@k2b/ui 0.2.0 → 0.4.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/dist/browser/actions/Button.js +11 -2
- package/dist/browser/actions/Button.js.map +1 -1
- package/dist/browser/actions/Disclosure.js +11 -8
- package/dist/browser/actions/Disclosure.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +4 -1
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/FilterChip.js +16 -2
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/actions/SplitButton.js +69 -22
- package/dist/browser/actions/SplitButton.js.map +1 -1
- package/dist/browser/actions/SpotlightSearch.js +3 -7
- package/dist/browser/actions/SpotlightSearch.js.map +1 -1
- package/dist/browser/actions/Tabs.js +132 -47
- package/dist/browser/actions/Tabs.js.map +1 -1
- package/dist/browser/actions/index.js +2 -2
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +751 -423
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatContextPopup.js +123 -0
- package/dist/browser/chat/ChatContextPopup.js.map +1 -0
- package/dist/browser/chat/ChatPrimitives.js +141 -78
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/chat/ChatTasks.js +112 -0
- package/dist/browser/chat/ChatTasks.js.map +1 -0
- package/dist/browser/chat/ChatTimeline.js +31 -14
- package/dist/browser/chat/ChatTimeline.js.map +1 -1
- package/dist/browser/chat/chat-behavior.js +0 -5
- package/dist/browser/chat/chat-behavior.js.map +1 -1
- package/dist/browser/chat/composer-document.js +55 -0
- package/dist/browser/chat/composer-document.js.map +1 -0
- package/dist/browser/chat/index.js +6 -1
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/chat/types.js.map +1 -1
- package/dist/browser/content/Chart.js +148 -239
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/ChartExplorer.js +324 -0
- package/dist/browser/content/ChartExplorer.js.map +1 -0
- package/dist/browser/content/ChartExplorerControls.js +153 -0
- package/dist/browser/content/ChartExplorerControls.js.map +1 -0
- package/dist/browser/content/ChartFilterControls.js +200 -0
- package/dist/browser/content/ChartFilterControls.js.map +1 -0
- package/dist/browser/content/ChartSnapshotView.js +114 -0
- package/dist/browser/content/ChartSnapshotView.js.map +1 -0
- package/dist/browser/content/DataTable.js +48 -32
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/FileBrowser.js +3 -0
- package/dist/browser/content/FileBrowser.js.map +1 -1
- package/dist/browser/content/FileGrid.js +93 -0
- package/dist/browser/content/FileGrid.js.map +1 -0
- package/dist/browser/content/FileTree.js +2 -2
- package/dist/browser/content/FileTree.js.map +1 -1
- package/dist/browser/content/FileView.js +511 -162
- package/dist/browser/content/FileView.js.map +1 -1
- package/dist/browser/content/MarkdownView.js +6 -0
- package/dist/browser/content/MarkdownView.js.map +1 -1
- package/dist/browser/content/Pagination.js.map +1 -1
- package/dist/browser/content/PdfPreview.js +107 -90
- package/dist/browser/content/PdfPreview.js.map +1 -1
- package/dist/browser/content/chart-cursor.js +33 -0
- package/dist/browser/content/chart-cursor.js.map +1 -0
- package/dist/browser/content/chart-explorer.js +147 -0
- package/dist/browser/content/chart-explorer.js.map +1 -0
- package/dist/browser/content/chart-inspection.js +447 -0
- package/dist/browser/content/chart-inspection.js.map +1 -0
- package/dist/browser/content/chart-line-gaps.js +53 -0
- package/dist/browser/content/chart-line-gaps.js.map +1 -0
- package/dist/browser/content/chart-map-viewport.js +5 -1
- package/dist/browser/content/chart-map-viewport.js.map +1 -1
- package/dist/browser/content/chart-snapshot.js +63 -0
- package/dist/browser/content/chart-snapshot.js.map +1 -0
- package/dist/browser/content/chart-state-timeline.js +32 -4
- package/dist/browser/content/chart-state-timeline.js.map +1 -1
- package/dist/browser/content/chart-svg.js +54 -0
- package/dist/browser/content/chart-svg.js.map +1 -0
- package/dist/browser/content/collection-selection.js +109 -0
- package/dist/browser/content/collection-selection.js.map +1 -0
- package/dist/browser/content/delimited-preferences.js +21 -0
- package/dist/browser/content/delimited-preferences.js.map +1 -0
- package/dist/browser/content/file-tree.js.map +1 -1
- package/dist/browser/content/file-view-preview.js +11 -7
- package/dist/browser/content/file-view-preview.js.map +1 -1
- package/dist/browser/content/index.js +9 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/InlineGuidance.js +17 -3
- package/dist/browser/feedback/InlineGuidance.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +81 -7
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/prompts.js +6 -0
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/feedback/toast.js +29 -6
- package/dist/browser/feedback/toast.js.map +1 -1
- package/dist/browser/inputs/ChoiceGroups.js.map +1 -1
- package/dist/browser/inputs/Select.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +3 -2
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +7 -1
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/markdown/MarkdownEditor.js +61 -37
- package/dist/browser/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/browser/inputs/markdown/behaviors.js +1 -1
- package/dist/browser/inputs/markdown/behaviors.js.map +1 -1
- package/dist/browser/intl/Format.js +89 -16
- package/dist/browser/intl/Format.js.map +1 -1
- package/dist/browser/intl/index.js.map +1 -1
- package/dist/browser/intl/messages.js +130 -2
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +712 -624
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/BottomSheet.js +95 -0
- package/dist/browser/layout/BottomSheet.js.map +1 -0
- package/dist/browser/layout/DetailPanel.js +56 -44
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/Navigation.js +278 -0
- package/dist/browser/layout/Navigation.js.map +1 -0
- package/dist/browser/layout/PanelDialog.js +219 -71
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/ScrollArea.js +21 -1
- package/dist/browser/layout/ScrollArea.js.map +1 -1
- package/dist/browser/layout/Settings.js.map +1 -1
- package/dist/browser/layout/SidebarItemPreview.js +183 -0
- package/dist/browser/layout/SidebarItemPreview.js.map +1 -0
- package/dist/browser/layout/app-workspace-controller.js +3 -0
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/app-workspace-state.js.map +1 -1
- package/dist/browser/layout/index.js +3 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/navigation-model.js +23 -0
- package/dist/browser/layout/navigation-model.js.map +1 -0
- package/dist/browser/layout/scroll-fade.js +100 -0
- package/dist/browser/layout/scroll-fade.js.map +1 -0
- package/dist/browser/surfaces/DescriptionList.js.map +1 -1
- package/dist/browser/surfaces/StatusBadge.js +2 -1
- package/dist/browser/surfaces/StatusBadge.js.map +1 -1
- package/dist/fonts/ibm-plex-mono-cyrillic-400-italic-4aded3f2f2a7d27d.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-cyrillic-400-normal-7635422bd10ddbbc.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-cyrillic-500-normal-1d89462e86cb8e87.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-cyrillic-600-normal-2b05a8695c7f9f4a.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-cyrillic-ext-400-italic-a0b3b8cbe5a516e7.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-cyrillic-ext-400-normal-f8c22ec1804bd696.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-cyrillic-ext-500-normal-3febe5c7f22e4b07.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-cyrillic-ext-600-normal-83109cdd4f8665b4.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400-italic-0840095faae86403.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-400-normal-08949f728dc52d52.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-500-normal-01d285447409c8a5.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-600-normal-0d1f0b8d0722224e.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-italic-1b07eee6df7d26b3.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-400-normal-6bc0f226a5b7884a.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-500-normal-6bb06407c97584b0.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-latin-ext-600-normal-32057cf50dd14bdb.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-vietnamese-400-italic-a6bab38af4f9c761.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-vietnamese-400-normal-62632b6375305e70.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-vietnamese-500-normal-781633d95de88040.woff2 +0 -0
- package/dist/fonts/ibm-plex-mono-vietnamese-600-normal-51b74d53e106ba8a.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-400-italic-e8731a7e2b00fc4f.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-400-normal-69afad88a0740b6e.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-500-normal-200be3a2a6b1789f.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-600-normal-730becc6f005c18c.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-700-normal-40540598b4c9eb2c.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-ext-400-italic-4ffb25726a7ce4cc.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-ext-400-normal-e2580ad78906551e.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-ext-500-normal-08578d906af6d986.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-ext-600-normal-d60d3d0b182753d5.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-cyrillic-ext-700-normal-d07dd53642480097.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-greek-400-italic-1bc10b01688ba9fa.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-greek-400-normal-02296067bc904d2a.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-greek-500-normal-8cb6e20b4dbbaa5f.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-greek-600-normal-0a9ebd9019415ee9.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-greek-700-normal-c949641d10a3bebc.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-400-italic-6de912e531b6c980.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-400-normal-3b646991d30055a9.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-500-normal-0717336fb31fcdcd.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-600-normal-8960851d691c054e.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-700-normal-42e7b0c143c19df9.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-400-italic-c5c00e8a32022dfe.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-400-normal-c93d2a12aaa280f6.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-500-normal-2846035d85100f84.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-600-normal-b25dfd4f979e442a.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext-700-normal-92f0392bd74fa395.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-vietnamese-400-italic-675d4bace127bffb.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-vietnamese-400-normal-771538f7f26551bd.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-vietnamese-500-normal-85ba3d9c2488a813.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-vietnamese-600-normal-5d34b803637befe3.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-vietnamese-700-normal-b79d0c4b68b85007.woff2 +0 -0
- package/dist/plex.css +1 -1
- package/dist/ssr/actions/Button.js +11 -2
- package/dist/ssr/actions/Button.js.map +1 -1
- package/dist/ssr/actions/Disclosure.js +2 -2
- package/dist/ssr/actions/Disclosure.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +4 -1
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +16 -2
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/actions/SplitButton.js +69 -22
- package/dist/ssr/actions/SplitButton.js.map +1 -1
- package/dist/ssr/actions/SpotlightSearch.js +3 -7
- package/dist/ssr/actions/SpotlightSearch.js.map +1 -1
- package/dist/ssr/actions/Tabs.js +58 -11
- package/dist/ssr/actions/Tabs.js.map +1 -1
- package/dist/ssr/actions/index.js +2 -2
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +366 -134
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatContextPopup.js +86 -0
- package/dist/ssr/chat/ChatContextPopup.js.map +1 -0
- package/dist/ssr/chat/ChatPrimitives.js +49 -11
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/chat/ChatTasks.js +48 -0
- package/dist/ssr/chat/ChatTasks.js.map +1 -0
- package/dist/ssr/chat/ChatTimeline.js +14 -4
- package/dist/ssr/chat/ChatTimeline.js.map +1 -1
- package/dist/ssr/chat/chat-behavior.js +0 -5
- package/dist/ssr/chat/chat-behavior.js.map +1 -1
- package/dist/ssr/chat/composer-document.js +55 -0
- package/dist/ssr/chat/composer-document.js.map +1 -0
- package/dist/ssr/chat/index.js +6 -1
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/chat/types.js.map +1 -1
- package/dist/ssr/content/Chart.js +121 -219
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/ChartExplorer.js +257 -0
- package/dist/ssr/content/ChartExplorer.js.map +1 -0
- package/dist/ssr/content/ChartExplorerControls.js +105 -0
- package/dist/ssr/content/ChartExplorerControls.js.map +1 -0
- package/dist/ssr/content/ChartFilterControls.js +139 -0
- package/dist/ssr/content/ChartFilterControls.js.map +1 -0
- package/dist/ssr/content/ChartSnapshotView.js +58 -0
- package/dist/ssr/content/ChartSnapshotView.js.map +1 -0
- package/dist/ssr/content/DataTable.js +13 -9
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/FileBrowser.js +3 -0
- package/dist/ssr/content/FileBrowser.js.map +1 -1
- package/dist/ssr/content/FileGrid.js +38 -0
- package/dist/ssr/content/FileGrid.js.map +1 -0
- package/dist/ssr/content/FileTree.js +2 -2
- package/dist/ssr/content/FileTree.js.map +1 -1
- package/dist/ssr/content/FileView.js +356 -75
- package/dist/ssr/content/FileView.js.map +1 -1
- package/dist/ssr/content/MarkdownView.js +6 -0
- package/dist/ssr/content/MarkdownView.js.map +1 -1
- package/dist/ssr/content/Pagination.js.map +1 -1
- package/dist/ssr/content/PdfPreview.js +37 -24
- package/dist/ssr/content/PdfPreview.js.map +1 -1
- package/dist/ssr/content/chart-cursor.js +33 -0
- package/dist/ssr/content/chart-cursor.js.map +1 -0
- package/dist/ssr/content/chart-explorer.js +147 -0
- package/dist/ssr/content/chart-explorer.js.map +1 -0
- package/dist/ssr/content/chart-inspection.js +447 -0
- package/dist/ssr/content/chart-inspection.js.map +1 -0
- package/dist/ssr/content/chart-line-gaps.js +53 -0
- package/dist/ssr/content/chart-line-gaps.js.map +1 -0
- package/dist/ssr/content/chart-map-viewport.js +5 -1
- package/dist/ssr/content/chart-map-viewport.js.map +1 -1
- package/dist/ssr/content/chart-snapshot.js +63 -0
- package/dist/ssr/content/chart-snapshot.js.map +1 -0
- package/dist/ssr/content/chart-state-timeline.js +32 -4
- package/dist/ssr/content/chart-state-timeline.js.map +1 -1
- package/dist/ssr/content/chart-svg.js +54 -0
- package/dist/ssr/content/chart-svg.js.map +1 -0
- package/dist/ssr/content/collection-selection.js +109 -0
- package/dist/ssr/content/collection-selection.js.map +1 -0
- package/dist/ssr/content/delimited-preferences.js +21 -0
- package/dist/ssr/content/delimited-preferences.js.map +1 -0
- package/dist/ssr/content/file-tree.js.map +1 -1
- package/dist/ssr/content/file-view-preview.js +11 -7
- package/dist/ssr/content/file-view-preview.js.map +1 -1
- package/dist/ssr/content/index.js +9 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/InlineGuidance.js +17 -3
- package/dist/ssr/feedback/InlineGuidance.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +81 -7
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +6 -0
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/feedback/toast.js +29 -6
- package/dist/ssr/feedback/toast.js.map +1 -1
- package/dist/ssr/inputs/ChoiceGroups.js.map +1 -1
- package/dist/ssr/inputs/Select.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +3 -3
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/markdown/MarkdownEditor.js +19 -11
- package/dist/ssr/inputs/markdown/MarkdownEditor.js.map +1 -1
- package/dist/ssr/inputs/markdown/behaviors.js +1 -1
- package/dist/ssr/inputs/markdown/behaviors.js.map +1 -1
- package/dist/ssr/intl/Format.js +61 -0
- package/dist/ssr/intl/Format.js.map +1 -1
- package/dist/ssr/intl/index.js.map +1 -1
- package/dist/ssr/intl/messages.js +130 -2
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +368 -275
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/BottomSheet.js +43 -0
- package/dist/ssr/layout/BottomSheet.js.map +1 -0
- package/dist/ssr/layout/DetailPanel.js +11 -4
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/Navigation.js +181 -0
- package/dist/ssr/layout/Navigation.js.map +1 -0
- package/dist/ssr/layout/PanelDialog.js +111 -26
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/ScrollArea.js +16 -1
- package/dist/ssr/layout/ScrollArea.js.map +1 -1
- package/dist/ssr/layout/Settings.js.map +1 -1
- package/dist/ssr/layout/SidebarItemPreview.js +133 -0
- package/dist/ssr/layout/SidebarItemPreview.js.map +1 -0
- package/dist/ssr/layout/app-workspace-controller.js +3 -0
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/app-workspace-state.js.map +1 -1
- package/dist/ssr/layout/index.js +3 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/navigation-model.js +23 -0
- package/dist/ssr/layout/navigation-model.js.map +1 -0
- package/dist/ssr/layout/scroll-fade.js +100 -0
- package/dist/ssr/layout/scroll-fade.js.map +1 -0
- package/dist/ssr/surfaces/DescriptionList.js.map +1 -1
- package/dist/ssr/surfaces/StatusBadge.js +2 -1
- package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tabler.css +1 -1
- package/dist/types/actions/Button.d.ts +4 -0
- package/dist/types/actions/Disclosure.d.ts +1 -0
- package/dist/types/actions/FilterChip.d.ts +4 -0
- package/dist/types/actions/SplitButton.d.ts +6 -0
- package/dist/types/actions/SpotlightSearch.d.ts +0 -4
- package/dist/types/actions/Tabs.d.ts +4 -0
- package/dist/types/actions/index.d.ts +4 -4
- package/dist/types/chat/ChatComposer.d.ts +20 -2
- package/dist/types/chat/ChatContextPopup.d.ts +6 -0
- package/dist/types/chat/ChatPrimitives.d.ts +4 -0
- package/dist/types/chat/ChatTasks.d.ts +15 -0
- package/dist/types/chat/ChatTimeline.d.ts +2 -0
- package/dist/types/chat/chat-behavior.d.ts +0 -3
- package/dist/types/chat/composer-document.d.ts +14 -0
- package/dist/types/chat/index.d.ts +8 -1
- package/dist/types/chat/types.d.ts +7 -0
- package/dist/types/content/Chart.d.ts +42 -23
- package/dist/types/content/ChartExplorer.d.ts +34 -0
- package/dist/types/content/ChartExplorerControls.d.ts +10 -0
- package/dist/types/content/ChartFilterControls.d.ts +21 -0
- package/dist/types/content/ChartSnapshotView.d.ts +11 -0
- package/dist/types/content/DataTable.d.ts +4 -0
- package/dist/types/content/FileBrowser.d.ts +1 -0
- package/dist/types/content/FileGrid.d.ts +21 -0
- package/dist/types/content/FileView.d.ts +20 -0
- package/dist/types/content/PdfPreview.d.ts +8 -1
- package/dist/types/content/chart-cursor.d.ts +15 -0
- package/dist/types/content/chart-explorer.d.ts +48 -0
- package/dist/types/content/chart-inspection.d.ts +40 -0
- package/dist/types/content/chart-line-gaps.d.ts +5 -0
- package/dist/types/content/chart-map-viewport.d.ts +1 -1
- package/dist/types/content/chart-snapshot.d.ts +26 -0
- package/dist/types/content/chart-svg.d.ts +21 -0
- package/dist/types/content/collection-selection.d.ts +24 -0
- package/dist/types/content/delimited-preferences.d.ts +11 -0
- package/dist/types/content/file-tree.d.ts +2 -0
- package/dist/types/content/file-view-preview.d.ts +4 -1
- package/dist/types/content/index.d.ts +16 -2
- package/dist/types/feedback/InlineGuidance.d.ts +1 -0
- package/dist/types/feedback/dialog-core.d.ts +11 -0
- package/dist/types/feedback/prompts.d.ts +2 -0
- package/dist/types/feedback/toast.d.ts +7 -1
- package/dist/types/inputs/markdown/MarkdownEditor.d.ts +5 -1
- package/dist/types/intl/Format.d.ts +9 -0
- package/dist/types/intl/index.d.ts +1 -1
- package/dist/types/intl/messages.d.ts +31 -1
- package/dist/types/layout/AppWorkspace.d.ts +35 -18
- package/dist/types/layout/BottomSheet.d.ts +23 -0
- package/dist/types/layout/DetailPanel.d.ts +1 -0
- package/dist/types/layout/Navigation.d.ts +8 -0
- package/dist/types/layout/PanelDialog.d.ts +14 -1
- package/dist/types/layout/ScrollArea.d.ts +4 -0
- package/dist/types/layout/Settings.d.ts +1 -1
- package/dist/types/layout/SidebarItemPreview.d.ts +11 -0
- package/dist/types/layout/index.d.ts +4 -1
- package/dist/types/layout/navigation-model.d.ts +48 -0
- package/dist/types/layout/scroll-fade.d.ts +3 -0
- package/dist/types/surfaces/DescriptionList.d.ts +1 -1
- package/dist/types/surfaces/StatusBadge.d.ts +1 -1
- package/package.json +5 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["chat/types.ts"],"sourcesContent":["export type ChatRole = \"user\" | \"assistant\" | \"system\" | \"tool\";\n\nexport type ChatMessageStatus = \"pending\" | \"streaming\" | \"complete\" | \"error\";\n\nexport type ChatActivityTone = \"neutral\" | \"ai\" | \"success\" | \"danger\";\n\ntype ChatActionBase = {\n id: string;\n label: string;\n icon?: string;\n variant?: \"danger\";\n disabled?: boolean;\n /** Toggle state for persistent message actions such as feedback. */\n pressed?: boolean;\n /** Semantic foreground for selected feedback actions, without a persistent background. */\n pressedTone?: \"success\" | \"danger\";\n};\n\n/** Exactly one executable behavior for every chat action. */\nexport type ChatAction = ChatActionBase &\n ({ onSelect: () => void | Promise<void>; copyText?: never } | { copyText: string; onSelect?: never });\n\nexport type ChatAttachment = {\n id: string;\n name: string;\n size?: number;\n kind?: \"file\" | \"image\" | \"resource\";\n icon?: string;\n previewUrl?: string;\n alt?: string;\n /** Optional destination represented by this attachment. */\n href?: string;\n /** Opaque application-owned payload returned unchanged with ChatSubmitInput. */\n data?: unknown;\n /** Optional application-owned action presented below the attachment label. */\n action?: ChatAction;\n};\n\nexport type ChatUsage = {\n input?: number;\n output?: number;\n total?: number;\n};\n\nexport type ChatContextUsageData = {\n usage?: ChatUsage | null;\n loopUsage?: ChatUsage | null;\n contextWindow?: number;\n modelLabel?: string;\n};\n\nexport type ChatModelOption = {\n id: string;\n label: string;\n description?: string;\n image?: string;\n icon?: string;\n capabilities?: readonly string[];\n};\n\nexport type ChatComposerState = \"idle\" | \"submitting\" | \"running\" | \"stopping\";\n\nexport type ChatSubmitIntent = \"send\" | \"steer\" | \"queue\";\n\nexport type ChatSubmitInput = {\n intent: ChatSubmitIntent;\n text: string;\n attachments: readonly ChatAttachment[];\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["chat/types.ts"],"sourcesContent":["export type ChatRole = \"user\" | \"assistant\" | \"system\" | \"tool\";\n\nexport type ChatMessageStatus = \"pending\" | \"streaming\" | \"complete\" | \"error\";\n\nexport type ChatActivityTone = \"neutral\" | \"ai\" | \"success\" | \"danger\";\n\ntype ChatActionBase = {\n id: string;\n label: string;\n icon?: string;\n variant?: \"danger\";\n disabled?: boolean;\n /** Toggle state for persistent message actions such as feedback. */\n pressed?: boolean;\n /** Semantic foreground for selected feedback actions, without a persistent background. */\n pressedTone?: \"success\" | \"danger\";\n};\n\n/** Exactly one executable behavior for every chat action. */\nexport type ChatAction = ChatActionBase &\n ({ onSelect: () => void | Promise<void>; copyText?: never } | { copyText: string; onSelect?: never });\n\nexport type ChatAttachment = {\n id: string;\n name: string;\n size?: number;\n kind?: \"file\" | \"image\" | \"resource\";\n icon?: string;\n previewUrl?: string;\n alt?: string;\n /** Optional destination represented by this attachment. */\n href?: string;\n /** Opaque application-owned payload returned unchanged with ChatSubmitInput. */\n data?: unknown;\n /** Optional application-owned action presented below the attachment label. */\n action?: ChatAction;\n};\n\nexport type ChatUsage = {\n input?: number;\n output?: number;\n total?: number;\n};\n\nexport type ChatContextUsageData = {\n usage?: ChatUsage | null;\n loopUsage?: ChatUsage | null;\n contextWindow?: number;\n modelLabel?: string;\n};\n\nexport type ChatModelOption = {\n id: string;\n label: string;\n description?: string;\n image?: string;\n icon?: string;\n capabilities?: readonly string[];\n};\n\nexport type ChatComposerState = \"idle\" | \"submitting\" | \"running\" | \"stopping\";\n\nexport type ChatSubmitIntent = \"send\" | \"steer\" | \"queue\";\n\nexport type ChatSubmitInput = {\n intent: ChatSubmitIntent;\n text: string;\n attachments: readonly ChatAttachment[];\n mentions?: readonly ChatMention[];\n};\n\n/** Ranges use UTF-16 offsets into the untrimmed composer text. Payloads stay application-owned. */\nexport type ChatMention = { start: number; end: number; attachment: ChatAttachment };\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { createComponent as _$createComponent } from "solid-js/web";
|
|
2
2
|
import { ssr as _$ssr } from "solid-js/web";
|
|
3
|
+
import { ssrStyleProperty as _$ssrStyleProperty } from "solid-js/web";
|
|
3
4
|
import { ssrStyle as _$ssrStyle } from "solid-js/web";
|
|
4
5
|
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
5
6
|
import { escape as _$escape } from "solid-js/web";
|
|
6
7
|
var _tmpl$ = "<span class=\"k2b-chart__anchor\" aria-hidden=\"true\"></span>",
|
|
7
|
-
_tmpl$2 = ["<span", " role=\"tooltip\" popover=\"manual\" class=\"k2b-tooltip\"></span>"],
|
|
8
|
+
_tmpl$2 = ["<span", " role=\"tooltip\" popover=\"manual\" data-instant=\"true\" class=\"k2b-tooltip k2b-chart__tooltip\"></span>"],
|
|
8
9
|
_tmpl$3 = ["<div class=\"k2b-chart__controls\"><button type=\"button\" class=\"k2b-button k2b-icon-button\" data-variant=\"secondary\"", " title=\"", "\"><i class=\"ti ti-plus\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"k2b-button k2b-icon-button\" data-variant=\"secondary\"", " title=\"", "\"><i class=\"ti ti-minus\" aria-hidden=\"true\"></i></button><button type=\"button\" class=\"k2b-button k2b-icon-button\" data-variant=\"secondary\"", " title=\"", "\"><i class=\"ti ti-focus-centered\" aria-hidden=\"true\"></i></button></div>"],
|
|
9
|
-
_tmpl$4 = ["<div class=\"", "\"", " style=\"", "\" role=\"group\"", "><div class=\"k2b-chart__svg\">", "</div>", "", "</div>"],
|
|
10
|
+
_tmpl$4 = ["<div class=\"", "\"", " style=\"", "\" role=\"group\"", "><div class=\"k2b-chart__svg\"", " style=\"", "\">", "</div>", "", "</div>"],
|
|
10
11
|
_tmpl$5 = ["<div class=\"", "\" style=\"", "\">", "</div>"];
|
|
11
12
|
import { charts } from "@k2b/stdlib";
|
|
12
|
-
import { createEffect, createMemo, createSignal, createUniqueId, onCleanup, onMount, Show } from "solid-js";
|
|
13
|
-
import {
|
|
13
|
+
import { createEffect, createMemo, createSignal, createUniqueId, onCleanup, onMount, Show, splitProps, untrack } from "solid-js";
|
|
14
|
+
import { isServer } from "solid-js/web";
|
|
15
|
+
import { useLocale } from "../intl/locale";
|
|
14
16
|
import { useUiMessages } from "../intl/messages";
|
|
17
|
+
import { createChartInspection } from "./chart-inspection";
|
|
18
|
+
import { lineGapsSvg } from "./chart-line-gaps";
|
|
15
19
|
import { DEFAULT_MAP_VIEWPORT, normalizeMapViewport, panMapViewport, zoomMapViewport } from "./chart-map-viewport";
|
|
16
20
|
import { panStateTimelineViewport, renderStateTimelineSvg, stateTimelineDomain, stateTimelineHeight, zoomStateTimelineViewport } from "./chart-state-timeline";
|
|
21
|
+
import { responsiveChartSvg, responsiveMapSvg, selectedChartSvg } from "./chart-svg";
|
|
17
22
|
|
|
18
23
|
/**
|
|
19
24
|
* Chart — minimal Solid wrapper around `stdlib.charts`.
|
|
@@ -25,31 +30,20 @@ import { panStateTimelineViewport, renderStateTimelineSvg, stateTimelineDomain,
|
|
|
25
30
|
* is a full SVG re-build, not a diff — fine for dashboard cadences
|
|
26
31
|
* (poll, websocket, store updates). Don't use this for 60fps streaming.
|
|
27
32
|
*
|
|
28
|
-
* **Sizing.**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* (`style={{ height: "14rem" }}`, an app class, a flex child, …).
|
|
36
|
-
* On SSR (no observer)
|
|
37
|
-
* the chart renders at stdlib's default size; the first client-side
|
|
38
|
-
* frame re-measures and re-renders.
|
|
39
|
-
*
|
|
40
|
-
* One documented exception: `kind: "stateTimeline"` derives its own
|
|
41
|
-
* initial height from the row count and legend via
|
|
42
|
-
* `stateTimelineHeight()`, because a timeline's height is a function of
|
|
43
|
-
* how many rows it has rather than of the layout around it. Every other
|
|
44
|
-
* kind starts at 280px until the observer reports the real box. Layout
|
|
45
|
-
* code that sizes charts uniformly must account for this.
|
|
33
|
+
* **Sizing.** The server and browser render the same logical viewBox. CSS
|
|
34
|
+
* fits Cartesian plots to the container and preserves text/marker sizes;
|
|
35
|
+
* maps fit the whole world and zoom uniformly across the full plot; pies, donuts and gauges retain
|
|
36
|
+
* their aspect ratio. No measurement
|
|
37
|
+
* or hydration redraw is needed. The caller sizes the wrapper, for example
|
|
38
|
+
* `style={{ height: "14rem" }}`. State timelines derive their default height
|
|
39
|
+
* from the row count and legend via `stateTimelineHeight()`.
|
|
46
40
|
*
|
|
47
41
|
* **Why so thin.** The props are a discriminated union over each
|
|
48
42
|
* stdlib chart function — `kind: "line"` brings in exactly the params
|
|
49
43
|
* `charts.line` expects, `kind: "bar"` brings in `charts.bar`'s, etc.
|
|
50
44
|
* Options stay aligned with stdlib without renaming. Shared interactive
|
|
51
45
|
* layers add bounded pan / zoom controls to maps and state timelines, plus
|
|
52
|
-
*
|
|
46
|
+
* renderer-owned inspection, tooltips and optional selection for all chart kinds.
|
|
53
47
|
* If stdlib gains a new option, it's automatically available at every
|
|
54
48
|
* callsite.
|
|
55
49
|
*
|
|
@@ -76,45 +70,68 @@ import { panStateTimelineViewport, renderStateTimelineSvg, stateTimelineDomain,
|
|
|
76
70
|
/**
|
|
77
71
|
* Per-kind props: `kind` discriminator + the exact options that
|
|
78
72
|
* `charts.<kind>` accepts, **minus** `width` / `height` (the wrapper
|
|
79
|
-
* owns those —
|
|
73
|
+
* owns those — CSS fits a stable coordinate space to the box). Solid's
|
|
80
74
|
* component model handles discriminated unions natively, so callsites
|
|
81
75
|
* get full type safety.
|
|
82
76
|
*/
|
|
83
77
|
|
|
78
|
+
/** Pure renderer options: component layout, events and inspection are configured elsewhere. */
|
|
79
|
+
|
|
80
|
+
/** Keep the fixed 28-unit bar-gauge rows inside the shared SSR/browser coordinate space. */
|
|
81
|
+
export const chartRenderHeight = props => {
|
|
82
|
+
if (props.kind === "stateTimeline") return stateTimelineHeight(props.rows.length, props.legend !== false);
|
|
83
|
+
if (props.kind === "barGauge") return Math.max(280, (props.title || props.subtitle ? 42 : 16) + props.data.length * 28 + 14);
|
|
84
|
+
return 280;
|
|
85
|
+
};
|
|
86
|
+
|
|
84
87
|
/**
|
|
85
88
|
* Internal — strips wrapper-only keys from props and forwards the
|
|
86
|
-
* rest (plus
|
|
87
|
-
* price for dispatching one function call across
|
|
89
|
+
* rest (plus logical size) to `charts[kind]`. The `any` is the
|
|
90
|
+
* price for dispatching one function call across 14 different option
|
|
88
91
|
* types; an explicit per-kind switch would type it but balloon the
|
|
89
92
|
* component for no runtime benefit.
|
|
90
93
|
*/
|
|
91
|
-
const
|
|
94
|
+
export const renderChartSvg = (props, width, height, mapViewport, timelineViewport) => {
|
|
92
95
|
const {
|
|
93
96
|
kind,
|
|
94
97
|
class: _class,
|
|
95
98
|
style: _style,
|
|
96
99
|
labels: _labels,
|
|
97
100
|
interactive: _interactive,
|
|
101
|
+
onSelect: _onSelect,
|
|
102
|
+
selected: _selected,
|
|
103
|
+
tooltip: _tooltip,
|
|
104
|
+
cursor: _cursor,
|
|
105
|
+
zoomFocus: _zoomFocus,
|
|
98
106
|
...opts
|
|
99
107
|
} = props;
|
|
100
108
|
if (kind === "stateTimeline") {
|
|
101
|
-
return renderStateTimelineSvg({
|
|
109
|
+
return responsiveChartSvg(renderStateTimelineSvg({
|
|
102
110
|
...opts,
|
|
103
111
|
width,
|
|
104
112
|
height,
|
|
105
|
-
viewport: timelineViewport
|
|
106
|
-
|
|
113
|
+
viewport: timelineViewport,
|
|
114
|
+
interactive: props.interactive
|
|
115
|
+
}));
|
|
107
116
|
}
|
|
108
117
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
|
-
|
|
118
|
+
let svg = charts[kind]({
|
|
110
119
|
...opts,
|
|
111
|
-
...(kind === "map"
|
|
112
|
-
viewport:
|
|
120
|
+
...(kind === "map" ? {
|
|
121
|
+
viewport: DEFAULT_MAP_VIEWPORT
|
|
113
122
|
} : {}),
|
|
114
123
|
width,
|
|
115
|
-
height
|
|
124
|
+
height,
|
|
125
|
+
inspect: props.interactive === true || props.kind === "line" && props.maxGap !== undefined
|
|
116
126
|
});
|
|
127
|
+
if (props.kind === "line" && props.maxGap !== undefined) {
|
|
128
|
+
if (props.area || props.errorBand) throw new Error("Chart maxGap does not support area or errorBand fills");
|
|
129
|
+
svg = lineGapsSvg(svg, props.maxGap, props);
|
|
130
|
+
}
|
|
131
|
+
if (props.kind === "map") return responsiveMapSvg(svg, width, height, normalizeMapViewport(mapViewport ?? props.viewport));
|
|
132
|
+
return preservesAspectRatio(kind) ? svg : responsiveChartSvg(svg);
|
|
117
133
|
};
|
|
134
|
+
const preservesAspectRatio = kind => kind === "map" || kind === "pie" || kind === "donut" || kind === "gauge";
|
|
118
135
|
|
|
119
136
|
/** Empty-data short-circuit. Kept per-kind because stdlib's payload
|
|
120
137
|
* key differs (series vs data vs groups). We're conservative: only
|
|
@@ -139,25 +156,23 @@ const isEmpty = props => {
|
|
|
139
156
|
return false;
|
|
140
157
|
};
|
|
141
158
|
const Chart = props => {
|
|
159
|
+
const [, drawingProps] = splitProps(props, ["selected", "onSelect", "tooltip", "cursor"]);
|
|
142
160
|
const messages = useUiMessages();
|
|
161
|
+
const locale = useLocale();
|
|
143
162
|
let containerRef;
|
|
144
163
|
let chartTooltipRef;
|
|
145
164
|
let lineAnchorRef;
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
// client-side frame; the SVG re-renders reactively via innerHTML.
|
|
150
|
-
const initialHeight = props.kind === "stateTimeline" ? stateTimelineHeight(props.rows.length, props.legend !== false) : 280;
|
|
151
|
-
const [size, setSize] = createSignal({
|
|
165
|
+
// One deterministic coordinate space on the server and client. CSS fits the
|
|
166
|
+
// SVG to its box; hydration must never replace it with measured geometry.
|
|
167
|
+
const size = () => ({
|
|
152
168
|
width: 480,
|
|
153
|
-
height:
|
|
169
|
+
height: chartRenderHeight(props)
|
|
154
170
|
});
|
|
171
|
+
const dimensions = () => containerRef?.getBoundingClientRect() ?? size();
|
|
155
172
|
const initialMapViewport = props.kind === "map" ? normalizeMapViewport(props.viewport) : DEFAULT_MAP_VIEWPORT;
|
|
156
173
|
const [mapViewport, setMapViewport] = createSignal(initialMapViewport);
|
|
157
174
|
const initialTimelineViewport = props.kind === "stateTimeline" ? stateTimelineDomain(props.rows, props.domain) : [0, 1];
|
|
158
175
|
const [timelineViewport, setTimelineViewport] = createSignal(initialTimelineViewport);
|
|
159
|
-
const [linePointIndex, setLinePointIndex] = createSignal(0);
|
|
160
|
-
const [lineInspectionActive, setLineInspectionActive] = createSignal(false);
|
|
161
176
|
const [dragging, setDragging] = createSignal(false);
|
|
162
177
|
const chartTooltipId = `k2b-chart-tooltip-${createUniqueId()}`;
|
|
163
178
|
let timelineViewportLocallyChanged = false;
|
|
@@ -168,7 +183,7 @@ const Chart = props => {
|
|
|
168
183
|
const interactiveMap = () => props.kind === "map" && props.interactive === true;
|
|
169
184
|
const interactiveTimeline = () => props.kind === "stateTimeline" && props.interactive === true;
|
|
170
185
|
const interactiveLine = () => props.kind === "line" && props.interactive === true;
|
|
171
|
-
const interactive = () =>
|
|
186
|
+
const interactive = () => props.interactive === true;
|
|
172
187
|
const draggable = () => interactiveMap() || interactiveTimeline();
|
|
173
188
|
const labels = () => props.labels ?? {};
|
|
174
189
|
const timelineFullDomain = () => props.kind === "stateTimeline" ? stateTimelineDomain(props.rows, props.domain) : [0, 1];
|
|
@@ -188,6 +203,14 @@ const Chart = props => {
|
|
|
188
203
|
};
|
|
189
204
|
const mapDimensions = () => {
|
|
190
205
|
const viewportElement = containerRef?.querySelector(".stdlib-chart-map-viewport");
|
|
206
|
+
const matrix = viewportElement?.getScreenCTM?.();
|
|
207
|
+
const box = viewportElement?.viewBox?.baseVal;
|
|
208
|
+
if (matrix && box?.width && box.height) {
|
|
209
|
+
return {
|
|
210
|
+
width: box.width * Math.hypot(matrix.a, matrix.b),
|
|
211
|
+
height: box.height * Math.hypot(matrix.c, matrix.d)
|
|
212
|
+
};
|
|
213
|
+
}
|
|
191
214
|
const rect = viewportElement?.getBoundingClientRect();
|
|
192
215
|
if (rect && rect.width > 0 && rect.height > 0) {
|
|
193
216
|
return {
|
|
@@ -195,16 +218,18 @@ const Chart = props => {
|
|
|
195
218
|
height: rect.height
|
|
196
219
|
};
|
|
197
220
|
}
|
|
198
|
-
return
|
|
221
|
+
return dimensions();
|
|
199
222
|
};
|
|
200
223
|
const zoom = delta => {
|
|
224
|
+
closeChartTooltip();
|
|
201
225
|
if (interactiveMap()) {
|
|
202
|
-
setMapViewport(current => zoomMapViewport(current, delta));
|
|
226
|
+
setMapViewport(current => zoomMapViewport(current, delta, props.kind === "map" ? props.zoomFocus : undefined));
|
|
203
227
|
} else if (interactiveTimeline()) {
|
|
204
228
|
updateTimelineViewport(current => zoomStateTimelineViewport(current, timelineFullDomain(), delta));
|
|
205
229
|
}
|
|
206
230
|
};
|
|
207
231
|
const reset = () => {
|
|
232
|
+
closeChartTooltip();
|
|
208
233
|
if (interactiveMap() && props.kind === "map") {
|
|
209
234
|
setMapViewport(normalizeMapViewport(props.viewport));
|
|
210
235
|
}
|
|
@@ -214,6 +239,7 @@ const Chart = props => {
|
|
|
214
239
|
}
|
|
215
240
|
};
|
|
216
241
|
const handlePointerDown = event => {
|
|
242
|
+
inspection.down(event);
|
|
217
243
|
if (!draggable() || event.button !== 0 || event.target.closest("button, a")) {
|
|
218
244
|
return;
|
|
219
245
|
}
|
|
@@ -249,10 +275,8 @@ const Chart = props => {
|
|
|
249
275
|
const sample = pendingPointer;
|
|
250
276
|
pendingPointer = undefined;
|
|
251
277
|
if (!sample) return;
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
278
|
+
const start = timelineDrag ?? drag;
|
|
279
|
+
if (start && Math.hypot(sample.clientX - start.x, sample.clientY - ("y" in start ? start.y : sample.clientY)) <= 6) return;
|
|
256
280
|
const activeTimelineDrag = timelineDrag;
|
|
257
281
|
if (activeTimelineDrag?.pointerId === sample.pointerId) {
|
|
258
282
|
updateTimelineViewport(() => panStateTimelineViewport(activeTimelineDrag.viewport, timelineFullDomain(), sample.clientX - activeTimelineDrag.x, activeTimelineDrag.width));
|
|
@@ -262,7 +286,8 @@ const Chart = props => {
|
|
|
262
286
|
setMapViewport(panMapViewport(drag.viewport, sample.clientX - drag.x, sample.clientY - drag.y, drag.width, drag.height));
|
|
263
287
|
};
|
|
264
288
|
const handlePointerMove = event => {
|
|
265
|
-
|
|
289
|
+
inspection.move(event);
|
|
290
|
+
if (timelineDrag?.pointerId !== event.pointerId && drag?.pointerId !== event.pointerId) return;
|
|
266
291
|
pendingPointer = {
|
|
267
292
|
pointerId: event.pointerId,
|
|
268
293
|
clientX: event.clientX,
|
|
@@ -306,20 +331,8 @@ const Chart = props => {
|
|
|
306
331
|
}
|
|
307
332
|
};
|
|
308
333
|
const handleKeyDown = event => {
|
|
309
|
-
if (
|
|
310
|
-
if (
|
|
311
|
-
const values = lineXValues();
|
|
312
|
-
if (values.length === 0) return;
|
|
313
|
-
if (event.key === "Escape") {
|
|
314
|
-
closeChartTooltip();
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
317
|
-
const next = event.key === "Home" ? 0 : event.key === "End" ? values.length - 1 : event.key === "ArrowLeft" ? Math.max(0, linePointIndex() - 1) : event.key === "ArrowRight" ? Math.min(values.length - 1, linePointIndex() + 1) : null;
|
|
318
|
-
if (next === null) return;
|
|
319
|
-
event.preventDefault();
|
|
320
|
-
showLinePoint(next);
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
334
|
+
if (inspection.key(event)) return;
|
|
335
|
+
if (!draggable() || event.target !== containerRef) return;
|
|
323
336
|
if (event.key === "+" || event.key === "=") {
|
|
324
337
|
event.preventDefault();
|
|
325
338
|
zoom(1);
|
|
@@ -351,171 +364,60 @@ const Chart = props => {
|
|
|
351
364
|
const dimensions = mapDimensions();
|
|
352
365
|
setMapViewport(current => panMapViewport(current, delta[0], delta[1], dimensions.width, dimensions.height));
|
|
353
366
|
};
|
|
354
|
-
const
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
const showTimelineTooltip = target => {
|
|
371
|
-
if (!interactiveTimeline() || !chartTooltipRef) return;
|
|
372
|
-
const trigger = target?.closest("[data-chart-tooltip]");
|
|
373
|
-
const content = trigger?.dataset.chartTooltip;
|
|
374
|
-
if (!trigger || !content) return;
|
|
375
|
-
chartTooltipTriggerRef?.removeAttribute("aria-describedby");
|
|
376
|
-
chartTooltipTriggerRef = trigger;
|
|
377
|
-
trigger.setAttribute("aria-describedby", chartTooltipId);
|
|
378
|
-
chartTooltipRef.textContent = content;
|
|
379
|
-
try {
|
|
380
|
-
if (!chartTooltipRef.matches(":popover-open")) chartTooltipRef.showPopover();
|
|
381
|
-
positionTooltipSurface(chartTooltipRef, trigger);
|
|
382
|
-
} catch {
|
|
383
|
-
// SVG <title> remains as the fallback on browsers without Popover.
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
const lineInspection = createMemo(() => {
|
|
387
|
-
if (props.kind !== "line") {
|
|
367
|
+
const inspection = createChartInspection({
|
|
368
|
+
container: () => containerRef,
|
|
369
|
+
cursor: () => props.cursor,
|
|
370
|
+
tooltip: () => chartTooltipRef,
|
|
371
|
+
anchor: () => lineAnchorRef,
|
|
372
|
+
kind: () => props.kind,
|
|
373
|
+
enabled: interactive,
|
|
374
|
+
select: selection => props.onSelect?.(selection),
|
|
375
|
+
format: selection => {
|
|
376
|
+
if (props.tooltip) return props.tooltip(selection);
|
|
377
|
+
const fields = messages().chartFields;
|
|
378
|
+
const format = new Intl.NumberFormat(locale(), {
|
|
379
|
+
maximumFractionDigits: 6
|
|
380
|
+
});
|
|
388
381
|
return {
|
|
389
|
-
|
|
390
|
-
|
|
382
|
+
title: selection.datum.label ?? (selection.datum.seriesIndex !== undefined ? `${labels().series ?? messages().series} ${selection.datum.seriesIndex + 1}` : undefined),
|
|
383
|
+
rows: selection.datum.values.map(field => ({
|
|
384
|
+
label: selection.kind === "line" && field.key === "y" ? selection.datum.label ?? labels().series ?? messages().series : fields({
|
|
385
|
+
key: field.key
|
|
386
|
+
}),
|
|
387
|
+
value: field.formatted ?? (field.key === "upperInclusive" ? field.value === "true" ? messages().yes : messages().no : typeof field.value === "number" ? `${format.format(field.value)}${field.key === "percent" ? "%" : ""}` : field.value)
|
|
388
|
+
}))
|
|
391
389
|
};
|
|
392
390
|
}
|
|
393
|
-
const values = new Set();
|
|
394
|
-
const series = props.series.map(entry => {
|
|
395
|
-
const points = new Map();
|
|
396
|
-
for (const point of entry.data) {
|
|
397
|
-
if (!Number.isFinite(point.x)) continue;
|
|
398
|
-
values.add(point.x);
|
|
399
|
-
if (Number.isFinite(point.y) && !points.has(point.x)) points.set(point.x, point);
|
|
400
|
-
}
|
|
401
|
-
return {
|
|
402
|
-
label: entry.label ?? labels().series ?? messages().series,
|
|
403
|
-
points
|
|
404
|
-
};
|
|
405
|
-
});
|
|
406
|
-
return {
|
|
407
|
-
values: [...values].sort((left, right) => left - right),
|
|
408
|
-
series
|
|
409
|
-
};
|
|
410
391
|
});
|
|
411
|
-
const
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const rightInset = (typeof padding === "number" ? padding : padding?.right) ?? 16;
|
|
420
|
-
return {
|
|
421
|
-
left: left + (props.yAxis?.label ? 14 : 0),
|
|
422
|
-
right: Math.max(left + 1, size().width - rightInset)
|
|
423
|
-
};
|
|
424
|
-
};
|
|
425
|
-
const showLinePoint = (index, pointerY) => {
|
|
426
|
-
if (props.kind !== "line" || !chartTooltipRef || !lineAnchorRef) return;
|
|
427
|
-
const inspection = lineInspection();
|
|
428
|
-
const values = inspection.values;
|
|
429
|
-
const pointIndex = Math.min(values.length - 1, Math.max(0, index));
|
|
430
|
-
const x = values[pointIndex];
|
|
431
|
-
if (x === undefined) return;
|
|
432
|
-
const points = inspection.series.map(series => {
|
|
433
|
-
const point = series.points.get(x);
|
|
434
|
-
return point ? {
|
|
435
|
-
label: series.label,
|
|
436
|
-
point
|
|
437
|
-
} : null;
|
|
438
|
-
}).filter(entry => entry !== null);
|
|
439
|
-
if (points.length === 0) return;
|
|
440
|
-
const xFormat = props.xAxis?.format ?? String;
|
|
441
|
-
const yFormat = props.yAxis?.format ?? String;
|
|
442
|
-
chartTooltipRef.textContent = [xFormat(x), ...points.map(entry => `${entry.label}: ${yFormat(entry.point.y)}`)].join(" · ");
|
|
443
|
-
const [min, max] = [values[0] ?? x, values.at(-1) ?? x];
|
|
444
|
-
const bounds = linePlotBounds();
|
|
445
|
-
const ratio = max === min ? 0.5 : (x - min) / (max - min);
|
|
446
|
-
lineAnchorRef.style.left = `${bounds.left + ratio * (bounds.right - bounds.left)}px`;
|
|
447
|
-
lineAnchorRef.style.top = `${Math.min(size().height - 8, Math.max(8, pointerY ?? 24))}px`;
|
|
448
|
-
setLinePointIndex(pointIndex);
|
|
449
|
-
setLineInspectionActive(true);
|
|
450
|
-
try {
|
|
451
|
-
if (!chartTooltipRef.matches(":popover-open")) chartTooltipRef.showPopover();
|
|
452
|
-
positionTooltipSurface(chartTooltipRef, lineAnchorRef);
|
|
453
|
-
} catch {
|
|
454
|
-
// The chart remains readable on browsers without Popover support.
|
|
455
|
-
}
|
|
456
|
-
};
|
|
457
|
-
const showLineTooltip = (clientX, clientY) => {
|
|
458
|
-
const values = lineXValues();
|
|
459
|
-
if (values.length === 0) return;
|
|
460
|
-
const rect = containerRef?.getBoundingClientRect();
|
|
461
|
-
if (!rect) return;
|
|
462
|
-
const bounds = linePlotBounds();
|
|
463
|
-
const localX = clientX - rect.left;
|
|
464
|
-
const ratio = Math.min(1, Math.max(0, (localX - bounds.left) / Math.max(1, bounds.right - bounds.left)));
|
|
465
|
-
const target = (values[0] ?? 0) + ratio * ((values.at(-1) ?? 0) - (values[0] ?? 0));
|
|
466
|
-
let low = 0;
|
|
467
|
-
let high = values.length - 1;
|
|
468
|
-
while (low < high) {
|
|
469
|
-
const middle = Math.floor((low + high) / 2);
|
|
470
|
-
if (values[middle] < target) low = middle + 1;else high = middle;
|
|
471
|
-
}
|
|
472
|
-
const previous = Math.max(0, low - 1);
|
|
473
|
-
const index = Math.abs(values[previous] - target) <= Math.abs(values[low] - target) ? previous : low;
|
|
474
|
-
showLinePoint(index, clientY - rect.top);
|
|
475
|
-
};
|
|
392
|
+
const closeChartTooltip = () => inspection.close();
|
|
393
|
+
const svgMarkup = createMemo(() => renderChartSvg(drawingProps, size().width, size().height, interactiveMap() ? mapViewport() : undefined, interactiveTimeline() ? timelineViewport() : undefined));
|
|
394
|
+
createEffect(() => {
|
|
395
|
+
svgMarkup();
|
|
396
|
+
inspection.invalidate();
|
|
397
|
+
untrack(() => inspection.selectDatum(props.selected));
|
|
398
|
+
});
|
|
399
|
+
createEffect(() => inspection.selectDatum(props.selected));
|
|
476
400
|
onCleanup(() => {
|
|
401
|
+
inspection.close();
|
|
477
402
|
if (pointerFrame !== undefined) cancelAnimationFrame(pointerFrame);
|
|
478
403
|
pointerFrame = undefined;
|
|
479
404
|
pendingPointer = undefined;
|
|
480
405
|
});
|
|
481
406
|
onMount(() => {
|
|
482
407
|
if (!containerRef) return;
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
const ro = new ResizeObserver(entries => {
|
|
494
|
-
const entry = entries[0];
|
|
495
|
-
if (!entry) return;
|
|
496
|
-
const {
|
|
497
|
-
width,
|
|
498
|
-
height
|
|
499
|
-
} = entry.contentRect;
|
|
500
|
-
// Floor to integer pixels; sub-pixel jitter would trigger an
|
|
501
|
-
// SVG re-render on every scroll/zoom otherwise.
|
|
502
|
-
if (width > 0 && height > 0) {
|
|
503
|
-
setSize(prev => {
|
|
504
|
-
const w = Math.round(width);
|
|
505
|
-
const h = Math.round(height);
|
|
506
|
-
return prev.width === w && prev.height === h ? prev : {
|
|
507
|
-
width: w,
|
|
508
|
-
height: h
|
|
509
|
-
};
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
});
|
|
513
|
-
ro.observe(containerRef);
|
|
514
|
-
window.addEventListener("scroll", closeChartTooltip, true);
|
|
408
|
+
const outside = event => {
|
|
409
|
+
if (event.target instanceof Node && !containerRef?.contains(event.target)) closeChartTooltip();
|
|
410
|
+
};
|
|
411
|
+
window.addEventListener("pointerdown", outside);
|
|
412
|
+
const scroll = event => {
|
|
413
|
+
if (event.target instanceof Node && chartTooltipRef?.contains(event.target)) return;
|
|
414
|
+
closeChartTooltip();
|
|
415
|
+
};
|
|
416
|
+
window.addEventListener("scroll", scroll, true);
|
|
515
417
|
window.addEventListener("resize", closeChartTooltip);
|
|
516
418
|
onCleanup(() => {
|
|
517
|
-
|
|
518
|
-
window.removeEventListener("scroll",
|
|
419
|
+
window.removeEventListener("pointerdown", outside);
|
|
420
|
+
window.removeEventListener("scroll", scroll, true);
|
|
519
421
|
window.removeEventListener("resize", closeChartTooltip);
|
|
520
422
|
});
|
|
521
423
|
});
|
|
@@ -530,9 +432,9 @@ const Chart = props => {
|
|
|
530
432
|
return _$ssr(_tmpl$5, `k2b-chart k2b-chart__empty ${_$escape(props.class ?? "", true)}`, _$ssrStyle(chartStyle()), _$escape(labels().empty ?? messages().noData));
|
|
531
433
|
},
|
|
532
434
|
get children() {
|
|
533
|
-
return _$ssr(_tmpl$4, `k2b-chart ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-chart-kind", _$escape(props.kind, true), false) + _$ssrAttribute("data-drag", draggable() ? dragging() ? "active" : "idle" : _$escape(undefined, true), false) + _$ssrAttribute("data-crosshair", !draggable() && interactiveLine() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-interactive", interactive() ? "true" : _$escape(undefined, true), false), _$ssrStyle(chartStyle()), _$ssrAttribute("aria-
|
|
435
|
+
return _$ssr(_tmpl$4, `k2b-chart ${_$escape(props.class ?? "", true)}`, _$ssrAttribute("data-chart-kind", _$escape(props.kind, true), false) + _$ssrAttribute("data-drag", draggable() ? dragging() ? "active" : "idle" : _$escape(undefined, true), false) + _$ssrAttribute("data-crosshair", !draggable() && interactiveLine() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-interactive", interactive() ? "true" : _$escape(undefined, true), false), _$ssrStyle(chartStyle()), _$ssrAttribute("aria-label", interactiveMap() ? _$escape(labels().interactiveMap ?? messages().interactiveMap, true) : interactiveTimeline() ? _$escape(labels().interactiveTimeline ?? messages().interactiveTimeline, true) : interactiveLine() ? _$escape(labels().interactiveLine ?? messages().interactiveLineChart, true) : interactive() ? _$escape(labels().interactiveChart ?? messages().interactiveChart, true) : _$escape(undefined, true), false) + _$ssrAttribute("aria-description", interactive() ? _$escape(messages().interactiveChart, true) : _$escape(undefined, true), false) + _$ssrAttribute("tabindex", interactive() ? 0 : _$escape(undefined, true), false), _$ssrAttribute("data-stretch", !preservesAspectRatio(props.kind) ? "true" : _$escape(undefined, true), false), _$ssrStyleProperty("--k2b-chart-width:", `${_$escape(size().width, true)}px`) + _$ssrStyleProperty(";--k2b-chart-height:", `${_$escape(size().height, true)}px`) + _$ssrStyleProperty(";aspect-ratio:", `${_$escape(size().width, true)} / ${_$escape(size().height, true)}`), isServer ? selectedChartSvg(svgMarkup(), props.selected) : svgMarkup(), _$escape(_$createComponent(Show, {
|
|
534
436
|
get when() {
|
|
535
|
-
return
|
|
437
|
+
return interactive();
|
|
536
438
|
},
|
|
537
439
|
get children() {
|
|
538
440
|
return [_$ssr(_tmpl$), _$ssr(_tmpl$2, _$ssrAttribute("id", _$escape(chartTooltipId, true), false))];
|