@useinsider/guido 3.11.0 → 3.12.0-beta.1b68f97

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 (66) hide show
  1. package/README.md +33 -0
  2. package/dist/@types/config/schemas.js +131 -98
  3. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +1 -1
  4. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +8 -8
  5. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
  6. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +10 -10
  7. package/dist/components/organisms/header/EditorActions.vue.js +1 -1
  8. package/dist/components/organisms/header/HeaderWrapper.vue.js +3 -3
  9. package/dist/components/organisms/header/HeaderWrapper.vue2.js +2 -0
  10. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +1 -1
  11. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +11 -10
  12. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +1 -1
  13. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
  14. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +20 -23
  15. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +3 -3
  16. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +8 -7
  17. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
  18. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +2 -2
  19. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
  20. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +9 -9
  21. package/dist/composables/useModuleDynamicContentRepair.js +37 -0
  22. package/dist/composables/usePreviewInteractionGuard.js +36 -11
  23. package/dist/composables/useRecommendationPreview.js +61 -60
  24. package/dist/composables/useSave.js +43 -24
  25. package/dist/composables/useStripo.js +70 -67
  26. package/dist/composables/validators/useAllowlistValidator.js +31 -0
  27. package/dist/config/migrator/index.js +7 -6
  28. package/dist/config/migrator/socialIconMigrator.js +29 -0
  29. package/dist/enums/academy.js +1 -1
  30. package/dist/enums/date.js +3 -4
  31. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +43 -41
  32. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  33. package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +10 -0
  34. package/dist/extensions/Blocks/Recommendation/extension.js +23 -21
  35. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +41 -40
  36. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -2
  37. package/dist/extensions/Blocks/controlFactories.js +125 -75
  38. package/dist/guido.css +1 -1
  39. package/dist/node_modules/valibot/dist/index.js +148 -112
  40. package/dist/src/@types/config/schemas.d.ts +59 -0
  41. package/dist/src/@types/generic.d.ts +18 -0
  42. package/dist/src/composables/useConfig.d.ts +10 -0
  43. package/dist/src/composables/useModuleDynamicContentRepair.d.ts +18 -0
  44. package/dist/src/composables/usePreviewInteractionGuard.d.ts +1 -1
  45. package/dist/src/composables/validators/useAllowlistValidator.d.ts +9 -0
  46. package/dist/src/config/migrator/socialIconMigrator.d.ts +1 -0
  47. package/dist/src/enums/academy.d.ts +3 -3
  48. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +1 -0
  49. package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +14 -0
  50. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  51. package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
  52. package/dist/src/extensions/Blocks/controlFactories.d.ts +36 -0
  53. package/dist/src/library.d.ts +1 -1
  54. package/dist/src/stores/config.d.ts +90 -0
  55. package/dist/src/utils/dynamicContentConverter.d.ts +27 -0
  56. package/dist/src/utils/environmentUtil.d.ts +5 -2
  57. package/dist/src/utils/genericUtil.d.ts +18 -1
  58. package/dist/src/utils/urlSchemes.d.ts +6 -0
  59. package/dist/utils/dateUtil.js +10 -23
  60. package/dist/utils/dynamicContentConverter.js +31 -0
  61. package/dist/utils/environmentUtil.js +3 -2
  62. package/dist/utils/genericUtil.js +42 -21
  63. package/dist/utils/urlSchemes.js +4 -0
  64. package/package.json +10 -1
  65. package/dist/src/composables/useHtmlValidator.test.d.ts +0 -1
  66. package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +0 -1
@@ -1,20 +1,21 @@
1
1
  import d from "./AMPOnboarding.vue2.js";
