@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
@@ -0,0 +1,429 @@
1
+ /**
2
+ * @file annotations/ui/checklist.tsx — a checklist drawn inside its sticky (#113, contract 113-checklist §5.4–§5.6)
3
+ * @scope apps/studio/annotations/ui/checklist.tsx
4
+ * @purpose The rows under a sticky's title: a 16 px box drawn in SVG (never a font glyph, so exports match), the
5
+ * entry's words (done = a tick and a strike in a quieter ink), the "3/5" chip, "+ Add an item".
6
+ *
7
+ * The layer owns every write and every key: it provides `ChecklistContext` (the entries of each list,
8
+ * whether rows take input, and the gestures — each one op batch, one ⌘Z) and answers the registry keys
9
+ * (`checklist.*`, `useCanvasKeys` under the `checkItemFocused` fact). This file adds NO key handler; it
10
+ * only draws, reports which row has focus (roving tabIndex, one tab stop per list) and turns a click into
11
+ * a gesture.
12
+ *
13
+ * Not interactive (Edit's quiet posture, Present, Can view / Can comment, an export): drawn, inert, no
14
+ * tab stop, no "+ Add an item". The AI's ticks wear the spark (`done.by === 'AI'`). Reduced motion: no
15
+ * tick animation ever (there is none to switch off).
16
+ */
17
+
18
+ import { createContext, useContext, useLayoutEffect, useRef, useState } from 'react';
19
+
20
+ import { progressOf } from '../elements/checkitem.model.ts';
21
+ import type { AnnotationElement } from '../types.ts';
22
+ import { AI_SPARK } from './ai-marks.tsx';
23
+ import { CHECKLIST_ATTR } from './checklist-wire.ts';
24
+ import { contrast, OBJECT_INK, TEXT_FLOOR } from './posture.ts';
25
+ import { UI_FONT } from './text-style.ts';
26
+
27
+ /** An entry being typed in: which one, and where the caret starts (`'end'` by default). */
28
+ export interface CheckEdit {
29
+ id: string;
30
+ caret?: number | 'end';
31
+ }
32
+
33
+ export interface ChecklistApi {
34
+ /** Every list's genuine entries, in order (`itemsByList`). Identity changes only when an entry does. */
35
+ byList: ReadonlyMap<string, readonly AnnotationElement[]>;
36
+ /** Rows take input: Preview, Can edit (posture `drawn`). */
37
+ interactive: boolean;
38
+ /** The entry open for typing, if any. */
39
+ editing: CheckEdit | null;
40
+ /** A row to focus once it is drawn (after a move, a removal, an add). Consumed by `focused`. */
41
+ focusRequest: CheckEdit | null;
42
+ /** The person's own last tick, for the polite live line ("3 of 5 done"). */
43
+ announce: { list: string; text: string } | null;
44
+ toggle: (itemId: string) => void;
45
+ startEdit: (itemId: string, caret?: number | 'end') => void;
46
+ /** An entry's words leave the field (blur / esc): one reword, if they changed. */
47
+ commitText: (itemId: string, text: string) => void;
48
+ /** "+ Add an item": a new empty entry at the end, open for typing. */
49
+ addAtEnd: (listId: string) => void;
50
+ /** A row took focus (the layer selects its sticky so the row's keys have their scope). */
51
+ focused: (itemId: string) => void;
52
+ }
53
+
54
+ export const ChecklistContext = createContext<ChecklistApi | null>(null);
55
+
56
+ /** The entries of a sticky (empty when it is not a checklist or no provider is mounted). */
57
+ export function useChecklistItems(stickyId: string): readonly AnnotationElement[] {
58
+ return useContext(ChecklistContext)?.byList.get(stickyId) ?? EMPTY;
59
+ }
60
+ const EMPTY: readonly AnnotationElement[] = [];
61
+
62
+ /** What an empty entry shows (and is called, for a screen reader: "Empty item"). */
63
+ export const CHECK_PLACEHOLDER = 'To do';
64
+
65
+ /** The ink of a ticked entry on `paper`: the object ink mixed toward the paper, never under 4.5:1 (§5.6). */
66
+ export function doneInk(paper: string): string {
67
+ const m = /^#([0-9a-f]{6})$/i.exec(paper.trim());
68
+ if (!m) return OBJECT_INK;
69
+ const bg = [0, 2, 4].map((i) => Number.parseInt((m[1] as string).slice(i, i + 2), 16));
70
+ const ink = [0, 2, 4].map((i) => Number.parseInt(OBJECT_INK.slice(1 + i, 3 + i), 16));
71
+ for (const k of [0.62, 0.7, 0.78, 0.86]) {
72
+ const mixed = `#${[0, 1, 2]
73
+ .map((i) =>
74
+ Math.round((ink[i] as number) * k + (bg[i] as number) * (1 - k))
75
+ .toString(16)
76
+ .padStart(2, '0')
77
+ )
78
+ .join('')}`;
79
+ if (contrast(mixed, paper) >= TEXT_FLOOR) return mixed;
80
+ }
81
+ return OBJECT_INK;
82
+ }
83
+
84
+ const isDone = (it: AnnotationElement) => it.done !== undefined && it.done !== null;
85
+ const doneByAi = (it: AnnotationElement) =>
86
+ !!it.done && typeof it.done === 'object' && (it.done as { by?: unknown }).by === 'AI';
87
+ const textOf = (it: AnnotationElement) => (typeof it.text === 'string' ? it.text : '');
88
+
89
+ /** "3 of 5 done" — the chip's spoken form. */
90
+ export function progressWords(items: readonly AnnotationElement[]): string {
91
+ const p = progressOf(items);
92
+ return `${p.done} of ${p.total} done`;
93
+ }
94
+
95
+ /** The 16 px box: an outline, filled with a tick when done. SVG so an export draws it the same. */
96
+ function CheckBox({ done, ai, ink }: { done: boolean; ai: boolean; ink: string }) {
97
+ return (
98
+ <svg
99
+ viewBox="0 0 16 16"
100
+ width="16"
101
+ height="16"
102
+ aria-hidden="true"
103
+ focusable="false"
104
+ style={{ flex: '0 0 16px', marginTop: 2 }}
105
+ >
106
+ <rect
107
+ x="1"
108
+ y="1"
109
+ width="14"
110
+ height="14"
111
+ rx="3"
112
+ fill={done ? (ai ? AI_SPARK : ink) : 'none'}
113
+ stroke={ai ? AI_SPARK : ink}
114
+ strokeWidth="1.5"
115
+ />
116
+ {done ? (
117
+ <path
118
+ d="M4.2 8.4 6.8 11l5-5.6"
119
+ fill="none"
120
+ stroke="#fff"
121
+ strokeWidth="1.8"
122
+ strokeLinecap="round"
123
+ strokeLinejoin="round"
124
+ />
125
+ ) : null}
126
+ </svg>
127
+ );
128
+ }
129
+
130
+ export interface ChecklistRowsProps {
131
+ listId: string;
132
+ /** The sticky's title (the group's accessible name). */
133
+ title: string;
134
+ /** The sticky's paper (for the done ink). */
135
+ paper: string;
136
+ fontSize: number;
137
+ /** Keep the rows inert even with a provider (a quiet / read-only / editing sticky). */
138
+ inert?: boolean;
139
+ }
140
+
141
+ /**
142
+ * The entries of one checklist sticky, under its title. One `role="group"` labelled by the title; each row a
143
+ * `role="checkbox"` with `aria-checked` and the entry as its name; one tab stop per list (roving tabIndex).
144
+ */
145
+ export function ChecklistRows({ listId, title, paper, fontSize, inert }: ChecklistRowsProps) {
146
+ const api = useContext(ChecklistContext);
147
+ const items = api?.byList.get(listId) ?? EMPTY;
148
+ const live = !!api?.interactive && !inert;
149
+ const [active, setActive] = useState<string | null>(null);
150
+ const rootRef = useRef<HTMLDivElement | null>(null);
151
+ const editing =
152
+ live && api?.editing && items.some((i) => i.id === api.editing?.id) ? api.editing : null;
153
+ const request = live ? api?.focusRequest : null;
154
+ // A row the layer asked for (after a move / removal / add) takes focus once it is drawn.
155
+ useLayoutEffect(() => {
156
+ if (!request || !items.some((i) => i.id === request.id)) return;
157
+ const root = rootRef.current;
158
+ const sel = `[data-item-id="${request.id.replace(/["\\]/g, '')}"]`;
159
+ const row = root?.querySelector<HTMLElement>(sel);
160
+ if (!row) return;
161
+ setActive(request.id);
162
+ if (editing?.id !== request.id) row.focus({ preventScroll: true });
163
+ }, [request, items, editing]);
164
+ // The open entry's field takes focus with its caret where it was asked.
165
+ useLayoutEffect(() => {
166
+ if (!editing) return;
167
+ const input = rootRef.current?.querySelector<HTMLInputElement>('input[data-an-check-input]');
168
+ if (!input) return;
169
+ input.focus({ preventScroll: true });
170
+ const at =
171
+ editing.caret === undefined || editing.caret === 'end' ? input.value.length : editing.caret;
172
+ try {
173
+ input.setSelectionRange(at, at);
174
+ } catch {
175
+ /* happy-dom / a detached field */
176
+ }
177
+ }, [editing]);
178
+ if (!items.length) return null;
179
+ const ink = OBJECT_INK;
180
+ const quiet = doneInk(paper);
181
+ const tabStop = active && items.some((i) => i.id === active) ? active : (items[0]?.id ?? null);
182
+ const label = title.trim() || 'Checklist';
183
+ return (
184
+ // biome-ignore lint/a11y/useSemanticElements: a <fieldset> draws a border and wants a <legend>; the title above names it
185
+ <div
186
+ ref={rootRef}
187
+ role="group"
188
+ aria-label={label}
189
+ className="dc-annot-checklist"
190
+ data-testid={`checklist-${listId}`}
191
+ {...(live ? { [CHECKLIST_ATTR]: '1' } : {})}
192
+ style={{
193
+ display: 'flex',
194
+ flexDirection: 'column',
195
+ gap: 0,
196
+ marginTop: 4,
197
+ // `.dc-annot-el` takes no pointer (a sticky is hit through its paper); live rows take their own presses
198
+ pointerEvents: live ? 'auto' : undefined,
199
+ }}
200
+ >
201
+ {items.map((it) => {
202
+ const done = isDone(it);
203
+ const words = textOf(it);
204
+ const name = words.trim() ? words : 'Empty item';
205
+ const open = editing?.id === it.id;
206
+ return (
207
+ // biome-ignore lint/a11y/useSemanticElements: a row holds the box AND an editable entry; a native checkbox cannot
208
+ <div
209
+ key={it.id}
210
+ role="checkbox"
211
+ aria-checked={done}
212
+ aria-label={name}
213
+ aria-disabled={live ? undefined : true}
214
+ tabIndex={live ? (it.id === tabStop ? 0 : -1) : undefined}
215
+ data-testid={`checklist-row-${it.id}`}
216
+ data-item-id={it.id}
217
+ data-an-check-row="1"
218
+ {...(done ? { 'data-done': '1' } : {})}
219
+ {...(doneByAi(it) ? { 'data-by': 'ai' } : {})}
220
+ onFocus={
221
+ live
222
+ ? (e) => {
223
+ if (e.target !== e.currentTarget && !open) return;
224
+ setActive(it.id);
225
+ api?.focused(it.id);
226
+ }
227
+ : undefined
228
+ }
229
+ style={{
230
+ display: 'flex',
231
+ alignItems: 'flex-start',
232
+ gap: 8,
233
+ minHeight: 24, // WCAG 2.5.8 — the row is the target, not only the box
234
+ padding: '2px 0',
235
+ boxSizing: 'border-box',
236
+ outlineOffset: 1,
237
+ cursor: live ? 'default' : undefined,
238
+ }}
239
+ >
240
+ {/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: the row is the checkbox; its key is the registry's Space (checklist.toggle) */}
241
+ <span
242
+ data-an-check-box="1"
243
+ onClick={live ? () => api?.toggle(it.id) : undefined}
244
+ style={{
245
+ display: 'grid',
246
+ placeItems: 'start center',
247
+ width: 20,
248
+ minHeight: 20,
249
+ flex: '0 0 20px',
250
+ cursor: live ? 'pointer' : undefined,
251
+ }}
252
+ >
253
+ <CheckBox done={done} ai={doneByAi(it)} ink={ink} />
254
+ </span>
255
+ {open ? (
256
+ <input
257
+ data-an-check-input="1"
258
+ aria-label={`Edit item${words.trim() ? ` “${words}”` : ''}`}
259
+ defaultValue={words}
260
+ maxLength={2000}
261
+ onBlur={(e) => api?.commitText(it.id, e.currentTarget.value.replace(/\n/g, ' '))}
262
+ onKeyDown={(e) => {
263
+ // Esc keeps the typed words (#163 D1) and leaves the field; the row keeps focus.
264
+ if (e.key !== 'Escape') return;
265
+ e.preventDefault();
266
+ e.stopPropagation();
267
+ const row = e.currentTarget.closest<HTMLElement>('[data-an-check-row]');
268
+ e.currentTarget.blur();
269
+ row?.focus({ preventScroll: true });
270
+ }}
271
+ style={{
272
+ flex: '1 1 auto',
273
+ minWidth: 0,
274
+ font: 'inherit',
275
+ fontSize,
276
+ color: 'inherit',
277
+ background: 'transparent',
278
+ border: 0,
279
+ outline: 'none',
280
+ padding: 0,
281
+ margin: 0,
282
+ }}
283
+ />
284
+ ) : (
285
+ // biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: ↵ on the row opens the entry (checklist.edit, the registry)
286
+ <span
287
+ data-an-check-text="1"
288
+ onClick={live ? () => api?.startEdit(it.id, 'end') : undefined}
289
+ style={{
290
+ flex: '1 1 auto',
291
+ minWidth: 0,
292
+ overflowWrap: 'anywhere',
293
+ color: done ? quiet : words.trim() ? ink : quiet,
294
+ textDecoration: done ? 'line-through' : undefined,
295
+ fontStyle: words.trim() ? undefined : 'italic',
296
+ cursor: live ? 'text' : undefined,
297
+ }}
298
+ >
299
+ {words.trim() ? words : CHECK_PLACEHOLDER}
300
+ </span>
301
+ )}
302
+ </div>
303
+ );
304
+ })}
305
+ {live ? (
306
+ <button
307
+ type="button"
308
+ data-testid="checklist-add"
309
+ className="dc-annot-check-add"
310
+ onClick={() => api?.addAtEnd(listId)}
311
+ style={{
312
+ display: 'flex',
313
+ alignItems: 'center',
314
+ gap: 8,
315
+ minHeight: 24,
316
+ padding: '2px 0',
317
+ margin: 0,
318
+ border: 0,
319
+ background: 'transparent',
320
+ color: quiet,
321
+ font: 'inherit',
322
+ fontSize,
323
+ fontWeight: 500,
324
+ textAlign: 'left',
325
+ cursor: 'pointer',
326
+ }}
327
+ >
328
+ <span aria-hidden="true" style={{ width: 20, textAlign: 'center' }}>
329
+ +
330
+ </span>
331
+ Add an item
332
+ </button>
333
+ ) : null}
334
+ </div>
335
+ );
336
+ }
337
+
338
+ /** The footer chip "3/5" beside the author line; it says "3 of 5 done" after the person's own tick. */
339
+ export function ChecklistChip({ listId, paper }: { listId: string; paper: string }) {
340
+ const api = useContext(ChecklistContext);
341
+ const items = api?.byList.get(listId) ?? EMPTY;
342
+ if (!items.length) return null;
343
+ const p = progressOf(items);
344
+ const said = api?.announce?.list === listId ? api.announce.text : '';
345
+ return (
346
+ <span
347
+ className="dc-annot-check-chip"
348
+ data-testid={`checklist-progress-${listId}`}
349
+ title={progressWords(items)}
350
+ style={{
351
+ position: 'absolute',
352
+ right: 10,
353
+ bottom: 4,
354
+ padding: '0 6px',
355
+ borderRadius: 8,
356
+ fontFamily: UI_FONT,
357
+ fontSize: 'var(--type-xs, 11px)',
358
+ fontWeight: 600,
359
+ lineHeight: 1.5,
360
+ color: doneInk(paper),
361
+ backgroundColor: paper,
362
+ fontVariantNumeric: 'tabular-nums',
363
+ pointerEvents: 'none',
364
+ zIndex: 1,
365
+ }}
366
+ >
367
+ <span aria-hidden="true">
368
+ {p.done}/{p.total}
369
+ </span>
370
+ <span
371
+ aria-live="polite"
372
+ style={{
373
+ position: 'absolute',
374
+ width: 1,
375
+ height: 1,
376
+ overflow: 'hidden',
377
+ clip: 'rect(0 0 0 0)',
378
+ whiteSpace: 'nowrap',
379
+ }}
380
+ >
381
+ {said}
382
+ </span>
383
+ </span>
384
+ );
385
+ }
386
+
387
+ /**
388
+ * "+N more": a fade over the bottom of a checklist card whose entries no longer fit (a list past the sticky's
389
+ * growth ceiling, or a card the person made small). Plain text a reader can find; never takes a press. The
390
+ * count comes from the model (`hiddenCheckItems`), the same measure `fitSticky` grows by.
391
+ */
392
+ export function ChecklistMore({
393
+ listId,
394
+ hidden,
395
+ paper,
396
+ }: {
397
+ listId: string;
398
+ hidden: number;
399
+ paper: string;
400
+ }) {
401
+ if (hidden <= 0) return null;
402
+ const hex = /^#[0-9a-f]{6}$/i.test(paper.trim());
403
+ return (
404
+ <span
405
+ data-testid={`checklist-more-${listId}`}
406
+ className="dc-annot-check-more"
407
+ style={{
408
+ position: 'absolute',
409
+ left: 0,
410
+ right: 0,
411
+ bottom: 22, // above the footer row (CHECK_FOOTER_H)
412
+ padding: '14px 10px 0',
413
+ boxSizing: 'border-box',
414
+ textAlign: 'right',
415
+ fontFamily: UI_FONT,
416
+ fontSize: 'var(--type-xs, 11px)',
417
+ fontWeight: 600,
418
+ lineHeight: 1.5,
419
+ color: doneInk(paper),
420
+ // the paper is validated; a value that is not a plain hex gets no gradient, never a url()
421
+ ...(hex ? { backgroundImage: `linear-gradient(to bottom, ${paper}00, ${paper} 70%)` } : {}),
422
+ pointerEvents: 'none',
423
+ zIndex: 1,
424
+ }}
425
+ >
426
+ +{hidden} more
427
+ </span>
428
+ );
429
+ }
@@ -48,7 +48,13 @@ import {
48
48
  useLiveViewport,
49
49
  } from '../../canvas-lib.tsx';
50
50
  import { SECTION_FOLDED_H } from '../constants.ts';
51
- import { authorLine, provenanceLine, relativeTime, tiltOf } from '../elements/sticky.model.ts';
51
+ import {
52
+ authorLine,
53
+ hiddenCheckItems,
54
+ provenanceLine,
55
+ relativeTime,
56
+ tiltOf,
57
+ } from '../elements/sticky.model.ts';
52
58
  import type { AnnotationElement } from '../types.ts';
53
59
  import {
54
60
  AI_SPARK,
@@ -58,6 +64,7 @@ import {
58
64
  sectionTone,
59
65
  stickyPaper,
60
66
  } from './ai-marks.tsx';
67
+ import { ChecklistChip, ChecklistMore, ChecklistRows, useChecklistItems } from './checklist.tsx';
61
68
  import { quietPaper, whoInk } from './posture.ts';
62
69
  import type { ResolvedEnds } from './render-model.ts';
63
70
  import { labelPoint } from './rest-route.ts';
@@ -343,6 +350,7 @@ function StickyView({ el, interactive, edit, quiet, selected, mine, typist }: El
343
350
  : null;
344
351
  const shown = [line, origin, doneLine].filter(Boolean).join(' · ');
345
352
  const pin = useTimePin(el); // S4.16 — the time chip, the fade off range, "Not printed"
353
+ const items = useChecklistItems(el.id); // #113 — a sticky with entries draws as a checklist
346
354
  return (
347
355
  <Node
348
356
  el={el}
@@ -408,6 +416,32 @@ function StickyView({ el, interactive, edit, quiet, selected, mine, typist }: El
408
416
  onDraft={edit.onDraft}
409
417
  />
410
418
  </div>
419
+ ) : items.length ? (
420
+ // #113 — a checklist: the sticky's text is the title, its entries under it (annotations/ui/checklist.tsx)
421
+ <div
422
+ className="dc-annot-checklist-card"
423
+ data-an-checklist-card="1"
424
+ style={{
425
+ ...style,
426
+ position: 'absolute',
427
+ inset: 0,
428
+ overflow: 'hidden',
429
+ display: 'flex',
430
+ flexDirection: 'column',
431
+ boxSizing: 'border-box',
432
+ paddingBottom: 26,
433
+ }}
434
+ >
435
+ {/* the title is the sticky's text slot (the caret-at-click mirror measures `.dc-annot-text`) */}
436
+ {text ? <div className="dc-annot-text">{withListMarkers(text, lst)}</div> : null}
437
+ <ChecklistRows
438
+ listId={el.id}
439
+ title={text}
440
+ paper={fill}
441
+ fontSize={fmt.fontSize}
442
+ inert={!interactive || !!quiet}
443
+ />
444
+ </div>
411
445
  ) : (
412
446
  <div
413
447
  className="dc-annot-text"
@@ -416,6 +450,18 @@ function StickyView({ el, interactive, edit, quiet, selected, mine, typist }: El
416
450
  {withListMarkers(text, lst)}
417
451
  </div>
418
452
  )}
453
+ {items.length && !edit ? (
454
+ <ChecklistMore
455
+ listId={el.id}
456
+ hidden={hiddenCheckItems(
457
+ { w, h, fontSize: fmt.fontSize },
458
+ text,
459
+ items as ReadonlyArray<{ text?: unknown }>
460
+ )}
461
+ paper={fill}
462
+ />
463
+ ) : null}
464
+ {items.length && !edit ? <ChecklistChip listId={el.id} paper={fill} /> : null}
419
465
  {edit ? <EditNotice notice={edit.notice} /> : null}
420
466
  {aiMade && !edit ? <SparkGlyph className="dc-annot-spark" /> : null}
421
467
  {resolved ? (
@@ -449,7 +495,7 @@ function StickyView({ el, interactive, edit, quiet, selected, mine, typist }: El
449
495
  style={{
450
496
  position: 'absolute',
451
497
  left: aiMade ? 28 : 12,
452
- right: 12,
498
+ right: items.length ? 52 : 12,
453
499
  bottom: 5,
454
500
  padding: '0 2px',
455
501
  borderRadius: 3,
@@ -25,6 +25,11 @@ export interface TemplatePlacement {
25
25
  box: Box;
26
26
  /** How many elements the template made (a labelled shape or arrow is two strokes, one element). */
27
27
  count: number;
28
+ /**
29
+ * #113 — records with no stroke form (a checklist's `checkitem` entries): the layer puts them in the SAME
30
+ * batch as the strokes (one ⌘Z), since the stroke view never carries them.
31
+ */
32
+ records: AnnotationElement[];
28
33
  }
29
34
 
30
35
  const PLACEMENT_KEYS = new Set(['op', 'type', 'in', 'near', 'pin', 'pointer', 'to', 'from']);
@@ -92,12 +97,17 @@ export function expandBoard(
92
97
  who && !s.authorName ? { ...s, authorName: who } : s
93
98
  );
94
99
  const parented = new Set(els.filter((e) => e.parent).map((e) => e.id));
95
- const top = els.filter((e) => !parented.has(e.id) && e.type !== 'arrow');
100
+ const drawn = new Set(strokes.map((s) => s.id));
101
+ const records = els.filter((e) => e.type === 'checkitem' && !drawn.has(e.id));
102
+ const top = els.filter(
103
+ (e) => !parented.has(e.id) && e.type !== 'arrow' && e.type !== 'checkitem'
104
+ );
96
105
  return {
97
106
  strokes,
98
107
  selectIds: (top.length ? top : els).map((e) => e.id),
99
108
  box: boxOf(strokes),
100
109
  count: els.length,
110
+ records,
101
111
  };
102
112
  }
103
113
 
@@ -358,10 +358,23 @@ function sameBox(a: Box | null, b: Box | null): boolean {
358
358
  * board so that what the v1 UI can't express survives: parents of unmoved
359
359
  * elements, sibling keys, unknown element types.
360
360
  */
361
+ export interface StrokesToElementsOpts {
362
+ /**
363
+ * #163 (Michal) — only a DRAG adopts: true when this change is the person dragging (r4 #18: a dragged object
364
+ * lands in the section under it). False for every other move (Fan out, align, distribute, the arrow keys): an
365
+ * existing object never JOINS a section by it — it keeps the one it is in while it still sits there, and
366
+ * leaves one it is moved out of. A new element (create, paste) is not a move and keeps today's rule.
367
+ * Absent = true (previews and hit tests read the board as a drag would land it).
368
+ */
369
+ adoptOnMove?: boolean;
370
+ }
371
+
361
372
  export function strokesToElements(
362
373
  strokes: readonly Stroke[],
363
- current: ReadonlyMap<string, AnnotationElement>
374
+ current: ReadonlyMap<string, AnnotationElement>,
375
+ opts: StrokesToElementsOpts = {}
364
376
  ): AnnotationElement[] {
377
+ const adoptOnMove = opts.adoptOnMove !== false;
365
378
  const flat = v1ToV2(strokes, { flat: true }).elements; // world coords, top level
366
379
  const world = new Map(flat.map((e) => [e.id, e]));
367
380
  const curScene = new Scene(current.values());
@@ -411,6 +424,11 @@ export function strokesToElements(
411
424
  parentOf.set(el.id, best && best.a < area(keptBox) ? best.id : kept);
412
425
  continue;
413
426
  }
427
+ // #163 — a move that is not a drag adopts nothing: it keeps its section while it still sits in it
428
+ if (moved && prev && !adoptOnMove) {
429
+ if (kept && keptBox && inside(keptBox, cx, cy)) parentOf.set(el.id, kept);
430
+ continue;
431
+ }
414
432
  if (best) parentOf.set(el.id, best.id);
415
433
  }
416
434
  // Break any cycle the kept parents could form (walk up; drop the parent that closes a loop).
@@ -506,7 +524,8 @@ export function strokesToElements(
506
524
  /** Map form of `strokesToElements` for `diffToOps`. */
507
525
  export function strokesToElementMap(
508
526
  strokes: readonly Stroke[],
509
- current: ReadonlyMap<string, AnnotationElement>
527
+ current: ReadonlyMap<string, AnnotationElement>,
528
+ opts: StrokesToElementsOpts = {}
510
529
  ): Map<string, AnnotationElement> {
511
- return new Map(strokesToElements(strokes, current).map((e) => [e.id, e]));
530
+ return new Map(strokesToElements(strokes, current, opts).map((e) => [e.id, e]));
512
531
  }
@@ -1736,6 +1736,18 @@ export function AnnotationContextToolbar({
1736
1736
  ) : null}
1737
1737
  <div className="dc-annot-ctx-sep" />
1738
1738
  {lockBtn}
1739
+ {soleSticky && store.isChecklist && !store.isChecklist(soleSticky.id) ? (
1740
+ // #113 — its task lines become entries; a sticky with none gets one empty entry
1741
+ <button
1742
+ type="button"
1743
+ className="dc-annot-ctx-ibtn dc-annot-ctx-tbtn"
1744
+ data-testid="annot-ctx-make-checklist"
1745
+ title="Turn into checklist — its ☐ / - [ ] lines become items you can tick"
1746
+ onClick={() => store.runAction?.('annotation.make-checklist')}
1747
+ >
1748
+ Checklist
1749
+ </button>
1750
+ ) : null}
1739
1751
  {soleSticky ? (
1740
1752
  <button
1741
1753
  type="button"