@useinsider/guido 2.0.0-beta.254566 → 2.0.0-beta.25fe7cd

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 (146) hide show
  1. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +3 -3
  2. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +8 -8
  3. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
  4. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +7 -8
  5. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
  6. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +10 -14
  7. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +18 -22
  8. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
  9. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
  10. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
  11. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
  12. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
  13. package/dist/components/organisms/header/HeaderWrapper.vue.js +5 -5
  14. package/dist/components/organisms/header/LeftSlot.vue.js +11 -11
  15. package/dist/components/organisms/header/LeftSlot.vue2.js +11 -12
  16. package/dist/components/organisms/header/MiddleSlot.vue.js +5 -4
  17. package/dist/components/organisms/header/MiddleSlot.vue2.js +14 -13
  18. package/dist/components/organisms/header/RightSlot.vue.js +12 -12
  19. package/dist/components/organisms/header/RightSlot.vue2.js +26 -20
  20. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
  21. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
  22. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
  23. package/dist/enums/academy.js +8 -0
  24. package/dist/enums/onboarding.js +1 -2
  25. package/dist/enums/unsubscribe.js +20 -21
  26. package/dist/extensions/Blocks/Items/controls/cardComposition.js +4 -13
  27. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +69 -153
  28. package/dist/extensions/Blocks/Recommendation/constants.js +1 -9
  29. package/dist/extensions/Blocks/Recommendation/control.js +61 -91
  30. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
  31. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
  32. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
  33. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
  34. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
  35. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
  36. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
  37. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
  38. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
  39. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
  40. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
  41. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
  42. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
  43. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
  44. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
  45. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
  46. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
  47. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
  48. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
  49. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
  52. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
  53. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
  54. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
  55. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
  56. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
  58. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
  59. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
  60. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
  61. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
  62. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
  63. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
  64. package/dist/extensions/Blocks/Recommendation/extension.js +42 -16
  65. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +72 -117
  66. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +64 -85
  67. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +17 -54
  68. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +45 -74
  69. package/dist/extensions/Blocks/common-control.js +6 -7
  70. package/dist/guido.css +1 -1
  71. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +290 -363
  72. package/dist/package.json.js +1 -1
  73. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  74. package/dist/src/enums/academy.d.ts +12 -0
  75. package/dist/src/enums/onboarding.d.ts +0 -1
  76. package/dist/src/enums/unsubscribe.d.ts +0 -1
  77. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +3 -50
  78. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -32
  79. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +2 -5
  80. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
  81. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
  82. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
  83. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
  84. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
  85. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
  86. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
  87. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
  88. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
  89. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
  90. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
  91. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
  92. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
  93. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
  94. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
  95. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
  96. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
  97. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
  98. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
  99. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
  100. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
  101. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
  102. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
  103. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
  104. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
  105. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
  106. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
  107. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
  108. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
  109. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
  110. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
  111. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
  112. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
  113. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
  114. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
  115. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +7 -15
  116. package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
  117. package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
  118. package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
  119. package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
  120. package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
  121. package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
  122. package/dist/static/styles/components/wide-panel.css.js +4 -0
  123. package/dist/static/styles/customEditorStyle.css.js +0 -13
  124. package/package.json +3 -3
  125. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
  126. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
  127. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
  128. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
  129. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
  130. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +0 -71
  131. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +0 -71
  132. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +0 -71
  133. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +0 -71
  134. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
  135. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +0 -25
  136. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
  137. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -592
  138. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
  139. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
  140. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
  141. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
  142. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
  143. package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
  144. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -19
  145. package/dist/static/assets/inbox-mockup.svg.js +0 -4
  146. package/dist/static/assets/phone-mockup.svg.js +0 -4
