@plitzi/sdk-authoring 0.38.7 → 0.38.8
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 +184 -0
- package/dist/index-src.js +507 -271
- package/dist/index.d.ts +96 -9
- package/dist/index.js +2 -2
- package/dist/node.d.ts +24 -1
- package/dist/node.js +42 -11
- package/package.json +6 -6
- package/skills/plitzi-authoring/SKILL.md +34 -149
- package/skills/plitzi-authoring/recipes/plugin.ts +1 -1
- package/skills/plitzi-authoring/reference/accessibility.md +1 -2
- package/skills/plitzi-authoring/reference/authoring-errors.md +1 -0
- package/skills/plitzi-authoring/reference/drawing.md +1 -1
- package/skills/plitzi-authoring/reference/flows.md +4 -2
- package/skills/plitzi-authoring/reference/index.md +33 -0
- package/skills/plitzi-authoring/reference/plugins.md +2 -2
- package/skills/plitzi-authoring/reference/recipes.md +25 -0
- package/skills/plitzi-authoring/reference/rules.md +61 -0
- package/skills/plitzi-authoring/reference/snippets-and-export.md +2 -2
- package/skills/plitzi-authoring/reference/structure.md +1 -1
- package/skills/plitzi-authoring/reference/testing.md +1 -1
- package/skills/plitzi-authoring/reference/validation.md +1 -1
package/dist/index-src.js
CHANGED
|
@@ -11,10 +11,10 @@ var __exportAll = (all, no_symbols) => {
|
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs
|
|
14
|
-
var e$
|
|
15
|
-
var t$63 = `(?:${e$
|
|
16
|
-
var n$47 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$
|
|
17
|
-
var r$37 = `${`${e$
|
|
14
|
+
var e$42 = "[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*";
|
|
15
|
+
var t$63 = `(?:${e$42}|\\d+)`;
|
|
16
|
+
var n$47 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$42}(?:\\.${t$63})*)\\s*\\]`;
|
|
17
|
+
var r$37 = `${`${e$42}(?:${n$47})*(?:\\??\\.${t$63}(?:${n$47})*)*`}(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`;
|
|
18
18
|
var i$28 = `\\{\\{\\s*${r$37}\\s*\\}\\}`;
|
|
19
19
|
var a$24 = `(?:${`\\{\\{\\{\\s*${r$37}\\s*\\}\\}\\}`}|${i$28})`;
|
|
20
20
|
var o$26 = new RegExp(a$24, "g");
|
|
@@ -28,22 +28,32 @@ var n$46 = (n, r = !1) => {
|
|
|
28
28
|
};
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region ../sdk-shared/dist/authoring/paramSpec.mjs
|
|
31
|
-
var t$62 =
|
|
31
|
+
var t$62 = [
|
|
32
|
+
"text",
|
|
33
|
+
"textarea",
|
|
34
|
+
"select",
|
|
35
|
+
"boolean",
|
|
36
|
+
"number",
|
|
37
|
+
"scalar",
|
|
38
|
+
"json",
|
|
39
|
+
"elementIds"
|
|
40
|
+
];
|
|
41
|
+
var n$45 = (e, t, n) => {
|
|
32
42
|
let r = [];
|
|
33
43
|
for (let [i, a] of Object.entries(n)) a.when && e[i] !== void 0 && !a.when(t) && r.push(i);
|
|
34
44
|
return r;
|
|
35
45
|
};
|
|
36
|
-
var
|
|
46
|
+
var r$36 = (e, t, n) => {
|
|
37
47
|
let r = [];
|
|
38
48
|
for (let [i, a] of Object.entries(n)) a.required && e[i] === void 0 && (!a.when || a.when(t)) && r.push(i);
|
|
39
49
|
return r;
|
|
40
50
|
};
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
51
|
+
var i$27 = (e) => e.trim() !== "" && Number.isFinite(Number(e));
|
|
52
|
+
var a$23 = (t) => typeof t == "string" && n$46(t);
|
|
53
|
+
var o$25 = (e, t) => {
|
|
44
54
|
switch (t.type) {
|
|
45
55
|
case "boolean": return typeof e == "boolean";
|
|
46
|
-
case "number": return typeof e == "number" || typeof e == "string" &&
|
|
56
|
+
case "number": return typeof e == "number" || typeof e == "string" && i$27(e);
|
|
47
57
|
case "select": return typeof e == "string" && (!t.options || t.options.includes(e));
|
|
48
58
|
case "scalar": return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
49
59
|
case "json": return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "object" && !!e;
|
|
@@ -53,12 +63,12 @@ var a$23 = (e, t) => {
|
|
|
53
63
|
default: return !0;
|
|
54
64
|
}
|
|
55
65
|
};
|
|
56
|
-
var
|
|
66
|
+
var s$22 = (e, t, n) => {
|
|
57
67
|
let r = [];
|
|
58
|
-
for (let [
|
|
59
|
-
let n = e[
|
|
60
|
-
n === void 0 ||
|
|
61
|
-
key:
|
|
68
|
+
for (let [i, s] of Object.entries(n)) {
|
|
69
|
+
let n = e[i];
|
|
70
|
+
n === void 0 || a$23(n) || s.when && !s.when(t) || o$25(n, s) || r.push({
|
|
71
|
+
key: i,
|
|
62
72
|
expected: s.type,
|
|
63
73
|
got: n === null ? "null" : typeof n,
|
|
64
74
|
...s.options ? { options: s.options } : {}
|
|
@@ -66,7 +76,7 @@ var o$25 = (e, t, n) => {
|
|
|
66
76
|
}
|
|
67
77
|
return r;
|
|
68
78
|
};
|
|
69
|
-
var
|
|
79
|
+
var c$19 = (e, t, n) => {
|
|
70
80
|
let r = {};
|
|
71
81
|
for (let [i, a] of Object.entries(e)) (!n || i in t) && (r[i] = a);
|
|
72
82
|
for (let [e, n] of Object.entries(t)) n.default === void 0 || r[e] !== void 0 || n.when && !n.when(r) || (r[e] = n.default);
|
|
@@ -74,7 +84,7 @@ var s$22 = (e, t, n) => {
|
|
|
74
84
|
};
|
|
75
85
|
//#endregion
|
|
76
86
|
//#region ../sdk-shared/dist/helpers/scroll.mjs
|
|
77
|
-
var e$
|
|
87
|
+
var e$41 = ["smooth", "auto"];
|
|
78
88
|
var t$61 = [
|
|
79
89
|
"start",
|
|
80
90
|
"center",
|
|
@@ -88,7 +98,7 @@ var r$35 = {
|
|
|
88
98
|
type: "select",
|
|
89
99
|
description: "How it moves: \"smooth\" glides there, \"auto\" jumps.",
|
|
90
100
|
default: "smooth",
|
|
91
|
-
options: [...e$
|
|
101
|
+
options: [...e$41]
|
|
92
102
|
};
|
|
93
103
|
var i$26 = {
|
|
94
104
|
scrollBy: {
|
|
@@ -212,7 +222,7 @@ var s$20 = (t, n) => {
|
|
|
212
222
|
let r = o$24(t);
|
|
213
223
|
return r ? {
|
|
214
224
|
known: !0,
|
|
215
|
-
params:
|
|
225
|
+
params: c$19(n, r.params, r.strictParams)
|
|
216
226
|
} : {
|
|
217
227
|
known: !1,
|
|
218
228
|
params: n
|
|
@@ -731,7 +741,7 @@ var elementAttributeNames = {
|
|
|
731
741
|
};
|
|
732
742
|
//#endregion
|
|
733
743
|
//#region ../sdk-elements/dist/Element/helpers/elementConstants.mjs
|
|
734
|
-
var e$
|
|
744
|
+
var e$40 = {
|
|
735
745
|
onLoad: {
|
|
736
746
|
action: "onLoad",
|
|
737
747
|
title: "On Load",
|
|
@@ -903,7 +913,7 @@ var e$39 = {
|
|
|
903
913
|
};
|
|
904
914
|
//#endregion
|
|
905
915
|
//#region ../sdk-shared/dist/authoring/declare.mjs
|
|
906
|
-
var e$
|
|
916
|
+
var e$39 = () => (e) => e;
|
|
907
917
|
var t$60 = () => (e) => e;
|
|
908
918
|
//#endregion
|
|
909
919
|
//#region ../sdk-elements/dist/elements/advanced/BlockHtml/declaration.mjs
|
|
@@ -1148,13 +1158,13 @@ var n$44 = {
|
|
|
1148
1158
|
var r$34 = t$60()({
|
|
1149
1159
|
type: "button",
|
|
1150
1160
|
attributeValues: {
|
|
1151
|
-
subType: e$
|
|
1161
|
+
subType: e$39()([
|
|
1152
1162
|
"button",
|
|
1153
1163
|
"submit",
|
|
1154
1164
|
"reset"
|
|
1155
1165
|
]),
|
|
1156
|
-
contentPlacement: e$
|
|
1157
|
-
iconPlacement: e$
|
|
1166
|
+
contentPlacement: e$39()(["before", "after"]),
|
|
1167
|
+
iconPlacement: e$39()(["before", "after"])
|
|
1158
1168
|
},
|
|
1159
1169
|
content: {
|
|
1160
1170
|
attributes: {
|
|
@@ -1224,7 +1234,7 @@ var r$34 = t$60()({
|
|
|
1224
1234
|
//#region ../sdk-elements/dist/elements/basic/Dropdown/declaration.mjs
|
|
1225
1235
|
var n$43 = t$60()({
|
|
1226
1236
|
type: "dropdown",
|
|
1227
|
-
attributeValues: { popupPlacement: e$
|
|
1237
|
+
attributeValues: { popupPlacement: e$39()([
|
|
1228
1238
|
"left",
|
|
1229
1239
|
"right",
|
|
1230
1240
|
"top",
|
|
@@ -1359,7 +1369,7 @@ var t$54 = t$60()({
|
|
|
1359
1369
|
//#region ../sdk-elements/dist/elements/basic/Heading/declaration.mjs
|
|
1360
1370
|
var n$42 = t$60()({
|
|
1361
1371
|
type: "heading",
|
|
1362
|
-
attributeValues: { subType: e$
|
|
1372
|
+
attributeValues: { subType: e$39()([
|
|
1363
1373
|
"h1",
|
|
1364
1374
|
"h2",
|
|
1365
1375
|
"h3",
|
|
@@ -1483,20 +1493,20 @@ var n$42 = t$60()({
|
|
|
1483
1493
|
var n$41 = t$60()({
|
|
1484
1494
|
type: "link",
|
|
1485
1495
|
attributeValues: {
|
|
1486
|
-
mode: e$
|
|
1496
|
+
mode: e$39()([
|
|
1487
1497
|
"page",
|
|
1488
1498
|
"internal",
|
|
1489
1499
|
"external"
|
|
1490
1500
|
]),
|
|
1491
|
-
target: e$
|
|
1501
|
+
target: e$39()([
|
|
1492
1502
|
"self",
|
|
1493
1503
|
"blank",
|
|
1494
1504
|
"parent",
|
|
1495
1505
|
"top"
|
|
1496
1506
|
]),
|
|
1497
|
-
contentPlacement: e$
|
|
1498
|
-
iconPlacement: e$
|
|
1499
|
-
current: e$
|
|
1507
|
+
contentPlacement: e$39()(["before", "after"]),
|
|
1508
|
+
iconPlacement: e$39()(["before", "after"]),
|
|
1509
|
+
current: e$39()(["page", "section"])
|
|
1500
1510
|
},
|
|
1501
1511
|
content: {
|
|
1502
1512
|
attributes: {
|
|
@@ -1674,7 +1684,7 @@ var t$52 = t$60()({
|
|
|
1674
1684
|
//#region ../sdk-elements/dist/elements/basic/RichText/declaration.mjs
|
|
1675
1685
|
var n$40 = t$60()({
|
|
1676
1686
|
type: "richText",
|
|
1677
|
-
attributeValues: { format: e$
|
|
1687
|
+
attributeValues: { format: e$39()([
|
|
1678
1688
|
"html",
|
|
1679
1689
|
"markdown",
|
|
1680
1690
|
"text"
|
|
@@ -1815,7 +1825,7 @@ var n$39 = {
|
|
|
1815
1825
|
};
|
|
1816
1826
|
var r$33 = t$60()({
|
|
1817
1827
|
type: "themeToggle",
|
|
1818
|
-
attributeValues: { subType: e$
|
|
1828
|
+
attributeValues: { subType: e$39()(["switch", "segmented"]) },
|
|
1819
1829
|
triggers: { onThemeChange: {
|
|
1820
1830
|
action: "onThemeChange",
|
|
1821
1831
|
title: "On Theme Change",
|
|
@@ -1883,7 +1893,7 @@ var r$33 = t$60()({
|
|
|
1883
1893
|
//#region ../sdk-elements/dist/elements/form/Form/declaration.mjs
|
|
1884
1894
|
var n$38 = t$60()({
|
|
1885
1895
|
type: "form",
|
|
1886
|
-
attributeValues: { method: e$
|
|
1896
|
+
attributeValues: { method: e$39()(["get", "post"]) },
|
|
1887
1897
|
sourceType: "apiContainer",
|
|
1888
1898
|
triggers: { onSubmit: {
|
|
1889
1899
|
action: "onSubmit",
|
|
@@ -2147,7 +2157,7 @@ var m$6 = (e, t, { field: n, icon: r } = {}) => ({
|
|
|
2147
2157
|
var h$4 = { field: l$13 };
|
|
2148
2158
|
var g$4 = t$60()({
|
|
2149
2159
|
type: "formControl",
|
|
2150
|
-
attributeValues: { subType: e$
|
|
2160
|
+
attributeValues: { subType: e$39()([
|
|
2151
2161
|
"text",
|
|
2152
2162
|
"number",
|
|
2153
2163
|
"email",
|
|
@@ -2297,7 +2307,7 @@ var g$4 = t$60()({
|
|
|
2297
2307
|
//#region ../sdk-elements/dist/elements/internal/LayoutContainer/declaration.mjs
|
|
2298
2308
|
var n$36 = t$60()({
|
|
2299
2309
|
type: "layoutContainer",
|
|
2300
|
-
attributeValues: { subType: e$
|
|
2310
|
+
attributeValues: { subType: e$39()([
|
|
2301
2311
|
"div",
|
|
2302
2312
|
"header",
|
|
2303
2313
|
"footer",
|
|
@@ -2608,12 +2618,12 @@ var t$46 = t$60()({
|
|
|
2608
2618
|
var n$35 = t$60()({
|
|
2609
2619
|
type: "image",
|
|
2610
2620
|
attributeValues: {
|
|
2611
|
-
fetchPriority: e$
|
|
2621
|
+
fetchPriority: e$39()([
|
|
2612
2622
|
"high",
|
|
2613
2623
|
"low",
|
|
2614
2624
|
"auto"
|
|
2615
2625
|
]),
|
|
2616
|
-
loadMode: e$
|
|
2626
|
+
loadMode: e$39()([
|
|
2617
2627
|
"auto",
|
|
2618
2628
|
"eager",
|
|
2619
2629
|
"lazy"
|
|
@@ -2768,7 +2778,7 @@ var t$44 = t$60()({
|
|
|
2768
2778
|
var n$34 = t$60()({
|
|
2769
2779
|
type: "apiContainer",
|
|
2770
2780
|
attributeValues: {
|
|
2771
|
-
subType: e$
|
|
2781
|
+
subType: e$39()([
|
|
2772
2782
|
"",
|
|
2773
2783
|
"div",
|
|
2774
2784
|
"header",
|
|
@@ -2781,19 +2791,19 @@ var n$34 = t$60()({
|
|
|
2781
2791
|
"address",
|
|
2782
2792
|
"figure"
|
|
2783
2793
|
]),
|
|
2784
|
-
method: e$
|
|
2794
|
+
method: e$39()([
|
|
2785
2795
|
"get",
|
|
2786
2796
|
"post",
|
|
2787
2797
|
"put",
|
|
2788
2798
|
"delete",
|
|
2789
2799
|
"patch"
|
|
2790
2800
|
]),
|
|
2791
|
-
credentials: e$
|
|
2801
|
+
credentials: e$39()([
|
|
2792
2802
|
"include",
|
|
2793
2803
|
"omit",
|
|
2794
2804
|
"same-origin"
|
|
2795
2805
|
]),
|
|
2796
|
-
pagination: e$
|
|
2806
|
+
pagination: e$39()([
|
|
2797
2807
|
"none",
|
|
2798
2808
|
"url",
|
|
2799
2809
|
"append"
|
|
@@ -2943,7 +2953,7 @@ var n$34 = t$60()({
|
|
|
2943
2953
|
//#region ../sdk-elements/dist/elements/provider/Channel/declaration.mjs
|
|
2944
2954
|
var n$33 = t$60()({
|
|
2945
2955
|
type: "channel",
|
|
2946
|
-
attributeValues: { subType: e$
|
|
2956
|
+
attributeValues: { subType: e$39()([
|
|
2947
2957
|
"",
|
|
2948
2958
|
"div",
|
|
2949
2959
|
"section",
|
|
@@ -3227,7 +3237,7 @@ var n$32 = [
|
|
|
3227
3237
|
var r$31 = t$60()({
|
|
3228
3238
|
type: "container",
|
|
3229
3239
|
attributeValues: {
|
|
3230
|
-
subType: e$
|
|
3240
|
+
subType: e$39()([
|
|
3231
3241
|
"div",
|
|
3232
3242
|
"header",
|
|
3233
3243
|
"footer",
|
|
@@ -3251,7 +3261,7 @@ var r$31 = t$60()({
|
|
|
3251
3261
|
"p",
|
|
3252
3262
|
"span"
|
|
3253
3263
|
]),
|
|
3254
|
-
live: e$
|
|
3264
|
+
live: e$39()([
|
|
3255
3265
|
"",
|
|
3256
3266
|
"polite",
|
|
3257
3267
|
"assertive"
|
|
@@ -3552,8 +3562,8 @@ var B = {
|
|
|
3552
3562
|
List: t$60()({
|
|
3553
3563
|
type: "list",
|
|
3554
3564
|
attributeValues: {
|
|
3555
|
-
subType: e$
|
|
3556
|
-
source: e$
|
|
3565
|
+
subType: e$39()(["ul", "ol"]),
|
|
3566
|
+
source: e$39()(["none", "controlled"])
|
|
3557
3567
|
},
|
|
3558
3568
|
sourceType: "list",
|
|
3559
3569
|
content: {
|
|
@@ -3853,8 +3863,8 @@ var B = {
|
|
|
3853
3863
|
Pagination: t$60()({
|
|
3854
3864
|
type: "pagination",
|
|
3855
3865
|
attributeValues: {
|
|
3856
|
-
mode: e$
|
|
3857
|
-
target: e$
|
|
3866
|
+
mode: e$39()(["pages", "loadMore"]),
|
|
3867
|
+
target: e$39()(["url", "interaction"])
|
|
3858
3868
|
},
|
|
3859
3869
|
triggers: { onPageChange: {
|
|
3860
3870
|
action: "onPageChange",
|
|
@@ -4137,7 +4147,7 @@ var elementSourceTypes = Object.fromEntries(Object.values(declarations).filter((
|
|
|
4137
4147
|
* element that fires it ever starts the flow — an `onSubmit` on a form's submit button is saved, looks right beside
|
|
4138
4148
|
* the form, and never runs, which is how a working form reads as "forms do not work outside the builder".
|
|
4139
4149
|
*/
|
|
4140
|
-
var elementTriggers = Object.fromEntries(Object.values(declarations).map((declaration) => [declaration.type, [...Object.keys(e$
|
|
4150
|
+
var elementTriggers = Object.fromEntries(Object.values(declarations).map((declaration) => [declaration.type, [...Object.keys(e$40), ...Object.keys(declaration.triggers ?? {})]]));
|
|
4141
4151
|
/** The triggers only some types fire, by action name — for a step builder that wants the title the builder shows. */
|
|
4142
4152
|
var typeTriggerDefinitions = Object.fromEntries(Object.values(declarations).flatMap((declaration) => Object.entries(declaration.triggers ?? {})));
|
|
4143
4153
|
/** The callbacks only some types answer to, by action name — with their params, for whatever explains or checks one. */
|
|
@@ -4848,6 +4858,11 @@ var AUTHORING_CODES = {
|
|
|
4848
4858
|
means: "a prop whose name a template cannot read as `props.x`",
|
|
4849
4859
|
fix: "letters, digits and `_`"
|
|
4850
4860
|
},
|
|
4861
|
+
"prop-type-unknown": {
|
|
4862
|
+
kind: "refused",
|
|
4863
|
+
means: "a prop declared with a type no editor offers and nothing checks a value against",
|
|
4864
|
+
fix: "one of text, textarea, select, boolean, number, scalar, json, elementIds — words are `text`"
|
|
4865
|
+
},
|
|
4851
4866
|
"prop-unknown": {
|
|
4852
4867
|
kind: "refused",
|
|
4853
4868
|
means: "a prop the component does not declare, handed in or read",
|
|
@@ -5352,7 +5367,7 @@ var twig = (parts, ...values) => parts.reduce((text, part, index) => {
|
|
|
5352
5367
|
}, "");
|
|
5353
5368
|
//#endregion
|
|
5354
5369
|
//#region ../sdk-shared/dist/dataSource/globalSources.mjs
|
|
5355
|
-
var e$
|
|
5370
|
+
var e$38 = [
|
|
5356
5371
|
"variables",
|
|
5357
5372
|
"navigation",
|
|
5358
5373
|
"auth",
|
|
@@ -5362,7 +5377,7 @@ var e$37 = [
|
|
|
5362
5377
|
"flags",
|
|
5363
5378
|
"computed"
|
|
5364
5379
|
];
|
|
5365
|
-
e$
|
|
5380
|
+
e$38.filter((e) => e !== "state" && e !== "computed");
|
|
5366
5381
|
var n$28 = {
|
|
5367
5382
|
navigation: {
|
|
5368
5383
|
routeParams: "open",
|
|
@@ -5386,7 +5401,7 @@ var n$28 = {
|
|
|
5386
5401
|
};
|
|
5387
5402
|
//#endregion
|
|
5388
5403
|
//#region ../sdk-shared/dist/helpers/twigWrapper/charClass.mjs
|
|
5389
|
-
var e$
|
|
5404
|
+
var e$37 = {
|
|
5390
5405
|
Tab: 9,
|
|
5391
5406
|
Newline: 10,
|
|
5392
5407
|
CarriageReturn: 13,
|
|
@@ -5422,11 +5437,11 @@ var e$36 = {
|
|
|
5422
5437
|
LowerR: 114,
|
|
5423
5438
|
LowerT: 116
|
|
5424
5439
|
};
|
|
5425
|
-
var t$33 = (t) => t >= 97 && t <= 122 || t >= 65 && t <= 90 || t === e$
|
|
5426
|
-
var n$27 = (n) => t$33(n) || n >= e$
|
|
5427
|
-
var r$29 = (t) => n$27(t) || t === e$
|
|
5428
|
-
var i$24 = (t) => t >= e$
|
|
5429
|
-
var a$20 = (t) => t === e$
|
|
5440
|
+
var t$33 = (t) => t >= 97 && t <= 122 || t >= 65 && t <= 90 || t === e$37.Underscore;
|
|
5441
|
+
var n$27 = (n) => t$33(n) || n >= e$37.Zero && n <= e$37.Nine;
|
|
5442
|
+
var r$29 = (t) => n$27(t) || t === e$37.Minus;
|
|
5443
|
+
var i$24 = (t) => t >= e$37.Zero && t <= e$37.Nine;
|
|
5444
|
+
var a$20 = (t) => t === e$37.Space || t === e$37.Tab || t === e$37.Newline || t === e$37.CarriageReturn;
|
|
5430
5445
|
var o$22 = (e) => {
|
|
5431
5446
|
let r = e.length;
|
|
5432
5447
|
if (r === 0 || !t$33(e.charCodeAt(0))) return !1;
|
|
@@ -5439,7 +5454,7 @@ var s$18 = (r) => {
|
|
|
5439
5454
|
let o = !1, s = !1;
|
|
5440
5455
|
for (let c = 1; c < a; c++) {
|
|
5441
5456
|
let a = r.charCodeAt(c);
|
|
5442
|
-
if (a === e$
|
|
5457
|
+
if (a === e$37.Dot) {
|
|
5443
5458
|
if (o) return !1;
|
|
5444
5459
|
o = !0, s = !1;
|
|
5445
5460
|
continue;
|
|
@@ -5456,7 +5471,7 @@ var s$18 = (r) => {
|
|
|
5456
5471
|
var c$17 = (e) => o$22(e);
|
|
5457
5472
|
//#endregion
|
|
5458
5473
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Lexer/Lexer.mjs
|
|
5459
|
-
var e$
|
|
5474
|
+
var e$36 = (e) => {
|
|
5460
5475
|
let t = [], n = 0;
|
|
5461
5476
|
for (; n < e.length;) {
|
|
5462
5477
|
let r = e.indexOf("{{", n), i = e.indexOf("{%", n), a, o;
|
|
@@ -5508,11 +5523,11 @@ var e$35 = (e) => {
|
|
|
5508
5523
|
};
|
|
5509
5524
|
//#endregion
|
|
5510
5525
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Lexer/types.mjs
|
|
5511
|
-
var e$
|
|
5526
|
+
var e$35 = (e, t) => t ? `{{{${e}}}}` : `{{${e}}}`;
|
|
5512
5527
|
var t$32 = (t) => {
|
|
5513
5528
|
switch (t.type) {
|
|
5514
5529
|
case "text": return t.value;
|
|
5515
|
-
case "variable": return e$
|
|
5530
|
+
case "variable": return e$35(t.content, t.raw);
|
|
5516
5531
|
case "tag": return `{%${t.content}%}`;
|
|
5517
5532
|
}
|
|
5518
5533
|
};
|
|
@@ -5551,17 +5566,17 @@ var o$21 = class {
|
|
|
5551
5566
|
let t = this.src.charCodeAt(this.pos);
|
|
5552
5567
|
this.pos++;
|
|
5553
5568
|
let n = "";
|
|
5554
|
-
for (; this.pos < this.src.length && this.src.charCodeAt(this.pos) !== t;) if (this.src.charCodeAt(this.pos) === e$
|
|
5569
|
+
for (; this.pos < this.src.length && this.src.charCodeAt(this.pos) !== t;) if (this.src.charCodeAt(this.pos) === e$37.Backslash && this.pos + 1 < this.src.length) {
|
|
5555
5570
|
this.pos++;
|
|
5556
5571
|
let r = this.src.charCodeAt(this.pos);
|
|
5557
|
-
r === e$
|
|
5572
|
+
r === e$37.LowerN ? n += "\n" : r === e$37.LowerT ? n += " " : r === e$37.LowerR ? n += "\r" : r === e$37.Backslash ? n += "\\" : n += r === t ? String.fromCharCode(r) : String.fromCharCode(e$37.Backslash) + String.fromCharCode(r), this.pos++;
|
|
5558
5573
|
} else n += this.src[this.pos], this.pos++;
|
|
5559
5574
|
return this.pos < this.src.length && this.pos++, n;
|
|
5560
5575
|
}
|
|
5561
5576
|
scanNumber() {
|
|
5562
5577
|
let n = this.pos;
|
|
5563
|
-
for (this.src.charCodeAt(this.pos) === e$
|
|
5564
|
-
if (this.src.charCodeAt(this.pos) === e$
|
|
5578
|
+
for (this.src.charCodeAt(this.pos) === e$37.Minus && this.pos++; this.pos < this.src.length && i$24(this.src.charCodeAt(this.pos));) this.pos++;
|
|
5579
|
+
if (this.src.charCodeAt(this.pos) === e$37.Dot) for (this.pos++; this.pos < this.src.length && i$24(this.src.charCodeAt(this.pos));) this.pos++;
|
|
5565
5580
|
return Number(this.src.slice(n, this.pos));
|
|
5566
5581
|
}
|
|
5567
5582
|
matchKeyword(e) {
|
|
@@ -5573,13 +5588,13 @@ var o$21 = class {
|
|
|
5573
5588
|
matchBinaryOp() {
|
|
5574
5589
|
this.skipWs();
|
|
5575
5590
|
let t = this.peek();
|
|
5576
|
-
if (this.at(1) === e$
|
|
5577
|
-
if (t === e$
|
|
5578
|
-
if (t === e$
|
|
5579
|
-
if (t === e$
|
|
5580
|
-
if (t === e$
|
|
5591
|
+
if (this.at(1) === e$37.Equals) {
|
|
5592
|
+
if (t === e$37.Equals) return this.pos += 2, "==";
|
|
5593
|
+
if (t === e$37.Bang) return this.pos += 2, "!=";
|
|
5594
|
+
if (t === e$37.Greater) return this.pos += 2, ">=";
|
|
5595
|
+
if (t === e$37.Less) return this.pos += 2, "<=";
|
|
5581
5596
|
}
|
|
5582
|
-
return t === e$
|
|
5597
|
+
return t === e$37.Greater ? (this.pos++, ">") : t === e$37.Less ? (this.pos++, "<") : null;
|
|
5583
5598
|
}
|
|
5584
5599
|
};
|
|
5585
5600
|
//#endregion
|
|
@@ -5614,15 +5629,15 @@ var s$17 = class extends o$21 {
|
|
|
5614
5629
|
}
|
|
5615
5630
|
parseTernary() {
|
|
5616
5631
|
let t = this.parseOr();
|
|
5617
|
-
if (this.skipWs(), this.peek() !== e$
|
|
5618
|
-
if (this.pos++, this.skipWs(), this.peek() === e$
|
|
5632
|
+
if (this.skipWs(), this.peek() !== e$37.Question) return t;
|
|
5633
|
+
if (this.pos++, this.skipWs(), this.peek() === e$37.Colon) return this.pos++, this.skipWs(), {
|
|
5619
5634
|
type: "ternary",
|
|
5620
5635
|
condition: t,
|
|
5621
5636
|
trueExpr: null,
|
|
5622
5637
|
falseExpr: this.parseTernary()
|
|
5623
5638
|
};
|
|
5624
5639
|
let n = this.parseOr();
|
|
5625
|
-
return this.skipWs(), this.peek() === e$
|
|
5640
|
+
return this.skipWs(), this.peek() === e$37.Colon ? (this.pos++, this.skipWs(), {
|
|
5626
5641
|
type: "ternary",
|
|
5627
5642
|
condition: t,
|
|
5628
5643
|
trueExpr: n,
|
|
@@ -5774,7 +5789,7 @@ var s$17 = class extends o$21 {
|
|
|
5774
5789
|
}
|
|
5775
5790
|
parseConcat() {
|
|
5776
5791
|
let t = this.parseAdditive();
|
|
5777
|
-
for (this.skipWs(); this.peek() === e$
|
|
5792
|
+
for (this.skipWs(); this.peek() === e$37.Tilde;) {
|
|
5778
5793
|
this.pos++;
|
|
5779
5794
|
let e = this.parseAdditive();
|
|
5780
5795
|
t = t.type === "concat" ? {
|
|
@@ -5790,9 +5805,9 @@ var s$17 = class extends o$21 {
|
|
|
5790
5805
|
parseAdditive() {
|
|
5791
5806
|
let t = this.parseMultiplicative();
|
|
5792
5807
|
this.skipWs();
|
|
5793
|
-
for (let n = this.peek(); n === e$
|
|
5808
|
+
for (let n = this.peek(); n === e$37.Plus || n === e$37.Minus; n = this.peek()) this.pos++, t = {
|
|
5794
5809
|
type: "binary",
|
|
5795
|
-
operator: n === e$
|
|
5810
|
+
operator: n === e$37.Plus ? "+" : "-",
|
|
5796
5811
|
left: t,
|
|
5797
5812
|
right: this.parseMultiplicative()
|
|
5798
5813
|
}, this.skipWs();
|
|
@@ -5801,11 +5816,11 @@ var s$17 = class extends o$21 {
|
|
|
5801
5816
|
parseMultiplicative() {
|
|
5802
5817
|
let t = this.parsePower();
|
|
5803
5818
|
this.skipWs();
|
|
5804
|
-
for (let n = this.peek(); (n === e$
|
|
5805
|
-
let r = n === e$
|
|
5819
|
+
for (let n = this.peek(); (n === e$37.Star || n === e$37.Slash || n === e$37.Percent) && (n !== e$37.Star || this.at(1) !== e$37.Star); n = this.peek()) {
|
|
5820
|
+
let r = n === e$37.Slash && this.at(1) === e$37.Slash;
|
|
5806
5821
|
this.pos += r ? 2 : 1, t = {
|
|
5807
5822
|
type: "binary",
|
|
5808
|
-
operator: r ? "//" : n === e$
|
|
5823
|
+
operator: r ? "//" : n === e$37.Star ? "*" : n === e$37.Slash ? "/" : "%",
|
|
5809
5824
|
left: t,
|
|
5810
5825
|
right: this.parsePower()
|
|
5811
5826
|
}, this.skipWs();
|
|
@@ -5814,7 +5829,7 @@ var s$17 = class extends o$21 {
|
|
|
5814
5829
|
}
|
|
5815
5830
|
parsePower() {
|
|
5816
5831
|
let t = this.parseDefault();
|
|
5817
|
-
return this.skipWs(), this.peek() !== e$
|
|
5832
|
+
return this.skipWs(), this.peek() !== e$37.Star || this.at(1) !== e$37.Star ? t : (this.pos += 2, {
|
|
5818
5833
|
type: "binary",
|
|
5819
5834
|
operator: "**",
|
|
5820
5835
|
left: t,
|
|
@@ -5822,27 +5837,27 @@ var s$17 = class extends o$21 {
|
|
|
5822
5837
|
});
|
|
5823
5838
|
}
|
|
5824
5839
|
parseSignedAtom() {
|
|
5825
|
-
return this.peek() === e$
|
|
5840
|
+
return this.peek() === e$37.Minus && i$24(this.at(1)) ? this.maybeTrailingFilters({
|
|
5826
5841
|
type: "literal",
|
|
5827
5842
|
value: this.scanNumber()
|
|
5828
|
-
}) : this.peek() === e$
|
|
5843
|
+
}) : this.peek() === e$37.Minus ? (this.pos++, this.skipWs(), {
|
|
5829
5844
|
type: "unary",
|
|
5830
5845
|
operator: "-",
|
|
5831
5846
|
operand: this.parseSignedAtom()
|
|
5832
5847
|
}) : this.parseAtom();
|
|
5833
5848
|
}
|
|
5834
5849
|
parseDefault() {
|
|
5835
|
-
if (this.skipWs(), this.peek() === e$
|
|
5850
|
+
if (this.skipWs(), this.peek() === e$37.Minus && i$24(this.at(1))) return this.maybeTrailingFilters({
|
|
5836
5851
|
type: "literal",
|
|
5837
5852
|
value: this.scanNumber()
|
|
5838
5853
|
});
|
|
5839
|
-
if (this.peek() === e$
|
|
5854
|
+
if (this.peek() === e$37.Minus) return this.pos++, {
|
|
5840
5855
|
type: "unary",
|
|
5841
5856
|
operator: "-",
|
|
5842
5857
|
operand: this.parseDefault()
|
|
5843
5858
|
};
|
|
5844
5859
|
let n = this.parseAtom();
|
|
5845
|
-
for (this.skipWs(); this.peek() === e$
|
|
5860
|
+
for (this.skipWs(); this.peek() === e$37.Question && this.at(1) === e$37.Question;) this.pos += 2, this.skipWs(), n = {
|
|
5846
5861
|
type: "default",
|
|
5847
5862
|
value: n,
|
|
5848
5863
|
defaultExpr: this.parseSignedAtom()
|
|
@@ -5852,7 +5867,7 @@ var s$17 = class extends o$21 {
|
|
|
5852
5867
|
parseAtom() {
|
|
5853
5868
|
this.skipWs();
|
|
5854
5869
|
let n = this.peek();
|
|
5855
|
-
if (n === e$
|
|
5870
|
+
if (n === e$37.LParen) {
|
|
5856
5871
|
this.pos++, this.skipWs();
|
|
5857
5872
|
let t = this.pos, n = this.tryParseArrowParams();
|
|
5858
5873
|
if (n !== null) return this.maybeTrailingFilters({
|
|
@@ -5862,9 +5877,9 @@ var s$17 = class extends o$21 {
|
|
|
5862
5877
|
});
|
|
5863
5878
|
this.pos = t;
|
|
5864
5879
|
let r = this.parseTernary();
|
|
5865
|
-
return this.expectChar(e$
|
|
5880
|
+
return this.expectChar(e$37.RParen, "a closing \")\""), this.maybeTrailingFilters(this.parseAccessChain(r, null));
|
|
5866
5881
|
}
|
|
5867
|
-
if (n === e$
|
|
5882
|
+
if (n === e$37.SingleQuote || n === e$37.DoubleQuote) return this.maybeTrailingFilters({
|
|
5868
5883
|
type: "literal",
|
|
5869
5884
|
value: this.scanStringLiteral()
|
|
5870
5885
|
});
|
|
@@ -5872,28 +5887,28 @@ var s$17 = class extends o$21 {
|
|
|
5872
5887
|
type: "literal",
|
|
5873
5888
|
value: this.scanNumber()
|
|
5874
5889
|
});
|
|
5875
|
-
if (n === e$
|
|
5890
|
+
if (n === e$37.LBracket) {
|
|
5876
5891
|
this.pos++;
|
|
5877
5892
|
let t = {
|
|
5878
5893
|
type: "array",
|
|
5879
|
-
elements: this.parseArgList(e$
|
|
5894
|
+
elements: this.parseArgList(e$37.RBracket)
|
|
5880
5895
|
};
|
|
5881
5896
|
return this.maybeTrailingFilters(this.parseAccessChain(t, null));
|
|
5882
5897
|
}
|
|
5883
|
-
return n === e$
|
|
5898
|
+
return n === e$37.LBrace ? (this.pos++, this.maybeTrailingFilters(this.parseAccessChain(this.parseObjectLiteral(), null))) : this.parsePathOrFunctionOrArrow();
|
|
5884
5899
|
}
|
|
5885
5900
|
tryParseArrowParams() {
|
|
5886
5901
|
let t = this.pos, n = [];
|
|
5887
|
-
for (this.skipWs(); this.peek() !== e$
|
|
5902
|
+
for (this.skipWs(); this.peek() !== e$37.RParen;) {
|
|
5888
5903
|
let r = this.scanName();
|
|
5889
5904
|
if (!r) return this.pos = t, null;
|
|
5890
|
-
if (n.push(r), this.skipWs(), this.peek() === e$
|
|
5905
|
+
if (n.push(r), this.skipWs(), this.peek() === e$37.Comma) {
|
|
5891
5906
|
this.pos++, this.skipWs();
|
|
5892
5907
|
continue;
|
|
5893
5908
|
}
|
|
5894
5909
|
break;
|
|
5895
5910
|
}
|
|
5896
|
-
return this.skipWs(), this.peek() === e$
|
|
5911
|
+
return this.skipWs(), this.peek() === e$37.RParen && (this.pos++, this.skipWs(), this.peek() === e$37.Equals && this.at(1) === e$37.Greater) ? (this.pos += 2, n) : (this.pos = t, null);
|
|
5897
5912
|
}
|
|
5898
5913
|
parsePathOrFunctionOrArrow() {
|
|
5899
5914
|
let t = this.scanName();
|
|
@@ -5909,14 +5924,14 @@ var s$17 = class extends o$21 {
|
|
|
5909
5924
|
type: "literal",
|
|
5910
5925
|
value: null
|
|
5911
5926
|
});
|
|
5912
|
-
if (this.skipWs(), this.peek() === e$
|
|
5927
|
+
if (this.skipWs(), this.peek() === e$37.Equals && this.at(1) === e$37.Greater) return this.pos += 2, this.maybeTrailingFilters({
|
|
5913
5928
|
type: "arrow",
|
|
5914
5929
|
params: [t],
|
|
5915
5930
|
body: this.parseTernary()
|
|
5916
5931
|
});
|
|
5917
|
-
if (this.peek() === e$
|
|
5932
|
+
if (this.peek() === e$37.LParen) {
|
|
5918
5933
|
this.pos++;
|
|
5919
|
-
let n = this.parseArgList(e$
|
|
5934
|
+
let n = this.parseArgList(e$37.RParen);
|
|
5920
5935
|
return this.maybeTrailingFilters(this.parseAccessChain({
|
|
5921
5936
|
type: "function",
|
|
5922
5937
|
name: t,
|
|
@@ -5933,7 +5948,7 @@ var s$17 = class extends o$21 {
|
|
|
5933
5948
|
let r = t, i = n;
|
|
5934
5949
|
for (;;) {
|
|
5935
5950
|
let t = this.peek();
|
|
5936
|
-
if (t === e$
|
|
5951
|
+
if (t === e$37.Dot) {
|
|
5937
5952
|
let e = this.pos;
|
|
5938
5953
|
this.pos++;
|
|
5939
5954
|
let t = this.scanName() || this.scanIndex();
|
|
@@ -5951,10 +5966,10 @@ var s$17 = class extends o$21 {
|
|
|
5951
5966
|
};
|
|
5952
5967
|
continue;
|
|
5953
5968
|
}
|
|
5954
|
-
if (t !== e$
|
|
5969
|
+
if (t !== e$37.LBracket) break;
|
|
5955
5970
|
this.pos++;
|
|
5956
5971
|
let n = this.parseTernary();
|
|
5957
|
-
if (this.expectChar(e$
|
|
5972
|
+
if (this.expectChar(e$37.RBracket, "a closing \"]\""), i && n.type === "literal" && (typeof n.value == "string" || typeof n.value == "number")) {
|
|
5958
5973
|
i.push(String(n.value));
|
|
5959
5974
|
continue;
|
|
5960
5975
|
}
|
|
@@ -5973,7 +5988,7 @@ var s$17 = class extends o$21 {
|
|
|
5973
5988
|
} : r;
|
|
5974
5989
|
}
|
|
5975
5990
|
maybeTrailingFilters(t) {
|
|
5976
|
-
return this.skipWs(), this.peek() === e$
|
|
5991
|
+
return this.skipWs(), this.peek() === e$37.Pipe ? {
|
|
5977
5992
|
type: "filter",
|
|
5978
5993
|
subject: t,
|
|
5979
5994
|
filters: this.parseTrailingFilters()
|
|
@@ -5981,21 +5996,21 @@ var s$17 = class extends o$21 {
|
|
|
5981
5996
|
}
|
|
5982
5997
|
parseObjectLiteral() {
|
|
5983
5998
|
let t = [];
|
|
5984
|
-
for (this.skipWs(); !this.eof() && this.peek() !== e$
|
|
5999
|
+
for (this.skipWs(); !this.eof() && this.peek() !== e$37.RBrace;) {
|
|
5985
6000
|
let n = this.parseObjectKey();
|
|
5986
|
-
this.skipWs(), this.peek() === e$
|
|
6001
|
+
this.skipWs(), this.peek() === e$37.Colon && this.pos++, this.skipWs(), t.push({
|
|
5987
6002
|
key: n,
|
|
5988
6003
|
value: this.parseTernary()
|
|
5989
|
-
}), this.skipWs(), this.peek() === e$
|
|
6004
|
+
}), this.skipWs(), this.peek() === e$37.Comma && (this.pos++, this.skipWs());
|
|
5990
6005
|
}
|
|
5991
|
-
return this.expectChar(e$
|
|
6006
|
+
return this.expectChar(e$37.RBrace, "a closing \"}\""), {
|
|
5992
6007
|
type: "object",
|
|
5993
6008
|
entries: t
|
|
5994
6009
|
};
|
|
5995
6010
|
}
|
|
5996
6011
|
parseObjectKey() {
|
|
5997
6012
|
let n = this.peek();
|
|
5998
|
-
if (n === e$
|
|
6013
|
+
if (n === e$37.SingleQuote || n === e$37.DoubleQuote) return {
|
|
5999
6014
|
type: "literal",
|
|
6000
6015
|
value: this.scanStringLiteral()
|
|
6001
6016
|
};
|
|
@@ -6003,10 +6018,10 @@ var s$17 = class extends o$21 {
|
|
|
6003
6018
|
type: "literal",
|
|
6004
6019
|
value: this.scanNumber()
|
|
6005
6020
|
};
|
|
6006
|
-
if (n === e$
|
|
6021
|
+
if (n === e$37.LParen) {
|
|
6007
6022
|
this.pos++, this.skipWs();
|
|
6008
6023
|
let t = this.parseTernary();
|
|
6009
|
-
return this.skipWs(), this.peek() === e$
|
|
6024
|
+
return this.skipWs(), this.peek() === e$37.RParen && this.pos++, t;
|
|
6010
6025
|
}
|
|
6011
6026
|
return {
|
|
6012
6027
|
type: "literal",
|
|
@@ -6015,25 +6030,25 @@ var s$17 = class extends o$21 {
|
|
|
6015
6030
|
}
|
|
6016
6031
|
parseArgList(t) {
|
|
6017
6032
|
let n = [];
|
|
6018
|
-
for (this.skipWs(); !this.eof() && this.peek() !== t;) n.push(this.parseTernary()), this.skipWs(), this.peek() === e$
|
|
6019
|
-
return this.expectChar(t, t === e$
|
|
6033
|
+
for (this.skipWs(); !this.eof() && this.peek() !== t;) n.push(this.parseTernary()), this.skipWs(), this.peek() === e$37.Comma && (this.pos++, this.skipWs());
|
|
6034
|
+
return this.expectChar(t, t === e$37.RParen ? "a closing \")\"" : "a closing \"]\""), n;
|
|
6020
6035
|
}
|
|
6021
6036
|
parseTrailingFilters() {
|
|
6022
6037
|
let t = [];
|
|
6023
|
-
for (; this.peek() === e$
|
|
6038
|
+
for (; this.peek() === e$37.Pipe;) this.pos++, this.skipWs(), t.push(this.readFilter()), this.skipWs();
|
|
6024
6039
|
return t;
|
|
6025
6040
|
}
|
|
6026
6041
|
parseApplyChain() {
|
|
6027
6042
|
this.skipWs();
|
|
6028
6043
|
let t = [this.readFilter()];
|
|
6029
|
-
for (this.skipWs(); this.peek() === e$
|
|
6044
|
+
for (this.skipWs(); this.peek() === e$37.Pipe;) this.pos++, this.skipWs(), t.push(this.readFilter()), this.skipWs();
|
|
6030
6045
|
return t;
|
|
6031
6046
|
}
|
|
6032
6047
|
readFilter() {
|
|
6033
6048
|
let t = this.scanName();
|
|
6034
|
-
return t || this.report(`A "|" with no filter name after it in "${this.src.trim()}"`), this.skipWs(), this.peek() === e$
|
|
6049
|
+
return t || this.report(`A "|" with no filter name after it in "${this.src.trim()}"`), this.skipWs(), this.peek() === e$37.LParen ? (this.pos++, {
|
|
6035
6050
|
name: t,
|
|
6036
|
-
args: this.parseArgList(e$
|
|
6051
|
+
args: this.parseArgList(e$37.RParen)
|
|
6037
6052
|
}) : {
|
|
6038
6053
|
name: t,
|
|
6039
6054
|
args: []
|
|
@@ -6052,8 +6067,8 @@ var r$27 = (t) => {
|
|
|
6052
6067
|
for (let r = 0; r + 1 < t.length; r++) {
|
|
6053
6068
|
let i = t.charCodeAt(r);
|
|
6054
6069
|
if (n !== 0) i === n && (n = 0);
|
|
6055
|
-
else if (i === e$
|
|
6056
|
-
else if (i === e$
|
|
6070
|
+
else if (i === e$37.SingleQuote || i === e$37.DoubleQuote) n = i;
|
|
6071
|
+
else if (i === e$37.Dot && t.charCodeAt(r + 1) === e$37.Dot) return [t.slice(0, r).trim(), t.slice(r + 2).trim()];
|
|
6057
6072
|
}
|
|
6058
6073
|
return null;
|
|
6059
6074
|
};
|
|
@@ -6152,7 +6167,7 @@ var f$10 = class {
|
|
|
6152
6167
|
},
|
|
6153
6168
|
source: ""
|
|
6154
6169
|
};
|
|
6155
|
-
let r = t.content.trim(), i = this.keepEmptyTokens ? e$
|
|
6170
|
+
let r = t.content.trim(), i = this.keepEmptyTokens ? e$35(t.content, t.raw) : "";
|
|
6156
6171
|
if (o$22(r)) return {
|
|
6157
6172
|
type: "variable",
|
|
6158
6173
|
raw: t.raw,
|
|
@@ -6328,7 +6343,7 @@ var l$11 = () => {
|
|
|
6328
6343
|
}
|
|
6329
6344
|
};
|
|
6330
6345
|
var u$11 = (e) => {
|
|
6331
|
-
let r = e$
|
|
6346
|
+
let r = e$36(e);
|
|
6332
6347
|
if (r.error) return null;
|
|
6333
6348
|
let i = r.tokens, { hasTags: a, allSimpleOrDotted: o } = c$15(i), s = a || !o, l = null, u = null;
|
|
6334
6349
|
if (s) {
|
|
@@ -6381,7 +6396,7 @@ var n$25 = (n) => {
|
|
|
6381
6396
|
var r$25 = (e) => [...new Set(n$25(e).map((e) => e.split(".")[0]))];
|
|
6382
6397
|
//#endregion
|
|
6383
6398
|
//#region ../sdk-shared/dist/style/styleConstants.mjs
|
|
6384
|
-
var e$
|
|
6399
|
+
var e$34 = {
|
|
6385
6400
|
platform: {
|
|
6386
6401
|
desktop: {},
|
|
6387
6402
|
tablet: {},
|
|
@@ -6639,7 +6654,7 @@ var r$23 = {
|
|
|
6639
6654
|
pageFolders: [],
|
|
6640
6655
|
components: {}
|
|
6641
6656
|
},
|
|
6642
|
-
style: e$
|
|
6657
|
+
style: e$34,
|
|
6643
6658
|
definition: { rootId: "" }
|
|
6644
6659
|
};
|
|
6645
6660
|
//#endregion
|
|
@@ -6660,7 +6675,7 @@ var r$23 = {
|
|
|
6660
6675
|
*
|
|
6661
6676
|
* `computed` holds the space's own computed values (`SpaceSpec.computed`), by name.
|
|
6662
6677
|
*/
|
|
6663
|
-
var GLOBAL_SOURCES = e$
|
|
6678
|
+
var GLOBAL_SOURCES = e$38;
|
|
6664
6679
|
/** What an element inside a component can read besides its own tree: the globals, and what its instance hands in. */
|
|
6665
6680
|
var COMPONENT_SOURCES = [...GLOBAL_SOURCES, n$23];
|
|
6666
6681
|
/**
|
|
@@ -6923,32 +6938,59 @@ var workingDirectory = () => {
|
|
|
6923
6938
|
return typeof cwd === "function" ? `${String(Reflect.apply(cwd, process, []))}/` : "";
|
|
6924
6939
|
};
|
|
6925
6940
|
var FRAME = /\(?((?:file:\/\/)?[^\s()]+?):(\d+):(\d+)\)?$/;
|
|
6941
|
+
var FRAMES = 64;
|
|
6942
|
+
var deepError = () => {
|
|
6943
|
+
const limit = Reflect.get(Error, "stackTraceLimit");
|
|
6944
|
+
if (typeof limit !== "number" || limit >= FRAMES) return /* @__PURE__ */ new Error();
|
|
6945
|
+
Reflect.set(Error, "stackTraceLimit", FRAMES);
|
|
6946
|
+
try {
|
|
6947
|
+
return /* @__PURE__ */ new Error();
|
|
6948
|
+
} finally {
|
|
6949
|
+
Reflect.set(Error, "stackTraceLimit", limit);
|
|
6950
|
+
}
|
|
6951
|
+
};
|
|
6926
6952
|
var markWrittenAt = (spec) => {
|
|
6927
6953
|
if (!isProduction()) Object.defineProperty(spec, WRITTEN_AT, {
|
|
6928
|
-
value:
|
|
6954
|
+
value: deepError(),
|
|
6929
6955
|
enumerable: false
|
|
6930
6956
|
});
|
|
6931
6957
|
return spec;
|
|
6932
6958
|
};
|
|
6933
6959
|
/**
|
|
6934
|
-
*
|
|
6935
|
-
*
|
|
6960
|
+
* `copy`, carrying where `spec` was written. A spread copies only what is enumerable, so a factory that rebuilds a spec
|
|
6961
|
+
* (`{ ...spec, attributes }`) would hand back one written nowhere: `plitzi element where` could not place it and `plitzi element edit`
|
|
6962
|
+
* would refuse it. The marker is the original's — the call the author wrote — never one taken where the copy is made.
|
|
6963
|
+
*/
|
|
6964
|
+
var carryWrittenAt = (spec, copy) => {
|
|
6965
|
+
const marker = Reflect.get(spec, WRITTEN_AT);
|
|
6966
|
+
if (marker instanceof Error) Object.defineProperty(copy, WRITTEN_AT, {
|
|
6967
|
+
value: marker,
|
|
6968
|
+
enumerable: false
|
|
6969
|
+
});
|
|
6970
|
+
return copy;
|
|
6971
|
+
};
|
|
6972
|
+
/**
|
|
6973
|
+
* Every call of the author's own code on the way to `spec`, the one that wrote it first and then each that called it —
|
|
6974
|
+
* a helper (`pageHead(…)`) and where it was called. Each is the function's name at its line and column, which tells
|
|
6975
|
+
* it apart from another call on the same line.
|
|
6936
6976
|
*/
|
|
6937
|
-
var
|
|
6977
|
+
var writtenCalls = (spec) => {
|
|
6938
6978
|
const marker = typeof spec === "object" && spec !== null ? Reflect.get(spec, WRITTEN_AT) : void 0;
|
|
6939
|
-
if (!(marker instanceof Error) || !marker.stack) return;
|
|
6979
|
+
if (!(marker instanceof Error) || !marker.stack) return [];
|
|
6940
6980
|
const cwd = workingDirectory();
|
|
6941
|
-
|
|
6981
|
+
return marker.stack.split("\n").slice(1).flatMap((line) => {
|
|
6942
6982
|
const match = FRAME.exec(line.trim());
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6983
|
+
const file = match?.[1].replace(/^file:\/\//, "");
|
|
6984
|
+
if (!match || !file || isOwnFrame(file)) return [];
|
|
6985
|
+
return [{
|
|
6946
6986
|
file: cwd && file.startsWith(cwd) ? file.slice(cwd.length) : file,
|
|
6947
6987
|
line: Number(match[2]),
|
|
6948
6988
|
column: Number(match[3])
|
|
6949
|
-
};
|
|
6950
|
-
}
|
|
6989
|
+
}];
|
|
6990
|
+
});
|
|
6951
6991
|
};
|
|
6992
|
+
/** The call in the author's own code that wrote `spec`: what a fix edits the source at. */
|
|
6993
|
+
var writtenAtPosition = (spec) => writtenCalls(spec).at(0);
|
|
6952
6994
|
/** The first frame of the author's own code that wrote `spec`, relative to the working directory; or nothing. */
|
|
6953
6995
|
var writtenAt = (spec) => {
|
|
6954
6996
|
const position = writtenAtPosition(spec);
|
|
@@ -7135,7 +7177,7 @@ var element = (type, props) => buildSpec(type, declarationsByType.get(type), pro
|
|
|
7135
7177
|
*/
|
|
7136
7178
|
var component = (componentId, instance = {}) => {
|
|
7137
7179
|
const { props, children, ...authoring } = instance;
|
|
7138
|
-
const filled = Array.isArray(children) ? children : Object.entries(children ?? {}).flatMap(([slot, specs]) => specs.map((spec) => ({
|
|
7180
|
+
const filled = Array.isArray(children) ? children : Object.entries(children ?? {}).flatMap(([slot, specs]) => specs.map((spec) => carryWrittenAt(spec, {
|
|
7139
7181
|
...spec,
|
|
7140
7182
|
attributes: {
|
|
7141
7183
|
...spec.attributes,
|
|
@@ -7146,7 +7188,7 @@ var component = (componentId, instance = {}) => {
|
|
|
7146
7188
|
...authoring,
|
|
7147
7189
|
...filled.length > 0 ? { children: filled } : {}
|
|
7148
7190
|
});
|
|
7149
|
-
return {
|
|
7191
|
+
return carryWrittenAt(spec, {
|
|
7150
7192
|
...spec,
|
|
7151
7193
|
attributes: {
|
|
7152
7194
|
...spec.attributes,
|
|
@@ -7154,7 +7196,7 @@ var component = (componentId, instance = {}) => {
|
|
|
7154
7196
|
referenceId: componentId,
|
|
7155
7197
|
...props
|
|
7156
7198
|
}
|
|
7157
|
-
};
|
|
7199
|
+
});
|
|
7158
7200
|
};
|
|
7159
7201
|
//#endregion
|
|
7160
7202
|
//#region src/elements/elements.ts
|
|
@@ -7262,8 +7304,8 @@ var themeToggle = defineElement(B.ThemeToggle);
|
|
|
7262
7304
|
var video = defineElement(B.Video);
|
|
7263
7305
|
//#endregion
|
|
7264
7306
|
//#region ../sdk-schema/dist/helpers/elementId.mjs
|
|
7265
|
-
var e$
|
|
7266
|
-
var t$28 = (t) => e$
|
|
7307
|
+
var e$33 = /^[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/;
|
|
7308
|
+
var t$28 = (t) => e$33.test(t);
|
|
7267
7309
|
var r$22 = (e) => new Set(Object.keys(e));
|
|
7268
7310
|
var i$20 = (e, n, r) => t$28(n) ? e[n] && n !== r ? `"${n}" is already used by another element here` : null : `"${n}" is not a valid name: start with a letter, then letters, numbers, hyphens and underscores`;
|
|
7269
7311
|
var a$17 = (e, t) => {
|
|
@@ -7382,7 +7424,7 @@ var _$3 = (e, t, n) => {
|
|
|
7382
7424
|
};
|
|
7383
7425
|
//#endregion
|
|
7384
7426
|
//#region ../sdk-shared/dist/helpers/isRecord.mjs
|
|
7385
|
-
var e$
|
|
7427
|
+
var e$32 = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
7386
7428
|
//#endregion
|
|
7387
7429
|
//#region src/schema/guard.ts
|
|
7388
7430
|
/**
|
|
@@ -7545,7 +7587,7 @@ var STEP_TYPES = [
|
|
|
7545
7587
|
* written, when it depends on which one: a hint about one field is noise about every other.
|
|
7546
7588
|
*/
|
|
7547
7589
|
function assertKnownKeys(value, keys, where, hint = "") {
|
|
7548
|
-
if (!e$
|
|
7590
|
+
if (!e$32(value)) throw new AuthoringError("element-shape", `${where} is ${value === null ? "null" : typeof value}, not an object.`);
|
|
7549
7591
|
for (const key of Object.keys(value)) if (!keys.includes(key)) throw new AuthoringError("unknown-field", `${where} has "${key}", which it does not take${didYouMean(key, keys) || "."} It takes ${keys.join(", ")}.${typeof hint === "string" ? hint : hint(key)}`);
|
|
7550
7592
|
}
|
|
7551
7593
|
/** Refuses an id nothing can name: empty, or with characters a template or a selector cannot carry. */
|
|
@@ -7575,28 +7617,28 @@ var paramIssue = (params, spec, where) => {
|
|
|
7575
7617
|
const unknown = Object.keys(provided).find((key) => !names.includes(key));
|
|
7576
7618
|
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"}.`;
|
|
7577
7619
|
}
|
|
7578
|
-
const effective =
|
|
7579
|
-
const invalid =
|
|
7620
|
+
const effective = c$19(provided, declared, false);
|
|
7621
|
+
const invalid = s$22(provided, effective, declared).at(0);
|
|
7580
7622
|
if (invalid) {
|
|
7581
7623
|
const value = provided[invalid.key];
|
|
7582
7624
|
const suggestion = typeof value === "string" && invalid.options ? didYouMean(value, invalid.options) : "";
|
|
7583
7625
|
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}.`;
|
|
7584
7626
|
}
|
|
7585
|
-
const missing =
|
|
7627
|
+
const missing = r$36(provided, effective, declared).at(0);
|
|
7586
7628
|
return missing === void 0 ? void 0 : `${where} needs "${missing}": ${declared[missing].description}`;
|
|
7587
7629
|
};
|
|
7588
7630
|
//#endregion
|
|
7589
7631
|
//#region ../sdk-schema/dist/helpers/elementTree.mjs
|
|
7590
|
-
var e$
|
|
7632
|
+
var e$31 = (e, t) => t && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
7591
7633
|
var t$27 = (t, n) => {
|
|
7592
7634
|
let r = [], i = /* @__PURE__ */ new Set([n]);
|
|
7593
|
-
for (let a = e$
|
|
7635
|
+
for (let a = e$31(t, e$31(t, n)?.definition.parentId); a && !i.has(a.id);) i.add(a.id), r.push(a.id), a = e$31(t, a.definition.parentId);
|
|
7594
7636
|
return r;
|
|
7595
7637
|
};
|
|
7596
7638
|
var n$22 = (n, r) => {
|
|
7597
7639
|
let i = [], a = /* @__PURE__ */ new Set([r]), o = (s) => {
|
|
7598
7640
|
for (let c of [s, ...t$27(n, s)]) {
|
|
7599
|
-
let t = e$
|
|
7641
|
+
let t = e$31(n, c);
|
|
7600
7642
|
if (c !== s || s !== r) {
|
|
7601
7643
|
if (a.has(c)) continue;
|
|
7602
7644
|
a.add(c), i.push(c);
|
|
@@ -7609,26 +7651,26 @@ var n$22 = (n, r) => {
|
|
|
7609
7651
|
};
|
|
7610
7652
|
var r$21 = (t, n) => {
|
|
7611
7653
|
let r = [], i = /* @__PURE__ */ new Set([n]), a = (n) => {
|
|
7612
|
-
for (let o of e$
|
|
7654
|
+
for (let o of e$31(t, n)?.definition.items ?? []) !i.has(o) && e$31(t, o) && (i.add(o), r.push(o), a(o));
|
|
7613
7655
|
};
|
|
7614
7656
|
return a(n), r;
|
|
7615
7657
|
};
|
|
7616
7658
|
//#endregion
|
|
7617
7659
|
//#region ../sdk-shared/dist/style/breakpoints.mjs
|
|
7618
|
-
var e$
|
|
7660
|
+
var e$30 = {
|
|
7619
7661
|
desktop: 1024,
|
|
7620
7662
|
tablet: 768,
|
|
7621
7663
|
mobile: 0
|
|
7622
7664
|
};
|
|
7623
|
-
var t$26 = (t) => e$
|
|
7665
|
+
var t$26 = (t) => e$30[t] === 0 ? "0" : `${String(e$30[t] / 16)}rem`;
|
|
7624
7666
|
//#endregion
|
|
7625
7667
|
//#region ../sdk-shared/dist/style/displayModes.mjs
|
|
7626
|
-
var e$
|
|
7668
|
+
var e$29 = [
|
|
7627
7669
|
"desktop",
|
|
7628
7670
|
"tablet",
|
|
7629
7671
|
"mobile"
|
|
7630
7672
|
];
|
|
7631
|
-
var t$25 = (t) => e$
|
|
7673
|
+
var t$25 = (t) => e$29.some((e) => e === t);
|
|
7632
7674
|
//#endregion
|
|
7633
7675
|
//#region ../sdk-shared/dist/style/fonts.mjs
|
|
7634
7676
|
var i$19 = (e) => {
|
|
@@ -7685,7 +7727,7 @@ var d$9 = (e) => {
|
|
|
7685
7727
|
return [...new Set(t)];
|
|
7686
7728
|
};
|
|
7687
7729
|
var f$8 = (t, n) => {
|
|
7688
|
-
if (!e$
|
|
7730
|
+
if (!e$32(t)) return c$13(`font.files[${n}] must be an object`);
|
|
7689
7731
|
let { weight: r, style: a, format: o, unicodeRange: s } = t;
|
|
7690
7732
|
if (typeof r != "number" || !Number.isInteger(r) || r < 1 || r > 1e3) return c$13(`font.files[${n}].weight must be a whole number between 1 and 1000`);
|
|
7691
7733
|
if (a !== "normal" && a !== "italic") return c$13(`font.files[${n}].style must be "normal" or "italic"`);
|
|
@@ -7704,7 +7746,7 @@ var f$8 = (t, n) => {
|
|
|
7704
7746
|
var p$8 = (e, t) => typeof e != "string" || !e ? c$13(`font.files[${t}].path must be a non-empty string`) : e.includes("://") || e.startsWith("/") ? c$13(`font.files[${t}].path must be relative to the font store, not a URL`) : e.split("/").includes("..") ? c$13(`font.files[${t}].path cannot climb out of the font store`) : e;
|
|
7705
7747
|
var m$4 = (e) => !Array.isArray(e) || e.length === 0 ? c$13("font.files must be a non-empty list") : e;
|
|
7706
7748
|
var h$2 = (i) => {
|
|
7707
|
-
if (!e$
|
|
7749
|
+
if (!e$32(i)) return c$13("a font must be an object");
|
|
7708
7750
|
let { source: a, fallback: o, display: s, preload: h } = i;
|
|
7709
7751
|
if (typeof a != "string" || !n$21.has(a)) return c$13("font.source must be one of: system, google, remote, hosted");
|
|
7710
7752
|
if (typeof o != "string" || !o.trim()) return c$13("font.fallback is required: it is what renders until the face arrives");
|
|
@@ -7759,19 +7801,19 @@ var h$2 = (i) => {
|
|
|
7759
7801
|
};
|
|
7760
7802
|
//#endregion
|
|
7761
7803
|
//#region ../sdk-shared/dist/types/StyleTypes.mjs
|
|
7762
|
-
var e$
|
|
7804
|
+
var e$28 = /* @__PURE__ */ function(e) {
|
|
7763
7805
|
return e.COLOR = "color", e.SPACING = "spacing", e.SHADOW = "shadow", e.CUSTOM = "custom", e;
|
|
7764
7806
|
}({});
|
|
7765
|
-
var t$24 = Object.values(e$
|
|
7807
|
+
var t$24 = Object.values(e$28);
|
|
7766
7808
|
var n$20 = (e) => typeof e == "string" && t$24.includes(e);
|
|
7767
7809
|
//#endregion
|
|
7768
7810
|
//#region ../sdk-shared/dist/style/styleConditions.mjs
|
|
7769
|
-
var e$
|
|
7811
|
+
var e$27 = {
|
|
7770
7812
|
"motion-reduce": "@media (prefers-reduced-motion: reduce)",
|
|
7771
7813
|
"motion-safe": "@media (prefers-reduced-motion: no-preference)"
|
|
7772
7814
|
};
|
|
7773
|
-
var t$23 = Object.keys(e$
|
|
7774
|
-
var r$19 = (t) => Object.hasOwn(e$
|
|
7815
|
+
var t$23 = Object.keys(e$27);
|
|
7816
|
+
var r$19 = (t) => Object.hasOwn(e$27, t);
|
|
7775
7817
|
var i$17 = String.raw`\d+(?:\.\d+)?(?:px|rem|em|ch)`;
|
|
7776
7818
|
var a$15 = String.raw`\((?:min|max)-width:\s*${i$17}\)`;
|
|
7777
7819
|
var o$17 = new RegExp(String.raw`^container(?:\s+(?<name>-?[_a-zA-Z][\w-]*))?\s+(?<query>${a$15}(?:\s+and\s+${a$15})?)$`);
|
|
@@ -7788,19 +7830,19 @@ var c$12 = (e) => {
|
|
|
7788
7830
|
if (t) return t.name ? `container ${t.name} ${t.query}` : `container ${t.query}`;
|
|
7789
7831
|
};
|
|
7790
7832
|
var u$8 = (t) => {
|
|
7791
|
-
if (r$19(t)) return e$
|
|
7833
|
+
if (r$19(t)) return e$27[t];
|
|
7792
7834
|
let n = s$14(t);
|
|
7793
7835
|
if (n) return n.name ? `@container ${n.name} ${n.query}` : `@container ${n.query}`;
|
|
7794
7836
|
};
|
|
7795
7837
|
var f$7 = (t) => {
|
|
7796
7838
|
let n = t.trim().replace(/\s+/g, " ").replace(/\(\s*/g, "(").replace(/\s*\)/g, ")").replace(/:\s*/g, ": ");
|
|
7797
|
-
for (let [t, r] of Object.entries(e$
|
|
7839
|
+
for (let [t, r] of Object.entries(e$27)) if (n === r) return t;
|
|
7798
7840
|
let r = /^@container\s+(.*)$/.exec(n);
|
|
7799
7841
|
if (r) return c$12(`container ${r[1]}`);
|
|
7800
7842
|
};
|
|
7801
7843
|
//#endregion
|
|
7802
7844
|
//#region ../sdk-shared/dist/style/stylePseudos.mjs
|
|
7803
|
-
var e$
|
|
7845
|
+
var e$26 = [
|
|
7804
7846
|
"before",
|
|
7805
7847
|
"after",
|
|
7806
7848
|
"marker",
|
|
@@ -7922,7 +7964,7 @@ var m$3 = (e) => {
|
|
|
7922
7964
|
};
|
|
7923
7965
|
//#endregion
|
|
7924
7966
|
//#region ../sdk-shared/dist/style/styleStates.mjs
|
|
7925
|
-
var e$
|
|
7967
|
+
var e$25 = [
|
|
7926
7968
|
"hover",
|
|
7927
7969
|
"focus",
|
|
7928
7970
|
"focus-visible",
|
|
@@ -7958,7 +8000,7 @@ var r$17 = {
|
|
|
7958
8000
|
hidden: 14
|
|
7959
8001
|
};
|
|
7960
8002
|
var i$15 = (e) => Object.hasOwn(r$17, e);
|
|
7961
|
-
var a$13 = (t) => i$15(t) ? r$17[t] : e$
|
|
8003
|
+
var a$13 = (t) => i$15(t) ? r$17[t] : e$25.length;
|
|
7962
8004
|
var o$15 = (e) => Object.entries(e).sort(([e], [t]) => a$13(e) - a$13(t));
|
|
7963
8005
|
var l$7 = {
|
|
7964
8006
|
current: ":is([aria-current]:not([aria-current=\"false\"]),[aria-pressed=\"true\"],[aria-selected=\"true\"],[role=\"tabpanel\"]:not([hidden]))",
|
|
@@ -7974,7 +8016,7 @@ var d$7 = (e) => e === "hidden";
|
|
|
7974
8016
|
var p$6 = (e) => e === ">";
|
|
7975
8017
|
//#endregion
|
|
7976
8018
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/shared.js
|
|
7977
|
-
function e$
|
|
8019
|
+
function e$24(e) {
|
|
7978
8020
|
if (typeof e == "string" || typeof e == "number") {
|
|
7979
8021
|
let t = String(e);
|
|
7980
8022
|
return t === "" ? null : /^[a-zA-Z0-9_-]+$/.test(t) || /^\d+$/.test(t) ? t : null;
|
|
@@ -7986,11 +8028,11 @@ function t$20(t, n) {
|
|
|
7986
8028
|
let r = [], i = /([^.[\]]+)|\[(\d+)\]/g, a;
|
|
7987
8029
|
for (; a = i.exec(t);) if (a[1]) {
|
|
7988
8030
|
if (!n && a[1] === "") continue;
|
|
7989
|
-
let t = e$
|
|
8031
|
+
let t = e$24(a[1]);
|
|
7990
8032
|
if (t !== null) r.push(t);
|
|
7991
8033
|
else if (n) return [];
|
|
7992
8034
|
} else if (a[2]) {
|
|
7993
|
-
let t = e$
|
|
8035
|
+
let t = e$24(a[2]);
|
|
7994
8036
|
if (t !== null) r.push(t);
|
|
7995
8037
|
else if (n) return [];
|
|
7996
8038
|
}
|
|
@@ -8000,7 +8042,7 @@ function n$18(t, n) {
|
|
|
8000
8042
|
if (!Array.isArray(t)) return [];
|
|
8001
8043
|
let r = [];
|
|
8002
8044
|
for (let i of t) {
|
|
8003
|
-
let t = e$
|
|
8045
|
+
let t = e$24(i);
|
|
8004
8046
|
if (t !== null) r.push(t);
|
|
8005
8047
|
else if (n) return [];
|
|
8006
8048
|
}
|
|
@@ -8340,7 +8382,7 @@ var d$6 = class {
|
|
|
8340
8382
|
};
|
|
8341
8383
|
flatAsSnippet = (e, t, n = !1) => {
|
|
8342
8384
|
let r = {
|
|
8343
|
-
...e$
|
|
8385
|
+
...e$34,
|
|
8344
8386
|
platform: {
|
|
8345
8387
|
desktop: {},
|
|
8346
8388
|
tablet: {},
|
|
@@ -8582,6 +8624,10 @@ var LintContext = class {
|
|
|
8582
8624
|
* The attributes this element reads: its type's, and what being where it is adds — an instance reads the props its
|
|
8583
8625
|
* component declares, each an attribute of its own, and a child of an instance names the slot it fills.
|
|
8584
8626
|
*/
|
|
8627
|
+
/** What the element's type — its component's, for a `custom` one — writes when an attribute is left out. */
|
|
8628
|
+
defaultsFor(element) {
|
|
8629
|
+
return this.catalogs.defaultAttributes?.[this.catalogType(element) ?? element.definition.type] ?? {};
|
|
8630
|
+
}
|
|
8585
8631
|
attributeNamesFor(element) {
|
|
8586
8632
|
const names = this.attributeNames(this.catalogType(element) ?? element.definition.type);
|
|
8587
8633
|
const parentId = element.definition.parentId;
|
|
@@ -8669,14 +8715,14 @@ var withPluginCatalogs = (options) => {
|
|
|
8669
8715
|
const byType = (own, hosted = own) => Object.fromEntries(plugins.flatMap((declaration) => {
|
|
8670
8716
|
return [[declaration.type, own(declaration)], [hostedKey(declaration), hosted(declaration)]].filter((entry) => entry[1] !== void 0);
|
|
8671
8717
|
}));
|
|
8672
|
-
const customTriggers = rest.vocabulary?.triggers?.["custom"] ?? Object.keys(e$
|
|
8718
|
+
const customTriggers = rest.vocabulary?.triggers?.["custom"] ?? Object.keys(e$40);
|
|
8673
8719
|
const customCallbacks = rest.vocabulary?.callbacks?.["custom"] ?? Object.keys(a$22);
|
|
8674
8720
|
const customAttributes = Object.keys(rest.defaultAttributes?.["custom"] ?? {});
|
|
8675
8721
|
const vocabulary = rest.vocabulary && {
|
|
8676
8722
|
...rest.vocabulary,
|
|
8677
8723
|
triggers: {
|
|
8678
8724
|
...rest.vocabulary.triggers,
|
|
8679
|
-
...byType((declaration) => [...Object.keys(e$
|
|
8725
|
+
...byType((declaration) => [...Object.keys(e$40), ...actionsOf(declaration.triggers)], (declaration) => [...customTriggers, ...actionsOf(declaration.triggers)])
|
|
8680
8726
|
},
|
|
8681
8727
|
callbacks: {
|
|
8682
8728
|
...rest.vocabulary.callbacks,
|
|
@@ -8839,7 +8885,7 @@ var steps_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
8839
8885
|
* the builders useless for exactly the flows that matter most.
|
|
8840
8886
|
*/
|
|
8841
8887
|
var builtinTrigger = (trigger) => {
|
|
8842
|
-
if (Object.hasOwn(e$
|
|
8888
|
+
if (Object.hasOwn(e$40, trigger)) return e$40[trigger];
|
|
8843
8889
|
return Object.hasOwn(typeTriggerDefinitions, trigger) ? typeTriggerDefinitions[trigger] : void 0;
|
|
8844
8890
|
};
|
|
8845
8891
|
var on = (trigger, params = {}) => {
|
|
@@ -9152,7 +9198,7 @@ var carouselPlay = (target) => carouselStep(target, "play", "Play");
|
|
|
9152
9198
|
var carouselPause = (target) => carouselStep(target, "pause", "Pause");
|
|
9153
9199
|
//#endregion
|
|
9154
9200
|
//#region ../sdk-interactions/dist/sources/QueriesSource/writeParams.mjs
|
|
9155
|
-
var e$
|
|
9201
|
+
var e$21 = {
|
|
9156
9202
|
origin: "Requests to the same site",
|
|
9157
9203
|
all: "All cached requests",
|
|
9158
9204
|
elements: "Only these containers",
|
|
@@ -9164,7 +9210,7 @@ var t$16 = (t, n = () => !0) => ({
|
|
|
9164
9210
|
description: "What to refresh once the write succeeded, so the page shows the new data: the requests to the same site, every provider on the page, only the api containers named in `invalidateElements`, or none for a step that only reads. Server-driven containers are refreshed too, asking the server past its cache. Containers on screen ask again at once; the rest when they are shown.",
|
|
9165
9211
|
default: t[0],
|
|
9166
9212
|
options: [...t],
|
|
9167
|
-
optionLabels: Object.fromEntries(t.map((t) => [t, e$
|
|
9213
|
+
optionLabels: Object.fromEntries(t.map((t) => [t, e$21[t]])),
|
|
9168
9214
|
label: "Refresh cached requests",
|
|
9169
9215
|
canBind: !1,
|
|
9170
9216
|
when: n
|
|
@@ -9248,7 +9294,7 @@ var t$15 = {
|
|
|
9248
9294
|
};
|
|
9249
9295
|
//#endregion
|
|
9250
9296
|
//#region ../sdk-interactions/dist/sources/AuthSource/callbacks.mjs
|
|
9251
|
-
var e$
|
|
9297
|
+
var e$20 = {
|
|
9252
9298
|
login: {
|
|
9253
9299
|
source: "auth",
|
|
9254
9300
|
title: "Auth Login",
|
|
@@ -9336,7 +9382,7 @@ var e$19 = {
|
|
|
9336
9382
|
};
|
|
9337
9383
|
//#endregion
|
|
9338
9384
|
//#region ../sdk-interactions/dist/sources/HostSource/callbacks.mjs
|
|
9339
|
-
var e$
|
|
9385
|
+
var e$19 = { hostAction: {
|
|
9340
9386
|
source: "host",
|
|
9341
9387
|
title: "Host Action",
|
|
9342
9388
|
strictParams: !0,
|
|
@@ -9355,7 +9401,7 @@ var e$18 = { hostAction: {
|
|
|
9355
9401
|
} };
|
|
9356
9402
|
//#endregion
|
|
9357
9403
|
//#region ../sdk-interactions/dist/sources/NavigationSource/callbacks.mjs
|
|
9358
|
-
var e$
|
|
9404
|
+
var e$18 = { navigate: {
|
|
9359
9405
|
source: "navigation",
|
|
9360
9406
|
title: "Navigate",
|
|
9361
9407
|
strictParams: !0,
|
|
@@ -9384,7 +9430,7 @@ var e$17 = { navigate: {
|
|
|
9384
9430
|
} };
|
|
9385
9431
|
//#endregion
|
|
9386
9432
|
//#region ../sdk-interactions/dist/sources/QueriesSource/callbacks.mjs
|
|
9387
|
-
var e$
|
|
9433
|
+
var e$17 = { invalidateQueries: {
|
|
9388
9434
|
source: "queries",
|
|
9389
9435
|
title: "Invalidate Queries",
|
|
9390
9436
|
strictParams: !0,
|
|
@@ -9407,7 +9453,7 @@ var e$16 = { invalidateQueries: {
|
|
|
9407
9453
|
} };
|
|
9408
9454
|
//#endregion
|
|
9409
9455
|
//#region ../sdk-interactions/dist/sources/StateSource/callbacks.mjs
|
|
9410
|
-
var e$
|
|
9456
|
+
var e$16 = {
|
|
9411
9457
|
setState: {
|
|
9412
9458
|
source: "state",
|
|
9413
9459
|
title: "Set State",
|
|
@@ -9559,7 +9605,7 @@ var e$15 = {
|
|
|
9559
9605
|
};
|
|
9560
9606
|
//#endregion
|
|
9561
9607
|
//#region ../sdk-shared/dist/authoring/spaceCallbacks.mjs
|
|
9562
|
-
var e$
|
|
9608
|
+
var e$15 = { addNotification: {
|
|
9563
9609
|
source: "space",
|
|
9564
9610
|
title: "Add Notification",
|
|
9565
9611
|
strictParams: !0,
|
|
@@ -9625,13 +9671,13 @@ var e$14 = { addNotification: {
|
|
|
9625
9671
|
* of them is an authoring question nobody at runtime asks.
|
|
9626
9672
|
*/
|
|
9627
9673
|
var BUILTIN_GLOBAL_CALLBACKS = {
|
|
9628
|
-
...e$14,
|
|
9629
9674
|
...e$15,
|
|
9630
|
-
...e$
|
|
9631
|
-
...e$17,
|
|
9675
|
+
...e$16,
|
|
9632
9676
|
...e$19,
|
|
9677
|
+
...e$18,
|
|
9678
|
+
...e$20,
|
|
9633
9679
|
...t$15,
|
|
9634
|
-
...e$
|
|
9680
|
+
...e$17
|
|
9635
9681
|
};
|
|
9636
9682
|
/** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
|
|
9637
9683
|
* callback whose source/schema is not knowable here). */
|
|
@@ -9645,7 +9691,7 @@ var applyBuiltinCallback = (action, params) => {
|
|
|
9645
9691
|
const builtin = BUILTIN_GLOBAL_CALLBACKS[action];
|
|
9646
9692
|
return {
|
|
9647
9693
|
source: builtin.source,
|
|
9648
|
-
params:
|
|
9694
|
+
params: c$19(params, builtin.params, builtin.strictParams)
|
|
9649
9695
|
};
|
|
9650
9696
|
};
|
|
9651
9697
|
//#endregion
|
|
@@ -9659,6 +9705,7 @@ var steps_exports = /* @__PURE__ */ __exportAll({
|
|
|
9659
9705
|
authRefreshDetails: () => authRefreshDetails,
|
|
9660
9706
|
cancelServerAction: () => cancelServerAction,
|
|
9661
9707
|
clearState: () => clearState,
|
|
9708
|
+
copyToClipboard: () => copyToClipboard,
|
|
9662
9709
|
cycleState: () => cycleState,
|
|
9663
9710
|
delay: () => delay,
|
|
9664
9711
|
hostAction: () => hostAction,
|
|
@@ -9855,6 +9902,12 @@ var utilityStep = (action, params = {}) => ({
|
|
|
9855
9902
|
/** Milliseconds. The param is `time` — not `delay`, `duration` or `ms`, any of which waits zero. */
|
|
9856
9903
|
var delay = (time) => utilityStep("delayTime", { time });
|
|
9857
9904
|
/**
|
|
9905
|
+
* Copies `text` to the visitor's clipboard — a template like any param: `copyToClipboard('{{ navigation.href }}')` copies
|
|
9906
|
+
* the page's address. Where the browser offers no clipboard the step fails, so a flow's `onFailure` says so and its
|
|
9907
|
+
* "Copied" never shows for nothing.
|
|
9908
|
+
*/
|
|
9909
|
+
var copyToClipboard = (text) => utilityStep("copyToClipboard", { text });
|
|
9910
|
+
/**
|
|
9858
9911
|
* Calls a URL and puts the answer in the flow scope as `{{ <id>.response.status }}` and `{{ <id>.response.data }}`.
|
|
9859
9912
|
*
|
|
9860
9913
|
* `body` takes an object for the reason {@link runServerAction}'s `input` does, and this is the surface where it
|
|
@@ -9868,6 +9921,20 @@ var delay = (time) => utilityStep("delayTime", { time });
|
|
|
9868
9921
|
var webHook = (params) => utilityStep("webHook", params);
|
|
9869
9922
|
var twigTemplate = (params) => utilityStep("twigTemplate", params);
|
|
9870
9923
|
//#endregion
|
|
9924
|
+
//#region ../sdk-interactions/dist/utility/copyToClipboardSpec.mjs
|
|
9925
|
+
var e$14 = {
|
|
9926
|
+
title: "Copy To Clipboard",
|
|
9927
|
+
type: "utility",
|
|
9928
|
+
strictParams: !0,
|
|
9929
|
+
params: { text: {
|
|
9930
|
+
type: "text",
|
|
9931
|
+
description: "The words to copy — a template reads the page: {{ navigation.href }} is its address.",
|
|
9932
|
+
default: "",
|
|
9933
|
+
label: "Text",
|
|
9934
|
+
required: !0
|
|
9935
|
+
} }
|
|
9936
|
+
};
|
|
9937
|
+
//#endregion
|
|
9871
9938
|
//#region ../sdk-interactions/dist/utility/webHookSpec.mjs
|
|
9872
9939
|
var t$14 = (e) => {
|
|
9873
9940
|
let t = typeof e.method == "string" ? e.method.toLowerCase() : "get";
|
|
@@ -9984,7 +10051,8 @@ var BUILTIN_UTILITIES = {
|
|
|
9984
10051
|
status: "",
|
|
9985
10052
|
data: ""
|
|
9986
10053
|
} }
|
|
9987
|
-
}
|
|
10054
|
+
},
|
|
10055
|
+
copyToClipboard: e$14
|
|
9988
10056
|
};
|
|
9989
10057
|
/** The built-in utility for an action, or undefined when the action is not a known built-in utility. */
|
|
9990
10058
|
var getUtility = (action) => Object.hasOwn(BUILTIN_UTILITIES, action) ? BUILTIN_UTILITIES[action] : void 0;
|
|
@@ -9998,7 +10066,7 @@ var applyUtility = (action, params) => {
|
|
|
9998
10066
|
};
|
|
9999
10067
|
return {
|
|
10000
10068
|
known: true,
|
|
10001
|
-
params:
|
|
10069
|
+
params: c$19(params, utility.params, utility.strictParams)
|
|
10002
10070
|
};
|
|
10003
10071
|
};
|
|
10004
10072
|
//#endregion
|
|
@@ -10956,9 +11024,9 @@ var s$8 = /* @__PURE__ */ new Set([
|
|
|
10956
11024
|
]);
|
|
10957
11025
|
var c$7 = (t, n) => {
|
|
10958
11026
|
let r = [];
|
|
10959
|
-
if (o$9.test(t) || r.push("a pattern is letters, digits and `:_.-`, with `{name}` for the part a page fills in — `board:{id}`"), !e$
|
|
10960
|
-
let { access: i, publish: a, presence: c, grant: l, maxMessageBytes: u, messagesPerSecond: d } = n, f = e$
|
|
10961
|
-
typeof f != "string" || !s$8.has(f) ? r.push("`access` is { mode: \"public\" }, { mode: \"session\" } or { mode: \"role\", permissions: […] }") : f === "role" && !(e$
|
|
11027
|
+
if (o$9.test(t) || r.push("a pattern is letters, digits and `:_.-`, with `{name}` for the part a page fills in — `board:{id}`"), !e$32(n)) return [...r, "a channel is an object: `{ access: { mode: \"public\" } }`"];
|
|
11028
|
+
let { access: i, publish: a, presence: c, grant: l, maxMessageBytes: u, messagesPerSecond: d } = n, f = e$32(i) ? i.mode : void 0;
|
|
11029
|
+
typeof f != "string" || !s$8.has(f) ? r.push("`access` is { mode: \"public\" }, { mode: \"session\" } or { mode: \"role\", permissions: […] }") : f === "role" && !(e$32(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");
|
|
10962
11030
|
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`);
|
|
10963
11031
|
return r;
|
|
10964
11032
|
};
|
|
@@ -11009,7 +11077,7 @@ var lintInstances = (ctx) => {
|
|
|
11009
11077
|
const bound = boundProps(element);
|
|
11010
11078
|
for (const [name, prop] of Object.entries(declared)) if (prop.required && element.attributes[name] === void 0 && !bound.has(name)) ctx.error("prop-missing", `${where} places component "${component.id}" without "${name}", which it requires${prop.description ? ` — ${prop.description}` : ""}. Hand it in: \`component('${component.id}', { props: { ${name}: … } })\`.`, element.id);
|
|
11011
11079
|
const written = Object.fromEntries(Object.keys(declared).map((name) => [name, element.attributes[name]]));
|
|
11012
|
-
for (const { key, expected, got, options } of
|
|
11080
|
+
for (const { key, expected, got, options } of s$22(written, written, declared)) {
|
|
11013
11081
|
const value = written[key];
|
|
11014
11082
|
const suggestion = options && typeof value === "string" ? didYouMean(value, options) : "";
|
|
11015
11083
|
ctx.error("prop-value", `${where} hands component "${component.id}" "${key}" as ${got}, and it is declared ${expected}${options ? ` (one of ${options.map((option) => `'${option}'`).join(", ")})` : ""}${suggestion || "."}`, element.id);
|
|
@@ -11738,7 +11806,7 @@ var c$5 = class {
|
|
|
11738
11806
|
}
|
|
11739
11807
|
};
|
|
11740
11808
|
var l$6 = (e) => {
|
|
11741
|
-
let r = e$
|
|
11809
|
+
let r = e$36(e);
|
|
11742
11810
|
if (r.error) return {
|
|
11743
11811
|
issues: [r.error],
|
|
11744
11812
|
freeNames: []
|
|
@@ -12202,7 +12270,7 @@ var checkAttributeTemplates = (ctx, element, where) => {
|
|
|
12202
12270
|
}, scope, element.id);
|
|
12203
12271
|
};
|
|
12204
12272
|
/** A value at a dotted path of a record, as the list reads its `itemKey`. */
|
|
12205
|
-
var fieldOf = (item, path) => path.split(".").reduce((value, key) => e$
|
|
12273
|
+
var fieldOf = (item, path) => path.split(".").reduce((value, key) => e$32(value) ? value[key] : void 0, item);
|
|
12206
12274
|
/**
|
|
12207
12275
|
* A list's `itemKey` that does not name each of its fixed items once. The list falls back to the items' `id`, then to
|
|
12208
12276
|
* their position, so the rows do not stay with their items as the author meant. Bound items arrive at run time and
|
|
@@ -12390,13 +12458,13 @@ var isRead = (name, schema, elements) => {
|
|
|
12390
12458
|
var lintDeclaration = (ctx, name, flag) => {
|
|
12391
12459
|
const where = `Feature flag "${name}"`;
|
|
12392
12460
|
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, "_")}".`);
|
|
12393
|
-
if (!e$
|
|
12461
|
+
if (!e$32(flag) || typeof flag.value !== "boolean" || !Array.isArray(flag.rules)) {
|
|
12394
12462
|
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.`);
|
|
12395
12463
|
return;
|
|
12396
12464
|
}
|
|
12397
12465
|
flag.rules.forEach((rule, index) => {
|
|
12398
12466
|
const at = `${where}, rule ${index + 1}`;
|
|
12399
|
-
if (!e$
|
|
12467
|
+
if (!e$32(rule) || typeof rule.value !== "boolean" || !e$32(rule.when)) {
|
|
12400
12468
|
ctx.error("flag-rule-shape", `${at} is ${JSON.stringify(rule)}. A rule is { when: { … }, value: true | false }.`);
|
|
12401
12469
|
return;
|
|
12402
12470
|
}
|
|
@@ -12468,7 +12536,7 @@ var flowsOf$1 = (element) => {
|
|
|
12468
12536
|
*/
|
|
12469
12537
|
var checkElementIds = (ctx, params, spec, at, hostId) => {
|
|
12470
12538
|
const declared = spec ?? {};
|
|
12471
|
-
const effective =
|
|
12539
|
+
const effective = c$19(params, declared, false);
|
|
12472
12540
|
for (const [key, param] of Object.entries(declared)) {
|
|
12473
12541
|
const ids = params[key];
|
|
12474
12542
|
if (param.type !== "elementIds" || !Array.isArray(ids) || param.when && !param.when(effective)) continue;
|
|
@@ -12978,7 +13046,7 @@ var f$3 = /* @__PURE__ */ new Set([
|
|
|
12978
13046
|
"loop"
|
|
12979
13047
|
]);
|
|
12980
13048
|
var p$3 = (i) => {
|
|
12981
|
-
if (!e$
|
|
13049
|
+
if (!e$32(i)) return ["motion is an object: `{ enter: \"fade-up\", on: \"view\" }`"];
|
|
12982
13050
|
let a = [];
|
|
12983
13051
|
for (let e of Object.keys(i)) f$3.has(e) || a.push(`motion has no "${e}" — it takes enter, on, duration, delay, stagger and loop`);
|
|
12984
13052
|
i.enter !== void 0 && !d$4(t$6, i.enter) && a.push(`motion.enter is one of ${t$6.join(", ")}`), i.on !== void 0 && !d$4(n$6, i.on) && a.push(`motion.on is ${n$6.slice(0, -1).join(", ")} or ${String(n$6.at(-1))}`), i.loop !== void 0 && !d$4(r$4, i.loop) && a.push(`motion.loop is one of ${r$4.join(", ")}`);
|
|
@@ -13170,9 +13238,23 @@ var stepsOf = (element) => Object.values(element.definition.interactions ?? {});
|
|
|
13170
13238
|
* A key the element or step does not take, renamed to the one it was a typo of — when that one is free — or dropped:
|
|
13171
13239
|
* it was never read, so dropping it changes nothing on screen.
|
|
13172
13240
|
*/
|
|
13173
|
-
var settleUnknownKeys = (record, known, what, on, report) => {
|
|
13241
|
+
var settleUnknownKeys = (record, known, what, on, report, defaults = {}) => {
|
|
13174
13242
|
for (const key of Object.keys(record)) {
|
|
13175
13243
|
if (known.includes(key)) continue;
|
|
13244
|
+
const wrapped = record[key];
|
|
13245
|
+
if (e$32(wrapped) && Object.keys(wrapped).length > 0 && Object.keys(wrapped).every((inner) => known.includes(inner))) {
|
|
13246
|
+
const inners = Object.keys(wrapped);
|
|
13247
|
+
if (inners.every((inner) => record[inner] === void 0 || record[inner] === defaults[inner])) {
|
|
13248
|
+
Object.assign(record, wrapped);
|
|
13249
|
+
Reflect.deleteProperty(record, key);
|
|
13250
|
+
report(`Moved ${inners.join(", ")} out of the ${what} "${key}", up to where ${inners.length === 1 ? "it is" : "they are"} read.`, {
|
|
13251
|
+
on,
|
|
13252
|
+
op: "unwrap",
|
|
13253
|
+
key
|
|
13254
|
+
});
|
|
13255
|
+
}
|
|
13256
|
+
continue;
|
|
13257
|
+
}
|
|
13176
13258
|
const meant = closest(key, known);
|
|
13177
13259
|
if (meant !== void 0 && record[meant] === void 0) {
|
|
13178
13260
|
record[meant] = record[key];
|
|
@@ -13227,7 +13309,7 @@ var FIXERS = {
|
|
|
13227
13309
|
},
|
|
13228
13310
|
"unknown-attribute": (element, ctx, report) => {
|
|
13229
13311
|
const names = ctx.attributeNamesFor(element);
|
|
13230
|
-
if (!isRoot(element) && names) settleUnknownKeys(element.attributes, names, "attribute", "attribute", report);
|
|
13312
|
+
if (!isRoot(element) && names) settleUnknownKeys(element.attributes, names, "attribute", "attribute", report, ctx.defaultsFor(element));
|
|
13231
13313
|
},
|
|
13232
13314
|
"attribute-kind": (element, ctx, report) => {
|
|
13233
13315
|
const defaults = ctx.catalogs.defaultAttributes?.[element.definition.type] ?? {};
|
|
@@ -13882,16 +13964,16 @@ var n$1 = (n) => {
|
|
|
13882
13964
|
dark: []
|
|
13883
13965
|
};
|
|
13884
13966
|
return Object.entries(r).forEach(([n, r]) => {
|
|
13885
|
-
switch (n$20(n) ? n : e$
|
|
13886
|
-
case e$
|
|
13967
|
+
switch (n$20(n) ? n : e$28.CUSTOM) {
|
|
13968
|
+
case e$28.COLOR:
|
|
13887
13969
|
Object.keys(r).forEach((e) => {
|
|
13888
13970
|
let t = r[e];
|
|
13889
13971
|
i.default.push(`--${e}:${t.default};`), t.light && i.light.push(`--${e}:${t.light};`), t.dark && i.dark.push(`--${e}:${t.dark};`);
|
|
13890
13972
|
});
|
|
13891
13973
|
break;
|
|
13892
|
-
case e$
|
|
13893
|
-
case e$
|
|
13894
|
-
case e$
|
|
13974
|
+
case e$28.SPACING:
|
|
13975
|
+
case e$28.SHADOW:
|
|
13976
|
+
case e$28.CUSTOM:
|
|
13895
13977
|
default: Object.keys(r).forEach((e) => {
|
|
13896
13978
|
i.default.push(`--${e}:${r[e]};`);
|
|
13897
13979
|
});
|
|
@@ -14006,9 +14088,9 @@ var o$2 = (e, t = ":root", n = 2, r = !0) => {
|
|
|
14006
14088
|
};
|
|
14007
14089
|
//#endregion
|
|
14008
14090
|
//#region ../sdk-style/dist/StyleHelper.mjs
|
|
14009
|
-
var s$1 = Object.fromEntries(e$
|
|
14091
|
+
var s$1 = Object.fromEntries(e$29.map((e) => [e, t$26(e)]));
|
|
14010
14092
|
var c = (e) => {
|
|
14011
|
-
if (t$25(e)) return e$
|
|
14093
|
+
if (t$25(e)) return e$30[e];
|
|
14012
14094
|
let t = e.match(/(\d*\.?\d+)(px|rem)/);
|
|
14013
14095
|
if (!t) return 0;
|
|
14014
14096
|
let r = parseFloat(t[1]);
|
|
@@ -14861,7 +14943,7 @@ var byProperty = (rules) => {
|
|
|
14861
14943
|
return responsive;
|
|
14862
14944
|
};
|
|
14863
14945
|
/** The states a selector can react to — the closed list the style editor offers, read from where it is declared. */
|
|
14864
|
-
var STYLE_STATES = e$
|
|
14946
|
+
var STYLE_STATES = e$25;
|
|
14865
14947
|
var STYLE_STATE_SET = new Set(STYLE_STATES);
|
|
14866
14948
|
var RULE_SET_KEYS = /* @__PURE__ */ new Set([
|
|
14867
14949
|
"css",
|
|
@@ -14937,7 +15019,7 @@ var toPseudos = (pseudos) => {
|
|
|
14937
15019
|
const parts = /* @__PURE__ */ new Map();
|
|
14938
15020
|
for (const [name, spec] of Object.entries(pseudos ?? {})) {
|
|
14939
15021
|
const bare = name.replace(/^:+/, "");
|
|
14940
|
-
if (!n$19(name)) throw new AuthoringError("style-pseudo-unknown", `Unknown pseudo-element "${name}"${n$19(bare) ? ` — write it without the colons, "${bare}"` : didYouMean(bare, e$
|
|
15022
|
+
if (!n$19(name)) throw new AuthoringError("style-pseudo-unknown", `Unknown pseudo-element "${name}"${n$19(bare) ? ` — write it without the colons, "${bare}"` : didYouMean(bare, e$26)}. A class dresses ${e$26.join(", ")}.`);
|
|
14941
15023
|
const part = partOf(spec);
|
|
14942
15024
|
const rules = {
|
|
14943
15025
|
base: toResponsive(part.css),
|
|
@@ -16687,7 +16769,7 @@ var isPlainIcon = ({ attributes }) => !attributes.label && (attributes.size ?? "
|
|
|
16687
16769
|
* its own (a binding, a flow, a condition), an icon that means something (`label`) or is sized or animated, and a
|
|
16688
16770
|
* text that is a drawn shape are left alone, since none of that would move with them.
|
|
16689
16771
|
*
|
|
16690
|
-
* What the `content-attribute` suggestion says, and what `plitzi fix` writes for the moves with no class to carry.
|
|
16772
|
+
* What the `content-attribute` suggestion says, and what `plitzi space fix` writes for the moves with no class to carry.
|
|
16691
16773
|
*/
|
|
16692
16774
|
var contentMoves = (schema, style) => {
|
|
16693
16775
|
const { flat } = schema;
|
|
@@ -17232,7 +17314,7 @@ var suggestCustomCssSlots = (schema) => {
|
|
|
17232
17314
|
*/
|
|
17233
17315
|
var NAME = /[\w-]+/g;
|
|
17234
17316
|
/** Every word the space's documents say outside the declaration being asked about. */
|
|
17235
|
-
var wordsOf = (...texts) => new Set(texts.flatMap((text) => text.match(NAME) ?? []));
|
|
17317
|
+
var wordsOf$1 = (...texts) => new Set(texts.flatMap((text) => text.match(NAME) ?? []));
|
|
17236
17318
|
var TOKEN_USE = /var\(\s*--([\w-]+)/g;
|
|
17237
17319
|
var tokensRead = (...texts) => new Set(texts.flatMap((text) => Array.from(text.matchAll(TOKEN_USE), (match) => match[1])));
|
|
17238
17320
|
var list = (names, limit = 6) => `${names.slice(0, limit).map((name) => `\`${name}\``).join(", ")}${names.length > limit ? `, and ${String(names.length - limit)} more` : ""}`;
|
|
@@ -17244,7 +17326,7 @@ var plural = (count, one, many) => count === 1 ? one : many;
|
|
|
17244
17326
|
var classesOf$1 = (style) => {
|
|
17245
17327
|
const items = Object.values(style.platform).flatMap((byName) => Object.values(byName));
|
|
17246
17328
|
const namedBy = /* @__PURE__ */ new Map();
|
|
17247
|
-
for (const item of items) for (const word of wordsOf(JSON.stringify(item.attributes))) namedBy.set(word, /* @__PURE__ */ new Set([...namedBy.get(word) ?? [], item.name]));
|
|
17329
|
+
for (const item of items) for (const word of wordsOf$1(JSON.stringify(item.attributes))) namedBy.set(word, /* @__PURE__ */ new Set([...namedBy.get(word) ?? [], item.name]));
|
|
17248
17330
|
return {
|
|
17249
17331
|
names: new Set(items.filter((item) => item.type === "class").map((item) => item.name)),
|
|
17250
17332
|
namedBy
|
|
@@ -17253,7 +17335,7 @@ var classesOf$1 = (style) => {
|
|
|
17253
17335
|
var unusedClassNames = (schema, style) => {
|
|
17254
17336
|
const { names, namedBy } = classesOf$1(style);
|
|
17255
17337
|
if (names.size === 0) return [];
|
|
17256
|
-
const schemaWords = wordsOf(JSON.stringify(schema));
|
|
17338
|
+
const schemaWords = wordsOf$1(JSON.stringify(schema));
|
|
17257
17339
|
return [...names].filter((name) => !schemaWords.has(name) && ![...namedBy.get(name) ?? []].some((item) => item !== name)).sort();
|
|
17258
17340
|
};
|
|
17259
17341
|
var unusedClasses = (unused) => {
|
|
@@ -17610,7 +17692,7 @@ var signaturesOf = (flat, declared) => {
|
|
|
17610
17692
|
const wired = /* @__PURE__ */ new Set([
|
|
17611
17693
|
...Object.values(bindings ?? {}).flat().flatMap(({ source }) => own.some((read) => read.source === source) ? [] : [`read:${source}`]),
|
|
17612
17694
|
...Object.values(interactions ?? {}).flatMap((node) => {
|
|
17613
|
-
const key = e$
|
|
17695
|
+
const key = e$32(node.params) ? node.params.key : void 0;
|
|
17614
17696
|
return typeof key === "string" ? [`write:${key}`] : [];
|
|
17615
17697
|
}),
|
|
17616
17698
|
...children.flatMap((child) => child.wiring.split("\n").filter(Boolean))
|
|
@@ -17787,7 +17869,7 @@ var erasedOn = (classes, mode) => {
|
|
|
17787
17869
|
const found = /* @__PURE__ */ new Map();
|
|
17788
17870
|
for (const width of WIDTHS) {
|
|
17789
17871
|
const layers = CASCADE[mode][width];
|
|
17790
|
-
for (const state of [void 0, ...e$
|
|
17872
|
+
for (const state of [void 0, ...e$25]) for (const [longhand, candidates] of candidatesAt(classes, layers, state)) {
|
|
17791
17873
|
const winner = candidates[candidates.length - 1];
|
|
17792
17874
|
if (winner.shorthand === void 0) continue;
|
|
17793
17875
|
for (const lost of candidates) {
|
|
@@ -18217,6 +18299,7 @@ var o$1 = (i, a) => {
|
|
|
18217
18299
|
code: "UNRESOLVED_BINDING_SOURCE",
|
|
18218
18300
|
message: `${f}, but no element answers to the name "${d}"`,
|
|
18219
18301
|
elementId: i.id,
|
|
18302
|
+
missing: d,
|
|
18220
18303
|
details: {
|
|
18221
18304
|
source: o.source,
|
|
18222
18305
|
elementId: d
|
|
@@ -18267,7 +18350,9 @@ var o$1 = (i, a) => {
|
|
|
18267
18350
|
}), a.type === "callback" && a.elementId && !t.has(a.elementId) && s.push({
|
|
18268
18351
|
code: "UNRESOLVED_INTERACTION_TARGET",
|
|
18269
18352
|
message: `Interaction "${a.id}" on element "${n.id}" runs against "${a.elementId}", but no element answers to that name`,
|
|
18270
|
-
elementId: n.id
|
|
18353
|
+
elementId: n.id,
|
|
18354
|
+
missing: a.elementId,
|
|
18355
|
+
wantedBy: a.action
|
|
18271
18356
|
});
|
|
18272
18357
|
let o = a.type === "trigger" && a.action === "onSubmit" && a.enabled ? g(a.elementId ?? n.id) : void 0;
|
|
18273
18358
|
o?.definition.type === "form" && o.attributes.managedByInteractions !== !0 && c.push({
|
|
@@ -18523,6 +18608,17 @@ var declaredAt = (declaration) => {
|
|
|
18523
18608
|
const at = writtenAt(declaration);
|
|
18524
18609
|
return `styles('${declaration.name}')${at === void 0 ? "" : ` at ${at}`}`;
|
|
18525
18610
|
};
|
|
18611
|
+
/**
|
|
18612
|
+
* A component in words, with where it is written: its declaration is an object no factory marks, so it is placed by
|
|
18613
|
+
* its root — the call next to everything else it declares. Read defensively: this names it in the very refusals that
|
|
18614
|
+
* say its shape is wrong.
|
|
18615
|
+
*/
|
|
18616
|
+
var componentWhere = (component) => {
|
|
18617
|
+
const root = component.root;
|
|
18618
|
+
const at = typeof root === "object" && root !== null ? writtenAt(root) : void 0;
|
|
18619
|
+
const id = component.id;
|
|
18620
|
+
return `Component "${String(id)}"${at === void 0 ? "" : ` (declared at ${at}, by its root)`}`;
|
|
18621
|
+
};
|
|
18526
18622
|
/** The types that render their children once per item: everything inside one is repeated, one copy per row. */
|
|
18527
18623
|
var REPEATING_TYPES = /* @__PURE__ */ new Set(["list", "carouselTrack"]);
|
|
18528
18624
|
/**
|
|
@@ -18530,7 +18626,7 @@ var REPEATING_TYPES = /* @__PURE__ */ new Set(["list", "carouselTrack"]);
|
|
|
18530
18626
|
* one that does — `"store-footer" › container[1] › text[0]` rather than a path of indices from the page down.
|
|
18531
18627
|
*/
|
|
18532
18628
|
var placeOf = (spec, parent, index) => {
|
|
18533
|
-
const record = e$
|
|
18629
|
+
const record = e$32(spec) ? spec : {};
|
|
18534
18630
|
if (typeof record.id === "string") return `"${record.id}"`;
|
|
18535
18631
|
return index === void 0 ? parent : `${parent} › ${typeof record.type === "string" ? record.type : "element"}[${index}]`;
|
|
18536
18632
|
};
|
|
@@ -18558,6 +18654,20 @@ var withCache = (item) => {
|
|
|
18558
18654
|
return complete;
|
|
18559
18655
|
};
|
|
18560
18656
|
/** The two attributes a page or a layout names its shell with. */
|
|
18657
|
+
/**
|
|
18658
|
+
* A page's attributes that are one field of its `PageSpec` each, by attribute name: the page writes `seoTitle` and the
|
|
18659
|
+
* document reads `seoPageTitle`. What an edit of a page's attribute writes in the code. Its layout is not here — two
|
|
18660
|
+
* attributes from one field (`layout: { id, slot }`) — nor `seoEnabled`, which follows from the other two.
|
|
18661
|
+
*/
|
|
18662
|
+
var PAGE_SPEC_FIELDS = {
|
|
18663
|
+
slug: "slug",
|
|
18664
|
+
name: "name",
|
|
18665
|
+
default: "isDefault",
|
|
18666
|
+
folder: "folder",
|
|
18667
|
+
accessLevel: "accessLevel",
|
|
18668
|
+
seoPageTitle: "seoTitle",
|
|
18669
|
+
seoPageDescription: "seoDescription"
|
|
18670
|
+
};
|
|
18561
18671
|
var layoutAttributes = (layout) => layout ? {
|
|
18562
18672
|
layout: layout.id,
|
|
18563
18673
|
layoutContainer: layout.slot
|
|
@@ -18598,6 +18708,8 @@ var SpaceAuthor = class {
|
|
|
18598
18708
|
classOrigins = /* @__PURE__ */ new Map();
|
|
18599
18709
|
/** Where each class's rules were written, in words — what `class-overrides-class` names it by. */
|
|
18600
18710
|
classWritten = /* @__PURE__ */ new Map();
|
|
18711
|
+
/** Each class written with `styles()`, by name: the declaration, which knows the line of the author's that wrote it. */
|
|
18712
|
+
classDeclarations = /* @__PURE__ */ new Map();
|
|
18601
18713
|
/** Each element's own rules on top of its classes (`<id>--own`), and where they were written. */
|
|
18602
18714
|
ownRules = /* @__PURE__ */ new Map();
|
|
18603
18715
|
/** Every element's own selector, named or derived — each one is that element's alone. */
|
|
@@ -18624,18 +18736,29 @@ var SpaceAuthor = class {
|
|
|
18624
18736
|
}
|
|
18625
18737
|
author() {
|
|
18626
18738
|
const { schema, style } = this.write();
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18739
|
+
const allow = this.options.allow ?? [];
|
|
18740
|
+
const answering = this.options.vocabulary?.callbacks;
|
|
18741
|
+
const meant = (missing, step) => {
|
|
18742
|
+
const elements = Object.values(schema.flat);
|
|
18743
|
+
const fit = step && answering ? elements.filter((element) => Object.hasOwn(answering, element.definition.type) && answering[element.definition.type].includes(step)).map((element) => element.id) : elements.map((element) => element.id);
|
|
18744
|
+
const nearest = didYouMean(missing, fit);
|
|
18745
|
+
if (nearest || !step || !answering) return nearest;
|
|
18746
|
+
return fit.length === 0 ? ` — no element of the space answers \`${step}\`` : fit.length <= 5 ? ` — the elements that answer \`${step}\`: ${fit.join(", ")}` : "";
|
|
18747
|
+
};
|
|
18748
|
+
const gate = validateSpace$1({
|
|
18749
|
+
schema,
|
|
18750
|
+
style
|
|
18751
|
+
}, this.options).errors.filter((error) => !allow.some((entry) => entry.code === error.code && entry.element === error.elementId)).map((error) => {
|
|
18752
|
+
const written = error.elementId ? this.specOf(error.elementId) : void 0;
|
|
18753
|
+
const at = written ? writtenAt(written) : void 0;
|
|
18754
|
+
return {
|
|
18634
18755
|
place: error.elementId ? `"${error.elementId}"` : "",
|
|
18635
18756
|
code: error.code,
|
|
18636
|
-
message: error.message
|
|
18637
|
-
|
|
18638
|
-
|
|
18757
|
+
message: `${error.message}${error.missing ? meant(error.missing, error.wantedBy) : ""}`,
|
|
18758
|
+
...at === void 0 ? {} : { at }
|
|
18759
|
+
};
|
|
18760
|
+
});
|
|
18761
|
+
if (this.refusals.length > 0 || gate.length > 0) throw new SpaceRefusedError(this.spec.permanentUrl, [...this.refusals, ...gate]);
|
|
18639
18762
|
const warnings = assertSpaceValid({
|
|
18640
18763
|
schema,
|
|
18641
18764
|
style
|
|
@@ -18701,6 +18824,10 @@ var SpaceAuthor = class {
|
|
|
18701
18824
|
})), mode);
|
|
18702
18825
|
}
|
|
18703
18826
|
/** The spec an element was written from, by its id in the documents. */
|
|
18827
|
+
/** Every class the space declares, by name, with the `styles()` declaration that wrote it when one did. */
|
|
18828
|
+
declaredClasses() {
|
|
18829
|
+
return [...this.classRules.keys()].map((name) => [name, this.classDeclarations.get(name)]);
|
|
18830
|
+
}
|
|
18704
18831
|
specOf(id) {
|
|
18705
18832
|
return this.specs.get(id);
|
|
18706
18833
|
}
|
|
@@ -18718,7 +18845,7 @@ var SpaceAuthor = class {
|
|
|
18718
18845
|
continue;
|
|
18719
18846
|
}
|
|
18720
18847
|
if (value.name !== name) throw new AuthoringError("class-listed-under-other-name", `The space-wide \`classes\` lists the declaration "${value.name}" under the name "${name}". A declaration is listed under its own name.`);
|
|
18721
|
-
this.declareClass(name, value.rules, () => `${declaredAt(value)}, listed in the space-wide \`classes\``, () => declaredAt(value));
|
|
18848
|
+
this.declareClass(name, value.rules, () => `${declaredAt(value)}, listed in the space-wide \`classes\``, () => declaredAt(value), value);
|
|
18722
18849
|
}
|
|
18723
18850
|
const layouts = this.spec.layouts ?? [];
|
|
18724
18851
|
const components = this.spec.components ?? [];
|
|
@@ -18766,9 +18893,9 @@ var SpaceAuthor = class {
|
|
|
18766
18893
|
this.resolveControls();
|
|
18767
18894
|
if (pages.length === 0) throw new AuthoringError("no-pages", "The space has no pages. Write at least one: `pages: [{ id: \"home\", name: \"Home\", slug: \"\", body: [] }]`.");
|
|
18768
18895
|
const style = {
|
|
18769
|
-
...e$
|
|
18770
|
-
mode: this.spec.mode ?? e$
|
|
18771
|
-
theme: this.spec.theme ?? e$
|
|
18896
|
+
...e$34,
|
|
18897
|
+
mode: this.spec.mode ?? e$34.mode,
|
|
18898
|
+
theme: this.spec.theme ?? e$34.theme,
|
|
18772
18899
|
platform: this.platform,
|
|
18773
18900
|
variables: this.spec.variables ?? {},
|
|
18774
18901
|
...this.spec.fonts ? { fonts: this.parseFonts(this.spec.fonts) } : {},
|
|
@@ -18874,12 +19001,13 @@ var SpaceAuthor = class {
|
|
|
18874
19001
|
* `origin` says where, and is only asked for when there is a conflict to report: reading where an element was written
|
|
18875
19002
|
* means formatting a stack, which every element of every space would otherwise pay for on every write.
|
|
18876
19003
|
*/
|
|
18877
|
-
declareClass(name, blocks, origin, written) {
|
|
19004
|
+
declareClass(name, blocks, origin, written, declaration) {
|
|
18878
19005
|
const existing = this.classRules.get(name);
|
|
18879
19006
|
if (!existing) {
|
|
18880
19007
|
this.classRules.set(name, blocks);
|
|
18881
19008
|
this.classOrigins.set(name, origin);
|
|
18882
19009
|
this.classWritten.set(name, written);
|
|
19010
|
+
if (declaration) this.classDeclarations.set(name, declaration);
|
|
18883
19011
|
return;
|
|
18884
19012
|
}
|
|
18885
19013
|
if (!sameBlocks(existing, blocks)) throw new AuthoringError("class-conflict", `The class "${name}" is declared twice with different rules: ${this.classOrigins.get(name)?.() ?? "once before"}, and ${origin()}. A class is one rule set per space: rename one of them, or make them agree.`);
|
|
@@ -18892,7 +19020,7 @@ var SpaceAuthor = class {
|
|
|
18892
19020
|
*/
|
|
18893
19021
|
collectDeclarations(rootClass, body, rootWhere) {
|
|
18894
19022
|
const collect = (value, usedBy) => {
|
|
18895
|
-
for (const ref of value ? classRefs(value) : []) if (typeof ref !== "string") this.declareClass(ref.name, ref.rules, () => `${declaredAt(ref)}, used by ${usedBy()}`, () => declaredAt(ref));
|
|
19023
|
+
for (const ref of value ? classRefs(value) : []) if (typeof ref !== "string") this.declareClass(ref.name, ref.rules, () => `${declaredAt(ref)}, used by ${usedBy()}`, () => declaredAt(ref), ref);
|
|
18896
19024
|
};
|
|
18897
19025
|
const walk = (spec) => {
|
|
18898
19026
|
const element = () => {
|
|
@@ -19135,15 +19263,18 @@ var SpaceAuthor = class {
|
|
|
19135
19263
|
}
|
|
19136
19264
|
const componentIds = /* @__PURE__ */ new Set();
|
|
19137
19265
|
for (const component of this.spec.components ?? []) {
|
|
19138
|
-
const where =
|
|
19266
|
+
const where = componentWhere(component);
|
|
19139
19267
|
assertKnownKeys(component, COMPONENT_SPEC_KEYS, where);
|
|
19140
19268
|
const id = component.id;
|
|
19141
19269
|
if (typeof id !== "string" || !t$28(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)}')\`.`);
|
|
19142
19270
|
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.`);
|
|
19143
19271
|
componentIds.add(component.id);
|
|
19144
|
-
for (const name of Object.
|
|
19272
|
+
for (const [name, prop] of Object.entries(component.props ?? {})) {
|
|
19145
19273
|
const problem = c$8(name);
|
|
19146
19274
|
if (problem) throw new AuthoringError("prop-name", `${where}: ${problem}.`);
|
|
19275
|
+
const types = t$62;
|
|
19276
|
+
const type = prop.type;
|
|
19277
|
+
if (!types.includes(type)) throw new AuthoringError("prop-type-unknown", `${where} declares the prop "${name}" as \`${type}\`, which is no type${didYouMean(type, [...types]) || "."} A prop is one of ${types.join(", ")}: words are \`text\`.`);
|
|
19147
19278
|
}
|
|
19148
19279
|
}
|
|
19149
19280
|
for (const page of this.spec.pages) {
|
|
@@ -19380,7 +19511,7 @@ var SpaceAuthor = class {
|
|
|
19380
19511
|
* that tree — every slot one of its elements.
|
|
19381
19512
|
*/
|
|
19382
19513
|
addComponent(component) {
|
|
19383
|
-
const where =
|
|
19514
|
+
const where = componentWhere(component);
|
|
19384
19515
|
const tree = this.componentTrees.get(component.id);
|
|
19385
19516
|
if (!tree) throw new Error(`${where} was not collected before it was written`);
|
|
19386
19517
|
const rootId = this.addElement(component.root, `${this.spec.permanentUrl}/component:${component.id}`, placeOf(component.root, `Component "${component.id}"`), "", "", false, tree);
|
|
@@ -19411,7 +19542,7 @@ var SpaceAuthor = class {
|
|
|
19411
19542
|
for (const name of Object.keys(given)) if (!names.includes(name)) throw new AuthoringError("prop-unknown", `${where} hands component "${target.id}" "${name}", which it does not declare${didYouMean(name, names) || "."} It declares ${names.length > 0 ? names.join(", ") : "no props"}.`);
|
|
19412
19543
|
const bound = new Set(spec.bind === void 0 ? [] : toBindingSpecs(spec.bind).map((binding) => binding.to));
|
|
19413
19544
|
for (const [name, prop] of Object.entries(props)) if (prop.required && given[name] === void 0 && !bound.has(name)) throw new AuthoringError("prop-missing", `${where} places component "${target.id}" without "${name}", which it requires${prop.description ? ` — ${prop.description}` : ""}. Hand it in: \`component('${target.id}', { props: { ${name}: … } })\`, or bind it.`);
|
|
19414
|
-
const invalid =
|
|
19545
|
+
const invalid = s$22(given, given, props).at(0);
|
|
19415
19546
|
if (invalid) throw new AuthoringError("prop-value", `${where} hands component "${target.id}" "${invalid.key}" as ${invalid.got}, and it is declared ${invalid.expected}${invalid.options ? ` — one of ${invalid.options.map((option) => `'${option}'`).join(", ")}` : ""}.`);
|
|
19416
19547
|
const slots = target.slots ?? [];
|
|
19417
19548
|
for (const child of spec.children ?? []) {
|
|
@@ -19619,12 +19750,14 @@ var SpaceAuthor = class {
|
|
|
19619
19750
|
return formats[as];
|
|
19620
19751
|
}
|
|
19621
19752
|
/**
|
|
19622
|
-
* `path` is
|
|
19623
|
-
*
|
|
19753
|
+
* `path` is where its parent placed it; its identity — what a selector of its own and its bindings are named after —
|
|
19754
|
+
* is that place with its id in its position, so it never changes when its siblings move. `place` is how a person
|
|
19755
|
+
* finds it: the nearest named element, and the steps from there.
|
|
19624
19756
|
*/
|
|
19625
19757
|
writeElement(spec, path, place, rootId, parentId, insideCondition, tree) {
|
|
19626
19758
|
this.assertElementShape(spec, place);
|
|
19627
19759
|
const id = spec.id ?? this.nextId(spec.type);
|
|
19760
|
+
const identity = `${path.slice(0, path.lastIndexOf("/"))}/#${id}`;
|
|
19628
19761
|
this.specs.set(id, spec);
|
|
19629
19762
|
const where = `Element "${spec.type}" (${id}) at ${place}`;
|
|
19630
19763
|
this.assertFlowShapes(spec.flows, where);
|
|
@@ -19650,7 +19783,7 @@ var SpaceAuthor = class {
|
|
|
19650
19783
|
...isRoot ? {} : { parentId },
|
|
19651
19784
|
items: [],
|
|
19652
19785
|
styleSelectors: {
|
|
19653
|
-
base: this.selectorFor(
|
|
19786
|
+
base: this.selectorFor(identity, spec, place),
|
|
19654
19787
|
...this.declaredSlots(spec.type),
|
|
19655
19788
|
...this.slotSelectors(spec, place)
|
|
19656
19789
|
},
|
|
@@ -19677,7 +19810,7 @@ var SpaceAuthor = class {
|
|
|
19677
19810
|
...spec.motion === void 0 ? {} : { motion: spec.motion },
|
|
19678
19811
|
...spec.quiet === void 0 ? {} : { quiet: [...spec.quiet] },
|
|
19679
19812
|
...spec.flag === void 0 ? {} : { flag: flagGateOf(spec.flag, where) },
|
|
19680
|
-
...bindings?.length ? { bindings: groupBindings(
|
|
19813
|
+
...bindings?.length ? { bindings: groupBindings(identity, bindings, sourceIndex, where, tree.globals) } : {},
|
|
19681
19814
|
...spec.flows ? { interactions: authorFlows(spec.flows, id) } : {}
|
|
19682
19815
|
}
|
|
19683
19816
|
};
|
|
@@ -19693,7 +19826,7 @@ var SpaceAuthor = class {
|
|
|
19693
19826
|
...[...ancestors].some((ancestor) => REPEATING_TYPES.has(tree.map.flat[ancestor].definition.type)) ? { repeated: true } : {},
|
|
19694
19827
|
...a$7(element) || this.drawsNothing(element) ? { boxless: true } : {}
|
|
19695
19828
|
});
|
|
19696
|
-
(spec.row === void 0 ? spec.children : this.rowChildren(spec, spec.row, id, where))?.forEach((child, index) => this.addElement(child, `${
|
|
19829
|
+
(spec.row === void 0 ? spec.children : this.rowChildren(spec, spec.row, id, where))?.forEach((child, index) => this.addElement(child, `${identity}/${index}`, placeOf(child, place, index), ownRootId, id, conditional, tree));
|
|
19697
19830
|
return id;
|
|
19698
19831
|
}
|
|
19699
19832
|
/** A `row` placed: a list's IS its children; a carousel's goes in a track, beside the controls it was given. */
|
|
@@ -19760,7 +19893,7 @@ var specEditOf = (change, spec) => {
|
|
|
19760
19893
|
};
|
|
19761
19894
|
/**
|
|
19762
19895
|
* What `fixSpace` would settle in this declaration, each with the place in the author's own code that wrote it and
|
|
19763
|
-
* the edit that makes the same fix there — what `plitzi fix` shows, and writes when asked — beside every problem the
|
|
19896
|
+
* the edit that makes the same fix there — what `plitzi space fix` shows, and writes when asked — beside every problem the
|
|
19764
19897
|
* linter reports, which a written fix must not add to. The documents are written as `authorSpace` writes them,
|
|
19765
19898
|
* without its gate: the problems a fix settles are the ones the gate stops on.
|
|
19766
19899
|
*/
|
|
@@ -19790,6 +19923,95 @@ var planFixes$1 = (spec, options = {}) => {
|
|
|
19790
19923
|
}), ...contentFixes(author, documents)]
|
|
19791
19924
|
};
|
|
19792
19925
|
};
|
|
19926
|
+
/** The attributes that are words a person reads or hears, whatever the element. */
|
|
19927
|
+
var SAID_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
19928
|
+
"content",
|
|
19929
|
+
"label",
|
|
19930
|
+
"title",
|
|
19931
|
+
"alt",
|
|
19932
|
+
"placeholder"
|
|
19933
|
+
]);
|
|
19934
|
+
/** What places a component, never what it hands it: the rest of an instance's attributes are the component's props. */
|
|
19935
|
+
var PLACING_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
19936
|
+
"referenceType",
|
|
19937
|
+
"referenceId",
|
|
19938
|
+
"slot"
|
|
19939
|
+
]);
|
|
19940
|
+
/** Every string a list's data holds, a few levels deep: the words its rows show come from there. */
|
|
19941
|
+
var dataWords = (value, depth = 0) => {
|
|
19942
|
+
if (depth > 4) return [];
|
|
19943
|
+
if (typeof value === "string") return value === "" ? [] : [value];
|
|
19944
|
+
if (Array.isArray(value)) return value.flatMap((item) => dataWords(item, depth + 1));
|
|
19945
|
+
return e$32(value) ? Object.values(value).flatMap((item) => dataWords(item, depth + 1)) : [];
|
|
19946
|
+
};
|
|
19947
|
+
var wordsOf = (element, templates) => {
|
|
19948
|
+
const instance = element.definition.type === "reference" && element.attributes.referenceType === "component";
|
|
19949
|
+
return [
|
|
19950
|
+
...Object.entries(element.attributes).flatMap(([key, value]) => typeof value === "string" && value !== "" && (SAID_ATTRIBUTES.has(key) || instance && !PLACING_ATTRIBUTES.has(key)) ? [value] : []),
|
|
19951
|
+
...templates,
|
|
19952
|
+
...dataWords(element.attributes.items)
|
|
19953
|
+
];
|
|
19954
|
+
};
|
|
19955
|
+
/**
|
|
19956
|
+
* Every element the space authors to, with where it was written — read from the code as it is NOW, so it follows an
|
|
19957
|
+
* element wherever a person moved it, with nothing kept that could fall out of step. What `plitzi element where` answers.
|
|
19958
|
+
*/
|
|
19959
|
+
var locateElements$1 = (spec, options = {}) => {
|
|
19960
|
+
const author = new SpaceAuthor(spec, options);
|
|
19961
|
+
const { schema } = author.write();
|
|
19962
|
+
return [...Object.values(schema.flat).map((element) => ({
|
|
19963
|
+
element,
|
|
19964
|
+
rootId: element.definition.rootId
|
|
19965
|
+
})), ...Object.entries(schema.components).flatMap(([componentId, component]) => Object.values(component.flat).map((element) => ({
|
|
19966
|
+
element,
|
|
19967
|
+
rootId: componentId
|
|
19968
|
+
})))].map(({ element, rootId }) => {
|
|
19969
|
+
const written = author.specOf(element.id);
|
|
19970
|
+
const calls = written ? writtenCalls(written) : [];
|
|
19971
|
+
const position = calls.at(0);
|
|
19972
|
+
const content = element.attributes.content;
|
|
19973
|
+
const templates = Object.values(element.definition.bindings ?? {}).flatMap((bindings) => bindings.flatMap((binding) => (binding.transformers ?? []).flatMap((transformer) => Object.values(transformer.params).filter((param) => typeof param === "string"))));
|
|
19974
|
+
return {
|
|
19975
|
+
elementId: element.id,
|
|
19976
|
+
type: element.definition.type,
|
|
19977
|
+
rootId,
|
|
19978
|
+
classes: element.definition.styleSelectors.base.split(/\s+/).filter(Boolean),
|
|
19979
|
+
...typeof content === "string" && content !== "" ? { content } : {},
|
|
19980
|
+
templates,
|
|
19981
|
+
words: wordsOf(element, templates),
|
|
19982
|
+
attributes: element.attributes,
|
|
19983
|
+
children: element.definition.items ?? [],
|
|
19984
|
+
targets: Object.values(element.definition.interactions ?? {}).flatMap((node) => node.type === "callback" && node.elementId !== null && node.elementId !== element.id ? [{
|
|
19985
|
+
elementId: node.elementId,
|
|
19986
|
+
step: node.action
|
|
19987
|
+
}] : []),
|
|
19988
|
+
bound: (element.definition.bindings?.attributes ?? []).map((binding) => binding.to),
|
|
19989
|
+
through: calls.slice(1),
|
|
19990
|
+
...position ? {
|
|
19991
|
+
at: `${position.file}:${String(position.line)}`,
|
|
19992
|
+
position
|
|
19993
|
+
} : {}
|
|
19994
|
+
};
|
|
19995
|
+
});
|
|
19996
|
+
};
|
|
19997
|
+
/**
|
|
19998
|
+
* Every class the space declares, with the `styles()` call that wrote it — read from the code as it is now, as
|
|
19999
|
+
* `locateElements` reads the elements. What `plitzi element where` answers of a class: who wears it, and where it is written.
|
|
20000
|
+
*/
|
|
20001
|
+
var locateClasses$1 = (spec, options = {}) => {
|
|
20002
|
+
const author = new SpaceAuthor(spec, options);
|
|
20003
|
+
author.write();
|
|
20004
|
+
return author.declaredClasses().map(([name, declaration]) => {
|
|
20005
|
+
const position = declaration ? writtenAtPosition(declaration) : void 0;
|
|
20006
|
+
return {
|
|
20007
|
+
name,
|
|
20008
|
+
...position ? {
|
|
20009
|
+
at: `${position.file}:${String(position.line)}`,
|
|
20010
|
+
position
|
|
20011
|
+
} : {}
|
|
20012
|
+
};
|
|
20013
|
+
});
|
|
20014
|
+
};
|
|
19793
20015
|
/**
|
|
19794
20016
|
* The `content-attribute` suggestions that have one way to be written: the children only words and an icon, none of
|
|
19795
20017
|
* 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
|
|
@@ -20200,7 +20422,7 @@ var transformerCatalog = () => Object.entries(BUILTIN_TRANSFORMERS).map(([action
|
|
|
20200
20422
|
/** The space's name and URL, where the document carries them. An older export carries no definition at all. */
|
|
20201
20423
|
var definitionOf = (schema) => {
|
|
20202
20424
|
const definition = schema.definition;
|
|
20203
|
-
if (!e$
|
|
20425
|
+
if (!e$32(definition)) return {};
|
|
20204
20426
|
return {
|
|
20205
20427
|
...typeof definition.name === "string" ? { name: definition.name } : {},
|
|
20206
20428
|
...typeof definition.permanentUrl === "string" ? { permanentUrl: definition.permanentUrl } : {}
|
|
@@ -20214,7 +20436,7 @@ var categoryOf = (variable) => {
|
|
|
20214
20436
|
/** The name an element carried beside its id before the id became the name, where it carries a usable one. */
|
|
20215
20437
|
var idRefOf = (element) => {
|
|
20216
20438
|
const stored = element;
|
|
20217
|
-
if (!e$
|
|
20439
|
+
if (!e$32(stored) || typeof stored.idRef !== "string" || !t$28(stored.idRef)) return;
|
|
20218
20440
|
return stored.idRef;
|
|
20219
20441
|
};
|
|
20220
20442
|
/**
|
|
@@ -20315,7 +20537,7 @@ var refuse = (reason) => {
|
|
|
20315
20537
|
throw new Unreadable(reason);
|
|
20316
20538
|
};
|
|
20317
20539
|
var isTriggerType = (value) => TRIGGER_TYPES.some((type) => type === value);
|
|
20318
|
-
var isNode = (value) => e$
|
|
20540
|
+
var isNode = (value) => e$32(value) && [
|
|
20319
20541
|
"id",
|
|
20320
20542
|
"title",
|
|
20321
20543
|
"type",
|
|
@@ -20323,10 +20545,10 @@ var isNode = (value) => e$31(value) && [
|
|
|
20323
20545
|
"beforeNode",
|
|
20324
20546
|
"afterNode",
|
|
20325
20547
|
"flowId"
|
|
20326
|
-
].every((key) => typeof value[key] === "string") && typeof value.enabled === "boolean" && e$
|
|
20548
|
+
].every((key) => typeof value[key] === "string") && typeof value.enabled === "boolean" && e$32(value.params) && e$32(value.preview);
|
|
20327
20549
|
/** A document with the shape an action has: whether it is the action code writes is what the round trip answers. */
|
|
20328
|
-
var isDocument = (value) => e$
|
|
20329
|
-
var isField = (value) => e$
|
|
20550
|
+
var isDocument = (value) => e$32(value) && typeof value.name === "string" && e$32(value.nodes) && Object.values(value.nodes).every(isNode);
|
|
20551
|
+
var isField = (value) => e$32(value) && FIELD_TYPES.some((type) => type === value.type);
|
|
20330
20552
|
var text = (params, key) => {
|
|
20331
20553
|
const value = params[key];
|
|
20332
20554
|
return typeof value === "string" ? value : void 0;
|
|
@@ -20343,7 +20565,7 @@ var inputOf = (node) => {
|
|
|
20343
20565
|
const raw = text(node.params, "input");
|
|
20344
20566
|
if (raw === void 0) return;
|
|
20345
20567
|
const value = parsed(raw);
|
|
20346
|
-
if (!e$
|
|
20568
|
+
if (!e$32(value) || !Object.values(value).every(isField)) return refuse(`the trigger "${node.id}" declares an input that is not a map of fields`);
|
|
20347
20569
|
return Object.fromEntries(Object.entries(value).filter((entry) => isField(entry[1])));
|
|
20348
20570
|
};
|
|
20349
20571
|
var accessOf = (node) => {
|
|
@@ -20456,7 +20678,7 @@ var chainFrom = (nodes, first) => {
|
|
|
20456
20678
|
/** A value with its keys in one order and its JSON params read, so two documents compare by what they hold. */
|
|
20457
20679
|
var comparable = (value) => {
|
|
20458
20680
|
if (Array.isArray(value)) return value.map(comparable);
|
|
20459
|
-
if (!e$
|
|
20681
|
+
if (!e$32(value)) return value;
|
|
20460
20682
|
return Object.fromEntries(Object.keys(value).filter((key) => value[key] !== void 0).sort().map((key) => {
|
|
20461
20683
|
const inner = value[key];
|
|
20462
20684
|
return [key, key === "input" && typeof inner === "string" ? parsed(inner) ?? inner : comparable(inner)];
|
|
@@ -20556,8 +20778,8 @@ var actionToSource = (spec, { packageName = "@plitzi/sdk-authoring" } = {}) => {
|
|
|
20556
20778
|
var canonical = (value) => {
|
|
20557
20779
|
if (value === void 0 || value === null) return null;
|
|
20558
20780
|
if (Array.isArray(value)) return value.map(canonical);
|
|
20559
|
-
if (e$
|
|
20560
|
-
const entries = Object.entries(value).map(([key, inner]) => [key, canonical(inner)]).filter(([, inner]) => inner !== null && !(e$
|
|
20781
|
+
if (e$32(value)) {
|
|
20782
|
+
const entries = Object.entries(value).map(([key, inner]) => [key, canonical(inner)]).filter(([, inner]) => inner !== null && !(e$32(inner) && Object.keys(inner).length === 0)).sort(([a], [b]) => a.localeCompare(b));
|
|
20561
20783
|
return Object.fromEntries(entries);
|
|
20562
20784
|
}
|
|
20563
20785
|
if (typeof value === "boolean" || typeof value === "number" || typeof value === "string") return value;
|
|
@@ -20646,12 +20868,12 @@ var classRules = (style, name) => {
|
|
|
20646
20868
|
};
|
|
20647
20869
|
var bindingsOf$1 = (element) => {
|
|
20648
20870
|
const stored = element.definition.bindings;
|
|
20649
|
-
if (!e$
|
|
20650
|
-
return Object.fromEntries(Object.entries(stored).map(([category, list]) => [category, (Array.isArray(list) ? list : []).filter(e$
|
|
20871
|
+
if (!e$32(stored)) return {};
|
|
20872
|
+
return Object.fromEntries(Object.entries(stored).map(([category, list]) => [category, (Array.isArray(list) ? list : []).filter(e$32).map((binding) => ({
|
|
20651
20873
|
source: binding.source,
|
|
20652
20874
|
to: binding.to,
|
|
20653
20875
|
transformers: Array.isArray(binding.transformers) ? binding.transformers : [],
|
|
20654
|
-
when: e$
|
|
20876
|
+
when: e$32(binding.when) && Array.isArray(binding.when.rules) && binding.when.rules.length > 0 ? binding.when : null,
|
|
20655
20877
|
enabled: binding.enabled !== false
|
|
20656
20878
|
})).map((binding) => JSON.stringify(canonical(binding))).sort()]));
|
|
20657
20879
|
};
|
|
@@ -20670,7 +20892,7 @@ var flowsOf = (element) => {
|
|
|
20670
20892
|
params: current.params,
|
|
20671
20893
|
preview: current.preview,
|
|
20672
20894
|
elementId: current.elementId === element.id ? "self" : current.elementId || null,
|
|
20673
|
-
when: e$
|
|
20895
|
+
when: e$32(current.when) && Array.isArray(current.when.rules) && current.when.rules.length > 0 ? current.when : null,
|
|
20674
20896
|
enabled: current.enabled,
|
|
20675
20897
|
whileRunning: current.whileRunning ?? "skip"
|
|
20676
20898
|
});
|
|
@@ -20694,7 +20916,7 @@ var PAGE_UNSET = {
|
|
|
20694
20916
|
var attributesOf = (element) => {
|
|
20695
20917
|
const isPage = element.definition.type === "page";
|
|
20696
20918
|
const defaults = isPage ? {} : defaultAttributes(element.definition.type);
|
|
20697
|
-
const stored = Object.entries(e$
|
|
20919
|
+
const stored = Object.entries(e$32(element.attributes) ? element.attributes : {}).filter(([key, value]) => value !== null && !(Array.isArray(value) && value.length === 0 && e$32(defaults[key])));
|
|
20698
20920
|
return Object.fromEntries(Object.entries({
|
|
20699
20921
|
...defaults,
|
|
20700
20922
|
...Object.fromEntries(stored)
|
|
@@ -21145,7 +21367,7 @@ var unwritableCss = (selector, unwritable, mode) => {
|
|
|
21145
21367
|
platform[breakpoint][selector.name] = item;
|
|
21146
21368
|
}
|
|
21147
21369
|
return l({
|
|
21148
|
-
...e$
|
|
21370
|
+
...e$34,
|
|
21149
21371
|
mode,
|
|
21150
21372
|
platform,
|
|
21151
21373
|
variables: {}
|
|
@@ -21268,9 +21490,9 @@ var BINDING_CATEGORIES = [
|
|
|
21268
21490
|
"style"
|
|
21269
21491
|
];
|
|
21270
21492
|
var isEmpty = (value) => !value || Object.keys(value).length === 0;
|
|
21271
|
-
var isBinding = (value) => e$
|
|
21493
|
+
var isBinding = (value) => e$32(value) && typeof value.source === "string" && typeof value.to === "string";
|
|
21272
21494
|
/** A condition worth keeping: the builder stores "no condition" as an empty group, or as an empty array. */
|
|
21273
|
-
var conditionOf = (when) => e$
|
|
21495
|
+
var conditionOf = (when) => e$32(when) && Array.isArray(when.rules) && when.rules.length > 0 ? when : void 0;
|
|
21274
21496
|
/**
|
|
21275
21497
|
* Every name a document mentions outside its own structure — in attributes, bindings, steps and settings.
|
|
21276
21498
|
*
|
|
@@ -21293,7 +21515,7 @@ var stepCorpus = (host, interactions) => Object.values(interactions).map((node)
|
|
|
21293
21515
|
...node.elementId && node.elementId !== host ? { elementId: node.elementId } : {}
|
|
21294
21516
|
}));
|
|
21295
21517
|
var bindingsOf = (bindings, category) => {
|
|
21296
|
-
const list = e$
|
|
21518
|
+
const list = e$32(bindings) ? bindings[category] : void 0;
|
|
21297
21519
|
return Array.isArray(list) ? list.filter(isBinding) : [];
|
|
21298
21520
|
};
|
|
21299
21521
|
var bindingCorpus = (bindings) => BINDING_CATEGORIES.flatMap((category) => bindingsOf(bindings, category).map(({ source, to, transformers, when }) => ({
|
|
@@ -21892,7 +22114,7 @@ var SpecReader = class {
|
|
|
21892
22114
|
}
|
|
21893
22115
|
readPage(page, index) {
|
|
21894
22116
|
this.reachable.add(page.id);
|
|
21895
|
-
const attributes = e$
|
|
22117
|
+
const attributes = e$32(page.attributes) ? page.attributes : {};
|
|
21896
22118
|
const where = `Page "${page.id}"`;
|
|
21897
22119
|
for (const key of Object.keys(attributes)) if (!PAGE_ATTRIBUTES.has(key)) this.dropField(`page attribute "${key}"`);
|
|
21898
22120
|
if (attributes.enabled === false) this.correct("dropped-field", `${where} was disabled, which an authored page cannot say; it is authored enabled.`, page.id);
|
|
@@ -21958,7 +22180,7 @@ var SpecReader = class {
|
|
|
21958
22180
|
const definition = element.definition;
|
|
21959
22181
|
for (const key of Object.keys(definition)) if (!DEFINITION_FIELDS.has(key)) this.dropField(`"${key}"`);
|
|
21960
22182
|
const { type, legacy } = this.typeOf(element);
|
|
21961
|
-
const stored = e$
|
|
22183
|
+
const stored = e$32(element.attributes) ? element.attributes : {};
|
|
21962
22184
|
const attributes = this.readAttributes(type, legacy ? legacy.attributes(stored) : stored, this.placedNames(element));
|
|
21963
22185
|
const keepId = this.options.keepIds === true || !this.derived.has(element.id);
|
|
21964
22186
|
const { base: baseSelector, ...slotSelectors } = definition.styleSelectors;
|
|
@@ -22030,7 +22252,7 @@ var SpecReader = class {
|
|
|
22030
22252
|
this.droppedAttributes.set(key, (this.droppedAttributes.get(key) ?? 0) + 1);
|
|
22031
22253
|
continue;
|
|
22032
22254
|
}
|
|
22033
|
-
const emptyList = Array.isArray(value) && value.length === 0 && e$
|
|
22255
|
+
const emptyList = Array.isArray(value) && value.length === 0 && e$32(defaults[name]);
|
|
22034
22256
|
if (value === null || emptyList) continue;
|
|
22035
22257
|
if (typeof value === "string" && fixes && Object.hasOwn(fixes, name) && Object.hasOwn(fixes[name], value)) {
|
|
22036
22258
|
const fixed = fixes[name][value];
|
|
@@ -22662,6 +22884,7 @@ var specToSource = (spec, options) => new SourceWriter(spec, options).write();
|
|
|
22662
22884
|
*/
|
|
22663
22885
|
var BUILDER_SIGNATURES = {
|
|
22664
22886
|
delay: "delay(ms)",
|
|
22887
|
+
copyToClipboard: "copyToClipboard('{{ navigation.href }}')",
|
|
22665
22888
|
authLogout: "authLogout()",
|
|
22666
22889
|
authRefreshDetails: "authRefreshDetails()",
|
|
22667
22890
|
on: "on('onArrival', params?)",
|
|
@@ -22774,7 +22997,7 @@ var fromSpec = (spec) => Object.entries(spec).map(([name, param]) => ({
|
|
|
22774
22997
|
type: param.type,
|
|
22775
22998
|
description: param.description,
|
|
22776
22999
|
...param.default === void 0 ? {} : { default: param.default },
|
|
22777
|
-
...param.options ? { options: param.options } : {},
|
|
23000
|
+
...param.options && param.type === "select" ? { options: param.options } : {},
|
|
22778
23001
|
...param.required ? { required: true } : {}
|
|
22779
23002
|
}));
|
|
22780
23003
|
var optionsOf = (param) => {
|
|
@@ -22830,7 +23053,7 @@ var builderOf = (action, type) => {
|
|
|
22830
23053
|
return builders.has(named) ? named : void 0;
|
|
22831
23054
|
};
|
|
22832
23055
|
var definitionIn = (catalog, name) => Object.hasOwn(catalog, name) ? catalog[name] : void 0;
|
|
22833
|
-
var triggerDefinition = (name) => definitionIn(e$
|
|
23056
|
+
var triggerDefinition = (name) => definitionIn(e$40, name) ?? definitionIn(typeTriggerDefinitions, name);
|
|
22834
23057
|
/** The attributes each type is authored with; `null` for one that takes any, which is said by its defaults. */
|
|
22835
23058
|
var attributeNames = elementAttributeNames;
|
|
22836
23059
|
var explainElement = (type) => {
|
|
@@ -22860,7 +23083,7 @@ var explainElement = (type) => {
|
|
|
22860
23083
|
var explainTrigger = (name) => {
|
|
22861
23084
|
const definition = triggerDefinition(name);
|
|
22862
23085
|
if (!definition) return;
|
|
22863
|
-
const basic = Object.hasOwn(e$
|
|
23086
|
+
const basic = Object.hasOwn(e$40, name);
|
|
22864
23087
|
return {
|
|
22865
23088
|
kind: "trigger",
|
|
22866
23089
|
name,
|
|
@@ -22964,7 +23187,7 @@ var explainList = (kind) => {
|
|
|
22964
23187
|
name,
|
|
22965
23188
|
summary: element.label
|
|
22966
23189
|
})));
|
|
22967
|
-
case "trigger": return sorted([.../* @__PURE__ */ new Set([...Object.keys(e$
|
|
23190
|
+
case "trigger": return sorted([.../* @__PURE__ */ new Set([...Object.keys(e$40), ...Object.keys(typeTriggerDefinitions)])].map((name) => ({
|
|
22968
23191
|
name,
|
|
22969
23192
|
summary: triggerDefinition(name)?.title ?? name
|
|
22970
23193
|
})));
|
|
@@ -23664,7 +23887,7 @@ var importedFiles = ({ probes, dark }) => {
|
|
|
23664
23887
|
"",
|
|
23665
23888
|
"1. Split `outline.ts` into one file per part of the page, each under `scope()`, and write its content.",
|
|
23666
23889
|
"2. Turn each repeated block into a `list` over its `data/` file (see the `lists` reference).",
|
|
23667
|
-
"3. `npx plitzi check` at every width, and compare with `screens/`.",
|
|
23890
|
+
"3. `npx plitzi page check` at every width, and compare with `screens/`.",
|
|
23668
23891
|
""
|
|
23669
23892
|
].join("\n");
|
|
23670
23893
|
const countBlocks = (nodes) => nodes.reduce((count, child) => count + 1 + countBlocks(child.children), 0);
|
|
@@ -26425,13 +26648,26 @@ var fixSpace = (space, options = {}, codes, elements) => fixSpace$1(space, withP
|
|
|
26425
26648
|
}), codes, elements);
|
|
26426
26649
|
/**
|
|
26427
26650
|
* `planFixes`, holding the same catalogs: every fix `fixSpace` would make in this declaration, each with the place in
|
|
26428
|
-
* the author's code that wrote the element and the edit that makes the fix there — what `plitzi fix` shows and writes.
|
|
26651
|
+
* the author's code that wrote the element and the edit that makes the fix there — what `plitzi space fix` shows and writes.
|
|
26429
26652
|
*/
|
|
26430
26653
|
var planFixes = (spec, options = {}) => planFixes$1(spec, withPluginCatalogs({
|
|
26431
26654
|
...ELEMENT_CATALOGS,
|
|
26432
26655
|
...options
|
|
26433
26656
|
}));
|
|
26434
26657
|
/**
|
|
26658
|
+
* `locateElements`, holding the same catalogs: every element the space authors to, with the call in the author's code
|
|
26659
|
+
* that wrote it — what `plitzi element where` answers and `plitzi element edit` edits at.
|
|
26660
|
+
*/
|
|
26661
|
+
var locateElements = (spec, options = {}) => locateElements$1(spec, withPluginCatalogs({
|
|
26662
|
+
...ELEMENT_CATALOGS,
|
|
26663
|
+
...options
|
|
26664
|
+
}));
|
|
26665
|
+
/** `locateClasses`, holding the same catalogs: every class the space declares, with the `styles()` call that wrote it. */
|
|
26666
|
+
var locateClasses = (spec, options = {}) => locateClasses$1(spec, withPluginCatalogs({
|
|
26667
|
+
...ELEMENT_CATALOGS,
|
|
26668
|
+
...options
|
|
26669
|
+
}));
|
|
26670
|
+
/**
|
|
26435
26671
|
* `authorSnippet`, holding the same vocabularies — the artefact you publish when you are not building a space.
|
|
26436
26672
|
*
|
|
26437
26673
|
* A snippet is a subtree hosted as a JSON and dragged onto someone else's canvas, so the checks that matter are
|
|
@@ -26448,4 +26684,4 @@ var validateSnippet = (snippet, options = {}) => validateSnippet$1(snippet, {
|
|
|
26448
26684
|
...options
|
|
26449
26685
|
});
|
|
26450
26686
|
//#endregion
|
|
26451
|
-
export {
|
|
26687
|
+
export { GLOBAL_CALLBACK_BUILDERS as $, AUTHORING_CODES as $i, setState as $n, container as $r, isCssProperty as $t, unrollPage as A, defaultLabel as Ai, whenFailed as An, onScroll as Ar, className as At, blankSpace as B, groupBindings as Bi, authLogout as Bn, setFieldValue as Br, css as Bt, pageTexts as C, c$19 as Ca, tabContainerHeader as Ci, authoringCodesTable as Cn, onFlowError as Cr, unusedDeclarations as Ct, pageRegions as D, t$62 as Da, video as Di, flowStepIds as Dn, onLoad as Dr, column as Dt, diffPictures as E, s$22 as Ea, themeToggle as Ei, authorFlows as En, onKey as Er, tw as Et, readDevTools as F, GLOBAL_SOURCES as Fi, getUtility as Fn, reloadApi as Fr, modifierClassName as Ft, space as G, variantFrom as Gi, cycleState as Gn, e$32 as Gr, cssShorthands as Gt, catalogTemplateFiles as H, hiddenWhen as Hi, cancelServerAction as Hn, updateElement as Hr, sameBlocks as Ht, readDevToolsInPage as I, activeOn as Ii, SET_STATE_TYPES as In, resetForm as Ir, splitClassList as It, importSlug as J, actionSource as Ji, invalidateQueries as Jn, blockJsx as Jr, expandShorthandTraced as Jt, space$1 as K, visibleWhen as Ki, delay as Kn, apiContainer as Kr, expandShorthand as Kt, dataIssues as L, activeWhen as Li, addNotification as Ln, scrollBy as Lr, styles as Lt, inspectPage as M, element as Mi, whileRunning as Mn, openDialog as Mr, classRefs as Mt, onScreen as N, inferredLinkMode as Ni, BUILTIN_UTILITIES as Nn, openModal as Nr, isClassModifier as Nt, profilePictures as O, component as Oi, named$2 as On, onPageLoad as Or, grid as Ot, failedFlowText as P, COMPONENT_SOURCES as Pi, applyUtility as Pn, publishOn as Pr, isStyleDeclaration as Pt, EXPLAIN_KINDS as Q, scope as Qi, runServerAction as Qn, channel as Qr, cssPropertyName as Qt, answerAction as R, authorBinding as Ri, appendState as Rn, scrollIntoView as Rr, BREAKPOINTS$1 as Rt, compareTexts as S, s$20 as Sa, tabContainerBody as Si, flagSpecOf as Sn, onFlowEnd as Sr, suggestClassOverrides as St, comparePictures as T, r$36 as Ta, text$1 as Ti, authorFlow as Tn, onInterval as Tr, createTw as Tt, emptySpaceSource as U, resolveSource as Ui, clearState as Un, elementsFromManifest as Ur, toBlocks as Ut, blankTemplateFiles as V, hasVisibilityBinding as Vi, authRefreshDetails as Vn, toggleElement as Vr, isRuleSetSpec as Vt, toPortableSource as W, toBindingSpecs as Wi, copyToClipboard as Wn, withPluginCatalogs as Wr, toResponsive as Wt, importProbe as X, twig as Xi, navigate as Xn, carousel as Xr, cssNumberValue as Xt, importedFiles as Y, source as Yi, moveState as Yn, button$1 as Yr, shorthandLonghands as Yt, BUILDER_NAMES as Z, closest as Zi, removeState as Zn, carouselTrack as Zr, cssProperties as Zt, shortcutKey as _, t$60 as _a, paragraph as _i, instanceSelectorFor as _n, closeModal as _r, assertSnippetValid as _t, locateClasses as a, elementCallbacks as aa, fontAwesome as ai, notificationsCss as an, BUILTIN_GLOBAL_CALLBACKS as ar, SPACE_FIELDS as at, summariseRenders as b, i$26 as ba, svg as bi, selectorFor as bn, on as br, suggestSpace as bt, validateSnippet as c, elementLeafTypes as ca, heading as ci, i$2 as cn, e$15 as cr, specFromSpace as ct, i as d, elementSourceTypes as da, list$1 as di, r$4 as dn, carouselGoTo as dr, actionToSource as dt, AuthoringError as ea, custom$1 as ei, isCustomProperty as en, stepState as er, explain as et, o as f, elementTriggers as fa, listItem as fi, t$6 as fn, carouselNext as fr, withNamedIds as ft, pressShortcut as g, e$39 as ga, pagination as gi, buildHandles as gn, closeDialog as gr, transformerCatalog as gt, withElement as h, typeTriggerDefinitions as ha, nodeHtml as hi, slugify as hn, carouselPrevious as hr, suggestTransformer as ht, lintSpace as i, elementAttributeValues as ia, embed as ii, pageFamily as in, webHook as ir, ELEMENT_FIELDS as it, inspectDocument as j, defineElement as ji, whenSucceeded as jn, onSubmit as jr, classNames as jt, loadImages as k, defaultAttributes as ki, when as kn, onPointerDown as kr, row as kt, validateSpace as l, elementPartTypes as la, image as li, FIXABLE_CODES as ln, announceOn as lr, compareSpaces as lt, singlePageSpace as m, typeCallbackDefinitions as ma, modalContainer as mi, digest as mn, carouselPlay as mr, getTransformer as mt, authorSpace as n, isSuggestionCode as na, dropdown as ni, SpaceRefusedError as nn, toggleState as nr, explainList as nt, locateElements as o, elementCatalog as oa, form as oi, withNotificationsCss as on, applyBuiltinCallback as or, specToSource as ot, compactSvg as p, elementTypeNames as pa, markdown as pi, e$8 as pn, carouselPause as pr, BUILTIN_TRANSFORMERS as pt, darkScheme as q, withVisibility as qi, hostAction as qn, blockHtml as qr, expandShorthandPatch as qt, fixSpace as r, elementAncestorTypes as ra, dropdownPopup as ri, refusalOf as rn, twigTemplate as rr, explanationText as rt, planFixes as s, elementDefaultAttributes as sa, formControl as si, d$2 as sn, getGlobalCallback as sr, SCHEMA_SETTINGS as st, authorSnippet as t, authoringCodeEntry as ta, dialogContainer as ti, suggestCssProperty as tn, toggleInState as tr, explainKindOf as tt, a as u, elementSlots as ua, link as ui, n$6 as un, cancelApi as ur, actionSpecFromEntry as ut, openPage as v, elementAttributeNames as va, reference as vi, locate as vn, declaredCallback as vr, PAGE_SPEC_FIELDS as vt, alignPictures as w, n$45 as wa, tabContainerItem as wi, defineAction as wn, onFlowProgress as wr, tokens as wt, PAGE_TEXT_LIMIT as x, o$24 as xa, tabContainer as xi, flagGateOf as xn, onClick as xr, withoutQuieted as xt, inspectRenders as y, a$22 as ya, richText as yi, pathForSlug as yn, declaredTrigger as yr, assertSpaceValid as yt, CATALOG_TEMPLATE_IDENTITY as z, bindTemplate as zi, authLogin as zn, scrollTo as zr, STYLE_STATES as zt };
|