@sixb/app 0.2.0 → 0.2.3
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/assets/connector-icons/README.md +1 -0
- package/assets/connector-icons/fleetio.ico +0 -0
- 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-card.d.ts +10 -0
- package/dist/agent/background/background-card.d.ts.map +1 -0
- package/dist/agent/background/background-tool-row.d.ts +9 -0
- package/dist/agent/background/background-tool-row.d.ts.map +1 -0
- package/dist/agent/background/context.d.ts +23 -0
- package/dist/agent/background/context.d.ts.map +1 -0
- package/dist/agent/background/interpret.d.ts +116 -0
- package/dist/agent/background/interpret.d.ts.map +1 -0
- package/dist/agent/bash/bash-tool-view.d.ts.map +1 -1
- package/dist/agent/bash/interpret.d.ts +4 -0
- package/dist/agent/bash/interpret.d.ts.map +1 -1
- package/dist/agent/components/composer-menu.d.ts +3 -1
- package/dist/agent/components/composer-menu.d.ts.map +1 -1
- package/dist/agent/components/composer-place.d.ts +13 -0
- package/dist/agent/components/composer-place.d.ts.map +1 -0
- package/dist/agent/components/composer.d.ts +23 -1
- package/dist/agent/components/composer.d.ts.map +1 -1
- package/dist/agent/components/computer-place.d.ts +3 -1
- package/dist/agent/components/computer-place.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 +3 -1
- 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 +6 -0
- package/dist/agent/components/transcript.d.ts.map +1 -1
- package/dist/agent/components/web-fetch-tool-view.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/child-parts.d.ts +2 -0
- package/dist/agent/delegation/child-parts.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/hooks/use-agent-conversation.d.ts +24 -4
- package/dist/agent/hooks/use-agent-conversation.d.ts.map +1 -1
- package/dist/agent/hooks/use-new-thread-place.d.ts +70 -0
- package/dist/agent/hooks/use-new-thread-place.d.ts.map +1 -0
- package/dist/agent/hooks/use-thread-lists.d.ts +40 -0
- package/dist/agent/hooks/use-thread-lists.d.ts.map +1 -1
- package/dist/agent/i18n/en.d.ts +74 -0
- 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 +126 -0
- package/dist/agent/i18n/index.d.ts.map +1 -1
- package/dist/agent/observed-conversation.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/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/utils/web-fetch.d.ts +33 -1
- package/dist/agent/utils/web-fetch.d.ts.map +1 -1
- package/dist/agent/utils/web-search.d.ts +14 -2
- package/dist/agent/utils/web-search.d.ts.map +1 -1
- 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 +6 -6
- 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 +424 -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 +43 -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 +64 -19
- package/dist/artifacts/renderers/canvas/board.d.ts.map +1 -1
- package/dist/artifacts/renderers/canvas/canvas.d.ts +13 -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/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 +40 -5
- package/dist/artifacts/renderers/canvas/focus.d.ts.map +1 -1
- 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/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/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-fw2bm6dq.js → chunk-001c4gnk.js} +8086 -3870
- package/dist/chunk-001c4gnk.js.map +204 -0
- package/dist/chunk-00wggsst.js +7 -0
- package/dist/chunk-00wggsst.js.map +10 -0
- package/dist/chunk-5crvhjp2.js +4704 -0
- package/dist/chunk-5crvhjp2.js.map +28 -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-4mprsd2n.js → chunk-fg6thecb.js} +25 -1
- package/dist/chunk-fg6thecb.js.map +10 -0
- package/dist/{chunk-j9653e83.js → chunk-fwb9mxwm.js} +1 -1
- package/dist/{chunk-km25essq.js → chunk-kes4ygmz.js} +1 -1
- package/dist/{chunk-kwbw4dyk.js → chunk-ryed2jq8.js} +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/createCustomApp.d.ts.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +930 -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/shared.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 +2 -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 +8195 -4841
- package/dist/pages.js.map +58 -49
- 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 -2
- package/src/agent/agent-chat.tsx +51 -8
- package/src/agent/agent-panel.tsx +12 -0
- package/src/agent/agent-surface.tsx +4 -0
- package/src/agent/agent.css +18 -0
- package/src/agent/artifact-card.tsx +84 -16
- package/src/agent/artifact-panel.tsx +63 -43
- package/src/agent/background/background-card.tsx +308 -0
- package/src/agent/background/background-tool-row.tsx +58 -0
- package/src/agent/background/context.ts +26 -0
- package/src/agent/background/interpret.ts +356 -0
- package/src/agent/bash/bash-tool-view.tsx +9 -4
- package/src/agent/bash/interpret.ts +21 -3
- package/src/agent/components/agent-message-body.tsx +1 -1
- package/src/agent/components/composer-menu.tsx +4 -1
- package/src/agent/components/composer-place.tsx +168 -0
- package/src/agent/components/composer.tsx +101 -3
- package/src/agent/components/computer-place.tsx +18 -1
- package/src/agent/components/context-chips.tsx +72 -2
- package/src/agent/components/conversation-panel.tsx +3 -2
- package/src/agent/components/message-parts.tsx +6 -1
- package/src/agent/components/thread-artifacts-menu.tsx +22 -5
- package/src/agent/components/transcript.tsx +33 -1
- package/src/agent/components/web-fetch-tool-view.tsx +94 -29
- package/src/agent/composer-insertion.ts +36 -0
- package/src/agent/delegation/child-parts.tsx +1 -1
- package/src/agent/hooks/use-agent-conversation.ts +101 -8
- package/src/agent/hooks/use-new-thread-place.ts +294 -0
- package/src/agent/i18n/en.ts +70 -3
- package/src/agent/i18n/fr.ts +70 -3
- package/src/agent/observed-conversation.tsx +3 -0
- package/src/agent/publish-artifact/interpret.ts +27 -5
- 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/react-router.tsx +2 -2
- package/src/agent/tool-views/built-in.tsx +29 -11
- package/src/agent/types.ts +4 -0
- package/src/agent/utils/web-fetch.ts +89 -10
- package/src/agent/utils/web-search.ts +67 -28
- package/src/artifacts/artifact-page.tsx +42 -17
- package/src/artifacts/artifact-viewer.tsx +56 -0
- package/src/artifacts/artifacts.css +80 -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 +6 -6
- package/src/artifacts/file-source.ts +10 -3
- package/src/artifacts/frame.tsx +50 -12
- 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 +415 -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 +817 -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 +309 -33
- package/src/artifacts/renderers/canvas/canvas.tsx +387 -72
- 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/draft.ts +41 -50
- package/src/artifacts/renderers/canvas/edit-mode.tsx +145 -20
- package/src/artifacts/renderers/canvas/focus.tsx +175 -24
- package/src/artifacts/renderers/canvas/items.tsx +179 -52
- package/src/artifacts/renderers/canvas/layout.ts +99 -47
- 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/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 +205 -147
- package/src/build.ts +96 -11
- package/src/codegen.ts +83 -5
- package/src/createCustomApp.ts +20 -7
- package/src/index.ts +12 -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/shared.tsx +1 -0
- 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 +2 -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 +17 -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-4mprsd2n.js.map +0 -10
- package/dist/chunk-fw2bm6dq.js.map +0 -182
- package/dist/chunk-zxthr2q5.js +0 -1487
- package/dist/chunk-zxthr2q5.js.map +0 -18
- /package/dist/{chunk-j9653e83.js.map → chunk-fwb9mxwm.js.map} +0 -0
- /package/dist/{chunk-km25essq.js.map → chunk-kes4ygmz.js.map} +0 -0
- /package/dist/{chunk-kwbw4dyk.js.map → chunk-ryed2jq8.js.map} +0 -0
|
@@ -1,33 +1,86 @@
|
|
|
1
|
-
import type { CanvasBoard } from "@sixb/core/artifacts"
|
|
1
|
+
import type { CanvasArrow, CanvasBoard } from "@sixb/core/artifacts"
|
|
2
2
|
import { ArrowLeft, ChevronLeft, ChevronRight } from "lucide-react"
|
|
3
|
-
import { type ReactNode, useEffect } from "react"
|
|
4
|
-
import {
|
|
3
|
+
import { type ReactNode, useCallback, useEffect, useState } from "react"
|
|
4
|
+
import type { LiveArtifact } from "../../live/session"
|
|
5
5
|
import { useArtifactMessages } from "../../messages"
|
|
6
6
|
import type { ArtifactVersion } from "../../queries"
|
|
7
|
+
import { type BoardEditor, BoardStage, type CommentPick, type StageMode } from "./board-editor"
|
|
8
|
+
import type { DraftPlace, PinPlace } from "./comment-pins"
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
|
-
* A board opened over the canvas: its page at
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
* A board opened over the canvas: its page at the board's own size, as the canvas and its picture
|
|
12
|
+
* show it, scaled to fit the viewer, and answering like a page. Its picture shows until the page
|
|
13
|
+
* is ready, and stays, with a word, if the page never is. ← and → step through the boards in the
|
|
14
|
+
* canvas's order, and Esc goes back to the canvas.
|
|
15
|
+
*
|
|
16
|
+
* It is a prototype too: pressing a button or a link within the page that reads as the label of an
|
|
17
|
+
* arrow leaving the board opens the board the arrow points to.
|
|
18
|
+
*
|
|
19
|
+
* Opened from a canvas edited live, its elements are edited in place; placing a comment, a click
|
|
20
|
+
* picks the element it is about. Its comments' pins show over it.
|
|
12
21
|
*/
|
|
13
22
|
export function BoardFocus({
|
|
14
23
|
version,
|
|
15
24
|
boards,
|
|
25
|
+
arrows,
|
|
16
26
|
id,
|
|
27
|
+
pictureOf,
|
|
17
28
|
onOpen,
|
|
18
29
|
onClose,
|
|
30
|
+
live = null,
|
|
31
|
+
canvas = null,
|
|
32
|
+
mode = "read",
|
|
33
|
+
pins = [],
|
|
34
|
+
activePin = null,
|
|
35
|
+
draft = null,
|
|
36
|
+
tools,
|
|
37
|
+
onEscape,
|
|
38
|
+
onPick,
|
|
39
|
+
onOpenPin,
|
|
40
|
+
onSubmitDraft,
|
|
41
|
+
onCancelDraft,
|
|
19
42
|
}: {
|
|
20
43
|
readonly version: ArtifactVersion
|
|
21
44
|
readonly boards: readonly CanvasBoard[]
|
|
45
|
+
readonly arrows: readonly CanvasArrow[]
|
|
22
46
|
readonly id: string
|
|
47
|
+
/** A board's picture at its own size, when it has one. */
|
|
48
|
+
readonly pictureOf?: (id: string) => string | undefined
|
|
23
49
|
readonly onOpen: (id: string) => void
|
|
24
50
|
readonly onClose: () => void
|
|
51
|
+
/** The canvas held live: the board shows what its document holds now. */
|
|
52
|
+
readonly live?: LiveArtifact | null
|
|
53
|
+
/** What edits the board's elements, while the reader edits the canvas. */
|
|
54
|
+
readonly canvas?: BoardEditor | null
|
|
55
|
+
readonly mode?: StageMode
|
|
56
|
+
readonly pins?: readonly PinPlace[]
|
|
57
|
+
readonly activePin?: string | null
|
|
58
|
+
readonly draft?: DraftPlace | null
|
|
59
|
+
/** The comment tools, in the header. */
|
|
60
|
+
readonly tools?: ReactNode
|
|
61
|
+
/** Esc, before it closes the board: true when it was taken, as a comment given up. */
|
|
62
|
+
readonly onEscape?: () => boolean
|
|
63
|
+
readonly onPick?: (board: string, pick: CommentPick) => void
|
|
64
|
+
readonly onOpenPin?: (id: string) => void
|
|
65
|
+
readonly onSubmitDraft?: (body: string) => Promise<void>
|
|
66
|
+
readonly onCancelDraft?: () => void
|
|
25
67
|
}) {
|
|
26
68
|
const messages = useArtifactMessages().canvas
|
|
27
69
|
const index = boards.findIndex((board) => board.id === id)
|
|
28
70
|
const board = boards[index]
|
|
29
71
|
const previous = boards[index - 1]
|
|
30
72
|
const next = boards[index + 1]
|
|
73
|
+
const [stage, setStage] = useState<HTMLDivElement | null>(null)
|
|
74
|
+
const room = useSize(stage)
|
|
75
|
+
|
|
76
|
+
const onPress = useCallback(
|
|
77
|
+
(text: string) => {
|
|
78
|
+
const to = followedArrow(arrows, boards, id, text)
|
|
79
|
+
if (to) onOpen(to)
|
|
80
|
+
},
|
|
81
|
+
[arrows, boards, id, onOpen]
|
|
82
|
+
)
|
|
83
|
+
const pick = useCallback((place: CommentPick) => onPick?.(id, place), [onPick, id])
|
|
31
84
|
|
|
32
85
|
useEffect(() => {
|
|
33
86
|
const onKey = (event: KeyboardEvent) => {
|
|
@@ -36,22 +89,25 @@ export function BoardFocus({
|
|
|
36
89
|
const target = event.target
|
|
37
90
|
if (
|
|
38
91
|
target instanceof Element &&
|
|
39
|
-
target.closest("input, textarea, select, [contenteditable]")
|
|
92
|
+
target.closest("input, textarea, select, [contenteditable], [data-board-tools]")
|
|
40
93
|
) {
|
|
41
94
|
return
|
|
42
95
|
}
|
|
43
|
-
if (event.key === "Escape")
|
|
44
|
-
|
|
96
|
+
if (event.key === "Escape") {
|
|
97
|
+
if (!onEscape?.()) onClose()
|
|
98
|
+
} else if (event.key === "ArrowLeft" && previous) onOpen(previous.id)
|
|
45
99
|
else if (event.key === "ArrowRight" && next) onOpen(next.id)
|
|
46
100
|
else return
|
|
47
101
|
event.preventDefault()
|
|
48
102
|
}
|
|
49
103
|
window.addEventListener("keydown", onKey)
|
|
50
104
|
return () => window.removeEventListener("keydown", onKey)
|
|
51
|
-
}, [previous, next, onOpen, onClose])
|
|
105
|
+
}, [previous, next, onOpen, onClose, onEscape])
|
|
52
106
|
|
|
53
107
|
if (!board) return null
|
|
54
108
|
const title = board.title ?? board.id
|
|
109
|
+
const scale = room ? Math.min(MAX_SCALE, room.width / board.w, room.height / board.h) : 0
|
|
110
|
+
const picture = pictureOf?.(board.id)
|
|
55
111
|
return (
|
|
56
112
|
<div
|
|
57
113
|
role="dialog"
|
|
@@ -69,7 +125,15 @@ export function BoardFocus({
|
|
|
69
125
|
</button>
|
|
70
126
|
<span className="h-5 w-px bg-border" aria-hidden="true" />
|
|
71
127
|
<span className="min-w-0 truncate px-1 text-sm font-semibold">{title}</span>
|
|
72
|
-
|
|
128
|
+
{mode === "edit" || mode === "comment" ? (
|
|
129
|
+
<span className="hidden min-w-0 truncate text-xs text-muted-foreground @5xl/canvas:inline">
|
|
130
|
+
{mode === "edit" ? messages.edit.hint : messages.comments.modeHint}
|
|
131
|
+
</span>
|
|
132
|
+
) : null}
|
|
133
|
+
{tools ? <div className="ml-auto flex shrink-0 items-center">{tools}</div> : null}
|
|
134
|
+
<span
|
|
135
|
+
className={`${tools ? "" : "ml-auto "}shrink-0 text-xs whitespace-nowrap text-muted-foreground tabular-nums max-sm:hidden`}
|
|
136
|
+
>
|
|
73
137
|
{messages.position(index + 1, boards.length)}
|
|
74
138
|
</span>
|
|
75
139
|
<Step
|
|
@@ -83,25 +147,112 @@ export function BoardFocus({
|
|
|
83
147
|
<ChevronRight className="size-4" aria-hidden="true" />
|
|
84
148
|
</Step>
|
|
85
149
|
</div>
|
|
86
|
-
<div className="flex min-h-0 flex-1
|
|
87
|
-
<div
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
150
|
+
<div className="flex min-h-0 flex-1 overflow-hidden bg-muted/40 p-3 sm:p-6">
|
|
151
|
+
<div ref={setStage} className="flex min-h-0 min-w-0 flex-1 items-center justify-center">
|
|
152
|
+
{scale > 0 ? (
|
|
153
|
+
// The box the board takes on screen; the page inside is laid out at the board's size.
|
|
154
|
+
<div
|
|
155
|
+
key={board.id}
|
|
156
|
+
className="sixb-canvas-surface relative shrink-0 motion-safe:animate-in motion-safe:fade-in motion-safe:zoom-in-97 motion-safe:duration-300 motion-safe:ease-out"
|
|
157
|
+
style={{ width: board.w * scale, height: board.h * scale }}
|
|
158
|
+
>
|
|
159
|
+
<BoardStage
|
|
160
|
+
version={version}
|
|
161
|
+
board={board}
|
|
162
|
+
title={title}
|
|
163
|
+
scale={scale}
|
|
164
|
+
live={live}
|
|
165
|
+
canvas={canvas}
|
|
166
|
+
mode={mode}
|
|
167
|
+
pins={pins.filter((pin) => pin.board === board.id)}
|
|
168
|
+
activePin={activePin}
|
|
169
|
+
draft={draft?.board === board.id ? draft : null}
|
|
170
|
+
fallback={picture ? <BoardPicture src={picture} /> : undefined}
|
|
171
|
+
failure={
|
|
172
|
+
<div className="relative size-full">
|
|
173
|
+
{picture ? <BoardPicture src={picture} /> : null}
|
|
174
|
+
<p className="absolute inset-x-0 bottom-0 m-0 bg-background/90 px-4 py-2 text-sm text-muted-foreground">
|
|
175
|
+
{messages.boardFailed}
|
|
176
|
+
</p>
|
|
177
|
+
</div>
|
|
178
|
+
}
|
|
179
|
+
onPress={onPress}
|
|
180
|
+
onPick={pick}
|
|
181
|
+
onOpenPin={(pin) => onOpenPin?.(pin)}
|
|
182
|
+
onSubmitDraft={(body) => onSubmitDraft?.(body) ?? Promise.resolve()}
|
|
183
|
+
onCancelDraft={() => onCancelDraft?.()}
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
) : null}
|
|
99
187
|
</div>
|
|
100
188
|
</div>
|
|
101
189
|
</div>
|
|
102
190
|
)
|
|
103
191
|
}
|
|
104
192
|
|
|
193
|
+
/**
|
|
194
|
+
* The board an arrow leaving `from` points to, when its label reads as `pressed`, case and spaces
|
|
195
|
+
* aside: the first such arrow the canvas lists, to a board.
|
|
196
|
+
*/
|
|
197
|
+
export function followedArrow(
|
|
198
|
+
arrows: readonly CanvasArrow[],
|
|
199
|
+
boards: readonly CanvasBoard[],
|
|
200
|
+
from: string,
|
|
201
|
+
pressed: string
|
|
202
|
+
): string | null {
|
|
203
|
+
const words = wordsOf(pressed)
|
|
204
|
+
for (const arrow of arrows) {
|
|
205
|
+
const to = arrow.to
|
|
206
|
+
if (arrow.from !== from || typeof to !== "string" || !arrow.label) continue
|
|
207
|
+
if (wordsOf(arrow.label) !== words) continue
|
|
208
|
+
if (boards.some((board) => board.id === to)) return to
|
|
209
|
+
}
|
|
210
|
+
return null
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function wordsOf(text: string): string {
|
|
214
|
+
return text.replace(/\s+/g, " ").trim().toLowerCase()
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** The most an opened board is enlarged to fit the viewer, as far as the canvas zooms. */
|
|
218
|
+
const MAX_SCALE = 2.5
|
|
219
|
+
|
|
220
|
+
/** A board's picture at its own size, drawn from its top as its tile draws it. */
|
|
221
|
+
function BoardPicture({ src }: { readonly src: string }) {
|
|
222
|
+
return (
|
|
223
|
+
<img
|
|
224
|
+
src={src}
|
|
225
|
+
alt=""
|
|
226
|
+
decoding="async"
|
|
227
|
+
draggable={false}
|
|
228
|
+
className="absolute inset-0 block size-full object-contain object-top"
|
|
229
|
+
/>
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** An element's size as it is laid out, followed as it changes; null until it is measured. */
|
|
234
|
+
function useSize(element: HTMLElement | null): { width: number; height: number } | null {
|
|
235
|
+
const [size, setSize] = useState<{ width: number; height: number } | null>(null)
|
|
236
|
+
|
|
237
|
+
useEffect(() => {
|
|
238
|
+
if (!element) return
|
|
239
|
+
|
|
240
|
+
const measure = () => {
|
|
241
|
+
const width = element.clientWidth
|
|
242
|
+
const height = element.clientHeight
|
|
243
|
+
setSize((last) =>
|
|
244
|
+
last && last.width === width && last.height === height ? last : { width, height }
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
measure()
|
|
248
|
+
const observer = new ResizeObserver(measure)
|
|
249
|
+
observer.observe(element)
|
|
250
|
+
return () => observer.disconnect()
|
|
251
|
+
}, [element])
|
|
252
|
+
|
|
253
|
+
return size
|
|
254
|
+
}
|
|
255
|
+
|
|
105
256
|
function Step({
|
|
106
257
|
label,
|
|
107
258
|
disabled,
|
|
@@ -6,30 +6,35 @@ import type {
|
|
|
6
6
|
CanvasShapeItem,
|
|
7
7
|
CanvasText,
|
|
8
8
|
} from "@sixb/core/artifacts"
|
|
9
|
+
import { CANVAS_TEXT_PIXELS, canvasNoteFontSize, canvasShapeFontSize } from "@sixb/core/artifacts"
|
|
9
10
|
import { cn } from "@sixb/ui/lib/utils"
|
|
10
|
-
import {
|
|
11
|
+
import { useQueryClient } from "@tanstack/react-query"
|
|
12
|
+
import { Handle, type NodeProps, type NodeTypes, Position, useStoreApi } from "@xyflow/react"
|
|
11
13
|
import { AppWindow, ArrowUpRight, Link2, Maximize2 } from "lucide-react"
|
|
12
|
-
import type
|
|
14
|
+
import { memo, type ReactNode, useSyncExternalStore } from "react"
|
|
13
15
|
import { useArtifactMessages } from "../../messages"
|
|
16
|
+
import { artifactChanged } from "../../queries"
|
|
14
17
|
import { ArtifactEmbed, ArtifactLink } from "../../references/references"
|
|
15
18
|
import { TONE_COLORS } from "../../tones"
|
|
16
|
-
import { LiveBoard, useLiveBoards } from "./board"
|
|
19
|
+
import { ItemTile, LiveBoard, useLive, useLiveBoards } from "./board"
|
|
17
20
|
import { EditChrome, InPlaceText, useCanvasEditing } from "./editing"
|
|
18
|
-
import {
|
|
21
|
+
import type { CanvasFlowNode } from "./layout"
|
|
22
|
+
import { boardPreviewSize, boardPreviewUrl } from "./previews"
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* Every item's look on the board. Boards and embeds are pages and artifacts under their names,
|
|
22
|
-
* live where the board shows them; sections are headings; the rest draw as they are,
|
|
23
|
-
* theme's colors.
|
|
26
|
+
* live where the board shows them large enough; sections are headings; the rest draw as they are,
|
|
27
|
+
* in the theme's colors. Each draws again only when its own node changes: a canvas holds up to a
|
|
28
|
+
* thousand.
|
|
24
29
|
*/
|
|
25
30
|
export const CANVAS_NODE_TYPES: NodeTypes = {
|
|
26
|
-
board: BoardNode,
|
|
27
|
-
section: SectionNode,
|
|
28
|
-
note: NoteNode,
|
|
29
|
-
text: TextNode,
|
|
30
|
-
shape: ShapeNode,
|
|
31
|
-
embed: EmbedNode,
|
|
32
|
-
point: PointNode,
|
|
31
|
+
board: memo(BoardNode),
|
|
32
|
+
section: memo(SectionNode),
|
|
33
|
+
note: memo(NoteNode),
|
|
34
|
+
text: memo(TextNode),
|
|
35
|
+
shape: memo(ShapeNode),
|
|
36
|
+
embed: memo(EmbedNode),
|
|
37
|
+
point: memo(PointNode),
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
/** The ends an arrow attaches to. Arrows find their own sides, so these are never seen. */
|
|
@@ -52,21 +57,116 @@ const MAX_NAME_SCALE = 2
|
|
|
52
57
|
/** How wide on screen an item is before its name is shown above it. */
|
|
53
58
|
const NAMED_FROM_WIDTH = 120
|
|
54
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The CSS variable names scale by, which the board sets on itself as it zooms, so no item draws
|
|
62
|
+
* again for a frame of a zoom.
|
|
63
|
+
*/
|
|
64
|
+
export const NAME_SCALE = "--sixb-name-scale"
|
|
65
|
+
|
|
66
|
+
/** `scale` as the CSS variable gives it, 1 where nothing sets it. */
|
|
67
|
+
export const NAME_SCALE_VALUE = `var(${NAME_SCALE}, 1)`
|
|
68
|
+
|
|
55
69
|
/**
|
|
56
70
|
* How much names grow against the zoom, as a design tool names its frames: their size on screen
|
|
57
|
-
* from 100% down to half, then shrinking with the canvas
|
|
71
|
+
* from 100% down to half, then shrinking with the canvas.
|
|
58
72
|
*/
|
|
59
|
-
export function
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
73
|
+
export function nameScale(zoom: number): number {
|
|
74
|
+
return Math.min(MAX_NAME_SCALE, Math.max(1, 1 / zoom))
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Below this zoom, the board marks itself far (`data-far`): a tile waiting for its picture, a few
|
|
79
|
+
* dozen pixels wide, stops breathing, which would repaint every such tile at each frame.
|
|
80
|
+
*/
|
|
81
|
+
export const FAR_BELOW_ZOOM = 0.2
|
|
82
|
+
|
|
83
|
+
/** What the board sets on itself as it zooms, so no item draws again for a frame of a zoom. */
|
|
84
|
+
export function zoomMarks(zoom: number): { readonly nameScale: string; readonly far: boolean } {
|
|
85
|
+
// Rounded, so a zoom between the steps it can show changes nothing.
|
|
86
|
+
return { nameScale: nameScale(zoom).toFixed(3), far: zoom < FAR_BELOW_ZOOM }
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Where React Flow's view is zoomed, and whether it waits to be fitted. */
|
|
90
|
+
export interface Zoom {
|
|
91
|
+
readonly zoom: number
|
|
92
|
+
readonly fitViewQueued: boolean
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** What of React Flow's store the zoom is read from. */
|
|
96
|
+
interface ZoomSource {
|
|
97
|
+
getState(): {
|
|
98
|
+
readonly transform: readonly [number, number, number]
|
|
99
|
+
readonly fitViewQueued: boolean
|
|
100
|
+
}
|
|
101
|
+
subscribe(listener: () => void): () => void
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const zooms = new WeakMap<
|
|
105
|
+
ZoomSource,
|
|
106
|
+
{ readonly get: () => Zoom; readonly subscribe: (listener: () => void) => () => void }
|
|
107
|
+
>()
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The zoom of a React Flow store, told to its listeners only as it changes: the store changes for
|
|
111
|
+
* every node someone moves, and an item that asks only how far the view is zoomed is not asked
|
|
112
|
+
* again for each. One subscription to the store, while anyone listens.
|
|
113
|
+
*/
|
|
114
|
+
export function zoomOf(source: ZoomSource) {
|
|
115
|
+
let entry = zooms.get(source)
|
|
116
|
+
if (entry) return entry
|
|
117
|
+
|
|
118
|
+
const read = (): Zoom => {
|
|
119
|
+
const { transform, fitViewQueued } = source.getState()
|
|
120
|
+
return { zoom: transform[2], fitViewQueued }
|
|
121
|
+
}
|
|
122
|
+
let current = read()
|
|
123
|
+
const listeners = new Set<() => void>()
|
|
124
|
+
let unsubscribe: (() => void) | null = null
|
|
125
|
+
|
|
126
|
+
entry = {
|
|
127
|
+
// Nobody listening, nothing keeps it up to date: it is read as it is asked for.
|
|
128
|
+
get: () => {
|
|
129
|
+
if (!unsubscribe) current = same(current, read())
|
|
130
|
+
return current
|
|
131
|
+
},
|
|
132
|
+
subscribe: (listener) => {
|
|
133
|
+
listeners.add(listener)
|
|
134
|
+
unsubscribe ??= source.subscribe(() => {
|
|
135
|
+
const next = same(current, read())
|
|
136
|
+
if (next === current) return
|
|
137
|
+
current = next
|
|
138
|
+
for (const each of listeners) each()
|
|
139
|
+
})
|
|
140
|
+
return () => {
|
|
141
|
+
listeners.delete(listener)
|
|
142
|
+
if (listeners.size > 0 || !unsubscribe) return
|
|
143
|
+
unsubscribe()
|
|
144
|
+
unsubscribe = null
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
}
|
|
148
|
+
zooms.set(source, entry)
|
|
149
|
+
return entry
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function same(last: Zoom, next: Zoom): Zoom {
|
|
153
|
+
return last.zoom === next.zoom && last.fitViewQueued === next.fitViewQueued ? last : next
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** What an item reads of the zoom, read again only as the zoom changes. */
|
|
157
|
+
function useZoomed<T>(select: (zoom: Zoom) => T): T {
|
|
158
|
+
const zoom = zoomOf(useStoreApi())
|
|
159
|
+
return useSyncExternalStore(zoom.subscribe, () => select(zoom.get()))
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Whether names show at all: zoomed out further, they give way to the canvas. */
|
|
163
|
+
export function useNamesShown(): boolean {
|
|
164
|
+
return useZoomed(({ zoom }) => zoom >= NAMES_FROM_ZOOM)
|
|
65
165
|
}
|
|
66
166
|
|
|
67
167
|
/** Whether an item is wide enough on screen to show its name above it. */
|
|
68
168
|
function useNamed(width: number): boolean {
|
|
69
|
-
return
|
|
169
|
+
return useZoomed(({ zoom }) => width * zoom >= NAMED_FROM_WIDTH)
|
|
70
170
|
}
|
|
71
171
|
|
|
72
172
|
/**
|
|
@@ -75,14 +175,12 @@ function useNamed(width: number): boolean {
|
|
|
75
175
|
*/
|
|
76
176
|
function NameRow({
|
|
77
177
|
width,
|
|
78
|
-
scale,
|
|
79
178
|
icon,
|
|
80
179
|
name,
|
|
81
180
|
action,
|
|
82
181
|
}: {
|
|
83
182
|
/** The named item's width, in canvas pixels. */
|
|
84
183
|
readonly width: number
|
|
85
|
-
readonly scale: number
|
|
86
184
|
readonly icon: ReactNode
|
|
87
185
|
readonly name: string
|
|
88
186
|
readonly action?: ReactNode
|
|
@@ -90,7 +188,10 @@ function NameRow({
|
|
|
90
188
|
return (
|
|
91
189
|
<div
|
|
92
190
|
className="pointer-events-none absolute bottom-full left-0 flex h-7 origin-bottom-left items-center gap-1.5 pb-1.5 text-[13px] font-medium text-muted-foreground"
|
|
93
|
-
style={{
|
|
191
|
+
style={{
|
|
192
|
+
width: `calc(${width}px / ${NAME_SCALE_VALUE})`,
|
|
193
|
+
transform: `scale(${NAME_SCALE_VALUE})`,
|
|
194
|
+
}}
|
|
94
195
|
>
|
|
95
196
|
<span className="shrink-0 [&>svg]:size-3.5" aria-hidden="true">
|
|
96
197
|
{icon}
|
|
@@ -112,24 +213,23 @@ function itemOf<Item>(props: NodeProps<CanvasFlowNode>): Item {
|
|
|
112
213
|
function BoardNode(props: NodeProps<CanvasFlowNode>) {
|
|
113
214
|
const board = itemOf<CanvasBoard>(props)
|
|
114
215
|
const messages = useArtifactMessages().canvas
|
|
115
|
-
const { open } = useLiveBoards()
|
|
116
|
-
const
|
|
216
|
+
const { version, previews, mode, open } = useLiveBoards()
|
|
217
|
+
const queries = useQueryClient()
|
|
218
|
+
// Until the view is fitted it is at 100%, which is not where the reader sees the board: the
|
|
219
|
+
// small picture first, then the full one if the board is drawn large.
|
|
220
|
+
const previewSize = useZoomed(({ zoom, fitViewQueued }) =>
|
|
221
|
+
fitViewQueued ? "small" : boardPreviewSize(board.w * zoom, window.devicePixelRatio || 1)
|
|
222
|
+
)
|
|
223
|
+
const shown = useNamesShown()
|
|
117
224
|
const named = useNamed(board.w)
|
|
118
225
|
const title = board.title ?? board.id
|
|
119
|
-
// Until the page runs, its outline: the name above says which it is.
|
|
120
|
-
const tile = (
|
|
121
|
-
<div className="flex size-full items-center justify-center bg-card">
|
|
122
|
-
<AppWindow className="size-12 text-muted-foreground/30" strokeWidth={1} aria-hidden="true" />
|
|
123
|
-
</div>
|
|
124
|
-
)
|
|
125
226
|
return (
|
|
126
227
|
<div className="relative size-full">
|
|
127
228
|
<Ends />
|
|
128
229
|
<EditChrome id={board.id} selected={props.selected} />
|
|
129
|
-
{
|
|
230
|
+
{shown && named ? (
|
|
130
231
|
<NameRow
|
|
131
232
|
width={board.w}
|
|
132
|
-
scale={scale}
|
|
133
233
|
icon={<AppWindow />}
|
|
134
234
|
name={title}
|
|
135
235
|
action={
|
|
@@ -149,7 +249,28 @@ function BoardNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
149
249
|
/>
|
|
150
250
|
) : null}
|
|
151
251
|
<div className="sixb-canvas-surface size-full overflow-hidden">
|
|
152
|
-
<LiveBoard
|
|
252
|
+
<LiveBoard
|
|
253
|
+
id={board.id}
|
|
254
|
+
file={board.file}
|
|
255
|
+
title={title}
|
|
256
|
+
tile={
|
|
257
|
+
<ItemTile
|
|
258
|
+
icon={AppWindow}
|
|
259
|
+
{...(version && previews[board.id] === "ready"
|
|
260
|
+
? {
|
|
261
|
+
preview: boardPreviewUrl(version, board.id, mode, previewSize),
|
|
262
|
+
// A small picture that can't be had gives way to the full one.
|
|
263
|
+
...(previewSize === "small"
|
|
264
|
+
? { fallback: boardPreviewUrl(version, board.id, mode) }
|
|
265
|
+
: {}),
|
|
266
|
+
}
|
|
267
|
+
: {})}
|
|
268
|
+
pending={previews[board.id] === "pending"}
|
|
269
|
+
// The version may have moved past the revision pictured: it is read again.
|
|
270
|
+
{...(version ? { onFail: () => artifactChanged(queries, version.artifactId) } : {})}
|
|
271
|
+
/>
|
|
272
|
+
}
|
|
273
|
+
/>
|
|
153
274
|
</div>
|
|
154
275
|
</div>
|
|
155
276
|
)
|
|
@@ -161,7 +282,7 @@ function BoardNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
161
282
|
*/
|
|
162
283
|
function SectionNode(props: NodeProps<CanvasFlowNode>) {
|
|
163
284
|
const section = itemOf<CanvasSection>(props)
|
|
164
|
-
const
|
|
285
|
+
const shown = useNamesShown()
|
|
165
286
|
const editing = useCanvasEditing()
|
|
166
287
|
const heading =
|
|
167
288
|
"absolute top-0 left-0 m-0 origin-top-left text-base leading-6 font-semibold tracking-[-0.01em] text-foreground"
|
|
@@ -173,7 +294,7 @@ function SectionNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
173
294
|
<div className={cn(heading, "pointer-events-auto")} style={{ width: section.w }}>
|
|
174
295
|
<InPlaceText id={section.id} value={section.title ?? ""} />
|
|
175
296
|
</div>
|
|
176
|
-
) : section.title &&
|
|
297
|
+
) : section.title && shown ? (
|
|
177
298
|
// While the canvas is edited, the heading is what takes the section: a press anywhere
|
|
178
299
|
// else in its region falls through to what the region holds, or pans.
|
|
179
300
|
<h3
|
|
@@ -182,7 +303,10 @@ function SectionNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
182
303
|
"truncate",
|
|
183
304
|
editing ? "pointer-events-auto cursor-grab" : "pointer-events-none"
|
|
184
305
|
)}
|
|
185
|
-
style={{
|
|
306
|
+
style={{
|
|
307
|
+
maxWidth: `calc(${section.w}px / ${NAME_SCALE_VALUE})`,
|
|
308
|
+
transform: `scale(${NAME_SCALE_VALUE})`,
|
|
309
|
+
}}
|
|
186
310
|
>
|
|
187
311
|
{section.title}
|
|
188
312
|
</h3>
|
|
@@ -211,9 +335,7 @@ function NoteNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
211
335
|
width: "100%",
|
|
212
336
|
// As tall as its box while it is resized, and never shorter than its height.
|
|
213
337
|
minHeight: `max(${note.h ?? Math.min(note.w, 112)}px, 100%)`,
|
|
214
|
-
|
|
215
|
-
// that a few words fill it.
|
|
216
|
-
fontSize: Math.round(Math.min(22, Math.max(15, note.w / 13))),
|
|
338
|
+
fontSize: canvasNoteFontSize(note.w),
|
|
217
339
|
...(tone === "neutral"
|
|
218
340
|
? {}
|
|
219
341
|
: { backgroundColor: `color-mix(in oklab, ${TONE_COLORS[tone]} 20%, var(--card))` }),
|
|
@@ -238,19 +360,19 @@ function NoteNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
238
360
|
/** A label or a heading on the canvas itself. */
|
|
239
361
|
function TextNode(props: NodeProps<CanvasFlowNode>) {
|
|
240
362
|
const text = itemOf<CanvasText>(props)
|
|
241
|
-
const size =
|
|
363
|
+
const size = CANVAS_TEXT_PIXELS[text.size]
|
|
242
364
|
const editing = useCanvasEditing()
|
|
243
365
|
return (
|
|
244
366
|
<div
|
|
245
367
|
className={cn(
|
|
246
368
|
"relative whitespace-pre-wrap text-foreground",
|
|
247
|
-
text.size === "xl" && "font-bold tracking-[-0.025em]",
|
|
369
|
+
(text.size === "xl" || text.size === "xxl") && "font-bold tracking-[-0.025em]",
|
|
248
370
|
text.size === "l" && "font-semibold tracking-[-0.015em]",
|
|
249
371
|
text.size === "s" && "text-muted-foreground"
|
|
250
372
|
)}
|
|
251
373
|
style={{
|
|
252
374
|
fontSize: size,
|
|
253
|
-
lineHeight: text.size === "
|
|
375
|
+
lineHeight: text.size === "s" || text.size === "m" ? 1.45 : 1.15,
|
|
254
376
|
...(text.w === undefined ? { width: "max-content", minWidth: "100%" } : { width: "100%" }),
|
|
255
377
|
}}
|
|
256
378
|
>
|
|
@@ -273,7 +395,7 @@ function ShapeNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
273
395
|
: "var(--card)"
|
|
274
396
|
const stroke = "color-mix(in oklab, var(--foreground) 32%, transparent)"
|
|
275
397
|
const editing = useCanvasEditing()
|
|
276
|
-
const fontSize =
|
|
398
|
+
const fontSize = canvasShapeFontSize(shape.w, shape.h)
|
|
277
399
|
const textBox = cn(
|
|
278
400
|
"relative text-center leading-snug font-medium text-foreground",
|
|
279
401
|
// A diamond's middle is narrower than its box.
|
|
@@ -330,22 +452,23 @@ function ShapeNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
330
452
|
|
|
331
453
|
/**
|
|
332
454
|
* Another artifact on the canvas at the item's size, as a deck's box shows one: a chart, a range,
|
|
333
|
-
* a slide, a section, a page's card, or another canvas's board.
|
|
334
|
-
*
|
|
455
|
+
* a slide, a section, a page's card, or another canvas's board. It shows once the view shows it
|
|
456
|
+
* large enough, as a board runs, and its tile until then. One the reader can't open, or whose part
|
|
457
|
+
* is gone, says so in place.
|
|
335
458
|
*/
|
|
336
459
|
function EmbedNode(props: NodeProps<CanvasFlowNode>) {
|
|
337
460
|
const embed = itemOf<CanvasEmbed>(props)
|
|
338
461
|
const messages = useArtifactMessages().canvas
|
|
339
|
-
const
|
|
340
|
-
const
|
|
462
|
+
const live = useLive(embed.id)
|
|
463
|
+
const shown = useNamesShown()
|
|
464
|
+
const named = useNamed(embed.w) && shown && Boolean(embed.title)
|
|
341
465
|
return (
|
|
342
466
|
<div className="relative size-full">
|
|
343
467
|
<Ends />
|
|
344
468
|
<EditChrome id={embed.id} selected={props.selected} />
|
|
345
|
-
{named &&
|
|
469
|
+
{named && embed.title ? (
|
|
346
470
|
<NameRow
|
|
347
471
|
width={embed.w}
|
|
348
|
-
scale={scale}
|
|
349
472
|
icon={<Link2 />}
|
|
350
473
|
name={embed.title}
|
|
351
474
|
action={
|
|
@@ -364,7 +487,11 @@ function EmbedNode(props: NodeProps<CanvasFlowNode>) {
|
|
|
364
487
|
className="sixb-canvas-surface sixb-canvas-embed size-full overflow-hidden"
|
|
365
488
|
{...(named ? { "data-named": "" } : {})}
|
|
366
489
|
>
|
|
367
|
-
|
|
490
|
+
{live ? (
|
|
491
|
+
<ArtifactEmbed address={embed.src} caption={embed.title ?? ""} fill />
|
|
492
|
+
) : (
|
|
493
|
+
<ItemTile icon={Link2} />
|
|
494
|
+
)}
|
|
368
495
|
</div>
|
|
369
496
|
</div>
|
|
370
497
|
)
|