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