@useinsider/guido 1.0.2-beta.ac0dc8b → 1.0.2-beta.ad1dcd9
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 +8 -0
- package/dist/components/Guido.vue.d.ts +2 -2
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +68 -64
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +2 -0
- 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.d.ts +2 -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.d.ts +2 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +18 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +108 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +2 -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.d.ts +6 -4
- package/dist/components/wrappers/WpDrawer.vue.js +6 -4
- package/dist/composables/useHtmlValidator.js +52 -61
- package/dist/composables/useStripo.js +13 -13
- package/dist/config/compiler/unsubscribeCompilerRules.js +19 -19
- package/dist/config/migrator/index.d.ts +1 -1
- package/dist/config/migrator/index.js +6 -6
- package/dist/config/migrator/unsubscribeMigrator.d.ts +1 -0
- package/dist/config/migrator/unsubscribeMigrator.js +112 -0
- package/dist/enums/defaults.js +6 -3
- package/dist/enums/unsubscribe.d.ts +19 -0
- package/dist/enums/unsubscribe.js +39 -6
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +30 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +141 -0
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +29 -0
- package/dist/extensions/Blocks/Unsubscribe/control.js +180 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +11 -0
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +54 -0
- package/dist/extensions/Blocks/{RadioButton → Unsubscribe}/extension.js +6 -5
- package/dist/extensions/Blocks/{RadioButton → Unsubscribe}/settingsPanel.d.ts +1 -1
- package/dist/extensions/Blocks/{RadioButton → Unsubscribe}/settingsPanel.js +14 -21
- package/dist/extensions/Blocks/Unsubscribe/template.d.ts +3 -0
- package/dist/extensions/Blocks/{RadioButton/block.js → Unsubscribe/template.js} +15 -26
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +9 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +11 -0
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +7 -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/constants/UIElementsAttributes.js +2 -1
- package/dist/services/unsubscribeApi.d.ts +4 -0
- package/dist/services/unsubscribeApi.js +16 -0
- package/dist/stores/unsubscribe.d.ts +183 -5
- package/dist/stores/unsubscribe.js +125 -6
- package/package.json +1 -1
- package/dist/config/migrator/radioButtonMigrator.d.ts +0 -1
- package/dist/config/migrator/radioButtonMigrator.js +0 -86
- package/dist/extensions/Blocks/RadioButton/block.d.ts +0 -10
- package/dist/extensions/Blocks/RadioButton/control.d.ts +0 -17
- package/dist/extensions/Blocks/RadioButton/control.js +0 -104
- package/dist/extensions/Blocks/RadioButton/template.d.ts +0 -6
- package/dist/extensions/Blocks/RadioButton/template.js +0 -160
- /package/dist/extensions/Blocks/{RadioButton → Unsubscribe}/extension.d.ts +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
var S = Object.defineProperty;
|
|
2
|
+
var _ = (n, s, e) => s in n ? S(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e;
|
|
3
|
+
var u = (n, s, e) => _(n, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
|
|
5
|
+
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
6
|
+
import { Block as d } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js";
|
|
7
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
8
|
+
import { BlockCompositionType as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
9
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
10
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
11
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
12
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
13
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
14
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
15
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
16
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
17
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
18
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
19
|
+
import { ModificationDescription as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js";
|
|
20
|
+
import { getDefaultTemplate as L } from "./template.js";
|
|
21
|
+
import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
|
|
22
|
+
import { parsePageList as p } from "./utils/utils.js";
|
|
23
|
+
const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', f = ".unsubscribe-block-v2", B = "{{ins-unsubscribe-link}}", C = {
|
|
24
|
+
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
25
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
26
|
+
};
|
|
27
|
+
class $ extends d {
|
|
28
|
+
constructor() {
|
|
29
|
+
super(...arguments);
|
|
30
|
+
u(this, "selectEventListener", null);
|
|
31
|
+
u(this, "cancelEventListener", null);
|
|
32
|
+
u(this, "currentNode");
|
|
33
|
+
}
|
|
34
|
+
getId() {
|
|
35
|
+
return v;
|
|
36
|
+
}
|
|
37
|
+
getIcon() {
|
|
38
|
+
return "mail-info";
|
|
39
|
+
}
|
|
40
|
+
getBlockCompositionType() {
|
|
41
|
+
return h.BLOCK;
|
|
42
|
+
}
|
|
43
|
+
getName() {
|
|
44
|
+
return this.api.translate("Unsubscribe Block");
|
|
45
|
+
}
|
|
46
|
+
getDescription() {
|
|
47
|
+
return this.api.translate("Unsubscribe Block Description");
|
|
48
|
+
}
|
|
49
|
+
getTemplate() {
|
|
50
|
+
return L();
|
|
51
|
+
}
|
|
52
|
+
onCreated(e) {
|
|
53
|
+
console.debug("on created", e), !("getAttribute" in e && e.getAttribute("data-migration")) && (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
|
|
54
|
+
}
|
|
55
|
+
onSelect(e) {
|
|
56
|
+
this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
|
|
57
|
+
}
|
|
58
|
+
onDelete(e) {
|
|
59
|
+
this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
60
|
+
}
|
|
61
|
+
_setupSelectEventListener() {
|
|
62
|
+
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
63
|
+
const i = e, { collectionType: t, selectedPages: r } = i.detail;
|
|
64
|
+
this._updateBlock(t, r.join(","));
|
|
65
|
+
}, document.addEventListener(a.SELECT, this.selectEventListener);
|
|
66
|
+
}
|
|
67
|
+
_removeSelectEventListener() {
|
|
68
|
+
this.selectEventListener && (document.removeEventListener(a.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
69
|
+
}
|
|
70
|
+
_setupCancelEventListener() {
|
|
71
|
+
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
72
|
+
this._handleCancel();
|
|
73
|
+
}, document.addEventListener(a.CANCEL, this.cancelEventListener);
|
|
74
|
+
}
|
|
75
|
+
_removeCancelEventListener() {
|
|
76
|
+
this.cancelEventListener && (document.removeEventListener(a.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
|
|
77
|
+
}
|
|
78
|
+
_handleCancel() {
|
|
79
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new m("Removed unsubscribe block due to cancel"));
|
|
80
|
+
}
|
|
81
|
+
_removeEventListeners() {
|
|
82
|
+
this._removeSelectEventListener(), this._removeCancelEventListener();
|
|
83
|
+
}
|
|
84
|
+
_updateBlock(e, i) {
|
|
85
|
+
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
86
|
+
return;
|
|
87
|
+
const t = this.currentNode.querySelector(g);
|
|
88
|
+
if (!t)
|
|
89
|
+
return;
|
|
90
|
+
const r = this._getMergeTag(e);
|
|
91
|
+
this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", r).apply(new m(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, i).apply(new m("Updated unsubscribe block metadata"));
|
|
92
|
+
}
|
|
93
|
+
_getMergeTag(e) {
|
|
94
|
+
return C[e] ?? B;
|
|
95
|
+
}
|
|
96
|
+
_openDrawer() {
|
|
97
|
+
try {
|
|
98
|
+
const e = c();
|
|
99
|
+
e.typeSelectionDrawerStatus = !0;
|
|
100
|
+
} catch (e) {
|
|
101
|
+
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
_checkExistingBlocks() {
|
|
105
|
+
const e = c();
|
|
106
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(f).forEach((t) => {
|
|
107
|
+
if ("getAttribute" in t) {
|
|
108
|
+
const r = t.getAttribute(o.PAGE_TYPE);
|
|
109
|
+
if (r) {
|
|
110
|
+
const l = Number(r);
|
|
111
|
+
l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
_loadBlockState(e) {
|
|
117
|
+
if (!("getAttribute" in e))
|
|
118
|
+
return;
|
|
119
|
+
const i = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
|
|
120
|
+
if (!i || !t)
|
|
121
|
+
return;
|
|
122
|
+
const r = c(), l = Number(i), b = p(t);
|
|
123
|
+
r.setCollectionWithoutAutoSelection(l), r.loadSelectedTemplates(b);
|
|
124
|
+
}
|
|
125
|
+
_resetStoreState() {
|
|
126
|
+
c().$reset();
|
|
127
|
+
}
|
|
128
|
+
_removeBlockTemplatesFromStore(e) {
|
|
129
|
+
if (!("getAttribute" in e))
|
|
130
|
+
return;
|
|
131
|
+
const i = e.getAttribute(o.PAGE_LIST);
|
|
132
|
+
if (!i)
|
|
133
|
+
return;
|
|
134
|
+
const t = c(), r = p(i);
|
|
135
|
+
t.removeUnsubscribePages(r);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export {
|
|
139
|
+
v as UNSUBSCRIBE_BLOCK_ID,
|
|
140
|
+
$ as UnsubscribeBlock
|
|
141
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { Control } from '@stripoinc/ui-editor-extensions';
|
|
3
|
+
export declare const UNSUBSCRIBE_CONTROL_ID = "ui-elements-unsubscribe";
|
|
4
|
+
export declare class UnsubscribeControl extends Control {
|
|
5
|
+
private currentPreviewIndex;
|
|
6
|
+
private currentNode?;
|
|
7
|
+
private currentPages?;
|
|
8
|
+
private valueChangeHandlers;
|
|
9
|
+
private lastParsedAttribute?;
|
|
10
|
+
getId(): string;
|
|
11
|
+
getTemplate(): string;
|
|
12
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
13
|
+
onRender(): void;
|
|
14
|
+
onDestroy(): void;
|
|
15
|
+
private get totalTemplates();
|
|
16
|
+
private _listenToFormUpdates;
|
|
17
|
+
private _onButtonClick;
|
|
18
|
+
private _onPrevClick;
|
|
19
|
+
private _onNextClick;
|
|
20
|
+
private _updatePreview;
|
|
21
|
+
private _updateCounter;
|
|
22
|
+
private _getPreview;
|
|
23
|
+
private _getButton;
|
|
24
|
+
private _getLabel;
|
|
25
|
+
private _getIconButton;
|
|
26
|
+
private _getPrevButton;
|
|
27
|
+
private _getNextButton;
|
|
28
|
+
private _getCounterText;
|
|
29
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var h = (o, n, t) => n in o ? d(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t;
|
|
3
|
+
var u = (o, n, t) => h(o, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
5
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
6
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
7
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
8
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
9
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
10
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
11
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
12
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
13
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
14
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
15
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
16
|
+
import { UEAttr as i } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js";
|
|
17
|
+
import { UIElementType as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
18
|
+
import { Control as T } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js";
|
|
19
|
+
import { DATA_ATTRIBUTES as p } from "./utils/constants.js";
|
|
20
|
+
import { parsePageList as g } from "./utils/utils.js";
|
|
21
|
+
const _ = "ui-elements-unsubscribe", r = {
|
|
22
|
+
SELECT_BUTTON: "selectTemplateButton",
|
|
23
|
+
PREV_BUTTON: "prevButton",
|
|
24
|
+
NEXT_BUTTON: "nextButton",
|
|
25
|
+
COUNTER_TEXT: "counterText",
|
|
26
|
+
PREVIEW_IMAGE: "previewImage"
|
|
27
|
+
};
|
|
28
|
+
class y extends T {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
u(this, "currentPreviewIndex", 0);
|
|
32
|
+
u(this, "currentNode");
|
|
33
|
+
u(this, "currentPages");
|
|
34
|
+
u(this, "valueChangeHandlers", []);
|
|
35
|
+
u(this, "lastParsedAttribute");
|
|
36
|
+
}
|
|
37
|
+
getId() {
|
|
38
|
+
return _;
|
|
39
|
+
}
|
|
40
|
+
getTemplate() {
|
|
41
|
+
return `
|
|
42
|
+
<div class="unsubscribe-controls-container container stretch widest-spacing">
|
|
43
|
+
${this._getPreview()}
|
|
44
|
+
${this._getButton()}
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
onTemplateNodeUpdated(t) {
|
|
49
|
+
if (this.currentNode = t, "getAttribute" in this.currentNode) {
|
|
50
|
+
const e = this.currentNode.getAttribute(p.PAGE_LIST);
|
|
51
|
+
e && (e !== this.lastParsedAttribute && (this.currentPages = g(e), this.lastParsedAttribute = e, this.currentPreviewIndex = 0), this._updatePreview(), this._updateCounter());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
onRender() {
|
|
55
|
+
this._listenToFormUpdates(), this._updateCounter();
|
|
56
|
+
}
|
|
57
|
+
onDestroy() {
|
|
58
|
+
this.valueChangeHandlers.forEach((t) => {
|
|
59
|
+
typeof t == "function" && t();
|
|
60
|
+
}), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
|
|
61
|
+
}
|
|
62
|
+
get totalTemplates() {
|
|
63
|
+
var t;
|
|
64
|
+
return ((t = this.currentPages) == null ? void 0 : t.length) ?? 0;
|
|
65
|
+
}
|
|
66
|
+
_listenToFormUpdates() {
|
|
67
|
+
this.valueChangeHandlers.push(
|
|
68
|
+
this.api.onValueChanged(r.SELECT_BUTTON, () => this._onButtonClick())
|
|
69
|
+
), this.valueChangeHandlers.push(
|
|
70
|
+
this.api.onValueChanged(r.PREV_BUTTON, () => this._onPrevClick())
|
|
71
|
+
), this.valueChangeHandlers.push(
|
|
72
|
+
this.api.onValueChanged(r.NEXT_BUTTON, () => this._onNextClick())
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
_onButtonClick() {
|
|
76
|
+
try {
|
|
77
|
+
const t = l();
|
|
78
|
+
t.activeType = t.getSelectedCollection[this.currentPreviewIndex], t.pageSelectionUpdateStatus = !0, t.pageSelectionDrawerStatus = !0;
|
|
79
|
+
} catch (t) {
|
|
80
|
+
console.error("[UnsubscribeControl] Failed to open drawer:", t);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
_onPrevClick() {
|
|
84
|
+
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
85
|
+
}
|
|
86
|
+
_onNextClick() {
|
|
87
|
+
this.currentPreviewIndex < this.totalTemplates - 1 && (this.currentPreviewIndex++, this._updatePreview(), this._updateCounter());
|
|
88
|
+
}
|
|
89
|
+
_updatePreview() {
|
|
90
|
+
var t;
|
|
91
|
+
if ((t = this.currentPages) != null && t.length)
|
|
92
|
+
try {
|
|
93
|
+
const e = this.currentPages[this.currentPreviewIndex], a = l().getThumbnailByTemplateId(e);
|
|
94
|
+
if (!a) {
|
|
95
|
+
console.warn("[UnsubscribeControl] No thumbnail found for page:", e);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.api.updateValues({
|
|
99
|
+
[r.PREVIEW_IMAGE]: a
|
|
100
|
+
});
|
|
101
|
+
} catch (e) {
|
|
102
|
+
console.error("[UnsubscribeControl] Failed to update preview:", e);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
_updateCounter() {
|
|
106
|
+
const t = this.currentPreviewIndex + 1, e = this.totalTemplates, c = this.currentPreviewIndex === 0, a = this.currentPreviewIndex >= e - 1;
|
|
107
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, a), this.api.setUIEAttribute(
|
|
108
|
+
r.COUNTER_TEXT,
|
|
109
|
+
i.LABEL.text,
|
|
110
|
+
`Showing ${t} of ${e}`
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
_getPreview() {
|
|
114
|
+
return `
|
|
115
|
+
<div class="unsubscribe-preview-container">
|
|
116
|
+
<div style="display: flex; justify-content: space-between; margin-bottom: 8px;">
|
|
117
|
+
<div style="font-weight: 500;">Unsubscribe Template</div>
|
|
118
|
+
<div style="display: flex; gap: 2px; align-items: center; color: #666;">
|
|
119
|
+
${this._getPrevButton()}
|
|
120
|
+
${this._getCounterText()}
|
|
121
|
+
${this._getNextButton()}
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
<unsubscribe-preview name="${r.PREVIEW_IMAGE}"></unsubscribe-preview>
|
|
125
|
+
</div>
|
|
126
|
+
`;
|
|
127
|
+
}
|
|
128
|
+
_getButton() {
|
|
129
|
+
return `
|
|
130
|
+
<${s.BUTTON}
|
|
131
|
+
id="${r.SELECT_BUTTON}"
|
|
132
|
+
class="primary full-width"
|
|
133
|
+
${i.BUTTON.name}="${r.SELECT_BUTTON}"
|
|
134
|
+
${i.BUTTON.caption}="${this.api.translate("Select Template")}"
|
|
135
|
+
>
|
|
136
|
+
</${s.BUTTON}>
|
|
137
|
+
`;
|
|
138
|
+
}
|
|
139
|
+
_getLabel(t, e) {
|
|
140
|
+
return `
|
|
141
|
+
<${s.LABEL}
|
|
142
|
+
${i.LABEL.text}="${t}"
|
|
143
|
+
${i.LABEL.name}="${e}"
|
|
144
|
+
>
|
|
145
|
+
</${s.LABEL}>
|
|
146
|
+
`;
|
|
147
|
+
}
|
|
148
|
+
_getIconButton(t, e, c) {
|
|
149
|
+
const a = c ? `${i.BUTTON.disabled}="true"` : "";
|
|
150
|
+
return `
|
|
151
|
+
<${s.BUTTON}
|
|
152
|
+
id="${t}"
|
|
153
|
+
class="flat-inline flat-white"
|
|
154
|
+
${i.BUTTON.name}="${t}"
|
|
155
|
+
${a}
|
|
156
|
+
>
|
|
157
|
+
<${s.ICON}
|
|
158
|
+
src="${e}"
|
|
159
|
+
class="icon-button"
|
|
160
|
+
></${s.ICON}>
|
|
161
|
+
</${s.BUTTON}>
|
|
162
|
+
`;
|
|
163
|
+
}
|
|
164
|
+
_getPrevButton() {
|
|
165
|
+
const t = this.currentPreviewIndex === 0;
|
|
166
|
+
return this._getIconButton(r.PREV_BUTTON, "arrow-back", t);
|
|
167
|
+
}
|
|
168
|
+
_getNextButton() {
|
|
169
|
+
const t = this.currentPreviewIndex >= this.totalTemplates - 1;
|
|
170
|
+
return this._getIconButton(r.NEXT_BUTTON, "arrow-right", t);
|
|
171
|
+
}
|
|
172
|
+
_getCounterText() {
|
|
173
|
+
const e = `Showing ${this.currentPreviewIndex + 1} of ${this.totalTemplates}`;
|
|
174
|
+
return this._getLabel(e, r.COUNTER_TEXT);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
export {
|
|
178
|
+
_ as UNSUBSCRIBE_CONTROL_ID,
|
|
179
|
+
y as UnsubscribeControl
|
|
180
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UIElement } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare const PREVIEW_UI_ELEMENT_ID = "unsubscribe-preview";
|
|
3
|
+
export declare class PreviewUIElement extends UIElement {
|
|
4
|
+
private imgElement?;
|
|
5
|
+
getId(): string;
|
|
6
|
+
getTemplate(): string;
|
|
7
|
+
onRender(container: HTMLElement): void;
|
|
8
|
+
setValue(value: string): void;
|
|
9
|
+
getValue(): string;
|
|
10
|
+
onDestroy(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var o = (i, t, e) => t in i ? m(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var r = (i, t, e) => o(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
5
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
6
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
7
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
8
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
9
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
10
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
11
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
12
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
13
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
14
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
15
|
+
import "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
16
|
+
import { UIElement as n } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js";
|
|
17
|
+
const s = "unsubscribe-preview", E = "width: 100%; max-height: 400px; overflow: hidden; display: flex; align-items: center; justify-content: center;", l = "object-fit: cover; width: 100%; height: auto;", p = "img", c = "Unsubscribe page preview";
|
|
18
|
+
class A extends n {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
r(this, "imgElement");
|
|
22
|
+
}
|
|
23
|
+
getId() {
|
|
24
|
+
return s;
|
|
25
|
+
}
|
|
26
|
+
getTemplate() {
|
|
27
|
+
return `
|
|
28
|
+
<div style="${E}">
|
|
29
|
+
<img
|
|
30
|
+
src=""
|
|
31
|
+
alt="${c}"
|
|
32
|
+
style="${l}"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
37
|
+
onRender(e) {
|
|
38
|
+
this.imgElement = e.querySelector(p);
|
|
39
|
+
}
|
|
40
|
+
setValue(e) {
|
|
41
|
+
console.debug("ui set value", e), this.imgElement && (this.imgElement.src = e);
|
|
42
|
+
}
|
|
43
|
+
getValue() {
|
|
44
|
+
var e;
|
|
45
|
+
return ((e = this.imgElement) == null ? void 0 : e.src) ?? "";
|
|
46
|
+
}
|
|
47
|
+
onDestroy() {
|
|
48
|
+
this.imgElement = void 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
s as PREVIEW_UI_ELEMENT_ID,
|
|
53
|
+
A as PreviewUIElement
|
|
54
|
+
};
|
|
@@ -11,10 +11,11 @@ import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Pre
|
|
|
11
11
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
12
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
13
|
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
14
|
+
import { UnsubscribeBlock as t } from "./block.js";
|
|
15
|
+
import { UnsubscribeControl as r } from "./control.js";
|
|
16
|
+
import { PreviewUIElement as i } from "./elements/preview.js";
|
|
17
|
+
import { SettingsPanel as m } from "./settingsPanel.js";
|
|
18
|
+
const P = new o().addBlock(t).withSettingsPanelRegistry(m).addControl(r).addUiElement(i).build();
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
P as default
|
|
20
21
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SettingsPanelRegistry, SettingsPanelTab } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class SettingsPanel extends SettingsPanelRegistry {
|
|
3
3
|
registerBlockControls(blockControlsMap: Record<string, SettingsPanelTab[]>): void;
|
|
4
4
|
}
|
|
@@ -2,38 +2,31 @@ import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiA
|
|
|
2
2
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
3
3
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
4
4
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
5
|
-
import {
|
|
5
|
+
import { TextControls as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
6
6
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
7
7
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
8
8
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
9
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
10
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import { SettingsTab as
|
|
11
|
+
import { SettingsTab as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
12
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
|
-
import { SettingsPanelRegistry as
|
|
14
|
-
import { SettingsPanelTab as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
class
|
|
18
|
-
registerBlockControls(
|
|
19
|
-
|
|
20
|
-
new
|
|
21
|
-
|
|
13
|
+
import { SettingsPanelRegistry as i } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js";
|
|
14
|
+
import { SettingsPanelTab as m } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js";
|
|
15
|
+
import { UNSUBSCRIBE_BLOCK_ID as e } from "./block.js";
|
|
16
|
+
import { UNSUBSCRIBE_CONTROL_ID as p } from "./control.js";
|
|
17
|
+
class c extends i {
|
|
18
|
+
registerBlockControls(t) {
|
|
19
|
+
t[e] = [
|
|
20
|
+
new m(
|
|
21
|
+
r.SETTINGS,
|
|
22
22
|
[
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
t.DISPLAY_CONDITIONS
|
|
26
|
-
]
|
|
27
|
-
),
|
|
28
|
-
new r(
|
|
29
|
-
o.STYLES,
|
|
30
|
-
[
|
|
31
|
-
m.TEXT_BLOCK_BACKGROUND_COLOR
|
|
23
|
+
p,
|
|
24
|
+
...Object.values(o)
|
|
32
25
|
]
|
|
33
26
|
)
|
|
34
27
|
];
|
|
35
28
|
}
|
|
36
29
|
}
|
|
37
30
|
export {
|
|
38
|
-
|
|
31
|
+
c as SettingsPanel
|
|
39
32
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const migrationTemplate = "\n <td\n esd-extension-block-id=\"unsubscribe-block\"\n class=\"esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block\"\n >\n {-{-TITLE-}-}\n </td>\n";
|
|
2
|
+
export declare function getDefaultTemplate(): string;
|
|
3
|
+
export default migrationTemplate;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Block as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js";
|
|
2
1
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js";
|
|
3
|
-
import
|
|
2
|
+
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
4
3
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
5
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
4
|
+
import { BlockType as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
6
5
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
7
6
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
8
7
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
@@ -11,29 +10,19 @@ import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Pop
|
|
|
11
10
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
12
11
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
13
12
|
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
getName() {
|
|
27
|
-
return this.api.translate("Radio Button Block");
|
|
28
|
-
}
|
|
29
|
-
getDescription() {
|
|
30
|
-
return this.api.translate("Radio Button Block Description");
|
|
31
|
-
}
|
|
32
|
-
getTemplate() {
|
|
33
|
-
return r();
|
|
34
|
-
}
|
|
13
|
+
const t = "unsubscribe", o = "{{ins-unsubscribe-link}}", i = `
|
|
14
|
+
<${r.BLOCK_TEXT} class="unsubscribe-block-v2 esd-block-unsubscribe es-p0" align="center">
|
|
15
|
+
<p>You can <strong><a
|
|
16
|
+
href="${o}"
|
|
17
|
+
class="unsubscribe-link"
|
|
18
|
+
target="_blank"
|
|
19
|
+
data-unsubscribe-link="true"
|
|
20
|
+
>${t}</a></strong> from our emails, if you need to.</p>
|
|
21
|
+
</${r.BLOCK_TEXT}>
|
|
22
|
+
`;
|
|
23
|
+
function E() {
|
|
24
|
+
return i;
|
|
35
25
|
}
|
|
36
26
|
export {
|
|
37
|
-
|
|
38
|
-
D as RadioButtonCustomBlock
|
|
27
|
+
E as getDefaultTemplate
|
|
39
28
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const UNSUBSCRIBE_EVENTS: {
|
|
2
|
+
readonly SELECT: "unsubscribe:select";
|
|
3
|
+
readonly CANCEL: "unsubscribe:cancel";
|
|
4
|
+
};
|
|
5
|
+
export type UnsubscribeEvent = typeof UNSUBSCRIBE_EVENTS[keyof typeof UNSUBSCRIBE_EVENTS];
|
|
6
|
+
export declare const DATA_ATTRIBUTES: {
|
|
7
|
+
readonly PAGE_TYPE: "data-unsubscribe-page-type";
|
|
8
|
+
readonly PAGE_LIST: "data-unsubscribe-page-list";
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a comma-separated list of page IDs into an array of numbers.
|
|
3
|
+
* Filters out invalid values (NaN, empty strings, negative numbers).
|
|
4
|
+
* @param pageList - Comma-separated string of page IDs
|
|
5
|
+
* @returns Array of valid page IDs
|
|
6
|
+
*/
|
|
7
|
+
export declare function parsePageList(pageList: string): number[];
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[data-v-a18ac2d3] .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-a18ac2d3] .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-85d64228],.guido-editor__container[data-v-85d64228]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-85d64228]{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-dda47b76] .guido__verion-history-view-option-selection-desktop svg,[data-v-dda47b76] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dda47b76] .in-segments-wrapper__button_selected,[data-v-dda47b76] .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}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useHttp as t } from "../composables/useHttp.js";
|
|
2
|
+
import { useToaster as n } from "../composables/useToaster.js";
|
|
3
|
+
const u = () => {
|
|
4
|
+
const { get: r } = t(), { handleError: s } = n();
|
|
5
|
+
return { getUnsubscribePages: async () => {
|
|
6
|
+
try {
|
|
7
|
+
const { data: e = [] } = await r("/unsubscribe-pages/get-all");
|
|
8
|
+
return e;
|
|
9
|
+
} catch (e) {
|
|
10
|
+
return s(e, "Failed to fetch unsubscribe pages"), [];
|
|
11
|
+
}
|
|
12
|
+
} };
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
u as useUnsubscribeApi
|
|
16
|
+
};
|