@1agh/maude 2.0.6 → 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 (177) hide show
  1. package/apps/studio/access/closure.ts +156 -16
  2. package/apps/studio/access/filters.ts +27 -0
  3. package/apps/studio/actions/agents.ts +54 -0
  4. package/apps/studio/actions/ctx.ts +3 -0
  5. package/apps/studio/actions/defs/sync.ts +13 -0
  6. package/apps/studio/actions/defs/view.ts +59 -3
  7. package/apps/studio/actions/keymap.gen.ts +35 -0
  8. package/apps/studio/actions/menu.ts +2 -0
  9. package/apps/studio/actions/types.ts +3 -1
  10. package/apps/studio/actions.manifest.json +136 -1
  11. package/apps/studio/actions.parity.json +25 -1
  12. package/apps/studio/annotations/ui/ai-seen.tsx +4 -3
  13. package/apps/studio/annotations/ui/ride.ts +2 -1
  14. package/apps/studio/annotations-context-toolbar.tsx +5 -4
  15. package/apps/studio/annotations-layer.tsx +4 -3
  16. package/apps/studio/api.ts +383 -128
  17. package/apps/studio/artboard-activity-overlay.tsx +4 -4
  18. package/apps/studio/artboard-ai-copies.tsx +4 -4
  19. package/apps/studio/artboard-freeze.ts +108 -0
  20. package/apps/studio/artboard-live-gate.tsx +414 -45
  21. package/apps/studio/artboard-live.ts +526 -31
  22. package/apps/studio/artboard-placeholder.ts +197 -0
  23. package/apps/studio/artboard-still-raster.ts +485 -0
  24. package/apps/studio/artboard-still-warmup.ts +221 -0
  25. package/apps/studio/artboard-still.ts +1188 -0
  26. package/apps/studio/artboard-webgl.ts +2 -1
  27. package/apps/studio/asset-placeholder.tsx +237 -132
  28. package/apps/studio/asset-upload-bars.tsx +4 -4
  29. package/apps/studio/bin/_perf-probe-open.mjs +364 -0
  30. package/apps/studio/bin/_perf-shared.mjs +12 -7
  31. package/apps/studio/bin/_pw-launch.mjs +26 -1
  32. package/apps/studio/bin/perf.sh +19 -0
  33. package/apps/studio/bridge/dgn-protocol.ts +35 -0
  34. package/apps/studio/canvas-build-sandbox.ts +69 -13
  35. package/apps/studio/canvas-camera.ts +90 -0
  36. package/apps/studio/canvas-comment-mount.tsx +9 -9
  37. package/apps/studio/canvas-lib.tsx +160 -34
  38. package/apps/studio/canvas-pages-view.tsx +465 -0
  39. package/apps/studio/canvas-pages.ts +305 -0
  40. package/apps/studio/canvas-rows.ts +62 -0
  41. package/apps/studio/canvas-shell.tsx +62 -16
  42. package/apps/studio/canvas-theme-icons.tsx +41 -0
  43. package/apps/studio/canvas-theme-pill.tsx +15 -6
  44. package/apps/studio/canvas-theme.ts +12 -11
  45. package/apps/studio/client/app.jsx +7 -0
  46. package/apps/studio/client/canvas-url.js +23 -1
  47. package/apps/studio/client/hooks/canvas-origin-probe.js +34 -0
  48. package/apps/studio/client/hooks/use-action-keys.jsx +3 -1
  49. package/apps/studio/client/hooks/use-canvas-bridge.jsx +1 -1
  50. package/apps/studio/client/hooks/use-palette-and-panels.jsx +23 -6
  51. package/apps/studio/client/hooks/use-photo-and-timeline.jsx +16 -8
  52. package/apps/studio/client/hooks/use-project-data.jsx +11 -2
  53. package/apps/studio/client/hooks/use-shell-core.jsx +19 -9
  54. package/apps/studio/client/index-loader.ts +41 -21
  55. package/apps/studio/client/inspector/inspector-panel.jsx +35 -14
  56. package/apps/studio/client/shell/viewport.jsx +32 -16
  57. package/apps/studio/client/tree/tree.jsx +17 -0
  58. package/apps/studio/client/v2/canvases/canvases-panel.jsx +24 -0
  59. package/apps/studio/client/v2/canvases/use-canvas-index.js +24 -1
  60. package/apps/studio/client/v2/code/canvas-error-card.jsx +14 -2
  61. package/apps/studio/client/v2/code/canvas-imports-card.jsx +7 -3
  62. package/apps/studio/client/v2/code/canvas-imports-words.js +16 -0
  63. package/apps/studio/client/v2/code/canvas-waiting-card.jsx +59 -5
  64. package/apps/studio/client/v2/code/canvas-waiting.js +18 -1
  65. package/apps/studio/client/v2/code/code-consent-sheet.jsx +87 -0
  66. package/apps/studio/client/v2/code/code-consent.js +67 -0
  67. package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +62 -10
  68. package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +314 -5
  69. package/apps/studio/client/v2/layers/artboard-layers.jsx +24 -5
  70. package/apps/studio/client/v2/layers/layers-request.js +49 -0
  71. package/apps/studio/client/v2/left-panel/canvases-pinned.jsx +93 -3
  72. package/apps/studio/client/v2/left-panel/ds-boards.js +39 -0
  73. package/apps/studio/client/v2/left-panel/left-panel-model.js +13 -0
  74. package/apps/studio/client/v2/left-panel/left-panel.css +24 -0
  75. package/apps/studio/client/v2/shell/canvas-crash-guard.js +40 -5
  76. package/apps/studio/client/v2/shell/canvas-mode.js +17 -1
  77. package/apps/studio/client/v2/shell/floating-panels.css +37 -1
  78. package/apps/studio/client/v2/shell/mode-switch.jsx +14 -3
  79. package/apps/studio/client/v2/shell/opening-skeleton.js +118 -0
  80. package/apps/studio/client/v2/shell/opening-skeleton.jsx +103 -0
  81. package/apps/studio/client/v2/shell/pages-pick.js +49 -0
  82. package/apps/studio/client/v2/shell/project-menu-model.js +3 -0
  83. package/apps/studio/client/v2/shell/share-cluster-host.jsx +3 -1
  84. package/apps/studio/client/v2/shell/shell-parity.json +8 -0
  85. package/apps/studio/client/v2/shell/use-canvas-mode-lane.js +30 -0
  86. package/apps/studio/comments-overlay.tsx +12 -11
  87. package/apps/studio/config-reload-wire.ts +4 -1
  88. package/apps/studio/config.schema.json +6 -0
  89. package/apps/studio/context.ts +37 -1
  90. package/apps/studio/dist/client.bundle.js +720 -720
  91. package/apps/studio/dist/comment-mount.js +2 -2
  92. package/apps/studio/dist/styles.css +1 -1
  93. package/apps/studio/ds/board/board.css +6 -0
  94. package/apps/studio/ds/board/ds-bar.tsx +21 -3
  95. package/apps/studio/ds/board/specimen.tsx +6 -3
  96. package/apps/studio/ds/board/template.ts +39 -19
  97. package/apps/studio/ds/cli.ts +7 -1
  98. package/apps/studio/ds/component-list.ts +2 -1
  99. package/apps/studio/ds/default.ts +6 -1
  100. package/apps/studio/ds/ds-resolver.ts +58 -8
  101. package/apps/studio/ds/engine.ts +3 -1
  102. package/apps/studio/ds/folder-systems.ts +199 -0
  103. package/apps/studio/ds/pairing-css.ts +2 -1
  104. package/apps/studio/ds/rename.ts +10 -3
  105. package/apps/studio/ds/shell-fallbacks.ts +2 -1
  106. package/apps/studio/ds/upgrade-stage.ts +6 -2
  107. package/apps/studio/editing/ai-point-ring.tsx +4 -4
  108. package/apps/studio/editing/ai-scope-outline.tsx +4 -4
  109. package/apps/studio/editing/align-bar.tsx +4 -4
  110. package/apps/studio/editing/anchor-report.ts +3 -2
  111. package/apps/studio/editing/artboard-handles.tsx +4 -4
  112. package/apps/studio/editing/corner-dots.tsx +4 -4
  113. package/apps/studio/editing/crop-mode.tsx +4 -4
  114. package/apps/studio/editing/drop-chip.tsx +4 -4
  115. package/apps/studio/editing/empty-report.ts +3 -2
  116. package/apps/studio/editing/focus-model.tsx +4 -4
  117. package/apps/studio/editing/gap-bands.tsx +3 -3
  118. package/apps/studio/editing/hold-rings.tsx +4 -4
  119. package/apps/studio/editing/lock-badge.tsx +3 -3
  120. package/apps/studio/editing/long-page.ts +23 -1
  121. package/apps/studio/editing/nudge.tsx +2 -2
  122. package/apps/studio/editing/page-activity.ts +4 -3
  123. package/apps/studio/editing/paste-bar.tsx +4 -4
  124. package/apps/studio/editing/pen/overlay.tsx +4 -3
  125. package/apps/studio/editing/place-freely.tsx +3 -3
  126. package/apps/studio/editing/reorder-slot.tsx +3 -3
  127. package/apps/studio/editing/selection.tsx +4 -4
  128. package/apps/studio/editing/size-ghost.tsx +4 -4
  129. package/apps/studio/editing/tab-order.tsx +4 -4
  130. package/apps/studio/editing/text-in-place.tsx +4 -4
  131. package/apps/studio/editing/undo-preview.tsx +3 -3
  132. package/apps/studio/equal-spacing-handles.tsx +3 -3
  133. package/apps/studio/frame-clock.ts +89 -0
  134. package/apps/studio/http.ts +66 -32
  135. package/apps/studio/index/ds-usage.ts +4 -1
  136. package/apps/studio/index-cache.ts +272 -0
  137. package/apps/studio/inspect-overlay.tsx +4 -3
  138. package/apps/studio/inspect.ts +7 -2
  139. package/apps/studio/link-chip-overlay.tsx +4 -3
  140. package/apps/studio/measure-overlay.tsx +4 -3
  141. package/apps/studio/present/pointer-dot.tsx +3 -2
  142. package/apps/studio/present/present-media.ts +6 -2
  143. package/apps/studio/present/present-stage.tsx +3 -2
  144. package/apps/studio/preview/preview-camera.tsx +3 -2
  145. package/apps/studio/routes/sync.ts +176 -0
  146. package/apps/studio/safe-zones-overlay.tsx +3 -2
  147. package/apps/studio/skip-dirs.ts +103 -47
  148. package/apps/studio/studio-page-host.ts +70 -0
  149. package/apps/studio/sync/code-module-consent.ts +86 -0
  150. package/apps/studio/sync/file-ledger.ts +24 -0
  151. package/apps/studio/sync/file-plane.ts +458 -53
  152. package/apps/studio/sync/held-deletes.ts +230 -0
  153. package/apps/studio/sync/hubs-config.ts +59 -2
  154. package/apps/studio/sync/index.ts +99 -15
  155. package/apps/studio/sync/seed-progress.ts +92 -2
  156. package/apps/studio/sync/settings.ts +36 -1
  157. package/apps/studio/sync/status.ts +15 -1
  158. package/apps/studio/sync/writer-registry.ts +5 -0
  159. package/apps/studio/text-caret.ts +5 -3
  160. package/apps/studio/toolbars/toolbar-rect.ts +3 -2
  161. package/apps/studio/use-annotation-resize.tsx +4 -3
  162. package/apps/studio/use-artboard-drag.tsx +3 -2
  163. package/apps/studio/use-element-resize.tsx +7 -6
  164. package/apps/studio/use-grid-track-handles.tsx +5 -4
  165. package/apps/studio/use-selection-set.tsx +64 -4
  166. package/apps/studio/use-spacing-handles.tsx +7 -6
  167. package/apps/studio/video-comp.tsx +55 -42
  168. package/apps/studio/video-play-overlay.tsx +4 -3
  169. package/apps/studio/whats-new.json +27 -0
  170. package/cli/commands/design.mjs +5 -2
  171. package/cli/commands/hub.mjs +10 -1
  172. package/cli/lib/bash-guard.mjs +14 -0
  173. package/cli/lib/design-help.gen.mjs +1 -1
  174. package/cli/lib/design-link.mjs +42 -17
  175. package/cli/lib/hub-purge.mjs +183 -0
  176. package/package.json +8 -8
  177. package/plugins/design/templates/_shell.html +164 -1
