@useinsider/guido 3.26.0 → 3.27.0-beta.0dd857f

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 (124) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +93 -91
  3. package/dist/@types/display-condition.js +25 -0
  4. package/dist/@types/email-be/html-validation.js +28 -0
  5. package/dist/components/Guido.vue.js +5 -5
  6. package/dist/components/Guido.vue2.js +104 -98
  7. package/dist/components/organisms/display-conditions/CodeEditorField.vue.js +17 -0
  8. package/dist/components/organisms/display-conditions/CodeEditorField.vue2.js +41 -0
  9. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +30 -0
  10. package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +81 -0
  11. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue.js +17 -0
  12. package/dist/components/organisms/display-conditions/DisplayConditionListState.vue2.js +45 -0
  13. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +36 -0
  14. package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +63 -0
  15. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue.js +17 -0
  16. package/dist/components/organisms/display-conditions/DisplayConditionsHost.vue2.js +22 -0
  17. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
  18. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +15 -15
  19. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
  20. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +28 -27
  21. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +3 -3
  22. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +42 -27
  23. package/dist/composables/useBlocksConfig.js +29 -20
  24. package/dist/composables/useCustomInterfaceAppearance.js +50 -50
  25. package/dist/composables/useDisplayConditions.js +116 -0
  26. package/dist/composables/useFullStoryBridge.js +10 -9
  27. package/dist/composables/useSave.js +19 -17
  28. package/dist/composables/useSaveValidation.js +134 -252
  29. package/dist/composables/useTranslations.js +14 -8
  30. package/dist/config/compiler/utils/itemsCompilerUtils.js +43 -42
  31. package/dist/config/compiler/utils/recommendationCompilerUtils.js +67 -64
  32. package/dist/enums/academy.js +1 -0
  33. package/dist/enums/display-condition.js +12 -0
  34. package/dist/enums/email-be.js +27 -0
  35. package/dist/enums/save-validation.js +2 -2
  36. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +14 -14
  37. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -40
  38. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +15 -15
  39. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -15
  40. package/dist/extensions/Blocks/common-control.js +25 -25
  41. package/dist/extensions/DisplayConditions/bridge.js +25 -0
  42. package/dist/extensions/DisplayConditions/constants.js +26 -0
  43. package/dist/extensions/DisplayConditions/control.js +215 -0
  44. package/dist/extensions/DisplayConditions/display-conditions.css.js +226 -0
  45. package/dist/extensions/DisplayConditions/extension.js +28 -0
  46. package/dist/extensions/DisplayConditions/iconsRegistry.js +20 -0
  47. package/dist/extensions/DisplayConditions/library.js +30 -0
  48. package/dist/extensions/DisplayConditions/settingsPanel.js +17 -0
  49. package/dist/extensions/DynamicContent/dynamic-content.js +15 -17
  50. package/dist/guido.css +1 -1
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +93 -92
  52. package/dist/node_modules/valibot/dist/index.js +405 -291
  53. package/dist/package.json.js +2 -2
  54. package/dist/services/displayConditionApi.js +39 -0
  55. package/dist/services/emailBe/errors/ApiError.js +50 -0
  56. package/dist/services/emailBe/errors/handleApiError.js +31 -0
  57. package/dist/services/emailBe/errors/toApiError.js +71 -0
  58. package/dist/services/emailBe/html/HtmlValidationService.js +35 -0
  59. package/dist/services/emailBe/html/index.js +6 -0
  60. package/dist/services/emailBe/http/HttpManager.js +68 -0
  61. package/dist/services/emailBe/http/RetryStack.js +24 -0
  62. package/dist/services/emailBe/http/client.js +61 -0
  63. package/dist/services/emailBe/http/index.js +10 -0
  64. package/dist/services/emailBe/http/transportErrors.js +20 -0
  65. package/dist/src/@types/config/schemas.d.ts +4 -0
  66. package/dist/src/@types/display-condition.d.ts +61 -0
  67. package/dist/src/@types/email-be/html-validation.d.ts +51 -0
  68. package/dist/src/components/organisms/display-conditions/CodeEditorField.vue.d.ts +43 -0
  69. package/dist/src/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.d.ts +2 -0
  70. package/dist/src/components/organisms/display-conditions/DisplayConditionListState.vue.d.ts +18 -0
  71. package/dist/src/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.d.ts +2 -0
  72. package/dist/src/components/organisms/display-conditions/DisplayConditionsHost.vue.d.ts +2 -0
  73. package/dist/src/composables/useConfig.d.ts +2 -0
  74. package/dist/src/composables/useDisplayConditions.d.ts +18 -0
  75. package/dist/src/composables/useSaveValidation.d.ts +2 -2
  76. package/dist/src/enums/academy.d.ts +1 -0
  77. package/dist/src/enums/display-condition.d.ts +15 -0
  78. package/dist/src/enums/email-be.d.ts +26 -0
  79. package/dist/src/enums/save-validation.d.ts +3 -15
  80. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +2 -0
  81. package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
  82. package/dist/src/extensions/DisplayConditions/bridge.d.ts +7 -0
  83. package/dist/src/extensions/DisplayConditions/constants.d.ts +23 -0
  84. package/dist/src/extensions/DisplayConditions/control.d.ts +25 -0
  85. package/dist/src/extensions/{Blocks/_Boilerplate → DisplayConditions}/iconsRegistry.d.ts +1 -1
  86. package/dist/src/extensions/DisplayConditions/library.d.ts +8 -0
  87. package/dist/src/extensions/DisplayConditions/settingsPanel.d.ts +5 -0
  88. package/dist/src/mock/api/display-conditions.d.ts +2 -0
  89. package/dist/src/services/displayConditionApi.d.ts +8 -0
  90. package/dist/src/services/emailBe/errors/ApiError.d.ts +40 -0
  91. package/dist/src/services/emailBe/errors/handleApiError.d.ts +11 -0
  92. package/dist/src/services/emailBe/errors/toApiError.d.ts +2 -0
  93. package/dist/src/services/emailBe/html/HtmlValidationService.d.ts +8 -0
  94. package/dist/src/services/emailBe/html/index.d.ts +2 -0
  95. package/dist/src/services/emailBe/http/HttpManager.d.ts +13 -0
  96. package/dist/src/services/emailBe/http/RetryStack.d.ts +6 -0
  97. package/dist/src/services/emailBe/http/client.d.ts +3 -0
  98. package/dist/src/services/emailBe/http/index.d.ts +2 -0
  99. package/dist/src/services/emailBe/http/transportErrors.d.ts +15 -0
  100. package/dist/src/services/emailBe/http/types.d.ts +46 -0
  101. package/dist/src/stores/config.d.ts +170 -0
  102. package/dist/src/stores/display-condition.d.ts +86 -0
  103. package/dist/src/stores/onboarding.d.ts +1 -0
  104. package/dist/src/utils/displayCondition.d.ts +11 -0
  105. package/dist/src/utils/editorShadowRoot.d.ts +1 -0
  106. package/dist/src/utils/protectTableText.d.ts +2 -0
  107. package/dist/static/styles/variables.css.js +1 -0
  108. package/dist/stores/config.js +13 -6
  109. package/dist/stores/display-condition.js +29 -0
  110. package/dist/stores/onboarding.js +4 -1
  111. package/dist/utils/displayCondition.js +29 -0
  112. package/dist/utils/editorShadowRoot.js +8 -0
  113. package/dist/utils/pairProductVariables.js +29 -28
  114. package/dist/utils/protectTableText.js +22 -0
  115. package/package.json +10 -2
  116. package/dist/src/extensions/Blocks/_Boilerplate/block.d.ts +0 -11
  117. package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +0 -7
  118. package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +0 -10
  119. package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +0 -16
  120. package/dist/src/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
  121. package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +0 -15
  122. package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
  123. package/dist/src/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
  124. /package/dist/src/extensions/{Blocks/_Boilerplate → DisplayConditions}/extension.d.ts +0 -0
