@maildeno/editor 0.4.6 → 0.4.7

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 (61) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/dist/DatePicker-DIaGGAVI.js +5347 -0
  3. package/dist/DatePicker-DmMga5gQ.js +5347 -0
  4. package/dist/Dialog-GTfGtduh.js +6294 -0
  5. package/dist/HealthIndicator--ScSxVRA.js +1216 -0
  6. package/dist/HealthIndicator-BraAh2Aj.js +1217 -0
  7. package/dist/Icon-BYmOM482.js +2537 -0
  8. package/dist/Icon-c2SPT3-6.js +2577 -0
  9. package/dist/PreviewCanvas-C1-rP9-B.js +533 -0
  10. package/dist/PreviewCanvas-Nro7tNCn.js +533 -0
  11. package/dist/RichTextEditor-CrYhiAOo.js +12217 -0
  12. package/dist/RichTextEditor-D7Itx0fL.js +12218 -0
  13. package/dist/RowPreviewChildren-B66HbFdX.js +4 -0
  14. package/dist/RowPreviewChildren-DvrE9HTT.js +4 -0
  15. package/dist/RowPreviewLegacyComponent-3QuwvWmT.js +402 -0
  16. package/dist/RowPreviewLegacyComponent-CPqaWwsE.js +402 -0
  17. package/dist/RowPreviewRow-B91YPfoz.js +80 -0
  18. package/dist/RowPreviewRow-MaA-9ApX.js +80 -0
  19. package/dist/SavedRowsPanel-CF-7R3q_.js +492 -0
  20. package/dist/SavedRowsPanel-TLOEvs3Z.js +491 -0
  21. package/dist/_plugin-vue_export-helper-Dj7HTbfw.js +8 -0
  22. package/dist/babel-DV7WPQI0.js +10043 -0
  23. package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +3 -3
  24. package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +4 -4
  25. package/dist/editor.css +2 -1
  26. package/dist/element-CeRQDEn3.js +21396 -0
  27. package/dist/element.js +2 -2
  28. package/dist/estree-DY9POgc0.js +8195 -0
  29. package/dist/html-wb0gSX1o.js +7273 -0
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.js +14886 -14
  32. package/dist/init.js +83 -94
  33. package/dist/mergeTagDefinitions-Cler19nv.js +27 -0
  34. package/dist/standalone-DHvJ30Td.js +3554 -0
  35. package/dist/useEmailBuilder-CjJoxzTi.js +4893 -0
  36. package/dist/useEmailBuilder-gOc8otd8.js +4893 -0
  37. package/dist/useToast-DeNMwkP3.js +194 -0
  38. package/dist/vue.runtime.esm-bundler-D2AjRP90.js +6117 -0
  39. package/package.json +3 -1
  40. package/dist/DatePicker-6dMK-shv.js +0 -5639
  41. package/dist/DatePicker-CEm1DPgG.js +0 -5640
  42. package/dist/HealthIndicator-Ch5Ck0BL.js +0 -1954
  43. package/dist/HealthIndicator-Dr5vMr1T.js +0 -1953
  44. package/dist/PreviewCanvas-CG52GC5m.js +0 -667
  45. package/dist/PreviewCanvas-CjOrVIGt.js +0 -668
  46. package/dist/RichTextEditor-DaaHuVox.js +0 -13487
  47. package/dist/RichTextEditor-DoWpYF0R.js +0 -13432
  48. package/dist/RowPreviewChildren-DQoyExvw.js +0 -4
  49. package/dist/RowPreviewChildren-yl3aB7hb.js +0 -4
  50. package/dist/RowPreviewLegacyComponent-CHxbwy9l.js +0 -454
  51. package/dist/RowPreviewLegacyComponent-Dv7OCys4.js +0 -454
  52. package/dist/RowPreviewRow-Bizr4PTf.js +0 -86
  53. package/dist/RowPreviewRow-CLhz0YQ5.js +0 -86
  54. package/dist/SavedRowsPanel-C0DkAzHi.js +0 -611
  55. package/dist/SavedRowsPanel-Cp3gADrK.js +0 -610
  56. package/dist/babel-Bmz1GpKj.js +0 -7218
  57. package/dist/element-CRfWpZos.js +0 -40842
  58. package/dist/estree-C5xyFN_T.js +0 -4831
  59. package/dist/html-Dc_r73Xn.js +0 -3062
  60. package/dist/index-BlYp4vAp.js +0 -34092
  61. package/dist/standalone-Yv8gSIWN.js +0 -2336
