@useinsider/guido 3.18.1-beta.c912b03 → 3.18.1-beta.d0bc5f3
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 +1 -3
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +70 -72
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +9 -7
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +76 -87
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +22 -24
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +26 -28
- package/dist/composables/useCustomInterfaceAppearance.js +42 -46
- package/dist/enums/extensions/recommendationBlock.js +37 -31
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +71 -72
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +37 -68
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +44 -45
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +119 -105
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +7 -7
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +52 -61
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -4
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +45 -54
- package/dist/src/services/recommendationApi.d.ts +1 -2
- package/dist/src/stores/config.d.ts +0 -160
- package/dist/src/stores/onboarding.d.ts +0 -421
- package/dist/static/styles/components/recommendation-strategy.css.js +41 -74
- package/dist/stores/config.js +59 -66
- package/dist/stores/onboarding.js +1 -6
- package/package.json +1 -1
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +0 -21
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +0 -46
- package/dist/composables/useLegacyStrategyConversion.js +0 -54
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -58
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +0 -2
- package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +0 -2
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +0 -39
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
- package/dist/static/assets/icons/line-info.svg.js +0 -5
|
@@ -24,9 +24,7 @@ const p = {
|
|
|
24
24
|
b(1, "userId is required")
|
|
25
25
|
),
|
|
26
26
|
/** Optional variation ID for A/B testing */
|
|
27
|
-
variationId: e(t())
|
|
28
|
-
/** Optional numeric campaign ID of the host campaign; absent for templates and modules */
|
|
29
|
-
campaignId: e(t())
|
|
27
|
+
variationId: e(t())
|
|
30
28
|
}), L = a({
|
|
31
29
|
/** Fallback font name (e.g., "Georgia") */
|
|
32
30
|
name: t(),
|
|
@@ -3,7 +3,7 @@ import o from "./Guido.vue2.js";
|
|
|
3
3
|
import i from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
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(),
|
|
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(
|
|
@@ -12,9 +12,9 @@ var t = function() {
|
|
|
12
12
|
s,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"cc5ee925"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const v = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
v as default
|
|
20
20
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { provideGuidoActions as
|
|
5
|
-
import { useGuidoStateBridge as
|
|
6
|
-
import { usePartner as
|
|
7
|
-
import { useStripo as
|
|
8
|
-
import { useTimerClone as
|
|
9
|
-
import { migrate as
|
|
10
|
-
import { ModuleFolderDefaults as
|
|
11
|
-
import { RIBBON_SELECTOR as
|
|
12
|
-
import { useRecommendationExtensionStore as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import { useStripoApi as
|
|
21
|
-
import { useConfigStore as
|
|
22
|
-
import { useDynamicContentStore as
|
|
1
|
+
import { defineComponent as ne, defineAsyncComponent as l, ref as O, computed as u, watch as x, onMounted as re, onUnmounted as se } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as ae } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as ie } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ce } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as de } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as me } from "../composables/usePartner.js";
|
|
7
|
+
import { useStripo as le } from "../composables/useStripo.js";
|
|
8
|
+
import { useTimerClone as ue } from "../composables/useTimerClone.js";
|
|
9
|
+
import { migrate as W } from "../config/migrator/index.js";
|
|
10
|
+
import { ModuleFolderDefaults as G } from "../enums/defaults.js";
|
|
11
|
+
import { RIBBON_SELECTOR as pe } from "../enums/onboarding.js";
|
|
12
|
+
import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
|
+
import fe from "./organisms/AutoSaveController.vue.js";
|
|
14
|
+
import ye from "./organisms/base/Toaster.vue.js";
|
|
15
|
+
import ge from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
16
|
+
import ve from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
|
+
import Se from "./organisms/LoadingWrapper.vue.js";
|
|
18
|
+
import be from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
19
|
+
import he from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
20
|
+
import { useStripoApi as Ee } from "../services/stripoApi.js";
|
|
21
|
+
import { useConfigStore as we } from "../stores/config.js";
|
|
22
|
+
import { useDynamicContentStore as Ce } from "../stores/dynamic-content.js";
|
|
23
23
|
import { useEditorStore as H } from "../stores/editor.js";
|
|
24
|
-
import { usePreviewStore as
|
|
25
|
-
import { useTemplateStore as
|
|
26
|
-
import { useUnsubscribeStore as
|
|
24
|
+
import { usePreviewStore as De } from "../stores/preview.js";
|
|
25
|
+
import { useTemplateStore as ke } from "../stores/template.js";
|
|
26
|
+
import { useUnsubscribeStore as Te } from "../stores/unsubscribe.js";
|
|
27
27
|
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
28
|
-
const
|
|
28
|
+
const et = /* @__PURE__ */ ne({
|
|
29
29
|
__name: "Guido",
|
|
30
30
|
props: {
|
|
31
31
|
config: null,
|
|
@@ -33,25 +33,23 @@ const tt = /* @__PURE__ */ re({
|
|
|
33
33
|
},
|
|
34
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
35
|
setup(z, { expose: q, emit: r }) {
|
|
36
|
-
const a = z, K =
|
|
36
|
+
const a = z, K = l(
|
|
37
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
), V =
|
|
38
|
+
), V = l(
|
|
39
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
), j =
|
|
40
|
+
), j = l(
|
|
41
41
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
42
|
-
), J =
|
|
42
|
+
), J = l(
|
|
43
43
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
44
|
-
),
|
|
45
|
-
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
46
|
-
), h = O(), p = O(), f = De(), E = Fe(), o = Ce();
|
|
44
|
+
), E = O(), p = O(), f = Ce(), w = Te(), o = we();
|
|
47
45
|
a.ready && o.init(a.config);
|
|
48
|
-
const c = H(),
|
|
46
|
+
const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), C = () => {
|
|
49
47
|
var t;
|
|
50
|
-
return (t =
|
|
51
|
-
},
|
|
48
|
+
return (t = E.value) == null ? void 0 : t.handleSave(!0);
|
|
49
|
+
}, D = (t) => {
|
|
52
50
|
c.loadingStatus = t;
|
|
53
51
|
};
|
|
54
|
-
|
|
52
|
+
ae(), de();
|
|
55
53
|
const y = () => {
|
|
56
54
|
var t, e;
|
|
57
55
|
return {
|
|
@@ -59,18 +57,18 @@ const tt = /* @__PURE__ */ re({
|
|
|
59
57
|
userId: o.userId,
|
|
60
58
|
username: o.username,
|
|
61
59
|
partnerName: o.partnerName,
|
|
62
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
63
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
60
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || G.SAVED_MODULES,
|
|
61
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || G.DEFAULT_MODULES
|
|
64
62
|
};
|
|
65
|
-
}, { initPlugin:
|
|
63
|
+
}, { initPlugin: k, preloadRuntime: T } = le(), { runExclusive: F, beginMount: R, isCurrentMount: I } = ie();
|
|
66
64
|
let g = 0;
|
|
67
|
-
const { getDefaultTemplate:
|
|
65
|
+
const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: L, hasTimerBlocks: B } = ue(), Y = u(() => {
|
|
68
66
|
var t;
|
|
69
67
|
return !((t = o.ui) != null && t.showHeader);
|
|
70
|
-
}),
|
|
71
|
-
() => !!
|
|
68
|
+
}), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
|
|
69
|
+
() => !!h().recommendationConfigs.strategyId
|
|
72
70
|
);
|
|
73
|
-
|
|
71
|
+
ce({
|
|
74
72
|
onBack: () => {
|
|
75
73
|
console.debug("guido:back"), r("back");
|
|
76
74
|
},
|
|
@@ -85,13 +83,13 @@ const tt = /* @__PURE__ */ re({
|
|
|
85
83
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
86
84
|
}
|
|
87
85
|
});
|
|
88
|
-
const
|
|
86
|
+
const A = (t) => {
|
|
89
87
|
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
90
|
-
},
|
|
88
|
+
}, P = () => {
|
|
91
89
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
92
90
|
};
|
|
93
|
-
|
|
94
|
-
r("on-change",
|
|
91
|
+
x(() => m.value, () => {
|
|
92
|
+
r("on-change", m.value);
|
|
95
93
|
});
|
|
96
94
|
const v = (t) => {
|
|
97
95
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
@@ -100,48 +98,48 @@ const tt = /* @__PURE__ */ re({
|
|
|
100
98
|
let i = null;
|
|
101
99
|
const S = () => {
|
|
102
100
|
var e;
|
|
103
|
-
const t = document.querySelector(
|
|
101
|
+
const t = document.querySelector(pe);
|
|
104
102
|
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
105
103
|
}, b = async () => {
|
|
106
104
|
var t;
|
|
107
105
|
try {
|
|
108
106
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
109
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
110
|
-
|
|
107
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", U = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
108
|
+
w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
111
109
|
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
|
|
112
110
|
let n = {
|
|
113
|
-
html: s && await
|
|
111
|
+
html: s && await W(s, _),
|
|
114
112
|
css: d
|
|
115
113
|
};
|
|
116
|
-
n.html || (n = await
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
preselectedDynamicContentList:
|
|
114
|
+
n.html || (n = await M(), n.html = await W(n.html, _));
|
|
115
|
+
const te = N ? $(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
116
|
+
B(n.html) && (n.html = await L(n.html)), N && (c.trackIdSessionFloor = Math.max(te, $(n.html)));
|
|
117
|
+
const oe = {
|
|
118
|
+
preselectedDynamicContentList: U,
|
|
121
119
|
onReady: () => {
|
|
122
120
|
console.debug("guido:ready"), r("ready");
|
|
123
121
|
}
|
|
124
122
|
};
|
|
125
|
-
g =
|
|
123
|
+
g = R(), await k(n, y(), oe), f.selectedDynamicContentList = U;
|
|
126
124
|
} catch (e) {
|
|
127
125
|
console.error("Failed to initialize Stripo editor:", e);
|
|
128
126
|
}
|
|
129
127
|
};
|
|
130
|
-
return
|
|
128
|
+
return re(async () => {
|
|
131
129
|
var e;
|
|
132
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
130
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), ke().$reset(), S();
|
|
133
131
|
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
134
|
-
if (t && (i = new ResizeObserver(S), i.observe(t)),
|
|
132
|
+
if (t && (i = new ResizeObserver(S), i.observe(t)), T(), a.ready)
|
|
135
133
|
await b();
|
|
136
134
|
else {
|
|
137
|
-
const s =
|
|
135
|
+
const s = x(() => a.ready, (d) => {
|
|
138
136
|
d && (s(), b());
|
|
139
137
|
});
|
|
140
138
|
}
|
|
141
139
|
document.addEventListener("dynamic-content:open", v);
|
|
142
|
-
}),
|
|
143
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v),
|
|
144
|
-
if (
|
|
140
|
+
}), se(() => {
|
|
141
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), F(async () => {
|
|
142
|
+
if (I(g))
|
|
145
143
|
try {
|
|
146
144
|
window.UIEditor.removeEditor();
|
|
147
145
|
} catch {
|
|
@@ -150,15 +148,15 @@ const tt = /* @__PURE__ */ re({
|
|
|
150
148
|
}), o.reset();
|
|
151
149
|
}), q({
|
|
152
150
|
dynamicContent: {
|
|
153
|
-
insert:
|
|
154
|
-
close:
|
|
151
|
+
insert: A,
|
|
152
|
+
close: P
|
|
155
153
|
},
|
|
156
|
-
hasChanges:
|
|
157
|
-
saveSilent:
|
|
158
|
-
setLoading:
|
|
159
|
-
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J,
|
|
154
|
+
hasChanges: m,
|
|
155
|
+
saveSilent: C,
|
|
156
|
+
setLoading: D
|
|
157
|
+
}), { __sfc: !0, PreviewContainer: K, OnboardingWrapper: V, AssignStrategyDrawer: j, RemoveStrategyModal: J, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: a, configStore: o, editorStore: c, previewStore: Q, hasChanges: m, isTestPartner: X, saveSilent: C, setLoading: D, emit: r, buildMetadata: y, initPlugin: k, preloadRuntime: T, runExclusive: F, beginMount: R, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: M, cloneTimersOnSave: L, hasTimerBlocks: B, noHeader: Y, isRrsEnabled: Z, hasAssignedStrategy: ee, insertDynamicContent: A, closeDynamicContent: P, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: S, startEditor: b, AutoSaveController: fe, Toaster: ye, FilterSelectionDrawer: ge, HeaderWrapper: ve, LoadingWrapper: Se, SaveAsTemplateDrawer: be, UnsubscribeWrapper: he };
|
|
160
158
|
}
|
|
161
159
|
});
|
|
162
160
|
export {
|
|
163
|
-
|
|
161
|
+
et as default
|
|
164
162
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s from "./AssignStrategyDrawer.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
5
5
|
var a = function() {
|
|
6
|
-
var e = this,
|
|
7
|
-
return t.store.assignStrategyDrawerStatus ?
|
|
8
|
-
return [
|
|
9
|
-
|
|
6
|
+
var e = this, r = e._self._c, t = e._self._setupProxy;
|
|
7
|
+
return t.store.assignStrategyDrawerStatus ? r(t.OrgStrategyDetailModal, { staticClass: "assign-strategy-drawer", attrs: { "description-status": "", show: "", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, strategy: t.selectedStrategy ?? {}, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { close: t.closeDrawer, primaryClick: t.assignStrategy }, scopedSlots: e._u([{ key: "contentTop", fn: function() {
|
|
8
|
+
return [r("div", { staticClass: "assign-strategy-drawer-content px-5 py-5" }, [r(t.OrgStrategyDropdown, { staticClass: "assign-strategy-select", attrs: { id: "assign-strategy-select", "create-button-visible": "", "info-box-position": "bottom right", loading: t.store.strategiesLoading, "placeholder-text": t.trans("smart-recommender.select-recommendation-strategy"), "selected-strategy-id": t.selectedStrategyId, state: t.showSelectionError ? "error" : "default", "state-message": t.showSelectionError ? t.trans("ds-steps.select-strategy-tooltip") : "", strategies: t.strategyOptions }, on: { create: function(l) {
|
|
9
|
+
return t.store.openStrategyCreation();
|
|
10
|
+
}, infoBoxButtonClick: t.onInfoBoxButtonClick, select: t.onSelect } })], 1)];
|
|
11
|
+
}, proxy: !0 }], null, !1, 1517791821) }) : e._e();
|
|
10
12
|
}, n = [], i = /* @__PURE__ */ o(
|
|
11
|
-
|
|
13
|
+
s,
|
|
12
14
|
a,
|
|
13
15
|
n,
|
|
14
16
|
!1,
|
|
15
17
|
null,
|
|
16
|
-
"
|
|
18
|
+
"3bcefe18"
|
|
17
19
|
);
|
|
18
20
|
const y = i.exports;
|
|
19
21
|
export {
|
|
@@ -1,73 +1,48 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as E, defineAsyncComponent as u, ref as f, computed as c, watch as O } from "vue";
|
|
2
2
|
import "@useinsider/design-system-organisms/style";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const st = /* @__PURE__ */ h({
|
|
3
|
+
import { useToaster as h } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as A } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as I } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as C } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as d } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as B } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import b from "./StrategyInfoBoxContent.vue.js";
|
|
10
|
+
import { formatShortDate as N } from "../../../../utils/dateUtil.js";
|
|
11
|
+
import { asText as S } from "../../../../utils/genericUtil.js";
|
|
12
|
+
import { escapeHtml as k } from "../../../../utils/htmlEscape.js";
|
|
13
|
+
import { InSkeleton as P } from "@useinsider/design-system-vue";
|
|
14
|
+
const Y = /* @__PURE__ */ E({
|
|
16
15
|
__name: "AssignStrategyDrawer",
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
render: (
|
|
20
|
-
}),
|
|
21
|
-
loader: async () => (await
|
|
22
|
-
loadingComponent:
|
|
16
|
+
setup(R) {
|
|
17
|
+
const g = () => import("@useinsider/design-system-organisms"), m = (t, e) => ({
|
|
18
|
+
render: (a) => a(P, { props: { sizing: { width: t, height: e } } })
|
|
19
|
+
}), T = u({
|
|
20
|
+
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
21
|
+
loadingComponent: m(480, 240),
|
|
23
22
|
delay: 0
|
|
24
|
-
}),
|
|
25
|
-
loader: async () => (await
|
|
26
|
-
loadingComponent:
|
|
23
|
+
}), _ = u({
|
|
24
|
+
loader: async () => (await g()).OrgStrategyDropdown,
|
|
25
|
+
loadingComponent: m(240, 42),
|
|
27
26
|
delay: 0
|
|
28
|
-
}),
|
|
29
|
-
|
|
27
|
+
}), o = "guido-edit-strategy-", s = A(), r = B(), { showToaster: n } = h(), i = f(null), l = f(!1), D = c(() => r.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: C.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
|
|
28
|
+
O(() => r.assignStrategyDrawerStatus, (t) => {
|
|
30
29
|
if (!t)
|
|
31
30
|
return;
|
|
32
|
-
const { strategyId:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
type:
|
|
36
|
-
message:
|
|
31
|
+
const { strategyId: e } = r.recommendationConfigs;
|
|
32
|
+
i.value = e || null, l.value = !1, r.fetchStrategies().catch(() => {
|
|
33
|
+
n({
|
|
34
|
+
type: d.Error,
|
|
35
|
+
message: s("discovery-strategy.error-description")
|
|
37
36
|
});
|
|
38
37
|
});
|
|
39
38
|
});
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
39
|
+
const p = (t) => {
|
|
40
|
+
const e = S(t.updated_at || t.created_at);
|
|
41
|
+
if (!e)
|
|
43
42
|
return "";
|
|
44
|
-
const
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
text: r("ds-steps.legacy-strategy"),
|
|
48
|
-
value: y,
|
|
49
|
-
infoBoxProps: {
|
|
50
|
-
id: "strategy-info-legacy",
|
|
51
|
-
theme: "light",
|
|
52
|
-
variant: "information",
|
|
53
|
-
className: "assign-strategy-info-box",
|
|
54
|
-
titleText: x(r("ds-steps.legacy-strategy")),
|
|
55
|
-
descriptionStatus: !0,
|
|
56
|
-
descriptionText: r("statistics.legacy-strategy-description"),
|
|
57
|
-
buttonOptions: [{
|
|
58
|
-
id: d,
|
|
59
|
-
type: "primary",
|
|
60
|
-
text: r("ds-steps.update"),
|
|
61
|
-
loadingStatus: e.legacyConversionLoading,
|
|
62
|
-
disabledStatus: e.legacyConversionLoading
|
|
63
|
-
}]
|
|
64
|
-
}
|
|
65
|
-
})), E = async (t) => {
|
|
66
|
-
if ((t == null ? void 0 : t.id) !== d)
|
|
67
|
-
return;
|
|
68
|
-
const a = await u();
|
|
69
|
-
a && (o.value = a);
|
|
70
|
-
}, m = s(() => e.strategies.map((t) => ({
|
|
43
|
+
const a = N(e, I);
|
|
44
|
+
return s("recommendation-strategy.last-updated-on", { value: a });
|
|
45
|
+
}, w = c(() => r.strategies.map((t) => ({
|
|
71
46
|
text: t.name,
|
|
72
47
|
value: t.strategy_id,
|
|
73
48
|
infoBoxProps: {
|
|
@@ -75,57 +50,71 @@ const st = /* @__PURE__ */ h({
|
|
|
75
50
|
theme: "light",
|
|
76
51
|
variant: "information",
|
|
77
52
|
className: "assign-strategy-info-box",
|
|
78
|
-
titleText:
|
|
53
|
+
titleText: k(S(t.name)),
|
|
79
54
|
descriptionStatus: !0,
|
|
80
|
-
descriptionText:
|
|
81
|
-
slot:
|
|
82
|
-
slotProps: { strategy: t }
|
|
55
|
+
descriptionText: p(t),
|
|
56
|
+
slot: b,
|
|
57
|
+
slotProps: { strategy: t },
|
|
58
|
+
// The info box drops the option's value/text, so the id is the only channel
|
|
59
|
+
// that can carry the strategy back to the click handler.
|
|
60
|
+
buttonOptions: [{
|
|
61
|
+
id: `${o}${t.strategy_id}`,
|
|
62
|
+
text: s("eureka.edit-strategy"),
|
|
63
|
+
type: "text",
|
|
64
|
+
// Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
|
|
65
|
+
// silently render blank space instead of failing.
|
|
66
|
+
icon: "line-open-website"
|
|
67
|
+
}]
|
|
83
68
|
}
|
|
84
|
-
}))),
|
|
85
|
-
|
|
69
|
+
}))), v = (t) => {
|
|
70
|
+
var a;
|
|
71
|
+
const e = (a = t == null ? void 0 : t.id) != null && a.startsWith(o) ? t.id.slice(o.length) : "";
|
|
72
|
+
e && r.openStrategyEdit(e);
|
|
73
|
+
}, y = c(() => {
|
|
74
|
+
const t = r.strategies.find((e) => String(e.strategy_id) === String(i.value ?? ""));
|
|
86
75
|
return t ? { ...t, fallback_config: null } : null;
|
|
87
|
-
}),
|
|
76
|
+
}), x = c(() => ({
|
|
88
77
|
primaryButton: {
|
|
89
78
|
styling: "solid",
|
|
90
79
|
type: "primary",
|
|
91
|
-
labelText:
|
|
80
|
+
labelText: s("products.assign-btn")
|
|
92
81
|
},
|
|
93
82
|
cancelOrBackButton: {
|
|
94
83
|
styling: "ghost",
|
|
95
84
|
type: "secondary",
|
|
96
|
-
labelText:
|
|
85
|
+
labelText: s("products.cancel")
|
|
97
86
|
}
|
|
98
87
|
}));
|
|
99
|
-
return { __sfc: !0, loadOrganisms:
|
|
100
|
-
|
|
88
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: m, OrgStrategyDetailModal: T, OrgStrategyDropdown: _, EDIT_BUTTON_ID_PREFIX: o, trans: s, store: r, showToaster: n, selectedStrategyId: i, showSelectionError: l, drawerDescription: D, lastUpdatedText: p, strategyOptions: w, onInfoBoxButtonClick: v, selectedStrategy: y, footerButtonGroupOptions: x, closeDrawer: () => {
|
|
89
|
+
r.closeAssignStrategyDrawer();
|
|
101
90
|
}, assignStrategy: async () => {
|
|
102
|
-
const t =
|
|
91
|
+
const t = y.value;
|
|
103
92
|
if (!t) {
|
|
104
|
-
|
|
93
|
+
l.value = !0;
|
|
105
94
|
return;
|
|
106
95
|
}
|
|
107
|
-
let
|
|
96
|
+
let e = "";
|
|
108
97
|
try {
|
|
109
|
-
|
|
110
|
-
} catch (
|
|
111
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
98
|
+
e = await r.resolveStrategyUrlTemplate(t, r.recommendationConfigs.currencySettings.value);
|
|
99
|
+
} catch (a) {
|
|
100
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", a);
|
|
112
101
|
}
|
|
113
|
-
if (!
|
|
114
|
-
|
|
115
|
-
type:
|
|
116
|
-
message:
|
|
102
|
+
if (!e) {
|
|
103
|
+
n({
|
|
104
|
+
type: d.Error,
|
|
105
|
+
message: s("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
117
106
|
});
|
|
118
107
|
return;
|
|
119
108
|
}
|
|
120
|
-
|
|
121
|
-
type:
|
|
122
|
-
message:
|
|
123
|
-
}),
|
|
109
|
+
r.assignStrategy(t), n({
|
|
110
|
+
type: d.Success,
|
|
111
|
+
message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
112
|
+
}), r.closeAssignStrategyDrawer();
|
|
124
113
|
}, onSelect: (t) => {
|
|
125
|
-
|
|
114
|
+
i.value = t.value, l.value = !1;
|
|
126
115
|
} };
|
|
127
116
|
}
|
|
128
117
|
});
|
|
129
118
|
export {
|
|
130
|
-
|
|
119
|
+
Y as default
|
|
131
120
|
};
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useToaster as
|
|
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
4
|
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import "../../../../extensions/Blocks/Recommendation/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { escapeHtml as S } from "../../../../utils/htmlEscape.js";
|
|
11
|
-
const w = /* @__PURE__ */ y({
|
|
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({
|
|
12
10
|
__name: "RemoveStrategyModal",
|
|
13
|
-
setup(
|
|
14
|
-
const t = _(), e =
|
|
11
|
+
setup(S) {
|
|
12
|
+
const t = _(), e = T(), { showToaster: a } = f(), i = n(() => ({
|
|
15
13
|
cancelOrBackButton: {
|
|
16
14
|
type: "secondary",
|
|
17
15
|
labelText: t("products.cancel"),
|
|
@@ -22,38 +20,38 @@ const w = /* @__PURE__ */ y({
|
|
|
22
20
|
labelText: t("discovery-strategy.remove")
|
|
23
21
|
}
|
|
24
22
|
})), m = n(() => {
|
|
25
|
-
var
|
|
26
|
-
const { strategyId:
|
|
27
|
-
return
|
|
23
|
+
var o;
|
|
24
|
+
const { strategyId: r } = e.recommendationConfigs;
|
|
25
|
+
return ((o = e.assignedStrategy) == null ? void 0 : o.name) || `#${r}`;
|
|
28
26
|
}), s = "__STRATEGY_NAME__", d = n(() => t("email-editor.remove-strategy-confirm-message", { strategyName: s }).split(s)), c = () => {
|
|
29
27
|
e.closeRemoveStrategyModal();
|
|
30
28
|
};
|
|
31
29
|
return { __sfc: !0, trans: t, store: e, showToaster: a, footerButtonOptions: i, strategyName: m, NAME_TOKEN: s, messageParts: d, close: c, handleConfirm: async () => {
|
|
32
|
-
const
|
|
30
|
+
const r = m.value, o = e.currentRecommendationId;
|
|
33
31
|
e.removeStrategy(), c();
|
|
34
32
|
const { strategyId: l, size: g } = e.recommendationConfigs;
|
|
35
33
|
if (a({
|
|
36
|
-
type:
|
|
34
|
+
type: v.Success,
|
|
37
35
|
// The toast renders through a sanitizing v-html, so the name is escaped first.
|
|
38
36
|
message: t("email-editor.strategy-removed-success", {
|
|
39
|
-
strategyName: `<b>${
|
|
37
|
+
strategyName: `<b>${R(r)}</b>`
|
|
40
38
|
})
|
|
41
|
-
}),
|
|
39
|
+
}), o !== null) {
|
|
42
40
|
try {
|
|
43
41
|
await e.fetchRecommendationProducts();
|
|
44
42
|
} catch (p) {
|
|
45
43
|
console.error("[RemoveStrategyModal] product refetch failed", p);
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
{ strategyId: l, size: g
|
|
45
|
+
h(
|
|
46
|
+
o,
|
|
47
|
+
{ strategyId: l, size: g },
|
|
50
48
|
e.recommendationProducts,
|
|
51
49
|
"Removed recommendation strategy"
|
|
52
50
|
);
|
|
53
51
|
}
|
|
54
|
-
}, WpModal:
|
|
52
|
+
}, WpModal: y };
|
|
55
53
|
}
|
|
56
54
|
});
|
|
57
55
|
export {
|
|
58
|
-
|
|
56
|
+
P as default
|
|
59
57
|
};
|