@1agh/maude 2.0.4 → 2.0.8

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 (272) hide show
  1. package/apps/hub/src/project-transactions/kernel.mjs +10 -1
  2. package/apps/studio/access/closure.ts +156 -16
  3. package/apps/studio/access/filters.ts +39 -5
  4. package/apps/studio/access/known-canvases.ts +24 -1
  5. package/apps/studio/access/refused-inputs.ts +89 -0
  6. package/apps/studio/actions/agents.ts +59 -0
  7. package/apps/studio/actions/ctx.ts +3 -0
  8. package/apps/studio/actions/defs/app.ts +12 -0
  9. package/apps/studio/actions/defs/sync.ts +13 -0
  10. package/apps/studio/actions/defs/view.ts +59 -3
  11. package/apps/studio/actions/keymap.gen.ts +35 -0
  12. package/apps/studio/actions/menu.ts +2 -0
  13. package/apps/studio/actions/types.ts +3 -1
  14. package/apps/studio/actions.manifest.json +148 -1
  15. package/apps/studio/actions.parity.json +31 -1
  16. package/apps/studio/annotations/ui/ai-seen.tsx +4 -3
  17. package/apps/studio/annotations/ui/element-node.tsx +139 -54
  18. package/apps/studio/annotations/ui/lod.tsx +1 -1
  19. package/apps/studio/annotations/ui/ride.ts +2 -1
  20. package/apps/studio/annotations/ui/text-style.ts +1 -1
  21. package/apps/studio/annotations-context-toolbar.tsx +5 -4
  22. package/apps/studio/annotations-layer.tsx +4 -15
  23. package/apps/studio/api.ts +425 -128
  24. package/apps/studio/artboard-activity-overlay.tsx +4 -4
  25. package/apps/studio/artboard-ai-copies.tsx +4 -4
  26. package/apps/studio/artboard-freeze.ts +108 -0
  27. package/apps/studio/artboard-live-gate.tsx +636 -0
  28. package/apps/studio/artboard-live.ts +831 -0
  29. package/apps/studio/artboard-placeholder.ts +197 -0
  30. package/apps/studio/artboard-still-raster.ts +485 -0
  31. package/apps/studio/artboard-still-warmup.ts +221 -0
  32. package/apps/studio/artboard-still.ts +1188 -0
  33. package/apps/studio/artboard-webgl.ts +669 -0
  34. package/apps/studio/asset-placeholder.tsx +237 -132
  35. package/apps/studio/asset-upload-bars.tsx +4 -4
  36. package/apps/studio/bin/_agent-browser-bin.mjs +8 -0
  37. package/apps/studio/bin/_agent-browser-safe.mjs +2 -1
  38. package/apps/studio/bin/_canvas-reasons.mjs +34 -0
  39. package/apps/studio/bin/_ds-check-live.mjs +37 -0
  40. package/apps/studio/bin/_ds-check.mjs +4 -1
  41. package/apps/studio/bin/_ds-prove-judge.mjs +167 -0
  42. package/apps/studio/bin/_ds-prove-playwright.mjs +183 -105
  43. package/apps/studio/bin/_import-asset.mjs +2 -1
  44. package/apps/studio/bin/_perf-probe-open.mjs +364 -0
  45. package/apps/studio/bin/_perf-probe.mjs +2 -1
  46. package/apps/studio/bin/_perf-shared.mjs +12 -7
  47. package/apps/studio/bin/_pw-launch.mjs +26 -1
  48. package/apps/studio/bin/_studio-verb.mjs +24 -3
  49. package/apps/studio/bin/_thumb-blank.mjs +70 -0
  50. package/apps/studio/bin/_thumb-cover.mjs +35 -0
  51. package/apps/studio/bin/_thumbs-playwright.mjs +89 -12
  52. package/apps/studio/bin/ds-check.sh +5 -1
  53. package/apps/studio/bin/perf.sh +30 -1
  54. package/apps/studio/bin/server-up.sh +7 -2
  55. package/apps/studio/bin/smoke.sh +19 -0
  56. package/apps/studio/bridge/dgn-protocol.ts +35 -0
  57. package/apps/studio/canvas-build-sandbox.ts +69 -13
  58. package/apps/studio/canvas-camera.ts +90 -0
  59. package/apps/studio/canvas-comment-mount.tsx +9 -9
  60. package/apps/studio/canvas-lib.tsx +289 -44
  61. package/apps/studio/canvas-pages-view.tsx +465 -0
  62. package/apps/studio/canvas-pages.ts +305 -0
  63. package/apps/studio/canvas-rows.ts +62 -0
  64. package/apps/studio/canvas-shell.tsx +62 -16
  65. package/apps/studio/canvas-theme-icons.tsx +41 -0
  66. package/apps/studio/canvas-theme-pill.tsx +15 -6
  67. package/apps/studio/canvas-theme.ts +12 -11
  68. package/apps/studio/client/app.jsx +7 -0
  69. package/apps/studio/client/canvas-url.js +36 -1
  70. package/apps/studio/client/home/HomeAccounts.jsx +262 -0
  71. package/apps/studio/client/home/Shelves.jsx +4 -3
  72. package/apps/studio/client/home/home-accounts-model.js +121 -0
  73. package/apps/studio/client/home/home-api.js +6 -0
  74. package/apps/studio/client/home/home-app.jsx +141 -40
  75. package/apps/studio/client/home/home-model.js +172 -6
  76. package/apps/studio/client/home/home.css +169 -5
  77. package/apps/studio/client/home/shell-mode.js +8 -1
  78. package/apps/studio/client/hooks/canvas-origin-probe.js +34 -0
  79. package/apps/studio/client/hooks/use-action-keys.jsx +3 -1
  80. package/apps/studio/client/hooks/use-canvas-bridge.jsx +1 -1
  81. package/apps/studio/client/hooks/use-palette-and-panels.jsx +23 -6
  82. package/apps/studio/client/hooks/use-photo-and-timeline.jsx +16 -8
  83. package/apps/studio/client/hooks/use-project-data.jsx +13 -2
  84. package/apps/studio/client/hooks/use-shell-core.jsx +19 -9
  85. package/apps/studio/client/index-loader.ts +41 -21
  86. package/apps/studio/client/inspector/inspector-panel.jsx +35 -14
  87. package/apps/studio/client/panels/ChatPanel.jsx +27 -20
  88. package/apps/studio/client/panels/CreateProject.jsx +19 -5
  89. package/apps/studio/client/panels/caps-cache.js +46 -0
  90. package/apps/studio/client/shell/viewport.jsx +66 -22
  91. package/apps/studio/client/tree/tree.jsx +17 -0
  92. package/apps/studio/client/v2/access/access-client.js +2 -0
  93. package/apps/studio/client/v2/access/access-host.jsx +12 -1
  94. package/apps/studio/client/v2/access/trashed-banner.jsx +6 -3
  95. package/apps/studio/client/v2/ai/Advanced.jsx +12 -0
  96. package/apps/studio/client/v2/ai/Composer.jsx +27 -10
  97. package/apps/studio/client/v2/canvases/canvases-panel.jsx +24 -0
  98. package/apps/studio/client/v2/canvases/use-canvas-index.js +24 -1
  99. package/apps/studio/client/v2/code/canvas-error-card.jsx +14 -2
  100. package/apps/studio/client/v2/code/canvas-imports-card.jsx +19 -14
  101. package/apps/studio/client/v2/code/canvas-imports-words.js +60 -0
  102. package/apps/studio/client/v2/code/canvas-waiting-card.jsx +59 -5
  103. package/apps/studio/client/v2/code/canvas-waiting.js +18 -1
  104. package/apps/studio/client/v2/code/code-bus.js +5 -0
  105. package/apps/studio/client/v2/code/code-consent-sheet.jsx +87 -0
  106. package/apps/studio/client/v2/code/code-consent.js +67 -0
  107. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +62 -10
  108. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +314 -5
  109. package/apps/studio/client/v2/ds/advanced-host.jsx +11 -26
  110. package/apps/studio/client/v2/ds/ds-refresh.js +161 -0
  111. package/apps/studio/client/v2/ds/library-host.jsx +45 -45
  112. package/apps/studio/client/v2/ds/make-host.jsx +13 -15
  113. package/apps/studio/client/v2/ds/off-system-host.jsx +18 -19
  114. package/apps/studio/client/v2/ds/review-host.jsx +7 -1
  115. package/apps/studio/client/v2/ds/truth-host.jsx +15 -17
  116. package/apps/studio/client/v2/ds/upgrade-host.jsx +26 -10
  117. package/apps/studio/client/v2/history/branch-actions.js +13 -9
  118. package/apps/studio/client/v2/history/git-advanced.jsx +8 -1
  119. package/apps/studio/client/v2/history/git-model.js +3 -1
  120. package/apps/studio/client/v2/history/git-parts.jsx +16 -1
  121. package/apps/studio/client/v2/layers/artboard-layers.jsx +24 -5
  122. package/apps/studio/client/v2/layers/layers-request.js +49 -0
  123. package/apps/studio/client/v2/left-panel/canvases-pinned.jsx +93 -3
  124. package/apps/studio/client/v2/left-panel/ds-boards.js +39 -0
  125. package/apps/studio/client/v2/left-panel/left-panel-model.js +13 -0
  126. package/apps/studio/client/v2/left-panel/left-panel.css +24 -0
  127. package/apps/studio/client/v2/presence/faces.jsx +42 -14
  128. package/apps/studio/client/v2/shell/account-card.jsx +10 -4
  129. package/apps/studio/client/v2/shell/canvas-crash-guard.js +172 -0
  130. package/apps/studio/client/v2/shell/canvas-mode.js +17 -1
  131. package/apps/studio/client/v2/shell/floating-panels.css +37 -1
  132. package/apps/studio/client/v2/shell/github-signin-host.jsx +42 -0
  133. package/apps/studio/client/v2/shell/menu-runner.js +11 -0
  134. package/apps/studio/client/v2/shell/mode-switch.jsx +14 -3
  135. package/apps/studio/client/v2/shell/opening-skeleton.js +118 -0
  136. package/apps/studio/client/v2/shell/opening-skeleton.jsx +103 -0
  137. package/apps/studio/client/v2/shell/pages-pick.js +49 -0
  138. package/apps/studio/client/v2/shell/project-account-card.jsx +203 -0
  139. package/apps/studio/client/v2/shell/project-account-model.js +182 -0
  140. package/apps/studio/client/v2/shell/project-menu-model.js +3 -0
  141. package/apps/studio/client/v2/shell/share-cluster-host.jsx +140 -11
  142. package/apps/studio/client/v2/shell/share-cluster.css +58 -0
  143. package/apps/studio/client/v2/shell/share-cluster.jsx +26 -7
  144. package/apps/studio/client/v2/shell/shell-parity.json +8 -0
  145. package/apps/studio/client/v2/shell/team-switch.js +94 -0
  146. package/apps/studio/client/v2/shell/too-heavy-card.jsx +38 -0
  147. package/apps/studio/client/v2/shell/use-account.js +8 -1
  148. package/apps/studio/client/v2/shell/use-canvas-mode-lane.js +30 -0
  149. package/apps/studio/collab/persistence.ts +9 -1
  150. package/apps/studio/collab/registry.ts +32 -0
  151. package/apps/studio/collab/room.ts +8 -0
  152. package/apps/studio/comments-overlay.tsx +12 -11
  153. package/apps/studio/config-reload-wire.ts +56 -0
  154. package/apps/studio/config.schema.json +6 -0
  155. package/apps/studio/context.ts +37 -1
  156. package/apps/studio/dist/client.bundle.js +1198 -1198
  157. package/apps/studio/dist/comment-mount.js +2 -2
  158. package/apps/studio/dist/styles.css +1 -1
  159. package/apps/studio/ds/board/board.css +6 -0
  160. package/apps/studio/ds/board/ds-bar.tsx +21 -3
  161. package/apps/studio/ds/board/specimen.tsx +16 -2
  162. package/apps/studio/ds/board/template.ts +39 -19
  163. package/apps/studio/ds/canvas-cli.ts +58 -2
  164. package/apps/studio/ds/check.ts +26 -1
  165. package/apps/studio/ds/cli.ts +14 -4
  166. package/apps/studio/ds/component-list.ts +2 -1
  167. package/apps/studio/ds/convert.ts +34 -6
  168. package/apps/studio/ds/default.ts +6 -1
  169. package/apps/studio/ds/ds-resolver.ts +58 -8
  170. package/apps/studio/ds/ds-verb.ts +13 -0
  171. package/apps/studio/ds/engine.ts +3 -1
  172. package/apps/studio/ds/folder-systems.ts +199 -0
  173. package/apps/studio/ds/pairing-css.ts +2 -1
  174. package/apps/studio/ds/post-build.ts +38 -0
  175. package/apps/studio/ds/rename.ts +10 -3
  176. package/apps/studio/ds/shell-fallbacks.ts +2 -1
  177. package/apps/studio/ds/upgrade-apply.ts +27 -5
  178. package/apps/studio/ds/upgrade-cli.ts +22 -2
  179. package/apps/studio/ds/upgrade-prove.ts +198 -15
  180. package/apps/studio/ds/upgrade-stage.ts +10 -3
  181. package/apps/studio/editing/ai-point-ring.tsx +4 -4
  182. package/apps/studio/editing/ai-scope-outline.tsx +4 -4
  183. package/apps/studio/editing/align-bar.tsx +4 -4
  184. package/apps/studio/editing/anchor-report.ts +3 -2
  185. package/apps/studio/editing/artboard-handles.tsx +4 -4
  186. package/apps/studio/editing/corner-dots.tsx +4 -4
  187. package/apps/studio/editing/crop-mode.tsx +4 -4
  188. package/apps/studio/editing/drop-chip.tsx +4 -4
  189. package/apps/studio/editing/empty-report.ts +3 -2
  190. package/apps/studio/editing/focus-model.tsx +4 -4
  191. package/apps/studio/editing/gap-bands.tsx +3 -3
  192. package/apps/studio/editing/hold-rings.tsx +4 -4
  193. package/apps/studio/editing/lock-badge.tsx +3 -3
  194. package/apps/studio/editing/long-page.ts +23 -1
  195. package/apps/studio/editing/nudge.tsx +2 -2
  196. package/apps/studio/editing/page-activity.ts +4 -3
  197. package/apps/studio/editing/paste-bar.tsx +4 -4
  198. package/apps/studio/editing/pen/overlay.tsx +4 -3
  199. package/apps/studio/editing/place-freely.tsx +3 -3
  200. package/apps/studio/editing/reorder-slot.tsx +3 -3
  201. package/apps/studio/editing/selection.tsx +4 -4
  202. package/apps/studio/editing/size-ghost.tsx +4 -4
  203. package/apps/studio/editing/tab-order.tsx +4 -4
  204. package/apps/studio/editing/text-in-place.tsx +4 -4
  205. package/apps/studio/editing/undo-preview.tsx +3 -3
  206. package/apps/studio/equal-spacing-handles.tsx +3 -3
  207. package/apps/studio/frame-clock.ts +89 -0
  208. package/apps/studio/history/trash.ts +6 -0
  209. package/apps/studio/home/accounts.ts +87 -0
  210. package/apps/studio/home/index-reader.ts +24 -2
  211. package/apps/studio/home/routes.ts +19 -0
  212. package/apps/studio/http.ts +80 -34
  213. package/apps/studio/index/ds-usage.ts +4 -1
  214. package/apps/studio/index-cache.ts +272 -0
  215. package/apps/studio/inspect-overlay.tsx +4 -3
  216. package/apps/studio/inspect.ts +7 -2
  217. package/apps/studio/link-chip-overlay.tsx +4 -3
  218. package/apps/studio/measure-overlay.tsx +4 -3
  219. package/apps/studio/present/pointer-dot.tsx +3 -2
  220. package/apps/studio/present/present-media.ts +6 -2
  221. package/apps/studio/present/present-stage.tsx +3 -2
  222. package/apps/studio/preview/preview-camera.tsx +3 -2
  223. package/apps/studio/routes/ds-convert.ts +18 -0
  224. package/apps/studio/routes/sync.ts +176 -0
  225. package/apps/studio/routes/trash.ts +16 -1
  226. package/apps/studio/safe-zones-overlay.tsx +3 -2
  227. package/apps/studio/server.ts +8 -10
  228. package/apps/studio/skip-dirs.ts +103 -47
  229. package/apps/studio/studio-page-host.ts +70 -0
  230. package/apps/studio/sync/accepted-cold-start.ts +28 -13
  231. package/apps/studio/sync/asset-push.ts +146 -23
  232. package/apps/studio/sync/asset-state.ts +3 -2
  233. package/apps/studio/sync/code-module-consent.ts +86 -0
  234. package/apps/studio/sync/file-ledger.ts +24 -0
  235. package/apps/studio/sync/file-membership.ts +28 -3
  236. package/apps/studio/sync/file-plane.ts +497 -61
  237. package/apps/studio/sync/file-pull.ts +304 -33
  238. package/apps/studio/sync/held-deletes.ts +230 -0
  239. package/apps/studio/sync/hub-link.ts +1 -2
  240. package/apps/studio/sync/hubs-config.ts +59 -2
  241. package/apps/studio/sync/index.ts +405 -163
  242. package/apps/studio/sync/journal-client.ts +94 -5
  243. package/apps/studio/sync/pending-deletes.ts +100 -0
  244. package/apps/studio/sync/projection.ts +77 -12
  245. package/apps/studio/sync/seed-progress.ts +104 -3
  246. package/apps/studio/sync/settings.ts +36 -1
  247. package/apps/studio/sync/status.ts +17 -1
  248. package/apps/studio/sync/writer-registry.ts +5 -0
  249. package/apps/studio/text-caret.ts +5 -3
  250. package/apps/studio/thumbs/service.ts +12 -2
  251. package/apps/studio/thumbs/validate.ts +7 -0
  252. package/apps/studio/toolbars/toolbar-rect.ts +3 -2
  253. package/apps/studio/ui-prefs-migrate.ts +4 -0
  254. package/apps/studio/use-annotation-resize.tsx +4 -3
  255. package/apps/studio/use-artboard-drag.tsx +3 -2
  256. package/apps/studio/use-element-resize.tsx +7 -6
  257. package/apps/studio/use-grid-track-handles.tsx +5 -4
  258. package/apps/studio/use-selection-set.tsx +64 -4
  259. package/apps/studio/use-spacing-handles.tsx +7 -6
  260. package/apps/studio/video-comp.tsx +75 -39
  261. package/apps/studio/video-play-overlay.tsx +4 -3
  262. package/apps/studio/whats-new.json +99 -0
  263. package/cli/commands/design.mjs +5 -2
  264. package/cli/commands/hub.mjs +10 -1
  265. package/cli/lib/bash-guard.mjs +27 -1
  266. package/cli/lib/design-help.gen.mjs +1 -1
  267. package/cli/lib/design-hook.mjs +20 -0
  268. package/cli/lib/design-link.mjs +42 -17
  269. package/cli/lib/hub-purge.mjs +183 -0
  270. package/cli/lib/studio-locate.mjs +35 -10
  271. package/package.json +8 -8
  272. package/plugins/design/templates/_shell.html +164 -1