2
+ /* empty css */
2
3
  import g from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var l = function() {
4
- var t, r, e, i, a, s;
5
- var n = this, p = n._self._c, o = n._self._setupProxy;
6
- return o.isVisible ? p(o.InOnboard, { key: "guido__amp-onboard", staticClass: "w-21-s p-a z-11", class: (t = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : t.classes, attrs: { id: "guido__amp-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (r = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : r.bottom, "left-position": (e = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : e.left, "pages-config": o.onboardingStore.onboardings.ampOnboarding.config, "pointer-position": (i = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : i.position, "right-position": (a = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : a.right, "top-position": (s = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: function(u) {
4
+ var c = function() {
5
+ var n, r, e, i, a, s;
6
+ var t = this, p = t._self._c, o = t._self._setupProxy;
7
+ return o.isVisible ? p(o.InOnboard, { key: "guido__amp-onboard", staticClass: "w-21-s p-a z-11", class: (n = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : n.classes, attrs: { id: "guido__amp-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (r = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : r.bottom, "left-position": (e = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : e.left, "pages-config": o.onboardingStore.onboardings.ampOnboarding.config, "pointer-position": (i = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : i.position, "right-position": (a = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : a.right, "top-position": (s = o.onboardingStore.getAmpCurrentCard) == null ? void 0 : s.top }, on: { backButtonClick: o.handleBack, close: function(b) {
7
8
  return o.onboardingStore.close("ampOnboarding");
8
- }, nextButtonClick: o.handleNext } }) : n._e();
9
- }, m = [], c = /* @__PURE__ */ g(
9
+ }, nextButtonClick: o.handleNext } }) : t._e();
10
+ }, m = [], l = /* @__PURE__ */ g(
10
11
  d,
11
- l,
12
+ c,
12
13
  m,
13
14
  !1,
14
15
  null,
15
- null
16
+ "6bcaca8a"
16
17
  );
17
- const f = c.exports;
18
+ const S = l.exports;
18
19
  export {
19
- f as default
20
+ S as default
20
21
  };
@@ -13,7 +13,7 @@ var l = function() {
13
13
  p,
14
14
  !1,
15
15
  null,
16
- "7419ae06"
16
+ "f16f20f8"
17
17
  );
18
18
  const S = _.exports;
19
19
  export {
@@ -1,21 +1,21 @@
1
1
  import g from "./ItemsOnboarding.vue2.js";
2
2
  /* empty css */
3
3
  import m from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var l = function() {
4
+ var c = function() {
5
5
  var e, n, r, i, s, a;
6
6
  var o = this, d = o._self._c, t = o._self._setupProxy;
7
- return t.isVisible ? d(t.InOnboard, { key: "guido__items-onboard", staticClass: "w-21-s p-a z-11", class: (e = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__items-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : r.left, "pages-config": t.onboardingStore.onboardings.itemsOnboarding.config, "pointer-position": (i = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : i.position, "right-position": (s = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : s.right, "top-position": (a = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : a.top }, on: { backButtonClick: t.handleBack, close: function(b) {
7
+ return t.isVisible ? d(t.InOnboard, { key: "guido__items-onboard", staticClass: "w-21-s p-a z-11", class: (e = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : e.classes, attrs: { id: "guido__items-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : n.bottom, "left-position": (r = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : r.left, "pages-config": t.onboardingStore.onboardings.itemsOnboarding.config, "pointer-position": (i = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : i.position, "right-position": (s = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : s.right, "top-position": (a = t.onboardingStore.getItemsCurrentCard) == null ? void 0 : a.top }, on: { backButtonClick: t.handleBack, close: function(_) {
8
8
  return t.onboardingStore.close("itemsOnboarding");
9
9
  }, nextButtonClick: t.handleNext } }) : o._e();
10
- }, c = [], p = /* @__PURE__ */ m(
10
+ }, l = [], b = /* @__PURE__ */ m(
11
11
  g,
12
- l,
13
12
  c,
13
+ l,
14
14
  !1,
15
15
  null,
16
- "796d193b"
16
+ "bb3cca55"
17
17
  );
18
- const I = p.exports;
18
+ const I = b.exports;
19
19
  export {
20
20
  I as default
21
21
  };
@@ -1,46 +1,43 @@
1
- import { defineComponent as v, ref as D, computed as o } from "vue";
2
- import _ from "../../wrappers/WpModal.vue.js";
3
- import { useConfig as h } from "../../../composables/useConfig.js";
1
+ import { defineComponent as b, ref as v, computed as o } from "vue";
2
+ import D from "../../wrappers/WpModal.vue.js";
3
+ import { useConfig as _ } from "../../../composables/useConfig.js";
4
4
  import { useTranslations as y } from "../../../composables/useTranslations.js";
5
- import { ACADEMY_LINKS as c } from "../../../enums/academy.js";
5
+ import { ACADEMY_LINKS as m } from "../../../enums/academy.js";
6
6
  import L from "../../../static/assets/onboarding-img.svg.js";
7
- import { useOnboardingStore as C } from "../../../stores/onboarding.js";
8
- import { isAfterDate as w, formatShortDate as A } from "../../../utils/dateUtil.js";
9
- const V = /* @__PURE__ */ v({
7
+ import { useOnboardingStore as h } from "../../../stores/onboarding.js";
8
+ import { isAfterDate as C } from "../../../utils/dateUtil.js";
9
+ const x = /* @__PURE__ */ b({
10
10
  __name: "NewVersionPopup",
11
11
  emits: ["onboarding-finished"],
12
- setup(I, { emit: a }) {
13
- const e = y(), t = C(), s = D(!0), { config: p } = h(), i = o(() => {
14
- var l, m;
15
- return (m = (l = p.value) == null ? void 0 : l.editor) == null ? void 0 : m.migrationDate;
16
- }), n = o(() => w(i.value || 0)), d = o(() => A(
17
- i.value || 0
18
- )), f = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-title") : e("email-editor.onboarding-title")), g = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-description", {
19
- sunsetDate: d.value,
20
- academyLink: c.EMAIL_EDITOR
12
+ setup(w, { emit: i }) {
13
+ const e = y(), t = h(), a = v(!0), { config: s } = _(), p = o(() => {
14
+ var l, u;
15
+ return (u = (l = s.value) == null ? void 0 : l.editor) == null ? void 0 : u.migrationDate;
16
+ }), n = o(() => C(p.value || 0)), c = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-title") : e("email-editor.onboarding-title")), f = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-description", {
17
+ academyLink: m.EMAIL_EDITOR
21
18
  }) : e("email-editor.onboarding-description", {
22
- academyLink: c.EMAIL_EDITOR
23
- })), u = o(() => n.value ? e("products.cancel") : e("products.remind-me-later")), b = o(() => ({
19
+ academyLink: m.EMAIL_EDITOR
20
+ })), d = o(() => n.value ? e("products.cancel") : e("products.remind-me-later")), g = o(() => ({
24
21
  primaryButton: {
25
22
  type: "primary",
26
23
  labelText: e("left-menu.discover-now")
27
24
  },
28
25
  secondaryButton: {
29
26
  type: "subtle-primary",
30
- labelText: u.value
27
+ labelText: d.value
31
28
  }
32
29
  })), r = () => {
33
- s.value = !1, a("onboarding-finished");
30
+ a.value = !1, i("onboarding-finished");
34
31
  };
35
- return { __sfc: !0, emit: a, trans: e, onboardingStore: t, isVisible: s, config: p, migrationDate: i, isAfterMigrationDate: n, formattedSunsetDate: d, popupTitle: f, popupDescription: g, secondaryButtonLabel: u, footerButtonOptions: b, closePopup: r, handleDiscoverNow: () => {
32
+ return { __sfc: !0, emit: i, trans: e, onboardingStore: t, isVisible: a, config: s, migrationDate: p, isAfterMigrationDate: n, popupTitle: c, popupDescription: f, secondaryButtonLabel: d, footerButtonOptions: g, closePopup: r, handleDiscoverNow: () => {
36
33
  t.onDiscoverNowClicked(), r();
37
34
  }, handleRemindLater: () => {
38
35
  t.onRemindMeLater(), r();
39
36
  }, handleClose: () => {
40
37
  t.onNewVersionPopupClose(), r();
41
- }, WpModal: _, onboardingImageSvg: L };
38
+ }, WpModal: D, onboardingImageSvg: L };
42
39
  }
43
40
  });
44
41
  export {
45
- V as default
42
+ x as default
46
43
  };
@@ -13,9 +13,9 @@ var g = function() {
13
13
  b,
14
14
  !1,
15
15
  null,
16
- "cadfc82d"
16
+ "b09e80c4"
17
17
  );
18
- const C = p.exports;
18
+ const f = p.exports;
19
19
  export {
20
- C as default
20
+ f as default
21
21
  };
@@ -1,20 +1,21 @@
1
1
  import g from "./VersionHistoryOnboarding.vue2.js";
2
+ /* empty css */
2
3
  import l from "../../../_virtual/_plugin-vue2_normalizer.js";
3
4
  var c = function() {
4
- var n, t, i, e, s, a;
5
+ var t, n, i, e, s, a;
5
6
  var r = this, d = r._self._c, o = r._self._setupProxy;
6
- return o.isVisible ? d(o.InOnboard, { key: "guido__version-history-onboard", staticClass: "w-21-s p-a z-11", class: (n = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : n.classes, attrs: { id: "guido__version-history-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (t = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : t.bottom, "left-position": (i = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : i.left, "pages-config": o.onboardingStore.onboardings.versionHistoryOnboarding.config, "pointer-position": (e = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : e.position, "right-position": (s = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : s.right, "top-position": (a = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : a.top }, on: { backButtonClick: o.handleBack, close: function(b) {
7
+ return o.isVisible ? d(o.InOnboard, { key: "guido__version-history-onboard", staticClass: "w-21-s p-a z-11", class: (t = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : t.classes, attrs: { id: "guido__version-history-onboard", "is-multiple-page": "", visible: "", "image-source": "", title: "", "bottom-position": (n = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : n.bottom, "left-position": (i = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : i.left, "pages-config": o.onboardingStore.onboardings.versionHistoryOnboarding.config, "pointer-position": (e = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : e.position, "right-position": (s = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : s.right, "top-position": (a = o.onboardingStore.getVersionHistoryCurrentCard) == null ? void 0 : a.top }, on: { backButtonClick: o.handleBack, close: function(u) {
7
8
  return o.onboardingStore.close("versionHistoryOnboarding");
8
9
  }, nextButtonClick: o.handleNext } }) : r._e();
9
- }, _ = [], p = /* @__PURE__ */ l(
10
+ }, p = [], _ = /* @__PURE__ */ l(
10
11
  g,
11
12
  c,
12
- _,
13
+ p,
13
14
  !1,
14
15
  null,
15
- null
16
+ "9bdef600"
16
17
  );
17
- const m = p.exports;
18
+ const y = _.exports;
18
19
  export {
19
- m as default
20
+ y as default
20
21
  };
@@ -1,6 +1,6 @@
1
- import n from "./UnsubscribePageSelection.vue2.js";
1
+ import a from "./UnsubscribePageSelection.vue2.js";
2
2
  /* empty css */
3
- import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var o = function() {
5
5
  var r = this, e = r._self._c, t = r._self._setupProxy;
6
6
  return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
@@ -10,13 +10,13 @@ var o = function() {
10
10
  return t.selectTemplate(s.id);
11
11
  } } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
12
12
  }), 0)]);
13
- }, i = [], c = /* @__PURE__ */ a(
14
- n,
13
+ }, i = [], c = /* @__PURE__ */ n(
14
+ a,
15
15
  o,
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "669fe7cf"
19
+ "91a26acd"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {
@@ -29,9 +29,9 @@ const N = /* @__PURE__ */ y({
29
29
  t();
30
30
  }, 500);
31
31
  }, m = () => {
32
- n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
32
+ e.pageSelectionDrawerStatus && (n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
33
33
  detail: { blockId: e.pendingBlockId }
34
- }));
34
+ })));
35
35
  }, b = () => {
36
36
  if (e.isActiveTypeFirstInCollection) {
37
37
  n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
@@ -2,15 +2,15 @@ import n from "./UnsubscribeTypeSelection.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var i = function() {
5
- var e = this, s = e._self._c, t = e._self._setupProxy;
6
- return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.changeCollection } })], 1);
5
+ var t = this, s = t._self._c, e = t._self._setupProxy;
6
+ return s(e.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.unsubscribeStore.typeSelectionDrawerStatus, "title-text": e.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: e.closeModal, onCloseEvent: e.closeModal, primaryButtonEvent: e.selectCollection } }, [s(e.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: e.isSelecting, "segment-list": e.segmentList, selected: e.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": e.skeletonStatus }, on: { click: e.changeCollection } })], 1);
7
7
  }, r = [], c = /* @__PURE__ */ o(
8
8
  n,
9
9
  i,
10
10
  r,
11
11
  !1,
12
12
  null,
13
- "7a305bb2"
13
+ "b9a93c6e"
14
14
  );
15
15
  const _ = c.exports;
16
16
  export {
@@ -10,10 +10,10 @@ import { InSegments as L } from "@useinsider/design-system-vue";
10
10
  const W = /* @__PURE__ */ _({
11
11
  __name: "UnsubscribeTypeSelection",
12
12
  setup(k) {
13
- const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), T = t(
13
+ const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), y = t(
14
14
  "unsubscription-preference.select-unsubscribe-page-description",
15
15
  { action: `<a href="${D.GLOBAL_UNSUBSCRIBE}" target="_blank">${t("ds-rules.visit-academy")}</a>` }
16
- ), y = f(() => [
16
+ ), T = f(() => [
17
17
  {
18
18
  description: t("unsubscription-preference.type-global-unsubscribe-description"),
19
19
  icon: "line-contact-global-unsub-page",
@@ -31,7 +31,7 @@ const W = /* @__PURE__ */ _({
31
31
  disable: e.isSubscriptionPreferencesCenterDisabled,
32
32
  tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
33
33
  }
34
- ]), g = f(
34
+ ]), S = f(
35
35
  () => e.isGlobalUnsubscribeDisabled && e.isSubscriptionPreferencesCenterDisabled
36
36
  ), C = f(() => ({
37
37
  primaryButton: {
@@ -41,7 +41,7 @@ const W = /* @__PURE__ */ _({
41
41
  n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
42
42
  ),
43
43
  loadingStatus: n.value,
44
- disabledStatus: g.value,
44
+ disabledStatus: S.value,
45
45
  skeletonStatus: o.value,
46
46
  skeletonSizing: { width: 168, height: 40 }
47
47
  },
@@ -53,12 +53,12 @@ const W = /* @__PURE__ */ _({
53
53
  skeletonStatus: o.value,
54
54
  skeletonSizing: { width: 78, height: 40 }
55
55
  }
56
- })), S = (s) => {
57
- e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
56
+ })), g = (s) => {
57
+ e.typeSelectionDrawerStatus && (e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
58
58
  detail: { blockId: e.pendingBlockId }
59
59
  })), s && setTimeout(() => {
60
60
  s();
61
- }, 500);
61
+ }, 500));
62
62
  }, E = (s) => {
63
63
  r.value = s;
64
64
  }, m = () => {
@@ -98,14 +98,14 @@ const W = /* @__PURE__ */ _({
98
98
  }), !1;
99
99
  }, B = async () => {
100
100
  if (n.value = !0, await e.fetchTemplates(!0), e.setCollection(r.value), !m()) {
101
- n.value = !1, S();
101
+ n.value = !1, g();
102
102
  return;
103
103
  }
104
104
  n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
105
105
  };
106
106
  return v(() => e.typeSelectionDrawerStatus, (s) => {
107
107
  s && (o.value = !0, r.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (r.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), o.value = !1);
108
- }), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: T, segmentList: y, hasNoSelectableType: g, footerButtonGroupOptions: C, closeModal: S, changeCollection: E, validateTemplates: m, selectCollection: B, WpDrawer: U, InSegments: L };
108
+ }), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: y, segmentList: T, hasNoSelectableType: S, footerButtonGroupOptions: C, closeModal: g, changeCollection: E, validateTemplates: m, selectCollection: B, WpDrawer: U, InSegments: L };
109
109
  }
110
110
  });
