@useinsider/guido 1.0.0-beta.dbd0bad → 1.0.0-beta.de03990
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/README.md +159 -23
- package/dist/@types/generic.d.ts +22 -1
- package/dist/components/Guido.vue.d.ts +11 -1
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +73 -34
- package/dist/components/organisms/base/Toaster.vue.d.ts +2 -0
- package/dist/components/organisms/base/Toaster.vue.js +17 -0
- package/dist/components/organisms/base/Toaster.vue2.js +15 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +31 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +25 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +10 -8
- package/dist/components/organisms/header/MiddleSlot.vue.js +5 -5
- package/dist/components/organisms/header/MiddleSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -10
- package/dist/components/organisms/header/RightSlot.vue2.js +31 -15
- package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
- package/dist/components/organisms/header/ViewOptions.vue2.js +30 -10
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +34 -16
- package/dist/components/wrappers/WpModal.vue.d.ts +65 -0
- package/dist/components/wrappers/WpModal.vue.js +27 -0
- package/dist/components/wrappers/WpModal.vue2.js +22 -0
- package/dist/composables/useActionsApi.d.ts +2 -0
- package/dist/composables/useActionsApi.js +62 -36
- package/dist/composables/useCodeEditorApi.d.ts +4 -0
- package/dist/composables/useCodeEditorApi.js +11 -0
- package/dist/composables/useConfig.d.ts +4 -0
- package/dist/composables/useConfig.js +7 -0
- package/dist/composables/useDebounce.d.ts +4 -0
- package/dist/composables/useDebounce.js +12 -0
- package/dist/composables/useExport.js +6 -6
- package/dist/composables/useGuidoActions.d.ts +46 -0
- package/dist/composables/useGuidoActions.js +37 -0
- package/dist/composables/useHtmlCompiler.js +9 -8
- package/dist/composables/usePreviewMode.d.ts +5 -0
- package/dist/composables/usePreviewMode.js +31 -0
- package/dist/composables/useProvideInject.d.ts +14 -0
- package/dist/composables/useProvideInject.js +17 -0
- package/dist/composables/useResponsivePreview.d.ts +5 -0
- package/dist/composables/useResponsivePreview.js +86 -0
- package/dist/composables/useStripo.js +27 -20
- package/dist/composables/useToaster.d.ts +1 -16
- package/dist/composables/useToaster.js +23 -30
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +4 -4
- package/dist/enums/defaults.js +14 -5
- package/dist/enums/preview.d.ts +13 -0
- package/dist/enums/preview.js +23 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +13 -15
- package/dist/guido.css +1 -1
- package/dist/mock/api/default-template.d.ts +2 -0
- package/dist/node_modules/lodash-es/_Stack.js +18 -0
- package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
- package/dist/node_modules/lodash-es/_apply.js +16 -0
- package/dist/node_modules/lodash-es/_arrayLikeKeys.js +19 -0
- package/dist/node_modules/lodash-es/_assignMergeValue.js +8 -0
- package/dist/node_modules/lodash-es/_assignValue.js +10 -0
- package/dist/node_modules/lodash-es/_baseAssignValue.js +12 -0
- package/dist/node_modules/lodash-es/_baseCreate.js +17 -0
- package/dist/node_modules/lodash-es/_baseFor.js +5 -0
- package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
- package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
- package/dist/node_modules/lodash-es/_baseKeysIn.js +15 -0
- package/dist/node_modules/lodash-es/_baseMerge.js +20 -0
- package/dist/node_modules/lodash-es/_baseMergeDeep.js +31 -0
- package/dist/node_modules/lodash-es/_baseRest.js +9 -0
- package/dist/node_modules/lodash-es/_baseSetToString.js +14 -0
- package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
- package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
- package/dist/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
- package/dist/node_modules/lodash-es/_cloneBuffer.js +9 -0
- package/dist/node_modules/lodash-es/_cloneTypedArray.js +8 -0
- package/dist/node_modules/lodash-es/_copyArray.js +9 -0
- package/dist/node_modules/lodash-es/_copyObject.js +14 -0
- package/dist/node_modules/lodash-es/_createAssigner.js +15 -0
- package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
- package/dist/node_modules/lodash-es/_defineProperty.js +11 -0
- package/dist/node_modules/lodash-es/_getPrototype.js +5 -0
- package/dist/node_modules/lodash-es/_initCloneObject.js +9 -0
- package/dist/node_modules/lodash-es/_isIndex.js +8 -0
- package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
- package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
- package/dist/node_modules/lodash-es/_nativeKeysIn.js +10 -0
- package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
- package/dist/node_modules/lodash-es/_overArg.js +8 -0
- package/dist/node_modules/lodash-es/_overRest.js +15 -0
- package/dist/node_modules/lodash-es/_safeGet.js +7 -0
- package/dist/node_modules/lodash-es/_setToString.js +6 -0
- package/dist/node_modules/lodash-es/_shortOut.js +16 -0
- package/dist/node_modules/lodash-es/_stackClear.js +7 -0
- package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
- package/dist/node_modules/lodash-es/_stackGet.js +6 -0
- package/dist/node_modules/lodash-es/_stackHas.js +6 -0
- package/dist/node_modules/lodash-es/_stackSet.js +17 -0
- package/dist/node_modules/lodash-es/constant.js +8 -0
- package/dist/node_modules/lodash-es/identity.js +6 -0
- package/dist/node_modules/lodash-es/isArguments.js +10 -0
- package/dist/node_modules/lodash-es/isArray.js +4 -0
- package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
- package/dist/node_modules/lodash-es/isArrayLikeObject.js +8 -0
- package/dist/node_modules/lodash-es/isBuffer.js +6 -0
- package/dist/node_modules/lodash-es/isLength.js +7 -0
- package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
- package/dist/node_modules/lodash-es/isPlainObject.js +16 -0
- package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
- package/dist/node_modules/lodash-es/keysIn.js +9 -0
- package/dist/node_modules/lodash-es/merge.js +8 -0
- package/dist/node_modules/lodash-es/stubFalse.js +6 -0
- package/dist/node_modules/lodash-es/toPlainObject.js +8 -0
- package/dist/services/stripoApi.d.ts +2 -1
- package/dist/services/stripoApi.js +27 -7
- package/dist/static/assets/inbox-mockup.svg.js +4 -0
- package/dist/static/assets/phone-mockup.svg.js +4 -0
- package/dist/stores/dynamic-content.d.ts +27 -0
- package/dist/stores/dynamic-content.js +23 -0
- package/dist/stores/preview.d.ts +46 -0
- package/dist/stores/preview.js +53 -0
- package/dist/stores/toaster.d.ts +25 -0
- package/dist/stores/toaster.js +28 -0
- package/dist/utils/arrayUtil.d.ts +1 -0
- package/dist/utils/arrayUtil.js +10 -0
- package/dist/utils/genericUtil.d.ts +2 -0
- package/dist/utils/genericUtil.js +7 -0
- package/dist/utils/tooltipUtils.d.ts +1 -1
- package/dist/utils/tooltipUtils.js +8 -6
- package/package.json +1 -1
- package/dist/composables/useTemplates.d.ts +0 -5
- package/dist/composables/useTemplates.js +0 -27
- package/dist/static/templates/default/index.html.js +0 -5
- package/dist/static/templates/default/style.css.js +0 -119
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { useDebounce as p } from "./useDebounce.js";
|
|
2
|
+
import { ResponsivePreviewRegex as c, ResponsivePreviewSelectors as v, ResponsivePreviewConfig as a } from "../enums/preview.js";
|
|
3
|
+
let i = null, l = null;
|
|
4
|
+
const { debounce: y } = p(), h = (t) => {
|
|
5
|
+
if (!t)
|
|
6
|
+
return null;
|
|
7
|
+
const e = t.match(c.TABLE_WIDTH);
|
|
8
|
+
if (!e)
|
|
9
|
+
return null;
|
|
10
|
+
const n = Number(e[1]);
|
|
11
|
+
return Number.isNaN(n) ? null : n;
|
|
12
|
+
}, w = (t) => Array.from(t.querySelectorAll("table[width]")).reduce((e, n) => {
|
|
13
|
+
const o = h(n.getAttribute("width"));
|
|
14
|
+
return o && o > e ? o : e;
|
|
15
|
+
}, 0), f = (t) => Array.from(t.querySelectorAll('[style*="width"]')).reduce((e, n) => {
|
|
16
|
+
const r = (n.getAttribute("style") || "").match(c.INLINE_WIDTH);
|
|
17
|
+
if (!r)
|
|
18
|
+
return e;
|
|
19
|
+
const s = Number(r[1]);
|
|
20
|
+
return !Number.isNaN(s) && s > e ? s : e;
|
|
21
|
+
}, 0), W = (t) => v.CONTAINERS.reduce((e, n) => {
|
|
22
|
+
const o = t.querySelector(n);
|
|
23
|
+
if (!o)
|
|
24
|
+
return e;
|
|
25
|
+
const r = Math.max(o.offsetWidth, o.scrollWidth);
|
|
26
|
+
return r > e ? r : e;
|
|
27
|
+
}, 0), E = (t) => {
|
|
28
|
+
const e = {
|
|
29
|
+
maxTableWidth: w(t),
|
|
30
|
+
maxInlineWidth: f(t),
|
|
31
|
+
maxContainerWidth: W(t)
|
|
32
|
+
}, { maxTableWidth: n, maxInlineWidth: o, maxContainerWidth: r } = e;
|
|
33
|
+
return Math.max(n, o, r) || a.DEFAULT_WIDTH;
|
|
34
|
+
}, b = (t) => {
|
|
35
|
+
const { documentElement: e, body: n } = t;
|
|
36
|
+
e.style.setProperty("overflow-x", "visible", "important"), n.style.setProperty("visibility", "visible", "important");
|
|
37
|
+
}, g = (t) => {
|
|
38
|
+
const { documentElement: e, body: n } = t;
|
|
39
|
+
e.style.removeProperty("transform"), e.style.removeProperty("transform-origin"), e.style.removeProperty("height"), n.style.removeProperty("overflow-x");
|
|
40
|
+
}, S = (t) => {
|
|
41
|
+
const { targetWidth: e, deviceWidth: n, minScale: o, maxScale: r } = t, s = n / e;
|
|
42
|
+
return Math.min(Math.max(s, o), r);
|
|
43
|
+
}, P = (t, e) => {
|
|
44
|
+
const n = E(t), o = S({
|
|
45
|
+
targetWidth: n,
|
|
46
|
+
deviceWidth: e,
|
|
47
|
+
minScale: a.MIN_SCALE,
|
|
48
|
+
maxScale: 1
|
|
49
|
+
}), { documentElement: r, body: s } = t;
|
|
50
|
+
r.style.setProperty("height", "100%", "important"), r.style.setProperty("transform", `scale(${o})`, "important"), r.style.setProperty("transform-origin", "top left", "important"), s.style.setProperty("overflow-x", "hidden", "important");
|
|
51
|
+
}, u = (t) => {
|
|
52
|
+
const e = t.querySelector('meta[name="viewport"]');
|
|
53
|
+
if (!e)
|
|
54
|
+
return !1;
|
|
55
|
+
const n = e.getAttribute("content") || "";
|
|
56
|
+
return c.META_VIEWPORT.test(n);
|
|
57
|
+
}, R = (t) => t.clientWidth || t.getBoundingClientRect().width || 375, d = (t) => {
|
|
58
|
+
const e = t.contentWindow;
|
|
59
|
+
l && e && e.removeEventListener("resize", l), i && window.removeEventListener("resize", i), l = null, i = null;
|
|
60
|
+
}, x = (t, e) => {
|
|
61
|
+
const n = t.contentWindow;
|
|
62
|
+
if (!n)
|
|
63
|
+
return;
|
|
64
|
+
d(t);
|
|
65
|
+
const o = () => y(e, a.RESIZE_DEBOUNCE_MS);
|
|
66
|
+
l = o, n.addEventListener("resize", l), i = o, window.addEventListener("resize", i);
|
|
67
|
+
}, M = () => ({
|
|
68
|
+
setupResponsivePreview: (n) => {
|
|
69
|
+
const o = n.contentDocument, r = n.contentWindow;
|
|
70
|
+
if (!o || !r)
|
|
71
|
+
return;
|
|
72
|
+
b(o);
|
|
73
|
+
const s = () => {
|
|
74
|
+
const m = R(n);
|
|
75
|
+
u(o) ? g(o) : P(o, m);
|
|
76
|
+
};
|
|
77
|
+
s(), x(n, s);
|
|
78
|
+
},
|
|
79
|
+
tearDownEmailResponsiveFit: (n) => {
|
|
80
|
+
d(n);
|
|
81
|
+
},
|
|
82
|
+
hasResponsiveMetaViewport: u
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
M as useResponsivePreview
|
|
86
|
+
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useCustomInterfaceAppearance as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { displayConditions as
|
|
5
|
-
import
|
|
6
|
-
import { useStripoApi as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { useActionsApi as g } from "./useActionsApi.js";
|
|
2
|
+
import { useCustomInterfaceAppearance as f } from "./useCustomInterfaceAppearance.js";
|
|
3
|
+
import { useToaster as y } from "./useToaster.js";
|
|
4
|
+
import { displayConditions as C } from "../enums/displayConditions.js";
|
|
5
|
+
import E from "../extensions/DynamicContent/extension.js";
|
|
6
|
+
import { useStripoApi as S } from "../services/stripoApi.js";
|
|
7
|
+
import { useEditorStore as w } from "../stores/editor.js";
|
|
8
|
+
import { dynamicContentToMergeTags as b } from "../utils/genericUtil.js";
|
|
9
|
+
const M = (d) => {
|
|
10
|
+
const { handleError: c } = y(), { getToken: a, getCustomFonts: u } = S(), l = (e, r = []) => {
|
|
11
|
+
const i = w(), { html: t, css: s, forceRecreate: p } = e;
|
|
11
12
|
window.UIEditor.initEditor(
|
|
12
13
|
document.querySelector("#guido-editor"),
|
|
13
14
|
{
|
|
14
|
-
metadata:
|
|
15
|
+
metadata: d,
|
|
15
16
|
html: t,
|
|
16
17
|
css: s,
|
|
18
|
+
forceRecreate: p,
|
|
17
19
|
locale: "en",
|
|
18
20
|
undoButtonSelector: "#guido__undo-button",
|
|
19
21
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -29,27 +31,32 @@ const x = (a) => {
|
|
|
29
31
|
`,
|
|
30
32
|
conditionsEnabled: !0,
|
|
31
33
|
customConditionsEnabled: !0,
|
|
32
|
-
conditionCategories:
|
|
34
|
+
conditionCategories: C,
|
|
33
35
|
messageSettingsEnabled: !1,
|
|
34
36
|
editorFonts: {
|
|
35
37
|
showDefaultStandardFonts: !0,
|
|
36
38
|
showDefaultNotStandardFonts: !0,
|
|
37
39
|
customFonts: r
|
|
38
40
|
},
|
|
41
|
+
mergeTags: [
|
|
42
|
+
{
|
|
43
|
+
entries: b(d.preselectedDynamicContentList)
|
|
44
|
+
}
|
|
45
|
+
],
|
|
39
46
|
async onTokenRefreshRequest(o) {
|
|
40
47
|
try {
|
|
41
|
-
const n = await
|
|
48
|
+
const n = await a();
|
|
42
49
|
o(n);
|
|
43
50
|
} catch (n) {
|
|
44
|
-
|
|
51
|
+
c(n, "Failed to refresh token");
|
|
45
52
|
}
|
|
46
53
|
},
|
|
47
54
|
onTemplateLoaded() {
|
|
48
55
|
try {
|
|
49
|
-
const { importCss: o } =
|
|
56
|
+
const { importCss: o } = f(), { activateCustomViewStyles: n } = g();
|
|
50
57
|
o(), n();
|
|
51
58
|
} catch (o) {
|
|
52
|
-
|
|
59
|
+
c(o, "Failed to load custom interface appearance");
|
|
53
60
|
}
|
|
54
61
|
},
|
|
55
62
|
onCodeEditorVisibilityChanged(o) {
|
|
@@ -62,10 +69,10 @@ const x = (a) => {
|
|
|
62
69
|
i.isVersionHistoryOpen = o;
|
|
63
70
|
},
|
|
64
71
|
ignoreClickOutsideSelectors: ["#guido-dynamic-content-modal"],
|
|
65
|
-
extensions: [
|
|
72
|
+
extensions: [E]
|
|
66
73
|
}
|
|
67
74
|
);
|
|
68
|
-
},
|
|
75
|
+
}, m = (e) => new Promise((r, i) => {
|
|
69
76
|
if (document.getElementById("UiEditorScript")) {
|
|
70
77
|
e(), r();
|
|
71
78
|
return;
|
|
@@ -79,12 +86,12 @@ const x = (a) => {
|
|
|
79
86
|
}, document.body.appendChild(t);
|
|
80
87
|
});
|
|
81
88
|
return { initPlugin: async (e) => {
|
|
82
|
-
await
|
|
89
|
+
await m(async () => {
|
|
83
90
|
const r = await u();
|
|
84
91
|
l(e, r);
|
|
85
92
|
});
|
|
86
93
|
} };
|
|
87
94
|
};
|
|
88
95
|
export {
|
|
89
|
-
|
|
96
|
+
M as useStripo
|
|
90
97
|
};
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export type ToasterOptions = {
|
|
3
|
-
type?: ToasterType;
|
|
4
|
-
message: string;
|
|
5
|
-
actionButton?: {
|
|
6
|
-
text: string;
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
1
|
+
import type { ToasterOptions } from '@@/Types/toaster';
|
|
10
2
|
export declare const useToaster: () => {
|
|
11
|
-
isToasterVisible: import("vue").Ref<boolean>;
|
|
12
|
-
toasterMessage: import("vue").Ref<string>;
|
|
13
|
-
toasterType: import("vue").Ref<ToasterType>;
|
|
14
|
-
toasterActionButton: import("vue").Ref<({
|
|
15
|
-
text: string;
|
|
16
|
-
onClick: () => void;
|
|
17
|
-
} | undefined)[]>;
|
|
18
3
|
showToaster: (options?: ToasterOptions) => void;
|
|
19
4
|
hideToaster: () => void;
|
|
20
5
|
handleError: (error: unknown, context: string) => void;
|
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useToasterStore as u } from "../stores/toaster.js";
|
|
2
|
+
import { watch as c, onUnmounted as T } from "vue";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const t = u();
|
|
5
|
+
let s = null;
|
|
6
|
+
const o = () => {
|
|
7
|
+
s && (clearTimeout(s), s = null);
|
|
8
|
+
};
|
|
9
|
+
function r(e = { message: "" }) {
|
|
10
|
+
o(), t.hideToaster(), t.showToaster(e);
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
12
|
+
function n() {
|
|
13
|
+
o(), t.hideToaster();
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function a(e, i) {
|
|
15
16
|
const m = e instanceof Error ? e.message : String(e);
|
|
16
|
-
|
|
17
|
-
type: "error",
|
|
18
|
-
message: `${r}: ${m}`
|
|
19
|
-
});
|
|
17
|
+
r({ type: "alert", message: `${i}: ${m}` });
|
|
20
18
|
}
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
toasterActionButton: n,
|
|
30
|
-
showToaster: l,
|
|
31
|
-
hideToaster: u,
|
|
32
|
-
handleError: f
|
|
33
|
-
};
|
|
19
|
+
return c(
|
|
20
|
+
() => t.shouldAutoHide,
|
|
21
|
+
(e) => {
|
|
22
|
+
o(), e && (s = setTimeout(() => {
|
|
23
|
+
t.hideToaster(), o();
|
|
24
|
+
}, 6e3));
|
|
25
|
+
}
|
|
26
|
+
), T(o), { showToaster: r, hideToaster: n, handleError: a };
|
|
34
27
|
};
|
|
35
28
|
export {
|
|
36
|
-
|
|
29
|
+
d as useToaster
|
|
37
30
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import memoize from "../node_modules/lodash-es/memoize.js";
|
|
2
2
|
import { ref } from "vue";
|
|
3
|
+
import { useConfig } from "./useConfig.js";
|
|
3
4
|
const useTranslations = () => {
|
|
4
|
-
const translations = ref(eval(
|
|
5
|
+
const { config } = useConfig(), translations = ref(eval(config.translationsPath)), trans = (n, t) => {
|
|
5
6
|
const r = translations.value[n];
|
|
6
7
|
return r ? t ? Object.entries(t).reduce(
|
|
7
|
-
(e, [o,
|
|
8
|
+
(e, [o, s]) => e.replace(new RegExp(`{${o}}`, "g"), String(s)),
|
|
8
9
|
r
|
|
9
10
|
) : r : (console.warn(`Translation key not found: ${n}`), n);
|
|
10
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useVersionHistoryStore as p } from "../stores/version-history.js";
|
|
2
2
|
import { useToaster as c } from "./useToaster.js";
|
|
3
|
-
const
|
|
3
|
+
const V = () => {
|
|
4
4
|
const i = p(), { showToaster: s } = c(), t = (e) => {
|
|
5
5
|
i.$reset(), i.updateState(e);
|
|
6
6
|
}, n = () => {
|
|
@@ -23,7 +23,7 @@ const l = () => {
|
|
|
23
23
|
window.StripoEditorApi.versionHistoryApi.previewVersion(e, (o) => {
|
|
24
24
|
const r = o instanceof Error ? o.message : String(o);
|
|
25
25
|
s({
|
|
26
|
-
type: "
|
|
26
|
+
type: "alert",
|
|
27
27
|
message: `Error compiling email: ${r}`
|
|
28
28
|
});
|
|
29
29
|
});
|
|
@@ -40,7 +40,7 @@ const l = () => {
|
|
|
40
40
|
(o) => {
|
|
41
41
|
const r = o instanceof Error ? o.message : String(o);
|
|
42
42
|
s({
|
|
43
|
-
type: "
|
|
43
|
+
type: "alert",
|
|
44
44
|
message: `Error compiling email: ${r}`
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -49,5 +49,5 @@ const l = () => {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
export {
|
|
52
|
-
|
|
52
|
+
V as useVersionHistoryApi
|
|
53
53
|
};
|
package/dist/enums/defaults.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
const
|
|
2
|
-
translationsPath: "window.trans.en"
|
|
3
|
-
|
|
1
|
+
const e = {
|
|
2
|
+
translationsPath: "window.trans.en",
|
|
3
|
+
emailHeader: {
|
|
4
|
+
senderName: "",
|
|
5
|
+
subject: ""
|
|
6
|
+
},
|
|
7
|
+
features: {
|
|
8
|
+
dynamicContent: !0,
|
|
9
|
+
saveAsTemplate: !0,
|
|
10
|
+
versionHistory: !0
|
|
11
|
+
}
|
|
12
|
+
}, t = "newsletter", n = "Guido User";
|
|
4
13
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
14
|
+
e as DefaultGuidoConfig,
|
|
15
|
+
t as DefaultProductType,
|
|
7
16
|
n as DefaultUsername
|
|
8
17
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ResponsivePreviewConfig: {
|
|
2
|
+
DEFAULT_WIDTH: number;
|
|
3
|
+
MIN_SCALE: number;
|
|
4
|
+
RESIZE_DEBOUNCE_MS: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const ResponsivePreviewRegex: {
|
|
7
|
+
INLINE_WIDTH: RegExp;
|
|
8
|
+
TABLE_WIDTH: RegExp;
|
|
9
|
+
META_VIEWPORT: RegExp;
|
|
10
|
+
};
|
|
11
|
+
export declare const ResponsivePreviewSelectors: {
|
|
12
|
+
CONTAINERS: string[];
|
|
13
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
DEFAULT_WIDTH: 600,
|
|
3
|
+
MIN_SCALE: 0.2,
|
|
4
|
+
RESIZE_DEBOUNCE_MS: 100
|
|
5
|
+
}, i = {
|
|
6
|
+
INLINE_WIDTH: /width\s*:\s*(\d+(\.\d+)?)px/i,
|
|
7
|
+
TABLE_WIDTH: /^(\d+(\.\d+)?)(px)?$/i,
|
|
8
|
+
META_VIEWPORT: /width\s*=\s*device-width/i
|
|
9
|
+
}, n = {
|
|
10
|
+
CONTAINERS: [
|
|
11
|
+
".wrapper",
|
|
12
|
+
".container",
|
|
13
|
+
"#wrapper",
|
|
14
|
+
"#container",
|
|
15
|
+
"[data-email-container]",
|
|
16
|
+
'[role="presentation"]'
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
e as ResponsivePreviewConfig,
|
|
21
|
+
i as ResponsivePreviewRegex,
|
|
22
|
+
n as ResponsivePreviewSelectors
|
|
23
|
+
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (i, t, e) =>
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var m = (i, t, e) => t in i ? o(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var r = (i, t, e) => m(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { dynamicContentToMergeTags as l } from "../../utils/genericUtil.js";
|
|
4
5
|
import { d as n } from "../../_virtual/index.js";
|
|
5
|
-
import { ExternalMergeTagsLibrary as
|
|
6
|
-
const a = "external-dynamic-content-ui-element",
|
|
7
|
-
class
|
|
6
|
+
import { ExternalMergeTagsLibrary as g } from "./dynamic-content-modal.js";
|
|
7
|
+
const a = "external-dynamic-content-ui-element", c = "button-add-dynamic-content";
|
|
8
|
+
class p extends n.UIElementTagRegistry {
|
|
8
9
|
registerUiElements(t) {
|
|
9
10
|
t[n.UIElementType.MERGETAGS] = a;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
|
-
class
|
|
13
|
+
class u extends n.UIElement {
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
16
|
r(this, "mergeTagsButton", null);
|
|
@@ -33,13 +34,10 @@ class b extends n.UIElement {
|
|
|
33
34
|
this.openMergeTagLibrary();
|
|
34
35
|
}
|
|
35
36
|
openMergeTagLibrary() {
|
|
36
|
-
this.mergeTagsLibrary || (this.mergeTagsLibrary = new
|
|
37
|
+
this.mergeTagsLibrary || (this.mergeTagsLibrary = new g()), this.mergeTagsLibrary.openMergeTagsLibrary(
|
|
37
38
|
this.selectedDynamicContent,
|
|
38
39
|
(e) => {
|
|
39
|
-
this.api.onValueChanged(
|
|
40
|
-
label: e.fallback ? `${e.text} | ${e.fallback}` : e.text,
|
|
41
|
-
value: e.fallback ? `{{${e.value}|${e.fallback}}}` : `{{${e.value}}}`
|
|
42
|
-
});
|
|
40
|
+
this.api.onValueChanged(l([e])[0]);
|
|
43
41
|
}
|
|
44
42
|
);
|
|
45
43
|
}
|
|
@@ -49,7 +47,7 @@ class b extends n.UIElement {
|
|
|
49
47
|
<${n.UIElementType.BUTTON}
|
|
50
48
|
id="guido__btn-add-dynamic-content"
|
|
51
49
|
class="btn btn-primary"
|
|
52
|
-
${n.UEAttr.BUTTON.name}="${
|
|
50
|
+
${n.UEAttr.BUTTON.name}="${c}">
|
|
53
51
|
<${n.UIElementType.ICON} src="plus" class="icon icon-button color-primary">
|
|
54
52
|
</${n.UIElementType.ICON}>
|
|
55
53
|
${this.api.translate("Add Dynamic Content")}
|
|
@@ -58,6 +56,6 @@ class b extends n.UIElement {
|
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
p as DynamicContentTagRegistry,
|
|
60
|
+
u as DynamicContentUiElementExtension
|
|
63
61
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-
|
|
1
|
+
.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}[data-v-421ffc13] .guido__verion-history-view-option-selection-desktop svg,[data-v-421ffc13] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-421ffc13] .in-segments-wrapper__button_selected,[data-v-421ffc13] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-421ffc13] .in-tooltip-wrapper__icon{cursor:pointer}[data-v-aad05c54] .guido__view-option-selection-desktop svg,[data-v-aad05c54] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-aad05c54] .in-segments-wrapper__button_selected,[data-v-aad05c54] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-aad05c54] .in-tooltip-wrapper__icon{cursor:pointer}.guido-editor__wrapper[data-v-09c28ccc],.guido-editor__container[data-v-09c28ccc]{width:100%;height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import r from "./_ListCache.js";
|
|
2
|
+
import a from "./_stackClear.js";
|
|
3
|
+
import p from "./_stackDelete.js";
|
|
4
|
+
import s from "./_stackGet.js";
|
|
5
|
+
import i from "./_stackHas.js";
|
|
6
|
+
import m from "./_stackSet.js";
|
|
7
|
+
function t(o) {
|
|
8
|
+
var e = this.__data__ = new r(o);
|
|
9
|
+
this.size = e.size;
|
|
10
|
+
}
|
|
11
|
+
t.prototype.clear = a;
|
|
12
|
+
t.prototype.delete = p;
|
|
13
|
+
t.prototype.get = s;
|
|
14
|
+
t.prototype.has = i;
|
|
15
|
+
t.prototype.set = m;
|
|
16
|
+
export {
|
|
17
|
+
t as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function t(l, c, e) {
|
|
2
|
+
switch (e.length) {
|
|
3
|
+
case 0:
|
|
4
|
+
return l.call(c);
|
|
5
|
+
case 1:
|
|
6
|
+
return l.call(c, e[0]);
|
|
7
|
+
case 2:
|
|
8
|
+
return l.call(c, e[0], e[1]);
|
|
9
|
+
case 3:
|
|
10
|
+
return l.call(c, e[0], e[1], e[2]);
|
|
11
|
+
}
|
|
12
|
+
return l.apply(c, e);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
t as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import p from "./_baseTimes.js";
|
|
2
|
+
import g from "./isArguments.js";
|
|
3
|
+
import h from "./isArray.js";
|
|
4
|
+
import a from "./isBuffer.js";
|
|
5
|
+
import d from "./_isIndex.js";
|
|
6
|
+
import A from "./isTypedArray.js";
|
|
7
|
+
function c(i, b) {
|
|
8
|
+
var t = h(i), f = !t && g(i), s = !t && !f && a(i), o = !t && !f && !s && A(i), n = t || f || s || o, e = n ? p(i.length, String) : [], m = e.length;
|
|
9
|
+
for (var r in i)
|
|
10
|
+
n && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
11
|
+
(r == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
12
|
+
s && (r == "offset" || r == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
13
|
+
o && (r == "buffer" || r == "byteLength" || r == "byteOffset") || // Skip index properties.
|
|
14
|
+
d(r, m)) || e.push(r);
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
c as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import t from "./_baseAssignValue.js";
|
|
2
|
+
import i from "./eq.js";
|
|
3
|
+
var s = Object.prototype, p = s.hasOwnProperty;
|
|
4
|
+
function l(r, a, o) {
|
|
5
|
+
var n = r[a];
|
|
6
|
+
(!(p.call(r, a) && i(n, o)) || o === void 0 && !(a in r)) && t(r, a, o);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
l as default
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import u from "./isObject.js";
|
|
2
|
+
var r = Object.create, c = /* @__PURE__ */ function() {
|
|
3
|
+
function e() {
|
|
4
|
+
}
|
|
5
|
+
return function(t) {
|
|
6
|
+
if (!u(t))
|
|
7
|
+
return {};
|
|
8
|
+
if (r)
|
|
9
|
+
return r(t);
|
|
10
|
+
e.prototype = t;
|
|
11
|
+
var n = new e();
|
|
12
|
+
return e.prototype = void 0, n;
|
|
13
|
+
};
|
|
14
|
+
}();
|
|
15
|
+
export {
|
|
16
|
+
c as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import e from "./_baseGetTag.js";
|
|
2
|
+
import r from "./isLength.js";
|
|
3
|
+
import o from "./isObjectLike.js";
|
|
4
|
+
var g = "[object Arguments]", b = "[object Array]", c = "[object Boolean]", j = "[object Date]", n = "[object Error]", T = "[object Function]", i = "[object Map]", y = "[object Number]", p = "[object Object]", A = "[object RegExp]", f = "[object Set]", u = "[object String]", m = "[object WeakMap]", s = "[object ArrayBuffer]", l = "[object DataView]", d = "[object Float32Array]", I = "[object Float64Array]", U = "[object Int8Array]", k = "[object Int16Array]", w = "[object Int32Array]", x = "[object Uint8Array]", B = "[object Uint8ClampedArray]", F = "[object Uint16Array]", M = "[object Uint32Array]", a = {};
|
|
5
|
+
a[d] = a[I] = a[U] = a[k] = a[w] = a[x] = a[B] = a[F] = a[M] = !0;
|
|
6
|
+
a[g] = a[b] = a[s] = a[c] = a[l] = a[j] = a[n] = a[T] = a[i] = a[y] = a[p] = a[A] = a[f] = a[u] = a[m] = !1;
|
|
7
|
+
function E(t) {
|
|
8
|
+
return o(t) && r(t.length) && !!a[e(t)];
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
E as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import a from "./isObject.js";
|
|
2
|
+
import i from "./_isPrototype.js";
|
|
3
|
+
import n from "./_nativeKeysIn.js";
|
|
4
|
+
var e = Object.prototype, p = e.hasOwnProperty;
|
|
5
|
+
function v(r) {
|
|
6
|
+
if (!a(r))
|
|
7
|
+
return n(r);
|
|
8
|
+
var s = i(r), o = [];
|
|
9
|
+
for (var t in r)
|
|
10
|
+
t == "constructor" && (s || !p.call(r, t)) || o.push(t);
|
|
11
|
+
return o;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
v as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import t from "./_Stack.js";
|
|
2
|
+
import d from "./_assignMergeValue.js";
|
|
3
|
+
import g from "./_baseFor.js";
|
|
4
|
+
import a from "./_baseMergeDeep.js";
|
|
5
|
+
import M from "./isObject.js";
|
|
6
|
+
import v from "./keysIn.js";
|
|
7
|
+
import x from "./_safeGet.js";
|
|
8
|
+
function D(f, r, e, n, i) {
|
|
9
|
+
f !== r && g(r, function(o, m) {
|
|
10
|
+
if (i || (i = new t()), M(o))
|
|
11
|
+
a(f, r, m, e, D, n, i);
|
|
12
|
+
else {
|
|
13
|
+
var p = n ? n(x(f, m), o, m + "", f, r, i) : void 0;
|
|
14
|
+
p === void 0 && (p = o), d(f, m, p);
|
|
15
|
+
}
|
|
16
|
+
}, v);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
D as default
|
|
20
|
+
};
|