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