@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.
Files changed (54) hide show
  1. package/README.md +1 -13
  2. package/dist/definitions.d.ts +15 -9
  3. package/dist/definitions.js +1756 -949
  4. package/dist/elements/article/definition.d.ts +43 -0
  5. package/dist/elements/article/template.d.ts +12 -0
  6. package/dist/elements/button/definition.d.ts +1 -0
  7. package/dist/elements/footer/definition.d.ts +35 -0
  8. package/dist/elements/footer/template.d.ts +2 -0
  9. package/dist/elements/heading/definition.d.ts +29 -0
  10. package/dist/elements/heading/template.d.ts +2 -0
  11. package/dist/elements/icon/definition.d.ts +11 -0
  12. package/dist/elements/image/definition.d.ts +47 -0
  13. package/dist/elements/image/template.d.ts +30 -0
  14. package/dist/elements/list/definition.d.ts +2 -0
  15. package/dist/elements/nav/definition.d.ts +39 -0
  16. package/dist/elements/nav/template.d.ts +17 -0
  17. package/dist/elements/page/definition.d.ts +41 -1
  18. package/dist/elements/table/definition.d.ts +2 -0
  19. package/dist/elements/text/definition.d.ts +2 -1
  20. package/dist/elements/video/definition.d.ts +39 -0
  21. package/dist/elements/video/template.d.ts +6 -0
  22. package/dist/elements/video/youtube.d.ts +4 -0
  23. package/dist/manifest.json +2 -2
  24. package/dist/plmt-elements.css +1 -1
  25. package/dist/render/renderHtml.d.ts +1 -1
  26. package/dist/render/styleToClasses.d.ts +8 -9
  27. package/dist/render/styleToVars.d.ts +2 -0
  28. package/dist/render/styleTokens.d.ts +11 -1
  29. package/dist/render/tags.d.ts +9 -1
  30. package/dist/render/types.d.ts +4 -0
  31. package/dist/schema/Fields/ColorField/colorText.d.ts +3 -0
  32. package/dist/schema/Fields/IconPicker/iconCatalog.d.ts +5 -1
  33. package/dist/schema/addressSchema.d.ts +2 -0
  34. package/dist/schema/device/devices.d.ts +8 -0
  35. package/dist/schema/deviceSettings.d.ts +1 -1
  36. package/dist/schema/elementCategories.d.ts +29 -0
  37. package/dist/schema/elementConfiguration.d.ts +1 -1
  38. package/dist/schema/elementRegistry.d.ts +25 -1
  39. package/dist/schema/elementStyleDefinitions.d.ts +6 -14
  40. package/dist/schema/elementTemplates.d.ts +3 -2
  41. package/dist/schema/linkSettings.d.ts +19 -2
  42. package/dist/schema/style/elementStyle.d.ts +1 -1
  43. package/dist/schema/styleItems.d.ts +18 -0
  44. package/dist/schema/styleTokensSchema.d.ts +34 -18
  45. package/dist/tags.json +5 -1
  46. package/dist/templates/brands/brandSpec.d.ts +5 -0
  47. package/dist/templates/elementSpec.d.ts +1 -1
  48. package/dist/templates/head.d.ts +43 -0
  49. package/dist/templates/heroicons/heroiconSpec.d.ts +6 -0
  50. package/dist/templates.d.ts +3 -0
  51. package/dist/templates.js +1351 -237
  52. package/dist/youtube-BDsE1Bz3.js +910 -0
  53. package/package.json +3 -3
  54. package/dist/styleToClasses-CZSWp6Ez.js +0 -683
