@1agh/maude 1.10.0 → 2.0.0-rc.2

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 (1985) hide show
  1. package/apps/hub/src/project-transactions/baseline.mjs +276 -0
  2. package/apps/hub/src/project-transactions/kernel.mjs +1756 -0
  3. package/apps/hub/src/project-transactions/lanes.mjs +287 -0
  4. package/apps/hub/src/project-transactions/runs-core.mjs +639 -0
  5. package/apps/hub/src/project-transactions/store-core.mjs +831 -0
  6. package/apps/studio/access/closure.ts +1075 -0
  7. package/apps/studio/access/filters.ts +1193 -0
  8. package/apps/studio/access/frame.ts +365 -0
  9. package/apps/studio/access/known-canvases.ts +82 -0
  10. package/apps/studio/access/request.ts +637 -0
  11. package/apps/studio/access/roles.ts +187 -0
  12. package/apps/studio/access/scope.ts +407 -0
  13. package/apps/studio/access/share-map.ts +434 -0
  14. package/apps/studio/acp/adapter-stderr.ts +22 -0
  15. package/apps/studio/acp/agent-path.ts +39 -0
  16. package/apps/studio/acp/ask-queue.ts +238 -0
  17. package/apps/studio/acp/audience.ts +615 -0
  18. package/apps/studio/acp/bootstrap-brief.ts +32 -15
  19. package/apps/studio/acp/bridge.ts +890 -114
  20. package/apps/studio/acp/chat-search.ts +195 -0
  21. package/apps/studio/acp/connected-fact.ts +83 -0
  22. package/apps/studio/acp/design-write-verb.ts +71 -0
  23. package/apps/studio/acp/env.ts +86 -0
  24. package/apps/studio/acp/index.ts +808 -58
  25. package/apps/studio/acp/login-state.ts +15 -1
  26. package/apps/studio/acp/may-scope.ts +771 -0
  27. package/apps/studio/acp/plugin-bootstrap.ts +90 -5
  28. package/apps/studio/acp/probe.ts +18 -4
  29. package/apps/studio/acp/repo-private.ts +73 -0
  30. package/apps/studio/acp/running.ts +50 -5
  31. package/apps/studio/acp/transcript.ts +356 -21
  32. package/apps/studio/acp/write-scope.ts +141 -11
  33. package/apps/studio/actions/agents.ts +2068 -0
  34. package/apps/studio/actions/canvas-keys.ts +41 -0
  35. package/apps/studio/actions/ctx.ts +118 -0
  36. package/apps/studio/actions/defs/_v1.ts +55 -0
  37. package/apps/studio/actions/defs/ai-runs.ts +56 -0
  38. package/apps/studio/actions/defs/annotation.ts +164 -0
  39. package/apps/studio/actions/defs/app.ts +269 -0
  40. package/apps/studio/actions/defs/canvas.ts +281 -0
  41. package/apps/studio/actions/defs/chat.ts +158 -0
  42. package/apps/studio/actions/defs/diagnostics.ts +52 -0
  43. package/apps/studio/actions/defs/ds.ts +139 -0
  44. package/apps/studio/actions/defs/edit.ts +986 -0
  45. package/apps/studio/actions/defs/export.ts +221 -0
  46. package/apps/studio/actions/defs/history.ts +175 -0
  47. package/apps/studio/actions/defs/native.ts +264 -0
  48. package/apps/studio/actions/defs/presence.ts +53 -0
  49. package/apps/studio/actions/defs/search.ts +90 -0
  50. package/apps/studio/actions/defs/sync.ts +47 -0
  51. package/apps/studio/actions/defs/timeline.ts +254 -0
  52. package/apps/studio/actions/defs/tool.ts +152 -0
  53. package/apps/studio/actions/defs/ui.ts +38 -0
  54. package/apps/studio/actions/defs/video.ts +115 -0
  55. package/apps/studio/actions/defs/view.ts +556 -0
  56. package/apps/studio/actions/documents.ts +32 -0
  57. package/apps/studio/actions/forward.ts +48 -0
  58. package/apps/studio/actions/help.ts +115 -0
  59. package/apps/studio/actions/index.ts +51 -0
  60. package/apps/studio/actions/keymap.gen.ts +1170 -0
  61. package/apps/studio/actions/keys.ts +271 -0
  62. package/apps/studio/actions/legacy.ts +250 -0
  63. package/apps/studio/actions/manifest-version.ts +18 -0
  64. package/apps/studio/actions/menu.ts +203 -0
  65. package/apps/studio/actions/native-menu.ts +132 -0
  66. package/apps/studio/actions/resolve.ts +118 -0
  67. package/apps/studio/actions/types.ts +266 -0
  68. package/apps/studio/actions/uniqueness.ts +119 -0
  69. package/apps/studio/actions/verbs.ts +306 -0
  70. package/apps/studio/actions.manifest.json +7826 -0
  71. package/apps/studio/actions.parity.json +268 -0
  72. package/apps/studio/activity.ts +4 -31
  73. package/apps/studio/agent-runs.ts +679 -0
  74. package/apps/studio/ai/attach-grants.ts +497 -0
  75. package/apps/studio/ai/copy-meta.ts +204 -0
  76. package/apps/studio/ai/create-claim.ts +88 -0
  77. package/apps/studio/ai/lease-home.ts +212 -0
  78. package/apps/studio/ai/run-doing.ts +106 -0
  79. package/apps/studio/ai/run-lifecycle.ts +337 -0
  80. package/apps/studio/ai/run-progress.ts +154 -0
  81. package/apps/studio/ai/runs.ts +1232 -0
  82. package/apps/studio/ai/save-hold.ts +565 -0
  83. package/apps/studio/ai/watch-progress.ts +182 -0
  84. package/apps/studio/ai/write-claim-scope.ts +39 -0
  85. package/apps/studio/ai/write-claim.ts +193 -0
  86. package/apps/studio/ai-banner.tsx +8 -14
  87. package/apps/studio/annotations/ai-read.ts +289 -1
  88. package/apps/studio/annotations/ai-write.ts +281 -23
  89. package/apps/studio/annotations/artboard-members.ts +86 -0
  90. package/apps/studio/annotations/board-ops.ts +358 -0
  91. package/apps/studio/annotations/board-schema.ts +81 -0
  92. package/apps/studio/annotations/constants.ts +2 -0
  93. package/apps/studio/annotations/elements/_shared.ts +290 -1
  94. package/apps/studio/annotations/elements/arrow.model.ts +29 -2
  95. package/apps/studio/annotations/elements/ballot.model.ts +110 -0
  96. package/apps/studio/annotations/elements/media.model.ts +11 -1
  97. package/apps/studio/annotations/elements/section.model.ts +3 -1
  98. package/apps/studio/annotations/elements/stamp.model.ts +83 -0
  99. package/apps/studio/annotations/elements/sticky.model.ts +235 -0
  100. package/apps/studio/annotations/elements/vote.model.ts +71 -0
  101. package/apps/studio/annotations/fields.ts +51 -0
  102. package/apps/studio/annotations/figjam-into.ts +119 -0
  103. package/apps/studio/annotations/hosts.ts +231 -0
  104. package/apps/studio/annotations/migrate-v1.ts +21 -2
  105. package/apps/studio/annotations/ops.ts +23 -0
  106. package/apps/studio/annotations/registry.ts +154 -16
  107. package/apps/studio/annotations/route.ts +268 -0
  108. package/apps/studio/annotations/run-tag.ts +150 -0
  109. package/apps/studio/annotations/stamp-kinds.ts +66 -0
  110. package/apps/studio/annotations/templates.ts +154 -0
  111. package/apps/studio/annotations/text-steps.ts +253 -0
  112. package/apps/studio/annotations/time-marks.ts +140 -0
  113. package/apps/studio/annotations/types.ts +22 -0
  114. package/apps/studio/annotations/ui/ai-marks.tsx +64 -0
  115. package/apps/studio/annotations/ui/ai-seen.tsx +117 -0
  116. package/apps/studio/annotations/ui/arrow-bind.ts +347 -0
  117. package/apps/studio/annotations/ui/arrow-cards.tsx +396 -0
  118. package/apps/studio/annotations/ui/arrow-kinds.ts +90 -0
  119. package/apps/studio/annotations/ui/bar-place.ts +18 -0
  120. package/apps/studio/annotations/ui/element-node.tsx +300 -52
  121. package/apps/studio/annotations/ui/host-view.ts +99 -0
  122. package/apps/studio/annotations/ui/locked.tsx +83 -0
  123. package/apps/studio/annotations/ui/lod.tsx +246 -0
  124. package/apps/studio/annotations/ui/placement.tsx +270 -0
  125. package/apps/studio/annotations/ui/pointer-pipeline.ts +10 -0
  126. package/apps/studio/annotations/ui/posture.ts +124 -0
  127. package/apps/studio/annotations/ui/quiet-tip.ts +28 -0
  128. package/apps/studio/annotations/ui/render-model.ts +27 -2
  129. package/apps/studio/annotations/ui/rest-route.ts +152 -0
  130. package/apps/studio/annotations/ui/ride.ts +957 -0
  131. package/apps/studio/annotations/ui/scene.tsx +59 -11
  132. package/apps/studio/annotations/ui/section-fold.ts +95 -0
  133. package/apps/studio/annotations/ui/shell-asks.ts +62 -0
  134. package/apps/studio/annotations/ui/stamps.ts +221 -0
  135. package/apps/studio/annotations/ui/stamps.tsx +272 -0
  136. package/apps/studio/annotations/ui/sticker-drop.ts +147 -0
  137. package/apps/studio/annotations/ui/sticker-preview.ts +41 -0
  138. package/apps/studio/annotations/ui/sticky-resolve.ts +106 -0
  139. package/apps/studio/annotations/ui/template-place.ts +108 -0
  140. package/apps/studio/annotations/ui/text-editor.tsx +6 -4
  141. package/apps/studio/annotations/ui/text-session.ts +63 -1
  142. package/apps/studio/annotations/ui/text-style.ts +11 -3
  143. package/apps/studio/annotations/ui/time-pins.tsx +134 -0
  144. package/apps/studio/annotations/ui/tool-prefs.ts +242 -0
  145. package/apps/studio/annotations/ui/tool-state.ts +211 -0
  146. package/apps/studio/annotations/ui/visibility.ts +76 -0
  147. package/apps/studio/annotations/ui/vote-dots.tsx +283 -0
  148. package/apps/studio/annotations/v1-adapter.ts +88 -5
  149. package/apps/studio/annotations/validate-board.ts +257 -0
  150. package/apps/studio/annotations/vote-guard.ts +48 -0
  151. package/apps/studio/annotations/votes-local.ts +481 -0
  152. package/apps/studio/annotations-bindings.ts +54 -8
  153. package/apps/studio/annotations-context-toolbar.tsx +612 -150
  154. package/apps/studio/annotations-layer.tsx +1768 -674
  155. package/apps/studio/annotations-model.ts +80 -5
  156. package/apps/studio/api.ts +1553 -459
  157. package/apps/studio/artboard-activity-overlay.tsx +530 -3
  158. package/apps/studio/artboard-ai-copies.tsx +187 -0
  159. package/apps/studio/artboard-convert-marks.tsx +142 -0
  160. package/apps/studio/artboard-gap-mark.tsx +177 -0
  161. package/apps/studio/artboard-ghosts-overlay.tsx +106 -0
  162. package/apps/studio/artboard-growth-memory.ts +56 -0
  163. package/apps/studio/artboard-growth-tag.tsx +115 -0
  164. package/apps/studio/artboard-guides-overlay.tsx +86 -26
  165. package/apps/studio/artboard-marquee.tsx +21 -6
  166. package/apps/studio/artboard-new-section.tsx +188 -0
  167. package/apps/studio/artboard-warn-mark.tsx +330 -0
  168. package/apps/studio/asset-details.ts +339 -0
  169. package/apps/studio/asset-generated.ts +99 -0
  170. package/apps/studio/asset-origins.ts +147 -0
  171. package/apps/studio/asset-placeholder.tsx +481 -0
  172. package/apps/studio/asset-rename.ts +171 -0
  173. package/apps/studio/asset-trash.ts +176 -0
  174. package/apps/studio/asset-upload-bars.tsx +167 -0
  175. package/apps/studio/asset-upload.ts +145 -1
  176. package/apps/studio/attribute-artboards.ts +327 -0
  177. package/apps/studio/bin/_ab-headless.sh +35 -0
  178. package/apps/studio/bin/_ab-park.sh +83 -0
  179. package/apps/studio/bin/_agent-browser-safe.mjs +36 -3
  180. package/apps/studio/bin/_annotate-post.mjs +137 -0
  181. package/apps/studio/bin/_assets.mjs +213 -0
  182. package/apps/studio/bin/_brand-colours.mjs +189 -0
  183. package/apps/studio/bin/_brand-fonts.mjs +158 -0
  184. package/apps/studio/bin/_brand-site.mjs +309 -0
  185. package/apps/studio/bin/_canvas-errors.mjs +143 -0
  186. package/apps/studio/bin/_canvas-rects-playwright.mjs +6 -3
  187. package/apps/studio/bin/_canvas-rects-static.mjs +1 -1
  188. package/apps/studio/bin/_check.mjs +122 -0
  189. package/apps/studio/bin/_comments.mjs +274 -0
  190. package/apps/studio/bin/_curl-local.mjs +122 -3
  191. package/apps/studio/bin/_decode-webaudio.mjs +120 -0
  192. package/apps/studio/bin/_describe.mjs +220 -0
  193. package/apps/studio/bin/_ds-check.mjs +26 -0
  194. package/apps/studio/bin/_ds-prove-playwright.mjs +327 -0
  195. package/apps/studio/bin/_ds-upgrade.mjs +14 -0
  196. package/apps/studio/bin/_ds.mjs +82 -0
  197. package/apps/studio/bin/_enumerate-artboards-playwright.mjs +6 -3
  198. package/apps/studio/bin/_exports.mjs +244 -0
  199. package/apps/studio/bin/_fetch-asset.mjs +209 -15
  200. package/apps/studio/bin/_history.mjs +509 -0
  201. package/apps/studio/bin/_html-playwright.mjs +10 -3
  202. package/apps/studio/bin/_import-asset.mjs +446 -15
  203. package/apps/studio/bin/_import-brand.mjs +40 -156
  204. package/apps/studio/bin/_import-figma.mjs +878 -20
  205. package/apps/studio/bin/_import-tokens.mjs +8 -118
  206. package/apps/studio/bin/_index-cli.mjs +126 -0
  207. package/apps/studio/bin/_layout-check.mjs +35 -0
  208. package/apps/studio/bin/_logs.mjs +130 -0
  209. package/apps/studio/bin/_motion-sample-playwright.mjs +6 -3
  210. package/apps/studio/bin/_no-egress.sh +36 -0
  211. package/apps/studio/bin/_pdf-playwright.mjs +9 -3
  212. package/apps/studio/bin/_perf-probe-safari.mjs +327 -37
  213. package/apps/studio/bin/_perf-probe-studio.mjs +259 -0
  214. package/apps/studio/bin/_perf-probe.mjs +35 -1
  215. package/apps/studio/bin/_perf-shared.mjs +377 -12
  216. package/apps/studio/bin/_place.mjs +35 -0
  217. package/apps/studio/bin/_png-playwright.mjs +27 -7
  218. package/apps/studio/bin/_pptx-playwright.mjs +4 -3
  219. package/apps/studio/bin/_pw-launch.mjs +124 -2
  220. package/apps/studio/bin/_record-shot.sh +65 -0
  221. package/apps/studio/bin/_rects-input.mjs +69 -0
  222. package/apps/studio/bin/_reel-place.mjs +160 -0
  223. package/apps/studio/bin/_region.mjs +37 -1
  224. package/apps/studio/bin/_runs.mjs +178 -0
  225. package/apps/studio/bin/_screenshot-playwright.mjs +6 -3
  226. package/apps/studio/bin/_studio-verb.mjs +220 -0
  227. package/apps/studio/bin/_svg-playwright.mjs +4 -3
  228. package/apps/studio/bin/_sync.mjs +179 -0
  229. package/apps/studio/bin/_thumbs-playwright.mjs +704 -0
  230. package/apps/studio/bin/_tile-draw.mjs +74 -0
  231. package/apps/studio/bin/_transcribe-local.mjs +243 -0
  232. package/apps/studio/bin/_transcribe.mjs +48 -56
  233. package/apps/studio/bin/_trash.mjs +287 -0
  234. package/apps/studio/bin/_url-guard.mjs +88 -0
  235. package/apps/studio/bin/_url-guard.sh +16 -0
  236. package/apps/studio/bin/_video-playwright.mjs +9 -3
  237. package/apps/studio/bin/_video-verbs.mjs +403 -0
  238. package/apps/studio/bin/_write-claim.mjs +124 -0
  239. package/apps/studio/bin/annotate.mjs +348 -330
  240. package/apps/studio/bin/assets.sh +28 -0
  241. package/apps/studio/bin/beats.mjs +237 -0
  242. package/apps/studio/bin/beats.sh +24 -0
  243. package/apps/studio/bin/bootstrap-check.sh +2 -1
  244. package/apps/studio/bin/canvas-edit.sh +17 -9
  245. package/apps/studio/bin/canvas-errors.sh +18 -0
  246. package/apps/studio/bin/canvas-rects.sh +14 -0
  247. package/apps/studio/bin/canvas-source.sh +18 -0
  248. package/apps/studio/bin/captions.sh +13 -0
  249. package/apps/studio/bin/chat-open.sh +2 -2
  250. package/apps/studio/bin/check.sh +27 -0
  251. package/apps/studio/bin/comments.sh +20 -0
  252. package/apps/studio/bin/cut-to-beat.sh +13 -0
  253. package/apps/studio/bin/cut-words.sh +13 -0
  254. package/apps/studio/bin/describe.sh +28 -0
  255. package/apps/studio/bin/draw-proof.sh +41 -8
  256. package/apps/studio/bin/ds-check.sh +30 -0
  257. package/apps/studio/bin/ds-upgrade.sh +30 -0
  258. package/apps/studio/bin/ds.sh +29 -0
  259. package/apps/studio/bin/exports.sh +19 -0
  260. package/apps/studio/bin/generate.sh +45 -3
  261. package/apps/studio/bin/handoff.sh +60 -1
  262. package/apps/studio/bin/history.sh +24 -0
  263. package/apps/studio/bin/import-brand.sh +5 -3
  264. package/apps/studio/bin/index.sh +26 -0
  265. package/apps/studio/bin/layout-check.sh +20 -0
  266. package/apps/studio/bin/logs.sh +17 -0
  267. package/apps/studio/bin/perf.sh +93 -3
  268. package/apps/studio/bin/photo-bg-remove.sh +49 -7
  269. package/apps/studio/bin/place.sh +20 -0
  270. package/apps/studio/bin/read-annotations.mjs +52 -1
  271. package/apps/studio/bin/reel-place.sh +15 -0
  272. package/apps/studio/bin/runs.sh +19 -0
  273. package/apps/studio/bin/screenshot.sh +37 -21
  274. package/apps/studio/bin/server-up.sh +50 -13
  275. package/apps/studio/bin/smoke.sh +10 -0
  276. package/apps/studio/bin/sync.sh +18 -0
  277. package/apps/studio/bin/to-lottie.sh +1 -1
  278. package/apps/studio/bin/transcribe-local.sh +27 -0
  279. package/apps/studio/bin/trash.sh +23 -0
  280. package/apps/studio/bin/visual-sanity.sh +1 -0
  281. package/apps/studio/bridge/canvas-mode-store.ts +301 -0
  282. package/apps/studio/bridge/canvas-modes.ts +548 -0
  283. package/apps/studio/bridge/dgn-protocol.ts +2671 -0
  284. package/apps/studio/bridge/esc-ladder.ts +98 -0
  285. package/apps/studio/bridge/link-target.ts +157 -0
  286. package/apps/studio/bridge/mode-shows.ts +167 -0
  287. package/apps/studio/bridge/occlusion.ts +108 -0
  288. package/apps/studio/bridge/paste-data.ts +101 -0
  289. package/apps/studio/build.ts +12 -1
  290. package/apps/studio/bunfig.toml +4 -0
  291. package/apps/studio/canvas-build-sandbox.ts +34 -5
  292. package/apps/studio/canvas-build-worker.ts +23 -1
  293. package/apps/studio/canvas-build.ts +419 -15
  294. package/apps/studio/canvas-comment-mount.tsx +113 -25
  295. package/apps/studio/canvas-create.ts +285 -49
  296. package/apps/studio/canvas-cursors.ts +12 -0
  297. package/apps/studio/canvas-ds-icons.tsx +241 -0
  298. package/apps/studio/canvas-edit.ts +1188 -172
  299. package/apps/studio/canvas-hud-tokens.gen.ts +120 -0
  300. package/apps/studio/canvas-icons.tsx +47 -0
  301. package/apps/studio/canvas-imports.ts +23 -4
  302. package/apps/studio/canvas-lib-inline.ts +57 -3
  303. package/apps/studio/canvas-lib.tsx +1033 -263
  304. package/apps/studio/canvas-list-watch.ts +73 -2
  305. package/apps/studio/canvas-meta.schema.json +11 -0
  306. package/apps/studio/canvas-notifications.tsx +28 -3
  307. package/apps/studio/canvas-pipeline.ts +43 -8
  308. package/apps/studio/canvas-replay-keys.ts +65 -0
  309. package/apps/studio/canvas-rows.ts +116 -0
  310. package/apps/studio/canvas-shell.tsx +784 -698
  311. package/apps/studio/canvas-source/errors.ts +315 -0
  312. package/apps/studio/canvas-source/source-map.ts +69 -0
  313. package/apps/studio/canvas-theme-pill.tsx +164 -0
  314. package/apps/studio/canvas-theme.ts +133 -0
  315. package/apps/studio/canvas-top-level.ts +69 -0
  316. package/apps/studio/check/ids.ts +28 -0
  317. package/apps/studio/check/index.ts +586 -0
  318. package/apps/studio/check/link-resolver.ts +75 -0
  319. package/apps/studio/check/meta.ts +79 -0
  320. package/apps/studio/check/video.ts +352 -0
  321. package/apps/studio/client/actions/shell-key-handlers.js +450 -0
  322. package/apps/studio/client/app.jsx +2918 -1203
  323. package/apps/studio/client/canvas-url.js +241 -5
  324. package/apps/studio/client/clipboard-relay.ts +144 -0
  325. package/apps/studio/client/command-palette-match.js +4 -2
  326. package/apps/studio/client/comments-overlay.css +529 -144
  327. package/apps/studio/client/dialogs/asset-picker.jsx +77 -32
  328. package/apps/studio/client/dialogs/command-palette.jsx +453 -67
  329. package/apps/studio/client/dialogs/export-dialog.jsx +6 -781
  330. package/apps/studio/client/dialogs/help-modal.jsx +31 -2
  331. package/apps/studio/client/dialogs/shortcuts-overlay.jsx +201 -106
  332. package/apps/studio/client/edit-op-relay.ts +77 -0
  333. package/apps/studio/client/embed-view.jsx +25 -5
  334. package/apps/studio/client/export-bridge-scope.js +72 -0
  335. package/apps/studio/client/export-center.jsx +179 -369
  336. package/apps/studio/client/export-lane.js +117 -0
  337. package/apps/studio/client/export-region.ts +25 -0
  338. package/apps/studio/client/file-tree.jsx +4 -4
  339. package/apps/studio/client/fonts/LICENSE-Inter-Tight.txt +93 -0
  340. package/apps/studio/client/fonts/LICENSE-Inter.txt +93 -0
  341. package/apps/studio/client/fonts/LICENSE-JetBrains-Mono.txt +93 -0
  342. package/apps/studio/client/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  343. package/apps/studio/client/fonts/inter-latin-wght-normal.woff2 +0 -0
  344. package/apps/studio/client/fonts/inter-tight-latin-ext-wght-normal.woff2 +0 -0
  345. package/apps/studio/client/fonts/inter-tight-latin-wght-normal.woff2 +0 -0
  346. package/apps/studio/client/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
  347. package/apps/studio/client/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  348. package/apps/studio/client/frame-cap.js +132 -0
  349. package/apps/studio/client/generate-dialog.jsx +38 -36
  350. package/apps/studio/client/github.js +85 -26
  351. package/apps/studio/client/home/HomeAsk.jsx +220 -0
  352. package/apps/studio/client/home/InviteSheet.jsx +150 -0
  353. package/apps/studio/client/home/Shelves.jsx +216 -0
  354. package/apps/studio/client/home/Starters.jsx +42 -0
  355. package/apps/studio/client/home/TargetChip.jsx +152 -0
  356. package/apps/studio/client/home/home-api.js +275 -0
  357. package/apps/studio/client/home/home-app.jsx +1884 -0
  358. package/apps/studio/client/home/home-icons.jsx +143 -0
  359. package/apps/studio/client/home/home-menu.js +43 -0
  360. package/apps/studio/client/home/home-model.js +514 -0
  361. package/apps/studio/client/home/home-starters.js +136 -0
  362. package/apps/studio/client/home/home.css +1681 -0
  363. package/apps/studio/client/home/invite-flow.js +422 -0
  364. package/apps/studio/client/home/shell-mode.js +49 -0
  365. package/apps/studio/client/hooks/annotations-hidden-toast.js +21 -0
  366. package/apps/studio/client/hooks/canvas-origin-probe.js +26 -0
  367. package/apps/studio/client/hooks/edit-scope-query.js +16 -0
  368. package/apps/studio/client/hooks/use-action-keys.jsx +121 -0
  369. package/apps/studio/client/hooks/use-canvas-bridge.jsx +881 -247
  370. package/apps/studio/client/hooks/use-git-actions.jsx +33 -12
  371. package/apps/studio/client/hooks/use-palette-and-panels.jsx +722 -287
  372. package/apps/studio/client/hooks/use-photo-and-timeline.jsx +268 -307
  373. package/apps/studio/client/hooks/use-project-data.jsx +23 -2
  374. package/apps/studio/client/hooks/use-shell-core.jsx +582 -126
  375. package/apps/studio/client/hooks/use-tabs.jsx +268 -126
  376. package/apps/studio/client/index-loader.ts +3 -1
  377. package/apps/studio/client/index.html +0 -3
  378. package/apps/studio/client/inspector/color-picker.jsx +29 -18
  379. package/apps/studio/client/inspector/css-knobs.jsx +765 -436
  380. package/apps/studio/client/inspector/css-vocab.jsx +37 -4
  381. package/apps/studio/client/inspector/ds-tokens.js +127 -15
  382. package/apps/studio/client/inspector/grid-tracks-editor.jsx +21 -15
  383. package/apps/studio/client/inspector/inspect-computed.jsx +17 -15
  384. package/apps/studio/client/inspector/inspector-panel.jsx +314 -207
  385. package/apps/studio/client/inspector/layers.jsx +90 -65
  386. package/apps/studio/client/inspector/selection.js +20 -0
  387. package/apps/studio/client/inspector/token-popover.jsx +42 -28
  388. package/apps/studio/client/inspector-controls.jsx +453 -106
  389. package/apps/studio/client/panels/BrandUploadPanel.jsx +8 -229
  390. package/apps/studio/client/panels/ChatPanel.jsx +391 -1674
  391. package/apps/studio/client/panels/CloudBar.jsx +548 -252
  392. package/apps/studio/client/panels/CollabModelInfographic.jsx +77 -20
  393. package/apps/studio/client/panels/CreateProject.jsx +224 -40
  394. package/apps/studio/client/panels/DiffView.jsx +27 -10
  395. package/apps/studio/client/panels/ElicitationPrompt.jsx +4 -3
  396. package/apps/studio/client/panels/FigmaImportPanel.jsx +12 -263
  397. package/apps/studio/client/panels/IdentityBar.jsx +262 -74
  398. package/apps/studio/client/panels/IntroVideoDialog.jsx +6 -1
  399. package/apps/studio/client/panels/PermissionPrompt.jsx +85 -9
  400. package/apps/studio/client/panels/ReadinessList.jsx +71 -46
  401. package/apps/studio/client/panels/RepoBranchSwitcher.jsx +124 -745
  402. package/apps/studio/client/panels/SettingsPanel.jsx +492 -608
  403. package/apps/studio/client/panels/SetupChecklist.jsx +10 -3
  404. package/apps/studio/client/panels/SourceConflictPanel.jsx +96 -20
  405. package/apps/studio/client/panels/SyncConsentDialog.jsx +14 -13
  406. package/apps/studio/client/panels/TeamProjects.jsx +365 -119
  407. package/apps/studio/client/panels/ToolGroup.jsx +6 -2
  408. package/apps/studio/client/panels/acp-runtime.js +127 -22
  409. package/apps/studio/client/panels/acp-usage.js +4 -1
  410. package/apps/studio/client/panels/chat-context.js +74 -5
  411. package/apps/studio/client/panels/chat-header.jsx +67 -0
  412. package/apps/studio/client/panels/chat-markdown.jsx +6 -2
  413. package/apps/studio/client/panels/file-deep-link-dialog.jsx +88 -17
  414. package/apps/studio/client/panels/file-preview.jsx +50 -24
  415. package/apps/studio/client/panels/git-grouping.js +9 -2
  416. package/apps/studio/client/panels/slash-commands.gen.js +171 -0
  417. package/apps/studio/client/panels/slash-commands.js +65 -25
  418. package/apps/studio/client/panels/timeline-media-cache.js +68 -2
  419. package/apps/studio/client/panels/timeline-parse.js +62 -22
  420. package/apps/studio/client/panels/timeline-snap.js +4 -1
  421. package/apps/studio/client/panels/transcript-view.js +9 -0
  422. package/apps/studio/client/photo-knobs.jsx +225 -46
  423. package/apps/studio/client/prefs-migrate.js +79 -0
  424. package/apps/studio/client/report-bug.jsx +59 -26
  425. package/apps/studio/client/selection-scope.js +215 -0
  426. package/apps/studio/client/share-link.js +104 -8
  427. package/apps/studio/client/shell/account-tone.js +28 -0
  428. package/apps/studio/client/shell/banners.jsx +21 -188
  429. package/apps/studio/client/shell/comments-panel.jsx +5 -176
  430. package/apps/studio/client/shell/constants.js +1 -0
  431. package/apps/studio/client/shell/dock.jsx +217 -31
  432. package/apps/studio/client/shell/drop-guard.js +52 -0
  433. package/apps/studio/client/shell/icons.jsx +165 -23
  434. package/apps/studio/client/shell/util.js +20 -33
  435. package/apps/studio/client/shell/viewport.jsx +249 -95
  436. package/apps/studio/client/shell-bus.js +82 -0
  437. package/apps/studio/client/shell-events.js +251 -0
  438. package/apps/studio/client/stamp-follow.js +62 -0
  439. package/apps/studio/client/stores/shell-store.jsx +15 -0
  440. package/apps/studio/client/styles/0-reset.css +79 -16
  441. package/apps/studio/client/styles/1-tokens-maude-v2.css +367 -0
  442. package/apps/studio/client/styles/1-tokens-shell.css +374 -0
  443. package/apps/studio/client/styles/2-layout.css +404 -24
  444. package/apps/studio/client/styles/3-kit-maude-v2.css +683 -0
  445. package/apps/studio/client/styles/_index.css +185 -18
  446. package/apps/studio/client/styles/fonts.css +63 -0
  447. package/apps/studio/client/system/system-view.jsx +52 -6
  448. package/apps/studio/client/tour/collab-tour.js +43 -38
  449. package/apps/studio/client/tour/overlay.jsx +61 -19
  450. package/apps/studio/client/tour/quick-setup-tour.js +27 -20
  451. package/apps/studio/client/tour/tour-model.js +36 -0
  452. package/apps/studio/client/tour/usage-tour.js +43 -24
  453. package/apps/studio/client/tree/tree.jsx +661 -409
  454. package/apps/studio/client/tree-expansion.js +5 -2
  455. package/apps/studio/client/tree-row-menu.jsx +43 -29
  456. package/apps/studio/client/ui-open.js +104 -0
  457. package/apps/studio/client/use-tree-drag.js +2 -0
  458. package/apps/studio/client/v2/access/access-card.jsx +54 -0
  459. package/apps/studio/client/v2/access/access-client.js +525 -0
  460. package/apps/studio/client/v2/access/access-host.jsx +328 -0
  461. package/apps/studio/client/v2/access/access.css +163 -0
  462. package/apps/studio/client/v2/access/ask-to-edit.jsx +97 -0
  463. package/apps/studio/client/v2/access/disabled-reason.js +50 -0
  464. package/apps/studio/client/v2/access/link-off-card.jsx +37 -0
  465. package/apps/studio/client/v2/access/trashed-banner.jsx +123 -0
  466. package/apps/studio/client/v2/advanced/where-matrix.js +231 -0
  467. package/apps/studio/client/v2/ai/AChip.jsx +158 -0
  468. package/apps/studio/client/v2/ai/Advanced.jsx +640 -0
  469. package/apps/studio/client/v2/ai/AiChatIsland.jsx +108 -0
  470. package/apps/studio/client/v2/ai/AskSelectionHost.jsx +173 -0
  471. package/apps/studio/client/v2/ai/AttachMenu.jsx +190 -0
  472. package/apps/studio/client/v2/ai/BigChat.jsx +195 -0
  473. package/apps/studio/client/v2/ai/ChatList.jsx +614 -0
  474. package/apps/studio/client/v2/ai/ChatUndo.jsx +164 -0
  475. package/apps/studio/client/v2/ai/ChoiceCard.jsx +178 -0
  476. package/apps/studio/client/v2/ai/Composer.jsx +655 -0
  477. package/apps/studio/client/v2/ai/ConnectSheet.jsx +118 -0
  478. package/apps/studio/client/v2/ai/Consent.jsx +66 -0
  479. package/apps/studio/client/v2/ai/DropOverlay.jsx +113 -0
  480. package/apps/studio/client/v2/ai/Feed.jsx +589 -0
  481. package/apps/studio/client/v2/ai/FoldNeeds.jsx +23 -0
  482. package/apps/studio/client/v2/ai/NeedsYouSlot.jsx +250 -0
  483. package/apps/studio/client/v2/ai/NotReady.jsx +110 -0
  484. package/apps/studio/client/v2/ai/OfferCard.jsx +165 -0
  485. package/apps/studio/client/v2/ai/PermissionCard.jsx +168 -0
  486. package/apps/studio/client/v2/ai/PickedShots.jsx +33 -0
  487. package/apps/studio/client/v2/ai/ProblemCard.jsx +41 -0
  488. package/apps/studio/client/v2/ai/QuitDialog.jsx +127 -0
  489. package/apps/studio/client/v2/ai/RawLog.jsx +68 -0
  490. package/apps/studio/client/v2/ai/Result.jsx +144 -0
  491. package/apps/studio/client/v2/ai/RunList.jsx +352 -0
  492. package/apps/studio/client/v2/ai/RunSurface.jsx +248 -0
  493. package/apps/studio/client/v2/ai/ScopeChip.jsx +239 -0
  494. package/apps/studio/client/v2/ai/SentStrip.jsx +70 -0
  495. package/apps/studio/client/v2/ai/StoppedDivider.jsx +84 -0
  496. package/apps/studio/client/v2/ai/Suggest.jsx +153 -0
  497. package/apps/studio/client/v2/ai/TurnResult.jsx +95 -0
  498. package/apps/studio/client/v2/ai/WaitingCard.jsx +133 -0
  499. package/apps/studio/client/v2/ai/WillChange.jsx +40 -0
  500. package/apps/studio/client/v2/ai/Working.jsx +74 -0
  501. package/apps/studio/client/v2/ai/advanced-handlers.js +56 -0
  502. package/apps/studio/client/v2/ai/advanced-model.js +214 -0
  503. package/apps/studio/client/v2/ai/ai-list-advanced.css +625 -0
  504. package/apps/studio/client/v2/ai/ai-may.js +75 -0
  505. package/apps/studio/client/v2/ai/ai-offer.js +178 -0
  506. package/apps/studio/client/v2/ai/ai-run.css +281 -0
  507. package/apps/studio/client/v2/ai/ai-send.js +164 -0
  508. package/apps/studio/client/v2/ai/ai.css +261 -0
  509. package/apps/studio/client/v2/ai/answer-note.js +44 -0
  510. package/apps/studio/client/v2/ai/ask-frame.js +131 -0
  511. package/apps/studio/client/v2/ai/ask-selection-lane.js +100 -0
  512. package/apps/studio/client/v2/ai/ask-selection.css +142 -0
  513. package/apps/studio/client/v2/ai/ask-selection.js +84 -0
  514. package/apps/studio/client/v2/ai/attach.css +366 -0
  515. package/apps/studio/client/v2/ai/attach.js +186 -0
  516. package/apps/studio/client/v2/ai/chat-list-model.js +333 -0
  517. package/apps/studio/client/v2/ai/chat-store-api.js +93 -0
  518. package/apps/studio/client/{styles/6-acp-chat.css → v2/ai/chat.css} +1152 -797
  519. package/apps/studio/client/v2/ai/connect-flow.js +75 -0
  520. package/apps/studio/client/v2/ai/gate-lines.js +121 -0
  521. package/apps/studio/client/v2/ai/icons.jsx +66 -0
  522. package/apps/studio/client/v2/ai/jump-model.js +61 -0
  523. package/apps/studio/client/v2/ai/made-by-ai.js +179 -0
  524. package/apps/studio/client/v2/ai/needs-you-store.js +112 -0
  525. package/apps/studio/client/v2/ai/needs-you-toast.js +104 -0
  526. package/apps/studio/client/v2/ai/needs-you.css +554 -0
  527. package/apps/studio/client/v2/ai/needs-you.js +401 -0
  528. package/apps/studio/client/v2/ai/panel-focus.js +71 -0
  529. package/apps/studio/client/v2/ai/panel.css +88 -0
  530. package/apps/studio/client/v2/ai/paste-chips.jsx +108 -0
  531. package/apps/studio/client/v2/ai/picked-shots.js +48 -0
  532. package/apps/studio/client/v2/ai/quit.css +64 -0
  533. package/apps/studio/client/v2/ai/result-shown.js +50 -0
  534. package/apps/studio/client/v2/ai/ring-relay.js +143 -0
  535. package/apps/studio/client/v2/ai/row-slots-lane.js +67 -0
  536. package/apps/studio/client/v2/ai/run-api.js +137 -0
  537. package/apps/studio/client/v2/ai/run-cards.js +31 -0
  538. package/apps/studio/client/v2/ai/run-compare.js +60 -0
  539. package/apps/studio/client/v2/ai/run-icons.jsx +53 -0
  540. package/apps/studio/client/v2/ai/run-model.js +348 -0
  541. package/apps/studio/client/v2/ai/runs-model.js +568 -0
  542. package/apps/studio/client/v2/ai/runs-store.js +161 -0
  543. package/apps/studio/client/v2/ai/runs.css +226 -0
  544. package/apps/studio/client/v2/ai/scope.js +298 -0
  545. package/apps/studio/client/v2/ai/seen-relay.js +95 -0
  546. package/apps/studio/client/v2/ai/sent-attachments.js +77 -0
  547. package/apps/studio/client/v2/ai/stopped.js +69 -0
  548. package/apps/studio/client/v2/ai/suggest-why.js +200 -0
  549. package/apps/studio/client/v2/ai/use-ai-scope.js +198 -0
  550. package/apps/studio/client/v2/ai/use-ask-ai.js +63 -0
  551. package/apps/studio/client/v2/ai/use-ask-selection.js +41 -0
  552. package/apps/studio/client/v2/ai/use-attachments.js +239 -0
  553. package/apps/studio/client/v2/ai/use-chat-runs.js +32 -0
  554. package/apps/studio/client/v2/ai/use-run-versions.js +39 -0
  555. package/apps/studio/client/v2/ai/video/ClipsAttached.jsx +23 -0
  556. package/apps/studio/client/v2/ai/video/LeftOut.jsx +29 -0
  557. package/apps/studio/client/v2/ai/video/WatchProgress.jsx +65 -0
  558. package/apps/studio/client/v2/ai/video/card-model.js +107 -0
  559. package/apps/studio/client/v2/ai/video/cards.jsx +51 -0
  560. package/apps/studio/client/v2/ai/video/clip-pic.js +12 -0
  561. package/apps/studio/client/v2/ai/video/video-cards.css +168 -0
  562. package/apps/studio/client/v2/annotations/annotation-asks.js +171 -0
  563. package/apps/studio/client/v2/annotations/annotation-list-model.js +238 -0
  564. package/apps/studio/client/v2/annotations/annotation-list.css +277 -0
  565. package/apps/studio/client/v2/annotations/annotation-list.jsx +433 -0
  566. package/apps/studio/client/v2/annotations/recent-stickers.js +64 -0
  567. package/apps/studio/client/v2/annotations/stamp-row.jsx +66 -0
  568. package/apps/studio/client/v2/annotations/stamps-glyphs.jsx +35 -0
  569. package/apps/studio/client/v2/annotations/sticker-preload.js +44 -0
  570. package/apps/studio/client/v2/annotations/sticker-search.js +155 -0
  571. package/apps/studio/client/v2/annotations/stickers-gallery.css +295 -0
  572. package/apps/studio/client/v2/annotations/stickers-gallery.jsx +454 -0
  573. package/apps/studio/client/v2/annotations/templates-panel.css +344 -0
  574. package/apps/studio/client/v2/annotations/templates-panel.jsx +240 -0
  575. package/apps/studio/client/v2/annotations/v2-scope.js +20 -0
  576. package/apps/studio/client/v2/annotations/vote-bar.jsx +212 -0
  577. package/apps/studio/client/v2/annotations/vote-sheet.jsx +200 -0
  578. package/apps/studio/client/v2/annotations/vote-store.js +392 -0
  579. package/apps/studio/client/v2/annotations/vote.css +153 -0
  580. package/apps/studio/client/v2/assets/ask-once.js +65 -0
  581. package/apps/studio/client/v2/assets/asset-drop-session.js +238 -0
  582. package/apps/studio/client/v2/assets/asset-state-lane.js +267 -0
  583. package/apps/studio/client/v2/assets/assets-bus.js +109 -0
  584. package/apps/studio/client/v2/assets/browse-model.js +90 -0
  585. package/apps/studio/client/v2/assets/browse-view.jsx +202 -0
  586. package/apps/studio/client/v2/assets/canvas-drop-catcher.jsx +114 -0
  587. package/apps/studio/client/v2/assets/connect-key-sheet.jsx +69 -0
  588. package/apps/studio/client/v2/assets/copy-asset.js +37 -0
  589. package/apps/studio/client/v2/assets/describe-client.js +156 -0
  590. package/apps/studio/client/v2/assets/describe-consent.jsx +184 -0
  591. package/apps/studio/client/v2/assets/describe.css +72 -0
  592. package/apps/studio/client/v2/assets/details-advanced.jsx +76 -0
  593. package/apps/studio/client/v2/assets/details-model.js +233 -0
  594. package/apps/studio/client/v2/assets/details.jsx +292 -0
  595. package/apps/studio/client/v2/assets/generate-ask.jsx +506 -0
  596. package/apps/studio/client/v2/assets/generated.js +83 -0
  597. package/apps/studio/client/v2/assets/import-lines.js +228 -0
  598. package/apps/studio/client/v2/assets/import-offline.js +32 -0
  599. package/apps/studio/client/v2/assets/import-toast.js +56 -0
  600. package/apps/studio/client/v2/assets/just-added.js +32 -0
  601. package/apps/studio/client/v2/assets/kinds-chip.jsx +77 -0
  602. package/apps/studio/client/v2/assets/library-foot.js +42 -0
  603. package/apps/studio/client/v2/assets/missing-frame.css +60 -0
  604. package/apps/studio/client/v2/assets/missing-frame.jsx +218 -0
  605. package/apps/studio/client/v2/assets/multi-select.js +58 -0
  606. package/apps/studio/client/v2/assets/place-asset.js +128 -0
  607. package/apps/studio/client/v2/assets/relink.js +96 -0
  608. package/apps/studio/client/v2/assets/rename-asset.js +83 -0
  609. package/apps/studio/client/v2/assets/search-marks.jsx +75 -0
  610. package/apps/studio/client/v2/assets/takes-overlay.jsx +86 -0
  611. package/apps/studio/client/v2/assets/takes.css +177 -0
  612. package/apps/studio/client/v2/assets/takes.js +224 -0
  613. package/apps/studio/client/v2/assets/tidy.jsx +144 -0
  614. package/apps/studio/client/v2/assets/tile-drag.js +53 -0
  615. package/apps/studio/client/v2/assets/tile-menu.jsx +119 -0
  616. package/apps/studio/client/v2/assets/tile.jsx +131 -0
  617. package/apps/studio/client/v2/assets/trash-assets.js +98 -0
  618. package/apps/studio/client/v2/assets/use-asset-details.js +58 -0
  619. package/apps/studio/client/v2/assets/use-assets.js +121 -0
  620. package/apps/studio/client/v2/assets/use-takes-lane.js +150 -0
  621. package/apps/studio/client/v2/canvases/canvas-icons.jsx +107 -0
  622. package/apps/studio/client/v2/canvases/canvases-panel.jsx +1466 -0
  623. package/apps/studio/client/v2/canvases/canvases.css +699 -0
  624. package/apps/studio/client/v2/canvases/covers.js +32 -0
  625. package/apps/studio/client/v2/canvases/inline-rename.jsx +122 -0
  626. package/apps/studio/client/v2/canvases/jump-list.jsx +100 -0
  627. package/apps/studio/client/v2/canvases/jump-model.js +102 -0
  628. package/apps/studio/client/v2/canvases/kept-on-this-mac.jsx +192 -0
  629. package/apps/studio/client/v2/canvases/last-canvas.js +36 -0
  630. package/apps/studio/client/v2/canvases/move-model.js +45 -0
  631. package/apps/studio/client/v2/canvases/move-sheet.jsx +91 -0
  632. package/apps/studio/client/v2/canvases/open-link.js +154 -0
  633. package/apps/studio/client/v2/canvases/panel-search.js +156 -0
  634. package/apps/studio/client/v2/canvases/rename-model.js +134 -0
  635. package/apps/studio/client/v2/canvases/row-menu.jsx +145 -0
  636. package/apps/studio/client/v2/canvases/row-slots.js +224 -0
  637. package/apps/studio/client/v2/canvases/sort.js +132 -0
  638. package/apps/studio/client/v2/canvases/support-model.js +68 -0
  639. package/apps/studio/client/v2/canvases/trash-canvas.js +120 -0
  640. package/apps/studio/client/v2/canvases/tree-model.js +760 -0
  641. package/apps/studio/client/v2/canvases/use-canvas-index.js +50 -0
  642. package/apps/studio/client/v2/canvases/use-canvases-sort.js +59 -0
  643. package/apps/studio/client/v2/canvases/use-move.js +61 -0
  644. package/apps/studio/client/v2/canvases/use-pins.js +80 -0
  645. package/apps/studio/client/v2/cloud/browser-door.js +152 -0
  646. package/apps/studio/client/v2/cloud/cloud-name.js +38 -0
  647. package/apps/studio/client/v2/code/canvas-error-card.jsx +407 -0
  648. package/apps/studio/client/v2/code/canvas-imports-card.jsx +31 -0
  649. package/apps/studio/client/v2/code/code-bus.js +63 -0
  650. package/apps/studio/client/v2/code/code-view.jsx +277 -0
  651. package/apps/studio/client/v2/code/code.css +373 -0
  652. package/apps/studio/client/v2/code/highlight.js +163 -0
  653. package/apps/studio/client/v2/code/use-canvas-source.js +338 -0
  654. package/apps/studio/client/v2/comments/comment-bridge.js +154 -0
  655. package/apps/studio/client/v2/comments/comment-client.js +84 -0
  656. package/apps/studio/client/v2/comments/comment-tool.js +18 -0
  657. package/apps/studio/client/v2/comments/comments-model.js +213 -0
  658. package/apps/studio/client/v2/comments/comments-panel.jsx +400 -0
  659. package/apps/studio/client/v2/comments/comments.css +305 -0
  660. package/apps/studio/client/v2/comments/mention-callouts.jsx +90 -0
  661. package/apps/studio/client/v2/comments/mention-model.js +118 -0
  662. package/apps/studio/client/v2/comments/native-mention-notice.js +73 -0
  663. package/apps/studio/client/v2/comments/reply-focus.js +30 -0
  664. package/apps/studio/client/v2/comments/use-comments-shell.jsx +176 -0
  665. package/apps/studio/client/v2/create/NameDialog.jsx +95 -0
  666. package/apps/studio/client/v2/create/NameDialogHost.jsx +141 -0
  667. package/apps/studio/client/v2/create/create-project.css +260 -0
  668. package/apps/studio/client/v2/create/duplicate-done.js +45 -0
  669. package/apps/studio/client/v2/create/empty-project.css +113 -0
  670. package/apps/studio/client/v2/create/empty-project.jsx +162 -0
  671. package/apps/studio/client/v2/create/first-draft.js +30 -0
  672. package/apps/studio/client/v2/create/intent-host.jsx +40 -0
  673. package/apps/studio/client/v2/create/name-dialog-bus.js +41 -0
  674. package/apps/studio/client/v2/create/name-dialog.css +36 -0
  675. package/apps/studio/client/v2/create/new-canvas.js +64 -0
  676. package/apps/studio/client/v2/create/open-sizes.js +41 -0
  677. package/apps/studio/client/v2/create/render-error.css +29 -0
  678. package/apps/studio/client/v2/create/render-error.jsx +107 -0
  679. package/apps/studio/client/v2/create/repair-offer.js +36 -0
  680. package/apps/studio/client/v2/create/take-intent.js +154 -0
  681. package/apps/studio/client/v2/create/use-project-empty.js +85 -0
  682. package/apps/studio/client/v2/create/use-render-error.js +116 -0
  683. package/apps/studio/client/v2/diagnostics/diagnostics-bus.js +47 -0
  684. package/apps/studio/client/v2/diagnostics/diagnostics-handlers.js +108 -0
  685. package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +196 -0
  686. package/apps/studio/client/v2/diagnostics/diagnostics-model.js +253 -0
  687. package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +557 -0
  688. package/apps/studio/client/v2/diagnostics/diagnostics.css +612 -0
  689. package/apps/studio/client/v2/diagnostics/resync-model.js +51 -0
  690. package/apps/studio/client/v2/diagnostics/resync-run.js +79 -0
  691. package/apps/studio/client/v2/diagnostics/sync-actions.js +38 -0
  692. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +241 -0
  693. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +392 -0
  694. package/apps/studio/client/v2/diagnostics/use-diagnostics-menu.js +58 -0
  695. package/apps/studio/client/v2/ds/advanced-bus.js +40 -0
  696. package/apps/studio/client/v2/ds/advanced-host.jsx +228 -0
  697. package/apps/studio/client/v2/ds/advanced-model.js +110 -0
  698. package/apps/studio/client/v2/ds/advanced-store.js +47 -0
  699. package/apps/studio/client/v2/ds/advanced.css +277 -0
  700. package/apps/studio/client/v2/ds/advanced.jsx +203 -0
  701. package/apps/studio/client/v2/ds/check-card.jsx +80 -0
  702. package/apps/studio/client/v2/ds/colour-picker.jsx +121 -0
  703. package/apps/studio/client/v2/ds/colour-words.js +48 -0
  704. package/apps/studio/client/v2/ds/conflict-pick.jsx +151 -0
  705. package/apps/studio/client/v2/ds/contrast-warning.jsx +80 -0
  706. package/apps/studio/client/v2/ds/contrast.js +137 -0
  707. package/apps/studio/client/v2/ds/convert-dialog.jsx +133 -0
  708. package/apps/studio/client/v2/ds/convert-host.jsx +143 -0
  709. package/apps/studio/client/v2/ds/convert-model.js +221 -0
  710. package/apps/studio/client/v2/ds/default-write.js +69 -0
  711. package/apps/studio/client/v2/ds/direction-bar.jsx +287 -0
  712. package/apps/studio/client/v2/ds/door-write.js +163 -0
  713. package/apps/studio/client/v2/ds/edge-model.js +151 -0
  714. package/apps/studio/client/v2/ds/edge-write.js +91 -0
  715. package/apps/studio/client/v2/ds/edges.css +152 -0
  716. package/apps/studio/client/v2/ds/follower-swap.js +88 -0
  717. package/apps/studio/client/v2/ds/go-to.js +71 -0
  718. package/apps/studio/client/v2/ds/kinds/master.jsx +214 -0
  719. package/apps/studio/client/v2/ds/kinds/token.jsx +546 -0
  720. package/apps/studio/client/v2/ds/library-bus.js +43 -0
  721. package/apps/studio/client/v2/ds/library-card.jsx +379 -0
  722. package/apps/studio/client/v2/ds/library-host.jsx +436 -0
  723. package/apps/studio/client/v2/ds/library-model.js +305 -0
  724. package/apps/studio/client/v2/ds/library-store.js +45 -0
  725. package/apps/studio/client/v2/ds/library.css +148 -0
  726. package/apps/studio/client/v2/ds/make-host.jsx +244 -0
  727. package/apps/studio/client/v2/ds/make-model.js +208 -0
  728. package/apps/studio/client/v2/ds/make-sheet.jsx +264 -0
  729. package/apps/studio/client/v2/ds/make-write.js +90 -0
  730. package/apps/studio/client/v2/ds/make.css +242 -0
  731. package/apps/studio/client/v2/ds/master-write.js +145 -0
  732. package/apps/studio/client/v2/ds/new-canvas-default.js +89 -0
  733. package/apps/studio/client/v2/ds/off-system-host.jsx +107 -0
  734. package/apps/studio/client/v2/ds/off-system.jsx +101 -0
  735. package/apps/studio/client/v2/ds/outside-banner.jsx +153 -0
  736. package/apps/studio/client/v2/ds/pinned-rows.js +138 -0
  737. package/apps/studio/client/v2/ds/pins.js +102 -0
  738. package/apps/studio/client/v2/ds/preview-bar.jsx +220 -0
  739. package/apps/studio/client/v2/ds/preview-doors.js +47 -0
  740. package/apps/studio/client/v2/ds/preview-mode.js +163 -0
  741. package/apps/studio/client/v2/ds/reach-data.js +68 -0
  742. package/apps/studio/client/v2/ds/reach-model.js +184 -0
  743. package/apps/studio/client/v2/ds/reach-view.jsx +577 -0
  744. package/apps/studio/client/v2/ds/reach.css +298 -0
  745. package/apps/studio/client/v2/ds/rename-write.js +88 -0
  746. package/apps/studio/client/v2/ds/review-bus.js +41 -0
  747. package/apps/studio/client/v2/ds/review-host.jsx +438 -0
  748. package/apps/studio/client/v2/ds/review-model.js +307 -0
  749. package/apps/studio/client/v2/ds/review-sheet.jsx +390 -0
  750. package/apps/studio/client/v2/ds/review.css +894 -0
  751. package/apps/studio/client/v2/ds/row-dots.js +41 -0
  752. package/apps/studio/client/v2/ds/switch-bus.js +56 -0
  753. package/apps/studio/client/v2/ds/switch-host.jsx +241 -0
  754. package/apps/studio/client/v2/ds/switch-model.js +254 -0
  755. package/apps/studio/client/v2/ds/switch-sheet.jsx +364 -0
  756. package/apps/studio/client/v2/ds/switch.css +263 -0
  757. package/apps/studio/client/v2/ds/system-menu.jsx +81 -0
  758. package/apps/studio/client/v2/ds/system-rename.jsx +102 -0
  759. package/apps/studio/client/v2/ds/token-write.js +241 -0
  760. package/apps/studio/client/v2/ds/token.css +185 -0
  761. package/apps/studio/client/v2/ds/trash-token-sheet.jsx +112 -0
  762. package/apps/studio/client/v2/ds/truth-card.jsx +85 -0
  763. package/apps/studio/client/v2/ds/truth-host.jsx +239 -0
  764. package/apps/studio/client/v2/ds/truth-model.js +315 -0
  765. package/apps/studio/client/v2/ds/truth-store.js +45 -0
  766. package/apps/studio/client/v2/ds/truth.css +143 -0
  767. package/apps/studio/client/v2/ds/update-available.jsx +261 -0
  768. package/apps/studio/client/v2/ds/update-dots.js +103 -0
  769. package/apps/studio/client/v2/ds/update-model.js +295 -0
  770. package/apps/studio/client/v2/ds/upgrade-bus.js +40 -0
  771. package/apps/studio/client/v2/ds/upgrade-host.jsx +185 -0
  772. package/apps/studio/client/v2/ds/upgrade-model.js +266 -0
  773. package/apps/studio/client/v2/ds/upgrade-offers.js +34 -0
  774. package/apps/studio/client/v2/ds/upgrade-sheet.jsx +277 -0
  775. package/apps/studio/client/v2/ds/upgrade.css +166 -0
  776. package/apps/studio/client/v2/ds/use-covers.js +27 -0
  777. package/apps/studio/client/v2/ds/use-ds-frames.js +165 -0
  778. package/apps/studio/client/v2/ds/use-ds-model.js +61 -0
  779. package/apps/studio/client/v2/ds/use-ds-search.js +61 -0
  780. package/apps/studio/client/v2/ds/use-ds-state.js +65 -0
  781. package/apps/studio/client/v2/ds/uses-link.jsx +58 -0
  782. package/apps/studio/client/v2/empty/all-trashed-model.js +321 -0
  783. package/apps/studio/client/v2/empty/all-trashed-relay.js +65 -0
  784. package/apps/studio/client/v2/empty/all-trashed.jsx +229 -0
  785. package/apps/studio/client/v2/empty/arriving.jsx +180 -0
  786. package/apps/studio/client/v2/empty/artboard-hint.jsx +47 -0
  787. package/apps/studio/client/v2/empty/ask-button.jsx +35 -0
  788. package/apps/studio/client/v2/empty/confetti.jsx +46 -0
  789. package/apps/studio/client/v2/empty/empty-canvas.jsx +96 -0
  790. package/apps/studio/client/v2/empty/empty-copy.js +265 -0
  791. package/apps/studio/client/v2/empty/empty-hint-store.js +31 -0
  792. package/apps/studio/client/v2/empty/empty-host.jsx +168 -0
  793. package/apps/studio/client/v2/empty/empty.css +440 -0
  794. package/apps/studio/client/v2/empty/empty.jsx +162 -0
  795. package/apps/studio/client/v2/empty/fill-ask.js +22 -0
  796. package/apps/studio/client/v2/empty/free-centre.js +11 -0
  797. package/apps/studio/client/v2/empty/index.js +40 -0
  798. package/apps/studio/client/v2/empty/layers-empty.jsx +22 -0
  799. package/apps/studio/client/v2/empty/not-local.jsx +111 -0
  800. package/apps/studio/client/v2/empty/select-new-artboard.js +32 -0
  801. package/apps/studio/client/v2/empty/skeleton.jsx +51 -0
  802. package/apps/studio/client/v2/empty/spot-art.jsx +923 -0
  803. package/apps/studio/client/v2/empty/spot.jsx +96 -0
  804. package/apps/studio/client/v2/empty/suggestions.jsx +18 -0
  805. package/apps/studio/client/v2/empty/use-empty-canvas.js +251 -0
  806. package/apps/studio/client/v2/export/access-line.jsx +48 -0
  807. package/apps/studio/client/v2/export/advanced/advanced-copy.js +77 -0
  808. package/apps/studio/client/v2/export/advanced/advanced.css +252 -0
  809. package/apps/studio/client/v2/export/advanced/advanced.jsx +148 -0
  810. package/apps/studio/client/v2/export/advanced/command.js +128 -0
  811. package/apps/studio/client/v2/export/advanced/command.jsx +50 -0
  812. package/apps/studio/client/v2/export/advanced/fields.jsx +132 -0
  813. package/apps/studio/client/v2/export/advanced/image.jsx +124 -0
  814. package/apps/studio/client/v2/export/advanced/model.js +199 -0
  815. package/apps/studio/client/v2/export/advanced/names.jsx +65 -0
  816. package/apps/studio/client/v2/export/advanced/print.jsx +99 -0
  817. package/apps/studio/client/v2/export/advanced/render.jsx +63 -0
  818. package/apps/studio/client/v2/export/advanced/video.jsx +76 -0
  819. package/apps/studio/client/v2/export/annotations-policy.js +28 -0
  820. package/apps/studio/client/v2/export/cloud-queue.js +69 -0
  821. package/apps/studio/client/v2/export/copy-command.js +72 -0
  822. package/apps/studio/client/v2/export/copy-png.js +144 -0
  823. package/apps/studio/client/v2/export/done-toast.jsx +89 -0
  824. package/apps/studio/client/v2/export/edges.css +74 -0
  825. package/apps/studio/client/v2/export/export-copy.js +352 -0
  826. package/apps/studio/client/v2/export/export-sheet.jsx +804 -0
  827. package/apps/studio/client/v2/export/export-sizes.js +217 -0
  828. package/apps/studio/client/v2/export/export.css +832 -0
  829. package/apps/studio/client/v2/export/exports-model.js +383 -0
  830. package/apps/studio/client/v2/export/exports-panel.css +192 -0
  831. package/apps/studio/client/v2/export/exports-panel.jsx +164 -0
  832. package/apps/studio/client/v2/export/file-rows.jsx +84 -0
  833. package/apps/studio/client/v2/export/inspector-export.jsx +335 -0
  834. package/apps/studio/client/v2/export/job-row.jsx +358 -0
  835. package/apps/studio/client/v2/export/last-finished.js +34 -0
  836. package/apps/studio/client/v2/export/native-save.js +160 -0
  837. package/apps/studio/client/v2/export/other-formats.jsx +199 -0
  838. package/apps/studio/client/v2/export/parts.jsx +117 -0
  839. package/apps/studio/client/v2/export/preflight/fonts.js +27 -0
  840. package/apps/studio/client/v2/export/preflight/paper.jsx +177 -0
  841. package/apps/studio/client/v2/export/preflight/safe-margin.js +24 -0
  842. package/apps/studio/client/v2/export/preflight/use-preflight.js +74 -0
  843. package/apps/studio/client/v2/export/preview.jsx +79 -0
  844. package/apps/studio/client/v2/export/print.css +219 -0
  845. package/apps/studio/client/v2/export/run-export.js +177 -0
  846. package/apps/studio/client/v2/export/scope-bar.jsx +70 -0
  847. package/apps/studio/client/v2/export/sections/batch-model.js +224 -0
  848. package/apps/studio/client/v2/export/sections/batch.jsx +235 -0
  849. package/apps/studio/client/v2/export/sections/image.jsx +93 -0
  850. package/apps/studio/client/v2/export/sections/print-copy.js +41 -0
  851. package/apps/studio/client/v2/export/sections/print.jsx +285 -0
  852. package/apps/studio/client/v2/export/sections/render-row.jsx +81 -0
  853. package/apps/studio/client/v2/export/sections/version.jsx +176 -0
  854. package/apps/studio/client/v2/export/sections/video-copy.js +92 -0
  855. package/apps/studio/client/v2/export/sections/video-model.js +127 -0
  856. package/apps/studio/client/v2/export/sections/video.jsx +397 -0
  857. package/apps/studio/client/v2/export/sections/web.jsx +151 -0
  858. package/apps/studio/client/v2/export/share-hint.jsx +51 -0
  859. package/apps/studio/client/v2/export/use-export-spec.js +546 -0
  860. package/apps/studio/client/v2/export/video-content.js +75 -0
  861. package/apps/studio/client/v2/export/video.css +221 -0
  862. package/apps/studio/client/v2/fold/advanced-fold.jsx +96 -0
  863. package/apps/studio/client/v2/fold/fold-store.js +151 -0
  864. package/apps/studio/client/v2/fold/fold.css +59 -0
  865. package/apps/studio/client/v2/fold/use-fold.js +36 -0
  866. package/apps/studio/client/v2/handoff/edges.jsx +74 -0
  867. package/apps/studio/client/v2/handoff/handoff-sheet.jsx +469 -0
  868. package/apps/studio/client/v2/handoff/handoff.css +181 -0
  869. package/apps/studio/client/v2/handoff/ready-card.jsx +84 -0
  870. package/apps/studio/client/v2/handoff/targets.js +111 -0
  871. package/apps/studio/client/v2/help/add-guides.js +43 -0
  872. package/apps/studio/client/v2/help/help.css +995 -0
  873. package/apps/studio/client/v2/history/blame.js +161 -0
  874. package/apps/studio/client/v2/history/branch-actions.js +214 -0
  875. package/apps/studio/client/v2/history/change-list.jsx +102 -0
  876. package/apps/studio/client/v2/history/clear-band.js +144 -0
  877. package/apps/studio/client/v2/history/compare-store.js +80 -0
  878. package/apps/studio/client/v2/history/compare-view.jsx +318 -0
  879. package/apps/studio/client/v2/history/compare-words.js +8 -0
  880. package/apps/studio/client/v2/history/git-advanced.jsx +580 -0
  881. package/apps/studio/client/v2/history/git-io.js +58 -0
  882. package/apps/studio/client/v2/history/git-model.js +526 -0
  883. package/apps/studio/client/v2/history/git-parts.jsx +662 -0
  884. package/apps/studio/client/v2/history/history-host.jsx +78 -0
  885. package/apps/studio/client/v2/history/history-panel.jsx +599 -0
  886. package/apps/studio/client/v2/history/history.css +1477 -0
  887. package/apps/studio/client/v2/history/name-dialog.jsx +109 -0
  888. package/apps/studio/client/v2/history/object-filter.js +143 -0
  889. package/apps/studio/client/v2/history/object-history-ask.js +62 -0
  890. package/apps/studio/client/v2/history/object-view.jsx +236 -0
  891. package/apps/studio/client/v2/history/rows.ts +445 -0
  892. package/apps/studio/client/v2/history/use-versions.js +391 -0
  893. package/apps/studio/client/v2/history/view-bar.jsx +80 -0
  894. package/apps/studio/client/v2/import/brand-model.js +145 -0
  895. package/apps/studio/client/v2/import/brand-result.jsx +197 -0
  896. package/apps/studio/client/v2/import/brand-sheet.jsx +434 -0
  897. package/apps/studio/client/v2/import/brand.css +378 -0
  898. package/apps/studio/client/v2/import/figma-artboard.jsx +121 -0
  899. package/apps/studio/client/v2/import/figma-model.js +237 -0
  900. package/apps/studio/client/v2/import/figma-prefill.js +23 -0
  901. package/apps/studio/client/v2/import/figma-sheet.jsx +525 -0
  902. package/apps/studio/client/v2/import/figma-summary.jsx +62 -0
  903. package/apps/studio/client/v2/import/figma.css +179 -0
  904. package/apps/studio/client/v2/import/frame-picker.jsx +57 -0
  905. package/apps/studio/client/v2/inspect/inspect-host.jsx +53 -0
  906. package/apps/studio/client/v2/inspect/inspect-model.js +132 -0
  907. package/apps/studio/client/v2/inspect/inspect-panel.jsx +214 -0
  908. package/apps/studio/client/v2/inspect/inspect.css +87 -0
  909. package/apps/studio/client/v2/inspector/advanced-rows-default.jsx +773 -0
  910. package/apps/studio/client/v2/inspector/advanced-rows.js +106 -0
  911. package/apps/studio/client/v2/inspector/advanced.jsx +286 -0
  912. package/apps/studio/client/v2/inspector/blocks.js +57 -0
  913. package/apps/studio/client/v2/inspector/colour-groups.js +129 -0
  914. package/apps/studio/client/v2/inspector/component-picker.css +133 -0
  915. package/apps/studio/client/v2/inspector/component-picker.jsx +367 -0
  916. package/apps/studio/client/v2/inspector/crumbs.jsx +89 -0
  917. package/apps/studio/client/v2/inspector/css-text.js +179 -0
  918. package/apps/studio/client/v2/inspector/css-write.js +204 -0
  919. package/apps/studio/client/v2/inspector/element-code.js +39 -0
  920. package/apps/studio/client/v2/inspector/element-id.js +70 -0
  921. package/apps/studio/client/v2/inspector/formats-ui.js +101 -0
  922. package/apps/studio/client/v2/inspector/formats-write.js +60 -0
  923. package/apps/studio/client/v2/inspector/frame.jsx +336 -0
  924. package/apps/studio/client/v2/inspector/inspector-actions.js +60 -0
  925. package/apps/studio/client/v2/inspector/inspector.css +2872 -0
  926. package/apps/studio/client/v2/inspector/jsx-slice.js +219 -0
  927. package/apps/studio/client/v2/inspector/kinds/add-width.js +55 -0
  928. package/apps/studio/client/v2/inspector/kinds/artboard-advanced-rows.jsx +89 -0
  929. package/apps/studio/client/v2/inspector/kinds/artboard-advanced.jsx +62 -0
  930. package/apps/studio/client/v2/inspector/kinds/artboard-fixed.jsx +111 -0
  931. package/apps/studio/client/v2/inspector/kinds/artboard-kinds-model.js +171 -0
  932. package/apps/studio/client/v2/inspector/kinds/artboard-model.js +155 -0
  933. package/apps/studio/client/v2/inspector/kinds/artboard-multi.jsx +142 -0
  934. package/apps/studio/client/v2/inspector/kinds/artboard-print-advanced.jsx +210 -0
  935. package/apps/studio/client/v2/inspector/kinds/artboard-print-model.js +112 -0
  936. package/apps/studio/client/v2/inspector/kinds/artboard-print.jsx +268 -0
  937. package/apps/studio/client/v2/inspector/kinds/artboard-rows.jsx +124 -0
  938. package/apps/studio/client/v2/inspector/kinds/artboard-video.jsx +144 -0
  939. package/apps/studio/client/v2/inspector/kinds/artboard-web.jsx +170 -0
  940. package/apps/studio/client/v2/inspector/kinds/artboard.jsx +168 -0
  941. package/apps/studio/client/v2/inspector/kinds/caption.jsx +203 -0
  942. package/apps/studio/client/v2/inspector/kinds/clip-model.js +190 -0
  943. package/apps/studio/client/v2/inspector/kinds/clip.css +157 -0
  944. package/apps/studio/client/v2/inspector/kinds/clip.jsx +447 -0
  945. package/apps/studio/client/v2/inspector/kinds/frame.jsx +118 -0
  946. package/apps/studio/client/v2/inspector/kinds/image.jsx +267 -0
  947. package/apps/studio/client/v2/inspector/kinds/index.js +180 -0
  948. package/apps/studio/client/v2/inspector/kinds/instance.jsx +377 -0
  949. package/apps/studio/client/v2/inspector/kinds/multi-artboard.jsx +129 -0
  950. package/apps/studio/client/v2/inspector/kinds/multi.jsx +220 -0
  951. package/apps/studio/client/v2/inspector/kinds/music.jsx +294 -0
  952. package/apps/studio/client/v2/inspector/kinds/path.jsx +174 -0
  953. package/apps/studio/client/v2/inspector/kinds/shape.jsx +59 -0
  954. package/apps/studio/client/v2/inspector/kinds/text.jsx +518 -0
  955. package/apps/studio/client/v2/inspector/kinds/title-rows.jsx +135 -0
  956. package/apps/studio/client/v2/inspector/kinds/video-facts.js +142 -0
  957. package/apps/studio/client/v2/inspector/layers-row-tools.jsx +93 -0
  958. package/apps/studio/client/v2/inspector/layers-slot.jsx +93 -0
  959. package/apps/studio/client/v2/inspector/link-write.js +52 -0
  960. package/apps/studio/client/v2/inspector/live-size.js +96 -0
  961. package/apps/studio/client/v2/inspector/model.js +228 -0
  962. package/apps/studio/client/v2/inspector/path-point.js +104 -0
  963. package/apps/studio/client/v2/inspector/print-write.js +85 -0
  964. package/apps/studio/client/v2/inspector/safe-zones-write.js +88 -0
  965. package/apps/studio/client/v2/inspector/sections/add-requests.js +35 -0
  966. package/apps/studio/client/v2/inspector/sections/border.jsx +141 -0
  967. package/apps/studio/client/v2/inspector/sections/color-control.jsx +246 -0
  968. package/apps/studio/client/v2/inspector/sections/colour-custom.jsx +826 -0
  969. package/apps/studio/client/v2/inspector/sections/colour-model.js +404 -0
  970. package/apps/studio/client/v2/inspector/sections/colour-popover.jsx +631 -0
  971. package/apps/studio/client/v2/inspector/sections/colour-words.js +131 -0
  972. package/apps/studio/client/v2/inspector/sections/corners.jsx +177 -0
  973. package/apps/studio/client/v2/inspector/sections/effects.jsx +67 -0
  974. package/apps/studio/client/v2/inspector/sections/export-slot.jsx +60 -0
  975. package/apps/studio/client/v2/inspector/sections/fill.jsx +187 -0
  976. package/apps/studio/client/v2/inspector/sections/formats.jsx +209 -0
  977. package/apps/studio/client/v2/inspector/sections/index.js +74 -0
  978. package/apps/studio/client/v2/inspector/sections/interaction.jsx +204 -0
  979. package/apps/studio/client/v2/inspector/sections/layout.jsx +314 -0
  980. package/apps/studio/client/v2/inspector/sections/opacity-row.jsx +37 -0
  981. package/apps/studio/client/v2/inspector/sections/point.jsx +102 -0
  982. package/apps/studio/client/v2/inspector/sections/position.jsx +259 -0
  983. package/apps/studio/client/v2/inspector/sections/recent-colours.js +106 -0
  984. package/apps/studio/client/v2/inspector/sections/row.jsx +91 -0
  985. package/apps/studio/client/v2/inspector/sections/safe-zones.jsx +174 -0
  986. package/apps/studio/client/v2/inspector/sections/sections.css +1474 -0
  987. package/apps/studio/client/v2/inspector/sections/size.jsx +104 -0
  988. package/apps/studio/client/v2/inspector/sections/type.jsx +168 -0
  989. package/apps/studio/client/v2/inspector/sections/warnings.css +44 -0
  990. package/apps/studio/client/v2/inspector/sections/warnings.jsx +137 -0
  991. package/apps/studio/client/v2/inspector/sections.js +226 -0
  992. package/apps/studio/client/v2/inspector/slots.js +110 -0
  993. package/apps/studio/client/v2/inspector/token-chip.jsx +315 -0
  994. package/apps/studio/client/v2/inspector/view-mode.jsx +193 -0
  995. package/apps/studio/client/v2/inspector/warning-fix.js +111 -0
  996. package/apps/studio/client/v2/kinds/ConvertDialog.jsx +183 -0
  997. package/apps/studio/client/v2/kinds/KindChips.jsx +60 -0
  998. package/apps/studio/client/v2/kinds/KindDimHost.jsx +35 -0
  999. package/apps/studio/client/v2/kinds/LayersKindFilter.jsx +108 -0
  1000. package/apps/studio/client/v2/kinds/SizePicker.jsx +566 -0
  1001. package/apps/studio/client/v2/kinds/SizePickerHost.jsx +104 -0
  1002. package/apps/studio/client/v2/kinds/advanced-rows.js +40 -0
  1003. package/apps/studio/client/v2/kinds/convert-api.js +116 -0
  1004. package/apps/studio/client/v2/kinds/convert.css +87 -0
  1005. package/apps/studio/client/v2/kinds/kind-dim-relay.js +93 -0
  1006. package/apps/studio/client/v2/kinds/kind-filter-model.js +106 -0
  1007. package/apps/studio/client/v2/kinds/kind-filter-store.js +71 -0
  1008. package/apps/studio/client/v2/kinds/kind-filter.css +105 -0
  1009. package/apps/studio/client/v2/kinds/layers-kind-model.js +99 -0
  1010. package/apps/studio/client/v2/kinds/size-picker-model.js +189 -0
  1011. package/apps/studio/client/v2/kinds/size-picker.css +393 -0
  1012. package/apps/studio/client/v2/layers/artboard-layers.jsx +105 -0
  1013. package/apps/studio/client/v2/layers/layers.css +94 -0
  1014. package/apps/studio/client/v2/left-panel/advanced-model.js +98 -0
  1015. package/apps/studio/client/v2/left-panel/assets-panel.jsx +1203 -0
  1016. package/apps/studio/client/v2/left-panel/canvas-file-menu.js +115 -0
  1017. package/apps/studio/client/v2/left-panel/canvases-advanced.jsx +270 -0
  1018. package/apps/studio/client/v2/left-panel/canvases-pinned.jsx +274 -0
  1019. package/apps/studio/client/v2/left-panel/layers-advanced.jsx +179 -0
  1020. package/apps/studio/client/v2/left-panel/left-panel-bus.js +83 -0
  1021. package/apps/studio/client/v2/left-panel/left-panel-model.js +184 -0
  1022. package/apps/studio/client/v2/left-panel/left-panel.css +1846 -0
  1023. package/apps/studio/client/v2/left-panel/selector-scope.js +42 -0
  1024. package/apps/studio/client/v2/left-panel/trash-model.js +282 -0
  1025. package/apps/studio/client/v2/left-panel/trash-view.jsx +257 -0
  1026. package/apps/studio/client/v2/left-panel/use-trash.js +172 -0
  1027. package/apps/studio/client/v2/left-panel/view-prefs.js +84 -0
  1028. package/apps/studio/client/v2/onboarding/AdvSheet.jsx +114 -0
  1029. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +239 -0
  1030. package/apps/studio/client/v2/onboarding/CliSheet.jsx +101 -0
  1031. package/apps/studio/client/v2/onboarding/ConnectAiSheet.jsx +60 -0
  1032. package/apps/studio/client/v2/onboarding/FigmaSheet.jsx +96 -0
  1033. package/apps/studio/client/v2/onboarding/FolderGithubSheet.jsx +77 -0
  1034. package/apps/studio/client/v2/onboarding/GithubSegment.jsx +241 -0
  1035. package/apps/studio/client/v2/onboarding/HubSheet.jsx +244 -0
  1036. package/apps/studio/client/v2/onboarding/connect-ai-home.js +94 -0
  1037. package/apps/studio/client/v2/onboarding/github-home.js +84 -0
  1038. package/apps/studio/client/v2/onboarding/onboarding-model.js +106 -0
  1039. package/apps/studio/client/v2/onboarding/onboarding.css +546 -0
  1040. package/apps/studio/client/v2/photo/apply-every-use-sheet.jsx +196 -0
  1041. package/apps/studio/client/v2/photo/canvas-rel.js +20 -0
  1042. package/apps/studio/client/v2/photo/looks.js +129 -0
  1043. package/apps/studio/client/v2/photo/photo-section.jsx +625 -0
  1044. package/apps/studio/client/v2/photo/photo.css +218 -0
  1045. package/apps/studio/client/v2/portal-scope.jsx +14 -0
  1046. package/apps/studio/client/v2/presence/faces.jsx +356 -0
  1047. package/apps/studio/client/v2/presence/presence.css +187 -0
  1048. package/apps/studio/client/v2/presence/use-presence-host.js +83 -0
  1049. package/apps/studio/client/v2/present/audience-window.js +63 -0
  1050. package/apps/studio/client/v2/present/canvas-pill.jsx +55 -0
  1051. package/apps/studio/client/v2/present/copy-link.js +82 -0
  1052. package/apps/studio/client/v2/present/follow-location.js +82 -0
  1053. package/apps/studio/client/v2/present/follow-model.js +68 -0
  1054. package/apps/studio/client/v2/present/follow-view.jsx +354 -0
  1055. package/apps/studio/client/v2/present/follow.css +91 -0
  1056. package/apps/studio/client/v2/present/order-map.jsx +64 -0
  1057. package/apps/studio/client/v2/present/order-notes-artboards.js +88 -0
  1058. package/apps/studio/client/v2/present/order-notes-model.js +141 -0
  1059. package/apps/studio/client/v2/present/order-notes-mount.jsx +26 -0
  1060. package/apps/studio/client/v2/present/order-notes-sheet.jsx +293 -0
  1061. package/apps/studio/client/v2/present/order-notes.css +150 -0
  1062. package/apps/studio/client/v2/present/present-chrome-host.jsx +95 -0
  1063. package/apps/studio/client/v2/present/present-controls-model.js +114 -0
  1064. package/apps/studio/client/v2/present/present-controls.jsx +263 -0
  1065. package/apps/studio/client/v2/present/present-zoom-store.js +33 -0
  1066. package/apps/studio/client/v2/present/present.css +258 -0
  1067. package/apps/studio/client/v2/present/presenter-button.jsx +25 -0
  1068. package/apps/studio/client/v2/present/presenter-host.jsx +246 -0
  1069. package/apps/studio/client/v2/present/presenter-model.js +167 -0
  1070. package/apps/studio/client/v2/present/presenter-store.js +140 -0
  1071. package/apps/studio/client/v2/present/presenter-view.css +298 -0
  1072. package/apps/studio/client/v2/present/presenter-view.jsx +241 -0
  1073. package/apps/studio/client/v2/present/video-present-model.js +92 -0
  1074. package/apps/studio/client/v2/present/video-present.css +164 -0
  1075. package/apps/studio/client/v2/present/video-present.jsx +331 -0
  1076. package/apps/studio/client/v2/preview/external-link-confirm.jsx +245 -0
  1077. package/apps/studio/client/v2/preview/link-follow.js +109 -0
  1078. package/apps/studio/client/v2/preview/open-in-app.jsx +46 -0
  1079. package/apps/studio/client/v2/preview/preview-back.js +21 -0
  1080. package/apps/studio/client/v2/preview/preview-bar.jsx +86 -0
  1081. package/apps/studio/client/v2/preview/preview-chrome-host.jsx +234 -0
  1082. package/apps/studio/client/v2/preview/preview-history.js +61 -0
  1083. package/apps/studio/client/v2/preview/preview.css +262 -0
  1084. package/apps/studio/client/v2/preview/zoom-only.jsx +58 -0
  1085. package/apps/studio/client/v2/search/help-model.js +275 -0
  1086. package/apps/studio/client/v2/search/moved-keys.js +74 -0
  1087. package/apps/studio/client/v2/search/palette-icons.js +45 -0
  1088. package/apps/studio/client/v2/search/search-ds.js +142 -0
  1089. package/apps/studio/client/v2/search/search-env.js +110 -0
  1090. package/apps/studio/client/v2/search/search-keywords.js +162 -0
  1091. package/apps/studio/client/v2/search/search-model.js +623 -0
  1092. package/apps/studio/client/v2/search/search-projects.js +214 -0
  1093. package/apps/studio/client/v2/search/search-recent.js +94 -0
  1094. package/apps/studio/client/v2/search/search-remote.js +30 -0
  1095. package/apps/studio/client/v2/search/search.css +519 -0
  1096. package/apps/studio/client/v2/settings/account.jsx +164 -0
  1097. package/apps/studio/client/v2/settings/advanced-prefs.js +91 -0
  1098. package/apps/studio/client/v2/settings/advanced-section.jsx +308 -0
  1099. package/apps/studio/client/v2/settings/connection-row.jsx +79 -0
  1100. package/apps/studio/client/v2/settings/connections-model.js +138 -0
  1101. package/apps/studio/client/v2/settings/connections-section.jsx +663 -0
  1102. package/apps/studio/client/v2/settings/general-section.jsx +155 -0
  1103. package/apps/studio/client/v2/settings/parts.jsx +48 -0
  1104. package/apps/studio/client/v2/settings/prefs-migrate.js +141 -0
  1105. package/apps/studio/client/v2/settings/project-sync-settings.jsx +255 -0
  1106. package/apps/studio/client/v2/settings/reset-section.jsx +164 -0
  1107. package/apps/studio/client/v2/settings/settings-handlers.js +46 -0
  1108. package/apps/studio/client/v2/settings/settings-model.js +523 -0
  1109. package/apps/studio/client/v2/settings/settings-sheet.jsx +204 -0
  1110. package/apps/studio/client/v2/settings/settings.css +975 -0
  1111. package/apps/studio/client/v2/settings/theme-auto.js +75 -0
  1112. package/apps/studio/client/v2/settings/use-advanced-prefs.js +32 -0
  1113. package/apps/studio/client/v2/settings/use-connections.js +485 -0
  1114. package/apps/studio/client/v2/share/glyphs.jsx +92 -0
  1115. package/apps/studio/client/v2/share/invite-row.jsx +68 -0
  1116. package/apps/studio/client/v2/share/link-dialog.js +53 -0
  1117. package/apps/studio/client/v2/share/link-row.jsx +38 -0
  1118. package/apps/studio/client/v2/share/move-to-cloud.jsx +88 -0
  1119. package/apps/studio/client/v2/share/people-list.jsx +151 -0
  1120. package/apps/studio/client/v2/share/person.jsx +26 -0
  1121. package/apps/studio/client/v2/share/role-menu.jsx +145 -0
  1122. package/apps/studio/client/v2/share/share-advanced.jsx +411 -0
  1123. package/apps/studio/client/v2/share/share-model.js +469 -0
  1124. package/apps/studio/client/v2/share/share-sheet.jsx +602 -0
  1125. package/apps/studio/client/v2/share/share.css +828 -0
  1126. package/apps/studio/client/v2/shell/account-card-model.js +114 -0
  1127. package/apps/studio/client/v2/shell/account-card.jsx +177 -0
  1128. package/apps/studio/client/v2/shell/annotation-prefs-store.js +105 -0
  1129. package/apps/studio/client/v2/shell/ask-to-edit.js +33 -0
  1130. package/apps/studio/client/v2/shell/callouts-host.jsx +151 -0
  1131. package/apps/studio/client/v2/shell/callouts-model.js +358 -0
  1132. package/apps/studio/client/v2/shell/callouts.css +164 -0
  1133. package/apps/studio/client/v2/shell/callouts.jsx +162 -0
  1134. package/apps/studio/client/v2/shell/canvas-mode.js +393 -0
  1135. package/apps/studio/client/v2/shell/contrast.css +37 -0
  1136. package/apps/studio/client/v2/shell/corner-icons.jsx +153 -0
  1137. package/apps/studio/client/v2/shell/dock-rail-homes.js +106 -0
  1138. package/apps/studio/client/v2/shell/f6-cycle.js +124 -0
  1139. package/apps/studio/client/v2/shell/floating-panels.css +2858 -0
  1140. package/apps/studio/client/v2/shell/fold-ghost.js +70 -0
  1141. package/apps/studio/client/v2/shell/format-update.css +43 -0
  1142. package/apps/studio/client/v2/shell/format-update.js +487 -0
  1143. package/apps/studio/client/v2/shell/format-update.jsx +479 -0
  1144. package/apps/studio/client/v2/shell/held-conflict.js +51 -0
  1145. package/apps/studio/client/v2/shell/image-pick.js +140 -0
  1146. package/apps/studio/client/v2/shell/insets-now.js +35 -0
  1147. package/apps/studio/client/v2/shell/inspector-follow.js +113 -0
  1148. package/apps/studio/client/v2/shell/menu-runner.js +711 -0
  1149. package/apps/studio/client/v2/shell/modal-focus.js +259 -0
  1150. package/apps/studio/client/v2/shell/mode-switch.jsx +418 -0
  1151. package/apps/studio/client/v2/shell/native-doors.js +121 -0
  1152. package/apps/studio/client/v2/shell/occlusion-insets.js +116 -0
  1153. package/apps/studio/client/v2/shell/panel-availability.js +27 -0
  1154. package/apps/studio/client/v2/shell/panel-layout.js +144 -0
  1155. package/apps/studio/client/v2/shell/panel-sizes.js +150 -0
  1156. package/apps/studio/client/v2/shell/paste-forward.js +43 -0
  1157. package/apps/studio/client/v2/shell/present-from-label.js +19 -0
  1158. package/apps/studio/client/v2/shell/project-menu-model.js +216 -0
  1159. package/apps/studio/client/v2/shell/project-pill.css +214 -0
  1160. package/apps/studio/client/v2/shell/project-pill.jsx +456 -0
  1161. package/apps/studio/client/v2/shell/recovery-store.js +139 -0
  1162. package/apps/studio/client/v2/shell/role-denial.js +73 -0
  1163. package/apps/studio/client/v2/shell/role-gate.js +29 -0
  1164. package/apps/studio/client/v2/shell/save-hold-notice.js +69 -0
  1165. package/apps/studio/client/v2/shell/save-status.js +191 -0
  1166. package/apps/studio/client/v2/shell/scroll-lock.js +49 -0
  1167. package/apps/studio/client/v2/shell/share-cluster-host.jsx +389 -0
  1168. package/apps/studio/client/v2/shell/share-cluster.css +608 -0
  1169. package/apps/studio/client/v2/shell/share-cluster.jsx +255 -0
  1170. package/apps/studio/client/v2/shell/shell-error-boundary.jsx +81 -0
  1171. package/apps/studio/client/v2/shell/shell-panels-relay.js +95 -0
  1172. package/apps/studio/client/v2/shell/shell-parity.js +457 -0
  1173. package/apps/studio/client/v2/shell/shell-parity.json +2106 -0
  1174. package/apps/studio/client/v2/shell/single-keys-store.js +49 -0
  1175. package/apps/studio/client/v2/shell/tool-panels.css +39 -0
  1176. package/apps/studio/client/v2/shell/tool-panels.js +156 -0
  1177. package/apps/studio/client/v2/shell/use-account.js +59 -0
  1178. package/apps/studio/client/v2/shell/use-annotation-prefs.js +77 -0
  1179. package/apps/studio/client/v2/shell/use-canvas-mode-lane.js +388 -0
  1180. package/apps/studio/client/v2/shell/use-dismiss-outside.js +35 -0
  1181. package/apps/studio/client/v2/shell/use-fit-on-ai-pin.js +42 -0
  1182. package/apps/studio/client/v2/shell/use-fit-while-ai-drafts.js +37 -0
  1183. package/apps/studio/client/v2/shell/use-occluded-insets.js +107 -0
  1184. package/apps/studio/client/v2/shell/use-panel-layout.js +45 -0
  1185. package/apps/studio/client/v2/shell/use-single-keys.js +56 -0
  1186. package/apps/studio/client/v2/shell/use-tool-panels.js +205 -0
  1187. package/apps/studio/client/v2/signin/CreateLocalSheet.jsx +155 -0
  1188. package/apps/studio/client/v2/signin/SignInCard.jsx +284 -0
  1189. package/apps/studio/client/v2/signin/SignInToast.jsx +22 -0
  1190. package/apps/studio/client/v2/signin/WhatsNewLine.jsx +64 -0
  1191. package/apps/studio/client/v2/signin/advanced-rows.js +40 -0
  1192. package/apps/studio/client/v2/signin/signin-model.js +138 -0
  1193. package/apps/studio/client/v2/signin/signin.css +484 -0
  1194. package/apps/studio/client/v2/signin/use-signin.js +209 -0
  1195. package/apps/studio/client/v2/signin/use-whats-new-line.js +94 -0
  1196. package/apps/studio/client/v2/sync-states/back-online.jsx +61 -0
  1197. package/apps/studio/client/v2/sync-states/conflict-card.jsx +326 -0
  1198. package/apps/studio/client/v2/sync-states/offline-foot.jsx +79 -0
  1199. package/apps/studio/client/v2/sync-states/row-words.js +83 -0
  1200. package/apps/studio/client/v2/sync-states/sync-states-model.js +264 -0
  1201. package/apps/studio/client/v2/sync-states/sync-states.css +232 -0
  1202. package/apps/studio/client/v2/timeline/Timeline.jsx +3194 -0
  1203. package/apps/studio/client/v2/timeline/TimelineHost.jsx +360 -0
  1204. package/apps/studio/client/v2/timeline/advanced/actions.js +27 -0
  1205. package/apps/studio/client/v2/timeline/advanced/advanced-store.js +116 -0
  1206. package/apps/studio/client/v2/timeline/advanced/advanced.css +323 -0
  1207. package/apps/studio/client/v2/timeline/advanced/cut-as-code.jsx +127 -0
  1208. package/apps/studio/client/v2/timeline/advanced/easing-curve.jsx +200 -0
  1209. package/apps/studio/client/v2/timeline/advanced/foot.jsx +210 -0
  1210. package/apps/studio/client/v2/timeline/advanced/model.js +121 -0
  1211. package/apps/studio/client/v2/timeline/advanced/render-settings.jsx +62 -0
  1212. package/apps/studio/client/v2/timeline/advanced/video-cap.js +174 -0
  1213. package/apps/studio/client/v2/timeline/ai-edge-model.js +111 -0
  1214. package/apps/studio/client/v2/timeline/ai-edge.css +104 -0
  1215. package/apps/studio/client/v2/timeline/ai-edge.jsx +113 -0
  1216. package/apps/studio/client/v2/timeline/anchor-lane.js +80 -0
  1217. package/apps/studio/client/v2/timeline/anchor.js +80 -0
  1218. package/apps/studio/client/v2/timeline/assemble-video.js +64 -0
  1219. package/apps/studio/client/v2/timeline/clip-search.js +88 -0
  1220. package/apps/studio/client/v2/timeline/clip-verb.js +224 -0
  1221. package/apps/studio/client/v2/timeline/comment-strip-host.jsx +93 -0
  1222. package/apps/studio/client/v2/timeline/comment-strip-model.js +103 -0
  1223. package/apps/studio/client/v2/timeline/comment-strip.jsx +82 -0
  1224. package/apps/studio/client/v2/timeline/edit/clip-menu.js +118 -0
  1225. package/apps/studio/client/v2/timeline/edit/clip-menu.jsx +48 -0
  1226. package/apps/studio/client/v2/timeline/edit/drop.jsx +101 -0
  1227. package/apps/studio/client/v2/timeline/edit/move.jsx +43 -0
  1228. package/apps/studio/client/v2/timeline/edit/ripple.js +43 -0
  1229. package/apps/studio/client/v2/timeline/edit/trim.jsx +52 -0
  1230. package/apps/studio/client/v2/timeline/edit/words.js +65 -0
  1231. package/apps/studio/client/v2/timeline/fit-fill.jsx +172 -0
  1232. package/apps/studio/client/v2/timeline/fit-model.js +137 -0
  1233. package/apps/studio/client/v2/timeline/fold.js +128 -0
  1234. package/apps/studio/client/v2/timeline/footage-rows.jsx +46 -0
  1235. package/apps/studio/client/v2/timeline/footage-state.js +135 -0
  1236. package/apps/studio/client/v2/timeline/glyphs.jsx +118 -0
  1237. package/apps/studio/client/v2/timeline/island-context.js +29 -0
  1238. package/apps/studio/client/v2/timeline/island-controls.jsx +83 -0
  1239. package/apps/studio/client/v2/timeline/island.jsx +54 -0
  1240. package/apps/studio/client/v2/timeline/joins/join-model.js +133 -0
  1241. package/apps/studio/client/v2/timeline/joins/joins.css +277 -0
  1242. package/apps/studio/client/v2/timeline/joins/transition-picker.jsx +240 -0
  1243. package/apps/studio/client/v2/timeline/keys.js +74 -0
  1244. package/apps/studio/client/v2/timeline/lanes/caption-lane.jsx +149 -0
  1245. package/apps/studio/client/v2/timeline/lanes/music-lane.jsx +294 -0
  1246. package/apps/studio/client/v2/timeline/lanes/music-media.js +200 -0
  1247. package/apps/studio/client/v2/timeline/lanes/music-model.js +190 -0
  1248. package/apps/studio/client/v2/timeline/loop-handle.jsx +70 -0
  1249. package/apps/studio/client/v2/timeline/marker-store.js +117 -0
  1250. package/apps/studio/client/v2/timeline/markers.js +79 -0
  1251. package/apps/studio/client/v2/timeline/marks.jsx +152 -0
  1252. package/apps/studio/client/v2/timeline/music-hint.jsx +98 -0
  1253. package/apps/studio/client/v2/timeline/other-takes-model.js +103 -0
  1254. package/apps/studio/client/v2/timeline/other-takes-store.js +49 -0
  1255. package/apps/studio/client/v2/timeline/other-takes.css +98 -0
  1256. package/apps/studio/client/v2/timeline/other-takes.jsx +269 -0
  1257. package/apps/studio/client/v2/timeline/peers.jsx +246 -0
  1258. package/apps/studio/client/v2/timeline/playhead.js +97 -0
  1259. package/apps/studio/client/v2/timeline/poster.js +109 -0
  1260. package/apps/studio/client/v2/timeline/reframe-island.jsx +478 -0
  1261. package/apps/studio/client/v2/timeline/reframe-model.js +135 -0
  1262. package/apps/studio/client/v2/timeline/reframe.css +150 -0
  1263. package/apps/studio/client/v2/timeline/ruler.js +61 -0
  1264. package/apps/studio/client/v2/timeline/selection.js +110 -0
  1265. package/apps/studio/client/v2/timeline/timeline-empty.jsx +108 -0
  1266. package/apps/studio/client/v2/timeline/timeline-store.js +147 -0
  1267. package/apps/studio/client/v2/timeline/timeline.css +2879 -0
  1268. package/apps/studio/client/v2/timeline/together.css +85 -0
  1269. package/apps/studio/client/v2/timeline/track-toggle.js +56 -0
  1270. package/apps/studio/client/v2/timeline/tracks.js +68 -0
  1271. package/apps/studio/client/v2/timeline/transport.js +66 -0
  1272. package/apps/studio/client/v2/timeline/zoom.js +37 -0
  1273. package/apps/studio/client/v2/transcript/TranscriptHost.jsx +162 -0
  1274. package/apps/studio/client/v2/transcript/TranscriptPanel.jsx +358 -0
  1275. package/apps/studio/client/v2/transcript/captions-api.js +297 -0
  1276. package/apps/studio/client/v2/transcript/captions-file-flag.js +38 -0
  1277. package/apps/studio/client/v2/transcript/comp-media-store.js +89 -0
  1278. package/apps/studio/client/v2/transcript/transcript-model.js +240 -0
  1279. package/apps/studio/client/v2/transcript/transcript.css +262 -0
  1280. package/apps/studio/client/v2/undo/projection.js +291 -0
  1281. package/apps/studio/client/v2/undo/undo-history.jsx +286 -0
  1282. package/apps/studio/client/v2/undo/undo.css +81 -0
  1283. package/apps/studio/client/v2/undo/use-undo-mode-lane.js +96 -0
  1284. package/apps/studio/client/v2/undo/use-undo-projection.jsx +460 -0
  1285. package/apps/studio/client/v2/undo/zoom-undo.jsx +79 -0
  1286. package/apps/studio/client/whats-new-seen.js +40 -0
  1287. package/apps/studio/client/whats-new.jsx +65 -62
  1288. package/apps/studio/clip-ops.ts +38 -6
  1289. package/apps/studio/cloud/config-path.ts +42 -0
  1290. package/apps/studio/cloud/endpoints.ts +212 -50
  1291. package/apps/studio/cloud/renew.ts +29 -16
  1292. package/apps/studio/collab/ai-activity.ts +19 -0
  1293. package/apps/studio/collab/awareness-bridge.ts +131 -4
  1294. package/apps/studio/collab/git-lifecycle.ts +52 -20
  1295. package/apps/studio/collab/holds.ts +69 -0
  1296. package/apps/studio/collab/index.ts +25 -0
  1297. package/apps/studio/collab/protocol.ts +64 -0
  1298. package/apps/studio/collab/registry.ts +59 -6
  1299. package/apps/studio/collab/room.ts +374 -16
  1300. package/apps/studio/collab/timeline-awareness.ts +123 -0
  1301. package/apps/studio/collab/timeline-presence.tsx +219 -0
  1302. package/apps/studio/commands/move-artboards-command.ts +45 -4
  1303. package/apps/studio/comments/anchors.ts +147 -0
  1304. package/apps/studio/comments/author-face.ts +41 -0
  1305. package/apps/studio/comments/from-line.ts +43 -0
  1306. package/apps/studio/comments/imported-from.ts +113 -0
  1307. package/apps/studio/comments/local-author.ts +41 -0
  1308. package/apps/studio/comments/mentions.ts +115 -0
  1309. package/apps/studio/comments/mine-stamp.ts +78 -0
  1310. package/apps/studio/comments/ops.ts +293 -0
  1311. package/apps/studio/comments/people.ts +66 -0
  1312. package/apps/studio/comments/where.ts +136 -0
  1313. package/apps/studio/comments-overlay.tsx +1220 -253
  1314. package/apps/studio/config.schema.json +33 -0
  1315. package/apps/studio/context-menu.tsx +126 -42
  1316. package/apps/studio/context.ts +178 -13
  1317. package/apps/studio/cursors-overlay.tsx +28 -11
  1318. package/apps/studio/debug-bundle.ts +21 -5
  1319. package/apps/studio/describe/batch.ts +414 -0
  1320. package/apps/studio/describe/budget.ts +147 -0
  1321. package/apps/studio/describe/claude.ts +273 -0
  1322. package/apps/studio/describe/consent.ts +120 -0
  1323. package/apps/studio/describe/validate.ts +192 -0
  1324. package/apps/studio/design-setup-readiness.ts +2 -2
  1325. package/apps/studio/diagnostics/store.ts +220 -0
  1326. package/apps/studio/dist/client.bundle.js +2429 -2329
  1327. package/apps/studio/dist/comment-mount.js +12 -9
  1328. package/apps/studio/dist/styles.css +1 -1
  1329. package/apps/studio/dom-selection.ts +239 -23
  1330. package/apps/studio/drag-bus.ts +211 -0
  1331. package/apps/studio/draw/serialize-animate.ts +4 -4
  1332. package/apps/studio/ds/board/board-specimen.css +199 -0
  1333. package/apps/studio/ds/board/board.css +674 -0
  1334. package/apps/studio/ds/board/brand-notes.ts +92 -0
  1335. package/apps/studio/ds/board/build-model.ts +418 -0
  1336. package/apps/studio/ds/board/component-states.ts +111 -0
  1337. package/apps/studio/ds/board/directions-model.ts +145 -0
  1338. package/apps/studio/ds/board/directions.css +169 -0
  1339. package/apps/studio/ds/board/directions.tsx +100 -0
  1340. package/apps/studio/ds/board/ds-bar.tsx +107 -0
  1341. package/apps/studio/ds/board/index.tsx +71 -0
  1342. package/apps/studio/ds/board/logo-paint.ts +118 -0
  1343. package/apps/studio/ds/board/outline.tsx +127 -0
  1344. package/apps/studio/ds/board/parts.tsx +160 -0
  1345. package/apps/studio/ds/board/section-brand.tsx +148 -0
  1346. package/apps/studio/ds/board/section-colour.tsx +160 -0
  1347. package/apps/studio/ds/board/section-components.tsx +146 -0
  1348. package/apps/studio/ds/board/section-motion.tsx +106 -0
  1349. package/apps/studio/ds/board/section-patterns.tsx +89 -0
  1350. package/apps/studio/ds/board/section-space.tsx +109 -0
  1351. package/apps/studio/ds/board/section-type.tsx +129 -0
  1352. package/apps/studio/ds/board/specimen.tsx +61 -0
  1353. package/apps/studio/ds/board/state.ts +105 -0
  1354. package/apps/studio/ds/board/template.ts +152 -0
  1355. package/apps/studio/ds/board/types.ts +346 -0
  1356. package/apps/studio/ds/canvas-check.ts +914 -0
  1357. package/apps/studio/ds/canvas-cli.ts +346 -0
  1358. package/apps/studio/ds/check-system-verb.ts +88 -0
  1359. package/apps/studio/ds/check-system.ts +293 -0
  1360. package/apps/studio/ds/check.ts +541 -0
  1361. package/apps/studio/ds/cli.ts +348 -0
  1362. package/apps/studio/ds/component-list.ts +150 -0
  1363. package/apps/studio/ds/contrast.ts +438 -0
  1364. package/apps/studio/ds/convert-map.ts +126 -0
  1365. package/apps/studio/ds/convert.ts +603 -0
  1366. package/apps/studio/ds/css-scan.ts +292 -0
  1367. package/apps/studio/ds/default-components.tsx +377 -0
  1368. package/apps/studio/ds/default.ts +58 -0
  1369. package/apps/studio/ds/design-system.tsx.tpl +40 -0
  1370. package/apps/studio/ds/ds-resolver.ts +205 -0
  1371. package/apps/studio/ds/ds-verb.ts +563 -0
  1372. package/apps/studio/ds/edges.ts +412 -0
  1373. package/apps/studio/ds/emit.ts +217 -0
  1374. package/apps/studio/ds/engine.ts +1652 -0
  1375. package/apps/studio/ds/fallbacks.ts +116 -0
  1376. package/apps/studio/ds/generate.ts +746 -0
  1377. package/apps/studio/ds/head.ts +372 -0
  1378. package/apps/studio/ds/instance-info.ts +90 -0
  1379. package/apps/studio/ds/library.ts +1137 -0
  1380. package/apps/studio/ds/make.ts +726 -0
  1381. package/apps/studio/ds/migrate-emitter.ts +42 -0
  1382. package/apps/studio/ds/nearest.ts +163 -0
  1383. package/apps/studio/ds/outside.ts +343 -0
  1384. package/apps/studio/ds/override-map.ts +213 -0
  1385. package/apps/studio/ds/pairing-css.ts +145 -0
  1386. package/apps/studio/ds/pin-scope.ts +268 -0
  1387. package/apps/studio/ds/registry.ts +228 -0
  1388. package/apps/studio/ds/rename.ts +104 -0
  1389. package/apps/studio/ds/render-rev.ts +144 -0
  1390. package/apps/studio/ds/revision.ts +268 -0
  1391. package/apps/studio/ds/shell-fallbacks.ts +84 -0
  1392. package/apps/studio/ds/switch.ts +426 -0
  1393. package/apps/studio/ds/system-files.ts +251 -0
  1394. package/apps/studio/ds/system.ts +312 -0
  1395. package/apps/studio/ds/undo-hook.ts +46 -0
  1396. package/apps/studio/ds/upgrade-apply.ts +258 -0
  1397. package/apps/studio/ds/upgrade-cli.ts +216 -0
  1398. package/apps/studio/ds/upgrade-codemod.ts +116 -0
  1399. package/apps/studio/ds/upgrade-progress.ts +153 -0
  1400. package/apps/studio/ds/upgrade-prove.ts +429 -0
  1401. package/apps/studio/ds/upgrade-stage.ts +387 -0
  1402. package/apps/studio/ds/upgrade.ts +394 -0
  1403. package/apps/studio/ds/value-types.ts +190 -0
  1404. package/apps/studio/edit-ops/align.ts +43 -0
  1405. package/apps/studio/edit-ops/arrange.ts +93 -0
  1406. package/apps/studio/edit-ops/artboard-facts.ts +70 -0
  1407. package/apps/studio/edit-ops/artboard-resize.ts +50 -0
  1408. package/apps/studio/edit-ops/artboard-trash.ts +77 -0
  1409. package/apps/studio/edit-ops/clear-link.ts +16 -0
  1410. package/apps/studio/edit-ops/clip/captions.ts +154 -0
  1411. package/apps/studio/edit-ops/clip/comp.ts +124 -0
  1412. package/apps/studio/edit-ops/clip/cut-source-range.ts +100 -0
  1413. package/apps/studio/edit-ops/clip/cut-to-beat.ts +136 -0
  1414. package/apps/studio/edit-ops/clip/duck.ts +123 -0
  1415. package/apps/studio/edit-ops/clip/easing.ts +76 -0
  1416. package/apps/studio/edit-ops/clip/formats.ts +163 -0
  1417. package/apps/studio/edit-ops/clip/gestures.ts +161 -0
  1418. package/apps/studio/edit-ops/clip/index.ts +543 -0
  1419. package/apps/studio/edit-ops/clip/jsx.ts +251 -0
  1420. package/apps/studio/edit-ops/clip/place.ts +127 -0
  1421. package/apps/studio/edit-ops/clip/reframe.ts +194 -0
  1422. package/apps/studio/edit-ops/clip/take-swap.ts +53 -0
  1423. package/apps/studio/edit-ops/clip/title-motion.ts +103 -0
  1424. package/apps/studio/edit-ops/clip/title-style.ts +177 -0
  1425. package/apps/studio/edit-ops/clip/track.ts +102 -0
  1426. package/apps/studio/edit-ops/clipboard.ts +482 -0
  1427. package/apps/studio/edit-ops/combine.ts +264 -0
  1428. package/apps/studio/edit-ops/constraints.ts +148 -0
  1429. package/apps/studio/edit-ops/convert-kind.ts +203 -0
  1430. package/apps/studio/edit-ops/corner-radius.ts +86 -0
  1431. package/apps/studio/edit-ops/crop.ts +303 -0
  1432. package/apps/studio/edit-ops/czech-ties.ts +84 -0
  1433. package/apps/studio/edit-ops/detach-instance.ts +119 -0
  1434. package/apps/studio/edit-ops/dispatch.ts +552 -0
  1435. package/apps/studio/edit-ops/distribute.ts +31 -0
  1436. package/apps/studio/edit-ops/ds-instance-update.ts +46 -0
  1437. package/apps/studio/edit-ops/ds-use-nearest.ts +72 -0
  1438. package/apps/studio/edit-ops/duplicate-at-width.ts +241 -0
  1439. package/apps/studio/edit-ops/frame.ts +68 -0
  1440. package/apps/studio/edit-ops/guides.ts +67 -0
  1441. package/apps/studio/edit-ops/hide.ts +30 -0
  1442. package/apps/studio/edit-ops/hover-rules.ts +94 -0
  1443. package/apps/studio/edit-ops/image-fit.ts +571 -0
  1444. package/apps/studio/edit-ops/insert-component.ts +344 -0
  1445. package/apps/studio/edit-ops/insert-preset.ts +151 -0
  1446. package/apps/studio/edit-ops/insert-shape.ts +326 -0
  1447. package/apps/studio/edit-ops/instance-model.ts +286 -0
  1448. package/apps/studio/edit-ops/instance-tree.ts +215 -0
  1449. package/apps/studio/edit-ops/layout-patch.ts +81 -0
  1450. package/apps/studio/edit-ops/lock.ts +30 -0
  1451. package/apps/studio/edit-ops/op-label.ts +155 -0
  1452. package/apps/studio/edit-ops/path-model.ts +671 -0
  1453. package/apps/studio/edit-ops/path.ts +172 -0
  1454. package/apps/studio/edit-ops/photo-every-use.ts +64 -0
  1455. package/apps/studio/edit-ops/photo-use.ts +41 -0
  1456. package/apps/studio/edit-ops/place-freely.ts +47 -0
  1457. package/apps/studio/edit-ops/place-plan.ts +60 -0
  1458. package/apps/studio/edit-ops/print.ts +104 -0
  1459. package/apps/studio/edit-ops/references.ts +231 -0
  1460. package/apps/studio/edit-ops/relink.ts +49 -0
  1461. package/apps/studio/edit-ops/reorder.ts +104 -0
  1462. package/apps/studio/edit-ops/reset-overrides.ts +75 -0
  1463. package/apps/studio/edit-ops/revert.ts +63 -0
  1464. package/apps/studio/edit-ops/rotate.ts +58 -0
  1465. package/apps/studio/edit-ops/safe-zones.ts +38 -0
  1466. package/apps/studio/edit-ops/scope-names.ts +151 -0
  1467. package/apps/studio/edit-ops/select-matching.ts +48 -0
  1468. package/apps/studio/edit-ops/set-gap.ts +65 -0
  1469. package/apps/studio/edit-ops/set-id.ts +42 -0
  1470. package/apps/studio/edit-ops/set-link.ts +39 -0
  1471. package/apps/studio/edit-ops/siblings.ts +105 -0
  1472. package/apps/studio/edit-ops/slot-defaults.ts +48 -0
  1473. package/apps/studio/edit-ops/stamp.ts +27 -0
  1474. package/apps/studio/edit-ops/swap-variant.ts +163 -0
  1475. package/apps/studio/edit-ops/text-copy.ts +146 -0
  1476. package/apps/studio/edit-ops/text-detach.ts +62 -0
  1477. package/apps/studio/edit-ops/text-style-ops.ts +131 -0
  1478. package/apps/studio/edit-ops/text-style.ts +141 -0
  1479. package/apps/studio/edit-ops/tidy.ts +72 -0
  1480. package/apps/studio/edit-ops/types.ts +229 -0
  1481. package/apps/studio/edit-ops/unframe.ts +53 -0
  1482. package/apps/studio/edit-ops/words-css.ts +487 -0
  1483. package/apps/studio/edit-ops/words-paint.ts +521 -0
  1484. package/apps/studio/edit-ops/z-order.ts +81 -0
  1485. package/apps/studio/editing/ai-point-ring.tsx +158 -0
  1486. package/apps/studio/editing/ai-scope-outline.tsx +180 -0
  1487. package/apps/studio/editing/align-bar.tsx +510 -0
  1488. package/apps/studio/editing/anchor-report.ts +123 -0
  1489. package/apps/studio/editing/anchor-reporter.tsx +64 -0
  1490. package/apps/studio/editing/aria-live.tsx +162 -0
  1491. package/apps/studio/editing/arrange.ts +345 -0
  1492. package/apps/studio/editing/artboard-actions.ts +275 -0
  1493. package/apps/studio/editing/artboard-commands.tsx +232 -0
  1494. package/apps/studio/editing/artboard-guides.tsx +265 -0
  1495. package/apps/studio/editing/artboard-handles.tsx +524 -0
  1496. package/apps/studio/editing/artboard-menu.tsx +153 -0
  1497. package/apps/studio/editing/artboard-resize.ts +306 -0
  1498. package/apps/studio/editing/ask-bubble.tsx +161 -0
  1499. package/apps/studio/editing/asset-drag.ts +70 -0
  1500. package/apps/studio/editing/click-to-type.ts +207 -0
  1501. package/apps/studio/editing/clipboard-actions.ts +91 -0
  1502. package/apps/studio/editing/clipboard.ts +194 -0
  1503. package/apps/studio/editing/clipped-grab.ts +45 -0
  1504. package/apps/studio/editing/corner-dots.tsx +394 -0
  1505. package/apps/studio/editing/crop-geometry.ts +128 -0
  1506. package/apps/studio/editing/crop-mode.tsx +522 -0
  1507. package/apps/studio/editing/crumbs.ts +158 -0
  1508. package/apps/studio/editing/draw-geometry.ts +151 -0
  1509. package/apps/studio/editing/draw-tools.tsx +490 -0
  1510. package/apps/studio/editing/drop-chip.tsx +105 -0
  1511. package/apps/studio/editing/duplicate-rhythm.ts +166 -0
  1512. package/apps/studio/editing/edit-chrome-gate.tsx +58 -0
  1513. package/apps/studio/editing/edit-op.ts +90 -0
  1514. package/apps/studio/editing/empty-report.ts +182 -0
  1515. package/apps/studio/editing/empty-reporter.tsx +74 -0
  1516. package/apps/studio/editing/figma-paste.ts +71 -0
  1517. package/apps/studio/editing/finder-drop-model.ts +130 -0
  1518. package/apps/studio/editing/finder-drop.tsx +400 -0
  1519. package/apps/studio/editing/focus-model.tsx +429 -0
  1520. package/apps/studio/editing/gap-bands.tsx +257 -0
  1521. package/apps/studio/editing/hold-rings.tsx +461 -0
  1522. package/apps/studio/editing/image-drop.tsx +193 -0
  1523. package/apps/studio/editing/index.tsx +402 -0
  1524. package/apps/studio/editing/instance-actions.ts +152 -0
  1525. package/apps/studio/editing/kids-summary.ts +75 -0
  1526. package/apps/studio/editing/kind-dim.tsx +54 -0
  1527. package/apps/studio/editing/layout-actions.ts +159 -0
  1528. package/apps/studio/editing/lock-badge.tsx +178 -0
  1529. package/apps/studio/editing/long-page.ts +102 -0
  1530. package/apps/studio/editing/minimap-context.tsx +161 -0
  1531. package/apps/studio/editing/nudge.tsx +212 -0
  1532. package/apps/studio/editing/object-actions.ts +156 -0
  1533. package/apps/studio/editing/object-keys.ts +58 -0
  1534. package/apps/studio/editing/object-menu.tsx +216 -0
  1535. package/apps/studio/editing/object-ops.ts +114 -0
  1536. package/apps/studio/editing/paste-bar.tsx +388 -0
  1537. package/apps/studio/editing/pen/combine-run.ts +113 -0
  1538. package/apps/studio/editing/pen/draw.tsx +364 -0
  1539. package/apps/studio/editing/pen/index.tsx +48 -0
  1540. package/apps/studio/editing/pen/overlay.tsx +147 -0
  1541. package/apps/studio/editing/pen/pen-geometry.ts +234 -0
  1542. package/apps/studio/editing/pen/point-store.ts +64 -0
  1543. package/apps/studio/editing/pen/points.tsx +421 -0
  1544. package/apps/studio/editing/place-freely.tsx +389 -0
  1545. package/apps/studio/editing/place-ghost.tsx +418 -0
  1546. package/apps/studio/editing/place-image.tsx +219 -0
  1547. package/apps/studio/editing/preset-ruler.tsx +218 -0
  1548. package/apps/studio/editing/rename-order.ts +58 -0
  1549. package/apps/studio/editing/reorder-slot.tsx +567 -0
  1550. package/apps/studio/editing/rotate-handle.tsx +353 -0
  1551. package/apps/studio/editing/selection.tsx +319 -0
  1552. package/apps/studio/editing/set-gap.ts +55 -0
  1553. package/apps/studio/editing/size-ghost.tsx +343 -0
  1554. package/apps/studio/editing/space-tap.ts +56 -0
  1555. package/apps/studio/editing/sticky-name.tsx +112 -0
  1556. package/apps/studio/editing/tab-order.tsx +298 -0
  1557. package/apps/studio/editing/take-keys.ts +115 -0
  1558. package/apps/studio/editing/text-actions.ts +214 -0
  1559. package/apps/studio/editing/text-in-place.tsx +187 -0
  1560. package/apps/studio/editing/tidy-preview.tsx +83 -0
  1561. package/apps/studio/editing/token-ruler.tsx +231 -0
  1562. package/apps/studio/editing/type-role.ts +122 -0
  1563. package/apps/studio/editing/undo-preview.tsx +120 -0
  1564. package/apps/studio/editing/video-label.ts +66 -0
  1565. package/apps/studio/editing/video-play.ts +65 -0
  1566. package/apps/studio/editing/world-menu.ts +36 -0
  1567. package/apps/studio/element-ids.ts +1030 -0
  1568. package/apps/studio/equal-spacing-handles.tsx +1 -1
  1569. package/apps/studio/exporters/_runtime.ts +64 -24
  1570. package/apps/studio/exporters/audio.ts +136 -0
  1571. package/apps/studio/exporters/door-fingerprint.ts +202 -0
  1572. package/apps/studio/exporters/estimate.ts +314 -0
  1573. package/apps/studio/exporters/file-names.ts +197 -0
  1574. package/apps/studio/exporters/format-scopes.ts +7 -1
  1575. package/apps/studio/exporters/hub-render-door.ts +368 -0
  1576. package/apps/studio/exporters/index.ts +53 -7
  1577. package/apps/studio/exporters/jobs.ts +484 -80
  1578. package/apps/studio/exporters/jpg.ts +21 -0
  1579. package/apps/studio/exporters/pdf-fonts.ts +102 -0
  1580. package/apps/studio/exporters/pdf.ts +133 -14
  1581. package/apps/studio/exporters/png.ts +136 -9
  1582. package/apps/studio/exporters/print-back.ts +92 -0
  1583. package/apps/studio/exporters/print-preflight.ts +373 -0
  1584. package/apps/studio/exporters/rects-runner.ts +130 -0
  1585. package/apps/studio/exporters/remote.ts +726 -3
  1586. package/apps/studio/exporters/render-seconds.ts +57 -0
  1587. package/apps/studio/exporters/replay.ts +48 -0
  1588. package/apps/studio/exporters/scope.ts +560 -15
  1589. package/apps/studio/exporters/spec-run.ts +270 -0
  1590. package/apps/studio/exporters/spec-v2.ts +408 -0
  1591. package/apps/studio/exporters/video-cap.ts +280 -0
  1592. package/apps/studio/exporters/wait-ai.ts +192 -0
  1593. package/apps/studio/figma/client.ts +67 -0
  1594. package/apps/studio/figma/comments-to-pins.ts +249 -0
  1595. package/apps/studio/figma/comments-to-strokes.ts +6 -1
  1596. package/apps/studio/figma/into-board.ts +141 -0
  1597. package/apps/studio/figma/to-strokes.ts +54 -0
  1598. package/apps/studio/format.ts +172 -30
  1599. package/apps/studio/fs-watch.ts +28 -1
  1600. package/apps/studio/generation/adapters/gemini.ts +3 -0
  1601. package/apps/studio/generation/adapters/stub.ts +133 -0
  1602. package/apps/studio/generation/gen-sidecar.ts +108 -0
  1603. package/apps/studio/generation/registry.ts +16 -5
  1604. package/apps/studio/generation/takes.ts +398 -0
  1605. package/apps/studio/generation/types.ts +7 -0
  1606. package/apps/studio/git/service.ts +143 -14
  1607. package/apps/studio/github/endpoints.ts +1 -1
  1608. package/apps/studio/github/identity-cache.ts +53 -14
  1609. package/apps/studio/handoff/blockers.ts +120 -0
  1610. package/apps/studio/handoff/run.ts +233 -0
  1611. package/apps/studio/handoff/targets.ts +334 -0
  1612. package/apps/studio/handoff/write-scopes.ts +57 -0
  1613. package/apps/studio/handoff.ts +24 -5
  1614. package/apps/studio/history/changes.ts +199 -0
  1615. package/apps/studio/history/describe-annotations.ts +216 -0
  1616. package/apps/studio/history/describe-css.ts +592 -0
  1617. package/apps/studio/history/describe-match.ts +866 -0
  1618. package/apps/studio/history/describe-meta.ts +281 -0
  1619. package/apps/studio/history/describe-version.ts +89 -0
  1620. package/apps/studio/history/describe-words.ts +513 -0
  1621. package/apps/studio/history/describe.ts +1452 -0
  1622. package/apps/studio/history/last-good.ts +123 -0
  1623. package/apps/studio/history/links.ts +112 -0
  1624. package/apps/studio/history/object-history.ts +535 -0
  1625. package/apps/studio/history/render-ok-signal.ts +81 -0
  1626. package/apps/studio/history/restore-artboard-action.ts +183 -0
  1627. package/apps/studio/history/restore-artboard.ts +607 -0
  1628. package/apps/studio/history/restore-object.ts +168 -0
  1629. package/apps/studio/history/run-label.ts +18 -0
  1630. package/apps/studio/history/surface-requests.ts +115 -0
  1631. package/apps/studio/history/titles.ts +259 -0
  1632. package/apps/studio/history/trash.ts +314 -0
  1633. package/apps/studio/history/version-lanes.ts +115 -0
  1634. package/apps/studio/history/versions.ts +458 -0
  1635. package/apps/studio/hmr-broadcast.ts +55 -1
  1636. package/apps/studio/home/ai.ts +79 -0
  1637. package/apps/studio/home/cli.ts +221 -0
  1638. package/apps/studio/home/cloud.ts +297 -0
  1639. package/apps/studio/home/create-local.ts +164 -0
  1640. package/apps/studio/home/github.ts +99 -0
  1641. package/apps/studio/home/hub.ts +340 -0
  1642. package/apps/studio/home/index-gc.ts +288 -0
  1643. package/apps/studio/home/index-reader.ts +338 -0
  1644. package/apps/studio/home/invite.ts +204 -0
  1645. package/apps/studio/home/main.ts +159 -0
  1646. package/apps/studio/home/pid.ts +12 -0
  1647. package/apps/studio/home/routes.ts +591 -0
  1648. package/apps/studio/home/signin.ts +285 -0
  1649. package/apps/studio/home/user-state.ts +177 -0
  1650. package/apps/studio/home/whats-new.ts +42 -0
  1651. package/apps/studio/http.ts +2589 -947
  1652. package/apps/studio/index/assets-response.ts +34 -0
  1653. package/apps/studio/index/assets.ts +335 -0
  1654. package/apps/studio/index/ds-usage.ts +983 -0
  1655. package/apps/studio/index/extract.ts +348 -0
  1656. package/apps/studio/index/extractors/asset-usage.ts +349 -0
  1657. package/apps/studio/index/extractors/attribution-cache.ts +225 -0
  1658. package/apps/studio/index/history-refs.ts +301 -0
  1659. package/apps/studio/index/history-source.ts +39 -0
  1660. package/apps/studio/index/match.ts +307 -0
  1661. package/apps/studio/index/scan-kick.ts +47 -0
  1662. package/apps/studio/index/service.ts +367 -0
  1663. package/apps/studio/index/snapshot.ts +135 -0
  1664. package/apps/studio/index/types.ts +139 -0
  1665. package/apps/studio/index/version-feed.ts +71 -0
  1666. package/apps/studio/input-router.tsx +522 -55
  1667. package/apps/studio/inspect-canvas.ts +86 -0
  1668. package/apps/studio/inspect-overlay.tsx +192 -0
  1669. package/apps/studio/inspect.ts +96 -33
  1670. package/apps/studio/kinds/convert.ts +175 -0
  1671. package/apps/studio/kinds/export-defaults.ts +42 -0
  1672. package/apps/studio/kinds/meta.ts +237 -0
  1673. package/apps/studio/kinds/physical.ts +84 -0
  1674. package/apps/studio/kinds/presets.ts +452 -0
  1675. package/apps/studio/kinds/print-custom.ts +165 -0
  1676. package/apps/studio/kinds/print-edit.ts +130 -0
  1677. package/apps/studio/kinds/print-guides.ts +23 -0
  1678. package/apps/studio/kinds/safe-zones.ts +250 -0
  1679. package/apps/studio/kinds/warnings.ts +422 -0
  1680. package/apps/studio/layer-name.ts +148 -0
  1681. package/apps/studio/layout/free-space.ts +131 -0
  1682. package/apps/studio/link-chip-overlay.tsx +175 -0
  1683. package/apps/studio/link-import.ts +617 -0
  1684. package/apps/studio/loopback-listen.ts +105 -0
  1685. package/apps/studio/macro-guard.ts +67 -0
  1686. package/apps/studio/managed-projects.ts +63 -14
  1687. package/apps/studio/marquee-overlay.tsx +2 -2
  1688. package/apps/studio/measure-overlay.tsx +10 -4
  1689. package/apps/studio/migrate/cli.ts +164 -0
  1690. package/apps/studio/migrate/ds-registry.ts +42 -0
  1691. package/apps/studio/migrate/engine.ts +926 -0
  1692. package/apps/studio/migrate/hub.ts +219 -0
  1693. package/apps/studio/migrate/steps.ts +627 -0
  1694. package/apps/studio/notifications.tsx +197 -52
  1695. package/apps/studio/outbox/content.ts +139 -0
  1696. package/apps/studio/outbox/drain.ts +269 -0
  1697. package/apps/studio/outbox/hub-reachability.ts +58 -0
  1698. package/apps/studio/outbox/index.ts +57 -0
  1699. package/apps/studio/outbox/policy.ts +859 -0
  1700. package/apps/studio/outbox/senders/export-cloud.ts +116 -0
  1701. package/apps/studio/outbox/store.ts +336 -0
  1702. package/apps/studio/outbox/types.ts +160 -0
  1703. package/apps/studio/participants-chrome.tsx +178 -60
  1704. package/apps/studio/paths.ts +8 -0
  1705. package/apps/studio/photo-store.ts +230 -1
  1706. package/apps/studio/port.ts +93 -0
  1707. package/apps/studio/presence/canvas-presence.tsx +522 -0
  1708. package/apps/studio/presence/fields.ts +93 -0
  1709. package/apps/studio/presence/model.ts +296 -0
  1710. package/apps/studio/presence/tones.ts +39 -0
  1711. package/apps/studio/present/fit.ts +138 -0
  1712. package/apps/studio/present/follow.ts +142 -0
  1713. package/apps/studio/present/media-presence.ts +105 -0
  1714. package/apps/studio/present/meta-schema.ts +612 -0
  1715. package/apps/studio/present/order.ts +153 -0
  1716. package/apps/studio/present/pointer-dot.tsx +379 -0
  1717. package/apps/studio/present/pointer-point.ts +24 -0
  1718. package/apps/studio/present/present-media.ts +446 -0
  1719. package/apps/studio/present/present-stage.tsx +1018 -0
  1720. package/apps/studio/present/present-zoom.ts +63 -0
  1721. package/apps/studio/present/relay-strip.ts +136 -0
  1722. package/apps/studio/preview/preview-camera.tsx +442 -0
  1723. package/apps/studio/preview/wheel-scroll.ts +85 -0
  1724. package/apps/studio/print/units.ts +3 -0
  1725. package/apps/studio/print-overlay-content.tsx +127 -10
  1726. package/apps/studio/read-only-mode.ts +83 -0
  1727. package/apps/studio/readiness.ts +18 -3
  1728. package/apps/studio/ripple.ts +19 -1
  1729. package/apps/studio/routes/agent.ts +1025 -0
  1730. package/apps/studio/routes/ai.ts +422 -0
  1731. package/apps/studio/routes/annotations.ts +649 -0
  1732. package/apps/studio/routes/asset-details.ts +87 -0
  1733. package/apps/studio/routes/asset-rename.ts +60 -0
  1734. package/apps/studio/routes/asset-state.ts +137 -0
  1735. package/apps/studio/routes/asset-trash.ts +77 -0
  1736. package/apps/studio/routes/assets.ts +217 -0
  1737. package/apps/studio/routes/availability.ts +94 -0
  1738. package/apps/studio/routes/canvas-meta-rider.ts +304 -0
  1739. package/apps/studio/routes/canvas-origin.ts +88 -0
  1740. package/apps/studio/routes/canvas-source.ts +315 -0
  1741. package/apps/studio/routes/chat-attach.ts +335 -0
  1742. package/apps/studio/routes/chat.ts +137 -0
  1743. package/apps/studio/routes/cloud-move.ts +364 -0
  1744. package/apps/studio/routes/cloud-plan.ts +36 -0
  1745. package/apps/studio/routes/comments.ts +118 -0
  1746. package/apps/studio/routes/connections.ts +132 -0
  1747. package/apps/studio/routes/describe.ts +122 -0
  1748. package/apps/studio/routes/diagnostics.ts +118 -0
  1749. package/apps/studio/routes/ds-check.ts +124 -0
  1750. package/apps/studio/routes/ds-convert.ts +55 -0
  1751. package/apps/studio/routes/ds-edges.ts +136 -0
  1752. package/apps/studio/routes/ds-library.ts +194 -0
  1753. package/apps/studio/routes/ds-make.ts +91 -0
  1754. package/apps/studio/routes/ds-switch.ts +68 -0
  1755. package/apps/studio/routes/ds-upgrade.ts +139 -0
  1756. package/apps/studio/routes/ds.ts +808 -0
  1757. package/apps/studio/routes/edit.ts +658 -0
  1758. package/apps/studio/routes/element-links.ts +155 -0
  1759. package/apps/studio/routes/export.ts +486 -0
  1760. package/apps/studio/routes/figma.ts +200 -0
  1761. package/apps/studio/routes/generate.ts +443 -0
  1762. package/apps/studio/routes/handoff.ts +319 -0
  1763. package/apps/studio/routes/help-guides.ts +37 -0
  1764. package/apps/studio/routes/history.ts +739 -0
  1765. package/apps/studio/routes/import-link.ts +186 -0
  1766. package/apps/studio/routes/index.ts +293 -0
  1767. package/apps/studio/routes/kinds.ts +257 -0
  1768. package/apps/studio/routes/links.ts +72 -0
  1769. package/apps/studio/routes/outbox.ts +87 -0
  1770. package/apps/studio/routes/photo-every-use.ts +241 -0
  1771. package/apps/studio/routes/pins.ts +66 -0
  1772. package/apps/studio/routes/present.ts +187 -0
  1773. package/apps/studio/routes/project-format.ts +148 -0
  1774. package/apps/studio/routes/project-undo.ts +497 -0
  1775. package/apps/studio/routes/settings.ts +179 -0
  1776. package/apps/studio/routes/share.ts +463 -0
  1777. package/apps/studio/routes/shell.ts +137 -0
  1778. package/apps/studio/routes/sync-conflicts.ts +150 -0
  1779. package/apps/studio/routes/sync.ts +172 -0
  1780. package/apps/studio/routes/table.ts +224 -0
  1781. package/apps/studio/routes/trash.ts +393 -0
  1782. package/apps/studio/routes/video.ts +395 -0
  1783. package/apps/studio/routes/votes.ts +486 -0
  1784. package/apps/studio/safe-zones-overlay.tsx +269 -0
  1785. package/apps/studio/scaffold-design.ts +72 -124
  1786. package/apps/studio/schema/annotations.v2.schema.json +2303 -0
  1787. package/apps/studio/schema/beats.v1.schema.json +94 -0
  1788. package/apps/studio/schema/canvas-meta.v2.schema.json +264 -0
  1789. package/apps/studio/schema/canvas-tsx.md +357 -0
  1790. package/apps/studio/schema/comments.v2.schema.json +125 -0
  1791. package/apps/studio/schema/ds-components-v1.schema.json +96 -0
  1792. package/apps/studio/schema/ds-formats.md +146 -0
  1793. package/apps/studio/schema/ds-head-v1.schema.json +67 -0
  1794. package/apps/studio/schema/ds-revision-v1.schema.json +31 -0
  1795. package/apps/studio/schema/ds-schema-v1.fallbacks.css +118 -0
  1796. package/apps/studio/schema/ds-schema-v1.json +2029 -0
  1797. package/apps/studio/schema/ds-schema-v1.schema.json +663 -0
  1798. package/apps/studio/schema/ds-tokens-v1.schema.json +210 -0
  1799. package/apps/studio/schema/edl.v1.schema.json +124 -0
  1800. package/apps/studio/schema/formats.ts +175 -0
  1801. package/apps/studio/schema/gen.v1.schema.json +33 -0
  1802. package/apps/studio/schema/transcript.v1.schema.json +133 -0
  1803. package/apps/studio/server.ts +454 -166
  1804. package/apps/studio/shell/info-file.ts +54 -0
  1805. package/apps/studio/shell/parent-watch.ts +97 -0
  1806. package/apps/studio/shell/profile.ts +61 -0
  1807. package/apps/studio/shell-canvas-file.ts +36 -0
  1808. package/apps/studio/skip-dirs.ts +455 -0
  1809. package/apps/studio/spoof-chars.ts +17 -0
  1810. package/apps/studio/static-lane.ts +212 -0
  1811. package/apps/studio/sync/accepted-cold-start.ts +35 -13
  1812. package/apps/studio/sync/accepted-link.ts +524 -27
  1813. package/apps/studio/sync/access-notices.ts +143 -0
  1814. package/apps/studio/sync/action-feed.ts +145 -0
  1815. package/apps/studio/sync/action-stage.ts +831 -165
  1816. package/apps/studio/sync/asset-push.ts +24 -2
  1817. package/apps/studio/sync/asset-state.ts +391 -0
  1818. package/apps/studio/sync/atomic-write.ts +42 -1
  1819. package/apps/studio/sync/availability.ts +185 -0
  1820. package/apps/studio/sync/canvas-path.ts +70 -6
  1821. package/apps/studio/sync/cell-pairing.ts +5 -24
  1822. package/apps/studio/sync/comment-door.ts +104 -0
  1823. package/apps/studio/sync/conflict-record.ts +186 -0
  1824. package/apps/studio/sync/create-collision.ts +297 -0
  1825. package/apps/studio/sync/ctl-provider.ts +16 -1
  1826. package/apps/studio/sync/file-ledger.ts +12 -0
  1827. package/apps/studio/sync/file-membership.ts +123 -10
  1828. package/apps/studio/sync/file-plane.ts +195 -12
  1829. package/apps/studio/sync/format-sync.ts +13 -7
  1830. package/apps/studio/sync/history-fields.ts +61 -0
  1831. package/apps/studio/sync/hub-link.ts +24 -4
  1832. package/apps/studio/sync/hub-text-undo.ts +178 -0
  1833. package/apps/studio/sync/hubs-config.ts +122 -20
  1834. package/apps/studio/sync/index.ts +1499 -128
  1835. package/apps/studio/sync/journal-client.ts +56 -0
  1836. package/apps/studio/sync/keep-both.ts +187 -0
  1837. package/apps/studio/sync/link-consent.ts +390 -0
  1838. package/apps/studio/sync/local-kernel.ts +2725 -0
  1839. package/apps/studio/sync/media-gate.ts +97 -0
  1840. package/apps/studio/sync/object-conflict.ts +199 -0
  1841. package/apps/studio/sync/poke.ts +50 -0
  1842. package/apps/studio/sync/presentation.ts +20 -2
  1843. package/apps/studio/sync/project-config-push.ts +5 -2
  1844. package/apps/studio/sync/projection.ts +208 -34
  1845. package/apps/studio/sync/resync-trace.ts +220 -0
  1846. package/apps/studio/sync/retry-after.ts +27 -0
  1847. package/apps/studio/sync/status.ts +16 -1
  1848. package/apps/studio/sync/supervisor.ts +20 -2
  1849. package/apps/studio/sync/transaction-client.ts +364 -34
  1850. package/apps/studio/sync/trash-clear-copies.ts +120 -0
  1851. package/apps/studio/sync/trash-watch.ts +157 -0
  1852. package/apps/studio/sync/trash.ts +50 -2
  1853. package/apps/studio/sync/undo-target.ts +110 -0
  1854. package/apps/studio/sync/workspace-signin.ts +14 -3
  1855. package/apps/studio/sync/write-hold.ts +238 -0
  1856. package/apps/studio/sync/writer-registry.ts +380 -5
  1857. package/apps/studio/sync-name-key.ts +59 -0
  1858. package/apps/studio/thumbs/keys.ts +147 -0
  1859. package/apps/studio/thumbs/routes.ts +68 -0
  1860. package/apps/studio/thumbs/service.ts +884 -0
  1861. package/apps/studio/thumbs/store.ts +114 -0
  1862. package/apps/studio/thumbs/validate.ts +62 -0
  1863. package/apps/studio/tool-palette.tsx +782 -563
  1864. package/apps/studio/toolbars/marker-tip.ts +22 -0
  1865. package/apps/studio/toolbars/shell-panels.ts +55 -0
  1866. package/apps/studio/toolbars/tool-panel.ts +89 -0
  1867. package/apps/studio/toolbars/toolbar-css.ts +283 -0
  1868. package/apps/studio/toolbars/toolbar-icons.tsx +135 -0
  1869. package/apps/studio/toolbars/toolbar-rect.ts +82 -0
  1870. package/apps/studio/ui-prefs-migrate.ts +467 -0
  1871. package/apps/studio/ui-prefs.ts +305 -3
  1872. package/apps/studio/undo-stack.ts +10 -0
  1873. package/apps/studio/use-annotation-resize.tsx +23 -17
  1874. package/apps/studio/use-artboard-drag.tsx +156 -15
  1875. package/apps/studio/use-canvas-keys.ts +58 -0
  1876. package/apps/studio/use-chrome-visibility.tsx +13 -0
  1877. package/apps/studio/use-collab.tsx +556 -56
  1878. package/apps/studio/use-element-resize.tsx +13 -9
  1879. package/apps/studio/use-governed-mode.ts +23 -0
  1880. package/apps/studio/use-keyboard-discipline.tsx +114 -49
  1881. package/apps/studio/use-selection-set.tsx +110 -9
  1882. package/apps/studio/use-snap-guides.tsx +74 -5
  1883. package/apps/studio/use-spacing-handles.tsx +90 -27
  1884. package/apps/studio/use-tool-mode.tsx +204 -10
  1885. package/apps/studio/use-undo-stack.tsx +19 -23
  1886. package/apps/studio/video/beats.ts +484 -0
  1887. package/apps/studio/video/decode-webaudio.ts +115 -0
  1888. package/apps/studio/video/decode.ts +288 -0
  1889. package/apps/studio/video/derive.ts +647 -0
  1890. package/apps/studio/video/format-ids.ts +158 -0
  1891. package/apps/studio/video/framing.ts +246 -0
  1892. package/apps/studio/video/inject.ts +324 -0
  1893. package/apps/studio/video/keyframes.ts +356 -0
  1894. package/apps/studio/video/link-groups.ts +40 -0
  1895. package/apps/studio/video/linked-formats.ts +142 -0
  1896. package/apps/studio/video/mask-comments.ts +36 -0
  1897. package/apps/studio/video/media-analysis.ts +169 -0
  1898. package/apps/studio/video/reel-place.ts +286 -0
  1899. package/apps/studio/video/reframe-read.ts +90 -0
  1900. package/apps/studio/video/schema.ts +422 -0
  1901. package/apps/studio/video/speech.ts +129 -0
  1902. package/apps/studio/video/title-motion.ts +85 -0
  1903. package/apps/studio/video/transcript-cut.ts +91 -0
  1904. package/apps/studio/video/whisper-parse.ts +123 -0
  1905. package/apps/studio/video/words-run.ts +210 -0
  1906. package/apps/studio/video/words-timing.ts +222 -0
  1907. package/apps/studio/video-comp.tsx +238 -9
  1908. package/apps/studio/video-links-overlay.tsx +272 -0
  1909. package/apps/studio/video-natural.ts +73 -0
  1910. package/apps/studio/video-play-chrome.tsx +229 -0
  1911. package/apps/studio/video-play-overlay.tsx +190 -0
  1912. package/apps/studio/video-vocab.tsx +460 -0
  1913. package/apps/studio/view-only-gesture.tsx +101 -0
  1914. package/apps/studio/viewport-fit.ts +28 -0
  1915. package/apps/studio/web-overlay-content.tsx +4 -2
  1916. package/apps/studio/whats-new.json +100 -20
  1917. package/apps/studio/whats-new.schema.json +10 -0
  1918. package/apps/studio/whats-new.ts +4 -0
  1919. package/apps/studio/workspace-mode.ts +10 -0
  1920. package/apps/studio/ws.ts +299 -8
  1921. package/cli/bin/maude.mjs +1 -0
  1922. package/cli/commands/design.mjs +401 -72
  1923. package/cli/commands/flow.mjs +12 -1
  1924. package/cli/commands/help.mjs +8 -0
  1925. package/cli/commands/migrate.mjs +55 -0
  1926. package/cli/lib/bash-guard.mjs +1691 -0
  1927. package/cli/lib/confine-out.mjs +150 -0
  1928. package/cli/lib/confine-read.mjs +179 -0
  1929. package/cli/lib/confine-root.mjs +157 -0
  1930. package/cli/lib/design-help.gen.mjs +119 -0
  1931. package/cli/lib/design-hook.mjs +1764 -0
  1932. package/cli/lib/design-link.mjs +68 -4
  1933. package/cli/lib/design-open.mjs +238 -0
  1934. package/cli/lib/export-spec.mjs +394 -0
  1935. package/cli/lib/finding-text.mjs +63 -0
  1936. package/cli/lib/flow-usage.mjs +6 -10
  1937. package/cli/lib/gitignore-block.mjs +1 -0
  1938. package/cli/lib/handoff.mjs +285 -0
  1939. package/cli/lib/handoff.schema.json +336 -0
  1940. package/cli/lib/hubs-config.mjs +10 -0
  1941. package/cli/lib/json-schema-lite.mjs +260 -0
  1942. package/cli/lib/project-links.mjs +88 -0
  1943. package/cli/lib/studio-locate.mjs +83 -0
  1944. package/cli/lib/sub-verbs.mjs +111 -0
  1945. package/cli/lib/workspace-plan.mjs +16 -3
  1946. package/package.json +29 -10
  1947. package/plugins/design/README.md +46 -0
  1948. package/plugins/design/templates/_shell.html +749 -69
  1949. package/plugins/design/templates/blank-canvas.tsx.template +26 -0
  1950. package/plugins/design/templates/brief-board.tsx.template +12 -11
  1951. package/plugins/design/templates/canvas.tsx.template +3 -3
  1952. package/plugins/design/templates/design-system-inspiration/core/README.philosophy.md.tpl +104 -0
  1953. package/plugins/design/templates/design-system-inspiration/core/colors_and_type.css.tpl +38 -3
  1954. package/plugins/design/templates/design-system-inspiration/core/components.json.tpl +127 -0
  1955. package/plugins/design/templates/design-system-inspiration/core/config.json.tpl +1 -0
  1956. package/plugins/design/templates/design-system-inspiration/core/preview/_components.css.tpl +111 -0
  1957. package/plugins/flow/.claude-plugin/config.schema.json +6 -1
  1958. package/apps/studio/annotations/ui/edit-actions.ts +0 -551
  1959. package/apps/studio/canvas-header.ts +0 -165
  1960. package/apps/studio/client/hmr.mjs +0 -113
  1961. package/apps/studio/client/hooks/use-keyboard-shortcuts.jsx +0 -297
  1962. package/apps/studio/client/iframe-lazy.mjs +0 -121
  1963. package/apps/studio/client/inspector/artboard-knobs.jsx +0 -456
  1964. package/apps/studio/client/menus/menubar.jsx +0 -856
  1965. package/apps/studio/client/panels/CapabilityBar.jsx +0 -101
  1966. package/apps/studio/client/panels/ClipInspector.jsx +0 -409
  1967. package/apps/studio/client/panels/GitPanel.jsx +0 -1026
  1968. package/apps/studio/client/panels/OnboardingWizard.jsx +0 -642
  1969. package/apps/studio/client/panels/StickerPicker.jsx +0 -160
  1970. package/apps/studio/client/panels/SyncPanel.jsx +0 -1190
  1971. package/apps/studio/client/panels/TimelinePanel.jsx +0 -2259
  1972. package/apps/studio/client/share-dialog.jsx +0 -91
  1973. package/apps/studio/client/shell/collapsed-rail.jsx +0 -23
  1974. package/apps/studio/client/shell/status-bar.jsx +0 -215
  1975. package/apps/studio/client/styles/1-tokens-maude.css +0 -296
  1976. package/apps/studio/client/styles/1-tokens.css +0 -304
  1977. package/apps/studio/client/styles/3-shell-maude.css +0 -3158
  1978. package/apps/studio/client/styles/3-shell.css +0 -1036
  1979. package/apps/studio/client/styles/4-components-maude.css +0 -134
  1980. package/apps/studio/client/styles/4-components.css +0 -2204
  1981. package/apps/studio/client/styles/5-maude-overrides.css +0 -162
  1982. package/apps/studio/client/styles.css +0 -1264
  1983. package/apps/studio/contextual-toolbar.tsx +0 -512
  1984. package/apps/studio/export-dialog.tsx +0 -827
  1985. package/apps/studio/undo-hud.tsx +0 -16
