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