@deepseek-harness-tui/dsh-tui 0.5.0
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/LICENSE +21 -0
- package/README.md +235 -0
- package/bin/dsh-tui.js +95 -0
- package/cordis.patch.yml +218 -0
- package/cordis.yml +185 -0
- package/lib/invariant.js +28 -0
- package/lib/types/activityPrefs.d.ts +29 -0
- package/lib/types/activityPrefs.d.ts.map +1 -0
- package/lib/types/activityPrefs.js +60 -0
- package/lib/types/bootstrap/state.d.ts +13 -0
- package/lib/types/bootstrap/state.d.ts.map +1 -0
- package/lib/types/bootstrap/state.js +12 -0
- package/lib/types/cc/cliHighlight.d.ts +20 -0
- package/lib/types/cc/cliHighlight.d.ts.map +1 -0
- package/lib/types/cc/cliHighlight.js +53 -0
- package/lib/types/cc/figures.d.ts +59 -0
- package/lib/types/cc/figures.d.ts.map +1 -0
- package/lib/types/cc/figures.js +69 -0
- package/lib/types/cc/format.d.ts +26 -0
- package/lib/types/cc/format.d.ts.map +1 -0
- package/lib/types/cc/format.js +55 -0
- package/lib/types/cc/hash.d.ts +25 -0
- package/lib/types/cc/hash.d.ts.map +1 -0
- package/lib/types/cc/hash.js +41 -0
- package/lib/types/cc/hyperlink.d.ts +21 -0
- package/lib/types/cc/hyperlink.d.ts.map +1 -0
- package/lib/types/cc/hyperlink.js +31 -0
- package/lib/types/cc/markdown.d.ts +43 -0
- package/lib/types/cc/markdown.d.ts.map +1 -0
- package/lib/types/cc/markdown.js +345 -0
- package/lib/types/cc/spinnerVerbs.d.ts +3 -0
- package/lib/types/cc/spinnerVerbs.d.ts.map +1 -0
- package/lib/types/cc/spinnerVerbs.js +190 -0
- package/lib/types/cc/terminal.d.ts +15 -0
- package/lib/types/cc/terminal.d.ts.map +1 -0
- package/lib/types/cc/terminal.js +84 -0
- package/lib/types/channel.d.ts +672 -0
- package/lib/types/channel.d.ts.map +1 -0
- package/lib/types/channel.js +2427 -0
- package/lib/types/childStderr.d.ts +63 -0
- package/lib/types/childStderr.d.ts.map +1 -0
- package/lib/types/childStderr.js +161 -0
- package/lib/types/commands.d.ts +55 -0
- package/lib/types/commands.d.ts.map +1 -0
- package/lib/types/commands.js +101 -0
- package/lib/types/components/ActivityLine.d.ts +29 -0
- package/lib/types/components/ActivityLine.d.ts.map +1 -0
- package/lib/types/components/ActivityLine.js +47 -0
- package/lib/types/components/ActivityPicker.d.ts +13 -0
- package/lib/types/components/ActivityPicker.d.ts.map +1 -0
- package/lib/types/components/ActivityPicker.js +24 -0
- package/lib/types/components/CommandSuggestions.d.ts +14 -0
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -0
- package/lib/types/components/CommandSuggestions.js +33 -0
- package/lib/types/components/FileSuggestions.d.ts +12 -0
- package/lib/types/components/FileSuggestions.d.ts.map +1 -0
- package/lib/types/components/FileSuggestions.js +26 -0
- package/lib/types/components/GoalTodoPanel.d.ts +13 -0
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -0
- package/lib/types/components/GoalTodoPanel.js +57 -0
- package/lib/types/components/HelpMenu.d.ts +12 -0
- package/lib/types/components/HelpMenu.d.ts.map +1 -0
- package/lib/types/components/HelpMenu.js +12 -0
- package/lib/types/components/HistorySearchDialog.d.ts +16 -0
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -0
- package/lib/types/components/HistorySearchDialog.js +31 -0
- package/lib/types/components/InterruptedByUser.d.ts +7 -0
- package/lib/types/components/InterruptedByUser.d.ts.map +1 -0
- package/lib/types/components/InterruptedByUser.js +9 -0
- package/lib/types/components/LoadedContextPanel.d.ts +20 -0
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -0
- package/lib/types/components/LoadedContextPanel.js +30 -0
- package/lib/types/components/LogoV2.d.ts +23 -0
- package/lib/types/components/LogoV2.d.ts.map +1 -0
- package/lib/types/components/LogoV2.js +95 -0
- package/lib/types/components/Markdown.d.ts +24 -0
- package/lib/types/components/Markdown.d.ts.map +1 -0
- package/lib/types/components/Markdown.js +106 -0
- package/lib/types/components/MarkdownTable.d.ts +17 -0
- package/lib/types/components/MarkdownTable.d.ts.map +1 -0
- package/lib/types/components/MarkdownTable.js +272 -0
- package/lib/types/components/MessageList.d.ts +41 -0
- package/lib/types/components/MessageList.d.ts.map +1 -0
- package/lib/types/components/MessageList.js +303 -0
- package/lib/types/components/ModelPicker.d.ts +14 -0
- package/lib/types/components/ModelPicker.d.ts.map +1 -0
- package/lib/types/components/ModelPicker.js +15 -0
- package/lib/types/components/PresetPicker.d.ts +17 -0
- package/lib/types/components/PresetPicker.d.ts.map +1 -0
- package/lib/types/components/PresetPicker.js +25 -0
- package/lib/types/components/PromptInput.d.ts +67 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -0
- package/lib/types/components/PromptInput.js +778 -0
- package/lib/types/components/ResumePicker.d.ts +15 -0
- package/lib/types/components/ResumePicker.d.ts.map +1 -0
- package/lib/types/components/ResumePicker.js +34 -0
- package/lib/types/components/RewindPicker.d.ts +14 -0
- package/lib/types/components/RewindPicker.d.ts.map +1 -0
- package/lib/types/components/RewindPicker.js +23 -0
- package/lib/types/components/SearchBox.d.ts +20 -0
- package/lib/types/components/SearchBox.d.ts.map +1 -0
- package/lib/types/components/SearchBox.js +33 -0
- package/lib/types/components/Select.d.ts +22 -0
- package/lib/types/components/Select.d.ts.map +1 -0
- package/lib/types/components/Select.js +19 -0
- package/lib/types/components/Spinner/GlimmerMessage.d.ts +19 -0
- package/lib/types/components/Spinner/GlimmerMessage.d.ts.map +1 -0
- package/lib/types/components/Spinner/GlimmerMessage.js +78 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +31 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -0
- package/lib/types/components/Spinner/SpinnerAnimationRow.js +162 -0
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts +16 -0
- package/lib/types/components/Spinner/SpinnerGlyph.d.ts.map +1 -0
- package/lib/types/components/Spinner/SpinnerGlyph.js +36 -0
- package/lib/types/components/Spinner/spinnerMode.d.ts +6 -0
- package/lib/types/components/Spinner/spinnerMode.d.ts.map +1 -0
- package/lib/types/components/Spinner/spinnerMode.js +1 -0
- package/lib/types/components/Spinner/spinnerUtils.d.ts +41 -0
- package/lib/types/components/Spinner/spinnerUtils.d.ts.map +1 -0
- package/lib/types/components/Spinner/spinnerUtils.js +104 -0
- package/lib/types/components/Spinner/useStalledAnimation.d.ts +16 -0
- package/lib/types/components/Spinner/useStalledAnimation.d.ts.map +1 -0
- package/lib/types/components/Spinner/useStalledAnimation.js +71 -0
- package/lib/types/components/StreamingMarkdown.d.ts +12 -0
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -0
- package/lib/types/components/StreamingMarkdown.js +39 -0
- package/lib/types/components/ThemePicker.d.ts +22 -0
- package/lib/types/components/ThemePicker.d.ts.map +1 -0
- package/lib/types/components/ThemePicker.js +51 -0
- package/lib/types/components/ThinkingToggle.d.ts +17 -0
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -0
- package/lib/types/components/ThinkingToggle.js +30 -0
- package/lib/types/components/ToolUseLoader.d.ts +13 -0
- package/lib/types/components/ToolUseLoader.d.ts.map +1 -0
- package/lib/types/components/ToolUseLoader.js +17 -0
- package/lib/types/components/Whale.d.ts +22 -0
- package/lib/types/components/Whale.d.ts.map +1 -0
- package/lib/types/components/Whale.js +78 -0
- package/lib/types/components/WorkingSpinner.d.ts +26 -0
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -0
- package/lib/types/components/WorkingSpinner.js +68 -0
- package/lib/types/components/activityFrames.d.ts +31 -0
- package/lib/types/components/activityFrames.d.ts.map +1 -0
- package/lib/types/components/activityFrames.js +83 -0
- package/lib/types/components/bigfont.d.ts +28 -0
- package/lib/types/components/bigfont.d.ts.map +1 -0
- package/lib/types/components/bigfont.js +91 -0
- package/lib/types/components/design-system/Byline.d.ts +14 -0
- package/lib/types/components/design-system/Byline.d.ts.map +1 -0
- package/lib/types/components/design-system/Byline.js +17 -0
- package/lib/types/components/design-system/Divider.d.ts +40 -0
- package/lib/types/components/design-system/Divider.d.ts.map +1 -0
- package/lib/types/components/design-system/Divider.js +24 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts +19 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.d.ts.map +1 -0
- package/lib/types/components/design-system/KeyboardShortcutHint.js +14 -0
- package/lib/types/components/design-system/ListItem.d.ts +36 -0
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -0
- package/lib/types/components/design-system/ListItem.js +48 -0
- package/lib/types/components/design-system/LoadingState.d.ts +19 -0
- package/lib/types/components/design-system/LoadingState.d.ts.map +1 -0
- package/lib/types/components/design-system/LoadingState.js +22 -0
- package/lib/types/components/design-system/Pane.d.ts +17 -0
- package/lib/types/components/design-system/Pane.d.ts.map +1 -0
- package/lib/types/components/design-system/Pane.js +15 -0
- package/lib/types/components/design-system/ProgressBar.d.ts +22 -0
- package/lib/types/components/design-system/ProgressBar.d.ts.map +1 -0
- package/lib/types/components/design-system/ProgressBar.js +27 -0
- package/lib/types/components/design-system/StatusIcon.d.ts +15 -0
- package/lib/types/components/design-system/StatusIcon.d.ts.map +1 -0
- package/lib/types/components/design-system/StatusIcon.js +20 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts +11 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemeProvider.js +135 -0
- package/lib/types/components/design-system/ThemedBox.d.ts +37 -0
- package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemedBox.js +26 -0
- package/lib/types/components/design-system/ThemedText.d.ts +56 -0
- package/lib/types/components/design-system/ThemedText.d.ts.map +1 -0
- package/lib/types/components/design-system/ThemedText.js +45 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts +18 -0
- package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantTextMessage.js +15 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +23 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantThinkingMessage.js +23 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +23 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -0
- package/lib/types/components/messages/AssistantToolUseMessage.js +220 -0
- package/lib/types/components/messages/MessageMetadata.d.ts +15 -0
- package/lib/types/components/messages/MessageMetadata.d.ts.map +1 -0
- package/lib/types/components/messages/MessageMetadata.js +20 -0
- package/lib/types/components/messages/UserPromptMessage.d.ts +19 -0
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -0
- package/lib/types/components/messages/UserPromptMessage.js +15 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +39 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -0
- package/lib/types/components/questions/AskUserQuestionPanel.js +228 -0
- package/lib/types/components/shimmer.d.ts +35 -0
- package/lib/types/components/shimmer.d.ts.map +1 -0
- package/lib/types/components/shimmer.js +43 -0
- package/lib/types/components/whaleFrames.d.ts +25 -0
- package/lib/types/components/whaleFrames.d.ts.map +1 -0
- package/lib/types/components/whaleFrames.js +419 -0
- package/lib/types/customTheme.d.ts +104 -0
- package/lib/types/customTheme.d.ts.map +1 -0
- package/lib/types/customTheme.js +268 -0
- package/lib/types/effortPrefs.d.ts +22 -0
- package/lib/types/effortPrefs.d.ts.map +1 -0
- package/lib/types/effortPrefs.js +45 -0
- package/lib/types/history.d.ts +24 -0
- package/lib/types/history.d.ts.map +1 -0
- package/lib/types/history.js +75 -0
- package/lib/types/hooks/useBlink.d.ts +11 -0
- package/lib/types/hooks/useBlink.d.ts.map +1 -0
- package/lib/types/hooks/useBlink.js +20 -0
- package/lib/types/i18n.d.ts +926 -0
- package/lib/types/i18n.d.ts.map +1 -0
- package/lib/types/i18n.js +356 -0
- package/lib/types/index.d.ts +70 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +31 -0
- package/lib/types/ink/Ansi.d.ts +11 -0
- package/lib/types/ink/Ansi.d.ts.map +1 -0
- package/lib/types/ink/Ansi.js +269 -0
- package/lib/types/ink/bidi.d.ts +18 -0
- package/lib/types/ink/bidi.d.ts.map +1 -0
- package/lib/types/ink/bidi.js +119 -0
- package/lib/types/ink/clearTerminal.d.ts +22 -0
- package/lib/types/ink/clearTerminal.d.ts.map +1 -0
- package/lib/types/ink/clearTerminal.js +72 -0
- package/lib/types/ink/colorize.d.ts +33 -0
- package/lib/types/ink/colorize.d.ts.map +1 -0
- package/lib/types/ink/colorize.js +213 -0
- package/lib/types/ink/components/AlternateScreen.d.ts +22 -0
- package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -0
- package/lib/types/ink/components/AlternateScreen.js +74 -0
- package/lib/types/ink/components/App.d.ts +73 -0
- package/lib/types/ink/components/App.d.ts.map +1 -0
- package/lib/types/ink/components/App.js +597 -0
- package/lib/types/ink/components/AppContext.d.ts +15 -0
- package/lib/types/ink/components/AppContext.d.ts.map +1 -0
- package/lib/types/ink/components/AppContext.js +11 -0
- package/lib/types/ink/components/Box.d.ts +49 -0
- package/lib/types/ink/components/Box.d.ts.map +1 -0
- package/lib/types/ink/components/Box.js +153 -0
- package/lib/types/ink/components/Button.d.ts +37 -0
- package/lib/types/ink/components/Button.d.ts.map +1 -0
- package/lib/types/ink/components/Button.js +166 -0
- package/lib/types/ink/components/ClockContext.d.ts +10 -0
- package/lib/types/ink/components/ClockContext.d.ts.map +1 -0
- package/lib/types/ink/components/ClockContext.js +108 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts +30 -0
- package/lib/types/ink/components/CursorDeclarationContext.d.ts.map +1 -0
- package/lib/types/ink/components/CursorDeclarationContext.js +6 -0
- package/lib/types/ink/components/ErrorOverview.d.ts +7 -0
- package/lib/types/ink/components/ErrorOverview.d.ts.map +1 -0
- package/lib/types/ink/components/ErrorOverview.js +49 -0
- package/lib/types/ink/components/Link.d.ts +8 -0
- package/lib/types/ink/components/Link.d.ts.map +1 -0
- package/lib/types/ink/components/Link.js +33 -0
- package/lib/types/ink/components/Newline.d.ts +13 -0
- package/lib/types/ink/components/Newline.d.ts.map +1 -0
- package/lib/types/ink/components/Newline.js +29 -0
- package/lib/types/ink/components/NoSelect.d.ts +20 -0
- package/lib/types/ink/components/NoSelect.d.ts.map +1 -0
- package/lib/types/ink/components/NoSelect.js +56 -0
- package/lib/types/ink/components/RawAnsi.d.ts +17 -0
- package/lib/types/ink/components/RawAnsi.d.ts.map +1 -0
- package/lib/types/ink/components/RawAnsi.js +45 -0
- package/lib/types/ink/components/ScrollBox.d.ts +78 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -0
- package/lib/types/ink/components/ScrollBox.js +174 -0
- package/lib/types/ink/components/Spacer.d.ts +6 -0
- package/lib/types/ink/components/Spacer.d.ts.map +1 -0
- package/lib/types/ink/components/Spacer.js +19 -0
- package/lib/types/ink/components/StdinContext.d.ts +32 -0
- package/lib/types/ink/components/StdinContext.d.ts.map +1 -0
- package/lib/types/ink/components/StdinContext.js +16 -0
- package/lib/types/ink/components/TerminalFocusContext.d.ts +11 -0
- package/lib/types/ink/components/TerminalFocusContext.d.ts.map +1 -0
- package/lib/types/ink/components/TerminalFocusContext.js +45 -0
- package/lib/types/ink/components/TerminalSizeContext.d.ts +6 -0
- package/lib/types/ink/components/TerminalSizeContext.d.ts.map +1 -0
- package/lib/types/ink/components/TerminalSizeContext.js +3 -0
- package/lib/types/ink/components/Text.d.ts +56 -0
- package/lib/types/ink/components/Text.d.ts.map +1 -0
- package/lib/types/ink/components/Text.js +194 -0
- package/lib/types/ink/constants.d.ts +3 -0
- package/lib/types/ink/constants.d.ts.map +1 -0
- package/lib/types/ink/constants.js +2 -0
- package/lib/types/ink/cursor.d.ts +11 -0
- package/lib/types/ink/cursor.d.ts.map +1 -0
- package/lib/types/ink/cursor.js +1 -0
- package/lib/types/ink/devtools.d.ts +7 -0
- package/lib/types/ink/devtools.d.ts.map +1 -0
- package/lib/types/ink/devtools.js +1 -0
- package/lib/types/ink/dom.d.ts +178 -0
- package/lib/types/ink/dom.d.ts.map +1 -0
- package/lib/types/ink/dom.js +424 -0
- package/lib/types/ink/events/click-event.d.ts +32 -0
- package/lib/types/ink/events/click-event.d.ts.map +1 -0
- package/lib/types/ink/events/click-event.js +36 -0
- package/lib/types/ink/events/dispatcher.d.ts +63 -0
- package/lib/types/ink/events/dispatcher.d.ts.map +1 -0
- package/lib/types/ink/events/dispatcher.js +194 -0
- package/lib/types/ink/events/emitter.d.ts +20 -0
- package/lib/types/ink/events/emitter.d.ts.map +1 -0
- package/lib/types/ink/events/emitter.js +43 -0
- package/lib/types/ink/events/event-handlers.d.ts +47 -0
- package/lib/types/ink/events/event-handlers.d.ts.map +1 -0
- package/lib/types/ink/events/event-handlers.js +30 -0
- package/lib/types/ink/events/event.d.ts +19 -0
- package/lib/types/ink/events/event.d.ts.map +1 -0
- package/lib/types/ink/events/event.js +22 -0
- package/lib/types/ink/events/focus-event.d.ts +19 -0
- package/lib/types/ink/events/focus-event.d.ts.map +1 -0
- package/lib/types/ink/events/focus-event.js +21 -0
- package/lib/types/ink/events/input-event.d.ts +53 -0
- package/lib/types/ink/events/input-event.d.ts.map +1 -0
- package/lib/types/ink/events/input-event.js +180 -0
- package/lib/types/ink/events/keyboard-event.d.ts +40 -0
- package/lib/types/ink/events/keyboard-event.d.ts.map +1 -0
- package/lib/types/ink/events/keyboard-event.js +65 -0
- package/lib/types/ink/events/paste-event.d.ts +11 -0
- package/lib/types/ink/events/paste-event.d.ts.map +1 -0
- package/lib/types/ink/events/paste-event.js +13 -0
- package/lib/types/ink/events/resize-event.d.ts +13 -0
- package/lib/types/ink/events/resize-event.d.ts.map +1 -0
- package/lib/types/ink/events/resize-event.js +16 -0
- package/lib/types/ink/events/terminal-event.d.ts +112 -0
- package/lib/types/ink/events/terminal-event.d.ts.map +1 -0
- package/lib/types/ink/events/terminal-event.js +131 -0
- package/lib/types/ink/events/terminal-focus-event.d.ts +21 -0
- package/lib/types/ink/events/terminal-focus-event.d.ts.map +1 -0
- package/lib/types/ink/events/terminal-focus-event.js +18 -0
- package/lib/types/ink/focus.d.ts +74 -0
- package/lib/types/ink/focus.d.ts.map +1 -0
- package/lib/types/ink/focus.js +188 -0
- package/lib/types/ink/frame.d.ts +119 -0
- package/lib/types/ink/frame.d.ts.map +1 -0
- package/lib/types/ink/frame.js +43 -0
- package/lib/types/ink/get-max-width.d.ts +20 -0
- package/lib/types/ink/get-max-width.d.ts.map +1 -0
- package/lib/types/ink/get-max-width.js +25 -0
- package/lib/types/ink/hit-test.d.ts +47 -0
- package/lib/types/ink/hit-test.d.ts.map +1 -0
- package/lib/types/ink/hit-test.js +126 -0
- package/lib/types/ink/hooks/use-animation-frame.d.ts +27 -0
- package/lib/types/ink/hooks/use-animation-frame.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-animation-frame.js +48 -0
- package/lib/types/ink/hooks/use-app.d.ts +8 -0
- package/lib/types/ink/hooks/use-app.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-app.js +8 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts +22 -0
- package/lib/types/ink/hooks/use-copy-on-select.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-copy-on-select.js +40 -0
- package/lib/types/ink/hooks/use-declared-cursor.d.ts +31 -0
- package/lib/types/ink/hooks/use-declared-cursor.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-declared-cursor.js +65 -0
- package/lib/types/ink/hooks/use-input.d.ts +41 -0
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-input.js +73 -0
- package/lib/types/ink/hooks/use-interval.d.ts +23 -0
- package/lib/types/ink/hooks/use-interval.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-interval.js +58 -0
- package/lib/types/ink/hooks/use-search-highlight.d.ts +34 -0
- package/lib/types/ink/hooks/use-search-highlight.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-search-highlight.js +35 -0
- package/lib/types/ink/hooks/use-selection.d.ts +44 -0
- package/lib/types/ink/hooks/use-selection.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-selection.js +64 -0
- package/lib/types/ink/hooks/use-stdin.d.ts +8 -0
- package/lib/types/ink/hooks/use-stdin.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-stdin.js +8 -0
- package/lib/types/ink/hooks/use-tab-status.d.ts +18 -0
- package/lib/types/ink/hooks/use-tab-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-tab-status.js +58 -0
- package/lib/types/ink/hooks/use-terminal-focus.d.ts +11 -0
- package/lib/types/ink/hooks/use-terminal-focus.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-focus.js +15 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts +6 -0
- package/lib/types/ink/hooks/use-terminal-size.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-size.js +12 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts +14 -0
- package/lib/types/ink/hooks/use-terminal-title.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-title.js +30 -0
- package/lib/types/ink/hooks/use-terminal-viewport.d.ts +32 -0
- package/lib/types/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-terminal-viewport.js +79 -0
- package/lib/types/ink/ink.d.ts +370 -0
- package/lib/types/ink/ink.d.ts.map +1 -0
- package/lib/types/ink/ink.js +1665 -0
- package/lib/types/ink/instances.d.ts +10 -0
- package/lib/types/ink/instances.d.ts.map +1 -0
- package/lib/types/ink/instances.js +13 -0
- package/lib/types/ink/layout/engine.d.ts +7 -0
- package/lib/types/ink/layout/engine.d.ts.map +1 -0
- package/lib/types/ink/layout/engine.js +8 -0
- package/lib/types/ink/layout/geometry.d.ts +86 -0
- package/lib/types/ink/layout/geometry.d.ts.map +1 -0
- package/lib/types/ink/layout/geometry.js +95 -0
- package/lib/types/ink/layout/node.d.ts +151 -0
- package/lib/types/ink/layout/node.d.ts.map +1 -0
- package/lib/types/ink/layout/node.js +72 -0
- package/lib/types/ink/layout/yoga.d.ts +69 -0
- package/lib/types/ink/layout/yoga.d.ts.map +1 -0
- package/lib/types/ink/layout/yoga.js +249 -0
- package/lib/types/ink/line-width-cache.d.ts +9 -0
- package/lib/types/ink/line-width-cache.d.ts.map +1 -0
- package/lib/types/ink/line-width-cache.js +45 -0
- package/lib/types/ink/log-update.d.ts +57 -0
- package/lib/types/ink/log-update.d.ts.map +1 -0
- package/lib/types/ink/log-update.js +710 -0
- package/lib/types/ink/measure-element.d.ts +19 -0
- package/lib/types/ink/measure-element.d.ts.map +1 -0
- package/lib/types/ink/measure-element.js +10 -0
- package/lib/types/ink/measure-text.d.ts +13 -0
- package/lib/types/ink/measure-text.d.ts.map +1 -0
- package/lib/types/ink/measure-text.js +38 -0
- package/lib/types/ink/node-cache.d.ts +33 -0
- package/lib/types/ink/node-cache.d.ts.map +1 -0
- package/lib/types/ink/node-cache.js +42 -0
- package/lib/types/ink/optimizer.d.ts +18 -0
- package/lib/types/ink/optimizer.d.ts.map +1 -0
- package/lib/types/ink/optimizer.js +83 -0
- package/lib/types/ink/output.d.ts +200 -0
- package/lib/types/ink/output.d.ts.map +1 -0
- package/lib/types/ink/output.js +663 -0
- package/lib/types/ink/parse-keypress.d.ts +132 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -0
- package/lib/types/ink/parse-keypress.js +707 -0
- package/lib/types/ink/reconciler.d.ts +43 -0
- package/lib/types/ink/reconciler.d.ts.map +1 -0
- package/lib/types/ink/reconciler.js +413 -0
- package/lib/types/ink/render-border.d.ts +36 -0
- package/lib/types/ink/render-border.d.ts.map +1 -0
- package/lib/types/ink/render-border.js +143 -0
- package/lib/types/ink/render-node-to-output.d.ts +93 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -0
- package/lib/types/ink/render-node-to-output.js +1290 -0
- package/lib/types/ink/render-to-screen.d.ts +65 -0
- package/lib/types/ink/render-to-screen.d.ts.map +1 -0
- package/lib/types/ink/render-to-screen.js +189 -0
- package/lib/types/ink/renderer.d.ts +24 -0
- package/lib/types/ink/renderer.d.ts.map +1 -0
- package/lib/types/ink/renderer.js +136 -0
- package/lib/types/ink/root.d.ts +91 -0
- package/lib/types/ink/root.d.ts.map +1 -0
- package/lib/types/ink/root.js +93 -0
- package/lib/types/ink/screen.d.ts +443 -0
- package/lib/types/ink/screen.d.ts.map +1 -0
- package/lib/types/ink/screen.js +1295 -0
- package/lib/types/ink/searchHighlight.d.ts +25 -0
- package/lib/types/ink/searchHighlight.d.ts.map +1 -0
- package/lib/types/ink/searchHighlight.js +82 -0
- package/lib/types/ink/selection.d.ts +323 -0
- package/lib/types/ink/selection.d.ts.map +1 -0
- package/lib/types/ink/selection.js +881 -0
- package/lib/types/ink/squash-text-nodes.d.ts +30 -0
- package/lib/types/ink/squash-text-nodes.d.ts.map +1 -0
- package/lib/types/ink/squash-text-nodes.js +63 -0
- package/lib/types/ink/stringWidth.d.ts +11 -0
- package/lib/types/ink/stringWidth.d.ts.map +1 -0
- package/lib/types/ink/stringWidth.js +209 -0
- package/lib/types/ink/styles.d.ts +324 -0
- package/lib/types/ink/styles.d.ts.map +1 -0
- package/lib/types/ink/styles.js +307 -0
- package/lib/types/ink/supports-hyperlinks.d.ts +20 -0
- package/lib/types/ink/supports-hyperlinks.d.ts.map +1 -0
- package/lib/types/ink/supports-hyperlinks.js +44 -0
- package/lib/types/ink/tabstops.d.ts +9 -0
- package/lib/types/ink/tabstops.d.ts.map +1 -0
- package/lib/types/ink/tabstops.js +46 -0
- package/lib/types/ink/terminal-focus-state.d.ts +35 -0
- package/lib/types/ink/terminal-focus-state.d.ts.map +1 -0
- package/lib/types/ink/terminal-focus-state.js +57 -0
- package/lib/types/ink/terminal-querier.d.ts +161 -0
- package/lib/types/ink/terminal-querier.d.ts.map +1 -0
- package/lib/types/ink/terminal-querier.js +204 -0
- package/lib/types/ink/terminal.d.ts +80 -0
- package/lib/types/ink/terminal.d.ts.map +1 -0
- package/lib/types/ink/terminal.js +268 -0
- package/lib/types/ink/termio/ansi.d.ts +75 -0
- package/lib/types/ink/termio/ansi.d.ts.map +1 -0
- package/lib/types/ink/termio/ansi.js +79 -0
- package/lib/types/ink/termio/csi.d.ts +253 -0
- package/lib/types/ink/termio/csi.d.ts.map +1 -0
- package/lib/types/ink/termio/csi.js +347 -0
- package/lib/types/ink/termio/dec.d.ts +61 -0
- package/lib/types/ink/termio/dec.d.ts.map +1 -0
- package/lib/types/ink/termio/dec.js +76 -0
- package/lib/types/ink/termio/esc.d.ts +15 -0
- package/lib/types/ink/termio/esc.d.ts.map +1 -0
- package/lib/types/ink/termio/esc.js +57 -0
- package/lib/types/ink/termio/osc.d.ts +208 -0
- package/lib/types/ink/termio/osc.d.ts.map +1 -0
- package/lib/types/ink/termio/osc.js +466 -0
- package/lib/types/ink/termio/parser.d.ts +46 -0
- package/lib/types/ink/termio/parser.d.ts.map +1 -0
- package/lib/types/ink/termio/parser.js +366 -0
- package/lib/types/ink/termio/sgr.d.ts +17 -0
- package/lib/types/ink/termio/sgr.d.ts.map +1 -0
- package/lib/types/ink/termio/sgr.js +300 -0
- package/lib/types/ink/termio/tokenize.d.ts +50 -0
- package/lib/types/ink/termio/tokenize.d.ts.map +1 -0
- package/lib/types/ink/termio/tokenize.js +266 -0
- package/lib/types/ink/termio/types.d.ts +211 -0
- package/lib/types/ink/termio/types.d.ts.map +1 -0
- package/lib/types/ink/termio/types.js +68 -0
- package/lib/types/ink/termio.d.ts +25 -0
- package/lib/types/ink/termio.d.ts.map +1 -0
- package/lib/types/ink/termio.js +24 -0
- package/lib/types/ink/truncateToWidth.d.ts +7 -0
- package/lib/types/ink/truncateToWidth.d.ts.map +1 -0
- package/lib/types/ink/truncateToWidth.js +18 -0
- package/lib/types/ink/useTerminalNotification.d.ts +45 -0
- package/lib/types/ink/useTerminalNotification.d.ts.map +1 -0
- package/lib/types/ink/useTerminalNotification.js +70 -0
- package/lib/types/ink/warn.d.ts +7 -0
- package/lib/types/ink/warn.d.ts.map +1 -0
- package/lib/types/ink/warn.js +15 -0
- package/lib/types/ink/widest-line.d.ts +7 -0
- package/lib/types/ink/widest-line.d.ts.map +1 -0
- package/lib/types/ink/widest-line.js +19 -0
- package/lib/types/ink/wrap-text.d.ts +10 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -0
- package/lib/types/ink/wrap-text.js +61 -0
- package/lib/types/ink/wrapAnsi.d.ts +18 -0
- package/lib/types/ink/wrapAnsi.d.ts.map +1 -0
- package/lib/types/ink/wrapAnsi.js +16 -0
- package/lib/types/invariant.d.ts +20 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/invariant.js +26 -0
- package/lib/types/modelPrefs.d.ts +37 -0
- package/lib/types/modelPrefs.d.ts.map +1 -0
- package/lib/types/modelPrefs.js +66 -0
- package/lib/types/modelRoute.d.ts +79 -0
- package/lib/types/modelRoute.d.ts.map +1 -0
- package/lib/types/modelRoute.js +96 -0
- package/lib/types/native-ts/yoga-layout/enums.d.ts +183 -0
- package/lib/types/native-ts/yoga-layout/enums.d.ts.map +1 -0
- package/lib/types/native-ts/yoga-layout/enums.js +150 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts +788 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -0
- package/lib/types/native-ts/yoga-layout/index.js +2571 -0
- package/lib/types/packaged-skills.d.ts +10 -0
- package/lib/types/packaged-skills.d.ts.map +1 -0
- package/lib/types/packaged-skills.js +63 -0
- package/lib/types/plugin.d.ts +33 -0
- package/lib/types/plugin.d.ts.map +1 -0
- package/lib/types/plugin.js +454 -0
- package/lib/types/presetPrefs.d.ts +29 -0
- package/lib/types/presetPrefs.d.ts.map +1 -0
- package/lib/types/presetPrefs.js +61 -0
- package/lib/types/presets.d.ts +110 -0
- package/lib/types/presets.d.ts.map +1 -0
- package/lib/types/presets.js +114 -0
- package/lib/types/questions.d.ts +97 -0
- package/lib/types/questions.d.ts.map +1 -0
- package/lib/types/questions.js +201 -0
- package/lib/types/screens/Chat.d.ts +23 -0
- package/lib/types/screens/Chat.d.ts.map +1 -0
- package/lib/types/screens/Chat.js +1263 -0
- package/lib/types/screens/StatusLine.d.ts +16 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -0
- package/lib/types/screens/StatusLine.js +105 -0
- package/lib/types/screens/StatusMetrics.d.ts +87 -0
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -0
- package/lib/types/screens/StatusMetrics.js +252 -0
- package/lib/types/sessionHistory.d.ts +32 -0
- package/lib/types/sessionHistory.d.ts.map +1 -0
- package/lib/types/sessionHistory.js +87 -0
- package/lib/types/theme.d.ts +115 -0
- package/lib/types/theme.d.ts.map +1 -0
- package/lib/types/theme.js +300 -0
- package/lib/types/themePrefs.d.ts +28 -0
- package/lib/types/themePrefs.d.ts.map +1 -0
- package/lib/types/themePrefs.js +59 -0
- package/lib/types/ui.d.ts +28 -0
- package/lib/types/ui.d.ts.map +1 -0
- package/lib/types/ui.js +25 -0
- package/lib/types/update.d.ts +76 -0
- package/lib/types/update.d.ts.map +1 -0
- package/lib/types/update.js +203 -0
- package/lib/types/utils/clipboard.d.ts +43 -0
- package/lib/types/utils/clipboard.d.ts.map +1 -0
- package/lib/types/utils/clipboard.js +82 -0
- package/lib/types/utils/debug.d.ts +8 -0
- package/lib/types/utils/debug.d.ts.map +1 -0
- package/lib/types/utils/debug.js +12 -0
- package/lib/types/utils/earlyInput.d.ts +7 -0
- package/lib/types/utils/earlyInput.d.ts.map +1 -0
- package/lib/types/utils/earlyInput.js +6 -0
- package/lib/types/utils/env.d.ts +10 -0
- package/lib/types/utils/env.d.ts.map +1 -0
- package/lib/types/utils/env.js +9 -0
- package/lib/types/utils/envUtils.d.ts +8 -0
- package/lib/types/utils/envUtils.d.ts.map +1 -0
- package/lib/types/utils/envUtils.js +13 -0
- package/lib/types/utils/execFileNoThrow.d.ts +34 -0
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -0
- package/lib/types/utils/execFileNoThrow.js +31 -0
- package/lib/types/utils/fullscreen.d.ts +8 -0
- package/lib/types/utils/fullscreen.d.ts.map +1 -0
- package/lib/types/utils/fullscreen.js +10 -0
- package/lib/types/utils/intl.d.ts +7 -0
- package/lib/types/utils/intl.d.ts.map +1 -0
- package/lib/types/utils/intl.js +9 -0
- package/lib/types/utils/loaded-context.d.ts +20 -0
- package/lib/types/utils/loaded-context.d.ts.map +1 -0
- package/lib/types/utils/loaded-context.js +36 -0
- package/lib/types/utils/log.d.ts +7 -0
- package/lib/types/utils/log.d.ts.map +1 -0
- package/lib/types/utils/log.js +9 -0
- package/lib/types/utils/mentions.d.ts +30 -0
- package/lib/types/utils/mentions.d.ts.map +1 -0
- package/lib/types/utils/mentions.js +72 -0
- package/lib/types/utils/narration.d.ts +11 -0
- package/lib/types/utils/narration.d.ts.map +1 -0
- package/lib/types/utils/narration.js +16 -0
- package/lib/types/utils/semver.d.ts +9 -0
- package/lib/types/utils/semver.d.ts.map +1 -0
- package/lib/types/utils/semver.js +24 -0
- package/lib/types/utils/sliceAnsi.d.ts +12 -0
- package/lib/types/utils/sliceAnsi.d.ts.map +1 -0
- package/lib/types/utils/sliceAnsi.js +79 -0
- package/lib/types/working-activity.d.ts +19 -0
- package/lib/types/working-activity.d.ts.map +1 -0
- package/lib/types/working-activity.js +18 -0
- package/package.json +141 -0
- package/skills/audit/SKILL.md +24 -0
- package/skills/bug/SKILL.md +27 -0
- package/skills/pr-comments/SKILL.md +20 -0
- package/skills/practice/SKILL.md +22 -0
- package/skills/release-notes/SKILL.md +25 -0
- package/skills/review/SKILL.md +25 -0
- package/skills/vuln-check/SKILL.md +25 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
2
|
+
import type { Except } from 'type-fest';
|
|
3
|
+
import type { DOMElement } from '../dom.js';
|
|
4
|
+
import type { ClickEvent } from '../events/click-event.js';
|
|
5
|
+
import type { FocusEvent } from '../events/focus-event.js';
|
|
6
|
+
import type { KeyboardEvent } from '../events/keyboard-event.js';
|
|
7
|
+
import type { Styles } from '../styles.js';
|
|
8
|
+
export type Props = Except<Styles, 'textWrap'> & {
|
|
9
|
+
ref?: Ref<DOMElement>;
|
|
10
|
+
/**
|
|
11
|
+
* Tab order index. Nodes with `tabIndex >= 0` participate in
|
|
12
|
+
* Tab/Shift+Tab cycling; `-1` means programmatically focusable only.
|
|
13
|
+
*/
|
|
14
|
+
tabIndex?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Focus this element when it mounts. Like the HTML `autofocus`
|
|
17
|
+
* attribute — the FocusManager calls `focus(node)` during the
|
|
18
|
+
* reconciler's `commitMount` phase.
|
|
19
|
+
*/
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Fired on left-button click (press + release without drag). Only works
|
|
23
|
+
* inside `<AlternateScreen>` where mouse tracking is enabled — no-op
|
|
24
|
+
* otherwise. The event bubbles from the deepest hit Box up through
|
|
25
|
+
* ancestors; call `event.stopImmediatePropagation()` to stop bubbling.
|
|
26
|
+
*/
|
|
27
|
+
onClick?: (event: ClickEvent) => void;
|
|
28
|
+
onFocus?: (event: FocusEvent) => void;
|
|
29
|
+
onFocusCapture?: (event: FocusEvent) => void;
|
|
30
|
+
onBlur?: (event: FocusEvent) => void;
|
|
31
|
+
onBlurCapture?: (event: FocusEvent) => void;
|
|
32
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
33
|
+
onKeyDownCapture?: (event: KeyboardEvent) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Fired when the mouse moves into this Box's rendered rect. Like DOM
|
|
36
|
+
* `mouseenter`, does NOT bubble — moving between children does not
|
|
37
|
+
* re-fire on the parent. Only works inside `<AlternateScreen>` where
|
|
38
|
+
* mode-1003 mouse tracking is enabled.
|
|
39
|
+
*/
|
|
40
|
+
onMouseEnter?: () => void;
|
|
41
|
+
/** Fired when the mouse moves out of this Box's rendered rect. */
|
|
42
|
+
onMouseLeave?: () => void;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* `<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
|
|
46
|
+
*/
|
|
47
|
+
declare function Box(t0: any): any;
|
|
48
|
+
export default Box;
|
|
49
|
+
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/Box.tsx"],"names":[],"mappings":"AACA,OAAc,EAA0B,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG;IAC/C,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC7C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,iBAAS,GAAG,CAAC,EAAE,KAAA,OAiKd;AACD,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import * as warn from '../warn.js';
|
|
4
|
+
/**
|
|
5
|
+
* `<Box>` is an essential Ink component to build your layout. It's like `<div style="display: flex">` in the browser.
|
|
6
|
+
*/
|
|
7
|
+
function Box(t0) {
|
|
8
|
+
const $ = _c(42);
|
|
9
|
+
let autoFocus;
|
|
10
|
+
let children;
|
|
11
|
+
let flexDirection;
|
|
12
|
+
let flexGrow;
|
|
13
|
+
let flexShrink;
|
|
14
|
+
let flexWrap;
|
|
15
|
+
let onBlur;
|
|
16
|
+
let onBlurCapture;
|
|
17
|
+
let onClick;
|
|
18
|
+
let onFocus;
|
|
19
|
+
let onFocusCapture;
|
|
20
|
+
let onKeyDown;
|
|
21
|
+
let onKeyDownCapture;
|
|
22
|
+
let onMouseEnter;
|
|
23
|
+
let onMouseLeave;
|
|
24
|
+
let ref;
|
|
25
|
+
let style;
|
|
26
|
+
let tabIndex;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
const { children: t1, flexWrap: t2, flexDirection: t3, flexGrow: t4, flexShrink: t5, ref: t6, tabIndex: t7, autoFocus: t8, onClick: t9, onFocus: t10, onFocusCapture: t11, onBlur: t12, onBlurCapture: t13, onMouseEnter: t14, onMouseLeave: t15, onKeyDown: t16, onKeyDownCapture: t17, ...t18 } = t0;
|
|
29
|
+
children = t1;
|
|
30
|
+
ref = t6;
|
|
31
|
+
tabIndex = t7;
|
|
32
|
+
autoFocus = t8;
|
|
33
|
+
onClick = t9;
|
|
34
|
+
onFocus = t10;
|
|
35
|
+
onFocusCapture = t11;
|
|
36
|
+
onBlur = t12;
|
|
37
|
+
onBlurCapture = t13;
|
|
38
|
+
onMouseEnter = t14;
|
|
39
|
+
onMouseLeave = t15;
|
|
40
|
+
onKeyDown = t16;
|
|
41
|
+
onKeyDownCapture = t17;
|
|
42
|
+
style = t18;
|
|
43
|
+
flexWrap = t2 === undefined ? "nowrap" : t2;
|
|
44
|
+
flexDirection = t3 === undefined ? "row" : t3;
|
|
45
|
+
flexGrow = t4 === undefined ? 0 : t4;
|
|
46
|
+
flexShrink = t5 === undefined ? 1 : t5;
|
|
47
|
+
warn.ifNotInteger(style.margin, "margin");
|
|
48
|
+
warn.ifNotInteger(style.marginX, "marginX");
|
|
49
|
+
warn.ifNotInteger(style.marginY, "marginY");
|
|
50
|
+
warn.ifNotInteger(style.marginTop, "marginTop");
|
|
51
|
+
warn.ifNotInteger(style.marginBottom, "marginBottom");
|
|
52
|
+
warn.ifNotInteger(style.marginLeft, "marginLeft");
|
|
53
|
+
warn.ifNotInteger(style.marginRight, "marginRight");
|
|
54
|
+
warn.ifNotInteger(style.padding, "padding");
|
|
55
|
+
warn.ifNotInteger(style.paddingX, "paddingX");
|
|
56
|
+
warn.ifNotInteger(style.paddingY, "paddingY");
|
|
57
|
+
warn.ifNotInteger(style.paddingTop, "paddingTop");
|
|
58
|
+
warn.ifNotInteger(style.paddingBottom, "paddingBottom");
|
|
59
|
+
warn.ifNotInteger(style.paddingLeft, "paddingLeft");
|
|
60
|
+
warn.ifNotInteger(style.paddingRight, "paddingRight");
|
|
61
|
+
warn.ifNotInteger(style.gap, "gap");
|
|
62
|
+
warn.ifNotInteger(style.columnGap, "columnGap");
|
|
63
|
+
warn.ifNotInteger(style.rowGap, "rowGap");
|
|
64
|
+
$[0] = t0;
|
|
65
|
+
$[1] = autoFocus;
|
|
66
|
+
$[2] = children;
|
|
67
|
+
$[3] = flexDirection;
|
|
68
|
+
$[4] = flexGrow;
|
|
69
|
+
$[5] = flexShrink;
|
|
70
|
+
$[6] = flexWrap;
|
|
71
|
+
$[7] = onBlur;
|
|
72
|
+
$[8] = onBlurCapture;
|
|
73
|
+
$[9] = onClick;
|
|
74
|
+
$[10] = onFocus;
|
|
75
|
+
$[11] = onFocusCapture;
|
|
76
|
+
$[12] = onKeyDown;
|
|
77
|
+
$[13] = onKeyDownCapture;
|
|
78
|
+
$[14] = onMouseEnter;
|
|
79
|
+
$[15] = onMouseLeave;
|
|
80
|
+
$[16] = ref;
|
|
81
|
+
$[17] = style;
|
|
82
|
+
$[18] = tabIndex;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
autoFocus = $[1];
|
|
86
|
+
children = $[2];
|
|
87
|
+
flexDirection = $[3];
|
|
88
|
+
flexGrow = $[4];
|
|
89
|
+
flexShrink = $[5];
|
|
90
|
+
flexWrap = $[6];
|
|
91
|
+
onBlur = $[7];
|
|
92
|
+
onBlurCapture = $[8];
|
|
93
|
+
onClick = $[9];
|
|
94
|
+
onFocus = $[10];
|
|
95
|
+
onFocusCapture = $[11];
|
|
96
|
+
onKeyDown = $[12];
|
|
97
|
+
onKeyDownCapture = $[13];
|
|
98
|
+
onMouseEnter = $[14];
|
|
99
|
+
onMouseLeave = $[15];
|
|
100
|
+
ref = $[16];
|
|
101
|
+
style = $[17];
|
|
102
|
+
tabIndex = $[18];
|
|
103
|
+
}
|
|
104
|
+
const t1 = style.overflowX ?? style.overflow ?? "visible";
|
|
105
|
+
const t2 = style.overflowY ?? style.overflow ?? "visible";
|
|
106
|
+
let t3;
|
|
107
|
+
if ($[19] !== flexDirection || $[20] !== flexGrow || $[21] !== flexShrink || $[22] !== flexWrap || $[23] !== style || $[24] !== t1 || $[25] !== t2) {
|
|
108
|
+
t3 = {
|
|
109
|
+
flexWrap,
|
|
110
|
+
flexDirection,
|
|
111
|
+
flexGrow,
|
|
112
|
+
flexShrink,
|
|
113
|
+
...style,
|
|
114
|
+
overflowX: t1,
|
|
115
|
+
overflowY: t2
|
|
116
|
+
};
|
|
117
|
+
$[19] = flexDirection;
|
|
118
|
+
$[20] = flexGrow;
|
|
119
|
+
$[21] = flexShrink;
|
|
120
|
+
$[22] = flexWrap;
|
|
121
|
+
$[23] = style;
|
|
122
|
+
$[24] = t1;
|
|
123
|
+
$[25] = t2;
|
|
124
|
+
$[26] = t3;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
t3 = $[26];
|
|
128
|
+
}
|
|
129
|
+
let t4;
|
|
130
|
+
if ($[27] !== autoFocus || $[28] !== children || $[29] !== onBlur || $[30] !== onBlurCapture || $[31] !== onClick || $[32] !== onFocus || $[33] !== onFocusCapture || $[34] !== onKeyDown || $[35] !== onKeyDownCapture || $[36] !== onMouseEnter || $[37] !== onMouseLeave || $[38] !== ref || $[39] !== t3 || $[40] !== tabIndex) {
|
|
131
|
+
t4 = _jsx("ink-box", { ref: ref, tabIndex: tabIndex, autoFocus: autoFocus, onClick: onClick, onFocus: onFocus, onFocusCapture: onFocusCapture, onBlur: onBlur, onBlurCapture: onBlurCapture, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onKeyDown: onKeyDown, onKeyDownCapture: onKeyDownCapture, style: t3, children: children });
|
|
132
|
+
$[27] = autoFocus;
|
|
133
|
+
$[28] = children;
|
|
134
|
+
$[29] = onBlur;
|
|
135
|
+
$[30] = onBlurCapture;
|
|
136
|
+
$[31] = onClick;
|
|
137
|
+
$[32] = onFocus;
|
|
138
|
+
$[33] = onFocusCapture;
|
|
139
|
+
$[34] = onKeyDown;
|
|
140
|
+
$[35] = onKeyDownCapture;
|
|
141
|
+
$[36] = onMouseEnter;
|
|
142
|
+
$[37] = onMouseLeave;
|
|
143
|
+
$[38] = ref;
|
|
144
|
+
$[39] = t3;
|
|
145
|
+
$[40] = tabIndex;
|
|
146
|
+
$[41] = t4;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
t4 = $[41];
|
|
150
|
+
}
|
|
151
|
+
return t4;
|
|
152
|
+
}
|
|
153
|
+
export default Box;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { type Ref } from 'react';
|
|
2
|
+
import type { Except } from 'type-fest';
|
|
3
|
+
import type { DOMElement } from '../dom.js';
|
|
4
|
+
import type { Styles } from '../styles.js';
|
|
5
|
+
type ButtonState = {
|
|
6
|
+
focused: boolean;
|
|
7
|
+
hovered: boolean;
|
|
8
|
+
active: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type Props = Except<Styles, 'textWrap'> & {
|
|
11
|
+
ref?: Ref<DOMElement>;
|
|
12
|
+
/**
|
|
13
|
+
* Called when the button is activated via Enter, Space, or click.
|
|
14
|
+
*/
|
|
15
|
+
onAction: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Tab order index. Defaults to 0 (in tab order).
|
|
18
|
+
* Set to -1 for programmatically focusable only.
|
|
19
|
+
*/
|
|
20
|
+
tabIndex?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Focus this button when it mounts.
|
|
23
|
+
*/
|
|
24
|
+
autoFocus?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Render prop receiving the interactive state. Use this to
|
|
27
|
+
* style children based on focus/hover/active — Button itself
|
|
28
|
+
* is intentionally unstyled.
|
|
29
|
+
*
|
|
30
|
+
* If not provided, children render as-is (no state-dependent styling).
|
|
31
|
+
*/
|
|
32
|
+
children: ((state: ButtonState) => React.ReactNode) | React.ReactNode;
|
|
33
|
+
};
|
|
34
|
+
declare function Button(t0: any): any;
|
|
35
|
+
export default Button;
|
|
36
|
+
export type { ButtonState };
|
|
37
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,KAAK,GAAG,EAA4C,MAAM,OAAO,CAAC;AAClF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAI5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG;IAC/C,GAAG,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,CAAC,KAAK,EAAE,WAAW,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;CACvE,CAAC;AACF,iBAAS,MAAM,CAAC,EAAE,KAAA,OAmJjB;AAID,eAAe,MAAM,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import Box from './Box.js';
|
|
5
|
+
function Button(t0) {
|
|
6
|
+
const $ = _c(30);
|
|
7
|
+
let autoFocus;
|
|
8
|
+
let children;
|
|
9
|
+
let onAction;
|
|
10
|
+
let ref;
|
|
11
|
+
let style;
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== t0) {
|
|
14
|
+
({
|
|
15
|
+
onAction,
|
|
16
|
+
tabIndex: t1,
|
|
17
|
+
autoFocus,
|
|
18
|
+
children,
|
|
19
|
+
ref,
|
|
20
|
+
...style
|
|
21
|
+
} = t0);
|
|
22
|
+
$[0] = t0;
|
|
23
|
+
$[1] = autoFocus;
|
|
24
|
+
$[2] = children;
|
|
25
|
+
$[3] = onAction;
|
|
26
|
+
$[4] = ref;
|
|
27
|
+
$[5] = style;
|
|
28
|
+
$[6] = t1;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
autoFocus = $[1];
|
|
32
|
+
children = $[2];
|
|
33
|
+
onAction = $[3];
|
|
34
|
+
ref = $[4];
|
|
35
|
+
style = $[5];
|
|
36
|
+
t1 = $[6];
|
|
37
|
+
}
|
|
38
|
+
const tabIndex = t1 === undefined ? 0 : t1;
|
|
39
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
40
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
41
|
+
const [isActive, setIsActive] = useState(false);
|
|
42
|
+
const activeTimer = useRef(null);
|
|
43
|
+
let t2;
|
|
44
|
+
let t3;
|
|
45
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
46
|
+
t2 = () => () => {
|
|
47
|
+
if (activeTimer.current) {
|
|
48
|
+
clearTimeout(activeTimer.current);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
t3 = [];
|
|
52
|
+
$[7] = t2;
|
|
53
|
+
$[8] = t3;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
t2 = $[7];
|
|
57
|
+
t3 = $[8];
|
|
58
|
+
}
|
|
59
|
+
useEffect(t2, t3);
|
|
60
|
+
let t4;
|
|
61
|
+
if ($[9] !== onAction) {
|
|
62
|
+
t4 = e => {
|
|
63
|
+
if (e.key === "return" || e.key === " ") {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
setIsActive(true);
|
|
66
|
+
onAction();
|
|
67
|
+
if (activeTimer.current) {
|
|
68
|
+
clearTimeout(activeTimer.current);
|
|
69
|
+
}
|
|
70
|
+
activeTimer.current = setTimeout(_temp, 100, setIsActive);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
$[9] = onAction;
|
|
74
|
+
$[10] = t4;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
t4 = $[10];
|
|
78
|
+
}
|
|
79
|
+
const handleKeyDown = t4;
|
|
80
|
+
let t5;
|
|
81
|
+
if ($[11] !== onAction) {
|
|
82
|
+
t5 = _e => {
|
|
83
|
+
onAction();
|
|
84
|
+
};
|
|
85
|
+
$[11] = onAction;
|
|
86
|
+
$[12] = t5;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
t5 = $[12];
|
|
90
|
+
}
|
|
91
|
+
const handleClick = t5;
|
|
92
|
+
let t6;
|
|
93
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
|
+
t6 = _e_0 => setIsFocused(true);
|
|
95
|
+
$[13] = t6;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
t6 = $[13];
|
|
99
|
+
}
|
|
100
|
+
const handleFocus = t6;
|
|
101
|
+
let t7;
|
|
102
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
103
|
+
t7 = _e_1 => setIsFocused(false);
|
|
104
|
+
$[14] = t7;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
t7 = $[14];
|
|
108
|
+
}
|
|
109
|
+
const handleBlur = t7;
|
|
110
|
+
let t8;
|
|
111
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
112
|
+
t8 = () => setIsHovered(true);
|
|
113
|
+
$[15] = t8;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
t8 = $[15];
|
|
117
|
+
}
|
|
118
|
+
const handleMouseEnter = t8;
|
|
119
|
+
let t9;
|
|
120
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
121
|
+
t9 = () => setIsHovered(false);
|
|
122
|
+
$[16] = t9;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
t9 = $[16];
|
|
126
|
+
}
|
|
127
|
+
const handleMouseLeave = t9;
|
|
128
|
+
let t10;
|
|
129
|
+
if ($[17] !== children || $[18] !== isActive || $[19] !== isFocused || $[20] !== isHovered) {
|
|
130
|
+
const state = {
|
|
131
|
+
focused: isFocused,
|
|
132
|
+
hovered: isHovered,
|
|
133
|
+
active: isActive
|
|
134
|
+
};
|
|
135
|
+
t10 = typeof children === "function" ? children(state) : children;
|
|
136
|
+
$[17] = children;
|
|
137
|
+
$[18] = isActive;
|
|
138
|
+
$[19] = isFocused;
|
|
139
|
+
$[20] = isHovered;
|
|
140
|
+
$[21] = t10;
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
t10 = $[21];
|
|
144
|
+
}
|
|
145
|
+
const content = t10;
|
|
146
|
+
let t11;
|
|
147
|
+
if ($[22] !== autoFocus || $[23] !== content || $[24] !== handleClick || $[25] !== handleKeyDown || $[26] !== ref || $[27] !== style || $[28] !== tabIndex) {
|
|
148
|
+
t11 = _jsx(Box, { ref: ref, tabIndex: tabIndex, autoFocus: autoFocus, onKeyDown: handleKeyDown, onClick: handleClick, onFocus: handleFocus, onBlur: handleBlur, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...style, children: content });
|
|
149
|
+
$[22] = autoFocus;
|
|
150
|
+
$[23] = content;
|
|
151
|
+
$[24] = handleClick;
|
|
152
|
+
$[25] = handleKeyDown;
|
|
153
|
+
$[26] = ref;
|
|
154
|
+
$[27] = style;
|
|
155
|
+
$[28] = tabIndex;
|
|
156
|
+
$[29] = t11;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
t11 = $[29];
|
|
160
|
+
}
|
|
161
|
+
return t11;
|
|
162
|
+
}
|
|
163
|
+
function _temp(setter) {
|
|
164
|
+
return setter(false);
|
|
165
|
+
}
|
|
166
|
+
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type Clock = {
|
|
3
|
+
subscribe: (onChange: () => void, keepAlive: boolean) => () => void;
|
|
4
|
+
now: () => number;
|
|
5
|
+
setTickInterval: (ms: number) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function createClock(tickIntervalMs: number): Clock;
|
|
8
|
+
export declare const ClockContext: React.Context<Clock | null>;
|
|
9
|
+
export declare function ClockProvider(t0: any): any;
|
|
10
|
+
//# sourceMappingURL=ClockContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClockContext.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/ClockContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAGlE,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,SAAS,EAAE,OAAO,KAAK,MAAM,IAAI,CAAC;IACpE,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,eAAe,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC;AACF,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,KAAK,CA0DzD;AACD,eAAO,MAAM,YAAY,6BAAoC,CAAC;AAM9D,wBAAgB,aAAa,CAAC,EAAE,KAAA,OAiC/B"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
|
+
import { createContext, useEffect, useState } from 'react';
|
|
4
|
+
import { FRAME_INTERVAL_MS } from '../constants.js';
|
|
5
|
+
import { useTerminalFocus } from '../hooks/use-terminal-focus.js';
|
|
6
|
+
export function createClock(tickIntervalMs) {
|
|
7
|
+
const subscribers = new Map();
|
|
8
|
+
let interval = null;
|
|
9
|
+
let currentTickIntervalMs = tickIntervalMs;
|
|
10
|
+
let startTime = 0;
|
|
11
|
+
// Snapshot of the current tick's time, ensuring all subscribers in the same
|
|
12
|
+
// tick see the same value (keeps animations synchronized)
|
|
13
|
+
let tickTime = 0;
|
|
14
|
+
function tick() {
|
|
15
|
+
tickTime = Date.now() - startTime;
|
|
16
|
+
for (const onChange of subscribers.keys()) {
|
|
17
|
+
onChange();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function updateInterval() {
|
|
21
|
+
const anyKeepAlive = [...subscribers.values()].some(Boolean);
|
|
22
|
+
if (anyKeepAlive) {
|
|
23
|
+
if (interval) {
|
|
24
|
+
clearInterval(interval);
|
|
25
|
+
interval = null;
|
|
26
|
+
}
|
|
27
|
+
if (startTime === 0) {
|
|
28
|
+
startTime = Date.now();
|
|
29
|
+
}
|
|
30
|
+
interval = setInterval(tick, currentTickIntervalMs);
|
|
31
|
+
}
|
|
32
|
+
else if (interval) {
|
|
33
|
+
clearInterval(interval);
|
|
34
|
+
interval = null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
subscribe(onChange, keepAlive) {
|
|
39
|
+
subscribers.set(onChange, keepAlive);
|
|
40
|
+
updateInterval();
|
|
41
|
+
return () => {
|
|
42
|
+
subscribers.delete(onChange);
|
|
43
|
+
updateInterval();
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
now() {
|
|
47
|
+
if (startTime === 0) {
|
|
48
|
+
startTime = Date.now();
|
|
49
|
+
}
|
|
50
|
+
// When the clock interval is running, return the synchronized tickTime
|
|
51
|
+
// so all subscribers in the same tick see the same value.
|
|
52
|
+
// When paused (no keepAlive subscribers), return real-time to avoid
|
|
53
|
+
// returning a stale tickTime from the last tick before the pause.
|
|
54
|
+
if (interval && tickTime) {
|
|
55
|
+
return tickTime;
|
|
56
|
+
}
|
|
57
|
+
return Date.now() - startTime;
|
|
58
|
+
},
|
|
59
|
+
setTickInterval(ms) {
|
|
60
|
+
if (ms === currentTickIntervalMs)
|
|
61
|
+
return;
|
|
62
|
+
currentTickIntervalMs = ms;
|
|
63
|
+
updateInterval();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export const ClockContext = createContext(null);
|
|
68
|
+
const BLURRED_TICK_INTERVAL_MS = FRAME_INTERVAL_MS * 2;
|
|
69
|
+
// Own component so App.tsx doesn't re-render when the clock is created.
|
|
70
|
+
// The clock value is stable (created once via useState), so the provider
|
|
71
|
+
// never causes consumer re-renders on its own.
|
|
72
|
+
export function ClockProvider(t0) {
|
|
73
|
+
const $ = _c(7);
|
|
74
|
+
const { children } = t0;
|
|
75
|
+
const [clock] = useState(_temp);
|
|
76
|
+
const focused = useTerminalFocus();
|
|
77
|
+
let t1;
|
|
78
|
+
let t2;
|
|
79
|
+
if ($[0] !== clock || $[1] !== focused) {
|
|
80
|
+
t1 = () => {
|
|
81
|
+
clock.setTickInterval(focused ? FRAME_INTERVAL_MS : BLURRED_TICK_INTERVAL_MS);
|
|
82
|
+
};
|
|
83
|
+
t2 = [clock, focused];
|
|
84
|
+
$[0] = clock;
|
|
85
|
+
$[1] = focused;
|
|
86
|
+
$[2] = t1;
|
|
87
|
+
$[3] = t2;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
t1 = $[2];
|
|
91
|
+
t2 = $[3];
|
|
92
|
+
}
|
|
93
|
+
useEffect(t1, t2);
|
|
94
|
+
let t3;
|
|
95
|
+
if ($[4] !== children || $[5] !== clock) {
|
|
96
|
+
t3 = _jsx(ClockContext.Provider, { value: clock, children: children });
|
|
97
|
+
$[4] = children;
|
|
98
|
+
$[5] = clock;
|
|
99
|
+
$[6] = t3;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
t3 = $[6];
|
|
103
|
+
}
|
|
104
|
+
return t3;
|
|
105
|
+
}
|
|
106
|
+
function _temp() {
|
|
107
|
+
return createClock(FRAME_INTERVAL_MS);
|
|
108
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DOMElement } from '../dom.js';
|
|
2
|
+
/**
|
|
3
|
+
* A declared cursor parking position: a node plus the line and column within
|
|
4
|
+
* it where the terminal cursor should sit.
|
|
5
|
+
*/
|
|
6
|
+
export type CursorDeclaration = {
|
|
7
|
+
/** Display column (terminal cell width) within the declared node */
|
|
8
|
+
readonly relativeX: number;
|
|
9
|
+
/** Line number within the declared node */
|
|
10
|
+
readonly relativeY: number;
|
|
11
|
+
/** The ink-box DOMElement whose yoga layout provides the absolute origin */
|
|
12
|
+
readonly node: DOMElement;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Setter for the declared cursor position.
|
|
16
|
+
*
|
|
17
|
+
* The optional second argument makes `null` a conditional clear: the
|
|
18
|
+
* declaration is only cleared if the currently-declared node matches
|
|
19
|
+
* `clearIfNode`. This makes the hook safe for sibling components
|
|
20
|
+
* (e.g. list items) that transfer focus among themselves — without the
|
|
21
|
+
* node check, a newly-unfocused item's clear could clobber a
|
|
22
|
+
* newly-focused sibling's set depending on layout-effect order.
|
|
23
|
+
*/
|
|
24
|
+
export type CursorDeclarationSetter = (declaration: CursorDeclaration | null, clearIfNode?: DOMElement | null) => void;
|
|
25
|
+
/**
|
|
26
|
+
* React context that provides the cursor-declaration setter to descendants.
|
|
27
|
+
*/
|
|
28
|
+
declare const CursorDeclarationContext: import("react").Context<CursorDeclarationSetter>;
|
|
29
|
+
export default CursorDeclarationContext;
|
|
30
|
+
//# sourceMappingURL=CursorDeclarationContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CursorDeclarationContext.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/CursorDeclarationContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oEAAoE;IACpE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,2CAA2C;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAC1B,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,WAAW,EAAE,iBAAiB,GAAG,IAAI,EACrC,WAAW,CAAC,EAAE,UAAU,GAAG,IAAI,KAC5B,IAAI,CAAA;AAET;;GAEG;AACH,QAAA,MAAM,wBAAwB,kDAE7B,CAAA;AAED,eAAe,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorOverview.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/ErrorOverview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAsB1B,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;CACvB,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,KAAK,EACN,EAAE,KAAK,qBA8EP"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import codeExcerpt from 'code-excerpt';
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import StackUtils from 'stack-utils';
|
|
5
|
+
import Box from './Box.js';
|
|
6
|
+
import Text from './Text.js';
|
|
7
|
+
/* eslint-disable custom-rules/no-process-cwd -- stack trace file:// paths are relative to the real OS cwd, not the virtual cwd */
|
|
8
|
+
// Error's source file is reported as file:///home/user/file.js
|
|
9
|
+
// This function removes the file://[cwd] part
|
|
10
|
+
const cleanupPath = (path) => {
|
|
11
|
+
return path?.replace(`file://${process.cwd()}/`, '');
|
|
12
|
+
};
|
|
13
|
+
let stackUtils;
|
|
14
|
+
function getStackUtils() {
|
|
15
|
+
return stackUtils ??= new StackUtils({
|
|
16
|
+
cwd: process.cwd(),
|
|
17
|
+
internals: StackUtils.nodeInternals()
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export default function ErrorOverview({ error }) {
|
|
21
|
+
const stack = error.stack ? error.stack.split('\n').slice(1) : undefined;
|
|
22
|
+
const origin = stack ? getStackUtils().parseLine(stack[0]) : undefined;
|
|
23
|
+
const filePath = cleanupPath(origin?.file);
|
|
24
|
+
let excerpt;
|
|
25
|
+
let lineWidth = 0;
|
|
26
|
+
if (filePath && origin?.line) {
|
|
27
|
+
try {
|
|
28
|
+
// eslint-disable-next-line custom-rules/no-sync-fs -- sync render path; error overlay can't go async without suspense restructuring
|
|
29
|
+
const sourceCode = readFileSync(filePath, 'utf8');
|
|
30
|
+
excerpt = codeExcerpt(sourceCode, origin.line);
|
|
31
|
+
if (excerpt) {
|
|
32
|
+
for (const { line } of excerpt) {
|
|
33
|
+
lineWidth = Math.max(lineWidth, String(line).length);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// file not readable — skip source context
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return _jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { backgroundColor: "ansi:red", color: "ansi:white", children: [' ', "ERROR", ' '] }), _jsxs(Text, { children: [" ", error.message] })] }), origin && filePath && _jsx(Box, { marginTop: 1, children: _jsxs(Text, { dim: true, children: [filePath, ":", origin.line, ":", origin.column] }) }), origin && excerpt && _jsx(Box, { marginTop: 1, flexDirection: "column", children: excerpt.map(({ line: line_0, value }) => _jsxs(Box, { children: [_jsx(Box, { width: lineWidth + 1, children: _jsxs(Text, { dim: line_0 !== origin.line, backgroundColor: line_0 === origin.line ? 'ansi:red' : undefined, color: line_0 === origin.line ? 'ansi:white' : undefined, children: [String(line_0).padStart(lineWidth, ' '), ":"] }) }), _jsx(Text, { backgroundColor: line_0 === origin.line ? 'ansi:red' : undefined, color: line_0 === origin.line ? 'ansi:white' : undefined, children: ' ' + value }, line_0)] }, line_0)) }), error.stack && _jsx(Box, { marginTop: 1, flexDirection: "column", children: error.stack.split('\n').slice(1).map(line_1 => {
|
|
42
|
+
const parsedLine = getStackUtils().parseLine(line_1);
|
|
43
|
+
// If the line from the stack cannot be parsed, we print out the unparsed line.
|
|
44
|
+
if (!parsedLine) {
|
|
45
|
+
return _jsxs(Box, { children: [_jsx(Text, { dim: true, children: "- " }), _jsx(Text, { bold: true, children: line_1 })] }, line_1);
|
|
46
|
+
}
|
|
47
|
+
return _jsxs(Box, { children: [_jsx(Text, { dim: true, children: "- " }), _jsx(Text, { bold: true, children: parsedLine.function }), _jsxs(Text, { dim: true, children: [' ', "(", cleanupPath(parsedLine.file) ?? '', ":", parsedLine.line, ":", parsedLine.column, ")"] })] }, line_1);
|
|
48
|
+
}) })] });
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/ink/components/Link.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAAE,KAAA,OA8B9B"}
|