@maildeno/editor 0.1.0
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/LICENSE +21 -0
- package/README.md +426 -0
- package/dist/RowPreviewLegacyComponent-CXsY4P-R.js +439 -0
- package/dist/RowPreviewLegacyComponent-osWbuByc.js +439 -0
- package/dist/RowPreviewRow-D-U1mV4v.js +107 -0
- package/dist/RowPreviewRow-MSc_unf3.js +107 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/localStorageAdapter.d.ts +6 -0
- package/dist/adapters/types.d.ts +83 -0
- package/dist/baseStyles.d.ts +13 -0
- package/dist/blocks/canvasStyleHelpers.d.ts +17 -0
- package/dist/blocks/definitions/anchor.d.ts +2 -0
- package/dist/blocks/definitions/button.d.ts +2 -0
- package/dist/blocks/definitions/divider.d.ts +2 -0
- package/dist/blocks/definitions/heading.d.ts +2 -0
- package/dist/blocks/definitions/image.d.ts +2 -0
- package/dist/blocks/definitions/list.d.ts +2 -0
- package/dist/blocks/definitions/menu.d.ts +2 -0
- package/dist/blocks/definitions/paragraph.d.ts +2 -0
- package/dist/blocks/definitions/socials.d.ts +2 -0
- package/dist/blocks/definitions/spacer.d.ts +2 -0
- package/dist/blocks/definitions/video.d.ts +2 -0
- package/dist/blocks/index.d.ts +8 -0
- package/dist/blocks/registry.d.ts +23 -0
- package/dist/blocks/types.d.ts +73 -0
- package/dist/composables/emailBuilder/components/useComponentStyleEditor.d.ts +72 -0
- package/dist/composables/emailBuilder/components/useProductRowActions.d.ts +3 -0
- package/dist/composables/emailBuilder/components/useProductRows.d.ts +59 -0
- package/dist/composables/emailBuilder/core/config/componentConfig.d.ts +29 -0
- package/dist/composables/emailBuilder/core/link-tags/useLinkTagInsert.d.ts +13 -0
- package/dist/composables/emailBuilder/core/merge-tags/mergeTagDefinitions.d.ts +64 -0
- package/dist/composables/emailBuilder/core/merge-tags/resolveMergeTags.d.ts +27 -0
- package/dist/composables/emailBuilder/core/ui/useLayerHoverScroll.d.ts +20 -0
- package/dist/composables/emailBuilder/core/ui/useLayoutDrag.d.ts +85 -0
- package/dist/composables/emailBuilder/core/ui/useRichTextEditors.d.ts +6 -0
- package/dist/composables/emailBuilder/core/ui/visibilityBadgeHelpers.d.ts +22 -0
- package/dist/composables/emailBuilder/core/useEmailBuilder.d.ts +274 -0
- package/dist/composables/emailBuilder/core/useEmailBuilderDefault.d.ts +507 -0
- package/dist/composables/emailBuilder/core/useEmailBuilderOperations.d.ts +31 -0
- package/dist/composables/emailBuilder/core/useEmailBuilderVisibility.d.ts +31 -0
- package/dist/composables/emailBuilder/export/actions/download.d.ts +24 -0
- package/dist/composables/emailBuilder/export/generators/html.d.ts +3 -0
- package/dist/composables/emailBuilder/export/generators/mjml.d.ts +6 -0
- package/dist/composables/emailBuilder/export/generators/react-email.d.ts +61 -0
- package/dist/composables/emailBuilder/export/helpers/generatorHelpers.d.ts +53 -0
- package/dist/composables/emailBuilder/export/logic/espLogicWrapper.d.ts +76 -0
- package/dist/composables/emailBuilder/export/logic/reactLogicWrapper.d.ts +31 -0
- package/dist/composables/emailBuilder/export/merge-tags/mergeTagMapper.d.ts +42 -0
- package/dist/composables/emailBuilder/export/merge-tags/reactMergeTagMapper.d.ts +26 -0
- package/dist/composables/emailBuilder/export/shared/containers.d.ts +18 -0
- package/dist/composables/emailBuilder/export/shared/styles.d.ts +12 -0
- package/dist/composables/emailBuilder/export/shared/tagIdentifier.d.ts +1 -0
- package/dist/composables/emailBuilder/export/targets/htmlExport.d.ts +20 -0
- package/dist/composables/emailBuilder/export/targets/jsonExport.d.ts +28 -0
- package/dist/composables/emailBuilder/export/targets/mjmlExport.d.ts +19 -0
- package/dist/composables/emailBuilder/export/targets/reactEmailExport.d.ts +20 -0
- package/dist/composables/emailBuilder/export/transformers/espWrapper.d.ts +2 -0
- package/dist/composables/emailBuilder/export/transformers/formatting.d.ts +3 -0
- package/dist/composables/emailBuilder/export/transformers/minify.d.ts +33 -0
- package/dist/composables/emailBuilder/export/transformers/tagMapper.d.ts +29 -0
- package/dist/composables/emailBuilder/export/types/export.d.ts +24 -0
- package/dist/composables/emailBuilder/export/useEmailExportEngine.d.ts +63 -0
- package/dist/composables/emailBuilder/export/useEmailExportMobileStyles.d.ts +3 -0
- package/dist/composables/emailBuilder/export/useExportSettings.d.ts +5 -0
- package/dist/composables/emailBuilder/health/accessibilityChecker.d.ts +64 -0
- package/dist/composables/emailBuilder/health/healthIndicator.d.ts +19 -0
- package/dist/composables/emailBuilder/history/useEmailBuilderHistory.d.ts +26 -0
- package/dist/composables/emailBuilder/history/useHistory.d.ts +16 -0
- package/dist/composables/emailBuilder/persistence/useEmailBuilderPersistence.d.ts +38 -0
- package/dist/composables/emailBuilder/preview/useClientPreview.d.ts +127 -0
- package/dist/composables/emailBuilder/transform/pipeline/hydrate.d.ts +54 -0
- package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +101 -0
- package/dist/composables/emailBuilder/transform/pipeline/optimizeAI.d.ts +125 -0
- package/dist/composables/emailBuilder/types/emailBuilder.d.ts +79 -0
- package/dist/composables/system/useColor.d.ts +26 -0
- package/dist/composables/system/useDeviceDetection.d.ts +5 -0
- package/dist/composables/system/useGoogleFonts.d.ts +11 -0
- package/dist/composables/system/useImageUpload.d.ts +23 -0
- package/dist/composables/system/useSavedRowsPanel.d.ts +35 -0
- package/dist/composables/ui/useConfirm.d.ts +33 -0
- package/dist/composables/ui/useInfoDialog.d.ts +22 -0
- package/dist/composables/ui/useTeleportTarget.d.ts +49 -0
- package/dist/composables/ui/useToast.d.ts +32 -0
- package/dist/devStyleMirror.d.ts +20 -0
- package/dist/documentScopedStyles.d.ts +39 -0
- package/dist/editor.css +2411 -0
- package/dist/element-DN22fZmQ.js +72000 -0
- package/dist/element-scoped-styles.css +2411 -0
- package/dist/element.d.ts +6 -0
- package/dist/element.js +2 -0
- package/dist/esp/registry.d.ts +33 -0
- package/dist/estree-C12ASyI-.js +7993 -0
- package/dist/html-DGrfikay.js +7353 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +71955 -0
- package/dist/init.d.ts +85 -0
- package/dist/init.js +130 -0
- package/dist/lightDom.d.ts +30 -0
- package/dist/merge-tags/registry.d.ts +33 -0
- package/dist/shadowStyles.d.ts +8 -0
- package/dist/standalone-Bd2oQFm3.js +3639 -0
- package/dist/theme.d.ts +132 -0
- package/dist/typescript-D-z2dDu9.js +23190 -0
- package/dist/utils/generateId.d.ts +1 -0
- package/dist/utils/shadowDom.d.ts +30 -0
- package/dist/vue.runtime.esm-bundler-DwQEK7WO.js +9028 -0
- package/package.json +99 -0
|
@@ -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 };
|