@@ -2,7 +2,7 @@
2
2
  "generated": "scripts/gen-actions.mjs — do not edit by hand",
3
3
  "format": "maude.actions-manifest",
4
4
  "v": 1,
5
- "manifestVersion": "3b10dc94b530",
5
+ "manifestVersion": "fb02f78da791",
6
6
  "actions": [
7
7
  {
8
8
  "id": "search.open",
@@ -2540,6 +2540,39 @@
2540
2540
  "verb": "maude design open <canvas>#<artboard>"
2541
2541
  }
2542
2542
  },
2543
+ {
2544
+ "id": "view.pages",
2545
+ "label": "Pages",
2546
+ "kind": "toggle",
2547
+ "exec": "canvas",
2548
+ "effect": "none",
2549
+ "agent": {
2550
+ "path": "human",
2551
+ "because": "view-pref"
2552
+ }
2553
+ },
2554
+ {
2555
+ "id": "pages.next",
2556
+ "label": "Next page",
2557
+ "kind": "command",
2558
+ "exec": "canvas",
2559
+ "effect": "none",
2560
+ "agent": {
2561
+ "path": "human",
2562
+ "because": "view-pref"
2563
+ }
2564
+ },
2565
+ {
2566
+ "id": "pages.prev",
2567
+ "label": "Previous page",
2568
+ "kind": "command",
2569
+ "exec": "canvas",
2570
+ "effect": "none",
2571
+ "agent": {
2572
+ "path": "human",
2573
+ "because": "view-pref"
2574
+ }
2575
+ },
2543
2576
  {
2544
2577
  "id": "view.advanced-open-all",
2545
2578
  "label": "Open all Advanced sections",
@@ -6252,6 +6285,108 @@
6252
6285
  "verb": "maude design curl-local -X POST http://127.0.0.1:<port>/_api/sync/cancel-assets"
6253
6286
  }
