@1agh/maude 2.0.8 → 2.1.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 (401) hide show
  1. package/README.md +2 -1
  2. package/apps/hub/src/project-transactions/kernel.mjs +13 -7
  3. package/apps/studio/access/closure.ts +86 -10
  4. package/apps/studio/access/filters.ts +18 -1
  5. package/apps/studio/access/request.ts +8 -0
  6. package/apps/studio/acp/design-write-verb.ts +12 -2
  7. package/apps/studio/acp/env.ts +7 -2
  8. package/apps/studio/acp/index.ts +15 -4
  9. package/apps/studio/acp/login-state.ts +22 -5
  10. package/apps/studio/acp/may-scope.ts +38 -1
  11. package/apps/studio/acp/plugin-bootstrap.ts +13 -1
  12. package/apps/studio/acp/probe.ts +11 -4
  13. package/apps/studio/actions/agents.ts +110 -28
  14. package/apps/studio/actions/canvas-keys.ts +4 -2
  15. package/apps/studio/actions/ctx.ts +3 -0
  16. package/apps/studio/actions/defs/annotation.ts +84 -2
  17. package/apps/studio/actions/defs/app.ts +28 -1
  18. package/apps/studio/actions/defs/edit.ts +13 -0
  19. package/apps/studio/actions/defs/export.ts +12 -0
  20. package/apps/studio/actions/defs/sync.ts +18 -0
  21. package/apps/studio/actions/defs/video.ts +9 -0
  22. package/apps/studio/actions/documents.ts +6 -1
  23. package/apps/studio/actions/keymap.gen.ts +147 -9
  24. package/apps/studio/actions/menu.ts +5 -1
  25. package/apps/studio/actions/types.ts +4 -2
  26. package/apps/studio/actions/verbs.ts +9 -0
  27. package/apps/studio/actions.manifest.json +300 -45
  28. package/apps/studio/actions.parity.json +19 -1
  29. package/apps/studio/ai/save-hold.ts +2 -1
  30. package/apps/studio/ai/write-claim-scope.ts +7 -1
  31. package/apps/studio/ai/write-claim.ts +154 -3
  32. package/apps/studio/annotations/ai-read.ts +42 -6
  33. package/apps/studio/annotations/ai-write.ts +145 -2
  34. package/apps/studio/annotations/board-ops.ts +34 -3
  35. package/apps/studio/annotations/checklist-ops.ts +374 -0
  36. package/apps/studio/annotations/elements/checkitem.model.ts +129 -0
  37. package/apps/studio/annotations/elements/sticky.model.ts +54 -2
  38. package/apps/studio/annotations/ops.ts +30 -0
  39. package/apps/studio/annotations/registry.ts +9 -1
  40. package/apps/studio/annotations/templates.ts +4 -2
  41. package/apps/studio/annotations/text-steps.ts +114 -10
  42. package/apps/studio/annotations/ui/checklist-wire.ts +129 -0
  43. package/apps/studio/annotations/ui/checklist.tsx +429 -0
  44. package/apps/studio/annotations/ui/element-node.tsx +48 -2
  45. package/apps/studio/annotations/ui/template-place.ts +11 -1
  46. package/apps/studio/annotations/v1-adapter.ts +22 -3
  47. package/apps/studio/annotations-context-toolbar.tsx +12 -0
  48. package/apps/studio/annotations-layer.tsx +442 -49
  49. package/apps/studio/annotations-model.ts +4 -2
  50. package/apps/studio/api.ts +148 -21
  51. package/apps/studio/artboard-live-gate.tsx +54 -17
  52. package/apps/studio/artboard-still-persist.ts +166 -0
  53. package/apps/studio/artboard-still-raster.ts +6 -2
  54. package/apps/studio/artboard-still.ts +390 -20
  55. package/apps/studio/asset-added.ts +154 -0
  56. package/apps/studio/asset-details.ts +46 -3
  57. package/apps/studio/asset-origins.ts +5 -3
  58. package/apps/studio/asset-trash.ts +6 -1
  59. package/apps/studio/bin/_agent-browser-safe.mjs +3 -4
  60. package/apps/studio/bin/_annotate-post.mjs +14 -5
  61. package/apps/studio/bin/_audio-search.mjs +8 -2
  62. package/apps/studio/bin/_curl-local.mjs +7 -4
  63. package/apps/studio/bin/_desktop-locate.sh +145 -0
  64. package/apps/studio/bin/_ds-check-live.mjs +2 -1
  65. package/apps/studio/bin/_exports.mjs +38 -2
  66. package/apps/studio/bin/_history.mjs +79 -8
  67. package/apps/studio/bin/_import-asset.mjs +14 -9
  68. package/apps/studio/bin/_import-figma.mjs +510 -98
  69. package/apps/studio/bin/_index-cli.mjs +10 -21
  70. package/apps/studio/bin/_ingest-footage.mjs +24 -6
  71. package/apps/studio/bin/_media-probe.mjs +232 -0
  72. package/apps/studio/bin/_perf-probe-open.mjs +6 -0
  73. package/apps/studio/bin/_perf-probe-safari.mjs +6 -0
  74. package/apps/studio/bin/_perf-probe-studio.mjs +6 -1
  75. package/apps/studio/bin/_perf-probe.mjs +8 -3
  76. package/apps/studio/bin/_perf-sweep-shared.mjs +789 -0
  77. package/apps/studio/bin/_perf-sweep.mjs +240 -0
  78. package/apps/studio/bin/_record-shot.sh +33 -8
  79. package/apps/studio/bin/_screenshot-playwright.mjs +45 -2
  80. package/apps/studio/bin/_studio-verb.mjs +8 -3
  81. package/apps/studio/bin/_thumb-route.mjs +21 -0
  82. package/apps/studio/bin/_thumbs-playwright.mjs +83 -1
  83. package/apps/studio/bin/_transcribe.mjs +22 -6
  84. package/apps/studio/bin/_unsynced-refs.mjs +22 -0
  85. package/apps/studio/bin/_url-guard.mjs +120 -5
  86. package/apps/studio/bin/_url-guard.sh +29 -7
  87. package/apps/studio/bin/_video-limits.mjs +104 -0
  88. package/apps/studio/bin/_video-playwright.mjs +119 -19
  89. package/apps/studio/bin/_video-proxy.mjs +130 -0
  90. package/apps/studio/bin/_write-claim.mjs +38 -16
  91. package/apps/studio/bin/annotate.mjs +12 -2
  92. package/apps/studio/bin/canvas-rects.sh +19 -4
  93. package/apps/studio/bin/chat-open.sh +7 -1
  94. package/apps/studio/bin/draw-proof.sh +6 -2
  95. package/apps/studio/bin/generate.sh +32 -10
  96. package/apps/studio/bin/handoff.sh +2 -2
  97. package/apps/studio/bin/perf.sh +96 -15
  98. package/apps/studio/bin/photo-adjust.sh +6 -3
  99. package/apps/studio/bin/photo-bg-remove.sh +2 -2
  100. package/apps/studio/bin/prep.sh +21 -4
  101. package/apps/studio/bin/read-annotations.mjs +3 -0
  102. package/apps/studio/bin/runtime-health.sh +27 -1
  103. package/apps/studio/bin/screenshot.sh +152 -12
  104. package/apps/studio/bin/server-up.sh +64 -6
  105. package/apps/studio/bin/smoke.sh +43 -8
  106. package/apps/studio/bin/to-lottie.sh +3 -2
  107. package/apps/studio/bin/video-proxy.sh +27 -0
  108. package/apps/studio/bin/visual-sanity.sh +3 -1
  109. package/apps/studio/bridge/dgn-protocol.ts +157 -1
  110. package/apps/studio/bridge/mode-shows.ts +8 -6
  111. package/apps/studio/bridge/still-webp.ts +233 -0
  112. package/apps/studio/build.ts +18 -0
  113. package/apps/studio/canvas-build.ts +93 -11
  114. package/apps/studio/canvas-comment-mount.tsx +53 -8
  115. package/apps/studio/canvas-edit.ts +34 -1
  116. package/apps/studio/canvas-lib-module.ts +210 -0
  117. package/apps/studio/canvas-lib.tsx +3 -12
  118. package/apps/studio/canvas-pipeline.ts +111 -5
  119. package/apps/studio/canvas-shell.tsx +8 -11
  120. package/apps/studio/canvas-theme-pill.tsx +5 -3
  121. package/apps/studio/check/index.ts +12 -5
  122. package/apps/studio/check/video.ts +18 -2
  123. package/apps/studio/client/app.jsx +65 -7
  124. package/apps/studio/client/clipboard-relay.ts +193 -16
  125. package/apps/studio/client/comments-overlay.css +18 -0
  126. package/apps/studio/client/export-center.jsx +30 -0
  127. package/apps/studio/client/generate-dialog.jsx +49 -4
  128. package/apps/studio/client/github.js +7 -0
  129. package/apps/studio/client/home/HomeAccountsRow.jsx +221 -0
  130. package/apps/studio/client/home/HomeConnection.jsx +111 -0
  131. package/apps/studio/client/home/home-accounts-model.js +110 -1
  132. package/apps/studio/client/home/home-api.js +9 -2
  133. package/apps/studio/client/home/home-app.jsx +126 -13
  134. package/apps/studio/client/home/home-model.js +69 -1
  135. package/apps/studio/client/home/home-where-model.js +105 -0
  136. package/apps/studio/client/home/home.css +239 -1
  137. package/apps/studio/client/hooks/use-canvas-bridge.jsx +173 -98
  138. package/apps/studio/client/hooks/use-palette-and-panels.jsx +5 -1
  139. package/apps/studio/client/hooks/use-tabs.jsx +11 -4
  140. package/apps/studio/client/panels/DiffView.jsx +7 -1
  141. package/apps/studio/client/panels/TeamProjects.jsx +137 -134
  142. package/apps/studio/client/panels/chat-context.js +2 -0
  143. package/apps/studio/client/panels/slash-commands.gen.js +13 -13
  144. package/apps/studio/client/selection-scope.js +16 -9
  145. package/apps/studio/client/share-link.js +12 -0
  146. package/apps/studio/client/shell/viewport.jsx +11 -1
  147. package/apps/studio/client/shell-events.js +8 -0
  148. package/apps/studio/client/styles/3-kit-maude-v2.css +16 -0
  149. package/apps/studio/client/styles/_index.css +4 -0
  150. package/apps/studio/client/v2/ai/Feed.jsx +1 -1
  151. package/apps/studio/client/v2/ai/OfferCard.jsx +34 -0
  152. package/apps/studio/client/v2/ai/activity-line.js +54 -1
  153. package/apps/studio/client/v2/ai/ai-offer.js +21 -1
  154. package/apps/studio/client/v2/ai/run-model.js +3 -1
  155. package/apps/studio/client/v2/annotations/vote-store.js +28 -4
  156. package/apps/studio/client/v2/assets/asset-drop-session.js +37 -2
  157. package/apps/studio/client/v2/assets/canvas-drop-catcher.jsx +7 -5
  158. package/apps/studio/client/v2/assets/details-model.js +1 -1
  159. package/apps/studio/client/v2/assets/details.jsx +5 -0
  160. package/apps/studio/client/v2/assets/tile-drag.js +11 -7
  161. package/apps/studio/client/v2/comments/comments-panel.jsx +22 -3
  162. package/apps/studio/client/v2/create/duplicate-done.js +6 -2
  163. package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
  164. package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
  165. package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
  166. package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
  167. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +113 -3
  168. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +343 -6
  169. package/apps/studio/client/v2/diagnostics/sync-details/unsynced-refs.js +55 -0
  170. package/apps/studio/client/v2/ds/review.css +1 -1
  171. package/apps/studio/client/v2/export/exports-model.js +7 -0
  172. package/apps/studio/client/v2/export/exports-panel.jsx +1 -0
  173. package/apps/studio/client/v2/export/job-row.jsx +32 -2
  174. package/apps/studio/client/v2/handoff/ready-card.jsx +1 -1
  175. package/apps/studio/client/v2/history/compare-view.jsx +1 -0
  176. package/apps/studio/client/v2/inspector/css-write.js +6 -1
  177. package/apps/studio/client/v2/inspector/frame.jsx +28 -4
  178. package/apps/studio/client/v2/inspector/kinds/clip-model.js +51 -0
  179. package/apps/studio/client/v2/inspector/kinds/clip.jsx +75 -2
  180. package/apps/studio/client/v2/inspector/model.js +21 -0
  181. package/apps/studio/client/v2/inspector/sections/fill.jsx +12 -3
  182. package/apps/studio/client/v2/inspector/sections/recent-colours.js +8 -5
  183. package/apps/studio/client/v2/inspector/view-mode.jsx +11 -1
  184. package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
  185. package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
  186. package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
  187. package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
  188. package/apps/studio/client/v2/link-server/link-server.css +109 -0
  189. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
  190. package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
  191. package/apps/studio/client/v2/preview/link-follow.js +4 -2
  192. package/apps/studio/client/v2/preview/preview-chrome-host.jsx +16 -6
  193. package/apps/studio/client/v2/search/help-model.js +2 -0
  194. package/apps/studio/client/v2/search/search-keywords.js +3 -2
  195. package/apps/studio/client/v2/settings/account.jsx +4 -2
  196. package/apps/studio/client/v2/settings/advanced-section.jsx +344 -137
  197. package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
  198. package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
  199. package/apps/studio/client/v2/settings/general-section.jsx +155 -24
  200. package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
  201. package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
  202. package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
  203. package/apps/studio/client/v2/settings/settings-cards.js +220 -0
  204. package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
  205. package/apps/studio/client/v2/settings/settings-model.js +100 -31
  206. package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
  207. package/apps/studio/client/v2/settings/settings.css +374 -64
  208. package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
  209. package/apps/studio/client/v2/settings/this-project-model.js +172 -0
  210. package/apps/studio/client/v2/settings/use-connections.js +3 -2
  211. package/apps/studio/client/v2/settings/use-open-card.js +37 -0
  212. package/apps/studio/client/v2/share/share-sheet.jsx +28 -11
  213. package/apps/studio/client/v2/shell/api-session-boot.js +6 -0
  214. package/apps/studio/client/v2/shell/api-session.js +126 -0
  215. package/apps/studio/client/v2/shell/connection-state.js +197 -0
  216. package/apps/studio/client/v2/shell/floating-panels.css +31 -1
  217. package/apps/studio/client/v2/shell/image-pick.js +61 -8
  218. package/apps/studio/client/v2/shell/menu-aim.js +43 -0
  219. package/apps/studio/client/v2/shell/menu-runner.js +25 -7
  220. package/apps/studio/client/v2/shell/occlusion-insets.js +18 -1
  221. package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
  222. package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
  223. package/apps/studio/client/v2/shell/project-account-model.js +272 -149
  224. package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
  225. package/apps/studio/client/v2/shell/project-account.css +237 -0
  226. package/apps/studio/client/v2/shell/project-pill.jsx +52 -6
  227. package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
  228. package/apps/studio/client/v2/shell/shell-parity.js +3 -2
  229. package/apps/studio/client/v2/shell/shell-parity.json +71 -36
  230. package/apps/studio/client/v2/shell/still-bridge.js +194 -0
  231. package/apps/studio/client/v2/shell/still-store.js +319 -0
  232. package/apps/studio/client/v2/shell/use-account.js +2 -0
  233. package/apps/studio/client/v2/shell/use-tool-panels.js +2 -1
  234. package/apps/studio/client/v2/signin/use-signin.js +1 -1
  235. package/apps/studio/client/v2/timeline/Timeline.jsx +15 -0
  236. package/apps/studio/client/v2/timeline/frame-handle-model.js +142 -0
  237. package/apps/studio/client/v2/timeline/frame-handle.jsx +151 -0
  238. package/apps/studio/clip-ops.ts +126 -8
  239. package/apps/studio/cloud/endpoints.ts +29 -4
  240. package/apps/studio/collab/ai-activity.ts +10 -8
  241. package/apps/studio/collab/awareness-bridge.ts +34 -9
  242. package/apps/studio/collab/index.ts +3 -0
  243. package/apps/studio/collab/registry.ts +41 -10
  244. package/apps/studio/comment-reattach.ts +149 -0
  245. package/apps/studio/comments/mine-stamp.ts +15 -7
  246. package/apps/studio/comments/ops.ts +52 -8
  247. package/apps/studio/comments-overlay.tsx +146 -9
  248. package/apps/studio/dist/client.bundle.js +892 -885
  249. package/apps/studio/dist/comment-mount.js +2 -2
  250. package/apps/studio/dist/styles.css +1 -1
  251. package/apps/studio/dom-selection.ts +87 -18
  252. package/apps/studio/ds/board/directions.css +8 -0
  253. package/apps/studio/ds/board/outline.tsx +16 -0
  254. package/apps/studio/ds/canvas-check.ts +6 -0
  255. package/apps/studio/edit-ops/clip/reframe.ts +19 -3
  256. package/apps/studio/edit-ops/clip-carry.ts +602 -0
  257. package/apps/studio/edit-ops/clipboard.ts +318 -23
  258. package/apps/studio/edit-ops/dispatch.ts +20 -2
  259. package/apps/studio/edit-ops/scope-names.ts +249 -40
  260. package/apps/studio/edit-ops/slot-defaults.ts +3 -0
  261. package/apps/studio/edit-ops/types.ts +6 -0
  262. package/apps/studio/editing/align-bar.tsx +33 -9
  263. package/apps/studio/editing/artboard-actions.ts +5 -0
  264. package/apps/studio/editing/artboard-menu.tsx +6 -2
  265. package/apps/studio/editing/click-to-type.ts +1 -1
  266. package/apps/studio/editing/clip-words.ts +48 -0
  267. package/apps/studio/editing/clipboard.ts +21 -6
  268. package/apps/studio/editing/declared-background.ts +25 -0
  269. package/apps/studio/editing/index.tsx +3 -0
  270. package/apps/studio/editing/object-keys.ts +4 -4
  271. package/apps/studio/editing/object-menu.tsx +13 -3
  272. package/apps/studio/editing/pen/points.tsx +61 -0
  273. package/apps/studio/editing/text-in-place.tsx +11 -0
  274. package/apps/studio/editing/video-frame-handle.tsx +425 -0
  275. package/apps/studio/exporters/capture-prepass.ts +374 -0
  276. package/apps/studio/exporters/degraded.ts +148 -0
  277. package/apps/studio/exporters/hub-render-door.ts +28 -2
  278. package/apps/studio/exporters/index.ts +3 -1
  279. package/apps/studio/exporters/job-budget.ts +93 -0
  280. package/apps/studio/exporters/jobs.ts +215 -28
  281. package/apps/studio/exporters/parity-check.ts +254 -0
  282. package/apps/studio/exporters/remote.ts +209 -15
  283. package/apps/studio/exporters/svg-inline.ts +87 -0
  284. package/apps/studio/exporters/video-render-lib.ts +88 -26
  285. package/apps/studio/exporters/video.ts +29 -6
  286. package/apps/studio/figma/assets.ts +58 -43
  287. package/apps/studio/figma/codegen-fonts.ts +100 -0
  288. package/apps/studio/figma/fig-decode.ts +390 -25
  289. package/apps/studio/figma/fig-kiwi.ts +18 -4
  290. package/apps/studio/figma/fig-vector.ts +59 -3
  291. package/apps/studio/figma/sanitize.ts +2 -0
  292. package/apps/studio/figma/style-map.ts +293 -48
  293. package/apps/studio/figma/to-artboard.ts +455 -69
  294. package/apps/studio/figma/to-strokes.ts +44 -11
  295. package/apps/studio/figma/types.ts +13 -0
  296. package/apps/studio/footage/schema.ts +3 -3
  297. package/apps/studio/generation/adapters/elevenlabs.ts +7 -1
  298. package/apps/studio/generation/adapters/groq.ts +8 -1
  299. package/apps/studio/generation/spend.ts +312 -0
  300. package/apps/studio/generation/types.ts +12 -0
  301. package/apps/studio/handoff/run.ts +1 -1
  302. package/apps/studio/handoff/targets.ts +2 -2
  303. package/apps/studio/handoff/write-scopes.ts +1 -1
  304. package/apps/studio/history/describe-annotations.ts +4 -0
  305. package/apps/studio/home/accounts.ts +30 -11
  306. package/apps/studio/home/cloud.ts +6 -1
  307. package/apps/studio/home/create-local.ts +32 -3
  308. package/apps/studio/home/hub-health.ts +76 -0
  309. package/apps/studio/home/routes.ts +15 -4
  310. package/apps/studio/http.ts +438 -86
  311. package/apps/studio/imported-module-ids.ts +91 -0
  312. package/apps/studio/inspect.ts +2 -0
  313. package/apps/studio/migrate/hub.ts +8 -1
  314. package/apps/studio/notifications.tsx +47 -5
  315. package/apps/studio/paths.ts +10 -1
  316. package/apps/studio/port.ts +3 -2
  317. package/apps/studio/preview/preview-camera.tsx +15 -382
  318. package/apps/studio/readiness.ts +10 -1
  319. package/apps/studio/release-build.ts +51 -0
  320. package/apps/studio/routes/agent.ts +188 -9
  321. package/apps/studio/routes/ai.ts +43 -11
  322. package/apps/studio/routes/annotations.ts +27 -1
  323. package/apps/studio/routes/assets.ts +18 -1
  324. package/apps/studio/routes/canvas-origin.ts +12 -9
  325. package/apps/studio/routes/cloud-move.ts +15 -0
  326. package/apps/studio/routes/edit.ts +3 -0
  327. package/apps/studio/routes/export.ts +51 -0
  328. package/apps/studio/routes/generate.ts +42 -12
  329. package/apps/studio/routes/hub-link-folder.ts +334 -0
  330. package/apps/studio/routes/hub-signin.ts +78 -1
  331. package/apps/studio/routes/index.ts +9 -1
  332. package/apps/studio/routes/shell.ts +217 -5
  333. package/apps/studio/routes/sync.ts +136 -8
  334. package/apps/studio/routes/votes.ts +2 -1
  335. package/apps/studio/schema/annotations.v2.schema.json +143 -1
  336. package/apps/studio/schema/beats.v1.schema.json +1 -1
  337. package/apps/studio/schema/edl.v1.schema.json +1 -1
  338. package/apps/studio/schema/formats.ts +3 -3
  339. package/apps/studio/schema/transcript.v1.schema.json +1 -1
  340. package/apps/studio/server.ts +142 -43
  341. package/apps/studio/shell/api-key.ts +503 -0
  342. package/apps/studio/shell/attest.ts +59 -0
  343. package/apps/studio/shell/capture-url.ts +20 -0
  344. package/apps/studio/shell/cli-yield.ts +276 -0
  345. package/apps/studio/shell/clip-transfer.ts +302 -0
  346. package/apps/studio/shell/key-file.ts +108 -0
  347. package/apps/studio/shell/server-json.ts +75 -0
  348. package/apps/studio/shell/worktree.ts +19 -0
  349. package/apps/studio/spoof-chars.ts +9 -0
  350. package/apps/studio/studio-page-host.ts +1 -1
  351. package/apps/studio/sync/accepted-cold-start.ts +144 -8
  352. package/apps/studio/sync/accepted-link.ts +76 -29
  353. package/apps/studio/sync/action-stage.ts +575 -44
  354. package/apps/studio/sync/adopt-held.ts +85 -0
  355. package/apps/studio/sync/ctl-heal.ts +58 -0
  356. package/apps/studio/sync/file-ledger.ts +38 -4
  357. package/apps/studio/sync/file-membership.ts +16 -1
  358. package/apps/studio/sync/file-plane.ts +289 -22
  359. package/apps/studio/sync/held-deletes.ts +86 -5
  360. package/apps/studio/sync/hub-link.ts +8 -0
  361. package/apps/studio/sync/index.ts +196 -12
  362. package/apps/studio/sync/journal-client.ts +50 -4
  363. package/apps/studio/sync/link-consent.ts +22 -75
  364. package/apps/studio/sync/link-survey.ts +252 -0
  365. package/apps/studio/sync/local-kernel.ts +296 -8
  366. package/apps/studio/sync/projection.ts +22 -3
  367. package/apps/studio/sync/seed-progress.ts +12 -0
  368. package/apps/studio/sync/source-recovery.ts +59 -3
  369. package/apps/studio/sync/status.ts +19 -2
  370. package/apps/studio/sync/unsynced-refs.ts +397 -0
  371. package/apps/studio/sync/writer-registry.ts +20 -0
  372. package/apps/studio/thumbs/service.ts +4 -1
  373. package/apps/studio/tool-palette.tsx +23 -0
  374. package/apps/studio/ui-prefs.ts +40 -0
  375. package/apps/studio/use-agent-presence.tsx +2 -2
  376. package/apps/studio/use-canvas-keys.ts +6 -1
  377. package/apps/studio/video/format-ids.ts +2 -2
  378. package/apps/studio/video/inject.ts +31 -0
  379. package/apps/studio/video/media-risk.ts +58 -0
  380. package/apps/studio/video/object-fit.ts +137 -0
  381. package/apps/studio/video/provider-transcript.ts +141 -0
  382. package/apps/studio/whats-new.json +137 -0
  383. package/apps/studio/workspace-mode.ts +1 -0
  384. package/apps/studio/ws.ts +5 -0
  385. package/cli/commands/design.mjs +119 -8
  386. package/cli/lib/bash-guard.mjs +366 -6
  387. package/cli/lib/confine-read.mjs +1 -0
  388. package/cli/lib/design-help.gen.mjs +3 -2
  389. package/cli/lib/design-hook.mjs +387 -81
  390. package/cli/lib/design-link.mjs +16 -1
  391. package/cli/lib/design-open.mjs +49 -3
  392. package/cli/lib/desktop-locate.mjs +770 -0
  393. package/cli/lib/handoff.mjs +1 -1
  394. package/cli/lib/hook-state.mjs +291 -0
  395. package/cli/lib/pkg-root.mjs +65 -13
  396. package/cli/lib/studio-locate.mjs +59 -16
  397. package/package.json +15 -8
  398. package/plugins/design/templates/_shell.html +13 -0
  399. package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
  400. package/apps/studio/client/v2/shell/account-card-model.js +0 -114
  401. package/apps/studio/client/v2/shell/account-card.jsx +0 -189
