@1agh/maude 2.1.1 → 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/actions/agents.ts +18 -42
- package/apps/studio/actions/verbs.ts +49 -0
- package/apps/studio/actions.manifest.json +103 -19
- 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/_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/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 +4 -3
- package/apps/studio/client/home/ProjectRows.jsx +514 -0
- package/apps/studio/client/home/home-accounts-model.js +148 -99
- package/apps/studio/client/home/home-api.js +4 -0
- package/apps/studio/client/home/home-app.jsx +127 -432
- package/apps/studio/client/home/home-icons.jsx +8 -0
- package/apps/studio/client/home/home-model.js +109 -0
- package/apps/studio/client/home/home.css +447 -111
- package/apps/studio/client/home/use-account-fix.js +123 -0
- package/apps/studio/client/v2/assets/generate-ask.jsx +3 -1
- 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/shell/occlusion-insets.js +37 -9
- package/apps/studio/client/v2/shell/use-occluded-insets.js +13 -3
- package/apps/studio/collab/room.ts +21 -7
- package/apps/studio/dist/client.bundle.js +692 -692
- 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/http.ts +6 -2
- package/apps/studio/routes/agent.ts +6 -2
- package/apps/studio/routes/project-undo.ts +10 -0
- package/apps/studio/server.ts +25 -0
- package/apps/studio/shell/cli-yield.ts +48 -11
- package/apps/studio/whats-new.json +18 -0
- package/cli/commands/design.mjs +74 -16
- package/cli/lib/bash-guard.mjs +4 -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 +8 -8
- package/apps/studio/client/home/HomeAccounts.jsx +0 -262
- package/apps/studio/client/home/HomeAccountsRow.jsx +0 -221
|
@@ -103,7 +103,14 @@ export function useExportCenter({ enabled = true } = {}) {
|
|
|
103
103
|
startToastShownRef.current.add(job.id);
|
|
104
104
|
hydratedRef.current.add(job.id);
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
// Merge, never replace: a live push that landed while this GET was in flight is newer than the
|
|
107
|
+
// snapshot, and replacing the map dropped it — its row, its toast and its save (fix-bulk B5).
|
|
108
|
+
setJobs((prev) => {
|
|
109
|
+
if (prev.size === 0) return m;
|
|
110
|
+
const next = new Map(m);
|
|
111
|
+
for (const [id, live] of prev) next.set(id, live);
|
|
112
|
+
return next;
|
|
113
|
+
});
|
|
107
114
|
})
|
|
108
115
|
.catch(() => {
|
|
109
116
|
/* offline / restart — the badge just stays empty until a push arrives */
|
|
@@ -359,18 +366,40 @@ export function useExportCenter({ enabled = true } = {}) {
|
|
|
359
366
|
|
|
360
367
|
// A spec that names where to save (Downloads, or the remembered folder) saves itself on this Mac the
|
|
361
368
|
// moment it is done — no dialog. Any other waits for Show in Finder, which asks once.
|
|
369
|
+
//
|
|
370
|
+
// fix-bulk B5 — a done job must always reach its folder. This ran only on a `jobs` change, and skipped a job
|
|
371
|
+
// that finished while the window was in the background, so a long Print PDF the person waited for in Finder
|
|
372
|
+
// was never saved and its bytes were later swept. Now: Downloads never shows a panel, so it saves whenever this
|
|
373
|
+
// tab is the visible one; the remembered folder may have to ask once, so it waits for the window — and both are
|
|
374
|
+
// tried again each time the window comes back (`comeBack`).
|
|
375
|
+
const [comeBack, setComeBack] = useState(0);
|
|
376
|
+
useEffect(() => {
|
|
377
|
+
if (!isNativeApp()) return undefined;
|
|
378
|
+
const again = () => {
|
|
379
|
+
if (document.visibilityState !== 'hidden') setComeBack((n) => n + 1);
|
|
380
|
+
};
|
|
381
|
+
window.addEventListener('focus', again);
|
|
382
|
+
document.addEventListener('visibilitychange', again);
|
|
383
|
+
return () => {
|
|
384
|
+
window.removeEventListener('focus', again);
|
|
385
|
+
document.removeEventListener('visibilitychange', again);
|
|
386
|
+
};
|
|
387
|
+
}, []);
|
|
362
388
|
useEffect(() => {
|
|
363
389
|
if (!isNativeApp()) return;
|
|
390
|
+
void comeBack;
|
|
391
|
+
if (document.visibilityState === 'hidden') return; // a background tab: the shell refuses its save
|
|
364
392
|
for (const job of jobs.values()) {
|
|
365
393
|
if (job.status !== 'done' || !job.filename || job.deliveredInBrowser) continue;
|
|
366
394
|
const to = job.spec?.options?.saveTo;
|
|
367
395
|
if (to !== 'downloads' && to !== 'remembered') continue;
|
|
368
396
|
if (hydratedRef.current.has(job.id) || autoSavedRef.current.has(job.id)) continue;
|
|
369
|
-
if (finalizedRef.current.has(job.id)
|
|
397
|
+
if (finalizedRef.current.has(job.id)) continue;
|
|
398
|
+
if (to === 'remembered' && !document.hasFocus()) continue;
|
|
370
399
|
autoSavedRef.current.add(job.id);
|
|
371
400
|
void save(job);
|
|
372
401
|
}
|
|
373
|
-
}, [jobs, save]);
|
|
402
|
+
}, [jobs, save, comeBack]);
|
|
374
403
|
|
|
375
404
|
const toastJobId = panelOpen ? null : (toastQueue[0] ?? null);
|
|
376
405
|
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// client/home/HomeAccountBanner.jsx — 2.1.2 HB1 (canvas 17, artboard 16): the one banner on top of Home,
|
|
2
|
+
// only for a sign-in the person can fix. One problem: what broke, which projects' changes wait on this
|
|
3
|
+
// Mac, and the line's own fix (Sign in again / Sign in, `useAccountFix` — the same attempt the accounts
|
|
4
|
+
// list shows). Two or more: "2 sign-ins stopped working" and Review, which opens the accounts list. A
|
|
5
|
+
// server that does not answer never raises it (`homeAccountBanner`).
|
|
6
|
+
|
|
7
|
+
import { BrokenLink } from './HomeConnection.jsx';
|
|
8
|
+
import { WAITING_WORD } from './use-account-fix.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {{ banner: ReturnType<typeof import('./home-accounts-model.js').homeAccountBanner>,
|
|
12
|
+
* native: boolean, fixer: { busy: string|null, error: string|null,
|
|
13
|
+
* fix: (card: object) => unknown }, onReview: () => void }} props
|
|
14
|
+
*/
|
|
15
|
+
export function HomeAccountBanner({ banner, native, fixer, onReview }) {
|
|
16
|
+
if (!banner) return null;
|
|
17
|
+
const one = banner.kind === 'one';
|
|
18
|
+
const waiting = one && fixer.busy === banner.card.key;
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
className="home-acb"
|
|
22
|
+
role="alert"
|
|
23
|
+
data-kind={banner.kind}
|
|
24
|
+
data-testid="home-account-banner"
|
|
25
|
+
>
|
|
26
|
+
<span className="home-acb-ic" aria-hidden="true">
|
|
27
|
+
<BrokenLink size={12} />
|
|
28
|
+
</span>
|
|
29
|
+
<span className="home-acb-t">
|
|
30
|
+
<strong>{banner.title}</strong>
|
|
31
|
+
{banner.body ? <span>{banner.body}</span> : null}
|
|
32
|
+
{one && fixer.error ? (
|
|
33
|
+
<span className="home-acb-err" data-testid="home-account-banner-error">
|
|
34
|
+
{fixer.error}
|
|
35
|
+
</span>
|
|
36
|
+
) : null}
|
|
37
|
+
</span>
|
|
38
|
+
{one ? (
|
|
39
|
+
<button
|
|
40
|
+
type="button"
|
|
41
|
+
className="btn btn--primary btn--sm"
|
|
42
|
+
data-testid="home-account-banner-fix"
|
|
43
|
+
disabled={!native || waiting}
|
|
44
|
+
title={native ? undefined : 'Sign in from the Maude app on your Mac.'}
|
|
45
|
+
onClick={() => fixer.fix(banner.card)}
|
|
46
|
+
>
|
|
47
|
+
{waiting ? WAITING_WORD : banner.action}
|
|
48
|
+
</button>
|
|
49
|
+
) : (
|
|
50
|
+
<button
|
|
51
|
+
type="button"
|
|
52
|
+
className="btn btn--primary btn--sm"
|
|
53
|
+
data-testid="home-account-banner-review"
|
|
54
|
+
onClick={onReview}
|
|
55
|
+
>
|
|
56
|
+
{banner.action}
|
|
57
|
+
</button>
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
// client/home/HomeAccountsChip.jsx — 2.1.2 HB1 (canvas 17, artboards 15, 17, 18): accounts leave Home's
|
|
2
|
+
// main surface. One chip at the top right — "3 accounts", plus a dot and "1 needs sign-in" while a
|
|
3
|
+
// sign-in is missing or stopped working — opens "Accounts on this Mac": one line per account (its
|
|
4
|
+
// e-mail or host, where it is, how many projects, its state only when it isn't fine), the fix on the
|
|
5
|
+
// line that broke (Sign in / Sign in again, `useAccountFix`), Sign out… and GitHub in its "…", the old
|
|
6
|
+
// servers folded at the foot (no answer, no project) with Forget… per server and Forget all, each
|
|
7
|
+
// behind a question, and Add an account…. Forget only removes the saved sign-in (POST
|
|
8
|
+
// /_home/hub/signout), on the person's click — never on its own.
|
|
9
|
+
// Replaces the 2.0.5 face card (HomeAccounts.jsx) and the 2.1.1 accounts row (HomeAccountsRow.jsx).
|
|
10
|
+
|
|
11
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
12
|
+
|
|
13
|
+
import { AcctFace, StateWord } from './HomeConnection.jsx';
|
|
14
|
+
import { cloudSignOut, hubSignOut, shellInvoke, shellListen } from './home-api.js';
|
|
15
|
+
import { forgetSpec, githubOf, slugOf } from './home-accounts-model.js';
|
|
16
|
+
import { HIcon } from './home-icons.jsx';
|
|
17
|
+
import { CONN_TONE } from './home-where-model.js';
|
|
18
|
+
import { WAITING_WORD } from './use-account-fix.js';
|
|
19
|
+
import { githubSignIn } from '../v2/onboarding/github-home.js';
|
|
20
|
+
|
|
21
|
+
const SIGNOUT_FAILED = 'Couldn’t sign out. Nothing changed — try again.';
|
|
22
|
+
const FORGET_FAILED = 'Couldn’t forget that server. Nothing changed — try again.';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @param {{ summary: ReturnType<typeof import('./home-accounts-model.js').homeAccountsSummary>,
|
|
26
|
+
* shell: object|null, native: boolean, open: boolean, onOpen: () => void,
|
|
27
|
+
* onClose: () => void, fixer: { busy: string|null, error: string|null,
|
|
28
|
+
* fix: (card: object) => unknown }, onAddCloud: () => void, onAddTeam: () => void,
|
|
29
|
+
* onChanged?: () => unknown }} props
|
|
30
|
+
*/
|
|
31
|
+
export function HomeAccountsChip({
|
|
32
|
+
summary,
|
|
33
|
+
shell,
|
|
34
|
+
native,
|
|
35
|
+
open,
|
|
36
|
+
onOpen,
|
|
37
|
+
onClose,
|
|
38
|
+
fixer,
|
|
39
|
+
onAddCloud,
|
|
40
|
+
onAddTeam,
|
|
41
|
+
onChanged,
|
|
42
|
+
}) {
|
|
43
|
+
const [menu, setMenu] = useState(null); // the card key whose "…" is open, or 'add'
|
|
44
|
+
const [oldOpen, setOldOpen] = useState(false);
|
|
45
|
+
const [asking, setAsking] = useState(null); // { id, title, body, primary, cancel, run }
|
|
46
|
+
const [busy, setBusy] = useState(false);
|
|
47
|
+
const [error, setError] = useState(null);
|
|
48
|
+
const [ghCode, setGhCode] = useState(null);
|
|
49
|
+
const wrap = useRef(null);
|
|
50
|
+
|
|
51
|
+
const close = useCallback(() => {
|
|
52
|
+
setMenu(null);
|
|
53
|
+
setAsking(null);
|
|
54
|
+
setError(null);
|
|
55
|
+
onClose();
|
|
56
|
+
}, [onClose]);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!open) return undefined;
|
|
59
|
+
const onKey = (e) => e.key === 'Escape' && close();
|
|
60
|
+
const onDown = (e) => wrap.current && !wrap.current.contains(e.target) && close();
|
|
61
|
+
window.addEventListener('keydown', onKey);
|
|
62
|
+
window.addEventListener('pointerdown', onDown);
|
|
63
|
+
return () => {
|
|
64
|
+
window.removeEventListener('keydown', onKey);
|
|
65
|
+
window.removeEventListener('pointerdown', onDown);
|
|
66
|
+
};
|
|
67
|
+
}, [open, close]);
|
|
68
|
+
// the GitHub device code arrives as a shell message while a sign-in from this list runs
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!open || !native) return undefined;
|
|
71
|
+
let off = () => {};
|
|
72
|
+
shellListen('github://device-code', (p) => setGhCode(p?.user_code ?? null)).then((u) => {
|
|
73
|
+
off = u;
|
|
74
|
+
});
|
|
75
|
+
return () => off();
|
|
76
|
+
}, [open, native]);
|
|
77
|
+
|
|
78
|
+
const { live, old } = summary;
|
|
79
|
+
// GitHub lives in the "…" of each profile's first line
|
|
80
|
+
const firstOf = new Set();
|
|
81
|
+
const seen = new Set();
|
|
82
|
+
for (const c of live)
|
|
83
|
+
if (!seen.has(c.profile)) {
|
|
84
|
+
seen.add(c.profile);
|
|
85
|
+
firstOf.add(c.key);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const runAsk = async () => {
|
|
89
|
+
const spec = asking;
|
|
90
|
+
setBusy(true);
|
|
91
|
+
setError(null);
|
|
92
|
+
const failed = await spec.run();
|
|
93
|
+
setBusy(false);
|
|
94
|
+
setAsking(null);
|
|
95
|
+
if (failed) setError(failed);
|
|
96
|
+
await onChanged?.();
|
|
97
|
+
};
|
|
98
|
+
const askSignOut = (card) => {
|
|
99
|
+
setMenu(null);
|
|
100
|
+
const s = card.signOut;
|
|
101
|
+
setAsking({
|
|
102
|
+
id: 'signout',
|
|
103
|
+
...s.confirm,
|
|
104
|
+
run: async () => {
|
|
105
|
+
const r =
|
|
106
|
+
s.path === 'cloud-signout'
|
|
107
|
+
? await cloudSignOut(s.profile)
|
|
108
|
+
: await hubSignOut(s.profile, s.url);
|
|
109
|
+
return r.ok && r.json?.ok ? null : r.json?.error || SIGNOUT_FAILED;
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
const askForget = (servers) => {
|
|
114
|
+
const spec = forgetSpec(servers);
|
|
115
|
+
setAsking({
|
|
116
|
+
...spec,
|
|
117
|
+
run: async () => {
|
|
118
|
+
let failed = null;
|
|
119
|
+
for (const s of spec.servers) {
|
|
120
|
+
const r = await hubSignOut(s.profile, s.url);
|
|
121
|
+
if (!r.ok || !r.json?.ok) failed = r.json?.error || FORGET_FAILED;
|
|
122
|
+
}
|
|
123
|
+
return failed;
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
const ghSignIn = async (profile) => {
|
|
128
|
+
setMenu(null);
|
|
129
|
+
setError(null);
|
|
130
|
+
setBusy(true);
|
|
131
|
+
try {
|
|
132
|
+
await githubSignIn(profile, shellInvoke);
|
|
133
|
+
await onChanged?.();
|
|
134
|
+
} catch (e) {
|
|
135
|
+
setError(typeof e === 'string' ? e : 'GitHub sign-in didn’t finish. Try again.');
|
|
136
|
+
} finally {
|
|
137
|
+
setGhCode(null);
|
|
138
|
+
setBusy(false);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const forgettable = old.filter((c) => c.forget);
|
|
143
|
+
const shownError = error || fixer.error;
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<span className="island home-top-acct" ref={wrap}>
|
|
147
|
+
<button
|
|
148
|
+
type="button"
|
|
149
|
+
className="home-acchip"
|
|
150
|
+
data-testid="home-accounts-chip"
|
|
151
|
+
data-needs={summary.needs || undefined}
|
|
152
|
+
aria-haspopup="dialog"
|
|
153
|
+
aria-expanded={open}
|
|
154
|
+
onClick={() => (open ? close() : onOpen())}
|
|
155
|
+
>
|
|
156
|
+
<HIcon name="people" size={14} />
|
|
157
|
+
<span>{summary.word}</span>
|
|
158
|
+
{summary.needsWord ? (
|
|
159
|
+
<span className="home-acchip-needs" data-testid="home-accounts-chip-needs">
|
|
160
|
+
<i aria-hidden="true" />
|
|
161
|
+
{summary.needsWord}
|
|
162
|
+
</span>
|
|
163
|
+
) : null}
|
|
164
|
+
<HIcon name="chevron" size={12} />
|
|
165
|
+
</button>
|
|
166
|
+
{open ? (
|
|
167
|
+
<div
|
|
168
|
+
className="home-accts"
|
|
169
|
+
role="dialog"
|
|
170
|
+
aria-label="Accounts on this Mac"
|
|
171
|
+
data-testid="home-accounts"
|
|
172
|
+
>
|
|
173
|
+
<p className="home-accts-h">Accounts on this Mac</p>
|
|
174
|
+
<ul className="home-accts-list">
|
|
175
|
+
{live.map((c) => {
|
|
176
|
+
const id = slugOf(c);
|
|
177
|
+
const bad = c.state === 'rejected' || c.state === 'missing';
|
|
178
|
+
const gh = native && firstOf.has(c.key) ? githubOf(shell, c.profile) : null;
|
|
179
|
+
const more = native && (c.signOut || gh);
|
|
180
|
+
return (
|
|
181
|
+
<li
|
|
182
|
+
key={c.key}
|
|
183
|
+
className={`home-acl${bad ? ' home-acl--bad' : ''}`}
|
|
184
|
+
data-kind={c.kind}
|
|
185
|
+
data-state={c.state}
|
|
186
|
+
data-testid={`home-account-card-${id}`}
|
|
187
|
+
>
|
|
188
|
+
<AcctFace face={c.face} state={c.state} size="md" />
|
|
189
|
+
<span className="home-acl-t">
|
|
190
|
+
<strong>{c.title}</strong>
|
|
191
|
+
<span>{c.sub}</span>
|
|
192
|
+
{c.state !== 'ok' ? (
|
|
193
|
+
<StateWord tone={CONN_TONE[c.state]} testid={`home-account-state-${id}`}>
|
|
194
|
+
{c.word}
|
|
195
|
+
</StateWord>
|
|
196
|
+
) : null}
|
|
197
|
+
</span>
|
|
198
|
+
{c.fix ? (
|
|
199
|
+
<button
|
|
200
|
+
type="button"
|
|
201
|
+
className="btn btn--primary btn--sm home-acl-fix"
|
|
202
|
+
data-testid={`home-account-signin-${id}`}
|
|
203
|
+
disabled={!native || fixer.busy === c.key}
|
|
204
|
+
title={native ? undefined : 'Sign in from the Maude app on your Mac.'}
|
|
205
|
+
onClick={() => fixer.fix(c)}
|
|
206
|
+
>
|
|
207
|
+
{fixer.busy === c.key ? WAITING_WORD : c.fix.label}
|
|
208
|
+
</button>
|
|
209
|
+
) : null}
|
|
210
|
+
{more ? (
|
|
211
|
+
<span className="home-acl-more">
|
|
212
|
+
<button
|
|
213
|
+
type="button"
|
|
214
|
+
className="icon-btn"
|
|
215
|
+
aria-label={`More for ${c.title}`}
|
|
216
|
+
aria-haspopup="menu"
|
|
217
|
+
aria-expanded={menu === c.key}
|
|
218
|
+
data-testid={`home-account-more-${id}`}
|
|
219
|
+
onClick={() => setMenu((m) => (m === c.key ? null : c.key))}
|
|
220
|
+
>
|
|
221
|
+
<HIcon name="more" size={16} />
|
|
222
|
+
</button>
|
|
223
|
+
{menu === c.key ? (
|
|
224
|
+
<span className="island home-acl-menu" role="menu">
|
|
225
|
+
{gh?.login ? (
|
|
226
|
+
<span
|
|
227
|
+
className="home-acl-menu-note"
|
|
228
|
+
data-testid={`home-account-github-${c.profile}`}
|
|
229
|
+
>
|
|
230
|
+
GitHub · {gh.login}
|
|
231
|
+
</span>
|
|
232
|
+
) : null}
|
|
233
|
+
{gh?.signIn ? (
|
|
234
|
+
<button
|
|
235
|
+
type="button"
|
|
236
|
+
role="menuitem"
|
|
237
|
+
className="row-item"
|
|
238
|
+
data-testid={`home-account-github-signin-${c.profile}`}
|
|
239
|
+
disabled={busy}
|
|
240
|
+
onClick={() => ghSignIn(c.profile)}
|
|
241
|
+
>
|
|
242
|
+
Sign in with GitHub…
|
|
243
|
+
</button>
|
|
244
|
+
) : null}
|
|
245
|
+
{c.signOut ? (
|
|
246
|
+
<button
|
|
247
|
+
type="button"
|
|
248
|
+
role="menuitem"
|
|
249
|
+
className="row-item"
|
|
250
|
+
data-testid={`home-account-signout-${id}`}
|
|
251
|
+
disabled={busy}
|
|
252
|
+
onClick={() => askSignOut(c)}
|
|
253
|
+
>
|
|
254
|
+
{c.signOut.label}
|
|
255
|
+
</button>
|
|
256
|
+
) : null}
|
|
257
|
+
</span>
|
|
258
|
+
) : null}
|
|
259
|
+
</span>
|
|
260
|
+
) : null}
|
|
261
|
+
</li>
|
|
262
|
+
);
|
|
263
|
+
})}
|
|
264
|
+
</ul>
|
|
265
|
+
{old.length ? (
|
|
266
|
+
<div className="home-accts-old">
|
|
267
|
+
<button
|
|
268
|
+
type="button"
|
|
269
|
+
className="home-accts-oldh"
|
|
270
|
+
data-testid="home-accounts-old"
|
|
271
|
+
aria-expanded={oldOpen}
|
|
272
|
+
onClick={() => setOldOpen((o) => !o)}
|
|
273
|
+
>
|
|
274
|
+
<HIcon name={oldOpen ? 'chevron' : 'submenu'} size={12} />
|
|
275
|
+
<span>{summary.oldWord}</span>
|
|
276
|
+
<span className="home-accts-oldw">Not answering, no projects</span>
|
|
277
|
+
</button>
|
|
278
|
+
{oldOpen ? (
|
|
279
|
+
<ul className="home-accts-oldl">
|
|
280
|
+
{old.map((c) => {
|
|
281
|
+
const id = slugOf(c);
|
|
282
|
+
return (
|
|
283
|
+
<li key={c.key} data-testid={`home-accounts-old-row-${id}`}>
|
|
284
|
+
<HIcon name="server" size={12} />
|
|
285
|
+
<code>{c.forget?.host ?? c.title}</code>
|
|
286
|
+
{native && c.forget ? (
|
|
287
|
+
<button
|
|
288
|
+
type="button"
|
|
289
|
+
className="btn btn--ghost btn--sm"
|
|
290
|
+
data-testid={`home-accounts-old-forget-${id}`}
|
|
291
|
+
disabled={busy}
|
|
292
|
+
onClick={() => askForget([c.forget])}
|
|
293
|
+
>
|
|
294
|
+
Forget…
|
|
295
|
+
</button>
|
|
296
|
+
) : null}
|
|
297
|
+
</li>
|
|
298
|
+
);
|
|
299
|
+
})}
|
|
300
|
+
{native && forgettable.length > 1 ? (
|
|
301
|
+
<li className="home-accts-oldall">
|
|
302
|
+
<button
|
|
303
|
+
type="button"
|
|
304
|
+
className="btn btn--ghost btn--sm"
|
|
305
|
+
data-testid="home-accounts-old-forget-all"
|
|
306
|
+
disabled={busy}
|
|
307
|
+
onClick={() => askForget(forgettable.map((c) => c.forget))}
|
|
308
|
+
>
|
|
309
|
+
Forget all {forgettable.length}…
|
|
310
|
+
</button>
|
|
311
|
+
</li>
|
|
312
|
+
) : null}
|
|
313
|
+
</ul>
|
|
314
|
+
) : null}
|
|
315
|
+
</div>
|
|
316
|
+
) : null}
|
|
317
|
+
{ghCode ? (
|
|
318
|
+
<p className="home-accts-note" data-testid="home-accounts-github-code">
|
|
319
|
+
Enter <strong>{ghCode}</strong> on the GitHub page that opened.
|
|
320
|
+
</p>
|
|
321
|
+
) : null}
|
|
322
|
+
{shownError ? (
|
|
323
|
+
<p className="home-accts-note" role="alert" data-testid="home-accounts-error">
|
|
324
|
+
{shownError}
|
|
325
|
+
</p>
|
|
326
|
+
) : null}
|
|
327
|
+
{asking ? (
|
|
328
|
+
<div
|
|
329
|
+
className="home-accts-ask"
|
|
330
|
+
role="alertdialog"
|
|
331
|
+
aria-label={asking.title}
|
|
332
|
+
data-testid="home-accounts-confirm"
|
|
333
|
+
data-ask={asking.id}
|
|
334
|
+
>
|
|
335
|
+
<strong>{asking.title}</strong>
|
|
336
|
+
<span>{asking.body}</span>
|
|
337
|
+
<span className="home-accts-btns">
|
|
338
|
+
<button
|
|
339
|
+
type="button"
|
|
340
|
+
className="btn btn--sm"
|
|
341
|
+
data-testid={`home-accounts-${asking.id}-cancel`}
|
|
342
|
+
onClick={() => setAsking(null)}
|
|
343
|
+
>
|
|
344
|
+
{asking.cancel}
|
|
345
|
+
</button>
|
|
346
|
+
<button
|
|
347
|
+
type="button"
|
|
348
|
+
className={`btn btn--sm ${asking.id === 'signout' ? 'btn--danger' : 'btn--primary'}`}
|
|
349
|
+
data-testid={`home-accounts-${asking.id}-confirm`}
|
|
350
|
+
disabled={busy}
|
|
351
|
+
onClick={runAsk}
|
|
352
|
+
>
|
|
353
|
+
{asking.primary}
|
|
354
|
+
</button>
|
|
355
|
+
</span>
|
|
356
|
+
</div>
|
|
357
|
+
) : null}
|
|
358
|
+
{native ? (
|
|
359
|
+
<div className="home-accts-foot">
|
|
360
|
+
<button
|
|
361
|
+
type="button"
|
|
362
|
+
className="home-accts-act"
|
|
363
|
+
data-testid="home-accounts-add"
|
|
364
|
+
aria-haspopup="menu"
|
|
365
|
+
aria-expanded={menu === 'add'}
|
|
366
|
+
onClick={() => setMenu((m) => (m === 'add' ? null : 'add'))}
|
|
367
|
+
>
|
|
368
|
+
<HIcon name="plus" size={12} /> Add an account…
|
|
369
|
+
</button>
|
|
370
|
+
{menu === 'add' ? (
|
|
371
|
+
<span className="home-accts-addm" role="menu">
|
|
372
|
+
<button
|
|
373
|
+
type="button"
|
|
374
|
+
role="menuitem"
|
|
375
|
+
className="row-item"
|
|
376
|
+
data-testid="home-accounts-add-cloud"
|
|
377
|
+
onClick={() => {
|
|
378
|
+
close();
|
|
379
|
+
onAddCloud?.();
|
|
380
|
+
}}
|
|
381
|
+
>
|
|
382
|
+
Add a Maude Cloud account…
|
|
383
|
+
</button>
|
|
384
|
+
<button
|
|
385
|
+
type="button"
|
|
386
|
+
role="menuitem"
|
|
387
|
+
className="row-item"
|
|
388
|
+
data-testid="home-accounts-add-team"
|
|
389
|
+
onClick={() => {
|
|
390
|
+
close();
|
|
391
|
+
onAddTeam?.();
|
|
392
|
+
}}
|
|
393
|
+
>
|
|
394
|
+
Connect to a team server…
|
|
395
|
+
</button>
|
|
396
|
+
</span>
|
|
397
|
+
) : null}
|
|
398
|
+
</div>
|
|
399
|
+
) : null}
|
|
400
|
+
</div>
|
|
401
|
+
) : null}
|
|
402
|
+
</span>
|
|
403
|
+
);
|
|
404
|
+
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { HIcon } from './home-icons.jsx';
|
|
7
7
|
|
|
8
8
|
/** The broken-link glyph on a sign-in that stopped working (the project window's badge). */
|
|
9
|
-
function BrokenLink({ size = 10 }) {
|
|
9
|
+
export function BrokenLink({ size = 10 }) {
|
|
10
10
|
return (
|
|
11
11
|
<svg
|
|
12
12
|
width={size}
|
|
@@ -26,7 +26,7 @@ function BrokenLink({ size = 10 }) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/** "Kept by Maude" — the mark, single colour. */
|
|
29
|
-
function KeptGlyph({ size = 12 }) {
|
|
29
|
+
export function KeptGlyph({ size = 12 }) {
|
|
30
30
|
return (
|
|
31
31
|
<svg width={size} height={size} viewBox="0 0 16 16" aria-hidden="true">
|
|
32
32
|
<rect x="1.5" y="1.5" width="13" height="13" rx="3.5" fill="currentColor" />
|
|
@@ -78,7 +78,8 @@ export function StateWord({ tone, children, testid }) {
|
|
|
78
78
|
return (
|
|
79
79
|
<span className="home-sw" data-tone={tone} data-testid={testid}>
|
|
80
80
|
<i aria-hidden="true" />
|
|
81
|
-
{
|
|
81
|
+
{/* 2.1.2: the word clips (…) on a narrow line instead of running under a button */}
|
|
82
|
+
<span className="home-sw-w">{children}</span>
|
|
82
83
|
</span>
|
|
83
84
|
);
|
|
84
85
|
}
|