@plitzi/sdk-authoring 0.36.1 → 0.36.2
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 +6 -0
- package/dist/index.d.ts +13 -4
- package/dist/index.js +388 -352
- package/package.json +7 -7
- package/skills/plitzi-authoring/SKILL.md +7 -0
package/dist/index.js
CHANGED
|
@@ -920,7 +920,7 @@ var t$33 = {
|
|
|
920
920
|
outline: "none",
|
|
921
921
|
position: "relative"
|
|
922
922
|
};
|
|
923
|
-
var n$
|
|
923
|
+
var n$14 = {
|
|
924
924
|
display: "flex",
|
|
925
925
|
cursor: "pointer",
|
|
926
926
|
"font-weight": "600",
|
|
@@ -929,11 +929,11 @@ var n$12 = {
|
|
|
929
929
|
color: "#6b7280",
|
|
930
930
|
"user-select": "none"
|
|
931
931
|
};
|
|
932
|
-
var r$
|
|
933
|
-
...n$
|
|
932
|
+
var r$12 = {
|
|
933
|
+
...n$14,
|
|
934
934
|
"margin-bottom": "4px"
|
|
935
935
|
};
|
|
936
|
-
var i$
|
|
936
|
+
var i$10 = {
|
|
937
937
|
display: "block",
|
|
938
938
|
color: "red",
|
|
939
939
|
"margin-top": "4px"
|
|
@@ -1004,8 +1004,8 @@ var a$7 = e()({
|
|
|
1004
1004
|
style: {
|
|
1005
1005
|
base: {},
|
|
1006
1006
|
input: { default: {} },
|
|
1007
|
-
label: { default: r$
|
|
1008
|
-
error: { default: i$
|
|
1007
|
+
label: { default: r$12 },
|
|
1008
|
+
error: { default: i$10 }
|
|
1009
1009
|
}
|
|
1010
1010
|
},
|
|
1011
1011
|
text: {
|
|
@@ -1014,8 +1014,8 @@ var a$7 = e()({
|
|
|
1014
1014
|
style: {
|
|
1015
1015
|
base: { default: {} },
|
|
1016
1016
|
input: { default: t$33 },
|
|
1017
|
-
label: { default: r$
|
|
1018
|
-
error: { default: i$
|
|
1017
|
+
label: { default: r$12 },
|
|
1018
|
+
error: { default: i$10 }
|
|
1019
1019
|
}
|
|
1020
1020
|
},
|
|
1021
1021
|
password: {
|
|
@@ -1024,8 +1024,8 @@ var a$7 = e()({
|
|
|
1024
1024
|
style: {
|
|
1025
1025
|
base: { default: {} },
|
|
1026
1026
|
input: { default: t$33 },
|
|
1027
|
-
label: { default: r$
|
|
1028
|
-
error: { default: i$
|
|
1027
|
+
label: { default: r$12 },
|
|
1028
|
+
error: { default: i$10 }
|
|
1029
1029
|
}
|
|
1030
1030
|
},
|
|
1031
1031
|
number: {
|
|
@@ -1034,8 +1034,8 @@ var a$7 = e()({
|
|
|
1034
1034
|
style: {
|
|
1035
1035
|
base: { default: {} },
|
|
1036
1036
|
input: { default: t$33 },
|
|
1037
|
-
label: { default: r$
|
|
1038
|
-
error: { default: i$
|
|
1037
|
+
label: { default: r$12 },
|
|
1038
|
+
error: { default: i$10 }
|
|
1039
1039
|
}
|
|
1040
1040
|
},
|
|
1041
1041
|
email: {
|
|
@@ -1044,8 +1044,8 @@ var a$7 = e()({
|
|
|
1044
1044
|
style: {
|
|
1045
1045
|
base: { default: {} },
|
|
1046
1046
|
input: { default: t$33 },
|
|
1047
|
-
label: { default: r$
|
|
1048
|
-
error: { default: i$
|
|
1047
|
+
label: { default: r$12 },
|
|
1048
|
+
error: { default: i$10 }
|
|
1049
1049
|
}
|
|
1050
1050
|
},
|
|
1051
1051
|
textarea: {
|
|
@@ -1054,8 +1054,8 @@ var a$7 = e()({
|
|
|
1054
1054
|
style: {
|
|
1055
1055
|
base: { default: {} },
|
|
1056
1056
|
input: { default: t$33 },
|
|
1057
|
-
label: { default: r$
|
|
1058
|
-
error: { default: i$
|
|
1057
|
+
label: { default: r$12 },
|
|
1058
|
+
error: { default: i$10 }
|
|
1059
1059
|
}
|
|
1060
1060
|
},
|
|
1061
1061
|
checkbox: {
|
|
@@ -1069,8 +1069,8 @@ var a$7 = e()({
|
|
|
1069
1069
|
"margin-left": "0px",
|
|
1070
1070
|
"margin-right": "4px"
|
|
1071
1071
|
} },
|
|
1072
|
-
label: { default: n$
|
|
1073
|
-
error: { default: i$
|
|
1072
|
+
label: { default: n$14 },
|
|
1073
|
+
error: { default: i$10 }
|
|
1074
1074
|
}
|
|
1075
1075
|
},
|
|
1076
1076
|
select: {
|
|
@@ -1082,8 +1082,8 @@ var a$7 = e()({
|
|
|
1082
1082
|
...t$33,
|
|
1083
1083
|
cursor: "pointer"
|
|
1084
1084
|
} },
|
|
1085
|
-
label: r$
|
|
1086
|
-
error: { default: i$
|
|
1085
|
+
label: r$12,
|
|
1086
|
+
error: { default: i$10 }
|
|
1087
1087
|
}
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
@@ -1451,7 +1451,7 @@ var F = {
|
|
|
1451
1451
|
definition: {
|
|
1452
1452
|
label: "Api Container",
|
|
1453
1453
|
type: "apiContainer",
|
|
1454
|
-
description: "Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production. With `cache: true` a browser request is kept for `staleTime` seconds (default 30) and shared with every provider asking the same thing; it is off unless set. A flow refreshes it with `performQuery` or the global `invalidateQueries` step.",
|
|
1454
|
+
description: "Fetches data from a backend HTTP API (its `query`/`method`/`credentials`) and exposes the response as a data source ITS DESCENDANTS bind to (source `apiContainer_<id>.data`; only elements inside it can consume it). This is how you get backend data into the frontend. Its `mockData` prop is builder-only sample data — the published runtime fetches the real `query`, so always set a real query for production. With `cache: true` a browser request is kept for `staleTime` seconds (default 30) and shared with every provider asking the same thing; it is off unless set. A flow refreshes it with `performQuery` or the global `invalidateQueries` step. Its `subType` (container tag) is empty by default, and then it renders NO element of its own: its children lay out directly in its parent, and any class, variant or style binding on it applies to nothing. To style the provider itself give it a tag (`subType: \"div\"`, `section`, …); otherwise style its parent or a child.",
|
|
1455
1455
|
items: [],
|
|
1456
1456
|
bindings: {},
|
|
1457
1457
|
styleSelectors: { base: "" },
|
|
@@ -2281,7 +2281,7 @@ var elementsFromManifest = (manifest) => Object.fromEntries(Object.entries(manif
|
|
|
2281
2281
|
})]));
|
|
2282
2282
|
//#endregion
|
|
2283
2283
|
//#region ../sdk-elements/dist/Element/helpers/elementConstants.mjs
|
|
2284
|
-
var e$
|
|
2284
|
+
var e$16 = {
|
|
2285
2285
|
onLoad: {
|
|
2286
2286
|
action: "onLoad",
|
|
2287
2287
|
title: "On Load",
|
|
@@ -2407,7 +2407,7 @@ var e$14 = {
|
|
|
2407
2407
|
* the builders useless for exactly the flows that matter most.
|
|
2408
2408
|
*/
|
|
2409
2409
|
var on = (trigger, params = {}) => {
|
|
2410
|
-
const declared = Object.hasOwn(e$
|
|
2410
|
+
const declared = Object.hasOwn(e$16, trigger) ? e$16[trigger] : void 0;
|
|
2411
2411
|
return {
|
|
2412
2412
|
type: "trigger",
|
|
2413
2413
|
action: trigger,
|
|
@@ -2496,7 +2496,7 @@ var toggleElement = (params, target) => ({
|
|
|
2496
2496
|
});
|
|
2497
2497
|
//#endregion
|
|
2498
2498
|
//#region ../sdk-interactions/dist/sources/QueriesSource/writeParams.mjs
|
|
2499
|
-
var e$
|
|
2499
|
+
var e$15 = {
|
|
2500
2500
|
origin: "Requests to the same site",
|
|
2501
2501
|
all: "All cached requests",
|
|
2502
2502
|
elements: "Only these containers",
|
|
@@ -2508,7 +2508,7 @@ var t$14 = (t, n = () => !0) => ({
|
|
|
2508
2508
|
description: "What to refresh once the write succeeded, so the page shows the new data: the cached requests to the same site, all of them, only the api containers named in `invalidateElements`, or none for a step that only reads. Containers on screen ask again at once; the rest when they are shown.",
|
|
2509
2509
|
default: t[0],
|
|
2510
2510
|
options: [...t],
|
|
2511
|
-
optionLabels: Object.fromEntries(t.map((t) => [t, e$
|
|
2511
|
+
optionLabels: Object.fromEntries(t.map((t) => [t, e$15[t]])),
|
|
2512
2512
|
label: "Refresh cached requests",
|
|
2513
2513
|
canBind: !1,
|
|
2514
2514
|
when: n
|
|
@@ -2591,7 +2591,7 @@ var t$13 = {
|
|
|
2591
2591
|
};
|
|
2592
2592
|
//#endregion
|
|
2593
2593
|
//#region ../sdk-interactions/dist/sources/AuthSource/callbacks.mjs
|
|
2594
|
-
var e$
|
|
2594
|
+
var e$14 = {
|
|
2595
2595
|
login: {
|
|
2596
2596
|
source: "auth",
|
|
2597
2597
|
title: "Auth Login",
|
|
@@ -2661,7 +2661,7 @@ var e$12 = {
|
|
|
2661
2661
|
};
|
|
2662
2662
|
//#endregion
|
|
2663
2663
|
//#region ../sdk-interactions/dist/sources/HostSource/callbacks.mjs
|
|
2664
|
-
var e$
|
|
2664
|
+
var e$13 = { hostAction: {
|
|
2665
2665
|
source: "host",
|
|
2666
2666
|
title: "Host Action",
|
|
2667
2667
|
strictParams: !0,
|
|
@@ -2680,7 +2680,7 @@ var e$11 = { hostAction: {
|
|
|
2680
2680
|
} };
|
|
2681
2681
|
//#endregion
|
|
2682
2682
|
//#region ../sdk-interactions/dist/sources/NavigationSource/callbacks.mjs
|
|
2683
|
-
var e$
|
|
2683
|
+
var e$12 = { navigate: {
|
|
2684
2684
|
source: "navigation",
|
|
2685
2685
|
title: "Navigate",
|
|
2686
2686
|
strictParams: !0,
|
|
@@ -2709,7 +2709,7 @@ var e$10 = { navigate: {
|
|
|
2709
2709
|
} };
|
|
2710
2710
|
//#endregion
|
|
2711
2711
|
//#region ../sdk-interactions/dist/sources/QueriesSource/callbacks.mjs
|
|
2712
|
-
var e$
|
|
2712
|
+
var e$11 = { invalidateQueries: {
|
|
2713
2713
|
source: "queries",
|
|
2714
2714
|
title: "Invalidate Queries",
|
|
2715
2715
|
strictParams: !0,
|
|
@@ -2732,7 +2732,7 @@ var e$9 = { invalidateQueries: {
|
|
|
2732
2732
|
} };
|
|
2733
2733
|
//#endregion
|
|
2734
2734
|
//#region ../sdk-interactions/dist/sources/StateSource/callbacks.mjs
|
|
2735
|
-
var e$
|
|
2735
|
+
var e$10 = {
|
|
2736
2736
|
setState: {
|
|
2737
2737
|
source: "state",
|
|
2738
2738
|
title: "Set State",
|
|
@@ -2882,19 +2882,19 @@ var e$8 = {
|
|
|
2882
2882
|
};
|
|
2883
2883
|
//#endregion
|
|
2884
2884
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs
|
|
2885
|
-
var e$
|
|
2886
|
-
var t$12 = `(?:${e$
|
|
2887
|
-
var n$
|
|
2888
|
-
var r$
|
|
2889
|
-
var i$
|
|
2890
|
-
var a$6 = `(?:${`\\{\\{\\{\\s*${r$
|
|
2891
|
-
var o$
|
|
2885
|
+
var e$9 = "[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*";
|
|
2886
|
+
var t$12 = `(?:${e$9}|\\d+)`;
|
|
2887
|
+
var n$13 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$9}(?:\\.${t$12})*)\\s*\\]`;
|
|
2888
|
+
var r$11 = `${`${e$9}(?:${n$13})*(?:\\??\\.${t$12}(?:${n$13})*)*`}(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`;
|
|
2889
|
+
var i$9 = `\\{\\{\\s*${r$11}\\s*\\}\\}`;
|
|
2890
|
+
var a$6 = `(?:${`\\{\\{\\{\\s*${r$11}\\s*\\}\\}\\}`}|${i$9})`;
|
|
2891
|
+
var o$6 = new RegExp(a$6, "g");
|
|
2892
2892
|
var s$4 = RegExp(`^${a$6}$`);
|
|
2893
2893
|
//#endregion
|
|
2894
2894
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/hasValidToken.mjs
|
|
2895
|
-
var n$
|
|
2895
|
+
var n$12 = (n, r = !1) => {
|
|
2896
2896
|
if (typeof n != "string") return !1;
|
|
2897
|
-
let i = r ? s$4 : o$
|
|
2897
|
+
let i = r ? s$4 : o$6;
|
|
2898
2898
|
return i.lastIndex = 0, i.test(n.trim());
|
|
2899
2899
|
};
|
|
2900
2900
|
//#endregion
|
|
@@ -2909,12 +2909,12 @@ var n$1 = (e, t, n) => {
|
|
|
2909
2909
|
for (let [i, a] of Object.entries(n)) a.required && e[i] === void 0 && (!a.when || a.when(t)) && r.push(i);
|
|
2910
2910
|
return r;
|
|
2911
2911
|
};
|
|
2912
|
-
var r$
|
|
2913
|
-
var i$
|
|
2912
|
+
var r$10 = (e) => e.trim() !== "" && Number.isFinite(Number(e));
|
|
2913
|
+
var i$8 = (t) => typeof t == "string" && n$12(t);
|
|
2914
2914
|
var a$5 = (e, t) => {
|
|
2915
2915
|
switch (t.type) {
|
|
2916
2916
|
case "boolean": return typeof e == "boolean";
|
|
2917
|
-
case "number": return typeof e == "number" || typeof e == "string" && r$
|
|
2917
|
+
case "number": return typeof e == "number" || typeof e == "string" && r$10(e);
|
|
2918
2918
|
case "select": return typeof e == "string" && (!t.options || t.options.includes(e));
|
|
2919
2919
|
case "scalar": return typeof e == "string" || typeof e == "number" || typeof e == "boolean";
|
|
2920
2920
|
case "text":
|
|
@@ -2927,7 +2927,7 @@ var o = (e, t, n) => {
|
|
|
2927
2927
|
let r = [];
|
|
2928
2928
|
for (let [o, s] of Object.entries(n)) {
|
|
2929
2929
|
let n = e[o];
|
|
2930
|
-
n === void 0 || i$
|
|
2930
|
+
n === void 0 || i$8(n) || s.when && !s.when(t) || a$5(n, s) || r.push({
|
|
2931
2931
|
key: o,
|
|
2932
2932
|
expected: s.type,
|
|
2933
2933
|
got: n === null ? "null" : typeof n,
|
|
@@ -3011,12 +3011,12 @@ var e$1 = { addNotification: {
|
|
|
3011
3011
|
*/
|
|
3012
3012
|
var BUILTIN_GLOBAL_CALLBACKS = {
|
|
3013
3013
|
...e$1,
|
|
3014
|
-
...e$8,
|
|
3015
|
-
...e$11,
|
|
3016
3014
|
...e$10,
|
|
3015
|
+
...e$13,
|
|
3017
3016
|
...e$12,
|
|
3017
|
+
...e$14,
|
|
3018
3018
|
...t$13,
|
|
3019
|
-
...e$
|
|
3019
|
+
...e$11
|
|
3020
3020
|
};
|
|
3021
3021
|
/** The built-in globalCallback for an action, or undefined when the action is not a known built-in (a plugin
|
|
3022
3022
|
* callback whose source/schema is not knowable here). */
|
|
@@ -3302,25 +3302,25 @@ var applyUtility = (action, params) => {
|
|
|
3302
3302
|
};
|
|
3303
3303
|
//#endregion
|
|
3304
3304
|
//#region ../sdk-shared/dist/actions/failureHandler.mjs
|
|
3305
|
-
var e$
|
|
3305
|
+
var e$8 = "flow.onFailure";
|
|
3306
3306
|
//#endregion
|
|
3307
3307
|
//#region ../sdk-schema/dist/helpers/elementId.mjs
|
|
3308
|
-
var e$
|
|
3309
|
-
var t$10 = (t) => e$
|
|
3310
|
-
var r$
|
|
3311
|
-
var i$
|
|
3308
|
+
var e$7 = /^[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/;
|
|
3309
|
+
var t$10 = (t) => e$7.test(t);
|
|
3310
|
+
var r$9 = (e) => new Set(Object.keys(e));
|
|
3311
|
+
var i$7 = (e, n, r) => t$10(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`;
|
|
3312
3312
|
var a$4 = (e, t) => {
|
|
3313
3313
|
let n = /* @__PURE__ */ new Set();
|
|
3314
3314
|
for (let r of t) {
|
|
3315
|
-
if (n.has(r.id) || i$
|
|
3315
|
+
if (n.has(r.id) || i$7(e, r.id)) return !1;
|
|
3316
3316
|
n.add(r.id);
|
|
3317
3317
|
}
|
|
3318
3318
|
return !0;
|
|
3319
3319
|
};
|
|
3320
|
-
var o$
|
|
3320
|
+
var o$5 = (e) => e.replace(/[^A-Za-z0-9]/g, "") || "element";
|
|
3321
3321
|
var s$3 = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
3322
3322
|
var c$2 = (e, t) => {
|
|
3323
|
-
let n = o$
|
|
3323
|
+
let n = o$5(e);
|
|
3324
3324
|
for (let e = 0; e < 100; e += 1) {
|
|
3325
3325
|
let e = "";
|
|
3326
3326
|
for (let t = 0; t < 4; t += 1) e += s$3[Math.floor(Math.random() * s$3.length)];
|
|
@@ -3329,7 +3329,7 @@ var c$2 = (e, t) => {
|
|
|
3329
3329
|
return l$1(e, t);
|
|
3330
3330
|
};
|
|
3331
3331
|
var l$1 = (e, t) => {
|
|
3332
|
-
let n = o$
|
|
3332
|
+
let n = o$5(e), r = 1;
|
|
3333
3333
|
for (; t(`${n}-${r}`);) r += 1;
|
|
3334
3334
|
return `${n}-${r}`;
|
|
3335
3335
|
};
|
|
@@ -3648,7 +3648,7 @@ var defineAction = (spec) => {
|
|
|
3648
3648
|
...undo.length > 0 ? [{
|
|
3649
3649
|
id: "onFailure",
|
|
3650
3650
|
type: "task",
|
|
3651
|
-
action: e$
|
|
3651
|
+
action: e$8,
|
|
3652
3652
|
params: {}
|
|
3653
3653
|
}, ...undo.map(taskStep)] : []
|
|
3654
3654
|
];
|
|
@@ -3884,24 +3884,38 @@ var digest = (value, length) => {
|
|
|
3884
3884
|
*/
|
|
3885
3885
|
var slugify = (value, fallback) => value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || fallback;
|
|
3886
3886
|
//#endregion
|
|
3887
|
+
//#region ../sdk-shared/dist/schema/layoutChain.mjs
|
|
3888
|
+
var e$6 = (e, t) => {
|
|
3889
|
+
let n = e?.attributes[t];
|
|
3890
|
+
return typeof n == "string" ? n : "";
|
|
3891
|
+
};
|
|
3892
|
+
var n$10 = (t, n) => {
|
|
3893
|
+
let r = [], i = n;
|
|
3894
|
+
for (; i && r.length <= 16;) {
|
|
3895
|
+
if (r.includes(i)) return [...r.slice(r.indexOf(i)), i];
|
|
3896
|
+
r.push(i), i = e$6(t(i), "layout");
|
|
3897
|
+
}
|
|
3898
|
+
return [];
|
|
3899
|
+
};
|
|
3900
|
+
//#endregion
|
|
3887
3901
|
//#region ../sdk-schema/dist/helpers/schemaValidator.mjs
|
|
3888
|
-
var
|
|
3889
|
-
let
|
|
3902
|
+
var n$9 = (n) => {
|
|
3903
|
+
let r = [], i = [], { flat: a, pages: o, pageFolders: s, variables: c } = n, l = (e) => !!a[e], u = (e) => a[e], d = () => Object.values(a).filter((e) => e?.definition?.type === "layoutContainer" && !e.definition.parentId).map((e) => e.id), f = () => [...o, ...d()], p = () => !a || typeof a != "object" ? (r.push({
|
|
3890
3904
|
code: "INVALID_FLAT",
|
|
3891
3905
|
message: "Schema.flat must be a valid Record<string, Element>"
|
|
3892
|
-
}), !1) : Array.isArray(
|
|
3906
|
+
}), !1) : Array.isArray(o) ? Array.isArray(s) ? Array.isArray(c) ? !0 : (r.push({
|
|
3893
3907
|
code: "INVALID_VARIABLES",
|
|
3894
3908
|
message: "Schema.variables must be an array"
|
|
3895
|
-
}), !1) : (
|
|
3909
|
+
}), !1) : (r.push({
|
|
3896
3910
|
code: "INVALID_PAGE_FOLDERS",
|
|
3897
3911
|
message: "Schema.pageFolders must be an array"
|
|
3898
|
-
}), !1) : (
|
|
3912
|
+
}), !1) : (r.push({
|
|
3899
3913
|
code: "INVALID_PAGES",
|
|
3900
3914
|
message: "Schema.pages must be an array of element IDs"
|
|
3901
|
-
}), !1),
|
|
3902
|
-
Object.entries(
|
|
3915
|
+
}), !1), m = () => {
|
|
3916
|
+
Object.entries(a).forEach(([e, t]) => {
|
|
3903
3917
|
if (!t) {
|
|
3904
|
-
|
|
3918
|
+
r.push({
|
|
3905
3919
|
code: "NULL_ELEMENT",
|
|
3906
3920
|
message: `Element with id "${e}" is null or undefined`,
|
|
3907
3921
|
elementId: e
|
|
@@ -3909,163 +3923,163 @@ var t$9 = (t) => {
|
|
|
3909
3923
|
return;
|
|
3910
3924
|
}
|
|
3911
3925
|
if (!t.id) {
|
|
3912
|
-
|
|
3926
|
+
r.push({
|
|
3913
3927
|
code: "MISSING_ID",
|
|
3914
3928
|
message: `Element at key "${e}" has no id property`
|
|
3915
3929
|
});
|
|
3916
3930
|
return;
|
|
3917
3931
|
}
|
|
3918
|
-
if (t.id !== e &&
|
|
3932
|
+
if (t.id !== e && r.push({
|
|
3919
3933
|
code: "ID_MISMATCH",
|
|
3920
3934
|
message: `Element id "${t.id}" doesn't match flat key "${e}"`,
|
|
3921
3935
|
elementId: e
|
|
3922
3936
|
}), !t.definition) {
|
|
3923
|
-
|
|
3937
|
+
r.push({
|
|
3924
3938
|
code: "MISSING_DEFINITION",
|
|
3925
3939
|
message: "Element missing definition",
|
|
3926
3940
|
elementId: e
|
|
3927
3941
|
});
|
|
3928
3942
|
return;
|
|
3929
3943
|
}
|
|
3930
|
-
let { definition:
|
|
3931
|
-
|
|
3944
|
+
let { definition: n, attributes: a } = t;
|
|
3945
|
+
n.type || r.push({
|
|
3932
3946
|
code: "MISSING_TYPE",
|
|
3933
3947
|
message: "Element missing definition.type",
|
|
3934
3948
|
elementId: e
|
|
3935
|
-
}),
|
|
3949
|
+
}), n.label === void 0 && r.push({
|
|
3936
3950
|
code: "MISSING_LABEL",
|
|
3937
3951
|
message: "Element missing definition.label",
|
|
3938
3952
|
elementId: e
|
|
3939
|
-
}),
|
|
3953
|
+
}), n.rootId || r.push({
|
|
3940
3954
|
code: "MISSING_ROOT_ID",
|
|
3941
3955
|
message: "Element missing definition.rootId",
|
|
3942
3956
|
elementId: e
|
|
3943
|
-
}), (!
|
|
3957
|
+
}), (!n.styleSelectors || typeof n.styleSelectors != "object") && r.push({
|
|
3944
3958
|
code: "MISSING_STYLE_SELECTORS",
|
|
3945
3959
|
message: "Element missing or invalid definition.styleSelectors",
|
|
3946
3960
|
elementId: e
|
|
3947
|
-
}), a ||
|
|
3961
|
+
}), a || i.push({
|
|
3948
3962
|
code: "MISSING_ATTRIBUTES",
|
|
3949
3963
|
message: "Element has no attributes",
|
|
3950
3964
|
elementId: e
|
|
3951
|
-
}),
|
|
3952
|
-
|
|
3965
|
+
}), n.items && (Array.isArray(n.items) ? n.items.forEach((t, n) => {
|
|
3966
|
+
l(t) || r.push({
|
|
3953
3967
|
code: "ORPHANED_ITEM_REFERENCE",
|
|
3954
|
-
message: `Element "${e}" references non-existent child "${t}" at items[${
|
|
3968
|
+
message: `Element "${e}" references non-existent child "${t}" at items[${n}]`,
|
|
3955
3969
|
elementId: e,
|
|
3956
3970
|
details: {
|
|
3957
3971
|
childId: t,
|
|
3958
|
-
index:
|
|
3972
|
+
index: n
|
|
3959
3973
|
}
|
|
3960
3974
|
});
|
|
3961
|
-
}) :
|
|
3975
|
+
}) : r.push({
|
|
3962
3976
|
code: "INVALID_ITEMS",
|
|
3963
3977
|
message: "Element.definition.items must be an array",
|
|
3964
3978
|
elementId: e
|
|
3965
|
-
})),
|
|
3979
|
+
})), n.parentId && !l(n.parentId) && r.push({
|
|
3966
3980
|
code: "ORPHANED_PARENT_REFERENCE",
|
|
3967
|
-
message: `Element "${e}" has parentId "${
|
|
3981
|
+
message: `Element "${e}" has parentId "${n.parentId}" but parent doesn't exist in flat`,
|
|
3968
3982
|
elementId: e,
|
|
3969
|
-
details: { parentId:
|
|
3983
|
+
details: { parentId: n.parentId }
|
|
3970
3984
|
});
|
|
3971
3985
|
});
|
|
3972
|
-
},
|
|
3973
|
-
Object.values(
|
|
3986
|
+
}, h = () => {
|
|
3987
|
+
Object.values(a).forEach((e) => {
|
|
3974
3988
|
if (!e?.definition) return;
|
|
3975
|
-
let { id: t, definition:
|
|
3976
|
-
if (
|
|
3977
|
-
let
|
|
3978
|
-
|
|
3989
|
+
let { id: t, definition: n } = e;
|
|
3990
|
+
if (n.items && n.items.forEach((e) => {
|
|
3991
|
+
let n = u(e);
|
|
3992
|
+
n?.definition && n.definition.parentId !== t && r.push({
|
|
3979
3993
|
code: "PARENT_CHILD_MISMATCH",
|
|
3980
|
-
message: `Element "${e}" is in "${t}".items but has parentId "${
|
|
3994
|
+
message: `Element "${e}" is in "${t}".items but has parentId "${n.definition.parentId}"`,
|
|
3981
3995
|
elementId: e,
|
|
3982
3996
|
details: {
|
|
3983
3997
|
expectedParent: t,
|
|
3984
|
-
actualParent:
|
|
3998
|
+
actualParent: n.definition.parentId
|
|
3985
3999
|
}
|
|
3986
4000
|
});
|
|
3987
|
-
}),
|
|
3988
|
-
let e =
|
|
4001
|
+
}), n.parentId) {
|
|
4002
|
+
let e = u(n.parentId);
|
|
3989
4003
|
if (!e?.definition) return;
|
|
3990
4004
|
let i = e.definition.items || [];
|
|
3991
|
-
i.includes(t) ||
|
|
4005
|
+
i.includes(t) || r.push({
|
|
3992
4006
|
code: "PARENT_CHILD_MISMATCH",
|
|
3993
|
-
message: `Element "${t}" has parentId "${
|
|
4007
|
+
message: `Element "${t}" has parentId "${n.parentId}" but parent doesn't have it in items`,
|
|
3994
4008
|
elementId: t,
|
|
3995
4009
|
details: {
|
|
3996
|
-
parentId:
|
|
4010
|
+
parentId: n.parentId,
|
|
3997
4011
|
parentItems: i
|
|
3998
4012
|
}
|
|
3999
4013
|
});
|
|
4000
4014
|
}
|
|
4001
4015
|
});
|
|
4002
|
-
},
|
|
4003
|
-
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(),
|
|
4004
|
-
if (t.has(i)) return
|
|
4016
|
+
}, g = () => {
|
|
4017
|
+
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), n = (i) => {
|
|
4018
|
+
if (t.has(i)) return r.push({
|
|
4005
4019
|
code: "CIRCULAR_REFERENCE",
|
|
4006
4020
|
message: `Circular reference detected involving element "${i}"`,
|
|
4007
4021
|
elementId: i
|
|
4008
4022
|
}), !0;
|
|
4009
4023
|
if (e.has(i)) return !1;
|
|
4010
4024
|
e.add(i), t.add(i);
|
|
4011
|
-
let a =
|
|
4025
|
+
let a = u(i);
|
|
4012
4026
|
if (a?.definition?.items) {
|
|
4013
|
-
for (let e of a.definition.items) if (
|
|
4027
|
+
for (let e of a.definition.items) if (n(e)) return t.delete(i), !0;
|
|
4014
4028
|
}
|
|
4015
4029
|
let o = /* @__PURE__ */ new Set(), s = a;
|
|
4016
4030
|
for (; s?.definition?.parentId;) {
|
|
4017
|
-
if (o.has(s.id)) return
|
|
4031
|
+
if (o.has(s.id)) return r.push({
|
|
4018
4032
|
code: "CIRCULAR_PARENT_REFERENCE",
|
|
4019
4033
|
message: `Circular parent reference detected involving element "${s.id}"`,
|
|
4020
4034
|
elementId: s.id
|
|
4021
4035
|
}), !0;
|
|
4022
|
-
o.add(s.id), s =
|
|
4036
|
+
o.add(s.id), s = u(s.definition.parentId);
|
|
4023
4037
|
}
|
|
4024
4038
|
return t.delete(i), !1;
|
|
4025
4039
|
};
|
|
4026
|
-
Object.keys(
|
|
4027
|
-
e.has(t) ||
|
|
4040
|
+
Object.keys(a).forEach((t) => {
|
|
4041
|
+
e.has(t) || n(t);
|
|
4028
4042
|
});
|
|
4029
|
-
},
|
|
4043
|
+
}, _ = () => {
|
|
4030
4044
|
let e = /* @__PURE__ */ new Set(), t = 0;
|
|
4031
|
-
|
|
4032
|
-
e.has(
|
|
4045
|
+
o.forEach((n, i) => {
|
|
4046
|
+
e.has(n) && r.push({
|
|
4033
4047
|
code: "DUPLICATE_PAGE",
|
|
4034
|
-
message: `Duplicate page ID "${
|
|
4035
|
-
elementId:
|
|
4036
|
-
}), e.add(
|
|
4037
|
-
let a =
|
|
4048
|
+
message: `Duplicate page ID "${n}" in pages array at index ${i}`,
|
|
4049
|
+
elementId: n
|
|
4050
|
+
}), e.add(n);
|
|
4051
|
+
let a = u(n);
|
|
4038
4052
|
if (!a) {
|
|
4039
|
-
|
|
4053
|
+
r.push({
|
|
4040
4054
|
code: "INVALID_PAGE_REFERENCE",
|
|
4041
|
-
message: `Page ID "${
|
|
4042
|
-
elementId:
|
|
4055
|
+
message: `Page ID "${n}" in pages array doesn't exist in flat`,
|
|
4056
|
+
elementId: n
|
|
4043
4057
|
});
|
|
4044
4058
|
return;
|
|
4045
4059
|
}
|
|
4046
|
-
a.definition.type !== "page" &&
|
|
4060
|
+
a.definition.type !== "page" && r.push({
|
|
4047
4061
|
code: "INVALID_PAGE_TYPE",
|
|
4048
|
-
message: `Element "${
|
|
4049
|
-
elementId:
|
|
4050
|
-
}), a.definition.rootId !==
|
|
4062
|
+
message: `Element "${n}" in pages array has type "${a.definition.type}" instead of "page"`,
|
|
4063
|
+
elementId: n
|
|
4064
|
+
}), a.definition.rootId !== n && r.push({
|
|
4051
4065
|
code: "PAGE_ROOT_ID_MISMATCH",
|
|
4052
|
-
message: `Page "${
|
|
4053
|
-
elementId:
|
|
4066
|
+
message: `Page "${n}" has rootId "${a.definition.rootId}" instead of its own ID`,
|
|
4067
|
+
elementId: n
|
|
4054
4068
|
}), a.attributes?.default && t++;
|
|
4055
|
-
}), t === 0 &&
|
|
4069
|
+
}), t === 0 && o.length > 0 ? i.push({
|
|
4056
4070
|
code: "NO_DEFAULT_PAGE",
|
|
4057
4071
|
message: "No default page found in schema"
|
|
4058
|
-
}) : t > 1 &&
|
|
4072
|
+
}) : t > 1 && i.push({
|
|
4059
4073
|
code: "MULTIPLE_DEFAULT_PAGES",
|
|
4060
4074
|
message: `Found ${t} default pages, expected 1`
|
|
4061
4075
|
});
|
|
4062
|
-
},
|
|
4063
|
-
|
|
4064
|
-
let t =
|
|
4076
|
+
}, v = () => {
|
|
4077
|
+
f().forEach((e) => {
|
|
4078
|
+
let t = u(e);
|
|
4065
4079
|
if (!t) return;
|
|
4066
|
-
let
|
|
4067
|
-
let i =
|
|
4068
|
-
i?.definition && (i.definition.rootId !== e &&
|
|
4080
|
+
let n = (t) => {
|
|
4081
|
+
let i = u(t);
|
|
4082
|
+
i?.definition && (i.definition.rootId !== e && r.push({
|
|
4069
4083
|
code: "ROOT_ID_MISMATCH",
|
|
4070
4084
|
message: `Element "${t}" has rootId "${i.definition.rootId}" but should be "${e}" (its root's ID)`,
|
|
4071
4085
|
elementId: t,
|
|
@@ -4073,98 +4087,110 @@ var t$9 = (t) => {
|
|
|
4073
4087
|
expectedRootId: e,
|
|
4074
4088
|
actualRootId: i.definition.rootId
|
|
4075
4089
|
}
|
|
4076
|
-
}), i.definition.items && i.definition.items.forEach((e) =>
|
|
4090
|
+
}), i.definition.items && i.definition.items.forEach((e) => n(e)));
|
|
4077
4091
|
};
|
|
4078
|
-
t.definition.items && t.definition.items.forEach((e) =>
|
|
4092
|
+
t.definition.items && t.definition.items.forEach((e) => n(e));
|
|
4079
4093
|
});
|
|
4080
|
-
},
|
|
4094
|
+
}, y = () => {
|
|
4081
4095
|
let e = /* @__PURE__ */ new Set();
|
|
4082
|
-
|
|
4096
|
+
s.forEach((t, n) => {
|
|
4083
4097
|
if (!t.id) {
|
|
4084
|
-
|
|
4098
|
+
r.push({
|
|
4085
4099
|
code: "INVALID_FOLDER",
|
|
4086
|
-
message: `Page folder at index ${
|
|
4100
|
+
message: `Page folder at index ${n} has no id`
|
|
4087
4101
|
});
|
|
4088
4102
|
return;
|
|
4089
4103
|
}
|
|
4090
|
-
e.has(t.id) &&
|
|
4104
|
+
e.has(t.id) && r.push({
|
|
4091
4105
|
code: "DUPLICATE_FOLDER",
|
|
4092
4106
|
message: `Duplicate folder ID "${t.id}"`,
|
|
4093
4107
|
elementId: t.id
|
|
4094
|
-
}), e.add(t.id), t.parentId && (e.has(t.parentId) ||
|
|
4108
|
+
}), e.add(t.id), t.parentId && (e.has(t.parentId) || r.push({
|
|
4095
4109
|
code: "ORPHANED_FOLDER_PARENT",
|
|
4096
4110
|
message: `Folder "${t.id}" has non-existent parent "${t.parentId}"`,
|
|
4097
4111
|
elementId: t.id,
|
|
4098
4112
|
details: { parentId: t.parentId }
|
|
4099
4113
|
}));
|
|
4100
4114
|
});
|
|
4101
|
-
},
|
|
4115
|
+
}, b = () => {
|
|
4116
|
+
let e = /* @__PURE__ */ new Set();
|
|
4117
|
+
d().forEach((n) => {
|
|
4118
|
+
let i = n$10(u, n);
|
|
4119
|
+
i.length === 0 || e.has(i[0]) || (i.forEach((t) => e.add(t)), r.push({
|
|
4120
|
+
code: "LAYOUT_CYCLE",
|
|
4121
|
+
message: `Layouts sit inside each other in a circle: ${i.join(" → ")}`,
|
|
4122
|
+
elementId: n,
|
|
4123
|
+
details: { cycle: i }
|
|
4124
|
+
}));
|
|
4125
|
+
});
|
|
4126
|
+
}, x = (e) => {
|
|
4102
4127
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
4103
4128
|
if (t.has(e)) return;
|
|
4104
4129
|
t.add(e);
|
|
4105
|
-
let r =
|
|
4130
|
+
let r = u(e);
|
|
4106
4131
|
r?.definition?.items && r.definition.items.forEach((e) => n(e));
|
|
4107
|
-
},
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
t
|
|
4132
|
+
}, r = /* @__PURE__ */ new Set(), o = (e) => {
|
|
4133
|
+
if (r.has(e)) return;
|
|
4134
|
+
r.add(e), n(e);
|
|
4135
|
+
let t = u(e)?.attributes;
|
|
4136
|
+
t?.layout && o(t.layout), t?.layoutContainer && n(t.layoutContainer);
|
|
4111
4137
|
};
|
|
4112
|
-
e ?
|
|
4113
|
-
let
|
|
4114
|
-
Object.keys(
|
|
4115
|
-
let n =
|
|
4116
|
-
n && !t.has(e) && n.definition.type !== "page" && !
|
|
4138
|
+
e ? o(e) : f().forEach(o);
|
|
4139
|
+
let s = new Set(f());
|
|
4140
|
+
Object.keys(a).forEach((e) => {
|
|
4141
|
+
let n = u(e);
|
|
4142
|
+
n && !t.has(e) && n.definition.type !== "page" && !s.has(e) && i.push({
|
|
4117
4143
|
code: "ORPHANED_ELEMENT",
|
|
4118
4144
|
message: `Element "${e}" is not reachable from any page or layout`,
|
|
4119
4145
|
elementId: e
|
|
4120
4146
|
});
|
|
4121
4147
|
});
|
|
4122
|
-
},
|
|
4148
|
+
}, S = () => {
|
|
4123
4149
|
let e = /* @__PURE__ */ new Set();
|
|
4124
|
-
|
|
4150
|
+
c.forEach((t, n) => {
|
|
4125
4151
|
if (!t.name) {
|
|
4126
|
-
|
|
4152
|
+
r.push({
|
|
4127
4153
|
code: "INVALID_VARIABLE",
|
|
4128
|
-
message: `Variable at index ${
|
|
4154
|
+
message: `Variable at index ${n} has no name`
|
|
4129
4155
|
});
|
|
4130
4156
|
return;
|
|
4131
4157
|
}
|
|
4132
|
-
e.has(t.name) &&
|
|
4158
|
+
e.has(t.name) && r.push({
|
|
4133
4159
|
code: "DUPLICATE_VARIABLE",
|
|
4134
4160
|
message: `Duplicate variable name "${t.name}"`,
|
|
4135
4161
|
details: { variableName: t.name }
|
|
4136
|
-
}), e.add(t.name), t.type ||
|
|
4162
|
+
}), e.add(t.name), t.type || i.push({
|
|
4137
4163
|
code: "MISSING_VARIABLE_TYPE",
|
|
4138
4164
|
message: `Variable "${t.name}" has no type`,
|
|
4139
4165
|
details: { variableName: t.name }
|
|
4140
4166
|
});
|
|
4141
4167
|
});
|
|
4142
|
-
},
|
|
4143
|
-
Object.values(
|
|
4144
|
-
t && (t$10(t.id) ||
|
|
4168
|
+
}, C = () => {
|
|
4169
|
+
Object.values(a).forEach((t) => {
|
|
4170
|
+
t && (t$10(t.id) || r.push({
|
|
4145
4171
|
code: "INVALID_ELEMENT_ID",
|
|
4146
4172
|
message: `Element "${t.id}" has a name that must start with a letter, then letters, numbers, hyphens and underscores (no hyphen or underscore at the start, and no hyphen at the end)`,
|
|
4147
4173
|
elementId: t.id
|
|
4148
4174
|
}));
|
|
4149
4175
|
});
|
|
4150
|
-
},
|
|
4151
|
-
let t = /* @__PURE__ */ new Set(),
|
|
4152
|
-
Object.values(
|
|
4153
|
-
if (!
|
|
4154
|
-
t.add(
|
|
4155
|
-
let
|
|
4156
|
-
|
|
4157
|
-
}), Object.values(
|
|
4158
|
-
|
|
4176
|
+
}, w = (e) => {
|
|
4177
|
+
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
|
|
4178
|
+
Object.values(a).forEach((r) => {
|
|
4179
|
+
if (!r) return;
|
|
4180
|
+
t.add(r.id);
|
|
4181
|
+
let a = e?.[r.definition.type];
|
|
4182
|
+
a && i.set(r.id, a), n.add(r.definition.type);
|
|
4183
|
+
}), Object.values(a).forEach((a) => {
|
|
4184
|
+
a && a.definition.bindings && Object.entries(a.definition.bindings).forEach(([o, s]) => {
|
|
4159
4185
|
(s ?? []).forEach((s) => {
|
|
4160
4186
|
let c = s.source.split(".")[0], l = c.indexOf("_");
|
|
4161
4187
|
if (l === -1) return;
|
|
4162
|
-
let u = c.slice(0, l), d = c.slice(l + 1), f = `Element "${
|
|
4188
|
+
let u = c.slice(0, l), d = c.slice(l + 1), f = `Element "${a.id}" binds ${o}.${s.to} to "${s.source}"`;
|
|
4163
4189
|
if (!t.has(d)) {
|
|
4164
|
-
(e ||
|
|
4190
|
+
(e || n.has(u)) && r.push({
|
|
4165
4191
|
code: "UNRESOLVED_BINDING_SOURCE",
|
|
4166
4192
|
message: `${f}, but no element answers to the name "${d}"`,
|
|
4167
|
-
elementId:
|
|
4193
|
+
elementId: a.id,
|
|
4168
4194
|
details: {
|
|
4169
4195
|
source: s.source,
|
|
4170
4196
|
elementId: d
|
|
@@ -4172,11 +4198,11 @@ var t$9 = (t) => {
|
|
|
4172
4198
|
});
|
|
4173
4199
|
return;
|
|
4174
4200
|
}
|
|
4175
|
-
let p =
|
|
4176
|
-
p && p !== u &&
|
|
4201
|
+
let p = i.get(d);
|
|
4202
|
+
p && p !== u && r.push({
|
|
4177
4203
|
code: "MISMATCHED_BINDING_SOURCE",
|
|
4178
4204
|
message: `${f}, but "${d}" publishes its source as "${p}_${d}"`,
|
|
4179
|
-
elementId:
|
|
4205
|
+
elementId: a.id,
|
|
4180
4206
|
details: {
|
|
4181
4207
|
source: s.source,
|
|
4182
4208
|
elementId: d,
|
|
@@ -4186,54 +4212,54 @@ var t$9 = (t) => {
|
|
|
4186
4212
|
});
|
|
4187
4213
|
});
|
|
4188
4214
|
});
|
|
4189
|
-
},
|
|
4190
|
-
let t = new Set(Object.keys(
|
|
4191
|
-
Object.values(
|
|
4192
|
-
let i =
|
|
4215
|
+
}, T = () => {
|
|
4216
|
+
let t = new Set(Object.keys(a));
|
|
4217
|
+
Object.values(a).forEach((n) => {
|
|
4218
|
+
let i = n?.definition.interactions;
|
|
4193
4219
|
if (!i) return;
|
|
4194
4220
|
let a = Object.keys(i);
|
|
4195
4221
|
Object.entries(i).forEach(([i, o]) => {
|
|
4196
|
-
t$10(i) ||
|
|
4222
|
+
t$10(i) || r.push({
|
|
4197
4223
|
code: "INVALID_INTERACTION_ID",
|
|
4198
|
-
message: `Interaction "${i}" on element "${
|
|
4199
|
-
elementId:
|
|
4200
|
-
}), o.id !== i &&
|
|
4224
|
+
message: `Interaction "${i}" on element "${n.id}" has a name that must start with a letter, then letters, numbers, hyphens and underscores — a later step reads it as {{ ${i}.field }}`,
|
|
4225
|
+
elementId: n.id
|
|
4226
|
+
}), o.id !== i && r.push({
|
|
4201
4227
|
code: "INTERACTION_ID_MISMATCH",
|
|
4202
|
-
message: `Interaction id "${o.id}" on element "${
|
|
4203
|
-
elementId:
|
|
4228
|
+
message: `Interaction id "${o.id}" on element "${n.id}" doesn't match its key "${i}"`,
|
|
4229
|
+
elementId: n.id
|
|
4204
4230
|
}), ["beforeNode", "afterNode"].forEach((e) => {
|
|
4205
4231
|
let t = o[e];
|
|
4206
|
-
t && !a.includes(t) &&
|
|
4232
|
+
t && !a.includes(t) && r.push({
|
|
4207
4233
|
code: "BROKEN_FLOW_LINK",
|
|
4208
|
-
message: `Interaction "${o.id}" on element "${
|
|
4209
|
-
elementId:
|
|
4234
|
+
message: `Interaction "${o.id}" on element "${n.id}" names ${e} "${t}", which is not a node of this flow`,
|
|
4235
|
+
elementId: n.id
|
|
4210
4236
|
});
|
|
4211
|
-
}), o.flowId && !a.includes(o.flowId) &&
|
|
4237
|
+
}), o.flowId && !a.includes(o.flowId) && r.push({
|
|
4212
4238
|
code: "BROKEN_FLOW_ID",
|
|
4213
|
-
message: `Interaction "${o.id}" on element "${
|
|
4214
|
-
elementId:
|
|
4215
|
-
}), o.type === "callback" && o.elementId && !t.has(o.elementId) &&
|
|
4239
|
+
message: `Interaction "${o.id}" on element "${n.id}" belongs to flow "${o.flowId}", which is not a node of this flow`,
|
|
4240
|
+
elementId: n.id
|
|
4241
|
+
}), o.type === "callback" && o.elementId && !t.has(o.elementId) && r.push({
|
|
4216
4242
|
code: "UNRESOLVED_INTERACTION_TARGET",
|
|
4217
|
-
message: `Interaction "${o.id}" on element "${
|
|
4218
|
-
elementId:
|
|
4243
|
+
message: `Interaction "${o.id}" on element "${n.id}" runs against "${o.elementId}", but no element answers to that name`,
|
|
4244
|
+
elementId: n.id
|
|
4219
4245
|
});
|
|
4220
4246
|
});
|
|
4221
4247
|
});
|
|
4222
|
-
},
|
|
4223
|
-
Object.values(
|
|
4248
|
+
}, E = () => {
|
|
4249
|
+
Object.values(a).forEach((e) => {
|
|
4224
4250
|
if (!e || !e.definition.bindings) return;
|
|
4225
4251
|
let t = /* @__PURE__ */ new Set();
|
|
4226
|
-
Object.entries(e.definition.bindings).forEach(([
|
|
4252
|
+
Object.entries(e.definition.bindings).forEach(([n, i]) => {
|
|
4227
4253
|
(i ?? []).forEach((i) => {
|
|
4228
4254
|
if (!i.id) {
|
|
4229
|
-
|
|
4255
|
+
r.push({
|
|
4230
4256
|
code: "MISSING_BINDING_ID",
|
|
4231
|
-
message: `Element "${e.id}" has a ${
|
|
4257
|
+
message: `Element "${e.id}" has a ${n} binding to "${i.to}" with no id`,
|
|
4232
4258
|
elementId: e.id
|
|
4233
4259
|
});
|
|
4234
4260
|
return;
|
|
4235
4261
|
}
|
|
4236
|
-
t.has(i.id) &&
|
|
4262
|
+
t.has(i.id) && r.push({
|
|
4237
4263
|
code: "DUPLICATE_BINDING_ID",
|
|
4238
4264
|
message: `Element "${e.id}" has two bindings called "${i.id}"`,
|
|
4239
4265
|
elementId: e.id,
|
|
@@ -4245,60 +4271,60 @@ var t$9 = (t) => {
|
|
|
4245
4271
|
};
|
|
4246
4272
|
return { validate: (e) => {
|
|
4247
4273
|
let { baseElementId: t } = e ?? {};
|
|
4248
|
-
return
|
|
4249
|
-
valid:
|
|
4250
|
-
errors:
|
|
4251
|
-
warnings:
|
|
4274
|
+
return p() ? (m(), h(), g(), _(), v(), y(), b(), x(t), S(), C(), w(e?.sourceTypes), E(), T(), {
|
|
4275
|
+
valid: r.length === 0,
|
|
4276
|
+
errors: r,
|
|
4277
|
+
warnings: i
|
|
4252
4278
|
}) : {
|
|
4253
4279
|
valid: !1,
|
|
4254
|
-
errors:
|
|
4255
|
-
warnings:
|
|
4280
|
+
errors: r,
|
|
4281
|
+
warnings: i
|
|
4256
4282
|
};
|
|
4257
4283
|
} };
|
|
4258
4284
|
};
|
|
4259
|
-
var
|
|
4285
|
+
var r$8 = (e, t) => n$9(e).validate(t);
|
|
4260
4286
|
//#endregion
|
|
4261
4287
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/shared.js
|
|
4262
|
-
function e$
|
|
4288
|
+
function e$5(e) {
|
|
4263
4289
|
if (typeof e == "string" || typeof e == "number") {
|
|
4264
4290
|
let t = String(e);
|
|
4265
4291
|
return t === "" ? null : /^[a-zA-Z0-9_-]+$/.test(t) || /^\d+$/.test(t) ? t : null;
|
|
4266
4292
|
}
|
|
4267
4293
|
return null;
|
|
4268
4294
|
}
|
|
4269
|
-
function t$
|
|
4295
|
+
function t$9(t, n) {
|
|
4270
4296
|
if (!t || t.startsWith(".") || t.endsWith(".") || /[^a-zA-Z0-9_.[\]-]/.test(t) || n && (/\.\.|(\[\])/g.test(t) || (t.match(/\[/g) || []).length !== (t.match(/\]/g) || []).length || /\][^.[]/.test(t))) return [];
|
|
4271
4297
|
let r = [], i = /([^.[\]]+)|\[(\d+)\]/g, a;
|
|
4272
4298
|
for (; a = i.exec(t);) if (a[1]) {
|
|
4273
4299
|
if (!n && a[1] === "") continue;
|
|
4274
|
-
let t = e$
|
|
4300
|
+
let t = e$5(a[1]);
|
|
4275
4301
|
if (t !== null) r.push(t);
|
|
4276
4302
|
else if (n) return [];
|
|
4277
4303
|
} else if (a[2]) {
|
|
4278
|
-
let t = e$
|
|
4304
|
+
let t = e$5(a[2]);
|
|
4279
4305
|
if (t !== null) r.push(t);
|
|
4280
4306
|
else if (n) return [];
|
|
4281
4307
|
}
|
|
4282
4308
|
return r.length ? r : [];
|
|
4283
4309
|
}
|
|
4284
|
-
function n$
|
|
4310
|
+
function n$8(t, n) {
|
|
4285
4311
|
if (!Array.isArray(t)) return [];
|
|
4286
4312
|
let r = [];
|
|
4287
4313
|
for (let i of t) {
|
|
4288
|
-
let t = e$
|
|
4314
|
+
let t = e$5(i);
|
|
4289
4315
|
if (t !== null) r.push(t);
|
|
4290
4316
|
else if (n) return [];
|
|
4291
4317
|
}
|
|
4292
4318
|
return r;
|
|
4293
4319
|
}
|
|
4294
|
-
function r$
|
|
4295
|
-
return e ? typeof e == "string" ? t$
|
|
4320
|
+
function r$7(e, r = !0) {
|
|
4321
|
+
return e ? typeof e == "string" ? t$9(e, r) : Array.isArray(e) ? n$8(e, r) : [] : [];
|
|
4296
4322
|
}
|
|
4297
4323
|
//#endregion
|
|
4298
4324
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/get.js
|
|
4299
|
-
function t$
|
|
4325
|
+
function t$8(t, n, r) {
|
|
4300
4326
|
if (t == null || !n) return r;
|
|
4301
|
-
let i = r$
|
|
4327
|
+
let i = r$7(n);
|
|
4302
4328
|
if (!i.length) return r;
|
|
4303
4329
|
let a = t;
|
|
4304
4330
|
for (let e of i) {
|
|
@@ -4312,8 +4338,8 @@ function t$7(t, n, r) {
|
|
|
4312
4338
|
}
|
|
4313
4339
|
//#endregion
|
|
4314
4340
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/set.js
|
|
4315
|
-
function t$
|
|
4316
|
-
let i = r$
|
|
4341
|
+
function t$7(t, n, r) {
|
|
4342
|
+
let i = r$7(n);
|
|
4317
4343
|
if (!i.length) return t;
|
|
4318
4344
|
let a = t;
|
|
4319
4345
|
for (let e = 0; e < i.length - 1; e++) {
|
|
@@ -4331,17 +4357,17 @@ function t$6(t, n, r) {
|
|
|
4331
4357
|
}
|
|
4332
4358
|
//#endregion
|
|
4333
4359
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/pick.js
|
|
4334
|
-
function n$
|
|
4360
|
+
function n$7(n, r) {
|
|
4335
4361
|
let i = {}, a = Array.isArray(r) ? r : [r];
|
|
4336
4362
|
for (let r of a) {
|
|
4337
|
-
let a = t$
|
|
4338
|
-
a !== void 0 && t$
|
|
4363
|
+
let a = t$8(n, r);
|
|
4364
|
+
a !== void 0 && t$7(i, r, a);
|
|
4339
4365
|
}
|
|
4340
4366
|
return i;
|
|
4341
4367
|
}
|
|
4342
4368
|
//#endregion
|
|
4343
4369
|
//#region ../sdk-shared/dist/style/styleConstants.mjs
|
|
4344
|
-
var e$
|
|
4370
|
+
var e$4 = {
|
|
4345
4371
|
platform: {
|
|
4346
4372
|
desktop: {},
|
|
4347
4373
|
tablet: {},
|
|
@@ -4356,7 +4382,7 @@ var e$3 = {
|
|
|
4356
4382
|
fonts: [],
|
|
4357
4383
|
cache: ""
|
|
4358
4384
|
};
|
|
4359
|
-
var t$
|
|
4385
|
+
var t$6 = {
|
|
4360
4386
|
DISPLAY: "display",
|
|
4361
4387
|
FLEX_WRAP: "flex-wrap",
|
|
4362
4388
|
FLEX_DIRECTION: "flex-direction",
|
|
@@ -4523,37 +4549,37 @@ var t$5 = {
|
|
|
4523
4549
|
STROKE: "stroke",
|
|
4524
4550
|
STROKE_WIDTH: "stroke-width"
|
|
4525
4551
|
};
|
|
4526
|
-
var n$
|
|
4527
|
-
t$
|
|
4528
|
-
t$
|
|
4529
|
-
t$
|
|
4530
|
-
t$
|
|
4531
|
-
t$
|
|
4532
|
-
t$
|
|
4533
|
-
t$
|
|
4534
|
-
t$
|
|
4535
|
-
t$
|
|
4536
|
-
t$
|
|
4537
|
-
t$
|
|
4538
|
-
t$
|
|
4539
|
-
t$
|
|
4540
|
-
t$
|
|
4541
|
-
t$
|
|
4542
|
-
t$
|
|
4543
|
-
t$
|
|
4544
|
-
t$
|
|
4545
|
-
t$
|
|
4546
|
-
t$
|
|
4552
|
+
var n$6 = [
|
|
4553
|
+
t$6.FONT_FAMILY,
|
|
4554
|
+
t$6.FONT_SIZE,
|
|
4555
|
+
t$6.FONT_STYLE,
|
|
4556
|
+
t$6.FONT_VARIANT,
|
|
4557
|
+
t$6.FONT_WEIGHT,
|
|
4558
|
+
t$6.COLOR,
|
|
4559
|
+
t$6.LINE_HEIGHT,
|
|
4560
|
+
t$6.LETTER_SPACING,
|
|
4561
|
+
t$6.TEXT_ALIGN,
|
|
4562
|
+
t$6.TEXT_DECORATION,
|
|
4563
|
+
t$6.TEXT_INDENT,
|
|
4564
|
+
t$6.TEXT_SHADOW,
|
|
4565
|
+
t$6.TEXT_TRANSFORM,
|
|
4566
|
+
t$6.TEXT_WRAP,
|
|
4567
|
+
t$6.TEXT_OVERFLOW,
|
|
4568
|
+
t$6.WHITE_SPACE,
|
|
4569
|
+
t$6.DIRECTION,
|
|
4570
|
+
t$6.CURSOR,
|
|
4571
|
+
t$6.LIST_STYLE,
|
|
4572
|
+
t$6.LIST_STYLE_TYPE
|
|
4547
4573
|
];
|
|
4548
|
-
Object.values(t$
|
|
4574
|
+
Object.values(t$6).map((e) => ({
|
|
4549
4575
|
path: e,
|
|
4550
4576
|
label: e
|
|
4551
4577
|
}));
|
|
4552
|
-
t$
|
|
4578
|
+
t$6.DISPLAY, t$6.FLEX_WRAP, t$6.FLEX_DIRECTION, t$6.ALIGN_ITEMS, t$6.JUSTIFY_ITEMS, t$6.JUSTIFY_CONTENT, t$6.ALIGN_CONTENT, t$6.ROW_GAP, t$6.COLUMN_GAP, t$6.GRID_ROW_GAP, t$6.GRID_COLUMN_GAP, t$6.GRID_TEMPLATE_AREAS, t$6.GRID_TEMPLATE_COLUMNS, t$6.GRID_TEMPLATE_ROWS, t$6.GRID_AUTO_FLOW, t$6.GRID_AUTO_ROWS, t$6.GRID_AUTO_COLUMNS, t$6.GRID_ROW_START, t$6.GRID_COLUMN_START, t$6.GRID_ROW_END, t$6.GRID_COLUMN_END, t$6.ALIGN_SELF, t$6.JUSTIFY_SELF, t$6.ORDER, t$6.FLEX_GROW, t$6.FLEX_SHRINK, t$6.FLEX_BASIS, t$6.LIST_STYLE, t$6.LIST_STYLE_TYPE, t$6.LIST_STYLE_POSITION, t$6.LIST_STYLE_IMAGE, t$6.BACKGROUND_COLOR, t$6.BACKGROUND_IMAGE, t$6.BACKGROUND_POSITION, t$6.BACKGROUND_SIZE, t$6.BACKGROUND_CLIP, t$6.BACKGROUND_ORIGIN, t$6.BACKGROUND_REPEAT, t$6.BACKGROUND_ATTACHMENT, t$6.BACKGROUND_BLEND_MODE, t$6.MASK_IMAGE, t$6.BORDER_TOP_STYLE, t$6.BORDER_TOP_WIDTH, t$6.BORDER_TOP_COLOR, t$6.BORDER_BOTTOM_STYLE, t$6.BORDER_BOTTOM_WIDTH, t$6.BORDER_BOTTOM_COLOR, t$6.BORDER_LEFT_STYLE, t$6.BORDER_LEFT_WIDTH, t$6.BORDER_LEFT_COLOR, t$6.BORDER_RIGHT_STYLE, t$6.BORDER_RIGHT_WIDTH, t$6.BORDER_RIGHT_COLOR, t$6.BORDER_TOP_LEFT_RADIUS, t$6.BORDER_TOP_RIGHT_RADIUS, t$6.BORDER_BOTTOM_LEFT_RADIUS, t$6.BORDER_BOTTOM_RIGHT_RADIUS, t$6.BORDER_COLLAPSE, t$6.BORDER_SPACING, t$6.TABLE_LAYOUT, t$6.OPACITY, t$6.VISIBILITY, t$6.CURSOR, t$6.TRANSITION, t$6.TRANSITION_PROPERTY, t$6.TRANSITION_DURATION, t$6.TRANSITION_TIMING_FUNCTION, t$6.TRANSITION_DELAY, t$6.ANIMATION, t$6.ANIMATION_NAME, t$6.ANIMATION_DURATION, t$6.ANIMATION_TIMING_FUNCTION, t$6.ANIMATION_DELAY, t$6.ANIMATION_ITERATION_COUNT, t$6.ANIMATION_DIRECTION, t$6.ANIMATION_FILL_MODE, t$6.ANIMATION_PLAY_STATE, t$6.BOX_SHADOW, t$6.FILTER, t$6.BACKDROP_FILTER, t$6.MIX_BLEND_MODE, t$6.ISOLATION, t$6.CLIP_PATH, t$6.TRANSFORM, t$6.TRANSFORM_ORIGIN, t$6.PERSPECTIVE, t$6.WILL_CHANGE, t$6.OUTLINE_WIDTH, t$6.OUTLINE_STYLE, t$6.OUTLINE_COLOR, t$6.OUTLINE_OFFSET, t$6.POINTER_EVENTS, t$6.USER_SELECT, t$6.TOUCH_ACTION, t$6.RESIZE, t$6.APPEARANCE, t$6.SCROLL_BEHAVIOR, t$6.OVERSCROLL_BEHAVIOR, t$6.ACCENT_COLOR, t$6.CARET_COLOR, t$6.COLOR_SCHEME, t$6.POSITION, t$6.FLOAT, t$6.CLEAR, t$6.Z_INDEX, t$6.TOP, t$6.BOTTOM, t$6.LEFT, t$6.RIGHT, t$6.BOX_SIZING, t$6.ASPECT_RATIO, t$6.WIDTH, t$6.HEIGHT, t$6.MIN_WIDTH, t$6.MIN_HEIGHT, t$6.MAX_WIDTH, t$6.MAX_HEIGHT, t$6.OVERFLOW, t$6.OVERFLOW_X, t$6.OVERFLOW_Y, t$6.OBJECT_FIT, t$6.OBJECT_POSITION, t$6.COLUMN_WIDTH, t$6.COLUMN_COUNT, t$6.MARGIN_TOP, t$6.MARGIN_BOTTOM, t$6.MARGIN_LEFT, t$6.MARGIN_RIGHT, t$6.PADDING_TOP, t$6.PADDING_BOTTOM, t$6.PADDING_LEFT, t$6.PADDING_RIGHT, t$6.FONT_FAMILY, t$6.FONT_WEIGHT, t$6.FONT_SIZE, t$6.LINE_HEIGHT, t$6.COLOR, t$6.TEXT_ALIGN, t$6.FONT_STYLE, t$6.FONT_VARIANT, t$6.TEXT_DECORATION, t$6.TEXT_DECORATION_LINE, t$6.TEXT_DECORATION_COLOR, t$6.TEXT_DECORATION_STYLE, t$6.TEXT_DECORATION_THICKNESS, t$6.TEXT_UNDERLINE_OFFSET, t$6.LETTER_SPACING, t$6.WORD_SPACING, t$6.TEXT_INDENT, t$6.TEXT_TRANSFORM, t$6.DIRECTION, t$6.WHITE_SPACE, t$6.TEXT_WRAP, t$6.WORD_BREAK, t$6.OVERFLOW_WRAP, t$6.HYPHENS, t$6.VERTICAL_ALIGN, t$6.TEXT_OVERFLOW, t$6.TEXT_SHADOW, t$6.LINE_CLAMP, t$6.WEBKIT_LINE_CLAMP, t$6.WEBKIT_BOX_ORIENT, t$6.FILL, t$6.STROKE, t$6.STROKE_WIDTH;
|
|
4553
4579
|
//#endregion
|
|
4554
4580
|
//#region ../sdk-shared/dist/schema/schemaConstants.mjs
|
|
4555
|
-
var t$
|
|
4556
|
-
var n$
|
|
4581
|
+
var t$5 = /var\(\s*--([a-zA-Z0-9_-]+)\s*\)|\{\{\s*([a-zA-Z0-9_-]+)\s*\}\}/;
|
|
4582
|
+
var n$5 = {
|
|
4557
4583
|
schema: {
|
|
4558
4584
|
definition: {
|
|
4559
4585
|
name: "",
|
|
@@ -4565,12 +4591,12 @@ var n$4 = {
|
|
|
4565
4591
|
pages: [],
|
|
4566
4592
|
pageFolders: []
|
|
4567
4593
|
},
|
|
4568
|
-
style: e$
|
|
4594
|
+
style: e$4,
|
|
4569
4595
|
definition: { rootId: "" }
|
|
4570
4596
|
};
|
|
4571
4597
|
//#endregion
|
|
4572
4598
|
//#region ../sdk-shared/dist/style/fonts.mjs
|
|
4573
|
-
var i$
|
|
4599
|
+
var i$5 = (e) => {
|
|
4574
4600
|
try {
|
|
4575
4601
|
let t = new URL(e);
|
|
4576
4602
|
return t.protocol === "https:" && !t.username && !t.password;
|
|
@@ -4580,21 +4606,21 @@ var i$4 = (e) => {
|
|
|
4580
4606
|
};
|
|
4581
4607
|
//#endregion
|
|
4582
4608
|
//#region ../sdk-shared/dist/style/fontValidation.mjs
|
|
4583
|
-
var t$
|
|
4609
|
+
var t$4 = /* @__PURE__ */ new Set([
|
|
4584
4610
|
"system",
|
|
4585
4611
|
"google",
|
|
4586
4612
|
"remote",
|
|
4587
4613
|
"hosted"
|
|
4588
4614
|
]);
|
|
4589
|
-
var n$
|
|
4615
|
+
var n$4 = /* @__PURE__ */ new Set([
|
|
4590
4616
|
"auto",
|
|
4591
4617
|
"block",
|
|
4592
4618
|
"swap",
|
|
4593
4619
|
"fallback",
|
|
4594
4620
|
"optional"
|
|
4595
4621
|
]);
|
|
4596
|
-
var r$
|
|
4597
|
-
var i$
|
|
4622
|
+
var r$5 = /* @__PURE__ */ new Set(["woff2", "woff"]);
|
|
4623
|
+
var i$4 = 100;
|
|
4598
4624
|
var a$3 = (e) => {
|
|
4599
4625
|
for (let t = 0; t < e.length; t += 1) {
|
|
4600
4626
|
let n = e.charCodeAt(t);
|
|
@@ -4602,15 +4628,15 @@ var a$3 = (e) => {
|
|
|
4602
4628
|
}
|
|
4603
4629
|
return !1;
|
|
4604
4630
|
};
|
|
4605
|
-
var o$
|
|
4631
|
+
var o$4 = class extends Error {};
|
|
4606
4632
|
var s$2 = (e) => {
|
|
4607
|
-
throw new o$
|
|
4633
|
+
throw new o$4(e);
|
|
4608
4634
|
};
|
|
4609
4635
|
var c$1 = (e) => typeof e == "object" && !!e && !Array.isArray(e);
|
|
4610
4636
|
var l = (e) => {
|
|
4611
4637
|
if (typeof e != "string") return s$2("font.family must be a string");
|
|
4612
4638
|
let t = e.trim();
|
|
4613
|
-
return t ? t.length > i$
|
|
4639
|
+
return t ? t.length > i$4 ? s$2(`font.family cannot be longer than ${i$4} characters`) : a$3(t) ? s$2("font.family cannot contain control characters") : t : s$2("font.family cannot be empty");
|
|
4614
4640
|
};
|
|
4615
4641
|
var u = (e) => {
|
|
4616
4642
|
if (e === void 0) return [400];
|
|
@@ -4629,7 +4655,7 @@ var f = (e, t) => {
|
|
|
4629
4655
|
let { weight: n, style: i, format: a, unicodeRange: o } = e;
|
|
4630
4656
|
if (typeof n != "number" || !Number.isInteger(n) || n < 1 || n > 1e3) return s$2(`font.files[${t}].weight must be a whole number between 1 and 1000`);
|
|
4631
4657
|
if (i !== "normal" && i !== "italic") return s$2(`font.files[${t}].style must be "normal" or "italic"`);
|
|
4632
|
-
if (typeof a != "string" || !r$
|
|
4658
|
+
if (typeof a != "string" || !r$5.has(a)) return s$2(`font.files[${t}].format must be "woff2" or "woff"`);
|
|
4633
4659
|
let l = {
|
|
4634
4660
|
weight: n,
|
|
4635
4661
|
style: i,
|
|
@@ -4646,9 +4672,9 @@ var m = (e) => !Array.isArray(e) || e.length === 0 ? s$2("font.files must be a n
|
|
|
4646
4672
|
var h = (r) => {
|
|
4647
4673
|
if (!c$1(r)) return s$2("a font must be an object");
|
|
4648
4674
|
let { source: i, fallback: a, display: o, preload: h } = r;
|
|
4649
|
-
if (typeof i != "string" || !t$
|
|
4675
|
+
if (typeof i != "string" || !t$4.has(i)) return s$2("font.source must be one of: system, google, remote, hosted");
|
|
4650
4676
|
if (typeof a != "string" || !a.trim()) return s$2("font.fallback is required: it is what renders until the face arrives");
|
|
4651
|
-
if (o !== void 0 && (typeof o != "string" || !n$
|
|
4677
|
+
if (o !== void 0 && (typeof o != "string" || !n$4.has(o))) return s$2("font.display must be one of: auto, block, swap, fallback, optional");
|
|
4652
4678
|
if (h !== void 0 && typeof h != "boolean") return s$2("font.preload must be a boolean");
|
|
4653
4679
|
let g = {
|
|
4654
4680
|
family: l(r.family),
|
|
@@ -4677,12 +4703,12 @@ var h = (r) => {
|
|
|
4677
4703
|
source: "remote",
|
|
4678
4704
|
files: m(n).map((t, n) => {
|
|
4679
4705
|
let r = f(t, n), { url: i } = t;
|
|
4680
|
-
return typeof i != "string" || !i$
|
|
4706
|
+
return typeof i != "string" || !i$5(i) ? s$2(`font.files[${n}].url must be an https URL with no credentials in it`) : {
|
|
4681
4707
|
...r,
|
|
4682
4708
|
url: i
|
|
4683
4709
|
};
|
|
4684
4710
|
})
|
|
4685
|
-
} : typeof t != "string" || !i$
|
|
4711
|
+
} : typeof t != "string" || !i$5(t) ? s$2("font.stylesheet must be an https URL with no credentials in it") : {
|
|
4686
4712
|
...g,
|
|
4687
4713
|
source: "remote",
|
|
4688
4714
|
stylesheet: t
|
|
@@ -4699,7 +4725,7 @@ var h = (r) => {
|
|
|
4699
4725
|
};
|
|
4700
4726
|
//#endregion
|
|
4701
4727
|
//#region ../sdk-style/dist/helpers/calculateInheriting.mjs
|
|
4702
|
-
var r$
|
|
4728
|
+
var r$4 = (e, t) => {
|
|
4703
4729
|
let n = [], r = t;
|
|
4704
4730
|
for (; r;) {
|
|
4705
4731
|
n.push(r);
|
|
@@ -4708,7 +4734,7 @@ var r$3 = (e, t) => {
|
|
|
4708
4734
|
}
|
|
4709
4735
|
return n;
|
|
4710
4736
|
};
|
|
4711
|
-
var i$
|
|
4737
|
+
var i$3 = (e, t, n, r, i) => {
|
|
4712
4738
|
let a = [], o = /* @__PURE__ */ new Set(), { definition: { styleSelectors: s, type: c }, attributes: { subType: l } } = e, u = (s[r] || "").split(" ").filter(Boolean);
|
|
4713
4739
|
for (let e of [...u, ...i]) {
|
|
4714
4740
|
if (o.has(e)) continue;
|
|
@@ -4729,17 +4755,17 @@ var i$2 = (e, t, n, r, i) => {
|
|
|
4729
4755
|
return a;
|
|
4730
4756
|
};
|
|
4731
4757
|
var a$2 = (t, n, r, i) => {
|
|
4732
|
-
let a = t$
|
|
4758
|
+
let a = t$8(i, `${t}.defaultStyle`, void 0);
|
|
4733
4759
|
if (a) return a.subTypes && !n && (n = Object.keys(a.subTypes)[0]), n && a.subTypes?.[n] && (a = a.subTypes[n]), {
|
|
4734
4760
|
name: "defaultStyle",
|
|
4735
|
-
attributes: { [r]: t$
|
|
4761
|
+
attributes: { [r]: t$8(a, `style.${r}`, {}) },
|
|
4736
4762
|
componentType: t,
|
|
4737
4763
|
isParent: !1,
|
|
4738
4764
|
isAncestor: !1,
|
|
4739
4765
|
isDefault: !0
|
|
4740
4766
|
};
|
|
4741
4767
|
};
|
|
4742
|
-
var o$
|
|
4768
|
+
var o$3 = (e, t, n, r) => {
|
|
4743
4769
|
let i = e[t];
|
|
4744
4770
|
if (!i) return {};
|
|
4745
4771
|
let a = i.default ?? {}, o = r ? i.variants?.[r]?.default ?? {} : {}, s = n ? i.states?.[n] ?? {} : {}, c = r && n ? i.variants?.[r]?.states?.[n] ?? {} : {};
|
|
@@ -4750,13 +4776,13 @@ var o$2 = (e, t, n, r) => {
|
|
|
4750
4776
|
...c
|
|
4751
4777
|
};
|
|
4752
4778
|
};
|
|
4753
|
-
var s$1 = (e, t, n, r) => o$
|
|
4779
|
+
var s$1 = (e, t, n, r) => o$3(e.attributes, t, n, r);
|
|
4754
4780
|
var c = (e, o, c, l, u = {}, d = {}) => {
|
|
4755
4781
|
let { componentSubType: f, styleSelector: p = "base", styleState: m, styleVariant: h, includeSelf: g = !1, skipSelectors: _ = [], addSelectors: v = [] } = d, y = {
|
|
4756
4782
|
tree: [],
|
|
4757
4783
|
style: {},
|
|
4758
4784
|
parentStyle: {}
|
|
4759
|
-
}, b = e ? r$
|
|
4785
|
+
}, b = e ? r$4(c, e) : [], x = /* @__PURE__ */ new Set();
|
|
4760
4786
|
for (let t of Object.keys(l)) {
|
|
4761
4787
|
let n = l[t];
|
|
4762
4788
|
if (n) {
|
|
@@ -4774,7 +4800,7 @@ var c = (e, o, c, l, u = {}, d = {}) => {
|
|
|
4774
4800
|
continue;
|
|
4775
4801
|
}
|
|
4776
4802
|
if (!e && o) {
|
|
4777
|
-
let e = i$
|
|
4803
|
+
let e = i$3({
|
|
4778
4804
|
definition: {
|
|
4779
4805
|
type: o,
|
|
4780
4806
|
styleSelectors: {},
|
|
@@ -4797,7 +4823,7 @@ var c = (e, o, c, l, u = {}, d = {}) => {
|
|
|
4797
4823
|
continue;
|
|
4798
4824
|
}
|
|
4799
4825
|
for (let r of b) {
|
|
4800
|
-
let s = e?.definition.parentId === r.id, c = r.id !== e?.id, l = i$
|
|
4826
|
+
let s = e?.definition.parentId === r.id, c = r.id !== e?.id, l = i$3(r, r.definition.type === o ? o : void 0, n, p, v);
|
|
4801
4827
|
!g && !c && !m && !h && Object.keys(l).length && (l = l.filter((e) => e.type === "element"));
|
|
4802
4828
|
for (let e of l) (!_.includes(e.name) || c) && y.tree.push({
|
|
4803
4829
|
name: e.name,
|
|
@@ -4821,7 +4847,7 @@ var c = (e, o, c, l, u = {}, d = {}) => {
|
|
|
4821
4847
|
let S = {};
|
|
4822
4848
|
for (let e of y.tree) {
|
|
4823
4849
|
let r = s$1(e, p, m, h);
|
|
4824
|
-
if (r && Object.keys(r).length && ((e.isAncestor || e.isDefault && e.componentType !== o) && (r = n$
|
|
4850
|
+
if (r && Object.keys(r).length && ((e.isAncestor || e.isDefault && e.componentType !== o) && (r = n$7(r, n$6)), Object.keys(r).length)) for (let t of Object.keys(r)) S[t] || (S[t] = []), S[t].push({
|
|
4825
4851
|
key: e.name,
|
|
4826
4852
|
value: r[t],
|
|
4827
4853
|
displayMode: e.displayMode
|
|
@@ -4866,26 +4892,26 @@ var p = class {
|
|
|
4866
4892
|
} else o = this.flat[n];
|
|
4867
4893
|
if (!o) return !1;
|
|
4868
4894
|
}
|
|
4869
|
-
if (r !== "custom" && !Array.isArray(t$
|
|
4870
|
-
switch (t$
|
|
4895
|
+
if (r !== "custom" && !Array.isArray(t$8(o, "definition.items")) || !this.isValidElement(a) || !a$4(this.flat, [a, ...Object.values(i)])) return !1;
|
|
4896
|
+
switch (t$7(this.flat, a.id, a), r) {
|
|
4871
4897
|
case "left":
|
|
4872
4898
|
case "top": {
|
|
4873
|
-
let e = t$
|
|
4899
|
+
let e = t$8(o, "definition.items", []);
|
|
4874
4900
|
if (e.splice(e.findIndex((e) => e === n), 0, a.id), !o) return !1;
|
|
4875
|
-
t$
|
|
4901
|
+
t$7(this.flat, `${o.id}.definition.items`, e), t$7(this.flat, `${a.id}.definition.parentId`, o.id), t$7(this.flat, `${a.id}.definition.rootId`, o.definition.rootId);
|
|
4876
4902
|
break;
|
|
4877
4903
|
}
|
|
4878
4904
|
case "right":
|
|
4879
4905
|
case "bottom": {
|
|
4880
|
-
let e = t$
|
|
4906
|
+
let e = t$8(o, "definition.items", []);
|
|
4881
4907
|
if (e.splice(e.findIndex((e) => e === n) + 1, 0, a.id), !o) return !1;
|
|
4882
|
-
t$
|
|
4908
|
+
t$7(this.flat, `${o.id}.definition.items`, e), t$7(this.flat, `${a.id}.definition.parentId`, o.id), t$7(this.flat, `${a.id}.definition.rootId`, o.definition.rootId);
|
|
4883
4909
|
break;
|
|
4884
4910
|
}
|
|
4885
4911
|
case "inside": {
|
|
4886
|
-
let e = t$
|
|
4912
|
+
let e = t$8(o, "definition.items", []);
|
|
4887
4913
|
if (!o) return !1;
|
|
4888
|
-
t$
|
|
4914
|
+
t$7(this.flat, `${n}.definition.items`, [...e, a.id]), t$7(this.flat, `${a.id}.definition.parentId`, n), t$7(this.flat, `${a.id}.definition.rootId`, o.definition.rootId);
|
|
4889
4915
|
break;
|
|
4890
4916
|
}
|
|
4891
4917
|
case "custom": break;
|
|
@@ -4896,21 +4922,21 @@ var p = class {
|
|
|
4896
4922
|
}), !0;
|
|
4897
4923
|
};
|
|
4898
4924
|
updateElement = (e) => !e || !this.flat[e.id] ? !1 : (this.flat[e.id] = e, !0);
|
|
4899
|
-
renameElement = (t, n) => this.flat[t] ? t === n ? [] : !i$
|
|
4900
|
-
renameConflict = (t, n) => i$
|
|
4925
|
+
renameElement = (t, n) => this.flat[t] ? t === n ? [] : !i$7(this.flat, n) && _(this.flat, { [t]: n }, this.pages) : !1;
|
|
4926
|
+
renameConflict = (t, n) => i$7(this.flat, n, t);
|
|
4901
4927
|
moveElement = (e, t, n, r = "inside") => {
|
|
4902
4928
|
if (n === t || !this.flat[e]) return !1;
|
|
4903
4929
|
let i = this.flat[t];
|
|
4904
4930
|
if (!i) return !1;
|
|
4905
4931
|
let a = this.flat[t];
|
|
4906
4932
|
for (; a;) {
|
|
4907
|
-
let e = t$
|
|
4933
|
+
let e = t$8(a, "definition.parentId");
|
|
4908
4934
|
if (!e) break;
|
|
4909
4935
|
if (a.id === n) return !1;
|
|
4910
4936
|
a = this.flat[e];
|
|
4911
4937
|
}
|
|
4912
4938
|
if (!a) return !1;
|
|
4913
|
-
let o = t$
|
|
4939
|
+
let o = t$8(this.flat, `${e}.definition.items`, []).filter((e) => e !== n);
|
|
4914
4940
|
if ([
|
|
4915
4941
|
"left",
|
|
4916
4942
|
"top",
|
|
@@ -4920,20 +4946,20 @@ var p = class {
|
|
|
4920
4946
|
if (!i.definition.parentId) return !1;
|
|
4921
4947
|
let a = this.flat[i.definition.parentId];
|
|
4922
4948
|
if (!a) return !1;
|
|
4923
|
-
let l = t$
|
|
4949
|
+
let l = t$8(a, "definition.items", []);
|
|
4924
4950
|
a.id === e && (l = o);
|
|
4925
4951
|
let u = l.findIndex((e) => e === t);
|
|
4926
|
-
["right", "bottom"].includes(r) && u++, l.splice(u, 0, n), t$
|
|
4952
|
+
["right", "bottom"].includes(r) && u++, l.splice(u, 0, n), t$7(this.flat, `${e}.definition.items`, o), t$7(this.flat, `${a.id}.definition.items`, l), t$7(this.flat, `${n}.definition.parentId`, a.id);
|
|
4927
4953
|
} else if (r === "inside") {
|
|
4928
4954
|
if (!this.flat[t]) return !1;
|
|
4929
|
-
let r = t$
|
|
4930
|
-
e === t && (r = o), r = [...r, n], t$
|
|
4955
|
+
let r = t$8(this.flat, `${t}.definition.items`, []);
|
|
4956
|
+
e === t && (r = o), r = [...r, n], t$7(this.flat, `${e}.definition.items`, o), t$7(this.flat, `${t}.definition.items`, r), t$7(this.flat, `${n}.definition.parentId`, t);
|
|
4931
4957
|
}
|
|
4932
4958
|
return !0;
|
|
4933
4959
|
};
|
|
4934
|
-
getElement = (e) => t$
|
|
4935
|
-
takenIds = () => r$
|
|
4936
|
-
elementIdConflict = (t, n) => i$
|
|
4960
|
+
getElement = (e) => t$8(this.flat, e);
|
|
4961
|
+
takenIds = () => r$9(this.flat);
|
|
4962
|
+
elementIdConflict = (t, n) => i$7(this.flat, t, n);
|
|
4937
4963
|
cloneElements = (e, t = "", n = "", i = !1) => {
|
|
4938
4964
|
let o = {
|
|
4939
4965
|
acum: {},
|
|
@@ -4952,17 +4978,17 @@ var p = class {
|
|
|
4952
4978
|
}
|
|
4953
4979
|
_(p, l), o.acum = p, o.item = p[l[e]], i && delete o.acum[l[e]];
|
|
4954
4980
|
let m = this.flat[t];
|
|
4955
|
-
return (!m || !Array.isArray(t$
|
|
4981
|
+
return (!m || !Array.isArray(t$8(m, "definition.items"))) && (t = t$8(m, "definition.parentId", t$8(u, "definition.parentId"))), t && t$7(o, "item.definition.parentId", t), o;
|
|
4956
4982
|
};
|
|
4957
4983
|
removeElement = (e, t = !1) => {
|
|
4958
4984
|
let n = this.flat[e];
|
|
4959
|
-
if (!n || n.definition.type === "page" && !t || t && t$
|
|
4960
|
-
let r = t$
|
|
4985
|
+
if (!n || n.definition.type === "page" && !t || t && t$8(n, "attributes.default", !1)) return !1;
|
|
4986
|
+
let r = t$8(n, "definition.items");
|
|
4961
4987
|
r && r.length > 0 && r.forEach((e) => this.removeElement(e));
|
|
4962
|
-
let i = t$
|
|
4988
|
+
let i = t$8(n, "definition.parentId"), a = i ? this.flat[i] : void 0;
|
|
4963
4989
|
if (i && a) {
|
|
4964
4990
|
let { definition: { items: t = [] } } = a;
|
|
4965
|
-
t$
|
|
4991
|
+
t$7(a, "definition.items", t.filter((t) => t !== e)), this.flat[i] = a;
|
|
4966
4992
|
}
|
|
4967
4993
|
return delete this.flat[e], !0;
|
|
4968
4994
|
};
|
|
@@ -4985,22 +5011,24 @@ var p = class {
|
|
|
4985
5011
|
return this.variables = this.variables.filter((t) => e.includes(t.name)), t !== this.variables.length;
|
|
4986
5012
|
};
|
|
4987
5013
|
removeVariable = (e) => this.removeVariables([e]);
|
|
4988
|
-
parentTree = (e) => {
|
|
4989
|
-
let
|
|
4990
|
-
if (!
|
|
5014
|
+
parentTree = (e, t = /* @__PURE__ */ new Set()) => {
|
|
5015
|
+
let n = this.flat[e], r = [];
|
|
5016
|
+
if (!n) return r;
|
|
4991
5017
|
do {
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
5018
|
+
let i = t$8(n, "definition.type");
|
|
5019
|
+
if ((i === "page" || i === "layoutContainer") && !t.has(n.id)) {
|
|
5020
|
+
t.add(n.id);
|
|
5021
|
+
let e = t$8(n, "attributes.layout"), i = t$8(n, "attributes.layoutContainer");
|
|
5022
|
+
e && i && r.push(i, ...this.parentTree(i, t));
|
|
4995
5023
|
}
|
|
4996
|
-
e !==
|
|
4997
|
-
} while (
|
|
4998
|
-
return
|
|
5024
|
+
e !== n.id && r.push(n.id), n = t$8(this.flat, t$8(n, "definition.parentId"), void 0);
|
|
5025
|
+
} while (n);
|
|
5026
|
+
return r;
|
|
4999
5027
|
};
|
|
5000
5028
|
childTree = (e) => {
|
|
5001
5029
|
let t = this.flat[e];
|
|
5002
5030
|
if (!t) return [];
|
|
5003
|
-
let n = [], r = t$
|
|
5031
|
+
let n = [], r = t$8(t, "definition.items");
|
|
5004
5032
|
return r && r.forEach((e) => n.push(e, ...this.childTree(e))), n;
|
|
5005
5033
|
};
|
|
5006
5034
|
isValidElement = (e) => {
|
|
@@ -5012,7 +5040,7 @@ var p = class {
|
|
|
5012
5040
|
};
|
|
5013
5041
|
flatAsTemplate = (e, t, n = !1) => {
|
|
5014
5042
|
let r = {
|
|
5015
|
-
...e$
|
|
5043
|
+
...e$4,
|
|
5016
5044
|
platform: {
|
|
5017
5045
|
desktop: {},
|
|
5018
5046
|
tablet: {},
|
|
@@ -5027,7 +5055,7 @@ var p = class {
|
|
|
5027
5055
|
elementsStyle: r,
|
|
5028
5056
|
variables: i
|
|
5029
5057
|
};
|
|
5030
|
-
let a = t$
|
|
5058
|
+
let a = t$8(this.flat, t);
|
|
5031
5059
|
if (!a) return {
|
|
5032
5060
|
elements: {
|
|
5033
5061
|
acum: {},
|
|
@@ -5039,14 +5067,14 @@ var p = class {
|
|
|
5039
5067
|
let o = this.cloneElements(t, a.definition.parentId);
|
|
5040
5068
|
return o.item ? (Object.values(o.acum).forEach((t) => {
|
|
5041
5069
|
let { id: n } = t;
|
|
5042
|
-
if (t$
|
|
5070
|
+
if (t$7(o.acum, `${n}.definition.rootId`, o.item?.id), c(t, t.definition.type, this.flat, e.platform, {}, { includeSelf: !0 }).tree.forEach((t) => {
|
|
5043
5071
|
let { displayMode: n, name: i } = t;
|
|
5044
5072
|
!(i in r.platform[n]) && i in e.platform[n] && (r.platform[n][i] = e.platform[n][i]);
|
|
5045
5073
|
}), this.variables.length > 0) {
|
|
5046
5074
|
let t = this.getElementVariables(e, n, o.acum);
|
|
5047
5075
|
i = [...i, ...t];
|
|
5048
5076
|
}
|
|
5049
|
-
}), t$
|
|
5077
|
+
}), t$7(o.acum, `${o.item.id}.definition.parentId`, null), n && delete o.acum[o.item.id], i.length > 1 && (i = [...new Set(i)]), {
|
|
5050
5078
|
elements: o,
|
|
5051
5079
|
elementsStyle: r,
|
|
5052
5080
|
variables: i
|
|
@@ -5059,15 +5087,15 @@ var p = class {
|
|
|
5059
5087
|
variables: i
|
|
5060
5088
|
};
|
|
5061
5089
|
};
|
|
5062
|
-
validate = () =>
|
|
5063
|
-
...n$
|
|
5090
|
+
validate = () => r$8({
|
|
5091
|
+
...n$5.schema,
|
|
5064
5092
|
flat: this.flat,
|
|
5065
5093
|
variables: this.variables
|
|
5066
5094
|
});
|
|
5067
5095
|
isValid = () => this.validate().valid;
|
|
5068
5096
|
assertValid = (e) => {
|
|
5069
|
-
let t =
|
|
5070
|
-
...n$
|
|
5097
|
+
let t = r$8({
|
|
5098
|
+
...n$5.schema,
|
|
5071
5099
|
flat: this.flat,
|
|
5072
5100
|
variables: this.variables
|
|
5073
5101
|
});
|
|
@@ -5077,9 +5105,9 @@ var p = class {
|
|
|
5077
5105
|
}
|
|
5078
5106
|
};
|
|
5079
5107
|
getElementVariables = (e, t, n = this.flat, r = this.variables) => {
|
|
5080
|
-
let i = [], a = t$
|
|
5108
|
+
let i = [], a = t$8(n, `${t}.definition.styleSelectors`);
|
|
5081
5109
|
if (!a) return i;
|
|
5082
|
-
let o = new RegExp(t$
|
|
5110
|
+
let o = new RegExp(t$5, "g");
|
|
5083
5111
|
return Object.values(a).filter(Boolean).forEach((t) => {
|
|
5084
5112
|
Object.values(e.platform).forEach((e) => {
|
|
5085
5113
|
let n = e[t];
|
|
@@ -5125,10 +5153,10 @@ var p = class {
|
|
|
5125
5153
|
variables: i
|
|
5126
5154
|
}).getElementVariables(t, n);
|
|
5127
5155
|
};
|
|
5128
|
-
static validate = (e) =>
|
|
5129
|
-
static isValid = (e) =>
|
|
5156
|
+
static validate = (e) => r$8(e);
|
|
5157
|
+
static isValid = (e) => r$8(e).valid;
|
|
5130
5158
|
static assertValid = (e, t) => {
|
|
5131
|
-
let n =
|
|
5159
|
+
let n = r$8(e);
|
|
5132
5160
|
if (!n.valid) {
|
|
5133
5161
|
let e = `Invalid schema${t ? ` (${t})` : ""}: ${n.errors.map((e) => e.message).join("; ")}`;
|
|
5134
5162
|
throw Error(e);
|
|
@@ -5137,7 +5165,7 @@ var p = class {
|
|
|
5137
5165
|
};
|
|
5138
5166
|
//#endregion
|
|
5139
5167
|
//#region ../sdk-variables/dist/VariablesHelper.mjs
|
|
5140
|
-
var o$
|
|
5168
|
+
var o$2 = (e, t = ":root", n = 2, r = !0) => {
|
|
5141
5169
|
let i = [], a = [], o = [], s = " ".repeat(n), c = " ".repeat(n * 2);
|
|
5142
5170
|
for (let [, t] of Object.entries(e)) for (let [e, n] of Object.entries(t)) {
|
|
5143
5171
|
let t = `--${e}`;
|
|
@@ -5150,12 +5178,12 @@ var o$1 = (e, t = ":root", n = 2, r = !0) => {
|
|
|
5150
5178
|
};
|
|
5151
5179
|
//#endregion
|
|
5152
5180
|
//#region ../sdk-style/dist/StyleHelper.mjs
|
|
5153
|
-
var r$
|
|
5181
|
+
var r$3 = {
|
|
5154
5182
|
desktop: "64rem",
|
|
5155
5183
|
tablet: "48rem",
|
|
5156
5184
|
mobile: "0"
|
|
5157
5185
|
};
|
|
5158
|
-
var i$
|
|
5186
|
+
var i$2 = (e) => {
|
|
5159
5187
|
if (e === "mobile") return 0;
|
|
5160
5188
|
if (e === "tablet") return 768;
|
|
5161
5189
|
if (e === "desktop") return 1024;
|
|
@@ -5165,23 +5193,23 @@ var i$1 = (e) => {
|
|
|
5165
5193
|
return t[2] === "rem" ? n * 16 : n;
|
|
5166
5194
|
};
|
|
5167
5195
|
var a$1 = (e) => {
|
|
5168
|
-
let { platform: n, mode: a = "desktop-first", variables: o } = e, s = [], c = Object.keys(n).sort((e, t) => a === "mobile-first" ? i$
|
|
5196
|
+
let { platform: n, mode: a = "desktop-first", variables: o } = e, s = [], c = Object.keys(n).sort((e, t) => a === "mobile-first" ? i$2(e) - i$2(t) : i$2(t) - i$2(e));
|
|
5169
5197
|
return c.forEach((e, t) => {
|
|
5170
5198
|
let i = Object.values(n[e]).sort((e, t) => Number(t.type === "element") - Number(e.type === "element")).map((e) => e.cache).join("\n");
|
|
5171
5199
|
if (!i) return;
|
|
5172
|
-
let o = r$
|
|
5200
|
+
let o = r$3[e] ?? e;
|
|
5173
5201
|
if (a === "mobile-first") o === "0" || e === "mobile" ? s.push(i) : s.push(`@media (min-width: ${o}) {${i}}`);
|
|
5174
5202
|
else {
|
|
5175
|
-
let n = c[t - 1], a = n ? r$
|
|
5203
|
+
let n = c[t - 1], a = n ? r$3[n] ?? n : void 0;
|
|
5176
5204
|
e === "desktop" ? s.push(i) : a ? s.push(`@media (max-width: ${a}) and (min-width: ${o}) {${i}}`) : s.push(`@media (max-width: ${o}) {${i}}`);
|
|
5177
5205
|
}
|
|
5178
|
-
}), o && Object.keys(o).length && s.push(o$
|
|
5206
|
+
}), o && Object.keys(o).length && s.push(o$2(o)), s.join("\n");
|
|
5179
5207
|
};
|
|
5180
5208
|
//#endregion
|
|
5181
5209
|
//#region src/style/properties.ts
|
|
5182
5210
|
/** Every kebab-case CSS property Plitzi's style engine understands. Values written to a definition must use these
|
|
5183
5211
|
* exact keys — camelCase or unknown keys are rejected. */
|
|
5184
|
-
var cssProperties = Array.from(new Set(Object.values(t$
|
|
5212
|
+
var cssProperties = Array.from(new Set(Object.values(t$6))).sort();
|
|
5185
5213
|
var cssPropertySet = new Set(cssProperties);
|
|
5186
5214
|
var isCssProperty = (key) => cssPropertySet.has(key);
|
|
5187
5215
|
var toKebab = (key) => key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
@@ -5892,6 +5920,19 @@ var grid = (columns, gap, extra = {}) => css({
|
|
|
5892
5920
|
...extra
|
|
5893
5921
|
});
|
|
5894
5922
|
//#endregion
|
|
5923
|
+
//#region ../sdk-schema/dist/helpers/styleWithoutTag.mjs
|
|
5924
|
+
var e$3 = (e) => Object.keys(e ?? {}).length > 0;
|
|
5925
|
+
var t$3 = (t) => Object.values(t ?? {}).some(e$3);
|
|
5926
|
+
var n$3 = (n) => e$3(n.default) || t$3(n.states) || Object.values(n.variants ?? {}).some((n) => e$3(n.default) || t$3(n.states));
|
|
5927
|
+
var r$2 = (e, t) => Object.values(e.platform).some((e) => Object.hasOwn(e, t) && Object.values(e[t].attributes).some(n$3));
|
|
5928
|
+
var i$1 = (e, t) => {
|
|
5929
|
+
if (e.definition.type !== "apiContainer") return;
|
|
5930
|
+
let n = e.attributes.subType;
|
|
5931
|
+
if (typeof n == "string" && n !== "") return;
|
|
5932
|
+
let { styleSelectors: i, initialState: a, bindings: o } = e.definition, s = Object.values(i).some((e) => e.split(" ").some((e) => e && r$2(t, e))), c = Object.keys(a?.styleVariant ?? {}).length > 0, l = (o?.style?.length ?? 0) > 0;
|
|
5933
|
+
if (s || c || l) return "has style but no `subType` (container tag), so it renders no element of its own and the style applies to nothing — its children lay out in its parent. Give it a tag (a `subType` of `div`, `section`, …) or move the style onto its parent or a child.";
|
|
5934
|
+
};
|
|
5935
|
+
//#endregion
|
|
5895
5936
|
//#region src/schema/validate.ts
|
|
5896
5937
|
var eachRuleSet = (style, visit) => {
|
|
5897
5938
|
const visitBlock = (block, path) => {
|
|
@@ -5925,13 +5966,22 @@ var validateStyle = (style) => {
|
|
|
5925
5966
|
});
|
|
5926
5967
|
return errors;
|
|
5927
5968
|
};
|
|
5969
|
+
/** Style the page will never show: on an element that renders nothing of its own. Needs both documents. */
|
|
5970
|
+
var validateStyleTargets = (schema, style) => Object.values(schema.flat).flatMap((element) => {
|
|
5971
|
+
const issue = i$1(element, style);
|
|
5972
|
+
return issue ? [{
|
|
5973
|
+
code: "STYLE_WITHOUT_TAG",
|
|
5974
|
+
message: `Element "${element.id}" ${issue}`,
|
|
5975
|
+
elementId: element.id
|
|
5976
|
+
}] : [];
|
|
5977
|
+
});
|
|
5928
5978
|
var validateSpace$1 = ({ schema, style }, options = {}) => {
|
|
5929
|
-
const schemaResult =
|
|
5979
|
+
const schemaResult = r$8(schema, options);
|
|
5930
5980
|
const errors = [...schemaResult.errors, ...validateStyle(style)];
|
|
5931
5981
|
return {
|
|
5932
5982
|
valid: errors.length === 0,
|
|
5933
5983
|
errors,
|
|
5934
|
-
warnings: schemaResult.warnings
|
|
5984
|
+
warnings: [...schemaResult.warnings, ...validateStyleTargets(schema, style)]
|
|
5935
5985
|
};
|
|
5936
5986
|
};
|
|
5937
5987
|
/** The throwing flavour. Returns what was survivable so a caller can decide what to do about it. */
|
|
@@ -6012,9 +6062,9 @@ var SpaceAuthor = class {
|
|
|
6012
6062
|
const pageFolders = this.buildPageFolders();
|
|
6013
6063
|
const pages = this.spec.pages.map((page, index) => this.addPage(page, index));
|
|
6014
6064
|
const style = {
|
|
6015
|
-
...e$
|
|
6016
|
-
mode: this.spec.mode ?? e$
|
|
6017
|
-
theme: this.spec.theme ?? e$
|
|
6065
|
+
...e$4,
|
|
6066
|
+
mode: this.spec.mode ?? e$4.mode,
|
|
6067
|
+
theme: this.spec.theme ?? e$4.theme,
|
|
6018
6068
|
platform: this.platform,
|
|
6019
6069
|
variables: this.spec.variables ?? {},
|
|
6020
6070
|
...this.spec.fonts ? { fonts: this.parseFonts(this.spec.fonts) } : {},
|
|
@@ -6221,23 +6271,6 @@ var SpaceAuthor = class {
|
|
|
6221
6271
|
details: { properties: skipped }
|
|
6222
6272
|
});
|
|
6223
6273
|
}
|
|
6224
|
-
/**
|
|
6225
|
-
* A provider dressed with a class it will never wear.
|
|
6226
|
-
*
|
|
6227
|
-
* An `apiContainer` whose `subType` is left empty — the builder's "Container Tag: None" — renders its children and
|
|
6228
|
-
* no element of its own, so its class and css style nothing and its id finds nothing on the page. Found three times
|
|
6229
|
-
* on real spaces: a counter card with no card, a sticky sidebar that did not stick, a map layer positioned nowhere.
|
|
6230
|
-
* A warning and not a refusal, because a provider with no tag is legal and often right; one with styles is not.
|
|
6231
|
-
*/
|
|
6232
|
-
warnStyleWithoutTag(spec, where) {
|
|
6233
|
-
const subType = spec.attributes?.subType;
|
|
6234
|
-
if (spec.type !== "apiContainer" || typeof subType === "string" && subType !== "" || !spec.class && !spec.css) return;
|
|
6235
|
-
this.styleWarnings.push({
|
|
6236
|
-
code: "provider-style-without-tag",
|
|
6237
|
-
message: `${where} has ${spec.class ? "a class" : "css"} but no \`subType\`, so it renders no element of its own and the style applies to nothing. Give it a tag — \`subType: 'div'\`, or \`section\`, \`aside\`… — or move the style onto a child.`,
|
|
6238
|
-
details: { type: spec.type }
|
|
6239
|
-
});
|
|
6240
|
-
}
|
|
6241
6274
|
writeSelector(name, responsive, where) {
|
|
6242
6275
|
this.warnTabletOnly(responsive, where);
|
|
6243
6276
|
for (const breakpoint of BREAKPOINTS) {
|
|
@@ -6412,7 +6445,6 @@ var SpaceAuthor = class {
|
|
|
6412
6445
|
this.assertStepsKnown(spec.flows, where);
|
|
6413
6446
|
const bindings = withVisibility(spec);
|
|
6414
6447
|
const sourceIndex = this.options.sourceTypes ? this.sources : void 0;
|
|
6415
|
-
this.warnStyleWithoutTag(spec, where);
|
|
6416
6448
|
const element = {
|
|
6417
6449
|
id,
|
|
6418
6450
|
attributes: spec.attributes ?? {},
|
|
@@ -7205,17 +7237,21 @@ var n$2 = (n, r) => ({
|
|
|
7205
7237
|
...r.canBind === void 0 ? {} : { canBind: r.canBind },
|
|
7206
7238
|
...r.elementType === void 0 ? {} : { elementType: r.elementType }
|
|
7207
7239
|
});
|
|
7208
|
-
var r$1 =
|
|
7209
|
-
var i = (e
|
|
7240
|
+
var r$1 = /* @__PURE__ */ new WeakMap();
|
|
7241
|
+
var i = (e) => {
|
|
7242
|
+
let t = r$1.get(e);
|
|
7243
|
+
return t || (t = Object.fromEntries(Object.entries(e).map(([e, t]) => [e, n$2(e, t)])), r$1.set(e, t)), t;
|
|
7244
|
+
};
|
|
7245
|
+
var a = (e, t, n, r = {}) => ({
|
|
7210
7246
|
action: e,
|
|
7211
7247
|
title: t.title,
|
|
7212
7248
|
type: t.type ?? "globalCallback",
|
|
7213
7249
|
callback: n,
|
|
7214
7250
|
preview: t.preview ?? {},
|
|
7215
|
-
params:
|
|
7216
|
-
...
|
|
7251
|
+
params: i(t.params),
|
|
7252
|
+
...r
|
|
7217
7253
|
});
|
|
7218
|
-
var
|
|
7254
|
+
var o$1 = (e, t, n = {}) => Object.fromEntries(Object.keys(e).map((r) => [r, a(r, e[r], t[r], n[r] ?? {})]));
|
|
7219
7255
|
//#endregion
|
|
7220
7256
|
//#region ../sdk-shared/dist/authoring/elementCallbacks.mjs
|
|
7221
7257
|
var t = {
|
|
@@ -7345,4 +7381,4 @@ var validateTemplate = (template, options = {}) => validateTemplate$1(template,
|
|
|
7345
7381
|
...options
|
|
7346
7382
|
});
|
|
7347
7383
|
//#endregion
|
|
7348
|
-
export { BREAKPOINTS, t as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, GLOBAL_SOURCES, addNotification, apiContainer, appendState, applyBuiltinCallback, r as applyElementCallback, applyUtility, assertSpaceValid, assertTemplateValid, authLogin, authLogout, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSpace, authorTemplate, blankSpace, blankSpaceSource, space as blankSpaceSpec, blockHtml, blockJsx, buildHandles, button, cancelServerAction, className, clearState, column, container, css, cssProperties, cssShorthands, custom, defineAction, defineElement, delay, dialogContainer, digest, dropdown, dropdownPopup, element, elementCatalog, e as elementDeclaration, elementSourceTypes, elementTypeNames, elementsFromManifest, expandShorthand, expandShorthandPatch, fontAwesome, form, formControl, n as getElementCallback, getGlobalCallback, getTransformer, getUtility, grid, groupBindings, heading, t$1 as hiddenParams, hiddenWhen, hostAction, image, o as invalidParams, invalidateQueries, isCssProperty, isCustomProperty, link, list, listItem, locate, markdown, n$1 as missingRequiredParams, modalContainer, moveState, named, navigate, nodeHtml, on, onClick, onFlowEnd, onFlowError, onFlowProgress, onLoad, onSubmit, pagination, paragraph, pathForSlug, s as reconcileParams, reference, reloadApi, removeState, resetForm, resolveSource, richText, row, runServerAction, sameRules, selectorFor, setState, shorthandLonghands, slugify, e$1 as spaceCallbacks, styles, suggestCssProperty, suggestTransformer, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, text, themeToggle, toBindingSpecs,
|
|
7384
|
+
export { BREAKPOINTS, t as BUILTIN_ELEMENT_CALLBACKS, BUILTIN_GLOBAL_CALLBACKS, BUILTIN_TRANSFORMERS, BUILTIN_UTILITIES, GLOBAL_SOURCES, addNotification, apiContainer, appendState, applyBuiltinCallback, r as applyElementCallback, applyUtility, assertSpaceValid, assertTemplateValid, authLogin, authLogout, authRefreshDetails, authorBinding, authorFlow, authorFlows, authorSpace, authorTemplate, blankSpace, blankSpaceSource, space as blankSpaceSpec, blockHtml, blockJsx, buildHandles, button, cancelServerAction, className, clearState, column, container, css, cssProperties, cssShorthands, custom, defineAction, defineElement, delay, dialogContainer, digest, dropdown, dropdownPopup, element, elementCatalog, e as elementDeclaration, elementSourceTypes, elementTypeNames, elementsFromManifest, expandShorthand, expandShorthandPatch, fontAwesome, form, formControl, n as getElementCallback, getGlobalCallback, getTransformer, getUtility, grid, groupBindings, heading, t$1 as hiddenParams, hiddenWhen, hostAction, image, o as invalidParams, invalidateQueries, isCssProperty, isCustomProperty, link, list, listItem, locate, markdown, n$1 as missingRequiredParams, modalContainer, moveState, named, navigate, nodeHtml, on, onClick, onFlowEnd, onFlowError, onFlowProgress, onLoad, onSubmit, pagination, paragraph, pathForSlug, s as reconcileParams, reference, reloadApi, removeState, resetForm, resolveSource, richText, row, runServerAction, sameRules, selectorFor, setState, shorthandLonghands, slugify, e$1 as spaceCallbacks, styles, suggestCssProperty, suggestTransformer, tabContainer, tabContainerBody, tabContainerHeader, tabContainerItem, text, themeToggle, toBindingSpecs, i as toBuilderParams, a as toInteractionCallback, o$1 as toInteractionCallbacks, toPortableSource, toResponsive, toggleElement, toggleInState, toggleState, transformerCatalog, twigTemplate, updateElement, validateSpace, validateTemplate, video, visibleWhen, webHook, when, whenFailed, whenSucceeded, withVisibility };
|