@@ -41,7 +41,12 @@ import {
41
41
  type WorldPoint,
42
42
  } from '../../annotations-model.ts';
43
43
  import { arrowPrimitives, type SvgPrimitive } from '../../canvas-arrowheads.ts';
44
- import { countRender, useLiveViewport } from '../../canvas-lib.tsx';
44
+ import {
45
+ countRender,
46
+ cssCounterScaledChrome,
47
+ screenSizedRef,
48
+ useLiveViewport,
49
+ } from '../../canvas-lib.tsx';
45
50
  import { SECTION_FOLDED_H } from '../constants.ts';
46
51
  import { authorLine, provenanceLine, relativeTime, tiltOf } from '../elements/sticky.model.ts';
47
52
  import type { AnnotationElement } from '../types.ts';
@@ -283,6 +288,14 @@ export function stickyBoxPath(x: number, y: number, w: number, h: number, r: num
283
288
  ].join(' ');
284
289
  }
285
290
 
291
+ /**
292
+ * The "lifted paper" shadow: feDropShadow dx 0 · dy 4 · stdDeviation 8 · #000 @ 0.28, as a CSS box-shadow (blur radius
293
+ * = 2 × stdDeviation). It is the same in both themes - the filter never read one. It is a box-shadow on the NODE, not
294
+ * an SVG filter on the shape: WebKit re-rasters the world layer at every zoom frame, and 221 software filters made each
295
+ * frame ~230 ms on the retention-ladder board (v2.0.5 annot-zoom).
296
+ */
297
+ const PAPER_SHADOW = '0 4px 16px rgba(0, 0, 0, 0.28)';
298
+
286
299
  function StickyView({ el, interactive, edit, quiet, selected, mine, typist }: ElementNodeProps) {
287
300
  const x = num(el.x);
288
301
  const y = num(el.y);
@@ -331,7 +344,17 @@ function StickyView({ el, interactive, edit, quiet, selected, mine, typist }: El
331
344
  const shown = [line, origin, doneLine].filter(Boolean).join(' · ');
332
345
  const pin = useTimePin(el); // S4.16 — the time chip, the fade off range, "Not printed"
333
346
  return (
334
- <Node el={el} x={x} y={y} w={w} h={h} rot={rot} raised={!!edit} extraAttrs={pin.attrs}>
347
+ <Node
348
+ el={el}
349
+ x={x}
350
+ y={y}
351
+ w={w}
352
+ h={h}
353
+ rot={rot}
354
+ raised={!!edit}
355
+ extraAttrs={pin.attrs}
356
+ extraStyle={{ borderRadius: r, boxShadow: PAPER_SHADOW }}
357
+ >
335
358
  <PinTags pin={pin} />
336
359
  <Geo x={x} y={y} w={w} h={h}>
337
360
  <path
@@ -340,7 +363,6 @@ function StickyView({ el, interactive, edit, quiet, selected, mine, typist }: El
340
363
  stroke={aiMade ? AI_SPARK : 'rgba(0,0,0,0.05)'}
341
364
  strokeWidth={aiMade ? 2 : 1}
342
365
  vectorEffect="non-scaling-stroke"
343
- filter="url(#dc-sticky-shadow)"
344
366
  pointerEvents={hit(interactive)}
345
367
  />
346
368
  {typist ? (
@@ -791,6 +813,9 @@ function ImageView({ el, interactive, resolveAsset }: ElementNodeProps) {
791
813
  );
792
814
  }
793
815
 
816
+ /** A link / media card is a rounded rect (rx 8) with the same lifted-paper shadow, on its node. */
817
+ const CARD_SHADOW_STYLE: CSSProperties = { borderRadius: 8, boxShadow: PAPER_SHADOW };
818
+
794
819
  function LinkView({ el, interactive }: ElementNodeProps) {
795
820
  const x = num(el.x);
796
821
  const y = num(el.y);
@@ -799,7 +824,7 @@ function LinkView({ el, interactive }: ElementNodeProps) {
799
824
  const lay = linkCardLayout(x, y, w, h);
800
825
  const font = { fontFamily: TEXT_FONT } as const;
801
826
  return (
802
- <Node el={el} x={x} y={y} w={w} h={h} rot={num(el.rot)}>
827
+ <Node el={el} x={x} y={y} w={w} h={h} rot={num(el.rot)} extraStyle={CARD_SHADOW_STYLE}>
803
828
  <Geo x={x} y={y} w={w} h={h}>
804
829
  <g
805
830
  data-url={str(el.url)}
@@ -818,7 +843,6 @@ function LinkView({ el, interactive }: ElementNodeProps) {
818
843
  stroke={LINK_CARD_STROKE}
819
844
  strokeWidth={1}
820
845
  vectorEffect="non-scaling-stroke"
821
- filter="url(#dc-sticky-shadow)"
822
846
  />
823
847
  <svg
824
848
  x={lay.glyph.x}
@@ -873,7 +897,7 @@ function MediaRefView({ el, interactive }: ElementNodeProps) {
873
897
  const src = str(el.src);
874
898
  const font = { fontFamily: TEXT_FONT } as const;
875
899
  return (
876
- <Node el={el} x={x} y={y} w={w} h={h} rot={num(el.rot)}>
900
+ <Node el={el} x={x} y={y} w={w} h={h} rot={num(el.rot)} extraStyle={CARD_SHADOW_STYLE}>
877
901
  <Geo x={x} y={y} w={w} h={h}>
878
902
  <g
879
903
  data-src={src}
@@ -892,7 +916,6 @@ function MediaRefView({ el, interactive }: ElementNodeProps) {
892
916
  stroke={LINK_CARD_STROKE}
893
917
  strokeWidth={1}
894
918
  vectorEffect="non-scaling-stroke"
895
- filter="url(#dc-sticky-shadow)"
896
919
  />
897
920
  <svg
898
921
  x={x + 8}
@@ -945,22 +968,123 @@ export function sectionChip(label: string, zoom: number) {
945
968
  return { fontSize, chipH, gap, padX, chipW };
946
969
  }
947
970
 
948
- function SectionChip({
949
- el,
950
- interactive,
951
- edit,
952
- note,
953
- count,
954
- }: {
971
+ type SectionChipProps = {
955
972
  el: AnnotationElement;
956
973
  interactive: boolean;
957
974
  edit: EditRequest | null;
958
975
  note?: string;
959
976
  /** S4.13 - how many an open section holds, drawn as a small number after its name. */
960
977
  count?: string;
978
+ };
979
+
980
+ /**
981
+ * 2.0.5 W2 — on Blink the chip is drawn once at its SCREEN size and counter-scaled by CSS: the viewport
982
+ * controller writes `--dc-zoom` straight onto it (`screenSizedRef`, past the scene's `--dc-zoom` reset), so a
983
+ * pan/zoom gesture renders no chip — it re-rendered every chip at ~20 Hz from `useLiveViewport()`. It scales
984
+ * about the section's top-left corner, where it hangs from. WebKit (the desktop app) keeps the live-zoom chip:
985
+ * the per-frame transform was not shown to be free there (`cssCounterScaledChrome`).
986
+ */
987
+ function SectionChip({ el, interactive, edit, note, count }: SectionChipProps) {
988
+ if (edit) return <SectionChipEditor el={el} interactive={interactive} edit={edit} />;
989
+ if (!cssCounterScaledChrome())
990
+ return <SectionChipLive el={el} interactive={interactive} note={note} count={count} />;
991
+ countRender('sectionChipRenders');
992
+ const { label, g, style, box } = sectionChipStyles(el, interactive, 1);
993
+ const lift = g.chipH + g.gap;
994
+ return (
995
+ <div
996
+ ref={screenSizedRef}
997
+ className="dc-annot-chip"
998
+ data-section-chip="1"
999
+ style={{
1000
+ ...box,
1001
+ width: note || count ? undefined : g.chipW,
1002
+ whiteSpace: 'nowrap',
1003
+ transform: 'scale(calc(1 / var(--dc-zoom, 1)))',
1004
+ transformOrigin: `0 ${lift}px`,
1005
+ }}
1006
+ >
1007
+ <SectionChipTitle label={label} style={style} note={note} count={count} />
1008
+ </div>
1009
+ );
1010
+ }
1011
+
1012
+ /** WebKit: the chip sized from the live zoom (re-renders with it), exactly as before 2.0.5. */
1013
+ function SectionChipLive({ el, interactive, note, count }: Omit<SectionChipProps, 'edit'>) {
1014
+ countRender('sectionChipRenders');
1015
+ // Counter-scaled chrome needs the live zoom, not the settle-cadence one.
1016
+ const zoom = useLiveViewport().zoom || 1;
1017
+ const { label, g, style, box } = sectionChipStyles(el, interactive, zoom);
1018
+ return (
1019
+ <div
1020
+ className="dc-annot-chip"
1021
+ data-section-chip="1"
1022
+ style={{ ...box, width: note || count ? undefined : g.chipW, whiteSpace: 'nowrap' }}
1023
+ >
1024
+ <SectionChipTitle label={label} style={style} note={note} count={count} />
1025
+ </div>
1026
+ );
1027
+ }
1028
+
1029
+ function SectionChipTitle({
1030
+ label,
1031
+ style,
1032
+ note,
1033
+ count,
1034
+ }: {
1035
+ label: string;
1036
+ style: CSSProperties;
1037
+ note?: string;
1038
+ count?: string;
961
1039
  }) {
1040
+ return (
1041
+ <div className="dc-annot-text dc-annot-text--nowrap" style={style}>
1042
+ {label}
1043
+ {count ? (
1044
+ <span data-section-count="1" style={{ opacity: 0.65, marginLeft: 6, fontWeight: 500 }}>
1045
+ {count}
1046
+ </span>
1047
+ ) : null}
1048
+ {note ? (
1049
+ <span data-fold-note="1" style={{ opacity: 0.75, marginLeft: 8, fontWeight: 500 }}>
1050
+ {note}
1051
+ </span>
1052
+ ) : null}
1053
+ </div>
1054
+ );
1055
+ }
1056
+
1057
+ /** Renaming a section: the editor sizes its text in world px, so it keeps the live-zoom sizing. */
1058
+ function SectionChipEditor({
1059
+ el,
1060
+ interactive,
1061
+ edit,
1062
+ }: Pick<SectionChipProps, 'el' | 'interactive'> & { edit: EditRequest }) {
1063
+ countRender('sectionChipRenders');
962
1064
  // Counter-scaled chrome needs the live zoom, not the settle-cadence one.
963
1065
  const zoom = useLiveViewport().zoom || 1;
1066
+ const { label, g, style, box } = sectionChipStyles(el, interactive, zoom);
1067
+ return (
1068
+ <div className="dc-annot-chip" style={{ ...box, zIndex: 1 }}>
1069
+ <TextEditor
1070
+ initialText={label}
1071
+ singleLine
1072
+ className="dc-annot-text dc-annot-text--nowrap"
1073
+ style={style}
1074
+ size={{ kind: 'fit-both', minWidth: g.chipW }}
1075
+ fmt={{ fontSize: g.fontSize }}
1076
+ caretPoint={edit.caretPoint}
1077
+ ariaLabel="Rename section"
1078
+ onCommit={edit.onCommit}
1079
+ onCancel={edit.onCancel}
1080
+ onDraft={edit.onDraft}
1081
+ />
1082
+ </div>
1083
+ );
1084
+ }
1085
+
1086
+ /** The chip's box + title styles at `zoom` (1 = screen px, for the CSS-scaled chip). */
1087
+ function sectionChipStyles(el: AnnotationElement, interactive: boolean, zoom: number) {
964
1088
  const label = str(el.label, 'Section');
965
1089
  const color = str(el.color, '#8a8a8a');
966
1090
  const g = sectionChip(label, zoom);
@@ -982,46 +1106,7 @@ function SectionChip({
982
1106
  backgroundColor: color,
983
1107
  pointerEvents: interactive ? 'auto' : 'none',
984
1108
  };
985
- if (edit) {
986
- return (
987
- <div className="dc-annot-chip" style={{ ...box, zIndex: 1 }}>
988
- <TextEditor
989
- initialText={label}
990
- singleLine
991
- className="dc-annot-text dc-annot-text--nowrap"
992
- style={style}
993
- size={{ kind: 'fit-both', minWidth: g.chipW }}
994
- fmt={{ fontSize: g.fontSize }}
995
- caretPoint={edit.caretPoint}
996
- ariaLabel="Rename section"
997
- onCommit={edit.onCommit}
998
- onCancel={edit.onCancel}
999
- onDraft={edit.onDraft}
1000
- />
1001
- </div>
1002
- );
1003
- }
1004
- return (
1005
- <div
1006
- className="dc-annot-chip"
1007
- data-section-chip="1"
1008
- style={{ ...box, width: note || count ? undefined : g.chipW, whiteSpace: 'nowrap' }}
1009
- >
1010
- <div className="dc-annot-text dc-annot-text--nowrap" style={style}>
1011
- {label}
1012
- {count ? (
1013
- <span data-section-count="1" style={{ opacity: 0.65, marginLeft: 6, fontWeight: 500 }}>
1014
- {count}
1015
- </span>
1016
- ) : null}
1017
- {note ? (
1018
- <span data-fold-note="1" style={{ opacity: 0.75, marginLeft: 8, fontWeight: 500 }}>
1019
- {note}
1020
- </span>
1021
- ) : null}
1022
- </div>
1023
- </div>
1024
- );
1109
+ return { label, g, style, box };
1025
1110
  }
1026
1111
 
1027
1112
  function SectionView({ el, interactive, edit, foldNote }: ElementNodeProps) {
@@ -118,7 +118,7 @@ function personLabel(key: string): string {
118
118
  }
119
119
 
120
120
  export const LOD_CSS = `
121
- .dc-annot-lod { position: absolute; left: 0; top: 0; width: 0; height: 0; }
121
+ .dc-annot-lod { position: absolute; left: 0; top: 0; width: 0; height: 0; --dc-zoom: initial; }
122
122
  .dc-annot-lod[data-quiet] { opacity: 0.45; }
123
123
  .dc-annot-lod [data-lod] { position: absolute; box-sizing: border-box; pointer-events: none; }
124
124
  .dc-annot-lod[data-live] [data-lod="section"] { pointer-events: auto; cursor: zoom-in; }
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  import { arrowPrimitives, type SvgPrimitive } from '../../canvas-arrowheads.ts';
31
+ import { frameRafOn } from '../../frame-clock.ts';
31
32
  import { artboardMembers } from '../artboard-members.ts';
32
33
  import { DEFAULT_INK } from '../constants.ts';
33
34
  import { parseHostRef } from '../elements/_shared.ts';
@@ -892,7 +893,7 @@ export function createDomRideSink(
892
893
  g.classList.add('is-settling');
893
894
  old.classList.add('is-leaving');
894
895
  s.appendChild(g);
895
- doc.defaultView?.requestAnimationFrame(() => g.classList.add('is-in'));
896
+ if (doc.defaultView) frameRafOn(doc.defaultView, () => g.classList.add('is-in'));
896
897
  doc.defaultView?.setTimeout(() => old.remove(), 200);
897
898
  } else {
898
899
  old?.remove();
@@ -100,7 +100,7 @@ export function stripListMarkers(text: string, list?: ListStyle): string {
100
100
  * like plain text (no border, no resize grip, inherited font).
101
101
  */
102
102
  export const TEXT_LAYER_CSS = `
103
- .dc-annot-scene { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; pointer-events: none; }
103
+ .dc-annot-scene { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; pointer-events: none; --dc-zoom: initial; }
104
104
  .dc-annot-el { position: absolute; pointer-events: none; }
105
105
  .dc-annot-el > svg.dc-annot-geo { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
106
106
  .dc-annot-text { box-sizing: border-box; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
@@ -97,6 +97,7 @@ import {
97
97
  IconUngroup,
98
98
  SHAPE_KIND_ICONS,
99
99
  } from './canvas-icons.tsx';
100
+ import { frameCaf, frameRaf } from './frame-clock.ts';
100
101
  import { holdHoverFocus } from './toolbars/tool-panel.ts';
101
102
  import { IconMore } from './toolbars/toolbar-icons.tsx';
102
103
  import { useAnnotationSelectionOptional } from './use-annotation-selection.tsx';
@@ -627,7 +628,7 @@ export function AnnotationContextToolbar({
627
628
  const u = unionRect(rects);
628
629
  if (!u) {
629
630
  el.style.display = 'none';
630
- rafRef.current = requestAnimationFrame(tick);
631
+ rafRef.current = frameRaf(tick);
631
632
  return;
632
633
  }
633
634
  el.style.display = 'flex';
@@ -646,11 +647,11 @@ export function AnnotationContextToolbar({
646
647
  if (left + tbW > winW - 8) left = winW - tbW - 8;
647
648
  el.style.left = `${Math.round(left)}px`;
648
649
  el.style.top = `${Math.round(top)}px`;
649
- rafRef.current = requestAnimationFrame(tick);
650
+ rafRef.current = frameRaf(tick);
650
651
  };
651
- rafRef.current = requestAnimationFrame(tick);
652
+ rafRef.current = frameRaf(tick);
652
653
  return () => {
653
- if (rafRef.current != null) cancelAnimationFrame(rafRef.current);
654
+ if (rafRef.current != null) frameCaf(rafRef.current);
654
655
  };
655
656
  }, [selectedStrokes, editingId]);
656
657
 
@@ -123,6 +123,7 @@ import { VoteDots } from './annotations/ui/vote-dots.tsx';
123
123
  import { projectStrokes, type StrokeCache } from './annotations/ui/world.ts';
124
124
  import { elementsToStrokes, strokesToElementMap } from './annotations/v1-adapter.ts';
125
125
  import { reasonProps } from './client/v2/access/disabled-reason.js';
126
+ import { frameCaf, frameRaf } from './frame-clock.ts';
126
127
  import { setStickerSelected } from './toolbars/shell-panels.ts';
127
128
  /**
128
129
  * @file annotations-layer.tsx — FigJam-style annotation overlay
@@ -1198,7 +1199,7 @@ export function AnnotationsLayer() {
1198
1199
  ),
1199
1200
  // read at every frame: the theme can flip between two drags
1200
1201
  defaultInk: () => resolveDefaultInk(readChromeTheme()),
1201
- schedule: (fn) => requestAnimationFrame(fn),
1202
+ schedule: (fn) => frameRaf(fn),
1202
1203
  });
1203
1204
  rideRef.current = ctl;
1204
1205
  return () => {
@@ -4507,13 +4508,13 @@ export function AnnotationsLayer() {
4507
4508
  const onMove = (e: PointerEvent) => {
4508
4509
  last = { x: e.clientX, y: e.clientY };
4509
4510
  if (raf == null && typeof requestAnimationFrame !== 'undefined') {
4510
- raf = requestAnimationFrame(apply);
4511
+ raf = frameRaf(apply);
4511
4512
  }
4512
4513
  };
4513
4514
  document.addEventListener('pointermove', onMove, { passive: true });
4514
4515
  return () => {
4515
4516
  document.removeEventListener('pointermove', onMove);
4516
- if (raf != null && typeof cancelAnimationFrame !== 'undefined') cancelAnimationFrame(raf);
4517
+ if (raf != null && typeof cancelAnimationFrame !== 'undefined') frameCaf(raf);
4517
4518
  clear();
4518
4519
  };
4519
4520
  }, [tool]);
@@ -5502,18 +5503,6 @@ function AnnotationsSvg({
5502
5503
  data-selection={annotSel?.selectedIds.join(' ') ?? ''}
5503
5504
  data-annot-state={gestureState}
5504
5505
  >
5505
- <defs>
5506
- {/* Phase 21 — soft "lifted paper" drop shadow for sticky notes. */}
5507
- <filter id="dc-sticky-shadow" x="-25%" y="-25%" width="150%" height="170%">
5508
- <feDropShadow
5509
- dx="0"
5510
- dy="4"
5511
- stdDeviation="8"
5512
- floodColor="#000000"
5513
- floodOpacity="0.28"
5514
- />
5515
- </filter>
5516
- </defs>
5517
5506
  {selectedStrokes.map((s) => (
5518
5507
  <SelectionHalo
5519
5508
  key={`halo-${s.id}`}