@useinsider/guido 3.17.0-beta.edf4165 → 3.17.0-beta.f7536b7
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 +0 -1
- package/dist/@types/config/schemas.js +6 -7
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +83 -83
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +50 -39
- package/dist/composables/useActionsApi.js +82 -67
- package/dist/composables/useAutoSave.js +31 -26
- package/dist/composables/useCustomInterfaceAppearance.js +38 -52
- package/dist/composables/useEditorLock.js +20 -0
- package/dist/composables/useGuidoStateBridge.js +37 -31
- package/dist/composables/useRecommendation.js +34 -41
- package/dist/composables/useSave.js +39 -36
- package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
- package/dist/config/migrator/recommendationMigrator.js +4 -5
- package/dist/enums/academy.js +1 -2
- package/dist/enums/date.js +3 -5
- package/dist/enums/extensions/recommendationBlock.js +1 -3
- package/dist/extensions/Blocks/Recommendation/block.js +21 -26
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +34 -34
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +95 -96
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +166 -162
- package/dist/extensions/Blocks/Recommendation/services/configService.js +35 -35
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +79 -165
- package/dist/extensions/Blocks/common-control.js +19 -22
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +30 -69
- package/dist/src/@types/config/schemas.d.ts +0 -2
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useEditorLock.d.ts +10 -0
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/enums/academy.d.ts +0 -1
- package/dist/src/enums/date.d.ts +0 -1
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +6 -2
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +4 -10
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -150
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -1
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -4
- package/dist/src/services/recommendationApi.d.ts +1 -4
- package/dist/src/stores/config.d.ts +0 -18
- package/dist/src/stores/save-as-template.d.ts +3 -4
- package/dist/src/utils/genericUtil.d.ts +0 -5
- package/dist/utils/dateUtil.js +10 -23
- package/dist/utils/genericUtil.js +27 -28
- package/dist/utils/templatePreparation.js +34 -35
- package/package.json +1 -2
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -21
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -106
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +0 -19
- package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +0 -63
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -124
- package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
- package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -16
- package/dist/src/mock/api/recommendation-strategies.d.ts +0 -2
- package/dist/static/assets/icons/line-change.svg.js +0 -5
- package/dist/static/assets/icons/line-delete.svg.js +0 -5
- package/dist/static/assets/icons/line-plus.svg.js +0 -5
- package/dist/static/styles/components/recommendation-strategy.css.js +0 -155
package/README.md
CHANGED
|
@@ -162,7 +162,6 @@ const config: GuidoConfigInput = {
|
|
|
162
162
|
liquidSyntax?: boolean, // Default: false - Enable Liquid template syntax
|
|
163
163
|
autosave?: boolean, // Default: false - Show the Auto Save toggle in the header. See wiki/AUTOSAVE.md.
|
|
164
164
|
allowlistEnabled?: boolean, // Default: false - Pre-save domain-allowlist check (opt-in). Guido self-serves the block toaster (role lookup, deep-link, copy from window.trans).
|
|
165
|
-
reusableRecommendationStrategy?: boolean, // Default: false - Assign an RRS strategy to recommendation blocks instead of per-block algorithm/filters/shuffle/product-count settings.
|
|
166
165
|
},
|
|
167
166
|
|
|
168
167
|
// Optional: Callbacks
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as f } from "../../enums/defaults.js";
|
|
2
|
-
import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as
|
|
2
|
+
import { object as a, number as n, optional as e, string as t, picklist as i, pipe as m, minLength as b, custom as k, boolean as o, array as c, transform as C, record as y, fallback as R, literal as u, looseObject as g, variant as T, union as h, unknown as r, lazy as I } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const p = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -76,7 +76,7 @@ const p = {
|
|
|
76
76
|
children: e(c(S)),
|
|
77
77
|
// eslint-disable-next-line camelcase -- backend field name
|
|
78
78
|
select_items: e(c(S))
|
|
79
|
-
})), N =
|
|
79
|
+
})), N = y(
|
|
80
80
|
t(),
|
|
81
81
|
R(c(S), [])
|
|
82
82
|
), P = g({
|
|
@@ -132,7 +132,7 @@ const p = {
|
|
|
132
132
|
* strategy, currency, locale, and layout data.
|
|
133
133
|
*/
|
|
134
134
|
recommendationConfigs: e(
|
|
135
|
-
|
|
135
|
+
y(t(), P),
|
|
136
136
|
{}
|
|
137
137
|
)
|
|
138
138
|
}), x = a({
|
|
@@ -219,8 +219,7 @@ const p = {
|
|
|
219
219
|
/** Enable pre-save domain-allowlist validation (opt-in; Guido self-serves the block toaster) */
|
|
220
220
|
allowlistEnabled: e(o(), !1),
|
|
221
221
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
222
|
-
linkTrackingIds: e(o(), !1)
|
|
223
|
-
reusableRecommendationStrategy: e(o(), !1)
|
|
222
|
+
linkTrackingIds: e(o(), !1)
|
|
224
223
|
}), B = i([
|
|
225
224
|
"amp-accordion",
|
|
226
225
|
"amp-carousel",
|
|
@@ -288,7 +287,7 @@ const p = {
|
|
|
288
287
|
...d.entries,
|
|
289
288
|
type: u("custom"),
|
|
290
289
|
/** Custom processor function */
|
|
291
|
-
processor:
|
|
290
|
+
processor: k(
|
|
292
291
|
(s) => typeof s == "function",
|
|
293
292
|
"processor must be a function"
|
|
294
293
|
)
|
|
@@ -308,7 +307,7 @@ const p = {
|
|
|
308
307
|
* Return false to cancel the save operation.
|
|
309
308
|
*/
|
|
310
309
|
externalValidation: e(
|
|
311
|
-
|
|
310
|
+
k(
|
|
312
311
|
(s) => typeof s == "function",
|
|
313
312
|
"externalValidation must be a function"
|
|
314
313
|
)
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import i from "./Guido.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import a from "../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var t = function() {
|
|
5
5
|
var o = this, r = o._self._c, e = o._self._setupProxy;
|
|
6
|
-
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer),
|
|
6
|
+
return r("div", { ref: "wrapperRef", staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": e.noHeader } }, [r(e.HeaderWrapper, { ref: "headerWrapperRef" }), r(e.AutoSaveController), e.editorStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isLoaded, expression: "!previewStore.isLoaded" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": e.noHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.FilterSelectionDrawer), r(e.SaveAsTemplateDrawer), e.isTestPartner() ? o._e() : r(e.OnboardingWrapper, { on: { "onboarding-finished": function(p) {
|
|
7
7
|
return e.emit("onboarding:finished");
|
|
8
8
|
} } }), r(e.UnsubscribeWrapper), r(e.LoadingWrapper)], 1);
|
|
9
|
-
},
|
|
10
|
-
|
|
9
|
+
}, n = [], s = /* @__PURE__ */ a(
|
|
10
|
+
i,
|
|
11
11
|
t,
|
|
12
|
-
|
|
12
|
+
n,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"1f2703e5"
|
|
16
16
|
);
|
|
17
|
-
const l =
|
|
17
|
+
const l = s.exports;
|
|
18
18
|
export {
|
|
19
19
|
l as default
|
|
20
20
|
};
|
|
@@ -1,69 +1,68 @@
|
|
|
1
|
-
import { defineComponent as Y, defineAsyncComponent as
|
|
1
|
+
import { defineComponent as Y, defineAsyncComponent as N, ref as O, computed as P, watch as x, onMounted as Z, onUnmounted as ee } from "vue";
|
|
2
2
|
import { useCortexBlueprintBridge as te } from "../composables/useCortexBlueprintBridge.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { useEditorLock as oe } from "../composables/useEditorLock.js";
|
|
4
|
+
import { provideGuidoActions as ne } from "../composables/useGuidoActions.js";
|
|
5
|
+
import { useGuidoStateBridge as re } from "../composables/useGuidoStateBridge.js";
|
|
6
|
+
import { usePartner as se } from "../composables/usePartner.js";
|
|
7
|
+
import { useStripo as ie } from "../composables/useStripo.js";
|
|
7
8
|
import { useTimerClone as ae } from "../composables/useTimerClone.js";
|
|
8
|
-
import { migrate as
|
|
9
|
-
import { ModuleFolderDefaults as
|
|
10
|
-
import { RIBBON_SELECTOR as
|
|
11
|
-
import { useRecommendationExtensionStore as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useStripoApi as
|
|
20
|
-
import { useConfigStore as
|
|
21
|
-
import { useDynamicContentStore as
|
|
22
|
-
import { useEditorStore as
|
|
23
|
-
import { usePreviewStore as
|
|
24
|
-
import { useTemplateStore as
|
|
25
|
-
import { useUnsubscribeStore as
|
|
26
|
-
import { readTrackFloor as
|
|
27
|
-
const
|
|
9
|
+
import { migrate as A } from "../config/migrator/index.js";
|
|
10
|
+
import { ModuleFolderDefaults as W } from "../enums/defaults.js";
|
|
11
|
+
import { RIBBON_SELECTOR as ce } from "../enums/onboarding.js";
|
|
12
|
+
import { useRecommendationExtensionStore as de } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
13
|
+
import me from "./organisms/AutoSaveController.vue.js";
|
|
14
|
+
import le from "./organisms/base/Toaster.vue.js";
|
|
15
|
+
import ue from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
16
|
+
import pe from "./organisms/header/HeaderWrapper.vue.js";
|
|
17
|
+
import fe from "./organisms/LoadingWrapper.vue.js";
|
|
18
|
+
import ve from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
|
|
19
|
+
import ye from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
|
|
20
|
+
import { useStripoApi as ge } from "../services/stripoApi.js";
|
|
21
|
+
import { useConfigStore as he } from "../stores/config.js";
|
|
22
|
+
import { useDynamicContentStore as Se } from "../stores/dynamic-content.js";
|
|
23
|
+
import { useEditorStore as G } from "../stores/editor.js";
|
|
24
|
+
import { usePreviewStore as be } from "../stores/preview.js";
|
|
25
|
+
import { useTemplateStore as Ee } from "../stores/template.js";
|
|
26
|
+
import { useUnsubscribeStore as we } from "../stores/unsubscribe.js";
|
|
27
|
+
import { readTrackFloor as H } from "../utils/linkTrackingIds.js";
|
|
28
|
+
const Qe = /* @__PURE__ */ Y({
|
|
28
29
|
__name: "Guido",
|
|
29
30
|
props: {
|
|
30
31
|
config: null,
|
|
31
32
|
ready: { type: Boolean, default: !0 }
|
|
32
33
|
},
|
|
33
34
|
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
34
|
-
setup(
|
|
35
|
-
const
|
|
35
|
+
setup($, { expose: z, emit: r }) {
|
|
36
|
+
const i = $, q = N(
|
|
36
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
37
|
-
),
|
|
38
|
+
), K = N(
|
|
38
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
39
|
-
),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
a.ready && o.init(a.config);
|
|
43
|
-
const c = P(), q = Se(), m = l(() => c.hasChanges), { isTestPartner: K } = re(), E = () => {
|
|
40
|
+
), h = O(), l = O(), u = Se(), S = we(), o = he();
|
|
41
|
+
i.ready && o.init(i.config);
|
|
42
|
+
const c = G(), V = be(), m = P(() => c.hasChanges), { isTestPartner: j } = se(), b = () => {
|
|
44
43
|
var t;
|
|
45
44
|
return (t = h.value) == null ? void 0 : t.handleSave(!0);
|
|
46
|
-
},
|
|
45
|
+
}, E = (t) => {
|
|
47
46
|
c.loadingStatus = t;
|
|
48
47
|
};
|
|
49
|
-
te(),
|
|
50
|
-
const
|
|
48
|
+
te(), re();
|
|
49
|
+
const p = () => {
|
|
51
50
|
var t, e;
|
|
52
51
|
return {
|
|
53
52
|
emailId: o.templateId,
|
|
54
53
|
userId: o.userId,
|
|
55
54
|
username: o.username,
|
|
56
55
|
partnerName: o.partnerName,
|
|
57
|
-
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) ||
|
|
58
|
-
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) ||
|
|
56
|
+
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || W.SAVED_MODULES,
|
|
57
|
+
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || W.DEFAULT_MODULES
|
|
59
58
|
};
|
|
60
|
-
}, { initPlugin:
|
|
59
|
+
}, { initPlugin: w, preloadRuntime: C } = ie(), { runExclusive: k, beginMount: D, isCurrentMount: T } = oe();
|
|
60
|
+
let f = 0;
|
|
61
|
+
const { getDefaultTemplate: F } = ge(), { cloneTimersOnSave: I, hasTimerBlocks: L } = ae(), J = P(() => {
|
|
61
62
|
var t;
|
|
62
63
|
return !((t = o.ui) != null && t.showHeader);
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
);
|
|
66
|
-
oe({
|
|
64
|
+
});
|
|
65
|
+
ne({
|
|
67
66
|
onBack: () => {
|
|
68
67
|
console.debug("guido:back"), r("back");
|
|
69
68
|
},
|
|
@@ -71,86 +70,87 @@ const Ve = /* @__PURE__ */ Y({
|
|
|
71
70
|
console.debug("guido:save:start"), r("save:start");
|
|
72
71
|
},
|
|
73
72
|
onSaveComplete: (t) => {
|
|
74
|
-
const e = { ...t, metadata:
|
|
73
|
+
const e = { ...t, metadata: p() };
|
|
75
74
|
console.debug("guido:save:complete", e), r("save:complete", e);
|
|
76
75
|
},
|
|
77
76
|
onTestEmailClick: () => {
|
|
78
77
|
console.debug("guido:test-email:click"), r("test-email:click");
|
|
79
78
|
}
|
|
80
79
|
});
|
|
81
|
-
const
|
|
82
|
-
console.debug("dynamic-content:close", t),
|
|
80
|
+
const M = (t) => {
|
|
81
|
+
console.debug("dynamic-content:close", t), u.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
83
82
|
}, R = () => {
|
|
84
83
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
85
84
|
};
|
|
86
|
-
|
|
85
|
+
x(() => m.value, () => {
|
|
87
86
|
r("on-change", m.value);
|
|
88
87
|
});
|
|
89
|
-
const
|
|
88
|
+
const v = (t) => {
|
|
90
89
|
const e = t, { attribute: s, position: d } = e.detail;
|
|
91
90
|
console.debug("dynamic-content:open", e.detail), r("dynamic-content:open", s, d);
|
|
92
91
|
};
|
|
93
|
-
let
|
|
94
|
-
const
|
|
92
|
+
let a = null;
|
|
93
|
+
const y = () => {
|
|
95
94
|
var e;
|
|
96
|
-
const t = document.querySelector(
|
|
97
|
-
(e =
|
|
98
|
-
},
|
|
95
|
+
const t = document.querySelector(ce);
|
|
96
|
+
(e = l.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
97
|
+
}, g = async () => {
|
|
99
98
|
var t;
|
|
100
99
|
try {
|
|
101
|
-
o.initialized || o.init(
|
|
102
|
-
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "",
|
|
103
|
-
|
|
104
|
-
const
|
|
100
|
+
o.initialized || o.init(i.config), c.templateId = o.templateId;
|
|
101
|
+
const e = o.template, s = (e == null ? void 0 : e.html) || "", d = (e == null ? void 0 : e.css) || "", B = (e == null ? void 0 : e.preselectedDynamicContent) || [];
|
|
102
|
+
S.selectedUnsubscribePages = (e == null ? void 0 : e.selectedUnsubscribePages) || [];
|
|
103
|
+
const U = ((t = e == null ? void 0 : e.migration) == null ? void 0 : t.recommendationConfigs) ?? {}, _ = o.isFeatureEnabled("linkTrackingIds");
|
|
105
104
|
let n = {
|
|
106
|
-
html: s && await
|
|
105
|
+
html: s && await A(s, U),
|
|
107
106
|
css: d
|
|
108
107
|
};
|
|
109
|
-
n.html || (n = await
|
|
110
|
-
const Q =
|
|
111
|
-
|
|
108
|
+
n.html || (n = await F(), n.html = await A(n.html, U));
|
|
109
|
+
const Q = _ ? H(n.html, (e == null ? void 0 : e.trackIdCounter) || 0) : 0;
|
|
110
|
+
L(n.html) && (n.html = await I(n.html)), _ && (c.trackIdSessionFloor = Math.max(Q, H(n.html)));
|
|
112
111
|
const X = {
|
|
113
|
-
preselectedDynamicContentList:
|
|
112
|
+
preselectedDynamicContentList: B,
|
|
114
113
|
onReady: () => {
|
|
115
114
|
console.debug("guido:ready"), r("ready");
|
|
116
115
|
}
|
|
117
116
|
};
|
|
118
|
-
await
|
|
117
|
+
f = D(), await w(n, p(), X), u.selectedDynamicContentList = B;
|
|
119
118
|
} catch (e) {
|
|
120
119
|
console.error("Failed to initialize Stripo editor:", e);
|
|
121
120
|
}
|
|
122
121
|
};
|
|
123
122
|
return Z(async () => {
|
|
124
123
|
var e;
|
|
125
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"),
|
|
126
|
-
const t = (e =
|
|
127
|
-
if (t && (
|
|
128
|
-
await
|
|
124
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), de().$reset(), G().$reset(), Ee().$reset(), y();
|
|
125
|
+
const t = (e = l.value) == null ? void 0 : e.parentElement;
|
|
126
|
+
if (t && (a = new ResizeObserver(y), a.observe(t)), C(), i.ready)
|
|
127
|
+
await g();
|
|
129
128
|
else {
|
|
130
|
-
const s =
|
|
131
|
-
d && (s(),
|
|
129
|
+
const s = x(() => i.ready, (d) => {
|
|
130
|
+
d && (s(), g());
|
|
132
131
|
});
|
|
133
132
|
}
|
|
134
|
-
document.addEventListener("dynamic-content:open",
|
|
133
|
+
document.addEventListener("dynamic-content:open", v);
|
|
135
134
|
}), ee(() => {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
135
|
+
a == null || a.disconnect(), document.removeEventListener("dynamic-content:open", v), k(async () => {
|
|
136
|
+
if (T(f))
|
|
137
|
+
try {
|
|
138
|
+
window.UIEditor.removeEditor();
|
|
139
|
+
} catch {
|
|
140
|
+
console.debug("Failed to remove Stripo editor: No editor found");
|
|
141
|
+
}
|
|
142
|
+
}), o.reset();
|
|
143
|
+
}), z({
|
|
144
144
|
dynamicContent: {
|
|
145
|
-
insert:
|
|
145
|
+
insert: M,
|
|
146
146
|
close: R
|
|
147
147
|
},
|
|
148
148
|
hasChanges: m,
|
|
149
|
-
saveSilent:
|
|
150
|
-
setLoading:
|
|
151
|
-
}), { __sfc: !0, PreviewContainer:
|
|
149
|
+
saveSilent: b,
|
|
150
|
+
setLoading: E
|
|
151
|
+
}), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: h, wrapperRef: l, dynamicContentStore: u, unsubscribeStore: S, props: i, configStore: o, editorStore: c, previewStore: V, hasChanges: m, isTestPartner: j, saveSilent: b, setLoading: E, emit: r, buildMetadata: p, initPlugin: w, preloadRuntime: C, runExclusive: k, beginMount: D, isCurrentMount: T, mountGeneration: f, getDefaultTemplate: F, cloneTimersOnSave: I, hasTimerBlocks: L, noHeader: J, insertDynamicContent: M, closeDynamicContent: R, handleDynamicContentOpen: v, ribbonObserver: a, updateRibbonOffset: y, startEditor: g, AutoSaveController: me, Toaster: le, FilterSelectionDrawer: ue, HeaderWrapper: pe, LoadingWrapper: fe, SaveAsTemplateDrawer: ve, UnsubscribeWrapper: ye };
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
export {
|
|
155
|
-
|
|
155
|
+
Qe as default
|
|
156
156
|
};
|
|
@@ -9,15 +9,15 @@ var u = function() {
|
|
|
9
9
|
} } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
|
|
10
10
|
return t.executeSave(!1);
|
|
11
11
|
} } })], 1);
|
|
12
|
-
},
|
|
12
|
+
}, c = [], p = /* @__PURE__ */ d(
|
|
13
13
|
l,
|
|
14
14
|
u,
|
|
15
|
-
|
|
15
|
+
c,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"c61cc8ea"
|
|
19
19
|
);
|
|
20
|
-
const v =
|
|
20
|
+
const v = p.exports;
|
|
21
21
|
export {
|
|
22
22
|
v as default
|
|
23
23
|
};
|
|
@@ -1,66 +1,77 @@
|
|
|
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
|
-
|
|
1
|
+
import { defineComponent as q, ref as n, computed as x } from "vue";
|
|
2
|
+
import { useActionsApi as b } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as k } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as B } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as D } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as L } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as R } from "../../../composables/useSave.js";
|
|
8
|
+
import { useToaster as z } from "../../../composables/useToaster.js";
|
|
9
|
+
import { useTranslations as I } from "../../../composables/useTranslations.js";
|
|
10
|
+
import { useVersionHistoryApi as P } from "../../../composables/useVersionHistoryApi.js";
|
|
11
|
+
import { useLiquidValidator as j } from "../../../composables/validators/useLiquidValidator.js";
|
|
12
|
+
import { useEditorStore as G } from "../../../stores/editor.js";
|
|
13
|
+
import { useTemplateStore as J } from "../../../stores/template.js";
|
|
14
|
+
import { getTooltipOptions as K } from "../../../utils/tooltipUtils.js";
|
|
15
|
+
import { InButtonV2 as N } from "@useinsider/design-system-vue";
|
|
16
|
+
import { storeToRefs as Q } from "pinia";
|
|
17
|
+
import U from "./MigrationConfirmModal.vue.js";
|
|
18
|
+
const ft = /* @__PURE__ */ q({
|
|
18
19
|
__name: "EditorActions",
|
|
19
|
-
setup(
|
|
20
|
-
const { config:
|
|
20
|
+
setup(W, { expose: w }) {
|
|
21
|
+
const { config: l, isFeatureEnabled: m } = k(), { exportHtml: c } = B(), { save: p } = R(), { openVersionHistory: u, closeVersionHistory: f } = P(), { getCompiledEmail: d } = b(), { compileHtml: v } = L(), { validateLiquidSyntax: y } = j(), { handleError: r } = z(), e = G(), g = J(), { hasMigrations: S } = Q(g), s = I(), i = n(!1), a = n(!1), H = n(), h = D(), _ = () => {
|
|
21
22
|
if (e.isVersionHistoryOpen) {
|
|
22
|
-
|
|
23
|
+
f();
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
i.value = !0, await
|
|
28
|
-
},
|
|
26
|
+
u();
|
|
27
|
+
}, C = async () => {
|
|
28
|
+
i.value = !0, await c(), i.value = !1;
|
|
29
|
+
}, A = () => {
|
|
29
30
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
30
|
-
},
|
|
31
|
+
}, M = x(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = x(
|
|
31
32
|
() => {
|
|
32
33
|
var t, o;
|
|
33
|
-
return ((o = (t =
|
|
34
|
+
return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
34
35
|
}
|
|
35
36
|
), V = async (t) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
a.value = !0, t || (e.loadingStatus = !0);
|
|
38
|
+
let o;
|
|
39
|
+
try {
|
|
40
|
+
o = await p(t);
|
|
41
|
+
} catch (T) {
|
|
42
|
+
r(T, "Failed to save template");
|
|
43
|
+
} finally {
|
|
44
|
+
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
45
|
+
}
|
|
46
|
+
return o;
|
|
39
47
|
}, E = (t) => {
|
|
40
48
|
var o;
|
|
41
|
-
if (!t &&
|
|
42
|
-
(o =
|
|
49
|
+
if (!t && S.value) {
|
|
50
|
+
(o = H.value) == null || o.open();
|
|
43
51
|
return;
|
|
44
52
|
}
|
|
45
53
|
return V(t);
|
|
46
|
-
},
|
|
47
|
-
if (
|
|
54
|
+
}, F = async () => {
|
|
55
|
+
if (m("liquidSyntax")) {
|
|
48
56
|
e.loadingStatus = !0;
|
|
49
57
|
try {
|
|
50
|
-
const { html: t } = await
|
|
51
|
-
if (!await
|
|
58
|
+
const { html: t } = await d({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = v(t);
|
|
59
|
+
if (!await y(o))
|
|
52
60
|
return;
|
|
61
|
+
} catch (t) {
|
|
62
|
+
r(t, "Failed to prepare test email");
|
|
63
|
+
return;
|
|
53
64
|
} finally {
|
|
54
65
|
e.loadingStatus = !1;
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
|
-
|
|
68
|
+
h();
|
|
58
69
|
};
|
|
59
|
-
return
|
|
70
|
+
return w({
|
|
60
71
|
handleSave: E
|
|
61
|
-
}), { __sfc: !0, config:
|
|
72
|
+
}), { __sfc: !0, config: l, isFeatureEnabled: m, exportHtml: c, save: p, openVersionHistory: u, closeVersionHistory: f, getCompiledEmail: d, compileHtml: v, validateLiquidSyntax: y, handleError: r, editorStore: e, templateStore: g, hasMigrations: S, trans: s, isExporting: i, isSaving: a, migrationModalRef: H, testEmailClick: h, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: V, handleSave: E, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
62
73
|
}
|
|
63
74
|
});
|
|
64
75
|
export {
|
|
65
|
-
|
|
76
|
+
ft as default
|
|
66
77
|
};
|