@@ -1,20 +1,20 @@
1
- import u from "./RightSlot.vue2.js";
2
- import d from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var p = function() {
4
- var o, i, n, a, l, r;
5
- var s = this, e = s._self._c, t = s._self._setupProxy;
6
- return e("div", { staticClass: "d-f" }, [(i = (o = t.config) == null ? void 0 : o.features) != null && i.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : s._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (a = (n = t.config) == null ? void 0 : n.features) != null && a.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : s._e(), (r = (l = t.config) == null ? void 0 : l.features) != null && r.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : s._e(), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(f) {
1
+ import l from "./RightSlot.vue2.js";
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var d = function() {
4
+ var s, i, n, a;
5
+ var o = this, e = o._self._c, t = o._self._setupProxy;
6
+ return e("div", { staticClass: "d-f" }, [t.editorStore.isVersionHistoryOpen ? e(t.RestoreButton) : [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(_) {
7
7
  return t.handleSave(!1);
8
- } } })], 1);
9
- }, c = [], _ = /* @__PURE__ */ d(
8
+ } } })]], 2);
9
+ }, u = [], p = /* @__PURE__ */ r(
10
+ l,
11
+ d,
10
12
  u,
11
- p,
12
- c,
13
13
  !1,
14
14
  null,
15
15
  null
16
16
  );
17
- const y = _.exports;
17
+ const f = p.exports;
18
18
  export {
19
- y as default
19
+ f as default
20
20
  };
@@ -1,36 +1,42 @@
1
- import { defineComponent as H, ref as c, computed as _ } from "vue";
1
+ import { defineComponent as _, ref as c, computed as f } from "vue";
2
2
  import { useConfig as h } from "../../../composables/useConfig.js";
3
- import { useExport as V } from "../../../composables/useExport.js";
3
+ import { useExport as w } from "../../../composables/useExport.js";
4
4
  import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
5
5
  import { useSave as E } from "../../../composables/useSave.js";
6
6
  import { useTranslations as T } from "../../../composables/useTranslations.js";
7
- import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
7
+ import { useVersionHistoryApi as O } from "../../../composables/useVersionHistoryApi.js";
8
8
  import { useEditorStore as C } from "../../../stores/editor.js";
