@useinsider/guido 2.0.0-beta.2d132c0 → 2.0.0-beta.5ccd854
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/dist/@types/config/schemas.js +6 -4
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +57 -59
- package/dist/components/organisms/base/Toaster.vue.js +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +2 -2
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +6 -6
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/composables/useStripo.js +54 -55
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/itemsBlockMigrator.js +283 -0
- package/dist/extensions/Blocks/Items/block.js +39 -40
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +46 -49
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +28 -26
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +132 -127
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +58 -48
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +48 -58
- package/dist/extensions/Blocks/Items/store/items-block.js +2 -2
- package/dist/extensions/Blocks/Items/template.js +296 -123
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +172 -0
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +11 -20
- package/dist/extensions/Blocks/Recommendation/control.js +1 -1
- package/dist/extensions/Blocks/common-control.js +64 -53
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +366 -287
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/config/migrator/itemsBlockMigrator.d.ts +6 -0
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -4
- package/dist/src/extensions/Blocks/Items/template.d.ts +20 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +71 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +13 -8
- package/dist/src/stores/config.d.ts +17 -0
- package/dist/static/styles/components/narrow-panel.css.js +0 -10
- package/package.json +3 -3
- package/dist/package.json.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as
|
|
1
|
+
import { object as o, number as p, optional as e, string as t, pipe as m, picklist as n, boolean as c, array as a, minLength as u, literal as r, custom as b, variant as S } from "../../node_modules/valibot/dist/index.js";
|
|
2
2
|
const i = {
|
|
3
3
|
/** Promotional/marketing emails */
|
|
4
4
|
PROMOTIONAL: 1,
|
|
@@ -103,7 +103,9 @@ const i = {
|
|
|
103
103
|
/** Enable display conditions */
|
|
104
104
|
displayConditions: e(c(), !0),
|
|
105
105
|
/** Enable unsubscribe block */
|
|
106
|
-
unsubscribe: e(c(), !0)
|
|
106
|
+
unsubscribe: e(c(), !0),
|
|
107
|
+
/** Disable modules panel in the editor */
|
|
108
|
+
modulesDisabled: e(c(), !1)
|
|
107
109
|
}), f = n([
|
|
108
110
|
"amp-accordion",
|
|
109
111
|
"amp-carousel",
|
|
@@ -171,8 +173,8 @@ const i = {
|
|
|
171
173
|
...l.entries,
|
|
172
174
|
type: r("custom"),
|
|
173
175
|
/** Custom processor function */
|
|
174
|
-
processor:
|
|
175
|
-
(
|
|
176
|
+
processor: b(
|
|
177
|
+
(d) => typeof d == "function",
|
|
176
178
|
"processor must be a function"
|
|
177
179
|
)
|
|
178
180
|
}), B = S("type", [
|
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { provideGuidoActions as
|
|
3
|
-
import { usePartner as
|
|
4
|
-
import { useStripo as
|
|
5
|
-
import { useTimerClone as
|
|
6
|
-
import { migrate as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import { useConfigStore as
|
|
15
|
-
import { useDynamicContentStore as
|
|
16
|
-
import { useEditorStore as
|
|
17
|
-
import { usePreviewStore as
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
const Pe = /* @__PURE__ */ q({
|
|
1
|
+
import { defineComponent as x, defineAsyncComponent as P, ref as B, computed as U, watch as N, onMounted as z, onUnmounted as K } from "vue";
|
|
2
|
+
import { provideGuidoActions as M } from "../composables/useGuidoActions.js";
|
|
3
|
+
import { usePartner as j } from "../composables/usePartner.js";
|
|
4
|
+
import { useStripo as q } from "../composables/useStripo.js";
|
|
5
|
+
import { useTimerClone as J } from "../composables/useTimerClone.js";
|
|
6
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
7
|
+
import Q from "./organisms/base/Toaster.vue.js";
|
|
8
|
+
import V from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
9
|
+
import X from "./organisms/header/HeaderWrapper.vue.js";
|
|
10
|
+
import Y from "./organisms/LoadingWrapper.vue.js";
|
|
11
|
+
import Z from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
12
|
+
import $ from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
13
|
+
import { useStripoApi as ee } from "../services/stripoApi.js";
|
|
14
|
+
import { useConfigStore as oe } from "../stores/config.js";
|
|
15
|
+
import { useDynamicContentStore as te } from "../stores/dynamic-content.js";
|
|
16
|
+
import { useEditorStore as ne } from "../stores/editor.js";
|
|
17
|
+
import { usePreviewStore as re } from "../stores/preview.js";
|
|
18
|
+
import { useUnsubscribeStore as ce } from "../stores/unsubscribe.js";
|
|
19
|
+
const Ee = /* @__PURE__ */ x({
|
|
21
20
|
__name: "Guido",
|
|
22
21
|
props: {
|
|
23
22
|
config: null
|
|
24
23
|
},
|
|
25
24
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
26
|
-
setup(
|
|
27
|
-
const
|
|
25
|
+
setup(_, { expose: I, emit: t }) {
|
|
26
|
+
const l = _, L = P(
|
|
28
27
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
29
|
-
),
|
|
28
|
+
), A = P(
|
|
30
29
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
31
|
-
), p =
|
|
32
|
-
n.init(
|
|
33
|
-
const
|
|
30
|
+
), p = B(), s = te(), u = ce(), n = oe();
|
|
31
|
+
n.init(l.config);
|
|
32
|
+
const i = ne(), F = re(), r = U(() => i.hasChanges), { isTestPartner: G } = j(), v = () => {
|
|
34
33
|
var e;
|
|
35
34
|
return (e = p.value) == null ? void 0 : e.handleSave(!0);
|
|
36
|
-
}, { templateId:
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
emailId:
|
|
40
|
-
userId:
|
|
41
|
-
username:
|
|
42
|
-
partnerName:
|
|
43
|
-
productType:
|
|
44
|
-
preselectedDynamicContentList:
|
|
35
|
+
}, { templateId: a, userId: y, partnerName: h, productType: f, username: b, template: o } = n, c = (o == null ? void 0 : o.html) || "", g = (o == null ? void 0 : o.css) || "", m = (o == null ? void 0 : o.preselectedDynamicContent) || [];
|
|
36
|
+
i.templateId = a;
|
|
37
|
+
const { initPlugin: S } = q({
|
|
38
|
+
emailId: a,
|
|
39
|
+
userId: y,
|
|
40
|
+
username: b,
|
|
41
|
+
partnerName: h,
|
|
42
|
+
productType: f,
|
|
43
|
+
preselectedDynamicContentList: m,
|
|
45
44
|
onReady: () => {
|
|
46
45
|
console.debug("guido:ready"), t("ready");
|
|
47
46
|
}
|
|
48
|
-
}), { getDefaultTemplate:
|
|
47
|
+
}), { getDefaultTemplate: w } = ee(), { cloneTimersOnSave: C, hasTimerBlocks: D } = J(), H = U(() => {
|
|
49
48
|
var e;
|
|
50
49
|
return !((e = n.ui) != null && e.showHeader);
|
|
51
50
|
});
|
|
52
|
-
|
|
51
|
+
M({
|
|
53
52
|
onBack: () => {
|
|
54
53
|
console.debug("guido:back"), t("back");
|
|
55
54
|
},
|
|
@@ -63,52 +62,51 @@ const Pe = /* @__PURE__ */ q({
|
|
|
63
62
|
console.debug("guido:test-email:click"), t("test-email:click");
|
|
64
63
|
}
|
|
65
64
|
});
|
|
66
|
-
const
|
|
67
|
-
console.debug("dynamic-content:close", e),
|
|
68
|
-
},
|
|
65
|
+
const E = (e) => {
|
|
66
|
+
console.debug("dynamic-content:close", e), s.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
67
|
+
}, k = () => {
|
|
69
68
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
70
69
|
};
|
|
71
|
-
|
|
70
|
+
N(() => r.value, () => {
|
|
72
71
|
t("on-change", r.value);
|
|
73
72
|
});
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
console.debug("dynamic-content:open",
|
|
73
|
+
const d = (e) => {
|
|
74
|
+
const T = e, { attribute: O, position: R } = T.detail;
|
|
75
|
+
console.debug("dynamic-content:open", T.detail), t("dynamic-content:open", O, R);
|
|
77
76
|
};
|
|
78
|
-
return
|
|
77
|
+
return z(async () => {
|
|
79
78
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
80
79
|
try {
|
|
81
|
-
|
|
80
|
+
u.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
|
|
82
81
|
let e = {
|
|
83
|
-
html:
|
|
84
|
-
css:
|
|
82
|
+
html: c && await W(c),
|
|
83
|
+
css: g,
|
|
85
84
|
forceRecreate: !0
|
|
86
85
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
87
86
|
};
|
|
88
|
-
e.html || (e = await
|
|
87
|
+
e.html || (e = await w(), e.html = await W(e.html)), D(e.html) && (e.html = await C(e.html)), await S(e), s.selectedDynamicContentList = m;
|
|
89
88
|
} catch (e) {
|
|
90
89
|
console.error("Failed to initialize Stripo editor:", e);
|
|
91
90
|
}
|
|
92
|
-
document.addEventListener("dynamic-content:open",
|
|
93
|
-
}),
|
|
94
|
-
|
|
95
|
-
c.value && (f.hideToaster(), (e = document.querySelector("#guido__toaster")) == null || e.remove()), c.value = !1, document.removeEventListener("dynamic-content:open", l);
|
|
91
|
+
document.addEventListener("dynamic-content:open", d);
|
|
92
|
+
}), K(() => {
|
|
93
|
+
document.removeEventListener("dynamic-content:open", d);
|
|
96
94
|
try {
|
|
97
95
|
window.UIEditor.removeEditor();
|
|
98
96
|
} catch {
|
|
99
97
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
100
98
|
}
|
|
101
99
|
n.reset();
|
|
102
|
-
}),
|
|
100
|
+
}), I({
|
|
103
101
|
dynamicContent: {
|
|
104
|
-
insert:
|
|
105
|
-
close:
|
|
102
|
+
insert: E,
|
|
103
|
+
close: k
|
|
106
104
|
},
|
|
107
105
|
hasChanges: r,
|
|
108
|
-
saveSilent:
|
|
109
|
-
}), { __sfc: !0, PreviewContainer:
|
|
106
|
+
saveSilent: v
|
|
107
|
+
}), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: p, dynamicContentStore: s, unsubscribeStore: u, props: l, configStore: n, editorStore: i, previewStore: F, hasChanges: r, isTestPartner: G, saveSilent: v, templateId: a, userId: y, partnerName: h, productType: f, username: b, templateConfig: o, html: c, css: g, preselectedDynamicContentList: m, emit: t, initPlugin: S, getDefaultTemplate: w, cloneTimersOnSave: C, hasTimerBlocks: D, noHeader: H, insertDynamicContent: E, closeDynamicContent: k, handleDynamicContentOpen: d, Toaster: Q, FilterSelectionDrawer: V, HeaderWrapper: X, LoadingWrapper: Y, SaveAsTemplateDrawer: Z, UnsubscribeWrapper: $ };
|
|
110
108
|
}
|
|
111
109
|
});
|
|
112
110
|
export {
|
|
113
|
-
|
|
111
|
+
Ee as default
|
|
114
112
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./Toaster.vue2.js";
|
|
2
2
|
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var r = function() {
|
|
4
|
-
var o = this,
|
|
5
|
-
return
|
|
4
|
+
var o = this, n = o._self._c, t = o._self._setupProxy;
|
|
5
|
+
return n(t.InToasts, { attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
|
|
6
6
|
}, a = [], _ = /* @__PURE__ */ s(
|
|
7
|
-
|
|
7
|
+
e,
|
|
8
8
|
r,
|
|
9
9
|
a,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
12
12
|
null
|
|
13
13
|
);
|
|
14
|
-
const
|
|
14
|
+
const l = _.exports;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
l as default
|
|
17
17
|
};
|
|
@@ -7,14 +7,14 @@ var s = function() {
|
|
|
7
7
|
return [t(e.EmailHeaderInfo)];
|
|
8
8
|
}, proxy: !0 }, { key: "headerRightSlot", fn: function() {
|
|
9
9
|
return [t(e.EmailSizeIndicator)];
|
|
10
|
-
}, proxy: !0 }]) }, [e.isContainerReady ? t("iframe", { staticClass: "email-iframe w-1 bor-w-0", style: { height: e.iframeHeight }, attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: e.previewStore.previewHtml } }) : r._e()])], 1);
|
|
10
|
+
}, proxy: !0 }]) }, [e.isContainerReady ? t("iframe", { staticClass: "email-iframe w-1 bor-w-0", style: { height: e.iframeHeight }, attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: e.previewStore.previewHtml } }) : r._e()])], 1);
|
|
11
11
|
}, i = [], n = /* @__PURE__ */ a(
|
|
12
12
|
o,
|
|
13
13
|
s,
|
|
14
14
|
i,
|
|
15
15
|
!1,
|
|
16
16
|
null,
|
|
17
|
-
"
|
|
17
|
+
"b37f3f6d"
|
|
18
18
|
);
|
|
19
19
|
const d = n.exports;
|
|
20
20
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import i from "./EmailSizeIndicator.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
5
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.
|
|
7
|
-
}, a = [], n = /* @__PURE__ */
|
|
6
|
+
return e("div", { staticClass: "d-f a-i-c j-c-c" }, [e(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), e(t.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: t.trans("email-editor.preview-design-size-tooltip") } })], 1);
|
|
7
|
+
}, a = [], n = /* @__PURE__ */ r(
|
|
8
8
|
i,
|
|
9
|
-
|
|
9
|
+
o,
|
|
10
10
|
a,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"c2adc57d"
|
|
14
14
|
);
|
|
15
15
|
const m = n.exports;
|
|
16
16
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
|
|
2
2
|
import { useTranslations as p } from "../../../../composables/useTranslations.js";
|
|
3
3
|
import { usePreviewStore as _ } from "../../../../stores/preview.js";
|
|
4
|
-
import {
|
|
4
|
+
import { InTooltip as v, InProgress as f } from "@useinsider/design-system-vue";
|
|
5
5
|
const S = /* @__PURE__ */ c({
|
|
6
6
|
__name: "EmailSizeIndicator",
|
|
7
7
|
setup(w) {
|
|
@@ -17,7 +17,7 @@ const S = /* @__PURE__ */ c({
|
|
|
17
17
|
}, i = p();
|
|
18
18
|
return u(() => t.previewHtml, () => {
|
|
19
19
|
r();
|
|
20
|
-
}, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f,
|
|
20
|
+
}, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltip: v };
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import n from "./ContentView.vue2.js";
|
|
2
2
|
import e from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
3
|
+
var o = function() {
|
|
4
4
|
var a = this, s = a._self._c, t = a._self._setupProxy;
|
|
5
5
|
return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
|
|
6
6
|
return a.$emit("back-to-inbox");
|
|
7
|
-
} } }, [s(t.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [a._v(a._s(t.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(t.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(t.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("iframe", { ref: "iframeRef", staticClass: "f-g-1 w-1 d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts", srcdoc: t.previewStore.previewHtml }, on: { load: t.onLoad } })]);
|
|
8
|
-
},
|
|
7
|
+
} } }, [s(t.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [a._v(a._s(t.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(t.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(t.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("iframe", { ref: "iframeRef", staticClass: "f-g-1 w-1 d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: t.previewStore.previewHtml }, on: { load: t.onLoad } })]);
|
|
8
|
+
}, c = [], i = /* @__PURE__ */ e(
|
|
9
9
|
n,
|
|
10
|
+
o,
|
|
10
11
|
c,
|
|
11
|
-
i,
|
|
12
12
|
!1,
|
|
13
13
|
null,
|
|
14
14
|
null
|
|
15
15
|
);
|
|
16
|
-
const d =
|
|
16
|
+
const d = i.exports;
|
|
17
17
|
export {
|
|
18
18
|
d as default
|
|
19
19
|
};
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as _ } from "./useActionsApi.js";
|
|
2
2
|
import { useBlocksConfig as k } from "./useBlocksConfig.js";
|
|
3
|
-
import { useConfig as
|
|
3
|
+
import { useConfig as B } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
|
|
5
|
-
import { useStripoEventHandler as
|
|
6
|
-
import { useToaster as
|
|
7
|
-
import { displayConditions as
|
|
8
|
-
import { useStripoApi as
|
|
9
|
-
import
|
|
10
|
-
import { useEditorStore as
|
|
11
|
-
import { dynamicContentToMergeTags as
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const e = I(), { html: n, css: u, forceRecreate: a } = i, { baseBlocks: t, extensions: d } = await C(), p = ((m = g.value) == null ? void 0 : m.displayConditions) ?? !0;
|
|
5
|
+
import { useStripoEventHandler as A } from "./useStripoEventHandler.js";
|
|
6
|
+
import { useToaster as v } from "./useToaster.js";
|
|
7
|
+
import { displayConditions as F } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as D } from "../services/stripoApi.js";
|
|
9
|
+
import I from "../static/styles/customEditorStyle.css.js";
|
|
10
|
+
import { useEditorStore as M } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as U } from "../utils/genericUtil.js";
|
|
12
|
+
const $ = (a) => {
|
|
13
|
+
const { features: d } = B(), { handleError: c } = v(), { getToken: g, getCustomFonts: f } = D(), { handleEvent: y } = A(), { getStripoBlocksConfig: C } = k(), S = async (i, n = []) => {
|
|
14
|
+
var p, m;
|
|
15
|
+
const o = M(), { html: s, css: t, forceRecreate: h } = i, { baseBlocks: l, extensions: w } = await C(), u = ((p = d.value) == null ? void 0 : p.displayConditions) ?? !0, b = ((m = d.value) == null ? void 0 : m.modulesDisabled) ?? !1;
|
|
17
16
|
window.UIEditor.initEditor(
|
|
18
17
|
document.querySelector("#guido-editor"),
|
|
19
18
|
{
|
|
20
|
-
metadata:
|
|
21
|
-
html:
|
|
22
|
-
css:
|
|
23
|
-
forceRecreate:
|
|
19
|
+
metadata: a,
|
|
20
|
+
html: s,
|
|
21
|
+
css: t,
|
|
22
|
+
forceRecreate: h,
|
|
24
23
|
locale: "en",
|
|
25
24
|
undoButtonSelector: "#guido__undo-button",
|
|
26
25
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -30,87 +29,87 @@ const N = (c) => {
|
|
|
30
29
|
customAppearanceMergetags: !0,
|
|
31
30
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
31
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
34
|
-
conditionsEnabled:
|
|
35
|
-
customConditionsEnabled:
|
|
36
|
-
conditionCategories:
|
|
32
|
+
customViewStyles: I,
|
|
33
|
+
conditionsEnabled: u,
|
|
34
|
+
customConditionsEnabled: u,
|
|
35
|
+
conditionCategories: F,
|
|
37
36
|
enableXSSSecurity: !0,
|
|
37
|
+
modulesDisabled: b,
|
|
38
38
|
messageSettingsEnabled: !0,
|
|
39
39
|
displayGmailAnnotations: !0,
|
|
40
40
|
displayHiddenPreheader: !1,
|
|
41
41
|
displayTitle: !1,
|
|
42
42
|
displayUTM: !1,
|
|
43
43
|
selectElementAfterDrop: !0,
|
|
44
|
-
...
|
|
44
|
+
...l ? { baseBlocks: l } : {},
|
|
45
45
|
editorFonts: {
|
|
46
46
|
showDefaultStandardFonts: !0,
|
|
47
47
|
showDefaultNotStandardFonts: !0,
|
|
48
|
-
customFonts:
|
|
48
|
+
customFonts: n
|
|
49
49
|
},
|
|
50
50
|
mergeTags: [
|
|
51
51
|
{
|
|
52
|
-
entries:
|
|
52
|
+
entries: U(a.preselectedDynamicContentList)
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
|
-
async onTokenRefreshRequest(
|
|
55
|
+
async onTokenRefreshRequest(e) {
|
|
56
56
|
try {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
} catch (
|
|
60
|
-
|
|
57
|
+
const r = await g();
|
|
58
|
+
e(r);
|
|
59
|
+
} catch (r) {
|
|
60
|
+
c(r, "Failed to refresh token");
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
onTemplateLoaded() {
|
|
64
64
|
try {
|
|
65
|
-
const { importCss:
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
const { importCss: e } = V(), { activateCustomViewStyles: r, updateTimerInClonedTemplate: T } = _();
|
|
66
|
+
e(), r(), T(), a.onReady(), o.isStripoInitialized = !0, o.loadingStatus = !1, setTimeout(() => {
|
|
67
|
+
o.hasChanges = !1;
|
|
68
68
|
}, 1e3);
|
|
69
|
-
} catch (
|
|
70
|
-
|
|
69
|
+
} catch (e) {
|
|
70
|
+
c(e, "Failed to load custom interface appearance");
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
|
-
onCodeEditorVisibilityChanged(
|
|
74
|
-
|
|
73
|
+
onCodeEditorVisibilityChanged(e) {
|
|
74
|
+
o.isCodeEditorOpen = e;
|
|
75
75
|
},
|
|
76
|
-
onEditorVisualModeChanged(
|
|
77
|
-
|
|
76
|
+
onEditorVisualModeChanged(e) {
|
|
77
|
+
o.editorVisualMode = e.toLowerCase();
|
|
78
78
|
},
|
|
79
|
-
onVersionHistoryVisibilityChanged(
|
|
80
|
-
|
|
79
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
80
|
+
o.isVersionHistoryOpen = e;
|
|
81
81
|
},
|
|
82
82
|
onDataChanged() {
|
|
83
|
-
|
|
83
|
+
o.hasChanges = !0;
|
|
84
84
|
},
|
|
85
|
-
onEvent:
|
|
85
|
+
onEvent: y,
|
|
86
86
|
ignoreClickOutsideSelectors: [
|
|
87
87
|
"#guido-dynamic-content-modal",
|
|
88
88
|
".in-on-board-wrapper",
|
|
89
89
|
".in-drawer__container"
|
|
90
90
|
],
|
|
91
|
-
extensions:
|
|
91
|
+
extensions: w
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
|
-
},
|
|
95
|
-
var d;
|
|
94
|
+
}, E = (i) => new Promise((n, o) => {
|
|
96
95
|
if (document.getElementById("UiEditorScript")) {
|
|
97
|
-
i(),
|
|
96
|
+
i(), n();
|
|
98
97
|
return;
|
|
99
98
|
}
|
|
100
|
-
const
|
|
101
|
-
t.id = "UiEditorScript", t.type = "module", t.src =
|
|
102
|
-
i(),
|
|
99
|
+
const s = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t = document.createElement("script");
|
|
100
|
+
t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
|
|
101
|
+
i(), n();
|
|
103
102
|
}, t.onerror = () => {
|
|
104
|
-
|
|
103
|
+
o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
105
104
|
}, document.body.appendChild(t);
|
|
106
105
|
});
|
|
107
106
|
return { initPlugin: async (i) => {
|
|
108
|
-
await
|
|
109
|
-
const
|
|
110
|
-
await
|
|
107
|
+
await E(async () => {
|
|
108
|
+
const n = await f();
|
|
109
|
+
await S(i, n);
|
|
111
110
|
});
|
|
112
111
|
} };
|
|
113
112
|
};
|
|
114
113
|
export {
|
|
115
|
-
|
|
114
|
+
$ as useStripo
|
|
116
115
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
1
|
+
import { migrateCheckbox as t } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as o } from "./couponBlockMigrator.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { migrateItemsBlock as i } from "./itemsBlockMigrator.js";
|
|
4
|
+
import { migrateRadioButton as e } from "./radioButtonMigrator.js";
|
|
5
|
+
import { migrateRecommendation as a } from "./recommendationMigrator.js";
|
|
6
|
+
import { migrateUnsubscribe as g } from "./unsubscribeMigrator.js";
|
|
7
|
+
const u = async (r) => {
|
|
8
|
+
let m = r;
|
|
9
|
+
return m = t(m), m = e(m), m = await g(m), m = o(m), m = a(m), m = i(m), m;
|
|
9
10
|
};
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
u as migrate
|
|
12
13
|
};
|