6254
6287
  },
6288
+ {
6289
+ "id": "sync.allow-code",
6290
+ "label": "Allow shared code…",
6291
+ "kind": "command",
6292
+ "exec": "shell",
6293
+ "effect": "external",
6294
+ "minRole": "edit",
6295
+ "server": {
6296
+ "route": "/_api/sync/code-consent/set",
6297
+ "method": "POST"
6298
+ },
6299
+ "agent": {
6300
+ "path": "human",
6301
+ "because": "consent",
6302
+ "note": "the person’s yes to shared code from this project’s hub running on their Mac"
6303
+ }
6304
+ },
6305
+ {
6306
+ "id": "sync.stop-code",
6307
+ "label": "Stop allowing shared code…",
6308
+ "kind": "command",
6309
+ "exec": "shell",
6310
+ "effect": "none",
6311
+ "minRole": "edit",
6312
+ "server": {
6313
+ "route": "/_api/sync/code-consent/set",
6314
+ "method": "POST"
6315
+ },
6316
+ "agent": {
6317
+ "path": "human",
6318
+ "because": "consent",
6319
+ "note": "takes back the person’s yes to shared code"
6320
+ }
6321
+ },
6322
+ {
6323
+ "id": "sync.ignore-folder",
6324
+ "label": "Don’t sync this folder",
6325
+ "kind": "command",
6326
+ "exec": "shell",
6327
+ "effect": "none",
6328
+ "minRole": "edit",
6329
+ "server": {
6330
+ "route": "/_api/sync/settings",
6331
+ "method": "POST"
6332
+ },
6333
+ "agent": {
6334
+ "path": "human",
6335
+ "because": "hub-link",
6336
+ "note": "which folders the project syncs is the person’s choice"
6337
+ }
6338
+ },
6339
+ {
6340
+ "id": "sync.sync-folder-again",
6341
+ "label": "Sync it again",
6342
+ "kind": "command",
6343
+ "exec": "shell",
6344
+ "effect": "none",
6345
+ "minRole": "edit",
6346
+ "server": {
6347
+ "route": "/_api/sync/settings",
6348
+ "method": "POST"
6349
+ },
6350
+ "agent": {
6351
+ "path": "human",
6352
+ "because": "hub-link",
6353
+ "note": "which folders the project syncs is the person’s choice"
6354
+ }
6355
+ },
6356
+ {
6357
+ "id": "sync.delete-held-on-hub",
6358
+ "label": "Move to the hub’s trash too…",
6359
+ "kind": "command",
6360
+ "exec": "shell",
6361
+ "effect": "shared",
6362
+ "minRole": "edit",
6363
+ "server": {
6364
+ "route": "/_api/sync/held-deletes",
6365
+ "method": "POST"
6366
+ },
6367
+ "agent": {
6368
+ "path": "human",
6369
+ "because": "hub-link",
6370
+ "note": "deleting a batch of files on the project’s hub is the person’s choice"
6371
+ }
6372
+ },
6373
+ {
6374
+ "id": "sync.keep-held-on-hub",
6375
+ "label": "Keep on the hub",
6376
+ "kind": "command",
6377
+ "exec": "shell",
6378
+ "effect": "none",
6379
+ "minRole": "edit",
6380
+ "server": {
6381
+ "route": "/_api/sync/held-deletes",
6382
+ "method": "POST"
6383
+ },
6384
+ "agent": {
6385
+ "path": "human",
6386
+ "because": "hub-link",
6387
+ "note": "which deleted files stay on the hub is the person’s choice"
6388
+ }
6389
+ },
6255
6390
  {
6256
6391
  "id": "sync.get-latest",
6257
6392
  "label": "Get latest",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$comment": "Lead-owned (contract V2-1.11 §5.7). humanMax/pendingMax may only be lowered; raising either, or adding a humanDecisions reason, is a lead change citing a decision id.",
3
- "humanMax": 177,
3
+ "humanMax": 186,
4
4
  "pendingMax": 0,
5
5
  "pending": [],
6
6
  "humanDecisions": {
@@ -274,6 +274,30 @@
274
274
  "from": 176,
275
275
  "by": "decision:maude/v2-205-w4-github-signin-action",
276
276
  "why": "2.0.5 W4 registers account.github-signin (Sign in to GitHub from the account card: GitHub's device flow, the person types the code in their own browser). Human 'native-window': an agent never signs anyone in. One human row."
277
+ },
278
+ {
279
+ "to": 179,
280
+ "from": 177,
281
+ "by": "decision:maude/v2-207-a3-code-consent-in-app",
282
+ "why": "2.0.7 A3 registers sync.allow-code and sync.stop-code (Sync details / the canvas-waiting card: the person's yes or no to shared code from the project's hub, which runs on their Mac outside the canvas sandbox). Both human 'consent': an agent never says yes for the person. Two human rows."
283
+ },
284
+ {
285
+ "to": 182,
286
+ "from": 179,
287
+ "by": "decision:maude/v2-207-pages-view",
288
+ "why": "2.0.7 B2 registers view.pages (Canvas | Pages on the canvas pill) and its paging, pages.next / pages.prev. Human 'view-pref': they only change how the person looks at the canvas (the view file, per Mac); an agent reads the canvas itself. Three human rows."
289
+ },
290
+ {
291
+ "to": 184,
292
+ "from": 182,
293
+ "by": "decision:maude/v2-207-ignore-folders-in-linkedhub",
294
+ "why": "2.0.7 #7 registers sync.ignore-folder and sync.sync-folder-again (Sync details: leave a folder of pictures out of sync on this Mac, or bring it back). Human 'hub-link': they change what this project exchanges with its hub, the person's call. Two human rows."
295
+ },
296
+ {
297
+ "to": 186,
298
+ "from": 184,
299
+ "by": "decision:maude/v2-207-7b-held-delete-answers",
300
+ "why": "2.0.7 #7b registers sync.delete-held-on-hub and sync.keep-held-on-hub (Sync details › Deleted on this Mac, held: Delete on the hub too… / Keep on the hub). Human 'hub-link': deleting a batch on the project's hub reaches every teammate, and which deleted files stay on the hub is the person's choice. Two human rows."
277
301
  }
278
302
  ],
