@useinsider/guido 3.18.0 → 3.18.1-beta.636c82d
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 +86 -82
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +72 -56
- package/dist/components/organisms/header/EditorActions.vue.js +1 -1
- package/dist/components/organisms/header/EditorActions.vue2.js +54 -41
- 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 +82 -67
- package/dist/composables/useAutoSave.js +31 -26
- package/dist/composables/useEditorLock.js +20 -0
- package/dist/composables/useGuidoStateBridge.js +37 -31
- package/dist/composables/useSave.js +42 -39
- package/dist/enums/extensions/recommendationBlock.js +38 -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/package.json.js +1 -1
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useEditorLock.d.ts +10 -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 +2 -2
|
@@ -1,54 +1,55 @@
|
|
|
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
|
-
|
|
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
|
+
import { useEditorStore as H } from "../stores/editor.js";
|
|
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
|
+
import { readTrackFloor as $ } from "../utils/linkTrackingIds.js";
|
|
28
|
+
const et = /* @__PURE__ */ ne({
|
|
28
29
|
__name: "Guido",
|
|
29
30
|
props: {
|
|
30
31
|
config: null,
|
|
31
32
|
ready: { type: Boolean, default: !0 }
|
|
32
33
|
},
|
|
33
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const a =
|
|
35
|
+
setup(z, { expose: q, emit: r }) {
|
|
36
|
+
const a = z, K = l(
|
|
36
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
38
|
+
), V = l(
|
|
38
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
40
|
+
), j = l(
|
|
40
41
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
41
|
-
),
|
|
42
|
+
), J = l(
|
|
42
43
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
43
|
-
),
|
|
44
|
+
), E = O(), p = O(), f = Ce(), w = Te(), o = we();
|
|
44
45
|
a.ready && o.init(a.config);
|
|
45
|
-
const c =
|
|
46
|
+
const c = H(), Q = De(), m = u(() => c.hasChanges), { isTestPartner: X } = me(), C = () => {
|
|
46
47
|
var t;
|
|
47
|
-
return (t =
|
|
48
|
-
},
|
|
48
|
+
return (t = E.value) == null ? void 0 : t.handleSave(!0);
|
|
49
|
+
}, D = (t) => {
|
|
49
50
|
c.loadingStatus = t;
|
|
50
51
|
};
|
|
51
|
-
|
|
52
|
+
ae(), de();
|
|
52
53
|
const y = () => {
|
|
53
54
|
var t, e;
|
|
54
55
|
return {
|
|
@@ -56,16 +57,18 @@ const je = /* @__PURE__ */ Z({
|
|
|
56
57
|
userId: o.userId,
|
|
57
58
|
username: o.username,
|
|
58
59
|
partnerName: o.partnerName,
|
|
59
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
60
|
-
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
|
|
61
62
|
};
|
|
62
|
-
}, { initPlugin:
|
|
63
|
+
}, { initPlugin: k, preloadRuntime: T } = le(), { runExclusive: F, beginMount: R, isCurrentMount: I } = ie();
|
|
64
|
+
let g = 0;
|
|
65
|
+
const { getDefaultTemplate: M } = Ee(), { cloneTimersOnSave: L, hasTimerBlocks: B } = ue(), Y = u(() => {
|
|
63
66
|
var t;
|
|
64
67
|
return !((t = o.ui) != null && t.showHeader);
|
|
65
|
-
}),
|
|
66
|
-
() => !!
|
|
68
|
+
}), Z = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), ee = u(
|
|
69
|
+
() => !!h().recommendationConfigs.strategyId
|
|
67
70
|
);
|
|
68
|
-
|
|
71
|
+
ce({
|
|
69
72
|
onBack: () => {
|
|
70
73
|
console.debug("guido:back"), r("back");
|
|
71
74
|
},
|
|
@@ -80,79 +83,80 @@ const je = /* @__PURE__ */ Z({
|
|
|
80
83
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
81
84
|
}
|
|
82
85
|
});
|
|
83
|
-
const
|
|
86
|
+
const A = (t) => {
|
|
84
87
|
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
85
|
-
},
|
|
88
|
+
}, P = () => {
|
|
86
89
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
87
90
|
};
|
|
88
|
-
|
|
91
|
+
x(() => m.value, () => {
|
|
89
92
|
r("on-change", m.value);
|
|
90
93
|
});
|
|
91
|
-
const
|
|
94
|
+
const v = (t) => {
|
|
92
95
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
93
96
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
94
97
|
};
|
|
95
98
|
let i = null;
|
|
96
|
-
const
|
|
99
|
+
const S = () => {
|
|
97
100
|
var e;
|
|
98
|
-
const t = document.querySelector(
|
|
101
|
+
const t = document.querySelector(pe);
|
|
99
102
|
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
100
|
-
},
|
|
103
|
+
}, b = async () => {
|
|
101
104
|
var t;
|
|
102
105
|
try {
|
|
103
106
|
o.initialized || o.init(a.config), c.templateId = o.templateId;
|
|
104
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
105
|
-
|
|
106
|
-
const
|
|
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) || [];
|
|
109
|
+
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, N = o.isFeatureEnabled("linkTrackingIds");
|
|
107
110
|
let n = {
|
|
108
|
-
html: s && await
|
|
111
|
+
html: s && await W(s, _),
|
|
109
112
|
css: d
|
|
110
113
|
};
|
|
111
|
-
n.html || (n = await
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
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,
|
|
116
119
|
onReady: () => {
|
|
117
120
|
console.debug("guido:ready"), r("ready");
|
|
118
121
|
}
|
|
119
122
|
};
|
|
120
|
-
await
|
|
123
|
+
g = R(), await k(n, y(), oe), f.selectedDynamicContentList = U;
|
|
121
124
|
} catch (e) {
|
|
122
125
|
console.error("Failed to initialize Stripo editor:", e);
|
|
123
126
|
}
|
|
124
127
|
};
|
|
125
|
-
return
|
|
128
|
+
return re(async () => {
|
|
126
129
|
var e;
|
|
127
|
-
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();
|
|
128
131
|
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
129
|
-
if (t && (i = new ResizeObserver(
|
|
130
|
-
await
|
|
132
|
+
if (t && (i = new ResizeObserver(S), i.observe(t)), T(), a.ready)
|
|
133
|
+
await b();
|
|
131
134
|
else {
|
|
132
|
-
const s =
|
|
133
|
-
d && (s(),
|
|
135
|
+
const s = x(() => a.ready, (d) => {
|
|
136
|
+
d && (s(), b());
|
|
134
137
|
});
|
|
135
138
|
}
|
|
136
|
-
document.addEventListener("dynamic-content:open",
|
|
137
|
-
}),
|
|
138
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
139
|
+
document.addEventListener("dynamic-content:open", v);
|
|
140
|
+
}), se(() => {
|
|
141
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), h().disposeStrategyPageReturn(), F(async () => {
|
|
142
|
+
if (I(g))
|
|
143
|
+
try {
|
|
144
|
+
window.UIEditor.removeEditor();
|
|
145
|
+
} catch {
|
|
146
|
+
console.debug("Failed to remove Stripo editor: No editor found");
|
|
147
|
+
}
|
|
148
|
+
}), o.reset();
|
|
149
|
+
}), q({
|
|
146
150
|
dynamicContent: {
|
|
147
|
-
insert:
|
|
148
|
-
close:
|
|
151
|
+
insert: A,
|
|
152
|
+
close: P
|
|
149
153
|
},
|
|
150
154
|
hasChanges: m,
|
|
151
|
-
saveSilent:
|
|
152
|
-
setLoading:
|
|
153
|
-
}), { __sfc: !0, PreviewContainer:
|
|
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 };
|
|
154
158
|
}
|
|
155
159
|
});
|
|
156
160
|
export {
|
|
157
|
-
|
|
161
|
+
et as default
|
|
158
162
|
};
|
|
@@ -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
|
+
"a90e37f5"
|
|
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
|
+
}), w = 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), v = c(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: B.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : ""), m = () => {
|
|
28
|
+
!e.assignStrategyDrawerStatus || !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
|
-
});
|
|
39
|
-
const
|
|
40
|
-
const r =
|
|
40
|
+
}), T(() => e.lastCreatedStrategyId, m);
|
|
41
|
+
const u = (t) => {
|
|
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
|
-
descriptionText:
|
|
56
|
-
slot:
|
|
57
|
-
slotProps: { strategy: t }
|
|
57
|
+
descriptionText: u(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
|
+
}, p = 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: w, EDIT_BUTTON_ID_PREFIX: i, trans: a, store: e, showToaster: l, selectedStrategyId: o, showSelectionError: n, drawerDescription: v, consumeLastCreatedStrategy: m, lastUpdatedText: u, strategyOptions: x, onInfoBoxButtonClick: C, selectedStrategy: p, footerButtonGroupOptions: E, closeDrawer: () => {
|
|
75
91
|
e.closeAssignStrategyDrawer();
|
|
76
92
|
}, assignStrategy: async () => {
|
|
77
|
-
const t =
|
|
93
|
+
const t = p.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,66 +1,79 @@
|
|
|
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
|
-
|
|
1
|
+
import { defineComponent as q, ref as l, computed as w } from "vue";
|
|
2
|
+
import { useActionsApi as b } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as B } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as D } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as L } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as R } from "../../../composables/useSave.js";
|
|
8
|
+
import { useToaster as z } from "../../../composables/useToaster.js";
|
|
9
|
+
import { useTranslations as I } from "../../../composables/useTranslations.js";
|
|
10
|
+
import { useVersionHistoryApi as P } from "../../../composables/useVersionHistoryApi.js";
|
|
11
|
+
import { useLiquidValidator as j } from "../../../composables/validators/useLiquidValidator.js";
|
|
12
|
+
import { useEditorStore as G } from "../../../stores/editor.js";
|
|
13
|
+
import { useTemplateStore as J } from "../../../stores/template.js";
|
|
14
|
+
import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
|
|
15
|
+
import { InButtonV2 as N } from "@useinsider/design-system-vue";
|
|
16
|
+
import { storeToRefs as Q } from "pinia";
|
|
17
|
+
import U from "./MigrationConfirmModal.vue.js";
|
|
18
|
+
const ft = /* @__PURE__ */ q({
|
|
18
19
|
__name: "EditorActions",
|
|
19
|
-
setup(
|
|
20
|
-
const { config:
|
|
20
|
+
setup(W, { expose: x }) {
|
|
21
|
+
const { config: m, isFeatureEnabled: c } = k(), { exportHtml: p } = B(), { save: u } = R(), { openVersionHistory: f, closeVersionHistory: d } = P(), { getCompiledEmail: v } = b(), { compileHtml: y } = L(), { validateLiquidSyntax: g } = j(), { handleError: r } = z(), e = G(), h = J(), { hasMigrations: H } = Q(h), s = I(), i = l(!1), a = l(!1), S = l(), V = D(), _ = () => {
|
|
21
22
|
if (e.isVersionHistoryOpen) {
|
|
22
|
-
|
|
23
|
+
d();
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
i.value = !0, await
|
|
28
|
-
},
|
|
26
|
+
f();
|
|
27
|
+
}, C = async () => {
|
|
28
|
+
i.value = !0, await p(), i.value = !1;
|
|
29
|
+
}, A = () => {
|
|
29
30
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
30
|
-
},
|
|
31
|
+
}, M = w(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = w(
|
|
31
32
|
() => {
|
|
32
33
|
var t, o;
|
|
33
|
-
return ((o = (t =
|
|
34
|
+
return ((o = (t = m.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
34
35
|
}
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
), E = async (t) => {
|
|
37
|
+
a.value = !0, t || (e.loadingStatus = !0);
|
|
38
|
+
let o;
|
|
39
|
+
try {
|
|
40
|
+
o = await u(t);
|
|
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) => {
|
|
40
50
|
var o;
|
|
41
|
-
if (!t &&
|
|
51
|
+
if (!t && H.value) {
|
|
42
52
|
(o = S.value) == null || o.open();
|
|
43
53
|
return;
|
|
44
54
|
}
|
|
45
|
-
return
|
|
46
|
-
},
|
|
47
|
-
if (
|
|
55
|
+
return E(t);
|
|
56
|
+
}, F = async () => {
|
|
57
|
+
if (c("liquidSyntax")) {
|
|
48
58
|
e.loadingStatus = !0;
|
|
49
59
|
try {
|
|
50
|
-
const { html: t } = await
|
|
51
|
-
if (!await
|
|
60
|
+
const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
|
|
61
|
+
if (!await g(o))
|
|
52
62
|
return;
|
|
63
|
+
} catch (t) {
|
|
64
|
+
r(t, "Failed to prepare test email");
|
|
65
|
+
return;
|
|
53
66
|
} finally {
|
|
54
67
|
e.loadingStatus = !1;
|
|
55
68
|
}
|
|
56
69
|
}
|
|
57
|
-
|
|
70
|
+
V();
|
|
58
71
|
};
|
|
59
72
|
return x({
|
|
60
|
-
handleSave:
|
|
61
|
-
}), { __sfc: !0, config:
|
|
73
|
+
handleSave: T
|
|
74
|
+
}), { __sfc: !0, config: m, isFeatureEnabled: c, exportHtml: p, save: u, openVersionHistory: f, closeVersionHistory: d, getCompiledEmail: v, compileHtml: y, validateLiquidSyntax: g, handleError: r, editorStore: e, templateStore: h, hasMigrations: H, trans: s, isExporting: i, isSaving: a, migrationModalRef: S, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: E, handleSave: T, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
62
75
|
}
|
|
63
76
|
});
|
|
64
77
|
export {
|
|
65
|
-
|
|
78
|
+
ft as default
|
|
66
79
|
};
|