@useinsider/guido 1.0.3-beta.0d0bb85 → 1.0.3-beta.0da597d

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 (118) hide show
  1. package/README.md +172 -3
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +79 -73
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
  6. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  7. package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
  8. package/dist/composables/useBlocksConfig.js +48 -0
  9. package/dist/composables/useGuidoActions.js +19 -9
  10. package/dist/composables/useStripo.js +50 -59
  11. package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
  12. package/dist/enums/defaults.js +16 -9
  13. package/dist/enums/extensions/recommendationBlock.js +2 -2
  14. package/dist/enums/unsubscribe.js +10 -9
  15. package/dist/extensions/Blocks/Checkbox/block.js +5 -2
  16. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  17. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  18. package/dist/extensions/Blocks/Items/block.js +66 -0
  19. package/dist/extensions/Blocks/Items/controls/button/link.js +68 -0
  20. package/dist/extensions/Blocks/Items/controls/cardComposition.js +99 -0
  21. package/dist/extensions/Blocks/Items/controls/image/link.js +68 -0
  22. package/dist/extensions/Blocks/Items/controls/index.js +217 -0
  23. package/dist/extensions/Blocks/Items/controls/name/trimming.js +70 -0
  24. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +107 -0
  25. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +123 -0
  26. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +76 -0
  27. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +61 -0
  28. package/dist/extensions/Blocks/Items/controls/settingsControl.js +280 -0
  29. package/dist/extensions/Blocks/Items/enums/controlEnums.js +5 -0
  30. package/dist/extensions/Blocks/Items/enums/productEnums.js +195 -0
  31. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +70 -0
  32. package/dist/extensions/Blocks/Items/extension.js +19 -0
  33. package/dist/extensions/Blocks/Items/iconsRegistry.js +32 -0
  34. package/dist/extensions/Blocks/Items/items.css.js +23 -0
  35. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +61 -0
  36. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +61 -0
  37. package/dist/extensions/Blocks/Items/settingsPanel.js +106 -0
  38. package/dist/extensions/Blocks/Items/store/items-block.js +71 -0
  39. package/dist/extensions/Blocks/Items/template.js +110 -0
  40. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
  41. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
  42. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +67 -0
  43. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +44 -0
  44. package/dist/extensions/Blocks/RadioButton/block.js +5 -2
  45. package/dist/extensions/Blocks/Recommendation/extension.js +4 -4
  46. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
  47. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  48. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +4 -4
  49. package/dist/extensions/Blocks/common-control.js +174 -110
  50. package/dist/extensions/Blocks/controlFactories.js +223 -0
  51. package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
  52. package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
  53. package/dist/guido.css +1 -1
  54. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +213 -168
  55. package/dist/package.json.js +1 -1
  56. package/dist/services/recommendationApi.js +13 -19
  57. package/dist/services/stripoApi.js +1 -1
  58. package/dist/src/@types/generic.d.ts +36 -6
  59. package/dist/src/components/Guido.vue.d.ts +3 -2
  60. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  61. package/dist/src/composables/useBlocksConfig.d.ts +11 -0
  62. package/dist/src/composables/useGuidoActions.d.ts +9 -0
  63. package/dist/src/extensions/Blocks/Checkbox/block.d.ts +1 -0
  64. package/dist/src/extensions/Blocks/Items/block.d.ts +13 -0
  65. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +14 -0
  66. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +20 -0
  67. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +14 -0
  68. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +501 -0
  69. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +14 -0
  70. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +19 -0
  71. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +21 -0
  72. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +14 -0
  73. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +13 -0
  74. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +42 -0
  75. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +61 -0
  76. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +154 -0
  77. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +43 -0
  78. package/dist/src/extensions/Blocks/Items/extension.d.ts +2 -0
  79. package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +4 -0
  80. package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +4 -0
  81. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +41 -0
  82. package/dist/src/extensions/Blocks/Items/template.d.ts +16 -0
  83. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
  84. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
  85. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +44 -0
  86. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
  87. package/dist/src/extensions/Blocks/RadioButton/block.d.ts +1 -0
  88. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  89. package/dist/src/extensions/Blocks/common-control.d.ts +44 -7
  90. package/dist/src/extensions/Blocks/controlFactories.d.ts +312 -0
  91. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
  92. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
  93. package/dist/src/stores/config.d.ts +9 -2
  94. package/dist/src/stores/dynamic-content.d.ts +3 -3
  95. package/dist/src/stores/editor.d.ts +1 -1
  96. package/dist/src/stores/onboarding.d.ts +1 -1
  97. package/dist/src/stores/preview.d.ts +1 -1
  98. package/dist/src/stores/recommendation.d.ts +1 -1
  99. package/dist/src/stores/save-as-template.d.ts +1 -1
  100. package/dist/src/stores/toaster.d.ts +1 -1
  101. package/dist/src/stores/unsubscribe.d.ts +1 -1
  102. package/dist/src/stores/version-history.d.ts +1 -1
  103. package/dist/src/utils/arrayUtil.d.ts +0 -5
  104. package/dist/src/utils/genericUtil.d.ts +1 -0
  105. package/dist/static/styles/components/narrow-panel.css.js +10 -0
  106. package/dist/static/styles/customEditorStyle.css.js +1 -1
  107. package/dist/stores/config.js +5 -5
  108. package/dist/stores/dynamic-content.js +2 -2
  109. package/dist/stores/editor.js +1 -1
  110. package/dist/stores/onboarding.js +27 -27
  111. package/dist/stores/preview.js +1 -1
  112. package/dist/stores/recommendation.js +3 -3
  113. package/dist/stores/save-as-template.js +2 -2
  114. package/dist/stores/toaster.js +1 -1
  115. package/dist/stores/unsubscribe.js +1 -1
  116. package/dist/stores/version-history.js +4 -4
  117. package/dist/utils/genericUtil.js +18 -8
  118. package/package.json +11 -4
