@marver-design/marver 0.27.0 → 0.28.0

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 (111) hide show
  1. package/CHANGELOG.md +195 -0
  2. package/README.md +9 -4
  3. package/dist/{anchor-check-ChdDqL5z.mjs → anchor-check-PHUOFj1N.mjs} +1 -1
  4. package/dist/{audio-Dw1lfMdb.mjs → audio-DX4POHAj.mjs} +39 -4
  5. package/dist/{board-tree-DRioF94d.mjs → board-tree-BXR8dw4b.mjs} +3 -1
  6. package/dist/{boards-DlTcpF47.mjs → boards-BeWtjGUM.mjs} +50 -5
  7. package/dist/boards-EH2onUXM.mjs +995 -0
  8. package/dist/{build-DZnFysGU.mjs → build-BsAyLMT1.mjs} +9 -22
  9. package/dist/{capture-vadKjuCo.mjs → capture-DdZ6xgoz.mjs} +92 -30
  10. package/dist/cli.mjs +56 -21
  11. package/dist/{collab-Dxg2trOK.mjs → collab-BEAcXrBb.mjs} +1 -1
  12. package/dist/{comments-DxOkCSNE.mjs → comments-CrBHPEQl.mjs} +4 -4
  13. package/dist/config-BezZTiov.mjs +182 -0
  14. package/dist/conn-BMiHS42T.mjs +222 -0
  15. package/dist/connectors-MR9d-EBP.mjs +290 -0
  16. package/dist/{context-HQ4Giw58.mjs → context-BUnFiyA3.mjs} +3 -3
  17. package/dist/{daemon-BSA0lV8d.mjs → daemon-C5dg2R-V.mjs} +2188 -183
  18. package/dist/{dev-eQJhWsqg.mjs → dev-D7YS7iT2.mjs} +25 -14
  19. package/dist/{init-COD0x48i.mjs → init-WE5lQkQL.mjs} +8 -3
  20. package/dist/jam-Cj5gBvwD.mjs +373 -0
  21. package/dist/{link-DDXZVGtv.mjs → link-BFFRgrMt.mjs} +4 -4
  22. package/dist/listener-DdLEM79A.mjs +80 -0
  23. package/dist/{ls-D7O1G505.mjs → ls-BZ5TAtd5.mjs} +1 -1
  24. package/dist/{manifest-Nl3KSVOk.mjs → manifest-DPZ3WNg_.mjs} +2 -2
  25. package/dist/{marks-CWM3WJjc.mjs → marks-Dyn6tmjp.mjs} +3 -3
  26. package/dist/{marks-CKgzucHZ.mjs → marks-Kmdab_5w.mjs} +3 -3
  27. package/dist/{marver-id-gate-BjF6v4bT.mjs → marver-id-gate-D-R0hSt_.mjs} +1 -1
  28. package/dist/perf-Cn5LiRaY.mjs +1319 -0
  29. package/dist/perf-jam-QxD_UnzN.mjs +635 -0
  30. package/dist/permit-DDa6wqOs.mjs +187 -0
  31. package/dist/plugin-C_0yb-Fq.mjs +5089 -0
  32. package/dist/{poster-Bx83ZYVK.mjs → poster-DHi6I1fO.mjs} +1 -1
  33. package/dist/{profile-Bh5Y5zpW.mjs → profile-jIS6BcAs.mjs} +1 -1
  34. package/dist/{publish-bakes-aljgm45S.mjs → publish-bakes-r4PEZuPl.mjs} +3 -3
  35. package/dist/{queue-CAM_vNmX.mjs → queue-c-6aTHEz.mjs} +164 -25
  36. package/dist/{recover-t9Pno3u9.mjs → recover-nrLEVLyJ.mjs} +2 -2
  37. package/dist/{serve-C8rVheYk.mjs → serve-Dp3nHstu.mjs} +3 -3
  38. package/dist/{session-BAaJsK5c.mjs → session-DyVE7cCk.mjs} +1 -1
  39. package/dist/{share-W5H3BNvP.mjs → share-Ce4tP7ji.mjs} +1 -1
  40. package/dist/{shot-LFhC-WYD.mjs → shot-BrRtqaiS.mjs} +34 -8
  41. package/dist/{shot-DoHLl6ig.mjs → shot-DBWN8hPP.mjs} +1 -1
  42. package/dist/sizes-wjXDev3b.mjs +139 -0
  43. package/dist/{slots-DCDo3N0x.mjs → slots-CFNnegCc.mjs} +8 -1
  44. package/dist/speech-worker.mjs +23 -3
  45. package/dist/{sync-BQVlHZpx.mjs → sync-CQdGARJ9.mjs} +1 -1
  46. package/dist/transport-C5FnY9ni.mjs +203 -0
  47. package/dist/{work-BroFwnup.mjs → work-BYWD_1Zf.mjs} +3 -3
  48. package/dist/{work-Bp1p39kq.mjs → work-DJxH7cCX.mjs} +1 -1
  49. package/docs/jam-session.md +42 -16
  50. package/docs/live-jam.md +92 -10
  51. package/docs/performance.md +197 -35
  52. package/package.json +1 -1
  53. package/src/client/content/video.tsx +10 -2
  54. package/src/client/shell/App.tsx +10 -3
  55. package/src/client/shell/Comments.tsx +5 -3
  56. package/src/client/shell/ContextMenu.tsx +5 -3
  57. package/src/client/shell/JamSurface.tsx +56 -21
  58. package/src/client/shell/LockedApp.tsx +3 -0
  59. package/src/client/shell/Play.tsx +4 -2
  60. package/src/client/shell/Tip.tsx +3 -1
  61. package/src/client/shell/api.ts +47 -20
  62. package/src/client/shell/app-bridge.ts +254 -0
  63. package/src/client/shell/app-perf.ts +92 -0
  64. package/src/client/shell/canvas/Canvas.tsx +115 -22
  65. package/src/client/shell/canvas/FrameNode.tsx +10 -6
  66. package/src/client/shell/canvas/admission.ts +23 -8
  67. package/src/client/shell/canvas/ctl.ts +6 -0
  68. package/src/client/shell/canvas/sleep.ts +57 -17
  69. package/src/client/shell/canvas/updates.ts +2 -1
  70. package/src/client/shell/icons.tsx +1 -0
  71. package/src/client/shell/inset.ts +44 -0
  72. package/src/client/shell/jam-capture.ts +113 -33
  73. package/src/client/shell/jam-keys.ts +40 -9
  74. package/src/client/shell/jam-lane.tsx +14 -5
  75. package/src/client/shell/jam-lines.ts +66 -9
  76. package/src/client/shell/jam-panel.tsx +61 -6
  77. package/src/client/shell/jam-queue.ts +50 -8
  78. package/src/client/shell/jam-session.tsx +53 -4
  79. package/src/client/shell/jam-surface-parts.tsx +6 -3
  80. package/src/client/shell/jam-ui.tsx +6 -1
  81. package/src/client/shell/jam-voice-wait.ts +21 -0
  82. package/src/client/shell/jam-voice.ts +62 -15
  83. package/src/client/shell/main.tsx +14 -1
  84. package/src/client/shell/marks-ui.tsx +5 -3
  85. package/src/client/shell/marver-app.ts +21 -0
  86. package/src/client/shell/perf-run-probe.ts +34 -0
  87. package/src/client/shell/perf-run.ts +70 -0
  88. package/src/client/shell/perf.ts +11 -0
  89. package/src/client/shell/recorder.ts +45 -3
  90. package/src/client/shell/store.ts +52 -24
  91. package/src/client/shell/styles.css +65 -17
  92. package/src/client/shell/tidy.ts +3 -2
  93. package/src/client/shell/unsaved.ts +81 -0
  94. package/src/client/shell/whiteout-probes.ts +141 -0
  95. package/src/shared/app-api.ts +205 -0
  96. package/src/shared/app-perf.ts +308 -0
  97. package/src/shared/approval.ts +20 -0
  98. package/src/shared/events.ts +1 -1
  99. package/src/shared/logo-sniff.ts +86 -0
  100. package/src/shared/machine.ts +132 -0
  101. package/src/shared/perf-run.ts +177 -0
  102. package/templates/AGENTS-embedded.md +31 -1
  103. package/templates/AGENTS-studio.md +31 -1
  104. package/templates/instructions/boards.md +10 -2
  105. package/templates/instructions/jam.md +90 -0
  106. package/dist/bake-DM_uWgAA.mjs +0 -786
  107. package/dist/boards-CGg6piKF.mjs +0 -342
  108. package/dist/perf-BWzQwZqj.mjs +0 -369
  109. package/dist/perf-BoDSkbEb.mjs +0 -429
  110. package/dist/perf-jam-D55U3FZK.mjs +0 -242
  111. package/dist/plugin-C-E7omsh.mjs +0 -2762
