@useinsider/guido 3.20.1 → 3.21.0
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 +65 -64
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -9
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +53 -51
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +23 -22
- package/dist/composables/useAutoSave.js +46 -44
- package/dist/composables/useLegacyStrategyConversion.js +16 -16
- package/dist/composables/useSave.js +26 -23
- package/dist/composables/useSaveValidation.js +113 -114
- package/dist/composables/useSaveValidationRollout.js +17 -6
- package/dist/composables/useStripo.js +4 -3
- package/dist/extensions/Blocks/Items/block.js +43 -42
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +296 -223
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +221 -203
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +19 -0
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +51 -36
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +31 -35
- package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +271 -192
- package/dist/package.json.js +1 -1
- package/dist/services/settingsApi.js +11 -0
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +4 -1
- package/dist/src/composables/useSaveValidationRollout.d.ts +1 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +40 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +2 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +18 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +9 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +7 -0
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +22 -0
- package/dist/src/services/settingsApi.d.ts +6 -0
- package/dist/src/stores/setup-settings.d.ts +4 -0
- package/dist/static/styles/components/button.css.js +5 -0
- package/dist/stores/setup-settings.js +10 -0
- package/package.json +4 -4
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useCortexBlueprintBridge as
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { provideGuidoActions as
|
|
5
|
-
import { useGuidoStateBridge as
|
|
6
|
-
import { usePartner as
|
|
7
|
-
import { useSaveValidationRollout as
|
|
8
|
-
import { useStripo as
|
|
9
|
-
import { useTimerClone as
|
|
1
|
+
import { defineComponent as ie, defineAsyncComponent as m, ref as W, computed as p, watch as G, onMounted as ce, onUnmounted as de } from "vue";
|
|
2
|
+
import { useCortexBlueprintBridge as me } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
+
import { useEditorLock as le } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ue } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as pe } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as fe } from "../composables/usePartner.js";
|
|
7
|
+
import { useSaveValidationRollout as ye } from "../composables/useSaveValidationRollout.js";
|
|
8
|
+
import { useStripo as ge } from "../composables/useStripo.js";
|
|
9
|
+
import { useTimerClone as Se } from "../composables/useTimerClone.js";
|
|
10
10
|
import { migrate as V } from "../config/migrator/index.js";
|
|
11
11
|
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
12
|
-
import { RIBBON_SELECTOR as
|
|
13
|
-
import { useRecommendationExtensionStore as
|
|
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
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
|
|
12
|
+
import { RIBBON_SELECTOR as ve } from "../enums/onboarding.js";
|
|
13
|
+
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as be } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
14
|
+
import { disposeUnsubscribeListeners as he } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
15
|
+
import Ee from "./organisms/AutoSaveController.vue.js";
|
|
16
|
+
import we from "./organisms/base/AuthErrorModal.vue.js";
|
|
17
|
+
import De from "./organisms/base/Toaster.vue.js";
|
|
18
|
+
import Ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
19
|
+
import ke from "./organisms/header/HeaderWrapper.vue.js";
|
|
20
|
+
import Re from "./organisms/LoadingWrapper.vue.js";
|
|
21
|
+
import Fe from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
22
|
+
import Le from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
23
|
+
import Me from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
24
|
+
import { useStripoApi as Te } from "../services/stripoApi.js";
|
|
25
|
+
import { useConfigStore as Ie } from "../stores/config.js";
|
|
26
|
+
import { useDynamicContentStore as Ue } from "../stores/dynamic-content.js";
|
|
27
|
+
import { useEditorStore as E } from "../stores/editor.js";
|
|
28
|
+
import { usePreviewStore as Ae } from "../stores/preview.js";
|
|
29
|
+
import { useSaveValidationStore as Be } from "../stores/save-validation.js";
|
|
30
|
+
import { useTemplateStore as Ne } from "../stores/template.js";
|
|
31
|
+
import { useUnsubscribeStore as Pe } from "../stores/unsubscribe.js";
|
|
32
|
+
import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
|
|
33
|
+
const yt = /* @__PURE__ */ ie({
|
|
33
34
|
__name: "Guido",
|
|
34
35
|
props: {
|
|
35
36
|
config: null,
|
|
36
37
|
ready: { type: Boolean, default: !0 }
|
|
37
38
|
},
|
|
38
39
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
39
|
-
setup(
|
|
40
|
-
const s =
|
|
40
|
+
setup(q, { expose: K, emit: r }) {
|
|
41
|
+
const s = q, j = m(
|
|
41
42
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
42
|
-
), j = m(
|
|
43
|
-
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
44
43
|
), J = m(
|
|
45
|
-
() => import("./organisms/
|
|
44
|
+
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
46
45
|
), Q = m(
|
|
47
|
-
() => import("./organisms/extensions/recommendation/
|
|
46
|
+
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
48
47
|
), X = m(
|
|
48
|
+
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
49
|
+
), Y = m(
|
|
49
50
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
50
|
-
),
|
|
51
|
+
), w = W(), f = W(), y = Ue(), D = Pe(), o = Ie();
|
|
51
52
|
s.ready && o.init(s.config);
|
|
52
|
-
const c =
|
|
53
|
+
const c = E(), Z = Ae(), l = p(() => c.hasChanges), { isTestPartner: ee } = fe(), { isEnabled: te, loadRollout: C } = ye(), k = () => {
|
|
53
54
|
var t;
|
|
54
|
-
return (t =
|
|
55
|
-
},
|
|
55
|
+
return (t = w.value) == null ? void 0 : t.handleSave(!0);
|
|
56
|
+
}, R = (t) => {
|
|
56
57
|
c.loadingStatus = t;
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
+
me(), pe();
|
|
59
60
|
const g = () => {
|
|
60
61
|
var t, e;
|
|
61
62
|
return {
|
|
@@ -66,15 +67,15 @@ const lt = /* @__PURE__ */ se({
|
|
|
66
67
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
67
68
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
68
69
|
};
|
|
69
|
-
}, { initPlugin:
|
|
70
|
+
}, { initPlugin: F, preloadRuntime: L } = ge(), { runExclusive: M, beginMount: T, isCurrentMount: S } = le();
|
|
70
71
|
let u = 0;
|
|
71
|
-
const { getDefaultTemplate:
|
|
72
|
+
const { getDefaultTemplate: I } = Te(), { cloneTimersOnSave: U, hasTimerBlocks: A } = Se(), oe = p(() => {
|
|
72
73
|
var t;
|
|
73
74
|
return !((t = o.ui) != null && t.showHeader);
|
|
74
|
-
}),
|
|
75
|
-
() => !!
|
|
75
|
+
}), ne = p(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = p(
|
|
76
|
+
() => !!z().recommendationConfigs.strategyId
|
|
76
77
|
);
|
|
77
|
-
|
|
78
|
+
ue({
|
|
78
79
|
onBack: () => {
|
|
79
80
|
console.debug("guido:back"), r("back");
|
|
80
81
|
},
|
|
@@ -104,14 +105,14 @@ const lt = /* @__PURE__ */ se({
|
|
|
104
105
|
let i = null;
|
|
105
106
|
const b = () => {
|
|
106
107
|
var e;
|
|
107
|
-
const t = document.querySelector(
|
|
108
|
+
const t = document.querySelector(ve);
|
|
108
109
|
(e = f.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
109
110
|
}, h = async () => {
|
|
110
111
|
var t;
|
|
111
112
|
try {
|
|
112
113
|
o.initialized || o.init(s.config), c.templateId = o.templateId;
|
|
113
114
|
const e = o.template, a = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
114
|
-
|
|
115
|
+
D.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
115
116
|
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
|
|
116
117
|
partnerName: o.partnerName,
|
|
117
118
|
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
@@ -121,25 +122,25 @@ const lt = /* @__PURE__ */ se({
|
|
|
121
122
|
html: a && await V(a, _, x),
|
|
122
123
|
css: d
|
|
123
124
|
};
|
|
124
|
-
n.html || (n = await
|
|
125
|
-
const
|
|
126
|
-
A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(
|
|
127
|
-
const
|
|
125
|
+
n.html || (n = await I(), n.html = await V(n.html, _, x));
|
|
126
|
+
const ae = O ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
127
|
+
A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(ae, H(n.html)));
|
|
128
|
+
const se = {
|
|
128
129
|
preselectedDynamicContentList: P,
|
|
129
130
|
onReady: () => {
|
|
130
131
|
console.debug("guido:ready"), r("ready");
|
|
131
132
|
}
|
|
132
133
|
};
|
|
133
|
-
u =
|
|
134
|
+
u = T(), await F(n, g(), se), y.selectedDynamicContentList = P;
|
|
134
135
|
} catch (e) {
|
|
135
136
|
console.error("Failed to initialize Stripo editor:", e);
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
|
-
return
|
|
139
|
+
return ce(async () => {
|
|
139
140
|
var e;
|
|
140
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
141
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), E().$reset(), Ne().$reset(), Be().$reset(), C(), b();
|
|
141
142
|
const t = (e = f.value) == null ? void 0 : e.parentElement;
|
|
142
|
-
if (t && (i = new ResizeObserver(b), i.observe(t)),
|
|
143
|
+
if (t && (i = new ResizeObserver(b), i.observe(t)), L(), s.ready)
|
|
143
144
|
await h();
|
|
144
145
|
else {
|
|
145
146
|
const a = G(() => s.ready, (d) => {
|
|
@@ -147,14 +148,14 @@ const lt = /* @__PURE__ */ se({
|
|
|
147
148
|
});
|
|
148
149
|
}
|
|
149
150
|
document.addEventListener("dynamic-content:open", v);
|
|
150
|
-
}),
|
|
151
|
-
if (i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v),
|
|
151
|
+
}), de(() => {
|
|
152
|
+
if (he(), be(), i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", v), S(u))
|
|
152
153
|
try {
|
|
153
|
-
|
|
154
|
+
E().isStripoInitialized = !1;
|
|
154
155
|
} catch (t) {
|
|
155
156
|
console.debug("Failed to close the editor readiness gate on unmount", t);
|
|
156
157
|
}
|
|
157
|
-
|
|
158
|
+
M(async () => {
|
|
158
159
|
if (S(u))
|
|
159
160
|
try {
|
|
160
161
|
window.UIEditor.removeEditor();
|
|
@@ -162,17 +163,17 @@ const lt = /* @__PURE__ */ se({
|
|
|
162
163
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
163
164
|
}
|
|
164
165
|
}), o.reset();
|
|
165
|
-
}),
|
|
166
|
+
}), K({
|
|
166
167
|
dynamicContent: {
|
|
167
168
|
insert: B,
|
|
168
169
|
close: N
|
|
169
170
|
},
|
|
170
171
|
hasChanges: l,
|
|
171
172
|
saveSilent: k,
|
|
172
|
-
setLoading:
|
|
173
|
-
}), { __sfc: !0, PreviewContainer:
|
|
173
|
+
setLoading: R
|
|
174
|
+
}), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, LegacyStrategyUpdatedModal: Y, headerWrapperRef: w, wrapperRef: f, dynamicContentStore: y, unsubscribeStore: D, props: s, configStore: o, editorStore: c, previewStore: Z, hasChanges: l, isTestPartner: ee, isSaveValidationEnabled: te, loadRollout: C, saveSilent: k, setLoading: R, emit: r, buildMetadata: g, initPlugin: F, preloadRuntime: L, runExclusive: M, beginMount: T, isCurrentMount: S, mountGeneration: u, getDefaultTemplate: I, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, hasAssignedStrategy: re, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: i, updateRibbonOffset: b, startEditor: h, AutoSaveController: Ee, AuthErrorModal: we, Toaster: De, FilterSelectionDrawer: Ce, HeaderWrapper: ke, LoadingWrapper: Re, SaveAsTemplateDrawer: Fe, UnsubscribeWrapper: Le, ValidationErrorDrawer: Me };
|
|
174
175
|
}
|
|
175
176
|
});
|
|
176
177
|
export {
|
|
177
|
-
|
|
178
|
+
yt as default
|
|
178
179
|
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useAutoSave as
|
|
3
|
-
import { useSave as
|
|
4
|
-
import { useSaveValidationRollout as
|
|
5
|
-
|
|
1
|
+
import { defineComponent as n } from "vue";
|
|
2
|
+
import { useAutoSave as u } from "../../composables/useAutoSave.js";
|
|
3
|
+
import { useSave as i } from "../../composables/useSave.js";
|
|
4
|
+
import { useSaveValidationRollout as l } from "../../composables/useSaveValidationRollout.js";
|
|
5
|
+
import { useConfigStore as m } from "../../stores/config.js";
|
|
6
|
+
const d = /* @__PURE__ */ n({
|
|
6
7
|
__name: "AutoSaveController",
|
|
7
|
-
setup(
|
|
8
|
-
const { save: e, saveRawOnly:
|
|
9
|
-
return s(
|
|
8
|
+
setup(f) {
|
|
9
|
+
const { save: e, saveRawOnly: t } = i(), { isEnabled: r } = l(), a = m(), o = () => r.value && a.allowSaveWithErrors, s = () => o() ? t() : e(!1, !0);
|
|
10
|
+
return u(s, { clearsChanges: () => !o() }), { __sfc: !0, save: e, saveRawOnly: t, isEnabled: r, configStore: a, isRawAutosave: o, backgroundSave: s };
|
|
10
11
|
}
|
|
11
12
|
});
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
d as default
|
|
14
15
|
};
|
|
@@ -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
|
+
}, p = [], c = /* @__PURE__ */ d(
|
|
13
13
|
l,
|
|
14
14
|
u,
|
|
15
|
-
|
|
15
|
+
p,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"baf7a5dd"
|
|
19
19
|
);
|
|
20
|
-
const v =
|
|
20
|
+
const v = c.exports;
|
|
21
21
|
export {
|
|
22
22
|
v as default
|
|
23
23
|
};
|
|
@@ -1,83 +1,85 @@
|
|
|
1
|
-
import { defineComponent as I, computed as
|
|
1
|
+
import { defineComponent as I, computed as u, ref as c } from "vue";
|
|
2
2
|
import { useActionsApi as P } from "../../../composables/useActionsApi.js";
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useExport as
|
|
5
|
-
import { useTestEmailClick as
|
|
6
|
-
import { useHtmlCompiler as
|
|
7
|
-
import { useSave as
|
|
8
|
-
import { useSaveValidation as
|
|
9
|
-
import { useSaveValidationRollout as
|
|
10
|
-
import { useToaster as
|
|
3
|
+
import { useConfig as j } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as G } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as J } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as K } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as N } from "../../../composables/useSave.js";
|
|
8
|
+
import { useSaveValidation as Q } from "../../../composables/useSaveValidation.js";
|
|
9
|
+
import { useSaveValidationRollout as U } from "../../../composables/useSaveValidationRollout.js";
|
|
10
|
+
import { useToaster as W } from "../../../composables/useToaster.js";
|
|
11
11
|
import { useTranslations as X } from "../../../composables/useTranslations.js";
|
|
12
12
|
import { useVersionHistoryApi as Y } from "../../../composables/useVersionHistoryApi.js";
|
|
13
13
|
import { useLiquidValidator as Z } from "../../../composables/validators/useLiquidValidator.js";
|
|
14
14
|
import { ToasterTypeOptions as $ } from "../../../enums/toaster.js";
|
|
15
|
-
import {
|
|
16
|
-
import { useEditorStore as ot } from "../../../stores/editor.js";
|
|
15
|
+
import { useEditorStore as tt } from "../../../stores/editor.js";
|
|
17
16
|
import { useSaveValidationStore as et } from "../../../stores/save-validation.js";
|
|
18
|
-
import { useTemplateStore as
|
|
19
|
-
import { getTooltipOptions as
|
|
20
|
-
import { InButtonV2 as
|
|
21
|
-
import { storeToRefs as
|
|
22
|
-
import
|
|
23
|
-
const
|
|
17
|
+
import { useTemplateStore as ot } from "../../../stores/template.js";
|
|
18
|
+
import { getTooltipOptions as rt } from "../../../utils/tooltipUtils.js";
|
|
19
|
+
import { InButtonV2 as it } from "@useinsider/design-system-vue";
|
|
20
|
+
import { storeToRefs as st } from "pinia";
|
|
21
|
+
import at from "./MigrationConfirmModal.vue.js";
|
|
22
|
+
const Ot = /* @__PURE__ */ I({
|
|
24
23
|
__name: "EditorActions",
|
|
25
|
-
setup(
|
|
26
|
-
const { config: p, isFeatureEnabled: f } =
|
|
27
|
-
if (
|
|
28
|
-
|
|
24
|
+
setup(nt, { expose: b }) {
|
|
25
|
+
const { config: p, isFeatureEnabled: f } = j(), { exportHtml: d } = G(), { save: v } = N(), { validateCurrentTemplate: y } = Q(), { isEnabled: s } = U(), { showToaster: S, hideToaster: g, handleError: i } = W(), { openVersionHistory: h, closeVersionHistory: T } = Y(), { getCompiledEmail: V } = P(), { compileHtml: E } = K(), { validateLiquidSyntax: H } = Z(), e = tt(), w = et(), x = ot(), { hasMigrations: C } = st(x), r = X(), k = u(() => s.value ? r("email-editor.save-and-continue") : "Save"), a = c(!1), n = c(!1), _ = c(), l = J(), q = () => {
|
|
26
|
+
if (e.isVersionHistoryOpen) {
|
|
27
|
+
T();
|
|
29
28
|
return;
|
|
30
29
|
}
|
|
31
|
-
|
|
30
|
+
h();
|
|
32
31
|
}, B = async () => {
|
|
33
32
|
a.value = !0, await d(), a.value = !1;
|
|
34
33
|
}, L = () => {
|
|
35
|
-
|
|
36
|
-
}, R =
|
|
34
|
+
e.isSaveAsTemplateDrawerOpen = !0;
|
|
35
|
+
}, R = u(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), D = u(
|
|
37
36
|
() => {
|
|
38
|
-
var t,
|
|
39
|
-
return ((
|
|
37
|
+
var t, o;
|
|
38
|
+
return ((o = (t = p.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
40
39
|
}
|
|
41
40
|
), A = async (t) => {
|
|
42
|
-
n.value = !0, t || (
|
|
43
|
-
let
|
|
41
|
+
n.value = !0, t || (e.loadingStatus = !0);
|
|
42
|
+
let o;
|
|
44
43
|
try {
|
|
45
|
-
|
|
46
|
-
} catch (
|
|
47
|
-
|
|
44
|
+
o = await v(t);
|
|
45
|
+
} catch (M) {
|
|
46
|
+
i(M, "Failed to save template");
|
|
48
47
|
} finally {
|
|
49
|
-
n.value = !1, !t && !
|
|
48
|
+
n.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
50
49
|
}
|
|
51
|
-
return
|
|
50
|
+
return o;
|
|
52
51
|
}, O = (t) => {
|
|
53
|
-
var
|
|
52
|
+
var o;
|
|
54
53
|
if (!t && C.value) {
|
|
55
|
-
(
|
|
54
|
+
(o = _.value) == null || o.open();
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
57
|
return A(t);
|
|
59
58
|
}, m = async () => {
|
|
60
|
-
|
|
59
|
+
e.loadingStatus = !0;
|
|
61
60
|
try {
|
|
62
61
|
return await y();
|
|
63
62
|
} catch (t) {
|
|
64
|
-
return
|
|
63
|
+
return i(t, "Failed to prepare test email"), null;
|
|
65
64
|
} finally {
|
|
66
|
-
|
|
65
|
+
e.loadingStatus = !1;
|
|
67
66
|
}
|
|
68
|
-
},
|
|
67
|
+
}, F = async () => {
|
|
69
68
|
const t = await m();
|
|
70
|
-
t.length
|
|
69
|
+
t != null && t.length ? w.open(t, "test") : t && g();
|
|
71
70
|
}, z = async () => {
|
|
72
|
-
if (
|
|
73
|
-
|
|
71
|
+
if (s.value) {
|
|
72
|
+
const t = await m();
|
|
73
|
+
if (!t)
|
|
74
|
+
return;
|
|
75
|
+
if (t.length) {
|
|
74
76
|
S({
|
|
75
77
|
type: $.Error,
|
|
76
78
|
message: r("email-editor.validation-errors-found"),
|
|
77
79
|
actionButton: {
|
|
78
80
|
text: r("email-editor.check-errors"),
|
|
79
81
|
onClick: () => {
|
|
80
|
-
|
|
82
|
+
F();
|
|
81
83
|
}
|
|
82
84
|
},
|
|
83
85
|
autoHide: !1
|
|
@@ -88,25 +90,25 @@ const bt = /* @__PURE__ */ I({
|
|
|
88
90
|
return;
|
|
89
91
|
}
|
|
90
92
|
if (f("liquidSyntax")) {
|
|
91
|
-
|
|
93
|
+
e.loadingStatus = !0;
|
|
92
94
|
try {
|
|
93
|
-
const { html: t } = await
|
|
94
|
-
if (!await
|
|
95
|
+
const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = E(t);
|
|
96
|
+
if (!await H(o))
|
|
95
97
|
return;
|
|
96
98
|
} catch (t) {
|
|
97
|
-
|
|
99
|
+
i(t, "Failed to prepare test email");
|
|
98
100
|
return;
|
|
99
101
|
} finally {
|
|
100
|
-
|
|
102
|
+
e.loadingStatus = !1;
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
l();
|
|
104
106
|
};
|
|
105
|
-
return
|
|
107
|
+
return b({
|
|
106
108
|
handleSave: O
|
|
107
|
-
}), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled:
|
|
109
|
+
}), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled: s, showToaster: S, hideToaster: g, handleError: i, openVersionHistory: h, closeVersionHistory: T, getCompiledEmail: V, compileHtml: E, validateLiquidSyntax: H, editorStore: e, saveValidationStore: w, templateStore: x, hasMigrations: C, trans: r, saveLabel: k, isExporting: a, isSaving: n, migrationModalRef: _, testEmailClick: l, handleVersionHistory: q, handleExport: B, handleSaveAs: L, versionHistoryTooltipText: R, isVersionHistoryButtonVisible: D, executeSave: A, handleSave: O, collectTestErrors: m, openTestErrors: F, handleTestEmail: z, getTooltipOptions: rt, InButtonV2: it, MigrationConfirmModal: at };
|
|
108
110
|
}
|
|
109
111
|
});
|
|
110
112
|
export {
|
|
111
|
-
|
|
113
|
+
Ot as default
|
|
112
114
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as c, ref as f, computed as s } from "vue";
|
|
2
|
+
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
3
|
import { useSave as S } from "../../../composables/useSave.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
4
|
+
import { useToaster as g } from "../../../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as y } from "../../../composables/useTranslations.js";
|
|
6
|
+
import { useConfigStore as h } from "../../../stores/config.js";
|
|
7
|
+
import { useEditorStore as _ } from "../../../stores/editor.js";
|
|
8
|
+
import { useSaveValidationStore as w } from "../../../stores/save-validation.js";
|
|
9
|
+
import { escapeHtml as C } from "../../../utils/htmlEscape.js";
|
|
10
|
+
import { InIcons as E } from "@useinsider/design-system-vue";
|
|
11
|
+
const H = /* @__PURE__ */ c({
|
|
11
12
|
__name: "ValidationErrorDrawer",
|
|
12
|
-
setup(
|
|
13
|
-
const r =
|
|
13
|
+
setup(T) {
|
|
14
|
+
const r = y(), e = w(), a = _(), n = h(), { saveWithErrors: i } = S(), { handleError: l } = g(), o = f(!1), m = s(() => {
|
|
14
15
|
const t = {
|
|
15
16
|
primaryButton: {
|
|
16
17
|
styling: "solid",
|
|
@@ -18,32 +19,32 @@ const V = /* @__PURE__ */ p({
|
|
|
18
19
|
labelText: r("email-editor.update-design")
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
|
-
return
|
|
22
|
+
return n.allowSaveWithErrors && e.intent !== "test" && (t.secondaryButton = {
|
|
22
23
|
styling: "solid",
|
|
23
24
|
type: "subtle-primary",
|
|
24
25
|
labelText: r("email-editor.save-and-continue"),
|
|
25
26
|
loadingStatus: o.value
|
|
26
27
|
}), t;
|
|
27
|
-
}),
|
|
28
|
-
const
|
|
29
|
-
return `${t.message}${
|
|
30
|
-
}));
|
|
31
|
-
return { __sfc: !0, trans: r, store: e, editorStore:
|
|
28
|
+
}), u = s(() => e.errors.map((t) => {
|
|
29
|
+
const p = t.detail ? ` (${C(t.detail)})` : "";
|
|
30
|
+
return `${t.message}${p}`;
|
|
31
|
+
})), d = s(() => `${r("email-editor.validation-errors")} (${u.value.length})`);
|
|
32
|
+
return { __sfc: !0, trans: r, store: e, editorStore: a, configStore: n, saveWithErrors: i, handleError: l, isSaving: o, footerButtonGroupOptions: m, rows: u, titleText: d, handleClose: () => {
|
|
32
33
|
e.isDrawerOpen && e.close();
|
|
33
34
|
}, handleSaveAndContinue: async () => {
|
|
34
35
|
if (!o.value) {
|
|
35
|
-
o.value = !0,
|
|
36
|
+
o.value = !0, a.loadingStatus = !0;
|
|
36
37
|
try {
|
|
37
|
-
await i() ? e.close() :
|
|
38
|
+
await i() ? e.close() : a.loadingStatus = !1;
|
|
38
39
|
} catch (t) {
|
|
39
|
-
|
|
40
|
+
l(t, "Failed to save template"), a.loadingStatus = !1;
|
|
40
41
|
} finally {
|
|
41
42
|
o.value = !1;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
}, WpDrawer:
|
|
45
|
+
}, WpDrawer: v, InIcons: E };
|
|
45
46
|
}
|
|
46
47
|
});
|
|
47
48
|
export {
|
|
48
|
-
|
|
49
|
+
H as default
|
|
49
50
|
};
|