@useinsider/guido 1.0.3-beta.2143901 → 1.0.3-beta.2155d71
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/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +61 -60
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +12 -13
- package/dist/composables/useStripo.js +35 -32
- package/dist/config/compiler/unsubscribeCompilerRules.js +39 -26
- package/dist/config/migrator/couponBlockMigrator.js +67 -0
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/unsubscribeMigrator.js +61 -49
- package/dist/enums/unsubscribe.js +15 -11
- package/dist/extensions/Blocks/Checkbox/control.js +55 -53
- package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/extensions/Blocks/RadioButton/control.js +44 -42
- package/dist/extensions/Blocks/Unsubscribe/block.js +5 -5
- package/dist/extensions/Blocks/Unsubscribe/extension.js +7 -6
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +27 -11
- package/dist/guido.css +1 -1
- package/dist/package.json.js +7 -0
- package/dist/{@types → src/@types}/generic.d.ts +2 -1
- package/dist/src/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/{enums → src/enums}/unsubscribe.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/block.d.ts +12 -0
- package/dist/src/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/DynamicContent/extension.d.ts +2 -0
- package/dist/src/stores/config.d.ts +96 -0
- package/dist/{stores → src/stores}/unsubscribe.d.ts +72 -2
- package/dist/stores/config.js +17 -0
- package/dist/stores/unsubscribe.js +43 -42
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +6 -1
- /package/dist/{@types → src/@types}/events.d.ts +0 -0
- /package/dist/{@types → src/@types}/save-as-template.d.ts +0 -0
- /package/dist/{App.vue.d.ts → src/App.vue.d.ts} +0 -0
- /package/dist/{components → src/components}/Guido.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/LoadingWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/base/Toaster.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/HeaderWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/LeftSlot.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/MiddleSlot.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/RightSlot.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/ViewOptions.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/RestoreButton.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/header/version-history/ViewOptions.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/AMPOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/GenericOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/NewVersionPopup.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/OnboardingWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -0
- /package/dist/{components → src/components}/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -0
- /package/dist/{components → src/components}/wrappers/WpDrawer.vue.d.ts +0 -0
- /package/dist/{components → src/components}/wrappers/WpModal.vue.d.ts +0 -0
- /package/dist/{composables → src/composables}/useActionsApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useApiExample.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCodeEditorApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/useConfig.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCustomInterfaceAppearance.d.ts +0 -0
- /package/dist/{composables → src/composables}/useDebounce.d.ts +0 -0
- /package/dist/{composables → src/composables}/useExport.d.ts +0 -0
- /package/dist/{composables → src/composables}/useGuidoActions.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlCompiler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHtmlValidator.d.ts +0 -0
- /package/dist/{composables → src/composables}/useHttp.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePartner.d.ts +0 -0
- /package/dist/{composables → src/composables}/usePreviewMode.d.ts +0 -0
- /package/dist/{composables → src/composables}/useProvideInject.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRecommendation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useResponsivePreview.d.ts +0 -0
- /package/dist/{composables → src/composables}/useSave.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripo.d.ts +0 -0
- /package/dist/{composables → src/composables}/useStripoEventHandler.d.ts +0 -0
- /package/dist/{composables → src/composables}/useToaster.d.ts +0 -0
- /package/dist/{composables → src/composables}/useTranslations.d.ts +0 -0
- /package/dist/{composables → src/composables}/useValidation.d.ts +0 -0
- /package/dist/{composables → src/composables}/useVersionHistoryApi.d.ts +0 -0
- /package/dist/{composables → src/composables}/validators/saveAsTemplate.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/htmlCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/outlookCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/recommendationCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/socialCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/checkboxMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/index.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/radioButtonMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/unsubscribeMigrator.d.ts +0 -0
- /package/dist/{enums → src/enums}/defaults.d.ts +0 -0
- /package/dist/{enums → src/enums}/displayConditions.d.ts +0 -0
- /package/dist/{enums → src/enums}/html-validator.d.ts +0 -0
- /package/dist/{enums → src/enums}/onboarding.d.ts +0 -0
- /package/dist/{enums → src/enums}/preview.d.ts +0 -0
- /package/dist/{enums → src/enums}/recommendation.d.ts +0 -0
- /package/dist/{enums → src/enums}/toaster.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Checkbox/template.d.ts +0 -0
- /package/dist/{extensions/Blocks/RadioButton → src/extensions/Blocks/CouponBlock}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/control.d.ts +0 -0
- /package/dist/{extensions/Blocks/Unsubscribe → src/extensions/Blocks/RadioButton}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/RadioButton/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/control.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/elements/preview.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Unsubscribe}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/tagRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/utils/constants.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/Unsubscribe/utils/utils.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
- /package/dist/{extensions/DynamicContent → src/extensions/Blocks/_Boilerplate}/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content-modal.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/DynamicContent/dynamic-content.d.ts +0 -0
- /package/dist/{library.d.ts → src/library.d.ts} +0 -0
- /package/dist/{main.d.ts → src/main.d.ts} +0 -0
- /package/dist/{mock → src/mock}/api/auth.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/custom-fonts.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/default-template.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/template-library.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/unsubscribe.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/user-modal-state.d.ts +0 -0
- /package/dist/{mock → src/mock}/api/validator.d.ts +0 -0
- /package/dist/{mock → src/mock}/browser.d.ts +0 -0
- /package/dist/{mock → src/mock}/handlers.d.ts +0 -0
- /package/dist/{services → src/services}/onboardingApi.d.ts +0 -0
- /package/dist/{services → src/services}/stripoApi.d.ts +0 -0
- /package/dist/{services → src/services}/templateLibraryApi.d.ts +0 -0
- /package/dist/{services → src/services}/unsubscribeApi.d.ts +0 -0
- /package/dist/{stores → src/stores}/dynamic-content.d.ts +0 -0
- /package/dist/{stores → src/stores}/editor.d.ts +0 -0
- /package/dist/{stores → src/stores}/onboarding.d.ts +0 -0
- /package/dist/{stores → src/stores}/preview.d.ts +0 -0
- /package/dist/{stores → src/stores}/recommendation.d.ts +0 -0
- /package/dist/{stores → src/stores}/save-as-template.d.ts +0 -0
- /package/dist/{stores → src/stores}/toaster.d.ts +0 -0
- /package/dist/{stores → src/stores}/version-history.d.ts +0 -0
- /package/dist/{utils → src/utils}/arrayUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/base64.d.ts +0 -0
- /package/dist/{utils → src/utils}/dateUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/genericUtil.d.ts +0 -0
- /package/dist/{utils → src/utils}/htmlCompiler.d.ts +0 -0
- /package/dist/{utils → src/utils}/templatePreparation.d.ts +0 -0
- /package/dist/{utils → src/utils}/tooltipUtils.d.ts +0 -0
|
@@ -1,37 +1,49 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { MERGE_TAGS as
|
|
5
|
-
import { DATA_ATTRIBUTES as
|
|
6
|
-
import { useUnsubscribeStore as
|
|
7
|
-
class
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var x = (l, e, t) => e in l ? h(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
3
|
+
var S = (l, e, t) => x(l, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { MERGE_TAGS as k, PAGE_TYPES as p } from "../../enums/unsubscribe.js";
|
|
5
|
+
import { DATA_ATTRIBUTES as A } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
+
import { useUnsubscribeStore as T } from "../../stores/unsubscribe.js";
|
|
7
|
+
class C {
|
|
8
8
|
constructor() {
|
|
9
|
-
|
|
9
|
+
S(this, "parser");
|
|
10
10
|
this.parser = new DOMParser();
|
|
11
11
|
}
|
|
12
12
|
async migrate(e) {
|
|
13
13
|
try {
|
|
14
|
-
const t = this.parser.parseFromString(e, "text/html"),
|
|
15
|
-
if (!
|
|
14
|
+
const t = this.parser.parseFromString(e, "text/html"), i = t.querySelectorAll("td.unsubscribe-block");
|
|
15
|
+
if (!i.length)
|
|
16
16
|
return e;
|
|
17
|
-
const
|
|
18
|
-
return await
|
|
19
|
-
const
|
|
17
|
+
const o = T();
|
|
18
|
+
return await o.fetchTemplates(), i.forEach((r) => {
|
|
19
|
+
const c = r.getAttribute("id"), g = this.extractPaddingClass(r), u = r.getAttribute("bgcolor") || "", n = this.extractUnsubscribeContent(r), s = this.getCollectionTypeFromMergeTag(n.linkHref), b = o.getSelectedUnsubscribePagesByCollection(s);
|
|
20
20
|
console.debug("[UnsubscribeMigrator]", {
|
|
21
21
|
mergeTag: n.linkHref,
|
|
22
|
-
collectionType:
|
|
23
|
-
pageIds:
|
|
22
|
+
collectionType: s,
|
|
23
|
+
pageIds: b,
|
|
24
|
+
paddingClass: g,
|
|
25
|
+
bgColor: u
|
|
24
26
|
});
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
+
const f = this.buildUnsubscribeBlock(
|
|
28
|
+
n,
|
|
29
|
+
s,
|
|
30
|
+
b,
|
|
31
|
+
g,
|
|
32
|
+
u
|
|
33
|
+
), a = this.parser.parseFromString(
|
|
34
|
+
`<table id="tempDoc"><tbody><tr>${f}</tr></tbody></table>`,
|
|
27
35
|
"text/html"
|
|
28
36
|
).querySelector(".unsubscribe-block-v2");
|
|
29
|
-
|
|
37
|
+
a && r.parentNode && (a.setAttribute("id", c || ""), r.parentNode.replaceChild(a, r));
|
|
30
38
|
}), t.documentElement.outerHTML;
|
|
31
39
|
} catch (t) {
|
|
32
40
|
return console.error("UnsubscribeMigrator failed:", t), e;
|
|
33
41
|
}
|
|
34
42
|
}
|
|
43
|
+
extractPaddingClass(e) {
|
|
44
|
+
const i = (e.getAttribute("class") || "").match(/\bes-p\d+\b/);
|
|
45
|
+
return i ? i[0] : "";
|
|
46
|
+
}
|
|
35
47
|
extractUnsubscribeContent(e) {
|
|
36
48
|
var m;
|
|
37
49
|
const t = e.querySelector("p");
|
|
@@ -47,8 +59,8 @@ class h {
|
|
|
47
59
|
align: "center",
|
|
48
60
|
paragraphStyle: ""
|
|
49
61
|
};
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
62
|
+
const i = e.getAttribute("align") || t.getAttribute("align") || "center", o = t.getAttribute("style") || "", r = t.querySelector("a.unsubscribe-link") || t.querySelector('a[href*="unsubscribe"]');
|
|
63
|
+
if (!r)
|
|
52
64
|
return {
|
|
53
65
|
textBefore: "You can ",
|
|
54
66
|
linkText: "unsubscribe",
|
|
@@ -57,56 +69,56 @@ class h {
|
|
|
57
69
|
textAfter: " from our emails, if you need to.",
|
|
58
70
|
isBold: !1,
|
|
59
71
|
isItalic: !1,
|
|
60
|
-
align:
|
|
61
|
-
paragraphStyle:
|
|
72
|
+
align: i,
|
|
73
|
+
paragraphStyle: o
|
|
62
74
|
};
|
|
63
|
-
const
|
|
75
|
+
const c = ((m = r.textContent) == null ? void 0 : m.trim()) || "unsubscribe", g = r.getAttribute("href") || "{{ins-unsubscribe-link}}", u = r.getAttribute("style") || "", n = t.textContent || "", s = n.indexOf(c), b = s >= 0 ? n.substring(0, s).trim() : "You can ", f = s >= 0 ? n.substring(s + c.length).trim() : " from our emails, if you need to.", d = !!t.querySelector("b, strong"), a = !!t.querySelector("i, em");
|
|
64
76
|
return {
|
|
65
|
-
textBefore:
|
|
66
|
-
linkText:
|
|
67
|
-
linkHref: this.normalizeUnsubscribeHref(
|
|
68
|
-
linkStyle:
|
|
69
|
-
textAfter:
|
|
70
|
-
isBold:
|
|
71
|
-
isItalic:
|
|
72
|
-
align:
|
|
73
|
-
paragraphStyle:
|
|
77
|
+
textBefore: b,
|
|
78
|
+
linkText: c,
|
|
79
|
+
linkHref: this.normalizeUnsubscribeHref(g),
|
|
80
|
+
linkStyle: u,
|
|
81
|
+
textAfter: f,
|
|
82
|
+
isBold: d,
|
|
83
|
+
isItalic: a,
|
|
84
|
+
align: i,
|
|
85
|
+
paragraphStyle: o
|
|
74
86
|
};
|
|
75
87
|
}
|
|
76
|
-
buildUnsubscribeBlock(e, t,
|
|
77
|
-
const
|
|
78
|
-
e.textBefore && n.push(e.textBefore), n.push(
|
|
79
|
-
let
|
|
80
|
-
e.isBold && e.isItalic ?
|
|
81
|
-
const
|
|
88
|
+
buildUnsubscribeBlock(e, t, i, o, r) {
|
|
89
|
+
const c = e.linkStyle ? ` style="${e.linkStyle}"` : "", u = `<a ${`href="${e.linkHref}" class="unsubscribe-link" target="_blank" data-unsubscribe-link="true"`}${c}>${e.linkText}</a>`, n = [];
|
|
90
|
+
e.textBefore && n.push(e.textBefore), n.push(u), e.textAfter && n.push(e.textAfter);
|
|
91
|
+
let s = n.join(" ");
|
|
92
|
+
e.isBold && e.isItalic ? s = `<strong path="1,0"><em path="1,0,0">${s}</em></strong>` : e.isBold ? s = `<strong path="1,0">${s}</strong>` : e.isItalic && (s = `<em path="1,0">${s}</em>`);
|
|
93
|
+
const b = e.align ? ` align="${e.align}"` : "", f = r ? ` bgcolor="${r}"` : "", d = e.paragraphStyle ? ` style="${e.paragraphStyle}"` : "", a = i.length > 0 ? ` ${A.PAGE_LIST}="${i.join(",")}"` : "", m = ` ${A.PAGE_TYPE}="${t}"`, y = "esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block";
|
|
82
94
|
return `
|
|
83
95
|
<td
|
|
84
96
|
data-migration="true"
|
|
85
97
|
esd-extension-block-id="unsubscribe-block"
|
|
86
|
-
class="
|
|
87
|
-
${
|
|
98
|
+
class="${o ? `${y} ${o}` : y}"
|
|
99
|
+
${b}${f}${m}${a}
|
|
88
100
|
>
|
|
89
|
-
<p path="1"${
|
|
90
|
-
${
|
|
101
|
+
<p path="1"${d}>
|
|
102
|
+
${s}
|
|
91
103
|
</p>
|
|
92
104
|
</td>
|
|
93
105
|
`;
|
|
94
106
|
}
|
|
95
107
|
getCollectionTypeFromMergeTag(e) {
|
|
96
|
-
return e === p
|
|
108
|
+
return e === k[p.SUBSCRIPTION_PREFERENCE_CENTER] ? p.SUBSCRIPTION_PREFERENCE_CENTER : e === k[p.GLOBAL_UNSUBSCRIBE] ? p.GLOBAL_UNSUBSCRIBE : p.GLOBAL_UNSUBSCRIBE;
|
|
97
109
|
}
|
|
98
110
|
normalizeUnsubscribeHref(e) {
|
|
99
|
-
if (Object.values(
|
|
111
|
+
if (Object.values(k).includes(e))
|
|
100
112
|
return e;
|
|
101
|
-
const
|
|
102
|
-
return
|
|
113
|
+
const i = e.match(/{{ins-(?:global-)?(?:preferences-)?unsubscribe-link}}/);
|
|
114
|
+
return i ? i[0] : e.includes("unsubscribe") || e.includes("unsub") ? (console.warn(
|
|
103
115
|
`[UnsubscribeMigrator] Unrecognized unsubscribe href format: "${e}". Defaulting to {{ins-unsubscribe-link}}`
|
|
104
116
|
), "{{ins-unsubscribe-link}}") : e;
|
|
105
117
|
}
|
|
106
118
|
}
|
|
107
|
-
async function
|
|
108
|
-
return new
|
|
119
|
+
async function M(l) {
|
|
120
|
+
return new C().migrate(l);
|
|
109
121
|
}
|
|
110
122
|
export {
|
|
111
|
-
|
|
123
|
+
M as migrateUnsubscribe
|
|
112
124
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useTranslations as e } from "../composables/useTranslations.js";
|
|
2
|
-
const s = e(),
|
|
2
|
+
const s = e(), R = {
|
|
3
3
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
4
4
|
PREFERENCES_LINK_TYPE: 3
|
|
5
5
|
}, S = {
|
|
@@ -10,13 +10,16 @@ const s = e(), n = {
|
|
|
10
10
|
}, N = {
|
|
11
11
|
UNSUBSCRIBE_URL: "https://mail.useinsider.com/user/v1/unsub",
|
|
12
12
|
PREFERENCES_URL: "https://mail.useinsider.com/user/v1/prefs"
|
|
13
|
-
}, _ =
|
|
13
|
+
}, _ = {
|
|
14
|
+
name: "Global Unsubscribe",
|
|
15
|
+
sendGridId: "G"
|
|
16
|
+
}, I = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", r = "/email/unsubscribe-pages", E = {
|
|
14
17
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
15
18
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
16
19
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
17
20
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
18
21
|
RESUBSCRIBE: 5
|
|
19
|
-
},
|
|
22
|
+
}, i = {
|
|
20
23
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
21
24
|
E.GLOBAL_UNSUBSCRIBE,
|
|
22
25
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -26,25 +29,26 @@ const s = e(), n = {
|
|
|
26
29
|
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
27
30
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
28
31
|
]
|
|
29
|
-
},
|
|
32
|
+
}, B = {
|
|
30
33
|
[E.GLOBAL_UNSUBSCRIBE]: s("unsubscription-preference.type-global-unsubscribe"),
|
|
31
34
|
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: s("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
32
35
|
[E.RESUBSCRIBE]: s("unsubscription-preference.type-resubscribe"),
|
|
33
36
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: s("unsubscription-preference.type-subscription-preferences-center"),
|
|
34
37
|
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: s("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
35
|
-
},
|
|
38
|
+
}, C = {
|
|
36
39
|
default: "{{ins-unsubscribe-link}}",
|
|
37
40
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
38
41
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
39
42
|
};
|
|
40
43
|
export {
|
|
41
|
-
|
|
44
|
+
I as ACADEMY_LINK,
|
|
45
|
+
_ as DEFAULT_UNSUBSCRIBE_GROUP,
|
|
42
46
|
S as LINK_REGEXES,
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
R as LINK_TYPES,
|
|
48
|
+
C as MERGE_TAGS,
|
|
45
49
|
E as PAGE_TYPES,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
i as TYPE_COLLECTIONS,
|
|
51
|
+
B as TYPE_TRANSLATIONS,
|
|
52
|
+
r as UNSUBSCRIBE_PAGES_LINK,
|
|
49
53
|
N as URLS
|
|
50
54
|
};
|
|
@@ -1,90 +1,92 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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 {
|
|
8
9
|
constructor() {
|
|
9
10
|
super(...arguments);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
o(this, "currentNode");
|
|
12
|
+
o(this, "selectedUnsubGroup");
|
|
13
|
+
o(this, "unsubList", []);
|
|
13
14
|
}
|
|
14
15
|
getId() {
|
|
15
|
-
return
|
|
16
|
+
return m;
|
|
16
17
|
}
|
|
17
18
|
_setFormValues() {
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
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
|
+
}
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
|
-
_getLabel(
|
|
29
|
+
_getLabel(e, s = `${Math.random()}`) {
|
|
23
30
|
return `
|
|
24
|
-
<${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
</${
|
|
31
|
+
<${i.LABEL}
|
|
32
|
+
${t.LABEL.text}="${e}"
|
|
33
|
+
${t.LABEL.name}="${s}">
|
|
34
|
+
</${i.LABEL}>
|
|
28
35
|
`;
|
|
29
36
|
}
|
|
30
|
-
_getSelectItem(
|
|
37
|
+
_getSelectItem(e, s) {
|
|
31
38
|
return `
|
|
32
|
-
<${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
35
|
-
</${
|
|
39
|
+
<${i.SELECT_ITEM}
|
|
40
|
+
${t.SELECT_ITEM.text}="${e}"
|
|
41
|
+
${t.SELECT_ITEM.value}="${s}">
|
|
42
|
+
</${i.SELECT_ITEM}>`;
|
|
36
43
|
}
|
|
37
44
|
_getSelect() {
|
|
38
|
-
return this.unsubList.map((
|
|
45
|
+
return this.unsubList.map((e) => this._getSelectItem(e.name, e.sendGridId)).join("");
|
|
39
46
|
}
|
|
40
47
|
getTemplate() {
|
|
41
48
|
return `
|
|
42
49
|
<div class="checkbox-controls-container">
|
|
43
50
|
<div class="checkbox-select-container container two-columns stretch">
|
|
44
|
-
<${
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
</${
|
|
51
|
+
<${i.LABEL}
|
|
52
|
+
${t.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
53
|
+
${t.LABEL.name}="${Math.random()}">
|
|
54
|
+
</${i.LABEL}>
|
|
48
55
|
|
|
49
|
-
<${
|
|
50
|
-
${
|
|
51
|
-
${
|
|
56
|
+
<${i.SELECTPICKER}
|
|
57
|
+
${t.SELECTPICKER.name}="${a}"
|
|
58
|
+
${t.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
52
59
|
${this._getSelect()}
|
|
53
|
-
</${
|
|
60
|
+
</${i.SELECTPICKER}>
|
|
54
61
|
</div>
|
|
55
62
|
</div>
|
|
56
63
|
`;
|
|
57
64
|
}
|
|
58
|
-
_onSelectChange(
|
|
59
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id",
|
|
65
|
+
_onSelectChange(e) {
|
|
66
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", e.toString()).apply(new p(`Updated text to ${e}`));
|
|
60
67
|
}
|
|
61
68
|
_listenToFormUpdates() {
|
|
62
|
-
this.api.onValueChanged(
|
|
69
|
+
this.api.onValueChanged(a, (e) => this._onSelectChange(e));
|
|
63
70
|
}
|
|
64
|
-
onTemplateNodeUpdated(
|
|
65
|
-
|
|
66
|
-
const i = Number(t.getAttribute("id"));
|
|
67
|
-
i && (this.selectedUnsubGroup = i, this.api.updateValues({
|
|
68
|
-
[o]: this.selectedUnsubGroup
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
+
onTemplateNodeUpdated(e) {
|
|
72
|
+
this.currentNode = e;
|
|
71
73
|
}
|
|
72
74
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
73
75
|
async onRender() {
|
|
74
|
-
const
|
|
76
|
+
const e = await C(
|
|
75
77
|
"/unsubscribe-groups/unsubscribe-list"
|
|
76
|
-
),
|
|
77
|
-
[
|
|
78
|
-
[
|
|
78
|
+
), s = [u, ...e.data], E = s.map((c) => ({
|
|
79
|
+
[t.SELECT_ITEM.text]: c.name,
|
|
80
|
+
[t.SELECT_ITEM.value]: c.sendGridId
|
|
79
81
|
}));
|
|
80
|
-
this.unsubList =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
this.unsubList = s, this.api.setUIEAttribute(
|
|
83
|
+
a,
|
|
84
|
+
t.SELECTPICKER.items,
|
|
85
|
+
E
|
|
84
86
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
m as CHECKBOX_CONTROL_BLOCK_ID,
|
|
91
|
+
S as CheckboxControl
|
|
90
92
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Block as o, BlockCompositionType as e, BlockType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as r } from "./template.js";
|
|
3
|
+
const n = "coupon-block";
|
|
4
|
+
class s extends o {
|
|
5
|
+
constructor() {
|
|
6
|
+
super();
|
|
7
|
+
}
|
|
8
|
+
getId() {
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
getIcon() {
|
|
12
|
+
return "coupon-icon";
|
|
13
|
+
}
|
|
14
|
+
getBlockCompositionType() {
|
|
15
|
+
return e.BLOCK;
|
|
16
|
+
}
|
|
17
|
+
getName() {
|
|
18
|
+
return this.api.translate("Coupon Block");
|
|
19
|
+
}
|
|
20
|
+
getDescription() {
|
|
21
|
+
return this.api.translate("Coupon lets you add a coupon code to your message design.");
|
|
22
|
+
}
|
|
23
|
+
getBlockType() {
|
|
24
|
+
return t.BLOCK_TEXT;
|
|
25
|
+
}
|
|
26
|
+
getTemplate() {
|
|
27
|
+
return r();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
n as COUPON_BLOCK_ID,
|
|
32
|
+
s as CouponBlock
|
|
33
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CouponBlock as t } from "./block.js";
|
|
3
|
+
import { CouponIconsRegistry as i } from "./iconsRegistry.js";
|
|
4
|
+
import { CouponBlockSettings as n } from "./settingsPanel.js";
|
|
5
|
+
const m = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
|
|
6
|
+
export {
|
|
7
|
+
m as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IconsRegistry as L } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
class t extends L {
|
|
3
|
+
registerIconsSvg(C) {
|
|
4
|
+
C["coupon-icon"] = `
|
|
5
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M7.87939 0C8.56714 0.0576002 9.26998 0.793636 9.82275 1.37305L9.83057
|
|
7
|
+
1.38184C9.93483 1.49112 10.0343 1.5944 10.1265 1.68652L17.2573 8.79492C18.2493
|
|
8
|
+
9.7872 18.2493 11.3954 17.2573 12.3877L12.396 17.2471C11.9169 17.726 11.2659 17.9999
|
|
9
|
+
10.6157 18C9.96563 17.9999 9.31551 17.76 8.83643 17.2471L1.68896 10.1221C1.58907 10.0222
|
|
10
|
+
1.47548 9.91523 1.35596 9.80273C0.77939 9.26006 0.0584135 8.58144 0.00146484 7.87305L0.00439453
|
|
11
|
+
2.15625C-0.0298299 1.57462 0.209988 1.02683 0.620605 0.616211C1.03135 0.20572 1.57981 0 2.16162
|
|
12
|
+
0L7.87939 0ZM2.16162 2C2.10648 2 2.07333 2.01007 2.05908 2.01562C2.04707 2.02035 2.04069 2.02432
|
|
13
|
+
2.03467 2.03027C2.01884 2.04611 2.00915 2.05957 2.00342 2.06836L2.00439 2.09766L2.00146 7.59277C2.01413
|
|
14
|
+
7.61029 2.02975 7.63092 2.04834 7.6543C2.20264 7.84819 2.41884 8.05659 2.72705 8.34668L2.73682
|
|
15
|
+
8.35645C2.84844 8.46149 2.9808 8.58586 3.10205 8.70703L3.10303 8.70801L10.2739 15.8564L10.2983
|
|
16
|
+
15.8818C10.3564 15.9439 10.4539 15.9999 10.6157 16C10.7155 15.9998 10.8635 15.9513 10.9819
|
|
17
|
+
15.833L15.8433 10.9736C16.054 10.7626 16.0536 10.4212 15.8433 10.21L8.71436 3.10352L8.7124
|
|
18
|
+
3.10156C8.60329 2.99248 8.49054 2.8737 8.39209 2.77051L8.37549 2.75391C8.08113 2.44536 7.86049
|
|
19
|
+
2.21875 7.65479 2.05469C7.62752 2.03295 7.6037 2.01461 7.5835 2L2.16162 2ZM8.16748 9.83301C8.81172
|
|
20
|
+
9.18878 9.8571 9.18898 10.5015 9.83301L10.6265 9.71973C11.2745 9.19135 12.2304 9.22915 12.8345
|
|
21
|
+
9.83301C13.4787 10.4772 13.4795 11.5226 12.8354 12.167C12.8312 12.1713 12.8251 12.1745 12.8208
|
|
22
|
+
12.1787L11.2085 13.792C10.818 14.1825 10.185 14.1824 9.79443 13.792L8.18115 12.1797C8.1768 12.1755
|
|
23
|
+
8.17178 12.1713 8.16748 12.167C7.52346 11.5226 7.52325 10.4772 8.16748 9.83301ZM5.00146 4C5.55353
|
|
24
|
+
4.00025 6.00146 4.44787 6.00146 5C6.00146 5.55213 5.55353 5.99975 5.00146 6C4.44918 6 4.00146 5.55228
|
|
25
|
+
4.00146 5C4.00146 4.44772 4.44918 4 5.00146 4Z" fill="#666666"/>
|
|
26
|
+
</svg>
|
|
27
|
+
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
t as CouponIconsRegistry
|
|
33
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SettingsPanelRegistry as T, SettingsPanelTab as o, SettingsTab as O, TextControls as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { COUPON_BLOCK_ID as N } from "./block.js";
|
|
3
|
+
class _ extends T {
|
|
4
|
+
registerBlockControls(e) {
|
|
5
|
+
e[N] = [
|
|
6
|
+
new o(
|
|
7
|
+
O.SETTINGS,
|
|
8
|
+
[
|
|
9
|
+
t.FONT_FAMILY,
|
|
10
|
+
t.FONT_SIZE,
|
|
11
|
+
t.FORMAT,
|
|
12
|
+
t.FONT_COLOR,
|
|
13
|
+
t.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
14
|
+
t.ALIGN,
|
|
15
|
+
t.LINE_HEIGHT,
|
|
16
|
+
t.INTERNAL_INDENTS
|
|
17
|
+
]
|
|
18
|
+
)
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
_ as CouponBlockSettings
|
|
24
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const o = `
|
|
2
|
+
<td class="coupon-block ins-coupon-code esd-block-text coupon-block-v2">
|
|
3
|
+
<p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
|
|
4
|
+
</td>`, e = `
|
|
5
|
+
<td
|
|
6
|
+
class="coupon-block coupon-block-v2 ins-coupon-code esd-block-text esd-extension-block"
|
|
7
|
+
esd-extension-block-id="coupon-block"
|
|
8
|
+
>
|
|
9
|
+
<p class="ins-title" contenteditable="false">{@COUPON_CODE}</p>
|
|
10
|
+
</td>
|
|
11
|
+
`;
|
|
12
|
+
function t() {
|
|
13
|
+
return o;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
e as default,
|
|
17
|
+
t as getDefaultTemplate
|
|
18
|
+
};
|
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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 {
|
|
8
9
|
constructor() {
|
|
9
10
|
super(...arguments);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
o(this, "currentNode");
|
|
12
|
+
o(this, "selectedUnsubGroup");
|
|
13
|
+
o(this, "unsubList", []);
|
|
13
14
|
}
|
|
14
15
|
getId() {
|
|
15
|
-
return
|
|
16
|
+
return m;
|
|
16
17
|
}
|
|
17
18
|
_setFormValues() {
|
|
18
|
-
this.
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
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
|
+
}
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
|
-
_getLabel(t,
|
|
29
|
+
_getLabel(t, s = `${Math.random()}`) {
|
|
23
30
|
return `
|
|
24
|
-
<${
|
|
31
|
+
<${i.LABEL}
|
|
25
32
|
${e.LABEL.text}="${t}"
|
|
26
|
-
${e.LABEL.name}="${
|
|
27
|
-
</${
|
|
33
|
+
${e.LABEL.name}="${s}">
|
|
34
|
+
</${i.LABEL}>
|
|
28
35
|
`;
|
|
29
36
|
}
|
|
30
|
-
_getSelectItem(t,
|
|
37
|
+
_getSelectItem(t, s) {
|
|
31
38
|
return `
|
|
32
|
-
<${
|
|
39
|
+
<${i.SELECT_ITEM}
|
|
33
40
|
${e.SELECT_ITEM.text}="${t}"
|
|
34
|
-
${e.SELECT_ITEM.value}="${
|
|
35
|
-
</${
|
|
41
|
+
${e.SELECT_ITEM.value}="${s}">
|
|
42
|
+
</${i.SELECT_ITEM}>`;
|
|
36
43
|
}
|
|
37
44
|
_getSelect() {
|
|
38
45
|
return this.unsubList.map((t) => this._getSelectItem(t.name, t.sendGridId)).join("");
|
|
@@ -41,50 +48,45 @@ class b extends l {
|
|
|
41
48
|
return `
|
|
42
49
|
<div class="checkbox-controls-container">
|
|
43
50
|
<div class="checkbox-select-container container two-columns stretch">
|
|
44
|
-
<${
|
|
51
|
+
<${i.LABEL}
|
|
45
52
|
${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
46
53
|
${e.LABEL.name}="${Math.random()}">
|
|
47
|
-
</${
|
|
54
|
+
</${i.LABEL}>
|
|
48
55
|
|
|
49
|
-
<${
|
|
50
|
-
${e.SELECTPICKER.name}="${
|
|
56
|
+
<${i.SELECTPICKER}
|
|
57
|
+
${e.SELECTPICKER.name}="${a}"
|
|
51
58
|
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
52
59
|
${this._getSelect()}
|
|
53
|
-
</${
|
|
60
|
+
</${i.SELECTPICKER}>
|
|
54
61
|
</div>
|
|
55
62
|
</div>
|
|
56
63
|
`;
|
|
57
64
|
}
|
|
58
65
|
_onSelectChange(t) {
|
|
59
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new
|
|
66
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
|
|
60
67
|
}
|
|
61
68
|
_listenToFormUpdates() {
|
|
62
|
-
this.api.onValueChanged(
|
|
69
|
+
this.api.onValueChanged(a, (t) => this._onSelectChange(t));
|
|
63
70
|
}
|
|
64
71
|
onTemplateNodeUpdated(t) {
|
|
65
|
-
|
|
66
|
-
const i = Number(t.getAttribute("id"));
|
|
67
|
-
i && (this.selectedUnsubGroup = i, this.api.updateValues({
|
|
68
|
-
[o]: this.selectedUnsubGroup
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
72
|
+
this.currentNode = t;
|
|
71
73
|
}
|
|
72
74
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
73
75
|
async onRender() {
|
|
74
|
-
const t = await
|
|
76
|
+
const t = await $(
|
|
75
77
|
"/unsubscribe-groups/unsubscribe-list"
|
|
76
|
-
),
|
|
78
|
+
), s = [E, ...t.data], c = s.map((u) => ({
|
|
77
79
|
[e.SELECT_ITEM.text]: u.name,
|
|
78
80
|
[e.SELECT_ITEM.value]: u.sendGridId
|
|
79
81
|
}));
|
|
80
|
-
this.unsubList =
|
|
81
|
-
|
|
82
|
+
this.unsubList = s, this.api.setUIEAttribute(
|
|
83
|
+
a,
|
|
82
84
|
e.SELECTPICKER.items,
|
|
83
|
-
|
|
85
|
+
c
|
|
84
86
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
m as CONTROL_BLOCK_ID,
|
|
91
|
+
_ as RadioButtonControl
|
|
90
92
|
};
|