@useinsider/guido 1.0.3-beta.8b084ad → 1.0.3-beta.8ba8dbc

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 (53) hide show
  1. package/README.md +3 -140
  2. package/dist/components/Guido.vue.js +1 -1
  3. package/dist/components/Guido.vue2.js +73 -79
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -16
  6. package/dist/components/organisms/header/RightSlot.vue.js +11 -11
  7. package/dist/components/organisms/header/RightSlot.vue2.js +22 -23
  8. package/dist/composables/useGuidoActions.js +9 -19
  9. package/dist/composables/useStripo.js +58 -49
  10. package/dist/config/compiler/unsubscribeCompilerRules.js +28 -33
  11. package/dist/enums/defaults.js +9 -16
  12. package/dist/enums/unsubscribe.js +9 -10
  13. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  14. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  15. package/dist/extensions/Blocks/Recommendation/extension.js +4 -4
  16. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  17. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +4 -4
  18. package/dist/extensions/DynamicContent/dynamic-content-modal.js +19 -25
  19. package/dist/extensions/DynamicContent/dynamic-content.js +33 -128
  20. package/dist/guido.css +1 -1
  21. package/dist/package.json.js +1 -1
  22. package/dist/src/@types/generic.d.ts +6 -36
  23. package/dist/src/components/Guido.vue.d.ts +2 -3
  24. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  25. package/dist/src/composables/useGuidoActions.d.ts +0 -9
  26. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  27. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +2 -9
  28. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +2 -52
  29. package/dist/src/stores/config.d.ts +2 -9
  30. package/dist/src/stores/dynamic-content.d.ts +3 -3
  31. package/dist/src/stores/editor.d.ts +1 -1
  32. package/dist/src/stores/onboarding.d.ts +1 -1
  33. package/dist/src/stores/preview.d.ts +1 -1
  34. package/dist/src/stores/recommendation.d.ts +1 -1
  35. package/dist/src/stores/save-as-template.d.ts +1 -1
  36. package/dist/src/stores/toaster.d.ts +1 -1
  37. package/dist/src/stores/unsubscribe.d.ts +1 -1
  38. package/dist/src/stores/version-history.d.ts +1 -1
  39. package/dist/src/utils/genericUtil.d.ts +0 -1
  40. package/dist/stores/config.js +5 -5
  41. package/dist/stores/dynamic-content.js +2 -2
  42. package/dist/stores/editor.js +1 -1
  43. package/dist/stores/onboarding.js +27 -27
  44. package/dist/stores/preview.js +1 -1
  45. package/dist/stores/recommendation.js +3 -3
  46. package/dist/stores/save-as-template.js +2 -2
  47. package/dist/stores/toaster.js +1 -1
  48. package/dist/stores/unsubscribe.js +1 -1
  49. package/dist/stores/version-history.js +4 -4
  50. package/dist/utils/genericUtil.js +9 -20
  51. package/package.json +2 -2
  52. package/dist/composables/useBlocksConfig.js +0 -49
  53. package/dist/src/composables/useBlocksConfig.d.ts +0 -11