@@ -1,83 +1,464 @@
1
- import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, o as u, p as ee, r as te, s as ne, t as re, u as ie } from "./styleToClasses-CZSWp6Ez.js";
2
- import { z as d } from "zod";
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 f = d.string().trim().min(1);
5
- function p(e) {
4
+ var b = y.string().trim().min(1);
5
+ function x(e) {
6
6
  return e;
7
7
  }
8
- var ae = /^[#0-9a-z%.,\s()-]+$/i, oe = /url|var|image|expression|attr/i;
9
- function m(e) {
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 && ae.test(t) && !oe.test(t);
392
+ return t !== "" && t.length <= 200 && st.test(t) && !ct.test(t);
12
393
  }
13
- function se(e) {
14
- if (m(e.value)) return `${e.kind}-gradient(${e.value.trim()})`;
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 ce = /^#[0-9A-Fa-f]{6}$/;
18
- function le(e) {
19
- return ce.test(e) ? [
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 ue(e) {
26
- if (ee(e)) return l(e);
27
- let t = le(e.hex);
28
- if (!t || !Number.isFinite(e.opacity)) return;
29
- if (e.opacity === 100) return e.hex.toUpperCase();
30
- let n = Math.min(100, Math.max(0, e.opacity)) / 100, [r, i, a] = t;
31
- return `rgba(${r}, ${i}, ${a}, ${n})`;
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 de(e) {
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 fe(e) {
38
- if (e.backgroundType === "gradient") return "transparent";
39
- if (e.backgroundColor) return ee(e.backgroundColor) ? l(e.backgroundColor) : ue(e.backgroundColor);
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 pe(e) {
422
+ function gt(e) {
42
423
  if (e.backgroundType !== "gradient") return "none";
43
- if (e.backgroundGradient) return se(e.backgroundGradient);
424
+ if (e.backgroundGradient) return ut(e.backgroundGradient);
44
425
  }
45
- function me(e, t) {
426
+ function _t(e, t) {
46
427
  return e.backgroundType ? {
47
- [`${t}-background-color`]: fe(e),
48
- [`${t}-background-image`]: pe(e)
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 h = [
433
+ var vt = [
53
434
  "none",
54
435
  "solid",
55
436
  "dashed",
56
437
  "dotted",
57
438
  "double"
58
- ], he = [
439
+ ], yt = [
59
440
  "row",
60
441
  "column",
61
442
  "row-reverse",
62
443
  "column-reverse"
63
- ], ge = [
444
+ ], bt = [
64
445
  "nowrap",
65
446
  "wrap",
66
447
  "wrap-reverse"
67
- ], _e = [
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
- ], ve = [
455
+ ], St = [
75
456
  "stretch",
76
457
  "flex-start",
77
458
  "center",
78
459
  "flex-end",
79
460
  "baseline"
80
- ], ye = ["stretch", ..._e], g = {
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
- }, _ = /^(auto|0|-?\d+(\.\d+)?(px|rem|em|%))$/i, be = /^(0|\d+(\.\d+)?(px|rem|em))$/i;
122
- function v(e) {
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 (_.test(t)) return t;
505
+ if (wt.test(t)) return t;
125
506
  }
126
- function y(e) {
127
- let t = v(e);
507
+ function P(e) {
508
+ let t = N(e);
128
509
  if (t != null) return t.toLowerCase() === "auto" ? "0" : t;
129
510
  }
130
- function xe(e) {
131
- let t = v(e);
511
+ function Et(e) {
512
+ let t = N(e);
132
513
  return t?.toLowerCase() === "auto" ? "none" : t;
133
514
  }
134
- function Se(e) {
515
+ function Dt(e) {
135
516
  let t = e.trim();
136
- return be.test(t) ? t : void 0;
517
+ return Tt.test(t) ? t : void 0;
137
518
  }
138
- function Ce(e, t) {
519
+ function Ot(e, t) {
139
520
  return e === "hide" ? "hidden" : t ? "auto" : "hidden";
140
521
  }
141
- var we = [
522
+ var kt = [
142
523
  "marginTop",
143
524
  "marginBottom",
144
525
  "marginLeft",
145
526
  "marginRight"
146
527
  ];
147
- function Te(e) {
528
+ function At(e) {
148
529
  return e.trim().toLowerCase() === "auto";
149
530
  }
150
- function b(e, t) {
151
- return we.every((t) => Te(e[t])) ? "0" : v(e[t]);
531
+ function jt(e, t) {
532
+ return kt.every((t) => At(e[t])) ? "0" : N(e[t]);
152
533
  }
153
- function Ee(e) {
534
+ function Mt(e) {
154
535
  return e.layout !== "grid" || e.gridColumns == null ? "none" : `repeat(${e.gridColumns}, minmax(0, 1fr))`;
155
536
  }
156
- function De(e, t) {
537
+ function Nt(e, t) {
157
538
  let n = {
158
- ...g,
539
+ ...M,
159
540
  ...e
160
541
  }, r = `--palmyit-${t}`;
161
542
  return {
162
543
  [`${r}-display`]: n.layout,
163
- [`${r}-grid-template-columns`]: Ee(n),
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`]: y(n.rowGap),
170
- [`${r}-column-gap`]: y(n.columnGap),
171
- [`${r}-overflow-x`]: Ce(n.overflow, n.overflowHorizontal),
172
- [`${r}-overflow-y`]: Ce(n.overflow, n.overflowVertical),
173
- [`${r}-width`]: v(n.width),
174
- [`${r}-height`]: v(n.height),
175
- [`${r}-min-width`]: v(n.minWidth),
176
- [`${r}-min-height`]: v(n.minHeight),
177
- [`${r}-max-width`]: xe(n.maxWidth),
178
- [`${r}-max-height`]: xe(n.maxHeight),
179
- [`${r}-padding-top`]: y(n.paddingTop),
180
- [`${r}-padding-bottom`]: y(n.paddingBottom),
181
- [`${r}-padding-left`]: y(n.paddingLeft),
182
- [`${r}-padding-right`]: y(n.paddingRight),
183
- [`${r}-margin-top`]: b(n, "marginTop"),
184
- [`${r}-margin-bottom`]: b(n, "marginBottom"),
185
- [`${r}-margin-left`]: b(n, "marginLeft"),
186
- [`${r}-margin-right`]: b(n, "marginRight"),
187
- [`${r}-border-top-left-radius`]: y(n.borderRadiusTopLeft),
188
- [`${r}-border-top-right-radius`]: y(n.borderRadiusTopRight),
189
- [`${r}-border-bottom-right-radius`]: y(n.borderRadiusBottomRight),
190
- [`${r}-border-bottom-left-radius`]: y(n.borderRadiusBottomLeft),
191
- [`${r}-border-width`]: Se(n.borderWidth),
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`]: ue(n.borderColor),
194
- ...me(n, r)
574
+ [`${r}-border-color`]: pt(n.borderColor),
575
+ ..._t(n, r)
195
576
  };
196
577
  }
197
578
  // src/schema/styleTokensSchema.ts
198
- var Oe = d.enum(ie), ke = d.enum(t), Ae = d.enum(c), je = d.enum(r), Me = d.enum(ne), Ne = d.enum(i), x = d.string().trim().regex(_, "Expected auto, 0, or a px, rem, em, or % length"), S = d.union([
199
- Oe,
200
- Ae,
201
- x
202
- ]), Pe = d.union([ke, x]), Fe = d.union([
203
- je,
204
- d.number().min(1).max(200),
205
- x
206
- ]), Ie = d.union([Me, x]), Le = d.union([Ne, x]), Re = d.strictObject({
207
- hex: d.string().regex(/^#[0-9A-Fa-f]{6}$/, "Expected a #RRGGBB color"),
208
- opacity: d.number().int().min(0).max(100)
209
- }), ze = new Set(n), Be = d.strictObject({
210
- name: d.enum(u),
211
- opacity: d.number().int().refine((e) => ze.has(e), "Expected a Tailwind opacity step such as 0, 10, 50, or 100")
212
- }), C = d.union([Be, Re]), Ve = d.strictObject({
213
- kind: d.enum(["linear", "radial"]),
214
- value: d.string().refine(m, "Expected gradient arguments such as 135deg, #2563EB, #7C3AED")
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 w(e, { defaults: t, typeAttribute: n } = {}) {
796
+ function V(e, { defaults: t, typeAttribute: n } = {}) {
217
797
  return [
218
798
  {
219
799
  key: "backgroundType",
220
800
  ...n ? { attribute: n } : {},
221
- value: d.enum(["color", "gradient"]),
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: Ve,
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 R = [
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 left"
865
+ "Padding start"
584
866
  ],
585
867
  [
586
868
  "paddingRight",
587
869
  "padding-right",
588
- "Padding right"
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 left"
885
+ "Margin start"
604
886
  ],
605
887
  [
606
888
  "marginRight",
607
889
  "margin-right",
608
- "Margin right"
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 St(e) {
913
+ function un(e) {
632
914
  let t = `--palmyit-${e}`, n = {
633
915
  key: "gridColumns",
634
916
  variable: `${t}-grid-template-columns`,
635
- value: d.union([
636
- d.literal(2),
637
- d.literal(3),
638
- d.literal(4)
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: d.enum([
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
- ...Ct(e)
938
+ ...dn(e)
657
939
  ];
658
940
  }
659
- function Ct(e) {
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: d.enum(he),
666
- defaultValue: g.flexDirection,
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: d.enum(ge),
673
- defaultValue: g.flexWrap,
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: d.enum(_e),
680
- defaultValue: g.justifyContent,
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: d.enum(ve),
687
- defaultValue: g.alignItems,
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: d.enum(ye),
694
- defaultValue: g.alignContent,
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: S,
701
- defaultValue: g.rowGap,
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: S,
708
- defaultValue: g.columnGap,
989
+ value: I,
990
+ defaultValue: M.columnGap,
709
991
  label: "Column gap"
710
992
  }
711
993
  ];
712
994
  }
713
- function wt(e, t) {
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: d.enum(["show", "hide"]),
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: d.boolean(),
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: d.boolean(),
1018
+ value: y.boolean(),
737
1019
  defaultValue: t.overflowVertical,
738
1020
  label: "Vertical overflow"
739
1021
  }
740
1022
  ];
741
1023
  }
742
- function Tt(e, t) {
743
- return R.map(([n, r, i]) => ({
1024
+ function pn(e, t) {
1025
+ return H.map(([n, r, i]) => ({
744
1026
  key: n,
745
1027
  variable: `--palmyit-${e}-${r}`,
746
- value: S,
1028
+ value: I,
747
1029
  defaultValue: t[n],
748
1030
  label: i
749
1031
  }));
750
1032
  }
751
- function Et(e, t) {
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: Pe,
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: d.enum(h),
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
- value: C,
772
- defaultValue: t.borderColor,
773
- label: "Border color"
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 Dt(e, t) {
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 jt(e) {
804
- return e.replace(/^MdOutline/, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2");
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 Mt = {
1332
+ var zn = {
808
1333
  name: "Button",
809
1334
  startIcon: "",
810
1335
  endIcon: "",
811
- ...P,
1336
+ ...d,
812
1337
  style: {}
813
- }, Nt = d.string().refine((e) => e === "" || z(e), "Expected an outlined Material icon name such as MdOutlineHome").default("");
814
- function Pt(e, t) {
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 B = "--palmyit-button", V = [
818
- ...w(B, { typeAttribute: "data-background" }),
1342
+ var q = "--palmyit-button", Hn = [
1343
+ ...V(q, { typeAttribute: "data-background" }),
819
1344
  {
820
1345
  key: "borderWidth",
821
- variable: `${B}-border-width`,
822
- value: Pe,
1346
+ variable: `${q}-border-width`,
1347
+ value: Bt,
823
1348
  label: "Border width"
824
1349
  },
825
1350
  {
826
1351
  key: "borderStyle",
827
- variable: `${B}-border-style`,
828
- value: d.enum(h),
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: `${B}-border-color`,
834
- value: C,
1358
+ variable: `${q}-border-color`,
835
1359
  label: "Border color"
836
- },
837
- ...R.map(([e, t, n]) => ({
1360
+ }),
1361
+ ...H.map(([e, t, n]) => ({
838
1362
  key: e,
839
- variable: `${B}-${t}`,
840
- value: S,
1363
+ variable: `${q}-${t}`,
1364
+ value: I,
841
1365
  label: n
842
1366
  })),
843
- {
1367
+ L({
844
1368
  key: "textColor",
845
- variable: `${B}-text-color`,
846
- value: C,
1369
+ variable: `${q}-text-color`,
847
1370
  label: "Text color"
848
- },
1371
+ }),
849
1372
  {
850
1373
  key: "textFont",
851
- variable: `${B}-font-family`,
852
- value: d.string().refine(xt, "Expected a Google Fonts family name"),
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: `${B}-font-size`,
858
- value: Fe,
1380
+ variable: `${q}-font-size`,
1381
+ value: Vt,
859
1382
  label: "Text size"
860
1383
  },
861
1384
  {
862
1385
  key: "iconGap",
863
- variable: `${B}-gap`,
864
- value: S,
1386
+ variable: `${q}-gap`,
1387
+ value: I,
865
1388
  label: "Icon gap"
866
1389
  }
867
- ], Ft = M(p({
1390
+ ], Un = k(x({
868
1391
  type: "PButton",
869
1392
  label: "Button",
870
1393
  allowedChildren: [],
871
1394
  templates: [],
872
- attributes: d.strictObject({
873
- id: f,
874
- name: d.string().trim().min(1, "Enter a button label").default(Mt.name),
875
- startIcon: Nt,
876
- endIcon: Nt,
877
- ...F,
878
- style: O(V).transform((e) => e)
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, style: s }) => ({
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
- ...Pt("startIcon", n),
884
- ...Pt("endIcon", r),
885
- ...L({
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
- style: A(s, V)
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
- ...I,
899
- ...k(V, "style.")
1422
+ ...g,
1423
+ ...w(Hn, "style.")
900
1424
  }
901
1425
  }
902
- }), V), H = {
1426
+ }), Hn), Wn = {
903
1427
  label: "Checkbox",
904
1428
  checked: !1
905
- }, It = M(p({
1429
+ }, Gn = k(x({
906
1430
  type: "PCheckbox",
907
1431
  label: "Checkbox input",
908
1432
  allowedChildren: [],
909
1433
  templates: [],
910
- attributes: d.strictObject({
911
- id: f,
912
- label: d.string().trim().min(1, "Enter a label").default(H.label),
913
- checked: d.boolean().default(H.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 U({ type: e, label: t, kind: n, defaultStyle: r, allowedChildren: i, templates: a }) {
930
- let o = Dt(n, r);
931
- return M(p({
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: d.strictObject({
937
- id: f,
938
- style: Ot(o, r)
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
- style: A(t, o)
1466
+ ...E(T(t, o))
943
1467
  }),
944
1468
  history: {
945
1469
  summary: () => t,
946
- attributes: k(o, "style.")
1470
+ attributes: w(o, "style.")
947
1471
  }
948
1472
  }), o);
949
1473
  }
950
- // src/schema/layoutChildren.ts
951
- var W = [
952
- "PContainer",
953
- "PButton",
954
- "PText",
955
- "PRichText",
956
- "PImage",
957
- "PVideo",
958
- "PList",
959
- "PIcon",
960
- "PDivider",
961
- "PTable",
962
- "PTextField",
963
- "PTextArea",
964
- "PCheckbox",
965
- "PRadio",
966
- "PSelect"
967
- ], Lt = { ...g }, Rt = U({
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: Lt,
972
- allowedChildren: W,
1526
+ defaultStyle: Zn,
1527
+ allowedChildren: Xn,
973
1528
  templates: []
974
- }), zt = [
1529
+ }), $n = [
975
1530
  "1",
976
1531
  "2",
977
1532
  "3",
978
1533
  "4"
979
- ], Bt = { size: "4" }, Vt = M(p({
1534
+ ], er = { size: "4" }, tr = k(x({
980
1535
  type: "PDivider",
981
1536
  label: "Divider",
982
1537
  allowedChildren: [],
983
1538
  templates: [],
984
- attributes: d.strictObject({
985
- id: f,
986
- size: d.enum(zt).default(Bt.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
- })), G = {
997
- icon: "MdOutlineStarBorder",
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
- ...P
1000
- }, Ht = M(p({
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: d.strictObject({
1006
- id: f,
1007
- icon: d.string().refine(z, "Choose an outlined Material icon such as MdOutlineHome").default(G.icon),
1008
- label: d.string().trim().default(G.label),
1009
- ...F
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, href: r, target: i, description: a }) => ({
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
- ...L({
1019
- href: r,
1020
- target: i,
1021
- description: a
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 || jt(e),
1702
+ summary: ({ icon: e, label: t }) => t || Rn(e),
1026
1703
  attributes: {
1027
1704
  icon: "Icon",
1028
1705
  label: "Description",
1029
- ...I
1706
+ size: "Size",
1707
+ shape: "Shape",
1708
+ ...g
1030
1709
  }
1031
1710
  }
1032
- })), Ut = [
1033
- "width",
1034
- "height",
1035
- "minWidth",
1036
- "minHeight",
1037
- "maxWidth",
1038
- "maxHeight"
1039
- ], Wt = [
1040
- "borderRadiusTopLeft",
1041
- "borderRadiusTopRight",
1042
- "borderRadiusBottomRight",
1043
- "borderRadiusBottomLeft"
1044
- ], Gt = [...Ut, ...Wt], Kt = {
1045
- src: "/image-placeholder.svg",
1046
- alt: "Image",
1047
- style: {},
1048
- ...P
1049
- }, K = "--palmyit-image";
1050
- function qt(e) {
1051
- return R.filter(([t]) => e.includes(t)).map(([e, t, n]) => ({
1052
- key: e,
1053
- variable: `${K}-${t}`,
1054
- value: S,
1055
- label: n
1056
- }));
1057
- }
1058
- var q = [
1059
- ...qt(Ut),
1060
- ...w(K, { typeAttribute: "data-background" }),
1061
- {
1062
- key: "borderWidth",
1063
- variable: `${K}-border-width`,
1064
- value: Pe,
1065
- label: "Border width"
1066
- },
1067
- {
1068
- key: "borderStyle",
1069
- variable: `${K}-border-style`,
1070
- value: d.enum(h),
1071
- label: "Border style"
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
- attributes: d.strictObject({
1086
- id: f,
1087
- src: N.default(Kt.src),
1088
- alt: d.string().trim().default(Kt.alt),
1089
- style: O(q).transform((e) => e),
1090
- ...F
1091
- }).refine(({ href: e, alt: t }) => e === "" || t !== "", {
1092
- path: ["alt"],
1093
- message: "Describe a linked image so the link has a name"
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: ({ id: e, src: t, alt: n, style: r, href: i, target: a, description: o }) => ({
1096
- id: e,
1097
- src: t,
1098
- alt: n,
1099
- style: A(r, q),
1100
- ...L({
1101
- href: i,
1102
- target: a,
1103
- description: o
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: ({ alt: e }) => e,
1863
+ summary: ({ brandText: e }) => e || "Navigation",
1108
1864
  attributes: {
1109
- src: "Image address",
1110
- alt: "Description",
1111
- ...I,
1112
- ...k(q, "style.")
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
- }), q);
1116
- // src/schema/textItems.ts
1117
- function J(e, t) {
1118
- return d.array(d.strictObject({ text: d.string().trim().min(1, t) })).min(1, e);
1119
- }
1120
- function Y(e) {
1121
- return e.map(({ text: e }) => ({ text: e }));
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: d.strictObject({
1134
- id: f,
1135
- items: J("Add a list item", "Enter item text").default(Yt.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: Y(t)
1900
+ items: j(t),
1901
+ ...n ? { ordered: !0 } : {}
1140
1902
  }),
1141
1903
  history: {
1142
1904
  summary: ({ items: e }) => e[0]?.text ?? "",
1143
- attributes: { items: "Items" }
1905
+ attributes: {
1906
+ items: "Items",
1907
+ ordered: "Ordered"
1908
+ }
1144
1909
  }
1145
- })), Zt = /^\/([a-z0-9]+(-[a-z0-9]+)*)?$/, X = {
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
- value: C,
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
- value: C,
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: Fe,
1174
- defaultValue: X.textSize,
1972
+ value: y.enum(xr),
1973
+ defaultValue: Or.textSize,
1175
1974
  label: "Text size"
1176
1975
  }
1177
- ], Qt = Z.map(({ key: e }) => e), $t = p({
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: ["PSection"],
1979
+ allowedChildren: [
1980
+ "PNav",
1981
+ "PSection",
1982
+ "PFooter"
1983
+ ],
1181
1984
  templates: [],
1182
- attributes: d.strictObject({
1183
- id: f,
1184
- url: d.string().regex(Zt, "Expected / or a lowercase path such as /about-us"),
1185
- title: d.string().default(""),
1186
- style: O(Z)
1187
- }).transform(({ id: e, url: t, title: n, style: r }) => ({
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
- ...r
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, ...r }) => ({
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
- style: A(r, Z)
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
- ...k(Z)
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
- }), en = {
2062
+ }), Pr = {
1208
2063
  legend: "Choose one",
1209
2064
  options: [{ text: "Option 1" }, { text: "Option 2" }]
1210
- }, tn = M(p({
2065
+ }, Fr = k(x({
1211
2066
  type: "PRadio",
1212
2067
  label: "Radio input",
1213
2068
  allowedChildren: [],
1214
2069
  templates: [],
1215
- attributes: d.strictObject({
1216
- id: f,
1217
- legend: d.string().trim().min(1, "Enter a question").default(en.legend),
1218
- options: J("Add an option", "Enter option text").default(en.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: Y(n)
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
- })), nn = { ...g }, rn = U({
2087
+ })), Ir = { ...M }, Lr = Kn({
1233
2088
  type: "PSection",
1234
2089
  label: "Section",
1235
2090
  kind: "section",
1236
- defaultStyle: nn,
1237
- allowedChildren: W,
2091
+ defaultStyle: Ir,
2092
+ allowedChildren: Xn,
1238
2093
  templates: []
1239
- }), an = {
2094
+ }), Rr = {
1240
2095
  label: "Select",
1241
2096
  options: [{ text: "Option 1" }, { text: "Option 2" }]
1242
- }, on = M(p({
2097
+ }, zr = k(x({
1243
2098
  type: "PSelect",
1244
2099
  label: "Select",
1245
2100
  allowedChildren: [],
1246
2101
  templates: [],
1247
- attributes: d.strictObject({
1248
- id: f,
1249
- label: d.string().trim().min(1, "Enter a label").default(an.label),
1250
- options: J("Add an option", "Enter option text").default(an.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: Y(n)
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
- })), sn = {
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 cn(e, t) {
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 ln = d.strictObject({ cells: d.array(d.string()) }), un = M(p({
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: d.strictObject({
1289
- id: f,
1290
- headers: J("Add a column", "Enter a column heading").default(sn.headers),
1291
- rows: d.array(ln).default(sn.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: Y(t),
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
- })), dn = /<[^>]*>/g;
1318
- function fn(e) {
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 pn(e) {
1323
- return e.replace(dn, " ").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/\s+/g, " ").trim();
2181
+ function Kr(e) {
2182
+ return e.replace(Wr, " ").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/\s+/g, " ").trim();
1324
2183
  }
1325
2184
  // src/elements/rich-text/definition.ts
1326
- var mn = { text: "<p>Add your main text here. Double-click to edit and customize your content to make it selectable.</p>" }, hn = M(p({
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: d.strictObject({
1332
- id: f,
1333
- text: d.string().transform(fn).refine((e) => pn(e).trim().length > 0, "Enter text").default(mn.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: fn(t)
2196
+ text: Gr(t)
1338
2197
  }),
1339
2198
  history: {
1340
- summary: ({ text: e }) => pn(e),
2199
+ summary: ({ text: e }) => Kr(e),
1341
2200
  attributes: { text: "Text" }
1342
2201
  }
1343
- })), gn = [
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
- }, En = M(p({
2205
+ }, Xr = k(x({
1480
2206
  type: "PTextArea",
1481
2207
  label: "Text area",
1482
2208
  allowedChildren: [],
1483
2209
  templates: [],
1484
- attributes: d.strictObject({
1485
- id: f,
1486
- label: d.string().trim().min(1, "Enter a label").default(Tn.label),
1487
- placeholder: d.string().default(Tn.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
- })), Dn = {
2227
+ })), Zr = {
1502
2228
  label: "Text field",
1503
2229
  placeholder: ""
1504
- }, On = M(p({
2230
+ }, Qr = k(x({
1505
2231
  type: "PTextField",
1506
2232
  label: "Text field",
1507
2233
  allowedChildren: [],
1508
2234
  templates: [],
1509
- attributes: d.strictObject({
1510
- id: f,
1511
- label: d.string().trim().min(1, "Enter a label").default(Dn.label),
1512
- placeholder: d.string().default(Dn.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
- })), kn = {
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
- title: "Video"
1529
- }, An = M(p({
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: d.strictObject({
1535
- id: f,
1536
- src: d.union([d.literal(""), N]).default(kn.src),
1537
- title: d.string().trim().min(1, "Enter a video title").default(kn.title)
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, src: t, title: n }) => ({
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
- src: t,
1542
- title: n
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
- title: "Title"
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: $t,
1553
- PSection: rn,
1554
- PContainer: Rt,
1555
- PButton: Ft,
1556
- PText: wn,
1557
- PRichText: hn,
1558
- PImage: Jt,
1559
- PVideo: An,
1560
- PList: Xt,
1561
- PIcon: Ht,
1562
- PDivider: Vt,
1563
- PTextField: On,
1564
- PTextArea: En,
1565
- PCheckbox: It,
1566
- PRadio: tn,
1567
- PSelect: on,
1568
- PTable: un
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 jn(e) {
1571
- return typeof e == "string" && Object.hasOwn($, e);
2370
+ function oi(e) {
2371
+ return typeof e == "string" && Object.hasOwn(ai, e);
1572
2372
  }
1573
2373
  // src/schema/elementTemplates.ts
1574
- function Mn(e) {
2374
+ function si(e) {
1575
2375
  return typeof e == "object" && !!e && !Array.isArray(e);
1576
2376
  }
1577
- function Nn(e) {
2377
+ function ci(e) {
1578
2378
  try {
1579
2379
  let t = JSON.parse(e);
1580
- return Mn(t) ? t : void 0;
2380
+ return si(t) ? t : void 0;
1581
2381
  } catch {
1582
2382
  return;
1583
2383
  }
1584
2384
  }
1585
- function Pn(e) {
1586
- return Array.isArray(e) ? e : [];
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 Fn(e, t) {
1589
- let n = new Map(Pn(e).map((e) => [e.key, e]));
1590
- for (let e of Pn(t)) n.set(e.key, {
1591
- ...n.get(e.key),
1592
- ...e
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 In(e, t) {
2399
+ function di(e, t) {
1597
2400
  let n = {
1598
2401
  ...e,
1599
2402
  ...t,
1600
2403
  id: e.id
1601
2404
  };
1602
- return "style" in t && (n.style = Fn(e.style, t.style)), n;
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 Ln(e, t) {
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 = Rn(e, r);
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 Rn(e, t) {
1621
- if (!Mn(t)) return {
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 (!jn(n)) return {
2433
+ if (!oi(n)) return {
1627
2434
  ok: !1,
1628
2435
  message: `Unknown element type "${String(n)}"`
1629
2436
  };
1630
- if (!$[e].allowedChildren.includes(n)) return {
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 = $[n];
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
- } : Ln(n, r);
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 zn(e, t, n) {
2474
+ function mi(e, t, n) {
1668
2475
  let r = (e) => ({
1669
2476
  ok: !1,
1670
2477
  message: `Template "${n.name}": ${e}`
1671
- }), i = Nn(n.shortcode);
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(In(c, s));
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 = Ln(e.type, a);
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 Bn = /^#[0-9A-Fa-f]{6}$/, Vn = /^#[0-9A-Fa-f]{8}$/;
1688
- function Hn(e) {
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 Un(e) {
2498
+ function vi(e) {
1692
2499
  let t = e.hex.toUpperCase();
1693
- if (!Bn.test(t)) return "#000000FF";
1694
- let n = Hn(e.opacity);
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 Wn(e) {
2504
+ function yi(e) {
1698
2505
  let t = e.trim().toUpperCase();
1699
- return Bn.test(t) ? {
2506
+ return hi.test(t) ? {
1700
2507
  hex: t,
1701
2508
  opacity: 100
1702
- } : Vn.test(t) ? {
2509
+ } : gi.test(t) ? {
1703
2510
  hex: t.slice(0, 7),
1704
- opacity: Hn(Number.parseInt(t.slice(7, 9), 16) / 255 * 100)
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 Gn = {
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 Kn(e, t = "portrait") {
1723
- return Gn[e][t];
2529
+ function xi(e, t = "portrait") {
2530
+ return bi[e][t];
1724
2531
  }
1725
- function qn(e, t, n = "portrait") {
1726
- let r = Kn(t, n);
2532
+ function Si(e, t, n = "portrait") {
2533
+ let r = xi(t, n);
1727
2534
  return r === "style" ? {} : e[r] ?? {};
1728
2535
  }
1729
- function Jn(e, t) {
2536
+ function Ci(e, t) {
1730
2537
  return JSON.stringify(e) === JSON.stringify(t);
1731
2538
  }
1732
- function Yn(e, t) {
1733
- return Object.fromEntries(Object.entries(t).filter(([t, n]) => n !== void 0 && !Jn(n, e[t])));
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 Xn(e, t, n = "portrait") {
1736
- let r = n === "landscape" ? qn(e, t, "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
- ...qn(e, t, "portrait"),
2546
+ ...Si(e, t, "portrait"),
1740
2547
  ...r
1741
2548
  };
1742
2549
  }
1743
- export { h as BORDER_LINE_STYLES, u as COLOR_NAMES, qe as DEVICE_CHOICES, ye as FLEX_ALIGN_CONTENTS, ve as FLEX_ALIGN_ITEMS, he as FLEX_DIRECTIONS, _e as FLEX_JUSTIFY_CONTENTS, ge as FLEX_WRAPS, gn as FONT_STYLES, bn as FONT_WEIGHTS, Gt as IMAGE_LENGTH_KEYS, K as IMAGE_PREFIX, Ge as LANDSCAPE_VISIBILITY_PROP_BY_DEVICE, _ as LENGTH_PATTERN, At as NO_ICON, n as OPACITY_STEPS, ie as SPACING_TOKENS, vn as TEXT_ALIGNS, _n as TEXT_DECORATIONS, Sn as TEXT_PREFIX, r as TEXT_SIZE_TOKENS, yn as TEXT_TRANSFORMS, Ke as VISIBILITY_PROPS, E as VISIBILITY_PROP_BY_DEVICE, N as addressSchema, zn as applyElementTemplate, w as backgroundStyleDefinitions, me as backgroundStyleToCssVariables, T as builderDevices, He as builderViewports, Yn as changedStyle, C as colorValue, ue as colorValueToCss, Mt as defaultButtonProps, H as defaultCheckboxProps, Lt as defaultContainerStyle, Bt as defaultDividerProps, g as defaultElementStyle, G as defaultIconProps, Kt as defaultImageProps, P as defaultLinkSettings, Yt as defaultListProps, X as defaultPageStyle, en as defaultRadioProps, mn as defaultRichTextProps, nn as defaultSectionStyle, an as defaultSelectProps, sn as defaultTableProps, Tn as defaultTextAreaProps, Dn as defaultTextFieldProps, xn as defaultTextProps, kn as defaultVideoProps, p as defineElement, U as defineLayoutElement, Ue as deviceForWidth, qn as deviceOverride, Kn as deviceStyleProp, f as elementIdSchema, $ as elementRegistry, Dt as elementStyleDefinitions, Ot as elementStyleSchema, De as elementStyleToCssVariables, cn as fitRowsToHeaders, Wn as fromHexAlpha, se as gradientToCss, jn as isElementType, xt as isFontFamily, z as isOutlineIconName, ee as isPaletteColor, m as isSafeGradientArgs, D as isShownOn, jt as labelForIcon, W as layoutChildren, R as lengthKeys, S as lengthValue, I as linkHistoryLabels, F as linkSettingsShape, fn as normalizeRichText, We as orientationForWidth, Ft as pButtonDefinition, It as pCheckboxDefinition, Rt as pContainerDefinition, Vt as pDividerDefinition, Ht as pIconDefinition, Jt as pImageDefinition, Xt as pListDefinition, $t as pPageDefinition, tn as pRadioDefinition, hn as pRichTextDefinition, rn as pSectionDefinition, on as pSelectDefinition, un as pTableDefinition, En as pTextAreaDefinition, wn as pTextDefinition, On as pTextFieldDefinition, An as pVideoDefinition, Qt as pageStyleKeys, re as pageTokensToVarValues, Xn as resolveDeviceStyle, pn as richTextToPlainText, y as sanitizeAutoAsZero, Se as sanitizeBorderWidth, v as sanitizeLength, xe as sanitizeMaxLength, Ye as shownDeviceCount, O as styleItemsSchema, k as styleLabels, tt as styleOverrideItemsSchema, te as styleToClasses, J as textItemsSchema, de as textSizeToCss, Cn as textStyleDefinitions, Un as toHexAlpha, L as toLinkAttributes, o as toPaletteColor, a as toSpacingToken, A as toStyleItems, it as toStyleOverrideItems, Y as toTextItems, e as toTextSizeToken, s as unresolvedStyleForVars, Je as visibilityProp, M as withDeviceSettings };
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 };