@useinsider/guido 3.18.0-beta.599df29 → 3.18.0-beta.88ff219
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 +3 -3
- package/dist/components/Guido.vue2.js +78 -82
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +70 -54
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +41 -54
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +46 -0
- package/dist/composables/useActionsApi.js +67 -82
- package/dist/composables/useAutoSave.js +26 -31
- package/dist/composables/useGuidoStateBridge.js +31 -37
- package/dist/composables/useSave.js +39 -42
- package/dist/enums/extensions/recommendationBlock.js +36 -31
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +35 -31
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +129 -68
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +49 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +21 -4
- package/dist/stores/onboarding.js +41 -36
- package/package.json +1 -1
- package/dist/composables/useEditorLock.js +0 -20
- package/dist/src/composables/useEditorLock.d.ts +0 -10
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
const et = /* @__PURE__ */ ne({
|
|
1
|
+
import { defineComponent as Z, defineAsyncComponent as l, ref as P, computed as u, watch as U, onMounted as ee, onUnmounted as te } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as oe } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
|
|
4
|
+
import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
|
|
5
|
+
import { usePartner as se } from "../composables/usePartner.js";
|
|
6
|
+
import { useStripo as ae } from "../composables/useStripo.js";
|
|
7
|
+
import { useTimerClone as ie } from "../composables/useTimerClone.js";
|
|
8
|
+
import { migrate as _ } from "../config/migrator/index.js";
|
|
9
|
+
import { ModuleFolderDefaults as N } from "../enums/defaults.js";
|
|
10
|
+
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
11
|
+
import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
12
|
+
import de from "./organisms/AutoSaveController.vue.js";
|
|
13
|
+
import me from "./organisms/base/Toaster.vue.js";
|
|
14
|
+
import le from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
15
|
+
import ue from "./organisms/header/HeaderWrapper.vue.js";
|
|
16
|
+
import pe from "./organisms/LoadingWrapper.vue.js";
|
|
17
|
+
import fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
18
|
+
import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
19
|
+
import { useStripoApi as ge } from "../services/stripoApi.js";
|
|
20
|
+
import { useConfigStore as ve } from "../stores/config.js";
|
|
21
|
+
import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
|
|
22
|
+
import { useEditorStore as O } from "../stores/editor.js";
|
|
23
|
+
import { usePreviewStore as he } from "../stores/preview.js";
|
|
24
|
+
import { useTemplateStore as be } from "../stores/template.js";
|
|
25
|
+
import { useUnsubscribeStore as Ee } from "../stores/unsubscribe.js";
|
|
26
|
+
import { readTrackFloor as W } from "../utils/linkTrackingIds.js";
|
|
27
|
+
const je = /* @__PURE__ */ Z({
|
|
29
28
|
__name: "Guido",
|
|
30
29
|
props: {
|
|
31
30
|
config: null,
|
|
32
31
|
ready: { type: Boolean, default: !0 }
|
|
33
32
|
},
|
|
34
33
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
|
-
setup(
|
|
36
|
-
const a =
|
|
34
|
+
setup(x, { expose: G, emit: r }) {
|
|
35
|
+
const a = x, H = l(
|
|
37
36
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
),
|
|
37
|
+
), $ = l(
|
|
39
38
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
39
|
+
), z = l(
|
|
41
40
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
42
|
-
),
|
|
41
|
+
), q = l(
|
|
43
42
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
44
|
-
),
|
|
43
|
+
), b = P(), p = P(), f = Se(), E = Ee(), o = ve();
|
|
45
44
|
a.ready && o.init(a.config);
|
|
46
|
-
const c =
|
|
45
|
+
const c = O(), K = he(), m = u(() => c.hasChanges), { isTestPartner: V } = se(), w = () => {
|
|
47
46
|
var t;
|
|
48
|
-
return (t =
|
|
47
|
+
return (t = b.value) == null ? void 0 : t.handleSave(!0);
|
|
49
48
|
}, C = (t) => {
|
|
50
49
|
c.loadingStatus = t;
|
|
51
50
|
};
|
|
52
|
-
|
|
51
|
+
oe(), re();
|
|
53
52
|
const y = () => {
|
|
54
53
|
var t, e;
|
|
55
54
|
return {
|
|
@@ -57,18 +56,16 @@ const et = /* @__PURE__ */ ne({
|
|
|
57
56
|
userId: o.userId,
|
|
58
57
|
username: o.username,
|
|
59
58
|
partnerName: o.partnerName,
|
|
60
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
61
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
59
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || N.SAVED_MODULES,
|
|
60
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || N.DEFAULT_MODULES
|
|
62
61
|
};
|
|
63
|
-
}, { initPlugin: D, preloadRuntime: k } =
|
|
64
|
-
let g = 0;
|
|
65
|
-
const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: R, hasTimerBlocks: L } = ue(), Y = u(() => {
|
|
62
|
+
}, { initPlugin: D, preloadRuntime: k } = ae(), { getDefaultTemplate: T } = ge(), { cloneTimersOnSave: F, hasTimerBlocks: R } = ie(), j = u(() => {
|
|
66
63
|
var t;
|
|
67
64
|
return !((t = o.ui) != null && t.showHeader);
|
|
68
|
-
}),
|
|
69
|
-
() => !!
|
|
65
|
+
}), J = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), Q = u(
|
|
66
|
+
() => !!h().recommendationConfigs.strategyId
|
|
70
67
|
);
|
|
71
|
-
|
|
68
|
+
ne({
|
|
72
69
|
onBack: () => {
|
|
73
70
|
console.debug("guido:back"), r("back");
|
|
74
71
|
},
|
|
@@ -83,80 +80,79 @@ const et = /* @__PURE__ */ ne({
|
|
|
83
80
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
84
81
|
}
|
|
85
82
|
});
|
|
86
|
-
const
|
|
83
|
+
const I = (t) => {
|
|
87
84
|
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
88
|
-
},
|
|
85
|
+
}, L = () => {
|
|
89
86
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
90
87
|
};
|
|
91
|
-
|
|
88
|
+
U(() => m.value, () => {
|
|
92
89
|
r("on-change", m.value);
|
|
93
90
|
});
|
|
94
|
-
const
|
|
91
|
+
const g = (t) => {
|
|
95
92
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
96
93
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
97
94
|
};
|
|
98
95
|
let i = null;
|
|
99
|
-
const
|
|
96
|
+
const v = () => {
|
|
100
97
|
var e;
|
|
101
|
-
const t = document.querySelector(
|
|
98
|
+
const t = document.querySelector(ce);
|
|
102
99
|
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
103
|
-
},
|
|
100
|
+
}, S = async () => {
|
|
104
101
|
var t;
|
|
105
102
|
try {
|
|
106
103
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
107
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
104
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", M = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
108
105
|
E.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
109
|
-
const
|
|
106
|
+
const B = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, A = o.isFeatureEnabled("linkTrackingIds");
|
|
110
107
|
let n = {
|
|
111
|
-
html: s && await
|
|
108
|
+
html: s && await _(s, B),
|
|
112
109
|
css: d
|
|
113
110
|
};
|
|
114
|
-
n.html || (n = await
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
preselectedDynamicContentList:
|
|
111
|
+
n.html || (n = await T(), n.html = await _(n.html, B));
|
|
112
|
+
const X = A ? W(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
113
|
+
R(n.html) && (n.html = await F(n.html)), A && (c.trackIdSessionFloor = Math.max(X, W(n.html)));
|
|
114
|
+
const Y = {
|
|
115
|
+
preselectedDynamicContentList: M,
|
|
119
116
|
onReady: () => {
|
|
120
117
|
console.debug("guido:ready"), r("ready");
|
|
121
118
|
}
|
|
122
119
|
};
|
|
123
|
-
|
|
120
|
+
await D(n, y(), Y), f.selectedDynamicContentList = M;
|
|
124
121
|
} catch (e) {
|
|
125
122
|
console.error("Failed to initialize Stripo editor:", e);
|
|
126
123
|
}
|
|
127
124
|
};
|
|
128
|
-
return
|
|
125
|
+
return ee(async () => {
|
|
129
126
|
var e;
|
|
130
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
127
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), O().$reset(), be().$reset(), v();
|
|
131
128
|
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
132
|
-
if (t && (i = new ResizeObserver(
|
|
133
|
-
await
|
|
129
|
+
if (t && (i = new ResizeObserver(v), i.observe(t)), k(), a.ready)
|
|
130
|
+
await S();
|
|
134
131
|
else {
|
|
135
|
-
const s =
|
|
136
|
-
d && (s(),
|
|
132
|
+
const s = U(() => a.ready, (d) => {
|
|
133
|
+
d && (s(), S());
|
|
137
134
|
});
|
|
138
135
|
}
|
|
139
|
-
document.addEventListener("dynamic-content:open",
|
|
140
|
-
}),
|
|
141
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}), q({
|
|
136
|
+
document.addEventListener("dynamic-content:open", g);
|
|
137
|
+
}), te(() => {
|
|
138
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", g), h().disposeStrategyPageReturn();
|
|
139
|
+
try {
|
|
140
|
+
window.UIEditor.removeEditor();
|
|
141
|
+
} catch {
|
|
142
|
+
console.debug("Failed to remove Stripo editor: No editor found");
|
|
143
|
+
}
|
|
144
|
+
o.reset();
|
|
145
|
+
}), G({
|
|
150
146
|
dynamicContent: {
|
|
151
|
-
insert:
|
|
152
|
-
close:
|
|
147
|
+
insert: I,
|
|
148
|
+
close: L
|
|
153
149
|
},
|
|
154
150
|
hasChanges: m,
|
|
155
151
|
saveSilent: w,
|
|
156
152
|
setLoading: C
|
|
157
|
-
}), { __sfc: !0, PreviewContainer:
|
|
153
|
+
}), { __sfc: !0, PreviewContainer: H, OnboardingWrapper: $, AssignStrategyDrawer: z, RemoveStrategyModal: q, headerWrapperRef: b, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: E, props: a, configStore: o, editorStore: c, previewStore: K, hasChanges: m, isTestPartner: V, saveSilent: w, setLoading: C, emit: r, buildMetadata: y, initPlugin: D, preloadRuntime: k, getDefaultTemplate: T, cloneTimersOnSave: F, hasTimerBlocks: R, noHeader: j, isRrsEnabled: J, hasAssignedStrategy: Q, insertDynamicContent: I, closeDynamicContent: L, handleDynamicContentOpen: g, ribbonObserver: i, updateRibbonOffset: v, startEditor: S, AutoSaveController: de, Toaster: me, FilterSelectionDrawer: le, HeaderWrapper: ue, LoadingWrapper: pe, SaveAsTemplateDrawer: fe, UnsubscribeWrapper: ye };
|
|
158
154
|
}
|
|
159
155
|
});
|
|
160
156
|
export {
|
|
161
|
-
|
|
157
|
+
je as default
|
|
162
158
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import s 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
|
-
|
|
4
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
5
|
+
var a = function() {
|
|
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();
|
|
12
|
+
}, n = [], i = /* @__PURE__ */ o(
|
|
13
|
+
s,
|
|
14
|
+
a,
|
|
13
15
|
n,
|
|
14
16
|
!1,
|
|
15
17
|
null,
|
|
16
|
-
"
|
|
18
|
+
"0b3e3cba"
|
|
17
19
|
);
|
|
18
20
|
const y = i.exports;
|
|
19
21
|
export {
|
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as I, defineAsyncComponent as f, ref as S, computed as c, watch as T } 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 { formatShortDate as
|
|
11
|
-
import { asText as
|
|
12
|
-
import { escapeHtml as
|
|
13
|
-
import { InSkeleton as
|
|
14
|
-
const
|
|
3
|
+
import { useToaster as O } from "../../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as h } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { DOTTED_DATE_LOCALE as A } from "../../../../enums/date.js";
|
|
6
|
+
import { URLS as B } from "../../../../enums/extensions/recommendationBlock.js";
|
|
7
|
+
import { ToasterTypeOptions as y } from "../../../../enums/toaster.js";
|
|
8
|
+
import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import N from "./StrategyInfoBoxContent.vue.js";
|
|
10
|
+
import { formatShortDate as k } from "../../../../utils/dateUtil.js";
|
|
11
|
+
import { asText as _ } from "../../../../utils/genericUtil.js";
|
|
12
|
+
import { escapeHtml as L } from "../../../../utils/htmlEscape.js";
|
|
13
|
+
import { InSkeleton as P } from "@useinsider/design-system-vue";
|
|
14
|
+
const Z = /* @__PURE__ */ I({
|
|
15
15
|
__name: "AssignStrategyDrawer",
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
render: (
|
|
19
|
-
}),
|
|
20
|
-
loader: async () => (await
|
|
21
|
-
loadingComponent:
|
|
16
|
+
setup(R) {
|
|
17
|
+
const g = () => import("@useinsider/design-system-organisms"), d = (t, r) => ({
|
|
18
|
+
render: (s) => s(P, { props: { sizing: { width: t, height: r } } })
|
|
19
|
+
}), D = f({
|
|
20
|
+
loader: async () => (await g()).OrgStrategyDetailModal,
|
|
21
|
+
loadingComponent: d(480, 240),
|
|
22
22
|
delay: 0
|
|
23
|
-
}),
|
|
24
|
-
loader: async () => (await
|
|
25
|
-
loadingComponent:
|
|
23
|
+
}), v = f({
|
|
24
|
+
loader: async () => (await g()).OrgStrategyDropdown,
|
|
25
|
+
loadingComponent: d(240, 42),
|
|
26
26
|
delay: 0
|
|
27
|
-
}),
|
|
28
|
-
|
|
27
|
+
}), i = "guido-edit-strategy-", a = h(), e = b(), { showToaster: l } = O(), o = S(null), n = S(!1), w = c(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: B.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : ""), m = () => {
|
|
28
|
+
e.lastCreatedStrategyId && (o.value = e.lastCreatedStrategyId, n.value = !1, e.lastCreatedStrategyId = null);
|
|
29
|
+
};
|
|
30
|
+
T(() => e.assignStrategyDrawerStatus, (t) => {
|
|
29
31
|
if (!t)
|
|
30
32
|
return;
|
|
31
33
|
const { strategyId: r } = e.recommendationConfigs;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
type:
|
|
35
|
-
message:
|
|
34
|
+
o.value = r || null, n.value = !1, e.fetchStrategies().then(m).catch(() => {
|
|
35
|
+
l({
|
|
36
|
+
type: y.Error,
|
|
37
|
+
message: a("discovery-strategy.error-description")
|
|
36
38
|
});
|
|
37
39
|
});
|
|
38
|
-
});
|
|
40
|
+
}), T(() => e.lastCreatedStrategyId, m);
|
|
39
41
|
const p = (t) => {
|
|
40
|
-
const r =
|
|
42
|
+
const r = _(t.updated_at || t.created_at);
|
|
41
43
|
if (!r)
|
|
42
44
|
return "";
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
-
},
|
|
45
|
+
const s = k(r, A);
|
|
46
|
+
return a("recommendation-strategy.last-updated-on", { value: s });
|
|
47
|
+
}, x = c(() => e.strategies.map((t) => ({
|
|
46
48
|
text: t.name,
|
|
47
49
|
value: t.strategy_id,
|
|
48
50
|
infoBoxProps: {
|
|
@@ -50,57 +52,71 @@ const W = /* @__PURE__ */ v({
|
|
|
50
52
|
theme: "light",
|
|
51
53
|
variant: "information",
|
|
52
54
|
className: "assign-strategy-info-box",
|
|
53
|
-
titleText:
|
|
55
|
+
titleText: L(_(t.name)),
|
|
54
56
|
descriptionStatus: !0,
|
|
55
57
|
descriptionText: p(t),
|
|
56
|
-
slot:
|
|
57
|
-
slotProps: { strategy: t }
|
|
58
|
+
slot: N,
|
|
59
|
+
slotProps: { strategy: t },
|
|
60
|
+
// The info box drops the option's value/text, so the id is the only channel
|
|
61
|
+
// that can carry the strategy back to the click handler.
|
|
62
|
+
buttonOptions: [{
|
|
63
|
+
id: `${i}${t.strategy_id}`,
|
|
64
|
+
text: a("eureka.edit-strategy"),
|
|
65
|
+
type: "text",
|
|
66
|
+
// Resolved from Guido's own public/sprite.svg by InIcons; an unknown name would
|
|
67
|
+
// silently render blank space instead of failing.
|
|
68
|
+
icon: "line-open-website"
|
|
69
|
+
}]
|
|
58
70
|
}
|
|
59
|
-
}))),
|
|
60
|
-
|
|
71
|
+
}))), C = (t) => {
|
|
72
|
+
var s;
|
|
73
|
+
const r = (s = t == null ? void 0 : t.id) != null && s.startsWith(i) ? t.id.slice(i.length) : "";
|
|
74
|
+
r && e.openStrategyEdit(r);
|
|
75
|
+
}, u = c(() => {
|
|
76
|
+
const t = e.strategies.find((r) => String(r.strategy_id) === String(o.value ?? ""));
|
|
61
77
|
return t ? { ...t, fallback_config: null } : null;
|
|
62
|
-
}),
|
|
78
|
+
}), E = c(() => ({
|
|
63
79
|
primaryButton: {
|
|
64
80
|
styling: "solid",
|
|
65
81
|
type: "primary",
|
|
66
|
-
labelText:
|
|
82
|
+
labelText: a("products.assign-btn")
|
|
67
83
|
},
|
|
68
84
|
cancelOrBackButton: {
|
|
69
85
|
styling: "ghost",
|
|
70
86
|
type: "secondary",
|
|
71
|
-
labelText:
|
|
87
|
+
labelText: a("products.cancel")
|
|
72
88
|
}
|
|
73
89
|
}));
|
|
74
|
-
return { __sfc: !0, loadOrganisms:
|
|
90
|
+
return { __sfc: !0, loadOrganisms: g, skeleton: d, OrgStrategyDetailModal: D, OrgStrategyDropdown: v, EDIT_BUTTON_ID_PREFIX: i, trans: a, store: e, showToaster: l, selectedStrategyId: o, showSelectionError: n, drawerDescription: w, consumeLastCreatedStrategy: m, lastUpdatedText: p, strategyOptions: x, onInfoBoxButtonClick: C, selectedStrategy: u, footerButtonGroupOptions: E, closeDrawer: () => {
|
|
75
91
|
e.closeAssignStrategyDrawer();
|
|
76
92
|
}, assignStrategy: async () => {
|
|
77
|
-
const t =
|
|
93
|
+
const t = u.value;
|
|
78
94
|
if (!t) {
|
|
79
|
-
|
|
95
|
+
n.value = !0;
|
|
80
96
|
return;
|
|
81
97
|
}
|
|
82
98
|
let r = "";
|
|
83
99
|
try {
|
|
84
100
|
r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
85
|
-
} catch (
|
|
86
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
101
|
+
} catch (s) {
|
|
102
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", s);
|
|
87
103
|
}
|
|
88
104
|
if (!r) {
|
|
89
|
-
|
|
90
|
-
type:
|
|
91
|
-
message:
|
|
105
|
+
l({
|
|
106
|
+
type: y.Error,
|
|
107
|
+
message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
92
108
|
});
|
|
93
109
|
return;
|
|
94
110
|
}
|
|
95
|
-
e.assignStrategy(t),
|
|
96
|
-
type:
|
|
97
|
-
message:
|
|
111
|
+
e.assignStrategy(t), l({
|
|
112
|
+
type: y.Success,
|
|
113
|
+
message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
98
114
|
}), e.closeAssignStrategyDrawer();
|
|
99
115
|
}, onSelect: (t) => {
|
|
100
|
-
|
|
116
|
+
o.value = t.value, n.value = !1;
|
|
101
117
|
} };
|
|
102
118
|
}
|
|
103
119
|
});
|
|
104
120
|
export {
|
|
105
|
-
|
|
121
|
+
Z as default
|
|
106
122
|
};
|
|
@@ -1,79 +1,66 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useExport as
|
|
5
|
-
import { useTestEmailClick as
|
|
6
|
-
import { useHtmlCompiler as
|
|
7
|
-
import { useSave as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
const ft = /* @__PURE__ */ q({
|
|
1
|
+
import { defineComponent as O, ref as n, computed as h } from "vue";
|
|
2
|
+
import { useActionsApi as q } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as b } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as k } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as B } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as D } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as F } from "../../../composables/useSave.js";
|
|
8
|
+
import { useTranslations as L } from "../../../composables/useTranslations.js";
|
|
9
|
+
import { useVersionHistoryApi as R } from "../../../composables/useVersionHistoryApi.js";
|
|
10
|
+
import { useLiquidValidator as z } from "../../../composables/validators/useLiquidValidator.js";
|
|
11
|
+
import { useEditorStore as I } from "../../../stores/editor.js";
|
|
12
|
+
import { useTemplateStore as P } from "../../../stores/template.js";
|
|
13
|
+
import { getTooltipOptions as j } from "../../../utils/tooltipUtils.js";
|
|
14
|
+
import { InButtonV2 as G } from "@useinsider/design-system-vue";
|
|
15
|
+
import { storeToRefs as J } from "pinia";
|
|
16
|
+
import K from "./MigrationConfirmModal.vue.js";
|
|
17
|
+
const ut = /* @__PURE__ */ O({
|
|
19
18
|
__name: "EditorActions",
|
|
20
|
-
setup(
|
|
21
|
-
const { config:
|
|
19
|
+
setup(N, { expose: x }) {
|
|
20
|
+
const { config: a, isFeatureEnabled: l } = b(), { exportHtml: m } = k(), { save: u } = F(), { openVersionHistory: c, closeVersionHistory: p } = R(), { getCompiledEmail: f } = q(), { compileHtml: d } = D(), { validateLiquidSyntax: v } = z(), e = I(), y = P(), { hasMigrations: g } = J(y), s = L(), i = n(!1), r = n(!1), S = n(), H = B(), T = () => {
|
|
22
21
|
if (e.isVersionHistoryOpen) {
|
|
23
|
-
|
|
22
|
+
p();
|
|
24
23
|
return;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
i.value = !0, await
|
|
29
|
-
},
|
|
25
|
+
c();
|
|
26
|
+
}, w = async () => {
|
|
27
|
+
i.value = !0, await m(), i.value = !1;
|
|
28
|
+
}, _ = () => {
|
|
30
29
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
31
|
-
},
|
|
30
|
+
}, C = h(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), A = h(
|
|
32
31
|
() => {
|
|
33
32
|
var t, o;
|
|
34
|
-
return ((o = (t =
|
|
33
|
+
return ((o = (t = a.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
35
34
|
}
|
|
36
|
-
),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} catch (n) {
|
|
42
|
-
if (t)
|
|
43
|
-
throw n;
|
|
44
|
-
r(n, "Failed to save template");
|
|
45
|
-
} finally {
|
|
46
|
-
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
47
|
-
}
|
|
48
|
-
return o;
|
|
49
|
-
}, T = (t) => {
|
|
35
|
+
), V = async (t) => {
|
|
36
|
+
r.value = !0, t || (e.loadingStatus = !0);
|
|
37
|
+
const o = await u(t);
|
|
38
|
+
return r.value = !1, !t && !o && (e.loadingStatus = !1), o;
|
|
39
|
+
}, E = (t) => {
|
|
50
40
|
var o;
|
|
51
|
-
if (!t &&
|
|
41
|
+
if (!t && g.value) {
|
|
52
42
|
(o = S.value) == null || o.open();
|
|
53
43
|
return;
|
|
54
44
|
}
|
|
55
|
-
return
|
|
56
|
-
},
|
|
57
|
-
if (
|
|
45
|
+
return V(t);
|
|
46
|
+
}, M = async () => {
|
|
47
|
+
if (l("liquidSyntax")) {
|
|
58
48
|
e.loadingStatus = !0;
|
|
59
49
|
try {
|
|
60
|
-
const { html: t } = await
|
|
61
|
-
if (!await
|
|
50
|
+
const { html: t } = await f({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = d(t);
|
|
51
|
+
if (!await v(o))
|
|
62
52
|
return;
|
|
63
|
-
} catch (t) {
|
|
64
|
-
r(t, "Failed to prepare test email");
|
|
65
|
-
return;
|
|
66
53
|
} finally {
|
|
67
54
|
e.loadingStatus = !1;
|
|
68
55
|
}
|
|
69
56
|
}
|
|
70
|
-
|
|
57
|
+
H();
|
|
71
58
|
};
|
|
72
59
|
return x({
|
|
73
|
-
handleSave:
|
|
74
|
-
}), { __sfc: !0, config:
|
|
60
|
+
handleSave: E
|
|
61
|
+
}), { __sfc: !0, config: a, isFeatureEnabled: l, exportHtml: m, save: u, openVersionHistory: c, closeVersionHistory: p, getCompiledEmail: f, compileHtml: d, validateLiquidSyntax: v, editorStore: e, templateStore: y, hasMigrations: g, trans: s, isExporting: i, isSaving: r, migrationModalRef: S, testEmailClick: H, handleVersionHistory: T, handleExport: w, handleSaveAs: _, versionHistoryTooltipText: C, isVersionHistoryButtonVisible: A, executeSave: V, handleSave: E, handleTestEmail: M, getTooltipOptions: j, InButtonV2: G, MigrationConfirmModal: K };
|
|
75
62
|
}
|
|
76
63
|
});
|
|
77
64
|
export {
|
|
78
|
-
|
|
65
|
+
ut as default
|
|
79
66
|
};
|