@@ -1,6 +1,6 @@
1
1
  import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
2
- const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symbol.for("guido.save.complete"), s = (e) => {
3
- o(r, e.onBack), o(n, e.onSaveStart), o(a, e.onSaveComplete);
2
+ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), c = Symbol.for("guido.save.complete"), a = Symbol.for("guido.test.email.click"), i = (e) => {
3
+ o(r, e.onBack), o(n, e.onSaveStart), o(c, e.onSaveComplete), o(a, e.onTestEmailClick);
4
4
  }, u = () => {
5
5
  try {
6
6
  return t(r);
@@ -9,7 +9,7 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
9
9
  "useBack: No back handler provided. Make sure Guido component is in the component tree."
10
10
  );
11
11
  }
12
- }, d = () => {
12
+ }, l = () => {
13
13
  try {
14
14
  return t(n);
15
15
  } catch {
@@ -17,21 +17,31 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
17
17
  "useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
18
18
  );
19
19
  }
20
- }, i = () => {
20
+ }, d = () => {
21
21
  try {
22
- return t(a);
22
+ return t(c);
23
23
  } catch {
24
24
  throw new Error(
25
25
  "useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
26
26
  );
27
27
  }
28
+ }, m = () => {
29
+ try {
30
+ return t(a);
31
+ } catch {
32
+ throw new Error(
33
+ "useTestEmailClick: No test email click handler provided. Make sure Guido component is in the component tree."
34
+ );
35
+ }
28
36
  };
29
37
  export {
30
38
  r as BACK_KEY,
31
- a as SAVE_COMPLETE_KEY,
39
+ c as SAVE_COMPLETE_KEY,
32
40
  n as SAVE_START_KEY,
33
- s as provideGuidoActions,
41
+ a as TEST_EMAIL_CLICK_KEY,
42
+ i as provideGuidoActions,
34
43
  u as useBack,
35
- i as useSaveComplete,
36
- d as useSaveStart
44
+ d as useSaveComplete,
45
+ l as useSaveStart,
46
+ m as useTestEmailClick
37
47
  };
