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