@useinsider/guido 3.18.2-beta.ec25841 → 3.18.2-beta.eedafd2
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 +1 -0
- package/dist/@types/config/schemas.js +28 -26
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +72 -70
- package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +52 -70
- package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +86 -56
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
- package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useCustomInterfaceAppearance.js +46 -56
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +81 -84
- package/dist/composables/useHttp.js +24 -22
- package/dist/composables/useRecommendation.js +35 -40
- package/dist/composables/useSave.js +90 -45
- package/dist/composables/useSaveValidation.js +279 -0
- package/dist/composables/useSaveValidationRollout.js +9 -0
- package/dist/composables/useStripo.js +30 -30
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/enums/extensions/recommendationBlock.js +31 -38
- package/dist/enums/save-validation.js +4 -0
- 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 +33 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +78 -168
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
- package/dist/guido.css +1 -1
- package/dist/services/templateLibraryApi.js +17 -14
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/enums/save-validation.d.ts +27 -0
- 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/store/recommendation.d.ts +3 -73
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
- package/dist/src/stores/config.d.ts +30 -0
- package/dist/src/stores/onboarding.d.ts +0 -377
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/utils/genericUtil.d.ts +6 -0
- package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
- package/dist/stores/config.js +39 -22
- package/dist/stores/onboarding.js +36 -41
- package/dist/stores/save-validation.js +30 -0
- package/dist/utils/genericUtil.js +63 -54
- package/dist/utils/liquidDynamicContent.js +15 -0
- package/dist/utils/templatePreparation.js +63 -59
- 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/strategyDetach.js +0 -19
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyDetach.d.ts +0 -12
- package/dist/static/styles/components/skeleton.css.js +0 -23
- /package/dist/src/components/organisms/{onboarding/RecommendationStrategyOnboarding.vue.d.ts → validation/ValidationErrorDrawer.vue.d.ts} +0 -0
|
@@ -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
|
|
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
7
|
import { ToasterTypeOptions as m } from "../../../../enums/toaster.js";
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
const rt = /* @__PURE__ */ I({
|
|
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: (
|
|
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
|
-
|
|
32
|
+
n.value = r || null, i.value = !1, e.fetchStrategies().catch(() => {
|
|
33
|
+
s({
|
|
33
34
|
type: m.Error,
|
|
34
|
-
message:
|
|
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
|
|
43
|
-
return
|
|
44
|
-
},
|
|
43
|
+
const a = I(r, E);
|
|
44
|
+
return o("recommendation-strategy.last-updated-on", { value: a });
|
|
45
|
+
}, D = l(() => e.strategies.map((t) => ({
|
|
45
46
|
text: t.name,
|
|
46
47
|
value: t.strategy_id,
|
|
47
48
|
infoBoxProps: {
|
|
@@ -49,76 +50,57 @@ const rt = /* @__PURE__ */ I({
|
|
|
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: s("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 o = e.currentRecommendationId;
|
|
74
|
-
String(a.value ?? "") === r && (a.value = null);
|
|
75
|
-
const y = e.recommendationConfigs.strategyId === r;
|
|
76
|
-
y && e.removeStrategy(), e.openStrategyEdit(r), y && o !== null && N(o);
|
|
77
|
-
}, p = l(() => {
|
|
78
|
-
const t = e.strategies.find((r) => String(r.strategy_id) === String(a.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",
|
|
84
|
-
labelText:
|
|
66
|
+
labelText: o("products.assign-btn")
|
|
85
67
|
},
|
|
86
68
|
cancelOrBackButton: {
|
|
87
69
|
styling: "ghost",
|
|
88
70
|
type: "secondary",
|
|
89
|
-
labelText:
|
|
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
|
-
|
|
89
|
+
s({
|
|
108
90
|
type: m.Error,
|
|
109
|
-
message:
|
|
91
|
+
message: o("email-editor.strategy-assign-failed", { strategyName: t.name })
|
|
110
92
|
});
|
|
111
93
|
return;
|
|
112
94
|
}
|
|
113
|
-
e.assignStrategy(t),
|
|
95
|
+
e.assignStrategy(t), s({
|
|
114
96
|
type: m.Success,
|
|
115
|
-
message:
|
|
97
|
+
message: o("email-editor.strategy-assigned-success", { strategyName: t.name })
|
|
116
98
|
}), e.closeAssignStrategyDrawer();
|
|
117
99
|
}, onSelect: (t) => {
|
|
118
|
-
|
|
100
|
+
n.value = t.value, i.value = !1;
|
|
119
101
|
} };
|
|
120
102
|
}
|
|
121
103
|
});
|
|
122
104
|
export {
|
|
123
|
-
|
|
105
|
+
W as default
|
|
124
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 C = /* @__PURE__ */ l({
|
|
|
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
|
};
|
|
@@ -4,7 +4,7 @@ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
|
4
4
|
var u = function() {
|
|
5
5
|
var s, i, n, a;
|
|
6
6
|
var o = this, e = o._self._c, t = o._self._setupProxy;
|
|
7
|
-
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "
|
|
7
|
+
return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.handleTestEmail } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "label-text": t.saveLabel, "loading-status": t.isSaving }, on: { click: function(r) {
|
|
8
8
|
return t.handleSave(!1);
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
@@ -15,7 +15,7 @@ var u = function() {
|
|
|
15
15
|
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"f938f128"
|
|
19
19
|
);
|
|
20
20
|
const v = c.exports;
|
|
21
21
|
export {
|
|
@@ -1,79 +1,109 @@
|
|
|
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
|
-
import
|
|
18
|
-
|
|
1
|
+
import { defineComponent as D, computed as u, ref as c } from "vue";
|
|
2
|
+
import { useActionsApi as z } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as I } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as P } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as W } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as j } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as G } from "../../../composables/useSave.js";
|
|
8
|
+
import { useSaveValidation as J } from "../../../composables/useSaveValidation.js";
|
|
9
|
+
import { useSaveValidationRollout as K } from "../../../composables/useSaveValidationRollout.js";
|
|
10
|
+
import { useToaster as N } from "../../../composables/useToaster.js";
|
|
11
|
+
import { useTranslations as Q } from "../../../composables/useTranslations.js";
|
|
12
|
+
import { useVersionHistoryApi as U } from "../../../composables/useVersionHistoryApi.js";
|
|
13
|
+
import { useLiquidValidator as X } from "../../../composables/validators/useLiquidValidator.js";
|
|
14
|
+
import { ToasterTypeOptions as Y } from "../../../enums/toaster.js";
|
|
15
|
+
import { useConfigStore as Z } from "../../../stores/config.js";
|
|
16
|
+
import { useEditorStore as $ } from "../../../stores/editor.js";
|
|
17
|
+
import { useSaveValidationStore as tt } from "../../../stores/save-validation.js";
|
|
18
|
+
import { useTemplateStore as et } from "../../../stores/template.js";
|
|
19
|
+
import { getTooltipOptions as ot } from "../../../utils/tooltipUtils.js";
|
|
20
|
+
import { InButtonV2 as rt } from "@useinsider/design-system-vue";
|
|
21
|
+
import { storeToRefs as it } from "pinia";
|
|
22
|
+
import at from "./MigrationConfirmModal.vue.js";
|
|
23
|
+
const Ot = /* @__PURE__ */ D({
|
|
19
24
|
__name: "EditorActions",
|
|
20
|
-
setup(
|
|
21
|
-
const { config:
|
|
22
|
-
if (
|
|
23
|
-
|
|
25
|
+
setup(st, { expose: M }) {
|
|
26
|
+
const { config: p, isFeatureEnabled: f } = I(), { exportHtml: d } = P(), { save: v } = G(), { validateCurrentTemplate: y } = J(), { isEnabled: i } = K(), { showToaster: S, handleError: a } = N(), { openVersionHistory: g, closeVersionHistory: h } = U(), { getCompiledEmail: V } = z(), { compileHtml: w } = j(), { validateLiquidSyntax: T } = X(), E = Z(), o = $(), H = tt(), x = et(), { hasMigrations: C } = it(x), r = Q(), b = u(() => i.value && E.allowSaveWithErrors ? r("email-editor.save-and-continue") : "Save"), s = c(!1), n = c(!1), _ = c(), l = W(), k = () => {
|
|
27
|
+
if (o.isVersionHistoryOpen) {
|
|
28
|
+
h();
|
|
24
29
|
return;
|
|
25
30
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
31
|
+
g();
|
|
32
|
+
}, F = async () => {
|
|
33
|
+
s.value = !0, await d(), s.value = !1;
|
|
34
|
+
}, q = () => {
|
|
35
|
+
o.isSaveAsTemplateDrawerOpen = !0;
|
|
36
|
+
}, B = u(() => o.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), L = u(
|
|
32
37
|
() => {
|
|
33
|
-
var t,
|
|
34
|
-
return ((
|
|
38
|
+
var t, e;
|
|
39
|
+
return ((e = (t = p.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
|
|
35
40
|
}
|
|
36
|
-
),
|
|
37
|
-
|
|
38
|
-
let
|
|
41
|
+
), A = async (t) => {
|
|
42
|
+
n.value = !0, t || (o.loadingStatus = !0);
|
|
43
|
+
let e;
|
|
39
44
|
try {
|
|
40
|
-
|
|
41
|
-
} catch (
|
|
45
|
+
e = await v(t);
|
|
46
|
+
} catch (m) {
|
|
42
47
|
if (t)
|
|
43
|
-
throw
|
|
44
|
-
|
|
48
|
+
throw m;
|
|
49
|
+
a(m, "Failed to save template");
|
|
45
50
|
} finally {
|
|
46
|
-
|
|
51
|
+
n.value = !1, !t && !e && (o.loadingStatus = !1);
|
|
47
52
|
}
|
|
48
|
-
return
|
|
49
|
-
},
|
|
50
|
-
var
|
|
51
|
-
if (!t &&
|
|
52
|
-
(
|
|
53
|
+
return e;
|
|
54
|
+
}, O = (t) => {
|
|
55
|
+
var e;
|
|
56
|
+
if (!t && C.value) {
|
|
57
|
+
(e = _.value) == null || e.open();
|
|
53
58
|
return;
|
|
54
59
|
}
|
|
55
|
-
return
|
|
56
|
-
},
|
|
57
|
-
if (
|
|
58
|
-
|
|
60
|
+
return A(t);
|
|
61
|
+
}, R = async () => {
|
|
62
|
+
if (i.value) {
|
|
63
|
+
o.loadingStatus = !0;
|
|
64
|
+
let t = [];
|
|
65
|
+
try {
|
|
66
|
+
t = await y();
|
|
67
|
+
} catch (e) {
|
|
68
|
+
console.warn("Test-path validation failed; sending without the drawer.", e);
|
|
69
|
+
} finally {
|
|
70
|
+
o.loadingStatus = !1;
|
|
71
|
+
}
|
|
72
|
+
if (t.length) {
|
|
73
|
+
S({
|
|
74
|
+
type: Y.Error,
|
|
75
|
+
message: r("email-editor.validation-errors-found"),
|
|
76
|
+
actionButton: {
|
|
77
|
+
text: r("email-editor.check-errors"),
|
|
78
|
+
onClick: () => H.open(t, "test")
|
|
79
|
+
},
|
|
80
|
+
autoHide: !1
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
l();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (f("liquidSyntax")) {
|
|
88
|
+
o.loadingStatus = !0;
|
|
59
89
|
try {
|
|
60
|
-
const { html: t } = await
|
|
61
|
-
if (!await
|
|
90
|
+
const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: e } = w(t);
|
|
91
|
+
if (!await T(e))
|
|
62
92
|
return;
|
|
63
93
|
} catch (t) {
|
|
64
|
-
|
|
94
|
+
a(t, "Failed to prepare test email");
|
|
65
95
|
return;
|
|
66
96
|
} finally {
|
|
67
|
-
|
|
97
|
+
o.loadingStatus = !1;
|
|
68
98
|
}
|
|
69
99
|
}
|
|
70
|
-
|
|
100
|
+
l();
|
|
71
101
|
};
|
|
72
|
-
return
|
|
73
|
-
handleSave:
|
|
74
|
-
}), { __sfc: !0, config:
|
|
102
|
+
return M({
|
|
103
|
+
handleSave: O
|
|
104
|
+
}), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled: i, showToaster: S, handleError: a, openVersionHistory: g, closeVersionHistory: h, getCompiledEmail: V, compileHtml: w, validateLiquidSyntax: T, configStore: E, editorStore: o, saveValidationStore: H, templateStore: x, hasMigrations: C, trans: r, saveLabel: b, isExporting: s, isSaving: n, migrationModalRef: _, testEmailClick: l, handleVersionHistory: k, handleExport: F, handleSaveAs: q, versionHistoryTooltipText: B, isVersionHistoryButtonVisible: L, executeSave: A, handleSave: O, handleTestEmail: R, getTooltipOptions: ot, InButtonV2: rt, MigrationConfirmModal: at };
|
|
75
105
|
}
|
|
76
106
|
});
|
|
77
107
|
export {
|
|
78
|
-
|
|
108
|
+
Ot as default
|
|
79
109
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import o from "./LeftSlot.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var a = function() {
|
|
5
5
|
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
6
|
return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { attrs: { id: "guido__back-button", "left-icon": "line-arrow-left", styling: "ghost", type: "secondary", "disabled-status": t.isBackButtonDisabled, "label-text": t.backButtonLabel, "skeleton-sizing": { width: 150, height: 26 }, "skeleton-status": t.editorStore.loadingStatus }, on: { click: t.handleBackClick } })], 1);
|
|
7
|
-
}, i = [], r = /* @__PURE__ */
|
|
7
|
+
}, i = [], r = /* @__PURE__ */ n(
|
|
8
8
|
o,
|
|
9
|
-
|
|
9
|
+
a,
|
|
10
10
|
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"b8f24f34"
|
|
14
14
|
);
|
|
15
15
|
const f = r.exports;
|
|
16
16
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as m, computed as p, ref as d } from "vue";
|
|
2
2
|
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useBack as B } from "../../../composables/useGuidoActions.js";
|
|
4
4
|
import { usePreviewMode as b } from "../../../composables/usePreviewMode.js";
|
|
5
5
|
import { useTranslations as v } from "../../../composables/useTranslations.js";
|
|
6
6
|
import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
|
|
7
|
-
import { useEditorStore as
|
|
7
|
+
import { useEditorStore as y } from "../../../stores/editor.js";
|
|
8
8
|
import { InButtonV2 as w } from "@useinsider/design-system-vue";
|
|
9
|
-
import { useDebounceFn as
|
|
10
|
-
const D = /* @__PURE__ */
|
|
9
|
+
import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.js";
|
|
10
|
+
const D = /* @__PURE__ */ m({
|
|
11
11
|
__name: "LeftSlot",
|
|
12
12
|
setup(C) {
|
|
13
|
-
const e =
|
|
14
|
-
var u,
|
|
15
|
-
return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (
|
|
16
|
-
}), r = d(!1),
|
|
13
|
+
const e = y(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), l = p(() => {
|
|
14
|
+
var u, f;
|
|
15
|
+
return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (f = (u = t.value) == null ? void 0 : u.ui) != null && f.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
|
|
16
|
+
}), r = d(!1), a = () => {
|
|
17
17
|
if (e.isVersionHistoryOpen) {
|
|
18
18
|
n();
|
|
19
19
|
return;
|
|
@@ -23,11 +23,15 @@ const D = /* @__PURE__ */ l({
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
i();
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, c = V(async () => {
|
|
27
|
+
try {
|
|
28
|
+
await a();
|
|
29
|
+
} finally {
|
|
30
|
+
r.value = !1;
|
|
31
|
+
}
|
|
28
32
|
}, 500);
|
|
29
|
-
return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel:
|
|
30
|
-
r.value = !0,
|
|
33
|
+
return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: l, isBackButtonDisabled: r, executeBackAction: a, debouncedBackAction: c, handleBackClick: () => {
|
|
34
|
+
r.value = !0, c();
|
|
31
35
|
}, InButtonV2: w };
|
|
32
36
|
}
|
|
33
37
|
});
|
|
@@ -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
|
};
|