@1agh/maude 2.0.0-rc.2 → 2.0.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 (76) hide show
  1. package/apps/studio/acp/login-state.ts +3 -2
  2. package/apps/studio/actions/defs/chat.ts +4 -1
  3. package/apps/studio/actions.manifest.json +1 -1
  4. package/apps/studio/bridge/dgn-protocol.ts +13 -0
  5. package/apps/studio/canvas-lib.tsx +7 -0
  6. package/apps/studio/client/export-lane.js +4 -2
  7. package/apps/studio/client/hooks/use-canvas-bridge.jsx +6 -0
  8. package/apps/studio/client/panels/ChatPanel.jsx +10 -2
  9. package/apps/studio/client/panels/acp-runtime.js +14 -0
  10. package/apps/studio/client/system/system-view.jsx +6 -2
  11. package/apps/studio/client/tree-row-menu.jsx +4 -0
  12. package/apps/studio/client/v2/ai/Advanced.jsx +23 -7
  13. package/apps/studio/client/v2/ai/AttachMenu.jsx +4 -0
  14. package/apps/studio/client/v2/ai/ChatList.jsx +7 -1
  15. package/apps/studio/client/v2/ai/ConnectSheet.jsx +75 -4
  16. package/apps/studio/client/v2/ai/NeedsYouSlot.jsx +42 -8
  17. package/apps/studio/client/v2/ai/NotReady.jsx +24 -3
  18. package/apps/studio/client/v2/ai/RunList.jsx +4 -0
  19. package/apps/studio/client/v2/ai/RunSurface.jsx +14 -4
  20. package/apps/studio/client/v2/ai/ScopeChip.jsx +4 -0
  21. package/apps/studio/client/v2/ai/Working.jsx +13 -1
  22. package/apps/studio/client/v2/ai/activity-line.js +390 -0
  23. package/apps/studio/client/v2/ai/activity-store.js +45 -0
  24. package/apps/studio/client/v2/ai/advanced-model.js +62 -12
  25. package/apps/studio/client/v2/ai/ai-list-advanced.css +7 -0
  26. package/apps/studio/client/v2/ai/ai-run.css +19 -0
  27. package/apps/studio/client/v2/ai/ai-send.js +6 -2
  28. package/apps/studio/client/v2/ai/connect-flow.js +29 -8
  29. package/apps/studio/client/v2/ai/needs-you.css +18 -0
  30. package/apps/studio/client/v2/ai/ring-relay.js +11 -1
  31. package/apps/studio/client/v2/ai/use-activity-line.js +81 -0
  32. package/apps/studio/client/v2/annotations/templates-panel.jsx +4 -0
  33. package/apps/studio/client/v2/assets/kinds-chip.jsx +1 -1
  34. package/apps/studio/client/v2/assets/place-asset.js +20 -1
  35. package/apps/studio/client/v2/assets/tile-menu.jsx +1 -1
  36. package/apps/studio/client/v2/canvases/canvases-panel.jsx +5 -1
  37. package/apps/studio/client/v2/canvases/row-menu.jsx +4 -2
  38. package/apps/studio/client/v2/ds/review.css +2 -0
  39. package/apps/studio/client/v2/empty/ai-drafting.jsx +78 -0
  40. package/apps/studio/client/v2/empty/empty-host.jsx +17 -0
  41. package/apps/studio/client/v2/empty/empty.css +98 -0
  42. package/apps/studio/client/v2/export/advanced/render.jsx +5 -2
  43. package/apps/studio/client/v2/export/export-copy.js +11 -4
  44. package/apps/studio/client/v2/export/export-sheet.jsx +6 -2
  45. package/apps/studio/client/v2/export/exports-model.js +13 -0
  46. package/apps/studio/client/v2/export/exports-panel.jsx +4 -2
  47. package/apps/studio/client/v2/export/job-row.jsx +4 -0
  48. package/apps/studio/client/v2/export/other-formats.jsx +7 -1
  49. package/apps/studio/client/v2/export/sections/batch-model.js +3 -2
  50. package/apps/studio/client/v2/export/sections/batch.jsx +20 -4
  51. package/apps/studio/client/v2/inspector/sections/colour-popover.jsx +4 -0
  52. package/apps/studio/client/v2/inspector/token-chip.jsx +4 -0
  53. package/apps/studio/client/v2/kinds/SizePicker.jsx +4 -0
  54. package/apps/studio/client/v2/presence/faces.jsx +4 -0
  55. package/apps/studio/client/v2/share/role-menu.jsx +7 -1
  56. package/apps/studio/client/v2/share/share-model.js +20 -1
  57. package/apps/studio/client/v2/share/share-sheet.jsx +6 -4
  58. package/apps/studio/client/v2/shell/account-card.jsx +7 -1
  59. package/apps/studio/client/v2/shell/canvas-pointer.js +21 -0
  60. package/apps/studio/client/v2/shell/mode-switch.jsx +4 -0
  61. package/apps/studio/client/v2/shell/project-pill.jsx +4 -0
  62. package/apps/studio/client/v2/shell/save-status.js +10 -1
  63. package/apps/studio/client/v2/shell/share-cluster-host.jsx +2 -0
  64. package/apps/studio/client/v2/shell/share-cluster.jsx +6 -1
  65. package/apps/studio/client/v2/shell/use-dismiss-outside.js +14 -6
  66. package/apps/studio/client/v2/timeline/joins/transition-picker.jsx +7 -1
  67. package/apps/studio/client/v2/undo/undo-history.jsx +7 -1
  68. package/apps/studio/cloud/endpoints.ts +31 -1
  69. package/apps/studio/dist/client.bundle.js +921 -921
  70. package/apps/studio/dist/comment-mount.js +1 -1
  71. package/apps/studio/dist/styles.css +1 -1
  72. package/apps/studio/editing/canvas-pointer.ts +29 -0
  73. package/apps/studio/routes/cloud-move.ts +7 -4
  74. package/apps/studio/video-play-overlay.tsx +67 -12
  75. package/apps/studio/whats-new.json +43 -16
  76. package/package.json +8 -8
