@useinsider/guido 1.0.3-beta.367d151 → 1.0.3-beta.3757462

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 (111) hide show
  1. package/dist/@types/generic.d.ts +0 -14
  2. package/dist/components/Guido.vue.d.ts +2 -3
  3. package/dist/components/Guido.vue.js +9 -11
  4. package/dist/components/Guido.vue2.js +69 -75
  5. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  6. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  7. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  8. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  9. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  11. package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
  12. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  13. package/dist/composables/useStripo.js +18 -26
  14. package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
  15. package/dist/config/migrator/index.d.ts +1 -1
  16. package/dist/config/migrator/index.js +6 -7
  17. package/dist/enums/defaults.js +0 -4
  18. package/dist/enums/unsubscribe.d.ts +0 -23
  19. package/dist/enums/unsubscribe.js +6 -43
  20. package/dist/extensions/Blocks/Checkbox/control.js +54 -53
  21. package/dist/extensions/Blocks/RadioButton/control.js +45 -44
  22. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  23. package/dist/guido.css +1 -1
  24. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +71 -83
  25. package/dist/stores/editor.d.ts +0 -21
  26. package/dist/stores/editor.js +1 -2
  27. package/dist/stores/unsubscribe.d.ts +5 -253
  28. package/dist/stores/unsubscribe.js +6 -126
  29. package/dist/utils/dateUtil.d.ts +0 -4
  30. package/dist/utils/dateUtil.js +12 -8
  31. package/dist/utils/genericUtil.d.ts +0 -1
  32. package/dist/utils/genericUtil.js +7 -8
  33. package/dist/utils/templatePreparation.js +16 -17
  34. package/package.json +2 -2
  35. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
  36. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
  37. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
  38. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +0 -2
  39. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
  40. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
  41. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +0 -2
  42. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
  43. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
  44. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
  45. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
  46. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
  47. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  48. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  49. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  50. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  51. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  52. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  53. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  54. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  55. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
  56. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  57. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  58. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  59. package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
  60. package/dist/config/migrator/unsubscribeMigrator.js +0 -124
  61. package/dist/enums/date.d.ts +0 -13
  62. package/dist/enums/date.js +0 -16
  63. package/dist/enums/extensions/recommendationBlock.d.ts +0 -16
  64. package/dist/enums/extensions/recommendationBlock.js +0 -80
  65. package/dist/extensions/Blocks/Recommendation/block.d.ts +0 -10
  66. package/dist/extensions/Blocks/Recommendation/block.js +0 -27
  67. package/dist/extensions/Blocks/Recommendation/control.d.ts +0 -29
  68. package/dist/extensions/Blocks/Recommendation/control.js +0 -277
  69. package/dist/extensions/Blocks/Recommendation/extension.d.ts +0 -2
  70. package/dist/extensions/Blocks/Recommendation/extension.js +0 -10
  71. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
  72. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
  73. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
  74. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +0 -4
  75. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -32
  76. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
  77. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
  78. package/dist/extensions/Blocks/Recommendation/template.d.ts +0 -6
  79. package/dist/extensions/Blocks/Recommendation/template.js +0 -200
  80. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
  81. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
  82. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
  83. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  84. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  85. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  86. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  87. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  88. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
  89. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
  90. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
  91. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
  92. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
  93. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
  94. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  95. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  96. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  97. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  98. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  99. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  100. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  101. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  102. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  103. package/dist/extensions/Blocks/common-control.d.ts +0 -66
  104. package/dist/extensions/Blocks/common-control.js +0 -102
  105. package/dist/mock/api/recommendation.d.ts +0 -2
  106. package/dist/services/recommendationApi.d.ts +0 -6
  107. package/dist/services/recommendationApi.js +0 -43
  108. package/dist/services/unsubscribeApi.d.ts +0 -4
  109. package/dist/services/unsubscribeApi.js +0 -16
  110. package/dist/stores/config.d.ts +0 -97
  111. package/dist/stores/config.js +0 -17
