@qwen-code/qwen-code 0.0.2 → 0.0.4-nightly.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +6 -4
- package/dist/qwen-code-qwen-code-0.0.3.tgz +0 -0
- package/dist/src/acp/acp.d.ts +208 -0
- package/dist/src/acp/acp.js +193 -0
- package/dist/src/acp/acp.js.map +1 -0
- package/dist/src/acp/acpPeer.d.ts +8 -0
- package/dist/src/acp/acpPeer.js +537 -0
- package/dist/src/acp/acpPeer.js.map +1 -0
- package/dist/src/config/config.d.ts +5 -2
- package/dist/src/config/config.js +70 -28
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +2 -2
- package/dist/src/config/extension.js +21 -16
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/settings.d.ts +22 -15
- package/dist/src/config/settings.js +25 -10
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.d.ts +1 -0
- package/dist/src/gemini.js +31 -49
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +1 -1
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.js +0 -67
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/patches/is-in-ci.d.ts +7 -0
- package/dist/src/patches/is-in-ci.js +15 -0
- package/dist/src/patches/is-in-ci.js.map +1 -0
- package/dist/src/services/BuiltinCommandLoader.d.ts +24 -0
- package/dist/src/services/BuiltinCommandLoader.js +72 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -0
- package/dist/src/services/CommandService.d.ts +43 -5
- package/dist/src/services/CommandService.js +61 -25
- package/dist/src/services/CommandService.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +37 -0
- package/dist/src/services/FileCommandLoader.js +179 -0
- package/dist/src/services/FileCommandLoader.js.map +1 -0
- package/dist/src/services/McpPromptLoader.d.ts +25 -0
- package/dist/src/services/McpPromptLoader.js +192 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -0
- package/dist/src/services/prompt-processors/argumentProcessor.d.ts +21 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js +28 -0
- package/dist/src/services/prompt-processors/argumentProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +32 -0
- package/dist/src/services/prompt-processors/shellProcessor.js +77 -0
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/types.d.ts +38 -0
- package/dist/src/services/prompt-processors/types.js +14 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -0
- package/dist/src/services/types.d.ts +22 -0
- package/dist/src/services/types.js +7 -0
- package/dist/src/services/types.js.map +1 -0
- package/dist/src/ui/App.js +130 -101
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/colors.js +6 -0
- package/dist/src/ui/colors.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +2 -0
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/authCommand.js +2 -0
- package/dist/src/ui/commands/authCommand.js.map +1 -1
- package/dist/src/ui/commands/bugCommand.d.ts +7 -0
- package/dist/src/ui/commands/bugCommand.js +63 -0
- package/dist/src/ui/commands/bugCommand.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.d.ts +7 -0
- package/dist/src/ui/commands/chatCommand.js +179 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -0
- package/dist/src/ui/commands/clearCommand.js +14 -2
- package/dist/src/ui/commands/clearCommand.js.map +1 -1
- package/dist/src/ui/commands/compressCommand.d.ts +7 -0
- package/dist/src/ui/commands/compressCommand.js +64 -0
- package/dist/src/ui/commands/compressCommand.js.map +1 -0
- package/dist/src/ui/commands/copyCommand.d.ts +7 -0
- package/dist/src/ui/commands/copyCommand.js +59 -0
- package/dist/src/ui/commands/copyCommand.js.map +1 -0
- package/dist/src/ui/commands/corgiCommand.d.ts +7 -0
- package/dist/src/ui/commands/corgiCommand.js +15 -0
- package/dist/src/ui/commands/corgiCommand.js.map +1 -0
- package/dist/src/ui/commands/docsCommand.d.ts +7 -0
- package/dist/src/ui/commands/docsCommand.js +31 -0
- package/dist/src/ui/commands/docsCommand.js.map +1 -0
- package/dist/src/ui/commands/editorCommand.d.ts +7 -0
- package/dist/src/ui/commands/editorCommand.js +16 -0
- package/dist/src/ui/commands/editorCommand.js.map +1 -0
- package/dist/src/ui/commands/extensionsCommand.d.ts +7 -0
- package/dist/src/ui/commands/extensionsCommand.js +31 -0
- package/dist/src/ui/commands/extensionsCommand.js.map +1 -0
- package/dist/src/ui/commands/helpCommand.js +4 -2
- package/dist/src/ui/commands/helpCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.d.ts +8 -0
- package/dist/src/ui/commands/ideCommand.js +121 -0
- package/dist/src/ui/commands/ideCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.d.ts +7 -0
- package/dist/src/ui/commands/mcpCommand.js +425 -0
- package/dist/src/ui/commands/mcpCommand.js.map +1 -0
- package/dist/src/ui/commands/memoryCommand.js +11 -4
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/privacyCommand.js +2 -0
- package/dist/src/ui/commands/privacyCommand.js.map +1 -1
- package/dist/src/ui/commands/quitCommand.d.ts +7 -0
- package/dist/src/ui/commands/quitCommand.js +34 -0
- package/dist/src/ui/commands/quitCommand.js.map +1 -0
- package/dist/src/ui/commands/restoreCommand.d.ts +8 -0
- package/dist/src/ui/commands/restoreCommand.js +128 -0
- package/dist/src/ui/commands/restoreCommand.js.map +1 -0
- package/dist/src/ui/commands/statsCommand.d.ts +7 -0
- package/dist/src/ui/commands/statsCommand.js +54 -0
- package/dist/src/ui/commands/statsCommand.js.map +1 -0
- package/dist/src/ui/commands/themeCommand.js +2 -0
- package/dist/src/ui/commands/themeCommand.js.map +1 -1
- package/dist/src/ui/commands/toolsCommand.d.ts +7 -0
- package/dist/src/ui/commands/toolsCommand.js +56 -0
- package/dist/src/ui/commands/toolsCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +76 -4
- package/dist/src/ui/commands/types.js +6 -1
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/vimCommand.d.ts +7 -0
- package/dist/src/ui/commands/vimCommand.js +23 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -0
- package/dist/src/ui/components/AuthDialog.js +0 -1
- package/dist/src/ui/components/AuthDialog.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +6 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +46 -19
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/Footer.d.ts +1 -0
- package/dist/src/ui/components/Footer.js +2 -2
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.js +1 -1
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.d.ts +1 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +11 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.js +19 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -0
- package/dist/src/ui/components/InputPrompt.d.ts +3 -1
- package/dist/src/ui/components/InputPrompt.js +86 -123
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +15 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js +44 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/ThemeDialog.js +51 -25
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/Tips.js +1 -1
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/messages/DiffRenderer.d.ts +1 -0
- package/dist/src/ui/components/messages/DiffRenderer.js +12 -11
- package/dist/src/ui/components/messages/DiffRenderer.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +5 -4
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js +3 -1
- package/dist/src/ui/components/messages/ToolGroupMessage.js.map +1 -1
- package/dist/src/ui/components/shared/MaxSizedBox.js +69 -2
- package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.d.ts +3 -1
- package/dist/src/ui/components/shared/RadioButtonSelect.js +69 -50
- package/dist/src/ui/components/shared/RadioButtonSelect.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +273 -3
- package/dist/src/ui/components/shared/text-buffer.js +426 -80
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +72 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js +565 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
- package/dist/src/ui/constants.d.ts +1 -0
- package/dist/src/ui/constants.js +1 -0
- package/dist/src/ui/constants.js.map +1 -1
- package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
- package/dist/src/ui/contexts/VimModeContext.js +48 -0
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +54 -15
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +2 -1
- package/dist/src/ui/hooks/shellCommandProcessor.js +154 -177
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +9 -12
- package/dist/src/ui/hooks/slashCommandProcessor.js +203 -880
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.js +2 -1
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +4 -1
- package/dist/src/ui/hooks/useCompletion.js +137 -24
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.js +53 -37
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
- package/dist/src/ui/hooks/useFocus.d.ts +6 -0
- package/dist/src/ui/hooks/useFocus.js +41 -0
- package/dist/src/ui/hooks/useFocus.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.js +57 -11
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useInputHistory.d.ts +1 -1
- package/dist/src/ui/hooks/useKeypress.js +5 -2
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/usePrivacySettings.js +5 -5
- package/dist/src/ui/hooks/usePrivacySettings.js.map +1 -1
- package/dist/src/ui/hooks/useShellHistory.d.ts +3 -2
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useThemeCommand.js +24 -23
- package/dist/src/ui/hooks/useThemeCommand.js.map +1 -1
- package/dist/src/ui/hooks/vim.d.ts +28 -0
- package/dist/src/ui/hooks/vim.js +630 -0
- package/dist/src/ui/hooks/vim.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.js +3 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +2 -0
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +2 -0
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +3 -1
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +3 -1
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/color-utils.d.ts +21 -0
- package/dist/src/ui/themes/color-utils.js +221 -0
- package/dist/src/ui/themes/color-utils.js.map +1 -0
- package/dist/src/ui/themes/dracula.js +2 -0
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +2 -0
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +2 -0
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +3 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +3 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/qwen-dark.js +2 -0
- package/dist/src/ui/themes/qwen-dark.js.map +1 -1
- package/dist/src/ui/themes/qwen-light.js +2 -0
- package/dist/src/ui/themes/qwen-light.js.map +1 -1
- package/dist/src/ui/themes/shades-of-purple.d.ts +1 -1
- package/dist/src/ui/themes/shades-of-purple.js +3 -1
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +31 -6
- package/dist/src/ui/themes/theme-manager.js +114 -37
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +23 -3
- package/dist/src/ui/themes/theme.js +244 -182
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +3 -1
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +9 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +3 -1
- package/dist/src/ui/utils/CodeColorizer.js +23 -11
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +1 -0
- package/dist/src/ui/utils/commandUtils.js +47 -0
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/errorParsing.js.map +1 -1
- package/dist/src/ui/utils/markdownUtilities.js +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +0 -8
- package/dist/src/ui/utils/textUtils.js +0 -22
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.js +5 -1
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/events.d.ts +11 -0
- package/dist/src/utils/events.js +13 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/sandbox.js +7 -3
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/userStartupWarnings.js +16 -10
- package/dist/src/utils/userStartupWarnings.js.map +1 -1
- package/dist/src/validateNonInterActiveAuth.d.ts +7 -0
- package/dist/src/validateNonInterActiveAuth.js +38 -0
- package/dist/src/validateNonInterActiveAuth.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -5
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
* Copyright 2025 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
|
-
import { useEffect, useState } from 'react';
|
|
7
|
+
import { useEffect, useState, useRef } from 'react';
|
|
8
8
|
import { Text, Box, useInput } from 'ink';
|
|
9
9
|
import { Colors } from '../../colors.js';
|
|
10
10
|
/**
|
|
@@ -13,22 +13,11 @@ import { Colors } from '../../colors.js';
|
|
|
13
13
|
*
|
|
14
14
|
* @template T The type of the value associated with each radio item.
|
|
15
15
|
*/
|
|
16
|
-
export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlight, isFocused, showScrollArrows = false, maxItemsToShow = 10, }) {
|
|
17
|
-
|
|
18
|
-
const safeInitialIndex = items.length > 0
|
|
19
|
-
? Math.max(0, Math.min(initialIndex, items.length - 1))
|
|
20
|
-
: 0;
|
|
21
|
-
const [activeIndex, setActiveIndex] = useState(safeInitialIndex);
|
|
16
|
+
export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlight, isFocused, showScrollArrows = false, maxItemsToShow = 10, showNumbers = true, }) {
|
|
17
|
+
const [activeIndex, setActiveIndex] = useState(initialIndex);
|
|
22
18
|
const [scrollOffset, setScrollOffset] = useState(0);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (items.length === 0) {
|
|
26
|
-
setActiveIndex(0);
|
|
27
|
-
}
|
|
28
|
-
else if (activeIndex >= items.length) {
|
|
29
|
-
setActiveIndex(Math.max(0, items.length - 1));
|
|
30
|
-
}
|
|
31
|
-
}, [items.length, activeIndex]);
|
|
19
|
+
const [numberInput, setNumberInput] = useState('');
|
|
20
|
+
const numberInputTimer = useRef(null);
|
|
32
21
|
useEffect(() => {
|
|
33
22
|
const newScrollOffset = Math.max(0, Math.min(activeIndex - maxItemsToShow + 1, items.length - maxItemsToShow));
|
|
34
23
|
if (activeIndex < scrollOffset) {
|
|
@@ -38,61 +27,91 @@ export function RadioButtonSelect({ items, initialIndex = 0, onSelect, onHighlig
|
|
|
38
27
|
setScrollOffset(newScrollOffset);
|
|
39
28
|
}
|
|
40
29
|
}, [activeIndex, items.length, scrollOffset, maxItemsToShow]);
|
|
30
|
+
useEffect(() => () => {
|
|
31
|
+
if (numberInputTimer.current) {
|
|
32
|
+
clearTimeout(numberInputTimer.current);
|
|
33
|
+
}
|
|
34
|
+
}, []);
|
|
41
35
|
useInput((input, key) => {
|
|
36
|
+
const isNumeric = showNumbers && /^[0-9]$/.test(input);
|
|
37
|
+
// Any key press that is not a digit should clear the number input buffer.
|
|
38
|
+
if (!isNumeric && numberInputTimer.current) {
|
|
39
|
+
clearTimeout(numberInputTimer.current);
|
|
40
|
+
setNumberInput('');
|
|
41
|
+
}
|
|
42
42
|
if (input === 'k' || key.upArrow) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
onHighlight?.(items[newIndex].value);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
43
|
+
const newIndex = activeIndex > 0 ? activeIndex - 1 : items.length - 1;
|
|
44
|
+
setActiveIndex(newIndex);
|
|
45
|
+
onHighlight?.(items[newIndex].value);
|
|
46
|
+
return;
|
|
50
47
|
}
|
|
51
48
|
if (input === 'j' || key.downArrow) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
onHighlight?.(items[newIndex].value);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
49
|
+
const newIndex = activeIndex < items.length - 1 ? activeIndex + 1 : 0;
|
|
50
|
+
setActiveIndex(newIndex);
|
|
51
|
+
onHighlight?.(items[newIndex].value);
|
|
52
|
+
return;
|
|
59
53
|
}
|
|
60
54
|
if (key.return) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
activeIndex < items.length &&
|
|
64
|
-
items[activeIndex]) {
|
|
65
|
-
onSelect(items[activeIndex].value);
|
|
66
|
-
}
|
|
55
|
+
onSelect(items[activeIndex].value);
|
|
56
|
+
return;
|
|
67
57
|
}
|
|
68
|
-
//
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
58
|
+
// Handle numeric input for selection.
|
|
59
|
+
if (isNumeric) {
|
|
60
|
+
if (numberInputTimer.current) {
|
|
61
|
+
clearTimeout(numberInputTimer.current);
|
|
62
|
+
}
|
|
63
|
+
const newNumberInput = numberInput + input;
|
|
64
|
+
setNumberInput(newNumberInput);
|
|
65
|
+
const targetIndex = Number.parseInt(newNumberInput, 10) - 1;
|
|
66
|
+
// A single '0' is not a valid selection since items are 1-indexed.
|
|
67
|
+
if (newNumberInput === '0') {
|
|
68
|
+
numberInputTimer.current = setTimeout(() => setNumberInput(''), 350);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (targetIndex >= 0 && targetIndex < items.length) {
|
|
72
|
+
const targetItem = items[targetIndex];
|
|
73
|
+
setActiveIndex(targetIndex);
|
|
74
|
+
onHighlight?.(targetItem.value);
|
|
75
|
+
// If the typed number can't be a prefix for another valid number,
|
|
76
|
+
// select it immediately. Otherwise, wait for more input.
|
|
77
|
+
const potentialNextNumber = Number.parseInt(newNumberInput + '0', 10);
|
|
78
|
+
if (potentialNextNumber > items.length) {
|
|
79
|
+
onSelect(targetItem.value);
|
|
80
|
+
setNumberInput('');
|
|
75
81
|
}
|
|
82
|
+
else {
|
|
83
|
+
numberInputTimer.current = setTimeout(() => {
|
|
84
|
+
onSelect(targetItem.value);
|
|
85
|
+
setNumberInput('');
|
|
86
|
+
}, 350); // Debounce time for multi-digit input.
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
// The typed number is out of bounds, clear the buffer
|
|
91
|
+
setNumberInput('');
|
|
76
92
|
}
|
|
77
93
|
}
|
|
78
|
-
}, {
|
|
79
|
-
isActive: isFocused &&
|
|
80
|
-
items.length > 0 &&
|
|
81
|
-
activeIndex >= 0 &&
|
|
82
|
-
activeIndex < items.length,
|
|
83
|
-
});
|
|
94
|
+
}, { isActive: isFocused && items.length > 0 });
|
|
84
95
|
const visibleItems = items.slice(scrollOffset, scrollOffset + maxItemsToShow);
|
|
85
96
|
return (_jsxs(Box, { flexDirection: "column", children: [showScrollArrows && (_jsx(Text, { color: scrollOffset > 0 ? Colors.Foreground : Colors.Gray, children: "\u25B2" })), visibleItems.map((item, index) => {
|
|
86
97
|
const itemIndex = scrollOffset + index;
|
|
87
98
|
const isSelected = activeIndex === itemIndex;
|
|
88
99
|
let textColor = Colors.Foreground;
|
|
100
|
+
let numberColor = Colors.Foreground;
|
|
89
101
|
if (isSelected) {
|
|
90
102
|
textColor = Colors.AccentGreen;
|
|
103
|
+
numberColor = Colors.AccentGreen;
|
|
91
104
|
}
|
|
92
105
|
else if (item.disabled) {
|
|
93
106
|
textColor = Colors.Gray;
|
|
107
|
+
numberColor = Colors.Gray;
|
|
108
|
+
}
|
|
109
|
+
if (!showNumbers) {
|
|
110
|
+
numberColor = Colors.Gray;
|
|
94
111
|
}
|
|
95
|
-
|
|
112
|
+
const numberColumnWidth = String(items.length).length;
|
|
113
|
+
const itemNumberText = `${String(itemIndex + 1).padStart(numberColumnWidth)}.`;
|
|
114
|
+
return (_jsxs(Box, { alignItems: "center", children: [_jsx(Box, { minWidth: 2, flexShrink: 0, children: _jsx(Text, { color: isSelected ? Colors.AccentGreen : Colors.Foreground, children: isSelected ? '●' : ' ' }) }), _jsx(Box, { marginRight: 1, flexShrink: 0, minWidth: itemNumberText.length, children: _jsx(Text, { color: numberColor, children: itemNumberText }) }), item.themeNameDisplay && item.themeTypeDisplay ? (_jsxs(Text, { color: textColor, wrap: "truncate", children: [item.themeNameDisplay, ' ', _jsx(Text, { color: Colors.Gray, children: item.themeTypeDisplay })] })) : (_jsx(Text, { color: textColor, wrap: "truncate", children: item.label }))] }, item.label));
|
|
96
115
|
}), showScrollArrows && (_jsx(Text, { color: scrollOffset + maxItemsToShow < items.length
|
|
97
116
|
? Colors.Foreground
|
|
98
117
|
: Colors.Gray, children: "\u25BC" }))] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtonSelect.js","sourceRoot":"","sources":["../../../../../src/ui/components/shared/RadioButtonSelect.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioButtonSelect.js","sourceRoot":"","sources":["../../../../../src/ui/components/shared/RadioButtonSelect.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAqCzC;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAI,EACnC,KAAK,EACL,YAAY,GAAG,CAAC,EAChB,QAAQ,EACR,WAAW,EACX,SAAS,EACT,gBAAgB,GAAG,KAAK,EACxB,cAAc,GAAG,EAAE,EACnB,WAAW,GAAG,IAAI,GACQ;IAC1B,MAAM,CAAC,WAAW,EAAE,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C,GAAG,GAClB,GACH,EACN,KAAC,GAAG,IACF,WAAW,EAAE,CAAC,EACd,UAAU,EAAE,CAAC,EACb,QAAQ,EAAE,cAAc,CAAC,MAAM,YAE/B,KAAC,IAAI,IAAC,KAAK,EAAE,WAAW,YAAG,cAAc,GAAQ,GAC7C,EACL,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAChD,MAAC,IAAI,IAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC,UAAU,aACpC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAC3B,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,YAAG,IAAI,CAAC,gBAAgB,GAAQ,IACnD,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAC,UAAU,YACpC,IAAI,CAAC,KAAK,GACN,CACR,KAtBO,IAAI,CAAC,KAAK,CAuBd,CACP,CAAC;YACJ,CAAC,CAAC,EACD,gBAAgB,IAAI,CACnB,KAAC,IAAI,IACH,KAAK,EACH,YAAY,GAAG,cAAc,GAAG,KAAK,CAAC,MAAM;oBAC1C,CAAC,CAAC,MAAM,CAAC,UAAU;oBACnB,CAAC,CAAC,MAAM,CAAC,IAAI,uBAIZ,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export type Direction = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRight' | 'home' | 'end';
|
|
7
|
+
export declare const findNextWordStart: (text: string, currentOffset: number) => number;
|
|
8
|
+
export declare const findPrevWordStart: (text: string, currentOffset: number) => number;
|
|
9
|
+
export declare const findWordEnd: (text: string, currentOffset: number) => number;
|
|
10
|
+
export declare const getOffsetFromPosition: (row: number, col: number, lines: string[]) => number;
|
|
11
|
+
export declare const getPositionFromOffsets: (startOffset: number, endOffset: number, lines: string[]) => {
|
|
12
|
+
startRow: number;
|
|
13
|
+
startCol: number;
|
|
14
|
+
endRow: number;
|
|
15
|
+
endCol: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const getLineRangeOffsets: (startRow: number, lineCount: number, lines: string[]) => {
|
|
18
|
+
startOffset: number;
|
|
19
|
+
endOffset: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const replaceRangeInternal: (state: TextBufferState, startRow: number, startCol: number, endRow: number, endCol: number, text: string) => TextBufferState;
|
|
7
22
|
export interface Viewport {
|
|
8
23
|
height: number;
|
|
9
24
|
width: number;
|
|
@@ -24,7 +39,12 @@ interface UndoHistoryEntry {
|
|
|
24
39
|
cursorCol: number;
|
|
25
40
|
}
|
|
26
41
|
export declare function offsetToLogicalPos(text: string, offset: number): [number, number];
|
|
27
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Converts logical row/col position to absolute text offset
|
|
44
|
+
* Inverse operation of offsetToLogicalPos
|
|
45
|
+
*/
|
|
46
|
+
export declare function logicalPosToOffset(lines: string[], row: number, col: number): number;
|
|
47
|
+
export interface TextBufferState {
|
|
28
48
|
lines: string[];
|
|
29
49
|
cursorRow: number;
|
|
30
50
|
cursorCol: number;
|
|
@@ -35,7 +55,8 @@ interface TextBufferState {
|
|
|
35
55
|
selectionAnchor: [number, number] | null;
|
|
36
56
|
viewportWidth: number;
|
|
37
57
|
}
|
|
38
|
-
|
|
58
|
+
export declare const pushUndo: (currentState: TextBufferState) => TextBufferState;
|
|
59
|
+
export type TextBufferAction = {
|
|
39
60
|
type: 'set_text';
|
|
40
61
|
payload: string;
|
|
41
62
|
pushToUndo?: boolean;
|
|
@@ -82,6 +103,125 @@ type TextBufferAction = {
|
|
|
82
103
|
} | {
|
|
83
104
|
type: 'set_viewport_width';
|
|
84
105
|
payload: number;
|
|
106
|
+
} | {
|
|
107
|
+
type: 'vim_delete_word_forward';
|
|
108
|
+
payload: {
|
|
109
|
+
count: number;
|
|
110
|
+
};
|
|
111
|
+
} | {
|
|
112
|
+
type: 'vim_delete_word_backward';
|
|
113
|
+
payload: {
|
|
114
|
+
count: number;
|
|
115
|
+
};
|
|
116
|
+
} | {
|
|
117
|
+
type: 'vim_delete_word_end';
|
|
118
|
+
payload: {
|
|
119
|
+
count: number;
|
|
120
|
+
};
|
|
121
|
+
} | {
|
|
122
|
+
type: 'vim_change_word_forward';
|
|
123
|
+
payload: {
|
|
124
|
+
count: number;
|
|
125
|
+
};
|
|
126
|
+
} | {
|
|
127
|
+
type: 'vim_change_word_backward';
|
|
128
|
+
payload: {
|
|
129
|
+
count: number;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
type: 'vim_change_word_end';
|
|
133
|
+
payload: {
|
|
134
|
+
count: number;
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
137
|
+
type: 'vim_delete_line';
|
|
138
|
+
payload: {
|
|
139
|
+
count: number;
|
|
140
|
+
};
|
|
141
|
+
} | {
|
|
142
|
+
type: 'vim_change_line';
|
|
143
|
+
payload: {
|
|
144
|
+
count: number;
|
|
145
|
+
};
|
|
146
|
+
} | {
|
|
147
|
+
type: 'vim_delete_to_end_of_line';
|
|
148
|
+
} | {
|
|
149
|
+
type: 'vim_change_to_end_of_line';
|
|
150
|
+
} | {
|
|
151
|
+
type: 'vim_change_movement';
|
|
152
|
+
payload: {
|
|
153
|
+
movement: 'h' | 'j' | 'k' | 'l';
|
|
154
|
+
count: number;
|
|
155
|
+
};
|
|
156
|
+
} | {
|
|
157
|
+
type: 'vim_move_left';
|
|
158
|
+
payload: {
|
|
159
|
+
count: number;
|
|
160
|
+
};
|
|
161
|
+
} | {
|
|
162
|
+
type: 'vim_move_right';
|
|
163
|
+
payload: {
|
|
164
|
+
count: number;
|
|
165
|
+
};
|
|
166
|
+
} | {
|
|
167
|
+
type: 'vim_move_up';
|
|
168
|
+
payload: {
|
|
169
|
+
count: number;
|
|
170
|
+
};
|
|
171
|
+
} | {
|
|
172
|
+
type: 'vim_move_down';
|
|
173
|
+
payload: {
|
|
174
|
+
count: number;
|
|
175
|
+
};
|
|
176
|
+
} | {
|
|
177
|
+
type: 'vim_move_word_forward';
|
|
178
|
+
payload: {
|
|
179
|
+
count: number;
|
|
180
|
+
};
|
|
181
|
+
} | {
|
|
182
|
+
type: 'vim_move_word_backward';
|
|
183
|
+
payload: {
|
|
184
|
+
count: number;
|
|
185
|
+
};
|
|
186
|
+
} | {
|
|
187
|
+
type: 'vim_move_word_end';
|
|
188
|
+
payload: {
|
|
189
|
+
count: number;
|
|
190
|
+
};
|
|
191
|
+
} | {
|
|
192
|
+
type: 'vim_delete_char';
|
|
193
|
+
payload: {
|
|
194
|
+
count: number;
|
|
195
|
+
};
|
|
196
|
+
} | {
|
|
197
|
+
type: 'vim_insert_at_cursor';
|
|
198
|
+
} | {
|
|
199
|
+
type: 'vim_append_at_cursor';
|
|
200
|
+
} | {
|
|
201
|
+
type: 'vim_open_line_below';
|
|
202
|
+
} | {
|
|
203
|
+
type: 'vim_open_line_above';
|
|
204
|
+
} | {
|
|
205
|
+
type: 'vim_append_at_line_end';
|
|
206
|
+
} | {
|
|
207
|
+
type: 'vim_insert_at_line_start';
|
|
208
|
+
} | {
|
|
209
|
+
type: 'vim_move_to_line_start';
|
|
210
|
+
} | {
|
|
211
|
+
type: 'vim_move_to_line_end';
|
|
212
|
+
} | {
|
|
213
|
+
type: 'vim_move_to_first_nonwhitespace';
|
|
214
|
+
} | {
|
|
215
|
+
type: 'vim_move_to_first_line';
|
|
216
|
+
} | {
|
|
217
|
+
type: 'vim_move_to_last_line';
|
|
218
|
+
} | {
|
|
219
|
+
type: 'vim_move_to_line';
|
|
220
|
+
payload: {
|
|
221
|
+
lineNumber: number;
|
|
222
|
+
};
|
|
223
|
+
} | {
|
|
224
|
+
type: 'vim_escape_insert_mode';
|
|
85
225
|
};
|
|
86
226
|
export declare function textBufferReducer(state: TextBufferState, action: TextBufferAction): TextBufferState;
|
|
87
227
|
export declare function useTextBuffer({ initialText, initialCursorOffset, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive, }: UseTextBufferProps): TextBuffer;
|
|
@@ -109,7 +249,9 @@ export interface TextBuffer {
|
|
|
109
249
|
/**
|
|
110
250
|
* Insert a single character or string without newlines.
|
|
111
251
|
*/
|
|
112
|
-
insert: (ch: string
|
|
252
|
+
insert: (ch: string, opts?: {
|
|
253
|
+
paste?: boolean;
|
|
254
|
+
}) => void;
|
|
113
255
|
newline: () => void;
|
|
114
256
|
backspace: () => void;
|
|
115
257
|
del: () => void;
|
|
@@ -180,5 +322,133 @@ export interface TextBuffer {
|
|
|
180
322
|
}) => Promise<void>;
|
|
181
323
|
replaceRangeByOffset: (startOffset: number, endOffset: number, replacementText: string) => void;
|
|
182
324
|
moveToOffset(offset: number): void;
|
|
325
|
+
/**
|
|
326
|
+
* Delete N words forward from cursor position (vim 'dw' command)
|
|
327
|
+
*/
|
|
328
|
+
vimDeleteWordForward: (count: number) => void;
|
|
329
|
+
/**
|
|
330
|
+
* Delete N words backward from cursor position (vim 'db' command)
|
|
331
|
+
*/
|
|
332
|
+
vimDeleteWordBackward: (count: number) => void;
|
|
333
|
+
/**
|
|
334
|
+
* Delete to end of N words from cursor position (vim 'de' command)
|
|
335
|
+
*/
|
|
336
|
+
vimDeleteWordEnd: (count: number) => void;
|
|
337
|
+
/**
|
|
338
|
+
* Change N words forward from cursor position (vim 'cw' command)
|
|
339
|
+
*/
|
|
340
|
+
vimChangeWordForward: (count: number) => void;
|
|
341
|
+
/**
|
|
342
|
+
* Change N words backward from cursor position (vim 'cb' command)
|
|
343
|
+
*/
|
|
344
|
+
vimChangeWordBackward: (count: number) => void;
|
|
345
|
+
/**
|
|
346
|
+
* Change to end of N words from cursor position (vim 'ce' command)
|
|
347
|
+
*/
|
|
348
|
+
vimChangeWordEnd: (count: number) => void;
|
|
349
|
+
/**
|
|
350
|
+
* Delete N lines from cursor position (vim 'dd' command)
|
|
351
|
+
*/
|
|
352
|
+
vimDeleteLine: (count: number) => void;
|
|
353
|
+
/**
|
|
354
|
+
* Change N lines from cursor position (vim 'cc' command)
|
|
355
|
+
*/
|
|
356
|
+
vimChangeLine: (count: number) => void;
|
|
357
|
+
/**
|
|
358
|
+
* Delete from cursor to end of line (vim 'D' command)
|
|
359
|
+
*/
|
|
360
|
+
vimDeleteToEndOfLine: () => void;
|
|
361
|
+
/**
|
|
362
|
+
* Change from cursor to end of line (vim 'C' command)
|
|
363
|
+
*/
|
|
364
|
+
vimChangeToEndOfLine: () => void;
|
|
365
|
+
/**
|
|
366
|
+
* Change movement operations (vim 'ch', 'cj', 'ck', 'cl' commands)
|
|
367
|
+
*/
|
|
368
|
+
vimChangeMovement: (movement: 'h' | 'j' | 'k' | 'l', count: number) => void;
|
|
369
|
+
/**
|
|
370
|
+
* Move cursor left N times (vim 'h' command)
|
|
371
|
+
*/
|
|
372
|
+
vimMoveLeft: (count: number) => void;
|
|
373
|
+
/**
|
|
374
|
+
* Move cursor right N times (vim 'l' command)
|
|
375
|
+
*/
|
|
376
|
+
vimMoveRight: (count: number) => void;
|
|
377
|
+
/**
|
|
378
|
+
* Move cursor up N times (vim 'k' command)
|
|
379
|
+
*/
|
|
380
|
+
vimMoveUp: (count: number) => void;
|
|
381
|
+
/**
|
|
382
|
+
* Move cursor down N times (vim 'j' command)
|
|
383
|
+
*/
|
|
384
|
+
vimMoveDown: (count: number) => void;
|
|
385
|
+
/**
|
|
386
|
+
* Move cursor forward N words (vim 'w' command)
|
|
387
|
+
*/
|
|
388
|
+
vimMoveWordForward: (count: number) => void;
|
|
389
|
+
/**
|
|
390
|
+
* Move cursor backward N words (vim 'b' command)
|
|
391
|
+
*/
|
|
392
|
+
vimMoveWordBackward: (count: number) => void;
|
|
393
|
+
/**
|
|
394
|
+
* Move cursor to end of Nth word (vim 'e' command)
|
|
395
|
+
*/
|
|
396
|
+
vimMoveWordEnd: (count: number) => void;
|
|
397
|
+
/**
|
|
398
|
+
* Delete N characters at cursor (vim 'x' command)
|
|
399
|
+
*/
|
|
400
|
+
vimDeleteChar: (count: number) => void;
|
|
401
|
+
/**
|
|
402
|
+
* Enter insert mode at cursor (vim 'i' command)
|
|
403
|
+
*/
|
|
404
|
+
vimInsertAtCursor: () => void;
|
|
405
|
+
/**
|
|
406
|
+
* Enter insert mode after cursor (vim 'a' command)
|
|
407
|
+
*/
|
|
408
|
+
vimAppendAtCursor: () => void;
|
|
409
|
+
/**
|
|
410
|
+
* Open new line below and enter insert mode (vim 'o' command)
|
|
411
|
+
*/
|
|
412
|
+
vimOpenLineBelow: () => void;
|
|
413
|
+
/**
|
|
414
|
+
* Open new line above and enter insert mode (vim 'O' command)
|
|
415
|
+
*/
|
|
416
|
+
vimOpenLineAbove: () => void;
|
|
417
|
+
/**
|
|
418
|
+
* Move to end of line and enter insert mode (vim 'A' command)
|
|
419
|
+
*/
|
|
420
|
+
vimAppendAtLineEnd: () => void;
|
|
421
|
+
/**
|
|
422
|
+
* Move to first non-whitespace and enter insert mode (vim 'I' command)
|
|
423
|
+
*/
|
|
424
|
+
vimInsertAtLineStart: () => void;
|
|
425
|
+
/**
|
|
426
|
+
* Move cursor to beginning of line (vim '0' command)
|
|
427
|
+
*/
|
|
428
|
+
vimMoveToLineStart: () => void;
|
|
429
|
+
/**
|
|
430
|
+
* Move cursor to end of line (vim '$' command)
|
|
431
|
+
*/
|
|
432
|
+
vimMoveToLineEnd: () => void;
|
|
433
|
+
/**
|
|
434
|
+
* Move cursor to first non-whitespace character (vim '^' command)
|
|
435
|
+
*/
|
|
436
|
+
vimMoveToFirstNonWhitespace: () => void;
|
|
437
|
+
/**
|
|
438
|
+
* Move cursor to first line (vim 'gg' command)
|
|
439
|
+
*/
|
|
440
|
+
vimMoveToFirstLine: () => void;
|
|
441
|
+
/**
|
|
442
|
+
* Move cursor to last line (vim 'G' command)
|
|
443
|
+
*/
|
|
444
|
+
vimMoveToLastLine: () => void;
|
|
445
|
+
/**
|
|
446
|
+
* Move cursor to specific line number (vim '[N]G' command)
|
|
447
|
+
*/
|
|
448
|
+
vimMoveToLine: (lineNumber: number) => void;
|
|
449
|
+
/**
|
|
450
|
+
* Handle escape from insert mode (moves cursor left if not at line start)
|
|
451
|
+
*/
|
|
452
|
+
vimEscapeInsertMode: () => void;
|
|
183
453
|
}
|
|
184
454
|
export {};
|