@maildeno/editor 0.1.3 → 0.4.2
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 +258 -0
- package/README.md +397 -381
- package/dist/RowPreviewChildren-DT0y0lKC.js +4 -0
- package/dist/RowPreviewChildren-OsbF7_vu.js +4 -0
- package/dist/RowPreviewLegacyComponent-BV4b5bHQ.js +487 -0
- package/dist/RowPreviewLegacyComponent-C08MGJVT.js +487 -0
- package/dist/RowPreviewRow-ByxeBYV8.js +112 -0
- package/dist/RowPreviewRow-N-hh5l_H.js +112 -0
- package/dist/adapters/errors.d.ts +59 -0
- package/dist/adapters/index.d.ts +31 -0
- package/dist/adapters/types.d.ts +68 -0
- package/dist/brand.d.ts +15 -0
- package/dist/components/DesktopOnlyNotice.vue.d.ts +20 -0
- package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +182 -0
- package/dist/components/features/emailBuilder/assistant/AssistantPanel.vue.d.ts +37 -0
- package/dist/components/features/emailBuilder/blocks/AnchorBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/ButtonBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/DividerBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/HeadingBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/ImageBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/ListBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/MenuBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/ParagraphBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/SocialsBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/SpacerBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/blocks/VideoBlock.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/canvas/Canvas.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/canvas/CanvasColumn.vue.d.ts +49 -0
- package/dist/components/features/emailBuilder/canvas/CanvasComponent.vue.d.ts +56 -0
- package/dist/components/features/emailBuilder/canvas/CanvasElement.vue.d.ts +21 -0
- package/dist/components/features/emailBuilder/canvas/CanvasRow.vue.d.ts +49 -0
- package/dist/components/features/emailBuilder/canvas/CanvasRowSpacer.vue.d.ts +40 -0
- package/dist/components/features/emailBuilder/health/HealthIndicator.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/layout/Header.vue.d.ts +54 -0
- package/dist/components/features/emailBuilder/layout/SendEmail.vue.d.ts +21 -0
- package/dist/components/features/emailBuilder/layout/SidebarLeft.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/layout/SidebarRight.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/AnchorPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/ButtonPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/DividerPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/HeadingPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/ImagePanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/ListPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/MenuPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/ParagraphPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/RowColumnPanel.vue.d.ts +13 -0
- package/dist/components/features/emailBuilder/panels/RowPanel.vue.d.ts +13 -0
- package/dist/components/features/emailBuilder/panels/RowSpacerPanel.vue.d.ts +13 -0
- package/dist/components/features/emailBuilder/panels/SocialsPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/SpacerPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/VideoPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/panels/shared/DeviceTabs.vue.d.ts +19 -0
- package/dist/components/features/emailBuilder/panels/shared/LinkFieldMergeTags.vue.d.ts +31 -0
- package/dist/components/features/emailBuilder/panels/shared/OverrideBadge.vue.d.ts +9 -0
- package/dist/components/features/emailBuilder/panels/shared/PreviewBadge.vue.d.ts +11 -0
- package/dist/components/features/emailBuilder/panels/shared/TextFieldMergeTags.vue.d.ts +25 -0
- package/dist/components/features/emailBuilder/panels/ui/BoxStylingSection.vue.d.ts +7 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyAlignment.vue.d.ts +30 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyColor.vue.d.ts +75 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyGradientColor.vue.d.ts +27 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyNumberSlider.vue.d.ts +74 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertySection.vue.d.ts +17 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertySelect.vue.d.ts +74 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyTextStyle.vue.d.ts +52 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyTextStylePanel.vue.d.ts +72 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyToggle.vue.d.ts +45 -0
- package/dist/components/features/emailBuilder/panels/ui/PropertyVisibility.vue.d.ts +32 -0
- package/dist/components/features/emailBuilder/panels/ui/SpacingControl.vue.d.ts +19 -0
- package/dist/components/features/emailBuilder/panels/ui/color-picker/AlphaSlider.vue.d.ts +28 -0
- package/dist/components/features/emailBuilder/panels/ui/color-picker/ColorPickerPanel.vue.d.ts +31 -0
- package/dist/components/features/emailBuilder/panels/ui/color-picker/HueSlider.vue.d.ts +19 -0
- package/dist/components/features/emailBuilder/panels/ui/color-picker/RecentColors.vue.d.ts +20 -0
- package/dist/components/features/emailBuilder/panels/ui/color-picker/SVPanel.vue.d.ts +39 -0
- package/dist/components/features/emailBuilder/panels/ui/visibility-rule/Rule.vue.d.ts +28 -0
- package/dist/components/features/emailBuilder/preview/PreviewScreen.vue.d.ts +7 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewCanvas.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewCapabilityBadges.vue.d.ts +12 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewClientCard.vue.d.ts +20 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewClientList.vue.d.ts +21 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewClientPicker.vue.d.ts +16 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewComponent.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewDetailView.vue.d.ts +41 -0
- package/dist/components/features/emailBuilder/preview/ui/PreviewRendered.vue.d.ts +8 -0
- package/dist/components/features/emailBuilder/product/RowPreview.vue.d.ts +8 -0
- package/dist/components/features/emailBuilder/product/RowPreviewChildren.vue.d.ts +14 -0
- package/dist/components/features/emailBuilder/product/RowPreviewLegacyComponent.vue.d.ts +14 -0
- package/dist/components/features/emailBuilder/product/RowPreviewRow.vue.d.ts +9 -0
- package/dist/components/features/emailBuilder/product/SavedRowsPanel.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/product/SavedTemplatesPanel.vue.d.ts +13 -0
- package/dist/components/features/emailBuilder/product/VersionHistoryPanel.vue.d.ts +14 -0
- package/dist/components/features/emailBuilder/sidebar/SidebarBlockButton.vue.d.ts +35 -0
- package/dist/components/features/emailBuilder/tabs/GeneralTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/LayoutTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/content/ContentTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/content/LayersPanel.vue.d.ts +7 -0
- package/dist/components/features/emailBuilder/tabs/general/MergeTagsTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/general/StylesTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/general/VisibilityTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/general/VisibilityWrapESPTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/general/merge-tags/LinkTagTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/tabs/general/merge-tags/MergeTagTab.vue.d.ts +3 -0
- package/dist/components/features/emailBuilder/ui/LinkInputDialog.vue.d.ts +17 -0
- package/dist/components/features/emailBuilder/ui/canvas/CanvasRowDropZone.vue.d.ts +12 -0
- package/dist/components/features/emailBuilder/ui/canvas/DropZone.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/canvas/Loader.vue.d.ts +19 -0
- package/dist/components/features/emailBuilder/ui/layers-panel/ComponentIcon.vue.d.ts +7 -0
- package/dist/components/features/emailBuilder/ui/layers-panel/LayerColumnChildren.vue.d.ts +42 -0
- package/dist/components/features/emailBuilder/ui/layers-panel/LayerDropLine.vue.d.ts +8 -0
- package/dist/components/features/emailBuilder/ui/renderers/AnchorRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/DividerRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/HeadingRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/ImageRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/ListRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/MenuRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/ParagraphRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/SocialsRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/SpacerRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/renderers/VideoRenderer.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/rich-text-editor/RichTextEditor.vue.d.ts +12 -0
- package/dist/components/features/emailBuilder/ui/rich-text-editor/pickers/MergeTagPicker.vue.d.ts +18 -0
- package/dist/components/features/emailBuilder/ui/rich-text-editor/pickers/RichTextColorPicker.vue.d.ts +15 -0
- package/dist/components/features/emailBuilder/ui/visibility/SupportBadge.vue.d.ts +10 -0
- package/dist/components/features/emailBuilder/ui/visibility/VisibilityPopover.vue.d.ts +45 -0
- package/dist/components/ui/ConfirmDialog.vue.d.ts +3 -0
- package/dist/components/ui/Icon.vue.d.ts +33 -0
- package/dist/components/ui/InfoDialog.vue.d.ts +12 -0
- package/dist/components/ui/Loading.vue.d.ts +6 -0
- package/dist/components/ui/ShadowSafeToast.vue.d.ts +3 -0
- package/dist/components/ui/primitives/Button.vue.d.ts +23 -0
- package/dist/components/ui/primitives/DatePicker.vue.d.ts +16 -0
- package/dist/components/ui/primitives/Dialog.vue.d.ts +34 -0
- package/dist/components/ui/primitives/InputText.vue.d.ts +29 -0
- package/dist/components/ui/primitives/Message.vue.d.ts +20 -0
- package/dist/components/ui/primitives/Select.vue.d.ts +22 -0
- package/dist/composables/emailBuilder/components/useSystemRows.d.ts +22 -0
- package/dist/composables/emailBuilder/core/ui/useLayerHoverScroll.d.ts +10 -10
- package/dist/composables/emailBuilder/core/useEmailBuilder.d.ts +18 -0
- package/dist/composables/emailBuilder/export/logic/espLogicWrapper.d.ts +4 -4
- package/dist/composables/emailBuilder/export/targets/templateSnapshot.d.ts +24 -0
- package/dist/composables/emailBuilder/persistence/useEmailBuilderPersistence.d.ts +1 -1
- package/dist/composables/system/useColorScheme.d.ts +16 -0
- package/dist/editor.css +1072 -682
- package/dist/element-C2ZH0Z_i.js +86561 -0
- package/dist/element-scoped-styles.css +1072 -682
- package/dist/element.d.ts +1 -1
- package/dist/element.js +5 -2
- package/dist/estree-DBJlF9un.js +4876 -0
- package/dist/html-3PMDtB0V.js +3123 -0
- package/dist/index-DhFg3uKs.js +75864 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +16 -67053
- package/dist/init.d.ts +95 -2
- package/dist/init.js +166 -122
- package/dist/standalone-DKWMQftY.js +2391 -0
- package/dist/theme.d.ts +68 -17
- package/dist/types/assistant.d.ts +56 -0
- package/dist/typescript-l6-4tT8s.js +13240 -0
- package/package.json +6 -3
- package/dist/RowPreviewLegacyComponent-CXsY4P-R.js +0 -439
- package/dist/RowPreviewLegacyComponent-yjHSkZLz.js +0 -439
- package/dist/RowPreviewRow-CBfAnQ6o.js +0 -107
- package/dist/RowPreviewRow-CeowK6Q_.js +0 -107
- package/dist/composables/emailBuilder/transform/pipeline/optimizeAI.d.ts +0 -125
- package/dist/element-CMhqxYnE.js +0 -67099
- package/dist/estree-B67dfAo1.js +0 -7989
- package/dist/html-DGrfikay.js +0 -7353
- package/dist/standalone-Bd2oQFm3.js +0 -3639
- package/dist/typescript-C_Ru9PRN.js +0 -23184
- package/dist/vue.runtime.esm-bundler-CfYyFhW6.js +0 -9097
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maildeno/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
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",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
24
|
"README.md",
|
|
25
|
+
"CHANGELOG.md",
|
|
25
26
|
"LICENSE"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
@@ -29,7 +30,9 @@
|
|
|
29
30
|
"dev:element": "vite build --config vite.config.element.ts --watch",
|
|
30
31
|
"build": "vite build && vite build --config vite.config.element.ts",
|
|
31
32
|
"typecheck": "vue-tsc -p tsconfig.json --noEmit && tsc -p tsconfig.node.json --noEmit",
|
|
32
|
-
"prepublishOnly": "npm run typecheck && npm run build"
|
|
33
|
+
"prepublishOnly": "npm run typecheck && npm run build",
|
|
34
|
+
"format": "prettier --write \"src/**/*.{ts,vue}\"",
|
|
35
|
+
"format:check": "prettier --check \"src/**/*.{ts,vue}\""
|
|
33
36
|
},
|
|
34
37
|
"sideEffects": [
|
|
35
38
|
"**/*.css"
|
|
@@ -96,4 +99,4 @@
|
|
|
96
99
|
"vite-plugin-dts": "^5.0.3",
|
|
97
100
|
"vue-tsc": "^3.3.11"
|
|
98
101
|
}
|
|
99
|
-
}
|
|
102
|
+
}
|
|
@@ -1,439 +0,0 @@
|
|
|
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 };
|