@deepseek-harness-tui/dsh-tui 0.8.8 → 0.9.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/README.md +60 -238
- package/bin/dsh-tui.js +172 -5
- package/cordis.patch.yml +16 -4
- package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
- package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
- package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
- package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
- package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
- package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
- package/dsh-ecosystem-spec/registry/README.md +14 -14
- package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
- package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
- package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
- package/lib/types/cc/hyperlink.d.ts +7 -1
- package/lib/types/cc/hyperlink.d.ts.map +1 -1
- package/lib/types/cc/hyperlink.js +3 -2
- package/lib/types/cc/markdown.d.ts.map +1 -1
- package/lib/types/cc/markdown.js +33 -3
- package/lib/types/cc/sessionColors.d.ts +27 -0
- package/lib/types/cc/sessionColors.d.ts.map +1 -0
- package/lib/types/cc/sessionColors.js +39 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +10 -2
- package/lib/types/components/ActivityPicker.d.ts +4 -1
- package/lib/types/components/ActivityPicker.d.ts.map +1 -1
- package/lib/types/components/ActivityPicker.js +2 -2
- package/lib/types/components/AutoRecapRow.d.ts +23 -0
- package/lib/types/components/AutoRecapRow.d.ts.map +1 -0
- package/lib/types/components/AutoRecapRow.js +23 -0
- package/lib/types/components/BtwPanel.d.ts.map +1 -1
- package/lib/types/components/BtwPanel.js +1 -1
- package/lib/types/components/Chat/SubagentMessage.d.ts +2 -1
- package/lib/types/components/Chat/SubagentMessage.d.ts.map +1 -1
- package/lib/types/components/Chat/SubagentMessage.js +11 -3
- package/lib/types/components/ColorPicker.d.ts +17 -0
- package/lib/types/components/ColorPicker.d.ts.map +1 -0
- package/lib/types/components/ColorPicker.js +20 -0
- package/lib/types/components/CommandSuggestions.d.ts +23 -4
- package/lib/types/components/CommandSuggestions.d.ts.map +1 -1
- package/lib/types/components/CommandSuggestions.js +41 -14
- package/lib/types/components/ContextBarView.d.ts +33 -0
- package/lib/types/components/ContextBarView.d.ts.map +1 -0
- package/lib/types/components/ContextBarView.js +46 -0
- package/lib/types/components/EffortInputBorder.d.ts +12 -1
- package/lib/types/components/EffortInputBorder.d.ts.map +1 -1
- package/lib/types/components/EffortInputBorder.js +22 -5
- package/lib/types/components/EffortSlider.d.ts +4 -1
- package/lib/types/components/EffortSlider.d.ts.map +1 -1
- package/lib/types/components/EffortSlider.js +4 -2
- package/lib/types/components/ExtensionDialog.js +6 -2
- package/lib/types/components/FileActionsPanel.d.ts +22 -0
- package/lib/types/components/FileActionsPanel.d.ts.map +1 -0
- package/lib/types/components/FileActionsPanel.js +28 -0
- package/lib/types/components/FileSuggestions.d.ts +26 -7
- package/lib/types/components/FileSuggestions.d.ts.map +1 -1
- package/lib/types/components/FileSuggestions.js +39 -12
- package/lib/types/components/GoalTodoPanel.d.ts +26 -2
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +86 -17
- package/lib/types/components/HelpMenu.d.ts +7 -1
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +12 -4
- package/lib/types/components/HistorySearchDialog.d.ts +4 -1
- package/lib/types/components/HistorySearchDialog.d.ts.map +1 -1
- package/lib/types/components/HistorySearchDialog.js +2 -2
- package/lib/types/components/LangPicker.d.ts +14 -0
- package/lib/types/components/LangPicker.d.ts.map +1 -0
- package/lib/types/components/LangPicker.js +17 -0
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LoadedContextPanel.js +3 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +12 -3
- package/lib/types/components/MessageList.d.ts +45 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +560 -41
- package/lib/types/components/ModelPicker.d.ts +27 -2
- package/lib/types/components/ModelPicker.d.ts.map +1 -1
- package/lib/types/components/ModelPicker.js +26 -6
- package/lib/types/components/PermissionsPicker.d.ts +21 -0
- package/lib/types/components/PermissionsPicker.d.ts.map +1 -0
- package/lib/types/components/PermissionsPicker.js +27 -0
- package/lib/types/components/PlanPicker.d.ts +15 -0
- package/lib/types/components/PlanPicker.d.ts.map +1 -0
- package/lib/types/components/PlanPicker.js +18 -0
- package/lib/types/components/PresetPicker.d.ts +4 -1
- package/lib/types/components/PresetPicker.d.ts.map +1 -1
- package/lib/types/components/PresetPicker.js +2 -2
- package/lib/types/components/PromptInput.d.ts +4 -3
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +602 -75
- package/lib/types/components/RecapPanel.d.ts +25 -0
- package/lib/types/components/RecapPanel.d.ts.map +1 -0
- package/lib/types/components/RecapPanel.js +55 -0
- package/lib/types/components/RewindPicker.d.ts +12 -1
- package/lib/types/components/RewindPicker.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.js +6 -4
- package/lib/types/components/ScrollbarGutter.d.ts +28 -0
- package/lib/types/components/ScrollbarGutter.d.ts.map +1 -0
- package/lib/types/components/ScrollbarGutter.js +119 -0
- package/lib/types/components/Select.d.ts +8 -1
- package/lib/types/components/Select.d.ts.map +1 -1
- package/lib/types/components/Select.js +4 -2
- package/lib/types/components/SkillsPicker.d.ts +4 -1
- package/lib/types/components/SkillsPicker.d.ts.map +1 -1
- package/lib/types/components/SkillsPicker.js +2 -2
- package/lib/types/components/SubagentCard.d.ts +2 -1
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +9 -2
- package/lib/types/components/SubagentDashboard.d.ts +4 -0
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +9 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +5 -4
- package/lib/types/components/SuggestionCard.d.ts +65 -0
- package/lib/types/components/SuggestionCard.d.ts.map +1 -0
- package/lib/types/components/SuggestionCard.js +77 -0
- package/lib/types/components/ThemePicker.d.ts +4 -1
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +2 -2
- package/lib/types/components/ThinkingToggle.d.ts +4 -1
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
- package/lib/types/components/ThinkingToggle.js +2 -2
- package/lib/types/components/TimelineRail.d.ts +53 -0
- package/lib/types/components/TimelineRail.d.ts.map +1 -0
- package/lib/types/components/TimelineRail.js +197 -0
- package/lib/types/components/WorkspaceFlowPicker.d.ts +6 -1
- package/lib/types/components/WorkspaceFlowPicker.d.ts.map +1 -1
- package/lib/types/components/WorkspaceFlowPicker.js +4 -2
- package/lib/types/components/WorkspaceMenuPicker.d.ts +19 -0
- package/lib/types/components/WorkspaceMenuPicker.d.ts.map +1 -0
- package/lib/types/components/WorkspaceMenuPicker.js +19 -0
- package/lib/types/components/WorkspacePicker.d.ts +4 -1
- package/lib/types/components/WorkspacePicker.d.ts.map +1 -1
- package/lib/types/components/WorkspacePicker.js +2 -2
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +5 -1
- package/lib/types/components/design-system/ListItem.d.ts +8 -1
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +8 -3
- package/lib/types/components/design-system/ThemeProvider.d.ts +7 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +2 -1
- package/lib/types/components/messages/AssistantTextMessage.d.ts +5 -2
- package/lib/types/components/messages/AssistantTextMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantTextMessage.js +6 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +2 -1
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +10 -4
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +15 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +37 -7
- package/lib/types/components/messages/UserPromptMessage.d.ts +2 -1
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +7 -3
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +75 -11
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +13 -2
- package/lib/types/components/sessions/SessionListRow.d.ts +4 -1
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +4 -2
- package/lib/types/components/trajectory/HotspotView.d.ts +7 -1
- package/lib/types/components/trajectory/HotspotView.d.ts.map +1 -1
- package/lib/types/components/trajectory/HotspotView.js +8 -2
- package/lib/types/components/trajectory/Ledger.d.ts +9 -1
- package/lib/types/components/trajectory/Ledger.d.ts.map +1 -1
- package/lib/types/components/trajectory/Ledger.js +23 -5
- package/lib/types/components/trajectory/WaveBand.d.ts +10 -1
- package/lib/types/components/trajectory/WaveBand.d.ts.map +1 -1
- package/lib/types/components/trajectory/WaveBand.js +7 -2
- package/lib/types/dsh-adapter/channel.d.ts +117 -7
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +1301 -122
- package/lib/types/dsh-adapter/compat/index.d.ts +8 -6
- package/lib/types/dsh-adapter/compat/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/index.js +8 -6
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +150 -0
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +518 -41
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +1 -0
- package/lib/types/dsh-adapter/extension-events.d.ts +1 -1
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.d.ts +20 -2
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +9 -1
- package/lib/types/dsh-adapter/plugin.d.ts +0 -9
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +453 -14
- package/lib/types/dsh-adapter/presets.d.ts +18 -0
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +31 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts +29 -1
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +89 -5
- package/lib/types/dsh-adapter/questions.d.ts +19 -2
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +53 -10
- package/lib/types/dsh-adapter/recap.d.ts +49 -0
- package/lib/types/dsh-adapter/recap.d.ts.map +1 -0
- package/lib/types/dsh-adapter/recap.js +121 -0
- package/lib/types/dsh-adapter/sessionTree.d.ts +314 -0
- package/lib/types/dsh-adapter/sessionTree.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessionTree.js +954 -0
- package/lib/types/dsh-adapter/shortcuts.d.ts +15 -44
- package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -1
- package/lib/types/dsh-adapter/shortcuts.js +28 -165
- package/lib/types/dsh-adapter/types.d.ts +1 -1
- package/lib/types/dsh-adapter/types.d.ts.map +1 -1
- package/lib/types/herdr.js +1 -1
- package/lib/types/i18n.d.ts +770 -181
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +257 -80
- package/lib/types/ink/components/AlternateScreen.d.ts.map +1 -1
- package/lib/types/ink/components/AlternateScreen.js +13 -1
- package/lib/types/ink/components/App.d.ts +12 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +101 -4
- package/lib/types/ink/components/ClockContext.d.ts.map +1 -1
- package/lib/types/ink/components/ClockContext.js +2 -0
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +170 -91
- package/lib/types/ink/constants.d.ts +9 -0
- package/lib/types/ink/constants.d.ts.map +1 -1
- package/lib/types/ink/constants.js +9 -0
- package/lib/types/ink/events/click-event.d.ts +7 -16
- package/lib/types/ink/events/click-event.d.ts.map +1 -1
- package/lib/types/ink/events/click-event.js +16 -19
- package/lib/types/ink/events/event-handlers.d.ts +11 -1
- package/lib/types/ink/events/event-handlers.d.ts.map +1 -1
- package/lib/types/ink/events/event-handlers.js +2 -0
- package/lib/types/ink/events/input-event.d.ts +9 -0
- package/lib/types/ink/events/input-event.d.ts.map +1 -1
- package/lib/types/ink/events/input-event.js +4 -0
- package/lib/types/ink/events/pointer-event.d.ts +61 -0
- package/lib/types/ink/events/pointer-event.d.ts.map +1 -0
- package/lib/types/ink/events/pointer-event.js +61 -0
- package/lib/types/ink/events/wheel-event.d.ts +17 -0
- package/lib/types/ink/events/wheel-event.d.ts.map +1 -0
- package/lib/types/ink/events/wheel-event.js +20 -0
- package/lib/types/ink/geometry-trace.d.ts +51 -0
- package/lib/types/ink/geometry-trace.d.ts.map +1 -0
- package/lib/types/ink/geometry-trace.js +83 -0
- package/lib/types/ink/hit-test.d.ts +56 -1
- package/lib/types/ink/hit-test.d.ts.map +1 -1
- package/lib/types/ink/hit-test.js +146 -8
- package/lib/types/ink/ink.d.ts +58 -1
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +230 -29
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +21 -0
- package/lib/types/ink/node-cache.d.ts +5 -0
- package/lib/types/ink/node-cache.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.d.ts +8 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +101 -12
- package/lib/types/ink/render-node-to-output.d.ts +10 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +111 -18
- package/lib/types/ink/timeline-rail.d.ts +138 -0
- package/lib/types/ink/timeline-rail.d.ts.map +1 -0
- package/lib/types/ink/timeline-rail.js +179 -0
- package/lib/types/ink/wrap-text.d.ts.map +1 -1
- package/lib/types/ink/wrap-text.js +47 -5
- package/lib/types/migrationPrefs.d.ts +60 -0
- package/lib/types/migrationPrefs.d.ts.map +1 -0
- package/lib/types/migrationPrefs.js +97 -0
- package/lib/types/modelGroups.d.ts +72 -0
- package/lib/types/modelGroups.d.ts.map +1 -0
- package/lib/types/modelGroups.js +97 -0
- package/lib/types/modelRecents.d.ts +39 -0
- package/lib/types/modelRecents.d.ts.map +1 -0
- package/lib/types/modelRecents.js +97 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts +11 -0
- package/lib/types/native-ts/yoga-layout/index.d.ts.map +1 -1
- package/lib/types/native-ts/yoga-layout/index.js +31 -1
- package/lib/types/oauth.d.ts +15 -0
- package/lib/types/oauth.d.ts.map +1 -0
- package/lib/types/oauth.js +14 -0
- package/lib/types/reload.d.ts +109 -0
- package/lib/types/reload.d.ts.map +1 -0
- package/lib/types/reload.js +118 -0
- package/lib/types/screens/Chat.d.ts +3 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +1377 -371
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +56 -29
- package/lib/types/screens/SessionTree.d.ts +27 -0
- package/lib/types/screens/SessionTree.d.ts.map +1 -0
- package/lib/types/screens/SessionTree.js +555 -0
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +64 -22
- package/lib/types/screens/StatusLine.d.ts +0 -8
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +224 -45
- package/lib/types/screens/StatusMetrics.d.ts +35 -3
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +63 -8
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
- package/lib/types/screens/TrajectoryScene.js +81 -14
- package/lib/types/screens/chatOverlay.d.ts +237 -0
- package/lib/types/screens/chatOverlay.d.ts.map +1 -0
- package/lib/types/screens/chatOverlay.js +116 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +64 -10
- package/lib/types/tuiDisplayPrefs.d.ts +15 -0
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +9 -0
- package/lib/types/update.d.ts +139 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +382 -30
- package/lib/types/utils/debug.d.ts +10 -0
- package/lib/types/utils/debug.d.ts.map +1 -1
- package/lib/types/utils/debug.js +24 -0
- package/lib/types/utils/fileTarget.d.ts +46 -0
- package/lib/types/utils/fileTarget.d.ts.map +1 -0
- package/lib/types/utils/fileTarget.js +178 -0
- package/lib/types/utils/keymap.d.ts +134 -0
- package/lib/types/utils/keymap.d.ts.map +1 -0
- package/lib/types/utils/keymap.js +311 -0
- package/lib/types/utils/mentions.d.ts +25 -2
- package/lib/types/utils/mentions.d.ts.map +1 -1
- package/lib/types/utils/mentions.js +69 -10
- package/lib/types/utils/openExternal.d.ts +50 -0
- package/lib/types/utils/openExternal.d.ts.map +1 -0
- package/lib/types/utils/openExternal.js +170 -0
- package/lib/types/utils/paths.d.ts.map +1 -1
- package/lib/types/utils/paths.js +1 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +21 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +140 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/cordis.patch.yml +11 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +44 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/command.d.ts +14 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/command.js +67 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.d.ts +64 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/credentials.js +170 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.d.ts +79 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/index.js +196 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.d.ts +68 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.js +193 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/opener.d.ts +32 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/opener.js +101 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.d.ts +31 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/profiles.js +68 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.d.ts +69 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/service.js +129 -0
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +70 -0
- package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/command/LICENSE +21 -21
- package/node_modules/@dsh-std/command/README.md +26 -26
- package/node_modules/@dsh-std/command/README.zh.md +28 -28
- package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/command/package.json +22 -22
- package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/node_modules/@dsh-std/connection/README.md +42 -42
- package/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/node_modules/@dsh-std/connection/package.json +20 -20
- package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/core/LICENSE +21 -21
- package/node_modules/@dsh-std/core/README.md +13 -13
- package/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/core/package.json +21 -21
- package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/node_modules/@dsh-std/manifest/README.md +5 -5
- package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/manifest/package.json +20 -20
- package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/messages/LICENSE +21 -21
- package/node_modules/@dsh-std/messages/README.md +5 -5
- package/node_modules/@dsh-std/messages/README.zh.md +7 -7
- package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/messages/package.json +20 -20
- package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
- package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/node_modules/@dsh-std/presentation/README.md +27 -27
- package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/presentation/package.json +25 -25
- package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/storage/LICENSE +21 -21
- package/node_modules/@dsh-std/storage/README.md +5 -5
- package/node_modules/@dsh-std/storage/README.zh.md +7 -7
- package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/storage/package.json +20 -20
- package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
- package/package.json +19 -5
- package/presets/liangshen/.dsh-tui-managed.json +1 -1
- package/presets/liangshen/instruction-hint.mjs +8 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PointerEvent, type PointerEventInit } from './pointer-event.js';
|
|
2
2
|
/**
|
|
3
3
|
* Mouse click event. Fired on left-button release without drag, only when
|
|
4
4
|
* mouse tracking is enabled (i.e. inside <AlternateScreen>).
|
|
5
5
|
*
|
|
6
6
|
* Bubbles from the deepest hit node up through parentNode. Call
|
|
7
7
|
* stopImmediatePropagation() to prevent ancestors' onClick from firing.
|
|
8
|
+
*
|
|
9
|
+
* Extends PointerEvent: `shift`/`alt`/`ctrl` expose the modifiers the
|
|
10
|
+
* terminal reported on the release, and `localCol`/`localRow` are recomputed
|
|
11
|
+
* per handler so containers see coordinates relative to themselves.
|
|
8
12
|
*/
|
|
9
|
-
export declare class ClickEvent extends
|
|
10
|
-
/** 0-indexed screen column of the click */
|
|
11
|
-
readonly col: number;
|
|
12
|
-
/** 0-indexed screen row of the click */
|
|
13
|
-
readonly row: number;
|
|
14
|
-
/**
|
|
15
|
-
* Click column relative to the current handler's Box (col - box.x).
|
|
16
|
-
* Recomputed by dispatchClick before each handler fires, so an onClick
|
|
17
|
-
* on a container sees coords relative to that container, not to any
|
|
18
|
-
* child the click landed on.
|
|
19
|
-
*/
|
|
20
|
-
localCol: number;
|
|
21
|
-
/** Click row relative to the current handler's Box (row - box.y). */
|
|
22
|
-
localRow: number;
|
|
13
|
+
export declare class ClickEvent extends PointerEvent {
|
|
23
14
|
/**
|
|
24
15
|
* True if the clicked cell has no visible content (unwritten in the
|
|
25
16
|
* screen buffer — both packed words are 0). Handlers can check this to
|
|
@@ -27,6 +18,6 @@ export declare class ClickEvent extends Event {
|
|
|
27
18
|
* clicks on empty terminal space don't toggle state.
|
|
28
19
|
*/
|
|
29
20
|
readonly cellIsBlank: boolean;
|
|
30
|
-
constructor(col: number, row: number, cellIsBlank: boolean);
|
|
21
|
+
constructor(col: number, row: number, cellIsBlank: boolean, init?: PointerEventInit);
|
|
31
22
|
}
|
|
32
23
|
//# sourceMappingURL=click-event.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click-event.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/click-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"click-event.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/click-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAExE;;;;;;;;;;GAUG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;gBAG3B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,OAAO,EACpB,IAAI,CAAC,EAAE,gBAAgB;CAa1B"}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PointerEvent } from './pointer-event.js';
|
|
2
2
|
/**
|
|
3
3
|
* Mouse click event. Fired on left-button release without drag, only when
|
|
4
4
|
* mouse tracking is enabled (i.e. inside <AlternateScreen>).
|
|
5
5
|
*
|
|
6
6
|
* Bubbles from the deepest hit node up through parentNode. Call
|
|
7
7
|
* stopImmediatePropagation() to prevent ancestors' onClick from firing.
|
|
8
|
+
*
|
|
9
|
+
* Extends PointerEvent: `shift`/`alt`/`ctrl` expose the modifiers the
|
|
10
|
+
* terminal reported on the release, and `localCol`/`localRow` are recomputed
|
|
11
|
+
* per handler so containers see coordinates relative to themselves.
|
|
8
12
|
*/
|
|
9
|
-
export class ClickEvent extends
|
|
10
|
-
/** 0-indexed screen column of the click */
|
|
11
|
-
col;
|
|
12
|
-
/** 0-indexed screen row of the click */
|
|
13
|
-
row;
|
|
14
|
-
/**
|
|
15
|
-
* Click column relative to the current handler's Box (col - box.x).
|
|
16
|
-
* Recomputed by dispatchClick before each handler fires, so an onClick
|
|
17
|
-
* on a container sees coords relative to that container, not to any
|
|
18
|
-
* child the click landed on.
|
|
19
|
-
*/
|
|
20
|
-
localCol = 0;
|
|
21
|
-
/** Click row relative to the current handler's Box (row - box.y). */
|
|
22
|
-
localRow = 0;
|
|
13
|
+
export class ClickEvent extends PointerEvent {
|
|
23
14
|
/**
|
|
24
15
|
* True if the clicked cell has no visible content (unwritten in the
|
|
25
16
|
* screen buffer — both packed words are 0). Handlers can check this to
|
|
@@ -27,10 +18,16 @@ export class ClickEvent extends Event {
|
|
|
27
18
|
* clicks on empty terminal space don't toggle state.
|
|
28
19
|
*/
|
|
29
20
|
cellIsBlank;
|
|
30
|
-
constructor(col, row, cellIsBlank) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
constructor(col, row, cellIsBlank, init) {
|
|
22
|
+
// A click is by definition a left-button release without drag. Normalize
|
|
23
|
+
// the low button bits to 0 (left) while preserving modifier bits
|
|
24
|
+
// (0x04 shift / 0x08 alt / 0x10 ctrl) from the release byte.
|
|
25
|
+
const button = init?.button ?? 0;
|
|
26
|
+
super('click', col, row, {
|
|
27
|
+
...init,
|
|
28
|
+
action: 'release',
|
|
29
|
+
button: button & ~0x03,
|
|
30
|
+
});
|
|
34
31
|
this.cellIsBlank = cellIsBlank;
|
|
35
32
|
}
|
|
36
33
|
}
|
|
@@ -2,13 +2,22 @@ import type { ClickEvent } from './click-event.js';
|
|
|
2
2
|
import type { FocusEvent } from './focus-event.js';
|
|
3
3
|
import type { KeyboardEvent } from './keyboard-event.js';
|
|
4
4
|
import type { PasteEvent } from './paste-event.js';
|
|
5
|
+
import type { PointerEvent } from './pointer-event.js';
|
|
5
6
|
import type { ResizeEvent } from './resize-event.js';
|
|
7
|
+
import type { WheelEvent } from './wheel-event.js';
|
|
6
8
|
type KeyboardEventHandler = (event: KeyboardEvent) => void;
|
|
7
9
|
type FocusEventHandler = (event: FocusEvent) => void;
|
|
8
10
|
type PasteEventHandler = (event: PasteEvent) => void;
|
|
9
11
|
type ResizeEventHandler = (event: ResizeEvent) => void;
|
|
10
12
|
type ClickEventHandler = (event: ClickEvent) => void;
|
|
11
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Hover handlers receive the pointer position. Existing `() => void`
|
|
15
|
+
* handlers remain assignable (a function taking fewer parameters is
|
|
16
|
+
* assignable to one taking more), so this widening is fully backwards
|
|
17
|
+
* compatible.
|
|
18
|
+
*/
|
|
19
|
+
type HoverEventHandler = (event: PointerEvent) => void;
|
|
20
|
+
type WheelEventHandler = (event: WheelEvent) => void;
|
|
12
21
|
/**
|
|
13
22
|
* Props for event handlers on Box and other host components.
|
|
14
23
|
*
|
|
@@ -29,6 +38,7 @@ export type EventHandlerProps = {
|
|
|
29
38
|
onClick?: ClickEventHandler;
|
|
30
39
|
onMouseEnter?: HoverEventHandler;
|
|
31
40
|
onMouseLeave?: HoverEventHandler;
|
|
41
|
+
onWheel?: WheelEventHandler;
|
|
32
42
|
};
|
|
33
43
|
/**
|
|
34
44
|
* Reverse lookup: event type string → handler prop names.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/event-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"event-handlers.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/event-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,KAAK,oBAAoB,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;AAC1D,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;AACpD,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;AACpD,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;AACtD,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;AACpD;;;;;GAKG;AACH,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAA;AACtD,KAAK,iBAAiB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,oBAAoB,CAAA;IAChC,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IAEvC,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,cAAc,CAAC,EAAE,iBAAiB,CAAA;IAClC,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,aAAa,CAAC,EAAE,iBAAiB,CAAA;IAEjC,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,cAAc,CAAC,EAAE,iBAAiB,CAAA;IAElC,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAE7B,OAAO,CAAC,EAAE,iBAAiB,CAAA;IAC3B,YAAY,CAAC,EAAE,iBAAiB,CAAA;IAChC,YAAY,CAAC,EAAE,iBAAiB,CAAA;IAChC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,MAAM,EACN;IAAE,MAAM,CAAC,EAAE,MAAM,iBAAiB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,iBAAiB,CAAA;CAAE,CASxE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,aAc9B,CAAA"}
|
|
@@ -9,6 +9,7 @@ export const HANDLER_FOR_EVENT = {
|
|
|
9
9
|
paste: { bubble: 'onPaste', capture: 'onPasteCapture' },
|
|
10
10
|
resize: { bubble: 'onResize' },
|
|
11
11
|
click: { bubble: 'onClick' },
|
|
12
|
+
wheel: { bubble: 'onWheel' },
|
|
12
13
|
};
|
|
13
14
|
/**
|
|
14
15
|
* Set of all event handler prop names, for the reconciler to detect
|
|
@@ -27,4 +28,5 @@ export const EVENT_HANDLER_PROPS = new Set([
|
|
|
27
28
|
'onClick',
|
|
28
29
|
'onMouseEnter',
|
|
29
30
|
'onMouseLeave',
|
|
31
|
+
'onWheel',
|
|
30
32
|
]);
|
|
@@ -13,6 +13,8 @@ export type Key = {
|
|
|
13
13
|
pageUp: boolean;
|
|
14
14
|
wheelUp: boolean;
|
|
15
15
|
wheelDown: boolean;
|
|
16
|
+
wheelLeft: boolean;
|
|
17
|
+
wheelRight: boolean;
|
|
16
18
|
home: boolean;
|
|
17
19
|
end: boolean;
|
|
18
20
|
return: boolean;
|
|
@@ -25,6 +27,13 @@ export type Key = {
|
|
|
25
27
|
delete: boolean;
|
|
26
28
|
meta: boolean;
|
|
27
29
|
super: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Pointer column (0-indexed) when the key is a wheel event — the SGR/X10
|
|
32
|
+
* sequence carries the position. Undefined for non-wheel keys.
|
|
33
|
+
*/
|
|
34
|
+
mouseCol?: number;
|
|
35
|
+
/** Pointer row (0-indexed) when the key is a wheel event. See mouseCol. */
|
|
36
|
+
mouseRow?: number;
|
|
28
37
|
};
|
|
29
38
|
/**
|
|
30
39
|
* Event fired for each input chunk received from stdin (a typed character or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-event.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/input-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,IAAI,EAAE,OAAO,CAAA;IACb,GAAG,EAAE,OAAO,CAAA;IACZ,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"input-event.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/input-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC;;;GAGG;AACH,MAAM,MAAM,GAAG,GAAG;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,IAAI,EAAE,OAAO,CAAA;IACb,GAAG,EAAE,OAAO,CAAA;IACZ,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,EAAE,EAAE,OAAO,CAAA;IACX,GAAG,EAAE,OAAO,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AA2KD;;;GAGG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAA;IAEjB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB;;;wBAGoB;IACpB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;gBAEd,QAAQ,EAAE,SAAS;CAShC"}
|
|
@@ -10,6 +10,8 @@ function parseKey(keypress) {
|
|
|
10
10
|
pageUp: keypress.name === 'pageup',
|
|
11
11
|
wheelUp: keypress.name === 'wheelup',
|
|
12
12
|
wheelDown: keypress.name === 'wheeldown',
|
|
13
|
+
wheelLeft: keypress.name === 'wheelleft',
|
|
14
|
+
wheelRight: keypress.name === 'wheelright',
|
|
13
15
|
home: keypress.name === 'home',
|
|
14
16
|
end: keypress.name === 'end',
|
|
15
17
|
return: keypress.name === 'return',
|
|
@@ -29,6 +31,8 @@ function parseKey(keypress) {
|
|
|
29
31
|
// protocol CSI u sequences. Distinct from meta (Alt/Option) so
|
|
30
32
|
// bindings like cmd+c can be expressed separately from opt+c.
|
|
31
33
|
super: keypress.super,
|
|
34
|
+
mouseCol: keypress.mouseCol,
|
|
35
|
+
mouseRow: keypress.mouseRow,
|
|
32
36
|
};
|
|
33
37
|
let input = keypress.ctrl ? keypress.name : keypress.sequence;
|
|
34
38
|
// Handle undefined input case
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { TerminalEvent, type EventTarget } from './terminal-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pointer action reported by the terminal protocol.
|
|
4
|
+
*
|
|
5
|
+
* - `press`: a button went down (SGR `M` terminator / X10 press)
|
|
6
|
+
* - `release`: a button came up (SGR `m` terminator; X10 cannot report this)
|
|
7
|
+
* - `move`: pointer motion (SGR drag bit or mode-1003 no-button motion)
|
|
8
|
+
*/
|
|
9
|
+
export type PointerAction = 'press' | 'release' | 'move';
|
|
10
|
+
/** Optional state when constructing a {@link PointerEvent}. */
|
|
11
|
+
export type PointerEventInit = {
|
|
12
|
+
/** Raw protocol button byte (SGR bits: 0x04 shift, 0x08 alt, 0x10 ctrl). */
|
|
13
|
+
button?: number;
|
|
14
|
+
action?: PointerAction;
|
|
15
|
+
bubbles?: boolean;
|
|
16
|
+
cancelable?: boolean;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Base class for pointer-derived terminal events (click, wheel, hover).
|
|
20
|
+
*
|
|
21
|
+
* Carries the raw SGR/X10 button byte so handlers can read modifier flags
|
|
22
|
+
* (`shift`/`alt`/`ctrl`) without re-parsing the escape sequence, plus
|
|
23
|
+
* per-handler local coordinates: `_prepareForTarget` recomputes
|
|
24
|
+
* `localCol`/`localRow` from the nodeCache rect before each handler fires,
|
|
25
|
+
* so an onClick on a container sees coordinates relative to that container,
|
|
26
|
+
* not to the child the pointer actually landed on.
|
|
27
|
+
*
|
|
28
|
+
* `meta` is deliberately always false: xterm.js drops metaKey before SGR
|
|
29
|
+
* encoding (the SGR bit we call "meta" is wired to alt), so no pointer
|
|
30
|
+
* protocol can distinguish it reliably.
|
|
31
|
+
*/
|
|
32
|
+
export declare class PointerEvent extends TerminalEvent {
|
|
33
|
+
/** 0-indexed screen column of the pointer. */
|
|
34
|
+
readonly col: number;
|
|
35
|
+
/** 0-indexed screen row of the pointer. */
|
|
36
|
+
readonly row: number;
|
|
37
|
+
/** Raw protocol button byte (SGR encoding). */
|
|
38
|
+
readonly button: number;
|
|
39
|
+
/** Which pointer action produced this event. */
|
|
40
|
+
readonly action: PointerAction;
|
|
41
|
+
/** Shift held (SGR button bit 0x04). */
|
|
42
|
+
readonly shift: boolean;
|
|
43
|
+
/** Alt/Option held (SGR button bit 0x08). */
|
|
44
|
+
readonly alt: boolean;
|
|
45
|
+
/** Ctrl held (SGR button bit 0x10). */
|
|
46
|
+
readonly ctrl: boolean;
|
|
47
|
+
/** Always false — see class doc. */
|
|
48
|
+
readonly meta = false;
|
|
49
|
+
/** Column relative to the current handler's node (set during dispatch). */
|
|
50
|
+
localCol: number;
|
|
51
|
+
/** Row relative to the current handler's node (set during dispatch). */
|
|
52
|
+
localRow: number;
|
|
53
|
+
constructor(type: string, col: number, row: number, init?: PointerEventInit);
|
|
54
|
+
/**
|
|
55
|
+
* Refresh localCol/localRow for the node whose handler is about to run.
|
|
56
|
+
* Nodes without a cached rect (not rendered this frame) get 0,0 — handlers
|
|
57
|
+
* should prefer absolute col/row when that distinction matters.
|
|
58
|
+
*/
|
|
59
|
+
_prepareForTarget(target: EventTarget): void;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=pointer-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pointer-event.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/pointer-event.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAErE;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;AAExD,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG;IAC7B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,YAAa,SAAQ,aAAa;IAC7C,8CAA8C;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,6CAA6C;IAC7C,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAA;IACrB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;IACtB,oCAAoC;IACpC,QAAQ,CAAC,IAAI,SAAQ;IACrB,2EAA2E;IAC3E,QAAQ,SAAI;IACZ,wEAAwE;IACxE,QAAQ,SAAI;gBAEA,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,gBAAgB;IAc3E;;;;OAIG;IACM,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;CAKtD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { nodeCache } from '../node-cache.js';
|
|
2
|
+
import { TerminalEvent } from './terminal-event.js';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for pointer-derived terminal events (click, wheel, hover).
|
|
5
|
+
*
|
|
6
|
+
* Carries the raw SGR/X10 button byte so handlers can read modifier flags
|
|
7
|
+
* (`shift`/`alt`/`ctrl`) without re-parsing the escape sequence, plus
|
|
8
|
+
* per-handler local coordinates: `_prepareForTarget` recomputes
|
|
9
|
+
* `localCol`/`localRow` from the nodeCache rect before each handler fires,
|
|
10
|
+
* so an onClick on a container sees coordinates relative to that container,
|
|
11
|
+
* not to the child the pointer actually landed on.
|
|
12
|
+
*
|
|
13
|
+
* `meta` is deliberately always false: xterm.js drops metaKey before SGR
|
|
14
|
+
* encoding (the SGR bit we call "meta" is wired to alt), so no pointer
|
|
15
|
+
* protocol can distinguish it reliably.
|
|
16
|
+
*/
|
|
17
|
+
export class PointerEvent extends TerminalEvent {
|
|
18
|
+
/** 0-indexed screen column of the pointer. */
|
|
19
|
+
col;
|
|
20
|
+
/** 0-indexed screen row of the pointer. */
|
|
21
|
+
row;
|
|
22
|
+
/** Raw protocol button byte (SGR encoding). */
|
|
23
|
+
button;
|
|
24
|
+
/** Which pointer action produced this event. */
|
|
25
|
+
action;
|
|
26
|
+
/** Shift held (SGR button bit 0x04). */
|
|
27
|
+
shift;
|
|
28
|
+
/** Alt/Option held (SGR button bit 0x08). */
|
|
29
|
+
alt;
|
|
30
|
+
/** Ctrl held (SGR button bit 0x10). */
|
|
31
|
+
ctrl;
|
|
32
|
+
/** Always false — see class doc. */
|
|
33
|
+
meta = false;
|
|
34
|
+
/** Column relative to the current handler's node (set during dispatch). */
|
|
35
|
+
localCol = 0;
|
|
36
|
+
/** Row relative to the current handler's node (set during dispatch). */
|
|
37
|
+
localRow = 0;
|
|
38
|
+
constructor(type, col, row, init) {
|
|
39
|
+
super(type, {
|
|
40
|
+
bubbles: init?.bubbles ?? true,
|
|
41
|
+
cancelable: init?.cancelable ?? true,
|
|
42
|
+
});
|
|
43
|
+
this.col = col;
|
|
44
|
+
this.row = row;
|
|
45
|
+
this.button = init?.button ?? 0;
|
|
46
|
+
this.action = init?.action ?? 'move';
|
|
47
|
+
this.shift = (this.button & 0x04) !== 0;
|
|
48
|
+
this.alt = (this.button & 0x08) !== 0;
|
|
49
|
+
this.ctrl = (this.button & 0x10) !== 0;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Refresh localCol/localRow for the node whose handler is about to run.
|
|
53
|
+
* Nodes without a cached rect (not rendered this frame) get 0,0 — handlers
|
|
54
|
+
* should prefer absolute col/row when that distinction matters.
|
|
55
|
+
*/
|
|
56
|
+
_prepareForTarget(target) {
|
|
57
|
+
const rect = nodeCache.get(target);
|
|
58
|
+
this.localCol = rect ? this.col - rect.x : 0;
|
|
59
|
+
this.localRow = rect ? this.row - rect.y : 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PointerEvent, type PointerEventInit } from './pointer-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Mouse wheel event dispatched to the ScrollBox under the pointer.
|
|
4
|
+
*
|
|
5
|
+
* `deltaY`/`deltaX` are in terminal rows/columns per wheel notch (positive =
|
|
6
|
+
* content moves up / right, i.e. scroll down / scroll right), matching
|
|
7
|
+
* ScrollBox.scrollBy's sign convention. Coordinates identify where the wheel
|
|
8
|
+
* event occurred so routing can hit-test the deepest scroll container.
|
|
9
|
+
*/
|
|
10
|
+
export declare class WheelEvent extends PointerEvent {
|
|
11
|
+
/** Rows to scroll (positive = scroll down). */
|
|
12
|
+
readonly deltaY: number;
|
|
13
|
+
/** Columns to scroll (positive = scroll right; currently informational). */
|
|
14
|
+
readonly deltaX: number;
|
|
15
|
+
constructor(col: number, row: number, deltaY: number, deltaX?: number, init?: PointerEventInit);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=wheel-event.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wheel-event.d.ts","sourceRoot":"","sources":["../../../../src/ink/events/wheel-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAExE;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,YAAY;IAC1C,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBAGrB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,MAAM,SAAI,EACV,IAAI,CAAC,EAAE,gBAAgB;CAM1B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PointerEvent } from './pointer-event.js';
|
|
2
|
+
/**
|
|
3
|
+
* Mouse wheel event dispatched to the ScrollBox under the pointer.
|
|
4
|
+
*
|
|
5
|
+
* `deltaY`/`deltaX` are in terminal rows/columns per wheel notch (positive =
|
|
6
|
+
* content moves up / right, i.e. scroll down / scroll right), matching
|
|
7
|
+
* ScrollBox.scrollBy's sign convention. Coordinates identify where the wheel
|
|
8
|
+
* event occurred so routing can hit-test the deepest scroll container.
|
|
9
|
+
*/
|
|
10
|
+
export class WheelEvent extends PointerEvent {
|
|
11
|
+
/** Rows to scroll (positive = scroll down). */
|
|
12
|
+
deltaY;
|
|
13
|
+
/** Columns to scroll (positive = scroll right; currently informational). */
|
|
14
|
+
deltaX;
|
|
15
|
+
constructor(col, row, deltaY, deltaX = 0, init) {
|
|
16
|
+
super('wheel', col, row, { ...init, action: 'move' });
|
|
17
|
+
this.deltaY = deltaY;
|
|
18
|
+
this.deltaX = deltaX;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type FrameCause = 'react-commit' | 'animation' | 'scroll' | 'scroll-drain' | 'measure' | 'resize' | 'reanchor' | 'immediate';
|
|
2
|
+
export declare const GEOMETRY_TRACE_ENABLED: boolean;
|
|
3
|
+
export type ScrollGeometryNote = {
|
|
4
|
+
sticky: boolean;
|
|
5
|
+
shrunk: boolean;
|
|
6
|
+
grew: boolean;
|
|
7
|
+
atBottom: boolean;
|
|
8
|
+
/** scrollTop captured before at-bottom follow (the user's logical view). */
|
|
9
|
+
scrollTopBeforeFollow: number;
|
|
10
|
+
/** scrollTop after pendingScrollDelta drain, before clamps. */
|
|
11
|
+
cur: number;
|
|
12
|
+
/** scrollTop written back to the DOM node (post follow/drain, pre virtual clamp). */
|
|
13
|
+
scrollTop: number;
|
|
14
|
+
/** What actually gets painted this frame (post cMin/cMax virtual clamp). */
|
|
15
|
+
renderScrollTop: number;
|
|
16
|
+
scrollHeight: number;
|
|
17
|
+
prevScrollHeight: number;
|
|
18
|
+
innerHeight: number;
|
|
19
|
+
maxScroll: number;
|
|
20
|
+
prevMaxScroll: number;
|
|
21
|
+
clampMin: number | null;
|
|
22
|
+
clampMax: number | null;
|
|
23
|
+
};
|
|
24
|
+
export type ListGeometryNote = {
|
|
25
|
+
start: number;
|
|
26
|
+
end: number;
|
|
27
|
+
topPad: number;
|
|
28
|
+
bottomPad: number;
|
|
29
|
+
/** Estimated total content height from cached row heights. */
|
|
30
|
+
total: number;
|
|
31
|
+
base: number;
|
|
32
|
+
sticky: boolean;
|
|
33
|
+
pending: number;
|
|
34
|
+
viewport: number;
|
|
35
|
+
termRows: number;
|
|
36
|
+
columns: number;
|
|
37
|
+
rowCount: number;
|
|
38
|
+
};
|
|
39
|
+
/** Tag the origin of the next painted frame. First note in the window wins. */
|
|
40
|
+
export declare function noteFrameCause(cause: FrameCause): void;
|
|
41
|
+
/** Renderer-side note, one per ScrollBox encountered during the paint. */
|
|
42
|
+
export declare function noteScrollGeometry(note: ScrollGeometryNote): void;
|
|
43
|
+
/** React-side note from MessageList's virtualization pass (latest wins). */
|
|
44
|
+
export declare function noteListGeometry(note: ListGeometryNote): void;
|
|
45
|
+
/** Scalar forensics (PromptInput content rows, …). Latest wins. */
|
|
46
|
+
export declare function noteAuxNumber(key: string, value: number): void;
|
|
47
|
+
/** Paint begins: just tag the frame id — inter-frame notes belong to it. */
|
|
48
|
+
export declare function beginGeometryFrame(frame: number): void;
|
|
49
|
+
/** Paint ends: flush one JSON line and reset the inter-frame window. */
|
|
50
|
+
export declare function endGeometryFrame(durationMs: number): void;
|
|
51
|
+
//# sourceMappingURL=geometry-trace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry-trace.d.ts","sourceRoot":"","sources":["../../../src/ink/geometry-trace.ts"],"names":[],"mappings":"AAoBA,MAAM,MAAM,UAAU,GAClB,cAAc,GACd,WAAW,GACX,QAAQ,GACR,cAAc,GACd,SAAS,GACT,QAAQ,GACR,UAAU,GACV,WAAW,CAAA;AAEf,eAAO,MAAM,sBAAsB,SACQ,CAAA;AAI3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,4EAA4E;IAC5E,qBAAqB,EAAE,MAAM,CAAA;IAC7B,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAA;IACX,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAA;IACjB,4EAA4E;IAC5E,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,gBAAgB,EAAE,MAAM,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAkBD,+EAA+E;AAC/E,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAGtD;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAGjE;AAED,4EAA4E;AAC5E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAG7D;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAG9D;AAED,4EAA4E;AAC5E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAGtD;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAmBzD"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry forensics — per-frame scroll-geometry trace (issues #421/#433).
|
|
3
|
+
*
|
|
4
|
+
* `DSH_TUI_GEOMETRY_TRACE=<file>` appends one JSON line per painted frame:
|
|
5
|
+
* the frame's trigger cause, every ScrollBox's resolved geometry (scrollTop
|
|
6
|
+
* before/after follow + drain + virtual clamp, scrollHeight/maxScroll
|
|
7
|
+
* prev/cur, sticky/shrunk/grew flags, clamp bounds), the MessageList
|
|
8
|
+
* virtualization window, and aux counters (e.g. PromptInput content rows).
|
|
9
|
+
*
|
|
10
|
+
* Zero overhead when the env is unset: every entry point returns on a
|
|
11
|
+
* module-const boolean, so the disabled path is a single predictable branch.
|
|
12
|
+
*
|
|
13
|
+
* Ordering contract: causes and React-side notes (list geometry, aux) land
|
|
14
|
+
* BETWEEN frames — at event/commit time, before the throttled paint. The
|
|
15
|
+
* renderer adds scroll geometry during the paint; endGeometryFrame flushes
|
|
16
|
+
* and resets. First-noted cause wins (the origin of the frame chain); no
|
|
17
|
+
* note at paint time means a plain reconciler commit.
|
|
18
|
+
*/
|
|
19
|
+
import { appendFileSync } from 'node:fs';
|
|
20
|
+
export const GEOMETRY_TRACE_ENABLED = process.env.DSH_TUI_GEOMETRY_TRACE !== undefined &&
|
|
21
|
+
process.env.DSH_TUI_GEOMETRY_TRACE !== '';
|
|
22
|
+
const TRACE_PATH = process.env.DSH_TUI_GEOMETRY_TRACE ?? '';
|
|
23
|
+
let state = {
|
|
24
|
+
frame: -1,
|
|
25
|
+
cause: null,
|
|
26
|
+
scroll: [],
|
|
27
|
+
list: null,
|
|
28
|
+
aux: {}
|
|
29
|
+
};
|
|
30
|
+
/** Tag the origin of the next painted frame. First note in the window wins. */
|
|
31
|
+
export function noteFrameCause(cause) {
|
|
32
|
+
if (!GEOMETRY_TRACE_ENABLED)
|
|
33
|
+
return;
|
|
34
|
+
if (state.cause === null)
|
|
35
|
+
state.cause = cause;
|
|
36
|
+
}
|
|
37
|
+
/** Renderer-side note, one per ScrollBox encountered during the paint. */
|
|
38
|
+
export function noteScrollGeometry(note) {
|
|
39
|
+
if (!GEOMETRY_TRACE_ENABLED)
|
|
40
|
+
return;
|
|
41
|
+
state.scroll.push(note);
|
|
42
|
+
}
|
|
43
|
+
/** React-side note from MessageList's virtualization pass (latest wins). */
|
|
44
|
+
export function noteListGeometry(note) {
|
|
45
|
+
if (!GEOMETRY_TRACE_ENABLED)
|
|
46
|
+
return;
|
|
47
|
+
state.list = note;
|
|
48
|
+
}
|
|
49
|
+
/** Scalar forensics (PromptInput content rows, …). Latest wins. */
|
|
50
|
+
export function noteAuxNumber(key, value) {
|
|
51
|
+
if (!GEOMETRY_TRACE_ENABLED)
|
|
52
|
+
return;
|
|
53
|
+
state.aux[key] = value;
|
|
54
|
+
}
|
|
55
|
+
/** Paint begins: just tag the frame id — inter-frame notes belong to it. */
|
|
56
|
+
export function beginGeometryFrame(frame) {
|
|
57
|
+
if (!GEOMETRY_TRACE_ENABLED)
|
|
58
|
+
return;
|
|
59
|
+
state.frame = frame;
|
|
60
|
+
}
|
|
61
|
+
/** Paint ends: flush one JSON line and reset the inter-frame window. */
|
|
62
|
+
export function endGeometryFrame(durationMs) {
|
|
63
|
+
if (!GEOMETRY_TRACE_ENABLED)
|
|
64
|
+
return;
|
|
65
|
+
if (state.frame >= 0) {
|
|
66
|
+
const line = JSON.stringify({
|
|
67
|
+
t: new Date().toISOString(),
|
|
68
|
+
frame: state.frame,
|
|
69
|
+
cause: state.cause ?? 'react-commit',
|
|
70
|
+
ms: Math.round(durationMs * 10) / 10,
|
|
71
|
+
scroll: state.scroll,
|
|
72
|
+
list: state.list,
|
|
73
|
+
aux: state.aux
|
|
74
|
+
});
|
|
75
|
+
try {
|
|
76
|
+
appendFileSync(TRACE_PATH, line + '\n');
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
// Unwritable path etc. — forensics must never break rendering.
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
state = { frame: -1, cause: null, scroll: [], list: null, aux: {} };
|
|
83
|
+
}
|
|
@@ -16,18 +16,69 @@ import type { DOMElement } from './dom.js';
|
|
|
16
16
|
* @returns the deepest element whose rect contains (col, row), or null.
|
|
17
17
|
*/
|
|
18
18
|
export declare function hitTest(node: DOMElement, col: number, row: number): DOMElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* hitTest, but overlay-aware: absolute-positioned nodes can paint OUTSIDE
|
|
21
|
+
* every ancestor's rect (OverlayAbove's `bottom:'100%'` pickers float over
|
|
22
|
+
* the transcript), so the plain containment recursion never reaches them —
|
|
23
|
+
* a click on the picker lands in the ScrollBox's rows instead. Check the
|
|
24
|
+
* frame's absolute hit list FIRST, in reverse paint order (later = visually
|
|
25
|
+
* on top), then fall back to the in-flow tree.
|
|
26
|
+
* @param root - the tree root for the in-flow fallback.
|
|
27
|
+
* @param col - the screen column to test.
|
|
28
|
+
* @param row - the screen row to test.
|
|
29
|
+
* @returns the deepest element at (col, row), or null.
|
|
30
|
+
*/
|
|
31
|
+
export declare function hitTestWithOverlays(root: DOMElement, col: number, row: number): DOMElement | null;
|
|
19
32
|
/**
|
|
20
33
|
* Hit-test the root at (col, row) and bubble a ClickEvent from the deepest
|
|
21
34
|
* containing node up through parentNode. Only nodes with an onClick handler
|
|
22
35
|
* fire. Stops when a handler calls stopImmediatePropagation(). Returns
|
|
23
36
|
* true if at least one onClick handler fired.
|
|
37
|
+
*
|
|
38
|
+
* Each handler call is isolated: a throwing handler is logged and the
|
|
39
|
+
* bubbling continues, so one broken onClick cannot swallow the click from
|
|
40
|
+
* its ancestors or the rest of the input batch.
|
|
41
|
+
*
|
|
24
42
|
* @param root - the tree root to hit-test.
|
|
25
43
|
* @param col - the screen column of the click.
|
|
26
44
|
* @param row - the screen row of the click.
|
|
27
45
|
* @param cellIsBlank - whether the clicked cell is blank, reported on the event.
|
|
46
|
+
* @param button - raw SGR release byte (carries shift/alt/ctrl modifier bits).
|
|
28
47
|
* @returns true when at least one onClick handler fired.
|
|
29
48
|
*/
|
|
30
|
-
export declare function dispatchClick(root: DOMElement, col: number, row: number, cellIsBlank?: boolean): boolean;
|
|
49
|
+
export declare function dispatchClick(root: DOMElement, col: number, row: number, cellIsBlank?: boolean, button?: number): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Fire onMouseLeave on every tracked hover node, then empty the set.
|
|
52
|
+
*
|
|
53
|
+
* The pointer-state resets (alt-screen swap, terminal resize) drop the hover
|
|
54
|
+
* set because the geometry it was computed against is gone. But the React
|
|
55
|
+
* components behind those nodes still hold their `hovered=true` state: a bare
|
|
56
|
+
* `set.clear()` never tells them the pointer "left", so every row crossed
|
|
57
|
+
* before the reset keeps its highlight forever — the next motion event only
|
|
58
|
+
* fires enter on the new row (the old nodes are no longer in the set, so no
|
|
59
|
+
* diff ever produces their leave). Firing leave first is what makes the
|
|
60
|
+
* reset invisible to the rows.
|
|
61
|
+
*
|
|
62
|
+
* @param hovered - the tracked hover set; emptied in place.
|
|
63
|
+
* @param col - pointer column for the synthetic leave events (-1 = unknown).
|
|
64
|
+
* @param row - pointer row for the synthetic leave events.
|
|
65
|
+
*/
|
|
66
|
+
export declare function clearHovered(hovered: Set<DOMElement>, col?: number, row?: number): void;
|
|
67
|
+
/**
|
|
68
|
+
* Route a wheel event to the ScrollBox (or any onWheel handler) under the
|
|
69
|
+
* pointer. Dispatches through the shared Dispatcher at continuous priority
|
|
70
|
+
* so the event bubbles from the deepest hit node and React schedules any
|
|
71
|
+
* state updates at the right lane.
|
|
72
|
+
*
|
|
73
|
+
* @param root - the tree root to hit-test.
|
|
74
|
+
* @param col - the screen column of the wheel event.
|
|
75
|
+
* @param row - the screen row of the wheel event.
|
|
76
|
+
* @param deltaY - rows to scroll (positive = scroll down).
|
|
77
|
+
* @param deltaX - columns to scroll (positive = right; informational).
|
|
78
|
+
* @param button - raw SGR byte (carries modifier bits).
|
|
79
|
+
* @returns true when an onWheel handler existed under the pointer.
|
|
80
|
+
*/
|
|
81
|
+
export declare function dispatchWheel(root: DOMElement, col: number, row: number, deltaY: number, deltaX?: number, button?: number): boolean;
|
|
31
82
|
/**
|
|
32
83
|
* Fire onMouseEnter/onMouseLeave as the pointer moves. Like DOM
|
|
33
84
|
* mouseenter/mouseleave: does NOT bubble — moving between children does
|
|
@@ -35,6 +86,10 @@ export declare function dispatchClick(root: DOMElement, col: number, row: number
|
|
|
35
86
|
* ancestor with a hover handler; diffs against the previous hovered set;
|
|
36
87
|
* fires leave on the nodes exited, enter on the nodes entered.
|
|
37
88
|
*
|
|
89
|
+
* Handlers receive a PointerEvent ('hover') with the pointer position;
|
|
90
|
+
* existing `() => void` handlers simply ignore the argument. Each call is
|
|
91
|
+
* isolated so one throwing handler cannot break the rest of the diff.
|
|
92
|
+
*
|
|
38
93
|
* Mutates `hovered` in place so the caller (App instance) can hold it
|
|
39
94
|
* across calls. Clears the set when the hit is null (cursor moved into a
|
|
40
95
|
* non-rendered gap or off the root rect).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hit-test.d.ts","sourceRoot":"","sources":["../../../src/ink/hit-test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"hit-test.d.ts","sourceRoot":"","sources":["../../../src/ink/hit-test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAU1C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CACrB,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,UAAU,GAAG,IAAI,CAmBnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,UAAU,GAAG,IAAI,CAkBnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,WAAW,UAAQ,EACnB,MAAM,SAAI,GACT,OAAO,CA2CT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,EACxB,GAAG,SAAK,EACR,GAAG,SAAK,GACP,IAAI,CAiBN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,MAAM,SAAI,EACV,MAAM,SAAI,GACT,OAAO,CAcT;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,UAAU,EAChB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,GACvB,IAAI,CAwCN"}
|