@useinsider/guido 1.0.3-beta.46b1cdf → 1.0.3-beta.47364b3

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 (57) hide show
  1. package/README.md +140 -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 +49 -0
  9. package/dist/composables/useGuidoActions.js +19 -9
  10. package/dist/composables/useStripo.js +49 -58
  11. package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
  12. package/dist/enums/defaults.js +16 -9
  13. package/dist/enums/unsubscribe.js +27 -25
  14. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  15. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  16. package/dist/extensions/Blocks/Recommendation/extension.js +4 -4
  17. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  18. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +4 -4
  19. package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
  20. package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
  21. package/dist/guido.css +1 -1
  22. package/dist/package.json.js +1 -1
  23. package/dist/services/stripoApi.js +1 -1
  24. package/dist/src/@types/generic.d.ts +36 -6
  25. package/dist/src/components/Guido.vue.d.ts +3 -2
  26. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  27. package/dist/src/composables/useBlocksConfig.d.ts +11 -0
  28. package/dist/src/composables/useGuidoActions.d.ts +9 -0
  29. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  30. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
  31. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
  32. package/dist/src/stores/config.d.ts +9 -2
  33. package/dist/src/stores/dynamic-content.d.ts +3 -3
  34. package/dist/src/stores/editor.d.ts +1 -1
  35. package/dist/src/stores/onboarding.d.ts +1 -1
  36. package/dist/src/stores/preview.d.ts +1 -1
  37. package/dist/src/stores/recommendation.d.ts +1 -1
  38. package/dist/src/stores/save-as-template.d.ts +1 -1
  39. package/dist/src/stores/toaster.d.ts +1 -1
  40. package/dist/src/stores/unsubscribe.d.ts +1 -1
  41. package/dist/src/stores/version-history.d.ts +1 -1
  42. package/dist/src/utils/environmentUtil.d.ts +5 -0
  43. package/dist/src/utils/genericUtil.d.ts +1 -0
  44. package/dist/static/styles/components/narrow-panel.css.js +10 -0
  45. package/dist/stores/config.js +5 -5
  46. package/dist/stores/dynamic-content.js +2 -2
  47. package/dist/stores/editor.js +1 -1
  48. package/dist/stores/onboarding.js +27 -27
  49. package/dist/stores/preview.js +1 -1
  50. package/dist/stores/recommendation.js +3 -3
  51. package/dist/stores/save-as-template.js +2 -2
  52. package/dist/stores/toaster.js +1 -1
  53. package/dist/stores/unsubscribe.js +1 -1
  54. package/dist/stores/version-history.js +4 -4
  55. package/dist/utils/environmentUtil.js +4 -0
  56. package/dist/utils/genericUtil.js +20 -9
  57. package/package.json +2 -2
@@ -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 B } from "./useCustomInterfaceAppearance.js";
5
+ import { useStripoEventHandler as V } from "./useStripoEventHandler.js";
6
+ import { useToaster as _ } from "./useToaster.js";
7
+ import { displayConditions as F } from "../enums/displayConditions.js";
8
+ import { useStripoApi as A } from "../services/stripoApi.js";
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 } = _(), { getToken: f, getCustomFonts: S } = A(), { handleEvent: C } = V(), { 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: F,
40
37
  enableXSSSecurity: !0,
41
38
  messageSettingsEnabled: !1,
42
39
  selectBlockAfterDropFromSettingsPanel: !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 } = B(), { 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
  };
