mirror of
http://10.0.2.1:3031/sauer/claude-code.git
synced 2026-06-30 16:56:58 +10:00
167 lines
16 KiB
TypeScript
167 lines
16 KiB
TypeScript
|
|
import { c as _c } from "react/compiler-runtime";
|
||
|
|
import React from 'react';
|
||
|
|
import { envDynamic } from 'src/utils/envDynamic.js';
|
||
|
|
import { Box, Text } from '../ink.js';
|
||
|
|
import { useKeybindings } from '../keybindings/useKeybinding.js';
|
||
|
|
import { getGlobalConfig, saveGlobalConfig } from '../utils/config.js';
|
||
|
|
import { env } from '../utils/env.js';
|
||
|
|
import { getTerminalIdeType, type IDEExtensionInstallationStatus, isJetBrainsIde, toIDEDisplayName } from '../utils/ide.js';
|
||
|
|
import { Dialog } from './design-system/Dialog.js';
|
||
|
|
interface Props {
|
||
|
|
onDone: () => void;
|
||
|
|
installationStatus: IDEExtensionInstallationStatus | null;
|
||
|
|
}
|
||
|
|
export function IdeOnboardingDialog(t0) {
|
||
|
|
const $ = _c(23);
|
||
|
|
const {
|
||
|
|
onDone,
|
||
|
|
installationStatus
|
||
|
|
} = t0;
|
||
|
|
markDialogAsShown();
|
||
|
|
let t1;
|
||
|
|
if ($[0] !== onDone) {
|
||
|
|
t1 = {
|
||
|
|
"confirm:yes": onDone,
|
||
|
|
"confirm:no": onDone
|
||
|
|
};
|
||
|
|
$[0] = onDone;
|
||
|
|
$[1] = t1;
|
||
|
|
} else {
|
||
|
|
t1 = $[1];
|
||
|
|
}
|
||
|
|
let t2;
|
||
|
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t2 = {
|
||
|
|
context: "Confirmation"
|
||
|
|
};
|
||
|
|
$[2] = t2;
|
||
|
|
} else {
|
||
|
|
t2 = $[2];
|
||
|
|
}
|
||
|
|
useKeybindings(t1, t2);
|
||
|
|
let t3;
|
||
|
|
if ($[3] !== installationStatus?.ideType) {
|
||
|
|
t3 = installationStatus?.ideType ?? getTerminalIdeType();
|
||
|
|
$[3] = installationStatus?.ideType;
|
||
|
|
$[4] = t3;
|
||
|
|
} else {
|
||
|
|
t3 = $[4];
|
||
|
|
}
|
||
|
|
const ideType = t3;
|
||
|
|
const isJetBrains = isJetBrainsIde(ideType);
|
||
|
|
let t4;
|
||
|
|
if ($[5] !== ideType) {
|
||
|
|
t4 = toIDEDisplayName(ideType);
|
||
|
|
$[5] = ideType;
|
||
|
|
$[6] = t4;
|
||
|
|
} else {
|
||
|
|
t4 = $[6];
|
||
|
|
}
|
||
|
|
const ideName = t4;
|
||
|
|
const installedVersion = installationStatus?.installedVersion;
|
||
|
|
const pluginOrExtension = isJetBrains ? "plugin" : "extension";
|
||
|
|
const mentionShortcut = env.platform === "darwin" ? "Cmd+Option+K" : "Ctrl+Alt+K";
|
||
|
|
let t5;
|
||
|
|
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t5 = <Text color="claude">✻ </Text>;
|
||
|
|
$[7] = t5;
|
||
|
|
} else {
|
||
|
|
t5 = $[7];
|
||
|
|
}
|
||
|
|
let t6;
|
||
|
|
if ($[8] !== ideName) {
|
||
|
|
t6 = <>{t5}<Text>Welcome to Claude Code for {ideName}</Text></>;
|
||
|
|
$[8] = ideName;
|
||
|
|
$[9] = t6;
|
||
|
|
} else {
|
||
|
|
t6 = $[9];
|
||
|
|
}
|
||
|
|
const t7 = installedVersion ? `installed ${pluginOrExtension} v${installedVersion}` : undefined;
|
||
|
|
let t8;
|
||
|
|
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t8 = <Text color="suggestion">⧉ open files</Text>;
|
||
|
|
$[10] = t8;
|
||
|
|
} else {
|
||
|
|
t8 = $[10];
|
||
|
|
}
|
||
|
|
let t9;
|
||
|
|
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t9 = <Text>• Claude has context of {t8}{" "}and <Text color="suggestion">⧉ selected lines</Text></Text>;
|
||
|
|
$[11] = t9;
|
||
|
|
} else {
|
||
|
|
t9 = $[11];
|
||
|
|
}
|
||
|
|
let t10;
|
||
|
|
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t10 = <Text color="diffAddedWord">+11</Text>;
|
||
|
|
$[12] = t10;
|
||
|
|
} else {
|
||
|
|
t10 = $[12];
|
||
|
|
}
|
||
|
|
let t11;
|
||
|
|
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t11 = <Text>• Review Claude Code's changes{" "}{t10}{" "}<Text color="diffRemovedWord">-22</Text> in the comfort of your IDE</Text>;
|
||
|
|
$[13] = t11;
|
||
|
|
} else {
|
||
|
|
t11 = $[13];
|
||
|
|
}
|
||
|
|
let t12;
|
||
|
|
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t12 = <Text>• Cmd+Esc<Text dimColor={true}> for Quick Launch</Text></Text>;
|
||
|
|
$[14] = t12;
|
||
|
|
} else {
|
||
|
|
t12 = $[14];
|
||
|
|
}
|
||
|
|
let t13;
|
||
|
|
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t13 = <Box flexDirection="column" gap={1}>{t9}{t11}{t12}<Text>• {mentionShortcut}<Text dimColor={true}> to reference files or lines in your input</Text></Text></Box>;
|
||
|
|
$[15] = t13;
|
||
|
|
} else {
|
||
|
|
t13 = $[15];
|
||
|
|
}
|
||
|
|
let t14;
|
||
|
|
if ($[16] !== onDone || $[17] !== t6 || $[18] !== t7) {
|
||
|
|
t14 = <Dialog title={t6} subtitle={t7} color="ide" onCancel={onDone} hideInputGuide={true}>{t13}</Dialog>;
|
||
|
|
$[16] = onDone;
|
||
|
|
$[17] = t6;
|
||
|
|
$[18] = t7;
|
||
|
|
$[19] = t14;
|
||
|
|
} else {
|
||
|
|
t14 = $[19];
|
||
|
|
}
|
||
|
|
let t15;
|
||
|
|
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
||
|
|
t15 = <Box paddingX={1}><Text dimColor={true} italic={true}>Press Enter to continue</Text></Box>;
|
||
|
|
$[20] = t15;
|
||
|
|
} else {
|
||
|
|
t15 = $[20];
|
||
|
|
}
|
||
|
|
let t16;
|
||
|
|
if ($[21] !== t14) {
|
||
|
|
t16 = <>{t14}{t15}</>;
|
||
|
|
$[21] = t14;
|
||
|
|
$[22] = t16;
|
||
|
|
} else {
|
||
|
|
t16 = $[22];
|
||
|
|
}
|
||
|
|
return t16;
|
||
|
|
}
|
||
|
|
export function hasIdeOnboardingDialogBeenShown(): boolean {
|
||
|
|
const config = getGlobalConfig();
|
||
|
|
const terminal = envDynamic.terminal || 'unknown';
|
||
|
|
return config.hasIdeOnboardingBeenShown?.[terminal] === true;
|
||
|
|
}
|
||
|
|
function markDialogAsShown(): void {
|
||
|
|
if (hasIdeOnboardingDialogBeenShown()) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
const terminal = envDynamic.terminal || 'unknown';
|
||
|
|
saveGlobalConfig(current => ({
|
||
|
|
...current,
|
||
|
|
hasIdeOnboardingBeenShown: {
|
||
|
|
...current.hasIdeOnboardingBeenShown,
|
||
|
|
[terminal]: true
|
||
|
|
}
|
||
|
|
}));
|
||
|
|
}
|
||
|
|
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJSZWFjdCIsImVudkR5bmFtaWMiLCJCb3giLCJUZXh0IiwidXNlS2V5YmluZGluZ3MiLCJnZXRHbG9iYWxDb25maWciLCJzYXZlR2xvYmFsQ29uZmlnIiwiZW52IiwiZ2V0VGVybWluYWxJZGVUeXBlIiwiSURFRXh0ZW5zaW9uSW5zdGFsbGF0aW9uU3RhdHVzIiwiaXNKZXRCcmFpbnNJZGUiLCJ0b0lERURpc3BsYXlOYW1lIiwiRGlhbG9nIiwiUHJvcHMiLCJvbkRvbmUiLCJpbnN0YWxsYXRpb25TdGF0dXMiLCJJZGVPbmJvYXJkaW5nRGlhbG9nIiwidDAiLCIkIiwiX2MiLCJtYXJrRGlhbG9nQXNTaG93biIsInQxIiwidDIiLCJTeW1ib2wiLCJmb3I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0cmwrQWx0K0snXG5cbiAgcmV0dXJuIChcbiAgICA8PlxuICAgICAgPERpYWxvZ1xuICAgICAgICB0aXRsZT17XG4gICAgICAgICAgPD5cbiAgICAgICAgICAgIDxUZXh0IGNvbG9yPVwiY2xhdWRlXCI+4py7IDwvVGV4dD5cbiAgICAgICAgICAgIDxUZXh0PldlbGNvbWUgdG8gQ2xhdWRlIENvZGUgZm9yIHtpZGVOYW1lfTwvVGV4dD5cbiAgICAgICAgICA8Lz5cbiAgICAgICAgfVxuICAgICAgICBzdWJ0aXRsZT17XG4gICAgICAgICAgaW5zdGFsbGVkVmVyc2lvblxuICAgICAgICAgICAgPyBgaW5zdGFsbGVkICR7cGx1Z2luT3JFeHRlbnNpb259IHYke2luc3RhbGxlZFZlcnNpb259YFxuICAgICAgICAgICAgOiB1bmRlZmluZWRcbiAgICAgICAgfVxuICAgICAgICBjb2xvcj1cImlkZVwiXG4gICAgICAgIG9uQ2FuY2VsPXtvbkRvbmV9XG4gICAgICAgIGhpZGVJbnB1dEd1aWRlXG4gICAgICA+XG4gICAgICAgIDxCb3ggZmxleERpcmVjdGlvbj1cImNvbHVtblwiIGdhcD17MX0+XG4gICAgICAgICAgPFRleHQ+XG4gICAgICAgICAgICDigKIgQ2xhdWRlIGhhcyBjb250ZXh0IG9mIDxUZXh0IGNvbG9yPVwic3VnZ2VzdGlvblwiPuKniSBvcGVuIGZpbGVzPC9UZXh0PnsnICd9XG4gICAgICAgICAgICBhbmQgPFRleHQgY29sb3I9XCJzdWdnZXN0aW9uXCI+4qeJIHNlbGVjdGVkIGxpbmVzPC9UZXh0PlxuICAgICAgICAgIDwvVGV4dD5cbiAgICAgICAgICA8VGV4dD5cbiAgICAgICAgICAgIOKAoiBSZXZpZXcgQ2xhdWRlIENvZGUmYXBvcztzIGNoYW5nZXN7JyAnfVxuICAgICAgICAgICAgPFRleHQgY29sb3I9XCJkaWZmQWRkZWRXb3JkXCI+KzExPC9UZXh0PnsnICd9XG4gICAgICAgICAgICA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