@useinsider/guido 1.0.3-beta.fb2b45b → 1.0.3-beta.ff71e68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/generic.d.ts +0 -9
- package/dist/components/Guido.vue.d.ts +2 -2
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +69 -74
- package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
- package/dist/components/wrappers/WpDrawer.vue.js +4 -6
- package/dist/composables/useStripo.js +13 -17
- package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
- package/dist/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/config/migrator/couponBlockMigrator.js +67 -0
- package/dist/config/migrator/index.d.ts +1 -1
- package/dist/config/migrator/index.js +7 -7
- package/dist/enums/defaults.js +3 -6
- package/dist/enums/unsubscribe.d.ts +0 -19
- package/dist/enums/unsubscribe.js +6 -39
- package/dist/extensions/Blocks/Checkbox/control.js +41 -43
- package/dist/extensions/Blocks/CouponBlock/block.d.ts +12 -0
- package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
- package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/iconsRegistry.d.ts +1 -1
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/settingsPanel.d.ts +1 -1
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
- package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/extensions/Blocks/RadioButton/control.js +23 -25
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +1 -2
- package/dist/stores/unsubscribe.d.ts +5 -253
- package/dist/stores/unsubscribe.js +6 -126
- package/dist/utils/templatePreparation.js +16 -17
- package/package.json +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
- package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
- package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
- package/dist/config/migrator/unsubscribeMigrator.js +0 -124
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
- package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
- package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
- package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
- package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
- package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
- package/dist/services/unsubscribeApi.d.ts +0 -4
- package/dist/services/unsubscribeApi.js +0 -16
- package/dist/stores/config.d.ts +0 -96
- package/dist/stores/config.js +0 -17
- /package/dist/extensions/Blocks/{Unsubscribe → CouponBlock}/extension.d.ts +0 -0
|
@@ -1,256 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
type UnsubscribePage = {
|
|
2
|
+
type: number;
|
|
3
|
+
};
|
|
2
4
|
interface StoreState {
|
|
3
|
-
|
|
4
|
-
selectedTemplates: Record<number, number>;
|
|
5
|
-
selectedUnsubscribePages: number[];
|
|
6
|
-
selectedCollectionType: number;
|
|
7
|
-
activeType: number;
|
|
8
|
-
pageSelectionUpdateStatus: boolean;
|
|
9
|
-
pageSelectionDrawerStatus: boolean;
|
|
10
|
-
typeSelectionDrawerStatus: boolean;
|
|
11
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
12
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
5
|
+
selectedUnsubscribePages: UnsubscribePage[];
|
|
13
6
|
}
|
|
14
|
-
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
|
|
15
|
-
getSelectedCollection: (state: {
|
|
16
|
-
templates: {
|
|
17
|
-
id: number;
|
|
18
|
-
name: string;
|
|
19
|
-
type: number;
|
|
20
|
-
isVisible: number;
|
|
21
|
-
html: string;
|
|
22
|
-
originalHtml: string;
|
|
23
|
-
css: string;
|
|
24
|
-
thumbnail: string;
|
|
25
|
-
createdAt: string;
|
|
26
|
-
updatedAt: string;
|
|
27
|
-
status: number;
|
|
28
|
-
}[];
|
|
29
|
-
selectedTemplates: Record<number, number>;
|
|
30
|
-
selectedUnsubscribePages: number[];
|
|
31
|
-
selectedCollectionType: number;
|
|
32
|
-
activeType: number;
|
|
33
|
-
pageSelectionUpdateStatus: boolean;
|
|
34
|
-
pageSelectionDrawerStatus: boolean;
|
|
35
|
-
typeSelectionDrawerStatus: boolean;
|
|
36
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
37
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
38
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number[];
|
|
39
|
-
getSelectedTemplateByActiveType: (state: {
|
|
40
|
-
templates: {
|
|
41
|
-
id: number;
|
|
42
|
-
name: string;
|
|
43
|
-
type: number;
|
|
44
|
-
isVisible: number;
|
|
45
|
-
html: string;
|
|
46
|
-
originalHtml: string;
|
|
47
|
-
css: string;
|
|
48
|
-
thumbnail: string;
|
|
49
|
-
createdAt: string;
|
|
50
|
-
updatedAt: string;
|
|
51
|
-
status: number;
|
|
52
|
-
}[];
|
|
53
|
-
selectedTemplates: Record<number, number>;
|
|
54
|
-
selectedUnsubscribePages: number[];
|
|
55
|
-
selectedCollectionType: number;
|
|
56
|
-
activeType: number;
|
|
57
|
-
pageSelectionUpdateStatus: boolean;
|
|
58
|
-
pageSelectionDrawerStatus: boolean;
|
|
59
|
-
typeSelectionDrawerStatus: boolean;
|
|
60
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
61
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
62
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number;
|
|
63
|
-
getTemplatesByActiveType: (state: {
|
|
64
|
-
templates: {
|
|
65
|
-
id: number;
|
|
66
|
-
name: string;
|
|
67
|
-
type: number;
|
|
68
|
-
isVisible: number;
|
|
69
|
-
html: string;
|
|
70
|
-
originalHtml: string;
|
|
71
|
-
css: string;
|
|
72
|
-
thumbnail: string;
|
|
73
|
-
createdAt: string;
|
|
74
|
-
updatedAt: string;
|
|
75
|
-
status: number;
|
|
76
|
-
}[];
|
|
77
|
-
selectedTemplates: Record<number, number>;
|
|
78
|
-
selectedUnsubscribePages: number[];
|
|
79
|
-
selectedCollectionType: number;
|
|
80
|
-
activeType: number;
|
|
81
|
-
pageSelectionUpdateStatus: boolean;
|
|
82
|
-
pageSelectionDrawerStatus: boolean;
|
|
83
|
-
typeSelectionDrawerStatus: boolean;
|
|
84
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
85
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
86
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
87
|
-
id: number;
|
|
88
|
-
name: string;
|
|
89
|
-
type: number;
|
|
90
|
-
isVisible: number;
|
|
91
|
-
html: string;
|
|
92
|
-
originalHtml: string;
|
|
93
|
-
css: string;
|
|
94
|
-
thumbnail: string;
|
|
95
|
-
createdAt: string;
|
|
96
|
-
updatedAt: string;
|
|
97
|
-
status: number;
|
|
98
|
-
}[];
|
|
99
|
-
getThumbnailByTemplateId: (state: {
|
|
100
|
-
templates: {
|
|
101
|
-
id: number;
|
|
102
|
-
name: string;
|
|
103
|
-
type: number;
|
|
104
|
-
isVisible: number;
|
|
105
|
-
html: string;
|
|
106
|
-
originalHtml: string;
|
|
107
|
-
css: string;
|
|
108
|
-
thumbnail: string;
|
|
109
|
-
createdAt: string;
|
|
110
|
-
updatedAt: string;
|
|
111
|
-
status: number;
|
|
112
|
-
}[];
|
|
113
|
-
selectedTemplates: Record<number, number>;
|
|
114
|
-
selectedUnsubscribePages: number[];
|
|
115
|
-
selectedCollectionType: number;
|
|
116
|
-
activeType: number;
|
|
117
|
-
pageSelectionUpdateStatus: boolean;
|
|
118
|
-
pageSelectionDrawerStatus: boolean;
|
|
119
|
-
typeSelectionDrawerStatus: boolean;
|
|
120
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
121
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
122
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => (id: number) => string;
|
|
123
|
-
getSelectedUnsubscribePagesByCollection: (state: {
|
|
124
|
-
templates: {
|
|
125
|
-
id: number;
|
|
126
|
-
name: string;
|
|
127
|
-
type: number;
|
|
128
|
-
isVisible: number;
|
|
129
|
-
html: string;
|
|
130
|
-
originalHtml: string;
|
|
131
|
-
css: string;
|
|
132
|
-
thumbnail: string;
|
|
133
|
-
createdAt: string;
|
|
134
|
-
updatedAt: string;
|
|
135
|
-
status: number;
|
|
136
|
-
}[];
|
|
137
|
-
selectedTemplates: Record<number, number>;
|
|
138
|
-
selectedUnsubscribePages: number[];
|
|
139
|
-
selectedCollectionType: number;
|
|
140
|
-
activeType: number;
|
|
141
|
-
pageSelectionUpdateStatus: boolean;
|
|
142
|
-
pageSelectionDrawerStatus: boolean;
|
|
143
|
-
typeSelectionDrawerStatus: boolean;
|
|
144
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
145
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
146
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => (collectionType: number) => number[];
|
|
147
|
-
isActiveTypeFirstInCollection: (state: {
|
|
148
|
-
templates: {
|
|
149
|
-
id: number;
|
|
150
|
-
name: string;
|
|
151
|
-
type: number;
|
|
152
|
-
isVisible: number;
|
|
153
|
-
html: string;
|
|
154
|
-
originalHtml: string;
|
|
155
|
-
css: string;
|
|
156
|
-
thumbnail: string;
|
|
157
|
-
createdAt: string;
|
|
158
|
-
updatedAt: string;
|
|
159
|
-
status: number;
|
|
160
|
-
}[];
|
|
161
|
-
selectedTemplates: Record<number, number>;
|
|
162
|
-
selectedUnsubscribePages: number[];
|
|
163
|
-
selectedCollectionType: number;
|
|
164
|
-
activeType: number;
|
|
165
|
-
pageSelectionUpdateStatus: boolean;
|
|
166
|
-
pageSelectionDrawerStatus: boolean;
|
|
167
|
-
typeSelectionDrawerStatus: boolean;
|
|
168
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
169
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
170
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
171
|
-
isActiveTypeLastInCollection: (state: {
|
|
172
|
-
templates: {
|
|
173
|
-
id: number;
|
|
174
|
-
name: string;
|
|
175
|
-
type: number;
|
|
176
|
-
isVisible: number;
|
|
177
|
-
html: string;
|
|
178
|
-
originalHtml: string;
|
|
179
|
-
css: string;
|
|
180
|
-
thumbnail: string;
|
|
181
|
-
createdAt: string;
|
|
182
|
-
updatedAt: string;
|
|
183
|
-
status: number;
|
|
184
|
-
}[];
|
|
185
|
-
selectedTemplates: Record<number, number>;
|
|
186
|
-
selectedUnsubscribePages: number[];
|
|
187
|
-
selectedCollectionType: number;
|
|
188
|
-
activeType: number;
|
|
189
|
-
pageSelectionUpdateStatus: boolean;
|
|
190
|
-
pageSelectionDrawerStatus: boolean;
|
|
191
|
-
typeSelectionDrawerStatus: boolean;
|
|
192
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
193
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
194
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
195
|
-
hasTemplatesByCollectionType: (state: {
|
|
196
|
-
templates: {
|
|
197
|
-
id: number;
|
|
198
|
-
name: string;
|
|
199
|
-
type: number;
|
|
200
|
-
isVisible: number;
|
|
201
|
-
html: string;
|
|
202
|
-
originalHtml: string;
|
|
203
|
-
css: string;
|
|
204
|
-
thumbnail: string;
|
|
205
|
-
createdAt: string;
|
|
206
|
-
updatedAt: string;
|
|
207
|
-
status: number;
|
|
208
|
-
}[];
|
|
209
|
-
selectedTemplates: Record<number, number>;
|
|
210
|
-
selectedUnsubscribePages: number[];
|
|
211
|
-
selectedCollectionType: number;
|
|
212
|
-
activeType: number;
|
|
213
|
-
pageSelectionUpdateStatus: boolean;
|
|
214
|
-
pageSelectionDrawerStatus: boolean;
|
|
215
|
-
typeSelectionDrawerStatus: boolean;
|
|
216
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
217
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
218
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => Record<number, boolean>;
|
|
219
|
-
unsubscribePagesStatus: (state: {
|
|
220
|
-
templates: {
|
|
221
|
-
id: number;
|
|
222
|
-
name: string;
|
|
223
|
-
type: number;
|
|
224
|
-
isVisible: number;
|
|
225
|
-
html: string;
|
|
226
|
-
originalHtml: string;
|
|
227
|
-
css: string;
|
|
228
|
-
thumbnail: string;
|
|
229
|
-
createdAt: string;
|
|
230
|
-
updatedAt: string;
|
|
231
|
-
status: number;
|
|
232
|
-
}[];
|
|
233
|
-
selectedTemplates: Record<number, number>;
|
|
234
|
-
selectedUnsubscribePages: number[];
|
|
235
|
-
selectedCollectionType: number;
|
|
236
|
-
activeType: number;
|
|
237
|
-
pageSelectionUpdateStatus: boolean;
|
|
238
|
-
pageSelectionDrawerStatus: boolean;
|
|
239
|
-
typeSelectionDrawerStatus: boolean;
|
|
240
|
-
isGlobalUnsubscribeDisabled: boolean;
|
|
241
|
-
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
242
|
-
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
243
|
-
}, {
|
|
244
|
-
$reset(): void;
|
|
245
|
-
fetchTemplates(): Promise<void>;
|
|
246
|
-
setCollection(collectionType: number): void;
|
|
247
|
-
setCollectionWithoutAutoSelection(collectionType: number): void;
|
|
248
|
-
setSelectedTemplate(template: number): void;
|
|
249
|
-
setNextType(): void;
|
|
250
|
-
setPreviousType(): void;
|
|
251
|
-
loadSelectedTemplates(templates: number[]): void;
|
|
252
|
-
getSelectedTemplatesByCollection(type: number): number[];
|
|
253
|
-
addUnsubscribePages(pageIds: number[]): void;
|
|
254
|
-
removeUnsubscribePages(pageIds: number[]): void;
|
|
255
|
-
}>;
|
|
7
|
+
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {}, {}>;
|
|
256
8
|
export {};
|
|
@@ -1,129 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
selectedTemplates: {},
|
|
7
|
-
selectedUnsubscribePages: [],
|
|
8
|
-
selectedCollectionType: a.GLOBAL_UNSUBSCRIBE,
|
|
9
|
-
activeType: a.GLOBAL_UNSUBSCRIBE,
|
|
10
|
-
pageSelectionUpdateStatus: !1,
|
|
11
|
-
pageSelectionDrawerStatus: !1,
|
|
12
|
-
typeSelectionDrawerStatus: !1,
|
|
13
|
-
isGlobalUnsubscribeDisabled: !1,
|
|
14
|
-
isSubscriptionPreferencesCenterDisabled: !1
|
|
15
|
-
}), g = d("unsubscribe", {
|
|
16
|
-
state: () => p(),
|
|
17
|
-
getters: {
|
|
18
|
-
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
19
|
-
getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
|
|
20
|
-
getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
|
|
21
|
-
getThumbnailByTemplateId: (e) => (t) => {
|
|
22
|
-
var c;
|
|
23
|
-
return ((c = e.templates.find((s) => s.id === t)) == null ? void 0 : c.thumbnail) ?? "";
|
|
24
|
-
},
|
|
25
|
-
getSelectedUnsubscribePagesByCollection: (e) => (t) => {
|
|
26
|
-
const c = i[t];
|
|
27
|
-
if (!c)
|
|
28
|
-
return [];
|
|
29
|
-
const s = /* @__PURE__ */ new Map();
|
|
30
|
-
e.templates.forEach((n) => {
|
|
31
|
-
s.set(n.id, n.type);
|
|
32
|
-
});
|
|
33
|
-
const l = new Set(c);
|
|
34
|
-
return e.selectedUnsubscribePages.filter((n) => {
|
|
35
|
-
const o = s.get(n);
|
|
36
|
-
return o !== void 0 && l.has(o);
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
isActiveTypeFirstInCollection: (e) => {
|
|
40
|
-
const t = i[e.selectedCollectionType];
|
|
41
|
-
return e.activeType === t[0];
|
|
42
|
-
},
|
|
43
|
-
isActiveTypeLastInCollection: (e) => {
|
|
44
|
-
const t = i[e.selectedCollectionType];
|
|
45
|
-
return e.activeType === t[t.length - 1];
|
|
46
|
-
},
|
|
47
|
-
hasTemplatesByCollectionType: (e) => {
|
|
48
|
-
const t = {};
|
|
49
|
-
return i[e.selectedCollectionType].forEach((s) => {
|
|
50
|
-
t[s] = e.templates.some((l) => l.type === s);
|
|
51
|
-
}), t;
|
|
52
|
-
},
|
|
53
|
-
unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
|
|
54
|
-
},
|
|
55
|
-
actions: {
|
|
56
|
-
$reset() {
|
|
57
|
-
const { templates: e, selectedUnsubscribePages: t } = this;
|
|
58
|
-
Object.assign(this, {
|
|
59
|
-
...p(),
|
|
60
|
-
templates: e,
|
|
61
|
-
selectedUnsubscribePages: t
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
async fetchTemplates() {
|
|
65
|
-
if (this.templates.length)
|
|
66
|
-
return;
|
|
67
|
-
const { getUnsubscribePages: e } = r(), t = await e();
|
|
68
|
-
this.templates = t;
|
|
69
|
-
},
|
|
70
|
-
setCollection(e) {
|
|
71
|
-
this.selectedCollectionType = e;
|
|
72
|
-
const t = i[e];
|
|
73
|
-
if (t && t.length > 0) {
|
|
74
|
-
[this.activeType] = t;
|
|
75
|
-
const c = { ...this.selectedTemplates };
|
|
76
|
-
t.forEach((s) => {
|
|
77
|
-
if (!c[s]) {
|
|
78
|
-
const l = this.templates.find((n) => n.type === s);
|
|
79
|
-
l && (c[s] = l.id);
|
|
80
|
-
}
|
|
81
|
-
}), this.selectedTemplates = c;
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
setCollectionWithoutAutoSelection(e) {
|
|
85
|
-
this.selectedCollectionType = e;
|
|
86
|
-
const t = i[e];
|
|
87
|
-
t && t.length > 0 && ([this.activeType] = t);
|
|
88
|
-
},
|
|
89
|
-
setSelectedTemplate(e) {
|
|
90
|
-
this.selectedTemplates = {
|
|
91
|
-
...this.selectedTemplates,
|
|
92
|
-
[this.activeType]: e
|
|
93
|
-
};
|
|
94
|
-
},
|
|
95
|
-
setNextType() {
|
|
96
|
-
const t = this.getSelectedCollection.indexOf(this.activeType) + 1;
|
|
97
|
-
t < this.getSelectedCollection.length && (this.activeType = this.getSelectedCollection[t]);
|
|
98
|
-
},
|
|
99
|
-
setPreviousType() {
|
|
100
|
-
const t = this.getSelectedCollection.indexOf(this.activeType) - 1;
|
|
101
|
-
t >= 0 && (this.activeType = this.getSelectedCollection[t]);
|
|
102
|
-
},
|
|
103
|
-
loadSelectedTemplates(e) {
|
|
104
|
-
const t = new Map(this.templates.map((s) => [s.id, s.type])), c = { ...this.selectedTemplates };
|
|
105
|
-
e.forEach((s) => {
|
|
106
|
-
const l = t.get(s);
|
|
107
|
-
l !== void 0 && (c[l] = s);
|
|
108
|
-
}), this.selectedTemplates = c;
|
|
109
|
-
},
|
|
110
|
-
getSelectedTemplatesByCollection(e) {
|
|
111
|
-
const t = i[e], c = [];
|
|
112
|
-
return t.forEach((s) => {
|
|
113
|
-
this.selectedTemplates[s] && c.push(this.selectedTemplates[s]);
|
|
114
|
-
}), c;
|
|
115
|
-
},
|
|
116
|
-
addUnsubscribePages(e) {
|
|
117
|
-
const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
|
|
118
|
-
this.selectedUnsubscribePages = Array.from(t);
|
|
119
|
-
},
|
|
120
|
-
removeUnsubscribePages(e) {
|
|
121
|
-
this.selectedUnsubscribePages = this.selectedUnsubscribePages.filter(
|
|
122
|
-
(t) => !e.includes(t)
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
1
|
+
import { defineStore as e } from "pinia";
|
|
2
|
+
const t = () => ({
|
|
3
|
+
selectedUnsubscribePages: []
|
|
4
|
+
}), r = e("unsubscribe", {
|
|
5
|
+
state: () => t()
|
|
126
6
|
});
|
|
127
7
|
export {
|
|
128
|
-
|
|
8
|
+
r as useUnsubscribeStore
|
|
129
9
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
1
|
+
import { useActionsApi as g } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as S } from "../composables/useHtmlCompiler.js";
|
|
3
3
|
import { useDynamicContentStore as f } from "../stores/dynamic-content.js";
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const i = f(), t = C(), { getCompiledEmail: o, getTemplateData: s } = S(), { compileHtml: n } = b();
|
|
4
|
+
const H = () => {
|
|
5
|
+
const t = f(), { getCompiledEmail: i, getTemplateData: o } = g(), { compileHtml: n } = S();
|
|
7
6
|
return {
|
|
8
7
|
prepareTemplateDetails: async () => {
|
|
9
|
-
const { html: a, ampHtml:
|
|
8
|
+
const { html: a, ampHtml: s = "", ampErrors: m = [] } = await i({
|
|
10
9
|
minimize: !0,
|
|
11
10
|
resetDataSavedFlag: !1
|
|
12
|
-
}), { html:
|
|
11
|
+
}), { html: r, css: c, syncModulesIds: l = [] } = await o(), { compiledHtml: p, stats: e, appliedRules: d } = n(a), u = t.getSelectedDynamicContentList;
|
|
13
12
|
return console.debug("HTML Compilation Stats:", {
|
|
14
13
|
originalSize: e.originalSize,
|
|
15
14
|
compiledSize: e.compiledSize,
|
|
@@ -17,25 +16,25 @@ const z = () => {
|
|
|
17
16
|
appliedRules: d,
|
|
18
17
|
executionTime: `${e.executionTime.toFixed(2)}ms`
|
|
19
18
|
}), {
|
|
20
|
-
dynamicContentList:
|
|
21
|
-
compiledHtml:
|
|
22
|
-
rawHtml:
|
|
23
|
-
css:
|
|
24
|
-
ampHtml:
|
|
25
|
-
ampErrors:
|
|
26
|
-
modules:
|
|
19
|
+
dynamicContentList: u,
|
|
20
|
+
compiledHtml: p,
|
|
21
|
+
rawHtml: r,
|
|
22
|
+
css: c,
|
|
23
|
+
ampHtml: s,
|
|
24
|
+
ampErrors: m,
|
|
25
|
+
modules: l,
|
|
27
26
|
recommendation: {
|
|
28
27
|
campaignUrls: {},
|
|
29
28
|
configs: {}
|
|
30
29
|
},
|
|
31
30
|
unsubscribe: {
|
|
32
|
-
status:
|
|
33
|
-
config:
|
|
31
|
+
status: !1,
|
|
32
|
+
config: []
|
|
34
33
|
}
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
38
|
export {
|
|
40
|
-
|
|
39
|
+
H as useTemplatePreparation
|
|
41
40
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.3-beta.
|
|
3
|
+
"version": "1.0.3-beta.ff71e68",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import s from "./UnsubscribeBreadcrumb.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var o = function() {
|
|
5
|
-
var e = this, t = e._self._c, r = e._self._setupProxy;
|
|
6
|
-
return t(r.InBreadcrumb, { staticClass: "c-p", attrs: { "without-router": "", "active-tab": r.unsubscribeStore.activeType, "home-icon": !1, list: r.breadcrumbs, routes: [] }, on: { click: r.navigate } });
|
|
7
|
-
}, c = [], n = /* @__PURE__ */ a(
|
|
8
|
-
s,
|
|
9
|
-
o,
|
|
10
|
-
c,
|
|
11
|
-
!1,
|
|
12
|
-
null,
|
|
13
|
-
"70835920"
|
|
14
|
-
);
|
|
15
|
-
const f = n.exports;
|
|
16
|
-
export {
|
|
17
|
-
f as default
|
|
18
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineComponent as o, computed as n } from "vue";
|
|
2
|
-
import { TYPE_TRANSLATIONS as s } from "../../../enums/unsubscribe.js";
|
|
3
|
-
import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
|
|
4
|
-
import { InBreadcrumb as m } from "@useinsider/design-system-vue";
|
|
5
|
-
const f = /* @__PURE__ */ o({
|
|
6
|
-
__name: "UnsubscribeBreadcrumb",
|
|
7
|
-
setup(a) {
|
|
8
|
-
const r = c(), t = n(() => r.getSelectedCollection.map((e) => ({ value: e, text: s[e] })));
|
|
9
|
-
return { __sfc: !0, unsubscribeStore: r, breadcrumbs: t, navigate: (e) => {
|
|
10
|
-
r.activeType = e.value;
|
|
11
|
-
}, InBreadcrumb: m };
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
export {
|
|
15
|
-
f as default
|
|
16
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import a from "./UnsubscribePageSelection.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var o = function() {
|
|
5
|
-
var r = this, e = r._self._c, t = r._self._setupProxy;
|
|
6
|
-
return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.closeModal, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
|
|
7
|
-
return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
|
|
8
|
-
}, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
|
|
9
|
-
return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
|
|
10
|
-
return t.selectTemplate(s.id);
|
|
11
|
-
} } }, [e(t.InContainer, { staticClass: "template-container o-h", class: { selected: t.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: t.getBorderClass(s.id) } }, [e("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [e("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })])]), e("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
|
|
12
|
-
}), 0)]);
|
|
13
|
-
}, i = [], c = /* @__PURE__ */ n(
|
|
14
|
-
a,
|
|
15
|
-
o,
|
|
16
|
-
i,
|
|
17
|
-
!1,
|
|
18
|
-
null,
|
|
19
|
-
"a86fc486"
|
|
20
|
-
);
|
|
21
|
-
const _ = c.exports;
|
|
22
|
-
export {
|
|
23
|
-
_ as default
|
|
24
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { defineComponent as f, ref as y, computed as n, watch as T } from "vue";
|
|
2
|
-
import g from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
-
import { useToaster as S } from "../../../composables/useToaster.js";
|
|
4
|
-
import { useTranslations as v } from "../../../composables/useTranslations.js";
|
|
5
|
-
import { ToasterTypeOptions as B } from "../../../enums/toaster.js";
|
|
6
|
-
import { useUnsubscribeStore as w } from "../../../stores/unsubscribe.js";
|
|
7
|
-
import { InContainer as C } from "@useinsider/design-system-vue";
|
|
8
|
-
import h from "./UnsubscribeBreadcrumb.vue.js";
|
|
9
|
-
const E = /* @__PURE__ */ f({
|
|
10
|
-
__name: "UnsubscribePageSelection",
|
|
11
|
-
setup(_) {
|
|
12
|
-
const s = v(), e = w(), { showToaster: a } = S(), o = y(!1), c = n(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = n(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), p = n(() => ({
|
|
13
|
-
primaryButton: {
|
|
14
|
-
styling: "solid",
|
|
15
|
-
type: "primary",
|
|
16
|
-
labelText: c.value,
|
|
17
|
-
loadingStatus: o.value,
|
|
18
|
-
disabledStatus: !1
|
|
19
|
-
},
|
|
20
|
-
cancelOrBackButton: {
|
|
21
|
-
styling: "ghost",
|
|
22
|
-
type: "secondary",
|
|
23
|
-
labelText: i.value,
|
|
24
|
-
disabledStatus: o.value
|
|
25
|
-
}
|
|
26
|
-
})), u = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", r = (t) => {
|
|
27
|
-
e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
|
|
28
|
-
t();
|
|
29
|
-
}, 500);
|
|
30
|
-
}, m = () => {
|
|
31
|
-
if (e.isActiveTypeFirstInCollection) {
|
|
32
|
-
r(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
e.setPreviousType();
|
|
36
|
-
}, d = () => {
|
|
37
|
-
if (e.isActiveTypeLastInCollection) {
|
|
38
|
-
o.value = !0;
|
|
39
|
-
const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t);
|
|
40
|
-
e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
|
|
41
|
-
detail: {
|
|
42
|
-
collectionType: t,
|
|
43
|
-
selectedPages: l
|
|
44
|
-
}
|
|
45
|
-
})), r(() => {
|
|
46
|
-
o.value = !1, a({
|
|
47
|
-
type: B.Success,
|
|
48
|
-
message: s("global-unsubscribe.pages-were-attached")
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
e.setNextType();
|
|
54
|
-
}, b = (t) => {
|
|
55
|
-
e.setSelectedTemplate(t);
|
|
56
|
-
};
|
|
57
|
-
return T(() => e.pageSelectionDrawerStatus, (t) => {
|
|
58
|
-
t && e.pageSelectionUpdateStatus && e.fetchTemplates();
|
|
59
|
-
}), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: p, getBorderClass: u, closeModal: r, handleBack: m, handleSave: d, selectTemplate: b, WpDrawer: g, InContainer: C, UnsubscribeBreadcrumb: h };
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
export {
|
|
63
|
-
E as default
|
|
64
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
-
export default _default;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import n from "./UnsubscribeTypeSelection.vue2.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var i = function() {
|
|
5
|
-
var e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
|
-
return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.changeCollection } })], 1);
|
|
7
|
-
}, r = [], c = /* @__PURE__ */ o(
|
|
8
|
-
n,
|
|
9
|
-
i,
|
|
10
|
-
r,
|
|
11
|
-
!1,
|
|
12
|
-
null,
|
|
13
|
-
"dd57102d"
|
|
14
|
-
);
|
|
15
|
-
const d = c.exports;
|
|
16
|
-
export {
|
|
17
|
-
d as default
|
|
18
|
-
};
|