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