111
111
  export {
@@ -0,0 +1,37 @@
1
+ import { useConfig as C } from "./useConfig.js";
2
+ import { useToaster as D } from "./useToaster.js";
3
+ import { useTranslations as T } from "./useTranslations.js";
4
+ import { ToasterTypeOptions as g } from "../enums/toaster.js";
5
+ import { buildDynamicContentLookup as h, convertModuleDynamicContent as O } from "../utils/dynamicContentConverter.js";
6
+ import { flattenDynamicContentList as f } from "../utils/genericUtil.js";
7
+ const M = "dynamic-content.unresolved-attributes-on-drop", b = () => {
8
+ const { template: i, isFeatureEnabled: p } = C(), { showToaster: m } = D(), a = T();
9
+ return { handleModuleAdd: (n, o) => {
10
+ var s, c, l;
11
+ try {
12
+ if ((n == null ? void 0 : n.action) !== "ADD" && (n == null ? void 0 : n.action) !== "COPY")
13
+ return;
14
+ const e = h(f((s = i.value) == null ? void 0 : s.dynamicContentList));
15
+ if (e.size === 0)
16
+ return;
17
+ const t = (c = o == null ? void 0 : o.getTargetNode) == null ? void 0 : c.call(o), r = (l = t == null ? void 0 : t.getOuterHTML) == null ? void 0 : l.call(t);
18
+ if (!t || typeof r != "string")
19
+ return;
20
+ const { html: u, unresolved: y } = O(
21
+ r,
22
+ e,
23
+ p("liquidSyntax")
24
+ );
25
+ u !== r && o.modifyHtml(t).replaceWith(u), y.length > 0 && m({
26
+ type: g.Warning,
27
+ message: a(M)
28
+ });
29
+ } catch (e) {
30
+ console.error("Failed to repair dynamic content on module add:", e);
31
+ }
32
+ } };
33
+ };
34
+ export {
35
+ M as UNRESOLVED_DYNAMIC_CONTENT_ON_DROP_KEY,
36
+ b as useModuleDynamicContentRepair
37
+ };
@@ -1,17 +1,42 @@
1
- const o = ["click", "auxclick", "submit"], c = (t) => {
2
- t.preventDefault(), t.stopPropagation();
3
- }, a = () => ({ blockPreviewInteractions: (r) => {
1
+ import { URLS as o, MERGE_TAGS as a } from "../enums/unsubscribe.js";
2
+ import { UNSUBSCRIBE_LINK_SELECTOR as i } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
3
+ import { BASE_SAFE_URL_SCHEMES as u } from "../utils/urlSchemes.js";
4
+ const E = ["click", "auxclick"], d = [
5
+ ...Object.values(a),
6
+ o.UNSUBSCRIBE_URL,
7
+ o.PREFERENCES_URL
8
+ ], l = (e) => {
9
+ if (e.matches(i))
10
+ return !0;
11
+ const r = e.getAttribute("href") ?? "";
12
+ return d.some((t) => r.includes(t));
13
+ }, S = [...u, "tel:", "sms:"], f = (e) => {
14
+ const r = (e.getAttribute("href") ?? "").trim();
15
+ return r === "" || r.startsWith("#") || r.startsWith("{{") ? !1 : S.includes(e.protocol);
16
+ }, m = (e) => {
17
+ var t, n;
18
+ const r = (n = (t = e.target) == null ? void 0 : t.closest) == null ? void 0 : n.call(t, "a");
19
+ if (r) {
20
+ if (l(r) || !f(r)) {
21
+ e.preventDefault(), e.stopPropagation();
22
+ return;
23
+ }
24
+ r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer");
25
+ }
26
+ }, R = (e) => {
27
+ e.preventDefault(), e.stopPropagation();
28
+ }, s = /* @__PURE__ */ new WeakSet(), c = "guidoPreviewGuarded", g = () => ({ guardPreviewInteractions: (r) => {
4
29
  try {
5
- const e = r.contentDocument;
6
- if (!e)
30
+ const t = r.contentDocument;
31
+ if (!t || s.has(t))
7
32
  return;
8
- o.forEach((n) => {
9
- e.addEventListener(n, c, !0);
10
- });
11
- } catch (e) {
12
- console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", e);
33
+ delete t.documentElement.dataset[c], E.forEach((n) => {
34
+ t.addEventListener(n, m, !0);
35
+ }), t.addEventListener("submit", R, !0), s.add(t), t.documentElement.dataset[c] = "true";
36
+ } catch (t) {
37
+ console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", t);
13
38
  }
14
39
  } });
15
40
  export {
16
- a as usePreviewInteractionGuard
41
+ g as usePreviewInteractionGuard
17
42
  };
@@ -1,111 +1,112 @@
1
- import { BLOCK_ROOT_SELECTOR as S, CURRENCY_ATTR as p, CONTAINER_SELECTOR as O } from "../extensions/Blocks/Recommendation/constants/selectors.js";
2
- import { useRecommendationExtensionStore as h } from "../extensions/Blocks/Recommendation/store/recommendation.js";
3
- import { formatPrice as E } from "../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
- const f = `${S}[recommendation-id]`, C = ".product-old-price", R = /\{\{(?:reco_)?(\d+_\d+_[a-zA-Z0-9_.]+)\}\}/g, T = new RegExp(
1
+ import { BLOCK_ROOT_SELECTOR as f, CURRENCY_ATTR as A, CONTAINER_SELECTOR as O } from "../extensions/Blocks/Recommendation/constants/selectors.js";
2
+ import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
3
+ import { formatPrice as _ } from "../extensions/Blocks/Recommendation/utils/priceFormatter.js";
4
+ import { BASE_SAFE_URL_SCHEMES as R } from "../utils/urlSchemes.js";
5
+ const S = `${f}[recommendation-id]`, h = ".product-old-price", T = /\{\{(?:reco_)?(\d+_\d+_[a-zA-Z0-9_.]+)\}\}/g, b = new RegExp(
5
6
  "\\{%\\s*if\\s+([\\s\\S]+?)\\s*%\\}([\\s\\S]*?)(?:\\{%\\s*else\\s*%\\}([\\s\\S]*?))?\\{%\\s*endif\\s*%\\}",
6
7
  "g"
7
8
  );
8
- function b(e) {
9
+ function L(e) {
9
10
  return e.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&#39;");
10
11
  }
11
- function _(e) {
12
- var s;
13
- const n = (s = e.replace(/[\u0000-\u0020]+/g, "").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/)) == null ? void 0 : s[1];
14
- return n && n !== "http" && n !== "https" && n !== "mailto" ? "" : e;
12
+ function g(e) {
13
+ var c;
14
+ const i = (c = e.replace(/[\u0000-\u0020]+/g, "").toLowerCase().match(/^([a-z][a-z0-9+.-]*):/)) == null ? void 0 : c[1];
15
+ return i && !R.includes(`${i}:`) ? "" : e;
15
16
  }
16
17
  function N(e) {
17
- const t = e.getAttribute(p.CURRENCY) || "USD", n = e.getAttribute(p.DECIMAL_SEPARATOR) || ".", s = e.getAttribute(p.THOUSAND_SEPARATOR) || ",";
18
+ const t = e.getAttribute(A.CURRENCY) || "USD", i = e.getAttribute(A.DECIMAL_SEPARATOR) || ".", c = e.getAttribute(A.THOUSAND_SEPARATOR) || ",";
18
19
  return {
19
20
  code: t,
20
- symbol: e.getAttribute(p.SYMBOL) || t,
21
- alignment: e.getAttribute(p.ALIGNMENT) === "0" ? "before" : "after",
22
- decimalCount: parseInt(e.getAttribute(p.DECIMAL_COUNT) || "2") || 2,
23
- decimalSeparator: n,
24
- thousandSeparator: s
21
+ symbol: e.getAttribute(A.SYMBOL) || t,
22
+ alignment: e.getAttribute(A.ALIGNMENT) === "0" ? "before" : "after",
23
+ decimalCount: parseInt(e.getAttribute(A.DECIMAL_COUNT) || "2") || 2,
24
+ decimalSeparator: i,
25
+ thousandSeparator: c
25
26
  };
26
27
  }
27
- function g(e, t) {
28
+ function E(e, t) {
28
29
  return (e == null ? void 0 : e[t]) ?? Object.values(e ?? {})[0] ?? 0;
29
30
  }
30
- function L(e, t) {
31
- const n = g(e.original_price, t), s = g(e.price, t), o = n > 0 ? Math.round((n - s) / n * 100) : 0;
32
- return o > 0 ? `${o}%` : "0%";
31
+ function $(e, t) {
32
+ const i = E(e.original_price, t), c = E(e.price, t), n = i > 0 ? Math.round((i - c) / i * 100) : 0;
33
+ return n > 0 ? `${n}%` : "0%";
33
34
  }
34
- function P(e, t, n, s, o, a) {
35
- s.forEach((i, c) => {
36
- const r = (m) => `${n}_${c}_${m}`, u = E({ price: g(i.price, o.code), currency: o }), l = E({ price: g(i.original_price, o.code), currency: o }), d = L(i, o.code);
37
- e.set(r("name"), i.name ?? ""), e.set(r("image_url"), _(i.image_url ?? "")), e.set(r("url"), _(i.url ?? "")), e.set(r("item_id"), i.item_id ?? ""), e.set(r("currency"), ""), e.set(r("price"), u), e.set(r("original_price"), l), e.set(r("discount"), d), e.set(r("omnibus_price"), l), e.set(r("omnibus_discount"), d), a && u === l && t.add(`${n}_${c}`), Object.entries(i.product_attributes ?? {}).forEach(([m, A]) => {
38
- e.set(r(`product_attribute.${m}`), String(A)), e.set(r(m), String(A));
35
+ function P(e, t, i, c, n, a) {
36
+ c.forEach((o, s) => {
37
+ const r = (m) => `${i}_${s}_${m}`, u = _({ price: E(o.price, n.code), currency: n }), l = _({ price: E(o.original_price, n.code), currency: n }), d = $(o, n.code);
38
+ e.set(r("name"), o.name ?? ""), e.set(r("image_url"), g(o.image_url ?? "")), e.set(r("url"), g(o.url ?? "")), e.set(r("item_id"), o.item_id ?? ""), e.set(r("currency"), ""), e.set(r("price"), u), e.set(r("original_price"), l), e.set(r("discount"), d), e.set(r("omnibus_price"), l), e.set(r("omnibus_discount"), d), a && u === l && t.add(`${i}_${s}`), Object.entries(o.product_attributes ?? {}).forEach(([m, p]) => {
39
+ e.set(r(`product_attribute.${m}`), String(p)), e.set(r(m), String(p));
39
40
  });
40
41
  });
41
42
  }
42
- function $(e, t) {
43
- const n = e.match(/^(.+?)\s*(!=|==)\s*"([^"]*)"$/);
44
- if (!n)
43
+ function z(e, t) {
44
+ const i = e.match(/^(.+?)\s*(!=|==)\s*"([^"]*)"$/);
45
+ if (!i)
45
46
  return !0;
46
- const [, s, o, a] = n, i = t.get(s.trim()) ?? "";
47
- return o === "!=" ? i !== a : i === a;
47
+ const [, c, n, a] = i, o = t.get(c.trim()) ?? "";
48
+ return n === "!=" ? o !== a : o === a;
48
49
  }
49
- function z(e, t) {
50
+ function w(e, t) {
50
51
  return e.replace(
51
- T,
52
- (n, s, o, a) => s.split(/\s+and\s+/).every((c) => $(c.trim(), t)) ? o : a ?? ""
52
+ b,
53
+ (i, c, n, a) => c.split(/\s+and\s+/).every((s) => z(s.trim(), t)) ? n : a ?? ""
53
54
  );
54
55
  }
55
- function w(e) {
56
+ function D(e) {
56
57
  let t = e;
57
58
  for (; t.children.length === 1; )
58
59
  [t] = t.children;
59
60
  return t;
60
61
  }
61
- function D(e, t) {
62
- var i;
62
+ function I(e, t) {
63
+ var o;
63
64
  if (!t.size)
64
65
  return e;
65
- const n = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), s = new DOMParser().parseFromString(n, "text/html");
66
- s.querySelectorAll(f).forEach((c) => {
67
- const r = Number(c.getAttribute("recommendation-id"));
66
+ const i = e.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), c = new DOMParser().parseFromString(i, "text/html");
67
+ c.querySelectorAll(S).forEach((s) => {
68
+ const r = Number(s.getAttribute("recommendation-id"));
68
69
  if (!Number.isFinite(r))
69
70
  return;
70
- const u = c.querySelectorAll(O);
71
- (u.length ? Array.from(u) : [c]).forEach((d) => {
72
- d.querySelectorAll(C).forEach((m, A) => {
73
- t.has(`${r}_${A}`) && (w(m).textContent = "");
71
+ const u = s.querySelectorAll(O);
72
+ (u.length ? Array.from(u) : [s]).forEach((d) => {
73
+ d.querySelectorAll(h).forEach((m, p) => {
74
+ t.has(`${r}_${p}`) && (D(m).textContent = "");
74
75
  });
75
76
  });
76
77
  });
77
- const o = (i = e.match(/<!DOCTYPE[^>]*>/i)) == null ? void 0 : i[0];
78
- return ((o ? `${o}
79
- ` : "") + s.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
78
+ const n = (o = e.match(/<!DOCTYPE[^>]*>/i)) == null ? void 0 : o[0];
79
+ return ((n ? `${n}
80
+ ` : "") + c.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
80
81
  }
81
- function I(e) {
82
+ function y(e) {
82
83
  if (!e || !e.includes("recommendation-block-v2"))
83
84
  return e;
84
- const t = h(), n = new DOMParser().parseFromString(e, "text/html"), s = Array.from(n.querySelectorAll(f)), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
85
- if (s.forEach((c) => {
85
+ const t = C(), i = new DOMParser().parseFromString(e, "text/html"), c = Array.from(i.querySelectorAll(S)), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
86
+ if (c.forEach((s) => {
86
87
  var l;
87
- const r = Number(c.getAttribute("recommendation-id"));
88
+ const r = Number(s.getAttribute("recommendation-id"));
88
89
  if (!Number.isFinite(r))
89
90
  return;
90
91
  const u = ((l = t.blockStates[r]) == null ? void 0 : l.recommendationProducts) ?? [];
91
92
  u.length && P(
92
- o,
93
+ n,
93
94
  a,
94
95
  r,
95
96
  u,
96
- N(c),
97
- c.getAttribute("hide-price") === "true"
97
+ N(s),
98
+ s.getAttribute("hide-price") === "true"
98
99
  );
99
- }), !o.size)
100
+ }), !n.size)
100
101
  return e;
101
- let i = D(e, a);
102
- return i = i.replace(
103
- R,
104
- (c, r) => o.has(r) ? b(o.get(r)) : c
105
- ), i = z(i, o), i;
102
+ let o = I(e, a);
103
+ return o = o.replace(
104
+ T,
105
+ (s, r) => n.has(r) ? L(n.get(r)) : s
106
+ ), o = w(o, n), o;
106
107
  }
107
- const q = () => ({ substituteRecommendationPreview: I });
108
+ const q = () => ({ substituteRecommendationPreview: y });
108
109
  export {
109
- I as substituteRecommendationPreview,
110
+ y as substituteRecommendationPreview,
110
111
  q as useRecommendationPreview
111
112
  };