@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.
Files changed (61) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +37 -39
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +65 -68
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -10
  6. package/dist/components/organisms/header/EditorActions.vue.js +5 -5
  7. package/dist/components/organisms/header/EditorActions.vue2.js +46 -83
  8. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  9. package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
  10. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  11. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  12. package/dist/composables/useAutoSave.js +44 -46
  13. package/dist/composables/useHtmlCompiler.js +26 -37
  14. package/dist/composables/useHtmlValidator.js +0 -2
  15. package/dist/composables/useSave.js +45 -92
  16. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  17. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  18. package/dist/config/migrator/recommendationMigrator.js +28 -21
  19. package/dist/config/migrator/recommendationPartnerMigrator.js +36 -30
  20. package/dist/guido.css +1 -1
  21. package/dist/src/@types/config/schemas.d.ts +0 -4
  22. package/dist/src/components/Guido.vue.d.ts +1 -17
  23. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  24. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  25. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  26. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  27. package/dist/src/composables/useAutoSave.d.ts +1 -4
  28. package/dist/src/composables/useConfig.d.ts +0 -2
  29. package/dist/src/composables/useGuidoActions.d.ts +2 -0
  30. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  31. package/dist/src/composables/useSave.d.ts +1 -6
  32. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  33. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  34. package/dist/src/mock/cortexChatStore.d.ts +12 -0
  35. package/dist/src/stores/config.d.ts +0 -32
  36. package/dist/src/stores/onboarding.d.ts +4 -0
  37. package/dist/src/stores/recommendation.d.ts +5 -0
  38. package/dist/src/utils/dateUtil.d.ts +10 -0
  39. package/dist/src/utils/genericUtil.d.ts +3 -0
  40. package/dist/src/utils/templatePreparation.d.ts +0 -30
  41. package/dist/static/styles/components/version-history.css.js +2 -6
  42. package/dist/stores/config.js +67 -84
  43. package/dist/stores/onboarding.js +4 -0
  44. package/dist/utils/templatePreparation.js +36 -39
  45. package/package.json +1 -1
  46. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  47. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -50
  48. package/dist/composables/useSaveValidation.js +0 -284
  49. package/dist/composables/useSaveValidationRollout.js +0 -20
  50. package/dist/enums/save-validation.js +0 -4
  51. package/dist/services/settingsApi.js +0 -11
  52. package/dist/src/@types/save-validation.d.ts +0 -19
  53. package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
  54. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  55. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -4
  56. package/dist/src/enums/save-validation.d.ts +0 -27
  57. package/dist/src/services/settingsApi.d.ts +0 -6
  58. package/dist/src/stores/save-validation.d.ts +0 -22
  59. package/dist/src/stores/setup-settings.d.ts +0 -4
  60. package/dist/stores/save-validation.js +0 -30
  61. package/dist/stores/setup-settings.js +0 -10
