@useinsider/guido 3.18.2-beta.ec25841 → 3.18.2-beta.eedafd2

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 (81) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +28 -26
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +72 -70
  5. package/dist/components/organisms/AutoSaveController.vue2.js +9 -8
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +11 -13
  7. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +52 -70
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +37 -23
  9. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  10. package/dist/components/organisms/header/EditorActions.vue2.js +86 -56
  11. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  12. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -12
  13. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -20
  14. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +34 -34
  15. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +20 -0
  16. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +48 -0
  17. package/dist/components/wrappers/WpDrawer.vue.js +9 -7
  18. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  19. package/dist/composables/useCustomInterfaceAppearance.js +46 -56
  20. package/dist/composables/useHtmlCompiler.js +37 -26
  21. package/dist/composables/useHtmlValidator.js +81 -84
  22. package/dist/composables/useHttp.js +24 -22
  23. package/dist/composables/useRecommendation.js +35 -40
  24. package/dist/composables/useSave.js +90 -45
  25. package/dist/composables/useSaveValidation.js +279 -0
  26. package/dist/composables/useSaveValidationRollout.js +9 -0
  27. package/dist/composables/useStripo.js +30 -30
  28. package/dist/composables/validators/useCouponBlockValidator.js +24 -21
  29. package/dist/composables/validators/useUnsubscribeBlockValidator.js +34 -27
  30. package/dist/enums/extensions/recommendationBlock.js +31 -38
  31. package/dist/enums/save-validation.js +4 -0
  32. package/dist/extensions/Blocks/Recommendation/block.js +39 -43
  33. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +20 -21
  34. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +33 -38
  35. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -84
  36. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +78 -168
  37. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +12 -21
  38. package/dist/guido.css +1 -1
  39. package/dist/services/templateLibraryApi.js +17 -14
  40. package/dist/src/@types/config/schemas.d.ts +4 -0
  41. package/dist/src/@types/save-validation.d.ts +19 -0
  42. package/dist/src/components/Guido.vue.d.ts +17 -1
  43. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +17 -1
  44. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +17 -1
  45. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +17 -1
  46. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +4 -3
  47. package/dist/src/composables/useConfig.d.ts +2 -0
  48. package/dist/src/composables/useHtmlValidator.d.ts +21 -0
  49. package/dist/src/composables/useSave.d.ts +6 -1
  50. package/dist/src/composables/useSaveValidation.d.ts +6 -0
  51. package/dist/src/composables/useSaveValidationRollout.d.ts +3 -0
  52. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  53. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +10 -0
  54. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  55. package/dist/src/enums/save-validation.d.ts +27 -0
  56. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -1
  57. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
  58. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -2
  59. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -9
  60. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +3 -73
  61. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +0 -4
  62. package/dist/src/stores/config.d.ts +30 -0
  63. package/dist/src/stores/onboarding.d.ts +0 -377
  64. package/dist/src/stores/save-validation.d.ts +22 -0
  65. package/dist/src/utils/genericUtil.d.ts +6 -0
  66. package/dist/src/utils/liquidDynamicContent.d.ts +20 -0
  67. package/dist/src/utils/templatePreparation.d.ts +30 -0
  68. package/dist/static/styles/components/recommendation-strategy.css.js +4 -34
  69. package/dist/stores/config.js +39 -22
  70. package/dist/stores/onboarding.js +36 -41
  71. package/dist/stores/save-validation.js +30 -0
  72. package/dist/utils/genericUtil.js +63 -54
  73. package/dist/utils/liquidDynamicContent.js +15 -0
  74. package/dist/utils/templatePreparation.js +63 -59
  75. package/package.json +1 -1
  76. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  77. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -47
  78. package/dist/extensions/Blocks/Recommendation/utils/strategyDetach.js +0 -19
  79. package/dist/src/extensions/Blocks/Recommendation/utils/strategyDetach.d.ts +0 -12
  80. package/dist/static/styles/components/skeleton.css.js +0 -23
  81. /package/dist/src/components/organisms/{onboarding/RecommendationStrategyOnboarding.vue.d.ts → validation/ValidationErrorDrawer.vue.d.ts} +0 -0