@@ -1,36 +1,23 @@
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 m } from "../../composables/usePartner.js";
2
+ import { LINK_REGEXES as c, LINK_TYPES as p, URLS as E } from "../../enums/unsubscribe.js";
3
+ import { useUnsubscribeStore as b } from "../../stores/unsubscribe.js";
4
+ const S = [
7
5
  {
8
6
  id: "add-unsubscribe-link-values",
9
7
  description: "Adding unsubscribe link values",
10
8
  type: "custom",
11
- processor: (t) => {
12
- const { getPartnerName: i } = U(), a = N(), n = I(), u = a.getVariationId;
13
- if (!u)
14
- 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)
21
- 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;
25
- let s = E;
26
- R && (s = s.replace(
27
- l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
28
- f.UNSUBSCRIBE_URL + e
29
- )), _ && (s = s.replace(
30
- 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;
9
+ processor: (n) => {
10
+ var a, u;
11
+ const { getPartnerName: i } = m(), t = b();
12
+ let e = n;
13
+ const o = `/${i()}/email/0?user={{iid}}`, r = (a = t.selectedUnsubscribePages) == null ? void 0 : a.find((l) => l.type === p.UNSUBSCRIBE_LINK_TYPE), s = (u = t.selectedUnsubscribePages) == null ? void 0 : u.find((l) => l.type === p.PREFERENCES_LINK_TYPE);
14
+ return r && (e = e.replace(
15
+ c.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
16
+ E.UNSUBSCRIBE_URL + o
17
+ )), s && (e = e.replace(
18
+ c.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
19
+ E.PREFERENCES_URL + o
20
+ )), e.replace(c.UNSUBSCRIBE_LINK_REGEX, "");
34
21
  },
35
22
  priority: 60
36
23
  },
@@ -38,7 +25,7 @@ const T = [
38
25
  id: "remove-data-ogsb-button-styles",
39
26
  description: "Removing styles like [data-ogsb] .es-button.es-button-123 { background: red; }",
40
27
  type: "regex",
41
- pattern: l.DATA_OGSB_BUTTON_CSS_REGEX,
28
+ pattern: c.DATA_OGSB_BUTTON_CSS_REGEX,
42
29
  replacement: "",
43
30
  flags: "g",
44
31
  priority: 61
@@ -47,25 +34,25 @@ const T = [
47
34
  id: "format-comment-braces",
48
35
  description: "Adding spaces around comment braces for proper formatting",
49
36
  type: "custom",
50
- processor: (t) => t.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
37
+ processor: (n) => n.replace(/{#/g, "{ #").replace(/#}/g, "# }"),
51
38
  priority: 62
52
39
  },
53
40
  {
54
41
  id: "add-universal-link-flags",
55
42
  description: "Adding universal link flags",
56
43
  type: "custom",
57
- processor: (t) => {
58
- let i = t;
59
- const a = i.match(/<a[^>]+>(.*?)<\/a>/gm);
60
- return a && a.forEach((n) => {
61
- if (n.includes("insEmail=1"))
44
+ processor: (n) => {
45
+ let i = n;
46
+ const t = i.match(/<a[^>]+>(.*?)<\/a>/gm);
47
+ return t && t.forEach((e) => {
48
+ if (e.includes("insEmail=1"))
62
49
  return;
63
- if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
64
- const o = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
65
- const r = e.slice(6, e.length - 1).trim();
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`);
50
+ if (e.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
51
+ const o = e.replace(/href=(["'`”])(.*?)\1/gm, (r) => {
52
+ const s = r.slice(6, r.length - 1).trim();
53
+ return r.includes("?") || r.includes("#") ? s.slice(-1) === "&" ? r.replace(s, `${s}insEmail=1`) : r.replace(s, `${s}&insEmail=1`) : r.replace(s, `${s}?insEmail=1`);
67
54
  });
68
- i = i.replace(n, o);
55
+ i = i.replace(e, o);
69
56
  }
70
57
  }), i;
71
58
  },
@@ -73,5 +60,5 @@ const T = [
73
60
  }
74
61
  ];
75
62
  export {
76
- T as unsubscribeCompilerRules
63
+ S as unsubscribeCompilerRules
77
64
  };
@@ -1 +1 @@
1
- export declare const migrate: (html: string) => Promise<string>;
1
+ export declare const migrate: (html: string) => string;
@@ -1,11 +1,10 @@
1
- import { migrateCheckbox as o } from "./checkboxMigrator.js";
1
+ import { migrateCheckbox as r } from "./checkboxMigrator.js";
2
2
  import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
3
- import { migrateRadioButton as i } from "./radioButtonMigrator.js";
4
- import { migrateUnsubscribe as e } from "./unsubscribeMigrator.js";
5
- const c = async (t) => {
6
- let r = t;
7
- return r = o(r), r = i(r), r = await e(r), r = m(r), r;
3
+ import { migrateRadioButton as e } from "./radioButtonMigrator.js";
4
+ const p = (o) => {
5
+ let t = o;
6
+ return t = r(t), t = e(t), t = m(t), t;
8
7
  };
9
8
  export {
10
- c as migrate
9
+ p as migrate
11
10
  };
@@ -1,13 +1,9 @@
1
1
  const a = {
2
2
  translationsPath: "window.trans.en",
3
- migrationDate: 1759696858,
4
3
  emailHeader: {
5
4
  senderName: "",
6
5
  subject: ""
7
6
  },
8
- extensions: {
9
- unsubscribe: !0
10
- },
11
7
  features: {
12
8
  dynamicContent: !0,
13
9
  saveAsTemplate: !0,
@@ -13,26 +13,3 @@ export declare const URLS: {
13
13
  PREFERENCES_URL: string;
14
14
  };
15
15
  export declare const INSIDER_ID = "iid";
16
- export declare const DEFAULT_UNSUBSCRIBE_GROUP: {
17
- readonly name: "Global Unsubscribe";
18
- readonly sendGridId: "G";
19
- };
20
- export declare const ACADEMY_LINK = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center";
21
- export declare const UNSUBSCRIBE_PAGES_LINK = "/email/unsubscribe-pages";
22
- export declare const PAGE_TYPES: {
23
- GLOBAL_UNSUBSCRIBE: number;
24
- GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: number;
25
- SUBSCRIPTION_PREFERENCE_CENTER: number;
26
- SUBSCRIPTION_PREFERENCE_CONFIRMATION: number;
27
- RESUBSCRIBE: number;
28
- };
29
- export declare const TYPE_COLLECTIONS: {
30
- [x: number]: number[];
31
- };
32
- export declare const TYPE_TRANSLATIONS: {
33
- [x: number]: string;
34
- };
35
- export declare const MERGE_TAGS: {
36
- [x: number]: string;
37
- default: string;
38
- };
@@ -1,54 +1,17 @@
1
- import { useTranslations as e } from "../composables/useTranslations.js";
2
- const s = e(), R = {
1
+ const E = {
3
2
  UNSUBSCRIBE_LINK_TYPE: 1,
4
3
  PREFERENCES_LINK_TYPE: 3
5
- }, S = {
4
+ }, s = {
6
5
  UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
7
6
  DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
8
7
  GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
9
8
  PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
10
- }, N = {
9
+ }, _ = {
11
10
  UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
12
11
  PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
13
- }, _ = {
14
- name: "Global Unsubscribe",
15
- sendGridId: "G"
16
- }, I = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
17
- GLOBAL_UNSUBSCRIBE: 1,
18
- GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
19
- SUBSCRIPTION_PREFERENCE_CENTER: 3,
20
- SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
21
- RESUBSCRIBE: 5
22
- }, i = {
23
- [E.GLOBAL_UNSUBSCRIBE]: [
24
- E.GLOBAL_UNSUBSCRIBE,
25
- E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
26
- E.RESUBSCRIBE
27
- ],
28
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: [
29
- E.SUBSCRIPTION_PREFERENCE_CENTER,
30
- E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
31
- ]
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 = {
39
- default: "{{ins-unsubscribe-link}}",
40
- [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
41
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
42
12
  };
43
13
  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,
49
- E as PAGE_TYPES,
50
- i as TYPE_COLLECTIONS,
51
- B as TYPE_TRANSLATIONS,
52
- r as UNSUBSCRIBE_PAGES_LINK,
53
- N as URLS
14
+ s as LINK_REGEXES,
15
+ E as LINK_TYPES,
16
+ _ as URLS
54
17
  };
@@ -1,92 +1,93 @@
1
- var d = Object.defineProperty;
2
- var l = (r, n, e) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
3
- var o = (r, n, e) => l(r, typeof n != "symbol" ? n + "" : n, e);
4
- import { useHttp as L } from "../../../composables/useHttp.js";
5
- import { DEFAULT_UNSUBSCRIBE_GROUP as u } from "../../../enums/unsubscribe.js";
6
- import { Control as h, UIElementType as i, UEAttr as t, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- const m = "ui-elements-checkbox", a = "select", { get: C } = L();
8
- class S extends h {
1
+ var c = Object.defineProperty;
2
+ var E = (n, s, t) => s in n ? c(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t;
3
+ var u = (n, s, t) => E(n, typeof s != "symbol" ? s + "" : s, t);
4
+ import { useHttp as d } from "../../../composables/useHttp.js";
5
+ import { Control as l, UIElementType as r, UEAttr as e, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ const h = "ui-elements-checkbox", o = "select", { get: L } = d();
7
+ class $ extends l {
9
8
  constructor() {
10
9
  super(...arguments);
11
- o(this, "currentNode");
12
- o(this, "selectedUnsubGroup");
13
- o(this, "unsubList", []);
10
+ u(this, "currentNode");
11
+ u(this, "selectedUnsubGroup");
12
+ u(this, "unsubList", []);
14
13
  }
15
14
  getId() {
16
- return m;
15
+ return h;
17
16
  }
18
17
  _setFormValues() {
19
18
  if (this.currentNode && "getAttribute" in this.currentNode) {
20
- const e = this.currentNode.getAttribute("id");
21
- if (e) {
22
- const s = e === u.sendGridId ? e : Number(e);
23
- s && (this.selectedUnsubGroup = s, this.api.updateValues({
24
- [a]: this.selectedUnsubGroup
25
- }));
26
- }
19
+ const t = Number(this.currentNode.getAttribute("id"));
20
+ t && (this.selectedUnsubGroup = t, this.api.updateValues({
21
+ [o]: this.selectedUnsubGroup
22
+ }));
27
23
  }
28
24
  }
29
- _getLabel(e, s = `${Math.random()}`) {
25
+ _getLabel(t, i = `${Math.random()}`) {
30
26
  return `
31
- <${i.LABEL}
32
- ${t.LABEL.text}="${e}"
33
- ${t.LABEL.name}="${s}">
34
- </${i.LABEL}>
27
+ <${r.LABEL}
28
+ ${e.LABEL.text}="${t}"
29
+ ${e.LABEL.name}="${i}">
30
+ </${r.LABEL}>
35
31
  `;
36
32
  }
37
- _getSelectItem(e, s) {
33
+ _getSelectItem(t, i) {
38
34
  return `
39
- <${i.SELECT_ITEM}
40
- ${t.SELECT_ITEM.text}="${e}"
41
- ${t.SELECT_ITEM.value}="${s}">
42
- </${i.SELECT_ITEM}>`;
35
+ <${r.SELECT_ITEM}
36
+ ${e.SELECT_ITEM.text}="${t}"
37
+ ${e.SELECT_ITEM.value}="${i}">
38
+ </${r.SELECT_ITEM}>`;
43
39
  }
44
40
  _getSelect() {
45
- return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
41
+ return this.unsubList.map((t) => this._getSelectItem(t.name, t.sendGridId)).join("");
46
42
  }
47
43
  getTemplate() {
48
44
  return `
49
45
  <div class="checkbox-controls-container">
50
46
  <div class="checkbox-select-container container two-columns stretch">
51
- <${i.LABEL}
52
- ${t.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
53
- ${t.LABEL.name}="${Math.random()}">
54
- </${i.LABEL}>
47
+ <${r.LABEL}
48
+ ${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
49
+ ${e.LABEL.name}="${Math.random()}">
50
+ </${r.LABEL}>
55
51
 
56
- <${i.SELECTPICKER}
57
- ${t.SELECTPICKER.name}="${a}"
58
- ${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
52
+ <${r.SELECTPICKER}
53
+ ${e.SELECTPICKER.name}="${o}"
54
+ ${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
59
55
  ${this._getSelect()}
60
- </${i.SELECTPICKER}>
56
+ </${r.SELECTPICKER}>
61
57
  </div>
62
58
  </div>
63
59
  `;
64
60
  }
65
- _onSelectChange(e) {
66
- this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new p(`Updated text to ${e}`));
61
+ _onSelectChange(t) {
62
+ this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new p(`Updated text to ${t}`));
67
63
  }
68
64
  _listenToFormUpdates() {
69
- this.api.onValueChanged(a, (e) => this._onSelectChange(e));
65
+ this.api.onValueChanged(o, (t) => this._onSelectChange(t));
70
66
  }
71
- onTemplateNodeUpdated(e) {
72
- this.currentNode = e;
67
+ onTemplateNodeUpdated(t) {
68
+ if (this.currentNode = t, "getAttribute" in t) {
69
+ const i = Number(t.getAttribute("id"));
70
+ i && (this.selectedUnsubGroup = i, this.api.updateValues({
71
+ [o]: this.selectedUnsubGroup
72
+ }));
73
+ }
73
74
  }
74
75
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
75
76
  async onRender() {
76
- const e = await C(
77
+ const t = await L(
77
78
  "/unsubscribe-groups/unsubscribe-list"
78
- ), s = [u, ...e.data], E = s.map((c) => ({
79
- [t.SELECT_ITEM.text]: c.name,
80
- [t.SELECT_ITEM.value]: c.sendGridId
79
+ ), i = t.data.map((a) => ({
80
+ [e.SELECT_ITEM.text]: a.name,
81
+ [e.SELECT_ITEM.value]: a.sendGridId
81
82
  }));
82
- this.unsubList = s, this.api.setUIEAttribute(
83
- a,
84
- t.SELECTPICKER.items,
85
- E
83
+ this.unsubList = t.data, this.api.setUIEAttribute(
84
+ o,
85
+ e.SELECTPICKER.items,
86
+ i
86
87
  ), this._setFormValues(), this._listenToFormUpdates();
87
88
  }
88
89
  }
89
90
  export {
90
- m as CHECKBOX_CONTROL_BLOCK_ID,
91
- S as CheckboxControl
91
+ h as CHECKBOX_CONTROL_BLOCK_ID,
92
+ $ as CheckboxControl
92
93
  };
@@ -1,45 +1,41 @@
1
- var d = Object.defineProperty;
2
- var l = (r, n, t) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
- var o = (r, n, t) => l(r, typeof n != "symbol" ? n + "" : n, t);
4
- import { useHttp as L } from "../../../composables/useHttp.js";
5
- import { DEFAULT_UNSUBSCRIBE_GROUP as E } from "../../../enums/unsubscribe.js";
6
- import { Control as p, UIElementType as i, UEAttr as e, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- const m = "ui-elements-radio-button", a = "select", { get: $ } = L();
8
- class _ extends p {
1
+ var c = Object.defineProperty;
2
+ var E = (r, s, t) => s in r ? c(r, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[s] = t;
3
+ var u = (r, s, t) => E(r, typeof s != "symbol" ? s + "" : s, t);
4
+ import { useHttp as d } from "../../../composables/useHttp.js";
5
+ import { Control as l, UIElementType as n, UEAttr as e, ModificationDescription as p } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
6
+ const L = "ui-elements-radio-button", o = "select", { get: h } = d();
7
+ class T extends l {
9
8
  constructor() {
10
9
  super(...arguments);
11
- o(this, "currentNode");
12
- o(this, "selectedUnsubGroup");
13
- o(this, "unsubList", []);
10
+ u(this, "currentNode");
11
+ u(this, "selectedUnsubGroup");
12
+ u(this, "unsubList", []);
14
13
  }
15
14
  getId() {
16
- return m;
15
+ return L;
17
16
  }
18
17
  _setFormValues() {
19
18
  if (this.currentNode && "getAttribute" in this.currentNode) {
20
- const t = this.currentNode.getAttribute("id");
21
- if (t) {
22
- const s = t === E.sendGridId ? t : Number(t);
23
- s && (this.selectedUnsubGroup = s, this.api.updateValues({
24
- [a]: this.selectedUnsubGroup
25
- }));
26
- }
19
+ const t = Number(this.currentNode.getAttribute("id"));
20
+ t && (this.selectedUnsubGroup = t, this.api.updateValues({
21
+ [o]: this.selectedUnsubGroup
22
+ }));
27
23
  }
28
24
  }
29
- _getLabel(t, s = `${Math.random()}`) {
25
+ _getLabel(t, i = `${Math.random()}`) {
30
26
  return `
31
- <${i.LABEL}
27
+ <${n.LABEL}
32
28
  ${e.LABEL.text}="${t}"
33
- ${e.LABEL.name}="${s}">
34
- </${i.LABEL}>
29
+ ${e.LABEL.name}="${i}">
30
+ </${n.LABEL}>
35
31
  `;
36
32
  }
37
- _getSelectItem(t, s) {
33
+ _getSelectItem(t, i) {
38
34
  return `
39
- <${i.SELECT_ITEM}
35
+ <${n.SELECT_ITEM}
40
36
  ${e.SELECT_ITEM.text}="${t}"
41
- ${e.SELECT_ITEM.value}="${s}">
42
- </${i.SELECT_ITEM}>`;
37
+ ${e.SELECT_ITEM.value}="${i}">
38
+ </${n.SELECT_ITEM}>`;
43
39
  }
44
40
  _getSelect() {
45
41
  return this.unsubList.map((t) => this._getSelectItem(t.name, t.sendGridId)).join("");
@@ -48,45 +44,50 @@ class _ extends p {
48
44
  return `
49
45
  <div class="checkbox-controls-container">
50
46
  <div class="checkbox-select-container container two-columns stretch">
51
- <${i.LABEL}
47
+ <${n.LABEL}
52
48
  ${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
53
49
  ${e.LABEL.name}="${Math.random()}">
54
- </${i.LABEL}>
50
+ </${n.LABEL}>
55
51
 
56
- <${i.SELECTPICKER}
57
- ${e.SELECTPICKER.name}="${a}"
52
+ <${n.SELECTPICKER}
53
+ ${e.SELECTPICKER.name}="${o}"
58
54
  ${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
59
55
  ${this._getSelect()}
60
- </${i.SELECTPICKER}>
56
+ </${n.SELECTPICKER}>
61
57
  </div>
62
58
  </div>
63
59
  `;
64
60
  }
65
61
  _onSelectChange(t) {
66
- this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
62
+ this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new p(`Updated text to ${t}`));
67
63
  }
68
64
  _listenToFormUpdates() {
69
- this.api.onValueChanged(a, (t) => this._onSelectChange(t));
65
+ this.api.onValueChanged(o, (t) => this._onSelectChange(t));
70
66
  }
71
67
  onTemplateNodeUpdated(t) {
72
- this.currentNode = t;
68
+ if (this.currentNode = t, "getAttribute" in t) {
69
+ const i = Number(t.getAttribute("id"));
70
+ i && (this.selectedUnsubGroup = i, this.api.updateValues({
71
+ [o]: this.selectedUnsubGroup
72
+ }));
73
+ }
73
74
  }
74
75
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
75
76
  async onRender() {
76
- const t = await $(
77
+ const t = await h(
77
78
  "/unsubscribe-groups/unsubscribe-list"
78
- ), s = [E, ...t.data], c = s.map((u) => ({
79
- [e.SELECT_ITEM.text]: u.name,
80
- [e.SELECT_ITEM.value]: u.sendGridId
79
+ ), i = t.data.map((a) => ({
80
+ [e.SELECT_ITEM.text]: a.name,
81
+ [e.SELECT_ITEM.value]: a.sendGridId
81
82
  }));
82
- this.unsubList = s, this.api.setUIEAttribute(
83
- a,
83
+ this.unsubList = t.data, this.api.setUIEAttribute(
84
+ o,
84
85
  e.SELECTPICKER.items,
85
- c
86
+ i
86
87
  ), this._setFormValues(), this._listenToFormUpdates();
87
88
  }
88
89
  }
89
90
  export {
90
- m as CONTROL_BLOCK_ID,
91
- _ as RadioButtonControl
91
+ L as CONTROL_BLOCK_ID,
92
+ T as RadioButtonControl
92
93
  };
@@ -12,12 +12,12 @@ const e = {
12
12
  <td align="left" width="70%" style="vertical-align: top;">
13
13
  <table cellpadding="0" cellspacing="0" role="presentation" width="100%">
14
14
  <tbody>
15
- <${t.BLOCK_TEXT}>
16
- {-{-TITLE-}-}
17
- </${t.BLOCK_TEXT}>
18
- <${t.BLOCK_TEXT}>
19
- {-{-DESCRIPTION-}-}
20
- </${t.BLOCK_TEXT}>
15
+ <${t.BLOCK_TEXT}>
16
+ {-{-TITLE-}-}
17
+ </${t.BLOCK_TEXT}>
18
+ <${t.BLOCK_TEXT}>
19
+ {-{-DESCRIPTION-}-}
20
+ </${t.BLOCK_TEXT}>
21
21
  </tbody>
22
22
  </table>
23
23
  </td>
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-2c168944] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-3c910a93],.guido-editor__container[data-v-3c910a93]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-3c910a93]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ [data-v-2c168944] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-aca05338],.guido-editor__container[data-v-aca05338]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-aca05338]{height:calc(100vh - 75px)}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}