@useinsider/guido 2.1.0-beta.3c99b16 → 2.1.0-beta.3cb52f1
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/organisms/base/Toaster.vue.js +4 -4
- package/dist/components/organisms/base/Toaster.vue2.js +12 -9
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
- package/dist/composables/useStripo.js +25 -23
- package/dist/composables/useVersionHistoryApi.js +1 -1
- package/dist/config/i18n/en/index.js +11 -0
- package/dist/config/i18n/en/labels.json.js +7 -0
- package/dist/config/i18n/en/toasters.json.js +56 -0
- package/dist/config/i18n/en/tooltips.json.js +82 -0
- package/dist/config/i18n/index.js +7 -0
- package/dist/config/migrator/itemsBlockMigrator.js +65 -64
- package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
- package/dist/guido.css +1 -1
- package/dist/src/config/i18n/en/index.d.ts +1 -0
- package/dist/src/config/i18n/index.d.ts +16 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/static/styles/components/notification.css.js +18 -0
- package/dist/static/styles/components/tools.css.js +6 -2
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/unsubscribe.js +37 -34
- package/package.json +1 -1
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { TYPE_COLLECTIONS as i, PAGE_TYPES as
|
|
2
|
-
import { useUnsubscribeApi as
|
|
3
|
-
import { defineStore as
|
|
4
|
-
|
|
1
|
+
import { TYPE_COLLECTIONS as i, PAGE_TYPES as p } from "../enums/unsubscribe.js";
|
|
2
|
+
import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
|
|
3
|
+
import { defineStore as h } from "pinia";
|
|
4
|
+
let o = null;
|
|
5
|
+
const r = () => ({
|
|
5
6
|
templates: [],
|
|
6
7
|
selectedTemplates: {},
|
|
7
8
|
selectedUnsubscribePages: [],
|
|
8
|
-
selectedCollectionType:
|
|
9
|
-
activeType:
|
|
9
|
+
selectedCollectionType: p.GLOBAL_UNSUBSCRIBE,
|
|
10
|
+
activeType: p.GLOBAL_UNSUBSCRIBE,
|
|
10
11
|
pageSelectionUpdateStatus: !1,
|
|
11
12
|
pageSelectionDrawerStatus: !1,
|
|
12
13
|
typeSelectionDrawerStatus: !1,
|
|
13
14
|
isGlobalUnsubscribeDisabled: !1,
|
|
14
15
|
isSubscriptionPreferencesCenterDisabled: !1
|
|
15
|
-
}),
|
|
16
|
-
state: () =>
|
|
16
|
+
}), b = h("guidoUnsubscribe", {
|
|
17
|
+
state: () => r(),
|
|
17
18
|
getters: {
|
|
18
19
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
19
20
|
getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
|
|
20
21
|
getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
|
|
21
22
|
getThumbnailByTemplateId: (e) => (t) => {
|
|
22
|
-
var
|
|
23
|
-
return ((
|
|
23
|
+
var l;
|
|
24
|
+
return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
|
|
24
25
|
},
|
|
25
26
|
getSelectedUnsubscribePagesByCollection: (e) => (t) => {
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
27
|
+
const l = i[t];
|
|
28
|
+
if (!l)
|
|
28
29
|
return [];
|
|
29
30
|
const s = /* @__PURE__ */ new Map();
|
|
30
31
|
e.templates.forEach((n) => {
|
|
31
32
|
s.set(n.id, n.type);
|
|
32
33
|
});
|
|
33
|
-
const
|
|
34
|
+
const c = new Set(l);
|
|
34
35
|
return e.selectedUnsubscribePages.filter((n) => {
|
|
35
|
-
const
|
|
36
|
-
return
|
|
36
|
+
const a = s.get(n);
|
|
37
|
+
return a !== void 0 && c.has(a);
|
|
37
38
|
});
|
|
38
39
|
},
|
|
39
40
|
isActiveTypeFirstInCollection: (e) => {
|
|
@@ -47,7 +48,7 @@ const p = () => ({
|
|
|
47
48
|
hasTemplatesByCollectionType: (e) => {
|
|
48
49
|
const t = {};
|
|
49
50
|
return i[e.selectedCollectionType].forEach((s) => {
|
|
50
|
-
t[s] = e.templates.some((
|
|
51
|
+
t[s] = e.templates.some((c) => c.type === s);
|
|
51
52
|
}), t;
|
|
52
53
|
},
|
|
53
54
|
unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
|
|
@@ -56,29 +57,31 @@ const p = () => ({
|
|
|
56
57
|
$reset() {
|
|
57
58
|
const { templates: e, selectedUnsubscribePages: t } = this;
|
|
58
59
|
Object.assign(this, {
|
|
59
|
-
...
|
|
60
|
+
...r(),
|
|
60
61
|
templates: e,
|
|
61
62
|
selectedUnsubscribePages: t
|
|
62
63
|
});
|
|
63
64
|
},
|
|
64
65
|
async fetchTemplates() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
this.templates.length || (o || (o = (async () => {
|
|
67
|
+
const { getUnsubscribePages: e } = d();
|
|
68
|
+
this.templates = await e();
|
|
69
|
+
})().finally(() => {
|
|
70
|
+
o = null;
|
|
71
|
+
})), await o);
|
|
69
72
|
},
|
|
70
73
|
setCollection(e) {
|
|
71
74
|
this.selectedCollectionType = e;
|
|
72
75
|
const t = i[e];
|
|
73
76
|
if (t && t.length > 0) {
|
|
74
77
|
[this.activeType] = t;
|
|
75
|
-
const
|
|
78
|
+
const l = { ...this.selectedTemplates };
|
|
76
79
|
t.forEach((s) => {
|
|
77
|
-
if (!
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
+
if (!l[s]) {
|
|
81
|
+
const c = this.templates.find((n) => n.type === s);
|
|
82
|
+
c && (l[s] = c.id);
|
|
80
83
|
}
|
|
81
|
-
}), this.selectedTemplates =
|
|
84
|
+
}), this.selectedTemplates = l;
|
|
82
85
|
}
|
|
83
86
|
},
|
|
84
87
|
setCollectionWithoutAutoSelection(e) {
|
|
@@ -101,17 +104,17 @@ const p = () => ({
|
|
|
101
104
|
t >= 0 && (this.activeType = this.getSelectedCollection[t]);
|
|
102
105
|
},
|
|
103
106
|
loadSelectedTemplates(e) {
|
|
104
|
-
const t = new Map(this.templates.map((s) => [s.id, s.type])),
|
|
107
|
+
const t = new Map(this.templates.map((s) => [s.id, s.type])), l = { ...this.selectedTemplates };
|
|
105
108
|
e.forEach((s) => {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
}), this.selectedTemplates =
|
|
109
|
+
const c = t.get(s);
|
|
110
|
+
c !== void 0 && (l[c] = s);
|
|
111
|
+
}), this.selectedTemplates = l;
|
|
109
112
|
},
|
|
110
113
|
getSelectedTemplatesByCollection(e) {
|
|
111
|
-
const t = i[e],
|
|
114
|
+
const t = i[e], l = [];
|
|
112
115
|
return t.forEach((s) => {
|
|
113
|
-
this.selectedTemplates[s] &&
|
|
114
|
-
}),
|
|
116
|
+
this.selectedTemplates[s] && l.push(this.selectedTemplates[s]);
|
|
117
|
+
}), l;
|
|
115
118
|
},
|
|
116
119
|
addUnsubscribePages(e) {
|
|
117
120
|
const t = /* @__PURE__ */ new Set([...this.selectedUnsubscribePages, ...e]);
|
|
@@ -125,5 +128,5 @@ const p = () => ({
|
|
|
125
128
|
}
|
|
126
129
|
});
|
|
127
130
|
export {
|
|
128
|
-
|
|
131
|
+
b as useUnsubscribeStore
|
|
129
132
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.3cb52f1",
|
|
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",
|