@@ -1,26 +1,29 @@
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();
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;
17
20
  window.UIEditor.initEditor(
18
21
  document.querySelector("#guido-editor"),
19
22
  {
20
- metadata: d,
23
+ metadata: a,
21
24
  html: n,
22
- css: p,
23
- forceRecreate: a,
25
+ css: c,
26
+ forceRecreate: s,
24
27
  locale: "en",
25
28
  undoButtonSelector: "#guido__undo-button",
26
29
  redoButtonSelector: "#guido__redo-button",
@@ -30,40 +33,39 @@ const N = (d) => {
30
33
  customAppearanceMergetags: !0,
31
34
  customAppearanceMergetagsBorderColor: "#f1f3fe",
32
35
  customAppearanceMergetagsBackgroundColor: "#f1f3fe",
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,
36
+ customViewStyles: x,
37
+ conditionsEnabled: !0,
38
+ customConditionsEnabled: !0,
39
+ conditionCategories: y,
37
40
  enableXSSSecurity: !0,
38
41
  messageSettingsEnabled: !1,
39
42
  selectBlockAfterDropFromSettingsPanel: !0,
40
- ...e ? { baseBlocks: e } : {},
41
43
  editorFonts: {
42
44
  showDefaultStandardFonts: !0,
43
45
  showDefaultNotStandardFonts: !0,
44
- customFonts: r
46
+ customFonts: i
45
47
  },
46
48
  mergeTags: [
47
49
  {
48
- entries: I(d.preselectedDynamicContentList)
50
+ entries: A(a.preselectedDynamicContentList)
49
51
  }
50
52
  ],
51
53
  async onTokenRefreshRequest(o) {
52
54
  try {
53
- const s = await f();
54
- o(s);
55
- } catch (s) {
56
- l(s, "Failed to refresh token");
55
+ const e = await u();
56
+ o(e);
57
+ } catch (e) {
58
+ d(e, "Failed to refresh token");
57
59
  }
58
60
  },
59
61
  onTemplateLoaded() {
60
62
  try {
61
- const { importCss: o } = B(), { activateCustomViewStyles: s } = h();
62
- o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
63
+ const { importCss: o } = E(), { activateCustomViewStyles: e } = f();
64
+ o(), e(), a.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
63
65
  t.hasChanges = !1;
64
66
  }, 1e3);
65
67
  } catch (o) {
66
- l(o, "Failed to load custom interface appearance");
68
+ d(o, "Failed to load custom interface appearance");
67
69
  }
68
70
  },
69
71
  onCodeEditorVisibilityChanged(o) {
@@ -78,35 +80,42 @@ const N = (d) => {
78
80
  onDataChanged() {
79
81
  t.hasChanges = !0;
80
82
  },
81
- onEvent: C,
83
+ onEvent: p,
82
84
  ignoreClickOutsideSelectors: [
83
85
  "#guido-dynamic-content-modal",
84
86
  ".in-on-board-wrapper",
85
87
  ".in-drawer__container"
86
88
  ],
87
- extensions: c
89
+ extensions: [
90
+ k,
91
+ h,
92
+ b,
93
+ V,
94
+ _,
95
+ w
96
+ ]
88
97
  }
89
98
  );
90
- }, w = (i) => new Promise((r, t) => {
91
- var c;
99
+ }, g = (r) => new Promise((i, t) => {
100
+ var e;
92
101
  if (document.getElementById("UiEditorScript")) {
93
- i(), r();
102
+ r(), i();
94
103
  return;
95
104
  }
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);
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);
102
111
  });
103
- return { initPlugin: async (i) => {
104
- await w(async () => {
105
- const r = await S();
106
- await E(i, r);
112
+ return { initPlugin: async (r) => {
113
+ await g(async () => {
114
+ const i = await m();
115
+ l(r, i);
107
116
  });
108
117
  } };
109
118
  };
110
119
  export {
111
- N as useStripo
120
+ G as useStripo
112
121
  };
@@ -1,41 +1,36 @@
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 = [
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 = [
8
7
  {
9
8
  id: "add-unsubscribe-link-values",
10
9
  description: "Adding unsubscribe link values",
11
10
  type: "custom",
12
11
  processor: (t) => {
13
- const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
14
- if (!a)
12
+ const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
13
+ if (!u)
15
14
  return t;
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)
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)
22
21
  return;
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;
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;
26
25
  let s = E;
27
- _ && (n.selectedDynamicContentList.push({
28
- text: f,
29
- value: f,
30
- fallback: ""
31
- }), s = s.replace(
26
+ R && (s = s.replace(
32
27
  l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
33
- S.UNSUBSCRIBE_URL + r
34
- )), I && (s = s.replace(
28
+ f.UNSUBSCRIBE_URL + e
29
+ )), _ && (s = s.replace(
35
30
  l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
36
- S.PREFERENCES_URL + r
37
- )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(E, s);
38
- }), e;
31
+ f.PREFERENCES_URL + e
32
+ )), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), o = o.replace(E, s);
33
+ }), o;
39
34
  },
40
35
  priority: 60
41
36
  },
