@useinsider/guido 3.7.2-beta.b9b817e → 3.7.2-beta.cebab71
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/email-preview/desktop-preview/DesktopPreview.vue.js +8 -8
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +15 -12
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +16 -15
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +4 -4
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +38 -35
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +54 -51
- package/dist/composables/usePreviewInteractionGuard.js +17 -0
- package/dist/enums/extensions/recommendationBlock.js +1 -3
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +6 -6
- package/dist/extensions/Blocks/Unsubscribe/block.js +88 -74
- package/dist/extensions/Blocks/Unsubscribe/control.js +17 -14
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +19 -31
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +3 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -1
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +6 -0
- package/dist/src/stores/unsubscribe.d.ts +11 -1
- package/dist/stores/unsubscribe.js +8 -7
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./DesktopPreview.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var a = function() {
|
|
5
5
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
6
|
return e("div", { staticClass: "desktop-preview-wrapper" }, [e("p", { staticClass: "f-s-1 f-w-600 l-h-1 t-t-u t-c-53 mb-6 l-s-5" }, [s._v(" " + s._s(t.trans("email-editor.desktop-preview")) + " ")]), e("div", { ref: "containerRef", staticClass: "desktop-preview d-f f-d-c o-h s-1" }, [e(t.DesktopBrowserHeader), e("div", { staticClass: "desktop-preview__content d-f f-g-1 o-h b-c-5 min-h-0" }, [e("div", { staticClass: "f-g-1 h-1 o-h b-c-4 min-w-0" }, [t.isContainerReady ? e("iframe", { staticClass: "desktop-preview__iframe d-b w-1 h-1 b-c-4 bor-s-n", attrs: { sandbox: `
|
|
@@ -8,16 +8,16 @@ var a = function() {
|
|
|
8
8
|
allow-popups
|
|
9
9
|
allow-forms
|
|
10
10
|
allow-scripts
|
|
11
|
-
allow-popups-to-escape-sandbox`, srcdoc: t.previewStore.previewHtml } }) : s._e()])])], 1)]);
|
|
12
|
-
}, i = [],
|
|
13
|
-
|
|
11
|
+
allow-popups-to-escape-sandbox`, srcdoc: t.previewStore.previewHtml }, on: { load: t.onIframeLoad } }) : s._e()])])], 1)]);
|
|
12
|
+
}, i = [], n = /* @__PURE__ */ r(
|
|
13
|
+
o,
|
|
14
14
|
a,
|
|
15
15
|
i,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"06afaecb"
|
|
19
19
|
);
|
|
20
|
-
const
|
|
20
|
+
const f = n.exports;
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
f as default
|
|
23
23
|
};
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
1
|
+
import { defineComponent as u, ref as a, onMounted as p, onBeforeUnmount as l, nextTick as v } from "vue";
|
|
2
|
+
import { usePreviewInteractionGuard as d } from "../../../../composables/usePreviewInteractionGuard.js";
|
|
3
|
+
import { useTranslations as _ } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { usePreviewStore as w } from "../../../../stores/preview.js";
|
|
5
|
+
import I from "./DesktopBrowserHeader.vue.js";
|
|
6
|
+
const C = /* @__PURE__ */ u({
|
|
6
7
|
__name: "DesktopPreview",
|
|
7
|
-
setup(
|
|
8
|
-
const
|
|
8
|
+
setup(k) {
|
|
9
|
+
const i = _(), { blockPreviewInteractions: t } = d(), o = a(), n = a(!1), c = w();
|
|
9
10
|
let e = null;
|
|
10
|
-
const
|
|
11
|
+
const f = (m) => {
|
|
12
|
+
t(m.target);
|
|
13
|
+
}, r = () => {
|
|
11
14
|
o.value && (e = new ResizeObserver(() => {
|
|
12
|
-
}), e.observe(o.value),
|
|
15
|
+
}), e.observe(o.value), v(() => {
|
|
13
16
|
n.value = !0;
|
|
14
17
|
}));
|
|
15
|
-
},
|
|
18
|
+
}, s = () => {
|
|
16
19
|
e == null || e.disconnect();
|
|
17
20
|
};
|
|
18
|
-
return
|
|
21
|
+
return p(r), l(s), { __sfc: !0, trans: i, blockPreviewInteractions: t, containerRef: o, isContainerReady: n, previewStore: c, resizeObserver: e, onIframeLoad: f, initIframe: r, cleanIframe: s, DesktopBrowserHeader: I };
|
|
19
22
|
}
|
|
20
23
|
});
|
|
21
24
|
export {
|
|
22
|
-
|
|
25
|
+
C as default
|
|
23
26
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "./ContentView.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
-
var
|
|
4
|
+
var c = function() {
|
|
5
5
|
var t = this, s = t._self._c, a = t._self._setupProxy;
|
|
6
6
|
return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
|
|
7
7
|
return t.$emit("back-to-inbox");
|
|
8
8
|
} } }, [s(a.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: a.previewStore.previewHtml }, on: { load: a.onLoad } })])]);
|
|
9
|
-
},
|
|
9
|
+
}, o = [], i = /* @__PURE__ */ n(
|
|
10
10
|
e,
|
|
11
|
+
c,
|
|
11
12
|
o,
|
|
12
|
-
i,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"cbafc185"
|
|
16
16
|
);
|
|
17
|
-
const d =
|
|
17
|
+
const d = i.exports;
|
|
18
18
|
export {
|
|
19
19
|
d as default
|
|
20
20
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { defineComponent as m, ref as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { defineComponent as m, ref as a } from "vue";
|
|
2
|
+
import { usePreviewInteractionGuard as f } from "../../../../composables/usePreviewInteractionGuard.js";
|
|
3
|
+
import { useResponsivePreview as p } from "../../../../composables/useResponsivePreview.js";
|
|
4
|
+
import { useTranslations as u } from "../../../../composables/useTranslations.js";
|
|
5
|
+
import { usePreviewStore as v } from "../../../../stores/preview.js";
|
|
6
|
+
import { InIcons as P } from "@useinsider/design-system-vue";
|
|
7
|
+
const g = /* @__PURE__ */ m({
|
|
7
8
|
__name: "ContentView",
|
|
8
9
|
emits: ["back-to-inbox"],
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
11
|
-
["transform", "transform-origin", "height"].forEach((
|
|
12
|
-
|
|
10
|
+
setup(_) {
|
|
11
|
+
const c = u(), t = v(), r = a(), { setupResponsivePreview: n } = p(), { blockPreviewInteractions: s } = f(), i = (e) => {
|
|
12
|
+
["transform", "transform-origin", "height"].forEach((o) => {
|
|
13
|
+
e.documentElement.style.removeProperty(o);
|
|
13
14
|
});
|
|
14
15
|
};
|
|
15
|
-
return { __sfc: !0, trans:
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
}, InIcons:
|
|
16
|
+
return { __sfc: !0, trans: c, previewStore: t, iframeRef: r, setupResponsivePreview: n, blockPreviewInteractions: s, clearAMPTransforms: i, onLoad: () => {
|
|
17
|
+
const e = r.value, o = e == null ? void 0 : e.contentDocument;
|
|
18
|
+
o && (n(e), s(e), t.isAMPResponsive && i(o));
|
|
19
|
+
}, InIcons: P };
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
+
g as default
|
|
23
24
|
};
|
|
@@ -10,15 +10,15 @@ var o = function() {
|
|
|
10
10
|
return t.selectTemplate(s.id);
|
|
11
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
|
-
},
|
|
13
|
+
}, c = [], i = /* @__PURE__ */ n(
|
|
14
14
|
a,
|
|
15
15
|
o,
|
|
16
|
-
|
|
16
|
+
c,
|
|
17
17
|
!1,
|
|
18
18
|
null,
|
|
19
|
-
"
|
|
19
|
+
"ec5c2ac6"
|
|
20
20
|
);
|
|
21
|
-
const _ =
|
|
21
|
+
const _ = i.exports;
|
|
22
22
|
export {
|
|
23
23
|
_ as default
|
|
24
24
|
};
|
|
@@ -1,66 +1,69 @@
|
|
|
1
|
-
import { defineComponent as y, ref as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as y, ref as T, computed as a, watch as v } from "vue";
|
|
2
|
+
import w from "../../wrappers/WpDrawer.vue.js";
|
|
3
3
|
import { useToaster as C } from "../../../composables/useToaster.js";
|
|
4
4
|
import { useTranslations as B } from "../../../composables/useTranslations.js";
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
5
|
+
import { ToasterTypeOptions as h } from "../../../enums/toaster.js";
|
|
6
|
+
import { useEditorStore as P } from "../../../stores/editor.js";
|
|
7
|
+
import { useUnsubscribeStore as U } from "../../../stores/unsubscribe.js";
|
|
8
|
+
import { InContainer as _ } from "@useinsider/design-system-vue";
|
|
9
|
+
import x from "./UnsubscribeBreadcrumb.vue.js";
|
|
10
|
+
const N = /* @__PURE__ */ y({
|
|
10
11
|
__name: "UnsubscribePageSelection",
|
|
11
|
-
setup(
|
|
12
|
-
const s = B(), e =
|
|
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(() => ({
|
|
13
14
|
primaryButton: {
|
|
14
15
|
styling: "solid",
|
|
15
16
|
type: "primary",
|
|
16
|
-
labelText:
|
|
17
|
+
labelText: i.value,
|
|
17
18
|
loadingStatus: o.value,
|
|
18
19
|
disabledStatus: !1
|
|
19
20
|
},
|
|
20
21
|
cancelOrBackButton: {
|
|
21
22
|
styling: "ghost",
|
|
22
23
|
type: "secondary",
|
|
23
|
-
labelText:
|
|
24
|
+
labelText: l.value,
|
|
24
25
|
disabledStatus: o.value
|
|
25
26
|
}
|
|
26
|
-
})),
|
|
27
|
+
})), d = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", n = (t) => {
|
|
27
28
|
e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
|
|
28
29
|
t();
|
|
29
30
|
}, 500);
|
|
30
|
-
}, d = () => {
|
|
31
|
-
n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel"));
|
|
32
31
|
}, m = () => {
|
|
32
|
+
n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel"));
|
|
33
|
+
}, b = () => {
|
|
33
34
|
if (e.isActiveTypeFirstInCollection) {
|
|
34
35
|
n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
e.setPreviousType();
|
|
38
|
-
},
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
}, f = () => {
|
|
40
|
+
if (!r.isPreviewModeOpen) {
|
|
41
|
+
if (e.isActiveTypeLastInCollection) {
|
|
42
|
+
o.value = !0;
|
|
43
|
+
const t = e.selectedCollectionType, u = e.getSelectedTemplatesByCollection(t), S = e.getSelectedUnsubscribePagesByCollection(t);
|
|
44
|
+
e.removeUnsubscribePages(S), e.addUnsubscribePages(u), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
|
|
45
|
+
detail: {
|
|
46
|
+
collectionType: t,
|
|
47
|
+
selectedPages: u
|
|
48
|
+
}
|
|
49
|
+
})), n(() => {
|
|
50
|
+
o.value = !1, c({
|
|
51
|
+
type: h.Success,
|
|
52
|
+
message: s("global-unsubscribe.pages-were-attached")
|
|
53
|
+
});
|
|
51
54
|
});
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
e.setNextType();
|
|
54
58
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
e.setSelectedTemplate(t);
|
|
59
|
+
}, g = (t) => {
|
|
60
|
+
r.isPreviewModeOpen || e.setSelectedTemplate(t);
|
|
58
61
|
};
|
|
59
|
-
return
|
|
62
|
+
return v(() => e.pageSelectionDrawerStatus, (t) => {
|
|
60
63
|
t && e.pageSelectionUpdateStatus && e.fetchTemplates();
|
|
61
|
-
}), { __sfc: !0, trans: s, unsubscribeStore: e,
|
|
64
|
+
}), { __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: x };
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
67
|
export {
|
|
65
|
-
|
|
68
|
+
N as default
|
|
66
69
|
};
|
|
@@ -1,106 +1,109 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _, ref as b, computed as m, watch as h } from "vue";
|
|
2
2
|
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
3
|
import { useToaster as U } from "../../../composables/useToaster.js";
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { ACADEMY_LINKS as
|
|
6
|
-
import { ToasterTypeOptions as
|
|
7
|
-
import { PAGE_TYPES as l, getTypeTranslations as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
import { InSegments as
|
|
10
|
-
const V = /* @__PURE__ */
|
|
4
|
+
import { useTranslations as w } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ACADEMY_LINKS as N } from "../../../enums/academy.js";
|
|
6
|
+
import { ToasterTypeOptions as I } from "../../../enums/toaster.js";
|
|
7
|
+
import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as D } from "../../../enums/unsubscribe.js";
|
|
8
|
+
import { useUnsubscribeStore as L } from "../../../stores/unsubscribe.js";
|
|
9
|
+
import { InSegments as P } from "@useinsider/design-system-vue";
|
|
10
|
+
const V = /* @__PURE__ */ _({
|
|
11
11
|
__name: "UnsubscribeTypeSelection",
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
12
|
+
setup(G) {
|
|
13
|
+
const t = w(), { showToaster: f } = U(), e = L(), n = b(!1), o = b(!0), r = b(l.GLOBAL_UNSUBSCRIBE), S = t(
|
|
14
14
|
"unsubscription-preference.select-unsubscribe-page-description",
|
|
15
|
-
{ action: `<a href="${
|
|
16
|
-
), T =
|
|
15
|
+
{ action: `<a href="${N.GLOBAL_UNSUBSCRIBE}" target="_blank">${t("ds-rules.visit-academy")}</a>` }
|
|
16
|
+
), T = m(() => [
|
|
17
17
|
{
|
|
18
|
-
description:
|
|
18
|
+
description: t("unsubscription-preference.type-global-unsubscribe-description"),
|
|
19
19
|
icon: "line-contact-global-unsub-page",
|
|
20
|
-
text:
|
|
20
|
+
text: t("unsubscription-preference.type-global-unsubscribe"),
|
|
21
21
|
value: l.GLOBAL_UNSUBSCRIBE,
|
|
22
|
-
disable:
|
|
22
|
+
disable: e.isGlobalUnsubscribeDisabled,
|
|
23
23
|
position: "bottom",
|
|
24
|
-
tooltipText:
|
|
24
|
+
tooltipText: e.isGlobalUnsubscribeDisabled ? t("unsubscription-preference.global-unsub-added") : ""
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
description:
|
|
27
|
+
description: t("unsubscription-preference.type-subscription-preferences-center-description"),
|
|
28
28
|
icon: "line-contact-sub-pref-center-page",
|
|
29
|
-
text:
|
|
29
|
+
text: t("unsubscription-preference.type-subscription-preferences-center"),
|
|
30
30
|
value: l.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
31
|
-
disable:
|
|
32
|
-
tooltipText:
|
|
31
|
+
disable: e.isSubscriptionPreferencesCenterDisabled,
|
|
32
|
+
tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
|
|
33
33
|
}
|
|
34
|
-
]), y =
|
|
34
|
+
]), y = m(() => ({
|
|
35
35
|
primaryButton: {
|
|
36
36
|
styling: "solid",
|
|
37
37
|
type: "primary",
|
|
38
|
-
labelText:
|
|
38
|
+
labelText: t(
|
|
39
39
|
n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
|
|
40
40
|
),
|
|
41
41
|
loadingStatus: n.value,
|
|
42
42
|
disabledStatus: !1,
|
|
43
|
-
skeletonStatus:
|
|
43
|
+
skeletonStatus: o.value,
|
|
44
44
|
skeletonSizing: { width: 168, height: 40 }
|
|
45
45
|
},
|
|
46
46
|
cancelOrBackButton: {
|
|
47
47
|
styling: "ghost",
|
|
48
48
|
type: "secondary",
|
|
49
|
-
labelText:
|
|
49
|
+
labelText: t("products.cancel"),
|
|
50
50
|
disabledStatus: n.value,
|
|
51
|
-
skeletonStatus:
|
|
51
|
+
skeletonStatus: o.value,
|
|
52
52
|
skeletonSizing: { width: 78, height: 40 }
|
|
53
53
|
}
|
|
54
54
|
})), d = (s) => {
|
|
55
|
-
|
|
55
|
+
e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
56
|
+
detail: { blockId: e.pendingBlockId }
|
|
57
|
+
})), s && setTimeout(() => {
|
|
56
58
|
s();
|
|
57
59
|
}, 500);
|
|
58
60
|
}, E = (s) => {
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
const s =
|
|
62
|
-
if (Object.entries(s).forEach(([
|
|
63
|
-
p ||
|
|
64
|
-
}),
|
|
61
|
+
r.value = s;
|
|
62
|
+
}, g = () => {
|
|
63
|
+
const s = e.hasTemplatesByCollectionType, a = [];
|
|
64
|
+
if (Object.entries(s).forEach(([i, p]) => {
|
|
65
|
+
p || a.push(Number(i));
|
|
66
|
+
}), a.length === 0)
|
|
65
67
|
return !0;
|
|
66
|
-
const
|
|
68
|
+
const C = R(), c = a.map((i) => C[i]);
|
|
67
69
|
let u = "";
|
|
68
|
-
if (
|
|
69
|
-
u =
|
|
70
|
-
page:
|
|
70
|
+
if (a.length === 1)
|
|
71
|
+
u = t("unsubscription-preference.create-page-to-continue", {
|
|
72
|
+
page: c[0]
|
|
71
73
|
});
|
|
72
|
-
else if (
|
|
73
|
-
u =
|
|
74
|
-
page1:
|
|
75
|
-
page2:
|
|
74
|
+
else if (a.length === 2)
|
|
75
|
+
u = t("unsubscription-preference.create-pages-to-continue", {
|
|
76
|
+
page1: c[0],
|
|
77
|
+
page2: c[1]
|
|
76
78
|
});
|
|
77
79
|
else {
|
|
78
|
-
const
|
|
79
|
-
u =
|
|
80
|
+
const i = c.pop() ?? "", p = c.join(", ");
|
|
81
|
+
u = t("unsubscription-preference.create-multiple-pages-to-continue", {
|
|
80
82
|
pages: p,
|
|
81
|
-
lastPage:
|
|
83
|
+
lastPage: i
|
|
82
84
|
});
|
|
83
85
|
}
|
|
84
86
|
return f({
|
|
85
|
-
type:
|
|
87
|
+
type: I.Warning,
|
|
86
88
|
message: u,
|
|
87
89
|
actionButton: {
|
|
88
90
|
text: "Go to Unsubscribe Pages",
|
|
89
91
|
onClick: () => {
|
|
90
|
-
window.location.href
|
|
92
|
+
const i = new URL(D, window.location.origin).href;
|
|
93
|
+
window.open(i, "_blank", "noopener");
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
}), !1;
|
|
94
|
-
},
|
|
95
|
-
if (n.value = !0, await
|
|
97
|
+
}, B = async () => {
|
|
98
|
+
if (n.value = !0, await e.fetchTemplates(!0), e.setCollection(r.value), !g()) {
|
|
96
99
|
n.value = !1, d();
|
|
97
100
|
return;
|
|
98
101
|
}
|
|
99
|
-
n.value = !1,
|
|
102
|
+
n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
|
|
100
103
|
};
|
|
101
|
-
return
|
|
102
|
-
s && (
|
|
103
|
-
}), { __sfc: !0, trans:
|
|
104
|
+
return h(() => e.typeSelectionDrawerStatus, (s) => {
|
|
105
|
+
s && (o.value = !0, r.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (r.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), o.value = !1);
|
|
106
|
+
}), { __sfc: !0, trans: t, showToaster: f, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: S, segmentList: T, footerButtonGroupOptions: y, closeModal: d, changeCollection: E, validateTemplates: g, selectCollection: B, WpDrawer: v, InSegments: P };
|
|
104
107
|
}
|
|
105
108
|
});
|
|
106
109
|
export {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const o = ["click", "auxclick", "submit"], c = (t) => {
|
|
2
|
+
t.preventDefault(), t.stopPropagation();
|
|
3
|
+
}, a = () => ({ blockPreviewInteractions: (r) => {
|
|
4
|
+
try {
|
|
5
|
+
const e = r.contentDocument;
|
|
6
|
+
if (!e)
|
|
7
|
+
return;
|
|
8
|
+
o.forEach((n) => {
|
|
9
|
+
e.addEventListener(n, c, !0);
|
|
10
|
+
});
|
|
11
|
+
} catch (e) {
|
|
12
|
+
console.warn("[usePreviewInteractionGuard] Could not guard preview iframe:", e);
|
|
13
|
+
}
|
|
14
|
+
} });
|
|
15
|
+
export {
|
|
16
|
+
a as usePreviewInteractionGuard
|
|
17
|
+
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { useTranslations as r } from "../../composables/useTranslations.js";
|
|
2
2
|
const l = {
|
|
3
|
-
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
4
|
-
// Relative path → same-origin as the embedding inone dashboard.
|
|
5
|
-
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
|
|
3
|
+
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com"
|
|
6
4
|
}, c = {
|
|
7
5
|
CLIENT_ID: "clientId"
|
|
8
6
|
}, d = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getRecommendationFeedSourceMaps as g, getOperatorOptions as R, PriceAttributes as C } from "../../../../enums/extensions/recommendationBlock.js";
|
|
2
2
|
import { useRecommendationApi as y } from "../../../../services/recommendationApi.js";
|
|
3
3
|
import { useConfigStore as G } from "../../../../stores/config.js";
|
|
4
|
-
import { defineStore as
|
|
5
|
-
import { DEFAULT_MOBILE_CARDS_IN_ROW as
|
|
4
|
+
import { defineStore as P } from "pinia";
|
|
5
|
+
import { DEFAULT_MOBILE_CARDS_IN_ROW as D, DEFAULT_CARDS_IN_ROW as F } from "../constants/layout.js";
|
|
6
6
|
import { EXCLUDED_ALGORITHM_IDS as w } from "../constants/defaultConfig.js";
|
|
7
7
|
import { getDefaultProducts as S } from "../templates/utils.js";
|
|
8
8
|
import { generateCompleteFilterQuery as b } from "../utils/filterUtil.js";
|
|
@@ -13,7 +13,7 @@ const h = y();
|
|
|
13
13
|
let m = null, u = null, d = null;
|
|
14
14
|
function k() {
|
|
15
15
|
return {
|
|
16
|
-
cardsInRow:
|
|
16
|
+
cardsInRow: F,
|
|
17
17
|
currencySettings: {
|
|
18
18
|
name: "USD",
|
|
19
19
|
value: "USD",
|
|
@@ -27,7 +27,7 @@ function k() {
|
|
|
27
27
|
productIds: [],
|
|
28
28
|
id: 1,
|
|
29
29
|
language: "en_US",
|
|
30
|
-
mobileCardsInRow:
|
|
30
|
+
mobileCardsInRow: D,
|
|
31
31
|
mobileLayoutEnabled: !1,
|
|
32
32
|
orientation: "grid",
|
|
33
33
|
recommendedProducts: [],
|
|
@@ -60,7 +60,7 @@ const L = () => ({
|
|
|
60
60
|
blockStates: {},
|
|
61
61
|
currentRecommendationId: null,
|
|
62
62
|
configVersion: 0
|
|
63
|
-
}), K =
|
|
63
|
+
}), K = P("guidoRecommendationExtension", {
|
|
64
64
|
state: () => L(),
|
|
65
65
|
getters: {
|
|
66
66
|
// ====================================================================
|
|
@@ -133,7 +133,7 @@ const L = () => ({
|
|
|
133
133
|
value: e.text
|
|
134
134
|
})),
|
|
135
135
|
getFilterList() {
|
|
136
|
-
return Object.values(this.filterList).
|
|
136
|
+
return Object.values(this.filterList).map((t) => {
|
|
137
137
|
let e;
|
|
138
138
|
return t.type === "productAttribute" ? e = `product_attributes.${t.attributeName}` : C.includes(t.attributeName) ? e = `${t.attributeName}.${this.recommendationConfigs.currencySettings.value}` : e = t.attributeName, {
|
|
139
139
|
text: t.displayName,
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
var S = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var a = (c, o, e) =>
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { PAGE_TYPES as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
var f = (c, o, e) => o in c ? S(c, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[o] = e;
|
|
3
|
+
var a = (c, o, e) => f(c, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
+
import { useToaster as A } from "../../../composables/useToaster.js";
|
|
5
|
+
import { ToasterTypeOptions as L } from "../../../enums/toaster.js";
|
|
6
|
+
import { PAGE_TYPES as g } from "../../../enums/unsubscribe.js";
|
|
7
|
+
import { useEditorStore as T } from "../../../stores/editor.js";
|
|
8
|
+
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
9
|
+
import { Block as y, BlockCompositionType as I, ContextActionType as _, ModificationDescription as d, BlockType as v } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
10
|
+
import { getDefaultTemplate as C } from "./template.js";
|
|
10
11
|
import { UNSUBSCRIBE_BLOCK_SELECTOR as m, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as b } from "./utils/constants.js";
|
|
11
|
-
import { parsePageList as
|
|
12
|
-
const
|
|
13
|
-
[
|
|
14
|
-
[
|
|
12
|
+
import { parsePageList as k } from "./utils/utils.js";
|
|
13
|
+
const N = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', U = "{{ins-unsubscribe-link}}", R = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", D = "Removing the unsubscribe text leaves an empty block, but an active unsubscribe link is required. Undo your last action to restore the text, or delete the unsubscribe block entirely.", P = {
|
|
14
|
+
[g.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
15
|
+
[g.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
15
16
|
}, w = 3;
|
|
16
|
-
class
|
|
17
|
+
class W extends y {
|
|
17
18
|
constructor() {
|
|
18
19
|
super();
|
|
19
20
|
a(this, "selectEventListener", null);
|
|
@@ -29,13 +30,13 @@ class H extends y {
|
|
|
29
30
|
a(this, "guardAttemptsByBlockId", /* @__PURE__ */ new Map());
|
|
30
31
|
}
|
|
31
32
|
getId() {
|
|
32
|
-
return
|
|
33
|
+
return N;
|
|
33
34
|
}
|
|
34
35
|
getIcon() {
|
|
35
36
|
return "unsubscribe-icon";
|
|
36
37
|
}
|
|
37
38
|
getBlockCompositionType() {
|
|
38
|
-
return
|
|
39
|
+
return I.BLOCK;
|
|
39
40
|
}
|
|
40
41
|
getName() {
|
|
41
42
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -44,15 +45,16 @@ class H extends y {
|
|
|
44
45
|
return this.api.translate("Unsubscribe Block Description");
|
|
45
46
|
}
|
|
46
47
|
getTemplate() {
|
|
47
|
-
return
|
|
48
|
+
return C();
|
|
48
49
|
}
|
|
49
50
|
getContextActionsIds() {
|
|
50
|
-
return [
|
|
51
|
+
return [_.MOVE, _.REMOVE];
|
|
51
52
|
}
|
|
52
53
|
onSelect(e) {
|
|
53
|
-
this.currentNode = e
|
|
54
|
-
|
|
55
|
-
t
|
|
54
|
+
if (this.currentNode = e, T().isPreviewModeOpen)
|
|
55
|
+
return;
|
|
56
|
+
const t = this._readBlockId(e) !== null, r = this._getOrAssignBlockId(e);
|
|
57
|
+
r && this.linkStateByBlockId.set(r, this._hasUnsubscribeLink(e)), !("getAttribute" in e && e.getAttribute("data-migration")) && (t && !this._hasPageSelection(e) || (this._resetStoreState(), r && (l().pendingBlockId = r), this._loadBlockState(e), this._setupSelectEventListener(), this._setupCancelEventListener(r), this._checkExistingBlocks(), this._openDrawer()));
|
|
56
58
|
}
|
|
57
59
|
onCreated(e) {
|
|
58
60
|
this._ensureLeadingTextGuard(e);
|
|
@@ -71,8 +73,8 @@ class H extends y {
|
|
|
71
73
|
const t = this._getOrAssignBlockId(e);
|
|
72
74
|
if (!t)
|
|
73
75
|
return;
|
|
74
|
-
const
|
|
75
|
-
this.linkStateByBlockId.get(t) === !0 && !
|
|
76
|
+
const r = this._hasUnsubscribeLink(e);
|
|
77
|
+
this.linkStateByBlockId.get(t) === !0 && !r && this._warnLinkRemoved(), this.linkStateByBlockId.set(t, r);
|
|
76
78
|
}
|
|
77
79
|
onDelete(e) {
|
|
78
80
|
this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
@@ -93,25 +95,25 @@ class H extends y {
|
|
|
93
95
|
const t = e.querySelector(E);
|
|
94
96
|
if (!t)
|
|
95
97
|
return;
|
|
96
|
-
let
|
|
97
|
-
for (;
|
|
98
|
-
|
|
99
|
-
if (!
|
|
98
|
+
let r = t, s = r.parent();
|
|
99
|
+
for (; s && "getTagName" in s && s.getTagName().toLowerCase() !== "p"; )
|
|
100
|
+
r = s, s = s.parent();
|
|
101
|
+
if (!s || !("getTagName" in s) || s.getTagName().toLowerCase() !== "p")
|
|
100
102
|
return;
|
|
101
|
-
const i =
|
|
103
|
+
const i = r.previousSibling();
|
|
102
104
|
if (!!(i && i.getType() === "text" && i.getTextContent())) {
|
|
103
105
|
const p = this._readBlockId(e);
|
|
104
106
|
p && this.guardAttemptsByBlockId.delete(p);
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
107
|
-
const
|
|
108
|
-
if (!
|
|
109
|
+
const h = this._getOrAssignBlockId(e);
|
|
110
|
+
if (!h)
|
|
109
111
|
return;
|
|
110
|
-
const
|
|
111
|
-
if (!(
|
|
112
|
-
this.guardAttemptsByBlockId.set(
|
|
112
|
+
const B = this.guardAttemptsByBlockId.get(h) ?? 0;
|
|
113
|
+
if (!(B >= w)) {
|
|
114
|
+
this.guardAttemptsByBlockId.set(h, B + 1);
|
|
113
115
|
try {
|
|
114
|
-
this.api.getDocumentModifier().modifyHtml(
|
|
116
|
+
this.api.getDocumentModifier().modifyHtml(s).prepend(" ").apply(new d("Ensure unsubscribe link text guard"));
|
|
115
117
|
} catch (p) {
|
|
116
118
|
console.warn("[UnsubscribeBlock] Failed to ensure link text guard:", p);
|
|
117
119
|
}
|
|
@@ -123,6 +125,17 @@ class H extends y {
|
|
|
123
125
|
_readBlockId(e) {
|
|
124
126
|
return "getAttribute" in e ? e.getAttribute(n.BLOCK_ID) : null;
|
|
125
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* True when the block has a page type and a page list — i.e. a template was
|
|
130
|
+
* applied. A block with neither, combined with an already-present block id,
|
|
131
|
+
* is an undo-restored orphan of a cancelled block.
|
|
132
|
+
*/
|
|
133
|
+
_hasPageSelection(e) {
|
|
134
|
+
if (!("getAttribute" in e))
|
|
135
|
+
return !1;
|
|
136
|
+
const t = e.getAttribute(n.PAGE_TYPE), r = e.getAttribute(n.PAGE_LIST);
|
|
137
|
+
return !!t && !!r;
|
|
138
|
+
}
|
|
126
139
|
/**
|
|
127
140
|
* Returns the block's stable id, assigning one via the document modifier if
|
|
128
141
|
* the node has not been tagged yet. Idempotent: subsequent calls during
|
|
@@ -135,13 +148,13 @@ class H extends y {
|
|
|
135
148
|
return t;
|
|
136
149
|
if (!("getAttribute" in e))
|
|
137
150
|
return null;
|
|
138
|
-
const
|
|
151
|
+
const r = this._generateNextBlockId();
|
|
139
152
|
try {
|
|
140
|
-
this.api.getDocumentModifier().modifyHtml(e).setAttribute(n.BLOCK_ID,
|
|
141
|
-
} catch (
|
|
142
|
-
return console.warn("[UnsubscribeBlock] Failed to assign block id:",
|
|
153
|
+
this.api.getDocumentModifier().modifyHtml(e).setAttribute(n.BLOCK_ID, r).apply(new d(`Assign unsubscribe block id ${r}`));
|
|
154
|
+
} catch (s) {
|
|
155
|
+
return console.warn("[UnsubscribeBlock] Failed to assign block id:", s), null;
|
|
143
156
|
}
|
|
144
|
-
return
|
|
157
|
+
return r;
|
|
145
158
|
}
|
|
146
159
|
/**
|
|
147
160
|
* Generates a unique id by scanning the document for the highest existing
|
|
@@ -152,10 +165,10 @@ class H extends y {
|
|
|
152
165
|
let e = 0;
|
|
153
166
|
try {
|
|
154
167
|
const t = this.api.getDocumentRoot();
|
|
155
|
-
t && "querySelectorAll" in t && t.querySelectorAll(m).forEach((
|
|
156
|
-
if ("getAttribute" in
|
|
157
|
-
const i =
|
|
158
|
-
|
|
168
|
+
t && "querySelectorAll" in t && t.querySelectorAll(m).forEach((s) => {
|
|
169
|
+
if ("getAttribute" in s) {
|
|
170
|
+
const i = s.getAttribute(n.BLOCK_ID), u = i ? parseInt(i) : 0;
|
|
171
|
+
u > e && (e = u);
|
|
159
172
|
}
|
|
160
173
|
});
|
|
161
174
|
} catch {
|
|
@@ -164,14 +177,14 @@ class H extends y {
|
|
|
164
177
|
}
|
|
165
178
|
_warnLinkRemoved() {
|
|
166
179
|
try {
|
|
167
|
-
const { showToaster: e } =
|
|
180
|
+
const { showToaster: e } = A();
|
|
168
181
|
e({
|
|
169
|
-
type:
|
|
170
|
-
message: this.api.translate(
|
|
182
|
+
type: L.Warning,
|
|
183
|
+
message: this.api.translate(D),
|
|
171
184
|
actionButton: {
|
|
172
185
|
text: this.api.translate("Visit Academy"),
|
|
173
186
|
onClick: () => {
|
|
174
|
-
window.open(
|
|
187
|
+
window.open(R, "_blank", "noopener,noreferrer");
|
|
175
188
|
}
|
|
176
189
|
}
|
|
177
190
|
});
|
|
@@ -181,16 +194,17 @@ class H extends y {
|
|
|
181
194
|
}
|
|
182
195
|
_setupSelectEventListener() {
|
|
183
196
|
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
184
|
-
const t = e, { collectionType:
|
|
185
|
-
this._updateBlock(
|
|
197
|
+
const t = e, { collectionType: r, selectedPages: s } = t.detail;
|
|
198
|
+
this._updateBlock(r, s.join(","));
|
|
186
199
|
}, document.addEventListener(b.SELECT, this.selectEventListener);
|
|
187
200
|
}
|
|
188
201
|
_removeSelectEventListener() {
|
|
189
202
|
this.selectEventListener && (document.removeEventListener(b.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
190
203
|
}
|
|
191
|
-
_setupCancelEventListener() {
|
|
192
|
-
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
193
|
-
|
|
204
|
+
_setupCancelEventListener(e) {
|
|
205
|
+
this._removeCancelEventListener(), this.cancelEventListener = (t) => {
|
|
206
|
+
const { detail: r } = t, s = (r == null ? void 0 : r.blockId) ?? null;
|
|
207
|
+
s !== null && s !== e || this._handleCancel();
|
|
194
208
|
}, document.addEventListener(b.CANCEL, this.cancelEventListener);
|
|
195
209
|
}
|
|
196
210
|
_removeCancelEventListener() {
|
|
@@ -200,7 +214,7 @@ class H extends y {
|
|
|
200
214
|
try {
|
|
201
215
|
if (!this.currentNode)
|
|
202
216
|
return;
|
|
203
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${
|
|
217
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new d("Removed unsubscribe block due to cancel"));
|
|
204
218
|
} catch (e) {
|
|
205
219
|
console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
|
|
206
220
|
}
|
|
@@ -211,32 +225,32 @@ class H extends y {
|
|
|
211
225
|
_updateBlock(e, t) {
|
|
212
226
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
213
227
|
return;
|
|
214
|
-
const
|
|
215
|
-
if (!
|
|
228
|
+
const r = this.currentNode.querySelector(E);
|
|
229
|
+
if (!r)
|
|
216
230
|
return;
|
|
217
|
-
const
|
|
218
|
-
this.api.getDocumentModifier().modifyHtml(
|
|
231
|
+
const s = this._getMergeTag(e);
|
|
232
|
+
this.api.getDocumentModifier().modifyHtml(r).setAttribute("href", s).apply(new d(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(n.PAGE_TYPE, e.toString()).setAttribute(n.PAGE_LIST, t).apply(new d("Updated unsubscribe block metadata"));
|
|
219
233
|
}
|
|
220
234
|
_getMergeTag(e) {
|
|
221
|
-
return
|
|
235
|
+
return P[e] ?? U;
|
|
222
236
|
}
|
|
223
237
|
_openDrawer() {
|
|
224
238
|
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
225
239
|
try {
|
|
226
|
-
const e =
|
|
240
|
+
const e = l();
|
|
227
241
|
e.typeSelectionDrawerStatus = !0;
|
|
228
242
|
} catch (e) {
|
|
229
243
|
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
230
244
|
}
|
|
231
245
|
}
|
|
232
246
|
_checkExistingBlocks() {
|
|
233
|
-
const e =
|
|
234
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(m).forEach((
|
|
235
|
-
if ("getAttribute" in
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
const i = Number(
|
|
239
|
-
i ===
|
|
247
|
+
const e = l();
|
|
248
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(m).forEach((r) => {
|
|
249
|
+
if ("getAttribute" in r) {
|
|
250
|
+
const s = r.getAttribute(n.PAGE_TYPE);
|
|
251
|
+
if (s) {
|
|
252
|
+
const i = Number(s);
|
|
253
|
+
i === g.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : i === g.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
240
254
|
}
|
|
241
255
|
}
|
|
242
256
|
});
|
|
@@ -244,14 +258,14 @@ class H extends y {
|
|
|
244
258
|
async _loadBlockState(e) {
|
|
245
259
|
if (!("getAttribute" in e))
|
|
246
260
|
return;
|
|
247
|
-
const t = e.getAttribute(n.PAGE_TYPE),
|
|
248
|
-
if (!t || !
|
|
261
|
+
const t = e.getAttribute(n.PAGE_TYPE), r = e.getAttribute(n.PAGE_LIST);
|
|
262
|
+
if (!t || !r)
|
|
249
263
|
return;
|
|
250
|
-
const
|
|
251
|
-
await
|
|
264
|
+
const s = l(), i = Number(t), u = k(r);
|
|
265
|
+
await s.fetchTemplates(), s.setCollectionWithoutAutoSelection(i), s.loadSelectedTemplates(u);
|
|
252
266
|
}
|
|
253
267
|
_resetStoreState() {
|
|
254
|
-
|
|
268
|
+
l().$reset();
|
|
255
269
|
}
|
|
256
270
|
_removeBlockTemplatesFromStore(e) {
|
|
257
271
|
if (!("getAttribute" in e))
|
|
@@ -259,11 +273,11 @@ class H extends y {
|
|
|
259
273
|
const t = e.getAttribute(n.PAGE_LIST);
|
|
260
274
|
if (!t)
|
|
261
275
|
return;
|
|
262
|
-
const
|
|
263
|
-
|
|
276
|
+
const r = l(), s = k(t);
|
|
277
|
+
r.removeUnsubscribePages(s);
|
|
264
278
|
}
|
|
265
279
|
}
|
|
266
280
|
export {
|
|
267
|
-
|
|
268
|
-
|
|
281
|
+
N as UNSUBSCRIBE_BLOCK_ID,
|
|
282
|
+
W as UnsubscribeBlock
|
|
269
283
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
var T = Object.defineProperty;
|
|
2
|
-
var p = (
|
|
3
|
-
var c = (
|
|
2
|
+
var p = (a, s, e) => s in a ? T(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
|
|
3
|
+
var c = (a, s, e) => p(a, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { useEditorStore as _ } from "../../../stores/editor.js";
|
|
4
5
|
import { useUnsubscribeStore as l } from "../../../stores/unsubscribe.js";
|
|
5
|
-
import { Control as
|
|
6
|
+
import { Control as g, UEAttr as i, UIElementType as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
7
|
import { DATA_ATTRIBUTES as d } from "./utils/constants.js";
|
|
7
8
|
import { parsePageList as h } from "./utils/utils.js";
|
|
8
|
-
const
|
|
9
|
+
const v = "ui-elements-unsubscribe", r = {
|
|
9
10
|
SELECT_BUTTON: "selectTemplateButton",
|
|
10
11
|
PREV_BUTTON: "prevButton",
|
|
11
12
|
NEXT_BUTTON: "nextButton",
|
|
12
13
|
COUNTER_TEXT: "counterText",
|
|
13
14
|
PREVIEW_IMAGE: "previewImage"
|
|
14
15
|
};
|
|
15
|
-
class
|
|
16
|
+
class w extends g {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments);
|
|
18
19
|
c(this, "currentPreviewIndex", 0);
|
|
@@ -22,7 +23,7 @@ class B extends _ {
|
|
|
22
23
|
c(this, "lastParsedAttribute");
|
|
23
24
|
}
|
|
24
25
|
getId() {
|
|
25
|
-
return
|
|
26
|
+
return v;
|
|
26
27
|
}
|
|
27
28
|
getTemplate() {
|
|
28
29
|
return `
|
|
@@ -61,6 +62,8 @@ class B extends _ {
|
|
|
61
62
|
}
|
|
62
63
|
_onButtonClick() {
|
|
63
64
|
try {
|
|
65
|
+
if (_().isPreviewModeOpen)
|
|
66
|
+
return;
|
|
64
67
|
const e = l();
|
|
65
68
|
this._reseedSelectionFromBlock(), e.activeType = e.getSelectedCollection[this.currentPreviewIndex], e.pageSelectionUpdateStatus = !0, e.pageSelectionDrawerStatus = !0;
|
|
66
69
|
} catch (e) {
|
|
@@ -71,8 +74,8 @@ class B extends _ {
|
|
|
71
74
|
const e = l();
|
|
72
75
|
if (e.$reset(), !this.currentNode || !("getAttribute" in this.currentNode))
|
|
73
76
|
return;
|
|
74
|
-
const t = this.currentNode.getAttribute(d.PAGE_TYPE),
|
|
75
|
-
!t || !
|
|
77
|
+
const t = this.currentNode.getAttribute(d.PAGE_TYPE), o = this.currentNode.getAttribute(d.PAGE_LIST);
|
|
78
|
+
!t || !o || (e.setCollectionWithoutAutoSelection(Number(t)), e.loadSelectedTemplates(h(o)));
|
|
76
79
|
}
|
|
77
80
|
_onPrevClick() {
|
|
78
81
|
this.currentPreviewIndex > 0 && (this.currentPreviewIndex--, this._updatePreview(), this._updateCounter());
|
|
@@ -100,8 +103,8 @@ class B extends _ {
|
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
_updateCounter() {
|
|
103
|
-
const e = this.currentPreviewIndex + 1, t = this.totalTemplates,
|
|
104
|
-
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled,
|
|
106
|
+
const e = this.currentPreviewIndex + 1, t = this.totalTemplates, o = this.currentPreviewIndex === 0, u = this.currentPreviewIndex >= t - 1;
|
|
107
|
+
this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, u), this.api.setUIEAttribute(
|
|
105
108
|
r.COUNTER_TEXT,
|
|
106
109
|
i.LABEL.text,
|
|
107
110
|
`${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
|
|
@@ -142,8 +145,8 @@ class B extends _ {
|
|
|
142
145
|
</${n.LABEL}>
|
|
143
146
|
`;
|
|
144
147
|
}
|
|
145
|
-
_getIconButton(e, t,
|
|
146
|
-
const u =
|
|
148
|
+
_getIconButton(e, t, o) {
|
|
149
|
+
const u = o ? `${i.BUTTON.disabled}="true"` : "";
|
|
147
150
|
return `
|
|
148
151
|
<${n.BUTTON}
|
|
149
152
|
id="${e}"
|
|
@@ -172,6 +175,6 @@ class B extends _ {
|
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
177
|
export {
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
v as UNSUBSCRIBE_CONTROL_ID,
|
|
179
|
+
w as UnsubscribeControl
|
|
177
180
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.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-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .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-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}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.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}.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-82128f7d]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-50dac6de]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-50dac6de]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-50dac6de]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-ec5c2ac6]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-ec5c2ac6]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-ec5c2ac6]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-ec5c2ac6]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-ec5c2ac6]{object-fit:cover;transform:scale(1)}[data-v-811cff80] .guido__verion-history-view-option-selection-desktop svg,[data-v-811cff80] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-811cff80] .in-segments-wrapper__button_selected,[data-v-811cff80] .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-06afaecb]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-06afaecb]{min-height:504px}.iframe-wrapper[data-v-cbafc185]{width:258px}.iframe-scaled[data-v-cbafc185]{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-7419ae06] .vueperslides__bullets,[data-v-796d193b] .vueperslides__bullets{pointer-events:none!important}[data-v-796d193b] .vueperslides__parallax-wrapper{height:110px!important}[data-v-cadfc82d] .vueperslides__bullets{pointer-events:none!important}[data-v-cadfc82d] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -1,52 +1,40 @@
|
|
|
1
|
-
import { useHttp as
|
|
2
|
-
import { QUERY_PARAMS as
|
|
3
|
-
const
|
|
4
|
-
(
|
|
5
|
-
attributeName: t.attributeName,
|
|
6
|
-
attributeJs: t.attributeJs,
|
|
7
|
-
attributeType: t.attributeType,
|
|
8
|
-
type: t.type,
|
|
9
|
-
displayName: t.displayName,
|
|
10
|
-
isFilterable: t.isFilterable
|
|
11
|
-
}, a),
|
|
12
|
-
{}
|
|
13
|
-
), f = () => {
|
|
14
|
-
const { get: o } = d(), { get: a } = d({ headers: {} }), t = "6KcLM9TwheVB1mgK";
|
|
1
|
+
import { useHttp as a } from "../composables/useHttp.js";
|
|
2
|
+
import { QUERY_PARAMS as d, URLS as h } from "../enums/extensions/recommendationBlock.js";
|
|
3
|
+
const y = () => {
|
|
4
|
+
const { get: r } = a(), { get: s } = a({ headers: {} }), m = "6KcLM9TwheVB1mgK";
|
|
15
5
|
return {
|
|
16
6
|
fetchRecommendationCreateData: async () => {
|
|
17
7
|
try {
|
|
18
|
-
return (await
|
|
8
|
+
return (await r("/newsletter/recommendations/create-data")).data;
|
|
19
9
|
} catch (e) {
|
|
20
10
|
throw console.error("fetchUserModalState error:", e), e;
|
|
21
11
|
}
|
|
22
12
|
},
|
|
23
13
|
fetchRecommendationFilters: async () => {
|
|
24
14
|
try {
|
|
25
|
-
const { data: e } = await
|
|
26
|
-
|
|
27
|
-
), n = Array.isArray(e) ? e : (e == null ? void 0 : e.data) ?? [];
|
|
28
|
-
return R(n);
|
|
15
|
+
const { data: e } = await r("/stripo/email-recommendation-attributes");
|
|
16
|
+
return e;
|
|
29
17
|
} catch (e) {
|
|
30
18
|
throw console.error("fetchRecommendationFilters error:", e), e;
|
|
31
19
|
}
|
|
32
20
|
},
|
|
33
|
-
fetchRecommendationProducts: async (e,
|
|
34
|
-
var
|
|
21
|
+
fetchRecommendationProducts: async (e, i) => {
|
|
22
|
+
var n;
|
|
35
23
|
try {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
console.debug("🏁 Recommendation API Query:",
|
|
40
|
-
const
|
|
41
|
-
`${
|
|
24
|
+
const t = new URLSearchParams(Object.entries(i));
|
|
25
|
+
t.set(d.CLIENT_ID, m);
|
|
26
|
+
const c = decodeURIComponent(t.toString());
|
|
27
|
+
console.debug("🏁 Recommendation API Query:", c);
|
|
28
|
+
const o = await s(
|
|
29
|
+
`${h.RECOMMENDATION_API_URL}/v2/${e}?${c}`
|
|
42
30
|
);
|
|
43
|
-
return ((
|
|
44
|
-
} catch (
|
|
45
|
-
throw console.error("fetchRecommendationProducts error:",
|
|
31
|
+
return ((n = o == null ? void 0 : o.data) == null ? void 0 : n.data) ?? [];
|
|
32
|
+
} catch (t) {
|
|
33
|
+
throw console.error("fetchRecommendationProducts error:", t), t;
|
|
46
34
|
}
|
|
47
35
|
}
|
|
48
36
|
};
|
|
49
37
|
};
|
|
50
38
|
export {
|
|
51
|
-
|
|
39
|
+
y as useRecommendationApi
|
|
52
40
|
};
|
|
@@ -2,7 +2,6 @@ import type { TextValueObject } from '@@/Types/generic';
|
|
|
2
2
|
import type { RecommendationFeedItem } from '@@/Types/recommendation';
|
|
3
3
|
export declare const URLS: {
|
|
4
4
|
RECOMMENDATION_API_URL: string;
|
|
5
|
-
PRODUCT_ATTRIBUTES_PATH: string;
|
|
6
5
|
};
|
|
7
6
|
export declare const QUERY_PARAMS: {
|
|
8
7
|
CLIENT_ID: string;
|
|
@@ -29,6 +29,12 @@ export declare class UnsubscribeBlock extends Block {
|
|
|
29
29
|
private _ensureLeadingTextGuard;
|
|
30
30
|
private _hasUnsubscribeLink;
|
|
31
31
|
private _readBlockId;
|
|
32
|
+
/**
|
|
33
|
+
* True when the block has a page type and a page list — i.e. a template was
|
|
34
|
+
* applied. A block with neither, combined with an already-present block id,
|
|
35
|
+
* is an undo-restored orphan of a cancelled block.
|
|
36
|
+
*/
|
|
37
|
+
private _hasPageSelection;
|
|
32
38
|
/**
|
|
33
39
|
* Returns the block's stable id, assigning one via the document modifier if
|
|
34
40
|
* the node has not been tagged yet. Idempotent: subsequent calls during
|
|
@@ -10,6 +10,7 @@ interface StoreState {
|
|
|
10
10
|
typeSelectionDrawerStatus: boolean;
|
|
11
11
|
isGlobalUnsubscribeDisabled: boolean;
|
|
12
12
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
13
|
+
pendingBlockId: string | null;
|
|
13
14
|
}
|
|
14
15
|
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guidoUnsubscribe", StoreState, {
|
|
15
16
|
getSelectedCollection: (state: {
|
|
@@ -35,6 +36,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
35
36
|
typeSelectionDrawerStatus: boolean;
|
|
36
37
|
isGlobalUnsubscribeDisabled: boolean;
|
|
37
38
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
39
|
+
pendingBlockId: string | null;
|
|
38
40
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number[];
|
|
39
41
|
getSelectedTemplateByActiveType: (state: {
|
|
40
42
|
templates: {
|
|
@@ -59,6 +61,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
59
61
|
typeSelectionDrawerStatus: boolean;
|
|
60
62
|
isGlobalUnsubscribeDisabled: boolean;
|
|
61
63
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
64
|
+
pendingBlockId: string | null;
|
|
62
65
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => number;
|
|
63
66
|
getTemplatesByActiveType: (state: {
|
|
64
67
|
templates: {
|
|
@@ -83,6 +86,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
83
86
|
typeSelectionDrawerStatus: boolean;
|
|
84
87
|
isGlobalUnsubscribeDisabled: boolean;
|
|
85
88
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
89
|
+
pendingBlockId: string | null;
|
|
86
90
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => {
|
|
87
91
|
id: number;
|
|
88
92
|
name: string;
|
|
@@ -119,6 +123,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
119
123
|
typeSelectionDrawerStatus: boolean;
|
|
120
124
|
isGlobalUnsubscribeDisabled: boolean;
|
|
121
125
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
126
|
+
pendingBlockId: string | null;
|
|
122
127
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => (id: number) => string;
|
|
123
128
|
getSelectedUnsubscribePagesByCollection: (state: {
|
|
124
129
|
templates: {
|
|
@@ -143,6 +148,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
143
148
|
typeSelectionDrawerStatus: boolean;
|
|
144
149
|
isGlobalUnsubscribeDisabled: boolean;
|
|
145
150
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
151
|
+
pendingBlockId: string | null;
|
|
146
152
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => (collectionType: number) => number[];
|
|
147
153
|
isActiveTypeFirstInCollection: (state: {
|
|
148
154
|
templates: {
|
|
@@ -167,6 +173,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
167
173
|
typeSelectionDrawerStatus: boolean;
|
|
168
174
|
isGlobalUnsubscribeDisabled: boolean;
|
|
169
175
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
176
|
+
pendingBlockId: string | null;
|
|
170
177
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
171
178
|
isActiveTypeLastInCollection: (state: {
|
|
172
179
|
templates: {
|
|
@@ -191,6 +198,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
191
198
|
typeSelectionDrawerStatus: boolean;
|
|
192
199
|
isGlobalUnsubscribeDisabled: boolean;
|
|
193
200
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
201
|
+
pendingBlockId: string | null;
|
|
194
202
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
195
203
|
hasTemplatesByCollectionType: (state: {
|
|
196
204
|
templates: {
|
|
@@ -215,6 +223,7 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
215
223
|
typeSelectionDrawerStatus: boolean;
|
|
216
224
|
isGlobalUnsubscribeDisabled: boolean;
|
|
217
225
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
226
|
+
pendingBlockId: string | null;
|
|
218
227
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => Record<number, boolean>;
|
|
219
228
|
unsubscribePagesStatus: (state: {
|
|
220
229
|
templates: {
|
|
@@ -239,10 +248,11 @@ export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"guido
|
|
|
239
248
|
typeSelectionDrawerStatus: boolean;
|
|
240
249
|
isGlobalUnsubscribeDisabled: boolean;
|
|
241
250
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
251
|
+
pendingBlockId: string | null;
|
|
242
252
|
} & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
|
|
243
253
|
}, {
|
|
244
254
|
$reset(): void;
|
|
245
|
-
fetchTemplates(): Promise<void>;
|
|
255
|
+
fetchTemplates(force?: boolean): Promise<void>;
|
|
246
256
|
setCollection(collectionType: number): void;
|
|
247
257
|
setCollectionWithoutAutoSelection(collectionType: number): void;
|
|
248
258
|
setSelectedTemplate(template: number): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
import { defineStore as
|
|
3
|
+
import { defineStore as u } from "pinia";
|
|
4
4
|
let o = null;
|
|
5
5
|
const r = () => ({
|
|
6
6
|
templates: [],
|
|
@@ -12,8 +12,9 @@ const r = () => ({
|
|
|
12
12
|
pageSelectionDrawerStatus: !1,
|
|
13
13
|
typeSelectionDrawerStatus: !1,
|
|
14
14
|
isGlobalUnsubscribeDisabled: !1,
|
|
15
|
-
isSubscriptionPreferencesCenterDisabled: !1
|
|
16
|
-
|
|
15
|
+
isSubscriptionPreferencesCenterDisabled: !1,
|
|
16
|
+
pendingBlockId: null
|
|
17
|
+
}), b = u("guidoUnsubscribe", {
|
|
17
18
|
state: () => r(),
|
|
18
19
|
getters: {
|
|
19
20
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
@@ -62,10 +63,10 @@ const r = () => ({
|
|
|
62
63
|
selectedUnsubscribePages: t
|
|
63
64
|
});
|
|
64
65
|
},
|
|
65
|
-
async fetchTemplates() {
|
|
66
|
-
this.templates.length || (
|
|
67
|
-
const { getUnsubscribePages:
|
|
68
|
-
this.templates = await
|
|
66
|
+
async fetchTemplates(e = !1) {
|
|
67
|
+
!e && this.templates.length || ((e || !o) && (o = (async () => {
|
|
68
|
+
const { getUnsubscribePages: t } = d();
|
|
69
|
+
this.templates = await t();
|
|
69
70
|
})().finally(() => {
|
|
70
71
|
o = null;
|
|
71
72
|
})), await o);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.7.2-beta.
|
|
3
|
+
"version": "3.7.2-beta.cebab71",
|
|
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",
|