@useinsider/guido 1.0.3-beta.294f9bc → 1.0.3-beta.2cf8046

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 (82) hide show
  1. package/README.md +32 -0
  2. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +21 -0
  3. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +99 -0
  4. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +20 -18
  5. package/dist/composables/useBlocksConfig.js +1 -2
  6. package/dist/composables/useStripo.js +9 -9
  7. package/dist/enums/extensions/recommendationBlock.js +2 -2
  8. package/dist/enums/onboarding.js +7 -3
  9. package/dist/enums/unsubscribe.js +26 -27
  10. package/dist/extensions/Blocks/Checkbox/block.js +5 -2
  11. package/dist/extensions/Blocks/Checkbox/control.js +14 -15
  12. package/dist/extensions/Blocks/Items/block.js +67 -0
  13. package/dist/extensions/Blocks/Items/controls/button/link.js +68 -0
  14. package/dist/extensions/Blocks/Items/controls/cardComposition.js +193 -0
  15. package/dist/extensions/Blocks/Items/controls/image/link.js +68 -0
  16. package/dist/extensions/Blocks/Items/controls/index.js +217 -0
  17. package/dist/extensions/Blocks/Items/controls/name/trimming.js +70 -0
  18. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +107 -0
  19. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +123 -0
  20. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +76 -0
  21. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +61 -0
  22. package/dist/extensions/Blocks/Items/controls/settingsControl.js +280 -0
  23. package/dist/extensions/Blocks/Items/enums/controlEnums.js +5 -0
  24. package/dist/extensions/Blocks/Items/enums/productEnums.js +201 -0
  25. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +76 -0
  26. package/dist/extensions/Blocks/Items/extension.js +19 -0
  27. package/dist/extensions/Blocks/Items/iconsRegistry.js +32 -0
  28. package/dist/extensions/Blocks/Items/items.css.js +23 -0
  29. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +61 -0
  30. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +61 -0
  31. package/dist/extensions/Blocks/Items/settingsPanel.js +106 -0
  32. package/dist/extensions/Blocks/Items/store/items-block.js +71 -0
  33. package/dist/extensions/Blocks/Items/template.js +110 -0
  34. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
  35. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
  36. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +67 -0
  37. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +44 -0
  38. package/dist/extensions/Blocks/RadioButton/block.js +5 -2
  39. package/dist/extensions/Blocks/RadioButton/control.js +17 -18
  40. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
  41. package/dist/extensions/Blocks/common-control.js +174 -110
  42. package/dist/extensions/Blocks/controlFactories.js +223 -0
  43. package/dist/guido.css +1 -1
  44. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +213 -168
  45. package/dist/package.json.js +1 -1
  46. package/dist/services/recommendationApi.js +13 -19
  47. package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +2 -0
  48. package/dist/src/enums/onboarding.d.ts +4 -0
  49. package/dist/src/extensions/Blocks/Checkbox/block.d.ts +1 -0
  50. package/dist/src/extensions/Blocks/Items/block.d.ts +13 -0
  51. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +14 -0
  52. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +33 -0
  53. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +14 -0
  54. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +501 -0
  55. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +14 -0
  56. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +19 -0
  57. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +21 -0
  58. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +14 -0
  59. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +13 -0
  60. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +42 -0
  61. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +61 -0
  62. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +160 -0
  63. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +49 -0
  64. package/dist/src/extensions/Blocks/Items/extension.d.ts +2 -0
  65. package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +4 -0
  66. package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +4 -0
  67. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +41 -0
  68. package/dist/src/extensions/Blocks/Items/template.d.ts +16 -0
  69. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
  70. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
  71. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +44 -0
  72. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
  73. package/dist/src/extensions/Blocks/RadioButton/block.d.ts +1 -0
  74. package/dist/src/extensions/Blocks/common-control.d.ts +44 -7
  75. package/dist/src/extensions/Blocks/controlFactories.d.ts +312 -0
  76. package/dist/src/stores/onboarding.d.ts +334 -0
  77. package/dist/static/styles/customEditorStyle.css.js +1 -1
  78. package/dist/stores/onboarding.js +20 -12
  79. package/dist/utils/genericUtil.js +16 -17
  80. package/package.json +11 -4
  81. package/dist/src/utils/environmentUtil.d.ts +0 -5
  82. package/dist/utils/environmentUtil.js +0 -4
