@useinsider/guido 3.19.0-beta.cd75ff0 → 3.19.0-beta.cf43946
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 +37 -39
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +65 -68
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -10
- package/dist/components/organisms/header/EditorActions.vue.js +5 -5
- package/dist/components/organisms/header/EditorActions.vue2.js +46 -83
- 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/useAutoSave.js +44 -46
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useSave.js +45 -92
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/config/migrator/recommendationMigrator.js +28 -21
- package/dist/config/migrator/recommendationPartnerMigrator.js +36 -30
- package/dist/guido.css +1 -1
- 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/useAutoSave.d.ts +1 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- 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/mock/cortexChatStore.d.ts +12 -0
- package/dist/src/stores/config.d.ts +0 -32
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/recommendation.d.ts +5 -0
- package/dist/src/utils/dateUtil.d.ts +10 -0
- package/dist/src/utils/genericUtil.d.ts +3 -0
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/static/styles/components/version-history.css.js +2 -6
- package/dist/stores/config.js +67 -84
- package/dist/stores/onboarding.js +4 -0
- package/dist/utils/templatePreparation.js +36 -39
- package/package.json +1 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -50
- package/dist/composables/useSaveValidation.js +0 -284
- package/dist/composables/useSaveValidationRollout.js +0 -20
- package/dist/enums/save-validation.js +0 -4
- package/dist/services/settingsApi.js +0 -11
- 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 -4
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/services/settingsApi.d.ts +0 -6
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/src/stores/setup-settings.d.ts +0 -4
- package/dist/stores/save-validation.js +0 -30
- package/dist/stores/setup-settings.js +0 -10
|
@@ -1,114 +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
|
-
import
|
|
18
|
-
|
|
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({
|
|
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({
|
|
23
19
|
__name: "EditorActions",
|
|
24
|
-
setup(
|
|
25
|
-
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(), _ = () => {
|
|
26
22
|
if (e.isVersionHistoryOpen) {
|
|
27
|
-
|
|
23
|
+
f();
|
|
28
24
|
return;
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
},
|
|
26
|
+
u();
|
|
27
|
+
}, C = async () => {
|
|
28
|
+
i.value = !0, await c(), i.value = !1;
|
|
29
|
+
}, A = () => {
|
|
34
30
|
e.isSaveAsTemplateDrawerOpen = !0;
|
|
35
|
-
},
|
|
31
|
+
}, M = x(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), O = x(
|
|
36
32
|
() => {
|
|
37
33
|
var t, o;
|
|
38
|
-
return ((o = (t =
|
|
34
|
+
return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
|
|
39
35
|
}
|
|
40
|
-
),
|
|
41
|
-
|
|
36
|
+
), V = async (t) => {
|
|
37
|
+
a.value = !0, t || (e.loadingStatus = !0);
|
|
42
38
|
let o;
|
|
43
39
|
try {
|
|
44
|
-
o = await
|
|
45
|
-
} catch (
|
|
46
|
-
|
|
40
|
+
o = await p(t);
|
|
41
|
+
} catch (T) {
|
|
42
|
+
r(T, "Failed to save template");
|
|
47
43
|
} finally {
|
|
48
|
-
|
|
44
|
+
a.value = !1, !t && !o && (e.loadingStatus = !1);
|
|
49
45
|
}
|
|
50
46
|
return o;
|
|
51
|
-
},
|
|
47
|
+
}, E = (t) => {
|
|
52
48
|
var o;
|
|
53
|
-
if (!t &&
|
|
54
|
-
(o =
|
|
49
|
+
if (!t && S.value) {
|
|
50
|
+
(o = H.value) == null || o.open();
|
|
55
51
|
return;
|
|
56
52
|
}
|
|
57
|
-
return
|
|
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
|
-
}
|
|
53
|
+
return V(t);
|
|
67
54
|
}, F = async () => {
|
|
68
|
-
|
|
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")) {
|
|
55
|
+
if (m("liquidSyntax")) {
|
|
93
56
|
e.loadingStatus = !0;
|
|
94
57
|
try {
|
|
95
|
-
const { html: t } = await
|
|
96
|
-
if (!await
|
|
58
|
+
const { html: t } = await d({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = v(t);
|
|
59
|
+
if (!await y(o))
|
|
97
60
|
return;
|
|
98
61
|
} catch (t) {
|
|
99
|
-
|
|
62
|
+
r(t, "Failed to prepare test email");
|
|
100
63
|
return;
|
|
101
64
|
} finally {
|
|
102
65
|
e.loadingStatus = !1;
|
|
103
66
|
}
|
|
104
67
|
}
|
|
105
|
-
|
|
68
|
+
h();
|
|
106
69
|
};
|
|
107
|
-
return
|
|
108
|
-
handleSave:
|
|
109
|
-
}), { __sfc: !0, config:
|
|
70
|
+
return w({
|
|
71
|
+
handleSave: E
|
|
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 };
|
|
110
73
|
}
|
|
111
74
|
});
|
|
112
75
|
export {
|
|
113
|
-
|
|
76
|
+
ft as default
|
|
114
77
|
};
|
|
@@ -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,78 +1,76 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { useEditorLock as
|
|
3
|
-
import { useAutosaveStore as
|
|
4
|
-
import { useEditorStore as
|
|
5
|
-
import { computed as
|
|
6
|
-
const
|
|
7
|
-
const { isFeatureEnabled:
|
|
8
|
-
let
|
|
9
|
-
const
|
|
10
|
-
() =>
|
|
11
|
-
),
|
|
12
|
-
hasChanges:
|
|
13
|
-
isInSaveableState:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (!d.value) {
|
|
1
|
+
import { useConfig as E } from "./useConfig.js";
|
|
2
|
+
import { useEditorLock as f } from "./useEditorLock.js";
|
|
3
|
+
import { useAutosaveStore as p, AUTOSAVE_STATUS as s } from "../stores/autosave.js";
|
|
4
|
+
import { useEditorStore as A } from "../stores/editor.js";
|
|
5
|
+
import { computed as y, watch as I, onUnmounted as L } from "vue";
|
|
6
|
+
const w = 18e4, v = 6e4, R = (b) => {
|
|
7
|
+
const { isFeatureEnabled: S } = E(), o = A(), t = p(), { isEditorBusy: g } = f();
|
|
8
|
+
let i = null, c = 0;
|
|
9
|
+
const u = y(
|
|
10
|
+
() => S("autosave") && t.isOn
|
|
11
|
+
), m = () => o.hasChanges && o.isInSaveableState, h = () => ({
|
|
12
|
+
hasChanges: o.hasChanges,
|
|
13
|
+
isInSaveableState: o.isInSaveableState
|
|
14
|
+
}), l = async (e) => {
|
|
15
|
+
if (!u.value) {
|
|
17
16
|
console.debug("guido:autosave:skipped", { trigger: e, reason: "not-active" });
|
|
18
17
|
return;
|
|
19
18
|
}
|
|
20
|
-
if (!
|
|
21
|
-
console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates:
|
|
19
|
+
if (!m()) {
|
|
20
|
+
console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: h() });
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
24
|
-
if (t.status ===
|
|
23
|
+
if (t.status === s.SAVING) {
|
|
25
24
|
console.debug("guido:autosave:skipped", { trigger: e, reason: "already-saving" });
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
|
-
if (
|
|
27
|
+
if (g()) {
|
|
29
28
|
console.debug("guido:autosave:skipped", { trigger: e, reason: "editor-busy" });
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
|
-
console.debug("guido:autosave:save-start", { trigger: e }), t.status =
|
|
33
|
-
const n = s.changeSeq;
|
|
31
|
+
e === "visibility" && (c = Date.now()), console.debug("guido:autosave:save-start", { trigger: e }), t.status = s.SAVING;
|
|
34
32
|
try {
|
|
35
|
-
if (await
|
|
36
|
-
console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status =
|
|
33
|
+
if (await b() === void 0) {
|
|
34
|
+
console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = s.ERROR;
|
|
37
35
|
return;
|
|
38
36
|
}
|
|
39
|
-
|
|
40
|
-
} catch (
|
|
41
|
-
console.debug("guido:autosave:error", { trigger: e, error:
|
|
37
|
+
o.hasChanges = !1, t.status = s.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
|
|
38
|
+
} catch (a) {
|
|
39
|
+
console.debug("guido:autosave:error", { trigger: e, error: a }), t.status = s.ERROR;
|
|
42
40
|
}
|
|
43
|
-
},
|
|
41
|
+
}, n = () => {
|
|
44
42
|
const { visibilityState: e } = document;
|
|
45
43
|
if (console.debug("guido:autosave:visibility-change", {
|
|
46
44
|
visibilityState: e,
|
|
47
|
-
isActive:
|
|
45
|
+
isActive: u.value
|
|
48
46
|
}), e !== "hidden")
|
|
49
47
|
return;
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
48
|
+
const a = Date.now() - c;
|
|
49
|
+
if (a < v) {
|
|
52
50
|
console.debug("guido:autosave:visibility-debounced", {
|
|
53
|
-
sinceLastMs:
|
|
54
|
-
debounceMs:
|
|
51
|
+
sinceLastMs: a,
|
|
52
|
+
debounceMs: v
|
|
55
53
|
});
|
|
56
54
|
return;
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
document.removeEventListener("visibilitychange",
|
|
56
|
+
l("visibility");
|
|
57
|
+
}, d = () => {
|
|
58
|
+
i && (clearInterval(i), i = null);
|
|
59
|
+
}, r = () => {
|
|
60
|
+
document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
|
|
63
61
|
};
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
I(
|
|
63
|
+
u,
|
|
66
64
|
(e) => {
|
|
67
|
-
console.debug("guido:autosave:active-changed", { active: e }), e ? (
|
|
68
|
-
console.debug("guido:autosave:interval-tick"),
|
|
69
|
-
},
|
|
65
|
+
console.debug("guido:autosave:active-changed", { active: e }), e ? (d(), i = setInterval(() => {
|
|
66
|
+
console.debug("guido:autosave:interval-tick"), l("interval");
|
|
67
|
+
}, w), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (d(), r(), t.status = s.IDLE);
|
|
70
68
|
},
|
|
71
69
|
{ immediate: !0 }
|
|
72
|
-
),
|
|
73
|
-
|
|
70
|
+
), L(() => {
|
|
71
|
+
d(), r(), t.status = s.IDLE, t.lastSavedAt = null;
|
|
74
72
|
});
|
|
75
73
|
};
|
|
76
74
|
export {
|
|
77
|
-
|
|
75
|
+
R as useAutoSave
|
|
78
76
|
};
|
|
@@ -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
|
};
|
|
@@ -226,8 +226,6 @@ const ke = () => {
|
|
|
226
226
|
export {
|
|
227
227
|
ge as buildPartnerAttributeNameSet,
|
|
228
228
|
pe as findInvalidCustomFields,
|
|
229
|
-
Ee as getInvalidDynamicContentTags,
|
|
230
|
-
me as getRecommendationBlockIds,
|
|
231
229
|
fe as parseRecommendationVariable,
|
|
232
230
|
ke as useHtmlValidator
|
|
233
231
|
};
|