@@ -1,10 +1,13 @@
1
1
  // edit-ops/scope-names.ts — P8 C7 (14 ed-ab-menu, clipboard): which names an object READS from the code around it.
2
2
  //
3
3
  // A pasted object that reads `{title}` or `props.items` out of the component it was copied from renders an error
4
- // card where it lands (the name is not there). The clipboard asks two questions of the source text, no more:
5
- // needsOf(source, from, to) the names the range reads that something around it declares (a parameter, a local
6
- // const, a module-level helper, an import) — not names the range declares itself
7
- // scopeAt(source, pos) the names a spot can see: the module's own and every function scope around it
4
+ // card where it lands (the name is not there). The clipboard asks these questions of the source text:
5
+ // freeRefsOf(source, from, to) #122 — every read of a name the range does not declare itself (identifiers, JSX
6
+ // tag roots, TS type references), with its position and where it is declared:
7
+ // `import` / `module` (carried by edit-ops/clip-carry.ts) or `function` / `global`
8
+ // needsOf(source, from, to) the `function` names of those: a parameter, hook state, the component's local
9
+ // const — what a paste elsewhere can not carry
10
+ // scopeAt(source, pos) the names a spot can see: the module's own and every function scope around it
8
11
  // A paste whose `needs` the target cannot see is refused in words, nothing written. Plain-JS AST walk, no scope