@@ -1,29 +1,26 @@
1
- import { useActionsApi as f } from "./useActionsApi.js";
2
- import { useCustomInterfaceAppearance as E } from "./useCustomInterfaceAppearance.js";
3
- import { useStripoEventHandler as S } from "./useStripoEventHandler.js";
4
- import { useToaster as C } from "./useToaster.js";
5
- import { displayConditions as y } from "../enums/displayConditions.js";
6
- import h from "../extensions/Blocks/Checkbox/extension.js";
7
- import w from "../extensions/Blocks/CouponBlock/extension.js";
8
- import b from "../extensions/Blocks/RadioButton/extension.js";
9
- import V from "../extensions/Blocks/Recommendation/extension.js";
10
- import _ from "../extensions/Blocks/Unsubscribe/extension.js";
11
- import k from "../extensions/DynamicContent/extension.js";
12
- import { useStripoApi as B } from "../services/stripoApi.js";
13
- import x from "../static/styles/customEditorStyle.css.js";
14
- import { useEditorStore as F } from "../stores/editor.js";
15
- import { dynamicContentToMergeTags as A } from "../utils/genericUtil.js";
16
- import T from "../package.json.js";
17
- const G = (a) => {
18
- const { handleError: d } = C(), { getToken: u, getCustomFonts: m } = B(), { handleEvent: p } = S(), l = (r, i = []) => {
19
- const t = F(), { html: n, css: c, forceRecreate: s } = r;
1
+ import { useActionsApi as h } from "./useActionsApi.js";
2
+ import { useBlocksConfig as b } from "./useBlocksConfig.js";
3
+ import { useConfig as k } from "./useConfig.js";
4
+ import { useCustomInterfaceAppearance as V } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as _ } from "./useStripoEventHandler.js";
6
+ import { useToaster as B } from "./useToaster.js";
7
+ import { displayConditions as A } from "../enums/displayConditions.js";
8
+ import { useStripoApi as F } from "../services/stripoApi.js";
9
+ import T from "../static/styles/customEditorStyle.css.js";
10
+ import { useEditorStore as v } from "../stores/editor.js";
11
+ import { dynamicContentToMergeTags as I } from "../utils/genericUtil.js";
12
+ import M from "../package.json.js";
13
+ const N = (d) => {
14
+ const { config: u } = k(), { handleError: l } = B(), { getToken: f, getCustomFonts: S } = F(), { handleEvent: C } = _(), { getStripoBlocksConfig: y } = b(), E = async (i, r = []) => {
15
+ var m, g;
16
+ const t = v(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: c } = await y();
20
17
  window.UIEditor.initEditor(
21
18
  document.querySelector("#guido-editor"),
22
19
  {
23
- metadata: a,
20
+ metadata: d,
24
21
  html: n,
25
- css: c,
26
- forceRecreate: s,
22
+ css: p,
23
+ forceRecreate: a,
27
24
  locale: "en",
28
25
  undoButtonSelector: "#guido__undo-button",
29
26
  redoButtonSelector: "#guido__redo-button",
@@ -33,39 +30,40 @@ const G = (a) => {
33
30
  customAppearanceMergetags: !0,
34
31
  customAppearanceMergetagsBorderColor: "#f1f3fe",
35
32
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
36
- customViewStyles: x,
37
- conditionsEnabled: !0,
38
- customConditionsEnabled: !0,
39
- conditionCategories: y,
33
+ customViewStyles: T,
34
+ conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
35
+ customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
36
+ conditionCategories: A,
40
37
  enableXSSSecurity: !0,
41
38
  messageSettingsEnabled: !1,
42
- selectBlockAfterDropFromSettingsPanel: !0,
39
+ selectElementAfterDrop: !0,
40
+ ...e ? { baseBlocks: e } : {},
43
41
  editorFonts: {
44
42
  showDefaultStandardFonts: !0,
45
43
  showDefaultNotStandardFonts: !0,
46
- customFonts: i
44
+ customFonts: r
47
45
  },
48
46
  mergeTags: [
49
47
  {
50
- entries: A(a.preselectedDynamicContentList)
48
+ entries: I(d.preselectedDynamicContentList)
51
49
  }
52
50
  ],
53
51
  async onTokenRefreshRequest(o) {
54
52
  try {
55
- const e = await u();
56
- o(e);
57
- } catch (e) {
58
- d(e, "Failed to refresh token");
53
+ const s = await f();
54
+ o(s);
55
+ } catch (s) {
56
+ l(s, "Failed to refresh token");
59
57
  }
60
58
  },
61
59
  onTemplateLoaded() {
62
60
  try {
63
- const { importCss: o } = E(), { activateCustomViewStyles: e } = f();
64
- o(), e(), a.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
61
+ const { importCss: o } = V(), { activateCustomViewStyles: s } = h();
62
+ o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
65
63
  t.hasChanges = !1;
66
64
  }, 1e3);
67
65
  } catch (o) {
68
- d(o, "Failed to load custom interface appearance");
66
+ l(o, "Failed to load custom interface appearance");
69
67
  }
70
68
  },
71
69
  onCodeEditorVisibilityChanged(o) {
@@ -80,42 +78,35 @@ const G = (a) => {
80
78
  onDataChanged() {
81
79
  t.hasChanges = !0;
82
80
  },
83
- onEvent: p,
81
+ onEvent: C,
84
82
  ignoreClickOutsideSelectors: [
85
83
  "#guido-dynamic-content-modal",
86
84
  ".in-on-board-wrapper",
87
85
  ".in-drawer__container"
88
86
  ],
89
- extensions: [
90
- k,
91
- h,
92
- b,
93
- V,
94
- _,
95
- w
96
- ]
87
+ extensions: c
97
88
  }
98
89
  );
99
- }, g = (r) => new Promise((i, t) => {
100
- var e;
90
+ }, w = (i) => new Promise((r, t) => {
91
+ var c;
101
92
  if (document.getElementById("UiEditorScript")) {
102
- r(), i();
93
+ i(), r();
103
94
  return;
104
95
  }
105
- const n = T.guido, s = `https://email-static.useinsider.com/guido/${(e = n == null ? void 0 : n.stripo) == null ? void 0 : e.version}/UIEditor.js`, o = document.createElement("script");
106
- o.id = "UiEditorScript", o.type = "module", o.src = s, o.onload = () => {
107
- r(), i();
108
- }, o.onerror = () => {
109
- t(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
110
- }, document.body.appendChild(o);
96
+ const n = M.guido, a = `https://email-static.useinsider.com/guido/${(c = n == null ? void 0 : n.stripo) == null ? void 0 : c.version}/UIEditor.js`, e = document.createElement("script");
97
+ e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
98
+ i(), r();
99
+ }, e.onerror = () => {
100
+ t(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
101
+ }, document.body.appendChild(e);
111
102
  });
112
- return { initPlugin: async (r) => {
113
- await g(async () => {
114
- const i = await m();
115
- l(r, i);
103
+ return { initPlugin: async (i) => {
104
+ await w(async () => {
105
+ const r = await S();
106
+ await E(i, r);
116
107
  });
117
108
  } };
118
109
  };
119
110
  export {
120
- G as useStripo
111
+ N as useStripo
121
112
  };
@@ -1,36 +1,41 @@
1
- import { usePartner as U } from "../../composables/usePartner.js";
2
- import { LINK_REGEXES as l, LINK_TYPES as b, URLS as f } from "../../enums/unsubscribe.js";
3
- import { parsePageList as B } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
- import { useConfigStore as N } from "../../stores/config.js";
5
- import { useUnsubscribeStore as I } from "../../stores/unsubscribe.js";
6
- const T = [
1
+ import { usePartner as N } from "../../composables/usePartner.js";
2
+ import { LINK_REGEXES as l, LINK_TYPES as g, INSIDER_ID as f, URLS as S } from "../../enums/unsubscribe.js";
3
+ import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
4
+ import { useConfigStore as B } from "../../stores/config.js";
5
+ import { useDynamicContentStore as y } from "../../stores/dynamic-content.js";
6
+ import { useUnsubscribeStore as L } from "../../stores/unsubscribe.js";
7
+ const D = [
7
8
  {
8
9
  id: "add-unsubscribe-link-values",
9
10
  description: "Adding unsubscribe link values",
10
11
  type: "custom",
11
12
  processor: (t) => {
12
- const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
13
- if (!u)
13
+ const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
14
+ if (!a)
14
15
  return t;
15
- let o = t;
16
- const e = `/${i()}/email/${u}?user={{iid}}`;
17
- return new DOMParser().parseFromString(o, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
18
- var g;
19
- const d = p.getAttribute("data-unsubscribe-page-list");
20
- if (!d)
16
+ let e = t;
17
+ const r = `/${i()}/email/${a}?user={{iid}}`;
18
+ return new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
19
+ var b;
20
+ const m = p.getAttribute("data-unsubscribe-page-list");
21
+ if (!m)
21
22
  return;
22
- const S = B(d), m = ((g = n.templates) == null ? void 0 : g.filter(
23
- (c) => S.includes(c.id)
24
- )) ?? [], R = m.some((c) => c.type === b.UNSUBSCRIBE_LINK_TYPE), _ = m.some((c) => c.type === b.PREFERENCES_LINK_TYPE), E = p.outerHTML;
23
+ const R = U(m), d = ((b = u.templates) == null ? void 0 : b.filter(
24
+ (o) => R.includes(o.id)
25
+ )) ?? [], _ = d.some((o) => o.type === g.UNSUBSCRIBE_LINK_TYPE), I = d.some((o) => o.type === g.PREFERENCES_LINK_TYPE), E = p.outerHTML;
25
26
  let s = E;
26
- R && (s = s.replace(
27
+ _ && (n.selectedDynamicContentList.push({
28
+ text: f,
29
+ value: f,
30
+ fallback: ""
31
+ }), s = s.replace(
27
32
  l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
28
- f.UNSUBSCRIBE_URL + e
29
- )), _ && (s = s.replace(
33
+ S.UNSUBSCRIBE_URL + r
34
+ )), I && (s = s.replace(
30
35
  l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
31
- f.PREFERENCES_URL + e
32
- )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), o = o.replace(E, s);
33
- }), o;
36
+ S.PREFERENCES_URL + r
37
+ )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(E, s);
38
+ }), e;
34
39
  },
35
40
  priority: 60
36
41
  },
@@ -56,16 +61,16 @@ const T = [
56
61
  type: "custom",
57
62
  processor: (t) => {
58
63
  let i = t;
59
- const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
60
- return a && a.forEach((n) => {
64
+ const c = i.match(/<a[^>]+>(.*?)<\/a>/gm);
65
+ return c && c.forEach((n) => {
61
66
  if (n.includes("insEmail=1"))
62
67
  return;
63
68
  if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
64
- const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
69
+ const a = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
65
70
  const r = e.slice(6, e.length - 1).trim();
66
71
  return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
67
72
  });
68
- i = i.replace(n, o);
73
+ i = i.replace(n, a);
69
74
  }
70
75
  }), i;
71
76
  },
@@ -73,5 +78,5 @@ const T = [
73
78
  }
74
79
  ];
75
80
  export {
76
- T as unsubscribeCompilerRules
81
+ D as unsubscribeCompilerRules
77
82
  };
@@ -1,4 +1,4 @@
1
- const a = {
1
+ const e = {
2
2
  translationsPath: "window.trans.en",
3
3
  migrationDate: 1759696858,
4
4
  emailHeader: {
@@ -8,18 +8,25 @@ const a = {
8
8
  extensions: {
9
9
  unsubscribe: !0
10
10
  },
11
+ blocks: {
12
+ excludeDefaults: [],
13
+ includeCustoms: []
14
+ },
11
15
  features: {
12
16
  dynamicContent: !0,
13
17
  saveAsTemplate: !0,
14
- versionHistory: !0
18
+ versionHistory: !0,
19
+ testMessage: !0,
20
+ displayConditions: !0
15
21
  },
16
22
  useHeader: !0
17
23
  }, t = {
18
24
  promotional: 1,
19
25
  transactional: 2
20
- }, e = "email", o = "Guido User", n = t.promotional, i = 2, s = {
26
+ }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
21
27
  email: 60,
22
- architect: 49
28
+ architect: 49,
29
+ unsubscribePages: 97
23
30
  }, u = [
24
31
  "alfredtesting",
25
32
  "electio",
@@ -53,12 +60,12 @@ const a = {
53
60
  "stripoeditorlivetest"
54
61
  ];
55
62
  export {
56
- a as DefaultGuidoConfig,
57
- n as DefaultMessageType,
58
- e as DefaultProductType,
63
+ e as DefaultGuidoConfig,
64
+ s as DefaultMessageType,
65
+ a as DefaultProductType,
59
66
  o as DefaultUsername,
60
- i as EditorType,
61
- s as ProductIds,
67
+ n as EditorType,
68
+ i as ProductIds,
62
69
  u as TEST_PARTNER_LIST,
63
70
  t as TemplateTypes
64
71
  };
@@ -12,8 +12,8 @@ const s = {
12
12
  { id: 61, key: "mostPopular", name: "Most Popular Items", path: "most-popular" },
13
13
  { id: 62, key: "mostPurchased", name: "Top Sellers", path: "top-sellers" }
14
14
  ], u = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], l = [
15
- { text: "after the amount", value: "1" },
16
- { text: "before the amount", value: "0" }
15
+ { text: "before the amount", value: "0" },
16
+ { text: "after the amount", value: "1" }
17
17
  ], c = [
18
18
  { text: "dot(.)", value: "." },
19
19
  { text: "comma(,)", value: "," }
@@ -10,16 +10,16 @@ const s = e(), R = {
10
10
  }, N = {
11
11
  UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
12
12
  PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
13
- }, _ = {
13
+ }, I = "iid", _ = {
14
14
  name: "Global Unsubscribe",
15
15
  sendGridId: "G"
16
- }, I = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
16
+ }, i = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
17
17
  GLOBAL_UNSUBSCRIBE: 1,
18
18
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
19
19
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
20
20
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
21
21
  RESUBSCRIBE: 5
22
- }, i = {
22
+ }, B = {
23
23
  [E.GLOBAL_UNSUBSCRIBE]: [
24
24
  E.GLOBAL_UNSUBSCRIBE,
25
25
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -29,26 +29,27 @@ const s = e(), R = {
29
29
  E.SUBSCRIPTION_PREFERENCE_CENTER,
30
30
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
31
31
  ]
32
- }, B = {
32
+ }, C = {
33
33
  [E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
34
34
  [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
35
35
  [E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
36
36
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
37
37
  [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
38
- }, C = {
38
+ }, c = {
39
39
  default: "{{ins-unsubscribe-link}}",
40
40
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
41
41
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
42
42
  };
43
43
  export {
44
- I as ACADEMY_LINK,
44
+ i as ACADEMY_LINK,
45
45
  _ as DEFAULT_UNSUBSCRIBE_GROUP,
46
+ I as INSIDER_ID,
46
47
  S as LINK_REGEXES,
47
48
  R as LINK_TYPES,
48
- C as MERGE_TAGS,
49
+ c as MERGE_TAGS,
49
50
  E as PAGE_TYPES,
50
- i as TYPE_COLLECTIONS,
51
- B as TYPE_TRANSLATIONS,
51
+ B as TYPE_COLLECTIONS,
52
+ C as TYPE_TRANSLATIONS,
52
53
  r as UNSUBSCRIBE_PAGES_LINK,
53
54
  N as URLS
54
55
  };
@@ -1,7 +1,7 @@
1
1
  import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { getDefaultTemplate as o } from "./template.js";
3
3
  const r = "checkbox-block";
4
- class p extends e {
4
+ class s extends e {
5
5
  constructor() {
6
6
  super();
7
7
  }
@@ -23,8 +23,11 @@ class p extends e {
23
23
  getTemplate() {
24
24
  return o();
25
25
  }
26
+ allowInnerBlocksDND() {
27
+ return !1;
28
+ }
26
29
  }
27
30
  export {
28
31
  r as CHECKBOX_BLOCK_ID,
29
- p as CheckboxBlock
32
+ s as CheckboxBlock
30
33
  };
@@ -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 k = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
6
+ const d = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
7
7
  export {
8
- k as default
8
+ d 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 m = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
5
+ const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
6
6
  export {
7
- m as default
7
+ p as default
8
8
  };
@@ -0,0 +1,66 @@
1
+ import { Block as b, BlockCompositionType as f, ModificationDescription as l } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { configAttributes as t } from "./enums/productEnums.js";
3
+ import { DefaultConfigValues as e, SETTINGS_ENUMS as u } from "./enums/settingsEnums.js";
4
+ import { useItemsBlockStore as d } from "./store/items-block.js";
5
+ import { getDefaultTemplate as D } from "./template.js";
6
+ const g = "items-block";
7
+ class B extends b {
8
+ getId() {
9
+ return g;
10
+ }
11
+ getIcon() {
12
+ return "items-icon";
13
+ }
14
+ getBlockCompositionType() {
15
+ return f.CONTAINER;
16
+ }
17
+ getName() {
18
+ return this.api.translate("Items");
19
+ }
20
+ getDescription() {
21
+ return this.api.translate("Items lets you display personalized products based on user behavior.");
22
+ }
23
+ getTemplate() {
24
+ const r = d();
25
+ return D({
26
+ orientation: u.ORIENTATION.HORIZONTAL,
27
+ itemsType: u.ITEMS_TYPE.CART_ITEMS,
28
+ itemId: "{{Abandoned Cart Item (1) Url}}",
29
+ currencySymbol: r.currencySymbol,
30
+ currencyLocation: r.currencyLocation,
31
+ formattedPrice: r.formattedPrice
32
+ });
33
+ }
34
+ allowInnerBlocksDND() {
35
+ return !1;
36
+ }
37
+ onCreated(r) {
38
+ const n = r.querySelector("esd-config-block");
39
+ if (!n)
40
+ return;
41
+ 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));
42
+ if (Number(c)) {
43
+ if (!a) {
44
+ const i = s();
45
+ this.api.getDocumentModifier().modifyHtml(o).setAttribute(t.BLOCK_INSTANCE_ID, i).apply(new l("Assign block instance ID to legacy block"));
46
+ }
47
+ } else {
48
+ const i = e.itemsType, m = e.cartItemsSelectControlValue, I = e.cardOrientationControlValue, C = e.productNameTrimmingControlValue, T = e.productPriceHideDiscountControlValue, E = e.productPriceFormattedControlValue, A = e.productPriceCurrencySymbolControlValue, N = e.productPriceCurrencyLocationControlValue, p = e.productButtonLinkControlValue, O = e.productImageLinkControlValue, _ = s();
49
+ 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, A).setAttribute(t.PRODUCT_PRICE_CURRENCY_LOCATION, N).setAttribute(t.PRODUCT_BUTTON_LINK, p).setAttribute(t.PRODUCT_IMAGE_LINK, O).setAttribute(t.BLOCK_INSTANCE_ID, _).setAttribute("data-initialized", "1").setAttribute(t.NAME_CONTROL_ENABLED, e.productNameControlEnabled).setAttribute(
50
+ t.QUANTITY_CONTROL_ENABLED,
51
+ e.productQuantityControlEnabled
52
+ ).setAttribute(t.PRICE_CONTROL_OPENED, e.productPriceControlOpened).apply(new l("Initialize config block attributes with defaults"));
53
+ }
54
+ }
55
+ onSelect(r) {
56
+ const n = r.querySelector("esd-config-block"), o = d();
57
+ if (!n)
58
+ return;
59
+ 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;
60
+ o.setItemsType(a), o.setItemIds(s), o.setOrientation(i);
61
+ }
62
+ }
63
+ export {
64
+ g as BLOCK_ID,
65
+ B as ItemsBlock
66
+ };
@@ -0,0 +1,68 @@
1
+ var r = Object.defineProperty;
2
+ var a = (o, e, t) => e in o ? r(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var s = (o, e, t) => a(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommonControl as u } from "../../../common-control.js";
5
+ import { ItemsBlockControlId as d } from "../../enums/controlEnums.js";
6
+ import { useItemsBlockStore as l } from "../../store/items-block.js";
7
+ import { syncButtonLinkFromAttributes as h } from "../../utils/syncAttributesFromConfigBlock.js";
8
+ import { updateConfigBlockAttributes as m } from "../../utils/updateAttributes.js";
9
+ const i = d.BUTTON_LINK, n = {
10
+ LINK: "link"
11
+ };
12
+ class C extends u {
13
+ constructor() {
14
+ super(...arguments);
15
+ s(this, "store", l());
16
+ }
17
+ getId() {
18
+ return i;
19
+ }
20
+ getTemplate() {
21
+ return `
22
+ <div class="${i}">
23
+ ${this._getLink()}
24
+ </div>
25
+ `;
26
+ }
27
+ onRender() {
28
+ this.api.updateValues({
29
+ [n.LINK]: this.store.buttonLink
30
+ }), this._listenToFormUpdates();
31
+ }
32
+ onTemplateNodeUpdated(t) {
33
+ super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
34
+ () => h(this.currentNode),
35
+ () => {
36
+ this.api.updateValues({
37
+ [n.LINK]: this.store.buttonLink
38
+ });
39
+ }
40
+ );
41
+ }
42
+ _listenToFormUpdates() {
43
+ this.api.onValueChanged(
44
+ n.LINK,
45
+ (t) => this._onLinkChange(t)
46
+ );
47
+ }
48
+ _onLinkChange(t) {
49
+ console.debug("Button link changed to: ", t), this.store.setButtonLink(t), m(this.currentNode, this.api);
50
+ }
51
+ _getLink() {
52
+ return `
53
+ ${this._GuOneColumn([
54
+ this._GuLabel({ text: "Link" }),
55
+ this._GuTextInput({
56
+ name: n.LINK,
57
+ placeholder: "Enter Link",
58
+ className: "es-100",
59
+ disabled: !0
60
+ })
61
+ ])}
62
+ `;
63
+ }
64
+ }
65
+ export {
66
+ C as ButtonLinkControl,
67
+ i as CONTROL_BLOCK_ID
68
+ };