@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.
- package/CHANGELOG.md +42 -0
- package/dist/DatePicker-DIaGGAVI.js +5347 -0
- package/dist/DatePicker-DmMga5gQ.js +5347 -0
- package/dist/Dialog-GTfGtduh.js +6294 -0
- package/dist/HealthIndicator--ScSxVRA.js +1216 -0
- package/dist/HealthIndicator-BraAh2Aj.js +1217 -0
- package/dist/Icon-BYmOM482.js +2537 -0
- package/dist/Icon-c2SPT3-6.js +2577 -0
- package/dist/PreviewCanvas-C1-rP9-B.js +533 -0
- package/dist/PreviewCanvas-Nro7tNCn.js +533 -0
- package/dist/RichTextEditor-CrYhiAOo.js +12217 -0
- package/dist/RichTextEditor-D7Itx0fL.js +12218 -0
- package/dist/RowPreviewChildren-B66HbFdX.js +4 -0
- package/dist/RowPreviewChildren-DvrE9HTT.js +4 -0
- package/dist/RowPreviewLegacyComponent-3QuwvWmT.js +402 -0
- package/dist/RowPreviewLegacyComponent-CPqaWwsE.js +402 -0
- package/dist/RowPreviewRow-B91YPfoz.js +80 -0
- package/dist/RowPreviewRow-MaA-9ApX.js +80 -0
- package/dist/SavedRowsPanel-CF-7R3q_.js +492 -0
- package/dist/SavedRowsPanel-TLOEvs3Z.js +491 -0
- package/dist/_plugin-vue_export-helper-Dj7HTbfw.js +8 -0
- package/dist/babel-DV7WPQI0.js +10043 -0
- package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +3 -3
- package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +4 -4
- package/dist/editor.css +2 -1
- package/dist/element-CeRQDEn3.js +21396 -0
- package/dist/element.js +2 -2
- package/dist/estree-DY9POgc0.js +8195 -0
- package/dist/html-wb0gSX1o.js +7273 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +14886 -14
- package/dist/init.js +83 -94
- package/dist/mergeTagDefinitions-Cler19nv.js +27 -0
- package/dist/standalone-DHvJ30Td.js +3554 -0
- package/dist/useEmailBuilder-CjJoxzTi.js +4893 -0
- package/dist/useEmailBuilder-gOc8otd8.js +4893 -0
- package/dist/useToast-DeNMwkP3.js +194 -0
- package/dist/vue.runtime.esm-bundler-D2AjRP90.js +6117 -0
- package/package.json +3 -1
- package/dist/DatePicker-6dMK-shv.js +0 -5639
- package/dist/DatePicker-CEm1DPgG.js +0 -5640
- package/dist/HealthIndicator-Ch5Ck0BL.js +0 -1954
- package/dist/HealthIndicator-Dr5vMr1T.js +0 -1953
- package/dist/PreviewCanvas-CG52GC5m.js +0 -667
- package/dist/PreviewCanvas-CjOrVIGt.js +0 -668
- package/dist/RichTextEditor-DaaHuVox.js +0 -13487
- package/dist/RichTextEditor-DoWpYF0R.js +0 -13432
- package/dist/RowPreviewChildren-DQoyExvw.js +0 -4
- package/dist/RowPreviewChildren-yl3aB7hb.js +0 -4
- package/dist/RowPreviewLegacyComponent-CHxbwy9l.js +0 -454
- package/dist/RowPreviewLegacyComponent-Dv7OCys4.js +0 -454
- package/dist/RowPreviewRow-Bizr4PTf.js +0 -86
- package/dist/RowPreviewRow-CLhz0YQ5.js +0 -86
- package/dist/SavedRowsPanel-C0DkAzHi.js +0 -611
- package/dist/SavedRowsPanel-Cp3gADrK.js +0 -610
- package/dist/babel-Bmz1GpKj.js +0 -7218
- package/dist/element-CRfWpZos.js +0 -40842
- package/dist/estree-C5xyFN_T.js +0 -4831
- package/dist/html-Dc_r73Xn.js +0 -3062
- package/dist/index-BlYp4vAp.js +0 -34092
- package/dist/standalone-Yv8gSIWN.js +0 -2336
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
import { H as le, L as r, S as de, T as G, V as se, Z as y, _ as L, c as h, f as w, g, gt as ce, h as s, mt as R, v as z, vt as l, x as ue, y as o, yt as M, z as C } from "./vue.runtime.esm-bundler-D2AjRP90.js";
|
|
2
|
+
import { n as E, x as O } from "./useEmailBuilder-gOc8otd8.js";
|
|
3
|
+
var pe = ["innerHTML"], ge = ["innerHTML"], ve = ["src", "alt"], fe = ["src", "alt"], me = {
|
|
4
|
+
style: {
|
|
5
|
+
width: "28px",
|
|
6
|
+
height: "28px",
|
|
7
|
+
color: "#94a3b8"
|
|
8
|
+
},
|
|
9
|
+
fill: "currentColor",
|
|
10
|
+
viewBox: "0 0 20 20"
|
|
11
|
+
}, be = ["src", "alt"], xe = ["src", "alt"], ye = ["src", "alt"], he = 5, ke = /* @__PURE__ */ G({
|
|
12
|
+
__name: "PreviewComponent",
|
|
13
|
+
props: {
|
|
14
|
+
component: {},
|
|
15
|
+
forceMobile: { type: Boolean },
|
|
16
|
+
depth: {}
|
|
17
|
+
},
|
|
18
|
+
setup($) {
|
|
19
|
+
const c = $, f = s(() => c.component.componentType ?? c.component.type), { visibilityPreviewContext: I } = E(), { evaluateVisibility: F } = O(), m = s(() => {
|
|
20
|
+
const e = f.value, i = e === "row" || e === "row-spacer" ? c.component.visibility : c.component.props?.visibility;
|
|
21
|
+
return F(i, I.value);
|
|
22
|
+
}), n = s(() => {
|
|
23
|
+
const e = c.component.props ?? {};
|
|
24
|
+
if (!c.forceMobile || !e.mobile) return e;
|
|
25
|
+
const i = { ...e };
|
|
26
|
+
for (const [u, a] of Object.entries(e.mobile)) a != null && (i[u] = a);
|
|
27
|
+
return i;
|
|
28
|
+
});
|
|
29
|
+
function p(e, i = "0") {
|
|
30
|
+
return e ? `${e.top ?? 0}px ${e.right ?? 0}px ${e.bottom ?? 0}px ${e.left ?? 0}px` : i;
|
|
31
|
+
}
|
|
32
|
+
function A(e) {
|
|
33
|
+
return e == null ? "" : String(e);
|
|
34
|
+
}
|
|
35
|
+
function k(e) {
|
|
36
|
+
const i = e?.backgroundGradient;
|
|
37
|
+
if (i?.useGradient === !0 && Array.isArray(i?.gradient?.colors) && i.gradient.colors.length >= 2) {
|
|
38
|
+
const { type: u, direction: a, colors: v } = i.gradient, _ = v.map((W) => `${W.color} ${W.position}%`).join(", ");
|
|
39
|
+
return u === "radial" ? `radial-gradient(circle at center, ${_})` : `linear-gradient(${a}, ${_})`;
|
|
40
|
+
}
|
|
41
|
+
return e?.backgroundColor ?? "transparent";
|
|
42
|
+
}
|
|
43
|
+
const B = s(() => {
|
|
44
|
+
const e = c.component, i = {
|
|
45
|
+
display: "flex",
|
|
46
|
+
flexDirection: c.forceMobile && e.mobileStack === !0 ? "column" : "row",
|
|
47
|
+
background: k(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
|
+
width: "100%",
|
|
52
|
+
minWidth: "0",
|
|
53
|
+
boxSizing: "border-box"
|
|
54
|
+
};
|
|
55
|
+
return e.border && (i.border = `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}`, i.borderRadius = `${e.border.radius ?? 0}px`), (e.gap ?? 0) > 0 && (i.gap = `${e.gap}px`), e.backgroundImage && (i.backgroundImage = `url(${e.backgroundImage})`, i.backgroundSize = e.backgroundSize ?? "cover", i.backgroundPosition = e.backgroundPosition ?? "center center", i.backgroundRepeat = e.backgroundRepeat ?? "no-repeat"), i;
|
|
56
|
+
}), T = {
|
|
57
|
+
top: "flex-start",
|
|
58
|
+
middle: "center",
|
|
59
|
+
bottom: "flex-end"
|
|
60
|
+
};
|
|
61
|
+
function D(e) {
|
|
62
|
+
const i = c.component, u = c.forceMobile && i.mobileStack === !0, a = e.border?.radius ?? 0, v = {
|
|
63
|
+
width: u ? "100%" : `${e.width ?? 100}%`,
|
|
64
|
+
boxSizing: "border-box",
|
|
65
|
+
display: "flex",
|
|
66
|
+
flexDirection: "column",
|
|
67
|
+
justifyContent: T[e.verticalAlign] || "flex-start",
|
|
68
|
+
padding: e.padding ? `${e.padding.top}px ${e.padding.right}px ${e.padding.bottom}px ${e.padding.left}px` : "10px",
|
|
69
|
+
background: k(e),
|
|
70
|
+
minWidth: "0"
|
|
71
|
+
};
|
|
72
|
+
return a > 0 && (v.overflow = "hidden"), e.border && (v.border = `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}`, v.borderRadius = `${a}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;
|
|
73
|
+
}
|
|
74
|
+
const t = s(() => ({
|
|
75
|
+
width: "100%",
|
|
76
|
+
height: (c.component.height ?? 20) + "px",
|
|
77
|
+
background: k(c.component)
|
|
78
|
+
})), d = s(() => {
|
|
79
|
+
const e = n.value;
|
|
80
|
+
return {
|
|
81
|
+
margin: p(e.margin),
|
|
82
|
+
padding: p(e.padding),
|
|
83
|
+
fontSize: (e.fontSize ?? 32) + "px",
|
|
84
|
+
lineHeight: String(e.lineHeight ?? 1.2),
|
|
85
|
+
letterSpacing: (e.letterSpacing ?? 0) + "px",
|
|
86
|
+
color: e.color ?? "#111111",
|
|
87
|
+
fontWeight: e.fontWeight ?? "bold",
|
|
88
|
+
fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
|
|
89
|
+
background: k(e),
|
|
90
|
+
textTransform: e.textTransform ?? "none",
|
|
91
|
+
textDecoration: e.textDecoration ?? "none",
|
|
92
|
+
textAlign: e.align ?? "left",
|
|
93
|
+
overflowWrap: "break-word",
|
|
94
|
+
wordBreak: "break-word"
|
|
95
|
+
};
|
|
96
|
+
}), b = s(() => {
|
|
97
|
+
const e = n.value;
|
|
98
|
+
return {
|
|
99
|
+
margin: p(e.margin),
|
|
100
|
+
padding: p(e.padding),
|
|
101
|
+
fontSize: (e.fontSize ?? 16) + "px",
|
|
102
|
+
lineHeight: String(e.lineHeight ?? 1.5),
|
|
103
|
+
letterSpacing: (e.letterSpacing ?? 0) + "px",
|
|
104
|
+
color: e.color ?? "#111111",
|
|
105
|
+
fontWeight: e.fontWeight ?? "normal",
|
|
106
|
+
fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
|
|
107
|
+
fontStyle: e.fontStyle ?? "normal",
|
|
108
|
+
background: k(e),
|
|
109
|
+
textTransform: e.textTransform ?? "none",
|
|
110
|
+
textDecoration: e.textDecoration ?? "none",
|
|
111
|
+
textAlign: e.align ?? "left",
|
|
112
|
+
overflowWrap: "break-word",
|
|
113
|
+
wordBreak: "break-word"
|
|
114
|
+
};
|
|
115
|
+
}), S = s(() => {
|
|
116
|
+
const e = n.value;
|
|
117
|
+
return {
|
|
118
|
+
margin: p(e.margin),
|
|
119
|
+
padding: p(e.padding, "0 0 0 20px"),
|
|
120
|
+
fontSize: (e.fontSize ?? 16) + "px",
|
|
121
|
+
lineHeight: String(e.lineHeight ?? 1.5),
|
|
122
|
+
letterSpacing: (e.letterSpacing ?? 0) + "px",
|
|
123
|
+
fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
|
|
124
|
+
color: e.color ?? "#111111",
|
|
125
|
+
background: k(e),
|
|
126
|
+
overflowWrap: "break-word",
|
|
127
|
+
wordBreak: "break-word"
|
|
128
|
+
};
|
|
129
|
+
}), x = s(() => {
|
|
130
|
+
const e = n.value;
|
|
131
|
+
return {
|
|
132
|
+
margin: p(e.margin),
|
|
133
|
+
padding: p(e.padding),
|
|
134
|
+
textAlign: e.align ?? "center"
|
|
135
|
+
};
|
|
136
|
+
}), P = s(() => {
|
|
137
|
+
const e = n.value;
|
|
138
|
+
return {
|
|
139
|
+
width: typeof e.width == "number" ? e.width + "%" : "100%",
|
|
140
|
+
height: "auto",
|
|
141
|
+
maxWidth: "100%",
|
|
142
|
+
borderRadius: (e.borderRadius ?? 0) + "px",
|
|
143
|
+
border: e.border ? `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}` : "none",
|
|
144
|
+
display: "inline-block"
|
|
145
|
+
};
|
|
146
|
+
}), H = s(() => ({
|
|
147
|
+
width: "100%",
|
|
148
|
+
height: "100px",
|
|
149
|
+
background: "#e2e8f0",
|
|
150
|
+
borderRadius: "4px"
|
|
151
|
+
})), X = s(() => {
|
|
152
|
+
const e = n.value;
|
|
153
|
+
return {
|
|
154
|
+
margin: p(e.margin),
|
|
155
|
+
padding: p(e.padding),
|
|
156
|
+
textAlign: e.align ?? "center"
|
|
157
|
+
};
|
|
158
|
+
}), Z = s(() => {
|
|
159
|
+
const e = n.value;
|
|
160
|
+
return {
|
|
161
|
+
position: "relative",
|
|
162
|
+
display: "inline-block",
|
|
163
|
+
width: typeof e.width == "number" ? e.width + "%" : "100%",
|
|
164
|
+
paddingTop: "56.25%",
|
|
165
|
+
overflow: "hidden",
|
|
166
|
+
borderRadius: (e.borderRadius ?? 0) + "px"
|
|
167
|
+
};
|
|
168
|
+
}), q = s(() => ({
|
|
169
|
+
position: "absolute",
|
|
170
|
+
top: "0",
|
|
171
|
+
left: "0",
|
|
172
|
+
width: "100%",
|
|
173
|
+
height: "100%",
|
|
174
|
+
objectFit: "cover"
|
|
175
|
+
})), J = s(() => ({
|
|
176
|
+
position: "absolute",
|
|
177
|
+
top: "0",
|
|
178
|
+
left: "0",
|
|
179
|
+
width: "100%",
|
|
180
|
+
height: "100%",
|
|
181
|
+
background: "#e2e8f0",
|
|
182
|
+
display: "flex",
|
|
183
|
+
alignItems: "center",
|
|
184
|
+
justifyContent: "center"
|
|
185
|
+
})), K = s(() => {
|
|
186
|
+
const e = n.value;
|
|
187
|
+
return {
|
|
188
|
+
margin: p(e.margin),
|
|
189
|
+
textAlign: e.align ?? "center"
|
|
190
|
+
};
|
|
191
|
+
}), Q = s(() => {
|
|
192
|
+
const e = n.value, i = !!e.icon;
|
|
193
|
+
return {
|
|
194
|
+
background: k(e),
|
|
195
|
+
color: e.color ?? "#ffffff",
|
|
196
|
+
fontSize: (e.fontSize ?? 16) + "px",
|
|
197
|
+
fontWeight: e.fontWeight ?? "600",
|
|
198
|
+
fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
|
|
199
|
+
letterSpacing: (e.letterSpacing ?? 0) + "px",
|
|
200
|
+
padding: p(e.padding, "12px 24px"),
|
|
201
|
+
borderRadius: (e.borderRadius ?? 4) + "px",
|
|
202
|
+
border: e.border ? `${e.border.width ?? 0}px ${e.border.style ?? "solid"} ${e.border.color ?? "transparent"}` : "none",
|
|
203
|
+
display: i ? "inline-flex" : "inline-block",
|
|
204
|
+
alignItems: i ? "center" : void 0,
|
|
205
|
+
verticalAlign: i ? "middle" : void 0,
|
|
206
|
+
lineHeight: "1.2",
|
|
207
|
+
textDecoration: "none",
|
|
208
|
+
textTransform: e.textTransform ?? "none",
|
|
209
|
+
whiteSpace: "nowrap"
|
|
210
|
+
};
|
|
211
|
+
}), V = s(() => {
|
|
212
|
+
const e = n.value, i = Math.max(4, e.iconSize ?? 20), u = e.iconGap ?? 8, a = e.iconPosition !== "after";
|
|
213
|
+
return {
|
|
214
|
+
display: "block",
|
|
215
|
+
width: i + "px",
|
|
216
|
+
height: i + "px",
|
|
217
|
+
flexShrink: "0",
|
|
218
|
+
marginRight: a ? u + "px" : "0",
|
|
219
|
+
marginLeft: a ? "0" : u + "px"
|
|
220
|
+
};
|
|
221
|
+
}), U = s(() => {
|
|
222
|
+
const e = n.value;
|
|
223
|
+
return {
|
|
224
|
+
margin: p(e.margin),
|
|
225
|
+
padding: p(e.padding),
|
|
226
|
+
textAlign: e.align ?? "left"
|
|
227
|
+
};
|
|
228
|
+
}), Y = s(() => {
|
|
229
|
+
const e = n.value;
|
|
230
|
+
return {
|
|
231
|
+
color: e.color ?? "#007bff",
|
|
232
|
+
fontSize: (e.fontSize ?? 16) + "px",
|
|
233
|
+
fontWeight: e.fontWeight ?? "normal",
|
|
234
|
+
fontFamily: e.fontFamily ? `'${e.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
|
|
235
|
+
letterSpacing: (e.letterSpacing ?? 0) + "px",
|
|
236
|
+
textDecoration: e.textDecoration ?? "underline",
|
|
237
|
+
overflowWrap: "break-word",
|
|
238
|
+
wordBreak: "break-word"
|
|
239
|
+
};
|
|
240
|
+
}), ee = s(() => {
|
|
241
|
+
const e = n.value;
|
|
242
|
+
return {
|
|
243
|
+
margin: p(e.margin),
|
|
244
|
+
padding: p(e.padding),
|
|
245
|
+
textAlign: e.align ?? "center"
|
|
246
|
+
};
|
|
247
|
+
}), te = s(() => {
|
|
248
|
+
const e = n.value, i = e.align ?? "center";
|
|
249
|
+
return {
|
|
250
|
+
width: (e.width ?? 100) + "%",
|
|
251
|
+
height: (e.height ?? 1) + "px",
|
|
252
|
+
background: k(e),
|
|
253
|
+
border: "none",
|
|
254
|
+
display: "block",
|
|
255
|
+
margin: i === "center" ? "0 auto" : i === "right" ? "0 0 0 auto" : "0"
|
|
256
|
+
};
|
|
257
|
+
}), ne = s(() => {
|
|
258
|
+
const e = n.value;
|
|
259
|
+
return {
|
|
260
|
+
width: "100%",
|
|
261
|
+
height: (e.height ?? 20) + "px",
|
|
262
|
+
background: k(e)
|
|
263
|
+
};
|
|
264
|
+
}), re = s(() => {
|
|
265
|
+
const e = n.value;
|
|
266
|
+
return {
|
|
267
|
+
display: "flex",
|
|
268
|
+
flexWrap: "wrap",
|
|
269
|
+
gap: (e.spacing ?? 8) + "px",
|
|
270
|
+
justifyContent: e.align === "center" ? "center" : e.align === "right" ? "flex-end" : "flex-start",
|
|
271
|
+
margin: p(e.margin),
|
|
272
|
+
padding: p(e.padding)
|
|
273
|
+
};
|
|
274
|
+
}), ie = {
|
|
275
|
+
display: "inline-flex",
|
|
276
|
+
alignItems: "center",
|
|
277
|
+
justifyContent: "center"
|
|
278
|
+
}, oe = s(() => {
|
|
279
|
+
const e = n.value;
|
|
280
|
+
return {
|
|
281
|
+
margin: p(e.margin),
|
|
282
|
+
padding: p(e.padding),
|
|
283
|
+
textAlign: e.align ?? "left",
|
|
284
|
+
lineHeight: "0",
|
|
285
|
+
background: k(e)
|
|
286
|
+
};
|
|
287
|
+
});
|
|
288
|
+
function ae(e, i) {
|
|
289
|
+
const u = n.value, a = u.mobileStack === !0 && c.forceMobile, v = u.spacing ?? 8, _ = Math.ceil((v ?? 0) / 2), W = e === 0, N = e === i - 1;
|
|
290
|
+
return {
|
|
291
|
+
display: a ? "block" : "inline-block",
|
|
292
|
+
marginLeft: a || W ? "0px" : _ + "px",
|
|
293
|
+
marginRight: a || N ? "0px" : _ + "px",
|
|
294
|
+
marginBottom: a && !N ? v + "px" : "0px",
|
|
295
|
+
fontSize: Math.max(6, u.fontSize ?? 14) + "px",
|
|
296
|
+
lineHeight: String(u.lineHeight ?? 1.4),
|
|
297
|
+
letterSpacing: (u.letterSpacing ?? 0) + "px",
|
|
298
|
+
color: u.color ?? "#111111",
|
|
299
|
+
fontWeight: u.fontWeight ?? "normal",
|
|
300
|
+
fontFamily: u.fontFamily ? `'${u.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
|
|
301
|
+
fontStyle: u.fontStyle ?? "normal",
|
|
302
|
+
textTransform: u.textTransform ?? "none",
|
|
303
|
+
textDecoration: u.textDecoration ?? "none",
|
|
304
|
+
whiteSpace: a ? "normal" : "nowrap"
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
const j = s(() => c.depth ?? 0);
|
|
308
|
+
return (e, i) => {
|
|
309
|
+
const u = se("PreviewComponent", !0);
|
|
310
|
+
return f.value === "row" && j.value < he ? y((r(), o("div", {
|
|
311
|
+
key: 0,
|
|
312
|
+
style: l(B.value)
|
|
313
|
+
}, [(r(!0), o(w, null, C($.component.columns || [], (a) => (r(), o("div", {
|
|
314
|
+
key: a.id,
|
|
315
|
+
style: l(D(a))
|
|
316
|
+
}, [(r(!0), o(w, null, C(a.children ?? a.components ?? [], (v) => (r(), L(u, {
|
|
317
|
+
key: v.id,
|
|
318
|
+
component: v,
|
|
319
|
+
"force-mobile": $.forceMobile,
|
|
320
|
+
depth: j.value + 1
|
|
321
|
+
}, null, 8, [
|
|
322
|
+
"component",
|
|
323
|
+
"force-mobile",
|
|
324
|
+
"depth"
|
|
325
|
+
]))), 128))], 4))), 128))], 4)), [[h, m.value]]) : f.value === "row-spacer" ? y((r(), o("div", {
|
|
326
|
+
key: 1,
|
|
327
|
+
style: l(t.value)
|
|
328
|
+
}, null, 4)), [[h, m.value]]) : f.value === "heading" ? y((r(), L(le(n.value?.level || "h2"), {
|
|
329
|
+
key: 2,
|
|
330
|
+
style: l(d.value),
|
|
331
|
+
innerHTML: A(n.value?.content)
|
|
332
|
+
}, null, 8, ["style", "innerHTML"])), [[h, m.value]]) : f.value === "paragraph" ? y((r(), o("p", {
|
|
333
|
+
key: 3,
|
|
334
|
+
style: l(b.value),
|
|
335
|
+
innerHTML: A(n.value?.content)
|
|
336
|
+
}, null, 12, pe)), [[h, m.value]]) : f.value === "list" ? y((r(), o("div", {
|
|
337
|
+
key: 4,
|
|
338
|
+
style: l(S.value),
|
|
339
|
+
innerHTML: A(n.value?.content)
|
|
340
|
+
}, null, 12, ge)), [[h, m.value]]) : f.value === "image" ? y((r(), o("div", {
|
|
341
|
+
key: 5,
|
|
342
|
+
style: l(x.value)
|
|
343
|
+
}, [n.value?.src ? (r(), o("img", {
|
|
344
|
+
key: 0,
|
|
345
|
+
src: n.value.src,
|
|
346
|
+
alt: n.value?.alt || "",
|
|
347
|
+
style: l(P.value)
|
|
348
|
+
}, null, 12, ve)) : (r(), o("div", {
|
|
349
|
+
key: 1,
|
|
350
|
+
style: l(H.value)
|
|
351
|
+
}, null, 4))], 4)), [[h, m.value]]) : f.value === "video" ? y((r(), o("div", {
|
|
352
|
+
key: 6,
|
|
353
|
+
style: l(X.value)
|
|
354
|
+
}, [g("div", { style: l(Z.value) }, [n.value?.coverImage ? (r(), o("img", {
|
|
355
|
+
key: 0,
|
|
356
|
+
src: n.value.coverImage,
|
|
357
|
+
alt: n.value?.alt || "Video",
|
|
358
|
+
style: l(q.value)
|
|
359
|
+
}, null, 12, fe)) : (r(), o("div", {
|
|
360
|
+
key: 1,
|
|
361
|
+
style: l(J.value)
|
|
362
|
+
}, [(r(), o("svg", me, [...i[0] || (i[0] = [g("path", {
|
|
363
|
+
"fill-rule": "evenodd",
|
|
364
|
+
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",
|
|
365
|
+
"clip-rule": "evenodd"
|
|
366
|
+
}, null, -1)])]))], 4))], 4)], 4)), [[h, m.value]]) : f.value === "button" ? y((r(), o("div", {
|
|
367
|
+
key: 7,
|
|
368
|
+
style: l(K.value)
|
|
369
|
+
}, [g("span", { style: l(Q.value) }, [
|
|
370
|
+
n.value?.icon && n.value?.iconPosition !== "after" ? (r(), o("img", {
|
|
371
|
+
key: 0,
|
|
372
|
+
src: n.value.icon,
|
|
373
|
+
alt: n.value?.iconAlt || "",
|
|
374
|
+
style: l(V.value)
|
|
375
|
+
}, null, 12, be)) : z("", !0),
|
|
376
|
+
de(" " + M(n.value?.text || "Button") + " ", 1),
|
|
377
|
+
n.value?.icon && n.value?.iconPosition === "after" ? (r(), o("img", {
|
|
378
|
+
key: 1,
|
|
379
|
+
src: n.value.icon,
|
|
380
|
+
alt: n.value?.iconAlt || "",
|
|
381
|
+
style: l(V.value)
|
|
382
|
+
}, null, 12, xe)) : z("", !0)
|
|
383
|
+
], 4)], 4)), [[h, m.value]]) : f.value === "anchor" ? y((r(), o("div", {
|
|
384
|
+
key: 8,
|
|
385
|
+
style: l(U.value)
|
|
386
|
+
}, [g("span", { style: l(Y.value) }, M(n.value?.text || "Link"), 5)], 4)), [[h, m.value]]) : f.value === "divider" ? y((r(), o("div", {
|
|
387
|
+
key: 9,
|
|
388
|
+
style: l(ee.value)
|
|
389
|
+
}, [g("hr", { style: l(te.value) }, null, 4)], 4)), [[h, m.value]]) : f.value === "spacer" ? y((r(), o("div", {
|
|
390
|
+
key: 10,
|
|
391
|
+
style: l(ne.value)
|
|
392
|
+
}, null, 4)), [[h, m.value]]) : f.value === "socials" ? y((r(), o("div", {
|
|
393
|
+
key: 11,
|
|
394
|
+
style: l(re.value)
|
|
395
|
+
}, [n.value?.platforms?.some((a) => a.enabled && a.link) ? (r(!0), o(w, { key: 0 }, C(n.value.platforms.filter((a) => a.enabled && a.link), (a) => (r(), o("span", {
|
|
396
|
+
key: a.name,
|
|
397
|
+
style: ie
|
|
398
|
+
}, [g("img", {
|
|
399
|
+
src: a.icon,
|
|
400
|
+
alt: a.name,
|
|
401
|
+
style: l({
|
|
402
|
+
width: (n.value?.iconSize || 24) + "px",
|
|
403
|
+
height: (n.value?.iconSize || 24) + "px",
|
|
404
|
+
display: "block"
|
|
405
|
+
})
|
|
406
|
+
}, null, 12, ye)]))), 128)) : z("", !0)], 4)), [[h, m.value]]) : f.value === "menu" ? y((r(), o("div", {
|
|
407
|
+
key: 12,
|
|
408
|
+
style: l(oe.value)
|
|
409
|
+
}, [(r(!0), o(w, null, C(n.value?.items || [], (a, v) => (r(), o("span", {
|
|
410
|
+
key: v,
|
|
411
|
+
style: l(ae(Number(v), (n.value?.items || []).length))
|
|
412
|
+
}, M(a.label || ""), 5))), 128))], 4)), [[h, m.value]]) : z("", !0);
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
}), Se = ke, $e = { class: "flex flex-col h-full bg-(--md-surface) rounded-xl border border-(--md-border) overflow-hidden" }, we = { class: "flex items-center gap-3 px-3 py-2.5 border-b border-(--md-border) bg-(--md-surface-hover)/70 shrink-0" }, Ae = { 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)" }, Ce = { class: "ml-auto text-[10.5px] text-(--md-text-subtle) font-mono shrink-0" }, _e = { class: "p-6" }, ze = {
|
|
416
|
+
key: 0,
|
|
417
|
+
class: "flex flex-col items-center justify-center h-[60vh] text-center gap-3"
|
|
418
|
+
}, Me = /* @__PURE__ */ G({
|
|
419
|
+
__name: "PreviewCanvas",
|
|
420
|
+
props: {
|
|
421
|
+
rows: {},
|
|
422
|
+
canvas: {},
|
|
423
|
+
forceMobile: { type: Boolean }
|
|
424
|
+
},
|
|
425
|
+
setup($) {
|
|
426
|
+
const c = $, { visibilityPreviewContext: f } = E(), { evaluateVisibility: I } = O(), F = s(() => c.canvas?.bodyBackgroundColor ?? "#f9fafb"), m = s(() => (c.rows ?? []).length > 0), n = s(() => {
|
|
427
|
+
const t = c.canvas?.width ?? 600;
|
|
428
|
+
if (!c.forceMobile) return t;
|
|
429
|
+
const d = c.canvas?.mobileBreakpoint ?? 600;
|
|
430
|
+
return d === 600 ? 360 : d;
|
|
431
|
+
}), p = s(() => {
|
|
432
|
+
const t = c.canvas?.padding;
|
|
433
|
+
return t ? `${t.top ?? 0}px ${t.right ?? 0}px ${t.bottom ?? 0}px ${t.left ?? 0}px` : "0";
|
|
434
|
+
});
|
|
435
|
+
function A(t) {
|
|
436
|
+
const d = t?.backgroundGradient;
|
|
437
|
+
if (d?.useGradient === !0 && Array.isArray(d?.gradient?.colors) && d.gradient.colors.length >= 2) {
|
|
438
|
+
const { type: b, direction: S, colors: x } = d.gradient, P = x.map((H) => `${H.color} ${H.position}%`).join(", ");
|
|
439
|
+
return b === "radial" ? `radial-gradient(circle at center, ${P})` : `linear-gradient(${S}, ${P})`;
|
|
440
|
+
}
|
|
441
|
+
return t?.backgroundColor ?? "transparent";
|
|
442
|
+
}
|
|
443
|
+
function k(t) {
|
|
444
|
+
return {
|
|
445
|
+
width: "100%",
|
|
446
|
+
height: (t.height ?? 20) + "px",
|
|
447
|
+
background: A(t)
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
function B(t) {
|
|
451
|
+
const d = {
|
|
452
|
+
display: "flex",
|
|
453
|
+
flexDirection: c.forceMobile && t.mobileStack === !0 ? "column" : "row",
|
|
454
|
+
background: A(t),
|
|
455
|
+
padding: t.padding ? `${t.padding.top}px ${t.padding.right}px ${t.padding.bottom}px ${t.padding.left}px` : "0",
|
|
456
|
+
minHeight: t.minHeight ? `${t.minHeight}px` : "auto",
|
|
457
|
+
alignItems: "stretch",
|
|
458
|
+
width: "100%",
|
|
459
|
+
boxSizing: "border-box"
|
|
460
|
+
};
|
|
461
|
+
return t.border && (d.border = `${t.border.width ?? 0}px ${t.border.style ?? "solid"} ${t.border.color ?? "transparent"}`, d.borderRadius = `${t.border.radius ?? 0}px`), (t.gap ?? 0) > 0 && (d.gap = `${t.gap}px`), t.backgroundImage && (d.backgroundImage = `url(${t.backgroundImage})`, d.backgroundSize = t.backgroundSize ?? "cover", d.backgroundPosition = t.backgroundPosition ?? "center center", d.backgroundRepeat = t.backgroundRepeat ?? "no-repeat"), d;
|
|
462
|
+
}
|
|
463
|
+
const T = {
|
|
464
|
+
top: "flex-start",
|
|
465
|
+
middle: "center",
|
|
466
|
+
bottom: "flex-end"
|
|
467
|
+
};
|
|
468
|
+
function D(t, d) {
|
|
469
|
+
const b = c.forceMobile && d.mobileStack === !0, S = t.border?.radius ?? 0, x = {
|
|
470
|
+
width: b ? "100%" : `${t.width ?? 100}%`,
|
|
471
|
+
boxSizing: "border-box",
|
|
472
|
+
display: "flex",
|
|
473
|
+
flexDirection: "column",
|
|
474
|
+
justifyContent: T[t.verticalAlign] || "flex-start",
|
|
475
|
+
padding: t.padding ? `${t.padding.top ?? 0}px ${t.padding.right ?? 0}px ${t.padding.bottom ?? 0}px ${t.padding.left ?? 0}px` : "10px",
|
|
476
|
+
background: A(t),
|
|
477
|
+
minWidth: "0"
|
|
478
|
+
};
|
|
479
|
+
return S > 0 && (x.overflow = "hidden"), t.border && (x.border = `${t.border.width ?? 0}px ${t.border.style ?? "solid"} ${t.border.color ?? "transparent"}`, x.borderRadius = `${S}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;
|
|
480
|
+
}
|
|
481
|
+
return (t, d) => (r(), o("div", $e, [g("div", we, [
|
|
482
|
+
d[3] || (d[3] = g("div", { class: "flex items-center gap-1.5 shrink-0" }, [
|
|
483
|
+
g("span", {
|
|
484
|
+
class: "w-2.5 h-2.5 rounded-full bg-[#ff5f57]",
|
|
485
|
+
"aria-hidden": "true"
|
|
486
|
+
}),
|
|
487
|
+
g("span", {
|
|
488
|
+
class: "w-2.5 h-2.5 rounded-full bg-[#febc2e]",
|
|
489
|
+
"aria-hidden": "true"
|
|
490
|
+
}),
|
|
491
|
+
g("span", {
|
|
492
|
+
class: "w-2.5 h-2.5 rounded-full bg-[#28c840]",
|
|
493
|
+
"aria-hidden": "true"
|
|
494
|
+
})
|
|
495
|
+
], -1)),
|
|
496
|
+
g("div", Ae, [
|
|
497
|
+
d[0] || (d[0] = g("span", { class: "w-1.5 h-1.5 rounded-full bg-(--md-success) shrink-0" }, null, -1)),
|
|
498
|
+
d[1] || (d[1] = g("span", { class: "text-[12px] font-medium text-(--md-text) truncate" }, " Source ", -1)),
|
|
499
|
+
d[2] || (d[2] = g("span", { class: "text-[10.5px] text-(--md-text-subtle) truncate" }, " · Live canvas data ", -1)),
|
|
500
|
+
g("span", Ce, M(n.value) + "px ", 1)
|
|
501
|
+
]),
|
|
502
|
+
g("span", { class: ce(["inline-flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider px-1.5 py-1 rounded shrink-0", $.forceMobile ? "bg-(--md-warning-bg) text-(--md-warning-fg)" : "bg-(--md-success-bg) text-(--md-success-fg)"]) }, M($.forceMobile ? "Mobile" : "Desktop"), 3)
|
|
503
|
+
]), g("div", {
|
|
504
|
+
class: "flex-1 overflow-y-auto overflow-x-hidden",
|
|
505
|
+
style: l({ backgroundColor: F.value })
|
|
506
|
+
}, [g("div", _e, [m.value ? (r(), o("div", {
|
|
507
|
+
key: 1,
|
|
508
|
+
class: "mx-auto shadow-sm rounded-md overflow-hidden",
|
|
509
|
+
style: l({
|
|
510
|
+
width: n.value + "px",
|
|
511
|
+
maxWidth: "100%",
|
|
512
|
+
backgroundColor: $.canvas?.backgroundColor ?? "#ffffff"
|
|
513
|
+
})
|
|
514
|
+
}, [g("div", { style: l({ padding: p.value }) }, [(r(!0), o(w, null, C($.rows, (b) => (r(), o(w, { key: b.id }, [b.type === "row-spacer" ? y((r(), o("div", {
|
|
515
|
+
key: 0,
|
|
516
|
+
style: l(k(b))
|
|
517
|
+
}, null, 4)), [[h, R(I)(b.visibility, R(f))]]) : b.type === "row" ? y((r(), o("div", {
|
|
518
|
+
key: 1,
|
|
519
|
+
style: l(B(b))
|
|
520
|
+
}, [(r(!0), o(w, null, C(b.columns || [], (S) => (r(), o("div", {
|
|
521
|
+
key: S.id,
|
|
522
|
+
style: l(D(S, b))
|
|
523
|
+
}, [(r(!0), o(w, null, C(S.children ?? S.components ?? [], (x) => (r(), L(Se, {
|
|
524
|
+
key: x.id,
|
|
525
|
+
component: x,
|
|
526
|
+
"force-mobile": $.forceMobile,
|
|
527
|
+
depth: 1
|
|
528
|
+
}, null, 8, ["component", "force-mobile"]))), 128))], 4))), 128))], 4)), [[h, R(I)(b.visibility, R(f))]]) : z("", !0)], 64))), 128))], 4)], 4)) : (r(), o("div", ze, [...d[4] || (d[4] = [ue('<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)])]))])], 4)]));
|
|
529
|
+
}
|
|
530
|
+
}), He = Me;
|
|
531
|
+
export {
|
|
532
|
+
He as default
|
|
533
|
+
};
|