@dfosco/storyboard-core 4.2.0-beta.4 → 4.2.1

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.
Files changed (419) hide show
  1. package/commandpalette.config.json +109 -24
  2. package/dist/storyboard-ui.css +1 -1
  3. package/dist/storyboard-ui.js +16711 -27239
  4. package/dist/storyboard-ui.js.map +1 -1
  5. package/dist/tailwind.css +1 -1
  6. package/package.json +5 -2
  7. package/scaffold/agents/prompt-agent.agent.md +181 -0
  8. package/scaffold/agents/terminal-agent.agent.md +351 -0
  9. package/scaffold/codex/config.toml +246 -0
  10. package/scaffold/manifest.json +5 -10
  11. package/scaffold/skills/canvas/SKILL.md +5 -4
  12. package/scaffold/skills/ship/SKILL.md +1 -1
  13. package/scaffold/storyboard.config.json +11 -1
  14. package/src/ActionMenuButton.jsx +103 -0
  15. package/src/AutosyncMenuButton.css +67 -0
  16. package/src/AutosyncMenuButton.jsx +242 -0
  17. package/src/BranchSelect.jsx +29 -0
  18. package/src/BranchSelect.module.css +30 -0
  19. package/src/CanvasAgentsMenu.jsx +89 -0
  20. package/src/CanvasCreateMenu.jsx +611 -0
  21. package/src/CanvasSnap.css +27 -0
  22. package/src/CanvasSnap.jsx +51 -0
  23. package/src/CanvasUndoRedo.css +36 -0
  24. package/src/CanvasUndoRedo.jsx +62 -0
  25. package/src/CanvasZoomControl.css +53 -0
  26. package/src/CanvasZoomControl.jsx +49 -0
  27. package/src/CanvasZoomToFit.css +18 -0
  28. package/src/CanvasZoomToFit.jsx +26 -0
  29. package/src/CommandMenu.css +8 -0
  30. package/src/CommandMenu.jsx +287 -0
  31. package/src/CommandPalette.jsx +35 -0
  32. package/src/CommandPaletteTrigger.jsx +25 -0
  33. package/src/CommentsMenuButton.jsx +40 -0
  34. package/src/CoreUIBar.css +47 -0
  35. package/src/CoreUIBar.jsx +858 -0
  36. package/src/CreateMenuButton.jsx +117 -0
  37. package/src/HideChromeTrigger.jsx +40 -0
  38. package/src/InspectorPanel.css +109 -0
  39. package/src/InspectorPanel.jsx +632 -0
  40. package/src/PwaInstallBanner.css +42 -0
  41. package/src/PwaInstallBanner.jsx +124 -0
  42. package/src/SidePanel.jsx +261 -0
  43. package/src/ThemeMenuButton.jsx +139 -0
  44. package/src/autosync/server.js +202 -5
  45. package/src/autosync/server.test.js +111 -0
  46. package/src/canvas/__tests__/agent-integration.test.js +596 -0
  47. package/src/canvas/__tests__/helpers/browser.js +95 -0
  48. package/src/canvas/__tests__/helpers/canvas-api.js +129 -0
  49. package/src/canvas/__tests__/helpers/perf.js +118 -0
  50. package/src/canvas/__tests__/helpers/setup.js +176 -0
  51. package/src/canvas/__tests__/helpers/tmux.js +130 -0
  52. package/src/canvas/__tests__/helpers/transcript.js +132 -0
  53. package/src/canvas/__tests__/terminal-integration.test.js +177 -0
  54. package/src/canvas/hot-pool.js +756 -0
  55. package/src/canvas/materializer.js +31 -0
  56. package/src/canvas/materializer.test.js +56 -0
  57. package/src/canvas/selectedWidgets.js +65 -7
  58. package/src/canvas/server.js +1802 -22
  59. package/src/canvas/server.test.js +239 -0
  60. package/src/canvas/terminal-config.js +330 -0
  61. package/src/canvas/terminal-registry.js +41 -3
  62. package/src/canvas/terminal-server.js +1098 -37
  63. package/src/canvas/writeGuard.js +51 -3
  64. package/src/canvasConfig.js +67 -1
  65. package/src/canvasConfig.test.js +79 -1
  66. package/src/cli/agent.js +85 -0
  67. package/src/cli/branch.js +232 -0
  68. package/src/cli/canvasAdd.js +61 -14
  69. package/src/cli/canvasBatch.js +98 -0
  70. package/src/cli/canvasBounds.js +1 -1
  71. package/src/cli/canvasRead.js +1 -1
  72. package/src/cli/canvasUpdate.js +179 -0
  73. package/src/cli/compact.js +0 -2
  74. package/src/cli/create.js +40 -16
  75. package/src/cli/dev.js +158 -84
  76. package/src/cli/exit.js +23 -24
  77. package/src/cli/index.js +55 -2
  78. package/src/cli/proxy.js +96 -37
  79. package/src/cli/schemas.js +22 -4
  80. package/src/cli/server.js +149 -26
  81. package/src/cli/serverUrl.js +8 -3
  82. package/src/cli/sessions.js +133 -7
  83. package/src/cli/setup.js +138 -12
  84. package/src/cli/terminal-commands.js +20 -9
  85. package/src/cli/terminal-messaging.js +231 -0
  86. package/src/cli/terminal-welcome.js +449 -34
  87. package/src/cli/updateVersion.js +1 -1
  88. package/src/commandActions.js +1 -0
  89. package/src/commandPaletteConfig.js +9 -0
  90. package/src/comments/auth.js +2 -1
  91. package/src/comments/ui/AuthModal.jsx +114 -0
  92. package/src/comments/ui/CommentWindow.jsx +329 -0
  93. package/src/comments/ui/CommentsDrawer.jsx +102 -0
  94. package/src/comments/ui/Composer.jsx +64 -0
  95. package/src/comments/ui/authModal.test.js +1 -1
  96. package/src/comments/ui/commentWindow.js +16 -17
  97. package/src/comments/ui/commentsDrawer.js +25 -26
  98. package/src/comments/ui/composer.js +23 -24
  99. package/src/comments/ui/index.js +2 -3
  100. package/src/configSchema.js +59 -1
  101. package/src/configStore.js +161 -0
  102. package/src/core-ui-colors.css +12 -0
  103. package/src/devtools.js +17 -19
  104. package/src/devtools.test.js +18 -9
  105. package/src/featureFlags.js +12 -5
  106. package/src/fuzzySearch.test.js +10 -0
  107. package/src/index.js +15 -3
  108. package/src/lib/components/ui/alert/alert-action.jsx +11 -0
  109. package/src/lib/components/ui/alert/alert-description.jsx +11 -0
  110. package/src/lib/components/ui/alert/alert-title.jsx +11 -0
  111. package/src/lib/components/ui/alert/alert.jsx +25 -0
  112. package/src/lib/components/ui/alert/index.js +15 -15
  113. package/src/lib/components/ui/avatar/avatar-badge.jsx +22 -0
  114. package/src/lib/components/ui/avatar/avatar-fallback.jsx +18 -0
  115. package/src/lib/components/ui/avatar/avatar-group-count.jsx +19 -0
  116. package/src/lib/components/ui/avatar/avatar-group.jsx +19 -0
  117. package/src/lib/components/ui/avatar/avatar-image.jsx +15 -0
  118. package/src/lib/components/ui/avatar/avatar.jsx +19 -0
  119. package/src/lib/components/ui/avatar/index.js +20 -20
  120. package/src/lib/components/ui/badge/badge.jsx +31 -0
  121. package/src/lib/components/ui/badge/index.js +2 -2
  122. package/src/lib/components/ui/button/button.jsx +100 -0
  123. package/src/lib/components/ui/button/index.js +9 -9
  124. package/src/lib/components/ui/card/card-action.jsx +11 -0
  125. package/src/lib/components/ui/card/card-content.jsx +11 -0
  126. package/src/lib/components/ui/card/card-description.jsx +11 -0
  127. package/src/lib/components/ui/card/card-footer.jsx +11 -0
  128. package/src/lib/components/ui/card/card-header.jsx +19 -0
  129. package/src/lib/components/ui/card/card-title.jsx +11 -0
  130. package/src/lib/components/ui/card/card.jsx +17 -0
  131. package/src/lib/components/ui/card/index.js +23 -23
  132. package/src/lib/components/ui/checkbox/checkbox.jsx +29 -0
  133. package/src/lib/components/ui/checkbox/index.js +5 -5
  134. package/src/lib/components/ui/collapsible/collapsible-content.jsx +7 -0
  135. package/src/lib/components/ui/collapsible/collapsible-trigger.jsx +7 -0
  136. package/src/lib/components/ui/collapsible/collapsible.jsx +7 -0
  137. package/src/lib/components/ui/collapsible/index.js +11 -11
  138. package/src/lib/components/ui/dialog/dialog-close.jsx +7 -0
  139. package/src/lib/components/ui/dialog/dialog-content.jsx +34 -0
  140. package/src/lib/components/ui/dialog/dialog-description.jsx +15 -0
  141. package/src/lib/components/ui/dialog/dialog-footer.jsx +23 -0
  142. package/src/lib/components/ui/dialog/dialog-header.jsx +11 -0
  143. package/src/lib/components/ui/dialog/dialog-overlay.jsx +15 -0
  144. package/src/lib/components/ui/dialog/dialog-portal.jsx +4 -0
  145. package/src/lib/components/ui/dialog/dialog-title.jsx +15 -0
  146. package/src/lib/components/ui/dialog/dialog-trigger.jsx +7 -0
  147. package/src/lib/components/ui/dialog/dialog.jsx +4 -0
  148. package/src/lib/components/ui/dialog/index.js +32 -32
  149. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.jsx +8 -0
  150. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.jsx +30 -0
  151. package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.jsx +22 -0
  152. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.jsx +16 -0
  153. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.jsx +7 -0
  154. package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.jsx +20 -0
  155. package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.jsx +17 -0
  156. package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.jsx +4 -0
  157. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.jsx +7 -0
  158. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.jsx +29 -0
  159. package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.jsx +15 -0
  160. package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.jsx +16 -0
  161. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.jsx +15 -0
  162. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.jsx +23 -0
  163. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.jsx +4 -0
  164. package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.jsx +7 -0
  165. package/src/lib/components/ui/dropdown-menu/dropdown-menu.jsx +4 -0
  166. package/src/lib/components/ui/dropdown-menu/index.js +52 -52
  167. package/src/lib/components/ui/input/index.js +5 -5
  168. package/src/lib/components/ui/input/input.jsx +19 -0
  169. package/src/lib/components/ui/label/index.js +5 -5
  170. package/src/lib/components/ui/label/label.jsx +19 -0
  171. package/src/lib/components/ui/panel/index.js +21 -21
  172. package/src/lib/components/ui/panel/panel-body.jsx +11 -0
  173. package/src/lib/components/ui/panel/panel-close.jsx +16 -0
  174. package/src/lib/components/ui/panel/panel-content.jsx +29 -0
  175. package/src/lib/components/ui/panel/panel-footer.jsx +11 -0
  176. package/src/lib/components/ui/panel/panel-header.jsx +11 -0
  177. package/src/lib/components/ui/panel/panel-title.jsx +12 -0
  178. package/src/lib/components/ui/panel/panel.jsx +4 -0
  179. package/src/lib/components/ui/popover/index.js +26 -26
  180. package/src/lib/components/ui/popover/popover-close.jsx +7 -0
  181. package/src/lib/components/ui/popover/popover-content.jsx +22 -0
  182. package/src/lib/components/ui/popover/popover-description.jsx +11 -0
  183. package/src/lib/components/ui/popover/popover-header.jsx +11 -0
  184. package/src/lib/components/ui/popover/popover-portal.jsx +4 -0
  185. package/src/lib/components/ui/popover/popover-title.jsx +11 -0
  186. package/src/lib/components/ui/popover/popover-trigger.jsx +8 -0
  187. package/src/lib/components/ui/popover/popover.jsx +4 -0
  188. package/src/lib/components/ui/searchable-list.jsx +160 -0
  189. package/src/lib/components/ui/select/index.js +35 -35
  190. package/src/lib/components/ui/select/select-content.jsx +30 -0
  191. package/src/lib/components/ui/select/select-group-heading.jsx +17 -0
  192. package/src/lib/components/ui/select/select-group.jsx +15 -0
  193. package/src/lib/components/ui/select/select-item.jsx +26 -0
  194. package/src/lib/components/ui/select/select-label.jsx +11 -0
  195. package/src/lib/components/ui/select/select-portal.jsx +4 -0
  196. package/src/lib/components/ui/select/select-scroll-down-button.jsx +18 -0
  197. package/src/lib/components/ui/select/select-scroll-up-button.jsx +18 -0
  198. package/src/lib/components/ui/select/select-separator.jsx +15 -0
  199. package/src/lib/components/ui/select/select-trigger.jsx +25 -0
  200. package/src/lib/components/ui/select/select.jsx +4 -0
  201. package/src/lib/components/ui/separator/index.js +5 -5
  202. package/src/lib/components/ui/separator/separator.jsx +22 -0
  203. package/src/lib/components/ui/sheet/index.js +32 -32
  204. package/src/lib/components/ui/sheet/sheet-close.jsx +7 -0
  205. package/src/lib/components/ui/sheet/sheet-content.jsx +35 -0
  206. package/src/lib/components/ui/sheet/sheet-description.jsx +15 -0
  207. package/src/lib/components/ui/sheet/sheet-footer.jsx +11 -0
  208. package/src/lib/components/ui/sheet/sheet-header.jsx +11 -0
  209. package/src/lib/components/ui/sheet/sheet-overlay.jsx +15 -0
  210. package/src/lib/components/ui/sheet/sheet-portal.jsx +4 -0
  211. package/src/lib/components/ui/sheet/sheet-title.jsx +15 -0
  212. package/src/lib/components/ui/sheet/sheet-trigger.jsx +7 -0
  213. package/src/lib/components/ui/sheet/sheet.jsx +4 -0
  214. package/src/lib/components/ui/textarea/index.js +5 -5
  215. package/src/lib/components/ui/textarea/textarea.jsx +18 -0
  216. package/src/lib/components/ui/toggle/index.js +6 -9
  217. package/src/lib/components/ui/toggle/toggle.jsx +36 -0
  218. package/src/lib/components/ui/toggle-group/index.js +8 -8
  219. package/src/lib/components/ui/toggle-group/toggle-group-item.jsx +29 -0
  220. package/src/lib/components/ui/toggle-group/toggle-group.jsx +43 -0
  221. package/src/lib/components/ui/tooltip/index.js +3 -3
  222. package/src/lib/components/ui/tooltip/tooltip-content.jsx +21 -0
  223. package/src/lib/components/ui/tooltip/tooltip-trigger.jsx +23 -0
  224. package/src/lib/components/ui/tooltip/tooltip.jsx +11 -0
  225. package/src/lib/components/ui/trigger-button/index.js +3 -3
  226. package/src/lib/components/ui/trigger-button/trigger-button.css +38 -0
  227. package/src/lib/components/ui/trigger-button/trigger-button.jsx +63 -0
  228. package/src/logger/devLogger.js +238 -0
  229. package/src/logger/devLogger.test.js +193 -0
  230. package/src/modes.test.js +4 -4
  231. package/src/mountStoryboardCore.js +133 -42
  232. package/src/paletteProviders.js +3 -0
  233. package/src/paletteProviders.test.js +2 -2
  234. package/src/server/index.js +104 -40
  235. package/src/sidepanel.css +214 -0
  236. package/src/smoothCorners.js +1 -1
  237. package/src/styles/tailwind.css +1 -1
  238. package/src/svelte-plugin-ui/__tests__/ModeSwitch.test.ts +8 -8
  239. package/src/svelte-plugin-ui/__tests__/ToolbarShell.test.ts +11 -10
  240. package/src/svelte-plugin-ui/components/Icon.css +11 -0
  241. package/src/svelte-plugin-ui/components/Icon.jsx +281 -0
  242. package/src/svelte-plugin-ui/components/ModeSwitch.css +90 -0
  243. package/src/svelte-plugin-ui/components/ModeSwitch.jsx +47 -0
  244. package/src/svelte-plugin-ui/components/ToolbarShell.css +80 -0
  245. package/src/svelte-plugin-ui/components/ToolbarShell.jsx +84 -0
  246. package/src/svelte-plugin-ui/components/Viewfinder.css +412 -0
  247. package/src/svelte-plugin-ui/components/Viewfinder.jsx +513 -0
  248. package/src/svelte-plugin-ui/mount.ts +12 -16
  249. package/src/toolRegistry.js +4 -4
  250. package/src/toolbarConfigStore.js +30 -0
  251. package/src/tools/handlers/autosync.js +1 -1
  252. package/src/tools/handlers/canvasAddWidget.js +1 -1
  253. package/src/tools/handlers/canvasAgents.js +20 -0
  254. package/src/tools/handlers/canvasToolbar.js +8 -8
  255. package/src/tools/handlers/commandPalette.js +9 -0
  256. package/src/tools/handlers/comments.js +2 -2
  257. package/src/tools/handlers/create.js +1 -1
  258. package/src/tools/handlers/devtools.js +19 -3
  259. package/src/tools/handlers/devtools.test.js +38 -0
  260. package/src/tools/handlers/featureFlags.js +1 -1
  261. package/src/tools/handlers/flows.js +3 -3
  262. package/src/tools/handlers/hideChrome.js +9 -0
  263. package/src/tools/handlers/paletteTheme.js +35 -0
  264. package/src/tools/handlers/theme.js +1 -1
  265. package/src/tools/registry.js +4 -1
  266. package/src/tools/surfaces/commandList.js +3 -3
  267. package/src/tools/surfaces/mainToolbar.js +3 -3
  268. package/src/tools/surfaces/registry.js +4 -4
  269. package/src/ui/design-modes.ts +2 -2
  270. package/src/ui/viewfinder.ts +1 -1
  271. package/src/vite/server-plugin.js +243 -61
  272. package/src/workshop/features/createCanvas/CreateCanvasForm.jsx +260 -0
  273. package/src/workshop/features/createCanvas/index.js +1 -1
  274. package/src/workshop/features/createFlow/CreateFlowForm.jsx +334 -0
  275. package/src/workshop/features/createFlow/index.js +1 -1
  276. package/src/workshop/features/createPage/CreatePageForm.jsx +304 -0
  277. package/src/workshop/features/createPage/index.js +1 -1
  278. package/src/workshop/features/createPrototype/CreatePrototypeForm.jsx +289 -0
  279. package/src/workshop/features/createPrototype/index.js +1 -1
  280. package/src/workshop/features/createPrototype/server.js +98 -0
  281. package/src/workshop/features/createStory/CreateStoryForm.jsx +208 -0
  282. package/src/workshop/features/createStory/index.js +1 -1
  283. package/src/workshop/ui/WorkshopPanel.jsx +98 -0
  284. package/src/workshop/ui/mount.ts +1 -1
  285. package/src/worktree/port.js +48 -0
  286. package/src/worktree/serverRegistry.js +120 -0
  287. package/toolbar.config.json +93 -42
  288. package/widgets.config.json +580 -12
  289. package/scaffold/commandpalette.config.json +0 -4
  290. package/scaffold/toolbar.config.json +0 -4
  291. package/src/ActionMenuButton.svelte +0 -119
  292. package/src/AutosyncMenuButton.svelte +0 -397
  293. package/src/CanvasCreateMenu.svelte +0 -295
  294. package/src/CanvasSnap.svelte +0 -87
  295. package/src/CanvasUndoRedo.svelte +0 -108
  296. package/src/CanvasZoomControl.svelte +0 -111
  297. package/src/CanvasZoomToFit.svelte +0 -52
  298. package/src/CommandMenu.svelte +0 -249
  299. package/src/CommandPalette.svelte +0 -33
  300. package/src/CommentsMenuButton.svelte +0 -53
  301. package/src/CoreUIBar.svelte +0 -847
  302. package/src/CreateMenuButton.svelte +0 -133
  303. package/src/DocPanel.svelte +0 -299
  304. package/src/InspectorPanel.svelte +0 -745
  305. package/src/PwaInstallBanner.svelte +0 -124
  306. package/src/SidePanel.svelte +0 -480
  307. package/src/ThemeMenuButton.svelte +0 -132
  308. package/src/comments/ui/AuthModal.svelte +0 -108
  309. package/src/comments/ui/CommentWindow.svelte +0 -333
  310. package/src/comments/ui/CommentsDrawer.svelte +0 -96
  311. package/src/comments/ui/Composer.svelte +0 -65
  312. package/src/lib/components/ui/alert/alert-action.svelte +0 -19
  313. package/src/lib/components/ui/alert/alert-description.svelte +0 -22
  314. package/src/lib/components/ui/alert/alert-title.svelte +0 -22
  315. package/src/lib/components/ui/alert/alert.svelte +0 -38
  316. package/src/lib/components/ui/avatar/avatar-badge.svelte +0 -25
  317. package/src/lib/components/ui/avatar/avatar-fallback.svelte +0 -20
  318. package/src/lib/components/ui/avatar/avatar-group-count.svelte +0 -22
  319. package/src/lib/components/ui/avatar/avatar-group.svelte +0 -22
  320. package/src/lib/components/ui/avatar/avatar-image.svelte +0 -17
  321. package/src/lib/components/ui/avatar/avatar.svelte +0 -24
  322. package/src/lib/components/ui/badge/badge.svelte +0 -44
  323. package/src/lib/components/ui/button/button.svelte +0 -108
  324. package/src/lib/components/ui/card/card-action.svelte +0 -21
  325. package/src/lib/components/ui/card/card-content.svelte +0 -19
  326. package/src/lib/components/ui/card/card-description.svelte +0 -19
  327. package/src/lib/components/ui/card/card-footer.svelte +0 -18
  328. package/src/lib/components/ui/card/card-header.svelte +0 -21
  329. package/src/lib/components/ui/card/card-title.svelte +0 -14
  330. package/src/lib/components/ui/card/card.svelte +0 -21
  331. package/src/lib/components/ui/checkbox/checkbox.svelte +0 -39
  332. package/src/lib/components/ui/collapsible/collapsible-content.svelte +0 -7
  333. package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +0 -7
  334. package/src/lib/components/ui/collapsible/collapsible.svelte +0 -11
  335. package/src/lib/components/ui/dialog/dialog-close.svelte +0 -11
  336. package/src/lib/components/ui/dialog/dialog-content.svelte +0 -42
  337. package/src/lib/components/ui/dialog/dialog-description.svelte +0 -17
  338. package/src/lib/components/ui/dialog/dialog-footer.svelte +0 -29
  339. package/src/lib/components/ui/dialog/dialog-header.svelte +0 -19
  340. package/src/lib/components/ui/dialog/dialog-overlay.svelte +0 -17
  341. package/src/lib/components/ui/dialog/dialog-portal.svelte +0 -7
  342. package/src/lib/components/ui/dialog/dialog-title.svelte +0 -17
  343. package/src/lib/components/ui/dialog/dialog-trigger.svelte +0 -11
  344. package/src/lib/components/ui/dialog/dialog.svelte +0 -7
  345. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +0 -16
  346. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -40
  347. package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +0 -27
  348. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -18
  349. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +0 -7
  350. package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +0 -24
  351. package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +0 -20
  352. package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.svelte +0 -7
  353. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +0 -16
  354. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +0 -34
  355. package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +0 -17
  356. package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +0 -19
  357. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +0 -17
  358. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +0 -27
  359. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.svelte +0 -7
  360. package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +0 -7
  361. package/src/lib/components/ui/dropdown-menu/dropdown-menu.svelte +0 -7
  362. package/src/lib/components/ui/input/input.svelte +0 -40
  363. package/src/lib/components/ui/label/label.svelte +0 -20
  364. package/src/lib/components/ui/panel/panel-body.svelte +0 -13
  365. package/src/lib/components/ui/panel/panel-close.svelte +0 -16
  366. package/src/lib/components/ui/panel/panel-content.svelte +0 -33
  367. package/src/lib/components/ui/panel/panel-footer.svelte +0 -13
  368. package/src/lib/components/ui/panel/panel-header.svelte +0 -16
  369. package/src/lib/components/ui/panel/panel-title.svelte +0 -14
  370. package/src/lib/components/ui/panel/panel.svelte +0 -15
  371. package/src/lib/components/ui/popover/popover-close.svelte +0 -7
  372. package/src/lib/components/ui/popover/popover-content.svelte +0 -27
  373. package/src/lib/components/ui/popover/popover-description.svelte +0 -19
  374. package/src/lib/components/ui/popover/popover-header.svelte +0 -19
  375. package/src/lib/components/ui/popover/popover-portal.svelte +0 -7
  376. package/src/lib/components/ui/popover/popover-title.svelte +0 -19
  377. package/src/lib/components/ui/popover/popover-trigger.svelte +0 -17
  378. package/src/lib/components/ui/popover/popover.svelte +0 -7
  379. package/src/lib/components/ui/select/select-content.svelte +0 -40
  380. package/src/lib/components/ui/select/select-group-heading.svelte +0 -19
  381. package/src/lib/components/ui/select/select-group.svelte +0 -17
  382. package/src/lib/components/ui/select/select-item.svelte +0 -38
  383. package/src/lib/components/ui/select/select-label.svelte +0 -18
  384. package/src/lib/components/ui/select/select-portal.svelte +0 -7
  385. package/src/lib/components/ui/select/select-scroll-down-button.svelte +0 -20
  386. package/src/lib/components/ui/select/select-scroll-up-button.svelte +0 -20
  387. package/src/lib/components/ui/select/select-separator.svelte +0 -17
  388. package/src/lib/components/ui/select/select-trigger.svelte +0 -27
  389. package/src/lib/components/ui/select/select.svelte +0 -11
  390. package/src/lib/components/ui/separator/separator.svelte +0 -23
  391. package/src/lib/components/ui/sheet/sheet-close.svelte +0 -7
  392. package/src/lib/components/ui/sheet/sheet-content.svelte +0 -43
  393. package/src/lib/components/ui/sheet/sheet-description.svelte +0 -17
  394. package/src/lib/components/ui/sheet/sheet-footer.svelte +0 -18
  395. package/src/lib/components/ui/sheet/sheet-header.svelte +0 -19
  396. package/src/lib/components/ui/sheet/sheet-overlay.svelte +0 -17
  397. package/src/lib/components/ui/sheet/sheet-portal.svelte +0 -7
  398. package/src/lib/components/ui/sheet/sheet-title.svelte +0 -17
  399. package/src/lib/components/ui/sheet/sheet-trigger.svelte +0 -7
  400. package/src/lib/components/ui/sheet/sheet.svelte +0 -7
  401. package/src/lib/components/ui/textarea/textarea.svelte +0 -21
  402. package/src/lib/components/ui/toggle/toggle.svelte +0 -45
  403. package/src/lib/components/ui/toggle-group/toggle-group-item.svelte +0 -35
  404. package/src/lib/components/ui/toggle-group/toggle-group.svelte +0 -63
  405. package/src/lib/components/ui/tooltip/tooltip-content.svelte +0 -24
  406. package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +0 -27
  407. package/src/lib/components/ui/tooltip/tooltip.svelte +0 -9
  408. package/src/lib/components/ui/trigger-button/trigger-button.svelte +0 -106
  409. package/src/svelte-plugin-ui/components/Icon.svelte +0 -181
  410. package/src/svelte-plugin-ui/components/ModeSwitch.svelte +0 -121
  411. package/src/svelte-plugin-ui/components/ToolbarShell.svelte +0 -150
  412. package/src/svelte-plugin-ui/components/Viewfinder.svelte +0 -1001
  413. package/src/tools/handlers/docs.js +0 -11
  414. package/src/workshop/features/createCanvas/CreateCanvasForm.svelte +0 -139
  415. package/src/workshop/features/createFlow/CreateFlowForm.svelte +0 -314
  416. package/src/workshop/features/createPage/CreatePageForm.svelte +0 -249
  417. package/src/workshop/features/createPrototype/CreatePrototypeForm.svelte +0 -287
  418. package/src/workshop/features/createStory/CreateStoryForm.svelte +0 -161
  419. package/src/workshop/ui/WorkshopPanel.svelte +0 -97