@@ -4,14 +4,20 @@ import memoize from "../node_modules/lodash-es/memoize.js";
4
4
  import { ref } from "vue";
5
5
  import { useConfig } from "./useConfig.js";
6
6
  const useTranslations = () => {
7
- var o, e;
8
- const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || DEFAULT_EDITOR.translationsPath, translations = ref(eval(translationsPath)), trans = (t, n) => {
9
- var s;
10
- const r = (s = translations.value) == null ? void 0 : s[t];
11
- return r ? n ? Object.entries(n).reduce(
12
- (i, [a, l]) => i.replace(new RegExp(`{${a}}`, "g"), String(l)),
13
- r
14
- ) : r : (console.warn(`Translation key not found: ${t}`), t);
7
+ var s, i;
8
+ const { config } = useConfig(), translationsPath = ((i = (s = config.value) == null ? void 0 : s.editor) == null ? void 0 : i.translationsPath) || DEFAULT_EDITOR.translationsPath, translations = ref(eval(translationsPath)), trans = (t, n) => {
9
+ var a;
10
+ const o = (a = translations.value) == null ? void 0 : a[t];
11
+ if (!o)
12
+ return console.warn(`Translation key not found: ${t}`), t;
13
+ const r = Object.keys(n ?? {}).filter(Boolean).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
14
+ if (n && r.length) {
15
+ const e = new RegExp(`{(${r.join("|")})}|:(${r.join("|")})\\b`, "g");
16
+ return o.replace(e, (f, l, c) => String(
17
+ n[l ?? c]
18
+ ));
19
+ }
20
+ return o;
15
21
  };
16
22
  return memoize(
17
23
  trans,
@@ -1,75 +1,76 @@
1
- import { PRODUCT_WRAPPER_SELECTOR as h, hasZeroWidthDeclaration as E, isZeroWidthValue as f, withWidthPin as T, PRODUCT_TD_SELECTOR as _, withoutZeroWidth as y } from "../../../extensions/Blocks/Items/constants/cardWidth.js";
2
- import { DefaultConfigValues as D } from "../../../extensions/Blocks/Items/enums/settingsEnums.js";
3
- import { protectLiquid as p, restoreLiquid as A } from "../../../utils/liquidProtection.js";
4
- const m = "MSO_ITEMS_HIDE_START", S = "MSO_ITEMS_HIDE_END", M = "mso-hide:all; max-height:0; overflow:hidden; font-size:0; line-height:0;", I = ".ins-product-cart td.horizontal-price, .ins-product-cart td.vertical-price", O = ".ins-product-td td.product-image-class img[width]", g = Number(D.productImageWidth);
5
- function C(t) {
1
+ import { PRODUCT_WRAPPER_SELECTOR as _, hasZeroWidthDeclaration as p, isZeroWidthValue as f, withWidthPin as y, PRODUCT_TD_SELECTOR as D, withoutZeroWidth as S } from "../../../extensions/Blocks/Items/constants/cardWidth.js";
2
+ import { DefaultConfigValues as M } from "../../../extensions/Blocks/Items/enums/settingsEnums.js";
3
+ import { protectLiquid as h, restoreLiquid as T } from "../../../utils/liquidProtection.js";
4
+ import { protectTableText as E, restoreTableText as m } from "../../../utils/protectTableText.js";
5
+ const A = "MSO_ITEMS_HIDE_START", b = "MSO_ITEMS_HIDE_END", I = "mso-hide:all; max-height:0; overflow:hidden; font-size:0; line-height:0;", O = ".ins-product-cart td.horizontal-price, .ins-product-cart td.vertical-price", g = ".ins-product-td td.product-image-class img[width]", H = Number(M.productImageWidth);
6
+ function P(t) {
6
7
  if (!t.includes("vertical-price") || !t.includes("ins-product-cart"))
7
8
  return t;
8
- const s = t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), o = new DOMParser().parseFromString(s, "text/html");
9
+ const s = E(t).replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), o = new DOMParser().parseFromString(s, "text/html");
9
10
  let n = !1;
10
- if (o.querySelectorAll(I).forEach((e) => {
11
+ if (o.querySelectorAll(O).forEach((e) => {
11
12
  var d, u;
12
- const r = e.getAttribute("style") || "";
13
- if (!/display\s*:\s*none/i.test(r))
13
+ const i = e.getAttribute("style") || "";
14
+ if (!/display\s*:\s*none/i.test(i))
14
15
  return;
15
16
  const l = e.previousSibling;
16
- if (((l == null ? void 0 : l.nodeType) !== Node.COMMENT_NODE || l.data !== m) && ((d = e.parentNode) == null || d.insertBefore(o.createComment(m), e), (u = e.parentNode) == null || u.insertBefore(o.createComment(S), e.nextSibling)), !/mso-hide/i.test(r)) {
17
- const a = r.trim().endsWith(";") ? " " : "; ";
18
- e.setAttribute("style", `${r}${a}${M}`);
17
+ if (((l == null ? void 0 : l.nodeType) !== Node.COMMENT_NODE || l.data !== A) && ((d = e.parentNode) == null || d.insertBefore(o.createComment(A), e), (u = e.parentNode) == null || u.insertBefore(o.createComment(b), e.nextSibling)), !/mso-hide/i.test(i)) {
18
+ const a = i.trim().endsWith(";") ? " " : "; ";
19
+ e.setAttribute("style", `${i}${a}${I}`);
19
20
  }
20
21
  n = !0;
21
22
  }), !n)
22
23
  return t;
23
- const c = s.match(/<!DOCTYPE[^>]*>/i);
24
- return ((c ? `${c[0]}
25
- ` : "") + o.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
24
+ const c = s.match(/<!DOCTYPE[^>]*>/i), r = c ? `${c[0]}
25
+ ` : "";
26
+ return m((r + o.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}"));
26
27
  }
27
- function N(t) {
28
+ function R(t) {
28
29
  if (!t.includes("ins-product-wrapper") && !t.includes("ins-product-td"))
29
30
  return t;
30
- const s = new DOMParser().parseFromString(p(t), "text/html");
31
+ const s = new DOMParser().parseFromString(h(E(t)), "text/html");
31
32
  let o = !1;
32
- if (s.querySelectorAll(h).forEach((i) => {
33
- const e = i.getAttribute("style") || "";
34
- if (!E(e) && !f(i.getAttribute("width")))
33
+ if (s.querySelectorAll(_).forEach((r) => {
34
+ const e = r.getAttribute("style") || "";
35
+ if (!p(e) && !f(r.getAttribute("width")))
35
36
  return;
36
- const r = T(e);
37
- r !== e && (i.setAttribute("style", r), o = !0), f(i.getAttribute("width")) && (i.setAttribute("width", "100%"), o = !0);
38
- }), s.querySelectorAll(_).forEach((i) => {
39
- const e = i.getAttribute("style") || "";
40
- if (E(e)) {
41
- const r = y(e);
42
- r ? i.setAttribute("style", r) : i.removeAttribute("style"), o = !0;
37
+ const i = y(e);
38
+ i !== e && (r.setAttribute("style", i), o = !0), f(r.getAttribute("width")) && (r.setAttribute("width", "100%"), o = !0);
39
+ }), s.querySelectorAll(D).forEach((r) => {
40
+ const e = r.getAttribute("style") || "";
41
+ if (p(e)) {
42
+ const i = S(e);
43
+ i ? r.setAttribute("style", i) : r.removeAttribute("style"), o = !0;
43
44
  }
44
- f(i.getAttribute("width")) && (i.removeAttribute("width"), o = !0);
45
+ f(r.getAttribute("width")) && (r.removeAttribute("width"), o = !0);
45
46
  }), !o)
46
47
  return t;
47
48
  const n = t.match(/<!DOCTYPE[^>]*>/i), c = n ? `${n[0]}
48
49
  ` : "";
49
- return A(c + s.documentElement.outerHTML);
50
+ return m(T(c + s.documentElement.outerHTML));
50
51
  }
51
- function L(t) {
52
+ function x(t) {
52
53
  if (!t.includes("product-image-class"))
53
54
  return t;
54
- const s = new DOMParser().parseFromString(p(t), "text/html");
55
+ const s = new DOMParser().parseFromString(h(E(t)), "text/html");
55
56
  let o = !1;
56
- if (s.querySelectorAll(O).forEach((i) => {
57
+ if (s.querySelectorAll(g).forEach((r) => {
57
58
  var u, a;
58
- const e = ((u = i.getAttribute("width")) == null ? void 0 : u.trim()) ?? "", r = ((a = i.getAttribute("style")) == null ? void 0 : a.trim()) ?? "";
59
- if (!/^\d+$/.test(e) || /(^|;)\s*min-width\s*:/i.test(r))
59
+ const e = ((u = r.getAttribute("width")) == null ? void 0 : u.trim()) ?? "", i = ((a = r.getAttribute("style")) == null ? void 0 : a.trim()) ?? "";
60
+ if (!/^\d+$/.test(e) || /(^|;)\s*min-width\s*:/i.test(i))
60
61
  return;
61
- const l = r && !r.endsWith(";") ? ";" : "", d = Math.min(Number(e), g);
62
- i.setAttribute("style", `${r}${l}min-width:${d}px;max-width:${e}px`), o = !0;
62
+ const l = i && !i.endsWith(";") ? ";" : "", d = Math.min(Number(e), H);
63
+ r.setAttribute("style", `${i}${l}min-width:${d}px;max-width:${e}px`), o = !0;
63
64
  }), !o)
64
65
  return t;
65
66
  const n = t.match(/<!DOCTYPE[^>]*>/i), c = n ? `${n[0]}
66
67
  ` : "";
67
- return A(c + s.documentElement.outerHTML);
68
+ return m(T(c + s.documentElement.outerHTML));
68
69
  }
69
70
  export {
70
- S as MSO_ITEMS_HIDE_END,
71
- m as MSO_ITEMS_HIDE_START,
72
- L as lockHorizontalItemImageWidths,
73
- N as normalizeItemsBlockWidths,
74
- C as wrapHiddenPriceTdsForOutlook
71
+ b as MSO_ITEMS_HIDE_END,
72
+ A as MSO_ITEMS_HIDE_START,
73
+ x as lockHorizontalItemImageWidths,
74
+ R as normalizeItemsBlockWidths,
75
+ P as wrapHiddenPriceTdsForOutlook
75
76
  };
@@ -1,13 +1,14 @@
1
1
  import { useConfig as C } from "../../../composables/useConfig.js";
2
2
  import { useRecommendation as O } from "../../../composables/useRecommendation.js";
3
- import { MOBILE_ROW_SELECTOR as q, MOBILE_CONTAINER_SELECTOR as M, CSS_CLASS_RECO_BUTTON as B } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
4
- import { useRecommendationExtensionStore as N } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { isIgnoredRecommendationBlock as T } from "./recommendationIgnoreUtils.js";
6
- function L(t, r, e, o, c = "") {
3
+ import { MOBILE_ROW_SELECTOR as q, MOBILE_CONTAINER_SELECTOR as M, CSS_CLASS_RECO_BUTTON as T } from "../../../extensions/Blocks/Recommendation/constants/selectors.js";
4
+ import { useRecommendationExtensionStore as B } from "../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { protectTableText as N, restoreTableText as L } from "../../../utils/protectTableText.js";
6
+ import { isIgnoredRecommendationBlock as P } from "./recommendationIgnoreUtils.js";
7
+ function R(t, r, e, o, c = "") {
7
8
  const i = `{{${c}${t}_${r}_${e}}}`, n = `{{${c}${t}_${r}_currency}}`;
8
9
  return o === "before" ? `${n} ${i}` : `${i} ${n}`;
9
10
  }
10
- function A(t) {
11
+ function b(t) {
11
12
  let r = t;
12
13
  for (; r.children.length === 1; )
13
14
  [r] = r.children;
@@ -19,12 +20,12 @@ function _(t, r, e, o, c, i) {
19
20
  const n = t.querySelector("img");
20
21
  n && (n.setAttribute("src", `{{${i}${e}_${o}_image_url}}`), n.setAttribute("alt", `{{${i}${e}_${o}_name}}`));
21
22
  const s = t.querySelector("a");
22
- s && (s.setAttribute("href", `{{${i}${e}_${o}_url}}`), s.classList.add(B));
23
+ s && (s.setAttribute("href", `{{${i}${e}_${o}_url}}`), s.classList.add(T));
23
24
  break;
24
25
  }
25
26
  case "productName": {
26
27
  const n = t.querySelector("p");
27
- n && (A(n).textContent = `{{${i}${e}_${o}_name}}`);
28
+ n && (b(n).textContent = `{{${i}${e}_${o}_name}}`);
28
29
  break;
29
30
  }
30
31
  // Inline mode ("Move to next line" OFF) merges BOTH prices into one row
@@ -32,16 +33,16 @@ function _(t, r, e, o, c, i) {
32
33
  // substitute by cell content, not by the row's anchor (SD-145161).
33
34
  case "productPrice":
34
35
  case "productOldPrice": {
35
- const n = (a, l) => {
36
- a && (A(a).textContent = L(
36
+ const n = (l, d) => {
37
+ l && (b(l).textContent = R(
37
38
  e,
38
39
  o,
39
- l,
40
+ d,
40
41
  c,
41
42
  i
42
43
  ));
43
- }, s = t.querySelector(".product-price p"), d = t.querySelector(".product-old-price p"), u = !s && !d ? t.querySelector("p") : null;
44
- n(s ?? (r === "productPrice" ? u : null), "price"), n(d ?? (r === "productOldPrice" ? u : null), "original_price");
44
+ }, s = t.querySelector(".product-price p"), a = t.querySelector(".product-old-price p"), u = !s && !a ? t.querySelector("p") : null;
45
+ n(s ?? (r === "productPrice" ? u : null), "price"), n(a ?? (r === "productOldPrice" ? u : null), "original_price");
45
46
  break;
46
47
  }
47
48
  case "productButton": {
@@ -70,72 +71,72 @@ function _(t, r, e, o, c, i) {
70
71
  default: {
71
72
  const n = t.getAttribute("product-attr") ? t : t.querySelector("[product-attr]");
72
73
  if (n) {
73
- const s = n.getAttribute("product-attr"), d = n.querySelector("p");
74
- d && (A(d).textContent = `{{${i}${e}_${o}_${s}}}`);
74
+ const s = n.getAttribute("product-attr"), a = n.querySelector("p");
75
+ a && (b(a).textContent = `{{${i}${e}_${o}_${s}}}`);
75
76
  }
76
77
  break;
77
78
  }
78
79
  }
79
80
  }
80
- const P = "name";
81
+ const w = "name";
81
82
  function y(t, r, e, o) {
82
- const c = `${o}${r}_${e}_${P}`;
83
+ const c = `${o}${r}_${e}_${w}`;
83
84
  return {
84
85
  open: t.createComment(`{% if ${c} and ${c} != "" %}`),
85
86
  close: t.createComment("{% endif %}")
86
87
  };
87
88
  }
88
- function R(t, r, e) {
89
+ function D(t, r, e) {
89
90
  return y(t, r, 0, e);
90
91
  }
91
- function w(t, r, e, o) {
92
+ function v(t, r, e, o) {
92
93
  if (!t.innerHTML.includes("{{"))
93
94
  return;
94
95
  const { open: c, close: i } = y(t.ownerDocument, r, e, o);
95
96
  t.insertBefore(c, t.firstChild), t.appendChild(i);
96
97
  }
97
- function D(t, r, e, o) {
98
+ function W(t, r, e, o) {
98
99
  var n, s;
99
100
  if (!t.innerHTML.includes("{{"))
100
101
  return;
101
102
  const { open: c, close: i } = y(t.ownerDocument, r, e, o);
102
103
  (n = t.parentNode) == null || n.insertBefore(c, t), (s = t.parentNode) == null || s.insertBefore(i, t.nextSibling);
103
104
  }
104
- function v(t, r, e, o) {
105
+ function H(t, r, e, o) {
105
106
  t.querySelectorAll(".recommendation-product-row").forEach((i, n) => {
106
- i.querySelectorAll("[data-attribute-type]").forEach((d) => {
107
- const u = d.getAttribute("data-attribute-type") || "", a = d.querySelectorAll(".attribute-cell");
108
- a.length > 0 ? a.forEach((l) => {
109
- _(l, u, r, n, e, o);
110
- }) : _(d, u, r, n, e, o);
111
- }), D(i, r, n, o);
107
+ i.querySelectorAll("[data-attribute-type]").forEach((a) => {
108
+ const u = a.getAttribute("data-attribute-type") || "", l = a.querySelectorAll(".attribute-cell");
109
+ l.length > 0 ? l.forEach((d) => {
110
+ _(d, u, r, n, e, o);
111
+ }) : _(a, u, r, n, e, o);
112
+ }), W(i, r, n, o);
112
113
  });
113
114
  }
114
- function H(t, r, e, o) {
115
+ function x(t, r, e, o) {
115
116
  const c = t.querySelectorAll(".recommendation-product-row");
116
117
  if (!c.length)
117
118
  return;
118
119
  const [i] = c, n = i.querySelector("[data-attribute-type]"), s = n ? n.querySelectorAll(".attribute-cell").length : 1;
119
- c.forEach((d, u) => {
120
- d.querySelectorAll("[data-attribute-type]").forEach((l) => {
121
- const p = l.getAttribute("data-attribute-type") || "";
122
- l.querySelectorAll(".attribute-cell").forEach((m, h) => {
120
+ c.forEach((a, u) => {
121
+ a.querySelectorAll("[data-attribute-type]").forEach((d) => {
122
+ const p = d.getAttribute("data-attribute-type") || "";
123
+ d.querySelectorAll(".attribute-cell").forEach((m, h) => {
123
124
  const S = u * s + h;
124
- _(m, p, r, S, e, o), w(m, r, S, o);
125
+ _(m, p, r, S, e, o), v(m, r, S, o);
125
126
  });
126
127
  });
127
128
  });
128
129
  }
129
- function W(t, r, e, o) {
130
+ function F(t, r, e, o) {
130
131
  t.querySelectorAll(".ins-recommendation-product-container").forEach((i) => {
131
- H(i, r, e, o);
132
+ x(i, r, e, o);
132
133
  });
133
134
  }
134
- function F(t, r, e) {
135
+ function G(t, r, e) {
135
136
  const o = t.getAttribute("data-layout") || "grid", c = t.getAttribute("currency-alignment"), i = c === "0" || c === "before" ? "before" : "after";
136
- o === "list" ? v(t, r, i, e) : W(t, r, i, e);
137
+ o === "list" ? H(t, r, i, e) : F(t, r, i, e);
137
138
  }
138
- function b(t, r, e) {
139
+ function A(t, r, e) {
139
140
  const o = new RegExp(`${r}\\s*:\\s*(\\d+)\\s*px`, "i"), c = t.match(o);
140
141
  return c ? parseInt(c[1]) : e;
141
142
  }
@@ -150,7 +151,7 @@ function g(t) {
150
151
  const e = (t.getAttribute("style") || "").match(/(?:^|[;\s])width\s*:\s*(\d+(?:\.\d+)?(?:px|%))/i);
151
152
  return e && $(e[1]) ? e[1] : null;
152
153
  }
153
- function x(t, r) {
154
+ function V(t, r) {
154
155
  let e = t.parentElement;
155
156
  for (; e && e !== r; ) {
156
157
  if (e.tagName === "TD" && g(e))
@@ -159,62 +160,64 @@ function x(t, r) {
159
160
  }
160
161
  return null;
161
162
  }
162
- function G(t) {
163
- const r = t.getAttribute("style") || "", e = b(r, "width", 600), o = b(r, "padding", 0) * 2, c = Math.max(0, e - o);
163
+ function U(t) {
164
+ const r = t.getAttribute("style") || "", e = A(r, "width", 600), o = A(r, "padding", 0) * 2, c = Math.max(0, e - o);
164
165
  c !== 0 && t.querySelectorAll("img.adapt-img").forEach((i) => {
165
166
  if (i.hasAttribute("width"))
166
167
  return;
167
- const n = x(i, t);
168
+ const n = V(i, t);
168
169
  if (!n)
169
170
  return;
170
- const s = g(n), d = b(n.getAttribute("style") || "", "padding", 0) * 2, u = s.endsWith("%") ? Math.floor(c * parseFloat(s) / 100) : parseInt(s), a = Math.max(1, u - d), l = i.getAttribute("style") || "", p = /(?:^|[;\s])max-height\s*:\s*(\d+(?:\.\d+)?)px/i.exec(l);
171
+ const s = g(n), a = A(n.getAttribute("style") || "", "padding", 0) * 2, u = s.endsWith("%") ? Math.floor(c * parseFloat(s) / 100) : parseInt(s), l = Math.max(1, u - a), d = i.getAttribute("style") || "", p = /(?:^|[;\s])max-height\s*:\s*(\d+(?:\.\d+)?)px/i.exec(d);
171
172
  if (p) {
172
- i.setAttribute("width", String(Math.max(1, Math.min(a, Math.floor(parseFloat(p[1])))))), i.removeAttribute("height");
173
+ i.setAttribute("width", String(Math.max(1, Math.min(l, Math.floor(parseFloat(p[1])))))), i.removeAttribute("height");
173
174
  return;
174
175
  }
175
- if (i.setAttribute("width", String(a)), !/\bwidth\s*:\s*\d/i.test(l)) {
176
- const f = l && !l.trim().endsWith(";") ? "; " : "";
177
- i.setAttribute("style", `${l}${f}width: ${a}px`);
176
+ if (i.setAttribute("width", String(l)), !/\bwidth\s*:\s*\d/i.test(d)) {
177
+ const f = d && !d.trim().endsWith(";") ? "; " : "";
178
+ i.setAttribute("style", `${d}${f}width: ${l}px`);
178
179
  }
179
180
  });
180
181
  }
181
- const E = "MSO_MOBILE_HIDE_START", V = "MSO_MOBILE_HIDE_END";
182
- function U(t, r) {
182
+ const E = "MSO_MOBILE_HIDE_START", X = "MSO_MOBILE_HIDE_END";
183
+ function j(t, r) {
183
184
  t.querySelectorAll(q).forEach((e) => {
184
185
  var i, n;
185
186
  const o = e.querySelector(M);
186
187
  if (!o || o.children.length === 0)
187
188
  return;
188
189
  const c = e.previousSibling;
189
- (c == null ? void 0 : c.nodeType) === Node.COMMENT_NODE && c.data === E || ((i = e.parentNode) == null || i.insertBefore(r.createComment(E), e), (n = e.parentNode) == null || n.insertBefore(r.createComment(V), e.nextSibling));
190
+ (c == null ? void 0 : c.nodeType) === Node.COMMENT_NODE && c.data === E || ((i = e.parentNode) == null || i.insertBefore(r.createComment(E), e), (n = e.parentNode) == null || n.insertBefore(r.createComment(X), e.nextSibling));
190
191
  });
191
192
  }
192
- function X(t, r) {
193
+ function Y(t, r) {
193
194
  const e = t.match(/<!DOCTYPE[^>]*>/i);
194
195
  return (e ? `${e[0]}
195
196
  ` : "") + r.documentElement.outerHTML;
196
197
  }
197
- function Q(t) {
198
- const r = t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), e = new DOMParser().parseFromString(r, "text/html"), o = e.querySelectorAll(".recommendation-block-v2");
198
+ function I(t) {
199
+ const r = N(t).replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), e = new DOMParser().parseFromString(r, "text/html"), o = e.querySelectorAll(".recommendation-block-v2");
199
200
  if (!o.length)
200
201
  return t;
201
- const { buildCampaignUrl: c } = O(), i = N();
202
+ const { buildCampaignUrl: c } = O(), i = B();
202
203
  i.recommendationCampaignUrls = {};
203
204
  const { isFeatureEnabled: n } = C(), s = n("liquidSyntax") ? "reco_" : "";
204
- return o.forEach((u) => {
205
- var l, p, f, m;
206
- const a = u.getAttribute("recommendation-id");
207
- if (a) {
208
- if ((l = u.parentNode) == null || l.insertBefore(e.createComment("REC_START"), u), (p = u.parentNode) == null || p.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((h) => h.remove()), c(a), U(u, e), !T(u)) {
209
- F(u, a, s);
210
- const { open: h, close: S } = R(e, a, s);
205
+ o.forEach((u) => {
206
+ var d, p, f, m;
207
+ const l = u.getAttribute("recommendation-id");
208
+ if (l) {
209
+ if ((d = u.parentNode) == null || d.insertBefore(e.createComment("REC_START"), u), (p = u.parentNode) == null || p.insertBefore(e.createComment("REC_END"), u.nextSibling), u.querySelectorAll('[data-visibility="0"]').forEach((h) => h.remove()), c(l), j(u, e), !P(u)) {
210
+ G(u, l, s);
211
+ const { open: h, close: S } = D(e, l, s);
211
212
  (f = u.parentNode) == null || f.insertBefore(h, u), (m = u.parentNode) == null || m.insertBefore(S, u.nextSibling);
212
213
  }
213
- G(u);
214
+ U(u);
214
215
  }
215
- }), X(r, e).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
216
+ });
217
+ const a = Y(r, e);
218
+ return L(a.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}"));
216
219
  }
217
220
  export {
218
- L as formatPriceVariable,
219
- Q as prepareRecommendationBlocks
221
+ R as formatPriceVariable,
222
+ I as prepareRecommendationBlocks
220
223
  };
@@ -2,6 +2,7 @@ const e = "https://academy.insiderone.com", o = {
2
2
  EMAIL_EDITOR: `${e}/docs/email-drag-and-drop-editor`,
3
3
  GLOBAL_UNSUBSCRIBE: `${e}/docs/global-unsubscribe-preference-center`,
4
4
  AMP_FOR_EMAILS: `${e}/docs/amp-for-emails`,
5
+ EMAIL_DISPLAY_CONDITIONS: `${e}/docs/new-editor-add-display-conditions-to-an-email`,
5
6
  EMAIL_RECOMMENDATION_BLOCK: `${e}/docs/new-editor-email-recommendation-block`,
6
7
  LEGACY_UNSUBSCRIBE_MODULE: `${e}/docs/new-editor-add-unsubscribe-pages-into-emails`
7
8
  };
@@ -0,0 +1,12 @@
1
+ var N = /* @__PURE__ */ ((I) => (I.OPEN = "display-condition:open", I.APPLY = "display-condition:apply", I.CANCEL = "display-condition:cancel", I))(N || {}), A = /* @__PURE__ */ ((I) => (I.INLINE = "inline", I.SAVED = "saved", I))(A || {});
2
+ const M = {
3
+ NAME_MIN: 2,
4
+ NAME_MAX: 40,
5
+ DESCRIPTION_MAX: 200,
6
+ CODE_MAX: 65535
7
+ };
8
+ export {
9
+ M as DISPLAY_CONDITION_LIMITS,
10
+ N as DisplayConditionEvent,
11
+ A as DisplayConditionSourceType
12
+ };
@@ -0,0 +1,27 @@
1
+ const E = "/email-proxy", e = {
2
+ HTML_VALIDATE: "/v1/html/validate"
3
+ }, n = {
4
+ BAD_GATEWAY: "bad_gateway",
5
+ BAD_REQUEST: "bad_request",
6
+ CONFLICT: "conflict",
7
+ FORBIDDEN: "forbidden",
8
+ INTERNAL_ERROR: "internal_error",
9
+ NOT_FOUND: "not_found",
10
+ RATE_LIMITED: "rate_limited",
11
+ UNAUTHENTICATED: "unauthenticated",
12
+ VALIDATION_FAILED: "validation_failed",
13
+ SESSION_EXPIRED: "session_expired",
14
+ INVALID_RESPONSE: "invalid_response",
15
+ NETWORK: "network_error",
16
+ TIMEOUT: "timeout",
17
+ UNKNOWN: "unknown"
18
+ }, t = {
19
+ PONGO: "pongo",
20
+ LIQUID: "liquid"
21
+ };
22
+ export {
23
+ E as EMAIL_BE_BASE_URL,
24
+ e as EmailBeEndPoints,
25
+ n as EmailBeErrorCodes,
26
+ t as HtmlSyntax
27
+ };
@@ -1,4 +1,4 @@
1
- var n = /* @__PURE__ */ ((s) => (s.CouponTagModified = "coupon-tag-modified", s.DuplicateUnsubBlock = "duplicate-unsub-block", s.UnsubBlockMissingTemplate = "unsub-block-missing-template", s.LiquidSyntax = "liquid-syntax", s.InvalidLinks = "invalid-links", s.LinkCheckInProgress = "link-check-in-progress", s.CustomFieldScript = "custom-field-script", s.EmptyHtml = "empty-html", s.MismatchedBraces = "mismatched-braces", s.InvalidDynamicTag = "invalid-dynamic-tag", s.InvalidCustomField = "invalid-custom-field", s.ConditionsSyntax = "conditions-syntax", s.WrongEqualityOperator = "wrong-equality-operator", s.MissingIfEndif = "missing-if-endif", s.ConditionTagSpacing = "condition-tag-spacing", s.BracesInsideIfTag = "braces-inside-if-tag", s.RecommendationRequiredFields = "recommendation-required-fields", s.RecommendationFilters = "recommendation-filters", s.InvalidImageType = "invalid-image-type", s.CheckboxUnsubGroup = "checkbox-unsub-group", s.RadioButtonUnsubGroup = "radio-button-unsub-group", s.ExternallyManagedUnsubscribe = "externally-managed-unsubscribe", s))(n || {});
1
+ var r = /* @__PURE__ */ ((n) => (n.CustomFieldScript = "custom-field-script", n.InvalidDynamicTag = "invalid-dynamic-tag", n.InvalidCustomField = "invalid-custom-field", n.MissingIfEndif = "missing-if-endif", n.RecommendationRequiredFields = "recommendation-required-fields", n.RecommendationFilters = "recommendation-filters", n.CheckboxUnsubGroup = "checkbox-unsub-group", n.RadioButtonUnsubGroup = "radio-button-unsub-group", n.ExternallyManagedUnsubscribe = "externally-managed-unsubscribe", n.EmailBeHtml = "email-be-html", n))(r || {});
2
2
  export {
3
- n as SaveValidationRule
3
+ r as SaveValidationRule
4
4
  };
@@ -1,21 +1,21 @@
1
- var n = Object.defineProperty;
2
- var o = (i, e, t) => e in i ? n(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var r = (i, e, t) => o(i, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommonControl as s } from "../../../common-control.js";
5
- import { useRecommendationExtensionStore as l } from "../../store/recommendation.js";
6
- const d = "recommendation-filters-control", a = {
1
+ var o = Object.defineProperty;
2
+ var s = (i, e, t) => e in i ? o(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
+ var r = (i, e, t) => s(i, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommonControl as l } from "../../../common-control.js";
5
+ import { useRecommendationExtensionStore as d } from "../../store/recommendation.js";
6
+ const a = "recommendation-filters-control", u = {
7
7
  FILTERS: "filterStatus"
8
8
  };
9
- class h extends s {
9
+ class m extends l {
10
10
  constructor() {
11
11
  super(...arguments);
12
- r(this, "store", l());
12
+ r(this, "store", d());
13
13
  r(this, "addFilterListener", () => {
14
14
  });
15
15
  r(this, "addFilterButton", null);
16
16
  }
17
17
  getId() {
18
- return d;
18
+ return a;
19
19
  }
20
20
  getTemplate() {
21
21
  return `
@@ -23,7 +23,7 @@ class h extends s {
23
23
  ${this._GuTwoColumns([
24
24
  this._GuLabel({ text: this.api.translate("Filters") }),
25
25
  this._GuButton({
26
- name: a.FILTERS,
26
+ name: u.FILTERS,
27
27
  label: this.api.translate("Add Filter"),
28
28
  id: "guido__btn-add-filter"
29
29
  })
@@ -42,11 +42,11 @@ class h extends s {
42
42
  this.store.openFilterDrawer();
43
43
  }
44
44
  _setupButtonListener() {
45
- var t;
46
- this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (t = this.addFilterButton) == null || t.addEventListener("click", this.addFilterListener);
45
+ var t, n;
46
+ this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = (t = this.getContainer()) == null ? void 0 : t.querySelector("#guido__btn-add-filter"), (n = this.addFilterButton) == null || n.addEventListener("click", this.addFilterListener);
47
47
  }
48
48
  }
49
49
  export {
50
- d as FILTERS_CONTROL_ID,
51
- h as FiltersControl
50
+ a as FILTERS_CONTROL_ID,
51
+ m as FiltersControl
52
52
  };