@1agh/maude 2.1.0 → 2.1.2
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.
- package/apps/studio/access/request.ts +1 -0
- package/apps/studio/actions/agents.ts +45 -42
- package/apps/studio/actions/defs/app.ts +28 -1
- package/apps/studio/actions/defs/sync.ts +4 -0
- package/apps/studio/actions/verbs.ts +49 -0
- package/apps/studio/actions.manifest.json +162 -20
- package/apps/studio/actions.parity.json +13 -1
- package/apps/studio/ai/create-claim.ts +1 -1
- package/apps/studio/bin/_asset-file.mjs +117 -0
- package/apps/studio/bin/_canvas-file.mjs +146 -0
- package/apps/studio/bin/_curl-local.mjs +7 -4
- package/apps/studio/bin/_footage.mjs +123 -0
- package/apps/studio/bin/_pdf-playwright.mjs +14 -0
- package/apps/studio/bin/_png-playwright.mjs +15 -1
- package/apps/studio/bin/_pw-launch.mjs +98 -0
- package/apps/studio/bin/_retry-save.mjs +49 -0
- package/apps/studio/bin/_sync.mjs +145 -2
- package/apps/studio/bin/asset-rename.sh +12 -0
- package/apps/studio/bin/asset-trash.sh +12 -0
- package/apps/studio/bin/canvas-move.sh +12 -0
- package/apps/studio/bin/canvas-new.sh +12 -0
- package/apps/studio/bin/footage.sh +12 -0
- package/apps/studio/bin/generate.sh +7 -0
- package/apps/studio/bin/retry-save.sh +13 -0
- package/apps/studio/bridge/canvas-mode-store.ts +11 -2
- package/apps/studio/bridge/dgn-protocol.ts +8 -3
- package/apps/studio/bridge/occlusion.ts +45 -0
- package/apps/studio/canvas-theme-pill.tsx +169 -26
- package/apps/studio/client/app.jsx +16 -4
- package/apps/studio/client/export-center.jsx +32 -3
- package/apps/studio/client/home/HomeAccountBanner.jsx +61 -0
- package/apps/studio/client/home/HomeAccountsChip.jsx +404 -0
- package/apps/studio/client/home/HomeConnection.jsx +112 -0
- package/apps/studio/client/home/ProjectRows.jsx +514 -0
- package/apps/studio/client/home/home-accounts-model.js +234 -76
- package/apps/studio/client/home/home-api.js +10 -2
- package/apps/studio/client/home/home-app.jsx +151 -394
- package/apps/studio/client/home/home-icons.jsx +8 -0
- package/apps/studio/client/home/home-model.js +149 -1
- package/apps/studio/client/home/home-where-model.js +105 -0
- package/apps/studio/client/home/home.css +621 -53
- package/apps/studio/client/home/use-account-fix.js +123 -0
- package/apps/studio/client/hooks/use-palette-and-panels.jsx +3 -1
- package/apps/studio/client/hooks/use-tabs.jsx +11 -4
- package/apps/studio/client/panels/TeamProjects.jsx +137 -134
- package/apps/studio/client/share-link.js +12 -0
- package/apps/studio/client/styles/_index.css +4 -0
- package/apps/studio/client/v2/assets/generate-ask.jsx +3 -1
- package/apps/studio/client/v2/diagnostics/diagnostics-host.jsx +1 -0
- package/apps/studio/client/v2/diagnostics/diagnostics-model.js +32 -2
- package/apps/studio/client/v2/diagnostics/diagnostics-sheet.jsx +35 -8
- package/apps/studio/client/v2/diagnostics/diagnostics.css +34 -0
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details-model.js +94 -3
- package/apps/studio/client/v2/diagnostics/sync-details/sync-details.jsx +187 -4
- package/apps/studio/client/v2/export/done-toast.jsx +2 -5
- package/apps/studio/client/v2/export/export-sheet.jsx +9 -2
- package/apps/studio/client/v2/export/export.css +9 -0
- package/apps/studio/client/v2/export/exports-model.js +16 -3
- package/apps/studio/client/v2/export/file-rows.jsx +81 -5
- package/apps/studio/client/v2/export/native-save.js +33 -0
- package/apps/studio/client/v2/export/sections/print-copy.js +3 -0
- package/apps/studio/client/v2/export/sections/print.jsx +37 -20
- package/apps/studio/client/v2/link-server/LinkServerDialog.jsx +492 -0
- package/apps/studio/client/v2/link-server/LinkServerHost.jsx +42 -0
- package/apps/studio/client/v2/link-server/link-server-api.js +142 -0
- package/apps/studio/client/v2/link-server/link-server-model.js +438 -0
- package/apps/studio/client/v2/link-server/link-server.css +109 -0
- package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +31 -86
- package/apps/studio/client/v2/onboarding/onboarding-model.js +1 -18
- package/apps/studio/client/v2/search/search-keywords.js +3 -2
- package/apps/studio/client/v2/settings/account.jsx +4 -2
- package/apps/studio/client/v2/settings/advanced-section.jsx +245 -148
- package/apps/studio/client/v2/settings/connection-row.jsx +3 -59
- package/apps/studio/client/v2/settings/connections-section.jsx +118 -425
- package/apps/studio/client/v2/settings/general-section.jsx +138 -43
- package/apps/studio/client/v2/settings/project-sync-settings.jsx +4 -3
- package/apps/studio/client/v2/settings/reset-section.jsx +14 -3
- package/apps/studio/client/v2/settings/settings-card.jsx +142 -0
- package/apps/studio/client/v2/settings/settings-cards.js +220 -0
- package/apps/studio/client/v2/settings/settings-handlers.js +7 -6
- package/apps/studio/client/v2/settings/settings-model.js +91 -31
- package/apps/studio/client/v2/settings/settings-sheet.jsx +25 -6
- package/apps/studio/client/v2/settings/settings.css +374 -64
- package/apps/studio/client/v2/settings/this-project-card.jsx +730 -0
- package/apps/studio/client/v2/settings/this-project-model.js +172 -0
- package/apps/studio/client/v2/settings/use-connections.js +3 -2
- package/apps/studio/client/v2/settings/use-open-card.js +37 -0
- package/apps/studio/client/v2/shell/connection-state.js +197 -0
- package/apps/studio/client/v2/shell/menu-runner.js +7 -2
- package/apps/studio/client/v2/shell/occlusion-insets.js +37 -9
- package/apps/studio/client/v2/shell/project-account-bus.js +36 -0
- package/apps/studio/client/v2/shell/project-account-card.jsx +357 -148
- package/apps/studio/client/v2/shell/project-account-model.js +272 -149
- package/apps/studio/client/v2/shell/project-account-toast.js +66 -0
- package/apps/studio/client/v2/shell/project-account.css +237 -0
- package/apps/studio/client/v2/shell/share-cluster-host.jsx +166 -83
- package/apps/studio/client/v2/shell/shell-parity.js +3 -2
- package/apps/studio/client/v2/shell/shell-parity.json +40 -26
- package/apps/studio/client/v2/shell/use-account.js +2 -0
- package/apps/studio/client/v2/shell/use-occluded-insets.js +13 -3
- package/apps/studio/client/v2/signin/use-signin.js +1 -1
- package/apps/studio/cloud/endpoints.ts +29 -4
- package/apps/studio/collab/room.ts +21 -7
- package/apps/studio/dist/client.bundle.js +886 -886
- package/apps/studio/dist/comment-mount.js +2 -2
- package/apps/studio/dist/styles.css +1 -1
- package/apps/studio/exporters/ghostscript.ts +78 -1
- package/apps/studio/exporters/pdf-fonts.ts +31 -4
- package/apps/studio/generation/jobs.ts +6 -0
- package/apps/studio/home/accounts.ts +30 -11
- package/apps/studio/home/cloud.ts +6 -1
- package/apps/studio/home/hub-health.ts +76 -0
- package/apps/studio/home/routes.ts +9 -3
- package/apps/studio/http.ts +14 -2
- package/apps/studio/migrate/hub.ts +8 -1
- package/apps/studio/routes/agent.ts +6 -2
- package/apps/studio/routes/hub-link-folder.ts +334 -0
- package/apps/studio/routes/hub-signin.ts +78 -1
- package/apps/studio/routes/index.ts +4 -0
- package/apps/studio/routes/project-undo.ts +10 -0
- package/apps/studio/routes/sync.ts +22 -4
- package/apps/studio/server.ts +25 -0
- package/apps/studio/shell/api-key.ts +11 -0
- package/apps/studio/shell/cli-yield.ts +48 -11
- package/apps/studio/sync/accepted-cold-start.ts +144 -8
- package/apps/studio/sync/action-stage.ts +18 -1
- package/apps/studio/sync/ctl-heal.ts +58 -0
- package/apps/studio/sync/file-ledger.ts +38 -4
- package/apps/studio/sync/file-plane.ts +226 -19
- package/apps/studio/sync/held-deletes.ts +86 -5
- package/apps/studio/sync/hub-link.ts +8 -0
- package/apps/studio/sync/index.ts +68 -4
- package/apps/studio/sync/link-consent.ts +22 -75
- package/apps/studio/sync/link-survey.ts +252 -0
- package/apps/studio/sync/local-kernel.ts +16 -1
- package/apps/studio/sync/seed-progress.ts +12 -0
- package/apps/studio/sync/source-recovery.ts +18 -2
- package/apps/studio/sync/status.ts +11 -1
- package/apps/studio/sync/writer-registry.ts +5 -0
- package/apps/studio/whats-new.json +36 -0
- package/cli/commands/design.mjs +74 -16
- package/cli/lib/bash-guard.mjs +23 -4
- package/cli/lib/confine-read.mjs +2 -0
- package/cli/lib/design-help.gen.mjs +15 -2
- package/cli/lib/design-hook.mjs +1 -1
- package/cli/lib/desktop-locate.mjs +36 -8
- package/cli/lib/studio-locate.mjs +8 -2
- package/cli/lib/sub-verbs.mjs +13 -1
- package/package.json +9 -8
- package/apps/studio/client/home/HomeAccounts.jsx +0 -262
- package/apps/studio/client/v2/onboarding/HubSheet.jsx +0 -212
- package/apps/studio/client/v2/shell/account-card-model.js +0 -114
- package/apps/studio/client/v2/shell/account-card.jsx +0 -189
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// client/home/use-account-fix.js — 2.1.2 HB1: one account's "Sign in again" / "Sign in", shared by the
|
|
2
|
+
// banner on top of Home (artboard 16) and the accounts list behind the chip (artboard 17), so both show
|
|
3
|
+
// the same "Waiting…" and the same plain-words error. Moved here from the 2.1.1 accounts row (B4):
|
|
4
|
+
// cloud-signin Home's own Maude Cloud sign-in for THAT profile (`onCloudSignIn`, home-app drops a
|
|
5
|
+
// dead credential first)
|
|
6
|
+
// hub-signin the team-server sign-in with the address filled in: start → open the browser → poll
|
|
7
|
+
// until the server vouched → `onChanged` (Home reloads)
|
|
8
|
+
// A person's click starts it; nothing here retries on its own.
|
|
9
|
+
|
|
10
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
hubSignInCancel,
|
|
14
|
+
hubSignInPoll,
|
|
15
|
+
hubSignInStart,
|
|
16
|
+
openTeamServerSignIn,
|
|
17
|
+
} from './home-api.js';
|
|
18
|
+
|
|
19
|
+
const POLL_MS = 1200;
|
|
20
|
+
export const SIGNIN_WORDS = Object.freeze({
|
|
21
|
+
unreachable: 'Couldn’t reach that server. Check the address, or whether it’s online.',
|
|
22
|
+
noBrowser: 'The browser didn’t open. Nothing changed — try again.',
|
|
23
|
+
refused: 'That sign-in page can’t be opened from here. Nothing changed.',
|
|
24
|
+
});
|
|
25
|
+
/** The fix button while the browser has the sign-in (short: it sits on a narrow line). */
|
|
26
|
+
export const WAITING_WORD = 'Waiting…';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {{ onCloudSignIn: (card: object) => unknown, onChanged?: () => unknown, pollMs?: number }} in
|
|
30
|
+
* @returns {{ busy: string|null, error: string|null, clearError: () => void,
|
|
31
|
+
* fix: (card: object) => Promise<void> }}
|
|
32
|
+
*/
|
|
33
|
+
export function useAccountFix({ onCloudSignIn, onChanged, pollMs = POLL_MS }) {
|
|
34
|
+
const [busy, setBusy] = useState(null); // the card key whose sign-in waits on the browser
|
|
35
|
+
const [error, setError] = useState(null);
|
|
36
|
+
const attempt = useRef(null); // { id, stop }
|
|
37
|
+
|
|
38
|
+
// leaving Home ends the attempt that waits
|
|
39
|
+
useEffect(
|
|
40
|
+
() => () => {
|
|
41
|
+
const a = attempt.current;
|
|
42
|
+
attempt.current = null;
|
|
43
|
+
if (a) {
|
|
44
|
+
a.stop();
|
|
45
|
+
void hubSignInCancel(a.id);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[]
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
const waitForBrowser = useCallback(
|
|
52
|
+
(id) =>
|
|
53
|
+
new Promise((resolve) => {
|
|
54
|
+
let timer = null;
|
|
55
|
+
const stop = () => {
|
|
56
|
+
clearTimeout(timer);
|
|
57
|
+
resolve({ ok: false, cancelled: true });
|
|
58
|
+
};
|
|
59
|
+
attempt.current = { id, stop };
|
|
60
|
+
const tick = async () => {
|
|
61
|
+
const p = await hubSignInPoll(id);
|
|
62
|
+
if (attempt.current?.id !== id) return;
|
|
63
|
+
if (p.json?.pending) {
|
|
64
|
+
timer = setTimeout(tick, pollMs);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
attempt.current = null;
|
|
68
|
+
resolve(
|
|
69
|
+
p.ok && p.json?.ok
|
|
70
|
+
? { ok: true }
|
|
71
|
+
: { ok: false, error: p.json?.error || SIGNIN_WORDS.unreachable }
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
timer = setTimeout(tick, 0);
|
|
75
|
+
}),
|
|
76
|
+
[pollMs]
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const fixServer = useCallback(
|
|
80
|
+
async (card) => {
|
|
81
|
+
setError(null);
|
|
82
|
+
setBusy(card.key);
|
|
83
|
+
const s = await hubSignInStart(card.fix.profile, card.fix.url);
|
|
84
|
+
if (!s.ok || !s.json?.ok) {
|
|
85
|
+
setBusy(null);
|
|
86
|
+
setError(s.json?.error || SIGNIN_WORDS.unreachable);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const id = s.json.id;
|
|
90
|
+
const opened = await openTeamServerSignIn(s.json.signInUrl);
|
|
91
|
+
if (opened !== 'ok') {
|
|
92
|
+
void hubSignInCancel(id);
|
|
93
|
+
setBusy(null);
|
|
94
|
+
setError(opened === 'refused' ? SIGNIN_WORDS.refused : SIGNIN_WORDS.noBrowser);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const done = await waitForBrowser(id);
|
|
98
|
+
setBusy(null);
|
|
99
|
+
if (done.cancelled) return;
|
|
100
|
+
if (!done.ok) {
|
|
101
|
+
setError(done.error);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
await onChanged?.();
|
|
105
|
+
},
|
|
106
|
+
[onChanged, waitForBrowser]
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const fix = useCallback(
|
|
110
|
+
async (card) => {
|
|
111
|
+
if (!card?.fix || busy) return;
|
|
112
|
+
if (card.fix.path === 'cloud-signin') {
|
|
113
|
+
setError(null);
|
|
114
|
+
await onCloudSignIn(card);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
await fixServer(card);
|
|
118
|
+
},
|
|
119
|
+
[busy, onCloudSignIn, fixServer]
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
return { busy, error, clearError: () => setError(null), fix };
|
|
123
|
+
}
|
|
@@ -28,6 +28,7 @@ import { useLayersTreeRequest } from '../v2/layers/layers-request.js';
|
|
|
28
28
|
import { bindPaletteEnv, sendToAskAI } from '../v2/search/search-env.js';
|
|
29
29
|
import { desktopProjectsEnv } from '../v2/search/search-projects.js';
|
|
30
30
|
import { actionSearchRows, settingsSearchRows } from '../v2/search/search-model.js';
|
|
31
|
+
import { settingsTarget } from '../v2/settings/settings-cards.js';
|
|
31
32
|
import { isNativeApp, onMenuAction } from '../github.js';
|
|
32
33
|
import { DOCK_PANELS, PANEL_SIDES_DEFAULTS } from '../shell/dock.jsx';
|
|
33
34
|
import { EMPTY_GROUPS, SYSTEM_TAB } from '../shell/constants.js';
|
|
@@ -439,7 +440,8 @@ export function usePaletteAndPanels({
|
|
|
439
440
|
...settingsSearchRows({
|
|
440
441
|
cloud: cfg.cloud,
|
|
441
442
|
readOnly: viewerMode,
|
|
442
|
-
|
|
443
|
+
// 2.1.1 T6: the tab AND the card that holds the row ("advanced#privacy"), so a closed card opens
|
|
444
|
+
run: (section, row) => setSettingsOpen(settingsTarget(section, row)),
|
|
443
445
|
}),
|
|
444
446
|
// S10.13 — the Design system and everything in it by name (a converted system opens its canvas, an
|
|
445
447
|
// older one its v1 view)
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
4
|
import { CANVAS_EXT_RE, SYSTEM_TAB } from '../shell/constants.js';
|
|
5
5
|
import { remapDirPrefix, revealPath } from '../tree-expansion.js';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
buildShareLinks,
|
|
8
|
+
normalizeOpenPath,
|
|
9
|
+
readOpenParam,
|
|
10
|
+
shareTargetFor,
|
|
11
|
+
withOpenParam,
|
|
12
|
+
} from '../share-link.js';
|
|
7
13
|
import { basename, displayName, previewKind, shellToast } from '../shell/util.js';
|
|
8
14
|
import { assembleVideoFlow } from '../v2/timeline/assemble-video.js';
|
|
9
15
|
import { notify } from '../../notifications.tsx';
|
|
@@ -205,9 +211,10 @@ export function useTabs({
|
|
|
205
211
|
localUrl: location.origin,
|
|
206
212
|
readOnly: !!cfg.readOnly,
|
|
207
213
|
});
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
214
|
+
// `{ project: true }` (Move to Maude Cloud, Connect): the project's sheet when no canvas is open
|
|
215
|
+
const showShare = (path = sharePath, opts) => {
|
|
216
|
+
const target = shareTargetFor(path, cfg.designRel, opts);
|
|
217
|
+
if (target) setShareDialog(target);
|
|
211
218
|
};
|
|
212
219
|
|
|
213
220
|
// Retry from the #115 error panel: re-read /_config FIRST (the stale
|
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
openTeamServerSignIn,
|
|
34
34
|
} from '../github.js';
|
|
35
35
|
import { reasonProps } from '../v2/access/disabled-reason.js';
|
|
36
|
+
import { projectLinkApi } from '../v2/link-server/link-server-api.js';
|
|
37
|
+
import { LinkServerDialog } from '../v2/link-server/LinkServerDialog.jsx';
|
|
36
38
|
import { SIGNIN_WORDS } from '../v2/signin/signin-model.js';
|
|
37
39
|
|
|
38
40
|
const api = async (path, init) => {
|
|
@@ -149,10 +151,9 @@ function ErrorLine({ text }) {
|
|
|
149
151
|
);
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
export default function TeamProjects({ variant = 'door', initialServer = '', serverOnly = false }) {
|
|
154
|
+
// 2.1.1 T5: Settings' “Add a team server…” (the old `serverOnly` form) is the one "Link your server" dialog
|
|
155
|
+
// now (v2/link-server/) — `TeamProjectsDialog serverOnly` hands over to it below.
|
|
156
|
+
export default function TeamProjects({ variant = 'door', initialServer = '' }) {
|
|
156
157
|
const [recents, setRecents] = useState(null);
|
|
157
158
|
const [cloud, setCloud] = useState({
|
|
158
159
|
state: 'loading',
|
|
@@ -367,7 +368,7 @@ export default function TeamProjects({ variant = 'door', initialServer = '', ser
|
|
|
367
368
|
</div>
|
|
368
369
|
)}
|
|
369
370
|
|
|
370
|
-
{
|
|
371
|
+
{recents && recents.length > 0 && (
|
|
371
372
|
<section className="tp-section" aria-label="Recent team projects">
|
|
372
373
|
<div className="ob-section-label">On this computer</div>
|
|
373
374
|
<div className="ob-repolist">
|
|
@@ -405,142 +406,140 @@ export default function TeamProjects({ variant = 'door', initialServer = '', ser
|
|
|
405
406
|
</section>
|
|
406
407
|
)}
|
|
407
408
|
|
|
408
|
-
|
|
409
|
-
<
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
>
|
|
419
|
-
<
|
|
420
|
-
|
|
409
|
+
<section className="tp-section" aria-label="Maude Cloud">
|
|
410
|
+
<div className="ob-section-label">Maude Cloud</div>
|
|
411
|
+
{cloud.state === 'loading' && <div className="ob-foot-note">Checking your sign-in…</div>}
|
|
412
|
+
{cloud.state === 'out' && !device && (
|
|
413
|
+
<button
|
|
414
|
+
type="button"
|
|
415
|
+
className="ob-repo"
|
|
416
|
+
onClick={startCloudSignIn}
|
|
417
|
+
data-testid="team-cloud-signin"
|
|
418
|
+
>
|
|
419
|
+
<span className="ob-repo-icon">
|
|
420
|
+
<Spark size={15} />
|
|
421
|
+
</span>
|
|
422
|
+
<span className="ob-repo-tx">
|
|
423
|
+
<span className="ob-repo-name">Sign in to Maude Cloud</span>
|
|
424
|
+
<span className="ob-repo-meta">See the projects you were invited to</span>
|
|
425
|
+
</span>
|
|
426
|
+
<span className="ob-repo-go">
|
|
427
|
+
<Icon name="arrow-right" size={15} /> Sign in
|
|
428
|
+
</span>
|
|
429
|
+
</button>
|
|
430
|
+
)}
|
|
431
|
+
{device && (
|
|
432
|
+
<div className="tp-device" data-testid="team-cloud-device">
|
|
433
|
+
<span className="ob-field-label">{SIGNIN_WORDS.codeCheck}</span>
|
|
434
|
+
<div className="gi-code">
|
|
435
|
+
<span className="gi-code-val" data-testid="team-cloud-code">
|
|
436
|
+
{device.userCode}
|
|
421
437
|
</span>
|
|
422
|
-
<
|
|
423
|
-
|
|
424
|
-
|
|
438
|
+
<button
|
|
439
|
+
type="button"
|
|
440
|
+
className="btn btn--ghost gi-code-copy"
|
|
441
|
+
onClick={() =>
|
|
442
|
+
navigator.clipboard?.writeText(device.userCode).then(
|
|
443
|
+
() => {
|
|
444
|
+
setCopied(true);
|
|
445
|
+
setTimeout(() => setCopied(false), 1500);
|
|
446
|
+
},
|
|
447
|
+
() => {}
|
|
448
|
+
)
|
|
449
|
+
}
|
|
450
|
+
aria-label="Copy the code"
|
|
451
|
+
>
|
|
452
|
+
<Icon name="copy" size={15} /> {copied ? 'Copied' : 'Copy'}
|
|
453
|
+
</button>
|
|
454
|
+
</div>
|
|
455
|
+
{device.verificationUrl && isDisplayableUrl(device.verificationUrl, cloud.url) && (
|
|
456
|
+
<span className="ob-foot-note">
|
|
457
|
+
If your browser didn’t open, go to{' '}
|
|
458
|
+
<span className="gi-dc-url">{device.verificationUrl}</span>
|
|
425
459
|
</span>
|
|
426
|
-
|
|
427
|
-
|
|
460
|
+
)}
|
|
461
|
+
<div className="ob-form-actions">
|
|
462
|
+
<span className="gi-dc-status" aria-live="polite">
|
|
463
|
+
<span className="gi-pulse" aria-hidden="true" /> Waiting for you to confirm…
|
|
428
464
|
</span>
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
<div className="tp-device" data-testid="team-cloud-device">
|
|
433
|
-
<span className="ob-field-label">{SIGNIN_WORDS.codeCheck}</span>
|
|
434
|
-
<div className="gi-code">
|
|
435
|
-
<span className="gi-code-val" data-testid="team-cloud-code">
|
|
436
|
-
{device.userCode}
|
|
437
|
-
</span>
|
|
438
|
-
<button
|
|
439
|
-
type="button"
|
|
440
|
-
className="btn btn--ghost gi-code-copy"
|
|
441
|
-
onClick={() =>
|
|
442
|
-
navigator.clipboard?.writeText(device.userCode).then(
|
|
443
|
-
() => {
|
|
444
|
-
setCopied(true);
|
|
445
|
-
setTimeout(() => setCopied(false), 1500);
|
|
446
|
-
},
|
|
447
|
-
() => {}
|
|
448
|
-
)
|
|
449
|
-
}
|
|
450
|
-
aria-label="Copy the code"
|
|
451
|
-
>
|
|
452
|
-
<Icon name="copy" size={15} /> {copied ? 'Copied' : 'Copy'}
|
|
453
|
-
</button>
|
|
454
|
-
</div>
|
|
455
|
-
{device.verificationUrl && isDisplayableUrl(device.verificationUrl, cloud.url) && (
|
|
456
|
-
<span className="ob-foot-note">
|
|
457
|
-
If your browser didn’t open, go to{' '}
|
|
458
|
-
<span className="gi-dc-url">{device.verificationUrl}</span>
|
|
459
|
-
</span>
|
|
460
|
-
)}
|
|
461
|
-
<div className="ob-form-actions">
|
|
462
|
-
<span className="gi-dc-status" aria-live="polite">
|
|
463
|
-
<span className="gi-pulse" aria-hidden="true" /> Waiting for you to confirm…
|
|
464
|
-
</span>
|
|
465
|
-
<button type="button" className="btn btn--ghost" onClick={cancelCloudSignIn}>
|
|
466
|
-
Cancel
|
|
467
|
-
</button>
|
|
468
|
-
</div>
|
|
465
|
+
<button type="button" className="btn btn--ghost" onClick={cancelCloudSignIn}>
|
|
466
|
+
Cancel
|
|
467
|
+
</button>
|
|
469
468
|
</div>
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
<button
|
|
487
|
-
type="button"
|
|
488
|
-
key={p.id}
|
|
489
|
-
className="ob-repo"
|
|
490
|
-
onClick={() => openExternal(shareViewUrl(p.url, p.id))}
|
|
491
|
-
data-testid={`team-cloud-project-${p.id}`}
|
|
492
|
-
title="Viewing works in the browser. Editing in the app needs the member role — ask whoever runs the project."
|
|
493
|
-
>
|
|
494
|
-
<span className="ob-repo-icon">
|
|
495
|
-
<Icon name="globe" size={15} />
|
|
496
|
-
</span>
|
|
497
|
-
<span className="ob-repo-tx">
|
|
498
|
-
<span className="ob-repo-name">{p.name || p.id}</span>
|
|
499
|
-
<span className="ob-repo-meta">viewer · opens in your browser</span>
|
|
500
|
-
</span>
|
|
501
|
-
<span className="ob-repo-go">
|
|
502
|
-
<Icon name="external" size={15} /> View
|
|
503
|
-
</span>
|
|
504
|
-
</button>
|
|
505
|
-
);
|
|
506
|
-
}
|
|
469
|
+
</div>
|
|
470
|
+
)}
|
|
471
|
+
{cloud.state === 'in' && (
|
|
472
|
+
<>
|
|
473
|
+
{projects === null && <div className="ob-foot-note">Loading your projects…</div>}
|
|
474
|
+
{Array.isArray(projects) && projects.length === 0 && (
|
|
475
|
+
<div className="ob-foot-note" data-testid="team-cloud-empty">
|
|
476
|
+
You aren’t in any project yet. Ask whoever runs your team’s project to invite{' '}
|
|
477
|
+
{cloud.email || 'you'}.
|
|
478
|
+
</div>
|
|
479
|
+
)}
|
|
480
|
+
{Array.isArray(projects) && projects.length > 0 && (
|
|
481
|
+
<div className="ob-repolist">
|
|
482
|
+
{projects.map((p) => {
|
|
483
|
+
const k = `cloud:${p.id}`;
|
|
484
|
+
if (p.role === 'viewer') {
|
|
507
485
|
return (
|
|
508
486
|
<button
|
|
509
487
|
type="button"
|
|
510
488
|
key={p.id}
|
|
511
489
|
className="ob-repo"
|
|
512
|
-
|
|
513
|
-
onClick={() => openCloud(p)}
|
|
490
|
+
onClick={() => openExternal(shareViewUrl(p.url, p.id))}
|
|
514
491
|
data-testid={`team-cloud-project-${p.id}`}
|
|
492
|
+
title="Viewing works in the browser. Editing in the app needs the member role — ask whoever runs the project."
|
|
515
493
|
>
|
|
516
494
|
<span className="ob-repo-icon">
|
|
517
|
-
<
|
|
495
|
+
<Icon name="globe" size={15} />
|
|
518
496
|
</span>
|
|
519
497
|
<span className="ob-repo-tx">
|
|
520
498
|
<span className="ob-repo-name">{p.name || p.id}</span>
|
|
521
|
-
<span className="ob-repo-meta">
|
|
522
|
-
{p.role}
|
|
523
|
-
{p.stateLabel ? ` · ${p.stateLabel}` : ''}
|
|
524
|
-
</span>
|
|
499
|
+
<span className="ob-repo-meta">viewer · opens in your browser</span>
|
|
525
500
|
</span>
|
|
526
501
|
<span className="ob-repo-go">
|
|
527
|
-
|
|
528
|
-
<Icon name="spinner" size={16} className="ob-spin" />
|
|
529
|
-
) : (
|
|
530
|
-
<>
|
|
531
|
-
<Icon name="arrow-right" size={15} /> Open
|
|
532
|
-
</>
|
|
533
|
-
)}
|
|
502
|
+
<Icon name="external" size={15} /> View
|
|
534
503
|
</span>
|
|
535
504
|
</button>
|
|
536
505
|
);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
506
|
+
}
|
|
507
|
+
return (
|
|
508
|
+
<button
|
|
509
|
+
type="button"
|
|
510
|
+
key={p.id}
|
|
511
|
+
className="ob-repo"
|
|
512
|
+
disabled={!!busy}
|
|
513
|
+
onClick={() => openCloud(p)}
|
|
514
|
+
data-testid={`team-cloud-project-${p.id}`}
|
|
515
|
+
>
|
|
516
|
+
<span className="ob-repo-icon">
|
|
517
|
+
<Spark size={15} />
|
|
518
|
+
</span>
|
|
519
|
+
<span className="ob-repo-tx">
|
|
520
|
+
<span className="ob-repo-name">{p.name || p.id}</span>
|
|
521
|
+
<span className="ob-repo-meta">
|
|
522
|
+
{p.role}
|
|
523
|
+
{p.stateLabel ? ` · ${p.stateLabel}` : ''}
|
|
524
|
+
</span>
|
|
525
|
+
</span>
|
|
526
|
+
<span className="ob-repo-go">
|
|
527
|
+
{busy === k ? (
|
|
528
|
+
<Icon name="spinner" size={16} className="ob-spin" />
|
|
529
|
+
) : (
|
|
530
|
+
<>
|
|
531
|
+
<Icon name="arrow-right" size={15} /> Open
|
|
532
|
+
</>
|
|
533
|
+
)}
|
|
534
|
+
</span>
|
|
535
|
+
</button>
|
|
536
|
+
);
|
|
537
|
+
})}
|
|
538
|
+
</div>
|
|
539
|
+
)}
|
|
540
|
+
</>
|
|
541
|
+
)}
|
|
542
|
+
</section>
|
|
544
543
|
|
|
545
544
|
<section className="tp-section" aria-label="Your team's server">
|
|
546
545
|
<div className="ob-section-label">Your team’s own server</div>
|
|
@@ -622,13 +621,21 @@ export default function TeamProjects({ variant = 'door', initialServer = '', ser
|
|
|
622
621
|
);
|
|
623
622
|
}
|
|
624
623
|
|
|
625
|
-
/** The same picker as a dialog — from the project switcher.
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
}
|
|
624
|
+
/** The same picker as a dialog — from the project switcher. `serverOnly` (Settings' “Add a team server…”)
|
|
625
|
+
* is the one "Link your server" dialog since 2.1.1 T5. */
|
|
626
|
+
export function TeamProjectsDialog(props) {
|
|
627
|
+
if (props.serverOnly)
|
|
628
|
+
return (
|
|
629
|
+
<LinkServerDialog
|
|
630
|
+
api={projectLinkApi()}
|
|
631
|
+
initialUrl={props.initialServer || ''}
|
|
632
|
+
onClose={props.onClose}
|
|
633
|
+
/>
|
|
634
|
+
);
|
|
635
|
+
return <TeamProjectsPicker {...props} />;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function TeamProjectsPicker({ onClose, initialServer = '', title = 'Open a team project' }) {
|
|
632
639
|
const ref = useRef(null);
|
|
633
640
|
useEffect(() => {
|
|
634
641
|
const prev = document.activeElement;
|
|
@@ -649,11 +656,7 @@ export function TeamProjectsDialog({
|
|
|
649
656
|
<div className="tp-dialog-head">
|
|
650
657
|
<div>
|
|
651
658
|
<h2 id="tp-dialog-title">{title}</h2>
|
|
652
|
-
<p>
|
|
653
|
-
{serverOnly
|
|
654
|
-
? 'Sign in to your team’s own server. Its projects open in their own copy on this computer.'
|
|
655
|
-
: 'Projects you were added to open in their own copy on this computer.'}
|
|
656
|
-
</p>
|
|
659
|
+
<p>Projects you were added to open in their own copy on this computer.</p>
|
|
657
660
|
</div>
|
|
658
661
|
<button
|
|
659
662
|
type="button"
|
|
@@ -665,7 +668,7 @@ export function TeamProjectsDialog({
|
|
|
665
668
|
<Icon name="x" size={14} />
|
|
666
669
|
</button>
|
|
667
670
|
</div>
|
|
668
|
-
<TeamProjects variant="dialog" initialServer={initialServer}
|
|
671
|
+
<TeamProjects variant="dialog" initialServer={initialServer} />
|
|
669
672
|
</div>
|
|
670
673
|
</div>
|
|
671
674
|
);
|
|
@@ -14,6 +14,18 @@ export function normalizeOpenPath(raw, designRel = '.design') {
|
|
|
14
14
|
return rel.split('/').some((s) => s === '' || s === '.' || s === '..') ? null : rel;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* What the Share sheet opens on: the canvas at `path`, or — with no canvas — nothing, unless the ask is about the
|
|
19
|
+
* PROJECT (`{ project: true }`: Move to Maude Cloud, Connect), which gets the project's own sheet (2.1.1 T7: from
|
|
20
|
+
* Diagnostics › Sync with no canvas open, "Create project on Maude Cloud" did nothing).
|
|
21
|
+
* @returns {{ path: string, rel: string|null, label: string } | null}
|
|
22
|
+
*/
|
|
23
|
+
export function shareTargetFor(path, designRel = '.design', opts = {}) {
|
|
24
|
+
const rel = normalizeOpenPath(path, designRel);
|
|
25
|
+
if (rel) return { path, rel, label: path.split('/').pop() || path };
|
|
26
|
+
return opts?.project ? { path: '', rel: null, label: '' } : null;
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
/** Decode a URL value exactly once, then validate. */
|
|
18
30
|
export function normalizeOpenParam(raw, designRel = '.design') {
|
|
19
31
|
if (typeof raw !== 'string') return null;
|
|
@@ -64,6 +64,8 @@
|
|
|
64
64
|
@import url("../v2/present/video-present.css");
|
|
65
65
|
/* V2-4.3a — the Share cluster, top-right. */
|
|
66
66
|
@import url("../v2/shell/share-cluster.css");
|
|
67
|
+
/* 2.1.1 T2/T4 — the account chip face, the avatar menu and Switch account. */
|
|
68
|
+
@import url("../v2/shell/project-account.css");
|
|
67
69
|
/* S3.9 - Preview's own islands: the PreviewBar and the zoom readout. */
|
|
68
70
|
@import url("../v2/preview/preview.css");
|
|
69
71
|
/* S8.2 — the Export sheet (client/v2/export/). */
|
|
@@ -184,6 +186,8 @@
|
|
|
184
186
|
@import url("../v2/signin/signin.css");
|
|
185
187
|
/* S6.9 — the five Advanced sheets: hub, folder or GitHub, Connect AI, the maude command, Figma (client/v2/onboarding/). */
|
|
186
188
|
@import url("../v2/onboarding/onboarding.css");
|
|
189
|
+
/* 2.1.1 T5 — the one "Link your server" dialog (client/v2/link-server/). */
|
|
190
|
+
@import url("../v2/link-server/link-server.css");
|
|
187
191
|
@import url("./5-utilities.css");
|
|
188
192
|
/* S3.7a — the Present follower page (follow bar, Live, watching; the audience window has no chrome). */
|
|
189
193
|
@import url("../v2/present/follow.css");
|
|
@@ -25,7 +25,9 @@ const POLL_LIMIT_MS = 10 * 60 * 1000;
|
|
|
25
25
|
const KEY_POLL_MS = 2000;
|
|
26
26
|
const KEY_WAIT_LIMIT_MS = 10 * 60 * 1000;
|
|
27
27
|
// The provider the key sheet names ("Connect a Google key?"). A key that lands is only ever quoted on this one.
|
|
28
|
-
|
|
28
|
+
// The registry id of Google's adapter (generation/adapters/gemini.ts) — 'google' named no provider, so the waiting
|
|
29
|
+
// prompt never saw a key added in Settings (#218; test/218-key-sheet-provider.test.ts).
|
|
30
|
+
export const SHEET_PROVIDER = 'gemini';
|
|
29
31
|
|
|
30
32
|
export const ASK_WORDS = {
|
|
31
33
|
title: 'Generate an image',
|
|
@@ -185,6 +185,7 @@ export default function DiagnosticsHost({ toast }) {
|
|
|
185
185
|
cloud: cfg?.cloud ?? null,
|
|
186
186
|
groupPaths: (groups || []).map((g) => g.path).filter(Boolean),
|
|
187
187
|
names: canvasNamesBySlug(groups),
|
|
188
|
+
designRel: cfg?.designRel,
|
|
188
189
|
behind: gitStatus?.behind || 0,
|
|
189
190
|
onGetLatest: gitGetLatest,
|
|
190
191
|
resync,
|
|
@@ -13,11 +13,11 @@ import { syncPresentation } from '../../../sync/presentation.ts';
|
|
|
13
13
|
export const STATUS_IDS = Object.freeze(['diag.sync', 'diag.server', 'diag.ai']);
|
|
14
14
|
export const VALUE_IDS = Object.freeze(['diag.address', 'diag.process', 'diag.project-folder']);
|
|
15
15
|
|
|
16
|
-
/** Sync: one word. A solo project
|
|
16
|
+
/** Sync: one word. A solo project is "Only on this Mac" (a neutral word, not a problem; canvas 17). */
|
|
17
17
|
export function syncWord(syncStatus, { project, aiHeld = false } = {}) {
|
|
18
18
|
if (aiHeld) return { word: 'Needs you', tone: 'warn' };
|
|
19
19
|
const p = syncPresentation(syncStatus, { project });
|
|
20
|
-
if (!p) return { word: '
|
|
20
|
+
if (!p) return { word: 'Only on this Mac', tone: 'neutral' };
|
|
21
21
|
switch (p.phase) {
|
|
22
22
|
case 'synced':
|
|
23
23
|
return { word: 'Up to date', tone: 'ok' };
|
|
@@ -40,6 +40,36 @@ export function syncWord(syncStatus, { project, aiHeld = false } = {}) {
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* 2.1.1 T3 — Sync on a project only on this Mac (canvas 17 ac-sync): the next step, not a dead end. Two
|
|
45
|
+
* ways out, the same two as the avatar menu: Maude Cloud (the existing move, `share.move-to-cloud` → the
|
|
46
|
+
* Share sheet's Move to Maude Cloud) and your own server (`account.link-server` → the one dialog). Both
|
|
47
|
+
* are the Mac app's (the move answers only the desktop window), so a browser tab gets words, no buttons.
|
|
48
|
+
*/
|
|
49
|
+
export function soloSync({ native = false, folder = '' } = {}) {
|
|
50
|
+
const at = typeof folder === 'string' && folder ? tilde(folder) : '';
|
|
51
|
+
return {
|
|
52
|
+
title: 'Only on this Mac',
|
|
53
|
+
body: 'Nothing leaves this Mac yet. Put it on Maude Cloud to open it from any Mac and share it — or sync it with your own server.',
|
|
54
|
+
actions: native
|
|
55
|
+
? [
|
|
56
|
+
{
|
|
57
|
+
id: 'share.move-to-cloud',
|
|
58
|
+
label: 'Create project on Maude Cloud',
|
|
59
|
+
primary: true,
|
|
60
|
+
testid: 'diag-sync-to-cloud',
|
|
61
|
+
},
|
|
62
|
+
{ id: 'account.link-server', label: 'Link your server', testid: 'diag-sync-link-server' },
|
|
63
|
+
]
|
|
64
|
+
: [],
|
|
65
|
+
fine: !native
|
|
66
|
+
? 'Open this project in the Maude app to put it on Maude Cloud or link your server.'
|
|
67
|
+
: at
|
|
68
|
+
? `It stays in ${at} either way.`
|
|
69
|
+
: 'It stays on this Mac either way.',
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
43
73
|
/**
|
|
44
74
|
* Server: the studio answers (this page is served by it); the socket says whether it is live. In a cloud tab
|
|
45
75
|
* there is no process of yours to name — the server is the cloud's (S11.15, 06 · ad-edge-where).
|