@@ -1,64 +1,64 @@
1
- import { defineComponent as A, ref as c, computed as b, toRef as h, nextTick as C } from "vue";
2
- import N from "../../wrappers/WpDrawer.vue.js";
3
- import { useTranslations as O } from "../../../composables/useTranslations.js";
1
+ import { defineComponent as _, ref as c, computed as h, watch as C, toRef as N, nextTick as O } from "vue";
2
+ import b from "../../wrappers/WpDrawer.vue.js";
3
+ import { useTranslations as D } from "../../../composables/useTranslations.js";
4
4
  import { useTemplateNameValidator as x } from "../../../composables/validators/saveAsTemplate.js";
5
5
  import { useTemplateLibraryApi as B } from "../../../services/templateLibraryApi.js";
6
- import { useEditorStore as D } from "../../../stores/editor.js";
7
- import { useSaveAsTemplateStore as k } from "../../../stores/save-as-template.js";
8
- import { InMultiSelect as I, InBasicTextInput as M } from "@useinsider/design-system-vue";
9
- import { useDebounceFn as V } from "../../../node_modules/@vueuse/shared/index.js";
10
- const H = /* @__PURE__ */ A({
6
+ import { useEditorStore as k } from "../../../stores/editor.js";
7
+ import { useSaveAsTemplateStore as I } from "../../../stores/save-as-template.js";
8
+ import { InMultiSelect as M, InBasicTextInput as V } from "@useinsider/design-system-vue";
9
+ import { useDebounceFn as E } from "../../../node_modules/@vueuse/shared/index.js";
10
+ const J = /* @__PURE__ */ _({
11
11
  __name: "SaveAsTemplateDrawer",
12
- setup(E) {
13
- const o = O(), n = D(), t = k(), { createTemplate: m } = B(), a = c(!1), r = c(!1), l = c(""), f = b(() => ({
12
+ setup(R) {
13
+ const s = D(), o = k(), t = I(), { createTemplate: m } = B(), a = c(!1), n = c(!1), r = c(""), f = h(() => ({
14
14
  primaryButton: {
15
15
  styling: "solid",
16
16
  type: "primary",
17
- labelText: o(a.value ? "newsletter.saving" : "products.save"),
17
+ labelText: s(a.value ? "newsletter.saving" : "products.save"),
18
18
  loadingStatus: a.value,
19
19
  disabledStatus: t.skeletonStatus
20
20
  },
21
21
  cancelOrBackButton: {
22
22
  styling: "ghost",
23
23
  type: "secondary",
24
- labelText: o("products.cancel"),
24
+ labelText: s("products.cancel"),
25
25
  disabledStatus: a.value
26
26
  }
27
- })), u = () => {
28
- l.value = "", n.isSaveAsTemplateDrawerOpen = !1;
29
- }, i = async () => {
30
- const e = h(t, "templateName"), { success: s, errorMessage: _ } = await x(e).validate();
31
- return l.value = _, s;
32
- }, v = V(async (e) => {
33
- t.templateName = e, await i();
34
- }, 500), g = async (e) => {
35
- r.value = !0, await t.addCategory(e), r.value = !1;
36
- }, y = (e) => {
27
+ })), p = () => {
28
+ r.value = "", o.isSaveAsTemplateDrawerOpen = !1;
29
+ }, l = async () => {
30
+ const e = N(t, "templateName"), { success: i, errorMessage: A } = await x(e).validate();
31
+ return r.value = A, i;
32
+ }, v = E(async (e) => {
33
+ t.templateName = e, await l();
34
+ }, 500), S = async (e) => {
35
+ n.value = !0, await t.addCategory(e), n.value = !1;
36
+ }, T = (e) => {
37
37
  t.selectedCategories = e;
38
- }, S = (e) => {
38
+ }, g = (e) => {
39
39
  e && (t.selectedCategories = e);
40
- }, T = () => {
40
+ }, y = () => {
41
41
  t.selectedCategories = [];
42
42
  }, w = async () => {
43
- if (a.value = !0, !await i()) {
43
+ if (a.value = !0, !await l()) {
44
44
  a.value = !1;
45
45
  return;
46
46
  }
47
- const s = await m();
48
- a.value = !1, s && u();
49
- }, p = () => {
50
- C(() => {
47
+ const i = await m();
48
+ a.value = !1, i && p();
49
+ }, u = () => {
50
+ O(() => {
51
51
  const e = document.querySelector("input#guido__template-name-input");
52
52
  e == null || e.focus();
53
53
  });
54
54
  }, d = async () => {
55
- t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, p();
55
+ t.$reset(), await t.fetchCategories(), t.skeletonStatus = !1, u();
56
56
  };
57
- return n.$subscribe((e, { isSaveAsTemplateDrawerOpen: s }) => {
58
- s && d();
59
- }), { __sfc: !0, trans: o, editorStore: n, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: r, templateNameError: l, footerButtonGroupOptions: f, closeModal: u, validateTemplateName: i, handleTemplateName: v, handleAddOption: g, handleCategoryChange: y, handleSelectAllOptions: S, handleResetAllOptions: T, saveTemplate: w, focusToInput: p, initializeDrawer: d, WpDrawer: N, InBasicTextInput: M, InMultiSelect: I };
57
+ return C(() => o.isSaveAsTemplateDrawerOpen, (e) => {
58
+ e && d();
59
+ }), { __sfc: !0, trans: s, editorStore: o, saveAsTemplateStore: t, createTemplate: m, isSaving: a, isAddingOption: n, templateNameError: r, footerButtonGroupOptions: f, closeModal: p, validateTemplateName: l, handleTemplateName: v, handleAddOption: S, handleCategoryChange: T, handleSelectAllOptions: g, handleResetAllOptions: y, saveTemplate: w, focusToInput: u, initializeDrawer: d, WpDrawer: b, InBasicTextInput: V, InMultiSelect: M };
60
60
  }
61
61
  });
62
62
  export {
63
- H as default
63
+ J as default
64
64
  };
@@ -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, 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) {
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(o) {
7
+ }, onCloseEvent: function(n) {
8
8
  return e.emit("onCloseEvent");
9
- }, primaryButtonEvent: function(o) {
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 [n("div", [t._t("default")], 2)];
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 f = c.exports;
26
+ const p = c.exports;
25
27
  export {
26
- f as default
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,77 +1,67 @@
1
- import p from "../static/assets/icons/line-change.svg.js";
2
- import s from "../static/assets/icons/line-delete.svg.js";
3
- import a from "../static/assets/icons/line-plus.svg.js";
4
- import f from "../static/styles/base.css.js";
5
- import C from "../static/styles/components/alert-message.css.js";
6
- import c from "../static/styles/components/amp-block.css.js";
7
- import l from "../static/styles/components/base-input.css.js";
8
- import d from "../static/styles/components/button-group.css.js";
9
- import u from "../static/styles/components/button.css.js";
10
- import h from "../static/styles/components/combobox.css.js";
11
- import g from "../static/styles/components/counter.css.js";
12
- import w from "../static/styles/components/dropdown-menu.css.js";
13
- import y from "../static/styles/components/loader.css.js";
14
- import I from "../static/styles/components/narrow-panel.css.js";
15
- import A from "../static/styles/components/popup.css.js";
16
- import b from "../static/styles/components/recommendation-strategy.css.js";
17
- import B from "../static/styles/components/skeleton.css.js";
18
- import D from "../static/styles/components/switcher.css.js";
19
- import $ from "../static/styles/components/tabs.css.js";
20
- import P from "../static/styles/components/tools.css.js";
21
- import R from "../static/styles/components/version-history.css.js";
22
- import T from "../static/styles/components/wide-panel.css.js";
1
+ import S from "../static/assets/icons/line-change.svg.js";
2
+ import i from "../static/assets/icons/line-delete.svg.js";
3
+ import n from "../static/assets/icons/line-plus.svg.js";
4
+ import p from "../static/styles/base.css.js";
5
+ import s from "../static/styles/components/alert-message.css.js";
6
+ import C from "../static/styles/components/amp-block.css.js";
7
+ import a from "../static/styles/components/base-input.css.js";
8
+ import f from "../static/styles/components/button-group.css.js";
9
+ import c from "../static/styles/components/button.css.js";
10
+ import u from "../static/styles/components/combobox.css.js";
11
+ import l from "../static/styles/components/counter.css.js";
12
+ import d from "../static/styles/components/dropdown-menu.css.js";
13
+ import h from "../static/styles/components/loader.css.js";
14
+ import g from "../static/styles/components/narrow-panel.css.js";
15
+ import I from "../static/styles/components/popup.css.js";
16
+ import w from "../static/styles/components/recommendation-strategy.css.js";
17
+ import y from "../static/styles/components/switcher.css.js";
18
+ import b from "../static/styles/components/tabs.css.js";
19
+ import B from "../static/styles/components/tools.css.js";
20
+ import $ from "../static/styles/components/version-history.css.js";
21
+ import P from "../static/styles/components/wide-panel.css.js";
23
22
  import x from "../static/styles/variables.css.js";
24
- function r(S, o) {
25
- return `--guido-icon-${S}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
23
+ function r(t, o) {
24
+ return `--guido-icon-${t}: url("data:image/svg+xml,${encodeURIComponent(o.trim())}");`;
26
25
  }
27
- const M = `:host {
28
- ${r("line-change", p)}
29
- ${r("line-delete", s)}
30
- ${r("line-plus", a)}
31
- }`, O = [
26
+ const A = `:host {
27
+ ${r("line-change", S)}
28
+ ${r("line-delete", i)}
29
+ ${r("line-plus", n)}
30
+ }`, R = [
32
31
  x,
33
32
  // Must be on top
34
- M,
35
- f,
33
+ A,
34
+ p,
36
35
  // Must be on top
36
+ s,
37
37
  C,
38
+ a,
39
+ f,
38
40
  c,
41
+ u,
39
42
  l,
40
43
  d,
41
- u,
42
44
  h,
43
45
  g,
44
- w,
45
- y,
46
46
  I,
47
- A,
47
+ y,
48
+ b,
48
49
  B,
49
- D,
50
50
  $,
51
51
  P,
52
- R,
53
- T,
54
- b
52
+ w
55
53
  // Last: overrides button.css / wide-panel.css defaults
56
54
  ].join(`
57
55
 
58
- `), V = 3e4;
59
- let e = null;
60
- function W() {
61
- return e || (e = new CSSStyleSheet(), e.replaceSync(O)), e;
62
- }
63
- const So = () => ({ importCss: () => {
64
- const o = W(), i = Date.now() + V, m = () => {
65
- var n;
66
- const t = (n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot;
67
- if (t) {
68
- t.adoptedStyleSheets.includes(o) || (t.adoptedStyleSheets = [...t.adoptedStyleSheets, o]);
69
- return;
70
- }
71
- Date.now() < i && requestAnimationFrame(m);
72
- };
73
- m();
56
+ `), Y = () => ({ importCss: () => {
57
+ const o = new CSSStyleSheet();
58
+ o.replaceSync(R);
59
+ const e = document.querySelector("ui-editor");
60
+ if (!e)
61
+ return;
62
+ const m = e.shadowRoot;
63
+ m && (m.adoptedStyleSheets = [o]);
74
64
  } });
75
65
  export {
76
- So as useCustomInterfaceAppearance
66
+ Y as useCustomInterfaceAppearance
77
67
  };
@@ -1,13 +1,14 @@
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";
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 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([
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
- ]), 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) };
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
- M as useHtmlCompiler
63
+ I as useHtmlCompiler
53
64
  };