@useinsider/guido 1.0.3-beta.dfb1fcf → 1.0.3-beta.e1adf59

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 (130) hide show
  1. package/README.md +3 -144
  2. package/dist/components/Guido.vue.js +10 -12
  3. package/dist/components/Guido.vue2.js +101 -84
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
  6. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  7. package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
  8. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  9. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  11. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  12. package/dist/composables/useApiErrorTracking.js +120 -0
  13. package/dist/composables/useErrorTracking.js +98 -0
  14. package/dist/composables/useGuidoActions.js +9 -19
  15. package/dist/composables/useHttp.js +89 -52
  16. package/dist/composables/useStripo.js +163 -66
  17. package/dist/composables/useStripoErrorCategory.js +86 -0
  18. package/dist/composables/useStripoSlackNotifier.js +47 -0
  19. package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
  20. package/dist/config/migrator/index.js +6 -7
  21. package/dist/enums/defaults.js +8 -16
  22. package/dist/enums/onboarding.js +1 -2
  23. package/dist/enums/unsubscribe.js +25 -27
  24. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  25. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  26. package/dist/extensions/Blocks/Recommendation/block.js +3 -6
  27. package/dist/extensions/Blocks/Recommendation/control.js +65 -109
  28. package/dist/extensions/Blocks/Recommendation/extension.js +7 -18
  29. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -159
  30. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  31. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  32. package/dist/extensions/Blocks/common-control.js +43 -125
  33. package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
  34. package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
  35. package/dist/guido.css +1 -1
  36. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +100 -312
  37. package/dist/package.json.js +1 -1
  38. package/dist/services/slackNotificationService.js +167 -0
  39. package/dist/services/stripoApi.js +49 -19
  40. package/dist/services/stripoErrorDeduplicationService.js +91 -0
  41. package/dist/src/@types/generic.d.ts +6 -42
  42. package/dist/src/components/Guido.vue.d.ts +3 -4
  43. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  44. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  45. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  46. package/dist/src/composables/useApiErrorTracking.d.ts +26 -0
  47. package/dist/src/composables/useErrorTracking.d.ts +30 -0
  48. package/dist/src/composables/useGuidoActions.d.ts +0 -9
  49. package/dist/src/composables/useStripoErrorCategory.d.ts +26 -0
  50. package/dist/src/composables/useStripoSlackNotifier.d.ts +8 -0
  51. package/dist/src/enums/onboarding.d.ts +0 -1
  52. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -1
  53. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +2 -11
  54. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  55. package/dist/src/extensions/Blocks/Recommendation/template.d.ts +6 -0
  56. package/dist/src/extensions/Blocks/common-control.d.ts +0 -21
  57. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
  58. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
  59. package/dist/src/services/slackNotificationService.d.ts +110 -0
  60. package/dist/src/services/stripoErrorDeduplicationService.d.ts +75 -0
  61. package/dist/src/stores/config.d.ts +2 -10
  62. package/dist/src/stores/dynamic-content.d.ts +3 -3
  63. package/dist/src/stores/editor.d.ts +1 -1
  64. package/dist/src/stores/onboarding.d.ts +1 -1
  65. package/dist/src/stores/preview.d.ts +1 -1
  66. package/dist/src/stores/recommendation.d.ts +1 -1
  67. package/dist/src/stores/save-as-template.d.ts +1 -1
  68. package/dist/src/stores/toaster.d.ts +1 -1
  69. package/dist/src/stores/unsubscribe.d.ts +1 -1
  70. package/dist/src/stores/version-history.d.ts +1 -1
  71. package/dist/src/utils/dateUtil.d.ts +0 -21
  72. package/dist/src/utils/genericUtil.d.ts +0 -1
  73. package/dist/static/styles/components/narrow-panel.css.js +0 -10
  74. package/dist/static/styles/components/wide-panel.css.js +4 -0
  75. package/dist/static/styles/customEditorStyle.css.js +0 -19
  76. package/dist/stores/config.js +5 -5
  77. package/dist/stores/dynamic-content.js +2 -2
  78. package/dist/stores/editor.js +1 -1
  79. package/dist/stores/onboarding.js +27 -27
  80. package/dist/stores/preview.js +1 -1
  81. package/dist/stores/recommendation.js +3 -3
  82. package/dist/stores/save-as-template.js +2 -2
  83. package/dist/stores/toaster.js +1 -1
  84. package/dist/stores/unsubscribe.js +1 -1
  85. package/dist/stores/version-history.js +4 -4
  86. package/dist/utils/dateUtil.js +3 -24
  87. package/dist/utils/genericUtil.js +9 -20
  88. package/package.json +3 -3
  89. package/dist/composables/useBlocksConfig.js +0 -49
  90. package/dist/config/migrator/recommendationMigrator.js +0 -293
  91. package/dist/enums/date.js +0 -6
  92. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -193
  93. package/dist/extensions/Blocks/Recommendation/constants.js +0 -14
  94. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
  95. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -272
  96. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
  97. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.js +0 -71
  98. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.js +0 -71
  99. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.js +0 -71
  100. package/dist/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.js +0 -71
  101. package/dist/extensions/Blocks/Recommendation/controls/priceHideControl.js +0 -60
  102. package/dist/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.js +0 -160
  103. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
  104. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -184
  105. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
  106. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
  107. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +0 -25
  108. package/dist/extensions/Blocks/controlFactories.js +0 -234
  109. package/dist/src/composables/useBlocksConfig.d.ts +0 -11
  110. package/dist/src/config/migrator/recommendationMigrator.d.ts +0 -1
  111. package/dist/src/enums/date.d.ts +0 -4
  112. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -79
  113. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +0 -91
  114. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
  115. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -71
  116. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
  117. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
  118. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
  119. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
  120. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
  121. package/dist/src/extensions/Blocks/Recommendation/controls/priceHideControl.d.ts +0 -16
  122. package/dist/src/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.d.ts +0 -50
  123. package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
  124. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  125. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
  126. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
  127. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -19
  128. package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -95
  129. package/dist/src/utils/environmentUtil.d.ts +0 -5
  130. package/dist/utils/environmentUtil.js +0 -4
