@plitzi/sdk-authoring 0.38.9 → 0.38.10
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/CHANGELOG.md +81 -0
- package/dist/index-src.js +636 -431
- package/dist/index.d.ts +78 -40
- package/dist/node.d.ts +28 -1
- package/package.json +6 -6
- package/skills/plitzi-authoring/CHEATSHEET.md +1 -1
- package/skills/plitzi-authoring/recipes/filter-a-list.ts +0 -2
- package/skills/plitzi-authoring/recipes/forms-and-modals.ts +2 -1
- package/skills/plitzi-authoring/reference/authoring-errors.md +4 -1
- package/skills/plitzi-authoring/reference/layouts.md +4 -2
- package/skills/plitzi-authoring/reference/structure.md +3 -1
package/dist/index-src.js
CHANGED
|
@@ -11,12 +11,12 @@ var __exportAll = (all, no_symbols) => {
|
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs
|
|
14
|
-
var e$
|
|
15
|
-
var t$63 = `(?:${e$
|
|
16
|
-
var n$47 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$
|
|
17
|
-
var r$36 = `${`${e$
|
|
18
|
-
var i$
|
|
19
|
-
var a$24 = `(?:${`\\{\\{\\{\\s*${r$36}\\s*\\}\\}\\}`}|${i$
|
|
14
|
+
var e$43 = "[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*";
|
|
15
|
+
var t$63 = `(?:${e$43}|\\d+)`;
|
|
16
|
+
var n$47 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$43}(?:\\.${t$63})*)\\s*\\]`;
|
|
17
|
+
var r$36 = `${`${e$43}(?:${n$47})*(?:\\??\\.${t$63}(?:${n$47})*)*`}(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`;
|
|
18
|
+
var i$29 = `\\{\\{\\s*${r$36}\\s*\\}\\}`;
|
|
19
|
+
var a$24 = `(?:${`\\{\\{\\{\\s*${r$36}\\s*\\}\\}\\}`}|${i$29})`;
|
|
20
20
|
var o$26 = new RegExp(a$24, "g");
|
|
21
21
|
var s$24 = RegExp(`^${a$24}$`);
|
|
22
22
|
//#endregion
|
|
@@ -48,12 +48,12 @@ var r$35 = (e, t, n) => {
|
|
|
48
48
|
for (let [i, a] of Object.entries(n)) a.required && e[i] === void 0 && (!a.when || a.when(t)) && r.push(i);
|
|
49
49
|
return r;
|
|
50
50
|
};
|
|
51
|
-
var i$
|
|
51
|
+
var i$28 = (e) => e.trim() !== "" && Number.isFinite(Number(e));
|
|
52
52
|
var a$23 = (t) => typeof t == "string" && n$46(t);
|
|
53
53
|
var o$25 = (e, t) => {
|
|
54
54
|
switch (t.type) {
|
|
55
55
|
case "boolean": return typeof e == "boolean";
|
|
56
|
-
case "number": return typeof e == "number" || typeof e == "string" && i$
|
|
56
|
+
case "number": return typeof e == "number" || typeof e == "string" && i$28(e);
|
|
57
57
|
case "select": return typeof e == "string" && (!t.options || t.options.includes(e));
|
|
58
58
|
case "scalar": return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
59
59
|
case "json": return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "object" && !!e;
|
|
@@ -84,7 +84,7 @@ var c$19 = (e, t, n) => {
|
|
|
84
84
|
};
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region ../sdk-shared/dist/helpers/scroll.mjs
|
|
87
|
-
var e$
|
|
87
|
+
var e$42 = ["smooth", "auto"];
|
|
88
88
|
var t$61 = [
|
|
89
89
|
"start",
|
|
90
90
|
"center",
|
|
@@ -98,9 +98,9 @@ var r$34 = {
|
|
|
98
98
|
type: "select",
|
|
99
99
|
description: "How it moves: \"smooth\" glides there, \"auto\" jumps.",
|
|
100
100
|
default: "smooth",
|
|
101
|
-
options: [...e$
|
|
101
|
+
options: [...e$42]
|
|
102
102
|
};
|
|
103
|
-
var i$
|
|
103
|
+
var i$27 = {
|
|
104
104
|
scrollBy: {
|
|
105
105
|
title: "Scroll By",
|
|
106
106
|
type: "callback",
|
|
@@ -215,7 +215,7 @@ var a$22 = {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
|
-
...i$
|
|
218
|
+
...i$27
|
|
219
219
|
};
|
|
220
220
|
var o$24 = (e) => Object.hasOwn(a$22, e) ? a$22[e] : void 0;
|
|
221
221
|
var s$21 = (t, n) => {
|
|
@@ -698,6 +698,7 @@ var elementAttributeNames = {
|
|
|
698
698
|
page: [
|
|
699
699
|
"layout",
|
|
700
700
|
"layoutContainer",
|
|
701
|
+
"notFound",
|
|
701
702
|
"seoEnabled",
|
|
702
703
|
"seoPageDescription",
|
|
703
704
|
"seoPageTitle"
|
|
@@ -747,7 +748,7 @@ var elementAttributeNames = {
|
|
|
747
748
|
};
|
|
748
749
|
//#endregion
|
|
749
750
|
//#region ../sdk-elements/dist/Element/helpers/elementConstants.mjs
|
|
750
|
-
var e$
|
|
751
|
+
var e$41 = {
|
|
751
752
|
onLoad: {
|
|
752
753
|
action: "onLoad",
|
|
753
754
|
title: "On Load",
|
|
@@ -919,7 +920,7 @@ var e$40 = {
|
|
|
919
920
|
};
|
|
920
921
|
//#endregion
|
|
921
922
|
//#region ../sdk-shared/dist/authoring/declare.mjs
|
|
922
|
-
var e$
|
|
923
|
+
var e$40 = () => (e) => e;
|
|
923
924
|
var t$60 = () => (e) => e;
|
|
924
925
|
//#endregion
|
|
925
926
|
//#region ../sdk-elements/dist/elements/advanced/BlockHtml/declaration.mjs
|
|
@@ -1164,13 +1165,13 @@ var n$44 = {
|
|
|
1164
1165
|
var r$33 = t$60()({
|
|
1165
1166
|
type: "button",
|
|
1166
1167
|
attributeValues: {
|
|
1167
|
-
subType: e$
|
|
1168
|
+
subType: e$40()([
|
|
1168
1169
|
"button",
|
|
1169
1170
|
"submit",
|
|
1170
1171
|
"reset"
|
|
1171
1172
|
]),
|
|
1172
|
-
contentPlacement: e$
|
|
1173
|
-
iconPlacement: e$
|
|
1173
|
+
contentPlacement: e$40()(["before", "after"]),
|
|
1174
|
+
iconPlacement: e$40()(["before", "after"])
|
|
1174
1175
|
},
|
|
1175
1176
|
content: {
|
|
1176
1177
|
attributes: {
|
|
@@ -1240,7 +1241,7 @@ var r$33 = t$60()({
|
|
|
1240
1241
|
//#region ../sdk-elements/dist/elements/basic/Dropdown/declaration.mjs
|
|
1241
1242
|
var n$43 = t$60()({
|
|
1242
1243
|
type: "dropdown",
|
|
1243
|
-
attributeValues: { popupPlacement: e$
|
|
1244
|
+
attributeValues: { popupPlacement: e$40()([
|
|
1244
1245
|
"left",
|
|
1245
1246
|
"right",
|
|
1246
1247
|
"top",
|
|
@@ -1375,7 +1376,7 @@ var t$54 = t$60()({
|
|
|
1375
1376
|
//#region ../sdk-elements/dist/elements/basic/Heading/declaration.mjs
|
|
1376
1377
|
var n$42 = t$60()({
|
|
1377
1378
|
type: "heading",
|
|
1378
|
-
attributeValues: { subType: e$
|
|
1379
|
+
attributeValues: { subType: e$40()([
|
|
1379
1380
|
"h1",
|
|
1380
1381
|
"h2",
|
|
1381
1382
|
"h3",
|
|
@@ -1499,20 +1500,20 @@ var n$42 = t$60()({
|
|
|
1499
1500
|
var n$41 = t$60()({
|
|
1500
1501
|
type: "link",
|
|
1501
1502
|
attributeValues: {
|
|
1502
|
-
mode: e$
|
|
1503
|
+
mode: e$40()([
|
|
1503
1504
|
"page",
|
|
1504
1505
|
"internal",
|
|
1505
1506
|
"external"
|
|
1506
1507
|
]),
|
|
1507
|
-
target: e$
|
|
1508
|
+
target: e$40()([
|
|
1508
1509
|
"self",
|
|
1509
1510
|
"blank",
|
|
1510
1511
|
"parent",
|
|
1511
1512
|
"top"
|
|
1512
1513
|
]),
|
|
1513
|
-
contentPlacement: e$
|
|
1514
|
-
iconPlacement: e$
|
|
1515
|
-
current: e$
|
|
1514
|
+
contentPlacement: e$40()(["before", "after"]),
|
|
1515
|
+
iconPlacement: e$40()(["before", "after"]),
|
|
1516
|
+
current: e$40()(["page", "section"])
|
|
1516
1517
|
},
|
|
1517
1518
|
content: {
|
|
1518
1519
|
attributes: {
|
|
@@ -1690,7 +1691,7 @@ var t$52 = t$60()({
|
|
|
1690
1691
|
//#region ../sdk-elements/dist/elements/basic/RichText/declaration.mjs
|
|
1691
1692
|
var n$40 = t$60()({
|
|
1692
1693
|
type: "richText",
|
|
1693
|
-
attributeValues: { format: e$
|
|
1694
|
+
attributeValues: { format: e$40()([
|
|
1694
1695
|
"html",
|
|
1695
1696
|
"markdown",
|
|
1696
1697
|
"text"
|
|
@@ -1831,7 +1832,7 @@ var n$39 = {
|
|
|
1831
1832
|
};
|
|
1832
1833
|
var r$32 = t$60()({
|
|
1833
1834
|
type: "themeToggle",
|
|
1834
|
-
attributeValues: { subType: e$
|
|
1835
|
+
attributeValues: { subType: e$40()(["switch", "segmented"]) },
|
|
1835
1836
|
triggers: { onThemeChange: {
|
|
1836
1837
|
action: "onThemeChange",
|
|
1837
1838
|
title: "On Theme Change",
|
|
@@ -1899,7 +1900,7 @@ var r$32 = t$60()({
|
|
|
1899
1900
|
//#region ../sdk-elements/dist/elements/form/Form/declaration.mjs
|
|
1900
1901
|
var n$38 = t$60()({
|
|
1901
1902
|
type: "form",
|
|
1902
|
-
attributeValues: { method: e$
|
|
1903
|
+
attributeValues: { method: e$40()(["get", "post"]) },
|
|
1903
1904
|
sourceType: "apiContainer",
|
|
1904
1905
|
triggers: { onSubmit: {
|
|
1905
1906
|
action: "onSubmit",
|
|
@@ -2035,7 +2036,7 @@ var r$31 = {
|
|
|
2035
2036
|
...n$37,
|
|
2036
2037
|
"line-height": "20px"
|
|
2037
2038
|
};
|
|
2038
|
-
var i$
|
|
2039
|
+
var i$26 = {
|
|
2039
2040
|
display: "flex",
|
|
2040
2041
|
cursor: "pointer",
|
|
2041
2042
|
"font-weight": "600",
|
|
@@ -2045,7 +2046,7 @@ var i$25 = {
|
|
|
2045
2046
|
"user-select": "none"
|
|
2046
2047
|
};
|
|
2047
2048
|
var a$21 = {
|
|
2048
|
-
...i$
|
|
2049
|
+
...i$26,
|
|
2049
2050
|
"margin-bottom": "4px"
|
|
2050
2051
|
};
|
|
2051
2052
|
var o$23 = {
|
|
@@ -2079,7 +2080,7 @@ var l$13 = {
|
|
|
2079
2080
|
"font-size": "inherit",
|
|
2080
2081
|
"box-shadow": "none"
|
|
2081
2082
|
};
|
|
2082
|
-
var u$
|
|
2083
|
+
var u$14 = {
|
|
2083
2084
|
height: "100%",
|
|
2084
2085
|
width: "100%",
|
|
2085
2086
|
display: "block",
|
|
@@ -2163,7 +2164,7 @@ var m$7 = (e, t, { field: n, icon: r } = {}) => ({
|
|
|
2163
2164
|
var h$4 = { field: l$13 };
|
|
2164
2165
|
var g$4 = t$60()({
|
|
2165
2166
|
type: "formControl",
|
|
2166
|
-
attributeValues: { subType: e$
|
|
2167
|
+
attributeValues: { subType: e$40()([
|
|
2167
2168
|
"text",
|
|
2168
2169
|
"number",
|
|
2169
2170
|
"email",
|
|
@@ -2218,7 +2219,7 @@ var g$4 = t$60()({
|
|
|
2218
2219
|
definition: {
|
|
2219
2220
|
label: "Form Control",
|
|
2220
2221
|
type: "formControl",
|
|
2221
|
-
description: "A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input. A select offers its `options`: `[{ label, value }, …]` — the text shown, and what the field takes. A `switch` is a checkbox announced and drawn as an on/off switch (`role=\"switch\"`), for a setting that applies at once; both hold `true`/`false`, and a `defaultValue` of `\"true\"` starts them on. Its slots: `label`, `requiredMark` (the `*` that ends the label of a required field), `input` (the box a typed field or a select is drawn in — a textarea, checkbox or switch is its own box), `field` (the `<input>` or `<select>` inside that box), `icon` (the show/hide button of a password) and `error`. The thumb of a switch is no element a class reaches: the class on its `input` slot sets `--plitzi-switch-thumb` (off), `--plitzi-switch-thumb-checked` (on, white by default) and `--plitzi-switch-thumb-shadow`.",
|
|
2222
|
+
description: "A single labelled input (text/select/checkbox/… per its subType) inside a form; captures one field of user input. Optional unless `required: true`, as an HTML field is: a `requiredMessage` alone requires nothing. A select offers its `options`: `[{ label, value }, …]` — the text shown, and what the field takes. A `switch` is a checkbox announced and drawn as an on/off switch (`role=\"switch\"`), for a setting that applies at once; both hold `true`/`false`, and a `defaultValue` of `\"true\"` starts them on. Its slots: `label`, `requiredMark` (the `*` that ends the label of a required field), `input` (the box a typed field or a select is drawn in — a textarea, checkbox or switch is its own box), `field` (the `<input>` or `<select>` inside that box), `icon` (the show/hide button of a password) and `error`. The box is ringed (`2px solid currentColor`) while the field inside has keyboard focus: restyle it with a `focus-within` state on the `input` slot — the box never takes `focus` itself. The thumb of a switch is no element a class reaches: the class on its `input` slot sets `--plitzi-switch-thumb` (off), `--plitzi-switch-thumb-checked` (on, white by default) and `--plitzi-switch-thumb-shadow`.",
|
|
2222
2223
|
bindings: {},
|
|
2223
2224
|
styleSelectors: {
|
|
2224
2225
|
base: "",
|
|
@@ -2273,7 +2274,7 @@ var g$4 = t$60()({
|
|
|
2273
2274
|
color: "inherit",
|
|
2274
2275
|
resize: "vertical"
|
|
2275
2276
|
}),
|
|
2276
|
-
select: m$7("Form Control Select", f$10, { field: u$
|
|
2277
|
+
select: m$7("Form Control Select", f$10, { field: u$14 }),
|
|
2277
2278
|
checkbox: {
|
|
2278
2279
|
name: "Form Control Checkbox",
|
|
2279
2280
|
displayMode: "desktop",
|
|
@@ -2285,7 +2286,7 @@ var g$4 = t$60()({
|
|
|
2285
2286
|
"margin-left": "0px",
|
|
2286
2287
|
"margin-right": "4px"
|
|
2287
2288
|
} },
|
|
2288
|
-
label: { default: i$
|
|
2289
|
+
label: { default: i$26 },
|
|
2289
2290
|
requiredMark: { default: s$20 },
|
|
2290
2291
|
error: { default: o$23 }
|
|
2291
2292
|
}
|
|
@@ -2297,7 +2298,7 @@ var g$4 = t$60()({
|
|
|
2297
2298
|
base: { default: {} },
|
|
2298
2299
|
input: { default: p$11 },
|
|
2299
2300
|
label: { default: {
|
|
2300
|
-
...i$
|
|
2301
|
+
...i$26,
|
|
2301
2302
|
"align-items": "center"
|
|
2302
2303
|
} },
|
|
2303
2304
|
requiredMark: { default: s$20 },
|
|
@@ -2313,7 +2314,7 @@ var g$4 = t$60()({
|
|
|
2313
2314
|
//#region ../sdk-elements/dist/elements/internal/LayoutContainer/declaration.mjs
|
|
2314
2315
|
var n$36 = t$60()({
|
|
2315
2316
|
type: "layoutContainer",
|
|
2316
|
-
attributeValues: { subType: e$
|
|
2317
|
+
attributeValues: { subType: e$40()([
|
|
2317
2318
|
"div",
|
|
2318
2319
|
"header",
|
|
2319
2320
|
"footer",
|
|
@@ -2451,6 +2452,11 @@ var t$49 = t$60()({
|
|
|
2451
2452
|
//#region ../sdk-elements/dist/elements/internal/Page/declaration.mjs
|
|
2452
2453
|
var t$48 = t$60()({
|
|
2453
2454
|
type: "page",
|
|
2455
|
+
serverTemplates: [
|
|
2456
|
+
"seoPageTitle",
|
|
2457
|
+
"seoPageDescription",
|
|
2458
|
+
"notFound"
|
|
2459
|
+
],
|
|
2454
2460
|
triggers: { onPageLoad: {
|
|
2455
2461
|
action: "onPageLoad",
|
|
2456
2462
|
title: "On Page Load",
|
|
@@ -2624,12 +2630,12 @@ var t$46 = t$60()({
|
|
|
2624
2630
|
var n$35 = t$60()({
|
|
2625
2631
|
type: "image",
|
|
2626
2632
|
attributeValues: {
|
|
2627
|
-
fetchPriority: e$
|
|
2633
|
+
fetchPriority: e$40()([
|
|
2628
2634
|
"high",
|
|
2629
2635
|
"low",
|
|
2630
2636
|
"auto"
|
|
2631
2637
|
]),
|
|
2632
|
-
loadMode: e$
|
|
2638
|
+
loadMode: e$40()([
|
|
2633
2639
|
"auto",
|
|
2634
2640
|
"eager",
|
|
2635
2641
|
"lazy"
|
|
@@ -2784,7 +2790,7 @@ var t$44 = t$60()({
|
|
|
2784
2790
|
var n$34 = t$60()({
|
|
2785
2791
|
type: "apiContainer",
|
|
2786
2792
|
attributeValues: {
|
|
2787
|
-
subType: e$
|
|
2793
|
+
subType: e$40()([
|
|
2788
2794
|
"",
|
|
2789
2795
|
"div",
|
|
2790
2796
|
"header",
|
|
@@ -2797,25 +2803,26 @@ var n$34 = t$60()({
|
|
|
2797
2803
|
"address",
|
|
2798
2804
|
"figure"
|
|
2799
2805
|
]),
|
|
2800
|
-
method: e$
|
|
2806
|
+
method: e$40()([
|
|
2801
2807
|
"get",
|
|
2802
2808
|
"post",
|
|
2803
2809
|
"put",
|
|
2804
2810
|
"delete",
|
|
2805
2811
|
"patch"
|
|
2806
2812
|
]),
|
|
2807
|
-
credentials: e$
|
|
2813
|
+
credentials: e$40()([
|
|
2808
2814
|
"include",
|
|
2809
2815
|
"omit",
|
|
2810
2816
|
"same-origin"
|
|
2811
2817
|
]),
|
|
2812
|
-
pagination: e$
|
|
2818
|
+
pagination: e$40()([
|
|
2813
2819
|
"none",
|
|
2814
2820
|
"url",
|
|
2815
2821
|
"append"
|
|
2816
2822
|
])
|
|
2817
2823
|
},
|
|
2818
2824
|
sourceType: "apiContainer",
|
|
2825
|
+
serverTemplates: ["notFound"],
|
|
2819
2826
|
triggers: {
|
|
2820
2827
|
onApiError: {
|
|
2821
2828
|
action: "onApiError",
|
|
@@ -2959,7 +2966,7 @@ var n$34 = t$60()({
|
|
|
2959
2966
|
//#region ../sdk-elements/dist/elements/provider/Channel/declaration.mjs
|
|
2960
2967
|
var n$33 = t$60()({
|
|
2961
2968
|
type: "channel",
|
|
2962
|
-
attributeValues: { subType: e$
|
|
2969
|
+
attributeValues: { subType: e$40()([
|
|
2963
2970
|
"",
|
|
2964
2971
|
"div",
|
|
2965
2972
|
"section",
|
|
@@ -3079,8 +3086,53 @@ var n$33 = t$60()({
|
|
|
3079
3086
|
}
|
|
3080
3087
|
});
|
|
3081
3088
|
//#endregion
|
|
3082
|
-
//#region ../sdk-elements/dist/elements/structure/Carousel/declaration.mjs
|
|
3089
|
+
//#region ../sdk-elements/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs
|
|
3083
3090
|
var t$43 = t$60()({
|
|
3091
|
+
type: "carouselTrack",
|
|
3092
|
+
ancestorType: "carousel",
|
|
3093
|
+
content: {
|
|
3094
|
+
attributes: {},
|
|
3095
|
+
definition: {
|
|
3096
|
+
label: "Carousel Track",
|
|
3097
|
+
type: "carouselTrack",
|
|
3098
|
+
description: "Where a carousel shows its slides: what is inside is one slide, rendered once per item.",
|
|
3099
|
+
items: [],
|
|
3100
|
+
bindings: {},
|
|
3101
|
+
styleSelectors: { base: "" },
|
|
3102
|
+
initialState: { visibility: !0 }
|
|
3103
|
+
},
|
|
3104
|
+
builder: {
|
|
3105
|
+
canDelete: !0,
|
|
3106
|
+
canSelect: !0,
|
|
3107
|
+
canDragDrop: !0,
|
|
3108
|
+
canMove: !0,
|
|
3109
|
+
canSnippet: !1,
|
|
3110
|
+
itemsAllowed: [],
|
|
3111
|
+
itemsNotAllowed: []
|
|
3112
|
+
},
|
|
3113
|
+
market: {
|
|
3114
|
+
category: "structure",
|
|
3115
|
+
owner: "Plitzi",
|
|
3116
|
+
verified: !0,
|
|
3117
|
+
license: "MIT",
|
|
3118
|
+
website: "https://plitzi.com",
|
|
3119
|
+
backgroundColor: "#4422ee",
|
|
3120
|
+
icon: "fa-solid fa-film"
|
|
3121
|
+
},
|
|
3122
|
+
defaultStyle: {
|
|
3123
|
+
name: "Carousel Track",
|
|
3124
|
+
displayMode: "desktop",
|
|
3125
|
+
style: { base: { default: {
|
|
3126
|
+
position: "relative",
|
|
3127
|
+
overflow: "hidden"
|
|
3128
|
+
} } }
|
|
3129
|
+
},
|
|
3130
|
+
settings: {}
|
|
3131
|
+
}
|
|
3132
|
+
});
|
|
3133
|
+
//#endregion
|
|
3134
|
+
//#region ../sdk-elements/dist/elements/structure/Carousel/declaration.mjs
|
|
3135
|
+
var t$42 = t$60()({
|
|
3084
3136
|
type: "carousel",
|
|
3085
3137
|
sourceType: "carousel",
|
|
3086
3138
|
triggers: { onChange: {
|
|
@@ -3183,51 +3235,6 @@ var t$43 = t$60()({
|
|
|
3183
3235
|
initialItems: ["carouselTrack"]
|
|
3184
3236
|
});
|
|
3185
3237
|
//#endregion
|
|
3186
|
-
//#region ../sdk-elements/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs
|
|
3187
|
-
var t$42 = t$60()({
|
|
3188
|
-
type: "carouselTrack",
|
|
3189
|
-
ancestorType: "carousel",
|
|
3190
|
-
content: {
|
|
3191
|
-
attributes: {},
|
|
3192
|
-
definition: {
|
|
3193
|
-
label: "Carousel Track",
|
|
3194
|
-
type: "carouselTrack",
|
|
3195
|
-
description: "Where a carousel shows its slides: what is inside is one slide, rendered once per item.",
|
|
3196
|
-
items: [],
|
|
3197
|
-
bindings: {},
|
|
3198
|
-
styleSelectors: { base: "" },
|
|
3199
|
-
initialState: { visibility: !0 }
|
|
3200
|
-
},
|
|
3201
|
-
builder: {
|
|
3202
|
-
canDelete: !0,
|
|
3203
|
-
canSelect: !0,
|
|
3204
|
-
canDragDrop: !0,
|
|
3205
|
-
canMove: !0,
|
|
3206
|
-
canSnippet: !1,
|
|
3207
|
-
itemsAllowed: [],
|
|
3208
|
-
itemsNotAllowed: []
|
|
3209
|
-
},
|
|
3210
|
-
market: {
|
|
3211
|
-
category: "structure",
|
|
3212
|
-
owner: "Plitzi",
|
|
3213
|
-
verified: !0,
|
|
3214
|
-
license: "MIT",
|
|
3215
|
-
website: "https://plitzi.com",
|
|
3216
|
-
backgroundColor: "#4422ee",
|
|
3217
|
-
icon: "fa-solid fa-film"
|
|
3218
|
-
},
|
|
3219
|
-
defaultStyle: {
|
|
3220
|
-
name: "Carousel Track",
|
|
3221
|
-
displayMode: "desktop",
|
|
3222
|
-
style: { base: { default: {
|
|
3223
|
-
position: "relative",
|
|
3224
|
-
overflow: "hidden"
|
|
3225
|
-
} } }
|
|
3226
|
-
},
|
|
3227
|
-
settings: {}
|
|
3228
|
-
}
|
|
3229
|
-
});
|
|
3230
|
-
//#endregion
|
|
3231
3238
|
//#region ../sdk-elements/dist/elements/structure/Container/declaration.mjs
|
|
3232
3239
|
var n$32 = [
|
|
3233
3240
|
"div",
|
|
@@ -3243,7 +3250,7 @@ var n$32 = [
|
|
|
3243
3250
|
var r$30 = t$60()({
|
|
3244
3251
|
type: "container",
|
|
3245
3252
|
attributeValues: {
|
|
3246
|
-
subType: e$
|
|
3253
|
+
subType: e$40()([
|
|
3247
3254
|
"div",
|
|
3248
3255
|
"header",
|
|
3249
3256
|
"footer",
|
|
@@ -3267,7 +3274,7 @@ var r$30 = t$60()({
|
|
|
3267
3274
|
"p",
|
|
3268
3275
|
"span"
|
|
3269
3276
|
]),
|
|
3270
|
-
live: e$
|
|
3277
|
+
live: e$40()([
|
|
3271
3278
|
"",
|
|
3272
3279
|
"polite",
|
|
3273
3280
|
"assertive"
|
|
@@ -3362,8 +3369,8 @@ var B = {
|
|
|
3362
3369
|
BlockHtml: t$59,
|
|
3363
3370
|
BlockJsx: t$58,
|
|
3364
3371
|
Button: r$33,
|
|
3365
|
-
Carousel: t$
|
|
3366
|
-
CarouselTrack: t$
|
|
3372
|
+
Carousel: t$42,
|
|
3373
|
+
CarouselTrack: t$43,
|
|
3367
3374
|
Channel: n$33,
|
|
3368
3375
|
Container: r$30,
|
|
3369
3376
|
Custom: t$57,
|
|
@@ -3496,8 +3503,7 @@ var B = {
|
|
|
3496
3503
|
top: "0",
|
|
3497
3504
|
position: "absolute",
|
|
3498
3505
|
"z-index": "210",
|
|
3499
|
-
"background-color": "
|
|
3500
|
-
opacity: "0.5"
|
|
3506
|
+
"background-color": "rgb(0 0 0 / 50%)"
|
|
3501
3507
|
} },
|
|
3502
3508
|
rootContainer: { default: {
|
|
3503
3509
|
display: "flex",
|
|
@@ -3568,8 +3574,8 @@ var B = {
|
|
|
3568
3574
|
List: t$60()({
|
|
3569
3575
|
type: "list",
|
|
3570
3576
|
attributeValues: {
|
|
3571
|
-
subType: e$
|
|
3572
|
-
source: e$
|
|
3577
|
+
subType: e$40()(["ul", "ol"]),
|
|
3578
|
+
source: e$40()(["none", "controlled"])
|
|
3573
3579
|
},
|
|
3574
3580
|
sourceType: "list",
|
|
3575
3581
|
content: {
|
|
@@ -3732,7 +3738,7 @@ var B = {
|
|
|
3732
3738
|
definition: {
|
|
3733
3739
|
label: "Modal Container",
|
|
3734
3740
|
type: "modalContainer",
|
|
3735
|
-
description: "A modal overlay container opened and closed through interactions; use for dialogs over the page.",
|
|
3741
|
+
description: "A modal overlay container opened and closed through interactions; use for dialogs over the page. The element itself is fixed over the whole viewport, and holds two layers side by side — neither inside the other: `backgroundContainer`, the dim layer, `rgb(0 0 0 / 50%)` (its `background-color` is the whole dim), and `rootContainer`, the dialog, centred by `top: 50%`, `left: 50%` and `transform: translate3d(-50%, -50%, 0)` — to sit it near the top, set `top` and `transform: translateX(-50%)`; flex alignment on the dim layer moves nothing. Inside the dialog, top to bottom: `headerContainer` (with `headerTitle` and `headerCloseButton`) and `bodyContainer`.",
|
|
3736
3742
|
items: [],
|
|
3737
3743
|
bindings: {},
|
|
3738
3744
|
loadStrategy: "lazy",
|
|
@@ -3784,8 +3790,7 @@ var B = {
|
|
|
3784
3790
|
top: "0",
|
|
3785
3791
|
position: "absolute",
|
|
3786
3792
|
"z-index": "210",
|
|
3787
|
-
"background-color": "
|
|
3788
|
-
opacity: "0.5"
|
|
3793
|
+
"background-color": "rgb(0 0 0 / 50%)"
|
|
3789
3794
|
} },
|
|
3790
3795
|
rootContainer: { default: {
|
|
3791
3796
|
display: "flex",
|
|
@@ -3869,8 +3874,8 @@ var B = {
|
|
|
3869
3874
|
Pagination: t$60()({
|
|
3870
3875
|
type: "pagination",
|
|
3871
3876
|
attributeValues: {
|
|
3872
|
-
mode: e$
|
|
3873
|
-
target: e$
|
|
3877
|
+
mode: e$40()(["pages", "loadMore"]),
|
|
3878
|
+
target: e$40()(["url", "interaction"])
|
|
3874
3879
|
},
|
|
3875
3880
|
triggers: { onPageChange: {
|
|
3876
3881
|
action: "onPageChange",
|
|
@@ -4122,6 +4127,7 @@ var B = {
|
|
|
4122
4127
|
ThemeToggle: r$32,
|
|
4123
4128
|
Video: t$44
|
|
4124
4129
|
};
|
|
4130
|
+
var V = Object.fromEntries(Object.values(B).flatMap((e) => "serverTemplates" in e ? [[e.type, e.serverTemplates]] : []));
|
|
4125
4131
|
//#endregion
|
|
4126
4132
|
//#region src/elements/catalog.ts
|
|
4127
4133
|
/** Every declaration, read through the part of its shape this catalog uses. */
|
|
@@ -4153,7 +4159,7 @@ var elementSourceTypes = Object.fromEntries(Object.values(declarations).filter((
|
|
|
4153
4159
|
* element that fires it ever starts the flow — an `onSubmit` on a form's submit button is saved, looks right beside
|
|
4154
4160
|
* the form, and never runs, which is how a working form reads as "forms do not work outside the builder".
|
|
4155
4161
|
*/
|
|
4156
|
-
var elementTriggers = Object.fromEntries(Object.values(declarations).map((declaration) => [declaration.type, [...Object.keys(e$
|
|
4162
|
+
var elementTriggers = Object.fromEntries(Object.values(declarations).map((declaration) => [declaration.type, [...Object.keys(e$41), ...Object.keys(declaration.triggers ?? {})]]));
|
|
4157
4163
|
/** The triggers only some types fire, by action name — for a step builder that wants the title the builder shows. */
|
|
4158
4164
|
var typeTriggerDefinitions = Object.fromEntries(Object.values(declarations).flatMap((declaration) => Object.entries(declaration.triggers ?? {})));
|
|
4159
4165
|
/** The callbacks only some types answer to, by action name — with their params, for whatever explains or checks one. */
|
|
@@ -4284,6 +4290,11 @@ var AUTHORING_CODES = {
|
|
|
4284
4290
|
means: "a page that sends visitors it is not for to a page the space does not have",
|
|
4285
4291
|
fix: "a page's id or slug (`''` is the home page), or a full URL"
|
|
4286
4292
|
},
|
|
4293
|
+
"page-template": {
|
|
4294
|
+
kind: "refused",
|
|
4295
|
+
means: "a template in a page's `seoTitle`, `seoDescription` or `notFound` that reads what is not there when the server answers — anything but the page's `runtime: 'server'` providers and `navigation` — or cannot be read",
|
|
4296
|
+
fix: "read the record from a provider with `runtime: 'server'` on the page or its layout — `'{{ apiContainer_post.title }} — Blog'` — or words of its own"
|
|
4297
|
+
},
|
|
4287
4298
|
"folder-undeclared": {
|
|
4288
4299
|
kind: "refused",
|
|
4289
4300
|
means: "a page, a layout or a folder filed in a folder the space does not declare",
|
|
@@ -4459,6 +4470,11 @@ var AUTHORING_CODES = {
|
|
|
4459
4470
|
means: "an ancestor condition keyed by something that is neither a class name nor `'>'` (the parent)",
|
|
4460
4471
|
fix: "`[card.name]` for a `styles()` declaration, or `'>'` for the parent whatever it wears"
|
|
4461
4472
|
},
|
|
4473
|
+
"focus-on-field-box": {
|
|
4474
|
+
kind: "warned",
|
|
4475
|
+
means: "a `focus` or `focus-visible` state on a text field's or a select's `input` slot — the box the field is drawn in, which never takes focus, so no ring is ever shown",
|
|
4476
|
+
fix: "`'focus-within'` on the same class, or the state on the `field` slot"
|
|
4477
|
+
},
|
|
4462
4478
|
"heading-level-overridden": {
|
|
4463
4479
|
kind: "warned",
|
|
4464
4480
|
means: "a markdown's or richText's `heading` slot and a level's (`heading3`) both setting one property, the general class written later in the stylesheet — the level's value is lost",
|
|
@@ -4696,7 +4712,7 @@ var AUTHORING_CODES = {
|
|
|
4696
4712
|
},
|
|
4697
4713
|
"not-found-not-a-template": {
|
|
4698
4714
|
kind: "refused",
|
|
4699
|
-
means: "`notFound
|
|
4715
|
+
means: "`notFound`, a provider's or a page's, that is not one `{{ expression }}` — never `true`, so never a 404",
|
|
4700
4716
|
fix: "`notFound: '{{ source.found == false }}'`"
|
|
4701
4717
|
},
|
|
4702
4718
|
"server-data-in-browser": {
|
|
@@ -4719,6 +4735,11 @@ var AUTHORING_CODES = {
|
|
|
4719
4735
|
means: "a control in a form with no `name` — its value never reaches `values`",
|
|
4720
4736
|
fix: "`formControl({ name: 'email', … })`"
|
|
4721
4737
|
},
|
|
4738
|
+
"required-message-unused": {
|
|
4739
|
+
kind: "warned",
|
|
4740
|
+
means: "a `requiredMessage` on a field nothing requires — fields are optional unless `required: true`, so it is never shown and an empty answer is sent",
|
|
4741
|
+
fix: "`required: true` on the field, or no message"
|
|
4742
|
+
},
|
|
4722
4743
|
"form-control-name-taken": {
|
|
4723
4744
|
kind: "warned",
|
|
4724
4745
|
means: "two controls in one form with one name — one overwrites the other",
|
|
@@ -5388,7 +5409,7 @@ var twig = (parts, ...values) => parts.reduce((text, part, index) => {
|
|
|
5388
5409
|
}, "");
|
|
5389
5410
|
//#endregion
|
|
5390
5411
|
//#region ../sdk-shared/dist/dataSource/globalSources.mjs
|
|
5391
|
-
var e$
|
|
5412
|
+
var e$39 = [
|
|
5392
5413
|
"variables",
|
|
5393
5414
|
"navigation",
|
|
5394
5415
|
"auth",
|
|
@@ -5398,7 +5419,7 @@ var e$38 = [
|
|
|
5398
5419
|
"flags",
|
|
5399
5420
|
"computed"
|
|
5400
5421
|
];
|
|
5401
|
-
e$
|
|
5422
|
+
e$39.filter((e) => e !== "state" && e !== "computed");
|
|
5402
5423
|
var n$28 = {
|
|
5403
5424
|
navigation: {
|
|
5404
5425
|
routeParams: "open",
|
|
@@ -5422,7 +5443,7 @@ var n$28 = {
|
|
|
5422
5443
|
};
|
|
5423
5444
|
//#endregion
|
|
5424
5445
|
//#region ../sdk-shared/dist/helpers/twigWrapper/charClass.mjs
|
|
5425
|
-
var e$
|
|
5446
|
+
var e$38 = {
|
|
5426
5447
|
Tab: 9,
|
|
5427
5448
|
Newline: 10,
|
|
5428
5449
|
CarriageReturn: 13,
|
|
@@ -5458,11 +5479,11 @@ var e$37 = {
|
|
|
5458
5479
|
LowerR: 114,
|
|
5459
5480
|
LowerT: 116
|
|
5460
5481
|
};
|
|
5461
|
-
var t$33 = (t) => t >= 97 && t <= 122 || t >= 65 && t <= 90 || t === e$
|
|
5462
|
-
var n$27 = (n) => t$33(n) || n >= e$
|
|
5463
|
-
var r$28 = (t) => n$27(t) || t === e$
|
|
5464
|
-
var i$
|
|
5465
|
-
var a$20 = (t) => t === e$
|
|
5482
|
+
var t$33 = (t) => t >= 97 && t <= 122 || t >= 65 && t <= 90 || t === e$38.Underscore;
|
|
5483
|
+
var n$27 = (n) => t$33(n) || n >= e$38.Zero && n <= e$38.Nine;
|
|
5484
|
+
var r$28 = (t) => n$27(t) || t === e$38.Minus;
|
|
5485
|
+
var i$25 = (t) => t >= e$38.Zero && t <= e$38.Nine;
|
|
5486
|
+
var a$20 = (t) => t === e$38.Space || t === e$38.Tab || t === e$38.Newline || t === e$38.CarriageReturn;
|
|
5466
5487
|
var o$22 = (e) => {
|
|
5467
5488
|
let r = e.length;
|
|
5468
5489
|
if (r === 0 || !t$33(e.charCodeAt(0))) return !1;
|
|
@@ -5475,24 +5496,24 @@ var s$19 = (r) => {
|
|
|
5475
5496
|
let o = !1, s = !1;
|
|
5476
5497
|
for (let c = 1; c < a; c++) {
|
|
5477
5498
|
let a = r.charCodeAt(c);
|
|
5478
|
-
if (a === e$
|
|
5499
|
+
if (a === e$38.Dot) {
|
|
5479
5500
|
if (o) return !1;
|
|
5480
5501
|
o = !0, s = !1;
|
|
5481
5502
|
continue;
|
|
5482
5503
|
}
|
|
5483
5504
|
if (o) {
|
|
5484
|
-
if (s = i$
|
|
5505
|
+
if (s = i$25(a), !s && !t$33(a)) return !1;
|
|
5485
5506
|
o = !1;
|
|
5486
5507
|
continue;
|
|
5487
5508
|
}
|
|
5488
|
-
if (s ? !i$
|
|
5509
|
+
if (s ? !i$25(a) : !n$27(a)) return !1;
|
|
5489
5510
|
}
|
|
5490
5511
|
return !o;
|
|
5491
5512
|
};
|
|
5492
5513
|
var c$17 = (e) => o$22(e);
|
|
5493
5514
|
//#endregion
|
|
5494
5515
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Lexer/Lexer.mjs
|
|
5495
|
-
var e$
|
|
5516
|
+
var e$37 = (e) => {
|
|
5496
5517
|
let t = [], n = 0;
|
|
5497
5518
|
for (; n < e.length;) {
|
|
5498
5519
|
let r = e.indexOf("{{", n), i = e.indexOf("{%", n), a, o;
|
|
@@ -5544,11 +5565,11 @@ var e$36 = (e) => {
|
|
|
5544
5565
|
};
|
|
5545
5566
|
//#endregion
|
|
5546
5567
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Lexer/types.mjs
|
|
5547
|
-
var e$
|
|
5568
|
+
var e$36 = (e, t) => t ? `{{{${e}}}}` : `{{${e}}}`;
|
|
5548
5569
|
var t$32 = (t) => {
|
|
5549
5570
|
switch (t.type) {
|
|
5550
5571
|
case "text": return t.value;
|
|
5551
|
-
case "variable": return e$
|
|
5572
|
+
case "variable": return e$36(t.content, t.raw);
|
|
5552
5573
|
case "tag": return `{%${t.content}%}`;
|
|
5553
5574
|
}
|
|
5554
5575
|
};
|
|
@@ -5580,24 +5601,24 @@ var o$21 = class {
|
|
|
5580
5601
|
}
|
|
5581
5602
|
scanIndex() {
|
|
5582
5603
|
let e = this.pos;
|
|
5583
|
-
for (; !this.eof() && i$
|
|
5604
|
+
for (; !this.eof() && i$25(this.src.charCodeAt(this.pos));) this.pos++;
|
|
5584
5605
|
return this.src.slice(e, this.pos);
|
|
5585
5606
|
}
|
|
5586
5607
|
scanStringLiteral() {
|
|
5587
5608
|
let t = this.src.charCodeAt(this.pos);
|
|
5588
5609
|
this.pos++;
|
|
5589
5610
|
let n = "";
|
|
5590
|
-
for (; this.pos < this.src.length && this.src.charCodeAt(this.pos) !== t;) if (this.src.charCodeAt(this.pos) === e$
|
|
5611
|
+
for (; this.pos < this.src.length && this.src.charCodeAt(this.pos) !== t;) if (this.src.charCodeAt(this.pos) === e$38.Backslash && this.pos + 1 < this.src.length) {
|
|
5591
5612
|
this.pos++;
|
|
5592
5613
|
let r = this.src.charCodeAt(this.pos);
|
|
5593
|
-
r === e$
|
|
5614
|
+
r === e$38.LowerN ? n += "\n" : r === e$38.LowerT ? n += " " : r === e$38.LowerR ? n += "\r" : r === e$38.Backslash ? n += "\\" : n += r === t ? String.fromCharCode(r) : String.fromCharCode(e$38.Backslash) + String.fromCharCode(r), this.pos++;
|
|
5594
5615
|
} else n += this.src[this.pos], this.pos++;
|
|
5595
5616
|
return this.pos < this.src.length && this.pos++, n;
|
|
5596
5617
|
}
|
|
5597
5618
|
scanNumber() {
|
|
5598
5619
|
let n = this.pos;
|
|
5599
|
-
for (this.src.charCodeAt(this.pos) === e$
|
|
5600
|
-
if (this.src.charCodeAt(this.pos) === e$
|
|
5620
|
+
for (this.src.charCodeAt(this.pos) === e$38.Minus && this.pos++; this.pos < this.src.length && i$25(this.src.charCodeAt(this.pos));) this.pos++;
|
|
5621
|
+
if (this.src.charCodeAt(this.pos) === e$38.Dot) for (this.pos++; this.pos < this.src.length && i$25(this.src.charCodeAt(this.pos));) this.pos++;
|
|
5601
5622
|
return Number(this.src.slice(n, this.pos));
|
|
5602
5623
|
}
|
|
5603
5624
|
matchKeyword(e) {
|
|
@@ -5609,13 +5630,13 @@ var o$21 = class {
|
|
|
5609
5630
|
matchBinaryOp() {
|
|
5610
5631
|
this.skipWs();
|
|
5611
5632
|
let t = this.peek();
|
|
5612
|
-
if (this.at(1) === e$
|
|
5613
|
-
if (t === e$
|
|
5614
|
-
if (t === e$
|
|
5615
|
-
if (t === e$
|
|
5616
|
-
if (t === e$
|
|
5633
|
+
if (this.at(1) === e$38.Equals) {
|
|
5634
|
+
if (t === e$38.Equals) return this.pos += 2, "==";
|
|
5635
|
+
if (t === e$38.Bang) return this.pos += 2, "!=";
|
|
5636
|
+
if (t === e$38.Greater) return this.pos += 2, ">=";
|
|
5637
|
+
if (t === e$38.Less) return this.pos += 2, "<=";
|
|
5617
5638
|
}
|
|
5618
|
-
return t === e$
|
|
5639
|
+
return t === e$38.Greater ? (this.pos++, ">") : t === e$38.Less ? (this.pos++, "<") : null;
|
|
5619
5640
|
}
|
|
5620
5641
|
};
|
|
5621
5642
|
//#endregion
|
|
@@ -5624,7 +5645,7 @@ var r$27 = (e, t) => {
|
|
|
5624
5645
|
let n = new s$18(e, t), r = n.parseTernary();
|
|
5625
5646
|
return n.expectEnd(), r;
|
|
5626
5647
|
};
|
|
5627
|
-
var i$
|
|
5648
|
+
var i$24 = (e, t) => {
|
|
5628
5649
|
let n = new s$18(e, t), r = n.parseApplyChain();
|
|
5629
5650
|
return n.expectEnd(), r;
|
|
5630
5651
|
};
|
|
@@ -5650,15 +5671,15 @@ var s$18 = class extends o$21 {
|
|
|
5650
5671
|
}
|
|
5651
5672
|
parseTernary() {
|
|
5652
5673
|
let t = this.parseOr();
|
|
5653
|
-
if (this.skipWs(), this.peek() !== e$
|
|
5654
|
-
if (this.pos++, this.skipWs(), this.peek() === e$
|
|
5674
|
+
if (this.skipWs(), this.peek() !== e$38.Question) return t;
|
|
5675
|
+
if (this.pos++, this.skipWs(), this.peek() === e$38.Colon) return this.pos++, this.skipWs(), {
|
|
5655
5676
|
type: "ternary",
|
|
5656
5677
|
condition: t,
|
|
5657
5678
|
trueExpr: null,
|
|
5658
5679
|
falseExpr: this.parseTernary()
|
|
5659
5680
|
};
|
|
5660
5681
|
let n = this.parseOr();
|
|
5661
|
-
return this.skipWs(), this.peek() === e$
|
|
5682
|
+
return this.skipWs(), this.peek() === e$38.Colon ? (this.pos++, this.skipWs(), {
|
|
5662
5683
|
type: "ternary",
|
|
5663
5684
|
condition: t,
|
|
5664
5685
|
trueExpr: n,
|
|
@@ -5810,7 +5831,7 @@ var s$18 = class extends o$21 {
|
|
|
5810
5831
|
}
|
|
5811
5832
|
parseConcat() {
|
|
5812
5833
|
let t = this.parseAdditive();
|
|
5813
|
-
for (this.skipWs(); this.peek() === e$
|
|
5834
|
+
for (this.skipWs(); this.peek() === e$38.Tilde;) {
|
|
5814
5835
|
this.pos++;
|
|
5815
5836
|
let e = this.parseAdditive();
|
|
5816
5837
|
t = t.type === "concat" ? {
|
|
@@ -5826,9 +5847,9 @@ var s$18 = class extends o$21 {
|
|
|
5826
5847
|
parseAdditive() {
|
|
5827
5848
|
let t = this.parseMultiplicative();
|
|
5828
5849
|
this.skipWs();
|
|
5829
|
-
for (let n = this.peek(); n === e$
|
|
5850
|
+
for (let n = this.peek(); n === e$38.Plus || n === e$38.Minus; n = this.peek()) this.pos++, t = {
|
|
5830
5851
|
type: "binary",
|
|
5831
|
-
operator: n === e$
|
|
5852
|
+
operator: n === e$38.Plus ? "+" : "-",
|
|
5832
5853
|
left: t,
|
|
5833
5854
|
right: this.parseMultiplicative()
|
|
5834
5855
|
}, this.skipWs();
|
|
@@ -5837,11 +5858,11 @@ var s$18 = class extends o$21 {
|
|
|
5837
5858
|
parseMultiplicative() {
|
|
5838
5859
|
let t = this.parsePower();
|
|
5839
5860
|
this.skipWs();
|
|
5840
|
-
for (let n = this.peek(); (n === e$
|
|
5841
|
-
let r = n === e$
|
|
5861
|
+
for (let n = this.peek(); (n === e$38.Star || n === e$38.Slash || n === e$38.Percent) && (n !== e$38.Star || this.at(1) !== e$38.Star); n = this.peek()) {
|
|
5862
|
+
let r = n === e$38.Slash && this.at(1) === e$38.Slash;
|
|
5842
5863
|
this.pos += r ? 2 : 1, t = {
|
|
5843
5864
|
type: "binary",
|
|
5844
|
-
operator: r ? "//" : n === e$
|
|
5865
|
+
operator: r ? "//" : n === e$38.Star ? "*" : n === e$38.Slash ? "/" : "%",
|
|
5845
5866
|
left: t,
|
|
5846
5867
|
right: this.parsePower()
|
|
5847
5868
|
}, this.skipWs();
|
|
@@ -5850,7 +5871,7 @@ var s$18 = class extends o$21 {
|
|
|
5850
5871
|
}
|
|
5851
5872
|
parsePower() {
|
|
5852
5873
|
let t = this.parseDefault();
|
|
5853
|
-
return this.skipWs(), this.peek() !== e$
|
|
5874
|
+
return this.skipWs(), this.peek() !== e$38.Star || this.at(1) !== e$38.Star ? t : (this.pos += 2, {
|
|
5854
5875
|
type: "binary",
|
|
5855
5876
|
operator: "**",
|
|
5856
5877
|
left: t,
|
|
@@ -5858,27 +5879,27 @@ var s$18 = class extends o$21 {
|
|
|
5858
5879
|
});
|
|
5859
5880
|
}
|
|
5860
5881
|
parseSignedAtom() {
|
|
5861
|
-
return this.peek() === e$
|
|
5882
|
+
return this.peek() === e$38.Minus && i$25(this.at(1)) ? this.maybeTrailingFilters({
|
|
5862
5883
|
type: "literal",
|
|
5863
5884
|
value: this.scanNumber()
|
|
5864
|
-
}) : this.peek() === e$
|
|
5885
|
+
}) : this.peek() === e$38.Minus ? (this.pos++, this.skipWs(), {
|
|
5865
5886
|
type: "unary",
|
|
5866
5887
|
operator: "-",
|
|
5867
5888
|
operand: this.parseSignedAtom()
|
|
5868
5889
|
}) : this.parseAtom();
|
|
5869
5890
|
}
|
|
5870
5891
|
parseDefault() {
|
|
5871
|
-
if (this.skipWs(), this.peek() === e$
|
|
5892
|
+
if (this.skipWs(), this.peek() === e$38.Minus && i$25(this.at(1))) return this.maybeTrailingFilters({
|
|
5872
5893
|
type: "literal",
|
|
5873
5894
|
value: this.scanNumber()
|
|
5874
5895
|
});
|
|
5875
|
-
if (this.peek() === e$
|
|
5896
|
+
if (this.peek() === e$38.Minus) return this.pos++, {
|
|
5876
5897
|
type: "unary",
|
|
5877
5898
|
operator: "-",
|
|
5878
5899
|
operand: this.parseDefault()
|
|
5879
5900
|
};
|
|
5880
5901
|
let n = this.parseAtom();
|
|
5881
|
-
for (this.skipWs(); this.peek() === e$
|
|
5902
|
+
for (this.skipWs(); this.peek() === e$38.Question && this.at(1) === e$38.Question;) this.pos += 2, this.skipWs(), n = {
|
|
5882
5903
|
type: "default",
|
|
5883
5904
|
value: n,
|
|
5884
5905
|
defaultExpr: this.parseSignedAtom()
|
|
@@ -5888,7 +5909,7 @@ var s$18 = class extends o$21 {
|
|
|
5888
5909
|
parseAtom() {
|
|
5889
5910
|
this.skipWs();
|
|
5890
5911
|
let n = this.peek();
|
|
5891
|
-
if (n === e$
|
|
5912
|
+
if (n === e$38.LParen) {
|
|
5892
5913
|
this.pos++, this.skipWs();
|
|
5893
5914
|
let t = this.pos, n = this.tryParseArrowParams();
|
|
5894
5915
|
if (n !== null) return this.maybeTrailingFilters({
|
|
@@ -5898,38 +5919,38 @@ var s$18 = class extends o$21 {
|
|
|
5898
5919
|
});
|
|
5899
5920
|
this.pos = t;
|
|
5900
5921
|
let r = this.parseTernary();
|
|
5901
|
-
return this.expectChar(e$
|
|
5922
|
+
return this.expectChar(e$38.RParen, "a closing \")\""), this.maybeTrailingFilters(this.parseAccessChain(r, null));
|
|
5902
5923
|
}
|
|
5903
|
-
if (n === e$
|
|
5924
|
+
if (n === e$38.SingleQuote || n === e$38.DoubleQuote) return this.maybeTrailingFilters({
|
|
5904
5925
|
type: "literal",
|
|
5905
5926
|
value: this.scanStringLiteral()
|
|
5906
5927
|
});
|
|
5907
|
-
if (i$
|
|
5928
|
+
if (i$25(n)) return this.maybeTrailingFilters({
|
|
5908
5929
|
type: "literal",
|
|
5909
5930
|
value: this.scanNumber()
|
|
5910
5931
|
});
|
|
5911
|
-
if (n === e$
|
|
5932
|
+
if (n === e$38.LBracket) {
|
|
5912
5933
|
this.pos++;
|
|
5913
5934
|
let t = {
|
|
5914
5935
|
type: "array",
|
|
5915
|
-
elements: this.parseArgList(e$
|
|
5936
|
+
elements: this.parseArgList(e$38.RBracket)
|
|
5916
5937
|
};
|
|
5917
5938
|
return this.maybeTrailingFilters(this.parseAccessChain(t, null));
|
|
5918
5939
|
}
|
|
5919
|
-
return n === e$
|
|
5940
|
+
return n === e$38.LBrace ? (this.pos++, this.maybeTrailingFilters(this.parseAccessChain(this.parseObjectLiteral(), null))) : this.parsePathOrFunctionOrArrow();
|
|
5920
5941
|
}
|
|
5921
5942
|
tryParseArrowParams() {
|
|
5922
5943
|
let t = this.pos, n = [];
|
|
5923
|
-
for (this.skipWs(); this.peek() !== e$
|
|
5944
|
+
for (this.skipWs(); this.peek() !== e$38.RParen;) {
|
|
5924
5945
|
let r = this.scanName();
|
|
5925
5946
|
if (!r) return this.pos = t, null;
|
|
5926
|
-
if (n.push(r), this.skipWs(), this.peek() === e$
|
|
5947
|
+
if (n.push(r), this.skipWs(), this.peek() === e$38.Comma) {
|
|
5927
5948
|
this.pos++, this.skipWs();
|
|
5928
5949
|
continue;
|
|
5929
5950
|
}
|
|
5930
5951
|
break;
|
|
5931
5952
|
}
|
|
5932
|
-
return this.skipWs(), this.peek() === e$
|
|
5953
|
+
return this.skipWs(), this.peek() === e$38.RParen && (this.pos++, this.skipWs(), this.peek() === e$38.Equals && this.at(1) === e$38.Greater) ? (this.pos += 2, n) : (this.pos = t, null);
|
|
5933
5954
|
}
|
|
5934
5955
|
parsePathOrFunctionOrArrow() {
|
|
5935
5956
|
let t = this.scanName();
|
|
@@ -5945,14 +5966,14 @@ var s$18 = class extends o$21 {
|
|
|
5945
5966
|
type: "literal",
|
|
5946
5967
|
value: null
|
|
5947
5968
|
});
|
|
5948
|
-
if (this.skipWs(), this.peek() === e$
|
|
5969
|
+
if (this.skipWs(), this.peek() === e$38.Equals && this.at(1) === e$38.Greater) return this.pos += 2, this.maybeTrailingFilters({
|
|
5949
5970
|
type: "arrow",
|
|
5950
5971
|
params: [t],
|
|
5951
5972
|
body: this.parseTernary()
|
|
5952
5973
|
});
|
|
5953
|
-
if (this.peek() === e$
|
|
5974
|
+
if (this.peek() === e$38.LParen) {
|
|
5954
5975
|
this.pos++;
|
|
5955
|
-
let n = this.parseArgList(e$
|
|
5976
|
+
let n = this.parseArgList(e$38.RParen);
|
|
5956
5977
|
return this.maybeTrailingFilters(this.parseAccessChain({
|
|
5957
5978
|
type: "function",
|
|
5958
5979
|
name: t,
|
|
@@ -5969,7 +5990,7 @@ var s$18 = class extends o$21 {
|
|
|
5969
5990
|
let r = t, i = n;
|
|
5970
5991
|
for (;;) {
|
|
5971
5992
|
let t = this.peek();
|
|
5972
|
-
if (t === e$
|
|
5993
|
+
if (t === e$38.Dot) {
|
|
5973
5994
|
let e = this.pos;
|
|
5974
5995
|
this.pos++;
|
|
5975
5996
|
let t = this.scanName() || this.scanIndex();
|
|
@@ -5987,10 +6008,10 @@ var s$18 = class extends o$21 {
|
|
|
5987
6008
|
};
|
|
5988
6009
|
continue;
|
|
5989
6010
|
}
|
|
5990
|
-
if (t !== e$
|
|
6011
|
+
if (t !== e$38.LBracket) break;
|
|
5991
6012
|
this.pos++;
|
|
5992
6013
|
let n = this.parseTernary();
|
|
5993
|
-
if (this.expectChar(e$
|
|
6014
|
+
if (this.expectChar(e$38.RBracket, "a closing \"]\""), i && n.type === "literal" && (typeof n.value == "string" || typeof n.value == "number")) {
|
|
5994
6015
|
i.push(String(n.value));
|
|
5995
6016
|
continue;
|
|
5996
6017
|
}
|
|
@@ -6009,7 +6030,7 @@ var s$18 = class extends o$21 {
|
|
|
6009
6030
|
} : r;
|
|
6010
6031
|
}
|
|
6011
6032
|
maybeTrailingFilters(t) {
|
|
6012
|
-
return this.skipWs(), this.peek() === e$
|
|
6033
|
+
return this.skipWs(), this.peek() === e$38.Pipe ? {
|
|
6013
6034
|
type: "filter",
|
|
6014
6035
|
subject: t,
|
|
6015
6036
|
filters: this.parseTrailingFilters()
|
|
@@ -6017,32 +6038,32 @@ var s$18 = class extends o$21 {
|
|
|
6017
6038
|
}
|
|
6018
6039
|
parseObjectLiteral() {
|
|
6019
6040
|
let t = [];
|
|
6020
|
-
for (this.skipWs(); !this.eof() && this.peek() !== e$
|
|
6041
|
+
for (this.skipWs(); !this.eof() && this.peek() !== e$38.RBrace;) {
|
|
6021
6042
|
let n = this.parseObjectKey();
|
|
6022
|
-
this.skipWs(), this.peek() === e$
|
|
6043
|
+
this.skipWs(), this.peek() === e$38.Colon && this.pos++, this.skipWs(), t.push({
|
|
6023
6044
|
key: n,
|
|
6024
6045
|
value: this.parseTernary()
|
|
6025
|
-
}), this.skipWs(), this.peek() === e$
|
|
6046
|
+
}), this.skipWs(), this.peek() === e$38.Comma && (this.pos++, this.skipWs());
|
|
6026
6047
|
}
|
|
6027
|
-
return this.expectChar(e$
|
|
6048
|
+
return this.expectChar(e$38.RBrace, "a closing \"}\""), {
|
|
6028
6049
|
type: "object",
|
|
6029
6050
|
entries: t
|
|
6030
6051
|
};
|
|
6031
6052
|
}
|
|
6032
6053
|
parseObjectKey() {
|
|
6033
6054
|
let n = this.peek();
|
|
6034
|
-
if (n === e$
|
|
6055
|
+
if (n === e$38.SingleQuote || n === e$38.DoubleQuote) return {
|
|
6035
6056
|
type: "literal",
|
|
6036
6057
|
value: this.scanStringLiteral()
|
|
6037
6058
|
};
|
|
6038
|
-
if (i$
|
|
6059
|
+
if (i$25(n)) return {
|
|
6039
6060
|
type: "literal",
|
|
6040
6061
|
value: this.scanNumber()
|
|
6041
6062
|
};
|
|
6042
|
-
if (n === e$
|
|
6063
|
+
if (n === e$38.LParen) {
|
|
6043
6064
|
this.pos++, this.skipWs();
|
|
6044
6065
|
let t = this.parseTernary();
|
|
6045
|
-
return this.skipWs(), this.peek() === e$
|
|
6066
|
+
return this.skipWs(), this.peek() === e$38.RParen && this.pos++, t;
|
|
6046
6067
|
}
|
|
6047
6068
|
return {
|
|
6048
6069
|
type: "literal",
|
|
@@ -6051,25 +6072,25 @@ var s$18 = class extends o$21 {
|
|
|
6051
6072
|
}
|
|
6052
6073
|
parseArgList(t) {
|
|
6053
6074
|
let n = [];
|
|
6054
|
-
for (this.skipWs(); !this.eof() && this.peek() !== t;) n.push(this.parseTernary()), this.skipWs(), this.peek() === e$
|
|
6055
|
-
return this.expectChar(t, t === e$
|
|
6075
|
+
for (this.skipWs(); !this.eof() && this.peek() !== t;) n.push(this.parseTernary()), this.skipWs(), this.peek() === e$38.Comma && (this.pos++, this.skipWs());
|
|
6076
|
+
return this.expectChar(t, t === e$38.RParen ? "a closing \")\"" : "a closing \"]\""), n;
|
|
6056
6077
|
}
|
|
6057
6078
|
parseTrailingFilters() {
|
|
6058
6079
|
let t = [];
|
|
6059
|
-
for (; this.peek() === e$
|
|
6080
|
+
for (; this.peek() === e$38.Pipe;) this.pos++, this.skipWs(), t.push(this.readFilter()), this.skipWs();
|
|
6060
6081
|
return t;
|
|
6061
6082
|
}
|
|
6062
6083
|
parseApplyChain() {
|
|
6063
6084
|
this.skipWs();
|
|
6064
6085
|
let t = [this.readFilter()];
|
|
6065
|
-
for (this.skipWs(); this.peek() === e$
|
|
6086
|
+
for (this.skipWs(); this.peek() === e$38.Pipe;) this.pos++, this.skipWs(), t.push(this.readFilter()), this.skipWs();
|
|
6066
6087
|
return t;
|
|
6067
6088
|
}
|
|
6068
6089
|
readFilter() {
|
|
6069
6090
|
let t = this.scanName();
|
|
6070
|
-
return t || this.report(`A "|" with no filter name after it in "${this.src.trim()}"`), this.skipWs(), this.peek() === e$
|
|
6091
|
+
return t || this.report(`A "|" with no filter name after it in "${this.src.trim()}"`), this.skipWs(), this.peek() === e$38.LParen ? (this.pos++, {
|
|
6071
6092
|
name: t,
|
|
6072
|
-
args: this.parseArgList(e$
|
|
6093
|
+
args: this.parseArgList(e$38.RParen)
|
|
6073
6094
|
}) : {
|
|
6074
6095
|
name: t,
|
|
6075
6096
|
args: []
|
|
@@ -6088,8 +6109,8 @@ var r$26 = (t) => {
|
|
|
6088
6109
|
for (let r = 0; r + 1 < t.length; r++) {
|
|
6089
6110
|
let i = t.charCodeAt(r);
|
|
6090
6111
|
if (n !== 0) i === n && (n = 0);
|
|
6091
|
-
else if (i === e$
|
|
6092
|
-
else if (i === e$
|
|
6112
|
+
else if (i === e$38.SingleQuote || i === e$38.DoubleQuote) n = i;
|
|
6113
|
+
else if (i === e$38.Dot && t.charCodeAt(r + 1) === e$38.Dot) return [t.slice(0, r).trim(), t.slice(r + 2).trim()];
|
|
6093
6114
|
}
|
|
6094
6115
|
return null;
|
|
6095
6116
|
};
|
|
@@ -6117,7 +6138,7 @@ var l$12 = /* @__PURE__ */ new Set([
|
|
|
6117
6138
|
"else",
|
|
6118
6139
|
"elseif"
|
|
6119
6140
|
]);
|
|
6120
|
-
var u$
|
|
6141
|
+
var u$13 = () => ({
|
|
6121
6142
|
type: "if",
|
|
6122
6143
|
condition: {
|
|
6123
6144
|
type: "literal",
|
|
@@ -6188,7 +6209,7 @@ var f$9 = class {
|
|
|
6188
6209
|
},
|
|
6189
6210
|
source: ""
|
|
6190
6211
|
};
|
|
6191
|
-
let r = t.content.trim(), i = this.keepEmptyTokens ? e$
|
|
6212
|
+
let r = t.content.trim(), i = this.keepEmptyTokens ? e$36(t.content, t.raw) : "";
|
|
6192
6213
|
if (o$22(r)) return {
|
|
6193
6214
|
type: "variable",
|
|
6194
6215
|
raw: t.raw,
|
|
@@ -6223,9 +6244,9 @@ var f$9 = class {
|
|
|
6223
6244
|
parseIf() {
|
|
6224
6245
|
this.advance();
|
|
6225
6246
|
let e = this.tokens[this.pos - 1];
|
|
6226
|
-
if (e.type !== "tag") return this.error = "Malformed {% if %} tag", u$
|
|
6247
|
+
if (e.type !== "tag") return this.error = "Malformed {% if %} tag", u$13();
|
|
6227
6248
|
let t = e.content.trim(), n = t.indexOf(" ") === -1 ? "" : t.slice(t.indexOf(" ") + 1).trim();
|
|
6228
|
-
if (!n) return this.error = "Malformed {% if %} tag: missing condition", u$
|
|
6249
|
+
if (!n) return this.error = "Malformed {% if %} tag: missing condition", u$13();
|
|
6229
6250
|
let r = r$27(n, this.issues), i = this.parseBody(), s = [], c = null, l = !1;
|
|
6230
6251
|
for (; this.peek();) {
|
|
6231
6252
|
let e = this.peek();
|
|
@@ -6323,7 +6344,7 @@ var f$9 = class {
|
|
|
6323
6344
|
filters: [],
|
|
6324
6345
|
body: []
|
|
6325
6346
|
};
|
|
6326
|
-
let t = e.content.trim(), r = i$
|
|
6347
|
+
let t = e.content.trim(), r = i$24(t.slice(t.indexOf(" ") + 1).trim(), this.issues), a = this.parseBody(), o = this.peek();
|
|
6327
6348
|
return o && o.type === "tag" && this.advance(), {
|
|
6328
6349
|
type: "apply",
|
|
6329
6350
|
filters: r,
|
|
@@ -6334,7 +6355,7 @@ var f$9 = class {
|
|
|
6334
6355
|
//#endregion
|
|
6335
6356
|
//#region ../sdk-shared/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs
|
|
6336
6357
|
var r$25 = /* @__PURE__ */ new Map();
|
|
6337
|
-
var i$
|
|
6358
|
+
var i$23 = 1024;
|
|
6338
6359
|
var a$18 = {
|
|
6339
6360
|
hits: 0,
|
|
6340
6361
|
misses: 0
|
|
@@ -6358,13 +6379,13 @@ var c$15 = (t) => {
|
|
|
6358
6379
|
};
|
|
6359
6380
|
};
|
|
6360
6381
|
var l$11 = () => {
|
|
6361
|
-
if (r$25.size >= i$
|
|
6382
|
+
if (r$25.size >= i$23) {
|
|
6362
6383
|
let e = r$25.keys().next().value;
|
|
6363
6384
|
e !== void 0 && r$25.delete(e);
|
|
6364
6385
|
}
|
|
6365
6386
|
};
|
|
6366
|
-
var u$
|
|
6367
|
-
let r = e$
|
|
6387
|
+
var u$12 = (e) => {
|
|
6388
|
+
let r = e$37(e);
|
|
6368
6389
|
if (r.error) return null;
|
|
6369
6390
|
let i = r.tokens, { hasTags: a, allSimpleOrDotted: o } = c$15(i), s = a || !o, l = null, u = null;
|
|
6370
6391
|
if (s) {
|
|
@@ -6389,7 +6410,7 @@ var d$10 = (e) => {
|
|
|
6389
6410
|
let t = r$25.get(e);
|
|
6390
6411
|
if (t) return a$18.hits++, t;
|
|
6391
6412
|
a$18.misses++;
|
|
6392
|
-
let n = u$
|
|
6413
|
+
let n = u$12(e);
|
|
6393
6414
|
return n ? (l$11(), r$25.set(e, n), n) : null;
|
|
6394
6415
|
};
|
|
6395
6416
|
//#endregion
|
|
@@ -6417,7 +6438,7 @@ var n$25 = (n) => {
|
|
|
6417
6438
|
var r$24 = (e) => [...new Set(n$25(e).map((e) => e.split(".")[0]))];
|
|
6418
6439
|
//#endregion
|
|
6419
6440
|
//#region ../sdk-shared/dist/style/styleConstants.mjs
|
|
6420
|
-
var e$
|
|
6441
|
+
var e$35 = {
|
|
6421
6442
|
platform: {
|
|
6422
6443
|
desktop: {},
|
|
6423
6444
|
tablet: {},
|
|
@@ -6677,7 +6698,7 @@ var r$22 = {
|
|
|
6677
6698
|
pageFolders: [],
|
|
6678
6699
|
components: {}
|
|
6679
6700
|
},
|
|
6680
|
-
style: e$
|
|
6701
|
+
style: e$35,
|
|
6681
6702
|
definition: { rootId: "" }
|
|
6682
6703
|
};
|
|
6683
6704
|
//#endregion
|
|
@@ -6698,7 +6719,7 @@ var r$22 = {
|
|
|
6698
6719
|
*
|
|
6699
6720
|
* `computed` holds the space's own computed values (`SpaceSpec.computed`), by name.
|
|
6700
6721
|
*/
|
|
6701
|
-
var GLOBAL_SOURCES = e$
|
|
6722
|
+
var GLOBAL_SOURCES = e$39;
|
|
6702
6723
|
/** What an element inside a component can read besides its own tree: the globals, and what its instance hands in. */
|
|
6703
6724
|
var COMPONENT_SOURCES = [...GLOBAL_SOURCES, n$23];
|
|
6704
6725
|
/**
|
|
@@ -7327,14 +7348,14 @@ var themeToggle = defineElement(B.ThemeToggle);
|
|
|
7327
7348
|
var video = defineElement(B.Video);
|
|
7328
7349
|
//#endregion
|
|
7329
7350
|
//#region ../sdk-schema/dist/helpers/elementId.mjs
|
|
7330
|
-
var e$
|
|
7331
|
-
var t$28 = (t) => e$
|
|
7351
|
+
var e$34 = /^[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/;
|
|
7352
|
+
var t$28 = (t) => e$34.test(t);
|
|
7332
7353
|
var r$21 = (e) => new Set(Object.keys(e));
|
|
7333
|
-
var i$
|
|
7354
|
+
var i$21 = (e, n, r) => t$28(n) ? e[n] && n !== r ? `"${n}" is already used by another element here` : null : `"${n}" is not a valid name: start with a letter, then letters, numbers, hyphens and underscores`;
|
|
7334
7355
|
var a$17 = (e, t) => {
|
|
7335
7356
|
let n = /* @__PURE__ */ new Set();
|
|
7336
7357
|
for (let r of t) {
|
|
7337
|
-
if (n.has(r.id) || i$
|
|
7358
|
+
if (n.has(r.id) || i$21(e, r.id)) return !1;
|
|
7338
7359
|
n.add(r.id);
|
|
7339
7360
|
}
|
|
7340
7361
|
return !0;
|
|
@@ -7355,7 +7376,7 @@ var l$10 = (e, t) => {
|
|
|
7355
7376
|
for (; t(`${n}-${r}`);) r += 1;
|
|
7356
7377
|
return `${n}-${r}`;
|
|
7357
7378
|
};
|
|
7358
|
-
var u$
|
|
7379
|
+
var u$11 = (e, t) => {
|
|
7359
7380
|
if (!t(e)) return e;
|
|
7360
7381
|
let n = /^(.*[A-Za-z0-9])-(\d+)$/.exec(e), r = n ? n[1] : e, i = n ? Number(n[2]) + 1 : 2;
|
|
7361
7382
|
for (; t(`${r}-${i}`);) i += 1;
|
|
@@ -7447,7 +7468,7 @@ var _$3 = (e, t, n) => {
|
|
|
7447
7468
|
};
|
|
7448
7469
|
//#endregion
|
|
7449
7470
|
//#region ../sdk-shared/dist/helpers/isRecord.mjs
|
|
7450
|
-
var e$
|
|
7471
|
+
var e$33 = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
7451
7472
|
//#endregion
|
|
7452
7473
|
//#region src/schema/guard.ts
|
|
7453
7474
|
/**
|
|
@@ -7498,6 +7519,7 @@ var PAGE_SPEC_KEYS = [
|
|
|
7498
7519
|
"isDefault",
|
|
7499
7520
|
"seoTitle",
|
|
7500
7521
|
"seoDescription",
|
|
7522
|
+
"notFound",
|
|
7501
7523
|
"accessLevel",
|
|
7502
7524
|
"unauthorizedRedirect",
|
|
7503
7525
|
"folder",
|
|
@@ -7610,7 +7632,7 @@ var STEP_TYPES = [
|
|
|
7610
7632
|
* written, when it depends on which one: a hint about one field is noise about every other.
|
|
7611
7633
|
*/
|
|
7612
7634
|
function assertKnownKeys(value, keys, where, hint = "") {
|
|
7613
|
-
if (!e$
|
|
7635
|
+
if (!e$33(value)) throw new AuthoringError("element-shape", `${where} is ${value === null ? "null" : typeof value}, not an object.`);
|
|
7614
7636
|
for (const key of Object.keys(value)) if (!keys.includes(key)) throw new AuthoringError("unknown-field", `${where} has "${key}", which it does not take${didYouMean(key, keys) || "."} It takes ${keys.join(", ")}.${typeof hint === "string" ? hint : hint(key)}`);
|
|
7615
7637
|
}
|
|
7616
7638
|
/** Refuses an id nothing can name: empty, or with characters a template or a selector cannot carry. */
|
|
@@ -7652,16 +7674,16 @@ var paramIssue = (params, spec, where) => {
|
|
|
7652
7674
|
};
|
|
7653
7675
|
//#endregion
|
|
7654
7676
|
//#region ../sdk-schema/dist/helpers/elementTree.mjs
|
|
7655
|
-
var e$
|
|
7677
|
+
var e$32 = (e, t) => t && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
7656
7678
|
var t$27 = (t, n) => {
|
|
7657
7679
|
let r = [], i = /* @__PURE__ */ new Set([n]);
|
|
7658
|
-
for (let a = e$
|
|
7680
|
+
for (let a = e$32(t, e$32(t, n)?.definition.parentId); a && !i.has(a.id);) i.add(a.id), r.push(a.id), a = e$32(t, a.definition.parentId);
|
|
7659
7681
|
return r;
|
|
7660
7682
|
};
|
|
7661
7683
|
var n$22 = (n, r) => {
|
|
7662
7684
|
let i = [], a = /* @__PURE__ */ new Set([r]), o = (s) => {
|
|
7663
7685
|
for (let c of [s, ...t$27(n, s)]) {
|
|
7664
|
-
let t = e$
|
|
7686
|
+
let t = e$32(n, c);
|
|
7665
7687
|
if (c !== s || s !== r) {
|
|
7666
7688
|
if (a.has(c)) continue;
|
|
7667
7689
|
a.add(c), i.push(c);
|
|
@@ -7674,29 +7696,29 @@ var n$22 = (n, r) => {
|
|
|
7674
7696
|
};
|
|
7675
7697
|
var r$20 = (t, n) => {
|
|
7676
7698
|
let r = [], i = /* @__PURE__ */ new Set([n]), a = (n) => {
|
|
7677
|
-
for (let o of e$
|
|
7699
|
+
for (let o of e$32(t, n)?.definition.items ?? []) !i.has(o) && e$32(t, o) && (i.add(o), r.push(o), a(o));
|
|
7678
7700
|
};
|
|
7679
7701
|
return a(n), r;
|
|
7680
7702
|
};
|
|
7681
7703
|
//#endregion
|
|
7682
7704
|
//#region ../sdk-shared/dist/style/breakpoints.mjs
|
|
7683
|
-
var e$
|
|
7705
|
+
var e$31 = {
|
|
7684
7706
|
desktop: 1024,
|
|
7685
7707
|
tablet: 768,
|
|
7686
7708
|
mobile: 0
|
|
7687
7709
|
};
|
|
7688
|
-
var t$26 = (t) => e$
|
|
7710
|
+
var t$26 = (t) => e$31[t] === 0 ? "0" : `${String(e$31[t] / 16)}rem`;
|
|
7689
7711
|
//#endregion
|
|
7690
7712
|
//#region ../sdk-shared/dist/style/displayModes.mjs
|
|
7691
|
-
var e$
|
|
7713
|
+
var e$30 = [
|
|
7692
7714
|
"desktop",
|
|
7693
7715
|
"tablet",
|
|
7694
7716
|
"mobile"
|
|
7695
7717
|
];
|
|
7696
|
-
var t$25 = (t) => e$
|
|
7718
|
+
var t$25 = (t) => e$30.some((e) => e === t);
|
|
7697
7719
|
//#endregion
|
|
7698
7720
|
//#region ../sdk-shared/dist/style/fonts.mjs
|
|
7699
|
-
var i$
|
|
7721
|
+
var i$20 = (e) => {
|
|
7700
7722
|
try {
|
|
7701
7723
|
let t = new URL(e);
|
|
7702
7724
|
return t.protocol === "https:" && !t.username && !t.password;
|
|
@@ -7719,7 +7741,7 @@ var r$19 = /* @__PURE__ */ new Set([
|
|
|
7719
7741
|
"fallback",
|
|
7720
7742
|
"optional"
|
|
7721
7743
|
]);
|
|
7722
|
-
var i$
|
|
7744
|
+
var i$19 = /* @__PURE__ */ new Set(["woff2", "woff"]);
|
|
7723
7745
|
var a$16 = 100;
|
|
7724
7746
|
var o$18 = (e) => {
|
|
7725
7747
|
for (let t = 0; t < e.length; t += 1) {
|
|
@@ -7737,7 +7759,7 @@ var l$9 = (e) => {
|
|
|
7737
7759
|
let t = e.trim();
|
|
7738
7760
|
return t ? t.length > a$16 ? c$13(`font.family cannot be longer than ${a$16} characters`) : o$18(t) ? c$13("font.family cannot contain control characters") : t : c$13("font.family cannot be empty");
|
|
7739
7761
|
};
|
|
7740
|
-
var u$
|
|
7762
|
+
var u$10 = (e) => {
|
|
7741
7763
|
if (e === void 0) return [400];
|
|
7742
7764
|
if (!Array.isArray(e) || e.length === 0) return c$13("font.weights must be a non-empty list of numbers");
|
|
7743
7765
|
let t = e.map((e) => typeof e != "number" || !Number.isInteger(e) || e < 1 || e > 1e3 ? c$13("font.weights must hold whole numbers between 1 and 1000") : e);
|
|
@@ -7750,11 +7772,11 @@ var d$8 = (e) => {
|
|
|
7750
7772
|
return [...new Set(t)];
|
|
7751
7773
|
};
|
|
7752
7774
|
var f$7 = (t, n) => {
|
|
7753
|
-
if (!e$
|
|
7775
|
+
if (!e$33(t)) return c$13(`font.files[${n}] must be an object`);
|
|
7754
7776
|
let { weight: r, style: a, format: o, unicodeRange: s } = t;
|
|
7755
7777
|
if (typeof r != "number" || !Number.isInteger(r) || r < 1 || r > 1e3) return c$13(`font.files[${n}].weight must be a whole number between 1 and 1000`);
|
|
7756
7778
|
if (a !== "normal" && a !== "italic") return c$13(`font.files[${n}].style must be "normal" or "italic"`);
|
|
7757
|
-
if (typeof o != "string" || !i$
|
|
7779
|
+
if (typeof o != "string" || !i$19.has(o)) return c$13(`font.files[${n}].format must be "woff2" or "woff"`);
|
|
7758
7780
|
let l = {
|
|
7759
7781
|
weight: r,
|
|
7760
7782
|
style: a,
|
|
@@ -7769,7 +7791,7 @@ var f$7 = (t, n) => {
|
|
|
7769
7791
|
var p$9 = (e, t) => typeof e != "string" || !e ? c$13(`font.files[${t}].path must be a non-empty string`) : e.includes("://") || e.startsWith("/") ? c$13(`font.files[${t}].path must be relative to the font store, not a URL`) : e.split("/").includes("..") ? c$13(`font.files[${t}].path cannot climb out of the font store`) : e;
|
|
7770
7792
|
var m$5 = (e) => !Array.isArray(e) || e.length === 0 ? c$13("font.files must be a non-empty list") : e;
|
|
7771
7793
|
var h$2 = (i) => {
|
|
7772
|
-
if (!e$
|
|
7794
|
+
if (!e$33(i)) return c$13("a font must be an object");
|
|
7773
7795
|
let { source: a, fallback: o, display: s, preload: h } = i;
|
|
7774
7796
|
if (typeof a != "string" || !n$21.has(a)) return c$13("font.source must be one of: system, google, remote, hosted");
|
|
7775
7797
|
if (typeof o != "string" || !o.trim()) return c$13("font.fallback is required: it is what renders until the face arrives");
|
|
@@ -7778,7 +7800,7 @@ var h$2 = (i) => {
|
|
|
7778
7800
|
let g = {
|
|
7779
7801
|
family: l$9(i.family),
|
|
7780
7802
|
fallback: o.trim(),
|
|
7781
|
-
weights: u$
|
|
7803
|
+
weights: u$10(i.weights),
|
|
7782
7804
|
styles: d$8(i.styles),
|
|
7783
7805
|
...s === void 0 ? {} : { display: s },
|
|
7784
7806
|
...h === void 0 ? {} : { preload: h }
|
|
@@ -7802,12 +7824,12 @@ var h$2 = (i) => {
|
|
|
7802
7824
|
source: "remote",
|
|
7803
7825
|
files: m$5(n).map((e, n) => {
|
|
7804
7826
|
let r = f$7(e, n), { url: i } = e;
|
|
7805
|
-
return typeof i != "string" || !i$
|
|
7827
|
+
return typeof i != "string" || !i$20(i) ? c$13(`font.files[${n}].url must be an https URL with no credentials in it`) : {
|
|
7806
7828
|
...r,
|
|
7807
7829
|
url: i
|
|
7808
7830
|
};
|
|
7809
7831
|
})
|
|
7810
|
-
} : typeof e != "string" || !i$
|
|
7832
|
+
} : typeof e != "string" || !i$20(e) ? c$13("font.stylesheet must be an https URL with no credentials in it") : {
|
|
7811
7833
|
...g,
|
|
7812
7834
|
source: "remote",
|
|
7813
7835
|
stylesheet: e
|
|
@@ -7824,21 +7846,21 @@ var h$2 = (i) => {
|
|
|
7824
7846
|
};
|
|
7825
7847
|
//#endregion
|
|
7826
7848
|
//#region ../sdk-shared/dist/types/StyleTypes.mjs
|
|
7827
|
-
var e$
|
|
7849
|
+
var e$29 = /* @__PURE__ */ function(e) {
|
|
7828
7850
|
return e.COLOR = "color", e.SPACING = "spacing", e.SHADOW = "shadow", e.CUSTOM = "custom", e;
|
|
7829
7851
|
}({});
|
|
7830
|
-
var t$24 = Object.values(e$
|
|
7852
|
+
var t$24 = Object.values(e$29);
|
|
7831
7853
|
var n$20 = (e) => typeof e == "string" && t$24.includes(e);
|
|
7832
7854
|
//#endregion
|
|
7833
7855
|
//#region ../sdk-shared/dist/style/styleConditions.mjs
|
|
7834
|
-
var e$
|
|
7856
|
+
var e$28 = {
|
|
7835
7857
|
"motion-reduce": "@media (prefers-reduced-motion: reduce)",
|
|
7836
7858
|
"motion-safe": "@media (prefers-reduced-motion: no-preference)"
|
|
7837
7859
|
};
|
|
7838
|
-
var t$23 = Object.keys(e$
|
|
7839
|
-
var r$18 = (t) => Object.hasOwn(e$
|
|
7840
|
-
var i$
|
|
7841
|
-
var a$15 = String.raw`\((?:min|max)-width:\s*${i$
|
|
7860
|
+
var t$23 = Object.keys(e$28);
|
|
7861
|
+
var r$18 = (t) => Object.hasOwn(e$28, t);
|
|
7862
|
+
var i$18 = String.raw`\d+(?:\.\d+)?(?:px|rem|em|ch)`;
|
|
7863
|
+
var a$15 = String.raw`\((?:min|max)-width:\s*${i$18}\)`;
|
|
7842
7864
|
var o$17 = new RegExp(String.raw`^container(?:\s+(?<name>-?[_a-zA-Z][\w-]*))?\s+(?<query>${a$15}(?:\s+and\s+${a$15})?)$`);
|
|
7843
7865
|
var s$15 = (e) => {
|
|
7844
7866
|
let t = o$17.exec(e.trim());
|
|
@@ -7852,20 +7874,20 @@ var c$12 = (e) => {
|
|
|
7852
7874
|
let t = s$15(e);
|
|
7853
7875
|
if (t) return t.name ? `container ${t.name} ${t.query}` : `container ${t.query}`;
|
|
7854
7876
|
};
|
|
7855
|
-
var u$
|
|
7856
|
-
if (r$18(t)) return e$
|
|
7877
|
+
var u$9 = (t) => {
|
|
7878
|
+
if (r$18(t)) return e$28[t];
|
|
7857
7879
|
let n = s$15(t);
|
|
7858
7880
|
if (n) return n.name ? `@container ${n.name} ${n.query}` : `@container ${n.query}`;
|
|
7859
7881
|
};
|
|
7860
7882
|
var f$6 = (t) => {
|
|
7861
7883
|
let n = t.trim().replace(/\s+/g, " ").replace(/\(\s*/g, "(").replace(/\s*\)/g, ")").replace(/:\s*/g, ": ");
|
|
7862
|
-
for (let [t, r] of Object.entries(e$
|
|
7884
|
+
for (let [t, r] of Object.entries(e$28)) if (n === r) return t;
|
|
7863
7885
|
let r = /^@container\s+(.*)$/.exec(n);
|
|
7864
7886
|
if (r) return c$12(`container ${r[1]}`);
|
|
7865
7887
|
};
|
|
7866
7888
|
//#endregion
|
|
7867
7889
|
//#region ../sdk-shared/dist/style/stylePseudos.mjs
|
|
7868
|
-
var e$
|
|
7890
|
+
var e$27 = [
|
|
7869
7891
|
"before",
|
|
7870
7892
|
"after",
|
|
7871
7893
|
"marker",
|
|
@@ -7885,7 +7907,7 @@ var t$22 = {
|
|
|
7885
7907
|
};
|
|
7886
7908
|
var n$19 = (e) => Object.hasOwn(t$22, e);
|
|
7887
7909
|
var r$17 = (e) => `::${e}`;
|
|
7888
|
-
var i$
|
|
7910
|
+
var i$17 = [
|
|
7889
7911
|
"before",
|
|
7890
7912
|
"after",
|
|
7891
7913
|
"marker"
|
|
@@ -7946,7 +7968,7 @@ var l$8 = {
|
|
|
7946
7968
|
...c$11
|
|
7947
7969
|
]
|
|
7948
7970
|
};
|
|
7949
|
-
var u$
|
|
7971
|
+
var u$8 = (e, t) => {
|
|
7950
7972
|
let n = l$8[e];
|
|
7951
7973
|
return !n || t.startsWith("--") || n.includes(t);
|
|
7952
7974
|
};
|
|
@@ -7987,7 +8009,7 @@ var m$4 = (e) => {
|
|
|
7987
8009
|
};
|
|
7988
8010
|
//#endregion
|
|
7989
8011
|
//#region ../sdk-shared/dist/style/styleStates.mjs
|
|
7990
|
-
var e$
|
|
8012
|
+
var e$26 = [
|
|
7991
8013
|
"hover",
|
|
7992
8014
|
"focus",
|
|
7993
8015
|
"focus-visible",
|
|
@@ -8022,8 +8044,8 @@ var r$16 = {
|
|
|
8022
8044
|
disabled: 13,
|
|
8023
8045
|
hidden: 14
|
|
8024
8046
|
};
|
|
8025
|
-
var i$
|
|
8026
|
-
var a$13 = (t) => i$
|
|
8047
|
+
var i$16 = (e) => Object.hasOwn(r$16, e);
|
|
8048
|
+
var a$13 = (t) => i$16(t) ? r$16[t] : e$26.length;
|
|
8027
8049
|
var o$15 = (e) => Object.entries(e).sort(([e], [t]) => a$13(e) - a$13(t));
|
|
8028
8050
|
var l$7 = {
|
|
8029
8051
|
current: ":is([aria-current]:not([aria-current=\"false\"]),[aria-pressed=\"true\"],[aria-selected=\"true\"],[role=\"tabpanel\"]:not([hidden]))",
|
|
@@ -8034,12 +8056,12 @@ var l$7 = {
|
|
|
8034
8056
|
odd: ":nth-child(odd)",
|
|
8035
8057
|
even: ":nth-child(even)"
|
|
8036
8058
|
};
|
|
8037
|
-
var u$
|
|
8059
|
+
var u$7 = (e) => (i$16(e) ? l$7[e] : void 0) ?? `:${e}`;
|
|
8038
8060
|
var d$6 = (e) => e === "hidden";
|
|
8039
8061
|
var p$7 = (e) => e === ">";
|
|
8040
8062
|
//#endregion
|
|
8041
8063
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/shared.js
|
|
8042
|
-
function e$
|
|
8064
|
+
function e$25(e) {
|
|
8043
8065
|
if (typeof e == "string" || typeof e == "number") {
|
|
8044
8066
|
let t = String(e);
|
|
8045
8067
|
return t === "" ? null : /^[a-zA-Z0-9_-]+$/.test(t) || /^\d+$/.test(t) ? t : null;
|
|
@@ -8051,11 +8073,11 @@ function t$20(t, n) {
|
|
|
8051
8073
|
let r = [], i = /([^.[\]]+)|\[(\d+)\]/g, a;
|
|
8052
8074
|
for (; a = i.exec(t);) if (a[1]) {
|
|
8053
8075
|
if (!n && a[1] === "") continue;
|
|
8054
|
-
let t = e$
|
|
8076
|
+
let t = e$25(a[1]);
|
|
8055
8077
|
if (t !== null) r.push(t);
|
|
8056
8078
|
else if (n) return [];
|
|
8057
8079
|
} else if (a[2]) {
|
|
8058
|
-
let t = e$
|
|
8080
|
+
let t = e$25(a[2]);
|
|
8059
8081
|
if (t !== null) r.push(t);
|
|
8060
8082
|
else if (n) return [];
|
|
8061
8083
|
}
|
|
@@ -8065,7 +8087,7 @@ function n$18(t, n) {
|
|
|
8065
8087
|
if (!Array.isArray(t)) return [];
|
|
8066
8088
|
let r = [];
|
|
8067
8089
|
for (let i of t) {
|
|
8068
|
-
let t = e$
|
|
8090
|
+
let t = e$25(i);
|
|
8069
8091
|
if (t !== null) r.push(t);
|
|
8070
8092
|
else if (n) return [];
|
|
8071
8093
|
}
|
|
@@ -8130,7 +8152,7 @@ var r$14 = (e, t) => {
|
|
|
8130
8152
|
}
|
|
8131
8153
|
return n;
|
|
8132
8154
|
};
|
|
8133
|
-
var i$
|
|
8155
|
+
var i$15 = (e, t, n, r, i) => {
|
|
8134
8156
|
let a = [], o = /* @__PURE__ */ new Set(), { definition: { styleSelectors: s, type: c }, attributes: { subType: l } } = e, u = (s[r] || "").split(" ").filter(Boolean);
|
|
8135
8157
|
for (let e of [...u, ...i]) {
|
|
8136
8158
|
if (o.has(e)) continue;
|
|
@@ -8231,7 +8253,7 @@ var c$9 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
8231
8253
|
continue;
|
|
8232
8254
|
}
|
|
8233
8255
|
if (!t && o) {
|
|
8234
|
-
let t = i$
|
|
8256
|
+
let t = i$15({
|
|
8235
8257
|
definition: {
|
|
8236
8258
|
type: o,
|
|
8237
8259
|
styleSelectors: {},
|
|
@@ -8254,7 +8276,7 @@ var c$9 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
8254
8276
|
continue;
|
|
8255
8277
|
}
|
|
8256
8278
|
for (let r of w) {
|
|
8257
|
-
let s = t?.definition.parentId === r.id, c = r.id !== t?.id, l = i$
|
|
8279
|
+
let s = t?.definition.parentId === r.id, c = r.id !== t?.id, l = i$15(r, r.definition.type === o ? o : void 0, n, p, x);
|
|
8258
8280
|
!y && !c && !m && !h && Object.keys(l).length && (l = l.filter((e) => e.type === "element"));
|
|
8259
8281
|
for (let t of l) (!b.includes(t.name) || c) && C.tree.push({
|
|
8260
8282
|
name: t.name,
|
|
@@ -8340,7 +8362,7 @@ var d$5 = class {
|
|
|
8340
8362
|
});
|
|
8341
8363
|
};
|
|
8342
8364
|
updateElement = (e) => !e || !this.flat[e.id] ? !1 : (this.flat[e.id] = e, !0);
|
|
8343
|
-
renameElement = (t, n) => this.flat[t] ? t === n ? [] : i$
|
|
8365
|
+
renameElement = (t, n) => this.flat[t] ? t === n ? [] : i$21(this.flat, n) || this.takenElsewhere(n) ? !1 : _$3(this.flat, { [t]: n }, this.pages) : !1;
|
|
8344
8366
|
moveElement = (e, t, n, r = "inside") => {
|
|
8345
8367
|
let i = this.flat[e], a = this.flat[n];
|
|
8346
8368
|
if (!i || !a || n === t || t$27(this.flat, t).includes(n)) return !1;
|
|
@@ -8358,7 +8380,7 @@ var d$5 = class {
|
|
|
8358
8380
|
if (!u) return c;
|
|
8359
8381
|
let d = [e, ...r$20(this.flat, e)], f = r$21(this.flat);
|
|
8360
8382
|
for (let e of d) {
|
|
8361
|
-
let t = u$
|
|
8383
|
+
let t = u$11(e, (e) => f.has(e) || this.takenElsewhere(e));
|
|
8362
8384
|
f.add(t), l[e] = t;
|
|
8363
8385
|
}
|
|
8364
8386
|
let p = {};
|
|
@@ -8405,7 +8427,7 @@ var d$5 = class {
|
|
|
8405
8427
|
};
|
|
8406
8428
|
flatAsSnippet = (e, t, n = !1) => {
|
|
8407
8429
|
let r = {
|
|
8408
|
-
...e$
|
|
8430
|
+
...e$35,
|
|
8409
8431
|
platform: {
|
|
8410
8432
|
desktop: {},
|
|
8411
8433
|
tablet: {},
|
|
@@ -8506,8 +8528,8 @@ var p$6 = (e, t) => Object.hasOwn(e.components, t) ? e.components[t] : void 0;
|
|
|
8506
8528
|
var m$3 = (e, t) => e.definition.type === "reference" && e.attributes.referenceType === "component" && (t === void 0 || e.attributes.referenceId === t);
|
|
8507
8529
|
//#endregion
|
|
8508
8530
|
//#region ../sdk-shared/dist/navigation/routes.mjs
|
|
8509
|
-
var i$
|
|
8510
|
-
var a$11 = (e) => i$
|
|
8531
|
+
var i$14 = (e) => e.replaceAll(/\/+/g, "/");
|
|
8532
|
+
var a$11 = (e) => i$14(e.replace(/{{([a-zA-Z0-9-_:*/]+)}}/gi, ":$1"));
|
|
8511
8533
|
var o$12 = (e, t) => {
|
|
8512
8534
|
if (!t || !e[t]) return "";
|
|
8513
8535
|
let { slug: n, parentId: r } = e[t];
|
|
@@ -8528,8 +8550,8 @@ function s$10(e, t, n, r = !1) {
|
|
|
8528
8550
|
[a$11(`/${c}`)]: n,
|
|
8529
8551
|
[a$11(`/${n}`)]: n
|
|
8530
8552
|
};
|
|
8531
|
-
if (!l && r) return i$
|
|
8532
|
-
if (!t.find((e) => e.id === l)) return r ? i$
|
|
8553
|
+
if (!l && r) return i$14(`/${c}`);
|
|
8554
|
+
if (!t.find((e) => e.id === l)) return r ? i$14(`/${c}`) : {
|
|
8533
8555
|
[a$11(`/${c}`)]: n,
|
|
8534
8556
|
[a$11(`/${n}`)]: n
|
|
8535
8557
|
};
|
|
@@ -8537,7 +8559,7 @@ function s$10(e, t, n, r = !1) {
|
|
|
8537
8559
|
...e,
|
|
8538
8560
|
[t.id]: t
|
|
8539
8561
|
}), {}), l), c].filter(Boolean).join("/");
|
|
8540
|
-
return r ? i$
|
|
8562
|
+
return r ? i$14(`/${d}`) : {
|
|
8541
8563
|
[a$11(`/${d}`)]: n,
|
|
8542
8564
|
[a$11(`/${n}`)]: n
|
|
8543
8565
|
};
|
|
@@ -8738,14 +8760,14 @@ var withPluginCatalogs = (options) => {
|
|
|
8738
8760
|
const byType = (own, hosted = own) => Object.fromEntries(plugins.flatMap((declaration) => {
|
|
8739
8761
|
return [[declaration.type, own(declaration)], [hostedKey(declaration), hosted(declaration)]].filter((entry) => entry[1] !== void 0);
|
|
8740
8762
|
}));
|
|
8741
|
-
const customTriggers = rest.vocabulary?.triggers?.["custom"] ?? Object.keys(e$
|
|
8763
|
+
const customTriggers = rest.vocabulary?.triggers?.["custom"] ?? Object.keys(e$41);
|
|
8742
8764
|
const customCallbacks = rest.vocabulary?.callbacks?.["custom"] ?? Object.keys(a$22);
|
|
8743
8765
|
const customAttributes = Object.keys(rest.defaultAttributes?.["custom"] ?? {});
|
|
8744
8766
|
const vocabulary = rest.vocabulary && {
|
|
8745
8767
|
...rest.vocabulary,
|
|
8746
8768
|
triggers: {
|
|
8747
8769
|
...rest.vocabulary.triggers,
|
|
8748
|
-
...byType((declaration) => [...Object.keys(e$
|
|
8770
|
+
...byType((declaration) => [...Object.keys(e$41), ...actionsOf(declaration.triggers)], (declaration) => [...customTriggers, ...actionsOf(declaration.triggers)])
|
|
8749
8771
|
},
|
|
8750
8772
|
callbacks: {
|
|
8751
8773
|
...rest.vocabulary.callbacks,
|
|
@@ -8820,7 +8842,7 @@ var r$13 = {
|
|
|
8820
8842
|
del: "delete",
|
|
8821
8843
|
return: "enter"
|
|
8822
8844
|
};
|
|
8823
|
-
var i$
|
|
8845
|
+
var i$13 = /* @__PURE__ */ new Set([
|
|
8824
8846
|
"escape",
|
|
8825
8847
|
"enter",
|
|
8826
8848
|
"tab",
|
|
@@ -8853,7 +8875,7 @@ var o$11 = (e, t) => {
|
|
|
8853
8875
|
}
|
|
8854
8876
|
if (u.length !== 1) return { problem: `"${e.trim()}" names ${u.length ? `${u.length} keys (${u.join(", ")})` : "no key, only modifiers"}: a shortcut is modifiers and ONE key, like "shift+f"` };
|
|
8855
8877
|
let [d] = u;
|
|
8856
|
-
return d.length !== 1 && !i$
|
|
8878
|
+
return d.length !== 1 && !i$13.has(d) ? { problem: `"${d}" in "${e.trim()}" is not a key: use one character ("f", "?", "+") or a key's name (${[...i$13].slice(0, 15).join(", ")}, f1…f12)` } : { combo: a$10(l, d) };
|
|
8857
8879
|
};
|
|
8858
8880
|
var s$9 = (e, t = !1) => {
|
|
8859
8881
|
let n = e.split(",").map((e) => o$11(e, t));
|
|
@@ -8908,7 +8930,7 @@ var steps_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
8908
8930
|
* the builders useless for exactly the flows that matter most.
|
|
8909
8931
|
*/
|
|
8910
8932
|
var builtinTrigger = (trigger) => {
|
|
8911
|
-
if (Object.hasOwn(e$
|
|
8933
|
+
if (Object.hasOwn(e$41, trigger)) return e$41[trigger];
|
|
8912
8934
|
return Object.hasOwn(typeTriggerDefinitions, trigger) ? typeTriggerDefinitions[trigger] : void 0;
|
|
8913
8935
|
};
|
|
8914
8936
|
var on = (trigger, params = {}) => {
|
|
@@ -9221,7 +9243,7 @@ var carouselPlay = (target) => carouselStep(target, "play", "Play");
|
|
|
9221
9243
|
var carouselPause = (target) => carouselStep(target, "pause", "Pause");
|
|
9222
9244
|
//#endregion
|
|
9223
9245
|
//#region ../sdk-interactions/dist/sources/QueriesSource/writeParams.mjs
|
|
9224
|
-
var e$
|
|
9246
|
+
var e$22 = {
|
|
9225
9247
|
origin: "Requests to the same site",
|
|
9226
9248
|
all: "All cached requests",
|
|
9227
9249
|
elements: "Only these containers",
|
|
@@ -9233,7 +9255,7 @@ var t$16 = (t, n = () => !0) => ({
|
|
|
9233
9255
|
description: "What to refresh once the write succeeded, so the page shows the new data: the requests to the same site, every provider on the page, only the api containers named in `invalidateElements`, or none for a step that only reads. Server-driven containers are refreshed too, asking the server past its cache. Containers on screen ask again at once; the rest when they are shown.",
|
|
9234
9256
|
default: t[0],
|
|
9235
9257
|
options: [...t],
|
|
9236
|
-
optionLabels: Object.fromEntries(t.map((t) => [t, e$
|
|
9258
|
+
optionLabels: Object.fromEntries(t.map((t) => [t, e$22[t]])),
|
|
9237
9259
|
label: "Refresh cached requests",
|
|
9238
9260
|
canBind: !1,
|
|
9239
9261
|
when: n
|
|
@@ -9317,7 +9339,7 @@ var t$15 = {
|
|
|
9317
9339
|
};
|
|
9318
9340
|
//#endregion
|
|
9319
9341
|
//#region ../sdk-interactions/dist/sources/AuthSource/callbacks.mjs
|
|
9320
|
-
var e$
|
|
9342
|
+
var e$21 = {
|
|
9321
9343
|
login: {
|
|
9322
9344
|
source: "auth",
|
|
9323
9345
|
title: "Auth Login",
|
|
@@ -9405,7 +9427,7 @@ var e$20 = {
|
|
|
9405
9427
|
};
|
|
9406
9428
|
//#endregion
|
|
9407
9429
|
//#region ../sdk-interactions/dist/sources/HostSource/callbacks.mjs
|
|
9408
|
-
var e$
|
|
9430
|
+
var e$20 = { hostAction: {
|
|
9409
9431
|
source: "host",
|
|
9410
9432
|
title: "Host Action",
|
|
9411
9433
|
strictParams: !0,
|
|
@@ -9424,7 +9446,7 @@ var e$19 = { hostAction: {
|
|
|
9424
9446
|
} };
|
|
9425
9447
|
//#endregion
|
|
9426
9448
|
//#region ../sdk-interactions/dist/sources/NavigationSource/callbacks.mjs
|
|
9427
|
-
var e$
|
|
9449
|
+
var e$19 = { navigate: {
|
|
9428
9450
|
source: "navigation",
|
|
9429
9451
|
title: "Navigate",
|
|
9430
9452
|
strictParams: !0,
|
|
@@ -9453,7 +9475,7 @@ var e$18 = { navigate: {
|
|
|
9453
9475
|
} };
|
|
9454
9476
|
//#endregion
|
|
9455
9477
|
//#region ../sdk-interactions/dist/sources/QueriesSource/callbacks.mjs
|
|
9456
|
-
var e$
|
|
9478
|
+
var e$18 = { invalidateQueries: {
|
|
9457
9479
|
source: "queries",
|
|
9458
9480
|
title: "Invalidate Queries",
|
|
9459
9481
|
strictParams: !0,
|
|
@@ -9476,7 +9498,7 @@ var e$17 = { invalidateQueries: {
|
|
|
9476
9498
|
} };
|
|
9477
9499
|
//#endregion
|
|
9478
9500
|
//#region ../sdk-interactions/dist/sources/StateSource/callbacks.mjs
|
|
9479
|
-
var e$
|
|
9501
|
+
var e$17 = {
|
|
9480
9502
|
setState: {
|
|
9481
9503
|
source: "state",
|
|
9482
9504
|
title: "Set State",
|
|
@@ -9628,7 +9650,7 @@ var e$16 = {
|
|
|
9628
9650
|
};
|
|
9629
9651
|
//#endregion
|
|
9630
9652
|
//#region ../sdk-shared/dist/authoring/spaceCallbacks.mjs
|
|
9631
|
-
var e$
|
|
9653
|
+
var e$16 = { addNotification: {
|
|
9632
9654
|
source: "space",
|
|
9633
9655
|
title: "Add Notification",
|
|
9634
9656
|
strictParams: !0,
|
|
@@ -9694,13 +9716,13 @@ var e$15 = { addNotification: {
|
|
|
9694
9716
|
* of them is an authoring question nobody at runtime asks.
|
|
9695
9717
|
*/
|
|
9696
9718
|
var BUILTIN_GLOBAL_CALLBACKS = {
|
|
9697
|
-
...e$15,
|
|
9698
9719
|
...e$16,
|
|
9699
|
-
...e$
|
|
9700
|
-
...e$18,
|
|
9720
|
+
...e$17,
|
|
9701
9721
|
...e$20,
|
|
9722
|
+
...e$19,
|
|
9723
|
+
...e$21,
|
|
9702
9724
|
...t$15,
|
|
9703
|
-
...e$
|
|
9725
|
+
...e$18
|
|
9704
9726
|
};
|
|
9705
9727
|
/** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
|
|
9706
9728
|
* callback whose source/schema is not knowable here). */
|
|
@@ -9945,7 +9967,7 @@ var webHook = (params) => utilityStep("webHook", params);
|
|
|
9945
9967
|
var twigTemplate = (params) => utilityStep("twigTemplate", params);
|
|
9946
9968
|
//#endregion
|
|
9947
9969
|
//#region ../sdk-interactions/dist/utility/copyToClipboardSpec.mjs
|
|
9948
|
-
var e$
|
|
9970
|
+
var e$15 = {
|
|
9949
9971
|
title: "Copy To Clipboard",
|
|
9950
9972
|
type: "utility",
|
|
9951
9973
|
strictParams: !0,
|
|
@@ -10075,7 +10097,7 @@ var BUILTIN_UTILITIES = {
|
|
|
10075
10097
|
data: ""
|
|
10076
10098
|
} }
|
|
10077
10099
|
},
|
|
10078
|
-
copyToClipboard: e$
|
|
10100
|
+
copyToClipboard: e$15
|
|
10079
10101
|
};
|
|
10080
10102
|
/** The built-in utility for an action, or undefined when the action is not a known built-in utility. */
|
|
10081
10103
|
var getUtility = (action) => Object.hasOwn(BUILTIN_UTILITIES, action) ? BUILTIN_UTILITIES[action] : void 0;
|
|
@@ -10155,13 +10177,13 @@ var withNotFoundPage = (spec) => {
|
|
|
10155
10177
|
};
|
|
10156
10178
|
//#endregion
|
|
10157
10179
|
//#region ../sdk-shared/dist/actions/failureHandler.mjs
|
|
10158
|
-
var e$
|
|
10180
|
+
var e$14 = "flow.onFailure";
|
|
10159
10181
|
//#endregion
|
|
10160
10182
|
//#region ../sdk-shared/dist/actions/functions.mjs
|
|
10161
10183
|
var a$9 = (e) => e === "/fn" || e.startsWith("/fn/");
|
|
10162
10184
|
//#endregion
|
|
10163
10185
|
//#region ../sdk-shared/dist/types/SchemaTypes.mjs
|
|
10164
|
-
var e$
|
|
10186
|
+
var e$13 = [
|
|
10165
10187
|
"skip",
|
|
10166
10188
|
"parallel",
|
|
10167
10189
|
"queue",
|
|
@@ -10302,7 +10324,7 @@ var both = (inner, outer) => inner.combinator === "and" && outer.combinator ===
|
|
|
10302
10324
|
*/
|
|
10303
10325
|
var whileRunning = (mode, trigger) => {
|
|
10304
10326
|
if (trigger.type !== "trigger") throw new AuthoringError("while-running", `whileRunning('${mode}', …) wraps a flow's TRIGGER — it decides what firing the trigger again does — and was given a "${trigger.type}" step (${trigger.action}). Put it around the first step: \`[whileRunning('${mode}', onClick()), …]\`.`);
|
|
10305
|
-
if (!e$
|
|
10327
|
+
if (!e$13.includes(mode)) throw new AuthoringError("while-running", `whileRunning takes ${e$13.map((item) => `'${item}'`).join(", ")}, not '${mode}'.`);
|
|
10306
10328
|
return {
|
|
10307
10329
|
...trigger,
|
|
10308
10330
|
whileRunning: mode
|
|
@@ -10473,7 +10495,7 @@ var defineAction = (spec) => {
|
|
|
10473
10495
|
...undo.length > 0 ? [{
|
|
10474
10496
|
id: "onFailure",
|
|
10475
10497
|
type: "task",
|
|
10476
|
-
action: e$
|
|
10498
|
+
action: e$14,
|
|
10477
10499
|
params: {}
|
|
10478
10500
|
}, ...undo.map(taskStep)] : []
|
|
10479
10501
|
];
|
|
@@ -10507,15 +10529,16 @@ var authoringCodesTable = (kind) => {
|
|
|
10507
10529
|
var t$13 = "[A-Za-z_][A-Za-z0-9_]*";
|
|
10508
10530
|
var n$13 = RegExp(`^${t$13}$`);
|
|
10509
10531
|
RegExp(`^!?${t$13}$`);
|
|
10510
|
-
var i$
|
|
10532
|
+
var i$12 = /* @__PURE__ */ new Set([
|
|
10511
10533
|
"__proto__",
|
|
10512
10534
|
"constructor",
|
|
10513
10535
|
"prototype"
|
|
10514
10536
|
]);
|
|
10515
|
-
var a$8 = (e) => n$13.test(e) && !i$
|
|
10537
|
+
var a$8 = (e) => n$13.test(e) && !i$12.has(e);
|
|
10516
10538
|
//#endregion
|
|
10517
10539
|
//#region ../sdk-shared/dist/flags/resolveFlags.mjs
|
|
10518
|
-
var i$
|
|
10540
|
+
var i$11 = (e) => typeof e == "object" && !!e && "rules" in e && Array.isArray(e.rules) && e.rules.some((e) => typeof e == "object" && !!e && !("enabled" in e && e.enabled === !1));
|
|
10541
|
+
var u$6 = (e, t) => !e || (t[e.name] ?? !1) === e.is;
|
|
10519
10542
|
//#endregion
|
|
10520
10543
|
//#region src/schema/flags.ts
|
|
10521
10544
|
/**
|
|
@@ -10909,14 +10932,14 @@ var lintActionOutputBindings = (ctx) => {
|
|
|
10909
10932
|
};
|
|
10910
10933
|
//#endregion
|
|
10911
10934
|
//#region ../sdk-schema/dist/helpers/styleWithoutTag.mjs
|
|
10912
|
-
var e$
|
|
10913
|
-
var t$12 = (t) => Object.values(t ?? {}).some(e$
|
|
10914
|
-
var n$12 = (n) => e$
|
|
10935
|
+
var e$12 = (e) => Object.keys(e ?? {}).length > 0;
|
|
10936
|
+
var t$12 = (t) => Object.values(t ?? {}).some(e$12);
|
|
10937
|
+
var n$12 = (n) => e$12(n.default) || t$12(n.states) || Object.values(n.variants ?? {}).some((n) => e$12(n.default) || t$12(n.states));
|
|
10915
10938
|
var r$11 = (e, t) => Object.values(e.platform).some((e) => Object.hasOwn(e, t) && Object.values(e[t].attributes).some(n$12));
|
|
10916
|
-
var i$
|
|
10939
|
+
var i$10 = /* @__PURE__ */ new Set(["apiContainer", "channel"]);
|
|
10917
10940
|
var a$7 = (e) => {
|
|
10918
10941
|
let t = e.attributes.subType;
|
|
10919
|
-
return i$
|
|
10942
|
+
return i$10.has(e.definition.type) && (typeof t != "string" || t === "");
|
|
10920
10943
|
};
|
|
10921
10944
|
var o$10 = (e, t) => {
|
|
10922
10945
|
if (!a$7(e)) return;
|
|
@@ -10925,8 +10948,8 @@ var o$10 = (e, t) => {
|
|
|
10925
10948
|
};
|
|
10926
10949
|
//#endregion
|
|
10927
10950
|
//#region ../sdk-shared/dist/schema/anchor.mjs
|
|
10928
|
-
var e$
|
|
10929
|
-
var t$11 = (t) => typeof t == "string" && e$
|
|
10951
|
+
var e$11 = /^[a-z][a-z0-9-]*$/;
|
|
10952
|
+
var t$11 = (t) => typeof t == "string" && e$11.test(t);
|
|
10930
10953
|
var n$11 = (e) => e.normalize("NFKD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^[^a-z]+|-+$/g, "") || "section";
|
|
10931
10954
|
var r$10 = (e, t) => {
|
|
10932
10955
|
let r = n$11(e), i = r;
|
|
@@ -10935,7 +10958,7 @@ var r$10 = (e, t) => {
|
|
|
10935
10958
|
};
|
|
10936
10959
|
//#endregion
|
|
10937
10960
|
//#region ../sdk-shared/dist/schema/layoutChain.mjs
|
|
10938
|
-
var e$
|
|
10961
|
+
var e$10 = (e, t) => {
|
|
10939
10962
|
let n = e?.attributes[t];
|
|
10940
10963
|
return typeof n == "string" ? n : "";
|
|
10941
10964
|
};
|
|
@@ -10947,7 +10970,7 @@ var t$10 = (t, n, r) => {
|
|
|
10947
10970
|
a.add(o), i.push({
|
|
10948
10971
|
layout: o,
|
|
10949
10972
|
slot: s || o
|
|
10950
|
-
}), o = e$
|
|
10973
|
+
}), o = e$10(n, "layout"), s = e$10(n, "layoutContainer");
|
|
10951
10974
|
}
|
|
10952
10975
|
return i;
|
|
10953
10976
|
};
|
|
@@ -10955,7 +10978,7 @@ var n$10 = (t, n) => {
|
|
|
10955
10978
|
let r = [], i = n;
|
|
10956
10979
|
for (; i && r.length <= 16;) {
|
|
10957
10980
|
if (r.includes(i)) return [...r.slice(r.indexOf(i)), i];
|
|
10958
|
-
r.push(i), i = e$
|
|
10981
|
+
r.push(i), i = e$10(t(i), "layout");
|
|
10959
10982
|
}
|
|
10960
10983
|
return [];
|
|
10961
10984
|
};
|
|
@@ -10964,7 +10987,7 @@ var n$10 = (t, n) => {
|
|
|
10964
10987
|
var t$9 = /^ {0,3}(`{3,}|~{3,})/;
|
|
10965
10988
|
var n$9 = /^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*$/;
|
|
10966
10989
|
var r$9 = (e) => e.replace(/!\[[^\]]*\]\([^)]*\)/g, "").replace(/<[^>]+>/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`+([^`]*?)`+/g, "$1").replace(/(\*\*|~~)(.+?)\1/g, "$2").replace(/\*(.+?)\*/g, "$1").replace(/\b__(.+?)__\b/g, "$1").replace(/\b_(.+?)_\b/g, "$1").replace(/\\([\\`*_{}[\]()#+\-.!|~>])/g, "$1").trim();
|
|
10967
|
-
var i$
|
|
10990
|
+
var i$9 = (i) => {
|
|
10968
10991
|
let a = /* @__PURE__ */ new Set(), o = [], s;
|
|
10969
10992
|
for (let c of i.split("\n")) {
|
|
10970
10993
|
let i = t$9.exec(c)?.[1];
|
|
@@ -11005,7 +11028,7 @@ var anchorsOfPage = (ctx, pageId) => {
|
|
|
11005
11028
|
Object.values(ctx.flat).forEach((element) => {
|
|
11006
11029
|
if (!roots.has(element.definition.rootId)) return;
|
|
11007
11030
|
const own = element.definition.anchor ? [element.definition.anchor] : [];
|
|
11008
|
-
const headings = element.definition.type === "markdown" ? i$
|
|
11031
|
+
const headings = element.definition.type === "markdown" ? i$9(attributeText$1(element, "content")).map((heading) => heading.anchor) : [];
|
|
11009
11032
|
[...own, ...headings].forEach((anchor) => anchors.set(anchor, [...anchors.get(anchor) ?? [], element.id]));
|
|
11010
11033
|
});
|
|
11011
11034
|
return anchors;
|
|
@@ -11091,10 +11114,10 @@ var lintAnchors = (ctx) => {
|
|
|
11091
11114
|
var t$8 = /^[A-Za-z0-9:_.-]{1,128}$/;
|
|
11092
11115
|
var n$8 = "[A-Za-z0-9_.-]{1,64}";
|
|
11093
11116
|
var r$8 = (e) => t$8.test(e);
|
|
11094
|
-
var i$
|
|
11117
|
+
var i$8 = (e) => RegExp(`^${e.split(/(\{[A-Za-z0-9_]+\})/).map((e) => /^\{[A-Za-z0-9_]+\}$/.test(e) ? n$8 : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("")}$`);
|
|
11095
11118
|
var a$6 = (e, t) => {
|
|
11096
11119
|
if (!t || !r$8(e)) return;
|
|
11097
|
-
let n = Object.keys(t).find((t) => i$
|
|
11120
|
+
let n = Object.keys(t).find((t) => i$8(t).test(e));
|
|
11098
11121
|
return n === void 0 ? void 0 : {
|
|
11099
11122
|
pattern: n,
|
|
11100
11123
|
declaration: t[n]
|
|
@@ -11108,9 +11131,9 @@ var s$8 = /* @__PURE__ */ new Set([
|
|
|
11108
11131
|
]);
|
|
11109
11132
|
var c$7 = (t, n) => {
|
|
11110
11133
|
let r = [];
|
|
11111
|
-
if (o$9.test(t) || r.push("a pattern is letters, digits and `:_.-`, with `{name}` for the part a page fills in — `board:{id}`"), !e$
|
|
11112
|
-
let { access: i, publish: a, presence: c, grant: l, maxMessageBytes: u, messagesPerSecond: d } = n, f = e$
|
|
11113
|
-
typeof f != "string" || !s$8.has(f) ? r.push("`access` is { mode: \"public\" }, { mode: \"session\" } or { mode: \"role\", permissions: […] }") : f === "role" && !(e$
|
|
11134
|
+
if (o$9.test(t) || r.push("a pattern is letters, digits and `:_.-`, with `{name}` for the part a page fills in — `board:{id}`"), !e$33(n)) return [...r, "a channel is an object: `{ access: { mode: \"public\" } }`"];
|
|
11135
|
+
let { access: i, publish: a, presence: c, grant: l, maxMessageBytes: u, messagesPerSecond: d } = n, f = e$33(i) ? i.mode : void 0;
|
|
11136
|
+
typeof f != "string" || !s$8.has(f) ? r.push("`access` is { mode: \"public\" }, { mode: \"session\" } or { mode: \"role\", permissions: […] }") : f === "role" && !(e$33(i) && Array.isArray(i.permissions) && i.permissions.every((e) => typeof e == "string")) && r.push("`access: { mode: \"role\" }` names the permissions it needs: `permissions: [\"boardEdit\"]`"), a !== void 0 && a !== "clients" && a !== "server" && r.push("`publish` is \"clients\" (pages send) or \"server\" (only a flow's realtime.publish)"), c !== void 0 && typeof c != "boolean" && r.push("`presence` is true or false"), l !== void 0 && typeof l != "boolean" && r.push("`grant` is true (a page needs a grant from `realtime.grant` to open a topic) or false");
|
|
11114
11137
|
for (let [e, t] of [["maxMessageBytes", u], ["messagesPerSecond", d]]) t !== void 0 && (typeof t != "number" || !Number.isInteger(t) || t <= 0) && r.push(`\`${e}\` is a whole number above zero`);
|
|
11115
11138
|
return r;
|
|
11116
11139
|
};
|
|
@@ -11170,7 +11193,7 @@ var lintInstances = (ctx) => {
|
|
|
11170
11193
|
};
|
|
11171
11194
|
//#endregion
|
|
11172
11195
|
//#region ../sdk-shared/dist/server/rsc/projectData.mjs
|
|
11173
|
-
var e$
|
|
11196
|
+
var e$9 = "/data/";
|
|
11174
11197
|
//#endregion
|
|
11175
11198
|
//#region src/schema/dataPath.ts
|
|
11176
11199
|
/**
|
|
@@ -11276,14 +11299,14 @@ var lintDataPaths = (ctx) => {
|
|
|
11276
11299
|
//#endregion
|
|
11277
11300
|
//#region ../sdk-elements/dist/elements/media/Svg/sanitizeSvg.mjs
|
|
11278
11301
|
var r$7 = /^\s*(?:<!--[\s\S]*?-->\s*)*<svg\b[\s\S]*<\/svg>\s*$/i;
|
|
11279
|
-
var i$
|
|
11302
|
+
var i$7 = (e) => r$7.test(e);
|
|
11280
11303
|
//#endregion
|
|
11281
11304
|
//#region ../sdk-shared/dist/helpers/twigWrapper/filters/filters.mjs
|
|
11282
|
-
var e$
|
|
11305
|
+
var e$8 = Symbol("twigArrowParams");
|
|
11283
11306
|
var t$7 = (e) => e == null || e === "";
|
|
11284
11307
|
var n$7 = (e, t) => e === t ? 0 : e == null ? -1 : t == null ? 1 : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t));
|
|
11285
11308
|
var r$6 = (e) => e === void 0 || typeof e == "function" || typeof e == "symbol" ? "null" : typeof e == "bigint" ? e.toString() : JSON.stringify(e);
|
|
11286
|
-
var i$
|
|
11309
|
+
var i$6 = (e) => e == null ? "" : String(e);
|
|
11287
11310
|
var a$5 = (e) => {
|
|
11288
11311
|
let t = new TextEncoder().encode(e), n = "";
|
|
11289
11312
|
for (let e = 0; e < t.length; e++) n += String.fromCharCode(t[e]);
|
|
@@ -11454,7 +11477,7 @@ var _$2 = (e) => {
|
|
|
11454
11477
|
}
|
|
11455
11478
|
};
|
|
11456
11479
|
var v$1 = (e, t, n) => {
|
|
11457
|
-
for (let r of [t == null ? "en" : i$
|
|
11480
|
+
for (let r of [t == null ? "en" : i$6(t), "en"]) try {
|
|
11458
11481
|
return new Intl.NumberFormat(r, n).format(e);
|
|
11459
11482
|
} catch {
|
|
11460
11483
|
continue;
|
|
@@ -11479,7 +11502,7 @@ var y$1 = {
|
|
|
11479
11502
|
rtrim: (e) => typeof e == "string" ? e.trimEnd() : e,
|
|
11480
11503
|
pad: (e, t) => {
|
|
11481
11504
|
if (typeof e != "string") return e;
|
|
11482
|
-
let n = Number(t[0]) || 0, r = t.length > 1 ? i$
|
|
11505
|
+
let n = Number(t[0]) || 0, r = t.length > 1 ? i$6(t[1]) : " ";
|
|
11483
11506
|
if (r === "") return e;
|
|
11484
11507
|
let a = n - e.length;
|
|
11485
11508
|
if (a <= 0) return e;
|
|
@@ -11488,7 +11511,7 @@ var y$1 = {
|
|
|
11488
11511
|
},
|
|
11489
11512
|
padRight: (e, t) => {
|
|
11490
11513
|
if (typeof e != "string") return e;
|
|
11491
|
-
let n = Number(t[0]) || 0, r = t.length > 1 ? i$
|
|
11514
|
+
let n = Number(t[0]) || 0, r = t.length > 1 ? i$6(t[1]) : " ";
|
|
11492
11515
|
if (r === "") return e;
|
|
11493
11516
|
let a = n - e.length;
|
|
11494
11517
|
if (a <= 0) return e;
|
|
@@ -11504,28 +11527,28 @@ var y$1 = {
|
|
|
11504
11527
|
let n = e.match(/-?\d+(?:\.\d+)?/);
|
|
11505
11528
|
return n ? Number(n[0]) : 0;
|
|
11506
11529
|
},
|
|
11507
|
-
replace: (e, t) => typeof e != "string" || t.length === 0 ? e : e.split(i$
|
|
11530
|
+
replace: (e, t) => typeof e != "string" || t.length === 0 ? e : e.split(i$6(t[0])).join(i$6(t[1])),
|
|
11508
11531
|
slice: (e, t) => {
|
|
11509
11532
|
if (t.length === 0) return e;
|
|
11510
11533
|
let n = Number(t[0]) || 0, r = t.length > 1 && Number.isFinite(Number(t[1])) ? n + Number(t[1]) : void 0;
|
|
11511
11534
|
return typeof e == "string" || Array.isArray(e) ? e.slice(n, r) : e;
|
|
11512
11535
|
},
|
|
11513
|
-
split: (e, t) => typeof e == "string" && t.length > 0 ? e.split(i$
|
|
11514
|
-
join: (e, t) => Array.isArray(e) ? e.join(t.length === 0 ? "" : i$
|
|
11536
|
+
split: (e, t) => typeof e == "string" && t.length > 0 ? e.split(i$6(t[0])) : e,
|
|
11537
|
+
join: (e, t) => Array.isArray(e) ? e.join(t.length === 0 ? "" : i$6(t[0])) : e,
|
|
11515
11538
|
reverse: (e) => typeof e == "string" ? e.split("").reverse().join("") : Array.isArray(e) ? [...e].reverse() : e,
|
|
11516
|
-
length: (e) => typeof e == "string" || Array.isArray(e) ? e.length : typeof e == "number" ? i$
|
|
11539
|
+
length: (e) => typeof e == "string" || Array.isArray(e) ? e.length : typeof e == "number" ? i$6(e).length : typeof e == "object" && e ? Object.keys(e).length : 0,
|
|
11517
11540
|
first: (e) => typeof e == "string" ? e.length > 0 ? e[0] : "" : Array.isArray(e) ? e.length > 0 ? e[0] : void 0 : e,
|
|
11518
11541
|
last: (e) => typeof e == "string" ? e.length > 0 ? e[e.length - 1] : "" : Array.isArray(e) ? e.length > 0 ? e[e.length - 1] : void 0 : e,
|
|
11519
11542
|
contains: (e, t) => {
|
|
11520
11543
|
if (t.length === 0) return !1;
|
|
11521
11544
|
let n = t[0];
|
|
11522
|
-
return typeof e == "string" ? e.includes(i$
|
|
11545
|
+
return typeof e == "string" ? e.includes(i$6(n)) : Array.isArray(e) ? e.includes(n) : !1;
|
|
11523
11546
|
},
|
|
11524
|
-
startswith: (e, t) => typeof e == "string" && t.length > 0 && e.startsWith(i$
|
|
11525
|
-
endswith: (e, t) => typeof e == "string" && t.length > 0 && e.endsWith(i$
|
|
11547
|
+
startswith: (e, t) => typeof e == "string" && t.length > 0 && e.startsWith(i$6(t[0])),
|
|
11548
|
+
endswith: (e, t) => typeof e == "string" && t.length > 0 && e.endsWith(i$6(t[0])),
|
|
11526
11549
|
number_format: (e, t) => {
|
|
11527
11550
|
if (typeof e != "number") return e;
|
|
11528
|
-
let n = Number(t[0]) || 0, r = t[1] == null ? "." : i$
|
|
11551
|
+
let n = Number(t[0]) || 0, r = t[1] == null ? "." : i$6(t[1]), a = t[2] == null ? "" : i$6(t[2]), o = e.toFixed(n);
|
|
11529
11552
|
if (a === "") return o.replace(".", r);
|
|
11530
11553
|
let s = o.split(".");
|
|
11531
11554
|
return s[0] = s[0].replace(/\B(?=(\d{3})+(?!\d))/g, a), s.join(r);
|
|
@@ -11536,7 +11559,7 @@ var y$1 = {
|
|
|
11536
11559
|
let r = t[2], a = typeof r == "object" && !!r && "trimZeros" in r && r.trimZeros === !0 && Number.isInteger(n);
|
|
11537
11560
|
return v$1(n, t[1], {
|
|
11538
11561
|
style: "currency",
|
|
11539
|
-
currency: i$
|
|
11562
|
+
currency: i$6(t[0]),
|
|
11540
11563
|
...a ? {
|
|
11541
11564
|
minimumFractionDigits: 0,
|
|
11542
11565
|
maximumFractionDigits: 0
|
|
@@ -11558,7 +11581,7 @@ var y$1 = {
|
|
|
11558
11581
|
let i = [...t], a = r[0];
|
|
11559
11582
|
if (typeof a == "function") {
|
|
11560
11583
|
let t = a;
|
|
11561
|
-
return (t[e$
|
|
11584
|
+
return (t[e$8] ?? 1) >= 2 ? i.sort((e, n) => Number(t(e, n))) : i.sort((e, r) => n$7(t(e), t(r)));
|
|
11562
11585
|
}
|
|
11563
11586
|
return i.sort(n$7);
|
|
11564
11587
|
},
|
|
@@ -11598,7 +11621,7 @@ var y$1 = {
|
|
|
11598
11621
|
if (t.length === 0) return e.filter(Boolean);
|
|
11599
11622
|
let n = t[0];
|
|
11600
11623
|
if (typeof n == "function") return e.filter((e, t) => n(e, t));
|
|
11601
|
-
let r = i$
|
|
11624
|
+
let r = i$6(n);
|
|
11602
11625
|
return e.filter((e) => {
|
|
11603
11626
|
if (typeof e == "object" && e) {
|
|
11604
11627
|
let t = e[r];
|
|
@@ -11609,14 +11632,14 @@ var y$1 = {
|
|
|
11609
11632
|
},
|
|
11610
11633
|
column: (e, t) => {
|
|
11611
11634
|
if (!Array.isArray(e) || t.length === 0) return e;
|
|
11612
|
-
let n = i$
|
|
11635
|
+
let n = i$6(t[0]);
|
|
11613
11636
|
return e.map((e) => typeof e == "object" && e ? e[n] : void 0);
|
|
11614
11637
|
},
|
|
11615
|
-
url_encode: (e) => typeof e == "string" ? encodeURIComponent(e) : typeof e == "object" && e && !Array.isArray(e) ? new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e, t]) => [e, i$
|
|
11638
|
+
url_encode: (e) => typeof e == "string" ? encodeURIComponent(e) : typeof e == "object" && e && !Array.isArray(e) ? new URLSearchParams(Object.fromEntries(Object.entries(e).map(([e, t]) => [e, i$6(t)]))).toString() : e,
|
|
11616
11639
|
nl2br: (e) => typeof e == "string" ? e.replace(/\n/g, "<br>") : e,
|
|
11617
11640
|
striptags: (e, t) => {
|
|
11618
11641
|
if (typeof e != "string") return e;
|
|
11619
|
-
let n = t.length > 0 ? i$
|
|
11642
|
+
let n = t.length > 0 ? i$6(t[0]).trim() : "";
|
|
11620
11643
|
if (n) {
|
|
11621
11644
|
let t = n.split(/(?:\s*>\s*<\s*|<\s*|>\s*)/).filter(Boolean).map((e) => e.replace(/[/>]/g, "").trim());
|
|
11622
11645
|
if (t.length > 0) {
|
|
@@ -11629,7 +11652,7 @@ var y$1 = {
|
|
|
11629
11652
|
abs: (e) => typeof e == "number" ? Math.abs(e) : e,
|
|
11630
11653
|
round: (e, t) => {
|
|
11631
11654
|
if (typeof e != "number") return e;
|
|
11632
|
-
let n = Number(t[0]) || 0, r = t[1] == null ? "common" : i$
|
|
11655
|
+
let n = Number(t[0]) || 0, r = t[1] == null ? "common" : i$6(t[1]), a = 10 ** n;
|
|
11633
11656
|
return r === "ceil" ? Math.ceil(e * a) / a : r === "floor" ? Math.floor(e * a) / a : Math.round(e * a) / a;
|
|
11634
11657
|
},
|
|
11635
11658
|
format: (e, t) => {
|
|
@@ -11646,7 +11669,7 @@ var y$1 = {
|
|
|
11646
11669
|
} else if (s === "f") {
|
|
11647
11670
|
let e = Number(c);
|
|
11648
11671
|
u = `${l && e >= 0 ? "+" : ""}${o === void 0 ? String(e) : e.toFixed(Number(o))}`;
|
|
11649
|
-
} else u = i$
|
|
11672
|
+
} else u = i$6(c), u = o === void 0 ? u : u.slice(0, Number(o));
|
|
11650
11673
|
let d = Number(a || 0);
|
|
11651
11674
|
if (u.length >= d) return u;
|
|
11652
11675
|
let f = /'(.)/.exec(r), p = f ? f[1] : r.includes("0") ? "0" : " ";
|
|
@@ -11657,9 +11680,9 @@ var y$1 = {
|
|
|
11657
11680
|
random: (e) => Array.isArray(e) ? e.length > 0 ? e[Math.floor(Math.random() * e.length)] : void 0 : typeof e == "string" ? e.length > 0 ? e[Math.floor(Math.random() * e.length)] : "" : typeof e == "number" ? Math.floor(Math.random() * e) : e,
|
|
11658
11681
|
date: (e, t) => {
|
|
11659
11682
|
if (t.length === 0) return e;
|
|
11660
|
-
let n = i$
|
|
11683
|
+
let n = i$6(t[0]), r = h$1(e);
|
|
11661
11684
|
if (Number.isNaN(r.getTime())) return "";
|
|
11662
|
-
let a = g$2(r, t.length > 1 ? i$
|
|
11685
|
+
let a = g$2(r, t.length > 1 ? i$6(t[1]) : "");
|
|
11663
11686
|
if (!a) return "";
|
|
11664
11687
|
let o = (e) => String(e).padStart(2, "0"), s = [
|
|
11665
11688
|
"January",
|
|
@@ -11726,13 +11749,13 @@ var y$1 = {
|
|
|
11726
11749
|
md5: (e) => typeof e == "string" ? s$7(e) : e,
|
|
11727
11750
|
without: (e, t) => {
|
|
11728
11751
|
if (typeof e != "object" || !e || Array.isArray(e)) return e;
|
|
11729
|
-
let n = t.map(i$
|
|
11752
|
+
let n = t.map(i$6), r = {};
|
|
11730
11753
|
for (let [t, i] of Object.entries(e)) n.includes(t) || (r[t] = i);
|
|
11731
11754
|
return r;
|
|
11732
11755
|
},
|
|
11733
11756
|
only: (e, t) => {
|
|
11734
11757
|
if (typeof e != "object" || !e || Array.isArray(e)) return e;
|
|
11735
|
-
let n = t.map(i$
|
|
11758
|
+
let n = t.map(i$6), r = {};
|
|
11736
11759
|
for (let [t, i] of Object.entries(e)) n.includes(t) && (r[t] = i);
|
|
11737
11760
|
return r;
|
|
11738
11761
|
},
|
|
@@ -11741,12 +11764,12 @@ var y$1 = {
|
|
|
11741
11764
|
let n = t[0];
|
|
11742
11765
|
if (typeof n == "function") return e.find((e, t) => n(e, t));
|
|
11743
11766
|
if (t.length < 2) return;
|
|
11744
|
-
let r = i$
|
|
11767
|
+
let r = i$6(n), a = t[1];
|
|
11745
11768
|
return e.find((e) => typeof e == "object" && e ? e[r] === a : e === a);
|
|
11746
11769
|
},
|
|
11747
11770
|
pluck: (e, t) => {
|
|
11748
11771
|
if (!Array.isArray(e) || t.length === 0) return e;
|
|
11749
|
-
let n = i$
|
|
11772
|
+
let n = i$6(t[0]);
|
|
11750
11773
|
return e.map((e) => typeof e == "object" && e ? e[n] : void 0);
|
|
11751
11774
|
},
|
|
11752
11775
|
unique: (e) => Array.isArray(e) ? [...new Set(e)] : e,
|
|
@@ -11762,7 +11785,7 @@ var y$1 = {
|
|
|
11762
11785
|
},
|
|
11763
11786
|
index_by: (e, t) => {
|
|
11764
11787
|
if (!Array.isArray(e) || t.length === 0) return e;
|
|
11765
|
-
let n = i$
|
|
11788
|
+
let n = i$6(t[0]), r = {};
|
|
11766
11789
|
for (let t of e) if (typeof t == "object" && t) {
|
|
11767
11790
|
let e = String(t[n] ?? "");
|
|
11768
11791
|
r[e] = t;
|
|
@@ -11771,7 +11794,7 @@ var y$1 = {
|
|
|
11771
11794
|
},
|
|
11772
11795
|
group_by: (e, t) => {
|
|
11773
11796
|
if (!Array.isArray(e) || t.length === 0) return e;
|
|
11774
|
-
let n = i$
|
|
11797
|
+
let n = i$6(t[0]), r = {};
|
|
11775
11798
|
for (let t of e) if (typeof t == "object" && t) {
|
|
11776
11799
|
let e = String(t[n] ?? "");
|
|
11777
11800
|
r[e] = r[e] ?? [], r[e].push(t);
|
|
@@ -11781,7 +11804,7 @@ var y$1 = {
|
|
|
11781
11804
|
};
|
|
11782
11805
|
//#endregion
|
|
11783
11806
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs
|
|
11784
|
-
var e$
|
|
11807
|
+
var e$7 = (e) => typeof e == "string" && /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/.test(e);
|
|
11785
11808
|
//#endregion
|
|
11786
11809
|
//#region ../sdk-shared/dist/helpers/twigWrapper/inspectTemplate.mjs
|
|
11787
11810
|
var r$5 = /* @__PURE__ */ new Set([
|
|
@@ -11790,10 +11813,10 @@ var r$5 = /* @__PURE__ */ new Set([
|
|
|
11790
11813
|
"min",
|
|
11791
11814
|
"range"
|
|
11792
11815
|
]);
|
|
11793
|
-
var i$
|
|
11816
|
+
var i$5 = (e) => `value|round(0, '${e}')`;
|
|
11794
11817
|
var a$4 = {
|
|
11795
|
-
floor: i$
|
|
11796
|
-
ceil: i$
|
|
11818
|
+
floor: i$5("floor"),
|
|
11819
|
+
ceil: i$5("ceil"),
|
|
11797
11820
|
clamp: "min(max(value, low), high)"
|
|
11798
11821
|
};
|
|
11799
11822
|
var o$7 = (t) => {
|
|
@@ -11890,7 +11913,7 @@ var c$5 = class {
|
|
|
11890
11913
|
}
|
|
11891
11914
|
};
|
|
11892
11915
|
var l$6 = (e) => {
|
|
11893
|
-
let r = e$
|
|
11916
|
+
let r = e$37(e);
|
|
11894
11917
|
if (r.error) return {
|
|
11895
11918
|
issues: [r.error],
|
|
11896
11919
|
freeNames: []
|
|
@@ -11945,6 +11968,26 @@ var checkShapedReads = (ctx, reads, where, id) => {
|
|
|
11945
11968
|
for (const [source, field] of reads) if (isShaped(source)) checkShapedField(ctx, source, field, where, id);
|
|
11946
11969
|
};
|
|
11947
11970
|
//#endregion
|
|
11971
|
+
//#region ../sdk-shared/dist/dataSource/helpers/getSourceName.mjs
|
|
11972
|
+
var e$6 = (e, t) => `${e}_${t}`;
|
|
11973
|
+
//#endregion
|
|
11974
|
+
//#region ../sdk-shared/dist/schema/serverElements.mjs
|
|
11975
|
+
var i$4 = (e, t, i, a) => {
|
|
11976
|
+
if (t === void 0) return [];
|
|
11977
|
+
let o = i ? new Set(i) : void 0, s = [], c = /* @__PURE__ */ new Set(), l = e.flat[t], u = (e) => typeof e == "string" ? e : "", d = [t, ...l ? t$10((t) => e.flat[t], u(l.attributes.layout), u(l.attributes.layoutContainer)).map((e) => e.layout) : []];
|
|
11978
|
+
for (; d.length > 0;) {
|
|
11979
|
+
let t = d.pop();
|
|
11980
|
+
if (t === void 0 || c.has(t)) continue;
|
|
11981
|
+
c.add(t);
|
|
11982
|
+
let r = e.flat[t];
|
|
11983
|
+
if (!r || a && !u$6(r.definition.flag, a)) continue;
|
|
11984
|
+
r.definition.runtime === "server" && (!o || o.has(r.id)) && s.push(r);
|
|
11985
|
+
let { items: i } = r.definition;
|
|
11986
|
+
i && d.push(...i);
|
|
11987
|
+
}
|
|
11988
|
+
return s;
|
|
11989
|
+
};
|
|
11990
|
+
//#endregion
|
|
11948
11991
|
//#region src/schema/lint/pages.ts
|
|
11949
11992
|
/**
|
|
11950
11993
|
* Where a link in `page` mode, or a `navigate` to a page, goes: a page named by its id, or a path read as the path it
|
|
@@ -11952,7 +11995,7 @@ var checkShapedReads = (ctx, reads, where, id) => {
|
|
|
11952
11995
|
* in-app, so it is refused; a bare name that is no page's id is a typo.
|
|
11953
11996
|
*/
|
|
11954
11997
|
var checkPageTarget = (ctx, target, where, field, id) => {
|
|
11955
|
-
if (target === "" || target.startsWith("#") || target.startsWith("/") || e$
|
|
11998
|
+
if (target === "" || target.startsWith("#") || target.startsWith("/") || e$7(target)) return;
|
|
11956
11999
|
if (/^[a-z][a-z0-9+.-]*:/i.test(target)) {
|
|
11957
12000
|
ctx.error("page-target-url", `${where} is "${target}", a full URL, in page mode — it would render as a path inside the space. Write \`${field}: 'external'\` for it.`, id);
|
|
11958
12001
|
return;
|
|
@@ -11970,6 +12013,39 @@ var folderPath = (ctx, folderId) => {
|
|
|
11970
12013
|
}
|
|
11971
12014
|
return parts.join("/");
|
|
11972
12015
|
};
|
|
12016
|
+
/** A page's own templates, by the attribute the document holds and the field of the page that writes it. */
|
|
12017
|
+
var PAGE_TEMPLATES = [
|
|
12018
|
+
["seoPageTitle", "seoTitle"],
|
|
12019
|
+
["seoPageDescription", "seoDescription"],
|
|
12020
|
+
["notFound", "notFound"]
|
|
12021
|
+
];
|
|
12022
|
+
/** One expression, whole: what a `notFound` is, and anything else is never `true`. */
|
|
12023
|
+
var ONE_EXPRESSION = /^\s*\{\{[\s\S]*\}\}\s*$/;
|
|
12024
|
+
/**
|
|
12025
|
+
* A page's title, description and `notFound` written as templates are evaluated by the server as it answers — the head,
|
|
12026
|
+
* the status — and the title again in the browser over the same answers: they read only what is there by then, the
|
|
12027
|
+
* server providers of the page and of its layouts by their source names (`apiContainer_capsule`), and `navigation`.
|
|
12028
|
+
* Anything else is not there yet: the head would carry the deployment's own title, and the address would answer 200.
|
|
12029
|
+
*/
|
|
12030
|
+
var checkPageTemplates = (ctx, pageId, where) => {
|
|
12031
|
+
const page = ctx.element(pageId);
|
|
12032
|
+
const providers = i$4({ flat: ctx.flat }, pageId).map((element) => e$6(element.definition.type, element.id));
|
|
12033
|
+
const readable = /* @__PURE__ */ new Set(["navigation", ...providers]);
|
|
12034
|
+
for (const [attribute, field] of PAGE_TEMPLATES) {
|
|
12035
|
+
const template = page?.attributes[attribute];
|
|
12036
|
+
if (attribute === "notFound" && typeof template === "string" && template !== "" && !ONE_EXPRESSION.test(template)) {
|
|
12037
|
+
ctx.error("not-found-not-a-template", `${where} has \`notFound: ${JSON.stringify(template)}\`, which is never \`true\`: it is one expression over the page's server providers, \`'{{ not apiContainer_post.found }}'\`.`, pageId);
|
|
12038
|
+
continue;
|
|
12039
|
+
}
|
|
12040
|
+
if (typeof template !== "string" || !e$7(template)) continue;
|
|
12041
|
+
const { issues, freeNames } = l$6(template);
|
|
12042
|
+
const unreadable = freeNames.filter((name) => !readable.has(name));
|
|
12043
|
+
if (issues.length === 0 && unreadable.length === 0) continue;
|
|
12044
|
+
const why = issues.length > 0 ? `cannot be read as written — ${issues.join("; ")}` : `reads ${unreadable.map((name) => `\`${name}\``).join(", ")}, which is not there when the server answers`;
|
|
12045
|
+
const can = providers.length > 0 ? providers.map((name) => `\`${name}\``).join(", ") : "none: no provider on it runs on the server";
|
|
12046
|
+
ctx.error("page-template", `${where}: \`${field}\` ${why}. A page's own templates are evaluated by the server before the page reaches the browser, from its server providers — ${can} — and \`navigation\`. Read the record from a provider with \`runtime: 'server'\` on the page (or its layout), or write words of its own.`, pageId);
|
|
12047
|
+
}
|
|
12048
|
+
};
|
|
11973
12049
|
/**
|
|
11974
12050
|
* Pages: who each is for, and that no two answer the same visitors at one address — the router takes one and the
|
|
11975
12051
|
* other can never be reached. Two pages on one path is a supported shape only when they differ by `accessLevel`: a
|
|
@@ -11981,6 +12057,7 @@ var lintPages = (ctx) => {
|
|
|
11981
12057
|
const page = ctx.element(pageId);
|
|
11982
12058
|
if (!page) continue;
|
|
11983
12059
|
const where = ctx.describe(pageId);
|
|
12060
|
+
checkPageTemplates(ctx, pageId, where);
|
|
11984
12061
|
const { accessLevel, slug, folder } = page.attributes;
|
|
11985
12062
|
if (accessLevel !== void 0 && accessLevel !== "" && !ACCESS_LEVELS.includes(accessLevel)) ctx.error("page-access-level", `${where}: \`accessLevel\` is ${JSON.stringify(accessLevel)}. It is one of ${ACCESS_LEVELS.map((level) => `'${level}'`).join(", ")}.`, pageId);
|
|
11986
12063
|
const path = `/${[typeof folder === "string" && folder ? folderPath(ctx, folder) : "", textOf(slug)].filter(Boolean).join("/")}`;
|
|
@@ -12027,6 +12104,27 @@ var lintTypeSlots = (ctx) => {
|
|
|
12027
12104
|
};
|
|
12028
12105
|
var LEVEL_SLOT = /^heading([1-6])$/;
|
|
12029
12106
|
var classesOf$2 = (selector) => (selector ?? "").split(/\s+/).filter(Boolean);
|
|
12107
|
+
/** The fields drawn as a box — the `input` slot — with the `<input>` or `<select>` inside it, the `field` slot. */
|
|
12108
|
+
var BOXED_FIELDS = new Set(Object.entries(g$4.content.defaultStyle.subTypes).filter(([, variant]) => "field" in variant.style).map(([subType]) => subType));
|
|
12109
|
+
var FOCUS_STATES = ["focus", "focus-visible"];
|
|
12110
|
+
/**
|
|
12111
|
+
* A text field's or a select's `input` slot is the box the field is drawn in, a `<div>` that never takes focus: a
|
|
12112
|
+
* `focus` state on its class is never seen, and a keyboard user tabbing to the field finds no ring at all.
|
|
12113
|
+
* `focus-within` is the box's own, lit while the field inside has focus.
|
|
12114
|
+
*/
|
|
12115
|
+
var checkFocusOnFieldBox = (ctx, element, where) => {
|
|
12116
|
+
if (element.definition.type !== "formControl") return;
|
|
12117
|
+
const subType = textOf(element.attributes.subType, textOf(ctx.defaultsFor(element).subType, "text"));
|
|
12118
|
+
if (!BOXED_FIELDS.has(subType)) return;
|
|
12119
|
+
for (const className of classesOf$2(element.definition.styleSelectors.input)) for (const items of Object.values(ctx.style.platform)) {
|
|
12120
|
+
const item = Object.hasOwn(items, className) ? items[className] : void 0;
|
|
12121
|
+
const states = item?.type === "class" ? item.attributes.base.states : void 0;
|
|
12122
|
+
const state = FOCUS_STATES.find((name) => states && Object.hasOwn(states, name));
|
|
12123
|
+
if (!state) continue;
|
|
12124
|
+
ctx.warn("focus-on-field-box", `${where} is a "${subType}" field whose \`input\` slot ("${className}") sets \`${state}\` — but \`input\` is the box the field is drawn in, which never takes focus, so the rule is never seen and a keyboard user finds no ring. Write it as \`'focus-within'\` on the same class (the box lights up while the field inside has focus), or put the state on the \`field\` slot.`, element.id);
|
|
12125
|
+
return;
|
|
12126
|
+
}
|
|
12127
|
+
};
|
|
12030
12128
|
/** A class's own rules at one breakpoint — its base, and each of its states — by where they apply, property by property. */
|
|
12031
12129
|
var classRules$1 = (items, name) => {
|
|
12032
12130
|
const item = Object.hasOwn(items, name) ? items[name] : void 0;
|
|
@@ -12140,7 +12238,7 @@ var checkName = (ctx, name, template, where, site, scope, id) => {
|
|
|
12140
12238
|
* typo, and the composed surface always supplies it.
|
|
12141
12239
|
*/
|
|
12142
12240
|
var checkTemplate = (ctx, template, where, site, scope = /* @__PURE__ */ new Set(), id) => {
|
|
12143
|
-
if (!e$
|
|
12241
|
+
if (!e$7(template)) return;
|
|
12144
12242
|
const { issues, freeNames } = l$6(template);
|
|
12145
12243
|
const reads = globalFieldsRead(template);
|
|
12146
12244
|
checkComputedReads(ctx, reads, where, site, id);
|
|
@@ -12340,23 +12438,18 @@ var checkBindings = (ctx, element, where) => {
|
|
|
12340
12438
|
}
|
|
12341
12439
|
};
|
|
12342
12440
|
/**
|
|
12343
|
-
* The attributes the page server evaluates in full, by element type — never rendered, so never held to what an
|
|
12344
|
-
* attribute resolves: a provider's `notFound`, read against its answer (`source`) once it is in.
|
|
12345
|
-
*/
|
|
12346
|
-
var SERVER_EXPRESSIONS = { apiContainer: ["notFound"] };
|
|
12347
|
-
/**
|
|
12348
12441
|
* An attribute's `{{ token }}` against what the attribute will see when it renders — and a condition in an attribute,
|
|
12349
12442
|
* which is used as written: an attribute only resolves a name with filters.
|
|
12350
12443
|
*/
|
|
12351
12444
|
var checkAttributeTemplates = (ctx, element, where) => {
|
|
12352
12445
|
if (PROSE_TYPES.has(element.definition.type)) return;
|
|
12353
|
-
const evaluated =
|
|
12446
|
+
const evaluated = V[element.definition.type] ?? [];
|
|
12354
12447
|
const rendered = Object.fromEntries(Object.entries(element.attributes).filter(([name]) => !evaluated.includes(name)));
|
|
12355
12448
|
for (const name of evaluated) {
|
|
12356
12449
|
const value = element.attributes[name];
|
|
12357
12450
|
if (typeof value === "string" && value !== "") checkTemplate(ctx, value, `${where}: its "${name}"`, { kind: "binding" }, ctx.scope(element.id), element.id);
|
|
12358
12451
|
}
|
|
12359
|
-
for (const value of stringsIn$1(rendered)) if (e$
|
|
12452
|
+
for (const value of stringsIn$1(rendered)) if (e$7(value) && !n$46(value)) ctx.warn("template-never-resolved", `${where} carries "${shorten(value)}", which is never resolved: an attribute only reads a name with filters (\`{{ post.slug|upper }}\`). Move the expression into a binding's \`twigTemplate\`, where it is evaluated in full.`, element.id, { value });
|
|
12360
12453
|
const routeParams = ctx.routeParams(element.id);
|
|
12361
12454
|
const scope = ctx.scope(element.id);
|
|
12362
12455
|
for (const [name, value] of Object.entries(rendered)) if (typeof value === "string" && n$46(value)) checkTemplate(ctx, value, `${where}: its "${name}"`, {
|
|
@@ -12365,7 +12458,7 @@ var checkAttributeTemplates = (ctx, element, where) => {
|
|
|
12365
12458
|
}, scope, element.id);
|
|
12366
12459
|
};
|
|
12367
12460
|
/** A value at a dotted path of a record, as the list reads its `itemKey`. */
|
|
12368
|
-
var fieldOf = (item, path) => path.split(".").reduce((value, key) => e$
|
|
12461
|
+
var fieldOf = (item, path) => path.split(".").reduce((value, key) => e$33(value) ? value[key] : void 0, item);
|
|
12369
12462
|
/**
|
|
12370
12463
|
* A list's `itemKey` that does not name each of its fixed items once. The list falls back to the items' `id`, then to
|
|
12371
12464
|
* their position, so the rows do not stay with their items as the author meant. Bound items arrive at run time and
|
|
@@ -12512,10 +12605,23 @@ var warnFormControls = (ctx) => {
|
|
|
12512
12605
|
}
|
|
12513
12606
|
}
|
|
12514
12607
|
};
|
|
12608
|
+
/**
|
|
12609
|
+
* A field is optional unless `required: true`, as an HTML field is. One with a `requiredMessage` and nothing requiring
|
|
12610
|
+
* it was written for a field that must be answered: the message is never shown, and an empty answer is sent — what a
|
|
12611
|
+
* space written while fields were required by default does after an upgrade, without a word.
|
|
12612
|
+
*/
|
|
12613
|
+
var checkRequiredMessage = (ctx, element, where) => {
|
|
12614
|
+
const { required, requiredMessage } = element.attributes;
|
|
12615
|
+
const message = textOf(requiredMessage).trim();
|
|
12616
|
+
const requires = required === true || required === "true" || typeof required === "string" && required.includes("{{");
|
|
12617
|
+
const bound = bindingsOf$2(element).some(({ binding }) => binding.to === "required");
|
|
12618
|
+
if (element.definition.type !== "formControl" || message === "" || requires || bound) return;
|
|
12619
|
+
ctx.warn("required-message-unused", `${where} has a \`requiredMessage\` ("${shorten(message)}") but nothing requires it — a field is optional unless \`required: true\` — so the message is never shown and an empty answer is sent. Add \`required: true\`, or drop the message.`, element.id);
|
|
12620
|
+
};
|
|
12515
12621
|
/** An `svg` draws one `<svg>…</svg>`; anything else renders nothing at all. */
|
|
12516
12622
|
var checkSvgMarkup = (ctx, element, where) => {
|
|
12517
12623
|
const { content } = element.attributes;
|
|
12518
|
-
if (element.definition.type !== "svg" || typeof content !== "string" || content === "" || i$
|
|
12624
|
+
if (element.definition.type !== "svg" || typeof content !== "string" || content === "" || i$7(content)) return;
|
|
12519
12625
|
ctx.error("svg-not-svg", `${where} is an \`svg\` whose \`content\` is not one \`<svg>…</svg>\` (${JSON.stringify(shorten(content))}), so it draws nothing. Give it the SVG markup alone; HTML around it belongs in a \`blockHtml\`.`, element.id);
|
|
12520
12626
|
};
|
|
12521
12627
|
var lintElements = (ctx) => {
|
|
@@ -12538,8 +12644,10 @@ var lintElements = (ctx) => {
|
|
|
12538
12644
|
checkAttributeTemplates(ctx, element, where);
|
|
12539
12645
|
checkIntent(ctx, element, where);
|
|
12540
12646
|
checkSvgMarkup(ctx, element, where);
|
|
12647
|
+
checkRequiredMessage(ctx, element, where);
|
|
12541
12648
|
checkSlots(ctx, element, where);
|
|
12542
12649
|
checkHeadingLevels(ctx, element, where);
|
|
12650
|
+
checkFocusOnFieldBox(ctx, element, where);
|
|
12543
12651
|
warnRouteParams(ctx, element, where);
|
|
12544
12652
|
}
|
|
12545
12653
|
warnFormControls(ctx);
|
|
@@ -12558,17 +12666,17 @@ var isRead = (name, schema, elements) => {
|
|
|
12558
12666
|
var lintDeclaration = (ctx, name, flag) => {
|
|
12559
12667
|
const where = `Feature flag "${name}"`;
|
|
12560
12668
|
if (!a$8(name)) ctx.error("flag-name", `${where} is not a name a template can read as \`flags.${name}\`. Use letters, digits and "_", starting with a letter or "_": "${name.replace(/[^A-Za-z0-9_]/g, "_")}".`);
|
|
12561
|
-
if (!e$
|
|
12669
|
+
if (!e$33(flag) || typeof flag.value !== "boolean" || !Array.isArray(flag.rules)) {
|
|
12562
12670
|
ctx.error("flag-shape", `${where} is ${JSON.stringify(flag)}. A flag is { value: true | false, rules: [{ when: { combinator: 'and', rules: [...] }, value: true | false }] } — \`value\` is its answer when no rule matches.`);
|
|
12563
12671
|
return;
|
|
12564
12672
|
}
|
|
12565
12673
|
flag.rules.forEach((rule, index) => {
|
|
12566
12674
|
const at = `${where}, rule ${index + 1}`;
|
|
12567
|
-
if (!e$
|
|
12675
|
+
if (!e$33(rule) || typeof rule.value !== "boolean" || !e$33(rule.when)) {
|
|
12568
12676
|
ctx.error("flag-rule-shape", `${at} is ${JSON.stringify(rule)}. A rule is { when: { … }, value: true | false }.`);
|
|
12569
12677
|
return;
|
|
12570
12678
|
}
|
|
12571
|
-
if (!i$
|
|
12679
|
+
if (!i$11(rule.when)) ctx.warn("flag-rule-empty", `${at} has no conditions, so it never decides anything — an unfinished rule is skipped, not read as "always". Give it a condition (\`{ field: 'environment', operator: '=', value: 'staging' }\`), or set the flag's \`value\` instead.`);
|
|
12572
12680
|
});
|
|
12573
12681
|
};
|
|
12574
12682
|
/**
|
|
@@ -12648,7 +12756,7 @@ var checkElementIds = (ctx, params, spec, at, hostId) => {
|
|
|
12648
12756
|
const kind = elementType ? `an ${elementType}` : "an element";
|
|
12649
12757
|
const listed = candidates.length > 0 ? `: ${candidates.slice(0, 8).join(", ")}${candidates.length > 8 ? ", …" : ""}` : ", and the space has none";
|
|
12650
12758
|
for (const id of ids) {
|
|
12651
|
-
if (typeof id !== "string" || e$
|
|
12759
|
+
if (typeof id !== "string" || e$7(id)) continue;
|
|
12652
12760
|
const element = ctx.element(id) ?? (Object.hasOwn(ctx.schema.flat, id) ? ctx.schema.flat[id] : void 0);
|
|
12653
12761
|
const type = element?.definition.type;
|
|
12654
12762
|
if (element && (!elementType || type === elementType)) continue;
|
|
@@ -12719,7 +12827,7 @@ var checkWhileRunning = (ctx, node, where, hostId) => {
|
|
|
12719
12827
|
ctx.error("while-running", `${where}: step "${node.id}" (${node.action}) sets whileRunning, which only a flow's trigger reads. Put it on the first step: \`[whileRunning('${whileRunning}', onClick()), …]\`.`, hostId);
|
|
12720
12828
|
return;
|
|
12721
12829
|
}
|
|
12722
|
-
if (!e$
|
|
12830
|
+
if (!e$13.includes(whileRunning)) ctx.error("while-running", `${where}: the trigger "${node.action}" sets whileRunning "${whileRunning}". It is one of ${e$13.map((mode) => `'${mode}'`).join(", ")}.`, hostId);
|
|
12723
12831
|
};
|
|
12724
12832
|
var checkTrigger = (ctx, node, where, host) => {
|
|
12725
12833
|
checkTriggerKeys(ctx, node, where, host.id);
|
|
@@ -12761,7 +12869,7 @@ var checkCallbackKey = (ctx, node, where, hostId) => {
|
|
|
12761
12869
|
const targetElement = ctx.element(target);
|
|
12762
12870
|
const type = targetElement && ctx.catalogType(targetElement);
|
|
12763
12871
|
const names = type === void 0 || !targetElement ? null : ctx.attributeNamesFor(targetElement);
|
|
12764
|
-
if (typeof key !== "string" || key === "" || e$
|
|
12872
|
+
if (typeof key !== "string" || key === "" || e$7(key) || type === void 0 || !names) return;
|
|
12765
12873
|
const at = `${where}: step "${node.action}" sets`;
|
|
12766
12874
|
if (category === "state") {
|
|
12767
12875
|
const keys = ["visibility", ...["base", ...ctx.catalogs.slotNames?.[type] ?? []].map((selector) => `styleSelectors.${selector}`)];
|
|
@@ -13146,7 +13254,7 @@ var f$3 = /* @__PURE__ */ new Set([
|
|
|
13146
13254
|
"loop"
|
|
13147
13255
|
]);
|
|
13148
13256
|
var p$3 = (i) => {
|
|
13149
|
-
if (!e$
|
|
13257
|
+
if (!e$33(i)) return ["motion is an object: `{ enter: \"fade-up\", on: \"view\" }`"];
|
|
13150
13258
|
let a = [];
|
|
13151
13259
|
for (let e of Object.keys(i)) f$3.has(e) || a.push(`motion has no "${e}" — it takes enter, on, duration, delay, stagger and loop`);
|
|
13152
13260
|
i.enter !== void 0 && !d$4(t$6, i.enter) && a.push(`motion.enter is one of ${t$6.join(", ")}`), i.on !== void 0 && !d$4(n$6, i.on) && a.push(`motion.on is ${n$6.slice(0, -1).join(", ")} or ${String(n$6.at(-1))}`), i.loop !== void 0 && !d$4(r$4, i.loop) && a.push(`motion.loop is one of ${r$4.join(", ")}`);
|
|
@@ -13331,7 +13439,7 @@ var lintStyle = (ctx) => {
|
|
|
13331
13439
|
//#region src/schema/lint/fixes.ts
|
|
13332
13440
|
var URL_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
|
|
13333
13441
|
/** A page target that is really a URL: the one reading of `mailto:`/`https:` a page-mode link can never mean. */
|
|
13334
|
-
var isUrlTarget = (target) => typeof target === "string" && !e$
|
|
13442
|
+
var isUrlTarget = (target) => typeof target === "string" && !e$7(target) && URL_SCHEME.test(target);
|
|
13335
13443
|
var isRoot = (element) => !element.definition.parentId;
|
|
13336
13444
|
var stepsOf = (element) => Object.values(element.definition.interactions ?? {});
|
|
13337
13445
|
/**
|
|
@@ -13342,7 +13450,7 @@ var settleUnknownKeys = (record, known, what, on, report, defaults = {}) => {
|
|
|
13342
13450
|
for (const key of Object.keys(record)) {
|
|
13343
13451
|
if (known.includes(key)) continue;
|
|
13344
13452
|
const wrapped = record[key];
|
|
13345
|
-
if (e$
|
|
13453
|
+
if (e$33(wrapped) && Object.keys(wrapped).length > 0 && Object.keys(wrapped).every((inner) => known.includes(inner))) {
|
|
13346
13454
|
const inners = Object.keys(wrapped);
|
|
13347
13455
|
if (inners.every((inner) => record[inner] === void 0 || record[inner] === defaults[inner])) {
|
|
13348
13456
|
Object.assign(record, wrapped);
|
|
@@ -14064,16 +14172,16 @@ var n$1 = (n) => {
|
|
|
14064
14172
|
dark: []
|
|
14065
14173
|
};
|
|
14066
14174
|
return Object.entries(r).forEach(([n, r]) => {
|
|
14067
|
-
switch (n$20(n) ? n : e$
|
|
14068
|
-
case e$
|
|
14175
|
+
switch (n$20(n) ? n : e$29.CUSTOM) {
|
|
14176
|
+
case e$29.COLOR:
|
|
14069
14177
|
Object.keys(r).forEach((e) => {
|
|
14070
14178
|
let t = r[e];
|
|
14071
14179
|
i.default.push(`--${e}:${t.default};`), t.light && i.light.push(`--${e}:${t.light};`), t.dark && i.dark.push(`--${e}:${t.dark};`);
|
|
14072
14180
|
});
|
|
14073
14181
|
break;
|
|
14074
|
-
case e$
|
|
14075
|
-
case e$
|
|
14076
|
-
case e$
|
|
14182
|
+
case e$29.SPACING:
|
|
14183
|
+
case e$29.SHADOW:
|
|
14184
|
+
case e$29.CUSTOM:
|
|
14077
14185
|
default: Object.keys(r).forEach((e) => {
|
|
14078
14186
|
i.default.push(`--${e}:${r[e]};`);
|
|
14079
14187
|
});
|
|
@@ -14102,7 +14210,7 @@ var m = (e, t, n) => {
|
|
|
14102
14210
|
for (let [l, { default: u, states: d, variants: f }] of Object.entries(e)) {
|
|
14103
14211
|
let e = p$7(l), m = e ? "" : `.${l}`, h = e ? " > &" : " &", g = e ? "*" : m;
|
|
14104
14212
|
u?.length && i.push(y(`:where(${g})${h}`, u, {}, t, n));
|
|
14105
|
-
for (let [e, r] of o$15(d ?? {})) i.push(y(`:where(${m}${u$
|
|
14213
|
+
for (let [e, r] of o$15(d ?? {})) i.push(y(`:where(${m}${u$7(e)})${h}`, r, {}, t, n)), d$6(e) && i.push(v(`:where(${g})${h}`, r, t, n));
|
|
14106
14214
|
let _ = (t, n = "") => e ? [`[data-variant="${t}"]${n}`] : p(m, t, n);
|
|
14107
14215
|
for (let [e, o] of Object.entries(f ?? {})) {
|
|
14108
14216
|
if (o.default.length) {
|
|
@@ -14110,7 +14218,7 @@ var m = (e, t, n) => {
|
|
|
14110
14218
|
i.push(y(`:where(${a})${h}`, o.default, {}, t, n));
|
|
14111
14219
|
}
|
|
14112
14220
|
for (let [l, u] of o$15(o.states ?? {})) {
|
|
14113
|
-
let a = _(e, u$
|
|
14221
|
+
let a = _(e, u$7(l)).join(r);
|
|
14114
14222
|
i.push(y(`:where(${a})${h}`, u, {}, t, n)), d$6(l) && i.push(v(`:where(${_(e).join(r)})${h}`, u, t, n));
|
|
14115
14223
|
}
|
|
14116
14224
|
}
|
|
@@ -14119,11 +14227,11 @@ var m = (e, t, n) => {
|
|
|
14119
14227
|
};
|
|
14120
14228
|
var h = (e, t, n) => Object.entries(e).flatMap(([e, { default: r, states: o }]) => {
|
|
14121
14229
|
let l = r$17(e), u = r.length ? [y(`&${l}`, r, {}, t, n)] : [];
|
|
14122
|
-
for (let [e, r] of o$15(o ?? {})) u.push(y(`&${u$
|
|
14230
|
+
for (let [e, r] of o$15(o ?? {})) u.push(y(`&${u$7(e)}${l}`, r, {}, t, n)), d$6(e) && u.push(v(`&${l}`, r, t, n));
|
|
14123
14231
|
return u;
|
|
14124
14232
|
});
|
|
14125
14233
|
var g = (e, t, n, i) => Object.entries(t).flatMap(([t, { default: a, states: o, pseudos: s }]) => {
|
|
14126
|
-
let c = u$
|
|
14234
|
+
let c = u$9(t);
|
|
14127
14235
|
if (!c) return [];
|
|
14128
14236
|
let l = _(e, a, {
|
|
14129
14237
|
states: o,
|
|
@@ -14133,7 +14241,7 @@ var g = (e, t, n, i) => Object.entries(t).flatMap(([t, { default: a, states: o,
|
|
|
14133
14241
|
});
|
|
14134
14242
|
var _ = (e, t, n, r = !0, i = l$1) => {
|
|
14135
14243
|
let { states: o, variants: d, ancestors: f, pseudos: p, conditions: _ } = n, b = r ? t.join("") : t.map((e) => `${u(i + l$1)}${e}`).join("\n").replaceAll(":", ": "), x = o ? o$15(o).flatMap(([e, t]) => {
|
|
14136
|
-
let n = y(`&${u$
|
|
14244
|
+
let n = y(`&${u$7(e)}`, t, {}, r, i + l$1);
|
|
14137
14245
|
return d$6(e) ? [n, v("&", t, r, i + l$1)] : [n];
|
|
14138
14246
|
}) : [], S = e.replace("plitzi__", ""), C = d ? Object.entries(d).map(([e, t]) => y(`&[data-variant="${e}"]${r ? "," : ", "}&${S}--${e}`, t.default, {
|
|
14139
14247
|
states: t.states,
|
|
@@ -14188,9 +14296,9 @@ var o$2 = (e, t = ":root", n = 2, r = !0) => {
|
|
|
14188
14296
|
};
|
|
14189
14297
|
//#endregion
|
|
14190
14298
|
//#region ../sdk-style/dist/StyleHelper.mjs
|
|
14191
|
-
var s$1 = Object.fromEntries(e$
|
|
14299
|
+
var s$1 = Object.fromEntries(e$30.map((e) => [e, t$26(e)]));
|
|
14192
14300
|
var c = (e) => {
|
|
14193
|
-
if (t$25(e)) return e$
|
|
14301
|
+
if (t$25(e)) return e$31[e];
|
|
14194
14302
|
let t = e.match(/(\d*\.?\d+)(px|rem)/);
|
|
14195
14303
|
if (!t) return 0;
|
|
14196
14304
|
let r = parseFloat(t[1]);
|
|
@@ -15043,7 +15151,7 @@ var byProperty = (rules) => {
|
|
|
15043
15151
|
return responsive;
|
|
15044
15152
|
};
|
|
15045
15153
|
/** The states a selector can react to — the closed list the style editor offers, read from where it is declared. */
|
|
15046
|
-
var STYLE_STATES = e$
|
|
15154
|
+
var STYLE_STATES = e$26;
|
|
15047
15155
|
var STYLE_STATE_SET = new Set(STYLE_STATES);
|
|
15048
15156
|
var RULE_SET_KEYS = /* @__PURE__ */ new Set([
|
|
15049
15157
|
"css",
|
|
@@ -15107,11 +15215,11 @@ var assertPseudo = (pseudo, part) => {
|
|
|
15107
15215
|
const ruleSets = partRuleSets(part);
|
|
15108
15216
|
for (const rules of ruleSets) for (const [property, value] of Object.entries(rules)) {
|
|
15109
15217
|
if (property === "content") {
|
|
15110
|
-
if (!i$
|
|
15218
|
+
if (!i$17.includes(pseudo)) throw new AuthoringError("style-pseudo-content", `\`content\` on \`::${pseudo}\` draws nothing: only ${i$17.map((name) => `\`::${name}\``).join(", ")} take one.`);
|
|
15111
15219
|
if (!m$4(String(value))) throw new AuthoringError("style-pseudo-content", `\`content: ${String(value)}\` on \`::${pseudo}\` is not text CSS can read, so nothing is drawn. Text goes in quotes inside the string — \`content: '"${String(value).replace(/"/g, "\\\"")}"'\` — and an empty box is \`'""'\`; \`counter()\`, \`attr()\` and \`url()\` are written as they are.`);
|
|
15112
15220
|
continue;
|
|
15113
15221
|
}
|
|
15114
|
-
if (!u$
|
|
15222
|
+
if (!u$8(pseudo, property)) throw new AuthoringError("style-pseudo-property", `\`${property}\` on \`::${pseudo}\` is dropped by every browser — \`::${pseudo}\` honours ${(l$8[pseudo] ?? []).map((name) => `\`${name}\``).join(", ")}. Style the element itself for the rest.`);
|
|
15115
15223
|
}
|
|
15116
15224
|
if (a$14.includes(pseudo) && !ruleSets.some((rules) => Object.hasOwn(rules, "content"))) throw new AuthoringError("style-pseudo-content", `\`::${pseudo}\` has no \`content\`, so the browser draws nothing for it. Give it one — \`content: '""'\` for an empty box — in its rules or in a state's.`);
|
|
15117
15225
|
};
|
|
@@ -15119,7 +15227,7 @@ var toPseudos = (pseudos) => {
|
|
|
15119
15227
|
const parts = /* @__PURE__ */ new Map();
|
|
15120
15228
|
for (const [name, spec] of Object.entries(pseudos ?? {})) {
|
|
15121
15229
|
const bare = name.replace(/^:+/, "");
|
|
15122
|
-
if (!n$19(name)) throw new AuthoringError("style-pseudo-unknown", `Unknown pseudo-element "${name}"${n$19(bare) ? ` — write it without the colons, "${bare}"` : didYouMean(bare, e$
|
|
15230
|
+
if (!n$19(name)) throw new AuthoringError("style-pseudo-unknown", `Unknown pseudo-element "${name}"${n$19(bare) ? ` — write it without the colons, "${bare}"` : didYouMean(bare, e$27)}. A class dresses ${e$27.join(", ")}.`);
|
|
15123
15231
|
const part = partOf(spec);
|
|
15124
15232
|
const rules = {
|
|
15125
15233
|
base: toResponsive(part.css),
|
|
@@ -17026,7 +17134,7 @@ var declarationsIn = (body) => splitTopLevel(body, ";").flatMap((declaration) =>
|
|
|
17026
17134
|
//#region src/decompile/customCss.ts
|
|
17027
17135
|
var STATE_SET$1 = new Set(STYLE_STATES.filter((state) => state !== "hidden"));
|
|
17028
17136
|
/** The states a selector writes as something other than their name — `:first-child`, `:nth-child(odd)`, `current`. */
|
|
17029
|
-
var WRITTEN_STATES = [...STATE_SET$1].filter((state) => u$
|
|
17137
|
+
var WRITTEN_STATES = [...STATE_SET$1].filter((state) => u$7(state) !== `:${state}`);
|
|
17030
17138
|
/**
|
|
17031
17139
|
* The `current` state as a selector writes it: the whole of it, as the style compiler does, or one of the attributes it
|
|
17032
17140
|
* stands for — `[aria-current='page']` on a nav link, `[aria-pressed='true']` on a toggle, `[aria-selected='true']` on a
|
|
@@ -17037,7 +17145,7 @@ var CURRENT_ATTRIBUTES = /\[aria-current=(["'])page\1\]|\[aria-(?:pressed|select
|
|
|
17037
17145
|
/** The `expanded` state in either quotes: `[aria-expanded='true']`. */
|
|
17038
17146
|
var EXPANDED_ATTRIBUTE = /\[aria-expanded=(["'])true\1\]/g;
|
|
17039
17147
|
/** Every way of writing a state, written as the state it is (`:first`, `:current`), so one pattern reads every state. */
|
|
17040
|
-
var asStateNames = (selector) => WRITTEN_STATES.reduce((written, state) => written.replaceAll(u$
|
|
17148
|
+
var asStateNames = (selector) => WRITTEN_STATES.reduce((written, state) => written.replaceAll(u$7(state), `:${state}`), selector).replaceAll(CURRENT_ATTRIBUTES, ":current").replaceAll(EXPANDED_ATTRIBUTE, ":expanded");
|
|
17041
17149
|
var isStyleState$1 = (state) => STATE_SET$1.has(state);
|
|
17042
17150
|
var STATE_THEN_PSEUDO = /^(?::([a-z-]+))?(?:::([a-z-]+))?$/;
|
|
17043
17151
|
/**
|
|
@@ -17117,7 +17225,7 @@ var declarationsOf = (body) => {
|
|
|
17117
17225
|
* there, and a `content` CSS can read. A rule that does not is left in `customCss`, where it was written and does exactly
|
|
17118
17226
|
* what it did.
|
|
17119
17227
|
*/
|
|
17120
|
-
var pseudoHolds = (pseudo, rules) => Object.entries(rules).every(([property, value]) => property === "content" ? i$
|
|
17228
|
+
var pseudoHolds = (pseudo, rules) => Object.entries(rules).every(([property, value]) => property === "content" ? i$17.includes(pseudo) && m$4(String(value)) : u$8(pseudo, property));
|
|
17121
17229
|
/** Where a pseudo-element's rules land, its state aside: the class, the pseudo-element and the condition. */
|
|
17122
17230
|
var pseudoKey = ({ className, pseudo, condition }) => `${className}::${pseudo ?? ""}@${condition ?? ""}`;
|
|
17123
17231
|
/**
|
|
@@ -17618,14 +17726,15 @@ var keyframesIn = (segments, found) => {
|
|
|
17618
17726
|
}
|
|
17619
17727
|
return found;
|
|
17620
17728
|
};
|
|
17621
|
-
var animationUseOf = (declarations, keyframes) => {
|
|
17729
|
+
var animationUseOf = (declarations, keyframes, at) => {
|
|
17622
17730
|
const names = declarations.filter(([property]) => ANIMATION_NAMES.has(property)).flatMap(([, value]) => value.split(/[\s,]+/).filter((word) => keyframes.has(word)));
|
|
17623
17731
|
if (names.length === 0) return;
|
|
17624
17732
|
const says = (longhand, word) => declarations.some(([property, value]) => (property === longhand || property === "animation") && word.test(value));
|
|
17625
17733
|
return {
|
|
17626
17734
|
names,
|
|
17627
17735
|
infinite: says("animation-iteration-count", INFINITE),
|
|
17628
|
-
paused: says("animation-play-state", PAUSED)
|
|
17736
|
+
paused: says("animation-play-state", PAUSED),
|
|
17737
|
+
...at
|
|
17629
17738
|
};
|
|
17630
17739
|
};
|
|
17631
17740
|
/** The animations `customCss` starts, and whether it lets paused ones run once the page is hydrated. */
|
|
@@ -17643,7 +17752,10 @@ var cssUsesIn = (segments, keyframes) => {
|
|
|
17643
17752
|
}
|
|
17644
17753
|
if (segment.kind !== "rule") continue;
|
|
17645
17754
|
const declarations = declarationsIn(segment.body);
|
|
17646
|
-
const use = animationUseOf(declarations, keyframes
|
|
17755
|
+
const use = animationUseOf(declarations, keyframes, {
|
|
17756
|
+
where: `the \`customCss\` rule \`${segment.selector}\``,
|
|
17757
|
+
selector: segment.selector
|
|
17758
|
+
});
|
|
17647
17759
|
if (use) uses.push(use);
|
|
17648
17760
|
if (segment.selector.includes("[data-hydrated]") && declarations.some(([property, value]) => property === "animation-play-state" && RUNNING.test(value))) hydratedGate = true;
|
|
17649
17761
|
}
|
|
@@ -17652,16 +17764,26 @@ var cssUsesIn = (segments, keyframes) => {
|
|
|
17652
17764
|
hydratedGate
|
|
17653
17765
|
};
|
|
17654
17766
|
};
|
|
17655
|
-
/** Every rule set of a selector
|
|
17656
|
-
var ruleSetsOf = (layer) => [
|
|
17657
|
-
...layer.default ? [layer.default] : [],
|
|
17658
|
-
...Object.
|
|
17659
|
-
...Object.
|
|
17660
|
-
...Object.
|
|
17767
|
+
/** Every rule set of a selector — its own, its states', its variants' and its ancestors' — with what it is. */
|
|
17768
|
+
var ruleSetsOf = (layer, within = "") => [
|
|
17769
|
+
...layer.default ? [[within, layer.default]] : [],
|
|
17770
|
+
...Object.entries(layer.states ?? {}).map(([state, rules]) => [`${within}, state \`${state}\``, rules]),
|
|
17771
|
+
...Object.entries(layer.variants ?? {}).flatMap(([variant, rules]) => ruleSetsOf(rules, `${within}, variant \`${variant}\``)),
|
|
17772
|
+
...Object.entries(layer.ancestors ?? {}).flatMap(([ancestor, rules]) => ruleSetsOf(rules, `${within}, inside \`${ancestor}\``))
|
|
17661
17773
|
];
|
|
17662
17774
|
/** The animations the style schema starts — its classes, ids and element styles, at every breakpoint. */
|
|
17663
|
-
var styleUsesIn = (style, keyframes) => Object.values(style.platform).flatMap((items) => Object.values(items)).flatMap((item) => Object.
|
|
17664
|
-
|
|
17775
|
+
var styleUsesIn = (style, keyframes) => Object.values(style.platform).flatMap((items) => Object.values(items)).flatMap((item) => Object.entries(item.attributes).flatMap(([slot, layer]) => ruleSetsOf(layer).map(([within, rules]) => ({
|
|
17776
|
+
item,
|
|
17777
|
+
slot,
|
|
17778
|
+
within,
|
|
17779
|
+
rules
|
|
17780
|
+
})))).flatMap(({ item, slot, within, rules }) => {
|
|
17781
|
+
const isClass = item.type === "class";
|
|
17782
|
+
const owner = isClass ? `the class \`${item.name}\`` : `the ${item.type} \`${item.name}\``;
|
|
17783
|
+
const use = animationUseOf(Object.entries(rules).map(([property, value]) => [property, String(value)]), keyframes, {
|
|
17784
|
+
where: `${owner}${slot === "base" ? "" : `, slot \`${slot}\``}${within}`,
|
|
17785
|
+
...isClass && slot === "base" ? { selector: `.${item.name}` } : {}
|
|
17786
|
+
});
|
|
17665
17787
|
return use ? [use] : [];
|
|
17666
17788
|
});
|
|
17667
17789
|
var COST_ORDER = [
|
|
@@ -17671,9 +17793,9 @@ var COST_ORDER = [
|
|
|
17671
17793
|
];
|
|
17672
17794
|
/** The way out of each cost, given in `COST_ORDER`. */
|
|
17673
17795
|
var CLAUSES = {
|
|
17674
|
-
layout: "a size or a position is a `transform` (`translate`, `scale`) of an element already at its full size",
|
|
17675
|
-
blur: "a blur or a shadow is drawn once, on a layer whose `opacity` changes",
|
|
17676
|
-
paint:
|
|
17796
|
+
layout: () => "a size or a position is a `transform` (`translate`, `scale`) of an element already at its full size",
|
|
17797
|
+
blur: () => "a blur or a shadow is drawn once, on a layer whose `opacity` changes",
|
|
17798
|
+
paint: (selector) => `a loop that has to animate anything else is decoration — start it \`paused\` where it is declared (\`animation-play-state: paused\`) and run it once the page is hydrated: \`[data-hydrated] ${selector} { animation-play-state: running; }\` in \`customCss\``
|
|
17677
17799
|
};
|
|
17678
17800
|
var suggestMotion = (schema, style) => {
|
|
17679
17801
|
const customCss = schema.settings.customCss;
|
|
@@ -17690,18 +17812,20 @@ var suggestMotion = (schema, style) => {
|
|
|
17690
17812
|
const properties = [...costs].filter(([, cost]) => cost !== "paint" || looping);
|
|
17691
17813
|
return properties.length > 0 ? [{
|
|
17692
17814
|
name,
|
|
17693
|
-
properties
|
|
17815
|
+
properties,
|
|
17816
|
+
named
|
|
17694
17817
|
}] : [];
|
|
17695
17818
|
});
|
|
17696
17819
|
if (heavy.length === 0) return [];
|
|
17697
17820
|
const costs = new Set(heavy.flatMap(({ properties }) => properties.map(([, cost]) => cost)));
|
|
17698
|
-
const listed = heavy.map(({ name, properties }) => `\`${name}\` (${properties.map(([property]) => `\`${property}\``).join(", ")})`);
|
|
17821
|
+
const listed = heavy.map(({ name, properties, named }) => `\`${name}\` (${properties.map(([property]) => `\`${property}\``).join(", ")}) in ${named.map((use) => use.where).join(" and ")}`);
|
|
17822
|
+
const selector = heavy.flatMap(({ named }) => named).find((use) => use.selector !== void 0)?.selector ?? ".your-class";
|
|
17699
17823
|
const one = heavy.length === 1;
|
|
17700
17824
|
return [{
|
|
17701
17825
|
code: "heavy-animation",
|
|
17702
17826
|
elementIds: [],
|
|
17703
17827
|
saves: 0,
|
|
17704
|
-
message: `${String(heavy.length)} animation${one ? "" : "s"}
|
|
17828
|
+
message: `${String(heavy.length)} animation${one ? "" : "s"} ${one ? "animates" : "animate"} what the browser repaints or lays out again on every frame — ${listed.slice(0, 4).join(", ")}${listed.length > 4 ? ", …" : ""} — on the main thread, so ${one ? "it stutters" : "they stutter"} whenever the page's scripts are busy, most of all while it loads. Animate \`opacity\` and \`transform\`: ` + COST_ORDER.filter((cost) => costs.has(cost)).map((cost) => CLAUSES[cost](selector)).join("; ") + "."
|
|
17705
17829
|
}];
|
|
17706
17830
|
};
|
|
17707
17831
|
//#endregion
|
|
@@ -17792,7 +17916,7 @@ var signaturesOf = (flat, declared) => {
|
|
|
17792
17916
|
const wired = /* @__PURE__ */ new Set([
|
|
17793
17917
|
...Object.values(bindings ?? {}).flat().flatMap(({ source }) => own.some((read) => read.source === source) ? [] : [`read:${source}`]),
|
|
17794
17918
|
...Object.values(interactions ?? {}).flatMap((node) => {
|
|
17795
|
-
const key = e$
|
|
17919
|
+
const key = e$33(node.params) ? node.params.key : void 0;
|
|
17796
17920
|
return typeof key === "string" ? [`write:${key}`] : [];
|
|
17797
17921
|
}),
|
|
17798
17922
|
...children.flatMap((child) => child.wiring.split("\n").filter(Boolean))
|
|
@@ -17969,7 +18093,7 @@ var erasedOn = (classes, mode) => {
|
|
|
17969
18093
|
const found = /* @__PURE__ */ new Map();
|
|
17970
18094
|
for (const width of WIDTHS) {
|
|
17971
18095
|
const layers = CASCADE[mode][width];
|
|
17972
|
-
for (const state of [void 0, ...e$
|
|
18096
|
+
for (const state of [void 0, ...e$26]) for (const [longhand, candidates] of candidatesAt(classes, layers, state)) {
|
|
17973
18097
|
const winner = candidates[candidates.length - 1];
|
|
17974
18098
|
if (winner.shorthand === void 0) continue;
|
|
17975
18099
|
for (const lost of candidates) {
|
|
@@ -18726,7 +18850,7 @@ var REPEATING_TYPES = /* @__PURE__ */ new Set(["list", "carouselTrack"]);
|
|
|
18726
18850
|
* one that does — `"store-footer" › container[1] › text[0]` rather than a path of indices from the page down.
|
|
18727
18851
|
*/
|
|
18728
18852
|
var placeOf = (spec, parent, index) => {
|
|
18729
|
-
const record = e$
|
|
18853
|
+
const record = e$33(spec) ? spec : {};
|
|
18730
18854
|
if (typeof record.id === "string") return `"${record.id}"`;
|
|
18731
18855
|
return index === void 0 ? parent : `${parent} › ${typeof record.type === "string" ? record.type : "element"}[${index}]`;
|
|
18732
18856
|
};
|
|
@@ -18766,7 +18890,8 @@ var PAGE_SPEC_FIELDS = {
|
|
|
18766
18890
|
folder: "folder",
|
|
18767
18891
|
accessLevel: "accessLevel",
|
|
18768
18892
|
seoPageTitle: "seoTitle",
|
|
18769
|
-
seoPageDescription: "seoDescription"
|
|
18893
|
+
seoPageDescription: "seoDescription",
|
|
18894
|
+
notFound: "notFound"
|
|
18770
18895
|
};
|
|
18771
18896
|
var layoutAttributes = (layout) => layout ? {
|
|
18772
18897
|
layout: layout.id,
|
|
@@ -18993,9 +19118,9 @@ var SpaceAuthor = class {
|
|
|
18993
19118
|
this.resolveControls();
|
|
18994
19119
|
if (pages.length === 0) throw new AuthoringError("no-pages", "The space has no pages. Write at least one: `pages: [{ id: \"home\", name: \"Home\", slug: \"\", body: [] }]`.");
|
|
18995
19120
|
const style = {
|
|
18996
|
-
...e$
|
|
18997
|
-
mode: this.spec.mode ?? e$
|
|
18998
|
-
theme: this.spec.theme ?? e$
|
|
19121
|
+
...e$35,
|
|
19122
|
+
mode: this.spec.mode ?? e$35.mode,
|
|
19123
|
+
theme: this.spec.theme ?? e$35.theme,
|
|
18999
19124
|
platform: this.platform,
|
|
19000
19125
|
variables: this.spec.variables ?? {},
|
|
19001
19126
|
...this.spec.fonts ? { fonts: this.parseFonts(this.spec.fonts) } : {},
|
|
@@ -19573,7 +19698,8 @@ var SpaceAuthor = class {
|
|
|
19573
19698
|
...page.accessLevel ? { accessLevel: page.accessLevel } : {},
|
|
19574
19699
|
seoEnabled: Boolean(page.seoTitle ?? page.seoDescription),
|
|
19575
19700
|
...page.seoTitle ? { seoPageTitle: page.seoTitle } : {},
|
|
19576
|
-
...page.seoDescription ? { seoPageDescription: page.seoDescription } : {}
|
|
19701
|
+
...page.seoDescription ? { seoPageDescription: page.seoDescription } : {},
|
|
19702
|
+
...page.notFound ? { notFound: page.notFound } : {}
|
|
19577
19703
|
},
|
|
19578
19704
|
definition: {
|
|
19579
19705
|
label: "Page",
|
|
@@ -19845,7 +19971,7 @@ var SpaceAuthor = class {
|
|
|
19845
19971
|
}
|
|
19846
19972
|
/** A format by its name in the space's `formats`, or the template written in its place. */
|
|
19847
19973
|
templateFor(as, where) {
|
|
19848
|
-
if (e$
|
|
19974
|
+
if (e$7(as)) return as;
|
|
19849
19975
|
const formats = this.spec.formats ?? {};
|
|
19850
19976
|
if (!Object.hasOwn(formats, as) || typeof formats[as] !== "string") throw new AuthoringError("format-unknown", `${where} shows its data \`as: '${as}'\`, which the space's \`formats\` do not name${didYouMean(as, Object.keys(formats)) || "."} Declare it once — \`formats: { ${as}: "{{ source|currency('USD') }}" }\` — or write the template in its place.`);
|
|
19851
19977
|
return formats[as];
|
|
@@ -20043,7 +20169,7 @@ var dataWords = (value, depth = 0) => {
|
|
|
20043
20169
|
if (depth > 4) return [];
|
|
20044
20170
|
if (typeof value === "string") return value === "" ? [] : [value];
|
|
20045
20171
|
if (Array.isArray(value)) return value.flatMap((item) => dataWords(item, depth + 1));
|
|
20046
|
-
return e$
|
|
20172
|
+
return e$33(value) ? Object.values(value).flatMap((item) => dataWords(item, depth + 1)) : [];
|
|
20047
20173
|
};
|
|
20048
20174
|
var wordsOf = (element, templates) => {
|
|
20049
20175
|
const instance = element.definition.type === "reference" && element.attributes.referenceType === "component";
|
|
@@ -20523,7 +20649,7 @@ var transformerCatalog = () => Object.entries(BUILTIN_TRANSFORMERS).map(([action
|
|
|
20523
20649
|
/** The space's name and URL, where the document carries them. An older export carries no definition at all. */
|
|
20524
20650
|
var definitionOf = (schema) => {
|
|
20525
20651
|
const definition = schema.definition;
|
|
20526
|
-
if (!e$
|
|
20652
|
+
if (!e$33(definition)) return {};
|
|
20527
20653
|
return {
|
|
20528
20654
|
...typeof definition.name === "string" ? { name: definition.name } : {},
|
|
20529
20655
|
...typeof definition.permanentUrl === "string" ? { permanentUrl: definition.permanentUrl } : {}
|
|
@@ -20537,7 +20663,7 @@ var categoryOf = (variable) => {
|
|
|
20537
20663
|
/** The name an element carried beside its id before the id became the name, where it carries a usable one. */
|
|
20538
20664
|
var idRefOf = (element) => {
|
|
20539
20665
|
const stored = element;
|
|
20540
|
-
if (!e$
|
|
20666
|
+
if (!e$33(stored) || typeof stored.idRef !== "string" || !t$28(stored.idRef)) return;
|
|
20541
20667
|
return stored.idRef;
|
|
20542
20668
|
};
|
|
20543
20669
|
/**
|
|
@@ -20564,7 +20690,7 @@ var withNamedIds = (schema) => {
|
|
|
20564
20690
|
const isTaken = (candidate) => taken.has(candidate);
|
|
20565
20691
|
const renames = stale.map((element) => {
|
|
20566
20692
|
const idRef = idRefOf(element);
|
|
20567
|
-
const to = idRef ? u$
|
|
20693
|
+
const to = idRef ? u$11(idRef, isTaken) : l$10(element.definition.type, isTaken);
|
|
20568
20694
|
taken.add(to);
|
|
20569
20695
|
return {
|
|
20570
20696
|
from: element.id,
|
|
@@ -20638,7 +20764,7 @@ var refuse = (reason) => {
|
|
|
20638
20764
|
throw new Unreadable(reason);
|
|
20639
20765
|
};
|
|
20640
20766
|
var isTriggerType = (value) => TRIGGER_TYPES.some((type) => type === value);
|
|
20641
|
-
var isNode = (value) => e$
|
|
20767
|
+
var isNode = (value) => e$33(value) && [
|
|
20642
20768
|
"id",
|
|
20643
20769
|
"title",
|
|
20644
20770
|
"type",
|
|
@@ -20646,10 +20772,10 @@ var isNode = (value) => e$32(value) && [
|
|
|
20646
20772
|
"beforeNode",
|
|
20647
20773
|
"afterNode",
|
|
20648
20774
|
"flowId"
|
|
20649
|
-
].every((key) => typeof value[key] === "string") && typeof value.enabled === "boolean" && e$
|
|
20775
|
+
].every((key) => typeof value[key] === "string") && typeof value.enabled === "boolean" && e$33(value.params) && e$33(value.preview);
|
|
20650
20776
|
/** A document with the shape an action has: whether it is the action code writes is what the round trip answers. */
|
|
20651
|
-
var isDocument = (value) => e$
|
|
20652
|
-
var isField = (value) => e$
|
|
20777
|
+
var isDocument = (value) => e$33(value) && typeof value.name === "string" && e$33(value.nodes) && Object.values(value.nodes).every(isNode);
|
|
20778
|
+
var isField = (value) => e$33(value) && FIELD_TYPES.some((type) => type === value.type);
|
|
20653
20779
|
var text = (params, key) => {
|
|
20654
20780
|
const value = params[key];
|
|
20655
20781
|
return typeof value === "string" ? value : void 0;
|
|
@@ -20666,7 +20792,7 @@ var inputOf = (node) => {
|
|
|
20666
20792
|
const raw = text(node.params, "input");
|
|
20667
20793
|
if (raw === void 0) return;
|
|
20668
20794
|
const value = parsed(raw);
|
|
20669
|
-
if (!e$
|
|
20795
|
+
if (!e$33(value) || !Object.values(value).every(isField)) return refuse(`the trigger "${node.id}" declares an input that is not a map of fields`);
|
|
20670
20796
|
return Object.fromEntries(Object.entries(value).filter((entry) => isField(entry[1])));
|
|
20671
20797
|
};
|
|
20672
20798
|
var accessOf = (node) => {
|
|
@@ -20779,7 +20905,7 @@ var chainFrom = (nodes, first) => {
|
|
|
20779
20905
|
/** A value with its keys in one order and its JSON params read, so two documents compare by what they hold. */
|
|
20780
20906
|
var comparable = (value) => {
|
|
20781
20907
|
if (Array.isArray(value)) return value.map(comparable);
|
|
20782
|
-
if (!e$
|
|
20908
|
+
if (!e$33(value)) return value;
|
|
20783
20909
|
return Object.fromEntries(Object.keys(value).filter((key) => value[key] !== void 0).sort().map((key) => {
|
|
20784
20910
|
const inner = value[key];
|
|
20785
20911
|
return [key, key === "input" && typeof inner === "string" ? parsed(inner) ?? inner : comparable(inner)];
|
|
@@ -20808,7 +20934,7 @@ var read = (entry) => {
|
|
|
20808
20934
|
const passthrough = passthroughOf(ways);
|
|
20809
20935
|
const steps = chain.slice(1, answerAt).map((node) => stepOf(node, passthrough));
|
|
20810
20936
|
const handler = chain.at(answerAt + 1);
|
|
20811
|
-
if (handler && handler.action !== "flow.onFailure") return refuse(`"${handler.id}" runs after the answer, where only ${e$
|
|
20937
|
+
if (handler && handler.action !== "flow.onFailure") return refuse(`"${handler.id}" runs after the answer, where only ${e$14} may`);
|
|
20812
20938
|
const undo = chain.slice(answerAt + 2);
|
|
20813
20939
|
const last = steps.at(-1);
|
|
20814
20940
|
const values = text(answer.params, "values");
|
|
@@ -20879,8 +21005,8 @@ var actionToSource = (spec, { packageName = "@plitzi/sdk-authoring" } = {}) => {
|
|
|
20879
21005
|
var canonical = (value) => {
|
|
20880
21006
|
if (value === void 0 || value === null) return null;
|
|
20881
21007
|
if (Array.isArray(value)) return value.map(canonical);
|
|
20882
|
-
if (e$
|
|
20883
|
-
const entries = Object.entries(value).map(([key, inner]) => [key, canonical(inner)]).filter(([, inner]) => inner !== null && !(e$
|
|
21008
|
+
if (e$33(value)) {
|
|
21009
|
+
const entries = Object.entries(value).map(([key, inner]) => [key, canonical(inner)]).filter(([, inner]) => inner !== null && !(e$33(inner) && Object.keys(inner).length === 0)).sort(([a], [b]) => a.localeCompare(b));
|
|
20884
21010
|
return Object.fromEntries(entries);
|
|
20885
21011
|
}
|
|
20886
21012
|
if (typeof value === "boolean" || typeof value === "number" || typeof value === "string") return value;
|
|
@@ -20969,12 +21095,12 @@ var classRules = (style, name) => {
|
|
|
20969
21095
|
};
|
|
20970
21096
|
var bindingsOf$1 = (element) => {
|
|
20971
21097
|
const stored = element.definition.bindings;
|
|
20972
|
-
if (!e$
|
|
20973
|
-
return Object.fromEntries(Object.entries(stored).map(([category, list]) => [category, (Array.isArray(list) ? list : []).filter(e$
|
|
21098
|
+
if (!e$33(stored)) return {};
|
|
21099
|
+
return Object.fromEntries(Object.entries(stored).map(([category, list]) => [category, (Array.isArray(list) ? list : []).filter(e$33).map((binding) => ({
|
|
20974
21100
|
source: binding.source,
|
|
20975
21101
|
to: binding.to,
|
|
20976
21102
|
transformers: Array.isArray(binding.transformers) ? binding.transformers : [],
|
|
20977
|
-
when: e$
|
|
21103
|
+
when: e$33(binding.when) && Array.isArray(binding.when.rules) && binding.when.rules.length > 0 ? binding.when : null,
|
|
20978
21104
|
enabled: binding.enabled !== false
|
|
20979
21105
|
})).map((binding) => JSON.stringify(canonical(binding))).sort()]));
|
|
20980
21106
|
};
|
|
@@ -20993,7 +21119,7 @@ var flowsOf = (element) => {
|
|
|
20993
21119
|
params: current.params,
|
|
20994
21120
|
preview: current.preview,
|
|
20995
21121
|
elementId: current.elementId === element.id ? "self" : current.elementId || null,
|
|
20996
|
-
when: e$
|
|
21122
|
+
when: e$33(current.when) && Array.isArray(current.when.rules) && current.when.rules.length > 0 ? current.when : null,
|
|
20997
21123
|
enabled: current.enabled,
|
|
20998
21124
|
whileRunning: current.whileRunning ?? "skip"
|
|
20999
21125
|
});
|
|
@@ -21017,7 +21143,7 @@ var PAGE_UNSET = {
|
|
|
21017
21143
|
var attributesOf = (element) => {
|
|
21018
21144
|
const isPage = element.definition.type === "page";
|
|
21019
21145
|
const defaults = isPage ? {} : defaultAttributes(element.definition.type);
|
|
21020
|
-
const stored = Object.entries(e$
|
|
21146
|
+
const stored = Object.entries(e$33(element.attributes) ? element.attributes : {}).filter(([key, value]) => value !== null && !(Array.isArray(value) && value.length === 0 && e$33(defaults[key])));
|
|
21021
21147
|
return Object.fromEntries(Object.entries({
|
|
21022
21148
|
...defaults,
|
|
21023
21149
|
...Object.fromEntries(stored)
|
|
@@ -21468,7 +21594,7 @@ var unwritableCss = (selector, unwritable, mode) => {
|
|
|
21468
21594
|
platform[breakpoint][selector.name] = item;
|
|
21469
21595
|
}
|
|
21470
21596
|
return l({
|
|
21471
|
-
...e$
|
|
21597
|
+
...e$35,
|
|
21472
21598
|
mode,
|
|
21473
21599
|
platform,
|
|
21474
21600
|
variables: {}
|
|
@@ -21531,6 +21657,7 @@ var PAGE_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
21531
21657
|
"seoEnabled",
|
|
21532
21658
|
"seoPageTitle",
|
|
21533
21659
|
"seoPageDescription",
|
|
21660
|
+
"notFound",
|
|
21534
21661
|
"enabled"
|
|
21535
21662
|
]);
|
|
21536
21663
|
var LAYOUT_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
@@ -21591,9 +21718,9 @@ var BINDING_CATEGORIES = [
|
|
|
21591
21718
|
"style"
|
|
21592
21719
|
];
|
|
21593
21720
|
var isEmpty = (value) => !value || Object.keys(value).length === 0;
|
|
21594
|
-
var isBinding = (value) => e$
|
|
21721
|
+
var isBinding = (value) => e$33(value) && typeof value.source === "string" && typeof value.to === "string";
|
|
21595
21722
|
/** A condition worth keeping: the builder stores "no condition" as an empty group, or as an empty array. */
|
|
21596
|
-
var conditionOf = (when) => e$
|
|
21723
|
+
var conditionOf = (when) => e$33(when) && Array.isArray(when.rules) && when.rules.length > 0 ? when : void 0;
|
|
21597
21724
|
/**
|
|
21598
21725
|
* Every name a document mentions outside its own structure — in attributes, bindings, steps and settings.
|
|
21599
21726
|
*
|
|
@@ -21616,7 +21743,7 @@ var stepCorpus = (host, interactions) => Object.values(interactions).map((node)
|
|
|
21616
21743
|
...node.elementId && node.elementId !== host ? { elementId: node.elementId } : {}
|
|
21617
21744
|
}));
|
|
21618
21745
|
var bindingsOf = (bindings, category) => {
|
|
21619
|
-
const list = e$
|
|
21746
|
+
const list = e$33(bindings) ? bindings[category] : void 0;
|
|
21620
21747
|
return Array.isArray(list) ? list.filter(isBinding) : [];
|
|
21621
21748
|
};
|
|
21622
21749
|
var bindingCorpus = (bindings) => BINDING_CATEGORIES.flatMap((category) => bindingsOf(bindings, category).map(({ source, to, transformers, when }) => ({
|
|
@@ -22215,7 +22342,7 @@ var SpecReader = class {
|
|
|
22215
22342
|
}
|
|
22216
22343
|
readPage(page, index) {
|
|
22217
22344
|
this.reachable.add(page.id);
|
|
22218
|
-
const attributes = e$
|
|
22345
|
+
const attributes = e$33(page.attributes) ? page.attributes : {};
|
|
22219
22346
|
const where = `Page "${page.id}"`;
|
|
22220
22347
|
for (const key of Object.keys(attributes)) if (!PAGE_ATTRIBUTES.has(key)) this.dropField(`page attribute "${key}"`);
|
|
22221
22348
|
if (attributes.enabled === false) this.correct("dropped-field", `${where} was disabled, which an authored page cannot say; it is authored enabled.`, page.id);
|
|
@@ -22226,6 +22353,7 @@ var SpecReader = class {
|
|
|
22226
22353
|
const redirect = attributes.unauthorizedBehaviour === "redirect" && typeof attributes.unauthorizedPageRedirect === "string" ? attributes.unauthorizedPageRedirect : void 0;
|
|
22227
22354
|
const seoTitle = typeof attributes.seoPageTitle === "string" ? attributes.seoPageTitle : "";
|
|
22228
22355
|
const seoDescription = typeof attributes.seoPageDescription === "string" ? attributes.seoPageDescription : "";
|
|
22356
|
+
const notFound = typeof attributes.notFound === "string" ? attributes.notFound : "";
|
|
22229
22357
|
if (BINDING_CATEGORIES.some((category) => bindingsOf(page.definition.bindings, category).length > 0)) this.correct("dropped-field", `${where} had bindings of its own, which a page cannot declare.`, page.id);
|
|
22230
22358
|
return {
|
|
22231
22359
|
id: page.id,
|
|
@@ -22234,6 +22362,7 @@ var SpecReader = class {
|
|
|
22234
22362
|
...isDefault ? { isDefault: true } : index === 0 ? { isDefault: false } : {},
|
|
22235
22363
|
...seoTitle ? { seoTitle } : {},
|
|
22236
22364
|
...seoDescription ? { seoDescription } : {},
|
|
22365
|
+
...notFound ? { notFound } : {},
|
|
22237
22366
|
...folder ? { folder } : {},
|
|
22238
22367
|
...layout ? { layout } : {},
|
|
22239
22368
|
...accessLevel ? { accessLevel } : {},
|
|
@@ -22281,7 +22410,7 @@ var SpecReader = class {
|
|
|
22281
22410
|
const definition = element.definition;
|
|
22282
22411
|
for (const key of Object.keys(definition)) if (!DEFINITION_FIELDS.has(key)) this.dropField(`"${key}"`);
|
|
22283
22412
|
const { type, legacy } = this.typeOf(element);
|
|
22284
|
-
const stored = e$
|
|
22413
|
+
const stored = e$33(element.attributes) ? element.attributes : {};
|
|
22285
22414
|
const attributes = this.readAttributes(type, legacy ? legacy.attributes(stored) : stored, this.placedNames(element));
|
|
22286
22415
|
const keepId = this.options.keepIds === true || !this.derived.has(element.id);
|
|
22287
22416
|
const { base: baseSelector, ...slotSelectors } = definition.styleSelectors;
|
|
@@ -22353,7 +22482,7 @@ var SpecReader = class {
|
|
|
22353
22482
|
this.droppedAttributes.set(key, (this.droppedAttributes.get(key) ?? 0) + 1);
|
|
22354
22483
|
continue;
|
|
22355
22484
|
}
|
|
22356
|
-
const emptyList = Array.isArray(value) && value.length === 0 && e$
|
|
22485
|
+
const emptyList = Array.isArray(value) && value.length === 0 && e$33(defaults[name]);
|
|
22357
22486
|
if (value === null || emptyList) continue;
|
|
22358
22487
|
if (typeof value === "string" && fixes && Object.hasOwn(fixes, name) && Object.hasOwn(fixes[name], value)) {
|
|
22359
22488
|
const fixed = fixes[name][value];
|
|
@@ -22515,11 +22644,13 @@ var SpecReader = class {
|
|
|
22515
22644
|
*
|
|
22516
22645
|
* Both are what an older builder leaves behind — an animation step from before animations were removed, a submit
|
|
22517
22646
|
* flow on a button — and authoring refuses both, so they are dropped here and reported rather than written into a
|
|
22518
|
-
* spec that could not be authored again. Only built-in types are judged: a plugin's registers what nobody here sees
|
|
22647
|
+
* spec that could not be authored again. Only built-in types are judged: a plugin's registers what nobody here sees —
|
|
22648
|
+
* and so does a `custom` host, whose triggers and callbacks are the component it renders, never `custom`'s own.
|
|
22519
22649
|
*/
|
|
22520
22650
|
liveSteps(chain, element) {
|
|
22521
22651
|
const typeOf = (id) => {
|
|
22522
22652
|
const type = this.flat[id]?.definition.type;
|
|
22653
|
+
if (type === "custom") return;
|
|
22523
22654
|
return type && Object.hasOwn(LEGACY_ELEMENT_TYPES, type) ? LEGACY_ELEMENT_TYPES[type].type : type;
|
|
22524
22655
|
};
|
|
22525
22656
|
const offers = (catalog, id, action) => {
|
|
@@ -23154,7 +23285,7 @@ var builderOf = (action, type) => {
|
|
|
23154
23285
|
return builders.has(named) ? named : void 0;
|
|
23155
23286
|
};
|
|
23156
23287
|
var definitionIn = (catalog, name) => Object.hasOwn(catalog, name) ? catalog[name] : void 0;
|
|
23157
|
-
var triggerDefinition = (name) => definitionIn(e$
|
|
23288
|
+
var triggerDefinition = (name) => definitionIn(e$41, name) ?? definitionIn(typeTriggerDefinitions, name);
|
|
23158
23289
|
/** The attributes each type is authored with; `null` for one that takes any, which is said by its defaults. */
|
|
23159
23290
|
var attributeNames = elementAttributeNames;
|
|
23160
23291
|
var explainElement = (type) => {
|
|
@@ -23184,7 +23315,7 @@ var explainElement = (type) => {
|
|
|
23184
23315
|
var explainTrigger = (name) => {
|
|
23185
23316
|
const definition = triggerDefinition(name);
|
|
23186
23317
|
if (!definition) return;
|
|
23187
|
-
const basic = Object.hasOwn(e$
|
|
23318
|
+
const basic = Object.hasOwn(e$41, name);
|
|
23188
23319
|
return {
|
|
23189
23320
|
kind: "trigger",
|
|
23190
23321
|
name,
|
|
@@ -23288,7 +23419,7 @@ var explainList = (kind) => {
|
|
|
23288
23419
|
name,
|
|
23289
23420
|
summary: element.label
|
|
23290
23421
|
})));
|
|
23291
|
-
case "trigger": return sorted([.../* @__PURE__ */ new Set([...Object.keys(e$
|
|
23422
|
+
case "trigger": return sorted([.../* @__PURE__ */ new Set([...Object.keys(e$41), ...Object.keys(typeTriggerDefinitions)])].map((name) => ({
|
|
23292
23423
|
name,
|
|
23293
23424
|
summary: triggerDefinition(name)?.title ?? name
|
|
23294
23425
|
})));
|
|
@@ -25880,9 +26011,48 @@ function probePage(input) {
|
|
|
25880
26011
|
}
|
|
25881
26012
|
const illegible = [];
|
|
25882
26013
|
if (input.legibility) {
|
|
26014
|
+
/**
|
|
26015
|
+
* A computed colour as `[r, g, b, alpha]`, 0–255 and 0–1 — or `null` for one this cannot read, which is then not
|
|
26016
|
+
* judged rather than judged wrong. The browser answers in the space the colour was written in: `rgb()` for a hex or
|
|
26017
|
+
* a name, `color(srgb …)` for a `color-mix()`, `oklch()`/`oklab()` as written. Read as `rgb()`, the last two came out
|
|
26018
|
+
* near black, and a page every visitor could read was said to be unreadable.
|
|
26019
|
+
*/
|
|
25883
26020
|
const parse = (value) => {
|
|
25884
|
-
const
|
|
25885
|
-
|
|
26021
|
+
const numbers = (value.match(/-?[\d.]+(?:e-?\d+)?%?/g) ?? []).map((part) => part.endsWith("%") ? Number(part.slice(0, -1)) / 100 : Number(part));
|
|
26022
|
+
const alpha = (at) => numbers.length > at ? numbers[at] : 1;
|
|
26023
|
+
const gamma = (linear) => 255 * Math.min(1, Math.max(0, linear <= .0031308 ? 12.92 * linear : 1.055 * linear ** (1 / 2.4) - .055));
|
|
26024
|
+
const fromOklab = (l, a, b, opacity) => {
|
|
26025
|
+
const [lc, mc, sc] = [
|
|
26026
|
+
(l + .3963377774 * a + .2158037573 * b) ** 3,
|
|
26027
|
+
(l - .1055613458 * a - .0638541728 * b) ** 3,
|
|
26028
|
+
(l - .0894841775 * a - 1.291485548 * b) ** 3
|
|
26029
|
+
];
|
|
26030
|
+
return [
|
|
26031
|
+
gamma(4.0767416621 * lc - 3.3077115913 * mc + .2309699292 * sc),
|
|
26032
|
+
gamma(-1.2684380046 * lc + 2.6097574011 * mc - .3413193965 * sc),
|
|
26033
|
+
gamma(-.0041960863 * lc - .7034186147 * mc + 1.707614701 * sc),
|
|
26034
|
+
opacity
|
|
26035
|
+
];
|
|
26036
|
+
};
|
|
26037
|
+
if (numbers.length < 3) return null;
|
|
26038
|
+
if (value.startsWith("rgb")) return [
|
|
26039
|
+
numbers[0],
|
|
26040
|
+
numbers[1],
|
|
26041
|
+
numbers[2],
|
|
26042
|
+
alpha(3)
|
|
26043
|
+
];
|
|
26044
|
+
if (value.startsWith("color(srgb ")) return [
|
|
26045
|
+
numbers[0] * 255,
|
|
26046
|
+
numbers[1] * 255,
|
|
26047
|
+
numbers[2] * 255,
|
|
26048
|
+
alpha(3)
|
|
26049
|
+
];
|
|
26050
|
+
if (value.startsWith("oklab(")) return fromOklab(numbers[0], numbers[1], numbers[2], alpha(3));
|
|
26051
|
+
if (value.startsWith("oklch(")) {
|
|
26052
|
+
const hue = numbers[2] * Math.PI / 180;
|
|
26053
|
+
return fromOklab(numbers[0], numbers[1] * Math.cos(hue), numbers[1] * Math.sin(hue), alpha(3));
|
|
26054
|
+
}
|
|
26055
|
+
return null;
|
|
25886
26056
|
};
|
|
25887
26057
|
/**
|
|
25888
26058
|
* What is PAINTED under a point of the text, composited — or `null` when that cannot be known.
|
|
@@ -25932,17 +26102,52 @@ function probePage(input) {
|
|
|
25932
26102
|
255
|
|
25933
26103
|
]);
|
|
25934
26104
|
};
|
|
25935
|
-
|
|
25936
|
-
|
|
25937
|
-
|
|
26105
|
+
/** WCAG's relative luminance of a colour, and the contrast between two: 1 is the same colour, 21 black on white. */
|
|
26106
|
+
const luminance = (colour) => {
|
|
26107
|
+
const [r, g, b] = colour.slice(0, 3).map((value) => {
|
|
26108
|
+
const channel = value / 255;
|
|
26109
|
+
return channel <= .03928 ? channel / 12.92 : ((channel + .055) / 1.055) ** 2.4;
|
|
26110
|
+
});
|
|
26111
|
+
return .2126 * r + .7152 * g + .0722 * b;
|
|
26112
|
+
};
|
|
26113
|
+
const contrastOf = (one, other) => {
|
|
26114
|
+
const [light, dark] = [luminance(one), luminance(other)].sort((a, b) => b - a);
|
|
26115
|
+
return (light + .05) / (dark + .05);
|
|
26116
|
+
};
|
|
26117
|
+
/**
|
|
26118
|
+
* Below this nobody reads it — far under what WCAG asks of body text (4.5:1), so a muted caption is not a finding;
|
|
26119
|
+
* text this close to what is behind it is a colour that was meant for the other theme.
|
|
26120
|
+
*/
|
|
26121
|
+
const MIN_CONTRAST = 2;
|
|
26122
|
+
/**
|
|
26123
|
+
* Every element that draws words of its own on the space's page: the space's elements, and whatever a plugin draws
|
|
26124
|
+
* inside one of them — the part of a page that is often the most read, with colours of its own. Words hidden from a
|
|
26125
|
+
* screen reader (`aria-hidden`) are a decoration, and an SVG's are painted with `fill`, not `color`.
|
|
26126
|
+
*/
|
|
26127
|
+
const writers = /* @__PURE__ */ new Set();
|
|
26128
|
+
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
|
|
26129
|
+
for (let text = walker.nextNode(); text; text = walker.nextNode()) {
|
|
26130
|
+
const parent = text.parentElement;
|
|
26131
|
+
if (parent && text.textContent?.trim() && parent.closest("[data-plitzi-el]") && !parent.closest("svg, script, style, noscript, [aria-hidden=\"true\"]")) writers.add(parent);
|
|
26132
|
+
}
|
|
26133
|
+
for (const node of writers) {
|
|
26134
|
+
if (!isVisible(node)) continue;
|
|
26135
|
+
const words = [...node.childNodes].filter((child) => child.nodeType === Node.TEXT_NODE).map((child) => child.textContent ?? "").join(" ").trim();
|
|
25938
26136
|
const ink = parse(getComputedStyle(node).color);
|
|
25939
26137
|
const paper = ink ? behind(node) : null;
|
|
25940
26138
|
if (!ink || !paper) continue;
|
|
25941
|
-
const
|
|
25942
|
-
|
|
26139
|
+
const contrast = contrastOf([
|
|
26140
|
+
0,
|
|
26141
|
+
1,
|
|
26142
|
+
2
|
|
26143
|
+
].map((channel) => ink[channel] * ink[3] + paper[channel] * (1 - ink[3])), paper);
|
|
26144
|
+
if (contrast < MIN_CONTRAST) {
|
|
25943
26145
|
const elementId = elementIdOf(node);
|
|
26146
|
+
const host = node.closest("[data-plitzi-el]");
|
|
26147
|
+
const name = node.hasAttribute("data-plitzi-el") || !host ? nameOf(node) : `${nameOf(host)} › ${nameOf(node)}`;
|
|
25944
26148
|
illegible.push({
|
|
25945
|
-
text: `${
|
|
26149
|
+
text: `${name}: "${words.slice(0, 40)}"`,
|
|
26150
|
+
contrast: Math.round(contrast * 100) / 100,
|
|
25946
26151
|
...elementId === void 0 ? {} : { elementId }
|
|
25947
26152
|
});
|
|
25948
26153
|
}
|
|
@@ -26001,9 +26206,9 @@ var issuesOf = (expected, findings) => {
|
|
|
26001
26206
|
message: `${named(id)} is cut off at the edge of the screen by ${String(pixels)}px — an ancestor hides what spills past it, so nothing scrolls to it: let the row wrap, or give it room`,
|
|
26002
26207
|
elementId: id
|
|
26003
26208
|
})),
|
|
26004
|
-
...findings.illegible.map(({ text, elementId }) => ({
|
|
26209
|
+
...findings.illegible.map(({ text, contrast, elementId }) => ({
|
|
26005
26210
|
code: "illegible-text",
|
|
26006
|
-
message: `text
|
|
26211
|
+
message: `text that cannot be told from what is behind it — contrast ${String(contrast)}:1, where body text asks 4.5:1: ${text}. A colour meant for one theme, painted in the other, is the usual cause: read the space's tokens (\`var(--…)\`), never a fixed colour`,
|
|
26007
26212
|
...about(elementId)
|
|
26008
26213
|
}))
|
|
26009
26214
|
];
|
|
@@ -26920,4 +27125,4 @@ var validateSnippet = (snippet, options = {}) => validateSnippet$1(snippet, {
|
|
|
26920
27125
|
...options
|
|
26921
27126
|
});
|
|
26922
27127
|
//#endregion
|
|
26923
|
-
export { GLOBAL_CALLBACK_BUILDERS as $, AUTHORING_CODES as $i, setState as $n, container as $r, isCssProperty as $t, unrollPage as A, defaultLabel as Ai, whenFailed as An, onScroll as Ar, className as At, blankSpace as B, groupBindings as Bi, authLogout as Bn, setFieldValue as Br, css as Bt, pageTexts as C, c$19 as Ca, tabContainerHeader as Ci, authoringCodesTable as Cn, onFlowError as Cr, unusedDeclarations as Ct, pageRegions as D, t$62 as Da, video as Di, flowStepIds as Dn, onLoad as Dr, column as Dt, diffPictures as E, s$23 as Ea, themeToggle as Ei, authorFlows as En, onKey as Er, tw as Et, readDevTools as F, GLOBAL_SOURCES as Fi, getUtility as Fn, reloadApi as Fr, modifierClassName as Ft, space as G, variantFrom as Gi, cycleState as Gn, e$
|
|
27128
|
+
export { GLOBAL_CALLBACK_BUILDERS as $, AUTHORING_CODES as $i, setState as $n, container as $r, isCssProperty as $t, unrollPage as A, defaultLabel as Ai, whenFailed as An, onScroll as Ar, className as At, blankSpace as B, groupBindings as Bi, authLogout as Bn, setFieldValue as Br, css as Bt, pageTexts as C, c$19 as Ca, tabContainerHeader as Ci, authoringCodesTable as Cn, onFlowError as Cr, unusedDeclarations as Ct, pageRegions as D, t$62 as Da, video as Di, flowStepIds as Dn, onLoad as Dr, column as Dt, diffPictures as E, s$23 as Ea, themeToggle as Ei, authorFlows as En, onKey as Er, tw as Et, readDevTools as F, GLOBAL_SOURCES as Fi, getUtility as Fn, reloadApi as Fr, modifierClassName as Ft, space as G, variantFrom as Gi, cycleState as Gn, e$33 as Gr, cssShorthands as Gt, catalogTemplateFiles as H, hiddenWhen as Hi, cancelServerAction as Hn, updateElement as Hr, sameBlocks as Ht, readDevToolsInPage as I, activeOn as Ii, SET_STATE_TYPES as In, resetForm as Ir, splitClassList as It, importSlug as J, actionSource as Ji, invalidateQueries as Jn, blockJsx as Jr, expandShorthandTraced as Jt, space$1 as K, visibleWhen as Ki, delay as Kn, apiContainer as Kr, expandShorthand as Kt, dataIssues as L, activeWhen as Li, addNotification as Ln, scrollBy as Lr, styles as Lt, inspectPage as M, element as Mi, whileRunning as Mn, openDialog as Mr, classRefs as Mt, onScreen as N, inferredLinkMode as Ni, BUILTIN_UTILITIES as Nn, openModal as Nr, isClassModifier as Nt, profilePictures as O, component as Oi, named$2 as On, onPageLoad as Or, grid as Ot, failedFlowText as P, COMPONENT_SOURCES as Pi, applyUtility as Pn, publishOn as Pr, isStyleDeclaration as Pt, EXPLAIN_KINDS as Q, scope as Qi, runServerAction as Qn, channel as Qr, cssPropertyName as Qt, answerAction as R, authorBinding as Ri, appendState as Rn, scrollIntoView as Rr, BREAKPOINTS$1 as Rt, compareTexts as S, s$21 as Sa, tabContainerBody as Si, flagSpecOf as Sn, onFlowEnd as Sr, suggestClassOverrides as St, comparePictures as T, r$35 as Ta, text$1 as Ti, authorFlow as Tn, onInterval as Tr, createTw as Tt, emptyTemplateFiles as U, resolveSource as Ui, clearState as Un, elementsFromManifest as Ur, toBlocks as Ut, blankTemplateFiles as V, hasVisibilityBinding as Vi, authRefreshDetails as Vn, toggleElement as Vr, isRuleSetSpec as Vt, toPortableSource as W, toBindingSpecs as Wi, copyToClipboard as Wn, withPluginCatalogs as Wr, toResponsive as Wt, importProbe as X, twig as Xi, navigate as Xn, carousel as Xr, cssNumberValue as Xt, importedFiles as Y, source as Yi, moveState as Yn, button$1 as Yr, shorthandLonghands as Yt, BUILDER_NAMES as Z, closest as Zi, removeState as Zn, carouselTrack as Zr, cssProperties as Zt, shortcutKey as _, t$60 as _a, paragraph as _i, instanceSelectorFor as _n, closeModal as _r, assertSnippetValid as _t, locateClasses as a, elementCallbacks as aa, fontAwesome as ai, notificationsCss as an, BUILTIN_GLOBAL_CALLBACKS as ar, SPACE_FIELDS as at, summariseRenders as b, i$27 as ba, svg as bi, selectorFor as bn, on as br, suggestSpace as bt, validateSnippet as c, elementLeafTypes as ca, heading as ci, i$2 as cn, e$16 as cr, specFromSpace as ct, i as d, elementSourceTypes as da, list$1 as di, r$4 as dn, carouselGoTo as dr, actionToSource as dt, AuthoringError as ea, custom$1 as ei, isCustomProperty as en, stepState as er, explain as et, o as f, elementTriggers as fa, listItem as fi, t$6 as fn, carouselNext as fr, withNamedIds as ft, pressShortcut as g, e$40 as ga, pagination as gi, buildHandles as gn, closeDialog as gr, transformerCatalog as gt, withElement as h, typeTriggerDefinitions as ha, nodeHtml as hi, slugify as hn, carouselPrevious as hr, suggestTransformer as ht, lintSpace as i, elementAttributeValues as ia, embed as ii, pageFamily as in, webHook as ir, ELEMENT_FIELDS as it, inspectDocument as j, defineElement as ji, whenSucceeded as jn, onSubmit as jr, classNames as jt, loadImages as k, defaultAttributes as ki, when as kn, onPointerDown as kr, row as kt, validateSpace as l, elementPartTypes as la, image as li, FIXABLE_CODES as ln, announceOn as lr, compareSpaces as lt, singlePageSpace as m, typeCallbackDefinitions as ma, modalContainer as mi, digest as mn, carouselPlay as mr, getTransformer as mt, authorSpace as n, isSuggestionCode as na, dropdown as ni, SpaceRefusedError as nn, toggleState as nr, explainList as nt, locateElements as o, elementCatalog as oa, form as oi, withNotificationsCss as on, applyBuiltinCallback as or, specToSource as ot, compactSvg as p, elementTypeNames as pa, markdown as pi, e$9 as pn, carouselPause as pr, BUILTIN_TRANSFORMERS as pt, darkScheme as q, withVisibility as qi, hostAction as qn, blockHtml as qr, expandShorthandPatch as qt, fixSpace as r, elementAncestorTypes as ra, dropdownPopup as ri, refusalOf as rn, twigTemplate as rr, explanationText as rt, planFixes as s, elementDefaultAttributes as sa, formControl as si, d$2 as sn, getGlobalCallback as sr, SCHEMA_SETTINGS as st, authorSnippet as t, authoringCodeEntry as ta, dialogContainer as ti, suggestCssProperty as tn, toggleInState as tr, explainKindOf as tt, a as u, elementSlots as ua, link as ui, n$6 as un, cancelApi as ur, actionSpecFromEntry as ut, openPage as v, elementAttributeNames as va, reference as vi, locate as vn, declaredCallback as vr, PAGE_SPEC_FIELDS as vt, alignPictures as w, n$45 as wa, tabContainerItem as wi, defineAction as wn, onFlowProgress as wr, tokens as wt, PAGE_TEXT_LIMIT as x, o$24 as xa, tabContainer as xi, flagGateOf as xn, onClick as xr, withoutQuieted as xt, inspectRenders as y, a$22 as ya, richText as yi, pathForSlug as yn, declaredTrigger as yr, assertSpaceValid as yt, CATALOG_TEMPLATE_IDENTITY as z, bindTemplate as zi, authLogin as zn, scrollTo as zr, STYLE_STATES as zt };
|