@useinsider/guido 1.0.3-beta.538b804 → 1.0.3-beta.552f8c9

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 (101) hide show
  1. package/README.md +32 -0
  2. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +4 -4
  3. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +41 -44
  4. package/dist/composables/useActionsApi.js +1 -1
  5. package/dist/composables/useHtmlCompiler.js +13 -15
  6. package/dist/composables/useHtmlValidator.js +35 -36
  7. package/dist/enums/onboarding.js +2 -3
  8. package/dist/enums/unsubscribe.js +26 -27
  9. package/dist/extensions/Blocks/Items/block.js +26 -26
  10. package/dist/extensions/Blocks/Items/controls/cardComposition.js +57 -151
  11. package/dist/extensions/Blocks/Items/controls/name/trimming.js +1 -1
  12. package/dist/extensions/Blocks/Items/controls/settingsControl.js +124 -165
  13. package/dist/extensions/Blocks/Items/enums/productEnums.js +5 -83
  14. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +1 -7
  15. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +56 -57
  16. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +55 -54
  17. package/dist/extensions/Blocks/Items/settingsPanel.js +45 -71
  18. package/dist/extensions/Blocks/Items/template.js +59 -138
  19. package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
  20. package/dist/guido.css +1 -1
  21. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +12 -13
  22. package/dist/node_modules/lodash-es/keysIn.js +3 -3
  23. package/dist/src/enums/onboarding.d.ts +0 -1
  24. package/dist/src/extensions/Blocks/Items/block.d.ts +0 -14
  25. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +7 -20
  26. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -7
  27. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +0 -8
  28. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +0 -6
  29. package/dist/src/extensions/Blocks/Items/template.d.ts +1 -9
  30. package/package.json +9 -2
  31. package/dist/config/compiler/itemsCompilerRules.js +0 -14
  32. package/dist/node_modules/lodash-es/_DataView.js +0 -6
  33. package/dist/node_modules/lodash-es/_Promise.js +0 -6
  34. package/dist/node_modules/lodash-es/_Set.js +0 -6
  35. package/dist/node_modules/lodash-es/_SetCache.js +0 -13
  36. package/dist/node_modules/lodash-es/_WeakMap.js +0 -6
  37. package/dist/node_modules/lodash-es/_arrayFilter.js +0 -10
  38. package/dist/node_modules/lodash-es/_arrayMap.js +0 -8
  39. package/dist/node_modules/lodash-es/_arrayPush.js +0 -8
  40. package/dist/node_modules/lodash-es/_arraySome.js +0 -9
  41. package/dist/node_modules/lodash-es/_baseEach.js +0 -6
  42. package/dist/node_modules/lodash-es/_baseFlatten.js +0 -13
  43. package/dist/node_modules/lodash-es/_baseForOwn.js +0 -8
  44. package/dist/node_modules/lodash-es/_baseGet.js +0 -11
  45. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  46. package/dist/node_modules/lodash-es/_baseHasIn.js +0 -6
  47. package/dist/node_modules/lodash-es/_baseIsEqual.js +0 -8
  48. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +0 -32
  49. package/dist/node_modules/lodash-es/_baseIsMatch.js +0 -29
  50. package/dist/node_modules/lodash-es/_baseIteratee.js +0 -11
  51. package/dist/node_modules/lodash-es/_baseKeys.js +0 -14
  52. package/dist/node_modules/lodash-es/_baseMap.js +0 -11
  53. package/dist/node_modules/lodash-es/_baseMatches.js +0 -12
  54. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  55. package/dist/node_modules/lodash-es/_baseProperty.js +0 -8
  56. package/dist/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  57. package/dist/node_modules/lodash-es/_baseRange.js +0 -9
  58. package/dist/node_modules/lodash-es/_baseToString.js +0 -18
  59. package/dist/node_modules/lodash-es/_baseTrim.js +0 -8
  60. package/dist/node_modules/lodash-es/_cacheHas.js +0 -6
  61. package/dist/node_modules/lodash-es/_castPath.js +0 -10
  62. package/dist/node_modules/lodash-es/_createBaseEach.js +0 -15
  63. package/dist/node_modules/lodash-es/_createRange.js +0 -11
  64. package/dist/node_modules/lodash-es/_equalArrays.js +0 -40
  65. package/dist/node_modules/lodash-es/_equalByTag.js +0 -45
  66. package/dist/node_modules/lodash-es/_equalObjects.js +0 -36
  67. package/dist/node_modules/lodash-es/_getAllKeys.js +0 -9
  68. package/dist/node_modules/lodash-es/_getMatchData.js +0 -12
  69. package/dist/node_modules/lodash-es/_getSymbols.js +0 -10
  70. package/dist/node_modules/lodash-es/_getTag.js +0 -28
  71. package/dist/node_modules/lodash-es/_hasPath.js +0 -19
  72. package/dist/node_modules/lodash-es/_isFlattenable.js +0 -10
  73. package/dist/node_modules/lodash-es/_isKey.js +0 -12
  74. package/dist/node_modules/lodash-es/_isStrictComparable.js +0 -7
  75. package/dist/node_modules/lodash-es/_mapToArray.js +0 -9
  76. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  77. package/dist/node_modules/lodash-es/_memoizeCapped.js +0 -11
  78. package/dist/node_modules/lodash-es/_nativeKeys.js +0 -5
  79. package/dist/node_modules/lodash-es/_setCacheAdd.js +0 -7
  80. package/dist/node_modules/lodash-es/_setCacheHas.js +0 -6
  81. package/dist/node_modules/lodash-es/_setToArray.js +0 -9
  82. package/dist/node_modules/lodash-es/_stringToPath.js +0 -10
  83. package/dist/node_modules/lodash-es/_toKey.js +0 -10
  84. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
  85. package/dist/node_modules/lodash-es/flatMap.js +0 -8
  86. package/dist/node_modules/lodash-es/get.js +0 -8
  87. package/dist/node_modules/lodash-es/hasIn.js +0 -8
  88. package/dist/node_modules/lodash-es/isSymbol.js +0 -9
  89. package/dist/node_modules/lodash-es/keys.js +0 -9
  90. package/dist/node_modules/lodash-es/map.js +0 -11
  91. package/dist/node_modules/lodash-es/property.js +0 -10
  92. package/dist/node_modules/lodash-es/range.js +0 -5
  93. package/dist/node_modules/lodash-es/stubArray.js +0 -6
  94. package/dist/node_modules/lodash-es/toFinite.js +0 -14
  95. package/dist/node_modules/lodash-es/toNumber.js +0 -22
  96. package/dist/node_modules/lodash-es/toString.js +0 -7
  97. package/dist/src/config/compiler/itemsCompilerRules.d.ts +0 -2
  98. package/dist/src/utils/environmentUtil.d.ts +0 -5
  99. package/dist/src/utils/pairProductVariables.d.ts +0 -7
  100. package/dist/utils/environmentUtil.js +0 -4
  101. package/dist/utils/pairProductVariables.js +0 -136
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
@@ -1,19 +1,19 @@
1
1
  import g from "./ItemsOnboarding.vue2.js";