@@ -0,0 +1,3194 @@
1
+ // TimelinePanel — DDR-148 bottom timeline for a video-comp, restructured by
2
+ // feature-enhanced-video-editing into the iMovie model:
3
+ //
4
+ // • ONE px-per-frame scale (timeline-scale.js) drives every block, handle,
5
+ // tick, and drag — zoom from fit-to-width down to single-frame ticks
6
+ // (⌘+/⌘−, pinch, header slider, `0` = fit), horizontal scroll when the
7
+ // content outgrows the viewport (Task 4);
8
+ // • a three-band layout for series comps: overlay lane above, ONE storyline
9
+ // lane of series beats butted side-by-side (transitions as ⧓ seam chips),
10
+ // audio lane below. Non-series comps keep the stacked row-per-sequence
11
+ // fallback (Task 5);
12
+ // • single-select (stableId) with the accent outline; click selects, the
13
+ // bare track scrubs + deselects; Esc/Delete live in the shell keyboard
14
+ // layer (Task 3).
15
+ //
16
+ // It drives the embedded Player via postMessage (`dgn: 'timeline-seek' |
17
+ // -play | -pause`), consumed by video-comp.tsx.
18
+
19
+ import { Fragment, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
20
+ import { portalToBody } from '../portal-scope.jsx';
21
+
22
+ import { isSilentVideo, timelineKindOf } from '../inspector/kinds/clip-model.js';
23
+ import { foldStore } from '../fold/use-fold.js';
24
+ import {
25
+ AdvancedFoot,
26
+ advancedStore,
27
+ trackKey,
28
+ useAdvanced,
29
+ useAdvancedOpen,
30
+ } from './advanced/foot.jsx';
31
+ import { clock, frameTick, timecode } from './advanced/model.js';
32
+ import {
33
+ bindCapTarget,
34
+ capView,
35
+ loadMaxFrames,
36
+ maxFramesOf,
37
+ saveMaxFrames,
38
+ CAP_CEILING,
39
+ useCapVersion,
40
+ } from './advanced/video-cap.js';
41
+ import { FitFillAsk, useFitFill } from './fit-fill.jsx';
42
+ import { joinTitle, stillSecond, tileOfPresentation } from './joins/join-model.js';
43
+ import { TransitionPicker } from './joins/transition-picker.jsx';
44
+ import { MusicLaneOverlay, musicSelection, useMusicLane } from './lanes/music-lane.jsx';
45
+ import { trackToggle } from './track-toggle.js';
46
+ import { MusicHint, MusicTool } from './music-hint.jsx';
47
+ import { TGlyph } from './glyphs.jsx';
48
+ import { CaptionLane, CaptionsTool } from './lanes/caption-lane.jsx';
49
+ import { reasonProps } from '../access/disabled-reason.js';
50
+ import { Person } from '../share/person.jsx';
51
+ import { RulerMarks } from './marks.jsx';
52
+ import { PeerHeads } from './peers.jsx';
53
+ import { timelineSelection } from './selection.js';
54
+ import { useTimelineIsland } from './island-context.js';
55
+ import { AiCutStatus, AiEdge, useAiCut } from './ai-edge.jsx';
56
+ import { LoopHandle } from './loop-handle.jsx';
57
+ import { usePlayback } from './playhead.js';
58
+ import { mss, readoutLabel, rulerLabel, rulerStepFrames } from './ruler.js';
59
+ import { deriveTracks } from './tracks.js';
60
+ import { isBand } from './transport.js';
61
+ import { KeptStatus, SharedStatus, SizeButton } from './island-controls.jsx';
62
+ import { OtherTakesHost } from './other-takes.jsx';
63
+ import { ReframeHost } from './reframe-island.jsx';
64
+ import { bindClips } from './clip-search.js';
65
+ import { FOLD_WORDS, FOLDABLE, trackFold, useFoldVersion } from './fold.js';
66
+ import { bindMarkerSource, loadMarkers, markersOf, useMarkersVersion } from './marker-store.js';
67
+ import {
68
+ clipNameWithState,
69
+ FOOTAGE_WORDS,
70
+ footageForSrc,
71
+ preparingChip,
72
+ preparingCount,
73
+ useFootageAnswers,
74
+ } from './footage-state.js';
75
+ import { clipTip, nameVisible } from './zoom.js';
76
+ import { ClipMenu } from './edit/clip-menu.jsx';
77
+ import { ArtboardDropCatcher, DropLanding, fileCount } from './edit/drop.jsx';
78
+ import { landingOf, MoveLanding } from './edit/move.jsx';
79
+ import { TrimTip } from './edit/trim.jsx';
80
+ import { computeSnapTargets, snapFrame } from '../../panels/timeline-snap.js';
81
+ import { activeComp } from '../../panels/timeline-comp-target.js';
82
+ import {
83
+ getFilmstrip,
84
+ getPeaks,
85
+ peaksToPath,
86
+ probeMediaDuration,
87
+ stripBucket,
88
+ } from '../../panels/timeline-media-cache.js';
89
+ import {
90
+ clampPxPerFrame,
91
+ fitPxPerFrame,
92
+ MAX_PX_PER_FRAME,
93
+ pxToFrame,
94
+ ZOOM_STEP,
95
+ zoomAroundScroll,
96
+ } from '../../panels/timeline-scale.js';
97
+ // DDR-150 dogfood #6 — per-row media-kind identity so the timeline reads like
98
+ // an editor: what's footage, what's a still, what's audio, what's plain JSX.
99
+ function rowKind(seq) {
100
+ if (seq.placeholder) return 'placeholder';
101
+ const t = seq.mediaTag;
102
+ if (t === 'Video' || t === 'OffthreadVideo' || t === 'MaudeVideo') return 'video';
103
+ if (t === 'Img') return 'image';
104
+ if (t === 'Audio') return 'audio';
105
+ return 'jsx';
106
+ }
107
+ /** The name a clip goes by in words ("Oslava", never a content-hash file name): "Clip N" when it has none. */
108
+ function displayNameOf(seq, i) {
109
+ // P8 C3 (07 · ve-text) — a title goes by its words (timeline-parse.js `text`), never by "AbsoluteFill"
110
+ if (seq.text) return seq.text;
111
+ // p8-t-video-2 — a named clip goes by its name: the dropped file's ("IMG_5120"), an AI cut's shot ("Tackle 2")
112
+ if (
113
+ typeof seq.stableId === 'string' &&
114
+ seq.stableId.startsWith('name:') &&
115
+ seq.stableId.length > 5
116
+ )
117
+ return seq.stableId.slice(5);
118
+ const raw =
119
+ ['Video', 'OffthreadVideo', 'Audio', 'Img', 'MaudeVideo', 'MaudeAudio', 'MaudeImg'].includes(
120
+ seq.label
121
+ ) && seq.mediaSrc
122
+ ? String(seq.mediaSrc).split('/').pop()
123
+ : seq.label;
124
+ return /^[a-f0-9]{6,16}\.\w+$/i.test(raw || '') ? `Clip ${i + 1}` : raw;
125
+ }
126
+ const clamp = (n, lo, hi) => Math.max(lo, Math.min(hi, n));
127
+
128
+ /** A song's name in words: its file name without the extension ("Hype instrumental.mp3" → "Hype instrumental"). */
129
+ const songName = (label) => String(label ?? '').replace(/\.[a-z0-9]{2,4}$/i, '') || 'Music';
130
+
131
+ /** P8 C3 (07 · .ve-wave) — deterministic bars (the board's `wave()`), one per ~1.1 % of the clip, as the stand-in
132
+ * until the real peaks are read. */
133
+ function WaveBars({ width, seed = 1 }) {
134
+ const n = clamp(Math.round(width / 5), 4, 240);
135
+ const bars = [];
136
+ for (let k = 0; k < n; k++) {
137
+ const h = 0.25 + 0.75 * Math.abs(Math.sin(k * 0.61 * seed + 1.3) * Math.cos(k * 0.17 + seed));
138
+ bars.push(<i key={k} style={{ height: `${Math.round(h * 100)}%` }} />);
139
+ }
140
+ return (
141
+ <span className="tl-wave-bars" aria-hidden="true">
142
+ {bars}
143
+ </span>
144
+ );
145
+ }
146
+
147
+ /** A length in words, one decimal ("2.5 s"). */
148
+ const secs = (frames, fps) => `${Math.round((frames / (fps || 30)) * 10) / 10} s`;
149
+ /** A moment in words — m:ss, like the ruler (words.js header rule: never "10.10s"). */
150
+ function fmtTime(frame, fps) {
151
+ return mss(frame / (fps || 30));
152
+ }
153
+
154
+ /**
155
+ * Drag state its own release handler reads synchronously. The releases used
156
+ * to commit from INSIDE a state updater (`setX((d) => { commit(d); … })`), and
157
+ * React is free to run an updater more than once — StrictMode does it on
158
+ * purpose, and a render replayed against a concurrent update may too — so one
159
+ * drag could write its clip twice. Updaters passed to `set` run once, here,
160
+ * against the live value; the release commits outside any updater.
161
+ */
162
+ function useLiveState(initial) {
163
+ const [state, setState] = useState(initial);
164
+ const live = useRef(initial);
165
+ const set = useCallback((next) => {
166
+ live.current = typeof next === 'function' ? next(live.current) : next;
167
+ setState(live.current);
168
+ }, []);
169
+ return [state, set, live];
170
+ }
171
+
172
+ // The frame axis starts AFTER the label gutter: P8 C3 (07 · .ve-tl-labs) — a 22 px column of track chips in compact,
173
+ // 132 px of chip + name in full, then the lanes' 8 px gap.
174
+ const COMPACT_GUTTER = 30;
175
+ const FULL_GUTTER = 140;
176
+ // Padding the .tl-scroll container puts around the tracks (timeline.css: 3 px a side, room for the selection ring).
177
+ const SCROLL_PAD_X = 6;
178
+ /** Split's own line when nothing is under the playhead (the shell's toast, app.jsx `onSplitAtPlayhead`). */
179
+ const SPLIT_NOTHING = 'Nothing under the playhead to split.';
180
+
181
+ export default function TimelinePanel({
182
+ comps = [],
183
+ // issue #75 — the comp the shell's transport targets. The panel reads its
184
+ // meta (fps / duration) off the SAME comp, so the readout can never describe
185
+ // a different artboard than the one Play actually moves.
186
+ compId = null,
187
+ sequences = [],
188
+ audio = [],
189
+ transitions = [],
190
+ total = 0,
191
+ frame = 0,
192
+ playing = false,
193
+ loop = false,
194
+ onSeek,
195
+ onPlay,
196
+ onPause,
197
+ onToggleLoop,
198
+ muted = false,
199
+ onToggleMute,
200
+ volume = 1,
201
+ onVolume,
202
+ height,
203
+ resizing,
204
+ onResize,
205
+ onRetime,
206
+ onRemove,
207
+ onReplace,
208
+ onReplaceAudio,
209
+ onReplaceLayer,
210
+ onReorder,
211
+ // Task 6 — magnetic drag commit: (movedClipRef, targetClipRef, 'before'|'after').
212
+ onReorderMove,
213
+ onToggleHide,
214
+ onDropMedia,
215
+ onClose,
216
+ // Task 3 — single-select model. `selectedClipId` is the selected clip's
217
+ // stableId (survives refetch/reorder, unlike an index); click selects,
218
+ // empty-track click deselects, Esc/Delete are handled by the shell.
219
+ selectedClipId = null,
220
+ onSelect,
221
+ // Task 7 — resolves a comp-relative media src (`assets/x.mp4`) to a URL the
222
+ // shell origin can fetch (`/<designRel>/assets/x.mp4`).
223
+ resolveMediaUrl,
224
+ // Phase 2 — transitions from the enumerator (stableId + contentHash), by
225
+ // seam order, for the ⧓ chip → Transition tab flow.
226
+ transitionClips = [],
227
+ // Phase 2 — parametric verb commit: (clipRef, verb, params).
228
+ onClipVerb,
229
+ // Phase 3 — toolbar entries: scissors + overlay authoring.
230
+ onSplitAtPlayhead,
231
+ onAddTitle,
232
+ onAddImage,
233
+ // Phase 4 — AI placeholder authoring + resolution (DDR-164 spine).
234
+ onAddAiClip,
235
+ onGeneratePlaceholder,
236
+ // Task 23 — timeline comments (frame-anchored 💬 pins + agent context).
237
+ comments = [],
238
+ // WKWebView-safe text ask: (title, initial?) => Promise<string|null>.
239
+ promptText,
240
+ onAddComment,
241
+ onResolveComment,
242
+ onDeleteComment,
243
+ }) {
244
+ // DDR-150 dogfood — layer expansion (stacked-rows fallback mode only; the
245
+ // storyline layout moves layer detail into the clip inspector).
246
+ const [collapsed, setCollapsed] = useState(() => new Set());
247
+ const [dropActive, setDropActive] = useState(false);
248
+ const comp = activeComp(comps, compId);
249
+ // issue #75 — which artboard the rows + transport belong to. `null` means the
250
+ // shell genuinely could NOT tell (a comp mounted outside any artboard, a
251
+ // resolver fall-through). That case must render as an explicit unknown, not
252
+ // as no chip at all: "no chip" already means "single comp, nothing to
253
+ // disambiguate", and reusing it for "I don't know" would make the ambiguous
254
+ // case look like the safe one (security-review 2026-08-12).
255
+ const scopedArtboard = comp?.artboardLabel || comp?.artboardId || null;
256
+ const totalFrames = Math.max(1, total || comp?.durationInFrames || 1);
257
+ const fps = comp?.fps ?? 30;
258
+ // the threads this video's strip draws: the frame-anchored ones (`timeline`) and the timed pins on THIS video
259
+ // (`t` seconds + the video's artboard id — comments/where.ts); another video's pins are not ours
260
+ const stripComments = (comments || []).filter(
261
+ (c) =>
262
+ c &&
263
+ (c.timeline ||
264
+ (typeof c.t === 'number' &&
265
+ Number.isFinite(c.t) &&
266
+ (!comp?.artboardId || c.artboard === comp.artboardId)))
267
+ );
268
+ const clamped = clamp(Math.round(frame), 0, totalFrames - 1);
269
+ const trackRef = useRef(null);
270
+ const scrollRef = useRef(null);
271
+ const draggingRef = useRef(false);
272
+ const rootRef = useRef(null);
273
+ // S7.7 — the island around this body (null when it stands alone): the empty-comp block lives there.
274
+ const island = useTimelineIsland();
275
+ // p8-sweep-leftovers — a video with no clip has nothing to split or caption: those tools rest and say why.
276
+ const noClips = sequences.length === 0 && audio.length === 0;
277
+ // P8 C3 — the board's two sizes: compact (the narrow icon gutter, no zoom, no Advanced) and full. A body with
278
+ // no island around it is the full one.
279
+ const full = !island || island.size === 'full';
280
+ const gutter = full ? FULL_GUTTER : COMPACT_GUTTER;
281
+ // S7.14 — an AI cut on this video: its edge, the shot that landed, the status chip (from the run's progress)
282
+ const aiCut = useAiCut({
283
+ activePath: island?.canvas ?? null,
284
+ artboardId: comp?.artboardId ?? null,
285
+ compKey: `${total}:${sequences.length}`,
286
+ });
287
+ // S7.8 — the loop band (I / O) and whether the playhead was just stepped by hand live in one store the keys write.
288
+ const playback = usePlayback();
289
+ const band = compId ? playback.loopFor(compId) : null;
290
+ const poster = Number.isFinite(island?.poster) ? island.poster : null;
291
+ // the default poster (poster.js: absent = 35 % of the length)
292
+ const posterAt = clamp(poster ?? Math.round(totalFrames * 0.35), 0, totalFrames - 1);
293
+ // S7.18 — Advanced at the foot (frames, keyframes, the cut as code), the asked-for empty tracks, and how long
294
+ // one export of this video may be (C22). The fold is the shared `timeline` Advanced fold.
295
+ const advOpen = useAdvancedOpen();
296
+ const haveRef = useRef([]);
297
+ const trackInfoRef = useRef({ counts: {}, labels: {} }); // S7.16 — what `timeline.fold-track` folds
298
+ const adv = useAdvanced();
299
+ useCapVersion();
300
+ const capFile = island?.canvas ?? null;
301
+ const capId = comp?.artboardId ?? null;
302
+ useEffect(() => {
303
+ if (capFile && capId) void loadMaxFrames(capFile, capId);
304
+ bindCapTarget(() =>
305
+ capFile && capId
306
+ ? { file: capFile, artboardId: capId, have: haveRef.current, ...trackInfoRef.current }
307
+ : null
308
+ );
309
+ return () => bindCapTarget(null);
310
+ }, [capFile, capId]);
311
+ const cap = capView({
312
+ frames: totalFrames,
313
+ fps,
314
+ stored: capFile && capId ? maxFramesOf(capFile, capId) : null,
315
+ label: scopedArtboard ?? 'This video',
316
+ });
317
+ const extraTracks = adv.tracks[trackKey(capFile, capId)] ?? [];
318
+ // Focus the dock the moment it opens — the transport shortcuts live on the
319
+ // SHELL window and need shell focus (see the pre-restructure history).
320
+ useEffect(() => {
321
+ rootRef.current?.focus();
322
+ }, []);
323
+
324
+ // -------------------------------------------------------------------------
325
+ // Task 4 — zoom state. `zoomPxf == null` means fit-to-width (the default);
326
+ // any explicit value is clamped to [fit, MAX_PX_PER_FRAME].
327
+ const [zoomPxf, setZoomPxf] = useState(null);
328
+ const [viewW, setViewW] = useState(0);
329
+ // The scroll container mounts LATER than the panel (only once a comp is
330
+ // announced) — capture it via a callback ref so the ResizeObserver attaches
331
+ // whenever it (re)appears, not just on the panel's first render.
332
+ const [scrollEl, setScrollEl] = useState(null);
333
+ const setScrollRef = useCallback((el) => {
334
+ scrollRef.current = el;
335
+ setScrollEl(el);
336
+ }, []);
337
+ useLayoutEffect(() => {
338
+ if (!scrollEl) return undefined;
339
+ const measure = () => setViewW(scrollEl.clientWidth);
340
+ measure();
341
+ // WKWebView occasionally reports 0 on the mount frame (before layout
342
+ // settles) and the ResizeObserver never re-fires — the "zoom stopped
343
+ // working" symptom (fit-scale computed against a 40px axis). Re-measure on
344
+ // rAF until a real width lands.
345
+ let raf = 0;
346
+ const retry = () => {
347
+ if (scrollEl.clientWidth > 0) measure();
348
+ else raf = requestAnimationFrame(retry);
349
+ };
350
+ if (scrollEl.clientWidth <= 0) raf = requestAnimationFrame(retry);
351
+ const ro = new ResizeObserver(measure);
352
+ ro.observe(scrollEl);
353
+ return () => {
354
+ ro.disconnect();
355
+ if (raf) cancelAnimationFrame(raf);
356
+ };
357
+ }, [scrollEl]);
358
+ const axisViewport = Math.max(40, viewW - gutter - SCROLL_PAD_X);
359
+ const fitPxf = fitPxPerFrame(axisViewport, totalFrames);
360
+ const pxf = zoomPxf == null ? fitPxf : clampPxPerFrame(zoomPxf, axisViewport, totalFrames);
361
+ const axisPx = Math.ceil(totalFrames * pxf);
362
+ const x = (f) => f * pxf; // axis-relative px for a frame
363
+
364
+ // Scroll compensation applied after a zoom (keeps the anchor stationary).
365
+ const pendingScrollRef = useRef(null);
366
+ useLayoutEffect(() => {
367
+ if (pendingScrollRef.current == null) return;
368
+ const el = scrollRef.current;
369
+ if (el) el.scrollLeft = pendingScrollRef.current;
370
+ pendingScrollRef.current = null;
371
+ });
372
+
373
+ /** Zoom to `nextPxf` keeping `anchorFrame` (default: playhead, or selection)
374
+ * at the same viewport x. */
375
+ const zoomTo = useCallback(
376
+ (nextRaw, anchorFrame) => {
377
+ const el = scrollRef.current;
378
+ const next = clampPxPerFrame(nextRaw, axisViewport, totalFrames);
379
+ const anchor =
380
+ anchorFrame != null
381
+ ? anchorFrame
382
+ : (sequences.find((s) => s.stableId && s.stableId === selectedClipId)?.from ?? clamped);
383
+ if (el) pendingScrollRef.current = zoomAroundScroll(pxf, next, anchor, el.scrollLeft);
384
+ setZoomPxf(next <= fitPxf ? null : next);
385
+ },
386
+ [axisViewport, totalFrames, pxf, fitPxf, clamped, sequences, selectedClipId]
387
+ );
388
+
389
+ // ⌘+/⌘− zoom · 0 = fit. Window-level (the dock is a sibling of the canvas),
390
+ // gated on not-typing; ⌘± deliberately overrides browser zoom while the
391
+ // timeline is open (the documented keyboard map).
392
+ useEffect(() => {
393
+ const onKey = (e) => {
394
+ const t = e.target;
395
+ const tag = t?.tagName;
396
+ if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || t?.isContentEditable) return;
397
+ if ((e.metaKey || e.ctrlKey) && (e.key === '=' || e.key === '+')) {
398
+ e.preventDefault();
399
+ zoomTo(pxf * ZOOM_STEP);
400
+ } else if ((e.metaKey || e.ctrlKey) && e.key === '-') {
401
+ e.preventDefault();
402
+ zoomTo(pxf / ZOOM_STEP);
403
+ } else if (e.key === '0' && !e.metaKey && !e.ctrlKey && !e.altKey) {
404
+ setZoomPxf(null);
405
+ } else if ((e.key === 'c' || e.key === 'C') && !e.metaKey && !e.ctrlKey && !e.altKey) {
406
+ // The C comment tool (mirrors the artboard's comment shortcut).
407
+ setCommentMode((m) => !m);
408
+ } else if (e.key === 'Escape') {
409
+ setCommentMode(false);
410
+ }
411
+ };
412
+ window.addEventListener('keydown', onKey);
413
+ return () => window.removeEventListener('keydown', onKey);
414
+ }, [pxf, zoomTo]);
415
+
416
+ // Pinch-zoom (trackpad pinch arrives as wheel + ctrlKey) around the cursor.
417
+ // Non-passive listener — preventDefault must actually stop the page zoom.
418
+ useEffect(() => {
419
+ const el = scrollRef.current;
420
+ if (!el) return undefined;
421
+ const onWheel = (e) => {
422
+ if (!e.ctrlKey && !e.metaKey) return; // plain wheel = native scroll
423
+ e.preventDefault();
424
+ const rect = trackRef.current?.getBoundingClientRect();
425
+ const anchor =
426
+ rect != null
427
+ ? clamp(Math.round(pxToFrame(e.clientX - rect.left - gutter, pxf)), 0, totalFrames - 1)
428
+ : clamped;
429
+ zoomTo(pxf * Math.exp(-e.deltaY * 0.01), anchor);
430
+ };
431
+ el.addEventListener('wheel', onWheel, { passive: false });
432
+ return () => el.removeEventListener('wheel', onWheel);
433
+ }, [pxf, clamped, totalFrames, zoomTo, scrollEl, gutter]);
434
+
435
+ // Header slider — log scale from fit (0) to MAX_PX_PER_FRAME (100).
436
+ const zoomSliderValue = (() => {
437
+ const ratio = Math.log(pxf / fitPxf) / Math.log(MAX_PX_PER_FRAME / Math.max(1e-6, fitPxf));
438
+ return clamp(Math.round((Number.isFinite(ratio) ? ratio : 0) * 100), 0, 100);
439
+ })();
440
+ const zoomFromSlider = (v) => {
441
+ const ratio = clamp(v, 0, 100) / 100;
442
+ return fitPxf * (MAX_PX_PER_FRAME / Math.max(1e-6, fitPxf)) ** ratio;
443
+ };
444
+
445
+ // -------------------------------------------------------------------------
446
+ // Drag machines (retime / move) — px-per-frame based.
447
+ const [retimeDrag, setRetimeDrag, retimeLive] = useLiveState(null);
448
+ const [moveDrag, setMoveDrag, moveLive] = useLiveState(null);
449
+ // Task 6 — magnetic storyline reorder drag: { index, slot, targetSlot, dx, pxf }.
450
+ const [reorderDrag, setReorderDrag, reorderLive] = useLiveState(null);
451
+ // Debate verdict (feedback): a momentary accent rule at the frame a drag just
452
+ // snapped to — magnetism is otherwise invisible. { frame } | null.
453
+ const [snapFlash, setSnapFlash] = useState(null);
454
+ const snapFlashTimer = useRef(null);
455
+ const flashSnap = useCallback((frame) => {
456
+ setSnapFlash({ frame });
457
+ clearTimeout(snapFlashTimer.current);
458
+ snapFlashTimer.current = setTimeout(() => setSnapFlash(null), 350);
459
+ }, []);
460
+ // Task 6 — file-drop insertion caret: { lane, slot?, frame?, x } (axis px).
461
+ const [dropCaret, setDropCaret] = useState(null);
462
+ // Dogfood (2026-07-30) — the C comment tool: while armed, a click anywhere on
463
+ // the timeline pins a comment to the exact frame (+ clip + lane when the
464
+ // click lands on a block) instead of scrubbing/selecting.
465
+ const [commentMode, setCommentMode] = useState(false);
466
+ // Dogfood (2026-07-30) — vertical layer reorder: dragging an overlay row's
467
+ // lane chip up/down re-stacks the standalone clips (z-order = doc order).
468
+ const [layerDrag, setLayerDrag, layerLive] = useLiveState(null);
469
+ // Right-click clip context menu: { index, x, y }.
470
+ const [ctxMenu, setCtxMenu] = useState(null);
471
+ // Task 23 — the open comment-thread popover: { id, x, y } | null.
472
+ const [commentPopover, setCommentPopover] = useState(null);
473
+ // S7.10 — the join picker (07 · ve-transition): { seam, x, y }, opened by clicking the dot between two clips.
474
+ // (The v1 clip dialog is gone: a selected clip is edited in the right-hand inspector, kinds/clip.jsx.)
475
+ const [joinPicker, setJoinPicker] = useState(null);
476
+ // Task 11 — left-edge in-point trim drag: { index, ref, startX, pxf, delta }.
477
+ const [trimInDrag, setTrimInDrag, trimInLive] = useLiveState(null);
478
+ // True after a body-drag actually moved — suppresses the click-to-select.
479
+ const movedRef = useRef(false);
480
+ // Drag the top edge to resize the panel — pointer-capture + window listeners
481
+ // attached SYNCHRONOUSLY in pointerdown (the "attach a frame late" lesson).
482
+ const beginResize = useCallback(
483
+ (e) => {
484
+ e.preventDefault();
485
+ e.stopPropagation();
486
+ e.currentTarget.setPointerCapture?.(e.pointerId);
487
+ const startY = e.clientY;
488
+ const startH = height || 216;
489
+ const onMove = (ev) => {
490
+ onResize?.(clamp(startH + (startY - ev.clientY), 140, 640));
491
+ };
492
+ const onUp = () => {
493
+ window.removeEventListener('pointermove', onMove);
494
+ window.removeEventListener('pointerup', onUp);
495
+ };
496
+ window.addEventListener('pointermove', onMove);
497
+ window.addEventListener('pointerup', onUp);
498
+ },
499
+ [height, onResize]
500
+ );
501
+
502
+ const seekAt = useCallback(
503
+ (clientX) => {
504
+ const el = trackRef.current;
505
+ if (!el) return;
506
+ const r = el.getBoundingClientRect();
507
+ const f = pxToFrame(clientX - r.left - gutter, pxf);
508
+ onSeek?.(clamp(Math.round(f), 0, totalFrames - 1));
509
+ },
510
+ [onSeek, totalFrames, pxf, gutter]
511
+ );
512
+
513
+ // the frame under a pointer x, unclamped to the cut's last frame (the loop handles clamp to the band themselves)
514
+ const frameAtClientX = useCallback(
515
+ (clientX) => {
516
+ const el = trackRef.current;
517
+ if (!el) return null;
518
+ const r = el.getBoundingClientRect();
519
+ return Math.round(pxToFrame(clientX - r.left - gutter, pxf));
520
+ },
521
+ [pxf, gutter]
522
+ );
523
+
524
+ useEffect(() => {
525
+ if (!draggingRef.current) return undefined;
526
+ const move = (e) => seekAt(e.clientX);
527
+ const up = () => {
528
+ draggingRef.current = false;
529
+ };
530
+ window.addEventListener('pointermove', move);
531
+ window.addEventListener('pointerup', up, { once: true });
532
+ return () => {
533
+ window.removeEventListener('pointermove', move);
534
+ window.removeEventListener('pointerup', up);
535
+ };
536
+ });
537
+
538
+ // Comment tool — pin a comment at the clicked frame. `seq`/`laneName` are
539
+ // set when the click landed on a clip block (anchor survives reorder via
540
+ // clipStableId + frameOffset); a bare-track click anchors the frame alone.
541
+ // The composer is a small popover ANCHORED at the click (the artboard
542
+ // comment grammar), not a center-screen modal (dogfood 2026-07-30).
543
+ const [commentDraft, setCommentDraft] = useState(null); // { x, y, anchor, at }
544
+ const placeCommentAt = useCallback(
545
+ (e, seq, laneName) => {
546
+ const el = trackRef.current;
547
+ if (!el || !onAddComment) return;
548
+ const r = el.getBoundingClientRect();
549
+ const f = clamp(Math.round(pxToFrame(e.clientX - r.left - gutter, pxf)), 0, totalFrames - 1);
550
+ const anchor =
551
+ seq && seq.stableId
552
+ ? {
553
+ clipStableId: seq.stableId,
554
+ frameOffset: Math.max(0, f - (seq.from || 0)),
555
+ frame: f,
556
+ lane: laneName || undefined,
557
+ }
558
+ : { frame: f, lane: laneName || undefined };
559
+ setCommentDraft({
560
+ x: clamp(e.clientX - 130, 8, window.innerWidth - 280),
561
+ y: Math.max(48, e.clientY - 140),
562
+ anchor,
563
+ at: f,
564
+ });
565
+ setCommentMode(false);
566
+ },
567
+ [pxf, totalFrames, onAddComment, gutter]
568
+ );
569
+
570
+ const onTrackDown = (e) => {
571
+ // A click on a sequence block SELECTS it (handled there); a press on the
572
+ // bare track deselects, scrubs, and starts a scrub drag.
573
+ if (retimeDrag) return; // a resize is in flight — don't scrub
574
+ // P8 C9 — the gutter's own buttons (fold a track, the eye, the speaker) take their click: a press that starts a scrub
575
+ // here captures the pointer on the lanes, and the click then lands on the lanes, never on the button
576
+ if (e.target?.closest?.('.tl-track-cap')) return;
577
+ if (commentMode) {
578
+ e.preventDefault();
579
+ placeCommentAt(e, null, null);
580
+ return;
581
+ }
582
+ e.preventDefault(); // don't start a text selection while scrubbing
583
+ onSelect?.(null);
584
+ draggingRef.current = true;
585
+ seekAt(e.clientX);
586
+ e.currentTarget.setPointerCapture?.(e.pointerId);
587
+ };
588
+
589
+ // Alt = no snap; threshold is ~8 px at the CURRENT zoom.
590
+ const snapThreshold = (altKey) => (altKey ? 0 : 8 / pxf);
591
+
592
+ // Drag-to-retime — the right edge rewrites durationInFrames on release.
593
+ useEffect(() => {
594
+ if (!retimeDrag) return undefined;
595
+ const move = (e) => {
596
+ const deltaFrames = (e.clientX - retimeDrag.startX) / retimeDrag.pxf;
597
+ const rawEnd = retimeDrag.startFrom + Math.round(retimeDrag.startDur + deltaFrames);
598
+ const end = snapFrame(rawEnd, retimeDrag.targets, e.altKey ? 0 : 8 / retimeDrag.pxf);
599
+ if (end !== rawEnd) flashSnap(end);
600
+ let curDur = Math.max(1, end - retimeDrag.startFrom);
601
+ // Task 8 — clamp to the source's real duration (footage sidecar) so a
602
+ // trim can't ask the clip for frames the file doesn't have.
603
+ let atClamp = curDur <= 1;
604
+ if (retimeDrag.maxDur > 0 && curDur >= retimeDrag.maxDur) {
605
+ curDur = retimeDrag.maxDur;
606
+ atClamp = true;
607
+ }
608
+ setRetimeDrag((d) => (d ? { ...d, curDur, atClamp } : d));
609
+ };
610
+ const up = () => {
611
+ const d = retimeLive.current;
612
+ setRetimeDrag(null);
613
+ if (d && d.curDur !== d.startDur)
614
+ onRetime?.(d.ref ?? d.index, { durationInFrames: d.curDur });
615
+ };
616
+ window.addEventListener('pointermove', move);
617
+ window.addEventListener('pointerup', up, { once: true });
618
+ return () => {
619
+ window.removeEventListener('pointermove', move);
620
+ window.removeEventListener('pointerup', up);
621
+ };
622
+ }, [retimeDrag, onRetime, flashSnap]);
623
+
624
+ // Body-drag to move a standalone clip's `from`. Commits on release.
625
+ useEffect(() => {
626
+ if (!moveDrag) return undefined;
627
+ const move = (e) => {
628
+ const deltaFrames = (e.clientX - moveDrag.startX) / moveDrag.pxf;
629
+ const rawFrom = Math.max(0, Math.round(moveDrag.startFrom + deltaFrames));
630
+ const curFrom = Math.max(
631
+ 0,
632
+ snapFrame(rawFrom, moveDrag.targets, e.altKey ? 0 : 8 / moveDrag.pxf)
633
+ );
634
+ if (curFrom !== rawFrom) flashSnap(curFrom);
635
+ if (Math.abs(curFrom - moveDrag.startFrom) >= 1) movedRef.current = true;
636
+ // Vertical layer-move affordance: highlight the storyline while the clip
637
+ // hovers over it (the drop would move it between layers).
638
+ const story = document.querySelector('.tl-storyline-track')?.getBoundingClientRect();
639
+ const overStory = !!(story && e.clientY >= story.top && e.clientY <= story.bottom);
640
+ setMoveDrag((d) => (d ? { ...d, curFrom, overStory } : d));
641
+ };
642
+ const up = (e) => {
643
+ const d = moveLive.current;
644
+ setMoveDrag(null);
645
+ if (!d) return;
646
+ // Dropping the clip ON the storyline lane moves it between layers
647
+ // (the layers model); otherwise commit the horizontal from-move.
648
+ const story = document.querySelector('.tl-storyline-track')?.getBoundingClientRect();
649
+ if (
650
+ story &&
651
+ onClipVerb &&
652
+ e.clientY >= story.top &&
653
+ e.clientY <= story.bottom &&
654
+ movedRef.current
655
+ ) {
656
+ onClipVerb(d.ref ?? { index: d.index }, 'to-storyline', {});
657
+ } else if (d.curFrom !== d.startFrom) {
658
+ onRetime?.(d.ref ?? d.index, { from: d.curFrom });
659
+ }
660
+ };
661
+ window.addEventListener('pointermove', move);
662
+ window.addEventListener('pointerup', up, { once: true });
663
+ return () => {
664
+ window.removeEventListener('pointermove', move);
665
+ window.removeEventListener('pointerup', up);
666
+ };
667
+ }, [moveDrag, onRetime, onClipVerb, flashSnap]);
668
+
669
+ // Task 11 — left-edge in-point trim: preview live, commit `trim-in` on
670
+ // release (the server writes trimBefore + duration + from + ripple).
671
+ useEffect(() => {
672
+ if (!trimInDrag) return undefined;
673
+ const move = (e) => {
674
+ const raw = Math.round((e.clientX - trimInDrag.startX) / trimInDrag.pxf);
675
+ // positive = trim INTO the clip; clamp so ≥1 frame stays.
676
+ const delta = Math.min(trimInDrag.maxDelta, raw);
677
+ setTrimInDrag((d) => (d ? { ...d, delta } : d));
678
+ };
679
+ const up = () => {
680
+ const d = trimInLive.current;
681
+ setTrimInDrag(null);
682
+ if (d && d.delta) onClipVerb?.(d.ref, 'trim-in', { deltaFrames: d.delta });
683
+ };
684
+ window.addEventListener('pointermove', move);
685
+ window.addEventListener('pointerup', up, { once: true });
686
+ return () => {
687
+ window.removeEventListener('pointermove', move);
688
+ window.removeEventListener('pointerup', up);
689
+ };
690
+ }, [trimInDrag, onClipVerb]);
691
+
692
+ const startTrimIn = (e, index) => {
693
+ e.stopPropagation();
694
+ e.preventDefault();
695
+ const seq = sequences[index];
696
+ if (!seq) return;
697
+ setTrimInDrag({
698
+ index,
699
+ ref: refFor(seq, index),
700
+ startX: e.clientX,
701
+ pxf,
702
+ delta: 0,
703
+ maxDelta: Math.max(0, (seq.duration ?? 1) - 1),
704
+ });
705
+ };
706
+
707
+ // Snap targets for a drag on clip `index`: ticks + OTHER clips' edges + playhead.
708
+ const snapTargetsFor = (index) =>
709
+ computeSnapTargets({
710
+ fps,
711
+ totalFrames,
712
+ clips: sequences,
713
+ movingIndex: index,
714
+ playhead: clamped,
715
+ beats: musicLane.snapBeats, // S7.12 — Snap to the beat
716
+ });
717
+
718
+ // Task 3 — every op addresses a clip as { stableId, index }: stableId when the
719
+ // enumerator supplied one (multi-comp-safe, survives reorder), the row index
720
+ // as the legacy fallback (DDR-150: never address by row index when avoidable).
721
+ const refFor = (seq, index) => ({ stableId: seq?.stableId ?? null, index });
722
+
723
+ // Task 6 — magnetic reorder: body-dragging a series beat shuffles the
724
+ // storyline live (a `from` write would be a lie — Remotion computes series
725
+ // offsets), and commits as a real series MOVE on release.
726
+ const startReorder = (e, index) => {
727
+ e.stopPropagation();
728
+ if (!onReorderMove) return;
729
+ const story = sequences.map((s, i) => ({ s, i })).filter(({ s }) => s.series);
730
+ const slot = story.findIndex(({ i }) => i === index);
731
+ if (slot < 0) return;
732
+ movedRef.current = false;
733
+ setReorderDrag({ index, slot, targetSlot: slot, dx: 0, startX: e.clientX, pxf });
734
+ };
735
+
736
+ useEffect(() => {
737
+ if (!reorderDrag) return undefined;
738
+ const story = sequences.map((s, i) => ({ s, i })).filter(({ s }) => s.series);
739
+ const move = (e) => {
740
+ const dx = e.clientX - reorderDrag.startX;
741
+ if (Math.abs(dx) > 3) movedRef.current = true;
742
+ const me = story[reorderDrag.slot];
743
+ if (!me) return;
744
+ const draggedCenter = me.s.from + me.s.duration / 2 + dx / reorderDrag.pxf;
745
+ // Slot = how many OTHER beats' centers sit left of the dragged center.
746
+ let target = 0;
747
+ story.forEach(({ s }, k) => {
748
+ if (k === reorderDrag.slot) return;
749
+ if (s.from + s.duration / 2 < draggedCenter) target += 1;
750
+ });
751
+ setReorderDrag((d) => (d ? { ...d, dx, targetSlot: target } : d));
752
+ };
753
+ const up = (e) => {
754
+ const d = reorderLive.current;
755
+ setReorderDrag(null);
756
+ if (!d) return;
757
+ if (movedRef.current && onClipVerb) {
758
+ const track = document.querySelector('.tl-storyline-track')?.getBoundingClientRect();
759
+ if (track && e.clientY < track.top - 6) {
760
+ const beat = sequences[d.index];
761
+ if (beat) {
762
+ onClipVerb(refFor(beat, d.index), 'to-overlay', {});
763
+ return;
764
+ }
765
+ }
766
+ }
767
+ if (d.targetSlot !== d.slot) {
768
+ const moved = story[d.slot];
769
+ // targetSlot counts positions among the OTHER beats — map to a ref
770
+ // beat + before/after in the original order.
771
+ const others = story.filter((_, k) => k !== d.slot);
772
+ if (moved && others.length) {
773
+ if (d.targetSlot <= 0) {
774
+ onReorderMove?.(refFor(moved.s, moved.i), refFor(others[0].s, others[0].i), 'before');
775
+ } else {
776
+ const ref = others[Math.min(d.targetSlot, others.length) - 1];
777
+ onReorderMove?.(refFor(moved.s, moved.i), refFor(ref.s, ref.i), 'after');
778
+ }
779
+ }
780
+ }
781
+ };
782
+ window.addEventListener('pointermove', move);
783
+ window.addEventListener('pointerup', up, { once: true });
784
+ return () => {
785
+ window.removeEventListener('pointermove', move);
786
+ window.removeEventListener('pointerup', up);
787
+ };
788
+ }, [reorderDrag, sequences, onReorderMove, onClipVerb]);
789
+
790
+ // Vertical layer reorder — drag an overlay row's V-chip across the rows;
791
+ // the drop commits ONE `layer-order` verb (doc-order index = z-order).
792
+ const startLayerDrag = (e, index, docIdx) => {
793
+ if (!onClipVerb) return;
794
+ e.stopPropagation();
795
+ e.preventDefault();
796
+ setLayerDrag({ index, docIdx, curTarget: docIdx });
797
+ };
798
+ useEffect(() => {
799
+ if (!layerDrag) return undefined;
800
+ const move = (e) => {
801
+ let target = layerDrag.docIdx;
802
+ for (const row of document.querySelectorAll('[data-layer-doc]')) {
803
+ const r = row.getBoundingClientRect();
804
+ if (e.clientY >= r.top && e.clientY <= r.bottom) target = Number(row.dataset.layerDoc);
805
+ }
806
+ setLayerDrag((d) => (d ? { ...d, curTarget: target } : d));
807
+ };
808
+ const up = () => {
809
+ const d = layerLive.current;
810
+ setLayerDrag(null);
811
+ if (d && d.curTarget !== d.docIdx) {
812
+ const seq = sequences[d.index];
813
+ if (seq) onClipVerb?.(refFor(seq, d.index), 'layer-order', { toIndex: d.curTarget });
814
+ }
815
+ };
816
+ window.addEventListener('pointermove', move);
817
+ window.addEventListener('pointerup', up, { once: true });
818
+ return () => {
819
+ window.removeEventListener('pointermove', move);
820
+ window.removeEventListener('pointerup', up);
821
+ };
822
+ }, [layerDrag, sequences, onClipVerb]);
823
+
824
+ const startMove = (e, index, startFrom) => {
825
+ if (sequences[index]?.loose) return; // loose media row — read-only
826
+ // V2-8.5 c4-video (07 · ve-move-transition): a clip you pick up IS the selected one (its ring and its inspector
827
+ // come with the lift), not only after a click
828
+ onSelect?.(sequences[index]?.stableId ?? null);
829
+ // A TransitionSeries/Series clip computes its own position — Remotion
830
+ // IGNORES a `from` prop on it; its body-drag is the magnetic REORDER.
831
+ if (sequences[index]?.series) {
832
+ startReorder(e, index);
833
+ return;
834
+ }
835
+ if (!onRetime) return;
836
+ e.stopPropagation();
837
+ movedRef.current = false;
838
+ setMoveDrag({
839
+ index,
840
+ ref: refFor(sequences[index], index),
841
+ startX: e.clientX,
842
+ startFrom,
843
+ pxf,
844
+ curFrom: startFrom,
845
+ targets: snapTargetsFor(index),
846
+ });
847
+ };
848
+
849
+ const startResize = (e, index, dur) => {
850
+ e.stopPropagation();
851
+ e.preventDefault();
852
+ const seq = sequences[index];
853
+ const startFrom = seq?.from ?? 0;
854
+ setRetimeDrag({
855
+ index,
856
+ ref: refFor(seq, index),
857
+ startX: e.clientX,
858
+ startDur: dur,
859
+ startFrom,
860
+ pxf,
861
+ curDur: dur,
862
+ atClamp: false,
863
+ // Task 8 — source-bounds clamp (0 = unknown, no clamp).
864
+ maxDur: (seq?.mediaSrc && visuals[`d|${seq.mediaSrc}`]) || 0,
865
+ targets: snapTargetsFor(index),
866
+ });
867
+ };
868
+
869
+ // S7.8 — ruler ticks step 1/3/5/10/30/60 s by the visible span (07 · ve-play); past a second of zoom the
870
+ // frame ladder takes over (ruler.js).
871
+ const step = rulerStepFrames({
872
+ pxPerFrame: pxf,
873
+ fps,
874
+ spanFrames: Math.min(totalFrames, axisViewport / pxf),
875
+ });
876
+ const ticks = [];
877
+ for (let f = 0; f <= totalFrames - 1; f += step) ticks.push(f);
878
+
879
+ // -------------------------------------------------------------------------
880
+ // Task 5 — the three-band projection. Series beats form THE storyline lane;
881
+ // standalone sequences are the overlay band; loose <Audio> beds the audio
882
+ // band. A comp with no series clips keeps the stacked row-per-sequence
883
+ // fallback (its truthful projection).
884
+ const storyline = [];
885
+ const overlay = [];
886
+ const audioClips = []; // Task 18 — standalone audio clips live in the audio band
887
+ sequences.forEach((seq, i) => {
888
+ if (seq.series) storyline.push({ seq, i });
889
+ else if (rowKind(seq) === 'audio') audioClips.push({ seq, i });
890
+ else overlay.push({ seq, i });
891
+ });
892
+ // Band (iMovie) layout is for MEDIA cuts. A purely digital comp — every
893
+ // sequence a hand-authored JSX scene (Maude Video Intro, Photo Editor
894
+ // Trailer) — keeps the stacked row-per-sequence projection, which is the
895
+ // truthful, layer-expandable view the user asked back (dogfood 2026-07-30).
896
+ const bandMode = storyline.length > 0 && sequences.some((s) => rowKind(s) !== 'jsx');
897
+
898
+ // S7.8 (C35) — the four tracks, derived from what the comp already says: row index → track id, and the
899
+ // loose <Audio> beds' own. A track is a grouping of the rows below, never a new kind of row, so every row's
900
+ // testid and drag is unchanged.
901
+ const trackOfIdx = new Map();
902
+ const trackOfBed = new Map();
903
+ const trackOfCount = new Map(); // S7.16 — how many things each track holds
904
+ const drawnTracks = deriveTracks({ sequences, audio, extra: extraTracks });
905
+ haveRef.current = drawnTracks.map((t) => t.id);
906
+ trackInfoRef.current = {
907
+ counts: Object.fromEntries(drawnTracks.map((t) => [t.id, t.members.length])),
908
+ labels: Object.fromEntries(drawnTracks.map((t) => [t.id, t.label])),
909
+ };
910
+ for (const t of drawnTracks) {
911
+ for (const m of t.members) (m.kind === 'seq' ? trackOfIdx : trackOfBed).set(m.index, t.id);
912
+ trackOfCount.set(t.id, t.members.length);
913
+ }
914
+ // S7.16 (07 · ve-long) — a track you do not need folds to "Text · 18": one line, no rows. A view (per viewer).
915
+ useFoldVersion();
916
+ useFootageAnswers(); // S7.16 — a waiting clip turns to here by itself when the file arrives
917
+ const foldKey = trackKey(capFile, capId);
918
+ // S7.16 — ruler markers ("Výkop", "TD 1"): part of the cut, in the video's meta; the flags jump the playhead
919
+ useMarkersVersion();
920
+ const markers = capFile && capId ? markersOf(capFile, capId) : [];
921
+ const markerAt = useRef({ frame: 0, seek: null });
922
+ markerAt.current = { frame: clamped, seek: onSeek };
923
+ useEffect(() => {
924
+ if (!capFile || !capId) return undefined;
925
+ void loadMarkers(capFile, capId);
926
+ bindMarkerSource(() => ({
927
+ file: capFile,
928
+ artboardId: capId,
929
+ frame: markerAt.current.frame,
930
+ seek: markerAt.current.seek,
931
+ }));
932
+ return () => bindMarkerSource(null);
933
+ }, [capFile, capId]);
934
+ const preparing = preparingCount(
935
+ sequences.map((q) => (q.mediaSrc ? footageForSrc(island?.canvas, q.mediaSrc) : null))
936
+ );
937
+ // S7.16 — ⌘K finds a clip by name: the clips of this video, and what picking one does (select it, playhead on it)
938
+ const goToClipRef = useRef(null);
939
+ goToClipRef.current = (c) => {
940
+ onSeek?.(c.from);
941
+ onSelect?.(c.id);
942
+ };
943
+ useEffect(() => {
944
+ bindClips(
945
+ comp
946
+ ? {
947
+ fps,
948
+ go: (c) => goToClipRef.current?.(c),
949
+ clips: sequences
950
+ .map((q, qi) => ({ q, qi }))
951
+ .filter(({ q }) => q.stableId && !q.loose)
952
+ .map(({ q, qi }) => ({
953
+ id: q.stableId,
954
+ name: displayNameOf(q, qi),
955
+ from: q.from,
956
+ frames: q.duration,
957
+ src: q.mediaSrc ?? null,
958
+ })),
959
+ }
960
+ : null
961
+ );
962
+ }, [comp, sequences, fps]);
963
+ useEffect(() => () => bindClips(null), []);
964
+ // P8 C3 (07 · .ve-tl-labs, .ve-lab) — a track is its chip in the gutter (a 20 px tinted icon; in full the name
965
+ // beside it) over the rows it groups. No caption strip above the rows, no code-made lane ids. An empty track still
966
+ // draws its lane (`.ve-row--empty`), with the hint when there is one; a folded one is one striped line.
967
+ const TRACK_ICON = {
968
+ text: 'type',
969
+ gfx: 'image',
970
+ video: 'video',
971
+ video2: 'video',
972
+ music: 'music',
973
+ music2: 'music',
974
+ };
975
+ // P8 C8 (07 · .ve-lab-b) — the Full timeline's per-track button: an eye on Text / Graphics, a speaker on Video / Music.
976
+ // One `clip.track` write for the whole track, so one ⌘Z takes it back (track-toggle.js, edit-ops/clip/track.ts).
977
+ const trackButton = (id, label) => {
978
+ if (!full) return null;
979
+ const t = drawnTracks.find((d) => d.id === id);
980
+ const tt = trackToggle(id, label, {
981
+ seqs: (t?.members ?? []).filter((m) => m.kind === 'seq').map((m) => sequences[m.index]),
982
+ beds: (t?.members ?? [])
983
+ .filter((m) => m.kind === 'audio')
984
+ .map((m) => musicLane.forBed(m.index)),
985
+ });
986
+ const can = canEditHere && !!onClipVerb && tt.ids.length > 0;
987
+ return (
988
+ <button
989
+ type="button"
990
+ className={`tl-lab-b${tt.off ? ' is-off' : ''}`}
991
+ data-testid={`timeline-track-${tt.kind}-${id}`}
992
+ aria-label={tt.label}
993
+ title={tt.label}
994
+ aria-pressed={tt.off}
995
+ disabled={!can}
996
+ onClick={() => onClipVerb(null, 'clip.track', tt.params)}
997
+ >
998
+ <TGlyph name={tt.glyph} size={12} />
999
+ </button>
1000
+ );
1001
+ };
1002
+ const trackChip = (id, label, { foldable, folded, count }) => {
1003
+ const chip = (
1004
+ <span className="tl-lab-ic" aria-hidden="true">
1005
+ <TGlyph name={folded ? 'submenu' : (TRACK_ICON[id] ?? 'video')} size={folded ? 10 : 12} />
1006
+ </span>
1007
+ );
1008
+ return (
1009
+ <div className="tl-track-cap" title={folded ? FOLD_WORDS.line(label, count) : label}>
1010
+ {foldable ? (
1011
+ <button
1012
+ type="button"
1013
+ className="tl-track-fold"
1014
+ data-testid={`timeline-track-fold-${id}`}
1015
+ aria-expanded={!folded}
1016
+ aria-label={folded ? FOLD_WORDS.unfold(label) : FOLD_WORDS.fold(label)}
1017
+ title={folded ? FOLD_WORDS.unfold(label) : FOLD_WORDS.fold(label)}
1018
+ onClick={() => trackFold.toggle(foldKey, id)}
1019
+ >
1020
+ {chip}
1021
+ <span className="tl-track-name">{folded ? FOLD_WORDS.line(label, count) : label}</span>
1022
+ </button>
1023
+ ) : (
1024
+ <>
1025
+ {chip}
1026
+ <span className="tl-track-name">{label}</span>
1027
+ </>
1028
+ )}
1029
+ {folded ? null : trackButton(id, label)}
1030
+ </div>
1031
+ );
1032
+ };
1033
+ const trackShell = (id, label, children, hint, after = null) => {
1034
+ const count = trackOfCount.get(id) ?? 0;
1035
+ const foldable = FOLDABLE.includes(id) && count > 1;
1036
+ const folded = foldable && trackFold.isFolded(foldKey, id);
1037
+ const rows = (Array.isArray(children) ? children : [children]).filter(Boolean);
1038
+ return (
1039
+ <div
1040
+ className="tl-track"
1041
+ data-track={id}
1042
+ data-folded={folded ? '1' : undefined}
1043
+ data-testid={`timeline-track-${id}`}
1044
+ key={id}
1045
+ >
1046
+ {trackChip(id, label, { foldable, folded, count })}
1047
+ {folded ? (
1048
+ <div className="tl-row tl-row--fold" aria-hidden="true">
1049
+ <span className="tl-row-label" />
1050
+ <div className="tl-row-track" style={{ width: axisPx, flex: 'none' }}>
1051
+ <span className="tl-fold-bar" />
1052
+ </div>
1053
+ </div>
1054
+ ) : rows.length ? (
1055
+ rows
1056
+ ) : (
1057
+ <div className="tl-row tl-row--empty" data-testid={`timeline-track-empty-${id}`}>
1058
+ <span className="tl-row-label" />
1059
+ {/* biome-ignore lint/a11y/noStaticElementInteractions: a drop target for dragged files, like every lane — not a control */}
1060
+ <div
1061
+ className="tl-row-track"
1062
+ style={{ width: axisPx, flex: 'none' }}
1063
+ onDragOver={onLaneDragOver(
1064
+ id === 'music' || id === 'music2' ? 'audio' : 'overlay',
1065
+ `e-${id}`
1066
+ )}
1067
+ onDrop={onLaneDrop({ lane: id === 'music' || id === 'music2' ? 'audio' : 'overlay' })}
1068
+ >
1069
+ {hint ? <span className="tl-track-hint tl-row-hint">{hint}</span> : null}
1070
+ {laneCaret(id === 'music' || id === 'music2' ? 'audio' : 'overlay', `e-${id}`)}
1071
+ </div>
1072
+ </div>
1073
+ )}
1074
+ {folded ? null : after}
1075
+ </div>
1076
+ );
1077
+ };
1078
+
1079
+ /** P8 C3 (07 · ve-select: titles side by side on one Text lane) — rows of one track that never overlap in time share
1080
+ * a lane. Greedy by start; every row keeps its own element and testid (the later one is drawn ONTO its lane's
1081
+ * first row, `data-lane-join`). A row whose layers are open keeps a lane to itself. */
1082
+ const laneJoins = (entries) => {
1083
+ const lanes = []; // { end, solo } per lane
1084
+ const laneOf = new Map();
1085
+ for (const { seq, i } of [...entries].sort((a, b) => a.seq.from - b.seq.from)) {
1086
+ const solo = Array.isArray(seq.layers) && seq.layers.length >= 2 && !collapsed.has(i);
1087
+ let k = solo ? -1 : lanes.findIndex((l) => !l.solo && l.end <= seq.from);
1088
+ if (k < 0) {
1089
+ k = lanes.length;
1090
+ lanes.push({ end: 0, solo });
1091
+ }
1092
+ lanes[k].end = seq.from + seq.duration;
1093
+ laneOf.set(i, k);
1094
+ }
1095
+ return laneOf;
1096
+ };
1097
+ /** Entries in drawing order: lane by lane, each lane left to right; `join` = drawn onto the row above it. */
1098
+ const packed = (entries) => {
1099
+ const laneOf = laneJoins(entries);
1100
+ const seen = new Set();
1101
+ return [...entries]
1102
+ .sort((a, b) => laneOf.get(a.i) - laneOf.get(b.i) || a.seq.from - b.seq.from)
1103
+ .map((e) => {
1104
+ const lane = laneOf.get(e.i);
1105
+ const join = seen.has(lane);
1106
+ seen.add(lane);
1107
+ return { ...e, join };
1108
+ });
1109
+ };
1110
+
1111
+ // -------------------------------------------------------------------------
1112
+ // Task 7 — real media visuals. Async extraction (never blocks the scrub);
1113
+ // today's plain blocks are the instant fallback. Keyed by src + zoom bucket.
1114
+ const [visuals, setVisuals] = useState({});
1115
+ const resolveUrl = useCallback(
1116
+ (src) => {
1117
+ if (!src) return null;
1118
+ // Security (adversarial review 2026-07-30): mediaSrc comes verbatim from
1119
+ // (untrusted, DDR-054) canvas source. Filmstrip/waveform extraction runs
1120
+ // on the privileged no-CSP SHELL origin (fetch + <video src>), so a
1121
+ // protocol-relative `//host/…` — which passes `startsWith('/')` — would
1122
+ // egress to an attacker host zero-click on Timeline open. Reject `//`
1123
+ // (and any scheme); only a single-slash-rooted, same-origin path is a
1124
+ // real contained asset. Everything else routes through resolveMediaUrl,
1125
+ // which prefixes the designRoot (same-origin by construction).
1126
+ if (src.startsWith('//')) return null;
1127
+ if (/^(https?:|data:|blob:)/i.test(src)) return null;
1128
+ if (src.startsWith('/')) return src;
1129
+ return resolveMediaUrl ? resolveMediaUrl(src) : null;
1130
+ },
1131
+ [resolveMediaUrl]
1132
+ );
1133
+ // ── S7.10 — the join picker's numbers: who it joins, what it plays now, and the writes ──
1134
+ const picker = (() => {
1135
+ if (!joinPicker) return null;
1136
+ const t = (transitions || [])[joinPicker.seam];
1137
+ const tClip = transitionClips[joinPicker.seam];
1138
+ if (!t || !tClip) return null;
1139
+ const ai = t.afterIndex;
1140
+ const A = sequences[ai];
1141
+ const B = sequences[ai + 1];
1142
+ if (!A || !B) return null;
1143
+ // each shot is held on the frame the join meets it: the outgoing clip's last, the incoming clip's first
1144
+ const shot = (seq, i, end) => {
1145
+ const url = seq.mediaSrc ? resolveUrl(seq.mediaSrc) : null;
1146
+ const at = stillSecond(seq, end, fps);
1147
+ return { url: url && at != null ? `${url}#t=${at}` : url, label: displayNameOf(seq, i) };
1148
+ };
1149
+ const ref = { stableId: tClip.stableId, transition: true };
1150
+ return {
1151
+ title: joinTitle(displayNameOf(A, ai), displayNameOf(B, ai + 1)),
1152
+ tile: tileOfPresentation(t.presentation),
1153
+ frames: t.dur ?? 15,
1154
+ a: shot(A, ai, 'last'),
1155
+ b: shot(B, ai + 1, 'first'),
1156
+ set: (params) => onClipVerb?.(ref, 'video.transition.set', params),
1157
+ };
1158
+ })();
1159
+
1160
+ // ── S7.10 — the selected clip, for the right-hand inspector and for the "how should it sit?" ask ──
1161
+ const selIndex =
1162
+ selectedClipId == null
1163
+ ? -1
1164
+ : sequences.findIndex((s2) => s2.stableId && s2.stableId === selectedClipId);
1165
+ const selSeq = selIndex >= 0 ? sequences[selIndex] : null;
1166
+ const canEditHere = island ? island.canEdit !== false : true;
1167
+ const fitFill = useFitFill({
1168
+ seq: selSeq,
1169
+ comp,
1170
+ url: selSeq?.mediaSrc ? resolveUrl(selSeq.mediaSrc) : null,
1171
+ canvas: island?.canvas ?? null,
1172
+ artboardId: comp?.artboardId ?? null,
1173
+ canEdit: canEditHere && !!onClipVerb,
1174
+ runFit: (fit) => selSeq && onClipVerb?.(refFor(selSeq, selIndex), 'video.fit', { fit }),
1175
+ });
1176
+ // S7.12 — the Music track: beats, the dip, Snap to the beat, and "Add music → beats detected"
1177
+ const musicLane = useMusicLane({
1178
+ canvas: island?.canvas ?? null,
1179
+ artboardId: comp?.artboardId ?? null,
1180
+ sequences,
1181
+ audio,
1182
+ canEdit: canEditHere && !!onClipVerb,
1183
+ runOp: onClipVerb,
1184
+ });
1185
+ const selBed = onClipVerb ? musicLane.bedById(selectedClipId) : null;
1186
+ // Cut to the beat rolls cuts through the footage's spare seconds: the lengths of the picture sources
1187
+ const sequencesNow = useRef(sequences);
1188
+ sequencesNow.current = sequences;
1189
+ const probeSources = async () => {
1190
+ const srcs = [
1191
+ ...new Set(sequencesNow.current.filter((q) => rowKind(q) === 'video').map((q) => q.mediaSrc)),
1192
+ ];
1193
+ const out = {};
1194
+ await Promise.all(
1195
+ srcs.filter(Boolean).map(async (src) => {
1196
+ const url = resolveUrl(src);
1197
+ const sec = url ? await probeMediaDuration(url) : null;
1198
+ if (sec) out[src] = sec;
1199
+ })
1200
+ );
1201
+ return out;
1202
+ };
1203
+ useEffect(() => {
1204
+ if (selBed) {
1205
+ timelineSelection.set(
1206
+ musicSelection({
1207
+ info: selBed.info,
1208
+ label: songName(audio[selBed.index]?.label),
1209
+ canvas: island?.canvas ?? null,
1210
+ artboardId: comp?.artboardId ?? null,
1211
+ fps,
1212
+ onClipVerb,
1213
+ onSelect,
1214
+ probeSources,
1215
+ changeSong: onReplaceAudio ? () => onReplaceAudio(selBed.index) : null,
1216
+ })
1217
+ );
1218
+ return;
1219
+ }
1220
+ if (!selSeq || selSeq.loose || !onClipVerb) {
1221
+ // S7.11 — a caption word is selected through the lane, not through a clip: a refetch must not clear it
1222
+ if (timelineSelection.get()?.kind !== 'caption') timelineSelection.set(null);
1223
+ return;
1224
+ }
1225
+ const i = selIndex;
1226
+ const ref = refFor(selSeq, i);
1227
+ const k = (transitions || []).findIndex((t2) => t2.afterIndex === i);
1228
+ const tClip = k >= 0 ? transitionClips[k] : null;
1229
+ const kind = timelineKindOf({ ...selSeq, rowKind: rowKind(selSeq) });
1230
+ const joinRef = (j) => ({ stableId: j.stableId, transition: true });
1231
+ timelineSelection.set({
1232
+ kind,
1233
+ canvas: island?.canvas ?? null,
1234
+ artboardId: comp?.artboardId ?? null,
1235
+ fps,
1236
+ stableId: selSeq.stableId,
1237
+ label: displayNameOf(selSeq, i),
1238
+ seq: {
1239
+ from: selSeq.from,
1240
+ duration: selSeq.duration,
1241
+ label: selSeq.label,
1242
+ series: !!selSeq.series,
1243
+ mediaTag: selSeq.mediaTag ?? null,
1244
+ mediaSrc: selSeq.mediaSrc ?? null,
1245
+ mediaProps: selSeq.mediaProps ?? null,
1246
+ placeholder: selSeq.placeholder ?? null,
1247
+ text: selSeq.text ?? null,
1248
+ titleMotion: selSeq.titleMotion ?? null,
1249
+ titleStyle: selSeq.titleStyle ?? null,
1250
+ fit: selSeq.fit ?? null,
1251
+ rowKind: rowKind(selSeq),
1252
+ },
1253
+ transitionAfter:
1254
+ tClip && k >= 0
1255
+ ? {
1256
+ k,
1257
+ stableId: tClip.stableId,
1258
+ dur: transitions[k].dur ?? 15,
1259
+ presentation: transitions[k].presentation ?? null,
1260
+ }
1261
+ : null,
1262
+ onVerb: (verb, params) => onClipVerb(ref, verb, params),
1263
+ onOp: (op, params, opts) => onClipVerb(ref, `video.${op}`, params, opts),
1264
+ probeSources,
1265
+ onJoin: (j, params) => onClipVerb(joinRef(j), 'video.transition.set', params),
1266
+ onRemoveJoin: (j) => onClipVerb(joinRef(j), 'remove-transition', {}),
1267
+ deselect: () => onSelect?.(null),
1268
+ });
1269
+ // biome-ignore lint/correctness/useExhaustiveDependencies: `refFor` is a pure helper; the rest is listed
1270
+ }, [
1271
+ selSeq,
1272
+ selIndex,
1273
+ transitions,
1274
+ transitionClips,
1275
+ onClipVerb,
1276
+ onSelect,
1277
+ fps,
1278
+ comp?.artboardId,
1279
+ island?.canvas,
1280
+ selBed?.info,
1281
+ selBed?.index,
1282
+ audio,
1283
+ ]);
1284
+ // the Timeline going away takes its selection with it
1285
+ useEffect(() => () => timelineSelection.set(null), []);
1286
+
1287
+ useEffect(() => {
1288
+ let alive = true;
1289
+ for (const seq of sequences) {
1290
+ if (rowKind(seq) !== 'video' || !seq.mediaSrc) continue;
1291
+ const url = resolveUrl(seq.mediaSrc);
1292
+ if (!url) continue;
1293
+ const bucket = stripBucket(Math.max(2, seq.duration * pxf));
1294
+ const key = `s|${seq.mediaSrc}|${bucket}`;
1295
+ if (visuals[key] !== undefined) continue;
1296
+ setVisuals((v) => (v[key] !== undefined ? v : { ...v, [key]: null }));
1297
+ getFilmstrip(url, bucket).then((strip) => {
1298
+ if (alive && strip) setVisuals((v) => ({ ...v, [key]: strip }));
1299
+ });
1300
+ }
1301
+ for (const a of audio) {
1302
+ if (!a.src) continue;
1303
+ const url = resolveUrl(a.src);
1304
+ if (!url) continue;
1305
+ const key = `p|${a.src}`;
1306
+ if (visuals[key] !== undefined) continue;
1307
+ setVisuals((v) => (v[key] !== undefined ? v : { ...v, [key]: null }));
1308
+ getPeaks(url).then((peaks) => {
1309
+ if (alive && peaks) setVisuals((v) => ({ ...v, [key]: peaks }));
1310
+ });
1311
+ }
1312
+ // Task 8 — source duration (frames) from the footage sidecar, for trim
1313
+ // clamping. Cached under `d|<src>`; absent sidecar caches `0` (no clamp).
1314
+ for (const seq of sequences) {
1315
+ if (rowKind(seq) !== 'video' || !seq.mediaSrc) continue;
1316
+ const key = `d|${seq.mediaSrc}`;
1317
+ if (visuals[key] !== undefined) continue;
1318
+ setVisuals((v) => (v[key] !== undefined ? v : { ...v, [key]: null }));
1319
+ fetch(`/_api/footage?asset=${encodeURIComponent(seq.mediaSrc)}`)
1320
+ .then((r) => (r.ok ? r.json() : null))
1321
+ .then((j) => {
1322
+ if (!alive) return;
1323
+ const sec = Number(j?.durationSec);
1324
+ const frames = Number.isFinite(sec) && sec > 0 ? Math.round(sec * (fps || 30)) : 0;
1325
+ setVisuals((v) => ({ ...v, [key]: frames }));
1326
+ })
1327
+ .catch(() => {
1328
+ if (alive) setVisuals((v) => ({ ...v, [key]: 0 }));
1329
+ });
1330
+ }
1331
+ return () => {
1332
+ alive = false;
1333
+ };
1334
+ }, [sequences, audio, pxf, resolveUrl, visuals, fps]);
1335
+
1336
+ // Task 6 — live reorder preview: while a beat drags, the OTHER beats take
1337
+ // their preview `from`s (cursor walk over the preview order, seams
1338
+ // approximated by the first transition's duration); the dragged beat follows
1339
+ // the pointer. Truth re-renders from disk after the commit.
1340
+ const previewFroms = (() => {
1341
+ if (!reorderDrag) return null;
1342
+ const story = sequences.map((s, i) => ({ s, i })).filter(({ s }) => s.series);
1343
+ const dragged = story[reorderDrag.slot];
1344
+ if (!dragged) return null;
1345
+ const seamDur = (transitions && transitions[0]?.dur) || 0;
1346
+ const others = story.filter((_, k) => k !== reorderDrag.slot);
1347
+ const order = [...others];
1348
+ order.splice(Math.max(0, Math.min(reorderDrag.targetSlot, others.length)), 0, dragged);
1349
+ const map = new Map();
1350
+ let cursor = story[0]?.s.from ?? 0;
1351
+ for (const { s, i } of order) {
1352
+ map.set(i, cursor);
1353
+ cursor += s.duration - seamDur;
1354
+ }
1355
+ return map;
1356
+ })();
1357
+
1358
+ // S7.9 — the line + words for a lifted beat: "Drop before Touchdown", at the gap its siblings left for it.
1359
+ const landing = (() => {
1360
+ if (!reorderDrag) return null;
1361
+ const rows = sequences.map((s, i) => ({ s, i })).filter(({ s }) => s.series);
1362
+ const l = landingOf({ story: rows.map(({ s }) => s), reorderDrag });
1363
+ const at = rows[reorderDrag.slot];
1364
+ return l && at
1365
+ ? { ...l, frame: previewFroms?.get(at.i) ?? at.s.from, firstRow: rows[0].i }
1366
+ : null;
1367
+ })();
1368
+
1369
+ // DDR-150 P4 / Task 6 — file drops. Lanes set an insertion caret and hand a
1370
+ // POSITION to onDropMedia(files, pos); the panel-level drop stays as the
1371
+ // append fallback.
1372
+ const hasFiles = (dt) => Array.from(dt?.types ?? []).includes('Files');
1373
+ const onDrop = (e) => {
1374
+ if (!onDropMedia || !hasFiles(e.dataTransfer)) return;
1375
+ e.preventDefault();
1376
+ e.stopPropagation();
1377
+ setDropActive(false);
1378
+ setDropCaret(null);
1379
+ const files = Array.from(e.dataTransfer.files || []);
1380
+ // A drop OUTSIDE any lane = a NEW overlay layer at the playhead (the
1381
+ // layers model); dropping ON the storyline lane still makes a beat.
1382
+ if (files.length) onDropMedia(files, comp ? { lane: 'overlay', frame: clamped } : null);
1383
+ };
1384
+
1385
+ /** Storyline seam boundaries in axis px (slot 0 … N). */
1386
+ const storyBoundaries = () => {
1387
+ const story = sequences.filter((s) => s.series);
1388
+ const pts = story.map((s) => x(s.from));
1389
+ if (story.length) {
1390
+ const last = story[story.length - 1];
1391
+ pts.push(x(last.from + last.duration));
1392
+ }
1393
+ return pts;
1394
+ };
1395
+
1396
+ const onStoryDragOver = (e) => {
1397
+ if (!onDropMedia || !hasFiles(e.dataTransfer)) return;
1398
+ e.preventDefault();
1399
+ e.stopPropagation();
1400
+ e.dataTransfer.dropEffect = 'copy';
1401
+ const rect = e.currentTarget.getBoundingClientRect();
1402
+ const px = e.clientX - rect.left;
1403
+ const pts = storyBoundaries();
1404
+ let slot = 0;
1405
+ let best = Infinity;
1406
+ pts.forEach((p, k) => {
1407
+ const d = Math.abs(p - px);
1408
+ if (d < best) {
1409
+ best = d;
1410
+ slot = k;
1411
+ }
1412
+ });
1413
+ const story = sequences.filter((q) => q.series);
1414
+ const frames = story.map((q) => q.from);
1415
+ if (story.length) {
1416
+ const last = story[story.length - 1];
1417
+ frames.push(last.from + last.duration);
1418
+ }
1419
+ setDropCaret({
1420
+ lane: 'storyline',
1421
+ slot,
1422
+ x: pts[slot] ?? px,
1423
+ frame: frames[slot] ?? 0,
1424
+ count: fileCount(e.dataTransfer),
1425
+ });
1426
+ };
1427
+
1428
+ const onLaneDragOver = (lane, row) => (e) => {
1429
+ if (!onDropMedia || !hasFiles(e.dataTransfer)) return;
1430
+ e.preventDefault();
1431
+ e.stopPropagation();
1432
+ e.dataTransfer.dropEffect = 'copy';
1433
+ const rect = e.currentTarget.getBoundingClientRect();
1434
+ const px = e.clientX - rect.left;
1435
+ const f = clamp(Math.round(pxToFrame(px, pxf)), 0, totalFrames - 1);
1436
+ setDropCaret({ lane, row, frame: f, x: px, count: fileCount(e.dataTransfer) });
1437
+ };
1438
+
1439
+ const laneCaret = (lane, row) =>
1440
+ dropCaret && dropCaret.lane === lane && dropCaret.row === row ? (
1441
+ <>
1442
+ <span
1443
+ className="tl-drop-caret"
1444
+ data-testid="timeline-drop-caret"
1445
+ style={{ left: dropCaret.x - 1 }}
1446
+ />
1447
+ <DropLanding x={dropCaret.x} count={dropCaret.count} atFrame={dropCaret.frame} fps={fps} />
1448
+ </>
1449
+ ) : null;
1450
+
1451
+ const onLaneDrop = (pos) => (e) => {
1452
+ if (!onDropMedia || !hasFiles(e.dataTransfer)) return;
1453
+ e.preventDefault();
1454
+ e.stopPropagation();
1455
+ setDropActive(false);
1456
+ const caret = dropCaret;
1457
+ setDropCaret(null);
1458
+ const files = Array.from(e.dataTransfer.files || []);
1459
+ if (!files.length) return;
1460
+ if (pos.lane === 'storyline') {
1461
+ onDropMedia(files, { lane: 'storyline', index: caret?.slot ?? undefined });
1462
+ } else {
1463
+ onDropMedia(files, { lane: pos.lane, frame: caret?.frame ?? 0 });
1464
+ }
1465
+ };
1466
+
1467
+ /** One clip block + its hover affordances (trim handle, replace, remove),
1468
+ * absolutely positioned on the frame axis of its lane. */
1469
+ const renderBlock = (seq, i, { lane, laneName }) => {
1470
+ const dur = retimeDrag && retimeDrag.index === i ? retimeDrag.curDur : seq.duration;
1471
+ const isResizing = !!(retimeDrag && retimeDrag.index === i);
1472
+ let blockFrom = moveDrag && moveDrag.index === i ? moveDrag.curFrom : seq.from;
1473
+ const moving = !!(moveDrag && moveDrag.index === i);
1474
+ // Task 6 — magnetic reorder preview: the dragged beat follows the pointer,
1475
+ // its siblings take their preview slots.
1476
+ let dragOffset = 0;
1477
+ let dragging = false;
1478
+ // V2-8.5 c4-video: a digital comp's beats (lane 'row') lift and shuffle like the media cut's storyline
1479
+ if ((lane === 'storyline' || (lane === 'row' && seq.series)) && reorderDrag) {
1480
+ if (reorderDrag.index === i) {
1481
+ dragging = true;
1482
+ dragOffset = reorderDrag.dx;
1483
+ } else if (previewFroms?.has(i)) {
1484
+ blockFrom = previewFroms.get(i);
1485
+ }
1486
+ }
1487
+ const layers = Array.isArray(seq.layers) ? seq.layers : [];
1488
+ const decomposable = layers.length >= 2;
1489
+ const selected = selectedClipId != null && seq.stableId === selectedClipId;
1490
+ // Debate verdict (orientation): never surface a content-hash filename or a
1491
+ // bare tag name as the clip's identity — "Clip N" beats "bca08b1e.mov";
1492
+ // the real src stays in the tooltip.
1493
+ const displayLabel = displayNameOf(seq, i);
1494
+ // Task 11 — in-point trim preview: left edge follows, width shrinks.
1495
+ const trimming = !!(trimInDrag && trimInDrag.index === i);
1496
+ const trimDelta = trimming ? trimInDrag.delta : 0;
1497
+ const left = x(blockFrom) + dragOffset + (trimming ? x(trimDelta) : 0);
1498
+ const width = Math.max(2, x(dur - trimDelta));
1499
+ const mp = seq.mediaProps || null;
1500
+ // S7.16 (07 · ve-footage, ve-long) — footage not here yet / still preparing, and the name of a block too narrow to read
1501
+ const footage = seq.mediaSrc ? footageForSrc(island?.canvas, seq.mediaSrc) : null;
1502
+ const prepChip = preparingChip(footage);
1503
+ const namesOff = !nameVisible(width) && !isResizing && !moving;
1504
+ const tip = namesOff
1505
+ ? clipTip({
1506
+ name: clipNameWithState(displayLabel, footage),
1507
+ src: seq.mediaSrc,
1508
+ frames: dur,
1509
+ fps,
1510
+ })
1511
+ : null;
1512
+ return (
1513
+ <Fragment key={`b${i}`}>
1514
+ <button
1515
+ type="button"
1516
+ className={`tl-seq-block${isResizing ? ' is-resizing' : ''}${moving ? ' is-moving' : ''}${dragging ? ' is-dragging' : ''}${seq.hidden ? ' is-hidden' : ''}${selected ? ' is-selected' : ''}${lane === 'storyline' ? ' tl-beat' : ''}${aiCut?.landing && aiCut.landing === seq.stableId ? ' is-landing' : ''}`}
1517
+ data-testid={`timeline-seq-${i}`}
1518
+ data-clip-id={seq.stableId || undefined}
1519
+ data-kind={rowKind(seq)}
1520
+ data-hidden={seq.hidden ? '1' : undefined}
1521
+ data-footage={footage?.kind}
1522
+ aria-description={footage?.line}
1523
+ data-names={namesOff ? 'off' : undefined}
1524
+ title={
1525
+ tip ??
1526
+ (seq.series
1527
+ ? `${displayLabel} · ${secs(dur, fps)} — drag to move, trim the right edge`
1528
+ : `${displayLabel} · ${secs(dur, fps)} — drag to move (⌥ = no snap)`)
1529
+ }
1530
+ aria-label={`${displayLabel}, ${fmtTime(blockFrom, fps)} to ${fmtTime(blockFrom + dur, fps)}. Click to select; drag to move.`}
1531
+ style={{
1532
+ left,
1533
+ width,
1534
+ cursor: onRetime && !seq.series ? 'grab' : undefined,
1535
+ }}
1536
+ onContextMenu={(e) => {
1537
+ e.preventDefault();
1538
+ e.stopPropagation();
1539
+ onSelect?.(seq.stableId ?? null); // right-click selects too (iMovie)
1540
+ setCtxMenu({ index: i, x: e.clientX, y: e.clientY });
1541
+ }}
1542
+ onPointerDown={(e) => {
1543
+ if (commentMode) {
1544
+ e.stopPropagation();
1545
+ e.preventDefault();
1546
+ placeCommentAt(e, seq, laneName || lane);
1547
+ return;
1548
+ }
1549
+ startMove(e, i, seq.from);
1550
+ }}
1551
+ onDoubleClick={(e) => {
1552
+ e.stopPropagation();
1553
+ if (seq.loose) return; // read-only row — no clip inspector
1554
+ // S7.10 — double-click selects the clip; its inspector is the right-hand panel (it opens with the pick).
1555
+ onSelect?.(seq.stableId ?? null);
1556
+ }}
1557
+ onClick={(e) => {
1558
+ e.stopPropagation();
1559
+ if (movedRef.current) {
1560
+ movedRef.current = false;
1561
+ return; // a drag-move just happened — don't also select
1562
+ }
1563
+ // Task 3 — click SELECTS (iMovie's select → act grammar); seeking
1564
+ // stays on the ruler/track scrub.
1565
+ onSelect?.(seq.stableId ?? null);
1566
+ }}
1567
+ >
1568
+ {mp?.playbackRate && mp.playbackRate !== 1 ? (
1569
+ <span className="tl-chip tl-chip-speed" data-testid={`timeline-speed-chip-${i}`}>
1570
+ {mp.playbackRate}×
1571
+ </span>
1572
+ ) : null}
1573
+ {mp?.muted ? (
1574
+ <span
1575
+ className="tl-chip tl-chip-mute"
1576
+ title="Muted"
1577
+ data-testid={`timeline-mute-chip-${i}`}
1578
+ >
1579
+ <TGlyph name="mute" size={10} />
1580
+ </span>
1581
+ ) : null}
1582
+ {(() => {
1583
+ // Task 7 — filmstrip behind the label (async; block is the fallback).
1584
+ // Dogfood 2026-07-30 — an Img overlay shows the IMAGE ITSELF (no
1585
+ // extraction needed; the strip was video-only and image overlays
1586
+ // read as anonymous slabs).
1587
+ if (rowKind(seq) === 'image' && seq.mediaSrc) {
1588
+ const url = resolveUrl(seq.mediaSrc);
1589
+ if (!url) return null;
1590
+ return (
1591
+ <span className="tl-strip tl-strip--img" aria-hidden="true">
1592
+ <img src={url} alt="" draggable={false} />
1593
+ </span>
1594
+ );
1595
+ }
1596
+ if (rowKind(seq) !== 'video' || !seq.mediaSrc) return null;
1597
+ const bucket = stripBucket(Math.max(2, seq.duration * pxf));
1598
+ const strip = visuals[`s|${seq.mediaSrc}|${bucket}`];
1599
+ if (!strip) return null;
1600
+ return (
1601
+ <span className="tl-strip" aria-hidden="true">
1602
+ {strip.map((u, k) => (
1603
+ <img key={k} src={u} alt="" draggable={false} />
1604
+ ))}
1605
+ </span>
1606
+ );
1607
+ })()}
1608
+ {/* P8 C3 (07 · .ve-clip-lab / .ve-item) — the clip's name on a chip; a title or a graphic leads with
1609
+ its track's glyph. No kind glyph column, no frame counts (the trim / move tips say the length). */}
1610
+ <span className="tl-seq-name tl-clip-lab">
1611
+ {trackOfIdx.get(i) === 'text' ? (
1612
+ <TGlyph name="type" size={11} />
1613
+ ) : trackOfIdx.get(i) === 'gfx' ? (
1614
+ <TGlyph name="image" size={11} />
1615
+ ) : null}
1616
+ {clipNameWithState(displayLabel, footage)}
1617
+ </span>
1618
+ {prepChip ? (
1619
+ <span className="tl-chip tl-chip-prep" data-testid={`timeline-prep-chip-${i}`}>
1620
+ {prepChip}
1621
+ </span>
1622
+ ) : null}
1623
+ {/* 07 ve-advanced (P8 C10): a keyframe is a DIAMOND on the clip (the board's `.ve-kf`), one at each end of
1624
+ its animated window, filled where the playhead is; a click picks the window whose curve the cards
1625
+ show and seeks to that end. */}
1626
+ {(advOpen ? seq.keyframes : []).flatMap((kf, k) => {
1627
+ // S7.18 — the markers show with Advanced open; a click picks the keyframe whose curve the foot shows
1628
+ const info = seq.keyframeInfo?.[k];
1629
+ const picked = !!info && adv.kf?.component === seq.label && adv.kf.index === info.index;
1630
+ const ends = kf.to > kf.from ? [kf.from, kf.to] : [kf.from];
1631
+ return ends.map((f, e) => {
1632
+ const l = ((f - seq.from) / Math.max(1, seq.duration)) * 100;
1633
+ return (
1634
+ <span
1635
+ key={`${k}-${e}`}
1636
+ className={`tl-kf${picked ? ' is-picked' : ''}${clamped === f ? ' is-at' : ''}`}
1637
+ data-testid={e === 0 ? `timeline-kf-${i}-${k}` : `timeline-kf-${i}-${k}-to`}
1638
+ style={{ left: `${clamp(l, 0, 100)}%` }}
1639
+ title={`seek to keyframe ${f}f (animates ${kf.from}–${kf.to}f)`}
1640
+ onPointerDown={(ev) => ev.stopPropagation()}
1641
+ onClick={(ev) => {
1642
+ ev.stopPropagation();
1643
+ if (info)
1644
+ advancedStore.selectKeyframe({ component: seq.label, index: info.index });
1645
+ onSeek?.(f);
1646
+ }}
1647
+ />
1648
+ );
1649
+ });
1650
+ })}
1651
+ {(comments || [])
1652
+ .filter((c) => c.timeline?.clipStableId && c.timeline.clipStableId === seq.stableId)
1653
+ .map((c) => (
1654
+ // In-place 💬 badge at the comment's exact frame ON the clip —
1655
+ // the top strip stays as the overview; this is the "where".
1656
+ <span
1657
+ key={`cm${c.id}`}
1658
+ role="button"
1659
+ tabIndex={-1}
1660
+ className={`tl-clip-pin${c.status === 'resolved' ? ' is-resolved' : ''}`}
1661
+ data-testid={`timeline-clip-pin-${c.id}`}
1662
+ title={`${c.author || 'comment'}: ${c.text}`}
1663
+ style={{ left: x(clamp(c.timeline.frameOffset || 0, 0, Math.max(0, dur - 1))) }}
1664
+ onPointerDown={(ev) => ev.stopPropagation()}
1665
+ onClick={(ev) => {
1666
+ ev.stopPropagation();
1667
+ setCommentPopover({
1668
+ id: c.id,
1669
+ x: ev.clientX - 130,
1670
+ y: Math.max(60, ev.clientY - 180),
1671
+ });
1672
+ }}
1673
+ >
1674
+ 💬
1675
+ </span>
1676
+ ))}
1677
+ {lane === 'storyline' && decomposable ? (
1678
+ <span
1679
+ role="button"
1680
+ tabIndex={-1}
1681
+ className="tl-beat-expand"
1682
+ data-testid={`timeline-beat-expand-${i}`}
1683
+ title={collapsed.has(i) ? 'Show this beat’s layers' : 'Collapse layers'}
1684
+ onPointerDown={(ev) => ev.stopPropagation()}
1685
+ onClick={(ev) => {
1686
+ ev.stopPropagation();
1687
+ setCollapsed((prev) => {
1688
+ const next = new Set(prev);
1689
+ if (next.has(i)) next.delete(i);
1690
+ else next.add(i);
1691
+ return next;
1692
+ });
1693
+ }}
1694
+ >
1695
+ {collapsed.has(i) ? '▸' : '▾'}
1696
+ </span>
1697
+ ) : null}
1698
+ </button>
1699
+ {onRetime && !seq.loose ? (
1700
+ <span
1701
+ className="tl-seq-resize"
1702
+ data-testid={`timeline-resize-${i}`}
1703
+ title="Drag to retime this sequence"
1704
+ style={{ left: left + width - 5 }}
1705
+ onPointerDown={(e) => startResize(e, i, seq.duration)}
1706
+ onClick={(e) => e.stopPropagation()}
1707
+ />
1708
+ ) : null}
1709
+ {onClipVerb &&
1710
+ !seq.loose &&
1711
+ seq.mediaSrc &&
1712
+ (rowKind(seq) === 'video' || rowKind(seq) === 'audio') ? (
1713
+ <span
1714
+ className="tl-seq-trim-in"
1715
+ data-testid={`timeline-trim-in-${i}`}
1716
+ title="Drag to trim the in-point (left edge)"
1717
+ style={{ left: left - 1 }}
1718
+ onPointerDown={(e) => startTrimIn(e, i)}
1719
+ onClick={(e) => e.stopPropagation()}
1720
+ />
1721
+ ) : null}
1722
+ {trimming ? (
1723
+ <TrimTip
1724
+ testid="timeline-trim-in-tip"
1725
+ sequences={sequences}
1726
+ index={i}
1727
+ newDuration={Math.max(1, seq.duration - trimDelta)}
1728
+ fps={fps}
1729
+ left={left}
1730
+ clamped={trimDelta >= trimInDrag.maxDelta && trimDelta > 0}
1731
+ />
1732
+ ) : null}
1733
+ {isResizing ? (
1734
+ <TrimTip
1735
+ testid="timeline-trim-tip"
1736
+ sequences={sequences}
1737
+ index={i}
1738
+ newDuration={dur}
1739
+ fps={fps}
1740
+ left={left + width + 8}
1741
+ clamped={retimeDrag.atClamp}
1742
+ />
1743
+ ) : null}
1744
+ {moving ? (
1745
+ <TrimTip
1746
+ testid="timeline-move-tip"
1747
+ sequences={sequences}
1748
+ index={i}
1749
+ newDuration={seq.duration}
1750
+ newFrom={blockFrom}
1751
+ deltaFrames={blockFrom - moveDrag.startFrom}
1752
+ fps={fps}
1753
+ left={left}
1754
+ />
1755
+ ) : null}
1756
+ {onReplace && seq.replaceable && !decomposable ? (
1757
+ <button
1758
+ type="button"
1759
+ className="tl-seq-replace"
1760
+ data-testid={`timeline-replace-${i}`}
1761
+ title={`Replace this ${rowKind(seq)}`}
1762
+ aria-label={`Replace media in ${seq.label}`}
1763
+ style={{ left: left + width - 34 }}
1764
+ onPointerDown={(e) => e.stopPropagation()}
1765
+ onClick={(e) => {
1766
+ e.stopPropagation();
1767
+ onReplace(refFor(seq, i));
1768
+ }}
1769
+ >
1770
+ ⇄
1771
+ </button>
1772
+ ) : null}
1773
+ </Fragment>
1774
+ );
1775
+ };
1776
+
1777
+ /** Task 17 — "+" on a hard cut (no transition yet). P8 C3 (07 · ve-select): never drawn at rest — it shows while the
1778
+ * pointer is over the video track or the button has keyboard focus (timeline.css). */
1779
+ const renderAddSeams = () => {
1780
+ if (!onClipVerb) return null;
1781
+ const withTrans = new Set((transitions || []).map((t) => t.afterIndex));
1782
+ return storyline.slice(0, -1).map(({ seq, i }, k) => {
1783
+ if (withTrans.has(i)) return null;
1784
+ const next = storyline[k + 1];
1785
+ if (!next) return null;
1786
+ const between = `${displayNameOf(seq, i)} and ${displayNameOf(next.seq, next.i)}`;
1787
+ return (
1788
+ <button
1789
+ key={`addseam${k}`}
1790
+ type="button"
1791
+ className="tl-seam tl-seam-add"
1792
+ data-testid={`timeline-seam-add-${k}`}
1793
+ aria-label={`Add a transition between ${between}`}
1794
+ title={`Add a transition between ${between} — a 0.5 s fade; click its dot to change it`}
1795
+ style={{ left: x(next.seq.from) }}
1796
+ onPointerDown={(e) => e.stopPropagation()}
1797
+ onClick={(e) => {
1798
+ e.stopPropagation();
1799
+ onClipVerb(refFor(seq, i), 'insert-transition', {
1800
+ presentation: 'fade',
1801
+ durationInFrames: 15,
1802
+ });
1803
+ }}
1804
+ >
1805
+ <TGlyph name="plus" size={12} />
1806
+ </button>
1807
+ );
1808
+ });
1809
+ };
1810
+
1811
+ /** P8 C3 (07 · .ve-join) — the round dot on a join that has a transition; it opens the picker right there. The
1812
+ * picker is placed from the dot itself, so a keyboard Enter (clientX/Y = 0) lands it on the join too. */
1813
+ const renderSeams = () =>
1814
+ (transitions || []).map((t, k) => {
1815
+ const next = sequences[t.afterIndex + 1];
1816
+ const prev = sequences[t.afterIndex];
1817
+ if (!next) return null;
1818
+ const center = x(next.from + (t.dur || 0) / 2);
1819
+ const name = `${prev ? displayNameOf(prev, t.afterIndex) : 'Clip'} → ${displayNameOf(next, t.afterIndex + 1)}`;
1820
+ return (
1821
+ <button
1822
+ key={`seam${k}`}
1823
+ type="button"
1824
+ className="tl-seam tl-join"
1825
+ data-testid={`timeline-seam-${k}`}
1826
+ data-sel={joinPicker?.seam === k ? 'true' : undefined}
1827
+ aria-label={`Transition ${name}`}
1828
+ aria-haspopup="dialog"
1829
+ aria-expanded={joinPicker?.seam === k}
1830
+ title={`${name} · ${secs(t.dur || 0, fps)} — click to change`}
1831
+ style={{ left: center }}
1832
+ onPointerDown={(e) => e.stopPropagation()}
1833
+ onClick={(e) => {
1834
+ e.stopPropagation();
1835
+ const r = e.currentTarget.getBoundingClientRect();
1836
+ setJoinPicker({ seam: k, x: r.left + r.width / 2, y: r.top, from: e.currentTarget });
1837
+ }}
1838
+ >
1839
+ <TGlyph name="transition" size={11} />
1840
+ </button>
1841
+ );
1842
+ });
1843
+
1844
+ const renderAudioRow = (a, i) => {
1845
+ const bedInfo = musicLane.forBed(i); // S7.12 — the media's entry of this loose song
1846
+ const Bed = bedInfo ? 'button' : 'div'; // a song the studio knows is a control; one it doesn't is a picture
1847
+ return (
1848
+ <div className="tl-row" key={`a${i}`} data-testid={`timeline-audio-${i}`}>
1849
+ <span className="tl-row-label" title={a.label} />
1850
+ <div
1851
+ className="tl-row-track"
1852
+ style={{ width: axisPx, flex: 'none' }}
1853
+ onDragOver={onLaneDragOver('audio', `a${i}`)}
1854
+ onDrop={onLaneDrop({ lane: 'audio' })}
1855
+ >
1856
+ {laneCaret('audio', `a${i}`)}
1857
+ <Bed
1858
+ {...(bedInfo ? { type: 'button' } : {})}
1859
+ className={`tl-audio-block${bedInfo && selectedClipId === bedInfo.stableId ? ' is-selected' : ''}`}
1860
+ title={`${songName(a.label)} · ${secs(a.duration, fps)}`}
1861
+ aria-label={bedInfo ? `${songName(a.label)} — select the music` : undefined}
1862
+ style={{
1863
+ left: x(a.from),
1864
+ width: Math.max(2, x(a.duration)),
1865
+ cursor: bedInfo ? 'pointer' : undefined,
1866
+ }}
1867
+ data-clip-id={bedInfo?.stableId || undefined}
1868
+ // 07 · ve-music — a press on the song selects it (its inspector opens); it never starts a scrub of the track
1869
+ onPointerDown={bedInfo ? (e) => e.stopPropagation() : undefined}
1870
+ onClick={
1871
+ bedInfo
1872
+ ? (e) => {
1873
+ e.stopPropagation();
1874
+ onSelect?.(bedInfo.stableId);
1875
+ }
1876
+ : undefined
1877
+ }
1878
+ >
1879
+ {a.src && visuals[`p|${a.src}`] ? (
1880
+ <svg className="tl-wave" viewBox="0 0 100 12" preserveAspectRatio="none" aria-hidden>
1881
+ {/* Task 7 — real peaks (WebAudio decode), filled mirrored wave. */}
1882
+ <path className="tl-wave-real" d={peaksToPath(visuals[`p|${a.src}`])} />
1883
+ </svg>
1884
+ ) : (
1885
+ // P8 C3 (07 · .ve-wave) — until the peaks are read, the song draws as bars, never a sine line
1886
+ <WaveBars width={Math.max(2, x(a.duration))} seed={i + 1} />
1887
+ )}
1888
+ {bedInfo ? null : (
1889
+ <span className="tl-music-lab">
1890
+ <TGlyph name="music" size={10} />
1891
+ <span className="tl-music-n">{songName(a.label)}</span>
1892
+ </span>
1893
+ )}
1894
+ </Bed>
1895
+ {onReplaceAudio ? (
1896
+ <button
1897
+ type="button"
1898
+ className="tl-seq-replace"
1899
+ data-testid={`timeline-audio-replace-${i}`}
1900
+ title="Replace this audio"
1901
+ aria-label={`Replace audio ${a.label}`}
1902
+ style={{ left: x(a.from) + Math.max(2, x(a.duration)) - 20 }}
1903
+ onPointerDown={(e) => e.stopPropagation()}
1904
+ onClick={(e) => {
1905
+ e.stopPropagation();
1906
+ onReplaceAudio(i);
1907
+ }}
1908
+ >
1909
+ ⇄
1910
+ </button>
1911
+ ) : null}
1912
+ <MusicLaneOverlay
1913
+ info={bedInfo}
1914
+ x={x}
1915
+ speech={musicLane.speech}
1916
+ fps={musicLane.fps}
1917
+ finding={musicLane.finding(a.src)}
1918
+ name={songName(a.label)}
1919
+ />
1920
+ </div>
1921
+ </div>
1922
+ );
1923
+ };
1924
+
1925
+ return (
1926
+ <aside
1927
+ ref={rootRef}
1928
+ tabIndex={-1}
1929
+ data-size={full ? 'full' : 'compact'}
1930
+ data-ruler={advOpen && adv.mode === 'frames' ? 'frames' : undefined}
1931
+ className={`tl-panel${resizing ? ' is-resizing' : ''}${dropActive ? ' is-drop' : ''}${commentMode ? ' is-commenting' : ''}`}
1932
+ // compact is as tall as its tracks (07 · .ve-tl--compact); only the full timeline takes the dragged height
1933
+ style={{
1934
+ // 07 ve-advanced: with Advanced open the island grows past the dragged height (its cards must stay inside the
1935
+ // island and the tracks must stay on screen); CSS caps it at the window
1936
+ ...(height && full ? { height } : {}),
1937
+ outline: 'none',
1938
+ '--tl-gutter': `${gutter}px`,
1939
+ }}
1940
+ onPointerEnter={() => {
1941
+ // Keyboard shortcuts (C · Space · ⌘B · ⌘±) live on the SHELL window;
1942
+ // when the canvas iframe holds focus they never arrive. Hovering the
1943
+ // dock is the intent signal — grab shell focus so "press C, click a
1944
+ // clip" works without an extra priming click (dogfood 2026-07-30).
1945
+ if (!document.activeElement || document.activeElement === document.body) {
1946
+ rootRef.current?.focus();
1947
+ } else {
1948
+ const tag = document.activeElement.tagName;
1949
+ if (tag !== 'INPUT' && tag !== 'TEXTAREA' && tag !== 'SELECT') rootRef.current?.focus();
1950
+ }
1951
+ }}
1952
+ onDragOver={(e) => {
1953
+ if (!onDropMedia || !hasFiles(e.dataTransfer)) return;
1954
+ e.preventDefault();
1955
+ e.dataTransfer.dropEffect = 'copy';
1956
+ if (!dropActive) setDropActive(true);
1957
+ }}
1958
+ onDragLeave={(e) => {
1959
+ if (e.relatedTarget == null) {
1960
+ setDropActive(false);
1961
+ setDropCaret(null);
1962
+ }
1963
+ }}
1964
+ onDrop={onDrop}
1965
+ aria-label="Timeline"
1966
+ data-testid="timeline-panel"
1967
+ >
1968
+ <div
1969
+ className="tl-resize-handle"
1970
+ data-testid="timeline-resize-handle"
1971
+ title="Drag to resize"
1972
+ onPointerDown={beginResize}
1973
+ />
1974
+ <div className="tl-head">
1975
+ {comp ? (
1976
+ <>
1977
+ {/* P8 C3 (07 · .ve-tl-hd) — play · loop · time / length · the video's name, then the status, four
1978
+ tools and the size. Everything else the v1 header carried is one disclosure down (Advanced). */}
1979
+ {/* 07 ve-play: the keys are drawn tips over the play button — "Pause — tap space" (hold space and drag to
1980
+ pan) on hover / focus, and "Step ← → one frame · ⇧ one second" while the playhead is being stepped */}
1981
+ <span className="tl-play-wrap">
1982
+ <button
1983
+ type="button"
1984
+ className="icon-btn k-icon-sm tl-play"
1985
+ aria-label={playing ? 'Pause' : 'Play'}
1986
+ aria-pressed={playing}
1987
+ aria-describedby="timeline-play-tip"
1988
+ data-testid="timeline-playpause"
1989
+ onClick={() => (playing ? onPause?.() : onPlay?.())}
1990
+ >
1991
+ <TGlyph name={playing ? 'pause' : 'play'} />
1992
+ </button>
1993
+ <span
1994
+ className="tl-keytip tl-keytip--play"
1995
+ id="timeline-play-tip"
1996
+ role="tooltip"
1997
+ data-testid="timeline-play-tip"
1998
+ >
1999
+ {playing ? 'Pause' : 'Play'} — tap <kbd className="kbd">space</kbd>
2000
+ <span className="tl-keytip-dim">hold space and drag to pan</span>
2001
+ </span>
2002
+ {playback.stepping() ? (
2003
+ <span className="tl-keytip tl-keytip--step" data-testid="timeline-step-tip">
2004
+ Step <kbd className="kbd">←</kbd>
2005
+ <kbd className="kbd">→</kbd> one frame · <kbd className="kbd">⇧</kbd> one second
2006
+ </span>
2007
+ ) : null}
2008
+ </span>
2009
+ <button
2010
+ type="button"
2011
+ className="icon-btn k-icon-sm"
2012
+ aria-label="Loop"
2013
+ aria-pressed={loop}
2014
+ title="Loop"
2015
+ data-testid="timeline-loop"
2016
+ onClick={() => onToggleLoop?.()}
2017
+ >
2018
+ <TGlyph name="loop" />
2019
+ </button>
2020
+ <span
2021
+ className="tl-readout"
2022
+ data-testid="timeline-readout"
2023
+ title={`Frame ${clamped} of ${totalFrames - 1}`}
2024
+ >
2025
+ {advOpen ? (
2026
+ <>
2027
+ <b>{timecode(clamped, fps)}</b>{' '}
2028
+ <span className="tl-readout-len">/ {timecode(totalFrames, fps)}</span>
2029
+ </>
2030
+ ) : (
2031
+ <>
2032
+ <b>{readoutLabel(clamped, fps, playback.stepping())}</b>{' '}
2033
+ <span className="tl-readout-len">/ {mss(totalFrames / fps)}</span>
2034
+ </>
2035
+ )}
2036
+ </span>
2037
+ {/* issue #75 — the rows + transport belong to ONE artboard: the header names it. On a canvas with
2038
+ several videos where the shell could not tell which, it says so instead of guessing. */}
2039
+ {scopedArtboard || comps.length > 1 ? (
2040
+ <span
2041
+ className={`tl-name${scopedArtboard ? '' : ' is-unknown'}`}
2042
+ data-testid="timeline-name"
2043
+ title={
2044
+ scopedArtboard
2045
+ ? `The timeline of “${scopedArtboard}”`
2046
+ : 'This canvas has several videos and the timeline could not tell which one this is — Play may move a video you are not looking at.'
2047
+ }
2048
+ >
2049
+ <TGlyph name="video" size={12} />
2050
+ {scopedArtboard ?? 'This video'}
2051
+ </span>
2052
+ ) : null}
2053
+ {stripComments.length ? (
2054
+ // 10 · co-comment-video — what the markers below add up to
2055
+ <span className="tl-comments-n" data-testid="timeline-comments-count">
2056
+ <TGlyph name="comment" size={12} />
2057
+ {stripComments.length === 1
2058
+ ? '1 comment on this video'
2059
+ : `${stripComments.length} comments on this video`}
2060
+ </span>
2061
+ ) : null}
2062
+ <AiCutStatus cut={aiCut} />
2063
+ {cap.warn ? (
2064
+ // C22 — past 3 600 frames the video warns, here as everywhere (the Export sheet, the server). The
2065
+ // sentence is the same one; the badge opens Advanced, where Allow longer is.
2066
+ <button
2067
+ type="button"
2068
+ className="tl-status tl-status--warn tl-long-badge"
2069
+ data-testid="timeline-long-badge"
2070
+ title={cap.line}
2071
+ onClick={() => {
2072
+ // Advanced is at the foot of the full timeline: open it, and make the timeline full if it is not
2073
+ foldStore.set('timeline', true);
2074
+ if (!full) island?.onToggleSize?.();
2075
+ }}
2076
+ >
2077
+ <TGlyph name="clock" size={12} />
2078
+ {clock(totalFrames, fps)}
2079
+ </button>
2080
+ ) : null}
2081
+ {preparing > 0 ? (
2082
+ <span className="tl-status tl-prep-status" data-testid="timeline-prep-status">
2083
+ <TGlyph name="sync" size={12} />
2084
+ {FOOTAGE_WORDS.preparing(preparing)}
2085
+ </span>
2086
+ ) : null}
2087
+ <SharedStatus canvas={island?.canvas} artboardId={comp?.artboardId} />
2088
+ <KeptStatus />
2089
+ {onToggleMute && (playing || muted) ? (
2090
+ // 07 · ve-play — "Sound on" while it plays with sound; the same chip mutes (and says so while muted)
2091
+ <button
2092
+ type="button"
2093
+ className="tl-status tl-sound"
2094
+ data-testid="timeline-sound"
2095
+ aria-pressed={!muted}
2096
+ title={muted ? 'Sound off — click to turn it on' : 'Sound on — click to mute'}
2097
+ onClick={() => onToggleMute()}
2098
+ >
2099
+ {muted ? (
2100
+ <TGlyph name="mute" size={12} />
2101
+ ) : (
2102
+ <span className="tl-meter" aria-hidden="true">
2103
+ <i />
2104
+ <i />
2105
+ <i />
2106
+ </span>
2107
+ )}
2108
+ {muted ? 'Sound off' : 'Sound on'}
2109
+ </button>
2110
+ ) : null}
2111
+ <span className="tl-spacer" />
2112
+ <span className="tl-tools">
2113
+ {onSplitAtPlayhead ? (
2114
+ <button
2115
+ type="button"
2116
+ className="icon-btn k-icon-sm"
2117
+ aria-label="Split at the playhead"
2118
+ title="Split at the playhead · S"
2119
+ data-testid="timeline-split"
2120
+ disabled={noClips}
2121
+ {...reasonProps(noClips, SPLIT_NOTHING)}
2122
+ onClick={() => onSplitAtPlayhead()}
2123
+ >
2124
+ <TGlyph name="scissors" />
2125
+ </button>
2126
+ ) : null}
2127
+ {onAddTitle ? (
2128
+ <button
2129
+ type="button"
2130
+ className="icon-btn k-icon-sm"
2131
+ aria-label="Add text"
2132
+ title="Add text"
2133
+ data-testid="timeline-add-title"
2134
+ onClick={() => onAddTitle(clamped)}
2135
+ >
2136
+ <TGlyph name="type" />
2137
+ </button>
2138
+ ) : null}
2139
+ {island ? <CaptionsTool off={noClips} /> : null}
2140
+ {onDropMedia && canEditHere ? (
2141
+ <MusicTool onAddFiles={(files) => onDropMedia(files, null)} />
2142
+ ) : null}
2143
+ </span>
2144
+ <span className="tl-div" aria-hidden="true" />
2145
+ {full ? (
2146
+ <>
2147
+ <span className="tl-zoomer">
2148
+ <button
2149
+ type="button"
2150
+ className="icon-btn k-icon-sm tl-zoom-step"
2151
+ aria-label="Zoom out"
2152
+ title={zoomPxf == null ? 'The whole video already fits' : 'Zoom out · ⌘−'}
2153
+ disabled={zoomPxf == null}
2154
+ onClick={() => zoomTo(pxf / ZOOM_STEP)}
2155
+ >
2156
+ <TGlyph name="minus" size={12} />
2157
+ </button>
2158
+ <input
2159
+ type="range"
2160
+ className="tl-zoom"
2161
+ min="0"
2162
+ max="100"
2163
+ value={zoomSliderValue}
2164
+ data-testid="timeline-zoom"
2165
+ aria-label="Zoom the timeline"
2166
+ title="Zoom the timeline"
2167
+ onChange={(e) => zoomTo(zoomFromSlider(Number(e.target.value)))}
2168
+ />
2169
+ <button
2170
+ type="button"
2171
+ className="icon-btn k-icon-sm tl-zoom-step"
2172
+ aria-label="Zoom in"
2173
+ title="Zoom in · ⌘+"
2174
+ onClick={() => zoomTo(pxf * ZOOM_STEP)}
2175
+ >
2176
+ <TGlyph name="plus" size={12} />
2177
+ </button>
2178
+ </span>
2179
+ <button
2180
+ type="button"
2181
+ className="btn btn--ghost btn--sm tl-fit"
2182
+ data-testid="timeline-zoom-fit"
2183
+ title={
2184
+ zoomPxf == null ? 'The whole video already fits' : 'Fit the whole video · 0'
2185
+ }
2186
+ disabled={zoomPxf == null}
2187
+ onClick={() => setZoomPxf(null)}
2188
+ >
2189
+ Fit
2190
+ </button>
2191
+ </>
2192
+ ) : null}
2193
+ </>
2194
+ ) : (
2195
+ <span className="tl-title">Timeline</span>
2196
+ )}
2197
+ <SizeButton />
2198
+ </div>
2199
+
2200
+ {!comp ? (
2201
+ <div className="tl-empty" data-testid="timeline-empty">
2202
+ No video on this canvas yet. Drop clips here to start a cut, or make one with{' '}
2203
+ <b>⌘K → New video</b>.
2204
+ </div>
2205
+ ) : island?.empty && sequences.length === 0 && audio.length === 0 ? (
2206
+ // S7.7 (05 · es-timeline) — a video artboard with no clips: the kit's line + one AI chip. The panel's
2207
+ // own onDrop is on its root, so the block is the drop zone too.
2208
+ island.empty
2209
+ ) : (
2210
+ <div className="tl-scroll" ref={setScrollRef}>
2211
+ <div
2212
+ className={`tl-tracks${stripComments.length ? ' has-comment-row' : ''}`}
2213
+ ref={trackRef}
2214
+ data-testid="timeline-track"
2215
+ style={{ width: gutter + axisPx }}
2216
+ onPointerDown={onTrackDown}
2217
+ onDragOver={onLaneDragOver('overlay', 'tracks')}
2218
+ onDrop={onLaneDrop({ lane: 'overlay' })}
2219
+ >
2220
+ {stripComments.length ? (
2221
+ // Task 23 — 💬 marker strip. Preferred anchor: clipStableId +
2222
+ // frameOffset (survives reorder/ripple); a comment whose clip is
2223
+ // gone degrades to its absolute frame with a "detached" badge.
2224
+ <div className="tl-comments-strip" data-testid="timeline-comments-strip">
2225
+ {stripComments.map((c) => {
2226
+ const tl = c.timeline || {};
2227
+ const faced = !c.timeline && typeof c.t === 'number';
2228
+ let frame = null;
2229
+ let detached = false;
2230
+ if (faced) {
2231
+ // 10 · co-comment-video: a pin on the video keeps its second ("at 0:12"), not a clip
2232
+ frame = Math.round(c.t * fps);
2233
+ } else if (tl.clipStableId) {
2234
+ const row = sequences.find((r2) => r2.stableId === tl.clipStableId);
2235
+ if (row)
2236
+ frame =
2237
+ row.from + Math.min(tl.frameOffset || 0, Math.max(0, row.duration - 1));
2238
+ else if (tl.frame != null) {
2239
+ frame = tl.frame;
2240
+ detached = true;
2241
+ }
2242
+ } else if (tl.frame != null) {
2243
+ frame = tl.frame;
2244
+ }
2245
+ if (frame == null) return null;
2246
+ return (
2247
+ <button
2248
+ key={c.id}
2249
+ type="button"
2250
+ className={`tl-comment-pin${faced ? ' tl-comment-pin--face' : ''}${c.status === 'resolved' ? ' is-resolved' : ''}${detached ? ' is-detached' : ''}`}
2251
+ data-testid={`timeline-comment-${c.id}`}
2252
+ title={`${c.author || 'comment'}${detached ? ' (detached — clip removed)' : ''}: ${c.text}`}
2253
+ style={{
2254
+ left: gutter + x(clamp(frame, 0, totalFrames - 1)) - (faced ? 10 : 8),
2255
+ }}
2256
+ onPointerDown={(e) => e.stopPropagation()}
2257
+ onClick={(e) => {
2258
+ e.stopPropagation();
2259
+ onSeek?.(clamp(frame, 0, totalFrames - 1));
2260
+ // a video pin's thread is the canvas's own (the pin on the picture): the click only moves the playhead
2261
+ if (!faced)
2262
+ setCommentPopover({
2263
+ id: c.id,
2264
+ x: e.clientX - 130,
2265
+ y: Math.max(60, e.clientY - 180),
2266
+ });
2267
+ }}
2268
+ >
2269
+ {faced ? <Person name={c.author || ''} size="sm" /> : '💬'}
2270
+ </button>
2271
+ );
2272
+ })}
2273
+ </div>
2274
+ ) : null}
2275
+ {isBand(band) ? (
2276
+ <span
2277
+ className="tl-loop-lane"
2278
+ data-testid="timeline-loop-lane"
2279
+ style={{ left: gutter + x(band.in), width: x(band.out - band.in) }}
2280
+ />
2281
+ ) : null}
2282
+ <div className="tl-ruler" style={{ width: axisPx }}>
2283
+ {isBand(band) ? (
2284
+ <span
2285
+ className="tl-loop"
2286
+ data-testid="timeline-loop-band"
2287
+ title={`Loop ${fmtTime(band.in, fps)}–${fmtTime(band.out, fps)} · I and O set it`}
2288
+ style={{ left: x(band.in), width: x(band.out - band.in) }}
2289
+ />
2290
+ ) : null}
2291
+ {/* 07 · .ve-inout (ve-play) — the band's two ends are "I" and "O" badges: drag one, or step it with ← →
2292
+ (⇧ = one second). The keys I / O set them at the playhead as before. */}
2293
+ {isBand(band)
2294
+ ? ['in', 'out'].map((end) => (
2295
+ <LoopHandle
2296
+ key={end}
2297
+ end={end}
2298
+ band={band}
2299
+ fps={fps}
2300
+ total={totalFrames}
2301
+ left={x(band[end])}
2302
+ valueText={fmtTime(band[end], fps)}
2303
+ frameAt={frameAtClientX}
2304
+ onChange={(next) => compId && playback.setLoop(compId, next)}
2305
+ />
2306
+ ))
2307
+ : null}
2308
+ {/* 07 · .ve-poster-flag — the picture the video rests on; with none stored it is the default, 35 % in */}
2309
+ <span
2310
+ className="tl-poster-flag"
2311
+ data-testid="timeline-poster-flag"
2312
+ data-frame={posterAt}
2313
+ title={`Poster frame · ${fmtTime(posterAt, fps)}`}
2314
+ style={{ left: x(posterAt) }}
2315
+ >
2316
+ <TGlyph name="image" size={10} />
2317
+ Poster
2318
+ </span>
2319
+ {markers.map((m) => (
2320
+ <button
2321
+ key={`mk${m.frame}`}
2322
+ type="button"
2323
+ className="tl-marker-flag"
2324
+ data-testid={`timeline-marker-${m.frame}`}
2325
+ style={{ left: x(clamp(m.frame, 0, totalFrames - 1)) }}
2326
+ title={`${m.name || 'Marker'} · ${fmtTime(m.frame, fps)}`}
2327
+ onPointerDown={(e) => e.stopPropagation()}
2328
+ onClick={(e) => {
2329
+ e.stopPropagation();
2330
+ onSeek?.(m.frame);
2331
+ }}
2332
+ >
2333
+ <span className="tl-marker-name">{m.name}</span>
2334
+ </button>
2335
+ ))}
2336
+ {/* S7.17 — comment flags + time-pinned stickies on this video */}
2337
+ <RulerMarks
2338
+ file={capFile}
2339
+ artboardId={capId}
2340
+ fps={fps}
2341
+ total={totalFrames}
2342
+ x={x}
2343
+ onSeek={onSeek}
2344
+ />
2345
+ {ticks.map((f) => {
2346
+ const major = f % (fps || 30) === 0;
2347
+ const showLabel = (advOpen && adv.mode === 'frames') || major || step <= 5;
2348
+ return (
2349
+ <span
2350
+ key={f}
2351
+ className={`tl-tick${major ? ' is-major' : ''}${f === 0 ? ' is-start' : ''}`}
2352
+ style={{ left: x(f) }}
2353
+ >
2354
+ {showLabel ? (
2355
+ <span className="tl-tick-label">
2356
+ {advOpen && adv.mode === 'frames' ? frameTick(f) : rulerLabel(f, fps)}
2357
+ </span>
2358
+ ) : null}
2359
+ </span>
2360
+ );
2361
+ })}
2362
+ </div>
2363
+
2364
+ {laneCaret('overlay', 'tracks')}
2365
+ {sequences.length === 0 ? (
2366
+ <div className="tl-row">
2367
+ <span className="tl-row-label">comp</span>
2368
+ <div className="tl-row-track" style={{ width: axisPx, flex: 'none' }}>
2369
+ <div className="tl-seq-block" style={{ left: 0, width: axisPx }}>
2370
+ <span className="tl-seq-name">whole composition</span>
2371
+ </div>
2372
+ </div>
2373
+ </div>
2374
+ ) : bandMode ? (
2375
+ <>
2376
+ {/* Overlay band — standalone Sequences above the storyline.
2377
+ Rendered TOP = topmost paint (last in the document), so the
2378
+ stack reads like FCP; drag the V-chip to reorder layers. */}
2379
+ {(() => {
2380
+ // z-ladder = the overlay clips the SERVER can reorder
2381
+ // (standalone <Sequence>s; `loose` bare media has no clip
2382
+ // identity and stays out of the index space).
2383
+ const zLadder = overlay.filter(({ seq }) => !seq.loose);
2384
+ const overlayOf = (id) => overlay.filter(({ i }) => trackOfIdx.get(i) === id);
2385
+ const overlayRows = (list) =>
2386
+ packed(list).map(({ seq, i, join }) => {
2387
+ const docIdx = seq.loose ? null : zLadder.findIndex((o) => o.i === i);
2388
+ const vNum = docIdx == null ? null : docIdx + 2; // V1 = the storyline
2389
+ const rowCls =
2390
+ `tl-row tl-row--overlay` +
2391
+ (layerDrag && layerDrag.index === i ? ' is-layer-dragging' : '') +
2392
+ (layerDrag &&
2393
+ docIdx != null &&
2394
+ layerDrag.index !== i &&
2395
+ layerDrag.curTarget === docIdx
2396
+ ? ' is-layer-target'
2397
+ : '');
2398
+ return (
2399
+ <div
2400
+ className={rowCls}
2401
+ key={`o${i}`}
2402
+ data-testid={`timeline-row-${i}`}
2403
+ data-lane-join={join ? '1' : undefined}
2404
+ {...(docIdx != null ? { 'data-layer-doc': docIdx } : {})}
2405
+ >
2406
+ <span className="tl-row-label">
2407
+ {/* P8 C3 — the layer grip has no code-made id ("V2"); it shows on hover in full */}
2408
+ {docIdx != null && full ? (
2409
+ <span
2410
+ className="tl-row-grip"
2411
+ data-testid={`timeline-lane-chip-${i}`}
2412
+ role="presentation"
2413
+ title="Drag up or down to change which layer covers which"
2414
+ onPointerDown={(e) => startLayerDrag(e, i, docIdx)}
2415
+ />
2416
+ ) : null}
2417
+ </span>
2418
+ <div
2419
+ className="tl-row-track"
2420
+ style={{ width: axisPx, flex: 'none' }}
2421
+ onDragOver={onLaneDragOver('overlay', `o${i}`)}
2422
+ onDrop={onLaneDrop({ lane: 'overlay' })}
2423
+ >
2424
+ {renderBlock(seq, i, {
2425
+ lane: 'overlay',
2426
+ laneName: vNum != null ? `V${vNum}` : 'loose',
2427
+ })}
2428
+ {laneCaret('overlay', `o${i}`)}
2429
+ </div>
2430
+ </div>
2431
+ );
2432
+ });
2433
+ return [
2434
+ trackShell(
2435
+ 'text',
2436
+ 'Text',
2437
+ overlayRows(overlayOf('text')),
2438
+ null,
2439
+ // S7.11 — the captions are the Text track's second lane (derived from the words); it may
2440
+ // draw nothing, so it never stands in for the track's own (empty) lane
2441
+ <CaptionLane
2442
+ key="captions"
2443
+ canvas={island?.canvas ?? null}
2444
+ artboardId={comp?.artboardId ?? null}
2445
+ fps={fps}
2446
+ frame={clamped}
2447
+ x={x}
2448
+ axisPx={axisPx}
2449
+ onSeek={onSeek}
2450
+ />
2451
+ ),
2452
+ trackShell('gfx', 'Graphics', overlayRows(overlayOf('gfx'))),
2453
+ overlayOf('video2').length || extraTracks.includes('video2')
2454
+ ? trackShell('video2', 'Video 2', overlayRows(overlayOf('video2')))
2455
+ : null,
2456
+ ];
2457
+ })()}
2458
+ {/* THE storyline — series beats butted side-by-side. */}
2459
+ <div className="tl-track" data-track="video" data-testid="timeline-track-video">
2460
+ {trackChip('video', 'Video', {
2461
+ foldable: false,
2462
+ folded: false,
2463
+ count: storyline.length,
2464
+ })}
2465
+ <div className="tl-row tl-row--storyline" data-testid="timeline-storyline">
2466
+ <span className="tl-row-label" />
2467
+ <div
2468
+ className={`tl-row-track tl-storyline-track${reorderDrag ? ' is-reordering' : ''}${moveDrag?.overStory ? ' is-drop-target' : ''}`}
2469
+ style={{ width: axisPx, flex: 'none' }}
2470
+ onDragOver={onStoryDragOver}
2471
+ onDrop={onLaneDrop({ lane: 'storyline' })}
2472
+ >
2473
+ {storyline.map(({ seq, i }) =>
2474
+ renderBlock(seq, i, { lane: 'storyline', laneName: 'V1' })
2475
+ )}
2476
+ {reorderDrag ? null : renderSeams()}
2477
+ {reorderDrag ? null : renderAddSeams()}
2478
+ {dropCaret?.lane === 'storyline' ? (
2479
+ <>
2480
+ <span
2481
+ className="tl-drop-caret"
2482
+ data-testid="timeline-drop-caret"
2483
+ style={{ left: dropCaret.x - 1 }}
2484
+ />
2485
+ <DropLanding
2486
+ x={dropCaret.x}
2487
+ count={dropCaret.count}
2488
+ atFrame={dropCaret.frame}
2489
+ fps={fps}
2490
+ />
2491
+ </>
2492
+ ) : null}
2493
+ {landing ? (
2494
+ <MoveLanding x={x(landing.frame ?? 0)} text={landing.text} />
2495
+ ) : null}
2496
+ </div>
2497
+ </div>
2498
+ {/* Dogfood 2026-07-30 (image #22) — a decomposable beat (an
2499
+ old hand-authored scene component) expands into its layer
2500
+ sub-rows right under the storyline, exactly like the
2501
+ stacked fallback used to show; default-expanded. */}
2502
+ {storyline
2503
+ .filter(
2504
+ ({ seq, i }) =>
2505
+ Array.isArray(seq.layers) && seq.layers.length >= 2 && !collapsed.has(i)
2506
+ )
2507
+ .map(({ seq, i }) =>
2508
+ seq.layers.map((ly, li) => {
2509
+ const lyKind =
2510
+ ly.kind === 'video' || ly.kind === 'image' || ly.kind === 'audio'
2511
+ ? ly.kind
2512
+ : 'jsx';
2513
+ return (
2514
+ <div
2515
+ className="tl-row tl-row--layer"
2516
+ key={`bl${i}-${li}`}
2517
+ data-testid={`timeline-layer-${i}-${li}`}
2518
+ >
2519
+ <span className="tl-row-label" title={`${seq.label} · ${ly.label}`}>
2520
+ <span className="tl-layer-indent" aria-hidden="true" />
2521
+ <span className="tl-row-label-text">{ly.label}</span>
2522
+ </span>
2523
+ <div className="tl-row-track" style={{ width: axisPx, flex: 'none' }}>
2524
+ <div
2525
+ className="tl-seq-block tl-layer-block"
2526
+ data-kind={lyKind}
2527
+ data-testid={`timeline-layer-block-${i}-${li}`}
2528
+ title={`${seq.label} · ${ly.label} (${ly.kind} layer)`}
2529
+ style={{ left: x(seq.from), width: Math.max(2, x(seq.duration)) }}
2530
+ onContextMenu={(e) => {
2531
+ e.preventDefault();
2532
+ e.stopPropagation();
2533
+ setCtxMenu({
2534
+ index: i,
2535
+ layerIndex: li,
2536
+ x: e.clientX,
2537
+ y: e.clientY,
2538
+ });
2539
+ }}
2540
+ >
2541
+ <span className="tl-seq-name">{ly.label}</span>
2542
+ </div>
2543
+ {onReplaceLayer && (ly.mediaCdId || ly.mediaArrayRef) ? (
2544
+ <button
2545
+ type="button"
2546
+ className="tl-seq-replace"
2547
+ data-testid={`timeline-layer-replace-${i}-${li}`}
2548
+ title={`Replace this ${ly.kind}`}
2549
+ aria-label={`Replace ${ly.label}`}
2550
+ style={{ left: x(seq.from) + Math.max(2, x(seq.duration)) - 20 }}
2551
+ onPointerDown={(e) => e.stopPropagation()}
2552
+ onClick={(e) => {
2553
+ e.stopPropagation();
2554
+ onReplaceLayer(refFor(seq, i), li);
2555
+ }}
2556
+ >
2557
+ ⇄
2558
+ </button>
2559
+ ) : null}
2560
+ </div>
2561
+ </div>
2562
+ );
2563
+ })
2564
+ )}
2565
+ </div>
2566
+ {/* Audio band — standalone audio clips (movable/trimmable) +
2567
+ loose <Audio> beds, on Music (and Music 2 when two play at once). */}
2568
+ {(() => {
2569
+ const clipRow = ({ seq, i }, k) => (
2570
+ <div
2571
+ className="tl-row tl-row--overlay tl-row--audio"
2572
+ key={`ac${i}`}
2573
+ data-testid={`timeline-row-${i}`}
2574
+ >
2575
+ <span className="tl-row-label" />
2576
+ <div
2577
+ className="tl-row-track"
2578
+ style={{ width: axisPx, flex: 'none' }}
2579
+ onDragOver={onLaneDragOver('audio', `ac${i}`)}
2580
+ onDrop={onLaneDrop({ lane: 'audio' })}
2581
+ >
2582
+ {renderBlock(seq, i, { lane: 'audio', laneName: `A${k + 1}` })}
2583
+ <MusicLaneOverlay
2584
+ info={musicLane.forClip(seq.stableId)}
2585
+ x={x}
2586
+ speech={musicLane.speech}
2587
+ fps={musicLane.fps}
2588
+ finding={musicLane.finding(seq.mediaSrc)}
2589
+ name={songName(displayNameOf(seq, i))}
2590
+ />
2591
+ {laneCaret('audio', `ac${i}`)}
2592
+ </div>
2593
+ </div>
2594
+ );
2595
+ const musicOf = (id) => [
2596
+ ...audioClips
2597
+ .map((entry, k) =>
2598
+ trackOfIdx.get(entry.i) === id ? clipRow(entry, k) : null
2599
+ )
2600
+ .filter(Boolean),
2601
+ ...audio
2602
+ .map((a, i) => (trackOfBed.get(i) === id ? renderAudioRow(a, i) : null))
2603
+ .filter(Boolean),
2604
+ ];
2605
+ const music = musicOf('music');
2606
+ const music2 = musicOf('music2');
2607
+ return [
2608
+ trackShell(
2609
+ 'music',
2610
+ 'Music',
2611
+ music,
2612
+ music.length || music2.length || !isSilentVideo(sequences, audio) ? null : (
2613
+ <MusicHint
2614
+ artboard={scopedArtboard || undefined}
2615
+ canAsk={island?.canAsk}
2616
+ canEdit={canEditHere}
2617
+ onAddFiles={onDropMedia ? (files) => onDropMedia(files, null) : undefined}
2618
+ />
2619
+ )
2620
+ ),
2621
+ music2.length || extraTracks.includes('music2')
2622
+ ? trackShell('music2', 'Music 2', music2)
2623
+ : null,
2624
+ ];
2625
+ })()}
2626
+ {/* Debate verdict: the dead space below the lanes gets a JOB —
2627
+ it IS the new-layer drop target, and says so. */}
2628
+ <div
2629
+ className={`tl-newlayer-zone${dropCaret?.row === 'newlayer' ? ' is-active' : ''}`}
2630
+ data-testid="timeline-newlayer-zone"
2631
+ onDragOver={onLaneDragOver('overlay', 'newlayer')}
2632
+ onDrop={onLaneDrop({ lane: 'overlay' })}
2633
+ >
2634
+ <span style={{ marginLeft: gutter }}>Drop clips here — new layer</span>
2635
+ </div>
2636
+ </>
2637
+ ) : (
2638
+ <>
2639
+ {(() => {
2640
+ // gate-b-polish3 (07 · C35) — a purely digital comp keeps its row-per-sequence view (layers
2641
+ // expand under a row, dogfood 2026-07-30), but the rows sit in the SAME four tracks as a media
2642
+ // cut: Text · Graphics · Video · Music, top covers bottom. A track groups rows; every row's
2643
+ // testid, drag and expand are unchanged (S7.8: tracks are caption strips around the rows).
2644
+ const stackRow = (seq, i, join = false) => {
2645
+ const layers = Array.isArray(seq.layers) ? seq.layers : [];
2646
+ const decomposable = layers.length >= 2;
2647
+ const isExpanded = decomposable && !collapsed.has(i);
2648
+ const dur =
2649
+ retimeDrag && retimeDrag.index === i ? retimeDrag.curDur : seq.duration;
2650
+ return (
2651
+ <Fragment key={i}>
2652
+ <div
2653
+ className="tl-row"
2654
+ data-testid={`timeline-row-${i}`}
2655
+ data-lane-join={join ? '1' : undefined}
2656
+ >
2657
+ <span className="tl-row-label" title={seq.label}>
2658
+ {decomposable ? (
2659
+ <button
2660
+ type="button"
2661
+ className="tl-expand"
2662
+ data-testid={`timeline-expand-${i}`}
2663
+ title={isExpanded ? 'Collapse layers' : 'Show layers'}
2664
+ aria-label={
2665
+ isExpanded
2666
+ ? `Collapse ${seq.label} layers`
2667
+ : `Show ${seq.label} layers`
2668
+ }
2669
+ aria-expanded={isExpanded}
2670
+ onPointerDown={(e) => e.stopPropagation()}
2671
+ onClick={(e) => {
2672
+ e.stopPropagation();
2673
+ e.preventDefault();
2674
+ setCollapsed((prev) => {
2675
+ const next = new Set(prev);
2676
+ if (next.has(i)) next.delete(i);
2677
+ else next.add(i);
2678
+ return next;
2679
+ });
2680
+ }}
2681
+ >
2682
+ {isExpanded ? '▾' : '▸'}
2683
+ </button>
2684
+ ) : (
2685
+ <span className="tl-expand tl-expand--spacer" aria-hidden="true" />
2686
+ )}
2687
+ <span className="tl-row-label-text">{displayNameOf(seq, i)}</span>
2688
+ </span>
2689
+ {/* V2-8.5 c4-video (07 · ve-drop): files over the Video lane land between its beats, with the
2690
+ caret and "Drop N clips at …" — the same lane the media cut's storyline is */}
2691
+ <div
2692
+ className="tl-row-track"
2693
+ style={{ width: axisPx, flex: 'none' }}
2694
+ {...(seq.series
2695
+ ? {
2696
+ onDragOver: onStoryDragOver,
2697
+ onDrop: onLaneDrop({ lane: 'storyline' }),
2698
+ }
2699
+ : {})}
2700
+ >
2701
+ {renderBlock(seq, i, { lane: 'row' })}
2702
+ {dropCaret?.lane === 'storyline' &&
2703
+ seq.series &&
2704
+ i === sequences.findIndex((s) => s.series) ? (
2705
+ <>
2706
+ <span
2707
+ className="tl-drop-caret"
2708
+ data-testid="timeline-drop-caret"
2709
+ style={{ left: dropCaret.x - 1 }}
2710
+ />
2711
+ <DropLanding
2712
+ x={dropCaret.x}
2713
+ count={dropCaret.count}
2714
+ atFrame={dropCaret.frame}
2715
+ fps={fps}
2716
+ />
2717
+ </>
2718
+ ) : null}
2719
+ {/* the lifted beat's landing line + "Drop before …" tip, on the Video lane's first row */}
2720
+ {landing && seq.series && i === landing.firstRow ? (
2721
+ <MoveLanding x={x(landing.frame ?? 0)} text={landing.text} />
2722
+ ) : null}
2723
+ </div>
2724
+ </div>
2725
+ {isExpanded
2726
+ ? layers.map((ly, li) => {
2727
+ const lyKind =
2728
+ ly.kind === 'video'
2729
+ ? 'video'
2730
+ : ly.kind === 'image'
2731
+ ? 'image'
2732
+ : ly.kind === 'audio'
2733
+ ? 'audio'
2734
+ : 'jsx';
2735
+ const lyReplaceable = !!(ly.mediaCdId || ly.mediaArrayRef);
2736
+ return (
2737
+ <div
2738
+ className="tl-row tl-row--layer"
2739
+ key={`l${li}`}
2740
+ data-testid={`timeline-layer-${i}-${li}`}
2741
+ >
2742
+ <span className="tl-row-label" title={ly.label}>
2743
+ <span className="tl-layer-indent" aria-hidden="true" />
2744
+ <span className="tl-row-label-text">{ly.label}</span>
2745
+ </span>
2746
+ <div
2747
+ className="tl-row-track"
2748
+ style={{ width: axisPx, flex: 'none' }}
2749
+ >
2750
+ <div
2751
+ className="tl-seq-block tl-layer-block"
2752
+ data-kind={lyKind}
2753
+ data-testid={`timeline-layer-block-${i}-${li}`}
2754
+ title={`${ly.label} (${ly.kind} layer)`}
2755
+ style={{ left: x(seq.from), width: Math.max(2, x(dur)) }}
2756
+ onContextMenu={(e) => {
2757
+ e.preventDefault();
2758
+ e.stopPropagation();
2759
+ setCtxMenu({
2760
+ index: i,
2761
+ layerIndex: li,
2762
+ x: e.clientX,
2763
+ y: e.clientY,
2764
+ });
2765
+ }}
2766
+ >
2767
+ <span className="tl-seq-name">{ly.label}</span>
2768
+ </div>
2769
+ {onReplaceLayer && lyReplaceable ? (
2770
+ <button
2771
+ type="button"
2772
+ className="tl-seq-replace"
2773
+ data-testid={`timeline-layer-replace-${i}-${li}`}
2774
+ title={`Replace this ${ly.kind}`}
2775
+ aria-label={`Replace ${ly.label}`}
2776
+ style={{ left: x(seq.from) + Math.max(2, x(dur)) - 20 }}
2777
+ onPointerDown={(e) => e.stopPropagation()}
2778
+ onClick={(e) => {
2779
+ e.stopPropagation();
2780
+ onReplaceLayer(refFor(seq, i), li);
2781
+ }}
2782
+ >
2783
+ ⇄
2784
+ </button>
2785
+ ) : null}
2786
+ </div>
2787
+ </div>
2788
+ );
2789
+ })
2790
+ : null}
2791
+ </Fragment>
2792
+ );
2793
+ };
2794
+ // V2-8.5 c4-video (07 · ve-select): beats that never overlap share ONE lane — the board's Video
2795
+ // track is a strip of clips, not a staircase. A beat open into its layers keeps a lane to itself.
2796
+ const rowsOn = (id) =>
2797
+ packed(
2798
+ sequences
2799
+ .map((seq, i) => ({ seq, i }))
2800
+ .filter(({ i }) => trackOfIdx.get(i) === id)
2801
+ ).map(({ seq, i, join }) => stackRow(seq, i, join));
2802
+ const bedsOn = (id) =>
2803
+ audio
2804
+ .map((a, i) => (trackOfBed.get(i) === id ? renderAudioRow(a, i) : null))
2805
+ .filter(Boolean);
2806
+ return drawnTracks.map((t) =>
2807
+ trackShell(t.id, t.label, [...rowsOn(t.id), ...bedsOn(t.id)])
2808
+ );
2809
+ })()}
2810
+ </>
2811
+ )}
2812
+
2813
+ {snapFlash ? (
2814
+ <span className="tl-snapline" style={{ left: gutter + x(snapFlash.frame) }} />
2815
+ ) : null}
2816
+ {/* S7.17 — teammates' playheads, and the tag over a caption word one of them is fixing */}
2817
+ <PeerHeads
2818
+ canvas={capFile}
2819
+ artboardId={capId}
2820
+ x={x}
2821
+ gutter={gutter}
2822
+ total={totalFrames}
2823
+ />
2824
+ <span
2825
+ className="tl-playhead"
2826
+ data-testid="timeline-playhead"
2827
+ style={{ left: gutter + x(clamped) }}
2828
+ />
2829
+ <AiEdge cut={aiCut} left={aiCut?.edge != null ? gutter + x(aiCut.edge) : Number.NaN} />
2830
+ </div>
2831
+ </div>
2832
+ )}
2833
+ {comp && full ? (
2834
+ <AdvancedFoot
2835
+ canvas={capFile}
2836
+ artboardId={capId}
2837
+ fps={fps}
2838
+ total={totalFrames}
2839
+ frame={clamped}
2840
+ sequences={sequences}
2841
+ selectedClipId={selectedClipId}
2842
+ canEdit={canEditHere && !!onClipVerb}
2843
+ canRead
2844
+ cap={cap}
2845
+ onCap={(action) =>
2846
+ capFile && capId
2847
+ ? void saveMaxFrames(capFile, capId, action === 'allow' ? CAP_CEILING : null)
2848
+ : undefined
2849
+ }
2850
+ have={drawnTracks.map((t) => t.id)}
2851
+ onWriteEasing={(kf, bezier) => onClipVerb?.(null, 'video.easing.set', { ...kf, bezier })}
2852
+ tools={
2853
+ // 07 · note 26 — "Everything the old timeline had, one disclosure down": the v1 header's other tools
2854
+ <div className="tla-tools" data-testid="timeline-more-tools">
2855
+ <button
2856
+ type="button"
2857
+ className="btn btn--ghost btn--sm"
2858
+ aria-label="Jump to start"
2859
+ onClick={() => onSeek?.(0)}
2860
+ >
2861
+ <TGlyph name="step-back" size={12} />
2862
+ To the start
2863
+ </button>
2864
+ {onAddImage ? (
2865
+ <button
2866
+ type="button"
2867
+ className="btn btn--ghost btn--sm"
2868
+ title="Add an image at the playhead"
2869
+ data-testid="timeline-add-image"
2870
+ onClick={() => onAddImage(clamped)}
2871
+ >
2872
+ <TGlyph name="image" size={12} />
2873
+ Add image
2874
+ </button>
2875
+ ) : null}
2876
+ {onAddAiClip ? (
2877
+ <button
2878
+ type="button"
2879
+ className="btn btn--ghost btn--sm"
2880
+ title="Add a shot for AI to make, at the end"
2881
+ data-testid="timeline-placeholder-add"
2882
+ onClick={() => onAddAiClip()}
2883
+ >
2884
+ <TGlyph name="spark" size={12} />
2885
+ Shot for AI
2886
+ </button>
2887
+ ) : null}
2888
+ {onAddComment ? (
2889
+ <button
2890
+ type="button"
2891
+ className="btn btn--ghost btn--sm"
2892
+ aria-pressed={commentMode}
2893
+ title="Click anywhere on the timeline to pin a comment · C"
2894
+ data-testid="timeline-comment-tool"
2895
+ onClick={() => setCommentMode((m) => !m)}
2896
+ >
2897
+ <TGlyph name="comment" size={12} />
2898
+ Comment
2899
+ </button>
2900
+ ) : null}
2901
+ {onToggleMute ? (
2902
+ <button
2903
+ type="button"
2904
+ className="btn btn--ghost btn--sm"
2905
+ aria-pressed={!muted}
2906
+ data-testid="timeline-mute"
2907
+ onClick={() => onToggleMute()}
2908
+ >
2909
+ <TGlyph name={muted ? 'mute' : 'volume'} size={12} />
2910
+ {muted ? 'Sound off' : 'Sound on'}
2911
+ </button>
2912
+ ) : null}
2913
+ {onVolume ? (
2914
+ <label className="tla-vol">
2915
+ Volume
2916
+ <input
2917
+ type="range"
2918
+ className="tl-volume"
2919
+ min="0"
2920
+ max="100"
2921
+ value={Math.round((muted ? 0 : volume) * 100)}
2922
+ data-testid="timeline-volume"
2923
+ onChange={(e) => onVolume(Number(e.target.value) / 100)}
2924
+ />
2925
+ </label>
2926
+ ) : null}
2927
+ </div>
2928
+ }
2929
+ />
2930
+ ) : null}
2931
+ {commentDraft
2932
+ ? portalToBody(
2933
+ <div
2934
+ className="tlci tlci--comment"
2935
+ style={{ left: commentDraft.x, top: commentDraft.y }}
2936
+ >
2937
+ <div className="tlci-head" style={{ cursor: 'default' }}>
2938
+ <span className="tlci-title">
2939
+ Comment at {fmtTime(commentDraft.at, fps)}
2940
+ {commentDraft.anchor.lane ? ` · ${commentDraft.anchor.lane}` : ''}
2941
+ </span>
2942
+ <button
2943
+ type="button"
2944
+ className="tlci-x"
2945
+ aria-label="Close"
2946
+ onClick={() => setCommentDraft(null)}
2947
+ >
2948
+ ×
2949
+ </button>
2950
+ </div>
2951
+ <div className="tlci-body">
2952
+ <textarea
2953
+ className="tlci-textarea"
2954
+ rows={3}
2955
+ autoFocus
2956
+ placeholder="Comment… (Enter to add)"
2957
+ data-testid="timeline-comment-composer"
2958
+ onKeyDown={(e) => {
2959
+ e.stopPropagation();
2960
+ if (e.key === 'Enter' && !e.shiftKey) {
2961
+ e.preventDefault();
2962
+ const text = e.currentTarget.value.trim();
2963
+ if (text) onAddComment?.(commentDraft.anchor, text);
2964
+ setCommentDraft(null);
2965
+ } else if (e.key === 'Escape') {
2966
+ setCommentDraft(null);
2967
+ }
2968
+ }}
2969
+ />
2970
+ <div className="tlci-row">
2971
+ <button
2972
+ type="button"
2973
+ className="tlci-btn"
2974
+ data-testid="timeline-comment-submit"
2975
+ onClick={(e) => {
2976
+ const ta = e.currentTarget.closest('.tlci')?.querySelector('textarea');
2977
+ const text = ta?.value?.trim();
2978
+ if (text) onAddComment?.(commentDraft.anchor, text);
2979
+ setCommentDraft(null);
2980
+ }}
2981
+ >
2982
+ Add comment
2983
+ </button>
2984
+ </div>
2985
+ </div>
2986
+ </div>
2987
+ )
2988
+ : null}
2989
+ {commentPopover
2990
+ ? portalToBody(
2991
+ (() => {
2992
+ const c = comments.find((k) => k.id === commentPopover.id);
2993
+ if (!c) return null;
2994
+ return (
2995
+ <div
2996
+ className="tlci"
2997
+ style={{ left: commentPopover.x, top: commentPopover.y }}
2998
+ role="dialog"
2999
+ aria-label="Timeline comment"
3000
+ data-testid="timeline-comment-popover"
3001
+ onPointerDown={(e) => e.stopPropagation()}
3002
+ >
3003
+ <div className="tlci-head">
3004
+ <span className="tlci-title">💬 {c.author || 'comment'}</span>
3005
+ <button
3006
+ type="button"
3007
+ className="tlci-x"
3008
+ aria-label="Close"
3009
+ onClick={() => setCommentPopover(null)}
3010
+ >
3011
+ ×
3012
+ </button>
3013
+ </div>
3014
+ <div className="tlci-body">
3015
+ <p className="tlci-comment-text">{c.text}</p>
3016
+ {(c.thread || []).map((r2, k2) => (
3017
+ <p key={k2} className="tlci-note">
3018
+ ↳ {r2.author ? `${r2.author}: ` : ''}
3019
+ {r2.body}
3020
+ </p>
3021
+ ))}
3022
+ <div className="tlci-presets">
3023
+ {c.status !== 'resolved' && onResolveComment ? (
3024
+ <button
3025
+ type="button"
3026
+ className="tlci-chip"
3027
+ onClick={() => {
3028
+ onResolveComment(c.id);
3029
+ setCommentPopover(null);
3030
+ }}
3031
+ >
3032
+ Resolve
3033
+ </button>
3034
+ ) : null}
3035
+ {onDeleteComment ? (
3036
+ <button
3037
+ type="button"
3038
+ className="tlci-chip"
3039
+ onClick={() => {
3040
+ onDeleteComment(c.id);
3041
+ setCommentPopover(null);
3042
+ }}
3043
+ >
3044
+ Delete comment
3045
+ </button>
3046
+ ) : null}
3047
+ </div>
3048
+ </div>
3049
+ </div>
3050
+ );
3051
+ })()
3052
+ )
3053
+ : null}
3054
+ {joinPicker && picker
3055
+ ? portalToBody(
3056
+ <TransitionPicker
3057
+ title={picker.title}
3058
+ tile={picker.tile}
3059
+ frames={picker.frames}
3060
+ fps={fps}
3061
+ a={picker.a}
3062
+ b={picker.b}
3063
+ x={joinPicker.x}
3064
+ y={joinPicker.y}
3065
+ canEdit={island ? island.canEdit !== false : true}
3066
+ onPick={(key) => picker.set({ presentation: key })}
3067
+ onLength={(frames) => picker.set({ durationInFrames: frames })}
3068
+ onClose={() => {
3069
+ // a11y — esc / a click away hands focus back to the join it opened from
3070
+ const from = joinPicker.from;
3071
+ setJoinPicker(null);
3072
+ if (from?.isConnected) from.focus?.();
3073
+ }}
3074
+ />
3075
+ )
3076
+ : null}
3077
+ {/* S7.13 — Re-frame: the selected clip's window per format (drawn only while opened) */}
3078
+ <ReframeHost
3079
+ seq={selSeq}
3080
+ comp={comp}
3081
+ fps={fps}
3082
+ frame={frame}
3083
+ name={selSeq ? displayNameOf(selSeq, selIndex) : ''}
3084
+ canvas={island?.canvas ?? null}
3085
+ artboardId={comp?.artboardId ?? null}
3086
+ canEdit={canEditHere && !!onClipVerb}
3087
+ url={selSeq?.mediaSrc ? resolveUrl(selSeq.mediaSrc) : null}
3088
+ run={(params) => selSeq && onClipVerb?.(refFor(selSeq, selIndex), 'video.reframe', params)}
3089
+ />
3090
+ {/* S7.15 — Other takes: the selected clip's other good moments, swapped in at the same length (07 · ve-ai-adjust) */}
3091
+ <OtherTakesHost
3092
+ seq={selSeq}
3093
+ fps={fps}
3094
+ name={selSeq ? displayNameOf(selSeq, selIndex) : ''}
3095
+ canEdit={canEditHere && !!onClipVerb}
3096
+ url={selSeq?.mediaSrc ? resolveUrl(selSeq.mediaSrc) : null}
3097
+ run={(params) =>
3098
+ selSeq && onClipVerb?.(refFor(selSeq, selIndex), 'video.take.swap', params)
3099
+ }
3100
+ />
3101
+ {fitFill.ask
3102
+ ? portalToBody(
3103
+ <FitFillAsk ask={fitFill.ask} onAnswer={fitFill.answer} onClose={fitFill.dismiss} />
3104
+ )
3105
+ : null}
3106
+ {ctxMenu && sequences[ctxMenu.index]
3107
+ ? portalToBody(
3108
+ (() => {
3109
+ const seq = sequences[ctxMenu.index];
3110
+ const i = ctxMenu.index;
3111
+ const ref = refFor(seq, i);
3112
+ // Vertical z-order (overlay clips only) — mirrors the V-chip drag.
3113
+ const zLadder = overlay.filter((o) => !o.seq.loose);
3114
+ const docIdx = zLadder.findIndex((o) => o.i === i);
3115
+ // the series beats, in order: "earlier" and "later" are relative to THEM, not to every row
3116
+ const beats = sequences
3117
+ .map((s2, i2) => ({ s: s2, i: i2 }))
3118
+ .filter(({ s: s2 }) => s2.series);
3119
+ const at = beats.findIndex((b) => b.i === i);
3120
+ const prevBeat = at > 0 ? beats[at - 1] : null;
3121
+ const nextBeat = at >= 0 && at < beats.length - 1 ? beats[at + 1] : null;
3122
+ // S7.9 — the 17 v1 items, six drawn and eleven under Advanced ▸ (edit/clip-menu.js).
3123
+ return (
3124
+ <ClipMenu
3125
+ x={ctxMenu.x}
3126
+ y={ctxMenu.y}
3127
+ onClose={() => setCtxMenu(null)}
3128
+ model={{
3129
+ seq,
3130
+ index: seq.series ? Math.max(0, at) : i,
3131
+ count: seq.series ? beats.length : sequences.length,
3132
+ rowKind: rowKind(seq),
3133
+ layerIndex: ctxMenu.layerIndex ?? null,
3134
+ zLadder: docIdx >= 0 ? { docIdx, len: zLadder.length } : null,
3135
+ has: {
3136
+ comment: !!onAddComment,
3137
+ generate: !!onGeneratePlaceholder,
3138
+ verb: !!onClipVerb,
3139
+ replace: !!onReplace,
3140
+ reorder: !!onReorder,
3141
+ hide: !!onToggleHide,
3142
+ remove: !!onRemove,
3143
+ replaceLayer: !!onReplaceLayer,
3144
+ },
3145
+ }}
3146
+ run={{
3147
+ comment: () =>
3148
+ // Same anchored composer as the C tool — no modal.
3149
+ setCommentDraft({
3150
+ x: clamp(ctxMenu.x - 130, 8, window.innerWidth - 280),
3151
+ y: Math.max(48, ctxMenu.y - 140),
3152
+ anchor: {
3153
+ clipStableId: seq.stableId || undefined,
3154
+ frameOffset: Math.max(0, clamped - (seq.from || 0)),
3155
+ frame: clamped,
3156
+ },
3157
+ at: clamped,
3158
+ }),
3159
+ generate: () => onGeneratePlaceholder(ref),
3160
+ // S7.10 — Adjust… selects the clip: the right-hand inspector is where it is adjusted
3161
+ adjust: () => onSelect?.(seq.stableId ?? null),
3162
+ hide: () => onToggleHide(ref),
3163
+ show: () => onToggleHide(ref),
3164
+ remove: () => onRemove(ref),
3165
+ replace: () => onReplace(ref),
3166
+ mute: () => onClipVerb(ref, 'audio', { muted: true }),
3167
+ unmute: () => onClipVerb(ref, 'audio', { muted: false }),
3168
+ 'detach-audio': () => onClipVerb(ref, 'detach-audio', {}),
3169
+ 'to-overlay': () => onClipVerb(ref, 'to-overlay', {}),
3170
+ 'to-storyline': () => onClipVerb(ref, 'to-storyline', {}),
3171
+ 'layer-up': () => onClipVerb(ref, 'layer-order', { toIndex: docIdx + 1 }),
3172
+ 'layer-down': () => onClipVerb(ref, 'layer-order', { toIndex: docIdx - 1 }),
3173
+ // a series beat swaps places with its neighbour through the ONE move op; a layer re-stacks
3174
+ earlier: () =>
3175
+ seq.series
3176
+ ? prevBeat && onReorderMove?.(ref, refFor(prevBeat.s, prevBeat.i), 'before')
3177
+ : onReorder(ref, 'forward'),
3178
+ later: () =>
3179
+ seq.series
3180
+ ? nextBeat && onReorderMove?.(ref, refFor(nextBeat.s, nextBeat.i), 'after')
3181
+ : onReorder(ref, 'backward'),
3182
+ 'replace-layer': () => onReplaceLayer(ref, ctxMenu.layerIndex),
3183
+ }}
3184
+ />
3185
+ );
3186
+ })()
3187
+ )
3188
+ : null}
3189
+ {island?.fileDrag && island.dropRect && onDropMedia ? (
3190
+ <ArtboardDropCatcher rect={island.dropRect} onFiles={(files) => onDropMedia(files, null)} />
3191
+ ) : null}
3192
+ </aside>
3193
+ );
3194
+ }