@maildeno/editor 0.4.2 → 0.4.3

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.
@@ -0,0 +1,439 @@
1
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeStyle, openBlock, renderList, resolveDynamicComponent, toDisplayString } from "vue";
2
+ //#region src/components/features/emailBuilder/product/RowPreviewLegacyComponent.vue?vue&type=script&setup=true&lang.ts
3
+ var _hoisted_1 = ["innerHTML"];
4
+ var _hoisted_2 = ["src", "alt"];
5
+ var _hoisted_3 = ["src", "alt"];
6
+ var _hoisted_4 = {
7
+ style: {
8
+ "width": "30%",
9
+ "height": "30%",
10
+ "color": "#9ca3af"
11
+ },
12
+ fill: "currentColor",
13
+ viewBox: "0 0 20 20"
14
+ };
15
+ var _hoisted_5 = ["src", "alt"];
16
+ var _hoisted_6 = ["src", "alt"];
17
+ var _hoisted_7 = ["innerHTML"];
18
+ var _hoisted_8 = { key: 8 };
19
+ var _hoisted_9 = { key: 0 };
20
+ var _hoisted_10 = ["src", "alt"];
21
+ var _hoisted_11 = {
22
+ key: 1,
23
+ style: {
24
+ "font-size": "7px",
25
+ "color": "#9ca3af",
26
+ "font-style": "italic"
27
+ }
28
+ };
29
+ var _hoisted_12 = {
30
+ key: 11,
31
+ class: "rounded truncate",
32
+ style: {
33
+ "font-size": "7px",
34
+ "color": "#9ca3af",
35
+ "background": "#f3f4f6",
36
+ "padding": "1px 3px"
37
+ }
38
+ };
39
+ //#endregion
40
+ //#region src/components/features/emailBuilder/product/RowPreviewLegacyComponent.vue
41
+ var RowPreviewLegacyComponent_default = /* @__PURE__ */ defineComponent({
42
+ __name: "RowPreviewLegacyComponent",
43
+ props: {
44
+ comp: {},
45
+ scale: {}
46
+ },
47
+ setup(__props) {
48
+ const props = __props;
49
+ const compType = computed(() => props.comp.componentType ?? props.comp.type);
50
+ function resolvePreviewHtml(html) {
51
+ if (!html) return "";
52
+ return html.replace(/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs, (_, name, fallback) => {
53
+ const tag = name.trim();
54
+ const def = fallback?.trim();
55
+ return def ? `{{ ${tag}|'${def}' }}` : `{{ ${tag} }}`;
56
+ });
57
+ }
58
+ function resolveBackground(item) {
59
+ const bg = item?.backgroundGradient;
60
+ if (bg?.useGradient === true && Array.isArray(bg?.gradient?.colors) && bg.gradient.colors.length >= 2) {
61
+ const { type, direction, colors } = bg.gradient;
62
+ const stops = colors.map((c) => `${c.color} ${c.position}%`).join(", ");
63
+ return type === "radial" ? `radial-gradient(circle at center, ${stops})` : `linear-gradient(${direction}, ${stops})`;
64
+ }
65
+ return item?.backgroundColor || "transparent";
66
+ }
67
+ function loadGoogleFont(fontFamily) {
68
+ if (!fontFamily) return;
69
+ if ((fontFamily.includes(" ") || [
70
+ "Roboto",
71
+ "Open Sans",
72
+ "Lato",
73
+ "Montserrat",
74
+ "Poppins",
75
+ "Nunito",
76
+ "Raleway",
77
+ "Plus Jakarta Sans"
78
+ ].some((f) => fontFamily.includes(f))) && typeof document !== "undefined") {
79
+ const href = `https://fonts.googleapis.com/css2?family=${fontFamily.replace(/ /g, "+")}:wght@300;400;500;600;700;800&display=swap`;
80
+ if (!document.querySelector(`link[href="${href}"]`)) {
81
+ const link = document.createElement("link");
82
+ link.href = href;
83
+ link.rel = "stylesheet";
84
+ document.head.appendChild(link);
85
+ }
86
+ }
87
+ }
88
+ function headingStyle(p) {
89
+ if (p?.fontFamily) loadGoogleFont(p.fontFamily);
90
+ return {
91
+ fontSize: Math.max(7, p?.fontSize || 24) + "px",
92
+ color: p?.color || "#111111",
93
+ fontWeight: p?.fontWeight || "bold",
94
+ fontFamily: p?.fontFamily || "Arial, sans-serif",
95
+ textAlign: p?.align || "left",
96
+ lineHeight: String(p?.lineHeight ?? 1.2),
97
+ letterSpacing: `${p?.letterSpacing ?? 0}px`,
98
+ textTransform: p?.textTransform || "none",
99
+ textDecoration: p?.textDecoration || "none",
100
+ background: resolveBackground(p),
101
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 4}px ${p?.margin?.left ?? 0}px`,
102
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`
103
+ };
104
+ }
105
+ function paragraphStyle(p) {
106
+ if (p?.fontFamily) loadGoogleFont(p.fontFamily);
107
+ return {
108
+ fontSize: Math.max(6, p?.fontSize || 16) + "px",
109
+ color: p?.color || "#111111",
110
+ fontFamily: p?.fontFamily || "Arial, sans-serif",
111
+ fontWeight: p?.fontWeight || "normal",
112
+ fontStyle: p?.fontStyle || "normal",
113
+ textAlign: p?.align || "left",
114
+ lineHeight: String(p?.lineHeight ?? 1.5),
115
+ letterSpacing: `${p?.letterSpacing ?? 0}px`,
116
+ textTransform: p?.textTransform || "none",
117
+ textDecoration: p?.textDecoration || "none",
118
+ background: resolveBackground(p),
119
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 4}px ${p?.margin?.left ?? 0}px`,
120
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`
121
+ };
122
+ }
123
+ function imageContainerStyle(p) {
124
+ return {
125
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 0}px ${p?.margin?.left ?? 0}px`,
126
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`,
127
+ textAlign: p?.align || "left"
128
+ };
129
+ }
130
+ function imageStyle(p) {
131
+ const align = p?.align || "left";
132
+ return {
133
+ width: (p?.width || 100) + "%",
134
+ height: p?.height || "auto",
135
+ borderRadius: (p?.borderRadius || 0) + "px",
136
+ border: `${p?.border?.width || 0}px ${p?.border?.style || "solid"} ${p?.border?.color || "#000000"}`,
137
+ display: "block",
138
+ margin: align === "center" ? "0 auto" : align === "right" ? "0 0 0 auto" : "0"
139
+ };
140
+ }
141
+ function videoContainerStyle(p) {
142
+ return {
143
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 0}px ${p?.margin?.left ?? 0}px`,
144
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`,
145
+ textAlign: p?.align || "left",
146
+ maxWidth: "100%"
147
+ };
148
+ }
149
+ function videoThumbnailStyle(p) {
150
+ const align = p?.align || "left";
151
+ return {
152
+ width: "100%",
153
+ maxWidth: "100%",
154
+ paddingBottom: "56.25%",
155
+ height: "0",
156
+ position: "relative",
157
+ display: "inline-block",
158
+ borderRadius: (p?.borderRadius || 0) + "px",
159
+ border: `${p?.border?.width || 0}px ${p?.border?.style || "solid"} ${p?.border?.color || "#000000"}`,
160
+ overflow: "hidden",
161
+ marginLeft: align === "center" ? "auto" : align === "right" ? "auto" : "0",
162
+ marginRight: align === "center" ? "auto" : "0",
163
+ boxSizing: "border-box"
164
+ };
165
+ }
166
+ function videoImageStyle() {
167
+ return {
168
+ position: "absolute",
169
+ top: "0",
170
+ left: "0",
171
+ width: "100%",
172
+ height: "100%",
173
+ objectFit: "cover",
174
+ display: "block"
175
+ };
176
+ }
177
+ function videoPlaceholderStyle() {
178
+ return {
179
+ position: "absolute",
180
+ top: "0",
181
+ left: "0",
182
+ width: "100%",
183
+ height: "100%",
184
+ background: "#e5e7eb",
185
+ display: "flex",
186
+ alignItems: "center",
187
+ justifyContent: "center"
188
+ };
189
+ }
190
+ function buttonContainerStyle(p) {
191
+ return {
192
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 4}px ${p?.margin?.left ?? 0}px`,
193
+ textAlign: p?.align || "center"
194
+ };
195
+ }
196
+ function buttonStyle(p) {
197
+ if (p?.fontFamily) loadGoogleFont(p.fontFamily);
198
+ const hasIcon = !!p?.icon;
199
+ return {
200
+ background: resolveBackground(p),
201
+ color: p?.color || "#ffffff",
202
+ fontSize: Math.max(5, p?.fontSize || 16) + "px",
203
+ fontWeight: p?.fontWeight || "500",
204
+ fontFamily: p?.fontFamily || "Arial, sans-serif",
205
+ letterSpacing: `${p?.letterSpacing ?? 0}px`,
206
+ padding: `${p?.padding?.top ?? 8}px ${p?.padding?.right ?? 16}px ${p?.padding?.bottom ?? 8}px ${p?.padding?.left ?? 16}px`,
207
+ borderRadius: (p?.borderRadius || 4) + "px",
208
+ border: `${p?.border?.width || 0}px ${p?.border?.style || "solid"} ${p?.border?.color || "#000000"}`,
209
+ ...hasIcon ? {
210
+ display: "inline-flex",
211
+ alignItems: "center",
212
+ verticalAlign: "middle"
213
+ } : { display: "inline-block" },
214
+ lineHeight: "1.2",
215
+ textDecoration: "none"
216
+ };
217
+ }
218
+ function buttonIconStyle(p) {
219
+ const size = Math.max(4, p?.iconSize ?? 20);
220
+ const gap = p?.iconGap ?? 8;
221
+ const isBefore = p?.iconPosition !== "after";
222
+ return {
223
+ display: "block",
224
+ width: size + "px",
225
+ height: size + "px",
226
+ flexShrink: "0",
227
+ marginRight: isBefore ? gap + "px" : "0",
228
+ marginLeft: isBefore ? "0" : gap + "px"
229
+ };
230
+ }
231
+ function onIconError(e) {
232
+ const img = e.target;
233
+ img.style.display = "none";
234
+ }
235
+ function anchorContainerStyle(p) {
236
+ return {
237
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 4}px ${p?.margin?.left ?? 0}px`,
238
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`,
239
+ textAlign: p?.align || "left"
240
+ };
241
+ }
242
+ function anchorStyle(p) {
243
+ if (p?.fontFamily) loadGoogleFont(p.fontFamily);
244
+ return {
245
+ color: p?.color || "#007bff",
246
+ fontSize: Math.max(6, p?.fontSize || 16) + "px",
247
+ fontWeight: p?.fontWeight || "normal",
248
+ fontFamily: p?.fontFamily || "Arial, sans-serif",
249
+ letterSpacing: `${p?.letterSpacing ?? 0}px`,
250
+ textDecoration: p?.textDecoration || "underline"
251
+ };
252
+ }
253
+ function listWrapStyle(p) {
254
+ if (p?.fontFamily) loadGoogleFont(p.fontFamily);
255
+ return {
256
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 0}px ${p?.margin?.left ?? 0}px`,
257
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 16}px`,
258
+ fontSize: Math.max(6, p?.fontSize || 16) + "px",
259
+ fontFamily: p?.fontFamily || "Arial, sans-serif",
260
+ lineHeight: String(p?.lineHeight ?? 1.5),
261
+ letterSpacing: `${p?.letterSpacing ?? 0}px`,
262
+ color: p?.color || "#111111",
263
+ background: resolveBackground(p)
264
+ };
265
+ }
266
+ function dividerContainerStyle(p) {
267
+ return {
268
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 0}px ${p?.margin?.left ?? 0}px`,
269
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`,
270
+ textAlign: p?.align || "left"
271
+ };
272
+ }
273
+ function dividerStyle(p) {
274
+ const align = p?.align || "left";
275
+ return {
276
+ width: (p?.width || 100) + "%",
277
+ height: (p?.height || 1) + "px",
278
+ background: resolveBackground(p),
279
+ border: "none",
280
+ margin: align === "center" ? "0 auto" : align === "right" ? "0 0 0 auto" : "0"
281
+ };
282
+ }
283
+ function spacerStyle(p) {
284
+ return {
285
+ width: "100%",
286
+ height: (p?.height || 16) + "px",
287
+ background: resolveBackground(p)
288
+ };
289
+ }
290
+ function menuContainerStyle(p) {
291
+ if (p?.fontFamily) loadGoogleFont(p.fontFamily);
292
+ return {
293
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 0}px ${p?.margin?.left ?? 0}px`,
294
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`,
295
+ textAlign: p?.align || "left",
296
+ lineHeight: "0",
297
+ background: resolveBackground(p)
298
+ };
299
+ }
300
+ function menuItemStyle(p, index, total) {
301
+ if (p?.fontFamily) loadGoogleFont(p.fontFamily);
302
+ const isStacked = p?.mobileStack === true;
303
+ const spacing = p?.spacing ?? 8;
304
+ const isFirst = index === 0;
305
+ const isLast = index === total - 1;
306
+ return {
307
+ display: "inline-block",
308
+ marginLeft: isFirst ? "0px" : `${spacing / 2}px`,
309
+ marginRight: isLast ? "0px" : `${spacing / 2}px`,
310
+ fontSize: Math.max(6, p?.fontSize ?? 14) + "px",
311
+ lineHeight: String(p?.lineHeight ?? 1.4),
312
+ letterSpacing: (p?.letterSpacing ?? 0) + "px",
313
+ color: p?.color || "#111111",
314
+ fontWeight: p?.fontWeight || "normal",
315
+ fontFamily: p?.fontFamily ? `'${p.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
316
+ fontStyle: p?.fontStyle || "normal",
317
+ textTransform: p?.textTransform || "none",
318
+ textDecoration: p?.textDecoration || "none",
319
+ whiteSpace: isStacked ? "normal" : "nowrap",
320
+ cursor: "default"
321
+ };
322
+ }
323
+ function socialsContainerStyle(p) {
324
+ return {
325
+ margin: `${p?.margin?.top ?? 0}px ${p?.margin?.right ?? 0}px ${p?.margin?.bottom ?? 0}px ${p?.margin?.left ?? 0}px`,
326
+ padding: `${p?.padding?.top ?? 0}px ${p?.padding?.right ?? 0}px ${p?.padding?.bottom ?? 0}px ${p?.padding?.left ?? 0}px`,
327
+ textAlign: p?.align || "left",
328
+ display: "flex",
329
+ flexWrap: "wrap",
330
+ gap: (p?.spacing ?? 8) + "px",
331
+ justifyContent: p?.align === "center" ? "center" : p?.align === "right" ? "flex-end" : "flex-start"
332
+ };
333
+ }
334
+ return (_ctx, _cache) => {
335
+ return compType.value === "heading" ? (openBlock(), createBlock(resolveDynamicComponent(__props.comp.props?.level || "h2"), {
336
+ key: 0,
337
+ style: normalizeStyle(headingStyle(__props.comp.props)),
338
+ class: "truncate",
339
+ innerHTML: resolvePreviewHtml(__props.comp.props?.content) || "Heading"
340
+ }, null, 8, ["style", "innerHTML"])) : compType.value === "paragraph" ? (openBlock(), createElementBlock("p", {
341
+ key: 1,
342
+ style: normalizeStyle([paragraphStyle(__props.comp.props), {
343
+ "display": "-webkit-box",
344
+ "-webkit-line-clamp": "2",
345
+ "-webkit-box-orient": "vertical"
346
+ }]),
347
+ class: "overflow-hidden",
348
+ innerHTML: resolvePreviewHtml(__props.comp.props?.content) || "Text"
349
+ }, null, 12, _hoisted_1)) : compType.value === "image" ? (openBlock(), createElementBlock("div", {
350
+ key: 2,
351
+ style: normalizeStyle(imageContainerStyle(__props.comp.props))
352
+ }, [createElementVNode("img", {
353
+ src: __props.comp.props?.src,
354
+ alt: __props.comp.props?.alt || "",
355
+ style: normalizeStyle(imageStyle(__props.comp.props))
356
+ }, null, 12, _hoisted_2)], 4)) : compType.value === "video" ? (openBlock(), createElementBlock("div", {
357
+ key: 3,
358
+ style: normalizeStyle(videoContainerStyle(__props.comp.props))
359
+ }, [createElementVNode("div", { style: normalizeStyle(videoThumbnailStyle(__props.comp.props)) }, [__props.comp.props?.coverImage ? (openBlock(), createElementBlock("img", {
360
+ key: 0,
361
+ src: __props.comp.props.coverImage,
362
+ alt: __props.comp.props?.alt || "Video",
363
+ style: normalizeStyle(videoImageStyle())
364
+ }, null, 12, _hoisted_3)) : (openBlock(), createElementBlock("div", {
365
+ key: 1,
366
+ style: normalizeStyle(videoPlaceholderStyle())
367
+ }, [(openBlock(), createElementBlock("svg", _hoisted_4, [..._cache[0] || (_cache[0] = [createElementVNode("path", {
368
+ "fill-rule": "evenodd",
369
+ 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",
370
+ "clip-rule": "evenodd"
371
+ }, null, -1)])]))], 4))], 4)], 4)) : compType.value === "button" ? (openBlock(), createElementBlock("div", {
372
+ key: 4,
373
+ style: normalizeStyle(buttonContainerStyle(__props.comp.props))
374
+ }, [createElementVNode("span", {
375
+ style: normalizeStyle(buttonStyle(__props.comp.props)),
376
+ class: "inline-block truncate"
377
+ }, [
378
+ __props.comp.props?.icon && __props.comp.props?.iconPosition !== "after" ? (openBlock(), createElementBlock("img", {
379
+ key: 0,
380
+ src: __props.comp.props.icon,
381
+ alt: __props.comp.props?.iconAlt || "",
382
+ style: normalizeStyle(buttonIconStyle(__props.comp.props)),
383
+ onError: onIconError
384
+ }, null, 44, _hoisted_5)) : createCommentVNode("", true),
385
+ createTextVNode(" " + toDisplayString(__props.comp.props?.text || "Button") + " ", 1),
386
+ __props.comp.props?.icon && __props.comp.props?.iconPosition === "after" ? (openBlock(), createElementBlock("img", {
387
+ key: 1,
388
+ src: __props.comp.props.icon,
389
+ alt: __props.comp.props?.iconAlt || "",
390
+ style: normalizeStyle(buttonIconStyle(__props.comp.props)),
391
+ onError: onIconError
392
+ }, null, 44, _hoisted_6)) : createCommentVNode("", true)
393
+ ], 4)], 4)) : compType.value === "anchor" ? (openBlock(), createElementBlock("div", {
394
+ key: 5,
395
+ style: normalizeStyle(anchorContainerStyle(__props.comp.props))
396
+ }, [createElementVNode("span", {
397
+ style: normalizeStyle(anchorStyle(__props.comp.props)),
398
+ class: "truncate block"
399
+ }, toDisplayString(__props.comp.props?.text || "Link"), 5)], 4)) : compType.value === "list" ? (openBlock(), createElementBlock("div", {
400
+ key: 6,
401
+ style: normalizeStyle(listWrapStyle(__props.comp.props)),
402
+ innerHTML: resolvePreviewHtml(__props.comp.props?.content) || "<ul><li>Item</li></ul>"
403
+ }, null, 12, _hoisted_7)) : compType.value === "divider" ? (openBlock(), createElementBlock("div", {
404
+ key: 7,
405
+ style: normalizeStyle(dividerContainerStyle(__props.comp.props))
406
+ }, [createElementVNode("hr", { style: normalizeStyle(dividerStyle(__props.comp.props)) }, null, 4)], 4)) : compType.value === "spacer" ? (openBlock(), createElementBlock("div", _hoisted_8, [createElementVNode("div", { style: normalizeStyle(spacerStyle(__props.comp.props)) }, null, 4)])) : compType.value === "menu" ? (openBlock(), createElementBlock("div", {
407
+ key: 9,
408
+ style: normalizeStyle(menuContainerStyle(__props.comp.props))
409
+ }, [!__props.comp.props?.items?.some((i) => i.enabled && i.label) ? (openBlock(), createElementBlock("div", _hoisted_9, " Menu ")) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.comp.props.items.filter((i) => i.enabled && i.label), (item, idx) => {
410
+ return openBlock(), createElementBlock("span", {
411
+ key: item._id || idx,
412
+ style: normalizeStyle(menuItemStyle(__props.comp.props, Number(idx), __props.comp.props.items.filter((i) => i.enabled && i.label).length))
413
+ }, toDisplayString(item.label), 5);
414
+ }), 128))], 4)) : compType.value === "socials" ? (openBlock(), createElementBlock("div", {
415
+ key: 10,
416
+ style: normalizeStyle(socialsContainerStyle(__props.comp.props))
417
+ }, [__props.comp.props?.platforms?.some((p) => p.enabled && p.link) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.comp.props.platforms.filter((p) => p.enabled && p.link), (platform) => {
418
+ return openBlock(), createElementBlock("span", {
419
+ key: platform.name,
420
+ style: {
421
+ display: "inline-flex",
422
+ alignItems: "center",
423
+ justifyContent: "center"
424
+ }
425
+ }, [createElementVNode("img", {
426
+ src: platform.icon,
427
+ alt: platform.name,
428
+ style: normalizeStyle({
429
+ width: (__props.comp.props?.iconSize || 24) + "px",
430
+ height: (__props.comp.props?.iconSize || 24) + "px",
431
+ display: "block"
432
+ })
433
+ }, null, 12, _hoisted_10)]);
434
+ }), 128)) : (openBlock(), createElementBlock("span", _hoisted_11, "Socials"))], 4)) : (openBlock(), createElementBlock("div", _hoisted_12, toDisplayString(compType.value), 1));
435
+ };
436
+ }
437
+ });
438
+ //#endregion
439
+ export { RowPreviewLegacyComponent_default as default };
@@ -0,0 +1,107 @@
1
+ import { Fragment, computed, createCommentVNode, createElementBlock, createVNode, defineAsyncComponent, defineComponent, normalizeStyle, openBlock, renderList, unref } from "vue";
2
+ //#region src/components/features/emailBuilder/product/RowPreviewRow.vue?vue&type=script&setup=true&lang.ts
3
+ var _hoisted_1 = {
4
+ key: 0,
5
+ class: "w-full border border-dashed border-(--md-border) rounded",
6
+ style: { "min-height": "10px" }
7
+ };
8
+ //#endregion
9
+ //#region src/components/features/emailBuilder/product/RowPreviewRow.vue
10
+ var RowPreviewRow_default = /* @__PURE__ */ defineComponent({
11
+ __name: "RowPreviewRow",
12
+ props: {
13
+ row: {},
14
+ scale: {},
15
+ depth: {}
16
+ },
17
+ setup(__props) {
18
+ const RowPreviewChildren = defineAsyncComponent(() => import("./index.js").then((n) => n.t));
19
+ const props = __props;
20
+ function resolveBackground(item) {
21
+ const bg = item?.backgroundGradient;
22
+ if (bg?.useGradient === true && Array.isArray(bg?.gradient?.colors) && bg.gradient.colors.length >= 2) {
23
+ const { type, direction, colors } = bg.gradient;
24
+ const stops = colors.map((c) => `${c.color} ${c.position}%`).join(", ");
25
+ return type === "radial" ? `radial-gradient(circle at center, ${stops})` : `linear-gradient(${direction}, ${stops})`;
26
+ }
27
+ return item?.backgroundColor ?? "transparent";
28
+ }
29
+ const rowStyle = computed(() => {
30
+ const r = props.row;
31
+ const style = {
32
+ display: "flex",
33
+ flexDirection: "row",
34
+ background: resolveBackground(r),
35
+ padding: `${r.padding?.top ?? 0}px ${r.padding?.right ?? 0}px ${r.padding?.bottom ?? 0}px ${r.padding?.left ?? 0}px`,
36
+ alignItems: "stretch",
37
+ border: `${r.border?.width ?? 0}px ${r.border?.style ?? "solid"} ${r.border?.color ?? "transparent"}`,
38
+ borderRadius: `${r.border?.radius ?? 0}px`,
39
+ gap: `${r.gap ?? 0}px`,
40
+ overflow: "hidden"
41
+ };
42
+ if (r.backgroundImage) {
43
+ style.backgroundImage = `url(${r.backgroundImage})`;
44
+ style.backgroundSize = r.backgroundSize ?? "cover";
45
+ style.backgroundPosition = r.backgroundPosition ?? "center center";
46
+ }
47
+ return style;
48
+ });
49
+ function colStyle(col, parentRow) {
50
+ const verticalAlignMap = {
51
+ top: "flex-start",
52
+ middle: "center",
53
+ bottom: "flex-end"
54
+ };
55
+ const widthPct = col.width ?? 50;
56
+ const siblingCount = parentRow?.columns?.length || 1;
57
+ const gapPx = parentRow?.gap ?? 0;
58
+ const gapShare = siblingCount > 1 ? gapPx * (siblingCount - 1) / siblingCount : 0;
59
+ const widthValue = gapShare > 0 ? `calc(${widthPct}% - ${gapShare}px)` : `${widthPct}%`;
60
+ const style = {
61
+ flex: `0 0 ${widthValue}`,
62
+ width: widthValue,
63
+ maxWidth: widthValue,
64
+ boxSizing: "border-box",
65
+ background: resolveBackground(col),
66
+ padding: `${col.padding?.top ?? 10}px ${col.padding?.right ?? 10}px ${col.padding?.bottom ?? 10}px ${col.padding?.left ?? 10}px`,
67
+ border: `${col.border?.width ?? 0}px ${col.border?.style ?? "solid"} ${col.border?.color ?? "transparent"}`,
68
+ borderRadius: `${col.border?.radius ?? 0}px`,
69
+ overflow: "hidden",
70
+ minWidth: "0",
71
+ display: "flex",
72
+ flexDirection: "column",
73
+ justifyContent: verticalAlignMap[col.verticalAlign] ?? "flex-start"
74
+ };
75
+ if (col.backgroundImage) {
76
+ style.backgroundImage = `url(${col.backgroundImage})`;
77
+ style.backgroundSize = col.backgroundSize ?? "cover";
78
+ style.backgroundPosition = col.backgroundPosition ?? "center center";
79
+ style.minHeight = "14px";
80
+ }
81
+ return style;
82
+ }
83
+ return (_ctx, _cache) => {
84
+ return (__props.depth ?? 0) < 5 ? (openBlock(), createElementBlock("div", {
85
+ key: 0,
86
+ style: normalizeStyle(rowStyle.value),
87
+ class: "w-full"
88
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row.columns ?? [], (col) => {
89
+ return openBlock(), createElementBlock("div", {
90
+ key: col.id,
91
+ style: normalizeStyle(colStyle(col, __props.row)),
92
+ class: "overflow-hidden shrink-0"
93
+ }, [createVNode(unref(RowPreviewChildren), {
94
+ children: col.children ?? col.components ?? [],
95
+ scale: __props.scale,
96
+ depth: (__props.depth ?? 0) + 1
97
+ }, null, 8, [
98
+ "children",
99
+ "scale",
100
+ "depth"
101
+ ]), (col.children ?? col.components ?? []).length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true)], 4);
102
+ }), 128))], 4)) : createCommentVNode("", true);
103
+ };
104
+ }
105
+ });
106
+ //#endregion
107
+ export { RowPreviewRow_default as default };
@@ -0,0 +1,107 @@
1
+ import { C as createVNode, L as openBlock, T as defineComponent, f as Fragment, h as computed, mt as unref, v as createCommentVNode, vt as normalizeStyle, w as defineAsyncComponent, y as createElementBlock, z as renderList } from "./vue.runtime.esm-bundler-BaHqghYy.js";
2
+ //#region src/components/features/emailBuilder/product/RowPreviewRow.vue?vue&type=script&setup=true&lang.ts
3
+ var _hoisted_1 = {
4
+ key: 0,
5
+ class: "w-full border border-dashed border-(--md-border) rounded",
6
+ style: { "min-height": "10px" }
7
+ };
8
+ //#endregion
9
+ //#region src/components/features/emailBuilder/product/RowPreviewRow.vue
10
+ var RowPreviewRow_default = /* @__PURE__ */ defineComponent({
11
+ __name: "RowPreviewRow",
12
+ props: {
13
+ row: {},
14
+ scale: {},
15
+ depth: {}
16
+ },
17
+ setup(__props) {
18
+ const RowPreviewChildren = defineAsyncComponent(() => import("./element-95RHug4F.js").then((n) => n.o));
19
+ const props = __props;
20
+ function resolveBackground(item) {
21
+ const bg = item?.backgroundGradient;
22
+ if (bg?.useGradient === true && Array.isArray(bg?.gradient?.colors) && bg.gradient.colors.length >= 2) {
23
+ const { type, direction, colors } = bg.gradient;
24
+ const stops = colors.map((c) => `${c.color} ${c.position}%`).join(", ");
25
+ return type === "radial" ? `radial-gradient(circle at center, ${stops})` : `linear-gradient(${direction}, ${stops})`;
26
+ }
27
+ return item?.backgroundColor ?? "transparent";
28
+ }
29
+ const rowStyle = computed(() => {
30
+ const r = props.row;
31
+ const style = {
32
+ display: "flex",
33
+ flexDirection: "row",
34
+ background: resolveBackground(r),
35
+ padding: `${r.padding?.top ?? 0}px ${r.padding?.right ?? 0}px ${r.padding?.bottom ?? 0}px ${r.padding?.left ?? 0}px`,
36
+ alignItems: "stretch",
37
+ border: `${r.border?.width ?? 0}px ${r.border?.style ?? "solid"} ${r.border?.color ?? "transparent"}`,
38
+ borderRadius: `${r.border?.radius ?? 0}px`,
39
+ gap: `${r.gap ?? 0}px`,
40
+ overflow: "hidden"
41
+ };
42
+ if (r.backgroundImage) {
43
+ style.backgroundImage = `url(${r.backgroundImage})`;
44
+ style.backgroundSize = r.backgroundSize ?? "cover";
45
+ style.backgroundPosition = r.backgroundPosition ?? "center center";
46
+ }
47
+ return style;
48
+ });
49
+ function colStyle(col, parentRow) {
50
+ const verticalAlignMap = {
51
+ top: "flex-start",
52
+ middle: "center",
53
+ bottom: "flex-end"
54
+ };
55
+ const widthPct = col.width ?? 50;
56
+ const siblingCount = parentRow?.columns?.length || 1;
57
+ const gapPx = parentRow?.gap ?? 0;
58
+ const gapShare = siblingCount > 1 ? gapPx * (siblingCount - 1) / siblingCount : 0;
59
+ const widthValue = gapShare > 0 ? `calc(${widthPct}% - ${gapShare}px)` : `${widthPct}%`;
60
+ const style = {
61
+ flex: `0 0 ${widthValue}`,
62
+ width: widthValue,
63
+ maxWidth: widthValue,
64
+ boxSizing: "border-box",
65
+ background: resolveBackground(col),
66
+ padding: `${col.padding?.top ?? 10}px ${col.padding?.right ?? 10}px ${col.padding?.bottom ?? 10}px ${col.padding?.left ?? 10}px`,
67
+ border: `${col.border?.width ?? 0}px ${col.border?.style ?? "solid"} ${col.border?.color ?? "transparent"}`,
68
+ borderRadius: `${col.border?.radius ?? 0}px`,
69
+ overflow: "hidden",
70
+ minWidth: "0",
71
+ display: "flex",
72
+ flexDirection: "column",
73
+ justifyContent: verticalAlignMap[col.verticalAlign] ?? "flex-start"
74
+ };
75
+ if (col.backgroundImage) {
76
+ style.backgroundImage = `url(${col.backgroundImage})`;
77
+ style.backgroundSize = col.backgroundSize ?? "cover";
78
+ style.backgroundPosition = col.backgroundPosition ?? "center center";
79
+ style.minHeight = "14px";
80
+ }
81
+ return style;
82
+ }
83
+ return (_ctx, _cache) => {
84
+ return (__props.depth ?? 0) < 5 ? (openBlock(), createElementBlock("div", {
85
+ key: 0,
86
+ style: normalizeStyle(rowStyle.value),
87
+ class: "w-full"
88
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.row.columns ?? [], (col) => {
89
+ return openBlock(), createElementBlock("div", {
90
+ key: col.id,
91
+ style: normalizeStyle(colStyle(col, __props.row)),
92
+ class: "overflow-hidden shrink-0"
93
+ }, [createVNode(unref(RowPreviewChildren), {
94
+ children: col.children ?? col.components ?? [],
95
+ scale: __props.scale,
96
+ depth: (__props.depth ?? 0) + 1
97
+ }, null, 8, [
98
+ "children",
99
+ "scale",
100
+ "depth"
101
+ ]), (col.children ?? col.components ?? []).length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1)) : createCommentVNode("", true)], 4);
102
+ }), 128))], 4)) : createCommentVNode("", true);
103
+ };
104
+ }
105
+ });
106
+ //#endregion
107
+ export { RowPreviewRow_default as default };