@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
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
useRef,
|
|
20
20
|
useState,
|
|
21
21
|
} from "react"
|
|
22
|
+
import type { LiveCanvas } from "../../live/canvas"
|
|
22
23
|
import { useArtifactMessages } from "../../messages"
|
|
23
24
|
import {
|
|
24
25
|
addItem,
|
|
@@ -42,8 +43,25 @@ export interface CanvasEditor {
|
|
|
42
43
|
readonly apply: (change: CanvasChange) => void
|
|
43
44
|
readonly undo: () => void
|
|
44
45
|
readonly redo: () => void
|
|
46
|
+
/**
|
|
47
|
+
* Edits everyone sees as they are made: a drag moves its items for the others while it goes,
|
|
48
|
+
* and is one undo step from its start to its end, however long it pauses.
|
|
49
|
+
*/
|
|
50
|
+
readonly live?: {
|
|
51
|
+
readonly startDrag: () => void
|
|
52
|
+
readonly endDrag: () => void
|
|
53
|
+
/** Ends the undo step being made: a board's edit is one step of its own. */
|
|
54
|
+
readonly stopCapturing: () => void
|
|
55
|
+
/** Tells the others what is selected. */
|
|
56
|
+
readonly select: (ids: readonly string[]) => void
|
|
57
|
+
/** Edits what a board's page shows, as one step of the same undo. */
|
|
58
|
+
readonly editBoard: LiveCanvas["editBoard"]
|
|
59
|
+
}
|
|
45
60
|
}
|
|
46
61
|
|
|
62
|
+
/** How often a drag tells the others where its items are, at most. */
|
|
63
|
+
const DRAG_SHARE_MS = 50
|
|
64
|
+
|
|
47
65
|
/** The grid items snap to as they move and resize. */
|
|
48
66
|
const GRID = 8
|
|
49
67
|
/** What an item added from the toolbar first measures, to place it in the middle of the view. */
|
|
@@ -68,30 +86,72 @@ export function useBoardEditing(
|
|
|
68
86
|
const messages = useArtifactMessages().canvas.toolbar
|
|
69
87
|
const store = useStoreApi()
|
|
70
88
|
const graph = useMemo(() => canvasGraph(canvas), [canvas])
|
|
89
|
+
const read = useReadGraph(graph, store)
|
|
71
90
|
const editing = !!edit
|
|
72
91
|
const [nodes, setNodes] = useState<Node[]>(graph.nodes)
|
|
73
92
|
const [edges, setEdges] = useState<Edge[]>(graph.edges)
|
|
93
|
+
// Which of the graph's nodes and edges each one drawn now was made from: one whose item did
|
|
94
|
+
// not change is kept as it is, so React Flow draws again only the items that changed.
|
|
95
|
+
const [madeFrom] = useState(() => new WeakMap<object, object>())
|
|
74
96
|
const selected = useRef<ReadonlySet<string>>(new Set())
|
|
75
97
|
const [selection, setSelection] = useState<ReadonlySet<string>>(new Set())
|
|
76
98
|
const [typing, setTyping] = useState<string | null>(null)
|
|
77
99
|
const root = useRef<HTMLDivElement | null>(null)
|
|
78
100
|
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
// Editing, drawn from the canvas as it changes, what was selected still selected, what React
|
|
102
|
+
// Flow measured kept, and an item being dragged where the drag has it. Brought up to date as
|
|
103
|
+
// the board draws, not in an effect after it, so a change of the canvas is one commit. Read, the
|
|
104
|
+
// graph is drawn as it is, and nothing is kept.
|
|
105
|
+
const [drawnFrom, setDrawnFrom] = useState<{
|
|
106
|
+
readonly graph: typeof graph | null
|
|
107
|
+
readonly editing: boolean
|
|
108
|
+
}>({ graph: null, editing: false })
|
|
109
|
+
if (drawnFrom.graph !== graph || drawnFrom.editing !== editing) {
|
|
110
|
+
if (editing || drawnFrom.editing) setDrawnFrom({ graph, editing })
|
|
111
|
+
if (editing) {
|
|
112
|
+
const chosen = selected.current
|
|
113
|
+
setNodes((current) => {
|
|
114
|
+
const drawn = new Map(current.map((node) => [node.id, node]))
|
|
115
|
+
const next = graph.nodes.map((node) => {
|
|
116
|
+
const was = drawn.get(node.id)
|
|
117
|
+
const choose = node.type !== "point"
|
|
118
|
+
const isSelected = choose && chosen.has(node.id)
|
|
119
|
+
const same =
|
|
120
|
+
was &&
|
|
121
|
+
madeFrom.get(was) === node &&
|
|
122
|
+
!!was.draggable === choose &&
|
|
123
|
+
!!was.selected === isSelected &&
|
|
124
|
+
!was.dragging
|
|
125
|
+
if (same) return was
|
|
126
|
+
|
|
127
|
+
const next: Node = {
|
|
128
|
+
...node,
|
|
129
|
+
...(choose ? { draggable: true, selectable: true, selected: isSelected } : {}),
|
|
130
|
+
...(was?.measured ? { measured: was.measured } : {}),
|
|
131
|
+
...(was?.dragging ? { position: was.position, dragging: true } : {}),
|
|
132
|
+
}
|
|
133
|
+
madeFrom.set(next, node)
|
|
134
|
+
return next
|
|
135
|
+
})
|
|
136
|
+
return sameItems(current, next) ? current : next
|
|
137
|
+
})
|
|
138
|
+
setEdges((current) => {
|
|
139
|
+
const drawn = new Map(current.map((edge) => [edge.id, edge]))
|
|
140
|
+
const next = graph.edges.map((edge) => {
|
|
141
|
+
const was = drawn.get(edge.id)
|
|
142
|
+
const isSelected = chosen.has(edge.id)
|
|
143
|
+
const same =
|
|
144
|
+
was && madeFrom.get(was) === edge && !!was.selectable && !!was.selected === isSelected
|
|
145
|
+
if (same) return was
|
|
146
|
+
|
|
147
|
+
const next: Edge = { ...edge, selectable: true, selected: isSelected }
|
|
148
|
+
madeFrom.set(next, edge)
|
|
149
|
+
return next
|
|
150
|
+
})
|
|
151
|
+
return sameItems(current, next) ? current : next
|
|
152
|
+
})
|
|
153
|
+
}
|
|
154
|
+
}
|
|
95
155
|
useEffect(() => {
|
|
96
156
|
if (!editing) {
|
|
97
157
|
selected.current = new Set()
|
|
@@ -123,6 +183,16 @@ export function useBoardEditing(
|
|
|
123
183
|
|
|
124
184
|
const focusBoard = useCallback(() => root.current?.focus({ preventScroll: true }), [])
|
|
125
185
|
|
|
186
|
+
// The others see what this reader selects.
|
|
187
|
+
const share = edit?.live?.select
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
share?.([...selection])
|
|
190
|
+
}, [share, selection])
|
|
191
|
+
useEffect(() => () => share?.([]), [share])
|
|
192
|
+
|
|
193
|
+
// A drag tells the others where its items are as it goes, a few times a second at most.
|
|
194
|
+
const dragShared = useRef(0)
|
|
195
|
+
|
|
126
196
|
const items: CanvasItemEditing | null = useMemo(
|
|
127
197
|
() =>
|
|
128
198
|
edit
|
|
@@ -141,7 +211,7 @@ export function useBoardEditing(
|
|
|
141
211
|
)
|
|
142
212
|
|
|
143
213
|
if (!edit) {
|
|
144
|
-
return { nodes:
|
|
214
|
+
return { nodes: read.nodes, edges: read.edges, editing: false as const, root }
|
|
145
215
|
}
|
|
146
216
|
|
|
147
217
|
const chosenItems = canvas.items.filter((item) => selection.has(item.id))
|
|
@@ -157,7 +227,7 @@ export function useBoardEditing(
|
|
|
157
227
|
}
|
|
158
228
|
const text = kind === "text" ? messages.newText : kind === "section" ? messages.newSection : ""
|
|
159
229
|
const added = addItem(kind, at, text)
|
|
160
|
-
const id = added.id
|
|
230
|
+
const id = added.id
|
|
161
231
|
edit.apply((current) => {
|
|
162
232
|
const next = added.change(current)
|
|
163
233
|
return shape && shape !== "rect" ? styleItems(new Set([id]), { shape })(next) : next
|
|
@@ -276,8 +346,18 @@ export function useBoardEditing(
|
|
|
276
346
|
setEdges((current) => applyEdgeChanges(changes, current))
|
|
277
347
|
if (changes.some((change) => change.type === "select")) chose(changes)
|
|
278
348
|
},
|
|
279
|
-
|
|
280
|
-
|
|
349
|
+
onNodeDragStart: () => edit.live?.startDrag(),
|
|
350
|
+
onNodeDrag: (_: unknown, __: Node, dragged: Node[]) => {
|
|
351
|
+
if (!edit.live) return
|
|
352
|
+
const now = performance.now()
|
|
353
|
+
if (now - dragShared.current < DRAG_SHARE_MS) return
|
|
354
|
+
dragShared.current = now
|
|
355
|
+
edit.apply(moveItems(new Map(dragged.map((node) => [node.id, node.position] as const))))
|
|
356
|
+
},
|
|
357
|
+
onNodeDragStop: (_: unknown, __: Node, dragged: Node[]) => {
|
|
358
|
+
edit.apply(moveItems(new Map(dragged.map((node) => [node.id, node.position] as const))))
|
|
359
|
+
edit.live?.endDrag()
|
|
360
|
+
},
|
|
281
361
|
onConnect: (connection: Connection) =>
|
|
282
362
|
edit.apply(connectItems(connection.source, connection.target)),
|
|
283
363
|
onNodeDoubleClick: (_: unknown, node: Node) => {
|
|
@@ -299,3 +379,48 @@ export function useBoardEditing(
|
|
|
299
379
|
},
|
|
300
380
|
}
|
|
301
381
|
}
|
|
382
|
+
|
|
383
|
+
/** Whether two lists hold the same items, in the same order. */
|
|
384
|
+
function sameItems<T>(left: readonly T[], right: readonly T[]): boolean {
|
|
385
|
+
return left.length === right.length && left.every((item, index) => item === right[index])
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* The graph as a read board hands it to React Flow. Its lists stay the ones given before while
|
|
390
|
+
* they hold the same items: React Flow takes a list in again, and works out every arrow's ends,
|
|
391
|
+
* whenever it is a new one. A node made again, as for an item someone moved, keeps the size React
|
|
392
|
+
* Flow measured while its own stays the same: without it, React Flow measures it again, in a
|
|
393
|
+
* commit of its own that redraws every arrow.
|
|
394
|
+
*/
|
|
395
|
+
function useReadGraph(
|
|
396
|
+
graph: { readonly nodes: Node[]; readonly edges: Edge[] },
|
|
397
|
+
store: ReturnType<typeof useStoreApi>
|
|
398
|
+
): { readonly nodes: Node[]; readonly edges: Edge[] } {
|
|
399
|
+
// Caches of what the graph draws as: one kept from a render that was thrown away is as good.
|
|
400
|
+
const [measuredFrom] = useState(() => new WeakMap<Node, Node>())
|
|
401
|
+
const last = useRef<{ readonly nodes: Node[]; readonly edges: Edge[] } | null>(null)
|
|
402
|
+
|
|
403
|
+
const { nodeLookup } = store.getState()
|
|
404
|
+
const measured = graph.nodes.map((node) => {
|
|
405
|
+
const kept = measuredFrom.get(node)
|
|
406
|
+
if (kept) return kept
|
|
407
|
+
|
|
408
|
+
const drawn = nodeLookup.get(node.id)
|
|
409
|
+
const same =
|
|
410
|
+
drawn?.measured.width !== undefined &&
|
|
411
|
+
drawn.measured.height !== undefined &&
|
|
412
|
+
drawn.internals.userNode.width === node.width &&
|
|
413
|
+
drawn.internals.userNode.height === node.height
|
|
414
|
+
const next = same ? { ...node, measured: { ...drawn.measured } } : node
|
|
415
|
+
measuredFrom.set(node, next)
|
|
416
|
+
return next
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
const nodes =
|
|
420
|
+
last.current && sameItems(last.current.nodes, measured) ? last.current.nodes : measured
|
|
421
|
+
const edges =
|
|
422
|
+
last.current && sameItems(last.current.edges, graph.edges) ? last.current.edges : graph.edges
|
|
423
|
+
if (nodes !== last.current?.nodes || edges !== last.current?.edges)
|
|
424
|
+
last.current = { nodes, edges }
|
|
425
|
+
return last.current
|
|
426
|
+
}
|
|
@@ -1,27 +1,92 @@
|
|
|
1
|
-
import type { CanvasBoard } from "@sixb/core/artifacts"
|
|
1
|
+
import type { CanvasArrow, CanvasBoard, FrameZoom, FrameZoomStep } from "@sixb/core/artifacts"
|
|
2
|
+
import { cn } from "@sixb/ui/lib/utils"
|
|
2
3
|
import { ArrowLeft, ChevronLeft, ChevronRight } from "lucide-react"
|
|
3
|
-
import { type ReactNode, useEffect } from "react"
|
|
4
|
-
import {
|
|
4
|
+
import { type ReactNode, useCallback, useEffect, useMemo, useState } from "react"
|
|
5
|
+
import type { LiveArtifact } from "../../live/session"
|
|
5
6
|
import { useArtifactMessages } from "../../messages"
|
|
6
7
|
import type { ArtifactVersion } from "../../queries"
|
|
8
|
+
import { type BoardEditor, BoardStage, type CommentPick, type StageMode } from "./board-editor"
|
|
9
|
+
import type { DraftPlace, PinPlace } from "./comment-pins"
|
|
10
|
+
import { ZoomBar } from "./controls"
|
|
11
|
+
import type { Box } from "./draft"
|
|
12
|
+
import { PageResizer } from "./page-resize"
|
|
13
|
+
import type { PageSize, SizeName, SnappedSize } from "./page-size"
|
|
14
|
+
import { SizeControls } from "./page-size-controls"
|
|
15
|
+
import { usePageZoom } from "./page-zoom"
|
|
16
|
+
import { useShownSize } from "./shown-size"
|
|
17
|
+
|
|
18
|
+
/** How long a size kept as the board's is said. */
|
|
19
|
+
const KEPT_MS = 2400
|
|
7
20
|
|
|
8
21
|
/**
|
|
9
|
-
* A board opened over the canvas: its page at
|
|
10
|
-
*
|
|
11
|
-
* boards in the canvas's order, and Esc
|
|
22
|
+
* A board opened over the canvas: its page at the board's own size, as the canvas and its picture
|
|
23
|
+
* show it, and answering like a page. Its picture shows until the page is ready, and stays, with
|
|
24
|
+
* a word, if the page never is. ← and → step through the boards in the canvas's order, and Esc
|
|
25
|
+
* goes back to the canvas.
|
|
26
|
+
*
|
|
27
|
+
* It opens fitted: whole, or, taller than wide, to its width, scrolling down it as a document's
|
|
28
|
+
* page. The zoom bar, a pinch or ⌘ with the wheel over it, ⌘ +, − and 0, and a double-click beside
|
|
29
|
+
* it zoom it. Its edges resize it for the reader alone, laid out again at that size while it is
|
|
30
|
+
* open, until they go back to the board's size; whoever may change the canvas keeps it as the
|
|
31
|
+
* board's.
|
|
32
|
+
*
|
|
33
|
+
* It is a prototype too: pressing a button or a link within the page that reads as the label of an
|
|
34
|
+
* arrow leaving the board opens the board the arrow points to.
|
|
35
|
+
*
|
|
36
|
+
* Opened from a canvas edited live, its elements are edited in place; placing a comment, a click
|
|
37
|
+
* picks the element it is about. Its comments' pins show over it.
|
|
12
38
|
*/
|
|
13
39
|
export function BoardFocus({
|
|
14
40
|
version,
|
|
15
41
|
boards,
|
|
42
|
+
arrows,
|
|
16
43
|
id,
|
|
44
|
+
pictureOf,
|
|
17
45
|
onOpen,
|
|
18
46
|
onClose,
|
|
47
|
+
live = null,
|
|
48
|
+
canvas = null,
|
|
49
|
+
mode = "read",
|
|
50
|
+
pins = [],
|
|
51
|
+
activePin = null,
|
|
52
|
+
draft = null,
|
|
53
|
+
tools,
|
|
54
|
+
onEscape,
|
|
55
|
+
onPick,
|
|
56
|
+
onOpenPin,
|
|
57
|
+
onSubmitDraft,
|
|
58
|
+
onCancelDraft,
|
|
59
|
+
onResizeBoard,
|
|
19
60
|
}: {
|
|
20
61
|
readonly version: ArtifactVersion
|
|
21
62
|
readonly boards: readonly CanvasBoard[]
|
|
63
|
+
readonly arrows: readonly CanvasArrow[]
|
|
22
64
|
readonly id: string
|
|
65
|
+
/** A board's picture at its own size, when it has one. */
|
|
66
|
+
readonly pictureOf?: (id: string) => string | undefined
|
|
23
67
|
readonly onOpen: (id: string) => void
|
|
24
68
|
readonly onClose: () => void
|
|
69
|
+
/** The canvas held live: the board shows what its document holds now. */
|
|
70
|
+
readonly live?: LiveArtifact | null
|
|
71
|
+
/** What edits the board's elements, while the reader edits the canvas. */
|
|
72
|
+
readonly canvas?: BoardEditor | null
|
|
73
|
+
readonly mode?: StageMode
|
|
74
|
+
readonly pins?: readonly PinPlace[]
|
|
75
|
+
readonly activePin?: string | null
|
|
76
|
+
readonly draft?: DraftPlace | null
|
|
77
|
+
/** The comment tools, in the header. */
|
|
78
|
+
readonly tools?: ReactNode
|
|
79
|
+
/** Esc, before it closes the board: true when it was taken, as a comment given up. */
|
|
80
|
+
readonly onEscape?: () => boolean
|
|
81
|
+
readonly onPick?: (board: string, pick: CommentPick) => void
|
|
82
|
+
readonly onOpenPin?: (id: string) => void
|
|
83
|
+
readonly onSubmitDraft?: (body: string) => Promise<void>
|
|
84
|
+
readonly onCancelDraft?: () => void
|
|
85
|
+
/**
|
|
86
|
+
* Resizes a board on the canvas, as its handles do while the canvas is edited: Keep this size.
|
|
87
|
+
* Absent for whoever may not change the canvas.
|
|
88
|
+
*/
|
|
89
|
+
readonly onResizeBoard?: (id: string, box: Box) => void
|
|
25
90
|
}) {
|
|
26
91
|
const messages = useArtifactMessages().canvas
|
|
27
92
|
const index = boards.findIndex((board) => board.id === id)
|
|
@@ -29,29 +94,105 @@ export function BoardFocus({
|
|
|
29
94
|
const previous = boards[index - 1]
|
|
30
95
|
const next = boards[index + 1]
|
|
31
96
|
|
|
97
|
+
const [kept, setKept] = useState<PageSize | null>(null)
|
|
98
|
+
const own = useMemo(() => ({ w: board?.w ?? 1, h: board?.h ?? 1 }), [board?.w, board?.h])
|
|
99
|
+
const size = useShownSize(id, own)
|
|
100
|
+
const { shown, resized, suggestions } = size
|
|
101
|
+
|
|
102
|
+
const [stage, setStage] = useState<HTMLDivElement | null>(null)
|
|
103
|
+
const view = useSize(stage)
|
|
104
|
+
const zoom = usePageZoom({ id, page: shown, view, stage })
|
|
105
|
+
|
|
106
|
+
/** A size picked from the menu: the page fitted at it. */
|
|
107
|
+
const pickSize = (picked: PageSize, name: SizeName) => {
|
|
108
|
+
size.pick(picked, name)
|
|
109
|
+
zoom.fit("open")
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const reset = () => {
|
|
113
|
+
size.reset()
|
|
114
|
+
zoom.fit("open")
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** A resize ends: what it snapped to says whether its width carries to the other boards. */
|
|
118
|
+
const resizedBy = (snapped: SnappedSize | null) => {
|
|
119
|
+
zoom.release()
|
|
120
|
+
if (snapped) size.settle(snapped)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const keep =
|
|
124
|
+
onResizeBoard && board
|
|
125
|
+
? () => {
|
|
126
|
+
onResizeBoard(board.id, { x: board.x, y: board.y, w: shown.w, h: shown.h })
|
|
127
|
+
size.keep()
|
|
128
|
+
setKept(shown)
|
|
129
|
+
}
|
|
130
|
+
: undefined
|
|
131
|
+
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (!kept) return
|
|
134
|
+
const timer = window.setTimeout(() => setKept(null), KEPT_MS)
|
|
135
|
+
return () => window.clearTimeout(timer)
|
|
136
|
+
}, [kept])
|
|
137
|
+
|
|
138
|
+
const { step, zoomTo, zoomBy } = zoom
|
|
139
|
+
const zoomStep = useCallback(
|
|
140
|
+
(to: FrameZoomStep) => (to === "actual" ? zoomTo(1) : step(to)),
|
|
141
|
+
[step, zoomTo]
|
|
142
|
+
)
|
|
143
|
+
const onZoom = useCallback(
|
|
144
|
+
(by: FrameZoom) => ("step" in by ? zoomStep(by.step) : zoomBy(by.factor, by.at)),
|
|
145
|
+
[zoomStep, zoomBy]
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
const onPress = useCallback(
|
|
149
|
+
(text: string) => {
|
|
150
|
+
const to = followedArrow(arrows, boards, id, text)
|
|
151
|
+
if (to) onOpen(to)
|
|
152
|
+
},
|
|
153
|
+
[arrows, boards, id, onOpen]
|
|
154
|
+
)
|
|
155
|
+
const pick = useCallback((place: CommentPick) => onPick?.(id, place), [onPick, id])
|
|
156
|
+
|
|
32
157
|
useEffect(() => {
|
|
33
158
|
const onKey = (event: KeyboardEvent) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
159
|
+
// ⌘ +, − and 0 zoom the board, not the app around it.
|
|
160
|
+
if (event.metaKey || event.ctrlKey) {
|
|
161
|
+
const to = zoomKey(event)
|
|
162
|
+
if (to) {
|
|
163
|
+
event.preventDefault()
|
|
164
|
+
zoomStep(to)
|
|
165
|
+
}
|
|
166
|
+
return
|
|
167
|
+
}
|
|
168
|
+
if (event.altKey) return
|
|
169
|
+
// Keys typed into a field are the field's, and a menu's are its own; arrows on the page's
|
|
170
|
+
// handles and their suggestions resize it.
|
|
171
|
+
const target = event.target instanceof Element ? event.target : null
|
|
37
172
|
if (
|
|
38
|
-
target
|
|
39
|
-
|
|
173
|
+
target?.closest(
|
|
174
|
+
"input, textarea, select, [contenteditable], [data-board-tools], [role=menu]"
|
|
175
|
+
)
|
|
40
176
|
) {
|
|
41
177
|
return
|
|
42
178
|
}
|
|
43
|
-
if (event.key
|
|
44
|
-
|
|
179
|
+
if (event.key !== "Escape" && target?.closest("[data-page-resizer]")) return
|
|
180
|
+
if (event.key === "Escape") {
|
|
181
|
+
if (!onEscape?.()) onClose()
|
|
182
|
+
} else if (event.key === "ArrowLeft" && previous) onOpen(previous.id)
|
|
45
183
|
else if (event.key === "ArrowRight" && next) onOpen(next.id)
|
|
46
184
|
else return
|
|
47
185
|
event.preventDefault()
|
|
48
186
|
}
|
|
49
187
|
window.addEventListener("keydown", onKey)
|
|
50
188
|
return () => window.removeEventListener("keydown", onKey)
|
|
51
|
-
}, [previous, next, onOpen, onClose])
|
|
189
|
+
}, [previous, next, onOpen, onClose, onEscape, zoomStep])
|
|
52
190
|
|
|
53
191
|
if (!board) return null
|
|
54
192
|
const title = board.title ?? board.id
|
|
193
|
+
const { scale, placement } = zoom
|
|
194
|
+
const picture = resized ? undefined : pictureOf?.(board.id)
|
|
195
|
+
|
|
55
196
|
return (
|
|
56
197
|
<div
|
|
57
198
|
role="dialog"
|
|
@@ -69,7 +210,24 @@ export function BoardFocus({
|
|
|
69
210
|
</button>
|
|
70
211
|
<span className="h-5 w-px bg-border" aria-hidden="true" />
|
|
71
212
|
<span className="min-w-0 truncate px-1 text-sm font-semibold">{title}</span>
|
|
72
|
-
|
|
213
|
+
{mode === "edit" || mode === "comment" ? (
|
|
214
|
+
<span className="hidden min-w-0 truncate text-xs text-muted-foreground @5xl/canvas:inline">
|
|
215
|
+
{mode === "edit" ? messages.edit.hint : messages.comments.modeHint}
|
|
216
|
+
</span>
|
|
217
|
+
) : null}
|
|
218
|
+
<div className="ml-auto flex shrink-0 items-center">
|
|
219
|
+
<SizeControls
|
|
220
|
+
shown={shown}
|
|
221
|
+
board={own}
|
|
222
|
+
suggestions={suggestions}
|
|
223
|
+
kept={kept}
|
|
224
|
+
onPick={pickSize}
|
|
225
|
+
onReset={reset}
|
|
226
|
+
onKeep={keep}
|
|
227
|
+
/>
|
|
228
|
+
{tools}
|
|
229
|
+
</div>
|
|
230
|
+
<span className="shrink-0 text-xs whitespace-nowrap text-muted-foreground tabular-nums max-sm:hidden">
|
|
73
231
|
{messages.position(index + 1, boards.length)}
|
|
74
232
|
</span>
|
|
75
233
|
<Step
|
|
@@ -83,25 +241,162 @@ export function BoardFocus({
|
|
|
83
241
|
<ChevronRight className="size-4" aria-hidden="true" />
|
|
84
242
|
</Step>
|
|
85
243
|
</div>
|
|
86
|
-
<div className="
|
|
244
|
+
<div className="relative min-h-0 flex-1 bg-muted/40">
|
|
245
|
+
{/* Scrolled over the page when it is larger than the view; pinched, zoomed instead. */}
|
|
87
246
|
<div
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
247
|
+
ref={setStage}
|
|
248
|
+
data-board-stage=""
|
|
249
|
+
className="absolute inset-0 touch-pan-x touch-pan-y overflow-auto overscroll-contain"
|
|
250
|
+
onDoubleClick={(event) => {
|
|
251
|
+
if ((event.target as Element).closest("[data-board-page]")) return
|
|
252
|
+
const at = zoom.pageAt(event.clientX, event.clientY)
|
|
253
|
+
if (at) zoom.toggle(at)
|
|
254
|
+
}}
|
|
91
255
|
>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
256
|
+
{placement && scale > 0 ? (
|
|
257
|
+
<div className="relative" style={{ width: placement.width, height: placement.height }}>
|
|
258
|
+
{/* The box the page takes on screen; the page inside is laid out at its size. */}
|
|
259
|
+
<div
|
|
260
|
+
key={board.id}
|
|
261
|
+
data-board-page=""
|
|
262
|
+
className={cn(
|
|
263
|
+
"group/page sixb-canvas-surface absolute motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-97 motion-safe:duration-300 motion-safe:ease-out",
|
|
264
|
+
zoom.settling ? "motion-safe:transition-[left,top] motion-safe:ease-out" : null
|
|
265
|
+
)}
|
|
266
|
+
style={{
|
|
267
|
+
left: placement.left,
|
|
268
|
+
top: placement.top,
|
|
269
|
+
width: shown.w * scale,
|
|
270
|
+
height: shown.h * scale,
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
273
|
+
<BoardStage
|
|
274
|
+
version={version}
|
|
275
|
+
board={board}
|
|
276
|
+
size={shown}
|
|
277
|
+
title={title}
|
|
278
|
+
scale={scale}
|
|
279
|
+
live={live}
|
|
280
|
+
canvas={canvas}
|
|
281
|
+
mode={mode}
|
|
282
|
+
pins={pins.filter((pin) => pin.board === board.id)}
|
|
283
|
+
activePin={activePin}
|
|
284
|
+
draft={draft?.board === board.id ? draft : null}
|
|
285
|
+
// Its picture is of the board at its own size.
|
|
286
|
+
fallback={picture ? <BoardPicture src={picture} /> : undefined}
|
|
287
|
+
failure={
|
|
288
|
+
<div className="relative size-full">
|
|
289
|
+
{picture ? <BoardPicture src={picture} /> : null}
|
|
290
|
+
<p className="absolute inset-x-0 bottom-0 m-0 bg-background/90 px-4 py-2 text-sm text-muted-foreground">
|
|
291
|
+
{messages.boardFailed}
|
|
292
|
+
</p>
|
|
293
|
+
</div>
|
|
294
|
+
}
|
|
295
|
+
onPress={onPress}
|
|
296
|
+
onPick={pick}
|
|
297
|
+
onOpenPin={(pin) => onOpenPin?.(pin)}
|
|
298
|
+
onSubmitDraft={(body) => onSubmitDraft?.(body) ?? Promise.resolve()}
|
|
299
|
+
onCancelDraft={() => onCancelDraft?.()}
|
|
300
|
+
onContentHeight={size.onContentHeight}
|
|
301
|
+
onZoom={onZoom}
|
|
302
|
+
/>
|
|
303
|
+
<PageResizer
|
|
304
|
+
size={shown}
|
|
305
|
+
scale={scale}
|
|
306
|
+
suggestions={suggestions}
|
|
307
|
+
stage={stage}
|
|
308
|
+
onStart={zoom.hold}
|
|
309
|
+
onResize={size.resize}
|
|
310
|
+
onEnd={resizedBy}
|
|
311
|
+
/>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
) : null}
|
|
99
315
|
</div>
|
|
316
|
+
|
|
317
|
+
<ZoomBar
|
|
318
|
+
zoom={scale}
|
|
319
|
+
fitLabel={messages.fitPage}
|
|
320
|
+
onZoomOut={() => zoom.step("out")}
|
|
321
|
+
onActualSize={() => zoom.zoomTo(1)}
|
|
322
|
+
onZoomIn={() => zoom.step("in")}
|
|
323
|
+
onFit={() => zoom.fit("whole")}
|
|
324
|
+
className="absolute bottom-3 left-3 z-20"
|
|
325
|
+
/>
|
|
100
326
|
</div>
|
|
101
327
|
</div>
|
|
102
328
|
)
|
|
103
329
|
}
|
|
104
330
|
|
|
331
|
+
/** ⌘ or Ctrl with +, − or 0 as a zoom step. */
|
|
332
|
+
export function zoomKey(event: KeyboardEvent): FrameZoomStep | null {
|
|
333
|
+
if (event.altKey) return null
|
|
334
|
+
if (event.key === "=" || event.key === "+") return "in"
|
|
335
|
+
if (event.key === "-") return "out"
|
|
336
|
+
if (event.key === "0") return "actual"
|
|
337
|
+
return null
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* The board an arrow leaving `from` points to, when its label reads as `pressed`, case and spaces
|
|
342
|
+
* aside: the first such arrow the canvas lists, to a board.
|
|
343
|
+
*/
|
|
344
|
+
export function followedArrow(
|
|
345
|
+
arrows: readonly CanvasArrow[],
|
|
346
|
+
boards: readonly CanvasBoard[],
|
|
347
|
+
from: string,
|
|
348
|
+
pressed: string
|
|
349
|
+
): string | null {
|
|
350
|
+
const words = wordsOf(pressed)
|
|
351
|
+
for (const arrow of arrows) {
|
|
352
|
+
const to = arrow.to
|
|
353
|
+
if (arrow.from !== from || typeof to !== "string" || !arrow.label) continue
|
|
354
|
+
if (wordsOf(arrow.label) !== words) continue
|
|
355
|
+
if (boards.some((board) => board.id === to)) return to
|
|
356
|
+
}
|
|
357
|
+
return null
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
function wordsOf(text: string): string {
|
|
361
|
+
return text.replace(/\s+/g, " ").trim().toLowerCase()
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** A board's picture at its own size, drawn from its top as its tile draws it. */
|
|
365
|
+
function BoardPicture({ src }: { readonly src: string }) {
|
|
366
|
+
return (
|
|
367
|
+
<img
|
|
368
|
+
src={src}
|
|
369
|
+
alt=""
|
|
370
|
+
decoding="async"
|
|
371
|
+
draggable={false}
|
|
372
|
+
className="absolute inset-0 block size-full object-contain object-top"
|
|
373
|
+
/>
|
|
374
|
+
)
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/** An element's size as it is laid out, followed as it changes; null until it is measured. */
|
|
378
|
+
function useSize(element: HTMLElement | null): { width: number; height: number } | null {
|
|
379
|
+
const [size, setSize] = useState<{ width: number; height: number } | null>(null)
|
|
380
|
+
|
|
381
|
+
useEffect(() => {
|
|
382
|
+
if (!element) return
|
|
383
|
+
|
|
384
|
+
const measure = () => {
|
|
385
|
+
const width = element.clientWidth
|
|
386
|
+
const height = element.clientHeight
|
|
387
|
+
setSize((last) =>
|
|
388
|
+
last && last.width === width && last.height === height ? last : { width, height }
|
|
389
|
+
)
|
|
390
|
+
}
|
|
391
|
+
measure()
|
|
392
|
+
const observer = new ResizeObserver(measure)
|
|
393
|
+
observer.observe(element)
|
|
394
|
+
return () => observer.disconnect()
|
|
395
|
+
}, [element])
|
|
396
|
+
|
|
397
|
+
return size
|
|
398
|
+
}
|
|
399
|
+
|
|
105
400
|
function Step({
|
|
106
401
|
label,
|
|
107
402
|
disabled,
|