@palmyit/elements 0.1.7 → 0.1.19

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 (98) hide show
  1. package/README.md +2 -0
  2. package/dist/definitions.d.ts +34 -25
  3. package/dist/definitions.js +1681 -868
  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 +39 -0
  7. package/dist/elements/button/template.d.ts +2 -0
  8. package/dist/elements/checkbox/definition.d.ts +10 -0
  9. package/dist/elements/checkbox/template.d.ts +2 -0
  10. package/dist/elements/container/definition.d.ts +39 -0
  11. package/dist/elements/container/template.d.ts +2 -0
  12. package/dist/elements/divider/definition.d.ts +10 -0
  13. package/dist/elements/divider/template.d.ts +2 -0
  14. package/dist/elements/footer/definition.d.ts +35 -0
  15. package/dist/elements/footer/template.d.ts +2 -0
  16. package/dist/elements/heading/definition.d.ts +29 -0
  17. package/dist/elements/heading/template.d.ts +2 -0
  18. package/dist/elements/icon/definition.d.ts +29 -0
  19. package/dist/elements/icon/template.d.ts +2 -0
  20. package/dist/elements/image/definition.d.ts +80 -0
  21. package/dist/elements/image/template.d.ts +32 -0
  22. package/dist/elements/list/definition.d.ts +13 -0
  23. package/dist/elements/list/template.d.ts +2 -0
  24. package/dist/elements/nav/definition.d.ts +39 -0
  25. package/dist/elements/nav/template.d.ts +17 -0
  26. package/dist/elements/page/definition.d.ts +62 -0
  27. package/dist/elements/page/template.d.ts +2 -0
  28. package/dist/elements/radio/definition.d.ts +13 -0
  29. package/dist/elements/radio/template.d.ts +2 -0
  30. package/dist/elements/rich-text/definition.d.ts +8 -0
  31. package/dist/elements/rich-text/template.d.ts +2 -0
  32. package/dist/elements/section/definition.d.ts +39 -0
  33. package/dist/elements/section/template.d.ts +2 -0
  34. package/dist/elements/select/definition.d.ts +13 -0
  35. package/dist/elements/select/template.d.ts +2 -0
  36. package/dist/{schema/PTable/pTable.definition.d.ts → elements/table/definition.d.ts} +4 -2
  37. package/dist/elements/table/template.d.ts +2 -0
  38. package/dist/{schema/PText/pText.definition.d.ts → elements/text/definition.d.ts} +11 -10
  39. package/dist/elements/text/template.d.ts +2 -0
  40. package/dist/elements/text-area/definition.d.ts +10 -0
  41. package/dist/elements/text-area/template.d.ts +2 -0
  42. package/dist/elements/text-field/definition.d.ts +10 -0
  43. package/dist/elements/text-field/template.d.ts +2 -0
  44. package/dist/elements/video/definition.d.ts +49 -0
  45. package/dist/elements/video/template.d.ts +8 -0
  46. package/dist/elements/video/youtube.d.ts +4 -0
  47. package/dist/manifest.json +2 -2
  48. package/dist/plmt-elements.css +2 -1
  49. package/dist/render/renderHtml.d.ts +1 -1
  50. package/dist/render/styleToClasses.d.ts +34 -0
  51. package/dist/render/styleToVars.d.ts +2 -0
  52. package/dist/render/styleTokens.d.ts +67 -0
  53. package/dist/render/tags.d.ts +9 -1
  54. package/dist/render/types.d.ts +10 -0
  55. package/dist/schema/Fields/BackgroundField/backgroundValue.d.ts +4 -3
  56. package/dist/schema/Fields/ColorField/colorText.d.ts +3 -0
  57. package/dist/schema/Fields/IconPicker/iconCatalog.d.ts +5 -1
  58. package/dist/schema/addressSchema.d.ts +2 -0
  59. package/dist/schema/backgroundStyleDefinitions.d.ts +1 -6
  60. package/dist/schema/device/devices.d.ts +8 -0
  61. package/dist/schema/deviceSettings.d.ts +1 -1
  62. package/dist/schema/elementCategories.d.ts +29 -0
  63. package/dist/schema/elementConfiguration.d.ts +1 -1
  64. package/dist/schema/elementRegistry.d.ts +38 -14
  65. package/dist/schema/elementStyleDefinitions.d.ts +7 -15
  66. package/dist/schema/elementTemplates.d.ts +3 -2
  67. package/dist/schema/linkSettings.d.ts +19 -2
  68. package/dist/schema/style/elementStyle.d.ts +3 -3
  69. package/dist/schema/style/page-styles.d.ts +2 -2
  70. package/dist/schema/styleItems.d.ts +18 -0
  71. package/dist/schema/styleTokensSchema.d.ts +290 -0
  72. package/dist/tags.json +5 -1
  73. package/dist/templates/brands/brandSpec.d.ts +5 -0
  74. package/dist/templates/elementSpec.d.ts +3 -8
  75. package/dist/templates/head.d.ts +43 -0
  76. package/dist/templates/helpers.d.ts +9 -1
  77. package/dist/templates/heroicons/heroiconSpec.d.ts +6 -0
  78. package/dist/templates.d.ts +6 -1
  79. package/dist/templates.js +1428 -234
  80. package/dist/youtube-BDsE1Bz3.js +910 -0
  81. package/package.json +5 -3
  82. package/dist/schema/PButton/pButton.definition.d.ts +0 -38
  83. package/dist/schema/PCheckbox/pCheckbox.definition.d.ts +0 -10
  84. package/dist/schema/PContainer/pContainer.definition.d.ts +0 -39
  85. package/dist/schema/PDivider/pDivider.definition.d.ts +0 -10
  86. package/dist/schema/PIcon/pIcon.definition.d.ts +0 -18
  87. package/dist/schema/PImage/pImage.definition.d.ts +0 -33
  88. package/dist/schema/PList/pList.definition.d.ts +0 -11
  89. package/dist/schema/PPage/pPage.definition.d.ts +0 -22
  90. package/dist/schema/PRadio/pRadio.definition.d.ts +0 -13
  91. package/dist/schema/PRichText/pRichText.definition.d.ts +0 -8
  92. package/dist/schema/PSection/pSection.definition.d.ts +0 -39
  93. package/dist/schema/PSelect/pSelect.definition.d.ts +0 -13
  94. package/dist/schema/PTextArea/pTextArea.definition.d.ts +0 -10
  95. package/dist/schema/PTextField/pTextField.definition.d.ts +0 -10
  96. package/dist/schema/PVideo/pVideo.definition.d.ts +0 -10
  97. /package/dist/{schema/PRichText → elements/rich-text}/richTextMarks.d.ts +0 -0
  98. /package/dist/{schema/PRichText → elements/rich-text}/richTextOptions.d.ts +0 -0
@@ -1,104 +1,19 @@
1
- import { z as e } 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";
2
3
  // src/schema/elementConfiguration.ts
