@useinsider/guido 3.19.0-beta.c8d2be8 → 3.19.0-beta.cd75ff0
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 +102 -87
- package/dist/components/Guido.vue.js +4 -4
- package/dist/components/Guido.vue2.js +83 -75
- package/dist/components/organisms/AutoSaveController.vue2.js +10 -8
- package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
- package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +83 -48
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +50 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/components/wrappers/WpModal.vue.js +1 -1
- package/dist/components/wrappers/WpModal.vue2.js +4 -3
- package/dist/composables/useActionsApi.js +52 -47
- package/dist/composables/useAuthError.js +52 -0
- package/dist/composables/useAutoSave.js +44 -42
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +2 -0
- package/dist/composables/useHttp.js +48 -49
- package/dist/composables/useLegacyStrategyConversion.js +23 -19
- package/dist/composables/useSave.js +92 -45
- package/dist/composables/useSaveValidation.js +284 -0
- package/dist/composables/useSaveValidationRollout.js +20 -0
- package/dist/composables/useStripo.js +24 -20
- package/dist/composables/useToaster.js +17 -15
- package/dist/composables/useTranslations.js +3 -2
- package/dist/composables/useVersionHistoryApi.js +33 -24
- package/dist/composables/validators/useCouponBlockValidator.js +24 -21
- package/dist/composables/validators/useLiquidValidator.js +15 -15
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
- package/dist/config/migrator/index.js +14 -13
- package/dist/config/migrator/recommendationPartnerMigrator.js +50 -0
- package/dist/enums/extensions/recommendationBlock.js +30 -29
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Recommendation/block.js +15 -14
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +45 -38
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
- package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
- package/dist/guido.css +1 -1
- package/dist/services/settingsApi.js +11 -0
- package/dist/src/@types/config/schemas.d.ts +20 -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/base/AuthErrorModal.vue.d.ts +2 -0
- 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/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
- package/dist/src/composables/useAuthError.d.ts +12 -0
- package/dist/src/composables/useAutoSave.d.ts +4 -1
- package/dist/src/composables/useConfig.d.ts +4 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useHttp.d.ts +2 -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 +4 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/config/migrator/index.d.ts +2 -1
- package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
- package/dist/src/services/settingsApi.d.ts +6 -0
- package/dist/src/stores/config.d.ts +52 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/stores/setup-settings.d.ts +4 -0
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
- package/dist/stores/config.js +84 -67
- package/dist/stores/save-validation.js +30 -0
- package/dist/stores/setup-settings.js +10 -0
- package/dist/stores/unsubscribe.js +3 -3
- package/dist/utils/stripoEditorApi.js +11 -0
- package/dist/utils/templatePreparation.js +39 -36
- package/package.json +2 -1
|
@@ -1,57 +1,61 @@
|
|
|
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 {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { defineComponent as ie, defineAsyncComponent as m, ref as W, computed as u, 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
|
+
import { migrate as V } from "../config/migrator/index.js";
|
|
11
|
+
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
12
|
+
import { RIBBON_SELECTOR as ve } from "../enums/onboarding.js";
|
|
12
13
|
import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
14
|
+
import be from "./organisms/AutoSaveController.vue.js";
|
|
15
|
+
import he from "./organisms/base/AuthErrorModal.vue.js";
|
|
16
|
+
import Ee from "./organisms/base/Toaster.vue.js";
|
|
17
|
+
import we from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
18
|
+
import De from "./organisms/header/HeaderWrapper.vue.js";
|
|
19
|
+
import Ce from "./organisms/LoadingWrapper.vue.js";
|
|
20
|
+
import ke from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
21
|
+
import Re from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
22
|
+
import Fe from "./organisms/validation/ValidationErrorDrawer.vue.js";
|
|
23
|
+
import { useStripoApi as Me } from "../services/stripoApi.js";
|
|
24
|
+
import { useConfigStore as Te } from "../stores/config.js";
|
|
25
|
+
import { useDynamicContentStore as Ie } from "../stores/dynamic-content.js";
|
|
23
26
|
import { useEditorStore as H } from "../stores/editor.js";
|
|
24
|
-
import { usePreviewStore as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
|
|
27
|
+
import { usePreviewStore as Le } from "../stores/preview.js";
|
|
28
|
+
import { useSaveValidationStore as Ue } from "../stores/save-validation.js";
|
|
29
|
+
import { useTemplateStore as Ae } from "../stores/template.js";
|
|
30
|
+
import { useUnsubscribeStore as Be } from "../stores/unsubscribe.js";
|
|
31
|
+
import { readTrackFloor as z } from "../utils/linkTrackingIds.js";
|
|
32
|
+
const ut = /* @__PURE__ */ ie({
|
|
29
33
|
__name: "Guido",
|
|
30
34
|
props: {
|
|
31
35
|
config: null,
|
|
32
36
|
ready: { type: Boolean, default: !0 }
|
|
33
37
|
},
|
|
34
38
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
39
|
+
setup(q, { expose: K, emit: r }) {
|
|
40
|
+
const s = q, j = m(
|
|
37
41
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
),
|
|
42
|
+
), J = m(
|
|
39
43
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
44
|
+
), Q = m(
|
|
41
45
|
() => import("./organisms/extensions/recommendation/AssignStrategyDrawer.vue.js")
|
|
42
|
-
),
|
|
46
|
+
), X = m(
|
|
43
47
|
() => import("./organisms/extensions/recommendation/RemoveStrategyModal.vue.js")
|
|
44
|
-
),
|
|
48
|
+
), Y = m(
|
|
45
49
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
46
|
-
), E =
|
|
47
|
-
|
|
48
|
-
const c = H(),
|
|
50
|
+
), E = W(), p = W(), f = Ie(), w = Be(), o = Te();
|
|
51
|
+
s.ready && o.init(s.config);
|
|
52
|
+
const c = H(), Z = Le(), l = u(() => c.hasChanges), { isTestPartner: ee } = fe(), { isEnabled: te, loadRollout: D } = ye(), C = () => {
|
|
49
53
|
var t;
|
|
50
54
|
return (t = E.value) == null ? void 0 : t.handleSave(!0);
|
|
51
|
-
},
|
|
55
|
+
}, k = (t) => {
|
|
52
56
|
c.loadingStatus = t;
|
|
53
57
|
};
|
|
54
|
-
|
|
58
|
+
me(), pe();
|
|
55
59
|
const y = () => {
|
|
56
60
|
var t, e;
|
|
57
61
|
return {
|
|
@@ -59,18 +63,18 @@ const tt = /* @__PURE__ */ re({
|
|
|
59
63
|
userId: o.userId,
|
|
60
64
|
username: o.username,
|
|
61
65
|
partnerName: o.partnerName,
|
|
62
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
63
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
66
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
67
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
64
68
|
};
|
|
65
|
-
}, { initPlugin:
|
|
69
|
+
}, { initPlugin: R, preloadRuntime: F } = ge(), { runExclusive: M, beginMount: T, isCurrentMount: I } = le();
|
|
66
70
|
let g = 0;
|
|
67
|
-
const { getDefaultTemplate:
|
|
71
|
+
const { getDefaultTemplate: L } = Me(), { cloneTimersOnSave: U, hasTimerBlocks: A } = Se(), oe = u(() => {
|
|
68
72
|
var t;
|
|
69
73
|
return !((t = o.ui) != null && t.showHeader);
|
|
70
|
-
}),
|
|
74
|
+
}), ne = u(() => o.isFeatureEnabled("reusableRecommendationStrategy")), re = u(
|
|
71
75
|
() => !!h().recommendationConfigs.strategyId
|
|
72
76
|
);
|
|
73
|
-
|
|
77
|
+
ue({
|
|
74
78
|
onBack: () => {
|
|
75
79
|
console.debug("guido:back"), r("back");
|
|
76
80
|
},
|
|
@@ -85,80 +89,84 @@ const tt = /* @__PURE__ */ re({
|
|
|
85
89
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
86
90
|
}
|
|
87
91
|
});
|
|
88
|
-
const
|
|
92
|
+
const B = (t) => {
|
|
89
93
|
console.debug("dynamic-content:close", t), f.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
90
|
-
},
|
|
94
|
+
}, N = () => {
|
|
91
95
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
92
96
|
};
|
|
93
|
-
|
|
97
|
+
G(() => l.value, () => {
|
|
94
98
|
r("on-change", l.value);
|
|
95
99
|
});
|
|
96
|
-
const
|
|
97
|
-
const e = t, { attribute:
|
|
98
|
-
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open",
|
|
100
|
+
const S = (t) => {
|
|
101
|
+
const e = t, { attribute: a, position: d } = e.detail;
|
|
102
|
+
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", a, d);
|
|
99
103
|
};
|
|
100
104
|
let i = null;
|
|
101
|
-
const
|
|
105
|
+
const v = () => {
|
|
102
106
|
var e;
|
|
103
|
-
const t = document.querySelector(
|
|
107
|
+
const t = document.querySelector(ve);
|
|
104
108
|
(e = p.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
105
109
|
}, b = async () => {
|
|
106
110
|
var t;
|
|
107
111
|
try {
|
|
108
|
-
o.initialized || o.init(
|
|
109
|
-
const e = o.template,
|
|
112
|
+
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) || "", P = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
110
114
|
w.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
111
|
-
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {},
|
|
115
|
+
const _ = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, O = o.isFeatureEnabled("linkTrackingIds"), x = {
|
|
116
|
+
partnerName: o.partnerName,
|
|
117
|
+
campaignUrls: e == null ? void 0 : e.recommendationCampaignUrls,
|
|
118
|
+
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
119
|
+
};
|
|
112
120
|
let n = {
|
|
113
|
-
html:
|
|
121
|
+
html: a && await V(a, _, x),
|
|
114
122
|
css: d
|
|
115
123
|
};
|
|
116
|
-
n.html || (n = await
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
const
|
|
124
|
+
n.html || (n = await L(), n.html = await V(n.html, _, x));
|
|
125
|
+
const ae = O ? z(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
126
|
+
A(n.html) && (n.html = await U(n.html)), O && (c.trackIdSessionFloor = Math.max(ae, z(n.html)));
|
|
127
|
+
const se = {
|
|
120
128
|
preselectedDynamicContentList: P,
|
|
121
129
|
onReady: () => {
|
|
122
130
|
console.debug("guido:ready"), r("ready");
|
|
123
131
|
}
|
|
124
132
|
};
|
|
125
|
-
g =
|
|
133
|
+
g = T(), await R(n, y(), se), f.selectedDynamicContentList = P;
|
|
126
134
|
} catch (e) {
|
|
127
135
|
console.error("Failed to initialize Stripo editor:", e);
|
|
128
136
|
}
|
|
129
137
|
};
|
|
130
|
-
return
|
|
138
|
+
return ce(async () => {
|
|
131
139
|
var e;
|
|
132
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(),
|
|
140
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), h().$reset(), H().$reset(), Ae().$reset(), Ue().$reset(), D(), v();
|
|
133
141
|
const t = (e = p.value) == null ? void 0 : e.parentElement;
|
|
134
|
-
if (t && (i = new ResizeObserver(
|
|
142
|
+
if (t && (i = new ResizeObserver(v), i.observe(t)), F(), s.ready)
|
|
135
143
|
await b();
|
|
136
144
|
else {
|
|
137
|
-
const
|
|
138
|
-
d && (
|
|
145
|
+
const a = G(() => s.ready, (d) => {
|
|
146
|
+
d && (a(), b());
|
|
139
147
|
});
|
|
140
148
|
}
|
|
141
|
-
document.addEventListener("dynamic-content:open",
|
|
142
|
-
}),
|
|
143
|
-
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open",
|
|
144
|
-
if (
|
|
149
|
+
document.addEventListener("dynamic-content:open", S);
|
|
150
|
+
}), de(() => {
|
|
151
|
+
i == null || i.disconnect(), document.removeEventListener("dynamic-content:open", S), h().disposeStrategyPageReturn(), M(async () => {
|
|
152
|
+
if (I(g))
|
|
145
153
|
try {
|
|
146
154
|
window.UIEditor.removeEditor();
|
|
147
155
|
} catch {
|
|
148
156
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
149
157
|
}
|
|
150
158
|
}), o.reset();
|
|
151
|
-
}),
|
|
159
|
+
}), K({
|
|
152
160
|
dynamicContent: {
|
|
153
|
-
insert:
|
|
154
|
-
close:
|
|
161
|
+
insert: B,
|
|
162
|
+
close: N
|
|
155
163
|
},
|
|
156
164
|
hasChanges: l,
|
|
157
165
|
saveSilent: C,
|
|
158
|
-
setLoading:
|
|
159
|
-
}), { __sfc: !0, PreviewContainer:
|
|
166
|
+
setLoading: k
|
|
167
|
+
}), { __sfc: !0, PreviewContainer: j, OnboardingWrapper: J, AssignStrategyDrawer: Q, RemoveStrategyModal: X, LegacyStrategyUpdatedModal: Y, headerWrapperRef: E, wrapperRef: p, dynamicContentStore: f, unsubscribeStore: w, props: s, configStore: o, editorStore: c, previewStore: Z, hasChanges: l, isTestPartner: ee, isSaveValidationEnabled: te, loadRollout: D, saveSilent: C, setLoading: k, emit: r, buildMetadata: y, initPlugin: R, preloadRuntime: F, runExclusive: M, beginMount: T, isCurrentMount: I, mountGeneration: g, getDefaultTemplate: L, cloneTimersOnSave: U, hasTimerBlocks: A, noHeader: oe, isRrsEnabled: ne, hasAssignedStrategy: re, insertDynamicContent: B, closeDynamicContent: N, handleDynamicContentOpen: S, ribbonObserver: i, updateRibbonOffset: v, startEditor: b, AutoSaveController: be, AuthErrorModal: he, Toaster: Ee, FilterSelectionDrawer: we, HeaderWrapper: De, LoadingWrapper: Ce, SaveAsTemplateDrawer: ke, UnsubscribeWrapper: Re, ValidationErrorDrawer: Fe };
|
|
160
168
|
}
|
|
161
169
|
});
|
|
162
170
|
export {
|
|
163
|
-
|
|
171
|
+
ut as default
|
|
164
172
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useAutoSave as
|
|
3
|
-
import { useSave as
|
|
4
|
-
|
|
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({
|
|
5
7
|
__name: "AutoSaveController",
|
|
6
|
-
setup(
|
|
7
|
-
const { save: e } =
|
|
8
|
-
return
|
|
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 };
|
|
9
11
|
}
|
|
10
12
|
});
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
d as default
|
|
13
15
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "./AuthErrorModal.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var a = function() {
|
|
5
|
+
var o = this, r = o._self._c, t = o._self._setupProxy;
|
|
6
|
+
return t.authError ? r("div", { staticClass: "auth-error-modal" }, [r(t.WpModal, { attrs: { id: "guido__auth-error-modal", state: "warning", "close-button-status": !1, "close-on-outside-click": !1, "footer-button-options": t.footerButtonOptions, title: t.title }, on: { close: t.dismiss, "primary-action": t.recover } }, [r("p", [o._v(o._s(t.message))])])], 1) : o._e();
|
|
7
|
+
}, n = [], i = /* @__PURE__ */ s(
|
|
8
|
+
e,
|
|
9
|
+
a,
|
|
10
|
+
n,
|
|
11
|
+
!1,
|
|
12
|
+
null,
|
|
13
|
+
"b4d7ae51"
|
|
14
|
+
);
|
|
15
|
+
const m = i.exports;
|
|
16
|
+
export {
|
|
17
|
+
m as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent as c, computed as n } from "vue";
|
|
2
|
+
import p from "../../wrappers/WpModal.vue.js";
|
|
3
|
+
import { useAuthError as d } from "../../../composables/useAuthError.js";
|
|
4
|
+
import { useTranslations as m } from "../../../composables/useTranslations.js";
|
|
5
|
+
const _ = /* @__PURE__ */ c({
|
|
6
|
+
__name: "AuthErrorModal",
|
|
7
|
+
setup(v) {
|
|
8
|
+
const e = m(), { authError: t } = d(), r = n(() => {
|
|
9
|
+
var o;
|
|
10
|
+
return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data !== null;
|
|
11
|
+
}), s = n(() => {
|
|
12
|
+
var o;
|
|
13
|
+
return ((o = t.value) == null ? void 0 : o.status) === 419 && t.value.data === null;
|
|
14
|
+
}), i = n(() => r.value ? e("integration-hub.reload-this-page") : e("action-builder.session-expired")), u = n(() => r.value ? e("auth.error-occurred-refresh") : s.value ? e("settings.session-on-another-device") : e("journey-builder.login-session-expired")), l = n(() => ({
|
|
15
|
+
primaryButton: {
|
|
16
|
+
type: "primary",
|
|
17
|
+
labelText: r.value ? e("integration-hub.reload") : e("journey-builder.login-popup-button")
|
|
18
|
+
},
|
|
19
|
+
cancelOrBackButton: {
|
|
20
|
+
type: "secondary",
|
|
21
|
+
styling: "ghost",
|
|
22
|
+
labelText: e("settings.cancel")
|
|
23
|
+
}
|
|
24
|
+
})), a = () => {
|
|
25
|
+
if (r.value) {
|
|
26
|
+
window.location.reload();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
window.location.replace("/");
|
|
30
|
+
};
|
|
31
|
+
return { __sfc: !0, trans: e, authError: t, isPageExpired: r, isTakenOver: s, title: i, message: u, footerButtonOptions: l, recover: a, dismiss: () => {
|
|
32
|
+
if (r.value) {
|
|
33
|
+
t.value = null;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
a();
|
|
37
|
+
}, WpModal: p };
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
_ as default
|
|
42
|
+
};
|
|
@@ -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
|
+
"baf7a5dd"
|
|
19
19
|
);
|
|
20
20
|
const v = c.exports;
|
|
21
21
|
export {
|
|
@@ -1,79 +1,114 @@
|
|
|
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 I, computed as u, ref as c } from "vue";
|
|
2
|
+
import { useActionsApi as P } from "../../../composables/useActionsApi.js";
|
|
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
|
+
import { useTranslations as X } from "../../../composables/useTranslations.js";
|
|
12
|
+
import { useVersionHistoryApi as Y } from "../../../composables/useVersionHistoryApi.js";
|
|
13
|
+
import { useLiquidValidator as Z } from "../../../composables/validators/useLiquidValidator.js";
|
|
14
|
+
import { ToasterTypeOptions as $ } from "../../../enums/toaster.js";
|
|
15
|
+
import { useEditorStore as tt } from "../../../stores/editor.js";
|
|
16
|
+
import { useSaveValidationStore as et } from "../../../stores/save-validation.js";
|
|
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({
|
|
19
23
|
__name: "EditorActions",
|
|
20
|
-
setup(
|
|
21
|
-
const { config:
|
|
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 = () => {
|
|
22
26
|
if (e.isVersionHistoryOpen) {
|
|
23
|
-
|
|
27
|
+
T();
|
|
24
28
|
return;
|
|
25
29
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
+
h();
|
|
31
|
+
}, B = async () => {
|
|
32
|
+
a.value = !0, await d(), a.value = !1;
|
|
33
|
+
}, L = () => {
|
|
30
34
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
31
|
-
},
|
|
35
|
+
}, R = u(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), D = u(
|
|
32
36
|
() => {
|
|
33
37
|
var t, o;
|
|
34
|
-
return ((o = (t =
|
|
38
|
+
return ((o = (t = p.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
35
39
|
}
|
|
36
|
-
),
|
|
37
|
-
|
|
40
|
+
), A = async (t) => {
|
|
41
|
+
n.value = !0, t || (e.loadingStatus = !0);
|
|
38
42
|
let o;
|
|
39
43
|
try {
|
|
40
|
-
o = await
|
|
41
|
-
} catch (
|
|
42
|
-
|
|
43
|
-
throw n;
|
|
44
|
-
r(n, "Failed to save template");
|
|
44
|
+
o = await v(t);
|
|
45
|
+
} catch (M) {
|
|
46
|
+
i(M, "Failed to save template");
|
|
45
47
|
} finally {
|
|
46
|
-
|
|
48
|
+
n.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
47
49
|
}
|
|
48
50
|
return o;
|
|
49
|
-
},
|
|
51
|
+
}, O = (t) => {
|
|
50
52
|
var o;
|
|
51
|
-
if (!t &&
|
|
52
|
-
(o =
|
|
53
|
+
if (!t && C.value) {
|
|
54
|
+
(o = _.value) == null || o.open();
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
|
-
return
|
|
57
|
+
return A(t);
|
|
58
|
+
}, m = async () => {
|
|
59
|
+
e.loadingStatus = !0;
|
|
60
|
+
try {
|
|
61
|
+
return await y();
|
|
62
|
+
} catch (t) {
|
|
63
|
+
return i(t, "Failed to prepare test email"), null;
|
|
64
|
+
} finally {
|
|
65
|
+
e.loadingStatus = !1;
|
|
66
|
+
}
|
|
56
67
|
}, F = async () => {
|
|
57
|
-
|
|
68
|
+
const t = await m();
|
|
69
|
+
t != null && t.length ? w.open(t, "test") : t && g();
|
|
70
|
+
}, z = async () => {
|
|
71
|
+
if (s.value) {
|
|
72
|
+
const t = await m();
|
|
73
|
+
if (!t)
|
|
74
|
+
return;
|
|
75
|
+
if (t.length) {
|
|
76
|
+
S({
|
|
77
|
+
type: $.Error,
|
|
78
|
+
message: r("email-editor.validation-errors-found"),
|
|
79
|
+
actionButton: {
|
|
80
|
+
text: r("email-editor.check-errors"),
|
|
81
|
+
onClick: () => {
|
|
82
|
+
F();
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
autoHide: !1
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
l();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (f("liquidSyntax")) {
|
|
58
93
|
e.loadingStatus = !0;
|
|
59
94
|
try {
|
|
60
|
-
const { html: t } = await
|
|
61
|
-
if (!await
|
|
95
|
+
const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = E(t);
|
|
96
|
+
if (!await H(o))
|
|
62
97
|
return;
|
|
63
98
|
} catch (t) {
|
|
64
|
-
|
|
99
|
+
i(t, "Failed to prepare test email");
|
|
65
100
|
return;
|
|
66
101
|
} finally {
|
|
67
102
|
e.loadingStatus = !1;
|
|
68
103
|
}
|
|
69
104
|
}
|
|
70
|
-
|
|
105
|
+
l();
|
|
71
106
|
};
|
|
72
|
-
return
|
|
73
|
-
handleSave:
|
|
74
|
-
}), { __sfc: !0, config:
|
|
107
|
+
return b({
|
|
108
|
+
handleSave: O
|
|
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 };
|
|
75
110
|
}
|
|
76
111
|
});
|
|
77
112
|
export {
|
|
78
|
-
|
|
113
|
+
Ot as default
|
|
79
114
|
};
|
|
@@ -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
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import a from "./ValidationErrorDrawer.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import s from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var i = function() {
|
|
5
|
+
var o = this, r = o._self._c, t = o._self._setupProxy;
|
|
6
|
+
return r(t.WpDrawer, { attrs: { id: "guido__validation-error-drawer", size: "small", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.isDrawerOpen, "title-text": t.titleText }, on: { onCloseEvent: t.handleClose, primaryButtonEvent: t.handleClose, secondaryButtonEvent: t.handleSaveAndContinue } }, [r("div", { staticClass: "d-f f-d-c validation-error-list" }, o._l(t.rows, function(e, n) {
|
|
7
|
+
return r("div", { key: n, staticClass: "d-f a-i-c validation-error-row" }, [r(t.InIcons, { staticClass: "validation-error-row__icon i-c-12", attrs: { name: "filled-caution-triangle" } }), r("span", { staticClass: "validation-error-row__text", domProps: { innerHTML: o._s(e) } })], 1);
|
|
8
|
+
}), 0)]);
|
|
9
|
+
}, l = [], d = /* @__PURE__ */ s(
|
|
10
|
+
a,
|
|
11
|
+
i,
|
|
12
|
+
l,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
"e48cebe9"
|
|
16
|
+
);
|
|
17
|
+
const f = d.exports;
|
|
18
|
+
export {
|
|
19
|
+
f as default
|
|
20
|
+
};
|