9
- import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
10
- import { InButtonV2 as A } from "@useinsider/design-system-vue";
11
- const J = /* @__PURE__ */ H({
9
+ import { getTooltipOptions as A } from "../../../utils/tooltipUtils.js";
10
+ import { InButtonV2 as B } from "@useinsider/design-system-vue";
11
+ import k from "./version-history/RestoreButton.vue.js";
12
+ const K = /* @__PURE__ */ _({
12
13
  __name: "RightSlot",
13
- setup(k, { expose: u }) {
14
- const { config: f } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = c(!1), s = c(!1), v = x(), d = () => {
14
+ setup(R, { expose: v }) {
15
+ const { config: n } = h(), { exportHtml: a } = w(), { save: l } = E(), { openVersionHistory: p, closeVersionHistory: m } = O(), o = C(), s = T(), r = c(!1), i = c(!1), d = x(), y = () => {
15
16
  if (o.isVersionHistoryOpen) {
16
- a();
17
+ m();
17
18
  return;
18
19
  }
19
- i();
20
- }, y = async () => {
21
- e.value = !0, await r(), e.value = !1;
20
+ p();
21
+ }, H = async () => {
22
+ r.value = !0, await a(), r.value = !1;
22
23
  }, S = () => {
23
24
  o.isSaveAsTemplateDrawerOpen = !0;
24
- }, g = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
25
- s.value = !0, o.loadingStatus = !0;
26
- const m = await n(p);
27
- return s.value = !1, (p || !m) && (o.loadingStatus = !1), m;
25
+ }, V = f(() => o.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), g = f(
26
+ () => {
27
+ var t, e;
28
+ return ((e = (t = n.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
29
+ }
30
+ ), u = async (t) => {
31
+ i.value = !0, o.loadingStatus = !0;
32
+ const e = await l(t);
33
+ return i.value = !1, (t || !e) && (o.loadingStatus = !1), e;
28
34
  };
29
- return u({
30
- handleSave: l
31
- }), { __sfc: !0, config: f, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: v, handleVersionHistory: d, handleExport: y, handleSaveAs: S, versionHistoryTooltipText: g, handleSave: l, getTooltipOptions: O, InButtonV2: A };
35
+ return v({
36
+ handleSave: u
37
+ }), { __sfc: !0, config: n, exportHtml: a, save: l, openVersionHistory: p, closeVersionHistory: m, editorStore: o, trans: s, isExporting: r, isSaving: i, testEmailClick: d, handleVersionHistory: y, handleExport: H, handleSaveAs: S, versionHistoryTooltipText: V, isVersionHistoryButtonVisible: g, handleSave: u, getTooltipOptions: A, InButtonV2: B, RestoreButton: k };
32
38
  }
33
39
  });
34
40
  export {
35
- J as default
41
+ K as default
36
42
  };
@@ -1,25 +1,25 @@
1
1
  import { defineComponent as v, ref as D, computed as o } from "vue";
2
- import h from "../../wrappers/WpModal.vue.js";
3
- import { useConfig as y } from "../../../composables/useConfig.js";
4
- import { useTranslations as _ } from "../../../composables/useTranslations.js";
5
- import { ACADEMY_LINK as c } from "../../../enums/onboarding.js";
6
- import C from "../../../static/assets/onboarding-img.svg.js";
7
- import { useOnboardingStore as L } from "../../../stores/onboarding.js";
8
- import { isAfterDate as w, formatShortDate as N } from "../../../utils/dateUtil.js";
9
- const E = /* @__PURE__ */ v({
2
+ import _ from "../../wrappers/WpModal.vue.js";
3
+ import { useConfig as h } from "../../../composables/useConfig.js";
4
+ import { useTranslations as y } from "../../../composables/useTranslations.js";
5
+ import { ACADEMY_LINKS as c } from "../../../enums/academy.js";
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({
10
10
  __name: "NewVersionPopup",
11
11
  emits: ["onboarding-finished"],
12
- setup(S, { emit: a }) {
13
- const e = _(), t = L(), s = D(!0), { config: p } = y(), i = o(() => {
12
+ setup(I, { emit: a }) {
13
+ const e = y(), t = C(), s = D(!0), { config: p } = h(), i = o(() => {
14
14
  var l, m;
15
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(() => N(
16
+ }), n = o(() => w(i.value || 0)), d = o(() => A(
17
17
  i.value || 0
18
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
19
  sunsetDate: d.value,
20
- academyLink: c
20
+ academyLink: c.EMAIL_EDITOR
21
21
  }) : e("email-editor.onboarding-description", {
22
- academyLink: c
22
+ academyLink: c.EMAIL_EDITOR
23
23
  })), u = o(() => n.value ? e("products.cancel") : e("products.remind-me-later")), b = o(() => ({
24
24
  primaryButton: {
25
25
  type: "primary",
@@ -38,9 +38,9 @@ const E = /* @__PURE__ */ v({
38
38
  t.onRemindMeLater(), r();
39
39
  }, handleClose: () => {
40
40
  t.onNewVersionPopupClose(), r();
41
- }, WpModal: h, onboardingImageSvg: C };
41
+ }, WpModal: _, onboardingImageSvg: L };
42
42
  }
43
43
  });
44
44
  export {
45
- E as default
45
+ V as default
46
46
  };
@@ -10,7 +10,7 @@ var i = function() {
10
10
  r,
11
11
  !1,
12
12
  null,
13
- "bb3bb07c"
13
+ "43c617a7"
14
14
  );
15
15
  const _ = c.exports;
16
16
  export {
@@ -1,18 +1,19 @@
1
- import { defineComponent as v, ref as b, computed as m, watch as _ } from "vue";
2
- import B from "../../wrappers/WpDrawer.vue.js";
1
+ import { defineComponent as h, ref as b, computed as g, watch as _ } from "vue";
2
+ import v from "../../wrappers/WpDrawer.vue.js";
3
3
  import { useToaster as U } from "../../../composables/useToaster.js";
4
- import { useTranslations as w } from "../../../composables/useTranslations.js";
5
- import { ToasterTypeOptions as N } from "../../../enums/toaster.js";
6
- import { PAGE_TYPES as l, ACADEMY_LINK as D, getTypeTranslations as P, UNSUBSCRIBE_PAGES_LINK as R } from "../../../enums/unsubscribe.js";
7
- import { useUnsubscribeStore as I } from "../../../stores/unsubscribe.js";
4
+ import { useTranslations as N } from "../../../composables/useTranslations.js";
5
+ import { ACADEMY_LINKS as w } from "../../../enums/academy.js";
6
+ import { ToasterTypeOptions as R } from "../../../enums/toaster.js";
7
+ import { PAGE_TYPES as l, getTypeTranslations as D, UNSUBSCRIBE_PAGES_LINK as I } from "../../../enums/unsubscribe.js";
8
+ import { useUnsubscribeStore as P } from "../../../stores/unsubscribe.js";
8
9
  import { InSegments as G } from "@useinsider/design-system-vue";
9
- const K = /* @__PURE__ */ v({
10
+ const V = /* @__PURE__ */ h({
10
11
  __name: "UnsubscribeTypeSelection",
11
- setup(x) {
12
- const e = w(), { showToaster: f } = U(), t = I(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
12
+ setup(L) {
13
+ const e = N(), { showToaster: f } = U(), t = P(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), S = e(
13
14
  "unsubscription-preference.select-unsubscribe-page-description",
14
- { action: `<a href="${D}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
15
- ), T = m(() => [
15
+ { action: `<a href="${w.GLOBAL_UNSUBSCRIBE}" target="_blank">${e("ds-rules.visit-academy")}</a>` }
16
+ ), T = g(() => [
16
17
  {
17
18
  description: e("unsubscription-preference.type-global-unsubscribe-description"),
18
19
  icon: "line-contact-global-unsub-page",
@@ -30,7 +31,7 @@ const K = /* @__PURE__ */ v({
30
31
  disable: t.isSubscriptionPreferencesCenterDisabled,
31
32
  tooltipText: t.isSubscriptionPreferencesCenterDisabled ? e("unsubscription-preference.pref-center-added") : ""
32
33
  }
33
- ]), y = m(() => ({
34
+ ]), y = g(() => ({
34
35
  primaryButton: {
35
36
  styling: "solid",
36
37
  type: "primary",
@@ -56,13 +57,13 @@ const K = /* @__PURE__ */ v({
56
57
  }, 500);
57
58
  }, E = (s) => {
58
59
  o.value = s;
59
- }, g = () => {
60
+ }, m = () => {
60
61
  const s = t.hasTemplatesByCollectionType, r = [];
61
62
  if (Object.entries(s).forEach(([c, p]) => {
62
63
  p || r.push(Number(c));
63
64
  }), r.length === 0)
64
65
  return !0;
65
- const h = P(), a = r.map((c) => h[c]);
66
+ const B = D(), a = r.map((c) => B[c]);
66
67
  let u = "";
67
68
  if (r.length === 1)
68
69
  u = e("unsubscription-preference.create-page-to-continue", {
@@ -81,17 +82,17 @@ const K = /* @__PURE__ */ v({
81
82
  });
82
83
  }
83
84
  return f({
84
- type: N.Warning,
85
+ type: R.Warning,
85
86
  message: u,
86
87
  actionButton: {
87
88
  text: "Go to Unsubscribe Pages",
88
89
  onClick: () => {
89
- window.location.href = R;
90
+ window.location.href = I;
90
91
  }
91
92
  }
92
93
  }), !1;
93
94
  }, C = async () => {
94
- if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !g()) {
95
+ if (n.value = !0, await t.fetchTemplates(), t.setCollection(o.value), !m()) {
95
96
  n.value = !1, d();
96
97
  return;
97
98
  }
@@ -99,9 +100,9 @@ const K = /* @__PURE__ */ v({
99
100
  };
100
101
  return _(() => t.typeSelectionDrawerStatus, (s) => {
101
102
  s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, t.isGlobalUnsubscribeDisabled && (o.value = t.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
102
- }), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: C, WpDrawer: B, InSegments: G };
103
+ }), { __sfc: !0, trans: e, showToaster: f, unsubscribeStore: t, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: m, selectCollection: C, WpDrawer: v, InSegments: G };
103
104
  }
104
105
  });
105
106
  export {
106
- K as default
107
+ V as default
107
108
  };
@@ -0,0 +1,8 @@
1
+ const e = "https://academy.useinsider.com", o = {
2
+ EMAIL_EDITOR: `${e}/docs/email-drag-drop-editor`,
3
+ GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
4
+ AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`
5
+ };
6
+ export {
7
+ o as ACADEMY_LINKS
8
+ };
@@ -2,9 +2,8 @@ const e = [
2
2
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
3
3
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
4
4
  ".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
5
- ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper", a = "https://academy.useinsider.com/docs/email-drag-drop-editor";
5
+ ], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper";
6
6
  export {
7
- a as ACADEMY_LINK,
8
7
  n as CARD_COMPOSITION_TAB_SELECTOR,
9
8
  o as RIBBON_SELECTOR,
10
9
  e as SERVICE_HOVER_SELECTORS,
@@ -1,26 +1,26 @@
1
- import { useTranslations as n } from "../composables/useTranslations.js";
1
+ import { useTranslations as e } from "../composables/useTranslations.js";
2
2
  import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
- const N = {
3
+ const I = {
4
4
  UNSUBSCRIBE_LINK_TYPE: 1,
5
5
  PREFERENCES_LINK_TYPE: 3
6
- }, I = {
6
+ }, r = {
7
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
8
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
9
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
10
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
11
- }, s = R(), i = {
11
+ }, s = R(), _ = {
12
12
  UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
13
13
  PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
14
- }, _ = "iid", B = {
14
+ }, i = "iid", B = {
15
15
  name: "Global Unsubscribe",
16
16
  sendGridId: "G"
17
- }, t = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", C = "/email/unsubscribe-pages", E = {
17
+ }, C = "/email/unsubscribe-pages", E = {
18
18
  GLOBAL_UNSUBSCRIBE: 1,
19
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
20
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
21
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
22
22
  RESUBSCRIBE: 5
23
- }, c = {
23
+ }, t = {
24
24
  [E.GLOBAL_UNSUBSCRIBE]: [
25
25
  E.GLOBAL_UNSUBSCRIBE,
26
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -31,29 +31,28 @@ const N = {
31
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
32
32
  ]
33
33
  }, U = () => {
34
- const e = n();
34
+ const n = e();
35
35
  return {
36
- [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
37
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
38
- [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
39
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
40
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
36
+ [E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
37
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
38
+ [E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
39
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
40
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
41
41
  };
42
- }, o = {
42
+ }, c = {
43
43
  default: "{{ins-unsubscribe-link}}",
44
44
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
45
45
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
46
46
  };
47
47
  export {
48
- t as ACADEMY_LINK,
49
48
  B as DEFAULT_UNSUBSCRIBE_GROUP,
50
- _ as INSIDER_ID,
51
- I as LINK_REGEXES,
52
- N as LINK_TYPES,
53
- o as MERGE_TAGS,
49
+ i as INSIDER_ID,
50
+ r as LINK_REGEXES,
51
+ I as LINK_TYPES,
52
+ c as MERGE_TAGS,
54
53
  E as PAGE_TYPES,
55
- c as TYPE_COLLECTIONS,
54
+ t as TYPE_COLLECTIONS,
56
55
  C as UNSUBSCRIBE_PAGES_LINK,
57
- i as URLS,
56
+ _ as URLS,
58
57
  U as getTypeTranslations
59
58
  };
@@ -145,19 +145,10 @@ class g extends R {
145
145
  T && this.api.getDocumentModifier().modifyHtml(o).setAttribute(C[T], e ? "1" : "0").apply(new l(`Updated ${t} visibility attribute`));
146
146
  }
147
147
  _listenToFormUpdates() {
148
- this.api.onValueChanged(i.PRODUCT_IMAGE, (t) => {
149
- this._onProductImageChange(t);
150
- }), this.api.onValueChanged(i.PRODUCT_NAME, (t) => {
151
- this._onProductNameChange(t);
152
- }), this.api.onValueChanged(i.PRODUCT_QUANTITY, (t) => {
153
- this._onProductQuantityChange(t);
154
- }), this.api.onValueChanged(i.PRODUCT_PRICE, (t) => {
155
- this._onProductPriceChange(t);
156
- }), this.api.onValueChanged(i.PRODUCT_ORIGINAL_PRICE, (t) => {
157
- this._onProductOriginalPriceChange(t);
158
- }), this.api.onValueChanged(i.PRODUCT_BUTTON, (t) => {
159
- this._onProductButtonChange(t);
160
- });
148
+ this.api.onValueChanged(i.PRODUCT_IMAGE, (t) => this._onProductImageChange(t)), this.api.onValueChanged(i.PRODUCT_NAME, (t) => this._onProductNameChange(t)), this.api.onValueChanged(i.PRODUCT_QUANTITY, (t) => this._onProductQuantityChange(t)), this.api.onValueChanged(i.PRODUCT_PRICE, (t) => this._onProductPriceChange(t)), this.api.onValueChanged(
149
+ i.PRODUCT_ORIGINAL_PRICE,
150
+ (t) => this._onProductOriginalPriceChange(t)
151
+ ), this.api.onValueChanged(i.PRODUCT_BUTTON, (t) => this._onProductButtonChange(t));
161
152
  }
162
153
  _onProductImageChange(t) {
163
154
  var o;
@@ -1,187 +1,103 @@
1
- import { ModificationDescription as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as _ } from "../common-control.js";
3
- import { ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OLD_PRICE as h, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_BUTTON as g } from "./constants.js";
4
- const R = "ui-elements-recommendation-card-composition", l = ".recommendation-attribute-row", A = "tr.recommendation-product-row", c = "data-card-composition", a = "data-attribute-type", d = "data-visibility", s = [
5
- { key: m, label: "Product Image", visible: !0 },
6
- { key: y, label: "Product Name", visible: !0 },
7
- { key: T, label: "Product Price", visible: !0 },
8
- { key: h, label: "Product Original Price", visible: !0 },
9
- { key: C, label: "Omnibus Price", visible: !1 },
10
- { key: f, label: "Omnibus Discount", visible: !1 },
11
- { key: g, label: "Product Button", visible: !0 }
1
+ var m = Object.defineProperty;
2
+ var y = (n, o, i) => o in n ? m(n, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[o] = i;
3
+ var a = (n, o, i) => y(n, typeof o != "symbol" ? o + "" : o, i);
4
+ import { ModificationDescription as u } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as b } from "../common-control.js";
6
+ const h = "ui-elements-recommendation-card-composition", s = [
7
+ { key: "productImage", label: "Product Image", visible: !0 },
8
+ { key: "productName", label: "Product Name", visible: !0 },
9
+ { key: "productPrice", label: "Product Price", visible: !0 },
10
+ { key: "productOriginalPrice", label: "Product Original Price", visible: !0 },
11
+ { key: "productButton", label: "Product Button", visible: !0 }
12
12
  ];
13
- class N extends _ {
13
+ class g extends b {
14
+ constructor() {
15
+ super(...arguments);
16
+ a(this, "currentComposition", []);
17
+ a(this, "currentVisibility", {});
18
+ }
14
19
  getId() {
15
- return R;
20
+ return h;
16
21
  }
17
22
  getTemplate() {
18
- const t = s.map((i) => ({
19
- key: i.key,
20
- label: i.label,
21
- content: this._createItemContent(i.label, i.key)
23
+ const i = s.map((e) => ({
24
+ key: e.key,
25
+ label: e.label,
26
+ content: `
27
+ <div style="display: flex; align-items: center; justify-content: space-between;
28
+ padding: 8px; gap: 8px;">
29
+ <span style="flex: 1;">${e.label}</span>
30
+ ${this._GuToggle(`visibility_${e.key}`)}
31
+ </div>
32
+ `
22
33
  }));
23
34
  return `
24
35
  <div class="container">
25
36
  ${this._GuLabel({ text: "Card Element Order & Visibility" })}
26
- ${this._GuOrderable("cardComposition", t)}
37
+ ${this._GuOrderable("cardComposition", i)}
27
38
  </div>
28
39
  `;
29
40
  }
30
41
  onRender() {
31
- this._initializeComposition(), this._registerValueChangeListeners();
32
- }
33
- onTemplateNodeUpdated(t) {
34
- super.onTemplateNodeUpdated(t), this._initializeComposition();
35
- }
36
- /**
37
- * Creates the HTML content for an orderable item with label and toggle
38
- */
39
- _createItemContent(t, i) {
40
- return `
41
- <div style="display: flex; align-items: center; justify-content: space-between;
42
- padding: 8px; gap: 8px;">
43
- <span style="flex: 1;">${t}</span>
44
- ${this._GuToggle(`visibility_${i}`)}
45
- </div>
46
- `;
47
- }
48
- /**
49
- * Registers event listeners for composition and visibility changes
50
- */
51
- _registerValueChangeListeners() {
52
- this.api.onValueChanged("cardComposition", (t) => {
53
- this._applyCompositionToBlock(t);
54
- }), s.forEach((t) => {
55
- this.api.onValueChanged(`visibility_${t.key}`, (i) => {
56
- this._applyVisibilityToBlock(t.key, i);
42
+ this._initializeComposition(), this.api.onValueChanged("cardComposition", (i) => {
43
+ this.currentComposition = i, this._applyCompositionToBlock(i);
44
+ }), s.forEach((i) => {
45
+ this.api.onValueChanged(`visibility_${i.key}`, (e) => {
46
+ this.currentVisibility[i.key] = e, this._applyVisibilityToBlock();
57
47
  });
58
48
  });
59
49
  }
50
+ onTemplateNodeUpdated(i) {
51
+ super.onTemplateNodeUpdated(i), this._initializeComposition();
52
+ }
60
53
  /**
61
- * Initializes composition order and visibility state from the current node
54
+ * Initialize the composition order and visibility from the block or use defaults
62
55
  */
63
56
  _initializeComposition() {
64
- const t = this._readCompositionFromNode(), i = this._readVisibilityFromRows(), e = {
65
- cardComposition: t,
66
- ...this._buildVisibilityValues(i)
57
+ var p;
58
+ const i = (p = this.currentNode) == null ? void 0 : p.querySelector(".ins-recommendation-v3-block-v2");
59
+ let e = null, l = null;
60
+ if (i && "getAttribute" in i && (e = i.getAttribute("data-card-composition"), l = i.getAttribute("data-card-visibility")), e) {
61
+ const t = e.split(",").filter(Boolean), r = s.map((c) => c.key);
62
+ t.every((c) => r.includes(c)) && t.length > 0 ? this.currentComposition = t : this.currentComposition = r;
63
+ } else
64
+ this.currentComposition = s.map((t) => t.key);
65
+ if (l)
66
+ try {
67
+ const t = JSON.parse(l);
68
+ this.currentVisibility = t;
69
+ } catch {
70
+ this.currentVisibility = s.reduce((t, r) => (t[r.key] = r.visible, t), {});
71
+ }
72
+ else
73
+ this.currentVisibility = s.reduce((t, r) => (t[r.key] = r.visible, t), {});
74
+ const d = {
75
+ cardComposition: this.currentComposition
67
76
  };
68
- this.api.updateValues(e);
69
- }
70
- /**
71
- * Reads composition order from node's data-card-composition attribute
72
- * Falls back to default order if attribute is not present
73
- */
74
- _readCompositionFromNode() {
75
- if (!this.currentNode || !("getAttribute" in this.currentNode))
76
- return s.map((i) => i.key);
77
- const t = this.currentNode.getAttribute(c);
78
- return t ? t.split(",").filter(Boolean) : s.map((i) => i.key);
79
- }
80
- /**
81
- * Builds visibility values object from the visibility map
82
- */
83
- _buildVisibilityValues(t) {
84
- return s.reduce((i, e) => (i[`visibility_${e.key}`] = t[e.key] ?? !0, i), {});
85
- }
86
- /**
87
- * Read visibility state from individual row elements' data-visibility attributes
88
- * This ensures toggles reflect the actual DOM state
89
- */
90
- _readVisibilityFromRows() {
91
- if (!this.currentNode)
92
- return this._getDefaultVisibilities();
93
- const t = Array.from(this.currentNode.querySelectorAll(l));
94
- console.debug("_readVisibilityFromRows - found attribute rows:", t.length);
95
- const i = this._extractVisibilityFromRows(t);
96
- return this._mergeWithDefaults(i);
97
- }
98
- /**
99
- * Returns default visibility values for all items
100
- */
101
- _getDefaultVisibilities() {
102
- return s.reduce((t, i) => (t[i.key] = i.visible, t), {});
103
- }
104
- /**
105
- * Extracts visibility values from DOM nodes
106
- */
107
- _extractVisibilityFromRows(t) {
108
- const i = {};
109
- return t.forEach((e) => {
110
- if (!("getAttribute" in e))
111
- return;
112
- const o = e.getAttribute(a), r = e.getAttribute(d);
113
- o && r !== null && (i[o] = this._parseVisibilityValue(r), console.debug(
114
- `_readVisibilityFromRows - ${o}: ${i[o]} (raw: ${r})`
115
- ));
116
- }), i;
117
- }
118
- /**
119
- * Parses visibility value from string to boolean
120
- * Accepts "1", "true" as true, everything else as false
121
- */
122
- _parseVisibilityValue(t) {
123
- return t === "1" || t === "true";
124
- }
125
- /**
126
- * Merges extracted visibilities with default values for missing keys
127
- */
128
- _mergeWithDefaults(t) {
129
- return s.forEach((i) => {
130
- i.key in t || (t[i.key] = i.visible, console.debug(`_readVisibilityFromRows - ${i.key}: using default ${i.visible}`));
131
- }), t;
77
+ s.forEach((t) => {
78
+ d[`visibility_${t.key}`] = this.currentVisibility[t.key] ?? !0;
79
+ }), this.api.updateValues(d);
132
80
  }
133
81
  /**
134
82
  * Apply the reordered composition to the block's HTML structure
135
- * Updates the data-card-composition attribute and reorders product attributes
136
- */
137
- _applyCompositionToBlock(t) {
138
- if (console.debug("_applyCompositionToBlock - composition:", t), !this.currentNode) {
139
- console.debug("_applyCompositionToBlock - no current node");
140
- return;
141
- }
142
- this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(c, t.join(",")).apply(new n("Update card composition")), this._reorderProductAttributes(t);
143
- }
144
- /**
145
- * Reorders attribute rows within each product row based on composition order
146
83
  */
147
- _reorderProductAttributes(t) {
84
+ _applyCompositionToBlock(i) {
148
85
  if (!this.currentNode)
149
86
  return;
150
- const i = this.currentNode.querySelectorAll(A);
151
- if (!(i != null && i.length))
152
- return;
153
- const e = this.api.getDocumentModifier();
154
- i.forEach((o) => {
155
- const r = this._buildCompositionHtml(o, t);
156
- e.modifyHtml(o).setInnerHtml(r);
157
- }), e.apply(new n("Reorder product attributes"));
158
- }
159
- /**
160
- * Builds HTML string with attributes ordered according to composition
161
- */
162
- _buildCompositionHtml(t, i) {
163
- return i.reduce((e, o) => {
164
- const r = t.querySelector(`${l}[${a}="${o}"]`);
165
- return r && "getOuterHTML" in r ? e + r.getOuterHTML() : e;
166
- }, "");
87
+ const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
88
+ e && this.api.getDocumentModifier().modifyHtml(e).setAttribute("data-card-composition", i.join(",")).apply(new u("Stored card composition order"));
167
89
  }
168
90
  /**
169
91
  * Apply visibility changes to the block's HTML structure
170
- * Updates display style and data-visibility attribute for all matching rows
171
92
  */
172
- _applyVisibilityToBlock(t, i) {
173
- if (console.debug("_applyVisibilityToBlock", t, i), !this.currentNode)
174
- return;
175
- const e = this.currentNode.querySelectorAll(`${l}[${a}="${t}"]`);
176
- if (!(e != null && e.length))
93
+ _applyVisibilityToBlock() {
94
+ if (!this.currentNode)
177
95
  return;
178
- const o = i ? "table-row" : "none", r = i ? "1" : "0", p = `Set ${t} visibility to ${i ? "visible" : "hidden"}`, u = this.api.getDocumentModifier();
179
- e.forEach((b) => {
180
- u.modifyHtml(b).setStyle("display", o).setAttribute(d, r);
181
- }), u.apply(new n(p));
96
+ const i = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
97
+ i && this.api.getDocumentModifier().modifyHtml(i).setAttribute("data-card-visibility", JSON.stringify(this.currentVisibility)).apply(new u("Stored card visibility settings"));
182
98
  }
183
99
  }
184
100
  export {
185
- R as COMPOSITION_CONTROL_BLOCK_ID,
186
- N as RecommendationCardCompositionControl
101
+ h as COMPOSITION_CONTROL_BLOCK_ID,
102
+ g as RecommendationCardCompositionControl
187
103
  };