@useinsider/guido 3.22.0-beta.d4e1d48 → 3.22.0-beta.e257753

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.
@@ -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 i = function() {
5
- var r = this, t = r._self._c, e = r._self._setupProxy;
6
- return t(e.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": e.footerButtonGroupOptions, status: e.unsubscribeStore.pageSelectionDrawerStatus, "title-text": e.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: e.handleBack, onCloseEvent: e.handleClose, primaryButtonEvent: e.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
7
- return [t(e.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
8
- }, proxy: !0 }]) }, [t("div", { staticClass: "d-g templates-wrapper" }, r._l(e.unsubscribeStore.getTemplatesByActiveType, function(s) {
9
- return t("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
10
- return e.selectTemplate(s.id);
11
- } } }, [t(e.InContainer, { staticClass: "template-container o-h p-r", class: { selected: e.unsubscribeStore.getSelectedTemplateByActiveType === s.id }, attrs: { border: e.getBorderClass(s.id) } }, [t("div", { staticClass: "w-1 h-1 d-f j-c-c a-i-c" }, [t("img", { staticClass: "w-1 h-1 thumbnail o-h", attrs: { alt: s.name, src: s.thumbnail } })]), s.isDefault ? t(e.InChips, { staticClass: "p-a t-3 r-3", attrs: { id: "guido__unsubscribe-default-chip", type: "neutral", value: "default", "close-button": !1, interactive: !1, text: e.trans("unsubscription-preference.default") } }) : r._e()], 1), t("div", { staticClass: "mt-1 f-s-1" }, [r._v(" " + r._s(s.name) + " ")])], 1);
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.handleClose, 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
12
  }), 0)]);
