@useinsider/guido 3.18.2-beta.eedafd2 → 3.18.2-beta.ef84353
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 +20 -1
- package/dist/@types/config/schemas.js +26 -28
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +51 -53
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
- package/dist/components/organisms/header/EditorActions.vue.js +2 -2
- package/dist/components/organisms/header/EditorActions.vue2.js +56 -86
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useGuidoStateBridge.js +29 -24
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useSave.js +45 -90
- package/dist/composables/useStripo.js +7 -7
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +36 -43
- package/dist/guido.css +1 -1
- package/dist/library.js +15 -13
- package/dist/public/editorState.js +4 -0
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useGuidoStateBridge.d.ts +11 -7
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -5
- package/dist/src/library.d.ts +2 -0
- package/dist/src/public/editorState.d.ts +14 -0
- package/dist/src/public/trackingIds.d.ts +6 -2
- package/dist/src/stores/config.d.ts +0 -30
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/stores/guido-email-editor.d.ts +27 -27
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/stores/config.js +22 -39
- package/dist/stores/editor.js +4 -0
- package/dist/stores/guido-email-editor.js +0 -4
- package/dist/utils/templatePreparation.js +25 -28
- package/package.json +5 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -48
- package/dist/composables/useSaveValidation.js +0 -279
- package/dist/composables/useSaveValidationRollout.js +0 -9
- package/dist/enums/save-validation.js +0 -4
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/stores/save-validation.js +0 -30
|
@@ -1,109 +1,79 @@
|
|
|
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
|
-
|
|
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({
|
|
1
|
+
import { defineComponent as q, ref as l, computed as w } 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({
|
|
24
19
|
__name: "EditorActions",
|
|
25
|
-
setup(
|
|
26
|
-
const { config:
|
|
27
|
-
if (
|
|
28
|
-
|
|
20
|
+
setup(W, { expose: x }) {
|
|
21
|
+
const { config: m, isFeatureEnabled: c } = k(), { exportHtml: p } = B(), { save: u } = R(), { openVersionHistory: f, closeVersionHistory: d } = P(), { getCompiledEmail: v } = b(), { compileHtml: y } = L(), { validateLiquidSyntax: g } = j(), { handleError: r } = z(), e = G(), h = J(), { hasMigrations: H } = Q(h), s = I(), i = l(!1), a = l(!1), S = l(), V = D(), _ = () => {
|
|
22
|
+
if (e.isVersionHistoryOpen) {
|
|
23
|
+
d();
|
|
29
24
|
return;
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
},
|
|
26
|
+
f();
|
|
27
|
+
}, C = async () => {
|
|
28
|
+
i.value = !0, await p(), i.value = !1;
|
|
29
|
+
}, A = () => {
|
|
30
|
+
e.isSaveAsTemplateDrawerOpen = !0;
|
|
31
|
+
}, M = w(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = w(
|
|
37
32
|
() => {
|
|
38
|
-
var t,
|
|
39
|
-
return ((
|
|
33
|
+
var t, o;
|
|
34
|
+
return ((o = (t = m.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
40
35
|
}
|
|
41
|
-
),
|
|
42
|
-
|
|
43
|
-
let
|
|
36
|
+
), E = async (t) => {
|
|
37
|
+
a.value = !0, t || (e.loadingStatus = !0);
|
|
38
|
+
let o;
|
|
44
39
|
try {
|
|
45
|
-
|
|
46
|
-
} catch (
|
|
40
|
+
o = await u(t);
|
|
41
|
+
} catch (n) {
|
|
47
42
|
if (t)
|
|
48
|
-
throw
|
|
49
|
-
|
|
43
|
+
throw n;
|
|
44
|
+
r(n, "Failed to save template");
|
|
50
45
|
} finally {
|
|
51
|
-
|
|
46
|
+
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
52
47
|
}
|
|
53
|
-
return
|
|
54
|
-
},
|
|
55
|
-
var
|
|
56
|
-
if (!t &&
|
|
57
|
-
(
|
|
48
|
+
return o;
|
|
49
|
+
}, T = (t) => {
|
|
50
|
+
var o;
|
|
51
|
+
if (!t && H.value) {
|
|
52
|
+
(o = S.value) == null || o.open();
|
|
58
53
|
return;
|
|
59
54
|
}
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
let t = [];
|
|
65
|
-
try {
|
|
66
|
-
t = await y();
|
|
67
|
-
} catch (e) {
|
|
68
|
-
console.warn("Test-path validation failed; sending without the drawer.", e);
|
|
69
|
-
} finally {
|
|
70
|
-
o.loadingStatus = !1;
|
|
71
|
-
}
|
|
72
|
-
if (t.length) {
|
|
73
|
-
S({
|
|
74
|
-
type: Y.Error,
|
|
75
|
-
message: r("email-editor.validation-errors-found"),
|
|
76
|
-
actionButton: {
|
|
77
|
-
text: r("email-editor.check-errors"),
|
|
78
|
-
onClick: () => H.open(t, "test")
|
|
79
|
-
},
|
|
80
|
-
autoHide: !1
|
|
81
|
-
});
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
l();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (f("liquidSyntax")) {
|
|
88
|
-
o.loadingStatus = !0;
|
|
55
|
+
return E(t);
|
|
56
|
+
}, F = async () => {
|
|
57
|
+
if (c("liquidSyntax")) {
|
|
58
|
+
e.loadingStatus = !0;
|
|
89
59
|
try {
|
|
90
|
-
const { html: t } = await
|
|
91
|
-
if (!await
|
|
60
|
+
const { html: t } = await v({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = y(t);
|
|
61
|
+
if (!await g(o))
|
|
92
62
|
return;
|
|
93
63
|
} catch (t) {
|
|
94
|
-
|
|
64
|
+
r(t, "Failed to prepare test email");
|
|
95
65
|
return;
|
|
96
66
|
} finally {
|
|
97
|
-
|
|
67
|
+
e.loadingStatus = !1;
|
|
98
68
|
}
|
|
99
69
|
}
|
|
100
|
-
|
|
70
|
+
V();
|
|
101
71
|
};
|
|
102
|
-
return
|
|
103
|
-
handleSave:
|
|
104
|
-
}), { __sfc: !0, config:
|
|
72
|
+
return x({
|
|
73
|
+
handleSave: T
|
|
74
|
+
}), { __sfc: !0, config: m, isFeatureEnabled: c, exportHtml: p, save: u, openVersionHistory: f, closeVersionHistory: d, getCompiledEmail: v, compileHtml: y, validateLiquidSyntax: g, handleError: r, editorStore: e, templateStore: h, hasMigrations: H, trans: s, isExporting: i, isSaving: a, migrationModalRef: S, testEmailClick: V, handleVersionHistory: _, handleExport: C, handleSaveAs: A, versionHistoryTooltipText: M, isVersionHistoryButtonVisible: O, executeSave: E, handleSave: T, handleTestEmail: F, getTooltipOptions: K, InButtonV2: N, MigrationConfirmModal: U };
|
|
105
75
|
}
|
|
106
76
|
});
|
|
107
77
|
export {
|
|
108
|
-
|
|
78
|
+
ft as default
|
|
109
79
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import o from "./LeftSlot.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = 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__ */ a(
|
|
8
8
|
o,
|
|
9
|
-
|
|
9
|
+
n,
|
|
10
10
|
i,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"73199fa4"
|
|
14
14
|
);
|
|
15
15
|
const f = r.exports;
|
|
16
16
|
export {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as l, 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 V } 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 y } from "../../../node_modules/@vueuse/shared/index.js";
|
|
10
|
+
const D = /* @__PURE__ */ l({
|
|
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 = V(), i = B(), { closeVersionHistory: n } = _(), { closePreviewMode: s } = b(), o = v(), { config: t } = k(), f = p(() => {
|
|
14
|
+
var u, m;
|
|
15
|
+
return e.isVersionHistoryOpen || e.isPreviewModeOpen ? o("email-editor.back-to-editor") : (m = (u = t.value) == null ? void 0 : u.ui) != null && m.backButtonLabel ? t.value.ui.backButtonLabel : o("email-editor.back-to-design");
|
|
16
|
+
}), r = d(!1), c = () => {
|
|
17
17
|
if (e.isVersionHistoryOpen) {
|
|
18
18
|
n();
|
|
19
19
|
return;
|
|
@@ -23,15 +23,11 @@ const D = /* @__PURE__ */ m({
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
i();
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
await a();
|
|
29
|
-
} finally {
|
|
30
|
-
r.value = !1;
|
|
31
|
-
}
|
|
26
|
+
}, a = y(() => {
|
|
27
|
+
c(), r.value = !1;
|
|
32
28
|
}, 500);
|
|
33
|
-
return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel:
|
|
34
|
-
r.value = !0,
|
|
29
|
+
return { __sfc: !0, editorStore: e, handleBack: i, closeVersionHistory: n, closePreviewMode: s, trans: o, config: t, backButtonLabel: f, isBackButtonDisabled: r, executeBackAction: c, debouncedBackAction: a, handleBackClick: () => {
|
|
30
|
+
r.value = !0, a();
|
|
35
31
|
}, InButtonV2: w };
|
|
36
32
|
}
|
|
37
33
|
});
|
|
@@ -1,19 +1,17 @@
|
|
|
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, n = t._self._c, e = t._self._setupProxy;
|
|
5
|
+
return n(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(o) {
|
|
6
6
|
return e.emit("cancelOrBackButtonEvent");
|
|
7
|
-
}, onCloseEvent: function(
|
|
7
|
+
}, onCloseEvent: function(o) {
|
|
8
8
|
return e.emit("onCloseEvent");
|
|
9
|
-
}, primaryButtonEvent: function(
|
|
9
|
+
}, primaryButtonEvent: function(o) {
|
|
10
10
|
return e.emit("primaryButtonEvent");
|
|
11
|
-
}, secondaryButtonEvent: function(n) {
|
|
12
|
-
return e.emit("secondaryButtonEvent");
|
|
13
11
|
} }, scopedSlots: t._u([t.$slots.headerBottomSlot ? { key: "headerBottomSlot", fn: function() {
|
|
14
12
|
return [t._t("headerBottomSlot")];
|
|
15
13
|
}, proxy: !0 } : null, { key: "contentSlot", fn: function() {
|
|
16
|
-
return [
|
|
14
|
+
return [n("div", [t._t("default")], 2)];
|
|
17
15
|
}, proxy: !0 }], null, !0) });
|
|
18
16
|
}, i = [], c = /* @__PURE__ */ s(
|
|
19
17
|
r,
|
|
@@ -23,7 +21,7 @@ var u = function() {
|
|
|
23
21
|
null,
|
|
24
22
|
null
|
|
25
23
|
);
|
|
26
|
-
const
|
|
24
|
+
const f = c.exports;
|
|
27
25
|
export {
|
|
28
|
-
|
|
26
|
+
f as default
|
|
29
27
|
};
|
|
@@ -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"],
|
|
17
17
|
setup(n, { emit: t }) {
|
|
18
18
|
return { __sfc: !0, emit: t, InDrawer: o };
|
|
19
19
|
}
|
|
@@ -1,54 +1,59 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useEditorLock as
|
|
1
|
+
import { useActionsApi as v } from "./useActionsApi.js";
|
|
2
|
+
import { useEditorLock as C } from "./useEditorLock.js";
|
|
3
3
|
import { useConfigStore as T } from "../stores/config.js";
|
|
4
4
|
import { useEditorStore as w } from "../stores/editor.js";
|
|
5
5
|
import { useGuidoEmailEditorStore as y } from "../stores/guido-email-editor.js";
|
|
6
|
-
import { watch as
|
|
7
|
-
const
|
|
8
|
-
const i = w(), u = y(),
|
|
9
|
-
let o = null,
|
|
10
|
-
const
|
|
6
|
+
import { watch as c, onUnmounted as z } from "vue";
|
|
7
|
+
const B = 500, G = () => {
|
|
8
|
+
const i = w(), u = y(), d = T(), { getTemplateData: l } = v(), { runExclusive: m, isEditorBusy: p } = C();
|
|
9
|
+
let o = null, n = !1;
|
|
10
|
+
const r = () => {
|
|
11
11
|
o && (clearTimeout(o), o = null);
|
|
12
|
-
},
|
|
13
|
-
|
|
12
|
+
}, a = (t) => {
|
|
13
|
+
r(), o = setTimeout(() => {
|
|
14
14
|
o = null, t();
|
|
15
|
-
},
|
|
15
|
+
}, B);
|
|
16
16
|
}, e = async () => {
|
|
17
|
-
var t,
|
|
18
|
-
if (!(
|
|
17
|
+
var t, s;
|
|
18
|
+
if (!(n || !i.isStripoInitialized)) {
|
|
19
19
|
if (p()) {
|
|
20
|
-
|
|
20
|
+
a(() => void e());
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
try {
|
|
24
|
-
const { html: E, css:
|
|
25
|
-
if (
|
|
24
|
+
const { html: E, css: I } = await m(l), b = ((s = (t = d.config) == null ? void 0 : t.identity) == null ? void 0 : s.templateId) ?? "";
|
|
25
|
+
if (n)
|
|
26
26
|
return;
|
|
27
27
|
u.$patch({
|
|
28
28
|
html: E ?? "",
|
|
29
|
-
css:
|
|
30
|
-
templateId:
|
|
29
|
+
css: I ?? "",
|
|
30
|
+
templateId: b,
|
|
31
31
|
lastUpdatedAt: Date.now()
|
|
32
32
|
});
|
|
33
33
|
} catch {
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
}, f = () =>
|
|
36
|
+
}, f = () => a(() => void e()), h = c(
|
|
37
37
|
() => i.isStripoInitialized,
|
|
38
38
|
(t) => {
|
|
39
39
|
t && e();
|
|
40
40
|
},
|
|
41
41
|
{ immediate: !0 }
|
|
42
|
-
), S =
|
|
42
|
+
), S = c(
|
|
43
|
+
() => i.changeSeq,
|
|
44
|
+
() => {
|
|
45
|
+
i.isStripoInitialized && f();
|
|
46
|
+
}
|
|
47
|
+
), g = c(
|
|
43
48
|
() => i.hasChanges,
|
|
44
|
-
(t,
|
|
45
|
-
|
|
49
|
+
(t, s) => {
|
|
50
|
+
!t && s && i.isStripoInitialized && (r(), e());
|
|
46
51
|
}
|
|
47
52
|
);
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
z(() => {
|
|
54
|
+
n = !0, r(), h(), S(), g();
|
|
50
55
|
});
|
|
51
56
|
};
|
|
52
57
|
export {
|
|
53
|
-
|
|
58
|
+
G as useGuidoStateBridge
|
|
54
59
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { defaultHtmlCompilerRules as
|
|
2
|
-
import { itemsCompilerRules as
|
|
3
|
-
import { liquidCompilerRules as
|
|
4
|
-
import { outlookCompilerRules as
|
|
1
|
+
import { defaultHtmlCompilerRules as R } from "../config/compiler/htmlCompilerRules.js";
|
|
2
|
+
import { itemsCompilerRules as g } from "../config/compiler/itemsCompilerRules.js";
|
|
3
|
+
import { liquidCompilerRules as C } from "../config/compiler/liquidCompilerRules.js";
|
|
4
|
+
import { outlookCompilerRules as b } 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
|
-
|
|
11
|
-
const x = /* @__PURE__ */ new Set([
|
|
7
|
+
import { unsubscribeCompilerRules as x } from "../config/compiler/unsubscribeCompilerRules.js";
|
|
8
|
+
import { createHtmlCompiler as s } from "../utils/htmlCompiler.js";
|
|
9
|
+
import { useConfig as k } from "./useConfig.js";
|
|
10
|
+
const y = /* @__PURE__ */ new Set([
|
|
12
11
|
// URL/tag encoding fixes — keep merge-tag and placeholder integrity intact.
|
|
13
12
|
"fix-url-encoding-start",
|
|
14
13
|
"fix-url-encoding-end",
|
|
@@ -31,34 +30,24 @@ const x = /* @__PURE__ */ new Set([
|
|
|
31
30
|
// Editor-only attribute strip — AMP4EMAIL has no `contenteditable`, so leaving
|
|
32
31
|
// it in narrows/breaks rendering. Pure attribute removal, emits nothing.
|
|
33
32
|
"remove-contenteditable"
|
|
34
|
-
]),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
...
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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) };
|
|
33
|
+
]), M = () => {
|
|
34
|
+
var i, m, r;
|
|
35
|
+
const { compiler: o, isFeatureEnabled: n, partner: a } = k(), p = ((i = o.value) == null ? void 0 : i.customRules) || [], l = [
|
|
36
|
+
...!!((m = o.value) != null && m.ignoreDefaultRules) ? [] : R,
|
|
37
|
+
...v,
|
|
38
|
+
...x,
|
|
39
|
+
...g,
|
|
40
|
+
...b,
|
|
41
|
+
...H,
|
|
42
|
+
...n("liquidSyntax") ? C : [],
|
|
43
|
+
...p.map((e, f) => ({
|
|
44
|
+
...e,
|
|
45
|
+
priority: e.priority + 1e3 + f
|
|
46
|
+
// Ensure additional rules run after default rules
|
|
47
|
+
}))
|
|
48
|
+
], u = s(l), c = l.filter((e) => y.has(e.id)), d = s(c), t = (r = a.value) == null ? void 0 : r.fallbackFont;
|
|
49
|
+
return { compileHtml: (e) => u.compile(e, void 0, t), compileAmpHtml: (e) => d.compile(e, void 0, t) };
|
|
61
50
|
};
|
|
62
51
|
export {
|
|
63
|
-
|
|
52
|
+
M as useHtmlCompiler
|
|
64
53
|
};
|
|
@@ -221,8 +221,6 @@ const De = () => {
|
|
|
221
221
|
export {
|
|
222
222
|
de as buildPartnerAttributeNameSet,
|
|
223
223
|
fe as findInvalidCustomFields,
|
|
224
|
-
pe as getInvalidDynamicContentTags,
|
|
225
|
-
ce as getRecommendationBlockIds,
|
|
226
224
|
ue as parseRecommendationVariable,
|
|
227
225
|
De as useHtmlValidator
|
|
228
226
|
};
|
|
@@ -1,100 +1,55 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as T } from "./useActionsApi.js";
|
|
2
2
|
import { useConfig as q } from "./useConfig.js";
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const r = D(), f = F(), { validateHtml: p } = _(), { validateLiquidSyntax: v } = et(), { validateCouponBlockTags: y } = tt(), { validateUnsubscribeBlockUniqueness: S, validateUnsubscribeBlockHasTemplate: w } = st(), { validateSyncModuleBlocks: u } = ot(), { callbacks: a, isFeatureEnabled: m } = q(), { extractSyncModuleData: b } = G(), { setSyncModuleUnsubscriptionPages: g } = J(), { editorSave: E, getTemplateData: H } = W(), { showToaster: V } = $(), { getBlockedDomains: x, resolveToast: k } = Z(), { prepareTemplateDetails: d } = X(), { collectSaveValidationErrors: C } = j(), { isEnabled: B } = z(), T = Q(), h = N(), P = K(), { runExclusive: n } = O(), l = async (t, e, o) => {
|
|
23
|
-
if (!m("allowlistEnabled"))
|
|
24
|
-
return !1;
|
|
25
|
-
const i = await x(t, e);
|
|
26
|
-
if (!i.length)
|
|
27
|
-
return !1;
|
|
28
|
-
if (!o) {
|
|
29
|
-
const s = await k(i);
|
|
30
|
-
s != null && s.message && V({
|
|
31
|
-
type: I.Warning,
|
|
32
|
-
message: s.message,
|
|
33
|
-
actionButton: s.actionButton
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return !0;
|
|
37
|
-
}, L = async (t) => !y(t.compiledHtml) || !S(t.compiledHtml) || !w(t.compiledHtml) ? !1 : m("liquidSyntax") ? v(t.compiledHtml) : p(t.compiledHtml, t.dynamicContentList, !0), c = async (t, e) => {
|
|
38
|
-
if (!await E())
|
|
3
|
+
import { useEditorLock as C } from "./useEditorLock.js";
|
|
4
|
+
import { useSaveStart as L, useSaveComplete as M } from "./useGuidoActions.js";
|
|
5
|
+
import { useSyncModuleExtractor as D } from "./useSyncModuleExtractor.js";
|
|
6
|
+
import { ToasterTypeOptions as P } from "../enums/toaster.js";
|
|
7
|
+
import { useStripoApi as U } from "../services/stripoApi.js";
|
|
8
|
+
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
9
|
+
import { useAllowlist as h } from "./useAllowlist.js";
|
|
10
|
+
import { useHtmlValidator as F } from "./useHtmlValidator.js";
|
|
11
|
+
import { useToaster as O } from "./useToaster.js";
|
|
12
|
+
import { useCouponBlockValidator as W } from "./validators/useCouponBlockValidator.js";
|
|
13
|
+
import { useLiquidValidator as j } from "./validators/useLiquidValidator.js";
|
|
14
|
+
import { useSyncModuleBlockValidator as z } from "./validators/useSyncModuleBlockValidator.js";
|
|
15
|
+
import { useUnsubscribeBlockValidator as G } from "./validators/useUnsubscribeBlockValidator.js";
|
|
16
|
+
const rt = () => {
|
|
17
|
+
const n = L(), c = M(), { validateHtml: d } = F(), { validateLiquidSyntax: m } = j(), { validateCouponBlockTags: u } = W(), { validateUnsubscribeBlockUniqueness: p, validateUnsubscribeBlockHasTemplate: f } = G(), { validateSyncModuleBlocks: v } = z(), { callbacks: s, isFeatureEnabled: r } = q(), { extractSyncModuleData: S } = D(), { setSyncModuleUnsubscriptionPages: b } = U(), { editorSave: w } = T(), { showToaster: V } = O(), { getBlockedDomains: y, resolveToast: k } = h(), { runExclusive: x } = C(), H = async (a, o) => {
|
|
18
|
+
var l;
|
|
19
|
+
n();
|
|
20
|
+
const { prepareTemplateDetails: B } = A(), t = await B();
|
|
21
|
+
if (!v(t.rawHtml, o) || !u(t.compiledHtml) || !p(t.compiledHtml) || !f(t.compiledHtml))
|
|
39
22
|
return;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const R = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
|
|
43
|
-
f({ ...t, ...R, silent: e.silent });
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
}, U = async (t, e) => {
|
|
47
|
-
var i;
|
|
48
|
-
r();
|
|
49
|
-
const o = await d();
|
|
50
|
-
if (u(o.rawHtml, e)) {
|
|
51
|
-
if (B.value && !e) {
|
|
52
|
-
const s = await C(
|
|
53
|
-
o.compiledHtml,
|
|
54
|
-
o.dynamicContentList
|
|
55
|
-
);
|
|
56
|
-
if (s.length) {
|
|
57
|
-
T.open(s, "save");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
} else if (!await L(o))
|
|
23
|
+
if (r("liquidSyntax")) {
|
|
24
|
+
if (!await m(t.compiledHtml))
|
|
61
25
|
return;
|
|
62
|
-
|
|
63
|
-
return c(o, { silent: e, suppress: t });
|
|
64
|
-
}
|
|
65
|
-
}, A = async () => {
|
|
66
|
-
var e;
|
|
67
|
-
if (!P.allowSaveWithErrors)
|
|
26
|
+
} else if (!await d(t.compiledHtml, t.dynamicContentList, !0))
|
|
68
27
|
return;
|
|
69
|
-
|
|
70
|
-
const t = await d();
|
|
71
|
-
if (!((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)) && !await l(t.compiledHtml, t.css, !1))
|
|
72
|
-
return c(t, { silent: !1, blankCompiled: !0 });
|
|
73
|
-
}, M = async () => {
|
|
74
|
-
r();
|
|
75
|
-
const { html: t, css: e } = await H();
|
|
76
|
-
if (!u(t, !0) || await l(t, e, !0))
|
|
28
|
+
if ((l = s.value) != null && l.externalValidation && !await s.value.externalValidation(t))
|
|
77
29
|
return;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
30
|
+
if (r("allowlistEnabled")) {
|
|
31
|
+
const i = await y(t.compiledHtml, t.css);
|
|
32
|
+
if (i.length) {
|
|
33
|
+
if (!o) {
|
|
34
|
+
const e = await k(i);
|
|
35
|
+
e != null && e.message && V({
|
|
36
|
+
type: P.Warning,
|
|
37
|
+
message: e.message,
|
|
38
|
+
actionButton: e.actionButton
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
90
42
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
43
|
+
}
|
|
44
|
+
if (!await w())
|
|
45
|
+
return;
|
|
46
|
+
const { unsubscribePayload: E, stripoModules: g } = S(t.rawHtml);
|
|
47
|
+
return await b(E), t.modules = g, a || c({ ...t, silent: o }), t;
|
|
93
48
|
};
|
|
94
|
-
return { save: (
|
|
95
|
-
() =>
|
|
96
|
-
)
|
|
49
|
+
return { save: (a = !1, o = !1) => x(
|
|
50
|
+
() => H(a, o)
|
|
51
|
+
) };
|
|
97
52
|
};
|
|
98
53
|
export {
|
|
99
|
-
|
|
54
|
+
rt as useSave
|
|
100
55
|
};
|