package/README.md CHANGED
@@ -787,3 +787,35 @@ ISC License
787
787
  - Playwright integrationBoilerplate/control.ts
788
788
  - Commitlint & Precommit Hooks integration
789
789
  - Get Pre-built display conditions from API
790
+
791
+ Recommendation Block:
792
+ - [ ] Validations for Filters
793
+ - [ ] DOM Rerender after Filters change
794
+ - [ ] Change currencySymbol as Input Type
795
+ - [ ] Apply filter query to request
796
+ - [ ] Drawer loading bug
797
+ - [ ] Drawer send request when apply filters
798
+ - [ ] Clear all feature for Drawer
799
+ - [ ] Stripo's controls should be effect specific DOM item -- Try extending CommonControl class
800
+ - [ ] Show toaster message if uses multiple recommendation blocks in same template
801
+ - [ ] Change filter button text as Change Filters
802
+ - [ ] Migration template for Recommendation Block
803
+ - [ ] Recommendation Algorithm default value should be mostPopular
804
+ - [ ] Default fields for empty template like currency, title etc.
805
+ - [ ] Recommendation Block Icon Registry should be updated
806
+ - [ ] AMP Block Icon should be updated
807
+ - [ ] Padding feature for between Product Rows
808
+
809
+ Items Block Phase 2:
810
+ [ ] Writing configs to esd-config-data DOM.
811
+ [ ] Build on save feature should be working
812
+ [ ] Data Migration feature should be working
813
+
814
+ Tech Debts:
815
+ [ ] Merge Custom Blocks into a single File
816
+ [ ] Move Custom Blocks names to an enum file
817
+ [ ] Template Replacement should be optimized for version history
818
+ [ ] Code Optimization for Items Block inner blocks reordering
819
+ [ ] Image Size & Margins controls has an error on console
820
+ [ ] Feed Text Trimming feature to toggle settings
821
+ [ ] Formatted Price feature to toggle settings
@@ -0,0 +1,21 @@
1
+ import g from "./ItemsOnboarding.vue2.js";
2
+ /* empty css */
3
+ import m from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var l = function() {
5
+ var e, n, r, i, s, a;
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) {
8
+ return t.onboardingStore.close("itemsOnboarding");
9
+ }, nextButtonClick: t.handleNext } }) : o._e();
10
+ }, c = [], p = /* @__PURE__ */ m(
11
+ g,
12
+ l,
13
+ c,
14
+ !1,
15
+ null,
16
+ "dd1a237a"
17
+ );
18
+ const I = p.exports;
19
+ export {
20
+ I as default
21
+ };
@@ -0,0 +1,99 @@
1
+ import { defineComponent as l, computed as a, watch as u } from "vue";
2
+ import { useTranslations as x } from "../../../composables/useTranslations.js";
3
+ import { RIBBON_SELECTOR as T, UI_EDITOR_SELECTOR as O, CARD_COMPOSITION_TAB_SELECTOR as B, SETTINGS_TAB_SELECTOR as f } from "../../../enums/onboarding.js";
4
+ import { useOnboardingStore as C } from "../../../stores/onboarding.js";
5
+ import { InOnboard as k } from "@useinsider/design-system-vue";
6
+ const E = /* @__PURE__ */ l({
7
+ __name: "ItemsOnboarding",
8
+ setup(_) {
9
+ const e = x(), o = C(), c = a(() => {
10
+ const t = document.querySelector(T);
11
+ return (t == null ? void 0 : t.offsetHeight) ?? 0;
12
+ }), n = (t) => `${t + c.value}px`, r = (t) => {
13
+ const i = document.querySelector(O);
14
+ if (!(i != null && i.shadowRoot))
15
+ return;
16
+ const { shadowRoot: s } = i, m = s.querySelector(t);
17
+ m && m.click();
18
+ }, d = a(() => [
19
+ {
20
+ classes: "guido-items-onboarding-card-1",
21
+ right: "426px",
22
+ top: n(90),
23
+ position: "Right Top",
24
+ title: e("email-editor.onboarding-items-title"),
25
+ description: e("email-editor.onboarding-items-description"),
26
+ imageSource: "",
27
+ backButtonClick: () => {
28
+ },
29
+ nextButtonType: "text",
30
+ nextButtonText: e("products.next"),
31
+ nextButtonClick: () => {
32
+ o.next("itemsOnboarding");
33
+ }
34
+ },
35
+ {
36
+ classes: "guido-items-onboarding-card-2",
37
+ right: "426px",
38
+ top: n(218),
39
+ position: "Right Top",
40
+ title: e("email-editor.onboarding-items-item-type-title"),
41
+ description: e("email-editor.onboarding-items-item-type-description"),
42
+ imageSource: "",
43
+ backButtonType: "text",
44
+ backButtonText: e("ds-steps.back"),
45
+ backButtonClick: () => {
46
+ o.previous("itemsOnboarding");
47
+ },
48
+ nextButtonType: "text",
49
+ nextButtonText: e("products.next"),
50
+ nextButtonClick: () => {
51
+ o.next("itemsOnboarding");
52
+ }
53
+ },
54
+ {
55
+ classes: "guido-items-onboarding-card-3",
56
+ right: "426px",
57
+ top: n(140),
58
+ position: "Right Top",
59
+ title: e("email-editor.onboarding-items-composition-title"),
60
+ description: e("email-editor.onboarding-items-composition-description"),
61
+ imageSource: "",
62
+ backButtonType: "text",
63
+ backButtonText: e("ds-steps.back"),
64
+ backButtonClick: () => {
65
+ o.previous("itemsOnboarding");
66
+ },
67
+ nextButtonType: "text",
68
+ nextButtonText: e("action-builder.ok"),
69
+ nextButtonClick: () => {
70
+ o.close("itemsOnboarding");
71
+ }
72
+ }
73
+ ]), g = a(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
74
+ var t, i;
75
+ (i = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || i.call(t);
76
+ }, b = () => {
77
+ var t, i;
78
+ (i = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || i.call(t);
79
+ };
80
+ return u(
81
+ () => o.isActive("itemsOnboarding"),
82
+ (t) => {
83
+ t && o.setConfig("itemsOnboarding", d.value);
84
+ },
85
+ { immediate: !0 }
86
+ ), u(
87
+ () => o.onboardings.itemsOnboarding.cardIndex,
88
+ (t, i) => {
89
+ if (!o.isActive("itemsOnboarding"))
90
+ return;
91
+ const s = `${i}-${t}`;
92
+ s === "1-2" && r(B), s === "2-1" && r(f);
93
+ }
94
+ ), { __sfc: !0, trans: e, onboardingStore: o, ribbonOffset: c, getTopPosition: n, switchTab: r, onboardingCardsConfig: d, isVisible: g, handleNext: p, handleBack: b, InOnboard: k };
95
+ }
96
+ });
97
+ export {
98
+ E as default
99
+ };
@@ -1,23 +1,25 @@
1
1
  import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
- import { usePartner as u } from "../../../composables/usePartner.js";
3
- import { useEditorStore as v } from "../../../stores/editor.js";
4
- import { useOnboardingStore as l } from "../../../stores/onboarding.js";
5
- import { usePreviewStore as y } from "../../../stores/preview.js";
6
- import S from "./AMPOnboarding.vue.js";
7
- import h from "./GenericOnboarding.vue.js";
8
- import w from "./NewVersionPopup.vue.js";
9
- import P from "./TextBlockOnboarding.vue.js";
10
- import _ from "./VersionHistoryOnboarding.vue.js";
11
- const F = /* @__PURE__ */ b({
2
+ import u from "./AMPOnboarding.vue.js";
3
+ import v from "./GenericOnboarding.vue.js";
4
+ import l from "./ItemsOnboarding.vue.js";
5
+ import y from "./NewVersionPopup.vue.js";
6
+ import S from "./TextBlockOnboarding.vue.js";
7
+ import h from "./VersionHistoryOnboarding.vue.js";
8
+ import { usePartner as w } from "../../../composables/usePartner.js";
9
+ import { useEditorStore as P } from "../../../stores/editor.js";
10
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
11
+ import { usePreviewStore as A } from "../../../stores/preview.js";
12
+ const G = /* @__PURE__ */ b({
12
13
  __name: "OnboardingWrapper",
13
14
  emits: ["onboarding-finished"],
14
- setup(A, { emit: f }) {
15
- const o = l(), r = v(), s = y(), { isTestPartner: a } = u(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
16
- { type: "newVersionPopup", component: w },
17
- { type: "genericOnboarding", component: h },
18
- { type: "textBlockOnboarding", component: P },
19
- { type: "versionHistoryOnboarding", component: _ },
20
- { type: "ampOnboarding", component: S }
15
+ setup(H, { emit: f }) {
16
+ const o = _(), r = P(), s = A(), { isTestPartner: a } = w(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
17
+ { type: "newVersionPopup", component: y },
18
+ { type: "genericOnboarding", component: v },
19
+ { type: "textBlockOnboarding", component: S },
20
+ { type: "versionHistoryOnboarding", component: h },
21
+ { type: "ampOnboarding", component: u },
22
+ { type: "itemsOnboarding", component: l }
21
23
  ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
22
24
  return O(async () => {
23
25
  await o.fetchUserModalState();
@@ -40,5 +42,5 @@ const F = /* @__PURE__ */ b({
40
42
  }
41
43
  });
42
44
  export {
43
- F as default
45
+ G as default
44
46
  };
@@ -19,8 +19,7 @@ const l = {
19
19
  "recommendation-block": () => import("../extensions/Blocks/Recommendation/extension.js"),
20
20
  "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
21
21
  "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
22
- "items-block": null
23
- // TODO: Add ItemsBlock extension when available
22
+ "items-block": () => import("../extensions/Blocks/Items/extension.js")
24
23
  }, a = (n) => {
25
24
  if (!n || !n.length)
26
25
  return {};
@@ -1,17 +1,17 @@
1
1
  import { useActionsApi as h } from "./useActionsApi.js";
2
2
  import { useBlocksConfig as b } from "./useBlocksConfig.js";
3
3
  import { useConfig as k } from "./useConfig.js";
4
- import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
5
- import { useStripoEventHandler as V } from "./useStripoEventHandler.js";
6
- import { useToaster as _ } from "./useToaster.js";
7
- import { displayConditions as F } from "../enums/displayConditions.js";
8
- import { useStripoApi as A } from "../services/stripoApi.js";
4
+ import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
6
+ import { useToaster as B } from "./useToaster.js";
7
+ import { displayConditions as A } from "../enums/displayConditions.js";
8
+ import { useStripoApi as F } from "../services/stripoApi.js";
9
9
  import T from "../static/styles/customEditorStyle.css.js";
10
10
  import { useEditorStore as v } from "../stores/editor.js";
11
11
  import { dynamicContentToMergeTags as I } from "../utils/genericUtil.js";
12
12
  import M from "../package.json.js";
13
13
  const N = (d) => {
14
- const { config: u } = k(), { handleError: l } = _(), { getToken: f, getCustomFonts: S } = A(), { handleEvent: C } = V(), { getStripoBlocksConfig: y } = b(), E = async (i, r = []) => {
14
+ const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: S } = F(), { handleEvent: C } = _(), { getStripoBlocksConfig: y } = b(), E = async (i, r = []) => {
15
15
  var m, g;
16
16
  const t = v(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: c } = await y();
17
17
  window.UIEditor.initEditor(
@@ -33,10 +33,10 @@ const N = (d) => {
33
33
  customViewStyles: T,
34
34
  conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
35
35
  customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
36
- conditionCategories: F,
36
+ conditionCategories: A,
37
37
  enableXSSSecurity: !0,
38
38
  messageSettingsEnabled: !1,
39
- selectBlockAfterDropFromSettingsPanel: !0,
39
+ selectElementAfterDrop: !0,
40
40
  ...e ? { baseBlocks: e } : {},
41
41
  editorFonts: {
42
42
  showDefaultStandardFonts: !0,
@@ -58,7 +58,7 @@ const N = (d) => {
58
58
  },
59
59
  onTemplateLoaded() {
60
60
  try {
61
- const { importCss: o } = B(), { activateCustomViewStyles: s } = h();
61
+ const { importCss: o } = V(), { activateCustomViewStyles: s } = h();
62
62
  o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
63
63
  t.hasChanges = !1;
64
64
  }, 1e3);
@@ -12,8 +12,8 @@ const s = {
12
12
  { id: 61, key: "mostPopular", name: "Most Popular Items", path: "most-popular" },
13
13
  { id: 62, key: "mostPurchased", name: "Top Sellers", path: "top-sellers" }
14
14
  ], u = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], l = [
15
- { text: "after the amount", value: "1" },
16
- { text: "before the amount", value: "0" }
15
+ { text: "before the amount", value: "0" },
16
+ { text: "after the amount", value: "1" }
17
17
  ], c = [
18
18
  { text: "dot(.)", value: "." },
19
19
  { text: "comma(,)", value: "," }
@@ -2,8 +2,12 @@ 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 = "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", a = "https://academy.useinsider.com/docs/email-drag-drop-editor";
6
6
  export {
7
- t as ACADEMY_LINK,
8
- e as SERVICE_HOVER_SELECTORS
7
+ a as ACADEMY_LINK,
8
+ n as CARD_COMPOSITION_TAB_SELECTOR,
9
+ o as RIBBON_SELECTOR,
10
+ e as SERVICE_HOVER_SELECTORS,
11
+ s as SETTINGS_TAB_SELECTOR,
12
+ t as UI_EDITOR_SELECTOR
9
13
  };
@@ -1,26 +1,25 @@
1
- import { useTranslations as n } from "../composables/useTranslations.js";
2
- import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
- const e = n(), I = {
1
+ import { useTranslations as e } from "../composables/useTranslations.js";
2
+ const s = e(), R = {
4
3
  UNSUBSCRIBE_LINK_TYPE: 1,
5
4
  PREFERENCES_LINK_TYPE: 3
6
- }, r = {
5
+ }, S = {
7
6
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
8
7
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
9
8
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
10
9
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
11
- }, s = R(), _ = {
12
- UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
13
- PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
14
- }, i = "iid", B = {
10
+ }, N = {
11
+ UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
12
+ PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
13
+ }, I = "iid", _ = {
15
14
  name: "Global Unsubscribe",
16
15
  sendGridId: "G"
17
- }, C = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", c = "/email/unsubscribe-pages", E = {
16
+ }, i = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
18
17
  GLOBAL_UNSUBSCRIBE: 1,
19
18
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
20
19
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
21
20
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
22
21
  RESUBSCRIBE: 5
23
- }, t = {
22
+ }, B = {
24
23
  [E.GLOBAL_UNSUBSCRIBE]: [
25
24
  E.GLOBAL_UNSUBSCRIBE,
26
25
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -30,27 +29,27 @@ const e = n(), I = {
30
29
  E.SUBSCRIPTION_PREFERENCE_CENTER,
31
30
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
32
31
  ]
33
- }, U = {
34
- [E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
35
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
36
- [E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
37
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
38
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
39
- }, o = {
32
+ }, C = {
33
+ [E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
34
+ [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
35
+ [E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
36
+ [E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
37
+ [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
38
+ }, c = {
40
39
  default: "{{ins-unsubscribe-link}}",
41
40
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
42
41
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
43
42
  };
44
43
  export {
45
- C as ACADEMY_LINK,
46
- B as DEFAULT_UNSUBSCRIBE_GROUP,
47
- i as INSIDER_ID,
48
- r as LINK_REGEXES,
49
- I as LINK_TYPES,
50
- o as MERGE_TAGS,
44
+ i as ACADEMY_LINK,
45
+ _ as DEFAULT_UNSUBSCRIBE_GROUP,
46
+ I as INSIDER_ID,
47
+ S as LINK_REGEXES,
48
+ R as LINK_TYPES,
49
+ c as MERGE_TAGS,
51
50
  E as PAGE_TYPES,
52
- t as TYPE_COLLECTIONS,
53
- U as TYPE_TRANSLATIONS,
54
- c as UNSUBSCRIBE_PAGES_LINK,
55
- _ as URLS
51
+ B as TYPE_COLLECTIONS,
52
+ C as TYPE_TRANSLATIONS,
53
+ r as UNSUBSCRIBE_PAGES_LINK,
54
+ N as URLS
56
55
  };
@@ -1,7 +1,7 @@
1
1
  import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { getDefaultTemplate as o } from "./template.js";
3
3
  const r = "checkbox-block";
4
- class p extends e {
4
+ class s extends e {
5
5
  constructor() {
6
6
  super();
7
7
  }
@@ -23,8 +23,11 @@ class p extends e {
23
23
  getTemplate() {
24
24
  return o();
25
25
  }
26
+ allowInnerBlocksDND() {
27
+ return !1;
28
+ }
26
29
  }
27
30
  export {
28
31
  r as CHECKBOX_BLOCK_ID,
29
- p as CheckboxBlock
32
+ s as CheckboxBlock
30
33
  };
@@ -2,9 +2,9 @@ var d = Object.defineProperty;
2
2
  var l = (r, n, e) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
3
3
  var o = (r, n, e) => l(r, typeof n != "symbol" ? n + "" : n, e);
4
4
  import { useHttp as L } from "../../../composables/useHttp.js";
5
- import { DEFAULT_UNSUBSCRIBE_GROUP as c } from "../../../enums/unsubscribe.js";
5
+ import { DEFAULT_UNSUBSCRIBE_GROUP as u } from "../../../enums/unsubscribe.js";
6
6
  import { Control as h, UIElementType as i, UEAttr as t, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- const m = "ui-elements-checkbox", u = "select", { get: C } = L();
7
+ const m = "ui-elements-checkbox", a = "select", { get: C } = L();
8
8
  class S extends h {
9
9
  constructor() {
10
10
  super(...arguments);
@@ -16,16 +16,15 @@ class S extends h {
16
16
  return m;
17
17
  }
18
18
  _setFormValues() {
19
- if (this.selectedUnsubGroup = "", this.currentNode && "getAttribute" in this.currentNode) {
19
+ if (this.currentNode && "getAttribute" in this.currentNode) {
20
20
  const e = this.currentNode.getAttribute("id");
21
21
  if (e) {
22
- const s = e === c.sendGridId ? e : Number(e);
23
- s && (this.selectedUnsubGroup = s);
22
+ const s = e === u.sendGridId ? e : Number(e);
23
+ s && (this.selectedUnsubGroup = s, this.api.updateValues({
24
+ [a]: this.selectedUnsubGroup
25
+ }));
24
26
  }
25
27
  }
26
- this.api.updateValues({
27
- [u]: this.selectedUnsubGroup
28
- });
29
28
  }
30
29
  _getLabel(e, s = `${Math.random()}`) {
31
30
  return `
@@ -55,7 +54,7 @@ class S extends h {
55
54
  </${i.LABEL}>
56
55
 
57
56
  <${i.SELECTPICKER}
58
- ${t.SELECTPICKER.name}="${u}"
57
+ ${t.SELECTPICKER.name}="${a}"
59
58
  ${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
60
59
  ${this._getSelect()}
61
60
  </${i.SELECTPICKER}>
@@ -67,21 +66,21 @@ class S extends h {
67
66
  this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new p(`Updated text to ${e}`));
68
67
  }
69
68
  _listenToFormUpdates() {
70
- this.api.onValueChanged(u, (e) => this._onSelectChange(e));
69
+ this.api.onValueChanged(a, (e) => this._onSelectChange(e));
71
70
  }
72
71
  onTemplateNodeUpdated(e) {
73
- this.currentNode = e, this._setFormValues();
72
+ this.currentNode = e;
74
73
  }
75
74
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
76
75
  async onRender() {
77
76
  const e = await C(
78
77
  "/unsubscribe-groups/unsubscribe-list"
79
- ), s = [c, ...e.data], E = s.map((a) => ({
80
- [t.SELECT_ITEM.text]: a.name,
81
- [t.SELECT_ITEM.value]: a.sendGridId
78
+ ), s = [u, ...e.data], E = s.map((c) => ({
79
+ [t.SELECT_ITEM.text]: c.name,
80
+ [t.SELECT_ITEM.value]: c.sendGridId
82
81
  }));
83
82
  this.unsubList = s, this.api.setUIEAttribute(
84
- u,
83
+ a,
85
84
  t.SELECTPICKER.items,
86
85
  E
87
86
  ), this._setFormValues(), this._listenToFormUpdates();
@@ -0,0 +1,67 @@
1
+ import { useOnboardingStore as L } from "../../../stores/onboarding.js";
2
+ import { Block as S, BlockCompositionType as y, ModificationDescription as u } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { configAttributes as t } from "./enums/productEnums.js";
4
+ import { DefaultConfigValues as e, SETTINGS_ENUMS as l } from "./enums/settingsEnums.js";
5
+ import { useItemsBlockStore as I } from "./store/items-block.js";
6
+ import { getDefaultTemplate as V } from "./template.js";
7
+ const B = "items-block";
8
+ class z extends S {
9
+ getId() {
10
+ return B;
11
+ }
12
+ getIcon() {
13
+ return "items-icon";
14
+ }
15
+ getBlockCompositionType() {
16
+ return y.CONTAINER;
17
+ }
18
+ getName() {
19
+ return this.api.translate("Items");
20
+ }
21
+ getDescription() {
22
+ return this.api.translate("Items lets you display personalized products based on user behavior.");
23
+ }
24
+ getTemplate() {
25
+ const i = I();
26
+ return V({
27
+ orientation: l.ORIENTATION.HORIZONTAL,
28
+ itemsType: l.ITEMS_TYPE.CART_ITEMS,
29
+ itemId: "{{Abandoned Cart Item (1) Url}}",
30
+ currencySymbol: i.currencySymbol,
31
+ currencyLocation: i.currencyLocation,
32
+ formattedPrice: i.formattedPrice
33
+ });
34
+ }
35
+ allowInnerBlocksDND() {
36
+ return !1;
37
+ }
38
+ onCreated(i) {
39
+ const n = i.querySelector("esd-config-block");
40
+ if (!n)
41
+ return;
42
+ const o = n, s = o.getAttribute("data-initialized") || "0", a = o.getAttribute(t.BLOCK_INSTANCE_ID), c = () => String(Date.now() + Math.floor(Math.random() * 1e3));
43
+ if (Number(s)) {
44
+ if (!a) {
45
+ const r = c();
46
+ this.api.getDocumentModifier().modifyHtml(o).setAttribute(t.BLOCK_INSTANCE_ID, r).apply(new u("Assign block instance ID to legacy block"));
47
+ }
48
+ } else {
49
+ const r = e.itemsType, d = e.cartItemsSelectControlValue, m = e.cardOrientationControlValue, T = e.productNameTrimmingControlValue, C = e.productPriceHideDiscountControlValue, b = e.productPriceFormattedControlValue, E = e.productPriceCurrencySymbolControlValue, O = e.productPriceCurrencyLocationControlValue, A = e.productButtonLinkControlValue, _ = e.productImageLinkControlValue, N = e.productImageVisible, p = e.productNameVisible, f = e.productQuantityVisible, g = e.productPriceVisible, D = e.productOriginalPriceVisible, R = e.productButtonVisible, P = c();
50
+ this.api.getDocumentModifier().modifyHtml(o).setAttribute("data-source", r).setAttribute(t.TYPE, r).setAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE, d).setAttribute(t.ORIENTATION, m).setAttribute(t.PRODUCT_NAME_TRIMMING, T).setAttribute(t.PRODUCT_PRICE_HIDE_DISCOUNT, C).setAttribute(t.PRODUCT_PRICE_FORMATTED, b).setAttribute(t.PRODUCT_PRICE_CURRENCY_SYMBOL, E).setAttribute(t.PRODUCT_PRICE_CURRENCY_LOCATION, O).setAttribute(t.PRODUCT_BUTTON_LINK, A).setAttribute(t.PRODUCT_IMAGE_LINK, _).setAttribute(t.BLOCK_INSTANCE_ID, P).setAttribute("data-initialized", "1").setAttribute(t.NAME_CONTROL_ENABLED, e.productNameControlEnabled).setAttribute(
51
+ t.QUANTITY_CONTROL_ENABLED,
52
+ e.productQuantityControlEnabled
53
+ ).setAttribute(t.PRICE_CONTROL_OPENED, e.productPriceControlOpened).setAttribute(t.PRODUCT_IMAGE_VISIBLE, N).setAttribute(t.PRODUCT_NAME_VISIBLE, p).setAttribute(t.PRODUCT_QUANTITY_VISIBLE, f).setAttribute(t.PRODUCT_PRICE_VISIBLE, g).setAttribute(t.PRODUCT_ORIGINAL_PRICE_VISIBLE, D).setAttribute(t.PRODUCT_BUTTON_VISIBLE, R).apply(new u("Initialize config block attributes with defaults")), L().startOnboarding("itemsOnboarding");
54
+ }
55
+ }
56
+ onSelect(i) {
57
+ const n = i.querySelector("esd-config-block"), o = I();
58
+ if (!n)
59
+ return;
60
+ const s = n, a = s.getAttribute(t.TYPE) || e.itemsType, c = s.getAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE) || e.cartItemsSelectControlValue, r = s.getAttribute(t.ORIENTATION) || e.cardOrientationControlValue;
61
+ o.setItemsType(a), o.setItemIds(c), o.setOrientation(r);
62
+ }
63
+ }
64
+ export {
65
+ B as BLOCK_ID,
66
+ z as ItemsBlock
67
+ };
@@ -0,0 +1,68 @@
1
+ var r = Object.defineProperty;
2
+ var a = (o, e, t) => e in o ? r(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var s = (o, e, t) => a(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommonControl as u } from "../../../common-control.js";
5
+ import { ItemsBlockControlId as d } from "../../enums/controlEnums.js";
6
+ import { useItemsBlockStore as l } from "../../store/items-block.js";
7
+ import { syncButtonLinkFromAttributes as h } from "../../utils/syncAttributesFromConfigBlock.js";
8
+ import { updateConfigBlockAttributes as m } from "../../utils/updateAttributes.js";
9
+ const i = d.BUTTON_LINK, n = {
10
+ LINK: "link"
11
+ };
12
+ class C extends u {
13
+ constructor() {
14
+ super(...arguments);
15
+ s(this, "store", l());
16
+ }
17
+ getId() {
18
+ return i;
19
+ }
20
+ getTemplate() {
21
+ return `
22
+ <div class="${i}">
23
+ ${this._getLink()}
24
+ </div>
25
+ `;
26
+ }
27
+ onRender() {
28
+ this.api.updateValues({
29
+ [n.LINK]: this.store.buttonLink
30
+ }), this._listenToFormUpdates();
31
+ }
32
+ onTemplateNodeUpdated(t) {
33
+ super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
34
+ () => h(this.currentNode),
35
+ () => {
36
+ this.api.updateValues({
37
+ [n.LINK]: this.store.buttonLink
38
+ });
39
+ }
40
+ );
41
+ }
42
+ _listenToFormUpdates() {
43
+ this.api.onValueChanged(
44
+ n.LINK,
45
+ (t) => this._onLinkChange(t)
46
+ );
47
+ }
48
+ _onLinkChange(t) {
49
+ console.debug("Button link changed to: ", t), this.store.setButtonLink(t), m(this.currentNode, this.api);
50
+ }
51
+ _getLink() {
52
+ return `
53
+ ${this._GuOneColumn([
54
+ this._GuLabel({ text: "Link" }),
55
+ this._GuTextInput({
56
+ name: n.LINK,
57
+ placeholder: "Enter Link",
58
+ className: "es-100",
59
+ disabled: !0
60
+ })
61
+ ])}
62
+ `;
63
+ }
64
+ }
65
+ export {
66
+ C as ButtonLinkControl,
67
+ i as CONTROL_BLOCK_ID
68
+ };