@sixb/app 0.2.1 → 0.2.4
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/agent/activity-label.d.ts.map +1 -1
- package/dist/agent/agent-chat.d.ts +9 -2
- package/dist/agent/agent-chat.d.ts.map +1 -1
- package/dist/agent/agent-panel.d.ts +9 -1
- package/dist/agent/agent-panel.d.ts.map +1 -1
- package/dist/agent/agent-surface.d.ts.map +1 -1
- package/dist/agent/artifact-card.d.ts +3 -1
- package/dist/agent/artifact-card.d.ts.map +1 -1
- package/dist/agent/artifact-panel.d.ts +7 -1
- package/dist/agent/artifact-panel.d.ts.map +1 -1
- package/dist/agent/background/background-tool-row.d.ts.map +1 -1
- package/dist/agent/background/interpret.d.ts +1 -1
- package/dist/agent/background/interpret.d.ts.map +1 -1
- package/dist/agent/components/composer-place.d.ts +3 -1
- package/dist/agent/components/composer-place.d.ts.map +1 -1
- package/dist/agent/components/composer.d.ts +20 -1
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/context-chips.d.ts.map +1 -1
- package/dist/agent/components/context-meter.d.ts +1 -1
- package/dist/agent/components/conversation-panel.d.ts +7 -2
- package/dist/agent/components/conversation-panel.d.ts.map +1 -1
- package/dist/agent/components/message-parts.d.ts +3 -1
- package/dist/agent/components/message-parts.d.ts.map +1 -1
- package/dist/agent/components/thread-artifacts-menu.d.ts.map +1 -1
- package/dist/agent/components/transcript.d.ts +5 -0
- package/dist/agent/components/transcript.d.ts.map +1 -1
- package/dist/agent/composer-insertion.d.ts +24 -0
- package/dist/agent/composer-insertion.d.ts.map +1 -0
- package/dist/agent/delegation/agent-exchange.d.ts +16 -0
- package/dist/agent/delegation/agent-exchange.d.ts.map +1 -0
- package/dist/agent/delegation/child-card.d.ts +3 -3
- package/dist/agent/delegation/child-card.d.ts.map +1 -1
- package/dist/agent/delegation/child-parts.d.ts +1 -10
- package/dist/agent/delegation/child-parts.d.ts.map +1 -1
- package/dist/agent/delegation/child-work.d.ts.map +1 -1
- package/dist/agent/delegation/interpret.d.ts +4 -10
- package/dist/agent/delegation/interpret.d.ts.map +1 -1
- package/dist/agent/delegation/use-children.d.ts +5 -5
- package/dist/agent/delegation/use-children.d.ts.map +1 -1
- package/dist/agent/file-edits/file-edit-tool-view.d.ts +10 -0
- package/dist/agent/file-edits/file-edit-tool-view.d.ts.map +1 -0
- package/dist/agent/file-edits/interpret.d.ts +25 -0
- package/dist/agent/file-edits/interpret.d.ts.map +1 -0
- package/dist/agent/hooks/use-agent-conversation.d.ts +16 -4
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-new-thread-place.d.ts +39 -17
- package/dist/agent/hooks/use-new-thread-place.d.ts.map +1 -1
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +59 -4
- package/dist/agent/i18n/en.d.ts.map +1 -1
- package/dist/agent/i18n/fr.d.ts.map +1 -1
- package/dist/agent/i18n/index.d.ts +96 -8
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/message-agent/interpret.d.ts +2 -2
- package/dist/agent/message-agent/interpret.d.ts.map +1 -1
- package/dist/agent/publish-artifact/interpret.d.ts +8 -2
- package/dist/agent/publish-artifact/interpret.d.ts.map +1 -1
- package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts +9 -0
- package/dist/agent/publish-artifact/open-artifact-tool-view.d.ts.map +1 -0
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts +4 -2
- package/dist/agent/publish-artifact/publish-artifact-tool-view.d.ts.map +1 -1
- package/dist/agent/publish-artifact/use-live-publishes.d.ts +3 -3
- package/dist/agent/publish-artifact/use-live-publishes.d.ts.map +1 -1
- package/dist/agent/questions/interpret.d.ts +31 -0
- package/dist/agent/questions/interpret.d.ts.map +1 -0
- package/dist/agent/questions/question-card.d.ts +16 -0
- package/dist/agent/questions/question-card.d.ts.map +1 -0
- package/dist/agent/questions/question-composer.d.ts +15 -0
- package/dist/agent/questions/question-composer.d.ts.map +1 -0
- package/dist/agent/read/interpret.d.ts +8 -1
- package/dist/agent/read/interpret.d.ts.map +1 -1
- package/dist/agent/read/read-tool-view.d.ts.map +1 -1
- package/dist/agent/tool-views/built-in.d.ts.map +1 -1
- package/dist/agent/types.d.ts +3 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/waits.d.ts +14 -0
- package/dist/agent/waits.d.ts.map +1 -0
- package/dist/artifacts/artifact-page.d.ts.map +1 -1
- package/dist/artifacts/artifact-viewer.d.ts +16 -0
- package/dist/artifacts/artifact-viewer.d.ts.map +1 -0
- package/dist/artifacts/card-details.d.ts +1 -1
- package/dist/artifacts/card-details.d.ts.map +1 -1
- package/dist/artifacts/card-preview.d.ts.map +1 -1
- package/dist/artifacts/comments-context.d.ts +48 -0
- package/dist/artifacts/comments-context.d.ts.map +1 -0
- package/dist/artifacts/edit-session.d.ts +17 -7
- package/dist/artifacts/edit-session.d.ts.map +1 -1
- package/dist/artifacts/file-source.d.ts.map +1 -1
- package/dist/artifacts/frame.d.ts +10 -2
- package/dist/artifacts/frame.d.ts.map +1 -1
- package/dist/artifacts/guest-badge.d.ts +8 -0
- package/dist/artifacts/guest-badge.d.ts.map +1 -0
- package/dist/artifacts/held-artifact.d.ts +19 -0
- package/dist/artifacts/held-artifact.d.ts.map +1 -0
- package/dist/artifacts/holders.d.ts +10 -0
- package/dist/artifacts/holders.d.ts.map +1 -0
- package/dist/artifacts/live/boards.d.ts +15 -0
- package/dist/artifacts/live/boards.d.ts.map +1 -0
- package/dist/artifacts/live/canvas.d.ts +79 -0
- package/dist/artifacts/live/canvas.d.ts.map +1 -0
- package/dist/artifacts/live/header.d.ts +29 -0
- package/dist/artifacts/live/header.d.ts.map +1 -0
- package/dist/artifacts/live/hooks.d.ts +21 -0
- package/dist/artifacts/live/hooks.d.ts.map +1 -0
- package/dist/artifacts/live/presence.d.ts +32 -0
- package/dist/artifacts/live/presence.d.ts.map +1 -0
- package/dist/artifacts/live/session.d.ts +130 -0
- package/dist/artifacts/live/session.d.ts.map +1 -0
- package/dist/artifacts/live/view.d.ts +28 -0
- package/dist/artifacts/live/view.d.ts.map +1 -0
- package/dist/artifacts/messages.d.ts +476 -14
- package/dist/artifacts/messages.d.ts.map +1 -1
- package/dist/artifacts/page-queries.d.ts +2 -2
- package/dist/artifacts/page-queries.d.ts.map +1 -1
- package/dist/artifacts/page-state.d.ts.map +1 -1
- package/dist/artifacts/publish-edit.d.ts +24 -14
- package/dist/artifacts/publish-edit.d.ts.map +1 -1
- package/dist/artifacts/queries.d.ts +490 -9
- package/dist/artifacts/queries.d.ts.map +1 -1
- package/dist/artifacts/references/references.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/arrows.d.ts +0 -18
- package/dist/artifacts/renderers/canvas/arrows.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/board-editor.d.ts +50 -0
- package/dist/artifacts/renderers/canvas/board-editor.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board-properties.d.ts +37 -0
- package/dist/artifacts/renderers/canvas/board-properties.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board-source.d.ts +18 -0
- package/dist/artifacts/renderers/canvas/board-source.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/board.d.ts +77 -20
- package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/canvas.d.ts +14 -4
- package/dist/artifacts/renderers/canvas/canvas.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts +84 -0
- package/dist/artifacts/renderers/canvas/comment-pins.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/commenting.d.ts +58 -0
- package/dist/artifacts/renderers/canvas/commenting.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts +27 -0
- package/dist/artifacts/renderers/canvas/comments-panel.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/comments.d.ts +56 -0
- package/dist/artifacts/renderers/canvas/comments.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/controls.d.ts +15 -4
- package/dist/artifacts/renderers/canvas/controls.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/draft.d.ts +7 -6
- package/dist/artifacts/renderers/canvas/draft.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts +19 -2
- package/dist/artifacts/renderers/canvas/edit-mode.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/focus.d.ts +54 -5
- package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/gestures.d.ts +46 -0
- package/dist/artifacts/renderers/canvas/gestures.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/items.d.ts +47 -4
- package/dist/artifacts/renderers/canvas/items.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/layout.d.ts +5 -8
- package/dist/artifacts/renderers/canvas/layout.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/page-resize.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/page-resize.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-size-controls.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/page-size-controls.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-size.d.ts +93 -0
- package/dist/artifacts/renderers/canvas/page-size.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/page-zoom.d.ts +64 -0
- package/dist/artifacts/renderers/canvas/page-zoom.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/presence.d.ts +21 -0
- package/dist/artifacts/renderers/canvas/presence.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/previews.d.ts +54 -0
- package/dist/artifacts/renderers/canvas/previews.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/renderer.d.ts +11 -2
- package/dist/artifacts/renderers/canvas/renderer.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/shown-size.d.ts +26 -0
- package/dist/artifacts/renderers/canvas/shown-size.d.ts.map +1 -0
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts +5 -2
- package/dist/artifacts/renderers/canvas/thumbnail.d.ts.map +1 -1
- package/dist/artifacts/version-menu.d.ts +19 -0
- package/dist/artifacts/version-menu.d.ts.map +1 -0
- package/dist/artifacts/view-context.d.ts +43 -0
- package/dist/artifacts/view-context.d.ts.map +1 -0
- package/dist/artifacts/viewer.d.ts.map +1 -1
- package/dist/build.d.ts +5 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/chunk-00wggsst.js +7 -0
- package/dist/chunk-00wggsst.js.map +10 -0
- package/dist/{chunk-q69001w3.js → chunk-694m74s7.js} +7 -1
- package/dist/{chunk-q69001w3.js.map → chunk-694m74s7.js.map} +3 -3
- package/dist/{chunk-7fj9cfkw.js → chunk-970s5nkn.js} +1 -1
- package/dist/{chunk-4mprsd2n.js → chunk-fg6thecb.js} +25 -1
- package/dist/chunk-fg6thecb.js.map +10 -0
- package/dist/{chunk-ytadd0b5.js → chunk-kymx9y5e.js} +8126 -4257
- package/dist/chunk-kymx9y5e.js.map +211 -0
- package/dist/{chunk-j8g956dt.js → chunk-pxd07kvx.js} +1 -1
- package/dist/{chunk-kwbw4dyk.js → chunk-ryed2jq8.js} +1 -1
- package/dist/chunk-yrcm1pbg.js +5975 -0
- package/dist/chunk-yrcm1pbg.js.map +34 -0
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +932 -309
- package/dist/index.js.map +15 -10
- package/dist/locale-messages.d.ts +12 -0
- package/dist/locale-messages.d.ts.map +1 -1
- package/dist/locale.d.ts +12 -0
- package/dist/locale.d.ts.map +1 -1
- package/dist/locale.js +1 -1
- package/dist/metadata.d.ts +8 -0
- package/dist/metadata.d.ts.map +1 -1
- package/dist/pages/console/action-run.d.ts.map +1 -1
- package/dist/pages/console/data/connectors.d.ts.map +1 -1
- package/dist/pages/console/data/datasets.d.ts.map +1 -1
- package/dist/pages/console/data/lake-health.d.ts +3 -0
- package/dist/pages/console/data/lake-health.d.ts.map +1 -0
- package/dist/pages/console/data/messages.d.ts +98 -2
- package/dist/pages/console/data/messages.d.ts.map +1 -1
- package/dist/pages/console/data/pipelines.d.ts.map +1 -1
- package/dist/pages/console/data/projections.d.ts.map +1 -1
- package/dist/pages/console/data/syncs.d.ts.map +1 -1
- package/dist/pages/console/ontology/action-runs.d.ts.map +1 -1
- package/dist/pages/console/ontology/actions.d.ts.map +1 -1
- package/dist/pages/console/ontology/components/action-button.d.ts.map +1 -1
- package/dist/pages/console/ontology/components/artifact-picker.d.ts +36 -0
- package/dist/pages/console/ontology/components/artifact-picker.d.ts.map +1 -0
- package/dist/pages/console/ontology/components/object-query-bar.d.ts.map +1 -1
- package/dist/pages/console/ontology/lib/action-params.d.ts +2 -0
- package/dist/pages/console/ontology/lib/action-params.d.ts.map +1 -1
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts +2 -1
- package/dist/pages/console/ontology/lineage/properties-panel.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-page.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-type.d.ts.map +1 -1
- package/dist/pages/console/ontology/object-types.d.ts.map +1 -1
- package/dist/pages/console/ontology/objects.d.ts.map +1 -1
- package/dist/pages/console/ontology/rules.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflow.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows/run-input-form.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows/schema-shape.d.ts.map +1 -1
- package/dist/pages/console/ontology/workflows.d.ts.map +1 -1
- package/dist/pages/console/skeletons.d.ts +30 -0
- package/dist/pages/console/skeletons.d.ts.map +1 -0
- package/dist/pages/console/workflow-run.d.ts.map +1 -1
- package/dist/pages/section-page.d.ts +11 -1
- package/dist/pages/section-page.d.ts.map +1 -1
- package/dist/pages/section-ui.d.ts +25 -3
- package/dist/pages/section-ui.d.ts.map +1 -1
- package/dist/pages/settings/activity/calendar.d.ts.map +1 -1
- package/dist/pages/settings/activity/connections.d.ts.map +1 -1
- package/dist/pages/settings/activity/page.d.ts.map +1 -1
- package/dist/pages/settings/activity/thread.d.ts.map +1 -1
- package/dist/pages/settings/activity/timeline.d.ts +2 -0
- package/dist/pages/settings/activity/timeline.d.ts.map +1 -1
- package/dist/pages/settings/controls.d.ts +4 -0
- package/dist/pages/settings/controls.d.ts.map +1 -1
- package/dist/pages/settings/members.d.ts.map +1 -1
- package/dist/pages/settings/memory-history.d.ts +2 -0
- package/dist/pages/settings/memory-history.d.ts.map +1 -1
- package/dist/pages/settings/memory.d.ts.map +1 -1
- package/dist/pages/settings/service-accounts.d.ts.map +1 -1
- package/dist/pages/settings/sessions.d.ts.map +1 -1
- package/dist/pages/settings/usage/breakdown.d.ts.map +1 -1
- package/dist/pages/settings/usage/limits.d.ts.map +1 -1
- package/dist/pages/settings/usage/messages.d.ts +0 -2
- package/dist/pages/settings/usage/messages.d.ts.map +1 -1
- package/dist/pages/settings/usage/runs.d.ts +8 -2
- package/dist/pages/settings/usage/runs.d.ts.map +1 -1
- package/dist/pages/settings/usage/spend-chart.d.ts.map +1 -1
- package/dist/pages/settings/usage/spend-model.d.ts +5 -0
- package/dist/pages/settings/usage/spend-model.d.ts.map +1 -1
- package/dist/pages/values.d.ts +6 -0
- package/dist/pages/values.d.ts.map +1 -1
- package/dist/pages.d.ts +4 -0
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +8188 -4841
- package/dist/pages.js.map +56 -47
- package/dist/sections/catalog.d.ts.map +1 -1
- package/dist/sections/sections.d.ts.map +1 -1
- package/dist/server.js +294 -23
- package/dist/server.js.map +8 -7
- package/dist/service-worker.d.ts +39 -0
- package/dist/service-worker.d.ts.map +1 -0
- package/dist/shared-session.d.ts +25 -0
- package/dist/shared-session.d.ts.map +1 -0
- package/dist/shell/app-return.d.ts +35 -0
- package/dist/shell/app-return.d.ts.map +1 -0
- package/dist/shell/app-shell.d.ts +1 -1
- package/dist/shell/app-shell.d.ts.map +1 -1
- package/dist/shell/nav-items.d.ts +2 -0
- package/dist/shell/nav-items.d.ts.map +1 -1
- package/dist/shell/phone/back.d.ts +6 -0
- package/dist/shell/phone/back.d.ts.map +1 -0
- package/dist/shell/phone/launch.d.ts +7 -0
- package/dist/shell/phone/launch.d.ts.map +1 -0
- package/dist/shell/phone/more-sheet.d.ts +36 -0
- package/dist/shell/phone/more-sheet.d.ts.map +1 -0
- package/dist/shell/phone/phone-foundations.d.ts +9 -0
- package/dist/shell/phone/phone-foundations.d.ts.map +1 -0
- package/dist/shell/phone/pull-to-refresh.d.ts +9 -0
- package/dist/shell/phone/pull-to-refresh.d.ts.map +1 -0
- package/dist/shell/phone/routes.d.ts +12 -0
- package/dist/shell/phone/routes.d.ts.map +1 -0
- package/dist/shell/phone/screen-motion.d.ts +11 -0
- package/dist/shell/phone/screen-motion.d.ts.map +1 -0
- package/dist/shell/phone/scroll-restoration.d.ts +7 -0
- package/dist/shell/phone/scroll-restoration.d.ts.map +1 -0
- package/dist/shell/phone/startup-image.d.ts +17 -0
- package/dist/shell/phone/startup-image.d.ts.map +1 -0
- package/dist/shell/phone/tab-bar.d.ts +14 -0
- package/dist/shell/phone/tab-bar.d.ts.map +1 -0
- package/dist/shell/phone/top-bar.d.ts +24 -0
- package/dist/shell/phone/top-bar.d.ts.map +1 -0
- package/dist/shell/search-command.d.ts +3 -1
- package/dist/shell/search-command.d.ts.map +1 -1
- package/dist/shell/user-menu.d.ts +2 -0
- package/dist/shell/user-menu.d.ts.map +1 -1
- package/package.json +8 -5
- package/src/agent/activity-label.ts +6 -1
- package/src/agent/agent-chat.tsx +52 -8
- package/src/agent/agent-panel.tsx +12 -0
- package/src/agent/agent-surface.tsx +4 -0
- package/src/agent/artifact-card.tsx +84 -16
- package/src/agent/artifact-panel.tsx +63 -43
- package/src/agent/background/background-tool-row.tsx +24 -10
- package/src/agent/background/interpret.ts +60 -51
- package/src/agent/components/agent-message-body.tsx +1 -1
- package/src/agent/components/composer-place.tsx +77 -53
- package/src/agent/components/composer.tsx +92 -7
- package/src/agent/components/context-chips.tsx +72 -2
- package/src/agent/components/conversation-panel.tsx +30 -10
- package/src/agent/components/message-parts.tsx +29 -6
- package/src/agent/components/thread-artifacts-menu.tsx +22 -5
- package/src/agent/components/transcript.tsx +45 -27
- package/src/agent/composer-insertion.ts +36 -0
- package/src/agent/delegation/agent-exchange.tsx +53 -0
- package/src/agent/delegation/child-card.tsx +6 -40
- package/src/agent/delegation/child-parts.tsx +1 -84
- package/src/agent/delegation/child-work.tsx +19 -5
- package/src/agent/delegation/interpret.ts +33 -54
- package/src/agent/delegation/model.ts +1 -1
- package/src/agent/file-edits/file-edit-tool-view.tsx +126 -0
- package/src/agent/file-edits/interpret.ts +120 -0
- package/src/agent/hooks/use-agent-conversation.ts +61 -10
- package/src/agent/hooks/use-new-thread-place.ts +149 -25
- package/src/agent/i18n/en.ts +60 -4
- package/src/agent/i18n/fr.ts +51 -4
- package/src/agent/message-agent/interpret.ts +4 -3
- package/src/agent/publish-artifact/interpret.ts +37 -6
- package/src/agent/publish-artifact/open-artifact-tool-view.tsx +49 -0
- package/src/agent/publish-artifact/publish-artifact-tool-view.tsx +14 -8
- package/src/agent/publish-artifact/use-live-publishes.ts +7 -11
- package/src/agent/questions/interpret.ts +90 -0
- package/src/agent/questions/question-card.tsx +57 -0
- package/src/agent/questions/question-composer.tsx +257 -0
- package/src/agent/react-router.tsx +2 -2
- package/src/agent/read/interpret.ts +34 -1
- package/src/agent/read/read-tool-view.tsx +20 -4
- package/src/agent/tool-views/built-in.tsx +22 -8
- package/src/agent/types.ts +4 -0
- package/src/agent/waits.ts +50 -0
- package/src/artifacts/artifact-page.tsx +42 -17
- package/src/artifacts/artifact-viewer.tsx +56 -0
- package/src/artifacts/artifacts.css +116 -0
- package/src/artifacts/card-details.ts +2 -2
- package/src/artifacts/card-preview.tsx +17 -3
- package/src/artifacts/comments-context.ts +125 -0
- package/src/artifacts/edit-session.tsx +21 -7
- package/src/artifacts/file-source.ts +10 -3
- package/src/artifacts/frame.tsx +53 -14
- package/src/artifacts/gallery.tsx +9 -11
- package/src/artifacts/guest-badge.tsx +21 -0
- package/src/artifacts/held-artifact.tsx +241 -0
- package/src/artifacts/holders.tsx +170 -0
- package/src/artifacts/live/boards.ts +95 -0
- package/src/artifacts/live/canvas.ts +402 -0
- package/src/artifacts/live/header.tsx +137 -0
- package/src/artifacts/live/hooks.ts +94 -0
- package/src/artifacts/live/presence.ts +147 -0
- package/src/artifacts/live/session.ts +520 -0
- package/src/artifacts/live/view.ts +81 -0
- package/src/artifacts/messages.ts +469 -24
- package/src/artifacts/page-queries.ts +2 -3
- package/src/artifacts/page-state.ts +16 -7
- package/src/artifacts/publish-edit.ts +50 -22
- package/src/artifacts/queries.ts +108 -10
- package/src/artifacts/references/references.tsx +6 -9
- package/src/artifacts/renderers/canvas/arrows.tsx +12 -39
- package/src/artifacts/renderers/canvas/board-editor.tsx +839 -0
- package/src/artifacts/renderers/canvas/board-properties.tsx +488 -0
- package/src/artifacts/renderers/canvas/board-source.ts +110 -0
- package/src/artifacts/renderers/canvas/board.tsx +373 -35
- package/src/artifacts/renderers/canvas/canvas.tsx +441 -75
- package/src/artifacts/renderers/canvas/comment-pins.tsx +465 -0
- package/src/artifacts/renderers/canvas/commenting.tsx +319 -0
- package/src/artifacts/renderers/canvas/comments-panel.tsx +574 -0
- package/src/artifacts/renderers/canvas/comments.ts +225 -0
- package/src/artifacts/renderers/canvas/controls.tsx +64 -30
- package/src/artifacts/renderers/canvas/draft.ts +41 -50
- package/src/artifacts/renderers/canvas/edit-mode.tsx +145 -20
- package/src/artifacts/renderers/canvas/focus.tsx +321 -26
- package/src/artifacts/renderers/canvas/gestures.ts +265 -0
- package/src/artifacts/renderers/canvas/items.tsx +179 -52
- package/src/artifacts/renderers/canvas/layout.ts +99 -47
- package/src/artifacts/renderers/canvas/page-resize.tsx +542 -0
- package/src/artifacts/renderers/canvas/page-size-controls.tsx +193 -0
- package/src/artifacts/renderers/canvas/page-size.ts +218 -0
- package/src/artifacts/renderers/canvas/page-zoom.ts +280 -0
- package/src/artifacts/renderers/canvas/presence.tsx +184 -0
- package/src/artifacts/renderers/canvas/previews.ts +127 -0
- package/src/artifacts/renderers/canvas/renderer.tsx +87 -22
- package/src/artifacts/renderers/canvas/shown-size.ts +105 -0
- package/src/artifacts/renderers/canvas/thumbnail.tsx +56 -15
- package/src/artifacts/renderers/canvas/toolbar.tsx +1 -1
- package/src/artifacts/renderers/slides/slides.tsx +1 -1
- package/src/artifacts/version-menu.tsx +438 -0
- package/src/artifacts/view-context.ts +102 -0
- package/src/artifacts/viewer.tsx +219 -147
- package/src/build.ts +96 -11
- package/src/codegen.ts +83 -5
- package/src/createCustomApp.ts +20 -7
- package/src/index.ts +14 -0
- package/src/locale-messages.ts +24 -0
- package/src/metadata.ts +12 -0
- package/src/pages/console/action-run.tsx +20 -0
- package/src/pages/console/data/connectors.tsx +27 -3
- package/src/pages/console/data/datasets.tsx +30 -1
- package/src/pages/console/data/lake-health.tsx +299 -0
- package/src/pages/console/data/messages.ts +143 -2
- package/src/pages/console/data/pipelines.tsx +91 -3
- package/src/pages/console/data/projections.tsx +23 -4
- package/src/pages/console/data/syncs.tsx +39 -2
- package/src/pages/console/ontology/action-runs.tsx +8 -2
- package/src/pages/console/ontology/actions.tsx +39 -15
- package/src/pages/console/ontology/components/action-button.tsx +10 -0
- package/src/pages/console/ontology/components/artifact-picker.tsx +522 -0
- package/src/pages/console/ontology/components/object-query-bar.tsx +21 -5
- package/src/pages/console/ontology/lib/action-params.ts +10 -0
- package/src/pages/console/ontology/lineage/properties-panel.tsx +32 -24
- package/src/pages/console/ontology/object-page.tsx +2 -0
- package/src/pages/console/ontology/object-type.tsx +73 -14
- package/src/pages/console/ontology/object-types.tsx +56 -7
- package/src/pages/console/ontology/objects.tsx +167 -19
- package/src/pages/console/ontology/rules.tsx +186 -30
- package/src/pages/console/ontology/workflow.tsx +130 -74
- package/src/pages/console/ontology/workflows/run-input-form.tsx +21 -2
- package/src/pages/console/ontology/workflows/schema-shape.tsx +3 -0
- package/src/pages/console/ontology/workflows.tsx +34 -21
- package/src/pages/console/skeletons.tsx +99 -0
- package/src/pages/console/workflow-run.tsx +20 -0
- package/src/pages/section-page.tsx +37 -7
- package/src/pages/section-ui.tsx +96 -13
- package/src/pages/settings/activity/calendar.tsx +13 -6
- package/src/pages/settings/activity/connections.tsx +26 -9
- package/src/pages/settings/activity/page.tsx +31 -4
- package/src/pages/settings/activity/thread.tsx +32 -18
- package/src/pages/settings/activity/timeline.tsx +39 -0
- package/src/pages/settings/controls.tsx +19 -1
- package/src/pages/settings/developers.tsx +2 -2
- package/src/pages/settings/members.tsx +42 -9
- package/src/pages/settings/memory-history.tsx +76 -10
- package/src/pages/settings/memory.tsx +47 -5
- package/src/pages/settings/service-accounts.tsx +7 -2
- package/src/pages/settings/sessions.tsx +6 -2
- package/src/pages/settings/usage/breakdown.tsx +62 -2
- package/src/pages/settings/usage/limits.tsx +45 -3
- package/src/pages/settings/usage/messages.ts +0 -2
- package/src/pages/settings/usage/page.tsx +99 -52
- package/src/pages/settings/usage/runs.tsx +105 -8
- package/src/pages/settings/usage/spend-chart.tsx +79 -45
- package/src/pages/settings/usage/spend-model.ts +16 -0
- package/src/pages/values.tsx +72 -6
- package/src/pages.ts +4 -0
- package/src/sections/catalog.ts +6 -0
- package/src/sections/sections.tsx +2 -0
- package/src/service-worker.ts +176 -0
- package/src/shared-session.ts +73 -0
- package/src/shell/app-return.ts +115 -0
- package/src/shell/app-shell.tsx +125 -27
- package/src/shell/nav-items.tsx +2 -0
- package/src/shell/phone/back.ts +16 -0
- package/src/shell/phone/launch.ts +6 -0
- package/src/shell/phone/more-sheet.tsx +249 -0
- package/src/shell/phone/phone-foundations.tsx +43 -0
- package/src/shell/phone/phone.css +660 -0
- package/src/shell/phone/pull-to-refresh.tsx +201 -0
- package/src/shell/phone/routes.ts +34 -0
- package/src/shell/phone/screen-motion.ts +292 -0
- package/src/shell/phone/scroll-restoration.tsx +70 -0
- package/src/shell/phone/startup-image.ts +119 -0
- package/src/shell/phone/tab-bar.tsx +95 -0
- package/src/shell/phone/top-bar.tsx +195 -0
- package/src/shell/search-command.tsx +30 -14
- package/src/shell/user-menu.tsx +2 -1
- package/dist/chunk-4j3c3p72.js +0 -1487
- package/dist/chunk-4j3c3p72.js.map +0 -18
- package/dist/chunk-4mprsd2n.js.map +0 -10
- package/dist/chunk-ytadd0b5.js.map +0 -188
- /package/dist/{chunk-7fj9cfkw.js.map → chunk-970s5nkn.js.map} +0 -0
- /package/dist/{chunk-j8g956dt.js.map → chunk-pxd07kvx.js.map} +0 -0
- /package/dist/{chunk-kwbw4dyk.js.map → chunk-ryed2jq8.js.map} +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { ArtifactLiveUser } from "@sixb/core/artifacts/live"
|
|
2
|
+
import { type InternalNode, useStore, ViewportPortal } from "@xyflow/react"
|
|
3
|
+
import { Sparkles } from "lucide-react"
|
|
4
|
+
import { memo, useCallback } from "react"
|
|
5
|
+
import { livePersonName, useLivePresence } from "../../live/presence"
|
|
6
|
+
import type { LiveArtifact } from "../../live/session"
|
|
7
|
+
import { useArtifactMessages } from "../../messages"
|
|
8
|
+
import { NAME_SCALE_VALUE } from "./items"
|
|
9
|
+
|
|
10
|
+
/** An item's box on the canvas, as React Flow measured it. */
|
|
11
|
+
interface Box {
|
|
12
|
+
readonly x: number
|
|
13
|
+
readonly y: number
|
|
14
|
+
readonly w: number
|
|
15
|
+
readonly h: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* How far down the board view a selection's top must be for its name to show above it: the
|
|
20
|
+
* toolbar, while editing, and a name's height. Higher, the name shows under the selection's top
|
|
21
|
+
* edge, never under the toolbar nor off the view.
|
|
22
|
+
*/
|
|
23
|
+
export const NAME_CLEARANCE = 96
|
|
24
|
+
|
|
25
|
+
/** Whether a selection's name goes under its top edge, where the view puts its box now. */
|
|
26
|
+
export function nameBelow(box: { readonly y: number }, transform: readonly number[]): boolean {
|
|
27
|
+
const [, panY = 0, zoom = 1] = transform
|
|
28
|
+
return box.y * zoom + panY < NAME_CLEARANCE
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Over the canvas, where the others are: each person's selection outlined in their color, their
|
|
33
|
+
* name above it, or just under its top edge near the top of the view, and each board an Agent
|
|
34
|
+
* turn is changing, its outline shimmering and a badge saying so, kept within the board. Drawn
|
|
35
|
+
* in the canvas's own coordinates, it takes no pointer.
|
|
36
|
+
*/
|
|
37
|
+
export const PresenceLayer = memo(function PresenceLayer({
|
|
38
|
+
live,
|
|
39
|
+
}: {
|
|
40
|
+
readonly live: LiveArtifact
|
|
41
|
+
}) {
|
|
42
|
+
const messages = useArtifactMessages().canvas.live
|
|
43
|
+
const all = useArtifactMessages()
|
|
44
|
+
const guestLabel = all.canvas.comments.guest
|
|
45
|
+
const labels = { guest: guestLabel, teamMember: all.live.teamMember }
|
|
46
|
+
const { peers, agents } = useLivePresence(live)
|
|
47
|
+
|
|
48
|
+
// One outline per item someone selected: the first person who did names it.
|
|
49
|
+
const selected = new Map<string, ArtifactLiveUser>()
|
|
50
|
+
for (const peer of peers) {
|
|
51
|
+
for (const id of peer.selection) if (!selected.has(id)) selected.set(id, peer.user)
|
|
52
|
+
}
|
|
53
|
+
const changing = [...new Set(agents.flatMap((agent) => agent.boards))]
|
|
54
|
+
const boxes = useBoxes([...selected.keys(), ...changing])
|
|
55
|
+
// The selections whose names go under their top edge: read again as the view moves, drawn
|
|
56
|
+
// again only as one of them crosses.
|
|
57
|
+
const below = useStore(
|
|
58
|
+
useCallback(
|
|
59
|
+
(state: { readonly transform: readonly number[] }) =>
|
|
60
|
+
[...boxes]
|
|
61
|
+
.filter(([, box]) => nameBelow(box, state.transform))
|
|
62
|
+
.map(([id]) => id)
|
|
63
|
+
.join("\n"),
|
|
64
|
+
[boxes]
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
if (boxes.size === 0) return null
|
|
69
|
+
return (
|
|
70
|
+
<ViewportPortal>
|
|
71
|
+
{changing.map((id) => {
|
|
72
|
+
const box = boxes.get(id)
|
|
73
|
+
return box ? (
|
|
74
|
+
<div
|
|
75
|
+
key={`agent:${id}`}
|
|
76
|
+
data-agent-board={id}
|
|
77
|
+
className="sixb-agent-board pointer-events-none absolute rounded-[12px]"
|
|
78
|
+
style={place(box, 4)}
|
|
79
|
+
>
|
|
80
|
+
{/*
|
|
81
|
+
* The badge's lane: the board's width less its margins, at the badge's scale, so the
|
|
82
|
+
* badge never reaches past the board. Narrow, its words truncate, then leave the icon.
|
|
83
|
+
*/}
|
|
84
|
+
<div
|
|
85
|
+
className="@container absolute top-3 right-3 flex origin-top-right justify-end"
|
|
86
|
+
style={{
|
|
87
|
+
width: `calc(${Math.max(box.w - 16, 0)}px / ${NAME_SCALE_VALUE})`,
|
|
88
|
+
transform: `scale(${NAME_SCALE_VALUE})`,
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
<span
|
|
92
|
+
title={messages.agentChanging}
|
|
93
|
+
className="flex max-w-full min-w-0 items-center gap-1.5 rounded-full bg-background/95 px-2.5 py-1 text-[12px] font-medium whitespace-nowrap text-primary shadow-[0_1px_2px_rgb(0_0_0/0.08),0_6px_16px_-8px_rgb(0_0_0/0.3)] ring-1 ring-[color-mix(in_oklab,var(--primary)_25%,transparent)] @max-[8rem]:px-1.5"
|
|
94
|
+
>
|
|
95
|
+
<Sparkles
|
|
96
|
+
className="size-3.5 shrink-0 motion-safe:animate-pulse"
|
|
97
|
+
aria-hidden="true"
|
|
98
|
+
/>
|
|
99
|
+
<span className="min-w-0 truncate @max-[8rem]:sr-only">
|
|
100
|
+
{messages.agentChanging}
|
|
101
|
+
</span>
|
|
102
|
+
</span>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
) : null
|
|
106
|
+
})}
|
|
107
|
+
{[...selected].map(([id, user]) => {
|
|
108
|
+
const box = boxes.get(id)
|
|
109
|
+
return box ? (
|
|
110
|
+
<div
|
|
111
|
+
key={`peer:${id}`}
|
|
112
|
+
data-peer-selection={id}
|
|
113
|
+
className="pointer-events-none absolute rounded-[6px]"
|
|
114
|
+
style={{
|
|
115
|
+
...place(box, 3),
|
|
116
|
+
boxShadow: `0 0 0 calc(2px * ${NAME_SCALE_VALUE}) ${user.color}`,
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
<span
|
|
120
|
+
data-name={below.split("\n").includes(id) ? "below" : "above"}
|
|
121
|
+
className="absolute left-0 rounded-[4px] px-1.5 py-px text-[11px] leading-4 font-medium whitespace-nowrap text-white data-[name=above]:bottom-full data-[name=above]:mb-1 data-[name=above]:origin-bottom-left data-[name=below]:top-1 data-[name=below]:left-1 data-[name=below]:origin-top-left"
|
|
122
|
+
style={{ backgroundColor: user.color, transform: `scale(${NAME_SCALE_VALUE})` }}
|
|
123
|
+
>
|
|
124
|
+
{livePersonName(user, labels)}
|
|
125
|
+
{user.guest && user.name ? <span className="opacity-75"> · {guestLabel}</span> : null}
|
|
126
|
+
</span>
|
|
127
|
+
</div>
|
|
128
|
+
) : null
|
|
129
|
+
})}
|
|
130
|
+
</ViewportPortal>
|
|
131
|
+
)
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
/** A box drawn `margin` pixels around an item. */
|
|
135
|
+
function place(box: Box, margin: number) {
|
|
136
|
+
return {
|
|
137
|
+
transform: `translate(${box.x - margin}px, ${box.y - margin}px)`,
|
|
138
|
+
width: box.w + margin * 2,
|
|
139
|
+
height: box.h + margin * 2,
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** The boxes of these items, read again only as one of them moves or changes size. */
|
|
144
|
+
function useBoxes(ids: readonly string[]): ReadonlyMap<string, Box> {
|
|
145
|
+
const key = ids.join("\n")
|
|
146
|
+
const select = useCallback(
|
|
147
|
+
(state: { readonly nodeLookup: ReadonlyMap<string, InternalNode> }) => {
|
|
148
|
+
const boxes = new Map<string, Box>()
|
|
149
|
+
for (const id of key ? key.split("\n") : []) {
|
|
150
|
+
const node = state.nodeLookup.get(id)
|
|
151
|
+
const box = node ? boxOf(node) : null
|
|
152
|
+
if (box) boxes.set(id, box)
|
|
153
|
+
}
|
|
154
|
+
return boxes
|
|
155
|
+
},
|
|
156
|
+
[key]
|
|
157
|
+
)
|
|
158
|
+
return useStore(select, sameBoxes)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function boxOf(node: InternalNode): Box | null {
|
|
162
|
+
const w = node.measured.width ?? node.width
|
|
163
|
+
const h = node.measured.height ?? node.height
|
|
164
|
+
if (w === undefined || h === undefined) return null
|
|
165
|
+
const { x, y } = node.internals.positionAbsolute
|
|
166
|
+
return { x, y, w, h }
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function sameBoxes(left: ReadonlyMap<string, Box>, right: ReadonlyMap<string, Box>): boolean {
|
|
170
|
+
if (left.size !== right.size) return false
|
|
171
|
+
for (const [id, box] of left) {
|
|
172
|
+
const other = right.get(id)
|
|
173
|
+
if (
|
|
174
|
+
!other ||
|
|
175
|
+
other.x !== box.x ||
|
|
176
|
+
other.y !== box.y ||
|
|
177
|
+
other.w !== box.w ||
|
|
178
|
+
other.h !== box.h
|
|
179
|
+
) {
|
|
180
|
+
return false
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return true
|
|
184
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { client, getArtifactVersion, withSharedAccess } from "@sixb/client"
|
|
2
|
+
import { BOARD_PREVIEW_WAIT_MS, SMALL_BOARD_PREVIEW_WIDTH } from "@sixb/core/artifacts"
|
|
3
|
+
import { type Query, useQuery } from "@tanstack/react-query"
|
|
4
|
+
import type { ArtifactVersion } from "../../queries"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Whether a board's picture can be shown: `ready`, `pending` while it is rendered, `none` when
|
|
8
|
+
* none will come and the board shows its outline.
|
|
9
|
+
*/
|
|
10
|
+
export type BoardPreviewStatus = "ready" | "pending" | "none"
|
|
11
|
+
|
|
12
|
+
export type BoardPreviews = Readonly<Record<string, BoardPreviewStatus>>
|
|
13
|
+
|
|
14
|
+
const NO_PREVIEWS: BoardPreviews = {}
|
|
15
|
+
|
|
16
|
+
/** The first look again for pictures still rendered, and the longest between two. */
|
|
17
|
+
const FIRST_CHECK_MS = 2_000
|
|
18
|
+
const LONGEST_CHECK_MS = 30_000
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* How long to wait before asking the version again which pictures are ready: never when none is
|
|
22
|
+
* pending or the version's last write is past the server's wait, else a little longer each time
|
|
23
|
+
* it is asked. An open version waits from its last write, as the server does.
|
|
24
|
+
*/
|
|
25
|
+
export function nextPreviewCheck(
|
|
26
|
+
previews: BoardPreviews,
|
|
27
|
+
version: Pick<ArtifactVersion, "updatedAt">,
|
|
28
|
+
checks: number,
|
|
29
|
+
now: number
|
|
30
|
+
): number | false {
|
|
31
|
+
if (!Object.values(previews).includes("pending")) return false
|
|
32
|
+
|
|
33
|
+
if (now - Date.parse(version.updatedAt) >= BOARD_PREVIEW_WAIT_MS) return false
|
|
34
|
+
|
|
35
|
+
return Math.min(LONGEST_CHECK_MS, FIRST_CHECK_MS * 1.5 ** checks)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A canvas version's boards and whether each one's picture is ready, asked again while some are
|
|
40
|
+
* rendered, as {@link nextPreviewCheck} says. Its own query, so the viewer's version stays as it
|
|
41
|
+
* was read. Without a version, a canvas drawn on its own, no board has a picture.
|
|
42
|
+
*/
|
|
43
|
+
export function useBoardPreviews(version: ArtifactVersion | undefined): BoardPreviews {
|
|
44
|
+
return useQuery(boardPreviewsQuery(version)).data ?? NO_PREVIEWS
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The query {@link useBoardPreviews} runs. The version's own answer starts it when it holds one:
|
|
49
|
+
* one without it, such as a version seeded from elsewhere, is asked rather than read as none.
|
|
50
|
+
*/
|
|
51
|
+
export function boardPreviewsQuery(version: ArtifactVersion | undefined) {
|
|
52
|
+
return {
|
|
53
|
+
// A revision's boards are pictured once: an open version that changed asks again.
|
|
54
|
+
queryKey: ["artifact-board-previews", version?.artifactId, version?.version, version?.revision],
|
|
55
|
+
queryFn: async (): Promise<BoardPreviews> => {
|
|
56
|
+
if (!version) return NO_PREVIEWS
|
|
57
|
+
|
|
58
|
+
const { data } = await getArtifactVersion({
|
|
59
|
+
path: { artifactId: version.artifactId, version: String(version.version) },
|
|
60
|
+
throwOnError: true,
|
|
61
|
+
})
|
|
62
|
+
return data.boardPreviews ?? NO_PREVIEWS
|
|
63
|
+
},
|
|
64
|
+
...(version?.boardPreviews ? { initialData: version.boardPreviews } : {}),
|
|
65
|
+
enabled: version !== undefined,
|
|
66
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
67
|
+
retry: false,
|
|
68
|
+
refetchInterval: (current: Query<BoardPreviews>) =>
|
|
69
|
+
version
|
|
70
|
+
? nextPreviewCheck(
|
|
71
|
+
current.state.data ?? NO_PREVIEWS,
|
|
72
|
+
version,
|
|
73
|
+
current.state.dataUpdateCount,
|
|
74
|
+
Date.now()
|
|
75
|
+
)
|
|
76
|
+
: false,
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** A board's picture at its own size, or one at most {@link SMALL_BOARD_PREVIEW_WIDTH} wide. */
|
|
81
|
+
export type BoardPreviewSize = "small" | "full"
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The picture a board's tile shows, from how wide it is on screen: the small one while that
|
|
85
|
+
* covers it pixel for pixel, the full one past it, so a canvas fitted to a hundred boards holds a
|
|
86
|
+
* hundred small pictures, not a hundred screens.
|
|
87
|
+
*/
|
|
88
|
+
export function boardPreviewSize(screenWidth: number, pixelRatio: number): BoardPreviewSize {
|
|
89
|
+
return screenWidth * pixelRatio <= SMALL_BOARD_PREVIEW_WIDTH ? "small" : "full"
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Where a board's picture is, in the reader's mode, at a size, of what the board shows: the
|
|
94
|
+
* server picks the mode a canvas pins, and the full size is its default. Named by the board's
|
|
95
|
+
* render key, the picture stays the same while the board does, however often an open canvas
|
|
96
|
+
* changes around it, as it does edited live; without one, by the revision shown. Either way it is
|
|
97
|
+
* kept for good, and one the version moved past is not found, never shown.
|
|
98
|
+
*/
|
|
99
|
+
export function boardPreviewUrl(
|
|
100
|
+
version: Pick<ArtifactVersion, "artifactId" | "version" | "revision" | "outline">,
|
|
101
|
+
board: string,
|
|
102
|
+
mode: "light" | "dark",
|
|
103
|
+
size: BoardPreviewSize = "full"
|
|
104
|
+
): string {
|
|
105
|
+
const artifact = `/api/artifacts/${encodeURIComponent(version.artifactId)}`
|
|
106
|
+
const path = `${artifact}/versions/${version.version}/boards/${encodeURIComponent(board)}/preview`
|
|
107
|
+
const url = new URL(path, client.getConfig().baseUrl || window.location.origin)
|
|
108
|
+
url.searchParams.set("theme", mode)
|
|
109
|
+
if (size === "small") url.searchParams.set("size", "small")
|
|
110
|
+
const key = renderKeyOf(version, board)
|
|
111
|
+
if (key) url.searchParams.set("key", key)
|
|
112
|
+
else url.searchParams.set("revision", String(version.revision))
|
|
113
|
+
// An `<img>` sends no header: a shared link's session names its grant in the address.
|
|
114
|
+
return withSharedAccess(url.toString())
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** The render key a version's outline gives a board, if it gives one. */
|
|
118
|
+
export function renderKeyOf(
|
|
119
|
+
version: Pick<ArtifactVersion, "outline">,
|
|
120
|
+
board: string
|
|
121
|
+
): string | undefined {
|
|
122
|
+
if (version.outline.kind !== "canvas") return undefined
|
|
123
|
+
const item = version.outline.items.find(
|
|
124
|
+
(candidate) => candidate.type === "board" && candidate.id === board
|
|
125
|
+
)
|
|
126
|
+
return item?.type === "board" ? item.renderKey : undefined
|
|
127
|
+
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { CANVAS_FILE, type Canvas, parseCanvas } from "@sixb/core/artifacts"
|
|
2
2
|
import { useOptionalTheme } from "@sixb/ui/hooks"
|
|
3
|
-
import {
|
|
4
|
-
import { lazy, Suspense, useEffect, useMemo, useState } from "react"
|
|
3
|
+
import { lazy, Suspense, useEffect, useMemo, useState, useSyncExternalStore } from "react"
|
|
5
4
|
import { useArtifactEditing, useReportDraft } from "../../edit-session"
|
|
6
5
|
import { type History, recordChange, redoChange, startHistory, undoChange } from "../../history"
|
|
6
|
+
import { type LiveCanvas, liveCanvasOf } from "../../live/canvas"
|
|
7
|
+
import { useLiveArtifactState, useViewerLiveArtifact } from "../../live/hooks"
|
|
8
|
+
import { shareSelection } from "../../live/presence"
|
|
9
|
+
import type { LiveArtifact } from "../../live/session"
|
|
7
10
|
import { useArtifactMessages } from "../../messages"
|
|
8
11
|
import { type ArtifactVersion, useFileText, versionFileSource } from "../../queries"
|
|
9
12
|
import { useArtifactThemeAttributes } from "../../theme"
|
|
@@ -17,8 +20,13 @@ const CanvasBoard = lazy(() => import("./canvas"))
|
|
|
17
20
|
* A version's `canvas.json`, parsed once it is read: undefined until then, and null when it
|
|
18
21
|
* cannot be read or does not parse.
|
|
19
22
|
*/
|
|
20
|
-
export function useCanvas(
|
|
21
|
-
|
|
23
|
+
export function useCanvas(
|
|
24
|
+
version: ArtifactVersion,
|
|
25
|
+
options: { readonly enabled?: boolean } = {}
|
|
26
|
+
): Canvas | null | undefined {
|
|
27
|
+
const file = useFileText(
|
|
28
|
+
options.enabled === false ? null : versionFileSource(version, CANVAS_FILE)
|
|
29
|
+
)
|
|
22
30
|
return useMemo(() => {
|
|
23
31
|
if (file.text === undefined) return file.loading ? undefined : null
|
|
24
32
|
const parsed = parseCanvas(file.text)
|
|
@@ -26,7 +34,27 @@ export function useCanvas(version: ArtifactVersion): Canvas | null | undefined {
|
|
|
26
34
|
}, [file.text, file.loading])
|
|
27
35
|
}
|
|
28
36
|
|
|
29
|
-
/**
|
|
37
|
+
/** The mode a canvas's boards draw in: the one its theme.json pins, else the app's. */
|
|
38
|
+
export function useCanvasMode(version: ArtifactVersion): "light" | "dark" {
|
|
39
|
+
const theme = useArtifactThemeAttributes(version)
|
|
40
|
+
const app = useOptionalTheme()?.resolvedTheme
|
|
41
|
+
|
|
42
|
+
if (theme.className === "dark" || theme.className === "light") return theme.className
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
app ??
|
|
46
|
+
(typeof document !== "undefined" && document.documentElement.classList.contains("dark")
|
|
47
|
+
? "dark"
|
|
48
|
+
: "light")
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* A canvas artifact: its board, in the app's theme or its own, opened where an address points.
|
|
54
|
+
* Held live by the viewer, it is drawn from its live document once that holds it, everyone's
|
|
55
|
+
* changes as they make them, and edited there; else from the version's `canvas.json`, edited as
|
|
56
|
+
* a draft the header saves.
|
|
57
|
+
*/
|
|
30
58
|
export function CanvasRenderer({
|
|
31
59
|
version,
|
|
32
60
|
part,
|
|
@@ -36,33 +64,33 @@ export function CanvasRenderer({
|
|
|
36
64
|
}) {
|
|
37
65
|
const messages = useArtifactMessages()
|
|
38
66
|
const theme = useArtifactThemeAttributes(version)
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
67
|
+
const mode = useCanvasMode(version)
|
|
68
|
+
const live = useViewerLiveArtifact()
|
|
69
|
+
const liveState = useLiveArtifactState(live)
|
|
70
|
+
const liveCanvas = live && liveState.synced && !liveState.left ? liveCanvasOf(live) : null
|
|
71
|
+
const fromDocument = useLiveCanvas(liveCanvas)
|
|
72
|
+
const fromVersion = useCanvas(version, { enabled: !fromDocument })
|
|
73
|
+
const canvas = fromDocument ?? fromVersion
|
|
74
|
+
const editing = useArtifactEditing()
|
|
75
|
+
const liveEdit = useLiveEditor(
|
|
76
|
+
live,
|
|
77
|
+
fromDocument && editing && liveState.access === "edit" ? liveCanvas : null
|
|
78
|
+
)
|
|
79
|
+
const draft = useCanvasDraft(fromDocument ? undefined : canvas)
|
|
50
80
|
const loading = <ViewerLoading label={messages.viewer.loading} />
|
|
51
81
|
if (canvas === undefined) return loading
|
|
52
82
|
if (canvas === null) return <ViewerNotice title={messages.canvas.loadFailed} />
|
|
53
83
|
return (
|
|
54
|
-
<div
|
|
55
|
-
data-sixb-artifact=""
|
|
56
|
-
className={cn("flex min-h-0 flex-1 flex-col", theme.className)}
|
|
57
|
-
style={theme.style}
|
|
58
|
-
>
|
|
84
|
+
<div data-sixb-artifact="" className="flex min-h-0 flex-1 flex-col">
|
|
59
85
|
<Suspense fallback={loading}>
|
|
60
86
|
<CanvasBoard
|
|
61
87
|
canvas={draft.canvas ?? canvas}
|
|
62
|
-
{...(draft.edit ? { edit: draft.edit } : {})}
|
|
88
|
+
{...(liveEdit ? { edit: liveEdit } : draft.edit ? { edit: draft.edit } : {})}
|
|
89
|
+
{...(fromDocument && live ? { live } : {})}
|
|
63
90
|
version={version}
|
|
64
91
|
title={version.title}
|
|
65
92
|
mode={mode}
|
|
93
|
+
theme={theme}
|
|
66
94
|
{...(part ? { focus: part } : {})}
|
|
67
95
|
/>
|
|
68
96
|
</Suspense>
|
|
@@ -70,6 +98,43 @@ export function CanvasRenderer({
|
|
|
70
98
|
)
|
|
71
99
|
}
|
|
72
100
|
|
|
101
|
+
const noSubscription = () => () => {}
|
|
102
|
+
const nothing = () => null
|
|
103
|
+
|
|
104
|
+
/** The canvas a live document holds, as it changes; null while there is none. */
|
|
105
|
+
function useLiveCanvas(canvas: LiveCanvas | null): Canvas | null {
|
|
106
|
+
return useSyncExternalStore(
|
|
107
|
+
canvas?.subscribe ?? noSubscription,
|
|
108
|
+
canvas?.getCanvas ?? nothing,
|
|
109
|
+
nothing
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Editing the live document: each change written for everyone at once, this reader's own taken
|
|
115
|
+
* back by undo, and what they select shown to the others. Null while not editing.
|
|
116
|
+
*/
|
|
117
|
+
function useLiveEditor(live: LiveArtifact | null, canvas: LiveCanvas | null): CanvasEditor | null {
|
|
118
|
+
return useMemo<CanvasEditor | null>(
|
|
119
|
+
() =>
|
|
120
|
+
live && canvas
|
|
121
|
+
? {
|
|
122
|
+
apply: (change) => canvas.apply(change),
|
|
123
|
+
undo: () => canvas.undo(),
|
|
124
|
+
redo: () => canvas.redo(),
|
|
125
|
+
live: {
|
|
126
|
+
startDrag: () => canvas.startDrag(),
|
|
127
|
+
endDrag: () => canvas.endDrag(),
|
|
128
|
+
stopCapturing: () => canvas.stopCapturing(),
|
|
129
|
+
select: (ids) => shareSelection(live, ids),
|
|
130
|
+
editBoard: (path, make, files) => canvas.editBoard(path, make, files),
|
|
131
|
+
},
|
|
132
|
+
}
|
|
133
|
+
: null,
|
|
134
|
+
[live, canvas]
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
|
|
73
138
|
/**
|
|
74
139
|
* The canvas as the reader arranges it, while the viewer is editing: each change a step for undo,
|
|
75
140
|
* and the draft reported to the header's Save. Leaving editing drops it.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
2
|
+
import {
|
|
3
|
+
clampSize,
|
|
4
|
+
isScreen,
|
|
5
|
+
type PageSize,
|
|
6
|
+
type SizeName,
|
|
7
|
+
type SnappedSize,
|
|
8
|
+
sameSize,
|
|
9
|
+
sizeSuggestions,
|
|
10
|
+
} from "./page-size"
|
|
11
|
+
|
|
12
|
+
/** A common screen's width the reader chose, and whether each board shows its full page at it. */
|
|
13
|
+
interface Screen {
|
|
14
|
+
readonly w: number
|
|
15
|
+
readonly full: boolean
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The size an opened board's page is shown at, for the reader alone, while the boards are open.
|
|
20
|
+
*
|
|
21
|
+
* A size set on a board stays on it as the reader steps through the others. A common screen's
|
|
22
|
+
* width, picked or snapped to, carries to them: each is shown at it, at its own board's height, or
|
|
23
|
+
* its full page once the reader chose that, so a flow is walked at a phone's width. Back to board
|
|
24
|
+
* size puts every board back.
|
|
25
|
+
*/
|
|
26
|
+
export function useShownSize(id: string, own: PageSize) {
|
|
27
|
+
const [sizes, setSizes] = useState<Readonly<Record<string, PageSize>>>({})
|
|
28
|
+
const [screen, setScreen] = useState<Screen | null>(null)
|
|
29
|
+
// Each board's page height, as its frame reports it at the width shown.
|
|
30
|
+
const [heights, setHeights] = useState<Readonly<Record<string, number>>>({})
|
|
31
|
+
|
|
32
|
+
const height = heights[id] ?? null
|
|
33
|
+
const suggestions = useMemo(() => sizeSuggestions(own, height), [own, height])
|
|
34
|
+
const chosen =
|
|
35
|
+
sizes[id] ??
|
|
36
|
+
(screen
|
|
37
|
+
? clampSize(
|
|
38
|
+
{ w: screen.w, h: screen.full && height !== null ? height : own.h },
|
|
39
|
+
suggestions.least
|
|
40
|
+
)
|
|
41
|
+
: null)
|
|
42
|
+
const shown = chosen && !sameSize(chosen, own) ? chosen : own
|
|
43
|
+
|
|
44
|
+
const onContentHeight = useCallback(
|
|
45
|
+
(next: number) => setHeights((last) => (last[id] === next ? last : { ...last, [id]: next })),
|
|
46
|
+
[id]
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
/** A size laid out on this board, as a resize goes. */
|
|
50
|
+
const resize = useCallback(
|
|
51
|
+
(size: PageSize) => setSizes((last) => ({ ...last, [id]: size })),
|
|
52
|
+
[id]
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A size set on this board: a common screen's width carries to the others, and `full`, when
|
|
57
|
+
* given, says whether they show their full page at it.
|
|
58
|
+
*/
|
|
59
|
+
const set = (size: PageSize, name: SizeName | null, full: boolean | null) => {
|
|
60
|
+
if (name !== null && isScreen(name)) {
|
|
61
|
+
setSizes({ [id]: size })
|
|
62
|
+
setScreen({ w: size.w, full: full ?? screen?.full ?? false })
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
resize(size)
|
|
66
|
+
if (screen && full !== null) setScreen({ ...screen, full })
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// A size kept as the board's is no longer one of the reader's once the board has it: should
|
|
70
|
+
// the board change again, as with Undo, it shows as it is.
|
|
71
|
+
const keeping = useRef<{ readonly id: string; readonly size: PageSize } | null>(null)
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const kept = keeping.current
|
|
74
|
+
if (!kept || kept.id !== id || !sameSize(kept.size, own)) return
|
|
75
|
+
|
|
76
|
+
keeping.current = null
|
|
77
|
+
setSizes(({ [id]: _, ...others }) => others)
|
|
78
|
+
}, [id, own])
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
shown,
|
|
82
|
+
resized: shown !== own,
|
|
83
|
+
suggestions,
|
|
84
|
+
/** The page's height as its frame reports it. */
|
|
85
|
+
onContentHeight,
|
|
86
|
+
resize,
|
|
87
|
+
/** A size picked from the menu. */
|
|
88
|
+
pick: (size: PageSize, name: SizeName) =>
|
|
89
|
+
set(size, name, name === "full" ? true : isScreen(name) ? false : null),
|
|
90
|
+
/** A resize ended, at what it snapped to: a free one stays on this board. */
|
|
91
|
+
settle: (snapped: SnappedSize) => {
|
|
92
|
+
const width = snapped.w && isScreen(snapped.w.name) ? snapped.w.name : null
|
|
93
|
+
set(snapped.size, width, snapped.h ? snapped.h.name === "full" : null)
|
|
94
|
+
},
|
|
95
|
+
/** Back to the board's size: every board's, and no screen's width carried any more. */
|
|
96
|
+
reset: () => {
|
|
97
|
+
setSizes({})
|
|
98
|
+
setScreen(null)
|
|
99
|
+
},
|
|
100
|
+
/** The size shown was kept as the board's. */
|
|
101
|
+
keep: () => {
|
|
102
|
+
keeping.current = { id, size: shown }
|
|
103
|
+
},
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -5,9 +5,17 @@ import { approximateBox, type Box, canvasExtent } from "./layout"
|
|
|
5
5
|
/**
|
|
6
6
|
* A canvas drawn small, as a card previews it: boards, embeds, notes, and shapes as their shapes in
|
|
7
7
|
* the theme's colors, texts and sections' headings as lines, arrows between what they join. Plain
|
|
8
|
-
* SVG, so a card never loads the board.
|
|
8
|
+
* SVG, so a card never loads the board. A board with a picture shows it, up to
|
|
9
|
+
* {@link MAX_PICTURED_BOARDS}: past them, each is a few pixels on a card, and drawn as its shape.
|
|
9
10
|
*/
|
|
10
|
-
export function CanvasThumbnail({
|
|
11
|
+
export function CanvasThumbnail({
|
|
12
|
+
canvas,
|
|
13
|
+
pictures = NO_PICTURES,
|
|
14
|
+
}: {
|
|
15
|
+
readonly canvas: Canvas
|
|
16
|
+
/** Each board's small picture, by board id, for those that have one. */
|
|
17
|
+
readonly pictures?: ReadonlyMap<string, string>
|
|
18
|
+
}) {
|
|
11
19
|
const extent = canvasExtent(canvas)
|
|
12
20
|
// A margin around everything, a twentieth of the larger side.
|
|
13
21
|
const margin = Math.max(extent.width, extent.height) / 20
|
|
@@ -24,6 +32,9 @@ export function CanvasThumbnail({ canvas }: { readonly canvas: Canvas }) {
|
|
|
24
32
|
})
|
|
25
33
|
)
|
|
26
34
|
const stroke = Math.max(view.width, view.height) / 400
|
|
35
|
+
const boards = canvas.items.filter((item) => item.type === "board").length
|
|
36
|
+
const pictured = boards <= MAX_PICTURED_BOARDS ? pictures : NO_PICTURES
|
|
37
|
+
|
|
27
38
|
return (
|
|
28
39
|
<svg
|
|
29
40
|
viewBox={`${view.x} ${view.y} ${view.width} ${view.height}`}
|
|
@@ -32,20 +43,33 @@ export function CanvasThumbnail({ canvas }: { readonly canvas: Canvas }) {
|
|
|
32
43
|
aria-hidden="true"
|
|
33
44
|
>
|
|
34
45
|
{canvas.items.map((item) => (
|
|
35
|
-
<Shape
|
|
46
|
+
<Shape
|
|
47
|
+
key={item.id}
|
|
48
|
+
item={item}
|
|
49
|
+
boxes={boxes}
|
|
50
|
+
stroke={stroke}
|
|
51
|
+
picture={pictured.get(item.id)}
|
|
52
|
+
/>
|
|
36
53
|
))}
|
|
37
54
|
</svg>
|
|
38
55
|
)
|
|
39
56
|
}
|
|
40
57
|
|
|
58
|
+
/** The most boards a card draws as their pictures: a hundred would fetch a hundred pictures. */
|
|
59
|
+
const MAX_PICTURED_BOARDS = 24
|
|
60
|
+
|
|
61
|
+
const NO_PICTURES: ReadonlyMap<string, string> = new Map()
|
|
62
|
+
|
|
41
63
|
function Shape({
|
|
42
64
|
item,
|
|
43
65
|
boxes,
|
|
44
66
|
stroke,
|
|
67
|
+
picture,
|
|
45
68
|
}: {
|
|
46
69
|
readonly item: CanvasItem
|
|
47
70
|
readonly boxes: ReadonlyMap<string, Box>
|
|
48
71
|
readonly stroke: number
|
|
72
|
+
readonly picture: string | undefined
|
|
49
73
|
}) {
|
|
50
74
|
const box = boxes.get(item.id)
|
|
51
75
|
const line = "color-mix(in oklab, var(--foreground) 30%, transparent)"
|
|
@@ -85,18 +109,35 @@ function Shape({
|
|
|
85
109
|
) : null
|
|
86
110
|
}
|
|
87
111
|
case "board":
|
|
88
|
-
case "embed":
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
112
|
+
case "embed": {
|
|
113
|
+
if (!box) return null
|
|
114
|
+
|
|
115
|
+
const edge = "color-mix(in oklab, var(--foreground) 14%, transparent)"
|
|
116
|
+
if (!picture) {
|
|
117
|
+
return (
|
|
118
|
+
<rect
|
|
119
|
+
{...rect(box)}
|
|
120
|
+
rx={stroke * 2}
|
|
121
|
+
style={{ fill: "var(--card)", stroke: edge }}
|
|
122
|
+
strokeWidth={stroke}
|
|
123
|
+
/>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// The picture from the top at the board's width, as its tile shows it, edged on top.
|
|
128
|
+
return (
|
|
129
|
+
<g>
|
|
130
|
+
<rect {...rect(box)} rx={stroke * 2} style={{ fill: "var(--card)" }} />
|
|
131
|
+
<image {...rect(box)} href={picture} preserveAspectRatio="xMidYMin meet" />
|
|
132
|
+
<rect
|
|
133
|
+
{...rect(box)}
|
|
134
|
+
rx={stroke * 2}
|
|
135
|
+
style={{ fill: "none", stroke: edge }}
|
|
136
|
+
strokeWidth={stroke}
|
|
137
|
+
/>
|
|
138
|
+
</g>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
100
141
|
case "note":
|
|
101
142
|
// A neutral note is plain paper, edged as a board is.
|
|
102
143
|
return box ? (
|