@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.
- package/dist/@types/generic.d.ts +0 -14
- package/dist/components/Guido.vue.d.ts +2 -3
- package/dist/components/Guido.vue.js +9 -11
- package/dist/components/Guido.vue2.js +69 -75
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
- package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
- package/dist/components/wrappers/WpDrawer.vue.js +4 -6
- package/dist/composables/useStripo.js +18 -26
- package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
- package/dist/config/migrator/index.d.ts +1 -1
- package/dist/config/migrator/index.js +6 -7
- package/dist/enums/defaults.js +0 -4
- package/dist/enums/unsubscribe.d.ts +0 -23
- package/dist/enums/unsubscribe.js +6 -43
- package/dist/extensions/Blocks/Checkbox/control.js +54 -53
- package/dist/extensions/Blocks/RadioButton/control.js +45 -44
- package/dist/extensions/Blocks/RadioButton/template.js +6 -6
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +71 -83
- package/dist/stores/editor.d.ts +0 -21
- package/dist/stores/editor.js +1 -2
- package/dist/stores/unsubscribe.d.ts +5 -253
- package/dist/stores/unsubscribe.js +6 -126
- package/dist/utils/dateUtil.d.ts +0 -4
- package/dist/utils/dateUtil.js +12 -8
- package/dist/utils/genericUtil.d.ts +0 -1
- package/dist/utils/genericUtil.js +7 -8
- package/dist/utils/templatePreparation.js +16 -17
- package/package.json +2 -2
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +0 -2
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
- package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +0 -2
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
- package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
- package/dist/config/migrator/unsubscribeMigrator.js +0 -124
- package/dist/enums/date.d.ts +0 -13
- package/dist/enums/date.js +0 -16
- package/dist/enums/extensions/recommendationBlock.d.ts +0 -16
- package/dist/enums/extensions/recommendationBlock.js +0 -80
- package/dist/extensions/Blocks/Recommendation/block.d.ts +0 -10
- package/dist/extensions/Blocks/Recommendation/block.js +0 -27
- package/dist/extensions/Blocks/Recommendation/control.d.ts +0 -29
- package/dist/extensions/Blocks/Recommendation/control.js +0 -277
- package/dist/extensions/Blocks/Recommendation/extension.d.ts +0 -2
- package/dist/extensions/Blocks/Recommendation/extension.js +0 -10
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
- package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +0 -4
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -32
- package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
- package/dist/extensions/Blocks/Recommendation/template.d.ts +0 -6
- package/dist/extensions/Blocks/Recommendation/template.js +0 -200
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
- package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
- package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
- package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
- package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
- package/dist/extensions/Blocks/common-control.d.ts +0 -66
- package/dist/extensions/Blocks/common-control.js +0 -102
- package/dist/mock/api/recommendation.d.ts +0 -2
- package/dist/services/recommendationApi.d.ts +0 -6
- package/dist/services/recommendationApi.js +0 -43
- package/dist/services/unsubscribeApi.d.ts +0 -4
- package/dist/services/unsubscribeApi.js +0 -16
- package/dist/stores/config.d.ts +0 -97
- package/dist/stores/config.js +0 -17
|
@@ -1,36 +1,23 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as
|
|
3
|
-
import {
|
|
4
|
-
|
|
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: (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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:
|
|
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: (
|
|
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: (
|
|
58
|
-
let i =
|
|
59
|
-
const
|
|
60
|
-
return
|
|
61
|
-
if (
|
|
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 (
|
|
64
|
-
const o =
|
|
65
|
-
const
|
|
66
|
-
return
|
|
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(
|
|
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
|
-
|
|
63
|
+
S as unsubscribeCompilerRules
|
|
77
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const migrate: (html: string) =>
|
|
1
|
+
export declare const migrate: (html: string) => string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { migrateCheckbox as
|
|
1
|
+
import { migrateCheckbox as r } from "./checkboxMigrator.js";
|
|
2
2
|
import { migrateCouponBlock as m } from "./couponBlockMigrator.js";
|
|
3
|
-
import { migrateRadioButton as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
+
p as migrate
|
|
11
10
|
};
|
package/dist/enums/defaults.js
CHANGED
|
@@ -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
|
-
|
|
2
|
-
const s = e(), R = {
|
|
1
|
+
const E = {
|
|
3
2
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
4
3
|
PREFERENCES_LINK_TYPE: 3
|
|
5
|
-
},
|
|
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
|
-
},
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
u(this, "currentNode");
|
|
11
|
+
u(this, "selectedUnsubGroup");
|
|
12
|
+
u(this, "unsubList", []);
|
|
14
13
|
}
|
|
15
14
|
getId() {
|
|
16
|
-
return
|
|
15
|
+
return h;
|
|
17
16
|
}
|
|
18
17
|
_setFormValues() {
|
|
19
18
|
if (this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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(
|
|
25
|
+
_getLabel(t, i = `${Math.random()}`) {
|
|
30
26
|
return `
|
|
31
|
-
<${
|
|
32
|
-
${
|
|
33
|
-
${
|
|
34
|
-
</${
|
|
27
|
+
<${r.LABEL}
|
|
28
|
+
${e.LABEL.text}="${t}"
|
|
29
|
+
${e.LABEL.name}="${i}">
|
|
30
|
+
</${r.LABEL}>
|
|
35
31
|
`;
|
|
36
32
|
}
|
|
37
|
-
_getSelectItem(
|
|
33
|
+
_getSelectItem(t, i) {
|
|
38
34
|
return `
|
|
39
|
-
<${
|
|
40
|
-
${
|
|
41
|
-
${
|
|
42
|
-
</${
|
|
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((
|
|
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
|
-
<${
|
|
52
|
-
${
|
|
53
|
-
${
|
|
54
|
-
</${
|
|
47
|
+
<${r.LABEL}
|
|
48
|
+
${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
49
|
+
${e.LABEL.name}="${Math.random()}">
|
|
50
|
+
</${r.LABEL}>
|
|
55
51
|
|
|
56
|
-
<${
|
|
57
|
-
${
|
|
58
|
-
${
|
|
52
|
+
<${r.SELECTPICKER}
|
|
53
|
+
${e.SELECTPICKER.name}="${o}"
|
|
54
|
+
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
59
55
|
${this._getSelect()}
|
|
60
|
-
</${
|
|
56
|
+
</${r.SELECTPICKER}>
|
|
61
57
|
</div>
|
|
62
58
|
</div>
|
|
63
59
|
`;
|
|
64
60
|
}
|
|
65
|
-
_onSelectChange(
|
|
66
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id",
|
|
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(
|
|
65
|
+
this.api.onValueChanged(o, (t) => this._onSelectChange(t));
|
|
70
66
|
}
|
|
71
|
-
onTemplateNodeUpdated(
|
|
72
|
-
this.currentNode =
|
|
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
|
|
77
|
+
const t = await L(
|
|
77
78
|
"/unsubscribe-groups/unsubscribe-list"
|
|
78
|
-
),
|
|
79
|
-
[
|
|
80
|
-
[
|
|
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 =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
91
|
-
|
|
91
|
+
h as CHECKBOX_CONTROL_BLOCK_ID,
|
|
92
|
+
$ as CheckboxControl
|
|
92
93
|
};
|
|
@@ -1,45 +1,41 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
u(this, "currentNode");
|
|
11
|
+
u(this, "selectedUnsubGroup");
|
|
12
|
+
u(this, "unsubList", []);
|
|
14
13
|
}
|
|
15
14
|
getId() {
|
|
16
|
-
return
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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,
|
|
25
|
+
_getLabel(t, i = `${Math.random()}`) {
|
|
30
26
|
return `
|
|
31
|
-
<${
|
|
27
|
+
<${n.LABEL}
|
|
32
28
|
${e.LABEL.text}="${t}"
|
|
33
|
-
${e.LABEL.name}="${
|
|
34
|
-
</${
|
|
29
|
+
${e.LABEL.name}="${i}">
|
|
30
|
+
</${n.LABEL}>
|
|
35
31
|
`;
|
|
36
32
|
}
|
|
37
|
-
_getSelectItem(t,
|
|
33
|
+
_getSelectItem(t, i) {
|
|
38
34
|
return `
|
|
39
|
-
<${
|
|
35
|
+
<${n.SELECT_ITEM}
|
|
40
36
|
${e.SELECT_ITEM.text}="${t}"
|
|
41
|
-
${e.SELECT_ITEM.value}="${
|
|
42
|
-
</${
|
|
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
|
-
<${
|
|
47
|
+
<${n.LABEL}
|
|
52
48
|
${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
53
49
|
${e.LABEL.name}="${Math.random()}">
|
|
54
|
-
</${
|
|
50
|
+
</${n.LABEL}>
|
|
55
51
|
|
|
56
|
-
<${
|
|
57
|
-
${e.SELECTPICKER.name}="${
|
|
52
|
+
<${n.SELECTPICKER}
|
|
53
|
+
${e.SELECTPICKER.name}="${o}"
|
|
58
54
|
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
59
55
|
${this._getSelect()}
|
|
60
|
-
</${
|
|
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
|
|
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(
|
|
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
|
-
),
|
|
79
|
-
[e.SELECT_ITEM.text]:
|
|
80
|
-
[e.SELECT_ITEM.value]:
|
|
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 =
|
|
83
|
-
|
|
83
|
+
this.unsubList = t.data, this.api.setUIEAttribute(
|
|
84
|
+
o,
|
|
84
85
|
e.SELECTPICKER.items,
|
|
85
|
-
|
|
86
|
+
i
|
|
86
87
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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}
|