@dfosco/storyboard-core 4.2.0-beta.2 → 4.2.0-beta.21
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/commandpalette.config.json +109 -24
- package/dist/storyboard-ui.css +1 -1
- package/dist/storyboard-ui.js +17379 -28568
- package/dist/storyboard-ui.js.map +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +5 -2
- package/scaffold/agents/prompt-agent.agent.md +181 -0
- package/scaffold/agents/terminal-agent.agent.md +351 -0
- package/scaffold/codex/config.toml +246 -0
- package/scaffold/manifest.json +5 -0
- package/scaffold/skills/canvas/SKILL.md +5 -4
- package/scaffold/skills/ship/SKILL.md +1 -1
- package/scaffold/storyboard.config.json +14 -1
- package/scaffold/toolbar.config.json +1 -1
- package/src/ActionMenuButton.jsx +100 -0
- package/src/AutosyncMenuButton.css +67 -0
- package/src/AutosyncMenuButton.jsx +241 -0
- package/src/BranchSelect.jsx +29 -0
- package/src/BranchSelect.module.css +30 -0
- package/src/CanvasAgentsMenu.jsx +87 -0
- package/src/CanvasCreateMenu.jsx +609 -0
- package/src/CanvasSnap.css +27 -0
- package/src/CanvasSnap.jsx +51 -0
- package/src/CanvasUndoRedo.css +36 -0
- package/src/CanvasUndoRedo.jsx +62 -0
- package/src/CanvasZoomControl.css +53 -0
- package/src/CanvasZoomControl.jsx +49 -0
- package/src/CanvasZoomToFit.css +18 -0
- package/src/CanvasZoomToFit.jsx +26 -0
- package/src/CommandMenu.css +8 -0
- package/src/CommandMenu.jsx +286 -0
- package/src/CommandPalette.jsx +35 -0
- package/src/CommandPaletteTrigger.jsx +25 -0
- package/src/CommentsMenuButton.jsx +38 -0
- package/src/CoreUIBar.css +47 -0
- package/src/CoreUIBar.jsx +855 -0
- package/src/CreateMenuButton.jsx +116 -0
- package/src/HideChromeTrigger.jsx +40 -0
- package/src/InspectorPanel.css +109 -0
- package/src/InspectorPanel.jsx +629 -0
- package/src/PwaInstallBanner.css +42 -0
- package/src/PwaInstallBanner.jsx +124 -0
- package/src/SidePanel.jsx +260 -0
- package/src/ThemeMenuButton.jsx +136 -0
- package/src/autosync/server.js +202 -5
- package/src/autosync/server.test.js +112 -0
- package/src/canvas/__tests__/agent-integration.test.js +593 -0
- package/src/canvas/__tests__/helpers/browser.js +95 -0
- package/src/canvas/__tests__/helpers/canvas-api.js +129 -0
- package/src/canvas/__tests__/helpers/perf.js +118 -0
- package/src/canvas/__tests__/helpers/setup.js +176 -0
- package/src/canvas/__tests__/helpers/tmux.js +130 -0
- package/src/canvas/__tests__/helpers/transcript.js +129 -0
- package/src/canvas/__tests__/terminal-integration.test.js +175 -0
- package/src/canvas/hot-pool.js +757 -0
- package/src/canvas/materializer.js +31 -0
- package/src/canvas/materializer.test.js +56 -0
- package/src/canvas/selectedWidgets.js +65 -7
- package/src/canvas/server.js +1801 -22
- package/src/canvas/server.test.js +239 -0
- package/src/canvas/terminal-config.js +331 -0
- package/src/canvas/terminal-registry.js +38 -0
- package/src/canvas/terminal-server.js +1037 -29
- package/src/canvas/writeGuard.js +51 -3
- package/src/canvasConfig.js +67 -1
- package/src/canvasConfig.test.js +79 -1
- package/src/cli/agent.js +85 -0
- package/src/cli/branch.js +232 -0
- package/src/cli/canvasAdd.js +59 -12
- package/src/cli/canvasBatch.js +98 -0
- package/src/cli/canvasBounds.js +1 -1
- package/src/cli/canvasRead.js +1 -1
- package/src/cli/canvasUpdate.js +179 -0
- package/src/cli/create.js +38 -14
- package/src/cli/dev.js +157 -83
- package/src/cli/exit.js +23 -24
- package/src/cli/index.js +55 -2
- package/src/cli/proxy.js +96 -37
- package/src/cli/schemas.js +22 -4
- package/src/cli/server.js +148 -25
- package/src/cli/serverUrl.js +8 -3
- package/src/cli/sessions.js +131 -5
- package/src/cli/setup.js +109 -11
- package/src/cli/terminal-commands.js +16 -8
- package/src/cli/terminal-messaging.js +231 -0
- package/src/cli/terminal-welcome.js +365 -33
- package/src/commandActions.js +1 -0
- package/src/commandPaletteConfig.js +9 -0
- package/src/comments/auth.js +2 -1
- package/src/comments/ui/AuthModal.jsx +114 -0
- package/src/comments/ui/CommentWindow.jsx +329 -0
- package/src/comments/ui/CommentsDrawer.jsx +102 -0
- package/src/comments/ui/Composer.jsx +64 -0
- package/src/comments/ui/authModal.test.js +1 -1
- package/src/comments/ui/commentWindow.js +16 -17
- package/src/comments/ui/commentsDrawer.js +25 -26
- package/src/comments/ui/composer.js +23 -24
- package/src/comments/ui/index.js +2 -3
- package/src/configSchema.js +59 -1
- package/src/configStore.js +161 -0
- package/src/core-ui-colors.css +12 -0
- package/src/devtools.js +17 -19
- package/src/devtools.test.js +18 -9
- package/src/featureFlags.js +12 -5
- package/src/fuzzySearch.test.js +10 -0
- package/src/index.js +14 -2
- package/src/lib/components/ui/alert/alert-action.jsx +11 -0
- package/src/lib/components/ui/alert/alert-description.jsx +11 -0
- package/src/lib/components/ui/alert/alert-title.jsx +11 -0
- package/src/lib/components/ui/alert/alert.jsx +25 -0
- package/src/lib/components/ui/alert/index.js +15 -15
- package/src/lib/components/ui/avatar/avatar-badge.jsx +22 -0
- package/src/lib/components/ui/avatar/avatar-fallback.jsx +18 -0
- package/src/lib/components/ui/avatar/avatar-group-count.jsx +19 -0
- package/src/lib/components/ui/avatar/avatar-group.jsx +19 -0
- package/src/lib/components/ui/avatar/avatar-image.jsx +15 -0
- package/src/lib/components/ui/avatar/avatar.jsx +19 -0
- package/src/lib/components/ui/avatar/index.js +20 -20
- package/src/lib/components/ui/badge/badge.jsx +31 -0
- package/src/lib/components/ui/badge/index.js +2 -2
- package/src/lib/components/ui/button/button.jsx +100 -0
- package/src/lib/components/ui/button/index.js +9 -9
- package/src/lib/components/ui/card/card-action.jsx +11 -0
- package/src/lib/components/ui/card/card-content.jsx +11 -0
- package/src/lib/components/ui/card/card-description.jsx +11 -0
- package/src/lib/components/ui/card/card-footer.jsx +11 -0
- package/src/lib/components/ui/card/card-header.jsx +19 -0
- package/src/lib/components/ui/card/card-title.jsx +11 -0
- package/src/lib/components/ui/card/card.jsx +17 -0
- package/src/lib/components/ui/card/index.js +23 -23
- package/src/lib/components/ui/checkbox/checkbox.jsx +29 -0
- package/src/lib/components/ui/checkbox/index.js +5 -5
- package/src/lib/components/ui/collapsible/collapsible-content.jsx +7 -0
- package/src/lib/components/ui/collapsible/collapsible-trigger.jsx +7 -0
- package/src/lib/components/ui/collapsible/collapsible.jsx +7 -0
- package/src/lib/components/ui/collapsible/index.js +11 -11
- package/src/lib/components/ui/dialog/dialog-close.jsx +7 -0
- package/src/lib/components/ui/dialog/dialog-content.jsx +34 -0
- package/src/lib/components/ui/dialog/dialog-description.jsx +15 -0
- package/src/lib/components/ui/dialog/dialog-footer.jsx +23 -0
- package/src/lib/components/ui/dialog/dialog-header.jsx +11 -0
- package/src/lib/components/ui/dialog/dialog-overlay.jsx +15 -0
- package/src/lib/components/ui/dialog/dialog-portal.jsx +4 -0
- package/src/lib/components/ui/dialog/dialog-title.jsx +15 -0
- package/src/lib/components/ui/dialog/dialog-trigger.jsx +7 -0
- package/src/lib/components/ui/dialog/dialog.jsx +4 -0
- package/src/lib/components/ui/dialog/index.js +32 -32
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.jsx +8 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.jsx +30 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.jsx +22 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.jsx +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.jsx +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.jsx +20 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.jsx +17 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.jsx +4 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.jsx +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.jsx +29 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.jsx +15 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.jsx +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.jsx +15 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.jsx +23 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.jsx +4 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.jsx +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu.jsx +4 -0
- package/src/lib/components/ui/dropdown-menu/index.js +52 -52
- package/src/lib/components/ui/input/index.js +5 -5
- package/src/lib/components/ui/input/input.jsx +19 -0
- package/src/lib/components/ui/label/index.js +5 -5
- package/src/lib/components/ui/label/label.jsx +19 -0
- package/src/lib/components/ui/panel/index.js +21 -21
- package/src/lib/components/ui/panel/panel-body.jsx +11 -0
- package/src/lib/components/ui/panel/panel-close.jsx +16 -0
- package/src/lib/components/ui/panel/panel-content.jsx +29 -0
- package/src/lib/components/ui/panel/panel-footer.jsx +11 -0
- package/src/lib/components/ui/panel/panel-header.jsx +11 -0
- package/src/lib/components/ui/panel/panel-title.jsx +12 -0
- package/src/lib/components/ui/panel/panel.jsx +4 -0
- package/src/lib/components/ui/popover/index.js +26 -26
- package/src/lib/components/ui/popover/popover-close.jsx +7 -0
- package/src/lib/components/ui/popover/popover-content.jsx +22 -0
- package/src/lib/components/ui/popover/popover-description.jsx +11 -0
- package/src/lib/components/ui/popover/popover-header.jsx +11 -0
- package/src/lib/components/ui/popover/popover-portal.jsx +4 -0
- package/src/lib/components/ui/popover/popover-title.jsx +11 -0
- package/src/lib/components/ui/popover/popover-trigger.jsx +8 -0
- package/src/lib/components/ui/popover/popover.jsx +4 -0
- package/src/lib/components/ui/searchable-list.jsx +159 -0
- package/src/lib/components/ui/select/index.js +35 -35
- package/src/lib/components/ui/select/select-content.jsx +30 -0
- package/src/lib/components/ui/select/select-group-heading.jsx +17 -0
- package/src/lib/components/ui/select/select-group.jsx +15 -0
- package/src/lib/components/ui/select/select-item.jsx +26 -0
- package/src/lib/components/ui/select/select-label.jsx +11 -0
- package/src/lib/components/ui/select/select-portal.jsx +4 -0
- package/src/lib/components/ui/select/select-scroll-down-button.jsx +18 -0
- package/src/lib/components/ui/select/select-scroll-up-button.jsx +18 -0
- package/src/lib/components/ui/select/select-separator.jsx +15 -0
- package/src/lib/components/ui/select/select-trigger.jsx +25 -0
- package/src/lib/components/ui/select/select.jsx +4 -0
- package/src/lib/components/ui/separator/index.js +5 -5
- package/src/lib/components/ui/separator/separator.jsx +22 -0
- package/src/lib/components/ui/sheet/index.js +32 -32
- package/src/lib/components/ui/sheet/sheet-close.jsx +7 -0
- package/src/lib/components/ui/sheet/sheet-content.jsx +35 -0
- package/src/lib/components/ui/sheet/sheet-description.jsx +15 -0
- package/src/lib/components/ui/sheet/sheet-footer.jsx +11 -0
- package/src/lib/components/ui/sheet/sheet-header.jsx +11 -0
- package/src/lib/components/ui/sheet/sheet-overlay.jsx +15 -0
- package/src/lib/components/ui/sheet/sheet-portal.jsx +4 -0
- package/src/lib/components/ui/sheet/sheet-title.jsx +15 -0
- package/src/lib/components/ui/sheet/sheet-trigger.jsx +7 -0
- package/src/lib/components/ui/sheet/sheet.jsx +4 -0
- package/src/lib/components/ui/textarea/index.js +5 -5
- package/src/lib/components/ui/textarea/textarea.jsx +18 -0
- package/src/lib/components/ui/toggle/index.js +6 -9
- package/src/lib/components/ui/toggle/toggle.jsx +36 -0
- package/src/lib/components/ui/toggle-group/index.js +8 -8
- package/src/lib/components/ui/toggle-group/toggle-group-item.jsx +29 -0
- package/src/lib/components/ui/toggle-group/toggle-group.jsx +43 -0
- package/src/lib/components/ui/tooltip/index.js +3 -3
- package/src/lib/components/ui/tooltip/tooltip-content.jsx +21 -0
- package/src/lib/components/ui/tooltip/tooltip-trigger.jsx +23 -0
- package/src/lib/components/ui/tooltip/tooltip.jsx +11 -0
- package/src/lib/components/ui/trigger-button/index.js +3 -3
- package/src/lib/components/ui/trigger-button/trigger-button.css +38 -0
- package/src/lib/components/ui/trigger-button/trigger-button.jsx +63 -0
- package/src/logger/devLogger.js +238 -0
- package/src/logger/devLogger.test.js +193 -0
- package/src/modes.test.js +4 -4
- package/src/mountStoryboardCore.js +123 -27
- package/src/paletteProviders.js +3 -0
- package/src/paletteProviders.test.js +2 -2
- package/src/server/index.js +98 -36
- package/src/sidepanel.css +214 -0
- package/src/styles/tailwind.css +1 -1
- package/src/svelte-plugin-ui/__tests__/ModeSwitch.test.ts +8 -8
- package/src/svelte-plugin-ui/__tests__/ToolbarShell.test.ts +11 -10
- package/src/svelte-plugin-ui/components/Icon.css +11 -0
- package/src/svelte-plugin-ui/components/Icon.jsx +281 -0
- package/src/svelte-plugin-ui/components/ModeSwitch.css +90 -0
- package/src/svelte-plugin-ui/components/ModeSwitch.jsx +47 -0
- package/src/svelte-plugin-ui/components/ToolbarShell.css +80 -0
- package/src/svelte-plugin-ui/components/ToolbarShell.jsx +84 -0
- package/src/svelte-plugin-ui/components/Viewfinder.css +412 -0
- package/src/svelte-plugin-ui/components/Viewfinder.jsx +512 -0
- package/src/svelte-plugin-ui/mount.ts +12 -16
- package/src/toolRegistry.js +4 -4
- package/src/toolbarConfigStore.js +30 -0
- package/src/tools/handlers/autosync.js +1 -1
- package/src/tools/handlers/canvasAddWidget.js +1 -1
- package/src/tools/handlers/canvasAgents.js +19 -0
- package/src/tools/handlers/canvasToolbar.js +8 -8
- package/src/tools/handlers/commandPalette.js +9 -0
- package/src/tools/handlers/comments.js +1 -1
- package/src/tools/handlers/create.js +1 -1
- package/src/tools/handlers/devtools.js +16 -0
- package/src/tools/handlers/devtools.test.js +38 -0
- package/src/tools/handlers/flows.js +1 -1
- package/src/tools/handlers/hideChrome.js +9 -0
- package/src/tools/handlers/paletteTheme.js +35 -0
- package/src/tools/handlers/theme.js +1 -1
- package/src/tools/registry.js +4 -1
- package/src/tools/surfaces/commandList.js +3 -3
- package/src/tools/surfaces/mainToolbar.js +3 -3
- package/src/tools/surfaces/registry.js +4 -4
- package/src/ui/design-modes.ts +2 -2
- package/src/ui/viewfinder.ts +1 -1
- package/src/vite/server-plugin.js +242 -60
- package/src/workshop/features/createCanvas/CreateCanvasForm.jsx +260 -0
- package/src/workshop/features/createCanvas/index.js +1 -1
- package/src/workshop/features/createFlow/CreateFlowForm.jsx +334 -0
- package/src/workshop/features/createFlow/index.js +1 -1
- package/src/workshop/features/createPage/CreatePageForm.jsx +304 -0
- package/src/workshop/features/createPage/index.js +1 -1
- package/src/workshop/features/createPrototype/CreatePrototypeForm.jsx +289 -0
- package/src/workshop/features/createPrototype/index.js +1 -1
- package/src/workshop/features/createPrototype/server.js +98 -0
- package/src/workshop/features/createStory/CreateStoryForm.jsx +208 -0
- package/src/workshop/features/createStory/index.js +1 -1
- package/src/workshop/ui/WorkshopPanel.jsx +98 -0
- package/src/workshop/ui/mount.ts +1 -1
- package/src/worktree/port.js +48 -0
- package/src/worktree/serverRegistry.js +120 -0
- package/toolbar.config.json +93 -42
- package/widgets.config.json +580 -12
- package/src/ActionMenuButton.svelte +0 -119
- package/src/AutosyncMenuButton.svelte +0 -397
- package/src/CanvasCreateMenu.svelte +0 -295
- package/src/CanvasSnap.svelte +0 -87
- package/src/CanvasUndoRedo.svelte +0 -108
- package/src/CanvasZoomControl.svelte +0 -111
- package/src/CanvasZoomToFit.svelte +0 -52
- package/src/CommandMenu.svelte +0 -249
- package/src/CommandPalette.svelte +0 -33
- package/src/CommentsMenuButton.svelte +0 -53
- package/src/CoreUIBar.svelte +0 -847
- package/src/CreateMenuButton.svelte +0 -133
- package/src/DocPanel.svelte +0 -299
- package/src/InspectorPanel.svelte +0 -745
- package/src/PwaInstallBanner.svelte +0 -124
- package/src/SidePanel.svelte +0 -480
- package/src/ThemeMenuButton.svelte +0 -132
- package/src/comments/ui/AuthModal.svelte +0 -108
- package/src/comments/ui/CommentWindow.svelte +0 -333
- package/src/comments/ui/CommentsDrawer.svelte +0 -96
- package/src/comments/ui/Composer.svelte +0 -65
- package/src/lib/components/ui/alert/alert-action.svelte +0 -19
- package/src/lib/components/ui/alert/alert-description.svelte +0 -22
- package/src/lib/components/ui/alert/alert-title.svelte +0 -22
- package/src/lib/components/ui/alert/alert.svelte +0 -38
- package/src/lib/components/ui/avatar/avatar-badge.svelte +0 -25
- package/src/lib/components/ui/avatar/avatar-fallback.svelte +0 -20
- package/src/lib/components/ui/avatar/avatar-group-count.svelte +0 -22
- package/src/lib/components/ui/avatar/avatar-group.svelte +0 -22
- package/src/lib/components/ui/avatar/avatar-image.svelte +0 -17
- package/src/lib/components/ui/avatar/avatar.svelte +0 -24
- package/src/lib/components/ui/badge/badge.svelte +0 -44
- package/src/lib/components/ui/button/button.svelte +0 -108
- package/src/lib/components/ui/card/card-action.svelte +0 -21
- package/src/lib/components/ui/card/card-content.svelte +0 -19
- package/src/lib/components/ui/card/card-description.svelte +0 -19
- package/src/lib/components/ui/card/card-footer.svelte +0 -18
- package/src/lib/components/ui/card/card-header.svelte +0 -21
- package/src/lib/components/ui/card/card-title.svelte +0 -14
- package/src/lib/components/ui/card/card.svelte +0 -21
- package/src/lib/components/ui/checkbox/checkbox.svelte +0 -39
- package/src/lib/components/ui/collapsible/collapsible-content.svelte +0 -7
- package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +0 -7
- package/src/lib/components/ui/collapsible/collapsible.svelte +0 -11
- package/src/lib/components/ui/dialog/dialog-close.svelte +0 -11
- package/src/lib/components/ui/dialog/dialog-content.svelte +0 -42
- package/src/lib/components/ui/dialog/dialog-description.svelte +0 -17
- package/src/lib/components/ui/dialog/dialog-footer.svelte +0 -29
- package/src/lib/components/ui/dialog/dialog-header.svelte +0 -19
- package/src/lib/components/ui/dialog/dialog-overlay.svelte +0 -17
- package/src/lib/components/ui/dialog/dialog-portal.svelte +0 -7
- package/src/lib/components/ui/dialog/dialog-title.svelte +0 -17
- package/src/lib/components/ui/dialog/dialog-trigger.svelte +0 -11
- package/src/lib/components/ui/dialog/dialog.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +0 -16
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -40
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +0 -27
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -18
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +0 -24
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +0 -20
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +0 -16
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +0 -34
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +0 -17
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +0 -19
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +0 -17
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +0 -27
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +0 -7
- package/src/lib/components/ui/dropdown-menu/dropdown-menu.svelte +0 -7
- package/src/lib/components/ui/input/input.svelte +0 -40
- package/src/lib/components/ui/label/label.svelte +0 -20
- package/src/lib/components/ui/panel/panel-body.svelte +0 -13
- package/src/lib/components/ui/panel/panel-close.svelte +0 -16
- package/src/lib/components/ui/panel/panel-content.svelte +0 -33
- package/src/lib/components/ui/panel/panel-footer.svelte +0 -13
- package/src/lib/components/ui/panel/panel-header.svelte +0 -16
- package/src/lib/components/ui/panel/panel-title.svelte +0 -14
- package/src/lib/components/ui/panel/panel.svelte +0 -15
- package/src/lib/components/ui/popover/popover-close.svelte +0 -7
- package/src/lib/components/ui/popover/popover-content.svelte +0 -27
- package/src/lib/components/ui/popover/popover-description.svelte +0 -19
- package/src/lib/components/ui/popover/popover-header.svelte +0 -19
- package/src/lib/components/ui/popover/popover-portal.svelte +0 -7
- package/src/lib/components/ui/popover/popover-title.svelte +0 -19
- package/src/lib/components/ui/popover/popover-trigger.svelte +0 -17
- package/src/lib/components/ui/popover/popover.svelte +0 -7
- package/src/lib/components/ui/select/select-content.svelte +0 -40
- package/src/lib/components/ui/select/select-group-heading.svelte +0 -19
- package/src/lib/components/ui/select/select-group.svelte +0 -17
- package/src/lib/components/ui/select/select-item.svelte +0 -38
- package/src/lib/components/ui/select/select-label.svelte +0 -18
- package/src/lib/components/ui/select/select-portal.svelte +0 -7
- package/src/lib/components/ui/select/select-scroll-down-button.svelte +0 -20
- package/src/lib/components/ui/select/select-scroll-up-button.svelte +0 -20
- package/src/lib/components/ui/select/select-separator.svelte +0 -17
- package/src/lib/components/ui/select/select-trigger.svelte +0 -27
- package/src/lib/components/ui/select/select.svelte +0 -11
- package/src/lib/components/ui/separator/separator.svelte +0 -23
- package/src/lib/components/ui/sheet/sheet-close.svelte +0 -7
- package/src/lib/components/ui/sheet/sheet-content.svelte +0 -43
- package/src/lib/components/ui/sheet/sheet-description.svelte +0 -17
- package/src/lib/components/ui/sheet/sheet-footer.svelte +0 -18
- package/src/lib/components/ui/sheet/sheet-header.svelte +0 -19
- package/src/lib/components/ui/sheet/sheet-overlay.svelte +0 -17
- package/src/lib/components/ui/sheet/sheet-portal.svelte +0 -7
- package/src/lib/components/ui/sheet/sheet-title.svelte +0 -17
- package/src/lib/components/ui/sheet/sheet-trigger.svelte +0 -7
- package/src/lib/components/ui/sheet/sheet.svelte +0 -7
- package/src/lib/components/ui/textarea/textarea.svelte +0 -21
- package/src/lib/components/ui/toggle/toggle.svelte +0 -45
- package/src/lib/components/ui/toggle-group/toggle-group-item.svelte +0 -35
- package/src/lib/components/ui/toggle-group/toggle-group.svelte +0 -63
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +0 -24
- package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +0 -27
- package/src/lib/components/ui/tooltip/tooltip.svelte +0 -9
- package/src/lib/components/ui/trigger-button/trigger-button.svelte +0 -106
- package/src/svelte-plugin-ui/components/Icon.svelte +0 -181
- package/src/svelte-plugin-ui/components/ModeSwitch.svelte +0 -121
- package/src/svelte-plugin-ui/components/ToolbarShell.svelte +0 -150
- package/src/svelte-plugin-ui/components/Viewfinder.svelte +0 -1001
- package/src/tools/handlers/docs.js +0 -11
- package/src/workshop/features/createCanvas/CreateCanvasForm.svelte +0 -139
- package/src/workshop/features/createFlow/CreateFlowForm.svelte +0 -314
- package/src/workshop/features/createPage/CreatePageForm.svelte +0 -249
- package/src/workshop/features/createPrototype/CreatePrototypeForm.svelte +0 -287
- package/src/workshop/features/createStory/CreateStoryForm.svelte +0 -161
- package/src/workshop/ui/WorkshopPanel.svelte +0 -97
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Comment composer —
|
|
2
|
+
* Comment composer — React inline text input that appears at click position.
|
|
3
3
|
*
|
|
4
4
|
* Positioned absolutely within the comment overlay. Submits to the comments API.
|
|
5
5
|
* Styled with Tachyons + sb-* custom classes for light/dark mode support.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
8
|
+
import { createElement } from 'react'
|
|
9
|
+
import { createRoot } from 'react-dom/client'
|
|
10
|
+
import ComposerComponent from './Composer.jsx'
|
|
10
11
|
import { getCachedUser } from '../auth.js'
|
|
11
12
|
import { saveDraft, clearDraft, composerDraftKey } from '../commentDrafts.js'
|
|
12
13
|
import './comment-layout.css'
|
|
@@ -36,7 +37,7 @@ export function showComposer(container, xPct, yPct, route, callbacks = {}) {
|
|
|
36
37
|
// Stop click from propagating (prevents placing another composer)
|
|
37
38
|
composer.addEventListener('click', (e) => e.stopPropagation())
|
|
38
39
|
|
|
39
|
-
let
|
|
40
|
+
let root = null
|
|
40
41
|
let skipDraftSave = false
|
|
41
42
|
const draftKey = composerDraftKey(route)
|
|
42
43
|
|
|
@@ -84,7 +85,7 @@ export function showComposer(container, xPct, yPct, route, callbacks = {}) {
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
function destroy() {
|
|
87
|
-
// Save draft from DOM before
|
|
88
|
+
// Save draft from DOM before React unmounts
|
|
88
89
|
if (!skipDraftSave) {
|
|
89
90
|
const textarea = composer.querySelector('textarea')
|
|
90
91
|
const val = textarea?.value?.trim()
|
|
@@ -94,7 +95,7 @@ export function showComposer(container, xPct, yPct, route, callbacks = {}) {
|
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
window.removeEventListener('keydown', onEscape, true)
|
|
97
|
-
if (
|
|
98
|
+
if (root) { root.unmount(); root = null }
|
|
98
99
|
composer.remove()
|
|
99
100
|
}
|
|
100
101
|
|
|
@@ -109,25 +110,23 @@ export function showComposer(container, xPct, yPct, route, callbacks = {}) {
|
|
|
109
110
|
}
|
|
110
111
|
window.addEventListener('keydown', onEscape, true)
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
callbacks.onSubmitOptimistic?.(text, pos.x, pos.y)
|
|
128
|
-
},
|
|
113
|
+
root = createRoot(composer)
|
|
114
|
+
root.render(createElement(ComposerComponent, {
|
|
115
|
+
user,
|
|
116
|
+
route,
|
|
117
|
+
onCancel: () => {
|
|
118
|
+
clearDraft(draftKey)
|
|
119
|
+
skipDraftSave = true
|
|
120
|
+
destroy()
|
|
121
|
+
callbacks.onCancel?.()
|
|
122
|
+
},
|
|
123
|
+
onSubmit: (text) => {
|
|
124
|
+
clearDraft(draftKey)
|
|
125
|
+
skipDraftSave = true
|
|
126
|
+
destroy()
|
|
127
|
+
callbacks.onSubmitOptimistic?.(text, pos.x, pos.y)
|
|
129
128
|
},
|
|
130
|
-
})
|
|
129
|
+
}))
|
|
131
130
|
|
|
132
131
|
applyPosition()
|
|
133
132
|
// Auto-focus textarea after DOM is ready
|
package/src/comments/ui/index.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* React UI exports for the comments system.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Import from '@dfosco/storyboard-core/comments/svelte'.
|
|
4
|
+
* Import from '@dfosco/storyboard-core/comments/ui'.
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
7
|
// Mount
|
package/src/configSchema.js
CHANGED
|
@@ -15,10 +15,57 @@
|
|
|
15
15
|
* @property {Record<string, string>} [propsMap] — static props merged into widget props
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {object} CanvasTerminalConfig
|
|
20
|
+
* @property {boolean} [resizable] — whether terminal widgets can be resized (default false)
|
|
21
|
+
* @property {number} [defaultWidth] — default width for new terminal widgets
|
|
22
|
+
* @property {number} [defaultHeight] — default height for new terminal widgets
|
|
23
|
+
* @property {number} [fontSize] — terminal font size
|
|
24
|
+
* @property {string} [fontFamily] — terminal font family
|
|
25
|
+
* @property {string} [prompt] — shell prompt string
|
|
26
|
+
* @property {string|null} [startupCommand] — skip welcome screen: "copilot", "shell", or a custom command. null shows welcome.
|
|
27
|
+
* @property {object|null} [defaultStartupSequence] — sequence of steps to run after terminal opens
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {object} CanvasZoomConfig
|
|
32
|
+
* @property {number} min — minimum zoom percentage (default 10)
|
|
33
|
+
* @property {number} max — maximum zoom percentage (default 250)
|
|
34
|
+
* @property {number} step — zoom increment/decrement step (default 10)
|
|
35
|
+
*/
|
|
36
|
+
|
|
18
37
|
/**
|
|
19
38
|
* @typedef {object} CanvasConfig
|
|
20
39
|
* @property {PasteRule[]} pasteRules — URL→widget conversion rules (evaluated in order, first match wins)
|
|
21
40
|
* @property {{ embedBehavior: string, ghGuard: string }} github — GitHub-specific embed settings
|
|
41
|
+
* @property {CanvasTerminalConfig} [terminal] — terminal widget settings
|
|
42
|
+
* @property {Record<string, CanvasAgentConfig>} [agents] — per-agent overrides
|
|
43
|
+
* @property {CanvasZoomConfig} [zoom] — zoom min/max/step settings
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {object} CanvasAgentConfig
|
|
48
|
+
* @property {string} [label] — display label
|
|
49
|
+
* @property {string} [icon] — icon name
|
|
50
|
+
* @property {string} [startupCommand] — command to run on startup
|
|
51
|
+
* @property {string} [resumeCommand] — command to browse/resume existing sessions (e.g. "copilot --resume")
|
|
52
|
+
* @property {string} [postStartup] — command sent after agent readiness (e.g. "/allow-all on")
|
|
53
|
+
* @property {string} [readinessSignal] — tmux pane text that signals the agent is ready (fragile, prefer readinessFile)
|
|
54
|
+
* @property {boolean} [readinessFile] — use a file-based SessionStart hook for readiness (writes --settings with hook, polls for signal file)
|
|
55
|
+
* @property {boolean} [resizable] — override terminal resizability for this agent
|
|
56
|
+
* @property {number} [defaultWidth] — override default width
|
|
57
|
+
* @property {number} [defaultHeight] — override default height
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @typedef {object} HotPoolConfig
|
|
62
|
+
* @property {boolean} [enabled] — enable/disable all pools (default: true)
|
|
63
|
+
* @property {boolean} [verbose] — log to Vite terminal (default: false)
|
|
64
|
+
* @property {number} [default_pool_size] — default baseline per pool (default: 1)
|
|
65
|
+
* @property {number} [default_max_pool_size] — default surge cap per pool (default: 3)
|
|
66
|
+
* @property {boolean} [load_balancer] — enable auto-scaling (default: true)
|
|
67
|
+
* @property {number} [load_balancer_cooldown_mins] — minutes idle before scale-down (default: 10)
|
|
68
|
+
* @property {Record<string, { pool_size?: number, max_pool_size?: number }>} [pools] — per-pool overrides (terminal, prompt, copilot, claude, codex)
|
|
22
69
|
*/
|
|
23
70
|
|
|
24
71
|
/**
|
|
@@ -63,7 +110,7 @@
|
|
|
63
110
|
* @property {boolean} enabled — master toggle for customer mode
|
|
64
111
|
* @property {boolean} hideChrome — hides all toolbars (except canvas tools), branchbar, cmd+k, cmd+.
|
|
65
112
|
* @property {boolean} hideHomepage — removes the storyboard homepage (leaves empty page)
|
|
66
|
-
* @property {string} protoHomepage — internal /path that replaces homepage; redirects from / and /
|
|
113
|
+
* @property {string} protoHomepage — internal /path that replaces homepage; redirects from / and /workspace
|
|
67
114
|
*/
|
|
68
115
|
|
|
69
116
|
/**
|
|
@@ -79,6 +126,7 @@
|
|
|
79
126
|
* @property {{ hide?: string[] }} [ui]
|
|
80
127
|
* @property {object} [toolbar]
|
|
81
128
|
* @property {CanvasConfig} [canvas]
|
|
129
|
+
* @property {HotPoolConfig} [hotPool]
|
|
82
130
|
* @property {CommandPaletteConfig} [commandPalette]
|
|
83
131
|
* @property {CustomerModeConfig} [customerMode]
|
|
84
132
|
*/
|
|
@@ -114,6 +162,16 @@ export const configDefaults = {
|
|
|
114
162
|
embedBehavior: 'link-preview', // "link-preview" | "rich-embed"
|
|
115
163
|
ghGuard: 'copy', // "copy" | "link" | "off"
|
|
116
164
|
},
|
|
165
|
+
zoom: {
|
|
166
|
+
min: 10,
|
|
167
|
+
max: 250,
|
|
168
|
+
step: 10,
|
|
169
|
+
},
|
|
170
|
+
terminal: {
|
|
171
|
+
resizable: false,
|
|
172
|
+
defaultWidth: 800,
|
|
173
|
+
defaultHeight: 450,
|
|
174
|
+
},
|
|
117
175
|
},
|
|
118
176
|
commandPalette: {
|
|
119
177
|
providers: ['prototypes', 'flows', 'canvases', 'pages'],
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified Config Store — single source of truth for all storyboard configuration.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the scattered init/store pattern with one reactive config object.
|
|
5
|
+
* Domain-specific stores (toolbarConfigStore, canvasConfig, etc.) become thin
|
|
6
|
+
* wrappers that delegate here — zero consumer changes needed.
|
|
7
|
+
*
|
|
8
|
+
* Override priority (lowest → highest):
|
|
9
|
+
* core defaults → widgets → paste → toolbar → commandPalette → storyboard.config.json → prototype
|
|
10
|
+
*
|
|
11
|
+
* Framework-agnostic (zero npm dependencies).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { deepMerge } from './loader.js'
|
|
15
|
+
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Internal state
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
/** @type {object} Full merged config (set once at startup) */
|
|
21
|
+
let _baseConfig = {}
|
|
22
|
+
|
|
23
|
+
/** @type {Record<string, object>} Domain → prototype-level overrides */
|
|
24
|
+
let _prototypeOverrides = {}
|
|
25
|
+
|
|
26
|
+
/** @type {object} Final merged config (base + prototype overrides) */
|
|
27
|
+
let _mergedConfig = {}
|
|
28
|
+
|
|
29
|
+
/** @type {Set<Function>} */
|
|
30
|
+
const _listeners = new Set()
|
|
31
|
+
|
|
32
|
+
let _snapshotVersion = 0
|
|
33
|
+
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
// Initialization
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Seed the unified config with the pre-merged config object.
|
|
40
|
+
* Called once at app startup (from the virtual module or mountStoryboardCore).
|
|
41
|
+
*
|
|
42
|
+
* @param {object} config - The unified config with all domains
|
|
43
|
+
*/
|
|
44
|
+
export function initConfig(config) {
|
|
45
|
+
_baseConfig = config || {}
|
|
46
|
+
_prototypeOverrides = {}
|
|
47
|
+
_recompute()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// ---------------------------------------------------------------------------
|
|
51
|
+
// Domain access
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get the full merged config or a specific domain slice.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} [domain] - Optional domain key (e.g. 'toolbar', 'canvas')
|
|
58
|
+
* @returns {object}
|
|
59
|
+
*/
|
|
60
|
+
export function getConfig(domain) {
|
|
61
|
+
if (!domain) return _mergedConfig
|
|
62
|
+
return _mergedConfig[domain] || {}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Prototype overrides
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Set overrides for a specific domain from a prototype-local config file.
|
|
71
|
+
* Called on route change when entering a prototype with local config.
|
|
72
|
+
*
|
|
73
|
+
* @param {string} domain - Config domain (e.g. 'toolbar', 'widgets')
|
|
74
|
+
* @param {object} overrides - Prototype-level overrides to deep-merge
|
|
75
|
+
*/
|
|
76
|
+
export function setOverrides(domain, overrides) {
|
|
77
|
+
if (!overrides) return
|
|
78
|
+
_prototypeOverrides[domain] = overrides
|
|
79
|
+
_recompute()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Clear overrides for a specific domain.
|
|
84
|
+
*
|
|
85
|
+
* @param {string} domain
|
|
86
|
+
*/
|
|
87
|
+
export function clearOverrides(domain) {
|
|
88
|
+
if (!_prototypeOverrides[domain]) return
|
|
89
|
+
delete _prototypeOverrides[domain]
|
|
90
|
+
_recompute()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Clear all prototype overrides (e.g. when leaving a prototype).
|
|
95
|
+
*/
|
|
96
|
+
export function clearAllOverrides() {
|
|
97
|
+
if (Object.keys(_prototypeOverrides).length === 0) return
|
|
98
|
+
_prototypeOverrides = {}
|
|
99
|
+
_recompute()
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// Reactivity
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Subscribe to config changes. Compatible with Svelte stores.
|
|
108
|
+
*
|
|
109
|
+
* @param {Function} callback - Called with the full merged config
|
|
110
|
+
* @returns {Function} Unsubscribe
|
|
111
|
+
*/
|
|
112
|
+
export function subscribeToConfig(callback) {
|
|
113
|
+
_listeners.add(callback)
|
|
114
|
+
callback(_mergedConfig)
|
|
115
|
+
return () => _listeners.delete(callback)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Snapshot version for useSyncExternalStore.
|
|
120
|
+
*
|
|
121
|
+
* @returns {string}
|
|
122
|
+
*/
|
|
123
|
+
export function getConfigSnapshot() {
|
|
124
|
+
return String(_snapshotVersion)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
// Internal
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
|
|
131
|
+
function _recompute() {
|
|
132
|
+
if (Object.keys(_prototypeOverrides).length === 0) {
|
|
133
|
+
_mergedConfig = _baseConfig
|
|
134
|
+
} else {
|
|
135
|
+
const result = { ..._baseConfig }
|
|
136
|
+
for (const [domain, overrides] of Object.entries(_prototypeOverrides)) {
|
|
137
|
+
result[domain] = result[domain]
|
|
138
|
+
? deepMerge(result[domain], overrides)
|
|
139
|
+
: overrides
|
|
140
|
+
}
|
|
141
|
+
_mergedConfig = result
|
|
142
|
+
}
|
|
143
|
+
_snapshotVersion++
|
|
144
|
+
for (const cb of _listeners) {
|
|
145
|
+
try { cb(_mergedConfig) } catch (err) {
|
|
146
|
+
console.error('[storyboard] Error in config subscriber:', err)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// ---------------------------------------------------------------------------
|
|
152
|
+
// Test helpers
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
|
|
155
|
+
export function _resetConfig() {
|
|
156
|
+
_baseConfig = {}
|
|
157
|
+
_prototypeOverrides = {}
|
|
158
|
+
_mergedConfig = {}
|
|
159
|
+
_listeners.clear()
|
|
160
|
+
_snapshotVersion = 0
|
|
161
|
+
}
|
package/src/core-ui-colors.css
CHANGED
|
@@ -64,6 +64,12 @@
|
|
|
64
64
|
--fgColor-muted: #656d76;
|
|
65
65
|
--borderColor-default: #d1d9e0;
|
|
66
66
|
--bgColor-neutral-muted: rgba(175, 184, 193, 0.2);
|
|
67
|
+
|
|
68
|
+
/* Slate palette tokens — used by trigger buttons and canvas toolbar */
|
|
69
|
+
--color-slate-100: oklch(96.8% .007 247.896);
|
|
70
|
+
--color-slate-300: oklch(86.9% .022 252.894);
|
|
71
|
+
--color-slate-400: oklch(70.4% .04 256.788);
|
|
72
|
+
--color-slate-600: oklch(44.6% .043 257.281);
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
/* Dark tokens — applied when toolbar syncs with a dark theme.
|
|
@@ -114,4 +120,10 @@
|
|
|
114
120
|
--fgColor-muted: #8b949e;
|
|
115
121
|
--borderColor-default: #30363d;
|
|
116
122
|
--bgColor-neutral-muted: rgba(110, 118, 129, 0.2);
|
|
123
|
+
|
|
124
|
+
/* Slate palette tokens — dark equivalents */
|
|
125
|
+
--color-slate-100: oklch(20.8% .042 265.755);
|
|
126
|
+
--color-slate-300: oklch(29.3% .042 264.531);
|
|
127
|
+
--color-slate-400: oklch(44.6% .043 257.281);
|
|
128
|
+
--color-slate-600: oklch(70.4% .04 256.788);
|
|
117
129
|
}
|
package/src/devtools.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Storyboard Core UI Bar —
|
|
2
|
+
* Storyboard Core UI Bar — React-based floating toolbar.
|
|
3
3
|
*
|
|
4
|
-
* Mounts the CoreUIBar
|
|
4
|
+
* Mounts the CoreUIBar React component into the DOM.
|
|
5
5
|
* Contains the command menu and mode-specific buttons (workshop, etc.).
|
|
6
|
-
* Uses dynamic import() for the
|
|
7
|
-
* breaking non-
|
|
6
|
+
* Uses dynamic import() for the React component to avoid
|
|
7
|
+
* breaking non-React test environments.
|
|
8
8
|
*
|
|
9
9
|
* Usage:
|
|
10
10
|
* import { mountDevTools } from '@dfosco/storyboard-core'
|
|
11
11
|
* mountDevTools() // call once at app startup
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
let
|
|
14
|
+
let root = null
|
|
15
15
|
let wrapper = null
|
|
16
16
|
let skipLink = null
|
|
17
17
|
|
|
@@ -35,8 +35,9 @@ export async function mountDevTools(options = {}) {
|
|
|
35
35
|
// Skip mounting entirely when loaded inside a prototype embed iframe
|
|
36
36
|
if (typeof window !== 'undefined' && new URLSearchParams(window.location.search).has('_sb_embed')) return
|
|
37
37
|
|
|
38
|
-
const {
|
|
39
|
-
const {
|
|
38
|
+
const { createElement } = await import('react')
|
|
39
|
+
const { createRoot } = await import('react-dom/client')
|
|
40
|
+
const { default: CoreUIBar } = await import('./CoreUIBar.jsx')
|
|
40
41
|
|
|
41
42
|
// Inject skip link as the first child of <body> so it is the
|
|
42
43
|
// first element in the tab order, regardless of where CoreUIBar
|
|
@@ -108,24 +109,21 @@ export async function mountDevTools(options = {}) {
|
|
|
108
109
|
wrapper.id = 'sb-core-ui'
|
|
109
110
|
container.appendChild(wrapper)
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
})
|
|
112
|
+
root = createRoot(wrapper)
|
|
113
|
+
root.render(createElement(CoreUIBar, {
|
|
114
|
+
basePath,
|
|
115
|
+
toolbarConfig: options.toolbarConfig,
|
|
116
|
+
customHandlers: options.customHandlers,
|
|
117
|
+
}))
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
/**
|
|
122
121
|
* Remove the Core UI Bar from the DOM.
|
|
123
122
|
*/
|
|
124
123
|
export async function unmountDevTools() {
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
instance = null
|
|
124
|
+
if (root) {
|
|
125
|
+
root.unmount()
|
|
126
|
+
root = null
|
|
129
127
|
}
|
|
130
128
|
if (wrapper) { wrapper.remove(); wrapper = null }
|
|
131
129
|
if (skipLink) { skipLink.remove(); skipLink = null }
|
package/src/devtools.test.js
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Tests for devtools.js — command menu mount lifecycle.
|
|
3
|
-
* Mocks the
|
|
3
|
+
* Mocks the React component to avoid jsdom lifecycle issues.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { vi } from 'vitest'
|
|
7
7
|
|
|
8
|
-
vi.
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const mockRender = vi.fn()
|
|
9
|
+
const mockUnmount = vi.fn()
|
|
10
|
+
const mockCreateRoot = vi.fn(() => ({ render: mockRender, unmount: mockUnmount }))
|
|
11
|
+
|
|
12
|
+
vi.mock('react', () => ({
|
|
13
|
+
createElement: vi.fn((comp, props) => ({ comp, props })),
|
|
14
|
+
}))
|
|
15
|
+
|
|
16
|
+
vi.mock('react-dom/client', () => ({
|
|
17
|
+
createRoot: mockCreateRoot,
|
|
11
18
|
}))
|
|
12
19
|
|
|
13
|
-
vi.mock('./CommandMenu.
|
|
20
|
+
vi.mock('./CommandMenu.jsx', () => ({ default: () => null }))
|
|
14
21
|
|
|
15
22
|
describe('mountDevTools', () => {
|
|
16
23
|
let mountDevTools, unmountDevTools
|
|
@@ -19,11 +26,13 @@ describe('mountDevTools', () => {
|
|
|
19
26
|
document.body.innerHTML = ''
|
|
20
27
|
vi.resetModules()
|
|
21
28
|
|
|
22
|
-
vi.doMock('
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
vi.doMock('react', () => ({
|
|
30
|
+
createElement: vi.fn((comp, props) => ({ comp, props })),
|
|
31
|
+
}))
|
|
32
|
+
vi.doMock('react-dom/client', () => ({
|
|
33
|
+
createRoot: vi.fn(() => ({ render: vi.fn(), unmount: vi.fn() })),
|
|
25
34
|
}))
|
|
26
|
-
vi.doMock('./CommandMenu.
|
|
35
|
+
vi.doMock('./CommandMenu.jsx', () => ({ default: () => null }))
|
|
27
36
|
|
|
28
37
|
const mod = await import('./devtools.js')
|
|
29
38
|
mountDevTools = mod.mountDevTools
|
package/src/featureFlags.js
CHANGED
|
@@ -16,6 +16,12 @@ import { getLocal, setLocal, removeLocal, getAllLocal } from './localStorage.js'
|
|
|
16
16
|
const FLAG_PREFIX = 'flag.'
|
|
17
17
|
const BODY_CLASS_PREFIX = 'sb-ff-'
|
|
18
18
|
|
|
19
|
+
/** Built-in feature flag defaults — always available even if initFeatureFlags is never called. */
|
|
20
|
+
const BUILTIN_DEFAULTS = {
|
|
21
|
+
'canvas-auto-reload': false,
|
|
22
|
+
'prototype-auto-reload': true,
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
/** Module-level storage for config defaults */
|
|
20
26
|
let _defaults = {}
|
|
21
27
|
|
|
@@ -43,7 +49,7 @@ export function syncFlagBodyClasses() {
|
|
|
43
49
|
* @param {Record<string, boolean>} defaults - Flag key → default value
|
|
44
50
|
*/
|
|
45
51
|
export function initFeatureFlags(defaults = {}) {
|
|
46
|
-
_defaults = { ...defaults }
|
|
52
|
+
_defaults = { ...BUILTIN_DEFAULTS, ...defaults }
|
|
47
53
|
for (const [key, value] of Object.entries(_defaults)) {
|
|
48
54
|
if (getLocal(FLAG_PREFIX + key) === null) {
|
|
49
55
|
setLocal(FLAG_PREFIX + key, String(value))
|
|
@@ -61,7 +67,7 @@ export function getFlag(key) {
|
|
|
61
67
|
const localVal = getLocal(FLAG_PREFIX + key)
|
|
62
68
|
if (localVal !== null) return localVal === 'true'
|
|
63
69
|
|
|
64
|
-
return _defaults[key] ?? false
|
|
70
|
+
return _defaults[key] ?? BUILTIN_DEFAULTS[key] ?? false
|
|
65
71
|
}
|
|
66
72
|
|
|
67
73
|
/**
|
|
@@ -87,10 +93,11 @@ export function toggleFlag(key) {
|
|
|
87
93
|
* @returns {Record<string, { default: boolean, current: boolean }>}
|
|
88
94
|
*/
|
|
89
95
|
export function getAllFlags() {
|
|
96
|
+
const allKeys = new Set([...Object.keys(BUILTIN_DEFAULTS), ...Object.keys(_defaults)])
|
|
90
97
|
const result = {}
|
|
91
|
-
for (const key of
|
|
98
|
+
for (const key of allKeys) {
|
|
92
99
|
result[key] = {
|
|
93
|
-
default: _defaults[key] ?? false,
|
|
100
|
+
default: _defaults[key] ?? BUILTIN_DEFAULTS[key] ?? false,
|
|
94
101
|
current: getFlag(key),
|
|
95
102
|
}
|
|
96
103
|
}
|
|
@@ -116,5 +123,5 @@ export function resetFlags() {
|
|
|
116
123
|
* @returns {string[]}
|
|
117
124
|
*/
|
|
118
125
|
export function getFlagKeys() {
|
|
119
|
-
return Object.keys(_defaults)
|
|
126
|
+
return [...new Set([...Object.keys(BUILTIN_DEFAULTS), ...Object.keys(_defaults)])]
|
|
120
127
|
}
|
package/src/fuzzySearch.test.js
CHANGED
|
@@ -106,4 +106,14 @@ describe('fuzzySearch', () => {
|
|
|
106
106
|
const results = fuzzySearch(data, 'val')
|
|
107
107
|
expect(results).toHaveLength(1)
|
|
108
108
|
})
|
|
109
|
+
|
|
110
|
+
it('ranks agent keyword matches above fuzzy component matches for "cop"', () => {
|
|
111
|
+
const data = [
|
|
112
|
+
{ label: 'Component add widget create component component' },
|
|
113
|
+
{ label: 'Agent add widget create agent copilot Copilot CLI' },
|
|
114
|
+
]
|
|
115
|
+
const results = fuzzySearch(data, 'cop')
|
|
116
|
+
expect(results[0].item.label).toContain('Agent')
|
|
117
|
+
expect(results[0].score).toBeGreaterThan(results[1].score)
|
|
118
|
+
})
|
|
109
119
|
})
|
package/src/index.js
CHANGED
|
@@ -82,7 +82,7 @@ export { initUIConfig, isMenuHidden, getHiddenItems } from './uiConfig.js'
|
|
|
82
82
|
export { initToolRegistry, registerToolModule, setToolComponent, setToolGuardResult, getToolComponent, getToolModule, getToolsForToolbar, getToolConfig, getAllToolConfigs, subscribeToToolRegistry, getToolRegistrySnapshot } from './toolRegistry.js'
|
|
83
83
|
|
|
84
84
|
// Toolbar config store (reactive layered overrides: core → custom → prototype → user)
|
|
85
|
-
export { initToolbarConfig, setPrototypeToolbarConfig, clearPrototypeToolbarConfig, getToolbarConfig, subscribeToToolbarConfig, getToolbarConfigSnapshot } from './toolbarConfigStore.js'
|
|
85
|
+
export { initToolbarConfig, setPrototypeToolbarConfig, clearPrototypeToolbarConfig, getToolbarConfig, subscribeToToolbarConfig, getToolbarConfigSnapshot, setClientToolbarOverrides } from './toolbarConfigStore.js'
|
|
86
86
|
|
|
87
87
|
// Toolbar tool state management (runtime state for toolbar tools)
|
|
88
88
|
export { TOOL_STATES, initToolbarToolStates, setToolbarToolState, getToolbarToolState, isToolbarToolLocalOnly, subscribeToToolbarToolStates, getToolbarToolStatesSnapshot } from './toolStateStore.js'
|
|
@@ -91,9 +91,12 @@ export { TOOL_STATES, initToolbarToolStates, setToolbarToolState, getToolbarTool
|
|
|
91
91
|
export { initCommentsConfig, getCommentsConfig, isCommentsEnabled } from './comments/config.js'
|
|
92
92
|
|
|
93
93
|
// Canvas config (paste rules, canvas-level overrides)
|
|
94
|
-
export { initCanvasConfig, getPasteRules, getTerminalConfig } from './canvasConfig.js'
|
|
94
|
+
export { initCanvasConfig, getPasteRules, getTerminalConfig, getAgentsConfig, isTerminalResizable, getTerminalDimensions, getCanvasZoom } from './canvasConfig.js'
|
|
95
95
|
export { getCommandPaletteConfig } from './commandPaletteConfig.js'
|
|
96
96
|
|
|
97
|
+
// Unified config store
|
|
98
|
+
export { initConfig, getConfig, setOverrides, clearOverrides, clearAllOverrides, subscribeToConfig, getConfigSnapshot } from './configStore.js'
|
|
99
|
+
|
|
97
100
|
// Customer mode config
|
|
98
101
|
export { initCustomerModeConfig, getCustomerModeConfig, isCustomerMode } from './customerModeConfig.js'
|
|
99
102
|
|
|
@@ -110,3 +113,12 @@ export {
|
|
|
110
113
|
|
|
111
114
|
// Recent artifacts (command palette recents)
|
|
112
115
|
export { trackRecent, getRecent, clearRecent } from './recentArtifacts.js'
|
|
116
|
+
|
|
117
|
+
// Fuzzy search (scoring used by command palette custom filter)
|
|
118
|
+
export { scoreMatch } from './fuzzySearch.js'
|
|
119
|
+
|
|
120
|
+
// Icon component for UI rendering
|
|
121
|
+
export { Icon, default as IconDefault } from './svelte-plugin-ui/components/Icon.jsx'
|
|
122
|
+
|
|
123
|
+
// Shared UI components
|
|
124
|
+
export { default as BranchSelect } from './BranchSelect.jsx'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AlertAction = forwardRef(function AlertAction({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="alert-action" className={cn("absolute top-2 right-2", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default AlertAction;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AlertDescription = forwardRef(function AlertDescription({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="alert-description" className={cn("text-muted-foreground text-sm text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default AlertDescription;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
|
|
4
|
+
const AlertTitle = forwardRef(function AlertTitle({ className, children, ...props }, ref) {
|
|
5
|
+
return (
|
|
6
|
+
<div ref={ref} data-slot="alert-title" className={cn("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3", className)} {...props}>
|
|
7
|
+
{children}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
});
|
|
11
|
+
export default AlertTitle;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
import { tv } from "tailwind-variants";
|
|
4
|
+
|
|
5
|
+
export const alertVariants = tv({
|
|
6
|
+
base: "grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full",
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-card text-card-foreground",
|
|
10
|
+
destructive: "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const Alert = forwardRef(function Alert({ className, variant = "default", children, ...props }, ref) {
|
|
19
|
+
return (
|
|
20
|
+
<div ref={ref} data-slot="alert" role="alert" className={cn(alertVariants({ variant }), className)} {...props}>
|
|
21
|
+
{children}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
export default Alert;
|