@@ -1,114 +1,77 @@
1
- import { defineComponent as I, computed as u, ref as c } from "vue";
2
- import { useActionsApi as P } from "../../../composables/useActionsApi.js";
3
- import { useConfig as j } from "../../../composables/useConfig.js";
4
- import { useExport as G } from "../../../composables/useExport.js";
5
- import { useTestEmailClick as J } from "../../../composables/useGuidoActions.js";
6
- import { useHtmlCompiler as K } from "../../../composables/useHtmlCompiler.js";
7
- import { useSave as N } from "../../../composables/useSave.js";
8
- import { useSaveValidation as Q } from "../../../composables/useSaveValidation.js";
9
- import { useSaveValidationRollout as U } from "../../../composables/useSaveValidationRollout.js";
10
- import { useToaster as W } from "../../../composables/useToaster.js";
11
- import { useTranslations as X } from "../../../composables/useTranslations.js";
12
- import { useVersionHistoryApi as Y } from "../../../composables/useVersionHistoryApi.js";
13
- import { useLiquidValidator as Z } from "../../../composables/validators/useLiquidValidator.js";
14
- import { ToasterTypeOptions as $ } from "../../../enums/toaster.js";
15
- import { useEditorStore as tt } from "../../../stores/editor.js";
16
- import { useSaveValidationStore as et } from "../../../stores/save-validation.js";
17
- import { useTemplateStore as ot } from "../../../stores/template.js";
18
- import { getTooltipOptions as rt } from "../../../utils/tooltipUtils.js";
19
- import { InButtonV2 as it } from "@useinsider/design-system-vue";
20
- import { storeToRefs as st } from "pinia";
21
- import at from "./MigrationConfirmModal.vue.js";
22
- const Ot = /* @__PURE__ */ I({
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(nt, { expose: b }) {
25
- const { config: p, isFeatureEnabled: f } = j(), { exportHtml: d } = G(), { save: v } = N(), { validateCurrentTemplate: y } = Q(), { isEnabled: s } = U(), { showToaster: S, hideToaster: g, handleError: i } = W(), { openVersionHistory: h, closeVersionHistory: T } = Y(), { getCompiledEmail: V } = P(), { compileHtml: E } = K(), { validateLiquidSyntax: H } = Z(), e = tt(), w = et(), x = ot(), { hasMigrations: C } = st(x), r = X(), k = u(() => s.value ? r("email-editor.save-and-continue") : "Save"), a = c(!1), n = c(!1), _ = c(), l = J(), q = () => {
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
- T();
23
+ f();
28
24
  return;
29
25
  }
30
- h();
31
- }, B = async () => {
32
- a.value = !0, await d(), a.value = !1;
33
- }, L = () => {
26
+ u();
27
+ }, C = async () => {
28
+ i.value = !0, await c(), i.value = !1;
29
+ }, A = () => {
34
30
  e.isSaveAsTemplateDrawerOpen = !0;
35
- }, R = u(() => e.isVersionHistoryOpen ? r("newsletter.close-version-history") : r("newsletter.version-history")), D = u(
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 = p.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
34
+ return ((o = (t = l.value) == null ? void 0 : t.features) == null ? void 0 : o.versionHistory) && !e.isPreviewModeOpen;
39
35
  }
40
- ), A = async (t) => {
41
- n.value = !0, t || (e.loadingStatus = !0);
36
+ ), V = async (t) => {
37
+ a.value = !0, t || (e.loadingStatus = !0);
42
38
  let o;
43
39
  try {
44
- o = await v(t);
45
- } catch (M) {
46
- i(M, "Failed to save template");
40
+ o = await p(t);
41
+ } catch (T) {
42
+ r(T, "Failed to save template");
47
43
  } finally {
48
- n.value = !1, !t && !o && (e.loadingStatus = !1);
44
+ a.value = !1, !t && !o && (e.loadingStatus = !1);
49
45
  }
50
46
  return o;
51
- }, O = (t) => {
47
+ }, E = (t) => {
52
48
  var o;
53
- if (!t && C.value) {
54
- (o = _.value) == null || o.open();
49
+ if (!t && S.value) {
50
+ (o = H.value) == null || o.open();
55
51
  return;
56
52
  }
57
- return A(t);
58
- }, m = async () => {
59
- e.loadingStatus = !0;
60
- try {
61
- return await y();
62
- } catch (t) {
63
- return i(t, "Failed to prepare test email"), null;
64
- } finally {
65
- e.loadingStatus = !1;
66
- }
53
+ return V(t);
67
54
  }, F = async () => {
68
- const t = await m();
69
- t != null && t.length ? w.open(t, "test") : t && g();
70
- }, z = async () => {
71
- if (s.value) {
72
- const t = await m();
73
- if (!t)
74
- return;
75
- if (t.length) {
76
- S({
77
- type: $.Error,
78
- message: r("email-editor.validation-errors-found"),
79
- actionButton: {
80
- text: r("email-editor.check-errors"),
81
- onClick: () => {
82
- F();
83
- }
84
- },
85
- autoHide: !1
86
- });
87
- return;
88
- }
89
- l();
90
- return;
91
- }
92
- if (f("liquidSyntax")) {
55
+ if (m("liquidSyntax")) {
93
56
  e.loadingStatus = !0;
94
57
  try {
95
- const { html: t } = await V({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: o } = E(t);
96
- if (!await H(o))
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
- i(t, "Failed to prepare test email");
62
+ r(t, "Failed to prepare test email");
100
63
  return;
101
64
  } finally {
102
65
  e.loadingStatus = !1;
103
66
  }
104
67
  }
105
- l();
68
+ h();
106
69
  };
107
- return b({
108
- handleSave: O
109
- }), { __sfc: !0, config: p, isFeatureEnabled: f, exportHtml: d, save: v, validateCurrentTemplate: y, isEnabled: s, showToaster: S, hideToaster: g, handleError: i, openVersionHistory: h, closeVersionHistory: T, getCompiledEmail: V, compileHtml: E, validateLiquidSyntax: H, editorStore: e, saveValidationStore: w, templateStore: x, hasMigrations: C, trans: r, saveLabel: k, isExporting: a, isSaving: n, migrationModalRef: _, testEmailClick: l, handleVersionHistory: q, handleExport: B, handleSaveAs: L, versionHistoryTooltipText: R, isVersionHistoryButtonVisible: D, executeSave: A, handleSave: O, collectTestErrors: m, openTestErrors: F, handleTestEmail: z, getTooltipOptions: rt, InButtonV2: it, MigrationConfirmModal: at };
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
- Ot as default
76
+ ft as default
114
77
  };
@@ -1,16 +1,16 @@
1
1
  import o from "./LeftSlot.vue2.js";
2
2
  /* empty css */
3
- import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var a = function() {
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__ */ n(
7
+ }, i = [], r = /* @__PURE__ */ a(
8
8
  o,
9
- a,
9
+ n,
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "b8f24f34"
13
+ "73199fa4"
14
14
  );
15
15
  const f = r.exports;
16
16
  export {
@@ -1,19 +1,19 @@
1
- import { defineComponent as m, computed as p, ref as d } from "vue";
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 y } from "../../../stores/editor.js";
7
+ import { useEditorStore as V } from "../../../stores/editor.js";
8
8
  import { InButtonV2 as w } from "@useinsider/design-system-vue";
9
- import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.js";
10
- const D = /* @__PURE__ */ m({
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 = 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 = () => {
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
- }, c = V(async () => {
27
- try {
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: l, isBackButtonDisabled: r, executeBackAction: a, debouncedBackAction: c, handleBackClick: () => {
34
- r.value = !0, c();
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, 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) {
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(n) {
7
+ }, onCloseEvent: function(o) {
8
8
  return e.emit("onCloseEvent");
9
- }, primaryButtonEvent: function(n) {
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 [o("div", [t._t("default")], 2)];
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 p = c.exports;
24
+ const f = c.exports;
27
25
  export {
28
- p as default
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", "secondaryButtonEvent"],
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 p } from "./useConfig.js";
2
- import { useEditorLock as y } from "./useEditorLock.js";
3
- import { useAutosaveStore as I, AUTOSAVE_STATUS as a } from "../stores/autosave.js";
4
- import { useEditorStore as L } from "../stores/editor.js";
5
- import { computed as w, watch as V, onUnmounted as k } from "vue";
6
- const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
7
- const { isFeatureEnabled: m } = p(), s = L(), t = I(), { isEditorBusy: f } = y();
8
- let o = null, l = 0, u = -1;
9
- const d = w(
10
- () => m("autosave") && t.isOn
11
- ), A = () => s.hasChanges && s.isInSaveableState && s.changeSeq !== u, E = () => ({
12
- hasChanges: s.hasChanges,
13
- isInSaveableState: s.isInSaveableState,
14
- isUnchangedSinceLastSave: s.changeSeq === u
15
- }), r = async (e) => {
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 (!A()) {
21
- console.debug("guido:autosave:skipped", { trigger: e, reason: "gates-blocked", gates: E() });
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 === a.SAVING) {
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 (f()) {
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 = a.SAVING, e === "visibility" && (l = Date.now());
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 g() === void 0) {
36
- console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = a.ERROR;
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
- u = n, h() && (s.hasChanges = !1), t.status = a.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
40
- } catch (S) {
41
- console.debug("guido:autosave:error", { trigger: e, error: S }), t.status = a.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
- }, i = () => {
41
+ }, n = () => {
44
42
  const { visibilityState: e } = document;
45
43
  if (console.debug("guido:autosave:visibility-change", {
46
44
  visibilityState: e,
47
- isActive: d.value
45
+ isActive: u.value
48
46
  }), e !== "hidden")
49
47
  return;
50
- const n = Date.now() - l;
51
- if (n < b) {
48
+ const a = Date.now() - c;
49
+ if (a < v) {
52
50
  console.debug("guido:autosave:visibility-debounced", {
53
- sinceLastMs: n,
54
- debounceMs: b
51
+ sinceLastMs: a,
52
+ debounceMs: v
55
53
  });
56
54
  return;
57
55
  }
58
- r("visibility");
59
- }, c = () => {
60
- o && (clearInterval(o), o = null);
61
- }, v = () => {
62
- document.removeEventListener("visibilitychange", i), window.removeEventListener("pagehide", i);
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
- V(
65
- d,
62
+ I(
63
+ u,
66
64
  (e) => {
67
- console.debug("guido:autosave:active-changed", { active: e }), e ? (c(), o = setInterval(() => {
68
- console.debug("guido:autosave:interval-tick"), r("interval");
69
- }, D), document.addEventListener("visibilitychange", i), window.addEventListener("pagehide", i)) : (c(), v(), t.status = a.IDLE);
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
- ), k(() => {
73
- c(), v(), t.status = a.IDLE, t.lastSavedAt = null;
70
+ ), L(() => {
71
+ d(), r(), t.status = s.IDLE, t.lastSavedAt = null;
74
72
  });
75
73
  };
76
74
  export {
77
- _ as useAutoSave
75
+ R as useAutoSave
78
76
  };
@@ -1,14 +1,13 @@
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";
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 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([
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
- ]), 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) };
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
- I as useHtmlCompiler
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
  };