@wildwinter/app-shell 0.39.0 → 0.40.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.
- 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-DS4XXAZS.js +56 -0
- package/dist/chunk-DS4XXAZS.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-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-KGAMP5LW.js → chunk-SDOKZTAR.js} +3 -3
- package/dist/{chunk-KGAMP5LW.js.map → chunk-SDOKZTAR.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 +257 -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.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 +13 -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-XZYZXY7I.js.map +0 -1
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,aAAW,IAAI;AAAmB,kBAAgB;AAAM;AAClF,CAAC;AACC,QAAM;AACN,WAAS;AAAM,eAAa;AAAQ,mBAAiB;AAAe,OAAK;AACzE,WAAS,IAAI;AACb,iBAAe,IAAI,MAAM,IAAI;AAC/B;AACA,CAAC;AACC,QAAM,IAAI,IAAI,CAAC,IAAI,IAAI;AACvB,SAAO,IAAI;AACb;AACA,CAAC;AACC,WAAS;AAAa,eAAa;AAAQ,mBAAiB;AAC5D,UAAQ;AAAG,cAAY;AAAM,SAAO,IAAI;AACxC,eAAa;AAAG,WAAS;AAAK,UAAQ;AACxC;AACA,CALC,oBAKoB;AAAS,SAAO,IAAI;AAAW;AACpD,CAAC;AACC,QAAM;AAAG,cAAY;AAAG,cAAY;AACpC,WAAS;AAAM,kBAAgB;AAAQ,OAAK;AAC5C,WAAS;AACX;AAIA,CAAC,gBAAgB,CARhB;AAQuC,WAAS;AAAM,kBAAgB;AAAQ,OAAK;AAAK;AACzF,CAAC;AACC,QAAM,KAAK,IAAI,WAAW,EAAE;AAC5B,WAAS,IAAI;AAAK,UAAQ,IAAI,MAAM,IAAI;AAAS,iBAAe,IAAI;AACpE,cAAY,IAAI;AAAS,SAAO,IAAI;AACtC;AACA,CAAC;AAAgB,QAAM,IAAI,CAAC,IAAI,IAAI;AAAY,SAAO,IAAI;AAAU;AACrE,CADC,aACa,CAAC;AAAM,SAAO,IAAI,QAAQ,EAAE;AAAO;AACjD,CAAC;AAAmB,WAAS;AAAM,eAAa;AAAQ,mBAAiB;AAAe,OAAK;AAAK;AAClG,CAAC;AACC,QAAM,KAAK,IAAI;AAAY,WAAS,IAAI;AAAM,UAAQ;AACtD,cAAY;AAAM,UAAQ,IAAI,OAAO,IAAI;AAAS,iBAAe,IAAI;AAAc,SAAO,IAAI;AAChG;AACA,CAJC,cAIc;AAAS,gBAAc,IAAI;AAAW,SAAO,IAAI;AAAW;AAC3E,CAAC;AACC,QAAM,OAAO,IAAI;AAAY,WAAS,IAAI;AAAM,UAAQ;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-DS4XXAZS.js.map
|
|
56
|
+
//# sourceMappingURL=chunk-DS4XXAZS.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,CAAQ,IAAA,GAAO,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,GAAI,MAAA;AACnD,EAAA,IAAI,KAAA,EAAO;AACT,IAAA,MAAM,IAAA,GAAO,MAAM,OAAO,CAAA;AAC1B,IAAA,MAAM,IAAA,GAAO,IAAA,CAAK,QAAA,IAAY,CAAC,OAAA,CAAQ,SAAS,OAAA,CAAQ,KAAA,IAAS,CAAC,IAAA,CAAK,IAAA,CAAK,QAAA,CAAS,OAAO,OAAA,CAAQ,KAAK,CAAA,CAAA,CAAG,CAAA,GACxG,CAAA,EAAG,IAAA,CAAK,IAAI,CAAA,KAAA,EAAQ,OAAA,CAAQ,KAAK,CAAA,CAAA,CAAA,GACjC,IAAA,CAAK,IAAA;AACT,IAAA,OAAO,IAAA,CAAK,OAAO,EAAE,IAAA,EAAM,MAAM,IAAA,CAAK,IAAA,EAAK,GAAI,EAAE,IAAA,EA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CAAA;AAAA,EACA,cAAA,EAAgB,CAAC,CAAA,MAAO,EAAE,MAAM,CAAA,EAAG,WAAA,CAAY,CAAC,CAAC,CAAA,cAAA,CAAA,EAAiB,CAAA;AAAA,EAClE,OAAA,EAAS,CAAC,CAAA,MAAO;AAAA,IACf,IAAA,EAAM,CAAA,EAAG,WAAA,CAAY,CAAC,CAAC,CAAA,UAAA,CAAA;AAAA,IACvB,IAAA,EAAM;AAAA,GACR,CAAA;AAAA,EACA,aAAA,EAAe,CAAC,CAAA,MAAO;AAAA,IACrB,IAAA,EAAM,sBAAsB,CAAA,CAAE,IAAA,GAAO,KAAK,CAAA,CAAE,IAAI,MAAM,EAAE,CAAA,gBAAA,CAAA;AAAA,IACxD,IAAA,EAAM;AAAA,GACR,CAAA;AAAA,EACA,gBAAA,EAAkB,CAAC,CAAA,MAAO;AAAA,IACxB,IAAA,EAAM,CAAA,EAAG,CAAA,CAAE,IAAA,IAAQ,WAAW,CAAA,8CAAA,CAAA;AAAA,IAC9B,IAAA,EAAM;AAAA,GACR;AACF","file":"chunk-DS4XXAZS.js","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 tells.\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
|
-
//# sourceM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AAQ;AAAG,QAAA,IAAA,CAAK,OAAA,EAAQ;AAAA,MAAG;AAAA,KACjF,CAAA;AACD,IAAA,MAAA,CAAO,IAAA,GAAO,QAAA;AACd,IAAA,MAAA,CAAO,YAAA,CAAa,QAAQ,UAAU,CAAA;AACtC,IAAA,IAAI,IAAA,CAAK,QAAA,KAAa,IAAA,EAAM,MAAA,CAAO,QAAA,GAAW,IAAA;AAC9C,IAAA,IAAA,CAAK,OAAO,MAAM,CAAA;AAAA,EACpB;AAEA,EAAA,IAAA,CAAK,KAAA,CAAM,IAAA,GAAO,CAAA,EAAG,CAAC,CAAA,EAAA,CAAA;AACtB,EAAA,IAAA,CAAK,KAAA,CAAM,GAAA,GAAM,CAAA,EAAG,CAAC,CAAA,EAAA,CAAA;AACrB,EAAA,QAAA,CAAS,IAAA,CAAK,OAAO,IAAI,CAAA;AAEzB,EAAA,MAAM,CAAA,GAAI,KAAK,qBAAA,EAAsB;AACrC,EAAA,IAAI,EAAE,KAAA,GAAQ,MAAA,CAAO,UAAA,EAAY,IAAA,CAAK,MAAM,IAAA,GAAO,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
|
-
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,EAAA,CAAG,CAAA,CAAE,WAAW,CAAC,CAAA,IAAA,EAAO,GAAG,CAAA,CAAE,KAAK,CAAC,CAAA,KAAA,EAAQ,EAAA,CAAG,CAAA,CAAE,cAAc,CAAC,CAAA,MAAA,CAAA;AAC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;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
|