@sixb/app 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -0
- package/README.md +27 -26
- package/assets/connector-icons/README.md +29 -0
- package/assets/connector-icons/ace-iot.ico +0 -0
- package/assets/connector-icons/companycam.png +0 -0
- package/assets/connector-icons/exa.png +0 -0
- package/assets/connector-icons/github.svg +1 -0
- package/assets/connector-icons/google.ico +0 -0
- package/assets/connector-icons/googleads.svg +29 -0
- package/assets/connector-icons/linkedin.svg +1 -0
- package/assets/connector-icons/mercury.svg +1 -0
- package/assets/connector-icons/meta.svg +1 -0
- package/assets/connector-icons/microsoft.ico +0 -0
- package/assets/connector-icons/notion.svg +1 -0
- package/assets/connector-icons/pandadoc.png +0 -0
- package/assets/connector-icons/pennylane.ico +0 -0
- package/assets/connector-icons/pipedrive.png +0 -0
- package/assets/connector-icons/plaud.png +0 -0
- package/assets/connector-icons/quickbooks.svg +1 -0
- package/assets/connector-icons/stripe.svg +1 -0
- package/assets/connector-icons/teamleader.ico +0 -0
- package/assets/connector-icons/tiktok.svg +1 -0
- package/assets/connector-icons/unipile.png +0 -0
- package/dist/agent/activity-label.d.ts +5 -0
- package/dist/agent/activity-label.d.ts.map +1 -0
- package/dist/agent/agent-chat.d.ts +25 -0
- package/dist/agent/agent-chat.d.ts.map +1 -0
- package/dist/agent/agent-context-provider.d.ts +9 -0
- package/dist/agent/agent-context-provider.d.ts.map +1 -0
- package/dist/agent/agent-execution-trace.d.ts +9 -0
- package/dist/agent/agent-execution-trace.d.ts.map +1 -0
- package/dist/agent/agent-panel.d.ts +24 -0
- package/dist/agent/agent-panel.d.ts.map +1 -0
- package/dist/agent/agent-surface-state.d.ts +22 -0
- package/dist/agent/agent-surface-state.d.ts.map +1 -0
- package/dist/agent/agent-surface.d.ts +46 -0
- package/dist/agent/agent-surface.d.ts.map +1 -0
- package/dist/agent/agents-page.d.ts +4 -0
- package/dist/agent/agents-page.d.ts.map +1 -0
- package/dist/agent/artifact-card.d.ts +9 -0
- package/dist/agent/artifact-card.d.ts.map +1 -0
- package/dist/agent/artifact-panel-state.d.ts +16 -0
- package/dist/agent/artifact-panel-state.d.ts.map +1 -0
- package/dist/agent/artifact-panel.d.ts +38 -0
- package/dist/agent/artifact-panel.d.ts.map +1 -0
- package/dist/agent/bash/bash-tool-view.d.ts +17 -0
- package/dist/agent/bash/bash-tool-view.d.ts.map +1 -0
- package/dist/agent/bash/data.d.ts +35 -0
- package/dist/agent/bash/data.d.ts.map +1 -0
- package/dist/agent/bash/interpret.d.ts +84 -0
- package/dist/agent/bash/interpret.d.ts.map +1 -0
- package/dist/agent/bash/renderers.d.ts +31 -0
- package/dist/agent/bash/renderers.d.ts.map +1 -0
- package/dist/agent/bash/shell.d.ts +16 -0
- package/dist/agent/bash/shell.d.ts.map +1 -0
- package/dist/agent/components/activity-status.d.ts +13 -0
- package/dist/agent/components/activity-status.d.ts.map +1 -0
- package/dist/agent/components/agent-thread-switcher.d.ts +16 -0
- package/dist/agent/components/agent-thread-switcher.d.ts.map +1 -0
- package/dist/agent/components/composer.d.ts +47 -0
- package/dist/agent/components/composer.d.ts.map +1 -0
- package/dist/agent/components/context-chips.d.ts +7 -0
- package/dist/agent/components/context-chips.d.ts.map +1 -0
- package/dist/agent/components/context-picker.d.ts +16 -0
- package/dist/agent/components/context-picker.d.ts.map +1 -0
- package/dist/agent/components/conversation-panel.d.ts +82 -0
- package/dist/agent/components/conversation-panel.d.ts.map +1 -0
- package/dist/agent/components/file-attachment-card.d.ts +8 -0
- package/dist/agent/components/file-attachment-card.d.ts.map +1 -0
- package/dist/agent/components/message-parts.d.ts +14 -0
- package/dist/agent/components/message-parts.d.ts.map +1 -0
- package/dist/agent/components/message-view.d.ts +58 -0
- package/dist/agent/components/message-view.d.ts.map +1 -0
- package/dist/agent/components/model-controls.d.ts +20 -0
- package/dist/agent/components/model-controls.d.ts.map +1 -0
- package/dist/agent/components/model-picker-row.d.ts +8 -0
- package/dist/agent/components/model-picker-row.d.ts.map +1 -0
- package/dist/agent/components/provider-logo.d.ts +6 -0
- package/dist/agent/components/provider-logo.d.ts.map +1 -0
- package/dist/agent/components/provider-logos.d.ts +3 -0
- package/dist/agent/components/provider-logos.d.ts.map +1 -0
- package/dist/agent/components/reasoning-effort-slider.d.ts +11 -0
- package/dist/agent/components/reasoning-effort-slider.d.ts.map +1 -0
- package/dist/agent/components/sandbox-recovery.d.ts +6 -0
- package/dist/agent/components/sandbox-recovery.d.ts.map +1 -0
- package/dist/agent/components/thread-artifacts-menu.d.ts +8 -0
- package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -0
- package/dist/agent/components/transcript.d.ts +36 -0
- package/dist/agent/components/transcript.d.ts.map +1 -0
- package/dist/agent/components/web-fetch-tool-view.d.ts +5 -0
- package/dist/agent/components/web-fetch-tool-view.d.ts.map +1 -0
- package/dist/agent/components/web-search-tool-view.d.ts +5 -0
- package/dist/agent/components/web-search-tool-view.d.ts.map +1 -0
- package/dist/agent/components/web-sources.d.ts +9 -0
- package/dist/agent/components/web-sources.d.ts.map +1 -0
- package/dist/agent/format.d.ts +12 -0
- package/dist/agent/format.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +337 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -0
- package/dist/agent/hooks/use-thread-stream.d.ts +22 -0
- package/dist/agent/hooks/use-thread-stream.d.ts.map +1 -0
- package/dist/agent/i18n/en.d.ts +550 -0
- package/dist/agent/i18n/en.d.ts.map +1 -0
- package/dist/agent/i18n/fr.d.ts +4 -0
- package/dist/agent/i18n/fr.d.ts.map +1 -0
- package/dist/agent/i18n/index.d.ts +1079 -0
- package/dist/agent/i18n/index.d.ts.map +1 -0
- package/dist/agent/live-run.d.ts +48 -0
- package/dist/agent/live-run.d.ts.map +1 -0
- package/dist/agent/model-selection.d.ts +33 -0
- package/dist/agent/model-selection.d.ts.map +1 -0
- package/dist/agent/object-context-title.d.ts +22 -0
- package/dist/agent/object-context-title.d.ts.map +1 -0
- package/dist/agent/parts.d.ts +42 -0
- package/dist/agent/parts.d.ts.map +1 -0
- package/dist/agent/publish-artifact/interpret.d.ts +32 -0
- package/dist/agent/publish-artifact/interpret.d.ts.map +1 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts +9 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts.map +1 -0
- package/dist/agent/publish-artifact/use-live-publishes.d.ts +10 -0
- package/dist/agent/publish-artifact/use-live-publishes.d.ts.map +1 -0
- package/dist/agent/react-router.d.ts +7 -0
- package/dist/agent/react-router.d.ts.map +1 -0
- package/dist/agent/read/interpret.d.ts +24 -0
- package/dist/agent/read/interpret.d.ts.map +1 -0
- package/dist/agent/read/read-tool-view.d.ts +5 -0
- package/dist/agent/read/read-tool-view.d.ts.map +1 -0
- package/dist/agent/requester-settings.d.ts +15 -0
- package/dist/agent/requester-settings.d.ts.map +1 -0
- package/dist/agent/run-presentation.d.ts +70 -0
- package/dist/agent/run-presentation.d.ts.map +1 -0
- package/dist/agent/thread-navigation.d.ts +5 -0
- package/dist/agent/thread-navigation.d.ts.map +1 -0
- package/dist/agent/types.d.ts +22 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/utils/context-display.d.ts +5 -0
- package/dist/agent/utils/context-display.d.ts.map +1 -0
- package/dist/agent/utils/context-mention.d.ts +12 -0
- package/dist/agent/utils/context-mention.d.ts.map +1 -0
- package/dist/agent/utils/web-fetch.d.ts +4 -0
- package/dist/agent/utils/web-fetch.d.ts.map +1 -0
- package/dist/agent/utils/web-search.d.ts +20 -0
- package/dist/agent/utils/web-search.d.ts.map +1 -0
- package/dist/agent/view-file/interpret.d.ts +9 -0
- package/dist/agent/view-file/interpret.d.ts.map +1 -0
- package/dist/agent/view-file/view-file-tool-view.d.ts +9 -0
- package/dist/agent/view-file/view-file-tool-view.d.ts.map +1 -0
- package/dist/artifacts/artifact-page.d.ts +7 -0
- package/dist/artifacts/artifact-page.d.ts.map +1 -0
- package/dist/artifacts/card-details.d.ts +15 -0
- package/dist/artifacts/card-details.d.ts.map +1 -0
- package/dist/artifacts/card-preview.d.ts +59 -0
- package/dist/artifacts/card-preview.d.ts.map +1 -0
- package/dist/artifacts/copy-feedback.d.ts +6 -0
- package/dist/artifacts/copy-feedback.d.ts.map +1 -0
- package/dist/artifacts/file-size.d.ts +11 -0
- package/dist/artifacts/file-size.d.ts.map +1 -0
- package/dist/artifacts/file-source.d.ts +45 -0
- package/dist/artifacts/file-source.d.ts.map +1 -0
- package/dist/artifacts/file-view.d.ts +9 -0
- package/dist/artifacts/file-view.d.ts.map +1 -0
- package/dist/artifacts/frame.d.ts +45 -0
- package/dist/artifacts/frame.d.ts.map +1 -0
- package/dist/artifacts/gallery.d.ts +6 -0
- package/dist/artifacts/gallery.d.ts.map +1 -0
- package/dist/artifacts/kind-icon.d.ts +8 -0
- package/dist/artifacts/kind-icon.d.ts.map +1 -0
- package/dist/artifacts/markdown-tree.d.ts +22 -0
- package/dist/artifacts/markdown-tree.d.ts.map +1 -0
- package/dist/artifacts/messages.d.ts +301 -0
- package/dist/artifacts/messages.d.ts.map +1 -0
- package/dist/artifacts/queries.d.ts +21 -0
- package/dist/artifacts/queries.d.ts.map +1 -0
- package/dist/artifacts/references/embed-tree.d.ts +17 -0
- package/dist/artifacts/references/embed-tree.d.ts.map +1 -0
- package/dist/artifacts/references/references.d.ts +50 -0
- package/dist/artifacts/references/references.d.ts.map +1 -0
- package/dist/artifacts/renderers/document-tree.d.ts +11 -0
- package/dist/artifacts/renderers/document-tree.d.ts.map +1 -0
- package/dist/artifacts/renderers/document.d.ts +17 -0
- package/dist/artifacts/renderers/document.d.ts.map +1 -0
- package/dist/artifacts/renderers/file.d.ts +10 -0
- package/dist/artifacts/renderers/file.d.ts.map +1 -0
- package/dist/artifacts/renderers/notice.d.ts +12 -0
- package/dist/artifacts/renderers/notice.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart-data.d.ts +33 -0
- package/dist/artifacts/renderers/sheet/chart-data.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/chart.d.ts +15 -0
- package/dist/artifacts/renderers/sheet/chart.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/format.d.ts +35 -0
- package/dist/artifacts/renderers/sheet/format.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/grid.d.ts +25 -0
- package/dist/artifacts/renderers/sheet/grid.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/mini-chart.d.ts +7 -0
- package/dist/artifacts/renderers/sheet/mini-chart.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/model.d.ts +29 -0
- package/dist/artifacts/renderers/sheet/model.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/selection.d.ts +42 -0
- package/dist/artifacts/renderers/sheet/selection.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/sheet.d.ts +17 -0
- package/dist/artifacts/renderers/sheet/sheet.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/virtual.d.ts +13 -0
- package/dist/artifacts/renderers/sheet/virtual.d.ts.map +1 -0
- package/dist/artifacts/renderers/sheet/workbook.d.ts +24 -0
- package/dist/artifacts/renderers/sheet/workbook.d.ts.map +1 -0
- package/dist/artifacts/renderers/slides/navigation.d.ts +17 -0
- package/dist/artifacts/renderers/slides/navigation.d.ts.map +1 -0
- package/dist/artifacts/renderers/slides/slides.d.ts +14 -0
- package/dist/artifacts/renderers/slides/slides.d.ts.map +1 -0
- package/dist/artifacts/target.d.ts +29 -0
- package/dist/artifacts/target.d.ts.map +1 -0
- package/dist/artifacts/theme.d.ts +18 -0
- package/dist/artifacts/theme.d.ts.map +1 -0
- package/dist/artifacts/viewer.d.ts +19 -0
- package/dist/artifacts/viewer.d.ts.map +1 -0
- package/dist/chunk-3schcf10.js +251 -0
- package/dist/chunk-3schcf10.js.map +10 -0
- package/dist/chunk-6n5pdqp0.js +115 -0
- package/dist/chunk-6n5pdqp0.js.map +11 -0
- package/dist/chunk-c7gy61rx.js +276 -0
- package/dist/chunk-c7gy61rx.js.map +10 -0
- package/dist/chunk-g3f4cm8x.js +20 -0
- package/dist/chunk-g3f4cm8x.js.map +10 -0
- package/dist/chunk-gn3k23q5.js +149 -0
- package/dist/chunk-gn3k23q5.js.map +10 -0
- package/dist/chunk-md3p7qdt.js +379 -0
- package/dist/chunk-md3p7qdt.js.map +10 -0
- package/dist/chunk-ng0hdnrq.js +183 -0
- package/dist/chunk-ng0hdnrq.js.map +10 -0
- package/dist/chunk-xxpdn63v.js +15018 -0
- package/dist/chunk-xxpdn63v.js.map +105 -0
- package/dist/chunk-yvhzn4ye.js +98 -0
- package/dist/chunk-yvhzn4ye.js.map +10 -0
- package/dist/codegen.d.ts +8 -4
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts +14 -7
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +31 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +962 -2891
- package/dist/index.js.map +14 -13
- package/dist/locale-messages.d.ts +74 -6
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +75 -8
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +10 -19
- package/dist/locale.js.map +3 -4
- package/dist/metadata.d.ts.map +1 -1
- package/dist/pages/data/connectors.d.ts +5 -0
- package/dist/pages/data/connectors.d.ts.map +1 -0
- package/dist/pages/data/datasets.d.ts +30 -0
- package/dist/pages/data/datasets.d.ts.map +1 -0
- package/dist/pages/data/live-updates.d.ts +13 -0
- package/dist/pages/data/live-updates.d.ts.map +1 -0
- package/dist/pages/data/messages.d.ts +354 -0
- package/dist/pages/data/messages.d.ts.map +1 -0
- package/dist/pages/data/pipeline-canvas.d.ts +34 -0
- package/dist/pages/data/pipeline-canvas.d.ts.map +1 -0
- package/dist/pages/data/pipelines.d.ts +9 -0
- package/dist/pages/data/pipelines.d.ts.map +1 -0
- package/dist/pages/data/projections.d.ts +10 -0
- package/dist/pages/data/projections.d.ts.map +1 -0
- package/dist/pages/data/schema.d.ts +20 -0
- package/dist/pages/data/schema.d.ts.map +1 -0
- package/dist/pages/data/shared.d.ts +13 -0
- package/dist/pages/data/shared.d.ts.map +1 -0
- package/dist/pages/data/sync-button.d.ts +15 -0
- package/dist/pages/data/sync-button.d.ts.map +1 -0
- package/dist/pages/data/syncs.d.ts +5 -0
- package/dist/pages/data/syncs.d.ts.map +1 -0
- package/dist/pages/home.d.ts +6 -0
- package/dist/pages/home.d.ts.map +1 -0
- package/dist/pages/mosaic.d.ts +5 -0
- package/dist/pages/mosaic.d.ts.map +1 -0
- package/dist/pages/observability/action-run.d.ts +19 -0
- package/dist/pages/observability/action-run.d.ts.map +1 -0
- package/dist/pages/observability/activity/calendar.d.ts +9 -0
- package/dist/pages/observability/activity/calendar.d.ts.map +1 -0
- package/dist/pages/observability/activity/connections.d.ts +7 -0
- package/dist/pages/observability/activity/connections.d.ts.map +1 -0
- package/dist/pages/observability/activity/format.d.ts +11 -0
- package/dist/pages/observability/activity/format.d.ts.map +1 -0
- package/dist/pages/observability/activity/messages.d.ts +231 -0
- package/dist/pages/observability/activity/messages.d.ts.map +1 -0
- package/dist/pages/observability/activity/meta-items.d.ts +10 -0
- package/dist/pages/observability/activity/meta-items.d.ts.map +1 -0
- package/dist/pages/observability/activity/page.d.ts +6 -0
- package/dist/pages/observability/activity/page.d.ts.map +1 -0
- package/dist/pages/observability/activity/period.d.ts +31 -0
- package/dist/pages/observability/activity/period.d.ts.map +1 -0
- package/dist/pages/observability/activity/steps.d.ts +44 -0
- package/dist/pages/observability/activity/steps.d.ts.map +1 -0
- package/dist/pages/observability/activity/timeline.d.ts +36 -0
- package/dist/pages/observability/activity/timeline.d.ts.map +1 -0
- package/dist/pages/observability/activity/users.d.ts +18 -0
- package/dist/pages/observability/activity/users.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/calls.d.ts +27 -0
- package/dist/pages/observability/ai-usage/calls.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/charts.d.ts +23 -0
- package/dist/pages/observability/ai-usage/charts.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/format.d.ts +101 -0
- package/dist/pages/observability/ai-usage/format.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/limits.d.ts +12 -0
- package/dist/pages/observability/ai-usage/limits.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/messages.d.ts +431 -0
- package/dist/pages/observability/ai-usage/messages.d.ts.map +1 -0
- package/dist/pages/observability/ai-usage/page.d.ts +6 -0
- package/dist/pages/observability/ai-usage/page.d.ts.map +1 -0
- package/dist/pages/observability/live-updates.d.ts +3 -0
- package/dist/pages/observability/live-updates.d.ts.map +1 -0
- package/dist/pages/observability/logs.d.ts +11 -0
- package/dist/pages/observability/logs.d.ts.map +1 -0
- package/dist/pages/observability/messages.d.ts +329 -0
- package/dist/pages/observability/messages.d.ts.map +1 -0
- package/dist/pages/observability/runs.d.ts +7 -0
- package/dist/pages/observability/runs.d.ts.map +1 -0
- package/dist/pages/observability/workflow-run.d.ts +6 -0
- package/dist/pages/observability/workflow-run.d.ts.map +1 -0
- package/dist/pages/ontology/actions.d.ts +3 -0
- package/dist/pages/ontology/actions.d.ts.map +1 -0
- package/dist/pages/ontology/components/action-button.d.ts +12 -0
- package/dist/pages/ontology/components/action-button.d.ts.map +1 -0
- package/dist/pages/ontology/components/action-param-null-control.d.ts +7 -0
- package/dist/pages/ontology/components/action-param-null-control.d.ts.map +1 -0
- package/dist/pages/ontology/components/collection-toolbar.d.ts +21 -0
- package/dist/pages/ontology/components/collection-toolbar.d.ts.map +1 -0
- package/dist/pages/ontology/components/common.d.ts +16 -0
- package/dist/pages/ontology/components/common.d.ts.map +1 -0
- package/dist/pages/ontology/components/file-ref-upload-field.d.ts +13 -0
- package/dist/pages/ontology/components/file-ref-upload-field.d.ts.map +1 -0
- package/dist/pages/ontology/components/object-filter-popover.d.ts +9 -0
- package/dist/pages/ontology/components/object-filter-popover.d.ts.map +1 -0
- package/dist/pages/ontology/components/object-icon.d.ts +7 -0
- package/dist/pages/ontology/components/object-icon.d.ts.map +1 -0
- package/dist/pages/ontology/components/object-query-bar.d.ts +21 -0
- package/dist/pages/ontology/components/object-query-bar.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-chart.d.ts +18 -0
- package/dist/pages/ontology/components/telemetry-chart.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-grid.d.ts +19 -0
- package/dist/pages/ontology/components/telemetry-grid.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-tile.d.ts +18 -0
- package/dist/pages/ontology/components/telemetry-tile.d.ts.map +1 -0
- package/dist/pages/ontology/components/telemetry-value.d.ts +10 -0
- package/dist/pages/ontology/components/telemetry-value.d.ts.map +1 -0
- package/dist/pages/ontology/components/usage-bar.d.ts +12 -0
- package/dist/pages/ontology/components/usage-bar.d.ts.map +1 -0
- package/dist/pages/ontology/graph.d.ts +6 -0
- package/dist/pages/ontology/graph.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/object-live-updates.d.ts +5 -0
- package/dist/pages/ontology/hooks/object-live-updates.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/object-telemetry-updates.d.ts +8 -0
- package/dist/pages/ontology/hooks/object-telemetry-updates.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/object-type-counts.d.ts +5 -0
- package/dist/pages/ontology/hooks/object-type-counts.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/rule-live-updates.d.ts +9 -0
- package/dist/pages/ontology/hooks/rule-live-updates.d.ts.map +1 -0
- package/dist/pages/ontology/hooks/workflow-live-updates.d.ts +6 -0
- package/dist/pages/ontology/hooks/workflow-live-updates.d.ts.map +1 -0
- package/dist/pages/ontology/lib/action-params.d.ts +55 -0
- package/dist/pages/ontology/lib/action-params.d.ts.map +1 -0
- package/dist/pages/ontology/lib/format-value.d.ts +3 -0
- package/dist/pages/ontology/lib/format-value.d.ts.map +1 -0
- package/dist/pages/ontology/lib/labels.d.ts +3 -0
- package/dist/pages/ontology/lib/labels.d.ts.map +1 -0
- package/dist/pages/ontology/lib/live-update-keys.d.ts +15 -0
- package/dist/pages/ontology/lib/live-update-keys.d.ts.map +1 -0
- package/dist/pages/ontology/lib/object-query.d.ts +72 -0
- package/dist/pages/ontology/lib/object-query.d.ts.map +1 -0
- package/dist/pages/ontology/lib/ontology-graph-layout.d.ts +68 -0
- package/dist/pages/ontology/lib/ontology-graph-layout.d.ts.map +1 -0
- package/dist/pages/ontology/lib/ontology-graph-links.d.ts +4 -0
- package/dist/pages/ontology/lib/ontology-graph-links.d.ts.map +1 -0
- package/dist/pages/ontology/lib/telemetry-history.d.ts +10 -0
- package/dist/pages/ontology/lib/telemetry-history.d.ts.map +1 -0
- package/dist/pages/ontology/lib/time.d.ts +3 -0
- package/dist/pages/ontology/lib/time.d.ts.map +1 -0
- package/dist/pages/ontology/lib/user-preferences.d.ts +8 -0
- package/dist/pages/ontology/lib/user-preferences.d.ts.map +1 -0
- package/dist/pages/ontology/object-page.d.ts +7 -0
- package/dist/pages/ontology/object-page.d.ts.map +1 -0
- package/dist/pages/ontology/object-type.d.ts +3 -0
- package/dist/pages/ontology/object-type.d.ts.map +1 -0
- package/dist/pages/ontology/object-types.d.ts +7 -0
- package/dist/pages/ontology/object-types.d.ts.map +1 -0
- package/dist/pages/ontology/objects.d.ts +6 -0
- package/dist/pages/ontology/objects.d.ts.map +1 -0
- package/dist/pages/ontology/rules.d.ts +32 -0
- package/dist/pages/ontology/rules.d.ts.map +1 -0
- package/dist/pages/ontology/workflow.d.ts +6 -0
- package/dist/pages/ontology/workflow.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/agent-execution-panel.d.ts +17 -0
- package/dist/pages/ontology/workflows/agent-execution-panel.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/intervention-panel.d.ts +5 -0
- package/dist/pages/ontology/workflows/intervention-panel.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/node-execution-panel.d.ts +11 -0
- package/dist/pages/ontology/workflows/node-execution-panel.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/request-run-dialog.d.ts +5 -0
- package/dist/pages/ontology/workflows/request-run-dialog.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/run-debug-section.d.ts +11 -0
- package/dist/pages/ontology/workflows/run-debug-section.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/run-input-form.d.ts +18 -0
- package/dist/pages/ontology/workflows/run-input-form.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/run-progress.d.ts +15 -0
- package/dist/pages/ontology/workflows/run-progress.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/schema-shape.d.ts +10 -0
- package/dist/pages/ontology/workflows/schema-shape.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/status-badge.d.ts +5 -0
- package/dist/pages/ontology/workflows/status-badge.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/utils.d.ts +29 -0
- package/dist/pages/ontology/workflows/utils.d.ts.map +1 -0
- package/dist/pages/ontology/workflows/workflow-card.d.ts +5 -0
- package/dist/pages/ontology/workflows/workflow-card.d.ts.map +1 -0
- package/dist/pages/ontology/workflows.d.ts +3 -0
- package/dist/pages/ontology/workflows.d.ts.map +1 -0
- package/dist/pages/routes.d.ts +26 -0
- package/dist/pages/routes.d.ts.map +1 -0
- package/dist/pages/section-page.d.ts +91 -0
- package/dist/pages/section-page.d.ts.map +1 -0
- package/dist/pages/section-ui.d.ts +212 -0
- package/dist/pages/section-ui.d.ts.map +1 -0
- package/dist/pages/settings/controls.d.ts +94 -0
- package/dist/pages/settings/controls.d.ts.map +1 -0
- package/dist/pages/settings/developers.d.ts +3 -0
- package/dist/pages/settings/developers.d.ts.map +1 -0
- package/dist/pages/settings/members.d.ts +3 -0
- package/dist/pages/settings/members.d.ts.map +1 -0
- package/dist/pages/settings/messages.d.ts +538 -0
- package/dist/pages/settings/messages.d.ts.map +1 -0
- package/dist/pages/settings/personal.d.ts +6 -0
- package/dist/pages/settings/personal.d.ts.map +1 -0
- package/dist/pages/settings/service-accounts.d.ts +3 -0
- package/dist/pages/settings/service-accounts.d.ts.map +1 -0
- package/dist/pages/settings/sessions.d.ts +3 -0
- package/dist/pages/settings/sessions.d.ts.map +1 -0
- package/dist/pages/values.d.ts +77 -0
- package/dist/pages/values.d.ts.map +1 -0
- package/dist/pages.d.ts +45 -0
- package/dist/pages.d.ts.map +1 -0
- package/dist/pages.js +26029 -0
- package/dist/pages.js.map +98 -0
- package/dist/runtime.d.ts +0 -2
- package/dist/runtime.d.ts.map +1 -1
- package/dist/sections/catalog.d.ts +37 -0
- package/dist/sections/catalog.d.ts.map +1 -0
- package/dist/sections/counts.d.ts +7 -0
- package/dist/sections/counts.d.ts.map +1 -0
- package/dist/sections/sections.d.ts +67 -0
- package/dist/sections/sections.d.ts.map +1 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +3036 -0
- package/dist/server.js.map +19 -0
- package/dist/session.d.ts +18 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/shell/agent-dock.d.ts +7 -0
- package/dist/shell/agent-dock.d.ts.map +1 -0
- package/dist/shell/app-shell.d.ts +42 -0
- package/dist/shell/app-shell.d.ts.map +1 -0
- package/dist/shell/brand.d.ts +15 -0
- package/dist/shell/brand.d.ts.map +1 -0
- package/dist/shell/nav-items.d.ts +34 -0
- package/dist/shell/nav-items.d.ts.map +1 -0
- package/dist/shell/search-command.d.ts +12 -0
- package/dist/shell/search-command.d.ts.map +1 -0
- package/dist/shell/section-nav.d.ts +13 -0
- package/dist/shell/section-nav.d.ts.map +1 -0
- package/dist/shell/user-menu.d.ts +25 -0
- package/dist/shell/user-menu.d.ts.map +1 -0
- package/dist/tailwind.d.ts +4 -4
- package/dist/tailwind.d.ts.map +1 -1
- package/package.json +22 -21
- package/src/agent/activity-label.ts +70 -0
- package/src/agent/agent-chat.tsx +248 -0
- package/src/agent/agent-context-provider.tsx +92 -0
- package/src/agent/agent-execution-trace.tsx +316 -0
- package/src/agent/agent-panel.tsx +74 -0
- package/src/agent/agent-surface-state.ts +113 -0
- package/src/agent/agent-surface.tsx +363 -0
- package/src/agent/agent.css +231 -0
- package/src/agent/agents-page.ts +7 -0
- package/src/agent/artifact-card.tsx +190 -0
- package/src/agent/artifact-panel-state.ts +38 -0
- package/src/agent/artifact-panel.tsx +320 -0
- package/src/agent/bash/bash-tool-view.tsx +288 -0
- package/src/agent/bash/data.ts +137 -0
- package/src/agent/bash/interpret.ts +769 -0
- package/src/agent/bash/renderers.tsx +503 -0
- package/src/agent/bash/shell.ts +195 -0
- package/src/agent/components/activity-status.tsx +86 -0
- package/src/agent/components/agent-thread-switcher.tsx +346 -0
- package/src/agent/components/composer.tsx +870 -0
- package/src/agent/components/context-chips.tsx +63 -0
- package/src/agent/components/context-picker.tsx +88 -0
- package/src/agent/components/conversation-panel.tsx +352 -0
- package/src/agent/components/file-attachment-card.tsx +136 -0
- package/src/agent/components/message-parts.tsx +305 -0
- package/src/agent/components/message-view.tsx +422 -0
- package/src/agent/components/model-controls.tsx +204 -0
- package/src/agent/components/model-picker-row.tsx +136 -0
- package/src/agent/components/provider-logo.tsx +31 -0
- package/src/agent/components/provider-logos.ts +24 -0
- package/src/agent/components/reasoning-effort-slider.tsx +121 -0
- package/src/agent/components/sandbox-recovery.tsx +49 -0
- package/src/agent/components/thread-artifacts-menu.tsx +77 -0
- package/src/agent/components/transcript.tsx +239 -0
- package/src/agent/components/web-fetch-tool-view.tsx +69 -0
- package/src/agent/components/web-search-tool-view.tsx +37 -0
- package/src/agent/components/web-sources.tsx +159 -0
- package/src/agent/format.ts +60 -0
- package/src/agent/hooks/use-agent-conversation.ts +536 -0
- package/src/agent/hooks/use-thread-stream.ts +121 -0
- package/src/agent/i18n/en.ts +500 -0
- package/src/agent/i18n/fr.ts +530 -0
- package/src/agent/i18n/index.ts +14 -0
- package/src/agent/live-run.ts +257 -0
- package/src/agent/model-selection.ts +88 -0
- package/src/agent/object-context-title.ts +57 -0
- package/src/agent/parts.ts +119 -0
- package/src/agent/publish-artifact/interpret.ts +110 -0
- package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +62 -0
- package/src/agent/publish-artifact/use-live-publishes.ts +45 -0
- package/src/agent/react-router.tsx +103 -0
- package/src/agent/read/interpret.ts +101 -0
- package/src/agent/read/read-tool-view.tsx +92 -0
- package/src/agent/requester-settings.ts +55 -0
- package/src/agent/run-presentation.ts +211 -0
- package/src/agent/thread-navigation.ts +11 -0
- package/src/agent/types.ts +37 -0
- package/src/agent/utils/context-display.ts +72 -0
- package/src/agent/utils/context-mention.ts +28 -0
- package/src/agent/utils/web-fetch.ts +20 -0
- package/src/agent/utils/web-search.ts +106 -0
- package/src/agent/view-file/interpret.ts +22 -0
- package/src/agent/view-file/view-file-tool-view.tsx +123 -0
- package/src/artifacts/artifact-page.tsx +61 -0
- package/src/artifacts/artifacts.css +172 -0
- package/src/artifacts/card-details.ts +92 -0
- package/src/artifacts/card-preview.tsx +612 -0
- package/src/artifacts/copy-feedback.ts +25 -0
- package/src/artifacts/file-size.ts +24 -0
- package/src/artifacts/file-source.ts +109 -0
- package/src/artifacts/file-view.ts +57 -0
- package/src/artifacts/frame.tsx +288 -0
- package/src/artifacts/gallery.tsx +405 -0
- package/src/artifacts/kind-icon.tsx +23 -0
- package/src/artifacts/markdown-tree.ts +32 -0
- package/src/artifacts/messages.ts +317 -0
- package/src/artifacts/queries.ts +85 -0
- package/src/artifacts/references/embed-tree.ts +86 -0
- package/src/artifacts/references/references.tsx +739 -0
- package/src/artifacts/renderers/document-tree.ts +157 -0
- package/src/artifacts/renderers/document.tsx +334 -0
- package/src/artifacts/renderers/file.tsx +160 -0
- package/src/artifacts/renderers/notice.tsx +38 -0
- package/src/artifacts/renderers/sheet/chart-data.ts +73 -0
- package/src/artifacts/renderers/sheet/chart.tsx +288 -0
- package/src/artifacts/renderers/sheet/format.ts +142 -0
- package/src/artifacts/renderers/sheet/grid.tsx +709 -0
- package/src/artifacts/renderers/sheet/mini-chart.tsx +241 -0
- package/src/artifacts/renderers/sheet/model.ts +136 -0
- package/src/artifacts/renderers/sheet/selection.ts +152 -0
- package/src/artifacts/renderers/sheet/sheet.tsx +471 -0
- package/src/artifacts/renderers/sheet/virtual.ts +49 -0
- package/src/artifacts/renderers/sheet/workbook.ts +57 -0
- package/src/artifacts/renderers/slides/navigation.ts +38 -0
- package/src/artifacts/renderers/slides/slides.tsx +441 -0
- package/src/artifacts/target.ts +76 -0
- package/src/artifacts/theme.ts +29 -0
- package/src/artifacts/viewer.tsx +476 -0
- package/src/build.ts +13 -2
- package/src/codegen.ts +98 -80
- package/src/createCustomApp.ts +175 -67
- package/src/index.ts +47 -16
- package/src/locale-messages.ts +128 -12
- package/src/locale.ts +1 -2
- package/src/metadata.ts +35 -1
- package/src/pages/canvas.css +43 -0
- package/src/pages/data/connectors.tsx +317 -0
- package/src/pages/data/datasets.tsx +731 -0
- package/src/pages/data/live-updates.ts +71 -0
- package/src/pages/data/messages.ts +349 -0
- package/src/pages/data/pipeline-canvas.tsx +288 -0
- package/src/pages/data/pipelines.tsx +710 -0
- package/src/pages/data/projections.tsx +482 -0
- package/src/pages/data/schema.tsx +62 -0
- package/src/pages/data/shared.tsx +78 -0
- package/src/pages/data/sync-button.tsx +103 -0
- package/src/pages/data/syncs.tsx +326 -0
- package/src/pages/home.tsx +64 -0
- package/src/pages/mosaic.tsx +97 -0
- package/src/pages/observability/action-run.tsx +229 -0
- package/src/pages/observability/activity/calendar.tsx +239 -0
- package/src/pages/observability/activity/connections.tsx +144 -0
- package/src/pages/observability/activity/format.ts +49 -0
- package/src/pages/observability/activity/messages.ts +255 -0
- package/src/pages/observability/activity/meta-items.tsx +23 -0
- package/src/pages/observability/activity/page.tsx +605 -0
- package/src/pages/observability/activity/period.ts +63 -0
- package/src/pages/observability/activity/steps.ts +102 -0
- package/src/pages/observability/activity/timeline.tsx +411 -0
- package/src/pages/observability/activity/users.tsx +133 -0
- package/src/pages/observability/ai-usage/calls.tsx +541 -0
- package/src/pages/observability/ai-usage/charts.tsx +126 -0
- package/src/pages/observability/ai-usage/format.ts +276 -0
- package/src/pages/observability/ai-usage/limits.tsx +629 -0
- package/src/pages/observability/ai-usage/messages.ts +446 -0
- package/src/pages/observability/ai-usage/page.tsx +814 -0
- package/src/pages/observability/live-updates.ts +19 -0
- package/src/pages/observability/logs.tsx +617 -0
- package/src/pages/observability/messages.ts +336 -0
- package/src/pages/observability/runs.tsx +732 -0
- package/src/pages/observability/workflow-run.tsx +323 -0
- package/src/pages/ontology/actions.tsx +749 -0
- package/src/pages/ontology/components/action-button.tsx +355 -0
- package/src/pages/ontology/components/action-param-null-control.tsx +35 -0
- package/src/pages/ontology/components/collection-toolbar.tsx +61 -0
- package/src/pages/ontology/components/common.tsx +60 -0
- package/src/pages/ontology/components/file-ref-upload-field.tsx +279 -0
- package/src/pages/ontology/components/object-filter-popover.tsx +311 -0
- package/src/pages/ontology/components/object-icon.tsx +133 -0
- package/src/pages/ontology/components/object-query-bar.tsx +217 -0
- package/src/pages/ontology/components/telemetry-chart.tsx +392 -0
- package/src/pages/ontology/components/telemetry-grid.tsx +137 -0
- package/src/pages/ontology/components/telemetry-tile.tsx +164 -0
- package/src/pages/ontology/components/telemetry-value.tsx +91 -0
- package/src/pages/ontology/components/usage-bar.tsx +64 -0
- package/src/pages/ontology/graph.tsx +1283 -0
- package/src/pages/ontology/hooks/object-live-updates.ts +53 -0
- package/src/pages/ontology/hooks/object-telemetry-updates.ts +45 -0
- package/src/pages/ontology/hooks/object-type-counts.ts +27 -0
- package/src/pages/ontology/hooks/rule-live-updates.ts +28 -0
- package/src/pages/ontology/hooks/workflow-live-updates.ts +20 -0
- package/src/pages/ontology/lib/action-params.ts +231 -0
- package/src/pages/ontology/lib/format-value.ts +34 -0
- package/src/pages/ontology/lib/labels.ts +50 -0
- package/src/pages/ontology/lib/live-update-keys.ts +62 -0
- package/src/pages/ontology/lib/object-query.ts +372 -0
- package/src/pages/ontology/lib/ontology-graph-layout.ts +1004 -0
- package/src/pages/ontology/lib/ontology-graph-links.ts +15 -0
- package/src/pages/ontology/lib/telemetry-history.ts +56 -0
- package/src/pages/ontology/lib/time.ts +23 -0
- package/src/pages/ontology/lib/user-preferences.ts +52 -0
- package/src/pages/ontology/object-page.tsx +1029 -0
- package/src/pages/ontology/object-type.tsx +910 -0
- package/src/pages/ontology/object-types.tsx +240 -0
- package/src/pages/ontology/objects.tsx +938 -0
- package/src/pages/ontology/rules.tsx +805 -0
- package/src/pages/ontology/workflow.tsx +1485 -0
- package/src/pages/ontology/workflows/agent-execution-panel.tsx +340 -0
- package/src/pages/ontology/workflows/intervention-panel.tsx +261 -0
- package/src/pages/ontology/workflows/node-execution-panel.tsx +86 -0
- package/src/pages/ontology/workflows/request-run-dialog.tsx +197 -0
- package/src/pages/ontology/workflows/run-debug-section.tsx +54 -0
- package/src/pages/ontology/workflows/run-input-form.tsx +900 -0
- package/src/pages/ontology/workflows/run-progress.tsx +83 -0
- package/src/pages/ontology/workflows/schema-shape.tsx +206 -0
- package/src/pages/ontology/workflows/status-badge.tsx +15 -0
- package/src/pages/ontology/workflows/utils.ts +107 -0
- package/src/pages/ontology/workflows/workflow-card.tsx +48 -0
- package/src/pages/ontology/workflows.tsx +143 -0
- package/src/pages/routes.ts +63 -0
- package/src/pages/section-page.tsx +272 -0
- package/src/pages/section-ui.tsx +773 -0
- package/src/pages/settings/controls.tsx +721 -0
- package/src/pages/settings/developers.tsx +163 -0
- package/src/pages/settings/members.tsx +1018 -0
- package/src/pages/settings/messages.ts +551 -0
- package/src/pages/settings/personal.tsx +97 -0
- package/src/pages/settings/service-accounts.tsx +623 -0
- package/src/pages/settings/sessions.tsx +183 -0
- package/src/pages/values.tsx +700 -0
- package/src/pages.ts +59 -0
- package/src/runtime.ts +0 -3
- package/src/sections/catalog.ts +182 -0
- package/src/sections/counts.ts +33 -0
- package/src/sections/sections.tsx +259 -0
- package/src/server.ts +19 -0
- package/src/session.ts +29 -0
- package/src/shell/agent-dock.tsx +32 -0
- package/src/shell/app-shell.tsx +142 -0
- package/src/shell/brand.tsx +47 -0
- package/src/shell/nav-items.tsx +136 -0
- package/src/shell/search-command.tsx +160 -0
- package/src/shell/section-nav.tsx +61 -0
- package/src/shell/user-menu.tsx +206 -0
- package/src/tailwind.ts +4 -4
- package/dist/agents.d.ts +0 -11
- package/dist/agents.d.ts.map +0 -1
- package/dist/agents.js +0 -41
- package/dist/agents.js.map +0 -10
- package/dist/auth.js +0 -3
- package/dist/auth.js.map +0 -9
- package/dist/browser.d.ts +0 -3
- package/dist/browser.d.ts.map +0 -1
- package/dist/browser.js +0 -9
- package/dist/browser.js.map +0 -9
- package/dist/chunk-cftmy40z.js +0 -70
- package/dist/chunk-cftmy40z.js.map +0 -10
- package/dist/chunk-e1gj8c1a.js +0 -8
- package/dist/chunk-e1gj8c1a.js.map +0 -10
- package/src/agents.ts +0 -48
- package/src/browser.ts +0 -2
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import type { WorkbookChart } from "@sixb/core/artifacts"
|
|
2
|
+
import { useLocale } from "@sixb/ui/lib/i18n"
|
|
3
|
+
import { useMemo } from "react"
|
|
4
|
+
import { chartData } from "./chart-data"
|
|
5
|
+
import type { SheetModel } from "./model"
|
|
6
|
+
|
|
7
|
+
// A chart at a glance, as a card previews it: the shape of the data in the theme's chart colors,
|
|
8
|
+
// with no axes to read. Drawn as plain SVG, so a card never loads the charting library.
|
|
9
|
+
const WIDTH = 200
|
|
10
|
+
const HEIGHT = 64
|
|
11
|
+
|
|
12
|
+
export function MiniChart({
|
|
13
|
+
chart,
|
|
14
|
+
model,
|
|
15
|
+
}: {
|
|
16
|
+
readonly chart: WorkbookChart
|
|
17
|
+
readonly model: SheetModel
|
|
18
|
+
}) {
|
|
19
|
+
const data = useMemo(() => chartData(chart, model), [chart, model])
|
|
20
|
+
if (!data) return null
|
|
21
|
+
const series = data.series.map((entry) => ({
|
|
22
|
+
color: entry.color,
|
|
23
|
+
values: data.rows.map((row) => {
|
|
24
|
+
const value = row[entry.key]
|
|
25
|
+
return typeof value === "number" ? value : null
|
|
26
|
+
}),
|
|
27
|
+
}))
|
|
28
|
+
if (chart.type === "pie") {
|
|
29
|
+
const [first] = series
|
|
30
|
+
return first ? (
|
|
31
|
+
<MiniPie labels={data.rows.map((row) => String(row.x ?? ""))} values={first.values} />
|
|
32
|
+
) : null
|
|
33
|
+
}
|
|
34
|
+
return (
|
|
35
|
+
<svg
|
|
36
|
+
viewBox={`0 0 ${WIDTH} ${HEIGHT}`}
|
|
37
|
+
preserveAspectRatio="none"
|
|
38
|
+
className="block size-full overflow-visible"
|
|
39
|
+
aria-hidden="true"
|
|
40
|
+
>
|
|
41
|
+
{chart.type === "bar" ? (
|
|
42
|
+
<Bars series={series} stacked={chart.stacked} />
|
|
43
|
+
) : (
|
|
44
|
+
<Lines series={series} area={chart.type === "area"} stacked={chart.stacked} />
|
|
45
|
+
)}
|
|
46
|
+
</svg>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface Series {
|
|
51
|
+
readonly color: string
|
|
52
|
+
readonly values: readonly (number | null)[]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function Bars({
|
|
56
|
+
series,
|
|
57
|
+
stacked,
|
|
58
|
+
}: {
|
|
59
|
+
readonly series: readonly Series[]
|
|
60
|
+
readonly stacked: boolean
|
|
61
|
+
}) {
|
|
62
|
+
const count = series[0]?.values.length ?? 0
|
|
63
|
+
if (count === 0) return null
|
|
64
|
+
const totals = Array.from({ length: count }, (_, index) =>
|
|
65
|
+
stacked
|
|
66
|
+
? series.reduce((sum, entry) => sum + Math.max(0, entry.values[index] ?? 0), 0)
|
|
67
|
+
: Math.max(0, ...series.map((entry) => entry.values[index] ?? 0))
|
|
68
|
+
)
|
|
69
|
+
const max = Math.max(...totals) || 1
|
|
70
|
+
const slot = WIDTH / count
|
|
71
|
+
const group = slot * 0.64
|
|
72
|
+
const width = stacked ? group : group / series.length
|
|
73
|
+
const y = (value: number) => HEIGHT * (1 - value / max)
|
|
74
|
+
return (
|
|
75
|
+
<>
|
|
76
|
+
{Array.from({ length: count }, (_, index) => {
|
|
77
|
+
let base = 0
|
|
78
|
+
return series.map((entry, position) => {
|
|
79
|
+
const value = Math.max(0, entry.values[index] ?? 0)
|
|
80
|
+
const x = index * slot + (slot - group) / 2 + (stacked ? 0 : position * width)
|
|
81
|
+
const top = stacked ? base + value : value
|
|
82
|
+
const rect = (
|
|
83
|
+
<rect
|
|
84
|
+
key={`${index}:${position}`}
|
|
85
|
+
x={x + (stacked ? 0 : 0.6)}
|
|
86
|
+
y={y(top)}
|
|
87
|
+
width={Math.max(0.5, width - (stacked ? 0 : 1.2))}
|
|
88
|
+
height={Math.max(0, y(stacked ? base : 0) - y(top))}
|
|
89
|
+
rx={1}
|
|
90
|
+
fill={entry.color}
|
|
91
|
+
/>
|
|
92
|
+
)
|
|
93
|
+
base = top
|
|
94
|
+
return rect
|
|
95
|
+
})
|
|
96
|
+
})}
|
|
97
|
+
</>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function Lines({
|
|
102
|
+
series,
|
|
103
|
+
area,
|
|
104
|
+
stacked,
|
|
105
|
+
}: {
|
|
106
|
+
readonly series: readonly Series[]
|
|
107
|
+
readonly area: boolean
|
|
108
|
+
readonly stacked: boolean
|
|
109
|
+
}) {
|
|
110
|
+
const count = series[0]?.values.length ?? 0
|
|
111
|
+
if (count === 0) return null
|
|
112
|
+
// Stacked areas sit on the series before them.
|
|
113
|
+
const layers = series.map((entry, position) =>
|
|
114
|
+
entry.values.map((value, index) =>
|
|
115
|
+
value === null
|
|
116
|
+
? null
|
|
117
|
+
: stacked
|
|
118
|
+
? series
|
|
119
|
+
.slice(0, position + 1)
|
|
120
|
+
.reduce((sum, layer) => sum + Math.max(0, layer.values[index] ?? 0), 0)
|
|
121
|
+
: value
|
|
122
|
+
)
|
|
123
|
+
)
|
|
124
|
+
const all = layers.flat().filter((value): value is number => value !== null)
|
|
125
|
+
if (all.length === 0) return null
|
|
126
|
+
// An area measures from zero; a line shows change, so it fits its values.
|
|
127
|
+
const low = area ? Math.min(0, ...all) : Math.min(...all)
|
|
128
|
+
const high = Math.max(...all)
|
|
129
|
+
const pad = area ? 0 : (high - low) * 0.12 || 1
|
|
130
|
+
const min = low - pad
|
|
131
|
+
const max = high + pad
|
|
132
|
+
const x = (index: number) => (count === 1 ? WIDTH / 2 : (index / (count - 1)) * WIDTH)
|
|
133
|
+
const y = (value: number) => HEIGHT * (1 - (value - min) / (max - min || 1))
|
|
134
|
+
return (
|
|
135
|
+
<>
|
|
136
|
+
{layers.map((values, position) => {
|
|
137
|
+
const color = series[position]?.color ?? "currentColor"
|
|
138
|
+
// An empty cell is a gap in the line, not a zero.
|
|
139
|
+
const runs: { index: number; value: number }[][] = [[]]
|
|
140
|
+
values.forEach((value, index) => {
|
|
141
|
+
if (value === null) runs.push([])
|
|
142
|
+
else runs.at(-1)?.push({ index, value })
|
|
143
|
+
})
|
|
144
|
+
return runs
|
|
145
|
+
.filter((run) => run.length > 0)
|
|
146
|
+
.map((run, runIndex) => {
|
|
147
|
+
const points = run.map((point) => `${x(point.index)},${y(point.value)}`).join(" ")
|
|
148
|
+
const first = run[0]
|
|
149
|
+
const last = run.at(-1)
|
|
150
|
+
return (
|
|
151
|
+
<g key={`${position}:${runIndex}`}>
|
|
152
|
+
{area && first && last ? (
|
|
153
|
+
<polygon
|
|
154
|
+
points={`${x(first.index)},${y(Math.max(min, 0))} ${points} ${x(last.index)},${y(Math.max(min, 0))}`}
|
|
155
|
+
fill={color}
|
|
156
|
+
fillOpacity={0.14}
|
|
157
|
+
/>
|
|
158
|
+
) : null}
|
|
159
|
+
<polyline
|
|
160
|
+
points={points}
|
|
161
|
+
fill="none"
|
|
162
|
+
stroke={color}
|
|
163
|
+
strokeWidth={1.75}
|
|
164
|
+
strokeLinejoin="round"
|
|
165
|
+
strokeLinecap="round"
|
|
166
|
+
vectorEffect="non-scaling-stroke"
|
|
167
|
+
/>
|
|
168
|
+
</g>
|
|
169
|
+
)
|
|
170
|
+
})
|
|
171
|
+
})}
|
|
172
|
+
</>
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** A donut of the slices, beside the largest of them with their shares. */
|
|
177
|
+
function MiniPie({
|
|
178
|
+
labels,
|
|
179
|
+
values,
|
|
180
|
+
}: {
|
|
181
|
+
readonly labels: readonly string[]
|
|
182
|
+
readonly values: readonly (number | null)[]
|
|
183
|
+
}) {
|
|
184
|
+
const locale = useLocale()
|
|
185
|
+
const slices = values
|
|
186
|
+
.map((value, index) => ({
|
|
187
|
+
label: labels[index] ?? "",
|
|
188
|
+
value: Math.max(0, value ?? 0),
|
|
189
|
+
color: `var(--chart-${(index % 5) + 1})`,
|
|
190
|
+
}))
|
|
191
|
+
.filter((slice) => slice.value > 0)
|
|
192
|
+
const total = slices.reduce((sum, slice) => sum + slice.value, 0)
|
|
193
|
+
if (total === 0) return null
|
|
194
|
+
const share = new Intl.NumberFormat(locale, { style: "percent", maximumFractionDigits: 0 })
|
|
195
|
+
const radius = 24
|
|
196
|
+
const circumference = 2 * Math.PI * radius
|
|
197
|
+
let offset = 0
|
|
198
|
+
return (
|
|
199
|
+
<span className="flex h-full items-center gap-4">
|
|
200
|
+
<svg viewBox="0 0 64 64" className="h-full max-h-16 shrink-0" aria-hidden="true">
|
|
201
|
+
<g transform="rotate(-90 32 32)">
|
|
202
|
+
{slices.map((slice) => {
|
|
203
|
+
const length = (slice.value / total) * circumference
|
|
204
|
+
const circle = (
|
|
205
|
+
<circle
|
|
206
|
+
key={slice.label}
|
|
207
|
+
cx={32}
|
|
208
|
+
cy={32}
|
|
209
|
+
r={radius}
|
|
210
|
+
fill="none"
|
|
211
|
+
stroke={slice.color}
|
|
212
|
+
strokeWidth={11}
|
|
213
|
+
strokeDasharray={`${Math.max(0, length - 1.2)} ${circumference}`}
|
|
214
|
+
strokeDashoffset={-offset}
|
|
215
|
+
/>
|
|
216
|
+
)
|
|
217
|
+
offset += length
|
|
218
|
+
return circle
|
|
219
|
+
})}
|
|
220
|
+
</g>
|
|
221
|
+
</svg>
|
|
222
|
+
<span className="flex min-w-0 flex-1 flex-col gap-0.5 text-[11px] leading-4">
|
|
223
|
+
{[...slices]
|
|
224
|
+
.sort((a, b) => b.value - a.value)
|
|
225
|
+
.slice(0, 3)
|
|
226
|
+
.map((slice) => (
|
|
227
|
+
<span key={slice.label} className="flex min-w-0 items-center gap-1.5">
|
|
228
|
+
<span
|
|
229
|
+
className="size-1.5 shrink-0 rounded-full"
|
|
230
|
+
style={{ background: slice.color }}
|
|
231
|
+
/>
|
|
232
|
+
<span className="min-w-0 flex-1 truncate text-muted-foreground">{slice.label}</span>
|
|
233
|
+
<span className="text-foreground tabular-nums">
|
|
234
|
+
{share.format(slice.value / total)}
|
|
235
|
+
</span>
|
|
236
|
+
</span>
|
|
237
|
+
))}
|
|
238
|
+
</span>
|
|
239
|
+
</span>
|
|
240
|
+
)
|
|
241
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type CsvTable,
|
|
3
|
+
NUMERIC_COLUMN_TYPES,
|
|
4
|
+
parseSheetNumber,
|
|
5
|
+
type SheetColumnFormat,
|
|
6
|
+
type WorkbookSheet,
|
|
7
|
+
} from "@sixb/core/artifacts"
|
|
8
|
+
|
|
9
|
+
/** One column as the grid draws it. */
|
|
10
|
+
export interface SheetColumn {
|
|
11
|
+
readonly name: string
|
|
12
|
+
readonly format: SheetColumnFormat
|
|
13
|
+
readonly numeric: boolean
|
|
14
|
+
/** Digits after the decimal point: the format's, else as many as the column's values need. */
|
|
15
|
+
readonly decimals: number
|
|
16
|
+
readonly width: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** A sheet ready to draw: its columns, and its data rows each as wide as the columns. */
|
|
20
|
+
export interface SheetModel {
|
|
21
|
+
readonly name: string
|
|
22
|
+
readonly columns: readonly SheetColumn[]
|
|
23
|
+
readonly rows: readonly (readonly string[])[]
|
|
24
|
+
/** Grid rows that stay in view, the header row included. */
|
|
25
|
+
readonly frozenRows: number
|
|
26
|
+
readonly frozenColumns: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type SheetLayout = Pick<
|
|
30
|
+
WorkbookSheet,
|
|
31
|
+
"name" | "frozenRows" | "frozenColumns" | "columns" | "widths"
|
|
32
|
+
>
|
|
33
|
+
|
|
34
|
+
/** A sheet of a workbook, laid out as its workbook says. */
|
|
35
|
+
export function sheetModel(sheet: SheetLayout, table: CsvTable): SheetModel {
|
|
36
|
+
const columns = table.header.map((name, index) => {
|
|
37
|
+
const format = sheet.columns[name] ?? { type: "text" as const }
|
|
38
|
+
return column(name, format, table.rows, index, sheet.widths[name])
|
|
39
|
+
})
|
|
40
|
+
return {
|
|
41
|
+
name: sheet.name,
|
|
42
|
+
columns,
|
|
43
|
+
rows: table.rows.map((row) => pad(row, columns.length)),
|
|
44
|
+
frozenRows: Math.min(sheet.frozenRows, table.rows.length + 1),
|
|
45
|
+
frozenColumns: Math.min(sheet.frozenColumns, columns.length),
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A plain CSV file as a sheet: a column whose values are all numbers reads as numbers, any other
|
|
51
|
+
* as text, and rows longer than the header add unnamed columns.
|
|
52
|
+
*/
|
|
53
|
+
export function fileSheetModel(name: string, table: CsvTable): SheetModel {
|
|
54
|
+
// A loop, not a spread: a long file's rows are more arguments than a call can take.
|
|
55
|
+
let width = table.header.length
|
|
56
|
+
for (const row of table.rows) width = Math.max(width, row.length)
|
|
57
|
+
const header = Array.from({ length: width }, (_, index) => table.header[index] ?? "")
|
|
58
|
+
const columns = header.map((columnName, index) => {
|
|
59
|
+
const values = table.rows.map((row) => row[index] ?? "").filter((value) => value.trim())
|
|
60
|
+
const numeric =
|
|
61
|
+
values.length > 0 && values.every((value) => parseSheetNumber(value) !== undefined)
|
|
62
|
+
return column(columnName, { type: numeric ? "number" : "text" }, table.rows, index, undefined)
|
|
63
|
+
})
|
|
64
|
+
return {
|
|
65
|
+
name,
|
|
66
|
+
columns,
|
|
67
|
+
rows: table.rows.map((row) => pad(row, width)),
|
|
68
|
+
frozenRows: 1,
|
|
69
|
+
frozenColumns: 0,
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const SAMPLE_ROWS = 200
|
|
74
|
+
const CHARACTER_WIDTH = 7.4
|
|
75
|
+
const HEADER_CHARACTER_WIDTH = 7.8
|
|
76
|
+
const MIN_WIDTH = 72
|
|
77
|
+
const MAX_WIDTH = 320
|
|
78
|
+
|
|
79
|
+
function column(
|
|
80
|
+
name: string,
|
|
81
|
+
format: SheetColumnFormat,
|
|
82
|
+
rows: readonly (readonly string[])[],
|
|
83
|
+
index: number,
|
|
84
|
+
width: number | undefined
|
|
85
|
+
): SheetColumn {
|
|
86
|
+
const numeric = NUMERIC_COLUMN_TYPES.includes(format.type)
|
|
87
|
+
const sample = rows.slice(0, SAMPLE_ROWS).map((row) => row[index] ?? "")
|
|
88
|
+
return {
|
|
89
|
+
name,
|
|
90
|
+
format,
|
|
91
|
+
numeric,
|
|
92
|
+
decimals: format.decimals ?? (numeric ? neededDecimals(sample, format.type) : 0),
|
|
93
|
+
width: width ?? estimatedWidth(name, sample, format),
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** As many decimals as the values carry, capped where more would be noise. */
|
|
98
|
+
function neededDecimals(values: readonly string[], type: SheetColumnFormat["type"]): number {
|
|
99
|
+
const cap = type === "number" ? 4 : 2
|
|
100
|
+
let decimals = 0
|
|
101
|
+
for (const value of values) {
|
|
102
|
+
const number = parseSheetNumber(value)
|
|
103
|
+
if (number === undefined) continue
|
|
104
|
+
const scaled = type === "percent" ? number * 100 : number
|
|
105
|
+
const text = String(Math.abs(Number(scaled.toFixed(cap))))
|
|
106
|
+
const point = text.indexOf(".")
|
|
107
|
+
if (point >= 0) decimals = Math.max(decimals, text.length - point - 1)
|
|
108
|
+
if (decimals === cap) break
|
|
109
|
+
}
|
|
110
|
+
return decimals
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** A width that fits the header and most values without measuring text. */
|
|
114
|
+
function estimatedWidth(
|
|
115
|
+
name: string,
|
|
116
|
+
sample: readonly string[],
|
|
117
|
+
format: SheetColumnFormat
|
|
118
|
+
): number {
|
|
119
|
+
// Formatting adds currency signs, grouping, and month names.
|
|
120
|
+
const extra =
|
|
121
|
+
format.type === "currency" ? 4 : format.type === "number" || format.type === "date" ? 2 : 0
|
|
122
|
+
const longest = Math.max(
|
|
123
|
+
...sample.map((value) => value.length + extra),
|
|
124
|
+
format.type === "image" ? 4 : 0
|
|
125
|
+
)
|
|
126
|
+
// The header is semibold, beside its type glyph and sort control.
|
|
127
|
+
const header = name.length * HEADER_CHARACTER_WIDTH + (format.type === "text" ? 0 : 18) + 54
|
|
128
|
+
const values = longest * CHARACTER_WIDTH + 28
|
|
129
|
+
return Math.round(Math.min(MAX_WIDTH, Math.max(MIN_WIDTH, header, values)))
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function pad(row: readonly string[], width: number): readonly string[] {
|
|
133
|
+
return row.length >= width
|
|
134
|
+
? row
|
|
135
|
+
: [...row, ...Array.from({ length: width - row.length }, () => "")]
|
|
136
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { parseSheetNumber } from "@sixb/core/artifacts"
|
|
2
|
+
import type { SheetModel } from "./model"
|
|
3
|
+
|
|
4
|
+
// Grid coordinates: row 0 is the header row, row 1 the first data row as currently ordered;
|
|
5
|
+
// column 0 is the sheet's first column. A1 names count rows from 1, so grid row 0 is row 1.
|
|
6
|
+
|
|
7
|
+
export interface CellPoint {
|
|
8
|
+
readonly row: number
|
|
9
|
+
readonly column: number
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface CellRange {
|
|
13
|
+
readonly top: number
|
|
14
|
+
readonly left: number
|
|
15
|
+
readonly bottom: number
|
|
16
|
+
readonly right: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function cellRange(anchor: CellPoint, focus: CellPoint): CellRange {
|
|
20
|
+
return {
|
|
21
|
+
top: Math.min(anchor.row, focus.row),
|
|
22
|
+
left: Math.min(anchor.column, focus.column),
|
|
23
|
+
bottom: Math.max(anchor.row, focus.row),
|
|
24
|
+
right: Math.max(anchor.column, focus.column),
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function inRange(range: CellRange, row: number, column: number): boolean {
|
|
29
|
+
return row >= range.top && row <= range.bottom && column >= range.left && column <= range.right
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** `A`, `Z`, `AA`, `AB`… */
|
|
33
|
+
export function columnLetter(index: number): string {
|
|
34
|
+
let letters = ""
|
|
35
|
+
for (let rest = index + 1; rest > 0; rest = Math.floor((rest - 1) / 26)) {
|
|
36
|
+
letters = String.fromCharCode(65 + ((rest - 1) % 26)) + letters
|
|
37
|
+
}
|
|
38
|
+
return letters
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** `B2`, or `B2:D5` for more than one cell. */
|
|
42
|
+
export function rangeLabel(range: CellRange): string {
|
|
43
|
+
const start = `${columnLetter(range.left)}${range.top + 1}`
|
|
44
|
+
const end = `${columnLetter(range.right)}${range.bottom + 1}`
|
|
45
|
+
return start === end ? start : `${start}:${end}`
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface RangeStats {
|
|
49
|
+
/** Cells with a value. */
|
|
50
|
+
readonly count: number
|
|
51
|
+
/** Cells of numeric columns that hold a number; the sum and average are theirs. */
|
|
52
|
+
readonly numericCount: number
|
|
53
|
+
readonly sum: number
|
|
54
|
+
readonly average?: number
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** What a spreadsheet's status bar says about a selection. Header cells are labels, not values. */
|
|
58
|
+
export function rangeStats(
|
|
59
|
+
range: CellRange,
|
|
60
|
+
model: SheetModel,
|
|
61
|
+
order: readonly number[]
|
|
62
|
+
): RangeStats {
|
|
63
|
+
let count = 0
|
|
64
|
+
let numericCount = 0
|
|
65
|
+
let sum = 0
|
|
66
|
+
for (let row = Math.max(range.top, 1); row <= range.bottom; row += 1) {
|
|
67
|
+
const values = model.rows[order[row - 1] ?? -1]
|
|
68
|
+
if (!values) continue
|
|
69
|
+
for (let column = range.left; column <= range.right; column += 1) {
|
|
70
|
+
const value = values[column] ?? ""
|
|
71
|
+
if (!value.trim()) continue
|
|
72
|
+
count += 1
|
|
73
|
+
if (!model.columns[column]?.numeric) continue
|
|
74
|
+
const number = parseSheetNumber(value)
|
|
75
|
+
if (number === undefined) continue
|
|
76
|
+
numericCount += 1
|
|
77
|
+
sum += number
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { count, numericCount, sum, ...(numericCount > 0 ? { average: sum / numericCount } : {}) }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The selection as tab-separated values, the shape every spreadsheet pastes. */
|
|
84
|
+
export function rangeTsv(range: CellRange, model: SheetModel, order: readonly number[]): string {
|
|
85
|
+
const lines: string[] = []
|
|
86
|
+
for (let row = range.top; row <= range.bottom; row += 1) {
|
|
87
|
+
const values =
|
|
88
|
+
row === 0 ? model.columns.map((column) => column.name) : model.rows[order[row - 1] ?? -1]
|
|
89
|
+
if (!values) continue
|
|
90
|
+
lines.push(
|
|
91
|
+
values
|
|
92
|
+
.slice(range.left, range.right + 1)
|
|
93
|
+
.map((value) => value.replace(/[\t\r\n]+/g, " "))
|
|
94
|
+
.join("\t")
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
return lines.join("\n")
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type MoveKey = "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "Home" | "End"
|
|
101
|
+
|
|
102
|
+
/** Where a key moves the focus cell; `jump` goes to the edge, as with Cmd or Ctrl held. */
|
|
103
|
+
export function moveFocus(
|
|
104
|
+
point: CellPoint,
|
|
105
|
+
key: MoveKey,
|
|
106
|
+
bounds: { readonly rows: number; readonly columns: number },
|
|
107
|
+
jump = false
|
|
108
|
+
): CellPoint {
|
|
109
|
+
const lastRow = bounds.rows - 1
|
|
110
|
+
const lastColumn = bounds.columns - 1
|
|
111
|
+
switch (key) {
|
|
112
|
+
case "ArrowUp":
|
|
113
|
+
return { ...point, row: jump ? 0 : Math.max(0, point.row - 1) }
|
|
114
|
+
case "ArrowDown":
|
|
115
|
+
return { ...point, row: jump ? lastRow : Math.min(lastRow, point.row + 1) }
|
|
116
|
+
case "ArrowLeft":
|
|
117
|
+
return { ...point, column: jump ? 0 : Math.max(0, point.column - 1) }
|
|
118
|
+
case "ArrowRight":
|
|
119
|
+
return { ...point, column: jump ? lastColumn : Math.min(lastColumn, point.column + 1) }
|
|
120
|
+
case "Home":
|
|
121
|
+
return jump ? { row: 0, column: 0 } : { ...point, column: 0 }
|
|
122
|
+
case "End":
|
|
123
|
+
return jump ? { row: lastRow, column: lastColumn } : { ...point, column: lastColumn }
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type SortDirection = "ascending" | "descending"
|
|
128
|
+
|
|
129
|
+
/** The order of the data rows sorted by one column: numbers as numbers, the rest as text. */
|
|
130
|
+
export function sortedOrder(
|
|
131
|
+
model: SheetModel,
|
|
132
|
+
sort: { readonly column: number; readonly direction: SortDirection } | null,
|
|
133
|
+
locale: string
|
|
134
|
+
): number[] {
|
|
135
|
+
const order = model.rows.map((_, index) => index)
|
|
136
|
+
if (!sort) return order
|
|
137
|
+
const column = model.columns[sort.column]
|
|
138
|
+
const collator = new Intl.Collator(locale, { numeric: true, sensitivity: "base" })
|
|
139
|
+
const key = (index: number) => model.rows[index]?.[sort.column] ?? ""
|
|
140
|
+
const sign = sort.direction === "ascending" ? 1 : -1
|
|
141
|
+
return order.sort((a, b) => {
|
|
142
|
+
const left = key(a)
|
|
143
|
+
const right = key(b)
|
|
144
|
+
// Empty cells go last whichever way the column sorts.
|
|
145
|
+
if (!left.trim() || !right.trim()) return (left.trim() ? 0 : 1) - (right.trim() ? 0 : 1)
|
|
146
|
+
if (column?.numeric) {
|
|
147
|
+
const difference = (parseSheetNumber(left) ?? 0) - (parseSheetNumber(right) ?? 0)
|
|
148
|
+
if (difference !== 0) return sign * difference
|
|
149
|
+
}
|
|
150
|
+
return sign * collator.compare(left, right) || a - b
|
|
151
|
+
})
|
|
152
|
+
}
|