@@ -1,25 +1,26 @@
1
- import { useTranslations as e } from "../composables/useTranslations.js";
2
- const s = e(), R = {
1
+ import { useTranslations as n } from "../composables/useTranslations.js";
2
+ import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
3
+ const e = n(), I = {
3
4
  UNSUBSCRIBE_LINK_TYPE: 1,
4
5
  PREFERENCES_LINK_TYPE: 3
5
- }, S = {
6
+ }, r = {
6
7
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
7
8
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
8
9
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
9
10
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
10
- }, N = {
11
- UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
12
- PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
13
- }, _ = {
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 = {
14
15
  name: "Global Unsubscribe",
15
16
  sendGridId: "G"
16
- }, I = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
17
+ }, C = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", c = "/email/unsubscribe-pages", E = {
17
18
  GLOBAL_UNSUBSCRIBE: 1,
18
19
  GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
19
20
  SUBSCRIPTION_PREFERENCE_CENTER: 3,
20
21
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
21
22
  RESUBSCRIBE: 5
22
- }, i = {
23
+ }, t = {
23
24
  [E.GLOBAL_UNSUBSCRIBE]: [
24
25
  E.GLOBAL_UNSUBSCRIBE,
25
26
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -29,26 +30,27 @@ const s = e(), R = {
29
30
  E.SUBSCRIPTION_PREFERENCE_CENTER,
30
31
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
31
32
  ]
32
- }, B = {
33
- [E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
34
- [E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
35
- [E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
36
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
37
- [E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
38
- }, C = {
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 = {
39
40
  default: "{{ins-unsubscribe-link}}",
40
41
  [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
41
42
  [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
42
43
  };
43
44
  export {
44
- I as ACADEMY_LINK,
45
- _ as DEFAULT_UNSUBSCRIBE_GROUP,
46
- S as LINK_REGEXES,
47
- R as LINK_TYPES,
48
- C as MERGE_TAGS,
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,
49
51
  E as PAGE_TYPES,
50
- i as TYPE_COLLECTIONS,
51
- B as TYPE_TRANSLATIONS,
52
- r as UNSUBSCRIBE_PAGES_LINK,
53
- N as URLS
52
+ t as TYPE_COLLECTIONS,
53
+ U as TYPE_TRANSLATIONS,
54
+ c as UNSUBSCRIBE_PAGES_LINK,
55
+ _ as URLS
54
56
  };
@@ -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
  };
@@ -31,15 +31,15 @@ import { OldPriceSizeControl as I } from "./controls/oldPrice/size.js";
31
31
  import { OldPriceStyleControl as T } from "./controls/oldPrice/style.js";
32
32
  import { PriceAlignControl as w } from "./controls/price/align.js";
33
33
  import { PriceBackgroundControl as h } from "./controls/price/background.js";
34
- import { PriceColorControl as E } from "./controls/price/color.js";
35
- import { PriceFontFamilyControl as M } from "./controls/price/fontFamily.js";
36
- import { PricePaddingsControl as b } from "./controls/price/paddings.js";
34
+ import { PriceColorControl as M } from "./controls/price/color.js";
35
+ import { PriceFontFamilyControl as b } from "./controls/price/fontFamily.js";
36
+ import { PricePaddingsControl as E } from "./controls/price/paddings.js";
37
37
  import { PriceSizeControl as j } from "./controls/price/size.js";
38
38
  import { PriceStyleControl as q } from "./controls/price/style.js";
39
39
  import { RecommendationIconsRegistry as v } from "./iconsRegistry.js";
40
40
  import D from "./recommendation.css.js";
41
41
  import { SettingsPanel as G } from "./settingsPanel.js";
42
- const Io = new o().addBlock(r).withSettingsPanelRegistry(G).addControl(n).addControl(d).addControl(l).addControl(m).addControl(i).addControl(C).addControl(a).addControl(e).addControl(p).addControl(f).addControl(c).addControl(s).addControl(g).addControl(B).addControl(P).addControl(u).addControl(y).addControl(S).addControl(F).addControl(R).addControl(N).addControl(O).addControl(k).addControl(x).addControl(z).addControl(A).addControl(I).addControl(T).addControl(w).addControl(h).addControl(E).addControl(M).addControl(b).addControl(j).addControl(q).addControl(t).addStyles(D).withIconsRegistry(v).build();
42
+ const Io = new o().addBlock(r).withSettingsPanelRegistry(G).addControl(n).addControl(d).addControl(l).addControl(m).addControl(i).addControl(C).addControl(a).addControl(e).addControl(p).addControl(f).addControl(c).addControl(s).addControl(g).addControl(B).addControl(P).addControl(u).addControl(y).addControl(S).addControl(F).addControl(R).addControl(N).addControl(O).addControl(k).addControl(x).addControl(z).addControl(A).addControl(I).addControl(T).addControl(w).addControl(h).addControl(M).addControl(b).addControl(E).addControl(j).addControl(q).addControl(t).addStyles(D).withIconsRegistry(v).build();
43
43
  export {
44
44
  Io as default
45
45
  };
@@ -133,7 +133,7 @@ const a = c(), d = () => ({
133
133
  filterSelectionDrawerStatus: !1,
134
134
  filterList: {},
135
135
  filterGroup: 1
136
- }), G = p("recommendationExtension", {
136
+ }), G = p("guidoRecommendationExtension", {
137
137
  state: () => d(),
138
138
  getters: {
139
139
  hasFilters: (e) => !!e.recommendationConfigs.filters.length,
@@ -1,6 +1,6 @@
1
1
  import { BlockType as t, BlockAttr as n } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
2
  import { RecommendationBlockId as o } from "../constants.js";
3
- import { spacer as l, generateTemplate as s, prepareProductRows as d, DEFAULTS as p, getDefaultProducts as i } from "./templateUtils.js";
3
+ import { generateTemplate as l, prepareProductRows as s, spacer as d, DEFAULTS as p, getDefaultProducts as i } from "./templateUtils.js";
4
4
  import { DEFAULT_CARD_COMPOSITION as $ } from "./templateUtils.js";
5
5
  const g = `
6
6
  <td align="left" class="ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block es-p20">
@@ -33,7 +33,7 @@ const g = `
33
33
  </table>
34
34
  </td>
35
35
  </tr>
36
- ${l}
36
+ ${d}
37
37
  <tr>
38
38
  <td>
39
39
  <table
@@ -134,7 +134,7 @@ const g = `
134
134
  };
135
135
  function x() {
136
136
  const e = i();
137
- return s(
137
+ return l(
138
138
  g,
139
139
  e,
140
140
  3,
@@ -143,7 +143,7 @@ function x() {
143
143
  );
144
144
  }
145
145
  function f(e, r, c) {
146
- return d(
146
+ return s(
147
147
  e,
148
148
  r,
149
149
  a,
@@ -1,27 +1,33 @@
1
- var i = Object.defineProperty;
2
- var d = (t, e, n) => e in t ? i(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var a = (t, e, n) => d(t, typeof e != "symbol" ? e + "" : e, n);
4
- class y {
1
+ var d = Object.defineProperty;
2
+ var m = (t, e, n) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var c = (t, e, n) => m(t, typeof e != "symbol" ? e + "" : e, n);
4
+ class C {
5
5
  constructor() {
6
- a(this, "selectedDynamicContent", null);
7
- a(this, "dataSelectCallback", () => {
6
+ c(this, "selectedDynamicContent", null);
7
+ c(this, "dataSelectCallback", () => {
8
8
  });
9
+ c(this, "closeDynamicContentHandler", null);
9
10
  }
10
- openMergeTagsLibrary(e, n) {
11
- this.dataSelectCallback = n, this.selectedDynamicContent = e;
12
- const s = new CustomEvent("dynamic-content:open", {
13
- detail: {
14
- attribute: e
15
- }
11
+ /**
12
+ * Opens the merge tags library modal
13
+ * @param dynamicContent - Currently selected dynamic content (if any)
14
+ * @param onDataSelectCallback - Callback invoked when user selects a merge tag
15
+ * @param position - Optional position data to place the modal
16
+ */
17
+ openMergeTagsLibrary(e, n, l) {
18
+ this.closeDynamicContentHandler && (document.removeEventListener("dynamic-content:close", this.closeDynamicContentHandler), this.closeDynamicContentHandler = null), this.dataSelectCallback = n, this.selectedDynamicContent = e;
19
+ const o = {
20
+ attribute: e,
21
+ position: l
22
+ }, s = new CustomEvent("dynamic-content:open", {
23
+ detail: o
16
24
  });
17
- document.dispatchEvent(s);
18
- const o = (l) => {
19
- const c = l.detail;
20
- this.selectedDynamicContent = c, c.text && c.value && this.dataSelectCallback(c), document.removeEventListener("dynamic-content:close", o);
21
- };
22
- document.addEventListener("dynamic-content:close", o);
25
+ document.dispatchEvent(s), this.closeDynamicContentHandler = (i) => {
26
+ const a = i.detail;
27
+ this.selectedDynamicContent = a, a.text && a.value && this.dataSelectCallback(a);
28
+ }, document.addEventListener("dynamic-content:close", this.closeDynamicContentHandler);
23
29
  }
24
30
  }
25
31
  export {
26
- y as ExternalMergeTagsLibrary
32
+ C as ExternalMergeTagsLibrary
27
33
  };