@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
@@ -0,0 +1,636 @@
1
+ /**
2
+ * @file artboard-live-gate.tsx — 2.0.5: the React half of artboard-live.ts
3
+ * @scope apps/studio/artboard-live-gate.tsx (used by canvas-lib.tsx's DCArtboardBody + DesignCanvas)
4
+ * @purpose One `LiveRegistry` + one `WebglBudget` per canvas document, fed by three shared
5
+ * IntersectionObservers (prefetch ring, on screen, keep ring). `ArtboardLiveGate` wraps an
6
+ * artboard's children: it hands them `useArtboardActive()` / `useArtboardSeen()`, pauses the
7
+ * artboard's `<video>`s and CSS animations while it sleeps, and mounts the children only while the
8
+ * registry admits them. `holdAllLive()` is the in-frame export's guarantee: every artboard live
9
+ * for the capture.
10
+ *
11
+ * 2.0.7: in `sleep` too the children mount only while admitted (the mount ring: on screen + a
12
+ * prefetch ring, released when far, within a DOM budget). First mounts go through the registry's
13
+ * queue paced per frame, so it never blocks a pan or a zoom. What stands in is a same-size
14
+ * placeholder in the artboard's own colours (artboard-placeholder.ts) — never the bare frame,
15
+ * which on a dark design system is a black box.
16
+ */
17
+
18
+ import {
19
+ createContext,
20
+ type ReactNode,
21
+ type RefObject,
22
+ useContext,
23
+ useEffect,
24
+ useLayoutEffect,
25
+ useRef,
26
+ useState,
27
+ useSyncExternalStore,
28
+ } from 'react';
29
+ import { ARTBOARD_FREEZE_CSS, ArtboardFreeze } from './artboard-freeze.ts';
30
+ import {
31
+ type ArtboardLiveState,
32
+ KEEP_MARGIN,
33
+ type LiveMode,
34
+ LiveRegistry,
35
+ NEAR_MARGIN,
36
+ resolveLiveMode,
37
+ } from './artboard-live.ts';
38
+ import {
39
+ backgroundOf,
40
+ canvasBackground,
41
+ choosePlaceholder,
42
+ knownBackground,
43
+ rememberBackground,
44
+ rememberPicture,
45
+ subscribeCanvasBackground,
46
+ takePicture,
47
+ } from './artboard-placeholder.ts';
48
+ import {
49
+ ARTBOARD_STILL_CSS,
50
+ inOverviewCut,
51
+ resolveStillMode,
52
+ StillController,
53
+ } from './artboard-still.ts';
54
+ import { rasterTimings, startStill } from './artboard-still-raster.ts';
55
+ import { StillWarmup, WARM_ENABLED } from './artboard-still-warmup.ts';
56
+ import { WebglBudget } from './artboard-webgl.ts';
57
+ import { frameFreezeApi, frameFrozen, frameRaf, onFrameFreeze } from './frame-clock.ts';
58
+
59
+ const ALL_LIVE: ArtboardLiveState = { live: true, seen: true, media: true };
60
+ const LiveContext = createContext<ArtboardLiveState>(ALL_LIVE);
61
+
62
+ /**
63
+ * May this artboard's media load (a Player, a `<video>` with its src)? Follows the mount ring: near or on screen,
64
+ * kept inside the keep ring. A video artboard is mounted wherever it is (its comp registers itself), so a
65
+ * `VideoComp` mounts its Player only while this holds — far away it fetches and decodes nothing (2.0.7). Always
66
+ * `true` outside an artboard, in captures and exports.
67
+ */
68
+ export function useArtboardMedia(): boolean {
69
+ return useContext(LiveContext).media;
70
+ }
71
+
72
+ /**
73
+ * Is this artboard running live? `false` while it is offscreen or the canvas is zoomed out to its overview —
74
+ * pause a render loop, a video, a simulation. Always `true` outside an artboard, in captures and exports.
75
+ */
76
+ export function useArtboardActive(): boolean {
77
+ return useContext(LiveContext).live;
78
+ }
79
+
80
+ /**
81
+ * Are this artboard's children mounted now (it is on screen or near it)? Gate an expensive first mount on it
82
+ * (the design-system board's specimens do). Always `true` in captures and exports.
83
+ */
84
+ export function useArtboardSeen(): boolean {
85
+ return useContext(LiveContext).seen;
86
+ }
87
+
88
+ /**
89
+ * Is the camera moving right now (a pan, a zoom)? While it is, Maude holds the artboards' frame callbacks and
90
+ * pauses their CSS animations and silent videos; a timer (setInterval / setTimeout) is the canvas's own — skip
91
+ * a tick while this is true. Opt-in: only a component that calls it re-renders when a gesture starts and stops.
92
+ * Always `false` outside the canvas frame's shell (tests, captures never move the camera).
93
+ */
94
+ export function useArtboardGesture(): boolean {
95
+ return useSyncExternalStore(onFrameFreeze, frameFrozen, () => false);
96
+ }
97
+
98
+ interface Runtime {
99
+ registry: LiveRegistry;
100
+ budget: WebglBudget | null;
101
+ near: IntersectionObserver | null;
102
+ visible: IntersectionObserver | null;
103
+ keep: IntersectionObserver | null;
104
+ ids: WeakMap<Element, string>;
105
+ /** 2.0.7 — the overview level: artboards under the cut show their still (WebKit). */
106
+ stills: StillController | null;
107
+ /** 2.0.7 — draws the stills of artboards that never mounted, one at a time while nothing moves. */
108
+ warmup: StillWarmup | null;
109
+ /** the article of each observed artboard (the warm-up's distance and cut, the gesture freeze) */
110
+ articles: Map<string, HTMLElement>;
111
+ /** 2.0.7 — pauses the awake artboards' own animations and silent videos while the camera moves. */
112
+ freeze: ArtboardFreeze | null;
113
+ }
114
+
115
+ /**
116
+ * The runtime lives on the canvas DOCUMENT, not in this module. Each canvas module bundles its own copy of
117
+ * canvas-lib (Bun.build inlines `@maude/canvas-lib`), so an edit's soft reload evaluates a fresh copy of this file:
118
+ * a module-level runtime started every artboard of the remounted canvas as a placeholder again, just as the shell
119
+ * reselected after `loaded` — the selected clip was gone (2.0.7 video regression). Bump `RUNTIME_SHAPE` when
120
+ * `Runtime` or `LiveRegistry` changes shape (a canvas-lib change hard-reloads the frame anyway).
121
+ */
122
+ const RUNTIME_SHAPE = 5;
123
+ const RUNTIME_KEY = '__maudeArtboardLive';
124
+ interface RuntimeSlot {
125
+ shape: number;
126
+ search: string;
127
+ runtime: Runtime;
128
+ }
129
+ function runtimeSlot(): RuntimeSlot | null {
130
+ const slot = (window as unknown as Record<string, unknown>)[RUNTIME_KEY] as
131
+ | RuntimeSlot
132
+ | undefined;
133
+ return slot && slot.shape === RUNTIME_SHAPE ? slot : null;
134
+ }
135
+
136
+ function embedded(): boolean {
137
+ try {
138
+ return window.parent !== window;
139
+ } catch {
140
+ return true;
141
+ }
142
+ }
143
+
144
+ /** Test hook: forget the per-document runtime (the URL decides the mode at first use). */
145
+ export function resetArtboardLive(): void {
146
+ if (typeof window === 'undefined') return;
147
+ delete (window as unknown as Record<string, unknown>)[RUNTIME_KEY];
148
+ }
149
+
150
+ /** WebKit / WKWebView — the same test as canvas-lib's `IS_WEBKIT`. */
151
+ function isWebkit(): boolean {
152
+ return (
153
+ typeof navigator !== 'undefined' &&
154
+ (/apple/i.test(navigator.vendor || '') ||
155
+ (typeof window !== 'undefined' && 'GestureEvent' in window))
156
+ );
157
+ }
158
+
159
+ /** Distance (px) of an observed artboard's centre to the viewport centre — the mount queue's order. */
160
+ function centreDistance(en: IntersectionObserverEntry): number {
161
+ const b = en.boundingClientRect;
162
+ if (!b) return Number.POSITIVE_INFINITY;
163
+ const W = typeof innerWidth === 'number' ? innerWidth : 0;
164
+ const H = typeof innerHeight === 'number' ? innerHeight : 0;
165
+ return Math.hypot(b.left + b.width / 2 - W / 2, b.top + b.height / 2 - H / 2);
166
+ }
167
+
168
+ function getRuntime(): Runtime | null {
169
+ if (typeof window === 'undefined') return null;
170
+ const held = runtimeSlot();
171
+ if (held && held.search === window.location.search) return held.runtime;
172
+ const mode: LiveMode = resolveLiveMode({ search: window.location.search, embedded: embedded() });
173
+ const schedule = (fn: () => void) =>
174
+ typeof requestAnimationFrame === 'function' ? frameRaf(fn) : setTimeout(fn, 16);
175
+ const registry = new LiveRegistry(mode, schedule);
176
+ const ids = new WeakMap<Element, string>();
177
+ let near: IntersectionObserver | null = null;
178
+ let visible: IntersectionObserver | null = null;
179
+ let keep: IntersectionObserver | null = null;
180
+ let budget: WebglBudget | null = null;
181
+ if (mode !== 'off' && typeof IntersectionObserver === 'function') {
182
+ near = new IntersectionObserver(
183
+ (entries) => {
184
+ for (const en of entries) {
185
+ const id = ids.get(en.target);
186
+ if (id) registry.setNear(id, en.isIntersecting, centreDistance(en));
187
+ }
188
+ },
189
+ { rootMargin: NEAR_MARGIN }
190
+ );
191
+ keep = new IntersectionObserver(
192
+ (entries) => {
193
+ for (const en of entries) {
194
+ const id = ids.get(en.target);
195
+ if (id) registry.setKeep(id, en.isIntersecting);
196
+ }
197
+ },
198
+ { rootMargin: KEEP_MARGIN }
199
+ );
200
+ visible = new IntersectionObserver((entries) => {
201
+ for (const en of entries) {
202
+ const id = ids.get(en.target);
203
+ if (id) registry.setVisible(id, en.isIntersecting);
204
+ }
205
+ });
206
+ budget = new WebglBudget((id) => (id ? registry.isLive(id) : true));
207
+ budget.install(window as Window & typeof globalThis);
208
+ registry.onChange(() => budget?.update());
209
+ // 2.0.7 — WebKit: with many artboards on screen (`crowded`, LAYER_MAX_VISIBLE) they stop being a compositing
210
+ // layer each. WebKit rasterizes every such layer at full size whatever the world's scale, so 40 artboards on
211
+ // screen at 8 % were 40 full-size rasters per frame (seconds per pan frame on the mascot canvas, ~40 ms
212
+ // without). Switched only outside a gesture, so a pinch never re-rasters mid-flight. Blink keeps its layers.
213
+ if (isWebkit()) {
214
+ const sync = () => {
215
+ if (registry.isInteracting()) return;
216
+ document.documentElement.toggleAttribute('data-dc-crowded', registry.crowded());
217
+ };
218
+ registry.onChange(sync);
219
+ registry.onSettle(sync);
220
+ }
221
+ (window as unknown as { __maudeWebglStats?: () => unknown }).__maudeWebglStats = () => ({
222
+ ...budget?.stats(),
223
+ mode,
224
+ visible: registry.visibleCount(),
225
+ mounted: registry.mountedCount(),
226
+ mountedNodes: Math.round(registry.mountedWeight()),
227
+ // 2.0.7 — a light canvas mounts every artboard (v2-207-light-canvas-mounts-all); -1 = not known yet
228
+ light: registry.isLight(),
229
+ estimatedNodes: Math.round(registry.estimatedWeight()),
230
+ churn: registry.churnStats(),
231
+ });
232
+ }
233
+ const articles = new Map<string, HTMLElement>();
234
+ // 2.0.7 — the gesture freeze: while the camera moves the awake artboards' CSS animations, scripted Web
235
+ // Animations and silent videos pause (artboard-freeze.ts); their frame callbacks wait in the shell's gate.
236
+ let freeze: ArtboardFreeze | null = null;
237
+ if (mode !== 'off') {
238
+ const fz = new ArtboardFreeze();
239
+ onFrameFreeze((on) => (on ? fz.freeze(articles.values()) : fz.thaw()));
240
+ freeze = fz;
241
+ (window as unknown as { __maudeFreezeStats?: () => unknown }).__maudeFreezeStats = () => ({
242
+ ...fz.stats(),
243
+ frame: frameFreezeApi()?.stats() ?? null,
244
+ });
245
+ }
246
+ let stills: StillController | null = null;
247
+ let warmup: StillWarmup | null = null;
248
+ if (
249
+ resolveStillMode({ search: window.location.search, webkit: isWebkit(), liveMode: mode }) ===
250
+ 'on'
251
+ ) {
252
+ const st = new StillController({ job: startStill, info: (id) => registry.slotInfo(id) });
253
+ registry.onSettle(() => st.settle());
254
+ // 2.0.7 — no mid-gesture wait for artboards under the cut (decision v2-207-drop-undercut-midgesture-wait): in Safari
255
+ // the wait alone put the 10 % sweep's tail over base (p99 ~80 -> ~120 ms, worst second 52 -> 31 frames), since the
256
+ // waiting artboards stayed on screen as placeholders through the pan; the ring's mid-gesture hold stays
257
+ stills = st;
258
+ const w = window as unknown as Record<string, unknown>;
259
+ w.__maudeStillStats = () => ({ ...st.stats(), raster: { ...rasterTimings } });
260
+ // the views each artboard went through (the flicker count of the overview level)
261
+ w.__maudeStillHistory = (id?: string) => st.history(id);
262
+ // the last drawings: slices, the longest one, when the walk / the decode / the drawing ended
263
+ w.__maudeStillJobs = () => st.jobs();
264
+ if (mode === 'sleep' && WARM_ENABLED) {
265
+ warmup = startWarmup(registry, st, articles);
266
+ const wu = warmup;
267
+ w.__maudeStillWarm = () => ({ ...wu.stats(), cache: st.cache.stats() });
268
+ }
269
+ }
270
+ const runtime: Runtime = {
271
+ registry,
272
+ budget,
273
+ near,
274
+ visible,
275
+ keep,
276
+ ids,
277
+ stills,
278
+ warmup,
279
+ articles,
280
+ freeze,
281
+ };
282
+ const slot: RuntimeSlot = { shape: RUNTIME_SHAPE, search: window.location.search, runtime };
283
+ (window as unknown as Record<string, unknown>)[RUNTIME_KEY] = slot;
284
+ return runtime;
285
+ }
286
+
287
+ /** The ring's own mounts are done when it mounted nothing for this long (ms) — the warm-up waits for them. */
288
+ const WARM_RING_QUIET_MS = 300;
289
+
290
+ /** The stills' warm-up (artboard-still-warmup.ts) on this document's registry and still controller. */
291
+ function startWarmup(
292
+ registry: LiveRegistry,
293
+ st: StillController,
294
+ articles: Map<string, HTMLElement>
295
+ ): StillWarmup {
296
+ const now = () => performance.now();
297
+ const W = () => (typeof innerWidth === 'number' ? innerWidth : 0);
298
+ const H = () => (typeof innerHeight === 'number' ? innerHeight : 0);
299
+ const wu = new StillWarmup({
300
+ now,
301
+ later: (fn, ms) => setTimeout(fn, ms),
302
+ cancel: (h) => clearTimeout(h as ReturnType<typeof setTimeout>),
303
+ candidates: () =>
304
+ registry.warmCandidates().map((k) => {
305
+ const a = articles.get(k.id);
306
+ if (!a) return k;
307
+ const r = a.getBoundingClientRect();
308
+ return {
309
+ ...k,
310
+ dist: Math.hypot(r.left + r.width / 2 - W() / 2, r.top + r.height / 2 - H() / 2),
311
+ };
312
+ }),
313
+ wanted: (id) => {
314
+ const a = articles.get(id);
315
+ return !!a && inOverviewCut(a.offsetWidth, st.zoomNow());
316
+ },
317
+ hasStill: (id) => st.hasStill(id),
318
+ mount: (id) => registry.setWarm(id, true),
319
+ release: (id) => registry.setWarm(id, false),
320
+ mounted: (id) => registry.isMounted(id),
321
+ quiet: () =>
322
+ st.quiet(true) &&
323
+ !registry.isInteracting() &&
324
+ now() - registry.lastMountAt() >= WARM_RING_QUIET_MS,
325
+ lastActivity: () => st.lastActivity(),
326
+ cacheRoom: () => {
327
+ const c = st.cache.stats();
328
+ const each = c.n ? c.bytes / c.n : 0;
329
+ return c.bytes + 2 * each <= st.cache.max;
330
+ },
331
+ });
332
+ st.onStill((id, ok) => wu.stillDone(id, ok));
333
+ registry.onSettle(() => wu.wake());
334
+ // any input pauses it at once (capture: before the canvas's own handlers; passive: never delays them)
335
+ const onInput = () => wu.input();
336
+ for (const type of ['pointerdown', 'pointermove', 'wheel', 'keydown', 'touchstart'])
337
+ window.addEventListener(type, onInput, { capture: true, passive: true });
338
+ wu.kick();
339
+ return wu;
340
+ }
341
+
342
+ /** The mode this canvas document runs in. */
343
+ export function artboardLiveMode(): LiveMode {
344
+ return getRuntime()?.registry.mode ?? 'off';
345
+ }
346
+
347
+ /**
348
+ * Every artboard live for a capture, at once. Resolves after two frames (restored WebGL contexts and woken
349
+ * players draw again); call the returned release when the capture is done.
350
+ */
351
+ export async function holdAllLive(): Promise<() => void> {
352
+ const rt = getRuntime();
353
+ if (!rt || rt.registry.mode === 'off') return () => {};
354
+ const release = rt.registry.holdAllLive();
355
+ rt.budget?.apply();
356
+ if (typeof requestAnimationFrame === 'function')
357
+ await new Promise<void>((r) => frameRaf(() => frameRaf(() => r())));
358
+ return release;
359
+ }
360
+
361
+ /**
362
+ * The viewport wrote this zoom (canvas-lib's applyViewport, every frame of a gesture): small artboards swap to
363
+ * their stills on the first scale step of a gesture. Cheap — a comparison per registered artboard.
364
+ */
365
+ export function noteGestureZoom(zoom: number): void {
366
+ getRuntime()?.stills?.noteZoom(zoom);
367
+ }
368
+
369
+ /** Feeds the published (settle-cadence) zoom and the gesture flag. Renders nothing. */
370
+ export function ArtboardLiveFeed({ zoom, interacting }: { zoom: number; interacting: boolean }) {
371
+ useEffect(() => {
372
+ const rt = getRuntime();
373
+ if (!rt || rt.registry.mode === 'off') return;
374
+ rt.registry.setZoom(zoom);
375
+ rt.stills?.setZoom(zoom);
376
+ rt.warmup?.wake();
377
+ }, [zoom]);
378
+ useEffect(() => {
379
+ const rt = getRuntime();
380
+ if (!rt || rt.registry.mode === 'off') return;
381
+ rt.registry.setInteracting(interacting);
382
+ // A settle can change which contexts are nearest the centre.
383
+ if (!interacting) rt.budget?.update();
384
+ }, [interacting]);
385
+ return null;
386
+ }
387
+
388
+ /** Pause what plays inside a sleeping artboard; resume what WE paused when it wakes. */
389
+ function useMediaSleep(articleRef: RefObject<HTMLElement | null>, live: boolean, on: boolean) {
390
+ const paused = useRef(new Set<HTMLMediaElement>());
391
+ useEffect(() => {
392
+ const el = articleRef.current;
393
+ if (!on || !el) return;
394
+ el.toggleAttribute('data-dc-asleep', !live);
395
+ // VideoComp drives its own Player (useArtboardActive); its <video>s are the Player's to sync.
396
+ const own = (m: Element) => !m.closest('.dc-video-comp');
397
+ if (!live) {
398
+ for (const m of el.querySelectorAll<HTMLMediaElement>('video')) {
399
+ if (!own(m) || m.paused) continue;
400
+ m.pause();
401
+ paused.current.add(m);
402
+ }
403
+ // An autoplay that starts later (data arrives after we slept) is paused too.
404
+ const onPlay = (ev: Event) => {
405
+ const m = ev.target as HTMLMediaElement;
406
+ if (m instanceof HTMLVideoElement && own(m)) {
407
+ m.pause();
408
+ paused.current.add(m);
409
+ }
410
+ };
411
+ el.addEventListener('play', onPlay, true);
412
+ return () => el.removeEventListener('play', onPlay, true);
413
+ }
414
+ for (const m of paused.current) if (m.isConnected) void m.play?.()?.catch?.(() => {});
415
+ paused.current.clear();
416
+ return undefined;
417
+ }, [articleRef, live, on]);
418
+ }
419
+
420
+ /** How long after a first mount the placeholder's picture is taken (images and fonts have come in). */
421
+ const PICTURE_DELAY_MS = 900;
422
+
423
+ export function ArtboardLiveGate({
424
+ id,
425
+ articleRef,
426
+ bodyRef,
427
+ heightFloor,
428
+ background,
429
+ pinned = false,
430
+ eager = false,
431
+ children,
432
+ }: {
433
+ id: string;
434
+ articleRef: RefObject<HTMLElement | null>;
435
+ bodyRef: RefObject<HTMLElement | null>;
436
+ heightFloor: number;
437
+ /** the artboard's own `background` prop — the colour a never-rendered placeholder takes */
438
+ background?: string;
439
+ /** the active artboard, or the one holding the selection: never released (the shell works in its DOM) */
440
+ pinned?: boolean;
441
+ /** a video artboard: always mounted (its comp registers itself only while mounted) */
442
+ eager?: boolean;
443
+ children: ReactNode;
444
+ }) {
445
+ const rt = getRuntime();
446
+ const on = !!rt && rt.registry.mode !== 'off';
447
+ const [state, setState] = useState<ArtboardLiveState>(() =>
448
+ on && rt ? rt.registry.get(id) : ALL_LIVE
449
+ );
450
+ // Subscribe before the observers report (layout effects run before effects). Every change applies at once:
451
+ // a first mount as a React transition was measured and dropped — the canvas's own sync updates kept
452
+ // restarting it, so an on-screen artboard waited for the transition lane's ~5 s expiry (first paint 1.3 s →
453
+ // 15 s on math-learning-spaces). The queue's pacing (one per frame, one per GESTURE_MOUNT_GAP_MS mid-gesture)
454
+ // is what keeps a mount from blocking a pan.
455
+ useLayoutEffect(() => {
456
+ if (!on || !rt) return;
457
+ const off = rt.registry.subscribe(id, setState);
458
+ setState(rt.registry.get(id));
459
+ return off;
460
+ }, [on, rt, id]);
461
+ const { live, seen } = state;
462
+ // A skeleton drawn before any artboard of the canvas rendered took the mid tone: it repaints once the canvas
463
+ // colour is known (only while it is a placeholder — a mounted artboard never re-renders for it).
464
+ useSyncExternalStore(
465
+ subscribeCanvasBackground,
466
+ () => (on && !seen ? canvasBackground() : ''),
467
+ () => ''
468
+ );
469
+
470
+ useEffect(() => {
471
+ if (on && rt) rt.registry.setPinned(id, pinned);
472
+ }, [on, rt, id, pinned]);
473
+ useEffect(() => {
474
+ if (on && rt) rt.registry.setEager(id, eager);
475
+ }, [on, rt, id, eager]);
476
+
477
+ // Observe the artboard (the article — its size is stable whether its children are mounted or not).
478
+ useEffect(() => {
479
+ const el = articleRef.current;
480
+ if (!on || !rt || !el) return;
481
+ if (!rt.near || !rt.visible) {
482
+ // No IntersectionObserver: fail open, everything near and on screen.
483
+ rt.registry.setNear(id, true);
484
+ rt.registry.setVisible(id, true);
485
+ return;
486
+ }
487
+ rt.ids.set(el, id);
488
+ rt.articles.set(id, el);
489
+ rt.near.observe(el);
490
+ rt.visible.observe(el);
491
+ rt.keep?.observe(el);
492
+ return () => {
493
+ rt.near?.unobserve(el);
494
+ rt.visible?.unobserve(el);
495
+ rt.keep?.unobserve(el);
496
+ rt.ids.delete(el);
497
+ if (rt.articles.get(id) === el) rt.articles.delete(id);
498
+ // an edit's remount: the new gate already holds the id and its observers report on its own article —
499
+ // clearing near/visible here would put the artboard to sleep (and pause its video) for a frame
500
+ rt.registry.unobserve(id);
501
+ };
502
+ }, [articleRef, id, on, rt]);
503
+
504
+ useMediaSleep(articleRef, live, on);
505
+
506
+ // 2.0.7 — the overview level (artboard-still.ts): registered while the children are mounted; under the cut the
507
+ // artboard shows its still. The selected / active artboard and a video one never do (`pinned`, `eager`).
508
+ const stills = on && rt ? rt.stills : null;
509
+ const flags = useRef({ pinned, eager, bg: background });
510
+ flags.current = { pinned, eager, bg: background };
511
+ // A layout effect: an artboard mounting under the cut is hidden behind its still (or cover) before it paints.
512
+ useLayoutEffect(() => {
513
+ const article = articleRef.current;
514
+ const body = bodyRef.current;
515
+ if (!stills || !seen || !article || !body) return;
516
+ const f = flags.current;
517
+ return stills.register(id, { article, body, bg: knownBackground(id, f.bg) }, f);
518
+ }, [stills, seen, id, articleRef, bodyRef]);
519
+ useEffect(() => {
520
+ stills?.update(id, { pinned, eager });
521
+ }, [stills, id, pinned, eager]);
522
+ // a wake or a sleep changes what is painted (paused animations, a WebGL picture): draw it again
523
+ useEffect(() => {
524
+ stills?.markDirty(id, live ? 'woke' : 'slept');
525
+ }, [stills, id, live]);
526
+
527
+ // Remember the height the children had, so the placeholder holds it.
528
+ const lastHeight = useRef(0);
529
+ useLayoutEffect(() => {
530
+ if (!seen) return;
531
+ const b = bodyRef.current;
532
+ return () => {
533
+ if (b) lastHeight.current = b.offsetHeight;
534
+ };
535
+ }, [seen, bodyRef]);
536
+
537
+ // Mounted: weigh it (the DOM budget's unit) and, once it settled, take its picture for the placeholder.
538
+ useEffect(() => {
539
+ if (!on || !rt || !seen) return;
540
+ const b = bodyRef.current;
541
+ if (!b) return;
542
+ rt.registry.setWeight(id, b.getElementsByTagName('*').length);
543
+ // its colour at once (four elements at most): the next placeholders of this canvas take it
544
+ rememberBackground(id, backgroundOf(b));
545
+ const own = knownBackground(id, background);
546
+ if (own) {
547
+ articleRef.current?.style.setProperty('--dc-own-bg', own);
548
+ stills?.update(id, { bg: own });
549
+ }
550
+ let timer: ReturnType<typeof setTimeout> | undefined;
551
+ const shoot = () => {
552
+ if (!b.isConnected) return;
553
+ if (rt.registry.isInteracting()) {
554
+ timer = setTimeout(shoot, PICTURE_DELAY_MS);
555
+ return;
556
+ }
557
+ rt.registry.setWeight(id, b.getElementsByTagName('*').length);
558
+ const pic = takePicture(b);
559
+ if (pic) rememberPicture(id, pic);
560
+ };
561
+ timer = setTimeout(shoot, PICTURE_DELAY_MS);
562
+ return () => {
563
+ if (timer) clearTimeout(timer);
564
+ };
565
+ }, [on, rt, id, seen, bodyRef, articleRef, background, stills]);
566
+
567
+ // Not mounted: the frame takes the colour known so far (an unpainted body is never var(--bg-0)).
568
+ const ownBg = on && !seen ? knownBackground(id, background) : '';
569
+ useLayoutEffect(() => {
570
+ if (ownBg) articleRef.current?.style.setProperty('--dc-own-bg', ownBg);
571
+ }, [ownBg, articleRef]);
572
+
573
+ const value = on ? state : ALL_LIVE;
574
+ if (!on || seen) return <LiveContext.Provider value={value}>{children}</LiveContext.Provider>;
575
+ const ph = choosePlaceholder(id, background);
576
+ const kept = stills?.cache.peek(id);
577
+ // a kept still stands in for a released artboard (the same picture it shows when mounted under the cut)
578
+ const pic = kept ? undefined : ph.picture;
579
+ return (
580
+ <LiveContext.Provider value={value}>
581
+ <div
582
+ className="dc-artboard-sleeping"
583
+ data-dc-placeholder={ph.kind}
584
+ aria-hidden="true"
585
+ style={{
586
+ minHeight: Math.max(lastHeight.current, pic?.h ?? 0, heightFloor),
587
+ backgroundColor: ph.bg || undefined,
588
+ }}
589
+ >
590
+ {kept ? <StillCopy still={kept.el} /> : null}
591
+ {pic?.blocks.map((b, i) => (
592
+ <i
593
+ // biome-ignore lint/suspicious/noArrayIndexKey: a still picture; its blocks never reorder
594
+ key={i}
595
+ data-media={b.c ? undefined : ''}
596
+ style={{
597
+ left: `${b.x * 100}%`,
598
+ top: `${b.y * 100}%`,
599
+ width: `${b.w * 100}%`,
600
+ height: `${b.h * 100}%`,
601
+ background: b.c || undefined,
602
+ }}
603
+ />
604
+ ))}
605
+ </div>
606
+ </LiveContext.Provider>
607
+ );
608
+ }
609
+
610
+ /** A copy of a kept still (the cache's own canvas stays the cache's): drawn once, on mount. */
611
+ function StillCopy({ still }: { still: HTMLElement }) {
612
+ return (
613
+ <canvas
614
+ className="dc-artboard-still-copy"
615
+ ref={(c) => {
616
+ const src = still as HTMLCanvasElement;
617
+ if (!c || !src.width || c.width === src.width) return;
618
+ c.width = src.width;
619
+ c.height = src.height;
620
+ c.getContext('2d')?.drawImage(src, 0, 0);
621
+ }}
622
+ />
623
+ );
624
+ }
625
+
626
+ /** Paused CSS animations while asleep, the placeholder and the still. (A released WebGL canvas's picture is artboard-webgl.ts's.) */
627
+ export const ARTBOARD_LIVE_CSS = `${ARTBOARD_STILL_CSS}${ARTBOARD_FREEZE_CSS}
628
+ .dc-artboard[data-dc-asleep] .dc-artboard-body *,
629
+ .dc-artboard[data-dc-asleep] .dc-artboard-body *::before,
630
+ .dc-artboard[data-dc-asleep] .dc-artboard-body *::after { animation-play-state: paused !important; }
631
+ html[data-dc-crowded] .dc-canvas .dc-artboard { will-change: auto; }
632
+ .dc-artboard-sleeping { width: 100%; position: relative; overflow: hidden; }
633
+ .dc-artboard-sleeping > i { position: absolute; display: block; opacity: 0.45; border-radius: 2px; }
634
+ .dc-artboard-sleeping > i[data-media] { background: color-mix(in srgb, currentColor 16%, transparent); }
635
+ .dc-artboard-sleeping > .dc-artboard-still-copy { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
636
+ `;