9
12
  // analyser: an over-wide `scopeAt` never refuses what would work, only what plainly would not.
10
13
 
@@ -75,29 +78,42 @@ function functionNames(fn: Node, out: Set<string>): void {
75
78
  if (isNode(fn.body)) walk(fn.body);
76
79
  }
77
80
 
78
- /** Names the module itself declares at its top level: imports, functions, classes, var / let / const. */
79
- function moduleNames(program: Node): Set<string> {
80
- const out = new Set<string>();
81
+ /** Where a module-level name comes from: an import, or a declaration of the module itself. */
82
+ type ModuleKind = 'import' | 'module';
83
+
84
+ /** Names the module itself declares at its top level: imports, functions, classes, var / let / const, types. */
85
+ function moduleKinds(program: Node): Map<string, ModuleKind> {
86
+ const out = new Map<string, ModuleKind>();
87
+ const names = new Set<string>();
81
88
  const declare = (d: unknown) => {
82
89
  if (!isNode(d)) return;
83
90
  if (d.type === 'ImportDeclaration') {
84
91
  for (const s of (d.specifiers as unknown[]) ?? [])
85
- if (isNode(s) && isNode(s.local)) out.add(String(s.local.name));
92
+ if (isNode(s) && isNode(s.local)) out.set(String(s.local.name), 'import');
86
93
  } else if (d.type === 'VariableDeclaration') {
87
- for (const v of (d.declarations as unknown[]) ?? []) if (isNode(v)) patternNames(v.id, out);
94
+ for (const v of (d.declarations as unknown[]) ?? []) if (isNode(v)) patternNames(v.id, names);
88
95
  } else if (
89
- (d.type === 'FunctionDeclaration' || d.type === 'ClassDeclaration') &&
96
+ (d.type === 'FunctionDeclaration' ||
97
+ d.type === 'ClassDeclaration' ||
98
+ d.type === 'TSTypeAliasDeclaration' ||
99
+ d.type === 'TSInterfaceDeclaration' ||
100
+ d.type === 'TSEnumDeclaration') &&
90
101
  isNode(d.id)
91
102
  ) {
92
- out.add(String(d.id.name));
103
+ names.add(String(d.id.name));
93
104
  } else if (d.type === 'ExportNamedDeclaration' || d.type === 'ExportDefaultDeclaration') {
94
105
  declare(d.declaration);
95
106
  }
96
107
  };
97
108
  for (const d of (program.body as unknown[]) ?? []) declare(d);
109
+ for (const n of names) if (!out.has(n)) out.set(n, 'module');
98
110
  return out;
99
111
  }
100
112
 
113
+ function moduleNames(program: Node): Set<string> {
114
+ return new Set(moduleKinds(program).keys());
115
+ }
116
+
101
117
  /** The names a spot can see: the module's and those of every function around `pos`. Null when the text does not parse. */
102
118
  export function scopeAt(source: string, pos: number): Set<string> | null {
103
119
  const program = parse(source);
@@ -111,41 +127,234 @@ export function scopeAt(source: string, pos: number): Set<string> | null {
111
127
  return out;
112
128
  }
113
129
 
114
- /** Names the range `[from, to)` reads that something around it declares. Null when the text does not parse. */
130
+ /**
131
+ * #122 (122-A) — the names the range `[from, to)` reads that a FUNCTION around it declares (a parameter, hook
132
+ * state, the component's local const): `freeRefsOf`'s `function` names. Module-level names are not needs any
133
+ * more — the clipboard carries them (edit-ops/clip-carry.ts). Null when the text does not parse.
134
+ */
115
135
  export function needsOf(source: string, from: number, to: number): string[] | null {
136
+ const refs = freeRefsOf(source, from, to);
137
+ if (!refs) return null;
138
+ return [...new Set(refs.filter((r) => r.scope === 'function').map((r) => r.name))].sort();
139
+ }
140
+
141
+ /** Where a name a range reads is declared (contract 122 §5.1). */
142
+ export type RefScope = 'import' | 'module' | 'function' | 'global';
143
+
144
+ /** One read of a name the range does not declare itself, at its place in the source. */
145
+ export interface FreeRef {
146
+ name: string;
147
+ start: number;
148
+ end: number;
149
+ /** a JSX tag name (`<Card>`, `</Card>`, the `Icons` of `<Icons.Star>`) */
150
+ jsx: boolean;
151
+ /** an object shorthand (`{ W }`): renaming it writes `W: W2` */
152
+ shorthand: boolean;
153
+ scope: RefScope;
154
+ }
155
+
156
+ /** A parsed module, for asking several ranges of it with one parse. */
157
+ export interface ScopeModule {
158
+ readonly source: string;
159
+ readonly program: unknown;
160
+ }
161
+
162
+ export function scopeModule(source: string): ScopeModule | null {
116
163
  const program = parse(source);
117
- if (!program) return null;
118
- const outer = scopeAt(source, from);
119
- if (!outer) return null;
120
- const own = new Set<string>(); // names the range declares itself (a map callback's parameter, a local const)
121
- const reads = new Set<string>();
122
- const walk = (n: Node, parent: Node | null, key: string) => {
123
- if (n.end <= from || n.start >= to) {
124
- for (const c of kids(n)) if (c.end > from && c.start < to) walk(c, n, '');
164
+ return program ? { source, program } : null;
165
+ }
166
+
167
+ /** The type parameters a generic node declares (`<T>`). */
168
+ function typeParamNames(n: Node, out: Set<string>): void {
169
+ const tp = n.typeParameters;
170
+ if (!isNode(tp)) return;
171
+ for (const p of (tp.params as unknown[]) ?? []) {
172
+ if (!isNode(p)) continue;
173
+ const name = p.name;
174
+ if (isNode(name)) out.add(String(name.name));
175
+ else if (typeof name === 'string') out.add(name);
176
+ }
177
+ }
178
+
179
+ /**
180
+ * What one function declares for its own body, exactly: its parameters and type parameters, its own name when
181
+ * it is an expression, and every declaration inside it outside nested functions (blocks lumped in).
182
+ */
183
+ function ownScopeNames(fn: Node): Set<string> {
184
+ const out = new Set<string>();
185
+ for (const p of (fn.params as unknown[]) ?? []) patternNames(p, out);
186
+ if (fn.type !== 'FunctionDeclaration' && isNode(fn.id)) out.add(String(fn.id.name));
187
+ typeParamNames(fn, out);
188
+ const walk = (n: Node) => {
189
+ if (n.type === 'VariableDeclarator') patternNames(n.id, out);
190
+ if ((n.type === 'FunctionDeclaration' || n.type === 'ClassDeclaration') && isNode(n.id))
191
+ out.add(String(n.id.name));
192
+ if (n.type === 'CatchClause') patternNames(n.param, out);
193
+ if (FUNCTIONS.has(n.type)) return; // its own scope
194
+ for (const c of kids(n)) walk(c);
195
+ };
196
+ if (isNode(fn.body)) walk(fn.body);
197
+ return out;
198
+ }
199
+
200
+ /** Nodes whose non-computed `key` is a NAME, never a read. */
201
+ const KEY_NODES = new Set([
202
+ 'Property',
203
+ 'MethodDefinition',
204
+ 'PropertyDefinition',
205
+ 'AccessorProperty',
206
+ 'TSPropertySignature',
207
+ 'TSMethodSignature',
208
+ 'TSAbstractMethodDefinition',
209
+ 'TSAbstractPropertyDefinition',
210
+ 'TSAbstractAccessorProperty',
211
+ ]);
212
+ /** Nodes the walk never enters: they bind or name, they do not read. */
213
+ const SKIP_NODES = new Set([
214
+ 'ImportDeclaration',
215
+ 'ExportSpecifier',
216
+ 'MetaProperty',
217
+ 'TSModuleDeclaration',
218
+ 'TSImportType',
219
+ 'JSXNamespacedName',
220
+ ]);
221
+
222
+ /** A JSX element name's root read: `Card`, the `Icons` of `<Icons.Star>`; null for an intrinsic tag. */
223
+ function jsxRoot(n: unknown): Node | null {
224
+ if (!isNode(n)) return null;
225
+ if (n.type === 'JSXIdentifier') {
226
+ const name = String(n.name);
227
+ return /^[a-z]/.test(name) || name.includes('-') ? null : n;
228
+ }
229
+ if (n.type === 'JSXMemberExpression') {
230
+ let o: unknown = n.object;
231
+ while (isNode(o) && o.type === 'JSXMemberExpression') o = o.object;
232
+ return isNode(o) && o.type === 'JSXIdentifier' ? o : null;
233
+ }
234
+ return null;
235
+ }
236
+
237
+ type Scope = { node: Node; names: Set<string> };
238
+
239
+ /** `freeRefsOf` over an already parsed module. */
240
+ export function freeRefsIn(mod: ScopeModule, from: number, to: number): FreeRef[] {
241
+ const program = mod.program as Node;
242
+ const kinds = moduleKinds(program);
243
+ const out: FreeRef[] = [];
244
+ const chain: Scope[] = [];
245
+ const record = (name: string, at: Node, jsx: boolean, shorthand: boolean) => {
246
+ if (at.start < from || at.end > to) return;
247
+ const ref = { name, start: at.start, end: at.end, jsx, shorthand };
248
+ for (let i = chain.length - 1; i >= 0; i--) {
249
+ const s = chain[i] as Scope;
250
+ if (!s.names.has(name)) continue;
251
+ if (s.node.start >= from && s.node.end <= to) return; // the range declares it itself
252
+ out.push({ ...ref, scope: 'function' });
125
253
  return;
126
254
  }
127
- const inside = n.start >= from && n.end <= to;
128
- if (inside && FUNCTIONS.has(n.type)) functionNames(n, own);
129
- if (inside && n.type === 'VariableDeclarator') patternNames(n.id, own);
130
- if (n.type === 'Identifier') {
131
- const name = String(n.name);
132
- const isProp =
133
- parent &&
134
- ((parent.type === 'MemberExpression' && parent.property === n && !parent.computed) ||
135
- (parent.type === 'Property' &&
136
- parent.key === n &&
137
- !parent.computed &&
138
- !parent.shorthand) ||
139
- (parent.type === 'JSXAttribute' && key === 'name'));
140
- if (!isProp && n.start >= from && n.end <= to) reads.add(name);
141
- }
255
+ out.push({ ...ref, scope: kinds.get(name) ?? 'global' });
256
+ };
257
+ const each = (n: Node, skip?: (k: string) => boolean) => {
142
258
  for (const [k, v] of Object.entries(n)) {
143
- if (k === 'parent') continue;
259
+ if (k === 'parent' || skip?.(k)) continue;
144
260
  if (Array.isArray(v)) {
145
- for (const c of v) if (isNode(c)) walk(c, n, k);
146
- } else if (isNode(v)) walk(v, n, k);
261
+ for (const c of v) if (isNode(c)) walk(c);
262
+ } else if (isNode(v)) walk(v);
147
263
  }
148
264
  };
149
- walk(program, null, '');
150
- return [...reads].filter((r) => outer.has(r) && !own.has(r)).sort();
265
+ const walk = (n: Node, shorthand = false): void => {
266
+ if (n.end <= from || n.start >= to || SKIP_NODES.has(n.type)) return;
267
+ let scope: Scope | null = null;
268
+ if (FUNCTIONS.has(n.type)) scope = { node: n, names: ownScopeNames(n) };
269
+ else if (isNode(n.typeParameters) && n.typeParameters.type === 'TSTypeParameterDeclaration') {
270
+ scope = { node: n, names: new Set() };
271
+ typeParamNames(n, scope.names);
272
+ }
273
+ if (scope) chain.push(scope);
274
+ try {
275
+ visit(n, shorthand);
276
+ } finally {
277
+ if (scope) chain.pop();
278
+ }
279
+ };
280
+ const visit = (n: Node, shorthand: boolean): void => {
281
+ const sub = (v: unknown) => {
282
+ if (isNode(v)) walk(v);
283
+ };
284
+ switch (n.type) {
285
+ case 'Identifier':
286
+ record(String(n.name), n, false, shorthand);
287
+ sub(n.typeAnnotation);
288
+ return;
289
+ case 'MemberExpression':
290
+ sub(n.object);
291
+ if (n.computed) sub(n.property);
292
+ return;
293
+ case 'LabeledStatement':
294
+ sub(n.body);
295
+ return;
296
+ case 'BreakStatement':
297
+ case 'ContinueStatement':
298
+ return;
299
+ case 'TSQualifiedName':
300
+ sub(n.left);
301
+ return;
302
+ case 'TSTypeParameter':
303
+ sub(n.constraint);
304
+ sub(n.default);
305
+ return;
306
+ case 'TSEnumMember':
307
+ sub(n.initializer);
308
+ return;
309
+ case 'AssignmentPattern':
310
+ if (isNode(n.left)) walk(n.left, shorthand);
311
+ sub(n.right);
312
+ return;
313
+ case 'JSXOpeningElement':
314
+ case 'JSXClosingElement': {
315
+ const root = jsxRoot(n.name);
316
+ if (root) record(String(root.name), root, true, false);
317
+ for (const a of (n.attributes as unknown[]) ?? []) sub(a);
318
+ sub(n.typeArguments);
319
+ return;
320
+ }
321
+ case 'JSXAttribute':
322
+ sub(n.value);
323
+ return;
324
+ default:
325
+ }
326
+ if (n.type === 'Property' && n.shorthand) {
327
+ if (isNode(n.value)) walk(n.value, true);
328
+ return;
329
+ }
330
+ if (KEY_NODES.has(n.type)) each(n, (k) => k === 'key' && !n.computed);
331
+ else each(n);
332
+ };
333
+ walk(program);
334
+ return out;
335
+ }
336
+
337
+ /**
338
+ * #122 (122-A) — every read in `[from, to)` of a name the range does not declare itself, with its position and
339
+ * where it is declared: an `import`, a `module`-level declaration, a `function` around the range, or nothing
340
+ * (`global`). JSX tag roots (`<Card>`, `</Card>`, `<Icons.Star>` → `Icons`) and TS type references count.
341
+ * Null when the text does not parse.
342
+ */
343
+ export function freeRefsOf(source: string, from: number, to: number): FreeRef[] | null {
344
+ const mod = scopeModule(source);
345
+ return mod ? freeRefsIn(mod, from, to) : null;
346
+ }
347
+
348
+ /** #122 — the names the FUNCTIONS around `pos` declare (never the module's): what shadows a module name there. */
349
+ export function functionScopeAt(source: string, pos: number): Set<string> | null {
350
+ const program = parse(source);
351
+ if (!program) return null;
352
+ const out = new Set<string>();
353
+ const around = (n: Node) => {
354
+ if (FUNCTIONS.has(n.type) && n.start <= pos && pos <= n.end)
355
+ for (const name of ownScopeNames(n)) out.add(name);
356
+ for (const c of kids(n)) if (c.start <= pos && pos <= c.end) around(c);
357
+ };
358
+ around(program);
359
+ return out;
151
360
  }
@@ -30,6 +30,9 @@ export const SLOT_DEFAULTS: Readonly<Record<Slot, { token: string; fallback: str
30
30
  gradientEnd: { token: '--bg-0', fallback: '#ffffff' },
31
31
  });
32
32
 
33
+ /** IR-11: with no design system and nothing in Recent, "+" adds this — a neutral mid grey, then opens the picker. */
34
+ export const NEUTRAL_MID_GREY = '#808080';
35
+
33
36
  /** The paint of a slot's default: `{ token: '--bg-3', fallback: '#d4d4d8' }`. */
34
37
  export function slotPaint(slot: Slot): Paint {
35
38
  const d = SLOT_DEFAULTS[slot];
@@ -70,6 +70,12 @@ export interface ResolvedEditOp {
70
70
  ctx?: EditCtx;
71
71
  /** V2-8.9 L1 — whose clipboard a copy / paste uses; absent = the desktop's one person ('', sees all). */
72
72
  clipScope?: ClipScope;
73
+ /**
74
+ * #122 (122-A) — the text of another project file at a designRoot-relative path (the server's own read, never
75
+ * the request's); null = none. Only the clipboard asks, at paths clamped to the design root: what a carried
76
+ * import resolves to, and whether the C4 import rule allows it from the paste's canvas.
77
+ */
78
+ readFile?: (rel: string) => string | null;
73
79
  }
74
80
 
75
81
  /**
@@ -302,6 +302,20 @@ function boxOf(els: Element[]): { l: number; t: number; r: number; b: number } |
302
302
 
303
303
  const GUIDE_MS = 1800;
304
304
 
305
+ // The guide outlives the remount its own write causes: Align writes the file, and the soft reload re-renders the
306
+ // canvas from it a beat later (~100 ms with the shared canvas-lib) — a fresh subtree, whose DOM selects nothing. The
307
+ // guide is held here, beside the module (one shared canvas-lib per page), until its time is up.
308
+ let held: { guide: Guide; until: number } | null = null;
309
+
310
+ /** Hold `guide` for GUIDE_MS from `now`; a remounted bar shows it for the rest of that time. */
311
+ export function holdAlignGuide(guide: Guide, now: number = Date.now()): void {
312
+ held = { guide, until: now + GUIDE_MS };
313
+ }
314
+
315
+ function heldGuide(now: number = Date.now()): { guide: Guide; left: number } | null {
316
+ return held && held.until > now ? { guide: held.guide, left: held.until - now } : null;
317
+ }
318
+
305
319
  /** Do the selected artboards (no element picked inside them) differ in kind? 08 ak-mixed-select draws no bar then. */
306
320
  export function boardsMixKinds(
307
321
  selected: ReadonlyArray<{ id?: unknown; artboardId?: string | null }>,
@@ -325,8 +339,14 @@ export function AlignBar({ readOnly = false }: { readOnly?: boolean }) {
325
339
  return m;
326
340
  }, [readOnly, selected, world]);
327
341
  const bar = useRef<HTMLDivElement | null>(null);
328
- const [guide, setGuide] = useState<Guide | null>(null);
342
+ const [guide, setGuide] = useState<Guide | null>(() => heldGuide()?.guide ?? null);
329
343
  const guideTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
344
+ // a bar remounted by its own write's reload shows the held guide for the rest of its time
345
+ useEffect(() => {
346
+ const h = heldGuide();
347
+ if (!h) return;
348
+ guideTimer.current = setTimeout(() => setGuide(null), h.left);
349
+ }, []);
330
350
  const live = useRef({ selected, world, bus, undo, model });
331
351
  live.current = { selected, world, bus, undo, model };
332
352
 
@@ -375,6 +395,7 @@ export function AlignBar({ readOnly = false }: { readOnly?: boolean }) {
375
395
  }
376
396
  ).then((r) => {
377
397
  if (!r?.ok || !g) return;
398
+ holdAlignGuide(g);
378
399
  setGuide(g);
379
400
  if (guideTimer.current) clearTimeout(guideTimer.current);
380
401
  guideTimer.current = setTimeout(() => setGuide(null), GUIDE_MS);
@@ -461,17 +482,20 @@ export function AlignBar({ readOnly = false }: { readOnly?: boolean }) {
461
482
  return () => frameCaf(raf);
462
483
  }, [kind]);
463
484
 
464
- if (!model) return null;
485
+ // the guide stays for its time when the selection is gone (the reload after the align selects nothing)
486
+ if (!model && !guide) return null;
465
487
  return (
466
488
  <>
467
489
  <style>{CSS_TEXT}</style>
468
- <AlignBarView
469
- model={model}
470
- onAction={run}
471
- onTidy={tidy}
472
- onTidyPreview={previewTidy}
473
- barRef={bar}
474
- />
490
+ {model ? (
491
+ <AlignBarView
492
+ model={model}
493
+ onAction={run}
494
+ onTidy={tidy}
495
+ onTidyPreview={previewTidy}
496
+ barRef={bar}
497
+ />
498
+ ) : null}
475
499
  {guide ? (
476
500
  <div aria-hidden="true" data-testid="edit-align-guide">
477
501
  <span
@@ -248,6 +248,11 @@ export function useArtboardActions(clipboard?: Clipboard): ArtboardActions {
248
248
  // V2-clipboard-objects — the artboard's Copy ⌘C / Paste ⌘V (a paste lands beside this board's row)
249
249
  ...(live.current.clipboard
250
250
  ? {
251
+ cut: (t: ContextTarget) =>
252
+ void live.current.clipboard?.run('artboard.cut', {
253
+ objects: [],
254
+ artboards: idsFor(t.artboardId),
255
+ }),
251
256
  copy: (t: ContextTarget) =>
252
257
  void live.current.clipboard?.run('artboard.copy', {
253
258
  objects: [],
@@ -4,7 +4,7 @@
4
4
  //
5
5
  // Ask AI about “<artboard name>” ⌘/ (`labelOf` names it per click; the static label stays "this artboard")
6
6
  // Duplicate ⌘D · Duplicate at another width ▸ Laptop 1280 · Tablet 834 · Mobile 390 · Custom width… · Rename
7
- // Copy ⌘C · Paste ⌘V (V2-clipboard-objects, editing/clipboard.ts)
7
+ // Cut ⌘X · Copy ⌘C · Paste ⌘V (V2-clipboard-objects, editing/clipboard.ts; #122 added Cut)
8
8
  // Export… ⇧⌘E
9
9
  // Move to trash ⌫
10
10
  //
@@ -44,7 +44,8 @@ export interface ArtboardMenuDeps {
44
44
  customWidth(target: ContextTarget): void;
45
45
  rename(target: ContextTarget): void;
46
46
  resetPosition(target: ContextTarget): void;
47
- /** V2-clipboard-objects — absent: no Copy / Paste rows */
47
+ /** V2-clipboard-objects — absent: no Cut / Copy / Paste rows */
48
+ cut?(target: ContextTarget): void;
48
49
  copy?(target: ContextTarget): void;
49
50
  paste?(target: ContextTarget): void;
50
51
  }
@@ -81,6 +82,9 @@ export function artboardMenuSections(v1: MenuSection[], deps: ArtboardMenuDeps):
81
82
  return it ? [{ ...it, ...over }] : [];
82
83
  };
83
84
  const clip: MenuItem[] = [
85
+ ...(deps.cut
86
+ ? [{ id: 'cut-artboard', label: 'Cut', shortcut: '⌘X', onSelect: deps.cut } as MenuItem]
87
+ : []),
84
88
  ...(deps.copy
85
89
  ? [{ id: 'copy-artboard', label: 'Copy', shortcut: '⌘C', onSelect: deps.copy } as MenuItem]
86
90
  : []),
@@ -196,7 +196,7 @@ export async function insertTextAt(
196
196
  hold.release();
197
197
  doc.dispatchEvent(
198
198
  new CustomEvent(ENTER_TEXT_EDIT_EVENT, {
199
- detail: { el, clientX: at.x, clientY: at.y, selectAll: true, escKeeps: true },
199
+ detail: { el, clientX: at.x, clientY: at.y, selectAll: true },
200
200
  })
201
201
  );
202
202
  typeHeld(doc, el, typed);
@@ -0,0 +1,48 @@
1
+ // editing/clip-words.ts — the words a paste says about what travelled with it (#122, contract
2
+ // 122-cross-canvas-clipboard.md §5.2): "Pasted the artboard · added 2 imports" / "· renamed W to W2".
3
+ // Pure. The server answers `detail.carried = { imports, decls, renamed: [{from, to}] }` (edit-ops/clipboard.ts,
4
+ // slice 122-A); a paste that carried nothing says nothing, as a paste always has. Used by the canvas (a paste it
5
+ // ran itself) and by the shell (a paste the person confirmed on the shell's own toast).
6
+
7
+ import type { ElementRef } from '../edit-ops/types.ts';
8
+
9
+ const MAX_NAMED = 2;
10
+ const count = (n: number, one: string, many: string) => `${n} ${n === 1 ? one : many}`;
11
+ const num = (v: unknown): number => (typeof v === 'number' && Number.isFinite(v) && v > 0 ? v : 0);
12
+ const name = (v: unknown): string => (typeof v === 'string' ? v.slice(0, 60) : '');
13
+
14
+ /** What was pasted, from the refs the paste created: whole artboards, else objects. */
15
+ function pastedWhat(created: readonly ElementRef[] | undefined): string {
16
+ const list = created ?? [];
17
+ const boards = list.length > 0 && list.every((r) => r.artboard === r.element);
18
+ const n = list.length;
19
+ if (boards) return n === 1 ? 'the artboard' : `${n} artboards`;
20
+ return n <= 1 ? 'the object' : `${n} objects`;
21
+ }
22
+
23
+ /** The toast line for a paste that carried imports, declarations or renames; null when it carried none. */
24
+ export function clipWords(result: {
25
+ created?: readonly ElementRef[];
26
+ detail?: unknown;
27
+ }): string | null {
28
+ const carried = (result.detail as { carried?: unknown } | undefined)?.carried;
29
+ if (!carried || typeof carried !== 'object') return null;
30
+ const c = carried as { imports?: unknown; decls?: unknown; renamed?: unknown };
31
+ const imports = num(c.imports);
32
+ const decls = num(c.decls);
33
+ const renamed = (Array.isArray(c.renamed) ? c.renamed : []).flatMap((r) => {
34
+ const from = name((r as { from?: unknown } | null)?.from);
35
+ const to = name((r as { to?: unknown } | null)?.to);
36
+ return from && to ? [`${from} to ${to}`] : [];
37
+ });
38
+ const parts: string[] = [];
39
+ if (imports) parts.push(`added ${count(imports, 'import', 'imports')}`);
40
+ if (decls) parts.push(`added ${count(decls, 'declaration', 'declarations')}`);
41
+ if (renamed.length) {
42
+ const named = renamed.slice(0, MAX_NAMED).join(', ');
43
+ const more = renamed.length - MAX_NAMED;
44
+ parts.push(`renamed ${named}${more > 0 ? ` and ${more} more` : ''}`);
45
+ }
46
+ if (parts.length === 0) return null;
47
+ return `Pasted ${pastedWhat(result.created)} · ${parts.join(' · ')}`;
48
+ }
@@ -5,7 +5,8 @@
5
5
  //
6
6
  // object.copy / artboard.copy a read: nothing is written, nothing goes on the undo stack. The shell
7
7
  // keeps the handle the server answers (client/clipboard-relay.ts).
8
- // object.cut / canvas.paste a write: ONE legacy revert record on THIS canvas's undo stack (the same
8
+ // object.cut / artboard.cut / canvas.paste
9
+ // a write: ONE legacy revert record on THIS canvas's undo stack (the same
9
10
  // `editOpRecord` every edit-op pushes; on an op-log home the kernel
10
11
  // action is the undo and nothing is pushed here).
11
12
  //
@@ -15,10 +16,17 @@
15
16
 
16
17
  import type { EditOpResult, ElementRef } from '../edit-ops/types.ts';
17
18
  import type { CommandRecord } from '../undo-stack.ts';
19
+ import { clipWords } from './clip-words.ts';
18
20
  import { type EditOpAsk, editOpRecord, runEditOp } from './edit-op.ts';
19
21
  import { refusalLine } from './object-ops.ts';
20
22
 
21
- export const CLIP_ACTIONS = ['object.copy', 'object.cut', 'artboard.copy', 'canvas.paste'] as const;
23
+ export const CLIP_ACTIONS = [
24
+ 'object.copy',
25
+ 'object.cut',
26
+ 'artboard.copy',
27
+ 'artboard.cut',
28
+ 'canvas.paste',
29
+ ] as const;
22
30
  export type ClipAction = (typeof CLIP_ACTIONS)[number];
23
31
 
24
32
  export const isClipAction = (id: unknown): id is ClipAction =>
@@ -69,7 +77,8 @@ export function clipActionForEdit(
69
77
  if (id === 'edit.paste') return 'canvas.paste';
70
78
  if (id === 'edit.copy')
71
79
  return ctx.objects.length ? 'object.copy' : ctx.artboards.length ? 'artboard.copy' : null;
72
- if (id === 'edit.cut') return ctx.objects.length ? 'object.cut' : null;
80
+ if (id === 'edit.cut')
81
+ return ctx.objects.length ? 'object.cut' : ctx.artboards.length ? 'artboard.cut' : null;
73
82
  return null;
74
83
  }
75
84
 
@@ -77,6 +86,7 @@ const LABEL: Record<ClipAction, string> = {
77
86
  'object.copy': 'Copy',
78
87
  'artboard.copy': 'Copy',
79
88
  'object.cut': 'Cut',
89
+ 'artboard.cut': 'Cut',
80
90
  'canvas.paste': 'Paste',
81
91
  };
82
92
 
@@ -91,7 +101,7 @@ export async function runClipAction(
91
101
  ? 'artboard.copy'
92
102
  : action;
93
103
  let ask: EditOpAsk;
94
- if (op === 'artboard.copy') {
104
+ if (op === 'artboard.copy' || op === 'artboard.cut') {
95
105
  if (ctx.artboards.length === 0) return null;
96
106
  ask = { op, targets: [], params: { artboards: [...ctx.artboards] } };
97
107
  } else if (op === 'canvas.paste') {
@@ -113,7 +123,7 @@ export async function runClipAction(
113
123
  // still being handled here, and a clipboard write after the await is refused (WebKit, and Chromium in the
114
124
  // cross-origin canvas frame). Without it ⌘V never knew the paste was ours.
115
125
  const early =
116
- op === 'artboard.copy'
126
+ op === 'artboard.copy' || op === 'artboard.cut'
117
127
  ? clipMarker(ctx.artboards.length, 'artboards')
118
128
  : op === 'object.copy' || op === 'object.cut'
119
129
  ? clipMarker(ctx.objects.length, 'objects')
@@ -135,13 +145,18 @@ export async function runClipAction(
135
145
  deps.mark?.(clipMarker(clip.count, clip.kind));
136
146
  // a write (cut, paste) is ONE step on this canvas's undo stack; a copy wrote nothing
137
147
  if (
138
- (op === 'object.cut' || op === 'canvas.paste') &&
148
+ (op === 'object.cut' || op === 'artboard.cut' || op === 'canvas.paste') &&
139
149
  result.actionId === null &&
140
150
  result.writeId
141
151
  ) {
142
152
  const rec = editOpRecord(result.writeId, LABEL[op]);
143
153
  if (rec) deps.record?.(rec);
144
154
  }
155
+ // #122 — a paste that brought imports or declarations with it says so (a plain paste stays quiet)
156
+ if (op === 'canvas.paste') {
157
+ const line = clipWords(result);
158
+ if (line) deps.toast?.(line, 'info');
159
+ }
145
160
  if (op === 'canvas.paste' && result.created?.length) {
146
161
  const boards = result.created.every((r) => r.artboard === r.element);
147
162
  deps.select?.(result.created, boards ? 'artboards' : 'objects');
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @file declared-background.ts
3
+ * @purpose #168 F4: the shape a canvas-reported `background` shorthand (`declared.background`, dom-selection.ts)
4
+ * may have. Pure. The canvas applies it when it reads the value; the shell (css-write.js `declaredOf`)
5
+ * applies it again, because the canvas is untrusted. At most 512 characters, one or more comma-separated
6
+ * layers that are each a colour (hex, keyword or colour function), a `var()` or a gradient; never a
7
+ * `url()`, an image function, or anything that could close the declaration.
8
+ */
9
+
10
+ export const DECLARED_BACKGROUND_MAX = 512;
11
+
12
+ const BG_LAYER =
13
+ '(?:#[0-9a-f]{3,8}|[a-z]+|(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color|color-mix|var|(?:repeating-)?(?:linear|radial|conic)-gradient)\\([^;{}<>\\\\"\'`]*\\))';
14
+ const BG_SHAPE = new RegExp(`^${BG_LAYER}(?:\\s*,\\s*${BG_LAYER})*$`, 'i');
15
+ const BG_REFUSED = /url\s*\(|image\s*\(|image-set|element\s*\(|expression/i;
16
+
17
+ export function declaredBackgroundOk(v: unknown): v is string {
18
+ return (
19
+ typeof v === 'string' &&
20
+ v.length > 0 &&
21
+ v.length <= DECLARED_BACKGROUND_MAX &&
22
+ BG_SHAPE.test(v) &&
23
+ !BG_REFUSED.test(v)
24
+ );
25
+ }
@@ -90,6 +90,7 @@ import { TextInPlace } from './text-in-place.tsx';
90
90
  import { TidyPreview } from './tidy-preview.tsx';
91
91
  import { TokenRuler } from './token-ruler.tsx';
92
92
  import { UndoPreview } from './undo-preview.tsx';
93
+ import { VideoFrameHandle } from './video-frame-handle.tsx';
93
94
 
94
95
  /** Registry ids this layer runs when the shell asks (`dgn:'run-action'`). */
95
96
  export const EDITING_ACTIONS = [
@@ -374,6 +375,8 @@ export function EditingLayer() {
374
375
  {/* S8.14 — photos dragged from Finder onto an artboard: the hint, the import, ONE image.place, selected at once */}
375
376
  <FinderDrop readOnly={ro} />
376
377
  <CropMode readOnly={ro} />
378
+ {/* #128 §5 (T3.6b) — the selected video clip's pan / zoom handle, named by the shell's Timeline */}
379
+ <VideoFrameHandle readOnly={ro} />
377
380
  {/* S2.20 — an Undo history row lights what it would undo */}
378
381
  <UndoPreview />
379
382
  {/* S2.10 — ⌘D, ⌥-drag copy, Duplicate at another width, Custom width…, Rename, Reset position */}