@useinsider/guido 1.0.3-beta.d8a9e56 → 1.0.3-beta.dbf4a88
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 +8 -8
- package/dist/components/Guido.vue2.js +74 -69
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +16 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +24 -0
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +64 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +107 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +12 -0
- package/dist/components/wrappers/WpDrawer.vue.js +6 -4
- package/dist/composables/useStripo.js +41 -34
- package/dist/config/compiler/unsubscribeCompilerRules.js +42 -29
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/unsubscribeMigrator.js +124 -0
- package/dist/enums/defaults.js +6 -3
- package/dist/enums/unsubscribe.js +43 -6
- package/dist/extensions/Blocks/Checkbox/control.js +55 -53
- package/dist/extensions/Blocks/RadioButton/control.js +44 -42
- package/dist/extensions/Blocks/Unsubscribe/block.js +131 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +167 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +35 -0
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +42 -0
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +10 -0
- package/dist/extensions/Blocks/Unsubscribe/template.js +22 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +6 -0
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +2 -1
- package/dist/package.json.js +7 -0
- package/dist/services/unsubscribeApi.js +16 -0
- package/dist/{@types → src/@types}/generic.d.ts +9 -0
- package/dist/{components → src/components}/Guido.vue.d.ts +2 -2
- package/dist/src/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +2 -0
- package/dist/src/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -0
- package/dist/{components → src/components}/wrappers/WpDrawer.vue.d.ts +6 -4
- package/dist/src/config/migrator/index.d.ts +1 -0
- package/dist/src/config/migrator/unsubscribeMigrator.d.ts +1 -0
- package/dist/src/enums/unsubscribe.d.ts +38 -0
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +32 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
- package/dist/src/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
- package/dist/src/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +4 -0
- package/dist/src/extensions/Blocks/Unsubscribe/template.d.ts +12 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -0
- package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
- package/dist/src/extensions/DynamicContent/extension.d.ts +2 -0
- package/dist/src/services/unsubscribeApi.d.ts +4 -0
- package/dist/src/stores/config.d.ts +96 -0
- package/dist/src/stores/unsubscribe.d.ts +256 -0
- package/dist/stores/config.js +17 -0
- package/dist/stores/unsubscribe.js +126 -6
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +6 -1
- package/dist/config/migrator/index.d.ts +0 -1
- package/dist/enums/unsubscribe.d.ts +0 -15
- package/dist/stores/unsubscribe.d.ts +0 -8
- /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}/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}/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/couponBlockMigrator.d.ts +0 -0
- /package/dist/{config → src/config}/migrator/radioButtonMigrator.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 → src/extensions}/Blocks/CouponBlock/block.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/extension.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/iconsRegistry.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/settingsPanel.d.ts +0 -0
- /package/dist/{extensions → src/extensions}/Blocks/CouponBlock/template.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 → 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/Blocks/_Boilerplate → src/extensions/Blocks/Unsubscribe}/extension.d.ts +0 -0
- /package/dist/{extensions/Blocks/_Boilerplate → src/extensions/Blocks/Unsubscribe}/settingsPanel.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/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/{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,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
|
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var d = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
|
|
3
|
+
var u = (n, i, e) => d(n, typeof i != "symbol" ? i + "" : i, e);
|
|
4
|
+
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
|
+
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
+
import { Block as S, BlockCompositionType as h, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
import { getDefaultTemplate as L } from "./template.js";
|
|
8
|
+
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
9
|
+
import { parsePageList as m } from "./utils/utils.js";
|
|
10
|
+
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', B = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", C = {
|
|
11
|
+
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
12
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
13
|
+
};
|
|
14
|
+
class D extends S {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
u(this, "selectEventListener", null);
|
|
18
|
+
u(this, "cancelEventListener", null);
|
|
19
|
+
u(this, "currentNode");
|
|
20
|
+
}
|
|
21
|
+
getId() {
|
|
22
|
+
return v;
|
|
23
|
+
}
|
|
24
|
+
getIcon() {
|
|
25
|
+
return "unsubscribe-icon";
|
|
26
|
+
}
|
|
27
|
+
getBlockCompositionType() {
|
|
28
|
+
return h.BLOCK;
|
|
29
|
+
}
|
|
30
|
+
getName() {
|
|
31
|
+
return this.api.translate("Unsubscribe Block");
|
|
32
|
+
}
|
|
33
|
+
getDescription() {
|
|
34
|
+
return this.api.translate("Unsubscribe Block Description");
|
|
35
|
+
}
|
|
36
|
+
getTemplate() {
|
|
37
|
+
return L();
|
|
38
|
+
}
|
|
39
|
+
onCreated(e) {
|
|
40
|
+
"getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
41
|
+
}
|
|
42
|
+
onSelect(e) {
|
|
43
|
+
this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
|
|
44
|
+
}
|
|
45
|
+
onDelete(e) {
|
|
46
|
+
this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
47
|
+
}
|
|
48
|
+
onDestroy() {
|
|
49
|
+
this._removeEventListeners(), this.currentNode = void 0;
|
|
50
|
+
}
|
|
51
|
+
_setupSelectEventListener() {
|
|
52
|
+
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
53
|
+
const r = e, { collectionType: t, selectedPages: s } = r.detail;
|
|
54
|
+
this._updateBlock(t, s.join(","));
|
|
55
|
+
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
56
|
+
}
|
|
57
|
+
_removeSelectEventListener() {
|
|
58
|
+
this.selectEventListener && (document.removeEventListener(a.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
59
|
+
}
|
|
60
|
+
_setupCancelEventListener() {
|
|
61
|
+
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
62
|
+
this._handleCancel();
|
|
63
|
+
}, document.addEventListener(a.CANCEL, this.cancelEventListener);
|
|
64
|
+
}
|
|
65
|
+
_removeCancelEventListener() {
|
|
66
|
+
this.cancelEventListener && (document.removeEventListener(a.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
|
|
67
|
+
}
|
|
68
|
+
_handleCancel() {
|
|
69
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new b("Removed unsubscribe block due to cancel"));
|
|
70
|
+
}
|
|
71
|
+
_removeEventListeners() {
|
|
72
|
+
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
73
|
+
}
|
|
74
|
+
_updateBlock(e, r) {
|
|
75
|
+
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
76
|
+
return;
|
|
77
|
+
const t = this.currentNode.querySelector(g);
|
|
78
|
+
if (!t)
|
|
79
|
+
return;
|
|
80
|
+
const s = this._getMergeTag(e);
|
|
81
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", s).apply(new b(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
|
|
82
|
+
}
|
|
83
|
+
_getMergeTag(e) {
|
|
84
|
+
return C[e] ?? f;
|
|
85
|
+
}
|
|
86
|
+
_openDrawer() {
|
|
87
|
+
try {
|
|
88
|
+
const e = c();
|
|
89
|
+
e.typeSelectionDrawerStatus = !0;
|
|
90
|
+
} catch (e) {
|
|
91
|
+
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
_checkExistingBlocks() {
|
|
95
|
+
const e = c();
|
|
96
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((t) => {
|
|
97
|
+
if ("getAttribute" in t) {
|
|
98
|
+
const s = t.getAttribute(o.PAGE_TYPE);
|
|
99
|
+
if (s) {
|
|
100
|
+
const l = Number(s);
|
|
101
|
+
l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
_loadBlockState(e) {
|
|
107
|
+
if (!("getAttribute" in e))
|
|
108
|
+
return;
|
|
109
|
+
const r = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
110
|
+
if (!r || !t)
|
|
111
|
+
return;
|
|
112
|
+
const s = c(), l = Number(r), p = m(t);
|
|
113
|
+
s.setCollectionWithoutAutoSelection(l), s.loadSelectedTemplates(p);
|
|
114
|
+
}
|
|
115
|
+
_resetStoreState() {
|
|
116
|
+
c().$reset();
|
|
117
|
+
}
|
|
118
|
+
_removeBlockTemplatesFromStore(e) {
|
|
119
|
+
if (!("getAttribute" in e))
|
|
120
|
+
return;
|
|
121
|
+
const r = e.getAttribute(o.PAGE_LIST);
|
|
122
|
+
if (!r)
|
|
123
|
+
return;
|
|
124
|
+
const t = c(), s = m(r);
|
|
125
|
+
t.removeUnsubscribePages(s);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
v as UNSUBSCRIBE_BLOCK_ID,
|
|
130
|
+
D as UnsubscribeBlock
|
|
131
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
var h = Object.defineProperty;
|
|
2
|
+
var d = (a, s, e) => s in a ? h(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
|
|
3
|
+
var u = (a, s, e) => d(a, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
5
|
+
import { Control as T, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { DATA_ATTRIBUTES as p } from "./utils/constants.js";
|
|
7
|
+
import { parsePageList as _ } from "./utils/utils.js";
|
|
8
|
+
const g = "ui-elements-unsubscribe", r = {
|
|
9
|
+
SELECT_BUTTON: "selectTemplateButton",
|
|
10
|
+
PREV_BUTTON: "prevButton",
|
|
11
|
+
NEXT_BUTTON: "nextButton",
|
|
12
|
+
COUNTER_TEXT: "counterText",
|
|
13
|
+
PREVIEW_IMAGE: "previewImage"
|
|
14
|
+
};
|
|
15
|
+
class N extends T {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
u(this, "currentPreviewIndex", 0);
|
|
19
|
+
u(this, "currentNode");
|
|
20
|
+
u(this, "currentPages");
|
|
21
|
+
u(this, "valueChangeHandlers", []);
|
|
22
|
+
u(this, "lastParsedAttribute");
|
|
23
|
+
}
|
|
24
|
+
getId() {
|
|
25
|
+
return g;
|
|
26
|
+
}
|
|
27
|
+
getTemplate() {
|
|
28
|
+
return `
|
|
29
|
+
<div class="unsubscribe-controls-container container stretch widest-spacing">
|
|
30
|
+
${this._getPreview()}
|
|
31
|
+
${this._getButton()}
|
|
32
|
+
</div>
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
onTemplateNodeUpdated(e) {
|
|
36
|
+
if (this.currentNode = e, "getAttribute" in this.currentNode) {
|
|
37
|
+
const t = this.currentNode.getAttribute(p.PAGE_LIST);
|
|
38
|
+
t && (t !== this.lastParsedAttribute && (this.currentPages = _(t), this.lastParsedAttribute = t, this.currentPreviewIndex = 0), this._updatePreview(), this._updateCounter());
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
onRender() {
|
|
42
|
+
this._listenToFormUpdates(), this._updateCounter();
|
|
43
|
+
}
|
|
44
|
+
onDestroy() {
|
|
45
|
+
this.valueChangeHandlers.forEach((e) => {
|
|
46
|
+
typeof e == "function" && e();
|
|
47
|
+
}), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
|
|
48
|
+
}
|
|
49
|
+
get totalTemplates() {
|
|
50
|
+
var e;
|
|
51
|
+
return ((e = this.currentPages) == null ? void 0 : e.length) ?? 0;
|
|
52
|
+
}
|
|
53
|
+
_listenToFormUpdates() {
|
|
54
|
+
this.valueChangeHandlers.push(
|
|
55
|
+
this.api.onValueChanged(r.SELECT_BUTTON, () => this._onButtonClick())
|
|
56
|
+
), this.valueChangeHandlers.push(
|
|
57
|
+
this.api.onValueChanged(r.PREV_BUTTON, () => this._onPrevClick())
|
|
58
|
+
), this.valueChangeHandlers.push(
|
|
59
|
+
this.api.onValueChanged(r.NEXT_BUTTON, () => this._onNextClick())
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
_onButtonClick() {
|
|
63
|
+
try {
|
|
64
|
+
const e = l();
|
|
65
|
+
e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error("[UnsubscribeControl] Failed to open drawer:", e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_onPrevClick() {
|
|
71
|
+
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
72
|
+
}
|
|
73
|
+
_onNextClick() {
|
|
74
|
+
this.currentPreviewIndex < this.totalTemplates - 1 && (this.currentPreviewIndex++, this._updatePreview(), this._updateCounter());
|
|
75
|
+
}
|
|
76
|
+
_updatePreview() {
|
|
77
|
+
var e;
|
|
78
|
+
if ((e = this.currentPages) != null && e.length)
|
|
79
|
+
try {
|
|
80
|
+
const t = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(t);
|
|
81
|
+
if (!o) {
|
|
82
|
+
console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
this.api.updateValues({
|
|
86
|
+
[r.PREVIEW_IMAGE]: o
|
|
87
|
+
});
|
|
88
|
+
} catch (t) {
|
|
89
|
+
console.error("[UnsubscribeControl] Failed to update preview:", t);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
_updateCounter() {
|
|
93
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, c = this.currentPreviewIndex === 0, o = this.currentPreviewIndex >= t - 1;
|
|
94
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(
|
|
95
|
+
r.COUNTER_TEXT,
|
|
96
|
+
i.LABEL.text,
|
|
97
|
+
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
_getPreview() {
|
|
101
|
+
return `
|
|
102
|
+
<div class="unsubscribe-preview-container">
|
|
103
|
+
<div class="unsubscribe-preview-header">
|
|
104
|
+
<div class="unsubscribe-preview-title">${this.api.translate("Unsubscribe Template")}</div>
|
|
105
|
+
<div class="unsubscribe-preview-controls">
|
|
106
|
+
${this._getPrevButton()}
|
|
107
|
+
${this._getCounterText()}
|
|
108
|
+
${this._getNextButton()}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<unsubscribe-preview name="${r.PREVIEW_IMAGE}"></unsubscribe-preview>
|
|
112
|
+
</div>
|
|
113
|
+
`;
|
|
114
|
+
}
|
|
115
|
+
_getButton() {
|
|
116
|
+
return `
|
|
117
|
+
<${n.BUTTON}
|
|
118
|
+
id="${r.SELECT_BUTTON}"
|
|
119
|
+
class="primary full-width"
|
|
120
|
+
${i.BUTTON.name}="${r.SELECT_BUTTON}"
|
|
121
|
+
${i.BUTTON.caption}="${this.api.translate("Select Template")}"
|
|
122
|
+
>
|
|
123
|
+
</${n.BUTTON}>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
_getLabel(e, t) {
|
|
127
|
+
return `
|
|
128
|
+
<${n.LABEL}
|
|
129
|
+
${i.LABEL.text}="${e}"
|
|
130
|
+
${i.LABEL.name}="${t}"
|
|
131
|
+
>
|
|
132
|
+
</${n.LABEL}>
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
_getIconButton(e, t, c) {
|
|
136
|
+
const o = c ? `${i.BUTTON.disabled}="true"` : "";
|
|
137
|
+
return `
|
|
138
|
+
<${n.BUTTON}
|
|
139
|
+
id="${e}"
|
|
140
|
+
class="flat-inline flat-white"
|
|
141
|
+
${i.BUTTON.name}="${e}"
|
|
142
|
+
${o}
|
|
143
|
+
>
|
|
144
|
+
<${n.ICON}
|
|
145
|
+
src="${t}"
|
|
146
|
+
class="icon-button"
|
|
147
|
+
></${n.ICON}>
|
|
148
|
+
</${n.BUTTON}>
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
_getPrevButton() {
|
|
152
|
+
const e = this.currentPreviewIndex === 0;
|
|
153
|
+
return this._getIconButton(r.PREV_BUTTON, "arrow-back", e);
|
|
154
|
+
}
|
|
155
|
+
_getNextButton() {
|
|
156
|
+
const e = this.currentPreviewIndex >= this.totalTemplates - 1;
|
|
157
|
+
return this._getIconButton(r.NEXT_BUTTON, "arrow-right", e);
|
|
158
|
+
}
|
|
159
|
+
_getCounterText() {
|
|
160
|
+
const t = `Showing ${this.currentPreviewIndex + 1} of ${this.totalTemplates}`;
|
|
161
|
+
return this._getLabel(t, r.COUNTER_TEXT);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
export {
|
|
165
|
+
g as UNSUBSCRIBE_CONTROL_ID,
|
|
166
|
+
N as UnsubscribeControl
|
|
167
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var n = (i, t, e) => t in i ? r(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var s = (i, t, e) => n(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { UIElement as m } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
const E = "unsubscribe-preview", l = "img", c = "Unsubscribe page preview";
|
|
6
|
+
class o extends m {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
s(this, "imgElement");
|
|
10
|
+
}
|
|
11
|
+
getId() {
|
|
12
|
+
return E;
|
|
13
|
+
}
|
|
14
|
+
getTemplate() {
|
|
15
|
+
return `
|
|
16
|
+
<div class="unsubscribe-preview-image-container">
|
|
17
|
+
<img
|
|
18
|
+
src=""
|
|
19
|
+
alt="${c}"
|
|
20
|
+
class="unsubscribe-preview-image"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
onRender(e) {
|
|
26
|
+
this.imgElement = e.querySelector(l);
|
|
27
|
+
}
|
|
28
|
+
setValue(e) {
|
|
29
|
+
this.imgElement && (this.imgElement.src = e);
|
|
30
|
+
}
|
|
31
|
+
getValue() {
|
|
32
|
+
var e;
|
|
33
|
+
return ((e = this.imgElement) == null ? void 0 : e.src) ?? "";
|
|
34
|
+
}
|
|
35
|
+
onDestroy() {
|
|
36
|
+
this.imgElement = void 0;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
E as PREVIEW_UI_ELEMENT_ID,
|
|
41
|
+
o as PreviewUIElement
|
|
42
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExtensionBuilder as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { UnsubscribeBlock as i } from "./block.js";
|
|
3
|
+
import { UnsubscribeControl as t } from "./control.js";
|
|
4
|
+
import { PreviewUIElement as o } from "./elements/preview.js";
|
|
5
|
+
import { UnsubscribeIconsRegistry as r } from "./iconsRegistry.js";
|
|
6
|
+
import { SettingsPanel as s } from "./settingsPanel.js";
|
|
7
|
+
import n from "./styles.css.js";
|
|
8
|
+
import { UnsubscribeTagRegistry as l } from "./tagRegistry.js";
|
|
9
|
+
const f = new e().addBlock(i).withSettingsPanelRegistry(s).addControl(t).addUiElement(o).addStyles(n).withLocalization({
|
|
10
|
+
en: {
|
|
11
|
+
"Unsubscribe Block": "Unsubscribe Block",
|
|
12
|
+
"Unsubscribe Block Description": "Add an unsubscribe link to your email",
|
|
13
|
+
"Select Template": "Select Template",
|
|
14
|
+
"Unsubscribe Template": "Unsubscribe Template",
|
|
15
|
+
Showing: "Showing",
|
|
16
|
+
of: "of"
|
|
17
|
+
}
|
|
18
|
+
}).withUiElementTagRegistry(l).withIconsRegistry(r).build();
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IconsRegistry as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
class i extends s {
|
|
3
|
+
registerIconsSvg(C) {
|
|
4
|
+
C["unsubscribe-icon"] = `
|
|
5
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<path d="M4.5 9C6.98528 9 9 11.0147 9 13.5C9 15.9853 6.98528 18 4.5 18C2.01472 18 0 15.9853 0 13.5C0
|
|
7
|
+
11.0147 2.01472 9 4.5 9ZM2.17383 12.5879C2.06286 12.8707 2 13.1778 2 13.5C2 14.8807 3.11929 16 4.5
|
|
8
|
+
16C4.82196 16 5.12848 15.936 5.41113 15.8252L2.17383 12.5879ZM4.5 11C4.17785 11 3.87068 11.0629 3.58789
|
|
9
|
+
11.1738L6.8252 14.4111C6.93604 14.1285 7 13.822 7 13.5C7 12.1193 5.88071 11 4.5 11ZM16 0C17.1046 0 18
|
|
10
|
+
0.895431 18 2L18 12C18 13.1046 17.1046 14 16 14H11C10.4477 14 10 13.5523 10 13C10 12.4477 10.4477 12 11
|
|
11
|
+
12H16L16 5.93262L9.49609 8.87305C9.35966 8.94801 9.20653 8.99125 9.04883 8.99805C9.03254 8.99891 9.01624
|
|
12
|
+
8.99895 9 8.99902C8.98344 8.99894 8.9668 8.99894 8.9502 8.99805C8.79257 8.99109 8.63925 8.9481 8.50293
|
|
13
|
+
8.87305L2 5.93262L2 8C2 8.55229 1.55228 9 1 9C0.447715 9 0 8.55229 0 8L0 2C0 0.895431 0.895431
|
|
14
|
+
9.69188e-09 2 0L16 0ZM2 3.80664L9 6.96973L16 3.80664V2L2 2L2 3.80664Z" fill="#666666"/>
|
|
15
|
+
</svg>
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
i as UnsubscribeIconsRegistry
|
|
21
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SettingsPanelRegistry as e, SettingsPanelTab as N, SettingsTab as t, TextControls as O } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { UNSUBSCRIBE_BLOCK_ID as I } from "./block.js";
|
|
3
|
+
import { UNSUBSCRIBE_CONTROL_ID as _ } from "./control.js";
|
|
4
|
+
class R extends e {
|
|
5
|
+
registerBlockControls(T) {
|
|
6
|
+
T[I] = [
|
|
7
|
+
new N(
|
|
8
|
+
t.SETTINGS,
|
|
9
|
+
[
|
|
10
|
+
_,
|
|
11
|
+
O.FORMAT,
|
|
12
|
+
O.ALIGN,
|
|
13
|
+
O.LINE_HEIGHT,
|
|
14
|
+
O.DIRECTION,
|
|
15
|
+
O.INTERNAL_INDENTS,
|
|
16
|
+
O.HIDDEN_NODE
|
|
17
|
+
]
|
|
18
|
+
),
|
|
19
|
+
new N(
|
|
20
|
+
t.STYLES,
|
|
21
|
+
[
|
|
22
|
+
O.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
23
|
+
O.FONT_FAMILY,
|
|
24
|
+
O.FONT_SIZE,
|
|
25
|
+
O.FONT_COLOR,
|
|
26
|
+
O.FONT_BACKGROUND_COLOR,
|
|
27
|
+
O.LINKS_COLOR
|
|
28
|
+
]
|
|
29
|
+
)
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
R as SettingsPanel
|
|
35
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const n = `/* Unsubscribe Extension Styles */
|
|
2
|
+
|
|
3
|
+
.unsubscribe-preview-container {
|
|
4
|
+
/* Container styling handled by parent classes */
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.unsubscribe-preview-header {
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
margin-bottom: 8px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.unsubscribe-preview-title {
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.unsubscribe-preview-controls {
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: 2px;
|
|
20
|
+
align-items: center;
|
|
21
|
+
color: #666;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Preview image container and image */
|
|
25
|
+
.unsubscribe-preview-image-container {
|
|
26
|
+
width: 100%;
|
|
27
|
+
max-height: 400px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.unsubscribe-preview-image {
|
|
35
|
+
object-fit: cover;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: auto;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
export {
|
|
41
|
+
n as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UIElementTagRegistry as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { PREVIEW_UI_ELEMENT_ID as e } from "./elements/preview.js";
|
|
3
|
+
class m extends s {
|
|
4
|
+
registerUiElements(r) {
|
|
5
|
+
r[e] = e;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
m as UnsubscribeTagRegistry
|
|
10
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BlockType as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
const s = "unsubscribe", n = "{{ins-unsubscribe-link}}", t = `
|
|
3
|
+
<${e.BLOCK_TEXT}
|
|
4
|
+
class="unsubscribe-block-v2 esd-block-unsubscribe es-p0"
|
|
5
|
+
align="center"
|
|
6
|
+
data-unsubscribe-page-type=""
|
|
7
|
+
data-unsubscribe-page-list=""
|
|
8
|
+
>
|
|
9
|
+
<p>You can <strong><a
|
|
10
|
+
href="${n}"
|
|
11
|
+
class="unsubscribe-link"
|
|
12
|
+
target="_blank"
|
|
13
|
+
data-unsubscribe-link="true"
|
|
14
|
+
>${s}</a></strong> from our emails, if you need to.</p>
|
|
15
|
+
</${e.BLOCK_TEXT}>
|
|
16
|
+
`;
|
|
17
|
+
function r() {
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
r as getDefaultTemplate
|
|
22
|
+
};
|
package/dist/guido.css
CHANGED
|
@@ -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-
|
|
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-96687c1d],.guido-editor__container[data-v-96687c1d]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-96687c1d]{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}
|