@wildwinter/app-shell 0.39.0 → 0.40.1
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/README.md +7 -0
- package/dist/about.css +5 -5
- package/dist/about.css.map +1 -1
- package/dist/anchored.css +5 -5
- package/dist/anchored.css.map +1 -1
- package/dist/chunk-4OAORWEM.js +56 -0
- package/dist/chunk-4OAORWEM.js.map +1 -0
- package/dist/{chunk-K2AOLQW4.js → chunk-EHR2KBZC.js} +3 -3
- package/dist/{chunk-K2AOLQW4.js.map → chunk-EHR2KBZC.js.map} +1 -1
- package/dist/{chunk-KGAMP5LW.js → chunk-G2JT3HZH.js} +16 -3
- package/dist/chunk-G2JT3HZH.js.map +1 -0
- package/dist/{chunk-S4KWQLYN.js → chunk-OPZPFOPS.js} +4 -4
- package/dist/{chunk-S4KWQLYN.js.map → chunk-OPZPFOPS.js.map} +1 -1
- package/dist/{chunk-L5HOBEKL.js → chunk-R3NXPHRZ.js} +3 -3
- package/dist/{chunk-L5HOBEKL.js.map → chunk-R3NXPHRZ.js.map} +1 -1
- package/dist/{chunk-C6UVQYKI.js → chunk-SEWJLUOD.js} +3 -3
- package/dist/{chunk-C6UVQYKI.js.map → chunk-SEWJLUOD.js.map} +1 -1
- package/dist/{chunk-XZYZXY7I.js → chunk-UG2P777F.js} +36 -3
- package/dist/chunk-UG2P777F.js.map +1 -0
- package/dist/{chunk-2NMVIM54.js → chunk-YRFJLJUH.js} +3 -3
- package/dist/{chunk-2NMVIM54.js.map → chunk-YRFJLJUH.js.map} +1 -1
- package/dist/chunk-YWMSQFXX.js +146 -0
- package/dist/chunk-YWMSQFXX.js.map +1 -0
- package/dist/comments.css +11 -11
- package/dist/comments.css.map +1 -1
- package/dist/confirm.css +2 -2
- package/dist/confirm.css.map +1 -1
- package/dist/context-menu.cjs.map +1 -1
- package/dist/context-menu.css +1 -1
- package/dist/context-menu.css.map +1 -1
- package/dist/context-menu.js +2 -2
- package/dist/controls.css +70 -11
- package/dist/controls.css.map +1 -1
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.css +3 -2
- package/dist/dialog.css.map +1 -1
- package/dist/dialog.js +2 -2
- package/dist/identity.css +2 -2
- package/dist/identity.css.map +1 -1
- package/dist/index.cjs +270 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +39 -6
- package/dist/index.d.ts +39 -6
- package/dist/index.js +17 -13
- package/dist/index.js.map +1 -1
- package/dist/job.css +1 -1
- package/dist/job.css.map +1 -1
- package/dist/keys.cjs +155 -0
- package/dist/keys.cjs.map +1 -0
- package/dist/keys.css +41 -0
- package/dist/keys.css.map +1 -0
- package/dist/keys.d.cts +57 -0
- package/dist/keys.d.ts +57 -0
- package/dist/keys.js +3 -0
- package/dist/keys.js.map +1 -0
- package/dist/link-status.cjs +13 -0
- package/dist/link-status.cjs.map +1 -1
- package/dist/link-status.css +8 -8
- package/dist/link-status.css.map +1 -1
- package/dist/link-status.js +2 -2
- package/dist/notes-editor.css +7 -7
- package/dist/notes-editor.css.map +1 -1
- package/dist/pane-shell.css +7 -2
- package/dist/pane-shell.css.map +1 -1
- package/dist/problems.cjs +61 -0
- package/dist/problems.cjs.map +1 -0
- package/dist/problems.d.cts +57 -0
- package/dist/problems.d.ts +57 -0
- package/dist/problems.js +3 -0
- package/dist/problems.js.map +1 -0
- package/dist/property-list.cjs.map +1 -1
- package/dist/property-list.js +2 -2
- package/dist/save.css +1 -1
- package/dist/save.css.map +1 -1
- package/dist/settings.css +13 -13
- package/dist/settings.css.map +1 -1
- package/dist/stale.css +1 -1
- package/dist/stale.css.map +1 -1
- package/dist/stepper.css +14 -4
- package/dist/stepper.css.map +1 -1
- package/dist/toast.css +5 -5
- package/dist/toast.css.map +1 -1
- package/dist/tokens.css +2 -1
- package/dist/tokens.css.map +1 -1
- package/dist/tool-window.css +3 -2
- package/dist/tool-window.css.map +1 -1
- package/dist/tooltip.css +3 -3
- package/dist/tooltip.css.map +1 -1
- package/dist/updater-view.cjs.map +1 -1
- package/dist/updater-view.js +3 -3
- package/dist/updater.css +5 -5
- package/dist/updater.css.map +1 -1
- package/dist/vc.css +1 -1
- package/dist/vc.css.map +1 -1
- package/dist/welcome.cjs.map +1 -1
- package/dist/welcome.css +21 -21
- package/dist/welcome.css.map +1 -1
- package/dist/welcome.js +2 -2
- package/package.json +15 -1
- package/dist/chunk-KGAMP5LW.js.map +0 -1
- package/dist/chunk-XZYZXY7I.js.map +0 -1
package/README.md
CHANGED
|
@@ -131,6 +131,13 @@ needing and never had.
|
|
|
131
131
|
revealRow(document, "mood");
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
+
- **`--linkstatus-reserve`** - how much of the window's bottom-right corner the
|
|
135
|
+
live-link chip takes, published on the document while the chip is visible (`0px`
|
|
136
|
+
while hidden) and re-measured as its address comes and goes. The chip floats over
|
|
137
|
+
that corner, and both apps had things drawn under it. The stepper bar leaves the
|
|
138
|
+
room itself; a host strip that can end in the corner opts in with
|
|
139
|
+
`padding-right: calc(<its own> + var(--linkstatus-reserve, 0px))`.
|
|
140
|
+
|
|
134
141
|
- **`--ok`** joins `--danger` and `--warn` in `tokens.css`, with a `light-dark()`
|
|
135
142
|
default every palette should override in its own `theme.css`. It is the only
|
|
136
143
|
colour in the grammar layer, and it is there because it kept not being
|
package/dist/about.css
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
text-align: center;
|
|
4
4
|
}
|
|
5
5
|
.shell-about .shell-dialog-title {
|
|
6
|
-
font: 600
|
|
6
|
+
font: 600 18.5px/1.2 var(--font-read, var(--font-ui));
|
|
7
7
|
}
|
|
8
8
|
.shell-about .shell-dialog-actions {
|
|
9
9
|
justify-content: center;
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
gap: 2px;
|
|
21
21
|
}
|
|
22
22
|
.shell-about-version {
|
|
23
|
-
font:
|
|
23
|
+
font: 12.5px/1.4 var(--font-ui);
|
|
24
24
|
color: var(--muted);
|
|
25
25
|
margin: 0;
|
|
26
26
|
}
|
|
27
27
|
.shell-about-blurb {
|
|
28
|
-
font:
|
|
28
|
+
font: 13.5px/1.5 var(--font-read, var(--font-ui));
|
|
29
29
|
margin: 6px 0 0;
|
|
30
30
|
}
|
|
31
31
|
.shell-about-credits {
|
|
32
|
-
font:
|
|
32
|
+
font: 12.5px/1.55 var(--font-ui);
|
|
33
33
|
color: var(--muted);
|
|
34
34
|
margin: 2px 0 0;
|
|
35
35
|
white-space: pre-line;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
background: none;
|
|
46
46
|
padding: 0;
|
|
47
47
|
cursor: pointer;
|
|
48
|
-
font:
|
|
48
|
+
font: 12.5px/1 var(--font-ui);
|
|
49
49
|
color: var(--accent);
|
|
50
50
|
text-decoration: underline;
|
|
51
51
|
}
|
package/dist/about.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/about.css"],"sourcesContent":["/* The About surface (about.ts): the family's, so two apps' About boxes are\n recognisably siblings. Quiet, centred, one way out. The panel, scrim and\n actions row are the dialog frame's (dialog.css); the Close button is\n controls.css's `.btn`. What is About's own: everything is centred, the\n name is set in the reading face, and the wordmark sits above it. */\n.shell-about { text-align: center; }\n.shell-about .shell-dialog-title { font: 600
|
|
1
|
+
{"version":3,"sources":["../src/about.css"],"sourcesContent":["/* The About surface (about.ts): the family's, so two apps' About boxes are\n recognisably siblings. Quiet, centred, one way out. The panel, scrim and\n actions row are the dialog frame's (dialog.css); the Close button is\n controls.css's `.btn`. What is About's own: everything is centred, the\n name is set in the reading face, and the wordmark sits above it. */\n.shell-about { text-align: center; }\n.shell-about .shell-dialog-title { font: 600 18.5px/1.2 var(--font-read, var(--font-ui)); }\n.shell-about .shell-dialog-actions { justify-content: center; margin-top: 10px; }\n.shell-about-mark { margin-bottom: 2px; }\n.shell-about-mark svg { max-width: 220px; height: auto; }\n/* The body is a scrolling column, so nothing in it may carry a negative margin: the version line\n would sit above the body's top edge and be clipped. It tucks under the title through the body's\n gap instead. */\n.shell-about .shell-dialog-body { gap: 2px; }\n.shell-about-version { font: 12.5px/1.4 var(--font-ui); color: var(--muted); margin: 0; }\n.shell-about-blurb { font: 13.5px/1.5 var(--font-read, var(--font-ui)); margin: 6px 0 0; }\n.shell-about-credits { font: 12.5px/1.55 var(--font-ui); color: var(--muted); margin: 2px 0 0; white-space: pre-line; }\n.shell-about-links { display: flex; gap: 14px; justify-content: center; margin-top: 6px; }\n/* A link is underlined and coloured, never bare muted text on the ground. */\n.shell-about-link {\n border: 0; background: none; padding: 0; cursor: pointer;\n font: 12.5px/1 var(--font-ui); color: var(--accent); text-decoration: underline;\n}\n.shell-about-link:hover { text-decoration: none; }\n"],"mappings":";AAKA,CAAC;AAAc,cAAY;AAAQ;AACnC,CADC,YACY,CAAC;AAAqB,QAAM,IAAI,MAAM,CAAC,IAAI,IAAI,WAAW,EAAE,IAAI;AAAa;AAC1F,CAFC,YAEY,CAAC;AAAuB,mBAAiB;AAAQ,cAAY;AAAM;AAChF,CAAC;AAAmB,iBAAe;AAAK;AACxC,CADC,iBACiB;AAAM,aAAW;AAAO,UAAQ;AAAM;AAIxD,CARC,YAQY,CAAC;AAAoB,OAAK;AAAK;AAC5C,CAAC;AAAsB,QAAM,MAAM,CAAC,IAAI,IAAI;AAAY,SAAO,IAAI;AAAU,UAAQ;AAAG;AACxF,CAAC;AAAoB,QAAM,MAAM,CAAC,IAAI,IAAI,WAAW,EAAE,IAAI;AAAa,UAAQ,IAAI,EAAE;AAAG;AACzF,CAAC;AAAsB,QAAM,MAAM,CAAC,KAAK,IAAI;AAAY,SAAO,IAAI;AAAU,UAAQ,IAAI,EAAE;AAAG,eAAa;AAAU;AACtH,CAAC;AAAoB,WAAS;AAAM,OAAK;AAAM,mBAAiB;AAAQ,cAAY;AAAK;AAEzF,CAAC;AACC,UAAQ;AAAG,cAAY;AAAM,WAAS;AAAG,UAAQ;AACjD,QAAM,MAAM,CAAC,EAAE,IAAI;AAAY,SAAO,IAAI;AAAW,mBAAiB;AACxE;AACA,CAJC,gBAIgB;AAAS,mBAAiB;AAAM;","names":[]}
|
package/dist/anchored.css
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
border-bottom: 1px solid var(--line-soft);
|
|
27
27
|
}
|
|
28
28
|
.shell-anchored-title {
|
|
29
|
-
font: 600
|
|
29
|
+
font: 600 13px/1.2 var(--font-ui);
|
|
30
30
|
color: var(--muted);
|
|
31
31
|
}
|
|
32
32
|
.shell-anchored-close {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
gap: 8px;
|
|
59
59
|
}
|
|
60
60
|
.shell-id-input {
|
|
61
|
-
font:
|
|
61
|
+
font: 13px var(--font-mono, monospace);
|
|
62
62
|
padding: 5px 8px;
|
|
63
63
|
border: 1px solid var(--line);
|
|
64
64
|
border-radius: var(--radius-sm);
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
color: var(--ink);
|
|
67
67
|
}
|
|
68
68
|
.shell-id-hint {
|
|
69
|
-
font:
|
|
69
|
+
font: 12px/1.4 var(--font-ui);
|
|
70
70
|
color: var(--muted);
|
|
71
71
|
}
|
|
72
72
|
.shell-id-hint.bad {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
gap: 8px;
|
|
80
80
|
}
|
|
81
81
|
.shell-id-reset {
|
|
82
|
-
font:
|
|
82
|
+
font: 12px var(--font-ui);
|
|
83
83
|
padding: 3px 10px;
|
|
84
84
|
cursor: pointer;
|
|
85
85
|
background: none;
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
color: var(--accent);
|
|
93
93
|
}
|
|
94
94
|
.shell-id-set {
|
|
95
|
-
font:
|
|
95
|
+
font: 12.5px var(--font-ui);
|
|
96
96
|
padding: 3px 12px;
|
|
97
97
|
cursor: pointer;
|
|
98
98
|
border: 1px solid var(--accent);
|
package/dist/anchored.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/anchored.css"],"sourcesContent":["/* The anchored panel (anchored.ts): a floating panel hung off the thing it is\n about. Sized and positioned in script (the placement has to measure); this is\n only what it looks like. Its body scrolls, because the placement caps the\n height rather than letting a long thread run off the screen. */\n.shell-anchored {\n position: fixed; z-index: 40;\n display: flex; flex-direction: column;\n border: 1px solid var(--line);\n border-radius: var(--radius-md);\n background: var(--surface); color: var(--ink);\n box-shadow: var(--shadow-2, var(--shadow-1));\n overflow: hidden;\n /* The family's panel motion. Placement is set in script as left/top, so a\n transform-based keyframe composes with it rather than fighting it. */\n animation: var(--anim-panel-in);\n}\n/* Exit: .closing swaps the enter keyframe for its reverse, and the fading panel\n stops taking clicks so a second press cannot reach a control on its way out.\n Zero-duration under prefers-reduced-motion, where teardown is immediate. */\n.shell-anchored.closing { animation: var(--anim-panel-out); pointer-events: none; }\n.shell-anchored-head {\n flex: none;\n display: flex; align-items: center; justify-content: space-between; gap: 8px;\n padding: 8px 10px;\n border-bottom: 1px solid var(--line-soft);\n}\n.shell-anchored-title {\n font: 600
|
|
1
|
+
{"version":3,"sources":["../src/anchored.css"],"sourcesContent":["/* The anchored panel (anchored.ts): a floating panel hung off the thing it is\n about. Sized and positioned in script (the placement has to measure); this is\n only what it looks like. Its body scrolls, because the placement caps the\n height rather than letting a long thread run off the screen. */\n.shell-anchored {\n position: fixed; z-index: 40;\n display: flex; flex-direction: column;\n border: 1px solid var(--line);\n border-radius: var(--radius-md);\n background: var(--surface); color: var(--ink);\n box-shadow: var(--shadow-2, var(--shadow-1));\n overflow: hidden;\n /* The family's panel motion. Placement is set in script as left/top, so a\n transform-based keyframe composes with it rather than fighting it. */\n animation: var(--anim-panel-in);\n}\n/* Exit: .closing swaps the enter keyframe for its reverse, and the fading panel\n stops taking clicks so a second press cannot reach a control on its way out.\n Zero-duration under prefers-reduced-motion, where teardown is immediate. */\n.shell-anchored.closing { animation: var(--anim-panel-out); pointer-events: none; }\n.shell-anchored-head {\n flex: none;\n display: flex; align-items: center; justify-content: space-between; gap: 8px;\n padding: 8px 10px;\n border-bottom: 1px solid var(--line-soft);\n}\n.shell-anchored-title {\n font: 600 13px/1.2 var(--font-ui);\n color: var(--muted);\n}\n.shell-anchored-close {\n display: inline-flex; align-items: center; justify-content: center;\n border: 0; background: none; color: var(--muted);\n line-height: 1; padding: 2px; cursor: pointer;\n}\n.shell-anchored-close:hover { color: var(--accent); }\n.shell-anchored-body {\n flex: 1; min-height: 0; overflow-y: auto;\n display: flex; flex-direction: column; gap: 8px;\n padding: 10px;\n}\n\n/* The gameId editor (id-editor.ts). Refusal is the whole point of the design, so\n it has to LOOK refused: the hint reddens and Set goes flat. */\n.shell-id-editor .shell-anchored-body { display: flex; flex-direction: column; gap: 8px; }\n.shell-id-input {\n font: 13px var(--font-mono, monospace);\n padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm);\n background: var(--card); color: var(--ink);\n}\n.shell-id-hint { font: 12px/1.4 var(--font-ui); color: var(--muted); }\n.shell-id-hint.bad { color: var(--danger, #b00); }\n.shell-id-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }\n.shell-id-reset {\n font: 12px var(--font-ui); padding: 3px 10px; cursor: pointer;\n background: none; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--muted);\n}\n.shell-id-reset:hover { border-color: var(--accent); color: var(--accent); }\n.shell-id-set {\n font: 12.5px var(--font-ui); padding: 3px 12px; cursor: pointer;\n border: 1px solid var(--accent); border-radius: var(--radius-sm);\n background: var(--accent); color: var(--surface);\n}\n.shell-id-set:disabled {\n cursor: default; background: none; color: var(--muted); border-color: var(--line);\n}\n"],"mappings":";AAIA,CAAC;AACC,YAAU;AAAO,WAAS;AAC1B,WAAS;AAAM,kBAAgB;AAC/B,UAAQ,IAAI,MAAM,IAAI;AACtB,iBAAe,IAAI;AACnB,cAAY,IAAI;AAAY,SAAO,IAAI;AACvC,cAAY,IAAI,UAAU,EAAE,IAAI;AAChC,YAAU;AAGV,aAAW,IAAI;AACjB;AAIA,CAfC,cAec,CAAC;AAAU,aA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;AACxD,UAAQ,IAAI,MAAM,IAAI;AAAW,iBAAe,IAAI;AACpD,cAAY,IAAI;AAAW,SAAO,IAAI;AACxC;AACA,CALC,YAKY;AACX,UAAQ;AAAS,cAAY;AAAM,SAAO,IAAI;AAAU,gBAAc,IAAI;AAC5E;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/problems.ts
|
|
2
|
+
function problemName(p, dangling = false) {
|
|
3
|
+
if (p.title) return `\u201C${p.title}\u201D`;
|
|
4
|
+
if (dangling && p.where) return `(id ${p.where})`;
|
|
5
|
+
return "This";
|
|
6
|
+
}
|
|
7
|
+
function describeProblem(problem, table = {}) {
|
|
8
|
+
const entry = problem.code ? table[problem.code] : void 0;
|
|
9
|
+
if (entry) {
|
|
10
|
+
const copy = entry(problem);
|
|
11
|
+
const text = copy.dangling && !problem.title && problem.where && !copy.text.includes(`(id ${problem.where})`) ? `${copy.text} (id ${problem.where})` : copy.text;
|
|
12
|
+
return copy.next ? { text, next: copy.next } : { text };
|
|
13
|
+
}
|
|
14
|
+
const message = problem.message.replace(/\s*\[[^\]]*\]\s*$/, "").trim();
|
|
15
|
+
return { text: problem.title ? `${problem.title}: ${message}` : message };
|
|
16
|
+
}
|
|
17
|
+
function problemLine(problem, table) {
|
|
18
|
+
const { text, next } = describeProblem(problem, table);
|
|
19
|
+
return next ? `${text} ${next}` : text;
|
|
20
|
+
}
|
|
21
|
+
var defaultProblemCopy = {
|
|
22
|
+
"duplicate-gameid": (p) => ({
|
|
23
|
+
text: `The Game ID on ${problemName(p)} is already used elsewhere.`,
|
|
24
|
+
next: "Each one must be unique; change one of them."
|
|
25
|
+
}),
|
|
26
|
+
"invalid-gameid": (p) => ({
|
|
27
|
+
text: `The Game ID on ${problemName(p)} isn't valid.`,
|
|
28
|
+
next: "Use lowercase letters, digits and hyphens."
|
|
29
|
+
}),
|
|
30
|
+
"dangling-reference": (p) => ({
|
|
31
|
+
text: `${problemName(p, true)} points at something that no longer exists.`,
|
|
32
|
+
next: "Choose where it goes.",
|
|
33
|
+
dangling: true
|
|
34
|
+
}),
|
|
35
|
+
"unknown-property": (p) => ({
|
|
36
|
+
text: `${problemName(p)} uses a property that isn't set up yet.`,
|
|
37
|
+
next: "Declare it in the project settings, or fix the name."
|
|
38
|
+
}),
|
|
39
|
+
"missing-name": (p) => ({ text: `${problemName(p)} needs a name.` }),
|
|
40
|
+
"empty": (p) => ({
|
|
41
|
+
text: `${problemName(p)} is empty.`,
|
|
42
|
+
next: "Add something inside it, or remove it."
|
|
43
|
+
}),
|
|
44
|
+
"stale-build": (p) => ({
|
|
45
|
+
text: `Your playable build${p.path ? ` (${p.path})` : ""} is out of date.`,
|
|
46
|
+
next: "It refreshes the next time you publish."
|
|
47
|
+
}),
|
|
48
|
+
"merge-conflict": (p) => ({
|
|
49
|
+
text: `${p.path ?? "This file"} still has an unresolved merge conflict in it.`,
|
|
50
|
+
next: "Resolve it in your version control tool, then reopen the project."
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { defaultProblemCopy, describeProblem, problemLine, problemName };
|
|
55
|
+
//# sourceMappingURL=chunk-4OAORWEM.js.map
|
|
56
|
+
//# sourceMappingURL=chunk-4OAORWEM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/problems.ts"],"names":[],"mappings":";AA+CO,SAAS,WAAA,CAAY,CAAA,EAAgB,QAAA,GAAW,KAAA,EAAe;AACpE,EAAA,IAAI,CAAA,CAAE,KAAA,EAAO,OAAO,CAAA,MAAA,EAAI,EAAE,KAAK,CAAA,MAAA,CAAA;AAC/B,EAAA,IAAI,YAAY,CAAA,CAAE,KAAA,EAAO,OAAO,CAAA,IAAA,EAAO,EAAE,KAAK,CAAA,CAAA,CAAA;AAC9C,EAAA,OAAO,MAAA;AACT;AASO,SAAS,eAAA,CAAgB,OAAA,EAAsB,KAAA,GAA0B,EAAC,EAAgB;AAC/F,EAAA,MAAM,QAAQ,OAAA,CA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","sourcesContent":["// ---------------------------------------------------------------------------\n// Problem copy: a validator's diagnostic rewritten for the person at the\n// keyboard, through a table the app fills.\n//\n// Patterpad's `humanizeProblem` (its renderer.ts) proved the shape: a dozen\n// validator categories each mapped to a plain sentence with a next step, naming\n// things by their title, and a fallback that softens the technical residue.\n// Storyletter showed the raw compiler string and labelled it `path [where]`\n// (ui-review-2026-09, finding 17), the bracketed id that \"Diagnostics name what\n// the author can see\" (design-language.md) rules out for anything but a\n// DANGLING reference. This module is the translator; the tables are the\n// apps', because the codes are theirs. `defaultProblemCopy` covers the handful\n// of codes both validators raise in some form, as a floor an app spreads into\n// its own table.\n// ---------------------------------------------------------------------------\n\n/** What a translator needs to know about a problem. `code` is the app's own\n * category (Patterpad's `detail`, or a code Storyletter derives from its\n * compiler message); `title` is the author-facing name of the thing the\n * problem is about, when the app can resolve one; `where` is the raw\n * reference (an id) for when it cannot. */\nexport interface ProblemLike {\n code?: string;\n message: string;\n path?: string;\n where?: string;\n title?: string;\n}\n\nexport interface ProblemCopy {\n /** The sentence: what is wrong, in the author's words. */\n text: string;\n /** What to do about it, when there is one thing to do. */\n next?: string;\n /** The reference this problem is about no longer has a name to give, so the\n * raw id may be shown, written `(id ...)` so it cannot be mistaken for a\n * name. Set by the table entry; the translator never guesses it. */\n dangling?: boolean;\n}\n\nexport type ProblemCopyEntry = (problem: ProblemLike) => ProblemCopy;\nexport type ProblemCopyTable = Record<string, ProblemCopyEntry>;\n\n/** The name to call the thing a problem is about: its title in curly quotes,\n * \"(id ...)\" only when the reference dangles and there is nothing else,\n * and \"This\" otherwise, because the bar's \"go to\" shows the reader what\n * \"this\" is and an id is not something they can look for. */\nexport function problemName(p: ProblemLike, dangling = false): string {\n if (p.title) return `“${p.title}”`;\n if (dangling && p.where) return `(id ${p.where})`;\n return \"This\";\n}\n\n/**\n * Translate `problem` through `table`. A matching entry decides the copy; with\n * no entry the raw message is kept and prefixed by the title when there is one\n * (\"Burner Rig: duplicate id\"). Nothing here ever writes `[where]`; an id\n * appears only as `(id ...)`, only when the entry says the reference dangles,\n * and only when there is no title to say instead.\n */\nexport function describeProblem(problem: ProblemLike, table: ProblemCopyTable = {}): ProblemCopy {\n const entry = problem.code ? table[problem.code] : undefined;\n if (entry) {\n const copy = entry(problem);\n const text = copy.dangling && !problem.title && problem.where && !copy.text.includes(`(id ${problem.where})`)\n ? `${copy.text} (id ${problem.where})`\n : copy.text;\n return copy.next ? { text, next: copy.next } : { text };\n }\n const message = problem.message.replace(/\\s*\\[[^\\]]*\\]\\s*$/, \"\").trim();\n return { text: problem.title ? `${problem.title}: ${message}` : message };\n}\n\n/** `describeProblem` as one line for a bar that has room for one: the sentence,\n * then the next step after a space. */\nexport function problemLine(problem: ProblemLike, table?: ProblemCopyTable): string {\n const { text, next } = describeProblem(problem, table);\n return next ? `${text} ${next}` : text;\n}\n\n/**\n * The codes both validators raise in some form, in the family's voice. An app\n * spreads this into its own table and adds its own codes over it; a code an\n * app does not raise costs nothing.\n *\n * duplicate-gameid two things share one Game ID\n * invalid-gameid a Game ID that breaks the address rule\n * dangling-reference a jump / tag / property points at something gone\n * unknown-property a condition or effect names an undeclared property\n * missing-name a thing that needs a name has none\n * empty a container with nothing in it\n * stale-build the playable build is older than the source\n * merge-conflict a file still carries conflict markers\n */\nexport const defaultProblemCopy: ProblemCopyTable = {\n \"duplicate-gameid\": (p) => ({\n text: `The Game ID on ${problemName(p)} is already used elsewhere.`,\n next: \"Each one must be unique; change one of them.\",\n }),\n \"invalid-gameid\": (p) => ({\n text: `The Game ID on ${problemName(p)} isn't valid.`,\n next: \"Use lowercase letters, digits and hyphens.\",\n }),\n \"dangling-reference\": (p) => ({\n text: `${problemName(p, true)} points at something that no longer exists.`,\n next: \"Choose where it goes.\",\n dangling: true,\n }),\n \"unknown-property\": (p) => ({\n text: `${problemName(p)} uses a property that isn't set up yet.`,\n next: \"Declare it in the project settings, or fix the name.\",\n }),\n \"missing-name\": (p) => ({ text: `${problemName(p)} needs a name.` }),\n \"empty\": (p) => ({\n text: `${problemName(p)} is empty.`,\n next: \"Add something inside it, or remove it.\",\n }),\n \"stale-build\": (p) => ({\n text: `Your playable build${p.path ? ` (${p.path})` : \"\"} is out of date.`,\n next: \"It refreshes the next time you publish.\",\n }),\n \"merge-conflict\": (p) => ({\n text: `${p.path ?? \"This file\"} still has an unresolved merge conflict in it.`,\n next: \"Resolve it in your version control tool, then reopen the project.\",\n }),\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { el } from './chunk-
|
|
1
|
+
import { el } from './chunk-UG2P777F.js';
|
|
2
2
|
import { closeWithExit } from './chunk-IU7EY6BI.js';
|
|
3
3
|
|
|
4
4
|
// src/context-menu.ts
|
|
@@ -78,5 +78,5 @@ function openContextMenu(x, y, items) {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export { openContextMenu, openPopover };
|
|
81
|
-
//# sourceMappingURL=chunk-
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
81
|
+
//# sourceMappingURL=chunk-EHR2KBZC.js.map
|
|
82
|
+
//# sourceMappingURL=chunk-EHR2KBZC.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/context-menu.ts"],"names":[],"mappings":";;;;AA8BA,IAAM,IAAA,GAAO,CAAA;AAIb,IAAI,OAAA,GAA+B,IAAA;AAKnC,SAAS,QAAA,CAAS,MAAmB,SAAA,EAAiD;AACpF,EAAA,IAAI,IAAA,GAAO,KAAA;AACX,EAAA,MAAM,UAAU,MAAY;AAC1B,IAAA,IAAI,IAAA,EAAM;AACV,IAAA,IAAA,GAAO,IAAA;AACP,IAAA,IAAI,OAAA,KAAY,SAAS,OAAA,GAAU,IAAA;AACnC,IAAA,MAAA,CAAO,mBAAA,CAAoB,aAAA,EAAe,MAAA,EAAQ,IAAI,CAAA;AACtD,IAAA,MAAA,CAAO,mBAAA,CAAoB,SAAA,EAAW,KAAA,EAAO,IAAI,CAAA;AAEjD,IAAA,aAAA,CAA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,CAAA,EAAG,IAAA,CAAK,GAAA,CAAI,MAAM,MAAA,CAAO,UAAA,GAAa,CAAA,CAAE,KAAA,GAAQ,IAAI,CAAC,CAAA,EAAA,CAAA;AACxG,EAAA,IAAI,EAAE,MAAA,GAAS,MAAA,CAAO,WAAA,EAAa,IAAA,CAAK,MAAM,GAAA,GAAM,CAAA,EAAG,IAAA,CAAK,GAAA,CAAI,MAAM,MAAA,CAAO,WAAA,GAAc,CAAA,CAAE,MAAA,GAAS,IAAI,CAAC,CAAA,EAAA,CAAA;AAC7G","file":"chunk-EHR2KBZC.js","sourcesContent":["// ---------------------------------------------------------------------------\n// A right-click context menu and a small anchored popover: a floating list of\n// actions at the cursor (or a panel under a control), dismissed on outside\n// click or Escape, clamped to the viewport, closed with the family's exit\n// motion.\n//\n// Storyletter's, lifted (ui-review-2026-09, finding 11): its own header had\n// named itself an extraction candidate, and it had the two things Patterpad's\n// inline `sceneContextMenu` lacked, a `disabled` item and the clamp. A DOM\n// popover, not a native menu, so it is themed like everything else.\n//\n// Styles ship as context-menu.css; import it wherever the module is used,\n// including tool windows, which is the bug that made Storyletter give the\n// menu its own stylesheet in the first place.\n// ---------------------------------------------------------------------------\n\nimport { el } from \"./dom.js\";\nimport { closeWithExit } from \"./exit.js\";\n\nexport interface ContextItem {\n label: string;\n /** Drawn in --danger: a destructive action, which names its object. */\n danger?: boolean;\n /** Shown greyed and unclickable. For an action that belongs on this menu\n * but cannot apply right now (Move up on the first row), so the menu keeps\n * the same shape and the same item stays in the same place every time. */\n disabled?: boolean;\n onClick: () => void;\n}\n\nconst EDGE = 6;\n\n/** The one open menu or popover. Only ever one, so a fresh open replaces it\n * and a re-render that removed the anchor cannot leave one hanging in the air. */\nlet current: (() => void) | null = null;\n\n/** Outside-click / Escape wiring shared by the menu and the popover. The\n * returned `dismiss` plays the exit and removes the node; `onDismiss` fires\n * for every way out so a caller can flush on all of them. */\nfunction floating(node: HTMLElement, onDismiss?: () => void): { dismiss: () => void } {\n let gone = false;\n const dismiss = (): void => {\n if (gone) return;\n gone = true;\n if (current === dismiss) current = null;\n window.removeEventListener(\"pointerdown\", onAway, true);\n window.removeEventListener(\"keydown\", onKey, true);\n // A node mid-fade must not take a second click.\n closeWithExit(node, () => node.remove());\n onDismiss?.();\n };\n const onAway = (e: PointerEvent): void => { if (!node.contains(e.target as Node)) dismiss(); };\n const onKey = (e: KeyboardEvent): void => { if (e.key === \"Escape\") { e.preventDefault(); dismiss(); } };\n window.addEventListener(\"pointerdown\", onAway, true);\n window.addEventListener(\"keydown\", onKey, true);\n current?.();\n current = dismiss;\n return { dismiss };\n}\n\n/** Clamp a floating node into the viewport, preferring below `anchor` and\n * flipping above it when there is no room. */\nfunction placeBelow(node: HTMLElement, anchor: DOMRect): void {\n node.style.left = `${anchor.left}px`;\n node.style.top = `${anchor.bottom + 4}px`;\n const r = node.getBoundingClientRect();\n if (r.right > window.innerWidth) node.style.left = `${Math.max(EDGE, window.innerWidth - r.width - EDGE)}px`;\n if (r.bottom > window.innerHeight) node.style.top = `${Math.max(EDGE, anchor.top - r.height - 4)}px`;\n}\n\nexport interface PopoverOptions {\n /** Where the popover is appended. Default <body>. A popover opened from\n * inside a modal <dialog> passes the dialog: a body-level node sits behind\n * the scrim, inert, while one inside the dialog paints in its top layer\n * (Patterpad's colour swatch popover in Project settings). */\n host?: HTMLElement;\n}\n\n/** Open a small panel anchored to an element; `build` gets a close callback.\n * `onClose` runs however it closes (Escape, outside click, or `close`), the\n * place to flush an edit the panel was collecting. Only one is ever open. */\nexport function openPopover(\n anchor: HTMLElement, build: (close: () => void) => HTMLElement, onClose?: () => void, opts: PopoverOptions = {},\n): void {\n const pop = el(\"div\", \"popover\");\n let closed = false;\n const finish = (): void => { if (closed) return; closed = true; onClose?.(); };\n const { dismiss } = floating(pop, finish);\n pop.append(build(dismiss));\n (opts.host ?? document.body).append(pop);\n placeBelow(pop, anchor.getBoundingClientRect());\n}\n\n/** Open a context menu at (x, y). Only one is ever open. */\nexport function openContextMenu(x: number, y: number, items: ContextItem[]): void {\n const menu = el(\"div\", \"ctxmenu\");\n menu.setAttribute(\"role\", \"menu\");\n const { dismiss } = floating(menu);\n\n for (const item of items) {\n const button = el(\"button\", {\n className: `ctxmenu-item${item.danger ? \" danger\" : \"\"}`, text: item.label,\n onClick: () => { if (item.disabled === true) return; dismiss(); item.onClick(); },\n });\n button.type = \"button\";\n button.setAttribute(\"role\", \"menuitem\");\n if (item.disabled === true) button.disabled = true;\n menu.append(button);\n }\n\n menu.style.left = `${x}px`;\n menu.style.top = `${y}px`;\n document.body.append(menu);\n // Keep it on-screen.\n const r = menu.getBoundingClientRect();\n if (r.right > window.innerWidth) menu.style.left = `${Math.max(EDGE, window.innerWidth - r.width - EDGE)}px`;\n if (r.bottom > window.innerHeight) menu.style.top = `${Math.max(EDGE, window.innerHeight - r.height - EDGE)}px`;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { copyWithFeedback } from './chunk-P6WLAEKZ.js';
|
|
2
|
-
import { el, iconNode } from './chunk-
|
|
2
|
+
import { el, iconNode } from './chunk-UG2P777F.js';
|
|
3
3
|
|
|
4
4
|
// src/link-status.ts
|
|
5
5
|
function linkStatusClass(s) {
|
|
@@ -27,6 +27,8 @@ function linkAddress(s) {
|
|
|
27
27
|
if (s.state !== "listening" && s.state !== "connected") return void 0;
|
|
28
28
|
return s.address ?? `ws://127.0.0.1:${s.port}`;
|
|
29
29
|
}
|
|
30
|
+
var CORNER_INSET = 14.5;
|
|
31
|
+
var CORNER_GAP = 12;
|
|
30
32
|
function mountLinkStatus(host, opts) {
|
|
31
33
|
const wrap = el("div", "linkstatus");
|
|
32
34
|
wrap.hidden = true;
|
|
@@ -40,6 +42,15 @@ function mountLinkStatus(host, opts) {
|
|
|
40
42
|
wrap.append(...opts.lead ?? [], url, toggle);
|
|
41
43
|
host.append(wrap);
|
|
42
44
|
let status = { state: "off" };
|
|
45
|
+
const root = host.ownerDocument.documentElement;
|
|
46
|
+
const publishReserve = () => {
|
|
47
|
+
const width = wrap.hidden ? 0 : wrap.getBoundingClientRect().width;
|
|
48
|
+
root.style.setProperty(
|
|
49
|
+
"--linkstatus-reserve",
|
|
50
|
+
width > 0 ? `${Math.ceil(width + CORNER_INSET + CORNER_GAP)}px` : "0px"
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
if (typeof ResizeObserver !== "undefined") new ResizeObserver(publishReserve).observe(wrap);
|
|
43
54
|
const render = () => {
|
|
44
55
|
toggle.className = `linkstatus-toggle ${linkStatusClass(status)}`;
|
|
45
56
|
const tip = linkStatusTip(status);
|
|
@@ -51,6 +62,7 @@ function mountLinkStatus(host, opts) {
|
|
|
51
62
|
url.dataset["tip"] = "Click to copy the live link address";
|
|
52
63
|
url.hidden = false;
|
|
53
64
|
} else url.hidden = true;
|
|
65
|
+
publishReserve();
|
|
54
66
|
};
|
|
55
67
|
const apply = (s) => {
|
|
56
68
|
status = s;
|
|
@@ -75,6 +87,7 @@ function mountLinkStatus(host, opts) {
|
|
|
75
87
|
status: () => status,
|
|
76
88
|
setVisible(on) {
|
|
77
89
|
wrap.hidden = !on;
|
|
90
|
+
publishReserve();
|
|
78
91
|
},
|
|
79
92
|
toggle() {
|
|
80
93
|
toggle.click();
|
|
@@ -83,5 +96,5 @@ function mountLinkStatus(host, opts) {
|
|
|
83
96
|
}
|
|
84
97
|
|
|
85
98
|
export { linkAddress, linkStatusClass, linkStatusTip, mountLinkStatus };
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-G2JT3HZH.js.map
|
|
100
|
+
//# sourceMappingURL=chunk-G2JT3HZH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/link-status.ts"],"names":[],"mappings":";;;;AA0DO,SAAS,gBAAgB,CAAA,EAAgC;AAC9D,EAAA,IAAI,EAAE,KAAA,KAAU,KAAA,IAAS,CAAA,CAAE,K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M;AACX,IAAA,KAAK,gBAAA,CAAiB,KAAK,IAAI,CAAA;AAC/B,IAAA,IAAA,CAAK,SAAS,IAAI,CAAA;AAAA,EACpB,CAAC,CAAA;AAED,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,IAAA;AAAA,IAAM,KAAA;AAAA,IACV,QAAQ,MAAM,MAAA;AAAA,IACd,WAAW,EAAA,EAAmB;AAAE,MAAA,IAAA,CAAK,SAAS,CAAC,EAAA;AAAI,MAAA,cAAA,EAAe;AAAA,IAAG,CAAA;AAAA,IACrE,MAAA,GAAe;AAAE,MAAA,MAAA,CAAO,KAAA,EAAM;AAAA,IAAG;AAAA,GACnC;AACF","file":"chunk-G2JT3HZH.js","sourcesContent":["// ---------------------------------------------------------------------------\n// The live-link status chip: a compact control in the bottom-right corner for\n// the loopback server a running game connects to. All the state collapses to\n// one coloured \"connect\" icon (grey off, amber listening, green connected and\n// in sync, red connected on a different build); click it to toggle the link\n// (off -> listening -> stop), and while the link is up the copiable ws://\n// address sits beside it. Patterpad's debug-panel.ts and Storyletter's\n// live-link.ts were this file twice, character for character down to the\n// 1000ms `.copied` revert. Styles ship as link-status.css.\n//\n// What the game sends is the app's business; this is the control and the\n// status only.\n// ---------------------------------------------------------------------------\n\nimport { el } from \"./dom.js\";\nimport { iconNode } from \"./icons.js\";\nimport { copyWithFeedback } from \"./util.js\";\n\nexport type LinkStatus =\n | { state: \"off\" }\n | { state: \"error\"; message: string }\n | { state: \"listening\"; port: number; address?: string }\n | {\n state: \"connected\"; port: number; address?: string;\n /** What connected, if it said. */\n project?: string;\n /** Whether the game's build matches the editor's. */\n build?: \"match\" | \"stale\" | \"unknown\";\n /** One extra sentence for the tip (Storyletter names the live boxes). */\n note?: string;\n };\n\n/** The chip's colour class for a state: the four. */\nexport type LinkStatusClass = \"off\" | \"listening\" | \"live\" | \"stale\";\n\nexport interface LinkStatusOptions {\n /** A word beside the chip (\"Live link\"), so a bottom-corner plug is not a\n * mystery. Omitted draws none. */\n label?: string;\n /** Start when off or failed, stop otherwise. A returned status is applied;\n * a status pushed later through `apply` works as well. */\n onToggle: (current: LinkStatus) => LinkStatus | void | Promise<LinkStatus | void>;\n /** Runs after the address is copied. The copy itself is the chip's. */\n onCopy?: (address: string) => void;\n /** Controls before the address (Patterpad's flow picker). */\n lead?: HTMLElement[];\n}\n\nexport interface LinkStatusChip {\n el: HTMLElement;\n apply(status: LinkStatus): void;\n status(): LinkStatus;\n /** Show / hide the control (shown when a project is open). */\n setVisible(on: boolean): void;\n /** Toggle the link (a menu item routes here). */\n toggle(): void;\n}\n\nexport function linkStatusClass(s: LinkStatus): LinkStatusClass {\n if (s.state === \"off\" || s.state === \"error\") return \"off\";\n if (s.state === \"listening\") return \"listening\";\n return s.build === \"stale\" ? \"stale\" : \"live\";\n}\n\n/** The tooltip, spelling the state out. One wording for the family. */\nexport function linkStatusTip(s: LinkStatus): string {\n switch (s.state) {\n case \"off\": return \"Live link is off. Click to start listening.\";\n case \"error\": return `Live link failed (${s.message}). Click to retry.`;\n case \"listening\": return \"Live link is listening for a game. Click to stop.\";\n case \"connected\": {\n const who = s.project !== undefined ? ` to ${s.project}` : \"\";\n const build = s.build === \"stale\" ? \" on a different build, so save or rebuild to re-sync\"\n : s.build === \"match\" ? \" and in sync\" : \"\";\n const note = s.note ? ` ${s.note}` : \"\";\n return `Live link is connected${who}${build}.${note} Click to stop.`;\n }\n }\n}\n\n/** The address a game connects to. */\nexport function linkAddress(s: LinkStatus): string | undefined {\n if (s.state !== \"listening\" && s.state !== \"connected\") return undefined;\n return s.address ?? `ws://127.0.0.1:${s.port}`;\n}\n\n/** Where the chip sits, which link-status.css says too: its right inset, and the\n * breathing room anything beside it keeps. Kept beside the reserve that uses\n * them, since the reserve is a promise about the CSS. */\nconst CORNER_INSET = 14.5;\nconst CORNER_GAP = 12;\n\n/** Mount the chip into `host` (document.body in both apps: it is fixed to the\n * window's corner). Hidden until `setVisible(true)`. */\nexport function mountLinkStatus(host: HTMLElement, opts: LinkStatusOptions): LinkStatusChip {\n const wrap = el(\"div\", \"linkstatus\"); wrap.hidden = true;\n const url = el(\"button\", \"linkstatus-url\"); url.type = \"button\"; url.hidden = true;\n const toggle = el(\"button\", \"linkstatus-toggle off\"); toggle.type = \"button\"; toggle.append(iconNode(\"connect\"));\n if (opts.label !== undefined) wrap.append(el(\"span\", \"linkstatus-word\", opts.label));\n wrap.append(...(opts.lead ?? []), url, toggle);\n host.append(wrap);\n\n let status: LinkStatus = { state: \"off\" };\n\n // The corner the chip floats over belongs to whatever the host put there: a\n // problems bar's error link and its buttons, a canvas strip's last control.\n // Both apps had it drawn under the chip (2026-09-17). So the chip publishes\n // how much of the corner it takes, as --linkstatus-reserve on the document,\n // and the things that can sit there leave that much room (the stepper bar\n // does, in stepper.css; a host's own strips opt in). 0px while hidden.\n // Re-measured on every render, because the address comes and goes, and on a\n // resize where the platform offers one, because a web font landing moves it.\n const root = host.ownerDocument.documentElement;\n const publishReserve = (): void => {\n const width = wrap.hidden ? 0 : wrap.getBoundingClientRect().width;\n root.style.setProperty(\"--linkstatus-reserve\",\n width > 0 ? `${Math.ceil(width + CORNER_INSET + CORNER_GAP)}px` : \"0px\");\n };\n if (typeof ResizeObserver !== \"undefined\") new ResizeObserver(publishReserve).observe(wrap);\n\n const render = (): void => {\n toggle.className = `linkstatus-toggle ${linkStatusClass(status)}`;\n const tip = linkStatusTip(status);\n toggle.dataset[\"tip\"] = tip;\n toggle.setAttribute(\"aria-label\", tip);\n // The copiable address means something once the server is up.\n const addr = linkAddress(status);\n if (addr !== undefined) {\n url.textContent = addr;\n url.dataset[\"tip\"] = \"Click to copy the live link address\";\n url.hidden = false;\n } else url.hidden = true;\n publishReserve();\n };\n const apply = (s: LinkStatus): void => { status = s; render(); };\n render();\n\n toggle.addEventListener(\"click\", () => {\n const out = opts.onToggle(status);\n void Promise.resolve(out).then((next) => { if (next) apply(next); });\n });\n url.addEventListener(\"click\", () => {\n const addr = url.textContent ?? \"\";\n if (!addr) return;\n void copyWithFeedback(url, addr);\n opts.onCopy?.(addr);\n });\n\n return {\n el: wrap, apply,\n status: () => status,\n setVisible(on: boolean): void { wrap.hidden = !on; publishReserve(); },\n toggle(): void { toggle.click(); },\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { dialogFrame } from './chunk-
|
|
2
|
-
import { el } from './chunk-
|
|
1
|
+
import { dialogFrame } from './chunk-YRFJLJUH.js';
|
|
2
|
+
import { el } from './chunk-UG2P777F.js';
|
|
3
3
|
|
|
4
4
|
// src/updater-view.ts
|
|
5
5
|
var liveProgress = null;
|
|
@@ -62,5 +62,5 @@ function showUpdaterDialog(opts) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export { feedUpdaterDownloadProgress, showUpdaterDialog };
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-OPZPFOPS.js.map
|
|
66
|
+
//# sourceMappingURL=chunk-OPZPFOPS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/updater-view.ts"],"names":[],"mappings":";;;;AA8BA,IAAI,YAAA,GAAgE,IAAA;AAEpE,IAAM,KAAK,CAAC,CAAA,KAAA,CAAuB,KAAK,IAAA,GAAO,IAAA,CAAA,EAAO,QAAQ,CAAC,CAAA;AAIxD,SAAS,4BAA4B,CAAA,EAAkC;AAC5E,EAAA,IAAI,CAAC,YAAA,EAAc;AACnB,EAAA,MAAM,GAAA,GAAM,KAAK,GAAA,CAAI,CAAA,EAAG,KAAK,GAAA,CAAI,GAAA,EAAK,CAAA,CAAE,OAAO,CAAC,CAAA;AAChD,EAAA,YAAA,CAAa,GAAA,CAAI,KAAA,CAAM,KAAA,GAAQ,CAAA,EAAG,GAAG,CAAA,CAAA,CAAA;AACrC,EAAA,YAAA,CAAa,KAAA,CAAM,cACjB,CAAA,EAAG,GAAA,CAAI,QAAQ,CAAC,CAAC,MAAM,EA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AAA,CAAA,CAAE,cAAA,EAAe;AAAG,UAAA,IAAA,CAAK,YAAA,GAAe,KAAK,GAAG,CAAA;AAAA,QAAG,CAAC,CAAA;AACzF,QAAA,GAAA,CAAI,OAAO,CAAC,CAAA;AAAA,MACd;AACA,MAAA,KAAA,CAAM,IAAA,CAAK,OAAO,GAAG,CAAA;AAAA,IACvB;AAEA,IAAA,IAAA,CAAK,OAAA,CAAQ,OAAA,CAAQ,CAAC,KAAA,EAAO,CAAA,KAAM;AAGjC,MAAA,MAAM,IAAI,EAAA,CAAG,QAAA,EAAU,MAAM,SAAA,GAAY,aAAA,GAAgB,OAAO,KAAK,CAAA;AACrE,MAAA,CAAA,CAAE,IAAA,GAAO,QAAA;AACT,MAAA,CAAA,CAAE,gBAAA,CAAiB,OAAA,EAAS,MAAM,MAAA,CAAO,CAAC,CAAC,CAAA;AAC3C,MAAA,KAAA,CAAM,OAAA,CAAQ,OAAO,CAAC,CAAA;AACtB,MAAA,IAAI,MAAM,SAAA,EAAW,cAAA,CAAe,MAAM,CAAA,CAAE,OAAO,CAAA;AAAA,IACrD,CAAC,CAAA;AAED,IAAA,KAAA,CAAM,IAAA,EAAK;AAAA,EACb,CAAC,CAAA;AACH","file":"chunk-OPZPFOPS.js","sourcesContent":["// ---------------------------------------------------------------------------\n// The updater's VIEW: the themed prompt main summons over `updater:prompt`\n// (updater.ts) and reads the chosen button index back from, the same contract\n// as dialog.showMessageBox's `response`. The renderer half of the updater is\n// not optional: an unanswered prompt does not fall back to a native dialog,\n// the shell waits 300 seconds and resolves its own fallback index. Both apps\n// had written this view by hand (55 of 60 lines identical); this is the one\n// they share, on the family's dialog frame, the way save.ts has save-view.ts.\n//\n// Storyletter's copy, plus Patterpad's `links` row as an option (an About box\n// used to share this dialog there). Styles ship as updater.css.\n// ---------------------------------------------------------------------------\n\nimport { el } from \"./dom.js\";\nimport { dialogFrame } from \"./dialog.js\";\nimport type { UpdaterDownloadProgress, UpdaterPromptOptions } from \"./updater.js\";\n\nexport interface UpdaterLink { label: string; url: string }\n\nexport interface UpdaterViewOptions extends UpdaterPromptOptions {\n /** Web links under the detail. Opened through `openExternal`, never by\n * navigating the window. */\n links?: UpdaterLink[];\n /** How a link opens (the app's allow-listed shell.openExternal bridge).\n * Required for `links` to do anything. */\n openExternal?: (url: string) => void;\n}\n\n// The progress row of the open `progress: true` dialog, if any. These are\n// modal, so one at a time, so one slot is enough. Closing clears it.\nlet liveProgress: { bar: HTMLElement; label: HTMLElement } | null = null;\n\nconst mb = (n: number): string => (n / (1024 * 1024)).toFixed(1);\n\n/** Route a download-progress tick into the open dialog's bar. No-op when none\n * is showing. Registered once at boot on the app's progress channel. */\nexport function feedUpdaterDownloadProgress(p: UpdaterDownloadProgress): void {\n if (!liveProgress) return;\n const pct = Math.max(0, Math.min(100, p.percent));\n liveProgress.bar.style.width = `${pct}%`;\n liveProgress.label.textContent =\n `${pct.toFixed(0)}%, ${mb(p.transferred)} of ${mb(p.total)} MB (${mb(p.bytesPerSecond)} MB/s)`;\n}\n\n/** Show the prompt as a modal themed dialog; resolve the index of the clicked\n * button (Esc resolves `cancelId`, which defaults to the last button). */\nexport function showUpdaterDialog(opts: UpdaterViewOptions): Promise<number> {\n return new Promise((resolve) => {\n const defaultId = opts.defaultId ?? 0;\n const cancelId = opts.cancelId ?? opts.buttons.length - 1;\n\n let done = false;\n const finish = (idx: number): void => {\n if (done) return;\n done = true;\n liveProgress = null; // stop feeding a dialog that is gone\n resolve(idx);\n frame.close();\n };\n const frame = dialogFrame({\n title: opts.message, className: \"updater-dialog\",\n // Esc is the cancel button, not a further answer: main is waiting on an index.\n onClose: () => finish(cancelId),\n });\n if (opts.detail) frame.body.append(el(\"p\", \"updater-detail\", opts.detail));\n\n if (opts.progress) {\n const track = el(\"div\", \"updater-progress-track\");\n const bar = el(\"div\", \"updater-progress-bar\");\n track.append(bar);\n const label = el(\"p\", \"updater-progress-label\", \"Starting download…\");\n frame.body.append(track, label);\n liveProgress = { bar, label };\n }\n\n if (opts.links?.length) {\n const row = el(\"p\", \"updater-links\");\n for (const link of opts.links) {\n const a = el(\"a\", undefined, link.label);\n a.href = link.url;\n a.addEventListener(\"click\", (e) => { e.preventDefault(); opts.openExternal?.(link.url); });\n row.append(a);\n }\n frame.body.append(row);\n }\n\n opts.buttons.forEach((label, i) => {\n // The default is the affirmative and wears the accent; every other\n // button, the way out included, is the plain one.\n const b = el(\"button\", i === defaultId ? \"btn primary\" : \"btn\", label);\n b.type = \"button\";\n b.addEventListener(\"click\", () => finish(i));\n frame.actions.append(b);\n if (i === defaultId) queueMicrotask(() => b.focus());\n });\n\n frame.open();\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { el, iconBtn, moveItem, labelled, tagChips, stageChips } from './chunk-
|
|
1
|
+
import { el, iconBtn, moveItem, labelled, tagChips, stageChips } from './chunk-UG2P777F.js';
|
|
2
2
|
|
|
3
3
|
// src/settings.ts
|
|
4
4
|
function expandableRow(opts) {
|
|
@@ -530,5 +530,5 @@ function mountPropertyList(host, decls, opts = {}) {
|
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
export { PROPERTY_NAME_HINT, PROPERTY_TYPES, RESERVED_PROPERTY_NAMES, bindPropertyName, bindPropertyRef, defaultControl, dupGuard, expandableRow, firstIllegalPropertyName, focusNewRow, isCaseOnlyPropertyName, isValidPropertyName, mountPropertyList, mountSettingsDialog, propertyNameProblem, propertyNameify, propertyRefProblem, revalidatePropertyRefs, revealRow, revealRowWhenReady };
|
|
533
|
-
//# sourceMappingURL=chunk-
|
|
534
|
-
//# sourceMappingURL=chunk-
|
|
533
|
+
//# sourceMappingURL=chunk-R3NXPHRZ.js.map
|
|
534
|
+
//# sourceMappingURL=chunk-R3NXPHRZ.js.map
|