@@ -0,0 +1,92 @@
1
+ /**
2
+ * The shell's side of `mv:perf` (spec 28 A3.8 #9, #10, #16): what a 0.27.2 shell tells the Mac app's recorder -
3
+ * its gestures (perf.ts's begin and end, the white-out detector's window), its probe answers (whiteout-probes.ts,
4
+ * given by the canvas: `answerProbesWith`)
5
+ * and its board's frame count at each commit. Inert unless `window.marverApp.perf` exists (app 0.2): in Chrome, on
6
+ * a published canvas and inside app 0.1 nothing here sends, listens or runs a timer. The preload sends `mem` and
7
+ * `shown` by itself; the shell never sees a `doc`.
8
+ *
9
+ * FROZEN signatures (A3.8 #53); the recorder stream fills them (the probes' geometry is the flash stream's
10
+ * whiteout-probes.ts). Every message goes through `APP.perf` in a try: the app going away never breaks the page.
11
+ *
12
+ * As built: a gesture's `on` and `off` carry one `seq` (a new start while one is open ends it first, so main never
13
+ * holds two); `board` is sent when the frame count or the sleeping count changed, read at each change of the board's
14
+ * nodes and again at each gesture's end (frames fall asleep without the store moving), never more.
15
+ */
16
+ import type { PerfMsg } from '../../shared/app-api.ts'
17
+ import { APP } from './marver-app.ts'
18
+ import { useStore } from './store.ts'
19
+ import { sleepingCount } from './canvas/sleep.ts'
20
+
21
+ /** Whether this page talks to the recorder at all. */
22
+ export const PERF_ON = typeof APP?.perf === 'function'
23
+
24
+ /** The white-out probes (whiteout-probes.ts' pick and verify), given by the canvas (Canvas.tsx): canvas code, never
25
+ * in an all-boards-locked bundle, whose shell has no canvas - an ask there goes unanswered, which main reads as an
26
+ * inconclusive sample, as it reads any probe answer that never came. */
27
+ export interface Probes { pick(tick: number): PerfMsg; verify(tick: number): PerfMsg }
28
+ let probes: Probes | null = null
29
+ /** Canvas.tsx, at import: the probes this page answers with. */
30
+ export function answerProbesWith(p: Probes): void { probes = p }
31
+
32
+ let started = false
33
+ let seq = 0
34
+ let open: number | null = null
35
+ let lastBoard = ''
36
+
37
+ /** The board now: its frames and how many sleep, sent when either changed. */
38
+ function boardNow(): void {
39
+ try { boardChanged(useStore.getState().nodes.length, sleepingCount()) } catch { /* the page goes on */ }
40
+ }
41
+
42
+ /** main.tsx, after startAppBridge(): the probes' ask listener and the board subscription. Nothing without `APP.perf`. */
43
+ export function startAppPerf(): void {
44
+ if (!PERF_ON || started) return
45
+ started = true
46
+ try {
47
+ APP!.onPerfAsk?.((a) => {
48
+ if (a.kind !== 'probes' || !probes) return
49
+ try { sendPerf(a.at === 'before' ? probes.pick(a.tick) : probes.verify(a.tick)) } catch { /* no answer: main reads the sample as inconclusive */ }
50
+ })
51
+ } catch { /* the app's own */ }
52
+ useStore.subscribe((s, prev) => { if (s.nodes !== prev.nodes) boardNow() })
53
+ boardNow()
54
+ }
55
+
56
+ /** perf.ts's begin(): a gesture starts. */
57
+ export function gestureOn(type?: 'pan' | 'zoom' | 'layout'): void {
58
+ if (!PERF_ON) return
59
+ if (open !== null) gestureOff()
60
+ seq = seq >= 2 ** 31 - 2 ? 1 : seq + 1
61
+ open = seq
62
+ sendPerf({ kind: 'gesture', on: true, seq, ...(type ? { type } : {}) })
63
+ }
64
+
65
+ /** perf.ts's end(): the gesture that started last ends. */
66
+ export function gestureOff(): void {
67
+ if (!PERF_ON || open === null) return
68
+ const s = open
69
+ open = null
70
+ sendPerf({ kind: 'gesture', on: false, seq: s })
71
+ boardNow()
72
+ }
73
+
74
+ /** The board committed: its frame count and how many sleep. */
75
+ export function boardChanged(frames: number, asleep: number): void {
76
+ if (!PERF_ON) return
77
+ const k = `${frames}/${asleep}`
78
+ if (k === lastBoard) return
79
+ lastBoard = k
80
+ sendPerf({ kind: 'board', frames, asleep })
81
+ }
82
+
83
+ /** The display's refresh rate main last said (`display` ask), for gesture records' `hz`; null until it says. */
84
+ export function displayHz(): number | null {
85
+ try { return APP?.perfInfo?.().hz ?? null } catch { return null }
86
+ }
87
+
88
+ /** One message to the app, never throwing. */
89
+ export function sendPerf(p: PerfMsg): void {
90
+ if (!PERF_ON) return
91
+ try { APP!.perf!(p) } catch { /* the page goes on */ }
92
+ }
@@ -10,7 +10,15 @@ import { NOTE_GAP } from '../notes.ts'
10
10
  import { onMotion, startCameraBroadcast, setCameraScale } from './camera-broadcast.ts'