@@ -24,7 +24,17 @@
24
24
  }
25
25
  },
26
26
  "featureFlags": {},
27
- "canvas": {},
27
+ "canvas": {
28
+ "github": {
29
+ "embedBehavior": "link-preview",
30
+ "ghGuard": "copy"
31
+ },
32
+ "terminal": {
33
+ "resizable": false,
34
+ "defaultWidth": 800,
35
+ "defaultHeight": 450
36
+ }
37
+ },
28
38
  "customerMode": {
29
39
  "enabled": false,
30
40
  "hideChrome": false,
@@ -0,0 +1,103 @@
1
+ import { useState, useEffect, useCallback } from 'react'
2
+ import { TriggerButton } from './lib/components/ui/trigger-button/index.js'
3
+ import * as DropdownMenu from './lib/components/ui/dropdown-menu/index.js'
4
+ import Icon from './svelte-plugin-ui/components/Icon.jsx'
5
+ import { getActionChildren, subscribeToCommandActions } from '@dfosco/storyboard-core'
6
+
7
+ export default function ActionMenuButton({ config = {}, data: _data, localOnly: _localOnly, tabindex = -1 }) {
8
+ void _data
9
+ void _localOnly
10
+ const [menuOpen, setMenuOpen] = useState(false)
11
+ const [_actionsVersion, setActionsVersion] = useState(0)
12
+ void _actionsVersion
13
+
14
+ useEffect(() => {
15
+ const unsub = subscribeToCommandActions(() => { setActionsVersion((v) => v + 1) })
16
+ return unsub
17
+ }, [])
18
+
19
+ const children = config.action ? getActionChildren(config.action) : []
20
+ const hasRadio = children.some((c) => c.type === 'radio')
21
+ const activeValue = children.find((c) => c.type === 'radio' && c.active)?.id || ''
22
+
23
+ const handleOpenChange = useCallback((open) => {
24
+ setMenuOpen(open)
25
+ if (open) setActionsVersion((v) => v + 1)
26
+ }, [])
27
+
28
+ if (children.length === 0) return null
29
+
30
+ return (
31
+ <DropdownMenu.Root open={menuOpen} onOpenChange={handleOpenChange}>
32
+ <DropdownMenu.Trigger>
33
+ <TriggerButton
34
+ active={menuOpen}
35
+ size="icon-xl"
36
+ aria-label={config.ariaLabel || config.label || 'Menu'}
37
+ tabIndex={tabindex}
38
+ >
39
+ <Icon name={config.icon || 'primer/gear'} size={16} {...(config.meta || {})} />
40
+ </TriggerButton>
41
+ </DropdownMenu.Trigger>
42
+
43
+ <DropdownMenu.Content
44
+ side="top"
45
+ align="end"
46
+ sideOffset={16}
47
+ style={config.menuWidth ? { minWidth: config.menuWidth } : undefined}
48
+ className={config.menuWidth ? '' : 'min-w-[200px]'}
49
+ >
50
+ {config.label && <DropdownMenu.Label>{config.label}</DropdownMenu.Label>}
51
+
52
+ {hasRadio ? (
53
+ <DropdownMenu.RadioGroup value={activeValue}>
54
+ {children.map((child) => {
55
+ if (child.type !== 'radio') return null
56
+ return (
57
+ <DropdownMenu.RadioItem
58
+ key={child.id || child.label}
59
+ value={child.id}
60
+ onClick={(e) => {
61
+ if (child.href && (e.metaKey || e.ctrlKey)) {
62
+ e.preventDefault(); window.open(child.href, '_blank'); setMenuOpen(false); return
63
+ }
64
+ if (child.execute) child.execute(); setMenuOpen(false)
65
+ }}
66
+ >
67
+ {child.label}
68
+ </DropdownMenu.RadioItem>
69
+ )
70
+ })}
71
+ </DropdownMenu.RadioGroup>
72
+ ) : (
73
+ children.map((child) => {
74
+ if (child.type === 'toggle') {
75
+ return (
76
+ <DropdownMenu.CheckboxItem
77
+ key={child.id || child.label}
78
+ checked={child.active}
79
+ onSelect={(e) => { e.preventDefault(); if (child.execute) child.execute(); setActionsVersion((v) => v + 1) }}
80
+ >
81
+ {child.label}
82
+ </DropdownMenu.CheckboxItem>
83
+ )
84
+ }
85
+ return (
86
+ <DropdownMenu.Item
87
+ key={child.id || child.label}
88
+ onClick={(e) => {
89
+ if (child.href && (e.metaKey || e.ctrlKey)) {
90
+ e.preventDefault(); window.open(child.href, '_blank'); setMenuOpen(false); return
91
+ }
92
+ if (child.execute) child.execute(); setMenuOpen(false)
93
+ }}
94
+ >
95
+ {child.label}
96
+ </DropdownMenu.Item>
97
+ )
98
+ })
99
+ )}
100
+ </DropdownMenu.Content>
101
+ </DropdownMenu.Root>
102
+ )
103
+ }
@@ -0,0 +1,67 @@
1
+ .menuTitle {
2
+ font-size: 13px;
3
+ font-weight: 500;
4
+ color: var(--fgColor-default, #e6edf3);
5
+ padding: 6px 6px 0;
6
+ margin: 0;
7
+ }
8
+
9
+ .description {
10
+ font-size: 12px;
11
+ color: var(--fgColor-muted, #848d97);
12
+ padding: 0 6px 4px;
13
+ margin: 0;
14
+ line-height: 1.4;
15
+ }
16
+
17
+ .branchRow {
18
+ display: flex;
19
+ flex-direction: column;
20
+ gap: 6px;
21
+ padding: 6px 6px;
22
+ }
23
+
24
+ .branchLabel {
25
+ font-size: 13px;
26
+ font-weight: 500;
27
+ color: var(--fgColor-default, #e6edf3);
28
+ }
29
+
30
+ .statusRow {
31
+ padding: 4px 6px 2px;
32
+ }
33
+
34
+ .scopeHint {
35
+ font-size: 11px;
36
+ color: var(--fgColor-muted, #848d97);
37
+ padding: 4px 0;
38
+ margin: 0;
39
+ }
40
+
41
+ .statusError {
42
+ font-size: 11px;
43
+ color: var(--fgColor-danger, #f85149);
44
+ }
45
+
46
+ .statusOk {
47
+ font-size: 11px;
48
+ color: var(--fgColor-muted, #848d97);
49
+ }
50
+
51
+ .footer {
52
+ display: flex;
53
+ align-items: center;
54
+ gap: 6px;
55
+ font-size: 12px;
56
+ color: var(--fgColor-muted, #848d97);
57
+ padding: 2px 6px 0;
58
+ margin: 0;
59
+ }
60
+
61
+ .footerDot {
62
+ width: 8px;
63
+ height: 8px;
64
+ background: hsl(212, 92%, 45%);
65
+ border-radius: 50%;
66
+ flex-shrink: 0;
67
+ }
@@ -0,0 +1,242 @@
1
+ import './AutosyncMenuButton.css';
2
+ import { useState, useEffect, useRef, useCallback } from 'react'
3
+ import { TriggerButton } from './lib/components/ui/trigger-button/index.js'
4
+ import * as DropdownMenu from './lib/components/ui/dropdown-menu/index.js'
5
+ import Icon from './svelte-plugin-ui/components/Icon.jsx'
6
+ import BranchSelect from './BranchSelect.jsx'
7
+
8
+ export default function AutosyncMenuButton({ config = {}, basePath = '/', tabindex = -1 }) {
9
+ const apiBase = (basePath === '/' ? '' : basePath.replace(/\/$/, '')) + '/_storyboard/autosync'
10
+
11
+ const [menuOpen, setMenuOpen] = useState(false)
12
+ const [branches, setBranches] = useState([])
13
+ const [_currentBranch, setCurrentBranch] = useState('')
14
+ void _currentBranch
15
+ const [selectedBranch, setSelectedBranch] = useState('')
16
+ const [enabledScopes, setEnabledScopes] = useState({ canvas: false, prototype: false })
17
+ const [lastSyncTime, setLastSyncTime] = useState(null)
18
+ const [lastError, setLastError] = useState(null)
19
+ const [lastErrorByScope, setLastErrorByScope] = useState({ canvas: null, prototype: null })
20
+ const [syncing, setSyncing] = useState(false)
21
+ const [syncingScope, setSyncingScope] = useState(null)
22
+ const [loading, setLoading] = useState(false)
23
+
24
+ const pollRef = useRef(null)
25
+ const enabledScopesRef = useRef(enabledScopes)
26
+ enabledScopesRef.current = enabledScopes
27
+
28
+ function isProtectedBranch(name) {
29
+ const normalized = String(name || '').toLowerCase()
30
+ return normalized === 'main' || normalized === 'master'
31
+ }
32
+
33
+ function hasEnabled(scopes) {
34
+ return scopes?.canvas || scopes?.prototype
35
+ }
36
+
37
+ const applyStatus = useCallback((data) => {
38
+ const incomingScopes = data.enabledScopes
39
+ let newScopes
40
+ if (incomingScopes && typeof incomingScopes === 'object') {
41
+ newScopes = { canvas: incomingScopes.canvas === true, prototype: incomingScopes.prototype === true }
42
+ } else {
43
+ newScopes = {
44
+ canvas: data.enabled === true && data.scope === 'canvas',
45
+ prototype: data.enabled === true && data.scope === 'prototype',
46
+ }
47
+ }
48
+ setEnabledScopes(newScopes)
49
+
50
+ if (data.branch) setCurrentBranch(data.branch)
51
+ if (data.targetBranch) setSelectedBranch(data.targetBranch)
52
+ setLastSyncTime(data.lastSyncTime || null)
53
+ setLastError(data.lastError || null)
54
+ setSyncing(data.syncing === true)
55
+ setSyncingScope(
56
+ data.syncingScope === 'prototype' || data.syncingScope === 'canvas' ? data.syncingScope : null,
57
+ )
58
+
59
+ const incomingErrorByScope = data.lastErrorByScope
60
+ if (incomingErrorByScope && typeof incomingErrorByScope === 'object') {
61
+ setLastErrorByScope({ canvas: incomingErrorByScope.canvas || null, prototype: incomingErrorByScope.prototype || null })
62
+ }
63
+ }, [])
64
+
65
+ const fetchStatus = useCallback(async () => {
66
+ try {
67
+ const res = await fetch(`${apiBase}/status`)
68
+ const data = await res.json()
69
+ applyStatus(data)
70
+ } catch { /* ignore */ }
71
+ }, [apiBase, applyStatus])
72
+
73
+ function startPolling() {
74
+ if (pollRef.current) return
75
+ pollRef.current = setInterval(fetchStatus, 5000)
76
+ }
77
+
78
+ function stopPolling() {
79
+ if (pollRef.current) { clearInterval(pollRef.current); pollRef.current = null }
80
+ }
81
+
82
+ async function fetchBranches() {
83
+ try {
84
+ const res = await fetch(`${apiBase}/branches`)
85
+ const data = await res.json()
86
+ const branchList = data.branches || []
87
+ const current = data.current || ''
88
+ setBranches(branchList)
89
+ setCurrentBranch(current)
90
+ setSelectedBranch((prev) => {
91
+ if (!prev || isProtectedBranch(prev) || !branchList.includes(prev)) {
92
+ return branchList.includes(current) ? current : (branchList[0] || '')
93
+ }
94
+ return prev
95
+ })
96
+ } catch { /* ignore */ }
97
+ }
98
+
99
+ async function setAutosyncScope(scope, shouldEnable, e) {
100
+ e.preventDefault()
101
+ setLoading(true)
102
+ setLastError(null)
103
+ try {
104
+ if (shouldEnable && !selectedBranch) {
105
+ setLastError('Select a non-main branch first')
106
+ return
107
+ }
108
+ const res = await fetch(
109
+ shouldEnable ? `${apiBase}/enable` : `${apiBase}/disable`,
110
+ {
111
+ method: 'POST',
112
+ headers: { 'Content-Type': 'application/json' },
113
+ body: JSON.stringify(shouldEnable ? { branch: selectedBranch, scope } : { scope }),
114
+ },
115
+ )
116
+ const data = await res.json()
117
+ if (!res.ok) {
118
+ setLastError(data.error || (shouldEnable ? 'Failed to enable' : 'Failed to disable'))
119
+ } else {
120
+ applyStatus(data)
121
+ }
122
+ } catch (err) {
123
+ setLastError(err.message || 'Request failed')
124
+ } finally {
125
+ setLoading(false)
126
+ }
127
+ }
128
+
129
+ const branchSelectRef = useRef(null)
130
+
131
+ function handleOpenChange(open) {
132
+ setMenuOpen(open)
133
+ if (open) {
134
+ fetchBranches()
135
+ fetchStatus()
136
+ startPolling()
137
+ // Focus the branch selector after the menu mounts
138
+ requestAnimationFrame(() => branchSelectRef.current?.focus())
139
+ } else if (!hasEnabled(enabledScopesRef.current)) {
140
+ stopPolling()
141
+ }
142
+ }
143
+
144
+ // Allow command palette to open this menu via custom event
145
+ useEffect(() => {
146
+ const open = () => handleOpenChange(true)
147
+ document.addEventListener('storyboard:open-autosync', open)
148
+ return () => document.removeEventListener('storyboard:open-autosync', open)
149
+ }, [])
150
+
151
+ function formatSyncTime(iso) {
152
+ if (!iso) return ''
153
+ try {
154
+ return new Date(iso).toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', hour12: true })
155
+ } catch { return iso }
156
+ }
157
+
158
+ useEffect(() => {
159
+ fetchStatus()
160
+ return () => stopPolling()
161
+ }, [fetchStatus])
162
+
163
+ const isScopeEnabled = (target) => enabledScopes[target] === true
164
+ const showStatus = hasEnabled(enabledScopes) || lastError || lastSyncTime || lastErrorByScope.canvas || lastErrorByScope.prototype
165
+
166
+ return (
167
+ <DropdownMenu.Root open={menuOpen} onOpenChange={handleOpenChange}>
168
+ <DropdownMenu.Trigger>
169
+ <TriggerButton
170
+ active={menuOpen || hasEnabled(enabledScopes)}
171
+ size="icon-xl"
172
+ aria-label={config.ariaLabel || 'Autosync'}
173
+ tabIndex={tabindex}
174
+ >
175
+ <Icon name={config.icon || 'primer/sync'} size={16} {...(config.meta || {})} />
176
+ </TriggerButton>
177
+ </DropdownMenu.Trigger>
178
+
179
+ <DropdownMenu.Content
180
+ side="top"
181
+ align="end"
182
+ sideOffset={16}
183
+ style={config.menuWidth ? { minWidth: config.menuWidth } : undefined}
184
+ className="min-w-[280px]"
185
+ >
186
+ <p className="menuTitle">{config.label || 'Autosync'}</p>
187
+ <p className="description">Automatically commit and push changes every 30s</p>
188
+
189
+ <DropdownMenu.Separator />
190
+
191
+ {/* Branch selector */}
192
+ <div className="branchRow">
193
+ <label className="branchLabel" htmlFor="autosync-branch">Branch</label>
194
+ <BranchSelect
195
+ id="autosync-branch"
196
+ ref={branchSelectRef}
197
+ branches={branches}
198
+ value={selectedBranch}
199
+ onChange={(e) => setSelectedBranch(e.target.value)}
200
+ disabled={hasEnabled(enabledScopes) || loading}
201
+ placeholder="No non-main branches available"
202
+ />
203
+ </div>
204
+
205
+ <DropdownMenu.Separator />
206
+
207
+ <DropdownMenu.CheckboxItem
208
+ checked={isScopeEnabled('canvas')}
209
+ onSelect={(e) => setAutosyncScope('canvas', !isScopeEnabled('canvas'), e)}
210
+ disabled={loading || (!isScopeEnabled('canvas') && !selectedBranch)}
211
+ >
212
+ {isScopeEnabled('canvas') ? 'Disable autosync for canvas changes' : 'Enable autosync for canvas changes'}
213
+ </DropdownMenu.CheckboxItem>
214
+ <DropdownMenu.CheckboxItem
215
+ checked={isScopeEnabled('prototype')}
216
+ onSelect={(e) => setAutosyncScope('prototype', !isScopeEnabled('prototype'), e)}
217
+ disabled={loading || (!isScopeEnabled('prototype') && !selectedBranch)}
218
+ >
219
+ {isScopeEnabled('prototype') ? 'Disable autosync for prototype changes' : 'Enable autosync for prototype changes'}
220
+ </DropdownMenu.CheckboxItem>
221
+
222
+ {showStatus && (
223
+ <>
224
+ <DropdownMenu.Separator />
225
+ <div className="statusRow">
226
+ {syncing && syncingScope && (
227
+ <p className="scopeHint">Syncing <strong>{syncingScope}</strong> changes</p>
228
+ )}
229
+ {lastError && <span className="statusError">⚠ {lastError}</span>}
230
+ {lastErrorByScope.canvas && <span className="statusError">⚠ Canvas: {lastErrorByScope.canvas}</span>}
231
+ {lastErrorByScope.prototype && <span className="statusError">⚠ Prototype: {lastErrorByScope.prototype}</span>}
232
+ {!syncing && lastSyncTime && <span className="statusOk">Last sync: {formatSyncTime(lastSyncTime)}</span>}
233
+ </div>
234
+ </>
235
+ )}
236
+
237
+ <DropdownMenu.Separator />
238
+ <p className="footer"><span className="footerDot" />&nbsp;Only available in dev environment</p>
239
+ </DropdownMenu.Content>
240
+ </DropdownMenu.Root>
241
+ )
242
+ }
@@ -0,0 +1,29 @@
1
+ import css from './BranchSelect.module.css'
2
+
3
+ export default function BranchSelect({
4
+ branches = [],
5
+ value,
6
+ onChange,
7
+ disabled,
8
+ id,
9
+ placeholder,
10
+ ref,
11
+ }) {
12
+ return (
13
+ <select
14
+ ref={ref}
15
+ id={id}
16
+ className={css.select}
17
+ value={value}
18
+ onChange={onChange}
19
+ disabled={disabled}
20
+ >
21
+ {branches.length === 0 && (
22
+ <option value="" disabled>{placeholder || 'No branches available'}</option>
23
+ )}
24
+ {branches.map((branch) => (
25
+ <option key={branch} value={branch}>{branch}</option>
26
+ ))}
27
+ </select>
28
+ )
29
+ }
@@ -0,0 +1,30 @@
1
+ .select {
2
+ width: 100%;
3
+ appearance: none;
4
+ background-color: var(--bgColor-default, #0d1117);
5
+ color: var(--fgColor-default, #e6edf3);
6
+ border: 1px solid var(--borderColor-default, #30363d);
7
+ border-radius: 8px;
8
+ padding: 8px 32px 8px 12px;
9
+ font-size: 13px;
10
+ font-family: inherit;
11
+ cursor: pointer;
12
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23848d97'%3E%3Cpath d='M6 8.5L1.5 4h9L6 8.5z'/%3E%3C/svg%3E");
13
+ background-repeat: no-repeat;
14
+ background-position: right 10px center;
15
+ transition: border-color 0.15s ease;
16
+ }
17
+
18
+ .select:hover:not(:disabled) {
19
+ border-color: var(--fgColor-muted, #848d97);
20
+ }
21
+
22
+ .select:focus-visible {
23
+ outline: 2px solid var(--borderColor-accent-emphasis, #1f6feb);
24
+ outline-offset: -1px;
25
+ }
26
+
27
+ .select:disabled {
28
+ opacity: 0.5;
29
+ cursor: not-allowed;
30
+ }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * CanvasAgentsMenu — CoreUIBar dropdown for adding agent widgets to the active canvas.
3
+ * Reads agent definitions from canvas.agents config and dispatches add-widget events.
4
+ * Only visible when a canvas page is active and agents are configured.
5
+ */
6
+ import { useState, useMemo } from 'react'
7
+ import { TriggerButton } from './lib/components/ui/trigger-button/index.js'
8
+ import * as DropdownMenu from './lib/components/ui/dropdown-menu/index.js'
9
+ import Icon from './svelte-plugin-ui/components/Icon.jsx'
10
+ import { getConfig } from '@dfosco/storyboard-core'
11
+
12
+ export default function CanvasAgentsMenu({ config = {}, data: _data, canvasName = '', zoom: _zoom, tabindex }) {
13
+ void _data
14
+ void _zoom
15
+ const [menuOpen, setMenuOpen] = useState(false)
16
+
17
+ const agents = useMemo(() => {
18
+ const canvasConfig = getConfig('canvas')
19
+ const agentsConfig = canvasConfig?.agents
20
+ if (!agentsConfig || typeof agentsConfig !== 'object') return []
21
+ return Object.entries(agentsConfig).map(([id, cfg]) => ({
22
+ id,
23
+ label: cfg.label || id,
24
+ icon: cfg.icon,
25
+ startupCommand: cfg.startupCommand || id,
26
+ defaultWidth: cfg.defaultWidth,
27
+ defaultHeight: cfg.defaultHeight,
28
+ }))
29
+ }, [])
30
+
31
+ function addAgent(agent) {
32
+ document.dispatchEvent(new CustomEvent('storyboard:canvas:add-widget', {
33
+ detail: {
34
+ type: 'agent',
35
+ canvasName,
36
+ props: {
37
+ agentId: agent.id,
38
+ startupCommand: agent.startupCommand,
39
+ ...(agent.defaultWidth ? { width: agent.defaultWidth } : {}),
40
+ ...(agent.defaultHeight ? { height: agent.defaultHeight } : {}),
41
+ },
42
+ }
43
+ }))
44
+ setMenuOpen(false)
45
+ }
46
+
47
+ if (agents.length === 0) return null
48
+
49
+ return (
50
+ <DropdownMenu.Root open={menuOpen} onOpenChange={setMenuOpen}>
51
+ <DropdownMenu.Trigger asChild>
52
+ <TriggerButton
53
+ active={menuOpen}
54
+ size="icon-xl"
55
+ aria-label={config.ariaLabel || 'Add agent'}
56
+ tabIndex={tabindex}
57
+ >
58
+ {config.icon ? (
59
+ <Icon name={config.icon} size={16} {...(config.meta || {})} />
60
+ ) : (
61
+ <Icon name="agents" size={16} />
62
+ )}
63
+ </TriggerButton>
64
+ </DropdownMenu.Trigger>
65
+
66
+ <DropdownMenu.Content
67
+ side="top"
68
+ align="start"
69
+ sideOffset={16}
70
+ className="min-w-[180px]"
71
+ >
72
+ <DropdownMenu.Label>Add agent</DropdownMenu.Label>
73
+ {agents.map((agent) => (
74
+ <DropdownMenu.Item key={agent.id} onClick={() => addAgent(agent)}>
75
+ <span style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
76
+ <Icon name={agent.icon || 'agents'} size={16} />
77
+ {agent.label}
78
+ </span>
79
+ </DropdownMenu.Item>
80
+ ))}
81
+ <DropdownMenu.Separator />
82
+ <div className="px-2 py-1.5 text-xs text-muted-foreground flex flex-row items-baseline">
83
+ <span className="inline-flex w-2 h-2 rounded-full mr-1.5" style={{ background: 'hsl(212, 92%, 45%)' }}></span>
84
+ Only available in dev environment
85
+ </div>
86
+ </DropdownMenu.Content>
87
+ </DropdownMenu.Root>
88
+ )
89
+ }