279
303
  "humanMaxRaisedNote": "V2-5 A1 integration: the three slice raises stack on 86 (84 -> 86 by decision:maude/v2-4-gate-github-doors, human 'accounts'). S4.1/S4.3/S4.4 and S2.2-S2.4 add no human row. 86 + 4 + 6 + 4 = 100 human actions in the merged registry. V2-5 A2 integration: S5.4 builds `maude design runs list|stop`, so ai.runs.list and ai.stop turn cli (decision:maude/v2-S5.3-run-actions-human-until-s5.4 resolved by decision:maude/v2-S5.4-runs-fallback-prompts) and the cap lowers 100 -> 98; S3.1, S4.2, S4.5, S9.4, S2.5 and S1.4 add no human row. V2-5 A4 integration: measured 107 human actions in the merged registry (98 on feat + tool.pointer from S3.2b + 7 chat.advanced.* from S5.12 + object.select-matching from S2.6); every other A4 slice adds no human row. V2-5 A5 integration: measured 113 human actions in the merged registry (107 on feat + trash.clear from S1.7b + four ai.attach-* from S5.10 + present.presenter-view from S3.6b); every other A5 slice adds no human row. V2-5 A6a integration: measured 118 human actions in the merged registry (113 on feat + artboard.ask-ai S2.10 + element.set-id S2.2b/lead + edit.undo-history S2.20 + history.filter S1.12b − view.trash S1.17 (cli) + tab.overview + tab.rename S1.22b); every other A6a slice adds no human row."
@@ -13,6 +13,7 @@
13
13
  import { useEffect, useRef, useState } from 'react';
14
14
  import { createPortal } from 'react-dom';
15
15
  import { acceptFromShell } from '../../bridge/dgn-protocol.ts';
16
+ import { frameCaf, frameRaf } from '../../frame-clock.ts';
16
17
 
17
18
  export interface SeenTarget {
18
19
  ref: string;
@@ -83,11 +84,11 @@ export function AiSeenRings(): null | React.JSX.Element {
83
84
  ring.style.height = `${Math.round(r.height + PAD * 2)}px`;
84
85
  });
85
86
  }
86
- raf = requestAnimationFrame(tick);
87
+ raf = frameRaf(tick);
87
88
  };
88
- raf = requestAnimationFrame(tick);
89
+ raf = frameRaf(tick);
89
90
  return () => {
90
- if (raf != null) cancelAnimationFrame(raf);
91
+ if (raf != null) frameCaf(raf);
91
92
  };
92
93
  }, [targets]);
93
94
 
@@ -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();
@@ -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]);