@useinsider/guido 3.12.0-beta.435bd0b → 3.12.0-beta.4e0547f
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/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +110 -101
- package/dist/composables/useStripo.js +72 -69
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
- package/dist/extensions/Blocks/controlFactories.js +125 -75
- package/dist/guido.css +1 -1
- package/dist/src/components/Guido.vue.d.ts +18 -2
- package/dist/src/composables/useStripo.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
- package/dist/src/stores/config.d.ts +3 -1
- package/dist/stores/config.js +21 -19
- package/package.json +1 -1
|
@@ -1,140 +1,149 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { provideGuidoActions as
|
|
4
|
-
import { useGuidoStateBridge as
|
|
5
|
-
import { usePartner as
|
|
6
|
-
import { useStripo as
|
|
7
|
-
import { useTimerClone as
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
20
|
-
import { useConfigStore as
|
|
21
|
-
import { useDynamicContentStore as
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
const
|
|
1
|
+
import { defineComponent as q, defineAsyncComponent as M, ref as U, computed as _, watch as B, onMounted as K, onUnmounted as V } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as j } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as J } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as Q } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as X } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as Y } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as Z } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as I } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as ee } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as te } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import oe from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import ne from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import re from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import se from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import ie from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import ae from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ce from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as de } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as me } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as ue } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as pe } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
|
|
26
|
+
const xe = /* @__PURE__ */ q({
|
|
27
27
|
__name: "Guido",
|
|
28
28
|
props: {
|
|
29
|
-
config: null
|
|
29
|
+
config: null,
|
|
30
|
+
ready: { type: Boolean, default: !0 }
|
|
30
31
|
},
|
|
31
32
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
33
|
+
setup(P, { expose: A, emit: n }) {
|
|
34
|
+
const i = P, W = M(
|
|
34
35
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
35
|
-
),
|
|
36
|
+
), x = M(
|
|
36
37
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
37
|
-
),
|
|
38
|
-
i.init(
|
|
39
|
-
const
|
|
40
|
-
var
|
|
41
|
-
return (
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
defaultModulesFolderName: _
|
|
60
|
-
}, M = {
|
|
61
|
-
preselectedDynamicContentList: S,
|
|
62
|
-
onReady: () => {
|
|
63
|
-
console.debug("guido:ready"), n("ready");
|
|
64
|
-
}
|
|
65
|
-
}, { initPlugin: O } = se(y, M), { getDefaultTemplate: P } = Se(), { cloneTimersOnSave: R, hasTimerBlocks: A } = ae(), Q = x(() => {
|
|
66
|
-
var e;
|
|
67
|
-
return !((e = i.ui) != null && e.showHeader);
|
|
38
|
+
), g = U(), l = U(), u = le(), S = fe(), o = me();
|
|
39
|
+
i.ready && o.init(i.config);
|
|
40
|
+
const d = O(), G = ue(), m = _(() => d.hasChanges), { isTestPartner: H } = X(), h = () => {
|
|
41
|
+
var t;
|
|
42
|
+
return (t = g.value) == null ? void 0 : t.handleSave(!0);
|
|
43
|
+
}, b = (t) => {
|
|
44
|
+
d.loadingStatus = t;
|
|
45
|
+
};
|
|
46
|
+
j(), Q();
|
|
47
|
+
const p = () => {
|
|
48
|
+
var t, e;
|
|
49
|
+
return {
|
|
50
|
+
emailId: o.templateId,
|
|
51
|
+
userId: o.userId,
|
|
52
|
+
username: o.username,
|
|
53
|
+
partnerName: o.partnerName,
|
|
54
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
55
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
56
|
+
};
|
|
57
|
+
}, { initPlugin: E, preloadRuntime: w } = Y(), { getDefaultTemplate: C } = de(), { cloneTimersOnSave: D, hasTimerBlocks: T } = Z(), $ = _(() => {
|
|
58
|
+
var t;
|
|
59
|
+
return !((t = o.ui) != null && t.showHeader);
|
|
68
60
|
});
|
|
69
|
-
|
|
61
|
+
J({
|
|
70
62
|
onBack: () => {
|
|
71
63
|
console.debug("guido:back"), n("back");
|
|
72
64
|
},
|
|
73
65
|
onSaveStart: () => {
|
|
74
66
|
console.debug("guido:save:start"), n("save:start");
|
|
75
67
|
},
|
|
76
|
-
onSaveComplete: (
|
|
77
|
-
const
|
|
78
|
-
console.debug("guido:save:complete",
|
|
68
|
+
onSaveComplete: (t) => {
|
|
69
|
+
const e = { ...t, metadata: p() };
|
|
70
|
+
console.debug("guido:save:complete", e), n("save:complete", e);
|
|
79
71
|
},
|
|
80
72
|
onTestEmailClick: () => {
|
|
81
73
|
console.debug("guido:test-email:click"), n("test-email:click");
|
|
82
74
|
}
|
|
83
75
|
});
|
|
84
|
-
const
|
|
85
|
-
console.debug("dynamic-content:close",
|
|
86
|
-
},
|
|
76
|
+
const L = (t) => {
|
|
77
|
+
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
78
|
+
}, R = () => {
|
|
87
79
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
88
80
|
};
|
|
89
|
-
|
|
90
|
-
n("on-change",
|
|
81
|
+
B(() => m.value, () => {
|
|
82
|
+
n("on-change", m.value);
|
|
91
83
|
});
|
|
92
|
-
const
|
|
93
|
-
const
|
|
94
|
-
console.debug("dynamic-content:open",
|
|
84
|
+
const f = (t) => {
|
|
85
|
+
const e = t, { attribute: s, position: c } = e.detail;
|
|
86
|
+
console.debug("dynamic-content:open", e.detail), n("dynamic-content:open", s, c);
|
|
95
87
|
};
|
|
96
88
|
let a = null;
|
|
97
|
-
const
|
|
89
|
+
const y = () => {
|
|
90
|
+
var e;
|
|
91
|
+
const t = document.querySelector(ee);
|
|
92
|
+
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
93
|
+
}, v = async () => {
|
|
98
94
|
var t;
|
|
99
|
-
const e = document.querySelector(ce);
|
|
100
|
-
(t = p.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
|
|
101
|
-
};
|
|
102
|
-
return Z(async () => {
|
|
103
|
-
var t, u;
|
|
104
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), ie().$reset(), $().$reset(), m.templateId = v, be().$reset(), g();
|
|
105
|
-
const e = (t = p.value) == null ? void 0 : t.parentElement;
|
|
106
|
-
e && (a = new ResizeObserver(g), a.observe(e));
|
|
107
95
|
try {
|
|
108
|
-
|
|
109
|
-
const
|
|
96
|
+
o.initialized || o.init(i.config), d.templateId = o.templateId;
|
|
97
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", c = (e == null ? void 0 : e.css) || "", k = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
98
|
+
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
99
|
+
const F = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {};
|
|
110
100
|
let r = {
|
|
111
|
-
html:
|
|
112
|
-
css:
|
|
101
|
+
html: s && await I(s, F),
|
|
102
|
+
css: c
|
|
103
|
+
};
|
|
104
|
+
r.html || (r = await C(), r.html = await I(r.html, F)), T(r.html) && (r.html = await D(r.html));
|
|
105
|
+
const z = {
|
|
106
|
+
preselectedDynamicContentList: k,
|
|
107
|
+
onReady: () => {
|
|
108
|
+
console.debug("guido:ready"), n("ready");
|
|
109
|
+
}
|
|
113
110
|
};
|
|
114
|
-
|
|
115
|
-
} catch (
|
|
116
|
-
console.error("Failed to initialize Stripo editor:",
|
|
111
|
+
await E(r, p(), z), u.selectedDynamicContentList = k;
|
|
112
|
+
} catch (e) {
|
|
113
|
+
console.error("Failed to initialize Stripo editor:", e);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
return K(async () => {
|
|
117
|
+
var e;
|
|
118
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), te().$reset(), O().$reset(), pe().$reset(), y();
|
|
119
|
+
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
120
|
+
if (t && (a = new ResizeObserver(y), a.observe(t)), w(), i.ready)
|
|
121
|
+
await v();
|
|
122
|
+
else {
|
|
123
|
+
const s = B(() => i.ready, (c) => {
|
|
124
|
+
c && (s(), v());
|
|
125
|
+
});
|
|
117
126
|
}
|
|
118
|
-
document.addEventListener("dynamic-content:open",
|
|
119
|
-
}),
|
|
120
|
-
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
127
|
+
document.addEventListener("dynamic-content:open", f);
|
|
128
|
+
}), V(() => {
|
|
129
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", f);
|
|
121
130
|
try {
|
|
122
131
|
window.UIEditor.removeEditor();
|
|
123
132
|
} catch {
|
|
124
133
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
125
134
|
}
|
|
126
|
-
|
|
127
|
-
}),
|
|
135
|
+
o.reset();
|
|
136
|
+
}), A({
|
|
128
137
|
dynamicContent: {
|
|
129
|
-
insert:
|
|
130
|
-
close:
|
|
138
|
+
insert: L,
|
|
139
|
+
close: R
|
|
131
140
|
},
|
|
132
|
-
hasChanges:
|
|
133
|
-
saveSilent:
|
|
134
|
-
setLoading:
|
|
135
|
-
}), { __sfc: !0, PreviewContainer:
|
|
141
|
+
hasChanges: m,
|
|
142
|
+
saveSilent: h,
|
|
143
|
+
setLoading: b
|
|
144
|
+
}), { __sfc: !0, PreviewContainer: W, OnboardingWrapper: x, headerWrapperRef: g, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: d, previewStore: G, hasChanges: m, isTestPartner: H, saveSilent: h, setLoading: b, emit: n, buildMetadata: p, initPlugin: E, preloadRuntime: w, getDefaultTemplate: C, cloneTimersOnSave: D, hasTimerBlocks: T, noHeader: $, insertDynamicContent: L, closeDynamicContent: R, handleDynamicContentOpen: f, ribbonObserver: a, updateRibbonOffset: y, startEditor: v, AutoSaveController: oe, Toaster: ne, FilterSelectionDrawer: re, HeaderWrapper: se, LoadingWrapper: ie, SaveAsTemplateDrawer: ae, UnsubscribeWrapper: ce };
|
|
136
145
|
}
|
|
137
146
|
});
|
|
138
147
|
export {
|
|
139
|
-
|
|
148
|
+
xe as default
|
|
140
149
|
};
|
|
@@ -1,31 +1,44 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as L } from "./useActionsApi.js";
|
|
2
2
|
import { useBlocksConfig as O } from "./useBlocksConfig.js";
|
|
3
3
|
import { useConfig as q } from "./useConfig.js";
|
|
4
4
|
import { useCustomInterfaceAppearance as H } from "./useCustomInterfaceAppearance.js";
|
|
5
|
-
import { useFullStoryBridge as
|
|
6
|
-
import { useModuleDynamicContentRepair as
|
|
5
|
+
import { useFullStoryBridge as N } from "./useFullStoryBridge.js";
|
|
6
|
+
import { useModuleDynamicContentRepair as j } from "./useModuleDynamicContentRepair.js";
|
|
7
7
|
import { useStripoEventHandler as z } from "./useStripoEventHandler.js";
|
|
8
8
|
import { useStripoNotifications as $ } from "./useStripoNotifications.js";
|
|
9
9
|
import { useToaster as G } from "./useToaster.js";
|
|
10
10
|
import { localePatch as J } from "../config/i18n/index.js";
|
|
11
|
-
import { en as
|
|
11
|
+
import { en as w } from "../config/i18n/en/index.js";
|
|
12
12
|
import { ToasterTypeOptions as X } from "../enums/toaster.js";
|
|
13
|
-
import { useStripoApi as
|
|
14
|
-
import
|
|
15
|
-
import { useEditorStore as
|
|
16
|
-
import { buildMergeTagEntries as
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
import { useStripoApi as K } from "../services/stripoApi.js";
|
|
14
|
+
import Q from "../static/styles/customEditorStyle.css.js";
|
|
15
|
+
import { useEditorStore as b } from "../stores/editor.js";
|
|
16
|
+
import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../utils/genericUtil.js";
|
|
17
|
+
import Z from "../package.json.js";
|
|
18
|
+
let n = null;
|
|
19
|
+
const Ct = () => {
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: T, getCustomFonts: v, getSyncModulesStatus: B } = K(), { handleEvent: F } = z(), { handleModuleAdd: M } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
|
+
var l;
|
|
22
|
+
if (document.getElementById("UiEditorScript")) {
|
|
23
|
+
i();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(l = o == null ? void 0 : o.stripo) == null ? void 0 : l.version}/UIEditor.js`, t = document.createElement("script");
|
|
27
|
+
t.id = "UiEditorScript", t.type = "module", t.src = r, t.onload = () => i(), t.onerror = () => {
|
|
28
|
+
t.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
|
|
29
|
+
}, document.body.appendChild(t);
|
|
30
|
+
}), n.catch(() => {
|
|
31
|
+
n = null;
|
|
32
|
+
}), n), _ = async (i, s, o, a = [], r = !1) => {
|
|
33
|
+
var y, E, h, C;
|
|
34
|
+
const t = b(), { html: l, css: D } = i, { baseBlocks: g, extensions: R } = await A(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, P = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, U = ((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1;
|
|
22
35
|
await window.UIEditor.initEditor(
|
|
23
36
|
document.querySelector("#guido-editor"),
|
|
24
37
|
{
|
|
25
|
-
metadata:
|
|
26
|
-
html:
|
|
27
|
-
css:
|
|
28
|
-
forceRecreate:
|
|
38
|
+
metadata: s,
|
|
39
|
+
html: l,
|
|
40
|
+
css: D,
|
|
41
|
+
forceRecreate: U,
|
|
29
42
|
locale: "en",
|
|
30
43
|
undoButtonSelector: "#guido__undo-button",
|
|
31
44
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -35,9 +48,9 @@ const he = (b, l) => {
|
|
|
35
48
|
customAppearanceMergetags: !m("liquidSyntax"),
|
|
36
49
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
37
50
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
38
|
-
customViewStyles:
|
|
39
|
-
conditionsEnabled:
|
|
40
|
-
customConditionsEnabled:
|
|
51
|
+
customViewStyles: Q,
|
|
52
|
+
conditionsEnabled: S,
|
|
53
|
+
customConditionsEnabled: S,
|
|
41
54
|
enableXSSSecurity: !0,
|
|
42
55
|
modulesDisabled: P,
|
|
43
56
|
syncModulesEnabled: r,
|
|
@@ -49,50 +62,50 @@ const he = (b, l) => {
|
|
|
49
62
|
selectElementAfterDrop: !0,
|
|
50
63
|
sameFontSizeForOutlook: !0,
|
|
51
64
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
52
|
-
...
|
|
65
|
+
...g ? { baseBlocks: g } : {},
|
|
53
66
|
editorFonts: {
|
|
54
67
|
showDefaultStandardFonts: !0,
|
|
55
68
|
showDefaultNotStandardFonts: !0,
|
|
56
|
-
customFonts:
|
|
69
|
+
customFonts: a
|
|
57
70
|
},
|
|
58
71
|
mergeTags: [
|
|
59
72
|
{
|
|
60
|
-
entries:
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
entries: W(
|
|
74
|
+
o.preselectedDynamicContentList,
|
|
75
|
+
Y((C = u.value) == null ? void 0 : C.dynamicContentList),
|
|
63
76
|
m("liquidSyntax")
|
|
64
77
|
)
|
|
65
78
|
}
|
|
66
79
|
],
|
|
67
|
-
async onTokenRefreshRequest(
|
|
80
|
+
async onTokenRefreshRequest(e) {
|
|
68
81
|
try {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
} catch (
|
|
72
|
-
p(
|
|
82
|
+
const d = await T();
|
|
83
|
+
e(d);
|
|
84
|
+
} catch (d) {
|
|
85
|
+
p(d, "Failed to refresh token");
|
|
73
86
|
}
|
|
74
87
|
},
|
|
75
88
|
onTemplateLoaded() {
|
|
76
89
|
try {
|
|
77
|
-
const { importCss:
|
|
78
|
-
|
|
79
|
-
|
|
90
|
+
const { importCss: e } = H(), { activateCustomViewStyles: d, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
|
|
91
|
+
e(), d(), x(), I(), o.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
92
|
+
t.hasChanges = !1;
|
|
80
93
|
}, 1e3);
|
|
81
|
-
} catch (
|
|
82
|
-
p(
|
|
94
|
+
} catch (e) {
|
|
95
|
+
p(e, "Failed to load custom interface appearance");
|
|
83
96
|
}
|
|
84
97
|
},
|
|
85
|
-
onCodeEditorVisibilityChanged(
|
|
86
|
-
|
|
98
|
+
onCodeEditorVisibilityChanged(e) {
|
|
99
|
+
t.isCodeEditorOpen = e;
|
|
87
100
|
},
|
|
88
|
-
onEditorVisualModeChanged(
|
|
89
|
-
|
|
101
|
+
onEditorVisualModeChanged(e) {
|
|
102
|
+
t.editorVisualMode = e.toLowerCase();
|
|
90
103
|
},
|
|
91
|
-
onVersionHistoryVisibilityChanged(
|
|
92
|
-
|
|
104
|
+
onVersionHistoryVisibilityChanged(e) {
|
|
105
|
+
t.isVersionHistoryOpen = e;
|
|
93
106
|
},
|
|
94
107
|
onDataChanged() {
|
|
95
|
-
|
|
108
|
+
t.hasChanges = !0;
|
|
96
109
|
},
|
|
97
110
|
onEvent: F,
|
|
98
111
|
onModuleAdd: M,
|
|
@@ -102,45 +115,35 @@ const he = (b, l) => {
|
|
|
102
115
|
".in-on-board-wrapper",
|
|
103
116
|
".in-drawer__container"
|
|
104
117
|
],
|
|
105
|
-
extensions:
|
|
118
|
+
extensions: R,
|
|
106
119
|
localePatch: J
|
|
107
120
|
}
|
|
108
121
|
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Promise.resolve(n()).then(i, r);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const e = Y.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, o = document.createElement("script");
|
|
116
|
-
o.id = "UiEditorScript", o.type = "module", o.src = a, o.onload = () => {
|
|
117
|
-
Promise.resolve(n()).then(i, r);
|
|
118
|
-
}, o.onerror = () => {
|
|
119
|
-
r(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
120
|
-
}, document.body.appendChild(o);
|
|
121
|
-
});
|
|
122
|
-
return { initPlugin: async (n) => {
|
|
123
|
-
const i = w();
|
|
122
|
+
};
|
|
123
|
+
return { initPlugin: async (i, s, o) => {
|
|
124
|
+
const a = b();
|
|
124
125
|
try {
|
|
125
|
-
await
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
});
|
|
126
|
+
await f();
|
|
127
|
+
const [r, t] = await Promise.all([
|
|
128
|
+
v(),
|
|
129
|
+
B()
|
|
130
|
+
]);
|
|
131
|
+
a.syncModulesEnabled = t, await _(i, s, o, r, t);
|
|
132
132
|
} catch {
|
|
133
|
-
|
|
133
|
+
a.loadingStatus = !1, k({
|
|
134
134
|
type: X.Error,
|
|
135
|
-
message:
|
|
135
|
+
message: w["An error has occurred. Please report the error code to support."],
|
|
136
136
|
actionButton: {
|
|
137
|
-
text:
|
|
137
|
+
text: w["Reload page"],
|
|
138
138
|
onClick: () => window.location.reload()
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
+
}, preloadRuntime: () => {
|
|
143
|
+
f().catch(() => {
|
|
144
|
+
});
|
|
142
145
|
} };
|
|
143
146
|
};
|
|
144
147
|
export {
|
|
145
|
-
|
|
148
|
+
Ct as useStripo
|
|
146
149
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (c.BLOCK_BACKGROUND = "recommendation-block-background-color-control", c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationControlId as r } from "../../constants/controlIds.js";
|
|
3
|
+
import { BLOCK_ROOT_SELECTOR as t } from "../../constants/selectors.js";
|
|
4
|
+
const c = o(
|
|
5
|
+
r.BLOCK_BACKGROUND,
|
|
6
|
+
t
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
c as BlockBackgroundColorControl
|
|
10
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
1
|
+
import { ExtensionBuilder as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import n from "./canvasPreview.css.js";
|
|
4
4
|
import { RecommendationBlockControl as i } from "./controls/main/index.js";
|
|
@@ -6,42 +6,44 @@ import "./constants/selectors.js";
|
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
7
|
import "./utils/captureStyleTemplates.js";
|
|
8
8
|
import { NameControls as e } from "./controls/name/index.js";
|
|
9
|
-
import { PriceControls as
|
|
10
|
-
import { OldPriceControls as
|
|
9
|
+
import { PriceControls as l } from "./controls/price/index.js";
|
|
10
|
+
import { OldPriceControls as s } from "./controls/oldPrice/index.js";
|
|
11
11
|
import { OmnibusPriceControls as p } from "./controls/omnibusPrice/index.js";
|
|
12
12
|
import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
|
|
13
13
|
import { ButtonControls as c } from "./controls/button/index.js";
|
|
14
|
-
import { ImageControls as
|
|
15
|
-
import { CustomAttributeControls as
|
|
14
|
+
import { ImageControls as C } from "./controls/image/index.js";
|
|
15
|
+
import { CustomAttributeControls as f } from "./controls/customAttribute/index.js";
|
|
16
16
|
import { SpacingControl as d } from "./controls/spacing/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
17
|
+
import { BlockBackgroundColorControl as u } from "./controls/blockBackground/index.js";
|
|
18
|
+
import { CardBackgroundColorControl as g } from "./controls/cardBackground/index.js";
|
|
19
|
+
import { RecommendationCardCompositionControl as y } from "./controls/cardComposition/index.js";
|
|
20
|
+
import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
|
|
20
21
|
import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
|
|
21
22
|
import R from "./recommendation.css.js";
|
|
22
23
|
import { SettingsPanel as S } from "./settingsPanel.js";
|
|
23
|
-
const
|
|
24
|
+
const k = [
|
|
24
25
|
e,
|
|
25
|
-
s,
|
|
26
26
|
l,
|
|
27
|
+
s,
|
|
27
28
|
p,
|
|
28
29
|
a,
|
|
29
30
|
c,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
31
|
+
C,
|
|
32
|
+
f
|
|
33
|
+
], w = [
|
|
33
34
|
i,
|
|
34
35
|
u,
|
|
35
|
-
d,
|
|
36
36
|
g,
|
|
37
|
-
|
|
37
|
+
d,
|
|
38
|
+
y,
|
|
39
|
+
B
|
|
38
40
|
], b = [
|
|
39
|
-
...
|
|
40
|
-
...
|
|
41
|
-
],
|
|
42
|
-
(o,
|
|
43
|
-
new
|
|
41
|
+
...w,
|
|
42
|
+
...k.flatMap((o) => Object.values(o))
|
|
43
|
+
], W = b.reduce(
|
|
44
|
+
(o, r) => o.addControl(r),
|
|
45
|
+
new t().addBlock(m).withSettingsPanelRegistry(S)
|
|
44
46
|
).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
W as default
|
|
47
49
|
};
|