@useinsider/guido 3.19.0-beta.4b9be3a → 3.19.0-beta.4e3e6c4
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/README.md +21 -3
- package/dist/@types/config/schemas.js +59 -51
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +84 -87
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +29 -0
- package/dist/components/organisms/base/Toaster.vue2.js +13 -12
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +78 -57
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +25 -0
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +28 -42
- 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/OnboardingWrapper.vue2.js +28 -24
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +46 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +47 -0
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useActionsApi.js +44 -43
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useCortexBlueprintBridge.js +54 -120
- package/dist/composables/useCustomInterfaceAppearance.js +65 -51
- package/dist/composables/useEmailTemplateApplier.js +51 -96
- package/dist/composables/useHtmlValidator.js +87 -82
- package/dist/composables/useHttp.js +61 -54
- package/dist/composables/useLegacyStrategyConversion.js +61 -0
- package/dist/composables/useRecommendation.js +40 -35
- package/dist/composables/useStripo.js +30 -30
- package/dist/composables/useToaster.js +18 -22
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +33 -24
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/enums/extensions/recommendationBlock.js +49 -33
- 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 +100 -94
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +130 -55
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +74 -74
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +273 -92
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +42 -0
- 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/services/recommendationApi.js +46 -37
- package/dist/src/@types/config/schemas.d.ts +16 -0
- package/dist/src/components/organisms/base/AuthErrorModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +3 -4
- package/dist/src/composables/useEmailTemplateApplier.d.ts +5 -26
- package/dist/src/composables/useHttp.d.ts +2 -0
- package/dist/src/composables/useLegacyStrategyConversion.d.ts +3 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +7 -1
- 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 +10 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +7 -2
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +162 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +32 -0
- 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/services/recommendationApi.d.ts +2 -1
- package/dist/src/stores/config.d.ts +322 -0
- package/dist/src/stores/guido-email-editor.d.ts +10 -32
- package/dist/src/stores/onboarding.d.ts +808 -10
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/static/assets/icons/filled-arrow-rising.svg.js +5 -0
- package/dist/static/assets/icons/line-info.svg.js +5 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +104 -9
- package/dist/static/styles/components/skeleton.css.js +23 -0
- package/dist/stores/config.js +74 -60
- package/dist/stores/guido-email-editor.js +1 -3
- package/dist/stores/onboarding.js +46 -36
- 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,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
|
-
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 || 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();
|
|
12
|
+
}, n = [], i = /* @__PURE__ */ o(
|
|
13
|
+
s,
|
|
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,48 +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
|
-
}), 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) => {
|
|
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:
|
|
35
|
-
message:
|
|
31
|
+
s.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
|
|
32
|
+
c({
|
|
33
|
+
type: u.Error,
|
|
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
|
|
45
|
-
},
|
|
42
|
+
const o = M(r, N);
|
|
43
|
+
return a("recommendation-strategy.last-updated-on", { value: o });
|
|
44
|
+
}, S = n(() => ({
|
|
45
|
+
text: a("ds-steps.legacy-strategy"),
|
|
46
|
+
value: m,
|
|
47
|
+
hidden: !0
|
|
48
|
+
})), d = n(() => e.strategies.map((t) => ({
|
|
46
49
|
text: t.name,
|
|
47
50
|
value: t.strategy_id,
|
|
48
51
|
infoBoxProps: {
|
|
@@ -50,57 +53,75 @@ const W = /* @__PURE__ */ v({
|
|
|
50
53
|
theme: "light",
|
|
51
54
|
variant: "information",
|
|
52
55
|
className: "assign-strategy-info-box",
|
|
53
|
-
titleText:
|
|
56
|
+
titleText: G(O(t.name)),
|
|
54
57
|
descriptionStatus: !0,
|
|
55
|
-
descriptionText:
|
|
56
|
-
slot:
|
|
57
|
-
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
|
+
}]
|
|
58
71
|
}
|
|
59
|
-
}))),
|
|
60
|
-
|
|
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 ?? ""));
|
|
61
81
|
return t ? { ...t, fallback_config: null } : null;
|
|
62
|
-
}),
|
|
82
|
+
}), C = n(() => ({
|
|
63
83
|
primaryButton: {
|
|
64
84
|
styling: "solid",
|
|
65
85
|
type: "primary",
|
|
66
|
-
labelText:
|
|
86
|
+
labelText: a("products.assign-btn")
|
|
67
87
|
},
|
|
68
88
|
cancelOrBackButton: {
|
|
69
89
|
styling: "ghost",
|
|
70
90
|
type: "secondary",
|
|
71
|
-
labelText:
|
|
91
|
+
labelText: a("products.cancel")
|
|
72
92
|
}
|
|
73
93
|
}));
|
|
74
|
-
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: () => {
|
|
75
95
|
e.closeAssignStrategyDrawer();
|
|
76
96
|
}, assignStrategy: async () => {
|
|
77
|
-
const t =
|
|
97
|
+
const t = v.value;
|
|
78
98
|
if (!t) {
|
|
79
|
-
|
|
99
|
+
l.value = !0;
|
|
80
100
|
return;
|
|
81
101
|
}
|
|
82
102
|
let r = "";
|
|
83
103
|
try {
|
|
84
104
|
r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
|
|
85
|
-
} catch (
|
|
86
|
-
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed",
|
|
105
|
+
} catch (y) {
|
|
106
|
+
console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
|
|
87
107
|
}
|
|
88
108
|
if (!r) {
|
|
89
|
-
|
|
90
|
-
type:
|
|
91
|
-
message:
|
|
109
|
+
c({
|
|
110
|
+
type: u.Error,
|
|
111
|
+
message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
92
112
|
});
|
|
93
113
|
return;
|
|
94
114
|
}
|
|
95
|
-
e.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
115
|
+
const o = e.currentRecommendationId;
|
|
116
|
+
e.assignStrategy(t), c({
|
|
117
|
+
type: u.Success,
|
|
118
|
+
message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
119
|
+
}), e.closeAssignStrategyDrawer(), o !== null && await D(o, "Assigned recommendation strategy");
|
|
99
120
|
}, onSelect: (t) => {
|
|
100
|
-
|
|
121
|
+
s.value = t.value, l.value = !1;
|
|
101
122
|
} };
|
|
102
123
|
}
|
|
103
124
|
});
|
|
104
125
|
export {
|
|
105
|
-
|
|
126
|
+
st as default
|
|
106
127
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import s from "./LegacyStrategyUpdatedModal.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var r = function() {
|
|
5
|
+
var t = this, a = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return e.store.legacyStrategyUpdatedModalStatus ? a("div", { staticClass: "legacy-strategy-updated-modal" }, [a(e.WpModal, { attrs: { id: "guido__legacy-strategy-updated-modal", size: "small", "close-on-outside-click": !1, "footer-button-options": e.footerButtonOptions, title: e.trans("ds-steps.recommendation-strategy-migration-modal-title") }, on: { close: e.close, "primary-action": e.close } }, [a("p", [t._v(t._s(e.messageParts[0])), a("b", [t._v(t._s(e.strategyName))]), t._v(t._s(e.messageParts[1]))])])], 1) : t._e();
|
|
7
|
+
}, l = [], n = /* @__PURE__ */ o(
|
|
8
|
+
s,
|
|
9
|
+
r,
|
|
10
|
+
l,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"da2225a1"
|
|
14
|
+
);
|
|
15
|
+
const m = n.exports;
|
|
16
|
+
export {
|
|
17
|
+
m as default
|
|
18
|
+
};
|
package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineComponent as i, computed as s } from "vue";
|
|
2
|
+
import p from "../../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useTranslations as d } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
const M = /* @__PURE__ */ i({
|
|
6
|
+
__name: "LegacyStrategyUpdatedModal",
|
|
7
|
+
setup(l) {
|
|
8
|
+
const e = d(), t = g(), n = s(() => ({
|
|
9
|
+
primaryButton: {
|
|
10
|
+
type: "primary",
|
|
11
|
+
labelText: e("action-builder.ok")
|
|
12
|
+
}
|
|
13
|
+
})), m = s(() => {
|
|
14
|
+
var r;
|
|
15
|
+
const { strategyId: a } = t.recommendationConfigs;
|
|
16
|
+
return ((r = t.assignedStrategy) == null ? void 0 : r.name) || `#${a}`;
|
|
17
|
+
}), o = "__STRATEGY_NAME__", c = s(() => e("email-editor.legacy-strategy-updated-message", { strategyName: o }).split(o));
|
|
18
|
+
return { __sfc: !0, trans: e, store: t, footerButtonOptions: n, strategyName: m, NAME_TOKEN: o, messageParts: c, close: () => {
|
|
19
|
+
t.closeLegacyStrategyUpdatedModal();
|
|
20
|
+
}, WpModal: p };
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
M as default
|
|
25
|
+
};
|
|
@@ -1,57 +1,43 @@
|
|
|
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 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({
|
|
10
10
|
__name: "RemoveStrategyModal",
|
|
11
|
-
setup(
|
|
12
|
-
const
|
|
11
|
+
setup(v) {
|
|
12
|
+
const e = y(), t = f(), { showToaster: n } = l(), i = a(() => ({
|
|
13
13
|
cancelOrBackButton: {
|
|
14
14
|
type: "secondary",
|
|
15
|
-
labelText:
|
|
15
|
+
labelText: e("products.cancel"),
|
|
16
16
|
styling: "ghost"
|
|
17
17
|
},
|
|
18
18
|
primaryButton: {
|
|
19
19
|
type: "danger",
|
|
20
|
-
labelText:
|
|
20
|
+
labelText: e("discovery-strategy.remove")
|
|
21
21
|
}
|
|
22
|
-
})), m =
|
|
23
|
-
var
|
|
24
|
-
const { strategyId:
|
|
25
|
-
return ((
|
|
26
|
-
}),
|
|
27
|
-
|
|
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();
|
|
28
28
|
};
|
|
29
|
-
return { __sfc: !0, trans:
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (a({
|
|
34
|
-
type: v.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,
|
|
35
33
|
// The toast renders through a sanitizing v-html, so the name is escaped first.
|
|
36
|
-
message:
|
|
37
|
-
strategyName: `<b>${
|
|
34
|
+
message: e("email-editor.strategy-removed-success", {
|
|
35
|
+
strategyName: `<b>${T(o)}</b>`
|
|
38
36
|
})
|
|
39
|
-
}),
|
|
40
|
-
|
|
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 };
|
|
37
|
+
}), s !== null && await _(s, "Removed recommendation strategy");
|
|
38
|
+
}, WpModal: d };
|
|
53
39
|
}
|
|
54
40
|
});
|
|
55
41
|
export {
|
|
56
|
-
|
|
42
|
+
B as default
|
|
57
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
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, ref as
|
|
1
|
+
import { defineComponent as q, ref as n, computed as x } from "vue";
|
|
2
2
|
import { useActionsApi as b } from "../../../composables/useActionsApi.js";
|
|
3
3
|
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
4
4
|
import { useExport as B } from "../../../composables/useExport.js";
|
|
@@ -17,48 +17,46 @@ import { storeToRefs as Q } from "pinia";
|
|
|
17
17
|
import U from "./MigrationConfirmModal.vue.js";
|
|
18
18
|
const ft = /* @__PURE__ */ q({
|
|
19
19
|
__name: "EditorActions",
|
|
20
|
-
setup(W, { expose:
|
|
21
|
-
const { config:
|
|
20
|
+
setup(W, { expose: w }) {
|
|
21
|
+
const { config: l, isFeatureEnabled: m } = k(), { exportHtml: c } = B(), { save: p } = R(), { openVersionHistory: u, closeVersionHistory: f } = P(), { getCompiledEmail: d } = b(), { compileHtml: v } = L(), { validateLiquidSyntax: y } = j(), { handleError: r } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), s = I(), i = n(!1), a = n(!1), H = n(), h = D(), _ = () => {
|
|
22
22
|
if (e.isVersionHistoryOpen) {
|
|
23
|
-
|
|
23
|
+
f();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
u();
|
|
27
27
|
}, C = async () => {
|
|
28
|
-
i.value = !0, await
|
|
28
|
+
i.value = !0, await c(), i.value = !1;
|
|
29
29
|
}, A = () => {
|
|
30
30
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
31
|
-
}, M =
|
|
31
|
+
}, M = x(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = x(
|
|
32
32
|
() => {
|
|
33
33
|
var t, o;
|
|
34
|
-
return ((o = (t =
|
|
34
|
+
return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
35
35
|
}
|
|
36
|
-
),
|
|
36
|
+
), V = async (t) => {
|
|
37
37
|
a.value = !0, t || (e.loadingStatus = !0);
|
|
38
38
|
let o;
|
|
39
39
|
try {
|
|
40
|
-
o = await
|
|
41
|
-
} catch (
|
|
42
|
-
|
|
43
|
-
throw n;
|
|
44
|
-
r(n, "Failed to save template");
|
|
40
|
+
o = await p(t);
|
|
41
|
+
} catch (T) {
|
|
42
|
+
r(T, "Failed to save template");
|
|
45
43
|
} finally {
|
|
46
44
|
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
47
45
|
}
|
|
48
46
|
return o;
|
|
49
|
-
},
|
|
47
|
+
}, E = (t) => {
|
|
50
48
|
var o;
|
|
51
|
-
if (!t &&
|
|
52
|
-
(o =
|
|
49
|
+
if (!t && S.value) {
|
|
50
|
+
(o = H.value) == null || o.open();
|
|
53
51
|
return;
|
|
54
52
|
}
|
|
55
|
-
return
|
|
53
|
+
return V(t);
|
|
56
54
|
}, F = async () => {
|
|
57
|
-
if (
|
|
55
|
+
if (m("liquidSyntax")) {
|
|
58
56
|
e.loadingStatus = !0;
|
|
59
57
|
try {
|
|
60
|
-
const { html: t } = await
|
|
61
|
-
if (!await
|
|
58
|
+
const { html: t } = await d({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = v(t);
|
|
59
|
+
if (!await y(o))
|
|
62
60
|
return;
|
|
63
61
|
} catch (t) {
|
|
64
62
|
r(t, "Failed to prepare test email");
|
|
@@ -67,11 +65,11 @@ const ft = /* @__PURE__ */ q({
|
|
|
67
65
|
e.loadingStatus = !1;
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
|
-
|
|
68
|
+
h();
|
|
71
69
|
};
|
|
72
|
-
return
|
|
73
|
-
handleSave:
|
|
74
|
-
}), { __sfc: !0, config:
|
|
70
|
+
return w({
|
|
71
|
+
handleSave: E
|
|
72
|
+
}), { __sfc: !0, config: l, isFeatureEnabled: m, exportHtml: c, save: p, openVersionHistory: u, closeVersionHistory: f, getCompiledEmail: d, compileHtml: v, validateLiquidSyntax: y, handleError: r, editorStore: e, templateStore: g, hasMigrations: S, trans: s, isExporting: i, isSaving: a, migrationModalRef: H, testEmailClick: h, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: V, handleSave: E, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
75
73
|
}
|
|
76
74
|
});
|
|
77
75
|
export {
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import h from "./
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { defineComponent as f, computed as e, onMounted as O, watch as t } from "vue";
|
|
2
|
+
import y from "./AMPOnboarding.vue.js";
|
|
3
|
+
import u from "./GenericOnboarding.vue.js";
|
|
4
|
+
import v from "./ItemsOnboarding.vue.js";
|
|
5
|
+
import S from "./NewVersionPopup.vue.js";
|
|
6
|
+
import l from "./RecommendationLegacyStrategyOnboarding.vue.js";
|
|
7
|
+
import h from "./RecommendationStrategyOnboarding.vue.js";
|
|
8
|
+
import w from "./TextBlockOnboarding.vue.js";
|
|
9
|
+
import P from "./VersionHistoryOnboarding.vue.js";
|
|
10
|
+
import { usePartner as _ } from "../../../composables/usePartner.js";
|
|
11
|
+
import { useEditorStore as A } from "../../../stores/editor.js";
|
|
12
|
+
import { useOnboardingStore as H } from "../../../stores/onboarding.js";
|
|
13
|
+
import { usePreviewStore as M } from "../../../stores/preview.js";
|
|
14
|
+
const U = /* @__PURE__ */ f({
|
|
13
15
|
__name: "OnboardingWrapper",
|
|
14
16
|
emits: ["onboarding-finished"],
|
|
15
|
-
setup(
|
|
16
|
-
const o =
|
|
17
|
-
{ type: "newVersionPopup", component:
|
|
18
|
-
{ type: "genericOnboarding", component:
|
|
19
|
-
{ type: "textBlockOnboarding", component:
|
|
20
|
-
{ type: "versionHistoryOnboarding", component:
|
|
21
|
-
{ type: "ampOnboarding", component:
|
|
22
|
-
{ type: "itemsOnboarding", component:
|
|
23
|
-
|
|
17
|
+
setup(x, { emit: g }) {
|
|
18
|
+
const o = H(), r = A(), a = M(), { isTestPartner: s } = _(), m = e(() => r.isStripoInitialized), p = e(() => s()), d = [
|
|
19
|
+
{ type: "newVersionPopup", component: S },
|
|
20
|
+
{ type: "genericOnboarding", component: u },
|
|
21
|
+
{ type: "textBlockOnboarding", component: w },
|
|
22
|
+
{ type: "versionHistoryOnboarding", component: P },
|
|
23
|
+
{ type: "ampOnboarding", component: y },
|
|
24
|
+
{ type: "itemsOnboarding", component: v },
|
|
25
|
+
{ type: "recommendationStrategyOnboarding", component: h },
|
|
26
|
+
{ type: "recommendationLegacyStrategyOnboarding", component: l }
|
|
27
|
+
], c = (n) => p.value || !m.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), b = e(() => d.filter((n) => c(n.type)));
|
|
24
28
|
return O(async () => {
|
|
25
29
|
await o.fetchUserModalState();
|
|
26
30
|
}), t(
|
|
@@ -29,7 +33,7 @@ const G = /* @__PURE__ */ b({
|
|
|
29
33
|
n && !i && o.shouldShowOnboarding("versionHistoryOnboarding") && o.start("versionHistoryOnboarding"), !n && i && o.isActive("versionHistoryOnboarding") && o.close("versionHistoryOnboarding");
|
|
30
34
|
}
|
|
31
35
|
), t(
|
|
32
|
-
() =>
|
|
36
|
+
() => a.emailFormat,
|
|
33
37
|
(n, i) => {
|
|
34
38
|
i !== "AMP" && n === "AMP" && o.shouldShowOnboarding("ampOnboarding") && o.start("ampOnboarding");
|
|
35
39
|
}
|
|
@@ -38,9 +42,9 @@ const G = /* @__PURE__ */ b({
|
|
|
38
42
|
(n) => {
|
|
39
43
|
!n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
|
|
40
44
|
}
|
|
41
|
-
), { __sfc: !0, emit:
|
|
45
|
+
), { __sfc: !0, emit: g, onboardingStore: o, editorStore: r, previewStore: a, isTestPartner: s, isStripoReady: m, isTestPartnerActive: p, onboardingConfigs: d, shouldShow: c, visibleOnboardings: b };
|
|
42
46
|
}
|
|
43
47
|
});
|
|
44
48
|
export {
|
|
45
|
-
|
|
49
|
+
U as default
|
|
46
50
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import s from "./RecommendationLegacyStrategyOnboarding.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import c from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var d = function() {
|
|
5
|
+
var t, n, r, a, i;
|
|
6
|
+
var o = this, g = o._self._c, e = o._self._setupProxy;
|
|
7
|
+
return e.isVisible ? g(e.InOnboard, { key: "guido__recommendation-legacy-strategy-onboard", staticClass: "w-21-s p-a z-11", class: (t = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : t.classes, attrs: { id: "guido__recommendation-legacy-strategy-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "left-position": (n = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : n.left, "pages-config": e.onboardingStore.onboardings.recommendationLegacyStrategyOnboarding.config, "pointer-position": (r = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : r.position, "right-position": (a = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : a.right, "top-position": (i = e.onboardingStore.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : i.top }, on: { close: function(p) {
|
|
8
|
+
return e.onboardingStore.close(e.ONBOARDING_TYPE);
|
|
9
|
+
}, nextButtonClick: e.handleNext } }) : o._e();
|
|
10
|
+
}, m = [], l = /* @__PURE__ */ c(
|
|
11
|
+
s,
|
|
12
|
+
d,
|
|
13
|
+
m,
|
|
14
|
+
!1,
|
|
15
|
+
null,
|
|
16
|
+
"19d8cb42"
|
|
17
|
+
);
|
|
18
|
+
const f = l.exports;
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|