@@ -219,6 +219,8 @@ export function ExportSheet({
219
219
  // S8.5 — a video's Render row: cloud or this Mac (Suggest each time / always, export-lane.js)
220
220
  const online = useOnline();
221
221
  const [pickedLane, setPickedLane] = useState(null);
222
+ // rc3-i — a cloud tab (any lane but the desktop's own): nothing runs on a Mac, so the words never say it does
223
+ const workspace = exportLane !== 'local';
222
224
  const lanePref = state.adv?.lane ?? readLanePref();
223
225
  const render = useMemo(
224
226
  () =>
@@ -228,8 +230,9 @@ export function ExportSheet({
228
230
  online,
229
231
  picked: pickedLane,
230
232
  seconds: est?.seconds ?? null,
233
+ workspace,
231
234
  }),
232
- [lanePref, est, online, pickedLane]
235
+ [lanePref, est, online, pickedLane, workspace]
233
236
  );
234
237
  // 09 — one artboard exported (a post, a web page, a video, a print page): its picture + its size line beside the rows
235
238
  const videoRow = section === 'video' ? (video.rows?.[0] ?? null) : null;
@@ -342,7 +345,7 @@ export function ExportSheet({
342
345
  ? summaryWords(
343
346
  // 09 ex-video / 07 ve-export: the words follow the Render card that is ticked, not the estimate's lane
344
347
  estimateForLane(est, render),
345
- printChoice.printPdf ? { pdfPages: printChoice.withBack ? 2 : 1 } : undefined
348
+ { workspace, ...(printChoice.printPdf ? { pdfPages: printChoice.withBack ? 2 : 1 } : {}) }
346
349
  )
347
350
  : null;
348
351
  const button =
@@ -564,6 +567,7 @@ export function ExportSheet({
564
567
  const sectionProps = {
565
568
  state,
566
569
  set,
570
+ workspace,
567
571
  setFormat: (f) => {
568
572
  setFormat(f);
569
573
  setStatus(null);
@@ -14,6 +14,19 @@ export const PANEL_FOOT = 'The last 20 exports stay here. Also in Search: “Exp
14
14
  /** 09 ex-progress: while something runs the foot says what survives a sleeping Mac. */
15
15
  export const RUNNING_FOOT =
16
16
  'Cloud renders keep going if this Mac sleeps or the window closes. Exports on this Mac need the window open — images and PDFs take seconds.';
17
+ /**
18
+ * rc3-i — a browser tab (a cloud tab) has no Mac to sleep: when everything running there runs in the cloud, the
19
+ * foot says only the part that is true. The desktop keeps RUNNING_FOOT whatever runs.
20
+ */
21
+ export const RUNNING_FOOT_CLOUD = 'Cloud renders keep going if the window closes.';
22
+ export function runningFoot(jobs, { native = true } = {}) {
23
+ const active = (Array.isArray(jobs) ? jobs : []).filter(
24
+ (j) => j?.status === 'queued' || j?.status === 'running'
25
+ );
26
+ if (!native && active.length > 0 && active.every((j) => j.runsOn === 'cloud'))
27
+ return RUNNING_FOOT_CLOUD;
28
+ return RUNNING_FOOT;
29
+ }
17
30
  export const OPEN_FOLDER = 'Open the Downloads folder';
18
31
  export const SHOW_IN_FINDER = 'Show in Finder';
19
32
  export const DOWNLOAD = 'Download';
@@ -24,7 +24,7 @@ import {
24
24
  PANEL_FOOT,
25
25
  PANEL_TITLE,
26
26
  panelGroups,
27
- RUNNING_FOOT,
27
+ runningFoot,
28
28
  } from './exports-model.js';
29
29
 
30
30
  const EMPTY_ID = 'es-panels-make.exports-none';
@@ -157,7 +157,9 @@ export function ExportsPanel({
157
157
  )}
158
158
  </div>
159
159
  {groups.length > 0 ? (
160
- <p className="ex-panel-foot">{running ? RUNNING_FOOT : PANEL_FOOT}</p>
160
+ <p className="ex-panel-foot">
161
+ {running ? runningFoot(center.jobs, { native }) : PANEL_FOOT}
162
+ </p>
161
163
  ) : null}
162
164
  </div>
163
165
  );
@@ -24,6 +24,7 @@ import {
24
24
  whereOf,
25
25
  } from './exports-model.js';
26
26
  import { isQueuedCloud, RENDER_HERE } from './cloud-queue.js';
27
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
27
28
 
28
29
  // Per-job anchor for the ETA: the FIRST progress sample the client sees. For a video export that is
29
30
  // the first frame-step frame — after the (progress-less) renderMediaOnWeb attempt — so the rate is
@@ -138,9 +139,12 @@ function RowMenu({ job, native, on, anchorRef, onClose }) {
138
139
  };
139
140
  document.addEventListener('pointerdown', onPointer, true);
140
141
  document.addEventListener('keydown', onKey, true);
142
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
143
+ const offCanvas = onCanvasPointer(() => onClose());
141
144
  return () => {
142
145
  document.removeEventListener('pointerdown', onPointer, true);
143
146
  document.removeEventListener('keydown', onKey, true);
147
+ offCanvas();
144
148
  };
145
149
  }, [anchorRef, onClose]);
146
150
  const run = (id) => {
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { useEffect, useLayoutEffect, useRef, useState } from 'react';
9
9
  import { matchOther, OTHER_LABEL, OTHER_NONE, OTHER_SEARCH } from './export-copy.js';
10
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
10
11
 
11
12
  const GAP = 4;
12
13
  const EDGE = 16;
@@ -84,7 +85,12 @@ export function OtherFormats({ groups, format, onPick, open, setOpen }) {
84
85
  if (!root.current?.contains(e.target)) setOpen(false);
85
86
  };
86
87
  document.addEventListener('mousedown', away);
87
- return () => document.removeEventListener('mousedown', away);
88
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
89
+ const offCanvas = onCanvasPointer(() => setOpen(false));
90
+ return () => {
91
+ document.removeEventListener('mousedown', away);
92
+ offCanvas();
93
+ };
88
94
  }, [open, setOpen]);
89
95
 
90
96
  const rows = () => [
@@ -193,10 +193,11 @@ export const isBig = (est) =>
193
193
  * the cloud — that the window can close once this Mac's part is done. `summary` is the sheet's own
194
194
  * estimate sentence (counts, size, time), so the two never disagree.
195
195
  */
196
- export function bigWords(est, { summary, hasVideo }) {
196
+ export function bigWords(est, { summary, hasVideo, workspace = false }) {
197
197
  if (!isBig(est)) return null;
198
198
  const head = `This is a big export — ${summary ?? `${countWord(est.files)} files`}.`;
199
- if (hasVideo && est.lane === 'cloud')
199
+ // rc3-i — a cloud tab has no "this Mac's part": the sheet's own browser captures stay with the window
200
+ if (hasVideo && est.lane === 'cloud' && !workspace)
200
201
  return `${head} Once this Mac’s part is done you can close the window — the cloud finishes the videos.`;
201
202
  return `${head} Keep this window open until it is done.`;
202
203
  }
@@ -53,7 +53,17 @@ export function stillsOf(pictures, kind, max = 3) {
53
53
  .map((i) => ({ url: i.picture.url, label: i.label }));
54
54
  }
55
55
 
56
- function Group({ kind, row, pick, cloud, onPick, boards = [], canvases = 0, stills = [] }) {
56
+ function Group({
57
+ kind,
58
+ row,
59
+ pick,
60
+ cloud,
61
+ workspace = false,
62
+ onPick,
63
+ boards = [],
64
+ canvases = 0,
65
+ stills = [],
66
+ }) {
57
67
  const Icon = KIND_ICON[kind] ?? DigitalIcon;
58
68
  const choice = choiceFor(kind, { [kind]: pick });
59
69
  // 09: the small note under the value — what the format adds (print: "Bleed + crop marks"), or that a video renders in
@@ -70,7 +80,8 @@ function Group({ kind, row, pick, cloud, onPick, boards = [], canvases = 0, stil
70
80
  </strong>
71
81
  <span className="ex-group-s" data-testid={`export-group-${kind}-names`}>
72
82
  {canvases > 1 ? `from ${canvases} canvases — ` : ''}
73
- {namesLine(boards) || (kind === 'video' && cloud ? WHERE_CLOUD : WHERE_THIS_MAC)}
83
+ {namesLine(boards) ||
84
+ (kind === 'video' && cloud ? WHERE_CLOUD : workspace ? '' : WHERE_THIS_MAC)}
74
85
  </span>
75
86
  </div>
76
87
  {stills.length ? (
@@ -142,7 +153,7 @@ function IncludeRow({ state, set, counts }) {
142
153
  * @param est the server's estimate (`byKind`, `skipped`, `counts`, numbers)
143
154
  * @param setFormat the sheet's format setter (Project ZIP instead)
144
155
  */
145
- export function BatchSection({ state, set, est, setFormat, pictures }) {
156
+ export function BatchSection({ state, set, est, setFormat, pictures, workspace = false }) {
146
157
  const byKind = est?.byKind ?? {};
147
158
  const boards = est?.boards ?? [];
148
159
  const kinds = orderKinds(Object.keys(byKind));
@@ -150,7 +161,11 @@ export function BatchSection({ state, set, est, setFormat, pictures }) {
150
161
  const cloud = est?.lane === 'cloud';
151
162
  const shared = sharedPartsLine(est?.skipped);
152
163
  const unit = formatSkipLine(est?.skipped);
153
- const big = bigWords(est, { summary: summaryWords(est), hasVideo: kinds.includes('video') });
164
+ const big = bigWords(est, {
165
+ summary: summaryWords(est, { workspace }),
166
+ hasVideo: kinds.includes('video'),
167
+ workspace,
168
+ });
154
169
  return (
155
170
  <>
156
171
  {/* biome-ignore lint/a11y/useSemanticElements: a labelled run of format groups, not a form fieldset */}
@@ -167,6 +182,7 @@ export function BatchSection({ state, set, est, setFormat, pictures }) {
167
182
  row={byKind[kind]}
168
183
  pick={picks[kind]}
169
184
  cloud={cloud}
185
+ workspace={workspace}
170
186
  boards={boards.filter((b) => (b.kind ?? 'digital') === kind)}
171
187
  canvases={
172
188
  new Set(boards.filter((b) => (b.kind ?? 'digital') === kind).map((b) => b.canvas))
@@ -26,6 +26,7 @@ import { deltaE } from '../../../../ds/nearest.ts';
26
26
  import { requestDsMake } from '../../ds/default-write.js';
27
27
  import { addColourNow } from '../../ds/edge-write.js';
28
28
  import { OffSystemQuestion } from '../../ds/off-system.jsx';
29
+ import { onCanvasPointer } from '../../shell/canvas-pointer.js';
29
30
  import { colourGroups, groupOf, swatchOf } from '../colour-groups.js';
30
31
  import {
31
32
  GradientEditor,
@@ -302,9 +303,12 @@ export function ColourPopover({
302
303
  const away = () => closeRef.current();
303
304
  document.addEventListener('pointerdown', down, true);
304
305
  window.addEventListener('blur', away);
306
+ // rc3 r4-12 — a press in the canvas, told over the dgn bridge (WebKit gives this window no blur for it)
307
+ const offCanvas = onCanvasPointer(away);
305
308
  return () => {
306
309
  document.removeEventListener('pointerdown', down, true);
307
310
  window.removeEventListener('blur', away);
311
+ offCanvas();
308
312
  };
309
313
  }, [anchorRef]);
310
314
 
@@ -12,6 +12,7 @@ import { lengthPx, nearestSpace, tokenLabel } from '../../../edit-ops/words-css.
12
12
  import { ScrubLabelContext, makeScrubHandler } from '../../inspector-controls.jsx';
13
13
  import { StIcon } from '../../shell/icons.jsx';
14
14
  import { activeDsNameFor, useAllDsTokens } from '../../inspector/ds-tokens.js';
15
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
15
16
 
16
17
  const pxOf = (value) => {
17
18
  const m = /^(-?\d*\.?\d+)(px|rem)?$/i.exec(String(value ?? '').trim());
@@ -73,9 +74,12 @@ export function useDismiss(open, onClose, ref) {
73
74
  };
74
75
  document.addEventListener('pointerdown', down, true);
75
76
  document.addEventListener('keydown', key, true);
77
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
78
+ const offCanvas = onCanvasPointer(() => onClose());
76
79
  return () => {
77
80
  document.removeEventListener('pointerdown', down, true);
78
81
  document.removeEventListener('keydown', key, true);
82
+ offCanvas();
79
83
  };
80
84
  }, [open, onClose, ref]);
81
85
  }
@@ -17,6 +17,7 @@
17
17
  // overlay. Tokens only (size-picker.css).
18
18
 
19
19
  import { useEffect, useMemo, useRef, useState } from 'react';
20
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
20
21
  import {
21
22
  DigitalIcon,
22
23
  ImageIcon,
@@ -328,10 +329,13 @@ export default function SizePicker({
328
329
  window.addEventListener('keydown', onKey, true);
329
330
  document.addEventListener('pointerdown', onDown, true);
330
331
  window.addEventListener('blur', onBlur);
332
+ // rc3 r4-12 — a press in the canvas, told over the dgn bridge (WebKit gives this window no blur for it)
333
+ const offCanvas = onCanvasPointer(onBlur);
331
334
  return () => {
332
335
  window.removeEventListener('keydown', onKey, true);
333
336
  document.removeEventListener('pointerdown', onDown, true);
334
337
  window.removeEventListener('blur', onBlur);
338
+ offCanvas();
335
339
  };
336
340
  }, []);
337
341
 
@@ -21,6 +21,7 @@ import {
21
21
  } from '../../../presence/model.ts';
22
22
  import { toneFor, toneVar, YOU_TONE } from '../../../presence/tones.ts';
23
23
  import { Glyph, SparkGlyph } from '../share/glyphs.jsx';
24
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
24
25
 
25
26
  const isPeer = (f) => !f.you && !f.agent && typeof f.clientID === 'number';
26
27
 
@@ -40,9 +41,12 @@ function useDismiss(open, onClose, ref, restore) {
40
41
  };
41
42
  document.addEventListener('mousedown', onDown);
42
43
  document.addEventListener('keydown', onKey, true);
44
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
45
+ const offCanvas = onCanvasPointer(() => onClose());
43
46
  return () => {
44
47
  document.removeEventListener('mousedown', onDown);
45
48
  document.removeEventListener('keydown', onKey, true);
49
+ offCanvas();
46
50
  };
47
51
  }, [open, onClose, ref, restore]);
48
52
  }
@@ -20,6 +20,7 @@ import { useEffect, useLayoutEffect, useState } from 'react';
20
20
  import { useModalFocus } from '../shell/modal-focus.js';
21
21
  import { Glyph } from './glyphs.jsx';
22
22
  import { ROLE_WORDS } from './share-model.js';
23
+ import { onCanvasPointer } from '../shell/canvas-pointer.js';
23
24
 
24
25
  /** Where a menu of `size` hangs from `anchor`: right-aligned, below, or above when it would not fit. */
25
26
  export function menuPlace(anchorRect, size, view, gap = 4) {
@@ -59,7 +60,12 @@ export function RoleMenu({ row, roles, makeOwner, scopeName, anchor, onPick, onC
59
60
  if (ref.current && !ref.current.contains(e.target)) onClose();
60
61
  };
61
62
  document.addEventListener('mousedown', onDown, true);
62
- return () => document.removeEventListener('mousedown', onDown, true);
63
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
64
+ const offCanvas = onCanvasPointer(() => onClose());
65
+ return () => {
66
+ document.removeEventListener('mousedown', onDown, true);
67
+ offCanvas();
68
+ };
63
69
  }, [onClose, ref]);
64
70
 
65
71
  const onKeyDown = (e) => {
@@ -368,7 +368,9 @@ export function advancedView({ view, shell, hubUrl } = {}) {
368
368
  }
369
369
  : null,
370
370
  hint: !linked
371
- ? 'Addresses that open on this Mac'
371
+ ? shell === 'cloud'
372
+ ? 'Other ways in'
373
+ : 'Addresses that open on this Mac'
372
374
  : selfHosted
373
375
  ? 'Other ways in, sync, roles'
374
376
  : 'Links, link rules, sync',
@@ -467,3 +469,20 @@ export function shareApi(fetchImpl = (...a) => fetch(...a)) {
467
469
  confirmLink: () => go('POST', '/_api/sync/link/confirm', {}),
468
470
  };
469
471
  }
472
+
473
+ /**
474
+ * The sentence under a queued invite when the studio gave none (the desktop's route always does), and under
475
+ * Share while offline. rc3-i — a cloud tab (shell `cloud`) has no Mac in it.
476
+ */
477
+ export const INVITES_WAIT_CLOUD = 'Invites send when you are back online.';
478
+ export const queuedInviteWords = (shell) =>
479
+ shell === 'cloud' ? INVITES_WAIT_CLOUD : 'Invites send when this Mac is online.';
480
+
481
+ /**
482
+ * The line under a linked project the hub cannot be asked about. The desktop queues an invite on this Mac
483
+ * until it reaches the project; a cloud tab queues nothing — it just cannot reach its workspace.
484
+ */
485
+ export const unreachableWords = (shell) =>
486
+ shell === 'cloud'
487
+ ? 'Sharing is not available right now. Try again in a moment.'
488
+ : 'Sharing is not available right now. Invites you send wait here and go out once this Mac reaches the project.';
@@ -37,12 +37,14 @@ import {
37
37
  LINK_CONFIRMED_EVENT,
38
38
  lastSyncedAt,
39
39
  peopleRows,
40
+ queuedInviteWords,
40
41
  readJoinAs,
41
42
  roleWord,
42
43
  shareApi,
43
44
  sheetView,
44
45
  takeShareFocus,
45
46
  teamRow,
47
+ unreachableWords,
46
48
  writeJoinAs,
47
49
  } from './share-model.js';
48
50
 
@@ -267,7 +269,7 @@ export function ShareSheet({
267
269
  if (r.status === 202 && r.body?.queued) {
268
270
  setNotice({
269
271
  kind: 'queued',
270
- text: r.body.words ?? 'Invites send when this Mac is online.',
272
+ text: r.body.words ?? queuedInviteWords(shell),
271
273
  });
272
274
  return true;
273
275
  }
@@ -444,7 +446,8 @@ export function ShareSheet({
444
446
  </button>
445
447
  </div>
446
448
  )}
447
- {posture && !view.linked && !offerMove && !moving && !pendingLink && (
449
+ {/* a cloud tab is never a "local project": it IS the workspace, so this line has no true form there (rc3-i) */}
450
+ {posture && !view.linked && !offerMove && !moving && !pendingLink && shell !== 'cloud' && (
448
451
  <div className="v2sh-arow v2sh-arow--stack">
449
452
  <p className="v2sh-hint" data-testid="share-local-note">
450
453
  Local project — kept on this Mac. To invite people, move it to Maude Cloud in the
@@ -455,8 +458,7 @@ export function ShareSheet({
455
458
  )}
456
459
  {posture && view.linked && !view.reachable && (
457
460
  <p className="v2sh-hint" data-testid="share-unreachable">
458
- Sharing is not available right now. Invites you send wait here and go out once this Mac
459
- reaches the project.
461
+ {unreachableWords(shell)}
460
462
  </p>
461
463
  )}
462
464
 
@@ -13,6 +13,7 @@
13
13
 
14
14
  import { useCallback, useEffect, useId, useRef, useState } from 'react';
15
15
  import { StIcon } from '../../shell/icons.jsx';
16
+ import { onCanvasPointer } from './canvas-pointer.js';
16
17
 
17
18
  function Face({ initial, tone, size = 'md' }) {
18
19
  return (
@@ -48,7 +49,12 @@ export function AccountChip({ chip, card, onSwitch, onSignOut }) {
48
49
  if (wrap.current && !wrap.current.contains(e.target)) close(false);
49
50
  };
50
51
  document.addEventListener('pointerdown', onDown, true);
51
- return () => document.removeEventListener('pointerdown', onDown, true);
52
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
53
+ const offCanvas = onCanvasPointer(() => close(false));
54
+ return () => {
55
+ document.removeEventListener('pointerdown', onDown, true);
56
+ offCanvas();
57
+ };
52
58
  }, [open, close]);
53
59
 
54
60
  if (!chip || !card) return null;
@@ -0,0 +1,21 @@
1
+ // client/v2/shell/canvas-pointer.js — rc3 r4-12: "a press landed in the canvas", as a shell-window event.
2
+ //
3
+ // The canvas iframe (another origin, DDR-054) posts `{dgn:'canvas-pointerdown'}` on every press
4
+ // (editing/canvas-pointer.ts); the shell's canvas bridge accepts it from the active canvas only (the dgn table's
5
+ // `active` gate) and calls `announceCanvasPointer()`. Anything in the shell that closes on "a click anywhere
6
+ // else" listens with `onCanvasPointer` — use-dismiss-outside.js does, so every menu built on it closes on a
7
+ // click into the canvas even where the shell window gets no blur for it (WebKit, the packaged app).
8
+
9
+ export const CANVAS_POINTER_EVENT = 'maude:canvas-pointerdown';
10
+
11
+ /** Tell the shell's listeners that a press landed in the canvas. */
12
+ export function announceCanvasPointer(win = typeof window === 'undefined' ? null : window) {
13
+ win?.dispatchEvent(new Event(CANVAS_POINTER_EVENT));
14
+ }
15
+
16
+ /** Run `fn` on each press in the canvas. Returns the unsubscribe. */
17
+ export function onCanvasPointer(fn, win = typeof window === 'undefined' ? null : window) {
18
+ if (!win) return () => {};
19
+ win.addEventListener(CANVAS_POINTER_EVENT, fn);
20
+ return () => win.removeEventListener(CANVAS_POINTER_EVENT, fn);
21
+ }
@@ -23,6 +23,7 @@ import { formatChord } from '../../../actions/keys.ts';
23
23
  import { StIcon } from '../../shell/icons.jsx';
24
24
  import { MODE_WORD, modeSegments } from './canvas-mode.js';
25
25
  import { reasonProps } from '../access/disabled-reason.js';
26
+ import { onCanvasPointer } from './canvas-pointer.js';
26
27
 
27
28
  const GLYPH = {
28
29
  edit: (
@@ -253,9 +254,12 @@ export function ModeSwitch({
253
254
  };
254
255
  document.addEventListener('pointerdown', onDown, true);
255
256
  document.addEventListener('keydown', onKey, true);
257
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
258
+ const offCanvas = onCanvasPointer(() => setMenu(false));
256
259
  return () => {
257
260
  document.removeEventListener('pointerdown', onDown, true);
258
261
  document.removeEventListener('keydown', onKey, true);
262
+ offCanvas();
259
263
  };
260
264
  }, [menu]);
261
265
 
@@ -16,6 +16,7 @@ import { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } fr
16
16
  import { Kbd, StIcon } from '../../shell/icons.jsx';
17
17
  import { SWITCHER_TRIGGER_TESTID } from '../../panels/RepoBranchSwitcher.jsx';
18
18
  import { reasonProps } from '../access/disabled-reason.js';
19
+ import { onCanvasPointer } from './canvas-pointer.js';
19
20
  import { buildProjectMenu } from './project-menu-model.js';
20
21
 
21
22
  const slug = (s) =>
@@ -264,9 +265,12 @@ export function ProjectPill({
264
265
  const onBlur = () => close(false);
265
266
  document.addEventListener('pointerdown', onDown, true);
266
267
  window.addEventListener('blur', onBlur);
268
+ // rc3 r4-12 — a press in the canvas, told over the dgn bridge (WebKit gives this window no blur for it)
269
+ const offCanvas = onCanvasPointer(onBlur);
267
270
  return () => {
268
271
  document.removeEventListener('pointerdown', onDown, true);
269
272
  window.removeEventListener('blur', onBlur);
273
+ offCanvas();
270
274
  };
271
275
  }, [open, close]);
272
276
 
@@ -48,6 +48,12 @@ export const WORDS = Object.freeze({
48
48
  'not-saved': 'Not saved',
49
49
  });
50
50
 
51
+ /**
52
+ * rc3-i — a cloud tab (a browser on a cell) keeps nothing on a Mac, so its offline word drops the place
53
+ * (the callouts' rule, p8-cell-copy: same words, minus the part that is false there).
54
+ */
55
+ export const OFFLINE_WORD_CLOUD = 'Offline';
56
+
51
57
  export const ACCESS_WORDS = Object.freeze({ view: 'Can view', comment: 'Can comment' });
52
58
 
53
59
  /** A held source conflict's one action (CONTRACT §6): the two versions side by side in Sync details. */
@@ -71,6 +77,7 @@ const count = (n) => (Number.isFinite(n) && n > 0 ? n : 0);
71
77
 
72
78
  /**
73
79
  * @param in.linked a hub / cloud link exists
80
+ * @param in.cloud this shell is a cloud tab (a browser on a cell): no word names a Mac
74
81
  * @param in.online false only when the browser says there is no network
75
82
  * @param in.phase SyncPhase from syncPresentation, or null
76
83
  * @param in.pending edits waiting to leave this Mac
@@ -82,6 +89,7 @@ const count = (n) => (Number.isFinite(n) && n > 0 ? n : 0);
82
89
  export function saveStatus(input) {
83
90
  const {
84
91
  linked = false,
92
+ cloud,
85
93
  online = true,
86
94
  phase = null,
87
95
  pending = 0,
@@ -117,7 +125,8 @@ export function saveStatus(input) {
117
125
  });
118
126
  }
119
127
  if (!linked) return make('local');
120
- if (online === false || OFFLINE_PHASES.has(phase)) return make('offline');
128
+ if (online === false || OFFLINE_PHASES.has(phase))
129
+ return make('offline', cloud ? { word: OFFLINE_WORD_CLOUD } : {});
121
130
  if (SYNCING_PHASES.has(phase) || count(pending) > 0) return make('syncing');
122
131
  return make('saved');
123
132
  }
@@ -162,6 +162,7 @@ export function ShellShareCluster() {
162
162
  useHeldConflictToast({ held, names: conflictNames, onCompare: compare, toast: notify });
163
163
  const status = saveStatus({
164
164
  linked,
165
+ cloud: !!cfg?.cloud,
165
166
  online,
166
167
  phase,
167
168
  pending,
@@ -306,6 +307,7 @@ export function ShellShareCluster() {
306
307
  return (
307
308
  <>
308
309
  <ShareCluster
310
+ cloud={!!cfg?.cloud}
309
311
  accountSlot={
310
312
  chip ? (
311
313
  <AccountChip
@@ -17,10 +17,13 @@ import { ACTIONS_BY_ID } from '../../../actions/index.ts';
17
17
  import { modeCell } from '../../../bridge/mode-shows.ts';
18
18
  import { StIcon } from '../../shell/icons.jsx';
19
19
  import { PresenceFaces } from '../presence/faces.jsx';
20
+ import { INVITES_WAIT_CLOUD } from '../share/share-model.js';
20
21
  import { keyHint } from './project-menu-model.js';
21
22
 
22
23
  /** The words under Share while this Mac is offline — the same sentence the sheet gives a queued invite. */
23
24
  export const OFFLINE_INVITE_TIP = 'Invites send when this Mac is online.';
25
+ /** rc3-i — the same line in a cloud tab, which has no Mac in it. */
26
+ export const OFFLINE_INVITE_TIP_CLOUD = INVITES_WAIT_CLOUD;
24
27
 
25
28
  function Ring({ value }) {
26
29
  return (
@@ -65,6 +68,7 @@ const withKey = (label, def, ctx) => {
65
68
  * (bridge/mode-shows.ts): Preview is `compact`, Viewing `full-access`; `data-cluster` carries it
66
69
  * @param present the Present spec while presenting (Artboards · Canvas are two columns of the table)
67
70
  * @param accountSlot the account chip + card (S1.22a, account-card.jsx) — first, desktop only
71
+ * @param cloud this shell is a cloud tab: no sentence names a Mac (rc3-i)
68
72
  */
69
73
  export function ShareCluster({
70
74
  faces,
@@ -89,6 +93,7 @@ export function ShareCluster({
89
93
  mode = null,
90
94
  present = null,
91
95
  accountSlot = null,
96
+ cloud,
92
97
  }) {
93
98
  const cluster = mode ? modeCell('share-cluster', mode, present) : 'full';
94
99
  const offline = !access && status?.kind === 'offline';
@@ -238,7 +243,7 @@ export function ShareCluster({
238
243
  className="sh-tip"
239
244
  data-testid="share-offline-tip"
240
245
  >
241
- {OFFLINE_INVITE_TIP}
246
+ {cloud ? OFFLINE_INVITE_TIP_CLOUD : OFFLINE_INVITE_TIP}
242
247
  </span>
243
248
  </span>
244
249
  ) : (
@@ -1,20 +1,26 @@
1
1
  // client/v2/shell/use-dismiss-outside.js — "a click anywhere else closes the popover", including the click that
2
2
  // never reaches the shell.
3
3
  //
4
- // Two doors, the pair the project pill already used (shell/project-pill.jsx):
4
+ // Three doors:
5
5
  // · a `pointerdown` in the capture phase anywhere in the shell outside `ref` (capture, so a handler that stops the
6
6
  // event cannot keep the popover open);
7
- // · the shell window's `blur`. Canvases render in an iframe on another origin (DDR-054): a click in one bubbles
8
- // nothing to the shell, but it moves focus into the iframe and so blurs this window. (Switching apps does the
9
- // same — closing then is what a menu does anyway.)
10
- // `onDismiss('outside' | 'blur')` runs; esc and what focus does after are the popover's own.
7
+ // · a press in the canvas (`canvas-pointer.js`). Canvases render in an iframe on another origin (DDR-054): a
8
+ // click in one bubbles nothing to the shell, so the canvas tells the shell over the dgn bridge. This is the
9
+ // door that holds in the packaged app: WebKit does not move focus into the iframe on a press that lands on
10
+ // nothing focusable, so the window blur below never arrives there (rc3 r4-12);
11
+ // · the shell window's `blur` — Chromium's way of saying the same, and switching apps (closing then is what a
12
+ // menu does anyway).
13
+ // `onDismiss('outside' | 'canvas' | 'blur')` runs. None of the doors stops the press: it still reaches what it was
14
+ // aimed at. Esc and what focus does after are the popover's own — an outside dismissal should leave the focus
15
+ // where the click put it.
11
16
 
12
17
  import { useEffect, useRef } from 'react';
18
+ import { onCanvasPointer } from './canvas-pointer.js';
13
19
 
14
20
  /**
15
21
  * @param {boolean} open
16
22
  * @param {{ current: Element | null }} ref the popover; a pointerdown inside it is not a dismissal
17
- * @param {(why: 'outside' | 'blur') => void} onDismiss
23
+ * @param {(why: 'outside' | 'canvas' | 'blur') => void} onDismiss
18
24
  */
19
25
  export function useDismissOutside(open, ref, onDismiss) {
20
26
  const latest = useRef(onDismiss);
@@ -27,9 +33,11 @@ export function useDismissOutside(open, ref, onDismiss) {
27
33
  const onBlur = () => latest.current('blur');
28
34
  document.addEventListener('pointerdown', onDown, true);
29
35
  window.addEventListener('blur', onBlur);
36
+ const offCanvas = onCanvasPointer(() => latest.current('canvas'));
30
37
  return () => {
31
38
  document.removeEventListener('pointerdown', onDown, true);
32
39
  window.removeEventListener('blur', onBlur);
40
+ offCanvas();
33
41
  };
34
42
  }, [open, ref]);
35
43
  }
@@ -22,6 +22,7 @@ import {
22
22
  tileOfPresentation,
23
23
  } from './join-model.js';
24
24
  import { reasonProps } from '../../access/disabled-reason.js';
25
+ import { onCanvasPointer } from '../../shell/canvas-pointer.js';
25
26
 
26
27
  const reducedMotion = () =>
27
28
  typeof window !== 'undefined' &&
@@ -125,7 +126,12 @@ export function TransitionPicker({
125
126
  if (!rootRef.current?.contains(e.target)) onClose?.();
126
127
  };
127
128
  window.addEventListener('pointerdown', onDown, true);
128
- return () => window.removeEventListener('pointerdown', onDown, true);
129
+ // rc3 r4-12 — a press in the canvas closes it too (told over the dgn bridge; it never reaches this document)
130
+ const offCanvas = onCanvasPointer(() => onClose?.());
131
+ return () => {
132
+ window.removeEventListener('pointerdown', onDown, true);
133
+ offCanvas();
134
+ };
129
135
  }, [onClose]);
130
136
 
131
137
  // the slider moves the number on screen; the write waits for the release (a drag would be a write per tick)