@@ -61,16 +56,16 @@ const D = [
61
56
  type: "custom",
62
57
  processor: (t) => {
63
58
  let i = t;
64
- const c = i.match(/<a[^>]+>(.*?)<\/a>/gm);
65
- return c && c.forEach((n) => {
59
+ const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
60
+ return a && a.forEach((n) => {
66
61
  if (n.includes("insEmail=1"))
67
62
  return;
68
63
  if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
69
- const a = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
64
+ const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
70
65
  const r = e.slice(6, e.length - 1).trim();
71
66
  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`);
72
67
  });
73
- i = i.replace(n, a);
68
+ i = i.replace(n, o);
74
69
  }
75
70
  }), i;
76
71
  },
@@ -78,5 +73,5 @@ const D = [
78
73
  }
79
74
  ];
80
75
  export {
81
- D as unsubscribeCompilerRules
76
+ T as unsubscribeCompilerRules
82
77
  };
@@ -1,4 +1,4 @@
1
- const e = {
1
+ const a = {
2
2
  translationsPath: "window.trans.en",
3
3
  migrationDate: 1759696858,
4
4
  emailHeader: {
@@ -8,25 +8,18 @@ const e = {
8
8
  extensions: {
9
9
  unsubscribe: !0
10
10
  },
11
- blocks: {
12
- excludeDefaults: [],
13
- includeCustoms: []
14
- },
15
11
  features: {
16
12
  dynamicContent: !0,
17
13
  saveAsTemplate: !0,
18
- versionHistory: !0,
19
- testMessage: !0,
20
- displayConditions: !0
14
+ versionHistory: !0
21
15
  },
22
16
  useHeader: !0
23
17
  }, t = {
24
18
  promotional: 1,
25
19
  transactional: 2
26
- }, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
20
+ }, e = "email", o = "Guido User", n = t.promotional, i = 2, s = {
27
21
  email: 60,
28
- architect: 49,
29
- unsubscribePages: 97
22
+ architect: 49
30
23
  }, u = [
31
24
  "alfredtesting",
32
25
  "electio",
@@ -60,12 +53,12 @@ const e = {
60
53
  "stripoeditorlivetest"
61
54
  ];
62
55
  export {
63
- e as DefaultGuidoConfig,
64
- s as DefaultMessageType,
65
- a as DefaultProductType,
56
+ a as DefaultGuidoConfig,
57
+ n as DefaultMessageType,
58
+ e as DefaultProductType,
66
59
  o as DefaultUsername,
67
- n as EditorType,
68
- i as ProductIds,
60
+ i as EditorType,
61
+ s as ProductIds,
69
62
  u as TEST_PARTNER_LIST,
70
63
  t as TemplateTypes
71
64
  };
@@ -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
- }, I = "iid", _ = {
13
+ }, _ = {
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
- }, B = {
22
+ }, i = {
23
23
  [E.GLOBAL_UNSUBSCRIBE]: [
24
24
  E.GLOBAL_UNSUBSCRIBE,
25
25
  E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
@@ -29,27 +29,26 @@ const s = e(), R = {
29
29
  E.SUBSCRIPTION_PREFERENCE_CENTER,
30
30
  E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
31
31
  ]
32
- }, C = {
32
+ }, B = {
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,
47
46
  S as LINK_REGEXES,
48
47
  R as LINK_TYPES,
49
- c as MERGE_TAGS,
48
+ C as MERGE_TAGS,
50
49
  E as PAGE_TYPES,
51
- B as TYPE_COLLECTIONS,
52
- C as TYPE_TRANSLATIONS,
50
+ i as TYPE_COLLECTIONS,
51
+ B as TYPE_TRANSLATIONS,
53
52
  r as UNSUBSCRIBE_PAGES_LINK,
54
53
  N as URLS
55
54
  };
@@ -3,7 +3,7 @@ import { CheckboxBlock as t } from "./block.js";
3
3
  import { CheckboxControl as e } from "./control.js";
4
4
  import { CheckboxIconsRegistry as r } from "./iconsRegistry.js";
5
5
  import { CheckboxBlockSettings as i } from "./settingsPanel.js";
6
- const d = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
6
+ const k = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
7
7
  export {
8
- d as default
8
+ k as default
9
9
  };
@@ -2,7 +2,7 @@ import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-edito
2
2
  import { CouponBlock as t } from "./block.js";
3
3
  import { CouponIconsRegistry as i } from "./iconsRegistry.js";
4
4
  import { CouponBlockSettings as n } from "./settingsPanel.js";
5
- const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
5
+ const m = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
6
6
  export {
7
- p as default
7
+ m as default
8
8
  };
@@ -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 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";
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";
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(M).addControl(b).addControl(E).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(E).addControl(M).addControl(b).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("guidoRecommendationExtension", {
136
+ }), G = p("recommendationExtension", {
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 { generateTemplate as l, prepareProductRows as s, spacer as d, DEFAULTS as p, getDefaultProducts as i } from "./templateUtils.js";
3
+ import { spacer as l, generateTemplate as s, prepareProductRows 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
- ${d}
36
+ ${l}
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 l(
137
+ return s(
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 s(
146
+ return d(
147
147
  e,
148
148
  r,
149
149
  a,
@@ -1,33 +1,27 @@
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 {
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 {
5
5
  constructor() {
6
- c(this, "selectedDynamicContent", null);
7
- c(this, "dataSelectCallback", () => {
6
+ a(this, "selectedDynamicContent", null);
7
+ a(this, "dataSelectCallback", () => {
8
8
  });
9
- c(this, "closeDynamicContentHandler", null);
10
9
  }
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
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
+ }
24
16
  });
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);
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);
29
23
  }
30
24
  }
31
25
  export {
32
- C as ExternalMergeTagsLibrary
26
+ y as ExternalMergeTagsLibrary
33
27
  };