@useinsider/guido 3.19.0-beta.3906ea8 → 3.19.0-beta.3abc7c5
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 +33 -31
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +50 -48
- package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +85 -57
- 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 +48 -0
- package/dist/components/wrappers/WpDrawer.vue.js +9 -7
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useActionsApi.js +52 -47
- package/dist/composables/useCodeEditorApi.js +23 -9
- package/dist/composables/useHtmlCompiler.js +37 -26
- package/dist/composables/useHtmlValidator.js +2 -0
- package/dist/composables/useSave.js +90 -45
- package/dist/composables/useSaveValidation.js +279 -0
- package/dist/composables/useSaveValidationRollout.js +9 -0
- 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/useUnsubscribeBlockValidator.js +34 -27
- package/dist/enums/save-validation.js +4 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +54 -47
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/@types/save-validation.d.ts +19 -0
- package/dist/src/components/Guido.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +2 -0
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +21 -0
- package/dist/src/composables/useSave.d.ts +6 -1
- package/dist/src/composables/useSaveValidation.d.ts +6 -0
- package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
- package/dist/src/enums/save-validation.d.ts +27 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +5 -0
- package/dist/src/stores/config.d.ts +32 -0
- package/dist/src/stores/save-validation.d.ts +22 -0
- package/dist/src/utils/stripoEditorApi.d.ts +4 -0
- package/dist/src/utils/templatePreparation.d.ts +30 -0
- package/dist/stores/config.js +84 -67
- package/dist/stores/save-validation.js +30 -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 +3 -2
|
@@ -1,79 +1,107 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useActionsApi as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useExport as
|
|
5
|
-
import { useTestEmailClick as
|
|
6
|
-
import { useHtmlCompiler as
|
|
7
|
-
import { useSave as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
1
|
+
import { defineComponent as D, computed as m, ref as u } from "vue";
|
|
2
|
+
import { useActionsApi as z } from "../../../composables/useActionsApi.js";
|
|
3
|
+
import { useConfig as I } from "../../../composables/useConfig.js";
|
|
4
|
+
import { useExport as P } from "../../../composables/useExport.js";
|
|
5
|
+
import { useTestEmailClick as W } from "../../../composables/useGuidoActions.js";
|
|
6
|
+
import { useHtmlCompiler as j } from "../../../composables/useHtmlCompiler.js";
|
|
7
|
+
import { useSave as G } from "../../../composables/useSave.js";
|
|
8
|
+
import { useSaveValidation as J } from "../../../composables/useSaveValidation.js";
|
|
9
|
+
import { useSaveValidationRollout as K } from "../../../composables/useSaveValidationRollout.js";
|
|
10
|
+
import { useToaster as N } from "../../../composables/useToaster.js";
|
|
11
|
+
import { useTranslations as Q } from "../../../composables/useTranslations.js";
|
|
12
|
+
import { useVersionHistoryApi as U } from "../../../composables/useVersionHistoryApi.js";
|
|
13
|
+
import { useLiquidValidator as X } from "../../../composables/validators/useLiquidValidator.js";
|
|
14
|
+
import { ToasterTypeOptions as Y } from "../../../enums/toaster.js";
|
|
15
|
+
import { useConfigStore as Z } from "../../../stores/config.js";
|
|
16
|
+
import { useEditorStore as $ } from "../../../stores/editor.js";
|
|
17
|
+
import { useSaveValidationStore as tt } from "../../../stores/save-validation.js";
|
|
18
|
+
import { useTemplateStore as et } from "../../../stores/template.js";
|
|
19
|
+
import { getTooltipOptions as ot } from "../../../utils/tooltipUtils.js";
|
|
20
|
+
import { InButtonV2 as rt } from "@useinsider/design-system-vue";
|
|
21
|
+
import { storeToRefs as it } from "pinia";
|
|
22
|
+
import at from "./MigrationConfirmModal.vue.js";
|
|
23
|
+
const Ot = /* @__PURE__ */ D({
|
|
19
24
|
__name: "EditorActions",
|
|
20
|
-
setup(
|
|
21
|
-
const { config:
|
|
22
|
-
if (
|
|
23
|
-
|
|
25
|
+
setup(st, { expose: M }) {
|
|
26
|
+
const { config: c, isFeatureEnabled: p } = I(), { exportHtml: f } = P(), { save: d } = G(), { validateCurrentTemplate: v } = J(), { isEnabled: i } = K(), { showToaster: S, handleError: a } = N(), { openVersionHistory: y, closeVersionHistory: g } = U(), { getCompiledEmail: h } = z(), { compileHtml: V } = j(), { validateLiquidSyntax: T } = X(), w = Z(), o = $(), E = tt(), H = et(), { hasMigrations: x } = it(H), r = Q(), b = m(() => i.value && w.allowSaveWithErrors ? r("email-editor.save-and-continue") : "Save"), s = u(!1), n = u(!1), C = u(), l = W(), k = () => {
|
|
27
|
+
if (o.isVersionHistoryOpen) {
|
|
28
|
+
g();
|
|
24
29
|
return;
|
|
25
30
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
31
|
+
y();
|
|
32
|
+
}, F = async () => {
|
|
33
|
+
s.value = !0, await f(), s.value = !1;
|
|
34
|
+
}, q = () => {
|
|
35
|
+
o.isSaveAsTemplateDrawerOpen = !0;
|
|
36
|
+
}, B = m(() => o.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), L = m(
|
|
32
37
|
() => {
|
|
33
|
-
var t,
|
|
34
|
-
return ((
|
|
38
|
+
var t, e;
|
|
39
|
+
return ((e = (t = c.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
|
|
35
40
|
}
|
|
36
|
-
),
|
|
37
|
-
|
|
38
|
-
let
|
|
41
|
+
), _ = async (t) => {
|
|
42
|
+
n.value = !0, t || (o.loadingStatus = !0);
|
|
43
|
+
let e;
|
|
39
44
|
try {
|
|
40
|
-
|
|
41
|
-
} catch (
|
|
42
|
-
|
|
43
|
-
throw n;
|
|
44
|
-
r(n, "Failed to save template");
|
|
45
|
+
e = await d(t);
|
|
46
|
+
} catch (O) {
|
|
47
|
+
a(O, "Failed to save template");
|
|
45
48
|
} finally {
|
|
46
|
-
|
|
49
|
+
n.value = !1, !t && !e && (o.loadingStatus = !1);
|
|
47
50
|
}
|
|
48
|
-
return
|
|
49
|
-
},
|
|
50
|
-
var
|
|
51
|
-
if (!t &&
|
|
52
|
-
(
|
|
51
|
+
return e;
|
|
52
|
+
}, A = (t) => {
|
|
53
|
+
var e;
|
|
54
|
+
if (!t && x.value) {
|
|
55
|
+
(e = C.value) == null || e.open();
|
|
53
56
|
return;
|
|
54
57
|
}
|
|
55
|
-
return
|
|
56
|
-
},
|
|
57
|
-
if (
|
|
58
|
-
|
|
58
|
+
return _(t);
|
|
59
|
+
}, R = async () => {
|
|
60
|
+
if (i.value) {
|
|
61
|
+
o.loadingStatus = !0;
|
|
62
|
+
let t = [];
|
|
63
|
+
try {
|
|
64
|
+
t = await v();
|
|
65
|
+
} catch (e) {
|
|
66
|
+
console.warn("Test-path validation failed; sending without the drawer.", e);
|
|
67
|
+
} finally {
|
|
68
|
+
o.loadingStatus = !1;
|
|
69
|
+
}
|
|
70
|
+
if (t.length) {
|
|
71
|
+
S({
|
|
72
|
+
type: Y.Error,
|
|
73
|
+
message: r("email-editor.validation-errors-found"),
|
|
74
|
+
actionButton: {
|
|
75
|
+
text: r("email-editor.check-errors"),
|
|
76
|
+
onClick: () => E.open(t, "test")
|
|
77
|
+
},
|
|
78
|
+
autoHide: !1
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
l();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (p("liquidSyntax")) {
|
|
86
|
+
o.loadingStatus = !0;
|
|
59
87
|
try {
|
|
60
|
-
const { html: t } = await
|
|
61
|
-
if (!await
|
|
88
|
+
const { html: t } = await h({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: e } = V(t);
|
|
89
|
+
if (!await T(e))
|
|
62
90
|
return;
|
|
63
91
|
} catch (t) {
|
|
64
|
-
|
|
92
|
+
a(t, "Failed to prepare test email");
|
|
65
93
|
return;
|
|
66
94
|
} finally {
|
|
67
|
-
|
|
95
|
+
o.loadingStatus = !1;
|
|
68
96
|
}
|
|
69
97
|
}
|
|
70
|
-
|
|
98
|
+
l();
|
|
71
99
|
};
|
|
72
|
-
return
|
|
73
|
-
handleSave:
|
|
74
|
-
}), { __sfc: !0, config:
|
|
100
|
+
return M({
|
|
101
|
+
handleSave: A
|
|
102
|
+
}), { __sfc: !0, config: c, isFeatureEnabled: p, exportHtml: f, save: d, validateCurrentTemplate: v, isEnabled: i, showToaster: S, handleError: a, openVersionHistory: y, closeVersionHistory: g, getCompiledEmail: h, compileHtml: V, validateLiquidSyntax: T, configStore: w, editorStore: o, saveValidationStore: E, templateStore: H, hasMigrations: x, trans: r, saveLabel: b, isExporting: s, isSaving: n, migrationModalRef: C, testEmailClick: l, handleVersionHistory: k, handleExport: F, handleSaveAs: q, versionHistoryTooltipText: B, isVersionHistoryButtonVisible: L, executeSave: _, handleSave: A, handleTestEmail: R, getTooltipOptions: ot, InButtonV2: rt, MigrationConfirmModal: at };
|
|
75
103
|
}
|
|
76
104
|
});
|
|
77
105
|
export {
|
|
78
|
-
|
|
106
|
+
Ot as default
|
|
79
107
|
};
|
|
@@ -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 r = this, o = r._self._c, t = r._self._setupProxy;
|
|
6
|
+
return o(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 } }, [o("div", { staticClass: "d-f f-d-c validation-error-list" }, r._l(t.rows, function(e, n) {
|
|
7
|
+
return o("div", { key: n, staticClass: "d-f a-i-c validation-error-row" }, [o(t.InIcons, { staticClass: "validation-error-row__icon i-c-12", attrs: { name: "filled-caution-triangle" } }), o("span", { staticClass: "validation-error-row__text" }, [r._v(r._s(e))])], 1);
|
|
8
|
+
}), 0)]);
|
|
9
|
+
}, l = [], _ = /* @__PURE__ */ s(
|
|
10
|
+
a,
|
|
11
|
+
i,
|
|
12
|
+
l,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
"30d2e1f9"
|
|
16
|
+
);
|
|
17
|
+
const p = _.exports;
|
|
18
|
+
export {
|
|
19
|
+
p as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as m, ref as p, computed as a } from "vue";
|
|
2
|
+
import f from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useSave as S } from "../../../composables/useSave.js";
|
|
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 { InIcons as w } from "@useinsider/design-system-vue";
|
|
9
|
+
const I = /* @__PURE__ */ m({
|
|
10
|
+
__name: "ValidationErrorDrawer",
|
|
11
|
+
setup(_) {
|
|
12
|
+
const r = v(), e = h(), n = y(), s = g(), { saveWithErrors: i } = S(), o = p(!1), l = a(() => `${r("email-editor.validation-errors")} (${e.errorCount})`), u = a(() => {
|
|
13
|
+
const t = {
|
|
14
|
+
primaryButton: {
|
|
15
|
+
styling: "solid",
|
|
16
|
+
type: "primary",
|
|
17
|
+
labelText: r("email-editor.update-design")
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
return s.allowSaveWithErrors && e.intent !== "test" && (t.secondaryButton = {
|
|
21
|
+
styling: "solid",
|
|
22
|
+
type: "subtle-primary",
|
|
23
|
+
labelText: r("email-editor.save-and-continue"),
|
|
24
|
+
loadingStatus: o.value
|
|
25
|
+
}), t;
|
|
26
|
+
}), d = a(() => e.errors.map((t) => {
|
|
27
|
+
const c = t.detail ? ` (${t.detail})` : "";
|
|
28
|
+
return `${t.message}${c}`;
|
|
29
|
+
}));
|
|
30
|
+
return { __sfc: !0, trans: r, store: e, editorStore: n, configStore: s, saveWithErrors: i, isSaving: o, titleText: l, footerButtonGroupOptions: u, rows: d, handleClose: () => {
|
|
31
|
+
e.isDrawerOpen && e.close();
|
|
32
|
+
}, handleSaveAndContinue: async () => {
|
|
33
|
+
if (!o.value) {
|
|
34
|
+
o.value = !0, n.loadingStatus = !0;
|
|
35
|
+
try {
|
|
36
|
+
await i() ? e.close() : n.loadingStatus = !1;
|
|
37
|
+
} catch (t) {
|
|
38
|
+
console.warn("Soft-save failed; keeping the drawer open.", t), n.loadingStatus = !1;
|
|
39
|
+
} finally {
|
|
40
|
+
o.value = !1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, WpDrawer: f, InIcons: w };
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
I as default
|
|
48
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import r from "./WpDrawer.vue2.js";
|
|
2
2
|
import s from "../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
3
|
var u = function() {
|
|
4
|
-
var t = this,
|
|
5
|
-
return
|
|
4
|
+
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
5
|
+
return o(e.InDrawer, { class: t.className, attrs: { id: t.id, "footer-status": "", "close-on-outside-click": t.closeOnOutsideClick, "description-status": t.descriptionStatus, "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, size: t.size, status: t.status, "title-text": t.titleText }, on: { cancelOrBackButtonEvent: function(n) {
|
|
6
6
|
return e.emit("cancelOrBackButtonEvent");
|
|
7
|
-
}, onCloseEvent: function(
|
|
7
|
+
}, onCloseEvent: function(n) {
|
|
8
8
|
return e.emit("onCloseEvent");
|
|
9
|
-
}, primaryButtonEvent: function(
|
|
9
|
+
}, primaryButtonEvent: function(n) {
|
|
10
10
|
return e.emit("primaryButtonEvent");
|
|
11
|
+
}, secondaryButtonEvent: function(n) {
|
|
12
|
+
return e.emit("secondaryButtonEvent");
|
|
11
13
|
} }, scopedSlots: t._u([t.$slots.headerBottomSlot ? { key: "headerBottomSlot", fn: function() {
|
|
12
14
|
return [t._t("headerBottomSlot")];
|
|
13
15
|
}, proxy: !0 } : null, { key: "contentSlot", fn: function() {
|
|
14
|
-
return [
|
|
16
|
+
return [o("div", [t._t("default")], 2)];
|
|
15
17
|
}, proxy: !0 }], null, !0) });
|
|
16
18
|
}, i = [], c = /* @__PURE__ */ s(
|
|
17
19
|
r,
|
|
@@ -21,7 +23,7 @@ var u = function() {
|
|
|
21
23
|
null,
|
|
22
24
|
null
|
|
23
25
|
);
|
|
24
|
-
const
|
|
26
|
+
const p = c.exports;
|
|
25
27
|
export {
|
|
26
|
-
|
|
28
|
+
p as default
|
|
27
29
|
};
|
|
@@ -13,7 +13,7 @@ const r = /* @__PURE__ */ e({
|
|
|
13
13
|
status: { type: Boolean },
|
|
14
14
|
titleText: null
|
|
15
15
|
},
|
|
16
|
-
emits: ["cancelOrBackButtonEvent", "onCloseEvent", "primaryButtonEvent"],
|
|
16
|
+
emits: ["cancelOrBackButtonEvent", "onCloseEvent", "primaryButtonEvent", "secondaryButtonEvent"],
|
|
17
17
|
setup(n, { emit: t }) {
|
|
18
18
|
return { __sfc: !0, emit: t, InDrawer: o };
|
|
19
19
|
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { filterAmpErrors as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { filterAmpErrors as y } from "../utils/ampErrorFilter.js";
|
|
2
|
+
import { getEditorApi as s } from "../utils/stripoEditorApi.js";
|
|
3
|
+
import { useToaster as D } from "./useToaster.js";
|
|
4
|
+
const h = 1e4, T = 3e4, r = (n, l, A) => new Promise((C, p) => {
|
|
5
|
+
const f = setTimeout(
|
|
6
|
+
() => p(new Error(`${n} did not report completion within ${l}ms`)),
|
|
6
7
|
l
|
|
7
|
-
),
|
|
8
|
-
clearTimeout(
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
), c = (t) => (e) => {
|
|
9
|
+
clearTimeout(f), t(e);
|
|
10
|
+
}, d = c(p);
|
|
11
|
+
try {
|
|
12
|
+
A(c(C), d);
|
|
13
|
+
} catch (t) {
|
|
14
|
+
d(t);
|
|
15
|
+
}
|
|
16
|
+
}), P = () => {
|
|
17
|
+
const { handleError: n } = D(), l = (t = {}) => r(
|
|
13
18
|
"compileEmail",
|
|
14
|
-
|
|
15
|
-
(e,
|
|
19
|
+
T,
|
|
20
|
+
(e, i) => {
|
|
16
21
|
const o = { ...{
|
|
17
22
|
minimize: !0,
|
|
18
23
|
utmEntity: {
|
|
@@ -32,53 +37,53 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
|
|
|
32
37
|
forceAmp: !1,
|
|
33
38
|
resetDataSavedFlag: !1,
|
|
34
39
|
disableLineHeightsReplace: !0
|
|
35
|
-
}, ...t },
|
|
36
|
-
callback: (
|
|
37
|
-
|
|
38
|
-
html:
|
|
39
|
-
ampHtml:
|
|
40
|
-
ampErrors:
|
|
41
|
-
displayConditions:
|
|
40
|
+
}, ...t }, u = {
|
|
41
|
+
callback: (m, g, w, S, v) => {
|
|
42
|
+
m ? i(m) : e({
|
|
43
|
+
html: g,
|
|
44
|
+
ampHtml: w,
|
|
45
|
+
ampErrors: y(S ?? []),
|
|
46
|
+
displayConditions: v
|
|
42
47
|
});
|
|
43
48
|
},
|
|
44
49
|
...o
|
|
45
50
|
};
|
|
46
|
-
|
|
51
|
+
s().actionsApi.compileEmail(u);
|
|
47
52
|
}
|
|
48
53
|
);
|
|
49
54
|
return {
|
|
50
55
|
getCompiledEmail: l,
|
|
51
|
-
getTemplateData: () =>
|
|
56
|
+
getTemplateData: () => r(
|
|
52
57
|
"getTemplateData",
|
|
53
|
-
|
|
58
|
+
T,
|
|
54
59
|
(t) => {
|
|
55
|
-
const e = ({ html:
|
|
56
|
-
html:
|
|
57
|
-
css:
|
|
60
|
+
const e = ({ html: i, css: a, width: o, height: E, utmParams: u, syncModulesIds: m }) => t({
|
|
61
|
+
html: i,
|
|
62
|
+
css: a,
|
|
58
63
|
width: o,
|
|
59
64
|
height: E,
|
|
60
|
-
utmParams:
|
|
61
|
-
syncModulesIds:
|
|
65
|
+
utmParams: u,
|
|
66
|
+
syncModulesIds: m
|
|
62
67
|
});
|
|
63
|
-
|
|
68
|
+
s().actionsApi.getTemplateData(e);
|
|
64
69
|
}
|
|
65
70
|
),
|
|
66
71
|
activateCustomViewStyles: (t = !0) => {
|
|
67
|
-
|
|
72
|
+
s().actionsApi.activateCustomViewStyles(t);
|
|
68
73
|
},
|
|
69
74
|
getPreviewData: async (t) => {
|
|
70
75
|
try {
|
|
71
76
|
const {
|
|
72
77
|
html: e,
|
|
73
|
-
displayConditions:
|
|
74
|
-
ampHtml:
|
|
78
|
+
displayConditions: i,
|
|
79
|
+
ampHtml: a = "",
|
|
75
80
|
ampErrors: o = []
|
|
76
81
|
} = await l({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
77
82
|
return {
|
|
78
83
|
html: e,
|
|
79
|
-
ampHtml:
|
|
84
|
+
ampHtml: a,
|
|
80
85
|
ampErrors: o,
|
|
81
|
-
displayConditions:
|
|
86
|
+
displayConditions: i
|
|
82
87
|
};
|
|
83
88
|
} catch (e) {
|
|
84
89
|
return n(e, "Error loading preview"), {
|
|
@@ -90,30 +95,30 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
|
|
|
90
95
|
}
|
|
91
96
|
},
|
|
92
97
|
updateTimerInClonedTemplate: () => new Promise((t) => {
|
|
93
|
-
var e,
|
|
94
|
-
if (typeof ((
|
|
98
|
+
var e, i;
|
|
99
|
+
if (typeof ((i = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : i.updateTimerInClonedTemplate) != "function") {
|
|
95
100
|
t(null);
|
|
96
101
|
return;
|
|
97
102
|
}
|
|
98
103
|
try {
|
|
99
|
-
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((
|
|
100
|
-
|
|
104
|
+
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((a, o) => {
|
|
105
|
+
a ? (n(a, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
101
106
|
});
|
|
102
|
-
} catch (
|
|
103
|
-
n(
|
|
107
|
+
} catch (a) {
|
|
108
|
+
n(a, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
104
109
|
}
|
|
105
110
|
}),
|
|
106
111
|
updateHtmlAndCss: (t, e) => {
|
|
107
|
-
const { actionsApi:
|
|
108
|
-
return
|
|
109
|
-
|
|
112
|
+
const { actionsApi: i } = s();
|
|
113
|
+
return r("updateHtmlAndCss", h, (a) => {
|
|
114
|
+
i.updateHtmlAndCss(t, e, () => a());
|
|
110
115
|
});
|
|
111
116
|
},
|
|
112
|
-
editorSave: () =>
|
|
117
|
+
editorSave: () => r(
|
|
113
118
|
"save",
|
|
114
|
-
|
|
119
|
+
T,
|
|
115
120
|
(t) => {
|
|
116
|
-
|
|
121
|
+
s().actionsApi.save((e) => {
|
|
117
122
|
if (e) {
|
|
118
123
|
n(e, "Failed to save template"), t(!1);
|
|
119
124
|
return;
|
|
@@ -125,5 +130,5 @@ const D = 1e4, d = 3e4, s = (n, l, u) => new Promise((T, m) => {
|
|
|
125
130
|
};
|
|
126
131
|
};
|
|
127
132
|
export {
|
|
128
|
-
|
|
133
|
+
P as useActionsApi
|
|
129
134
|
};
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ToasterTypeOptions as d } from "../enums/toaster.js";
|
|
2
|
+
import { findEditorApi as s, EDITOR_NOT_READY_MESSAGE as p } from "../utils/stripoEditorApi.js";
|
|
3
|
+
import { useToaster as E } from "./useToaster.js";
|
|
4
|
+
const T = () => {
|
|
5
|
+
const { showToaster: i } = E(), t = (o) => {
|
|
6
|
+
var r;
|
|
7
|
+
const e = (r = s()) == null ? void 0 : r.codeEditorApi;
|
|
8
|
+
if (!e) {
|
|
9
|
+
i({ type: d.Error, message: p });
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
o(e);
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
openCodeEditor: () => {
|
|
16
|
+
t((o) => o.openCodeEditor());
|
|
17
|
+
},
|
|
18
|
+
closeCodeEditor: () => {
|
|
19
|
+
t((o) => o.closeCodeEditor());
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
9
23
|
export {
|
|
10
|
-
|
|
24
|
+
T as useCodeEditorApi
|
|
11
25
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { liquidCompilerRules as
|
|
4
|
-
import { outlookCompilerRules as
|
|
1
|
+
import { defaultHtmlCompilerRules as d } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as f } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { liquidCompilerRules as g } from "../config/compiler/liquidCompilerRules.js";
|
|
4
|
+
import { outlookCompilerRules as R } from "../config/compiler/outlookCompilerRules.js";
|
|
5
5
|
import { recommendationCompilerRules as v } from "../config/compiler/recommendationCompilerRules.js";
|
|
6
6
|
import { socialCompilerRules as H } from "../config/compiler/socialCompilerRules.js";
|
|
7
|
-
import { unsubscribeCompilerRules as
|
|
8
|
-
import { createHtmlCompiler as
|
|
9
|
-
import {
|
|
10
|
-
|
|
7
|
+
import { unsubscribeCompilerRules as b } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
|
+
import { createHtmlCompiler as n } from "../utils/htmlCompiler.js";
|
|
9
|
+
import { computed as p } from "vue";
|
|
10
|
+
import { useConfig as C } from "./useConfig.js";
|
|
11
|
+
const x = /* @__PURE__ */ new Set([
|
|
11
12
|
// URL/tag encoding fixes — keep merge-tag and placeholder integrity intact.
|
|
12
13
|
"fix-url-encoding-start",
|
|
13
14
|
"fix-url-encoding-end",
|
|
@@ -30,24 +31,34 @@ const y = /* @__PURE__ */ new Set([
|
|
|
30
31
|
// Editor-only attribute strip — AMP4EMAIL has no `contenteditable`, so leaving
|
|
31
32
|
// it in narrows/breaks rendering. Pure attribute removal, emits nothing.
|
|
32
33
|
"remove-contenteditable"
|
|
33
|
-
]),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
...
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
]), I = () => {
|
|
35
|
+
const { compiler: i, isFeatureEnabled: u, partner: a } = C(), c = p(() => {
|
|
36
|
+
var m, l;
|
|
37
|
+
const e = ((m = i.value) == null ? void 0 : m.customRules) || [];
|
|
38
|
+
return [
|
|
39
|
+
...!!((l = i.value) != null && l.ignoreDefaultRules) ? [] : d,
|
|
40
|
+
...v,
|
|
41
|
+
...b,
|
|
42
|
+
...f,
|
|
43
|
+
...R,
|
|
44
|
+
...H,
|
|
45
|
+
...u("liquidSyntax") ? g : [],
|
|
46
|
+
...e.map((t, o) => ({
|
|
47
|
+
...t,
|
|
48
|
+
priority: t.priority + 1e3 + o
|
|
49
|
+
// Ensure additional rules run after default rules
|
|
50
|
+
}))
|
|
51
|
+
];
|
|
52
|
+
}), r = p(() => {
|
|
53
|
+
var t;
|
|
54
|
+
const e = c.value, s = n(e), m = n(e.filter((o) => x.has(o.id))), l = (t = a.value) == null ? void 0 : t.fallbackFont;
|
|
55
|
+
return {
|
|
56
|
+
compileHtml: (o) => s.compile(o, void 0, l),
|
|
57
|
+
compileAmpHtml: (o) => m.compile(o, void 0, l)
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
return { compileHtml: (e) => r.value.compileHtml(e), compileAmpHtml: (e) => r.value.compileAmpHtml(e) };
|
|
50
61
|
};
|
|
51
62
|
export {
|
|
52
|
-
|
|
63
|
+
I as useHtmlCompiler
|
|
53
64
|
};
|
|
@@ -226,6 +226,8 @@ const ke = () => {
|
|
|
226
226
|
export {
|
|
227
227
|
ge as buildPartnerAttributeNameSet,
|
|
228
228
|
pe as findInvalidCustomFields,
|
|
229
|
+
Ee as getInvalidDynamicContentTags,
|
|
230
|
+
me as getRecommendationBlockIds,
|
|
229
231
|
fe as parseRecommendationVariable,
|
|
230
232
|
ke as useHtmlValidator
|
|
231
233
|
};
|