@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.
- package/CHANGELOG.md +46 -0
- package/dist/RowPreviewLegacyComponent-BFvLnPiK.js +439 -0
- package/dist/RowPreviewLegacyComponent-CXsY4P-R.js +439 -0
- package/dist/RowPreviewRow-CeowK6Q_.js +107 -0
- package/dist/RowPreviewRow-D-6koDUR.js +107 -0
- package/dist/editor.css +1832 -1831
- package/dist/element-95RHug4F.js +68388 -0
- package/dist/element-scoped-styles.css +1832 -1831
- package/dist/element.js +2 -5
- package/dist/estree-B67dfAo1.js +7989 -0
- package/dist/html-D6UnSE1C.js +7353 -0
- package/dist/index.js +68394 -16
- package/dist/init.js +148 -166
- package/dist/standalone-Bd2oQFm3.js +3639 -0
- package/dist/typescript-C_Ru9PRN.js +23184 -0
- package/dist/vue.runtime.esm-bundler-BaHqghYy.js +9097 -0
- package/package.json +1 -1
- package/dist/RowPreviewChildren-DT0y0lKC.js +0 -4
- package/dist/RowPreviewChildren-OsbF7_vu.js +0 -4
- package/dist/RowPreviewLegacyComponent-BV4b5bHQ.js +0 -487
- package/dist/RowPreviewLegacyComponent-C08MGJVT.js +0 -487
- package/dist/RowPreviewRow-ByxeBYV8.js +0 -112
- package/dist/RowPreviewRow-N-hh5l_H.js +0 -112
- package/dist/element-C2ZH0Z_i.js +0 -86561
- package/dist/estree-DBJlF9un.js +0 -4876
- package/dist/html-3PMDtB0V.js +0 -3123
- package/dist/index-DhFg3uKs.js +0 -75864
- package/dist/standalone-DKWMQftY.js +0 -2391
- package/dist/typescript-l6-4tT8s.js +0 -13240
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maildeno/editor",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "An open-source, framework-agnostic email template editor. Drag-and-drop block editing, HTML/MJML/React Email/JSON export, and a pluggable ESP-conditional-logic engine with zero required backend.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
import { n as defineComponent, o as computed, q as openBlock, A as createBlock, v as normalizeStyle, B as resolveDynamicComponent, t as createElementBlock, C as createBaseVNode, y as createCommentVNode, D as createTextVNode, E as toDisplayString, F as Fragment, u as renderList } from "./element-C2ZH0Z_i.js";
|
|
2
|
-
const _hoisted_1 = ["innerHTML"];
|
|
3
|
-
const _hoisted_2 = ["src", "alt"];
|
|
4
|
-
const _hoisted_3 = ["src", "alt"];
|
|
5
|
-
const _hoisted_4 = {
|
|
6
|
-
style: { "width": "30%", "height": "30%", "color": "#9ca3af" },
|
|
7
|
-
fill: "currentColor",
|
|
8
|
-
viewBox: "0 0 20 20"
|
|
9
|
-
};
|
|
10
|
-
const _hoisted_5 = ["src", "alt"];
|
|
11
|
-
const _hoisted_6 = ["src", "alt"];
|
|
12
|
-
const _hoisted_7 = ["innerHTML"];
|
|
13
|
-
const _hoisted_8 = { key: 8 };
|
|
14
|
-
const _hoisted_9 = { key: 0 };
|
|
15
|
-
const _hoisted_10 = ["src", "alt"];
|
|
16
|
-
const _hoisted_11 = {
|
|
17
|
-
key: 1,
|
|
18
|
-
style: { "font-size": "7px", "color": "#9ca3af", "font-style": "italic" }
|
|
19
|
-
};
|
|
20
|
-
const _hoisted_12 = {
|
|
21
|
-
key: 11,
|
|
22
|
-
class: "rounded truncate",
|
|
23
|
-
style: { "font-size": "7px", "color": "#9ca3af", "background": "#f3f4f6", "padding": "1px 3px" }
|
|
24
|
-
};
|
|
25
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
26
|
-
__name: "RowPreviewLegacyComponent",
|
|
27
|
-
props: {
|
|
28
|
-
comp: {},
|
|
29
|
-
scale: {}
|
|
30
|
-
},
|
|
31
|
-
setup(__props) {
|
|
32
|
-
const props = __props;
|
|
33
|
-
const compType = computed(() => props.comp.componentType ?? props.comp.type);
|
|
34
|
-
function resolvePreviewHtml(html) {
|
|
35
|
-
if (!html) return "";
|
|
36
|
-
return html.replace(
|
|
37
|
-
/<span[^>]*\bdata-merge="([^"]+)"(?:[^>]*\bdata-merge-default="([^"]*)")?[^>]*>.*?<\/span>/gs,
|
|
38
|
-
(_, name, fallback) => {
|
|
39
|
-
const tag = name.trim();
|
|
40
|
-
const def = fallback == null ? void 0 : fallback.trim();
|
|
41
|
-
return def ? `{{ ${tag}|'${def}' }}` : `{{ ${tag} }}`;
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
function resolveBackground(item) {
|
|
46
|
-
var _a;
|
|
47
|
-
const bg = item == null ? void 0 : item.backgroundGradient;
|
|
48
|
-
const hasGradient = (bg == null ? void 0 : bg.useGradient) === true && Array.isArray((_a = bg == null ? void 0 : bg.gradient) == null ? void 0 : _a.colors) && bg.gradient.colors.length >= 2;
|
|
49
|
-
if (hasGradient) {
|
|
50
|
-
const { type, direction, colors } = bg.gradient;
|
|
51
|
-
const stops = colors.map((c) => `${c.color} ${c.position}%`).join(", ");
|
|
52
|
-
return type === "radial" ? `radial-gradient(circle at center, ${stops})` : `linear-gradient(${direction}, ${stops})`;
|
|
53
|
-
}
|
|
54
|
-
return (item == null ? void 0 : item.backgroundColor) || "transparent";
|
|
55
|
-
}
|
|
56
|
-
function loadGoogleFont(fontFamily) {
|
|
57
|
-
if (!fontFamily) return;
|
|
58
|
-
const knownGoogleFonts = [
|
|
59
|
-
"Roboto",
|
|
60
|
-
"Open Sans",
|
|
61
|
-
"Lato",
|
|
62
|
-
"Montserrat",
|
|
63
|
-
"Poppins",
|
|
64
|
-
"Nunito",
|
|
65
|
-
"Raleway",
|
|
66
|
-
"Plus Jakarta Sans"
|
|
67
|
-
];
|
|
68
|
-
const isGoogle = fontFamily.includes(" ") || knownGoogleFonts.some((f) => fontFamily.includes(f));
|
|
69
|
-
if (isGoogle && typeof document !== "undefined") {
|
|
70
|
-
const formatted = fontFamily.replace(/ /g, "+");
|
|
71
|
-
const href = `https://fonts.googleapis.com/css2?family=${formatted}:wght@300;400;500;600;700;800&display=swap`;
|
|
72
|
-
if (!document.querySelector(`link[href="${href}"]`)) {
|
|
73
|
-
const link = document.createElement("link");
|
|
74
|
-
link.href = href;
|
|
75
|
-
link.rel = "stylesheet";
|
|
76
|
-
document.head.appendChild(link);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
function headingStyle(p) {
|
|
81
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
82
|
-
if (p == null ? void 0 : p.fontFamily) loadGoogleFont(p.fontFamily);
|
|
83
|
-
return {
|
|
84
|
-
fontSize: Math.max(7, (p == null ? void 0 : p.fontSize) || 24) + "px",
|
|
85
|
-
color: (p == null ? void 0 : p.color) || "#111111",
|
|
86
|
-
fontWeight: (p == null ? void 0 : p.fontWeight) || "bold",
|
|
87
|
-
fontFamily: (p == null ? void 0 : p.fontFamily) || "Arial, sans-serif",
|
|
88
|
-
textAlign: (p == null ? void 0 : p.align) || "left",
|
|
89
|
-
lineHeight: String((p == null ? void 0 : p.lineHeight) ?? 1.2),
|
|
90
|
-
letterSpacing: `${(p == null ? void 0 : p.letterSpacing) ?? 0}px`,
|
|
91
|
-
textTransform: (p == null ? void 0 : p.textTransform) || "none",
|
|
92
|
-
textDecoration: (p == null ? void 0 : p.textDecoration) || "none",
|
|
93
|
-
background: resolveBackground(p),
|
|
94
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 4}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
95
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function paragraphStyle(p) {
|
|
99
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
100
|
-
if (p == null ? void 0 : p.fontFamily) loadGoogleFont(p.fontFamily);
|
|
101
|
-
return {
|
|
102
|
-
fontSize: Math.max(6, (p == null ? void 0 : p.fontSize) || 16) + "px",
|
|
103
|
-
color: (p == null ? void 0 : p.color) || "#111111",
|
|
104
|
-
fontFamily: (p == null ? void 0 : p.fontFamily) || "Arial, sans-serif",
|
|
105
|
-
fontWeight: (p == null ? void 0 : p.fontWeight) || "normal",
|
|
106
|
-
fontStyle: (p == null ? void 0 : p.fontStyle) || "normal",
|
|
107
|
-
textAlign: (p == null ? void 0 : p.align) || "left",
|
|
108
|
-
lineHeight: String((p == null ? void 0 : p.lineHeight) ?? 1.5),
|
|
109
|
-
letterSpacing: `${(p == null ? void 0 : p.letterSpacing) ?? 0}px`,
|
|
110
|
-
textTransform: (p == null ? void 0 : p.textTransform) || "none",
|
|
111
|
-
textDecoration: (p == null ? void 0 : p.textDecoration) || "none",
|
|
112
|
-
background: resolveBackground(p),
|
|
113
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 4}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
114
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function imageContainerStyle(p) {
|
|
118
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
119
|
-
return {
|
|
120
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 0}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
121
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`,
|
|
122
|
-
textAlign: (p == null ? void 0 : p.align) || "left"
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function imageStyle(p) {
|
|
126
|
-
var _a, _b, _c;
|
|
127
|
-
const align = (p == null ? void 0 : p.align) || "left";
|
|
128
|
-
return {
|
|
129
|
-
width: ((p == null ? void 0 : p.width) || 100) + "%",
|
|
130
|
-
height: (p == null ? void 0 : p.height) || "auto",
|
|
131
|
-
borderRadius: ((p == null ? void 0 : p.borderRadius) || 0) + "px",
|
|
132
|
-
border: `${((_a = p == null ? void 0 : p.border) == null ? void 0 : _a.width) || 0}px ${((_b = p == null ? void 0 : p.border) == null ? void 0 : _b.style) || "solid"} ${((_c = p == null ? void 0 : p.border) == null ? void 0 : _c.color) || "#000000"}`,
|
|
133
|
-
display: "block",
|
|
134
|
-
margin: align === "center" ? "0 auto" : align === "right" ? "0 0 0 auto" : "0"
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function videoContainerStyle(p) {
|
|
138
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
139
|
-
return {
|
|
140
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 0}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
141
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`,
|
|
142
|
-
textAlign: (p == null ? void 0 : p.align) || "left",
|
|
143
|
-
maxWidth: "100%"
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function videoThumbnailStyle(p) {
|
|
147
|
-
var _a, _b, _c;
|
|
148
|
-
const align = (p == null ? void 0 : p.align) || "left";
|
|
149
|
-
return {
|
|
150
|
-
width: "100%",
|
|
151
|
-
maxWidth: "100%",
|
|
152
|
-
paddingBottom: "56.25%",
|
|
153
|
-
height: "0",
|
|
154
|
-
position: "relative",
|
|
155
|
-
display: "inline-block",
|
|
156
|
-
borderRadius: ((p == null ? void 0 : p.borderRadius) || 0) + "px",
|
|
157
|
-
border: `${((_a = p == null ? void 0 : p.border) == null ? void 0 : _a.width) || 0}px ${((_b = p == null ? void 0 : p.border) == null ? void 0 : _b.style) || "solid"} ${((_c = p == null ? void 0 : p.border) == null ? void 0 : _c.color) || "#000000"}`,
|
|
158
|
-
overflow: "hidden",
|
|
159
|
-
marginLeft: align === "center" ? "auto" : align === "right" ? "auto" : "0",
|
|
160
|
-
marginRight: align === "center" ? "auto" : "0",
|
|
161
|
-
boxSizing: "border-box"
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
function videoImageStyle() {
|
|
165
|
-
return {
|
|
166
|
-
position: "absolute",
|
|
167
|
-
top: "0",
|
|
168
|
-
left: "0",
|
|
169
|
-
width: "100%",
|
|
170
|
-
height: "100%",
|
|
171
|
-
objectFit: "cover",
|
|
172
|
-
display: "block"
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
function videoPlaceholderStyle() {
|
|
176
|
-
return {
|
|
177
|
-
position: "absolute",
|
|
178
|
-
top: "0",
|
|
179
|
-
left: "0",
|
|
180
|
-
width: "100%",
|
|
181
|
-
height: "100%",
|
|
182
|
-
background: "#e5e7eb",
|
|
183
|
-
display: "flex",
|
|
184
|
-
alignItems: "center",
|
|
185
|
-
justifyContent: "center"
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
function buttonContainerStyle(p) {
|
|
189
|
-
var _a, _b, _c, _d;
|
|
190
|
-
return {
|
|
191
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 4}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
192
|
-
textAlign: (p == null ? void 0 : p.align) || "center"
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
function buttonStyle(p) {
|
|
196
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
197
|
-
if (p == null ? void 0 : p.fontFamily) loadGoogleFont(p.fontFamily);
|
|
198
|
-
const hasIcon = !!(p == null ? void 0 : p.icon);
|
|
199
|
-
return {
|
|
200
|
-
background: resolveBackground(p),
|
|
201
|
-
color: (p == null ? void 0 : p.color) || "#ffffff",
|
|
202
|
-
fontSize: Math.max(5, (p == null ? void 0 : p.fontSize) || 16) + "px",
|
|
203
|
-
fontWeight: (p == null ? void 0 : p.fontWeight) || "500",
|
|
204
|
-
fontFamily: (p == null ? void 0 : p.fontFamily) || "Arial, sans-serif",
|
|
205
|
-
letterSpacing: `${(p == null ? void 0 : p.letterSpacing) ?? 0}px`,
|
|
206
|
-
padding: `${((_a = p == null ? void 0 : p.padding) == null ? void 0 : _a.top) ?? 8}px ${((_b = p == null ? void 0 : p.padding) == null ? void 0 : _b.right) ?? 16}px ${((_c = p == null ? void 0 : p.padding) == null ? void 0 : _c.bottom) ?? 8}px ${((_d = p == null ? void 0 : p.padding) == null ? void 0 : _d.left) ?? 16}px`,
|
|
207
|
-
borderRadius: ((p == null ? void 0 : p.borderRadius) || 4) + "px",
|
|
208
|
-
border: `${((_e = p == null ? void 0 : p.border) == null ? void 0 : _e.width) || 0}px ${((_f = p == null ? void 0 : p.border) == null ? void 0 : _f.style) || "solid"} ${((_g = p == null ? void 0 : p.border) == null ? void 0 : _g.color) || "#000000"}`,
|
|
209
|
-
// Icon branch uses inline-flex so icon + text align cleanly on one row.
|
|
210
|
-
// Plain branch stays inline-block (unchanged behaviour).
|
|
211
|
-
...hasIcon ? {
|
|
212
|
-
display: "inline-flex",
|
|
213
|
-
alignItems: "center",
|
|
214
|
-
verticalAlign: "middle"
|
|
215
|
-
} : { display: "inline-block" },
|
|
216
|
-
lineHeight: "1.2",
|
|
217
|
-
textDecoration: "none"
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
function buttonIconStyle(p) {
|
|
221
|
-
const size = Math.max(4, (p == null ? void 0 : p.iconSize) ?? 20);
|
|
222
|
-
const gap = (p == null ? void 0 : p.iconGap) ?? 8;
|
|
223
|
-
const isBefore = (p == null ? void 0 : p.iconPosition) !== "after";
|
|
224
|
-
return {
|
|
225
|
-
display: "block",
|
|
226
|
-
width: size + "px",
|
|
227
|
-
height: size + "px",
|
|
228
|
-
flexShrink: "0",
|
|
229
|
-
marginRight: isBefore ? gap + "px" : "0",
|
|
230
|
-
marginLeft: isBefore ? "0" : gap + "px"
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function onIconError(e) {
|
|
234
|
-
const img = e.target;
|
|
235
|
-
img.style.display = "none";
|
|
236
|
-
}
|
|
237
|
-
function anchorContainerStyle(p) {
|
|
238
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
239
|
-
return {
|
|
240
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 4}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
241
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`,
|
|
242
|
-
textAlign: (p == null ? void 0 : p.align) || "left"
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
function anchorStyle(p) {
|
|
246
|
-
if (p == null ? void 0 : p.fontFamily) loadGoogleFont(p.fontFamily);
|
|
247
|
-
return {
|
|
248
|
-
color: (p == null ? void 0 : p.color) || "#007bff",
|
|
249
|
-
fontSize: Math.max(6, (p == null ? void 0 : p.fontSize) || 16) + "px",
|
|
250
|
-
fontWeight: (p == null ? void 0 : p.fontWeight) || "normal",
|
|
251
|
-
fontFamily: (p == null ? void 0 : p.fontFamily) || "Arial, sans-serif",
|
|
252
|
-
letterSpacing: `${(p == null ? void 0 : p.letterSpacing) ?? 0}px`,
|
|
253
|
-
textDecoration: (p == null ? void 0 : p.textDecoration) || "underline"
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function listWrapStyle(p) {
|
|
257
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
258
|
-
if (p == null ? void 0 : p.fontFamily) loadGoogleFont(p.fontFamily);
|
|
259
|
-
return {
|
|
260
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 0}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
261
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 16}px`,
|
|
262
|
-
fontSize: Math.max(6, (p == null ? void 0 : p.fontSize) || 16) + "px",
|
|
263
|
-
fontFamily: (p == null ? void 0 : p.fontFamily) || "Arial, sans-serif",
|
|
264
|
-
lineHeight: String((p == null ? void 0 : p.lineHeight) ?? 1.5),
|
|
265
|
-
letterSpacing: `${(p == null ? void 0 : p.letterSpacing) ?? 0}px`,
|
|
266
|
-
color: (p == null ? void 0 : p.color) || "#111111",
|
|
267
|
-
background: resolveBackground(p)
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
function dividerContainerStyle(p) {
|
|
271
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
272
|
-
return {
|
|
273
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 0}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
274
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`,
|
|
275
|
-
textAlign: (p == null ? void 0 : p.align) || "left"
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
function dividerStyle(p) {
|
|
279
|
-
const align = (p == null ? void 0 : p.align) || "left";
|
|
280
|
-
return {
|
|
281
|
-
width: ((p == null ? void 0 : p.width) || 100) + "%",
|
|
282
|
-
height: ((p == null ? void 0 : p.height) || 1) + "px",
|
|
283
|
-
background: resolveBackground(p),
|
|
284
|
-
border: "none",
|
|
285
|
-
margin: align === "center" ? "0 auto" : align === "right" ? "0 0 0 auto" : "0"
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function spacerStyle(p) {
|
|
289
|
-
return {
|
|
290
|
-
width: "100%",
|
|
291
|
-
height: ((p == null ? void 0 : p.height) || 16) + "px",
|
|
292
|
-
background: resolveBackground(p)
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
function menuContainerStyle(p) {
|
|
296
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
297
|
-
if (p == null ? void 0 : p.fontFamily) loadGoogleFont(p.fontFamily);
|
|
298
|
-
return {
|
|
299
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 0}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
300
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`,
|
|
301
|
-
textAlign: (p == null ? void 0 : p.align) || "left",
|
|
302
|
-
lineHeight: "0",
|
|
303
|
-
background: resolveBackground(p)
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
function menuItemStyle(p, index, total) {
|
|
307
|
-
if (p == null ? void 0 : p.fontFamily) loadGoogleFont(p.fontFamily);
|
|
308
|
-
const isStacked = (p == null ? void 0 : p.mobileStack) === true;
|
|
309
|
-
const spacing = (p == null ? void 0 : p.spacing) ?? 8;
|
|
310
|
-
const isFirst = index === 0;
|
|
311
|
-
const isLast = index === total - 1;
|
|
312
|
-
return {
|
|
313
|
-
// display is always block, used for showcase
|
|
314
|
-
display: "inline-block",
|
|
315
|
-
marginLeft: isFirst ? "0px" : `${spacing / 2}px`,
|
|
316
|
-
marginRight: isLast ? "0px" : `${spacing / 2}px`,
|
|
317
|
-
// marginBottom: isStacked && !isLast ? `${spacing}px` : "0",
|
|
318
|
-
fontSize: Math.max(6, (p == null ? void 0 : p.fontSize) ?? 14) + "px",
|
|
319
|
-
lineHeight: String((p == null ? void 0 : p.lineHeight) ?? 1.4),
|
|
320
|
-
letterSpacing: ((p == null ? void 0 : p.letterSpacing) ?? 0) + "px",
|
|
321
|
-
color: (p == null ? void 0 : p.color) || "#111111",
|
|
322
|
-
fontWeight: (p == null ? void 0 : p.fontWeight) || "normal",
|
|
323
|
-
fontFamily: (p == null ? void 0 : p.fontFamily) ? `'${p.fontFamily}', Arial, sans-serif` : "Arial, sans-serif",
|
|
324
|
-
fontStyle: (p == null ? void 0 : p.fontStyle) || "normal",
|
|
325
|
-
textTransform: (p == null ? void 0 : p.textTransform) || "none",
|
|
326
|
-
textDecoration: (p == null ? void 0 : p.textDecoration) || "none",
|
|
327
|
-
whiteSpace: isStacked ? "normal" : "nowrap",
|
|
328
|
-
cursor: "default"
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
function socialsContainerStyle(p) {
|
|
332
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
333
|
-
return {
|
|
334
|
-
margin: `${((_a = p == null ? void 0 : p.margin) == null ? void 0 : _a.top) ?? 0}px ${((_b = p == null ? void 0 : p.margin) == null ? void 0 : _b.right) ?? 0}px ${((_c = p == null ? void 0 : p.margin) == null ? void 0 : _c.bottom) ?? 0}px ${((_d = p == null ? void 0 : p.margin) == null ? void 0 : _d.left) ?? 0}px`,
|
|
335
|
-
padding: `${((_e = p == null ? void 0 : p.padding) == null ? void 0 : _e.top) ?? 0}px ${((_f = p == null ? void 0 : p.padding) == null ? void 0 : _f.right) ?? 0}px ${((_g = p == null ? void 0 : p.padding) == null ? void 0 : _g.bottom) ?? 0}px ${((_h = p == null ? void 0 : p.padding) == null ? void 0 : _h.left) ?? 0}px`,
|
|
336
|
-
textAlign: (p == null ? void 0 : p.align) || "left",
|
|
337
|
-
display: "flex",
|
|
338
|
-
flexWrap: "wrap",
|
|
339
|
-
gap: ((p == null ? void 0 : p.spacing) ?? 8) + "px",
|
|
340
|
-
justifyContent: (p == null ? void 0 : p.align) === "center" ? "center" : (p == null ? void 0 : p.align) === "right" ? "flex-end" : "flex-start"
|
|
341
|
-
};
|
|
342
|
-
}
|
|
343
|
-
return (_ctx, _cache) => {
|
|
344
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
345
|
-
return compType.value === "heading" ? (openBlock(), createBlock(resolveDynamicComponent(((_a = __props.comp.props) == null ? void 0 : _a.level) || "h2"), {
|
|
346
|
-
key: 0,
|
|
347
|
-
style: normalizeStyle(headingStyle(__props.comp.props)),
|
|
348
|
-
class: "truncate",
|
|
349
|
-
innerHTML: resolvePreviewHtml((_b = __props.comp.props) == null ? void 0 : _b.content) || "Heading"
|
|
350
|
-
}, null, 8, ["style", "innerHTML"])) : compType.value === "paragraph" ? (openBlock(), createElementBlock("p", {
|
|
351
|
-
key: 1,
|
|
352
|
-
style: normalizeStyle([paragraphStyle(__props.comp.props), { "display": "-webkit-box", "-webkit-line-clamp": "2", "-webkit-box-orient": "vertical" }]),
|
|
353
|
-
class: "overflow-hidden",
|
|
354
|
-
innerHTML: resolvePreviewHtml((_c = __props.comp.props) == null ? void 0 : _c.content) || "Text"
|
|
355
|
-
}, null, 12, _hoisted_1)) : compType.value === "image" ? (openBlock(), createElementBlock("div", {
|
|
356
|
-
key: 2,
|
|
357
|
-
style: normalizeStyle(imageContainerStyle(__props.comp.props))
|
|
358
|
-
}, [
|
|
359
|
-
createBaseVNode("img", {
|
|
360
|
-
src: (_d = __props.comp.props) == null ? void 0 : _d.src,
|
|
361
|
-
alt: ((_e = __props.comp.props) == null ? void 0 : _e.alt) || "",
|
|
362
|
-
style: normalizeStyle(imageStyle(__props.comp.props))
|
|
363
|
-
}, null, 12, _hoisted_2)
|
|
364
|
-
], 4)) : compType.value === "video" ? (openBlock(), createElementBlock("div", {
|
|
365
|
-
key: 3,
|
|
366
|
-
style: normalizeStyle(videoContainerStyle(__props.comp.props))
|
|
367
|
-
}, [
|
|
368
|
-
createBaseVNode("div", {
|
|
369
|
-
style: normalizeStyle(videoThumbnailStyle(__props.comp.props))
|
|
370
|
-
}, [
|
|
371
|
-
((_f = __props.comp.props) == null ? void 0 : _f.coverImage) ? (openBlock(), createElementBlock("img", {
|
|
372
|
-
key: 0,
|
|
373
|
-
src: __props.comp.props.coverImage,
|
|
374
|
-
alt: ((_g = __props.comp.props) == null ? void 0 : _g.alt) || "Video",
|
|
375
|
-
style: normalizeStyle(videoImageStyle())
|
|
376
|
-
}, null, 12, _hoisted_3)) : (openBlock(), createElementBlock("div", {
|
|
377
|
-
key: 1,
|
|
378
|
-
style: normalizeStyle(videoPlaceholderStyle())
|
|
379
|
-
}, [
|
|
380
|
-
(openBlock(), createElementBlock("svg", _hoisted_4, [..._cache[0] || (_cache[0] = [
|
|
381
|
-
createBaseVNode("path", {
|
|
382
|
-
"fill-rule": "evenodd",
|
|
383
|
-
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",
|
|
384
|
-
"clip-rule": "evenodd"
|
|
385
|
-
}, null, -1)
|
|
386
|
-
])]))
|
|
387
|
-
], 4))
|
|
388
|
-
], 4)
|
|
389
|
-
], 4)) : compType.value === "button" ? (openBlock(), createElementBlock("div", {
|
|
390
|
-
key: 4,
|
|
391
|
-
style: normalizeStyle(buttonContainerStyle(__props.comp.props))
|
|
392
|
-
}, [
|
|
393
|
-
createBaseVNode("span", {
|
|
394
|
-
style: normalizeStyle(buttonStyle(__props.comp.props)),
|
|
395
|
-
class: "inline-block truncate"
|
|
396
|
-
}, [
|
|
397
|
-
((_h = __props.comp.props) == null ? void 0 : _h.icon) && ((_i = __props.comp.props) == null ? void 0 : _i.iconPosition) !== "after" ? (openBlock(), createElementBlock("img", {
|
|
398
|
-
key: 0,
|
|
399
|
-
src: __props.comp.props.icon,
|
|
400
|
-
alt: ((_j = __props.comp.props) == null ? void 0 : _j.iconAlt) || "",
|
|
401
|
-
style: normalizeStyle(buttonIconStyle(__props.comp.props)),
|
|
402
|
-
onError: onIconError
|
|
403
|
-
}, null, 44, _hoisted_5)) : createCommentVNode("", true),
|
|
404
|
-
createTextVNode(" " + toDisplayString(((_k = __props.comp.props) == null ? void 0 : _k.text) || "Button") + " ", 1),
|
|
405
|
-
((_l = __props.comp.props) == null ? void 0 : _l.icon) && ((_m = __props.comp.props) == null ? void 0 : _m.iconPosition) === "after" ? (openBlock(), createElementBlock("img", {
|
|
406
|
-
key: 1,
|
|
407
|
-
src: __props.comp.props.icon,
|
|
408
|
-
alt: ((_n = __props.comp.props) == null ? void 0 : _n.iconAlt) || "",
|
|
409
|
-
style: normalizeStyle(buttonIconStyle(__props.comp.props)),
|
|
410
|
-
onError: onIconError
|
|
411
|
-
}, null, 44, _hoisted_6)) : createCommentVNode("", true)
|
|
412
|
-
], 4)
|
|
413
|
-
], 4)) : compType.value === "anchor" ? (openBlock(), createElementBlock("div", {
|
|
414
|
-
key: 5,
|
|
415
|
-
style: normalizeStyle(anchorContainerStyle(__props.comp.props))
|
|
416
|
-
}, [
|
|
417
|
-
createBaseVNode("span", {
|
|
418
|
-
style: normalizeStyle(anchorStyle(__props.comp.props)),
|
|
419
|
-
class: "truncate block"
|
|
420
|
-
}, toDisplayString(((_o = __props.comp.props) == null ? void 0 : _o.text) || "Link"), 5)
|
|
421
|
-
], 4)) : compType.value === "list" ? (openBlock(), createElementBlock("div", {
|
|
422
|
-
key: 6,
|
|
423
|
-
style: normalizeStyle(listWrapStyle(__props.comp.props)),
|
|
424
|
-
innerHTML: resolvePreviewHtml((_p = __props.comp.props) == null ? void 0 : _p.content) || "<ul><li>Item</li></ul>"
|
|
425
|
-
}, null, 12, _hoisted_7)) : compType.value === "divider" ? (openBlock(), createElementBlock("div", {
|
|
426
|
-
key: 7,
|
|
427
|
-
style: normalizeStyle(dividerContainerStyle(__props.comp.props))
|
|
428
|
-
}, [
|
|
429
|
-
createBaseVNode("hr", {
|
|
430
|
-
style: normalizeStyle(dividerStyle(__props.comp.props))
|
|
431
|
-
}, null, 4)
|
|
432
|
-
], 4)) : compType.value === "spacer" ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
433
|
-
createBaseVNode("div", {
|
|
434
|
-
style: normalizeStyle(spacerStyle(__props.comp.props))
|
|
435
|
-
}, null, 4)
|
|
436
|
-
])) : compType.value === "menu" ? (openBlock(), createElementBlock("div", {
|
|
437
|
-
key: 9,
|
|
438
|
-
style: normalizeStyle(menuContainerStyle(__props.comp.props))
|
|
439
|
-
}, [
|
|
440
|
-
!((_r = (_q = __props.comp.props) == null ? void 0 : _q.items) == null ? void 0 : _r.some((i) => i.enabled && i.label)) ? (openBlock(), createElementBlock("div", _hoisted_9, " Menu ")) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.comp.props.items.filter(
|
|
441
|
-
(i) => i.enabled && i.label
|
|
442
|
-
), (item, idx) => {
|
|
443
|
-
return openBlock(), createElementBlock("span", {
|
|
444
|
-
key: item._id || idx,
|
|
445
|
-
style: normalizeStyle(
|
|
446
|
-
menuItemStyle(
|
|
447
|
-
__props.comp.props,
|
|
448
|
-
Number(idx),
|
|
449
|
-
__props.comp.props.items.filter((i) => i.enabled && i.label).length
|
|
450
|
-
)
|
|
451
|
-
)
|
|
452
|
-
}, toDisplayString(item.label), 5);
|
|
453
|
-
}), 128))
|
|
454
|
-
], 4)) : compType.value === "socials" ? (openBlock(), createElementBlock("div", {
|
|
455
|
-
key: 10,
|
|
456
|
-
style: normalizeStyle(socialsContainerStyle(__props.comp.props))
|
|
457
|
-
}, [
|
|
458
|
-
((_t = (_s = __props.comp.props) == null ? void 0 : _s.platforms) == null ? void 0 : _t.some((p) => p.enabled && p.link)) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.comp.props.platforms.filter(
|
|
459
|
-
(p) => p.enabled && p.link
|
|
460
|
-
), (platform) => {
|
|
461
|
-
var _a2, _b2;
|
|
462
|
-
return openBlock(), createElementBlock("span", {
|
|
463
|
-
key: platform.name,
|
|
464
|
-
style: {
|
|
465
|
-
display: "inline-flex",
|
|
466
|
-
alignItems: "center",
|
|
467
|
-
justifyContent: "center"
|
|
468
|
-
}
|
|
469
|
-
}, [
|
|
470
|
-
createBaseVNode("img", {
|
|
471
|
-
src: platform.icon,
|
|
472
|
-
alt: platform.name,
|
|
473
|
-
style: normalizeStyle({
|
|
474
|
-
width: (((_a2 = __props.comp.props) == null ? void 0 : _a2.iconSize) || 24) + "px",
|
|
475
|
-
height: (((_b2 = __props.comp.props) == null ? void 0 : _b2.iconSize) || 24) + "px",
|
|
476
|
-
display: "block"
|
|
477
|
-
})
|
|
478
|
-
}, null, 12, _hoisted_10)
|
|
479
|
-
]);
|
|
480
|
-
}), 128)) : (openBlock(), createElementBlock("span", _hoisted_11, "Socials"))
|
|
481
|
-
], 4)) : (openBlock(), createElementBlock("div", _hoisted_12, toDisplayString(compType.value), 1));
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
export {
|
|
486
|
-
_sfc_main as default
|
|
487
|
-
};
|