13
- }, o = [], c = /* @__PURE__ */ n(
13
+ }, i = [], c = /* @__PURE__ */ n(
14
14
  a,
15
- i,
16
15
  o,
16
+ i,
17
17
  !1,
18
18
  null,
19
- "eaf8e461"
19
+ "91a26acd"
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 C } from "../../../composables/useToaster.js";
4
- import { useTranslations as B } from "../../../composables/useTranslations.js";
3
+ import { useToaster as B } from "../../../composables/useToaster.js";
4
+ import { useTranslations as C } 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 I, InChips as _ } from "@useinsider/design-system-vue";
9
- import x from "./UnsubscribeBreadcrumb.vue.js";
10
- const W = /* @__PURE__ */ y({
8
+ import { InContainer as _ } from "@useinsider/design-system-vue";
9
+ import I from "./UnsubscribeBreadcrumb.vue.js";
10
+ const N = /* @__PURE__ */ y({
11
11
  __name: "UnsubscribePageSelection",
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(() => ({
12
+ setup(x) {
13
+ const s = C(), e = U(), r = P(), { showToaster: c } = B(), 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 W = /* @__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, InChips: _, InContainer: I, UnsubscribeBreadcrumb: x };
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, InContainer: _, UnsubscribeBreadcrumb: I };
67
67
  }
68
68
  });
69
69
  export {
70
- W as default
70
+ N 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-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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}
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-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{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,7 +26,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
26
26
  createdAt: string;
27
27
  updatedAt: string;
28
28
  status: number;
29
- isDefault?: boolean | undefined;
30
29
  }[];
31
30
  selectedTemplates: Record<number, number>;
32
31
  selectedUnsubscribePages: number[];
@@ -52,7 +51,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
52
51
  createdAt: string;
53
52
  updatedAt: string;
54
53
  status: number;
55
- isDefault?: boolean | undefined;
56
54
  }[];
57
55
  selectedTemplates: Record<number, number>;
58
56
  selectedUnsubscribePages: number[];
@@ -78,7 +76,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
78
76
  createdAt: string;
79
77
  updatedAt: string;
80
78
  status: number;
81
- isDefault?: boolean | undefined;
82
79
  }[];
83
80
  selectedTemplates: Record<number, number>;
84
81
  selectedUnsubscribePages: number[];
@@ -102,7 +99,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
102
99
  createdAt: string;
103
100
  updatedAt: string;
104
101
  status: number;
105
- isDefault?: boolean | undefined;
106
102
  }[];
107
103
  getThumbnailByTemplateId: (state: {
108
104
  templates: {
@@ -117,7 +113,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
117
113
  createdAt: string;
118
114
  updatedAt: string;
119
115
  status: number;
120
- isDefault?: boolean | undefined;
121
116
  }[];
122
117
  selectedTemplates: Record<number, number>;
123
118
  selectedUnsubscribePages: number[];
@@ -143,7 +138,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
143
138
  createdAt: string;
144
139
  updatedAt: string;
145
140
  status: number;
146
- isDefault?: boolean | undefined;
147
141
  }[];
148
142
  selectedTemplates: Record<number, number>;
149
143
  selectedUnsubscribePages: number[];
@@ -169,7 +163,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
169
163
  createdAt: string;
170
164
  updatedAt: string;
171
165
  status: number;
172
- isDefault?: boolean | undefined;
173
166
  }[];
174
167
  selectedTemplates: Record<number, number>;
175
168
  selectedUnsubscribePages: number[];
@@ -195,7 +188,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
195
188
  createdAt: string;
196
189
  updatedAt: string;
197
190
  status: number;
198
- isDefault?: boolean | undefined;
199
191
  }[];
200
192
  selectedTemplates: Record<number, number>;
201
193
  selectedUnsubscribePages: number[];
@@ -221,7 +213,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
221
213
  createdAt: string;
222
214
  updatedAt: string;
223
215
  status: number;
224
- isDefault?: boolean | undefined;
225
216
  }[];
226
217
  selectedTemplates: Record<number, number>;
227
218
  selectedUnsubscribePages: number[];
@@ -247,7 +238,6 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
247
238
  createdAt: string;
248
239
  updatedAt: string;
249
240
  status: number;
250
- isDefault?: boolean | undefined;
251
241
  }[];
252
242
  selectedTemplates: Record<number, number>;
253
243
  selectedUnsubscribePages: number[];
@@ -1,27 +1,23 @@
1
- import { TYPE_COLLECTIONS as c, PAGE_TYPES as r } from "../enums/unsubscribe.js";
1
+ import { TYPE_COLLECTIONS as i, PAGE_TYPES as p } from "../enums/unsubscribe.js";
2
2
  import { useUnsubscribeApi as d } from "../services/unsubscribeApi.js";
3
3
  import { defineStore as u } from "pinia";
4
- let a = null;
5
- const p = () => ({
4
+ let o = null;
5
+ const r = () => ({
6
6
  templates: [],
7
7
  selectedTemplates: {},
8
8
  selectedUnsubscribePages: [],
9
- selectedCollectionType: r.GLOBAL_UNSUBSCRIBE,
10
- activeType: r.GLOBAL_UNSUBSCRIBE,
9
+ selectedCollectionType: p.GLOBAL_UNSUBSCRIBE,
10
+ activeType: p.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
- function h(e) {
19
- return [...e].sort((t, l) => +!!l.isDefault - +!!t.isDefault);
20
- }
21
- const f = u("guidoUnsubscribe", {
22
- state: () => p(),
17
+ }), b = u("guidoUnsubscribe", {
18
+ state: () => r(),
23
19
  getters: {
24
- getSelectedCollection: (e) => c[e.selectedCollectionType],
20
+ getSelectedCollection: (e) => i[e.selectedCollectionType],
25
21
  getSelectedTemplateByActiveType: (e) => e.selectedTemplates[e.activeType],
26
22
  getTemplatesByActiveType: (e) => e.templates.filter((t) => t.type === e.activeType),
27
23
  getThumbnailByTemplateId: (e) => (t) => {
@@ -29,31 +25,31 @@ const f = u("guidoUnsubscribe", {
29
25
  return ((l = e.templates.find((s) => s.id === t)) == null ? void 0 : l.thumbnail) ?? "";
30
26
  },
31
27
  getSelectedUnsubscribePagesByCollection: (e) => (t) => {
32
- const l = c[t];
28
+ const l = i[t];
33
29
  if (!l)
34
30
  return [];
35
31
  const s = /* @__PURE__ */ new Map();
36
32
  e.templates.forEach((n) => {
37
33
  s.set(n.id, n.type);
38
34
  });
39
- const i = new Set(l);
35
+ const c = new Set(l);
40
36
  return e.selectedUnsubscribePages.filter((n) => {
41
- const o = s.get(n);
42
- return o !== void 0 && i.has(o);
37
+ const a = s.get(n);
38
+ return a !== void 0 && c.has(a);
43
39
  });
44
40
  },
45
41
  isActiveTypeFirstInCollection: (e) => {
46
- const t = c[e.selectedCollectionType] ?? [];
42
+ const t = i[e.selectedCollectionType] ?? [];
47
43
  return e.activeType === t[0];
48
44
  },
49
45
  isActiveTypeLastInCollection: (e) => {
50
- const t = c[e.selectedCollectionType] ?? [];
46
+ const t = i[e.selectedCollectionType] ?? [];
51
47
  return e.activeType === t[t.length - 1];
52
48
  },
53
49
  hasTemplatesByCollectionType: (e) => {
54
50
  const t = {};
55
- return (c[e.selectedCollectionType] ?? []).forEach((s) => {
56
- t[s] = e.templates.some((i) => i.type === s);
51
+ return (i[e.selectedCollectionType] ?? []).forEach((s) => {
52
+ t[s] = e.templates.some((c) => c.type === s);
57
53
  }), t;
58
54
  },
59
55
  unsubscribePagesStatus: (e) => e.selectedUnsubscribePages.length > 0
@@ -62,36 +58,36 @@ const f = u("guidoUnsubscribe", {
62
58
  $reset() {
63
59
  const { templates: e, selectedUnsubscribePages: t } = this;
64
60
  Object.assign(this, {
65
- ...p(),
61
+ ...r(),
66
62
  templates: e,
67
63
  selectedUnsubscribePages: t
68
64
  });
69
65
  },
70
66
  async fetchTemplates(e = !1) {
71
- !e && this.templates.length || ((e || !a) && (a = (async () => {
67
+ !e && this.templates.length || ((e || !o) && (o = (async () => {
72
68
  const { getUnsubscribePages: t } = d();
73
- this.templates = h(await t());
69
+ this.templates = await t();
74
70
  })().finally(() => {
75
- a = null;
76
- })), await a);
71
+ o = null;
72
+ })), await o);
77
73
  },
78
74
  setCollection(e) {
79
75
  this.selectedCollectionType = e;
80
- const t = c[e];
76
+ const t = i[e];
81
77
  if (t && t.length > 0) {
82
78
  [this.activeType] = t;
83
79
  const l = { ...this.selectedTemplates };
84
80
  t.forEach((s) => {
85
81
  if (!l[s]) {
86
- const i = this.templates.filter((o) => o.type === s), n = i.find((o) => o.isDefault) ?? i[0];
87
- n && (l[s] = n.id);
82
+ const c = this.templates.find((n) => n.type === s);
83
+ c && (l[s] = c.id);
88
84
  }
89
85
  }), this.selectedTemplates = l;
90
86
  }
91
87
  },
92
88
  setCollectionWithoutAutoSelection(e) {
93
89
  this.selectedCollectionType = e;
94
- const t = c[e];
90
+ const t = i[e];
95
91
  t && t.length > 0 && ([this.activeType] = t);
96
92
  },
97
93
  setSelectedTemplate(e) {
@@ -111,12 +107,12 @@ const f = u("guidoUnsubscribe", {
111
107
  loadSelectedTemplates(e) {
112
108
  const t = new Map(this.templates.map((s) => [s.id, s.type])), l = { ...this.selectedTemplates };
113
109
  e.forEach((s) => {
114
- const i = t.get(s);
115
- i !== void 0 && (l[i] = s);
110
+ const c = t.get(s);
111
+ c !== void 0 && (l[c] = s);
116
112
  }), this.selectedTemplates = l;
117
113
  },
118
114
  getSelectedTemplatesByCollection(e) {
119
- const t = c[e], l = [];
115
+ const t = i[e], l = [];
120
116
  return t.forEach((s) => {
121
117
  this.selectedTemplates[s] && l.push(this.selectedTemplates[s]);
122
118
  }), l;
@@ -133,5 +129,5 @@ const f = u("guidoUnsubscribe", {
133
129
  }
134
130
  });
135
131
  export {
136
- f as useUnsubscribeStore
132
+ b as useUnsubscribeStore
137
133
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.22.0-beta.d4e1d48",
3
+ "version": "3.22.0-beta.e257753",
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",