3
- var t = e.string().trim().min(1);
4
- function n(e) {
4
+ var b = y.string().trim().min(1);
5
+ function x(e) {
5
6
  return e;
6
7
  }
7
- var r = /^[#0-9a-z%.,\s()-]+$/i, i = /url|var|image|expression|attr/i;
8
- function a(e) {
9
- let t = e.trim();
10
- return t !== "" && t.length <= 200 && r.test(t) && !i.test(t);
11
- }
12
- function o(e) {
13
- if (a(e.value)) return `${e.kind}-gradient(${e.value.trim()})`;
14
- }
15
- // src/schema/backgroundStyleDefinitions.ts
16
- var s = e.strictObject({
17
- hex: e.string().regex(/^#[0-9A-Fa-f]{6}$/, "Expected a #RRGGBB color"),
18
- opacity: e.number().int().min(0).max(100)
19
- }), c = e.strictObject({
20
- kind: e.enum(["linear", "radial"]),
21
- value: e.string().refine(a, "Expected gradient arguments such as 135deg, #2563EB, #7C3AED")
22
- });
23
- function l(t, { defaults: n, typeAttribute: r } = {}) {
24
- return [
25
- {
26
- key: "backgroundType",
27
- ...r ? { attribute: r } : {},
28
- value: e.enum(["color", "gradient"]),
29
- defaultValue: n?.backgroundType,
30
- label: "Background type"
31
- },
32
- {
33
- key: "backgroundColor",
34
- variable: `${t}-background-color`,
35
- value: s,
36
- defaultValue: n?.backgroundColor,
37
- label: "Background color"
38
- },
39
- {
40
- key: "backgroundGradient",
41
- variable: `${t}-background-image`,
42
- value: c,
43
- defaultValue: n?.backgroundGradient,
44
- label: "Background gradient"
45
- }
46
- ];
47
- }
48
- // src/schema/device/devices.ts
49
- var u = [
50
- {
51
- name: "Desktop",
52
- icon: "Monitor",
53
- portrait: {
54
- width: 1280,
55
- height: "auto"
56
- }
57
- },
58
- {
59
- name: "Tablet",
60
- icon: "Tablet",
61
- portrait: {
62
- width: 768,
63
- height: "auto"
64
- },
65
- landscape: {
66
- width: 1024,
67
- height: 768
68
- }
69
- },
70
- {
71
- name: "Mobile",
72
- icon: "Smartphone",
73
- portrait: {
74
- width: 360,
75
- height: "auto"
76
- },
77
- landscape: {
78
- width: 640,
79
- height: 360
80
- }
81
- }
82
- ], ee = u.map(({ portrait: e, icon: t, name: n }) => ({
83
- ...e,
84
- icon: t,
85
- label: n
86
- }));
87
- function te(e) {
88
- return u.find((t) => t.portrait.width === e || t.landscape?.width === e) ?? u[0];
89
- }
90
- function ne(e) {
91
- return te(e).landscape?.width === e ? "landscape" : "portrait";
92
- }
93
8
  // src/schema/deviceVisibility.ts
94
- var d = {
9
+ var S = {
95
10
  Desktop: "showOnDesktop",
96
11
  Tablet: "showOnTablet",
97
12
  Mobile: "showOnMobile"
98
- }, f = {
13
+ }, ge = {
99
14
  Tablet: "showOnTabletLandscape",
100
15
  Mobile: "showOnMobileLandscape"
101
- }, re = [...Object.values(d), ...Object.values(f)], p = u.flatMap(({ name: e, landscape: t }) => t ? [{
16
+ }, _e = [...Object.values(S), ...Object.values(ge)], ve = s.flatMap(({ name: e, landscape: t }) => t ? [{
102
17
  device: e,
103
18
  orientation: "portrait"
104
19
  }, {
@@ -108,37 +23,37 @@ var d = {
108
23
  device: e,
109
24
  orientation: "portrait"
110
25
  }]);
111
- function m(e, t) {
112
- return (t === "landscape" ? f[e] : void 0) ?? d[e];
26
+ function ye(e, t) {
27
+ return (t === "landscape" ? ge[e] : void 0) ?? S[e];
113
28
  }
114
- function h(e, t, n = "portrait") {
115
- let r = e[m(t, n)];
116
- return r === void 0 ? e[d[t]] !== !1 : r;
29
+ function C(e, t, n = "portrait") {
30
+ let r = e[ye(t, n)];
31
+ return r === void 0 ? e[S[t]] !== !1 : r;
117
32
  }
118
- function ie(e) {
119
- return p.filter(({ device: t, orientation: n }) => h(e, t, n)).length;
33
+ function be(e) {
34
+ return ve.filter(({ device: t, orientation: n }) => C(e, t, n)).length;
120
35
  }
121
36
  // src/schema/styleItems.ts
122
- var ae = e.strictObject({
123
- key: e.string(),
124
- variable: e.string().optional(),
125
- variables: e.record(e.string(), e.string()).optional(),
126
- attribute: e.string().optional(),
127
- value: e.unknown()
128
- }), oe = [
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 = [
129
44
  "variable",
130
45
  "variables",
131
46
  "attribute"
132
47
  ];
133
- function se(e) {
48
+ function Ce(e) {
134
49
  let t = {};
135
50
  for (let n of e) n.defaultValue !== void 0 && (t[n.key] = n.defaultValue);
136
51
  return t;
137
52
  }
138
- function ce(e, t) {
139
- return oe.find((n) => JSON.stringify(e[n]) !== JSON.stringify(t[n]));
53
+ function we(e, t) {
54
+ return Se.find((n) => JSON.stringify(e[n]) !== JSON.stringify(t[n]));
140
55
  }
141
- function le(e, t, n) {
56
+ function Te(e, t, n) {
142
57
  if (!t) return {
143
58
  field: "key",
144
59
  message: `Unknown style key "${e.key}"`
@@ -147,28 +62,28 @@ function le(e, t, n) {
147
62
  field: "key",
148
63
  message: `Style key "${e.key}" appears twice`
149
64
  };
150
- let r = ce(e, t);
65
+ let r = we(e, t);
151
66
  if (r) return {
152
67
  field: r,
153
68
  message: `Style "${e.key}" ${r} does not match the element configuration`
154
69
  };
155
70
  }
156
- function g(e) {
157
- return de(e, () => se(e));
71
+ function Ee(e) {
72
+ return Oe(e, () => Ce(e));
158
73
  }
159
- function ue(e) {
160
- return de(e, () => ({}));
161
- }
162
- function de(t, n) {
163
- let r = new Map(t.map((e) => [e.key, e]));
164
- return e.array(ae).default([]).transform((e, t) => {
165
- let i = n(), a = /* @__PURE__ */ new Set();
166
- return e.forEach((e, n) => {
167
- let o = r.get(e.key), s = le(e, o, a);
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);
168
83
  if (s || !o) {
169
- t.addIssue({
84
+ r.addIssue({
170
85
  code: "custom",
171
- path: [n, s?.field ?? "key"],
86
+ path: [t, s?.field ?? "key"],
172
87
  message: s?.message ?? ""
173
88
  });
174
89
  return;
@@ -178,234 +93,372 @@ function de(t, n) {
178
93
  if (c.success) i[e.key] = c.data;
179
94
  else {
180
95
  let e = c.error.issues[0]?.message ?? "Invalid value";
181
- t.addIssue({
96
+ r.addIssue({
182
97
  code: "custom",
183
- path: [n, "value"],
98
+ path: [t, "value"],
184
99
  message: e
185
100
  });
186
101
  }
187
102
  }), i;
188
103
  });
189
104
  }
190
- function fe(e, t) {
191
- let n = Object.fromEntries(oe.filter((t) => e[t] !== void 0).map((t) => [t, e[t]]));
105
+ function ke(e, t) {
106
+ let n = Object.fromEntries(Se.filter((t) => e[t] !== void 0).map((t) => [t, e[t]]));
192
107
  return {
193
108
  key: e.key,
194
109
  ...n,
195
110
  value: t
196
111
  };
197
112
  }
198
- function _(e, t = "") {
113
+ function w(e, t = "") {
199
114
  return Object.fromEntries(e.flatMap(({ key: e, label: n }) => n === void 0 ? [] : [[`${t}${e}`, n]]));
200
115
  }
201
- function v(e, t) {
202
- return me({
203
- ...se(t),
116
+ function Ae(e, t) {
117
+ return Me({
118
+ ...Ce(t),
204
119
  ...e
205
120
  }, t);
206
121
  }
207
- function pe(e, t) {
208
- return me(e ?? {}, t);
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));
209
177
  }
210
- function me(e, t) {
211
- return t.filter((t) => e[t.key] !== void 0).map((t) => fe(t, e[t.key]));
178
+ function Le(e) {
179
+ return Ie(e, () => ({}));
212
180
  }
213
181
  // src/schema/deviceSettings.ts
214
- var y = [
182
+ var Re = [
215
183
  {
216
- prop: "tabletStyle",
217
- device: "Tablet"
184
+ key: "desktop",
185
+ visibility: "showOnDesktop",
186
+ label: "Desktop"
218
187
  },
219
188
  {
220
- prop: "mobileStyle",
221
- device: "Mobile"
189
+ key: "tablet",
190
+ visibility: "showOnTablet",
191
+ styleProp: "tabletStyle",
192
+ label: "Tablet"
222
193
  },
223
194
  {
224
- prop: "tabletLandscapeStyle",
225
- device: "Landscape tablet"
195
+ key: "tabletLandscape",
196
+ visibility: "showOnTabletLandscape",
197
+ styleProp: "tabletLandscapeStyle",
198
+ label: "Landscape tablet"
226
199
  },
227
200
  {
228
- prop: "mobileLandscapeStyle",
229
- device: "Landscape mobile"
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"
230
211
  }
231
- ], he = {
212
+ ], ze = Re.filter((e) => e.styleProp !== void 0).map(({ styleProp: e, label: t }) => ({
213
+ prop: e,
214
+ device: t
215
+ })), Be = {
232
216
  showOnDesktop: "Show on desktop",
233
217
  showOnTablet: "Show on portrait tablet",
234
218
  showOnTabletLandscape: "Show on landscape tablet",
235
219
  showOnMobile: "Show on portrait mobile",
236
220
  showOnMobileLandscape: "Show on landscape mobile"
237
- }, ge = Object.fromEntries(re.map((t) => [t, e.boolean().optional()]));
238
- function _e(t) {
239
- let n = t ? Object.fromEntries(y.map(({ prop: e }) => [e, ue(t).optional()])) : {};
240
- return e.strictObject({
241
- ...ge,
242
- ...n
243
- }).refine((e) => ie(e) > 0, {
244
- path: ["showOnDesktop"],
245
- message: "Show the element on at least one device"
246
- });
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;
247
245
  }
248
- function ve(e, t, n) {
246
+ function Ue(e, t, n) {
249
247
  return Object.fromEntries(Object.entries(e).filter(([e]) => t.has(e) === n));
250
248
  }
251
- function ye(t, n) {
252
- let r = new Set(Object.keys(n.shape));
253
- return e.record(e.string(), e.unknown()).transform((i, a) => {
254
- let o = t.safeParse(ve(i, r, !1)), s = n.safeParse(ve(i, r, !0));
255
- for (let e of [...o.error?.issues ?? [], ...s.error?.issues ?? []]) a.addIssue({
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({
256
254
  code: "custom",
257
255
  path: e.path,
258
256
  message: e.message
259
257
  });
260
- return !o.success || !s.success ? e.NEVER : {
261
- ...o.data,
262
- ...be(s.data)
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)
263
267
  };
264
268
  });
265
269
  }
266
- function be(e) {
267
- return Object.fromEntries(Object.entries(e).filter(([, e]) => !xe(e)));
270
+ function Ge(e) {
271
+ return Object.fromEntries(Object.entries(e).filter(([, e]) => !Ke(e)));
268
272
  }
269
- function xe(e) {
273
+ function Ke(e) {
270
274
  return e === void 0 || typeof e == "object" && !!e && Object.keys(e).length === 0;
271
275
  }
272
- function Se(e) {
273
- return Object.fromEntries(p.flatMap(({ device: t, orientation: n }) => {
274
- let r = h(e, t, n);
275
- return (n === "portrait" ? !r : r !== h(e, t, "portrait")) ? [[m(t, n), r]] : [];
276
- }));
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;
277
288
  }
278
- function Ce(e, t) {
279
- return Object.fromEntries(y.flatMap(({ prop: n }) => {
280
- let r = pe(e[n], t);
281
- return r.length > 0 ? [[n, r]] : [];
282
- }));
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 };
283
318
  }
284
- function we(e) {
319
+ function Qe(e) {
285
320
  return `${e.charAt(0).toLowerCase()}${e.slice(1)}`;
286
321
  }
287
- function Te(e) {
288
- return Object.fromEntries(y.flatMap(({ prop: t, device: n }) => Object.entries(_(e, `${t}.`)).map(([e, t]) => [e, `${n} ${we(t)}`])));
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)}`])));
289
324
  }
290
- function b(e, t) {
325
+ function k(e, t) {
291
326
  return {
292
327
  ...e,
293
- attributes: ye(e.attributes, _e(t)),
328
+ attributes: We(e.attributes, Ve(t)),
294
329
  toDocumentAttributes: (n) => ({
295
330
  ...e.toDocumentAttributes(n),
296
- ...Se(n),
297
- ...t ? Ce(n, t) : {}
331
+ ...Ze(n, t)
298
332
  }),
299
333
  history: {
300
334
  summary: e.history.summary,
301
335
  attributes: {
302
336
  ...e.history.attributes,
303
- ...he,
304
- ...t ? Te(t) : {}
337
+ ...Be,
338
+ ...t ? $e(t) : {}
305
339
  }
306
340
  }
307
341
  };
308
342
  }
309
- // src/schema/addressSchema.ts
310
- var Ee = "Enter an https:// address or a path that starts with /";
311
- function De(e) {
312
- if (e.startsWith("/")) return !e.startsWith("//") && !e.startsWith("/\\");
313
- try {
314
- let { protocol: t } = new URL(e);
315
- return t === "https:" || t === "http:";
316
- } catch {
317
- return !1;
318
- }
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);
319
346
  }
320
- var x = e.string().trim().min(1, Ee).refine(De, Ee), Oe = ["_self", "_blank"], S = {
321
- href: "",
322
- target: "_self",
323
- description: ""
324
- }, C = {
325
- href: e.string().trim().pipe(e.union([e.literal(""), x])).default(S.href),
326
- target: e.enum(Oe).default(S.target),
327
- description: e.string().trim().default(S.description)
328
- }, w = {
329
- href: "Link address",
330
- target: "Link target",
331
- description: "Link description"
332
- };
333
- function T({ href: e, target: t, description: n }) {
334
- return e === "" ? {} : {
335
- href: e,
336
- ...t === S.target ? {} : { target: t },
337
- ...n === "" ? {} : { description: n }
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
338
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;
339
366
  }
340
- // src/schema/PRichText/richTextMarks.ts
341
- var ke = /^[A-Za-z0-9][A-Za-z0-9 ]*$/;
342
- function E(e) {
343
- return typeof e == "string" && ke.test(e);
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) {
391
+ let t = e.trim();
392
+ return t !== "" && t.length <= 200 && st.test(t) && !ct.test(t);
393
+ }
394
+ function ut(e) {
395
+ if (lt(e.value)) return `${e.kind}-gradient(${e.value.trim()})`;
344
396
  }
345
397
  // src/schema/style/page-styles.ts
346
- var Ae = /^#[0-9A-Fa-f]{6}$/;
347
- function je(e) {
348
- return Ae.test(e) ? [
398
+ var dt = /^#[0-9A-Fa-f]{6}$/;
399
+ function ft(e) {
400
+ return dt.test(e) ? [
349
401
  Number.parseInt(e.slice(1, 3), 16),
350
402
  Number.parseInt(e.slice(3, 5), 16),
351
403
  Number.parseInt(e.slice(5, 7), 16)
352
404
  ] : null;
353
405
  }
354
- function D(e) {
355
- let t = je(e.hex);
356
- if (!t || !Number.isFinite(e.opacity)) return;
357
- if (e.opacity === 100) return e.hex.toUpperCase();
358
- let n = Math.min(100, Math.max(0, e.opacity)) / 100, [r, i, a] = t;
359
- 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})`;
360
413
  }
361
- function Me(e) {
414
+ function mt(e) {
362
415
  if (!(!Number.isFinite(e) || e <= 0)) return `${e}px`;
363
416
  }
364
417
  // src/schema/style/backgroundStyle.ts
365
- function Ne(e) {
366
- if (e.backgroundType === "gradient") return "transparent";
367
- if (e.backgroundColor) return D(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);
368
421
  }
369
- function Pe(e) {
422
+ function gt(e) {
370
423
  if (e.backgroundType !== "gradient") return "none";
371
- if (e.backgroundGradient) return o(e.backgroundGradient);
424
+ if (e.backgroundGradient) return ut(e.backgroundGradient);
372
425
  }
373
- function Fe(e, t) {
426
+ function _t(e, t) {
374
427
  return e.backgroundType ? {
375
- [`${t}-background-color`]: Ne(e),
376
- [`${t}-background-image`]: Pe(e)
428
+ [`${t}-background-color`]: ht(e),
429
+ [`${t}-background-image`]: gt(e)
377
430
  } : {};
378
431
  }
379
432
  // src/schema/style/elementStyle.ts
380
- var O = [
433
+ var vt = [
381
434
  "none",
382
435
  "solid",
383
436
  "dashed",
384
437
  "dotted",
385
438
  "double"
386
- ], Ie = [
439
+ ], yt = [
387
440
  "row",
388
441
  "column",
389
442
  "row-reverse",
390
443
  "column-reverse"
391
- ], Le = [
444
+ ], bt = [
392
445
  "nowrap",
393
446
  "wrap",
394
447
  "wrap-reverse"
395
- ], k = [
448
+ ], xt = [
396
449
  "flex-start",
397
450
  "center",
398
451
  "flex-end",
399
452
  "space-between",
400
453
  "space-around",
401
454
  "space-evenly"
402
- ], Re = [
455
+ ], St = [
403
456
  "stretch",
404
457
  "flex-start",
405
458
  "center",
406
459
  "flex-end",
407
460
  "baseline"
408
- ], ze = ["stretch", ...k], A = {
461
+ ], Ct = ["stretch", ...xt], M = {
409
462
  layout: "block",
410
463
  flexDirection: "row",
411
464
  flexWrap: "nowrap",
@@ -419,10 +472,6 @@ var O = [
419
472
  hex: "#FFFFFF",
420
473
  opacity: 0
421
474
  },
422
- backgroundGradient: {
423
- kind: "linear",
424
- value: "135deg, #2563EB, #7C3AED"
425
- },
426
475
  overflow: "show",
427
476
  overflowVertical: !0,
428
477
  overflowHorizontal: !0,
@@ -450,84 +499,326 @@ var O = [
450
499
  hex: "#000000",
451
500
  opacity: 100
452
501
  }
453
- }, Be = /^(auto|0|-?\d+(\.\d+)?(px|rem|em|%))$/i, Ve = /^(0|\d+(\.\d+)?(px|rem|em))$/i;
454
- function j(e) {
502
+ }, wt = /^(auto|0|-?\d+(\.\d+)?(px|rem|em|%))$/i, Tt = /^(0|\d+(\.\d+)?(px|rem|em))$/i;
503
+ function N(e) {
455
504
  let t = e.trim();
456
- if (Be.test(t)) return t;
505
+ if (wt.test(t)) return t;
457
506
  }
458
- function M(e) {
459
- let t = j(e);
507
+ function P(e) {
508
+ let t = N(e);
460
509
  if (t != null) return t.toLowerCase() === "auto" ? "0" : t;
461
510
  }
462
- function N(e) {
463
- let t = j(e);
511
+ function Et(e) {
512
+ let t = N(e);
464
513
  return t?.toLowerCase() === "auto" ? "none" : t;
465
514
  }
466
- function He(e) {
515
+ function Dt(e) {
467
516
  let t = e.trim();
468
- return Ve.test(t) ? t : void 0;
517
+ return Tt.test(t) ? t : void 0;
469
518
  }
470
- function Ue(e, t) {
519
+ function Ot(e, t) {
471
520
  return e === "hide" ? "hidden" : t ? "auto" : "hidden";
472
521
  }
473
- var We = [
522
+ var kt = [
474
523
  "marginTop",
475
524
  "marginBottom",
476
525
  "marginLeft",
477
526
  "marginRight"
478
527
  ];
479
- function Ge(e) {
528
+ function At(e) {
480
529
  return e.trim().toLowerCase() === "auto";
481
530
  }
482
- function P(e, t) {
483
- return We.every((t) => Ge(e[t])) ? "0" : j(e[t]);
531
+ function jt(e, t) {
532
+ return kt.every((t) => At(e[t])) ? "0" : N(e[t]);
484
533
  }
485
- function Ke(e) {
534
+ function Mt(e) {
486
535
  return e.layout !== "grid" || e.gridColumns == null ? "none" : `repeat(${e.gridColumns}, minmax(0, 1fr))`;
487
536
  }
488
- function qe(e, t) {
537
+ function Nt(e, t) {
489
538
  let n = {
490
- ...A,
539
+ ...M,
491
540
  ...e
492
541
  }, r = `--palmyit-${t}`;
493
542
  return {
494
543
  [`${r}-display`]: n.layout,
495
- [`${r}-grid-template-columns`]: Ke(n),
544
+ [`${r}-grid-template-columns`]: Mt(n),
496
545
  [`${r}-flex-direction`]: n.flexDirection,
497
546
  [`${r}-flex-wrap`]: n.flexWrap,
498
547
  [`${r}-justify-content`]: n.justifyContent,
499
548
  [`${r}-align-items`]: n.alignItems,
500
549
  [`${r}-align-content`]: n.alignContent,
501
- [`${r}-row-gap`]: M(n.rowGap),
502
- [`${r}-column-gap`]: M(n.columnGap),
503
- [`${r}-overflow-x`]: Ue(n.overflow, n.overflowHorizontal),
504
- [`${r}-overflow-y`]: Ue(n.overflow, n.overflowVertical),
505
- [`${r}-width`]: j(n.width),
506
- [`${r}-height`]: j(n.height),
507
- [`${r}-min-width`]: j(n.minWidth),
508
- [`${r}-min-height`]: j(n.minHeight),
509
- [`${r}-max-width`]: N(n.maxWidth),
510
- [`${r}-max-height`]: N(n.maxHeight),
511
- [`${r}-padding-top`]: M(n.paddingTop),
512
- [`${r}-padding-bottom`]: M(n.paddingBottom),
513
- [`${r}-padding-left`]: M(n.paddingLeft),
514
- [`${r}-padding-right`]: M(n.paddingRight),
515
- [`${r}-margin-top`]: P(n, "marginTop"),
516
- [`${r}-margin-bottom`]: P(n, "marginBottom"),
517
- [`${r}-margin-left`]: P(n, "marginLeft"),
518
- [`${r}-margin-right`]: P(n, "marginRight"),
519
- [`${r}-border-top-left-radius`]: M(n.borderRadiusTopLeft),
520
- [`${r}-border-top-right-radius`]: M(n.borderRadiusTopRight),
521
- [`${r}-border-bottom-right-radius`]: M(n.borderRadiusBottomRight),
522
- [`${r}-border-bottom-left-radius`]: M(n.borderRadiusBottomLeft),
523
- [`${r}-border-width`]: He(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),
524
573
  [`${r}-border-style`]: n.borderStyle,
525
- [`${r}-border-color`]: D(n.borderColor),
526
- ...Fe(n, r)
574
+ [`${r}-border-color`]: pt(n.borderColor),
575
+ ..._t(n, r)
576
+ };
577
+ }
578
+ // src/schema/styleTokensSchema.ts
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
+ }
527
605
  };
528
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")
795
+ });
796
+ function V(e, { defaults: t, typeAttribute: n } = {}) {
797
+ return [
798
+ {
799
+ key: "backgroundType",
800
+ ...n ? { attribute: n } : {},
801
+ value: y.enum(["color", "gradient"]),
802
+ defaultValue: t?.backgroundType,
803
+ label: "Background type"
804
+ },
805
+ L({
806
+ key: "backgroundColor",
807
+ variable: `${e}-background-color`,
808
+ defaultValue: t?.backgroundColor,
809
+ label: "Background color"
810
+ }),
811
+ {
812
+ key: "backgroundGradient",
813
+ variable: `${e}-background-image`,
814
+ value: ln,
815
+ defaultValue: t?.backgroundGradient,
816
+ label: "Background gradient"
817
+ }
818
+ ];
819
+ }
529
820
  // src/schema/elementStyleDefinitions.ts
530
- var F = e.string().trim().regex(Be, "Expected auto, 0, or a px, rem, em, or % length"), I = [
821
+ var H = [
531
822
  [
532
823
  "width",
533
824
  "width",
@@ -571,12 +862,12 @@ var F = e.string().trim().regex(Be, "Expected auto, 0, or a px, rem, em, or % le
571
862
  [
572
863
  "paddingLeft",
573
864
  "padding-left",
574
- "Padding left"
865
+ "Padding start"
575
866
  ],
576
867
  [
577
868
  "paddingRight",
578
869
  "padding-right",
579
- "Padding right"
870
+ "Padding end"
580
871
  ],
581
872
  [
582
873
  "marginTop",
@@ -591,12 +882,12 @@ var F = e.string().trim().regex(Be, "Expected auto, 0, or a px, rem, em, or % le
591
882
  [
592
883
  "marginLeft",
593
884
  "margin-left",
594
- "Margin left"
885
+ "Margin start"
595
886
  ],
596
887
  [
597
888
  "marginRight",
598
889
  "margin-right",
599
- "Margin right"
890
+ "Margin end"
600
891
  ],
601
892
  [
602
893
  "borderRadiusTopLeft",
@@ -619,23 +910,23 @@ var F = e.string().trim().regex(Be, "Expected auto, 0, or a px, rem, em, or % le
619
910
  "Radius bottom left"
620
911
  ]
621
912
  ];
622
- function Je(t) {
623
- let n = `--palmyit-${t}`, r = {
913
+ function un(e) {
914
+ let t = `--palmyit-${e}`, n = {
624
915
  key: "gridColumns",
625
- variable: `${n}-grid-template-columns`,
626
- value: e.union([
627
- e.literal(2),
628
- e.literal(3),
629
- e.literal(4)
916
+ variable: `${t}-grid-template-columns`,
917
+ value: y.union([
918
+ y.literal(2),
919
+ y.literal(3),
920
+ y.literal(4)
630
921
  ]),
631
922
  label: "Grid columns"
632
923
  };
633
924
  return [
634
925
  {
635
926
  key: "layout",
636
- variable: `${n}-display`,
927
+ variable: `${t}-display`,
637
928
  attribute: "data-layout",
638
- value: e.enum([
929
+ value: y.enum([
639
930
  "block",
640
931
  "flex",
641
932
  "grid"
@@ -643,139 +934,138 @@ function Je(t) {
643
934
  defaultValue: "block",
644
935
  label: "Layout"
645
936
  },
646
- r,
647
- ...Ye(t)
937
+ n,
938
+ ...dn(e)
648
939
  ];
649
940
  }
650
- function Ye(t) {
651
- let n = `--palmyit-${t}`;
941
+ function dn(e) {
942
+ let t = `--palmyit-${e}`;
652
943
  return [
653
944
  {
654
945
  key: "flexDirection",
655
- variable: `${n}-flex-direction`,
656
- value: e.enum(Ie),
657
- defaultValue: A.flexDirection,
946
+ variable: `${t}-flex-direction`,
947
+ value: y.enum(yt),
948
+ defaultValue: M.flexDirection,
658
949
  label: "Direction"
659
950
  },
660
951
  {
661
952
  key: "flexWrap",
662
- variable: `${n}-flex-wrap`,
663
- value: e.enum(Le),
664
- defaultValue: A.flexWrap,
953
+ variable: `${t}-flex-wrap`,
954
+ value: y.enum(bt),
955
+ defaultValue: M.flexWrap,
665
956
  label: "Wrap"
666
957
  },
667
958
  {
668
959
  key: "justifyContent",
669
- variable: `${n}-justify-content`,
670
- value: e.enum(k),
671
- defaultValue: A.justifyContent,
960
+ variable: `${t}-justify-content`,
961
+ value: y.enum(xt),
962
+ defaultValue: M.justifyContent,
672
963
  label: "Justify"
673
964
  },
674
965
  {
675
966
  key: "alignItems",
676
- variable: `${n}-align-items`,
677
- value: e.enum(Re),
678
- defaultValue: A.alignItems,
967
+ variable: `${t}-align-items`,
968
+ value: y.enum(St),
969
+ defaultValue: M.alignItems,
679
970
  label: "Align items"
680
971
  },
681
972
  {
682
973
  key: "alignContent",
683
- variable: `${n}-align-content`,
684
- value: e.enum(ze),
685
- defaultValue: A.alignContent,
974
+ variable: `${t}-align-content`,
975
+ value: y.enum(Ct),
976
+ defaultValue: M.alignContent,
686
977
  label: "Align content"
687
978
  },
688
979
  {
689
980
  key: "rowGap",
690
- variable: `${n}-row-gap`,
691
- value: F,
692
- defaultValue: A.rowGap,
981
+ variable: `${t}-row-gap`,
982
+ value: I,
983
+ defaultValue: M.rowGap,
693
984
  label: "Row gap"
694
985
  },
695
986
  {
696
987
  key: "columnGap",
697
- variable: `${n}-column-gap`,
698
- value: F,
699
- defaultValue: A.columnGap,
988
+ variable: `${t}-column-gap`,
989
+ value: I,
990
+ defaultValue: M.columnGap,
700
991
  label: "Column gap"
701
992
  }
702
993
  ];
703
994
  }
704
- function Xe(t, n) {
705
- let r = `--palmyit-${t}`;
995
+ function fn(e, t) {
996
+ let n = `--palmyit-${e}`;
706
997
  return [
707
998
  {
708
999
  key: "overflow",
709
1000
  variables: {
710
- x: `${r}-overflow-x`,
711
- y: `${r}-overflow-y`
1001
+ x: `${n}-overflow-x`,
1002
+ y: `${n}-overflow-y`
712
1003
  },
713
- value: e.enum(["show", "hide"]),
714
- defaultValue: n.overflow,
1004
+ value: y.enum(["show", "hide"]),
1005
+ defaultValue: t.overflow,
715
1006
  label: "Overflowing contents"
716
1007
  },
717
1008
  {
718
1009
  key: "overflowHorizontal",
719
- variable: `${r}-overflow-x`,
720
- value: e.boolean(),
721
- defaultValue: n.overflowHorizontal,
1010
+ variable: `${n}-overflow-x`,
1011
+ value: y.boolean(),
1012
+ defaultValue: t.overflowHorizontal,
722
1013
  label: "Horizontal overflow"
723
1014
  },
724
1015
  {
725
1016
  key: "overflowVertical",
726
- variable: `${r}-overflow-y`,
727
- value: e.boolean(),
728
- defaultValue: n.overflowVertical,
1017
+ variable: `${n}-overflow-y`,
1018
+ value: y.boolean(),
1019
+ defaultValue: t.overflowVertical,
729
1020
  label: "Vertical overflow"
730
1021
  }
731
1022
  ];
732
1023
  }
733
- function Ze(e, t) {
734
- return I.map(([n, r, i]) => ({
1024
+ function pn(e, t) {
1025
+ return H.map(([n, r, i]) => ({
735
1026
  key: n,
736
1027
  variable: `--palmyit-${e}-${r}`,
737
- value: F,
1028
+ value: I,
738
1029
  defaultValue: t[n],
739
1030
  label: i
740
1031
  }));
741
1032
  }
742
- function Qe(t, n) {
743
- let r = `--palmyit-${t}`;
1033
+ function mn(e, t) {
1034
+ let n = `--palmyit-${e}`;
744
1035
  return [
745
1036
  {
746
1037
  key: "borderWidth",
747
- variable: `${r}-border-width`,
748
- value: F,
749
- defaultValue: n.borderWidth,
1038
+ variable: `${n}-border-width`,
1039
+ value: Bt,
1040
+ defaultValue: t.borderWidth,
750
1041
  label: "Border width"
751
1042
  },
752
1043
  {
753
1044
  key: "borderStyle",
754
- variable: `${r}-border-style`,
755
- value: e.enum(O),
756
- defaultValue: n.borderStyle,
1045
+ variable: `${n}-border-style`,
1046
+ value: y.enum(vt),
1047
+ defaultValue: t.borderStyle,
757
1048
  label: "Border style"
758
1049
  },
759
- {
1050
+ L({
760
1051
  key: "borderColor",
761
- variable: `${r}-border-color`,
762
- value: s,
763
- defaultValue: n.borderColor,
1052
+ variable: `${n}-border-color`,
1053
+ defaultValue: t.borderColor,
764
1054
  label: "Border color"
765
- }
1055
+ })
766
1056
  ];
767
1057
  }
768
- function $e(e, t) {
1058
+ function hn(e, t) {
769
1059
  return [
770
- ...Je(e),
771
- ...Xe(e, t),
772
- ...Ze(e, t),
773
- ...Qe(e, t),
774
- ...l(`--palmyit-${e}`, { defaults: t })
1060
+ ...un(e),
1061
+ ...fn(e, t),
1062
+ ...pn(e, t),
1063
+ ...mn(e, t),
1064
+ ...V(`--palmyit-${e}`, { defaults: t })
775
1065
  ];
776
1066
  }
777
- function et(e, t) {
778
- return g(e).transform((e) => ({
1067
+ function gn(e, t) {
1068
+ return D(e).transform((e) => ({
779
1069
  ...t,
780
1070
  ...e
781
1071
  })).superRefine((e, t) => {
@@ -786,99 +1076,342 @@ function et(e, t) {
786
1076
  });
787
1077
  });
788
1078
  }
789
- // src/schema/Fields/IconPicker/iconCatalog.ts
790
- var tt = /^MdOutline[A-Z0-9]/, nt = "";
791
- function L(e) {
792
- return tt.test(e);
793
- }
794
- function rt(e) {
795
- return e.replace(/^MdOutline/, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2");
796
- }
797
- // src/schema/PButton/pButton.definition.ts
798
- var it = {
799
- name: "Button",
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"
1322
+ }
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);
1327
+ }
1328
+ function Rn(e) {
1329
+ return e ? e.split("-").map((e, t) => t === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" ") : "";
1330
+ }
1331
+ // src/elements/button/definition.ts
1332
+ var zn = {
1333
+ name: "Button",
800
1334
  startIcon: "",
801
1335
  endIcon: "",
802
- ...S,
1336
+ ...d,
803
1337
  style: {}
804
- }, at = e.string().refine((e) => e === "" || L(e), "Expected an outlined Material icon name such as MdOutlineHome").default("");
805
- function ot(e, t) {
1338
+ }, Bn = y.string().refine((e) => e === "" || Ln(e), "Expected a Heroicons name such as home").default("");
1339
+ function Vn(e, t) {
806
1340
  return t === "" ? {} : { [e]: t };
807
1341
  }
808
- var R = "--palmyit-button", z = [
809
- ...l(R, { typeAttribute: "data-background" }),
1342
+ var q = "--palmyit-button", Hn = [
1343
+ ...V(q, { typeAttribute: "data-background" }),
810
1344
  {
811
1345
  key: "borderWidth",
812
- variable: `${R}-border-width`,
813
- value: F,
1346
+ variable: `${q}-border-width`,
1347
+ value: Bt,
814
1348
  label: "Border width"
815
1349
  },
816
1350
  {
817
1351
  key: "borderStyle",
818
- variable: `${R}-border-style`,
819
- value: e.enum(O),
1352
+ variable: `${q}-border-style`,
1353
+ value: y.enum(vt),
820
1354
  label: "Border style"
821
1355
  },
822
- {
1356
+ L({
823
1357
  key: "borderColor",
824
- variable: `${R}-border-color`,
825
- value: s,
1358
+ variable: `${q}-border-color`,
826
1359
  label: "Border color"
827
- },
828
- ...I.map(([e, t, n]) => ({
1360
+ }),
1361
+ ...H.map(([e, t, n]) => ({
829
1362
  key: e,
830
- variable: `${R}-${t}`,
831
- value: F,
1363
+ variable: `${q}-${t}`,
1364
+ value: I,
832
1365
  label: n
833
1366
  })),
834
- {
1367
+ L({
835
1368
  key: "textColor",
836
- variable: `${R}-text-color`,
837
- value: s,
1369
+ variable: `${q}-text-color`,
838
1370
  label: "Text color"
839
- },
1371
+ }),
840
1372
  {
841
1373
  key: "textFont",
842
- variable: `${R}-font-family`,
843
- value: e.string().refine(E, "Expected a Google Fonts family name"),
1374
+ variable: `${q}-font-family`,
1375
+ value: y.string().refine(ie, "Expected a Google Fonts family name"),
844
1376
  label: "Font"
845
1377
  },
846
1378
  {
847
1379
  key: "textSize",
848
- variable: `${R}-font-size`,
849
- value: F,
1380
+ variable: `${q}-font-size`,
1381
+ value: Vt,
850
1382
  label: "Text size"
851
1383
  },
852
1384
  {
853
1385
  key: "iconGap",
854
- variable: `${R}-gap`,
855
- value: F,
1386
+ variable: `${q}-gap`,
1387
+ value: I,
856
1388
  label: "Icon gap"
857
1389
  }
858
- ], st = b(n({
1390
+ ], Un = k(x({
859
1391
  type: "PButton",
860
1392
  label: "Button",
861
1393
  allowedChildren: [],
862
1394
  templates: [],
863
- attributes: e.strictObject({
864
- id: t,
865
- name: e.string().trim().min(1, "Enter a button label").default(it.name),
866
- startIcon: at,
867
- endIcon: at,
868
- ...C,
869
- style: g(z).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)
870
1402
  }),
871
- 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 }) => ({
872
1404
  id: e,
873
1405
  name: t,
874
- ...ot("startIcon", n),
875
- ...ot("endIcon", r),
876
- ...T({
1406
+ ...Vn("startIcon", n),
1407
+ ...Vn("endIcon", r),
1408
+ ..._({
877
1409
  href: i,
878
1410
  target: a,
879
- description: o
1411
+ description: o,
1412
+ rel: s
880
1413
  }),
881
- style: v(s, z)
1414
+ ...E(T(c, Hn))
882
1415
  }),
883
1416
  history: {
884
1417
  summary: ({ name: e }) => e,
@@ -886,22 +1419,22 @@ var R = "--palmyit-button", z = [
886
1419
  name: "Label",
887
1420
  startIcon: "Start icon",
888
1421
  endIcon: "End icon",
889
- ...w,
890
- ..._(z, "style.")
1422
+ ...g,
1423
+ ...w(Hn, "style.")
891
1424
  }
892
1425
  }
893
- }), z), B = {
1426
+ }), Hn), Wn = {
894
1427
  label: "Checkbox",
895
1428
  checked: !1
896
- }, ct = b(n({
1429
+ }, Gn = k(x({
897
1430
  type: "PCheckbox",
898
1431
  label: "Checkbox input",
899
1432
  allowedChildren: [],
900
1433
  templates: [],
901
- attributes: e.strictObject({
902
- id: t,
903
- label: e.string().trim().min(1, "Enter a label").default(B.label),
904
- checked: e.boolean().default(B.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)
905
1438
  }),
906
1439
  toDocumentAttributes: ({ id: e, label: t, checked: n }) => ({
907
1440
  id: e,
@@ -917,64 +1450,95 @@ var R = "--palmyit-button", z = [
917
1450
  }
918
1451
  }));
919
1452
  // src/schema/layoutElementConfiguration.ts
920
- function V({ type: r, label: i, kind: a, defaultStyle: o, allowedChildren: s, templates: c }) {
921
- let l = $e(a, o);
922
- return b(n({
923
- type: r,
924
- label: i,
925
- allowedChildren: s,
926
- templates: c,
927
- attributes: e.strictObject({
928
- id: t,
929
- style: et(l, o)
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({
1456
+ type: e,
1457
+ label: t,
1458
+ allowedChildren: i,
1459
+ templates: a,
1460
+ attributes: y.strictObject({
1461
+ id: b,
1462
+ style: gn(o, r)
930
1463
  }),
931
1464
  toDocumentAttributes: ({ id: e, style: t }) => ({
932
1465
  id: e,
933
- style: v(t, l)
1466
+ ...E(T(t, o))
934
1467
  }),
935
1468
  history: {
936
- summary: () => i,
937
- attributes: _(l, "style.")
1469
+ summary: () => t,
1470
+ attributes: w(o, "style.")
938
1471
  }
939
- }), l);
1472
+ }), o);
940
1473
  }
941
- // src/schema/layoutChildren.ts
942
- var H = [
943
- "PContainer",
944
- "PButton",
945
- "PText",
946
- "PRichText",
947
- "PImage",
948
- "PVideo",
949
- "PList",
950
- "PIcon",
951
- "PDivider",
952
- "PTable",
953
- "PTextField",
954
- "PTextArea",
955
- "PCheckbox",
956
- "PRadio",
957
- "PSelect"
958
- ], lt = { ...A }, ut = V({
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({
959
1523
  type: "PContainer",
960
1524
  label: "Container",
961
1525
  kind: "container",
962
- defaultStyle: lt,
963
- allowedChildren: H,
1526
+ defaultStyle: Zn,
1527
+ allowedChildren: Xn,
964
1528
  templates: []
965
- }), dt = [
1529
+ }), $n = [
966
1530
  "1",
967
1531
  "2",
968
1532
  "3",
969
1533
  "4"
970
- ], ft = { size: "4" }, pt = b(n({
1534
+ ], er = { size: "4" }, tr = k(x({
971
1535
  type: "PDivider",
972
1536
  label: "Divider",
973
1537
  allowedChildren: [],
974
1538
  templates: [],
975
- attributes: e.strictObject({
976
- id: t,
977
- size: e.enum(dt).default(ft.size)
1539
+ attributes: y.strictObject({
1540
+ id: b,
1541
+ size: y.enum($n).default(er.size)
978
1542
  }),
979
1543
  toDocumentAttributes: ({ id: e, size: t }) => ({
980
1544
  id: e,
@@ -984,237 +1548,534 @@ var H = [
984
1548
  summary: () => "",
985
1549
  attributes: { size: "Width" }
986
1550
  }
987
- })), U = {
988
- 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",
989
1668
  label: "Icon",
990
- ...S
991
- }, mt = b(n({
1669
+ size: "medium",
1670
+ shape: "outline",
1671
+ ...d
1672
+ }, ur = k(x({
992
1673
  type: "PIcon",
993
1674
  label: "Icon",
994
1675
  allowedChildren: [],
995
1676
  templates: [],
996
- attributes: e.strictObject({
997
- id: t,
998
- icon: e.string().refine(L, "Choose an outlined Material icon such as MdOutlineHome").default(U.icon),
999
- label: e.string().trim().default(U.label),
1000
- ...C
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
1001
1684
  }).refine(({ href: e, label: t }) => e === "" || t !== "", {
1002
1685
  path: ["label"],
1003
1686
  message: "Describe a linked icon so the link has a name"
1004
1687
  }),
1005
- 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 }) => ({
1006
1689
  id: e,
1007
1690
  icon: t,
1008
1691
  label: n,
1009
- ...T({
1010
- href: r,
1011
- target: i,
1012
- description: a
1692
+ size: r,
1693
+ shape: i,
1694
+ ..._({
1695
+ href: a,
1696
+ target: o,
1697
+ description: s,
1698
+ rel: c
1013
1699
  })
1014
1700
  }),
1015
1701
  history: {
1016
- summary: ({ icon: e, label: t }) => t || rt(e),
1702
+ summary: ({ icon: e, label: t }) => t || Rn(e),
1017
1703
  attributes: {
1018
1704
  icon: "Icon",
1019
1705
  label: "Description",
1020
- ...w
1706
+ size: "Size",
1707
+ shape: "Shape",
1708
+ ...g
1021
1709
  }
1022
1710
  }
1023
- })), ht = [
1024
- "width",
1025
- "height",
1026
- "minWidth",
1027
- "minHeight",
1028
- "maxWidth",
1029
- "maxHeight"
1030
- ], gt = [
1031
- "borderRadiusTopLeft",
1032
- "borderRadiusTopRight",
1033
- "borderRadiusBottomRight",
1034
- "borderRadiusBottomLeft"
1035
- ], _t = [...ht, ...gt], W = {
1036
- src: "/image-placeholder.svg",
1037
- alt: "Image",
1038
- style: {},
1039
- ...S
1040
- }, G = "--palmyit-image";
1041
- function vt(e) {
1042
- return I.filter(([t]) => e.includes(t)).map(([e, t, n]) => ({
1043
- key: e,
1044
- variable: `${G}-${t}`,
1045
- value: F,
1046
- label: n
1047
- }));
1048
- }
1049
- var K = [
1050
- ...vt(ht),
1051
- ...l(G, { typeAttribute: "data-background" }),
1052
- {
1053
- key: "borderWidth",
1054
- variable: `${G}-border-width`,
1055
- value: F,
1056
- label: "Border width"
1057
- },
1058
- {
1059
- key: "borderStyle",
1060
- variable: `${G}-border-style`,
1061
- value: e.enum(O),
1062
- label: "Border style"
1063
- },
1064
- {
1065
- key: "borderColor",
1066
- variable: `${G}-border-color`,
1067
- value: s,
1068
- label: "Border color"
1069
- },
1070
- ...vt(gt)
1071
- ], yt = b(n({
1072
- type: "PImage",
1073
- 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",
1074
1753
  allowedChildren: [],
1075
- templates: [],
1076
- attributes: e.strictObject({
1077
- id: t,
1078
- src: x.default(W.src),
1079
- alt: e.string().trim().default(W.alt),
1080
- style: g(K).transform((e) => e),
1081
- ...C
1082
- }).refine(({ href: e, alt: t }) => e === "" || t !== "", {
1083
- path: ["alt"],
1084
- 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)
1085
1842
  }),
1086
- toDocumentAttributes: ({ id: e, src: t, alt: n, style: r, href: i, target: a, description: o }) => ({
1087
- id: e,
1088
- src: t,
1089
- alt: n,
1090
- style: v(r, K),
1091
- ...T({
1092
- href: i,
1093
- target: a,
1094
- description: o
1095
- })
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 }
1096
1861
  }),
1097
1862
  history: {
1098
- summary: ({ alt: e }) => e,
1863
+ summary: ({ brandText: e }) => e || "Navigation",
1099
1864
  attributes: {
1100
- src: "Image address",
1101
- alt: "Description",
1102
- ...w,
1103
- ..._(K, "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"
1104
1879
  }
1105
1880
  }
1106
- }), K);
1107
- // src/schema/textItems.ts
1108
- function q(t, n) {
1109
- return e.array(e.strictObject({ text: e.string().trim().min(1, n) })).min(1, t);
1110
- }
1111
- function J(e) {
1112
- return e.map(({ text: e }) => ({ text: e }));
1113
- }
1114
- // src/schema/PList/pList.definition.ts
1115
- var bt = { items: [
1116
- { text: "First item" },
1117
- { text: "Second item" },
1118
- { text: "Third item" }
1119
- ] }, xt = b(n({
1881
+ }), vr = {
1882
+ items: [
1883
+ { text: "First item" },
1884
+ { text: "Second item" },
1885
+ { text: "Third item" }
1886
+ ],
1887
+ ordered: !1
1888
+ }, yr = k(x({
1120
1889
  type: "PList",
1121
1890
  label: "List",
1122
1891
  allowedChildren: [],
1123
1892
  templates: [],
1124
- attributes: e.strictObject({
1125
- id: t,
1126
- items: q("Add a list item", "Enter item text").default(bt.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)
1127
1897
  }),
1128
- toDocumentAttributes: ({ id: e, items: t }) => ({
1898
+ toDocumentAttributes: ({ id: e, items: t, ordered: n }) => ({
1129
1899
  id: e,
1130
- items: J(t)
1900
+ items: j(t),
1901
+ ...n ? { ordered: !0 } : {}
1131
1902
  }),
1132
1903
  history: {
1133
1904
  summary: ({ items: e }) => e[0]?.text ?? "",
1134
- attributes: { items: "Items" }
1905
+ attributes: {
1906
+ items: "Items",
1907
+ ordered: "Ordered"
1908
+ }
1135
1909
  }
1136
- })), St = /^\/([a-z0-9]+(-[a-z0-9]+)*)?$/, Ct = e.strictObject({
1137
- hex: e.string().regex(/^#[0-9A-Fa-f]{6}$/, "Expected a #RRGGBB color"),
1138
- opacity: e.number().int().min(0).max(100)
1139
- }), Y = {
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 = {
1140
1932
  backgroundColor: {
1141
- hex: "#FFFFFF",
1933
+ name: "white",
1142
1934
  opacity: 100
1143
1935
  },
1144
1936
  textColor: {
1145
- hex: "#0F172A",
1937
+ name: "slate-900",
1146
1938
  opacity: 100
1147
1939
  },
1148
- textSize: 14
1149
- }, X = [
1150
- {
1940
+ textSize: "sm"
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({
1151
1958
  key: "backgroundColor",
1152
1959
  variable: "--palmyit-page-background-color",
1153
- value: Ct,
1154
- defaultValue: Y.backgroundColor,
1960
+ defaultValue: Or.backgroundColor,
1155
1961
  label: "Background color"
1156
- },
1157
- {
1962
+ }),
1963
+ L({
1158
1964
  key: "textColor",
1159
1965
  variable: "--palmyit-page-text-color",
1160
- value: Ct,
1161
- defaultValue: Y.textColor,
1966
+ defaultValue: Or.textColor,
1162
1967
  label: "Text color"
1163
- },
1968
+ }),
1164
1969
  {
1165
1970
  key: "textSize",
1166
1971
  variable: "--palmyit-page-font-size",
1167
- value: e.number().min(1).max(200),
1168
- defaultValue: Y.textSize,
1972
+ value: y.enum(xr),
1973
+ defaultValue: Or.textSize,
1169
1974
  label: "Text size"
1170
1975
  }
1171
- ], wt = X.map(({ key: e }) => e), Tt = n({
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({
1172
1977
  type: "PPage",
1173
1978
  label: "Page",
1174
- allowedChildren: ["PSection"],
1979
+ allowedChildren: [
1980
+ "PNav",
1981
+ "PSection",
1982
+ "PFooter"
1983
+ ],
1175
1984
  templates: [],
1176
- attributes: e.strictObject({
1177
- id: t,
1178
- url: e.string().regex(St, "Expected / or a lowercase path such as /about-us"),
1179
- title: e.string().default(""),
1180
- style: g(X)
1181
- }).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 }) => ({
1182
2004
  pageId: e,
1183
2005
  url: t,
1184
2006
  title: n,
1185
- ...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
1186
2021
  })),
1187
- 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 }) => ({
1188
2023
  id: e,
1189
2024
  url: t,
1190
2025
  title: n,
1191
- style: v(r, X)
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))
1192
2040
  }),
1193
2041
  history: {
1194
2042
  summary: ({ title: e, url: t }) => e || t,
1195
2043
  attributes: {
1196
2044
  title: "Title",
1197
2045
  url: "URL",
1198
- ..._(X)
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)
1199
2060
  }
1200
2061
  }
1201
- }), Et = {
2062
+ }), Pr = {
1202
2063
  legend: "Choose one",
1203
2064
  options: [{ text: "Option 1" }, { text: "Option 2" }]
1204
- }, Dt = b(n({
2065
+ }, Fr = k(x({
1205
2066
  type: "PRadio",
1206
2067
  label: "Radio input",
1207
2068
  allowedChildren: [],
1208
2069
  templates: [],
1209
- attributes: e.strictObject({
1210
- id: t,
1211
- legend: e.string().trim().min(1, "Enter a question").default(Et.legend),
1212
- options: q("Add an option", "Enter option text").default(Et.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)
1213
2074
  }),
1214
2075
  toDocumentAttributes: ({ id: e, legend: t, options: n }) => ({
1215
2076
  id: e,
1216
2077
  legend: t,
1217
- options: J(n)
2078
+ options: j(n)
1218
2079
  }),
1219
2080
  history: {
1220
2081
  summary: ({ legend: e }) => e,
@@ -1223,30 +2084,30 @@ var bt = { items: [
1223
2084
  options: "Options"
1224
2085
  }
1225
2086
  }
1226
- })), Ot = { ...A }, kt = V({
2087
+ })), Ir = { ...M }, Lr = Kn({
1227
2088
  type: "PSection",
1228
2089
  label: "Section",
1229
2090
  kind: "section",
1230
- defaultStyle: Ot,
1231
- allowedChildren: H,
2091
+ defaultStyle: Ir,
2092
+ allowedChildren: Xn,
1232
2093
  templates: []
1233
- }), At = {
2094
+ }), Rr = {
1234
2095
  label: "Select",
1235
2096
  options: [{ text: "Option 1" }, { text: "Option 2" }]
1236
- }, jt = b(n({
2097
+ }, zr = k(x({
1237
2098
  type: "PSelect",
1238
2099
  label: "Select",
1239
2100
  allowedChildren: [],
1240
2101
  templates: [],
1241
- attributes: e.strictObject({
1242
- id: t,
1243
- label: e.string().trim().min(1, "Enter a label").default(At.label),
1244
- options: q("Add an option", "Enter option text").default(At.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)
1245
2106
  }),
1246
2107
  toDocumentAttributes: ({ id: e, label: t, options: n }) => ({
1247
2108
  id: e,
1248
2109
  label: t,
1249
- options: J(n)
2110
+ options: j(n)
1250
2111
  }),
1251
2112
  history: {
1252
2113
  summary: ({ label: e }) => e,
@@ -1255,7 +2116,7 @@ var bt = { items: [
1255
2116
  options: "Options"
1256
2117
  }
1257
2118
  }
1258
- })), Mt = {
2119
+ })), Br = {
1259
2120
  headers: [
1260
2121
  { text: "Column 1" },
1261
2122
  { text: "Column 2" },
@@ -1269,20 +2130,22 @@ var bt = { items: [
1269
2130
  "Cell 4",
1270
2131
  "Cell 5",
1271
2132
  "Cell 6"
1272
- ] }]
2133
+ ] }],
2134
+ caption: ""
1273
2135
  };
1274
- function Nt(e, t) {
2136
+ function Vr(e, t) {
1275
2137
  return t.map(({ cells: t }) => ({ cells: Array.from({ length: e }, (e, n) => t[n] ?? "") }));
1276
2138
  }
1277
- var Pt = e.strictObject({ cells: e.array(e.string()) }), Ft = b(n({
2139
+ var Hr = y.strictObject({ cells: y.array(y.string()) }), Ur = k(x({
1278
2140
  type: "PTable",
1279
2141
  label: "Table",
1280
2142
  allowedChildren: [],
1281
2143
  templates: [],
1282
- attributes: e.strictObject({
1283
- id: t,
1284
- headers: q("Add a column", "Enter a column heading").default(Mt.headers),
1285
- rows: e.array(Pt).default(Mt.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)
1286
2149
  }).superRefine(({ headers: e, rows: t }, n) => {
1287
2150
  t.forEach(({ cells: t }, r) => {
1288
2151
  t.length !== e.length && n.addIssue({
@@ -1296,189 +2159,58 @@ var Pt = e.strictObject({ cells: e.array(e.string()) }), Ft = b(n({
1296
2159
  });
1297
2160
  });
1298
2161
  }),
1299
- toDocumentAttributes: ({ id: e, headers: t, rows: n }) => ({
2162
+ toDocumentAttributes: ({ id: e, headers: t, rows: n, caption: r }) => ({
1300
2163
  id: e,
1301
- headers: J(t),
1302
- rows: n.map(({ cells: e }) => ({ cells: [...e] }))
2164
+ headers: j(t),
2165
+ rows: n.map(({ cells: e }) => ({ cells: [...e] })),
2166
+ ...r === "" ? {} : { caption: r }
1303
2167
  }),
1304
2168
  history: {
1305
2169
  summary: ({ headers: e }) => e[0]?.text ?? "",
1306
2170
  attributes: {
1307
2171
  headers: "Column headings",
1308
- rows: "Rows"
2172
+ rows: "Rows",
2173
+ caption: "Caption"
1309
2174
  }
1310
2175
  }
1311
- })), It = /<[^>]*>/g;
1312
- function Lt(e) {
2176
+ })), Wr = /<[^>]*>/g;
2177
+ function Gr(e) {
1313
2178
  let t = e.trim();
1314
2179
  return t.includes("<") ? t : `<p>${t}</p>`;
1315
2180
  }
1316
- function Rt(e) {
1317
- return e.replace(It, " ").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();
1318
2183
  }
1319
- // src/schema/PRichText/pRichText.definition.ts
1320
- var zt = { text: "<p>Add your main text here. Double-click to edit and customize your content to make it selectable.</p>" }, Bt = b(n({
2184
+ // src/elements/rich-text/definition.ts
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({
1321
2186
  type: "PRichText",
1322
2187
  label: "Rich text",
1323
2188
  allowedChildren: [],
1324
2189
  templates: [],
1325
- attributes: e.strictObject({
1326
- id: t,
1327
- text: e.string().transform(Lt).refine((e) => Rt(e).trim().length > 0, "Enter text").default(zt.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)
1328
2193
  }),
1329
2194
  toDocumentAttributes: ({ id: e, text: t }) => ({
1330
2195
  id: e,
1331
- text: Lt(t)
2196
+ text: Gr(t)
1332
2197
  }),
1333
2198
  history: {
1334
- summary: ({ text: e }) => Rt(e),
2199
+ summary: ({ text: e }) => Kr(e),
1335
2200
  attributes: { text: "Text" }
1336
2201
  }
1337
- })), Vt = [
1338
- "normal",
1339
- "italic",
1340
- "oblique"
1341
- ], Ht = [
1342
- "none",
1343
- "underline",
1344
- "overline",
1345
- "line-through"
1346
- ], Ut = [
1347
- "left",
1348
- "center",
1349
- "right",
1350
- "justify"
1351
- ], Wt = [
1352
- "none",
1353
- "capitalize",
1354
- "uppercase",
1355
- "lowercase"
1356
- ], Gt = [
1357
- "100",
1358
- "200",
1359
- "300",
1360
- "400",
1361
- "500",
1362
- "600",
1363
- "700",
1364
- "800",
1365
- "900"
1366
- ], Kt = {
1367
- text: "Text",
1368
- ...S,
1369
- style: {}
1370
- }, qt = "--palmyit-text";
1371
- function Jt(t) {
1372
- return [
1373
- {
1374
- key: "textFont",
1375
- variable: `${t}-font-family`,
1376
- value: e.string().refine(E, "Expected a Google Fonts family name"),
1377
- label: "Font family"
1378
- },
1379
- {
1380
- key: "fontStyle",
1381
- variable: `${t}-font-style`,
1382
- value: e.enum(Vt),
1383
- label: "Text style"
1384
- },
1385
- {
1386
- key: "textSize",
1387
- variable: `${t}-font-size`,
1388
- value: F,
1389
- label: "Text size"
1390
- },
1391
- {
1392
- key: "textColor",
1393
- variable: `${t}-color`,
1394
- value: s,
1395
- label: "Text color"
1396
- },
1397
- {
1398
- key: "lineHeight",
1399
- variable: `${t}-line-height`,
1400
- value: F,
1401
- label: "Height"
1402
- },
1403
- {
1404
- key: "letterSpacing",
1405
- variable: `${t}-letter-spacing`,
1406
- value: F,
1407
- label: "Letter spacing"
1408
- },
1409
- {
1410
- key: "wordSpacing",
1411
- variable: `${t}-word-spacing`,
1412
- value: F,
1413
- label: "Word spacing"
1414
- },
1415
- {
1416
- key: "textDecoration",
1417
- variable: `${t}-text-decoration`,
1418
- value: e.enum(Ht),
1419
- label: "Text decoration"
1420
- },
1421
- {
1422
- key: "textAlign",
1423
- variable: `${t}-text-align`,
1424
- value: e.enum(Ut),
1425
- label: "Text align"
1426
- },
1427
- {
1428
- key: "textTransform",
1429
- variable: `${t}-text-transform`,
1430
- value: e.enum(Wt),
1431
- label: "Text transform"
1432
- },
1433
- {
1434
- key: "fontWeight",
1435
- variable: `${t}-font-weight`,
1436
- value: e.enum(Gt),
1437
- label: "Text weight"
1438
- }
1439
- ];
1440
- }
1441
- var Z = Jt(qt), Yt = b(n({
1442
- type: "PText",
1443
- label: "Text",
1444
- allowedChildren: [],
1445
- templates: [],
1446
- attributes: e.strictObject({
1447
- id: t,
1448
- text: e.string().trim().min(1, "Enter text").default(Kt.text),
1449
- ...C,
1450
- style: g(Z).transform((e) => e)
1451
- }),
1452
- toDocumentAttributes: ({ id: e, text: t, href: n, target: r, description: i, style: a }) => ({
1453
- id: e,
1454
- text: t,
1455
- ...T({
1456
- href: n,
1457
- target: r,
1458
- description: i
1459
- }),
1460
- style: v(a, Z)
1461
- }),
1462
- history: {
1463
- summary: ({ text: e }) => e,
1464
- attributes: {
1465
- text: "Text",
1466
- ...w,
1467
- ..._(Z, "style.")
1468
- }
1469
- }
1470
- }), Z), Xt = {
2202
+ })), Yr = {
1471
2203
  label: "Text area",
1472
2204
  placeholder: ""
1473
- }, Zt = b(n({
2205
+ }, Xr = k(x({
1474
2206
  type: "PTextArea",
1475
2207
  label: "Text area",
1476
2208
  allowedChildren: [],
1477
2209
  templates: [],
1478
- attributes: e.strictObject({
1479
- id: t,
1480
- label: e.string().trim().min(1, "Enter a label").default(Xt.label),
1481
- placeholder: e.string().default(Xt.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)
1482
2214
  }),
1483
2215
  toDocumentAttributes: ({ id: e, label: t, placeholder: n }) => ({
1484
2216
  id: e,
@@ -1492,18 +2224,18 @@ var Z = Jt(qt), Yt = b(n({
1492
2224
  placeholder: "Placeholder"
1493
2225
  }
1494
2226
  }
1495
- })), Qt = {
2227
+ })), Zr = {
1496
2228
  label: "Text field",
1497
2229
  placeholder: ""
1498
- }, $t = b(n({
2230
+ }, Qr = k(x({
1499
2231
  type: "PTextField",
1500
2232
  label: "Text field",
1501
2233
  allowedChildren: [],
1502
2234
  templates: [],
1503
- attributes: e.strictObject({
1504
- id: t,
1505
- label: e.string().trim().min(1, "Enter a label").default(Qt.label),
1506
- placeholder: e.string().default(Qt.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)
1507
2239
  }),
1508
2240
  toDocumentAttributes: ({ id: e, label: t, placeholder: n }) => ({
1509
2241
  id: e,
@@ -1517,92 +2249,173 @@ var Z = Jt(qt), Yt = b(n({
1517
2249
  placeholder: "Placeholder"
1518
2250
  }
1519
2251
  }
1520
- })), en = {
2252
+ })), $r = ["file", "youtube"], ei = ["none", "metadata"], ti = [
2253
+ "video",
2254
+ "9/16",
2255
+ "4/3",
2256
+ "square"
2257
+ ], $ = {
2258
+ source: "file",
1521
2259
  src: "",
1522
- title: "Video"
1523
- }, tn = b(n({
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({
1524
2279
  type: "PVideo",
1525
2280
  label: "Video",
1526
2281
  allowedChildren: [],
1527
2282
  templates: [],
1528
- attributes: e.strictObject({
1529
- id: t,
1530
- src: e.union([e.literal(""), x]).default(en.src),
1531
- title: e.string().trim().min(1, "Enter a video title").default(en.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
+ });
1532
2307
  }),
1533
- 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 }) => ({
1534
2309
  id: e,
1535
- src: t,
1536
- 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 }
1537
2325
  }),
1538
2326
  history: {
1539
2327
  summary: ({ title: e }) => e,
1540
2328
  attributes: {
2329
+ source: "Source",
1541
2330
  src: "Video address",
1542
- 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"
1543
2345
  }
1544
2346
  }
1545
- })), Q = {
1546
- PPage: Tt,
1547
- PSection: kt,
1548
- PContainer: ut,
1549
- PButton: st,
1550
- PText: Yt,
1551
- PRichText: Bt,
1552
- PImage: yt,
1553
- PVideo: tn,
1554
- PList: xt,
1555
- PIcon: mt,
1556
- PDivider: pt,
1557
- PTextField: $t,
1558
- PTextArea: Zt,
1559
- PCheckbox: ct,
1560
- PRadio: Dt,
1561
- PSelect: jt,
1562
- PTable: Ft
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
1563
2369
  };
1564
- function nn(e) {
1565
- return typeof e == "string" && Object.hasOwn(Q, e);
2370
+ function oi(e) {
2371
+ return typeof e == "string" && Object.hasOwn(ai, e);
1566
2372
  }
1567
2373
  // src/schema/elementTemplates.ts
1568
- function rn(e) {
2374
+ function si(e) {
1569
2375
  return typeof e == "object" && !!e && !Array.isArray(e);
1570
2376
  }
1571
- function an(e) {
2377
+ function ci(e) {
1572
2378
  try {
1573
2379
  let t = JSON.parse(e);
1574
- return rn(t) ? t : void 0;
2380
+ return si(t) ? t : void 0;
1575
2381
  } catch {
1576
2382
  return;
1577
2383
  }
1578
2384
  }
1579
- function on(e) {
1580
- 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;
1581
2391
  }
1582
- function sn(e, t) {
1583
- let n = new Map(on(e).map((e) => [e.key, e]));
1584
- for (let e of on(t)) n.set(e.key, {
1585
- ...n.get(e.key),
1586
- ...e
1587
- });
1588
- 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;
1589
2398
  }
1590
- function cn(e, t) {
2399
+ function di(e, t) {
1591
2400
  let n = {
1592
2401
  ...e,
1593
2402
  ...t,
1594
2403
  id: e.id
1595
2404
  };
1596
- return "style" in t && (n.style = sn(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;
1597
2410
  }
1598
- function ln(e, t) {
2411
+ function fi(e, t) {
1599
2412
  if (!Array.isArray(t)) return {
1600
2413
  ok: !1,
1601
2414
  message: "Expected a list of children"
1602
2415
  };
1603
2416
  let n = [];
1604
2417
  for (let r of t) {
1605
- let t = un(e, r);
2418
+ let t = pi(e, r);
1606
2419
  if (!t.ok) return t;
1607
2420
  n.push(t.item);
1608
2421
  }
@@ -1611,21 +2424,21 @@ function ln(e, t) {
1611
2424
  content: n
1612
2425
  };
1613
2426
  }
1614
- function un(e, t) {
1615
- if (!rn(t)) return {
2427
+ function pi(e, t) {
2428
+ if (!si(t)) return {
1616
2429
  ok: !1,
1617
2430
  message: "Expected an element object"
1618
2431
  };
1619
2432
  let n = t.type;
1620
- if (!nn(n)) return {
2433
+ if (!oi(n)) return {
1621
2434
  ok: !1,
1622
2435
  message: `Unknown element type "${String(n)}"`
1623
2436
  };
1624
- if (!Q[e].allowedChildren.includes(n)) return {
2437
+ if (!ai[e].allowedChildren.includes(n)) return {
1625
2438
  ok: !1,
1626
2439
  message: `${n} is not allowed inside ${e}`
1627
2440
  };
1628
- let { children: r, type: i, ...a } = t, o = Q[n];
2441
+ let { children: r, type: i, ...a } = t, o = ai[n];
1629
2442
  if (r !== void 0 && o.allowedChildren.length === 0) return {
1630
2443
  ok: !1,
1631
2444
  message: `${n} cannot have children`
@@ -1646,7 +2459,7 @@ function un(e, t) {
1646
2459
  let l = r === void 0 ? {
1647
2460
  ok: !0,
1648
2461
  content: []
1649
- } : ln(n, r);
2462
+ } : fi(n, r);
1650
2463
  return l.ok ? {
1651
2464
  ok: !0,
1652
2465
  item: {
@@ -1658,19 +2471,19 @@ function un(e, t) {
1658
2471
  }
1659
2472
  } : l;
1660
2473
  }
1661
- function dn(e, t, n) {
2474
+ function mi(e, t, n) {
1662
2475
  let r = (e) => ({
1663
2476
  ok: !1,
1664
2477
  message: `Template "${n.name}": ${e}`
1665
- }), i = an(n.shortcode);
2478
+ }), i = ci(n.shortcode);
1666
2479
  if (!i) return r("Expected a JSON object");
1667
- let { children: a, type: o, ...s } = i, c = e.toDocumentAttributes(t), l = e.attributes.safeParse(cn(c, s));
2480
+ let { children: a, type: o, ...s } = i, c = e.toDocumentAttributes(t), l = e.attributes.safeParse(di(c, s));
1668
2481
  if (!l.success) return r(l.error.issues[0]?.message ?? "Invalid template");
1669
2482
  if (a === void 0) return {
1670
2483
  ok: !0,
1671
2484
  props: l.data
1672
2485
  };
1673
- let u = ln(e.type, a);
2486
+ let u = fi(e.type, a);
1674
2487
  return u.ok ? {
1675
2488
  ok: !0,
1676
2489
  props: l.data,
@@ -1678,28 +2491,28 @@ function dn(e, t, n) {
1678
2491
  } : r(u.message);
1679
2492
  }
1680
2493
  // src/schema/Fields/ColorField/color-value.ts
1681
- var fn = /^#[0-9A-Fa-f]{6}$/, pn = /^#[0-9A-Fa-f]{8}$/;
1682
- function mn(e) {
2494
+ var hi = /^#[0-9A-Fa-f]{6}$/, gi = /^#[0-9A-Fa-f]{8}$/;
2495
+ function _i(e) {
1683
2496
  return Math.min(100, Math.max(0, Math.round(e)));
1684
2497
  }
1685
- function hn(e) {
2498
+ function vi(e) {
1686
2499
  let t = e.hex.toUpperCase();
1687
- if (!fn.test(t)) return "#000000FF";
1688
- let n = mn(e.opacity);
2500
+ if (!hi.test(t)) return "#000000FF";
2501
+ let n = _i(e.opacity);
1689
2502
  return `${t}${Math.round(n / 100 * 255).toString(16).padStart(2, "0").toUpperCase()}`;
1690
2503
  }
1691
- function gn(e) {
2504
+ function yi(e) {
1692
2505
  let t = e.trim().toUpperCase();
1693
- return fn.test(t) ? {
2506
+ return hi.test(t) ? {
1694
2507
  hex: t,
1695
2508
  opacity: 100
1696
- } : pn.test(t) ? {
2509
+ } : gi.test(t) ? {
1697
2510
  hex: t.slice(0, 7),
1698
- opacity: mn(Number.parseInt(t.slice(7, 9), 16) / 255 * 100)
2511
+ opacity: _i(Number.parseInt(t.slice(7, 9), 16) / 255 * 100)
1699
2512
  } : null;
1700
2513
  }
1701
2514
  // src/schema/device/deviceStyle.ts
1702
- var _n = {
2515
+ var bi = {
1703
2516
  Desktop: {
1704
2517
  portrait: "style",
1705
2518
  landscape: "style"
@@ -1713,25 +2526,25 @@ var _n = {
1713
2526
  landscape: "mobileLandscapeStyle"
1714
2527
  }
1715
2528
  };
1716
- function vn(e, t = "portrait") {
1717
- return _n[e][t];
2529
+ function xi(e, t = "portrait") {
2530
+ return bi[e][t];
1718
2531
  }
1719
- function $(e, t, n = "portrait") {
1720
- let r = vn(t, n);
2532
+ function Si(e, t, n = "portrait") {
2533
+ let r = xi(t, n);
1721
2534
  return r === "style" ? {} : e[r] ?? {};
1722
2535
  }
1723
- function yn(e, t) {
2536
+ function Ci(e, t) {
1724
2537
  return JSON.stringify(e) === JSON.stringify(t);
1725
2538
  }
1726
- function bn(e, t) {
1727
- return Object.fromEntries(Object.entries(t).filter(([t, n]) => n !== void 0 && !yn(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])));
1728
2541
  }
1729
- function xn(e, t, n = "portrait") {
1730
- let r = n === "landscape" ? $(e, t, "landscape") : {};
2542
+ function Ti(e, t, n = "portrait") {
2543
+ let r = n === "landscape" ? Si(e, t, "landscape") : {};
1731
2544
  return {
1732
2545
  ...e.style,
1733
- ...$(e, t, "portrait"),
2546
+ ...Si(e, t, "portrait"),
1734
2547
  ...r
1735
2548
  };
1736
2549
  }
1737
- export { O as BORDER_LINE_STYLES, p as DEVICE_CHOICES, ze as FLEX_ALIGN_CONTENTS, Re as FLEX_ALIGN_ITEMS, Ie as FLEX_DIRECTIONS, k as FLEX_JUSTIFY_CONTENTS, Le as FLEX_WRAPS, Vt as FONT_STYLES, Gt as FONT_WEIGHTS, _t as IMAGE_LENGTH_KEYS, G as IMAGE_PREFIX, f as LANDSCAPE_VISIBILITY_PROP_BY_DEVICE, Be as LENGTH_PATTERN, nt as NO_ICON, Ut as TEXT_ALIGNS, Ht as TEXT_DECORATIONS, qt as TEXT_PREFIX, Wt as TEXT_TRANSFORMS, re as VISIBILITY_PROPS, d as VISIBILITY_PROP_BY_DEVICE, x as addressSchema, dn as applyElementTemplate, l as backgroundStyleDefinitions, Fe as backgroundStyleToCssVariables, u as builderDevices, ee as builderViewports, bn as changedStyle, s as colorValue, D as colorValueToCss, it as defaultButtonProps, B as defaultCheckboxProps, lt as defaultContainerStyle, ft as defaultDividerProps, A as defaultElementStyle, U as defaultIconProps, W as defaultImageProps, S as defaultLinkSettings, bt as defaultListProps, Y as defaultPageStyle, Et as defaultRadioProps, zt as defaultRichTextProps, Ot as defaultSectionStyle, At as defaultSelectProps, Mt as defaultTableProps, Xt as defaultTextAreaProps, Qt as defaultTextFieldProps, Kt as defaultTextProps, en as defaultVideoProps, n as defineElement, V as defineLayoutElement, te as deviceForWidth, $ as deviceOverride, vn as deviceStyleProp, t as elementIdSchema, Q as elementRegistry, $e as elementStyleDefinitions, et as elementStyleSchema, qe as elementStyleToCssVariables, Nt as fitRowsToHeaders, gn as fromHexAlpha, o as gradientToCss, nn as isElementType, E as isFontFamily, L as isOutlineIconName, a as isSafeGradientArgs, h as isShownOn, rt as labelForIcon, H as layoutChildren, I as lengthKeys, F as lengthValue, w as linkHistoryLabels, C as linkSettingsShape, Lt as normalizeRichText, ne as orientationForWidth, st as pButtonDefinition, ct as pCheckboxDefinition, ut as pContainerDefinition, pt as pDividerDefinition, mt as pIconDefinition, yt as pImageDefinition, xt as pListDefinition, Tt as pPageDefinition, Dt as pRadioDefinition, Bt as pRichTextDefinition, kt as pSectionDefinition, jt as pSelectDefinition, Ft as pTableDefinition, Zt as pTextAreaDefinition, Yt as pTextDefinition, $t as pTextFieldDefinition, tn as pVideoDefinition, wt as pageStyleKeys, xn as resolveDeviceStyle, Rt as richTextToPlainText, M as sanitizeAutoAsZero, He as sanitizeBorderWidth, j as sanitizeLength, N as sanitizeMaxLength, ie as shownDeviceCount, g as styleItemsSchema, _ as styleLabels, ue as styleOverrideItemsSchema, q as textItemsSchema, Me as textSizeToCss, Jt as textStyleDefinitions, hn as toHexAlpha, T as toLinkAttributes, v as toStyleItems, pe as toStyleOverrideItems, J as toTextItems, m as visibilityProp, b 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 };