@plitzi/sdk-authoring 0.38.8 → 0.38.9
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 +62 -0
- package/dist/index-src.js +474 -238
- package/dist/index.d.ts +54 -12
- package/dist/index.js +2 -2
- package/dist/node.d.ts +19 -0
- package/dist/node.js +10 -0
- package/package.json +6 -6
- package/skills/plitzi-authoring/recipes/detail-page.ts +4 -2
- package/skills/plitzi-authoring/reference/accessibility.md +2 -0
- package/skills/plitzi-authoring/reference/authoring-errors.md +3 -0
- package/skills/plitzi-authoring/reference/flows.md +2 -2
- package/skills/plitzi-authoring/reference/layouts.md +18 -0
- package/skills/plitzi-authoring/reference/recipes.md +1 -1
package/dist/index-src.js
CHANGED
|
@@ -14,16 +14,16 @@ var __exportAll = (all, no_symbols) => {
|
|
|
14
14
|
var e$42 = "[a-zA-Z_][a-zA-Z0-9_]*(?:-[a-zA-Z0-9_]+)*";
|
|
15
15
|
var t$63 = `(?:${e$42}|\\d+)`;
|
|
16
16
|
var n$47 = `\\[\\s*(?:\\d+|'[^']*'|"[^"]*"|${e$42}(?:\\.${t$63})*)\\s*\\]`;
|
|
17
|
-
var r$
|
|
18
|
-
var i$28 = `\\{\\{\\s*${r$
|
|
19
|
-
var a$24 = `(?:${`\\{\\{\\{\\s*${r$
|
|
17
|
+
var r$36 = `${`${e$42}(?:${n$47})*(?:\\??\\.${t$63}(?:${n$47})*)*`}(?:\\s*\\?\\?\\s*[^|{}]+?)?(?:\\s*\\|\\s*[a-zA-Z_]+(?:\\([^)]*\\))?)*`;
|
|
18
|
+
var i$28 = `\\{\\{\\s*${r$36}\\s*\\}\\}`;
|
|
19
|
+
var a$24 = `(?:${`\\{\\{\\{\\s*${r$36}\\s*\\}\\}\\}`}|${i$28})`;
|
|
20
20
|
var o$26 = new RegExp(a$24, "g");
|
|
21
|
-
var s$
|
|
21
|
+
var s$24 = RegExp(`^${a$24}$`);
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region ../sdk-shared/dist/helpers/twigWrapper/tokens/hasValidToken.mjs
|
|
24
24
|
var n$46 = (n, r = !1) => {
|
|
25
25
|
if (typeof n != "string") return !1;
|
|
26
|
-
let i = r ? s$
|
|
26
|
+
let i = r ? s$24 : o$26;
|
|
27
27
|
return i.lastIndex = 0, i.test(n.trim());
|
|
28
28
|
};
|
|
29
29
|
//#endregion
|
|
@@ -43,7 +43,7 @@ var n$45 = (e, t, n) => {
|
|
|
43
43
|
for (let [i, a] of Object.entries(n)) a.when && e[i] !== void 0 && !a.when(t) && r.push(i);
|
|
44
44
|
return r;
|
|
45
45
|
};
|
|
46
|
-
var r$
|
|
46
|
+
var r$35 = (e, t, n) => {
|
|
47
47
|
let r = [];
|
|
48
48
|
for (let [i, a] of Object.entries(n)) a.required && e[i] === void 0 && (!a.when || a.when(t)) && r.push(i);
|
|
49
49
|
return r;
|
|
@@ -63,7 +63,7 @@ var o$25 = (e, t) => {
|
|
|
63
63
|
default: return !0;
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
var s$
|
|
66
|
+
var s$23 = (e, t, n) => {
|
|
67
67
|
let r = [];
|
|
68
68
|
for (let [i, s] of Object.entries(n)) {
|
|
69
69
|
let n = e[i];
|
|
@@ -91,10 +91,10 @@ var t$61 = [
|
|
|
91
91
|
"end",
|
|
92
92
|
"nearest"
|
|
93
93
|
];
|
|
94
|
-
var s$
|
|
94
|
+
var s$22 = "onScroll";
|
|
95
95
|
//#endregion
|
|
96
96
|
//#region ../sdk-shared/dist/authoring/elementCallbacks.mjs
|
|
97
|
-
var r$
|
|
97
|
+
var r$34 = {
|
|
98
98
|
type: "select",
|
|
99
99
|
description: "How it moves: \"smooth\" glides there, \"auto\" jumps.",
|
|
100
100
|
default: "smooth",
|
|
@@ -116,7 +116,7 @@ var i$26 = {
|
|
|
116
116
|
description: "How far down, the same way; negative goes up.",
|
|
117
117
|
default: ""
|
|
118
118
|
},
|
|
119
|
-
behavior: r$
|
|
119
|
+
behavior: r$34
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
122
|
scrollTo: {
|
|
@@ -134,7 +134,7 @@ var i$26 = {
|
|
|
134
134
|
description: "Where down, the same way. Empty stays.",
|
|
135
135
|
default: ""
|
|
136
136
|
},
|
|
137
|
-
behavior: r$
|
|
137
|
+
behavior: r$34
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
scrollIntoView: {
|
|
@@ -154,7 +154,7 @@ var i$26 = {
|
|
|
154
154
|
default: "nearest",
|
|
155
155
|
options: [...t$61]
|
|
156
156
|
},
|
|
157
|
-
behavior: r$
|
|
157
|
+
behavior: r$34
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
};
|
|
@@ -218,7 +218,7 @@ var a$22 = {
|
|
|
218
218
|
...i$26
|
|
219
219
|
};
|
|
220
220
|
var o$24 = (e) => Object.hasOwn(a$22, e) ? a$22[e] : void 0;
|
|
221
|
-
var s$
|
|
221
|
+
var s$21 = (t, n) => {
|
|
222
222
|
let r = o$24(t);
|
|
223
223
|
return r ? {
|
|
224
224
|
known: !0,
|
|
@@ -252,6 +252,7 @@ var elementAttributeNames = {
|
|
|
252
252
|
"loadingSlot",
|
|
253
253
|
"method",
|
|
254
254
|
"mockData",
|
|
255
|
+
"notFound",
|
|
255
256
|
"pageParam",
|
|
256
257
|
"pagination",
|
|
257
258
|
"query",
|
|
@@ -407,6 +408,7 @@ var elementAttributeNames = {
|
|
|
407
408
|
list: [
|
|
408
409
|
"itemKey",
|
|
409
410
|
"items",
|
|
411
|
+
"label",
|
|
410
412
|
"source",
|
|
411
413
|
"subType"
|
|
412
414
|
],
|
|
@@ -723,7 +725,11 @@ var elementAttributeNames = {
|
|
|
723
725
|
tabContainerBody: [],
|
|
724
726
|
tabContainerHeader: [],
|
|
725
727
|
tabContainerItem: [],
|
|
726
|
-
text: [
|
|
728
|
+
text: [
|
|
729
|
+
"content",
|
|
730
|
+
"decorative",
|
|
731
|
+
"title"
|
|
732
|
+
],
|
|
727
733
|
themeToggle: [
|
|
728
734
|
"darkLabel",
|
|
729
735
|
"lightLabel",
|
|
@@ -1155,7 +1161,7 @@ var n$44 = {
|
|
|
1155
1161
|
"border-bottom-left-radius": "4px",
|
|
1156
1162
|
"border-bottom-right-radius": "4px"
|
|
1157
1163
|
};
|
|
1158
|
-
var r$
|
|
1164
|
+
var r$33 = t$60()({
|
|
1159
1165
|
type: "button",
|
|
1160
1166
|
attributeValues: {
|
|
1161
1167
|
subType: e$39()([
|
|
@@ -1823,7 +1829,7 @@ var n$39 = {
|
|
|
1823
1829
|
"letter-spacing": "inherit",
|
|
1824
1830
|
cursor: "pointer"
|
|
1825
1831
|
};
|
|
1826
|
-
var r$
|
|
1832
|
+
var r$32 = t$60()({
|
|
1827
1833
|
type: "themeToggle",
|
|
1828
1834
|
attributeValues: { subType: e$39()(["switch", "segmented"]) },
|
|
1829
1835
|
triggers: { onThemeChange: {
|
|
@@ -2025,7 +2031,7 @@ var n$37 = {
|
|
|
2025
2031
|
outline: "none",
|
|
2026
2032
|
position: "relative"
|
|
2027
2033
|
};
|
|
2028
|
-
var r$
|
|
2034
|
+
var r$31 = {
|
|
2029
2035
|
...n$37,
|
|
2030
2036
|
"line-height": "20px"
|
|
2031
2037
|
};
|
|
@@ -2047,7 +2053,7 @@ var o$23 = {
|
|
|
2047
2053
|
color: "red",
|
|
2048
2054
|
"margin-top": "4px"
|
|
2049
2055
|
};
|
|
2050
|
-
var s$
|
|
2056
|
+
var s$20 = {
|
|
2051
2057
|
color: "red",
|
|
2052
2058
|
"margin-left": "4px"
|
|
2053
2059
|
};
|
|
@@ -2066,7 +2072,7 @@ var l$13 = {
|
|
|
2066
2072
|
"padding-left": "0px",
|
|
2067
2073
|
display: "block",
|
|
2068
2074
|
...c$18,
|
|
2069
|
-
"background-color": "
|
|
2075
|
+
"background-color": "transparent",
|
|
2070
2076
|
color: "inherit",
|
|
2071
2077
|
"line-height": "inherit",
|
|
2072
2078
|
"font-family": "inherit",
|
|
@@ -2087,7 +2093,7 @@ var u$13 = {
|
|
|
2087
2093
|
cursor: "inherit",
|
|
2088
2094
|
"box-shadow": "none"
|
|
2089
2095
|
};
|
|
2090
|
-
var d$
|
|
2096
|
+
var d$12 = {
|
|
2091
2097
|
height: "100%",
|
|
2092
2098
|
"margin-top": "0px",
|
|
2093
2099
|
"margin-right": "0px",
|
|
@@ -2107,11 +2113,11 @@ var d$13 = {
|
|
|
2107
2113
|
"font-weight": "inherit",
|
|
2108
2114
|
cursor: "pointer"
|
|
2109
2115
|
};
|
|
2110
|
-
var f$
|
|
2116
|
+
var f$10 = {
|
|
2111
2117
|
...n$37,
|
|
2112
2118
|
cursor: "pointer"
|
|
2113
2119
|
};
|
|
2114
|
-
var p$
|
|
2120
|
+
var p$11 = {
|
|
2115
2121
|
height: "20px",
|
|
2116
2122
|
width: "36px",
|
|
2117
2123
|
"margin-top": "0px",
|
|
@@ -2141,7 +2147,7 @@ var p$10 = {
|
|
|
2141
2147
|
appearance: "none",
|
|
2142
2148
|
cursor: "pointer"
|
|
2143
2149
|
};
|
|
2144
|
-
var m$
|
|
2150
|
+
var m$7 = (e, t, { field: n, icon: r } = {}) => ({
|
|
2145
2151
|
name: e,
|
|
2146
2152
|
displayMode: "desktop",
|
|
2147
2153
|
style: {
|
|
@@ -2150,7 +2156,7 @@ var m$6 = (e, t, { field: n, icon: r } = {}) => ({
|
|
|
2150
2156
|
...n ? { field: { default: n } } : {},
|
|
2151
2157
|
...r ? { icon: { default: r } } : {},
|
|
2152
2158
|
label: { default: a$21 },
|
|
2153
|
-
requiredMark: { default: s$
|
|
2159
|
+
requiredMark: { default: s$20 },
|
|
2154
2160
|
error: { default: o$23 }
|
|
2155
2161
|
}
|
|
2156
2162
|
});
|
|
@@ -2196,7 +2202,7 @@ var g$4 = t$60()({
|
|
|
2196
2202
|
autoFocus: !1,
|
|
2197
2203
|
disabled: !1,
|
|
2198
2204
|
options: [],
|
|
2199
|
-
required: !
|
|
2205
|
+
required: !1,
|
|
2200
2206
|
requiredMessage: "",
|
|
2201
2207
|
minLength: 0,
|
|
2202
2208
|
minLengthMessage: "",
|
|
@@ -2248,26 +2254,26 @@ var g$4 = t$60()({
|
|
|
2248
2254
|
displayMode: "desktop",
|
|
2249
2255
|
style: { base: { default: {} } },
|
|
2250
2256
|
subTypes: {
|
|
2251
|
-
hidden: m$
|
|
2252
|
-
text: m$
|
|
2253
|
-
number: m$
|
|
2254
|
-
email: m$
|
|
2255
|
-
password: m$
|
|
2257
|
+
hidden: m$7("Form Control Hidden", {}),
|
|
2258
|
+
text: m$7("Form Control Text", r$31, h$4),
|
|
2259
|
+
number: m$7("Form Control Number", r$31, h$4),
|
|
2260
|
+
email: m$7("Form Control Email", r$31, h$4),
|
|
2261
|
+
password: m$7("Form Control Password", r$31, {
|
|
2256
2262
|
...h$4,
|
|
2257
|
-
icon: d$
|
|
2263
|
+
icon: d$12
|
|
2258
2264
|
}),
|
|
2259
|
-
search: m$
|
|
2260
|
-
url: m$
|
|
2261
|
-
tel: m$
|
|
2262
|
-
date: m$
|
|
2263
|
-
time: m$
|
|
2264
|
-
color: m$
|
|
2265
|
-
textarea: m$
|
|
2266
|
-
...r$
|
|
2265
|
+
search: m$7("Form Control Search", r$31, h$4),
|
|
2266
|
+
url: m$7("Form Control URL", r$31, h$4),
|
|
2267
|
+
tel: m$7("Form Control Phone", r$31, h$4),
|
|
2268
|
+
date: m$7("Form Control Date", r$31, h$4),
|
|
2269
|
+
time: m$7("Form Control Time", r$31, h$4),
|
|
2270
|
+
color: m$7("Form Control Color", r$31, h$4),
|
|
2271
|
+
textarea: m$7("Form Control Textarea", {
|
|
2272
|
+
...r$31,
|
|
2267
2273
|
color: "inherit",
|
|
2268
2274
|
resize: "vertical"
|
|
2269
2275
|
}),
|
|
2270
|
-
select: m$
|
|
2276
|
+
select: m$7("Form Control Select", f$10, { field: u$13 }),
|
|
2271
2277
|
checkbox: {
|
|
2272
2278
|
name: "Form Control Checkbox",
|
|
2273
2279
|
displayMode: "desktop",
|
|
@@ -2280,7 +2286,7 @@ var g$4 = t$60()({
|
|
|
2280
2286
|
"margin-right": "4px"
|
|
2281
2287
|
} },
|
|
2282
2288
|
label: { default: i$25 },
|
|
2283
|
-
requiredMark: { default: s$
|
|
2289
|
+
requiredMark: { default: s$20 },
|
|
2284
2290
|
error: { default: o$23 }
|
|
2285
2291
|
}
|
|
2286
2292
|
},
|
|
@@ -2289,12 +2295,12 @@ var g$4 = t$60()({
|
|
|
2289
2295
|
displayMode: "desktop",
|
|
2290
2296
|
style: {
|
|
2291
2297
|
base: { default: {} },
|
|
2292
|
-
input: { default: p$
|
|
2298
|
+
input: { default: p$11 },
|
|
2293
2299
|
label: { default: {
|
|
2294
2300
|
...i$25,
|
|
2295
2301
|
"align-items": "center"
|
|
2296
2302
|
} },
|
|
2297
|
-
requiredMark: { default: s$
|
|
2303
|
+
requiredMark: { default: s$20 },
|
|
2298
2304
|
error: { default: o$23 }
|
|
2299
2305
|
}
|
|
2300
2306
|
}
|
|
@@ -2916,7 +2922,7 @@ var n$34 = t$60()({
|
|
|
2916
2922
|
definition: {
|
|
2917
2923
|
label: "Api Container",
|
|
2918
2924
|
type: "apiContainer",
|
|
2919
|
-
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, and `refreshSeconds` makes it ask again on its own every N seconds (either runtime; paused while the tab is hidden) — the way to keep a queue, feed or status board current without a plugin. 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.",
|
|
2925
|
+
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, and `refreshSeconds` makes it ask again on its own every N seconds (either runtime; paused while the tab is hidden) — the way to keep a queue, feed or status board current without a plugin. A server provider (`runtime: \"server\"`) whose answer means the address shows nothing — a record not found — says so in `notFound`, a template against its answer (`{{ source.found == false }}`): the page is sent with status 404, rendered as written. 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.",
|
|
2920
2926
|
items: [],
|
|
2921
2927
|
bindings: {},
|
|
2922
2928
|
styleSelectors: { base: "" },
|
|
@@ -3234,7 +3240,7 @@ var n$32 = [
|
|
|
3234
3240
|
"aside",
|
|
3235
3241
|
"figure"
|
|
3236
3242
|
];
|
|
3237
|
-
var r$
|
|
3243
|
+
var r$30 = t$60()({
|
|
3238
3244
|
type: "container",
|
|
3239
3245
|
attributeValues: {
|
|
3240
3246
|
subType: e$39()([
|
|
@@ -3355,11 +3361,11 @@ var B = {
|
|
|
3355
3361
|
ApiContainer: n$34,
|
|
3356
3362
|
BlockHtml: t$59,
|
|
3357
3363
|
BlockJsx: t$58,
|
|
3358
|
-
Button: r$
|
|
3364
|
+
Button: r$33,
|
|
3359
3365
|
Carousel: t$43,
|
|
3360
3366
|
CarouselTrack: t$42,
|
|
3361
3367
|
Channel: n$33,
|
|
3362
|
-
Container: r$
|
|
3368
|
+
Container: r$30,
|
|
3363
3369
|
Custom: t$57,
|
|
3364
3370
|
DialogContainer: t$60()({
|
|
3365
3371
|
type: "dialogContainer",
|
|
@@ -4113,7 +4119,7 @@ var B = {
|
|
|
4113
4119
|
}
|
|
4114
4120
|
}),
|
|
4115
4121
|
Text: t$51,
|
|
4116
|
-
ThemeToggle: r$
|
|
4122
|
+
ThemeToggle: r$32,
|
|
4117
4123
|
Video: t$44
|
|
4118
4124
|
};
|
|
4119
4125
|
//#endregion
|
|
@@ -4683,6 +4689,16 @@ var AUTHORING_CODES = {
|
|
|
4683
4689
|
means: "a `runtime: 'server'` element inside a component: the page server resolves a page's and its layouts', never a component's",
|
|
4684
4690
|
fix: "put the provider on the page, around the instance, and hand the component its rows as a prop"
|
|
4685
4691
|
},
|
|
4692
|
+
"not-found-in-browser": {
|
|
4693
|
+
kind: "refused",
|
|
4694
|
+
means: "`notFound` on a provider asked from the browser — its answer arrives after the page was sent with its status",
|
|
4695
|
+
fix: "`runtime: 'server'` on the provider, or `visible` on the page's \"not found\" part instead"
|
|
4696
|
+
},
|
|
4697
|
+
"not-found-not-a-template": {
|
|
4698
|
+
kind: "refused",
|
|
4699
|
+
means: "`notFound` that is not one `{{ expression }}` against the answer — never `true`, so never a 404",
|
|
4700
|
+
fix: "`notFound: '{{ source.found == false }}'`"
|
|
4701
|
+
},
|
|
4686
4702
|
"server-data-in-browser": {
|
|
4687
4703
|
kind: "refused",
|
|
4688
4704
|
means: "a provider asking for the project's own data (`/data/…`, read by its server from `src/data/` and never served) from the browser",
|
|
@@ -5168,6 +5184,11 @@ var AUTHORING_CODES = {
|
|
|
5168
5184
|
means: "a colour written out in a class where the space has a token of that value — it stays put in the dark scheme",
|
|
5169
5185
|
fix: "`var(--token)` when it should follow the scheme; a token of one value of its own when it must stay the same in both"
|
|
5170
5186
|
},
|
|
5187
|
+
"not-found-page": {
|
|
5188
|
+
kind: "suggested",
|
|
5189
|
+
means: "a space with no page of its own for an address no other page answers — a plain one was added, in the home page’s layout, sent with status 404",
|
|
5190
|
+
fix: "a page whose slug is `'*'`: `{ id: 'not-found', name: 'Not found', slug: '*', layout: …, body: [...] }`"
|
|
5191
|
+
},
|
|
5171
5192
|
"unused-component": {
|
|
5172
5193
|
kind: "suggested",
|
|
5173
5194
|
means: "a component no page, layout or other component places",
|
|
@@ -5439,7 +5460,7 @@ var e$37 = {
|
|
|
5439
5460
|
};
|
|
5440
5461
|
var t$33 = (t) => t >= 97 && t <= 122 || t >= 65 && t <= 90 || t === e$37.Underscore;
|
|
5441
5462
|
var n$27 = (n) => t$33(n) || n >= e$37.Zero && n <= e$37.Nine;
|
|
5442
|
-
var r$
|
|
5463
|
+
var r$28 = (t) => n$27(t) || t === e$37.Minus;
|
|
5443
5464
|
var i$24 = (t) => t >= e$37.Zero && t <= e$37.Nine;
|
|
5444
5465
|
var a$20 = (t) => t === e$37.Space || t === e$37.Tab || t === e$37.Newline || t === e$37.CarriageReturn;
|
|
5445
5466
|
var o$22 = (e) => {
|
|
@@ -5448,7 +5469,7 @@ var o$22 = (e) => {
|
|
|
5448
5469
|
for (let t = 1; t < r; t++) if (!n$27(e.charCodeAt(t))) return !1;
|
|
5449
5470
|
return !0;
|
|
5450
5471
|
};
|
|
5451
|
-
var s$
|
|
5472
|
+
var s$19 = (r) => {
|
|
5452
5473
|
let a = r.length;
|
|
5453
5474
|
if (a === 0 || !t$33(r.charCodeAt(0))) return !1;
|
|
5454
5475
|
let o = !1, s = !1;
|
|
@@ -5554,7 +5575,7 @@ var o$21 = class {
|
|
|
5554
5575
|
}
|
|
5555
5576
|
scanName() {
|
|
5556
5577
|
let e = this.pos;
|
|
5557
|
-
if (!this.eof() && t$33(this.src.charCodeAt(this.pos))) for (this.pos++; !this.eof() && r$
|
|
5578
|
+
if (!this.eof() && t$33(this.src.charCodeAt(this.pos))) for (this.pos++; !this.eof() && r$28(this.src.charCodeAt(this.pos));) this.pos++;
|
|
5558
5579
|
return this.src.slice(e, this.pos);
|
|
5559
5580
|
}
|
|
5560
5581
|
scanIndex() {
|
|
@@ -5599,17 +5620,17 @@ var o$21 = class {
|
|
|
5599
5620
|
};
|
|
5600
5621
|
//#endregion
|
|
5601
5622
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs
|
|
5602
|
-
var r$
|
|
5603
|
-
let n = new s$
|
|
5623
|
+
var r$27 = (e, t) => {
|
|
5624
|
+
let n = new s$18(e, t), r = n.parseTernary();
|
|
5604
5625
|
return n.expectEnd(), r;
|
|
5605
5626
|
};
|
|
5606
5627
|
var i$23 = (e, t) => {
|
|
5607
|
-
let n = new s$
|
|
5628
|
+
let n = new s$18(e, t), r = n.parseApplyChain();
|
|
5608
5629
|
return n.expectEnd(), r;
|
|
5609
5630
|
};
|
|
5610
5631
|
var a$19 = ["same as", "divisible by"];
|
|
5611
5632
|
var o$20 = "`matches` is not supported: templates evaluate no regular expressions. Use `starts with`, `ends with` or `in`.";
|
|
5612
|
-
var s$
|
|
5633
|
+
var s$18 = class extends o$21 {
|
|
5613
5634
|
issues;
|
|
5614
5635
|
constructor(e, t) {
|
|
5615
5636
|
super(e), this.issues = t;
|
|
@@ -5723,7 +5744,7 @@ var s$17 = class extends o$21 {
|
|
|
5723
5744
|
return this.pos = this.src.length, {
|
|
5724
5745
|
type: "unary",
|
|
5725
5746
|
operator: "not",
|
|
5726
|
-
operand: r$
|
|
5747
|
+
operand: r$27(t, this.issues)
|
|
5727
5748
|
};
|
|
5728
5749
|
}
|
|
5729
5750
|
if (this.matchKeyword("in")) {
|
|
@@ -6062,7 +6083,7 @@ var n$26 = (e) => {
|
|
|
6062
6083
|
for (; n < e.length && !a$20(e.charCodeAt(n));) n++;
|
|
6063
6084
|
return e.slice(0, n);
|
|
6064
6085
|
};
|
|
6065
|
-
var r$
|
|
6086
|
+
var r$26 = (t) => {
|
|
6066
6087
|
let n = 0;
|
|
6067
6088
|
for (let r = 0; r + 1 < t.length; r++) {
|
|
6068
6089
|
let i = t.charCodeAt(r);
|
|
@@ -6075,7 +6096,7 @@ var r$27 = (t) => {
|
|
|
6075
6096
|
//#endregion
|
|
6076
6097
|
//#region ../sdk-shared/dist/helpers/twigWrapper/Parser/Parser.mjs
|
|
6077
6098
|
var c$16 = (e, t = !1, n) => {
|
|
6078
|
-
let r = new f$
|
|
6099
|
+
let r = new f$9(e, t, n), i = r.parseBody();
|
|
6079
6100
|
if (!r.error) {
|
|
6080
6101
|
let e = r.peek();
|
|
6081
6102
|
if (e && e.type === "tag") {
|
|
@@ -6106,7 +6127,7 @@ var u$12 = () => ({
|
|
|
6106
6127
|
elseifClauses: [],
|
|
6107
6128
|
elseBody: null
|
|
6108
6129
|
});
|
|
6109
|
-
var d$
|
|
6130
|
+
var d$11 = () => ({
|
|
6110
6131
|
type: "for",
|
|
6111
6132
|
valueVar: "_item",
|
|
6112
6133
|
keyVar: null,
|
|
@@ -6117,7 +6138,7 @@ var d$12 = () => ({
|
|
|
6117
6138
|
body: [],
|
|
6118
6139
|
elseBody: null
|
|
6119
6140
|
});
|
|
6120
|
-
var f$
|
|
6141
|
+
var f$9 = class {
|
|
6121
6142
|
tokens;
|
|
6122
6143
|
keepEmptyTokens;
|
|
6123
6144
|
issues;
|
|
@@ -6177,7 +6198,7 @@ var f$10 = class {
|
|
|
6177
6198
|
},
|
|
6178
6199
|
source: i
|
|
6179
6200
|
};
|
|
6180
|
-
let o = r$
|
|
6201
|
+
let o = r$27(r, this.issues);
|
|
6181
6202
|
return {
|
|
6182
6203
|
type: "variable",
|
|
6183
6204
|
raw: t.raw,
|
|
@@ -6205,14 +6226,14 @@ var f$10 = class {
|
|
|
6205
6226
|
if (e.type !== "tag") return this.error = "Malformed {% if %} tag", u$12();
|
|
6206
6227
|
let t = e.content.trim(), n = t.indexOf(" ") === -1 ? "" : t.slice(t.indexOf(" ") + 1).trim();
|
|
6207
6228
|
if (!n) return this.error = "Malformed {% if %} tag: missing condition", u$12();
|
|
6208
|
-
let r = r$
|
|
6229
|
+
let r = r$27(n, this.issues), i = this.parseBody(), s = [], c = null, l = !1;
|
|
6209
6230
|
for (; this.peek();) {
|
|
6210
6231
|
let e = this.peek();
|
|
6211
6232
|
if (!e || e.type !== "tag") break;
|
|
6212
6233
|
let t = n$26(e.content.trim());
|
|
6213
6234
|
if (t === "elseif") {
|
|
6214
6235
|
this.advance();
|
|
6215
|
-
let t = e.content.trim(), r = r$
|
|
6236
|
+
let t = e.content.trim(), r = r$27(t.slice(t.indexOf(" ") + 1).trim(), this.issues), i = this.parseBody();
|
|
6216
6237
|
s.push({
|
|
6217
6238
|
condition: r,
|
|
6218
6239
|
body: i
|
|
@@ -6235,16 +6256,16 @@ var f$10 = class {
|
|
|
6235
6256
|
let e = this.pos;
|
|
6236
6257
|
this.advance();
|
|
6237
6258
|
let n = this.tokens[this.pos - 1];
|
|
6238
|
-
if (n.type !== "tag") return d$
|
|
6259
|
+
if (n.type !== "tag") return d$11();
|
|
6239
6260
|
let r = n.content.trim(), i = r.slice(r.indexOf(" ") + 1).trim(), c = /\sin\s/.exec(i);
|
|
6240
|
-
if (!c) return this.error = "Invalid {% for %} syntax: missing the `in` keyword", d$
|
|
6241
|
-
let l = i.slice(0, c.index).trim(), u = i.slice(c.index + c[0].length).trim(), f = r$
|
|
6261
|
+
if (!c) return this.error = "Invalid {% for %} syntax: missing the `in` keyword", d$11();
|
|
6262
|
+
let l = i.slice(0, c.index).trim(), u = i.slice(c.index + c[0].length).trim(), f = r$26(u), p = f ? {
|
|
6242
6263
|
type: "range",
|
|
6243
|
-
start: r$
|
|
6244
|
-
end: r$
|
|
6245
|
-
} : r$
|
|
6246
|
-
if (!c$17(g)) return this.error = `Invalid {% for %} variable name: "${g}"`, d$
|
|
6247
|
-
if (h !== null && !c$17(h)) return this.error = `Invalid {% for %} key variable name: "${h}"`, d$
|
|
6264
|
+
start: r$27(f[0], this.issues),
|
|
6265
|
+
end: r$27(f[1], this.issues)
|
|
6266
|
+
} : r$27(u, this.issues), m = l.indexOf(","), h = m === -1 ? null : l.slice(0, m).trim(), g = m === -1 ? l : l.slice(m + 1).trim();
|
|
6267
|
+
if (!c$17(g)) return this.error = `Invalid {% for %} variable name: "${g}"`, d$11();
|
|
6268
|
+
if (h !== null && !c$17(h)) return this.error = `Invalid {% for %} key variable name: "${h}"`, d$11();
|
|
6248
6269
|
let _ = this.parseBody(), v = null;
|
|
6249
6270
|
if (this.peek()) {
|
|
6250
6271
|
let e = this.peek();
|
|
@@ -6291,7 +6312,7 @@ var f$10 = class {
|
|
|
6291
6312
|
return {
|
|
6292
6313
|
type: "set",
|
|
6293
6314
|
name: n.slice(0, r).trim(),
|
|
6294
|
-
value: r$
|
|
6315
|
+
value: r$27(n.slice(r + 1).trim(), this.issues)
|
|
6295
6316
|
};
|
|
6296
6317
|
}
|
|
6297
6318
|
parseApply() {
|
|
@@ -6312,7 +6333,7 @@ var f$10 = class {
|
|
|
6312
6333
|
};
|
|
6313
6334
|
//#endregion
|
|
6314
6335
|
//#region ../sdk-shared/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs
|
|
6315
|
-
var r$
|
|
6336
|
+
var r$25 = /* @__PURE__ */ new Map();
|
|
6316
6337
|
var i$22 = 1024;
|
|
6317
6338
|
var a$18 = {
|
|
6318
6339
|
hits: 0,
|
|
@@ -6326,7 +6347,7 @@ var c$15 = (t) => {
|
|
|
6326
6347
|
n = !0;
|
|
6327
6348
|
break;
|
|
6328
6349
|
}
|
|
6329
|
-
if (a.type === "variable" && !s$
|
|
6350
|
+
if (a.type === "variable" && !s$19(a.content.trim())) {
|
|
6330
6351
|
r = !1;
|
|
6331
6352
|
break;
|
|
6332
6353
|
}
|
|
@@ -6337,9 +6358,9 @@ var c$15 = (t) => {
|
|
|
6337
6358
|
};
|
|
6338
6359
|
};
|
|
6339
6360
|
var l$11 = () => {
|
|
6340
|
-
if (r$
|
|
6341
|
-
let e = r$
|
|
6342
|
-
e !== void 0 && r$
|
|
6361
|
+
if (r$25.size >= i$22) {
|
|
6362
|
+
let e = r$25.keys().next().value;
|
|
6363
|
+
e !== void 0 && r$25.delete(e);
|
|
6343
6364
|
}
|
|
6344
6365
|
};
|
|
6345
6366
|
var u$11 = (e) => {
|
|
@@ -6364,12 +6385,12 @@ var u$11 = (e) => {
|
|
|
6364
6385
|
nodesWithSource: u
|
|
6365
6386
|
};
|
|
6366
6387
|
};
|
|
6367
|
-
var d$
|
|
6368
|
-
let t = r$
|
|
6388
|
+
var d$10 = (e) => {
|
|
6389
|
+
let t = r$25.get(e);
|
|
6369
6390
|
if (t) return a$18.hits++, t;
|
|
6370
6391
|
a$18.misses++;
|
|
6371
6392
|
let n = u$11(e);
|
|
6372
|
-
return n ? (l$11(), r$
|
|
6393
|
+
return n ? (l$11(), r$25.set(e, n), n) : null;
|
|
6373
6394
|
};
|
|
6374
6395
|
//#endregion
|
|
6375
6396
|
//#region ../sdk-shared/dist/helpers/twigWrapper/templateRoots.mjs
|
|
@@ -6388,12 +6409,12 @@ var t$31 = (e, n) => {
|
|
|
6388
6409
|
}
|
|
6389
6410
|
};
|
|
6390
6411
|
var n$25 = (n) => {
|
|
6391
|
-
let r = d$
|
|
6412
|
+
let r = d$10(n);
|
|
6392
6413
|
if (!r) return [];
|
|
6393
6414
|
let i = /* @__PURE__ */ new Set();
|
|
6394
6415
|
return t$31(r.nodes ?? r.nodesWithSource, i), [...i];
|
|
6395
6416
|
};
|
|
6396
|
-
var r$
|
|
6417
|
+
var r$24 = (e) => [...new Set(n$25(e).map((e) => e.split(".")[0]))];
|
|
6397
6418
|
//#endregion
|
|
6398
6419
|
//#region ../sdk-shared/dist/style/styleConstants.mjs
|
|
6399
6420
|
var e$34 = {
|
|
@@ -6589,6 +6610,8 @@ var t$30 = {
|
|
|
6589
6610
|
TEXT_INDENT: "text-indent",
|
|
6590
6611
|
TEXT_TRANSFORM: "text-transform",
|
|
6591
6612
|
DIRECTION: "direction",
|
|
6613
|
+
WRITING_MODE: "writing-mode",
|
|
6614
|
+
TEXT_ORIENTATION: "text-orientation",
|
|
6592
6615
|
WHITE_SPACE: "white-space",
|
|
6593
6616
|
TEXT_WRAP: "text-wrap",
|
|
6594
6617
|
WORD_BREAK: "word-break",
|
|
@@ -6636,12 +6659,12 @@ Object.values(t$30).map((e) => ({
|
|
|
6636
6659
|
path: e,
|
|
6637
6660
|
label: e
|
|
6638
6661
|
}));
|
|
6639
|
-
t$30.DISPLAY, t$30.FLEX_WRAP, t$30.FLEX_DIRECTION, t$30.ALIGN_ITEMS, t$30.JUSTIFY_ITEMS, t$30.JUSTIFY_CONTENT, t$30.ALIGN_CONTENT, t$30.ROW_GAP, t$30.COLUMN_GAP, t$30.GRID_ROW_GAP, t$30.GRID_COLUMN_GAP, t$30.GRID_TEMPLATE_AREAS, t$30.GRID_TEMPLATE_COLUMNS, t$30.GRID_TEMPLATE_ROWS, t$30.GRID_AUTO_FLOW, t$30.GRID_AUTO_ROWS, t$30.GRID_AUTO_COLUMNS, t$30.GRID_ROW_START, t$30.GRID_COLUMN_START, t$30.GRID_ROW_END, t$30.GRID_COLUMN_END, t$30.ALIGN_SELF, t$30.JUSTIFY_SELF, t$30.ORDER, t$30.FLEX_GROW, t$30.FLEX_SHRINK, t$30.FLEX_BASIS, t$30.LIST_STYLE, t$30.LIST_STYLE_TYPE, t$30.LIST_STYLE_POSITION, t$30.LIST_STYLE_IMAGE, t$30.BACKGROUND_COLOR, t$30.BACKGROUND_IMAGE, t$30.BACKGROUND_POSITION, t$30.BACKGROUND_SIZE, t$30.BACKGROUND_CLIP, t$30.BACKGROUND_ORIGIN, t$30.BACKGROUND_REPEAT, t$30.BACKGROUND_ATTACHMENT, t$30.BACKGROUND_BLEND_MODE, t$30.MASK_IMAGE, t$30.MASK_SIZE, t$30.MASK_POSITION, t$30.MASK_REPEAT, t$30.MASK_COMPOSITE, t$30.WEBKIT_MASK_IMAGE, t$30.BORDER_TOP_STYLE, t$30.BORDER_TOP_WIDTH, t$30.BORDER_TOP_COLOR, t$30.BORDER_BOTTOM_STYLE, t$30.BORDER_BOTTOM_WIDTH, t$30.BORDER_BOTTOM_COLOR, t$30.BORDER_LEFT_STYLE, t$30.BORDER_LEFT_WIDTH, t$30.BORDER_LEFT_COLOR, t$30.BORDER_RIGHT_STYLE, t$30.BORDER_RIGHT_WIDTH, t$30.BORDER_RIGHT_COLOR, t$30.BORDER_TOP_LEFT_RADIUS, t$30.BORDER_TOP_RIGHT_RADIUS, t$30.BORDER_BOTTOM_LEFT_RADIUS, t$30.BORDER_BOTTOM_RIGHT_RADIUS, t$30.BORDER_COLLAPSE, t$30.BORDER_SPACING, t$30.TABLE_LAYOUT, t$30.OPACITY, t$30.VISIBILITY, t$30.CURSOR, t$30.TRANSITION, t$30.TRANSITION_PROPERTY, t$30.TRANSITION_DURATION, t$30.TRANSITION_TIMING_FUNCTION, t$30.TRANSITION_DELAY, t$30.TRANSITION_BEHAVIOR, t$30.ANIMATION, t$30.ANIMATION_NAME, t$30.ANIMATION_DURATION, t$30.ANIMATION_TIMING_FUNCTION, t$30.ANIMATION_DELAY, t$30.ANIMATION_ITERATION_COUNT, t$30.ANIMATION_DIRECTION, t$30.ANIMATION_FILL_MODE, t$30.ANIMATION_PLAY_STATE, t$30.ANIMATION_TIMELINE, t$30.ANIMATION_RANGE, t$30.BOX_SHADOW, t$30.FILTER, t$30.BACKDROP_FILTER, t$30.MIX_BLEND_MODE, t$30.ISOLATION, t$30.CLIP_PATH, t$30.TRANSFORM, t$30.TRANSFORM_ORIGIN, t$30.TRANSLATE, t$30.ROTATE, t$30.SCALE, t$30.TRANSFORM_STYLE, t$30.PERSPECTIVE, t$30.PERSPECTIVE_ORIGIN, t$30.BACKFACE_VISIBILITY, t$30.WILL_CHANGE, t$30.OUTLINE_WIDTH, t$30.OUTLINE_STYLE, t$30.OUTLINE_COLOR, t$30.OUTLINE_OFFSET, t$30.POINTER_EVENTS, t$30.USER_SELECT, t$30.TOUCH_ACTION, t$30.RESIZE, t$30.APPEARANCE, t$30.SCROLL_BEHAVIOR, t$30.OVERSCROLL_BEHAVIOR, t$30.SCROLL_SNAP_TYPE, t$30.SCROLL_SNAP_ALIGN, t$30.SCROLL_SNAP_STOP, t$30.SCROLL_PADDING_TOP, t$30.SCROLL_MARGIN_TOP, t$30.ACCENT_COLOR, t$30.CARET_COLOR, t$30.COLOR_SCHEME, t$30.POSITION, t$30.FLOAT, t$30.CLEAR, t$30.Z_INDEX, t$30.TOP, t$30.BOTTOM, t$30.LEFT, t$30.RIGHT, t$30.BOX_SIZING, t$30.ASPECT_RATIO, t$30.WIDTH, t$30.HEIGHT, t$30.MIN_WIDTH, t$30.MIN_HEIGHT, t$30.MAX_WIDTH, t$30.MAX_HEIGHT, t$30.OVERFLOW, t$30.OVERFLOW_X, t$30.OVERFLOW_Y, t$30.SCROLLBAR_WIDTH, t$30.SCROLLBAR_COLOR, t$30.CONTAINER_TYPE, t$30.CONTENT, t$30.CONTAINER_NAME, t$30.OBJECT_FIT, t$30.OBJECT_POSITION, t$30.COLUMN_WIDTH, t$30.COLUMN_COUNT, t$30.MARGIN_TOP, t$30.MARGIN_BOTTOM, t$30.MARGIN_LEFT, t$30.MARGIN_RIGHT, t$30.PADDING_TOP, t$30.PADDING_BOTTOM, t$30.PADDING_LEFT, t$30.PADDING_RIGHT, t$30.FONT_FAMILY, t$30.FONT_WEIGHT, t$30.FONT_SIZE, t$30.LINE_HEIGHT, t$30.COLOR, t$30.TEXT_ALIGN, t$30.FONT_STYLE, t$30.FONT_VARIANT, t$30.FONT_VARIANT_NUMERIC, t$30.FONT_FEATURE_SETTINGS, t$30.TEXT_DECORATION, t$30.TEXT_DECORATION_LINE, t$30.TEXT_DECORATION_COLOR, t$30.TEXT_DECORATION_STYLE, t$30.TEXT_DECORATION_THICKNESS, t$30.TEXT_UNDERLINE_OFFSET, t$30.LETTER_SPACING, t$30.WORD_SPACING, t$30.TEXT_INDENT, t$30.TEXT_TRANSFORM, t$30.DIRECTION, t$30.WHITE_SPACE, t$30.TEXT_WRAP, t$30.WORD_BREAK, t$30.OVERFLOW_WRAP, t$30.HYPHENS, t$30.VERTICAL_ALIGN, t$30.TEXT_OVERFLOW, t$30.TEXT_SHADOW, t$30.LINE_CLAMP, t$30.WEBKIT_LINE_CLAMP, t$30.WEBKIT_BOX_ORIENT, t$30.WEBKIT_TEXT_FILL_COLOR, t$30.WEBKIT_BACKGROUND_CLIP, t$30.BOX_DECORATION_BREAK, t$30.WEBKIT_BOX_DECORATION_BREAK, t$30.FILL, t$30.STROKE, t$30.STROKE_WIDTH;
|
|
6662
|
+
t$30.DISPLAY, t$30.FLEX_WRAP, t$30.FLEX_DIRECTION, t$30.ALIGN_ITEMS, t$30.JUSTIFY_ITEMS, t$30.JUSTIFY_CONTENT, t$30.ALIGN_CONTENT, t$30.ROW_GAP, t$30.COLUMN_GAP, t$30.GRID_ROW_GAP, t$30.GRID_COLUMN_GAP, t$30.GRID_TEMPLATE_AREAS, t$30.GRID_TEMPLATE_COLUMNS, t$30.GRID_TEMPLATE_ROWS, t$30.GRID_AUTO_FLOW, t$30.GRID_AUTO_ROWS, t$30.GRID_AUTO_COLUMNS, t$30.GRID_ROW_START, t$30.GRID_COLUMN_START, t$30.GRID_ROW_END, t$30.GRID_COLUMN_END, t$30.ALIGN_SELF, t$30.JUSTIFY_SELF, t$30.ORDER, t$30.FLEX_GROW, t$30.FLEX_SHRINK, t$30.FLEX_BASIS, t$30.LIST_STYLE, t$30.LIST_STYLE_TYPE, t$30.LIST_STYLE_POSITION, t$30.LIST_STYLE_IMAGE, t$30.BACKGROUND_COLOR, t$30.BACKGROUND_IMAGE, t$30.BACKGROUND_POSITION, t$30.BACKGROUND_SIZE, t$30.BACKGROUND_CLIP, t$30.BACKGROUND_ORIGIN, t$30.BACKGROUND_REPEAT, t$30.BACKGROUND_ATTACHMENT, t$30.BACKGROUND_BLEND_MODE, t$30.MASK_IMAGE, t$30.MASK_SIZE, t$30.MASK_POSITION, t$30.MASK_REPEAT, t$30.MASK_COMPOSITE, t$30.WEBKIT_MASK_IMAGE, t$30.BORDER_TOP_STYLE, t$30.BORDER_TOP_WIDTH, t$30.BORDER_TOP_COLOR, t$30.BORDER_BOTTOM_STYLE, t$30.BORDER_BOTTOM_WIDTH, t$30.BORDER_BOTTOM_COLOR, t$30.BORDER_LEFT_STYLE, t$30.BORDER_LEFT_WIDTH, t$30.BORDER_LEFT_COLOR, t$30.BORDER_RIGHT_STYLE, t$30.BORDER_RIGHT_WIDTH, t$30.BORDER_RIGHT_COLOR, t$30.BORDER_TOP_LEFT_RADIUS, t$30.BORDER_TOP_RIGHT_RADIUS, t$30.BORDER_BOTTOM_LEFT_RADIUS, t$30.BORDER_BOTTOM_RIGHT_RADIUS, t$30.BORDER_COLLAPSE, t$30.BORDER_SPACING, t$30.TABLE_LAYOUT, t$30.OPACITY, t$30.VISIBILITY, t$30.CURSOR, t$30.TRANSITION, t$30.TRANSITION_PROPERTY, t$30.TRANSITION_DURATION, t$30.TRANSITION_TIMING_FUNCTION, t$30.TRANSITION_DELAY, t$30.TRANSITION_BEHAVIOR, t$30.ANIMATION, t$30.ANIMATION_NAME, t$30.ANIMATION_DURATION, t$30.ANIMATION_TIMING_FUNCTION, t$30.ANIMATION_DELAY, t$30.ANIMATION_ITERATION_COUNT, t$30.ANIMATION_DIRECTION, t$30.ANIMATION_FILL_MODE, t$30.ANIMATION_PLAY_STATE, t$30.ANIMATION_TIMELINE, t$30.ANIMATION_RANGE, t$30.BOX_SHADOW, t$30.FILTER, t$30.BACKDROP_FILTER, t$30.MIX_BLEND_MODE, t$30.ISOLATION, t$30.CLIP_PATH, t$30.TRANSFORM, t$30.TRANSFORM_ORIGIN, t$30.TRANSLATE, t$30.ROTATE, t$30.SCALE, t$30.TRANSFORM_STYLE, t$30.PERSPECTIVE, t$30.PERSPECTIVE_ORIGIN, t$30.BACKFACE_VISIBILITY, t$30.WILL_CHANGE, t$30.OUTLINE_WIDTH, t$30.OUTLINE_STYLE, t$30.OUTLINE_COLOR, t$30.OUTLINE_OFFSET, t$30.POINTER_EVENTS, t$30.USER_SELECT, t$30.TOUCH_ACTION, t$30.RESIZE, t$30.APPEARANCE, t$30.SCROLL_BEHAVIOR, t$30.OVERSCROLL_BEHAVIOR, t$30.SCROLL_SNAP_TYPE, t$30.SCROLL_SNAP_ALIGN, t$30.SCROLL_SNAP_STOP, t$30.SCROLL_PADDING_TOP, t$30.SCROLL_MARGIN_TOP, t$30.ACCENT_COLOR, t$30.CARET_COLOR, t$30.COLOR_SCHEME, t$30.POSITION, t$30.FLOAT, t$30.CLEAR, t$30.Z_INDEX, t$30.TOP, t$30.BOTTOM, t$30.LEFT, t$30.RIGHT, t$30.BOX_SIZING, t$30.ASPECT_RATIO, t$30.WIDTH, t$30.HEIGHT, t$30.MIN_WIDTH, t$30.MIN_HEIGHT, t$30.MAX_WIDTH, t$30.MAX_HEIGHT, t$30.OVERFLOW, t$30.OVERFLOW_X, t$30.OVERFLOW_Y, t$30.SCROLLBAR_WIDTH, t$30.SCROLLBAR_COLOR, t$30.CONTAINER_TYPE, t$30.CONTENT, t$30.CONTAINER_NAME, t$30.OBJECT_FIT, t$30.OBJECT_POSITION, t$30.COLUMN_WIDTH, t$30.COLUMN_COUNT, t$30.MARGIN_TOP, t$30.MARGIN_BOTTOM, t$30.MARGIN_LEFT, t$30.MARGIN_RIGHT, t$30.PADDING_TOP, t$30.PADDING_BOTTOM, t$30.PADDING_LEFT, t$30.PADDING_RIGHT, t$30.FONT_FAMILY, t$30.FONT_WEIGHT, t$30.FONT_SIZE, t$30.LINE_HEIGHT, t$30.COLOR, t$30.TEXT_ALIGN, t$30.FONT_STYLE, t$30.FONT_VARIANT, t$30.FONT_VARIANT_NUMERIC, t$30.FONT_FEATURE_SETTINGS, t$30.TEXT_DECORATION, t$30.TEXT_DECORATION_LINE, t$30.TEXT_DECORATION_COLOR, t$30.TEXT_DECORATION_STYLE, t$30.TEXT_DECORATION_THICKNESS, t$30.TEXT_UNDERLINE_OFFSET, t$30.LETTER_SPACING, t$30.WORD_SPACING, t$30.TEXT_INDENT, t$30.TEXT_TRANSFORM, t$30.DIRECTION, t$30.WRITING_MODE, t$30.TEXT_ORIENTATION, t$30.WHITE_SPACE, t$30.TEXT_WRAP, t$30.WORD_BREAK, t$30.OVERFLOW_WRAP, t$30.HYPHENS, t$30.VERTICAL_ALIGN, t$30.TEXT_OVERFLOW, t$30.TEXT_SHADOW, t$30.LINE_CLAMP, t$30.WEBKIT_LINE_CLAMP, t$30.WEBKIT_BOX_ORIENT, t$30.WEBKIT_TEXT_FILL_COLOR, t$30.WEBKIT_BACKGROUND_CLIP, t$30.BOX_DECORATION_BREAK, t$30.WEBKIT_BOX_DECORATION_BREAK, t$30.FILL, t$30.STROKE, t$30.STROKE_WIDTH;
|
|
6640
6663
|
//#endregion
|
|
6641
6664
|
//#region ../sdk-shared/dist/schema/schemaConstants.mjs
|
|
6642
6665
|
var t$29 = /var\(\s*--([a-zA-Z0-9_-]+)\s*\)|\{\{\s*([a-zA-Z0-9_-]+)\s*\}\}/;
|
|
6643
6666
|
var n$23 = "props";
|
|
6644
|
-
var r$
|
|
6667
|
+
var r$22 = {
|
|
6645
6668
|
schema: {
|
|
6646
6669
|
definition: {
|
|
6647
6670
|
name: "",
|
|
@@ -6862,7 +6885,7 @@ var activeOn = (cls, pages, options = {}) => {
|
|
|
6862
6885
|
* one only has to be one of them.
|
|
6863
6886
|
*/
|
|
6864
6887
|
var conditionSource = (template) => {
|
|
6865
|
-
const roots = r$
|
|
6888
|
+
const roots = r$24(template);
|
|
6866
6889
|
const global = roots.find((root) => GLOBAL_SOURCES.includes(root));
|
|
6867
6890
|
if (global) return global;
|
|
6868
6891
|
const element = roots.find((root) => root.includes("_"));
|
|
@@ -7306,7 +7329,7 @@ var video = defineElement(B.Video);
|
|
|
7306
7329
|
//#region ../sdk-schema/dist/helpers/elementId.mjs
|
|
7307
7330
|
var e$33 = /^[A-Za-z](?:[A-Za-z0-9_-]*[A-Za-z0-9_])?$/;
|
|
7308
7331
|
var t$28 = (t) => e$33.test(t);
|
|
7309
|
-
var r$
|
|
7332
|
+
var r$21 = (e) => new Set(Object.keys(e));
|
|
7310
7333
|
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`;
|
|
7311
7334
|
var a$17 = (e, t) => {
|
|
7312
7335
|
let n = /* @__PURE__ */ new Set();
|
|
@@ -7317,12 +7340,12 @@ var a$17 = (e, t) => {
|
|
|
7317
7340
|
return !0;
|
|
7318
7341
|
};
|
|
7319
7342
|
var o$19 = (e) => e.replace(/[^A-Za-z0-9]/g, "") || "element";
|
|
7320
|
-
var s$
|
|
7343
|
+
var s$17 = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
7321
7344
|
var c$14 = (e, t) => {
|
|
7322
7345
|
let n = o$19(e);
|
|
7323
7346
|
for (let e = 0; e < 100; e += 1) {
|
|
7324
7347
|
let e = "";
|
|
7325
|
-
for (let t = 0; t < 4; t += 1) e += s$
|
|
7348
|
+
for (let t = 0; t < 4; t += 1) e += s$17[Math.floor(Math.random() * s$17.length)];
|
|
7326
7349
|
if (!t(`${n}-${e}`)) return `${n}-${e}`;
|
|
7327
7350
|
}
|
|
7328
7351
|
return l$10(e, t);
|
|
@@ -7338,7 +7361,7 @@ var u$10 = (e, t) => {
|
|
|
7338
7361
|
for (; t(`${r}-${i}`);) i += 1;
|
|
7339
7362
|
return `${r}-${i}`;
|
|
7340
7363
|
};
|
|
7341
|
-
var d$
|
|
7364
|
+
var d$9 = {
|
|
7342
7365
|
page: [{ attribute: "layout" }, { attribute: "layoutContainer" }],
|
|
7343
7366
|
reference: [{
|
|
7344
7367
|
attribute: "referenceId",
|
|
@@ -7349,18 +7372,18 @@ var d$10 = {
|
|
|
7349
7372
|
when: (e) => e.mode === "page"
|
|
7350
7373
|
}]
|
|
7351
7374
|
};
|
|
7352
|
-
var f$
|
|
7375
|
+
var f$8 = { navigate: [{
|
|
7353
7376
|
param: "url",
|
|
7354
7377
|
when: (e) => e.urlType === "page"
|
|
7355
7378
|
}] };
|
|
7356
|
-
var p$
|
|
7379
|
+
var p$10 = (e, t) => {
|
|
7357
7380
|
let n = e.indexOf("."), r = n === -1 ? e : e.slice(0, n), i = r.indexOf("_");
|
|
7358
7381
|
if (i === -1) return e;
|
|
7359
7382
|
let a = t[r.slice(i + 1)];
|
|
7360
7383
|
return a ? `${r.slice(0, i + 1)}${a}${n === -1 ? "" : e.slice(n)}` : e;
|
|
7361
7384
|
};
|
|
7362
|
-
var m$
|
|
7363
|
-
var h$3 = (e, t) => e.replace(m$
|
|
7385
|
+
var m$6 = /([A-Za-z][A-Za-z0-9]*)_([A-Za-z][A-Za-z0-9_-]*)/g;
|
|
7386
|
+
var h$3 = (e, t) => e.replace(m$6, (e, n, r) => {
|
|
7364
7387
|
let i = t[r];
|
|
7365
7388
|
return i ? `${n}_${i}` : e;
|
|
7366
7389
|
});
|
|
@@ -7395,19 +7418,19 @@ var _$3 = (e, t, n) => {
|
|
|
7395
7418
|
t[n.id] && (n.id = t[n.id], e = !0);
|
|
7396
7419
|
let { definition: r, attributes: o } = n;
|
|
7397
7420
|
t[r.rootId] && (r.rootId = t[r.rootId], e = !0), r.parentId && t[r.parentId] && (r.parentId = t[r.parentId], e = !0), r.items?.some((e) => t[e]) && (r.items = r.items.map(i), e = !0);
|
|
7398
|
-
for (let { attribute: n, when: i } of d$
|
|
7421
|
+
for (let { attribute: n, when: i } of d$9[r.type] ?? []) {
|
|
7399
7422
|
let r = o[n];
|
|
7400
7423
|
typeof r == "string" && t[r] && (!i || i(o)) && (o[n] = t[r], e = !0);
|
|
7401
7424
|
}
|
|
7402
7425
|
let { slot: s } = o;
|
|
7403
7426
|
typeof s == "string" && t[s] && (o.slot = t[s], e = !0);
|
|
7404
7427
|
for (let n of Object.values(r.bindings ?? {})) for (let r of n) {
|
|
7405
|
-
let n = p$
|
|
7428
|
+
let n = p$10(r.source, t);
|
|
7406
7429
|
n !== r.source && (r.source = n, e = !0), r.transformers && g$3(r.transformers, t) && (e = !0), r.when && g$3(r.when, t) && (e = !0);
|
|
7407
7430
|
}
|
|
7408
7431
|
for (let n of Object.values(r.interactions ?? {})) {
|
|
7409
7432
|
n.elementId && t[n.elementId] && (n.elementId = t[n.elementId], e = !0);
|
|
7410
|
-
for (let { param: r, when: i } of f$
|
|
7433
|
+
for (let { param: r, when: i } of f$8[n.action] ?? []) {
|
|
7411
7434
|
let a = n.params[r];
|
|
7412
7435
|
typeof a == "string" && t[a] && (!i || i(n.params)) && (n.params[r] = t[a], e = !0);
|
|
7413
7436
|
}
|
|
@@ -7618,13 +7641,13 @@ var paramIssue = (params, spec, where) => {
|
|
|
7618
7641
|
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"}.`;
|
|
7619
7642
|
}
|
|
7620
7643
|
const effective = c$19(provided, declared, false);
|
|
7621
|
-
const invalid = s$
|
|
7644
|
+
const invalid = s$23(provided, effective, declared).at(0);
|
|
7622
7645
|
if (invalid) {
|
|
7623
7646
|
const value = provided[invalid.key];
|
|
7624
7647
|
const suggestion = typeof value === "string" && invalid.options ? didYouMean(value, invalid.options) : "";
|
|
7625
7648
|
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}.`;
|
|
7626
7649
|
}
|
|
7627
|
-
const missing = r$
|
|
7650
|
+
const missing = r$35(provided, effective, declared).at(0);
|
|
7628
7651
|
return missing === void 0 ? void 0 : `${where} needs "${missing}": ${declared[missing].description}`;
|
|
7629
7652
|
};
|
|
7630
7653
|
//#endregion
|
|
@@ -7649,7 +7672,7 @@ var n$22 = (n, r) => {
|
|
|
7649
7672
|
};
|
|
7650
7673
|
return o(r), i;
|
|
7651
7674
|
};
|
|
7652
|
-
var r$
|
|
7675
|
+
var r$20 = (t, n) => {
|
|
7653
7676
|
let r = [], i = /* @__PURE__ */ new Set([n]), a = (n) => {
|
|
7654
7677
|
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));
|
|
7655
7678
|
};
|
|
@@ -7689,7 +7712,7 @@ var n$21 = /* @__PURE__ */ new Set([
|
|
|
7689
7712
|
"remote",
|
|
7690
7713
|
"hosted"
|
|
7691
7714
|
]);
|
|
7692
|
-
var r$
|
|
7715
|
+
var r$19 = /* @__PURE__ */ new Set([
|
|
7693
7716
|
"auto",
|
|
7694
7717
|
"block",
|
|
7695
7718
|
"swap",
|
|
@@ -7705,9 +7728,9 @@ var o$18 = (e) => {
|
|
|
7705
7728
|
}
|
|
7706
7729
|
return !1;
|
|
7707
7730
|
};
|
|
7708
|
-
var s$
|
|
7731
|
+
var s$16 = class extends Error {};
|
|
7709
7732
|
var c$13 = (e) => {
|
|
7710
|
-
throw new s$
|
|
7733
|
+
throw new s$16(e);
|
|
7711
7734
|
};
|
|
7712
7735
|
var l$9 = (e) => {
|
|
7713
7736
|
if (typeof e != "string") return c$13("font.family must be a string");
|
|
@@ -7720,13 +7743,13 @@ var u$9 = (e) => {
|
|
|
7720
7743
|
let t = e.map((e) => typeof e != "number" || !Number.isInteger(e) || e < 1 || e > 1e3 ? c$13("font.weights must hold whole numbers between 1 and 1000") : e);
|
|
7721
7744
|
return [...new Set(t)].sort((e, t) => e - t);
|
|
7722
7745
|
};
|
|
7723
|
-
var d$
|
|
7746
|
+
var d$8 = (e) => {
|
|
7724
7747
|
if (e === void 0) return ["normal"];
|
|
7725
7748
|
if (!Array.isArray(e) || e.length === 0) return c$13("font.styles must be a non-empty list");
|
|
7726
7749
|
let t = e.map((e) => e !== "normal" && e !== "italic" ? c$13("font.styles may only hold \"normal\" or \"italic\"") : e);
|
|
7727
7750
|
return [...new Set(t)];
|
|
7728
7751
|
};
|
|
7729
|
-
var f$
|
|
7752
|
+
var f$7 = (t, n) => {
|
|
7730
7753
|
if (!e$32(t)) return c$13(`font.files[${n}] must be an object`);
|
|
7731
7754
|
let { weight: r, style: a, format: o, unicodeRange: s } = t;
|
|
7732
7755
|
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`);
|
|
@@ -7743,20 +7766,20 @@ var f$8 = (t, n) => {
|
|
|
7743
7766
|
}
|
|
7744
7767
|
return l;
|
|
7745
7768
|
};
|
|
7746
|
-
var p$
|
|
7747
|
-
var m$
|
|
7769
|
+
var p$9 = (e, t) => typeof e != "string" || !e ? c$13(`font.files[${t}].path must be a non-empty string`) : e.includes("://") || e.startsWith("/") ? c$13(`font.files[${t}].path must be relative to the font store, not a URL`) : e.split("/").includes("..") ? c$13(`font.files[${t}].path cannot climb out of the font store`) : e;
|
|
7770
|
+
var m$5 = (e) => !Array.isArray(e) || e.length === 0 ? c$13("font.files must be a non-empty list") : e;
|
|
7748
7771
|
var h$2 = (i) => {
|
|
7749
7772
|
if (!e$32(i)) return c$13("a font must be an object");
|
|
7750
7773
|
let { source: a, fallback: o, display: s, preload: h } = i;
|
|
7751
7774
|
if (typeof a != "string" || !n$21.has(a)) return c$13("font.source must be one of: system, google, remote, hosted");
|
|
7752
7775
|
if (typeof o != "string" || !o.trim()) return c$13("font.fallback is required: it is what renders until the face arrives");
|
|
7753
|
-
if (s !== void 0 && (typeof s != "string" || !r$
|
|
7776
|
+
if (s !== void 0 && (typeof s != "string" || !r$19.has(s))) return c$13("font.display must be one of: auto, block, swap, fallback, optional");
|
|
7754
7777
|
if (h !== void 0 && typeof h != "boolean") return c$13("font.preload must be a boolean");
|
|
7755
7778
|
let g = {
|
|
7756
7779
|
family: l$9(i.family),
|
|
7757
7780
|
fallback: o.trim(),
|
|
7758
7781
|
weights: u$9(i.weights),
|
|
7759
|
-
styles: d$
|
|
7782
|
+
styles: d$8(i.styles),
|
|
7760
7783
|
...s === void 0 ? {} : { display: s },
|
|
7761
7784
|
...h === void 0 ? {} : { preload: h }
|
|
7762
7785
|
};
|
|
@@ -7777,8 +7800,8 @@ var h$2 = (i) => {
|
|
|
7777
7800
|
return e === void 0 && n === void 0 ? c$13("a remote font needs either a stylesheet URL or the font files themselves") : e === void 0 ? {
|
|
7778
7801
|
...g,
|
|
7779
7802
|
source: "remote",
|
|
7780
|
-
files: m$
|
|
7781
|
-
let r = f$
|
|
7803
|
+
files: m$5(n).map((e, n) => {
|
|
7804
|
+
let r = f$7(e, n), { url: i } = e;
|
|
7782
7805
|
return typeof i != "string" || !i$19(i) ? c$13(`font.files[${n}].url must be an https URL with no credentials in it`) : {
|
|
7783
7806
|
...r,
|
|
7784
7807
|
url: i
|
|
@@ -7793,9 +7816,9 @@ var h$2 = (i) => {
|
|
|
7793
7816
|
return {
|
|
7794
7817
|
...g,
|
|
7795
7818
|
source: "hosted",
|
|
7796
|
-
files: m$
|
|
7797
|
-
...f$
|
|
7798
|
-
path: p$
|
|
7819
|
+
files: m$5(i.files).map((e, t) => ({
|
|
7820
|
+
...f$7(e, t),
|
|
7821
|
+
path: p$9(e.path, t)
|
|
7799
7822
|
}))
|
|
7800
7823
|
};
|
|
7801
7824
|
};
|
|
@@ -7813,11 +7836,11 @@ var e$27 = {
|
|
|
7813
7836
|
"motion-safe": "@media (prefers-reduced-motion: no-preference)"
|
|
7814
7837
|
};
|
|
7815
7838
|
var t$23 = Object.keys(e$27);
|
|
7816
|
-
var r$
|
|
7839
|
+
var r$18 = (t) => Object.hasOwn(e$27, t);
|
|
7817
7840
|
var i$17 = String.raw`\d+(?:\.\d+)?(?:px|rem|em|ch)`;
|
|
7818
7841
|
var a$15 = String.raw`\((?:min|max)-width:\s*${i$17}\)`;
|
|
7819
7842
|
var o$17 = new RegExp(String.raw`^container(?:\s+(?<name>-?[_a-zA-Z][\w-]*))?\s+(?<query>${a$15}(?:\s+and\s+${a$15})?)$`);
|
|
7820
|
-
var s$
|
|
7843
|
+
var s$15 = (e) => {
|
|
7821
7844
|
let t = o$17.exec(e.trim());
|
|
7822
7845
|
if (t?.groups) return {
|
|
7823
7846
|
name: t.groups.name,
|
|
@@ -7825,16 +7848,16 @@ var s$14 = (e) => {
|
|
|
7825
7848
|
};
|
|
7826
7849
|
};
|
|
7827
7850
|
var c$12 = (e) => {
|
|
7828
|
-
if (r$
|
|
7829
|
-
let t = s$
|
|
7851
|
+
if (r$18(e)) return e;
|
|
7852
|
+
let t = s$15(e);
|
|
7830
7853
|
if (t) return t.name ? `container ${t.name} ${t.query}` : `container ${t.query}`;
|
|
7831
7854
|
};
|
|
7832
7855
|
var u$8 = (t) => {
|
|
7833
|
-
if (r$
|
|
7834
|
-
let n = s$
|
|
7856
|
+
if (r$18(t)) return e$27[t];
|
|
7857
|
+
let n = s$15(t);
|
|
7835
7858
|
if (n) return n.name ? `@container ${n.name} ${n.query}` : `@container ${n.query}`;
|
|
7836
7859
|
};
|
|
7837
|
-
var f$
|
|
7860
|
+
var f$6 = (t) => {
|
|
7838
7861
|
let n = t.trim().replace(/\s+/g, " ").replace(/\(\s*/g, "(").replace(/\s*\)/g, ")").replace(/:\s*/g, ": ");
|
|
7839
7862
|
for (let [t, r] of Object.entries(e$27)) if (n === r) return t;
|
|
7840
7863
|
let r = /^@container\s+(.*)$/.exec(n);
|
|
@@ -7861,7 +7884,7 @@ var t$22 = {
|
|
|
7861
7884
|
selection: "::selection"
|
|
7862
7885
|
};
|
|
7863
7886
|
var n$19 = (e) => Object.hasOwn(t$22, e);
|
|
7864
|
-
var r$
|
|
7887
|
+
var r$17 = (e) => `::${e}`;
|
|
7865
7888
|
var i$16 = [
|
|
7866
7889
|
"before",
|
|
7867
7890
|
"after",
|
|
@@ -7883,7 +7906,7 @@ var o$16 = [
|
|
|
7883
7906
|
"line-height",
|
|
7884
7907
|
"vertical-align"
|
|
7885
7908
|
];
|
|
7886
|
-
var s$
|
|
7909
|
+
var s$14 = [
|
|
7887
7910
|
"font-family",
|
|
7888
7911
|
"font-size",
|
|
7889
7912
|
"font-style",
|
|
@@ -7910,16 +7933,16 @@ var l$8 = {
|
|
|
7910
7933
|
"color",
|
|
7911
7934
|
"content",
|
|
7912
7935
|
"direction",
|
|
7913
|
-
...s$
|
|
7936
|
+
...s$14
|
|
7914
7937
|
],
|
|
7915
7938
|
placeholder: [
|
|
7916
7939
|
...o$16,
|
|
7917
|
-
...s$
|
|
7940
|
+
...s$14,
|
|
7918
7941
|
...c$11
|
|
7919
7942
|
],
|
|
7920
7943
|
"first-line": [
|
|
7921
7944
|
...o$16,
|
|
7922
|
-
...s$
|
|
7945
|
+
...s$14,
|
|
7923
7946
|
...c$11
|
|
7924
7947
|
]
|
|
7925
7948
|
};
|
|
@@ -7927,7 +7950,7 @@ var u$7 = (e, t) => {
|
|
|
7927
7950
|
let n = l$8[e];
|
|
7928
7951
|
return !n || t.startsWith("--") || n.includes(t);
|
|
7929
7952
|
};
|
|
7930
|
-
var d$
|
|
7953
|
+
var d$7 = /* @__PURE__ */ new Set([
|
|
7931
7954
|
"none",
|
|
7932
7955
|
"normal",
|
|
7933
7956
|
"open-quote",
|
|
@@ -7939,8 +7962,8 @@ var d$8 = /* @__PURE__ */ new Set([
|
|
|
7939
7962
|
"unset",
|
|
7940
7963
|
"revert"
|
|
7941
7964
|
]);
|
|
7942
|
-
var f$
|
|
7943
|
-
var p$
|
|
7965
|
+
var f$5 = /^(?:counter|counters|attr|url|var|image-set|linear-gradient|radial-gradient|conic-gradient)\(/i;
|
|
7966
|
+
var p$8 = (e) => {
|
|
7944
7967
|
let t = [], n = "", r = "", i = 0;
|
|
7945
7968
|
for (let a of e) {
|
|
7946
7969
|
if (r) {
|
|
@@ -7958,9 +7981,9 @@ var p$7 = (e) => {
|
|
|
7958
7981
|
}
|
|
7959
7982
|
return n && t.push(n), r || i !== 0 ? void 0 : t;
|
|
7960
7983
|
};
|
|
7961
|
-
var m$
|
|
7962
|
-
let t = p$
|
|
7963
|
-
return t?.length ? t.every((e) => /^(["']).*\1$/s.test(e) || d$
|
|
7984
|
+
var m$4 = (e) => {
|
|
7985
|
+
let t = p$8(e.trim());
|
|
7986
|
+
return t?.length ? t.every((e) => /^(["']).*\1$/s.test(e) || d$7.has(e.toLowerCase()) || f$5.test(e) && e.endsWith(")")) : !1;
|
|
7964
7987
|
};
|
|
7965
7988
|
//#endregion
|
|
7966
7989
|
//#region ../sdk-shared/dist/style/styleStates.mjs
|
|
@@ -7982,7 +8005,7 @@ var e$25 = [
|
|
|
7982
8005
|
"even"
|
|
7983
8006
|
];
|
|
7984
8007
|
var t$21 = "plitzi-component--hidden";
|
|
7985
|
-
var r$
|
|
8008
|
+
var r$16 = {
|
|
7986
8009
|
odd: 0,
|
|
7987
8010
|
even: 1,
|
|
7988
8011
|
first: 2,
|
|
@@ -7999,8 +8022,8 @@ var r$17 = {
|
|
|
7999
8022
|
disabled: 13,
|
|
8000
8023
|
hidden: 14
|
|
8001
8024
|
};
|
|
8002
|
-
var i$15 = (e) => Object.hasOwn(r$
|
|
8003
|
-
var a$13 = (t) => i$15(t) ? r$
|
|
8025
|
+
var i$15 = (e) => Object.hasOwn(r$16, e);
|
|
8026
|
+
var a$13 = (t) => i$15(t) ? r$16[t] : e$25.length;
|
|
8004
8027
|
var o$15 = (e) => Object.entries(e).sort(([e], [t]) => a$13(e) - a$13(t));
|
|
8005
8028
|
var l$7 = {
|
|
8006
8029
|
current: ":is([aria-current]:not([aria-current=\"false\"]),[aria-pressed=\"true\"],[aria-selected=\"true\"],[role=\"tabpanel\"]:not([hidden]))",
|
|
@@ -8012,8 +8035,8 @@ var l$7 = {
|
|
|
8012
8035
|
even: ":nth-child(even)"
|
|
8013
8036
|
};
|
|
8014
8037
|
var u$6 = (e) => (i$15(e) ? l$7[e] : void 0) ?? `:${e}`;
|
|
8015
|
-
var d$
|
|
8016
|
-
var p$
|
|
8038
|
+
var d$6 = (e) => e === "hidden";
|
|
8039
|
+
var p$7 = (e) => e === ">";
|
|
8017
8040
|
//#endregion
|
|
8018
8041
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/shared.js
|
|
8019
8042
|
function e$24(e) {
|
|
@@ -8048,14 +8071,14 @@ function n$18(t, n) {
|
|
|
8048
8071
|
}
|
|
8049
8072
|
return r;
|
|
8050
8073
|
}
|
|
8051
|
-
function r$
|
|
8074
|
+
function r$15(e, r = !0) {
|
|
8052
8075
|
return e ? typeof e == "string" ? t$20(e, r) : Array.isArray(e) ? n$18(e, r) : [] : [];
|
|
8053
8076
|
}
|
|
8054
8077
|
//#endregion
|
|
8055
8078
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/get.js
|
|
8056
8079
|
function t$19(t, n, r) {
|
|
8057
8080
|
if (t == null || !n) return r;
|
|
8058
|
-
let i = r$
|
|
8081
|
+
let i = r$15(n);
|
|
8059
8082
|
if (!i.length) return r;
|
|
8060
8083
|
let a = t;
|
|
8061
8084
|
for (let e of i) {
|
|
@@ -8070,7 +8093,7 @@ function t$19(t, n, r) {
|
|
|
8070
8093
|
//#endregion
|
|
8071
8094
|
//#region ../../node_modules/@plitzi/plitzi-ui/dist/helpers/lodash/set.js
|
|
8072
8095
|
function t$18(t, n, r) {
|
|
8073
|
-
let i = r$
|
|
8096
|
+
let i = r$15(n);
|
|
8074
8097
|
if (!i.length) return t;
|
|
8075
8098
|
let a = t;
|
|
8076
8099
|
for (let e = 0; e < i.length - 1; e++) {
|
|
@@ -8098,7 +8121,7 @@ function n$17(n, r) {
|
|
|
8098
8121
|
}
|
|
8099
8122
|
//#endregion
|
|
8100
8123
|
//#region ../sdk-style/dist/helpers/calculateInheriting.mjs
|
|
8101
|
-
var r$
|
|
8124
|
+
var r$14 = (e, t) => {
|
|
8102
8125
|
let n = [], r = t;
|
|
8103
8126
|
for (; r;) {
|
|
8104
8127
|
n.push(r);
|
|
@@ -8178,7 +8201,7 @@ var o$14 = (e, t, n) => {
|
|
|
8178
8201
|
...f
|
|
8179
8202
|
};
|
|
8180
8203
|
};
|
|
8181
|
-
var s$
|
|
8204
|
+
var s$12 = (e, t, n) => o$14(e.attributes, t, n);
|
|
8182
8205
|
var c$9 = (t, o, c, l, u = {}, d = {}) => {
|
|
8183
8206
|
let { componentSubType: f, styleSelector: p = "base", styleState: m, styleVariant: h, styleAncestor: g, stylePseudo: _, styleCondition: v, includeSelf: y = !1, skipSelectors: b = [], addSelectors: x = [] } = d, S = {
|
|
8184
8207
|
styleState: m,
|
|
@@ -8190,7 +8213,7 @@ var c$9 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
8190
8213
|
tree: [],
|
|
8191
8214
|
style: {},
|
|
8192
8215
|
parentStyle: {}
|
|
8193
|
-
}, w = t ? r$
|
|
8216
|
+
}, w = t ? r$14(c, t) : [], T = /* @__PURE__ */ new Set();
|
|
8194
8217
|
for (let e of Object.keys(l)) {
|
|
8195
8218
|
let n = l[e];
|
|
8196
8219
|
if (n) {
|
|
@@ -8254,7 +8277,7 @@ var c$9 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
8254
8277
|
}
|
|
8255
8278
|
let E = {};
|
|
8256
8279
|
for (let t of C.tree) {
|
|
8257
|
-
let r = s$
|
|
8280
|
+
let r = s$12(t, p, S);
|
|
8258
8281
|
if (r && Object.keys(r).length && ((t.isAncestor || t.isDefault && t.componentType !== o) && (r = n$17(r, n$24)), Object.keys(r).length)) for (let e of Object.keys(r)) E[e] || (E[e] = []), E[e].push({
|
|
8259
8282
|
key: t.name,
|
|
8260
8283
|
value: r[e],
|
|
@@ -8263,7 +8286,7 @@ var c$9 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
8263
8286
|
}
|
|
8264
8287
|
let D = C.tree.filter((e) => e.isParent).reduce((e, t) => ({
|
|
8265
8288
|
...e,
|
|
8266
|
-
...s$
|
|
8289
|
+
...s$12(t, p, S)
|
|
8267
8290
|
}), {});
|
|
8268
8291
|
return {
|
|
8269
8292
|
...C,
|
|
@@ -8273,7 +8296,7 @@ var c$9 = (t, o, c, l, u = {}, d = {}) => {
|
|
|
8273
8296
|
};
|
|
8274
8297
|
//#endregion
|
|
8275
8298
|
//#region ../sdk-schema/dist/helpers/FlatMap.mjs
|
|
8276
|
-
var d$
|
|
8299
|
+
var d$5 = class {
|
|
8277
8300
|
flat;
|
|
8278
8301
|
variables;
|
|
8279
8302
|
pages;
|
|
@@ -8285,7 +8308,7 @@ var d$6 = class {
|
|
|
8285
8308
|
this.flat = t, this.variables = r ?? [], this.pages = i ?? [], this.mintId = a ?? c$14, this.takenElsewhere = o ?? (() => !1);
|
|
8286
8309
|
}
|
|
8287
8310
|
nextId = (e, t = () => !1) => {
|
|
8288
|
-
let n = r$
|
|
8311
|
+
let n = r$21(this.flat);
|
|
8289
8312
|
return this.mintId(e, (e) => n.has(e) || this.takenElsewhere(e) || t(e));
|
|
8290
8313
|
};
|
|
8291
8314
|
addElement = (e, n, r = "inside", i = {}) => {
|
|
@@ -8325,7 +8348,7 @@ var d$6 = class {
|
|
|
8325
8348
|
return o ? (i.definition.items = (i.definition.items ?? []).filter((e) => e !== n), o.parent.definition.items = o.items, a.definition.parentId = o.parent.id, this.carryRoot(n, o.parent.definition.rootId), !0) : !1;
|
|
8326
8349
|
};
|
|
8327
8350
|
carryRoot = (e, t) => {
|
|
8328
|
-
if (this.flat[e].definition.rootId !== t) for (let n of [e, ...r$
|
|
8351
|
+
if (this.flat[e].definition.rootId !== t) for (let n of [e, ...r$20(this.flat, e)]) this.flat[n].definition.rootId = t;
|
|
8329
8352
|
};
|
|
8330
8353
|
cloneElements = (e, t = "", n = "", s = !1) => {
|
|
8331
8354
|
let c = {
|
|
@@ -8333,7 +8356,7 @@ var d$6 = class {
|
|
|
8333
8356
|
item: void 0
|
|
8334
8357
|
}, l = {}, u = this.flat[e];
|
|
8335
8358
|
if (!u) return c;
|
|
8336
|
-
let d = [e, ...r$
|
|
8359
|
+
let d = [e, ...r$20(this.flat, e)], f = r$21(this.flat);
|
|
8337
8360
|
for (let e of d) {
|
|
8338
8361
|
let t = u$10(e, (e) => f.has(e) || this.takenElsewhere(e));
|
|
8339
8362
|
f.add(t), l[e] = t;
|
|
@@ -8350,7 +8373,7 @@ var d$6 = class {
|
|
|
8350
8373
|
removeElement = (e, t = !1) => {
|
|
8351
8374
|
let n = this.flat[e];
|
|
8352
8375
|
if (!n || n.definition.type === "page" && !t || t && n.attributes.default) return !1;
|
|
8353
|
-
for (let t of r$
|
|
8376
|
+
for (let t of r$20(this.flat, e)) delete this.flat[t];
|
|
8354
8377
|
let r = n.definition.parentId ? this.flat[n.definition.parentId] : void 0;
|
|
8355
8378
|
return r?.definition.items && (r.definition.items = r.definition.items.filter((t) => t !== e)), delete this.flat[e], !0;
|
|
8356
8379
|
};
|
|
@@ -8477,50 +8500,50 @@ var o$13 = /* @__PURE__ */ new Set([
|
|
|
8477
8500
|
"ref",
|
|
8478
8501
|
"id"
|
|
8479
8502
|
]);
|
|
8480
|
-
var s$
|
|
8481
|
-
var c$8 = (e) => s$
|
|
8482
|
-
var p$
|
|
8483
|
-
var m$
|
|
8503
|
+
var s$11 = /^[A-Za-z][A-Za-z0-9_]*$/;
|
|
8504
|
+
var c$8 = (e) => s$11.test(e) ? o$13.has(e) ? `"${e}" is an attribute every instance already has` : null : `"${e}" is not a valid prop name: start with a letter, then letters, numbers and underscores — it is read as {{ props.${e} }}`;
|
|
8505
|
+
var p$6 = (e, t) => Object.hasOwn(e.components, t) ? e.components[t] : void 0;
|
|
8506
|
+
var m$3 = (e, t) => e.definition.type === "reference" && e.attributes.referenceType === "component" && (t === void 0 || e.attributes.referenceId === t);
|
|
8484
8507
|
//#endregion
|
|
8485
8508
|
//#region ../sdk-shared/dist/navigation/routes.mjs
|
|
8486
|
-
var
|
|
8487
|
-
var
|
|
8488
|
-
var
|
|
8509
|
+
var i$13 = (e) => e.replaceAll(/\/+/g, "/");
|
|
8510
|
+
var a$11 = (e) => i$13(e.replace(/{{([a-zA-Z0-9-_:*/]+)}}/gi, ":$1"));
|
|
8511
|
+
var o$12 = (e, t) => {
|
|
8489
8512
|
if (!t || !e[t]) return "";
|
|
8490
8513
|
let { slug: n, parentId: r } = e[t];
|
|
8491
|
-
return r ? `${
|
|
8514
|
+
return r ? `${o$12(e, r)}/${n}` : n;
|
|
8492
8515
|
};
|
|
8493
|
-
function
|
|
8516
|
+
function s$10(e, t, n, r = !1) {
|
|
8494
8517
|
let s = n.replace(/^\/+/, ""), { slug: c = "", folder: l, default: u } = e[s]?.attributes ?? {
|
|
8495
8518
|
slug: s,
|
|
8496
8519
|
folder: "",
|
|
8497
8520
|
default: !1
|
|
8498
8521
|
};
|
|
8499
|
-
if (u && !
|
|
8522
|
+
if (u && !r) return {
|
|
8500
8523
|
"/": n,
|
|
8501
8524
|
[`/${n}`]: n
|
|
8502
8525
|
};
|
|
8503
|
-
if (u &&
|
|
8504
|
-
if (!l && !
|
|
8505
|
-
[
|
|
8506
|
-
[
|
|
8526
|
+
if (u && r) return "/";
|
|
8527
|
+
if (!l && !r) return {
|
|
8528
|
+
[a$11(`/${c}`)]: n,
|
|
8529
|
+
[a$11(`/${n}`)]: n
|
|
8507
8530
|
};
|
|
8508
|
-
if (!l &&
|
|
8509
|
-
if (!t.find((e) => e.id === l)) return
|
|
8510
|
-
[
|
|
8511
|
-
[
|
|
8531
|
+
if (!l && r) return i$13(`/${c}`);
|
|
8532
|
+
if (!t.find((e) => e.id === l)) return r ? i$13(`/${c}`) : {
|
|
8533
|
+
[a$11(`/${c}`)]: n,
|
|
8534
|
+
[a$11(`/${n}`)]: n
|
|
8512
8535
|
};
|
|
8513
|
-
let d = [
|
|
8536
|
+
let d = [o$12(t.reduce((e, t) => ({
|
|
8514
8537
|
...e,
|
|
8515
8538
|
[t.id]: t
|
|
8516
8539
|
}), {}), l), c].filter(Boolean).join("/");
|
|
8517
|
-
return
|
|
8518
|
-
[
|
|
8519
|
-
[
|
|
8540
|
+
return r ? i$13(`/${d}`) : {
|
|
8541
|
+
[a$11(`/${d}`)]: n,
|
|
8542
|
+
[a$11(`/${n}`)]: n
|
|
8520
8543
|
};
|
|
8521
8544
|
}
|
|
8522
|
-
var
|
|
8523
|
-
var
|
|
8545
|
+
var p$5 = (e) => !e || typeof e != "string" ? [] : (e.match(/:[a-zA-Z0-9-_:*]+/gim) || []).map((e) => e.replace(":", ""));
|
|
8546
|
+
var m$2 = (e) => p$5(a$11(e));
|
|
8524
8547
|
//#endregion
|
|
8525
8548
|
//#region src/schema/lint/context.ts
|
|
8526
8549
|
/**
|
|
@@ -8595,7 +8618,7 @@ var LintContext = class {
|
|
|
8595
8618
|
/** The component an instance places, when the space declares it. */
|
|
8596
8619
|
instanceOf(element) {
|
|
8597
8620
|
const { referenceId } = element.attributes;
|
|
8598
|
-
return m$
|
|
8621
|
+
return m$3(element) && typeof referenceId === "string" ? p$6(this.schema, referenceId) : void 0;
|
|
8599
8622
|
}
|
|
8600
8623
|
element(id) {
|
|
8601
8624
|
return Object.hasOwn(this.flat, id) ? this.flat[id] : void 0;
|
|
@@ -8632,7 +8655,7 @@ var LintContext = class {
|
|
|
8632
8655
|
const names = this.attributeNames(this.catalogType(element) ?? element.definition.type);
|
|
8633
8656
|
const parentId = element.definition.parentId;
|
|
8634
8657
|
const parent = parentId ? this.element(parentId) : void 0;
|
|
8635
|
-
const extra = [...Object.keys(this.instanceOf(element)?.props ?? {}), ...parent && m$
|
|
8658
|
+
const extra = [...Object.keys(this.instanceOf(element)?.props ?? {}), ...parent && m$3(parent) ? ["slot"] : []];
|
|
8636
8659
|
return names && extra.length > 0 ? [...names, ...extra] : names;
|
|
8637
8660
|
}
|
|
8638
8661
|
/** How a message names an element: its type and id, and the page or layout it is on. */
|
|
@@ -8661,8 +8684,8 @@ var LintContext = class {
|
|
|
8661
8684
|
routeParams(id) {
|
|
8662
8685
|
const rootId = this.element(id)?.definition.rootId ?? id;
|
|
8663
8686
|
const slugOf = (pageId) => textOf(this.element(pageId)?.attributes.slug);
|
|
8664
|
-
if (this.pageIds.has(rootId)) return
|
|
8665
|
-
return [...new Set([...this.pageIds].flatMap((pageId) =>
|
|
8687
|
+
if (this.pageIds.has(rootId)) return m$2(slugOf(rootId));
|
|
8688
|
+
return [...new Set([...this.pageIds].flatMap((pageId) => m$2(slugOf(pageId))))];
|
|
8666
8689
|
}
|
|
8667
8690
|
};
|
|
8668
8691
|
//#endregion
|
|
@@ -8946,7 +8969,7 @@ var onInterval = (ms) => {
|
|
|
8946
8969
|
* and hide the arrow at the end already reached: `[named('row', onScroll()), setState({ key: 'atEnd', type:
|
|
8947
8970
|
* 'boolean', value: '{{ row.atEnd }}' })]`.
|
|
8948
8971
|
*/
|
|
8949
|
-
var onScroll = () => on(s$
|
|
8972
|
+
var onScroll = () => on(s$22);
|
|
8950
8973
|
var onPageLoad = () => on("onPageLoad");
|
|
8951
8974
|
/**
|
|
8952
8975
|
* The end of a server action this element started — the trigger a `detached` run needs, because that step returns
|
|
@@ -10069,6 +10092,67 @@ var applyUtility = (action, params) => {
|
|
|
10069
10092
|
params: c$19(params, utility.params, utility.strictParams)
|
|
10070
10093
|
};
|
|
10071
10094
|
};
|
|
10095
|
+
var NOT_FOUND_ID = "plitzi-not-found";
|
|
10096
|
+
/**
|
|
10097
|
+
* The page a space that declares none of its own answers an unknown address with — inside the home page's layout, so
|
|
10098
|
+
* a visitor who mistyped a link is still on the site: what was asked for is not here, and the way home.
|
|
10099
|
+
*/
|
|
10100
|
+
var defaultNotFoundPage = (home) => ({
|
|
10101
|
+
id: NOT_FOUND_ID,
|
|
10102
|
+
name: "Not found",
|
|
10103
|
+
slug: "*",
|
|
10104
|
+
seoTitle: "Page not found",
|
|
10105
|
+
...home?.layout ? { layout: home.layout } : {},
|
|
10106
|
+
body: [container({
|
|
10107
|
+
id: `${NOT_FOUND_ID}-body`,
|
|
10108
|
+
css: {
|
|
10109
|
+
display: "flex",
|
|
10110
|
+
"flex-direction": "column",
|
|
10111
|
+
"align-items": "center",
|
|
10112
|
+
"row-gap": "16px",
|
|
10113
|
+
padding: "96px 24px",
|
|
10114
|
+
"text-align": "center"
|
|
10115
|
+
},
|
|
10116
|
+
children: [
|
|
10117
|
+
heading("Page not found", {
|
|
10118
|
+
id: `${NOT_FOUND_ID}-title`,
|
|
10119
|
+
subType: "h1"
|
|
10120
|
+
}),
|
|
10121
|
+
paragraph({
|
|
10122
|
+
id: `${NOT_FOUND_ID}-text`,
|
|
10123
|
+
content: "There is nothing at this address."
|
|
10124
|
+
}),
|
|
10125
|
+
link({
|
|
10126
|
+
id: `${NOT_FOUND_ID}-home`,
|
|
10127
|
+
href: "/",
|
|
10128
|
+
content: "Back to the home page"
|
|
10129
|
+
})
|
|
10130
|
+
]
|
|
10131
|
+
})]
|
|
10132
|
+
});
|
|
10133
|
+
var isTopLevelNotFound = (page) => page.slug === "*" && !page.folder;
|
|
10134
|
+
/**
|
|
10135
|
+
* The space with a page for the addresses no page answers: its own, or — when it declares none — a plain one, said as a
|
|
10136
|
+
* suggestion so the author knows it is there and how to write theirs. A space that is not a list of pages yet is left
|
|
10137
|
+
* as it is, for authoring to refuse.
|
|
10138
|
+
*/
|
|
10139
|
+
var withNotFoundPage = (spec) => {
|
|
10140
|
+
if (!Array.isArray(spec.pages) || spec.pages.length === 0 || spec.pages.some(isTopLevelNotFound)) return { spec };
|
|
10141
|
+
const home = spec.pages.find((page) => page.slug === "" && !page.folder);
|
|
10142
|
+
const page = defaultNotFoundPage(home);
|
|
10143
|
+
return {
|
|
10144
|
+
spec: {
|
|
10145
|
+
...spec,
|
|
10146
|
+
pages: [...spec.pages, page]
|
|
10147
|
+
},
|
|
10148
|
+
added: {
|
|
10149
|
+
code: "not-found-page",
|
|
10150
|
+
message: `No page answers an address nothing else does, so a plain one was added${home?.layout ? ` in the layout "${home.layout.id}"` : ""}, sent with status 404: write your own — a page whose slug is '*' — to say it in the space's words.`,
|
|
10151
|
+
elementIds: [NOT_FOUND_ID],
|
|
10152
|
+
saves: 0
|
|
10153
|
+
}
|
|
10154
|
+
};
|
|
10155
|
+
};
|
|
10072
10156
|
//#endregion
|
|
10073
10157
|
//#region ../sdk-shared/dist/actions/failureHandler.mjs
|
|
10074
10158
|
var e$13 = "flow.onFailure";
|
|
@@ -10949,8 +11033,8 @@ var lintLinkHash = (ctx, link, anchorsByPage) => {
|
|
|
10949
11033
|
}
|
|
10950
11034
|
if ((attributeText$1(link, "mode") || "page") !== "page") return;
|
|
10951
11035
|
const { flat, schema } = ctx;
|
|
10952
|
-
const path =
|
|
10953
|
-
const pageId = [...ctx.pageIds].find((id) =>
|
|
11036
|
+
const path = s$10(flat, schema.pageFolders, attributeText$1(link, "href"), true);
|
|
11037
|
+
const pageId = [...ctx.pageIds].find((id) => s$10(flat, schema.pageFolders, id, true) === path);
|
|
10954
11038
|
if (!pageId) return;
|
|
10955
11039
|
const anchors = anchorsByPage(pageId);
|
|
10956
11040
|
if (!anchors.has(hash)) {
|
|
@@ -11077,7 +11161,7 @@ var lintInstances = (ctx) => {
|
|
|
11077
11161
|
const bound = boundProps(element);
|
|
11078
11162
|
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);
|
|
11079
11163
|
const written = Object.fromEntries(Object.keys(declared).map((name) => [name, element.attributes[name]]));
|
|
11080
|
-
for (const { key, expected, got, options } of s$
|
|
11164
|
+
for (const { key, expected, got, options } of s$23(written, written, declared)) {
|
|
11081
11165
|
const value = written[key];
|
|
11082
11166
|
const suggestion = options && typeof value === "string" ? didYouMean(value, options) : "";
|
|
11083
11167
|
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);
|
|
@@ -12256,15 +12340,26 @@ var checkBindings = (ctx, element, where) => {
|
|
|
12256
12340
|
}
|
|
12257
12341
|
};
|
|
12258
12342
|
/**
|
|
12343
|
+
* The attributes the page server evaluates in full, by element type — never rendered, so never held to what an
|
|
12344
|
+
* attribute resolves: a provider's `notFound`, read against its answer (`source`) once it is in.
|
|
12345
|
+
*/
|
|
12346
|
+
var SERVER_EXPRESSIONS = { apiContainer: ["notFound"] };
|
|
12347
|
+
/**
|
|
12259
12348
|
* An attribute's `{{ token }}` against what the attribute will see when it renders — and a condition in an attribute,
|
|
12260
12349
|
* which is used as written: an attribute only resolves a name with filters.
|
|
12261
12350
|
*/
|
|
12262
12351
|
var checkAttributeTemplates = (ctx, element, where) => {
|
|
12263
12352
|
if (PROSE_TYPES.has(element.definition.type)) return;
|
|
12264
|
-
|
|
12353
|
+
const evaluated = SERVER_EXPRESSIONS[element.definition.type] ?? [];
|
|
12354
|
+
const rendered = Object.fromEntries(Object.entries(element.attributes).filter(([name]) => !evaluated.includes(name)));
|
|
12355
|
+
for (const name of evaluated) {
|
|
12356
|
+
const value = element.attributes[name];
|
|
12357
|
+
if (typeof value === "string" && value !== "") checkTemplate(ctx, value, `${where}: its "${name}"`, { kind: "binding" }, ctx.scope(element.id), element.id);
|
|
12358
|
+
}
|
|
12359
|
+
for (const value of stringsIn$1(rendered)) if (e$6(value) && !n$46(value)) ctx.warn("template-never-resolved", `${where} carries "${shorten(value)}", which is never resolved: an attribute only reads a name with filters (\`{{ post.slug|upper }}\`). Move the expression into a binding's \`twigTemplate\`, where it is evaluated in full.`, element.id, { value });
|
|
12265
12360
|
const routeParams = ctx.routeParams(element.id);
|
|
12266
12361
|
const scope = ctx.scope(element.id);
|
|
12267
|
-
for (const [name, value] of Object.entries(
|
|
12362
|
+
for (const [name, value] of Object.entries(rendered)) if (typeof value === "string" && n$46(value)) checkTemplate(ctx, value, `${where}: its "${name}"`, {
|
|
12268
12363
|
kind: "attribute",
|
|
12269
12364
|
routeParams
|
|
12270
12365
|
}, scope, element.id);
|
|
@@ -12350,6 +12445,11 @@ var checkIntent = (ctx, element, where) => {
|
|
|
12350
12445
|
"query"
|
|
12351
12446
|
].find((key) => typeof attributes[key] === "string" && attributes[key] !== "");
|
|
12352
12447
|
if (element.definition.runtime === "server" && ctx.component) ctx.error("server-provider-in-component", `${where} is resolved on the server (\`runtime: 'server'\`) inside component "${ctx.component.id}", and the page server only resolves what a page and its layouts hold — it would stay loading wherever the component is placed. Put the provider on the page, around the instance, and hand the component what it reads as a prop: \`component('${ctx.component.id}', { props: { rows: … } })\`, its list reading \`props.rows\`.`, element.id);
|
|
12448
|
+
const notFound = attributes.notFound;
|
|
12449
|
+
if (typeof notFound === "string" && notFound !== "") {
|
|
12450
|
+
if (element.definition.runtime !== "server") ctx.error("not-found-in-browser", `${where} says when its answer means the address shows nothing (\`notFound\`), but it is asked from the browser, after the page was sent with its status. Give it \`runtime: 'server'\` — or remove \`notFound\` and show the page's "not found" part with \`visible\`.`, element.id);
|
|
12451
|
+
else if (!/^\s*\{\{[\s\S]*\}\}\s*$/.test(notFound)) ctx.error("not-found-not-a-template", `${where} has \`notFound: ${JSON.stringify(notFound)}\`, which is never \`true\`: it is one expression against the answer, \`'{{ source.found == false }}'\`.`, element.id);
|
|
12452
|
+
}
|
|
12353
12453
|
if (element.definition.runtime === "server" && serverSource && ctx.schema.rsc?.enabled === false) ctx.warn("server-data-without-rsc", `${where} is resolved on the server (\`runtime: 'server'\`) through its \`${serverSource}\`, but the space turns server data off (\`rsc: { enabled: false }\`), so it renders its mock data and never asks. Remove that: server data is on unless a space turns it off.`, element.id, { source: serverSource });
|
|
12354
12454
|
const fallback = ctx.catalogs.defaultAttributes?.[type]?.content;
|
|
12355
12455
|
if ((element.definition.items?.length ?? 0) > 0 && typeof fallback === "string" && fallback !== "" && attributes.content === fallback && !bound("content")) ctx.warn("default-content-beside-children", `${where} has children and still its default content "${fallback}", which renders beside them. Set \`content: ''\` to show only the children, or put the words in \`content\`.`, element.id, {
|
|
@@ -12878,7 +12978,7 @@ var attributeText = (element, key) => {
|
|
|
12878
12978
|
/** The path a link inside the space leads to, as the link resolves it: a page id (or its path), or a path of its own. */
|
|
12879
12979
|
var pathOf = (ctx, link, mode) => {
|
|
12880
12980
|
const href = attributeText(link, "href");
|
|
12881
|
-
if (mode === "page") return
|
|
12981
|
+
if (mode === "page") return s$10(ctx.flat, ctx.schema.pageFolders, href, true);
|
|
12882
12982
|
return `/${href}`.replaceAll(/\/+/g, "/").split(/[?#]/)[0];
|
|
12883
12983
|
};
|
|
12884
12984
|
/**
|
|
@@ -14000,9 +14100,9 @@ var p = (e, t, n = "") => [`${e}[data-variant="${t}"]${n}`, `${e}--${t}${n}`];
|
|
|
14000
14100
|
var m = (e, t, n) => {
|
|
14001
14101
|
let r = t ? "," : ", ", i = [];
|
|
14002
14102
|
for (let [l, { default: u, states: d, variants: f }] of Object.entries(e)) {
|
|
14003
|
-
let e = p$
|
|
14103
|
+
let e = p$7(l), m = e ? "" : `.${l}`, h = e ? " > &" : " &", g = e ? "*" : m;
|
|
14004
14104
|
u?.length && i.push(y(`:where(${g})${h}`, u, {}, t, n));
|
|
14005
|
-
for (let [e, r] of o$15(d ?? {})) i.push(y(`:where(${m}${u$6(e)})${h}`, r, {}, t, n)), d$
|
|
14105
|
+
for (let [e, r] of o$15(d ?? {})) i.push(y(`:where(${m}${u$6(e)})${h}`, r, {}, t, n)), d$6(e) && i.push(v(`:where(${g})${h}`, r, t, n));
|
|
14006
14106
|
let _ = (t, n = "") => e ? [`[data-variant="${t}"]${n}`] : p(m, t, n);
|
|
14007
14107
|
for (let [e, o] of Object.entries(f ?? {})) {
|
|
14008
14108
|
if (o.default.length) {
|
|
@@ -14011,15 +14111,15 @@ var m = (e, t, n) => {
|
|
|
14011
14111
|
}
|
|
14012
14112
|
for (let [l, u] of o$15(o.states ?? {})) {
|
|
14013
14113
|
let a = _(e, u$6(l)).join(r);
|
|
14014
|
-
i.push(y(`:where(${a})${h}`, u, {}, t, n)), d$
|
|
14114
|
+
i.push(y(`:where(${a})${h}`, u, {}, t, n)), d$6(l) && i.push(v(`:where(${_(e).join(r)})${h}`, u, t, n));
|
|
14015
14115
|
}
|
|
14016
14116
|
}
|
|
14017
14117
|
}
|
|
14018
14118
|
return i;
|
|
14019
14119
|
};
|
|
14020
14120
|
var h = (e, t, n) => Object.entries(e).flatMap(([e, { default: r, states: o }]) => {
|
|
14021
|
-
let l = r$
|
|
14022
|
-
for (let [e, r] of o$15(o ?? {})) u.push(y(`&${u$6(e)}${l}`, r, {}, t, n)), d$
|
|
14121
|
+
let l = r$17(e), u = r.length ? [y(`&${l}`, r, {}, t, n)] : [];
|
|
14122
|
+
for (let [e, r] of o$15(o ?? {})) u.push(y(`&${u$6(e)}${l}`, r, {}, t, n)), d$6(e) && u.push(v(`&${l}`, r, t, n));
|
|
14023
14123
|
return u;
|
|
14024
14124
|
});
|
|
14025
14125
|
var g = (e, t, n, i) => Object.entries(t).flatMap(([t, { default: a, states: o, pseudos: s }]) => {
|
|
@@ -14034,7 +14134,7 @@ var g = (e, t, n, i) => Object.entries(t).flatMap(([t, { default: a, states: o,
|
|
|
14034
14134
|
var _ = (e, t, n, r = !0, i = l$1) => {
|
|
14035
14135
|
let { states: o, variants: d, ancestors: f, pseudos: p, conditions: _ } = n, b = r ? t.join("") : t.map((e) => `${u(i + l$1)}${e}`).join("\n").replaceAll(":", ": "), x = o ? o$15(o).flatMap(([e, t]) => {
|
|
14036
14136
|
let n = y(`&${u$6(e)}`, t, {}, r, i + l$1);
|
|
14037
|
-
return d$
|
|
14137
|
+
return d$6(e) ? [n, v("&", t, r, i + l$1)] : [n];
|
|
14038
14138
|
}) : [], S = e.replace("plitzi__", ""), C = d ? Object.entries(d).map(([e, t]) => y(`&[data-variant="${e}"]${r ? "," : ", "}&${S}--${e}`, t.default, {
|
|
14039
14139
|
states: t.states,
|
|
14040
14140
|
pseudos: t.pseudos
|
|
@@ -14970,7 +15070,7 @@ var toStates = (states) => {
|
|
|
14970
15070
|
};
|
|
14971
15071
|
var CLASS_NAME = /^-?[_a-zA-Z][\w-]*$/;
|
|
14972
15072
|
var toAncestors = (ancestors) => Object.entries(ancestors ?? {}).map(([name, ancestor]) => {
|
|
14973
|
-
if (!p$
|
|
15073
|
+
if (!p$7(name) && !CLASS_NAME.test(name)) throw new AuthoringError("ancestor-not-class", `The ancestor "${name}" is not a class name. An ancestor condition is keyed by a class that ancestor wears — \`[card.name]\` for a \`styles()\` declaration — or by \`'>'\` for the parent, whatever it wears.`);
|
|
14974
15074
|
return [name, toBlocks({
|
|
14975
15075
|
css: ancestor.css,
|
|
14976
15076
|
states: ancestor.states,
|
|
@@ -15008,7 +15108,7 @@ var assertPseudo = (pseudo, part) => {
|
|
|
15008
15108
|
for (const rules of ruleSets) for (const [property, value] of Object.entries(rules)) {
|
|
15009
15109
|
if (property === "content") {
|
|
15010
15110
|
if (!i$16.includes(pseudo)) throw new AuthoringError("style-pseudo-content", `\`content\` on \`::${pseudo}\` draws nothing: only ${i$16.map((name) => `\`::${name}\``).join(", ")} take one.`);
|
|
15011
|
-
if (!m$
|
|
15111
|
+
if (!m$4(String(value))) throw new AuthoringError("style-pseudo-content", `\`content: ${String(value)}\` on \`::${pseudo}\` is not text CSS can read, so nothing is drawn. Text goes in quotes inside the string — \`content: '"${String(value).replace(/"/g, "\\\"")}"'\` — and an empty box is \`'""'\`; \`counter()\`, \`attr()\` and \`url()\` are written as they are.`);
|
|
15012
15112
|
continue;
|
|
15013
15113
|
}
|
|
15014
15114
|
if (!u$7(pseudo, property)) throw new AuthoringError("style-pseudo-property", `\`${property}\` on \`::${pseudo}\` is dropped by every browser — \`::${pseudo}\` honours ${(l$8[pseudo] ?? []).map((name) => `\`${name}\``).join(", ")}. Style the element itself for the rest.`);
|
|
@@ -17017,7 +17117,7 @@ var declarationsOf = (body) => {
|
|
|
17017
17117
|
* there, and a `content` CSS can read. A rule that does not is left in `customCss`, where it was written and does exactly
|
|
17018
17118
|
* what it did.
|
|
17019
17119
|
*/
|
|
17020
|
-
var pseudoHolds = (pseudo, rules) => Object.entries(rules).every(([property, value]) => property === "content" ? i$16.includes(pseudo) && m$
|
|
17120
|
+
var pseudoHolds = (pseudo, rules) => Object.entries(rules).every(([property, value]) => property === "content" ? i$16.includes(pseudo) && m$4(String(value)) : u$7(pseudo, property));
|
|
17021
17121
|
/** Where a pseudo-element's rules land, its state aside: the class, the pseudo-element and the condition. */
|
|
17022
17122
|
var pseudoKey = ({ className, pseudo, condition }) => `${className}::${pseudo ?? ""}@${condition ?? ""}`;
|
|
17023
17123
|
/**
|
|
@@ -17063,7 +17163,7 @@ var foldCustomCss = (stylesheet, isClass, accepts = () => true) => {
|
|
|
17063
17163
|
const segments = stylesheetSegments(stylesheet);
|
|
17064
17164
|
const candidates = segments.map((segment) => {
|
|
17065
17165
|
if (segment.kind === "other") return;
|
|
17066
|
-
const condition = segment.kind === "atRule" ? f$
|
|
17166
|
+
const condition = segment.kind === "atRule" ? f$6(segment.prelude) : void 0;
|
|
17067
17167
|
if (segment.kind === "atRule" && !condition) return;
|
|
17068
17168
|
const rules = segment.kind === "rule" ? [ruleFold(segment.selector, segment.body, isClass, accepts)] : stylesheetSegments(segment.body).filter((part) => part.kind !== "other" || part.text.trim()).map((part) => part.kind === "rule" ? ruleFold(part.selector, part.body, isClass, accepts, condition) : void 0);
|
|
17069
17169
|
return rules.length > 0 && rules.every((rule) => rule !== void 0) ? rules : void 0;
|
|
@@ -17360,11 +17460,11 @@ var tokensOf$1 = (style) => Object.values(style.variables).flatMap((group) => Ob
|
|
|
17360
17460
|
name,
|
|
17361
17461
|
value
|
|
17362
17462
|
})));
|
|
17363
|
-
var unusedTokenNames = (schema, style) => {
|
|
17463
|
+
var unusedTokenNames = (schema, style, stylesheets = []) => {
|
|
17364
17464
|
const tokens = tokensOf$1(style);
|
|
17365
17465
|
if (tokens.length === 0) return [];
|
|
17366
17466
|
const items = Object.values(style.platform).flatMap((byName) => Object.values(byName));
|
|
17367
|
-
const read = tokensRead(JSON.stringify(schema), ...items.map((item) => JSON.stringify(item.attributes)), ...items.map((item) => JSON.stringify(item.variables ?? {})), JSON.stringify(style.variables), JSON.stringify(style.fonts ?? []));
|
|
17467
|
+
const read = tokensRead(JSON.stringify(schema), ...items.map((item) => JSON.stringify(item.attributes)), ...items.map((item) => JSON.stringify(item.variables ?? {})), JSON.stringify(style.variables), JSON.stringify(style.fonts ?? []), ...stylesheets);
|
|
17368
17468
|
return tokens.map((token) => token.name).filter((name) => !read.has(name)).sort();
|
|
17369
17469
|
};
|
|
17370
17470
|
var unusedTokens = (unused) => {
|
|
@@ -17374,7 +17474,7 @@ var unusedTokens = (unused) => {
|
|
|
17374
17474
|
elementIds: [],
|
|
17375
17475
|
subjects: unused,
|
|
17376
17476
|
saves: 0,
|
|
17377
|
-
message: `${String(unused.length)} ${plural(unused.length, "token is", "tokens are")} declared and read nowhere — no \`var(--…)\` in a class, an element, \`customCss
|
|
17477
|
+
message: `${String(unused.length)} ${plural(unused.length, "token is", "tokens are")} declared and read nowhere — no \`var(--…)\` in a class, an element, \`customCss\`, another token or a plugin's stylesheet: ${list(unused)}. Remove ${plural(unused.length, "it", "them")} from \`variables\`, or use ${plural(unused.length, "it", "them")} where a colour is written out instead.`
|
|
17378
17478
|
}];
|
|
17379
17479
|
};
|
|
17380
17480
|
var ABSOLUTE = /* @__PURE__ */ new Set([
|
|
@@ -17440,13 +17540,13 @@ var unusedComponents = (schema, unused) => {
|
|
|
17440
17540
|
* What a space declares and nothing uses — its classes, tokens and components — by the one rule the suggestions, the
|
|
17441
17541
|
* builder's Usages panel and anything else that says "unused" read, so they never disagree.
|
|
17442
17542
|
*/
|
|
17443
|
-
var unusedDeclarations = (schema, style) => ({
|
|
17543
|
+
var unusedDeclarations = (schema, style, stylesheets = []) => ({
|
|
17444
17544
|
classes: unusedClassNames(schema, style),
|
|
17445
|
-
tokens: unusedTokenNames(schema, style),
|
|
17545
|
+
tokens: unusedTokenNames(schema, style, stylesheets),
|
|
17446
17546
|
components: unusedComponentIds(schema)
|
|
17447
17547
|
});
|
|
17448
|
-
var suggestDeclarations = (schema, style) => {
|
|
17449
|
-
const unused = unusedDeclarations(schema, style);
|
|
17548
|
+
var suggestDeclarations = (schema, style, stylesheets = []) => {
|
|
17549
|
+
const unused = unusedDeclarations(schema, style, stylesheets);
|
|
17450
17550
|
return [
|
|
17451
17551
|
...unusedComponents(schema, unused.components),
|
|
17452
17552
|
...unusedClasses(unused.classes),
|
|
@@ -17966,13 +18066,13 @@ var quietCodes = (schema) => new Map([schema.flat, ...Object.values(schema.compo
|
|
|
17966
18066
|
* Each names what to write instead, and the ones about elements say how many it saves, which is what they are ranked
|
|
17967
18067
|
* by.
|
|
17968
18068
|
*/
|
|
17969
|
-
var suggestSpace = ({ schema, style }) => withoutQuieted(schema, [
|
|
18069
|
+
var suggestSpace = ({ schema, style }, { stylesheets = [] } = {}) => withoutQuieted(schema, [
|
|
17970
18070
|
...suggestRepeats(schema, style),
|
|
17971
18071
|
...suggestContent(schema, style),
|
|
17972
18072
|
...suggestCustomCss(schema, style),
|
|
17973
18073
|
...suggestCustomCssSlots(schema),
|
|
17974
18074
|
...suggestMotion(schema, style),
|
|
17975
|
-
...suggestDeclarations(schema, style)
|
|
18075
|
+
...suggestDeclarations(schema, style, stylesheets)
|
|
17976
18076
|
]).sort((a, b) => b.saves - a.saves);
|
|
17977
18077
|
/** The suggestions no element they are about quiets — for those read beside the documents, too (authoring's own). */
|
|
17978
18078
|
var withoutQuieted = (schema, suggestions) => {
|
|
@@ -18455,7 +18555,7 @@ var o$1 = (i, a) => {
|
|
|
18455
18555
|
}));
|
|
18456
18556
|
}), [["", l], ...Object.entries(p).map(([e, t]) => [e, t.flat])].forEach(([e, n]) => {
|
|
18457
18557
|
Object.values(n).forEach((r) => {
|
|
18458
|
-
if (!r || !m$
|
|
18558
|
+
if (!r || !m$3(r)) return;
|
|
18459
18559
|
let i = r.attributes.referenceId, a = typeof i == "string" ? p[i] : void 0;
|
|
18460
18560
|
if (!a || typeof i != "string") {
|
|
18461
18561
|
s.push({
|
|
@@ -18675,7 +18775,7 @@ var layoutAttributes = (layout) => layout ? {
|
|
|
18675
18775
|
var SpaceAuthor = class {
|
|
18676
18776
|
spec;
|
|
18677
18777
|
options;
|
|
18678
|
-
flatMap = new d$
|
|
18778
|
+
flatMap = new d$5({
|
|
18679
18779
|
flat: {},
|
|
18680
18780
|
variables: []
|
|
18681
18781
|
});
|
|
@@ -18766,7 +18866,7 @@ var SpaceAuthor = class {
|
|
|
18766
18866
|
const suggestions = [...suggestSpace({
|
|
18767
18867
|
schema,
|
|
18768
18868
|
style
|
|
18769
|
-
}), ...withoutQuieted(schema, this.classOverrides(schema, style.mode ?? "desktop-first"))].map((suggestion) => {
|
|
18869
|
+
}, { stylesheets: this.options.stylesheets ?? [] }), ...withoutQuieted(schema, this.classOverrides(schema, style.mode ?? "desktop-first"))].map((suggestion) => {
|
|
18770
18870
|
const first = suggestion.elementIds.at(0);
|
|
18771
18871
|
const at = first === void 0 ? void 0 : writtenAt(this.specOf(first));
|
|
18772
18872
|
return at === void 0 ? suggestion : {
|
|
@@ -18856,7 +18956,7 @@ var SpaceAuthor = class {
|
|
|
18856
18956
|
const sources = /* @__PURE__ */ new Map();
|
|
18857
18957
|
this.collectSources(component.root, sources);
|
|
18858
18958
|
this.componentTrees.set(component.id, {
|
|
18859
|
-
map: new d$
|
|
18959
|
+
map: new d$5({
|
|
18860
18960
|
flat: {},
|
|
18861
18961
|
variables: []
|
|
18862
18962
|
}),
|
|
@@ -19063,7 +19163,7 @@ var SpaceAuthor = class {
|
|
|
19063
19163
|
}
|
|
19064
19164
|
/** An ancestor condition names a class some ancestor wears; one this space does not declare can never match. */
|
|
19065
19165
|
assertAncestorClasses() {
|
|
19066
|
-
for (const breakpoint of BREAKPOINTS$1) for (const item of Object.values(this.platform[breakpoint])) for (const [slot, block] of Object.entries(item.attributes)) for (const ancestor of Object.keys(block.ancestors ?? {}).filter((name) => !p$
|
|
19166
|
+
for (const breakpoint of BREAKPOINTS$1) for (const item of Object.values(this.platform[breakpoint])) for (const [slot, block] of Object.entries(item.attributes)) for (const ancestor of Object.keys(block.ancestors ?? {}).filter((name) => !p$7(name))) this.assertClass(ancestor, `The ${item.type} "${item.name}" (${slot}, ${breakpoint}), in its \`ancestors\`,`);
|
|
19067
19167
|
}
|
|
19068
19168
|
/** `<type>-<n>` for an element nobody named. Positional and deterministic, so a re-run writes the same document;
|
|
19069
19169
|
* it steps over anything the author named so a derived name can never take one. */
|
|
@@ -19243,7 +19343,8 @@ var SpaceAuthor = class {
|
|
|
19243
19343
|
if (earlier !== void 0) {
|
|
19244
19344
|
const holder = tree.map.flat[element.id]?.definition.type;
|
|
19245
19345
|
const root = holder === "page" ? "page" : holder === "layoutContainer" ? "layout" : void 0;
|
|
19246
|
-
|
|
19346
|
+
const provider = holder === "apiContainer" && element.definition.type === "apiContainer";
|
|
19347
|
+
throw new AuthoringError("id-taken", root ? `Element "${element.id}" (${element.definition.type}) at ${path} uses the name of the ${root} at ${earlier} — ids are one namespace for the whole space, pages and layouts included. Give the element a name of its own: \`id: '${element.id}-${element.definition.type.toLowerCase()}'\`.` : provider ? `Provider "${element.id}" at ${path} is declared again — it is at ${earlier} too. Ids are one namespace for the whole space, and a provider's id is the name its source is read by: put it once in the layout those pages share (\`layouts\`, and \`layout: { id, slot }\` on each page), where every page reads it as it does now — a provider in a layout serves every page.` : `Element "${element.id}" (${element.definition.type}) at ${path} uses a name already taken at ${earlier}. Ids are one namespace for the whole space — layouts and every page share it — so wrap the function called more than once in \`scope('<what it is for>', ref => …)\`, which prefixes every id inside it.`);
|
|
19247
19348
|
}
|
|
19248
19349
|
if (!tree.map.addElement(element, to, position)) throw new AuthoringError("element-rejected", `Could not author element "${element.id}" (${element.definition.type}) at ${path}: the schema refused it`);
|
|
19249
19350
|
this.authoredAt.set(element.id, path);
|
|
@@ -19499,7 +19600,7 @@ var SpaceAuthor = class {
|
|
|
19499
19600
|
slug: page.slug,
|
|
19500
19601
|
path: this.routeFor(page),
|
|
19501
19602
|
...page.accessLevel ? { accessLevel: page.accessLevel } : {},
|
|
19502
|
-
params:
|
|
19603
|
+
params: m$2(page.slug),
|
|
19503
19604
|
...page.layout ? { layout: page.layout.id } : {},
|
|
19504
19605
|
elements: {}
|
|
19505
19606
|
};
|
|
@@ -19542,7 +19643,7 @@ var SpaceAuthor = class {
|
|
|
19542
19643
|
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"}.`);
|
|
19543
19644
|
const bound = new Set(spec.bind === void 0 ? [] : toBindingSpecs(spec.bind).map((binding) => binding.to));
|
|
19544
19645
|
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.`);
|
|
19545
|
-
const invalid = s$
|
|
19646
|
+
const invalid = s$23(given, given, props).at(0);
|
|
19546
19647
|
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(", ")}` : ""}.`);
|
|
19547
19648
|
const slots = target.slots ?? [];
|
|
19548
19649
|
for (const child of spec.children ?? []) {
|
|
@@ -20181,7 +20282,7 @@ var validateSnippet$1 = (snippet, options = {}) => {
|
|
|
20181
20282
|
}));
|
|
20182
20283
|
const { errors: spaceErrors, warnings } = validateSpace$1({
|
|
20183
20284
|
schema: {
|
|
20184
|
-
...r$
|
|
20285
|
+
...r$22.schema,
|
|
20185
20286
|
...schema
|
|
20186
20287
|
},
|
|
20187
20288
|
style
|
|
@@ -22234,10 +22335,10 @@ var SpecReader = class {
|
|
|
22234
22335
|
*/
|
|
22235
22336
|
placedNames(element) {
|
|
22236
22337
|
const { referenceId } = element.attributes;
|
|
22237
|
-
const component = m$
|
|
22338
|
+
const component = m$3(element) && typeof referenceId === "string" ? p$6(this.documents.schema, referenceId) : void 0;
|
|
22238
22339
|
const parentId = element.definition.parentId;
|
|
22239
22340
|
const parent = parentId && Object.hasOwn(this.flat, parentId) ? this.flat[parentId] : void 0;
|
|
22240
|
-
return [...Object.keys(component?.props ?? {}), ...parent && m$
|
|
22341
|
+
return [...Object.keys(component?.props ?? {}), ...parent && m$3(parent) ? ["slot"] : []];
|
|
22241
22342
|
}
|
|
22242
22343
|
readAttributes(type, attributes, placed = []) {
|
|
22243
22344
|
const declared = Object.hasOwn(ATTRIBUTE_NAMES, type) ? ATTRIBUTE_NAMES[type] : void 0;
|
|
@@ -23932,6 +24033,9 @@ var importedFiles = ({ probes, dark }) => {
|
|
|
23932
24033
|
//#region src/spaces/blank/content.ts?raw
|
|
23933
24034
|
var content_default = "import type { Tone } from './theme.ts';\n\n/**\n * What the page says, as data: the docs it points to, the three ways to change it and the guides to read on. Each band\n * is one of these lists mapped through one function of `index.ts` — add an entry and a card appears, styled like the\n * rest.\n */\n\n/** Where the documentation lives. Every link on the page starts here, so moving the docs is one line. */\nexport const DOCS = 'https://plitzi.com/docs';\n\nexport type Path = { id: string; title: string; body: string; path: string; icon: string; tone: Tone };\n\n/**\n * The three ways to change this page — the builder, code, an agent — as data: the band is this list, mapped. They\n * are the same space either way, so any one of them can be put down and another picked up.\n */\nexport const PATHS: (Path & { command?: string })[] = [\n {\n id: 'path-builder',\n title: 'In the builder',\n body: 'Select anything on this page and change it: drag elements in, style them, wire them to data, and publish.',\n path: 'elements',\n icon: 'fas fa-pen-ruler',\n tone: 'violet'\n },\n {\n id: 'path-code',\n title: 'In code',\n body: 'The same space as TypeScript, in a project of your own — served by your server, or pushed back here.',\n path: 'cli',\n icon: 'fas fa-code',\n tone: 'cyan',\n command: 'npx @plitzi/cli create my-site'\n },\n {\n id: 'path-agent',\n title: 'With an agent',\n body: 'Connect Claude or any MCP client. It reads and edits this space under the same rules as you do.',\n path: 'agents',\n icon: 'fas fa-robot',\n tone: 'blue'\n }\n];\n\n/** Where to read on, as data: the grid below is this list, mapped. Each one is a page of the docs. */\nexport const GUIDES: Path[] = [\n {\n id: 'concepts',\n title: 'Core concepts',\n body: 'Spaces, pages, elements, and who owns what.',\n path: 'concepts',\n icon: 'fas fa-shapes',\n tone: 'violet'\n },\n {\n id: 'authoring',\n title: 'A space in code',\n body: 'One declaration in, two documents out.',\n path: 'authoring',\n icon: 'fas fa-code',\n tone: 'cyan'\n },\n {\n id: 'styling',\n title: 'Styling and themes',\n body: 'Classes, states, breakpoints, light and dark.',\n path: 'styling',\n icon: 'fas fa-palette',\n tone: 'rose'\n },\n {\n id: 'data',\n title: 'Data and bindings',\n body: 'Fetch from an API, show it anywhere.',\n path: 'data',\n icon: 'fas fa-database',\n tone: 'emerald'\n },\n {\n id: 'interactions',\n title: 'Interactions and flows',\n body: 'Clicks and forms wired to steps, no code.',\n path: 'interactions',\n icon: 'fas fa-bolt',\n tone: 'amber'\n },\n {\n id: 'quickstart',\n title: 'Quickstart',\n body: 'From a new space to a published site.',\n path: 'quickstart',\n icon: 'fas fa-flag-checkered',\n tone: 'blue'\n }\n];\n";
|
|
23934
24035
|
//#endregion
|
|
24036
|
+
//#region src/spaces/blank/notFound.ts?raw
|
|
24037
|
+
var notFound_default$2 = "import { bodyText, button, heroBand, kicker, sectionTitle, shell } from './theme.ts';\nimport { container, heading, link, paragraph, text } from '../../elements';\n\nimport type { PageSpec } from '../../schema';\n\n/** The page of every address no other page answers, sent with status 404: what was asked for is not here, and the way back. */\nexport const notFound: PageSpec = {\n id: 'not-found',\n name: 'Not found',\n slug: '*',\n body: [\n container({\n id: 'not-found-main',\n subType: 'main',\n class: [shell, heroBand],\n children: [\n text('404', { id: 'not-found-kicker', class: kicker }),\n heading('Page not found', { id: 'not-found-title', subType: 'h1', class: sectionTitle }),\n paragraph({\n id: 'not-found-lede',\n class: bodyText,\n content: 'There is nothing at this address — it may have moved, or the link has a typo.'\n }),\n link({ id: 'not-found-home', href: '/', class: button, content: 'Back to the home page' })\n ]\n })\n ]\n};\n";
|
|
24038
|
+
//#endregion
|
|
23935
24039
|
//#region src/spaces/blank/content.ts
|
|
23936
24040
|
/**
|
|
23937
24041
|
* What the page says, as data: the docs it points to, the three ways to change it and the guides to read on. Each band
|
|
@@ -24380,6 +24484,41 @@ var footerRow = styles("footer-row", { css: {
|
|
|
24380
24484
|
}
|
|
24381
24485
|
} });
|
|
24382
24486
|
//#endregion
|
|
24487
|
+
//#region src/spaces/blank/notFound.ts
|
|
24488
|
+
/** The page of every address no other page answers, sent with status 404: what was asked for is not here, and the way back. */
|
|
24489
|
+
var notFound$1 = {
|
|
24490
|
+
id: "not-found",
|
|
24491
|
+
name: "Not found",
|
|
24492
|
+
slug: "*",
|
|
24493
|
+
body: [container({
|
|
24494
|
+
id: "not-found-main",
|
|
24495
|
+
subType: "main",
|
|
24496
|
+
class: [shell$1, heroBand],
|
|
24497
|
+
children: [
|
|
24498
|
+
text$1("404", {
|
|
24499
|
+
id: "not-found-kicker",
|
|
24500
|
+
class: kicker
|
|
24501
|
+
}),
|
|
24502
|
+
heading("Page not found", {
|
|
24503
|
+
id: "not-found-title",
|
|
24504
|
+
subType: "h1",
|
|
24505
|
+
class: sectionTitle
|
|
24506
|
+
}),
|
|
24507
|
+
paragraph({
|
|
24508
|
+
id: "not-found-lede",
|
|
24509
|
+
class: bodyText,
|
|
24510
|
+
content: "There is nothing at this address — it may have moved, or the link has a typo."
|
|
24511
|
+
}),
|
|
24512
|
+
link({
|
|
24513
|
+
id: "not-found-home",
|
|
24514
|
+
href: "/",
|
|
24515
|
+
class: button,
|
|
24516
|
+
content: "Back to the home page"
|
|
24517
|
+
})
|
|
24518
|
+
]
|
|
24519
|
+
})]
|
|
24520
|
+
};
|
|
24521
|
+
//#endregion
|
|
24383
24522
|
//#region src/spaces/blank/tokens.ts
|
|
24384
24523
|
/**
|
|
24385
24524
|
* Every colour the page uses, per scheme.
|
|
@@ -24810,7 +24949,15 @@ var space$1 = {
|
|
|
24810
24949
|
* makes the dark scheme work: a hard-coded colour would win against the theme and leave black text on black.
|
|
24811
24950
|
*/
|
|
24812
24951
|
elements: {
|
|
24813
|
-
page: { base: {
|
|
24952
|
+
page: { base: {
|
|
24953
|
+
"font-family": "var(--font-sans)",
|
|
24954
|
+
"flex-direction": "column",
|
|
24955
|
+
position: "relative",
|
|
24956
|
+
"min-width": "100%",
|
|
24957
|
+
"min-height": "100dvh",
|
|
24958
|
+
color: "var(--foreground)",
|
|
24959
|
+
"background-color": "var(--background)"
|
|
24960
|
+
} },
|
|
24814
24961
|
heading: { base: { color: "var(--foreground)" } },
|
|
24815
24962
|
text: { base: { color: "inherit" } },
|
|
24816
24963
|
paragraph: { base: { color: "var(--foreground)" } },
|
|
@@ -24822,12 +24969,6 @@ var space$1 = {
|
|
|
24822
24969
|
slug: "",
|
|
24823
24970
|
isDefault: true,
|
|
24824
24971
|
css: {
|
|
24825
|
-
"flex-direction": "column",
|
|
24826
|
-
position: "relative",
|
|
24827
|
-
"min-width": "100%",
|
|
24828
|
-
"min-height": "100dvh",
|
|
24829
|
-
color: "var(--foreground)",
|
|
24830
|
-
"background-color": "var(--background)",
|
|
24831
24972
|
"background-image": "radial-gradient(60rem 32rem at 50% -8rem, var(--glow), transparent 70%)",
|
|
24832
24973
|
"background-repeat": "no-repeat"
|
|
24833
24974
|
},
|
|
@@ -24903,17 +25044,47 @@ var space$1 = {
|
|
|
24903
25044
|
})]
|
|
24904
25045
|
})
|
|
24905
25046
|
]
|
|
24906
|
-
}]
|
|
25047
|
+
}, notFound$1]
|
|
24907
25048
|
};
|
|
24908
25049
|
//#endregion
|
|
24909
25050
|
//#region src/spaces/blank/spec.ts?raw
|
|
24910
|
-
var spec_default$1 = "import { DOCS, GUIDES, PATHS } from './content.ts';\nimport {\n backdrop,\n bodyText,\n brandMark,\n button,\n card,\n cardArrow,\n cardGrid,\n cardHead,\n cardsBand,\n cardTitle,\n command,\n footerBand,\n footerRow,\n guide,\n guideCopy,\n heroBand,\n iconButton,\n kicker,\n navLink,\n sectionHead,\n sectionTitle,\n shell,\n step,\n tile,\n tones,\n topBarBand\n} from './theme.ts';\nimport { fonts, variables } from './tokens.ts';\nimport { container, fontAwesome, heading, image, link, paragraph, text, themeToggle } from '../../elements';\n\nimport type { Path } from './content.ts';\nimport type { ElementSpec, SpaceSpec } from '../../schema';\n\n/**\n * The space, declared: this file is the page, and it assembles the rest — the palette in `tokens.ts`, the classes in\n * `theme.ts`, what the page says in `content.ts`. Everything else — element ids, style selector names, the\n * back-references between them — is derived from what is written in them, so authoring it twice writes byte-identical\n * documents and there is no generated file to keep in step.\n *\n * It starts as the space Plitzi gives a new account, and it is yours: rename things, change the palette, delete the\n * guides. The paths and the guides are each one function mapped over one list, which is not a saving of keystrokes —\n * change `guideCard` and all six follow, add an entry to `GUIDES` and a seventh appears, styled like the rest.\n *\n * Name anything a test, a binding or an agent should be able to point at (`id: 'hero-title'`). An element with no\n * name gets a positional one, which moves the moment something is inserted above it.\n */\n\n// ── The cards ──────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst pathCard = (entry: (typeof PATHS)[number], index: number): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: card,\n children: [\n container({\n class: cardHead,\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n // The number is for the eye: read out, \"1\" before \"In the builder\" says nothing the order does not.\n container({ class: step, decorative: true, children: [text({ content: String(index + 1) })] }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n }),\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText }),\n ...(entry.command\n ? [\n container({\n class: command,\n children: [\n container({ decorative: true, css: { color: 'var(--muted)' }, children: [text({ content: '$' })] }),\n text({ content: entry.command })\n ]\n })\n ]\n : [])\n ]\n });\n\nconst guideCard = (entry: Path): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: [card, guide],\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n container({\n class: guideCopy,\n children: [\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText })\n ]\n }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n });\n\n/** A band's head: its kicker, its title, and a line saying what is in it. */\nconst sectionHeader = (id: string, kickerText: string, title: string, lede: string): ElementSpec =>\n container({\n class: sectionHead,\n children: [\n text({ content: kickerText, class: kicker }),\n heading({ id: `${id}-title`, content: title, subType: 'h2', class: sectionTitle }),\n paragraph({ content: lede, class: bodyText })\n ]\n });\n\n// ── The page ───────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst topBar = container({\n id: 'top-bar',\n subType: 'header',\n class: [shell, topBarBand],\n children: [\n link({\n id: 'brand',\n href: 'https://plitzi.com',\n mode: 'external',\n target: 'blank',\n class: navLink,\n children: [\n // The name beside it already says what the mark is: read out, it would say \"Plitzi\" twice.\n image({ src: 'https://cdn.plitzi.com/resources/img/favicon.svg', decorative: true, class: brandMark }),\n text({ content: 'Plitzi', css: { color: 'var(--foreground)', 'font-size': '16px', 'font-weight': '700' } })\n ]\n }),\n container({\n id: 'top-actions',\n subType: 'nav',\n label: 'Plitzi',\n css: { display: 'flex', 'align-items': 'center', gap: '8px' },\n children: [\n link({ id: 'top-docs', href: DOCS, mode: 'external', target: 'blank', class: navLink, content: 'Docs' }),\n themeToggle({ id: 'theme', class: iconButton })\n ]\n })\n ]\n});\n\nconst heroEyebrow = container({\n id: 'hero-eyebrow',\n css: {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n padding: '6px 12px',\n 'border-radius': '999px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n 'font-size': '13px',\n 'font-weight': '500'\n },\n children: [\n container({\n css: { width: '8px', height: '8px', 'border-radius': '999px', 'background-color': 'var(--tint-emerald)' }\n }),\n text({ content: 'Your new space', css: { color: 'var(--muted)' } })\n ]\n});\n\nconst heroTitle = heading({\n id: 'hero-title',\n content: 'Welcome to Plitzi',\n subType: 'h1',\n css: {\n desktop: {\n 'font-size': '64px',\n 'font-weight': '700',\n 'letter-spacing': '-0.03em',\n 'line-height': '1.05',\n 'text-align': 'center',\n margin: '0px'\n },\n tablet: { 'font-size': '48px' },\n mobile: { 'font-size': '38px' }\n }\n});\n\nconst heroLede = paragraph({\n id: 'hero-lede',\n content:\n 'This page is where your space starts, and it is already yours. Change any of it in the builder, in code, ' +\n 'or by asking an agent — below is how, and where to read more.',\n css: {\n desktop: {\n color: 'var(--muted)',\n 'font-size': '18px',\n 'line-height': '1.6',\n 'text-align': 'center',\n 'max-width': '600px',\n margin: '0px'\n },\n mobile: { 'font-size': '16px' }\n }\n});\n\nconst heroActions = container({\n id: 'hero-actions',\n css: {\n desktop: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n gap: '12px',\n 'margin-top': '8px'\n },\n mobile: { 'flex-direction': 'column', 'align-items': 'stretch', width: '100%' }\n },\n children: [\n link({\n id: 'cta-quickstart',\n href: `${DOCS}/quickstart`,\n mode: 'external',\n target: 'blank',\n class: button,\n variant: 'primary',\n content: 'Start the quickstart',\n icon: 'fas fa-arrow-right',\n iconPlacement: 'after'\n }),\n link({\n id: 'cta-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: button,\n content: 'Read the docs',\n icon: 'fas fa-book-open'\n })\n ]\n});\n\nexport const space: SpaceSpec = {\n name: 'New space',\n permanentUrl: 'new-space',\n mode: 'desktop-first',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n variables,\n fonts,\n /**\n * What text is, before any class touches it.\n *\n * Per element TYPE, so every heading and paragraph follows the palette without naming a colour — which is what\n * makes the dark scheme work: a hard-coded colour would win against the theme and leave black text on black.\n */\n elements: {\n page: { base: { 'font-family': 'var(--font-sans)' } },\n heading: { base: { color: 'var(--foreground)' } },\n text: { base: { color: 'inherit' } },\n paragraph: { base: { color: 'var(--foreground)' } },\n fontAwesome: { base: { color: 'inherit' } }\n },\n pages: [\n {\n id: 'home',\n name: 'Home',\n slug: '',\n isDefault: true,\n css: {\n 'flex-direction': 'column',\n position: 'relative',\n 'min-width': '100%',\n 'min-height': '100dvh',\n color: 'var(--foreground)',\n 'background-color': 'var(--background)',\n // A glow over the top of the page, in the palette's primary, so it follows the scheme like everything else.\n 'background-image': 'radial-gradient(60rem 32rem at 50% -8rem, var(--glow), transparent 70%)',\n 'background-repeat': 'no-repeat'\n },\n body: [\n container({ id: 'backdrop', class: backdrop, decorative: true }),\n topBar,\n container({\n id: 'main',\n subType: 'main',\n css: { display: 'flex', 'flex-direction': 'column' },\n children: [\n container({\n id: 'hero',\n class: [shell, heroBand],\n children: [heroEyebrow, heroTitle, heroLede, heroActions]\n }),\n container({\n id: 'paths',\n subType: 'section',\n label: 'Make it yours',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'paths',\n 'Make it yours',\n 'Three ways in, one space',\n 'Start with whichever suits you — the others see every change it makes.'\n ),\n container({ id: 'path-cards', class: cardGrid, children: PATHS.map(pathCard) })\n ]\n }),\n container({\n id: 'guides',\n subType: 'section',\n label: 'Guides',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'guides',\n 'Guides',\n 'Learn the building blocks',\n 'Each one is a page of the docs, short enough to read before you change the page it explains.'\n ),\n container({ id: 'cards', class: cardGrid, children: GUIDES.map(guideCard) })\n ]\n })\n ]\n }),\n container({\n id: 'footer',\n subType: 'footer',\n class: [shell, footerBand],\n children: [\n container({\n class: footerRow,\n children: [\n text({ content: 'Made with Plitzi', css: { color: 'var(--muted)', 'font-size': '13px' } }),\n link({\n id: 'footer-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: navLink,\n content: 'plitzi.com/docs'\n })\n ]\n })\n ]\n })\n ]\n }\n ]\n};\n";
|
|
25051
|
+
var spec_default$1 = "import { DOCS, GUIDES, PATHS } from './content.ts';\nimport { notFound } from './notFound.ts';\nimport {\n backdrop,\n bodyText,\n brandMark,\n button,\n card,\n cardArrow,\n cardGrid,\n cardHead,\n cardsBand,\n cardTitle,\n command,\n footerBand,\n footerRow,\n guide,\n guideCopy,\n heroBand,\n iconButton,\n kicker,\n navLink,\n sectionHead,\n sectionTitle,\n shell,\n step,\n tile,\n tones,\n topBarBand\n} from './theme.ts';\nimport { fonts, variables } from './tokens.ts';\nimport { container, fontAwesome, heading, image, link, paragraph, text, themeToggle } from '../../elements';\n\nimport type { Path } from './content.ts';\nimport type { ElementSpec, SpaceSpec } from '../../schema';\n\n/**\n * The space, declared: this file is the page, and it assembles the rest — the palette in `tokens.ts`, the classes in\n * `theme.ts`, what the page says in `content.ts`. Everything else — element ids, style selector names, the\n * back-references between them — is derived from what is written in them, so authoring it twice writes byte-identical\n * documents and there is no generated file to keep in step.\n *\n * It starts as the space Plitzi gives a new account, and it is yours: rename things, change the palette, delete the\n * guides. The paths and the guides are each one function mapped over one list, which is not a saving of keystrokes —\n * change `guideCard` and all six follow, add an entry to `GUIDES` and a seventh appears, styled like the rest.\n *\n * Name anything a test, a binding or an agent should be able to point at (`id: 'hero-title'`). An element with no\n * name gets a positional one, which moves the moment something is inserted above it.\n */\n\n// ── The cards ──────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst pathCard = (entry: (typeof PATHS)[number], index: number): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: card,\n children: [\n container({\n class: cardHead,\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n // The number is for the eye: read out, \"1\" before \"In the builder\" says nothing the order does not.\n container({ class: step, decorative: true, children: [text({ content: String(index + 1) })] }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n }),\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText }),\n ...(entry.command\n ? [\n container({\n class: command,\n children: [\n container({ decorative: true, css: { color: 'var(--muted)' }, children: [text({ content: '$' })] }),\n text({ content: entry.command })\n ]\n })\n ]\n : [])\n ]\n });\n\nconst guideCard = (entry: Path): ElementSpec =>\n link({\n id: entry.id,\n href: `${DOCS}/${entry.path}`,\n mode: 'external',\n target: 'blank',\n class: [card, guide],\n children: [\n container({ class: [tile, tones[entry.tone]], children: [fontAwesome({ icon: entry.icon })] }),\n container({\n class: guideCopy,\n children: [\n heading({ id: `${entry.id}-title`, content: entry.title, subType: 'h3', class: cardTitle }),\n paragraph({ content: entry.body, class: bodyText })\n ]\n }),\n fontAwesome({ icon: 'fas fa-arrow-right', class: cardArrow })\n ]\n });\n\n/** A band's head: its kicker, its title, and a line saying what is in it. */\nconst sectionHeader = (id: string, kickerText: string, title: string, lede: string): ElementSpec =>\n container({\n class: sectionHead,\n children: [\n text({ content: kickerText, class: kicker }),\n heading({ id: `${id}-title`, content: title, subType: 'h2', class: sectionTitle }),\n paragraph({ content: lede, class: bodyText })\n ]\n });\n\n// ── The page ───────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst topBar = container({\n id: 'top-bar',\n subType: 'header',\n class: [shell, topBarBand],\n children: [\n link({\n id: 'brand',\n href: 'https://plitzi.com',\n mode: 'external',\n target: 'blank',\n class: navLink,\n children: [\n // The name beside it already says what the mark is: read out, it would say \"Plitzi\" twice.\n image({ src: 'https://cdn.plitzi.com/resources/img/favicon.svg', decorative: true, class: brandMark }),\n text({ content: 'Plitzi', css: { color: 'var(--foreground)', 'font-size': '16px', 'font-weight': '700' } })\n ]\n }),\n container({\n id: 'top-actions',\n subType: 'nav',\n label: 'Plitzi',\n css: { display: 'flex', 'align-items': 'center', gap: '8px' },\n children: [\n link({ id: 'top-docs', href: DOCS, mode: 'external', target: 'blank', class: navLink, content: 'Docs' }),\n themeToggle({ id: 'theme', class: iconButton })\n ]\n })\n ]\n});\n\nconst heroEyebrow = container({\n id: 'hero-eyebrow',\n css: {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n padding: '6px 12px',\n 'border-radius': '999px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n 'font-size': '13px',\n 'font-weight': '500'\n },\n children: [\n container({\n css: { width: '8px', height: '8px', 'border-radius': '999px', 'background-color': 'var(--tint-emerald)' }\n }),\n text({ content: 'Your new space', css: { color: 'var(--muted)' } })\n ]\n});\n\nconst heroTitle = heading({\n id: 'hero-title',\n content: 'Welcome to Plitzi',\n subType: 'h1',\n css: {\n desktop: {\n 'font-size': '64px',\n 'font-weight': '700',\n 'letter-spacing': '-0.03em',\n 'line-height': '1.05',\n 'text-align': 'center',\n margin: '0px'\n },\n tablet: { 'font-size': '48px' },\n mobile: { 'font-size': '38px' }\n }\n});\n\nconst heroLede = paragraph({\n id: 'hero-lede',\n content:\n 'This page is where your space starts, and it is already yours. Change any of it in the builder, in code, ' +\n 'or by asking an agent — below is how, and where to read more.',\n css: {\n desktop: {\n color: 'var(--muted)',\n 'font-size': '18px',\n 'line-height': '1.6',\n 'text-align': 'center',\n 'max-width': '600px',\n margin: '0px'\n },\n mobile: { 'font-size': '16px' }\n }\n});\n\nconst heroActions = container({\n id: 'hero-actions',\n css: {\n desktop: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n gap: '12px',\n 'margin-top': '8px'\n },\n mobile: { 'flex-direction': 'column', 'align-items': 'stretch', width: '100%' }\n },\n children: [\n link({\n id: 'cta-quickstart',\n href: `${DOCS}/quickstart`,\n mode: 'external',\n target: 'blank',\n class: button,\n variant: 'primary',\n content: 'Start the quickstart',\n icon: 'fas fa-arrow-right',\n iconPlacement: 'after'\n }),\n link({\n id: 'cta-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: button,\n content: 'Read the docs',\n icon: 'fas fa-book-open'\n })\n ]\n});\n\nexport const space: SpaceSpec = {\n name: 'New space',\n permanentUrl: 'new-space',\n mode: 'desktop-first',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n variables,\n fonts,\n /**\n * What text is, before any class touches it.\n *\n * Per element TYPE, so every heading and paragraph follows the palette without naming a colour — which is what\n * makes the dark scheme work: a hard-coded colour would win against the theme and leave black text on black.\n */\n elements: {\n // What every page is: the type, the scheme's colours, a whole screen tall.\n page: {\n base: {\n 'font-family': 'var(--font-sans)',\n 'flex-direction': 'column',\n position: 'relative',\n 'min-width': '100%',\n 'min-height': '100dvh',\n color: 'var(--foreground)',\n 'background-color': 'var(--background)'\n }\n },\n heading: { base: { color: 'var(--foreground)' } },\n text: { base: { color: 'inherit' } },\n paragraph: { base: { color: 'var(--foreground)' } },\n fontAwesome: { base: { color: 'inherit' } }\n },\n pages: [\n {\n id: 'home',\n name: 'Home',\n slug: '',\n isDefault: true,\n css: {\n // A glow over the top of the page, in the palette's primary, so it follows the scheme like everything else.\n 'background-image': 'radial-gradient(60rem 32rem at 50% -8rem, var(--glow), transparent 70%)',\n 'background-repeat': 'no-repeat'\n },\n body: [\n container({ id: 'backdrop', class: backdrop, decorative: true }),\n topBar,\n container({\n id: 'main',\n subType: 'main',\n css: { display: 'flex', 'flex-direction': 'column' },\n children: [\n container({\n id: 'hero',\n class: [shell, heroBand],\n children: [heroEyebrow, heroTitle, heroLede, heroActions]\n }),\n container({\n id: 'paths',\n subType: 'section',\n label: 'Make it yours',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'paths',\n 'Make it yours',\n 'Three ways in, one space',\n 'Start with whichever suits you — the others see every change it makes.'\n ),\n container({ id: 'path-cards', class: cardGrid, children: PATHS.map(pathCard) })\n ]\n }),\n container({\n id: 'guides',\n subType: 'section',\n label: 'Guides',\n class: [shell, cardsBand],\n children: [\n sectionHeader(\n 'guides',\n 'Guides',\n 'Learn the building blocks',\n 'Each one is a page of the docs, short enough to read before you change the page it explains.'\n ),\n container({ id: 'cards', class: cardGrid, children: GUIDES.map(guideCard) })\n ]\n })\n ]\n }),\n container({\n id: 'footer',\n subType: 'footer',\n class: [shell, footerBand],\n children: [\n container({\n class: footerRow,\n children: [\n text({ content: 'Made with Plitzi', css: { color: 'var(--muted)', 'font-size': '13px' } }),\n link({\n id: 'footer-docs',\n href: DOCS,\n mode: 'external',\n target: 'blank',\n class: navLink,\n content: 'plitzi.com/docs'\n })\n ]\n })\n ]\n })\n ]\n },\n notFound\n ]\n};\n";
|
|
24911
25052
|
//#endregion
|
|
24912
25053
|
//#region src/spaces/blank/theme.ts?raw
|
|
24913
25054
|
var theme_default = "import { styles } from '../../style';\n\n/**\n * The classes the page wears, declared once and named by the elements that wear them — so re-theming a card re-themes\n * every card. Every colour in them is a `var(--…)` of the palette in `tokens.ts`.\n */\n\n/** The same outline on everything that can be focused from the keyboard. */\nconst focusRing = { outline: '2px solid var(--primary)', 'outline-offset': '3px' };\n\n// A band wears `shell` for its sides and a class of its own for its top and bottom, so both write their sides apart: a\n// `padding` shorthand in either would reset the other's. A class that owns its whole box writes the shorthand.\nexport const shell = styles('shell', {\n css: {\n desktop: {\n display: 'flex',\n 'flex-direction': 'column',\n width: '100%',\n 'max-width': '1120px',\n 'margin-left': 'auto',\n 'margin-right': 'auto',\n 'padding-left': '32px',\n 'padding-right': '32px',\n position: 'relative',\n 'z-index': '1'\n },\n tablet: { 'padding-left': '24px', 'padding-right': '24px' },\n mobile: { 'padding-left': '20px', 'padding-right': '20px' }\n }\n});\n\n/**\n * The grid behind the top of the page, fading into the background as it goes down.\n *\n * Gradients rather than an image: it scales to any screen, costs no request, and follows the theme — the line colour\n * and the fade are variables, so it is faint on light and faint on dark without a second asset. The fade is the first\n * layer, drawn over the lines, so the grid ends softly instead of at an edge.\n */\nexport const backdrop = styles('backdrop', {\n css: {\n desktop: {\n position: 'absolute',\n top: '0px',\n left: '0px',\n right: '0px',\n height: '760px',\n 'pointer-events': 'none',\n 'background-image':\n 'linear-gradient(180deg, transparent 0%, var(--background) 100%), linear-gradient(0deg, var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px)',\n 'background-size': '100% 100%, 48px 48px, 48px 48px',\n 'background-position': '0% 0%, 50% 0%, 50% 0%',\n 'background-repeat': 'no-repeat, repeat, repeat'\n },\n mobile: { height: '560px' }\n }\n});\n\nexport const navLink = styles('nav-link', {\n css: {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n color: 'var(--muted)',\n 'font-size': '14px',\n 'font-weight': '500',\n 'text-decoration': 'none',\n 'border-radius': '8px',\n padding: '6px 10px'\n },\n states: { hover: { color: 'var(--foreground)' }, 'focus-visible': focusRing }\n});\n\n/** The mark beside the name, at the size the bar wants. */\nexport const brandMark = styles('brand-mark', { width: '24px', height: '24px' });\n\n/** The theme switch, dressed like the rest of the bar. It starts as a bare control, centred and in the bar's type. */\nexport const iconButton = styles('icon-button', {\n css: {\n display: 'flex',\n 'justify-content': 'center',\n width: '36px',\n height: '36px',\n 'border-radius': '8px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n color: 'var(--muted)',\n 'font-size': '16px'\n },\n states: { hover: { color: 'var(--foreground)' }, 'focus-visible': focusRing }\n});\n\n/** A call to action. The base is the quiet one; `primary` is the one the eye should land on. */\nexport const button = styles('button', {\n css: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n gap: '8px',\n height: '44px',\n padding: '0px 20px',\n 'border-radius': '10px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n color: 'var(--foreground)',\n 'font-size': '15px',\n 'font-weight': '600',\n 'text-decoration': 'none',\n 'transition-property': 'background-color, border-color, transform',\n 'transition-duration': '150ms',\n 'transition-timing-function': 'ease-out'\n },\n states: {\n hover: { 'border-color': 'var(--muted)' },\n 'focus-visible': focusRing\n },\n variants: {\n primary: {\n css: {\n 'background-color': 'var(--primary)',\n 'border-color': 'var(--primary)',\n color: 'var(--primary-foreground)',\n 'box-shadow': 'var(--shadow-md)'\n },\n states: { hover: { 'background-color': 'var(--primary-hover)', 'border-color': 'var(--primary-hover)' } }\n }\n }\n});\n\n/** A section's small label over its title: what the band is about, in the palette's primary. */\nexport const kicker = styles('kicker', {\n color: 'var(--primary)',\n 'font-size': '13px',\n 'font-weight': '600',\n 'letter-spacing': '0.04em',\n 'text-transform': 'uppercase',\n margin: '0px'\n});\n\nexport const sectionTitle = styles('section-title', {\n css: {\n desktop: {\n 'font-size': '32px',\n 'font-weight': '700',\n 'letter-spacing': '-0.02em',\n 'line-height': '1.15',\n margin: '0px'\n },\n mobile: { 'font-size': '26px' }\n }\n});\n\nexport const sectionHead = styles('section-head', {\n display: 'flex',\n 'flex-direction': 'column',\n gap: '8px',\n 'margin-bottom': '8px'\n});\n\n/** Copy under a title or in a card: the palette's quiet colour, at a size made for reading. */\nexport const bodyText = styles('body-text', {\n color: 'var(--muted)',\n 'font-size': '15px',\n 'line-height': '1.6',\n margin: '0px'\n});\n\n/** A card of either band: the whole card is the link, so the target is as large as what it describes. */\nexport const card = styles('card', {\n css: {\n display: 'flex',\n 'flex-direction': 'column',\n gap: '12px',\n padding: '24px',\n 'border-radius': '16px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--card)',\n 'box-shadow': 'var(--shadow-sm)',\n 'text-decoration': 'none',\n 'transition-property': 'transform, border-color, box-shadow',\n 'transition-duration': '200ms',\n 'transition-timing-function': 'ease-out'\n },\n states: {\n hover: { transform: 'translateY(-3px)', 'border-color': 'var(--primary)', 'box-shadow': 'var(--shadow-lg)' },\n 'focus-visible': focusRing\n }\n});\n\nexport const cardHead = styles('card-head', { display: 'flex', 'align-items': 'center', gap: '10px' });\n\nexport const cardTitle = styles('card-title', {\n color: 'var(--foreground)',\n 'font-size': '17px',\n 'font-weight': '600',\n margin: '0px'\n});\n\n/** The arrow slides while the card around it is hovered. */\nexport const cardArrow = styles('card-arrow', {\n css: {\n color: 'var(--muted)',\n 'font-size': '13px',\n 'margin-left': 'auto',\n 'transition-property': 'transform, color',\n 'transition-duration': '200ms',\n 'transition-timing-function': 'ease-out'\n },\n ancestors: {\n [card.name]: { states: { hover: { transform: 'translateX(4px)', color: 'var(--primary)' } } }\n }\n});\n\n/** The square an icon sits in. Its colour is a tone, worn beside it: `class: [tile, tones.violet]`. */\nexport const tile = styles('tile', {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n width: '40px',\n height: '40px',\n 'flex-shrink': '0',\n 'border-radius': '10px',\n 'font-size': '16px'\n});\n\n/** One class per tone, each a pair of palette variables — so a tone is dark-ready the moment it is declared. */\nexport const tones = {\n violet: styles('tone-violet', { color: 'var(--tint-violet)', 'background-color': 'var(--tint-violet-bg)' }),\n cyan: styles('tone-cyan', { color: 'var(--tint-cyan)', 'background-color': 'var(--tint-cyan-bg)' }),\n amber: styles('tone-amber', { color: 'var(--tint-amber)', 'background-color': 'var(--tint-amber-bg)' }),\n emerald: styles('tone-emerald', { color: 'var(--tint-emerald)', 'background-color': 'var(--tint-emerald-bg)' }),\n rose: styles('tone-rose', { color: 'var(--tint-rose)', 'background-color': 'var(--tint-rose-bg)' }),\n blue: styles('tone-blue', { color: 'var(--tint-blue)', 'background-color': 'var(--tint-blue-bg)' })\n};\n\n/** A path's number, in a circle: the order the three are worth reading in, not an order they must be taken in. */\nexport const step = styles('step', {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'center',\n width: '28px',\n height: '28px',\n 'flex-shrink': '0',\n 'border-radius': '999px',\n border: '1px solid var(--border)',\n color: 'var(--muted)',\n 'font-size': '13px',\n 'font-weight': '600'\n});\n\n/** What a path does, as it would be typed — the one place the page shows code. */\nexport const command = styles('command', {\n display: 'flex',\n 'align-items': 'center',\n gap: '8px',\n 'margin-top': 'auto',\n padding: '10px 12px',\n 'border-radius': '10px',\n border: '1px solid var(--border)',\n 'background-color': 'var(--code-bg)',\n color: 'var(--foreground)',\n 'font-family': 'var(--font-mono)',\n 'font-size': '13px',\n 'white-space': 'nowrap',\n overflow: 'hidden'\n});\n\n/** A guide is smaller than a path: one line under its title, its icon beside it rather than above. */\nexport const guide = styles('guide', {\n 'flex-direction': 'row',\n 'align-items': 'flex-start',\n gap: '16px',\n padding: '20px'\n});\n\nexport const guideCopy = styles('guide-copy', {\n display: 'flex',\n 'flex-direction': 'column',\n gap: '4px',\n 'min-width': '0px'\n});\n\n/** Each band of the page wears `shell` for its width, and one of these for what is its own. */\nexport const topBarBand = styles('top-bar', {\n 'flex-direction': 'row',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n 'padding-top': '20px',\n 'padding-bottom': '20px'\n});\n\nexport const heroBand = styles('hero', {\n css: {\n desktop: { 'align-items': 'center', gap: '24px', 'padding-top': '88px', 'padding-bottom': '88px' },\n tablet: { 'padding-top': '64px', 'padding-bottom': '64px' },\n mobile: { 'padding-top': '40px', 'padding-bottom': '48px' }\n }\n});\n\n/** The two bands of cards: the paths first, the guides after, each under its own head. */\nexport const cardsBand = styles('cards-band', { gap: '20px', 'padding-bottom': '80px' });\n\n/** Three columns that become two and then one, so a card is never narrower than its words. */\nexport const cardGrid = styles('card-grid', {\n css: {\n desktop: { display: 'grid', 'grid-template-columns': 'repeat(3, minmax(0, 1fr))', gap: '16px' },\n tablet: { 'grid-template-columns': 'repeat(2, minmax(0, 1fr))' },\n mobile: { 'grid-template-columns': 'minmax(0, 1fr)' }\n }\n});\n\n/** The footer's line spans the content, not the band's padding: it belongs to what it closes. */\nexport const footerBand = styles('footer', {\n css: {\n desktop: { 'margin-top': 'auto', 'padding-bottom': '32px' },\n mobile: { 'padding-bottom': '24px' }\n }\n});\n\nexport const footerRow = styles('footer-row', {\n css: {\n desktop: {\n display: 'flex',\n 'align-items': 'center',\n 'justify-content': 'space-between',\n gap: '16px',\n 'padding-top': '24px',\n 'border-top': '1px solid var(--border)'\n },\n mobile: { 'flex-direction': 'column', gap: '8px' }\n }\n});\n\n/** A tone by its name: what a card of `content.ts` says it is painted in. */\nexport type Tone = keyof typeof tones;\n";
|
|
24914
25055
|
//#endregion
|
|
24915
25056
|
//#region src/spaces/blank/tokens.ts?raw
|
|
24916
|
-
var tokens_default$1 = "import type { SpaceSpec } from '../../schema';\n\n/**\n * Every colour the page uses, per scheme.\n *\n * `default` is what a browser with no preference gets. No class names a colour directly — they are all `var(--…)` — so\n * switching the palette here re-themes the whole page, in both schemes, without touching a rule.\n */\nexport const variables
|
|
25057
|
+
var tokens_default$1 = "import type { SpaceSpec } from '../../schema';\n\n/**\n * Every colour the page uses, per scheme.\n *\n * `default` is what a browser with no preference gets. No class names a colour directly — they are all `var(--…)` — so\n * switching the palette here re-themes the whole page, in both schemes, without touching a rule.\n */\nexport const variables = {\n color: {\n background: { light: '#fbfbfd', dark: '#09090b', default: '#fbfbfd' },\n foreground: { light: '#17171c', dark: '#fafafa', default: '#17171c' },\n muted: { light: '#5f5f6e', dark: '#a1a1aa', default: '#5f5f6e' },\n card: { light: '#ffffff', dark: '#111115', default: '#ffffff' },\n 'code-bg': { light: '#f4f4f8', dark: '#18181d', default: '#f4f4f8' },\n border: { light: '#e6e6ee', dark: '#27272d', default: '#e6e6ee' },\n primary: { light: '#5b3df5', dark: '#7c66ff', default: '#5b3df5' },\n 'primary-hover': { light: '#4a2de0', dark: '#9180ff', default: '#4a2de0' },\n 'primary-foreground': { light: '#ffffff', dark: '#ffffff', default: '#ffffff' },\n glow: { light: 'rgba(91, 61, 245, 0.16)', dark: 'rgba(124, 102, 255, 0.24)', default: 'rgba(91, 61, 245, 0.16)' },\n grid: { light: '#0000000d', dark: '#ffffff0d', default: '#0000000d' },\n 'tint-violet': { light: '#5b3df5', dark: '#b7a6ff', default: '#5b3df5' },\n 'tint-violet-bg': { light: '#efecfe', dark: '#1c1836', default: '#efecfe' },\n 'tint-cyan': { light: '#0e7490', dark: '#67d8ef', default: '#0e7490' },\n 'tint-cyan-bg': { light: '#e0f5fa', dark: '#0c2a33', default: '#e0f5fa' },\n 'tint-amber': { light: '#a45b00', dark: '#f5c169', default: '#a45b00' },\n 'tint-amber-bg': { light: '#fcf0dc', dark: '#2e2314', default: '#fcf0dc' },\n 'tint-rose': { light: '#c2255c', dark: '#f994bc', default: '#c2255c' },\n 'tint-rose-bg': { light: '#fce8f0', dark: '#331623', default: '#fce8f0' },\n 'tint-emerald': { light: '#0f7b55', dark: '#64d6a6', default: '#0f7b55' },\n 'tint-emerald-bg': { light: '#e0f6ee', dark: '#0e2a21', default: '#e0f6ee' },\n 'tint-blue': { light: '#2159c4', dark: '#8ab0f7', default: '#2159c4' },\n 'tint-blue-bg': { light: '#e6edfc', dark: '#13203c', default: '#e6edfc' }\n },\n shadow: {\n 'shadow-sm': {\n light: '0 1px 2px rgba(12, 12, 20, 0.05)',\n dark: '0 1px 2px rgba(0, 0, 0, 0.5)',\n default: '0 1px 2px rgba(12, 12, 20, 0.05)'\n },\n 'shadow-md': {\n light: '0 1px 2px rgba(12, 12, 20, 0.06), 0 8px 20px -8px rgba(91, 61, 245, 0.45)',\n dark: '0 1px 2px rgba(0, 0, 0, 0.6), 0 8px 24px -8px rgba(124, 102, 255, 0.55)',\n default: '0 1px 2px rgba(12, 12, 20, 0.06), 0 8px 20px -8px rgba(91, 61, 245, 0.45)'\n },\n 'shadow-lg': {\n light: '0 2px 4px rgba(12, 12, 20, 0.05), 0 24px 48px -20px rgba(12, 12, 20, 0.25)',\n dark: '0 2px 4px rgba(0, 0, 0, 0.6), 0 28px 56px -22px rgba(0, 0, 0, 0.85)',\n default: '0 2px 4px rgba(12, 12, 20, 0.05), 0 24px 48px -20px rgba(12, 12, 20, 0.25)'\n }\n },\n custom: {\n 'font-sans':\n 'Geist, ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif',\n 'font-mono': '\"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'\n }\n} satisfies SpaceSpec['variables'];\n\n/** Loaded by the page itself: a face the space names here is the only one it ever fetches. */\nexport const fonts: SpaceSpec['fonts'] = [\n {\n family: 'Geist',\n fallback: 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif',\n weights: [400, 500, 600, 700],\n styles: ['normal'],\n display: 'swap',\n preload: true,\n source: 'google'\n },\n {\n family: 'Geist Mono',\n fallback: 'ui-monospace, SFMono-Regular, Menlo, Consolas, monospace',\n weights: [400],\n styles: ['normal'],\n display: 'swap',\n source: 'google'\n }\n];\n";
|
|
25058
|
+
//#endregion
|
|
25059
|
+
//#region src/spaces/empty/notFound.ts?raw
|
|
25060
|
+
var notFound_default$1 = "import { heading, link, paragraph } from '../../elements';\n\nimport type { PageSpec } from '../../schema';\n\n/** The page of every address no other page answers, sent with status 404: what was asked for is not here, and the way back. */\nexport const notFound: PageSpec = {\n id: 'not-found',\n name: 'Not found',\n slug: '*',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n heading('Page not found', { id: 'not-found-title', subType: 'h1' }),\n paragraph({ id: 'not-found-lede', content: 'There is nothing at this address.' }),\n link({ id: 'not-found-home', href: '/', content: 'Back to the home page' })\n ]\n};\n";
|
|
25061
|
+
//#endregion
|
|
25062
|
+
//#region src/spaces/empty/notFound.ts
|
|
25063
|
+
/** The page of every address no other page answers, sent with status 404: what was asked for is not here, and the way back. */
|
|
25064
|
+
var notFound = {
|
|
25065
|
+
id: "not-found",
|
|
25066
|
+
name: "Not found",
|
|
25067
|
+
slug: "*",
|
|
25068
|
+
layout: {
|
|
25069
|
+
id: "site",
|
|
25070
|
+
slot: "site-main"
|
|
25071
|
+
},
|
|
25072
|
+
body: [
|
|
25073
|
+
heading("Page not found", {
|
|
25074
|
+
id: "not-found-title",
|
|
25075
|
+
subType: "h1"
|
|
25076
|
+
}),
|
|
25077
|
+
paragraph({
|
|
25078
|
+
id: "not-found-lede",
|
|
25079
|
+
content: "There is nothing at this address."
|
|
25080
|
+
}),
|
|
25081
|
+
link({
|
|
25082
|
+
id: "not-found-home",
|
|
25083
|
+
href: "/",
|
|
25084
|
+
content: "Back to the home page"
|
|
25085
|
+
})
|
|
25086
|
+
]
|
|
25087
|
+
};
|
|
24917
25088
|
//#endregion
|
|
24918
25089
|
//#region src/spaces/empty/spec.ts
|
|
24919
25090
|
/**
|
|
@@ -24995,11 +25166,11 @@ var space = {
|
|
|
24995
25166
|
content: "What this site is about, in a line.",
|
|
24996
25167
|
class: lede
|
|
24997
25168
|
})]
|
|
24998
|
-
}]
|
|
25169
|
+
}, notFound]
|
|
24999
25170
|
};
|
|
25000
25171
|
//#endregion
|
|
25001
25172
|
//#region src/spaces/empty/spec.ts?raw
|
|
25002
|
-
var spec_default = "import { container, heading, paragraph } from '../../elements';\nimport { styles } from '../../style';\n\nimport type { SpaceSpec } from '../../schema';\n\n/**\n * The space, declared — and nothing in it yet but what every space starts from: tokens for both themes, a layout the\n * pages render in, and one page.\n *\n * Add a page to `pages`, chrome every page shares (a header, a footer) to the layout around `site-main`, and a look\n * used twice as a class beside the ones below. Name anything a test, a binding or an agent should point at.\n */\n\n/** The page around every page: the background, the type, and the column the pages render in. */\nconst shell = styles('shell', {\n display: 'flex',\n 'flex-direction': 'column',\n 'min-height': '100vh',\n 'background-color': 'var(--background)',\n color: 'var(--foreground)',\n 'font-family': 'system-ui, sans-serif'\n});\n\nconst main = styles('main', { width: '100%', 'max-width': '1120px', margin: '0px auto', padding: '48px 24px' });\n\n/** The line under a page's title: the palette's quiet colour. */\nconst lede = styles('lede', { color: 'var(--muted)', margin: '8px 0px 0px' });\n\nexport const space: SpaceSpec = {\n name: 'Empty space',\n permanentUrl: 'empty-space',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n // Every colour, per scheme: elements say `var(--name)`, so the palette changes here and nowhere else. Add one when a\n // look needs it — a colour declared and read by nothing is one authoring points out (`unused-token`).\n variables: {\n color: {\n background: { light: '#fbfbfd', dark: '#09090b', default: '#fbfbfd' },\n foreground: { light: '#17171c', dark: '#fafafa', default: '#17171c' },\n muted: { light: '#5f5f6e', dark: '#a1a1aa', default: '#5f5f6e' }\n }\n },\n layouts: [\n {\n id: 'site',\n body: [\n container({\n id: 'site-shell',\n class: shell,\n children: [container({ id: 'site-main', subType: 'main', class: main })]\n })\n ]\n }\n ],\n pages: [\n {\n id: 'home',\n name: 'Home',\n slug: '',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n heading('Home', { id: 'home-title', subType: 'h1' }),\n paragraph({ id: 'home-lede', content: 'What this site is about, in a line.', class: lede })\n ]\n }\n ]\n};\n";
|
|
25173
|
+
var spec_default = "import { notFound } from './notFound.ts';\nimport { container, heading, paragraph } from '../../elements';\nimport { styles } from '../../style';\n\nimport type { SpaceSpec } from '../../schema';\n\n/**\n * The space, declared — and nothing in it yet but what every space starts from: tokens for both themes, a layout the\n * pages render in, and one page.\n *\n * Add a page to `pages`, chrome every page shares (a header, a footer) to the layout around `site-main`, and a look\n * used twice as a class beside the ones below. Name anything a test, a binding or an agent should point at.\n */\n\n/** The page around every page: the background, the type, and the column the pages render in. */\nconst shell = styles('shell', {\n display: 'flex',\n 'flex-direction': 'column',\n 'min-height': '100vh',\n 'background-color': 'var(--background)',\n color: 'var(--foreground)',\n 'font-family': 'system-ui, sans-serif'\n});\n\nconst main = styles('main', { width: '100%', 'max-width': '1120px', margin: '0px auto', padding: '48px 24px' });\n\n/** The line under a page's title: the palette's quiet colour. */\nconst lede = styles('lede', { color: 'var(--muted)', margin: '8px 0px 0px' });\n\nexport const space: SpaceSpec = {\n name: 'Empty space',\n permanentUrl: 'empty-space',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n // Every colour, per scheme: elements say `var(--name)`, so the palette changes here and nowhere else. Add one when a\n // look needs it — a colour declared and read by nothing is one authoring points out (`unused-token`).\n variables: {\n color: {\n background: { light: '#fbfbfd', dark: '#09090b', default: '#fbfbfd' },\n foreground: { light: '#17171c', dark: '#fafafa', default: '#17171c' },\n muted: { light: '#5f5f6e', dark: '#a1a1aa', default: '#5f5f6e' }\n }\n },\n layouts: [\n {\n id: 'site',\n body: [\n container({\n id: 'site-shell',\n class: shell,\n children: [container({ id: 'site-main', subType: 'main', class: main })]\n })\n ]\n }\n ],\n pages: [\n {\n id: 'home',\n name: 'Home',\n slug: '',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n heading('Home', { id: 'home-title', subType: 'h1' }),\n paragraph({ id: 'home-lede', content: 'What this site is about, in a line.', class: lede })\n ]\n },\n notFound\n ]\n};\n";
|
|
25003
25174
|
//#endregion
|
|
25004
25175
|
//#region templates/catalog/src/data/products.json?raw
|
|
25005
25176
|
var products_default = "{\n \"products\": [\n {\n \"slug\": \"desk-lamp\",\n \"title\": \"Desk lamp\",\n \"category\": \"lighting\",\n \"price\": 49,\n \"summary\": \"A warm, dimmable light for long evenings at the desk.\"\n },\n {\n \"slug\": \"floor-lamp\",\n \"title\": \"Floor lamp\",\n \"category\": \"lighting\",\n \"price\": 129,\n \"summary\": \"Tall, slim and bright enough for a whole corner.\"\n },\n {\n \"slug\": \"notebook\",\n \"title\": \"Dotted notebook\",\n \"category\": \"paper\",\n \"price\": 12,\n \"summary\": \"A5, 160 pages, lies flat when open.\",\n \"badge\": \"New\"\n },\n {\n \"slug\": \"planner\",\n \"title\": \"Weekly planner\",\n \"category\": \"paper\",\n \"price\": 18,\n \"summary\": \"A week on two pages, undated so it starts when you do.\"\n },\n {\n \"slug\": \"pen-set\",\n \"title\": \"Fineliner set\",\n \"category\": \"writing\",\n \"price\": 15,\n \"summary\": \"Six colours, 0.4 mm, quick to dry.\"\n },\n {\n \"slug\": \"fountain-pen\",\n \"title\": \"Fountain pen\",\n \"category\": \"writing\",\n \"price\": 64,\n \"summary\": \"A steel nib and a converter for any ink.\",\n \"badge\": \"Popular\"\n },\n {\n \"slug\": \"desk-mat\",\n \"title\": \"Felt desk mat\",\n \"category\": \"desk\",\n \"price\": 39,\n \"summary\": \"Wool felt, 90 × 40 cm, quiet under a keyboard.\"\n },\n {\n \"slug\": \"monitor-stand\",\n \"title\": \"Monitor stand\",\n \"category\": \"desk\",\n \"price\": 79,\n \"summary\": \"Oak, with room underneath for a keyboard.\"\n }\n ]\n}\n";
|
|
@@ -25011,7 +25182,7 @@ var productCard_default = "/**\n * A product as a card, placed once per product:
|
|
|
25011
25182
|
var data_default = "/**\n * The data the pages read: one JSON file of the project's own (`src/data/products.json`). Its contents type every\n * path a page writes — `products.data.products` — so a misspelt field is a type error, not an empty card. Swapping the\n * file for a real endpoint later changes `PRODUCTS`, and nothing else.\n */\nimport { source } from '@plitzi/sdk-authoring';\n\nimport sample from '../data/products.json' with { type: 'json' };\n\n/**\n * How a page asks for the products: on the server, which reads `src/data/` and never serves it — the page arrives\n * with them in it.\n */\nexport const PRODUCTS = { query: '/data/products.json', runtime: 'server' } as const;\n\n/** The categories the catalog filters by, in the order its select offers them. */\nexport const CATEGORIES = [\n { value: 'lighting', label: 'Lighting' },\n { value: 'paper', label: 'Paper' },\n { value: 'writing', label: 'Writing' },\n { value: 'desk', label: 'Desk' }\n] as const;\n\n/** The products file as the source of the provider named `id` — one per page, as ids are one namespace. */\nexport const productsSource = (id: string) => source(id, sample);\n";
|
|
25012
25183
|
//#endregion
|
|
25013
25184
|
//#region templates/catalog/src/space/index.ts?raw
|
|
25014
|
-
var space_default = "/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */\n/**\n * The space, assembled: a file per part, so each stays short enough to read whole — the tokens, the layout every page\n * shares, the product card, and one file per page. Add a page under `pages/` and list it here.\n *\n * The products are `src/data/products.json`, the project's own: a provider on each page reads it on the server.\n */\nimport { productCard } from './components/productCard.ts';\nimport { layout } from './layout.ts';\nimport { catalog } from './pages/catalog.ts';\nimport { home } from './pages/home.ts';\nimport { product } from './pages/product.ts';\nimport { variables } from './tokens.ts';\n\nimport type { SpaceSpec } from '@plitzi/sdk-authoring';\n\nexport const space: SpaceSpec = {\n name: 'Catalog',\n permanentUrl: 'catalog',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n variables,\n // How a price is shown, said once: `text({ from: …, as: 'price' })` anywhere.\n formats: { price: \"{{ source|currency('USD', 'en', { trimZeros: true }) }}\" },\n layouts: [layout],\n components: [productCard],\n pages: [home, catalog, product]\n};\n";
|
|
25185
|
+
var space_default = "/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */\n/**\n * The space, assembled: a file per part, so each stays short enough to read whole — the tokens, the layout every page\n * shares, the product card, and one file per page. Add a page under `pages/` and list it here.\n *\n * The products are `src/data/products.json`, the project's own: a provider on each page reads it on the server.\n */\nimport { productCard } from './components/productCard.ts';\nimport { layout } from './layout.ts';\nimport { catalog } from './pages/catalog.ts';\nimport { home } from './pages/home.ts';\nimport { notFound } from './pages/notFound.ts';\nimport { product } from './pages/product.ts';\nimport { variables } from './tokens.ts';\n\nimport type { SpaceSpec } from '@plitzi/sdk-authoring';\n\nexport const space: SpaceSpec = {\n name: 'Catalog',\n permanentUrl: 'catalog',\n theme: { default: 'system', schemes: ['light', 'dark'] },\n variables,\n // How a price is shown, said once: `text({ from: …, as: 'price' })` anywhere.\n formats: { price: \"{{ source|currency('USD', 'en', { trimZeros: true }) }}\" },\n layouts: [layout],\n components: [productCard],\n pages: [home, catalog, product, notFound]\n};\n";
|
|
25015
25186
|
//#endregion
|
|
25016
25187
|
//#region templates/catalog/src/space/layout.ts?raw
|
|
25017
25188
|
var layout_default = "/**\n * The chrome every page shares — a header with the menu, and a footer — written once. Pages name the layout and the\n * slot their body goes in (`site-main`); the current menu entry marks itself, not each page.\n */\nimport { container, link, styles, text } from '@plitzi/sdk-authoring';\n\nimport { t } from './tokens.ts';\n\nimport type { LayoutSpec } from '@plitzi/sdk-authoring';\n\nconst shell = styles('shell', {\n display: 'flex',\n flexDirection: 'column',\n minHeight: '100vh',\n backgroundColor: t.background,\n color: t.foreground,\n fontFamily: 'system-ui, sans-serif'\n});\n\nconst header = styles('site-header', {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n padding: '16px 24px',\n borderBottom: `1px solid ${t.border}`\n});\n\nconst brand = styles('brand', { fontWeight: 700, color: t.foreground, textDecoration: 'none' });\n\nconst nav = styles('nav', { display: 'flex', gap: 20 });\n\nconst navLink = styles('nav-link', {\n css: { color: t.muted, textDecoration: 'none' },\n states: { current: { color: t.foreground, fontWeight: 600 } }\n});\n\nconst main = styles('main', {\n flexGrow: 1,\n width: '100%',\n maxWidth: '1120px',\n margin: '0px auto',\n padding: '40px 24px'\n});\n\nconst footer = styles('site-footer', { padding: '24px', color: t.muted, fontSize: '14px', textAlign: 'center' });\n\n/** The menu: one entry per section — Products stays current on every product, which is under its path. */\nconst MENU = [\n { href: '/', label: 'Home', current: 'page' },\n { href: '/products', label: 'Products', current: 'section' }\n] as const;\n\nexport const layout: LayoutSpec = {\n id: 'site',\n body: [\n container({\n id: 'site-shell',\n class: shell,\n children: [\n container({\n id: 'site-header',\n subType: 'header',\n class: header,\n children: [\n link({ id: 'site-brand', href: '/', class: brand, content: 'Desk & Co.' }),\n container({\n id: 'site-nav',\n subType: 'nav',\n class: nav,\n children: MENU.map(entry =>\n link({\n href: entry.href,\n class: navLink,\n current: entry.current,\n content: entry.label\n })\n )\n })\n ]\n }),\n container({ id: 'site-main', subType: 'main', class: main }),\n container({\n id: 'site-footer',\n subType: 'footer',\n class: footer,\n children: [text('Demo content: the products and their prices are made up.')]\n })\n ]\n })\n ]\n};\n";
|
|
@@ -25020,7 +25191,10 @@ var layout_default = "/**\n * The chrome every page shares — a header with the
|
|
|
25020
25191
|
var catalog_default = "/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */\n/**\n * Every product, filtered by category: the select writes the choice to `state`, and the list shows only the rows\n * that match — with a count and an empty state read off the same predicate.\n */\nimport {\n apiContainer,\n container,\n formControl,\n heading,\n list,\n named,\n on,\n setState,\n styles,\n text\n} from '@plitzi/sdk-authoring';\n\nimport { CATEGORIES, PRODUCTS, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\n/** The product grid, shared with the home page: a list is a `<ul>`, so the bullets and the indent go. */\nexport const grid = styles('product-grid', {\n desktop: {\n display: 'grid',\n gridTemplateColumns: 'repeat(3, minmax(0, 1fr))',\n gap: 20,\n margin: '0px',\n padding: '0px',\n listStyleType: 'none'\n },\n tablet: { gridTemplateColumns: 'repeat(2, minmax(0, 1fr))' },\n mobile: { gridTemplateColumns: 'minmax(0, 1fr)' }\n});\n\nconst toolbar = styles('catalog-toolbar', {\n display: 'flex',\n alignItems: 'end',\n justifyContent: 'space-between',\n gap: 16,\n marginBottom: '24px'\n});\n\nconst muted = styles('muted', { color: t.muted });\n\n// One predicate, read three times: the rows, their count, and whether there are none.\nconst shown = \"source|filter(p => (state.category ?? 'all') == 'all' or p.category == state.category)\";\n\nconst products = productsSource('catalog-products');\n\nexport const catalog: PageSpec = {\n id: 'catalog',\n name: 'Products',\n slug: 'products',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n heading('Products', { id: 'catalog-title', subType: 'h1' }),\n apiContainer({\n id: products.id,\n ...PRODUCTS,\n cache: true,\n children: [\n container({\n id: 'catalog-toolbar',\n class: toolbar,\n children: [\n // A control outside a form keeps its own value and fires `onChange` with `{ value, name }`.\n formControl({\n id: 'catalog-category',\n name: 'category',\n label: 'Category',\n subType: 'select',\n options: [\n { label: 'Everything', value: 'all' },\n ...CATEGORIES.map(({ value, label }) => ({ value, label }))\n ],\n defaultValue: 'all',\n // A filter always has an answer: the select is not a question that must be filled in.\n required: false,\n flows: [\n [\n named('picked', on('onChange')),\n setState({ key: 'category', type: 'text', value: '{{ picked.value }}' })\n ]\n ]\n }),\n text({ id: 'catalog-count', class: muted, from: products.data.products, as: `{{ ${shown}|length }} shown` })\n ]\n }),\n list({\n id: 'catalog-list',\n class: grid,\n from: products.data.products,\n as: `{{ ${shown} }}`,\n row: 'product-card'\n }),\n text('Nothing in that category yet.', {\n id: 'catalog-empty',\n class: muted,\n visible: { source: products.data.products, template: `{{ source is defined and ${shown}|length == 0 }}` }\n })\n ]\n })\n ]\n};\n";
|
|
25021
25192
|
//#endregion
|
|
25022
25193
|
//#region templates/catalog/src/space/pages/home.ts?raw
|
|
25023
|
-
var home_default = "/** The home page: what the shop is, and the first products of the file as a way in. */\nimport { apiContainer, container, heading, link, list, styles, text } from '@plitzi/sdk-authoring';\n\nimport { grid } from './catalog.ts';\nimport { PRODUCTS, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\
|
|
25194
|
+
var home_default = "/** The home page: what the shop is, and the first products of the file as a way in. */\nimport { apiContainer, container, heading, link, list, styles, text } from '@plitzi/sdk-authoring';\n\nimport { grid } from './catalog.ts';\nimport { PRODUCTS, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\nexport const hero = styles('hero', { display: 'flex', flexDirection: 'column', gap: 16, padding: '48px 0px' });\n\nexport const lede = styles('lede', { margin: '0px', maxWidth: '560px', color: t.muted, fontSize: '18px' });\n\nexport const cta = styles('cta', {\n css: {\n alignSelf: 'flex-start',\n padding: '10px 18px',\n borderRadius: '10px',\n backgroundColor: t.primary,\n color: t['on-primary'],\n fontWeight: 600,\n textDecoration: 'none'\n },\n states: { hover: { opacity: 0.9 } }\n});\n\nconst featured = productsSource('home-products');\n\nexport const home: PageSpec = {\n id: 'home',\n name: 'Home',\n slug: '',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n container({\n id: 'home-hero',\n subType: 'section',\n class: hero,\n children: [\n heading('Good things for a good desk', { id: 'home-title', subType: 'h1', css: { margin: '0px' } }),\n text('Lamps, paper and pens we would use ourselves.', { id: 'home-lede', class: lede }),\n link({ id: 'home-cta', href: '/products', class: cta, content: 'See every product' })\n ]\n }),\n apiContainer({\n id: featured.id,\n ...PRODUCTS,\n cache: true,\n children: [\n heading('Featured', { id: 'home-featured-title', subType: 'h2' }),\n list({\n id: 'home-featured',\n class: grid,\n from: featured.data.products,\n as: '{{ source|slice(0, 3) }}',\n row: 'product-card'\n })\n ]\n })\n ]\n};\n";
|
|
25195
|
+
//#endregion
|
|
25196
|
+
//#region templates/catalog/src/space/pages/notFound.ts?raw
|
|
25197
|
+
var notFound_default = "/** The page of every address no other page answers — a mistyped link, a product taken down — sent with status 404. */\nimport { container, heading, link, text } from '@plitzi/sdk-authoring';\n\nimport { cta, hero, lede } from './home.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\nexport const notFound: PageSpec = {\n id: 'not-found',\n name: 'Not found',\n slug: '*',\n seoTitle: 'Page not found',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n container({\n id: 'not-found-hero',\n subType: 'section',\n class: hero,\n children: [\n heading('Nothing on this shelf', { id: 'not-found-title', subType: 'h1', css: { margin: '0px' } }),\n text('The page you asked for is not here — it may have moved, or the link has a typo.', {\n id: 'not-found-lede',\n class: lede\n }),\n link({ id: 'not-found-cta', href: '/products', class: cta, content: 'See every product' })\n ]\n })\n ]\n};\n";
|
|
25024
25198
|
//#endregion
|
|
25025
25199
|
//#region templates/catalog/src/space/pages/product.ts?raw
|
|
25026
25200
|
var product_default = "/* eslint-disable quotes -- templates quote their own strings, and read best in the other quotes */\n/**\n * A page per product, at `/products/<slug>`: the same file, narrowed to the product the address names — and a message,\n * not an empty page, when no product has that name.\n */\nimport { apiContainer, container, heading, link, list, listItem, styles, text } from '@plitzi/sdk-authoring';\n\nimport { PRODUCTS, productsSource } from '../data.ts';\nimport { t } from '../tokens.ts';\n\nimport type { PageSpec } from '@plitzi/sdk-authoring';\n\nconst detail = styles('product-detail', { display: 'flex', flexDirection: 'column', gap: 12, maxWidth: '640px' });\n\nconst back = styles('back-link', { color: t.muted, textDecoration: 'none' });\n\nconst products = productsSource('product-data');\n\nexport const product: PageSpec = {\n id: 'product',\n name: 'Product',\n slug: 'products/:slug',\n layout: { id: 'site', slot: 'site-main' },\n body: [\n link({ id: 'product-back', href: '/products', class: back, content: '← All products' }),\n apiContainer({\n id: products.id,\n ...PRODUCTS,\n cache: true,\n children: [\n list({\n id: 'product-one',\n // A list is a `<ul>`: one product reads as a page, not as an indented item.\n css: { margin: '0px', padding: '0px', listStyleType: 'none' },\n from: products.data.products,\n as: '{{ source|filter(p => p.slug == navigation.routeParams.slug) }}',\n // Shown once the file answers with the product; the message below is the other side of the question.\n visible: {\n source: products.data.products,\n template: \"{{ source|find('slug', navigation.routeParams.slug) }}\"\n },\n row: r =>\n listItem({\n id: 'product-item',\n children: [\n container({\n id: 'product-detail',\n subType: 'article',\n class: detail,\n children: [\n heading({ id: 'product-title', subType: 'h1', from: `${r.item}.title` }),\n text({ id: 'product-summary', from: `${r.item}.summary` }),\n text({\n id: 'product-price',\n from: `${r.item}.price`,\n as: 'price',\n css: { fontSize: '24px', fontWeight: 700 }\n })\n ]\n })\n ]\n })\n }),\n text('No product by that name.', {\n id: 'product-missing',\n visible: {\n source: products.data.products,\n template: \"{{ source is defined and not (source|find('slug', navigation.routeParams.slug)) }}\"\n }\n })\n ]\n })\n ]\n};\n";
|
|
@@ -25070,16 +25244,21 @@ var blankTemplateFiles = ({ name, dir = "src/space", plugin } = {}) => {
|
|
|
25070
25244
|
[`${dir}/index.ts`]: name === void 0 ? entry : renameSpace(entry, name),
|
|
25071
25245
|
[`${dir}/tokens.ts`]: toPortableSource(tokens_default$1),
|
|
25072
25246
|
[`${dir}/theme.ts`]: toPortableSource(theme_default),
|
|
25073
|
-
[`${dir}/content.ts`]: toPortableSource(content_default)
|
|
25247
|
+
[`${dir}/content.ts`]: toPortableSource(content_default),
|
|
25248
|
+
[`${dir}/notFound.ts`]: toPortableSource(notFound_default$2)
|
|
25074
25249
|
};
|
|
25075
25250
|
};
|
|
25076
25251
|
/**
|
|
25077
|
-
* The space `plitzi create --template blank` starts from, as
|
|
25078
|
-
* project about to be something specific, where the welcome tour is the first thing that would be deleted
|
|
25252
|
+
* The space `plitzi create --template blank` starts from, as its files by path: tokens, a layout and one empty page —
|
|
25253
|
+
* for a project about to be something specific, where the welcome tour is the first thing that would be deleted —
|
|
25254
|
+
* and the page for an address nothing answers, beside it.
|
|
25079
25255
|
*/
|
|
25080
|
-
var
|
|
25256
|
+
var emptyTemplateFiles = ({ name, dir = "src/space" } = {}) => {
|
|
25081
25257
|
const portable = toPortableSource(spec_default);
|
|
25082
|
-
return
|
|
25258
|
+
return {
|
|
25259
|
+
[`${dir}/index.ts`]: name === void 0 ? portable : renameSpace(portable, name, space),
|
|
25260
|
+
[`${dir}/notFound.ts`]: toPortableSource(notFound_default$1)
|
|
25261
|
+
};
|
|
25083
25262
|
};
|
|
25084
25263
|
/** The one line in the declaration a `custom` element is hung off — the hero, so it lands under its buttons. */
|
|
25085
25264
|
var PLUGIN_ANCHOR = "children: [heroEyebrow, heroTitle, heroLede, heroActions]";
|
|
@@ -25292,6 +25471,7 @@ var catalogTemplateFiles = ({ name, mode = "server" } = {}) => {
|
|
|
25292
25471
|
"src/space/pages/home.ts": home_default,
|
|
25293
25472
|
"src/space/pages/catalog.ts": catalog_default,
|
|
25294
25473
|
"src/space/pages/product.ts": product_default,
|
|
25474
|
+
"src/space/pages/notFound.ts": notFound_default,
|
|
25295
25475
|
[client ? "public/data/products.json" : "src/data/products.json"]: products_default
|
|
25296
25476
|
};
|
|
25297
25477
|
return Object.fromEntries(Object.entries(files).map(([path, source]) => [path, source.replace(/^\/\* eslint-disable quotes[^\n]*\*\/\n/, "")]));
|
|
@@ -25626,6 +25806,7 @@ function probePage(input) {
|
|
|
25626
25806
|
* scroll an inner pane and the document would then report no overflow whatever the page contained.
|
|
25627
25807
|
*/
|
|
25628
25808
|
let overflow = null;
|
|
25809
|
+
const cutOff = [];
|
|
25629
25810
|
if (input.overflow) {
|
|
25630
25811
|
const viewport = document.documentElement.clientWidth;
|
|
25631
25812
|
/**
|
|
@@ -25645,6 +25826,48 @@ function probePage(input) {
|
|
|
25645
25826
|
for (let ancestor = node.parentElement; ancestor; ancestor = ancestor.parentElement) if (keepsOverflow(ancestor)) right = Math.min(right, ancestor.getBoundingClientRect().right);
|
|
25646
25827
|
return right;
|
|
25647
25828
|
};
|
|
25829
|
+
const visibleLeft = (node) => {
|
|
25830
|
+
let left = node.getBoundingClientRect().left;
|
|
25831
|
+
for (let ancestor = node.parentElement; ancestor; ancestor = ancestor.parentElement) if (keepsOverflow(ancestor)) left = Math.max(left, ancestor.getBoundingClientRect().left);
|
|
25832
|
+
return left;
|
|
25833
|
+
};
|
|
25834
|
+
/**
|
|
25835
|
+
* What is CUT at the screen's edge rather than scrolled to: a link, a control or words of the space's whose box runs
|
|
25836
|
+
* past the viewport while an ancestor hides the part that spills — a header whose last links fell off a phone, with
|
|
25837
|
+
* no sideways scroll to show for it, which read as a page with nothing wrong. Not inside a row a person scrolls on
|
|
25838
|
+
* purpose, nor anything a transform moves (a marquee, a carousel's track), nor what is not drawn.
|
|
25839
|
+
*/
|
|
25840
|
+
const scrolledOnPurpose = (node) => {
|
|
25841
|
+
for (let ancestor = node.parentElement; ancestor; ancestor = ancestor.parentElement) {
|
|
25842
|
+
const { overflowX } = getComputedStyle(ancestor);
|
|
25843
|
+
const pageScroller = ancestor === document.documentElement || ancestor === document.body || ancestor.matches(".plitzi-sdk");
|
|
25844
|
+
if ((overflowX === "auto" || overflowX === "scroll") && !pageScroller) return true;
|
|
25845
|
+
}
|
|
25846
|
+
return false;
|
|
25847
|
+
};
|
|
25848
|
+
const moved = (node) => {
|
|
25849
|
+
for (let at = node; at; at = at.parentElement) {
|
|
25850
|
+
const { transform } = getComputedStyle(at);
|
|
25851
|
+
if (transform !== "none" && transform !== "") return true;
|
|
25852
|
+
}
|
|
25853
|
+
return false;
|
|
25854
|
+
};
|
|
25855
|
+
const saysSomething = (node) => node.matches("a, button, input, select, textarea, label") || [...node.childNodes].some((child) => child.nodeType === Node.TEXT_NODE && (child.textContent ?? "").trim() !== "");
|
|
25856
|
+
for (const node of document.querySelectorAll("[data-plitzi-el]")) {
|
|
25857
|
+
const box = node.getBoundingClientRect();
|
|
25858
|
+
if (box.width === 0 || box.height === 0 || !saysSomething(node)) continue;
|
|
25859
|
+
const outside = Math.max(box.right - viewport, -box.left);
|
|
25860
|
+
const hiddenPart = Math.max(box.right - visibleRight(node), visibleLeft(node) - box.left);
|
|
25861
|
+
if (outside <= 1 || hiddenPart <= 1 || !node.checkVisibility({
|
|
25862
|
+
opacityProperty: true,
|
|
25863
|
+
visibilityProperty: true
|
|
25864
|
+
}) || scrolledOnPurpose(node) || moved(node)) continue;
|
|
25865
|
+
const id = node.getAttribute("data-plitzi-el");
|
|
25866
|
+
if (id) cutOff.push({
|
|
25867
|
+
id,
|
|
25868
|
+
pixels: Math.round(Math.min(outside, hiddenPart))
|
|
25869
|
+
});
|
|
25870
|
+
}
|
|
25648
25871
|
const wide = [...document.querySelectorAll("body *")].map((node) => ({
|
|
25649
25872
|
node,
|
|
25650
25873
|
right: visibleRight(node)
|
|
@@ -25732,6 +25955,7 @@ function probePage(input) {
|
|
|
25732
25955
|
byWidth,
|
|
25733
25956
|
brokenImages,
|
|
25734
25957
|
overflow,
|
|
25958
|
+
cutOff,
|
|
25735
25959
|
illegible
|
|
25736
25960
|
};
|
|
25737
25961
|
}
|
|
@@ -25772,6 +25996,11 @@ var issuesOf = (expected, findings) => {
|
|
|
25772
25996
|
...about(elementId)
|
|
25773
25997
|
})),
|
|
25774
25998
|
...sidewaysOf(findings.overflow),
|
|
25999
|
+
...findings.cutOff.map(({ id, pixels }) => ({
|
|
26000
|
+
code: "cut-off",
|
|
26001
|
+
message: `${named(id)} is cut off at the edge of the screen by ${String(pixels)}px — an ancestor hides what spills past it, so nothing scrolls to it: let the row wrap, or give it room`,
|
|
26002
|
+
elementId: id
|
|
26003
|
+
})),
|
|
25775
26004
|
...findings.illegible.map(({ text, elementId }) => ({
|
|
25776
26005
|
code: "illegible-text",
|
|
25777
26006
|
message: `text drawn in the colour behind it: ${text}`,
|
|
@@ -26617,10 +26846,17 @@ var ELEMENT_CATALOGS = {
|
|
|
26617
26846
|
* **Bindings.** A source may name the element alone and the prefix it publishes under is filled in — which
|
|
26618
26847
|
* is the half an author cannot see, and is not always the element's own type.
|
|
26619
26848
|
*/
|
|
26620
|
-
var authorSpace = (spec, options = {}) =>
|
|
26621
|
-
|
|
26622
|
-
|
|
26623
|
-
|
|
26849
|
+
var authorSpace = (spec, options = {}) => {
|
|
26850
|
+
const notFound = withNotFoundPage(spec);
|
|
26851
|
+
const authored = authorSpace$1(notFound.spec, withPluginCatalogs({
|
|
26852
|
+
...ELEMENT_CATALOGS,
|
|
26853
|
+
...options
|
|
26854
|
+
}));
|
|
26855
|
+
return notFound.added ? {
|
|
26856
|
+
...authored,
|
|
26857
|
+
suggestions: [...authored.suggestions, notFound.added]
|
|
26858
|
+
} : authored;
|
|
26859
|
+
};
|
|
26624
26860
|
/**
|
|
26625
26861
|
* `validateSpace`, holding this SDK's own catalogs — the same gate `authorSpace` puts its output through, for documents
|
|
26626
26862
|
* written anywhere else: the builder saving through the API, an import, an agent's edit, a JSON edited by hand.
|
|
@@ -26684,4 +26920,4 @@ var validateSnippet = (snippet, options = {}) => validateSnippet$1(snippet, {
|
|
|
26684
26920
|
...options
|
|
26685
26921
|
});
|
|
26686
26922
|
//#endregion
|
|
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$
|
|
26923
|
+
export { GLOBAL_CALLBACK_BUILDERS as $, AUTHORING_CODES as $i, setState as $n, container as $r, isCssProperty as $t, unrollPage as A, defaultLabel as Ai, whenFailed as An, onScroll as Ar, className as At, blankSpace as B, groupBindings as Bi, authLogout as Bn, setFieldValue as Br, css as Bt, pageTexts as C, c$19 as Ca, tabContainerHeader as Ci, authoringCodesTable as Cn, onFlowError as Cr, unusedDeclarations as Ct, pageRegions as D, t$62 as Da, video as Di, flowStepIds as Dn, onLoad as Dr, column as Dt, diffPictures as E, s$23 as Ea, themeToggle as Ei, authorFlows as En, onKey as Er, tw as Et, readDevTools as F, GLOBAL_SOURCES as Fi, getUtility as Fn, reloadApi as Fr, modifierClassName as Ft, space as G, variantFrom as Gi, cycleState as Gn, e$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$21 as Sa, tabContainerBody as Si, flagSpecOf as Sn, onFlowEnd as Sr, suggestClassOverrides as St, comparePictures as T, r$35 as Ta, text$1 as Ti, authorFlow as Tn, onInterval as Tr, createTw as Tt, emptyTemplateFiles as U, resolveSource as Ui, clearState as Un, elementsFromManifest as Ur, toBlocks as Ut, blankTemplateFiles as V, hasVisibilityBinding as Vi, authRefreshDetails as Vn, toggleElement as Vr, isRuleSetSpec as Vt, toPortableSource as W, toBindingSpecs as Wi, copyToClipboard as Wn, withPluginCatalogs as Wr, toResponsive as Wt, importProbe as X, twig as Xi, navigate as Xn, carousel as Xr, cssNumberValue as Xt, importedFiles as Y, source as Yi, moveState as Yn, button$1 as Yr, shorthandLonghands as Yt, BUILDER_NAMES as Z, closest as Zi, removeState as Zn, carouselTrack as Zr, cssProperties as Zt, shortcutKey as _, t$60 as _a, paragraph as _i, instanceSelectorFor as _n, closeModal as _r, assertSnippetValid as _t, locateClasses as a, elementCallbacks as aa, fontAwesome as ai, notificationsCss as an, BUILTIN_GLOBAL_CALLBACKS as ar, SPACE_FIELDS as at, summariseRenders as b, i$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 };
|