@@ -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
+ }, _ = {
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
+ }, i = {
24
23
  [E.GLOBAL_UNSUBSCRIBE]: [
25
24
  E.GLOBAL_UNSUBSCRIBE,
26
25
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -30,27 +29,26 @@ 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
+ }, B = {
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
+ S as LINK_REGEXES,
47
+ R as LINK_TYPES,
48
+ C as MERGE_TAGS,
51
49
  E as PAGE_TYPES,
52
- t as TYPE_COLLECTIONS,
53
- U as TYPE_TRANSLATIONS,
54
- c as UNSUBSCRIBE_PAGES_LINK,
55
- _ as URLS
50
+ i as TYPE_COLLECTIONS,
51
+ B as TYPE_TRANSLATIONS,
52
+ r as UNSUBSCRIBE_PAGES_LINK,
53
+ N as URLS
56
54
  };
@@ -3,7 +3,7 @@ import { CheckboxBlock as t } from "./block.js";
3
3
  import { CheckboxControl as e } from "./control.js";
4
4
  import { CheckboxIconsRegistry as r } from "./iconsRegistry.js";
5
5
  import { CheckboxBlockSettings as i } from "./settingsPanel.js";
6
- const d = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
6
+ const k = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
7
7
  export {
8
- d as default
8
+ k as default
9
9
  };
@@ -2,7 +2,7 @@ import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-edito
2
2
  import { CouponBlock as t } from "./block.js";
3
3
  import { CouponIconsRegistry as i } from "./iconsRegistry.js";
4
4
  import { CouponBlockSettings as n } from "./settingsPanel.js";
5
- const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
5
+ const m = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
6
6
  export {
7
- p as default
7
+ m as default
8
8
  };
@@ -1,10 +1,7 @@
1
1
  import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { getDefaultTemplate as o } from "./templates/blockTemplate.js";
2
+ import { getDefaultTemplate as o } from "./template.js";
3
3
  const n = "recommendation-block";
4
- class m extends e {
5
- constructor() {
6
- super();
7
- }
4
+ class c extends e {
8
5
  getId() {
9
6
  return n;
10
7
  }
@@ -26,5 +23,5 @@ class m extends e {
26
23
  }
27
24
  export {
28
25
  n as BLOCK_ID,
29
- m as RecommendationBlock
26
+ c as RecommendationBlock
30
27
  };
@@ -1,14 +1,11 @@
1
- var p = Object.defineProperty;
2
- var S = (a, s, e) => s in a ? p(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
3
- var u = (a, s, e) => S(a, typeof s != "symbol" ? s + "" : s, e);
4
- import { currencyDecimalCounts as _, currencyOperators as C, currencyLocationMaps as R } from "../../../enums/extensions/recommendationBlock.js";
5
- import { UEAttr as O, ModificationDescription as g } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
- import { CommonControl as U } from "../common-control.js";
7
- import { useRecommendationExtensionStore as N } from "./store/recommendation.js";
8
- import { prepareProductRows as E } from "./templates/blockTemplate.js";
9
- import { DEFAULT_CARD_COMPOSITION as d, getDefaultProducts as L } from "./templates/templateUtils.js";
10
- import { useDebounceFn as T } from "../../../node_modules/@vueuse/shared/index.js";
11
- const f = "ui-elements-recommendation-block", t = {
1
+ var _ = Object.defineProperty;
2
+ var R = (o, n, e) => n in o ? _(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
3
+ var r = (o, n, e) => R(o, typeof n != "symbol" ? n + "" : n, e);
4
+ import { currencyDecimalCounts as c, currencyOperators as a, currencyLocationMaps as l } from "../../../enums/extensions/recommendationBlock.js";
5
+ import { UEAttr as d } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ import { CommonControl as m } from "../common-control.js";
7
+ import { useRecommendationExtensionStore as S } from "./store/recommendation.js";
8
+ const g = "ui-elements-recommendation-block", t = {
12
9
  ALGORITHM: "strategy",
13
10
  PRODUCT_IDS: "productIds",
14
11
  LOCALE: "language",
@@ -21,23 +18,21 @@ const f = "ui-elements-recommendation-block", t = {
21
18
  FILTERS: "filterStatus",
22
19
  PRODUCT_COUNT: "size",
23
20
  PRODUCT_IN_ROW: "cardsInRow",
24
- SHUFFLE_PRODUCTS: "shuffleProducts"
21
+ SHUFFLE_PRODUCTS: "shuffleProducts",
22
+ RESPONSIVE: "unresponsive"
25
23
  };
26
- class Y extends U {
24
+ class p extends m {
27
25
  constructor() {
28
26
  super(...arguments);
29
- u(this, "store", N());
30
- u(this, "storeUnsubscription", () => {
27
+ r(this, "store", S());
28
+ r(this, "storeUnsubscription", () => {
31
29
  });
32
- u(this, "addFilterListener", () => {
30
+ r(this, "addFilterListener", () => {
33
31
  });
34
- u(this, "addFilterButton", null);
35
- u(this, "_debouncedRegenerateProductRows", T(() => {
36
- this._regenerateProductRows();
37
- }, 500));
32
+ r(this, "addFilterButton", null);
38
33
  }
39
34
  getId() {
40
- return f;
35
+ return g;
41
36
  }
42
37
  getTemplate() {
43
38
  return `
@@ -48,6 +43,7 @@ class Y extends U {
48
43
  ${this._getFilterStatus()}
49
44
  ${this._getProductLayout()}
50
45
  ${this._getShuffleProducts()}
46
+ ${this._getResponsive()}
51
47
  </div>
52
48
  `;
53
49
  }
@@ -77,25 +73,27 @@ class Y extends U {
77
73
  [t.CURRENCY_DECIMAL_COUNT]: e.currencySettings.decimalCount,
78
74
  [t.PRODUCT_COUNT]: e.size,
79
75
  [t.PRODUCT_IN_ROW]: e.cardsInRow,
80
- [t.SHUFFLE_PRODUCTS]: e.shuffleProducts
76
+ [t.SHUFFLE_PRODUCTS]: e.shuffleProducts,
77
+ [t.RESPONSIVE]: !e.unresponsive
81
78
  });
82
79
  }
83
80
  _initializeSelectItems() {
84
- const { store: e } = this, o = e.getActivePredictiveAlgorithms, i = e.getLanguages, n = {
85
- [t.ALGORITHM]: o,
81
+ const { store: e } = this, s = e.getActivePredictiveAlgorithms, i = e.getLanguages, C = {
82
+ [t.ALGORITHM]: s,
86
83
  [t.LOCALE]: i,
87
84
  [t.CURRENCY]: e.currencyList,
88
- [t.CURRENCY_LOCATION]: R,
85
+ [t.CURRENCY_LOCATION]: l,
89
86
  [t.CURRENCY_SYMBOL]: e.getCurrencySymbolList,
90
- [t.CURRENCY_THOUSAND_SEPARATOR]: C,
91
- [t.CURRENCY_DECIMAL_SEPARATOR]: C,
92
- [t.CURRENCY_DECIMAL_COUNT]: _,
87
+ [t.CURRENCY_THOUSAND_SEPARATOR]: a,
88
+ [t.CURRENCY_DECIMAL_SEPARATOR]: a,
89
+ [t.CURRENCY_DECIMAL_COUNT]: c,
93
90
  [t.PRODUCT_COUNT]: Number(e.recommendationConfigs.size),
94
91
  [t.PRODUCT_IN_ROW]: e.recommendationConfigs.cardsInRow,
95
- [t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts
92
+ [t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts,
93
+ [t.RESPONSIVE]: !e.recommendationConfigs.unresponsive
96
94
  };
97
- Object.entries(n).forEach(([r, l]) => {
98
- this.api.setUIEAttribute(r, O.SELECTPICKER.items, l);
95
+ Object.entries(C).forEach(([u, h]) => {
96
+ this.api.setUIEAttribute(u, d.SELECTPICKER.items, h);
99
97
  });
100
98
  }
101
99
  _getAlgorithms() {
@@ -141,7 +139,7 @@ class Y extends U {
141
139
  this._GuSelect({
142
140
  name: t.CURRENCY_LOCATION,
143
141
  placeholder: "Select Currency Location",
144
- options: R
142
+ options: l
145
143
  }),
146
144
  this._GuLabel({ text: "Currency Symbol" }),
147
145
  this._GuSelect({
@@ -153,19 +151,19 @@ class Y extends U {
153
151
  this._GuSelect({
154
152
  name: t.CURRENCY_THOUSAND_SEPARATOR,
155
153
  placeholder: "Select Thousand Separator",
156
- options: C
154
+ options: a
157
155
  }),
158
156
  this._GuLabel({ text: "Decimal Separator" }),
159
157
  this._GuSelect({
160
158
  name: t.CURRENCY_DECIMAL_SEPARATOR,
161
159
  placeholder: "Select Decimal Separator",
162
- options: C
160
+ options: a
163
161
  }),
164
162
  this._GuLabel({ text: "Decimal Count" }),
165
163
  this._GuSelect({
166
164
  name: t.CURRENCY_DECIMAL_COUNT,
167
165
  placeholder: "Select Decimal Count",
168
- options: _
166
+ options: c
169
167
  })
170
168
  ])}
171
169
  `;
@@ -200,100 +198,58 @@ class Y extends U {
200
198
  ])}
201
199
  `;
202
200
  }
201
+ _getResponsive() {
202
+ return `
203
+ ${this._GuTwoColumns([
204
+ this._GuLabel({ text: "Responsive Block" }),
205
+ this._GuToggle(t.RESPONSIVE)
206
+ ])}
207
+ `;
208
+ }
209
+ _onFilterChange(e) {
210
+ this.currentNode && this.store.$patch({
211
+ filterStatus: e,
212
+ filterSelectionDrawerStatus: e
213
+ });
214
+ }
203
215
  _onFilterSelectClick() {
204
216
  this.store.$patch({
205
217
  filterSelectionDrawerStatus: !0
206
218
  });
207
219
  }
208
- _onDataChange(e, o) {
209
- this.currentNode && (this.store.$patch({
220
+ _onDataChange(e, s) {
221
+ this.currentNode && this.store.$patch({
210
222
  recommendationConfigs: {
211
- [e]: o
223
+ [e]: s
212
224
  }
213
- }), this._debouncedRegenerateProductRows());
214
- }
215
- /**
216
- * Get the current card composition from block data attribute or use default
217
- */
218
- _getCardComposition() {
219
- if (!this.currentNode)
220
- return d;
221
- const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
222
- if (!e || !("getAttribute" in e))
223
- return d;
224
- const o = e.getAttribute("data-card-composition");
225
- return o ? o.split(",").filter(Boolean) : d;
226
- }
227
- _regenerateProductRows() {
228
- if (!this.currentNode || !("querySelector" in this.currentNode))
229
- return;
230
- const e = this.currentNode.querySelector(".ins-recommendation-product-container");
231
- if (!e) {
232
- console.error("Could not find container table for product rows");
233
- return;
234
- }
235
- const o = this.store.recommendationProducts.length > 0 ? this.store.recommendationProducts : L(), { cardsInRow: i } = this.store.recommendationConfigs, n = this._getCardComposition(), r = E(o, i, n);
236
- this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(r).apply(new g("Updated product")), this._reapplySpacing();
237
- }
238
- /**
239
- * Reapply spacing values after product regeneration
240
- * This ensures spacing persists when products are regenerated
241
- */
242
- _reapplySpacing() {
243
- if (!this.currentNode)
244
- return;
245
- const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
246
- if (!e || !("getAttribute" in e))
247
- return;
248
- const o = e.getAttribute("data-column-spacing"), i = e.getAttribute("data-row-spacing"), n = this.api.getDocumentModifier();
249
- if (o) {
250
- const r = parseInt(o);
251
- if (!Number.isNaN(r)) {
252
- const h = `0 ${Math.floor(r / 2)}px`;
253
- Array.from(
254
- this.currentNode.querySelectorAll(".product-card-wrapper")
255
- ).forEach((c) => {
256
- "parentNode" in c && c.parentNode && typeof c.parentNode == "object" && "tagName" in c.parentNode && c.parentNode.tagName === "TD" && n.modifyHtml(c.parentNode).setStyle("padding", h);
257
- });
258
- }
259
- }
260
- if (i) {
261
- const r = parseInt(i);
262
- if (!Number.isNaN(r)) {
263
- const l = `${r}px`;
264
- Array.from(this.currentNode.querySelectorAll(".spacer")).forEach((m) => {
265
- n.modifyHtml(m).setStyle("height", l);
266
- });
267
- }
268
- }
269
- (o || i) && n.apply(new g("Reapply spacing after regeneration"));
225
+ });
270
226
  }
271
- _onCurrencyConfigChange(e, o) {
227
+ _onCurrencyConfigChange(e, s) {
272
228
  this.currentNode && this.store.$patch({
273
229
  recommendationConfigs: {
274
230
  currencySettings: {
275
- [e]: o
231
+ [e]: s
276
232
  }
277
233
  }
278
234
  });
279
235
  }
280
236
  _onCurrencyChange(e) {
281
- const [, o] = e.split(".");
237
+ const [, s] = e.split(".");
282
238
  this.store.$patch({
283
239
  recommendationConfigs: {
284
240
  currencySettings: {
285
- name: o,
286
- value: o
241
+ name: s,
242
+ value: s
287
243
  }
288
244
  }
289
245
  });
290
246
  }
291
247
  _setProductIdsVisibility() {
292
- const { recommendationConfigs: e } = this.store, o = e.strategy === "manualMerchandising";
293
- this.api.setVisibility(t.PRODUCT_IDS, o), this.api.setVisibility(`${t.PRODUCT_IDS}_label`, o);
248
+ const { recommendationConfigs: e } = this.store, s = e.strategy === "manualMerchandising";
249
+ this.api.setVisibility(t.PRODUCT_IDS, s), this.api.setVisibility(`${t.PRODUCT_IDS}_label`, s);
294
250
  }
295
251
  _listenToFormUpdates() {
296
- var o;
252
+ var s;
297
253
  this.api.onValueChanged(t.ALGORITHM, (i) => {
298
254
  this._onDataChange(t.ALGORITHM, i), this._setProductIdsVisibility();
299
255
  }), this.api.onValueChanged(t.PRODUCT_IDS, (i) => this._onDataChange(t.PRODUCT_IDS, i.split(",") || [])), this.api.onValueChanged(t.LOCALE, (i) => this._onDataChange(t.LOCALE, i)), this.api.onValueChanged(t.CURRENCY, (i) => this._onCurrencyChange(i)), [
@@ -303,19 +259,19 @@ class Y extends U {
303
259
  t.CURRENCY_DECIMAL_SEPARATOR,
304
260
  t.CURRENCY_DECIMAL_COUNT
305
261
  ].forEach((i) => {
306
- this.api.onValueChanged(i, (n) => this._onCurrencyConfigChange(i, n));
307
- }), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (o = this.addFilterButton) == null || o.addEventListener("click", this.addFilterListener);
262
+ this.api.onValueChanged(i, (C) => this._onCurrencyConfigChange(i, C));
263
+ }), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.api.onValueChanged(t.RESPONSIVE, (i) => this._onDataChange(t.RESPONSIVE, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (s = this.addFilterButton) == null || s.addEventListener("click", this.addFilterListener);
308
264
  }
309
265
  _listenStateUpdates() {
310
266
  this.storeUnsubscription = this.store.$subscribe((e) => {
311
267
  if ("payload" in e) {
312
- const o = e.payload.recommendationConfigs;
313
- o && (this.api.updateValues(o), this.store.fetchRecommendationProducts());
268
+ const s = e.payload.recommendationConfigs;
269
+ s && (this.api.updateValues(s), this.store.fetchRecommendationProducts());
314
270
  }
315
271
  });
316
272
  }
317
273
  }
318
274
  export {
319
- f as CONTROL_BLOCK_ID,
320
- Y as RecommendationBlockControl
275
+ g as CONTROL_BLOCK_ID,
276
+ p as RecommendationBlockControl
321
277
  };
@@ -1,21 +1,10 @@
1
1
  import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { RecommendationBlock as n } from "./block.js";
3
- import { RecommendationCardCompositionControl as t } from "./cardCompositionControl.js";
4
- import { RecommendationBlockControl as r } from "./control.js";
5
- import { ButtonAlignControl as l, ButtonBorderControl as d, ButtonBorderRadiusControl as C, ButtonColorControl as i, ButtonFitToContentControl as a, ButtonFontFamilyControl as e, ButtonMarginsControl as m, ButtonPaddingsControl as c, ButtonTextControl as s, ButtonTextSizeControl as u, ButtonTextStyleAndFontColorControl as P, ImageMarginsControl as g, ImageSizeControl as O, NameAlignControl as p, NameBackgroundControl as B, NameColorControl as f, NameFontFamilyControl as S, NameLineSpacingControl as b, NamePaddingsControl as y, NameSizeControl as F, NameStyleControl as x, OldPriceAlignControl as D, OldPriceBackgroundControl as T, OldPriceColorControl as k, OldPriceFontFamilyControl as A, OldPriceLineSpacingControl as N, OldPricePaddingsControl as R, OldPriceSizeControl as z, OldPriceStyleControl as L, OmnibusPriceAlignControl as I, OmnibusPriceBackgroundControl as w, OmnibusPriceColorControl as h, OmnibusPriceFontFamilyControl as M, OmnibusPriceLineSpacingControl as E, OmnibusPricePaddingsControl as H, OmnibusPriceSizeControl as j, OmnibusPriceStyleControl as q, OmnibusDiscountAlignControl as v, OmnibusDiscountBackgroundControl as G, OmnibusDiscountColorControl as J, OmnibusDiscountFontFamilyControl as K, OmnibusDiscountLineSpacingControl as Q, OmnibusDiscountPaddingsControl as U, OmnibusDiscountSizeControl as V, OmnibusDiscountStyleControl as W, PriceAlignControl as X, PriceBackgroundControl as Y, PriceColorControl as Z, PriceFontFamilyControl as _, PriceLineSpacingControl as $, PricePaddingsControl as oo, PriceSizeControl as no, PriceStyleControl as to } from "./controls/index.js";
6
- import { RecommendationIconsRegistry as ro } from "./iconsRegistry.js";
7
- import lo from "./recommendation.css.js";
8
- import { SettingsPanel as Co } from "./settingsPanel.js";
9
- import { CardBackgroundColorControl as io } from "./controls/cardBackgroundColorControl.js";
10
- import { SpacingControl as ao } from "./controls/spacingControl.js";
11
- import { PriceInlineLayoutControl as eo } from "./controls/priceInlineLayoutControl.js";
12
- import { NameTextTrimControl as mo } from "./controls/nameTextTrimControl.js";
13
- import { OmnibusPriceTextBeforeControl as co } from "./controls/omnibusPriceTextBeforeControl.js";
14
- import { OmnibusPriceTextAfterControl as so } from "./controls/omnibusPriceTextAfterControl.js";
15
- import { OmnibusDiscountTextBeforeControl as uo } from "./controls/omnibusDiscountTextBeforeControl.js";
16
- import { OmnibusDiscountTextAfterControl as Po } from "./controls/omnibusDiscountTextAfterControl.js";
17
- import { PriceHideControl as go } from "./controls/priceHideControl.js";
18
- const Io = new o().addBlock(n).withSettingsPanelRegistry(Co).addControl(r).addControl(io).addControl(ao).addControl(eo).addControl(l).addControl(d).addControl(C).addControl(i).addControl(a).addControl(e).addControl(m).addControl(c).addControl(s).addControl(u).addControl(P).addControl(g).addControl(O).addControl(p).addControl(B).addControl(f).addControl(S).addControl(b).addControl(y).addControl(F).addControl(x).addControl(mo).addControl(D).addControl(T).addControl(k).addControl(A).addControl(N).addControl(R).addControl(z).addControl(L).addControl(I).addControl(w).addControl(h).addControl(M).addControl(E).addControl(H).addControl(j).addControl(q).addControl(co).addControl(so).addControl(v).addControl(G).addControl(J).addControl(K).addControl(Q).addControl(U).addControl(V).addControl(W).addControl(uo).addControl(Po).addControl(X).addControl(Y).addControl(Z).addControl(_).addControl(go).addControl($).addControl(oo).addControl(no).addControl(to).addControl(t).addStyles(lo).withIconsRegistry(ro).build();
2
+ import { RecommendationBlock as t } from "./block.js";
3
+ import { RecommendationBlockControl as e } from "./control.js";
4
+ import { RecommendationIconsRegistry as n } from "./iconsRegistry.js";
5
+ import i from "./recommendation.css.js";
6
+ import { SettingsPanel as m } from "./settingsPanel.js";
7
+ const f = new o().addBlock(t).withSettingsPanelRegistry(m).addControl(e).addStyles(i).withIconsRegistry(n).build();
19
8
  export {
20
- Io as default
9
+ f as default
21
10
  };
@@ -1,170 +1,32 @@
1
- import { SettingsPanelRegistry as E, SettingsPanelTab as I, SettingsTab as N, ContainerControls as S, TextControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { BLOCK_ID as R } from "./block.js";
3
- import { COMPOSITION_CONTROL_BLOCK_ID as L } from "./cardCompositionControl.js";
4
- import { RecommendationBlockId as T, RecommendationControlId as _ } from "./constants.js";
5
- import { CONTROL_BLOCK_ID as A } from "./control.js";
6
- import { CARD_BACKGROUND_COLOR_CONTROL_ID as U } from "./controls/cardBackgroundColorControl.js";
7
- import { PRICE_INLINE_LAYOUT_CONTROL_ID as D } from "./controls/priceInlineLayoutControl.js";
8
- import { SPACING_CONTROL_ID as B } from "./controls/spacingControl.js";
9
- class Y extends E {
10
- registerBlockControls(O) {
11
- O[R] = [
12
- new I(
13
- N.SETTINGS,
1
+ import { SettingsPanelRegistry as o, SettingsPanelTab as t, SettingsTab as e, ContainerControls as r, TextControls as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { BLOCK_ID as T } from "./block.js";
3
+ import { CONTROL_BLOCK_ID as i } from "./control.js";
4
+ class a extends o {
5
+ registerBlockControls(n) {
6
+ n[T] = [
7
+ new t(
8
+ e.SETTINGS,
14
9
  [
15
- A,
16
- D,
17
- S.EXTERNAL_INDENTS
10
+ i,
11
+ r.EXTERNAL_INDENTS
18
12
  ]
19
13
  ),
20
- new I(
21
- N.STYLES,
14
+ new t(
15
+ e.STYLES,
22
16
  [
23
- C.TEXT_BLOCK_BACKGROUND_COLOR,
24
- U,
25
- B
26
- ]
27
- ),
28
- new I(
29
- "Card Composition",
30
- [
31
- L
32
- ]
33
- ).withLabel("Card Composition")
34
- ], O[T.NAME] = [
35
- new I(
36
- N.SETTINGS,
37
- [
38
- _.NAME_STYLE,
39
- _.NAME_ALIGN,
40
- _.NAME_TEXT_TRIM,
41
- _.NAME_PADDINGS
42
- ]
43
- ),
44
- new I(
45
- N.STYLES,
46
- [
47
- _.NAME_BACKGROUND,
48
- _.NAME_FONT_FAMILY,
49
- _.NAME_LINE_SPACING,
50
- _.NAME_SIZE,
51
- _.NAME_COLOR
52
- ]
53
- )
54
- ], O[T.PRICE] = [
55
- new I(
56
- N.SETTINGS,
57
- [
58
- _.PRICE_STYLE,
59
- _.PRICE_ALIGN,
60
- _.PRICE_HIDE_IF_SAME,
61
- _.PRICE_PADDINGS
62
- ]
63
- ),
64
- new I(
65
- N.STYLES,
66
- [
67
- _.PRICE_BACKGROUND,
68
- _.PRICE_FONT_FAMILY,
69
- _.PRICE_LINE_SPACING,
70
- _.PRICE_SIZE,
71
- _.PRICE_COLOR
72
- ]
73
- )
74
- ], O[T.OLD_PRICE] = [
75
- new I(
76
- N.SETTINGS,
77
- [
78
- _.OLD_PRICE_STYLE,
79
- _.OLD_PRICE_ALIGN,
80
- _.OLD_PRICE_PADDINGS
81
- ]
82
- ),
83
- new I(
84
- N.STYLES,
85
- [
86
- _.OLD_PRICE_BACKGROUND,
87
- _.OLD_PRICE_FONT_FAMILY,
88
- _.OLD_PRICE_LINE_SPACING,
89
- _.OLD_PRICE_SIZE,
90
- _.OLD_PRICE_COLOR
91
- ]
92
- )
93
- ], O[T.OMNIBUS_PRICE] = [
94
- new I(
95
- N.SETTINGS,
96
- [
97
- _.OMNIBUS_PRICE_TEXT_BEFORE,
98
- _.OMNIBUS_PRICE_TEXT_AFTER,
99
- _.OMNIBUS_PRICE_STYLE,
100
- _.OMNIBUS_PRICE_ALIGN,
101
- _.OMNIBUS_PRICE_PADDINGS
102
- ]
103
- ),
104
- new I(
105
- N.STYLES,
106
- [
107
- _.OMNIBUS_PRICE_BACKGROUND,
108
- _.OMNIBUS_PRICE_FONT_FAMILY,
109
- _.OMNIBUS_PRICE_LINE_SPACING,
110
- _.OMNIBUS_PRICE_SIZE,
111
- _.OMNIBUS_PRICE_COLOR
112
- ]
113
- )
114
- ], O[T.OMNIBUS_DISCOUNT] = [
115
- new I(
116
- N.SETTINGS,
117
- [
118
- _.OMNIBUS_DISCOUNT_TEXT_BEFORE,
119
- _.OMNIBUS_DISCOUNT_TEXT_AFTER,
120
- _.OMNIBUS_DISCOUNT_STYLE,
121
- _.OMNIBUS_DISCOUNT_ALIGN,
122
- _.OMNIBUS_DISCOUNT_PADDINGS
123
- ]
124
- ),
125
- new I(
126
- N.STYLES,
127
- [
128
- _.OMNIBUS_DISCOUNT_BACKGROUND,
129
- _.OMNIBUS_DISCOUNT_FONT_FAMILY,
130
- _.OMNIBUS_DISCOUNT_LINE_SPACING,
131
- _.OMNIBUS_DISCOUNT_SIZE,
132
- _.OMNIBUS_DISCOUNT_COLOR
133
- ]
134
- )
135
- ], O[T.BUTTON] = [
136
- new I(
137
- N.SETTINGS,
138
- [
139
- _.BUTTON_TEXT,
140
- _.BUTTON_ALIGN,
141
- _.BUTTON_PADDINGS,
142
- _.BUTTON_MARGINS
143
- ]
144
- ),
145
- new I(
146
- N.STYLES,
147
- [
148
- _.BUTTON_COLOR,
149
- _.BUTTON_FONT_FAMILY,
150
- _.BUTTON_TEXT_SIZE,
151
- _.BUTTON_TEXT_STYLE_AND_FONT_COLOR,
152
- _.BUTTON_FIT_TO_CONTENT,
153
- _.BUTTON_BORDER_RADIUS,
154
- _.BUTTON_BORDER
155
- ]
156
- )
157
- ], O[T.IMAGE] = [
158
- new I(
159
- N.SETTINGS,
160
- [
161
- _.IMAGE_SIZE,
162
- _.IMAGE_MARGINS
17
+ s.TEXT_BLOCK_BACKGROUND_COLOR
163
18
  ]
164
19
  )
20
+ // TODO: It'll be opened after the card composition is implemented by Stripo team.
21
+ // new SettingsPanelTab(
22
+ // 'Card Composition',
23
+ // [
24
+ // COMPOSITION_CONTROL_BLOCK_ID,
25
+ // ]
26
+ // ).withLabel('Card Composition'),
165
27
  ];
166
28
  }
167
29
  }
168
30
  export {
169
- Y as SettingsPanel
31
+ a as SettingsPanel
170
32
  };
@@ -133,7 +133,7 @@ const a = c(), d = () => ({
133
133
  filterSelectionDrawerStatus: !1,
134
134
  filterList: {},
135
135
  filterGroup: 1
136
- }), G = p("guidoRecommendationExtension", {
136
+ }), G = p("recommendationExtension", {
137
137
  state: () => d(),
138
138
  getters: {
139
139
  hasFilters: (e) => !!e.recommendationConfigs.filters.length,