@useinsider/guido 3.21.2-beta.bb1c5dd → 3.21.2-beta.ccc7173
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/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
- package/dist/guido.css +1 -1
- package/dist/src/stores/unsubscribe.d.ts +10 -0
- package/dist/stores/unsubscribe.js +28 -24
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import a from "./UnsubscribePageSelection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
4
|
+
var i = function() {
|
|
5
5
|
var r = this, e = r._self._c, t = r._self._setupProxy;
|
|
6
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.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
|
|
7
7
|
return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
|
|
8
8
|
}, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
|
|
9
9
|
return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
|
|
10
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);
|
|
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) + " "), s.isDefault ? e(t.InChips, { staticClass: "ml-2", attrs: { id: "guido__unsubscribe-default-chip", styles: "stroke", value: "default", "close-button": !1, interactive: !1, text: t.trans("unsubscription-preference.default") } }) : r._e()], 1)], 1);
|
|
12
12
|
}), 0)]);
|
|
13
|
-
},
|
|
13
|
+
}, o = [], c = /* @__PURE__ */ n(
|
|
14
14
|
a,
|
|
15
|
-
o,
|
|
16
15
|
i,
|
|
16
|
+
o,
|
|
17
17
|
!1,
|
|
18
18
|
null,
|
|
19
|
-
"
|
|
19
|
+
"bdc41157"
|
|
20
20
|
);
|
|
21
21
|
const _ = c.exports;
|
|
22
22
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as y, ref as T, computed as a, watch as v } from "vue";
|
|
2
2
|
import w from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
3
|
+
import { useToaster as C } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as B } from "../../../composables/useTranslations.js";
|
|
5
5
|
import { ToasterTypeOptions as h } from "../../../enums/toaster.js";
|
|
6
6
|
import { useEditorStore as P } from "../../../stores/editor.js";
|
|
7
7
|
import { useUnsubscribeStore as U } from "../../../stores/unsubscribe.js";
|
|
8
|
-
import { InContainer as _ } from "@useinsider/design-system-vue";
|
|
9
|
-
import
|
|
10
|
-
const
|
|
8
|
+
import { InContainer as I, InChips as _ } from "@useinsider/design-system-vue";
|
|
9
|
+
import x from "./UnsubscribeBreadcrumb.vue.js";
|
|
10
|
+
const W = /* @__PURE__ */ y({
|
|
11
11
|
__name: "UnsubscribePageSelection",
|
|
12
|
-
setup(
|
|
13
|
-
const s =
|
|
12
|
+
setup(A) {
|
|
13
|
+
const s = B(), e = U(), r = P(), { showToaster: c } = C(), o = T(!1), i = a(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), l = a(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), p = a(() => ({
|
|
14
14
|
primaryButton: {
|
|
15
15
|
styling: "solid",
|
|
16
16
|
type: "primary",
|
|
@@ -63,9 +63,9 @@ const N = /* @__PURE__ */ y({
|
|
|
63
63
|
};
|
|
64
64
|
return v(() => e.pageSelectionDrawerStatus, (t) => {
|
|
65
65
|
t && e.pageSelectionUpdateStatus && e.fetchTemplates();
|
|
66
|
-
}), { __sfc: !0, trans: s, unsubscribeStore: e, editorStore: r, showToaster: c, isApplying: o, getPrimaryButtonText: i, getCancelOrBackButtonText: l, footerButtonGroupOptions: p, getBorderClass: d, closeModal: n, handleClose: m, handleBack: b, handleSave: f, selectTemplate: g, WpDrawer: w,
|
|
66
|
+
}), { __sfc: !0, trans: s, unsubscribeStore: e, editorStore: r, showToaster: c, isApplying: o, getPrimaryButtonText: i, getCancelOrBackButtonText: l, footerButtonGroupOptions: p, getBorderClass: d, closeModal: n, handleClose: m, handleBack: b, handleSave: f, selectTemplate: g, WpDrawer: w, InChips: _, InContainer: I, UnsubscribeBreadcrumb: x };
|
|
67
67
|
}
|
|
68
68
|
});
|
|
69
69
|
export {
|
|
70
|
-
|
|
70
|
+
W as default
|
|
71
71
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-c5146fc5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-c5146fc5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-c5146fc5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-bdc41157]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-bdc41157]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-bdc41157]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-bdc41157]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-bdc41157]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
|
@@ -26,6 +26,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
26
26
|
createdAt: string;
|
|
27
27
|
updatedAt: string;
|
|
28
28
|
status: number;
|
|
29
|
+
isDefault?: boolean | undefined;
|
|
29
30
|
}[];
|
|
30
31
|
selectedTemplates: Record<number, number>;
|
|
31
32
|
selectedUnsubscribePages: number[];
|
|
@@ -51,6 +52,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
51
52
|
createdAt: string;
|
|
52
53
|
updatedAt: string;
|
|
53
54
|
status: number;
|
|
55
|
+
isDefault?: boolean | undefined;
|
|
54
56
|
}[];
|
|
55
57
|
selectedTemplates: Record<number, number>;
|
|
56
58
|
selectedUnsubscribePages: number[];
|
|
@@ -76,6 +78,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
76
78
|
createdAt: string;
|
|
77
79
|
updatedAt: string;
|
|
78
80
|
status: number;
|
|
81
|
+
isDefault?: boolean | undefined;
|
|
79
82
|
}[];
|
|
80
83
|
selectedTemplates: Record<number, number>;
|
|
81
84
|
selectedUnsubscribePages: number[];
|
|
@@ -99,6 +102,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
99
102
|
createdAt: string;
|
|
100
103
|
updatedAt: string;
|
|
101
104
|
status: number;
|
|
105
|
+
isDefault?: boolean | undefined;
|
|
102
106
|
}[];
|
|
103
107
|
getThumbnailByTemplateId: (state: {
|
|
104
108
|
templates: {
|
|
@@ -113,6 +117,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
113
117
|
createdAt: string;
|
|
114
118
|
updatedAt: string;
|
|
115
119
|
status: number;
|
|
120
|
+
isDefault?: boolean | undefined;
|
|
116
121
|
}[];
|
|
117
122
|
selectedTemplates: Record<number, number>;
|
|
118
123
|
selectedUnsubscribePages: number[];
|
|
@@ -138,6 +143,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
138
143
|
createdAt: string;
|
|
139
144
|
updatedAt: string;
|
|
140
145
|
status: number;
|
|
146
|
+
isDefault?: boolean | undefined;
|
|
141
147
|
}[];
|
|
142
148
|
selectedTemplates: Record<number, number>;
|
|
143
149
|
selectedUnsubscribePages: number[];
|
|
@@ -163,6 +169,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
163
169
|
createdAt: string;
|
|
164
170
|
updatedAt: string;
|
|
165
171
|
status: number;
|
|
172
|
+
isDefault?: boolean | undefined;
|
|
166
173
|
}[];
|
|
167
174
|
selectedTemplates: Record<number, number>;
|
|
168
175
|
selectedUnsubscribePages: number[];
|
|
@@ -188,6 +195,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
188
195
|
createdAt: string;
|
|
189
196
|
updatedAt: string;
|
|
190
197
|
status: number;
|
|
198
|
+
isDefault?: boolean | undefined;
|
|
191
199
|
}[];
|
|
192
200
|
selectedTemplates: Record<number, number>;
|
|
193
201
|
selectedUnsubscribePages: number[];
|
|
@@ -213,6 +221,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
213
221
|
createdAt: string;
|
|
214
222
|
updatedAt: string;
|
|
215
223
|
status: number;
|
|
224
|
+
isDefault?: boolean | undefined;
|
|
216
225
|
}[];
|
|
217
226
|
selectedTemplates: Record<number, number>;
|
|
218
227
|
selectedUnsubscribePages: number[];
|
|
@@ -238,6 +247,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
238
247
|
createdAt: string;
|
|
239
248
|
updatedAt: string;
|
|
240
249
|
status: number;
|
|
250
|
+
isDefault?: boolean | undefined;
|
|
241
251
|
}[];
|
|
242
252
|
selectedTemplates: Record<number, number>;
|
|
243
253
|
selectedUnsubscribePages: number[];
|
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
import { TYPE_COLLECTIONS as
|
|
1
|
+
import { TYPE_COLLECTIONS as c, PAGE_TYPES as r } from "../enums/unsubscribe.js";
|
|
2
2
|
import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
|
|
3
3
|
import { defineStore as u } from "pinia";
|
|
4
4
|
let o = null;
|
|
5
|
-
const
|
|
5
|
+
const p = () => ({
|
|
6
6
|
templates: [],
|
|
7
7
|
selectedTemplates: {},
|
|
8
8
|
selectedUnsubscribePages: [],
|
|
9
|
-
selectedCollectionType:
|
|
10
|
-
activeType:
|
|
9
|
+
selectedCollectionType: r.GLOBAL_UNSUBSCRIBE,
|
|
10
|
+
activeType: r.GLOBAL_UNSUBSCRIBE,
|
|
11
11
|
pageSelectionUpdateStatus: !1,
|
|
12
12
|
pageSelectionDrawerStatus: !1,
|
|
13
13
|
typeSelectionDrawerStatus: !1,
|
|
14
14
|
isGlobalUnsubscribeDisabled: !1,
|
|
15
15
|
isSubscriptionPreferencesCenterDisabled: !1,
|
|
16
16
|
pendingBlockId: null
|
|
17
|
-
})
|
|
18
|
-
|
|
17
|
+
});
|
|
18
|
+
function h(e) {
|
|
19
|
+
return [...e].sort((t, l) => +!!l.isDefault - +!!t.isDefault);
|
|
20
|
+
}
|
|
21
|
+
const f = u("guidoUnsubscribe", {
|
|
22
|
+
state: () => p(),
|
|
19
23
|
getters: {
|
|
20
|
-
getSelectedCollection: (e) =>
|
|
24
|
+
getSelectedCollection: (e) => c[e.selectedCollectionType],
|
|
21
25
|
getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
|
|
22
26
|
getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
|
|
23
27
|
getThumbnailByTemplateId: (e) => (t) => {
|
|
@@ -25,31 +29,31 @@ const r = () => ({
|
|
|
25
29
|
return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
|
|
26
30
|
},
|
|
27
31
|
getSelectedUnsubscribePagesByCollection: (e) => (t) => {
|
|
28
|
-
const l =
|
|
32
|
+
const l = c[t];
|
|
29
33
|
if (!l)
|
|
30
34
|
return [];
|
|
31
35
|
const s = /* @__PURE__ */ new Map();
|
|
32
36
|
e.templates.forEach((n) => {
|
|
33
37
|
s.set(n.id, n.type);
|
|
34
38
|
});
|
|
35
|
-
const
|
|
39
|
+
const i = new Set(l);
|
|
36
40
|
return e.selectedUnsubscribePages.filter((n) => {
|
|
37
41
|
const a = s.get(n);
|
|
38
|
-
return a !== void 0 &&
|
|
42
|
+
return a !== void 0 && i.has(a);
|
|
39
43
|
});
|
|
40
44
|
},
|
|
41
45
|
isActiveTypeFirstInCollection: (e) => {
|
|
42
|
-
const t =
|
|
46
|
+
const t = c[e.selectedCollectionType] ?? [];
|
|
43
47
|
return e.activeType === t[0];
|
|
44
48
|
},
|
|
45
49
|
isActiveTypeLastInCollection: (e) => {
|
|
46
|
-
const t =
|
|
50
|
+
const t = c[e.selectedCollectionType] ?? [];
|
|
47
51
|
return e.activeType === t[t.length - 1];
|
|
48
52
|
},
|
|
49
53
|
hasTemplatesByCollectionType: (e) => {
|
|
50
54
|
const t = {};
|
|
51
|
-
return (
|
|
52
|
-
t[s] = e.templates.some((
|
|
55
|
+
return (c[e.selectedCollectionType] ?? []).forEach((s) => {
|
|
56
|
+
t[s] = e.templates.some((i) => i.type === s);
|
|
53
57
|
}), t;
|
|
54
58
|
},
|
|
55
59
|
unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
|
|
@@ -58,7 +62,7 @@ const r = () => ({
|
|
|
58
62
|
$reset() {
|
|
59
63
|
const { templates: e, selectedUnsubscribePages: t } = this;
|
|
60
64
|
Object.assign(this, {
|
|
61
|
-
...
|
|
65
|
+
...p(),
|
|
62
66
|
templates: e,
|
|
63
67
|
selectedUnsubscribePages: t
|
|
64
68
|
});
|
|
@@ -66,28 +70,28 @@ const r = () => ({
|
|
|
66
70
|
async fetchTemplates(e = !1) {
|
|
67
71
|
!e && this.templates.length || ((e || !o) && (o = (async () => {
|
|
68
72
|
const { getUnsubscribePages: t } = d();
|
|
69
|
-
this.templates = await t();
|
|
73
|
+
this.templates = h(await t());
|
|
70
74
|
})().finally(() => {
|
|
71
75
|
o = null;
|
|
72
76
|
})), await o);
|
|
73
77
|
},
|
|
74
78
|
setCollection(e) {
|
|
75
79
|
this.selectedCollectionType = e;
|
|
76
|
-
const t =
|
|
80
|
+
const t = c[e];
|
|
77
81
|
if (t && t.length > 0) {
|
|
78
82
|
[this.activeType] = t;
|
|
79
83
|
const l = { ...this.selectedTemplates };
|
|
80
84
|
t.forEach((s) => {
|
|
81
85
|
if (!l[s]) {
|
|
82
|
-
const
|
|
83
|
-
|
|
86
|
+
const i = this.templates.find((n) => n.type === s);
|
|
87
|
+
i && (l[s] = i.id);
|
|
84
88
|
}
|
|
85
89
|
}), this.selectedTemplates = l;
|
|
86
90
|
}
|
|
87
91
|
},
|
|
88
92
|
setCollectionWithoutAutoSelection(e) {
|
|
89
93
|
this.selectedCollectionType = e;
|
|
90
|
-
const t =
|
|
94
|
+
const t = c[e];
|
|
91
95
|
t && t.length > 0 && ([this.activeType] = t);
|
|
92
96
|
},
|
|
93
97
|
setSelectedTemplate(e) {
|
|
@@ -107,12 +111,12 @@ const r = () => ({
|
|
|
107
111
|
loadSelectedTemplates(e) {
|
|
108
112
|
const t = new Map(this.templates.map((s) => [s.id, s.type])), l = { ...this.selectedTemplates };
|
|
109
113
|
e.forEach((s) => {
|
|
110
|
-
const
|
|
111
|
-
|
|
114
|
+
const i = t.get(s);
|
|
115
|
+
i !== void 0 && (l[i] = s);
|
|
112
116
|
}), this.selectedTemplates = l;
|
|
113
117
|
},
|
|
114
118
|
getSelectedTemplatesByCollection(e) {
|
|
115
|
-
const t =
|
|
119
|
+
const t = c[e], l = [];
|
|
116
120
|
return t.forEach((s) => {
|
|
117
121
|
this.selectedTemplates[s] && l.push(this.selectedTemplates[s]);
|
|
118
122
|
}), l;
|
|
@@ -129,5 +133,5 @@ const r = () => ({
|
|
|
129
133
|
}
|
|
130
134
|
});
|
|
131
135
|
export {
|
|
132
|
-
|
|
136
|
+
f as useUnsubscribeStore
|
|
133
137
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.21.2-beta.
|
|
3
|
+
"version": "3.21.2-beta.ccc7173",
|
|
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",
|