@@ -1,668 +0,0 @@
1
- import { defineComponent as de, computed as s, resolveComponent as we, withDirectives as k, openBlock as o, createElementBlock as i, normalizeStyle as l, Fragment as I, renderList as H, createBlock as X, vShow as S, resolveDynamicComponent as Ae, createElementVNode as m, createCommentVNode as B, createTextVNode as ze, toDisplayString as _, normalizeClass as Ce, createStaticVNode as Me, unref as V } from "vue";
2
- import { e as se, V as ce } from "./index-BlYp4vAp.js";
3
- const Ie = ["innerHTML"], We = ["innerHTML"], He = ["src", "alt"], Re = ["src", "alt"], Fe = {
4
- style: { width: "28px", height: "28px", color: "#94a3b8" },
5
- fill: "currentColor",
6
- viewBox: "0 0 20 20"
7
- }, Pe = ["src", "alt"], Be = ["src", "alt"], _e = ["src", "alt"], Te = 5, De = /* @__PURE__ */ de({
8
- __name: "PreviewComponent",
9
- props: {
10
- component: {},
11
- forceMobile: { type: Boolean },
12
- depth: {}
13
- },
14
- setup(w) {
15
- const c = w, b = s(
16
- () => c.component.componentType ?? c.component.type
17
- ), { visibilityPreviewContext: T } = se(), { evaluateVisibility: j } = ce(), h = s(() => {
18
- var r;
19
- const e = b.value, a = e === "row" || e === "row-spacer" ? c.component.visibility : (r = c.component.props) == null ? void 0 : r.visibility;
20
- return j(a, T.value);
21
- }), n = s(() => {
22
- const e = c.component.props ?? {};
23
- if (!c.forceMobile || !e.mobile) return e;
24
- const a = { ...e };
25
- for (const [r, p] of Object.entries(e.mobile))
26
- p != null && (a[r] = p);
27
- return a;
28
- });
29
- function u(e, a = "0") {
30
- return e ? `${e.top ?? 0}px ${e.right ?? 0}px ${e.bottom ?? 0}px ${e.left ?? 0}px` : a;
31
- }
32
- function W(e) {
33
- return e == null ? "" : String(e);
34
- }
35
- function $(e) {
36
- var p;
37
- const a = e == null ? void 0 : e.backgroundGradient;
38
- if ((a == null ? void 0 : a.useGradient) === !0 && Array.isArray((p = a == null ? void 0 : a.gradient) == null ? void 0 : p.colors) && a.gradient.colors.length >= 2) {
39
- const { type: v, direction: A, colors: R } = a.gradient, C = R.map((F) => `${F.color} ${F.position}%`).join(", ");
40
- return v === "radial" ? `radial-gradient(circle at center, ${C})` : `linear-gradient(${A}, ${C})`;
41
- }
42
- return (e == null ? void 0 : e.backgroundColor) ?? "transparent";
43
- }
44
- const G = s(() => {
45
- const e = c.component, r = {
46
- display: "flex",
47
- flexDirection: c.forceMobile && e.mobileStack === !0 ? "column" : "row",
48
- background: $(e),
49
- padding: e.padding ? `${e.padding.top}px ${e.padding.right}px ${e.padding.bottom}px ${e.padding.left}px` : "0",
50
- minHeight: e.minHeight ? `${e.minHeight}px` : "auto",
51
- alignItems: "stretch",
52
- // CRITICAL: nested rows must fill the parent column's width. Without
53
- // these three, a flex row inside a flex column (parent column has
54
- // flex-direction: column) sizes to its content, then the percent-width
55
- // children compute against that smaller width and overflow horizontally
56
- // — that's the "Heading One/Two cards float outside the parent column"
57
- // bug from the preview screenshot.
58
- width: "100%",
59
- minWidth: "0",
60
- boxSizing: "border-box"
61
- };
62
- return e.border && (r.border = `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}`, r.borderRadius = `${e.border.radius ?? 0}px`), (e.gap ?? 0) > 0 && (r.gap = `${e.gap}px`), e.backgroundImage && (r.backgroundImage = `url(${e.backgroundImage})`, r.backgroundSize = e.backgroundSize ?? "cover", r.backgroundPosition = e.backgroundPosition ?? "center center", r.backgroundRepeat = e.backgroundRepeat ?? "no-repeat"), r;
63
- }), N = {
64
- top: "flex-start",
65
- middle: "center",
66
- bottom: "flex-end"
67
- };
68
- function E(e) {
69
- var A;
70
- const a = c.component, r = c.forceMobile && a.mobileStack === !0, p = ((A = e.border) == null ? void 0 : A.radius) ?? 0, v = {
71
- width: r ? "100%" : `${e.width ?? 100}%`,
72
- boxSizing: "border-box",
73
- display: "flex",
74
- flexDirection: "column",
75
- justifyContent: N[e.verticalAlign] || "flex-start",
76
- padding: e.padding ? `${e.padding.top}px ${e.padding.right}px ${e.padding.bottom}px ${e.padding.left}px` : "10px",
77
- background: $(e),
78
- minWidth: "0"
79
- // Apply `overflow: hidden` only when the nested column has rounded
80
- // corners — there, it's needed to clip children to the rounded shape.
81
- // For square columns, omit overflow so the flex+radius+overflow quirk
82
- // (which hides backgrounds in some engines) doesn't apply. Matches real
83
- // CanvasColumn behavior.
84
- };
85
- return p > 0 && (v.overflow = "hidden"), e.border && (v.border = `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}`, v.borderRadius = `${p}px`), e.backgroundImage && (v.backgroundImage = `url(${e.backgroundImage})`, v.backgroundSize = e.backgroundSize ?? "cover", v.backgroundPosition = e.backgroundPosition ?? "center center", v.backgroundRepeat = e.backgroundRepeat ?? "no-repeat"), v;
86
- }
87
- const t = s(() => ({
88
- width: "100%",
89
- height: (c.component.height ?? 20) + "px",
90
- background: $(c.component)
91
- })), d = s(() => {
92
- const e = n.value;
93
- return {
94
- margin: u(e.margin),
95
- padding: u(e.padding),
96
- fontSize: (e.fontSize ?? 32) + "px",
97
- lineHeight: String(e.lineHeight ?? 1.2),
98
- letterSpacing: (e.letterSpacing ?? 0) + "px",
99
- color: e.color ?? "#111111",
100
- fontWeight: e.fontWeight ?? "bold",
101
- fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
102
- background: $(e),
103
- textTransform: e.textTransform ?? "none",
104
- textDecoration: e.textDecoration ?? "none",
105
- textAlign: e.align ?? "left",
106
- // Wrap long unbroken strings (URLs, hash-codes) inside narrow columns
107
- // instead of letting them push the layout wider. Mirrors what real
108
- // email clients do on small viewports.
109
- overflowWrap: "break-word",
110
- wordBreak: "break-word"
111
- };
112
- }), f = s(() => {
113
- const e = n.value;
114
- return {
115
- margin: u(e.margin),
116
- padding: u(e.padding),
117
- fontSize: (e.fontSize ?? 16) + "px",
118
- lineHeight: String(e.lineHeight ?? 1.5),
119
- letterSpacing: (e.letterSpacing ?? 0) + "px",
120
- color: e.color ?? "#111111",
121
- fontWeight: e.fontWeight ?? "normal",
122
- fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
123
- fontStyle: e.fontStyle ?? "normal",
124
- background: $(e),
125
- textTransform: e.textTransform ?? "none",
126
- textDecoration: e.textDecoration ?? "none",
127
- textAlign: e.align ?? "left",
128
- overflowWrap: "break-word",
129
- wordBreak: "break-word"
130
- };
131
- }), g = s(() => {
132
- const e = n.value;
133
- return {
134
- margin: u(e.margin),
135
- padding: u(e.padding, "0 0 0 20px"),
136
- fontSize: (e.fontSize ?? 16) + "px",
137
- lineHeight: String(e.lineHeight ?? 1.5),
138
- letterSpacing: (e.letterSpacing ?? 0) + "px",
139
- fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
140
- color: e.color ?? "#111111",
141
- background: $(e),
142
- overflowWrap: "break-word",
143
- wordBreak: "break-word"
144
- };
145
- }), x = s(() => {
146
- const e = n.value;
147
- return {
148
- margin: u(e.margin),
149
- padding: u(e.padding),
150
- textAlign: e.align ?? "center"
151
- };
152
- }), z = s(() => {
153
- const e = n.value;
154
- return {
155
- width: typeof e.width == "number" ? e.width + "%" : "100%",
156
- height: "auto",
157
- maxWidth: "100%",
158
- borderRadius: (e.borderRadius ?? 0) + "px",
159
- border: e.border ? `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}` : "none",
160
- display: "inline-block"
161
- };
162
- }), O = s(() => ({
163
- width: "100%",
164
- height: "100px",
165
- background: "#e2e8f0",
166
- borderRadius: "4px"
167
- })), D = s(() => {
168
- const e = n.value;
169
- return {
170
- margin: u(e.margin),
171
- padding: u(e.padding),
172
- textAlign: e.align ?? "center"
173
- };
174
- }), L = s(() => {
175
- const e = n.value;
176
- return {
177
- position: "relative",
178
- display: "inline-block",
179
- width: typeof e.width == "number" ? e.width + "%" : "100%",
180
- paddingTop: "56.25%",
181
- overflow: "hidden",
182
- borderRadius: (e.borderRadius ?? 0) + "px"
183
- };
184
- }), ue = s(() => ({
185
- position: "absolute",
186
- top: "0",
187
- left: "0",
188
- width: "100%",
189
- height: "100%",
190
- objectFit: "cover"
191
- })), pe = s(() => ({
192
- position: "absolute",
193
- top: "0",
194
- left: "0",
195
- width: "100%",
196
- height: "100%",
197
- background: "#e2e8f0",
198
- display: "flex",
199
- alignItems: "center",
200
- justifyContent: "center"
201
- })), ge = s(() => {
202
- const e = n.value;
203
- return {
204
- margin: u(e.margin),
205
- textAlign: e.align ?? "center"
206
- };
207
- }), me = s(() => {
208
- const e = n.value, a = !!e.icon;
209
- return {
210
- background: $(e),
211
- color: e.color ?? "#ffffff",
212
- fontSize: (e.fontSize ?? 16) + "px",
213
- fontWeight: e.fontWeight ?? "600",
214
- fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
215
- letterSpacing: (e.letterSpacing ?? 0) + "px",
216
- padding: u(e.padding, "12px 24px"),
217
- borderRadius: (e.borderRadius ?? 4) + "px",
218
- border: e.border ? `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}` : "none",
219
- display: a ? "inline-flex" : "inline-block",
220
- alignItems: a ? "center" : void 0,
221
- verticalAlign: a ? "middle" : void 0,
222
- lineHeight: "1.2",
223
- textDecoration: "none",
224
- textTransform: e.textTransform ?? "none",
225
- whiteSpace: "nowrap"
226
- };
227
- }), q = s(() => {
228
- const e = n.value, a = Math.max(4, e.iconSize ?? 20), r = e.iconGap ?? 8, p = e.iconPosition !== "after";
229
- return {
230
- display: "block",
231
- width: a + "px",
232
- height: a + "px",
233
- flexShrink: "0",
234
- marginRight: p ? r + "px" : "0",
235
- marginLeft: p ? "0" : r + "px"
236
- };
237
- }), fe = s(() => {
238
- const e = n.value;
239
- return {
240
- margin: u(e.margin),
241
- padding: u(e.padding),
242
- textAlign: e.align ?? "left"
243
- };
244
- }), be = s(() => {
245
- const e = n.value;
246
- return {
247
- color: e.color ?? "#007bff",
248
- fontSize: (e.fontSize ?? 16) + "px",
249
- fontWeight: e.fontWeight ?? "normal",
250
- fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
251
- letterSpacing: (e.letterSpacing ?? 0) + "px",
252
- textDecoration: e.textDecoration ?? "underline",
253
- overflowWrap: "break-word",
254
- wordBreak: "break-word"
255
- };
256
- }), xe = s(() => {
257
- const e = n.value;
258
- return {
259
- margin: u(e.margin),
260
- padding: u(e.padding),
261
- textAlign: e.align ?? "center"
262
- };
263
- }), ve = s(() => {
264
- const e = n.value, a = e.align ?? "center";
265
- return {
266
- width: (e.width ?? 100) + "%",
267
- height: (e.height ?? 1) + "px",
268
- background: $(e),
269
- border: "none",
270
- display: "block",
271
- margin: a === "center" ? "0 auto" : a === "right" ? "0 0 0 auto" : "0"
272
- };
273
- }), ye = s(() => {
274
- const e = n.value;
275
- return {
276
- width: "100%",
277
- height: (e.height ?? 20) + "px",
278
- background: $(e)
279
- };
280
- }), he = s(() => {
281
- const e = n.value;
282
- return {
283
- display: "flex",
284
- flexWrap: "wrap",
285
- gap: (e.spacing ?? 8) + "px",
286
- justifyContent: e.align === "center" ? "center" : e.align === "right" ? "flex-end" : "flex-start",
287
- margin: u(e.margin),
288
- padding: u(e.padding)
289
- // No `background` key — wrapper stays transparent so parent column/row
290
- // bg shows through. This is the documented behavior the user flagged.
291
- };
292
- }), ke = {
293
- display: "inline-flex",
294
- alignItems: "center",
295
- justifyContent: "center"
296
- }, Se = s(() => {
297
- const e = n.value;
298
- return {
299
- margin: u(e.margin),
300
- padding: u(e.padding),
301
- textAlign: e.align ?? "left",
302
- lineHeight: "0",
303
- background: $(e)
304
- };
305
- });
306
- function $e(e, a) {
307
- const r = n.value, p = r.mobileStack === !0 && c.forceMobile, v = r.spacing ?? 8, A = Math.ceil((v ?? 0) / 2), R = e === 0, C = e === a - 1;
308
- return {
309
- display: p ? "block" : "inline-block",
310
- marginLeft: p || R ? "0px" : A + "px",
311
- marginRight: p || C ? "0px" : A + "px",
312
- marginBottom: p && !C ? v + "px" : "0px",
313
- fontSize: Math.max(6, r.fontSize ?? 14) + "px",
314
- lineHeight: String(r.lineHeight ?? 1.4),
315
- letterSpacing: (r.letterSpacing ?? 0) + "px",
316
- color: r.color ?? "#111111",
317
- fontWeight: r.fontWeight ?? "normal",
318
- fontFamily: r.fontFamily ? `'${r.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
319
- fontStyle: r.fontStyle ?? "normal",
320
- textTransform: r.textTransform ?? "none",
321
- textDecoration: r.textDecoration ?? "none",
322
- whiteSpace: p ? "normal" : "nowrap"
323
- };
324
- }
325
- const J = s(() => c.depth ?? 0);
326
- return (e, a) => {
327
- var p, v, A, R, C, F, K, Q, U, Y, Z, ee, te, ne, oe, ie, re, ae, le;
328
- const r = we("PreviewComponent", !0);
329
- return b.value === "row" && J.value < Te ? k((o(), i("div", {
330
- key: 0,
331
- style: l(G.value)
332
- }, [
333
- (o(!0), i(I, null, H(w.component.columns || [], (y) => (o(), i("div", {
334
- key: y.id,
335
- style: l(E(y))
336
- }, [
337
- (o(!0), i(I, null, H(y.children ?? y.components ?? [], (M) => (o(), X(r, {
338
- key: M.id,
339
- component: M,
340
- "force-mobile": w.forceMobile,
341
- depth: J.value + 1
342
- }, null, 8, ["component", "force-mobile", "depth"]))), 128))
343
- ], 4))), 128))
344
- ], 4)), [
345
- [S, h.value]
346
- ]) : b.value === "row-spacer" ? k((o(), i("div", {
347
- key: 1,
348
- style: l(t.value)
349
- }, null, 4)), [
350
- [S, h.value]
351
- ]) : b.value === "heading" ? k((o(), X(Ae(((p = n.value) == null ? void 0 : p.level) || "h2"), {
352
- key: 2,
353
- style: l(d.value),
354
- innerHTML: W((v = n.value) == null ? void 0 : v.content)
355
- }, null, 8, ["style", "innerHTML"])), [
356
- [S, h.value]
357
- ]) : b.value === "paragraph" ? k((o(), i("p", {
358
- key: 3,
359
- style: l(f.value),
360
- innerHTML: W((A = n.value) == null ? void 0 : A.content)
361
- }, null, 12, Ie)), [
362
- [S, h.value]
363
- ]) : b.value === "list" ? k((o(), i("div", {
364
- key: 4,
365
- style: l(g.value),
366
- innerHTML: W((R = n.value) == null ? void 0 : R.content)
367
- }, null, 12, We)), [
368
- [S, h.value]
369
- ]) : b.value === "image" ? k((o(), i("div", {
370
- key: 5,
371
- style: l(x.value)
372
- }, [
373
- (C = n.value) != null && C.src ? (o(), i("img", {
374
- key: 0,
375
- src: n.value.src,
376
- alt: ((F = n.value) == null ? void 0 : F.alt) || "",
377
- style: l(z.value)
378
- }, null, 12, He)) : (o(), i("div", {
379
- key: 1,
380
- style: l(O.value)
381
- }, null, 4))
382
- ], 4)), [
383
- [S, h.value]
384
- ]) : b.value === "video" ? k((o(), i("div", {
385
- key: 6,
386
- style: l(D.value)
387
- }, [
388
- m("div", {
389
- style: l(L.value)
390
- }, [
391
- (K = n.value) != null && K.coverImage ? (o(), i("img", {
392
- key: 0,
393
- src: n.value.coverImage,
394
- alt: ((Q = n.value) == null ? void 0 : Q.alt) || "Video",
395
- style: l(ue.value)
396
- }, null, 12, Re)) : (o(), i("div", {
397
- key: 1,
398
- style: l(pe.value)
399
- }, [
400
- (o(), i("svg", Fe, [...a[0] || (a[0] = [
401
- m("path", {
402
- "fill-rule": "evenodd",
403
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zM9.555 7.168A1 1 0 008 8v4a1 1 0 001.555.832l3-2a1 1 0 000-1.664l-3-2z",
404
- "clip-rule": "evenodd"
405
- }, null, -1)
406
- ])]))
407
- ], 4))
408
- ], 4)
409
- ], 4)), [
410
- [S, h.value]
411
- ]) : b.value === "button" ? k((o(), i("div", {
412
- key: 7,
413
- style: l(ge.value)
414
- }, [
415
- m("span", {
416
- style: l(me.value)
417
- }, [
418
- (U = n.value) != null && U.icon && ((Y = n.value) == null ? void 0 : Y.iconPosition) !== "after" ? (o(), i("img", {
419
- key: 0,
420
- src: n.value.icon,
421
- alt: ((Z = n.value) == null ? void 0 : Z.iconAlt) || "",
422
- style: l(q.value)
423
- }, null, 12, Pe)) : B("", !0),
424
- ze(" " + _(((ee = n.value) == null ? void 0 : ee.text) || "Button") + " ", 1),
425
- (te = n.value) != null && te.icon && ((ne = n.value) == null ? void 0 : ne.iconPosition) === "after" ? (o(), i("img", {
426
- key: 1,
427
- src: n.value.icon,
428
- alt: ((oe = n.value) == null ? void 0 : oe.iconAlt) || "",
429
- style: l(q.value)
430
- }, null, 12, Be)) : B("", !0)
431
- ], 4)
432
- ], 4)), [
433
- [S, h.value]
434
- ]) : b.value === "anchor" ? k((o(), i("div", {
435
- key: 8,
436
- style: l(fe.value)
437
- }, [
438
- m("span", {
439
- style: l(be.value)
440
- }, _(((ie = n.value) == null ? void 0 : ie.text) || "Link"), 5)
441
- ], 4)), [
442
- [S, h.value]
443
- ]) : b.value === "divider" ? k((o(), i("div", {
444
- key: 9,
445
- style: l(xe.value)
446
- }, [
447
- m("hr", {
448
- style: l(ve.value)
449
- }, null, 4)
450
- ], 4)), [
451
- [S, h.value]
452
- ]) : b.value === "spacer" ? k((o(), i("div", {
453
- key: 10,
454
- style: l(ye.value)
455
- }, null, 4)), [
456
- [S, h.value]
457
- ]) : b.value === "socials" ? k((o(), i("div", {
458
- key: 11,
459
- style: l(he.value)
460
- }, [
461
- (ae = (re = n.value) == null ? void 0 : re.platforms) != null && ae.some((y) => y.enabled && y.link) ? (o(!0), i(I, { key: 0 }, H(n.value.platforms.filter(
462
- (y) => y.enabled && y.link
463
- ), (y) => {
464
- var M, P;
465
- return o(), i("span", {
466
- key: y.name,
467
- style: ke
468
- }, [
469
- m("img", {
470
- src: y.icon,
471
- alt: y.name,
472
- style: l({
473
- width: (((M = n.value) == null ? void 0 : M.iconSize) || 24) + "px",
474
- height: (((P = n.value) == null ? void 0 : P.iconSize) || 24) + "px",
475
- display: "block"
476
- })
477
- }, null, 12, _e)
478
- ]);
479
- }), 128)) : B("", !0)
480
- ], 4)), [
481
- [S, h.value]
482
- ]) : b.value === "menu" ? k((o(), i("div", {
483
- key: 12,
484
- style: l(Se.value)
485
- }, [
486
- (o(!0), i(I, null, H(((le = n.value) == null ? void 0 : le.items) || [], (y, M) => {
487
- var P;
488
- return o(), i("span", {
489
- key: M,
490
- style: l($e(Number(M), (((P = n.value) == null ? void 0 : P.items) || []).length))
491
- }, _(y.label || ""), 5);
492
- }), 128))
493
- ], 4)), [
494
- [S, h.value]
495
- ]) : B("", !0);
496
- };
497
- }
498
- }), Le = { class: "flex flex-col h-full bg-(--md-surface) rounded-xl border border-(--md-border) overflow-hidden" }, Ve = { class: "flex items-center gap-3 px-3 py-2.5 border-b border-(--md-border) bg-(--md-surface-hover)/70 shrink-0" }, je = { class: "flex-1 min-w-0 flex items-center gap-2 rounded-md px-2.5 py-1.5 border bg-(--md-surface) border-(--md-border)" }, Ge = { class: "ml-auto text-[10.5px] text-(--md-text-subtle) font-mono shrink-0" }, Ne = { class: "p-6" }, Ee = {
499
- key: 0,
500
- class: "flex flex-col items-center justify-center h-[60vh] text-center gap-3"
501
- }, qe = /* @__PURE__ */ de({
502
- __name: "PreviewCanvas",
503
- props: {
504
- rows: {},
505
- canvas: {},
506
- forceMobile: { type: Boolean }
507
- },
508
- setup(w) {
509
- const c = w, { visibilityPreviewContext: b } = se(), { evaluateVisibility: T } = ce(), j = s(() => {
510
- var t;
511
- return ((t = c.canvas) == null ? void 0 : t.bodyBackgroundColor) ?? "#f9fafb";
512
- }), h = s(() => (c.rows ?? []).length > 0), n = s(() => {
513
- var f, g;
514
- const t = ((f = c.canvas) == null ? void 0 : f.width) ?? 600;
515
- if (!c.forceMobile) return t;
516
- const d = ((g = c.canvas) == null ? void 0 : g.mobileBreakpoint) ?? 600;
517
- return d === 600 ? 360 : d;
518
- }), u = s(() => {
519
- var d;
520
- const t = (d = c.canvas) == null ? void 0 : d.padding;
521
- return t ? `${t.top ?? 0}px ${t.right ?? 0}px ${t.bottom ?? 0}px ${t.left ?? 0}px` : "0";
522
- });
523
- function W(t) {
524
- var g;
525
- const d = t == null ? void 0 : t.backgroundGradient;
526
- if ((d == null ? void 0 : d.useGradient) === !0 && Array.isArray((g = d == null ? void 0 : d.gradient) == null ? void 0 : g.colors) && d.gradient.colors.length >= 2) {
527
- const { type: x, direction: z, colors: O } = d.gradient, D = O.map((L) => `${L.color} ${L.position}%`).join(", ");
528
- return x === "radial" ? `radial-gradient(circle at center, ${D})` : `linear-gradient(${z}, ${D})`;
529
- }
530
- return (t == null ? void 0 : t.backgroundColor) ?? "transparent";
531
- }
532
- function $(t) {
533
- return {
534
- width: "100%",
535
- height: (t.height ?? 20) + "px",
536
- background: W(t)
537
- };
538
- }
539
- function G(t) {
540
- const f = {
541
- display: "flex",
542
- flexDirection: c.forceMobile && t.mobileStack === !0 ? "column" : "row",
543
- background: W(t),
544
- padding: t.padding ? `${t.padding.top}px ${t.padding.right}px ${t.padding.bottom}px ${t.padding.left}px` : "0",
545
- minHeight: t.minHeight ? `${t.minHeight}px` : "auto",
546
- alignItems: "stretch",
547
- width: "100%",
548
- boxSizing: "border-box"
549
- };
550
- return t.border && (f.border = `${t.border.width ?? 0}px ${t.border.style ?? "solid"} ${t.border.color ?? "transparent"}`, f.borderRadius = `${t.border.radius ?? 0}px`), (t.gap ?? 0) > 0 && (f.gap = `${t.gap}px`), t.backgroundImage && (f.backgroundImage = `url(${t.backgroundImage})`, f.backgroundSize = t.backgroundSize ?? "cover", f.backgroundPosition = t.backgroundPosition ?? "center center", f.backgroundRepeat = t.backgroundRepeat ?? "no-repeat"), f;
551
- }
552
- const N = {
553
- top: "flex-start",
554
- middle: "center",
555
- bottom: "flex-end"
556
- };
557
- function E(t, d) {
558
- var z;
559
- const f = c.forceMobile && d.mobileStack === !0, g = ((z = t.border) == null ? void 0 : z.radius) ?? 0, x = {
560
- width: f ? "100%" : `${t.width ?? 100}%`,
561
- boxSizing: "border-box",
562
- display: "flex",
563
- flexDirection: "column",
564
- justifyContent: N[t.verticalAlign] || "flex-start",
565
- padding: t.padding ? `${t.padding.top ?? 0}px ${t.padding.right ?? 0}px ${t.padding.bottom ?? 0}px ${t.padding.left ?? 0}px` : "10px",
566
- background: W(t),
567
- // minWidth:0 lets flex columns shrink below their content's intrinsic
568
- // width — required for word-wrap to actually take effect inside flex.
569
- minWidth: "0"
570
- };
571
- return g > 0 && (x.overflow = "hidden"), t.border && (x.border = `${t.border.width ?? 0}px ${t.border.style ?? "solid"} ${t.border.color ?? "transparent"}`, x.borderRadius = `${g}px`), t.backgroundImage && (x.backgroundImage = `url(${t.backgroundImage})`, x.backgroundSize = t.backgroundSize ?? "cover", x.backgroundPosition = t.backgroundPosition ?? "center center", x.backgroundRepeat = t.backgroundRepeat ?? "no-repeat"), x;
572
- }
573
- return (t, d) => {
574
- var f;
575
- return o(), i("div", Le, [
576
- m("div", Ve, [
577
- d[3] || (d[3] = m("div", { class: "flex items-center gap-1.5 shrink-0" }, [
578
- m("span", {
579
- class: "w-2.5 h-2.5 rounded-full bg-[#ff5f57]",
580
- "aria-hidden": "true"
581
- }),
582
- m("span", {
583
- class: "w-2.5 h-2.5 rounded-full bg-[#febc2e]",
584
- "aria-hidden": "true"
585
- }),
586
- m("span", {
587
- class: "w-2.5 h-2.5 rounded-full bg-[#28c840]",
588
- "aria-hidden": "true"
589
- })
590
- ], -1)),
591
- m("div", je, [
592
- d[0] || (d[0] = m("span", { class: "w-1.5 h-1.5 rounded-full bg-(--md-success) shrink-0" }, null, -1)),
593
- d[1] || (d[1] = m("span", { class: "text-[12px] font-medium text-(--md-text) truncate" }, " Source ", -1)),
594
- d[2] || (d[2] = m("span", { class: "text-[10.5px] text-(--md-text-subtle) truncate" }, " · Live canvas data ", -1)),
595
- m("span", Ge, _(n.value) + "px ", 1)
596
- ]),
597
- m("span", {
598
- class: Ce([
599
- "inline-flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-1 rounded shrink-0",
600
- w.forceMobile ? "bg-(--md-warning-bg) text-(--md-warning-fg)" : "bg-(--md-success-bg) text-(--md-success-fg)"
601
- ])
602
- }, _(w.forceMobile ? "Mobile" : "Desktop"), 3)
603
- ]),
604
- m("div", {
605
- class: "flex-1 overflow-y-auto overflow-x-hidden",
606
- style: l({ backgroundColor: j.value })
607
- }, [
608
- m("div", Ne, [
609
- h.value ? (o(), i("div", {
610
- key: 1,
611
- class: "mx-auto shadow-sm rounded-md overflow-hidden",
612
- style: l({
613
- width: n.value + "px",
614
- maxWidth: "100%",
615
- backgroundColor: ((f = w.canvas) == null ? void 0 : f.backgroundColor) ?? "#ffffff"
616
- })
617
- }, [
618
- m("div", {
619
- style: l({
620
- padding: u.value
621
- })
622
- }, [
623
- (o(!0), i(I, null, H(w.rows, (g) => (o(), i(I, {
624
- key: g.id
625
- }, [
626
- g.type === "row-spacer" ? k((o(), i("div", {
627
- key: 0,
628
- style: l($(g))
629
- }, null, 4)), [
630
- [
631
- S,
632
- V(T)(g.visibility, V(b))
633
- ]
634
- ]) : g.type === "row" ? k((o(), i("div", {
635
- key: 1,
636
- style: l(G(g))
637
- }, [
638
- (o(!0), i(I, null, H(g.columns || [], (x) => (o(), i("div", {
639
- key: x.id,
640
- style: l(E(x, g))
641
- }, [
642
- (o(!0), i(I, null, H(x.children ?? x.components ?? [], (z) => (o(), X(De, {
643
- key: z.id,
644
- component: z,
645
- "force-mobile": w.forceMobile,
646
- depth: 1
647
- }, null, 8, ["component", "force-mobile"]))), 128))
648
- ], 4))), 128))
649
- ], 4)), [
650
- [
651
- S,
652
- V(T)(g.visibility, V(b))
653
- ]
654
- ]) : B("", !0)
655
- ], 64))), 128))
656
- ], 4)
657
- ], 4)) : (o(), i("div", Ee, [...d[4] || (d[4] = [
658
- Me('<div class="w-12 h-12 rounded-xl bg-(--md-surface) border border-(--md-border) flex items-center justify-center"><svg class="w-6 h-6 text-(--md-text-subtle)" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></div><div><p class="text-sm font-medium text-(--md-text-muted)"> No content yet </p><p class="text-[12px] text-(--md-text-subtle) mt-1"> Add components in the builder to see them here. </p></div>', 2)
659
- ])]))
660
- ])
661
- ], 4)
662
- ]);
663
- };
664
- }
665
- });
666
- export {
667
- qe as default
668
- };