@plitzi/sdk-authoring 0.38.2 → 0.38.3
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 +124 -0
- package/dist/index-compactSvg.js +13 -0
- package/dist/index.d.ts +162 -6
- package/dist/index.js +1410 -1020
- package/dist/node.d.ts +21 -0
- package/dist/node.js +35 -0
- package/package.json +14 -6
- package/skills/plitzi-authoring/CHEATSHEET.md +5 -3
- package/skills/plitzi-authoring/SKILL.md +1 -0
- package/skills/plitzi-authoring/recipes/carousel.ts +14 -9
- package/skills/plitzi-authoring/recipes/detail-page.ts +10 -6
- package/skills/plitzi-authoring/recipes/every-few-seconds.ts +13 -8
- package/skills/plitzi-authoring/recipes/filter-a-list.ts +2 -2
- package/skills/plitzi-authoring/recipes/forms-and-modals.ts +1 -2
- package/skills/plitzi-authoring/recipes/from-tailwind.ts +1 -1
- package/skills/plitzi-authoring/recipes/link-to-a-section.ts +2 -2
- package/skills/plitzi-authoring/recipes/link-with-data.ts +12 -7
- package/skills/plitzi-authoring/recipes/marquee.ts +2 -2
- package/skills/plitzi-authoring/recipes/scroll-a-row.ts +5 -6
- package/skills/plitzi-authoring/recipes/show-data.ts +12 -7
- package/skills/plitzi-authoring/recipes/typed-data.ts +9 -6
- package/skills/plitzi-authoring/recipes/usable-without-sight.ts +2 -2
- package/skills/plitzi-authoring/reference/accessibility.md +2 -2
- package/skills/plitzi-authoring/reference/authoring-errors.md +5 -0
- package/skills/plitzi-authoring/reference/colours-and-motion.md +3 -0
- package/skills/plitzi-authoring/reference/components.md +2 -1
- package/skills/plitzi-authoring/reference/drawing.md +22 -0
- package/skills/plitzi-authoring/reference/elements-and-styles.md +2 -2
- package/skills/plitzi-authoring/reference/lists.md +11 -6
- package/skills/plitzi-authoring/reference/plugins.md +5 -0
- package/skills/plitzi-authoring/reference/structure.md +1 -1
- package/skills/plitzi-authoring/reference/testing.md +9 -4
- package/skills/plitzi-authoring/reference/typed-sources.md +1 -1
- package/skills/plitzi-authoring/reference/validation.md +3 -2
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as compactSvg } from "./index-compactSvg.js";
|
|
1
2
|
//#region \0rolldown/runtime.js
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -12,16 +13,16 @@ var __exportAll = (all, no_symbols) => {
|
|
|
12
13
|
//#endregion
|
|
13
14
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs
|
|
14
15
|
var e$37 = "[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*";
|
|
15
|
-
var t$
|
|
16
|
-
var n$
|
|
17
|
-
var r$
|
|
18
|
-
var i$24 = `\\{\\{\\s*${r$
|
|
19
|
-
var a$20 = `(?:${`\\{\\{\\{\\s*${r$
|
|
16
|
+
var t$58 = `(?:${e$37}|\\d+)`;
|
|
17
|
+
var n$42 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$37}(?:\\.${t$58})*)\\s*\\]`;
|
|
18
|
+
var r$29 = `${`${e$37}(?:${n$42})*(?:\\??\\.${t$58}(?:${n$42})*)*`}(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`;
|
|
19
|
+
var i$24 = `\\{\\{\\s*${r$29}\\s*\\}\\}`;
|
|
20
|
+
var a$20 = `(?:${`\\{\\{\\{\\s*${r$29}\\s*\\}\\}\\}`}|${i$24})`;
|
|
20
21
|
var o$22 = new RegExp(a$20, "g");
|
|
21
22
|
var s$18 = RegExp(`^${a$20}$`);
|
|
22
23
|
//#endregion
|
|
23
24
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/hasValidToken.mjs
|
|
24
|
-
var n$
|
|
25
|
+
var n$41 = (n, r = !1) => {
|
|
25
26
|
if (typeof n != "string") return !1;
|
|
26
27
|
let i = r ? s$18 : o$22;
|
|
27
28
|
return i.lastIndex = 0, i.test(n.trim());
|
|
@@ -38,12 +39,12 @@ var n = (e, t, n) => {
|
|
|
38
39
|
for (let [i, a] of Object.entries(n)) a.required && e[i] === void 0 && (!a.when || a.when(t)) && r.push(i);
|
|
39
40
|
return r;
|
|
40
41
|
};
|
|
41
|
-
var r$
|
|
42
|
-
var i$23 = (t) => typeof t == "string" && n$
|
|
42
|
+
var r$28 = (e) => e.trim() !== "" && Number.isFinite(Number(e));
|
|
43
|
+
var i$23 = (t) => typeof t == "string" && n$41(t);
|
|
43
44
|
var a$19 = (e, t) => {
|
|
44
45
|
switch (t.type) {
|
|
45
46
|
case "boolean": return typeof e == "boolean";
|
|
46
|
-
case "number": return typeof e == "number" || typeof e == "string" && r$
|
|
47
|
+
case "number": return typeof e == "number" || typeof e == "string" && r$28(e);
|
|
47
48
|
case "select": return typeof e == "string" && (!t.options || t.options.includes(e));
|
|
48
49
|
case "scalar": return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
49
50
|
case "json": return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "object" && !!e;
|
|
@@ -75,7 +76,7 @@ var s$1 = (e, t, n) => {
|
|
|
75
76
|
//#endregion
|
|
76
77
|
//#region ../sdk-shared/dist/helpers/scroll.mjs
|
|
77
78
|
var e$36 = ["smooth", "auto"];
|
|
78
|
-
var t$
|
|
79
|
+
var t$57 = [
|
|
79
80
|
"start",
|
|
80
81
|
"center",
|
|
81
82
|
"end",
|
|
@@ -84,7 +85,7 @@ var t$56 = [
|
|
|
84
85
|
var s$17 = "onScroll";
|
|
85
86
|
//#endregion
|
|
86
87
|
//#region ../sdk-shared/dist/authoring/elementCallbacks.mjs
|
|
87
|
-
var r$
|
|
88
|
+
var r$27 = {
|
|
88
89
|
type: "select",
|
|
89
90
|
description: "How it moves: \"smooth\" glides there, \"auto\" jumps.",
|
|
90
91
|
default: "smooth",
|
|
@@ -106,7 +107,7 @@ var i$1 = {
|
|
|
106
107
|
description: "How far down, the same way; negative goes up.",
|
|
107
108
|
default: ""
|
|
108
109
|
},
|
|
109
|
-
behavior: r$
|
|
110
|
+
behavior: r$27
|
|
110
111
|
}
|
|
111
112
|
},
|
|
112
113
|
scrollTo: {
|
|
@@ -124,7 +125,7 @@ var i$1 = {
|
|
|
124
125
|
description: "Where down, the same way. Empty stays.",
|
|
125
126
|
default: ""
|
|
126
127
|
},
|
|
127
|
-
behavior: r$
|
|
128
|
+
behavior: r$27
|
|
128
129
|
}
|
|
129
130
|
},
|
|
130
131
|
scrollIntoView: {
|
|
@@ -136,15 +137,15 @@ var i$1 = {
|
|
|
136
137
|
type: "select",
|
|
137
138
|
description: "Where the element lands, top to bottom.",
|
|
138
139
|
default: "start",
|
|
139
|
-
options: [...t$
|
|
140
|
+
options: [...t$57]
|
|
140
141
|
},
|
|
141
142
|
inline: {
|
|
142
143
|
type: "select",
|
|
143
144
|
description: "Where it lands, side to side.",
|
|
144
145
|
default: "nearest",
|
|
145
|
-
options: [...t$
|
|
146
|
+
options: [...t$57]
|
|
146
147
|
},
|
|
147
|
-
behavior: r$
|
|
148
|
+
behavior: r$27
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
151
|
};
|
|
@@ -902,7 +903,7 @@ var e$1 = () => (e) => e;
|
|
|
902
903
|
var t = () => (e) => e;
|
|
903
904
|
//#endregion
|
|
904
905
|
//#region ../sdk-elements/dist/elements/advanced/BlockHtml/declaration.mjs
|
|
905
|
-
var t$
|
|
906
|
+
var t$56 = t()({
|
|
906
907
|
type: "blockHtml",
|
|
907
908
|
content: {
|
|
908
909
|
attributes: { content: "" },
|
|
@@ -942,7 +943,7 @@ var t$55 = t()({
|
|
|
942
943
|
});
|
|
943
944
|
//#endregion
|
|
944
945
|
//#region ../sdk-elements/dist/elements/advanced/BlockJsx/declaration.mjs
|
|
945
|
-
var t$
|
|
946
|
+
var t$55 = t()({
|
|
946
947
|
type: "blockJsx",
|
|
947
948
|
content: {
|
|
948
949
|
attributes: {
|
|
@@ -987,7 +988,7 @@ var t$54 = t()({
|
|
|
987
988
|
});
|
|
988
989
|
//#endregion
|
|
989
990
|
//#region ../sdk-elements/dist/elements/advanced/Custom/declaration.mjs
|
|
990
|
-
var t$
|
|
991
|
+
var t$54 = t()({
|
|
991
992
|
type: "custom",
|
|
992
993
|
content: {
|
|
993
994
|
attributes: {
|
|
@@ -1033,7 +1034,7 @@ var t$53 = t()({
|
|
|
1033
1034
|
});
|
|
1034
1035
|
//#endregion
|
|
1035
1036
|
//#region ../sdk-elements/dist/elements/advanced/NodeHtml/declaration.mjs
|
|
1036
|
-
var t$
|
|
1037
|
+
var t$53 = t()({
|
|
1037
1038
|
type: "nodeHtml",
|
|
1038
1039
|
content: {
|
|
1039
1040
|
attributes: { subType: "div" },
|
|
@@ -1079,7 +1080,7 @@ var t$52 = t()({
|
|
|
1079
1080
|
});
|
|
1080
1081
|
//#endregion
|
|
1081
1082
|
//#region ../sdk-elements/dist/elements/advanced/Reference/declaration.mjs
|
|
1082
|
-
var t$
|
|
1083
|
+
var t$52 = t()({
|
|
1083
1084
|
type: "reference",
|
|
1084
1085
|
content: {
|
|
1085
1086
|
attributes: {
|
|
@@ -1123,7 +1124,7 @@ var t$51 = t()({
|
|
|
1123
1124
|
});
|
|
1124
1125
|
//#endregion
|
|
1125
1126
|
//#region ../sdk-elements/dist/elements/basic/Button/declaration.mjs
|
|
1126
|
-
var n$
|
|
1127
|
+
var n$40 = t()({
|
|
1127
1128
|
type: "button",
|
|
1128
1129
|
attributeValues: {
|
|
1129
1130
|
subType: e$1()([
|
|
@@ -1236,7 +1237,7 @@ var n$39 = t()({
|
|
|
1236
1237
|
});
|
|
1237
1238
|
//#endregion
|
|
1238
1239
|
//#region ../sdk-elements/dist/elements/basic/Dropdown/declaration.mjs
|
|
1239
|
-
var n$
|
|
1240
|
+
var n$39 = t()({
|
|
1240
1241
|
type: "dropdown",
|
|
1241
1242
|
attributeValues: { popupPlacement: e$1()([
|
|
1242
1243
|
"left",
|
|
@@ -1310,7 +1311,7 @@ var n$38 = t()({
|
|
|
1310
1311
|
});
|
|
1311
1312
|
//#endregion
|
|
1312
1313
|
//#region ../sdk-elements/dist/elements/basic/Dropdown/DropdownPopup/declaration.mjs
|
|
1313
|
-
var t$
|
|
1314
|
+
var t$51 = t()({
|
|
1314
1315
|
type: "dropdownPopup",
|
|
1315
1316
|
ancestorType: "dropdown",
|
|
1316
1317
|
content: {
|
|
@@ -1369,7 +1370,7 @@ var t$50 = t()({
|
|
|
1369
1370
|
});
|
|
1370
1371
|
//#endregion
|
|
1371
1372
|
//#region ../sdk-elements/dist/elements/basic/Heading/declaration.mjs
|
|
1372
|
-
var n$
|
|
1373
|
+
var n$38 = t()({
|
|
1373
1374
|
type: "heading",
|
|
1374
1375
|
attributeValues: { subType: e$1()([
|
|
1375
1376
|
"h1",
|
|
@@ -1488,7 +1489,7 @@ var n$37 = t()({
|
|
|
1488
1489
|
});
|
|
1489
1490
|
//#endregion
|
|
1490
1491
|
//#region ../sdk-elements/dist/elements/basic/Link/declaration.mjs
|
|
1491
|
-
var n$
|
|
1492
|
+
var n$37 = t()({
|
|
1492
1493
|
type: "link",
|
|
1493
1494
|
attributeValues: {
|
|
1494
1495
|
mode: e$1()([
|
|
@@ -1561,7 +1562,7 @@ var n$36 = t()({
|
|
|
1561
1562
|
});
|
|
1562
1563
|
//#endregion
|
|
1563
1564
|
//#region ../sdk-elements/dist/elements/basic/Markdown/declaration.mjs
|
|
1564
|
-
var t$
|
|
1565
|
+
var t$50 = t()({
|
|
1565
1566
|
type: "markdown",
|
|
1566
1567
|
content: {
|
|
1567
1568
|
attributes: { content: "Markdown" },
|
|
@@ -1604,7 +1605,7 @@ var t$49 = t()({
|
|
|
1604
1605
|
});
|
|
1605
1606
|
//#endregion
|
|
1606
1607
|
//#region ../sdk-elements/dist/elements/basic/Paragraph/declaration.mjs
|
|
1607
|
-
var t$
|
|
1608
|
+
var t$49 = t()({
|
|
1608
1609
|
type: "paragraph",
|
|
1609
1610
|
content: {
|
|
1610
1611
|
attributes: { content: "Paragraph" },
|
|
@@ -1647,7 +1648,7 @@ var t$48 = t()({
|
|
|
1647
1648
|
});
|
|
1648
1649
|
//#endregion
|
|
1649
1650
|
//#region ../sdk-elements/dist/elements/basic/RichText/declaration.mjs
|
|
1650
|
-
var n$
|
|
1651
|
+
var n$36 = t()({
|
|
1651
1652
|
type: "richText",
|
|
1652
1653
|
attributeValues: { format: e$1()([
|
|
1653
1654
|
"html",
|
|
@@ -1698,7 +1699,7 @@ var n$35 = t()({
|
|
|
1698
1699
|
});
|
|
1699
1700
|
//#endregion
|
|
1700
1701
|
//#region ../sdk-elements/dist/elements/basic/Text/declaration.mjs
|
|
1701
|
-
var t$
|
|
1702
|
+
var t$48 = t()({
|
|
1702
1703
|
type: "text",
|
|
1703
1704
|
content: {
|
|
1704
1705
|
attributes: { content: "Text" },
|
|
@@ -1742,7 +1743,7 @@ var t$47 = t()({
|
|
|
1742
1743
|
});
|
|
1743
1744
|
//#endregion
|
|
1744
1745
|
//#region ../sdk-elements/dist/elements/basic/ThemeToggle/declaration.mjs
|
|
1745
|
-
var n$
|
|
1746
|
+
var n$35 = t()({
|
|
1746
1747
|
type: "themeToggle",
|
|
1747
1748
|
attributeValues: { subType: e$1()(["switch", "segmented"]) },
|
|
1748
1749
|
triggers: { onThemeChange: {
|
|
@@ -1806,7 +1807,7 @@ var n$34 = t()({
|
|
|
1806
1807
|
});
|
|
1807
1808
|
//#endregion
|
|
1808
1809
|
//#region ../sdk-elements/dist/elements/form/Form/declaration.mjs
|
|
1809
|
-
var n$
|
|
1810
|
+
var n$34 = t()({
|
|
1810
1811
|
type: "form",
|
|
1811
1812
|
attributeValues: { method: e$1()(["get", "post"]) },
|
|
1812
1813
|
sourceType: "apiContainer",
|
|
@@ -1910,7 +1911,7 @@ var n$33 = t()({
|
|
|
1910
1911
|
});
|
|
1911
1912
|
//#endregion
|
|
1912
1913
|
//#region ../sdk-elements/dist/elements/form/FormControl/declaration.mjs
|
|
1913
|
-
var n$
|
|
1914
|
+
var n$33 = {
|
|
1914
1915
|
width: "100%",
|
|
1915
1916
|
display: "flex",
|
|
1916
1917
|
"align-items": "center",
|
|
@@ -1940,7 +1941,7 @@ var n$32 = {
|
|
|
1940
1941
|
outline: "none",
|
|
1941
1942
|
position: "relative"
|
|
1942
1943
|
};
|
|
1943
|
-
var r$
|
|
1944
|
+
var r$26 = {
|
|
1944
1945
|
display: "flex",
|
|
1945
1946
|
cursor: "pointer",
|
|
1946
1947
|
"font-weight": "600",
|
|
@@ -1950,7 +1951,7 @@ var r$25 = {
|
|
|
1950
1951
|
"user-select": "none"
|
|
1951
1952
|
};
|
|
1952
1953
|
var i$22 = {
|
|
1953
|
-
...r$
|
|
1954
|
+
...r$26,
|
|
1954
1955
|
"margin-bottom": "4px"
|
|
1955
1956
|
};
|
|
1956
1957
|
var a$18 = {
|
|
@@ -2059,7 +2060,7 @@ var o$21 = t()({
|
|
|
2059
2060
|
displayMode: "desktop",
|
|
2060
2061
|
style: {
|
|
2061
2062
|
base: { default: {} },
|
|
2062
|
-
input: { default: n$
|
|
2063
|
+
input: { default: n$33 },
|
|
2063
2064
|
label: { default: i$22 },
|
|
2064
2065
|
error: { default: a$18 }
|
|
2065
2066
|
}
|
|
@@ -2069,7 +2070,7 @@ var o$21 = t()({
|
|
|
2069
2070
|
displayMode: "desktop",
|
|
2070
2071
|
style: {
|
|
2071
2072
|
base: { default: {} },
|
|
2072
|
-
input: { default: n$
|
|
2073
|
+
input: { default: n$33 },
|
|
2073
2074
|
label: { default: i$22 },
|
|
2074
2075
|
error: { default: a$18 }
|
|
2075
2076
|
}
|
|
@@ -2079,7 +2080,7 @@ var o$21 = t()({
|
|
|
2079
2080
|
displayMode: "desktop",
|
|
2080
2081
|
style: {
|
|
2081
2082
|
base: { default: {} },
|
|
2082
|
-
input: { default: n$
|
|
2083
|
+
input: { default: n$33 },
|
|
2083
2084
|
label: { default: i$22 },
|
|
2084
2085
|
error: { default: a$18 }
|
|
2085
2086
|
}
|
|
@@ -2089,7 +2090,7 @@ var o$21 = t()({
|
|
|
2089
2090
|
displayMode: "desktop",
|
|
2090
2091
|
style: {
|
|
2091
2092
|
base: { default: {} },
|
|
2092
|
-
input: { default: n$
|
|
2093
|
+
input: { default: n$33 },
|
|
2093
2094
|
label: { default: i$22 },
|
|
2094
2095
|
error: { default: a$18 }
|
|
2095
2096
|
}
|
|
@@ -2099,7 +2100,7 @@ var o$21 = t()({
|
|
|
2099
2100
|
displayMode: "desktop",
|
|
2100
2101
|
style: {
|
|
2101
2102
|
base: { default: {} },
|
|
2102
|
-
input: { default: n$
|
|
2103
|
+
input: { default: n$33 },
|
|
2103
2104
|
label: { default: i$22 },
|
|
2104
2105
|
error: { default: a$18 }
|
|
2105
2106
|
}
|
|
@@ -2115,7 +2116,7 @@ var o$21 = t()({
|
|
|
2115
2116
|
"margin-left": "0px",
|
|
2116
2117
|
"margin-right": "4px"
|
|
2117
2118
|
} },
|
|
2118
|
-
label: { default: r$
|
|
2119
|
+
label: { default: r$26 },
|
|
2119
2120
|
error: { default: a$18 }
|
|
2120
2121
|
}
|
|
2121
2122
|
},
|
|
@@ -2125,7 +2126,7 @@ var o$21 = t()({
|
|
|
2125
2126
|
style: {
|
|
2126
2127
|
base: { default: {} },
|
|
2127
2128
|
input: { default: {
|
|
2128
|
-
...n$
|
|
2129
|
+
...n$33,
|
|
2129
2130
|
cursor: "pointer"
|
|
2130
2131
|
} },
|
|
2131
2132
|
label: i$22,
|
|
@@ -2139,7 +2140,7 @@ var o$21 = t()({
|
|
|
2139
2140
|
});
|
|
2140
2141
|
//#endregion
|
|
2141
2142
|
//#region ../sdk-elements/dist/elements/internal/LayoutContainer/declaration.mjs
|
|
2142
|
-
var n$
|
|
2143
|
+
var n$32 = t()({
|
|
2143
2144
|
type: "layoutContainer",
|
|
2144
2145
|
attributeValues: { subType: e$1()([
|
|
2145
2146
|
"div",
|
|
@@ -2193,7 +2194,7 @@ var n$31 = t()({
|
|
|
2193
2194
|
});
|
|
2194
2195
|
//#endregion
|
|
2195
2196
|
//#region ../sdk-elements/dist/elements/internal/Loading/declaration.mjs
|
|
2196
|
-
var t$
|
|
2197
|
+
var t$47 = t()({
|
|
2197
2198
|
type: "loading",
|
|
2198
2199
|
content: {
|
|
2199
2200
|
attributes: {},
|
|
@@ -2233,7 +2234,7 @@ var t$46 = t()({
|
|
|
2233
2234
|
});
|
|
2234
2235
|
//#endregion
|
|
2235
2236
|
//#region ../sdk-elements/dist/elements/internal/NotFound/declaration.mjs
|
|
2236
|
-
var t$
|
|
2237
|
+
var t$46 = t()({
|
|
2237
2238
|
type: "notFound",
|
|
2238
2239
|
content: {
|
|
2239
2240
|
attributes: {},
|
|
@@ -2273,7 +2274,7 @@ var t$45 = t()({
|
|
|
2273
2274
|
});
|
|
2274
2275
|
//#endregion
|
|
2275
2276
|
//#region ../sdk-elements/dist/elements/internal/Page/declaration.mjs
|
|
2276
|
-
var t$
|
|
2277
|
+
var t$45 = t()({
|
|
2277
2278
|
type: "page",
|
|
2278
2279
|
triggers: { onPageLoad: {
|
|
2279
2280
|
action: "onPageLoad",
|
|
@@ -2347,7 +2348,7 @@ var t$44 = t()({
|
|
|
2347
2348
|
});
|
|
2348
2349
|
//#endregion
|
|
2349
2350
|
//#region ../sdk-elements/dist/elements/media/Embed/declaration.mjs
|
|
2350
|
-
var t$
|
|
2351
|
+
var t$44 = t()({
|
|
2351
2352
|
type: "embed",
|
|
2352
2353
|
content: {
|
|
2353
2354
|
attributes: {
|
|
@@ -2399,7 +2400,7 @@ var t$43 = t()({
|
|
|
2399
2400
|
});
|
|
2400
2401
|
//#endregion
|
|
2401
2402
|
//#region ../sdk-elements/dist/elements/media/FontAwesome/declaration.mjs
|
|
2402
|
-
var t$
|
|
2403
|
+
var t$43 = t()({
|
|
2403
2404
|
type: "fontAwesome",
|
|
2404
2405
|
content: {
|
|
2405
2406
|
attributes: {
|
|
@@ -2446,7 +2447,7 @@ var t$42 = t()({
|
|
|
2446
2447
|
});
|
|
2447
2448
|
//#endregion
|
|
2448
2449
|
//#region ../sdk-elements/dist/elements/media/Image/declaration.mjs
|
|
2449
|
-
var n$
|
|
2450
|
+
var n$31 = t()({
|
|
2450
2451
|
type: "image",
|
|
2451
2452
|
attributeValues: {
|
|
2452
2453
|
fetchPriority: e$1()([
|
|
@@ -2508,7 +2509,7 @@ var n$30 = t()({
|
|
|
2508
2509
|
});
|
|
2509
2510
|
//#endregion
|
|
2510
2511
|
//#region ../sdk-elements/dist/elements/media/Svg/declaration.mjs
|
|
2511
|
-
var t$
|
|
2512
|
+
var t$42 = t()({
|
|
2512
2513
|
type: "svg",
|
|
2513
2514
|
content: {
|
|
2514
2515
|
attributes: {
|
|
@@ -2555,7 +2556,7 @@ var t$41 = t()({
|
|
|
2555
2556
|
});
|
|
2556
2557
|
//#endregion
|
|
2557
2558
|
//#region ../sdk-elements/dist/elements/media/Video/declaration.mjs
|
|
2558
|
-
var t$
|
|
2559
|
+
var t$41 = t()({
|
|
2559
2560
|
type: "video",
|
|
2560
2561
|
content: {
|
|
2561
2562
|
attributes: {
|
|
@@ -2605,7 +2606,7 @@ var t$40 = t()({
|
|
|
2605
2606
|
});
|
|
2606
2607
|
//#endregion
|
|
2607
2608
|
//#region ../sdk-elements/dist/elements/provider/ApiContainer/declaration.mjs
|
|
2608
|
-
var n$
|
|
2609
|
+
var n$30 = t()({
|
|
2609
2610
|
type: "apiContainer",
|
|
2610
2611
|
attributeValues: {
|
|
2611
2612
|
subType: e$1()([
|
|
@@ -2774,7 +2775,7 @@ var n$29 = t()({
|
|
|
2774
2775
|
});
|
|
2775
2776
|
//#endregion
|
|
2776
2777
|
//#region ../sdk-elements/dist/elements/provider/Channel/declaration.mjs
|
|
2777
|
-
var n$
|
|
2778
|
+
var n$29 = t()({
|
|
2778
2779
|
type: "channel",
|
|
2779
2780
|
attributeValues: { subType: e$1()([
|
|
2780
2781
|
"",
|
|
@@ -2897,7 +2898,7 @@ var n$28 = t()({
|
|
|
2897
2898
|
});
|
|
2898
2899
|
//#endregion
|
|
2899
2900
|
//#region ../sdk-elements/dist/elements/structure/Carousel/declaration.mjs
|
|
2900
|
-
var t$
|
|
2901
|
+
var t$40 = t()({
|
|
2901
2902
|
type: "carousel",
|
|
2902
2903
|
sourceType: "carousel",
|
|
2903
2904
|
triggers: { onChange: {
|
|
@@ -3001,7 +3002,7 @@ var t$39 = t()({
|
|
|
3001
3002
|
});
|
|
3002
3003
|
//#endregion
|
|
3003
3004
|
//#region ../sdk-elements/dist/elements/structure/Carousel/CarouselTrack/declaration.mjs
|
|
3004
|
-
var t$
|
|
3005
|
+
var t$39 = t()({
|
|
3005
3006
|
type: "carouselTrack",
|
|
3006
3007
|
ancestorType: "carousel",
|
|
3007
3008
|
content: {
|
|
@@ -3043,7 +3044,7 @@ var t$38 = t()({
|
|
|
3043
3044
|
});
|
|
3044
3045
|
//#endregion
|
|
3045
3046
|
//#region ../sdk-elements/dist/elements/structure/Container/declaration.mjs
|
|
3046
|
-
var n$
|
|
3047
|
+
var n$28 = [
|
|
3047
3048
|
"div",
|
|
3048
3049
|
"header",
|
|
3049
3050
|
"footer",
|
|
@@ -3057,13 +3058,13 @@ var n$27 = [
|
|
|
3057
3058
|
//#endregion
|
|
3058
3059
|
//#region ../sdk-elements/dist/elements/declarations/index.mjs
|
|
3059
3060
|
var B = {
|
|
3060
|
-
ApiContainer: n$
|
|
3061
|
-
BlockHtml: t$
|
|
3062
|
-
BlockJsx: t$
|
|
3063
|
-
Button: n$
|
|
3064
|
-
Carousel: t$
|
|
3065
|
-
CarouselTrack: t$
|
|
3066
|
-
Channel: n$
|
|
3061
|
+
ApiContainer: n$30,
|
|
3062
|
+
BlockHtml: t$56,
|
|
3063
|
+
BlockJsx: t$55,
|
|
3064
|
+
Button: n$40,
|
|
3065
|
+
Carousel: t$40,
|
|
3066
|
+
CarouselTrack: t$39,
|
|
3067
|
+
Channel: n$29,
|
|
3067
3068
|
Container: t()({
|
|
3068
3069
|
type: "container",
|
|
3069
3070
|
attributeValues: { subType: e$1()([
|
|
@@ -3127,7 +3128,7 @@ var B = {
|
|
|
3127
3128
|
settings: {}
|
|
3128
3129
|
}
|
|
3129
3130
|
}),
|
|
3130
|
-
Custom: t$
|
|
3131
|
+
Custom: t$54,
|
|
3131
3132
|
DialogContainer: t()({
|
|
3132
3133
|
type: "dialogContainer",
|
|
3133
3134
|
sourceType: "dialogContainer",
|
|
@@ -3315,16 +3316,16 @@ var B = {
|
|
|
3315
3316
|
},
|
|
3316
3317
|
initialItems: ["container"]
|
|
3317
3318
|
}),
|
|
3318
|
-
Dropdown: n$
|
|
3319
|
-
DropdownPopup: t$
|
|
3320
|
-
Embed: t$
|
|
3321
|
-
FontAwesome: t$
|
|
3322
|
-
Form: n$
|
|
3319
|
+
Dropdown: n$39,
|
|
3320
|
+
DropdownPopup: t$51,
|
|
3321
|
+
Embed: t$44,
|
|
3322
|
+
FontAwesome: t$43,
|
|
3323
|
+
Form: n$34,
|
|
3323
3324
|
FormControl: o$21,
|
|
3324
|
-
Heading: n$
|
|
3325
|
-
Image: n$
|
|
3326
|
-
LayoutContainer: n$
|
|
3327
|
-
Link: n$
|
|
3325
|
+
Heading: n$38,
|
|
3326
|
+
Image: n$31,
|
|
3327
|
+
LayoutContainer: n$32,
|
|
3328
|
+
Link: n$37,
|
|
3328
3329
|
List: t()({
|
|
3329
3330
|
type: "list",
|
|
3330
3331
|
attributeValues: {
|
|
@@ -3341,7 +3342,7 @@ var B = {
|
|
|
3341
3342
|
definition: {
|
|
3342
3343
|
label: "List",
|
|
3343
3344
|
type: "list",
|
|
3344
|
-
description: "Repeats a template (its listItem
|
|
3345
|
+
description: "Repeats a template (its row: a listItem, or a container with subType \"li\") once per entry of a data array — the way to render a dynamic collection, as a <ul> (subType \"ol\" for a numbered one). Bind its items to a data source (e.g. an apiContainer response).",
|
|
3345
3346
|
items: [],
|
|
3346
3347
|
bindings: {},
|
|
3347
3348
|
styleSelectors: { base: "" },
|
|
@@ -3437,8 +3438,8 @@ var B = {
|
|
|
3437
3438
|
settings: {}
|
|
3438
3439
|
}
|
|
3439
3440
|
}),
|
|
3440
|
-
Loading: t$
|
|
3441
|
-
Markdown: t$
|
|
3441
|
+
Loading: t$47,
|
|
3442
|
+
Markdown: t$50,
|
|
3442
3443
|
ModalContainer: t()({
|
|
3443
3444
|
type: "modalContainer",
|
|
3444
3445
|
sourceType: "modalContainer",
|
|
@@ -3601,9 +3602,9 @@ var B = {
|
|
|
3601
3602
|
},
|
|
3602
3603
|
initialItems: ["container"]
|
|
3603
3604
|
}),
|
|
3604
|
-
NodeHtml: t$
|
|
3605
|
-
NotFound: t$
|
|
3606
|
-
Page: t$
|
|
3605
|
+
NodeHtml: t$53,
|
|
3606
|
+
NotFound: t$46,
|
|
3607
|
+
Page: t$45,
|
|
3607
3608
|
Pagination: t()({
|
|
3608
3609
|
type: "pagination",
|
|
3609
3610
|
attributeValues: {
|
|
@@ -3669,10 +3670,10 @@ var B = {
|
|
|
3669
3670
|
settings: {}
|
|
3670
3671
|
}
|
|
3671
3672
|
}),
|
|
3672
|
-
Paragraph: t$
|
|
3673
|
-
Reference: t$
|
|
3674
|
-
RichText: n$
|
|
3675
|
-
Svg: t$
|
|
3673
|
+
Paragraph: t$49,
|
|
3674
|
+
Reference: t$52,
|
|
3675
|
+
RichText: n$36,
|
|
3676
|
+
Svg: t$42,
|
|
3676
3677
|
TabContainer: t()({
|
|
3677
3678
|
type: "tabContainer",
|
|
3678
3679
|
content: {
|
|
@@ -3850,9 +3851,9 @@ var B = {
|
|
|
3850
3851
|
settings: {}
|
|
3851
3852
|
}
|
|
3852
3853
|
}),
|
|
3853
|
-
Text: t$
|
|
3854
|
-
ThemeToggle: n$
|
|
3855
|
-
Video: t$
|
|
3854
|
+
Text: t$48,
|
|
3855
|
+
ThemeToggle: n$35,
|
|
3856
|
+
Video: t$41
|
|
3856
3857
|
};
|
|
3857
3858
|
//#endregion
|
|
3858
3859
|
//#region src/elements/catalog.ts
|
|
@@ -4036,6 +4037,16 @@ var AUTHORING_CODES = {
|
|
|
4036
4037
|
means: "a layout `slot` that is not an element inside that layout",
|
|
4037
4038
|
fix: "the id of the element in the shell where the body goes"
|
|
4038
4039
|
},
|
|
4040
|
+
"motion-invalid": {
|
|
4041
|
+
kind: "refused",
|
|
4042
|
+
means: "a `motion` with a preset, a trigger or a timing the page cannot play",
|
|
4043
|
+
fix: "`motion: { enter: 'fade-up', on: 'view' }` — the message lists the presets"
|
|
4044
|
+
},
|
|
4045
|
+
"motion-no-tag": {
|
|
4046
|
+
kind: "refused",
|
|
4047
|
+
means: "a `motion` on an element with no tag of its own — nothing to move",
|
|
4048
|
+
fix: "the motion on what it wraps, or a `subType` on it"
|
|
4049
|
+
},
|
|
4039
4050
|
"anchor-invalid": {
|
|
4040
4051
|
kind: "refused",
|
|
4041
4052
|
means: "an `anchor` or a link's `hash` that is not lowercase letters, digits and `-`",
|
|
@@ -4206,6 +4217,16 @@ var AUTHORING_CODES = {
|
|
|
4206
4217
|
means: "a type no built-in element has",
|
|
4207
4218
|
fix: "the built-in it suggests; a plugin's declaration goes in `authorSpace(space, { plugins: [declaration] })`"
|
|
4208
4219
|
},
|
|
4220
|
+
"plugin-attribute-reserved": {
|
|
4221
|
+
kind: "warned",
|
|
4222
|
+
means: "a plugin attribute named as one of the element’s own fields — a factory never hands it to the plugin",
|
|
4223
|
+
fix: "rename it in the plugin (`variant` → `kind`)"
|
|
4224
|
+
},
|
|
4225
|
+
"unknown-variant": {
|
|
4226
|
+
kind: "warned",
|
|
4227
|
+
means: "a variant no class of the element and no style of its type declares — nothing applies",
|
|
4228
|
+
fix: "declare it (`styles(name, { variants: { … } })`), or name one that is"
|
|
4229
|
+
},
|
|
4209
4230
|
"unknown-attribute": {
|
|
4210
4231
|
kind: "refused",
|
|
4211
4232
|
means: "an attribute the element does not have",
|
|
@@ -4296,6 +4317,11 @@ var AUTHORING_CODES = {
|
|
|
4296
4317
|
means: "a controlled list with nothing to render",
|
|
4297
4318
|
fix: "`items: [ … ]` or `bind: { items: 'provider.data.rows' }`"
|
|
4298
4319
|
},
|
|
4320
|
+
"list-row-not-li": {
|
|
4321
|
+
kind: "warned",
|
|
4322
|
+
means: "a row of a list with `items` that is not an `<li>` — that list is a `<ul>` (or `<ol>`), so the row is a box inside a list, no item to a screen reader",
|
|
4323
|
+
fix: "`container({ subType: 'li' })` — or the component's root one, or a wrapper for a link or a button"
|
|
4324
|
+
},
|
|
4299
4325
|
"list-item-key-missing": {
|
|
4300
4326
|
kind: "warned",
|
|
4301
4327
|
means: "a list's `itemKey` that some of its items lack, or two of them share — the rows fall back to `id`, then position",
|
|
@@ -4973,20 +4999,20 @@ var e$33 = {
|
|
|
4973
4999
|
LowerR: 114,
|
|
4974
5000
|
LowerT: 116
|
|
4975
5001
|
};
|
|
4976
|
-
var t$
|
|
4977
|
-
var n$
|
|
4978
|
-
var r$
|
|
5002
|
+
var t$30 = (t) => t >= 97 && t <= 122 || t >= 65 && t <= 90 || t === e$33.Underscore;
|
|
5003
|
+
var n$25 = (n) => t$30(n) || n >= e$33.Zero && n <= e$33.Nine;
|
|
5004
|
+
var r$24 = (t) => n$25(t) || t === e$33.Minus;
|
|
4979
5005
|
var i$21 = (t) => t >= e$33.Zero && t <= e$33.Nine;
|
|
4980
5006
|
var a$17 = (t) => t === e$33.Space || t === e$33.Tab || t === e$33.Newline || t === e$33.CarriageReturn;
|
|
4981
5007
|
var o$20 = (e) => {
|
|
4982
5008
|
let r = e.length;
|
|
4983
|
-
if (r === 0 || !t$
|
|
4984
|
-
for (let t = 1; t < r; t++) if (!n$
|
|
5009
|
+
if (r === 0 || !t$30(e.charCodeAt(0))) return !1;
|
|
5010
|
+
for (let t = 1; t < r; t++) if (!n$25(e.charCodeAt(t))) return !1;
|
|
4985
5011
|
return !0;
|
|
4986
5012
|
};
|
|
4987
5013
|
var s$16 = (r) => {
|
|
4988
5014
|
let a = r.length;
|
|
4989
|
-
if (a === 0 || !t$
|
|
5015
|
+
if (a === 0 || !t$30(r.charCodeAt(0))) return !1;
|
|
4990
5016
|
let o = !1, s = !1;
|
|
4991
5017
|
for (let c = 1; c < a; c++) {
|
|
4992
5018
|
let a = r.charCodeAt(c);
|
|
@@ -4996,15 +5022,15 @@ var s$16 = (r) => {
|
|
|
4996
5022
|
continue;
|
|
4997
5023
|
}
|
|
4998
5024
|
if (o) {
|
|
4999
|
-
if (s = i$21(a), !s && !t$
|
|
5025
|
+
if (s = i$21(a), !s && !t$30(a)) return !1;
|
|
5000
5026
|
o = !1;
|
|
5001
5027
|
continue;
|
|
5002
5028
|
}
|
|
5003
|
-
if (s ? !i$21(a) : !n$
|
|
5029
|
+
if (s ? !i$21(a) : !n$25(a)) return !1;
|
|
5004
5030
|
}
|
|
5005
5031
|
return !o;
|
|
5006
5032
|
};
|
|
5007
|
-
var c$
|
|
5033
|
+
var c$14 = (e) => o$20(e);
|
|
5008
5034
|
//#endregion
|
|
5009
5035
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Lexer/Lexer.mjs
|
|
5010
5036
|
var e$32 = (e) => {
|
|
@@ -5060,7 +5086,7 @@ var e$32 = (e) => {
|
|
|
5060
5086
|
//#endregion
|
|
5061
5087
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Lexer/types.mjs
|
|
5062
5088
|
var e$31 = (e, t) => t ? `{{{${e}}}}` : `{{${e}}}`;
|
|
5063
|
-
var t$
|
|
5089
|
+
var t$29 = (t) => {
|
|
5064
5090
|
switch (t.type) {
|
|
5065
5091
|
case "text": return t.value;
|
|
5066
5092
|
case "variable": return e$31(t.content, t.raw);
|
|
@@ -5090,7 +5116,7 @@ var o$19 = class {
|
|
|
5090
5116
|
}
|
|
5091
5117
|
scanName() {
|
|
5092
5118
|
let e = this.pos;
|
|
5093
|
-
if (!this.eof() && t$
|
|
5119
|
+
if (!this.eof() && t$30(this.src.charCodeAt(this.pos))) for (this.pos++; !this.eof() && r$24(this.src.charCodeAt(this.pos));) this.pos++;
|
|
5094
5120
|
return this.src.slice(e, this.pos);
|
|
5095
5121
|
}
|
|
5096
5122
|
scanIndex() {
|
|
@@ -5119,7 +5145,7 @@ var o$19 = class {
|
|
|
5119
5145
|
let t = this.pos + e.length;
|
|
5120
5146
|
if (t > this.src.length) return !1;
|
|
5121
5147
|
for (let t = 0; t < e.length; t++) if (this.src.charCodeAt(this.pos + t) !== e.charCodeAt(t)) return !1;
|
|
5122
|
-
return t < this.src.length && n$
|
|
5148
|
+
return t < this.src.length && n$25(this.src.charCodeAt(t)) ? !1 : (this.pos = t, this.skipWs(), !0);
|
|
5123
5149
|
}
|
|
5124
5150
|
matchBinaryOp() {
|
|
5125
5151
|
this.skipWs();
|
|
@@ -5135,7 +5161,7 @@ var o$19 = class {
|
|
|
5135
5161
|
};
|
|
5136
5162
|
//#endregion
|
|
5137
5163
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs
|
|
5138
|
-
var r$
|
|
5164
|
+
var r$23 = (e, t) => {
|
|
5139
5165
|
let n = new s$15(e, t), r = n.parseTernary();
|
|
5140
5166
|
return n.expectEnd(), r;
|
|
5141
5167
|
};
|
|
@@ -5259,7 +5285,7 @@ var s$15 = class extends o$19 {
|
|
|
5259
5285
|
return this.pos = this.src.length, {
|
|
5260
5286
|
type: "unary",
|
|
5261
5287
|
operator: "not",
|
|
5262
|
-
operand: r$
|
|
5288
|
+
operand: r$23(t, this.issues)
|
|
5263
5289
|
};
|
|
5264
5290
|
}
|
|
5265
5291
|
if (this.matchKeyword("in")) {
|
|
@@ -5372,6 +5398,16 @@ var s$15 = class extends o$19 {
|
|
|
5372
5398
|
right: this.parsePower()
|
|
5373
5399
|
});
|
|
5374
5400
|
}
|
|
5401
|
+
parseSignedAtom() {
|
|
5402
|
+
return this.peek() === e$33.Minus && i$21(this.at(1)) ? this.maybeTrailingFilters({
|
|
5403
|
+
type: "literal",
|
|
5404
|
+
value: this.scanNumber()
|
|
5405
|
+
}) : this.peek() === e$33.Minus ? (this.pos++, this.skipWs(), {
|
|
5406
|
+
type: "unary",
|
|
5407
|
+
operator: "-",
|
|
5408
|
+
operand: this.parseSignedAtom()
|
|
5409
|
+
}) : this.parseAtom();
|
|
5410
|
+
}
|
|
5375
5411
|
parseDefault() {
|
|
5376
5412
|
if (this.skipWs(), this.peek() === e$33.Minus && i$21(this.at(1))) return this.maybeTrailingFilters({
|
|
5377
5413
|
type: "literal",
|
|
@@ -5386,7 +5422,7 @@ var s$15 = class extends o$19 {
|
|
|
5386
5422
|
for (this.skipWs(); this.peek() === e$33.Question && this.at(1) === e$33.Question;) this.pos += 2, this.skipWs(), n = {
|
|
5387
5423
|
type: "default",
|
|
5388
5424
|
value: n,
|
|
5389
|
-
defaultExpr: this.
|
|
5425
|
+
defaultExpr: this.parseSignedAtom()
|
|
5390
5426
|
}, this.skipWs();
|
|
5391
5427
|
return n;
|
|
5392
5428
|
}
|
|
@@ -5583,12 +5619,12 @@ var s$15 = class extends o$19 {
|
|
|
5583
5619
|
};
|
|
5584
5620
|
//#endregion
|
|
5585
5621
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Parser/helpers.mjs
|
|
5586
|
-
var n$
|
|
5622
|
+
var n$24 = (e) => {
|
|
5587
5623
|
let n = 0;
|
|
5588
5624
|
for (; n < e.length && !a$17(e.charCodeAt(n));) n++;
|
|
5589
5625
|
return e.slice(0, n);
|
|
5590
5626
|
};
|
|
5591
|
-
var r$
|
|
5627
|
+
var r$22 = (t) => {
|
|
5592
5628
|
let n = 0;
|
|
5593
5629
|
for (let r = 0; r + 1 < t.length; r++) {
|
|
5594
5630
|
let i = t.charCodeAt(r);
|
|
@@ -5600,13 +5636,13 @@ var r$21 = (t) => {
|
|
|
5600
5636
|
};
|
|
5601
5637
|
//#endregion
|
|
5602
5638
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Parser/Parser.mjs
|
|
5603
|
-
var c$
|
|
5639
|
+
var c$13 = (e, t = !1, n) => {
|
|
5604
5640
|
let r = new f$6(e, t, n), i = r.parseBody();
|
|
5605
5641
|
if (!r.error) {
|
|
5606
5642
|
let e = r.peek();
|
|
5607
5643
|
if (e && e.type === "tag") {
|
|
5608
|
-
let t = n$
|
|
5609
|
-
l$
|
|
5644
|
+
let t = n$24(e.content.trim());
|
|
5645
|
+
l$9.has(t) && (r.error = `Orphan closing tag: {% ${t} %} without matching opening tag`);
|
|
5610
5646
|
}
|
|
5611
5647
|
}
|
|
5612
5648
|
return {
|
|
@@ -5614,7 +5650,7 @@ var c$12 = (e, t = !1, n) => {
|
|
|
5614
5650
|
error: r.error
|
|
5615
5651
|
};
|
|
5616
5652
|
};
|
|
5617
|
-
var l$
|
|
5653
|
+
var l$9 = /* @__PURE__ */ new Set([
|
|
5618
5654
|
"endif",
|
|
5619
5655
|
"endfor",
|
|
5620
5656
|
"endset",
|
|
@@ -5622,7 +5658,7 @@ var l$8 = /* @__PURE__ */ new Set([
|
|
|
5622
5658
|
"else",
|
|
5623
5659
|
"elseif"
|
|
5624
5660
|
]);
|
|
5625
|
-
var u$
|
|
5661
|
+
var u$8 = () => ({
|
|
5626
5662
|
type: "if",
|
|
5627
5663
|
condition: {
|
|
5628
5664
|
type: "literal",
|
|
@@ -5632,7 +5668,7 @@ var u$7 = () => ({
|
|
|
5632
5668
|
elseifClauses: [],
|
|
5633
5669
|
elseBody: null
|
|
5634
5670
|
});
|
|
5635
|
-
var d$
|
|
5671
|
+
var d$9 = () => ({
|
|
5636
5672
|
type: "for",
|
|
5637
5673
|
valueVar: "_item",
|
|
5638
5674
|
keyVar: null,
|
|
@@ -5669,7 +5705,7 @@ var f$6 = class {
|
|
|
5669
5705
|
let e = [];
|
|
5670
5706
|
for (; this.pos < this.tokens.length;) {
|
|
5671
5707
|
let t = this.peek();
|
|
5672
|
-
if (!t || t.type === "tag" && l$
|
|
5708
|
+
if (!t || t.type === "tag" && l$9.has(n$24(t.content.trim()))) break;
|
|
5673
5709
|
let n = this.parseNode();
|
|
5674
5710
|
n && e.push(n);
|
|
5675
5711
|
}
|
|
@@ -5703,7 +5739,7 @@ var f$6 = class {
|
|
|
5703
5739
|
},
|
|
5704
5740
|
source: i
|
|
5705
5741
|
};
|
|
5706
|
-
let o = r$
|
|
5742
|
+
let o = r$23(r, this.issues);
|
|
5707
5743
|
return {
|
|
5708
5744
|
type: "variable",
|
|
5709
5745
|
raw: t.raw,
|
|
@@ -5714,7 +5750,7 @@ var f$6 = class {
|
|
|
5714
5750
|
parseTag() {
|
|
5715
5751
|
let e = this.peek();
|
|
5716
5752
|
if (!e || e.type !== "tag") return null;
|
|
5717
|
-
let n = n$
|
|
5753
|
+
let n = n$24(e.content.trim());
|
|
5718
5754
|
switch (n) {
|
|
5719
5755
|
case "if": return this.parseIf();
|
|
5720
5756
|
case "for": return this.parseFor();
|
|
@@ -5728,17 +5764,17 @@ var f$6 = class {
|
|
|
5728
5764
|
parseIf() {
|
|
5729
5765
|
this.advance();
|
|
5730
5766
|
let e = this.tokens[this.pos - 1];
|
|
5731
|
-
if (e.type !== "tag") return this.error = "Malformed {% if %} tag", u$
|
|
5767
|
+
if (e.type !== "tag") return this.error = "Malformed {% if %} tag", u$8();
|
|
5732
5768
|
let t = e.content.trim(), n = t.indexOf(" ") === -1 ? "" : t.slice(t.indexOf(" ") + 1).trim();
|
|
5733
|
-
if (!n) return this.error = "Malformed {% if %} tag: missing condition", u$
|
|
5734
|
-
let r = r$
|
|
5769
|
+
if (!n) return this.error = "Malformed {% if %} tag: missing condition", u$8();
|
|
5770
|
+
let r = r$23(n, this.issues), i = this.parseBody(), s = [], c = null, l = !1;
|
|
5735
5771
|
for (; this.peek();) {
|
|
5736
5772
|
let e = this.peek();
|
|
5737
5773
|
if (!e || e.type !== "tag") break;
|
|
5738
|
-
let t = n$
|
|
5774
|
+
let t = n$24(e.content.trim());
|
|
5739
5775
|
if (t === "elseif") {
|
|
5740
5776
|
this.advance();
|
|
5741
|
-
let t = e.content.trim(), r = r$
|
|
5777
|
+
let t = e.content.trim(), r = r$23(t.slice(t.indexOf(" ") + 1).trim(), this.issues), i = this.parseBody();
|
|
5742
5778
|
s.push({
|
|
5743
5779
|
condition: r,
|
|
5744
5780
|
body: i
|
|
@@ -5761,23 +5797,23 @@ var f$6 = class {
|
|
|
5761
5797
|
let e = this.pos;
|
|
5762
5798
|
this.advance();
|
|
5763
5799
|
let n = this.tokens[this.pos - 1];
|
|
5764
|
-
if (n.type !== "tag") return d$
|
|
5800
|
+
if (n.type !== "tag") return d$9();
|
|
5765
5801
|
let r = n.content.trim(), i = r.slice(r.indexOf(" ") + 1).trim(), c = /\sin\s/.exec(i);
|
|
5766
|
-
if (!c) return this.error = "Invalid {% for %} syntax: missing the `in` keyword", d$
|
|
5767
|
-
let l = i.slice(0, c.index).trim(), u = i.slice(c.index + c[0].length).trim(), f = r$
|
|
5802
|
+
if (!c) return this.error = "Invalid {% for %} syntax: missing the `in` keyword", d$9();
|
|
5803
|
+
let l = i.slice(0, c.index).trim(), u = i.slice(c.index + c[0].length).trim(), f = r$22(u), p = f ? {
|
|
5768
5804
|
type: "range",
|
|
5769
|
-
start: r$
|
|
5770
|
-
end: r$
|
|
5771
|
-
} : r$
|
|
5772
|
-
if (!c$
|
|
5773
|
-
if (h !== null && !c$
|
|
5805
|
+
start: r$23(f[0], this.issues),
|
|
5806
|
+
end: r$23(f[1], this.issues)
|
|
5807
|
+
} : r$23(u, this.issues), m = l.indexOf(","), h = m === -1 ? null : l.slice(0, m).trim(), g = m === -1 ? l : l.slice(m + 1).trim();
|
|
5808
|
+
if (!c$14(g)) return this.error = `Invalid {% for %} variable name: "${g}"`, d$9();
|
|
5809
|
+
if (h !== null && !c$14(h)) return this.error = `Invalid {% for %} key variable name: "${h}"`, d$9();
|
|
5774
5810
|
let _ = this.parseBody(), v = null;
|
|
5775
5811
|
if (this.peek()) {
|
|
5776
5812
|
let e = this.peek();
|
|
5777
|
-
e && e.type === "tag" && n$
|
|
5813
|
+
e && e.type === "tag" && n$24(e.content.trim()) === "else" && (this.advance(), v = this.parseBody());
|
|
5778
5814
|
}
|
|
5779
5815
|
let y = this.peek();
|
|
5780
|
-
y && y.type === "tag" && n$
|
|
5816
|
+
y && y.type === "tag" && n$24(y.content.trim()) === "endfor" ? this.advance() : this.error = "Malformed {% for %} block: missing {% endfor %}";
|
|
5781
5817
|
let b = this.keepEmptyTokens ? this.reconstructRange(e, this.pos) : void 0;
|
|
5782
5818
|
return {
|
|
5783
5819
|
type: "for",
|
|
@@ -5791,7 +5827,7 @@ var f$6 = class {
|
|
|
5791
5827
|
}
|
|
5792
5828
|
reconstructRange(e, t) {
|
|
5793
5829
|
let n = "";
|
|
5794
|
-
for (let i = e; i < t; i++) n += t$
|
|
5830
|
+
for (let i = e; i < t; i++) n += t$29(this.tokens[i]);
|
|
5795
5831
|
return n;
|
|
5796
5832
|
}
|
|
5797
5833
|
parseSet() {
|
|
@@ -5817,7 +5853,7 @@ var f$6 = class {
|
|
|
5817
5853
|
return {
|
|
5818
5854
|
type: "set",
|
|
5819
5855
|
name: n.slice(0, r).trim(),
|
|
5820
|
-
value: r$
|
|
5856
|
+
value: r$23(n.slice(r + 1).trim(), this.issues)
|
|
5821
5857
|
};
|
|
5822
5858
|
}
|
|
5823
5859
|
parseApply() {
|
|
@@ -5838,13 +5874,13 @@ var f$6 = class {
|
|
|
5838
5874
|
};
|
|
5839
5875
|
//#endregion
|
|
5840
5876
|
//#region ../sdk-shared/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs
|
|
5841
|
-
var r$
|
|
5877
|
+
var r$21 = /* @__PURE__ */ new Map();
|
|
5842
5878
|
var i$19 = 1024;
|
|
5843
5879
|
var a$15 = {
|
|
5844
5880
|
hits: 0,
|
|
5845
5881
|
misses: 0
|
|
5846
5882
|
};
|
|
5847
|
-
var c$
|
|
5883
|
+
var c$12 = (t) => {
|
|
5848
5884
|
let n = !1, r = !0;
|
|
5849
5885
|
for (let i = 0; i < t.length; i++) {
|
|
5850
5886
|
let a = t[i];
|
|
@@ -5862,24 +5898,24 @@ var c$11 = (t) => {
|
|
|
5862
5898
|
allSimpleOrDotted: r
|
|
5863
5899
|
};
|
|
5864
5900
|
};
|
|
5865
|
-
var l$
|
|
5866
|
-
if (r$
|
|
5867
|
-
let e = r$
|
|
5868
|
-
e !== void 0 && r$
|
|
5901
|
+
var l$8 = () => {
|
|
5902
|
+
if (r$21.size >= i$19) {
|
|
5903
|
+
let e = r$21.keys().next().value;
|
|
5904
|
+
e !== void 0 && r$21.delete(e);
|
|
5869
5905
|
}
|
|
5870
5906
|
};
|
|
5871
|
-
var u$
|
|
5907
|
+
var u$7 = (e) => {
|
|
5872
5908
|
let r = e$32(e);
|
|
5873
5909
|
if (r.error) return null;
|
|
5874
|
-
let i = r.tokens, { hasTags: a, allSimpleOrDotted: o } = c$
|
|
5910
|
+
let i = r.tokens, { hasTags: a, allSimpleOrDotted: o } = c$12(i), s = a || !o, l = null, u = null;
|
|
5875
5911
|
if (s) {
|
|
5876
|
-
let e = c$
|
|
5912
|
+
let e = c$13(i, !1);
|
|
5877
5913
|
if (e.error) return null;
|
|
5878
5914
|
l = e.nodes;
|
|
5879
|
-
let t = c$
|
|
5915
|
+
let t = c$13(i, !0);
|
|
5880
5916
|
t.error || (u = t.nodes);
|
|
5881
5917
|
} else {
|
|
5882
|
-
let e = c$
|
|
5918
|
+
let e = c$13(i, !0);
|
|
5883
5919
|
e.error || (u = e.nodes);
|
|
5884
5920
|
}
|
|
5885
5921
|
return {
|
|
@@ -5890,18 +5926,18 @@ var u$6 = (e) => {
|
|
|
5890
5926
|
nodesWithSource: u
|
|
5891
5927
|
};
|
|
5892
5928
|
};
|
|
5893
|
-
var d$
|
|
5894
|
-
let t = r$
|
|
5929
|
+
var d$8 = (e) => {
|
|
5930
|
+
let t = r$21.get(e);
|
|
5895
5931
|
if (t) return a$15.hits++, t;
|
|
5896
5932
|
a$15.misses++;
|
|
5897
|
-
let n = u$
|
|
5898
|
-
return n ? (l$
|
|
5933
|
+
let n = u$7(e);
|
|
5934
|
+
return n ? (l$8(), r$21.set(e, n), n) : null;
|
|
5899
5935
|
};
|
|
5900
5936
|
//#endregion
|
|
5901
5937
|
//#region ../sdk-shared/dist/helpers/twigWrapper/templateRoots.mjs
|
|
5902
|
-
var t$
|
|
5938
|
+
var t$28 = (e, n) => {
|
|
5903
5939
|
if (Array.isArray(e)) {
|
|
5904
|
-
for (let r of e) t$
|
|
5940
|
+
for (let r of e) t$28(r, n);
|
|
5905
5941
|
return;
|
|
5906
5942
|
}
|
|
5907
5943
|
if (typeof e == "object" && e) {
|
|
@@ -5910,16 +5946,16 @@ var t$27 = (e, n) => {
|
|
|
5910
5946
|
t.length > 0 && n.add(t.join("."));
|
|
5911
5947
|
return;
|
|
5912
5948
|
}
|
|
5913
|
-
for (let r of Object.values(e)) t$
|
|
5949
|
+
for (let r of Object.values(e)) t$28(r, n);
|
|
5914
5950
|
}
|
|
5915
5951
|
};
|
|
5916
|
-
var n$
|
|
5917
|
-
let r = d$
|
|
5952
|
+
var n$23 = (n) => {
|
|
5953
|
+
let r = d$8(n);
|
|
5918
5954
|
if (!r) return [];
|
|
5919
5955
|
let i = /* @__PURE__ */ new Set();
|
|
5920
|
-
return t$
|
|
5956
|
+
return t$28(r.nodes ?? r.nodesWithSource, i), [...i];
|
|
5921
5957
|
};
|
|
5922
|
-
var r$
|
|
5958
|
+
var r$20 = (e) => [...new Set(n$23(e).map((e) => e.split(".")[0]))];
|
|
5923
5959
|
//#endregion
|
|
5924
5960
|
//#region ../sdk-shared/dist/style/styleConstants.mjs
|
|
5925
5961
|
var e$30 = {
|
|
@@ -5937,7 +5973,7 @@ var e$30 = {
|
|
|
5937
5973
|
fonts: [],
|
|
5938
5974
|
cache: ""
|
|
5939
5975
|
};
|
|
5940
|
-
var t$
|
|
5976
|
+
var t$27 = {
|
|
5941
5977
|
DISPLAY: "display",
|
|
5942
5978
|
FLEX_WRAP: "flex-wrap",
|
|
5943
5979
|
FLEX_DIRECTION: "flex-direction",
|
|
@@ -5979,6 +6015,11 @@ var t$26 = {
|
|
|
5979
6015
|
BACKGROUND_ATTACHMENT: "background-attachment",
|
|
5980
6016
|
BACKGROUND_BLEND_MODE: "background-blend-mode",
|
|
5981
6017
|
MASK_IMAGE: "mask-image",
|
|
6018
|
+
MASK_SIZE: "mask-size",
|
|
6019
|
+
MASK_POSITION: "mask-position",
|
|
6020
|
+
MASK_REPEAT: "mask-repeat",
|
|
6021
|
+
MASK_COMPOSITE: "mask-composite",
|
|
6022
|
+
WEBKIT_MASK_IMAGE: "-webkit-mask-image",
|
|
5982
6023
|
BORDER_TOP_STYLE: "border-top-style",
|
|
5983
6024
|
BORDER_TOP_WIDTH: "border-top-width",
|
|
5984
6025
|
BORDER_TOP_COLOR: "border-top-color",
|
|
@@ -6113,44 +6154,47 @@ var t$26 = {
|
|
|
6113
6154
|
WEBKIT_LINE_CLAMP: "-webkit-line-clamp",
|
|
6114
6155
|
WEBKIT_BOX_ORIENT: "-webkit-box-orient",
|
|
6115
6156
|
WEBKIT_TEXT_FILL_COLOR: "-webkit-text-fill-color",
|
|
6157
|
+
WEBKIT_BACKGROUND_CLIP: "-webkit-background-clip",
|
|
6158
|
+
BOX_DECORATION_BREAK: "box-decoration-break",
|
|
6159
|
+
WEBKIT_BOX_DECORATION_BREAK: "-webkit-box-decoration-break",
|
|
6116
6160
|
FILL: "fill",
|
|
6117
6161
|
STROKE: "stroke",
|
|
6118
6162
|
STROKE_WIDTH: "stroke-width"
|
|
6119
6163
|
};
|
|
6120
|
-
var n$
|
|
6121
|
-
t$
|
|
6122
|
-
t$
|
|
6123
|
-
t$
|
|
6124
|
-
t$
|
|
6125
|
-
t$
|
|
6126
|
-
t$
|
|
6127
|
-
t$
|
|
6128
|
-
t$
|
|
6129
|
-
t$
|
|
6130
|
-
t$
|
|
6131
|
-
t$
|
|
6132
|
-
t$
|
|
6133
|
-
t$
|
|
6134
|
-
t$
|
|
6135
|
-
t$
|
|
6136
|
-
t$
|
|
6137
|
-
t$
|
|
6138
|
-
t$
|
|
6139
|
-
t$
|
|
6140
|
-
t$
|
|
6141
|
-
t$
|
|
6142
|
-
t$
|
|
6164
|
+
var n$22 = [
|
|
6165
|
+
t$27.FONT_FAMILY,
|
|
6166
|
+
t$27.FONT_SIZE,
|
|
6167
|
+
t$27.FONT_STYLE,
|
|
6168
|
+
t$27.FONT_VARIANT,
|
|
6169
|
+
t$27.FONT_VARIANT_NUMERIC,
|
|
6170
|
+
t$27.FONT_FEATURE_SETTINGS,
|
|
6171
|
+
t$27.FONT_WEIGHT,
|
|
6172
|
+
t$27.COLOR,
|
|
6173
|
+
t$27.LINE_HEIGHT,
|
|
6174
|
+
t$27.LETTER_SPACING,
|
|
6175
|
+
t$27.TEXT_ALIGN,
|
|
6176
|
+
t$27.TEXT_DECORATION,
|
|
6177
|
+
t$27.TEXT_INDENT,
|
|
6178
|
+
t$27.TEXT_SHADOW,
|
|
6179
|
+
t$27.TEXT_TRANSFORM,
|
|
6180
|
+
t$27.TEXT_WRAP,
|
|
6181
|
+
t$27.TEXT_OVERFLOW,
|
|
6182
|
+
t$27.WHITE_SPACE,
|
|
6183
|
+
t$27.DIRECTION,
|
|
6184
|
+
t$27.CURSOR,
|
|
6185
|
+
t$27.LIST_STYLE,
|
|
6186
|
+
t$27.LIST_STYLE_TYPE
|
|
6143
6187
|
];
|
|
6144
|
-
Object.values(t$
|
|
6188
|
+
Object.values(t$27).map((e) => ({
|
|
6145
6189
|
path: e,
|
|
6146
6190
|
label: e
|
|
6147
6191
|
}));
|
|
6148
|
-
t$
|
|
6192
|
+
t$27.DISPLAY, t$27.FLEX_WRAP, t$27.FLEX_DIRECTION, t$27.ALIGN_ITEMS, t$27.JUSTIFY_ITEMS, t$27.JUSTIFY_CONTENT, t$27.ALIGN_CONTENT, t$27.ROW_GAP, t$27.COLUMN_GAP, t$27.GRID_ROW_GAP, t$27.GRID_COLUMN_GAP, t$27.GRID_TEMPLATE_AREAS, t$27.GRID_TEMPLATE_COLUMNS, t$27.GRID_TEMPLATE_ROWS, t$27.GRID_AUTO_FLOW, t$27.GRID_AUTO_ROWS, t$27.GRID_AUTO_COLUMNS, t$27.GRID_ROW_START, t$27.GRID_COLUMN_START, t$27.GRID_ROW_END, t$27.GRID_COLUMN_END, t$27.ALIGN_SELF, t$27.JUSTIFY_SELF, t$27.ORDER, t$27.FLEX_GROW, t$27.FLEX_SHRINK, t$27.FLEX_BASIS, t$27.LIST_STYLE, t$27.LIST_STYLE_TYPE, t$27.LIST_STYLE_POSITION, t$27.LIST_STYLE_IMAGE, t$27.BACKGROUND_COLOR, t$27.BACKGROUND_IMAGE, t$27.BACKGROUND_POSITION, t$27.BACKGROUND_SIZE, t$27.BACKGROUND_CLIP, t$27.BACKGROUND_ORIGIN, t$27.BACKGROUND_REPEAT, t$27.BACKGROUND_ATTACHMENT, t$27.BACKGROUND_BLEND_MODE, t$27.MASK_IMAGE, t$27.MASK_SIZE, t$27.MASK_POSITION, t$27.MASK_REPEAT, t$27.MASK_COMPOSITE, t$27.WEBKIT_MASK_IMAGE, t$27.BORDER_TOP_STYLE, t$27.BORDER_TOP_WIDTH, t$27.BORDER_TOP_COLOR, t$27.BORDER_BOTTOM_STYLE, t$27.BORDER_BOTTOM_WIDTH, t$27.BORDER_BOTTOM_COLOR, t$27.BORDER_LEFT_STYLE, t$27.BORDER_LEFT_WIDTH, t$27.BORDER_LEFT_COLOR, t$27.BORDER_RIGHT_STYLE, t$27.BORDER_RIGHT_WIDTH, t$27.BORDER_RIGHT_COLOR, t$27.BORDER_TOP_LEFT_RADIUS, t$27.BORDER_TOP_RIGHT_RADIUS, t$27.BORDER_BOTTOM_LEFT_RADIUS, t$27.BORDER_BOTTOM_RIGHT_RADIUS, t$27.BORDER_COLLAPSE, t$27.BORDER_SPACING, t$27.TABLE_LAYOUT, t$27.OPACITY, t$27.VISIBILITY, t$27.CURSOR, t$27.TRANSITION, t$27.TRANSITION_PROPERTY, t$27.TRANSITION_DURATION, t$27.TRANSITION_TIMING_FUNCTION, t$27.TRANSITION_DELAY, t$27.TRANSITION_BEHAVIOR, t$27.ANIMATION, t$27.ANIMATION_NAME, t$27.ANIMATION_DURATION, t$27.ANIMATION_TIMING_FUNCTION, t$27.ANIMATION_DELAY, t$27.ANIMATION_ITERATION_COUNT, t$27.ANIMATION_DIRECTION, t$27.ANIMATION_FILL_MODE, t$27.ANIMATION_PLAY_STATE, t$27.ANIMATION_TIMELINE, t$27.ANIMATION_RANGE, t$27.BOX_SHADOW, t$27.FILTER, t$27.BACKDROP_FILTER, t$27.MIX_BLEND_MODE, t$27.ISOLATION, t$27.CLIP_PATH, t$27.TRANSFORM, t$27.TRANSFORM_ORIGIN, t$27.PERSPECTIVE, t$27.WILL_CHANGE, t$27.OUTLINE_WIDTH, t$27.OUTLINE_STYLE, t$27.OUTLINE_COLOR, t$27.OUTLINE_OFFSET, t$27.POINTER_EVENTS, t$27.USER_SELECT, t$27.TOUCH_ACTION, t$27.RESIZE, t$27.APPEARANCE, t$27.SCROLL_BEHAVIOR, t$27.OVERSCROLL_BEHAVIOR, t$27.SCROLL_SNAP_TYPE, t$27.SCROLL_SNAP_ALIGN, t$27.SCROLL_SNAP_STOP, t$27.SCROLL_PADDING_TOP, t$27.SCROLL_MARGIN_TOP, t$27.ACCENT_COLOR, t$27.CARET_COLOR, t$27.COLOR_SCHEME, t$27.POSITION, t$27.FLOAT, t$27.CLEAR, t$27.Z_INDEX, t$27.TOP, t$27.BOTTOM, t$27.LEFT, t$27.RIGHT, t$27.BOX_SIZING, t$27.ASPECT_RATIO, t$27.WIDTH, t$27.HEIGHT, t$27.MIN_WIDTH, t$27.MIN_HEIGHT, t$27.MAX_WIDTH, t$27.MAX_HEIGHT, t$27.OVERFLOW, t$27.OVERFLOW_X, t$27.OVERFLOW_Y, t$27.SCROLLBAR_WIDTH, t$27.SCROLLBAR_COLOR, t$27.OBJECT_FIT, t$27.OBJECT_POSITION, t$27.COLUMN_WIDTH, t$27.COLUMN_COUNT, t$27.MARGIN_TOP, t$27.MARGIN_BOTTOM, t$27.MARGIN_LEFT, t$27.MARGIN_RIGHT, t$27.PADDING_TOP, t$27.PADDING_BOTTOM, t$27.PADDING_LEFT, t$27.PADDING_RIGHT, t$27.FONT_FAMILY, t$27.FONT_WEIGHT, t$27.FONT_SIZE, t$27.LINE_HEIGHT, t$27.COLOR, t$27.TEXT_ALIGN, t$27.FONT_STYLE, t$27.FONT_VARIANT, t$27.FONT_VARIANT_NUMERIC, t$27.FONT_FEATURE_SETTINGS, t$27.TEXT_DECORATION, t$27.TEXT_DECORATION_LINE, t$27.TEXT_DECORATION_COLOR, t$27.TEXT_DECORATION_STYLE, t$27.TEXT_DECORATION_THICKNESS, t$27.TEXT_UNDERLINE_OFFSET, t$27.LETTER_SPACING, t$27.WORD_SPACING, t$27.TEXT_INDENT, t$27.TEXT_TRANSFORM, t$27.DIRECTION, t$27.WHITE_SPACE, t$27.TEXT_WRAP, t$27.WORD_BREAK, t$27.OVERFLOW_WRAP, t$27.HYPHENS, t$27.VERTICAL_ALIGN, t$27.TEXT_OVERFLOW, t$27.TEXT_SHADOW, t$27.LINE_CLAMP, t$27.WEBKIT_LINE_CLAMP, t$27.WEBKIT_BOX_ORIENT, t$27.WEBKIT_TEXT_FILL_COLOR, t$27.WEBKIT_BACKGROUND_CLIP, t$27.BOX_DECORATION_BREAK, t$27.WEBKIT_BOX_DECORATION_BREAK, t$27.FILL, t$27.STROKE, t$27.STROKE_WIDTH;
|
|
6149
6193
|
//#endregion
|
|
6150
6194
|
//#region ../sdk-shared/dist/schema/schemaConstants.mjs
|
|
6151
|
-
var t$
|
|
6152
|
-
var n$
|
|
6153
|
-
var r$
|
|
6195
|
+
var t$26 = /var\(\s*--([a-zA-Z0-9_-]+)\s*\)|\{\{\s*([a-zA-Z0-9_-]+)\s*\}\}/;
|
|
6196
|
+
var n$21 = "props";
|
|
6197
|
+
var r$18 = {
|
|
6154
6198
|
schema: {
|
|
6155
6199
|
definition: {
|
|
6156
6200
|
name: "",
|
|
@@ -6186,7 +6230,7 @@ var r$17 = {
|
|
|
6186
6230
|
*/
|
|
6187
6231
|
var GLOBAL_SOURCES = e$34;
|
|
6188
6232
|
/** What an element inside a component can read besides its own tree: the globals, and what its instance hands in. */
|
|
6189
|
-
var COMPONENT_SOURCES = [...GLOBAL_SOURCES, n$
|
|
6233
|
+
var COMPONENT_SOURCES = [...GLOBAL_SOURCES, n$21];
|
|
6190
6234
|
/**
|
|
6191
6235
|
* Turns what an author wrote into the name the runtime resolves.
|
|
6192
6236
|
*
|
|
@@ -6205,7 +6249,7 @@ var resolveSource = (source, index, where, globals = GLOBAL_SOURCES) => {
|
|
|
6205
6249
|
if (globals.includes(head)) return source;
|
|
6206
6250
|
const prefix = index.get(head);
|
|
6207
6251
|
if (!prefix) {
|
|
6208
|
-
const inComponent = globals.includes(n$
|
|
6252
|
+
const inComponent = globals.includes(n$21);
|
|
6209
6253
|
throw new AuthoringError("binding-source-unknown", `${where} binds to "${source}", but nothing ${inComponent ? "in this component" : "in this space"} answers to "${head}"${didYouMean(head, [...index.keys(), ...globals]) || "."} A source names an element by its id, or one of the globals: ${globals.join(", ")}.${inComponent ? " A component is closed: what it needs from where it is placed comes in as a prop." : ""}`);
|
|
6210
6254
|
}
|
|
6211
6255
|
return field ? `${prefix}_${head}.${field}` : `${prefix}_${head}`;
|
|
@@ -6369,7 +6413,7 @@ var activeOn = (cls, pages, options = {}) => {
|
|
|
6369
6413
|
* one only has to be one of them.
|
|
6370
6414
|
*/
|
|
6371
6415
|
var conditionSource = (template) => {
|
|
6372
|
-
const roots = r$
|
|
6416
|
+
const roots = r$20(template);
|
|
6373
6417
|
const global = roots.find((root) => GLOBAL_SOURCES.includes(root));
|
|
6374
6418
|
if (global) return global;
|
|
6375
6419
|
const element = roots.find((root) => root.includes("_"));
|
|
@@ -6557,7 +6601,7 @@ var listShape = (kind, id, attributes, bind, row, children, fed) => {
|
|
|
6557
6601
|
};
|
|
6558
6602
|
};
|
|
6559
6603
|
var buildSpec = (type, declaration, props) => {
|
|
6560
|
-
const { id: givenId, class: shared, css, states, selector, variant, slots, bind: givenBind, from: givenFrom, as, row, visible: givenVisible, flows, runtime, loadStrategy, anchor, flag, children, meta, ...attributes } = props;
|
|
6604
|
+
const { id: givenId, class: shared, css, states, selector, variant, slots, bind: givenBind, from: givenFrom, as, row, visible: givenVisible, flows, runtime, loadStrategy, anchor, motion, flag, children, meta, ...attributes } = props;
|
|
6561
6605
|
const id = givenId === void 0 ? void 0 : scoped(givenId);
|
|
6562
6606
|
const bind = givenBind === void 0 ? void 0 : bindingsOf$3(givenBind);
|
|
6563
6607
|
const from = givenFrom === void 0 ? void 0 : sourceName(givenFrom);
|
|
@@ -6582,6 +6626,7 @@ var buildSpec = (type, declaration, props) => {
|
|
|
6582
6626
|
...runtime === void 0 ? {} : { runtime },
|
|
6583
6627
|
...loadStrategy === void 0 ? {} : { loadStrategy },
|
|
6584
6628
|
...anchor === void 0 ? {} : { anchor },
|
|
6629
|
+
...motion === void 0 ? {} : { motion },
|
|
6585
6630
|
...flag === void 0 ? {} : { flag },
|
|
6586
6631
|
...list ? list.children === void 0 ? {} : { children: list.children } : children === void 0 ? {} : { children },
|
|
6587
6632
|
attributes: {
|
|
@@ -6775,9 +6820,9 @@ var video = defineElement(B.Video);
|
|
|
6775
6820
|
//#endregion
|
|
6776
6821
|
//#region ../sdk-schema/dist/helpers/elementId.mjs
|
|
6777
6822
|
var e$29 = /^[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/;
|
|
6778
|
-
var t$
|
|
6779
|
-
var r$
|
|
6780
|
-
var i$17 = (e, n, r) => t$
|
|
6823
|
+
var t$25 = (t) => e$29.test(t);
|
|
6824
|
+
var r$17 = (e) => new Set(Object.keys(e));
|
|
6825
|
+
var i$17 = (e, n, r) => t$25(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`;
|
|
6781
6826
|
var a$14 = (e, t) => {
|
|
6782
6827
|
let n = /* @__PURE__ */ new Set();
|
|
6783
6828
|
for (let r of t) {
|
|
@@ -6788,27 +6833,27 @@ var a$14 = (e, t) => {
|
|
|
6788
6833
|
};
|
|
6789
6834
|
var o$17 = (e) => e.replace(/[^A-Za-z0-9]/g, "") || "element";
|
|
6790
6835
|
var s$14 = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
6791
|
-
var c$
|
|
6836
|
+
var c$11 = (e, t) => {
|
|
6792
6837
|
let n = o$17(e);
|
|
6793
6838
|
for (let e = 0; e < 100; e += 1) {
|
|
6794
6839
|
let e = "";
|
|
6795
6840
|
for (let t = 0; t < 4; t += 1) e += s$14[Math.floor(Math.random() * s$14.length)];
|
|
6796
6841
|
if (!t(`${n}-${e}`)) return `${n}-${e}`;
|
|
6797
6842
|
}
|
|
6798
|
-
return l$
|
|
6843
|
+
return l$7(e, t);
|
|
6799
6844
|
};
|
|
6800
|
-
var l$
|
|
6845
|
+
var l$7 = (e, t) => {
|
|
6801
6846
|
let n = o$17(e), r = 1;
|
|
6802
6847
|
for (; t(`${n}-${r}`);) r += 1;
|
|
6803
6848
|
return `${n}-${r}`;
|
|
6804
6849
|
};
|
|
6805
|
-
var u$
|
|
6850
|
+
var u$6 = (e, t) => {
|
|
6806
6851
|
if (!t(e)) return e;
|
|
6807
6852
|
let n = /^(.*[A-Za-z0-9])-(\d+)$/.exec(e), r = n ? n[1] : e, i = n ? Number(n[2]) + 1 : 2;
|
|
6808
6853
|
for (; t(`${r}-${i}`);) i += 1;
|
|
6809
6854
|
return `${r}-${i}`;
|
|
6810
6855
|
};
|
|
6811
|
-
var d$
|
|
6856
|
+
var d$7 = {
|
|
6812
6857
|
page: [{ attribute: "layout" }, { attribute: "layoutContainer" }],
|
|
6813
6858
|
reference: [{
|
|
6814
6859
|
attribute: "referenceId",
|
|
@@ -6829,30 +6874,30 @@ var p$5 = (e, t) => {
|
|
|
6829
6874
|
let a = t[r.slice(i + 1)];
|
|
6830
6875
|
return a ? `${r.slice(0, i + 1)}${a}${n === -1 ? "" : e.slice(n)}` : e;
|
|
6831
6876
|
};
|
|
6832
|
-
var m$
|
|
6833
|
-
var h$
|
|
6877
|
+
var m$6 = /([A-Za-z][A-Za-z0-9]*)_([A-Za-z][A-Za-z0-9_-]*)/g;
|
|
6878
|
+
var h$5 = (e, t) => e.replace(m$6, (e, n, r) => {
|
|
6834
6879
|
let i = t[r];
|
|
6835
6880
|
return i ? `${n}_${i}` : e;
|
|
6836
6881
|
});
|
|
6837
|
-
var g$
|
|
6882
|
+
var g$3 = (e, t) => {
|
|
6838
6883
|
let n = !1;
|
|
6839
6884
|
if (Array.isArray(e)) return e.forEach((r, i) => {
|
|
6840
6885
|
if (typeof r == "string") {
|
|
6841
|
-
let a = h$
|
|
6886
|
+
let a = h$5(r, t);
|
|
6842
6887
|
a !== r && (e[i] = a, n = !0);
|
|
6843
6888
|
return;
|
|
6844
6889
|
}
|
|
6845
|
-
n = g$
|
|
6890
|
+
n = g$3(r, t) || n;
|
|
6846
6891
|
}), n;
|
|
6847
6892
|
if (!e || typeof e != "object") return !1;
|
|
6848
6893
|
let r = e;
|
|
6849
6894
|
for (let [e, i] of Object.entries(r)) {
|
|
6850
6895
|
if (typeof i == "string") {
|
|
6851
|
-
let a = h$
|
|
6896
|
+
let a = h$5(i, t);
|
|
6852
6897
|
a !== i && (r[e] = a, n = !0);
|
|
6853
6898
|
continue;
|
|
6854
6899
|
}
|
|
6855
|
-
n = g$
|
|
6900
|
+
n = g$3(i, t) || n;
|
|
6856
6901
|
}
|
|
6857
6902
|
return n;
|
|
6858
6903
|
};
|
|
@@ -6865,7 +6910,7 @@ var _$1 = (e, t, n) => {
|
|
|
6865
6910
|
t[n.id] && (n.id = t[n.id], e = !0);
|
|
6866
6911
|
let { definition: r, attributes: o } = n;
|
|
6867
6912
|
t[r.rootId] && (r.rootId = t[r.rootId], e = !0), r.parentId && t[r.parentId] && (r.parentId = t[r.parentId], e = !0), r.items?.some((e) => t[e]) && (r.items = r.items.map(i), e = !0);
|
|
6868
|
-
for (let { attribute: n, when: i } of d$
|
|
6913
|
+
for (let { attribute: n, when: i } of d$7[r.type] ?? []) {
|
|
6869
6914
|
let r = o[n];
|
|
6870
6915
|
typeof r == "string" && t[r] && (!i || i(o)) && (o[n] = t[r], e = !0);
|
|
6871
6916
|
}
|
|
@@ -6873,7 +6918,7 @@ var _$1 = (e, t, n) => {
|
|
|
6873
6918
|
typeof s == "string" && t[s] && (o.slot = t[s], e = !0);
|
|
6874
6919
|
for (let n of Object.values(r.bindings ?? {})) for (let r of n) {
|
|
6875
6920
|
let n = p$5(r.source, t);
|
|
6876
|
-
n !== r.source && (r.source = n, e = !0), r.transformers && g$
|
|
6921
|
+
n !== r.source && (r.source = n, e = !0), r.transformers && g$3(r.transformers, t) && (e = !0), r.when && g$3(r.when, t) && (e = !0);
|
|
6877
6922
|
}
|
|
6878
6923
|
for (let n of Object.values(r.interactions ?? {})) {
|
|
6879
6924
|
n.elementId && t[n.elementId] && (n.elementId = t[n.elementId], e = !0);
|
|
@@ -6881,7 +6926,7 @@ var _$1 = (e, t, n) => {
|
|
|
6881
6926
|
let a = n.params[r];
|
|
6882
6927
|
typeof a == "string" && t[a] && (!i || i(n.params)) && (n.params[r] = t[a], e = !0);
|
|
6883
6928
|
}
|
|
6884
|
-
g$
|
|
6929
|
+
g$3(n.params, t) && (e = !0), n.when && g$3(n.when, t) && (e = !0);
|
|
6885
6930
|
}
|
|
6886
6931
|
e && a.add(n.id);
|
|
6887
6932
|
}
|
|
@@ -6893,305 +6938,500 @@ var _$1 = (e, t, n) => {
|
|
|
6893
6938
|
}), [...a];
|
|
6894
6939
|
};
|
|
6895
6940
|
//#endregion
|
|
6896
|
-
//#region ../sdk-schema/dist/helpers/elementTree.mjs
|
|
6897
|
-
var e$28 = (e, t) => t && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
6898
|
-
var t$23 = (t, n) => {
|
|
6899
|
-
let r = [], i = /* @__PURE__ */ new Set([n]);
|
|
6900
|
-
for (let a = e$28(t, e$28(t, n)?.definition.parentId); a && !i.has(a.id);) i.add(a.id), r.push(a.id), a = e$28(t, a.definition.parentId);
|
|
6901
|
-
return r;
|
|
6902
|
-
};
|
|
6903
|
-
var n$19 = (n, r) => {
|
|
6904
|
-
let i = [], a = /* @__PURE__ */ new Set([r]), o = (s) => {
|
|
6905
|
-
for (let c of [s, ...t$23(n, s)]) {
|
|
6906
|
-
let t = e$28(n, c);
|
|
6907
|
-
if (c !== s || s !== r) {
|
|
6908
|
-
if (a.has(c)) continue;
|
|
6909
|
-
a.add(c), i.push(c);
|
|
6910
|
-
}
|
|
6911
|
-
let l = t?.definition.type, { layout: u, layoutContainer: d } = t?.attributes ?? {};
|
|
6912
|
-
(l === "page" || l === "layoutContainer") && u && typeof d == "string" && !a.has(d) && o(d);
|
|
6913
|
-
}
|
|
6914
|
-
};
|
|
6915
|
-
return o(r), i;
|
|
6916
|
-
};
|
|
6917
|
-
var r$15 = (t, n) => {
|
|
6918
|
-
let r = [], i = /* @__PURE__ */ new Set([n]), a = (n) => {
|
|
6919
|
-
for (let o of e$28(t, n)?.definition.items ?? []) !i.has(o) && e$28(t, o) && (i.add(o), r.push(o), a(o));
|
|
6920
|
-
};
|
|
6921
|
-
return a(n), r;
|
|
6922
|
-
};
|
|
6923
|
-
//#endregion
|
|
6924
|
-
//#region ../sdk-shared/dist/style/breakpoints.mjs
|
|
6925
|
-
var e$27 = {
|
|
6926
|
-
desktop: 1024,
|
|
6927
|
-
tablet: 768,
|
|
6928
|
-
mobile: 0
|
|
6929
|
-
};
|
|
6930
|
-
var t$22 = (t) => e$27[t] === 0 ? "0" : `${String(e$27[t] / 16)}rem`;
|
|
6931
|
-
//#endregion
|
|
6932
|
-
//#region ../sdk-shared/dist/style/displayModes.mjs
|
|
6933
|
-
var e$26 = [
|
|
6934
|
-
"desktop",
|
|
6935
|
-
"tablet",
|
|
6936
|
-
"mobile"
|
|
6937
|
-
];
|
|
6938
|
-
var t$21 = (t) => e$26.some((e) => e === t);
|
|
6939
|
-
//#endregion
|
|
6940
|
-
//#region ../sdk-shared/dist/style/fonts.mjs
|
|
6941
|
-
var i$16 = (e) => {
|
|
6942
|
-
try {
|
|
6943
|
-
let t = new URL(e);
|
|
6944
|
-
return t.protocol === "https:" && !t.username && !t.password;
|
|
6945
|
-
} catch {
|
|
6946
|
-
return !1;
|
|
6947
|
-
}
|
|
6948
|
-
};
|
|
6949
|
-
//#endregion
|
|
6950
6941
|
//#region ../sdk-shared/dist/helpers/isRecord.mjs
|
|
6951
|
-
var e$
|
|
6952
|
-
//#endregion
|
|
6953
|
-
//#region ../sdk-shared/dist/style/fontValidation.mjs
|
|
6954
|
-
var n$18 = /* @__PURE__ */ new Set([
|
|
6955
|
-
"system",
|
|
6956
|
-
"google",
|
|
6957
|
-
"remote",
|
|
6958
|
-
"hosted"
|
|
6959
|
-
]);
|
|
6960
|
-
var r$14 = /* @__PURE__ */ new Set([
|
|
6961
|
-
"auto",
|
|
6962
|
-
"block",
|
|
6963
|
-
"swap",
|
|
6964
|
-
"fallback",
|
|
6965
|
-
"optional"
|
|
6966
|
-
]);
|
|
6967
|
-
var i$15 = /* @__PURE__ */ new Set(["woff2", "woff"]);
|
|
6968
|
-
var a$13 = 100;
|
|
6969
|
-
var o$16 = (e) => {
|
|
6970
|
-
for (let t = 0; t < e.length; t += 1) {
|
|
6971
|
-
let n = e.charCodeAt(t);
|
|
6972
|
-
if (n < 32 || n === 127) return !0;
|
|
6973
|
-
}
|
|
6974
|
-
return !1;
|
|
6975
|
-
};
|
|
6976
|
-
var s$13 = class extends Error {};
|
|
6977
|
-
var c$9 = (e) => {
|
|
6978
|
-
throw new s$13(e);
|
|
6979
|
-
};
|
|
6980
|
-
var l$5 = (e) => {
|
|
6981
|
-
if (typeof e != "string") return c$9("font.family must be a string");
|
|
6982
|
-
let t = e.trim();
|
|
6983
|
-
return t ? t.length > a$13 ? c$9(`font.family cannot be longer than ${a$13} characters`) : o$16(t) ? c$9("font.family cannot contain control characters") : t : c$9("font.family cannot be empty");
|
|
6984
|
-
};
|
|
6985
|
-
var u$4 = (e) => {
|
|
6986
|
-
if (e === void 0) return [400];
|
|
6987
|
-
if (!Array.isArray(e) || e.length === 0) return c$9("font.weights must be a non-empty list of numbers");
|
|
6988
|
-
let t = e.map((e) => typeof e != "number" || !Number.isInteger(e) || e < 1 || e > 1e3 ? c$9("font.weights must hold whole numbers between 1 and 1000") : e);
|
|
6989
|
-
return [...new Set(t)].sort((e, t) => e - t);
|
|
6990
|
-
};
|
|
6991
|
-
var d$5 = (e) => {
|
|
6992
|
-
if (e === void 0) return ["normal"];
|
|
6993
|
-
if (!Array.isArray(e) || e.length === 0) return c$9("font.styles must be a non-empty list");
|
|
6994
|
-
let t = e.map((e) => e !== "normal" && e !== "italic" ? c$9("font.styles may only hold \"normal\" or \"italic\"") : e);
|
|
6995
|
-
return [...new Set(t)];
|
|
6996
|
-
};
|
|
6997
|
-
var f$4 = (t, n) => {
|
|
6998
|
-
if (!e$25(t)) return c$9(`font.files[${n}] must be an object`);
|
|
6999
|
-
let { weight: r, style: a, format: o, unicodeRange: s } = t;
|
|
7000
|
-
if (typeof r != "number" || !Number.isInteger(r) || r < 1 || r > 1e3) return c$9(`font.files[${n}].weight must be a whole number between 1 and 1000`);
|
|
7001
|
-
if (a !== "normal" && a !== "italic") return c$9(`font.files[${n}].style must be "normal" or "italic"`);
|
|
7002
|
-
if (typeof o != "string" || !i$15.has(o)) return c$9(`font.files[${n}].format must be "woff2" or "woff"`);
|
|
7003
|
-
let l = {
|
|
7004
|
-
weight: r,
|
|
7005
|
-
style: a,
|
|
7006
|
-
format: o
|
|
7007
|
-
};
|
|
7008
|
-
if (s !== void 0) {
|
|
7009
|
-
if (typeof s != "string") return c$9(`font.files[${n}].unicodeRange must be a string`);
|
|
7010
|
-
l.unicodeRange = s;
|
|
7011
|
-
}
|
|
7012
|
-
return l;
|
|
7013
|
-
};
|
|
7014
|
-
var p$4 = (e, t) => typeof e != "string" || !e ? c$9(`font.files[${t}].path must be a non-empty string`) : e.includes("://") || e.startsWith("/") ? c$9(`font.files[${t}].path must be relative to the font store, not a URL`) : e.split("/").includes("..") ? c$9(`font.files[${t}].path cannot climb out of the font store`) : e;
|
|
7015
|
-
var m$4 = (e) => !Array.isArray(e) || e.length === 0 ? c$9("font.files must be a non-empty list") : e;
|
|
7016
|
-
var h$3 = (i) => {
|
|
7017
|
-
if (!e$25(i)) return c$9("a font must be an object");
|
|
7018
|
-
let { source: a, fallback: o, display: s, preload: h } = i;
|
|
7019
|
-
if (typeof a != "string" || !n$18.has(a)) return c$9("font.source must be one of: system, google, remote, hosted");
|
|
7020
|
-
if (typeof o != "string" || !o.trim()) return c$9("font.fallback is required: it is what renders until the face arrives");
|
|
7021
|
-
if (s !== void 0 && (typeof s != "string" || !r$14.has(s))) return c$9("font.display must be one of: auto, block, swap, fallback, optional");
|
|
7022
|
-
if (h !== void 0 && typeof h != "boolean") return c$9("font.preload must be a boolean");
|
|
7023
|
-
let g = {
|
|
7024
|
-
family: l$5(i.family),
|
|
7025
|
-
fallback: o.trim(),
|
|
7026
|
-
weights: u$4(i.weights),
|
|
7027
|
-
styles: d$5(i.styles),
|
|
7028
|
-
...s === void 0 ? {} : { display: s },
|
|
7029
|
-
...h === void 0 ? {} : { preload: h }
|
|
7030
|
-
};
|
|
7031
|
-
if (a === "system") return {
|
|
7032
|
-
...g,
|
|
7033
|
-
source: "system"
|
|
7034
|
-
};
|
|
7035
|
-
if (a === "google") {
|
|
7036
|
-
let { subsets: e } = i;
|
|
7037
|
-
return e !== void 0 && (!Array.isArray(e) || e.some((e) => typeof e != "string")) ? c$9("font.subsets must be a list of strings") : {
|
|
7038
|
-
...g,
|
|
7039
|
-
source: "google",
|
|
7040
|
-
...e === void 0 ? {} : { subsets: e }
|
|
7041
|
-
};
|
|
7042
|
-
}
|
|
7043
|
-
if (a === "remote") {
|
|
7044
|
-
let { stylesheet: e, files: n } = i;
|
|
7045
|
-
return e === void 0 && n === void 0 ? c$9("a remote font needs either a stylesheet URL or the font files themselves") : e === void 0 ? {
|
|
7046
|
-
...g,
|
|
7047
|
-
source: "remote",
|
|
7048
|
-
files: m$4(n).map((e, n) => {
|
|
7049
|
-
let r = f$4(e, n), { url: i } = e;
|
|
7050
|
-
return typeof i != "string" || !i$16(i) ? c$9(`font.files[${n}].url must be an https URL with no credentials in it`) : {
|
|
7051
|
-
...r,
|
|
7052
|
-
url: i
|
|
7053
|
-
};
|
|
7054
|
-
})
|
|
7055
|
-
} : typeof e != "string" || !i$16(e) ? c$9("font.stylesheet must be an https URL with no credentials in it") : {
|
|
7056
|
-
...g,
|
|
7057
|
-
source: "remote",
|
|
7058
|
-
stylesheet: e
|
|
7059
|
-
};
|
|
7060
|
-
}
|
|
7061
|
-
return {
|
|
7062
|
-
...g,
|
|
7063
|
-
source: "hosted",
|
|
7064
|
-
files: m$4(i.files).map((e, t) => ({
|
|
7065
|
-
...f$4(e, t),
|
|
7066
|
-
path: p$4(e.path, t)
|
|
7067
|
-
}))
|
|
7068
|
-
};
|
|
7069
|
-
};
|
|
7070
|
-
//#endregion
|
|
7071
|
-
//#region ../sdk-shared/dist/types/StyleTypes.mjs
|
|
7072
|
-
var e$24 = /* @__PURE__ */ function(e) {
|
|
7073
|
-
return e.COLOR = "color", e.SPACING = "spacing", e.SHADOW = "shadow", e.CUSTOM = "custom", e;
|
|
7074
|
-
}({});
|
|
7075
|
-
var t$20 = Object.values(e$24);
|
|
7076
|
-
var n$17 = (e) => typeof e == "string" && t$20.includes(e);
|
|
6942
|
+
var e$28 = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
7077
6943
|
//#endregion
|
|
7078
|
-
//#region
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
"
|
|
6944
|
+
//#region src/schema/guard.ts
|
|
6945
|
+
/**
|
|
6946
|
+
* The shape checks that stand between a declaration and the document.
|
|
6947
|
+
*
|
|
6948
|
+
* TypeScript says all of this to an author who has it — and not to one writing JavaScript, generating JSON, or
|
|
6949
|
+
* reaching for a cast. Those still reach `authorSpace`, and a key it does not know or a value outside a list is
|
|
6950
|
+
* written into the document, where nothing reads it and nothing reports it. So every field is held here to the same
|
|
6951
|
+
* vocabulary the types declare, and a refusal names what was meant.
|
|
6952
|
+
*/
|
|
6953
|
+
/** Every field each spec takes. `guard.test.ts` holds each list to its type, so a new field cannot be forgotten here. */
|
|
6954
|
+
var SPACE_SPEC_KEYS = [
|
|
6955
|
+
"name",
|
|
6956
|
+
"permanentUrl",
|
|
6957
|
+
"variables",
|
|
6958
|
+
"classes",
|
|
6959
|
+
"elements",
|
|
6960
|
+
"schemaVariables",
|
|
6961
|
+
"customCss",
|
|
6962
|
+
"notifications",
|
|
6963
|
+
"computed",
|
|
6964
|
+
"formats",
|
|
6965
|
+
"flags",
|
|
6966
|
+
"channels",
|
|
6967
|
+
"settings",
|
|
6968
|
+
"rsc",
|
|
6969
|
+
"mode",
|
|
6970
|
+
"theme",
|
|
6971
|
+
"fonts",
|
|
6972
|
+
"pageFolders",
|
|
6973
|
+
"layouts",
|
|
6974
|
+
"components",
|
|
6975
|
+
"pages"
|
|
7090
6976
|
];
|
|
7091
|
-
var
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
"
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
6977
|
+
var COMPONENT_SPEC_KEYS = [
|
|
6978
|
+
"id",
|
|
6979
|
+
"label",
|
|
6980
|
+
"folder",
|
|
6981
|
+
"props",
|
|
6982
|
+
"slots",
|
|
6983
|
+
"root"
|
|
6984
|
+
];
|
|
6985
|
+
var PAGE_SPEC_KEYS = [
|
|
6986
|
+
"name",
|
|
6987
|
+
"id",
|
|
6988
|
+
"slug",
|
|
6989
|
+
"isDefault",
|
|
6990
|
+
"seoTitle",
|
|
6991
|
+
"seoDescription",
|
|
6992
|
+
"accessLevel",
|
|
6993
|
+
"unauthorizedRedirect",
|
|
6994
|
+
"folder",
|
|
6995
|
+
"layout",
|
|
6996
|
+
"css",
|
|
6997
|
+
"selector",
|
|
6998
|
+
"class",
|
|
6999
|
+
"flows",
|
|
7000
|
+
"flag",
|
|
7001
|
+
"body"
|
|
7002
|
+
];
|
|
7003
|
+
var LAYOUT_SPEC_KEYS = [
|
|
7004
|
+
"id",
|
|
7005
|
+
"label",
|
|
7006
|
+
"folder",
|
|
7007
|
+
"layout",
|
|
7008
|
+
"attributes",
|
|
7009
|
+
"css",
|
|
7010
|
+
"states",
|
|
7011
|
+
"selector",
|
|
7012
|
+
"class",
|
|
7013
|
+
"bind",
|
|
7014
|
+
"flows",
|
|
7015
|
+
"body"
|
|
7016
|
+
];
|
|
7017
|
+
var ELEMENT_SPEC_KEYS = [
|
|
7018
|
+
"type",
|
|
7019
|
+
"id",
|
|
7020
|
+
"attributes",
|
|
7021
|
+
"from",
|
|
7022
|
+
"as",
|
|
7023
|
+
"row",
|
|
7024
|
+
"variant",
|
|
7025
|
+
"css",
|
|
7026
|
+
"selector",
|
|
7027
|
+
"states",
|
|
7028
|
+
"class",
|
|
7029
|
+
"slots",
|
|
7030
|
+
"bind",
|
|
7031
|
+
"visible",
|
|
7032
|
+
"flows",
|
|
7033
|
+
"runtime",
|
|
7034
|
+
"loadStrategy",
|
|
7035
|
+
"anchor",
|
|
7036
|
+
"motion",
|
|
7037
|
+
"flag",
|
|
7038
|
+
"children",
|
|
7039
|
+
"meta"
|
|
7040
|
+
];
|
|
7041
|
+
var BINDING_SPEC_KEYS = [
|
|
7042
|
+
"to",
|
|
7043
|
+
"source",
|
|
7044
|
+
"category",
|
|
7045
|
+
"transformers",
|
|
7046
|
+
"when",
|
|
7047
|
+
"enabled"
|
|
7048
|
+
];
|
|
7049
|
+
var STEP_SPEC_KEYS = [
|
|
7050
|
+
"id",
|
|
7051
|
+
"type",
|
|
7052
|
+
"action",
|
|
7053
|
+
"title",
|
|
7054
|
+
"params",
|
|
7055
|
+
"preview",
|
|
7056
|
+
"on",
|
|
7057
|
+
"when",
|
|
7058
|
+
"enabled",
|
|
7059
|
+
"whileRunning"
|
|
7060
|
+
];
|
|
7061
|
+
var PAGE_FOLDER_SPEC_KEYS = [
|
|
7062
|
+
"id",
|
|
7063
|
+
"name",
|
|
7064
|
+
"slug",
|
|
7065
|
+
"parent"
|
|
7066
|
+
];
|
|
7067
|
+
var ELEMENT_STYLE_SPEC_KEYS = [
|
|
7068
|
+
"base",
|
|
7069
|
+
"states",
|
|
7070
|
+
"variants",
|
|
7071
|
+
"ancestors",
|
|
7072
|
+
"slots"
|
|
7073
|
+
];
|
|
7074
|
+
var RUNTIMES = [
|
|
7075
|
+
"server",
|
|
7076
|
+
"client",
|
|
7077
|
+
"shared"
|
|
7078
|
+
];
|
|
7079
|
+
var LOAD_STRATEGIES = [
|
|
7080
|
+
"eager",
|
|
7081
|
+
"lazy",
|
|
7082
|
+
"visible"
|
|
7083
|
+
];
|
|
7084
|
+
var BINDING_CATEGORIES$1 = [
|
|
7085
|
+
"attributes",
|
|
7086
|
+
"style",
|
|
7087
|
+
"initialState"
|
|
7088
|
+
];
|
|
7089
|
+
var ACCESS_LEVELS = ["public", "authenticated"];
|
|
7090
|
+
var STEP_TYPES = [
|
|
7091
|
+
"trigger",
|
|
7092
|
+
"globalCallback",
|
|
7093
|
+
"callback",
|
|
7094
|
+
"utility"
|
|
7095
|
+
];
|
|
7096
|
+
/** Refuses a field the spec does not take, naming the one it probably meant. */
|
|
7097
|
+
function assertKnownKeys(value, keys, where, hint = "") {
|
|
7098
|
+
if (!e$28(value)) throw new AuthoringError("element-shape", `${where} is ${value === null ? "null" : typeof value}, not an object.`);
|
|
7099
|
+
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(", ")}.${hint}`);
|
|
7118
7100
|
}
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7101
|
+
/** Refuses an id nothing can name: empty, or with characters a template or a selector cannot carry. */
|
|
7102
|
+
var assertId = (id, where) => {
|
|
7103
|
+
if (id === void 0) return;
|
|
7104
|
+
if (typeof id !== "string" || !t$25(id)) throw new AuthoringError("id-invalid", `${where}: the id ${JSON.stringify(id)} is not one a binding, a template or a test can name. Use a letter first, then letters, digits, "-" and "_" — like "hero-title".`);
|
|
7105
|
+
};
|
|
7106
|
+
/**
|
|
7107
|
+
* A binding's own shape: the two fields it cannot be written without, and no field it ignores. What the binding
|
|
7108
|
+
* means — its category, its transformers, its templates — is `lintSpace`'s to read in the written document.
|
|
7109
|
+
*/
|
|
7110
|
+
var assertBindingShape = (binding, where) => {
|
|
7111
|
+
assertKnownKeys(binding, BINDING_SPEC_KEYS, `${where}: a binding`);
|
|
7112
|
+
const { to, source } = binding;
|
|
7113
|
+
if (typeof to !== "string" || to.trim() === "") throw new AuthoringError("binding-shape", `${where}: a binding has no \`to\` — the attribute, style property or state key it writes.`);
|
|
7114
|
+
if (typeof source !== "string" || source.trim() === "") throw new AuthoringError("binding-shape", `${where}: the binding of "${to}" has no \`source\` — where its value comes from ('posts.title').`);
|
|
7115
|
+
};
|
|
7116
|
+
/**
|
|
7117
|
+
* A step's or a transformer's params against the catalog that declares them: an unknown key when the set is closed,
|
|
7118
|
+
* a value of the wrong type or outside its options, a required one left out. The first problem, in words, or nothing.
|
|
7119
|
+
*/
|
|
7120
|
+
var paramIssue = (params, spec, where) => {
|
|
7121
|
+
const declared = spec.params ?? {};
|
|
7122
|
+
const provided = params ?? {};
|
|
7123
|
+
const names = Object.keys(declared);
|
|
7124
|
+
if (spec.strictParams) {
|
|
7125
|
+
const unknown = Object.keys(provided).find((key) => !names.includes(key));
|
|
7126
|
+
if (unknown !== void 0) return `${where} has the param "${unknown}", which it does not take${didYouMean(unknown, names) || "."} It takes ${names.length > 0 ? names.join(", ") : "none"}.`;
|
|
7131
7127
|
}
|
|
7132
|
-
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
let t = e$22(i);
|
|
7139
|
-
if (t !== null) r.push(t);
|
|
7140
|
-
else if (n) return [];
|
|
7128
|
+
const effective = s$1(provided, declared, false);
|
|
7129
|
+
const invalid = o$1(provided, effective, declared).at(0);
|
|
7130
|
+
if (invalid) {
|
|
7131
|
+
const value = provided[invalid.key];
|
|
7132
|
+
const suggestion = typeof value === "string" && invalid.options ? didYouMean(value, invalid.options) : "";
|
|
7133
|
+
return invalid.options ? `${where}: "${invalid.key}" is ${JSON.stringify(value)}${suggestion || "."} It is one of ${invalid.options.map((option) => `'${option}'`).join(", ")}.` : `${where}: "${invalid.key}" is ${JSON.stringify(value)} (${invalid.got}), and it takes a ${invalid.expected}.`;
|
|
7141
7134
|
}
|
|
7135
|
+
const missing = n(provided, effective, declared).at(0);
|
|
7136
|
+
return missing === void 0 ? void 0 : `${where} needs "${missing}": ${declared[missing].description}`;
|
|
7137
|
+
};
|
|
7138
|
+
//#endregion
|
|
7139
|
+
//#region ../sdk-schema/dist/helpers/elementTree.mjs
|
|
7140
|
+
var e$27 = (e, t) => t && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
7141
|
+
var t$24 = (t, n) => {
|
|
7142
|
+
let r = [], i = /* @__PURE__ */ new Set([n]);
|
|
7143
|
+
for (let a = e$27(t, e$27(t, n)?.definition.parentId); a && !i.has(a.id);) i.add(a.id), r.push(a.id), a = e$27(t, a.definition.parentId);
|
|
7142
7144
|
return r;
|
|
7143
|
-
}
|
|
7144
|
-
|
|
7145
|
-
|
|
7146
|
-
|
|
7145
|
+
};
|
|
7146
|
+
var n$20 = (n, r) => {
|
|
7147
|
+
let i = [], a = /* @__PURE__ */ new Set([r]), o = (s) => {
|
|
7148
|
+
for (let c of [s, ...t$24(n, s)]) {
|
|
7149
|
+
let t = e$27(n, c);
|
|
7150
|
+
if (c !== s || s !== r) {
|
|
7151
|
+
if (a.has(c)) continue;
|
|
7152
|
+
a.add(c), i.push(c);
|
|
7153
|
+
}
|
|
7154
|
+
let l = t?.definition.type, { layout: u, layoutContainer: d } = t?.attributes ?? {};
|
|
7155
|
+
(l === "page" || l === "layoutContainer") && u && typeof d == "string" && !a.has(d) && o(d);
|
|
7156
|
+
}
|
|
7157
|
+
};
|
|
7158
|
+
return o(r), i;
|
|
7159
|
+
};
|
|
7160
|
+
var r$16 = (t, n) => {
|
|
7161
|
+
let r = [], i = /* @__PURE__ */ new Set([n]), a = (n) => {
|
|
7162
|
+
for (let o of e$27(t, n)?.definition.items ?? []) !i.has(o) && e$27(t, o) && (i.add(o), r.push(o), a(o));
|
|
7163
|
+
};
|
|
7164
|
+
return a(n), r;
|
|
7165
|
+
};
|
|
7147
7166
|
//#endregion
|
|
7148
|
-
//#region
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
|
|
7152
|
-
|
|
7153
|
-
|
|
7154
|
-
|
|
7155
|
-
if (typeof a != "object" || !a) return r;
|
|
7156
|
-
if (Array.isArray(a)) {
|
|
7157
|
-
let t = Number(e);
|
|
7158
|
-
a = a[t];
|
|
7159
|
-
} else a = a[e];
|
|
7160
|
-
}
|
|
7161
|
-
return a === void 0 ? r : a;
|
|
7162
|
-
}
|
|
7167
|
+
//#region ../sdk-shared/dist/style/breakpoints.mjs
|
|
7168
|
+
var e$26 = {
|
|
7169
|
+
desktop: 1024,
|
|
7170
|
+
tablet: 768,
|
|
7171
|
+
mobile: 0
|
|
7172
|
+
};
|
|
7173
|
+
var t$23 = (t) => e$26[t] === 0 ? "0" : `${String(e$26[t] / 16)}rem`;
|
|
7163
7174
|
//#endregion
|
|
7164
|
-
//#region
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
if (typeof a != "object" || !a) return t;
|
|
7172
|
-
let o = a;
|
|
7173
|
-
(o[n] == null || typeof o[n] != "object") && (o[n] = /^\d+$/.test(r) ? [] : {}), a = o[n];
|
|
7174
|
-
}
|
|
7175
|
-
let o = i[i.length - 1];
|
|
7176
|
-
if (typeof a == "object" && a) {
|
|
7177
|
-
let e = a;
|
|
7178
|
-
e[o] = r;
|
|
7179
|
-
}
|
|
7180
|
-
return t;
|
|
7181
|
-
}
|
|
7175
|
+
//#region ../sdk-shared/dist/style/displayModes.mjs
|
|
7176
|
+
var e$25 = [
|
|
7177
|
+
"desktop",
|
|
7178
|
+
"tablet",
|
|
7179
|
+
"mobile"
|
|
7180
|
+
];
|
|
7181
|
+
var t$22 = (t) => e$25.some((e) => e === t);
|
|
7182
7182
|
//#endregion
|
|
7183
|
-
//#region
|
|
7184
|
-
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7183
|
+
//#region ../sdk-shared/dist/style/fonts.mjs
|
|
7184
|
+
var i$16 = (e) => {
|
|
7185
|
+
try {
|
|
7186
|
+
let t = new URL(e);
|
|
7187
|
+
return t.protocol === "https:" && !t.username && !t.password;
|
|
7188
|
+
} catch {
|
|
7189
|
+
return !1;
|
|
7189
7190
|
}
|
|
7190
|
-
|
|
7191
|
+
};
|
|
7192
|
+
//#endregion
|
|
7193
|
+
//#region ../sdk-shared/dist/style/fontValidation.mjs
|
|
7194
|
+
var n$19 = /* @__PURE__ */ new Set([
|
|
7195
|
+
"system",
|
|
7196
|
+
"google",
|
|
7197
|
+
"remote",
|
|
7198
|
+
"hosted"
|
|
7199
|
+
]);
|
|
7200
|
+
var r$15 = /* @__PURE__ */ new Set([
|
|
7201
|
+
"auto",
|
|
7202
|
+
"block",
|
|
7203
|
+
"swap",
|
|
7204
|
+
"fallback",
|
|
7205
|
+
"optional"
|
|
7206
|
+
]);
|
|
7207
|
+
var i$15 = /* @__PURE__ */ new Set(["woff2", "woff"]);
|
|
7208
|
+
var a$13 = 100;
|
|
7209
|
+
var o$16 = (e) => {
|
|
7210
|
+
for (let t = 0; t < e.length; t += 1) {
|
|
7211
|
+
let n = e.charCodeAt(t);
|
|
7212
|
+
if (n < 32 || n === 127) return !0;
|
|
7213
|
+
}
|
|
7214
|
+
return !1;
|
|
7215
|
+
};
|
|
7216
|
+
var s$13 = class extends Error {};
|
|
7217
|
+
var c$10 = (e) => {
|
|
7218
|
+
throw new s$13(e);
|
|
7219
|
+
};
|
|
7220
|
+
var l$6 = (e) => {
|
|
7221
|
+
if (typeof e != "string") return c$10("font.family must be a string");
|
|
7222
|
+
let t = e.trim();
|
|
7223
|
+
return t ? t.length > a$13 ? c$10(`font.family cannot be longer than ${a$13} characters`) : o$16(t) ? c$10("font.family cannot contain control characters") : t : c$10("font.family cannot be empty");
|
|
7224
|
+
};
|
|
7225
|
+
var u$5 = (e) => {
|
|
7226
|
+
if (e === void 0) return [400];
|
|
7227
|
+
if (!Array.isArray(e) || e.length === 0) return c$10("font.weights must be a non-empty list of numbers");
|
|
7228
|
+
let t = e.map((e) => typeof e != "number" || !Number.isInteger(e) || e < 1 || e > 1e3 ? c$10("font.weights must hold whole numbers between 1 and 1000") : e);
|
|
7229
|
+
return [...new Set(t)].sort((e, t) => e - t);
|
|
7230
|
+
};
|
|
7231
|
+
var d$6 = (e) => {
|
|
7232
|
+
if (e === void 0) return ["normal"];
|
|
7233
|
+
if (!Array.isArray(e) || e.length === 0) return c$10("font.styles must be a non-empty list");
|
|
7234
|
+
let t = e.map((e) => e !== "normal" && e !== "italic" ? c$10("font.styles may only hold \"normal\" or \"italic\"") : e);
|
|
7235
|
+
return [...new Set(t)];
|
|
7236
|
+
};
|
|
7237
|
+
var f$4 = (t, n) => {
|
|
7238
|
+
if (!e$28(t)) return c$10(`font.files[${n}] must be an object`);
|
|
7239
|
+
let { weight: r, style: a, format: o, unicodeRange: s } = t;
|
|
7240
|
+
if (typeof r != "number" || !Number.isInteger(r) || r < 1 || r > 1e3) return c$10(`font.files[${n}].weight must be a whole number between 1 and 1000`);
|
|
7241
|
+
if (a !== "normal" && a !== "italic") return c$10(`font.files[${n}].style must be "normal" or "italic"`);
|
|
7242
|
+
if (typeof o != "string" || !i$15.has(o)) return c$10(`font.files[${n}].format must be "woff2" or "woff"`);
|
|
7243
|
+
let l = {
|
|
7244
|
+
weight: r,
|
|
7245
|
+
style: a,
|
|
7246
|
+
format: o
|
|
7247
|
+
};
|
|
7248
|
+
if (s !== void 0) {
|
|
7249
|
+
if (typeof s != "string") return c$10(`font.files[${n}].unicodeRange must be a string`);
|
|
7250
|
+
l.unicodeRange = s;
|
|
7251
|
+
}
|
|
7252
|
+
return l;
|
|
7253
|
+
};
|
|
7254
|
+
var p$4 = (e, t) => typeof e != "string" || !e ? c$10(`font.files[${t}].path must be a non-empty string`) : e.includes("://") || e.startsWith("/") ? c$10(`font.files[${t}].path must be relative to the font store, not a URL`) : e.split("/").includes("..") ? c$10(`font.files[${t}].path cannot climb out of the font store`) : e;
|
|
7255
|
+
var m$5 = (e) => !Array.isArray(e) || e.length === 0 ? c$10("font.files must be a non-empty list") : e;
|
|
7256
|
+
var h$4 = (i) => {
|
|
7257
|
+
if (!e$28(i)) return c$10("a font must be an object");
|
|
7258
|
+
let { source: a, fallback: o, display: s, preload: h } = i;
|
|
7259
|
+
if (typeof a != "string" || !n$19.has(a)) return c$10("font.source must be one of: system, google, remote, hosted");
|
|
7260
|
+
if (typeof o != "string" || !o.trim()) return c$10("font.fallback is required: it is what renders until the face arrives");
|
|
7261
|
+
if (s !== void 0 && (typeof s != "string" || !r$15.has(s))) return c$10("font.display must be one of: auto, block, swap, fallback, optional");
|
|
7262
|
+
if (h !== void 0 && typeof h != "boolean") return c$10("font.preload must be a boolean");
|
|
7263
|
+
let g = {
|
|
7264
|
+
family: l$6(i.family),
|
|
7265
|
+
fallback: o.trim(),
|
|
7266
|
+
weights: u$5(i.weights),
|
|
7267
|
+
styles: d$6(i.styles),
|
|
7268
|
+
...s === void 0 ? {} : { display: s },
|
|
7269
|
+
...h === void 0 ? {} : { preload: h }
|
|
7270
|
+
};
|
|
7271
|
+
if (a === "system") return {
|
|
7272
|
+
...g,
|
|
7273
|
+
source: "system"
|
|
7274
|
+
};
|
|
7275
|
+
if (a === "google") {
|
|
7276
|
+
let { subsets: e } = i;
|
|
7277
|
+
return e !== void 0 && (!Array.isArray(e) || e.some((e) => typeof e != "string")) ? c$10("font.subsets must be a list of strings") : {
|
|
7278
|
+
...g,
|
|
7279
|
+
source: "google",
|
|
7280
|
+
...e === void 0 ? {} : { subsets: e }
|
|
7281
|
+
};
|
|
7282
|
+
}
|
|
7283
|
+
if (a === "remote") {
|
|
7284
|
+
let { stylesheet: e, files: n } = i;
|
|
7285
|
+
return e === void 0 && n === void 0 ? c$10("a remote font needs either a stylesheet URL or the font files themselves") : e === void 0 ? {
|
|
7286
|
+
...g,
|
|
7287
|
+
source: "remote",
|
|
7288
|
+
files: m$5(n).map((e, n) => {
|
|
7289
|
+
let r = f$4(e, n), { url: i } = e;
|
|
7290
|
+
return typeof i != "string" || !i$16(i) ? c$10(`font.files[${n}].url must be an https URL with no credentials in it`) : {
|
|
7291
|
+
...r,
|
|
7292
|
+
url: i
|
|
7293
|
+
};
|
|
7294
|
+
})
|
|
7295
|
+
} : typeof e != "string" || !i$16(e) ? c$10("font.stylesheet must be an https URL with no credentials in it") : {
|
|
7296
|
+
...g,
|
|
7297
|
+
source: "remote",
|
|
7298
|
+
stylesheet: e
|
|
7299
|
+
};
|
|
7300
|
+
}
|
|
7301
|
+
return {
|
|
7302
|
+
...g,
|
|
7303
|
+
source: "hosted",
|
|
7304
|
+
files: m$5(i.files).map((e, t) => ({
|
|
7305
|
+
...f$4(e, t),
|
|
7306
|
+
path: p$4(e.path, t)
|
|
7307
|
+
}))
|
|
7308
|
+
};
|
|
7309
|
+
};
|
|
7310
|
+
//#endregion
|
|
7311
|
+
//#region ../sdk-shared/dist/types/StyleTypes.mjs
|
|
7312
|
+
var e$24 = /* @__PURE__ */ function(e) {
|
|
7313
|
+
return e.COLOR = "color", e.SPACING = "spacing", e.SHADOW = "shadow", e.CUSTOM = "custom", e;
|
|
7314
|
+
}({});
|
|
7315
|
+
var t$21 = Object.values(e$24);
|
|
7316
|
+
var n$18 = (e) => typeof e == "string" && t$21.includes(e);
|
|
7317
|
+
//#endregion
|
|
7318
|
+
//#region ../sdk-shared/dist/style/styleStates.mjs
|
|
7319
|
+
var e$23 = [
|
|
7320
|
+
"hover",
|
|
7321
|
+
"focus",
|
|
7322
|
+
"focus-visible",
|
|
7323
|
+
"focus-within",
|
|
7324
|
+
"active",
|
|
7325
|
+
"disabled",
|
|
7326
|
+
"checked",
|
|
7327
|
+
"visited",
|
|
7328
|
+
"current",
|
|
7329
|
+
"hidden"
|
|
7330
|
+
];
|
|
7331
|
+
var t$20 = "plitzi-component--hidden";
|
|
7332
|
+
var r$14 = {
|
|
7333
|
+
visited: 0,
|
|
7334
|
+
checked: 1,
|
|
7335
|
+
current: 2,
|
|
7336
|
+
"focus-within": 3,
|
|
7337
|
+
hover: 4,
|
|
7338
|
+
focus: 5,
|
|
7339
|
+
"focus-visible": 6,
|
|
7340
|
+
active: 7,
|
|
7341
|
+
disabled: 8,
|
|
7342
|
+
hidden: 9
|
|
7343
|
+
};
|
|
7344
|
+
var i$14 = (e) => Object.hasOwn(r$14, e);
|
|
7345
|
+
var a$12 = (t) => i$14(t) ? r$14[t] : e$23.length;
|
|
7346
|
+
var o$15 = (e) => Object.entries(e).sort(([e], [t]) => a$12(e) - a$12(t));
|
|
7347
|
+
var s$12 = "[aria-current=\"page\"]";
|
|
7348
|
+
var c$9 = (e) => e === "hidden" ? `.${t$20}` : e === "current" ? s$12 : `:${e}`;
|
|
7349
|
+
var l$5 = (e) => e === "hidden";
|
|
7350
|
+
//#endregion
|
|
7351
|
+
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/shared.js
|
|
7352
|
+
function e$22(e) {
|
|
7353
|
+
if (typeof e == "string" || typeof e == "number") {
|
|
7354
|
+
let t = String(e);
|
|
7355
|
+
return t === "" ? null : /^[a-zA-Z0-9_-]+$/.test(t) || /^\d+$/.test(t) ? t : null;
|
|
7356
|
+
}
|
|
7357
|
+
return null;
|
|
7358
|
+
}
|
|
7359
|
+
function t$19(t, n) {
|
|
7360
|
+
if (!t || t.startsWith(".") || t.endsWith(".") || /[^a-zA-Z0-9_.[\]-]/.test(t) || n && (/\.\.|(\[\])/g.test(t) || (t.match(/\[/g) || []).length !== (t.match(/\]/g) || []).length || /\][^.[]/.test(t))) return [];
|
|
7361
|
+
let r = [], i = /([^.[\]]+)|\[(\d+)\]/g, a;
|
|
7362
|
+
for (; a = i.exec(t);) if (a[1]) {
|
|
7363
|
+
if (!n && a[1] === "") continue;
|
|
7364
|
+
let t = e$22(a[1]);
|
|
7365
|
+
if (t !== null) r.push(t);
|
|
7366
|
+
else if (n) return [];
|
|
7367
|
+
} else if (a[2]) {
|
|
7368
|
+
let t = e$22(a[2]);
|
|
7369
|
+
if (t !== null) r.push(t);
|
|
7370
|
+
else if (n) return [];
|
|
7371
|
+
}
|
|
7372
|
+
return r.length ? r : [];
|
|
7373
|
+
}
|
|
7374
|
+
function n$17(t, n) {
|
|
7375
|
+
if (!Array.isArray(t)) return [];
|
|
7376
|
+
let r = [];
|
|
7377
|
+
for (let i of t) {
|
|
7378
|
+
let t = e$22(i);
|
|
7379
|
+
if (t !== null) r.push(t);
|
|
7380
|
+
else if (n) return [];
|
|
7381
|
+
}
|
|
7382
|
+
return r;
|
|
7383
|
+
}
|
|
7384
|
+
function r$13(e, r = !0) {
|
|
7385
|
+
return e ? typeof e == "string" ? t$19(e, r) : Array.isArray(e) ? n$17(e, r) : [] : [];
|
|
7386
|
+
}
|
|
7387
|
+
//#endregion
|
|
7388
|
+
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/get.js
|
|
7389
|
+
function t$18(t, n, r) {
|
|
7390
|
+
if (t == null || !n) return r;
|
|
7391
|
+
let i = r$13(n);
|
|
7392
|
+
if (!i.length) return r;
|
|
7393
|
+
let a = t;
|
|
7394
|
+
for (let e of i) {
|
|
7395
|
+
if (typeof a != "object" || !a) return r;
|
|
7396
|
+
if (Array.isArray(a)) {
|
|
7397
|
+
let t = Number(e);
|
|
7398
|
+
a = a[t];
|
|
7399
|
+
} else a = a[e];
|
|
7400
|
+
}
|
|
7401
|
+
return a === void 0 ? r : a;
|
|
7402
|
+
}
|
|
7403
|
+
//#endregion
|
|
7404
|
+
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/set.js
|
|
7405
|
+
function t$17(t, n, r) {
|
|
7406
|
+
let i = r$13(n);
|
|
7407
|
+
if (!i.length) return t;
|
|
7408
|
+
let a = t;
|
|
7409
|
+
for (let e = 0; e < i.length - 1; e++) {
|
|
7410
|
+
let n = i[e], r = i[e + 1];
|
|
7411
|
+
if (typeof a != "object" || !a) return t;
|
|
7412
|
+
let o = a;
|
|
7413
|
+
(o[n] == null || typeof o[n] != "object") && (o[n] = /^\d+$/.test(r) ? [] : {}), a = o[n];
|
|
7414
|
+
}
|
|
7415
|
+
let o = i[i.length - 1];
|
|
7416
|
+
if (typeof a == "object" && a) {
|
|
7417
|
+
let e = a;
|
|
7418
|
+
e[o] = r;
|
|
7419
|
+
}
|
|
7420
|
+
return t;
|
|
7421
|
+
}
|
|
7422
|
+
//#endregion
|
|
7423
|
+
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/pick.js
|
|
7424
|
+
function n$16(n, r) {
|
|
7425
|
+
let i = {}, a = Array.isArray(r) ? r : [r];
|
|
7426
|
+
for (let r of a) {
|
|
7427
|
+
let a = t$18(n, r);
|
|
7428
|
+
a !== void 0 && t$17(i, r, a);
|
|
7429
|
+
}
|
|
7430
|
+
return i;
|
|
7191
7431
|
}
|
|
7192
7432
|
//#endregion
|
|
7193
7433
|
//#region ../sdk-style/dist/helpers/calculateInheriting.mjs
|
|
7194
|
-
var r$
|
|
7434
|
+
var r$12 = (e, t) => {
|
|
7195
7435
|
let n = [], r = t;
|
|
7196
7436
|
for (; r;) {
|
|
7197
7437
|
n.push(r);
|
|
@@ -7221,10 +7461,10 @@ var i$13 = (e, t, n, r, i) => {
|
|
|
7221
7461
|
return a;
|
|
7222
7462
|
};
|
|
7223
7463
|
var a$11 = (e, n, r, i) => {
|
|
7224
|
-
let a = t$
|
|
7464
|
+
let a = t$18(i, `${e}.defaultStyle`, void 0);
|
|
7225
7465
|
if (a) return a.subTypes && !n && (n = Object.keys(a.subTypes)[0]), n && a.subTypes?.[n] && (a = a.subTypes[n]), {
|
|
7226
7466
|
name: "defaultStyle",
|
|
7227
|
-
attributes: { [r]: t$
|
|
7467
|
+
attributes: { [r]: t$18(a, `style.${r}`, {}) },
|
|
7228
7468
|
componentType: e,
|
|
7229
7469
|
isParent: !1,
|
|
7230
7470
|
isAncestor: !1,
|
|
@@ -7253,12 +7493,12 @@ var o$14 = (e, t, n, r, i) => {
|
|
|
7253
7493
|
};
|
|
7254
7494
|
};
|
|
7255
7495
|
var s$11 = (e, t, n, r, i) => o$14(e.attributes, t, n, r, i);
|
|
7256
|
-
var c$
|
|
7496
|
+
var c$8 = (t, o, c, l, u = {}, d = {}) => {
|
|
7257
7497
|
let { componentSubType: f, styleSelector: p = "base", styleState: m, styleVariant: h, styleAncestor: g, includeSelf: _ = !1, skipSelectors: v = [], addSelectors: y = [] } = d, b = {
|
|
7258
7498
|
tree: [],
|
|
7259
7499
|
style: {},
|
|
7260
7500
|
parentStyle: {}
|
|
7261
|
-
}, x = t ? r$
|
|
7501
|
+
}, x = t ? r$12(c, t) : [], S = /* @__PURE__ */ new Set();
|
|
7262
7502
|
for (let e of Object.keys(l)) {
|
|
7263
7503
|
let n = l[e];
|
|
7264
7504
|
if (n) {
|
|
@@ -7323,7 +7563,7 @@ var c$7 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
7323
7563
|
let C = {};
|
|
7324
7564
|
for (let t of b.tree) {
|
|
7325
7565
|
let r = s$11(t, p, m, h, g);
|
|
7326
|
-
if (r && Object.keys(r).length && ((t.isAncestor || t.isDefault && t.componentType !== o) && (r = n$
|
|
7566
|
+
if (r && Object.keys(r).length && ((t.isAncestor || t.isDefault && t.componentType !== o) && (r = n$16(r, n$22)), Object.keys(r).length)) for (let e of Object.keys(r)) C[e] || (C[e] = []), C[e].push({
|
|
7327
7567
|
key: t.name,
|
|
7328
7568
|
value: r[e],
|
|
7329
7569
|
displayMode: t.displayMode
|
|
@@ -7341,7 +7581,7 @@ var c$7 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
7341
7581
|
};
|
|
7342
7582
|
//#endregion
|
|
7343
7583
|
//#region ../sdk-schema/dist/helpers/FlatMap.mjs
|
|
7344
|
-
var d$
|
|
7584
|
+
var d$5 = class {
|
|
7345
7585
|
flat;
|
|
7346
7586
|
variables;
|
|
7347
7587
|
pages;
|
|
@@ -7350,10 +7590,10 @@ var d$4 = class {
|
|
|
7350
7590
|
constructor(e = {}) {
|
|
7351
7591
|
let { flat: t, variables: r, pages: i, mintId: a, takenElsewhere: o } = e;
|
|
7352
7592
|
if (!t) throw Error("Flat is required");
|
|
7353
|
-
this.flat = t, this.variables = r ?? [], this.pages = i ?? [], this.mintId = a ?? c$
|
|
7593
|
+
this.flat = t, this.variables = r ?? [], this.pages = i ?? [], this.mintId = a ?? c$11, this.takenElsewhere = o ?? (() => !1);
|
|
7354
7594
|
}
|
|
7355
7595
|
nextId = (e, t = () => !1) => {
|
|
7356
|
-
let n = r$
|
|
7596
|
+
let n = r$17(this.flat);
|
|
7357
7597
|
return this.mintId(e, (e) => n.has(e) || this.takenElsewhere(e) || t(e));
|
|
7358
7598
|
};
|
|
7359
7599
|
addElement = (e, n, r = "inside", i = {}) => {
|
|
@@ -7388,12 +7628,12 @@ var d$4 = class {
|
|
|
7388
7628
|
renameElement = (t, n) => this.flat[t] ? t === n ? [] : i$17(this.flat, n) || this.takenElsewhere(n) ? !1 : _$1(this.flat, { [t]: n }, this.pages) : !1;
|
|
7389
7629
|
moveElement = (e, t, n, r = "inside") => {
|
|
7390
7630
|
let i = this.flat[e], a = this.flat[n];
|
|
7391
|
-
if (!i || !a || n === t || t$
|
|
7631
|
+
if (!i || !a || n === t || t$24(this.flat, t).includes(n)) return !1;
|
|
7392
7632
|
let o = this.placement(t, r, [n], n);
|
|
7393
7633
|
return o ? (i.definition.items = (i.definition.items ?? []).filter((e) => e !== n), o.parent.definition.items = o.items, a.definition.parentId = o.parent.id, this.carryRoot(n, o.parent.definition.rootId), !0) : !1;
|
|
7394
7634
|
};
|
|
7395
7635
|
carryRoot = (e, t) => {
|
|
7396
|
-
if (this.flat[e].definition.rootId !== t) for (let n of [e, ...r$
|
|
7636
|
+
if (this.flat[e].definition.rootId !== t) for (let n of [e, ...r$16(this.flat, e)]) this.flat[n].definition.rootId = t;
|
|
7397
7637
|
};
|
|
7398
7638
|
cloneElements = (e, t = "", n = "", s = !1) => {
|
|
7399
7639
|
let c = {
|
|
@@ -7401,9 +7641,9 @@ var d$4 = class {
|
|
|
7401
7641
|
item: void 0
|
|
7402
7642
|
}, l = {}, u = this.flat[e];
|
|
7403
7643
|
if (!u) return c;
|
|
7404
|
-
let d = [e, ...r$
|
|
7644
|
+
let d = [e, ...r$16(this.flat, e)], f = r$17(this.flat);
|
|
7405
7645
|
for (let e of d) {
|
|
7406
|
-
let t = u$
|
|
7646
|
+
let t = u$6(e, (e) => f.has(e) || this.takenElsewhere(e));
|
|
7407
7647
|
f.add(t), l[e] = t;
|
|
7408
7648
|
}
|
|
7409
7649
|
let p = {};
|
|
@@ -7418,7 +7658,7 @@ var d$4 = class {
|
|
|
7418
7658
|
removeElement = (e, t = !1) => {
|
|
7419
7659
|
let n = this.flat[e];
|
|
7420
7660
|
if (!n || n.definition.type === "page" && !t || t && n.attributes.default) return !1;
|
|
7421
|
-
for (let t of r$
|
|
7661
|
+
for (let t of r$16(this.flat, e)) delete this.flat[t];
|
|
7422
7662
|
let r = n.definition.parentId ? this.flat[n.definition.parentId] : void 0;
|
|
7423
7663
|
return r?.definition.items && (r.definition.items = r.definition.items.filter((t) => t !== e)), delete this.flat[e], !0;
|
|
7424
7664
|
};
|
|
@@ -7477,7 +7717,7 @@ var d$4 = class {
|
|
|
7477
7717
|
let o = this.cloneElements(t, a.definition.parentId);
|
|
7478
7718
|
return o.item ? (Object.values(o.acum).forEach((t) => {
|
|
7479
7719
|
let { id: n } = t;
|
|
7480
|
-
if (o.item && (t.definition.rootId = o.item.id), c$
|
|
7720
|
+
if (o.item && (t.definition.rootId = o.item.id), c$8(t, t.definition.type, this.flat, e.platform, {}, { includeSelf: !0 }).tree.forEach((t) => {
|
|
7481
7721
|
let { displayMode: n, name: i } = t;
|
|
7482
7722
|
!(i in r.platform[n]) && i in e.platform[n] && (r.platform[n][i] = e.platform[n][i]);
|
|
7483
7723
|
}), this.variables.length > 0) {
|
|
@@ -7500,7 +7740,7 @@ var d$4 = class {
|
|
|
7500
7740
|
getElementVariables = (e, t, n = this.flat, r = this.variables) => {
|
|
7501
7741
|
let i = [], a = n[t]?.definition.styleSelectors;
|
|
7502
7742
|
if (!a) return i;
|
|
7503
|
-
let o = new RegExp(t$
|
|
7743
|
+
let o = new RegExp(t$26, "g");
|
|
7504
7744
|
return Object.values(a).filter(Boolean).forEach((t) => {
|
|
7505
7745
|
Object.values(e.platform).forEach((e) => {
|
|
7506
7746
|
let n = e[t];
|
|
@@ -7546,13 +7786,13 @@ var o$13 = /* @__PURE__ */ new Set([
|
|
|
7546
7786
|
"id"
|
|
7547
7787
|
]);
|
|
7548
7788
|
var s$10 = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
7549
|
-
var c$
|
|
7789
|
+
var c$7 = (e) => s$10.test(e) ? o$13.has(e) ? `"${e}" is an attribute every instance already has` : null : `"${e}" is not a valid prop name: start with a letter, then letters, numbers and underscores — it is read as {{ props.${e} }}`;
|
|
7550
7790
|
var p$3 = (e, t) => Object.hasOwn(e.components, t) ? e.components[t] : void 0;
|
|
7551
|
-
var m$
|
|
7791
|
+
var m$4 = (e, t) => e.definition.type === "reference" && e.attributes.referenceType === "component" && (t === void 0 || e.attributes.referenceId === t);
|
|
7552
7792
|
//#endregion
|
|
7553
7793
|
//#region ../sdk-shared/dist/navigation/routes.mjs
|
|
7554
|
-
var r$
|
|
7555
|
-
var i$12 = (e) => r$
|
|
7794
|
+
var r$11 = (e) => e.replaceAll(/\/+/g, "/");
|
|
7795
|
+
var i$12 = (e) => r$11(e.replace(/{{([a-zA-Z0-9-_:*/]+)}}/gi, ":$1"));
|
|
7556
7796
|
var a$10 = (e, t) => {
|
|
7557
7797
|
if (!t || !e[t]) return "";
|
|
7558
7798
|
let { slug: n, parentId: r } = e[t];
|
|
@@ -7573,8 +7813,8 @@ function o$12(e, t, n, o = !1) {
|
|
|
7573
7813
|
[i$12(`/${c}`)]: n,
|
|
7574
7814
|
[i$12(`/${n}`)]: n
|
|
7575
7815
|
};
|
|
7576
|
-
if (!l && o) return r$
|
|
7577
|
-
if (!t.find((e) => e.id === l)) return o ? r$
|
|
7816
|
+
if (!l && o) return r$11(`/${c}`);
|
|
7817
|
+
if (!t.find((e) => e.id === l)) return o ? r$11(`/${c}`) : {
|
|
7578
7818
|
[i$12(`/${c}`)]: n,
|
|
7579
7819
|
[i$12(`/${n}`)]: n
|
|
7580
7820
|
};
|
|
@@ -7582,13 +7822,13 @@ function o$12(e, t, n, o = !1) {
|
|
|
7582
7822
|
...e,
|
|
7583
7823
|
[t.id]: t
|
|
7584
7824
|
}), {}), l), c].filter(Boolean).join("/");
|
|
7585
|
-
return o ? r$
|
|
7825
|
+
return o ? r$11(`/${d}`) : {
|
|
7586
7826
|
[i$12(`/${d}`)]: n,
|
|
7587
7827
|
[i$12(`/${n}`)]: n
|
|
7588
7828
|
};
|
|
7589
7829
|
}
|
|
7590
|
-
var d$
|
|
7591
|
-
var f$3 = (e) => d$
|
|
7830
|
+
var d$4 = (e) => !e || typeof e != "string" ? [] : (e.match(/:[a-zA-Z0-9-_:*]+/gim) || []).map((e) => e.replace(":", ""));
|
|
7831
|
+
var f$3 = (e) => d$4(i$12(e));
|
|
7592
7832
|
//#endregion
|
|
7593
7833
|
//#region src/schema/lint/context.ts
|
|
7594
7834
|
/**
|
|
@@ -7663,7 +7903,7 @@ var LintContext = class {
|
|
|
7663
7903
|
/** The component an instance places, when the space declares it. */
|
|
7664
7904
|
instanceOf(element) {
|
|
7665
7905
|
const { referenceId } = element.attributes;
|
|
7666
|
-
return m$
|
|
7906
|
+
return m$4(element) && typeof referenceId === "string" ? p$3(this.schema, referenceId) : void 0;
|
|
7667
7907
|
}
|
|
7668
7908
|
element(id) {
|
|
7669
7909
|
return Object.hasOwn(this.flat, id) ? this.flat[id] : void 0;
|
|
@@ -7696,7 +7936,7 @@ var LintContext = class {
|
|
|
7696
7936
|
const names = this.attributeNames(this.catalogType(element) ?? element.definition.type);
|
|
7697
7937
|
const parentId = element.definition.parentId;
|
|
7698
7938
|
const parent = parentId ? this.element(parentId) : void 0;
|
|
7699
|
-
const extra = [...Object.keys(this.instanceOf(element)?.props ?? {}), ...parent && m$
|
|
7939
|
+
const extra = [...Object.keys(this.instanceOf(element)?.props ?? {}), ...parent && m$4(parent) ? ["slot"] : []];
|
|
7700
7940
|
return names && extra.length > 0 ? [...names, ...extra] : names;
|
|
7701
7941
|
}
|
|
7702
7942
|
/** How a message names an element: its type and id, and the page or layout it is on. */
|
|
@@ -7712,14 +7952,14 @@ var LintContext = class {
|
|
|
7712
7952
|
}
|
|
7713
7953
|
/** The elements `id` is nested in, as the document stores them — what "inside a form" means. */
|
|
7714
7954
|
ancestors(id) {
|
|
7715
|
-
return new Set(t$
|
|
7955
|
+
return new Set(t$24(this.flat, id));
|
|
7716
7956
|
}
|
|
7717
7957
|
/**
|
|
7718
7958
|
* The elements whose sources `id` can read: everything it renders inside, the layout shells around its page included
|
|
7719
7959
|
* — the walk the runtime makes, so a provider beside the slot in a layout is not in it.
|
|
7720
7960
|
*/
|
|
7721
7961
|
scope(id) {
|
|
7722
|
-
return new Set(n$
|
|
7962
|
+
return new Set(n$20(this.flat, id));
|
|
7723
7963
|
}
|
|
7724
7964
|
/** The route params an element's page declares; a layout renders on every page, so it sees all of them. */
|
|
7725
7965
|
routeParams(id) {
|
|
@@ -7816,20 +8056,28 @@ var withPluginCatalogs = (options) => {
|
|
|
7816
8056
|
...rest.slotNames,
|
|
7817
8057
|
...byType((declaration) => Object.keys(declaration.content?.definition?.styleSelectors ?? {}).filter((slot) => slot !== "base"))
|
|
7818
8058
|
},
|
|
8059
|
+
reservedPluginAttributes: {
|
|
8060
|
+
...rest.reservedPluginAttributes,
|
|
8061
|
+
...byType((declaration) => {
|
|
8062
|
+
const reserved = Object.keys(declaration.content?.attributes ?? {}).filter((name) => ELEMENT_SPEC_KEYS.includes(name));
|
|
8063
|
+
return reserved.length > 0 ? reserved : void 0;
|
|
8064
|
+
})
|
|
8065
|
+
},
|
|
8066
|
+
drawsNothingTypes: [...rest.drawsNothingTypes ?? [], ...plugins.filter((declaration) => declaration.drawsNothing === true).flatMap((declaration) => [declaration.type, hostedKey(declaration)])],
|
|
7819
8067
|
leafTypes: [...rest.leafTypes ?? [], ...plugins.filter((declaration) => declaration.content?.definition && !Array.isArray(declaration.content.definition.items)).map((declaration) => declaration.type)]
|
|
7820
8068
|
};
|
|
7821
8069
|
};
|
|
7822
|
-
var n$
|
|
8070
|
+
var n$15 = (e) => {
|
|
7823
8071
|
let t = typeof e == "string" && e.trim() !== "" ? Number(e) : e;
|
|
7824
8072
|
return typeof t == "number" && Number.isInteger(t) && t >= 250 ? t : void 0;
|
|
7825
8073
|
};
|
|
7826
|
-
var t$
|
|
8074
|
+
var t$16 = [
|
|
7827
8075
|
"ctrl",
|
|
7828
8076
|
"alt",
|
|
7829
8077
|
"shift",
|
|
7830
8078
|
"meta"
|
|
7831
8079
|
];
|
|
7832
|
-
var n$
|
|
8080
|
+
var n$14 = {
|
|
7833
8081
|
ctrl: "ctrl",
|
|
7834
8082
|
control: "ctrl",
|
|
7835
8083
|
alt: "alt",
|
|
@@ -7840,7 +8088,7 @@ var n$13 = {
|
|
|
7840
8088
|
command: "meta",
|
|
7841
8089
|
mod: "mod"
|
|
7842
8090
|
};
|
|
7843
|
-
var r$
|
|
8091
|
+
var r$10 = {
|
|
7844
8092
|
esc: "escape",
|
|
7845
8093
|
space: "space",
|
|
7846
8094
|
spacebar: "space",
|
|
@@ -7871,18 +8119,18 @@ var i$11 = /* @__PURE__ */ new Set([
|
|
|
7871
8119
|
"pagedown",
|
|
7872
8120
|
...Array.from({ length: 12 }, (e, t) => `f${t + 1}`)
|
|
7873
8121
|
]);
|
|
7874
|
-
var a$9 = (e, n) => [...t$
|
|
8122
|
+
var a$9 = (e, n) => [...t$16.filter((t) => e.has(t)), n].join("+");
|
|
7875
8123
|
var o$11 = (e, t) => {
|
|
7876
8124
|
let o = e.trim().toLowerCase();
|
|
7877
8125
|
if (!o) return { problem: "an empty shortcut (two commas in a row, or one at the end)" };
|
|
7878
8126
|
let s = o.endsWith("++") ? [...o.slice(0, -2).split("+"), "+"] : o.split("+"), c = o === "+" ? ["+"] : s.filter((e) => e !== ""), l = /* @__PURE__ */ new Set(), u = [];
|
|
7879
8127
|
for (let e of c) {
|
|
7880
|
-
if (Object.hasOwn(n$
|
|
7881
|
-
let r = n$
|
|
8128
|
+
if (Object.hasOwn(n$14, e)) {
|
|
8129
|
+
let r = n$14[e];
|
|
7882
8130
|
l.add(r === "mod" ? t ? "meta" : "ctrl" : r);
|
|
7883
8131
|
continue;
|
|
7884
8132
|
}
|
|
7885
|
-
u.push(Object.hasOwn(r$
|
|
8133
|
+
u.push(Object.hasOwn(r$10, e) ? r$10[e] : e);
|
|
7886
8134
|
}
|
|
7887
8135
|
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"` };
|
|
7888
8136
|
let [d] = u;
|
|
@@ -7986,7 +8234,7 @@ var onKey = (keys) => {
|
|
|
7986
8234
|
* (`when(...)`) — a state an `onMouseEnter` sets, say. `{{ <this step's id>.count }}` is how many times it has ticked.
|
|
7987
8235
|
*/
|
|
7988
8236
|
var onInterval = (ms) => {
|
|
7989
|
-
if (n$
|
|
8237
|
+
if (n$15(ms) === void 0) throw new AuthoringError("trigger-interval", `onInterval(${String(ms)}) is not an interval a flow can repeat on: it takes a whole number of milliseconds, at least 250 — \`onInterval(5000)\` is every five seconds.`);
|
|
7990
8238
|
return on("onInterval", { interval: ms });
|
|
7991
8239
|
};
|
|
7992
8240
|
/**
|
|
@@ -8245,7 +8493,7 @@ var e$19 = {
|
|
|
8245
8493
|
elements: "Only these containers",
|
|
8246
8494
|
none: "None — this only reads"
|
|
8247
8495
|
};
|
|
8248
|
-
var t$
|
|
8496
|
+
var t$15 = (t, n = () => !0) => ({
|
|
8249
8497
|
invalidateQueries: {
|
|
8250
8498
|
type: "select",
|
|
8251
8499
|
description: "What to refresh once the write succeeded, so the page shows the new data: the cached requests to the same site, all of them, only the api containers named in `invalidateElements`, or none for a step that only reads. Containers on screen ask again at once; the rest when they are shown.",
|
|
@@ -8267,7 +8515,7 @@ var t$14 = (t, n = () => !0) => ({
|
|
|
8267
8515
|
});
|
|
8268
8516
|
//#endregion
|
|
8269
8517
|
//#region ../sdk-interactions/dist/sources/ActionsSource/callbacks.mjs
|
|
8270
|
-
var t$
|
|
8518
|
+
var t$14 = {
|
|
8271
8519
|
runServerAction: {
|
|
8272
8520
|
source: "actions",
|
|
8273
8521
|
title: "Run Server Action",
|
|
@@ -8307,7 +8555,7 @@ var t$13 = {
|
|
|
8307
8555
|
default: "",
|
|
8308
8556
|
when: (e) => e.mode !== "detached"
|
|
8309
8557
|
},
|
|
8310
|
-
...t$
|
|
8558
|
+
...t$15([
|
|
8311
8559
|
"all",
|
|
8312
8560
|
"elements",
|
|
8313
8561
|
"none"
|
|
@@ -8717,7 +8965,7 @@ var BUILTIN_GLOBAL_CALLBACKS = {
|
|
|
8717
8965
|
...e$17,
|
|
8718
8966
|
...e$16,
|
|
8719
8967
|
...e$18,
|
|
8720
|
-
...t$
|
|
8968
|
+
...t$14,
|
|
8721
8969
|
...e$15
|
|
8722
8970
|
};
|
|
8723
8971
|
/** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
|
|
@@ -8948,7 +9196,7 @@ var webHook = (params) => utilityStep("webHook", params);
|
|
|
8948
9196
|
var twigTemplate = (params) => utilityStep("twigTemplate", params);
|
|
8949
9197
|
//#endregion
|
|
8950
9198
|
//#region ../sdk-interactions/dist/utility/webHookSpec.mjs
|
|
8951
|
-
var t$
|
|
9199
|
+
var t$13 = (e) => {
|
|
8952
9200
|
let t = typeof e.method == "string" ? e.method.toLowerCase() : "get";
|
|
8953
9201
|
return t === "get" || t === "head";
|
|
8954
9202
|
};
|
|
@@ -9043,21 +9291,21 @@ var BUILTIN_UTILITIES = {
|
|
|
9043
9291
|
description: "Serve a GET from the page’s query cache while it is fresh, and keep the answer there — shared with any api container asking the same thing.",
|
|
9044
9292
|
default: !1,
|
|
9045
9293
|
label: "Cache response",
|
|
9046
|
-
when: t$
|
|
9294
|
+
when: t$13
|
|
9047
9295
|
},
|
|
9048
9296
|
staleTime: {
|
|
9049
9297
|
type: "number",
|
|
9050
9298
|
description: "With `cache`: seconds the answer is served without asking again.",
|
|
9051
9299
|
default: 30,
|
|
9052
9300
|
label: "Fresh for (s)",
|
|
9053
|
-
when: (e) => t$
|
|
9301
|
+
when: (e) => t$13(e) && (e.cache === !0 || e.cache === "true")
|
|
9054
9302
|
},
|
|
9055
|
-
...t$
|
|
9303
|
+
...t$15([
|
|
9056
9304
|
"origin",
|
|
9057
9305
|
"all",
|
|
9058
9306
|
"elements",
|
|
9059
9307
|
"none"
|
|
9060
|
-
], (e) => !t$
|
|
9308
|
+
], (e) => !t$13(e))
|
|
9061
9309
|
},
|
|
9062
9310
|
preview: { response: {
|
|
9063
9311
|
status: "",
|
|
@@ -9085,7 +9333,7 @@ var applyUtility = (action, params) => {
|
|
|
9085
9333
|
var e$13 = "flow.onFailure";
|
|
9086
9334
|
//#endregion
|
|
9087
9335
|
//#region ../sdk-shared/dist/actions/functions.mjs
|
|
9088
|
-
var n$
|
|
9336
|
+
var n$12 = (e) => e === "/fn" || e.startsWith("/fn/");
|
|
9089
9337
|
//#endregion
|
|
9090
9338
|
//#region ../sdk-shared/dist/types/SchemaTypes.mjs
|
|
9091
9339
|
var e$12 = [
|
|
@@ -9113,7 +9361,7 @@ var hostFor = (step, host) => step.type === "trigger" || step.type === "callback
|
|
|
9113
9361
|
var assertStepIds = (ids, where) => {
|
|
9114
9362
|
const seen = /* @__PURE__ */ new Set();
|
|
9115
9363
|
for (const id of ids) {
|
|
9116
|
-
if (!t$
|
|
9364
|
+
if (!t$25(id)) throw new AuthoringError("step-name", `Step "${id}" in ${where} is not a valid name: start with a letter, then letters, numbers, hyphens and underscores. A later step reads this one as {{ ${id}.field }}.`);
|
|
9117
9365
|
if (seen.has(id)) throw new AuthoringError("step-duplicate", `${where} names the step "${id}" twice. A flow's steps are keyed by id, so the second wins.`);
|
|
9118
9366
|
seen.add(id);
|
|
9119
9367
|
}
|
|
@@ -9428,15 +9676,15 @@ var authoringCodesTable = (kind) => {
|
|
|
9428
9676
|
};
|
|
9429
9677
|
//#endregion
|
|
9430
9678
|
//#region ../sdk-shared/dist/flags/schemaFlag.mjs
|
|
9431
|
-
var t$
|
|
9432
|
-
var n$
|
|
9433
|
-
RegExp(`^!?${t$
|
|
9679
|
+
var t$12 = "[A-Za-z_][A-Za-z0-9_]*";
|
|
9680
|
+
var n$11 = RegExp(`^${t$12}$`);
|
|
9681
|
+
RegExp(`^!?${t$12}$`);
|
|
9434
9682
|
var i$10 = /* @__PURE__ */ new Set([
|
|
9435
9683
|
"__proto__",
|
|
9436
9684
|
"constructor",
|
|
9437
9685
|
"prototype"
|
|
9438
9686
|
]);
|
|
9439
|
-
var a$8 = (e) => n$
|
|
9687
|
+
var a$8 = (e) => n$11.test(e) && !i$10.has(e);
|
|
9440
9688
|
//#endregion
|
|
9441
9689
|
//#region ../sdk-shared/dist/flags/resolveFlags.mjs
|
|
9442
9690
|
var i$9 = (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));
|
|
@@ -9469,6 +9717,11 @@ var flagSpecOf = (gate) => gate.is ? gate.name : `!${gate.name}`;
|
|
|
9469
9717
|
*/
|
|
9470
9718
|
var escapeId = (value) => value.replace(/["\\]/g, "\\$&");
|
|
9471
9719
|
var selectorFor = (id) => `[data-plitzi-el="${escapeId(id)}"]`;
|
|
9720
|
+
/**
|
|
9721
|
+
* A component's instance, which has no node of its own: the component's root is drawn where it is placed and carries
|
|
9722
|
+
* the instance's name beside the component's (`data-plitzi-instance`, see `RootElement`).
|
|
9723
|
+
*/
|
|
9724
|
+
var instanceSelectorFor = (id) => `[data-plitzi-instance="${escapeId(id)}"]`;
|
|
9472
9725
|
/** The route for a slug: authoring stores it bare, and everything that navigates wants it absolute. */
|
|
9473
9726
|
var pathForSlug = (slug) => slug ? `/${slug}` : "/";
|
|
9474
9727
|
var buildHandles = (pages, layouts = {}) => {
|
|
@@ -9555,7 +9808,7 @@ var NAMING_ATTRIBUTES = {
|
|
|
9555
9808
|
"title",
|
|
9556
9809
|
"label"
|
|
9557
9810
|
],
|
|
9558
|
-
link: ["label"],
|
|
9811
|
+
link: ["content", "label"],
|
|
9559
9812
|
formControl: ["label"],
|
|
9560
9813
|
text: ["content"],
|
|
9561
9814
|
heading: ["content"],
|
|
@@ -9676,7 +9929,7 @@ var hasWordsInside = (ctx, id) => (ctx.element(id)?.definition.items ?? []).some
|
|
|
9676
9929
|
});
|
|
9677
9930
|
var FIXES = {
|
|
9678
9931
|
button: "Give it a `title` saying what it does — `button({ title: \"Close\", … })` — which is also its tooltip, or words of its own in `content`.",
|
|
9679
|
-
link: "Give it
|
|
9932
|
+
link: "Give it words of its own in `content` — `link({ content: \"Pricing\", … })` — or, where its words are an icon or a picture, a `label` saying where it goes: `link({ label: \"Your profile\", … })`."
|
|
9680
9933
|
};
|
|
9681
9934
|
/** A button, a link or a form field that nothing names. */
|
|
9682
9935
|
var warnUnnamedControl = (ctx, element, where) => {
|
|
@@ -9719,8 +9972,8 @@ var warnClickOnStaticElement = (ctx, element, where) => {
|
|
|
9719
9972
|
var warnIgnoredRegionName = (ctx, element, where) => {
|
|
9720
9973
|
if (element.definition.type !== "container" || !says(ctx, element, "label")) return;
|
|
9721
9974
|
const subType = textOf(attributeValue(ctx, element, "subType"), "div");
|
|
9722
|
-
if (n$
|
|
9723
|
-
ctx.warn("label-ignored", `${where} is a "${subType}" with a \`label\`, which nobody reads: it takes its name from what it holds. Put the words inside it — or, if it is a part of the page of its own, make it one of ${n$
|
|
9975
|
+
if (n$28.some((tag) => tag === subType)) return;
|
|
9976
|
+
ctx.warn("label-ignored", `${where} is a "${subType}" with a \`label\`, which nobody reads: it takes its name from what it holds. Put the words inside it — or, if it is a part of the page of its own, make it one of ${n$28.map((tag) => `'${tag}'`).join(", ")}.`, element.id);
|
|
9724
9977
|
};
|
|
9725
9978
|
/**
|
|
9726
9979
|
* Whether `id`'s subtree holds something a keyboard can reach — or markup the linter cannot read, which may — leaving
|
|
@@ -9797,29 +10050,29 @@ var lintAccessibility = (ctx) => {
|
|
|
9797
10050
|
//#endregion
|
|
9798
10051
|
//#region ../sdk-schema/dist/helpers/styleWithoutTag.mjs
|
|
9799
10052
|
var e$11 = (e) => Object.keys(e ?? {}).length > 0;
|
|
9800
|
-
var t$
|
|
9801
|
-
var n$
|
|
9802
|
-
var r$
|
|
10053
|
+
var t$11 = (t) => Object.values(t ?? {}).some(e$11);
|
|
10054
|
+
var n$10 = (n) => e$11(n.default) || t$11(n.states) || Object.values(n.variants ?? {}).some((n) => e$11(n.default) || t$11(n.states));
|
|
10055
|
+
var r$8 = (e, t) => Object.values(e.platform).some((e) => Object.hasOwn(e, t) && Object.values(e[t].attributes).some(n$10));
|
|
9803
10056
|
var i$8 = (e) => {
|
|
9804
10057
|
let t = e.attributes.subType;
|
|
9805
10058
|
return e.definition.type === "apiContainer" && (typeof t != "string" || t === "");
|
|
9806
10059
|
};
|
|
9807
10060
|
var a$7 = (e, t) => {
|
|
9808
10061
|
if (!i$8(e)) return;
|
|
9809
|
-
let { styleSelectors: n, initialState: a, bindings: o } = e.definition, s = Object.values(n).some((e) => e.split(" ").some((e) => e && r$
|
|
10062
|
+
let { styleSelectors: n, initialState: a, bindings: o } = e.definition, s = Object.values(n).some((e) => e.split(" ").some((e) => e && r$8(t, e))), c = Object.keys(a?.styleVariant ?? {}).length > 0, l = (o?.style?.length ?? 0) > 0;
|
|
9810
10063
|
if (s || c || l) return "has style but no `subType` (container tag), so it renders no element of its own and the style applies to nothing — its children lay out in its parent. Give it a tag (a `subType` of `div`, `section`, …) or move the style onto its parent or a child.";
|
|
9811
10064
|
};
|
|
9812
10065
|
//#endregion
|
|
9813
10066
|
//#region ../sdk-shared/dist/schema/anchor.mjs
|
|
9814
10067
|
var e$10 = /^[a-z][a-z0-9-]*$/;
|
|
9815
|
-
var t$
|
|
10068
|
+
var t$10 = (t) => typeof t == "string" && e$10.test(t);
|
|
9816
10069
|
//#endregion
|
|
9817
10070
|
//#region ../sdk-shared/dist/schema/layoutChain.mjs
|
|
9818
10071
|
var e$9 = (e, t) => {
|
|
9819
10072
|
let n = e?.attributes[t];
|
|
9820
10073
|
return typeof n == "string" ? n : "";
|
|
9821
10074
|
};
|
|
9822
|
-
var t$
|
|
10075
|
+
var t$9 = (t, n, r) => {
|
|
9823
10076
|
let i = [], a = /* @__PURE__ */ new Set(), o = n, s = r;
|
|
9824
10077
|
for (; o && !a.has(o) && i.length < 16;) {
|
|
9825
10078
|
let n = t(o);
|
|
@@ -9831,7 +10084,7 @@ var t$8 = (t, n, r) => {
|
|
|
9831
10084
|
}
|
|
9832
10085
|
return i;
|
|
9833
10086
|
};
|
|
9834
|
-
var n$
|
|
10087
|
+
var n$9 = (t, n) => {
|
|
9835
10088
|
let r = [], i = n;
|
|
9836
10089
|
for (; i && r.length <= 16;) {
|
|
9837
10090
|
if (r.includes(i)) return [...r.slice(r.indexOf(i)), i];
|
|
@@ -9853,7 +10106,7 @@ var attributeText = (element, key) => {
|
|
|
9853
10106
|
/** Every anchor a rendered page carries — its own tree and the layouts around it — with the elements that carry it. */
|
|
9854
10107
|
var anchorsOfPage = (ctx, pageId) => {
|
|
9855
10108
|
const page = ctx.element(pageId);
|
|
9856
|
-
const chain = page ? t$
|
|
10109
|
+
const chain = page ? t$9((id) => ctx.element(id), attributeText(page, "layout"), attributeText(page, "layoutContainer")) : [];
|
|
9857
10110
|
const roots = /* @__PURE__ */ new Set([pageId, ...chain.map((link) => link.layout)]);
|
|
9858
10111
|
const anchors = /* @__PURE__ */ new Map();
|
|
9859
10112
|
Object.values(ctx.flat).forEach((element) => {
|
|
@@ -9865,7 +10118,7 @@ var anchorsOfPage = (ctx, pageId) => {
|
|
|
9865
10118
|
/** One element's own anchor: well formed, on something that renders, and rendered once. */
|
|
9866
10119
|
var lintOwnAnchor = (ctx, element, anchor) => {
|
|
9867
10120
|
const where = ctx.describe(element.id);
|
|
9868
|
-
if (!t$
|
|
10121
|
+
if (!t$10(anchor)) ctx.error("anchor-invalid", `${where} has the anchor ${JSON.stringify(anchor)}. An anchor is the element's id in the URL (\`/page#anchor\`): ${FORMAT} — "${asAnchor(anchor)}".`, element.id);
|
|
9869
10122
|
if (i$8(element)) ctx.error("anchor-no-tag", `${where} has the anchor "${anchor}" but renders no element of its own (no \`subType\`), so there is nothing to scroll to. Put the anchor on the section it wraps, or give it a tag.`, element.id);
|
|
9870
10123
|
if (ctx.component) {
|
|
9871
10124
|
ctx.error("anchor-repeated", `${where} has the anchor "${anchor}", and a component renders its tree once per instance — two instances would put the same id in the page twice. Put the anchor on the element around the instance, on the page.`, element.id);
|
|
@@ -9879,7 +10132,7 @@ var lintLinkHash = (ctx, link, anchorsByPage) => {
|
|
|
9879
10132
|
const hash = attributeText(link, "hash");
|
|
9880
10133
|
if (!hash || attributeText(link, "mode") === "external") return;
|
|
9881
10134
|
const where = ctx.describe(link.id);
|
|
9882
|
-
if (!t$
|
|
10135
|
+
if (!t$10(hash)) {
|
|
9883
10136
|
ctx.error("anchor-invalid", `${where} goes to the section ${JSON.stringify(hash)}: an anchor is ${FORMAT}, written without the "#".`, link.id);
|
|
9884
10137
|
return;
|
|
9885
10138
|
}
|
|
@@ -9926,12 +10179,12 @@ var lintAnchors = (ctx) => {
|
|
|
9926
10179
|
};
|
|
9927
10180
|
//#endregion
|
|
9928
10181
|
//#region ../sdk-shared/dist/realtime/topics.mjs
|
|
9929
|
-
var t$
|
|
9930
|
-
var n$
|
|
9931
|
-
var r$
|
|
9932
|
-
var i$7 = (e) => RegExp(`^${e.split(/(\{[A-Za-z0-9_]+\})/).map((e) => /^\{[A-Za-z0-9_]+\}$/.test(e) ? n$
|
|
10182
|
+
var t$8 = /^[A-Za-z0-9:_.-]{1,128}$/;
|
|
10183
|
+
var n$8 = "[A-Za-z0-9_.-]{1,64}";
|
|
10184
|
+
var r$7 = (e) => t$8.test(e);
|
|
10185
|
+
var i$7 = (e) => RegExp(`^${e.split(/(\{[A-Za-z0-9_]+\})/).map((e) => /^\{[A-Za-z0-9_]+\}$/.test(e) ? n$8 : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("")}$`);
|
|
9933
10186
|
var a$6 = (e, t) => {
|
|
9934
|
-
if (!t || !r$
|
|
10187
|
+
if (!t || !r$7(e)) return;
|
|
9935
10188
|
let n = Object.keys(t).find((t) => i$7(t).test(e));
|
|
9936
10189
|
return n === void 0 ? void 0 : {
|
|
9937
10190
|
pattern: n,
|
|
@@ -9944,11 +10197,11 @@ var s$8 = /* @__PURE__ */ new Set([
|
|
|
9944
10197
|
"session",
|
|
9945
10198
|
"role"
|
|
9946
10199
|
]);
|
|
9947
|
-
var c$
|
|
10200
|
+
var c$6 = (t, n) => {
|
|
9948
10201
|
let r = [];
|
|
9949
|
-
if (o$10.test(t) || r.push("a pattern is letters, digits and `:_.-`, with `{name}` for the part a page fills in — `board:{id}`"), !e$
|
|
9950
|
-
let { access: i, publish: a, presence: c, grant: l, maxMessageBytes: u, messagesPerSecond: d } = n, f = e$
|
|
9951
|
-
typeof f != "string" || !s$8.has(f) ? r.push("`access` is { mode: \"public\" }, { mode: \"session\" } or { mode: \"role\", permissions: […] }") : f === "role" && !(e$
|
|
10202
|
+
if (o$10.test(t) || r.push("a pattern is letters, digits and `:_.-`, with `{name}` for the part a page fills in — `board:{id}`"), !e$28(n)) return [...r, "a channel is an object: `{ access: { mode: \"public\" } }`"];
|
|
10203
|
+
let { access: i, publish: a, presence: c, grant: l, maxMessageBytes: u, messagesPerSecond: d } = n, f = e$28(i) ? i.mode : void 0;
|
|
10204
|
+
typeof f != "string" || !s$8.has(f) ? r.push("`access` is { mode: \"public\" }, { mode: \"session\" } or { mode: \"role\", permissions: […] }") : f === "role" && !(e$28(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");
|
|
9952
10205
|
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`);
|
|
9953
10206
|
return r;
|
|
9954
10207
|
};
|
|
@@ -9963,7 +10216,7 @@ var SAMPLE_SEGMENT = "x";
|
|
|
9963
10216
|
var lintChannels = (ctx) => {
|
|
9964
10217
|
const declared = ctx.schema.settings.channels;
|
|
9965
10218
|
const patterns = Object.keys(declared ?? {});
|
|
9966
|
-
for (const pattern of patterns) for (const problem of c$
|
|
10219
|
+
for (const pattern of patterns) for (const problem of c$6(pattern, declared?.[pattern])) ctx.error("channel-declaration", `Channel "${pattern}": ${problem}.`);
|
|
9967
10220
|
for (const element of Object.values(ctx.flat)) {
|
|
9968
10221
|
if (element.definition.type !== "channel") continue;
|
|
9969
10222
|
if (element.definition.bindings?.attributes?.some((binding) => binding.to === "topic")) continue;
|
|
@@ -10008,14 +10261,14 @@ var lintInstances = (ctx) => {
|
|
|
10008
10261
|
};
|
|
10009
10262
|
//#endregion
|
|
10010
10263
|
//#region ../sdk-elements/dist/elements/media/Svg/sanitizeSvg.mjs
|
|
10011
|
-
var r$
|
|
10012
|
-
var i$6 = (e) => r$
|
|
10264
|
+
var r$6 = /^\s*(?:<!--[\s\S]*?-->\s*)*<svg\b[\s\S]*<\/svg>\s*$/i;
|
|
10265
|
+
var i$6 = (e) => r$6.test(e);
|
|
10013
10266
|
//#endregion
|
|
10014
10267
|
//#region ../sdk-shared/dist/helpers/twigWrapper/filters/filters.mjs
|
|
10015
10268
|
var e$8 = Symbol("twigArrowParams");
|
|
10016
|
-
var t$
|
|
10017
|
-
var n$
|
|
10018
|
-
var r$
|
|
10269
|
+
var t$7 = (e) => e == null || e === "";
|
|
10270
|
+
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));
|
|
10271
|
+
var r$5 = (e) => e === void 0 || typeof e == "function" || typeof e == "symbol" ? "null" : typeof e == "bigint" ? e.toString() : JSON.stringify(e);
|
|
10019
10272
|
var i$5 = (e) => e == null ? "" : String(e);
|
|
10020
10273
|
var a$5 = (e) => {
|
|
10021
10274
|
let t = new TextEncoder().encode(e), n = "";
|
|
@@ -10117,10 +10370,10 @@ var s$7 = (e) => {
|
|
|
10117
10370
|
};
|
|
10118
10371
|
return p(c) + p(l) + p(u) + p(d);
|
|
10119
10372
|
};
|
|
10120
|
-
var c$
|
|
10121
|
-
var u$
|
|
10373
|
+
var c$5 = "__PLITZI_RAW__";
|
|
10374
|
+
var u$4 = (e) => ({
|
|
10122
10375
|
__raw: e,
|
|
10123
|
-
__marker: c$
|
|
10376
|
+
__marker: c$5
|
|
10124
10377
|
});
|
|
10125
10378
|
var f$2 = [
|
|
10126
10379
|
"Sun",
|
|
@@ -10132,7 +10385,7 @@ var f$2 = [
|
|
|
10132
10385
|
"Sat"
|
|
10133
10386
|
];
|
|
10134
10387
|
var p$2 = /* @__PURE__ */ new Map();
|
|
10135
|
-
var m$
|
|
10388
|
+
var m$3 = (e) => {
|
|
10136
10389
|
if (!p$2.has(e)) try {
|
|
10137
10390
|
p$2.set(e, new Intl.DateTimeFormat("en-US", {
|
|
10138
10391
|
timeZone: e,
|
|
@@ -10150,13 +10403,13 @@ var m$2 = (e) => {
|
|
|
10150
10403
|
}
|
|
10151
10404
|
return p$2.get(e) ?? null;
|
|
10152
10405
|
};
|
|
10153
|
-
var h$
|
|
10406
|
+
var h$3 = (e) => {
|
|
10154
10407
|
if (e instanceof Date) return e;
|
|
10155
10408
|
if (typeof e == "number") return new Date(e);
|
|
10156
10409
|
let t = String(e).trim();
|
|
10157
10410
|
return /^-?\d+$/.test(t) ? new Date(Number(t)) : new Date(t);
|
|
10158
10411
|
};
|
|
10159
|
-
var g$
|
|
10412
|
+
var g$2 = (e, t) => {
|
|
10160
10413
|
if (!t) return {
|
|
10161
10414
|
year: e.getFullYear(),
|
|
10162
10415
|
month: e.getMonth() + 1,
|
|
@@ -10166,7 +10419,7 @@ var g$1 = (e, t) => {
|
|
|
10166
10419
|
seconds: e.getSeconds(),
|
|
10167
10420
|
weekday: e.getDay()
|
|
10168
10421
|
};
|
|
10169
|
-
let n = m$
|
|
10422
|
+
let n = m$3(t);
|
|
10170
10423
|
if (!n) return;
|
|
10171
10424
|
let r = n.formatToParts(e), i = (e) => r.find((t) => t.type === e)?.value ?? "";
|
|
10172
10425
|
return {
|
|
@@ -10195,11 +10448,11 @@ var v = (e, t, n) => {
|
|
|
10195
10448
|
return String(e);
|
|
10196
10449
|
};
|
|
10197
10450
|
var y = {
|
|
10198
|
-
raw: (e) => u$
|
|
10199
|
-
to_json: (e) => r$
|
|
10200
|
-
json_encode: (e) => r$
|
|
10451
|
+
raw: (e) => u$4(e),
|
|
10452
|
+
to_json: (e) => r$5(e),
|
|
10453
|
+
json_encode: (e) => r$5(e),
|
|
10201
10454
|
object_as_json: (e) => typeof e == "object" && e ? JSON.stringify(e) : e,
|
|
10202
|
-
default: (e, n) => t$
|
|
10455
|
+
default: (e, n) => t$7(e) ? n[0] : e,
|
|
10203
10456
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
10204
10457
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
|
|
10205
10458
|
trim: (e) => typeof e == "string" ? e.trim() : e,
|
|
@@ -10291,9 +10544,9 @@ var y = {
|
|
|
10291
10544
|
let i = [...t], a = r[0];
|
|
10292
10545
|
if (typeof a == "function") {
|
|
10293
10546
|
let t = a;
|
|
10294
|
-
return (t[e$8] ?? 1) >= 2 ? i.sort((e, n) => Number(t(e, n))) : i.sort((e, r) => n$
|
|
10547
|
+
return (t[e$8] ?? 1) >= 2 ? i.sort((e, n) => Number(t(e, n))) : i.sort((e, r) => n$7(t(e), t(r)));
|
|
10295
10548
|
}
|
|
10296
|
-
return i.sort(n$
|
|
10549
|
+
return i.sort(n$7);
|
|
10297
10550
|
},
|
|
10298
10551
|
batch: (e, t) => {
|
|
10299
10552
|
if (!Array.isArray(e) || t.length === 0) return e;
|
|
@@ -10390,9 +10643,9 @@ var y = {
|
|
|
10390
10643
|
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,
|
|
10391
10644
|
date: (e, t) => {
|
|
10392
10645
|
if (t.length === 0) return e;
|
|
10393
|
-
let n = i$5(t[0]), r = h$
|
|
10646
|
+
let n = i$5(t[0]), r = h$3(e);
|
|
10394
10647
|
if (Number.isNaN(r.getTime())) return "";
|
|
10395
|
-
let a = g$
|
|
10648
|
+
let a = g$2(r, t.length > 1 ? i$5(t[1]) : "");
|
|
10396
10649
|
if (!a) return "";
|
|
10397
10650
|
let o = (e) => String(e).padStart(2, "0"), s = [
|
|
10398
10651
|
"January",
|
|
@@ -10482,341 +10735,147 @@ var y = {
|
|
|
10482
10735
|
let n = i$5(t[0]);
|
|
10483
10736
|
return e.map((e) => typeof e == "object" && e ? e[n] : void 0);
|
|
10484
10737
|
},
|
|
10485
|
-
unique: (e) => Array.isArray(e) ? [...new Set(e)] : e,
|
|
10486
|
-
flatten: (e) => Array.isArray(e) ? e.flat() : e,
|
|
10487
|
-
sum: (e) => Array.isArray(e) ? e.reduce((e, t) => e + (typeof t == "number" ? t : 0), 0) : e,
|
|
10488
|
-
chunk: (e, t) => {
|
|
10489
|
-
if (!Array.isArray(e) || t.length === 0) return e;
|
|
10490
|
-
let n = Number(t[0]);
|
|
10491
|
-
if (n <= 0) return e;
|
|
10492
|
-
let r = [];
|
|
10493
|
-
for (let t = 0; t < e.length; t += n) r.push(e.slice(t, t + n));
|
|
10494
|
-
return r;
|
|
10495
|
-
},
|
|
10496
|
-
index_by: (e, t) => {
|
|
10497
|
-
if (!Array.isArray(e) || t.length === 0) return e;
|
|
10498
|
-
let n = i$5(t[0]), r = {};
|
|
10499
|
-
for (let t of e) if (typeof t == "object" && t) {
|
|
10500
|
-
let e = String(t[n] ?? "");
|
|
10501
|
-
r[e] = t;
|
|
10502
|
-
}
|
|
10503
|
-
return r;
|
|
10504
|
-
},
|
|
10505
|
-
group_by: (e, t) => {
|
|
10506
|
-
if (!Array.isArray(e) || t.length === 0) return e;
|
|
10507
|
-
let n = i$5(t[0]), r = {};
|
|
10508
|
-
for (let t of e) if (typeof t == "object" && t) {
|
|
10509
|
-
let e = String(t[n] ?? "");
|
|
10510
|
-
r[e] = r[e] ?? [], r[e].push(t);
|
|
10511
|
-
}
|
|
10512
|
-
return r;
|
|
10513
|
-
}
|
|
10514
|
-
};
|
|
10515
|
-
//#endregion
|
|
10516
|
-
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs
|
|
10517
|
-
var e$7 = (e) => typeof e == "string" && /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/.test(e);
|
|
10518
|
-
//#endregion
|
|
10519
|
-
//#region ../sdk-shared/dist/helpers/twigWrapper/inspectTemplate.mjs
|
|
10520
|
-
var r$3 = /* @__PURE__ */ new Set([
|
|
10521
|
-
"cycle",
|
|
10522
|
-
"max",
|
|
10523
|
-
"min",
|
|
10524
|
-
"range"
|
|
10525
|
-
]);
|
|
10526
|
-
var i$4 = "loop";
|
|
10527
|
-
var a$4 = class {
|
|
10528
|
-
issues = [];
|
|
10529
|
-
freeNames = /* @__PURE__ */ new Set();
|
|
10530
|
-
nodes(e, t) {
|
|
10531
|
-
let n = new Set(t);
|
|
10532
|
-
for (let t of e) switch (t.type) {
|
|
10533
|
-
case "text":
|
|
10534
|
-
case "break":
|
|
10535
|
-
case "continue": break;
|
|
10536
|
-
case "variable":
|
|
10537
|
-
this.expression(t.expression, n);
|
|
10538
|
-
break;
|
|
10539
|
-
case "if":
|
|
10540
|
-
this.expression(t.condition, n), this.nodes(t.body, n);
|
|
10541
|
-
for (let e of t.elseifClauses) this.expression(e.condition, n), this.nodes(e.body, n);
|
|
10542
|
-
t.elseBody && this.nodes(t.elseBody, n);
|
|
10543
|
-
break;
|
|
10544
|
-
case "for": {
|
|
10545
|
-
this.expression(t.collection, n);
|
|
10546
|
-
let e = /* @__PURE__ */ new Set([
|
|
10547
|
-
...n,
|
|
10548
|
-
t.valueVar,
|
|
10549
|
-
i$4,
|
|
10550
|
-
...t.keyVar ? [t.keyVar] : []
|
|
10551
|
-
]);
|
|
10552
|
-
this.nodes(t.body, e), n = /* @__PURE__ */ new Set([...n, ...this.setsIn(t.body)]), t.elseBody && this.nodes(t.elseBody, n);
|
|
10553
|
-
break;
|
|
10554
|
-
}
|
|
10555
|
-
case "set":
|
|
10556
|
-
Array.isArray(t.value) ? this.nodes(t.value, n) : this.expression(t.value, n), n = /* @__PURE__ */ new Set([...n, t.name]);
|
|
10557
|
-
break;
|
|
10558
|
-
case "apply":
|
|
10559
|
-
this.filterNames(t.filters.map((e) => e.name));
|
|
10560
|
-
for (let e of t.filters) e.args.forEach((e) => this.expression(e, n));
|
|
10561
|
-
this.nodes(t.body, n);
|
|
10562
|
-
}
|
|
10563
|
-
return n;
|
|
10564
|
-
}
|
|
10565
|
-
setsIn(e) {
|
|
10566
|
-
return e.flatMap((e) => e.type === "set" ? [e.name] : []);
|
|
10567
|
-
}
|
|
10568
|
-
filterNames(t) {
|
|
10569
|
-
for (let n of t) n && !Object.hasOwn(y, n) && this.issues.push(`Unknown filter "${n}"`);
|
|
10570
|
-
}
|
|
10571
|
-
expression(e, t) {
|
|
10572
|
-
switch (e.type) {
|
|
10573
|
-
case "literal": return;
|
|
10574
|
-
case "array":
|
|
10575
|
-
e.elements.forEach((e) => this.expression(e, t));
|
|
10576
|
-
return;
|
|
10577
|
-
case "object":
|
|
10578
|
-
for (let n of e.entries) this.expression(n.key, t), this.expression(n.value, t);
|
|
10579
|
-
return;
|
|
10580
|
-
case "range":
|
|
10581
|
-
this.expression(e.start, t), this.expression(e.end, t);
|
|
10582
|
-
return;
|
|
10583
|
-
case "path":
|
|
10584
|
-
t.has(e.segments[0]) || this.freeNames.add(e.segments[0]);
|
|
10585
|
-
return;
|
|
10586
|
-
case "index":
|
|
10587
|
-
this.expression(e.object, t), this.expression(e.index, t);
|
|
10588
|
-
return;
|
|
10589
|
-
case "function":
|
|
10590
|
-
r$3.has(e.name) || this.issues.push(`Unknown function "${e.name}()": the functions are ${[...r$3].join(", ")}`), e.args.forEach((e) => this.expression(e, t));
|
|
10591
|
-
return;
|
|
10592
|
-
case "filter":
|
|
10593
|
-
this.expression(e.subject, t), this.filterNames(e.filters.map((e) => e.name));
|
|
10594
|
-
for (let n of e.filters) n.args.forEach((e) => this.expression(e, t));
|
|
10595
|
-
return;
|
|
10596
|
-
case "concat":
|
|
10597
|
-
e.parts.forEach((e) => this.expression(e, t));
|
|
10598
|
-
return;
|
|
10599
|
-
case "unary":
|
|
10600
|
-
this.expression(e.operand, t);
|
|
10601
|
-
return;
|
|
10602
|
-
case "binary":
|
|
10603
|
-
this.expression(e.left, t), (e.operator !== "is" && e.operator !== "is not" || e.right.type !== "path") && this.expression(e.right, t);
|
|
10604
|
-
return;
|
|
10605
|
-
case "default":
|
|
10606
|
-
this.expression(e.value, t), this.expression(e.defaultExpr, t);
|
|
10607
|
-
return;
|
|
10608
|
-
case "ternary":
|
|
10609
|
-
this.expression(e.condition, t), e.trueExpr && this.expression(e.trueExpr, t), this.expression(e.falseExpr, t);
|
|
10610
|
-
return;
|
|
10611
|
-
case "arrow": this.expression(e.body, /* @__PURE__ */ new Set([...t, ...e.params]));
|
|
10612
|
-
}
|
|
10613
|
-
}
|
|
10614
|
-
};
|
|
10615
|
-
var o$8 = (e) => {
|
|
10616
|
-
let r = e$32(e);
|
|
10617
|
-
if (r.error) return {
|
|
10618
|
-
issues: [r.error],
|
|
10619
|
-
freeNames: []
|
|
10620
|
-
};
|
|
10621
|
-
let i = new a$4(), { nodes: o, error: s } = c$12(r.tokens, !1, i.issues);
|
|
10622
|
-
return s && i.issues.push(s), i.nodes(o, /* @__PURE__ */ new Set()), {
|
|
10623
|
-
issues: [...new Set(i.issues)],
|
|
10624
|
-
freeNames: [...i.freeNames]
|
|
10625
|
-
};
|
|
10626
|
-
};
|
|
10627
|
-
//#endregion
|
|
10628
|
-
//#region src/schema/guard.ts
|
|
10629
|
-
/**
|
|
10630
|
-
* The shape checks that stand between a declaration and the document.
|
|
10631
|
-
*
|
|
10632
|
-
* TypeScript says all of this to an author who has it — and not to one writing JavaScript, generating JSON, or
|
|
10633
|
-
* reaching for a cast. Those still reach `authorSpace`, and a key it does not know or a value outside a list is
|
|
10634
|
-
* written into the document, where nothing reads it and nothing reports it. So every field is held here to the same
|
|
10635
|
-
* vocabulary the types declare, and a refusal names what was meant.
|
|
10636
|
-
*/
|
|
10637
|
-
/** Every field each spec takes. `guard.test.ts` holds each list to its type, so a new field cannot be forgotten here. */
|
|
10638
|
-
var SPACE_SPEC_KEYS = [
|
|
10639
|
-
"name",
|
|
10640
|
-
"permanentUrl",
|
|
10641
|
-
"variables",
|
|
10642
|
-
"classes",
|
|
10643
|
-
"elements",
|
|
10644
|
-
"schemaVariables",
|
|
10645
|
-
"customCss",
|
|
10646
|
-
"notifications",
|
|
10647
|
-
"computed",
|
|
10648
|
-
"formats",
|
|
10649
|
-
"flags",
|
|
10650
|
-
"channels",
|
|
10651
|
-
"settings",
|
|
10652
|
-
"rsc",
|
|
10653
|
-
"mode",
|
|
10654
|
-
"theme",
|
|
10655
|
-
"fonts",
|
|
10656
|
-
"pageFolders",
|
|
10657
|
-
"layouts",
|
|
10658
|
-
"components",
|
|
10659
|
-
"pages"
|
|
10660
|
-
];
|
|
10661
|
-
var COMPONENT_SPEC_KEYS = [
|
|
10662
|
-
"id",
|
|
10663
|
-
"label",
|
|
10664
|
-
"folder",
|
|
10665
|
-
"props",
|
|
10666
|
-
"slots",
|
|
10667
|
-
"root"
|
|
10668
|
-
];
|
|
10669
|
-
var PAGE_SPEC_KEYS = [
|
|
10670
|
-
"name",
|
|
10671
|
-
"id",
|
|
10672
|
-
"slug",
|
|
10673
|
-
"isDefault",
|
|
10674
|
-
"seoTitle",
|
|
10675
|
-
"seoDescription",
|
|
10676
|
-
"accessLevel",
|
|
10677
|
-
"unauthorizedRedirect",
|
|
10678
|
-
"folder",
|
|
10679
|
-
"layout",
|
|
10680
|
-
"css",
|
|
10681
|
-
"selector",
|
|
10682
|
-
"class",
|
|
10683
|
-
"flows",
|
|
10684
|
-
"flag",
|
|
10685
|
-
"body"
|
|
10686
|
-
];
|
|
10687
|
-
var LAYOUT_SPEC_KEYS = [
|
|
10688
|
-
"id",
|
|
10689
|
-
"label",
|
|
10690
|
-
"folder",
|
|
10691
|
-
"layout",
|
|
10692
|
-
"attributes",
|
|
10693
|
-
"css",
|
|
10694
|
-
"states",
|
|
10695
|
-
"selector",
|
|
10696
|
-
"class",
|
|
10697
|
-
"bind",
|
|
10698
|
-
"flows",
|
|
10699
|
-
"body"
|
|
10700
|
-
];
|
|
10701
|
-
var ELEMENT_SPEC_KEYS = [
|
|
10702
|
-
"type",
|
|
10703
|
-
"id",
|
|
10704
|
-
"attributes",
|
|
10705
|
-
"from",
|
|
10706
|
-
"as",
|
|
10707
|
-
"row",
|
|
10708
|
-
"variant",
|
|
10709
|
-
"css",
|
|
10710
|
-
"selector",
|
|
10711
|
-
"states",
|
|
10712
|
-
"class",
|
|
10713
|
-
"slots",
|
|
10714
|
-
"bind",
|
|
10715
|
-
"visible",
|
|
10716
|
-
"flows",
|
|
10717
|
-
"runtime",
|
|
10718
|
-
"loadStrategy",
|
|
10719
|
-
"anchor",
|
|
10720
|
-
"flag",
|
|
10721
|
-
"children",
|
|
10722
|
-
"meta"
|
|
10723
|
-
];
|
|
10724
|
-
var BINDING_SPEC_KEYS = [
|
|
10725
|
-
"to",
|
|
10726
|
-
"source",
|
|
10727
|
-
"category",
|
|
10728
|
-
"transformers",
|
|
10729
|
-
"when",
|
|
10730
|
-
"enabled"
|
|
10731
|
-
];
|
|
10732
|
-
var STEP_SPEC_KEYS = [
|
|
10733
|
-
"id",
|
|
10734
|
-
"type",
|
|
10735
|
-
"action",
|
|
10736
|
-
"title",
|
|
10737
|
-
"params",
|
|
10738
|
-
"preview",
|
|
10739
|
-
"on",
|
|
10740
|
-
"when",
|
|
10741
|
-
"enabled",
|
|
10742
|
-
"whileRunning"
|
|
10743
|
-
];
|
|
10744
|
-
var PAGE_FOLDER_SPEC_KEYS = [
|
|
10745
|
-
"id",
|
|
10746
|
-
"name",
|
|
10747
|
-
"slug",
|
|
10748
|
-
"parent"
|
|
10749
|
-
];
|
|
10750
|
-
var ELEMENT_STYLE_SPEC_KEYS = [
|
|
10751
|
-
"base",
|
|
10752
|
-
"states",
|
|
10753
|
-
"variants",
|
|
10754
|
-
"ancestors",
|
|
10755
|
-
"slots"
|
|
10756
|
-
];
|
|
10757
|
-
var RUNTIMES = [
|
|
10758
|
-
"server",
|
|
10759
|
-
"client",
|
|
10760
|
-
"shared"
|
|
10761
|
-
];
|
|
10762
|
-
var LOAD_STRATEGIES = [
|
|
10763
|
-
"eager",
|
|
10764
|
-
"lazy",
|
|
10765
|
-
"visible"
|
|
10766
|
-
];
|
|
10767
|
-
var BINDING_CATEGORIES$1 = [
|
|
10768
|
-
"attributes",
|
|
10769
|
-
"style",
|
|
10770
|
-
"initialState"
|
|
10771
|
-
];
|
|
10772
|
-
var ACCESS_LEVELS = ["public", "authenticated"];
|
|
10773
|
-
var STEP_TYPES = [
|
|
10774
|
-
"trigger",
|
|
10775
|
-
"globalCallback",
|
|
10776
|
-
"callback",
|
|
10777
|
-
"utility"
|
|
10778
|
-
];
|
|
10779
|
-
/** Refuses a field the spec does not take, naming the one it probably meant. */
|
|
10780
|
-
function assertKnownKeys(value, keys, where, hint = "") {
|
|
10781
|
-
if (!e$25(value)) throw new AuthoringError("element-shape", `${where} is ${value === null ? "null" : typeof value}, not an object.`);
|
|
10782
|
-
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(", ")}.${hint}`);
|
|
10783
|
-
}
|
|
10784
|
-
/** Refuses an id nothing can name: empty, or with characters a template or a selector cannot carry. */
|
|
10785
|
-
var assertId = (id, where) => {
|
|
10786
|
-
if (id === void 0) return;
|
|
10787
|
-
if (typeof id !== "string" || !t$24(id)) throw new AuthoringError("id-invalid", `${where}: the id ${JSON.stringify(id)} is not one a binding, a template or a test can name. Use a letter first, then letters, digits, "-" and "_" — like "hero-title".`);
|
|
10788
|
-
};
|
|
10789
|
-
/**
|
|
10790
|
-
* A binding's own shape: the two fields it cannot be written without, and no field it ignores. What the binding
|
|
10791
|
-
* means — its category, its transformers, its templates — is `lintSpace`'s to read in the written document.
|
|
10792
|
-
*/
|
|
10793
|
-
var assertBindingShape = (binding, where) => {
|
|
10794
|
-
assertKnownKeys(binding, BINDING_SPEC_KEYS, `${where}: a binding`);
|
|
10795
|
-
const { to, source } = binding;
|
|
10796
|
-
if (typeof to !== "string" || to.trim() === "") throw new AuthoringError("binding-shape", `${where}: a binding has no \`to\` — the attribute, style property or state key it writes.`);
|
|
10797
|
-
if (typeof source !== "string" || source.trim() === "") throw new AuthoringError("binding-shape", `${where}: the binding of "${to}" has no \`source\` — where its value comes from ('posts.title').`);
|
|
10738
|
+
unique: (e) => Array.isArray(e) ? [...new Set(e)] : e,
|
|
10739
|
+
flatten: (e) => Array.isArray(e) ? e.flat() : e,
|
|
10740
|
+
sum: (e) => Array.isArray(e) ? e.reduce((e, t) => e + (typeof t == "number" ? t : 0), 0) : e,
|
|
10741
|
+
chunk: (e, t) => {
|
|
10742
|
+
if (!Array.isArray(e) || t.length === 0) return e;
|
|
10743
|
+
let n = Number(t[0]);
|
|
10744
|
+
if (n <= 0) return e;
|
|
10745
|
+
let r = [];
|
|
10746
|
+
for (let t = 0; t < e.length; t += n) r.push(e.slice(t, t + n));
|
|
10747
|
+
return r;
|
|
10748
|
+
},
|
|
10749
|
+
index_by: (e, t) => {
|
|
10750
|
+
if (!Array.isArray(e) || t.length === 0) return e;
|
|
10751
|
+
let n = i$5(t[0]), r = {};
|
|
10752
|
+
for (let t of e) if (typeof t == "object" && t) {
|
|
10753
|
+
let e = String(t[n] ?? "");
|
|
10754
|
+
r[e] = t;
|
|
10755
|
+
}
|
|
10756
|
+
return r;
|
|
10757
|
+
},
|
|
10758
|
+
group_by: (e, t) => {
|
|
10759
|
+
if (!Array.isArray(e) || t.length === 0) return e;
|
|
10760
|
+
let n = i$5(t[0]), r = {};
|
|
10761
|
+
for (let t of e) if (typeof t == "object" && t) {
|
|
10762
|
+
let e = String(t[n] ?? "");
|
|
10763
|
+
r[e] = r[e] ?? [], r[e].push(t);
|
|
10764
|
+
}
|
|
10765
|
+
return r;
|
|
10766
|
+
}
|
|
10798
10767
|
};
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10768
|
+
//#endregion
|
|
10769
|
+
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs
|
|
10770
|
+
var e$7 = (e) => typeof e == "string" && /\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/.test(e);
|
|
10771
|
+
//#endregion
|
|
10772
|
+
//#region ../sdk-shared/dist/helpers/twigWrapper/inspectTemplate.mjs
|
|
10773
|
+
var r$4 = /* @__PURE__ */ new Set([
|
|
10774
|
+
"cycle",
|
|
10775
|
+
"max",
|
|
10776
|
+
"min",
|
|
10777
|
+
"range"
|
|
10778
|
+
]);
|
|
10779
|
+
var i$4 = "loop";
|
|
10780
|
+
var a$4 = class {
|
|
10781
|
+
issues = [];
|
|
10782
|
+
freeNames = /* @__PURE__ */ new Set();
|
|
10783
|
+
nodes(e, t) {
|
|
10784
|
+
let n = new Set(t);
|
|
10785
|
+
for (let t of e) switch (t.type) {
|
|
10786
|
+
case "text":
|
|
10787
|
+
case "break":
|
|
10788
|
+
case "continue": break;
|
|
10789
|
+
case "variable":
|
|
10790
|
+
this.expression(t.expression, n);
|
|
10791
|
+
break;
|
|
10792
|
+
case "if":
|
|
10793
|
+
this.expression(t.condition, n), this.nodes(t.body, n);
|
|
10794
|
+
for (let e of t.elseifClauses) this.expression(e.condition, n), this.nodes(e.body, n);
|
|
10795
|
+
t.elseBody && this.nodes(t.elseBody, n);
|
|
10796
|
+
break;
|
|
10797
|
+
case "for": {
|
|
10798
|
+
this.expression(t.collection, n);
|
|
10799
|
+
let e = /* @__PURE__ */ new Set([
|
|
10800
|
+
...n,
|
|
10801
|
+
t.valueVar,
|
|
10802
|
+
i$4,
|
|
10803
|
+
...t.keyVar ? [t.keyVar] : []
|
|
10804
|
+
]);
|
|
10805
|
+
this.nodes(t.body, e), n = /* @__PURE__ */ new Set([...n, ...this.setsIn(t.body)]), t.elseBody && this.nodes(t.elseBody, n);
|
|
10806
|
+
break;
|
|
10807
|
+
}
|
|
10808
|
+
case "set":
|
|
10809
|
+
Array.isArray(t.value) ? this.nodes(t.value, n) : this.expression(t.value, n), n = /* @__PURE__ */ new Set([...n, t.name]);
|
|
10810
|
+
break;
|
|
10811
|
+
case "apply":
|
|
10812
|
+
this.filterNames(t.filters.map((e) => e.name));
|
|
10813
|
+
for (let e of t.filters) e.args.forEach((e) => this.expression(e, n));
|
|
10814
|
+
this.nodes(t.body, n);
|
|
10815
|
+
}
|
|
10816
|
+
return n;
|
|
10810
10817
|
}
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
if (invalid) {
|
|
10814
|
-
const value = provided[invalid.key];
|
|
10815
|
-
const suggestion = typeof value === "string" && invalid.options ? didYouMean(value, invalid.options) : "";
|
|
10816
|
-
return invalid.options ? `${where}: "${invalid.key}" is ${JSON.stringify(value)}${suggestion || "."} It is one of ${invalid.options.map((option) => `'${option}'`).join(", ")}.` : `${where}: "${invalid.key}" is ${JSON.stringify(value)} (${invalid.got}), and it takes a ${invalid.expected}.`;
|
|
10818
|
+
setsIn(e) {
|
|
10819
|
+
return e.flatMap((e) => e.type === "set" ? [e.name] : []);
|
|
10817
10820
|
}
|
|
10818
|
-
|
|
10819
|
-
|
|
10821
|
+
filterNames(t) {
|
|
10822
|
+
for (let n of t) n && !Object.hasOwn(y, n) && this.issues.push(`Unknown filter "${n}"`);
|
|
10823
|
+
}
|
|
10824
|
+
expression(e, t) {
|
|
10825
|
+
switch (e.type) {
|
|
10826
|
+
case "literal": return;
|
|
10827
|
+
case "array":
|
|
10828
|
+
e.elements.forEach((e) => this.expression(e, t));
|
|
10829
|
+
return;
|
|
10830
|
+
case "object":
|
|
10831
|
+
for (let n of e.entries) this.expression(n.key, t), this.expression(n.value, t);
|
|
10832
|
+
return;
|
|
10833
|
+
case "range":
|
|
10834
|
+
this.expression(e.start, t), this.expression(e.end, t);
|
|
10835
|
+
return;
|
|
10836
|
+
case "path":
|
|
10837
|
+
t.has(e.segments[0]) || this.freeNames.add(e.segments[0]);
|
|
10838
|
+
return;
|
|
10839
|
+
case "index":
|
|
10840
|
+
this.expression(e.object, t), this.expression(e.index, t);
|
|
10841
|
+
return;
|
|
10842
|
+
case "function":
|
|
10843
|
+
r$4.has(e.name) || this.issues.push(`Unknown function "${e.name}()": the functions are ${[...r$4].join(", ")}`), e.args.forEach((e) => this.expression(e, t));
|
|
10844
|
+
return;
|
|
10845
|
+
case "filter":
|
|
10846
|
+
this.expression(e.subject, t), this.filterNames(e.filters.map((e) => e.name));
|
|
10847
|
+
for (let n of e.filters) n.args.forEach((e) => this.expression(e, t));
|
|
10848
|
+
return;
|
|
10849
|
+
case "concat":
|
|
10850
|
+
e.parts.forEach((e) => this.expression(e, t));
|
|
10851
|
+
return;
|
|
10852
|
+
case "unary":
|
|
10853
|
+
this.expression(e.operand, t);
|
|
10854
|
+
return;
|
|
10855
|
+
case "binary":
|
|
10856
|
+
this.expression(e.left, t), (e.operator !== "is" && e.operator !== "is not" || e.right.type !== "path") && this.expression(e.right, t);
|
|
10857
|
+
return;
|
|
10858
|
+
case "default":
|
|
10859
|
+
this.expression(e.value, t), this.expression(e.defaultExpr, t);
|
|
10860
|
+
return;
|
|
10861
|
+
case "ternary":
|
|
10862
|
+
this.expression(e.condition, t), e.trueExpr && this.expression(e.trueExpr, t), this.expression(e.falseExpr, t);
|
|
10863
|
+
return;
|
|
10864
|
+
case "arrow": this.expression(e.body, /* @__PURE__ */ new Set([...t, ...e.params]));
|
|
10865
|
+
}
|
|
10866
|
+
}
|
|
10867
|
+
};
|
|
10868
|
+
var o$8 = (e) => {
|
|
10869
|
+
let r = e$32(e);
|
|
10870
|
+
if (r.error) return {
|
|
10871
|
+
issues: [r.error],
|
|
10872
|
+
freeNames: []
|
|
10873
|
+
};
|
|
10874
|
+
let i = new a$4(), { nodes: o, error: s } = c$13(r.tokens, !1, i.issues);
|
|
10875
|
+
return s && i.issues.push(s), i.nodes(o, /* @__PURE__ */ new Set()), {
|
|
10876
|
+
issues: [...new Set(i.issues)],
|
|
10877
|
+
freeNames: [...i.freeNames]
|
|
10878
|
+
};
|
|
10820
10879
|
};
|
|
10821
10880
|
//#endregion
|
|
10822
10881
|
//#region src/schema/lint/pages.ts
|
|
@@ -10858,7 +10917,7 @@ var lintPages = (ctx) => {
|
|
|
10858
10917
|
const { accessLevel, slug, folder } = page.attributes;
|
|
10859
10918
|
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);
|
|
10860
10919
|
const path = `/${[typeof folder === "string" && folder ? folderPath(ctx, folder) : "", textOf(slug)].filter(Boolean).join("/")}`;
|
|
10861
|
-
if (n$
|
|
10920
|
+
if (n$12(path)) ctx.error("page-route-reserved", `${where} answers at ${path}, under /fn — which is where the space's functions answer, never a page. Give it another slug (or its folder another one).`, pageId);
|
|
10862
10921
|
const key = `${path} ${typeof accessLevel === "string" && accessLevel ? accessLevel : "everyone"}`;
|
|
10863
10922
|
const earlier = routes.get(key);
|
|
10864
10923
|
if (earlier !== void 0) ctx.error("page-route-taken", `${where} answers at ${path} for the same visitors as ${earlier}, so one of them can never be reached. Give it another slug — or, for a sign-in page and the page behind it, \`accessLevel\` 'public' on one and 'authenticated' on the other.`, pageId);
|
|
@@ -11040,7 +11099,7 @@ var checkAttributes = (ctx, element, where) => {
|
|
|
11040
11099
|
ctx.error("unknown-attribute", `${where} sets "${name}", which a "${type}" never reads${didYouMean(name, names) || "."}${trigger || ` It reads ${names.join(", ")}.`}`, element.id);
|
|
11041
11100
|
continue;
|
|
11042
11101
|
}
|
|
11043
|
-
if (value === void 0 || value === null || typeof value === "string" && n$
|
|
11102
|
+
if (value === void 0 || value === null || typeof value === "string" && n$41(value)) continue;
|
|
11044
11103
|
if (Object.hasOwn(enums, name) && !(typeof value === "string" && enums[name].includes(value))) {
|
|
11045
11104
|
ctx.error("attribute-value", `${where}: \`${name}\` is ${JSON.stringify(value)}${typeof value === "string" && didYouMean(value, enums[name]) || "."} It is one of ${enums[name].map((item) => `'${item}'`).join(", ")}.`, element.id);
|
|
11046
11105
|
continue;
|
|
@@ -11138,16 +11197,16 @@ var checkBindings = (ctx, element, where) => {
|
|
|
11138
11197
|
*/
|
|
11139
11198
|
var checkAttributeTemplates = (ctx, element, where) => {
|
|
11140
11199
|
if (PROSE_TYPES.has(element.definition.type)) return;
|
|
11141
|
-
for (const value of stringsIn$1(element.attributes)) if (e$7(value) && !n$
|
|
11200
|
+
for (const value of stringsIn$1(element.attributes)) if (e$7(value) && !n$41(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 });
|
|
11142
11201
|
const routeParams = ctx.routeParams(element.id);
|
|
11143
11202
|
const scope = ctx.scope(element.id);
|
|
11144
|
-
for (const [name, value] of Object.entries(element.attributes)) if (typeof value === "string" && n$
|
|
11203
|
+
for (const [name, value] of Object.entries(element.attributes)) if (typeof value === "string" && n$41(value)) checkTemplate(ctx, value, `${where}: its "${name}"`, {
|
|
11145
11204
|
kind: "attribute",
|
|
11146
11205
|
routeParams
|
|
11147
11206
|
}, scope, element.id);
|
|
11148
11207
|
};
|
|
11149
11208
|
/** A value at a dotted path of a record, as the list reads its `itemKey`. */
|
|
11150
|
-
var fieldOf = (item, path) => path.split(".").reduce((value, key) => e$
|
|
11209
|
+
var fieldOf = (item, path) => path.split(".").reduce((value, key) => e$28(value) ? value[key] : void 0, item);
|
|
11151
11210
|
/**
|
|
11152
11211
|
* A list's `itemKey` that does not name each of its fixed items once. The list falls back to the items' `id`, then to
|
|
11153
11212
|
* their position, so the rows do not stay with their items as the author meant. Bound items arrive at run time and
|
|
@@ -11162,6 +11221,28 @@ var warnItemKey = (ctx, element, where) => {
|
|
|
11162
11221
|
if (missing === 0 && !shared) return;
|
|
11163
11222
|
ctx.warn("list-item-key-missing", `${where} names its rows by "${itemKey}", but ${missing > 0 ? `${String(missing)} of its ${String(items.length)} items have no "${itemKey}"` : `two of its items share one "${itemKey}"`}: the rows fall back to the items' \`id\`, then to their position. Give every item its own "${itemKey}", or name a field that has one.`, element.id);
|
|
11164
11223
|
};
|
|
11224
|
+
/** An `<li>`: a `listItem`, or a container that says it is one. */
|
|
11225
|
+
var isListItem = (element) => element.definition.type === "listItem" || element.definition.type === "container" && element.attributes.subType === "li";
|
|
11226
|
+
/** A container with no tag of its own named: the row `list-row-not-li` makes an `<li>` without asking. */
|
|
11227
|
+
var isPlainContainer = (element) => element.definition.type === "container" && (element.attributes.subType === void 0 || element.attributes.subType === "div");
|
|
11228
|
+
/**
|
|
11229
|
+
* The rows of a list with `items`: it is a `<ul>` (an `<ol>` with `subType: 'ol'`) and renders each row straight into
|
|
11230
|
+
* it, so a row that is not an `<li>` is a box inside a list — read by a screen reader as no item at all. A plain
|
|
11231
|
+
* container becomes one with nothing else to decide; anything else — a link, a button, a component whose root is not an
|
|
11232
|
+
* `<li>` — is wrapped, which is the author's to choose, since the wrapper then becomes what the list lays out.
|
|
11233
|
+
*/
|
|
11234
|
+
var warnRowsNotItems = (ctx, list) => {
|
|
11235
|
+
const tag = list.attributes.subType === "ol" ? "<ol>" : "<ul>";
|
|
11236
|
+
for (const rowId of list.definition.items ?? []) {
|
|
11237
|
+
const row = ctx.element(rowId);
|
|
11238
|
+
if (!row || isListItem(row)) continue;
|
|
11239
|
+
const component = ctx.instanceOf(row);
|
|
11240
|
+
const root = component?.flat[component.rootId];
|
|
11241
|
+
if (root && isListItem(root)) continue;
|
|
11242
|
+
const how = isPlainContainer(row) ? `Write it \`container({ subType: 'li' })\` — its class still lays "${row.id}" out as before.` : component ? `Make the root of component "${component.id}" an \`<li>\` (\`container({ subType: 'li' })\`), or wrap the instance in one.` : `Wrap it in \`container({ subType: 'li', children: [ … ] })\` — the wrapper is then what the list lays out, so move the layout of "${row.id}" onto it.`;
|
|
11243
|
+
ctx.warn("list-row-not-li", `${ctx.describe(row.id)} is a row of list "${list.id}", which renders as a \`${tag}\`: a row that is not an \`<li>\` is a box inside a list, which a screen reader reads as no item at all. ${how}`, row.id);
|
|
11244
|
+
}
|
|
11245
|
+
};
|
|
11165
11246
|
/**
|
|
11166
11247
|
* What renders, and renders something other than what it plainly means. Refused where there is no other reading — a
|
|
11167
11248
|
* controlled list with nothing to render — and warned where there is a rare legitimate one.
|
|
@@ -11178,6 +11259,7 @@ var checkIntent = (ctx, element, where) => {
|
|
|
11178
11259
|
if (!Array.isArray(attributes.items) || attributes.items.length === 0) ctx.error("list-without-items", `${where} is a controlled list with no items: it renders one row per item and would render none. Write \`items: [ … ]\`, or bind them: \`bind: { items: 'catalog.data.games' }\`.`, element.id);
|
|
11179
11260
|
}
|
|
11180
11261
|
if (type === "list" && !bound("items")) warnItemKey(ctx, element, where);
|
|
11262
|
+
if (type === "list" && attributes.source === "controlled") warnRowsNotItems(ctx, element);
|
|
11181
11263
|
const { loadingSlot } = attributes;
|
|
11182
11264
|
if (type === "apiContainer" && typeof loadingSlot === "string" && loadingSlot !== "") {
|
|
11183
11265
|
const children = element.definition.items ?? [];
|
|
@@ -11305,13 +11387,13 @@ var isRead = (name, schema, elements) => {
|
|
|
11305
11387
|
var lintDeclaration = (ctx, name, flag) => {
|
|
11306
11388
|
const where = `Feature flag "${name}"`;
|
|
11307
11389
|
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, "_")}".`);
|
|
11308
|
-
if (!e$
|
|
11390
|
+
if (!e$28(flag) || typeof flag.value !== "boolean" || !Array.isArray(flag.rules)) {
|
|
11309
11391
|
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.`);
|
|
11310
11392
|
return;
|
|
11311
11393
|
}
|
|
11312
11394
|
flag.rules.forEach((rule, index) => {
|
|
11313
11395
|
const at = `${where}, rule ${index + 1}`;
|
|
11314
|
-
if (!e$
|
|
11396
|
+
if (!e$28(rule) || typeof rule.value !== "boolean" || !e$28(rule.when)) {
|
|
11315
11397
|
ctx.error("flag-rule-shape", `${at} is ${JSON.stringify(rule)}. A rule is { when: { … }, value: true | false }.`);
|
|
11316
11398
|
return;
|
|
11317
11399
|
}
|
|
@@ -11421,7 +11503,7 @@ var checkTriggerKeys = (ctx, node, where, hostId) => {
|
|
|
11421
11503
|
};
|
|
11422
11504
|
/** A repeating flow whose interval cannot repeat: not a whole number of milliseconds, or faster than the floor. */
|
|
11423
11505
|
var checkTriggerInterval = (ctx, node, where, hostId) => {
|
|
11424
|
-
if (node.action !== "onInterval" || n$
|
|
11506
|
+
if (node.action !== "onInterval" || n$15(node.params.interval) !== void 0) return;
|
|
11425
11507
|
ctx.error("trigger-interval", `${where} repeats a flow every ${JSON.stringify(node.params.interval)} ms, which never ticks: an interval is a whole number of milliseconds, at least 250 — \`onInterval(5000)\`.`, hostId);
|
|
11426
11508
|
};
|
|
11427
11509
|
/**
|
|
@@ -11640,6 +11722,65 @@ var lintFlows = (ctx) => {
|
|
|
11640
11722
|
warnOverlaysNeverOpened(ctx);
|
|
11641
11723
|
};
|
|
11642
11724
|
//#endregion
|
|
11725
|
+
//#region ../sdk-shared/dist/schema/motion.mjs
|
|
11726
|
+
var t$6 = [
|
|
11727
|
+
"fade",
|
|
11728
|
+
"fade-up",
|
|
11729
|
+
"fade-down",
|
|
11730
|
+
"slide-left",
|
|
11731
|
+
"slide-right",
|
|
11732
|
+
"scale"
|
|
11733
|
+
];
|
|
11734
|
+
var n$6 = ["load", "view"];
|
|
11735
|
+
var r$3 = [
|
|
11736
|
+
"float",
|
|
11737
|
+
"pulse",
|
|
11738
|
+
"spin",
|
|
11739
|
+
"sway"
|
|
11740
|
+
];
|
|
11741
|
+
var l$4 = (e, t) => typeof t == "string" && e.includes(t);
|
|
11742
|
+
var u$3 = /* @__PURE__ */ new Set([
|
|
11743
|
+
"enter",
|
|
11744
|
+
"on",
|
|
11745
|
+
"duration",
|
|
11746
|
+
"delay",
|
|
11747
|
+
"stagger",
|
|
11748
|
+
"loop"
|
|
11749
|
+
]);
|
|
11750
|
+
var d$3 = (i) => {
|
|
11751
|
+
if (!e$28(i)) return ["motion is an object: `{ enter: 'fade-up', on: 'view' }`"];
|
|
11752
|
+
let a = [];
|
|
11753
|
+
for (let e of Object.keys(i)) u$3.has(e) || a.push(`motion has no "${e}" — it takes enter, on, duration, delay, stagger and loop`);
|
|
11754
|
+
i.enter !== void 0 && !l$4(t$6, i.enter) && a.push(`motion.enter is one of ${t$6.join(", ")}`), i.on !== void 0 && !l$4(n$6, i.on) && a.push(`motion.on is ${n$6.join(" or ")}`), i.loop !== void 0 && !l$4(r$3, i.loop) && a.push(`motion.loop is one of ${r$3.join(", ")}`);
|
|
11755
|
+
for (let e of [
|
|
11756
|
+
"duration",
|
|
11757
|
+
"delay",
|
|
11758
|
+
"stagger"
|
|
11759
|
+
]) {
|
|
11760
|
+
let t = i[e];
|
|
11761
|
+
t !== void 0 && (typeof t != "number" || !Number.isFinite(t) || t < 0 || t > 1e4) && a.push(`motion.${e} is a number of ms from 0 to ${String(1e4)}`);
|
|
11762
|
+
}
|
|
11763
|
+
return i.enter === void 0 && i.loop === void 0 && a.push("motion says nothing to play: give it an `enter`, a `loop`, or both"), i.stagger !== void 0 && i.enter === void 0 && a.push("motion.stagger staggers the children’s `enter`: give it one"), a;
|
|
11764
|
+
};
|
|
11765
|
+
["[data-motion-loop] { animation-play-state: running, running !important; }", "[data-motion-on=\"view\"][data-motion-enter], [data-motion-on=\"view\"][data-motion-stagger] > * { animation-timeline: auto, auto !important; }"].join("\n");
|
|
11766
|
+
//#endregion
|
|
11767
|
+
//#region src/schema/lint/motion.ts
|
|
11768
|
+
/**
|
|
11769
|
+
* An element's `motion`: one the SDK's stylesheet can play, on an element with a box to move. What is wrong with it is
|
|
11770
|
+
* refused rather than warned — a preset nobody declared, or a motion on a provider with no tag, renders as nothing
|
|
11771
|
+
* moving at all, which is the one thing an author who wrote a motion did not mean.
|
|
11772
|
+
*/
|
|
11773
|
+
var lintMotion = (ctx) => {
|
|
11774
|
+
Object.values(ctx.flat).forEach((element) => {
|
|
11775
|
+
const { motion } = element.definition;
|
|
11776
|
+
if (motion === void 0) return;
|
|
11777
|
+
const where = ctx.describe(element.id);
|
|
11778
|
+
const problems = d$3(motion);
|
|
11779
|
+
if (problems.length > 0) ctx.error("motion-invalid", `${where} has a motion the page cannot play: ${problems.join("; ")}. For example \`motion: { enter: 'fade-up', on: 'view' }\`.`, element.id);
|
|
11780
|
+
if (i$8(element)) ctx.error("motion-no-tag", `${where} has a motion but renders no element of its own (no \`subType\`), so there is nothing to move. Put the motion on what it wraps, or give it a tag.`, element.id);
|
|
11781
|
+
});
|
|
11782
|
+
};
|
|
11783
|
+
//#endregion
|
|
11643
11784
|
//#region src/schema/lint/style.ts
|
|
11644
11785
|
/**
|
|
11645
11786
|
* A colour token with a light value and no dark one: a dark theme shows the light value, which is how a near-black
|
|
@@ -11871,6 +12012,19 @@ var FIXERS = {
|
|
|
11871
12012
|
});
|
|
11872
12013
|
}
|
|
11873
12014
|
},
|
|
12015
|
+
"list-row-not-li": (element, ctx, report) => {
|
|
12016
|
+
const { parentId } = element.definition;
|
|
12017
|
+
const list = parentId ? ctx.element(parentId) : void 0;
|
|
12018
|
+
if (list?.definition.type === "list" && list.attributes.source === "controlled" && isPlainContainer(element)) {
|
|
12019
|
+
element.attributes.subType = "li";
|
|
12020
|
+
report("The row is now an `<li>` (`subType: li`), an item of the list it renders in.", {
|
|
12021
|
+
on: "attribute",
|
|
12022
|
+
op: "set",
|
|
12023
|
+
key: "subType",
|
|
12024
|
+
value: "li"
|
|
12025
|
+
});
|
|
12026
|
+
}
|
|
12027
|
+
},
|
|
11874
12028
|
"overlay-starts-open": (element, _ctx, report) => {
|
|
11875
12029
|
const { type, bindings } = element.definition;
|
|
11876
12030
|
const visibilityBound = (bindings?.initialState ?? []).some((binding) => binding.to === "visibility");
|
|
@@ -11975,6 +12129,7 @@ var lintSpace$1 = ({ schema, style }, catalogs = {}) => {
|
|
|
11975
12129
|
lintFlags(ctx);
|
|
11976
12130
|
lintElements(ctx);
|
|
11977
12131
|
lintAnchors(ctx);
|
|
12132
|
+
lintMotion(ctx);
|
|
11978
12133
|
lintInstances(ctx);
|
|
11979
12134
|
lintChannels(ctx);
|
|
11980
12135
|
lintFlows(ctx);
|
|
@@ -12315,7 +12470,7 @@ var n$2 = (n) => {
|
|
|
12315
12470
|
dark: []
|
|
12316
12471
|
};
|
|
12317
12472
|
return Object.entries(r).forEach(([n, r]) => {
|
|
12318
|
-
switch (n$
|
|
12473
|
+
switch (n$18(n) ? n : e$24.CUSTOM) {
|
|
12319
12474
|
case e$24.COLOR:
|
|
12320
12475
|
Object.keys(r).forEach((e) => {
|
|
12321
12476
|
let t = r[e];
|
|
@@ -12352,15 +12507,15 @@ var d = (e, t, n) => {
|
|
|
12352
12507
|
let o = t ? "," : ", ", s = [];
|
|
12353
12508
|
for (let [c, { default: l, states: d, variants: f }] of Object.entries(e)) {
|
|
12354
12509
|
l?.length && s.push(m(`:where(.${c}) &`, l, {}, t, n));
|
|
12355
|
-
for (let [e, o] of o$15(d ?? {})) s.push(m(`:where(.${c}${c$
|
|
12510
|
+
for (let [e, o] of o$15(d ?? {})) s.push(m(`:where(.${c}${c$9(e)}) &`, o, {}, t, n)), l$5(e) && s.push(p(`:where(.${c}) &`, o, t, n));
|
|
12356
12511
|
for (let [e, l] of Object.entries(f ?? {})) {
|
|
12357
12512
|
if (l.default.length) {
|
|
12358
12513
|
let r = u(`.${c}`, e).join(o);
|
|
12359
12514
|
s.push(m(`:where(${r}) &`, l.default, {}, t, n));
|
|
12360
12515
|
}
|
|
12361
12516
|
for (let [d, f] of o$15(l.states ?? {})) {
|
|
12362
|
-
let r = u(`.${c}`, e, c$
|
|
12363
|
-
if (s.push(m(`:where(${r}) &`, f, {}, t, n)), l$
|
|
12517
|
+
let r = u(`.${c}`, e, c$9(d)).join(o);
|
|
12518
|
+
if (s.push(m(`:where(${r}) &`, f, {}, t, n)), l$5(d)) {
|
|
12364
12519
|
let r = u(`.${c}`, e).join(o);
|
|
12365
12520
|
s.push(p(`:where(${r}) &`, f, t, n));
|
|
12366
12521
|
}
|
|
@@ -12371,8 +12526,8 @@ var d = (e, t, n) => {
|
|
|
12371
12526
|
};
|
|
12372
12527
|
var f = (e, t, n, c = !0, l = o$5) => {
|
|
12373
12528
|
let { states: u, variants: f, ancestors: h } = n, g = c ? t.join("") : t.map((e) => `${s$4(l + o$5)}${e}`).join("\n").replaceAll(":", ": "), _ = u ? o$15(u).flatMap(([e, t]) => {
|
|
12374
|
-
let n = m(`&${c$
|
|
12375
|
-
return l$
|
|
12529
|
+
let n = m(`&${c$9(e)}`, t, {}, c, l + o$5);
|
|
12530
|
+
return l$5(e) ? [n, p("&", t, c, l + o$5)] : [n];
|
|
12376
12531
|
}) : [], v = e.replace("plitzi__", ""), y = f ? Object.entries(f).map(([e, t]) => m(`&[data-variant="${e}"]${c ? "," : ", "}&${v}--${e}`, t.default, { states: t.states }, c, l + o$5)) : [], b = h ? d(h, c, l + o$5) : [];
|
|
12377
12532
|
if (c) return `${g}${_.join("")}${y.join("")}${b.join("")}`;
|
|
12378
12533
|
let x = g ? [g] : [];
|
|
@@ -12421,9 +12576,9 @@ var o$4 = (e, t = ":root", n = 2, r = !0) => {
|
|
|
12421
12576
|
};
|
|
12422
12577
|
//#endregion
|
|
12423
12578
|
//#region ../sdk-style/dist/StyleHelper.mjs
|
|
12424
|
-
var s$3 = Object.fromEntries(e$
|
|
12579
|
+
var s$3 = Object.fromEntries(e$25.map((e) => [e, t$23(e)]));
|
|
12425
12580
|
var c = (e) => {
|
|
12426
|
-
if (t$
|
|
12581
|
+
if (t$22(e)) return e$26[e];
|
|
12427
12582
|
let t = e.match(/(\d*\.?\d+)(px|rem)/);
|
|
12428
12583
|
if (!t) return 0;
|
|
12429
12584
|
let r = parseFloat(t[1]);
|
|
@@ -12446,7 +12601,7 @@ var l = (e) => {
|
|
|
12446
12601
|
//#region src/style/properties.ts
|
|
12447
12602
|
/** Every kebab-case CSS property Plitzi's style engine understands. Values written to a definition must use these
|
|
12448
12603
|
* exact keys — camelCase or unknown keys are rejected. */
|
|
12449
|
-
var cssProperties = Array.from(new Set(Object.values(t$
|
|
12604
|
+
var cssProperties = Array.from(new Set(Object.values(t$27))).sort();
|
|
12450
12605
|
var cssPropertySet = new Set(cssProperties);
|
|
12451
12606
|
var isCssProperty = (key) => cssPropertySet.has(key);
|
|
12452
12607
|
var toKebab = (key) => key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -14961,8 +15116,10 @@ var isPlainIcon = ({ attributes }) => !attributes.label && (attributes.size ?? "
|
|
|
14961
15116
|
* elements spent for nothing. The words are its own `content` and the icon its `icon`; a child that does something of
|
|
14962
15117
|
* its own (a binding, a flow, a condition), an icon that means something (`label`) or is sized or animated, and a
|
|
14963
15118
|
* text that is a drawn shape are left alone, since none of that would move with them.
|
|
15119
|
+
*
|
|
15120
|
+
* What the `content-attribute` suggestion says, and what `plitzi fix` writes for the moves with no class to carry.
|
|
14964
15121
|
*/
|
|
14965
|
-
var
|
|
15122
|
+
var contentMoves = (schema, style) => {
|
|
14966
15123
|
const { flat } = schema;
|
|
14967
15124
|
const declared = declaredClasses(style);
|
|
14968
15125
|
const properties = propertiesOf(style);
|
|
@@ -14979,13 +15136,27 @@ var suggestContent = (schema, style) => {
|
|
|
14979
15136
|
const classes = text ? text.definition.styleSelectors.base.split(/\s+/).filter((name) => declared.has(name)) : [];
|
|
14980
15137
|
const words = !text || typeof text.attributes.content === "string" && text.attributes.content.trim() !== "";
|
|
14981
15138
|
const drawn = classes.some((name) => [...properties.get(name) ?? []].some((property) => BOX.test(property)));
|
|
14982
|
-
if (words && !drawn)
|
|
14983
|
-
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
|
|
15139
|
+
if (words && !drawn) {
|
|
15140
|
+
const iconClass = icon && typeof icon.attributes.icon === "string" ? icon.attributes.icon : void 0;
|
|
15141
|
+
found.push({
|
|
15142
|
+
id,
|
|
15143
|
+
children: items,
|
|
15144
|
+
words: text && typeof text.attributes.content === "string" ? text.attributes.content : "",
|
|
15145
|
+
...iconClass === void 0 ? {} : { icon: iconClass },
|
|
15146
|
+
iconAfter: icon !== void 0 && text !== void 0 && children.indexOf(icon) > children.indexOf(text),
|
|
15147
|
+
classed: classes.length > 0
|
|
15148
|
+
});
|
|
15149
|
+
}
|
|
14988
15150
|
}
|
|
15151
|
+
return found;
|
|
15152
|
+
};
|
|
15153
|
+
var suggestContent = (schema, style) => {
|
|
15154
|
+
const found = contentMoves(schema, style).map((move) => ({
|
|
15155
|
+
id: move.id,
|
|
15156
|
+
saves: move.children.length,
|
|
15157
|
+
classed: move.classed,
|
|
15158
|
+
icon: move.icon !== void 0
|
|
15159
|
+
}));
|
|
14989
15160
|
if (found.length === 0) return [];
|
|
14990
15161
|
const classed = found.filter((entry) => entry.classed);
|
|
14991
15162
|
const iconed = found.filter((entry) => entry.icon);
|
|
@@ -15101,7 +15272,7 @@ var declarationsIn = (body) => splitTopLevel(body, ";").flatMap((declaration) =>
|
|
|
15101
15272
|
});
|
|
15102
15273
|
//#endregion
|
|
15103
15274
|
//#region src/decompile/customCss.ts
|
|
15104
|
-
var STATE_SET$1 = new Set(STYLE_STATES.filter((state) => state === "current" || c$
|
|
15275
|
+
var STATE_SET$1 = new Set(STYLE_STATES.filter((state) => state === "current" || c$9(state) === `:${state}`));
|
|
15105
15276
|
/** `[aria-current="page"]`, in either quotes, written as the state it is, so one pattern reads every state. */
|
|
15106
15277
|
var asStateNames = (selector) => selector.replaceAll(/\[aria-current=(["'])page\1\]/g, ":current");
|
|
15107
15278
|
var isStyleState$1 = (state) => STATE_SET$1.has(state);
|
|
@@ -15835,7 +16006,7 @@ var o$3 = (i, a) => {
|
|
|
15835
16006
|
}, E = () => {
|
|
15836
16007
|
let e = /* @__PURE__ */ new Set();
|
|
15837
16008
|
_().forEach((t) => {
|
|
15838
|
-
let n = n$
|
|
16009
|
+
let n = n$9(g, t);
|
|
15839
16010
|
n.length === 0 || e.has(n[0]) || (n.forEach((t) => e.add(t)), s.push({
|
|
15840
16011
|
code: "LAYOUT_CYCLE",
|
|
15841
16012
|
message: `Layouts sit inside each other in a circle: ${n.join(" → ")}`,
|
|
@@ -15887,7 +16058,7 @@ var o$3 = (i, a) => {
|
|
|
15887
16058
|
});
|
|
15888
16059
|
}, k = () => {
|
|
15889
16060
|
Object.values(l).forEach((t) => {
|
|
15890
|
-
t && (t$
|
|
16061
|
+
t && (t$25(t.id) || s.push({
|
|
15891
16062
|
code: "INVALID_ELEMENT_ID",
|
|
15892
16063
|
message: `Element "${t.id}" has a name that must start with a letter, then letters, numbers, hyphens and underscores (no hyphen or underscore at the start, and no hyphen at the end)`,
|
|
15893
16064
|
elementId: t.id
|
|
@@ -15939,7 +16110,7 @@ var o$3 = (i, a) => {
|
|
|
15939
16110
|
if (!r) return;
|
|
15940
16111
|
let i = Object.keys(r);
|
|
15941
16112
|
Object.entries(r).forEach(([r, a]) => {
|
|
15942
|
-
t$
|
|
16113
|
+
t$25(r) || s.push({
|
|
15943
16114
|
code: "INVALID_INTERACTION_ID",
|
|
15944
16115
|
message: `Interaction "${r}" on element "${n.id}" has a name that must start with a letter, then letters, numbers, hyphens and underscores — a later step reads it as {{ ${r}.field }}`,
|
|
15945
16116
|
elementId: n.id
|
|
@@ -16002,7 +16173,7 @@ var o$3 = (i, a) => {
|
|
|
16002
16173
|
code: "COMPONENT_ID_MISMATCH",
|
|
16003
16174
|
message: `${d} has id "${l.id}"`,
|
|
16004
16175
|
componentId: t
|
|
16005
|
-
}), t$
|
|
16176
|
+
}), t$25(t) || s.push({
|
|
16006
16177
|
code: "INVALID_COMPONENT_ID",
|
|
16007
16178
|
message: `${d} has a name that must start with a letter, then letters, numbers, hyphens and underscores`,
|
|
16008
16179
|
componentId: t
|
|
@@ -16030,7 +16201,7 @@ var o$3 = (i, a) => {
|
|
|
16030
16201
|
componentId: t
|
|
16031
16202
|
});
|
|
16032
16203
|
}), Object.keys(l.props ?? {}).forEach((e) => {
|
|
16033
|
-
let r = c$
|
|
16204
|
+
let r = c$7(e);
|
|
16034
16205
|
r && s.push({
|
|
16035
16206
|
code: "INVALID_COMPONENT_PROP",
|
|
16036
16207
|
message: `${d}: ${r}`,
|
|
@@ -16064,7 +16235,7 @@ var o$3 = (i, a) => {
|
|
|
16064
16235
|
}));
|
|
16065
16236
|
}), [["", l], ...Object.entries(p).map(([e, t]) => [e, t.flat])].forEach(([e, n]) => {
|
|
16066
16237
|
Object.values(n).forEach((r) => {
|
|
16067
|
-
if (!r || !m$
|
|
16238
|
+
if (!r || !m$4(r)) return;
|
|
16068
16239
|
let i = r.attributes.referenceId, a = typeof i == "string" ? p[i] : void 0;
|
|
16069
16240
|
if (!a || typeof i != "string") {
|
|
16070
16241
|
s.push({
|
|
@@ -16205,7 +16376,7 @@ var REPEATING_TYPES = /* @__PURE__ */ new Set(["list", "carouselTrack"]);
|
|
|
16205
16376
|
* one that does — `"store-footer" › container[1] › text[0]` rather than a path of indices from the page down.
|
|
16206
16377
|
*/
|
|
16207
16378
|
var placeOf = (spec, parent, index) => {
|
|
16208
|
-
const record = e$
|
|
16379
|
+
const record = e$28(spec) ? spec : {};
|
|
16209
16380
|
if (typeof record.id === "string") return `"${record.id}"`;
|
|
16210
16381
|
return index === void 0 ? parent : `${parent} › ${typeof record.type === "string" ? record.type : "element"}[${index}]`;
|
|
16211
16382
|
};
|
|
@@ -16240,7 +16411,7 @@ var layoutAttributes = (layout) => layout ? {
|
|
|
16240
16411
|
var SpaceAuthor = class {
|
|
16241
16412
|
spec;
|
|
16242
16413
|
options;
|
|
16243
|
-
flatMap = new d$
|
|
16414
|
+
flatMap = new d$5({
|
|
16244
16415
|
flat: {},
|
|
16245
16416
|
variables: []
|
|
16246
16417
|
});
|
|
@@ -16320,6 +16491,7 @@ var SpaceAuthor = class {
|
|
|
16320
16491
|
at
|
|
16321
16492
|
};
|
|
16322
16493
|
});
|
|
16494
|
+
this.markConditionalByChildren(schema);
|
|
16323
16495
|
return {
|
|
16324
16496
|
schema,
|
|
16325
16497
|
style,
|
|
@@ -16357,7 +16529,7 @@ var SpaceAuthor = class {
|
|
|
16357
16529
|
const sources = /* @__PURE__ */ new Map();
|
|
16358
16530
|
this.collectSources(component.root, sources);
|
|
16359
16531
|
this.componentTrees.set(component.id, {
|
|
16360
|
-
map: new d$
|
|
16532
|
+
map: new d$5({
|
|
16361
16533
|
flat: {},
|
|
16362
16534
|
variables: []
|
|
16363
16535
|
}),
|
|
@@ -16569,7 +16741,7 @@ var SpaceAuthor = class {
|
|
|
16569
16741
|
parseFonts(fonts) {
|
|
16570
16742
|
return fonts.map((font, index) => {
|
|
16571
16743
|
try {
|
|
16572
|
-
return h$
|
|
16744
|
+
return h$4(font);
|
|
16573
16745
|
} catch (error) {
|
|
16574
16746
|
const reason = error instanceof Error ? error.message : String(error);
|
|
16575
16747
|
throw new AuthoringError("font-invalid", `Font ${index} ("${font.family}") in space "${this.spec.permanentUrl}": ${reason}`, { cause: error });
|
|
@@ -16720,11 +16892,11 @@ var SpaceAuthor = class {
|
|
|
16720
16892
|
const where = `Component "${component.id}"`;
|
|
16721
16893
|
assertKnownKeys(component, COMPONENT_SPEC_KEYS, where);
|
|
16722
16894
|
const id = component.id;
|
|
16723
|
-
if (typeof id !== "string" || !t$
|
|
16895
|
+
if (typeof id !== "string" || !t$25(id)) throw new AuthoringError("component-id", `${where} needs an \`id\` that starts with a letter, then letters, numbers, hyphens and underscores — it is the name an instance places it by: \`component('${String(id)}')\`.`);
|
|
16724
16896
|
if (componentIds.has(component.id)) throw new AuthoringError("component-duplicate", `Two components are called "${component.id}". A component's id is the one name it is placed by.`);
|
|
16725
16897
|
componentIds.add(component.id);
|
|
16726
16898
|
for (const name of Object.keys(component.props ?? {})) {
|
|
16727
|
-
const problem = c$
|
|
16899
|
+
const problem = c$7(name);
|
|
16728
16900
|
if (problem) throw new AuthoringError("prop-name", `${where}: ${problem}.`);
|
|
16729
16901
|
}
|
|
16730
16902
|
}
|
|
@@ -16759,7 +16931,7 @@ var SpaceAuthor = class {
|
|
|
16759
16931
|
assertChannels() {
|
|
16760
16932
|
if (this.spec.settings?.channels !== void 0) throw new AuthoringError("setting-misplaced", "`settings.channels` is written through `channels` at the top of the space, not inside `settings`.");
|
|
16761
16933
|
for (const [pattern, declaration] of Object.entries(this.spec.channels ?? {})) {
|
|
16762
|
-
const [problem] = c$
|
|
16934
|
+
const [problem] = c$6(pattern, declaration);
|
|
16763
16935
|
if (problem) throw new AuthoringError("channel-declaration", `Channel "${pattern}": ${problem}.`);
|
|
16764
16936
|
}
|
|
16765
16937
|
}
|
|
@@ -16820,7 +16992,7 @@ var SpaceAuthor = class {
|
|
|
16820
16992
|
}
|
|
16821
16993
|
/** The element about to be placed under `parentId`, and everything that one is nested in. */
|
|
16822
16994
|
ancestorsOf(parentId, flat) {
|
|
16823
|
-
return Object.hasOwn(flat, parentId) ? /* @__PURE__ */ new Set([parentId, ...t$
|
|
16995
|
+
return Object.hasOwn(flat, parentId) ? /* @__PURE__ */ new Set([parentId, ...t$24(flat, parentId)]) : /* @__PURE__ */ new Set();
|
|
16824
16996
|
}
|
|
16825
16997
|
/**
|
|
16826
16998
|
* Where a page's ids are derived from — its slug, unless another page already claimed it.
|
|
@@ -17089,6 +17261,67 @@ var SpaceAuthor = class {
|
|
|
17089
17261
|
* rather than filed somewhere plausible: a handle that resolves to the wrong root is worse than one that is absent,
|
|
17090
17262
|
* which the lookup reports by name.
|
|
17091
17263
|
*/
|
|
17264
|
+
/**
|
|
17265
|
+
* An element whose every child shows only under a condition — four menu panels in one list, each opening on the
|
|
17266
|
+
* state that names it — shows nothing on a bare visit either, and that is it working: it is conditional the way its
|
|
17267
|
+
* children are. Bottom up, so a wrapper of such an element is too. Without it a suite asserting "everything named
|
|
17268
|
+
* is visible" failed on the menu at rest, and the only way past was a condition on the parent that said nothing new.
|
|
17269
|
+
*/
|
|
17270
|
+
markConditionalByChildren(schema) {
|
|
17271
|
+
const handles = [...Object.values(this.handles), ...Object.values(this.layoutHandles)].flatMap((root) => Object.values(root.elements));
|
|
17272
|
+
const byId = new Map(handles.map((handle) => [handle.id, handle]));
|
|
17273
|
+
for (let changed = true; changed;) {
|
|
17274
|
+
changed = false;
|
|
17275
|
+
for (const handle of handles) {
|
|
17276
|
+
const items = handle.conditional ? [] : schema.flat[handle.id].definition.items ?? [];
|
|
17277
|
+
if (items.length > 0 && items.every((child) => byId.get(child)?.conditional === true)) {
|
|
17278
|
+
handle.conditional = true;
|
|
17279
|
+
changed = true;
|
|
17280
|
+
}
|
|
17281
|
+
}
|
|
17282
|
+
}
|
|
17283
|
+
}
|
|
17284
|
+
/** The name an element's plugin is declared under: its own type, or `custom:<renderType>` for one a `custom` hosts. */
|
|
17285
|
+
pluginKeyOf(element) {
|
|
17286
|
+
const { type } = element.definition;
|
|
17287
|
+
const renderType = element.attributes.renderType;
|
|
17288
|
+
return type === "custom" && typeof renderType === "string" ? `${CUSTOM_TYPE}:${renderType}` : type;
|
|
17289
|
+
}
|
|
17290
|
+
/** Whether the element's plugin declares it draws nothing. */
|
|
17291
|
+
drawsNothing(element) {
|
|
17292
|
+
return this.options.drawsNothingTypes?.includes(this.pluginKeyOf(element)) ?? false;
|
|
17293
|
+
}
|
|
17294
|
+
/** Plugin types already warned about a reserved attribute: said once, at the first element of the type. */
|
|
17295
|
+
reservedWarned = /* @__PURE__ */ new Set();
|
|
17296
|
+
/**
|
|
17297
|
+
* What an element is written with that reaches nothing, said: a variant no class and no type style declares — the
|
|
17298
|
+
* element looks the same with it or without — and, once per plugin, an attribute it declares under one of the
|
|
17299
|
+
* element's own names, which a factory reads as that and never hands to the plugin.
|
|
17300
|
+
*/
|
|
17301
|
+
warnUnreachable(element, spec, where) {
|
|
17302
|
+
const key = this.pluginKeyOf(element);
|
|
17303
|
+
const reserved = this.options.reservedPluginAttributes?.[key] ?? [];
|
|
17304
|
+
if (reserved.length > 0 && !this.reservedWarned.has(key)) {
|
|
17305
|
+
this.reservedWarned.add(key);
|
|
17306
|
+
this.styleWarnings.push({
|
|
17307
|
+
code: "plugin-attribute-reserved",
|
|
17308
|
+
message: `${where} is a "${key}", whose plugin declares ${reserved.map((name) => `\`${name}\``).join(", ")} — ${reserved.length === 1 ? "a name" : "names"} authoring reads as the element's own (\`variant\` is its style variant, \`class\` its classes), so the plugin is never handed ${reserved.length === 1 ? "it" : "them"}. Rename ${reserved.length === 1 ? "it" : "them"} in the plugin: \`variant\` → \`kind\`.`,
|
|
17309
|
+
elementId: element.id
|
|
17310
|
+
});
|
|
17311
|
+
}
|
|
17312
|
+
if (spec.variant === void 0 || this.variantDeclared(spec, spec.variant)) return;
|
|
17313
|
+
const plugin = reserved.includes("variant") ? " If it was meant for the plugin’s own `variant`, that attribute is never set: rename it in the plugin." : "";
|
|
17314
|
+
this.styleWarnings.push({
|
|
17315
|
+
code: "unknown-variant",
|
|
17316
|
+
message: `${where} is written with \`variant: '${spec.variant}'\`, which no class of it and no style of its type declares, so nothing applies.${plugin} Declare it — \`styles(name, { variants: { ${spec.variant}: { … } } })\` — or name one that is.`,
|
|
17317
|
+
elementId: element.id
|
|
17318
|
+
});
|
|
17319
|
+
}
|
|
17320
|
+
/** Whether `variant` is declared by the element's type style or by one of its classes — where `variantOwner` looks. */
|
|
17321
|
+
variantDeclared(spec, variant) {
|
|
17322
|
+
if (this.spec.elements?.[spec.type]?.variants?.[variant] !== void 0) return true;
|
|
17323
|
+
return spec.class !== void 0 && classNames(splitClassList(spec.class).refs).some((name) => Object.values(this.classRules.get(name) ?? {}).some((block) => block.variants?.[variant] !== void 0));
|
|
17324
|
+
}
|
|
17092
17325
|
recordHandle(handle) {
|
|
17093
17326
|
if (Object.hasOwn(this.handles, handle.pageId)) {
|
|
17094
17327
|
this.handles[handle.pageId].elements[handle.id] = handle;
|
|
@@ -17194,21 +17427,23 @@ var SpaceAuthor = class {
|
|
|
17194
17427
|
...spec.runtime ? { runtime: spec.runtime } : {},
|
|
17195
17428
|
...spec.loadStrategy ? { loadStrategy: spec.loadStrategy } : {},
|
|
17196
17429
|
...spec.anchor === void 0 ? {} : { anchor: spec.anchor },
|
|
17430
|
+
...spec.motion === void 0 ? {} : { motion: spec.motion },
|
|
17197
17431
|
...spec.flag === void 0 ? {} : { flag: flagGateOf(spec.flag, where) },
|
|
17198
17432
|
...bindings?.length ? { bindings: groupBindings(path, bindings, sourceIndex, where, tree.globals) } : {},
|
|
17199
17433
|
...spec.flows ? { interactions: authorFlows(spec.flows, id) } : {}
|
|
17200
17434
|
}
|
|
17201
17435
|
};
|
|
17202
17436
|
this.insert(element, parentId, isRoot ? "custom" : "inside", place, tree);
|
|
17437
|
+
this.warnUnreachable(element, spec, where);
|
|
17203
17438
|
this.recordHandle({
|
|
17204
17439
|
id,
|
|
17205
17440
|
type: spec.type,
|
|
17206
17441
|
pageId: rootId,
|
|
17207
|
-
selector: selectorFor(id),
|
|
17442
|
+
selector: element.definition.type === "reference" && element.attributes.referenceType === "component" ? instanceSelectorFor(id) : selectorFor(id),
|
|
17208
17443
|
named: spec.id !== void 0,
|
|
17209
17444
|
...conditional ? { conditional: true } : {},
|
|
17210
17445
|
...[...ancestors].some((ancestor) => REPEATING_TYPES.has(tree.map.flat[ancestor].definition.type)) ? { repeated: true } : {},
|
|
17211
|
-
...i$8(element) ? { boxless: true } : {}
|
|
17446
|
+
...i$8(element) || this.drawsNothing(element) ? { boxless: true } : {}
|
|
17212
17447
|
});
|
|
17213
17448
|
(spec.row === void 0 ? spec.children : this.rowChildren(spec, spec.row, id, where))?.forEach((child, index) => this.addElement(child, `${path}/${index}`, placeOf(child, place, index), ownRootId, id, conditional, tree));
|
|
17214
17449
|
return id;
|
|
@@ -17291,7 +17526,7 @@ var planFixes$1 = (spec, options = {}) => {
|
|
|
17291
17526
|
elementId: issue.elementId ?? null,
|
|
17292
17527
|
message: issue.message
|
|
17293
17528
|
})),
|
|
17294
|
-
fixes: fixSpace$1(documents, options).applied.map((fix) => {
|
|
17529
|
+
fixes: [...fixSpace$1(documents, options).applied.map((fix) => {
|
|
17295
17530
|
const written = fix.elementId === null ? void 0 : author.specOf(fix.elementId);
|
|
17296
17531
|
const at = written ? writtenAt(written) : void 0;
|
|
17297
17532
|
const position = written ? writtenAtPosition(written) : void 0;
|
|
@@ -17304,9 +17539,35 @@ var planFixes$1 = (spec, options = {}) => {
|
|
|
17304
17539
|
...position === void 0 ? {} : { position },
|
|
17305
17540
|
...edit === void 0 ? {} : { edit }
|
|
17306
17541
|
};
|
|
17307
|
-
})
|
|
17542
|
+
}), ...contentFixes(author, documents)]
|
|
17308
17543
|
};
|
|
17309
17544
|
};
|
|
17545
|
+
/**
|
|
17546
|
+
* The `content-attribute` suggestions that have one way to be written: the children only words and an icon, none of
|
|
17547
|
+
* them named — a child with an id of its own is something a test or a flow may point at — and the words wearing no
|
|
17548
|
+
* class whose rules would have to be moved by hand.
|
|
17549
|
+
*/
|
|
17550
|
+
var contentFixes = (author, documents) => contentMoves(documents.schema, documents.style).filter((move) => !move.classed && move.children.every((child) => author.specOf(child)?.id === void 0)).map((move) => {
|
|
17551
|
+
const written = author.specOf(move.id);
|
|
17552
|
+
const at = written ? writtenAt(written) : void 0;
|
|
17553
|
+
const position = written ? writtenAtPosition(written) : void 0;
|
|
17554
|
+
const holds = move.icon === void 0 ? "its words" : move.words ? "its words and an icon" : "an icon";
|
|
17555
|
+
return {
|
|
17556
|
+
code: "content-attribute",
|
|
17557
|
+
message: `"${move.id}" holds only ${holds} as elements: they are its own \`content\`${move.icon === void 0 ? "" : " and `icon`"}.`,
|
|
17558
|
+
elementId: move.id,
|
|
17559
|
+
...at === void 0 ? {} : { at },
|
|
17560
|
+
...position === void 0 ? {} : { position },
|
|
17561
|
+
edit: {
|
|
17562
|
+
on: "children",
|
|
17563
|
+
op: "set",
|
|
17564
|
+
key: "content",
|
|
17565
|
+
value: move.words,
|
|
17566
|
+
...move.icon === void 0 ? {} : { icon: move.icon },
|
|
17567
|
+
...move.iconAfter ? { iconPlacement: "after" } : {}
|
|
17568
|
+
}
|
|
17569
|
+
};
|
|
17570
|
+
});
|
|
17310
17571
|
//#endregion
|
|
17311
17572
|
//#region src/schema/snippet.ts
|
|
17312
17573
|
var dedupe = (errors) => {
|
|
@@ -17450,7 +17711,7 @@ var validateSnippet$1 = (snippet, options = {}) => {
|
|
|
17450
17711
|
}));
|
|
17451
17712
|
const { errors: spaceErrors, warnings } = validateSpace$1({
|
|
17452
17713
|
schema: {
|
|
17453
|
-
...r$
|
|
17714
|
+
...r$18.schema,
|
|
17454
17715
|
...schema
|
|
17455
17716
|
},
|
|
17456
17717
|
style
|
|
@@ -17691,7 +17952,7 @@ var transformerCatalog = () => Object.entries(BUILTIN_TRANSFORMERS).map(([action
|
|
|
17691
17952
|
/** The space's name and URL, where the document carries them. An older export carries no definition at all. */
|
|
17692
17953
|
var definitionOf = (schema) => {
|
|
17693
17954
|
const definition = schema.definition;
|
|
17694
|
-
if (!e$
|
|
17955
|
+
if (!e$28(definition)) return {};
|
|
17695
17956
|
return {
|
|
17696
17957
|
...typeof definition.name === "string" ? { name: definition.name } : {},
|
|
17697
17958
|
...typeof definition.permanentUrl === "string" ? { permanentUrl: definition.permanentUrl } : {}
|
|
@@ -17705,7 +17966,7 @@ var categoryOf = (variable) => {
|
|
|
17705
17966
|
/** The name an element carried beside its id before the id became the name, where it carries a usable one. */
|
|
17706
17967
|
var idRefOf = (element) => {
|
|
17707
17968
|
const stored = element;
|
|
17708
|
-
if (!e$
|
|
17969
|
+
if (!e$28(stored) || typeof stored.idRef !== "string" || !t$25(stored.idRef)) return;
|
|
17709
17970
|
return stored.idRef;
|
|
17710
17971
|
};
|
|
17711
17972
|
/**
|
|
@@ -17721,7 +17982,7 @@ var idRefOf = (element) => {
|
|
|
17721
17982
|
var withNamedIds = (schema) => {
|
|
17722
17983
|
const stale = Object.values(schema.flat).filter((element) => {
|
|
17723
17984
|
const idRef = idRefOf(element);
|
|
17724
|
-
return idRef ? idRef !== element.id : !t$
|
|
17985
|
+
return idRef ? idRef !== element.id : !t$25(element.id);
|
|
17725
17986
|
});
|
|
17726
17987
|
if (stale.length === 0) return {
|
|
17727
17988
|
schema,
|
|
@@ -17732,7 +17993,7 @@ var withNamedIds = (schema) => {
|
|
|
17732
17993
|
const isTaken = (candidate) => taken.has(candidate);
|
|
17733
17994
|
const renames = stale.map((element) => {
|
|
17734
17995
|
const idRef = idRefOf(element);
|
|
17735
|
-
const to = idRef ? u$
|
|
17996
|
+
const to = idRef ? u$6(idRef, isTaken) : l$7(element.definition.type, isTaken);
|
|
17736
17997
|
taken.add(to);
|
|
17737
17998
|
return {
|
|
17738
17999
|
from: element.id,
|
|
@@ -17806,7 +18067,7 @@ var refuse = (reason) => {
|
|
|
17806
18067
|
throw new Unreadable(reason);
|
|
17807
18068
|
};
|
|
17808
18069
|
var isTriggerType = (value) => TRIGGER_TYPES.some((type) => type === value);
|
|
17809
|
-
var isNode = (value) => e$
|
|
18070
|
+
var isNode = (value) => e$28(value) && [
|
|
17810
18071
|
"id",
|
|
17811
18072
|
"title",
|
|
17812
18073
|
"type",
|
|
@@ -17814,10 +18075,10 @@ var isNode = (value) => e$25(value) && [
|
|
|
17814
18075
|
"beforeNode",
|
|
17815
18076
|
"afterNode",
|
|
17816
18077
|
"flowId"
|
|
17817
|
-
].every((key) => typeof value[key] === "string") && typeof value.enabled === "boolean" && e$
|
|
18078
|
+
].every((key) => typeof value[key] === "string") && typeof value.enabled === "boolean" && e$28(value.params) && e$28(value.preview);
|
|
17818
18079
|
/** A document with the shape an action has: whether it is the action code writes is what the round trip answers. */
|
|
17819
|
-
var isDocument = (value) => e$
|
|
17820
|
-
var isField = (value) => e$
|
|
18080
|
+
var isDocument = (value) => e$28(value) && typeof value.name === "string" && e$28(value.nodes) && Object.values(value.nodes).every(isNode);
|
|
18081
|
+
var isField = (value) => e$28(value) && FIELD_TYPES.some((type) => type === value.type);
|
|
17821
18082
|
var text$1 = (params, key) => {
|
|
17822
18083
|
const value = params[key];
|
|
17823
18084
|
return typeof value === "string" ? value : void 0;
|
|
@@ -17834,7 +18095,7 @@ var inputOf = (node) => {
|
|
|
17834
18095
|
const raw = text$1(node.params, "input");
|
|
17835
18096
|
if (raw === void 0) return;
|
|
17836
18097
|
const value = parsed(raw);
|
|
17837
|
-
if (!e$
|
|
18098
|
+
if (!e$28(value) || !Object.values(value).every(isField)) return refuse(`the trigger "${node.id}" declares an input that is not a map of fields`);
|
|
17838
18099
|
return Object.fromEntries(Object.entries(value).filter((entry) => isField(entry[1])));
|
|
17839
18100
|
};
|
|
17840
18101
|
var accessOf = (node) => {
|
|
@@ -17947,7 +18208,7 @@ var chainFrom = (nodes, first) => {
|
|
|
17947
18208
|
/** A value with its keys in one order and its JSON params read, so two documents compare by what they hold. */
|
|
17948
18209
|
var comparable = (value) => {
|
|
17949
18210
|
if (Array.isArray(value)) return value.map(comparable);
|
|
17950
|
-
if (!e$
|
|
18211
|
+
if (!e$28(value)) return value;
|
|
17951
18212
|
return Object.fromEntries(Object.keys(value).filter((key) => value[key] !== void 0).sort().map((key) => {
|
|
17952
18213
|
const inner = value[key];
|
|
17953
18214
|
return [key, key === "input" && typeof inner === "string" ? parsed(inner) ?? inner : comparable(inner)];
|
|
@@ -18047,8 +18308,8 @@ var actionToSource = (spec, { packageName = "@plitzi/sdk-authoring" } = {}) => {
|
|
|
18047
18308
|
var canonical = (value) => {
|
|
18048
18309
|
if (value === void 0 || value === null) return null;
|
|
18049
18310
|
if (Array.isArray(value)) return value.map(canonical);
|
|
18050
|
-
if (e$
|
|
18051
|
-
const entries = Object.entries(value).map(([key, inner]) => [key, canonical(inner)]).filter(([, inner]) => inner !== null && !(e$
|
|
18311
|
+
if (e$28(value)) {
|
|
18312
|
+
const entries = Object.entries(value).map(([key, inner]) => [key, canonical(inner)]).filter(([, inner]) => inner !== null && !(e$28(inner) && Object.keys(inner).length === 0)).sort(([a], [b]) => a.localeCompare(b));
|
|
18052
18313
|
return Object.fromEntries(entries);
|
|
18053
18314
|
}
|
|
18054
18315
|
if (typeof value === "boolean" || typeof value === "number" || typeof value === "string") return value;
|
|
@@ -18123,12 +18384,12 @@ var classRules = (style, name) => {
|
|
|
18123
18384
|
};
|
|
18124
18385
|
var bindingsOf$1 = (element) => {
|
|
18125
18386
|
const stored = element.definition.bindings;
|
|
18126
|
-
if (!e$
|
|
18127
|
-
return Object.fromEntries(Object.entries(stored).map(([category, list]) => [category, (Array.isArray(list) ? list : []).filter(e$
|
|
18387
|
+
if (!e$28(stored)) return {};
|
|
18388
|
+
return Object.fromEntries(Object.entries(stored).map(([category, list]) => [category, (Array.isArray(list) ? list : []).filter(e$28).map((binding) => ({
|
|
18128
18389
|
source: binding.source,
|
|
18129
18390
|
to: binding.to,
|
|
18130
18391
|
transformers: Array.isArray(binding.transformers) ? binding.transformers : [],
|
|
18131
|
-
when: e$
|
|
18392
|
+
when: e$28(binding.when) && Array.isArray(binding.when.rules) && binding.when.rules.length > 0 ? binding.when : null,
|
|
18132
18393
|
enabled: binding.enabled !== false
|
|
18133
18394
|
})).map((binding) => JSON.stringify(canonical(binding))).sort()]));
|
|
18134
18395
|
};
|
|
@@ -18147,7 +18408,7 @@ var flowsOf = (element) => {
|
|
|
18147
18408
|
params: current.params,
|
|
18148
18409
|
preview: current.preview,
|
|
18149
18410
|
elementId: current.elementId === element.id ? "self" : current.elementId || null,
|
|
18150
|
-
when: e$
|
|
18411
|
+
when: e$28(current.when) && Array.isArray(current.when.rules) && current.when.rules.length > 0 ? current.when : null,
|
|
18151
18412
|
enabled: current.enabled,
|
|
18152
18413
|
whileRunning: current.whileRunning ?? "skip"
|
|
18153
18414
|
});
|
|
@@ -18171,7 +18432,7 @@ var PAGE_UNSET = {
|
|
|
18171
18432
|
var attributesOf = (element) => {
|
|
18172
18433
|
const isPage = element.definition.type === "page";
|
|
18173
18434
|
const defaults = isPage ? {} : defaultAttributes(element.definition.type);
|
|
18174
|
-
const stored = Object.entries(e$
|
|
18435
|
+
const stored = Object.entries(e$28(element.attributes) ? element.attributes : {}).filter(([key, value]) => value !== null && !(Array.isArray(value) && value.length === 0 && e$28(defaults[key])));
|
|
18175
18436
|
return Object.fromEntries(Object.entries({
|
|
18176
18437
|
...defaults,
|
|
18177
18438
|
...Object.fromEntries(stored)
|
|
@@ -18279,6 +18540,7 @@ var SpaceComparer = class {
|
|
|
18279
18540
|
this.check(at, "load strategy", a.definition.loadStrategy, b.definition.loadStrategy);
|
|
18280
18541
|
this.check(at, "flag", a.definition.flag, b.definition.flag);
|
|
18281
18542
|
this.check(at, "anchor", a.definition.anchor, b.definition.anchor);
|
|
18543
|
+
this.check(at, "motion", a.definition.motion, b.definition.motion);
|
|
18282
18544
|
const childrenA = this.childrenOf(this.expected, a);
|
|
18283
18545
|
const childrenB = this.childrenOf(this.actual, b);
|
|
18284
18546
|
if (childrenA.length !== childrenB.length) this.differ(at, `children: expected ${childrenA.length}, got ${childrenB.length}`);
|
|
@@ -18609,7 +18871,8 @@ var DEFINITION_FIELDS = /* @__PURE__ */ new Set([
|
|
|
18609
18871
|
"runtime",
|
|
18610
18872
|
"loadStrategy",
|
|
18611
18873
|
"flag",
|
|
18612
|
-
"anchor"
|
|
18874
|
+
"anchor",
|
|
18875
|
+
"motion"
|
|
18613
18876
|
]);
|
|
18614
18877
|
var PAGE_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
18615
18878
|
"slug",
|
|
@@ -18684,9 +18947,9 @@ var BINDING_CATEGORIES = [
|
|
|
18684
18947
|
"style"
|
|
18685
18948
|
];
|
|
18686
18949
|
var isEmpty = (value) => !value || Object.keys(value).length === 0;
|
|
18687
|
-
var isBinding = (value) => e$
|
|
18950
|
+
var isBinding = (value) => e$28(value) && typeof value.source === "string" && typeof value.to === "string";
|
|
18688
18951
|
/** A condition worth keeping: the builder stores "no condition" as an empty group, or as an empty array. */
|
|
18689
|
-
var conditionOf = (when) => e$
|
|
18952
|
+
var conditionOf = (when) => e$28(when) && Array.isArray(when.rules) && when.rules.length > 0 ? when : void 0;
|
|
18690
18953
|
/**
|
|
18691
18954
|
* Every name a document mentions outside its own structure — in attributes, bindings, steps and settings.
|
|
18692
18955
|
*
|
|
@@ -18709,7 +18972,7 @@ var stepCorpus = (host, interactions) => Object.values(interactions).map((node)
|
|
|
18709
18972
|
...node.elementId && node.elementId !== host ? { elementId: node.elementId } : {}
|
|
18710
18973
|
}));
|
|
18711
18974
|
var bindingsOf = (bindings, category) => {
|
|
18712
|
-
const list = e$
|
|
18975
|
+
const list = e$28(bindings) ? bindings[category] : void 0;
|
|
18713
18976
|
return Array.isArray(list) ? list.filter(isBinding) : [];
|
|
18714
18977
|
};
|
|
18715
18978
|
var bindingCorpus = (bindings) => BINDING_CATEGORIES.flatMap((category) => bindingsOf(bindings, category).map(({ source, to, transformers, when }) => ({
|
|
@@ -19280,7 +19543,7 @@ var SpecReader = class {
|
|
|
19280
19543
|
}
|
|
19281
19544
|
readPage(page, index) {
|
|
19282
19545
|
this.reachable.add(page.id);
|
|
19283
|
-
const attributes = e$
|
|
19546
|
+
const attributes = e$28(page.attributes) ? page.attributes : {};
|
|
19284
19547
|
const where = `Page "${page.id}"`;
|
|
19285
19548
|
for (const key of Object.keys(attributes)) if (!PAGE_ATTRIBUTES.has(key)) this.dropField(`page attribute "${key}"`);
|
|
19286
19549
|
if (attributes.enabled === false) this.correct("dropped-field", `${where} was disabled, which an authored page cannot say; it is authored enabled.`, page.id);
|
|
@@ -19346,7 +19609,7 @@ var SpecReader = class {
|
|
|
19346
19609
|
const definition = element.definition;
|
|
19347
19610
|
for (const key of Object.keys(definition)) if (!DEFINITION_FIELDS.has(key)) this.dropField(`"${key}"`);
|
|
19348
19611
|
const { type, legacy } = this.typeOf(element);
|
|
19349
|
-
const stored = e$
|
|
19612
|
+
const stored = e$28(element.attributes) ? element.attributes : {};
|
|
19350
19613
|
const attributes = this.readAttributes(type, legacy ? legacy.attributes(stored) : stored, this.placedNames(element));
|
|
19351
19614
|
const keepId = this.options.keepIds === true || !this.derived.has(element.id);
|
|
19352
19615
|
const { base: baseSelector, ...slotSelectors } = definition.styleSelectors;
|
|
@@ -19380,6 +19643,7 @@ var SpecReader = class {
|
|
|
19380
19643
|
...definition.runtime ? { runtime: definition.runtime } : {},
|
|
19381
19644
|
...definition.loadStrategy ? { loadStrategy: definition.loadStrategy } : {},
|
|
19382
19645
|
...definition.anchor ? { anchor: definition.anchor } : {},
|
|
19646
|
+
...definition.motion ? { motion: definition.motion } : {},
|
|
19383
19647
|
...definition.flag ? { flag: flagSpecOf(definition.flag) } : {},
|
|
19384
19648
|
meta: { label: definition.label },
|
|
19385
19649
|
...this.childrenSpec(element)
|
|
@@ -19398,10 +19662,10 @@ var SpecReader = class {
|
|
|
19398
19662
|
*/
|
|
19399
19663
|
placedNames(element) {
|
|
19400
19664
|
const { referenceId } = element.attributes;
|
|
19401
|
-
const component = m$
|
|
19665
|
+
const component = m$4(element) && typeof referenceId === "string" ? p$3(this.documents.schema, referenceId) : void 0;
|
|
19402
19666
|
const parentId = element.definition.parentId;
|
|
19403
19667
|
const parent = parentId && Object.hasOwn(this.flat, parentId) ? this.flat[parentId] : void 0;
|
|
19404
|
-
return [...Object.keys(component?.props ?? {}), ...parent && m$
|
|
19668
|
+
return [...Object.keys(component?.props ?? {}), ...parent && m$4(parent) ? ["slot"] : []];
|
|
19405
19669
|
}
|
|
19406
19670
|
readAttributes(type, attributes, placed = []) {
|
|
19407
19671
|
const declared = Object.hasOwn(ATTRIBUTE_NAMES, type) ? ATTRIBUTE_NAMES[type] : void 0;
|
|
@@ -19416,7 +19680,7 @@ var SpecReader = class {
|
|
|
19416
19680
|
this.droppedAttributes.set(key, (this.droppedAttributes.get(key) ?? 0) + 1);
|
|
19417
19681
|
continue;
|
|
19418
19682
|
}
|
|
19419
|
-
const emptyList = Array.isArray(value) && value.length === 0 && e$
|
|
19683
|
+
const emptyList = Array.isArray(value) && value.length === 0 && e$28(defaults[name]);
|
|
19420
19684
|
if (value === null || emptyList) continue;
|
|
19421
19685
|
if (typeof value === "string" && fixes && Object.hasOwn(fixes, name) && Object.hasOwn(fixes[name], value)) {
|
|
19422
19686
|
const fixed = fixes[name][value];
|
|
@@ -19680,6 +19944,7 @@ var ELEMENT_FIELDS = [
|
|
|
19680
19944
|
"runtime",
|
|
19681
19945
|
"loadStrategy",
|
|
19682
19946
|
"anchor",
|
|
19947
|
+
"motion",
|
|
19683
19948
|
"flag",
|
|
19684
19949
|
"meta",
|
|
19685
19950
|
"children"
|
|
@@ -20818,7 +21083,7 @@ var importedFiles = ({ probes, dark }) => {
|
|
|
20818
21083
|
const css = Object.fromEntries(ranges.filter(([, rules]) => Object.keys(rules).length > 0).map(([mode, rules]) => [mode, rulesOf(rules)]));
|
|
20819
21084
|
const listFile = listFiles.get(node.path);
|
|
20820
21085
|
const id = elementId(node.id ?? (listFile ? `${listFile}-item` : node.heading), node.tag === "div" ? "block" : node.tag);
|
|
20821
|
-
if (!t$
|
|
21086
|
+
if (!t$25(id)) throw new Error(`importedFiles: "${id}" is not a valid element id.`);
|
|
20822
21087
|
const props = {
|
|
20823
21088
|
id,
|
|
20824
21089
|
subType: SUB_TYPES.has(node.tag) ? node.tag : void 0,
|
|
@@ -21749,22 +22014,22 @@ var spec_default = "import { container, heading } from '../../elements';\nimport
|
|
|
21749
22014
|
var products_default = "{\n \"products\": [\n {\n \"slug\": \"desk-lamp\",\n \"title\": \"Desk lamp\",\n \"category\": \"lighting\",\n \"price\": 49,\n \"summary\": \"A warm, dimmable light for long evenings at the desk.\"\n },\n {\n \"slug\": \"floor-lamp\",\n \"title\": \"Floor lamp\",\n \"category\": \"lighting\",\n \"price\": 129,\n \"summary\": \"Tall, slim and bright enough for a whole corner.\"\n },\n {\n \"slug\": \"notebook\",\n \"title\": \"Dotted notebook\",\n \"category\": \"paper\",\n \"price\": 12,\n \"summary\": \"A5, 160 pages, lies flat when open.\",\n \"badge\": \"New\"\n },\n {\n \"slug\": \"planner\",\n \"title\": \"Weekly planner\",\n \"category\": \"paper\",\n \"price\": 18,\n \"summary\": \"A week on two pages, undated so it starts when you do.\"\n },\n {\n \"slug\": \"pen-set\",\n \"title\": \"Fineliner set\",\n \"category\": \"writing\",\n \"price\": 15,\n \"summary\": \"Six colours, 0.4 mm, quick to dry.\"\n },\n {\n \"slug\": \"fountain-pen\",\n \"title\": \"Fountain pen\",\n \"category\": \"writing\",\n \"price\": 64,\n \"summary\": \"A steel nib and a converter for any ink.\",\n \"badge\": \"Popular\"\n },\n {\n \"slug\": \"desk-mat\",\n \"title\": \"Felt desk mat\",\n \"category\": \"desk\",\n \"price\": 39,\n \"summary\": \"Wool felt, 90 × 40 cm, quiet under a keyboard.\"\n },\n {\n \"slug\": \"monitor-stand\",\n \"title\": \"Monitor stand\",\n \"category\": \"desk\",\n \"price\": 79,\n \"summary\": \"Oak, with room underneath for a keyboard.\"\n }\n ]\n}\n";
|
|
21750
22015
|
//#endregion
|
|
21751
22016
|
//#region templates/catalog/src/site/components/productCard.ts?raw
|
|
21752
|
-
var productCard_default = "/**\n * A product as a card, placed once per product: one component, so a change to the card is a change to every card. It\n * reads the product through its `item` prop and links to the product's own page.\n */\nimport { heading, link, styles, text } from '@plitzi/sdk-authoring';\n\nimport { t } from '../tokens.ts';\n\nimport type { ComponentSpec } from '@plitzi/sdk-authoring';\n\nconst card = styles('product-card', {\n css: {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n height: '100%',\n padding: '20px',\n borderRadius: '14px',\n border: `1px solid ${t.border}`,\n backgroundColor: t.surface,\n color: t.foreground,\n textDecoration: 'none',\n transition: 'border-color 150ms ease'\n },\n states: { hover: { borderColor: t.primary } }\n});\n\nconst badge = styles('product-badge', {\n alignSelf: 'flex-start',\n padding: '2px 10px',\n borderRadius: '999px',\n backgroundColor: t.primary,\n color: t['on-primary'],\n fontSize: '12px',\n fontWeight: 600\n});\n\nconst summary = styles('product-summary', { margin: '0px', color: t.muted, fontSize: '14px', flexGrow: 1 });\n\nconst price = styles('product-price', { fontWeight: 700 });\n\nexport const productCard: ComponentSpec = {\n id: 'product-card',\n props: { item: { type: 'json', description: 'The product: slug, title, summary, price and, maybe, a badge' } },\n root:
|
|
22017
|
+
var productCard_default = "/**\n * A product as a card, placed once per product: one component, so a change to the card is a change to every card. It\n * reads the product through its `item` prop and links to the product's own page. Its root is the list's item, an\n * `<li>`, laid out as a grid of one so the link fills it — the card is as tall as the row it sits in.\n */\nimport { heading, link, listItem, styles, text } from '@plitzi/sdk-authoring';\n\nimport { t } from '../tokens.ts';\n\nimport type { ComponentSpec } from '@plitzi/sdk-authoring';\n\nconst card = styles('product-card', {\n css: {\n display: 'flex',\n flexDirection: 'column',\n gap: 8,\n height: '100%',\n padding: '20px',\n borderRadius: '14px',\n border: `1px solid ${t.border}`,\n backgroundColor: t.surface,\n color: t.foreground,\n textDecoration: 'none',\n transition: 'border-color 150ms ease'\n },\n states: { hover: { borderColor: t.primary } }\n});\n\nconst badge = styles('product-badge', {\n alignSelf: 'flex-start',\n padding: '2px 10px',\n borderRadius: '999px',\n backgroundColor: t.primary,\n color: t['on-primary'],\n fontSize: '12px',\n fontWeight: 600\n});\n\nconst summary = styles('product-summary', { margin: '0px', color: t.muted, fontSize: '14px', flexGrow: 1 });\n\nconst price = styles('product-price', { fontWeight: 700 });\n\nexport const productCard: ComponentSpec = {\n id: 'product-card',\n props: { item: { type: 'json', description: 'The product: slug, title, summary, price and, maybe, a badge' } },\n root: listItem({\n id: 'card-item',\n css: { display: 'grid' },\n children: [\n link({\n id: 'card',\n href: '/products/{{ props.item.slug|url_encode }}',\n class: card,\n children: [\n text({ id: 'card-badge', class: badge, from: 'props.item.badge', visible: 'props.item.badge' }),\n heading({\n id: 'card-title',\n subType: 'h3',\n from: 'props.item.title',\n css: { margin: '0px', fontSize: '18px' }\n }),\n text({ id: 'card-summary', class: summary, from: 'props.item.summary' }),\n text({ id: 'card-price', class: price, from: 'props.item.price', as: 'price' })\n ]\n })\n ]\n })\n};\n";
|
|
21753
22018
|
//#endregion
|
|
21754
22019
|
//#region templates/catalog/src/site/data.ts?raw
|
|
21755
22020
|
var data_default = "/**\n * The data the pages read: one JSON file the project serves (`public/data/products.json`). Its contents type every\n * path a page writes — `products.data.products` — so a misspelt field is a type error, not an empty card. Swapping the\n * file for a real endpoint later changes `PRODUCTS_URL`, and nothing else.\n */\nimport { source } from '@plitzi/sdk-authoring';\n\nimport sample from '../../public/data/products.json' with { type: 'json' };\n\nexport const PRODUCTS_URL = '/data/products.json';\n\n/** The categories the catalog filters by, in the order its select offers them. */\nexport const CATEGORIES = [\n { value: 'lighting', label: 'Lighting' },\n { value: 'paper', label: 'Paper' },\n { value: 'writing', label: 'Writing' },\n { value: 'desk', label: 'Desk' }\n] as const;\n\n/** The products file as the source of the provider named `id` — one per page, as ids are one namespace. */\nexport const productsSource = (id: string) => source(id, sample);\n";
|
|
21756
22021
|
//#endregion
|
|
21757
22022
|
//#region templates/catalog/src/site/layout.ts?raw
|
|
21758
|
-
var layout_default = "/**\n * The chrome every page shares — a header with the menu, and a footer — written once. Pages name the layout and the\n * slot their body goes in (`site-main`); the current menu entry comes from `activeOn`, not from each page.\n */\nimport { activeOn, container, link, styles, text } from '@plitzi/sdk-authoring';\n\nimport { t } from './tokens.ts';\n\nimport type { LayoutSpec } from '@plitzi/sdk-authoring';\n\nconst shell = styles('shell', {\n display: 'flex',\n flexDirection: 'column',\n minHeight: '100vh',\n backgroundColor: t.background,\n color: t.foreground,\n fontFamily: 'system-ui, sans-serif'\n});\n\nconst header = styles('site-header', {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 24px',\n borderBottom: `1px solid ${t.border}`\n});\n\nconst brand = styles('brand', { fontWeight: 700, color: t.foreground, textDecoration: 'none' });\n\nconst nav = styles('nav', { display: 'flex', gap: 20 });\n\nconst navLink = styles('nav-link', {\n css: { color: t.muted, textDecoration: 'none' },\n variants: { active: { color: t.foreground, fontWeight: 600 } }\n});\n\nconst main = styles('main', {\n flexGrow: 1,\n width: '100%',\n maxWidth: '1120px',\n margin: '0px auto',\n padding: '40px 24px'\n});\n\nconst footer = styles('site-footer', { padding: '24px', color: t.muted, fontSize: '14px', textAlign: 'center' });\n\n/** The menu: one entry per section, and the pages that belong to it. */\nconst MENU = [\n { href: '/', label: 'Home', pages: ['home'] },\n { href: '/products', label: 'Products', pages: ['catalog', 'product'] }\n] as const;\n\nexport const layout: LayoutSpec = {\n id: 'site',\n body: [\n container({\n id: 'site-shell',\n class: shell,\n children: [\n container({\n id: 'site-header',\n subType: 'header',\n class: header,\n children: [\n link({ id: 'site-brand', href: '/', class: brand,
|
|
22023
|
+
var layout_default = "/**\n * The chrome every page shares — a header with the menu, and a footer — written once. Pages name the layout and the\n * slot their body goes in (`site-main`); the current menu entry comes from `activeOn`, not from each page.\n */\nimport { activeOn, container, link, styles, text } from '@plitzi/sdk-authoring';\n\nimport { t } from './tokens.ts';\n\nimport type { LayoutSpec } from '@plitzi/sdk-authoring';\n\nconst shell = styles('shell', {\n display: 'flex',\n flexDirection: 'column',\n minHeight: '100vh',\n backgroundColor: t.background,\n color: t.foreground,\n fontFamily: 'system-ui, sans-serif'\n});\n\nconst header = styles('site-header', {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 24px',\n borderBottom: `1px solid ${t.border}`\n});\n\nconst brand = styles('brand', { fontWeight: 700, color: t.foreground, textDecoration: 'none' });\n\nconst nav = styles('nav', { display: 'flex', gap: 20 });\n\nconst navLink = styles('nav-link', {\n css: { color: t.muted, textDecoration: 'none' },\n variants: { active: { color: t.foreground, fontWeight: 600 } }\n});\n\nconst main = styles('main', {\n flexGrow: 1,\n width: '100%',\n maxWidth: '1120px',\n margin: '0px auto',\n padding: '40px 24px'\n});\n\nconst footer = styles('site-footer', { padding: '24px', color: t.muted, fontSize: '14px', textAlign: 'center' });\n\n/** The menu: one entry per section, and the pages that belong to it. */\nconst MENU = [\n { href: '/', label: 'Home', pages: ['home'] },\n { href: '/products', label: 'Products', pages: ['catalog', 'product'] }\n] as const;\n\nexport const layout: LayoutSpec = {\n id: 'site',\n body: [\n container({\n id: 'site-shell',\n class: shell,\n children: [\n container({\n id: 'site-header',\n subType: 'header',\n class: header,\n children: [\n link({ id: 'site-brand', href: '/', class: brand, content: 'Desk & Co.' }),\n container({\n id: 'site-nav',\n subType: 'nav',\n class: nav,\n children: MENU.map(entry =>\n link({\n href: entry.href,\n class: navLink,\n bind: [activeOn(navLink, [...entry.pages])],\n content: entry.label\n })\n )\n })\n ]\n }),\n container({ id: 'site-main', subType: 'main', class: main }),\n container({\n id: 'site-footer',\n subType: 'footer',\n class: footer,\n children: [text('Demo content: the products and their prices are made up.')]\n })\n ]\n })\n ]\n};\n";
|
|
21759
22024
|
//#endregion
|
|
21760
22025
|
//#region templates/catalog/src/site/pages/catalog.ts?raw
|
|
21761
22026
|
var catalog_default = "/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */\n/**\n * Every product, filtered by category: the select writes the choice to `state`, and the list shows only the rows\n * that match — with a count and an empty state read off the same predicate.\n */\nimport {\n apiContainer,\n container,\n formControl,\n heading,\n list,\n named,\n on,\n setState,\n styles,\n text\n} from '@plitzi/sdk-authoring';\n\nimport { CATEGORIES, PRODUCTS_URL, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\n/** The product grid, shared with the home page: a list is a `<ul>`, so the bullets and the indent go. */\nexport const grid = styles('product-grid', {\n desktop: {\n display: 'grid',\n gridTemplateColumns: 'repeat(3, minmax(0, 1fr))',\n gap: 20,\n margin: '0px',\n padding: '0px',\n listStyleType: 'none'\n },\n tablet: { gridTemplateColumns: 'repeat(2, minmax(0, 1fr))' },\n mobile: { gridTemplateColumns: 'minmax(0, 1fr)' }\n});\n\nconst toolbar = styles('catalog-toolbar', {\n display: 'flex',\n alignItems: 'end',\n justifyContent: 'space-between',\n gap: 16,\n marginBottom: '24px'\n});\n\nconst muted = styles('muted', { color: t.muted });\n\n// One predicate, read three times: the rows, their count, and whether there are none.\nconst shown = \"source|filter(p => (state.category ?? 'all') == 'all' or p.category == state.category)\";\n\nconst products = productsSource('catalog-products');\n\nexport const catalog: PageSpec = {\n id: 'catalog',\n name: 'Products',\n slug: 'products',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n heading('Products', { id: 'catalog-title', subType: 'h1' }),\n apiContainer({\n id: products.id,\n query: PRODUCTS_URL,\n cache: true,\n children: [\n container({\n id: 'catalog-toolbar',\n class: toolbar,\n children: [\n // A control outside a form keeps its own value and fires `onChange` with `{ value, name }`.\n formControl({\n id: 'catalog-category',\n name: 'category',\n label: 'Category',\n subType: 'select',\n options: [\n { label: 'Everything', value: 'all' },\n ...CATEGORIES.map(({ value, label }) => ({ value, label }))\n ],\n defaultValue: 'all',\n // A filter always has an answer: the select is not a question that must be filled in.\n required: false,\n flows: [\n [\n named('picked', on('onChange')),\n setState({ key: 'category', type: 'text', value: '{{ picked.value }}' })\n ]\n ]\n }),\n text({ id: 'catalog-count', class: muted, from: products.data.products, as: `{{ ${shown}|length }} shown` })\n ]\n }),\n list({\n id: 'catalog-list',\n class: grid,\n from: products.data.products,\n as: `{{ ${shown} }}`,\n row: 'product-card'\n }),\n text('Nothing in that category yet.', {\n id: 'catalog-empty',\n class: muted,\n visible: { source: products.data.products, template: `{{ source is defined and ${shown}|length == 0 }}` }\n })\n ]\n })\n ]\n};\n";
|
|
21762
22027
|
//#endregion
|
|
21763
22028
|
//#region templates/catalog/src/site/pages/home.ts?raw
|
|
21764
|
-
var home_default = "/** The home page: what the shop is, and the first products of the file as a way in. */\nimport { apiContainer, container, heading, link, list, styles, text } from '@plitzi/sdk-authoring';\n\nimport { grid } from './catalog.ts';\nimport { PRODUCTS_URL, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\nconst hero = styles('hero', { display: 'flex', flexDirection: 'column', gap: 16, padding: '48px 0px' });\n\nconst lede = styles('lede', { margin: '0px', maxWidth: '560px', color: t.muted, fontSize: '18px' });\n\nconst cta = styles('cta', {\n css: {\n alignSelf: 'flex-start',\n padding: '10px 18px',\n borderRadius: '10px',\n backgroundColor: t.primary,\n color: t['on-primary'],\n fontWeight: 600,\n textDecoration: 'none'\n },\n states: { hover: { opacity: 0.9 } }\n});\n\nconst featured = productsSource('home-products');\n\nexport const home: PageSpec = {\n id: 'home',\n name: 'Home',\n slug: '',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n container({\n id: 'home-hero',\n subType: 'section',\n class: hero,\n children: [\n heading('Good things for a good desk', { id: 'home-title', subType: 'h1', css: { margin: '0px' } }),\n text('Lamps, paper and pens we would use ourselves.', { id: 'home-lede', class: lede }),\n link({ id: 'home-cta', href: '/products', class: cta,
|
|
22029
|
+
var home_default = "/** The home page: what the shop is, and the first products of the file as a way in. */\nimport { apiContainer, container, heading, link, list, styles, text } from '@plitzi/sdk-authoring';\n\nimport { grid } from './catalog.ts';\nimport { PRODUCTS_URL, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\nconst hero = styles('hero', { display: 'flex', flexDirection: 'column', gap: 16, padding: '48px 0px' });\n\nconst lede = styles('lede', { margin: '0px', maxWidth: '560px', color: t.muted, fontSize: '18px' });\n\nconst cta = styles('cta', {\n css: {\n alignSelf: 'flex-start',\n padding: '10px 18px',\n borderRadius: '10px',\n backgroundColor: t.primary,\n color: t['on-primary'],\n fontWeight: 600,\n textDecoration: 'none'\n },\n states: { hover: { opacity: 0.9 } }\n});\n\nconst featured = productsSource('home-products');\n\nexport const home: PageSpec = {\n id: 'home',\n name: 'Home',\n slug: '',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n container({\n id: 'home-hero',\n subType: 'section',\n class: hero,\n children: [\n heading('Good things for a good desk', { id: 'home-title', subType: 'h1', css: { margin: '0px' } }),\n text('Lamps, paper and pens we would use ourselves.', { id: 'home-lede', class: lede }),\n link({ id: 'home-cta', href: '/products', class: cta, content: 'See every product' })\n ]\n }),\n apiContainer({\n id: featured.id,\n query: PRODUCTS_URL,\n cache: true,\n children: [\n heading('Featured', { id: 'home-featured-title', subType: 'h2' }),\n list({\n id: 'home-featured',\n class: grid,\n from: featured.data.products,\n as: '{{ source|slice(0, 3) }}',\n row: 'product-card'\n })\n ]\n })\n ]\n};\n";
|
|
21765
22030
|
//#endregion
|
|
21766
22031
|
//#region templates/catalog/src/site/pages/product.ts?raw
|
|
21767
|
-
var product_default = "/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */\n/**\n * A page per product, at `/products/<slug>`: the same file, narrowed to the product the address names — and a message,\n * not an empty page, when no product has that name.\n */\nimport { apiContainer, container, heading, link, list, styles, text } from '@plitzi/sdk-authoring';\n\nimport { PRODUCTS_URL, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\nconst detail = styles('product-detail', { display: 'flex', flexDirection: 'column', gap: 12, maxWidth: '640px' });\n\nconst back = styles('back-link', { color: t.muted, textDecoration: 'none' });\n\nconst products = productsSource('product-data');\n\nexport const product: PageSpec = {\n id: 'product',\n name: 'Product',\n slug: 'products/:slug',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n link({ id: 'product-back', href: '/products', class: back,
|
|
22032
|
+
var product_default = "/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */\n/**\n * A page per product, at `/products/<slug>`: the same file, narrowed to the product the address names — and a message,\n * not an empty page, when no product has that name.\n */\nimport { apiContainer, container, heading, link, list, listItem, styles, text } from '@plitzi/sdk-authoring';\n\nimport { PRODUCTS_URL, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\nconst detail = styles('product-detail', { display: 'flex', flexDirection: 'column', gap: 12, maxWidth: '640px' });\n\nconst back = styles('back-link', { color: t.muted, textDecoration: 'none' });\n\nconst products = productsSource('product-data');\n\nexport const product: PageSpec = {\n id: 'product',\n name: 'Product',\n slug: 'products/:slug',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n link({ id: 'product-back', href: '/products', class: back, content: '← All products' }),\n apiContainer({\n id: products.id,\n query: PRODUCTS_URL,\n cache: true,\n children: [\n list({\n id: 'product-one',\n // A list is a `<ul>`: one product reads as a page, not as an indented item.\n css: { margin: '0px', padding: '0px', listStyleType: 'none' },\n from: products.data.products,\n as: '{{ source|filter(p => p.slug == navigation.routeParams.slug) }}',\n // Shown once the file answers with the product; the message below is the other side of the question.\n visible: {\n source: products.data.products,\n template: \"{{ source|find('slug', navigation.routeParams.slug) }}\"\n },\n row: r =>\n listItem({\n id: 'product-item',\n children: [\n container({\n id: 'product-detail',\n subType: 'article',\n class: detail,\n children: [\n heading({ id: 'product-title', subType: 'h1', from: `${r.item}.title` }),\n text({ id: 'product-summary', from: `${r.item}.summary` }),\n text({\n id: 'product-price',\n from: `${r.item}.price`,\n as: 'price',\n css: { fontSize: '24px', fontWeight: 700 }\n })\n ]\n })\n ]\n })\n }),\n text('No product by that name.', {\n id: 'product-missing',\n visible: {\n source: products.data.products,\n template: \"{{ source is defined and not (source|find('slug', navigation.routeParams.slug)) }}\"\n }\n })\n ]\n })\n ]\n};\n";
|
|
21768
22033
|
//#endregion
|
|
21769
22034
|
//#region templates/catalog/src/site/tokens.ts?raw
|
|
21770
22035
|
var tokens_default = "/**\n * Every colour the site uses, with a value for each theme. Elements say `t.<name>` — `var(--name)` — so the palette\n * changes here and nowhere else, and a name that is not here is a type error.\n */\nimport { tokens } from '@plitzi/sdk-authoring';\n\nimport type { SpaceSpec } from '@plitzi/sdk-authoring';\n\nexport const variables = {\n color: {\n background: { light: '#fbfbfd', dark: '#0b0b0f', default: '#fbfbfd' },\n surface: { light: '#ffffff', dark: '#15151b', default: '#ffffff' },\n foreground: { light: '#17171c', dark: '#f4f4f5', default: '#17171c' },\n muted: { light: '#5f5f6e', dark: '#a1a1aa', default: '#5f5f6e' },\n border: { light: '#e6e6ee', dark: '#2a2a32', default: '#e6e6ee' },\n primary: { light: '#4f46e5', dark: '#818cf8', default: '#4f46e5' },\n 'on-primary': { light: '#ffffff', dark: '#0b0b0f', default: '#ffffff' }\n }\n} satisfies SpaceSpec['variables'];\n\nexport const t = tokens(variables);\n";
|
|
@@ -22063,13 +22328,58 @@ function probePage(input) {
|
|
|
22063
22328
|
const firstClass = typeof node.className === "string" ? node.className.split(" ")[0] : "";
|
|
22064
22329
|
return `<${node.tagName.toLowerCase()}${firstClass ? `.${firstClass}` : ""}>`;
|
|
22065
22330
|
};
|
|
22066
|
-
/**
|
|
22067
|
-
const
|
|
22331
|
+
/** The space's element a node belongs to: itself when it is one, or the nearest that holds it. */
|
|
22332
|
+
const elementIdOf = (node) => node.closest("[data-plitzi-el]")?.getAttribute("data-plitzi-el") ?? void 0;
|
|
22333
|
+
/** The node that takes an element's box away — which is rarely the element itself — and what it does. */
|
|
22334
|
+
const hiderOf = (node) => {
|
|
22068
22335
|
for (let at = node; at; at = at.parentElement) {
|
|
22069
22336
|
const style = getComputedStyle(at);
|
|
22070
|
-
if (style.display === "none") return
|
|
22071
|
-
|
|
22337
|
+
if (style.display === "none") return {
|
|
22338
|
+
at,
|
|
22339
|
+
how: "display:none"
|
|
22340
|
+
};
|
|
22341
|
+
if (style.visibility === "hidden" || style.visibility === "collapse") return {
|
|
22342
|
+
at,
|
|
22343
|
+
how: `visibility:${style.visibility}`
|
|
22344
|
+
};
|
|
22072
22345
|
}
|
|
22346
|
+
};
|
|
22347
|
+
/** The style rules of the page's own sheets that sit under a condition on the viewport (`@media`, `@container`). */
|
|
22348
|
+
const conditionalRules = () => {
|
|
22349
|
+
const found = [];
|
|
22350
|
+
const walk = (rules, conditional) => {
|
|
22351
|
+
for (const rule of rules) if (rule instanceof CSSStyleRule) {
|
|
22352
|
+
if (conditional) found.push(rule);
|
|
22353
|
+
walk(rule.cssRules, conditional);
|
|
22354
|
+
} else if (rule instanceof CSSMediaRule || typeof CSSContainerRule !== "undefined" && rule instanceof CSSContainerRule) walk(rule.cssRules, true);
|
|
22355
|
+
else if (rule instanceof CSSGroupingRule) walk(rule.cssRules, conditional);
|
|
22356
|
+
};
|
|
22357
|
+
for (const sheet of document.styleSheets) try {
|
|
22358
|
+
walk(sheet.cssRules, false);
|
|
22359
|
+
} catch {}
|
|
22360
|
+
return found;
|
|
22361
|
+
};
|
|
22362
|
+
let widthRules;
|
|
22363
|
+
/**
|
|
22364
|
+
* Whether a node is shown or hidden by the width it is drawn at: a rule under a breakpoint sets its `display` or its
|
|
22365
|
+
* `visibility` — whether that rule applies now or not. The desktop navigation a phone hides, the bottom bar only a
|
|
22366
|
+
* phone shows: hidden at this width on purpose, and checked at the width it shows at.
|
|
22367
|
+
*/
|
|
22368
|
+
const laidOutByWidth = (node) => {
|
|
22369
|
+
widthRules ??= conditionalRules();
|
|
22370
|
+
return widthRules.some((rule) => {
|
|
22371
|
+
if (!rule.style.display && !rule.style.visibility) return false;
|
|
22372
|
+
try {
|
|
22373
|
+
return node.matches(rule.selectorText);
|
|
22374
|
+
} catch {
|
|
22375
|
+
return false;
|
|
22376
|
+
}
|
|
22377
|
+
});
|
|
22378
|
+
};
|
|
22379
|
+
/** Why an element has no box, named by the node that takes it away — which is rarely the element itself. */
|
|
22380
|
+
const whyHidden = (node) => {
|
|
22381
|
+
const hider = hiderOf(node);
|
|
22382
|
+
if (hider) return `${hider.how} on ${hider.at === node ? "itself" : nameOf(hider.at)}`;
|
|
22073
22383
|
if (getComputedStyle(node).display === "contents") return "it has no box of its own (display:contents) and nothing inside it shows";
|
|
22074
22384
|
const box = node.getBoundingClientRect();
|
|
22075
22385
|
return `it has no size (${Math.round(box.width)}×${Math.round(box.height)})`;
|
|
@@ -22081,23 +22391,58 @@ function probePage(input) {
|
|
|
22081
22391
|
};
|
|
22082
22392
|
const missing = [];
|
|
22083
22393
|
const hidden = [];
|
|
22394
|
+
const byWidth = [];
|
|
22084
22395
|
for (const { id, selector } of input.expected) {
|
|
22085
22396
|
const nodes = [...document.querySelectorAll(selector)];
|
|
22086
22397
|
if (nodes.length === 0) missing.push(id);
|
|
22087
|
-
else if (!nodes.some(isVisible))
|
|
22088
|
-
|
|
22089
|
-
|
|
22090
|
-
|
|
22398
|
+
else if (!nodes.some(isVisible)) {
|
|
22399
|
+
const hider = hiderOf(nodes[0]);
|
|
22400
|
+
if (hider && laidOutByWidth(hider.at)) byWidth.push(id);
|
|
22401
|
+
else hidden.push({
|
|
22402
|
+
id,
|
|
22403
|
+
reason: whyHidden(nodes[0])
|
|
22404
|
+
});
|
|
22405
|
+
}
|
|
22091
22406
|
}
|
|
22092
22407
|
/**
|
|
22408
|
+
* Whether any of a node is where it can be seen: its box cut by every ancestor that clips what spills (a carousel's
|
|
22409
|
+
* track, a scrolling row) and then by the viewport — the test the browser runs before it fetches a lazy image.
|
|
22410
|
+
*/
|
|
22411
|
+
const inSight = (node) => {
|
|
22412
|
+
let { left, top, right, bottom } = node.getBoundingClientRect();
|
|
22413
|
+
for (let at = node.parentElement; at; at = at.parentElement) {
|
|
22414
|
+
const style = getComputedStyle(at);
|
|
22415
|
+
if (style.display === "contents") continue;
|
|
22416
|
+
const box = at.getBoundingClientRect();
|
|
22417
|
+
if (style.overflowX !== "visible") {
|
|
22418
|
+
left = Math.max(left, box.left);
|
|
22419
|
+
right = Math.min(right, box.right);
|
|
22420
|
+
}
|
|
22421
|
+
if (style.overflowY !== "visible") {
|
|
22422
|
+
top = Math.max(top, box.top);
|
|
22423
|
+
bottom = Math.min(bottom, box.bottom);
|
|
22424
|
+
}
|
|
22425
|
+
}
|
|
22426
|
+
return Math.min(right, window.innerWidth) > Math.max(left, 0) && Math.min(bottom, window.innerHeight) > Math.max(top, 0);
|
|
22427
|
+
};
|
|
22428
|
+
/**
|
|
22093
22429
|
* An image element that failed draws a fallback that loads fine, so the browser alone would call it loaded: it says
|
|
22094
|
-
* which source failed in `data-plitzi-failed`. Any other `img` is asked the browser's way — except a lazy one
|
|
22095
|
-
* fold, which has not been asked for yet
|
|
22430
|
+
* which source failed in `data-plitzi-failed`. Any other `img` is asked the browser's way — except a lazy one out of
|
|
22431
|
+
* sight (below the fold, or beside it in a carousel's track), which has not been asked for yet: it working, not
|
|
22432
|
+
* failing.
|
|
22096
22433
|
*/
|
|
22097
22434
|
const brokenImages = input.images ? [...document.querySelectorAll("img")].flatMap((image) => {
|
|
22098
22435
|
const failed = image.getAttribute("data-plitzi-failed");
|
|
22099
|
-
|
|
22100
|
-
|
|
22436
|
+
const elementId = elementIdOf(image);
|
|
22437
|
+
const at = elementId === void 0 ? {} : { elementId };
|
|
22438
|
+
if (failed !== null) return [{
|
|
22439
|
+
source: `${failed} (${nameOf(image)})`,
|
|
22440
|
+
...at
|
|
22441
|
+
}];
|
|
22442
|
+
return !(image.loading === "lazy" && !inSight(image)) && (!image.complete || image.naturalWidth === 0) ? [{
|
|
22443
|
+
source: image.currentSrc || image.src || nameOf(image),
|
|
22444
|
+
...at
|
|
22445
|
+
}] : [];
|
|
22101
22446
|
}) : [];
|
|
22102
22447
|
/**
|
|
22103
22448
|
* As far as it can be SEEN: an ancestor that clips its overflow cuts an element there, so a photograph scaled inside
|
|
@@ -22107,12 +22452,21 @@ function probePage(input) {
|
|
|
22107
22452
|
let overflow = null;
|
|
22108
22453
|
if (input.overflow) {
|
|
22109
22454
|
const viewport = document.documentElement.clientWidth;
|
|
22455
|
+
/**
|
|
22456
|
+
* Whether an ancestor keeps what spills inside it. One that hides or clips it does; so does one that scrolls it —
|
|
22457
|
+
* a carousel's row, a table's wrapper — which is somewhere a person scrolls on purpose, not the page doing it. Not
|
|
22458
|
+
* the page's own scroller: the document, or the pane the SDK scrolls a page in (`.plitzi-sdk`), whose sideways
|
|
22459
|
+
* scroll IS the page scrolling sideways.
|
|
22460
|
+
*/
|
|
22461
|
+
const keepsOverflow = (ancestor) => {
|
|
22462
|
+
const { overflowX } = getComputedStyle(ancestor);
|
|
22463
|
+
if (overflowX === "hidden" || overflowX === "clip") return true;
|
|
22464
|
+
const pageScroller = ancestor === document.documentElement || ancestor === document.body || ancestor.matches(".plitzi-sdk");
|
|
22465
|
+
return (overflowX === "auto" || overflowX === "scroll") && !pageScroller;
|
|
22466
|
+
};
|
|
22110
22467
|
const visibleRight = (node) => {
|
|
22111
22468
|
let right = node.getBoundingClientRect().right;
|
|
22112
|
-
for (let ancestor = node.parentElement; ancestor; ancestor = ancestor.parentElement)
|
|
22113
|
-
const { overflowX } = getComputedStyle(ancestor);
|
|
22114
|
-
if (overflowX === "hidden" || overflowX === "clip") right = Math.min(right, ancestor.getBoundingClientRect().right);
|
|
22115
|
-
}
|
|
22469
|
+
for (let ancestor = node.parentElement; ancestor; ancestor = ancestor.parentElement) if (keepsOverflow(ancestor)) right = Math.min(right, ancestor.getBoundingClientRect().right);
|
|
22116
22470
|
return right;
|
|
22117
22471
|
};
|
|
22118
22472
|
const wide = [...document.querySelectorAll("body *")].map((node) => ({
|
|
@@ -22121,7 +22475,8 @@ function probePage(input) {
|
|
|
22121
22475
|
})).filter((entry) => entry.right > viewport + 1).sort((a, b) => b.right - a.right);
|
|
22122
22476
|
if (wide.length > 0) overflow = {
|
|
22123
22477
|
pixels: Math.round(wide[0].right - viewport),
|
|
22124
|
-
widest: wide.slice(0, 3).map((entry) => nameOf(entry.node))
|
|
22478
|
+
widest: wide.slice(0, 3).map((entry) => nameOf(entry.node)),
|
|
22479
|
+
elementIds: [...new Set(wide.slice(0, 3).map((entry) => elementIdOf(entry.node)).filter((id) => id !== void 0))]
|
|
22125
22480
|
};
|
|
22126
22481
|
}
|
|
22127
22482
|
const illegible = [];
|
|
@@ -22181,13 +22536,20 @@ function probePage(input) {
|
|
|
22181
22536
|
const paper = ink ? behind(node) : null;
|
|
22182
22537
|
if (!ink || !paper) continue;
|
|
22183
22538
|
const distance = Math.abs(ink[0] - paper[0]) + Math.abs(ink[1] - paper[1]) + Math.abs(ink[2] - paper[2]);
|
|
22184
|
-
if (ink[3] === 0 || distance < 24)
|
|
22539
|
+
if (ink[3] === 0 || distance < 24) {
|
|
22540
|
+
const elementId = elementIdOf(node);
|
|
22541
|
+
illegible.push({
|
|
22542
|
+
text: `${nameOf(node)}: "${text.slice(0, 40)}"`,
|
|
22543
|
+
...elementId === void 0 ? {} : { elementId }
|
|
22544
|
+
});
|
|
22545
|
+
}
|
|
22185
22546
|
}
|
|
22186
22547
|
}
|
|
22187
22548
|
return {
|
|
22188
22549
|
marked: document.querySelector("[data-plitzi-el]") !== null,
|
|
22189
22550
|
missing,
|
|
22190
22551
|
hidden,
|
|
22552
|
+
byWidth,
|
|
22191
22553
|
brokenImages,
|
|
22192
22554
|
overflow,
|
|
22193
22555
|
illegible
|
|
@@ -22196,20 +22558,45 @@ function probePage(input) {
|
|
|
22196
22558
|
//#endregion
|
|
22197
22559
|
//#region src/testing/inspect.ts
|
|
22198
22560
|
var label = (handle) => `${handle.type} "${handle.id}"`;
|
|
22199
|
-
|
|
22200
|
-
var
|
|
22201
|
-
|
|
22561
|
+
var about = (elementId) => elementId === void 0 ? {} : { elementId };
|
|
22562
|
+
var sidewaysOf = (overflow) => overflow ? [{
|
|
22563
|
+
code: "sideways-scroll",
|
|
22564
|
+
message: `the page scrolls sideways by ${overflow.pixels}px — widest: ${overflow.widest.join(", ")}`,
|
|
22565
|
+
...about(overflow.elementIds.at(0))
|
|
22566
|
+
}] : [];
|
|
22567
|
+
/** The findings as issues. Separate from the probe so what a failure SAYS is tested without a browser. */
|
|
22568
|
+
var issuesOf = (expected, findings) => {
|
|
22569
|
+
if (!findings.marked && expected.length > 0) return [{
|
|
22570
|
+
code: "not-rendered",
|
|
22571
|
+
message: "nothing on the page carries data-plitzi-el — the space did not render here, or it renders with `testAttributes: false`"
|
|
22572
|
+
}];
|
|
22202
22573
|
const byId = new Map(expected.map((handle) => [handle.id, handle]));
|
|
22203
22574
|
const named = (id) => {
|
|
22204
22575
|
const handle = byId.get(id);
|
|
22205
22576
|
return handle ? label(handle) : `"${id}"`;
|
|
22206
22577
|
};
|
|
22207
22578
|
return [
|
|
22208
|
-
...findings.missing.map((id) =>
|
|
22209
|
-
|
|
22210
|
-
|
|
22211
|
-
|
|
22212
|
-
|
|
22579
|
+
...findings.missing.map((id) => ({
|
|
22580
|
+
code: "element-missing",
|
|
22581
|
+
message: `${named(id)} is not on the page`,
|
|
22582
|
+
elementId: id
|
|
22583
|
+
})),
|
|
22584
|
+
...findings.hidden.map(({ id, reason }) => ({
|
|
22585
|
+
code: "element-hidden",
|
|
22586
|
+
message: `${named(id)} is on the page but not visible: ${reason}`,
|
|
22587
|
+
elementId: id
|
|
22588
|
+
})),
|
|
22589
|
+
...findings.brokenImages.map(({ source, elementId }) => ({
|
|
22590
|
+
code: "image-not-loaded",
|
|
22591
|
+
message: `an image never loaded: ${source}`,
|
|
22592
|
+
...about(elementId)
|
|
22593
|
+
})),
|
|
22594
|
+
...sidewaysOf(findings.overflow),
|
|
22595
|
+
...findings.illegible.map(({ text, elementId }) => ({
|
|
22596
|
+
code: "illegible-text",
|
|
22597
|
+
message: `text drawn in the colour behind it: ${text}`,
|
|
22598
|
+
...about(elementId)
|
|
22599
|
+
}))
|
|
22213
22600
|
];
|
|
22214
22601
|
};
|
|
22215
22602
|
var defaultPage = (handles) => {
|
|
@@ -22232,11 +22619,14 @@ var inspect = async (driver, page, expected, options) => {
|
|
|
22232
22619
|
};
|
|
22233
22620
|
const deadline = Date.now() + (options.timeout ?? 5e3);
|
|
22234
22621
|
for (;;) {
|
|
22235
|
-
const
|
|
22236
|
-
|
|
22622
|
+
const findings = await driver.evaluate(probePage, input);
|
|
22623
|
+
const issues = issuesOf(expected, findings);
|
|
22624
|
+
if (issues.length === 0 || Date.now() >= deadline) return {
|
|
22237
22625
|
page,
|
|
22238
22626
|
checked: expected.length,
|
|
22239
|
-
problems
|
|
22627
|
+
problems: issues.map((issue) => issue.message),
|
|
22628
|
+
issues,
|
|
22629
|
+
hiddenAtWidth: findings.byWidth
|
|
22240
22630
|
};
|
|
22241
22631
|
await pause$1(100);
|
|
22242
22632
|
}
|
|
@@ -22696,4 +23086,4 @@ var validateSnippet = (snippet, options = {}) => validateSnippet$1(snippet, {
|
|
|
22696
23086
|
...options
|
|
22697
23087
|
});
|
|
22698
23088
|
//#endregion
|
|
22699
|
-
export { AUTHORING_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, a as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, ELEMENT_FIELDS, EXPLAIN_KINDS, FIXABLE_CODES, GLOBAL_SOURCES, i as NOTIFICATIONS_FIELDS, SCHEMA_SETTINGS, i$1 as SCROLL_CALLBACKS, SET_STATE_TYPES, SPACE_FIELDS, STYLE_STATES, SpaceRefusedError, actionSpecFromEntry, actionToSource, activeOn, activeWhen, addNotification, announceOn, apiContainer, appendState, applyBuiltinCallback, s as applyElementCallback, applyUtility, assertSnippetValid, assertSpaceValid, authLogin, authLogout, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSnippet, authorSpace, authoringCodeEntry, authoringCodesTable, bindTemplate, blankSpace, blankSpaceSource, space as blankSpaceSpec, blockHtml, blockJsx, buildHandles, button, cancelServerAction, carousel, carouselGoTo, carouselNext, carouselPause, carouselPlay, carouselPrevious, carouselTrack, catalogTemplateFiles, channel, className, classNames, classRefs, clearState, closeDialog, closeModal, column, comparePictures, compareSpaces, component, container, createTw, css, cssNumberValue, cssProperties, cssPropertyName, cssShorthands, custom, cycleState, darkScheme, declaredCallback, declaredTrigger, defaultAttributes, defaultLabel, defineAction, defineElement, delay, dialogContainer, diffPictures, digest, dropdown, dropdownPopup, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, t as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementPartTypes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed, emptySpaceSource, space$1 as emptySpaceSpec, expandShorthand, expandShorthandPatch, explain, explainKindOf, explainList, explanationText, failedFlowText, fixSpace, flagGateOf, flagSpecOf, flowStepIds, fontAwesome, form, formControl, o as getElementCallback, getGlobalCallback, getTransformer, getUtility, grid, groupBindings, hasVisibilityBinding, heading, t$1 as hiddenParams, hiddenWhen, hostAction, image, importProbe, importSlug, importedFiles, inferredLinkMode, inspectDocument, inspectPage, inspectRenders, o$1 as invalidParams, invalidateQueries, isClassModifier, isCssProperty, isCustomProperty, isRuleSetSpec, isStyleDeclaration, link, lintSpace, list, listItem, locate, markdown, n as missingRequiredParams, modalContainer, modifierClassName, moveState, named, navigate, nodeHtml, notificationsCss, on, onClick, onFlowEnd, onFlowError, onFlowProgress, onInterval, onKey, onLoad, onPageLoad, onPointerDown, onScreen, onScroll, onSubmit, openDialog, openModal, pageRegions, pagination, paragraph, pathForSlug, planFixes, pressShortcut, publishOn, readDevTools, readDevToolsInPage, s$1 as reconcileParams, reference, refusalOf, reloadApi, removeState, resetForm, resolveSource, richText, row, runServerAction, sameBlocks, scope, scrollBy, scrollIntoView, scrollTo, selectorFor, setFieldValue, setState, shortcutKey, shorthandLonghands, singlePageSpace, slugify, source, e as spaceCallbacks, specFromSpace, specToSource, splitClassList, h as splitNotificationsCss, stepState, styles, suggestCssProperty, suggestSpace, suggestTransformer, summariseRenders, svg, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, text, themeToggle, toBindingSpecs, toBlocks, i$2 as toBuilderParams, a$1 as toInteractionCallback, o$2 as toInteractionCallbacks, toPortableSource, toResponsive, toggleElement, toggleInState, toggleState, tokens, transformerCatalog, tw, twig, twigTemplate, typeCallbackDefinitions, typeTriggerDefinitions, updateElement, validateSnippet, validateSpace, e$1 as valuesOf, variantFrom, video, visibleWhen, webHook, when, whenFailed, whenSucceeded, whileRunning, withElement, withNamedIds, withNotificationsCss, withPluginCatalogs, withVisibility };
|
|
23089
|
+
export { AUTHORING_CODES, AuthoringError, BREAKPOINTS, BUILDER_NAMES, a as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, CATALOG_TEMPLATE_IDENTITY, COMPONENT_SOURCES, ELEMENT_FIELDS, EXPLAIN_KINDS, FIXABLE_CODES, GLOBAL_SOURCES, i as NOTIFICATIONS_FIELDS, SCHEMA_SETTINGS, i$1 as SCROLL_CALLBACKS, SET_STATE_TYPES, SPACE_FIELDS, STYLE_STATES, SpaceRefusedError, actionSpecFromEntry, actionToSource, activeOn, activeWhen, addNotification, announceOn, apiContainer, appendState, applyBuiltinCallback, s as applyElementCallback, applyUtility, assertSnippetValid, assertSpaceValid, authLogin, authLogout, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSnippet, authorSpace, authoringCodeEntry, authoringCodesTable, bindTemplate, blankSpace, blankSpaceSource, space as blankSpaceSpec, blockHtml, blockJsx, buildHandles, button, cancelServerAction, carousel, carouselGoTo, carouselNext, carouselPause, carouselPlay, carouselPrevious, carouselTrack, catalogTemplateFiles, channel, className, classNames, classRefs, clearState, closeDialog, closeModal, column, compactSvg, comparePictures, compareSpaces, component, container, createTw, css, cssNumberValue, cssProperties, cssPropertyName, cssShorthands, custom, cycleState, darkScheme, declaredCallback, declaredTrigger, defaultAttributes, defaultLabel, defineAction, defineElement, delay, dialogContainer, diffPictures, digest, dropdown, dropdownPopup, element, elementAncestorTypes, elementAttributeNames, elementAttributeValues, elementCallbacks, elementCatalog, t as elementDeclaration, elementDefaultAttributes, elementLeafTypes, elementPartTypes, elementSlots, elementSourceTypes, elementTriggers, elementTypeNames, elementsFromManifest, embed, emptySpaceSource, space$1 as emptySpaceSpec, expandShorthand, expandShorthandPatch, explain, explainKindOf, explainList, explanationText, failedFlowText, fixSpace, flagGateOf, flagSpecOf, flowStepIds, fontAwesome, form, formControl, o as getElementCallback, getGlobalCallback, getTransformer, getUtility, grid, groupBindings, hasVisibilityBinding, heading, t$1 as hiddenParams, hiddenWhen, hostAction, image, importProbe, importSlug, importedFiles, inferredLinkMode, inspectDocument, inspectPage, inspectRenders, instanceSelectorFor, o$1 as invalidParams, invalidateQueries, isClassModifier, isCssProperty, isCustomProperty, isRuleSetSpec, isStyleDeclaration, link, lintSpace, list, listItem, locate, markdown, n as missingRequiredParams, modalContainer, modifierClassName, moveState, named, navigate, nodeHtml, notificationsCss, on, onClick, onFlowEnd, onFlowError, onFlowProgress, onInterval, onKey, onLoad, onPageLoad, onPointerDown, onScreen, onScroll, onSubmit, openDialog, openModal, pageRegions, pagination, paragraph, pathForSlug, planFixes, pressShortcut, publishOn, readDevTools, readDevToolsInPage, s$1 as reconcileParams, reference, refusalOf, reloadApi, removeState, resetForm, resolveSource, richText, row, runServerAction, sameBlocks, scope, scrollBy, scrollIntoView, scrollTo, selectorFor, setFieldValue, setState, shortcutKey, shorthandLonghands, singlePageSpace, slugify, source, e as spaceCallbacks, specFromSpace, specToSource, splitClassList, h as splitNotificationsCss, stepState, styles, suggestCssProperty, suggestSpace, suggestTransformer, summariseRenders, svg, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, text, themeToggle, toBindingSpecs, toBlocks, i$2 as toBuilderParams, a$1 as toInteractionCallback, o$2 as toInteractionCallbacks, toPortableSource, toResponsive, toggleElement, toggleInState, toggleState, tokens, transformerCatalog, tw, twig, twigTemplate, typeCallbackDefinitions, typeTriggerDefinitions, updateElement, validateSnippet, validateSpace, e$1 as valuesOf, variantFrom, video, visibleWhen, webHook, when, whenFailed, whenSucceeded, whileRunning, withElement, withNamedIds, withNotificationsCss, withPluginCatalogs, withVisibility };
|