@adea-ai/ui 0.152.4 → 0.154.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/README.md +469 -580
- package/dist/NOTICE +10 -1
- package/dist/components/composites/account-menu/account-menu.d.ts +5 -0
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +37 -13
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts +2 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +92 -66
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +57 -57
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +9 -9
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.d.ts +7 -7
- package/dist/components/composites/appearance-editor/theme-preview.d.ts +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +6 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +36 -36
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +4 -4
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js +33 -37
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint-model.d.ts +3 -3
- package/dist/components/composites/checkpoint/checkpoint-model.js +2 -2
- package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts +2 -2
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts +2 -2
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.d.ts +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +7 -3
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +1 -3
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/inline-citation/citation.d.ts +1 -1
- package/dist/components/composites/inline-citation/citation.js +1 -1
- package/dist/components/composites/inline-citation/citation.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts +2 -2
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +22 -22
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.d.ts +5 -0
- package/dist/components/composites/list-row/list-row.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row.js +75 -83
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts +19 -5
- package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
- package/dist/components/composites/model-selector/model-selector.js +263 -29
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/model-selector/models.d.ts +2 -2
- package/dist/components/composites/model-selector/models.js +1 -1
- package/dist/components/composites/model-selector/models.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +17 -15
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +5 -7
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts +4 -4
- package/dist/components/composites/reasoning/reasoning.js +4 -4
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +63 -14
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +32 -32
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/source.d.ts +1 -1
- package/dist/components/composites/sources/source.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts +2 -2
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.d.ts +3 -3
- package/dist/components/composites/stack-trace/parse-stack-trace.js +4 -4
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts +3 -3
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +14 -16
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +6 -4
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts +1 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts +3 -3
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal-model.d.ts +3 -3
- package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal-model.js +1 -1
- package/dist/components/composites/terminal/terminal-model.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +24 -11
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results-model.d.ts +4 -4
- package/dist/components/composites/test-results/test-results-model.js +2 -2
- package/dist/components/composites/test-results/test-results-model.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts +1 -1
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts +4 -4
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +25 -18
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.d.ts +10 -4
- package/dist/components/composites/update-dialog/channel-control.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +14 -19
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/index.d.ts +1 -1
- package/dist/components/composites/update-dialog/index.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +4 -5
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +19 -20
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +18 -20
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/composer-menu.d.ts +3 -3
- package/dist/components/conversation/composer-menu.js +3 -3
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +2 -4
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.d.ts.map +1 -1
- package/dist/components/conversation/conversation-pane.js +6 -5
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -7
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +76 -76
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +32 -38
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +79 -73
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/scroll-follow-core.d.ts +7 -7
- package/dist/components/conversation/scroll-follow-core.js +4 -4
- package/dist/components/conversation/scroll-follow-core.js.map +1 -1
- package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow.js +19 -4
- package/dist/components/conversation/scroll-follow.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +23 -23
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
- package/dist/components/conversation/transcript-composition.js +2 -2
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.d.ts +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.d.ts.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +4 -6
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +17 -17
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +2 -4
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +16 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail-context.d.ts +1 -1
- package/dist/components/layout/side-rail/side-rail-context.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +62 -57
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +23 -23
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +25 -7
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +25 -7
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +2 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.d.ts +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +15 -14
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/motion/presence.d.ts +2 -2
- package/dist/components/motion/presence.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts +5 -5
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.d.ts +1 -1
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/theme-catalogue-source.d.ts +2 -2
- package/dist/components/theme/theme-catalogue-source.js +2 -2
- package/dist/components/theme/theme-catalogue-source.js.map +1 -1
- package/dist/components/theme/theme-context.d.ts +2 -2
- package/dist/components/theme/theme-context.js +3 -3
- package/dist/components/theme/theme-context.js.map +1 -1
- package/dist/components/theme/theme-document.d.ts.map +1 -1
- package/dist/components/theme/theme-document.js +14 -9
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-picker.d.ts +5 -5
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.d.ts +0 -6
- package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
- package/dist/components/theme/theme-provider-value.js +9 -3
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-script.d.ts +14 -0
- package/dist/components/theme/theme-script.d.ts.map +1 -1
- package/dist/components/theme/theme-script.js +1 -0
- package/dist/components/theme/theme-script.js.map +1 -1
- package/dist/components/theme/theme-state.d.ts +7 -7
- package/dist/components/theme/theme-state.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts +1 -1
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +4 -3
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +3 -3
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.d.ts.map +1 -1
- package/dist/components/ui/board/board.js +10 -6
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/bubble/bubble.d.ts.map +1 -1
- package/dist/components/ui/bubble/bubble.js +6 -4
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/button-group/button-group.d.ts +1 -1
- package/dist/components/ui/button-group/button-group.js +1 -1
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +6 -6
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.d.ts +4 -4
- package/dist/components/ui/callout/callout.js +4 -4
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.d.ts +2 -2
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts +4 -4
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart-options.d.ts +7 -7
- package/dist/components/ui/chart/chart-options.js +9 -9
- package/dist/components/ui/chart/chart-options.js.map +1 -1
- package/dist/components/ui/chart/chart.d.ts.map +1 -1
- package/dist/components/ui/chart/chart.js +16 -7
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +8 -6
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +8 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/command/command.d.ts +4 -4
- package/dist/components/ui/command/command.js +4 -4
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts +1 -1
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js +13 -13
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.d.ts +0 -4
- package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +17 -1
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +4 -3
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.d.ts +6 -6
- package/dist/components/ui/diff-block/diff-block.js +3 -3
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.d.ts +3 -3
- package/dist/components/ui/drawer/drawer.js +2 -2
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +5 -5
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty/empty-state.js +33 -36
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.d.ts +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +7 -7
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +15 -15
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.d.ts +1 -1
- package/dist/components/ui/field/number-field.js +1 -1
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.d.ts +1 -1
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-otp/input-otp.d.ts +1 -1
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.d.ts.map +1 -1
- package/dist/components/ui/item/item.js +26 -26
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.d.ts +25 -12
- package/dist/components/ui/kbd/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd/kbd.js +44 -13
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/kbd/platform-modifier.d.ts +3 -3
- package/dist/components/ui/kbd/platform-modifier.js +3 -3
- package/dist/components/ui/kbd/platform-modifier.js.map +1 -1
- package/dist/components/ui/label/label.d.ts +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.d.ts.map +1 -1
- package/dist/components/ui/marker/marker.js +17 -19
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts +2 -2
- package/dist/components/ui/menubar/menubar.js +1 -1
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +16 -18
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +7 -11
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts +1 -1
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +5 -4
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +2 -4
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.js +11 -4
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.js +6 -8
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +73 -73
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +12 -6
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts +2 -2
- package/dist/components/ui/resizable/resizable.js +3 -3
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts +3 -3
- package/dist/components/ui/select/select.js +1 -1
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +4 -3
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts +1 -1
- package/dist/components/ui/spinner/spinner.js +1 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts +13 -13
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +11 -11
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +8 -6
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +4 -4
- package/dist/components/ui/tabs/tabs.js +4 -4
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -1
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +13 -15
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.js +1 -1
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts +51 -0
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/deferred-tooltip.js +103 -0
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -0
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.js +3 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +6 -5
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +17 -17
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +3 -3
- package/dist/components/ui/typography/typography.js +5 -5
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/lib/accent-presets.d.ts +1 -1
- package/dist/lib/accent-presets.js.map +1 -1
- package/dist/lib/accent-roles.d.ts +2 -2
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/accent-roles.js.map +1 -1
- package/dist/lib/appearance-font-settings.d.ts.map +1 -1
- package/dist/lib/appearance-font-settings.js +15 -7
- package/dist/lib/appearance-font-settings.js.map +1 -1
- package/dist/lib/create-poll.d.ts +39 -0
- package/dist/lib/create-poll.d.ts.map +1 -0
- package/dist/lib/create-poll.js +116 -0
- package/dist/lib/create-poll.js.map +1 -0
- package/dist/lib/font-zoom.d.ts +1 -1
- package/dist/lib/font-zoom.js +1 -1
- package/dist/lib/font-zoom.js.map +1 -1
- package/dist/lib/keyed-rows.d.ts +2 -1
- package/dist/lib/keyed-rows.d.ts.map +1 -1
- package/dist/lib/keyed-rows.js +3 -2
- package/dist/lib/keyed-rows.js.map +1 -1
- package/dist/lib/overlay.d.ts +6 -6
- package/dist/lib/overlay.d.ts.map +1 -1
- package/dist/lib/overlay.js +6 -6
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lib/preference-store.d.ts +2 -2
- package/dist/lib/preference-store.js +2 -2
- package/dist/lib/preference-store.js.map +1 -1
- package/dist/lib/safe-script.d.ts +2 -2
- package/dist/lib/safe-script.js +2 -2
- package/dist/lib/safe-script.js.map +1 -1
- package/dist/lib/scroll-geometry.d.ts +1 -1
- package/dist/lib/scroll-geometry.js +1 -1
- package/dist/lib/scroll-geometry.js.map +1 -1
- package/dist/lib/text.d.ts +1 -1
- package/dist/lib/text.js +1 -1
- package/dist/lib/text.js.map +1 -1
- package/dist/lib/theme-accents.js +3 -3
- package/dist/lib/theme-accents.js.map +1 -1
- package/dist/lib/theme-css.js.map +1 -1
- package/dist/lib/theme-defaults.d.ts +4 -4
- package/dist/lib/theme-defaults.js +4 -4
- package/dist/lib/theme-defaults.js.map +1 -1
- package/dist/lib/theme-engine-light.js.map +1 -1
- package/dist/lib/theme-engine.d.ts +2 -2
- package/dist/lib/theme-engine.js +2 -2
- package/dist/lib/theme-engine.js.map +1 -1
- package/dist/lib/theme-projection.d.ts +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-projection.js.map +1 -1
- package/dist/lib/theme-records.d.ts +2 -2
- package/dist/lib/theme-records.js +2 -2
- package/dist/lib/theme-records.js.map +1 -1
- package/dist/lib/theme-types.d.ts +1 -1
- package/dist/lib/theme-types.js.map +1 -1
- package/dist/lib/themes.d.ts +13 -13
- package/dist/lib/themes.js +13 -13
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tokens.d.ts +2 -2
- package/dist/lib/tokens.js +1 -1
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.d.ts +2 -2
- package/dist/lib/tooltip-focus-gate.js +2 -2
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/variants.d.ts +4 -4
- package/dist/lib/variants.js +1 -1
- package/dist/lib/variants.js.map +1 -1
- package/dist/lib/version-notes.d.ts +4 -4
- package/dist/lib/version-notes.js +4 -4
- package/dist/lib/version-notes.js.map +1 -1
- package/dist/lint.js.map +1 -1
- package/dist/r/account-menu.json +1 -0
- package/dist/r/lib.json +5 -0
- package/dist/r/model-selector.json +1 -0
- package/dist/r/registry.json +14 -0
- package/dist/r/side-rail.json +1 -0
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +22 -2
- package/dist/r/src/components/composites/action-button/action-button.tsx +124 -78
- package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +7 -7
- package/dist/r/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
- package/dist/r/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
- package/dist/r/src/components/composites/chat/chat.tsx +15 -9
- package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +2 -2
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +8 -4
- package/dist/r/src/components/composites/context/context.tsx +2 -2
- package/dist/r/src/components/composites/file-tree/build-file-tree.ts +1 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +16 -2
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/dist/r/src/components/composites/inline-citation/citation.ts +1 -1
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +2 -2
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +31 -22
- package/dist/r/src/components/composites/list-row/list-row.tsx +69 -73
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +1 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +190 -14
- package/dist/r/src/components/composites/model-selector/models.ts +2 -2
- package/dist/r/src/components/composites/plan/plan.tsx +19 -11
- package/dist/r/src/components/composites/queue/queue.tsx +5 -3
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +4 -4
- package/dist/r/src/components/composites/settings/settings-navigation.tsx +57 -17
- package/dist/r/src/components/composites/settings/settings.tsx +14 -6
- package/dist/r/src/components/composites/sources/source.ts +1 -1
- package/dist/r/src/components/composites/sources/sources.tsx +2 -2
- package/dist/r/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +3 -3
- package/dist/r/src/components/composites/stat/stat.tsx +20 -16
- package/dist/r/src/components/composites/subagent/subagent.tsx +6 -4
- package/dist/r/src/components/composites/task/task.tsx +1 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +3 -3
- package/dist/r/src/components/composites/terminal/terminal-model.ts +3 -3
- package/dist/r/src/components/composites/terminal/terminal.tsx +24 -12
- package/dist/r/src/components/composites/test-results/test-results-model.ts +4 -4
- package/dist/r/src/components/composites/test-results/test-results.tsx +1 -1
- package/dist/r/src/components/composites/tool/tool.tsx +4 -4
- package/dist/r/src/components/composites/tree/tree.tsx +31 -15
- package/dist/r/src/components/composites/update-dialog/channel-control.tsx +17 -8
- package/dist/r/src/components/composites/update-dialog/index.ts +1 -0
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +7 -7
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
- package/dist/r/src/components/conversation/busy-send-button.tsx +6 -2
- package/dist/r/src/components/conversation/composer-menu.tsx +3 -3
- package/dist/r/src/components/conversation/conversation-avatar.tsx +1 -1
- package/dist/r/src/components/conversation/conversation-pane.tsx +8 -5
- package/dist/r/src/components/conversation/conversation-surface.tsx +2 -2
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
- package/dist/r/src/components/conversation/message-composer.tsx +4 -6
- package/dist/r/src/components/conversation/message-row.tsx +34 -26
- package/dist/r/src/components/conversation/scroll-follow-core.ts +8 -8
- package/dist/r/src/components/conversation/scroll-follow.ts +24 -8
- package/dist/r/src/components/conversation/thread-panel.tsx +7 -3
- package/dist/r/src/components/conversation/transcript-composition.tsx +4 -2
- package/dist/r/src/components/layout/app-shell/app-shell.tsx +1 -1
- package/dist/r/src/components/layout/app-shell/skip-link.tsx +3 -2
- package/dist/r/src/components/layout/page/page.tsx +15 -11
- package/dist/r/src/components/layout/panel/panel.tsx +1 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
- package/dist/r/src/components/layout/side-rail/side-rail-context.ts +1 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +41 -28
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
- package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
- package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -2
- package/dist/r/src/components/layout/status-bar/status-bar.tsx +1 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +4 -6
- package/dist/r/src/components/motion/presence.tsx +2 -2
- package/dist/r/src/components/theme/appearance-panel.tsx +5 -5
- package/dist/r/src/components/theme/lazy.ts +1 -1
- package/dist/r/src/components/theme/theme-catalogue-source.ts +2 -2
- package/dist/r/src/components/theme/theme-context.ts +3 -3
- package/dist/r/src/components/theme/theme-document.ts +22 -11
- package/dist/r/src/components/theme/theme-picker.tsx +5 -5
- package/dist/r/src/components/theme/theme-provider-value.ts +15 -3
- package/dist/r/src/components/theme/theme-script.ts +20 -0
- package/dist/r/src/components/theme/theme-state.ts +7 -7
- package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
- package/dist/r/src/components/ui/alert/alert.tsx +4 -3
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
- package/dist/r/src/components/ui/badge/badge.tsx +2 -2
- package/dist/r/src/components/ui/board/board.tsx +17 -5
- package/dist/r/src/components/ui/bubble/bubble.tsx +6 -4
- package/dist/r/src/components/ui/button/button.tsx +2 -2
- package/dist/r/src/components/ui/button-group/button-group.tsx +1 -1
- package/dist/r/src/components/ui/calendar/calendar.tsx +2 -2
- package/dist/r/src/components/ui/callout/callout.tsx +4 -4
- package/dist/r/src/components/ui/card/card.tsx +2 -2
- package/dist/r/src/components/ui/carousel/carousel.tsx +6 -6
- package/dist/r/src/components/ui/chart/chart-options.ts +9 -9
- package/dist/r/src/components/ui/chart/chart.tsx +14 -1
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +9 -6
- package/dist/r/src/components/ui/code-block/code-block.tsx +14 -7
- package/dist/r/src/components/ui/command/command.tsx +7 -7
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +1 -1
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -3
- package/dist/r/src/components/ui/dialog/dialog-layer.tsx +25 -1
- package/dist/r/src/components/ui/dialog/dialog.tsx +4 -3
- package/dist/r/src/components/ui/diff-block/diff-block.tsx +6 -6
- package/dist/r/src/components/ui/drawer/drawer.tsx +3 -3
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
- package/dist/r/src/components/ui/empty/empty-state.tsx +23 -18
- package/dist/r/src/components/ui/empty/empty.tsx +1 -1
- package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +15 -7
- package/dist/r/src/components/ui/field/number-field.tsx +1 -1
- package/dist/r/src/components/ui/hover-card/hover-card.tsx +1 -1
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
- package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/dist/r/src/components/ui/item/item.tsx +24 -18
- package/dist/r/src/components/ui/kbd/kbd.tsx +55 -14
- package/dist/r/src/components/ui/kbd/platform-modifier.ts +3 -3
- package/dist/r/src/components/ui/label/label.tsx +1 -1
- package/dist/r/src/components/ui/marker/marker.tsx +9 -5
- package/dist/r/src/components/ui/menubar/menubar.tsx +2 -2
- package/dist/r/src/components/ui/message/message.tsx +14 -13
- package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
- package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
- package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
- package/dist/r/src/components/ui/popover/popover.tsx +4 -2
- package/dist/r/src/components/ui/progress/progress.tsx +5 -3
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +10 -5
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +9 -6
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -5
- package/dist/r/src/components/ui/select/select.tsx +4 -4
- package/dist/r/src/components/ui/sheet/sheet.tsx +4 -3
- package/dist/r/src/components/ui/skeleton/skeleton.tsx +1 -1
- package/dist/r/src/components/ui/slider/slider.tsx +1 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +1 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +13 -13
- package/dist/r/src/components/ui/switch/switch.tsx +9 -6
- package/dist/r/src/components/ui/tabs/tabs.tsx +4 -4
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
- package/dist/r/src/components/ui/toast/toast.tsx +6 -4
- package/dist/r/src/components/ui/toggle/toggle.tsx +1 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +6 -4
- package/dist/r/src/components/ui/trace/trace.tsx +13 -9
- package/dist/r/src/components/ui/typography/typography.tsx +5 -5
- package/dist/r/src/lib/accent-presets.ts +1 -1
- package/dist/r/src/lib/accent-roles.ts +2 -2
- package/dist/r/src/lib/appearance-font-settings.ts +18 -7
- package/dist/r/src/lib/create-poll.ts +150 -0
- package/dist/r/src/lib/font-zoom.ts +3 -3
- package/dist/r/src/lib/keyed-rows.ts +3 -2
- package/dist/r/src/lib/overlay.ts +6 -6
- package/dist/r/src/lib/preference-store.ts +2 -2
- package/dist/r/src/lib/safe-script.ts +2 -2
- package/dist/r/src/lib/scroll-geometry.ts +1 -1
- package/dist/r/src/lib/text.ts +1 -1
- package/dist/r/src/lib/theme-accents.ts +3 -3
- package/dist/r/src/lib/theme-css.ts +2 -2
- package/dist/r/src/lib/theme-defaults.ts +4 -4
- package/dist/r/src/lib/theme-engine-light.ts +2 -2
- package/dist/r/src/lib/theme-engine.ts +2 -2
- package/dist/r/src/lib/theme-projection.ts +2 -2
- package/dist/r/src/lib/theme-records.ts +2 -2
- package/dist/r/src/lib/theme-types.ts +1 -1
- package/dist/r/src/lib/themes.ts +14 -14
- package/dist/r/src/lib/tokens.ts +2 -2
- package/dist/r/src/lib/tooltip-focus-gate.ts +11 -11
- package/dist/r/src/lib/utils.ts +1 -1
- package/dist/r/src/lib/variants.ts +4 -4
- package/dist/r/src/lib/version-notes.ts +4 -4
- package/dist/r/src/styles/base.css +12 -43
- package/dist/r/src/styles/fonts.css +1 -1
- package/dist/r/src/styles/theme.css +35 -35
- package/dist/r/tooltip.json +5 -0
- package/dist/r/top-bar.json +1 -0
- package/package.json +2 -1
- package/registry.json +14 -0
- package/src/components/composites/account-menu/account-menu.tsx +22 -2
- package/src/components/composites/action-button/action-button.tsx +124 -78
- package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
- package/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
- package/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
- package/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
- package/src/components/composites/appearance-editor/appearance-types.ts +7 -7
- package/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
- package/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
- package/src/components/composites/chat/chat.tsx +15 -9
- package/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/src/components/composites/checkpoint/checkpoint.tsx +2 -2
- package/src/components/composites/confirmation/confirmation.tsx +8 -4
- package/src/components/composites/context/context.tsx +2 -2
- package/src/components/composites/file-tree/build-file-tree.ts +1 -1
- package/src/components/composites/file-tree/file-tree.tsx +16 -2
- package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/src/components/composites/inline-citation/citation.ts +1 -1
- package/src/components/composites/inline-citation/inline-citation.tsx +2 -2
- package/src/components/composites/list-row/list-row-control.tsx +31 -22
- package/src/components/composites/list-row/list-row.tsx +69 -73
- package/src/components/composites/message-scroller/message-scroller.tsx +1 -1
- package/src/components/composites/model-selector/model-selector.tsx +190 -14
- package/src/components/composites/model-selector/models.ts +2 -2
- package/src/components/composites/plan/plan.tsx +19 -11
- package/src/components/composites/queue/queue.tsx +5 -3
- package/src/components/composites/reasoning/reasoning.tsx +4 -4
- package/src/components/composites/settings/settings-navigation.tsx +57 -17
- package/src/components/composites/settings/settings.tsx +14 -6
- package/src/components/composites/sources/source.ts +1 -1
- package/src/components/composites/sources/sources.tsx +2 -2
- package/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
- package/src/components/composites/stack-trace/stack-trace.tsx +3 -3
- package/src/components/composites/stat/stat.tsx +20 -16
- package/src/components/composites/subagent/subagent.tsx +6 -4
- package/src/components/composites/task/task.tsx +1 -1
- package/src/components/composites/terminal/ansi.ts +3 -3
- package/src/components/composites/terminal/terminal-model.ts +3 -3
- package/src/components/composites/terminal/terminal.tsx +24 -12
- package/src/components/composites/test-results/test-results-model.ts +4 -4
- package/src/components/composites/test-results/test-results.tsx +1 -1
- package/src/components/composites/tool/tool.tsx +4 -4
- package/src/components/composites/tree/tree.tsx +31 -15
- package/src/components/composites/update-dialog/channel-control.tsx +17 -8
- package/src/components/composites/update-dialog/index.ts +1 -0
- package/src/components/composites/update-dialog/update-dialog.tsx +7 -7
- package/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
- package/src/components/conversation/busy-send-button.tsx +6 -2
- package/src/components/conversation/composer-menu.tsx +3 -3
- package/src/components/conversation/conversation-avatar.tsx +1 -1
- package/src/components/conversation/conversation-pane.tsx +8 -5
- package/src/components/conversation/conversation-surface.tsx +2 -2
- package/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
- package/src/components/conversation/message-composer.tsx +4 -6
- package/src/components/conversation/message-row.tsx +34 -26
- package/src/components/conversation/scroll-follow-core.ts +8 -8
- package/src/components/conversation/scroll-follow.ts +24 -8
- package/src/components/conversation/thread-panel.tsx +7 -3
- package/src/components/conversation/transcript-composition.tsx +4 -2
- package/src/components/layout/app-shell/app-shell.tsx +1 -1
- package/src/components/layout/app-shell/skip-link.tsx +3 -2
- package/src/components/layout/page/page.tsx +15 -11
- package/src/components/layout/panel/panel.tsx +1 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
- package/src/components/layout/side-rail/side-rail-context.ts +1 -1
- package/src/components/layout/side-rail/side-rail.tsx +41 -28
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
- package/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
- package/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
- package/src/components/layout/split-layout/split-layout.tsx +6 -2
- package/src/components/layout/status-bar/status-bar.tsx +1 -1
- package/src/components/layout/top-bar/top-bar.tsx +4 -6
- package/src/components/motion/presence.tsx +2 -2
- package/src/components/theme/appearance-panel.tsx +5 -5
- package/src/components/theme/lazy.ts +1 -1
- package/src/components/theme/theme-catalogue-source.ts +2 -2
- package/src/components/theme/theme-context.ts +3 -3
- package/src/components/theme/theme-document.ts +22 -11
- package/src/components/theme/theme-picker.tsx +5 -5
- package/src/components/theme/theme-provider-value.ts +15 -3
- package/src/components/theme/theme-script.ts +20 -0
- package/src/components/theme/theme-state.ts +7 -7
- package/src/components/theme/theme-toggle.tsx +1 -1
- package/src/components/ui/alert/alert.tsx +4 -3
- package/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
- package/src/components/ui/badge/badge.tsx +2 -2
- package/src/components/ui/board/board.tsx +17 -5
- package/src/components/ui/bubble/bubble.tsx +6 -4
- package/src/components/ui/button/button.tsx +2 -2
- package/src/components/ui/button-group/button-group.tsx +1 -1
- package/src/components/ui/calendar/calendar.tsx +2 -2
- package/src/components/ui/callout/callout.tsx +4 -4
- package/src/components/ui/card/card.tsx +2 -2
- package/src/components/ui/carousel/carousel.tsx +6 -6
- package/src/components/ui/chart/chart-options.ts +9 -9
- package/src/components/ui/chart/chart.tsx +14 -1
- package/src/components/ui/checkbox/checkbox.tsx +9 -6
- package/src/components/ui/code-block/code-block.tsx +14 -7
- package/src/components/ui/command/command.tsx +7 -7
- package/src/components/ui/context-menu/context-menu.tsx +1 -1
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -3
- package/src/components/ui/dialog/dialog-layer.tsx +25 -1
- package/src/components/ui/dialog/dialog.tsx +4 -3
- package/src/components/ui/diff-block/diff-block.tsx +6 -6
- package/src/components/ui/drawer/drawer.tsx +3 -3
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
- package/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
- package/src/components/ui/empty/empty-state.tsx +23 -18
- package/src/components/ui/empty/empty.tsx +1 -1
- package/src/components/ui/entity-icon/entity-icon.tsx +5 -1
- package/src/components/ui/field/field.tsx +15 -7
- package/src/components/ui/field/number-field.tsx +1 -1
- package/src/components/ui/hover-card/hover-card.tsx +1 -1
- package/src/components/ui/input-group/input-group.tsx +1 -1
- package/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/src/components/ui/item/item.tsx +24 -18
- package/src/components/ui/kbd/kbd.tsx +55 -14
- package/src/components/ui/kbd/platform-modifier.ts +3 -3
- package/src/components/ui/label/label.tsx +1 -1
- package/src/components/ui/marker/marker.tsx +9 -5
- package/src/components/ui/menubar/menubar.tsx +2 -2
- package/src/components/ui/message/message.tsx +14 -13
- package/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
- package/src/components/ui/native-select/native-select.tsx +1 -1
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
- package/src/components/ui/pagination/pagination.tsx +1 -1
- package/src/components/ui/popover/popover.tsx +4 -2
- package/src/components/ui/progress/progress.tsx +5 -3
- package/src/components/ui/questionnaire/questionnaire.tsx +10 -5
- package/src/components/ui/radio-group/radio-group.tsx +9 -6
- package/src/components/ui/resizable/resizable.tsx +5 -5
- package/src/components/ui/select/select.tsx +4 -4
- package/src/components/ui/sheet/sheet.tsx +4 -3
- package/src/components/ui/skeleton/skeleton.tsx +1 -1
- package/src/components/ui/slider/slider.tsx +1 -1
- package/src/components/ui/spinner/spinner.tsx +1 -1
- package/src/components/ui/status-chip/status-chip.tsx +13 -13
- package/src/components/ui/switch/switch.tsx +9 -6
- package/src/components/ui/tabs/tabs.tsx +4 -4
- package/src/components/ui/textarea/textarea.tsx +1 -1
- package/src/components/ui/toast/toast.tsx +6 -4
- package/src/components/ui/toggle/toggle.tsx +1 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/tooltip.tsx +6 -4
- package/src/components/ui/trace/trace.tsx +13 -9
- package/src/components/ui/typography/typography.tsx +5 -5
- package/src/index.ts +1 -0
- package/src/lib/accent-presets.ts +1 -1
- package/src/lib/accent-roles.ts +2 -2
- package/src/lib/appearance-font-settings.ts +18 -7
- package/src/lib/create-poll.ts +150 -0
- package/src/lib/font-zoom.ts +3 -3
- package/src/lib/keyed-rows.ts +3 -2
- package/src/lib/overlay.ts +6 -6
- package/src/lib/preference-store.ts +2 -2
- package/src/lib/safe-script.ts +2 -2
- package/src/lib/scroll-geometry.ts +1 -1
- package/src/lib/text.ts +1 -1
- package/src/lib/theme-accents.ts +3 -3
- package/src/lib/theme-css.ts +2 -2
- package/src/lib/theme-defaults.ts +4 -4
- package/src/lib/theme-engine-light.ts +2 -2
- package/src/lib/theme-engine.ts +2 -2
- package/src/lib/theme-projection.ts +2 -2
- package/src/lib/theme-records.ts +2 -2
- package/src/lib/theme-types.ts +1 -1
- package/src/lib/themes.ts +14 -14
- package/src/lib/tokens.ts +2 -2
- package/src/lib/tooltip-focus-gate.ts +11 -11
- package/src/lib/utils.ts +1 -1
- package/src/lib/variants.ts +4 -4
- package/src/lib/version-notes.ts +4 -4
- package/src/lint/index.ts +1 -1
- package/src/styles/base.css +12 -43
- package/src/styles/fonts.css +1 -1
- package/src/styles/theme.css +35 -35
- package/src/styles/themes/aardvark-blue.css +98 -0
- package/src/styles/themes/aardvark-ink.css +98 -0
- package/src/styles/themes/adea-dark-colorblind.css +98 -0
- package/src/styles/themes/adea-dark-high-contrast.css +98 -0
- package/src/styles/themes/adea-dark.css +47 -0
- package/src/styles/themes/adea-light-colorblind.css +141 -0
- package/src/styles/themes/adea-light-high-contrast.css +141 -0
- package/src/styles/themes/adea-light.css +47 -0
- package/src/styles/themes/ayu-light.css +141 -0
- package/src/styles/themes/ayu-mirage.css +98 -0
- package/src/styles/themes/ayu.css +98 -0
- package/src/styles/themes/catppuccin-frappe.css +98 -0
- package/src/styles/themes/catppuccin-latte.css +141 -0
- package/src/styles/themes/catppuccin-macchiato.css +98 -0
- package/src/styles/themes/catppuccin-mocha.css +98 -0
- package/src/styles/themes/dracula.css +98 -0
- package/src/styles/themes/everforest-dark.css +98 -0
- package/src/styles/themes/everforest-light.css +141 -0
- package/src/styles/themes/gruvbox-dark.css +98 -0
- package/src/styles/themes/gruvbox-light.css +141 -0
- package/src/styles/themes/kanagawa.css +98 -0
- package/src/styles/themes/monokai.css +98 -0
- package/src/styles/themes/nord-light.css +141 -0
- package/src/styles/themes/nord.css +98 -0
- package/src/styles/themes/one-dark.css +98 -0
- package/src/styles/themes/rosepine-dawn.css +141 -0
- package/src/styles/themes/rosepine-moon.css +98 -0
- package/src/styles/themes/rosepine.css +98 -0
- package/src/styles/themes/solarized-dark.css +98 -0
- package/src/styles/themes/solarized-light.css +141 -0
- package/src/styles/themes/tokyonight-day.css +141 -0
- package/src/styles/themes/tokyonight-night.css +98 -0
- package/src/styles/themes/tokyonight-storm.css +98 -0
- package/src/styles/themes/vesper.css +98 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-row.js","names":["CheckCheck","MessageSquareReply","Pencil","RotateCcw","Trash2","For","Show","splitProps","cn","Button","CodeBlock","InlineCode","splitCodeFences","ConversationAvatar","senderKind","senderName","time","dateTime","edited","pending","streaming","deleted","highlighted","anchorId","avatar","attachments","link","actions","onOpenThread","onThreadIntent","onEdit","onDelete","onRetry","MessageRow","props","local","rest","mirrored","_el$","_tmpl$8","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_el$6","_el$9","_el$13","_$spread","_$mergeProps","undefined","tabindex","class","_$insert","_$createComponent","kind","size","children","when","fallback","_tmpl$9","_el$7","_tmpl$","_el$8","_tmpl$2","_el$0","_tmpl$3","_$effect","_$setAttribute","_tmpl$4","_tmpl$5","_tmpl$6","_$memo","_el$12","_tmpl$7","variant","onClick","onPointerEnter","onFocus","_p$","_v$","_v$2","_v$3","_v$4","e","_$className","t","a","o","MessageGroup","_el$15","_tmpl$0","MessageDayDivider","label","_el$16","_tmpl$1","_el$18","MessageBody","text","segments","map","segment","replace","filter","last","at","_el$19","_tmpl$11","each","code","language","complete","Prose","_tmpl$10","parts","split","Boolean","_el$21","_tmpl$12","part","startsWith","endsWith","length","slice"],"sources":["../../../src/components/conversation/message-row.tsx"],"sourcesContent":["import { CheckCheck, MessageSquareReply, Pencil, RotateCcw, Trash2 } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button'\nimport { CodeBlock, InlineCode } from '../ui/code-block'\nimport { splitCodeFences } from '../ui/message/parse-message-text'\nimport { ConversationAvatar, type ConversationAvatarKind } from './conversation-avatar'\n\n/**\n * MessageRow.\n *\n * One turn in a transcript: a speaker, a bubble, and the actions that apply to it.\n *\n * ## What it does not know\n *\n * It takes no domain types. A caller supplies the speaker's name, the timestamp, and\n * the body as children; attachments, a linked task and the action row are slots. That\n * is deliberate and it is the difference between a component a second application can\n * use and one that only fits the application it was written in — the first version of\n * this row was written against adea's message model and could not have been used by\n * cortana at all.\n *\n * ## The two things it does know\n *\n * **The speaker's own messages mirror.** A user's turn puts the avatar on the trailing\n * edge and the bubble on the leading one, so a transcript can be read as a\n * conversation rather than as a log. `senderKind` decides that, and it is the only\n * place the layout branches.\n *\n * **`content-visibility: auto`.** A transcript is the one list in an application that\n * can hold thousands of rows, and this lets the engine skip layout and paint for the\n * ones off screen. `contain-intrinsic-size` is what keeps the scrollbar honest while\n * it does — without it the scroll height collapses as rows are skipped and the\n * thumb jumps. Both are load-bearing rather than an optimisation to add later.\n */\nexport type MessageRowProps = Omit<ComponentProps<'article'>, 'onSelect'> & {\n /** Who spoke. Decides the mirroring and the avatar's tone. */\n senderKind: ConversationAvatarKind\n /** The speaker's name, announced with the message rather than drawn. */\n senderName: string\n /** An ISO timestamp, rendered by the caller's own formatter. */\n time?: string\n /** The machine-readable time, for `<time datetime>`. */\n dateTime?: string\n edited?: boolean\n /** Set while the message is in flight. */\n pending?: boolean\n /**\n * Set while tokens are still arriving. Shows a caret after the body and drops\n * the delivered tick; distinct from `pending`, which is the *sending* state of\n * a message the user wrote. A turn can be neither, either, or (briefly) both.\n */\n streaming?: boolean\n /** Set when the message has been deleted, which replaces the body. */\n deleted?: boolean\n /** Draw attention to this row, e.g. after arriving from a search result. */\n highlighted?: boolean\n /**\n * The turn's stable identity, which `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it (the same contract as `Message`).\n */\n anchorId?: string\n /** The caller's own avatar content. Falls back to a glyph for the kind. */\n avatar?: JSX.Element\n /** Attachments, rendered under the body. */\n attachments?: JSX.Element\n /** A linked entity — a task, an artifact, a session — rendered under the body. */\n link?: JSX.Element\n /** Extra rows in the action strip, before the built-in ones. */\n actions?: JSX.Element\n /** Show the reply affordance. Omit it to hide the action. */\n onOpenThread?: () => void\n /** Fires on hover and focus of the reply affordance, for prefetching. */\n onThreadIntent?: () => void\n onEdit?: () => void\n onDelete?: () => void\n onRetry?: () => void\n}\n\nexport function MessageRow(props: MessageRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'senderKind',\n 'senderName',\n 'time',\n 'dateTime',\n 'edited',\n 'pending',\n 'streaming',\n 'deleted',\n 'highlighted',\n 'anchorId',\n 'avatar',\n 'attachments',\n 'link',\n 'actions',\n 'onOpenThread',\n 'onThreadIntent',\n 'onEdit',\n 'onDelete',\n 'onRetry',\n 'children',\n ])\n\n const mirrored = () => local.senderKind === 'user'\n\n return (\n <article\n data-slot=\"message-row\"\n data-message-kind={local.senderKind}\n data-anchor-id={local.anchorId}\n aria-busy={local.pending || undefined}\n tabindex={local.highlighted ? -1 : undefined}\n class={cn(\n 'group/message grid max-w-3xl gap-2.5 px-1 py-1.5',\n /* The row is skipped by the engine while off screen; the intrinsic size keeps\n the scroll height stable while that happens. */\n '[content-visibility:auto] [contain-intrinsic-size:auto_7rem]',\n mirrored() ? 'grid-cols-[minmax(0,1fr)_2rem]' : 'grid-cols-[1.9rem_minmax(0,1fr)]',\n 'transition-colors ease-out hover:bg-muted/45',\n local.highlighted && 'bg-primary-subtle shadow-[inset_3px_0_var(--primary)]',\n local.class\n )}\n {...rest}\n >\n <span data-slot=\"message-avatar\" class={cn('mt-0.5', mirrored() ? 'order-2' : 'order-1')}>\n <ConversationAvatar kind={local.senderKind} size={mirrored() ? 'lg' : 'md'}>\n {local.avatar}\n </ConversationAvatar>\n </span>\n\n <div\n data-slot=\"message-content\"\n class={cn('flex min-w-0 flex-col gap-1', mirrored() ? 'order-1' : 'order-2')}\n >\n <div\n data-slot=\"message-bubble\"\n class={cn(\n 'relative w-fit min-w-16 max-w-[min(100%,38rem)] rounded-lg border border-border px-3.5 pt-2.5 pb-2',\n 'bg-card text-card-foreground',\n /* The tail: a squared corner on the side the speaker sits, which is what\n makes a bubble read as belonging to one voice. */\n mirrored() ? 'rounded-ee-sm ms-auto' : 'rounded-es-sm'\n )}\n >\n {/* The name is announced with the message rather than drawn: a transcript\n that repeats every speaker's name in every bubble is one nobody reads. */}\n <span class=\"visually-hidden\">{local.senderName}</span>\n\n <div data-slot=\"message-body\" class=\"font-content text-content\">\n <Show\n when={!local.deleted}\n fallback={\n <p class=\"font-content text-content text-muted-foreground italic\">\n Message deleted\n </p>\n }\n >\n {local.children}\n </Show>\n </div>\n\n <Show when={local.attachments}>\n <div class=\"mt-2 flex flex-wrap gap-2\">{local.attachments}</div>\n </Show>\n\n <Show when={local.link}>\n <div class=\"mt-2\">{local.link}</div>\n </Show>\n\n <div\n data-slot=\"message-meta\"\n class=\"mt-1 flex items-center gap-2 text-2xs text-muted-foreground\"\n >\n <Show when={local.time}>\n <time datetime={local.dateTime}>{local.time}</time>\n </Show>\n <Show when={local.edited}>\n <span>edited</span>\n </Show>\n <Show when={local.pending}>\n <span role=\"status\">sending…</span>\n </Show>\n <Show when={local.streaming}>\n <span role=\"status\">responding…</span>\n </Show>\n <Show when={mirrored() && !local.pending && !local.streaming && !local.deleted}>\n {/*\n `role=\"img\"` because a bare span cannot carry `aria-label` — axe's\n `aria-prohibited-attr`. The glyph is the whole message, so the role\n is also the accurate one: this element *is* an image whose meaning\n is its label.\n */}\n <span role=\"img\" aria-label=\"Delivered\" class=\"inline-flex\">\n <CheckCheck aria-hidden=\"true\" class=\"size-3\" />\n </span>\n </Show>\n </div>\n </div>\n\n {/* The action strip is hidden until the row is hovered or focused, so a\n transcript is not a wall of buttons — but it stays in the accessibility\n tree and the tab order, because a control that only exists under the\n pointer cannot be reached by keyboard. */}\n <footer\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-hover/message:opacity-100 group-focus-within/message:opacity-100',\n mirrored() && 'justify-end'\n )}\n >\n <Show when={local.actions}>{local.actions}</Show>\n <Show when={local.onOpenThread && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onOpenThread?.()}\n onPointerEnter={() => local.onThreadIntent?.()}\n onFocus={() => local.onThreadIntent?.()}\n >\n <MessageSquareReply />\n Thread\n </Button>\n </Show>\n <Show when={local.onEdit && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onEdit?.()}\n >\n <Pencil />\n Edit\n </Button>\n </Show>\n <Show when={local.onDelete && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onDelete?.()}\n >\n <Trash2 />\n Delete\n </Button>\n </Show>\n <Show when={local.onRetry}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onRetry?.()}\n >\n <RotateCcw />\n Retry\n </Button>\n </Show>\n </footer>\n </div>\n </article>\n )\n}\n\n/**\n * A run of messages from the same speaker.\n *\n * Consecutive turns from one voice are a *paragraph*, and a transcript that repeats\n * the avatar and the name for each line reads as noise. The group draws the first\n * row fully and the rest without their avatar.\n */\nexport function MessageGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div data-slot=\"message-group\" role=\"group\" class={cn('flex flex-col', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/** A day divider, so a long transcript has somewhere to rest the eye. */\nexport function MessageDayDivider(props: ComponentProps<'div'> & { label: string }) {\n const [local, rest] = splitProps(props, ['class', 'label'])\n return (\n <div\n data-slot=\"message-day-divider\"\n role=\"separator\"\n class={cn('flex items-center gap-3 px-4 py-3', local.class)}\n {...rest}\n >\n <span class=\"h-px flex-1 bg-border\" />\n <span class=\"text-2xs font-medium tracking-wide text-muted-foreground uppercase\">\n {local.label}\n </span>\n <span class=\"h-px flex-1 bg-border\" />\n </div>\n )\n}\n\n/**\n * Renders a body's code fences as blocks, which a plain `<p>` cannot.\n *\n * Fences follow the same grammar as `MessageText` (a line opening with three or\n * more backticks or tildes and an optional language), so one reply draws the same\n * code blocks whichever renderer shows it. Everything outside a fence is prose, kept\n * as written apart from inline code spans: a caller that needs the full inline\n * grammar should use `MessageText` or pass already-rendered children instead.\n */\nexport function MessageBody(\n props: ComponentProps<'div'> & {\n text: string\n /** True while the turn is still streaming, so a partial fence renders as a block. */\n streaming?: boolean\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'text', 'streaming'])\n\n const segments = () =>\n splitCodeFences(local.text, { streaming: local.streaming })\n .map((segment) =>\n // The newlines that separate prose from a fence belong to the fence\n // syntax. Kept, `whitespace-pre-wrap` draws them as blank lines on top\n // of the column gap, doubling the space beside every code block.\n segment.kind === 'prose'\n ? { ...segment, text: segment.text.replace(/^\\n+|\\n+$/g, '') }\n : segment\n )\n .filter((segment) => segment.kind === 'code' || segment.text !== '')\n\n const last = () => segments().at(-1)\n\n return (\n <div data-slot=\"message-body\" class={cn('flex flex-col gap-2', local.class)} {...rest}>\n <For each={segments()}>\n {(segment) =>\n segment.kind === 'code' ? (\n <CodeBlock\n code={segment.code}\n language={segment.language}\n complete={segment.complete}\n />\n ) : (\n <Prose text={segment.text} />\n )\n }\n </For>\n {/*\n The caret trails the last segment, and only when that segment is prose: a\n streaming code block already carries its own generating indicator, and two\n of them on one turn read as two streams.\n */}\n <Show when={local.streaming && last()?.kind === 'prose'}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\n/**\n * A run of prose, with its inline code marked. The split is non-greedy and\n * requires a non-empty span, so an unmatched backtick stays a backtick rather\n * than swallowing the rest of the paragraph.\n */\nfunction Prose(props: { text: string }) {\n const parts = () => props.text.split(/(`[^`\\n]+`)/g).filter(Boolean)\n\n return (\n <p class=\"font-content text-content whitespace-pre-wrap\">\n <For each={parts()}>\n {(part) => (\n <Show\n when={part.startsWith('`') && part.endsWith('`') && part.length > 2}\n fallback={part}\n >\n <InlineCode>{part.slice(1, -1)}</InlineCode>\n </Show>\n )}\n </For>\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgFA,SAAgBiC,WAAWC,OAAwB;C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AAC,CAACZ,OAAOa,OAAO;CAEnE,cAAA;EAAA,IAAAC,SAAAC,SAAA;EAAAjE,OAAAgE,QAAA/D,gBAEKlD,KAAG;GAAA,IAACwG,OAAI;IAAA,OAAEM,MAAM;GAAC;GAAAzD,WACd8D,SAAIjE,gBACHjD,MAAI;IAAA,IACHqD,OAAI;KAAA,OAAEc,WAAA,CAAA,EAAA+C,KAAKC,WAAW,GAAG,KAAKD,KAAKE,SAAS,GAAG,EAAC,CAAA,CAAA,KAAIF,KAAKG,SAAS;IAAC;IACnE/D,UAAU4D;IAAI,IAAA9D,WAAA;KAAA,OAAAH,gBAEb5C,YAAU,EAAA,IAAA+C,WAAA;MAAA,OAAE8D,KAAKI,MAAM,GAAG,EAAE;KAAC,EAAA,CAAA;IAAA;GAAA,CAAA;EAEjC,CAAA,CAAA;EAAA,OAAAN;CAAA,EAAA,CAAA;AAIT"}
|
|
1
|
+
{"version":3,"file":"message-row.js","names":["CheckCheck","MessageSquareReply","Pencil","RotateCcw","Trash2","createMemo","Index","Show","splitProps","cn","Button","CodeBlock","InlineCode","splitCodeFences","ConversationAvatar","senderKind","senderName","time","dateTime","edited","pending","streaming","deleted","highlighted","anchorId","avatar","attachments","link","actions","onOpenThread","onThreadIntent","onEdit","onDelete","onRetry","MessageRow","props","local","rest","mirrored","_el$","_tmpl$5","_el$2","firstChild","_el$3","nextSibling","_el$4","_el$5","_el$6","_el$7","_el$10","_$spread","_$mergeProps","undefined","tabindex","class","_$insert","_$createComponent","kind","size","children","when","fallback","_tmpl$6","attachmentsSlot","_el$12","_tmpl$7","linkSlot","_el$13","_tmpl$8","timeSlot","_el$14","_tmpl$9","_$effect","_$setAttribute","_tmpl$","_tmpl$2","_tmpl$3","_$memo","_el$1","_tmpl$4","actionsSlot","variant","onClick","onPointerEnter","onFocus","_p$","_v$","_v$2","_v$3","_v$4","e","_$className","t","a","o","MessageGroup","_el$15","_tmpl$0","MessageDayDivider","label","_el$16","_tmpl$1","_el$18","MessageBody","text","segments","map","segment","replace","filter","last","at","_el$19","_tmpl$11","each","Prose","code","language","complete","_tmpl$10","INLINE_CODE_SPLIT","parts","split","Boolean","_el$21","_tmpl$12","part","startsWith","endsWith","length","slice"],"sources":["../../../src/components/conversation/message-row.tsx"],"sourcesContent":["import { CheckCheck, MessageSquareReply, Pencil, RotateCcw, Trash2 } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createMemo, Index, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button'\nimport { CodeBlock, InlineCode } from '../ui/code-block'\nimport { splitCodeFences, type FenceSegment } from '../ui/message/parse-message-text'\nimport { ConversationAvatar, type ConversationAvatarKind } from './conversation-avatar'\n\n/**\n * MessageRow.\n *\n * One turn in a transcript: a speaker, a bubble, and the actions that apply to it.\n *\n * ## What it does not know\n *\n * It takes no domain types. A caller supplies the speaker's name, the timestamp, and\n * the body as children; attachments, a linked task and the action row are slots. That\n * is deliberate and it is the difference between a component a second application can\n * use and one that only fits the application it was written in — the first version of\n * this row was written against adea's message model and could not have been used by\n * cortana at all.\n *\n * ## The two things it does know\n *\n * **The speaker's own messages mirror.** A user's turn puts the avatar on the trailing\n * edge and the bubble on the leading one, so a transcript can be read as a\n * conversation rather than as a log. `senderKind` decides that, and it is the only\n * place the layout branches.\n *\n * **`content-visibility: auto`.** A transcript is the one list in an application that\n * can hold thousands of rows, and this lets the engine skip layout and paint for the\n * ones off screen. `contain-intrinsic-size` is what keeps the scrollbar honest while\n * it does — without it the scroll height collapses as rows are skipped and the\n * thumb jumps. Both are load-bearing rather than an optimisation to add later.\n */\nexport type MessageRowProps = Omit<ComponentProps<'article'>, 'onSelect'> & {\n /** Who spoke. Decides the mirroring and the avatar's tone. */\n senderKind: ConversationAvatarKind\n /** The speaker's name, announced with the message rather than drawn. */\n senderName: string\n /** An ISO timestamp, rendered by the caller's own formatter. */\n time?: string\n /** The machine-readable time, for `<time datetime>`. */\n dateTime?: string\n edited?: boolean\n /** Set while the message is in flight. */\n pending?: boolean\n /**\n * Set while tokens are still arriving. Shows a caret after the body and drops\n * the delivered tick; distinct from `pending`, which is the *sending* state of\n * a message the user wrote. A turn can be neither, either, or (briefly) both.\n */\n streaming?: boolean\n /** Set when the message has been deleted, which replaces the body. */\n deleted?: boolean\n /** Draw attention to this row, e.g. after arriving from a search result. */\n highlighted?: boolean\n /**\n * The turn's stable identity, which `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it (the same contract as `Message`).\n */\n anchorId?: string\n /** The caller's own avatar content. Falls back to a glyph for the kind. */\n avatar?: JSX.Element\n /** Attachments, rendered under the body. */\n attachments?: JSX.Element\n /** A linked entity — a task, an artifact, a session — rendered under the body. */\n link?: JSX.Element\n /** Extra rows in the action strip, before the built-in ones. */\n actions?: JSX.Element\n /** Show the reply affordance. Omit it to hide the action. */\n onOpenThread?: () => void\n /** Fires on hover and focus of the reply affordance, for prefetching. */\n onThreadIntent?: () => void\n onEdit?: () => void\n onDelete?: () => void\n onRetry?: () => void\n}\n\nexport function MessageRow(props: MessageRowProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'senderKind',\n 'senderName',\n 'time',\n 'dateTime',\n 'edited',\n 'pending',\n 'streaming',\n 'deleted',\n 'highlighted',\n 'anchorId',\n 'avatar',\n 'attachments',\n 'link',\n 'actions',\n 'onOpenThread',\n 'onThreadIntent',\n 'onEdit',\n 'onDelete',\n 'onRetry',\n 'children',\n ])\n\n const mirrored = () => local.senderKind === 'user'\n\n return (\n <article\n data-slot=\"message-row\"\n data-message-kind={local.senderKind}\n data-anchor-id={local.anchorId}\n aria-busy={local.pending || undefined}\n tabindex={local.highlighted ? -1 : undefined}\n class={cn(\n 'group/message grid max-w-3xl gap-2.5 px-1 py-1.5',\n /* The row is skipped by the engine while off screen; the intrinsic size keeps\n the scroll height stable while that happens. */\n '[content-visibility:auto] [contain-intrinsic-size:auto_7rem]',\n mirrored() ? 'grid-cols-[minmax(0,1fr)_2rem]' : 'grid-cols-[1.9rem_minmax(0,1fr)]',\n 'transition-colors ease-out hover:bg-muted/45',\n local.highlighted && 'bg-primary-subtle shadow-[inset_3px_0_var(--primary)]',\n local.class\n )}\n {...rest}\n >\n <span data-slot=\"message-avatar\" class={cn('mt-0.5', mirrored() ? 'order-2' : 'order-1')}>\n <ConversationAvatar kind={local.senderKind} size={mirrored() ? 'lg' : 'md'}>\n {local.avatar}\n </ConversationAvatar>\n </span>\n\n <div\n data-slot=\"message-content\"\n class={cn('flex min-w-0 flex-col gap-1', mirrored() ? 'order-1' : 'order-2')}\n >\n <div\n data-slot=\"message-bubble\"\n class={cn(\n 'relative w-fit min-w-16 max-w-[min(100%,38rem)] rounded-lg border border-border px-3.5 pt-2.5 pb-2',\n 'bg-card text-card-foreground',\n /* The tail: a squared corner on the side the speaker sits, which is what\n makes a bubble read as belonging to one voice. */\n mirrored() ? 'rounded-ee-sm ms-auto' : 'rounded-es-sm'\n )}\n >\n {/* The name is announced with the message rather than drawn: a transcript\n that repeats every speaker's name in every bubble is one nobody reads. */}\n <span class=\"visually-hidden\">{local.senderName}</span>\n\n <div data-slot=\"message-body\" class=\"font-content text-content\">\n <Show\n when={!local.deleted}\n fallback={\n <p class=\"font-content text-content text-muted-foreground italic\">\n Message deleted\n </p>\n }\n >\n {local.children}\n </Show>\n </div>\n\n <Show when={local.attachments}>\n {(attachmentsSlot) => <div class=\"mt-2 flex flex-wrap gap-2\">{attachmentsSlot()}</div>}\n </Show>\n\n <Show when={local.link}>{(linkSlot) => <div class=\"mt-2\">{linkSlot()}</div>}</Show>\n\n <div\n data-slot=\"message-meta\"\n class=\"mt-1 flex items-center gap-2 text-2xs text-muted-foreground\"\n >\n <Show when={local.time}>\n {(timeSlot) => <time datetime={local.dateTime}>{timeSlot()}</time>}\n </Show>\n <Show when={local.edited}>\n <span>edited</span>\n </Show>\n <Show when={local.pending}>\n <span role=\"status\">sending…</span>\n </Show>\n <Show when={local.streaming}>\n <span role=\"status\">responding…</span>\n </Show>\n <Show when={mirrored() && !local.pending && !local.streaming && !local.deleted}>\n {/*\n `role=\"img\"` because a bare span cannot carry `aria-label` — axe's\n `aria-prohibited-attr`. The glyph is the whole message, so the role\n is also the accurate one: this element *is* an image whose meaning\n is its label.\n */}\n <span role=\"img\" aria-label=\"Delivered\" class=\"inline-flex\">\n <CheckCheck aria-hidden=\"true\" class=\"size-3\" />\n </span>\n </Show>\n </div>\n </div>\n\n {/* The action strip is hidden until the row is hovered or focused, so a\n transcript is not a wall of buttons — but it stays in the accessibility\n tree and the tab order, because a control that only exists under the\n pointer cannot be reached by keyboard. */}\n <footer\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-hover/message:opacity-100 group-focus-within/message:opacity-100',\n mirrored() && 'justify-end'\n )}\n >\n <Show when={local.actions}>{(actionsSlot) => <>{actionsSlot()}</>}</Show>\n <Show when={local.onOpenThread && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onOpenThread?.()}\n onPointerEnter={() => local.onThreadIntent?.()}\n onFocus={() => local.onThreadIntent?.()}\n >\n <MessageSquareReply />\n Thread\n </Button>\n </Show>\n <Show when={local.onEdit && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onEdit?.()}\n >\n <Pencil />\n Edit\n </Button>\n </Show>\n <Show when={local.onDelete && !local.deleted}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onDelete?.()}\n >\n <Trash2 />\n Delete\n </Button>\n </Show>\n <Show when={local.onRetry}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n class=\"gap-1.5 text-muted-foreground\"\n onClick={() => local.onRetry?.()}\n >\n <RotateCcw />\n Retry\n </Button>\n </Show>\n </footer>\n </div>\n </article>\n )\n}\n\n/**\n * A run of messages from the same speaker.\n *\n * Consecutive turns from one voice are a *paragraph*, and a transcript that repeats\n * the avatar and the name for each line reads as noise. The group draws the first\n * row fully and the rest without their avatar.\n */\nexport function MessageGroup(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div data-slot=\"message-group\" role=\"group\" class={cn('flex flex-col', local.class)} {...rest}>\n {local.children}\n </div>\n )\n}\n\n/** A day divider, so a long transcript has somewhere to rest the eye. */\nexport function MessageDayDivider(props: ComponentProps<'div'> & { label: string }) {\n const [local, rest] = splitProps(props, ['class', 'label'])\n return (\n <div\n data-slot=\"message-day-divider\"\n role=\"separator\"\n class={cn('flex items-center gap-3 px-4 py-3', local.class)}\n {...rest}\n >\n <span class=\"h-px flex-1 bg-border\" />\n <span class=\"text-2xs font-medium tracking-wide text-muted-foreground uppercase\">\n {local.label}\n </span>\n <span class=\"h-px flex-1 bg-border\" />\n </div>\n )\n}\n\n/**\n * Renders a body's code fences as blocks, which a plain `<p>` cannot.\n *\n * Fences follow the same grammar as `MessageText` (a line opening with three or\n * more backticks or tildes and an optional language), so one reply draws the same\n * code blocks whichever renderer shows it. Everything outside a fence is prose, kept\n * as written apart from inline code spans: a caller that needs the full inline\n * grammar should use `MessageText` or pass already-rendered children instead.\n */\nexport function MessageBody(\n props: ComponentProps<'div'> & {\n text: string\n /** True while the turn is still streaming, so a partial fence renders as a block. */\n streaming?: boolean\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'text', 'streaming'])\n\n // Memoized and rendered by position: a streamed token only grows the last segment,\n // so the earlier code blocks and paragraphs keep their DOM instead of every\n // segment being rebuilt (splitting returns fresh objects each time).\n const segments = createMemo(() =>\n splitCodeFences(local.text, { streaming: local.streaming })\n .map((segment) =>\n // The newlines that separate prose from a fence belong to the fence\n // syntax. Kept, `whitespace-pre-wrap` draws them as blank lines on top\n // of the column gap, doubling the space beside every code block.\n segment.kind === 'prose'\n ? { ...segment, text: segment.text.replace(/^\\n+|\\n+$/g, '') }\n : segment\n )\n .filter((segment) => segment.kind === 'code' || segment.text !== '')\n )\n\n const last = () => segments().at(-1)\n\n return (\n <div data-slot=\"message-body\" class={cn('flex flex-col gap-2', local.class)} {...rest}>\n <Index each={segments()}>\n {(segment) => (\n <Show\n when={segment().kind === 'code'}\n fallback={<Prose text={(segment() as ProseSegment).text} />}\n >\n <CodeBlock\n code={(segment() as CodeSegment).code}\n language={(segment() as CodeSegment).language}\n complete={(segment() as CodeSegment).complete}\n />\n </Show>\n )}\n </Index>\n {/*\n The caret trails the last segment, and only when that segment is prose: a\n streaming code block already carries its own generating indicator, and two\n of them on one turn read as two streams.\n */}\n <Show when={local.streaming && last()?.kind === 'prose'}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\n/**\n * A run of prose, with its inline code marked. The split is non-greedy and\n * requires a non-empty span, so an unmatched backtick stays a backtick rather\n * than swallowing the rest of the paragraph.\n */\ntype ProseSegment = Extract<FenceSegment, { kind: 'prose' }>\ntype CodeSegment = Extract<FenceSegment, { kind: 'code' }>\n\nconst INLINE_CODE_SPLIT = /(`[^`\\n]+`)/g\n\nfunction Prose(props: { text: string }) {\n const parts = createMemo(() => props.text.split(INLINE_CODE_SPLIT).filter(Boolean))\n\n return (\n <p class=\"font-content text-content whitespace-pre-wrap\">\n <Index each={parts()}>\n {(part) => (\n <Show\n when={part().startsWith('`') && part().endsWith('`') && part().length > 2}\n fallback={part()}\n >\n <InlineCode>{part().slice(1, -1)}</InlineCode>\n </Show>\n )}\n </Index>\n </p>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgFA,SAAgBkC,WAAWC,OAAwB;CACjD,MAAM,CAACC,OAAOC,QAAQ7B,WAAW2B,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CAED,MAAMG,iBAAiBF,MAAMrB,eAAe;CAE5C,cAA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AAMsF,QAAQpH,iBAAiB8B,MAAMqE,KAAKkB,MAAMF,iBAAiB,CAAC,CAACX,OAAOc,OAAO,CAAC;CAElF,cAAA;EAAA,IAAAC,SAAAC,SAAA;EAAAtE,OAAAqE,QAAApE,gBAEKlD,OAAK;GAAA,IAAC4G,OAAI;IAAA,OAAEO,MAAM;GAAC;GAAA9D,WAChBmE,SAAItE,gBACHjD,MAAI;IAAA,IACHqD,OAAI;KAAA,OAAEiB,WAAA,CAAA,EAAAiD,KAAK,CAAC,CAACC,WAAW,GAAG,KAAKD,KAAK,CAAC,CAACE,SAAS,GAAG,EAAC,CAAA,CAAA,KAAIF,KAAK,CAAC,CAACG,SAAS;IAAC;IAAA,IACzEpE,WAAQ;KAAA,OAAEiE,KAAK;IAAC;IAAA,IAAAnE,WAAA;KAAA,OAAAH,gBAEf5C,YAAU,EAAA,IAAA+C,WAAA;MAAA,OAAEmE,KAAK,CAAC,CAACI,MAAM,GAAG,EAAE;KAAC,EAAA,CAAA;IAAA;GAAA,CAAA;EAEnC,CAAA,CAAA;EAAA,OAAAN;CAAA,EAAA,CAAA;AAIT"}
|
|
@@ -35,7 +35,7 @@ export declare function isViewportGrowthClamp(args: {
|
|
|
35
35
|
* Distance (px) from the true bottom within which a user scroll RE-ENGAGES
|
|
36
36
|
* follow. Deliberately much tighter than DEFAULT_BOTTOM_THRESHOLD: that band
|
|
37
37
|
* drives the jump-to-bottom pill's visibility, and reusing it for follow
|
|
38
|
-
* meant a deliberate 3-99px scroll-up kept `stick` armed
|
|
38
|
+
* meant a deliberate 3-99px scroll-up kept `stick` armed, the next content
|
|
39
39
|
* change then yanked the reader back to the bottom. Re-engaging only when the
|
|
40
40
|
* user has returned essentially to the bottom keeps "scrolled up to read"
|
|
41
41
|
* positions belonging to the user.
|
|
@@ -48,7 +48,7 @@ export declare const FOLLOW_REENGAGE_PX = 16;
|
|
|
48
48
|
* 1. At the true bottom (within the DPR-aware epsilon) → follow. This also
|
|
49
49
|
* absorbs the layout engine's clamp: a mid-stream content SHRINK drops
|
|
50
50
|
* scrollTop (which reads as an upward move) but lands exactly at the new
|
|
51
|
-
* bottom
|
|
51
|
+
* bottom, releasing there froze streaming follow for the rest of the
|
|
52
52
|
* turn.
|
|
53
53
|
* 2. Any other upward move → release, regardless of distance from the
|
|
54
54
|
* bottom. The scroll position now belongs to the user; only returning to
|
|
@@ -73,13 +73,13 @@ export declare function resolveUserScrollStick(args: {
|
|
|
73
73
|
*
|
|
74
74
|
* Positive = the viewport GREW (the composer shrank under a deletion, the
|
|
75
75
|
* keyboard closed). That growth lowers the maximum scrollTop, so the engine
|
|
76
|
-
* clamps any reader parked closer to the bottom than the growth
|
|
76
|
+
* clamps any reader parked closer to the bottom than the growth, with no
|
|
77
77
|
* application write anywhere. The clamp then arrives here as an ordinary
|
|
78
78
|
* scroll event sitting at distance ~0, which rule 1 below used to read as
|
|
79
79
|
* "the reader came back to the bottom" and re-arm follow for someone who
|
|
80
80
|
* never touched the scroller. The next turn to start then took them to the
|
|
81
81
|
* end. Rule 1 exists to absorb a CONTENT-shrink clamp mid-stream, and content
|
|
82
|
-
* shrink moves `scrollHeight`, not `clientHeight
|
|
82
|
+
* shrink moves `scrollHeight`, not `clientHeight`, so the two are
|
|
83
83
|
* distinguishable, and this is the delta that tells them apart. */
|
|
84
84
|
viewportGrowth?: number;
|
|
85
85
|
}): boolean;
|
|
@@ -143,13 +143,13 @@ export interface AutoPinResult {
|
|
|
143
143
|
* switch, before we have written anything this session).
|
|
144
144
|
*
|
|
145
145
|
* `viewportShrink` (px, default 0) is how much the SCROLLER'S OWN BOX has
|
|
146
|
-
* shrunk since that reference was recorded
|
|
146
|
+
* shrunk since that reference was recorded, chrome mounting below the
|
|
147
147
|
* transcript (a queue band, an attachment strip, a tip card), often
|
|
148
148
|
* spring-animated over several frames. Our own shrink inflates
|
|
149
149
|
* `distanceFromBottom` with no user input, so without this allowance the
|
|
150
150
|
* distance guard reads it as "meaningfully away from the bottom". Paired with
|
|
151
|
-
* a content SHRINK in the same commit window
|
|
152
|
-
* scrollTop below `lastWriteTop
|
|
151
|
+
* a content SHRINK in the same commit window, a tail-row remount clamping
|
|
152
|
+
* scrollTop below `lastWriteTop`, that produced a full user-scroll-up
|
|
153
153
|
* signature out of two of our own layout changes: follow released mid
|
|
154
154
|
* animation and the content settled a card-height low. Judging the distance
|
|
155
155
|
* against the box we were last a bottom FOR keeps the guard measuring the
|
|
@@ -25,7 +25,7 @@ function isViewportGrowthClamp(args) {
|
|
|
25
25
|
* 1. At the true bottom (within the DPR-aware epsilon) → follow. This also
|
|
26
26
|
* absorbs the layout engine's clamp: a mid-stream content SHRINK drops
|
|
27
27
|
* scrollTop (which reads as an upward move) but lands exactly at the new
|
|
28
|
-
* bottom
|
|
28
|
+
* bottom, releasing there froze streaming follow for the rest of the
|
|
29
29
|
* turn.
|
|
30
30
|
* 2. Any other upward move → release, regardless of distance from the
|
|
31
31
|
* bottom. The scroll position now belongs to the user; only returning to
|
|
@@ -140,13 +140,13 @@ function isScrollUpIntent(input) {
|
|
|
140
140
|
* switch, before we have written anything this session).
|
|
141
141
|
*
|
|
142
142
|
* `viewportShrink` (px, default 0) is how much the SCROLLER'S OWN BOX has
|
|
143
|
-
* shrunk since that reference was recorded
|
|
143
|
+
* shrunk since that reference was recorded, chrome mounting below the
|
|
144
144
|
* transcript (a queue band, an attachment strip, a tip card), often
|
|
145
145
|
* spring-animated over several frames. Our own shrink inflates
|
|
146
146
|
* `distanceFromBottom` with no user input, so without this allowance the
|
|
147
147
|
* distance guard reads it as "meaningfully away from the bottom". Paired with
|
|
148
|
-
* a content SHRINK in the same commit window
|
|
149
|
-
* scrollTop below `lastWriteTop
|
|
148
|
+
* a content SHRINK in the same commit window, a tail-row remount clamping
|
|
149
|
+
* scrollTop below `lastWriteTop`, that produced a full user-scroll-up
|
|
150
150
|
* signature out of two of our own layout changes: follow released mid
|
|
151
151
|
* animation and the content settled a card-height low. Judging the distance
|
|
152
152
|
* against the box we were last a bottom FOR keeps the guard measuring the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-follow-core.js","names":[],"sources":["../../../src/components/conversation/scroll-follow-core.ts"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/hooks/virtualizer/FollowController.ts\n * (plain-scroller decision units), pinned at\n * 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * This product includes software developed at Amazon.com, Inc.\n * (https://www.amazon.com/).\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Pure plain-scroller decisions retained from FollowController; virtual row\n * measurement, persisted anchor resolution and restore settling are excluded.\n */\nimport {\n atBottomEpsilon,\n bottomTarget,\n distanceFromBottom,\n isAtEnd,\n type ScrollGeom,\n} from '#lib/scroll-geometry'\n\n/**\n * Default distance (px) from the bottom within which the reader counts as \"at the\n * bottom\" for the jump-to-latest control. Follow intent uses the much tighter\n * FOLLOW_REENGAGE_PX instead.\n */\nexport const DEFAULT_BOTTOM_THRESHOLD = 80\n\n/**\n * Tolerance (px) for treating a scroll position as \"the same\" as a value we\n * wrote programmatically. Covers sub-pixel rounding and 1px momentum overshoot.\n * Must stay small so a deliberate user scroll of even a few px is still seen as\n * a user scroll.\n */\nexport const SELF_SCROLL_EPSILON = 2\n\n/**\n * Recognise a `scroll` event caused by our own programmatic write rather than\n * by the user. `lastWriteTop < 0` means \"we have not written this session\", so\n * any scroll is treated as the user's.\n */\nexport function isSelfScroll(\n scrollTop: number,\n lastWriteTop: number,\n epsilon: number = SELF_SCROLL_EPSILON\n): boolean {\n return lastWriteTop >= 0 && Math.abs(scrollTop - lastWriteTop) <= epsilon\n}\n\n/**\n * A viewport can clamp our bottom write before its scroll/resize notification,\n * then streamed content can reopen the gap before either callback runs. Accept\n * only the exact offset explained by that growth, with no reader input. Other\n * offsets still belong to the reader. A programmatic reveal landing at this\n * same offset cannot be distinguished from native clamping by geometry alone.\n */\nexport function isViewportGrowthClamp(args: {\n geom: ScrollGeom\n lastWriteTop: number\n lastWriteClientHeight: number\n readerMovedSinceWrite: boolean\n}): boolean {\n const growth = args.geom.clientHeight - args.lastWriteClientHeight\n return (\n !args.readerMovedSinceWrite &&\n args.lastWriteTop >= 0 &&\n args.lastWriteClientHeight >= 0 &&\n growth > SELF_SCROLL_EPSILON &&\n Math.abs(args.geom.scrollTop - Math.max(0, args.lastWriteTop - growth)) <= SELF_SCROLL_EPSILON\n )\n}\n\n/**\n * Distance (px) from the true bottom within which a user scroll RE-ENGAGES\n * follow. Deliberately much tighter than DEFAULT_BOTTOM_THRESHOLD: that band\n * drives the jump-to-bottom pill's visibility, and reusing it for follow\n * meant a deliberate 3-99px scroll-up kept `stick` armed — the next content\n * change then yanked the reader back to the bottom. Re-engaging only when the\n * user has returned essentially to the bottom keeps \"scrolled up to read\"\n * positions belonging to the user.\n */\nexport const FOLLOW_REENGAGE_PX = 16\n\n/**\n * Direction-aware `stick` decision for a *user-initiated* scroll (self-scrolls\n * filtered out by the caller via `isSelfScroll`):\n *\n * 1. At the true bottom (within the DPR-aware epsilon) → follow. This also\n * absorbs the layout engine's clamp: a mid-stream content SHRINK drops\n * scrollTop (which reads as an upward move) but lands exactly at the new\n * bottom — releasing there froze streaming follow for the rest of the\n * turn.\n * 2. Any other upward move → release, regardless of distance from the\n * bottom. The scroll position now belongs to the user; only returning to\n * the bottom (3) re-engages.\n * 3. A genuine DOWNWARD move that arrives within FOLLOW_REENGAGE_PX of the\n * bottom → re-engage. A neutral event inside the band does NOT: that is\n * how content collapsing under a still reader re-armed follow.\n * 4. Otherwise (downward/neutral, still away from the bottom) → keep the\n * previous state.\n *\n * `prevScrollTop < 0` means \"no prior observation this session\". Direction is\n * unknowable then, so the decision is position-only and CONSERVATIVE: follow\n * only within the re-engage band. Keeping a stale `stick` on an unattributable\n * away-from-bottom scroll is how a reader gets yanked.\n */\nexport function resolveUserScrollStick(args: {\n stick: boolean\n scrollTop: number\n prevScrollTop: number\n geom: ScrollGeom\n /** Change in the scroller's own height since the previous scroll event.\n *\n * Positive = the viewport GREW (the composer shrank under a deletion, the\n * keyboard closed). That growth lowers the maximum scrollTop, so the engine\n * clamps any reader parked closer to the bottom than the growth — with no\n * application write anywhere. The clamp then arrives here as an ordinary\n * scroll event sitting at distance ~0, which rule 1 below used to read as\n * \"the reader came back to the bottom\" and re-arm follow for someone who\n * never touched the scroller. The next turn to start then took them to the\n * end. Rule 1 exists to absorb a CONTENT-shrink clamp mid-stream, and content\n * shrink moves `scrollHeight`, not `clientHeight` — so the two are\n * distinguishable, and this is the delta that tells them apart. */\n viewportGrowth?: number\n}): boolean {\n const { stick, scrollTop, prevScrollTop, geom } = args\n const dist = distanceFromBottom(geom)\n // A viewport growth large enough to explain the reader's arrival at the bottom\n // is the engine's clamp, not the reader. Leave `stick` exactly as it was.\n // A native clamp only ever LOWERS scrollTop, so a downward move concurrent with\n // the growth is the user's own and must still re-engage follow. Without the\n // direction term a reader who deliberately scrolls down while the keyboard\n // closes is refused their re-engagement.\n const clampedByViewport =\n (args.viewportGrowth ?? 0) > atBottomEpsilon() && scrollTop <= prevScrollTop + atBottomEpsilon()\n if (isAtEnd(geom)) return clampedByViewport ? stick : true\n if (prevScrollTop < 0) return dist <= FOLLOW_REENGAGE_PX\n if (scrollTop < prevScrollTop - 0.5) return false\n // Re-engagement requires a genuine DOWNWARD move, not merely a non-upward\n // event that finds the reader inside the band. A neutral event (identical\n // scrollTop -- the tail of an iOS momentum run, or any scroll fired while the\n // reader is at rest) used to satisfy this, so a reader sitting mid-transcript\n // could be re-armed by CONTENT rather than by their own hand: when rows\n // outside the window reprice smaller than their estimates, the remaining\n // content collapses under them and the bottom band arrives at the reader\n // instead of the reader arriving at it. Follow re-engaged, and the next pin\n // took them to the end -- reported as scrolling along and suddenly landing at\n // the bottom. Distance alone cannot tell those apart; the direction of the\n // reader's own move can.\n if (scrollTop > prevScrollTop + 0.5 && dist <= FOLLOW_REENGAGE_PX) return true\n return stick\n}\n\n/** What the reader did to the scroller, as far as telling a scroll from anything else. */\nexport type ReaderInput =\n | { kind: 'wheel'; deltaY: number }\n | { kind: 'key'; key: string; shiftKey: boolean }\n | { kind: 'touchmove' }\n | { kind: 'pointerdown'; onScroller: boolean }\n\n/** The events `readerInput` reads; a scroller listens for these to learn what the reader did. */\nexport const READER_INPUT_EVENTS = ['wheel', 'touchmove', 'pointerdown', 'keydown'] as const\n\nconst SCROLL_UP_KEYS = new Set(['ArrowUp', 'PageUp', 'Home'])\nconst SCROLL_KEYS = new Set(['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp', 'Home', 'End', ' '])\n\n/**\n * The reader input an event on `scroller` carries. Descendant controls own their\n * keys, so only a key pressed on the focused scroller itself counts: that is the\n * one place native keyboard scrolling starts.\n */\nexport function readerInput(event: Event, scroller: Element): ReaderInput | undefined {\n if (event.type === 'wheel') return { kind: 'wheel', deltaY: (event as WheelEvent).deltaY }\n if (event.type === 'keydown') {\n if (event.target !== scroller) return undefined\n const { key, shiftKey } = event as KeyboardEvent\n return { kind: 'key', key, shiftKey }\n }\n if (event.type === 'touchmove') return { kind: 'touchmove' }\n if (event.type === 'pointerdown')\n return { kind: 'pointerdown', onScroller: event.target === scroller }\n return undefined\n}\n\n/**\n * Can this input scroll the view at all? A wheel, a touch drag, a press on the\n * scroller itself (its scrollbar or gutter) or a scrolling key can; a click or a\n * selection inside the content, or a letter, cannot.\n */\nexport function isScrollIntent(input: ReaderInput): boolean {\n switch (input.kind) {\n case 'wheel':\n case 'touchmove':\n return true\n case 'key':\n return SCROLL_KEYS.has(input.key)\n case 'pointerdown':\n return input.onScroller\n }\n}\n\n/**\n * Is this the reader moving the view up, right now?\n *\n * A held position (see `createScrollFollow().hold`) is the caller's until the reader takes it,\n * and only an input that can scroll the view up takes it: a wheel notch up, an up key, a\n * touch drag, or a press on the scroller itself. A wheel notch down or a down key does not\n * move the view away from the end, so it leaves it where it is.\n */\nexport function isScrollUpIntent(input: ReaderInput): boolean {\n switch (input.kind) {\n case 'wheel':\n return input.deltaY < 0\n case 'key':\n return SCROLL_UP_KEYS.has(input.key) || (input.key === ' ' && input.shiftKey)\n case 'touchmove':\n return true\n case 'pointerdown':\n return input.onScroller\n }\n}\n\n/** Result of an automatic (RO / append) pin evaluation. */\nexport interface AutoPinResult {\n /** Whether to write `el.scrollTop = target` now. */\n pin: boolean\n /** Next value for `stick` (released to false if the user scrolled up). */\n stick: boolean\n /** The bottom scrollTop the caller should write when `pin` is true. */\n target: number\n}\n\n/**\n * Decide an automatic pin at the moment content changed (RO callback / append\n * layout effect / its follow-up rAF), reading LIVE geometry.\n *\n * - Not sticking → never pin.\n * - Sticking but the user has scrolled up since our last write\n * (`scrollTop < lastWriteTop - epsilon`) → release stick, don't pin.\n * This is the synchronous, race-proof guard.\n * - Otherwise → pin to the bottom (only actually move if not already there).\n *\n * `lastWriteTop < 0` disables the scroll-up guard (used right after a slot\n * switch, before we have written anything this session).\n *\n * `viewportShrink` (px, default 0) is how much the SCROLLER'S OWN BOX has\n * shrunk since that reference was recorded — chrome mounting below the\n * transcript (a queue band, an attachment strip, a tip card), often\n * spring-animated over several frames. Our own shrink inflates\n * `distanceFromBottom` with no user input, so without this allowance the\n * distance guard reads it as \"meaningfully away from the bottom\". Paired with\n * a content SHRINK in the same commit window — a tail-row remount clamping\n * scrollTop below `lastWriteTop` — that produced a full user-scroll-up\n * signature out of two of our own layout changes: follow released mid\n * animation and the content settled a card-height low. Judging the distance\n * against the box we were last a bottom FOR keeps the guard measuring the\n * user's move rather than our own. Only the shrink's own pixels are forgiven,\n * so a genuine drag inside the same tick still releases.\n *\n * Follow here means \"keep me at the end while output arrives\": there is no run\n * signal, so a reader resting where we last put them is carried back whether or\n * not anything is streaming.\n */\nexport function evaluateAutoPin(args: {\n stick: boolean\n geom: ScrollGeom\n lastWriteTop: number\n viewportShrink?: number\n}): AutoPinResult {\n const { stick, geom, lastWriteTop } = args\n const viewportShrink = Math.max(0, args.viewportShrink ?? 0)\n const target = bottomTarget(geom)\n if (!stick) return { pin: false, stick: false, target }\n // Release only on a genuine user scroll-UP: scrollTop dropped below our last\n // write AND we are now meaningfully away from the bottom. A pure content\n // SHRINK mid-stream (a partial markdown line re-parsing, a code fence opening\n // and reclassifying the block) clamps scrollTop below lastWriteTop too, but\n // leaves us still AT the new bottom (distance ~0). Without the distance guard\n // that shrink looked like a scroll-up and froze streaming follow — once\n // released, nothing re-armed stick for the rest of the response.\n if (\n lastWriteTop >= 0 &&\n geom.scrollTop < lastWriteTop - SELF_SCROLL_EPSILON &&\n distanceFromBottom(geom) - viewportShrink > SELF_SCROLL_EPSILON\n ) {\n return { pin: false, stick: false, target }\n }\n return { pin: Math.abs(geom.scrollTop - target) > atBottomEpsilon(), stick: true, target }\n}\n"],"mappings":";;;;;;AAiDA,SAAgB,aACd,WACA,cACA,UAAA,GACS;CACT,OAAO,gBAAgB,KAAK,KAAK,IAAI,YAAY,YAAY,KAAK;AACpE;;;;;;;;AASA,SAAgB,sBAAsB,MAK1B;CACV,MAAM,SAAS,KAAK,KAAK,eAAe,KAAK;CAC7C,OACE,CAAC,KAAK,yBACN,KAAK,gBAAgB,KACrB,KAAK,yBAAyB,KAC9B,SAAA,KACA,KAAK,IAAI,KAAK,KAAK,YAAY,KAAK,IAAI,GAAG,KAAK,eAAe,MAAM,CAAC,KAAA;AAE1E;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,SAAgB,uBAAuB,MAkB3B;CACV,MAAM,EAAE,OAAO,WAAW,eAAe,SAAS;CAClD,MAAM,OAAO,mBAAmB,IAAI;CAOpC,MAAM,qBACH,KAAK,kBAAkB,KAAK,gBAAgB,KAAK,aAAa,gBAAgB,g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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,gBAAgB,MAKd;CAChB,MAAM,EAAE,OAAO,MAAM,iBAAiB;CACtC,MAAM,iBAAiB,KAAK,IAAI,GAAG,KAAK,kBAAkB,CAAC;CAC3D,MAAM,SAAS,aAAa,IAAI;CAChC,IAAI,CAAC,OAAO,OAAO;EAAE,KAAK;EAAO,OAAO;EAAO;CAAO;CAQtD,IACE,gBAAgB,KAChB,KAAK,YAAY,eAAA,KACjB,mBAAmB,IAAI,IAAI,iBAAA,GAE3B,OAAO;EAAE,KAAK;EAAO,OAAO;EAAO;CAAO;CAE5C,OAAO;EAAE,KAAK,KAAK,IAAI,KAAK,YAAY,MAAM,IAAI,gBAAgB;EAAG,OAAO;EAAM;CAAO;AAC3F"}
|
|
1
|
+
{"version":3,"file":"scroll-follow-core.js","names":[],"sources":["../../../src/components/conversation/scroll-follow-core.ts"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/hooks/virtualizer/FollowController.ts\n * (plain-scroller decision units), pinned at\n * 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * This product includes software developed at Amazon.com, Inc.\n * (https://www.amazon.com/).\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * Pure plain-scroller decisions retained from FollowController; virtual row\n * measurement, persisted anchor resolution and restore settling are excluded.\n */\nimport {\n atBottomEpsilon,\n bottomTarget,\n distanceFromBottom,\n isAtEnd,\n type ScrollGeom,\n} from '#lib/scroll-geometry'\n\n/**\n * Default distance (px) from the bottom within which the reader counts as \"at the\n * bottom\" for the jump-to-latest control. Follow intent uses the much tighter\n * FOLLOW_REENGAGE_PX instead.\n */\nexport const DEFAULT_BOTTOM_THRESHOLD = 80\n\n/**\n * Tolerance (px) for treating a scroll position as \"the same\" as a value we\n * wrote programmatically. Covers sub-pixel rounding and 1px momentum overshoot.\n * Must stay small so a deliberate user scroll of even a few px is still seen as\n * a user scroll.\n */\nexport const SELF_SCROLL_EPSILON = 2\n\n/**\n * Recognise a `scroll` event caused by our own programmatic write rather than\n * by the user. `lastWriteTop < 0` means \"we have not written this session\", so\n * any scroll is treated as the user's.\n */\nexport function isSelfScroll(\n scrollTop: number,\n lastWriteTop: number,\n epsilon: number = SELF_SCROLL_EPSILON\n): boolean {\n return lastWriteTop >= 0 && Math.abs(scrollTop - lastWriteTop) <= epsilon\n}\n\n/**\n * A viewport can clamp our bottom write before its scroll/resize notification,\n * then streamed content can reopen the gap before either callback runs. Accept\n * only the exact offset explained by that growth, with no reader input. Other\n * offsets still belong to the reader. A programmatic reveal landing at this\n * same offset cannot be distinguished from native clamping by geometry alone.\n */\nexport function isViewportGrowthClamp(args: {\n geom: ScrollGeom\n lastWriteTop: number\n lastWriteClientHeight: number\n readerMovedSinceWrite: boolean\n}): boolean {\n const growth = args.geom.clientHeight - args.lastWriteClientHeight\n return (\n !args.readerMovedSinceWrite &&\n args.lastWriteTop >= 0 &&\n args.lastWriteClientHeight >= 0 &&\n growth > SELF_SCROLL_EPSILON &&\n Math.abs(args.geom.scrollTop - Math.max(0, args.lastWriteTop - growth)) <= SELF_SCROLL_EPSILON\n )\n}\n\n/**\n * Distance (px) from the true bottom within which a user scroll RE-ENGAGES\n * follow. Deliberately much tighter than DEFAULT_BOTTOM_THRESHOLD: that band\n * drives the jump-to-bottom pill's visibility, and reusing it for follow\n * meant a deliberate 3-99px scroll-up kept `stick` armed, the next content\n * change then yanked the reader back to the bottom. Re-engaging only when the\n * user has returned essentially to the bottom keeps \"scrolled up to read\"\n * positions belonging to the user.\n */\nexport const FOLLOW_REENGAGE_PX = 16\n\n/**\n * Direction-aware `stick` decision for a *user-initiated* scroll (self-scrolls\n * filtered out by the caller via `isSelfScroll`):\n *\n * 1. At the true bottom (within the DPR-aware epsilon) → follow. This also\n * absorbs the layout engine's clamp: a mid-stream content SHRINK drops\n * scrollTop (which reads as an upward move) but lands exactly at the new\n * bottom, releasing there froze streaming follow for the rest of the\n * turn.\n * 2. Any other upward move → release, regardless of distance from the\n * bottom. The scroll position now belongs to the user; only returning to\n * the bottom (3) re-engages.\n * 3. A genuine DOWNWARD move that arrives within FOLLOW_REENGAGE_PX of the\n * bottom → re-engage. A neutral event inside the band does NOT: that is\n * how content collapsing under a still reader re-armed follow.\n * 4. Otherwise (downward/neutral, still away from the bottom) → keep the\n * previous state.\n *\n * `prevScrollTop < 0` means \"no prior observation this session\". Direction is\n * unknowable then, so the decision is position-only and CONSERVATIVE: follow\n * only within the re-engage band. Keeping a stale `stick` on an unattributable\n * away-from-bottom scroll is how a reader gets yanked.\n */\nexport function resolveUserScrollStick(args: {\n stick: boolean\n scrollTop: number\n prevScrollTop: number\n geom: ScrollGeom\n /** Change in the scroller's own height since the previous scroll event.\n *\n * Positive = the viewport GREW (the composer shrank under a deletion, the\n * keyboard closed). That growth lowers the maximum scrollTop, so the engine\n * clamps any reader parked closer to the bottom than the growth, with no\n * application write anywhere. The clamp then arrives here as an ordinary\n * scroll event sitting at distance ~0, which rule 1 below used to read as\n * \"the reader came back to the bottom\" and re-arm follow for someone who\n * never touched the scroller. The next turn to start then took them to the\n * end. Rule 1 exists to absorb a CONTENT-shrink clamp mid-stream, and content\n * shrink moves `scrollHeight`, not `clientHeight`, so the two are\n * distinguishable, and this is the delta that tells them apart. */\n viewportGrowth?: number\n}): boolean {\n const { stick, scrollTop, prevScrollTop, geom } = args\n const dist = distanceFromBottom(geom)\n // A viewport growth large enough to explain the reader's arrival at the bottom\n // is the engine's clamp, not the reader. Leave `stick` exactly as it was.\n // A native clamp only ever LOWERS scrollTop, so a downward move concurrent with\n // the growth is the user's own and must still re-engage follow. Without the\n // direction term a reader who deliberately scrolls down while the keyboard\n // closes is refused their re-engagement.\n const clampedByViewport =\n (args.viewportGrowth ?? 0) > atBottomEpsilon() && scrollTop <= prevScrollTop + atBottomEpsilon()\n if (isAtEnd(geom)) return clampedByViewport ? stick : true\n if (prevScrollTop < 0) return dist <= FOLLOW_REENGAGE_PX\n if (scrollTop < prevScrollTop - 0.5) return false\n // Re-engagement requires a genuine DOWNWARD move, not merely a non-upward\n // event that finds the reader inside the band. A neutral event (identical\n // scrollTop -- the tail of an iOS momentum run, or any scroll fired while the\n // reader is at rest) used to satisfy this, so a reader sitting mid-transcript\n // could be re-armed by CONTENT rather than by their own hand: when rows\n // outside the window reprice smaller than their estimates, the remaining\n // content collapses under them and the bottom band arrives at the reader\n // instead of the reader arriving at it. Follow re-engaged, and the next pin\n // took them to the end -- reported as scrolling along and suddenly landing at\n // the bottom. Distance alone cannot tell those apart; the direction of the\n // reader's own move can.\n if (scrollTop > prevScrollTop + 0.5 && dist <= FOLLOW_REENGAGE_PX) return true\n return stick\n}\n\n/** What the reader did to the scroller, as far as telling a scroll from anything else. */\nexport type ReaderInput =\n | { kind: 'wheel'; deltaY: number }\n | { kind: 'key'; key: string; shiftKey: boolean }\n | { kind: 'touchmove' }\n | { kind: 'pointerdown'; onScroller: boolean }\n\n/** The events `readerInput` reads; a scroller listens for these to learn what the reader did. */\nexport const READER_INPUT_EVENTS = ['wheel', 'touchmove', 'pointerdown', 'keydown'] as const\n\nconst SCROLL_UP_KEYS = new Set(['ArrowUp', 'PageUp', 'Home'])\nconst SCROLL_KEYS = new Set(['ArrowDown', 'ArrowUp', 'PageDown', 'PageUp', 'Home', 'End', ' '])\n\n/**\n * The reader input an event on `scroller` carries. Descendant controls own their\n * keys, so only a key pressed on the focused scroller itself counts: that is the\n * one place native keyboard scrolling starts.\n */\nexport function readerInput(event: Event, scroller: Element): ReaderInput | undefined {\n if (event.type === 'wheel') return { kind: 'wheel', deltaY: (event as WheelEvent).deltaY }\n if (event.type === 'keydown') {\n if (event.target !== scroller) return undefined\n const { key, shiftKey } = event as KeyboardEvent\n return { kind: 'key', key, shiftKey }\n }\n if (event.type === 'touchmove') return { kind: 'touchmove' }\n if (event.type === 'pointerdown')\n return { kind: 'pointerdown', onScroller: event.target === scroller }\n return undefined\n}\n\n/**\n * Can this input scroll the view at all? A wheel, a touch drag, a press on the\n * scroller itself (its scrollbar or gutter) or a scrolling key can; a click or a\n * selection inside the content, or a letter, cannot.\n */\nexport function isScrollIntent(input: ReaderInput): boolean {\n switch (input.kind) {\n case 'wheel':\n case 'touchmove':\n return true\n case 'key':\n return SCROLL_KEYS.has(input.key)\n case 'pointerdown':\n return input.onScroller\n }\n}\n\n/**\n * Is this the reader moving the view up, right now?\n *\n * A held position (see `createScrollFollow().hold`) is the caller's until the reader takes it,\n * and only an input that can scroll the view up takes it: a wheel notch up, an up key, a\n * touch drag, or a press on the scroller itself. A wheel notch down or a down key does not\n * move the view away from the end, so it leaves it where it is.\n */\nexport function isScrollUpIntent(input: ReaderInput): boolean {\n switch (input.kind) {\n case 'wheel':\n return input.deltaY < 0\n case 'key':\n return SCROLL_UP_KEYS.has(input.key) || (input.key === ' ' && input.shiftKey)\n case 'touchmove':\n return true\n case 'pointerdown':\n return input.onScroller\n }\n}\n\n/** Result of an automatic (RO / append) pin evaluation. */\nexport interface AutoPinResult {\n /** Whether to write `el.scrollTop = target` now. */\n pin: boolean\n /** Next value for `stick` (released to false if the user scrolled up). */\n stick: boolean\n /** The bottom scrollTop the caller should write when `pin` is true. */\n target: number\n}\n\n/**\n * Decide an automatic pin at the moment content changed (RO callback / append\n * layout effect / its follow-up rAF), reading LIVE geometry.\n *\n * - Not sticking → never pin.\n * - Sticking but the user has scrolled up since our last write\n * (`scrollTop < lastWriteTop - epsilon`) → release stick, don't pin.\n * This is the synchronous, race-proof guard.\n * - Otherwise → pin to the bottom (only actually move if not already there).\n *\n * `lastWriteTop < 0` disables the scroll-up guard (used right after a slot\n * switch, before we have written anything this session).\n *\n * `viewportShrink` (px, default 0) is how much the SCROLLER'S OWN BOX has\n * shrunk since that reference was recorded, chrome mounting below the\n * transcript (a queue band, an attachment strip, a tip card), often\n * spring-animated over several frames. Our own shrink inflates\n * `distanceFromBottom` with no user input, so without this allowance the\n * distance guard reads it as \"meaningfully away from the bottom\". Paired with\n * a content SHRINK in the same commit window, a tail-row remount clamping\n * scrollTop below `lastWriteTop`, that produced a full user-scroll-up\n * signature out of two of our own layout changes: follow released mid\n * animation and the content settled a card-height low. Judging the distance\n * against the box we were last a bottom FOR keeps the guard measuring the\n * user's move rather than our own. Only the shrink's own pixels are forgiven,\n * so a genuine drag inside the same tick still releases.\n *\n * Follow here means \"keep me at the end while output arrives\": there is no run\n * signal, so a reader resting where we last put them is carried back whether or\n * not anything is streaming.\n */\nexport function evaluateAutoPin(args: {\n stick: boolean\n geom: ScrollGeom\n lastWriteTop: number\n viewportShrink?: number\n}): AutoPinResult {\n const { stick, geom, lastWriteTop } = args\n const viewportShrink = Math.max(0, args.viewportShrink ?? 0)\n const target = bottomTarget(geom)\n if (!stick) return { pin: false, stick: false, target }\n // Release only on a genuine user scroll-UP: scrollTop dropped below our last\n // write AND we are now meaningfully away from the bottom. A pure content\n // SHRINK mid-stream (a partial markdown line re-parsing, a code fence opening\n // and reclassifying the block) clamps scrollTop below lastWriteTop too, but\n // leaves us still AT the new bottom (distance ~0). Without the distance guard\n // that shrink looked like a scroll-up and froze streaming follow, once\n // released, nothing re-armed stick for the rest of the response.\n if (\n lastWriteTop >= 0 &&\n geom.scrollTop < lastWriteTop - SELF_SCROLL_EPSILON &&\n distanceFromBottom(geom) - viewportShrink > SELF_SCROLL_EPSILON\n ) {\n return { pin: false, stick: false, target }\n }\n return { pin: Math.abs(geom.scrollTop - target) > atBottomEpsilon(), stick: true, target }\n}\n"],"mappings":";;;;;;AAiDA,SAAgB,aACd,WACA,cACA,UAAA,GACS;CACT,OAAO,gBAAgB,KAAK,KAAK,IAAI,YAAY,YAAY,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,MAAM;EAAe,YAAY,MAAM,WAAW;CAAS;AAExE;;;;;;AAOA,SAAgB,eAAe,OAA6B;CAC1D,QAAQ,MAAM,MAAd;EACE,KAAK;EACL,KAAK,aACH,OAAO;EACT,KAAK,OACH,OAAO,YAAY,IAAI,MAAM,GAAG;EAClC,KAAK,eACH,OAAO,MAAM;CACjB;AACF;;;;;;;;;AAUA,SAAgB,iBAAiB,OAA6B;CAC5D,QAAQ,MAAM,MAAd;EACE,KAAK,SACH,OAAO,MAAM,SAAS;EACxB,KAAK,OACH,OAAO,eAAe,IAAI,MAAM,GAAG,KAAM,MAAM,QAAQ,OAAO,MAAM;EACtE,KAAK,aACH,OAAO;EACT,KAAK,eACH,OAAO,MAAM;CACjB;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,gBAAgB,MAKd;CAChB,MAAM,EAAE,OAAO,MAAM,iBAAiB;CACtC,MAAM,iBAAiB,KAAK,IAAI,GAAG,KAAK,kBAAkB,CAAC;CAC3D,MAAM,SAAS,aAAa,IAAI;CAChC,IAAI,CAAC,OAAO,OAAO;EAAE,KAAK;EAAO,OAAO;EAAO;CAAO;CAQtD,IACE,gBAAgB,KAChB,KAAK,YAAY,eAAA,KACjB,mBAAmB,IAAI,IAAI,iBAAA,GAE3B,OAAO;EAAE,KAAK;EAAO,OAAO;EAAO;CAAO;CAE5C,OAAO;EAAE,KAAK,KAAK,IAAI,KAAK,YAAY,MAAM,IAAI,gBAAgB;EAAG,OAAO;EAAM;CAAO;AAC3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-follow.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/scroll-follow.ts"],"names":[],"mappings":"AAkCA,sGAAsG;AACtG,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAEvF,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,MAAM,MAAM,IAAI,CAAA;AAE/C,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,OAAO,EAAE,MAAM,OAAO,CAAA;IACtB,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IAClC,SAAS,EAAE,MAAM,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,2BAA2B,GAAG,SAAS,CAAA;IAC/D,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,2BAA2B,KAAK,IAAI,CAAA;CACnE;;;;;
|
|
1
|
+
{"version":3,"file":"scroll-follow.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/scroll-follow.ts"],"names":[],"mappings":"AAkCA,sGAAsG;AACtG,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAEvF,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,MAAM,MAAM,IAAI,CAAA;AAE/C,kFAAkF;AAClF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,OAAO,EAAE,MAAM,OAAO,CAAA;IACtB,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IAClC,SAAS,EAAE,MAAM,MAAM,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,2BAA2B,GAAG,SAAS,CAAA;IAC/D,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,2BAA2B,KAAK,IAAI,CAAA;CACnE;;;;;4BAmV2B,cAAc;2BASf,cAAc;EAIxC"}
|
|
@@ -29,13 +29,23 @@ function createScrollFollow(options) {
|
|
|
29
29
|
holdIntent = true;
|
|
30
30
|
return false;
|
|
31
31
|
};
|
|
32
|
+
let reportedTop = NaN;
|
|
33
|
+
let reportedFollowing;
|
|
32
34
|
const reportPosition = () => {
|
|
33
|
-
if (scroller)
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
if (!scroller) return;
|
|
36
|
+
const top = scroller.scrollTop;
|
|
37
|
+
const following = untrack(options.enabled) && stick;
|
|
38
|
+
if (top === reportedTop && following === reportedFollowing) return;
|
|
39
|
+
reportedTop = top;
|
|
40
|
+
reportedFollowing = following;
|
|
41
|
+
untrack(() => options.onPositionChange?.({
|
|
42
|
+
top,
|
|
43
|
+
following
|
|
36
44
|
}));
|
|
37
45
|
};
|
|
38
46
|
onCleanup(reportPosition);
|
|
47
|
+
let unbindScroller;
|
|
48
|
+
onCleanup(() => unbindScroller?.());
|
|
39
49
|
const rememberPosition = (element) => {
|
|
40
50
|
endRow = content?.lastElementChild ?? null;
|
|
41
51
|
lastWriteTop = element.scrollTop;
|
|
@@ -179,6 +189,7 @@ function createScrollFollow(options) {
|
|
|
179
189
|
contentObserver?.disconnect();
|
|
180
190
|
});
|
|
181
191
|
stick = true;
|
|
192
|
+
reportedTop = NaN;
|
|
182
193
|
holdGeneration += 1;
|
|
183
194
|
holds = 0;
|
|
184
195
|
holdFollowing = false;
|
|
@@ -239,7 +250,7 @@ function createScrollFollow(options) {
|
|
|
239
250
|
}
|
|
240
251
|
if (!initial && enabled) writePin(scroller, bottomTarget(scrollGeometry(scroller)));
|
|
241
252
|
else if (initial && stick) writePin(scroller, bottomTarget(scrollGeometry(scroller)));
|
|
242
|
-
setAtBottom(computeAtBottom(scrollGeometry(scroller), options.threshold
|
|
253
|
+
setAtBottom(computeAtBottom(scrollGeometry(scroller), untrack(options.threshold)));
|
|
243
254
|
reportPosition();
|
|
244
255
|
observe();
|
|
245
256
|
});
|
|
@@ -249,8 +260,12 @@ function createScrollFollow(options) {
|
|
|
249
260
|
jump,
|
|
250
261
|
hold,
|
|
251
262
|
bindScroller: (element) => {
|
|
263
|
+
unbindScroller?.();
|
|
252
264
|
scroller = element;
|
|
253
265
|
for (const type of READER_INPUT_EVENTS) element.addEventListener(type, noteReaderInput, { passive: true });
|
|
266
|
+
unbindScroller = () => {
|
|
267
|
+
for (const type of READER_INPUT_EVENTS) element.removeEventListener(type, noteReaderInput);
|
|
268
|
+
};
|
|
254
269
|
},
|
|
255
270
|
bindContent: (element) => {
|
|
256
271
|
content = element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-follow.js","names":["geometry"],"sources":["../../../src/components/conversation/scroll-follow.ts"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/app-sdk/useChatScrollFollow.ts,\n * pinned at 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * This product includes software developed at Amazon.com, Inc. (https://www.amazon.com/).\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations under the License.\n * Solid owner effects replace React refs/effects; native geometry and the\n * content/viewport observer contract are retained. No session store is copied.\n */\nimport { createEffect, createSignal, onCleanup, untrack } from 'solid-js'\nimport {\n bottomTarget,\n computeAtBottom,\n isAtEnd,\n scrollGeometry as geometry,\n} from '#lib/scroll-geometry'\nimport {\n evaluateAutoPin,\n isScrollIntent,\n isScrollUpIntent,\n isSelfScroll,\n isViewportGrowthClamp,\n READER_INPUT_EVENTS,\n readerInput,\n resolveUserScrollStick,\n SELF_SCROLL_EPSILON,\n} from './scroll-follow-core'\n\n/** Where the reader is in a transcript: the native offset, and whether they are following its end. */\nexport type ConversationReadingPosition = Readonly<{ top: number; following: boolean }>\n\n/** Opens a hold on the follow position (see `createScrollFollow`); the function it returns closes it. */\nexport type ScrollFollowHold = () => () => void\n\n/** Internal plain-scroller binding; host-owned restoration can disable follow. */\nexport function createScrollFollow(options: {\n enabled: () => boolean\n resetKey: () => string | undefined\n threshold: () => number\n initialPosition?: () => ConversationReadingPosition | undefined\n onPositionChange?: (position: ConversationReadingPosition) => void\n}) {\n const [atBottom, setAtBottom] = createSignal(true)\n let scroller: HTMLDivElement | undefined\n let content: HTMLDivElement | undefined\n let stick = true\n let lastWriteTop = -1\n let lastWriteClientHeight = -1\n let readerMovedSinceWrite = false\n let previousTop = -1\n let lastScrollClientHeight = 0\n // The content's last row when the offset was last taken as the reader's own. Rows added\n // after it are what an append put in since.\n let endRow: Element | null = null\n let pendingRestore: { frame: number; fromTop: number; target: number } | undefined\n let pendingRestoreUserIntent = false\n // A hold is the caller saying it is positioning the view (see `hold`): while one is\n // open and the reader was following, the content's moves are not read as the reader's.\n let holds = 0\n let holdFollowing = false\n let holdIntent = false\n let holdTop = -1\n // Bumped on every identity change, so a hold opened for the previous conversation can\n // neither pin the next one nor close over its state.\n let holdGeneration = 0\n const holding = () => holds > 0 && holdFollowing && !holdIntent\n // Is the view still where the hold left it? The content can move the offset only by\n // clamping it to the end it has now; anything else moved it from outside (a reveal, a\n // search jump), and that is the caller's to keep, so the hold gives way.\n const holdsPosition = (element: HTMLDivElement) => {\n if (!holding()) return false\n const end = bottomTarget(geometry(element))\n if (Math.abs(element.scrollTop - Math.min(holdTop, end)) <= SELF_SCROLL_EPSILON) return true\n holdIntent = true\n return false\n }\n const reportPosition = () => {\n if (scroller)\n untrack(() =>\n options.onPositionChange?.({\n top: scroller!.scrollTop,\n following: options.enabled() && stick,\n })\n )\n }\n onCleanup(reportPosition)\n\n const rememberPosition = (element: HTMLDivElement) => {\n endRow = content?.lastElementChild ?? null\n lastWriteTop = element.scrollTop\n lastWriteClientHeight = element.clientHeight\n previousTop = element.scrollTop\n readerMovedSinceWrite = false\n }\n const writePin = (element: HTMLDivElement, target: number) => {\n // Instant writes keep the self-scroll reference synchronized. A smooth\n // animation would produce intermediate positions that resemble user input.\n element.scrollTop = target\n rememberPosition(element)\n }\n const acceptViewportClamp = (element: HTMLDivElement) => {\n if (\n stick &&\n isViewportGrowthClamp({\n geom: geometry(element),\n lastWriteTop,\n lastWriteClientHeight,\n readerMovedSinceWrite,\n })\n )\n rememberPosition(element)\n }\n // How much the rows appended after `endRow` add to the content's height, or 0 when the\n // content changed in any other way. A tail append never moves the offset, so taking it\n // off the height gives the end the reader had before it.\n const appendedHeight = () => {\n const last = content?.lastElementChild\n if (!last || !endRow || last === endRow || endRow.parentElement !== content) return 0\n return Math.max(0, last.getBoundingClientRect().bottom - endRow.getBoundingClientRect().bottom)\n }\n const pinHeld = (element: HTMLDivElement) => {\n const geom = geometry(element)\n stick = true\n if (!isAtEnd(geom)) writePin(element, bottomTarget(geom))\n // An end the engine already clamped to is accepted as it stands, and is the reference\n // from here on: the write before it is further down than the content now reaches.\n else rememberPosition(element)\n holdTop = element.scrollTop\n setAtBottom(computeAtBottom(geometry(element), options.threshold()))\n reportPosition()\n }\n const pinAuto = () => {\n if (!scroller || !options.enabled() || pendingRestore) return\n if (holdsPosition(scroller)) return pinHeld(scroller)\n acceptViewportClamp(scroller)\n const geom = geometry(scroller)\n const result = evaluateAutoPin({\n stick,\n geom,\n lastWriteTop,\n viewportShrink: lastWriteClientHeight >= 0 ? lastWriteClientHeight - geom.clientHeight : 0,\n })\n stick = result.stick\n if (result.pin) writePin(scroller, result.target)\n else if (result.stick) rememberPosition(scroller)\n setAtBottom(computeAtBottom(geometry(scroller), options.threshold()))\n reportPosition()\n }\n const onScroll = () => {\n if (!scroller) return\n if (pendingRestore) {\n // A reset can clamp the outgoing offset while the incoming rows are\n // shorter. That notification is layout, not reader intent, and must not\n // cancel the snapshot waiting for the new rows to commit.\n const clampedFromTop = Math.min(pendingRestore.fromTop, bottomTarget(geometry(scroller)))\n if (\n pendingRestore.fromTop - clampedFromTop > 1 &&\n Math.abs(scroller.scrollTop - clampedFromTop) <= 1\n )\n return\n // An unexplained offset change can also be a browser clamp. Only actual\n // user scroll intent followed by a non-clamp movement cancels restoration.\n if (!pendingRestoreUserIntent) return\n cancelAnimationFrame(pendingRestore.frame)\n pendingRestore = undefined\n pendingRestoreUserIntent = false\n }\n if (!options.enabled()) {\n reportPosition()\n return\n }\n if (holdsPosition(scroller)) return pinHeld(scroller)\n acceptViewportClamp(scroller)\n const geom = geometry(scroller)\n setAtBottom(computeAtBottom(geom, options.threshold()))\n if (!isSelfScroll(geom.scrollTop, lastWriteTop)) {\n stick = resolveUserScrollStick({\n stick,\n scrollTop: geom.scrollTop,\n prevScrollTop: previousTop,\n geom,\n viewportGrowth: lastScrollClientHeight > 0 ? geom.clientHeight - lastScrollClientHeight : 0,\n })\n if (!stick) {\n lastWriteTop = -1\n lastWriteClientHeight = -1\n }\n }\n // A content-collapse clamp can arrive before ResizeObserver. Keep its new\n // bottom as our reference if viewport growth and more output follow next.\n if (stick && isAtEnd(geom)) rememberPosition(scroller)\n previousTop = geom.scrollTop\n // This baseline belongs only to scroll events, not observer callbacks.\n // Advancing it during resize would erase the viewport-clamp evidence.\n lastScrollClientHeight = geom.clientHeight\n reportPosition()\n }\n const jump = () => {\n if (!scroller || !options.enabled()) return\n stick = true\n writePin(scroller, bottomTarget(geometry(scroller)))\n setAtBottom(true)\n reportPosition()\n // The jump control disappears at the bottom. Return its keyboard focus to\n // the transcript instead of leaving the reader on a detached button.\n scroller.focus({ preventScroll: true })\n }\n\n // Open while the caller moves content under a reader who is following, so a clamp or an\n // insert it causes is not mistaken for the reader leaving the end. It gives way to the\n // reader's own scroll-up (`isScrollUpIntent`) and to anything else that moves the view\n // from outside (a reveal, a search jump); closing it puts a reader who is still following\n // back at the end. A change of conversation invalidates it, so the next conversation's\n // saved position is its own. A reveal or search jump outside a hold is never affected.\n const hold = () => {\n if (holds === 0) {\n holdFollowing = options.enabled() && stick && scroller !== undefined\n holdIntent = false\n holdTop = scroller ? scroller.scrollTop : -1\n }\n holds += 1\n const generation = holdGeneration\n let open = true\n return () => {\n if (!open || generation !== holdGeneration) return\n open = false\n // Asked while this hold still counts: `holdsPosition` is false once none is open.\n const last = holds === 1\n const resume = last && scroller !== undefined && holdsPosition(scroller)\n holds -= 1\n if (!last) return\n holdFollowing = false\n holdIntent = false\n if (resume && scroller && options.enabled() && !pendingRestore) pinHeld(scroller)\n }\n }\n const noteReaderInput = (event: Event) => {\n if (!scroller) return\n const input = readerInput(event, scroller)\n if (!input) return\n // Only reader intent followed by an unexplained offset change cancels a\n // pending snapshot restore; a browser clamp alone must not.\n if (pendingRestore && isScrollIntent(input)) pendingRestoreUserIntent = true\n if (isScrollUpIntent(input)) {\n readerMovedSinceWrite = true\n if (holds > 0) holdIntent = true\n }\n }\n\n createEffect(() => {\n options.resetKey()\n const enabled = options.enabled()\n // Capture before any reporting callback can replace the host snapshot.\n const candidate = untrack(() => options.initialPosition?.())\n const initial =\n candidate && Number.isFinite(candidate.top) && candidate.top >= 0 ? candidate : undefined\n let scheduledRestore: typeof pendingRestore\n let observer: ResizeObserver | undefined\n let contentObserver: MutationObserver | undefined\n onCleanup(() => {\n if (scheduledRestore) {\n cancelAnimationFrame(scheduledRestore.frame)\n if (pendingRestore === scheduledRestore) pendingRestore = undefined\n }\n pendingRestoreUserIntent = false\n observer?.disconnect()\n contentObserver?.disconnect()\n })\n stick = true\n holdGeneration += 1\n holds = 0\n holdFollowing = false\n holdIntent = false\n lastWriteTop = -1\n lastWriteClientHeight = -1\n readerMovedSinceWrite = false\n previousTop = -1\n lastScrollClientHeight = 0\n setAtBottom(true)\n if (!enabled || !scroller) return\n // Snapshot updates must not become another positioning owner. Consume the\n // host's snapshot only at entry/reset, then native reader intent owns follow.\n if (initial) {\n stick = enabled && initial.following\n }\n\n const observe = () => {\n if (!enabled || typeof ResizeObserver === 'undefined') return\n observer = new ResizeObserver(pinAuto)\n observer.observe(scroller!)\n if (content) {\n observer.observe(content)\n if (typeof MutationObserver !== 'undefined') {\n contentObserver = new MutationObserver(() => {\n // A collapsed turn can clamp the offset before any scroll/resize\n // callback. Remember that bottom at the mutation boundary, before\n // a later task grows the viewport or streams more content. This is\n // bookkeeping only: never pin, re-arm, or compete with another owner.\n if (\n !scroller ||\n !options.enabled() ||\n pendingRestore ||\n holds > 0 ||\n !stick ||\n readerMovedSinceWrite ||\n lastWriteTop < 0\n )\n return\n // Read the offset once per mutation batch. This can flush pending\n // layout, but deferring it loses a collapse clamp before a later task\n // grows the viewport/output. Ordinary growth needs no other geometry.\n if (scroller.scrollTop >= lastWriteTop - SELF_SCROLL_EPSILON) return\n const geom = geometry(scroller)\n if (isAtEnd(geom)) return rememberPosition(scroller)\n // Rows that size themselves late can shrink the content, and a layout read\n // anywhere clamps the offset at once, while the scroll event and resize\n // callback that report it wait for the next frame. A turn appended before\n // that frame (WebKit paints late under load) leaves the offset at the end the\n // content had without the new turn, which those callbacks would then measure\n // against the grown content and take for the reader scrolling up. An offset\n // exactly at that earlier end is the clamp; a reveal lands anywhere else.\n const grown = appendedHeight()\n if (grown > 0 && isAtEnd({ ...geom, scrollHeight: geom.scrollHeight - grown }))\n rememberPosition(scroller)\n })\n contentObserver.observe(content, { childList: true, characterData: true, subtree: true })\n }\n }\n }\n\n if (initial && !stick) {\n // The identity effect can run before Solid has inserted the new rows. A\n // synchronous write is clamped by the outgoing short transcript, so defer\n // restoration until the browser has committed the new content and layout.\n const restore = {\n frame: 0,\n fromTop: scroller.scrollTop,\n target: initial.top,\n }\n scheduledRestore = restore\n pendingRestore = restore\n pendingRestoreUserIntent = false\n // Keep resize observation alive during the pending frame. Its callback is\n // guarded above, and remains active if user input cancels restoration.\n observe()\n restore.frame = requestAnimationFrame(() => {\n if (pendingRestore !== restore || !scroller) return\n pendingRestore = undefined\n pendingRestoreUserIntent = false\n writePin(scroller, restore.target)\n setAtBottom(computeAtBottom(geometry(scroller), options.threshold()))\n reportPosition()\n })\n return\n }\n\n if (!initial && enabled) writePin(scroller, bottomTarget(geometry(scroller)))\n else if (initial && stick) writePin(scroller, bottomTarget(geometry(scroller)))\n setAtBottom(computeAtBottom(geometry(scroller), options.threshold()))\n reportPosition()\n observe()\n })\n\n return {\n atBottom,\n onScroll,\n jump,\n hold,\n bindScroller: (element: HTMLDivElement) => {\n scroller = element\n for (const type of READER_INPUT_EVENTS)\n element.addEventListener(type, noteReaderInput, { passive: true })\n },\n bindContent: (element: HTMLDivElement) => {\n content = element\n },\n }\n}\n"],"mappings":";;;;;AAyCA,SAAgB,mBAAmB,SAMhC;CACD,MAAM,CAAC,UAAU,eAAe,aAAa,IAAI;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI,QAAQ;CACZ,IAAI,eAAe;CACnB,IAAI,wBAAwB;CAC5B,IAAI,wBAAwB;CAC5B,IAAI,cAAc;CAClB,IAAI,yBAAyB;CAG7B,IAAI,SAAyB;CAC7B,IAAI;CACJ,IAAI,2BAA2B;CAG/B,IAAI,QAAQ;CACZ,IAAI,gBAAgB;CACpB,IAAI,aAAa;CACjB,IAAI,UAAU;CAGd,IAAI,iBAAiB;CACrB,MAAM,gBAAgB,QAAQ,KAAK,iBAAiB,CAAC;CAIrD,MAAM,iBAAiB,YAA4B;EACjD,IAAI,CAAC,QAAQ,GAAG,OAAO;EACvB,MAAM,MAAM,aAAaA,eAAS,OAAO,CAAC;EAC1C,IAAI,KAAK,IAAI,QAAQ,YAAY,KAAK,IAAI,SAAS,GAAG,CAAC,KAAA,GAA0B,OAAO;EACxF,aAAa;EACb,OAAO;CACT;CACA,MAAM,uBAAuB;EAC3B,IAAI,UACF,cACE,QAAQ,mBAAmB;GACzB,KAAK,SAAU;GACf,WAAW,QAAQ,QAAQ,KAAK;EAClC,CAAC,CACH;CACJ;CACA,UAAU,cAAc;CAExB,MAAM,oBAAoB,YAA4B;EACpD,SAAS,SAAS,oBAAoB;EACtC,eAAe,QAAQ;EACvB,wBAAwB,QAAQ;EAChC,cAAc,QAAQ;EACtB,wBAAwB;CAC1B;CACA,MAAM,YAAY,SAAyB,WAAmB;EAG5D,QAAQ,YAAY;EACpB,iBAAiB,OAAO;CAC1B;CACA,MAAM,uBAAuB,YAA4B;EACvD,IACE,SACA,sBAAsB;GACpB,MAAMA,eAAS,OAA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AS,KAAK,CAAC;EACrE;EACA,cAAc,YAA4B;GACxC,UAAU;EACZ;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"scroll-follow.js","names":["geometry"],"sources":["../../../src/components/conversation/scroll-follow.ts"],"sourcesContent":["/*\n * Substantially translated from KiroCrew website/src/app-sdk/useChatScrollFollow.ts,\n * pinned at 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * This product includes software developed at Amazon.com, Inc. (https://www.amazon.com/).\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy at http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations under the License.\n * Solid owner effects replace React refs/effects; native geometry and the\n * content/viewport observer contract are retained. No session store is copied.\n */\nimport { createEffect, createSignal, onCleanup, untrack } from 'solid-js'\nimport {\n bottomTarget,\n computeAtBottom,\n isAtEnd,\n scrollGeometry as geometry,\n} from '#lib/scroll-geometry'\nimport {\n evaluateAutoPin,\n isScrollIntent,\n isScrollUpIntent,\n isSelfScroll,\n isViewportGrowthClamp,\n READER_INPUT_EVENTS,\n readerInput,\n resolveUserScrollStick,\n SELF_SCROLL_EPSILON,\n} from './scroll-follow-core'\n\n/** Where the reader is in a transcript: the native offset, and whether they are following its end. */\nexport type ConversationReadingPosition = Readonly<{ top: number; following: boolean }>\n\n/** Opens a hold on the follow position (see `createScrollFollow`); the function it returns closes it. */\nexport type ScrollFollowHold = () => () => void\n\n/** Internal plain-scroller binding; host-owned restoration can disable follow. */\nexport function createScrollFollow(options: {\n enabled: () => boolean\n resetKey: () => string | undefined\n threshold: () => number\n initialPosition?: () => ConversationReadingPosition | undefined\n onPositionChange?: (position: ConversationReadingPosition) => void\n}) {\n const [atBottom, setAtBottom] = createSignal(true)\n let scroller: HTMLDivElement | undefined\n let content: HTMLDivElement | undefined\n let stick = true\n let lastWriteTop = -1\n let lastWriteClientHeight = -1\n let readerMovedSinceWrite = false\n let previousTop = -1\n let lastScrollClientHeight = 0\n // The content's last row when the offset was last taken as the reader's own. Rows added\n // after it are what an append put in since.\n let endRow: Element | null = null\n let pendingRestore: { frame: number; fromTop: number; target: number } | undefined\n let pendingRestoreUserIntent = false\n // A hold is the caller saying it is positioning the view (see `hold`): while one is\n // open and the reader was following, the content's moves are not read as the reader's.\n let holds = 0\n let holdFollowing = false\n let holdIntent = false\n let holdTop = -1\n // Bumped on every identity change, so a hold opened for the previous conversation can\n // neither pin the next one nor close over its state.\n let holdGeneration = 0\n const holding = () => holds > 0 && holdFollowing && !holdIntent\n // Is the view still where the hold left it? The content can move the offset only by\n // clamping it to the end it has now; anything else moved it from outside (a reveal, a\n // search jump), and that is the caller's to keep, so the hold gives way.\n const holdsPosition = (element: HTMLDivElement) => {\n if (!holding()) return false\n const end = bottomTarget(geometry(element))\n if (Math.abs(element.scrollTop - Math.min(holdTop, end)) <= SELF_SCROLL_EPSILON) return true\n holdIntent = true\n return false\n }\n // Reported on every scroll event and resize pin, which is about once a frame\n // while a turn streams. A host that stores it would re-render each time, so an\n // unchanged position is not reported again.\n let reportedTop = Number.NaN\n let reportedFollowing: boolean | undefined\n const reportPosition = () => {\n if (!scroller) return\n const top = scroller.scrollTop\n const following = untrack(options.enabled) && stick\n if (top === reportedTop && following === reportedFollowing) return\n reportedTop = top\n reportedFollowing = following\n untrack(() => options.onPositionChange?.({ top, following }))\n }\n onCleanup(reportPosition)\n let unbindScroller: (() => void) | undefined\n onCleanup(() => unbindScroller?.())\n\n const rememberPosition = (element: HTMLDivElement) => {\n endRow = content?.lastElementChild ?? null\n lastWriteTop = element.scrollTop\n lastWriteClientHeight = element.clientHeight\n previousTop = element.scrollTop\n readerMovedSinceWrite = false\n }\n const writePin = (element: HTMLDivElement, target: number) => {\n // Instant writes keep the self-scroll reference synchronized. A smooth\n // animation would produce intermediate positions that resemble user input.\n element.scrollTop = target\n rememberPosition(element)\n }\n const acceptViewportClamp = (element: HTMLDivElement) => {\n if (\n stick &&\n isViewportGrowthClamp({\n geom: geometry(element),\n lastWriteTop,\n lastWriteClientHeight,\n readerMovedSinceWrite,\n })\n )\n rememberPosition(element)\n }\n // How much the rows appended after `endRow` add to the content's height, or 0 when the\n // content changed in any other way. A tail append never moves the offset, so taking it\n // off the height gives the end the reader had before it.\n const appendedHeight = () => {\n const last = content?.lastElementChild\n if (!last || !endRow || last === endRow || endRow.parentElement !== content) return 0\n return Math.max(0, last.getBoundingClientRect().bottom - endRow.getBoundingClientRect().bottom)\n }\n const pinHeld = (element: HTMLDivElement) => {\n const geom = geometry(element)\n stick = true\n if (!isAtEnd(geom)) writePin(element, bottomTarget(geom))\n // An end the engine already clamped to is accepted as it stands, and is the reference\n // from here on: the write before it is further down than the content now reaches.\n else rememberPosition(element)\n holdTop = element.scrollTop\n setAtBottom(computeAtBottom(geometry(element), options.threshold()))\n reportPosition()\n }\n const pinAuto = () => {\n if (!scroller || !options.enabled() || pendingRestore) return\n if (holdsPosition(scroller)) return pinHeld(scroller)\n acceptViewportClamp(scroller)\n const geom = geometry(scroller)\n const result = evaluateAutoPin({\n stick,\n geom,\n lastWriteTop,\n viewportShrink: lastWriteClientHeight >= 0 ? lastWriteClientHeight - geom.clientHeight : 0,\n })\n stick = result.stick\n if (result.pin) writePin(scroller, result.target)\n else if (result.stick) rememberPosition(scroller)\n setAtBottom(computeAtBottom(geometry(scroller), options.threshold()))\n reportPosition()\n }\n const onScroll = () => {\n if (!scroller) return\n if (pendingRestore) {\n // A reset can clamp the outgoing offset while the incoming rows are\n // shorter. That notification is layout, not reader intent, and must not\n // cancel the snapshot waiting for the new rows to commit.\n const clampedFromTop = Math.min(pendingRestore.fromTop, bottomTarget(geometry(scroller)))\n if (\n pendingRestore.fromTop - clampedFromTop > 1 &&\n Math.abs(scroller.scrollTop - clampedFromTop) <= 1\n )\n return\n // An unexplained offset change can also be a browser clamp. Only actual\n // user scroll intent followed by a non-clamp movement cancels restoration.\n if (!pendingRestoreUserIntent) return\n cancelAnimationFrame(pendingRestore.frame)\n pendingRestore = undefined\n pendingRestoreUserIntent = false\n }\n if (!options.enabled()) {\n reportPosition()\n return\n }\n if (holdsPosition(scroller)) return pinHeld(scroller)\n acceptViewportClamp(scroller)\n const geom = geometry(scroller)\n setAtBottom(computeAtBottom(geom, options.threshold()))\n if (!isSelfScroll(geom.scrollTop, lastWriteTop)) {\n stick = resolveUserScrollStick({\n stick,\n scrollTop: geom.scrollTop,\n prevScrollTop: previousTop,\n geom,\n viewportGrowth: lastScrollClientHeight > 0 ? geom.clientHeight - lastScrollClientHeight : 0,\n })\n if (!stick) {\n lastWriteTop = -1\n lastWriteClientHeight = -1\n }\n }\n // A content-collapse clamp can arrive before ResizeObserver. Keep its new\n // bottom as our reference if viewport growth and more output follow next.\n if (stick && isAtEnd(geom)) rememberPosition(scroller)\n previousTop = geom.scrollTop\n // This baseline belongs only to scroll events, not observer callbacks.\n // Advancing it during resize would erase the viewport-clamp evidence.\n lastScrollClientHeight = geom.clientHeight\n reportPosition()\n }\n const jump = () => {\n if (!scroller || !options.enabled()) return\n stick = true\n writePin(scroller, bottomTarget(geometry(scroller)))\n setAtBottom(true)\n reportPosition()\n // The jump control disappears at the bottom. Return its keyboard focus to\n // the transcript instead of leaving the reader on a detached button.\n scroller.focus({ preventScroll: true })\n }\n\n // Open while the caller moves content under a reader who is following, so a clamp or an\n // insert it causes is not mistaken for the reader leaving the end. It gives way to the\n // reader's own scroll-up (`isScrollUpIntent`) and to anything else that moves the view\n // from outside (a reveal, a search jump); closing it puts a reader who is still following\n // back at the end. A change of conversation invalidates it, so the next conversation's\n // saved position is its own. A reveal or search jump outside a hold is never affected.\n const hold = () => {\n if (holds === 0) {\n holdFollowing = options.enabled() && stick && scroller !== undefined\n holdIntent = false\n holdTop = scroller ? scroller.scrollTop : -1\n }\n holds += 1\n const generation = holdGeneration\n let open = true\n return () => {\n if (!open || generation !== holdGeneration) return\n open = false\n // Asked while this hold still counts: `holdsPosition` is false once none is open.\n const last = holds === 1\n const resume = last && scroller !== undefined && holdsPosition(scroller)\n holds -= 1\n if (!last) return\n holdFollowing = false\n holdIntent = false\n if (resume && scroller && options.enabled() && !pendingRestore) pinHeld(scroller)\n }\n }\n const noteReaderInput = (event: Event) => {\n if (!scroller) return\n const input = readerInput(event, scroller)\n if (!input) return\n // Only reader intent followed by an unexplained offset change cancels a\n // pending snapshot restore; a browser clamp alone must not.\n if (pendingRestore && isScrollIntent(input)) pendingRestoreUserIntent = true\n if (isScrollUpIntent(input)) {\n readerMovedSinceWrite = true\n if (holds > 0) holdIntent = true\n }\n }\n\n createEffect(() => {\n options.resetKey()\n const enabled = options.enabled()\n // Capture before any reporting callback can replace the host snapshot.\n const candidate = untrack(() => options.initialPosition?.())\n const initial =\n candidate && Number.isFinite(candidate.top) && candidate.top >= 0 ? candidate : undefined\n let scheduledRestore: typeof pendingRestore\n let observer: ResizeObserver | undefined\n let contentObserver: MutationObserver | undefined\n onCleanup(() => {\n if (scheduledRestore) {\n cancelAnimationFrame(scheduledRestore.frame)\n if (pendingRestore === scheduledRestore) pendingRestore = undefined\n }\n pendingRestoreUserIntent = false\n observer?.disconnect()\n contentObserver?.disconnect()\n })\n stick = true\n // A new transcript (or re-enable) reports its first position even when it\n // equals the last one the previous transcript reported.\n reportedTop = Number.NaN\n holdGeneration += 1\n holds = 0\n holdFollowing = false\n holdIntent = false\n lastWriteTop = -1\n lastWriteClientHeight = -1\n readerMovedSinceWrite = false\n previousTop = -1\n lastScrollClientHeight = 0\n setAtBottom(true)\n if (!enabled || !scroller) return\n // Snapshot updates must not become another positioning owner. Consume the\n // host's snapshot only at entry/reset, then native reader intent owns follow.\n if (initial) {\n stick = enabled && initial.following\n }\n\n const observe = () => {\n if (!enabled || typeof ResizeObserver === 'undefined') return\n observer = new ResizeObserver(pinAuto)\n observer.observe(scroller!)\n if (content) {\n observer.observe(content)\n if (typeof MutationObserver !== 'undefined') {\n contentObserver = new MutationObserver(() => {\n // A collapsed turn can clamp the offset before any scroll/resize\n // callback. Remember that bottom at the mutation boundary, before\n // a later task grows the viewport or streams more content. This is\n // bookkeeping only: never pin, re-arm, or compete with another owner.\n if (\n !scroller ||\n !options.enabled() ||\n pendingRestore ||\n holds > 0 ||\n !stick ||\n readerMovedSinceWrite ||\n lastWriteTop < 0\n )\n return\n // Read the offset once per mutation batch. This can flush pending\n // layout, but deferring it loses a collapse clamp before a later task\n // grows the viewport/output. Ordinary growth needs no other geometry.\n if (scroller.scrollTop >= lastWriteTop - SELF_SCROLL_EPSILON) return\n const geom = geometry(scroller)\n if (isAtEnd(geom)) return rememberPosition(scroller)\n // Rows that size themselves late can shrink the content, and a layout read\n // anywhere clamps the offset at once, while the scroll event and resize\n // callback that report it wait for the next frame. A turn appended before\n // that frame (WebKit paints late under load) leaves the offset at the end the\n // content had without the new turn, which those callbacks would then measure\n // against the grown content and take for the reader scrolling up. An offset\n // exactly at that earlier end is the clamp; a reveal lands anywhere else.\n const grown = appendedHeight()\n if (grown > 0 && isAtEnd({ ...geom, scrollHeight: geom.scrollHeight - grown }))\n rememberPosition(scroller)\n })\n contentObserver.observe(content, { childList: true, characterData: true, subtree: true })\n }\n }\n }\n\n if (initial && !stick) {\n // The identity effect can run before Solid has inserted the new rows. A\n // synchronous write is clamped by the outgoing short transcript, so defer\n // restoration until the browser has committed the new content and layout.\n const restore = {\n frame: 0,\n fromTop: scroller.scrollTop,\n target: initial.top,\n }\n scheduledRestore = restore\n pendingRestore = restore\n pendingRestoreUserIntent = false\n // Keep resize observation alive during the pending frame. Its callback is\n // guarded above, and remains active if user input cancels restoration.\n observe()\n restore.frame = requestAnimationFrame(() => {\n if (pendingRestore !== restore || !scroller) return\n pendingRestore = undefined\n pendingRestoreUserIntent = false\n writePin(scroller, restore.target)\n setAtBottom(computeAtBottom(geometry(scroller), options.threshold()))\n reportPosition()\n })\n return\n }\n\n if (!initial && enabled) writePin(scroller, bottomTarget(geometry(scroller)))\n else if (initial && stick) writePin(scroller, bottomTarget(geometry(scroller)))\n // Untracked: a new threshold changes what counts as the bottom from now on,\n // it is not a reason to reset following and pin the reader to the end.\n setAtBottom(computeAtBottom(geometry(scroller), untrack(options.threshold)))\n reportPosition()\n observe()\n })\n\n return {\n atBottom,\n onScroll,\n jump,\n hold,\n bindScroller: (element: HTMLDivElement) => {\n unbindScroller?.()\n scroller = element\n for (const type of READER_INPUT_EVENTS)\n element.addEventListener(type, noteReaderInput, { passive: true })\n unbindScroller = () => {\n for (const type of READER_INPUT_EVENTS) element.removeEventListener(type, noteReaderInput)\n }\n },\n bindContent: (element: HTMLDivElement) => {\n content = element\n },\n }\n}\n"],"mappings":";;;;;AAyCA,SAAgB,mBAAmB,SAMhC;CACD,MAAM,CAAC,UAAU,eAAe,aAAa,IAAI;CACjD,IAAI;CACJ,IAAI;CACJ,IAAI,QAAQ;CACZ,IAAI,eAAe;CACnB,IAAI,wBAAwB;CAC5B,IAAI,wBAAwB;CAC5B,IAAI,cAAc;CAClB,IAAI,yBAAyB;CAG7B,IAAI,SAAyB;CAC7B,IAAI;CACJ,IAAI,2BAA2B;CAG/B,IAAI,QAAQ;CACZ,IAAI,gBAAgB;CACpB,IAAI,aAAa;CACjB,IAAI,UAAU;CAGd,IAAI,iBAAiB;CACrB,MAAM,gBAAgB,QAAQ,KAAK,iBAAiB,CAAC;CAIrD,MAAM,iBAAiB,YAA4B;EACjD,IAAI,CAAC,QAAQ,GAAG,OAAO;EACvB,MAAM,MAAM,aAAaA,eAAS,OAAO,CAAC;EAC1C,IAAI,KAAK,IAAI,QAAQ,YAAY,KAAK,IAAI,SAAS,GAAG,CAAC,KAAA,GAA0B,OAAO;EACxF,aAAa;EACb,OAAO;CACT;CAIA,IAAI,cAAc;CAClB,IAAI;CACJ,MAAM,uBAAuB;EAC3B,IAAI,CAAC,UAAU;EACf,MAAM,MAAM,SA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A;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"thread-panel.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/thread-panel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMnD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IACvD,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,iFAAiF;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,eAyElD;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,eA8BxD"}
|
|
@@ -6,11 +6,11 @@ import { X } from "lucide-solid";
|
|
|
6
6
|
import { Show, splitProps } from "solid-js";
|
|
7
7
|
// src/components/conversation/thread-panel.tsx
|
|
8
8
|
var _tmpl$ = /*#__PURE__*/ template(`<span class="text-muted-foreground text-2xs"> `);
|
|
9
|
-
var _tmpl$2 = /*#__PURE__*/ template(`<
|
|
10
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<div class="shrink-0 border-
|
|
11
|
-
var _tmpl$4 = /*#__PURE__*/ template(`<
|
|
12
|
-
var _tmpl$5 = /*#__PURE__*/ template(`<span class="
|
|
13
|
-
var _tmpl$6 = /*#__PURE__*/ template(`<
|
|
9
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<aside data-slot=thread-panel><header class="flex h-topbar shrink-0 items-center gap-2 border-b border-border px-3"><div class="flex min-w-0 flex-col"><span class="truncate text-sm font-semibold tracking-tight">Thread</span></div><div class="ms-auto flex shrink-0 items-center gap-1"></div></header><div class="min-h-0 flex-1 overflow-y-auto overscroll-contain px-2 py-2"role=region aria-label="Thread replies"tabindex=0>`);
|
|
10
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<div class="bg-muted/40 shrink-0 border-b border-border px-3 py-2">`);
|
|
11
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<div class="shrink-0 border-t border-border p-2">`);
|
|
12
|
+
var _tmpl$5 = /*#__PURE__*/ template(`<button type=button><span class="flex min-w-0 flex-col"><span class="truncate text-xs font-medium">`);
|
|
13
|
+
var _tmpl$6 = /*#__PURE__*/ template(`<span class="text-muted-foreground truncate text-2xs">`);
|
|
14
14
|
function ThreadPanel(props) {
|
|
15
15
|
const [local, rest] = splitProps(props, [
|
|
16
16
|
"class",
|
|
@@ -23,9 +23,9 @@ function ThreadPanel(props) {
|
|
|
23
23
|
"children"
|
|
24
24
|
]);
|
|
25
25
|
return (() => {
|
|
26
|
-
var _el$ = _tmpl$
|
|
26
|
+
var _el$ = _tmpl$2(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild;
|
|
27
27
|
_el$3.firstChild;
|
|
28
|
-
var _el$7 = _el$3.nextSibling, _el$
|
|
28
|
+
var _el$7 = _el$3.nextSibling, _el$8 = _el$2.nextSibling;
|
|
29
29
|
spread(_el$, mergeProps({
|
|
30
30
|
get ["aria-label"]() {
|
|
31
31
|
return `Thread: ${local.label}`;
|
|
@@ -69,22 +69,22 @@ function ThreadPanel(props) {
|
|
|
69
69
|
get when() {
|
|
70
70
|
return local.root;
|
|
71
71
|
},
|
|
72
|
-
|
|
73
|
-
var _el$
|
|
74
|
-
insert(_el$
|
|
75
|
-
return _el$
|
|
76
|
-
}
|
|
77
|
-
}), _el$
|
|
78
|
-
insert(_el$
|
|
72
|
+
children: (rootSlot) => (() => {
|
|
73
|
+
var _el$9 = _tmpl$3();
|
|
74
|
+
insert(_el$9, rootSlot);
|
|
75
|
+
return _el$9;
|
|
76
|
+
})()
|
|
77
|
+
}), _el$8);
|
|
78
|
+
insert(_el$8, () => local.children);
|
|
79
79
|
insert(_el$, createComponent(Show, {
|
|
80
80
|
get when() {
|
|
81
81
|
return local.composer;
|
|
82
82
|
},
|
|
83
|
-
|
|
84
|
-
var _el$0 = _tmpl$
|
|
85
|
-
insert(_el$0,
|
|
83
|
+
children: (composerSlot) => (() => {
|
|
84
|
+
var _el$0 = _tmpl$4();
|
|
85
|
+
insert(_el$0, composerSlot);
|
|
86
86
|
return _el$0;
|
|
87
|
-
}
|
|
87
|
+
})()
|
|
88
88
|
}), null);
|
|
89
89
|
return _el$;
|
|
90
90
|
})();
|
|
@@ -98,7 +98,7 @@ function AttachmentCard(props) {
|
|
|
98
98
|
"icon"
|
|
99
99
|
]);
|
|
100
100
|
return (() => {
|
|
101
|
-
var _el$1 = _tmpl$
|
|
101
|
+
var _el$1 = _tmpl$5(), _el$10 = _el$1.firstChild, _el$11 = _el$10.firstChild;
|
|
102
102
|
spread(_el$1, mergeProps({
|
|
103
103
|
get disabled() {
|
|
104
104
|
return local.unavailable;
|
|
@@ -113,11 +113,11 @@ function AttachmentCard(props) {
|
|
|
113
113
|
get when() {
|
|
114
114
|
return local.detail;
|
|
115
115
|
},
|
|
116
|
-
|
|
117
|
-
var _el$12 = _tmpl$
|
|
118
|
-
insert(_el$12,
|
|
116
|
+
children: (detailSlot) => (() => {
|
|
117
|
+
var _el$12 = _tmpl$6();
|
|
118
|
+
insert(_el$12, detailSlot);
|
|
119
119
|
return _el$12;
|
|
120
|
-
}
|
|
120
|
+
})()
|
|
121
121
|
}), null);
|
|
122
122
|
return _el$1;
|
|
123
123
|
})();
|