@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,237 @@
|
|
|
1
|
+
/* client/v2/shell/project-account.css — 2.1.1 T2/T4: the account chip's face + badge, the avatar menu,
|
|
2
|
+
Switch account and its sheet (project-account-card.jsx; canvas 17 Accounts and Connections). */
|
|
3
|
+
@layer components {
|
|
4
|
+
.sh-af {
|
|
5
|
+
position: relative;
|
|
6
|
+
flex: none;
|
|
7
|
+
display: inline-grid;
|
|
8
|
+
place-items: center;
|
|
9
|
+
width: 24px;
|
|
10
|
+
height: 24px;
|
|
11
|
+
}
|
|
12
|
+
.sh-af--sm {
|
|
13
|
+
width: 16px;
|
|
14
|
+
height: 16px;
|
|
15
|
+
}
|
|
16
|
+
.sh-af-circle--sm {
|
|
17
|
+
width: 16px;
|
|
18
|
+
height: 16px;
|
|
19
|
+
font-size: 9px;
|
|
20
|
+
}
|
|
21
|
+
.sh-af-tile {
|
|
22
|
+
display: grid;
|
|
23
|
+
place-items: center;
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
border-radius: var(--radius-sm, 6px);
|
|
27
|
+
background: var(--bg-3);
|
|
28
|
+
color: var(--fg-1);
|
|
29
|
+
}
|
|
30
|
+
.sh-af-tile[data-kind="server"] {
|
|
31
|
+
background: var(--object-green);
|
|
32
|
+
color: var(--object-ink);
|
|
33
|
+
}
|
|
34
|
+
/* offline: the face goes grey — the network, nothing to do */
|
|
35
|
+
.sh-af[data-badge="grey"] .sh-acct-face,
|
|
36
|
+
.sh-af[data-badge="grey"] .sh-af-tile {
|
|
37
|
+
background: var(--bg-3);
|
|
38
|
+
color: var(--fg-2);
|
|
39
|
+
}
|
|
40
|
+
.sh-af-ring {
|
|
41
|
+
position: absolute;
|
|
42
|
+
inset: -3px;
|
|
43
|
+
width: calc(100% + 6px);
|
|
44
|
+
height: calc(100% + 6px);
|
|
45
|
+
stroke: var(--accent);
|
|
46
|
+
animation: sh-af-spin 1.2s linear infinite;
|
|
47
|
+
}
|
|
48
|
+
@keyframes sh-af-spin {
|
|
49
|
+
to {
|
|
50
|
+
transform: rotate(360deg);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
.sh-af-badge {
|
|
54
|
+
position: absolute;
|
|
55
|
+
right: -4px;
|
|
56
|
+
bottom: -4px;
|
|
57
|
+
display: grid;
|
|
58
|
+
place-items: center;
|
|
59
|
+
width: 13px;
|
|
60
|
+
height: 13px;
|
|
61
|
+
border-radius: var(--radius-pill, 999px);
|
|
62
|
+
box-shadow: 0 0 0 1.5px var(--bg-2);
|
|
63
|
+
color: var(--fg-on-accent, #fff);
|
|
64
|
+
}
|
|
65
|
+
.sh-af-badge--broken {
|
|
66
|
+
background: var(--danger, oklch(0.6 0.2 25));
|
|
67
|
+
}
|
|
68
|
+
.sh-af-badge--warn {
|
|
69
|
+
background: var(--warning, oklch(0.75 0.15 75));
|
|
70
|
+
color: var(--object-ink);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* the menu */
|
|
74
|
+
.sh-am-pop {
|
|
75
|
+
width: 320px;
|
|
76
|
+
}
|
|
77
|
+
.sh-am,
|
|
78
|
+
.sh-am-sub {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: 2px;
|
|
82
|
+
}
|
|
83
|
+
.sh-am-pb {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
gap: 4px;
|
|
87
|
+
padding: var(--space-2, 8px);
|
|
88
|
+
border-radius: var(--radius-md, 8px);
|
|
89
|
+
}
|
|
90
|
+
.sh-am-pb--bad {
|
|
91
|
+
background: color-mix(in oklch, var(--danger, oklch(0.6 0.2 25)) 12%, var(--bg-2));
|
|
92
|
+
}
|
|
93
|
+
.sh-am-name {
|
|
94
|
+
font-size: var(--type-md, 15px);
|
|
95
|
+
color: var(--fg-0);
|
|
96
|
+
padding-bottom: 2px;
|
|
97
|
+
}
|
|
98
|
+
.sh-am-line {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: flex-start;
|
|
101
|
+
gap: var(--space-2, 8px);
|
|
102
|
+
font-size: var(--type-xs, 12px);
|
|
103
|
+
color: var(--fg-1);
|
|
104
|
+
}
|
|
105
|
+
.sh-am-ic {
|
|
106
|
+
flex: none;
|
|
107
|
+
display: inline-grid;
|
|
108
|
+
place-items: center;
|
|
109
|
+
width: 16px;
|
|
110
|
+
min-height: 16px;
|
|
111
|
+
color: var(--fg-2);
|
|
112
|
+
}
|
|
113
|
+
.sh-am-txt {
|
|
114
|
+
min-width: 0;
|
|
115
|
+
overflow-wrap: anywhere;
|
|
116
|
+
}
|
|
117
|
+
.sh-am-q,
|
|
118
|
+
.sh-am-gt {
|
|
119
|
+
color: var(--fg-2);
|
|
120
|
+
}
|
|
121
|
+
.sh-am-gt {
|
|
122
|
+
padding: var(--space-1, 4px) var(--space-2, 8px) 0;
|
|
123
|
+
font-size: var(--type-xs, 12px);
|
|
124
|
+
font-weight: var(--w-medium, 500);
|
|
125
|
+
}
|
|
126
|
+
.sh-am-mono {
|
|
127
|
+
font-family: var(--font-mono, ui-monospace, monospace);
|
|
128
|
+
font-size: 11px;
|
|
129
|
+
}
|
|
130
|
+
.sh-am-dot {
|
|
131
|
+
width: 7px;
|
|
132
|
+
height: 7px;
|
|
133
|
+
border-radius: var(--radius-pill, 999px);
|
|
134
|
+
background: var(--fg-2);
|
|
135
|
+
}
|
|
136
|
+
.sh-am-dot[data-tone="ok"] {
|
|
137
|
+
background: var(--success, oklch(0.65 0.15 150));
|
|
138
|
+
}
|
|
139
|
+
.sh-am-dot[data-tone="busy"] {
|
|
140
|
+
background: var(--accent);
|
|
141
|
+
}
|
|
142
|
+
.sh-am-dot[data-tone="warn"] {
|
|
143
|
+
background: var(--warning, oklch(0.75 0.15 75));
|
|
144
|
+
}
|
|
145
|
+
.sh-am-dot[data-tone="error"] {
|
|
146
|
+
background: var(--danger, oklch(0.6 0.2 25));
|
|
147
|
+
}
|
|
148
|
+
.sh-am-status[data-tone="error"] {
|
|
149
|
+
color: var(--danger, oklch(0.6 0.2 25));
|
|
150
|
+
}
|
|
151
|
+
.sh-am-fix {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-direction: column;
|
|
154
|
+
gap: var(--space-2, 8px);
|
|
155
|
+
padding-top: var(--space-1, 4px);
|
|
156
|
+
font-size: var(--type-xs, 12px);
|
|
157
|
+
color: var(--fg-1);
|
|
158
|
+
}
|
|
159
|
+
.sh-am-fixt {
|
|
160
|
+
line-height: 1.45;
|
|
161
|
+
text-wrap: pretty;
|
|
162
|
+
}
|
|
163
|
+
.sh-am-fixr {
|
|
164
|
+
display: flex;
|
|
165
|
+
gap: var(--space-2, 8px);
|
|
166
|
+
align-items: center;
|
|
167
|
+
}
|
|
168
|
+
.sh-am-addr {
|
|
169
|
+
flex: 1;
|
|
170
|
+
min-width: 0;
|
|
171
|
+
display: inline-flex;
|
|
172
|
+
align-items: center;
|
|
173
|
+
gap: 6px;
|
|
174
|
+
height: 28px;
|
|
175
|
+
padding: 0 var(--space-2, 8px);
|
|
176
|
+
border-radius: var(--radius-md, 8px);
|
|
177
|
+
background: var(--bg-1);
|
|
178
|
+
color: var(--fg-1);
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
white-space: nowrap;
|
|
181
|
+
text-overflow: ellipsis;
|
|
182
|
+
}
|
|
183
|
+
.sh-am-row {
|
|
184
|
+
gap: var(--space-2, 8px);
|
|
185
|
+
}
|
|
186
|
+
.sh-am-lab {
|
|
187
|
+
flex: 1;
|
|
188
|
+
min-width: 0;
|
|
189
|
+
}
|
|
190
|
+
.sh-am-keys {
|
|
191
|
+
color: var(--fg-2);
|
|
192
|
+
font-size: var(--type-xs, 12px);
|
|
193
|
+
}
|
|
194
|
+
.sh-am-row--two {
|
|
195
|
+
min-height: 40px;
|
|
196
|
+
}
|
|
197
|
+
.sh-am-two {
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-direction: column;
|
|
200
|
+
min-width: 0;
|
|
201
|
+
}
|
|
202
|
+
.sh-am-two strong {
|
|
203
|
+
font-weight: var(--w-medium, 500);
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
text-overflow: ellipsis;
|
|
206
|
+
white-space: nowrap;
|
|
207
|
+
}
|
|
208
|
+
.sh-am-two span {
|
|
209
|
+
font-size: var(--type-xs, 12px);
|
|
210
|
+
color: var(--fg-2);
|
|
211
|
+
}
|
|
212
|
+
.sh-am-back svg {
|
|
213
|
+
transform: rotate(90deg);
|
|
214
|
+
}
|
|
215
|
+
.sh-am-sheet {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-direction: column;
|
|
218
|
+
gap: var(--space-2, 8px);
|
|
219
|
+
padding: var(--space-3, 12px);
|
|
220
|
+
}
|
|
221
|
+
.sh-am-sheet-h {
|
|
222
|
+
font-size: var(--type-md, 15px);
|
|
223
|
+
color: var(--fg-0);
|
|
224
|
+
}
|
|
225
|
+
.sh-am-conf {
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: flex-start;
|
|
228
|
+
gap: var(--space-2, 8px);
|
|
229
|
+
font-size: var(--type-xs, 12px);
|
|
230
|
+
color: var(--fg-1);
|
|
231
|
+
}
|
|
232
|
+
.sh-am-conf > svg {
|
|
233
|
+
flex: none;
|
|
234
|
+
margin-top: 1px;
|
|
235
|
+
color: var(--fg-2);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -33,6 +33,7 @@ import { usePresenceHost } from '../presence/use-presence-host.js';
|
|
|
33
33
|
import { useShellStore } from '../../stores/shell-store.jsx';
|
|
34
34
|
import { askToEdit } from './ask-to-edit.js';
|
|
35
35
|
import { setExportPeople } from '../export/use-export-spec.js';
|
|
36
|
+
import { requestShareFocus } from '../share/share-model.js';
|
|
36
37
|
import { menuRunner } from './menu-runner.js';
|
|
37
38
|
import { ModeSwitch } from './mode-switch.jsx';
|
|
38
39
|
import { menuCtx } from './project-menu-model.js';
|
|
@@ -45,8 +46,6 @@ import {
|
|
|
45
46
|
heldConflicts,
|
|
46
47
|
} from '../diagnostics/sync-details/sync-details-model.js';
|
|
47
48
|
import { ShareCluster } from './share-cluster.jsx';
|
|
48
|
-
import { AccountChip } from './account-card.jsx';
|
|
49
|
-
import { accountCard, accountChip } from './account-card-model.js';
|
|
50
49
|
import { presentFromLabel } from './present-from-label.js';
|
|
51
50
|
import { copyPresentationLink, copyRowState } from '../present/copy-link.js';
|
|
52
51
|
import { normalizeOpenPath } from '../../share-link.js';
|
|
@@ -62,8 +61,16 @@ import {
|
|
|
62
61
|
import { servedFetch } from './served-routes.js';
|
|
63
62
|
import { CLOUD_CHANGED_EVENT } from '../../panels/CloudBar.jsx';
|
|
64
63
|
import { GitHubSignInSheet, useGitHubSignInHost } from './github-signin-host.jsx';
|
|
65
|
-
import {
|
|
66
|
-
|
|
64
|
+
import {
|
|
65
|
+
AccountChip,
|
|
66
|
+
ProjectAccountMenu,
|
|
67
|
+
ProjectAccountPopover,
|
|
68
|
+
SwitchSheet,
|
|
69
|
+
} from './project-account-card.jsx';
|
|
70
|
+
import { accountFace, accountMenu, switchList, switchSheet } from './project-account-model.js';
|
|
71
|
+
import { ACCOUNT_MENU_EVENT } from './project-account-bus.js';
|
|
72
|
+
import { useSignInToast } from './project-account-toast.js';
|
|
73
|
+
import { connectionState, connectionWords } from './connection-state.js';
|
|
67
74
|
import { runTeamSwitch } from './team-switch.js';
|
|
68
75
|
|
|
69
76
|
/** 2.0.5 W4 — the team server sign-in's recorded account (`GET /_api/connections/hub`, Settings' own read). */
|
|
@@ -89,21 +96,6 @@ function useHubAccount(enabled, url) {
|
|
|
89
96
|
return account;
|
|
90
97
|
}
|
|
91
98
|
|
|
92
|
-
/** Settings' team-server "Sign out": POST /_api/cloud/detach — the link and its sign-in, this profile only. */
|
|
93
|
-
async function detachHub(host) {
|
|
94
|
-
try {
|
|
95
|
-
const r = await fetch('/_api/cloud/detach', { method: 'POST' });
|
|
96
|
-
const j = await r.json().catch(() => ({}));
|
|
97
|
-
if (!r.ok || !j?.ok) throw new Error(j?.error || String(r.status));
|
|
98
|
-
window.dispatchEvent(
|
|
99
|
-
new CustomEvent(CLOUD_CHANGED_EVENT, { detail: { from: 'account-card' } })
|
|
100
|
-
);
|
|
101
|
-
shellToast(`Signed out of ${host || 'the team server'}. Your work stays on this Mac.`, true);
|
|
102
|
-
} catch {
|
|
103
|
-
shellToast('Could not sign out. Nothing changed — try again.');
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
99
|
/** `{ ok, status, json }` of a same-origin JSON call (team-switch.js's `api`). */
|
|
108
100
|
async function jsonFetch(path, init) {
|
|
109
101
|
try {
|
|
@@ -114,6 +106,17 @@ async function jsonFetch(path, init) {
|
|
|
114
106
|
}
|
|
115
107
|
}
|
|
116
108
|
|
|
109
|
+
// 2.1.1 T2 — the save word beside the chip says the connection state in words (canvas 17 · ac-states):
|
|
110
|
+
// the two sign-in states, a server that does not answer, and this Mac offline. Its actions stay the
|
|
111
|
+
// status's own (the word opens Diagnostics › Sync).
|
|
112
|
+
const CONNECTION_WORDS = new Set(['signin-missing', 'signin-rejected', 'unreachable', 'offline']);
|
|
113
|
+
function withConnection(status, conn) {
|
|
114
|
+
if (!conn || !CONNECTION_WORDS.has(conn.state)) return status;
|
|
115
|
+
if (status?.kind === 'not-saved' && (status.conflict || status.detail)) return status;
|
|
116
|
+
const w = connectionWords(conn);
|
|
117
|
+
return { ...status, word: w.word, icon: w.icon, tone: w.tone, connection: conn.state };
|
|
118
|
+
}
|
|
119
|
+
|
|
117
120
|
const subscribeOnline = (fn) => {
|
|
118
121
|
window.addEventListener('online', fn);
|
|
119
122
|
window.addEventListener('offline', fn);
|
|
@@ -300,75 +303,90 @@ export function ShellShareCluster() {
|
|
|
300
303
|
[selected, canvasActiveArtboard, boards]
|
|
301
304
|
);
|
|
302
305
|
|
|
303
|
-
//
|
|
304
|
-
//
|
|
306
|
+
// 2.1.1 T2/T4 (canvas 17 Accounts and Connections) — the account chip: its face says the kind (a
|
|
307
|
+
// Maude Cloud circle, your server's tile, this Mac's laptop) with at most one badge from the
|
|
308
|
+
// connection state; it and your own face open THIS project's account menu. A cloud tab's account is
|
|
309
|
+
// the hub's (no chip); a browser tab on this Mac shows the facts and no Mac account.
|
|
305
310
|
const native = isNativeApp();
|
|
306
|
-
// 2.0.5 W4 — every non-cloud tab reads its account (a browser tab on this Mac shows the facts too)
|
|
307
311
|
const acct = useAccount(!cfg?.cloud);
|
|
308
312
|
const projectName = cfg?.cloud?.projectName || project;
|
|
309
|
-
const
|
|
313
|
+
const gh = useGitHubSignInHost();
|
|
314
|
+
const [acctOpen, setAcctOpen] = useState(false);
|
|
315
|
+
const [acctView, setAcctView] = useState('menu');
|
|
316
|
+
const [pick, setPick] = useState(null); // { row, sheet } — the Switch account row being confirmed
|
|
317
|
+
const [using, setUsing] = useState(false);
|
|
318
|
+
const closeAcct = useCallback(() => {
|
|
319
|
+
setAcctOpen(false);
|
|
320
|
+
setAcctView('menu');
|
|
321
|
+
setPick(null);
|
|
322
|
+
}, []);
|
|
323
|
+
// the account's own read once it answered (it follows a sign-out), the shell's link until then
|
|
324
|
+
const linkHub = acct.linkedHub !== undefined ? acct.linkedHub : (cloudLinkedHub ?? null);
|
|
325
|
+
const hubAccount = useHubAccount(!cfg?.cloud && !!linkHub?.credentialed, linkHub?.url);
|
|
326
|
+
const conn = useMemo(
|
|
310
327
|
() =>
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
328
|
+
cfg?.cloud
|
|
329
|
+
? null
|
|
330
|
+
: connectionState({
|
|
331
|
+
linkedHub: linkHub,
|
|
332
|
+
cloudUrl: acct.cloudUrl,
|
|
333
|
+
syncStatus,
|
|
334
|
+
phase,
|
|
335
|
+
pending,
|
|
336
|
+
online,
|
|
337
|
+
}),
|
|
338
|
+
[cfg?.cloud, linkHub, acct.cloudUrl, syncStatus, phase, pending, online]
|
|
320
339
|
);
|
|
321
|
-
const
|
|
340
|
+
const face = useMemo(
|
|
322
341
|
() =>
|
|
323
|
-
|
|
324
|
-
?
|
|
325
|
-
|
|
342
|
+
conn
|
|
343
|
+
? accountFace({
|
|
344
|
+
conn,
|
|
326
345
|
profile: cfg?.profile,
|
|
327
|
-
|
|
328
|
-
|
|
346
|
+
cloudConnected: acct.connected,
|
|
347
|
+
cloudEmail: acct.email,
|
|
329
348
|
})
|
|
330
349
|
: null,
|
|
331
|
-
[
|
|
350
|
+
[conn, cfg?.profile, acct.connected, acct.email]
|
|
332
351
|
);
|
|
333
|
-
|
|
334
|
-
// cloud project, the login; Sign out on the kind's existing path, Switch through bind-on-sign-in.
|
|
335
|
-
const gh = useGitHubSignInHost();
|
|
336
|
-
const [acctOpen, setAcctOpen] = useState(false);
|
|
337
|
-
const closeAcct = useCallback(() => setAcctOpen(false), []);
|
|
338
|
-
// the account's own read once it answered (it follows a sign-out), the shell's link until then
|
|
339
|
-
const linkHub = acct.linkedHub !== undefined ? acct.linkedHub : (cloudLinkedHub ?? null);
|
|
340
|
-
const hubAccount = useHubAccount(!cfg?.cloud && !!linkHub?.credentialed, linkHub?.url);
|
|
341
|
-
const projectAcct = useMemo(
|
|
352
|
+
const menu = useMemo(
|
|
342
353
|
() =>
|
|
343
|
-
|
|
354
|
+
accountMenu({
|
|
344
355
|
native,
|
|
345
356
|
cloudTab: cfg?.cloud ?? null,
|
|
346
|
-
profile: cfg?.profile,
|
|
347
357
|
project: projectName,
|
|
348
|
-
|
|
358
|
+
conn,
|
|
359
|
+
face,
|
|
360
|
+
place: acct.place,
|
|
349
361
|
hubAccount,
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
cloudEmail: acct.email,
|
|
353
|
-
github: { state: gh.state, login: gh.login },
|
|
362
|
+
pending,
|
|
363
|
+
lastSyncAt: syncStatus?.lastSyncAt ?? null,
|
|
354
364
|
}),
|
|
355
|
-
[native, cfg?.cloud,
|
|
365
|
+
[native, cfg?.cloud, projectName, conn, face, acct.place, hubAccount, pending, syncStatus]
|
|
356
366
|
);
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
[acct, gh, projectAcct.where]
|
|
367
|
+
const list = useMemo(
|
|
368
|
+
() =>
|
|
369
|
+
native && !cfg?.cloud
|
|
370
|
+
? switchList({ accounts: acct.accounts, profile: cfg?.profile, cloudEmail: acct.email })
|
|
371
|
+
: null,
|
|
372
|
+
[native, cfg?.cloud, acct.accounts, cfg?.profile, acct.email]
|
|
364
373
|
);
|
|
365
|
-
//
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
374
|
+
// `account.switch` (⌘K, the tab menu) opens the menu on its Switch account list
|
|
375
|
+
useEffect(() => {
|
|
376
|
+
const on = (e) => {
|
|
377
|
+
setPick(null);
|
|
378
|
+
setAcctView(e?.detail?.view === 'switch' ? 'switch' : 'menu');
|
|
379
|
+
setAcctOpen(true);
|
|
380
|
+
};
|
|
381
|
+
window.addEventListener(ACCOUNT_MENU_EVENT, on);
|
|
382
|
+
return () => window.removeEventListener(ACCOUNT_MENU_EVENT, on);
|
|
383
|
+
}, []);
|
|
384
|
+
// 2.0.5 W4b — a team server's sign-in: `team_sign_in_prepare` first (bind-on-sign-in for a hub), then
|
|
385
|
+
// the server's own page with the folder's linked address. Words come back as one toast.
|
|
386
|
+
const hubSignIn = useCallback(
|
|
387
|
+
async (url) => {
|
|
370
388
|
const r = await runTeamSwitch({
|
|
371
|
-
url
|
|
389
|
+
url,
|
|
372
390
|
native,
|
|
373
391
|
invoke: shellInvoke,
|
|
374
392
|
api: jsonFetch,
|
|
@@ -385,6 +403,41 @@ export function ShellShareCluster() {
|
|
|
385
403
|
},
|
|
386
404
|
[native]
|
|
387
405
|
);
|
|
406
|
+
// The broken sign-in's one button (menu, toast): your server's own sign-in page with the address the
|
|
407
|
+
// folder already names — never typed again; a Maude Cloud project signs in where Maude Cloud does.
|
|
408
|
+
const fixSignIn = useCallback(
|
|
409
|
+
(fix) => {
|
|
410
|
+
closeAcct();
|
|
411
|
+
if (fix?.path === 'hub-signin') void hubSignIn(fix.url);
|
|
412
|
+
else menuRunner.run('settings.open', { tab: 'connections' });
|
|
413
|
+
},
|
|
414
|
+
[closeAcct, hubSignIn]
|
|
415
|
+
);
|
|
416
|
+
useSignInToast({
|
|
417
|
+
conn,
|
|
418
|
+
project: projectName,
|
|
419
|
+
onFix: () => fixSignIn(menu.fix),
|
|
420
|
+
toast: notify,
|
|
421
|
+
enabled: !cfg?.cloud,
|
|
422
|
+
});
|
|
423
|
+
const confirmUse = useCallback(async () => {
|
|
424
|
+
const row = pick?.row;
|
|
425
|
+
if (!row) return;
|
|
426
|
+
setUsing(true);
|
|
427
|
+
try {
|
|
428
|
+
const rebound = await shellInvoke('project_use_account', { id: row.id });
|
|
429
|
+
if (rebound)
|
|
430
|
+
shellToast(
|
|
431
|
+
`${projectName || 'This project'} now uses ${row.kind === 'local' ? 'no account' : row.title}. Reopening it…`,
|
|
432
|
+
true
|
|
433
|
+
);
|
|
434
|
+
closeAcct();
|
|
435
|
+
} catch (e) {
|
|
436
|
+
shellToast(String(e?.message || e || 'Could not switch accounts. Nothing changed.'));
|
|
437
|
+
} finally {
|
|
438
|
+
setUsing(false);
|
|
439
|
+
}
|
|
440
|
+
}, [pick, projectName, closeAcct]);
|
|
388
441
|
// S9.23 — the faces' menu and people list: where people are, Follow / Go to / Bring everyone here.
|
|
389
442
|
const presence = usePresenceHost({
|
|
390
443
|
lane,
|
|
@@ -423,22 +476,52 @@ export function ShellShareCluster() {
|
|
|
423
476
|
<>
|
|
424
477
|
<span className="sh-pa-anchor">
|
|
425
478
|
<ProjectAccountPopover open={acctOpen} onClose={closeAcct}>
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
479
|
+
{pick ? (
|
|
480
|
+
<SwitchSheet
|
|
481
|
+
sheet={pick.sheet}
|
|
482
|
+
busy={using}
|
|
483
|
+
onCancel={() => setPick(null)}
|
|
484
|
+
onConfirm={confirmUse}
|
|
485
|
+
/>
|
|
486
|
+
) : (
|
|
487
|
+
<ProjectAccountMenu
|
|
488
|
+
menu={menu}
|
|
489
|
+
face={face}
|
|
490
|
+
list={list}
|
|
491
|
+
view={acctView}
|
|
492
|
+
onView={setAcctView}
|
|
493
|
+
onFix={fixSignIn}
|
|
494
|
+
onPick={(row) =>
|
|
495
|
+
setPick({
|
|
496
|
+
row,
|
|
497
|
+
sheet: switchSheet({ row, project: projectName, place: acct.place, conn }),
|
|
498
|
+
})
|
|
499
|
+
}
|
|
500
|
+
onAction={(id, params) => {
|
|
501
|
+
closeAcct();
|
|
502
|
+
if (id === 'show-in-finder')
|
|
503
|
+
void doors.revealPath(cfg?.designRel || '.design');
|
|
504
|
+
else if (id === 'retry') retry();
|
|
505
|
+
else if (id === 'review-link') {
|
|
506
|
+
// 2.1.1 T8 — an address the repo names: the Share sheet's Connect row, the one
|
|
507
|
+
// consent step; never a sign-in with that address filled in
|
|
508
|
+
requestShareFocus('connect');
|
|
509
|
+
menuRunner.run('share.open');
|
|
510
|
+
} else menuRunner.run(id, params);
|
|
511
|
+
}}
|
|
512
|
+
/>
|
|
513
|
+
)}
|
|
433
514
|
</ProjectAccountPopover>
|
|
434
515
|
</span>
|
|
435
|
-
{
|
|
516
|
+
{native && face ? (
|
|
436
517
|
<AccountChip
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
518
|
+
face={face}
|
|
519
|
+
accountId={cfg?.profile?.id || 'default'}
|
|
520
|
+
onOpen={() => {
|
|
521
|
+
setAcctView('menu');
|
|
522
|
+
setPick(null);
|
|
523
|
+
setAcctOpen((o) => !o);
|
|
524
|
+
}}
|
|
442
525
|
opened={acctOpen}
|
|
443
526
|
/>
|
|
444
527
|
) : null}
|
|
@@ -449,7 +532,7 @@ export function ShellShareCluster() {
|
|
|
449
532
|
faces={faces}
|
|
450
533
|
onFollow={lane.follow}
|
|
451
534
|
presence={presence}
|
|
452
|
-
status={shown}
|
|
535
|
+
status={withConnection(shown, conn)}
|
|
453
536
|
access={access}
|
|
454
537
|
commentsCount={comments ? Number(comments.unreadCount) || 0 : Number(totalOpen) || 0}
|
|
455
538
|
commentsCountKind={comments ? 'unread' : 'open'}
|
|
@@ -324,8 +324,9 @@ function settingsPart({ native, cloud, readOnly }) {
|
|
|
324
324
|
).map((r) => ({
|
|
325
325
|
testid: r.testid,
|
|
326
326
|
section: r.section,
|
|
327
|
-
// The account row needs an address the shell may not have (a desktop not signed in, a hub with no dashboard)
|
|
328
|
-
|
|
327
|
+
// The account row needs an address the shell may not have (a desktop not signed in, a hub with no dashboard);
|
|
328
|
+
// a row under a fold (2.1.1 T6: This project › Sync details) is drawn once that fold is open.
|
|
329
|
+
...(r.account || r.fold ? { conditional: true } : {}),
|
|
329
330
|
}));
|
|
330
331
|
return {
|
|
331
332
|
present: true,
|