2
2
  /* empty css */
3
3
  import m from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var l = function() {
4
+ var c = function() {
5
5
  var e, n, r, i, s, a;
6
6
  var o = this, d = o._self._c, t = o._self._setupProxy;
7
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
8
  return t.onboardingStore.close("itemsOnboarding");
9
9
  }, nextButtonClick: t.handleNext } }) : o._e();
10
- }, c = [], p = /* @__PURE__ */ m(
10
+ }, l = [], p = /* @__PURE__ */ m(
11
11
  g,
12
- l,
13
12
  c,
13
+ l,
14
14
  !1,
15
15
  null,
16
- "dd1a237a"
16
+ "c8bd3ee6"
17
17
  );
18
18
  const I = p.exports;
19
19
  export {
@@ -1,33 +1,30 @@
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({
1
+ import { defineComponent as u, computed as c, watch as d } from "vue";
2
+ import { useTranslations as b } from "../../../composables/useTranslations.js";
3
+ import { UI_EDITOR_SELECTOR as l, CARD_COMPOSITION_TAB_SELECTOR as x, SETTINGS_TAB_SELECTOR as T } from "../../../enums/onboarding.js";
4
+ import { useOnboardingStore as k } from "../../../stores/onboarding.js";
5
+ import { InOnboard as B } from "@useinsider/design-system-vue";
6
+ const I = /* @__PURE__ */ u({
7
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))
8
+ setup(C) {
9
+ const i = b(), o = k(), r = (t) => {
10
+ const e = document.querySelector(l);
11
+ if (!(e != null && e.shadowRoot))
15
12
  return;
16
- const { shadowRoot: s } = i, m = s.querySelector(t);
17
- m && m.click();
18
- }, d = a(() => [
13
+ const { shadowRoot: n } = e, a = n.querySelector(t);
14
+ a && a.click();
15
+ }, s = c(() => [
19
16
  {
20
17
  classes: "guido-items-onboarding-card-1",
21
18
  right: "426px",
22
- top: n(90),
19
+ top: "90px",
23
20
  position: "Right Top",
24
- title: e("email-editor.onboarding-items-title"),
25
- description: e("email-editor.onboarding-items-description"),
21
+ title: i("email-editor.onboarding-items-title"),
22
+ description: i("email-editor.onboarding-items-description"),
26
23
  imageSource: "",
27
24
  backButtonClick: () => {
28
25
  },
29
26
  nextButtonType: "text",
30
- nextButtonText: e("products.next"),
27
+ nextButtonText: i("products.next"),
31
28
  nextButtonClick: () => {
32
29
  o.next("itemsOnboarding");
33
30
  }
@@ -35,18 +32,18 @@ const E = /* @__PURE__ */ l({
35
32
  {
36
33
  classes: "guido-items-onboarding-card-2",
37
34
  right: "426px",
38
- top: n(218),
35
+ top: "218px",
39
36
  position: "Right Top",
40
- title: e("email-editor.onboarding-items-item-type-title"),
41
- description: e("email-editor.onboarding-items-item-type-description"),
37
+ title: i("email-editor.onboarding-items-item-type-title"),
38
+ description: i("email-editor.onboarding-items-item-type-description"),
42
39
  imageSource: "",
43
40
  backButtonType: "text",
44
- backButtonText: e("ds-steps.back"),
41
+ backButtonText: i("ds-steps.back"),
45
42
  backButtonClick: () => {
46
43
  o.previous("itemsOnboarding");
47
44
  },
48
45
  nextButtonType: "text",
49
- nextButtonText: e("products.next"),
46
+ nextButtonText: i("products.next"),
50
47
  nextButtonClick: () => {
51
48
  o.next("itemsOnboarding");
52
49
  }
@@ -54,46 +51,46 @@ const E = /* @__PURE__ */ l({
54
51
  {
55
52
  classes: "guido-items-onboarding-card-3",
56
53
  right: "426px",
57
- top: n(140),
54
+ top: "140px",
58
55
  position: "Right Top",
59
- title: e("email-editor.onboarding-items-composition-title"),
60
- description: e("email-editor.onboarding-items-composition-description"),
56
+ title: i("email-editor.onboarding-items-composition-title"),
57
+ description: i("email-editor.onboarding-items-composition-description"),
61
58
  imageSource: "",
62
59
  backButtonType: "text",
63
- backButtonText: e("ds-steps.back"),
60
+ backButtonText: i("ds-steps.back"),
64
61
  backButtonClick: () => {
65
62
  o.previous("itemsOnboarding");
66
63
  },
67
64
  nextButtonType: "text",
68
- nextButtonText: e("action-builder.ok"),
65
+ nextButtonText: i("action-builder.ok"),
69
66
  nextButtonClick: () => {
70
67
  o.close("itemsOnboarding");
71
68
  }
72
69
  }
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);
70
+ ]), m = c(() => o.onboardings.itemsOnboarding.config.length > 0 && o.onboardings.itemsOnboarding.isActive), p = () => {
71
+ var t, e;
72
+ (e = (t = o.getItemsCurrentCard) == null ? void 0 : t.nextButtonClick) == null || e.call(t);
73
+ }, g = () => {
74
+ var t, e;
75
+ (e = (t = o.getItemsCurrentCard) == null ? void 0 : t.backButtonClick) == null || e.call(t);
79
76
  };
80
- return u(
77
+ return d(
81
78
  () => o.isActive("itemsOnboarding"),
82
79
  (t) => {
83
- t && o.setConfig("itemsOnboarding", d.value);
80
+ t && o.setConfig("itemsOnboarding", s.value);
84
81
  },
85
82
  { immediate: !0 }
86
- ), u(
83
+ ), d(
87
84
  () => o.onboardings.itemsOnboarding.cardIndex,
88
- (t, i) => {
85
+ (t, e) => {
89
86
  if (!o.isActive("itemsOnboarding"))
90
87
  return;
91
- const s = `${i}-${t}`;
92
- s === "1-2" && r(B), s === "2-1" && r(f);
88
+ const n = `${e}-${t}`;
89
+ n === "1-2" && r(x), n === "2-1" && r(T);
93
90
  }
94
- ), { __sfc: !0, trans: e, onboardingStore: o, ribbonOffset: c, getTopPosition: n, switchTab: r, onboardingCardsConfig: d, isVisible: g, handleNext: p, handleBack: b, InOnboard: k };
91
+ ), { __sfc: !0, trans: i, onboardingStore: o, switchTab: r, onboardingCardsConfig: s, isVisible: m, handleNext: p, handleBack: g, InOnboard: B };
95
92
  }
96
93
  });
97
94
  export {
98
- E as default
95
+ I as default
99
96
  };
@@ -17,7 +17,7 @@ const A = () => {
17
17
  ]
18
18
  },
19
19
  mergeTags: ["Tag1", "Tag2"],
20
- forceAmp: !1,
20
+ forseAmp: !1,
21
21
  resetDataSavedFlag: !1,
22
22
  disableLineHeightsReplace: !0
23
23
  }, ...t }, m = {
@@ -1,27 +1,25 @@
1
1
  import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
2
- import { itemsCompilerRules as p } from "../config/compiler/itemsCompilerRules.js";
3
- import { outlookCompilerRules as s } from "../config/compiler/outlookCompilerRules.js";
4
- import { recommendationCompilerRules as u } from "../config/compiler/recommendationCompilerRules.js";
5
- import { socialCompilerRules as n } from "../config/compiler/socialCompilerRules.js";
6
- import { unsubscribeCompilerRules as c } from "../config/compiler/unsubscribeCompilerRules.js";
7
- import { createHtmlCompiler as f } from "../utils/htmlCompiler.js";
8
- import { useConfig as R } from "./useConfig.js";
9
- const x = () => {
10
- const { config: e } = R(), m = e.htmlCompilerRules || [], l = [
2
+ import { outlookCompilerRules as p } from "../config/compiler/outlookCompilerRules.js";
3
+ import { recommendationCompilerRules as s } from "../config/compiler/recommendationCompilerRules.js";
4
+ import { socialCompilerRules as u } from "../config/compiler/socialCompilerRules.js";
5
+ import { unsubscribeCompilerRules as n } from "../config/compiler/unsubscribeCompilerRules.js";
6
+ import { createHtmlCompiler as c } from "../utils/htmlCompiler.js";
7
+ import { useConfig as f } from "./useConfig.js";
8
+ const h = () => {
9
+ const { config: e } = f(), l = e.htmlCompilerRules || [], m = [
11
10
  ...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
12
- ...u,
13
- ...c,
14
- ...p,
15
11
  ...s,
16
12
  ...n,
17
- ...m.map((o, i) => ({
13
+ ...p,
14
+ ...u,
15
+ ...l.map((o, i) => ({
18
16
  ...o,
19
17
  priority: o.priority + 1e3 + i
20
18
  // Ensure additional rules run after default rules
21
19
  }))
22
- ], r = f(l);
20
+ ], r = c(m);
23
21
  return { compileHtml: (o) => r.compile(o) };
24
22
  };
25
23
  export {
26
- x as useHtmlCompiler
24
+ h as useHtmlCompiler
27
25
  };
@@ -1,19 +1,18 @@
1
- import { useConfig as V } from "./useConfig.js";
2
- import { TemplateTypes as D } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as H, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as P, CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as _ } from "../enums/html-validator.js";
1
+ import { useConfig as H } from "./useConfig.js";
2
+ import { TemplateTypes as V } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as D, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as P, CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as _ } from "../enums/html-validator.js";
4
4
  import { ToasterTypeOptions as l } from "../enums/toaster.js";
5
- import { itemsBlockDynamicVariables as G } from "../extensions/Blocks/Items/enums/productEnums.js";
6
- import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
- import { base64EncodeWithSpecialChars as j } from "../utils/base64.js";
8
- import { useHttp as q } from "./useHttp.js";
9
- import { useToaster as M } from "./useToaster.js";
10
- import { useTranslations as X } from "./useTranslations.js";
11
- const ie = () => {
5
+ import { useRecommendationStore as G } from "../stores/recommendation.js";
6
+ import { base64EncodeWithSpecialChars as $ } from "../utils/base64.js";
7
+ import { useHttp as j } from "./useHttp.js";
8
+ import { useToaster as q } from "./useToaster.js";
9
+ import { useTranslations as M } from "./useTranslations.js";
10
+ const se = () => {
12
11
  var d;
13
- const { showToaster: c } = M(), { post: y } = q(), { config: h } = V(), a = X(), m = $(), u = ((d = h.partner) == null ? void 0 : d.messageType) === D.transactional, v = async (e) => {
12
+ const { showToaster: c } = q(), { post: y } = j(), { config: h } = H(), a = M(), m = G(), u = ((d = h.partner) == null ? void 0 : d.messageType) === V.transactional, v = async (e) => {
14
13
  const t = await y(
15
14
  "/newsletter/template-library/check-template-html-body",
16
- { html: j(e) }
15
+ { html: $(e) }
17
16
  ), { status: n, message: r } = t.data;
18
17
  return n || c({
19
18
  type: l.Alert,
@@ -26,10 +25,10 @@ const ie = () => {
26
25
  const t = e.match(/({%(.*?)%})/g);
27
26
  let n = !0;
28
27
  return t !== null && !u && t.forEach((r) => {
29
- const i = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
30
- if (i && i.length > 0) {
31
- const [o] = i;
32
- C(o) && !s.includes(o) && (c({
28
+ const o = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
+ if (o && o.length > 0) {
30
+ const [i] = o;
31
+ C(i) && !s.includes(i) && (c({
33
32
  type: l.Warning,
34
33
  message: a("custom-fields.invalid-custom-fields")
35
34
  }), n = !1);
@@ -59,19 +58,19 @@ const ie = () => {
59
58
  }, k = (e, s) => {
60
59
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
61
60
  if (t && !u) {
62
- const n = new Set(s.map((i) => i.toLowerCase())), r = [];
63
- if (t.forEach((i) => {
64
- const o = i.slice(2, -2).trim().toLowerCase();
65
- (!n.has(o) || o === "") && r.push(o);
61
+ const n = new Set(s.map((o) => o.toLowerCase())), r = [];
62
+ if (t.forEach((o) => {
63
+ const i = o.slice(2, -2).trim().toLowerCase();
64
+ (!n.has(i) || i === "") && r.push(i);
66
65
  }), r.length > 0) {
67
- const i = `
66
+ const o = `
68
67
  <ul>
69
- ${r.map((o) => `<li>${o}</li>`).join("")}
68
+ ${r.map((i) => `<li>${i}</li>`).join("")}
70
69
  </ul>
71
70
  `;
72
71
  return c({
73
72
  type: l.Alert,
74
- message: a("custom-fields.invalid-custom-fields") + i
73
+ message: a("custom-fields.invalid-custom-fields") + o
75
74
  }), !1;
76
75
  }
77
76
  }
@@ -80,11 +79,11 @@ const ie = () => {
80
79
  const s = e.match(/{%(.*?)%}/g), t = [];
81
80
  let n = !0;
82
81
  if (s && s.forEach((r) => {
83
- const i = r.match(H), o = r.match(P), B = (i == null ? void 0 : i.join("")) || "";
84
- (!i || r !== B) && !o && (c({
82
+ const o = r.match(D), i = r.match(P), B = (o == null ? void 0 : o.join("")) || "";
83
+ (!o || r !== B) && !i && (c({
85
84
  type: l.Alert,
86
85
  message: a("newsletter.display-conditions-invalid-syntax")
87
- }), n = !1), i && i.forEach((f) => {
86
+ }), n = !1), o && o.forEach((f) => {
88
87
  f.trim() === "=" && (c({
89
88
  type: l.Alert,
90
89
  message: a("custom-conditions.wrong-equality-operators")
@@ -95,8 +94,8 @@ const ie = () => {
95
94
  });
96
95
  });
97
96
  }), t.length) {
98
- const r = t.filter((o) => o === "if"), i = t.filter((o) => o === "endif");
99
- r.length !== i.length && (c({
97
+ const r = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
98
+ r.length !== o.length && (c({
100
99
  type: l.Alert,
101
100
  message: a("custom-conditions.missing-if-endif-tag")
102
101
  }), n = !1);
@@ -122,28 +121,28 @@ const ie = () => {
122
121
  }), !1);
123
122
  }, N = (e) => {
124
123
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
125
- return Array.from(n).find((i) => {
126
- var o;
127
- return !((o = i.id) != null && o.trim());
124
+ return Array.from(n).find((o) => {
125
+ var i;
126
+ return !((i = o.id) != null && i.trim());
128
127
  }) ? (c({
129
128
  type: l.Alert,
130
129
  message: a("unsubscribe-templates.select-checkbox-groups")
131
130
  }), !1) : !0;
132
131
  }, O = (e) => {
133
132
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
134
- return Array.from(n).find((i) => {
135
- var o;
136
- return !((o = i.id) != null && o.trim());
133
+ return Array.from(n).find((o) => {
134
+ var i;
135
+ return !((i = o.id) != null && i.trim());
137
136
  }) ? (c({
138
137
  type: l.Alert,
139
138
  message: a("unsubscribe-templates.select-radio-button-groups")
140
139
  }), !1) : !0;
141
140
  };
142
141
  return { validateHtml: async (e, s, t = !1) => {
143
- const n = [...s.map((i) => i.value), ...G];
142
+ const n = s.map((o) => o.value);
144
143
  return await b(e, n, t) && E(e) && A(e) && x(e) && k(e, n) && T(e) && F(e) && I(e) && W() && L(e) && N(e) && O(e);
145
144
  } };
146
145
  };
147
146
  export {
148
- ie as useHtmlValidator
147
+ se as useHtmlValidator
149
148
  };
@@ -2,11 +2,10 @@ 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 = "https://academy.useinsider.com/docs/email-drag-drop-editor";
6
6
  export {
7
- a as ACADEMY_LINK,
7
+ o as ACADEMY_LINK,
8
8
  n as CARD_COMPOSITION_TAB_SELECTOR,
9
- o as RIBBON_SELECTOR,
10
9
  e as SERVICE_HOVER_SELECTORS,
11
10
  s as SETTINGS_TAB_SELECTOR,
12
11
  t as UI_EDITOR_SELECTOR
@@ -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,20 +1,19 @@
1
- import { useOnboardingStore as y } from "../../../stores/onboarding.js";
2
- import { Block as R, BlockCompositionType as L, ModificationDescription as a } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
1
+ import { useOnboardingStore as f } from "../../../stores/onboarding.js";
2
+ import { Block as _, BlockCompositionType as g, ModificationDescription as u } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
3
  import { configAttributes as t } from "./enums/productEnums.js";
4
4
  import { DefaultConfigValues as e, SETTINGS_ENUMS as l } from "./enums/settingsEnums.js";
5
- import { useItemsBlockStore as S } from "./store/items-block.js";
6
- import { getDefaultTemplate as V } from "./template.js";
7
- import { syncCurrencySymbolFromAttributes as B, syncCurrencyLocationFromAttributes as U, syncFormattedPriceFromAttributes as k } from "./utils/syncAttributesFromConfigBlock.js";
8
- const M = "items-block";
9
- class x extends R {
5
+ import { useItemsBlockStore as d } from "./store/items-block.js";
6
+ import { getDefaultTemplate as D } from "./template.js";
7
+ const y = "items-block";
8
+ class V extends _ {
10
9
  getId() {
11
- return M;
10
+ return y;
12
11
  }
13
12
  getIcon() {
14
13
  return "items-icon";
15
14
  }
16
15
  getBlockCompositionType() {
17
- return L.CONTAINER;
16
+ return g.CONTAINER;
18
17
  }
19
18
  getName() {
20
19
  return this.api.translate("Items");
@@ -23,13 +22,14 @@ class x extends R {
23
22
  return this.api.translate("Items lets you display personalized products based on user behavior.");
24
23
  }
25
24
  getTemplate() {
26
- return V({
25
+ const r = d();
26
+ return D({
27
27
  orientation: l.ORIENTATION.HORIZONTAL,
28
28
  itemsType: l.ITEMS_TYPE.CART_ITEMS,
29
29
  itemId: "{{Abandoned Cart Item (1) Url}}",
30
- currencySymbol: e.productPriceCurrencySymbolControlValue,
31
- currencyLocation: e.productPriceCurrencyLocationControlValue,
32
- formattedPrice: e.productPriceFormattedControlValue === "1"
30
+ currencySymbol: r.currencySymbol,
31
+ currencyLocation: r.currencyLocation,
32
+ formattedPrice: r.formattedPrice
33
33
  });
34
34
  }
35
35
  allowInnerBlocksDND() {
@@ -39,29 +39,29 @@ class x extends R {
39
39
  const n = r.querySelector("esd-config-block");
40
40
  if (!n)
41
41
  return;
42
- const o = n, s = o.getAttribute("data-initialized") || "0", u = o.getAttribute(t.BLOCK_INSTANCE_ID), c = () => String(Date.now() + Math.floor(Math.random() * 1e3));
43
- if (Number(s)) {
44
- if (!u) {
45
- const i = c();
46
- this.api.getDocumentModifier().modifyHtml(o).setAttribute(t.BLOCK_INSTANCE_ID, i).apply(new a("Assign block instance ID to legacy block"));
42
+ const o = n, c = o.getAttribute("data-initialized") || "0", a = o.getAttribute(t.BLOCK_INSTANCE_ID), s = () => String(Date.now() + Math.floor(Math.random() * 1e3));
43
+ if (Number(c)) {
44
+ if (!a) {
45
+ const i = s();
46
+ this.api.getDocumentModifier().modifyHtml(o).setAttribute(t.BLOCK_INSTANCE_ID, i).apply(new u("Assign block instance ID to legacy block"));
47
47
  }
48
48
  } else {
49
- const i = e.itemsType, I = e.cartItemsSelectControlValue, d = e.cardOrientationControlValue, m = e.productNameTrimmingControlValue, C = e.productPriceHideDiscountControlValue, b = e.productPriceFormattedControlValue, T = e.productPriceCurrencySymbolControlValue, A = e.productPriceCurrencyLocationControlValue, E = e.productButtonLinkControlValue, O = e.productImageLinkControlValue, _ = e.productImageVisible, p = e.productNameVisible, N = e.productQuantityVisible, f = e.productPriceVisible, g = e.productOriginalPriceVisible, D = e.productButtonVisible, P = c();
50
- this.api.getDocumentModifier().modifyHtml(o).setAttribute("data-source", i).setAttribute(t.TYPE, i).setAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE, I).setAttribute(t.ORIENTATION, d).setAttribute(t.PRODUCT_NAME_TRIMMING, m).setAttribute(t.PRODUCT_PRICE_HIDE_DISCOUNT, C).setAttribute(t.PRODUCT_PRICE_FORMATTED, b).setAttribute(t.PRODUCT_PRICE_CURRENCY_SYMBOL, T).setAttribute(t.PRODUCT_PRICE_CURRENCY_LOCATION, A).setAttribute(t.PRODUCT_BUTTON_LINK, E).setAttribute(t.PRODUCT_IMAGE_LINK, O).setAttribute(t.BLOCK_INSTANCE_ID, P).setAttribute("data-initialized", "1").setAttribute(t.NAME_CONTROL_ENABLED, e.productNameControlEnabled).setAttribute(
49
+ const i = e.itemsType, m = e.cartItemsSelectControlValue, I = e.cardOrientationControlValue, C = e.productNameTrimmingControlValue, T = e.productPriceHideDiscountControlValue, E = e.productPriceFormattedControlValue, b = e.productPriceCurrencySymbolControlValue, O = e.productPriceCurrencyLocationControlValue, A = e.productButtonLinkControlValue, N = e.productImageLinkControlValue, p = s();
50
+ this.api.getDocumentModifier().modifyHtml(o).setAttribute("data-source", i).setAttribute(t.TYPE, i).setAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE, m).setAttribute(t.ORIENTATION, I).setAttribute(t.PRODUCT_NAME_TRIMMING, C).setAttribute(t.PRODUCT_PRICE_HIDE_DISCOUNT, T).setAttribute(t.PRODUCT_PRICE_FORMATTED, E).setAttribute(t.PRODUCT_PRICE_CURRENCY_SYMBOL, b).setAttribute(t.PRODUCT_PRICE_CURRENCY_LOCATION, O).setAttribute(t.PRODUCT_BUTTON_LINK, A).setAttribute(t.PRODUCT_IMAGE_LINK, N).setAttribute(t.BLOCK_INSTANCE_ID, p).setAttribute("data-initialized", "1").setAttribute(t.NAME_CONTROL_ENABLED, e.productNameControlEnabled).setAttribute(
51
51
  t.QUANTITY_CONTROL_ENABLED,
52
52
  e.productQuantityControlEnabled
53
- ).setAttribute(t.PRICE_CONTROL_OPENED, e.productPriceControlOpened).setAttribute(t.PRODUCT_IMAGE_VISIBLE, _).setAttribute(t.PRODUCT_NAME_VISIBLE, p).setAttribute(t.PRODUCT_QUANTITY_VISIBLE, N).setAttribute(t.PRODUCT_PRICE_VISIBLE, f).setAttribute(t.PRODUCT_ORIGINAL_PRICE_VISIBLE, g).setAttribute(t.PRODUCT_BUTTON_VISIBLE, D).apply(new a("Initialize config block attributes with defaults")), y().startOnboarding("itemsOnboarding");
53
+ ).setAttribute(t.PRICE_CONTROL_OPENED, e.productPriceControlOpened).apply(new u("Initialize config block attributes with defaults")), f().startOnboarding("itemsOnboarding");
54
54
  }
55
55
  }
56
56
  onSelect(r) {
57
- const n = r.querySelector("esd-config-block"), o = S();
57
+ const n = r.querySelector("esd-config-block"), o = d();
58
58
  if (!n)
59
59
  return;
60
- const s = n, u = s.getAttribute(t.TYPE) || e.itemsType, c = s.getAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE) || e.cartItemsSelectControlValue, i = s.getAttribute(t.ORIENTATION) || e.cardOrientationControlValue;
61
- o.setItemsType(u), o.setItemIds(c), o.setOrientation(i), B(r), U(r), k(r);
60
+ const c = n, a = c.getAttribute(t.TYPE) || e.itemsType, s = c.getAttribute(t.ITEMS_INDEX_SELECT_CONTROL_VALUE) || e.cartItemsSelectControlValue, i = c.getAttribute(t.ORIENTATION) || e.cardOrientationControlValue;
61
+ o.setItemsType(a), o.setItemIds(s), o.setOrientation(i);
62
62
  }
63
63
  }
64
64
  export {
65
- M as BLOCK_ID,
66
- x as ItemsBlock
65
+ y as BLOCK_ID,
66
+ V as ItemsBlock
67
67
  };