11
11
  import { attachCanvas, recorder } from '../recorder.ts'
12
12
  import { sleepingCount } from './sleep.ts'
13
- import { keepOverResume, resumed } from '../api.ts'
13
+ import { aimed } from './admission.ts'
14
+ import { keepOverResume, resumed, WS } from '../api.ts'
15
+ import { APP_REOPEN } from '../marver-app.ts'
16
+ import { TOP } from '../inset.ts'
17
+ import { answerProbesWith } from '../app-perf.ts'
18
+ import { pick, verify } from '../whiteout-probes.ts'
19
+
20
+ // the white-out probes the Mac app's recorder asks for (app-perf.ts): the canvas's own, so a locked bundle has none
21
+ answerProbesWith({ pick, verify })
14
22
 
15
23
  /**
16
24
  * The world. rzpp owns pan/zoom; nodes are absolutely positioned children of #sh-world.
@@ -34,6 +42,62 @@ import { keepOverResume, resumed } from '../api.ts'
34
42
  */
35
43
  const GAP = 32
36
44
  const BAR = 56
45
+
46
+ /** The camera survives a reload (spec 28 A2.9): kept per canvas and board, `mv-camera:<workspace>:<board>`, a second
47
+ * after it settles, and the next load of that board opens there - when its link names no selection, or when the Mac
48
+ * app reloaded the tab after a crash (`marverApp.reopen`). A1's camera carried over a resume wins. Dev canvases only:
49
+ * a published one has no workspace, and opens on the whole board as before. */
50
+ type Camera = { x: number; y: number; scale: number }
51
+ const cameraKey = (board: string) => `mv-camera:${WS}:${board}`
52
+ function savedCamera(board: string): Camera | null {
53
+ if (!WS) return null
54
+ try {
55
+ const c = JSON.parse(localStorage.getItem(cameraKey(board)) ?? 'null')
56
+ return c && [c.x, c.y, c.scale].every((v) => typeof v === 'number' && Number.isFinite(v)) && c.scale >= 0.05 && c.scale <= 5 ? { x: c.x, y: c.y, scale: c.scale } : null
57
+ } catch { return null }
58
+ }
59
+ let keepTimer: ReturnType<typeof setTimeout> | undefined
60
+ /** the camera write waiting for its second of quiet, if any */
61
+ let keepPending: (() => void) | undefined
62
+ /** Where the camera's flight lands (a fit, a zoom), for canvasCtl.landing: read only while rzpp animates. */
63
+ let flight: Camera | null = null
64
+ function keepCamera(x: number, y: number, scale: number) {
65
+ if (!WS) return
66
+ const board = useStore.getState().board
67
+ clearTimeout(keepTimer)
68
+ const write = () => {
69
+ keepPending = undefined
70
+ if (useStore.getState().board !== board) return // switched meanwhile: this camera was the other board's
71
+ try { localStorage.setItem(cameraKey(board), JSON.stringify({ x: Math.round(x * 100) / 100, y: Math.round(y * 100) / 100, scale })) } catch { /* storage off: the next load fits */ }
72
+ }
73
+ keepPending = write
74
+ keepTimer = setTimeout(write, 1000)
75
+ }
76
+ /**
77
+ * The pending camera, written now (spec 28 A3.8 #43): the page is hidden or leaving, and the Mac app may unload a
78
+ * hidden tab, which ends its page with the second of quiet not yet over. A hide mid-flight writes where the flight
79
+ * was going: a hidden page's animation frames stop, so it would not land before the page went. Nothing pending,
80
+ * nothing written. In Chrome too - a tab switch, a closed tab.
81
+ */
82
+ export function flushCamera(): void {
83
+ if (flight && canvasCtl.cameraBusy()) keepCamera(flight.x, flight.y, flight.scale)
84
+ if (!keepPending) return
85
+ clearTimeout(keepTimer)
86
+ keepPending()
87
+ }
88
+ let leaveWatched = false
89
+ /**
90
+ * The hide and the leave write the pending camera: listened for from the canvas's first mount, so after the page
91
+ * recorder's own listeners (startRecorder runs before the first render) - its cut of a load still waiting comes first,
92
+ * as `hidden`. Registered at import, ahead of the recorder's, the camera's pagehide write let a navigation away cut
93
+ * that load as `error` instead (page-recorder-browser's "the page goes").
94
+ */
95
+ function watchLeave(): void {
96
+ if (leaveWatched || typeof document === 'undefined') return
97
+ leaveWatched = true
98
+ document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'hidden') flushCamera() })
99
+ addEventListener('pagehide', flushCamera)
100
+ }
37
101
  function insets(el: HTMLElement) {
38
102
  const c = el.getBoundingClientRect()
39
103
  const rect = (q: string) => document.querySelector(q)?.getBoundingClientRect()
@@ -47,7 +111,8 @@ function insets(el: HTMLElement) {
47
111
  return {
48
112
  left: (leftEdge ? Math.max(0, leftEdge - c.left) : 0) + GAP,
49
113
  right: GAP + 16,
50
- top: (pill ? Math.max(0, pill.bottom - c.top) : 0) + 12 + BAR,
114
+ // the toolbar's foot, or the Mac app's strip when the toolbar is hidden (Hide UI) - the strip is always there
115
+ top: Math.max(pill ? pill.bottom - c.top : 0, TOP) + 12 + BAR,
51
116
  bottom: (lane ? Math.max(0, c.bottom - lane.top) : 0) + GAP + 16,
52
117
  }
53
118
  }
@@ -61,23 +126,22 @@ function insets(el: HTMLElement) {
61
126
  */
62
127
  const GRID = 20
63
128
  function paintGrid(positionX: number, positionY: number, scale: number) {
64
- const el = document.querySelector('.sh-canvas') as HTMLElement | null
65
- if (!el) return
129
+ // on .sh-app, which the canvas's ::before and the scroll edge (A3.8 #31) both inherit them from - the same element the
130
+ // camera's own variables go on every frame, so the style work per frame does not grow
131
+ const app = document.querySelector('.sh-app') as HTMLElement | null
132
+ if (!app) return
66
133
  let step = GRID * scale
67
134
  while (step < 14) step *= 2
68
135
  while (step >= 28) step /= 2
69
136
  const t = (step - 14) / 14
70
- el.style.setProperty('--grid-size', `${step}px ${step}px`)
71
- el.style.setProperty('--grid-pos', `${positionX % step}px ${positionY % step}px`)
72
- el.style.setProperty('--grid-alpha', (0.35 + 0.65 * Math.min(1, t)).toFixed(3))
137
+ app.style.setProperty('--grid-size', `${step}px ${step}px`)
138
+ app.style.setProperty('--grid-pos', `${positionX % step}px ${positionY % step}px`)
139
+ app.style.setProperty('--grid-alpha', (0.35 + 0.65 * Math.min(1, t)).toFixed(3))
73
140
  // screen-space overlays (selection bar) position themselves from these - no re-render per frame
74
- const app = document.querySelector('.sh-app') as HTMLElement | null
75
- if (app) {
76
- app.style.setProperty('--sh-s', String(scale))
77
- app.style.setProperty('--sh-inv', String(1 / scale)) // world-units-per-screen-px, for zoom-invariant strokes
78
- app.style.setProperty('--sh-tx', `${positionX}px`)
79
- app.style.setProperty('--sh-ty', `${positionY}px`)
80
- }
141
+ app.style.setProperty('--sh-s', String(scale))
142
+ app.style.setProperty('--sh-inv', String(1 / scale)) // world-units-per-screen-px, for zoom-invariant strokes
143
+ app.style.setProperty('--sh-tx', `${positionX}px`)
144
+ app.style.setProperty('--sh-ty', `${positionY}px`)
81
145
  }
82
146
 
83
147
  /**
@@ -145,10 +209,19 @@ export function Canvas() {
145
209
  const gesture = useStore((s) => s.gesture)
146
210
  const setScale = useStore((s) => s.setScale)
147
211
  const ref = useRef<ReactZoomPanPinchContentRef>(null)
212
+ // every camera move the canvas aims (a fit, a zoom, a camera restored): where it lands, while rzpp flies there, and the
213
+ // boot queue told - the first frame of a board starts now, ranked on that view, not once the flight is over
214
+ const fly = (x: number, y: number, scale: number, ms: number) => {
215
+ flight = ms ? { x, y, scale } : null
216
+ ref.current?.setTransform(x, y, scale, ms, 'easeOut')
217
+ aimed()
218
+ }
148
219
  const scaleTimer = useRef(0)
149
220
 
150
221
  // B0.4: frame-time sampler + image-LOD camera signal; the recorder hears when the camera stops and what sleeps (spec 28 A1.7)
151
222
  useEffect(() => { startPerf(); startCameraBroadcast(); return attachCanvas({ onMotion, sleeping: sleepingCount }) }, [])
223
+ // the pending camera written as the page hides or leaves (A3.8 #43), after the recorder's own listeners
224
+ useEffect(() => { watchLeave() }, [])
152
225
 
153
226
  useEffect(() => {
154
227
  const wrap = () => document.querySelector('.sh-canvas') as HTMLElement | null
@@ -167,14 +240,15 @@ export function Canvas() {
167
240
  let px = p.left + (aw - w * scale) / 2
168
241
  let py = p.top + (ah - h * scale) / 2
169
242
  if (focus) {
170
- // clamp order matters: left/top win when the band is tighter than the content
243
+ // clamp order matters: left/top win when the band is tighter than the content. The centre is the usable
244
+ // rectangle's: below the Mac app's strip when the shell took the inset (TOP 44)
171
245
  px = Math.max(Math.min((vw - w * scale) / 2, vw - p.right - w * scale), p.left)
172
- py = Math.max(Math.min((vh - h * scale) / 2, vh - p.bottom - h * scale), p.top)
246
+ py = Math.max(Math.min(TOP + (vh - TOP - h * scale) / 2, vh - p.bottom - h * scale), p.top)
173
247
  }
174
248
  const tx = px - x * scale, ty = py - y * scale
175
249
  // where this fit lands, in world px: the first one after a board's commit shows its visible cohort (spec 28 A1.7)
176
250
  recorder.placed({ x: -tx / scale, y: -ty / scale, w: vw / scale, h: vh / scale })
177
- ref.current.setTransform(tx, ty, scale, 320, 'easeOut')
251
+ fly(tx, ty, scale, 320)
178
252
  }
179
253
  const fitKeys = (keys: string[], focus: boolean) => {
180
254
  const st = useStore.getState()
@@ -212,11 +286,24 @@ export function Canvas() {
212
286
  const el = wrap(), inst = ref.current
213
287
  if (!el || !inst) return
214
288
  const { positionX, positionY, scale } = inst.instance.transformState
215
- const cx = el.clientWidth / 2, cy = el.clientHeight / 2
216
- const k = target / scale // zoom about the viewport center
217
- inst.setTransform(cx - (cx - positionX) * k, cy - (cy - positionY) * k, target, 250, 'easeOut')
289
+ const cx = el.clientWidth / 2, cy = TOP + (el.clientHeight - TOP) / 2
290
+ const k = target / scale // zoom about the usable rectangle's centre (below the Mac app's strip with the inset)
291
+ fly(cx - (cx - positionX) * k, cy - (cy - positionY) * k, target, 250)
218
292
  }
219
293
  canvasCtl.cameraBusy = () => !!ref.current?.instance.animation
294
+ // the camera as the world is drawn now, mid-flight included: the white-out probes' bracket (spec 28 A3.8 #16)
295
+ canvasCtl.transform = () => {
296
+ const t = ref.current?.instance.transformState
297
+ return t ? { x: t.positionX, y: t.positionY, s: t.scale } : null
298
+ }
299
+ // a rect on screen now, where it will be when the flight lands: the same world point under the landing transform
300
+ canvasCtl.landing = (r: DOMRect) => {
301
+ const el = wrap(), inst = ref.current
302
+ if (!flight || !el || !inst?.instance.animation) return r
303
+ const { positionX, positionY, scale } = inst.instance.transformState
304
+ const c = el.getBoundingClientRect(), k = flight.scale / scale
305
+ return new DOMRect(c.left + flight.x + (r.left - c.left - positionX) * k, c.top + flight.y + (r.top - c.top - positionY) * k, r.width * k, r.height * k)
306
+ }
220
307
  // a page that reloads itself when its canvas comes back (spec 28 A1.11) opens where the person was looking
221
308
  const unkeep = keepOverResume(() => {
222
309
  const t = ref.current?.instance.transformState
@@ -253,7 +340,12 @@ export function Canvas() {
253
340
  let revealed = false
254
341
  booted.current = true
255
342
  // the page before this one reloaded itself when its canvas came back: its camera, on the board it showed
256
- const cam = resumed?.camera && resumed.board === useStore.getState().board ? resumed.camera : null
343
+ const board = useStore.getState().board
344
+ const carried = resumed?.camera && resumed.board === board ? resumed.camera : null
345
+ // else the camera this board was left at (A2.9) - a link naming a selection fits it instead, unless the app
346
+ // reloaded this tab after a crash
347
+ const named = !!(bootHash.n?.length || bootHash.f?.length || bootHash.s?.length)
348
+ const cam = carried ?? (!named || APP_REOPEN ? savedCamera(board) : null)
257
349
  const fit = () => {
258
350
  const keys = linkTargets(bootHash, useStore.getState().nodes)
259
351
  if (keys.length) {
@@ -264,7 +356,7 @@ export function Canvas() {
264
356
  const el = document.querySelector('.sh-canvas') as HTMLElement | null
265
357
  if (cam && el && ref.current) {
266
358
  recorder.placed({ x: -cam.x / cam.scale, y: -cam.y / cam.scale, w: el.clientWidth / cam.scale, h: el.clientHeight / cam.scale })
267
- ref.current.setTransform(cam.x, cam.y, cam.scale, 0)
359
+ fly(cam.x, cam.y, cam.scale, 0)
268
360
  } else if (keys.length) {
269
361
  canvasCtl.fitNodes(keys)
270
362
  } else {
@@ -429,6 +521,7 @@ export function Canvas() {
429
521
  onTransformed={(r) => {
430
522
  paintGrid(r.state.positionX, r.state.positionY, r.state.scale)
431
523
  setCameraScale(r.state.scale) // keep the LOD's settle-scale current (cheap number write, no React)
524
+ if (booted.current) keepCamera(r.state.positionX, r.state.positionY, r.state.scale) // over a reload (A2.9)
432
525
  clearTimeout(scaleTimer.current)
433
526
  scaleTimer.current = window.setTimeout(() => setScale(r.state.scale), 120)
434
527
  }}
@@ -1,6 +1,7 @@
1
1
  import { memo, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'
2
2
  import { cap, frameUrl, shownRev, useStore, CONFIG, type Node } from '../store.ts'
3
3
  import { admit, release } from './admission.ts'
4
+ import { canvasCtl } from './ctl.ts'
4
5
  import { CopyIcon, IntentGlyph, ParallelogramFillIcon, ReloadIcon, SlideFrameIcon, XIcon } from '../icons.tsx'
5
6
  import { CommentLayer } from '../Comments.tsx'
6
7
  import { useComments } from '../comments-store.ts'
@@ -8,7 +9,7 @@ import { threadHostKey } from '../keys.ts'
8
9
  import { registerFrame, unregisterFrame } from './frame-registry.ts'
9
10
  import { canvasClick, canvasPointer, frameGone, frameLoaded, pressNow, useJamCapture } from '../jam-capture.ts'
10
11
  import { primeCameraFor } from './camera-broadcast.ts'
11
- import { sleep, wake } from './sleep.ts'
12
+ import { scheduleSleep, sleep, wake } from './sleep.ts'
12
13
  import { canAutoReload, shouldArmReadyWatch } from './ready-watch.ts'
13
14
  import { Stickies, type NoteSpec } from './Sticky.tsx'
14
15
  import { recorder } from '../recorder.ts'
@@ -108,9 +109,12 @@ export const FrameNode = memo(function FrameNode({ node }: { node: Node }) {
108
109
  useEffect(() => {
109
110
  if (!frame || node.missing) { admittedRef.current = false; setSrc(undefined); return } // gone: the card replaces the iframe; a return is a new document, admitted anew
110
111
  if (admittedRef.current) return // the document exists (the frame's id changed under it): no slot
111
- const rank = () => { // visible first, then by distance to the centre of the canvas (the panel offsets the window's)
112
- const r = iframeRef.current?.getBoundingClientRect(), c = document.querySelector('.sh-canvas')?.getBoundingClientRect()
113
- if (!r || !c) return Infinity
112
+ // visible first, then by distance to the centre of the canvas (the panel offsets the window's) - where the frame
113
+ // will be once the camera lands from a fit or zoom on its way (a board's first pick comes as the fit sets off)
114
+ const rank = () => {
115
+ const now = iframeRef.current?.getBoundingClientRect(), c = document.querySelector('.sh-canvas')?.getBoundingClientRect()
116
+ if (!now || !c) return Infinity
117
+ const r = canvasCtl.landing(now)
114
118
  const visible = r.right > c.left && r.left < c.right && r.bottom > c.top && r.top < c.bottom
115
119
  return (visible ? 0 : 1e7) + Math.hypot(r.x + r.width / 2 - c.x - c.width / 2, r.y + r.height / 2 - c.y - c.height / 2)
116
120
  }
@@ -215,8 +219,8 @@ export const FrameNode = memo(function FrameNode({ node }: { node: Node }) {
215
219
  // one being installed
216
220
  if (interact || dirty.current || resizing.current || node.status !== 'ready' || node.stale || behind) return
217
221
  if (node.themeOn !== undefined && node.themeOn !== node.theme) return // the frame has not painted the new theme yet
218
- const t = setTimeout(() => { void sleep(node.key, iframe, { frame: frame.id, theme: node.theme, w, h, doc: node.shown }) }, 250)
219
- return () => clearTimeout(t)
222
+ // counted while it waits (sleep.ts bakeWork): a headless perf run measures only once no sleep is still to come
223
+ return scheduleSleep(() => { void sleep(node.key, iframe, { frame: frame.id, theme: node.theme, w, h, doc: node.shown }) }, 250)
220
224
  }, [interact, node.status, node.theme, node.themeOn, node.rev, node.nav, node.stale, behind, w, h, node.missing, frame?.id, node.key, resizeTick])
221
225
  useEffect(() => () => wake(node.key, iframeRef.current), [node.key])
222
226
 
@@ -10,9 +10,11 @@
10
10
  *
11
11
  * A new batch admits ONE frame first (the quickest first content: one boot alone is ~550 ms, four
12
12
  * together ~1.8 s), then up to SLOTS at a time. Pure, apart from its timing: a board that mounts
13
- * registers every node, the shell fits the camera (App.tsx, a few tens of ms later), then the first
14
- * pump ranks them (visible first, nearest the centre of the canvas first); a freed slot pumps on
15
- * the next microtask, ranking again by the view of that moment.
13
+ * registers every node, the shell aims the camera (its fit: a frame after mount at boot, 60 ms after
14
+ * on a switch; Canvas.tsx says so through aimed()), then the first pump ranks them (visible first,
15
+ * nearest the centre of the canvas first) on where each frame will be once the camera lands
16
+ * (canvasCtl.landing) - it need not wait out the fit's ~320 ms flight. With no aim it waits SETTLE, as
17
+ * long as that flight. A freed slot pumps on the next microtask, ranking again by the view of that moment.
16
18
  */
17
19
  export const SLOTS = 4
18
20
  /** A new batch's head start: one frame alone until it is done, or until this long - one stalled
@@ -21,6 +23,7 @@ export const HEAD_MS = 2000
21
23
  let primed = false // the batch may use every slot
22
24
  let gen = 0 // the batch: a pump scheduled for an earlier one is void
23
25
  let timer: ReturnType<typeof setTimeout> | undefined
26
+ let settling: ReturnType<typeof setTimeout> | undefined // a pump waiting for the view to settle (SETTLE): aimed() runs it now
24
27
 
25
28
  export interface Admission { key: string; rank: () => number; start: () => void }
26
29
 
@@ -28,17 +31,29 @@ const waiting = new Map<string, Admission>()
28
31
  const active = new Set<string>()
29
32
  let scheduled = false
30
33
 
31
- /** Ask for a slot. Starts once the view has settled (SETTLE ms) when one is free; else queued by rank. */
34
+ /** Ask for a slot. Starts once the view has settled - the camera aimed where it will rest (aimed()), else SETTLE ms -
35
+ * when one is free; else queued by rank. */
32
36
  export function admit(a: Admission): void {
33
37
  if (active.has(a.key)) return
34
38
  if (!waiting.size && !active.size) { // a new batch
35
- primed = false; gen++; scheduled = false; clearTimeout(timer)
39
+ primed = false; gen++; scheduled = false; clearTimeout(timer); clearTimeout(settling); settling = undefined
36
40
  timer = setTimeout(() => { primed = true; schedule(0) }, HEAD_MS)
37
41
  }
38
42
  waiting.set(a.key, a)
39
43
  schedule(SETTLE)
40
44
  }
41
- const SETTLE = 350 // the board fit animates ~250 ms from 60 ms after mount: rank the first pick on the settled view
45
+ /** The board fit animates ~320 ms from 60 ms after mount: with no aim said, the first pick waits for it to land and
46
+ * ranks on the settled view. */
47
+ const SETTLE = 350
48
+
49
+ /** The camera was just sent where it will rest - a fit (a board's first, ⇧1, a link's selection), a zoom, a camera
50
+ * restored (Canvas.tsx). A pump waiting for the view to settle runs now: its ranks read where each frame will be once
51
+ * the camera lands (canvasCtl.landing), so the first pick is the one SETTLE would have made, a flight earlier. */
52
+ export function aimed(): void {
53
+ if (settling === undefined) return
54
+ clearTimeout(settling); settling = undefined; scheduled = false
55
+ schedule(0)
56
+ }
42
57
 
43
58
  /** The frame is done booting (ready, error, gone, or its watchdog took over): free the slot, or
44
59
  * leave the queue if it never started. */
@@ -58,7 +73,7 @@ function schedule(ms: number): void {
58
73
  if (scheduled) return
59
74
  scheduled = true
60
75
  const g = gen, run = () => { if (g === gen) pump() }
61
- if (ms) setTimeout(run, ms); else queueMicrotask(run)
76
+ if (ms) settling = setTimeout(() => { settling = undefined; run() }, ms); else queueMicrotask(run)
62
77
  }
63
78
 
64
79
  function pump(): void {
@@ -74,4 +89,4 @@ function pump(): void {
74
89
  }
75
90
 
76
91
  /** For tests: nothing queued, nothing active. */
77
- export function resetAdmission(): void { waiting.clear(); active.clear(); primed = false; scheduled = false; gen++; clearTimeout(timer) }
92
+ export function resetAdmission(): void { waiting.clear(); active.clear(); primed = false; scheduled = false; gen++; clearTimeout(timer); clearTimeout(settling); settling = undefined }
@@ -31,4 +31,10 @@ export const canvasCtl = {
31
31
  cameraBusy(): boolean { return false },
32
32
  /** What the camera shows now, in world px (null with no canvas) - a load's visible cohort when no fit landed. */
33
33
  view(): { x: number; y: number; w: number; h: number } | null { return null },
34
+ /** Where a rect on screen now will be once the camera lands from the flight it is on (a fit, a zoom) - itself while
35
+ * the camera rests: the boot queue ranks a board's first frame on the view the person will see (admission.ts). */
36
+ landing(r: DOMRect): DOMRect { return r },
37
+ /** The camera now, `{ x, y, s }` as the world is drawn (null with no canvas): the white-out probes' bracket (spec 28
38
+ * A3.8 #16) and a hide mid-flight (A3.8 #43). Assigned by Canvas.tsx from its camera. */
39
+ transform(): { x: number; y: number; s: number } | null { return null },
34
40
  }
@@ -28,7 +28,9 @@
28
28
  import { ROUTE } from '../../const.ts'
29
29
  import { BAKES, PUBLISHED } from '../store.ts'
30
30
  import { api } from '../api.ts'
31
+ import { PERF_RUN } from '../perf-run.ts'
31
32
  import { readOwn, sleepRule } from '../../../shared/sleep-rule.ts'
33
+ import type { BakeWork } from '../../../shared/perf-run.ts'
32
34
 
33
35
  /** `doc`: the revision the document shows (spec 26) - the compiler refuses a document behind its frame */
34
36
  export interface SleepKey { frame: string; theme: string; w: number; h: number; doc?: string }
@@ -51,10 +53,32 @@ const keyOf = (k: SleepKey) => `${k.frame}|${k.theme}|${Math.round(k.w)}|${Math.
51
53
  const asleep = new Map<string, { key: string; doc: Document }>()
52
54
  /** How many frames are asleep now (the recorder's weight of a settled load, spec 28 A1.7). */
53
55
  export const sleepingCount = (): number => asleep.size
56
+ /**
57
+ * The page's own bake work (spec 28 A3.8 #18): four counts of their own - `pending` below is the current request
58
+ * per node and survives a successful sleep, so it says nothing about idleness. `scheduled`: FrameNode's 250 ms
59
+ * timer and both retry timers, every one through `scheduleSleep()`; `running`: a sleep from its entry to its
60
+ * `finally` (fonts, the ask, the decode, the texture installed); `queued`: asks batched and not sent yet;
61
+ * `inflight`: the bake POST on its way. A headless perf run measures only once all four are zero and the server's
62
+ * own jobs for the run are too (bake.ts `jobsOf`).
63
+ */
64
+ let scheduled = 0, running = 0, inflight = 0
65
+ export const bakeWork = (): BakeWork => ({ scheduled, running, queued: queue.length, inflight })
66
+ /** All four at zero. Not the run's bake-idle: the driver adds the server's `jobsOf(run)`. */
67
+ export const bakeIdle = (): boolean => { const w = bakeWork(); return !w.scheduled && !w.running && !w.queued && !w.inflight }
68
+ /** A sleep to try in `ms` (FrameNode's settle, a compile still running, one retry of a failed compile), counted while
69
+ * it waits; the cancel stops it and its count. */
70
+ export function scheduleSleep(fn: () => void, ms: number): () => void {
71
+ scheduled++
72
+ let done = false
73
+ const t = setTimeout(() => { if (done) return; done = true; scheduled--; fn() }, ms)
74
+ return () => { if (done) return; done = true; scheduled--; clearTimeout(t) }
75
+ }
54
76
  /** The node's current request, so a stale answer (a newer sleep, a wake in between) is dropped. */
55
77
  const pending = new Map<string, number>()
56
78
  let seq = 0
57
- /** Nodes with one retry of a failed compile in flight. */
79
+ /** Nodes with a retry of a failed compile in flight - or, in a headless perf run, spent: a run's frame retries once
80
+ * until it wakes, so the run can reach bake-idle; every other canvas retries every 4 s for as long as the frame
81
+ * rests, as before 0.27.2, so a frame recovers when the server does. */
58
82
  const retried = new Set<string>()
59
83
  const RETRY_MS = 4000
60
84
  /** The server's answer for a compile still running (src/server/bake.ts COMPILING), and how many times a
@@ -95,27 +119,39 @@ function ask(key: SleepKey): Promise<Answer> {
95
119
  for (const q of batch) { const kk = keyOf(q.key); const e = byKey.get(kk); if (e) e.waiters.push(q.resolve); else byKey.set(kk, { key: q.key, waiters: [q.resolve] }) }
96
120
  const asks = [...byKey.values()].map((e) => ({ frame: e.key.frame, theme: e.key.theme, w: Math.round(e.key.w), h: Math.round(e.key.h), ...(e.key.doc ? { doc: e.key.doc } : {}) }))
97
121
  let data: { answers?: (Answer & SleepKey)[] } | null = null
98
- const index = PUBLISHED ? await staticAnswers() : null
99
- if (!index) {
100
- try {
101
- const r = await api('bakes', { method: 'POST', headers: { 'content-type': 'application/json', 'x-mv-c': csrf() }, body: JSON.stringify({ asks }) })
102
- data = r.ok ? await r.json() : null
103
- } catch { data = null }
104
- }
105
- for (const e of byKey.values()) {
106
- const a = index ? index[keyOf(e.key)] : data?.answers?.find((x) => keyOf(x) === keyOf(e.key))
107
- const answer: Answer = a ? (a.ok ? { ok: true, targets: a.targets } : { ok: false, error: a.error }) : { ok: false, error: 'no answer' }
108
- for (const w of e.waiters) w(answer)
109
- }
122
+ inflight++
123
+ try {
124
+ const index = PUBLISHED ? await staticAnswers() : null
125
+ if (!index) {
126
+ try {
127
+ const r = await api('bakes', { method: 'POST', headers: { 'content-type': 'application/json', 'x-mv-c': csrf() }, body: JSON.stringify({ asks }) })
128
+ data = r.ok ? await r.json() : null
129
+ } catch { data = null }
130
+ }
131
+ answerAll(byKey, index, data)
132
+ } finally { inflight-- }
110
133
  }, 40)
111
134
  })
112
135
  }
136
+ /** Every waiter of a batch, its key's answer - before the POST stops counting, so the page is never idle between. */
137
+ function answerAll(byKey: Map<string, { key: SleepKey; waiters: ((a: Answer) => void)[] }>, index: Record<string, Answer> | null, data: { answers?: (Answer & SleepKey)[] } | null): void {
138
+ for (const e of byKey.values()) {
139
+ const a = index ? index[keyOf(e.key)] : data?.answers?.find((x) => keyOf(x) === keyOf(e.key))
140
+ const answer: Answer = a ? (a.ok ? { ok: true, targets: a.targets } : { ok: false, error: a.error }) : { ok: false, error: 'no answer' }
141
+ for (const w of e.waiters) w(answer)
142
+ }
143
+ }
113
144
 
114
145
  /** Put a node's live document to sleep under `key`. Resolves once the override is installed (or
115
146
  * the document was found to have no effects, or the compile failed and the frame stays live).
116
147
  * A wake or a newer sleep in the meantime supersedes it. */
117
148
  export async function sleep(nodeKey: string, iframe: HTMLIFrameElement, key: SleepKey): Promise<'asleep' | 'live'> {
118
149
  if (AWAKE) return 'live'
150
+ running++
151
+ try { return await sleepNow(nodeKey, iframe, key) } finally { running-- }
152
+ }
153
+
154
+ async function sleepNow(nodeKey: string, iframe: HTMLIFrameElement, key: SleepKey): Promise<'asleep' | 'live'> {
119
155
  const k = keyOf(key)
120
156
  const doc = iframe.contentDocument
121
157
  if (!doc?.body) return 'live'
@@ -142,7 +178,7 @@ export async function sleep(nodeKey: string, iframe: HTMLIFrameElement, key: Sle
142
178
  const was = compiling.get(nodeKey)
143
179
  const n = (was && was.key === k ? was.n : 0) + 1
144
180
  compiling.set(nodeKey, { key: k, n })
145
- if (n <= COMPILING_TRIES) { setTimeout(() => { if (current()) void sleep(nodeKey, iframe, key) }, RETRY_MS); return 'live' }
181
+ if (n <= COMPILING_TRIES) { scheduleSleep(() => { if (current()) void sleep(nodeKey, iframe, key) }, RETRY_MS); return 'live' }
146
182
  }
147
183
  // no compiler (a published canvas, a compile that failed): the pause alone, the glass live -
148
184
  // never an effect layer without its texture
@@ -156,10 +192,13 @@ export async function sleep(nodeKey: string, iframe: HTMLIFrameElement, key: Sle
156
192
  if (PUBLISHED && targets.length && doc.querySelector('meta[name="mv-bakes"]')?.getAttribute('content') !== String(BAKES)) targets = []
157
193
  if (!install(doc, targets)) return 'live'
158
194
  // a certified sleep is remembered; the pause-only fallback is not, so the next lifecycle event
159
- // asks again (a compile the source outran, a server hiccup), and one retry is scheduled now
160
- if (targets.length) { asleep.set(nodeKey, { key: k, doc }); compiling.delete(nodeKey) }
195
+ // asks again (a compile the source outran, a server hiccup), and a retry is scheduled now. A canvas retries
196
+ // every 4 s while the frame rests: the retry clears its own mark, so a failure after a failure asks again and
197
+ // the glass sleeps once the server recovers. A headless perf run's retry keeps its mark until the node wakes -
198
+ // one retry, then nothing more, or a frame the compiler refuses would keep the run from ever being bake-idle
199
+ if (targets.length) { asleep.set(nodeKey, { key: k, doc }); compiling.delete(nodeKey); retried.delete(nodeKey) }
161
200
  else if (answer.ok === false && answer.error === COMPILING) { /* out of looks: the pause alone, final */ }
162
- else if (!PUBLISHED && !retried.has(nodeKey)) { retried.add(nodeKey); setTimeout(() => { retried.delete(nodeKey); if (current()) void sleep(nodeKey, iframe, key) }, RETRY_MS) } // a static miss is final
201
+ else if (!PUBLISHED && !retried.has(nodeKey)) { retried.add(nodeKey); scheduleSleep(() => { if (!PERF_RUN) retried.delete(nodeKey); if (current()) void sleep(nodeKey, iframe, key) }, RETRY_MS) } // a static miss is final
163
202
  return 'asleep'
164
203
  }
165
204
 
@@ -168,6 +207,7 @@ export function wake(nodeKey: string, iframe: HTMLIFrameElement | null): void {
168
207
  pending.delete(nodeKey)
169
208
  asleep.delete(nodeKey)
170
209
  compiling.delete(nodeKey)
210
+ retried.delete(nodeKey)
171
211
  const doc = iframe?.contentDocument
172
212
  const st = doc?.getElementById(STYLE_ID)
173
213
  if (!doc || !st) return
@@ -7,6 +7,7 @@
7
7
  * when its turn comes.
8
8
  */
9
9
  import { admit, release } from './admission.ts'
10
+ import { canvasCtl } from './ctl.ts'
10
11
  import { frameIsLeased, useStore, type Node } from '../store.ts'
11
12
 
12
13
  const rect = (key: string) => document.querySelector(`[data-node="${CSS.escape(key)}"]`)?.getBoundingClientRect()
@@ -21,7 +22,7 @@ function onScreen(key: string): boolean {
21
22
  return r.right > c.left - mx && r.left < c.right + mx && r.bottom > c.top - my && r.top < c.bottom + my
22
23
  }
23
24
  const rank = (key: string) => () => {
24
- const r = rect(key), c = view()
25
+ const now = rect(key), c = view(), r = now && canvasCtl.landing(now) // where it will be once a camera flight lands
25
26
  return r && c ? Math.hypot(r.x + r.width / 2 - c.x - c.width / 2, r.y + r.height / 2 - c.y - c.height / 2) : Infinity
26
27
  }
27
28
 
@@ -53,6 +53,7 @@ export const PanelFilledIcon = icon(<><rect x="32" y="48" width="192" height="16
53
53
  export const FrameRectIcon = icon(<rect x="40" y="52" width="176" height="152" rx="20" fill="none" stroke="currentColor" strokeWidth="16" />)
54
54
  export const UserIcon = icon(<path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z" />)
55
55
  export const PencilSimpleIcon = icon(<path d="M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z" />)
56
+ export const PauseIcon = icon(<><rect x="64" y="40" width="40" height="176" rx="10" /><rect x="152" y="40" width="40" height="176" rx="10" /></>)
56
57
  export const LinkIcon = icon(<path d="M137.54,186.36a8,8,0,0,1,0,11.31l-9.94,10A56,56,0,0,1,48.38,128.4L72.5,104.28A56,56,0,0,1,149.31,102a8,8,0,1,1-10.64,12,40,40,0,0,0-54.85,1.63L59.7,139.72a40,40,0,0,0,56.58,56.58l9.94-9.94A8,8,0,0,1,137.54,186.36Zm70.08-138a56.08,56.08,0,0,0-79.22,0l-9.94,9.95a8,8,0,0,0,11.32,11.31l9.94-9.94a40,40,0,0,1,56.58,56.58L172.18,140.4a40,40,0,0,1-54.85,1.6,8,8,0,1,0-10.64,12,56,56,0,0,0,76.81-2.26l24.12-24.12A56.08,56.08,0,0,0,207.62,48.38Z" />)
57
58
  export const LaserIcon = icon(<><circle cx="128" cy="128" r="56" fill="none" stroke="currentColor" strokeWidth="16" /><path d="M128 24 V56 M128 200 V232 M24 128 H56 M200 128 H232" fill="none" stroke="currentColor" strokeWidth="16" strokeLinecap="round" /><circle cx="128" cy="128" r="12" /></>)
58
59