@useinsider/guido 3.17.0-beta.edf4165 → 3.17.0-beta.f552101
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 +5 -5
- package/dist/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +59 -57
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
- package/dist/composables/useStripo.js +14 -14
- package/dist/config/i18n/en/labels.json.js +1 -1
- package/dist/config/migrator/index.js +9 -8
- package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
- package/dist/config/migrator/recommendation/extractors.js +29 -24
- package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
- package/dist/config/migrator/recommendationMigrator.js +30 -25
- package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
- package/dist/extensions/Blocks/Items/block.js +98 -49
- package/dist/extensions/Blocks/Items/constants/currency.js +11 -0
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +25 -24
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +12 -11
- package/dist/extensions/Blocks/Items/template.js +153 -152
- package/dist/extensions/Blocks/Recommendation/block.js +12 -11
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +24 -22
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +35 -28
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +329 -257
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +174 -109
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
- package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
- package/dist/extensions/Blocks/Recommendation/services/configService.js +34 -16
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +47 -37
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
- package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +1 -1
- package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
- package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +21 -0
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +38 -8
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +26 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
- package/dist/static/styles/customEditorStyle.css.js +3 -1
- package/dist/utils/pairProductVariables.js +60 -59
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -634,16 +634,16 @@ toaster fires (useful before the host has wired the catalog).
|
|
|
634
634
|
|
|
635
635
|
```bash
|
|
636
636
|
# Install
|
|
637
|
-
|
|
637
|
+
npm install
|
|
638
638
|
|
|
639
639
|
# Start dev server
|
|
640
|
-
|
|
640
|
+
npm start
|
|
641
641
|
|
|
642
642
|
# Build
|
|
643
|
-
|
|
643
|
+
npm run build
|
|
644
644
|
|
|
645
645
|
# Lint & type-check
|
|
646
|
-
|
|
646
|
+
npm run lint
|
|
647
647
|
```
|
|
648
648
|
|
|
649
649
|
### Environment Variables
|
|
@@ -661,7 +661,7 @@ VITE_STRIPO_USER=your_user
|
|
|
661
661
|
|
|
662
662
|
```bash
|
|
663
663
|
# Build the package
|
|
664
|
-
|
|
664
|
+
npm run build
|
|
665
665
|
|
|
666
666
|
# Create tarball
|
|
667
667
|
npm pack
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
|
-
var
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) :
|
|
5
|
+
var a = this, r = a._self._c, e = a._self._setupProxy;
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : a._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.AssignStrategyDrawer) : a._e(), e.isRrsEnabled || e.hasAssignedStrategy ? r(e.RemoveStrategyModal) : a._e(), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? a._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(_) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
9
|
}, s = [], n = /* @__PURE__ */ i(
|
|
10
|
-
|
|
10
|
+
o,
|
|
11
11
|
t,
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"5c588dc5"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const v = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
v as default
|
|
20
20
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
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
|
|
1
|
+
import { defineComponent as Z, defineAsyncComponent as l, ref as A, computed as u, watch as U, onMounted as ee, onUnmounted as te } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as se } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as ae } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as ie } from "../composables/useTimerClone.js";
|
|
8
8
|
import { migrate as _ } from "../config/migrator/index.js";
|
|
9
9
|
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
10
|
+
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
11
11
|
import { useRecommendationExtensionStore as O } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
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
|
|
12
|
+
import de from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import me from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import ue from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import pe from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as ge } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as ve } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
|
|
22
22
|
import { useEditorStore as P } from "../stores/editor.js";
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
23
|
+
import { usePreviewStore as he } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as be } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
|
|
26
26
|
import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
|
|
27
|
-
const
|
|
27
|
+
const je = /* @__PURE__ */ Z({
|
|
28
28
|
__name: "Guido",
|
|
29
29
|
props: {
|
|
30
30
|
config: null,
|
|
@@ -32,22 +32,24 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
32
32
|
},
|
|
33
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
34
|
setup(x, { expose: G, emit: r }) {
|
|
35
|
-
const a = x, H =
|
|
35
|
+
const a = x, H = l(
|
|
36
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
), $ =
|
|
37
|
+
), $ = l(
|
|
38
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
), z =
|
|
39
|
+
), z = l(
|
|
40
40
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
41
|
-
),
|
|
41
|
+
), q = l(
|
|
42
|
+
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
43
|
+
), h = A(), p = A(), f = Se(), b = Ee(), o = ve();
|
|
42
44
|
a.ready && o.init(a.config);
|
|
43
|
-
const c = P(),
|
|
45
|
+
const c = P(), K = he(), m = u(() => c.hasChanges), { isTestPartner: V } = se(), E = () => {
|
|
44
46
|
var t;
|
|
45
47
|
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
46
48
|
}, w = (t) => {
|
|
47
49
|
c.loadingStatus = t;
|
|
48
50
|
};
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
+
oe(), re();
|
|
52
|
+
const y = () => {
|
|
51
53
|
var t, e;
|
|
52
54
|
return {
|
|
53
55
|
emailId: o.templateId,
|
|
@@ -57,13 +59,13 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
57
59
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
58
60
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
59
61
|
};
|
|
60
|
-
}, { initPlugin: C, preloadRuntime: D } =
|
|
62
|
+
}, { initPlugin: C, preloadRuntime: D } = ae(), { getDefaultTemplate: k } = ge(), { cloneTimersOnSave: T, hasTimerBlocks: F } = ie(), j = u(() => {
|
|
61
63
|
var t;
|
|
62
64
|
return !((t = o.ui) != null && t.showHeader);
|
|
63
|
-
}),
|
|
65
|
+
}), J = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Q = u(
|
|
64
66
|
() => !!O().recommendationConfigs.strategyId
|
|
65
67
|
);
|
|
66
|
-
|
|
68
|
+
ne({
|
|
67
69
|
onBack: () => {
|
|
68
70
|
console.debug("guido:back"), r("back");
|
|
69
71
|
},
|
|
@@ -71,7 +73,7 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
71
73
|
console.debug("guido:save:start"), r("save:start");
|
|
72
74
|
},
|
|
73
75
|
onSaveComplete: (t) => {
|
|
74
|
-
const e = { ...t, metadata:
|
|
76
|
+
const e = { ...t, metadata: y() };
|
|
75
77
|
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
76
78
|
},
|
|
77
79
|
onTestEmailClick: () => {
|
|
@@ -79,61 +81,61 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
79
81
|
}
|
|
80
82
|
});
|
|
81
83
|
const I = (t) => {
|
|
82
|
-
console.debug("dynamic-content:close", t),
|
|
84
|
+
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
83
85
|
}, R = () => {
|
|
84
86
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
85
87
|
};
|
|
86
88
|
U(() => m.value, () => {
|
|
87
89
|
r("on-change", m.value);
|
|
88
90
|
});
|
|
89
|
-
const
|
|
91
|
+
const g = (t) => {
|
|
90
92
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
91
93
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
92
94
|
};
|
|
93
95
|
let i = null;
|
|
94
|
-
const
|
|
96
|
+
const v = () => {
|
|
95
97
|
var e;
|
|
96
|
-
const t = document.querySelector(
|
|
97
|
-
(e =
|
|
98
|
-
},
|
|
98
|
+
const t = document.querySelector(ce);
|
|
99
|
+
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
100
|
+
}, S = async () => {
|
|
99
101
|
var t;
|
|
100
102
|
try {
|
|
101
103
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
102
104
|
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", L = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
103
105
|
b.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
104
|
-
const
|
|
106
|
+
const M = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, B = o.isFeatureEnabled("linkTrackingIds");
|
|
105
107
|
let n = {
|
|
106
|
-
html: s && await _(s,
|
|
108
|
+
html: s && await _(s, M),
|
|
107
109
|
css: d
|
|
108
110
|
};
|
|
109
|
-
n.html || (n = await k(), n.html = await _(n.html,
|
|
110
|
-
const
|
|
111
|
-
F(n.html) && (n.html = await T(n.html)),
|
|
112
|
-
const
|
|
111
|
+
n.html || (n = await k(), n.html = await _(n.html, M));
|
|
112
|
+
const X = B ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
113
|
+
F(n.html) && (n.html = await T(n.html)), B && (c.trackIdSessionFloor = Math.max(X, W(n.html)));
|
|
114
|
+
const Y = {
|
|
113
115
|
preselectedDynamicContentList: L,
|
|
114
116
|
onReady: () => {
|
|
115
117
|
console.debug("guido:ready"), r("ready");
|
|
116
118
|
}
|
|
117
119
|
};
|
|
118
|
-
await C(n,
|
|
120
|
+
await C(n, y(), Y), f.selectedDynamicContentList = L;
|
|
119
121
|
} catch (e) {
|
|
120
122
|
console.error("Failed to initialize Stripo editor:", e);
|
|
121
123
|
}
|
|
122
124
|
};
|
|
123
|
-
return
|
|
125
|
+
return ee(async () => {
|
|
124
126
|
var e;
|
|
125
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(),
|
|
126
|
-
const t = (e =
|
|
127
|
-
if (t && (i = new ResizeObserver(
|
|
128
|
-
await
|
|
127
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), O().$reset(), P().$reset(), be().$reset(), v();
|
|
128
|
+
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
129
|
+
if (t && (i = new ResizeObserver(v), i.observe(t)), D(), a.ready)
|
|
130
|
+
await S();
|
|
129
131
|
else {
|
|
130
132
|
const s = U(() => a.ready, (d) => {
|
|
131
|
-
d && (s(),
|
|
133
|
+
d && (s(), S());
|
|
132
134
|
});
|
|
133
135
|
}
|
|
134
|
-
document.addEventListener("dynamic-content:open",
|
|
135
|
-
}),
|
|
136
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
136
|
+
document.addEventListener("dynamic-content:open", g);
|
|
137
|
+
}), te(() => {
|
|
138
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g);
|
|
137
139
|
try {
|
|
138
140
|
window.UIEditor.removeEditor();
|
|
139
141
|
} catch {
|
|
@@ -148,9 +150,9 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
148
150
|
hasChanges: m,
|
|
149
151
|
saveSilent: E,
|
|
150
152
|
setLoading: w
|
|
151
|
-
}), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, headerWrapperRef: h, wrapperRef:
|
|
153
|
+
}), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, RemoveStrategyModal: q, headerWrapperRef: h, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: b, props: a, configStore: o, editorStore: c, previewStore: K, hasChanges: m, isTestPartner: V, saveSilent: E, setLoading: w, emit: r, buildMetadata: y, initPlugin: C, preloadRuntime: D, getDefaultTemplate: k, cloneTimersOnSave: T, hasTimerBlocks: F, noHeader: j, isRrsEnabled: J, hasAssignedStrategy: Q, insertDynamicContent: I, closeDynamicContent: R, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: de, Toaster: me, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ye };
|
|
152
154
|
}
|
|
153
155
|
});
|
|
154
156
|
export {
|
|
155
|
-
|
|
157
|
+
je as default
|
|
156
158
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import s from "./RemoveStrategyModal.vue2.js";
|
|
2
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var a = function() {
|
|
4
|
+
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
5
|
+
return e.store.removeStrategyModalStatus ? o(e.WpModal, { attrs: { id: "guido__remove-strategy-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("email-editor.remove-strategy-confirm-title") }, on: { close: e.close, "primary-action": e.handleConfirm, "secondary-action": e.close } }, [o("p", [t._v(t._s(e.messageParts[0])), o("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])]) : t._e();
|
|
6
|
+
}, n = [], _ = /* @__PURE__ */ r(
|
|
7
|
+
s,
|
|
8
|
+
a,
|
|
9
|
+
n,
|
|
10
|
+
!1,
|
|
11
|
+
null,
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
const c = _.exports;
|
|
15
|
+
export {
|
|
16
|
+
c as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as u, computed as n } from "vue";
|
|
2
|
+
import y from "../../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useToaster as f } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as v } from "../../../../enums/toaster.js";
|
|
6
|
+
import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
|
+
import { commitBlockChangeOutsidePanel as h } from "../../../../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
|
|
8
|
+
import { escapeHtml as R } from "../../../../utils/htmlEscape.js";
|
|
9
|
+
const P = /* @__PURE__ */ u({
|
|
10
|
+
__name: "RemoveStrategyModal",
|
|
11
|
+
setup(S) {
|
|
12
|
+
const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
|
|
13
|
+
cancelOrBackButton: {
|
|
14
|
+
type: "secondary",
|
|
15
|
+
labelText: t("products.cancel"),
|
|
16
|
+
styling: "ghost"
|
|
17
|
+
},
|
|
18
|
+
primaryButton: {
|
|
19
|
+
type: "danger",
|
|
20
|
+
labelText: t("discovery-strategy.remove")
|
|
21
|
+
}
|
|
22
|
+
})), m = n(() => {
|
|
23
|
+
var o;
|
|
24
|
+
const { strategyId: r } = e.recommendationConfigs;
|
|
25
|
+
return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
|
|
26
|
+
}), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
|
|
27
|
+
e.closeRemoveStrategyModal();
|
|
28
|
+
};
|
|
29
|
+
return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
|
|
30
|
+
const r = m.value, o = e.currentRecommendationId;
|
|
31
|
+
e.removeStrategy(), c();
|
|
32
|
+
const { strategyId: l, size: g } = e.recommendationConfigs;
|
|
33
|
+
if (a({
|
|
34
|
+
type: v.Success,
|
|
35
|
+
// The toast renders through a sanitizing v-html, so the name is escaped first.
|
|
36
|
+
message: t("email-editor.strategy-removed-success", {
|
|
37
|
+
strategyName: `<b>${R(r)}</b>`
|
|
38
|
+
})
|
|
39
|
+
}), o !== null) {
|
|
40
|
+
try {
|
|
41
|
+
await e.fetchRecommendationProducts();
|
|
42
|
+
} catch (p) {
|
|
43
|
+
console.error("[RemoveStrategyModal] product refetch failed", p);
|
|
44
|
+
}
|
|
45
|
+
h(
|
|
46
|
+
o,
|
|
47
|
+
{ strategyId: l, size: g },
|
|
48
|
+
e.recommendationProducts,
|
|
49
|
+
"Removed recommendation strategy"
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}, WpModal: y };
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
P as default
|
|
57
|
+
};
|
|
@@ -17,13 +17,13 @@ import { buildMergeTagEntries as W, flattenDynamicContentList as Y } from "../ut
|
|
|
17
17
|
import Z from "../package.json.js";
|
|
18
18
|
let n = null;
|
|
19
19
|
const Ce = () => {
|
|
20
|
-
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken:
|
|
21
|
-
var
|
|
20
|
+
const { features: c, template: u, isFeatureEnabled: m } = q(), { handleError: p, showToaster: k } = G(), { getToken: B, getCustomFonts: M, getSyncModulesStatus: T } = K(), { handleEvent: v } = z(), { handleModuleAdd: F } = j(), { getStripoBlocksConfig: A } = O(), { getStripoNotifications: V } = $(), f = () => n || (n = new Promise((i, s) => {
|
|
21
|
+
var d;
|
|
22
22
|
if (document.getElementById("UiEditorScript")) {
|
|
23
23
|
i();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(
|
|
26
|
+
const o = Z.guido, r = `https://email-static.useinsider.com/guido/${(d = o == null ? void 0 : o.stripo) == null ? void 0 : d.version}/UIEditor.js`, e = document.createElement("script");
|
|
27
27
|
e.id = "UiEditorScript", e.type = "module", e.src = r, e.onload = () => i(), e.onerror = () => {
|
|
28
28
|
e.remove(), s(new Error(`Failed to load Stripo UIEditor script from S3: ${r}`));
|
|
29
29
|
}, document.body.appendChild(e);
|
|
@@ -31,12 +31,12 @@ const Ce = () => {
|
|
|
31
31
|
n = null;
|
|
32
32
|
}), n), _ = async (i, s, o, a = [], r = !1) => {
|
|
33
33
|
var y, E, h, C;
|
|
34
|
-
const e = b(), { html:
|
|
34
|
+
const e = b(), { html: d, 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 = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1);
|
|
35
35
|
await window.UIEditor.initEditor(
|
|
36
36
|
document.querySelector("#guido-editor"),
|
|
37
37
|
{
|
|
38
38
|
metadata: s,
|
|
39
|
-
html:
|
|
39
|
+
html: d,
|
|
40
40
|
css: D,
|
|
41
41
|
forceRecreate: U,
|
|
42
42
|
locale: "en",
|
|
@@ -80,16 +80,16 @@ const Ce = () => {
|
|
|
80
80
|
],
|
|
81
81
|
async onTokenRefreshRequest(t) {
|
|
82
82
|
try {
|
|
83
|
-
const
|
|
84
|
-
t(
|
|
85
|
-
} catch (
|
|
86
|
-
p(
|
|
83
|
+
const l = await B();
|
|
84
|
+
t(l);
|
|
85
|
+
} catch (l) {
|
|
86
|
+
p(l, "Failed to refresh token");
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
onTemplateLoaded() {
|
|
90
90
|
try {
|
|
91
|
-
const { importCss: t } = H(), { activateCustomViewStyles:
|
|
92
|
-
t(),
|
|
91
|
+
const { importCss: t } = H(), { activateCustomViewStyles: l, updateTimerInClonedTemplate: I } = L(), { injectFullStory: x } = N();
|
|
92
|
+
t(), l(), x(), I(), o.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
93
93
|
e.hasChanges = !1;
|
|
94
94
|
}, 1e3);
|
|
95
95
|
} catch (t) {
|
|
@@ -108,7 +108,7 @@ const Ce = () => {
|
|
|
108
108
|
onDataChanged() {
|
|
109
109
|
e.hasChanges = !0;
|
|
110
110
|
},
|
|
111
|
-
onEvent:
|
|
111
|
+
onEvent: v,
|
|
112
112
|
onModuleAdd: F,
|
|
113
113
|
notifications: V(),
|
|
114
114
|
ignoreClickOutsideSelectors: [
|
|
@@ -126,8 +126,8 @@ const Ce = () => {
|
|
|
126
126
|
try {
|
|
127
127
|
await f();
|
|
128
128
|
const [r, e] = await Promise.all([
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
M(),
|
|
130
|
+
T()
|
|
131
131
|
]);
|
|
132
132
|
a.syncModulesEnabled = e, await _(i, s, o, r, e);
|
|
133
133
|
} catch {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const e = "Items", o = "Default", t = "Custom", s = {
|
|
2
2
|
"Global Styles & Layout": "Global Styles and Layout",
|
|
3
3
|
"Structures & Modules": "Structures and Modules",
|
|
4
|
-
"Recommendation Block": "Recommendation",
|
|
4
|
+
"Recommendation Block": "Recommendation Block",
|
|
5
5
|
Items: e,
|
|
6
6
|
"This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
|
|
7
7
|
"This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.",
|
|
@@ -2,14 +2,15 @@ import { migrateCheckbox as t } from "./checkboxMigrator.js";
|
|
|
2
2
|
import { migrateCouponBlock as i } from "./couponBlockMigrator.js";
|
|
3
3
|
import { migrateItemsBlock as e } from "./itemsBlockMigrator.js";
|
|
4
4
|
import { migrateProductNameLink as a } from "./productNameLinkMigrator.js";
|
|
5
|
-
import { migrateRadioButton as
|
|
6
|
-
import { migrateRecommendation as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { migrateRadioButton as n } from "./radioButtonMigrator.js";
|
|
6
|
+
import { migrateRecommendation as c } from "./recommendationMigrator.js";
|
|
7
|
+
import { migrateRecommendationTitle as g } from "./recommendationTitleMigrator.js";
|
|
8
|
+
import { migrateSocialIcons as p } from "./socialIconMigrator.js";
|
|
9
|
+
import { migrateUnsubscribe as f } from "./unsubscribeMigrator.js";
|
|
10
|
+
const C = async (o, r = {}) => {
|
|
11
|
+
let m = o;
|
|
12
|
+
return m = t(m), m = n(m), m = await f(m), m = i(m), m = c(m, r), m = g(m), m = e(m), m = a(m), m = p(m), m;
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
C as migrate
|
|
15
16
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { DEFAULT_COMPOSITION as p, DEFAULT_VISIBILITY as I } from "../../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
2
|
-
import {
|
|
3
|
-
import { mapTextTheme as
|
|
4
|
-
const C = "__title__",
|
|
5
|
-
function
|
|
2
|
+
import { ATTR_RECOMMENDATION_TITLE as l, ATTR_CUSTOM_PREFIX as k, ATTR_PRODUCT_BUTTON as A, ATTR_PRODUCT_OMNIBUS_DISCOUNT as R, ATTR_PRODUCT_OMNIBUS_PRICE as x, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as h, ATTR_PRODUCT_NAME as E, ATTR_PRODUCT_IMAGE as O } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
3
|
+
import { mapTextTheme as b, mapButtonTheme as y, mapImageTheme as N } from "./themeMapper.js";
|
|
4
|
+
const C = "__title__", T = "product_attribute.";
|
|
5
|
+
function P(r) {
|
|
6
6
|
const t = r.variable ?? "";
|
|
7
7
|
switch (t) {
|
|
8
8
|
case "p_recommendation_title":
|
|
9
9
|
return { key: C, kind: "title" };
|
|
10
10
|
case "p_image":
|
|
11
|
-
return { key:
|
|
11
|
+
return { key: O, kind: "image" };
|
|
12
12
|
case "p_name":
|
|
13
|
-
return { key:
|
|
13
|
+
return { key: E, kind: "text" };
|
|
14
14
|
case "p_price":
|
|
15
|
-
return { key:
|
|
15
|
+
return { key: h, kind: "text" };
|
|
16
16
|
case "p_original_price":
|
|
17
17
|
return { key: f, kind: "text" };
|
|
18
18
|
case "p_omnibus_price":
|
|
19
19
|
return { key: x, kind: "text" };
|
|
20
20
|
case "p_omnibus_discount":
|
|
21
|
-
return { key:
|
|
21
|
+
return { key: R, kind: "text" };
|
|
22
22
|
case "p_button":
|
|
23
|
-
return { key:
|
|
23
|
+
return { key: A, kind: "button" };
|
|
24
24
|
default:
|
|
25
25
|
if (r.variableType === "p_attribute" || t.startsWith("p_attribute_")) {
|
|
26
|
-
const o = r.value ?? "", s = o.startsWith(
|
|
26
|
+
const o = r.value ?? "", s = o.startsWith(T) ? o.slice(T.length) : o;
|
|
27
27
|
if (!s)
|
|
28
28
|
return null;
|
|
29
|
-
const e = o || `${
|
|
29
|
+
const e = o || `${T}${s}`;
|
|
30
30
|
return {
|
|
31
|
-
key: `${
|
|
31
|
+
key: `${k}${e}`,
|
|
32
32
|
kind: "custom",
|
|
33
33
|
customAttrName: s,
|
|
34
34
|
customAttrValue: e
|
|
@@ -41,7 +41,7 @@ function _(r) {
|
|
|
41
41
|
const t = p.indexOf(r);
|
|
42
42
|
return t === -1 ? Number.POSITIVE_INFINITY : t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function V(r) {
|
|
45
45
|
const t = {
|
|
46
46
|
composition: [],
|
|
47
47
|
visibility: { ...I },
|
|
@@ -54,10 +54,10 @@ function S(r) {
|
|
|
54
54
|
return t.composition = [...p], t;
|
|
55
55
|
const o = [];
|
|
56
56
|
r.forEach((e, i) => {
|
|
57
|
-
const n =
|
|
57
|
+
const n = P(e);
|
|
58
58
|
if (n) {
|
|
59
59
|
if (n.kind === "title") {
|
|
60
|
-
t.titleVariable = e;
|
|
60
|
+
t.titleVariable = e, t.visibility[l] = e.hidden !== !0;
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
o.push({
|
|
@@ -82,20 +82,20 @@ function S(r) {
|
|
|
82
82
|
const { key: i, kind: n, hidden: u, legacy: c, customAttrName: d, customAttrValue: m } = e;
|
|
83
83
|
switch (t.composition.push(i), t.visibility[i] = !u, n === "custom" && d && m && (t.customAttributes.includes(m) || t.customAttributes.push(m), t.customAttrValues[i] = m), n) {
|
|
84
84
|
case "image":
|
|
85
|
-
s[i] =
|
|
85
|
+
s[i] = N(c.theme);
|
|
86
86
|
break;
|
|
87
87
|
case "button":
|
|
88
|
-
s[i] =
|
|
88
|
+
s[i] = y(c.theme);
|
|
89
89
|
break;
|
|
90
90
|
case "text":
|
|
91
91
|
case "custom": {
|
|
92
|
-
const
|
|
93
|
-
s[i] =
|
|
92
|
+
const a = b(c.theme);
|
|
93
|
+
s[i] = a, a.textTrimming && (t.anyTextTrimming = !0);
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}), t.perElementStyles = s, t;
|
|
98
98
|
}
|
|
99
99
|
export {
|
|
100
|
-
|
|
100
|
+
V as mapComposition
|
|
101
101
|
};
|
|
@@ -1,49 +1,54 @@
|
|
|
1
1
|
import { CURRENCY_ATTR as n, CSS_CLASS_SKIP_COMPILE as c } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
2
|
const a = "You May Also Like!";
|
|
3
|
-
function
|
|
4
|
-
var
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
3
|
+
function A(t) {
|
|
4
|
+
var i;
|
|
5
|
+
const e = t.querySelector(".ext-recommendation-title");
|
|
6
|
+
if (!e)
|
|
7
7
|
return a;
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const r = (i = e.textContent) == null ? void 0 : i.trim();
|
|
9
|
+
return r && r.length > 0 ? r : a;
|
|
10
10
|
}
|
|
11
11
|
function m(t) {
|
|
12
|
-
const
|
|
12
|
+
const e = t.querySelector(".ext-recommendation-title");
|
|
13
|
+
return e ? !/display\s*:\s*none/i.test(e.getAttribute("style") ?? "") : !1;
|
|
14
|
+
}
|
|
15
|
+
function d(t) {
|
|
16
|
+
const e = [
|
|
13
17
|
t,
|
|
14
18
|
...Array.from(t.querySelectorAll(".product-card, .ext-recommendation-card"))
|
|
15
19
|
];
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
21
|
-
const u = (
|
|
22
|
-
return u && u[1] ? (
|
|
23
|
-
}),
|
|
20
|
+
let r = "";
|
|
21
|
+
return e.some((i) => {
|
|
22
|
+
const o = i.getAttribute("bgcolor");
|
|
23
|
+
if (o && o.trim())
|
|
24
|
+
return r = o.trim(), !0;
|
|
25
|
+
const u = (i.getAttribute("style") ?? "").match(/background-color\s*:\s*([^;]+)/i);
|
|
26
|
+
return u && u[1] ? (r = u[1].trim(), !0) : !1;
|
|
27
|
+
}), r;
|
|
24
28
|
}
|
|
25
29
|
function C(t) {
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
30
|
+
const e = t.getAttribute(n.CURRENCY);
|
|
31
|
+
if (!e)
|
|
28
32
|
return;
|
|
29
|
-
const
|
|
33
|
+
const r = t.getAttribute(n.SYMBOL);
|
|
30
34
|
return {
|
|
31
|
-
value:
|
|
35
|
+
value: e,
|
|
32
36
|
// An empty `currency-symbol` is omitted so `mapCurrency` falls back to
|
|
33
37
|
// the currency code as the symbol.
|
|
34
|
-
...
|
|
38
|
+
...r ? { symbol: r } : {},
|
|
35
39
|
alignment: t.getAttribute(n.ALIGNMENT) ?? "",
|
|
36
40
|
decimalCount: t.getAttribute(n.DECIMAL_COUNT) ?? "",
|
|
37
41
|
decimalSeparator: t.getAttribute(n.DECIMAL_SEPARATOR) ?? "",
|
|
38
42
|
thousandSeparator: t.getAttribute(n.THOUSAND_SEPARATOR) ?? ""
|
|
39
43
|
};
|
|
40
44
|
}
|
|
41
|
-
function
|
|
45
|
+
function g(t) {
|
|
42
46
|
return t.classList.contains(c);
|
|
43
47
|
}
|
|
44
48
|
export {
|
|
45
|
-
|
|
49
|
+
d as extractCardBgColor,
|
|
46
50
|
C as extractCurrencyFromBlock,
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
A as extractTitleText,
|
|
52
|
+
m as hasVisibleTitle,
|
|
53
|
+
g as isPartnerManagedBlock
|
|
49
54
|
};
|