@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
@@ -81,25 +81,26 @@ export function registerCanvasThemeSystem(ds: { name: string; themeDefault: stri
81
81
  /** The registered design system's name, or null on a canvas with none. */
82
82
  export const getCanvasThemeSystemName = (): string | null => store().dsName;
83
83
 
84
- /** Remember the pick for this canvas on this Mac (best-effort, fire-and-forget like the camera). */
84
+ /**
85
+ * Remember the pick for this canvas on this Mac. The canvas writes nothing itself: its origin may PATCH only `layout`
86
+ * and `viewport` (routes/canvas-origin.ts), so its own `canvasTheme` PATCH was refused. It tells the studio
87
+ * `theme-pick`, and the shell writes `canvasTheme` into the view file for the canvas it has open, on the main origin
88
+ * (client/v2/shell/pages-pick.js) — the Canvas | Pages path. Outside the studio window nothing is remembered.
89
+ */
85
90
  function persist(mode: CanvasTheme): void {
86
- if (typeof window === 'undefined' || typeof fetch === 'undefined') return;
91
+ if (typeof window === 'undefined' || window.parent === window) return;
87
92
  // an embed, a Present follower and a past version are not the designer's own view (read-only-mode.ts)
88
93
  if (!persistsCanvasMeta()) return;
89
94
  const w = window as unknown as MetaWindow;
90
- const file = typeof w.__canvas_meta_file__ === 'string' ? w.__canvas_meta_file__ : null;
91
- if (!file) return;
92
95
  // keep the page-load snapshot current, so a soft remount reads the pick back (DDR-138)
93
96
  if (w.__canvas_meta__ && typeof w.__canvas_meta__ === 'object')
94
97
  w.__canvas_meta__.canvasTheme = mode;
95
98
  w.__maude_last_meta_self_write_at = Date.now();
96
- fetch('/_api/canvas-meta', {
97
- method: 'PATCH',
98
- headers: { 'content-type': 'application/json' },
99
- body: JSON.stringify({ file, patch: { canvasTheme: mode } }),
100
- }).catch((err) => {
101
- console.warn('[canvas-theme] persist failed:', err);
102
- });
99
+ try {
100
+ window.parent.postMessage({ dgn: 'theme-pick', v: 1, theme: mode }, '*');
101
+ } catch {
102
+ /* detached */
103
+ }
103
104
  }
104
105
 
105
106
  /** Show `mode` on every artboard. `persist: false` is a preview — nothing is remembered. */
@@ -237,6 +237,7 @@ import { cutCopyPaste, createMenuHandlers, menuRunner } from './v2/shell/menu-ru
237
237
  import DiagnosticsHost from './v2/diagnostics/diagnostics-host.jsx';
238
238
  import { useDiagnosticsMenu } from './v2/diagnostics/use-diagnostics-menu.js';
239
239
  import { menuCtx, moveDestinations } from './v2/shell/project-menu-model.js';
240
+ import { usePagesView } from './v2/shell/use-canvas-mode-lane.js';
240
241
  import { useProjectSwitcher } from './panels/RepoBranchSwitcher.jsx';
241
242
  import { ProjectPill } from './v2/shell/project-pill.jsx';
242
243
  import { AskSelectionHost } from './v2/ai/AskSelectionHost.jsx';
@@ -1895,6 +1896,7 @@ function ShellProjectPill() {
1895
1896
  const activeRel = activePath ? normalizeOpenPath(activePath, cfg?.designRel) : null;
1896
1897
  const activeRole = sessionRole(cfg, activeRel);
1897
1898
  const activeObserver = observerOn(cfg, activeRel);
1899
+ const pagesOn = usePagesView();
1898
1900
  const ctx = useMemo(
1899
1901
  () =>
1900
1902
  menuCtx({
@@ -1907,6 +1909,8 @@ function ShellProjectPill() {
1907
1909
  // S3.8 — Copy presentation link reads both: a cloud-linked desktop, and the network up.
1908
1910
  linkedHub: !!cloudLinkedHub?.url,
1909
1911
  online,
1912
+ // 2.0.7 B2 — the active canvas shows Pages (Preview / Present greyed, paging on)
1913
+ pagesView: pagesOn,
1910
1914
  }),
1911
1915
  [
1912
1916
  native,
@@ -1917,6 +1921,7 @@ function ShellProjectPill() {
1917
1921
  presentMode,
1918
1922
  cloudLinkedHub?.url,
1919
1923
  online,
1924
+ pagesOn,
1920
1925
  ]
1921
1926
  );
1922
1927
  // V2-4.8a: the megaphone's unseen dot, as a word on the Help row; and no "Back to Home" in a hub that
@@ -1960,6 +1965,7 @@ function ShellProjectPill() {
1960
1965
  'view.exports': exportCenter.panelOpen,
1961
1966
  'history.open': changesOpen,
1962
1967
  'present.canvas': presentMode,
1968
+ 'view.pages': pagesOn,
1963
1969
  },
1964
1970
  }),
1965
1971
  [
@@ -1984,6 +1990,7 @@ function ShellProjectPill() {
1984
1990
  exportCenter.panelOpen,
1985
1991
  changesOpen,
1986
1992
  presentMode,
1993
+ pagesOn,
1987
1994
  ]
1988
1995
  );
1989
1996
  const previewing = usePreviewMode();
@@ -255,6 +255,26 @@ export function canvasImportsOf(cfg, p) {
255
255
  return Array.isArray(list) ? list.filter((x) => typeof x === 'string' && x) : null;
256
256
  }
257
257
 
258
+ /**
259
+ * 2.0.5 (#205) — the design-root files `p`'s BUILT module was refused for (it inlined a file another canvas
260
+ * owns), from the index's `canvasRefusedInputs`, or `null` when none is on record.
261
+ */
262
+ export function canvasRefusedOf(cfg, p) {
263
+ const list = cfg?.canvasRefusedInputs?.[p];
264
+ const names = Array.isArray(list) ? list.filter((x) => typeof x === 'string' && x) : [];
265
+ return names.length ? names : null;
266
+ }
267
+
268
+ /**
269
+ * 2.0.7 — the imports of `p` that resolve to no file in the project (its frame is refused before it builds),
270
+ * from the index's `canvasMissingImports`, or `null` when none is on record.
271
+ */
272
+ export function canvasMissingOf(cfg, p) {
273
+ const list = cfg?.canvasMissingImports?.[p];
274
+ const names = Array.isArray(list) ? list.filter((x) => typeof x === 'string' && x) : [];
275
+ return names.length ? names : null;
276
+ }
277
+
258
278
  export function canvasUrl(p, cfg, opts) {
259
279
  if (!p.endsWith('.tsx')) return urlOf(p);
260
280
  const designRel = (cfg?.designRel || '.design').replace(/^\/+|\/+$/g, '');
@@ -286,6 +306,9 @@ export function canvasUrl(p, cfg, opts) {
286
306
  // Phase 27 (E2) — DiffView renders a CLEAN canvas (no editor chrome: toolbar,
287
307
  // world minimap, devtools) so the before/after is just the design.
288
308
  if (opts?.hideChrome) params.set('hide-chrome', '1');
309
+ // 2.0.5 — the too-heavy card's "Show visible artboards only": the canvas mounts only the artboards near the
310
+ // viewport (artboard-live.ts `light`). A capture (`hide-chrome`) ignores it and renders everything.
311
+ if (opts?.light) params.set('artboard-live', 'light');
289
312
  // Cloud Phase 25 C2 — the linked hub vouched a viewer role at sign-in
290
313
  // (`/_config.readOnly`), so the canvas boots read-only: edit tools and
291
314
  // mutating interactions are ABSENT from the iframe chrome (read-only-mode.ts
@@ -358,7 +381,19 @@ export function canvasUrl(p, cfg, opts) {
358
381
  // against. Unknown DS (single-DS / legacy / default-DS canvas) → `ds0`, which
359
382
  // keeps the historical behavior byte-for-byte. DDR-093.
360
383
  const uiDsName = !specMatch ? (opts?.ds ?? cfg?.canvasDesignSystems?.[p]) : null;
361
- const uiDsEntry = uiDsName ? cfg?.designSystems?.find((d) => d.name === uiDsName) : null;
384
+ // 2.0.7 — a system the config does not list (a cell's config.json never syncs) still owns the
385
+ // canvases in its own folder: the server names it (`ds-resolver` `folderSystemOf`), and only a
386
+ // canvas inside `system/<that name>/` gets that folder's files — a name never invents a path.
387
+ const uiDsEntry = uiDsName
388
+ ? (cfg?.designSystems?.find((d) => d.name === uiDsName) ??
389
+ (rel.startsWith(`system/${uiDsName}/`) && !/^[._]/.test(uiDsName)
390
+ ? {
391
+ name: uiDsName,
392
+ path: `system/${uiDsName}`,
393
+ tokensCssRel: `system/${uiDsName}/colors_and_type.css`,
394
+ }
395
+ : null))
396
+ : null;
362
397
  const uiDs = uiDsEntry || ds0;
363
398
  // Resolve tokens path. For a specimen, prefer the matching DS's tokensCssRel
364
399
  // (fall back to the `system/<ds>/colors_and_type.css` convention). Otherwise
@@ -0,0 +1,262 @@
1
+ // client/home/HomeAccounts.jsx — 2.0.5 W4b: Home's avatar and the card it opens.
2
+ //
3
+ // Every profile on this Mac by its label, with the accounts it is signed in with (Maude Cloud,
4
+ // team servers, GitHub): Sign out per account where Home has a path (asks first), Sign in with
5
+ // GitHub for a profile without it, and add / switch at the foot. What each row means and why a
6
+ // row has no button: home-accounts-model.js. The card fetches the team-server sign-ins when it
7
+ // opens (`GET /_home/accounts`) and after every sign-out.
8
+
9
+ import { useCallback, useEffect, useRef, useState } from 'react';
10
+
11
+ import { cloudSignOut, getAccounts, hubSignOut, shellInvoke, shellListen } from './home-api.js';
12
+ import { homeAccounts } from './home-accounts-model.js';
13
+ import { githubSignIn } from '../v2/onboarding/github-home.js';
14
+
15
+ const KIND_TITLE = { cloud: 'Maude Cloud', team: 'Team server', github: 'GitHub' };
16
+
17
+ /** The team-server sign-ins of `ids`, re-read when `open` turns on or `gen` moves. */
18
+ function useHubProfiles(ids, open, gen) {
19
+ const [hubProfiles, setHubProfiles] = useState([]);
20
+ const key = ids.join(',');
21
+ // biome-ignore lint/correctness/useExhaustiveDependencies: `key` stands for `ids`; `gen` re-reads
22
+ useEffect(() => {
23
+ if (!open || !key) return undefined;
24
+ let live = true;
25
+ getAccounts(key.split(',')).then((r) => {
26
+ if (live && r.ok && Array.isArray(r.json?.profiles)) setHubProfiles(r.json.profiles);
27
+ });
28
+ return () => {
29
+ live = false;
30
+ };
31
+ }, [open, key, gen]);
32
+ return hubProfiles;
33
+ }
34
+
35
+ /**
36
+ * @param shell / clouds / native — Home's data
37
+ * @param onAddCloud () => void Home's Maude Cloud sign-in (a fresh profile when one is signed in)
38
+ * @param onAddTeam () => void the Advanced › team server sheet
39
+ * @param onChanged () => Promise reload Home's data after a sign-out / sign-in
40
+ */
41
+ export function HomeAccounts({ shell, clouds, native, onAddCloud, onAddTeam, onChanged }) {
42
+ const [open, setOpen] = useState(false);
43
+ const [gen, setGen] = useState(0);
44
+ const [asking, setAsking] = useState(null);
45
+ const [busy, setBusy] = useState(false);
46
+ const [error, setError] = useState(null);
47
+ const [ghCode, setGhCode] = useState(null);
48
+ const wrap = useRef(null);
49
+ const ids = (shell?.profiles ?? []).map((p) => p?.id).filter((id) => typeof id === 'string');
50
+ const hubProfiles = useHubProfiles(ids, open, gen);
51
+ const model = homeAccounts({ native, shell, clouds, hubProfiles });
52
+
53
+ const close = useCallback(() => {
54
+ setOpen(false);
55
+ setAsking(null);
56
+ setError(null);
57
+ }, []);
58
+ useEffect(() => {
59
+ if (!open) return undefined;
60
+ const onKey = (e) => e.key === 'Escape' && close();
61
+ const onDown = (e) => wrap.current && !wrap.current.contains(e.target) && close();
62
+ window.addEventListener('keydown', onKey);
63
+ window.addEventListener('pointerdown', onDown);
64
+ return () => {
65
+ window.removeEventListener('keydown', onKey);
66
+ window.removeEventListener('pointerdown', onDown);
67
+ };
68
+ }, [open, close]);
69
+ // the GitHub device code arrives as a shell message while a sign-in from this card runs
70
+ useEffect(() => {
71
+ if (!open || !native) return undefined;
72
+ let off = () => {};
73
+ shellListen('github://device-code', (p) => setGhCode(p?.user_code ?? null)).then((u) => {
74
+ off = u;
75
+ });
76
+ return () => off();
77
+ }, [open, native]);
78
+
79
+ if (!model.face) return null;
80
+
81
+ const signOut = async () => {
82
+ const spec = asking;
83
+ setBusy(true);
84
+ setError(null);
85
+ const r =
86
+ spec.path === 'cloud-signout'
87
+ ? await cloudSignOut(spec.profile)
88
+ : await hubSignOut(spec.profile, spec.url);
89
+ setBusy(false);
90
+ setAsking(null);
91
+ if (!r.ok || !r.json?.ok) {
92
+ setError(r.json?.error || 'Couldn’t sign out. Nothing changed — try again.');
93
+ return;
94
+ }
95
+ setGen((g) => g + 1);
96
+ await onChanged?.();
97
+ };
98
+ const ghSignIn = async (profile) => {
99
+ setError(null);
100
+ setBusy(true);
101
+ try {
102
+ await githubSignIn(profile, shellInvoke);
103
+ await onChanged?.();
104
+ } catch (e) {
105
+ setError(typeof e === 'string' ? e : 'GitHub sign-in didn’t finish. Try again.');
106
+ } finally {
107
+ setGhCode(null);
108
+ setBusy(false);
109
+ }
110
+ };
111
+
112
+ return (
113
+ <span className="home-top-acct" ref={wrap}>
114
+ <button
115
+ type="button"
116
+ className="home-top-acct-btn"
117
+ data-testid="home-top-face"
118
+ aria-label={model.face.title}
119
+ title={model.face.title}
120
+ aria-haspopup="dialog"
121
+ aria-expanded={open}
122
+ onClick={() => (open ? close() : setOpen(true))}
123
+ >
124
+ <span
125
+ className={`home-face home-face--md home-face--${model.face.tone}`}
126
+ aria-hidden="true"
127
+ >
128
+ {model.face.initial}
129
+ </span>
130
+ </button>
131
+ {open ? (
132
+ <div
133
+ className="home-accts"
134
+ role="dialog"
135
+ aria-label="Accounts on this Mac"
136
+ data-testid="home-accounts"
137
+ >
138
+ <p className="home-accts-h">Accounts on this Mac</p>
139
+ {model.profiles.map((p) => (
140
+ <section
141
+ key={p.id}
142
+ className="home-accts-p"
143
+ data-testid={`home-accounts-profile-${p.id}`}
144
+ >
145
+ <h3 className="home-accts-ph">
146
+ <span className={`home-acctf home-acctf--${p.face.tone}`} aria-hidden="true">
147
+ {p.face.initial}
148
+ </span>
149
+ {p.label}
150
+ </h3>
151
+ {p.accounts.length ? (
152
+ <ul className="home-accts-list">
153
+ {p.accounts.map((a) => (
154
+ <li
155
+ key={a.key}
156
+ className="home-accts-row"
157
+ data-testid={`home-account-${p.id}-${a.kind}`}
158
+ >
159
+ <span className="home-accts-t">
160
+ <strong>
161
+ {a.kind === 'team'
162
+ ? `${KIND_TITLE.team} · ${a.host}`
163
+ : KIND_TITLE[a.kind]}
164
+ </strong>
165
+ {a.who ? <span>{a.who}</span> : null}
166
+ </span>
167
+ {a.signOut ? (
168
+ <button
169
+ type="button"
170
+ className="btn btn--ghost btn--sm"
171
+ data-testid={`home-account-signout-${p.id}-${a.kind}`}
172
+ onClick={() => setAsking(a.signOut)}
173
+ disabled={busy}
174
+ >
175
+ Sign out…
176
+ </button>
177
+ ) : null}
178
+ </li>
179
+ ))}
180
+ </ul>
181
+ ) : (
182
+ <p className="home-accts-none">Not signed in to anything yet.</p>
183
+ )}
184
+ {p.githubSignIn ? (
185
+ <button
186
+ type="button"
187
+ className="home-accts-act"
188
+ data-testid={`home-account-github-signin-${p.id}`}
189
+ onClick={() => ghSignIn(p.id)}
190
+ disabled={busy}
191
+ >
192
+ Sign in with GitHub…
193
+ </button>
194
+ ) : null}
195
+ </section>
196
+ ))}
197
+ {ghCode ? (
198
+ <p className="home-accts-note" data-testid="home-accounts-github-code">
199
+ Enter <strong>{ghCode}</strong> on the GitHub page that opened.
200
+ </p>
201
+ ) : null}
202
+ {error ? (
203
+ <p className="home-accts-note" role="alert" data-testid="home-accounts-error">
204
+ {error}
205
+ </p>
206
+ ) : null}
207
+ {asking ? (
208
+ <div className="home-accts-ask" role="alertdialog" data-testid="home-accounts-confirm">
209
+ <strong>{asking.confirm.title}</strong>
210
+ <span>{asking.confirm.body}</span>
211
+ <span className="home-accts-btns">
212
+ <button
213
+ type="button"
214
+ className="btn btn--sm"
215
+ data-testid="home-accounts-signout-cancel"
216
+ onClick={() => setAsking(null)}
217
+ >
218
+ {asking.confirm.cancel}
219
+ </button>
220
+ <button
221
+ type="button"
222
+ className="btn btn--sm btn--danger"
223
+ data-testid="home-accounts-signout-confirm"
224
+ disabled={busy}
225
+ onClick={signOut}
226
+ >
227
+ {asking.confirm.primary}
228
+ </button>
229
+ </span>
230
+ </div>
231
+ ) : null}
232
+ {model.add ? (
233
+ <div className="home-accts-foot">
234
+ <button
235
+ type="button"
236
+ className="home-accts-act"
237
+ data-testid="home-accounts-add-cloud"
238
+ onClick={() => {
239
+ close();
240
+ onAddCloud?.();
241
+ }}
242
+ >
243
+ {model.add.cloud}
244
+ </button>
245
+ <button
246
+ type="button"
247
+ className="home-accts-act"
248
+ data-testid="home-accounts-add-team"
249
+ onClick={() => {
250
+ close();
251
+ onAddTeam?.();
252
+ }}
253
+ >
254
+ {model.add.team}
255
+ </button>
256
+ </div>
257
+ ) : null}
258
+ </div>
259
+ ) : null}
260
+ </span>
261
+ );
262
+ }
@@ -10,7 +10,8 @@ import { accountFace, rowSlug, sharedAside } from './home-model.js';
10
10
  import { HIcon, ProjectSquare } from './home-icons.jsx';
11
11
  import { reasonProps } from '../v2/access/disabled-reason.js';
12
12
 
13
- /** Three ghost cards: the shelf's shape before there is anything on it. */
13
+ /** Three ghost cards: the shelf's shape before there is anything on it. Flat and dashed on purpose —
14
+ * they must never read as thumbnails that failed to load (no tilt, no fill). */
14
15
  export function GhostCards({ n = 3 }) {
15
16
  return (
16
17
  <span className="home-ghosts" aria-hidden="true">
@@ -202,10 +203,10 @@ export function SharedWithYou({
202
203
  ))}
203
204
  </div>
204
205
  ) : (
205
- <div className="home-shelf-row" data-testid="home-shared-empty">
206
- <GhostCards n={3} />
206
+ <div className="home-shelf-row home-shelf-row--lone" data-testid="home-shared-empty">
207
207
  <Empty
208
208
  align="left"
209
+ glyph="people"
209
210
  copyId="es-home-shared.shared-none"
210
211
  next="When someone shares a project with you, it shows up here."
211
212
  />
@@ -0,0 +1,121 @@
1
+ // client/home/home-accounts-model.js — 2.0.5 W4b: what Home's avatar lists. PURE.
2
+ //
3
+ // Every profile on this Mac by its label (`shell_state.profiles`), each with the accounts it is
4
+ // signed in with:
5
+ // cloud the profile's Maude Cloud listing says signed in → its e-mail; Sign out =
6
+ // POST /_home/cloud/signout {profile} (that profile's cloud.json only)
7
+ // team each team server in that profile's hubs.json (`GET /_home/accounts`) → host + the
8
+ // account it vouched for; Sign out = POST /_home/hub/signout {profile, url}
9
+ // github the login last signed in on the profile (profiles.json). Home has no GitHub sign-out
10
+ // path of its own — it lives in the project's account card — so no button here
11
+ // (Michal's rule: no dead buttons). A profile without a login offers "Sign in with GitHub…"
12
+ // (the existing `home_github_sign_in`).
13
+ // Add / switch: "Add a Maude Cloud account…" is Home's own sign-in, which never re-signs a profile
14
+ // that holds a credential (`home_cloud_sign_in_prepare` makes a fresh one — that IS the switch);
15
+ // "Connect to a team server…" is the Advanced › hub sheet. A browser has no shell: facts only.
16
+
17
+ import { accountFace } from './home-model.js';
18
+
19
+ const hostOf = (url) => {
20
+ try {
21
+ return new URL(String(url)).host;
22
+ } catch {
23
+ return String(url || '');
24
+ }
25
+ };
26
+ const str = (v) => (typeof v === 'string' && v.trim() ? v.trim() : null);
27
+
28
+ function signOutSpec(path, name, extra) {
29
+ return {
30
+ path,
31
+ ...extra,
32
+ label: `Sign out of ${name}…`,
33
+ confirm: {
34
+ title: `Sign out of ${name}?`,
35
+ body:
36
+ path === 'hub-signout'
37
+ ? 'Projects on this account stop syncing with it. Your work stays on this Mac.'
38
+ : 'Every project on this account is signed out. Your work stays on this Mac.',
39
+ primary: 'Sign out',
40
+ cancel: 'Cancel',
41
+ },
42
+ };
43
+ }
44
+
45
+ /**
46
+ * @param in.native the desktop app
47
+ * @param in.shell `shell_state` (profiles: [{ id, label, email?, github? }])
48
+ * @param in.clouds one `GET /_home/cloud` answer per profile
49
+ * @param in.hubProfiles `GET /_home/accounts` `profiles`
50
+ */
51
+ export function homeAccounts({ native = false, shell = null, clouds = null, hubProfiles = null }) {
52
+ const known = (shell?.profiles ?? []).filter((p) => p && typeof p.id === 'string');
53
+ const ids = [
54
+ ...known.map((p) => p.id),
55
+ ...(clouds ?? [])
56
+ .filter((c) => c?.signedIn && typeof c.profile === 'string')
57
+ .map((c) => c.profile),
58
+ ].filter((id, i, all) => all.indexOf(id) === i);
59
+
60
+ const profiles = ids.map((id) => {
61
+ const p = known.find((x) => x.id === id) ?? null;
62
+ const label = str(p?.label) || (id === 'default' ? 'Default' : id);
63
+ const cloud = (clouds ?? []).find((c) => c?.profile === id) ?? null;
64
+ const accounts = [];
65
+ if (cloud?.signedIn) {
66
+ const email = str(cloud.account?.email) || str(p?.email);
67
+ accounts.push({
68
+ kind: 'cloud',
69
+ key: 'cloud',
70
+ title: 'Maude Cloud',
71
+ host: null,
72
+ who: email,
73
+ signOut: native
74
+ ? signOutSpec('cloud-signout', email || 'Maude Cloud', { profile: id })
75
+ : null,
76
+ });
77
+ }
78
+ for (const h of (hubProfiles ?? []).find((x) => x?.id === id)?.hubs ?? []) {
79
+ if (!h || typeof h.url !== 'string') continue;
80
+ const host = hostOf(h.url);
81
+ accounts.push({
82
+ kind: 'team',
83
+ key: `team:${h.url}`,
84
+ title: 'Team server',
85
+ host,
86
+ who: str(h.account),
87
+ signOut: native ? signOutSpec('hub-signout', host, { profile: id, url: h.url }) : null,
88
+ });
89
+ }
90
+ const gh = str(p?.github);
91
+ if (gh)
92
+ accounts.push({
93
+ kind: 'github',
94
+ key: 'github',
95
+ title: 'GitHub',
96
+ host: null,
97
+ who: `@${gh.replace(/^@/, '')}`,
98
+ signOut: null,
99
+ });
100
+ return {
101
+ id,
102
+ label,
103
+ face: accountFace({ id, label, email: accounts[0]?.who?.replace(/^@/, '') || '' }),
104
+ accounts,
105
+ githubSignIn: native && !gh,
106
+ };
107
+ });
108
+
109
+ const first = profiles.find((p) => p.accounts.length) ?? profiles[0] ?? null;
110
+ const face = first
111
+ ? {
112
+ ...first.face,
113
+ title: [first.label, first.accounts[0]?.who].filter(Boolean).join(' · ') || 'Your accounts',
114
+ }
115
+ : null;
116
+ return {
117
+ profiles,
118
+ face,
119
+ add: native ? { cloud: 'Add a Maude Cloud account…', team: 'Connect to a team server…' } : null,
120
+ };
121
+ }
@@ -89,6 +89,12 @@ export const getIndex = (pids, running = []) =>
89
89
  homeFetch(`/_home/index?pids=${pidParam(pids)}&running=${pidParam(running)}`);
90
90
  export const getCloud = (profile) =>
91
91
  homeFetch(`/_home/cloud?profile=${encodeURIComponent(profile)}`);
92
+ /** 2.0.5 W4b — each profile's team-server sign-ins: `{ ok, profiles: [{ id, hubs: [{url, account}] }] }`. */
93
+ export const getAccounts = (profiles) =>
94
+ homeFetch(`/_home/accounts?profiles=${pidParam(profiles)}`);
95
+ /** 2.0.5 W4b — sign ONE profile out of one team server / of Maude Cloud. */
96
+ export const hubSignOut = (profile, url) => post('/_home/hub/signout', { profile, url });
97
+ export const cloudSignOut = (profile) => post('/_home/cloud/signout', { profile });
92
98
  export const search = (q, pids) =>
93
99
  homeFetch(`/_home/search?q=${encodeURIComponent(q)}&pids=${pidParam(pids)}`);
94
100
  export const getRecentSearches = () => homeFetch('/_home/recent-searches');