dsh-client-auto-continue 0.13.0 → 0.14.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.
@@ -208,12 +208,13 @@ export class CardForm<T> {
208
208
 
209
209
  /**
210
210
  * Write every staged edit, then re-seed from what the Host accepted.
211
- * @returns settlement after every write and the read-back.
211
+ * @returns true only when a non-empty save was accepted and read back.
212
212
  */
213
- async save(): Promise<void> {
213
+ async save(): Promise<boolean> {
214
214
  const plan = this.plan();
215
215
  const writes = plan.flatMap((item) => (item.run === undefined ? [] : [item.run]));
216
- if (plan.length === 0 || this.saving || writes.length !== plan.length) return;
216
+ const snapshot = this.scope.getSnapshot();
217
+ if (plan.length === 0 || this.saving || writes.length !== plan.length || snapshot.status !== 'ready' || !snapshot.writable || snapshot.mode !== 'host') return false;
217
218
  // Keep the staged edits this save writes. A field can be staged again
218
219
  // while a write is pending, so clear it only if that exact edit remains.
219
220
  const edits = plan.map(({ field, staged }) => ({ field, staged }));
@@ -221,8 +222,12 @@ export class CardForm<T> {
221
222
  this.failed = false;
222
223
  this.publish();
223
224
  let landed = true;
224
- for (const write of writes) {
225
- landed = (await write()) && landed;
225
+ try {
226
+ for (const write of writes) {
227
+ landed = (await write()) && landed;
228
+ }
229
+ } catch {
230
+ landed = false;
226
231
  }
227
232
  if (landed) {
228
233
  for (const { field, staged } of edits) {
@@ -232,6 +237,7 @@ export class CardForm<T> {
232
237
  this.saving = false;
233
238
  this.failed = !landed;
234
239
  this.publish();
240
+ return landed;
235
241
  }
236
242
 
237
243
  /**
@@ -258,13 +264,13 @@ export class CardForm<T> {
258
264
  }
259
265
 
260
266
  private async clear(field: string): Promise<boolean> {
261
- await this.scope.unset(field);
262
- return !this.stored(field);
267
+ const accepted = await this.scope.unset(field);
268
+ return accepted !== false && !this.stored(field);
263
269
  }
264
270
 
265
271
  private async store(field: string, value: unknown): Promise<boolean> {
266
- await this.scope.set(field, value);
267
- return this.userLayer()?.[field] === value;
272
+ const accepted = await this.scope.set(field, value);
273
+ return accepted !== false && this.userLayer()?.[field] === value;
268
274
  }
269
275
 
270
276
  private stage(field: string, edit: StagedEdit): void {
@@ -0,0 +1,42 @@
1
+ import { en, zh, type SettingsCardKey } from './locales.ts';
2
+
3
+ type Permission = NotificationPermission | 'unsupported' | 'failed';
4
+ export type SettingsNotice = 'enabled' | 'disabled' | 'saved';
5
+ let pendingPermission: Promise<Permission> | undefined;
6
+
7
+ /** Called directly by Save, before a network await can consume user activation. */
8
+ export function prepareSettingsNotification(enabled: boolean): Promise<Permission> {
9
+ try {
10
+ if (typeof Notification === 'undefined') return Promise.resolve('unsupported');
11
+ if (!enabled || Notification.permission !== 'default') return Promise.resolve(Notification.permission);
12
+ if (!pendingPermission) {
13
+ pendingPermission = Notification.requestPermission()
14
+ .catch((): Permission => 'failed')
15
+ .finally(() => { pendingPermission = undefined; });
16
+ }
17
+ return pendingPermission;
18
+ } catch {
19
+ return Promise.resolve('failed');
20
+ }
21
+ }
22
+
23
+ /** The save is already committed. Notification failures must never undo it. */
24
+ export function showSettingsNotification(notice: SettingsNotice, locale: string, permission: Permission): SettingsCardKey {
25
+ const message: SettingsCardKey = `notification.${notice}`;
26
+ if (permission !== 'granted') {
27
+ // Turning alerts off must not ask for permission just to confirm the change.
28
+ if (notice === 'disabled') return message;
29
+ return permission === 'unsupported' ? 'notification.unsupported'
30
+ : permission === 'failed' ? 'notification.failed' : 'notification.blocked';
31
+ }
32
+ try {
33
+ const copy = locale.startsWith('en') ? en : zh;
34
+ const notification = new Notification(copy['notification.title'], { body: copy[message] });
35
+ notification.onclick = () => {
36
+ try { globalThis.focus?.(); } catch { /* Focusing is best effort. */ }
37
+ };
38
+ return message;
39
+ } catch {
40
+ return notice === 'disabled' ? message : 'notification.failed';
41
+ }
42
+ }
@@ -21,393 +21,121 @@ const css = `
21
21
  .dshAcSwitch:disabled { opacity: .5; cursor: default; }
22
22
  .dshAcSwitch:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 2px; }
23
23
  .dshAcCard {
24
- --dsh-ac-violet: #8b7cff;
25
- --dsh-ac-cyan: #45cce5;
26
- --dsh-ac-mint: #46d69d;
27
- --dsh-ac-red: #e5484d;
28
- --dsh-ac-amber: #f1b95c;
29
- isolation: isolate;
30
- position: relative;
31
- overflow: hidden;
32
- border: 1px solid var(--dsw-alias-border-l2);
33
- background: var(--dsw-alias-bg-layer-3);
34
- border-radius: 16px;
35
- list-style: none;
36
- box-shadow: 0 10px 34px rgb(0 0 0 / 8%);
37
- transition: border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
38
- }
39
- .dshAcCard::before {
40
- content: "";
41
- z-index: 2;
42
- position: absolute;
43
- inset: 0 0 auto;
44
- height: 2px;
45
- pointer-events: none;
46
- opacity: .72;
47
- background: linear-gradient(90deg, transparent 1%, var(--dsh-ac-violet) 22%, var(--dsh-ac-cyan) 52%, var(--dsh-ac-mint) 80%, transparent 99%);
48
- }
49
- .dshAcCard::after {
50
- content: "";
51
- z-index: -1;
52
- position: absolute;
53
- width: 190px;
54
- height: 190px;
55
- top: -104px;
56
- left: -76px;
57
- pointer-events: none;
58
- border-radius: 999px;
59
- background: radial-gradient(circle, rgb(139 124 255 / 14%) 0, transparent 68%);
60
- }
61
- .dshAcCard:hover {
62
- border-color: color-mix(in srgb, var(--dsh-ac-violet) 48%, var(--dsw-alias-border-l2));
63
- box-shadow: 0 14px 42px rgb(0 0 0 / 12%);
64
- transform: translateY(-1px);
65
- }
66
- .dshAcCardOpen {
67
- background: var(--dsw-alias-bg-layer-2);
68
- border-color: color-mix(in srgb, var(--dsh-ac-violet) 42%, var(--dsw-alias-border-l2));
69
- box-shadow: 0 18px 54px rgb(0 0 0 / 14%);
70
- transform: none;
71
- }
72
- .dshAcHeaderFrame {
73
- align-items: stretch;
74
- flex-direction: column;
75
- display: flex;
76
- }
77
- .dshAcHeader {
78
- appearance: none;
79
- min-width: 0;
80
- flex: 1;
81
- font: inherit;
82
- color: inherit;
83
- text-align: left;
84
- cursor: pointer;
85
- background: none;
86
- border: 0;
87
- border-radius: 16px;
88
- align-items: center;
89
- gap: 14px;
90
- padding: 18px 18px 12px;
91
- display: flex;
92
- }
93
- .dshAcHeader:focus-visible { outline: 2px solid var(--dsh-ac-violet); outline-offset: -3px; }
94
- .dshAcRelayMark {
95
- width: 54px;
96
- height: 54px;
97
- flex: none;
98
- place-items: center;
99
- display: grid;
100
- color: var(--dsh-ac-cyan);
101
- border: 1px solid color-mix(in srgb, var(--dsh-ac-violet) 42%, var(--dsw-alias-border-l2));
102
- border-radius: 17px;
103
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-2) 84%, var(--dsh-ac-violet) 16%);
104
- box-shadow: inset 0 0 0 1px rgb(255 255 255 / 4%), 0 8px 24px rgb(62 51 153 / 16%);
105
- }
106
- .dshAcRelayMark svg { width: 44px; height: 44px; overflow: visible; }
107
- .dshAcRelayArc { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
108
- .dshAcRelayArcEcho { opacity: .42; }
109
- .dshAcRelayNode { stroke: var(--dsw-alias-bg-layer-3); stroke-width: 1.5; }
110
- .dshAcRelayNodeStart { fill: var(--dsh-ac-amber); }
111
- .dshAcRelayNodeEnd { fill: var(--dsh-ac-mint); }
112
- .dshAcRelayPulse { fill: var(--dsh-ac-violet); opacity: .85; }
113
- .dshAcCard:hover .dshAcRelayPulse, .dshAcCardOpen .dshAcRelayPulse {
114
- animation: dshAcRelayTravel 1.8s cubic-bezier(.4, 0, .2, 1) infinite;
115
- }
116
- .dshAcHeadText { flex-direction: column; flex: 1; gap: 3px; min-width: 0; display: flex; }
117
- .dshAcName {
118
- color: var(--dsw-alias-label-primary);
119
- font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", sans-serif;
120
- font-size: 18px;
121
- font-weight: 680;
122
- letter-spacing: -.015em;
123
- line-height: 1.35;
124
- }
125
- .dshAcDescription { max-width: 660px; color: var(--dsw-alias-label-tertiary); font-size: 13px; line-height: 1.5; }
126
- .dshAcJourney { flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 4px; display: flex; }
127
- .dshAcJourneyStep {
128
- align-items: center;
129
- gap: 5px;
130
- color: var(--dsw-alias-label-secondary);
131
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
132
- font-size: 10px;
133
- font-weight: 600;
134
- line-height: 1.4;
135
- letter-spacing: .02em;
136
- display: inline-flex;
137
- }
138
- .dshAcJourneyDot { width: 5px; height: 5px; flex: none; border-radius: 999px; background: currentColor; box-shadow: 0 0 0 3px rgb(255 255 255 / 3%); }
139
- .dshAcJourneyInterrupted .dshAcJourneyDot { color: var(--dsh-ac-amber); }
140
- .dshAcJourneyGrace .dshAcJourneyDot { color: var(--dsh-ac-cyan); }
141
- .dshAcJourneyContinue .dshAcJourneyDot { color: var(--dsh-ac-mint); }
142
- .dshAcJourneyLine {
143
- width: 25px;
144
- height: 1px;
145
- flex: none;
146
- opacity: .7;
147
- background: linear-gradient(90deg, var(--dsh-ac-violet), var(--dsh-ac-cyan), var(--dsh-ac-mint));
148
- background-size: 220% 100%;
149
- }
150
- .dshAcCard:hover .dshAcJourneyLine, .dshAcCardOpen .dshAcJourneyLine { animation: dshAcSignalSweep 1.8s linear infinite; }
151
- .dshAcChevron {
152
- width: 30px;
153
- height: 30px;
154
- color: var(--dsw-alias-label-tertiary);
155
- border: 1px solid var(--dsw-alias-border-l2);
156
- border-radius: 999px;
157
- flex: none;
158
- place-items: center;
159
- display: grid;
160
- transition: color .18s ease, border-color .18s ease, transform .18s ease;
161
- }
162
- .dshAcChevron svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
163
- .dshAcHeader:hover .dshAcChevron { color: var(--dsh-ac-violet); border-color: color-mix(in srgb, var(--dsh-ac-violet) 48%, var(--dsw-alias-border-l2)); }
164
- .dshAcChevronOpen { transform: rotate(180deg); }
165
- .dshAcGithub {
166
- min-width: 0;
167
- max-width: none;
168
- align-self: stretch;
169
- align-items: center;
170
- gap: 10px;
171
- margin: 0 18px 16px;
172
- padding: 9px 11px;
173
- color: var(--dsw-alias-label-primary);
174
- text-decoration: none;
175
- border: 1px solid var(--dsw-alias-border-l2);
176
- border-radius: 13px;
177
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-2) 90%, var(--dsh-ac-violet) 10%);
178
- display: flex;
179
- transition: border-color .18s ease, background .18s ease, transform .18s ease;
180
- }
181
- .dshAcGithub:hover {
182
- border-color: color-mix(in srgb, var(--dsh-ac-violet) 58%, var(--dsw-alias-border-l2));
183
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-2) 82%, var(--dsh-ac-violet) 18%);
184
- transform: translateY(-1px);
185
- }
186
- .dshAcGithub:focus-visible { outline: 2px solid var(--dsh-ac-violet); outline-offset: 2px; }
187
- .dshAcGithubIcon { width: 23px; height: 23px; flex: none; color: var(--dsw-alias-label-primary); }
188
- .dshAcGithubIcon svg { width: 100%; height: 100%; fill: currentColor; }
189
- .dshAcGithubText { min-width: 0; flex: 1; flex-direction: column; gap: 1px; display: flex; }
190
- .dshAcGithubAction { font-size: 12px; font-weight: 680; line-height: 1.4; }
191
- .dshAcGithubAction::before { content: "★"; color: var(--dsh-ac-amber); margin-right: 5px; }
192
- .dshAcGithubSlug {
193
- overflow: hidden;
194
- color: var(--dsw-alias-label-tertiary);
195
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
196
- font-size: 9.5px;
197
- line-height: 1.4;
198
- text-overflow: ellipsis;
199
- white-space: nowrap;
200
- }
201
- .dshAcExternal { width: 15px; height: 15px; flex: none; color: var(--dsw-alias-label-tertiary); }
202
- .dshAcExternal svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
203
- .dshAcBody { border-top: 1px solid var(--dsw-alias-border-l2); margin: 0 18px 12px; padding: 4px 0 0; }
204
- .dshAcReadOnly { color: var(--dsw-alias-label-tertiary); margin: 12px 0 0; font-size: 12px; line-height: 1.5; }
205
- .dshAcPending {
206
- white-space: nowrap;
207
- background: var(--dsw-alias-bg-module-platform);
208
- color: var(--dsw-alias-label-secondary);
209
- border-radius: 999px;
210
- flex: none;
211
- padding: 1px 8px;
212
- font-size: 11px;
213
- font-weight: 500;
214
- line-height: 17px;
215
- }
216
- .dshAcFooter {
217
- border-top: 1px solid var(--dsw-alias-border-l2);
218
- justify-content: flex-end;
219
- align-items: center;
220
- gap: 8px;
221
- padding: 12px 0 4px;
222
- display: flex;
223
- }
224
- .dshAcFailed { min-width: 0; color: var(--dsw-alias-label-error); flex: 1; margin: 0; font-size: 12px; line-height: 1.5; }
225
- .dshAcDiscard, .dshAcSave {
226
- appearance: none;
24
+ --dsh-ac-bg: var(--dsw-alias-bg-base, var(--dsw-alias-bg-layer-2));
25
+ --dsh-ac-line: var(--dsw-alias-border-l2);
26
+ --dsh-ac-text: var(--dsw-alias-label-primary);
27
+ --dsh-ac-muted: var(--dsw-alias-label-tertiary);
28
+ container: auto-continue-settings / inline-size;
29
+ color: var(--dsh-ac-text);
227
30
  font: inherit;
228
- cursor: pointer;
229
- border: 1px solid transparent;
230
- border-radius: 8px;
231
- padding: 5px 14px;
232
31
  font-size: 13px;
233
32
  line-height: 1.5;
234
- }
235
- .dshAcDiscard { border-color: var(--dsw-alias-border-l2); color: var(--dsw-alias-label-secondary); background: none; }
236
- .dshAcDiscard:hover:not(:disabled) { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-label-dimmed); }
237
- .dshAcSave { background: var(--dsw-alias-label-primary); color: var(--dsw-alias-bg-layer-3); }
238
- .dshAcDiscard:disabled, .dshAcSave:disabled { opacity: .4; cursor: default; }
239
- .dshAcDiscard:focus-visible, .dshAcSave:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary); outline-offset: 1px; }
240
- .dshAcFormCanvas { flex-direction: column; gap: 14px; padding: 12px 0 8px; display: flex; }
241
- .dshAcFormSection {
242
- --dsh-ac-section: var(--dsh-ac-violet);
243
- overflow: hidden;
244
- border: 1px solid var(--dsw-alias-border-l2);
245
- border-radius: 14px;
246
- background: var(--dsw-alias-bg-layer-3);
247
- background: color-mix(in srgb, var(--dsw-alias-bg-layer-3) 95%, var(--dsh-ac-section) 5%);
248
- }
249
- .dshAcFormSection-handoff { --dsh-ac-section: var(--dsh-ac-mint); }
250
- .dshAcFormSection-autoloop { --dsh-ac-section: var(--dsh-ac-red); }
251
- .dshAcFormSection-safety { --dsh-ac-section: var(--dsh-ac-amber); }
252
- .dshAcFormSection-recovery { --dsh-ac-section: var(--dsh-ac-cyan); }
253
- .dshAcFormSection-loop { --dsh-ac-section: var(--dsh-ac-violet); }
254
- .dshAcFormSection-live { --dsh-ac-section: color-mix(in srgb, var(--dsh-ac-violet) 60%, var(--dsh-ac-cyan)); }
255
- .dshAcSectionHead {
256
- align-items: center;
257
- gap: 11px;
258
- padding: 13px 14px 11px;
259
- border-bottom: 1px solid var(--dsw-alias-border-l2);
260
- display: flex;
261
- }
262
- .dshAcSectionSignal {
263
- width: 4px;
264
- height: 34px;
265
- flex: none;
266
- border-radius: 999px;
267
- background: var(--dsh-ac-section);
268
- box-shadow: 0 0 18px color-mix(in srgb, var(--dsh-ac-section) 55%, transparent);
269
- }
270
- .dshAcSectionCopy { min-width: 0; flex-direction: column; gap: 2px; display: flex; }
271
- .dshAcSectionTitle {
272
- color: var(--dsw-alias-label-primary);
273
- font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", sans-serif;
274
- font-size: 14px;
275
- font-weight: 680;
276
- line-height: 1.4;
277
- }
278
- .dshAcSectionDescription { color: var(--dsw-alias-label-tertiary); font-size: 11.5px; line-height: 1.45; }
279
- .dshAcSectionGrid {
280
- grid-template-columns: repeat(2, minmax(0, 1fr));
281
- column-gap: 22px;
282
- padding: 0 14px 4px;
283
- display: grid;
284
- }
285
- .dshAcField { min-width: 0; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--dsw-alias-border-l2); display: flex; }
286
- .dshAcSectionGrid > .dshAcField:first-child { border-top: 0; }
287
- .dshAcFieldWide { grid-column: 1 / -1; }
288
- .dshAcHead { align-items: center; gap: 8px; display: flex; }
289
- .dshAcLabel { min-width: 0; color: var(--dsw-alias-label-primary); flex: 1; font-size: 13px; font-weight: 500; line-height: 1.5; }
290
- .dshAcBadges { align-items: center; gap: 8px; display: inline-flex; }
291
- .dshAcBadge {
292
- white-space: nowrap;
293
- background: var(--dsw-alias-bg-module-platform);
294
- color: var(--dsw-alias-label-secondary);
295
- border-radius: 999px;
296
- padding: 1px 8px;
297
- font-size: 11px;
298
- font-weight: 500;
299
- line-height: 17px;
300
- }
301
- .dshAcReset {
302
- font: inherit;
303
- color: var(--dsw-alias-label-secondary);
304
- cursor: pointer;
305
- background: none;
306
- border: none;
33
+ list-style: none;
307
34
  padding: 0;
308
- font-size: 12px;
309
- line-height: 1.5;
310
- }
311
- .dshAcReset:hover:not(:disabled) { color: var(--dsw-alias-label-primary); }
312
- .dshAcReset:disabled { cursor: default; }
313
- .dshAcInput {
314
- box-sizing: border-box;
315
- width: 100%;
316
- border: 1px solid var(--dsw-alias-border-l2);
317
- background: var(--dsw-alias-bg-layer-3);
318
- height: 34px;
319
- font: inherit;
320
- color: var(--dsw-alias-label-primary);
321
- border-radius: 8px;
322
- padding: 0 12px;
323
- font-size: 13px;
324
- line-height: 1.5;
325
- }
326
- .dshAcInput:focus-visible { border-color: var(--dsw-alias-brand-primary); outline: none; }
327
- .dshAcInput:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; }
328
- .dshAcInputInvalid { border-color: var(--dsw-alias-label-error); }
329
- .dshAcTextArea { box-sizing: border-box; height: auto; min-height: 84px; padding: 8px 12px; resize: vertical; }
330
- .dshAcSelect {
331
- box-sizing: border-box;
332
- width: 100%;
333
- border: 1px solid var(--dsw-alias-border-l2);
334
- background: var(--dsw-alias-bg-layer-3);
335
- height: 34px;
336
- font: inherit;
337
- color: var(--dsw-alias-label-primary);
338
- border-radius: 8px;
339
- padding: 0 8px;
340
- font-size: 13px;
341
- line-height: 1.5;
342
- }
343
- .dshAcSelect:focus-visible { border-color: var(--dsw-alias-brand-primary); outline: none; }
344
- .dshAcSelect:disabled { color: var(--dsw-alias-label-tertiary); cursor: default; }
345
- .dshAcInvalid { color: var(--dsw-alias-label-error); margin: 0; font-size: 12px; line-height: 1.5; }
346
- .dshAcHint { color: var(--dsw-alias-label-tertiary); margin: 0; font-size: 12px; line-height: 1.5; }
347
- .dshAcPanel { min-width: 0; flex-direction: column; gap: 8px; padding: 12px 0 14px; display: flex; }
348
- .dshAcPanel + .dshAcPanel { border-left: 1px solid var(--dsw-alias-border-l2); padding-left: 20px; }
349
- .dshAcPanelHead { align-items: center; gap: 8px; display: flex; }
350
- .dshAcPanelTitle { color: var(--dsw-alias-label-primary); flex: 1; font-size: 13px; font-weight: 600; line-height: 1.5; }
351
- .dshAcStats { gap: 4px 16px; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); display: grid; }
352
- .dshAcStats > div { justify-content: space-between; gap: 8px; display: flex; }
353
- .dshAcStats dt { color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 1.5; }
354
- .dshAcStats dd { color: var(--dsw-alias-label-primary); margin: 0; font-size: 12px; font-weight: 600; line-height: 1.5; }
355
- .dshAcCodes { flex-wrap: wrap; align-items: center; gap: 6px; display: flex; }
356
- .dshAcCode {
357
- white-space: nowrap;
358
- background: var(--dsw-alias-bg-module-platform);
359
- color: var(--dsw-alias-label-secondary);
360
- border-radius: 999px;
361
- padding: 1px 8px;
362
- font-size: 11px;
363
- font-weight: 500;
364
- line-height: 17px;
365
- }
366
- .dshAcPauseList { flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; display: flex; }
367
- .dshAcPauseList li { align-items: center; gap: 8px; display: flex; }
368
- .dshAcPauseId {
369
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
370
- color: var(--dsw-alias-label-primary);
371
- font-size: 12px;
372
- line-height: 1.5;
373
- }
374
- @keyframes dshAcRelayTravel {
375
- 0% { opacity: 0; transform: translate(-19px, 18px) scale(.7); }
376
- 18% { opacity: 1; }
377
- 82% { opacity: 1; }
378
- 100% { opacity: 0; transform: translate(12px, 6px) scale(1.15); }
379
- }
380
- @keyframes dshAcSignalSweep {
381
- from { background-position: 100% 0; }
382
- to { background-position: -120% 0; }
383
- }
384
- @media (max-width: 820px) {
385
- .dshAcSectionGrid { grid-template-columns: minmax(0, 1fr); }
386
- .dshAcFieldWide { grid-column: auto; }
387
- .dshAcPanel + .dshAcPanel {
388
- border-top: 1px solid var(--dsw-alias-border-l2);
389
- border-left: 0;
390
- padding-left: 0;
391
- }
392
- }
393
- @media (max-width: 560px) {
394
- .dshAcHeader { align-items: flex-start; gap: 11px; padding: 15px 13px 10px; }
395
- .dshAcRelayMark { width: 46px; height: 46px; border-radius: 14px; }
396
- .dshAcRelayMark svg { width: 38px; height: 38px; }
397
- .dshAcName { font-size: 16px; }
398
- .dshAcDescription { font-size: 12px; }
399
- .dshAcJourney { gap: 5px; }
400
- .dshAcJourneyLine { width: 13px; }
401
- .dshAcChevron { width: 27px; height: 27px; }
402
- .dshAcPending { display: none; }
403
- .dshAcGithub { margin: 0 13px 13px; }
404
- .dshAcBody { margin-right: 13px; margin-left: 13px; }
405
- }
406
- @media (prefers-reduced-motion: reduce) {
407
- .dshAcCard, .dshAcGithub, .dshAcChevron { transition: none; }
408
- .dshAcCard:hover, .dshAcGithub:hover { transform: none; }
409
- .dshAcRelayPulse, .dshAcJourneyLine { animation: none !important; }
410
35
  }
36
+ .dshAcCard *, .dshAcCard *::before, .dshAcCard *::after { box-sizing: border-box; }
37
+ .dshAcCard :is(h2,h3,p) { margin: 0; }
38
+ .dshAcCard :is(button,input,textarea) { font: inherit; }
39
+ .dshAcCard button { cursor: pointer; }
40
+ .dshAcCard button:disabled { opacity: .4; cursor: default; }
41
+ .dshAcCard :is(a,button,input,textarea):focus-visible { outline: 2px solid var(--dsh-ac-text); outline-offset: 3px; }
42
+ .dshAcHeaderFrame { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: center; gap: 24px; margin: 20px 0; padding: 16px 18px; border-radius: 9px; color: #f9fafb; background: #23262c; }
43
+ .dshAcIntroduction { min-width: 0; }
44
+ .dshAcTitleLine { display: flex; align-items: center; gap: 10px; }
45
+ .dshAcTitleLine h2 { font-size: 17px; font-weight: 620; line-height: 1.4; white-space: nowrap; }
46
+ .dshAcStatus { white-space: nowrap; font-size: 11px; color: #dce0e6; background: #ffffff14; border-radius: 5px; padding: 2px 7px; }
47
+ .dshAcIntroduction p { margin-top: 5px; color: #b9bec8; font-size: 12px; line-height: 1.6; }
48
+ .dshAcRepository { display: flex; align-items: center; gap: 12px; min-width: 0; }
49
+ .dshAcStar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid #625032; border-radius: 50%; background: #302c25; color: #e9be6d; }
50
+ .dshAcStar svg { width: 18px; height: 18px; fill: #e9be6d12; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
51
+ .dshAcRepositoryCopy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; }
52
+ .dshAcRepositoryCopy strong { font-size: 13px; font-weight: 560; line-height: 1.5; }
53
+ .dshAcRepositoryCopy > span { color: #b9bec8; font-size: 10px; line-height: 1.6; }
54
+ .dshAcRepositoryCopy > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
55
+ .dshAcCard a.dshAcGithub { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none; min-height: 38px; padding: 9px 11px; border: 1px solid transparent; border-radius: 6px; color: #202329; background: #f4f5f7; text-decoration: none; font-size: 12px; font-weight: 550; white-space: nowrap; transition: background-color 140ms ease, box-shadow 140ms ease; }
56
+ .dshAcCard a.dshAcGithub:hover { background: #fff; box-shadow: 0 0 0 3px #ffffff18; }
57
+ .dshAcCard a.dshAcGithub:focus-visible { outline-color: #e9be6d; }
58
+ .dshAcGithub > svg { flex: none; width: 17px; height: 17px; fill: currentColor; }
59
+ .dshAcGithub > svg.dshAcExternal { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; margin-left: 2px; }
60
+ .dshAcGithubShort { display: none; }
61
+ .dshAcReadOnly { padding: 10px 0; color: var(--dsh-ac-muted); }
62
+ .dshAcLayout { display: grid; grid-template-columns: 164px minmax(0, 1fr); border-top: 1px solid var(--dsh-ac-line); min-height: 462px; }
63
+ .dshAcNav { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 16px 0; position: sticky; top: 16px; align-self: start; }
64
+ .dshAcNav > button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 37px; padding: 8px 11px; border: 0; border-radius: 6px; text-align: left; background: none; color: var(--dsw-alias-label-secondary); }
65
+ .dshAcNav > button:hover, .dshAcNav > button[aria-selected=true] { color: var(--dsh-ac-text); background: var(--dsw-alias-interactive-bg-hover); }
66
+ .dshAcNav > button[aria-selected=true] { font-weight: 600; }
67
+ .dshAcInvalidMark { color: var(--dsw-alias-state-error-primary); font-weight: 600; }
68
+ .dshAcCategory { min-width: 0; padding: 20px 0 16px 26px; border-left: 1px solid var(--dsh-ac-line); }
69
+ .dshAcCategoryHeading { padding-bottom: 14px; }
70
+ .dshAcCategoryHeading h3 { font-size: 15px; font-weight: 620; }
71
+ .dshAcCategoryHeading p { color: var(--dsh-ac-muted); font-size: 12px; margin-top: 3px; }
72
+ .dshAcField { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 24px; padding: 18px 0; border-bottom: 1px solid var(--dsh-ac-line); }
73
+ .dshAcField:last-child { border-bottom: 0; }
74
+ .dshAcFieldCopy { min-width: 0; }
75
+ .dshAcLabel { display: block; font-size: 14px; font-weight: 480; color: var(--dsh-ac-text); }
76
+ .dshAcHint { color: var(--dsh-ac-muted); font-size: 12px; line-height: 1.6; }
77
+ .dshAcFieldCopy p { margin-top: 4px; }
78
+ .dshAcFieldControl { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
79
+ .dshAcReset { padding: 0; border: 0; background: none; color: var(--dsh-ac-muted); font-size: 11px !important; white-space: nowrap; }
80
+ .dshAcReset:hover:not(:disabled) { color: var(--dsh-ac-text); text-decoration: underline; }
81
+ .dshAcInput { border: 1px solid var(--dsh-ac-line); border-radius: 6px; background: var(--dsh-ac-bg); color: var(--dsh-ac-text); padding: 8px 11px; }
82
+ .dshAcInput::placeholder { color: var(--dsh-ac-muted); opacity: .7; }
83
+ .dshAcInput[aria-invalid=true] { border-color: var(--dsw-alias-state-error-primary); }
84
+ .dshAcNumber { width: 132px; min-width: 0; font-variant-numeric: tabular-nums; }
85
+ .dshAcFieldText { display: block; }
86
+ .dshAcFieldText .dshAcFieldControl { margin-top: 10px; flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
87
+ .dshAcTextArea { display: block; width: 100%; min-height: 66px; resize: vertical; line-height: 1.6; }
88
+ .dshAcInvalid, .dshAcFailed { color: var(--dsw-alias-state-error-primary); font-size: 12px; }
89
+ .dshAcFooter { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 24px; padding: 13px 0; border-top: 1px solid var(--dsh-ac-line); background: var(--dsh-ac-bg); }
90
+ .dshAcFooter[data-dirty=true] { position: sticky; z-index: 8; bottom: 0; }
91
+ .dshAcFooter > div { display: flex; align-items: center; gap: 8px; }
92
+ .dshAcDiscard, .dshAcSave { padding: 7px 13px; border: 1px solid var(--dsh-ac-line); border-radius: 6px; font-size: 12px !important; background: var(--dsh-ac-bg); color: var(--dsh-ac-text); white-space: nowrap; }
93
+ .dshAcSave { background: var(--dsh-ac-text); color: var(--dsh-ac-bg); border-color: var(--dsh-ac-text); }
94
+ .dshAcDiscard:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
95
+ .dshAcSave:hover:not(:disabled) { opacity: .85; }
96
+ .dshAcPanel { padding: 20px 0; border-top: 1px solid var(--dsh-ac-line); }
97
+ .dshAcPanelHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
98
+ .dshAcPanelTitle { font-weight: 550; }
99
+ .dshAcStats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
100
+ .dshAcStats dt { font-size: 11px; color: var(--dsh-ac-muted); }
101
+ .dshAcStats dd { margin: 4px 0 0; font-size: 19px; font-weight: 550; font-variant-numeric: tabular-nums; }
102
+ .dshAcCodes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
103
+ .dshAcCode { font: 11px ui-monospace, SFMono-Regular, monospace; border: 1px solid var(--dsh-ac-line); border-radius: 4px; padding: 3px 6px; }
104
+ .dshAcPauseList { list-style: none; margin: 0; padding: 0; }
105
+ .dshAcPauseList li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
106
+ .dshAcPauseId { flex: 1; font: 12px ui-monospace, SFMono-Regular, monospace; }
107
+ @container auto-continue-settings (max-width: 760px) {
108
+ .dshAcHeaderFrame { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
109
+ .dshAcRepositoryCopy { display: none; }
110
+ .dshAcRepository { gap: 10px; }
111
+ .dshAcLayout { grid-template-columns: 136px minmax(0, 1fr); }
112
+ .dshAcCategory { padding-left: 20px; }
113
+ .dshAcFieldControl { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
114
+ }
115
+ @container auto-continue-settings (max-width: 560px) {
116
+ .dshAcLayout { display: block; min-height: 0; }
117
+ .dshAcNav { flex-direction: row; overflow-x: auto; position: static; padding: 12px 0; border-bottom: 1px solid var(--dsh-ac-line); }
118
+ .dshAcNav > button { flex: none; font-size: 12px; min-height: 34px; padding: 7px 10px; }
119
+ .dshAcCategory { border-left: 0; padding: 20px 0; }
120
+ .dshAcField { gap: 8px 14px; }
121
+ .dshAcLabel { font-size: 13px; }
122
+ .dshAcNumber { width: 98px; }
123
+ .dshAcFooter { align-items: flex-start; flex-direction: column; gap: 10px; }
124
+ .dshAcFooter > div { width: 100%; justify-content: flex-end; }
125
+ }
126
+ @container auto-continue-settings (max-width: 440px) {
127
+ .dshAcHeaderFrame { gap: 12px; padding: 14px; }
128
+ .dshAcTitleLine { gap: 6px; }
129
+ .dshAcTitleLine h2 { font-size: 15px; white-space: normal; }
130
+ .dshAcStatus { padding: 2px 5px; font-size: 10px; }
131
+ .dshAcIntroduction p { font-size: 11px; }
132
+ .dshAcStar, .dshAcGithubLong { display: none; }
133
+ .dshAcGithubShort { display: inline; }
134
+ .dshAcCard a.dshAcGithub { gap: 6px; padding: 8px; font-size: 11px; }
135
+ .dshAcGithub > svg.dshAcExternal { display: none; }
136
+ }
137
+ @media (prefers-reduced-motion: reduce) { .dshAcCard a.dshAcGithub { transition: none; } }
138
+
411
139
  `;
412
140
 
413
141
  /** Inject the stylesheet once; a no-op outside a browser environment. */