@palmyit/elements 0.1.8 → 0.1.20
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/README.md +1 -13
- package/dist/definitions.d.ts +15 -9
- package/dist/definitions.js +1756 -949
- package/dist/elements/article/definition.d.ts +43 -0
- package/dist/elements/article/template.d.ts +12 -0
- package/dist/elements/button/definition.d.ts +1 -0
- package/dist/elements/footer/definition.d.ts +35 -0
- package/dist/elements/footer/template.d.ts +2 -0
- package/dist/elements/heading/definition.d.ts +29 -0
- package/dist/elements/heading/template.d.ts +2 -0
- package/dist/elements/icon/definition.d.ts +11 -0
- package/dist/elements/image/definition.d.ts +47 -0
- package/dist/elements/image/template.d.ts +30 -0
- package/dist/elements/list/definition.d.ts +2 -0
- package/dist/elements/nav/definition.d.ts +39 -0
- package/dist/elements/nav/template.d.ts +17 -0
- package/dist/elements/page/definition.d.ts +41 -1
- package/dist/elements/table/definition.d.ts +2 -0
- package/dist/elements/text/definition.d.ts +2 -1
- package/dist/elements/video/definition.d.ts +39 -0
- package/dist/elements/video/template.d.ts +6 -0
- package/dist/elements/video/youtube.d.ts +4 -0
- package/dist/manifest.json +2 -2
- package/dist/plmt-elements.css +1 -1
- package/dist/render/renderHtml.d.ts +1 -1
- package/dist/render/styleToClasses.d.ts +8 -9
- package/dist/render/styleToVars.d.ts +2 -0
- package/dist/render/styleTokens.d.ts +11 -1
- package/dist/render/tags.d.ts +9 -1
- package/dist/render/types.d.ts +4 -0
- package/dist/schema/Fields/ColorField/colorText.d.ts +3 -0
- package/dist/schema/Fields/IconPicker/iconCatalog.d.ts +5 -1
- package/dist/schema/addressSchema.d.ts +2 -0
- package/dist/schema/device/devices.d.ts +8 -0
- package/dist/schema/deviceSettings.d.ts +1 -1
- package/dist/schema/elementCategories.d.ts +29 -0
- package/dist/schema/elementConfiguration.d.ts +1 -1
- package/dist/schema/elementRegistry.d.ts +25 -1
- package/dist/schema/elementStyleDefinitions.d.ts +6 -14
- package/dist/schema/elementTemplates.d.ts +3 -2
- package/dist/schema/linkSettings.d.ts +19 -2
- package/dist/schema/style/elementStyle.d.ts +1 -1
- package/dist/schema/styleItems.d.ts +18 -0
- package/dist/schema/styleTokensSchema.d.ts +34 -18
- package/dist/tags.json +5 -1
- package/dist/templates/brands/brandSpec.d.ts +5 -0
- package/dist/templates/elementSpec.d.ts +1 -1
- package/dist/templates/head.d.ts +43 -0
- package/dist/templates/heroicons/heroiconSpec.d.ts +6 -0
- package/dist/templates.d.ts +3 -0
- package/dist/templates.js +1351 -237
- package/dist/youtube-BDsE1Bz3.js +910 -0
- package/package.json +3 -3
- package/dist/styleToClasses-CZSWp6Ez.js +0 -683
package/dist/definitions.js
CHANGED
|
@@ -1,83 +1,464 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { z as
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, G as o, H as s, I as c, J as l, K as u, L as d, M as f, N as p, O as m, P as h, R as g, S as ee, T as te, U as ne, V as _, W as re, b as ie, g as ae, i as oe, k as se, n as ce, q as v, r as le, t as ue, v as de, w as fe, x as pe, y as me, z as he } from "./youtube-BDsE1Bz3.js";
|
|
2
|
+
import { z as y } from "zod";
|
|
3
3
|
// src/schema/elementConfiguration.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
4
|
+
var b = y.string().trim().min(1);
|
|
5
|
+
function x(e) {
|
|
6
6
|
return e;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
// src/schema/deviceVisibility.ts
|
|
9
|
+
var S = {
|
|
10
|
+
Desktop: "showOnDesktop",
|
|
11
|
+
Tablet: "showOnTablet",
|
|
12
|
+
Mobile: "showOnMobile"
|
|
13
|
+
}, ge = {
|
|
14
|
+
Tablet: "showOnTabletLandscape",
|
|
15
|
+
Mobile: "showOnMobileLandscape"
|
|
16
|
+
}, _e = [...Object.values(S), ...Object.values(ge)], ve = s.flatMap(({ name: e, landscape: t }) => t ? [{
|
|
17
|
+
device: e,
|
|
18
|
+
orientation: "portrait"
|
|
19
|
+
}, {
|
|
20
|
+
device: e,
|
|
21
|
+
orientation: "landscape"
|
|
22
|
+
}] : [{
|
|
23
|
+
device: e,
|
|
24
|
+
orientation: "portrait"
|
|
25
|
+
}]);
|
|
26
|
+
function ye(e, t) {
|
|
27
|
+
return (t === "landscape" ? ge[e] : void 0) ?? S[e];
|
|
28
|
+
}
|
|
29
|
+
function C(e, t, n = "portrait") {
|
|
30
|
+
let r = e[ye(t, n)];
|
|
31
|
+
return r === void 0 ? e[S[t]] !== !1 : r;
|
|
32
|
+
}
|
|
33
|
+
function be(e) {
|
|
34
|
+
return ve.filter(({ device: t, orientation: n }) => C(e, t, n)).length;
|
|
35
|
+
}
|
|
36
|
+
// src/schema/styleItems.ts
|
|
37
|
+
var xe = y.strictObject({
|
|
38
|
+
key: y.string(),
|
|
39
|
+
variable: y.string().optional(),
|
|
40
|
+
variables: y.record(y.string(), y.string()).optional(),
|
|
41
|
+
attribute: y.string().optional(),
|
|
42
|
+
value: y.unknown()
|
|
43
|
+
}), Se = [
|
|
44
|
+
"variable",
|
|
45
|
+
"variables",
|
|
46
|
+
"attribute"
|
|
47
|
+
];
|
|
48
|
+
function Ce(e) {
|
|
49
|
+
let t = {};
|
|
50
|
+
for (let n of e) n.defaultValue !== void 0 && (t[n.key] = n.defaultValue);
|
|
51
|
+
return t;
|
|
52
|
+
}
|
|
53
|
+
function we(e, t) {
|
|
54
|
+
return Se.find((n) => JSON.stringify(e[n]) !== JSON.stringify(t[n]));
|
|
55
|
+
}
|
|
56
|
+
function Te(e, t, n) {
|
|
57
|
+
if (!t) return {
|
|
58
|
+
field: "key",
|
|
59
|
+
message: `Unknown style key "${e.key}"`
|
|
60
|
+
};
|
|
61
|
+
if (n.has(e.key)) return {
|
|
62
|
+
field: "key",
|
|
63
|
+
message: `Style key "${e.key}" appears twice`
|
|
64
|
+
};
|
|
65
|
+
let r = we(e, t);
|
|
66
|
+
if (r) return {
|
|
67
|
+
field: r,
|
|
68
|
+
message: `Style "${e.key}" ${r} does not match the element configuration`
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function Ee(e) {
|
|
72
|
+
return Oe(e, () => Ce(e));
|
|
73
|
+
}
|
|
74
|
+
function De(e) {
|
|
75
|
+
return Oe(e, () => ({}));
|
|
76
|
+
}
|
|
77
|
+
function Oe(e, t) {
|
|
78
|
+
let n = new Map(e.map((e) => [e.key, e]));
|
|
79
|
+
return y.array(xe).default([]).transform((e, r) => {
|
|
80
|
+
let i = t(), a = /* @__PURE__ */ new Set();
|
|
81
|
+
return e.forEach((e, t) => {
|
|
82
|
+
let o = n.get(e.key), s = Te(e, o, a);
|
|
83
|
+
if (s || !o) {
|
|
84
|
+
r.addIssue({
|
|
85
|
+
code: "custom",
|
|
86
|
+
path: [t, s?.field ?? "key"],
|
|
87
|
+
message: s?.message ?? ""
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
a.add(e.key);
|
|
92
|
+
let c = o.value.safeParse(e.value);
|
|
93
|
+
if (c.success) i[e.key] = c.data;
|
|
94
|
+
else {
|
|
95
|
+
let e = c.error.issues[0]?.message ?? "Invalid value";
|
|
96
|
+
r.addIssue({
|
|
97
|
+
code: "custom",
|
|
98
|
+
path: [t, "value"],
|
|
99
|
+
message: e
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}), i;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function ke(e, t) {
|
|
106
|
+
let n = Object.fromEntries(Se.filter((t) => e[t] !== void 0).map((t) => [t, e[t]]));
|
|
107
|
+
return {
|
|
108
|
+
key: e.key,
|
|
109
|
+
...n,
|
|
110
|
+
value: t
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function w(e, t = "") {
|
|
114
|
+
return Object.fromEntries(e.flatMap(({ key: e, label: n }) => n === void 0 ? [] : [[`${t}${e}`, n]]));
|
|
115
|
+
}
|
|
116
|
+
function Ae(e, t) {
|
|
117
|
+
return Me({
|
|
118
|
+
...Ce(t),
|
|
119
|
+
...e
|
|
120
|
+
}, t);
|
|
121
|
+
}
|
|
122
|
+
function je(e, t) {
|
|
123
|
+
return Me(e ?? {}, t);
|
|
124
|
+
}
|
|
125
|
+
function Me(e, t) {
|
|
126
|
+
return t.filter((t) => e[t.key] !== void 0).map((t) => ke(t, e[t.key]));
|
|
127
|
+
}
|
|
128
|
+
function Ne(e, t) {
|
|
129
|
+
return JSON.stringify(e) === JSON.stringify(t);
|
|
130
|
+
}
|
|
131
|
+
function Pe(e, t) {
|
|
132
|
+
let n = {};
|
|
133
|
+
for (let r of t) {
|
|
134
|
+
let t = e?.[r.key];
|
|
135
|
+
t !== void 0 && (r.defaultValue !== void 0 && Ne(t, r.defaultValue) || (n[r.key] = r.document ? r.document.encode(t) : t));
|
|
136
|
+
}
|
|
137
|
+
return Object.keys(n).length > 0 ? n : void 0;
|
|
138
|
+
}
|
|
139
|
+
function T(e, t) {
|
|
140
|
+
return Pe(e, t);
|
|
141
|
+
}
|
|
142
|
+
function E(e) {
|
|
143
|
+
return e === void 0 ? {} : { style: e };
|
|
144
|
+
}
|
|
145
|
+
function Fe(e, t) {
|
|
146
|
+
return Pe(e, t);
|
|
147
|
+
}
|
|
148
|
+
function Ie(e, t) {
|
|
149
|
+
let n = new Map(e.map((e) => [e.key, e])), r = new Set(e.map((e) => e.key));
|
|
150
|
+
return y.record(y.string(), y.unknown()).superRefine((e, t) => {
|
|
151
|
+
for (let n of Object.keys(e)) r.has(n) || t.addIssue({
|
|
152
|
+
code: "custom",
|
|
153
|
+
path: [n],
|
|
154
|
+
message: `Unknown style key "${n}"`
|
|
155
|
+
});
|
|
156
|
+
}).transform((e, r) => {
|
|
157
|
+
let i = t();
|
|
158
|
+
for (let [t, a] of Object.entries(e)) {
|
|
159
|
+
let e = n.get(t);
|
|
160
|
+
if (!e) continue;
|
|
161
|
+
let o = (e.document?.schema ?? e.value).safeParse(a);
|
|
162
|
+
if (o.success) i[t] = o.data;
|
|
163
|
+
else {
|
|
164
|
+
let e = o.error.issues[0]?.message ?? "Invalid value";
|
|
165
|
+
r.addIssue({
|
|
166
|
+
code: "custom",
|
|
167
|
+
path: [t],
|
|
168
|
+
message: e
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return i;
|
|
173
|
+
}).optional().transform((e) => e ?? t());
|
|
174
|
+
}
|
|
175
|
+
function D(e) {
|
|
176
|
+
return Ie(e, () => Ce(e));
|
|
177
|
+
}
|
|
178
|
+
function Le(e) {
|
|
179
|
+
return Ie(e, () => ({}));
|
|
180
|
+
}
|
|
181
|
+
// src/schema/deviceSettings.ts
|
|
182
|
+
var Re = [
|
|
183
|
+
{
|
|
184
|
+
key: "desktop",
|
|
185
|
+
visibility: "showOnDesktop",
|
|
186
|
+
label: "Desktop"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
key: "tablet",
|
|
190
|
+
visibility: "showOnTablet",
|
|
191
|
+
styleProp: "tabletStyle",
|
|
192
|
+
label: "Tablet"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
key: "tabletLandscape",
|
|
196
|
+
visibility: "showOnTabletLandscape",
|
|
197
|
+
styleProp: "tabletLandscapeStyle",
|
|
198
|
+
label: "Landscape tablet"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
key: "mobile",
|
|
202
|
+
visibility: "showOnMobile",
|
|
203
|
+
styleProp: "mobileStyle",
|
|
204
|
+
label: "Mobile"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
key: "mobileLandscape",
|
|
208
|
+
visibility: "showOnMobileLandscape",
|
|
209
|
+
styleProp: "mobileLandscapeStyle",
|
|
210
|
+
label: "Landscape mobile"
|
|
211
|
+
}
|
|
212
|
+
], ze = Re.filter((e) => e.styleProp !== void 0).map(({ styleProp: e, label: t }) => ({
|
|
213
|
+
prop: e,
|
|
214
|
+
device: t
|
|
215
|
+
})), Be = {
|
|
216
|
+
showOnDesktop: "Show on desktop",
|
|
217
|
+
showOnTablet: "Show on portrait tablet",
|
|
218
|
+
showOnTabletLandscape: "Show on landscape tablet",
|
|
219
|
+
showOnMobile: "Show on portrait mobile",
|
|
220
|
+
showOnMobileLandscape: "Show on landscape mobile"
|
|
221
|
+
};
|
|
222
|
+
function O(e, t) {
|
|
223
|
+
return t && e ? y.strictObject({
|
|
224
|
+
style: Le(e).optional(),
|
|
225
|
+
hidden: y.boolean().optional()
|
|
226
|
+
}) : y.strictObject({ hidden: y.boolean().optional() });
|
|
227
|
+
}
|
|
228
|
+
function Ve(e) {
|
|
229
|
+
return y.strictObject({ devices: y.strictObject({
|
|
230
|
+
desktop: O(e, !1).optional(),
|
|
231
|
+
tablet: O(e, !0).optional(),
|
|
232
|
+
tabletLandscape: O(e, !0).optional(),
|
|
233
|
+
mobile: O(e, !0).optional(),
|
|
234
|
+
mobileLandscape: O(e, !0).optional()
|
|
235
|
+
}).optional() });
|
|
236
|
+
}
|
|
237
|
+
function He(e) {
|
|
238
|
+
if (!e) return {};
|
|
239
|
+
let t = {};
|
|
240
|
+
for (let n of Re) {
|
|
241
|
+
let r = e[n.key];
|
|
242
|
+
r && (r.hidden !== void 0 && (t[n.visibility] = !r.hidden), n.styleProp && r.style !== void 0 && (t[n.styleProp] = r.style));
|
|
243
|
+
}
|
|
244
|
+
return t;
|
|
245
|
+
}
|
|
246
|
+
function Ue(e, t, n) {
|
|
247
|
+
return Object.fromEntries(Object.entries(e).filter(([e]) => t.has(e) === n));
|
|
248
|
+
}
|
|
249
|
+
function We(e, t) {
|
|
250
|
+
let n = /* @__PURE__ */ new Set(["devices"]);
|
|
251
|
+
return y.record(y.string(), y.unknown()).transform((r, i) => {
|
|
252
|
+
let a = e.safeParse(Ue(r, n, !1)), o = t.safeParse(Ue(r, n, !0));
|
|
253
|
+
for (let e of [...a.error?.issues ?? [], ...o.error?.issues ?? []]) i.addIssue({
|
|
254
|
+
code: "custom",
|
|
255
|
+
path: e.path,
|
|
256
|
+
message: e.message
|
|
257
|
+
});
|
|
258
|
+
if (!a.success || !o.success) return y.NEVER;
|
|
259
|
+
let s = He(o.data.devices);
|
|
260
|
+
return be(s) === 0 ? (i.addIssue({
|
|
261
|
+
code: "custom",
|
|
262
|
+
path: ["devices"],
|
|
263
|
+
message: "Show the element on at least one device"
|
|
264
|
+
}), y.NEVER) : {
|
|
265
|
+
...a.data,
|
|
266
|
+
...Ge(s)
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
function Ge(e) {
|
|
271
|
+
return Object.fromEntries(Object.entries(e).filter(([, e]) => !Ke(e)));
|
|
272
|
+
}
|
|
273
|
+
function Ke(e) {
|
|
274
|
+
return e === void 0 || typeof e == "object" && !!e && Object.keys(e).length === 0;
|
|
275
|
+
}
|
|
276
|
+
function qe(e) {
|
|
277
|
+
let t = {};
|
|
278
|
+
for (let { device: n, orientation: r } of ve) {
|
|
279
|
+
let i = C(e, n, r);
|
|
280
|
+
if (!(r === "portrait" ? !i : i !== C(e, n, "portrait"))) continue;
|
|
281
|
+
let a = Je(ye(n, r));
|
|
282
|
+
t[a] = {
|
|
283
|
+
...t[a],
|
|
284
|
+
hidden: !i
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
return t;
|
|
288
|
+
}
|
|
289
|
+
function Je(e) {
|
|
290
|
+
let t = Re.find((t) => t.visibility === e);
|
|
291
|
+
if (!t) throw Error(`Unknown visibility prop ${e}`);
|
|
292
|
+
return t.key;
|
|
293
|
+
}
|
|
294
|
+
function Ye(e, t) {
|
|
295
|
+
let n = {};
|
|
296
|
+
for (let r of ze) {
|
|
297
|
+
let i = Fe(e[r.prop], t);
|
|
298
|
+
if (i === void 0) continue;
|
|
299
|
+
let a = Re.find((e) => e.styleProp === r.prop).key;
|
|
300
|
+
n[a] = {
|
|
301
|
+
...n[a],
|
|
302
|
+
style: i
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
return n;
|
|
306
|
+
}
|
|
307
|
+
function Xe(...e) {
|
|
308
|
+
let t = {};
|
|
309
|
+
for (let n of e) for (let [e, r] of Object.entries(n)) t[e] = {
|
|
310
|
+
...t[e],
|
|
311
|
+
...r
|
|
312
|
+
};
|
|
313
|
+
return Object.keys(t).length > 0 ? t : void 0;
|
|
314
|
+
}
|
|
315
|
+
function Ze(e, t) {
|
|
316
|
+
let n = Xe(qe(e), t ? Ye(e, t) : {});
|
|
317
|
+
return n === void 0 ? {} : { devices: n };
|
|
318
|
+
}
|
|
319
|
+
function Qe(e) {
|
|
320
|
+
return `${e.charAt(0).toLowerCase()}${e.slice(1)}`;
|
|
321
|
+
}
|
|
322
|
+
function $e(e) {
|
|
323
|
+
return Object.fromEntries(ze.flatMap(({ prop: t, device: n }) => Object.entries(w(e, `${t}.`)).map(([e, t]) => [e, `${n} ${Qe(t)}`])));
|
|
324
|
+
}
|
|
325
|
+
function k(e, t) {
|
|
326
|
+
return {
|
|
327
|
+
...e,
|
|
328
|
+
attributes: We(e.attributes, Ve(t)),
|
|
329
|
+
toDocumentAttributes: (n) => ({
|
|
330
|
+
...e.toDocumentAttributes(n),
|
|
331
|
+
...Ze(n, t)
|
|
332
|
+
}),
|
|
333
|
+
history: {
|
|
334
|
+
summary: e.history.summary,
|
|
335
|
+
attributes: {
|
|
336
|
+
...e.history.attributes,
|
|
337
|
+
...Be,
|
|
338
|
+
...t ? $e(t) : {}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
// src/schema/textItems.ts
|
|
344
|
+
function A(e, t) {
|
|
345
|
+
return y.array(y.strictObject({ text: y.string().trim().min(1, t) })).min(1, e);
|
|
346
|
+
}
|
|
347
|
+
function j(e) {
|
|
348
|
+
return e.map(({ text: e }) => ({ text: e }));
|
|
349
|
+
}
|
|
350
|
+
// src/schema/Fields/ColorField/colorText.ts
|
|
351
|
+
var et = /^#[0-9A-Fa-f]{6}$/, tt = new Set(ee), nt = new Set(fe);
|
|
352
|
+
function rt(e) {
|
|
353
|
+
return "name" in e;
|
|
354
|
+
}
|
|
355
|
+
function it(e) {
|
|
356
|
+
let t = e.lastIndexOf("/");
|
|
357
|
+
if (t === -1) return {
|
|
358
|
+
base: e,
|
|
359
|
+
opacity: void 0
|
|
360
|
+
};
|
|
361
|
+
let n = e.slice(t + 1);
|
|
362
|
+
return /^\d+$/.test(n) ? {
|
|
363
|
+
base: e.slice(0, t),
|
|
364
|
+
opacity: Number.parseInt(n, 10)
|
|
365
|
+
} : null;
|
|
366
|
+
}
|
|
367
|
+
function at(e) {
|
|
368
|
+
if (rt(e)) return e.opacity === 100 ? e.name : `${e.name}/${e.opacity}`;
|
|
369
|
+
let t = e.hex.toUpperCase();
|
|
370
|
+
return e.opacity === 100 ? t : `${t}/${e.opacity}`;
|
|
371
|
+
}
|
|
372
|
+
function ot(e) {
|
|
373
|
+
let t = it(e.trim());
|
|
374
|
+
if (!t) return null;
|
|
375
|
+
if (et.test(t.base)) {
|
|
376
|
+
let e = t.opacity ?? 100;
|
|
377
|
+
return e < 0 || e > 100 ? null : {
|
|
378
|
+
hex: t.base.toUpperCase(),
|
|
379
|
+
opacity: e
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
if (!tt.has(t.base)) return null;
|
|
383
|
+
let n = t.opacity ?? 100;
|
|
384
|
+
return nt.has(n) ? {
|
|
385
|
+
name: t.base,
|
|
386
|
+
opacity: n
|
|
387
|
+
} : null;
|
|
388
|
+
}
|
|
389
|
+
var st = /^[#0-9a-z%.,\s()-]+$/i, ct = /url|var|image|expression|attr/i;
|
|
390
|
+
function lt(e) {
|
|
10
391
|
let t = e.trim();
|
|
11
|
-
return t !== "" && t.length <= 200 &&
|
|
392
|
+
return t !== "" && t.length <= 200 && st.test(t) && !ct.test(t);
|
|
12
393
|
}
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
394
|
+
function ut(e) {
|
|
395
|
+
if (lt(e.value)) return `${e.kind}-gradient(${e.value.trim()})`;
|
|
15
396
|
}
|
|
16
397
|
// src/schema/style/page-styles.ts
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
return
|
|
398
|
+
var dt = /^#[0-9A-Fa-f]{6}$/;
|
|
399
|
+
function ft(e) {
|
|
400
|
+
return dt.test(e) ? [
|
|
20
401
|
Number.parseInt(e.slice(1, 3), 16),
|
|
21
402
|
Number.parseInt(e.slice(3, 5), 16),
|
|
22
403
|
Number.parseInt(e.slice(5, 7), 16)
|
|
23
404
|
] : null;
|
|
24
405
|
}
|
|
25
|
-
function
|
|
26
|
-
if (
|
|
27
|
-
let
|
|
28
|
-
if (!
|
|
29
|
-
if (
|
|
30
|
-
let
|
|
31
|
-
return `rgba(${
|
|
406
|
+
function pt(t) {
|
|
407
|
+
if (se(t)) return e(t);
|
|
408
|
+
let n = ft(t.hex);
|
|
409
|
+
if (!n || !Number.isFinite(t.opacity)) return;
|
|
410
|
+
if (t.opacity === 100) return t.hex.toUpperCase();
|
|
411
|
+
let r = Math.min(100, Math.max(0, t.opacity)) / 100, [i, a, o] = n;
|
|
412
|
+
return `rgba(${i}, ${a}, ${o}, ${r})`;
|
|
32
413
|
}
|
|
33
|
-
function
|
|
414
|
+
function mt(e) {
|
|
34
415
|
if (!(!Number.isFinite(e) || e <= 0)) return `${e}px`;
|
|
35
416
|
}
|
|
36
417
|
// src/schema/style/backgroundStyle.ts
|
|
37
|
-
function
|
|
38
|
-
if (
|
|
39
|
-
if (
|
|
418
|
+
function ht(t) {
|
|
419
|
+
if (t.backgroundType === "gradient") return "transparent";
|
|
420
|
+
if (t.backgroundColor) return se(t.backgroundColor) ? e(t.backgroundColor) : pt(t.backgroundColor);
|
|
40
421
|
}
|
|
41
|
-
function
|
|
422
|
+
function gt(e) {
|
|
42
423
|
if (e.backgroundType !== "gradient") return "none";
|
|
43
|
-
if (e.backgroundGradient) return
|
|
424
|
+
if (e.backgroundGradient) return ut(e.backgroundGradient);
|
|
44
425
|
}
|
|
45
|
-
function
|
|
426
|
+
function _t(e, t) {
|
|
46
427
|
return e.backgroundType ? {
|
|
47
|
-
[`${t}-background-color`]:
|
|
48
|
-
[`${t}-background-image`]:
|
|
428
|
+
[`${t}-background-color`]: ht(e),
|
|
429
|
+
[`${t}-background-image`]: gt(e)
|
|
49
430
|
} : {};
|
|
50
431
|
}
|
|
51
432
|
// src/schema/style/elementStyle.ts
|
|
52
|
-
var
|
|
433
|
+
var vt = [
|
|
53
434
|
"none",
|
|
54
435
|
"solid",
|
|
55
436
|
"dashed",
|
|
56
437
|
"dotted",
|
|
57
438
|
"double"
|
|
58
|
-
],
|
|
439
|
+
], yt = [
|
|
59
440
|
"row",
|
|
60
441
|
"column",
|
|
61
442
|
"row-reverse",
|
|
62
443
|
"column-reverse"
|
|
63
|
-
],
|
|
444
|
+
], bt = [
|
|
64
445
|
"nowrap",
|
|
65
446
|
"wrap",
|
|
66
447
|
"wrap-reverse"
|
|
67
|
-
],
|
|
448
|
+
], xt = [
|
|
68
449
|
"flex-start",
|
|
69
450
|
"center",
|
|
70
451
|
"flex-end",
|
|
71
452
|
"space-between",
|
|
72
453
|
"space-around",
|
|
73
454
|
"space-evenly"
|
|
74
|
-
],
|
|
455
|
+
], St = [
|
|
75
456
|
"stretch",
|
|
76
457
|
"flex-start",
|
|
77
458
|
"center",
|
|
78
459
|
"flex-end",
|
|
79
460
|
"baseline"
|
|
80
|
-
],
|
|
461
|
+
], Ct = ["stretch", ...xt], M = {
|
|
81
462
|
layout: "block",
|
|
82
463
|
flexDirection: "row",
|
|
83
464
|
flexWrap: "nowrap",
|
|
@@ -118,425 +499,326 @@ var h = [
|
|
|
118
499
|
hex: "#000000",
|
|
119
500
|
opacity: 100
|
|
120
501
|
}
|
|
121
|
-
},
|
|
122
|
-
function
|
|
502
|
+
}, wt = /^(auto|0|-?\d+(\.\d+)?(px|rem|em|%))$/i, Tt = /^(0|\d+(\.\d+)?(px|rem|em))$/i;
|
|
503
|
+
function N(e) {
|
|
123
504
|
let t = e.trim();
|
|
124
|
-
if (
|
|
505
|
+
if (wt.test(t)) return t;
|
|
125
506
|
}
|
|
126
|
-
function
|
|
127
|
-
let t =
|
|
507
|
+
function P(e) {
|
|
508
|
+
let t = N(e);
|
|
128
509
|
if (t != null) return t.toLowerCase() === "auto" ? "0" : t;
|
|
129
510
|
}
|
|
130
|
-
function
|
|
131
|
-
let t =
|
|
511
|
+
function Et(e) {
|
|
512
|
+
let t = N(e);
|
|
132
513
|
return t?.toLowerCase() === "auto" ? "none" : t;
|
|
133
514
|
}
|
|
134
|
-
function
|
|
515
|
+
function Dt(e) {
|
|
135
516
|
let t = e.trim();
|
|
136
|
-
return
|
|
517
|
+
return Tt.test(t) ? t : void 0;
|
|
137
518
|
}
|
|
138
|
-
function
|
|
519
|
+
function Ot(e, t) {
|
|
139
520
|
return e === "hide" ? "hidden" : t ? "auto" : "hidden";
|
|
140
521
|
}
|
|
141
|
-
var
|
|
522
|
+
var kt = [
|
|
142
523
|
"marginTop",
|
|
143
524
|
"marginBottom",
|
|
144
525
|
"marginLeft",
|
|
145
526
|
"marginRight"
|
|
146
527
|
];
|
|
147
|
-
function
|
|
528
|
+
function At(e) {
|
|
148
529
|
return e.trim().toLowerCase() === "auto";
|
|
149
530
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
531
|
+
function jt(e, t) {
|
|
532
|
+
return kt.every((t) => At(e[t])) ? "0" : N(e[t]);
|
|
152
533
|
}
|
|
153
|
-
function
|
|
534
|
+
function Mt(e) {
|
|
154
535
|
return e.layout !== "grid" || e.gridColumns == null ? "none" : `repeat(${e.gridColumns}, minmax(0, 1fr))`;
|
|
155
536
|
}
|
|
156
|
-
function
|
|
537
|
+
function Nt(e, t) {
|
|
157
538
|
let n = {
|
|
158
|
-
...
|
|
539
|
+
...M,
|
|
159
540
|
...e
|
|
160
541
|
}, r = `--palmyit-${t}`;
|
|
161
542
|
return {
|
|
162
543
|
[`${r}-display`]: n.layout,
|
|
163
|
-
[`${r}-grid-template-columns`]:
|
|
544
|
+
[`${r}-grid-template-columns`]: Mt(n),
|
|
164
545
|
[`${r}-flex-direction`]: n.flexDirection,
|
|
165
546
|
[`${r}-flex-wrap`]: n.flexWrap,
|
|
166
547
|
[`${r}-justify-content`]: n.justifyContent,
|
|
167
548
|
[`${r}-align-items`]: n.alignItems,
|
|
168
549
|
[`${r}-align-content`]: n.alignContent,
|
|
169
|
-
[`${r}-row-gap`]:
|
|
170
|
-
[`${r}-column-gap`]:
|
|
171
|
-
[`${r}-overflow-x`]:
|
|
172
|
-
[`${r}-overflow-y`]:
|
|
173
|
-
[`${r}-width`]:
|
|
174
|
-
[`${r}-height`]:
|
|
175
|
-
[`${r}-min-width`]:
|
|
176
|
-
[`${r}-min-height`]:
|
|
177
|
-
[`${r}-max-width`]:
|
|
178
|
-
[`${r}-max-height`]:
|
|
179
|
-
[`${r}-padding-top`]:
|
|
180
|
-
[`${r}-padding-bottom`]:
|
|
181
|
-
[`${r}-padding-left`]:
|
|
182
|
-
[`${r}-padding-right`]:
|
|
183
|
-
[`${r}-margin-top`]:
|
|
184
|
-
[`${r}-margin-bottom`]:
|
|
185
|
-
[`${r}-margin-left`]:
|
|
186
|
-
[`${r}-margin-right`]:
|
|
187
|
-
[`${r}-border-top-left-radius`]:
|
|
188
|
-
[`${r}-border-top-right-radius`]:
|
|
189
|
-
[`${r}-border-bottom-right-radius`]:
|
|
190
|
-
[`${r}-border-bottom-left-radius`]:
|
|
191
|
-
[`${r}-border-width`]:
|
|
550
|
+
[`${r}-row-gap`]: P(n.rowGap),
|
|
551
|
+
[`${r}-column-gap`]: P(n.columnGap),
|
|
552
|
+
[`${r}-overflow-x`]: Ot(n.overflow, n.overflowHorizontal),
|
|
553
|
+
[`${r}-overflow-y`]: Ot(n.overflow, n.overflowVertical),
|
|
554
|
+
[`${r}-width`]: N(n.width),
|
|
555
|
+
[`${r}-height`]: N(n.height),
|
|
556
|
+
[`${r}-min-width`]: N(n.minWidth),
|
|
557
|
+
[`${r}-min-height`]: N(n.minHeight),
|
|
558
|
+
[`${r}-max-width`]: Et(n.maxWidth),
|
|
559
|
+
[`${r}-max-height`]: Et(n.maxHeight),
|
|
560
|
+
[`${r}-padding-top`]: P(n.paddingTop),
|
|
561
|
+
[`${r}-padding-bottom`]: P(n.paddingBottom),
|
|
562
|
+
[`${r}-padding-left`]: P(n.paddingLeft),
|
|
563
|
+
[`${r}-padding-right`]: P(n.paddingRight),
|
|
564
|
+
[`${r}-margin-top`]: jt(n, "marginTop"),
|
|
565
|
+
[`${r}-margin-bottom`]: jt(n, "marginBottom"),
|
|
566
|
+
[`${r}-margin-left`]: jt(n, "marginLeft"),
|
|
567
|
+
[`${r}-margin-right`]: jt(n, "marginRight"),
|
|
568
|
+
[`${r}-border-top-left-radius`]: P(n.borderRadiusTopLeft),
|
|
569
|
+
[`${r}-border-top-right-radius`]: P(n.borderRadiusTopRight),
|
|
570
|
+
[`${r}-border-bottom-right-radius`]: P(n.borderRadiusBottomRight),
|
|
571
|
+
[`${r}-border-bottom-left-radius`]: P(n.borderRadiusBottomLeft),
|
|
572
|
+
[`${r}-border-width`]: Dt(n.borderWidth),
|
|
192
573
|
[`${r}-border-style`]: n.borderStyle,
|
|
193
|
-
[`${r}-border-color`]:
|
|
194
|
-
...
|
|
574
|
+
[`${r}-border-color`]: pt(n.borderColor),
|
|
575
|
+
..._t(n, r)
|
|
195
576
|
};
|
|
196
577
|
}
|
|
197
578
|
// src/schema/styleTokensSchema.ts
|
|
198
|
-
var
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
]),
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
]),
|
|
207
|
-
hex:
|
|
208
|
-
opacity:
|
|
209
|
-
}),
|
|
210
|
-
name:
|
|
211
|
-
opacity:
|
|
212
|
-
}),
|
|
213
|
-
|
|
214
|
-
|
|
579
|
+
var Pt = y.enum(i), Ft = y.enum(pe), It = y.enum(te), Lt = y.enum(r), Rt = y.enum(n), zt = y.enum(m), F = y.string().trim().regex(wt, "Expected auto, 0, or a px, rem, em, or % length"), I = y.union([
|
|
580
|
+
Pt,
|
|
581
|
+
It,
|
|
582
|
+
F
|
|
583
|
+
]), Bt = y.union([Ft, F]), Vt = y.union([
|
|
584
|
+
Lt,
|
|
585
|
+
y.number().min(1).max(200),
|
|
586
|
+
F
|
|
587
|
+
]), Ht = y.union([Rt, F]), Ut = y.union([zt, F]), Wt = y.strictObject({
|
|
588
|
+
hex: y.string().regex(/^#[0-9A-Fa-f]{6}$/, "Expected a #RRGGBB color"),
|
|
589
|
+
opacity: y.number().int().min(0).max(100)
|
|
590
|
+
}), Gt = new Set(fe), Kt = y.strictObject({
|
|
591
|
+
name: y.enum(ee),
|
|
592
|
+
opacity: y.number().int().refine((e) => Gt.has(e), "Expected a Tailwind opacity step such as 0, 10, 50, or 100")
|
|
593
|
+
}), qt = y.union([Kt, Wt]), Jt = y.string().transform((e, t) => ot(e) || (t.addIssue({
|
|
594
|
+
code: "custom",
|
|
595
|
+
message: "Expected a color such as #DC2626, #DC2626/80, or slate-700/50"
|
|
596
|
+
}), y.NEVER));
|
|
597
|
+
function L(e) {
|
|
598
|
+
return {
|
|
599
|
+
...e,
|
|
600
|
+
value: qt,
|
|
601
|
+
document: {
|
|
602
|
+
schema: Jt,
|
|
603
|
+
encode: (e) => at(e)
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
// src/schema/Fields/FontStyleField.ts
|
|
608
|
+
var Yt = [
|
|
609
|
+
"normal",
|
|
610
|
+
"italic",
|
|
611
|
+
"oblique"
|
|
612
|
+
], Xt = [
|
|
613
|
+
"none",
|
|
614
|
+
"underline",
|
|
615
|
+
"overline",
|
|
616
|
+
"line-through"
|
|
617
|
+
], Zt = [
|
|
618
|
+
"start",
|
|
619
|
+
"end",
|
|
620
|
+
"left",
|
|
621
|
+
"center",
|
|
622
|
+
"right",
|
|
623
|
+
"justify"
|
|
624
|
+
], Qt = [
|
|
625
|
+
"none",
|
|
626
|
+
"capitalize",
|
|
627
|
+
"uppercase",
|
|
628
|
+
"lowercase"
|
|
629
|
+
], $t = [
|
|
630
|
+
"100",
|
|
631
|
+
"200",
|
|
632
|
+
"300",
|
|
633
|
+
"400",
|
|
634
|
+
"500",
|
|
635
|
+
"600",
|
|
636
|
+
"700",
|
|
637
|
+
"800",
|
|
638
|
+
"900"
|
|
639
|
+
], en = {
|
|
640
|
+
text: "Text",
|
|
641
|
+
...d,
|
|
642
|
+
style: {}
|
|
643
|
+
}, tn = "--palmyit-text";
|
|
644
|
+
function nn(e) {
|
|
645
|
+
return [
|
|
646
|
+
{
|
|
647
|
+
key: "textFont",
|
|
648
|
+
variable: `${e}-font-family`,
|
|
649
|
+
value: y.string().refine(ie, "Expected a Google Fonts family name"),
|
|
650
|
+
label: "Font family"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
key: "fontStyle",
|
|
654
|
+
variable: `${e}-font-style`,
|
|
655
|
+
value: y.enum(Yt),
|
|
656
|
+
label: "Text style"
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
key: "textSize",
|
|
660
|
+
variable: `${e}-font-size`,
|
|
661
|
+
value: Vt,
|
|
662
|
+
label: "Text size"
|
|
663
|
+
},
|
|
664
|
+
L({
|
|
665
|
+
key: "textColor",
|
|
666
|
+
variable: `${e}-color`,
|
|
667
|
+
label: "Text color"
|
|
668
|
+
}),
|
|
669
|
+
{
|
|
670
|
+
key: "lineHeight",
|
|
671
|
+
variable: `${e}-line-height`,
|
|
672
|
+
value: Ht,
|
|
673
|
+
label: "Height"
|
|
674
|
+
},
|
|
675
|
+
{
|
|
676
|
+
key: "letterSpacing",
|
|
677
|
+
variable: `${e}-letter-spacing`,
|
|
678
|
+
value: Ut,
|
|
679
|
+
label: "Letter spacing"
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
key: "wordSpacing",
|
|
683
|
+
variable: `${e}-word-spacing`,
|
|
684
|
+
value: I,
|
|
685
|
+
label: "Word spacing"
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
key: "textDecoration",
|
|
689
|
+
variable: `${e}-text-decoration`,
|
|
690
|
+
value: y.enum(Xt),
|
|
691
|
+
label: "Text decoration"
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
key: "textAlign",
|
|
695
|
+
variable: `${e}-text-align`,
|
|
696
|
+
value: y.enum(Zt),
|
|
697
|
+
label: "Text align"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
key: "textTransform",
|
|
701
|
+
variable: `${e}-text-transform`,
|
|
702
|
+
value: y.enum(Qt),
|
|
703
|
+
label: "Text transform"
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
key: "fontWeight",
|
|
707
|
+
variable: `${e}-font-weight`,
|
|
708
|
+
value: y.enum($t),
|
|
709
|
+
label: "Text weight"
|
|
710
|
+
}
|
|
711
|
+
];
|
|
712
|
+
}
|
|
713
|
+
var R = nn(tn), rn = k(x({
|
|
714
|
+
type: "PText",
|
|
715
|
+
label: "Text",
|
|
716
|
+
allowedChildren: [],
|
|
717
|
+
templates: [],
|
|
718
|
+
attributes: y.strictObject({
|
|
719
|
+
id: b,
|
|
720
|
+
text: y.string().trim().min(1, "Enter text").default(en.text),
|
|
721
|
+
...t,
|
|
722
|
+
style: D(R).transform((e) => e)
|
|
723
|
+
}),
|
|
724
|
+
toDocumentAttributes: ({ id: e, text: t, href: n, target: r, description: i, rel: a, style: o }) => ({
|
|
725
|
+
id: e,
|
|
726
|
+
text: t,
|
|
727
|
+
..._({
|
|
728
|
+
href: n,
|
|
729
|
+
target: r,
|
|
730
|
+
description: i,
|
|
731
|
+
rel: a
|
|
732
|
+
}),
|
|
733
|
+
...E(T(o, R))
|
|
734
|
+
}),
|
|
735
|
+
history: {
|
|
736
|
+
summary: ({ text: e }) => e,
|
|
737
|
+
attributes: {
|
|
738
|
+
text: "Text",
|
|
739
|
+
...g,
|
|
740
|
+
...w(R, "style.")
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}), R), an = [
|
|
744
|
+
"1",
|
|
745
|
+
"2",
|
|
746
|
+
"3",
|
|
747
|
+
"4",
|
|
748
|
+
"5",
|
|
749
|
+
"6"
|
|
750
|
+
], on = /^[a-z0-9]+(?:-[a-z0-9]+)*$/, z = {
|
|
751
|
+
text: "Heading",
|
|
752
|
+
level: "2",
|
|
753
|
+
anchor: "",
|
|
754
|
+
...d,
|
|
755
|
+
style: {}
|
|
756
|
+
}, sn = "--palmyit-heading", B = nn(sn), cn = k(x({
|
|
757
|
+
type: "PHeading",
|
|
758
|
+
label: "Heading",
|
|
759
|
+
allowedChildren: [],
|
|
760
|
+
templates: [],
|
|
761
|
+
attributes: y.strictObject({
|
|
762
|
+
id: b,
|
|
763
|
+
text: y.string().trim().min(1, "Enter text").default(z.text),
|
|
764
|
+
level: y.enum(an).default(z.level),
|
|
765
|
+
anchor: y.string().trim().refine((e) => e === "" || on.test(e), { message: "Use lowercase letters, numbers, and hyphens" }).default(z.anchor),
|
|
766
|
+
...t,
|
|
767
|
+
style: D(B).transform((e) => e)
|
|
768
|
+
}),
|
|
769
|
+
toDocumentAttributes: ({ id: e, text: t, level: n, anchor: r, href: i, target: a, description: o, rel: s, style: c }) => ({
|
|
770
|
+
id: e,
|
|
771
|
+
text: t,
|
|
772
|
+
level: n,
|
|
773
|
+
...r === "" ? {} : { anchor: r },
|
|
774
|
+
..._({
|
|
775
|
+
href: i,
|
|
776
|
+
target: a,
|
|
777
|
+
description: o,
|
|
778
|
+
rel: s
|
|
779
|
+
}),
|
|
780
|
+
...E(T(c, B))
|
|
781
|
+
}),
|
|
782
|
+
history: {
|
|
783
|
+
summary: ({ text: e }) => e,
|
|
784
|
+
attributes: {
|
|
785
|
+
text: "Text",
|
|
786
|
+
level: "Level",
|
|
787
|
+
anchor: "Anchor",
|
|
788
|
+
...g,
|
|
789
|
+
...w(B, "style.")
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}), B), ln = y.strictObject({
|
|
793
|
+
kind: y.enum(["linear", "radial"]),
|
|
794
|
+
value: y.string().refine(lt, "Expected gradient arguments such as 135deg, #2563EB, #7C3AED")
|
|
215
795
|
});
|
|
216
|
-
function
|
|
796
|
+
function V(e, { defaults: t, typeAttribute: n } = {}) {
|
|
217
797
|
return [
|
|
218
798
|
{
|
|
219
799
|
key: "backgroundType",
|
|
220
800
|
...n ? { attribute: n } : {},
|
|
221
|
-
value:
|
|
801
|
+
value: y.enum(["color", "gradient"]),
|
|
222
802
|
defaultValue: t?.backgroundType,
|
|
223
803
|
label: "Background type"
|
|
224
804
|
},
|
|
225
|
-
{
|
|
805
|
+
L({
|
|
226
806
|
key: "backgroundColor",
|
|
227
807
|
variable: `${e}-background-color`,
|
|
228
|
-
value: C,
|
|
229
808
|
defaultValue: t?.backgroundColor,
|
|
230
809
|
label: "Background color"
|
|
231
|
-
},
|
|
810
|
+
}),
|
|
232
811
|
{
|
|
233
812
|
key: "backgroundGradient",
|
|
234
813
|
variable: `${e}-background-image`,
|
|
235
|
-
value:
|
|
814
|
+
value: ln,
|
|
236
815
|
defaultValue: t?.backgroundGradient,
|
|
237
816
|
label: "Background gradient"
|
|
238
817
|
}
|
|
239
818
|
];
|
|
240
819
|
}
|
|
241
|
-
// src/schema/device/devices.ts
|
|
242
|
-
var T = [
|
|
243
|
-
{
|
|
244
|
-
name: "Desktop",
|
|
245
|
-
icon: "Monitor",
|
|
246
|
-
portrait: {
|
|
247
|
-
width: 1280,
|
|
248
|
-
height: "auto"
|
|
249
|
-
}
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
name: "Tablet",
|
|
253
|
-
icon: "Tablet",
|
|
254
|
-
portrait: {
|
|
255
|
-
width: 768,
|
|
256
|
-
height: "auto"
|
|
257
|
-
},
|
|
258
|
-
landscape: {
|
|
259
|
-
width: 1024,
|
|
260
|
-
height: 768
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
name: "Mobile",
|
|
265
|
-
icon: "Smartphone",
|
|
266
|
-
portrait: {
|
|
267
|
-
width: 360,
|
|
268
|
-
height: "auto"
|
|
269
|
-
},
|
|
270
|
-
landscape: {
|
|
271
|
-
width: 640,
|
|
272
|
-
height: 360
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
], He = T.map(({ portrait: e, icon: t, name: n }) => ({
|
|
276
|
-
...e,
|
|
277
|
-
icon: t,
|
|
278
|
-
label: n
|
|
279
|
-
}));
|
|
280
|
-
function Ue(e) {
|
|
281
|
-
return T.find((t) => t.portrait.width === e || t.landscape?.width === e) ?? T[0];
|
|
282
|
-
}
|
|
283
|
-
function We(e) {
|
|
284
|
-
return Ue(e).landscape?.width === e ? "landscape" : "portrait";
|
|
285
|
-
}
|
|
286
|
-
// src/schema/deviceVisibility.ts
|
|
287
|
-
var E = {
|
|
288
|
-
Desktop: "showOnDesktop",
|
|
289
|
-
Tablet: "showOnTablet",
|
|
290
|
-
Mobile: "showOnMobile"
|
|
291
|
-
}, Ge = {
|
|
292
|
-
Tablet: "showOnTabletLandscape",
|
|
293
|
-
Mobile: "showOnMobileLandscape"
|
|
294
|
-
}, Ke = [...Object.values(E), ...Object.values(Ge)], qe = T.flatMap(({ name: e, landscape: t }) => t ? [{
|
|
295
|
-
device: e,
|
|
296
|
-
orientation: "portrait"
|
|
297
|
-
}, {
|
|
298
|
-
device: e,
|
|
299
|
-
orientation: "landscape"
|
|
300
|
-
}] : [{
|
|
301
|
-
device: e,
|
|
302
|
-
orientation: "portrait"
|
|
303
|
-
}]);
|
|
304
|
-
function Je(e, t) {
|
|
305
|
-
return (t === "landscape" ? Ge[e] : void 0) ?? E[e];
|
|
306
|
-
}
|
|
307
|
-
function D(e, t, n = "portrait") {
|
|
308
|
-
let r = e[Je(t, n)];
|
|
309
|
-
return r === void 0 ? e[E[t]] !== !1 : r;
|
|
310
|
-
}
|
|
311
|
-
function Ye(e) {
|
|
312
|
-
return qe.filter(({ device: t, orientation: n }) => D(e, t, n)).length;
|
|
313
|
-
}
|
|
314
|
-
// src/schema/styleItems.ts
|
|
315
|
-
var Xe = d.strictObject({
|
|
316
|
-
key: d.string(),
|
|
317
|
-
variable: d.string().optional(),
|
|
318
|
-
variables: d.record(d.string(), d.string()).optional(),
|
|
319
|
-
attribute: d.string().optional(),
|
|
320
|
-
value: d.unknown()
|
|
321
|
-
}), Ze = [
|
|
322
|
-
"variable",
|
|
323
|
-
"variables",
|
|
324
|
-
"attribute"
|
|
325
|
-
];
|
|
326
|
-
function Qe(e) {
|
|
327
|
-
let t = {};
|
|
328
|
-
for (let n of e) n.defaultValue !== void 0 && (t[n.key] = n.defaultValue);
|
|
329
|
-
return t;
|
|
330
|
-
}
|
|
331
|
-
function $e(e, t) {
|
|
332
|
-
return Ze.find((n) => JSON.stringify(e[n]) !== JSON.stringify(t[n]));
|
|
333
|
-
}
|
|
334
|
-
function et(e, t, n) {
|
|
335
|
-
if (!t) return {
|
|
336
|
-
field: "key",
|
|
337
|
-
message: `Unknown style key "${e.key}"`
|
|
338
|
-
};
|
|
339
|
-
if (n.has(e.key)) return {
|
|
340
|
-
field: "key",
|
|
341
|
-
message: `Style key "${e.key}" appears twice`
|
|
342
|
-
};
|
|
343
|
-
let r = $e(e, t);
|
|
344
|
-
if (r) return {
|
|
345
|
-
field: r,
|
|
346
|
-
message: `Style "${e.key}" ${r} does not match the element configuration`
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
function O(e) {
|
|
350
|
-
return nt(e, () => Qe(e));
|
|
351
|
-
}
|
|
352
|
-
function tt(e) {
|
|
353
|
-
return nt(e, () => ({}));
|
|
354
|
-
}
|
|
355
|
-
function nt(e, t) {
|
|
356
|
-
let n = new Map(e.map((e) => [e.key, e]));
|
|
357
|
-
return d.array(Xe).default([]).transform((e, r) => {
|
|
358
|
-
let i = t(), a = /* @__PURE__ */ new Set();
|
|
359
|
-
return e.forEach((e, t) => {
|
|
360
|
-
let o = n.get(e.key), s = et(e, o, a);
|
|
361
|
-
if (s || !o) {
|
|
362
|
-
r.addIssue({
|
|
363
|
-
code: "custom",
|
|
364
|
-
path: [t, s?.field ?? "key"],
|
|
365
|
-
message: s?.message ?? ""
|
|
366
|
-
});
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
a.add(e.key);
|
|
370
|
-
let c = o.value.safeParse(e.value);
|
|
371
|
-
if (c.success) i[e.key] = c.data;
|
|
372
|
-
else {
|
|
373
|
-
let e = c.error.issues[0]?.message ?? "Invalid value";
|
|
374
|
-
r.addIssue({
|
|
375
|
-
code: "custom",
|
|
376
|
-
path: [t, "value"],
|
|
377
|
-
message: e
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
}), i;
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
function rt(e, t) {
|
|
384
|
-
let n = Object.fromEntries(Ze.filter((t) => e[t] !== void 0).map((t) => [t, e[t]]));
|
|
385
|
-
return {
|
|
386
|
-
key: e.key,
|
|
387
|
-
...n,
|
|
388
|
-
value: t
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
function k(e, t = "") {
|
|
392
|
-
return Object.fromEntries(e.flatMap(({ key: e, label: n }) => n === void 0 ? [] : [[`${t}${e}`, n]]));
|
|
393
|
-
}
|
|
394
|
-
function A(e, t) {
|
|
395
|
-
return at({
|
|
396
|
-
...Qe(t),
|
|
397
|
-
...e
|
|
398
|
-
}, t);
|
|
399
|
-
}
|
|
400
|
-
function it(e, t) {
|
|
401
|
-
return at(e ?? {}, t);
|
|
402
|
-
}
|
|
403
|
-
function at(e, t) {
|
|
404
|
-
return t.filter((t) => e[t.key] !== void 0).map((t) => rt(t, e[t.key]));
|
|
405
|
-
}
|
|
406
|
-
// src/schema/deviceSettings.ts
|
|
407
|
-
var j = [
|
|
408
|
-
{
|
|
409
|
-
prop: "tabletStyle",
|
|
410
|
-
device: "Tablet"
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
prop: "mobileStyle",
|
|
414
|
-
device: "Mobile"
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
prop: "tabletLandscapeStyle",
|
|
418
|
-
device: "Landscape tablet"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
prop: "mobileLandscapeStyle",
|
|
422
|
-
device: "Landscape mobile"
|
|
423
|
-
}
|
|
424
|
-
], ot = {
|
|
425
|
-
showOnDesktop: "Show on desktop",
|
|
426
|
-
showOnTablet: "Show on portrait tablet",
|
|
427
|
-
showOnTabletLandscape: "Show on landscape tablet",
|
|
428
|
-
showOnMobile: "Show on portrait mobile",
|
|
429
|
-
showOnMobileLandscape: "Show on landscape mobile"
|
|
430
|
-
}, st = Object.fromEntries(Ke.map((e) => [e, d.boolean().optional()]));
|
|
431
|
-
function ct(e) {
|
|
432
|
-
let t = e ? Object.fromEntries(j.map(({ prop: t }) => [t, tt(e).optional()])) : {};
|
|
433
|
-
return d.strictObject({
|
|
434
|
-
...st,
|
|
435
|
-
...t
|
|
436
|
-
}).refine((e) => Ye(e) > 0, {
|
|
437
|
-
path: ["showOnDesktop"],
|
|
438
|
-
message: "Show the element on at least one device"
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
function lt(e, t, n) {
|
|
442
|
-
return Object.fromEntries(Object.entries(e).filter(([e]) => t.has(e) === n));
|
|
443
|
-
}
|
|
444
|
-
function ut(e, t) {
|
|
445
|
-
let n = new Set(Object.keys(t.shape));
|
|
446
|
-
return d.record(d.string(), d.unknown()).transform((r, i) => {
|
|
447
|
-
let a = e.safeParse(lt(r, n, !1)), o = t.safeParse(lt(r, n, !0));
|
|
448
|
-
for (let e of [...a.error?.issues ?? [], ...o.error?.issues ?? []]) i.addIssue({
|
|
449
|
-
code: "custom",
|
|
450
|
-
path: e.path,
|
|
451
|
-
message: e.message
|
|
452
|
-
});
|
|
453
|
-
return !a.success || !o.success ? d.NEVER : {
|
|
454
|
-
...a.data,
|
|
455
|
-
...dt(o.data)
|
|
456
|
-
};
|
|
457
|
-
});
|
|
458
|
-
}
|
|
459
|
-
function dt(e) {
|
|
460
|
-
return Object.fromEntries(Object.entries(e).filter(([, e]) => !ft(e)));
|
|
461
|
-
}
|
|
462
|
-
function ft(e) {
|
|
463
|
-
return e === void 0 || typeof e == "object" && !!e && Object.keys(e).length === 0;
|
|
464
|
-
}
|
|
465
|
-
function pt(e) {
|
|
466
|
-
return Object.fromEntries(qe.flatMap(({ device: t, orientation: n }) => {
|
|
467
|
-
let r = D(e, t, n);
|
|
468
|
-
return (n === "portrait" ? !r : r !== D(e, t, "portrait")) ? [[Je(t, n), r]] : [];
|
|
469
|
-
}));
|
|
470
|
-
}
|
|
471
|
-
function mt(e, t) {
|
|
472
|
-
return Object.fromEntries(j.flatMap(({ prop: n }) => {
|
|
473
|
-
let r = it(e[n], t);
|
|
474
|
-
return r.length > 0 ? [[n, r]] : [];
|
|
475
|
-
}));
|
|
476
|
-
}
|
|
477
|
-
function ht(e) {
|
|
478
|
-
return `${e.charAt(0).toLowerCase()}${e.slice(1)}`;
|
|
479
|
-
}
|
|
480
|
-
function gt(e) {
|
|
481
|
-
return Object.fromEntries(j.flatMap(({ prop: t, device: n }) => Object.entries(k(e, `${t}.`)).map(([e, t]) => [e, `${n} ${ht(t)}`])));
|
|
482
|
-
}
|
|
483
|
-
function M(e, t) {
|
|
484
|
-
return {
|
|
485
|
-
...e,
|
|
486
|
-
attributes: ut(e.attributes, ct(t)),
|
|
487
|
-
toDocumentAttributes: (n) => ({
|
|
488
|
-
...e.toDocumentAttributes(n),
|
|
489
|
-
...pt(n),
|
|
490
|
-
...t ? mt(n, t) : {}
|
|
491
|
-
}),
|
|
492
|
-
history: {
|
|
493
|
-
summary: e.history.summary,
|
|
494
|
-
attributes: {
|
|
495
|
-
...e.history.attributes,
|
|
496
|
-
...ot,
|
|
497
|
-
...t ? gt(t) : {}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
// src/schema/addressSchema.ts
|
|
503
|
-
var _t = "Enter an https:// address or a path that starts with /";
|
|
504
|
-
function vt(e) {
|
|
505
|
-
if (e.startsWith("/")) return !e.startsWith("//") && !e.startsWith("/\\");
|
|
506
|
-
try {
|
|
507
|
-
let { protocol: t } = new URL(e);
|
|
508
|
-
return t === "https:" || t === "http:";
|
|
509
|
-
} catch {
|
|
510
|
-
return !1;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
var N = d.string().trim().min(1, _t).refine(vt, _t), yt = ["_self", "_blank"], P = {
|
|
514
|
-
href: "",
|
|
515
|
-
target: "_self",
|
|
516
|
-
description: ""
|
|
517
|
-
}, F = {
|
|
518
|
-
href: d.string().trim().pipe(d.union([d.literal(""), N])).default(P.href),
|
|
519
|
-
target: d.enum(yt).default(P.target),
|
|
520
|
-
description: d.string().trim().default(P.description)
|
|
521
|
-
}, I = {
|
|
522
|
-
href: "Link address",
|
|
523
|
-
target: "Link target",
|
|
524
|
-
description: "Link description"
|
|
525
|
-
};
|
|
526
|
-
function L({ href: e, target: t, description: n }) {
|
|
527
|
-
return e === "" ? {} : {
|
|
528
|
-
href: e,
|
|
529
|
-
...t === P.target ? {} : { target: t },
|
|
530
|
-
...n === "" ? {} : { description: n }
|
|
531
|
-
};
|
|
532
|
-
}
|
|
533
|
-
// src/elements/rich-text/richTextMarks.ts
|
|
534
|
-
var bt = /^[A-Za-z0-9][A-Za-z0-9 ]*$/;
|
|
535
|
-
function xt(e) {
|
|
536
|
-
return typeof e == "string" && bt.test(e);
|
|
537
|
-
}
|
|
538
820
|
// src/schema/elementStyleDefinitions.ts
|
|
539
|
-
var
|
|
821
|
+
var H = [
|
|
540
822
|
[
|
|
541
823
|
"width",
|
|
542
824
|
"width",
|
|
@@ -580,12 +862,12 @@ var R = [
|
|
|
580
862
|
[
|
|
581
863
|
"paddingLeft",
|
|
582
864
|
"padding-left",
|
|
583
|
-
"Padding
|
|
865
|
+
"Padding start"
|
|
584
866
|
],
|
|
585
867
|
[
|
|
586
868
|
"paddingRight",
|
|
587
869
|
"padding-right",
|
|
588
|
-
"Padding
|
|
870
|
+
"Padding end"
|
|
589
871
|
],
|
|
590
872
|
[
|
|
591
873
|
"marginTop",
|
|
@@ -600,12 +882,12 @@ var R = [
|
|
|
600
882
|
[
|
|
601
883
|
"marginLeft",
|
|
602
884
|
"margin-left",
|
|
603
|
-
"Margin
|
|
885
|
+
"Margin start"
|
|
604
886
|
],
|
|
605
887
|
[
|
|
606
888
|
"marginRight",
|
|
607
889
|
"margin-right",
|
|
608
|
-
"Margin
|
|
890
|
+
"Margin end"
|
|
609
891
|
],
|
|
610
892
|
[
|
|
611
893
|
"borderRadiusTopLeft",
|
|
@@ -628,14 +910,14 @@ var R = [
|
|
|
628
910
|
"Radius bottom left"
|
|
629
911
|
]
|
|
630
912
|
];
|
|
631
|
-
function
|
|
913
|
+
function un(e) {
|
|
632
914
|
let t = `--palmyit-${e}`, n = {
|
|
633
915
|
key: "gridColumns",
|
|
634
916
|
variable: `${t}-grid-template-columns`,
|
|
635
|
-
value:
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
917
|
+
value: y.union([
|
|
918
|
+
y.literal(2),
|
|
919
|
+
y.literal(3),
|
|
920
|
+
y.literal(4)
|
|
639
921
|
]),
|
|
640
922
|
label: "Grid columns"
|
|
641
923
|
};
|
|
@@ -644,7 +926,7 @@ function St(e) {
|
|
|
644
926
|
key: "layout",
|
|
645
927
|
variable: `${t}-display`,
|
|
646
928
|
attribute: "data-layout",
|
|
647
|
-
value:
|
|
929
|
+
value: y.enum([
|
|
648
930
|
"block",
|
|
649
931
|
"flex",
|
|
650
932
|
"grid"
|
|
@@ -653,64 +935,64 @@ function St(e) {
|
|
|
653
935
|
label: "Layout"
|
|
654
936
|
},
|
|
655
937
|
n,
|
|
656
|
-
...
|
|
938
|
+
...dn(e)
|
|
657
939
|
];
|
|
658
940
|
}
|
|
659
|
-
function
|
|
941
|
+
function dn(e) {
|
|
660
942
|
let t = `--palmyit-${e}`;
|
|
661
943
|
return [
|
|
662
944
|
{
|
|
663
945
|
key: "flexDirection",
|
|
664
946
|
variable: `${t}-flex-direction`,
|
|
665
|
-
value:
|
|
666
|
-
defaultValue:
|
|
947
|
+
value: y.enum(yt),
|
|
948
|
+
defaultValue: M.flexDirection,
|
|
667
949
|
label: "Direction"
|
|
668
950
|
},
|
|
669
951
|
{
|
|
670
952
|
key: "flexWrap",
|
|
671
953
|
variable: `${t}-flex-wrap`,
|
|
672
|
-
value:
|
|
673
|
-
defaultValue:
|
|
954
|
+
value: y.enum(bt),
|
|
955
|
+
defaultValue: M.flexWrap,
|
|
674
956
|
label: "Wrap"
|
|
675
957
|
},
|
|
676
958
|
{
|
|
677
959
|
key: "justifyContent",
|
|
678
960
|
variable: `${t}-justify-content`,
|
|
679
|
-
value:
|
|
680
|
-
defaultValue:
|
|
961
|
+
value: y.enum(xt),
|
|
962
|
+
defaultValue: M.justifyContent,
|
|
681
963
|
label: "Justify"
|
|
682
964
|
},
|
|
683
965
|
{
|
|
684
966
|
key: "alignItems",
|
|
685
967
|
variable: `${t}-align-items`,
|
|
686
|
-
value:
|
|
687
|
-
defaultValue:
|
|
968
|
+
value: y.enum(St),
|
|
969
|
+
defaultValue: M.alignItems,
|
|
688
970
|
label: "Align items"
|
|
689
971
|
},
|
|
690
972
|
{
|
|
691
973
|
key: "alignContent",
|
|
692
974
|
variable: `${t}-align-content`,
|
|
693
|
-
value:
|
|
694
|
-
defaultValue:
|
|
975
|
+
value: y.enum(Ct),
|
|
976
|
+
defaultValue: M.alignContent,
|
|
695
977
|
label: "Align content"
|
|
696
978
|
},
|
|
697
979
|
{
|
|
698
980
|
key: "rowGap",
|
|
699
981
|
variable: `${t}-row-gap`,
|
|
700
|
-
value:
|
|
701
|
-
defaultValue:
|
|
982
|
+
value: I,
|
|
983
|
+
defaultValue: M.rowGap,
|
|
702
984
|
label: "Row gap"
|
|
703
985
|
},
|
|
704
986
|
{
|
|
705
987
|
key: "columnGap",
|
|
706
988
|
variable: `${t}-column-gap`,
|
|
707
|
-
value:
|
|
708
|
-
defaultValue:
|
|
989
|
+
value: I,
|
|
990
|
+
defaultValue: M.columnGap,
|
|
709
991
|
label: "Column gap"
|
|
710
992
|
}
|
|
711
993
|
];
|
|
712
994
|
}
|
|
713
|
-
function
|
|
995
|
+
function fn(e, t) {
|
|
714
996
|
let n = `--palmyit-${e}`;
|
|
715
997
|
return [
|
|
716
998
|
{
|
|
@@ -719,175 +1001,417 @@ function wt(e, t) {
|
|
|
719
1001
|
x: `${n}-overflow-x`,
|
|
720
1002
|
y: `${n}-overflow-y`
|
|
721
1003
|
},
|
|
722
|
-
value:
|
|
1004
|
+
value: y.enum(["show", "hide"]),
|
|
723
1005
|
defaultValue: t.overflow,
|
|
724
1006
|
label: "Overflowing contents"
|
|
725
1007
|
},
|
|
726
1008
|
{
|
|
727
1009
|
key: "overflowHorizontal",
|
|
728
1010
|
variable: `${n}-overflow-x`,
|
|
729
|
-
value:
|
|
1011
|
+
value: y.boolean(),
|
|
730
1012
|
defaultValue: t.overflowHorizontal,
|
|
731
1013
|
label: "Horizontal overflow"
|
|
732
1014
|
},
|
|
733
1015
|
{
|
|
734
1016
|
key: "overflowVertical",
|
|
735
1017
|
variable: `${n}-overflow-y`,
|
|
736
|
-
value:
|
|
1018
|
+
value: y.boolean(),
|
|
737
1019
|
defaultValue: t.overflowVertical,
|
|
738
1020
|
label: "Vertical overflow"
|
|
739
1021
|
}
|
|
740
1022
|
];
|
|
741
1023
|
}
|
|
742
|
-
function
|
|
743
|
-
return
|
|
1024
|
+
function pn(e, t) {
|
|
1025
|
+
return H.map(([n, r, i]) => ({
|
|
744
1026
|
key: n,
|
|
745
1027
|
variable: `--palmyit-${e}-${r}`,
|
|
746
|
-
value:
|
|
1028
|
+
value: I,
|
|
747
1029
|
defaultValue: t[n],
|
|
748
1030
|
label: i
|
|
749
1031
|
}));
|
|
750
1032
|
}
|
|
751
|
-
function
|
|
1033
|
+
function mn(e, t) {
|
|
752
1034
|
let n = `--palmyit-${e}`;
|
|
753
1035
|
return [
|
|
754
1036
|
{
|
|
755
1037
|
key: "borderWidth",
|
|
756
1038
|
variable: `${n}-border-width`,
|
|
757
|
-
value:
|
|
1039
|
+
value: Bt,
|
|
758
1040
|
defaultValue: t.borderWidth,
|
|
759
1041
|
label: "Border width"
|
|
760
1042
|
},
|
|
761
1043
|
{
|
|
762
1044
|
key: "borderStyle",
|
|
763
1045
|
variable: `${n}-border-style`,
|
|
764
|
-
value:
|
|
1046
|
+
value: y.enum(vt),
|
|
765
1047
|
defaultValue: t.borderStyle,
|
|
766
1048
|
label: "Border style"
|
|
767
1049
|
},
|
|
768
|
-
{
|
|
769
|
-
key: "borderColor",
|
|
770
|
-
variable: `${n}-border-color`,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
1050
|
+
L({
|
|
1051
|
+
key: "borderColor",
|
|
1052
|
+
variable: `${n}-border-color`,
|
|
1053
|
+
defaultValue: t.borderColor,
|
|
1054
|
+
label: "Border color"
|
|
1055
|
+
})
|
|
1056
|
+
];
|
|
1057
|
+
}
|
|
1058
|
+
function hn(e, t) {
|
|
1059
|
+
return [
|
|
1060
|
+
...un(e),
|
|
1061
|
+
...fn(e, t),
|
|
1062
|
+
...pn(e, t),
|
|
1063
|
+
...mn(e, t),
|
|
1064
|
+
...V(`--palmyit-${e}`, { defaults: t })
|
|
1065
|
+
];
|
|
1066
|
+
}
|
|
1067
|
+
function gn(e, t) {
|
|
1068
|
+
return D(e).transform((e) => ({
|
|
1069
|
+
...t,
|
|
1070
|
+
...e
|
|
1071
|
+
})).superRefine((e, t) => {
|
|
1072
|
+
e.layout === "grid" && e.gridColumns == null && t.addIssue({
|
|
1073
|
+
code: "custom",
|
|
1074
|
+
path: ["gridColumns"],
|
|
1075
|
+
message: "A grid layout needs 2, 3, or 4 columns"
|
|
1076
|
+
});
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
// src/elements/image/definition.ts
|
|
1080
|
+
var _n = [
|
|
1081
|
+
"width",
|
|
1082
|
+
"height",
|
|
1083
|
+
"minWidth",
|
|
1084
|
+
"minHeight",
|
|
1085
|
+
"maxWidth",
|
|
1086
|
+
"maxHeight"
|
|
1087
|
+
], vn = [
|
|
1088
|
+
"borderRadiusTopLeft",
|
|
1089
|
+
"borderRadiusTopRight",
|
|
1090
|
+
"borderRadiusBottomRight",
|
|
1091
|
+
"borderRadiusBottomLeft"
|
|
1092
|
+
], yn = [..._n, ...vn], bn = [
|
|
1093
|
+
"auto",
|
|
1094
|
+
"square",
|
|
1095
|
+
"video",
|
|
1096
|
+
"3/4",
|
|
1097
|
+
"4/3"
|
|
1098
|
+
], xn = ["cover", "contain"], Sn = [
|
|
1099
|
+
"center",
|
|
1100
|
+
"top",
|
|
1101
|
+
"bottom",
|
|
1102
|
+
"left",
|
|
1103
|
+
"right",
|
|
1104
|
+
"left-top",
|
|
1105
|
+
"right-top",
|
|
1106
|
+
"left-bottom",
|
|
1107
|
+
"right-bottom"
|
|
1108
|
+
], Cn = [
|
|
1109
|
+
"none",
|
|
1110
|
+
"sm",
|
|
1111
|
+
"md",
|
|
1112
|
+
"lg",
|
|
1113
|
+
"xl"
|
|
1114
|
+
], wn = ["start", "center"], U = {
|
|
1115
|
+
src: "/image-placeholder.svg",
|
|
1116
|
+
alt: "",
|
|
1117
|
+
priority: !1,
|
|
1118
|
+
caption: "",
|
|
1119
|
+
decorative: !1,
|
|
1120
|
+
intrinsicWidth: null,
|
|
1121
|
+
intrinsicHeight: null,
|
|
1122
|
+
tabletSrc: "",
|
|
1123
|
+
mobileSrc: "",
|
|
1124
|
+
aspectRatio: "auto",
|
|
1125
|
+
objectFit: "",
|
|
1126
|
+
objectPosition: "center",
|
|
1127
|
+
shadow: "none",
|
|
1128
|
+
captionAlign: "start",
|
|
1129
|
+
style: {},
|
|
1130
|
+
...d
|
|
1131
|
+
}, W = "--palmyit-image";
|
|
1132
|
+
function Tn(e) {
|
|
1133
|
+
return H.filter(([t]) => e.includes(t)).map(([e, t, n]) => ({
|
|
1134
|
+
key: e,
|
|
1135
|
+
variable: `${W}-${t}`,
|
|
1136
|
+
value: I,
|
|
1137
|
+
label: n
|
|
1138
|
+
}));
|
|
1139
|
+
}
|
|
1140
|
+
var G = [
|
|
1141
|
+
...Tn(_n),
|
|
1142
|
+
...V(W, { typeAttribute: "data-background" }),
|
|
1143
|
+
{
|
|
1144
|
+
key: "borderWidth",
|
|
1145
|
+
variable: `${W}-border-width`,
|
|
1146
|
+
value: Bt,
|
|
1147
|
+
label: "Border width"
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
key: "borderStyle",
|
|
1151
|
+
variable: `${W}-border-style`,
|
|
1152
|
+
value: y.enum(vt),
|
|
1153
|
+
label: "Border style"
|
|
1154
|
+
},
|
|
1155
|
+
L({
|
|
1156
|
+
key: "borderColor",
|
|
1157
|
+
variable: `${W}-border-color`,
|
|
1158
|
+
label: "Border color"
|
|
1159
|
+
}),
|
|
1160
|
+
...Tn(vn)
|
|
1161
|
+
], En = y.string().trim().pipe(y.union([y.literal(""), v])).default(""), Dn = y.number().int().positive().nullable().default(null), On = k(x({
|
|
1162
|
+
type: "PImage",
|
|
1163
|
+
label: "Image",
|
|
1164
|
+
allowedChildren: [],
|
|
1165
|
+
templates: [],
|
|
1166
|
+
attributes: y.strictObject({
|
|
1167
|
+
id: b,
|
|
1168
|
+
src: v.default(U.src),
|
|
1169
|
+
alt: y.string().trim().default(U.alt),
|
|
1170
|
+
priority: y.boolean().default(U.priority),
|
|
1171
|
+
caption: y.string().trim().default(U.caption),
|
|
1172
|
+
decorative: y.boolean().default(U.decorative),
|
|
1173
|
+
intrinsicWidth: Dn,
|
|
1174
|
+
intrinsicHeight: Dn,
|
|
1175
|
+
tabletSrc: En,
|
|
1176
|
+
mobileSrc: En,
|
|
1177
|
+
aspectRatio: y.enum(bn).default(U.aspectRatio),
|
|
1178
|
+
objectFit: y.union([y.literal(""), y.enum(xn)]).default(U.objectFit),
|
|
1179
|
+
objectPosition: y.enum(Sn).default(U.objectPosition),
|
|
1180
|
+
shadow: y.enum(Cn).default(U.shadow),
|
|
1181
|
+
captionAlign: y.enum(wn).default(U.captionAlign),
|
|
1182
|
+
style: D(G).transform((e) => e),
|
|
1183
|
+
...t
|
|
1184
|
+
}).refine(({ decorative: e, alt: t, src: n }) => e || t !== "" || n === U.src, {
|
|
1185
|
+
path: ["alt"],
|
|
1186
|
+
message: "Describe the image, or mark it decorative"
|
|
1187
|
+
}).refine(({ href: e, alt: t, decorative: n }) => e === "" || n || t !== "", {
|
|
1188
|
+
path: ["alt"],
|
|
1189
|
+
message: "Describe a linked image so the link has a name"
|
|
1190
|
+
}),
|
|
1191
|
+
toDocumentAttributes: ({ id: e, src: t, alt: n, priority: r, caption: i, decorative: a, intrinsicWidth: o, intrinsicHeight: s, tabletSrc: c, mobileSrc: l, aspectRatio: u, objectFit: d, objectPosition: f, shadow: p, captionAlign: m, style: h, href: g, target: ee, description: te, rel: ne }) => ({
|
|
1192
|
+
id: e,
|
|
1193
|
+
src: t,
|
|
1194
|
+
alt: n,
|
|
1195
|
+
...r ? { priority: !0 } : {},
|
|
1196
|
+
...i === "" ? {} : { caption: i },
|
|
1197
|
+
...a ? { decorative: !0 } : {},
|
|
1198
|
+
...o == null ? {} : { intrinsicWidth: o },
|
|
1199
|
+
...s == null ? {} : { intrinsicHeight: s },
|
|
1200
|
+
...c === "" ? {} : { tabletSrc: c },
|
|
1201
|
+
...l === "" ? {} : { mobileSrc: l },
|
|
1202
|
+
...u === U.aspectRatio ? {} : { aspectRatio: u },
|
|
1203
|
+
...d === "" ? {} : { objectFit: d },
|
|
1204
|
+
...f === U.objectPosition ? {} : { objectPosition: f },
|
|
1205
|
+
...p === U.shadow ? {} : { shadow: p },
|
|
1206
|
+
...m === U.captionAlign ? {} : { captionAlign: m },
|
|
1207
|
+
...E(T(h, G)),
|
|
1208
|
+
..._({
|
|
1209
|
+
href: g,
|
|
1210
|
+
target: ee,
|
|
1211
|
+
description: te,
|
|
1212
|
+
rel: ne
|
|
1213
|
+
})
|
|
1214
|
+
}),
|
|
1215
|
+
history: {
|
|
1216
|
+
summary: ({ alt: e, caption: t, decorative: n }) => n ? "Decorative image" : e || t || "Image",
|
|
1217
|
+
attributes: {
|
|
1218
|
+
src: "Image address",
|
|
1219
|
+
alt: "Description",
|
|
1220
|
+
priority: "Load first",
|
|
1221
|
+
caption: "Caption",
|
|
1222
|
+
decorative: "Decorative",
|
|
1223
|
+
tabletSrc: "Tablet image",
|
|
1224
|
+
mobileSrc: "Mobile image",
|
|
1225
|
+
aspectRatio: "Aspect ratio",
|
|
1226
|
+
objectFit: "Object fit",
|
|
1227
|
+
objectPosition: "Focus point",
|
|
1228
|
+
shadow: "Shadow",
|
|
1229
|
+
captionAlign: "Caption align",
|
|
1230
|
+
...g,
|
|
1231
|
+
...w(G, "style.")
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
}), G), kn = ["vertical", "horizontal"], An = [
|
|
1235
|
+
"2",
|
|
1236
|
+
"3",
|
|
1237
|
+
"4",
|
|
1238
|
+
"none"
|
|
1239
|
+
], K = {
|
|
1240
|
+
title: "Article title",
|
|
1241
|
+
titleLevel: "2",
|
|
1242
|
+
excerpt: "A short summary of the article.",
|
|
1243
|
+
href: "",
|
|
1244
|
+
linkLabel: "Read more",
|
|
1245
|
+
image: "",
|
|
1246
|
+
imageAlt: "",
|
|
1247
|
+
publishedAt: "",
|
|
1248
|
+
author: "",
|
|
1249
|
+
tags: [],
|
|
1250
|
+
layout: "vertical",
|
|
1251
|
+
clickableCard: !1,
|
|
1252
|
+
excerptLines: "3",
|
|
1253
|
+
imageAspect: "video",
|
|
1254
|
+
shadow: "none"
|
|
1255
|
+
}, jn = y.string().trim().pipe(y.union([y.literal(""), v])).default(""), Mn = y.string().trim().pipe(y.union([y.literal(""), l])).default(""), Nn = k(x({
|
|
1256
|
+
type: "PArticle",
|
|
1257
|
+
label: "Article",
|
|
1258
|
+
allowedChildren: [],
|
|
1259
|
+
templates: [],
|
|
1260
|
+
attributes: y.strictObject({
|
|
1261
|
+
id: b,
|
|
1262
|
+
title: y.string().trim().min(1, "Enter a title").default(K.title),
|
|
1263
|
+
titleLevel: y.enum(an).default(K.titleLevel),
|
|
1264
|
+
excerpt: y.string().trim().default(K.excerpt),
|
|
1265
|
+
href: Mn,
|
|
1266
|
+
linkLabel: y.string().trim().default(K.linkLabel),
|
|
1267
|
+
image: jn,
|
|
1268
|
+
imageAlt: y.string().trim().default(K.imageAlt),
|
|
1269
|
+
publishedAt: y.string().trim().default(K.publishedAt),
|
|
1270
|
+
author: y.string().trim().default(K.author),
|
|
1271
|
+
tags: y.array(y.strictObject({ text: y.string().trim().min(1, "Enter tag text") })).default(K.tags),
|
|
1272
|
+
layout: y.enum(kn).default(K.layout),
|
|
1273
|
+
clickableCard: y.boolean().default(K.clickableCard),
|
|
1274
|
+
excerptLines: y.enum(An).default(K.excerptLines),
|
|
1275
|
+
imageAspect: y.enum(bn).default(K.imageAspect),
|
|
1276
|
+
shadow: y.enum(Cn).default(K.shadow)
|
|
1277
|
+
}).refine(({ image: e, imageAlt: t }) => e === "" || t !== "", {
|
|
1278
|
+
path: ["imageAlt"],
|
|
1279
|
+
message: "Describe the cover image"
|
|
1280
|
+
}).refine(({ clickableCard: e, href: t }) => !e || t !== "", {
|
|
1281
|
+
path: ["href"],
|
|
1282
|
+
message: "Add a link for a clickable card"
|
|
1283
|
+
}),
|
|
1284
|
+
toDocumentAttributes: ({ id: e, title: t, titleLevel: n, excerpt: r, href: i, linkLabel: a, image: o, imageAlt: s, publishedAt: c, author: l, tags: u, layout: d, clickableCard: f, excerptLines: p, imageAspect: m, shadow: h }) => ({
|
|
1285
|
+
id: e,
|
|
1286
|
+
title: t,
|
|
1287
|
+
...n === K.titleLevel ? {} : { titleLevel: n },
|
|
1288
|
+
...r === "" ? {} : { excerpt: r },
|
|
1289
|
+
...i === "" ? {} : { href: i },
|
|
1290
|
+
...a === K.linkLabel ? {} : { linkLabel: a },
|
|
1291
|
+
...o === "" ? {} : {
|
|
1292
|
+
image: o,
|
|
1293
|
+
imageAlt: s
|
|
1294
|
+
},
|
|
1295
|
+
...c === "" ? {} : { publishedAt: c },
|
|
1296
|
+
...l === "" ? {} : { author: l },
|
|
1297
|
+
...u.length === 0 ? {} : { tags: j(u) },
|
|
1298
|
+
...d === K.layout ? {} : { layout: d },
|
|
1299
|
+
...f ? { clickableCard: !0 } : {},
|
|
1300
|
+
...p === K.excerptLines ? {} : { excerptLines: p },
|
|
1301
|
+
...m === K.imageAspect ? {} : { imageAspect: m },
|
|
1302
|
+
...h === K.shadow ? {} : { shadow: h }
|
|
1303
|
+
}),
|
|
1304
|
+
history: {
|
|
1305
|
+
summary: ({ title: e }) => e,
|
|
1306
|
+
attributes: {
|
|
1307
|
+
title: "Title",
|
|
1308
|
+
titleLevel: "Title level",
|
|
1309
|
+
excerpt: "Excerpt",
|
|
1310
|
+
href: "Link",
|
|
1311
|
+
linkLabel: "Link label",
|
|
1312
|
+
image: "Image",
|
|
1313
|
+
imageAlt: "Image description",
|
|
1314
|
+
publishedAt: "Published",
|
|
1315
|
+
author: "Author",
|
|
1316
|
+
tags: "Tags",
|
|
1317
|
+
layout: "Layout",
|
|
1318
|
+
clickableCard: "Clickable card",
|
|
1319
|
+
excerptLines: "Excerpt lines",
|
|
1320
|
+
imageAspect: "Image aspect",
|
|
1321
|
+
shadow: "Shadow"
|
|
774
1322
|
}
|
|
775
|
-
|
|
776
|
-
}
|
|
777
|
-
function
|
|
778
|
-
return
|
|
779
|
-
...St(e),
|
|
780
|
-
...wt(e, t),
|
|
781
|
-
...Tt(e, t),
|
|
782
|
-
...Et(e, t),
|
|
783
|
-
...w(`--palmyit-${e}`, { defaults: t })
|
|
784
|
-
];
|
|
785
|
-
}
|
|
786
|
-
function Ot(e, t) {
|
|
787
|
-
return O(e).transform((e) => ({
|
|
788
|
-
...t,
|
|
789
|
-
...e
|
|
790
|
-
})).superRefine((e, t) => {
|
|
791
|
-
e.layout === "grid" && e.gridColumns == null && t.addIssue({
|
|
792
|
-
code: "custom",
|
|
793
|
-
path: ["gridColumns"],
|
|
794
|
-
message: "A grid layout needs 2, 3, or 4 columns"
|
|
795
|
-
});
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
// src/schema/Fields/IconPicker/iconCatalog.ts
|
|
799
|
-
var kt = /^MdOutline[A-Z0-9]/, At = "";
|
|
800
|
-
function z(e) {
|
|
801
|
-
return kt.test(e);
|
|
1323
|
+
}
|
|
1324
|
+
})), Pn = /* @__PURE__ */ "academic-cap.adjustments-horizontal.adjustments-vertical.archive-box.archive-box-arrow-down.archive-box-x-mark.arrow-down.arrow-down-circle.arrow-down-left.arrow-down-on-square.arrow-down-on-square-stack.arrow-down-right.arrow-down-tray.arrow-left.arrow-left-circle.arrow-left-end-on-rectangle.arrow-left-on-rectangle.arrow-left-start-on-rectangle.arrow-long-down.arrow-long-left.arrow-long-right.arrow-long-up.arrow-path.arrow-path-rounded-square.arrow-right.arrow-right-circle.arrow-right-end-on-rectangle.arrow-right-on-rectangle.arrow-right-start-on-rectangle.arrow-small-down.arrow-small-left.arrow-small-right.arrow-small-up.arrow-top-right-on-square.arrow-trending-down.arrow-trending-up.arrow-turn-down-left.arrow-turn-down-right.arrow-turn-left-down.arrow-turn-left-up.arrow-turn-right-down.arrow-turn-right-up.arrow-turn-up-left.arrow-turn-up-right.arrow-up.arrow-up-circle.arrow-up-left.arrow-up-on-square.arrow-up-on-square-stack.arrow-up-right.arrow-up-tray.arrow-uturn-down.arrow-uturn-left.arrow-uturn-right.arrow-uturn-up.arrows-pointing-in.arrows-pointing-out.arrows-right-left.arrows-up-down.at-symbol.backspace.backward.banknotes.bars-2.bars-3.bars-3-bottom-left.bars-3-bottom-right.bars-3-center-left.bars-4.bars-arrow-down.bars-arrow-up.battery-0.battery-100.battery-50.beaker.bell.bell-alert.bell-slash.bell-snooze.bold.bolt.bolt-slash.book-open.bookmark.bookmark-slash.bookmark-square.briefcase.bug-ant.building-library.building-office.building-office-2.building-storefront.cake.calculator.calendar.calendar-date-range.calendar-days.camera.chart-bar.chart-bar-square.chart-pie.chat-bubble-bottom-center.chat-bubble-bottom-center-text.chat-bubble-left.chat-bubble-left-ellipsis.chat-bubble-left-right.chat-bubble-oval-left.chat-bubble-oval-left-ellipsis.check.check-badge.check-circle.chevron-double-down.chevron-double-left.chevron-double-right.chevron-double-up.chevron-down.chevron-left.chevron-right.chevron-up.chevron-up-down.circle-stack.clipboard.clipboard-document.clipboard-document-check.clipboard-document-list.clock.cloud.cloud-arrow-down.cloud-arrow-up.code-bracket.code-bracket-square.cog.cog-6-tooth.cog-8-tooth.command-line.computer-desktop.cpu-chip.credit-card.cube.cube-transparent.currency-bangladeshi.currency-dollar.currency-euro.currency-pound.currency-rupee.currency-yen.cursor-arrow-rays.cursor-arrow-ripple.device-phone-mobile.device-tablet.divide.document.document-arrow-down.document-arrow-up.document-chart-bar.document-check.document-currency-bangladeshi.document-currency-dollar.document-currency-euro.document-currency-pound.document-currency-rupee.document-currency-yen.document-duplicate.document-magnifying-glass.document-minus.document-plus.document-text.ellipsis-horizontal.ellipsis-horizontal-circle.ellipsis-vertical.envelope.envelope-open.equals.exclamation-circle.exclamation-triangle.eye.eye-dropper.eye-slash.face-frown.face-smile.film.finger-print.fire.flag.folder.folder-arrow-down.folder-minus.folder-open.folder-plus.forward.funnel.gif.gift.gift-top.globe-alt.globe-americas.globe-asia-australia.globe-europe-africa.h1.h2.h3.hand-raised.hand-thumb-down.hand-thumb-up.hashtag.heart.home.home-modern.identification.inbox.inbox-arrow-down.inbox-stack.information-circle.italic.key.language.lifebuoy.light-bulb.link.link-slash.list-bullet.lock-closed.lock-open.magnifying-glass.magnifying-glass-circle.magnifying-glass-minus.magnifying-glass-plus.map.map-pin.megaphone.microphone.minus.minus-circle.minus-small.moon.musical-note.newspaper.no-symbol.numbered-list.paint-brush.paper-airplane.paper-clip.pause.pause-circle.pencil.pencil-square.percent-badge.phone.phone-arrow-down-left.phone-arrow-up-right.phone-x-mark.photo.play.play-circle.play-pause.plus.plus-circle.plus-small.power.presentation-chart-bar.presentation-chart-line.printer.puzzle-piece.qr-code.question-mark-circle.queue-list.radio.receipt-percent.receipt-refund.rectangle-group.rectangle-stack.rocket-launch.rss.scale.scissors.server.server-stack.share.shield-check.shield-exclamation.shopping-bag.shopping-cart.signal.signal-slash.slash.sparkles.speaker-wave.speaker-x-mark.square-2-stack.square-3-stack-3d.squares-2x2.squares-plus.star.stop.stop-circle.strikethrough.sun.swatch.table-cells.tag.ticket.trash.trophy.truck.tv.underline.user.user-circle.user-group.user-minus.user-plus.users.variable.video-camera.video-camera-slash.view-columns.viewfinder-circle.wallet.wifi.window.wrench.wrench-screwdriver.x-circle.x-mark".split("."), Fn = "", In = new Set(Pn);
|
|
1325
|
+
function Ln(e) {
|
|
1326
|
+
return In.has(e);
|
|
802
1327
|
}
|
|
803
|
-
function
|
|
804
|
-
return e.
|
|
1328
|
+
function Rn(e) {
|
|
1329
|
+
return e ? e.split("-").map((e, t) => t === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" ") : "";
|
|
805
1330
|
}
|
|
806
1331
|
// src/elements/button/definition.ts
|
|
807
|
-
var
|
|
1332
|
+
var zn = {
|
|
808
1333
|
name: "Button",
|
|
809
1334
|
startIcon: "",
|
|
810
1335
|
endIcon: "",
|
|
811
|
-
...
|
|
1336
|
+
...d,
|
|
812
1337
|
style: {}
|
|
813
|
-
},
|
|
814
|
-
function
|
|
1338
|
+
}, Bn = y.string().refine((e) => e === "" || Ln(e), "Expected a Heroicons name such as home").default("");
|
|
1339
|
+
function Vn(e, t) {
|
|
815
1340
|
return t === "" ? {} : { [e]: t };
|
|
816
1341
|
}
|
|
817
|
-
var
|
|
818
|
-
...
|
|
1342
|
+
var q = "--palmyit-button", Hn = [
|
|
1343
|
+
...V(q, { typeAttribute: "data-background" }),
|
|
819
1344
|
{
|
|
820
1345
|
key: "borderWidth",
|
|
821
|
-
variable: `${
|
|
822
|
-
value:
|
|
1346
|
+
variable: `${q}-border-width`,
|
|
1347
|
+
value: Bt,
|
|
823
1348
|
label: "Border width"
|
|
824
1349
|
},
|
|
825
1350
|
{
|
|
826
1351
|
key: "borderStyle",
|
|
827
|
-
variable: `${
|
|
828
|
-
value:
|
|
1352
|
+
variable: `${q}-border-style`,
|
|
1353
|
+
value: y.enum(vt),
|
|
829
1354
|
label: "Border style"
|
|
830
1355
|
},
|
|
831
|
-
{
|
|
1356
|
+
L({
|
|
832
1357
|
key: "borderColor",
|
|
833
|
-
variable: `${
|
|
834
|
-
value: C,
|
|
1358
|
+
variable: `${q}-border-color`,
|
|
835
1359
|
label: "Border color"
|
|
836
|
-
},
|
|
837
|
-
...
|
|
1360
|
+
}),
|
|
1361
|
+
...H.map(([e, t, n]) => ({
|
|
838
1362
|
key: e,
|
|
839
|
-
variable: `${
|
|
840
|
-
value:
|
|
1363
|
+
variable: `${q}-${t}`,
|
|
1364
|
+
value: I,
|
|
841
1365
|
label: n
|
|
842
1366
|
})),
|
|
843
|
-
{
|
|
1367
|
+
L({
|
|
844
1368
|
key: "textColor",
|
|
845
|
-
variable: `${
|
|
846
|
-
value: C,
|
|
1369
|
+
variable: `${q}-text-color`,
|
|
847
1370
|
label: "Text color"
|
|
848
|
-
},
|
|
1371
|
+
}),
|
|
849
1372
|
{
|
|
850
1373
|
key: "textFont",
|
|
851
|
-
variable: `${
|
|
852
|
-
value:
|
|
1374
|
+
variable: `${q}-font-family`,
|
|
1375
|
+
value: y.string().refine(ie, "Expected a Google Fonts family name"),
|
|
853
1376
|
label: "Font"
|
|
854
1377
|
},
|
|
855
1378
|
{
|
|
856
1379
|
key: "textSize",
|
|
857
|
-
variable: `${
|
|
858
|
-
value:
|
|
1380
|
+
variable: `${q}-font-size`,
|
|
1381
|
+
value: Vt,
|
|
859
1382
|
label: "Text size"
|
|
860
1383
|
},
|
|
861
1384
|
{
|
|
862
1385
|
key: "iconGap",
|
|
863
|
-
variable: `${
|
|
864
|
-
value:
|
|
1386
|
+
variable: `${q}-gap`,
|
|
1387
|
+
value: I,
|
|
865
1388
|
label: "Icon gap"
|
|
866
1389
|
}
|
|
867
|
-
],
|
|
1390
|
+
], Un = k(x({
|
|
868
1391
|
type: "PButton",
|
|
869
1392
|
label: "Button",
|
|
870
1393
|
allowedChildren: [],
|
|
871
1394
|
templates: [],
|
|
872
|
-
attributes:
|
|
873
|
-
id:
|
|
874
|
-
name:
|
|
875
|
-
startIcon:
|
|
876
|
-
endIcon:
|
|
877
|
-
...
|
|
878
|
-
style:
|
|
1395
|
+
attributes: y.strictObject({
|
|
1396
|
+
id: b,
|
|
1397
|
+
name: y.string().trim().min(1, "Enter a button label").default(zn.name),
|
|
1398
|
+
startIcon: Bn,
|
|
1399
|
+
endIcon: Bn,
|
|
1400
|
+
...t,
|
|
1401
|
+
style: D(Hn).transform((e) => e)
|
|
879
1402
|
}),
|
|
880
|
-
toDocumentAttributes: ({ id: e, name: t, startIcon: n, endIcon: r, href: i, target: a, description: o,
|
|
1403
|
+
toDocumentAttributes: ({ id: e, name: t, startIcon: n, endIcon: r, href: i, target: a, description: o, rel: s, style: c }) => ({
|
|
881
1404
|
id: e,
|
|
882
1405
|
name: t,
|
|
883
|
-
...
|
|
884
|
-
...
|
|
885
|
-
...
|
|
1406
|
+
...Vn("startIcon", n),
|
|
1407
|
+
...Vn("endIcon", r),
|
|
1408
|
+
..._({
|
|
886
1409
|
href: i,
|
|
887
1410
|
target: a,
|
|
888
|
-
description: o
|
|
1411
|
+
description: o,
|
|
1412
|
+
rel: s
|
|
889
1413
|
}),
|
|
890
|
-
|
|
1414
|
+
...E(T(c, Hn))
|
|
891
1415
|
}),
|
|
892
1416
|
history: {
|
|
893
1417
|
summary: ({ name: e }) => e,
|
|
@@ -895,22 +1419,22 @@ var B = "--palmyit-button", V = [
|
|
|
895
1419
|
name: "Label",
|
|
896
1420
|
startIcon: "Start icon",
|
|
897
1421
|
endIcon: "End icon",
|
|
898
|
-
...
|
|
899
|
-
...
|
|
1422
|
+
...g,
|
|
1423
|
+
...w(Hn, "style.")
|
|
900
1424
|
}
|
|
901
1425
|
}
|
|
902
|
-
}),
|
|
1426
|
+
}), Hn), Wn = {
|
|
903
1427
|
label: "Checkbox",
|
|
904
1428
|
checked: !1
|
|
905
|
-
},
|
|
1429
|
+
}, Gn = k(x({
|
|
906
1430
|
type: "PCheckbox",
|
|
907
1431
|
label: "Checkbox input",
|
|
908
1432
|
allowedChildren: [],
|
|
909
1433
|
templates: [],
|
|
910
|
-
attributes:
|
|
911
|
-
id:
|
|
912
|
-
label:
|
|
913
|
-
checked:
|
|
1434
|
+
attributes: y.strictObject({
|
|
1435
|
+
id: b,
|
|
1436
|
+
label: y.string().trim().min(1, "Enter a label").default(Wn.label),
|
|
1437
|
+
checked: y.boolean().default(Wn.checked)
|
|
914
1438
|
}),
|
|
915
1439
|
toDocumentAttributes: ({ id: e, label: t, checked: n }) => ({
|
|
916
1440
|
id: e,
|
|
@@ -926,64 +1450,95 @@ var B = "--palmyit-button", V = [
|
|
|
926
1450
|
}
|
|
927
1451
|
}));
|
|
928
1452
|
// src/schema/layoutElementConfiguration.ts
|
|
929
|
-
function
|
|
930
|
-
let o =
|
|
931
|
-
return
|
|
1453
|
+
function Kn({ type: e, label: t, kind: n, defaultStyle: r, allowedChildren: i, templates: a }) {
|
|
1454
|
+
let o = hn(n, r);
|
|
1455
|
+
return k(x({
|
|
932
1456
|
type: e,
|
|
933
1457
|
label: t,
|
|
934
1458
|
allowedChildren: i,
|
|
935
1459
|
templates: a,
|
|
936
|
-
attributes:
|
|
937
|
-
id:
|
|
938
|
-
style:
|
|
1460
|
+
attributes: y.strictObject({
|
|
1461
|
+
id: b,
|
|
1462
|
+
style: gn(o, r)
|
|
939
1463
|
}),
|
|
940
1464
|
toDocumentAttributes: ({ id: e, style: t }) => ({
|
|
941
1465
|
id: e,
|
|
942
|
-
|
|
1466
|
+
...E(T(t, o))
|
|
943
1467
|
}),
|
|
944
1468
|
history: {
|
|
945
1469
|
summary: () => t,
|
|
946
|
-
attributes:
|
|
1470
|
+
attributes: w(o, "style.")
|
|
947
1471
|
}
|
|
948
1472
|
}), o);
|
|
949
1473
|
}
|
|
950
|
-
// src/schema/
|
|
951
|
-
var
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1474
|
+
// src/schema/elementCategories.ts
|
|
1475
|
+
var qn = ["PPage", "PSection"], Jn = [
|
|
1476
|
+
{
|
|
1477
|
+
id: "basic",
|
|
1478
|
+
title: "Basic",
|
|
1479
|
+
components: [
|
|
1480
|
+
"PButton",
|
|
1481
|
+
"PText",
|
|
1482
|
+
"PHeading",
|
|
1483
|
+
"PRichText",
|
|
1484
|
+
"PImage",
|
|
1485
|
+
"PVideo",
|
|
1486
|
+
"PList",
|
|
1487
|
+
"PIcon",
|
|
1488
|
+
"PDivider"
|
|
1489
|
+
]
|
|
1490
|
+
},
|
|
1491
|
+
{
|
|
1492
|
+
id: "layout",
|
|
1493
|
+
title: "Layout",
|
|
1494
|
+
components: [
|
|
1495
|
+
"PContainer",
|
|
1496
|
+
"PTable",
|
|
1497
|
+
"PArticle",
|
|
1498
|
+
"PNav",
|
|
1499
|
+
"PFooter"
|
|
1500
|
+
]
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
id: "inputs",
|
|
1504
|
+
title: "Inputs",
|
|
1505
|
+
components: [
|
|
1506
|
+
"PTextField",
|
|
1507
|
+
"PTextArea",
|
|
1508
|
+
"PCheckbox",
|
|
1509
|
+
"PRadio"
|
|
1510
|
+
]
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
id: "dropdown",
|
|
1514
|
+
title: "Dropdown",
|
|
1515
|
+
components: ["PSelect"]
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
id: "feedback",
|
|
1519
|
+
title: "Feedback",
|
|
1520
|
+
components: []
|
|
1521
|
+
}
|
|
1522
|
+
], Yn = /* @__PURE__ */ new Set(["PNav", "PFooter"]), Xn = Jn.flatMap(({ components: e }) => e).filter((e) => !Yn.has(e)), Zn = { ...M }, Qn = Kn({
|
|
968
1523
|
type: "PContainer",
|
|
969
1524
|
label: "Container",
|
|
970
1525
|
kind: "container",
|
|
971
|
-
defaultStyle:
|
|
972
|
-
allowedChildren:
|
|
1526
|
+
defaultStyle: Zn,
|
|
1527
|
+
allowedChildren: Xn,
|
|
973
1528
|
templates: []
|
|
974
|
-
}),
|
|
1529
|
+
}), $n = [
|
|
975
1530
|
"1",
|
|
976
1531
|
"2",
|
|
977
1532
|
"3",
|
|
978
1533
|
"4"
|
|
979
|
-
],
|
|
1534
|
+
], er = { size: "4" }, tr = k(x({
|
|
980
1535
|
type: "PDivider",
|
|
981
1536
|
label: "Divider",
|
|
982
1537
|
allowedChildren: [],
|
|
983
1538
|
templates: [],
|
|
984
|
-
attributes:
|
|
985
|
-
id:
|
|
986
|
-
size:
|
|
1539
|
+
attributes: y.strictObject({
|
|
1540
|
+
id: b,
|
|
1541
|
+
size: y.enum($n).default(er.size)
|
|
987
1542
|
}),
|
|
988
1543
|
toDocumentAttributes: ({ id: e, size: t }) => ({
|
|
989
1544
|
id: e,
|
|
@@ -993,156 +1548,387 @@ var W = [
|
|
|
993
1548
|
summary: () => "",
|
|
994
1549
|
attributes: { size: "Width" }
|
|
995
1550
|
}
|
|
996
|
-
})),
|
|
997
|
-
|
|
1551
|
+
})), nr = {
|
|
1552
|
+
...M,
|
|
1553
|
+
layout: "grid",
|
|
1554
|
+
gridColumns: 3
|
|
1555
|
+
}, J = {
|
|
1556
|
+
linkGroups: [],
|
|
1557
|
+
copyright: "© {year} All rights reserved.",
|
|
1558
|
+
address: "",
|
|
1559
|
+
phone: "",
|
|
1560
|
+
email: "",
|
|
1561
|
+
socialLinks: [],
|
|
1562
|
+
style: nr
|
|
1563
|
+
}, rr = y.strictObject({
|
|
1564
|
+
label: y.string().trim().min(1, "Enter a label"),
|
|
1565
|
+
href: l
|
|
1566
|
+
}), ir = y.strictObject({
|
|
1567
|
+
heading: y.string().trim().min(1, "Enter a heading"),
|
|
1568
|
+
items: y.array(rr).min(1, "Add a link")
|
|
1569
|
+
}), ar = y.strictObject({
|
|
1570
|
+
network: y.enum(oe),
|
|
1571
|
+
href: l
|
|
1572
|
+
}), or = hn("footer", nr), sr = k(x({
|
|
1573
|
+
type: "PFooter",
|
|
1574
|
+
label: "Footer",
|
|
1575
|
+
allowedChildren: Xn,
|
|
1576
|
+
templates: [
|
|
1577
|
+
{
|
|
1578
|
+
name: "Minimal copyright",
|
|
1579
|
+
shortcode: JSON.stringify({
|
|
1580
|
+
copyright: "© {year} All rights reserved.",
|
|
1581
|
+
linkGroups: [],
|
|
1582
|
+
socialLinks: [],
|
|
1583
|
+
address: "",
|
|
1584
|
+
phone: "",
|
|
1585
|
+
email: ""
|
|
1586
|
+
})
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
name: "Link columns",
|
|
1590
|
+
shortcode: JSON.stringify({
|
|
1591
|
+
copyright: "© {year} All rights reserved.",
|
|
1592
|
+
linkGroups: [{
|
|
1593
|
+
heading: "Company",
|
|
1594
|
+
items: [{
|
|
1595
|
+
label: "About",
|
|
1596
|
+
href: "/about"
|
|
1597
|
+
}, {
|
|
1598
|
+
label: "Contact",
|
|
1599
|
+
href: "/contact"
|
|
1600
|
+
}]
|
|
1601
|
+
}, {
|
|
1602
|
+
heading: "Resources",
|
|
1603
|
+
items: [{
|
|
1604
|
+
label: "Blog",
|
|
1605
|
+
href: "/blog"
|
|
1606
|
+
}, {
|
|
1607
|
+
label: "Help",
|
|
1608
|
+
href: "/help"
|
|
1609
|
+
}]
|
|
1610
|
+
}]
|
|
1611
|
+
})
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
name: "Contact + social",
|
|
1615
|
+
shortcode: JSON.stringify({
|
|
1616
|
+
copyright: "© {year} All rights reserved.",
|
|
1617
|
+
address: "123 Main Street",
|
|
1618
|
+
phone: "+1 555 0100",
|
|
1619
|
+
email: "hello@example.com",
|
|
1620
|
+
socialLinks: [{
|
|
1621
|
+
network: "x",
|
|
1622
|
+
href: "https://x.com/example"
|
|
1623
|
+
}, {
|
|
1624
|
+
network: "linkedin",
|
|
1625
|
+
href: "https://linkedin.com/company/example"
|
|
1626
|
+
}]
|
|
1627
|
+
})
|
|
1628
|
+
}
|
|
1629
|
+
],
|
|
1630
|
+
attributes: y.strictObject({
|
|
1631
|
+
id: b,
|
|
1632
|
+
linkGroups: y.array(ir).default(J.linkGroups),
|
|
1633
|
+
copyright: y.string().trim().default(J.copyright),
|
|
1634
|
+
address: y.string().trim().default(J.address),
|
|
1635
|
+
phone: y.string().trim().default(J.phone),
|
|
1636
|
+
email: y.string().trim().default(J.email),
|
|
1637
|
+
socialLinks: y.array(ar).default(J.socialLinks),
|
|
1638
|
+
style: gn(or, nr)
|
|
1639
|
+
}),
|
|
1640
|
+
toDocumentAttributes: ({ id: e, linkGroups: t, copyright: n, address: r, phone: i, email: a, socialLinks: o, style: s }) => ({
|
|
1641
|
+
id: e,
|
|
1642
|
+
...t.length === 0 ? {} : { linkGroups: t },
|
|
1643
|
+
...n === J.copyright ? {} : { copyright: n },
|
|
1644
|
+
...r === "" ? {} : { address: r },
|
|
1645
|
+
...i === "" ? {} : { phone: i },
|
|
1646
|
+
...a === "" ? {} : { email: a },
|
|
1647
|
+
...o.length === 0 ? {} : { socialLinks: o },
|
|
1648
|
+
...E(T(s, or))
|
|
1649
|
+
}),
|
|
1650
|
+
history: {
|
|
1651
|
+
summary: () => "Footer",
|
|
1652
|
+
attributes: {
|
|
1653
|
+
linkGroups: "Link groups",
|
|
1654
|
+
copyright: "Copyright",
|
|
1655
|
+
address: "Address",
|
|
1656
|
+
phone: "Phone",
|
|
1657
|
+
email: "Email",
|
|
1658
|
+
socialLinks: "Social links",
|
|
1659
|
+
...w(or, "style.")
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
}), or), cr = [
|
|
1663
|
+
"small",
|
|
1664
|
+
"medium",
|
|
1665
|
+
"large"
|
|
1666
|
+
], lr = ["outline", "solid"], Y = {
|
|
1667
|
+
icon: "star",
|
|
998
1668
|
label: "Icon",
|
|
999
|
-
|
|
1000
|
-
|
|
1669
|
+
size: "medium",
|
|
1670
|
+
shape: "outline",
|
|
1671
|
+
...d
|
|
1672
|
+
}, ur = k(x({
|
|
1001
1673
|
type: "PIcon",
|
|
1002
1674
|
label: "Icon",
|
|
1003
1675
|
allowedChildren: [],
|
|
1004
1676
|
templates: [],
|
|
1005
|
-
attributes:
|
|
1006
|
-
id:
|
|
1007
|
-
icon:
|
|
1008
|
-
label:
|
|
1009
|
-
|
|
1677
|
+
attributes: y.strictObject({
|
|
1678
|
+
id: b,
|
|
1679
|
+
icon: y.string().refine(Ln, "Choose a Heroicons name such as home").default(Y.icon),
|
|
1680
|
+
label: y.string().trim().default(Y.label),
|
|
1681
|
+
size: y.enum(cr).default(Y.size),
|
|
1682
|
+
shape: y.enum(lr).default(Y.shape),
|
|
1683
|
+
...t
|
|
1010
1684
|
}).refine(({ href: e, label: t }) => e === "" || t !== "", {
|
|
1011
1685
|
path: ["label"],
|
|
1012
1686
|
message: "Describe a linked icon so the link has a name"
|
|
1013
1687
|
}),
|
|
1014
|
-
toDocumentAttributes: ({ id: e, icon: t, label: n,
|
|
1688
|
+
toDocumentAttributes: ({ id: e, icon: t, label: n, size: r, shape: i, href: a, target: o, description: s, rel: c }) => ({
|
|
1015
1689
|
id: e,
|
|
1016
1690
|
icon: t,
|
|
1017
1691
|
label: n,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1692
|
+
size: r,
|
|
1693
|
+
shape: i,
|
|
1694
|
+
..._({
|
|
1695
|
+
href: a,
|
|
1696
|
+
target: o,
|
|
1697
|
+
description: s,
|
|
1698
|
+
rel: c
|
|
1022
1699
|
})
|
|
1023
1700
|
}),
|
|
1024
1701
|
history: {
|
|
1025
|
-
summary: ({ icon: e, label: t }) => t ||
|
|
1702
|
+
summary: ({ icon: e, label: t }) => t || Rn(e),
|
|
1026
1703
|
attributes: {
|
|
1027
1704
|
icon: "Icon",
|
|
1028
1705
|
label: "Description",
|
|
1029
|
-
|
|
1706
|
+
size: "Size",
|
|
1707
|
+
shape: "Shape",
|
|
1708
|
+
...g
|
|
1030
1709
|
}
|
|
1031
1710
|
}
|
|
1032
|
-
})),
|
|
1033
|
-
"
|
|
1034
|
-
"
|
|
1035
|
-
"
|
|
1036
|
-
|
|
1037
|
-
"
|
|
1038
|
-
"
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
"
|
|
1042
|
-
"
|
|
1043
|
-
"
|
|
1044
|
-
],
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
key: "borderColor",
|
|
1075
|
-
variable: `${K}-border-color`,
|
|
1076
|
-
value: C,
|
|
1077
|
-
label: "Border color"
|
|
1078
|
-
},
|
|
1079
|
-
...qt(Wt)
|
|
1080
|
-
], Jt = M(p({
|
|
1081
|
-
type: "PImage",
|
|
1082
|
-
label: "Image",
|
|
1711
|
+
})), dr = [
|
|
1712
|
+
"static",
|
|
1713
|
+
"sticky",
|
|
1714
|
+
"overlay"
|
|
1715
|
+
], fr = [
|
|
1716
|
+
"start",
|
|
1717
|
+
"center",
|
|
1718
|
+
"end"
|
|
1719
|
+
], pr = ["collapse", "scroll"], mr = ["tablet", "mobile"], hr = [
|
|
1720
|
+
"14",
|
|
1721
|
+
"16",
|
|
1722
|
+
"20"
|
|
1723
|
+
], X = {
|
|
1724
|
+
brandText: "Site",
|
|
1725
|
+
brandLogo: "",
|
|
1726
|
+
brandHref: "/",
|
|
1727
|
+
items: [{
|
|
1728
|
+
label: "Home",
|
|
1729
|
+
href: "/",
|
|
1730
|
+
target: "_self"
|
|
1731
|
+
}, {
|
|
1732
|
+
label: "About",
|
|
1733
|
+
href: "/about",
|
|
1734
|
+
target: "_self"
|
|
1735
|
+
}],
|
|
1736
|
+
ctaLabel: "",
|
|
1737
|
+
ctaHref: "",
|
|
1738
|
+
position: "sticky",
|
|
1739
|
+
alignment: "end",
|
|
1740
|
+
mobileMenu: "collapse",
|
|
1741
|
+
collapseAt: "mobile",
|
|
1742
|
+
glass: !1,
|
|
1743
|
+
border: !0,
|
|
1744
|
+
shadow: !1,
|
|
1745
|
+
height: "16"
|
|
1746
|
+
}, gr = y.strictObject({
|
|
1747
|
+
label: y.string().trim().min(1, "Enter a label"),
|
|
1748
|
+
href: l,
|
|
1749
|
+
target: y.enum(c).default("_self")
|
|
1750
|
+
}), _r = x({
|
|
1751
|
+
type: "PNav",
|
|
1752
|
+
label: "Navigation",
|
|
1083
1753
|
allowedChildren: [],
|
|
1084
|
-
templates: [
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1754
|
+
templates: [
|
|
1755
|
+
{
|
|
1756
|
+
name: "Sticky links",
|
|
1757
|
+
shortcode: JSON.stringify({
|
|
1758
|
+
position: "sticky",
|
|
1759
|
+
alignment: "end",
|
|
1760
|
+
items: [
|
|
1761
|
+
{
|
|
1762
|
+
label: "Home",
|
|
1763
|
+
href: "/",
|
|
1764
|
+
target: "_self"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
label: "About",
|
|
1768
|
+
href: "/about",
|
|
1769
|
+
target: "_self"
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
label: "Contact",
|
|
1773
|
+
href: "/contact",
|
|
1774
|
+
target: "_self"
|
|
1775
|
+
}
|
|
1776
|
+
]
|
|
1777
|
+
})
|
|
1778
|
+
},
|
|
1779
|
+
{
|
|
1780
|
+
name: "Brand + CTA",
|
|
1781
|
+
shortcode: JSON.stringify({
|
|
1782
|
+
position: "sticky",
|
|
1783
|
+
alignment: "end",
|
|
1784
|
+
brandText: "Site",
|
|
1785
|
+
items: [{
|
|
1786
|
+
label: "Home",
|
|
1787
|
+
href: "/",
|
|
1788
|
+
target: "_self"
|
|
1789
|
+
}, {
|
|
1790
|
+
label: "Services",
|
|
1791
|
+
href: "/services",
|
|
1792
|
+
target: "_self"
|
|
1793
|
+
}],
|
|
1794
|
+
ctaLabel: "Get started",
|
|
1795
|
+
ctaHref: "/contact"
|
|
1796
|
+
})
|
|
1797
|
+
},
|
|
1798
|
+
{
|
|
1799
|
+
name: "Overlay glass",
|
|
1800
|
+
shortcode: JSON.stringify({
|
|
1801
|
+
position: "overlay",
|
|
1802
|
+
alignment: "center",
|
|
1803
|
+
glass: !0,
|
|
1804
|
+
border: !1,
|
|
1805
|
+
shadow: !1,
|
|
1806
|
+
items: [
|
|
1807
|
+
{
|
|
1808
|
+
label: "Home",
|
|
1809
|
+
href: "/",
|
|
1810
|
+
target: "_self"
|
|
1811
|
+
},
|
|
1812
|
+
{
|
|
1813
|
+
label: "Work",
|
|
1814
|
+
href: "/work",
|
|
1815
|
+
target: "_self"
|
|
1816
|
+
},
|
|
1817
|
+
{
|
|
1818
|
+
label: "About",
|
|
1819
|
+
href: "/about",
|
|
1820
|
+
target: "_self"
|
|
1821
|
+
}
|
|
1822
|
+
]
|
|
1823
|
+
})
|
|
1824
|
+
}
|
|
1825
|
+
],
|
|
1826
|
+
attributes: y.strictObject({
|
|
1827
|
+
id: b,
|
|
1828
|
+
brandText: y.string().trim().default(X.brandText),
|
|
1829
|
+
brandLogo: y.string().trim().pipe(y.union([y.literal(""), v])).default(X.brandLogo),
|
|
1830
|
+
brandHref: l.default(X.brandHref),
|
|
1831
|
+
items: y.array(gr).default(X.items),
|
|
1832
|
+
ctaLabel: y.string().trim().default(X.ctaLabel),
|
|
1833
|
+
ctaHref: y.string().trim().pipe(y.union([y.literal(""), l])).default(X.ctaHref),
|
|
1834
|
+
position: y.enum(dr).default(X.position),
|
|
1835
|
+
alignment: y.enum(fr).default(X.alignment),
|
|
1836
|
+
mobileMenu: y.enum(pr).default(X.mobileMenu),
|
|
1837
|
+
collapseAt: y.enum(mr).default(X.collapseAt),
|
|
1838
|
+
glass: y.boolean().default(X.glass),
|
|
1839
|
+
border: y.boolean().default(X.border),
|
|
1840
|
+
shadow: y.boolean().default(X.shadow),
|
|
1841
|
+
height: y.enum(hr).default(X.height)
|
|
1094
1842
|
}),
|
|
1095
|
-
toDocumentAttributes: (
|
|
1096
|
-
id: e,
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1843
|
+
toDocumentAttributes: (e) => ({
|
|
1844
|
+
id: e.id,
|
|
1845
|
+
brandText: e.brandText,
|
|
1846
|
+
...e.brandLogo === "" ? {} : { brandLogo: e.brandLogo },
|
|
1847
|
+
brandHref: e.brandHref,
|
|
1848
|
+
items: e.items,
|
|
1849
|
+
...e.ctaLabel === "" || e.ctaHref === "" ? {} : {
|
|
1850
|
+
ctaLabel: e.ctaLabel,
|
|
1851
|
+
ctaHref: e.ctaHref
|
|
1852
|
+
},
|
|
1853
|
+
...e.position === X.position ? {} : { position: e.position },
|
|
1854
|
+
...e.alignment === X.alignment ? {} : { alignment: e.alignment },
|
|
1855
|
+
...e.mobileMenu === X.mobileMenu ? {} : { mobileMenu: e.mobileMenu },
|
|
1856
|
+
...e.collapseAt === X.collapseAt ? {} : { collapseAt: e.collapseAt },
|
|
1857
|
+
...e.glass ? { glass: !0 } : {},
|
|
1858
|
+
...e.border === X.border ? {} : { border: e.border },
|
|
1859
|
+
...e.shadow ? { shadow: !0 } : {},
|
|
1860
|
+
...e.height === X.height ? {} : { height: e.height }
|
|
1105
1861
|
}),
|
|
1106
1862
|
history: {
|
|
1107
|
-
summary: ({
|
|
1863
|
+
summary: ({ brandText: e }) => e || "Navigation",
|
|
1108
1864
|
attributes: {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1865
|
+
brandText: "Brand text",
|
|
1866
|
+
brandLogo: "Brand logo",
|
|
1867
|
+
brandHref: "Brand link",
|
|
1868
|
+
items: "Items",
|
|
1869
|
+
ctaLabel: "CTA label",
|
|
1870
|
+
ctaHref: "CTA link",
|
|
1871
|
+
position: "Position",
|
|
1872
|
+
alignment: "Alignment",
|
|
1873
|
+
mobileMenu: "Mobile menu",
|
|
1874
|
+
collapseAt: "Collapse at",
|
|
1875
|
+
glass: "Glass background",
|
|
1876
|
+
border: "Border",
|
|
1877
|
+
shadow: "Shadow",
|
|
1878
|
+
height: "Height"
|
|
1113
1879
|
}
|
|
1114
1880
|
}
|
|
1115
|
-
}),
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
}
|
|
1123
|
-
// src/elements/list/definition.ts
|
|
1124
|
-
var Yt = { items: [
|
|
1125
|
-
{ text: "First item" },
|
|
1126
|
-
{ text: "Second item" },
|
|
1127
|
-
{ text: "Third item" }
|
|
1128
|
-
] }, Xt = M(p({
|
|
1881
|
+
}), vr = {
|
|
1882
|
+
items: [
|
|
1883
|
+
{ text: "First item" },
|
|
1884
|
+
{ text: "Second item" },
|
|
1885
|
+
{ text: "Third item" }
|
|
1886
|
+
],
|
|
1887
|
+
ordered: !1
|
|
1888
|
+
}, yr = k(x({
|
|
1129
1889
|
type: "PList",
|
|
1130
1890
|
label: "List",
|
|
1131
1891
|
allowedChildren: [],
|
|
1132
1892
|
templates: [],
|
|
1133
|
-
attributes:
|
|
1134
|
-
id:
|
|
1135
|
-
items:
|
|
1893
|
+
attributes: y.strictObject({
|
|
1894
|
+
id: b,
|
|
1895
|
+
items: A("Add a list item", "Enter item text").default(vr.items),
|
|
1896
|
+
ordered: y.boolean().default(vr.ordered)
|
|
1136
1897
|
}),
|
|
1137
|
-
toDocumentAttributes: ({ id: e, items: t }) => ({
|
|
1898
|
+
toDocumentAttributes: ({ id: e, items: t, ordered: n }) => ({
|
|
1138
1899
|
id: e,
|
|
1139
|
-
items:
|
|
1900
|
+
items: j(t),
|
|
1901
|
+
...n ? { ordered: !0 } : {}
|
|
1140
1902
|
}),
|
|
1141
1903
|
history: {
|
|
1142
1904
|
summary: ({ items: e }) => e[0]?.text ?? "",
|
|
1143
|
-
attributes: {
|
|
1905
|
+
attributes: {
|
|
1906
|
+
items: "Items",
|
|
1907
|
+
ordered: "Ordered"
|
|
1908
|
+
}
|
|
1144
1909
|
}
|
|
1145
|
-
})),
|
|
1910
|
+
})), br = [
|
|
1911
|
+
"auto",
|
|
1912
|
+
"ltr",
|
|
1913
|
+
"rtl"
|
|
1914
|
+
], xr = [
|
|
1915
|
+
"sm",
|
|
1916
|
+
"base",
|
|
1917
|
+
"lg"
|
|
1918
|
+
], Sr = [
|
|
1919
|
+
"5xl",
|
|
1920
|
+
"6xl",
|
|
1921
|
+
"7xl",
|
|
1922
|
+
"full"
|
|
1923
|
+
], Cr = [
|
|
1924
|
+
"square",
|
|
1925
|
+
"soft",
|
|
1926
|
+
"rounded"
|
|
1927
|
+
], wr = [
|
|
1928
|
+
"always",
|
|
1929
|
+
"hover",
|
|
1930
|
+
"never"
|
|
1931
|
+
], Tr = /^\/([a-z0-9]+(-[a-z0-9]+)*)?$/, Er = /^#[0-9A-Fa-f]{6}$/, Dr = /^([a-z]{2,3})(-[A-Za-z0-9]+)*$/, Or = {
|
|
1146
1932
|
backgroundColor: {
|
|
1147
1933
|
name: "white",
|
|
1148
1934
|
opacity: 100
|
|
@@ -1152,75 +1938,144 @@ var Yt = { items: [
|
|
|
1152
1938
|
opacity: 100
|
|
1153
1939
|
},
|
|
1154
1940
|
textSize: "sm"
|
|
1155
|
-
}, Z =
|
|
1156
|
-
|
|
1941
|
+
}, Z = {
|
|
1942
|
+
seoTitle: "",
|
|
1943
|
+
description: "",
|
|
1944
|
+
lang: "",
|
|
1945
|
+
dir: "auto",
|
|
1946
|
+
shareImage: "",
|
|
1947
|
+
hideFromSearch: !1
|
|
1948
|
+
}, Q = {
|
|
1949
|
+
bodyFont: "",
|
|
1950
|
+
headingFont: "",
|
|
1951
|
+
lineHeight: "",
|
|
1952
|
+
accentColor: "",
|
|
1953
|
+
contentWidth: "7xl",
|
|
1954
|
+
radiusStyle: "soft",
|
|
1955
|
+
linkUnderline: "hover"
|
|
1956
|
+
}, kr = [
|
|
1957
|
+
L({
|
|
1157
1958
|
key: "backgroundColor",
|
|
1158
1959
|
variable: "--palmyit-page-background-color",
|
|
1159
|
-
|
|
1160
|
-
defaultValue: X.backgroundColor,
|
|
1960
|
+
defaultValue: Or.backgroundColor,
|
|
1161
1961
|
label: "Background color"
|
|
1162
|
-
},
|
|
1163
|
-
{
|
|
1962
|
+
}),
|
|
1963
|
+
L({
|
|
1164
1964
|
key: "textColor",
|
|
1165
1965
|
variable: "--palmyit-page-text-color",
|
|
1166
|
-
|
|
1167
|
-
defaultValue: X.textColor,
|
|
1966
|
+
defaultValue: Or.textColor,
|
|
1168
1967
|
label: "Text color"
|
|
1169
|
-
},
|
|
1968
|
+
}),
|
|
1170
1969
|
{
|
|
1171
1970
|
key: "textSize",
|
|
1172
1971
|
variable: "--palmyit-page-font-size",
|
|
1173
|
-
value:
|
|
1174
|
-
defaultValue:
|
|
1972
|
+
value: y.enum(xr),
|
|
1973
|
+
defaultValue: Or.textSize,
|
|
1175
1974
|
label: "Text size"
|
|
1176
1975
|
}
|
|
1177
|
-
],
|
|
1976
|
+
], Ar = kr.map(({ key: e }) => e), jr = y.string().trim().refine((e) => e === "" || ie(e), "Expected a Google Fonts family name").default(""), Mr = y.string().trim().refine((e) => e === "" || Er.test(e), "Expected a #RRGGBB color").default(""), Nr = x({
|
|
1178
1977
|
type: "PPage",
|
|
1179
1978
|
label: "Page",
|
|
1180
|
-
allowedChildren: [
|
|
1979
|
+
allowedChildren: [
|
|
1980
|
+
"PNav",
|
|
1981
|
+
"PSection",
|
|
1982
|
+
"PFooter"
|
|
1983
|
+
],
|
|
1181
1984
|
templates: [],
|
|
1182
|
-
attributes:
|
|
1183
|
-
id:
|
|
1184
|
-
url:
|
|
1185
|
-
title:
|
|
1186
|
-
|
|
1187
|
-
|
|
1985
|
+
attributes: y.strictObject({
|
|
1986
|
+
id: b,
|
|
1987
|
+
url: y.string().regex(Tr, "Expected / or a lowercase path such as /about-us"),
|
|
1988
|
+
title: y.string().default(""),
|
|
1989
|
+
seoTitle: y.string().trim().default(Z.seoTitle),
|
|
1990
|
+
description: y.string().trim().max(160, "Keep the description to about 160 characters").default(Z.description),
|
|
1991
|
+
lang: y.string().trim().refine((e) => e === "" || Dr.test(e), "Expected a language code such as en or ar").default(Z.lang),
|
|
1992
|
+
dir: y.enum(br).default(Z.dir),
|
|
1993
|
+
shareImage: y.string().trim().pipe(y.union([y.literal(""), v])).default(Z.shareImage),
|
|
1994
|
+
hideFromSearch: y.boolean().default(Z.hideFromSearch),
|
|
1995
|
+
bodyFont: jr,
|
|
1996
|
+
headingFont: jr,
|
|
1997
|
+
lineHeight: y.union([y.literal(""), y.enum(n)]).default(Q.lineHeight),
|
|
1998
|
+
accentColor: Mr,
|
|
1999
|
+
contentWidth: y.enum(Sr).default(Q.contentWidth),
|
|
2000
|
+
radiusStyle: y.enum(Cr).default(Q.radiusStyle),
|
|
2001
|
+
linkUnderline: y.enum(wr).default(Q.linkUnderline),
|
|
2002
|
+
style: D(kr)
|
|
2003
|
+
}).transform(({ id: e, url: t, title: n, seoTitle: r, description: i, lang: a, dir: o, shareImage: s, hideFromSearch: c, bodyFont: l, headingFont: u, lineHeight: d, accentColor: f, contentWidth: p, radiusStyle: m, linkUnderline: h, style: g }) => ({
|
|
1188
2004
|
pageId: e,
|
|
1189
2005
|
url: t,
|
|
1190
2006
|
title: n,
|
|
1191
|
-
|
|
2007
|
+
seoTitle: r,
|
|
2008
|
+
description: i,
|
|
2009
|
+
lang: a,
|
|
2010
|
+
dir: o,
|
|
2011
|
+
shareImage: s,
|
|
2012
|
+
hideFromSearch: c,
|
|
2013
|
+
bodyFont: l,
|
|
2014
|
+
headingFont: u,
|
|
2015
|
+
lineHeight: d,
|
|
2016
|
+
accentColor: f,
|
|
2017
|
+
contentWidth: p,
|
|
2018
|
+
radiusStyle: m,
|
|
2019
|
+
linkUnderline: h,
|
|
2020
|
+
...g
|
|
1192
2021
|
})),
|
|
1193
|
-
toDocumentAttributes: ({ pageId: e, url: t, title: n,
|
|
2022
|
+
toDocumentAttributes: ({ pageId: e, url: t, title: n, seoTitle: r, description: i, lang: a, dir: o, shareImage: s, hideFromSearch: c, bodyFont: l, headingFont: u, lineHeight: d, accentColor: f, contentWidth: p, radiusStyle: m, linkUnderline: h, ...g }) => ({
|
|
1194
2023
|
id: e,
|
|
1195
2024
|
url: t,
|
|
1196
2025
|
title: n,
|
|
1197
|
-
|
|
2026
|
+
...r === "" ? {} : { seoTitle: r },
|
|
2027
|
+
...i === "" ? {} : { description: i },
|
|
2028
|
+
...a === "" ? {} : { lang: a },
|
|
2029
|
+
...o === Z.dir ? {} : { dir: o },
|
|
2030
|
+
...s === "" ? {} : { shareImage: s },
|
|
2031
|
+
...c ? { hideFromSearch: !0 } : {},
|
|
2032
|
+
...l === "" ? {} : { bodyFont: l },
|
|
2033
|
+
...u === "" ? {} : { headingFont: u },
|
|
2034
|
+
...d === "" ? {} : { lineHeight: d },
|
|
2035
|
+
...f === "" ? {} : { accentColor: f },
|
|
2036
|
+
...p === Q.contentWidth ? {} : { contentWidth: p },
|
|
2037
|
+
...m === Q.radiusStyle ? {} : { radiusStyle: m },
|
|
2038
|
+
...h === Q.linkUnderline ? {} : { linkUnderline: h },
|
|
2039
|
+
...E(T(g, kr))
|
|
1198
2040
|
}),
|
|
1199
2041
|
history: {
|
|
1200
2042
|
summary: ({ title: e, url: t }) => e || t,
|
|
1201
2043
|
attributes: {
|
|
1202
2044
|
title: "Title",
|
|
1203
2045
|
url: "URL",
|
|
1204
|
-
|
|
2046
|
+
seoTitle: "Search result title",
|
|
2047
|
+
description: "Search result description",
|
|
2048
|
+
lang: "Language",
|
|
2049
|
+
dir: "Text direction",
|
|
2050
|
+
shareImage: "Social share image",
|
|
2051
|
+
hideFromSearch: "Hide from search engines",
|
|
2052
|
+
bodyFont: "Body font",
|
|
2053
|
+
headingFont: "Heading font",
|
|
2054
|
+
lineHeight: "Line height",
|
|
2055
|
+
accentColor: "Accent color",
|
|
2056
|
+
contentWidth: "Content width",
|
|
2057
|
+
radiusStyle: "Corner style",
|
|
2058
|
+
linkUnderline: "Link underline",
|
|
2059
|
+
...w(kr)
|
|
1205
2060
|
}
|
|
1206
2061
|
}
|
|
1207
|
-
}),
|
|
2062
|
+
}), Pr = {
|
|
1208
2063
|
legend: "Choose one",
|
|
1209
2064
|
options: [{ text: "Option 1" }, { text: "Option 2" }]
|
|
1210
|
-
},
|
|
2065
|
+
}, Fr = k(x({
|
|
1211
2066
|
type: "PRadio",
|
|
1212
2067
|
label: "Radio input",
|
|
1213
2068
|
allowedChildren: [],
|
|
1214
2069
|
templates: [],
|
|
1215
|
-
attributes:
|
|
1216
|
-
id:
|
|
1217
|
-
legend:
|
|
1218
|
-
options:
|
|
2070
|
+
attributes: y.strictObject({
|
|
2071
|
+
id: b,
|
|
2072
|
+
legend: y.string().trim().min(1, "Enter a question").default(Pr.legend),
|
|
2073
|
+
options: A("Add an option", "Enter option text").default(Pr.options)
|
|
1219
2074
|
}),
|
|
1220
2075
|
toDocumentAttributes: ({ id: e, legend: t, options: n }) => ({
|
|
1221
2076
|
id: e,
|
|
1222
2077
|
legend: t,
|
|
1223
|
-
options:
|
|
2078
|
+
options: j(n)
|
|
1224
2079
|
}),
|
|
1225
2080
|
history: {
|
|
1226
2081
|
summary: ({ legend: e }) => e,
|
|
@@ -1229,30 +2084,30 @@ var Yt = { items: [
|
|
|
1229
2084
|
options: "Options"
|
|
1230
2085
|
}
|
|
1231
2086
|
}
|
|
1232
|
-
})),
|
|
2087
|
+
})), Ir = { ...M }, Lr = Kn({
|
|
1233
2088
|
type: "PSection",
|
|
1234
2089
|
label: "Section",
|
|
1235
2090
|
kind: "section",
|
|
1236
|
-
defaultStyle:
|
|
1237
|
-
allowedChildren:
|
|
2091
|
+
defaultStyle: Ir,
|
|
2092
|
+
allowedChildren: Xn,
|
|
1238
2093
|
templates: []
|
|
1239
|
-
}),
|
|
2094
|
+
}), Rr = {
|
|
1240
2095
|
label: "Select",
|
|
1241
2096
|
options: [{ text: "Option 1" }, { text: "Option 2" }]
|
|
1242
|
-
},
|
|
2097
|
+
}, zr = k(x({
|
|
1243
2098
|
type: "PSelect",
|
|
1244
2099
|
label: "Select",
|
|
1245
2100
|
allowedChildren: [],
|
|
1246
2101
|
templates: [],
|
|
1247
|
-
attributes:
|
|
1248
|
-
id:
|
|
1249
|
-
label:
|
|
1250
|
-
options:
|
|
2102
|
+
attributes: y.strictObject({
|
|
2103
|
+
id: b,
|
|
2104
|
+
label: y.string().trim().min(1, "Enter a label").default(Rr.label),
|
|
2105
|
+
options: A("Add an option", "Enter option text").default(Rr.options)
|
|
1251
2106
|
}),
|
|
1252
2107
|
toDocumentAttributes: ({ id: e, label: t, options: n }) => ({
|
|
1253
2108
|
id: e,
|
|
1254
2109
|
label: t,
|
|
1255
|
-
options:
|
|
2110
|
+
options: j(n)
|
|
1256
2111
|
}),
|
|
1257
2112
|
history: {
|
|
1258
2113
|
summary: ({ label: e }) => e,
|
|
@@ -1261,7 +2116,7 @@ var Yt = { items: [
|
|
|
1261
2116
|
options: "Options"
|
|
1262
2117
|
}
|
|
1263
2118
|
}
|
|
1264
|
-
})),
|
|
2119
|
+
})), Br = {
|
|
1265
2120
|
headers: [
|
|
1266
2121
|
{ text: "Column 1" },
|
|
1267
2122
|
{ text: "Column 2" },
|
|
@@ -1275,20 +2130,22 @@ var Yt = { items: [
|
|
|
1275
2130
|
"Cell 4",
|
|
1276
2131
|
"Cell 5",
|
|
1277
2132
|
"Cell 6"
|
|
1278
|
-
] }]
|
|
2133
|
+
] }],
|
|
2134
|
+
caption: ""
|
|
1279
2135
|
};
|
|
1280
|
-
function
|
|
2136
|
+
function Vr(e, t) {
|
|
1281
2137
|
return t.map(({ cells: t }) => ({ cells: Array.from({ length: e }, (e, n) => t[n] ?? "") }));
|
|
1282
2138
|
}
|
|
1283
|
-
var
|
|
2139
|
+
var Hr = y.strictObject({ cells: y.array(y.string()) }), Ur = k(x({
|
|
1284
2140
|
type: "PTable",
|
|
1285
2141
|
label: "Table",
|
|
1286
2142
|
allowedChildren: [],
|
|
1287
2143
|
templates: [],
|
|
1288
|
-
attributes:
|
|
1289
|
-
id:
|
|
1290
|
-
headers:
|
|
1291
|
-
rows:
|
|
2144
|
+
attributes: y.strictObject({
|
|
2145
|
+
id: b,
|
|
2146
|
+
headers: A("Add a column", "Enter a column heading").default(Br.headers),
|
|
2147
|
+
rows: y.array(Hr).default(Br.rows),
|
|
2148
|
+
caption: y.string().trim().default(Br.caption)
|
|
1292
2149
|
}).superRefine(({ headers: e, rows: t }, n) => {
|
|
1293
2150
|
t.forEach(({ cells: t }, r) => {
|
|
1294
2151
|
t.length !== e.length && n.addIssue({
|
|
@@ -1302,189 +2159,58 @@ var ln = d.strictObject({ cells: d.array(d.string()) }), un = M(p({
|
|
|
1302
2159
|
});
|
|
1303
2160
|
});
|
|
1304
2161
|
}),
|
|
1305
|
-
toDocumentAttributes: ({ id: e, headers: t, rows: n }) => ({
|
|
2162
|
+
toDocumentAttributes: ({ id: e, headers: t, rows: n, caption: r }) => ({
|
|
1306
2163
|
id: e,
|
|
1307
|
-
headers:
|
|
1308
|
-
rows: n.map(({ cells: e }) => ({ cells: [...e] }))
|
|
2164
|
+
headers: j(t),
|
|
2165
|
+
rows: n.map(({ cells: e }) => ({ cells: [...e] })),
|
|
2166
|
+
...r === "" ? {} : { caption: r }
|
|
1309
2167
|
}),
|
|
1310
2168
|
history: {
|
|
1311
2169
|
summary: ({ headers: e }) => e[0]?.text ?? "",
|
|
1312
2170
|
attributes: {
|
|
1313
2171
|
headers: "Column headings",
|
|
1314
|
-
rows: "Rows"
|
|
2172
|
+
rows: "Rows",
|
|
2173
|
+
caption: "Caption"
|
|
1315
2174
|
}
|
|
1316
2175
|
}
|
|
1317
|
-
})),
|
|
1318
|
-
function
|
|
2176
|
+
})), Wr = /<[^>]*>/g;
|
|
2177
|
+
function Gr(e) {
|
|
1319
2178
|
let t = e.trim();
|
|
1320
2179
|
return t.includes("<") ? t : `<p>${t}</p>`;
|
|
1321
2180
|
}
|
|
1322
|
-
function
|
|
1323
|
-
return e.replace(
|
|
2181
|
+
function Kr(e) {
|
|
2182
|
+
return e.replace(Wr, " ").replace(/ /g, " ").replace(/&/g, "&").replace(/\s+/g, " ").trim();
|
|
1324
2183
|
}
|
|
1325
2184
|
// src/elements/rich-text/definition.ts
|
|
1326
|
-
var
|
|
2185
|
+
var qr = { text: "<p>Add your main text here. Double-click to edit and customize your content to make it selectable.</p>" }, Jr = k(x({
|
|
1327
2186
|
type: "PRichText",
|
|
1328
2187
|
label: "Rich text",
|
|
1329
2188
|
allowedChildren: [],
|
|
1330
2189
|
templates: [],
|
|
1331
|
-
attributes:
|
|
1332
|
-
id:
|
|
1333
|
-
text:
|
|
2190
|
+
attributes: y.strictObject({
|
|
2191
|
+
id: b,
|
|
2192
|
+
text: y.string().transform(Gr).refine((e) => Kr(e).trim().length > 0, "Enter text").default(qr.text)
|
|
1334
2193
|
}),
|
|
1335
2194
|
toDocumentAttributes: ({ id: e, text: t }) => ({
|
|
1336
2195
|
id: e,
|
|
1337
|
-
text:
|
|
2196
|
+
text: Gr(t)
|
|
1338
2197
|
}),
|
|
1339
2198
|
history: {
|
|
1340
|
-
summary: ({ text: e }) =>
|
|
2199
|
+
summary: ({ text: e }) => Kr(e),
|
|
1341
2200
|
attributes: { text: "Text" }
|
|
1342
2201
|
}
|
|
1343
|
-
})),
|
|
1344
|
-
"normal",
|
|
1345
|
-
"italic",
|
|
1346
|
-
"oblique"
|
|
1347
|
-
], _n = [
|
|
1348
|
-
"none",
|
|
1349
|
-
"underline",
|
|
1350
|
-
"overline",
|
|
1351
|
-
"line-through"
|
|
1352
|
-
], vn = [
|
|
1353
|
-
"left",
|
|
1354
|
-
"center",
|
|
1355
|
-
"right",
|
|
1356
|
-
"justify"
|
|
1357
|
-
], yn = [
|
|
1358
|
-
"none",
|
|
1359
|
-
"capitalize",
|
|
1360
|
-
"uppercase",
|
|
1361
|
-
"lowercase"
|
|
1362
|
-
], bn = [
|
|
1363
|
-
"100",
|
|
1364
|
-
"200",
|
|
1365
|
-
"300",
|
|
1366
|
-
"400",
|
|
1367
|
-
"500",
|
|
1368
|
-
"600",
|
|
1369
|
-
"700",
|
|
1370
|
-
"800",
|
|
1371
|
-
"900"
|
|
1372
|
-
], xn = {
|
|
1373
|
-
text: "Text",
|
|
1374
|
-
...P,
|
|
1375
|
-
style: {}
|
|
1376
|
-
}, Sn = "--palmyit-text";
|
|
1377
|
-
function Cn(e) {
|
|
1378
|
-
return [
|
|
1379
|
-
{
|
|
1380
|
-
key: "textFont",
|
|
1381
|
-
variable: `${e}-font-family`,
|
|
1382
|
-
value: d.string().refine(xt, "Expected a Google Fonts family name"),
|
|
1383
|
-
label: "Font family"
|
|
1384
|
-
},
|
|
1385
|
-
{
|
|
1386
|
-
key: "fontStyle",
|
|
1387
|
-
variable: `${e}-font-style`,
|
|
1388
|
-
value: d.enum(gn),
|
|
1389
|
-
label: "Text style"
|
|
1390
|
-
},
|
|
1391
|
-
{
|
|
1392
|
-
key: "textSize",
|
|
1393
|
-
variable: `${e}-font-size`,
|
|
1394
|
-
value: Fe,
|
|
1395
|
-
label: "Text size"
|
|
1396
|
-
},
|
|
1397
|
-
{
|
|
1398
|
-
key: "textColor",
|
|
1399
|
-
variable: `${e}-color`,
|
|
1400
|
-
value: C,
|
|
1401
|
-
label: "Text color"
|
|
1402
|
-
},
|
|
1403
|
-
{
|
|
1404
|
-
key: "lineHeight",
|
|
1405
|
-
variable: `${e}-line-height`,
|
|
1406
|
-
value: Ie,
|
|
1407
|
-
label: "Height"
|
|
1408
|
-
},
|
|
1409
|
-
{
|
|
1410
|
-
key: "letterSpacing",
|
|
1411
|
-
variable: `${e}-letter-spacing`,
|
|
1412
|
-
value: Le,
|
|
1413
|
-
label: "Letter spacing"
|
|
1414
|
-
},
|
|
1415
|
-
{
|
|
1416
|
-
key: "wordSpacing",
|
|
1417
|
-
variable: `${e}-word-spacing`,
|
|
1418
|
-
value: S,
|
|
1419
|
-
label: "Word spacing"
|
|
1420
|
-
},
|
|
1421
|
-
{
|
|
1422
|
-
key: "textDecoration",
|
|
1423
|
-
variable: `${e}-text-decoration`,
|
|
1424
|
-
value: d.enum(_n),
|
|
1425
|
-
label: "Text decoration"
|
|
1426
|
-
},
|
|
1427
|
-
{
|
|
1428
|
-
key: "textAlign",
|
|
1429
|
-
variable: `${e}-text-align`,
|
|
1430
|
-
value: d.enum(vn),
|
|
1431
|
-
label: "Text align"
|
|
1432
|
-
},
|
|
1433
|
-
{
|
|
1434
|
-
key: "textTransform",
|
|
1435
|
-
variable: `${e}-text-transform`,
|
|
1436
|
-
value: d.enum(yn),
|
|
1437
|
-
label: "Text transform"
|
|
1438
|
-
},
|
|
1439
|
-
{
|
|
1440
|
-
key: "fontWeight",
|
|
1441
|
-
variable: `${e}-font-weight`,
|
|
1442
|
-
value: d.enum(bn),
|
|
1443
|
-
label: "Text weight"
|
|
1444
|
-
}
|
|
1445
|
-
];
|
|
1446
|
-
}
|
|
1447
|
-
var Q = Cn(Sn), wn = M(p({
|
|
1448
|
-
type: "PText",
|
|
1449
|
-
label: "Text",
|
|
1450
|
-
allowedChildren: [],
|
|
1451
|
-
templates: [],
|
|
1452
|
-
attributes: d.strictObject({
|
|
1453
|
-
id: f,
|
|
1454
|
-
text: d.string().trim().min(1, "Enter text").default(xn.text),
|
|
1455
|
-
...F,
|
|
1456
|
-
style: O(Q).transform((e) => e)
|
|
1457
|
-
}),
|
|
1458
|
-
toDocumentAttributes: ({ id: e, text: t, href: n, target: r, description: i, style: a }) => ({
|
|
1459
|
-
id: e,
|
|
1460
|
-
text: t,
|
|
1461
|
-
...L({
|
|
1462
|
-
href: n,
|
|
1463
|
-
target: r,
|
|
1464
|
-
description: i
|
|
1465
|
-
}),
|
|
1466
|
-
style: A(a, Q)
|
|
1467
|
-
}),
|
|
1468
|
-
history: {
|
|
1469
|
-
summary: ({ text: e }) => e,
|
|
1470
|
-
attributes: {
|
|
1471
|
-
text: "Text",
|
|
1472
|
-
...I,
|
|
1473
|
-
...k(Q, "style.")
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
}), Q), Tn = {
|
|
2202
|
+
})), Yr = {
|
|
1477
2203
|
label: "Text area",
|
|
1478
2204
|
placeholder: ""
|
|
1479
|
-
},
|
|
2205
|
+
}, Xr = k(x({
|
|
1480
2206
|
type: "PTextArea",
|
|
1481
2207
|
label: "Text area",
|
|
1482
2208
|
allowedChildren: [],
|
|
1483
2209
|
templates: [],
|
|
1484
|
-
attributes:
|
|
1485
|
-
id:
|
|
1486
|
-
label:
|
|
1487
|
-
placeholder:
|
|
2210
|
+
attributes: y.strictObject({
|
|
2211
|
+
id: b,
|
|
2212
|
+
label: y.string().trim().min(1, "Enter a label").default(Yr.label),
|
|
2213
|
+
placeholder: y.string().default(Yr.placeholder)
|
|
1488
2214
|
}),
|
|
1489
2215
|
toDocumentAttributes: ({ id: e, label: t, placeholder: n }) => ({
|
|
1490
2216
|
id: e,
|
|
@@ -1498,18 +2224,18 @@ var Q = Cn(Sn), wn = M(p({
|
|
|
1498
2224
|
placeholder: "Placeholder"
|
|
1499
2225
|
}
|
|
1500
2226
|
}
|
|
1501
|
-
})),
|
|
2227
|
+
})), Zr = {
|
|
1502
2228
|
label: "Text field",
|
|
1503
2229
|
placeholder: ""
|
|
1504
|
-
},
|
|
2230
|
+
}, Qr = k(x({
|
|
1505
2231
|
type: "PTextField",
|
|
1506
2232
|
label: "Text field",
|
|
1507
2233
|
allowedChildren: [],
|
|
1508
2234
|
templates: [],
|
|
1509
|
-
attributes:
|
|
1510
|
-
id:
|
|
1511
|
-
label:
|
|
1512
|
-
placeholder:
|
|
2235
|
+
attributes: y.strictObject({
|
|
2236
|
+
id: b,
|
|
2237
|
+
label: y.string().trim().min(1, "Enter a label").default(Zr.label),
|
|
2238
|
+
placeholder: y.string().default(Zr.placeholder)
|
|
1513
2239
|
}),
|
|
1514
2240
|
toDocumentAttributes: ({ id: e, label: t, placeholder: n }) => ({
|
|
1515
2241
|
id: e,
|
|
@@ -1523,92 +2249,173 @@ var Q = Cn(Sn), wn = M(p({
|
|
|
1523
2249
|
placeholder: "Placeholder"
|
|
1524
2250
|
}
|
|
1525
2251
|
}
|
|
1526
|
-
})),
|
|
2252
|
+
})), $r = ["file", "youtube"], ei = ["none", "metadata"], ti = [
|
|
2253
|
+
"video",
|
|
2254
|
+
"9/16",
|
|
2255
|
+
"4/3",
|
|
2256
|
+
"square"
|
|
2257
|
+
], $ = {
|
|
2258
|
+
source: "file",
|
|
1527
2259
|
src: "",
|
|
1528
|
-
|
|
1529
|
-
|
|
2260
|
+
youtubeUrl: "",
|
|
2261
|
+
title: "Video",
|
|
2262
|
+
description: "",
|
|
2263
|
+
poster: "",
|
|
2264
|
+
uploadDate: "",
|
|
2265
|
+
captions: [],
|
|
2266
|
+
autoplay: !1,
|
|
2267
|
+
loop: !1,
|
|
2268
|
+
muted: !1,
|
|
2269
|
+
controls: !0,
|
|
2270
|
+
preload: "metadata",
|
|
2271
|
+
startAt: 0,
|
|
2272
|
+
aspectRatio: "video",
|
|
2273
|
+
caption: ""
|
|
2274
|
+
}, ni = y.string().trim().pipe(y.union([y.literal(""), v])).default(""), ri = y.strictObject({
|
|
2275
|
+
src: v,
|
|
2276
|
+
srclang: y.string().trim().min(2, "Enter a language code"),
|
|
2277
|
+
label: y.string().trim().min(1, "Enter a track label")
|
|
2278
|
+
}), ii = k(x({
|
|
1530
2279
|
type: "PVideo",
|
|
1531
2280
|
label: "Video",
|
|
1532
2281
|
allowedChildren: [],
|
|
1533
2282
|
templates: [],
|
|
1534
|
-
attributes:
|
|
1535
|
-
id:
|
|
1536
|
-
|
|
1537
|
-
|
|
2283
|
+
attributes: y.strictObject({
|
|
2284
|
+
id: b,
|
|
2285
|
+
source: y.enum($r).default($.source),
|
|
2286
|
+
src: y.union([y.literal(""), v]).default($.src),
|
|
2287
|
+
youtubeUrl: y.string().trim().default($.youtubeUrl),
|
|
2288
|
+
title: y.string().trim().min(1, "Enter a video title").default($.title),
|
|
2289
|
+
description: y.string().trim().default($.description),
|
|
2290
|
+
poster: ni,
|
|
2291
|
+
uploadDate: y.string().trim().default($.uploadDate),
|
|
2292
|
+
captions: y.array(ri).default($.captions),
|
|
2293
|
+
autoplay: y.boolean().default($.autoplay),
|
|
2294
|
+
loop: y.boolean().default($.loop),
|
|
2295
|
+
muted: y.boolean().default($.muted),
|
|
2296
|
+
controls: y.boolean().default($.controls),
|
|
2297
|
+
preload: y.enum(ei).default($.preload),
|
|
2298
|
+
startAt: y.number().int().min(0).default($.startAt),
|
|
2299
|
+
aspectRatio: y.enum(ti).default($.aspectRatio),
|
|
2300
|
+
caption: y.string().trim().default($.caption)
|
|
2301
|
+
}).superRefine((e, t) => {
|
|
2302
|
+
e.source === "file" && e.src === "" || e.source !== "youtube" || ue(e.youtubeUrl) || t.addIssue({
|
|
2303
|
+
code: "custom",
|
|
2304
|
+
path: ["youtubeUrl"],
|
|
2305
|
+
message: "Enter a YouTube watch, share, Shorts, or embed URL"
|
|
2306
|
+
});
|
|
1538
2307
|
}),
|
|
1539
|
-
toDocumentAttributes: ({ id: e,
|
|
2308
|
+
toDocumentAttributes: ({ id: e, source: t, src: n, youtubeUrl: r, title: i, description: a, poster: o, uploadDate: s, captions: c, autoplay: l, loop: u, muted: d, controls: f, preload: p, startAt: m, aspectRatio: h, caption: g }) => ({
|
|
1540
2309
|
id: e,
|
|
1541
|
-
|
|
1542
|
-
|
|
2310
|
+
source: t,
|
|
2311
|
+
...t === "file" ? { src: n } : { youtubeUrl: r },
|
|
2312
|
+
title: i,
|
|
2313
|
+
...a === "" ? {} : { description: a },
|
|
2314
|
+
...o === "" ? {} : { poster: o },
|
|
2315
|
+
...s === "" ? {} : { uploadDate: s },
|
|
2316
|
+
...c.length === 0 ? {} : { captions: c },
|
|
2317
|
+
...l ? { autoplay: !0 } : {},
|
|
2318
|
+
...u ? { loop: !0 } : {},
|
|
2319
|
+
...d || l ? { muted: !0 } : {},
|
|
2320
|
+
...f === $.controls ? {} : { controls: f },
|
|
2321
|
+
...p === $.preload ? {} : { preload: p },
|
|
2322
|
+
...m === 0 ? {} : { startAt: m },
|
|
2323
|
+
...h === $.aspectRatio ? {} : { aspectRatio: h },
|
|
2324
|
+
...g === "" ? {} : { caption: g }
|
|
1543
2325
|
}),
|
|
1544
2326
|
history: {
|
|
1545
2327
|
summary: ({ title: e }) => e,
|
|
1546
2328
|
attributes: {
|
|
2329
|
+
source: "Source",
|
|
1547
2330
|
src: "Video address",
|
|
1548
|
-
|
|
2331
|
+
youtubeUrl: "YouTube URL",
|
|
2332
|
+
title: "Title",
|
|
2333
|
+
description: "Description",
|
|
2334
|
+
poster: "Poster image",
|
|
2335
|
+
uploadDate: "Upload date",
|
|
2336
|
+
captions: "Captions",
|
|
2337
|
+
autoplay: "Autoplay",
|
|
2338
|
+
loop: "Loop",
|
|
2339
|
+
muted: "Muted",
|
|
2340
|
+
controls: "Controls",
|
|
2341
|
+
preload: "Preload",
|
|
2342
|
+
startAt: "Start at",
|
|
2343
|
+
aspectRatio: "Aspect ratio",
|
|
2344
|
+
caption: "Caption"
|
|
1549
2345
|
}
|
|
1550
2346
|
}
|
|
1551
|
-
})),
|
|
1552
|
-
PPage:
|
|
1553
|
-
PSection:
|
|
1554
|
-
PContainer:
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
2347
|
+
})), ai = {
|
|
2348
|
+
PPage: Nr,
|
|
2349
|
+
PSection: Lr,
|
|
2350
|
+
PContainer: Qn,
|
|
2351
|
+
PNav: _r,
|
|
2352
|
+
PFooter: sr,
|
|
2353
|
+
PButton: Un,
|
|
2354
|
+
PText: rn,
|
|
2355
|
+
PHeading: cn,
|
|
2356
|
+
PRichText: Jr,
|
|
2357
|
+
PImage: On,
|
|
2358
|
+
PVideo: ii,
|
|
2359
|
+
PList: yr,
|
|
2360
|
+
PIcon: ur,
|
|
2361
|
+
PDivider: tr,
|
|
2362
|
+
PTextField: Qr,
|
|
2363
|
+
PTextArea: Xr,
|
|
2364
|
+
PCheckbox: Gn,
|
|
2365
|
+
PRadio: Fr,
|
|
2366
|
+
PSelect: zr,
|
|
2367
|
+
PTable: Ur,
|
|
2368
|
+
PArticle: Nn
|
|
1569
2369
|
};
|
|
1570
|
-
function
|
|
1571
|
-
return typeof e == "string" && Object.hasOwn(
|
|
2370
|
+
function oi(e) {
|
|
2371
|
+
return typeof e == "string" && Object.hasOwn(ai, e);
|
|
1572
2372
|
}
|
|
1573
2373
|
// src/schema/elementTemplates.ts
|
|
1574
|
-
function
|
|
2374
|
+
function si(e) {
|
|
1575
2375
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1576
2376
|
}
|
|
1577
|
-
function
|
|
2377
|
+
function ci(e) {
|
|
1578
2378
|
try {
|
|
1579
2379
|
let t = JSON.parse(e);
|
|
1580
|
-
return
|
|
2380
|
+
return si(t) ? t : void 0;
|
|
1581
2381
|
} catch {
|
|
1582
2382
|
return;
|
|
1583
2383
|
}
|
|
1584
2384
|
}
|
|
1585
|
-
function
|
|
1586
|
-
|
|
2385
|
+
function li(e) {
|
|
2386
|
+
if (si(e)) return { ...e };
|
|
2387
|
+
if (!Array.isArray(e)) return {};
|
|
2388
|
+
let t = {};
|
|
2389
|
+
for (let n of e) si(n) && typeof n.key == "string" && (t[n.key] = n.value);
|
|
2390
|
+
return t;
|
|
1587
2391
|
}
|
|
1588
|
-
function
|
|
1589
|
-
let n =
|
|
1590
|
-
|
|
1591
|
-
...
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
return [...n.values()];
|
|
2392
|
+
function ui(e, t) {
|
|
2393
|
+
let n = {
|
|
2394
|
+
...li(e),
|
|
2395
|
+
...li(t)
|
|
2396
|
+
};
|
|
2397
|
+
return Object.keys(n).length > 0 ? n : void 0;
|
|
1595
2398
|
}
|
|
1596
|
-
function
|
|
2399
|
+
function di(e, t) {
|
|
1597
2400
|
let n = {
|
|
1598
2401
|
...e,
|
|
1599
2402
|
...t,
|
|
1600
2403
|
id: e.id
|
|
1601
2404
|
};
|
|
1602
|
-
|
|
2405
|
+
if ("style" in t) {
|
|
2406
|
+
let r = ui(e.style, t.style);
|
|
2407
|
+
r === void 0 ? delete n.style : n.style = r;
|
|
2408
|
+
}
|
|
2409
|
+
return n;
|
|
1603
2410
|
}
|
|
1604
|
-
function
|
|
2411
|
+
function fi(e, t) {
|
|
1605
2412
|
if (!Array.isArray(t)) return {
|
|
1606
2413
|
ok: !1,
|
|
1607
2414
|
message: "Expected a list of children"
|
|
1608
2415
|
};
|
|
1609
2416
|
let n = [];
|
|
1610
2417
|
for (let r of t) {
|
|
1611
|
-
let t =
|
|
2418
|
+
let t = pi(e, r);
|
|
1612
2419
|
if (!t.ok) return t;
|
|
1613
2420
|
n.push(t.item);
|
|
1614
2421
|
}
|
|
@@ -1617,21 +2424,21 @@ function Ln(e, t) {
|
|
|
1617
2424
|
content: n
|
|
1618
2425
|
};
|
|
1619
2426
|
}
|
|
1620
|
-
function
|
|
1621
|
-
if (!
|
|
2427
|
+
function pi(e, t) {
|
|
2428
|
+
if (!si(t)) return {
|
|
1622
2429
|
ok: !1,
|
|
1623
2430
|
message: "Expected an element object"
|
|
1624
2431
|
};
|
|
1625
2432
|
let n = t.type;
|
|
1626
|
-
if (!
|
|
2433
|
+
if (!oi(n)) return {
|
|
1627
2434
|
ok: !1,
|
|
1628
2435
|
message: `Unknown element type "${String(n)}"`
|
|
1629
2436
|
};
|
|
1630
|
-
if (
|
|
2437
|
+
if (!ai[e].allowedChildren.includes(n)) return {
|
|
1631
2438
|
ok: !1,
|
|
1632
2439
|
message: `${n} is not allowed inside ${e}`
|
|
1633
2440
|
};
|
|
1634
|
-
let { children: r, type: i, ...a } = t, o =
|
|
2441
|
+
let { children: r, type: i, ...a } = t, o = ai[n];
|
|
1635
2442
|
if (r !== void 0 && o.allowedChildren.length === 0) return {
|
|
1636
2443
|
ok: !1,
|
|
1637
2444
|
message: `${n} cannot have children`
|
|
@@ -1652,7 +2459,7 @@ function Rn(e, t) {
|
|
|
1652
2459
|
let l = r === void 0 ? {
|
|
1653
2460
|
ok: !0,
|
|
1654
2461
|
content: []
|
|
1655
|
-
} :
|
|
2462
|
+
} : fi(n, r);
|
|
1656
2463
|
return l.ok ? {
|
|
1657
2464
|
ok: !0,
|
|
1658
2465
|
item: {
|
|
@@ -1664,19 +2471,19 @@ function Rn(e, t) {
|
|
|
1664
2471
|
}
|
|
1665
2472
|
} : l;
|
|
1666
2473
|
}
|
|
1667
|
-
function
|
|
2474
|
+
function mi(e, t, n) {
|
|
1668
2475
|
let r = (e) => ({
|
|
1669
2476
|
ok: !1,
|
|
1670
2477
|
message: `Template "${n.name}": ${e}`
|
|
1671
|
-
}), i =
|
|
2478
|
+
}), i = ci(n.shortcode);
|
|
1672
2479
|
if (!i) return r("Expected a JSON object");
|
|
1673
|
-
let { children: a, type: o, ...s } = i, c = e.toDocumentAttributes(t), l = e.attributes.safeParse(
|
|
2480
|
+
let { children: a, type: o, ...s } = i, c = e.toDocumentAttributes(t), l = e.attributes.safeParse(di(c, s));
|
|
1674
2481
|
if (!l.success) return r(l.error.issues[0]?.message ?? "Invalid template");
|
|
1675
2482
|
if (a === void 0) return {
|
|
1676
2483
|
ok: !0,
|
|
1677
2484
|
props: l.data
|
|
1678
2485
|
};
|
|
1679
|
-
let u =
|
|
2486
|
+
let u = fi(e.type, a);
|
|
1680
2487
|
return u.ok ? {
|
|
1681
2488
|
ok: !0,
|
|
1682
2489
|
props: l.data,
|
|
@@ -1684,28 +2491,28 @@ function zn(e, t, n) {
|
|
|
1684
2491
|
} : r(u.message);
|
|
1685
2492
|
}
|
|
1686
2493
|
// src/schema/Fields/ColorField/color-value.ts
|
|
1687
|
-
var
|
|
1688
|
-
function
|
|
2494
|
+
var hi = /^#[0-9A-Fa-f]{6}$/, gi = /^#[0-9A-Fa-f]{8}$/;
|
|
2495
|
+
function _i(e) {
|
|
1689
2496
|
return Math.min(100, Math.max(0, Math.round(e)));
|
|
1690
2497
|
}
|
|
1691
|
-
function
|
|
2498
|
+
function vi(e) {
|
|
1692
2499
|
let t = e.hex.toUpperCase();
|
|
1693
|
-
if (!
|
|
1694
|
-
let n =
|
|
2500
|
+
if (!hi.test(t)) return "#000000FF";
|
|
2501
|
+
let n = _i(e.opacity);
|
|
1695
2502
|
return `${t}${Math.round(n / 100 * 255).toString(16).padStart(2, "0").toUpperCase()}`;
|
|
1696
2503
|
}
|
|
1697
|
-
function
|
|
2504
|
+
function yi(e) {
|
|
1698
2505
|
let t = e.trim().toUpperCase();
|
|
1699
|
-
return
|
|
2506
|
+
return hi.test(t) ? {
|
|
1700
2507
|
hex: t,
|
|
1701
2508
|
opacity: 100
|
|
1702
|
-
} :
|
|
2509
|
+
} : gi.test(t) ? {
|
|
1703
2510
|
hex: t.slice(0, 7),
|
|
1704
|
-
opacity:
|
|
2511
|
+
opacity: _i(Number.parseInt(t.slice(7, 9), 16) / 255 * 100)
|
|
1705
2512
|
} : null;
|
|
1706
2513
|
}
|
|
1707
2514
|
// src/schema/device/deviceStyle.ts
|
|
1708
|
-
var
|
|
2515
|
+
var bi = {
|
|
1709
2516
|
Desktop: {
|
|
1710
2517
|
portrait: "style",
|
|
1711
2518
|
landscape: "style"
|
|
@@ -1719,25 +2526,25 @@ var Gn = {
|
|
|
1719
2526
|
landscape: "mobileLandscapeStyle"
|
|
1720
2527
|
}
|
|
1721
2528
|
};
|
|
1722
|
-
function
|
|
1723
|
-
return
|
|
2529
|
+
function xi(e, t = "portrait") {
|
|
2530
|
+
return bi[e][t];
|
|
1724
2531
|
}
|
|
1725
|
-
function
|
|
1726
|
-
let r =
|
|
2532
|
+
function Si(e, t, n = "portrait") {
|
|
2533
|
+
let r = xi(t, n);
|
|
1727
2534
|
return r === "style" ? {} : e[r] ?? {};
|
|
1728
2535
|
}
|
|
1729
|
-
function
|
|
2536
|
+
function Ci(e, t) {
|
|
1730
2537
|
return JSON.stringify(e) === JSON.stringify(t);
|
|
1731
2538
|
}
|
|
1732
|
-
function
|
|
1733
|
-
return Object.fromEntries(Object.entries(t).filter(([t, n]) => n !== void 0 && !
|
|
2539
|
+
function wi(e, t) {
|
|
2540
|
+
return Object.fromEntries(Object.entries(t).filter(([t, n]) => n !== void 0 && !Ci(n, e[t])));
|
|
1734
2541
|
}
|
|
1735
|
-
function
|
|
1736
|
-
let r = n === "landscape" ?
|
|
2542
|
+
function Ti(e, t, n = "portrait") {
|
|
2543
|
+
let r = n === "landscape" ? Si(e, t, "landscape") : {};
|
|
1737
2544
|
return {
|
|
1738
2545
|
...e.style,
|
|
1739
|
-
...
|
|
2546
|
+
...Si(e, t, "portrait"),
|
|
1740
2547
|
...r
|
|
1741
2548
|
};
|
|
1742
2549
|
}
|
|
1743
|
-
export {
|
|
2550
|
+
export { An as ARTICLE_EXCERPT_LINES, kn as ARTICLE_LAYOUTS, vt as BORDER_LINE_STYLES, ee as COLOR_NAMES, Sr as CONTENT_WIDTHS, ve as DEVICE_CHOICES, Ct as FLEX_ALIGN_CONTENTS, St as FLEX_ALIGN_ITEMS, yt as FLEX_DIRECTIONS, xt as FLEX_JUSTIFY_CONTENTS, bt as FLEX_WRAPS, Yt as FONT_STYLES, $t as FONT_WEIGHTS, an as HEADING_LEVELS, sn as HEADING_PREFIX, Pn as HEROICON_NAMES, bn as IMAGE_ASPECT_RATIOS, wn as IMAGE_CAPTION_ALIGNS, yn as IMAGE_LENGTH_KEYS, xn as IMAGE_OBJECT_FITS, Sn as IMAGE_OBJECT_POSITIONS, W as IMAGE_PREFIX, Cn as IMAGE_SHADOWS, ge as LANDSCAPE_VISIBILITY_PROP_BY_DEVICE, wt as LENGTH_PATTERN, a as LINK_RELS, wr as LINK_UNDERLINES, fr as NAV_ALIGNMENTS, mr as NAV_COLLAPSE_AT, hr as NAV_HEIGHTS, pr as NAV_MOBILE_MENUS, dr as NAV_POSITIONS, Fn as NO_ICON, fe as OPACITY_STEPS, br as PAGE_DIRS, xr as PAGE_TEXT_SIZES, Cr as RADIUS_STYLES, i as SPACING_TOKENS, Zt as TEXT_ALIGNS, Xt as TEXT_DECORATIONS, tn as TEXT_PREFIX, r as TEXT_SIZE_TOKENS, Qt as TEXT_TRANSFORMS, ti as VIDEO_ASPECT_RATIOS, ei as VIDEO_PRELOADS, $r as VIDEO_SOURCES, _e as VISIBILITY_PROPS, S as VISIBILITY_PROP_BY_DEVICE, v as addressSchema, mi as applyElementTemplate, V as backgroundStyleDefinitions, _t as backgroundStyleToCssVariables, s as builderDevices, ne as builderViewports, wi as changedStyle, qt as colorValue, pt as colorValueToCss, K as defaultArticleProps, zn as defaultButtonProps, Wn as defaultCheckboxProps, Zn as defaultContainerStyle, er as defaultDividerProps, M as defaultElementStyle, J as defaultFooterProps, nr as defaultFooterStyle, z as defaultHeadingProps, Y as defaultIconProps, U as defaultImageProps, d as defaultLinkSettings, vr as defaultListProps, X as defaultNavProps, Z as defaultPageSeo, Or as defaultPageStyle, Q as defaultPageTheme, Pr as defaultRadioProps, qr as defaultRichTextProps, Ir as defaultSectionStyle, Rr as defaultSelectProps, Br as defaultTableProps, Yr as defaultTextAreaProps, Zr as defaultTextFieldProps, en as defaultTextProps, $ as defaultVideoProps, x as defineElement, Kn as defineLayoutElement, re as deviceForWidth, o as deviceMediaQueries, Si as deviceOverride, xi as deviceStyleProp, E as documentStyleAttribute, Le as documentStyleOverrideSchema, D as documentStyleSchema, Jn as elementCategories, b as elementIdSchema, ai as elementRegistry, hn as elementStyleDefinitions, gn as elementStyleSchema, Nt as elementStyleToCssVariables, Vr as fitRowsToHeaders, yi as fromHexAlpha, ut as gradientToCss, qn as hiddenFromDrawer, lr as iconShapes, cr as iconSizes, oi as isElementType, ie as isFontFamily, Ln as isHeroiconName, se as isPaletteColor, lt as isSafeGradientArgs, C as isShownOn, Rn as labelForIcon, Xn as layoutChildren, H as lengthKeys, I as lengthValue, l as linkAddressSchema, g as linkHistoryLabels, he as linkRelAttribute, t as linkSettingsShape, Gr as normalizeRichText, u as orientationForWidth, Nn as pArticleDefinition, Un as pButtonDefinition, Gn as pCheckboxDefinition, Qn as pContainerDefinition, tr as pDividerDefinition, sr as pFooterDefinition, cn as pHeadingDefinition, ur as pIconDefinition, On as pImageDefinition, yr as pListDefinition, _r as pNavDefinition, Nr as pPageDefinition, Fr as pRadioDefinition, Jr as pRichTextDefinition, Lr as pSectionDefinition, zr as pSelectDefinition, Ur as pTableDefinition, Xr as pTextAreaDefinition, rn as pTextDefinition, Qr as pTextFieldDefinition, ii as pVideoDefinition, Ar as pageStyleKeys, ae as pageTokensToVarValues, ue as parseYoutubeId, Ti as resolveDeviceStyle, Kr as richTextToPlainText, P as sanitizeAutoAsZero, Dt as sanitizeBorderWidth, N as sanitizeLength, Et as sanitizeMaxLength, be as shownDeviceCount, Ee as styleItemsSchema, w as styleLabels, De as styleOverrideItemsSchema, de as styleToClasses, A as textItemsSchema, mt as textSizeToCss, nn as textStyleDefinitions, T as toDocumentStyle, Fe as toDocumentStyleOverride, vi as toHexAlpha, _ as toLinkAttributes, f as toPaletteColor, p as toSpacingToken, Ae as toStyleItems, je as toStyleOverrideItems, j as toTextItems, h as toTextSizeToken, me as unresolvedStyleForVars, ye as visibilityProp, k as withDeviceSettings, ce as youtubeEmbedUrl, le as youtubeThumbnailUrl };
|