@useinsider/guido 3.8.0-beta.910d4af → 3.8.0-beta.eb4074b
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 +12 -15
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +5 -5
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +15 -16
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +37 -42
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +37 -40
- package/dist/composables/useHtmlValidator.js +180 -133
- package/dist/composables/useSave.js +14 -14
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +17 -26
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +64 -69
- package/dist/config/compiler/utils/recommendationIgnoreUtils.js +15 -0
- package/dist/config/migrator/recommendation/extractors.js +44 -22
- package/dist/config/migrator/recommendation/htmlBuilder.js +175 -169
- package/dist/config/migrator/recommendationMigrator.js +30 -31
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +22 -15
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +55 -41
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +42 -43
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +48 -45
- package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +3 -2
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +64 -60
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +294 -335
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +7 -6
- package/dist/extensions/Blocks/Recommendation/extension.js +7 -5
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +4 -2
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +3 -2
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +142 -173
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +56 -29
- package/dist/extensions/Blocks/Recommendation/templates/index.js +30 -8
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +132 -105
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +44 -23
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +112 -64
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +219 -0
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +24 -19
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +30 -22
- package/dist/extensions/Blocks/Unsubscribe/block.js +37 -40
- package/dist/extensions/Blocks/Unsubscribe/control.js +16 -19
- package/dist/extensions/Blocks/controlFactories.js +159 -133
- package/dist/guido.css +1 -1
- package/dist/src/composables/useHtmlValidator.d.ts +27 -0
- package/dist/src/composables/useHtmlValidator.test.d.ts +1 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -1
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.d.ts +17 -0
- package/dist/src/config/compiler/utils/recommendationIgnoreUtils.test.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/extractors.d.ts +15 -0
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +23 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +7 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +29 -47
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +4 -4
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +3 -2
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +165 -11
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +78 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +29 -9
- package/dist/src/extensions/Blocks/controlFactories.d.ts +11 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -11
- package/dist/stores/unsubscribe.js +7 -8
- package/package.json +1 -1
- package/dist/composables/usePreviewInteractionGuard.js +0 -17
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r from "./DesktopPreview.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import o 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 }
|
|
12
|
-
}, i = [],
|
|
13
|
-
|
|
11
|
+
allow-popups-to-escape-sandbox`, srcdoc: t.previewStore.previewHtml } }) : s._e()])])], 1)]);
|
|
12
|
+
}, i = [], p = /* @__PURE__ */ o(
|
|
13
|
+
r,
|
|
14
14
|
a,
|
|
15
15
|
i,
|
|
16
16
|
!1,
|
|
17
17
|
null,
|
|
18
|
-
"
|
|
18
|
+
"988f8da6"
|
|
19
19
|
);
|
|
20
|
-
const
|
|
20
|
+
const _ = p.exports;
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
_ as default
|
|
23
23
|
};
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
const C = /* @__PURE__ */ u({
|
|
1
|
+
import { defineComponent as f, ref as s, onMounted as c, onBeforeUnmount as m, nextTick as u } from "vue";
|
|
2
|
+
import { useTranslations as p } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { usePreviewStore as l } from "../../../../stores/preview.js";
|
|
4
|
+
import _ from "./DesktopBrowserHeader.vue.js";
|
|
5
|
+
const x = /* @__PURE__ */ f({
|
|
7
6
|
__name: "DesktopPreview",
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
7
|
+
setup(v) {
|
|
8
|
+
const a = p(), o = s(), n = s(!1), i = l();
|
|
10
9
|
let e = null;
|
|
11
|
-
const
|
|
12
|
-
t(m.target);
|
|
13
|
-
}, r = () => {
|
|
10
|
+
const t = () => {
|
|
14
11
|
o.value && (e = new ResizeObserver(() => {
|
|
15
|
-
}), e.observe(o.value),
|
|
12
|
+
}), e.observe(o.value), u(() => {
|
|
16
13
|
n.value = !0;
|
|
17
14
|
}));
|
|
18
|
-
},
|
|
15
|
+
}, r = () => {
|
|
19
16
|
e == null || e.disconnect();
|
|
20
17
|
};
|
|
21
|
-
return
|
|
18
|
+
return c(t), m(r), { __sfc: !0, trans: a, containerRef: o, isContainerReady: n, previewStore: i, resizeObserver: e, initIframe: t, cleanIframe: r, DesktopBrowserHeader: _ };
|
|
22
19
|
}
|
|
23
20
|
});
|
|
24
21
|
export {
|
|
25
|
-
|
|
22
|
+
x as default
|
|
26
23
|
};
|
|
@@ -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 o = 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
|
+
}, i = [], r = /* @__PURE__ */ n(
|
|
10
10
|
e,
|
|
11
|
-
c,
|
|
12
11
|
o,
|
|
12
|
+
i,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"e0424e99"
|
|
16
16
|
);
|
|
17
|
-
const d =
|
|
17
|
+
const d = r.exports;
|
|
18
18
|
export {
|
|
19
19
|
d as default
|
|
20
20
|
};
|
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { defineComponent as m, ref as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
const g = /* @__PURE__ */ m({
|
|
1
|
+
import { defineComponent as m, ref as c } from "vue";
|
|
2
|
+
import { useResponsivePreview as f } from "../../../../composables/useResponsivePreview.js";
|
|
3
|
+
import { useTranslations as a } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { usePreviewStore as p } from "../../../../stores/preview.js";
|
|
5
|
+
import { InIcons as u } from "@useinsider/design-system-vue";
|
|
6
|
+
const h = /* @__PURE__ */ m({
|
|
8
7
|
__name: "ContentView",
|
|
9
8
|
emits: ["back-to-inbox"],
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
["transform", "transform-origin", "height"].forEach((
|
|
13
|
-
|
|
9
|
+
setup(v) {
|
|
10
|
+
const i = a(), t = p(), n = c(), { setupResponsivePreview: r } = f(), s = (o) => {
|
|
11
|
+
["transform", "transform-origin", "height"].forEach((e) => {
|
|
12
|
+
o.documentElement.style.removeProperty(e);
|
|
14
13
|
});
|
|
15
14
|
};
|
|
16
|
-
return { __sfc: !0, trans:
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
}, InIcons:
|
|
15
|
+
return { __sfc: !0, trans: i, previewStore: t, iframeRef: n, setupResponsivePreview: r, clearAMPTransforms: s, onLoad: () => {
|
|
16
|
+
const o = n.value, e = o == null ? void 0 : o.contentDocument;
|
|
17
|
+
e && (r(o), t.isAMPResponsive && s(e));
|
|
18
|
+
}, InIcons: u };
|
|
20
19
|
}
|
|
21
20
|
});
|
|
22
21
|
export {
|
|
23
|
-
|
|
22
|
+
h as default
|
|
24
23
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from "./UnsubscribePageSelection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var o = 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() {
|
|
@@ -10,13 +10,13 @@ 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
|
-
}, i = [], c = /* @__PURE__ */
|
|
14
|
-
|
|
13
|
+
}, i = [], c = /* @__PURE__ */ n(
|
|
14
|
+
a,
|
|
15
15
|
o,
|
|
16
16
|
i,
|
|
17
17
|
!1,
|
|
18
18
|
null,
|
|
19
|
-
"
|
|
19
|
+
"f6a8cb4c"
|
|
20
20
|
);
|
|
21
21
|
const _ = c.exports;
|
|
22
22
|
export {
|
|
@@ -1,71 +1,66 @@
|
|
|
1
|
-
import { defineComponent as y, ref as
|
|
2
|
-
import
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
const N = /* @__PURE__ */ y({
|
|
1
|
+
import { defineComponent as y, ref as S, computed as a, watch as T } from "vue";
|
|
2
|
+
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useToaster as C } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as B } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as w } from "../../../enums/toaster.js";
|
|
6
|
+
import { useUnsubscribeStore as h } from "../../../stores/unsubscribe.js";
|
|
7
|
+
import { InContainer as U } from "@useinsider/design-system-vue";
|
|
8
|
+
import P from "./UnsubscribeBreadcrumb.vue.js";
|
|
9
|
+
const L = /* @__PURE__ */ y({
|
|
11
10
|
__name: "UnsubscribePageSelection",
|
|
12
|
-
setup(
|
|
13
|
-
const s =
|
|
11
|
+
setup(_) {
|
|
12
|
+
const s = B(), e = h(), { showToaster: r } = C(), o = S(!1), c = a(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = a(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = a(() => ({
|
|
14
13
|
primaryButton: {
|
|
15
14
|
styling: "solid",
|
|
16
15
|
type: "primary",
|
|
17
|
-
labelText:
|
|
16
|
+
labelText: c.value,
|
|
18
17
|
loadingStatus: o.value,
|
|
19
18
|
disabledStatus: !1
|
|
20
19
|
},
|
|
21
20
|
cancelOrBackButton: {
|
|
22
21
|
styling: "ghost",
|
|
23
22
|
type: "secondary",
|
|
24
|
-
labelText:
|
|
23
|
+
labelText: i.value,
|
|
25
24
|
disabledStatus: o.value
|
|
26
25
|
}
|
|
27
|
-
})),
|
|
26
|
+
})), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", n = (t) => {
|
|
28
27
|
e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
|
|
29
28
|
t();
|
|
30
29
|
}, 500);
|
|
30
|
+
}, d = () => {
|
|
31
|
+
n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel"));
|
|
31
32
|
}, m = () => {
|
|
32
|
-
n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
33
|
-
detail: { blockId: e.pendingBlockId }
|
|
34
|
-
}));
|
|
35
|
-
}, b = () => {
|
|
36
33
|
if (e.isActiveTypeFirstInCollection) {
|
|
37
34
|
n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
|
|
38
35
|
return;
|
|
39
36
|
}
|
|
40
37
|
e.setPreviousType();
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
message: s("global-unsubscribe.pages-were-attached")
|
|
55
|
-
});
|
|
38
|
+
}, b = () => {
|
|
39
|
+
if (e.isActiveTypeLastInCollection) {
|
|
40
|
+
o.value = !0;
|
|
41
|
+
const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), g = e.getSelectedUnsubscribePagesByCollection(t);
|
|
42
|
+
e.removeUnsubscribePages(g), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
|
|
43
|
+
detail: {
|
|
44
|
+
collectionType: t,
|
|
45
|
+
selectedPages: l
|
|
46
|
+
}
|
|
47
|
+
})), n(() => {
|
|
48
|
+
o.value = !1, r({
|
|
49
|
+
type: w.Success,
|
|
50
|
+
message: s("global-unsubscribe.pages-were-attached")
|
|
56
51
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
e.setNextType();
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
60
54
|
}
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
e.setNextType();
|
|
56
|
+
}, f = (t) => {
|
|
57
|
+
e.setSelectedTemplate(t);
|
|
63
58
|
};
|
|
64
|
-
return
|
|
59
|
+
return T(() => e.pageSelectionDrawerStatus, (t) => {
|
|
65
60
|
t && e.pageSelectionUpdateStatus && e.fetchTemplates();
|
|
66
|
-
}), { __sfc: !0, trans: s, unsubscribeStore: e,
|
|
61
|
+
}), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: r, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: n, handleClose: d, handleBack: m, handleSave: b, selectTemplate: f, WpDrawer: v, InContainer: U, UnsubscribeBreadcrumb: P };
|
|
67
62
|
}
|
|
68
63
|
});
|
|
69
64
|
export {
|
|
70
|
-
|
|
65
|
+
L as default
|
|
71
66
|
};
|
|
@@ -2,15 +2,15 @@ import n from "./UnsubscribeTypeSelection.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var i = function() {
|
|
5
|
-
var
|
|
6
|
-
return s(
|
|
5
|
+
var t = this, s = t._self._c, e = t._self._setupProxy;
|
|
6
|
+
return s(e.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": e.descriptionText, "footer-button-group-options": e.footerButtonGroupOptions, status: e.unsubscribeStore.typeSelectionDrawerStatus, "title-text": e.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: e.closeModal, onCloseEvent: e.closeModal, primaryButtonEvent: e.selectCollection } }, [s(e.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: e.isSelecting, "segment-list": e.segmentList, selected: e.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": e.skeletonStatus }, on: { click: e.changeCollection } })], 1);
|
|
7
7
|
}, r = [], c = /* @__PURE__ */ o(
|
|
8
8
|
n,
|
|
9
9
|
i,
|
|
10
10
|
r,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"18e1220a"
|
|
14
14
|
);
|
|
15
15
|
const _ = c.exports;
|
|
16
16
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as v, ref as b, computed as f, watch as _ } from "vue";
|
|
2
2
|
import U from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
3
|
+
import { useToaster as N } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as w } from "../../../composables/useTranslations.js";
|
|
5
5
|
import { ACADEMY_LINKS as D } from "../../../enums/academy.js";
|
|
6
|
-
import { ToasterTypeOptions as
|
|
7
|
-
import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
6
|
+
import { ToasterTypeOptions as P } from "../../../enums/toaster.js";
|
|
7
|
+
import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as G } from "../../../enums/unsubscribe.js";
|
|
8
|
+
import { useUnsubscribeStore as I } from "../../../stores/unsubscribe.js";
|
|
9
9
|
import { InSegments as L } from "@useinsider/design-system-vue";
|
|
10
|
-
const W = /* @__PURE__ */
|
|
10
|
+
const W = /* @__PURE__ */ v({
|
|
11
11
|
__name: "UnsubscribeTypeSelection",
|
|
12
|
-
setup(
|
|
13
|
-
const t =
|
|
12
|
+
setup(O) {
|
|
13
|
+
const t = w(), { showToaster: d } = N(), e = I(), n = b(!1), i = b(!0), o = b(l.GLOBAL_UNSUBSCRIBE), T = t(
|
|
14
14
|
"unsubscription-preference.select-unsubscribe-page-description",
|
|
15
15
|
{ action: `<a href="${D.GLOBAL_UNSUBSCRIBE}" target="_blank">${t("ds-rules.visit-academy")}</a>` }
|
|
16
16
|
), y = f(() => [
|
|
@@ -31,7 +31,7 @@ const W = /* @__PURE__ */ _({
|
|
|
31
31
|
disable: e.isSubscriptionPreferencesCenterDisabled,
|
|
32
32
|
tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
|
|
33
33
|
}
|
|
34
|
-
]),
|
|
34
|
+
]), S = f(
|
|
35
35
|
() => e.isGlobalUnsubscribeDisabled && e.isSubscriptionPreferencesCenterDisabled
|
|
36
36
|
), C = f(() => ({
|
|
37
37
|
primaryButton: {
|
|
@@ -41,8 +41,8 @@ const W = /* @__PURE__ */ _({
|
|
|
41
41
|
n.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
|
|
42
42
|
),
|
|
43
43
|
loadingStatus: n.value,
|
|
44
|
-
disabledStatus:
|
|
45
|
-
skeletonStatus:
|
|
44
|
+
disabledStatus: S.value,
|
|
45
|
+
skeletonStatus: i.value,
|
|
46
46
|
skeletonSizing: { width: 168, height: 40 }
|
|
47
47
|
},
|
|
48
48
|
cancelOrBackButton: {
|
|
@@ -50,62 +50,59 @@ const W = /* @__PURE__ */ _({
|
|
|
50
50
|
type: "secondary",
|
|
51
51
|
labelText: t("products.cancel"),
|
|
52
52
|
disabledStatus: n.value,
|
|
53
|
-
skeletonStatus:
|
|
53
|
+
skeletonStatus: i.value,
|
|
54
54
|
skeletonSizing: { width: 78, height: 40 }
|
|
55
55
|
}
|
|
56
|
-
})),
|
|
57
|
-
e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
58
|
-
detail: { blockId: e.pendingBlockId }
|
|
59
|
-
})), s && setTimeout(() => {
|
|
56
|
+
})), m = (s) => {
|
|
57
|
+
e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel")), s && setTimeout(() => {
|
|
60
58
|
s();
|
|
61
59
|
}, 500);
|
|
62
60
|
}, E = (s) => {
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
const s = e.hasTemplatesByCollectionType,
|
|
66
|
-
if (Object.entries(s).forEach(([
|
|
67
|
-
p ||
|
|
68
|
-
}),
|
|
61
|
+
o.value = s;
|
|
62
|
+
}, g = () => {
|
|
63
|
+
const s = e.hasTemplatesByCollectionType, r = [];
|
|
64
|
+
if (Object.entries(s).forEach(([c, p]) => {
|
|
65
|
+
p || r.push(Number(c));
|
|
66
|
+
}), r.length === 0)
|
|
69
67
|
return !0;
|
|
70
|
-
const
|
|
68
|
+
const B = R(), a = r.map((c) => B[c]);
|
|
71
69
|
let u = "";
|
|
72
|
-
if (
|
|
70
|
+
if (r.length === 1)
|
|
73
71
|
u = t("unsubscription-preference.create-page-to-continue", {
|
|
74
|
-
page:
|
|
72
|
+
page: a[0]
|
|
75
73
|
});
|
|
76
|
-
else if (
|
|
74
|
+
else if (r.length === 2)
|
|
77
75
|
u = t("unsubscription-preference.create-pages-to-continue", {
|
|
78
|
-
page1:
|
|
79
|
-
page2:
|
|
76
|
+
page1: a[0],
|
|
77
|
+
page2: a[1]
|
|
80
78
|
});
|
|
81
79
|
else {
|
|
82
|
-
const
|
|
80
|
+
const c = a.pop() ?? "", p = a.join(", ");
|
|
83
81
|
u = t("unsubscription-preference.create-multiple-pages-to-continue", {
|
|
84
82
|
pages: p,
|
|
85
|
-
lastPage:
|
|
83
|
+
lastPage: c
|
|
86
84
|
});
|
|
87
85
|
}
|
|
88
86
|
return d({
|
|
89
|
-
type:
|
|
87
|
+
type: P.Warning,
|
|
90
88
|
message: u,
|
|
91
89
|
actionButton: {
|
|
92
90
|
text: "Go to Unsubscribe Pages",
|
|
93
91
|
onClick: () => {
|
|
94
|
-
|
|
95
|
-
window.open(i, "_blank", "noopener");
|
|
92
|
+
window.location.href = G;
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
95
|
}), !1;
|
|
99
|
-
},
|
|
100
|
-
if (n.value = !0, await e.fetchTemplates(
|
|
101
|
-
n.value = !1,
|
|
96
|
+
}, h = async () => {
|
|
97
|
+
if (n.value = !0, await e.fetchTemplates(), e.setCollection(o.value), !g()) {
|
|
98
|
+
n.value = !1, m();
|
|
102
99
|
return;
|
|
103
100
|
}
|
|
104
101
|
n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
|
|
105
102
|
};
|
|
106
|
-
return
|
|
107
|
-
s && (
|
|
108
|
-
}), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus:
|
|
103
|
+
return _(() => e.typeSelectionDrawerStatus, (s) => {
|
|
104
|
+
s && (i.value = !0, o.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (o.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), i.value = !1);
|
|
105
|
+
}), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: i, selectedCollection: o, descriptionText: T, segmentList: y, hasNoSelectableType: S, footerButtonGroupOptions: C, closeModal: m, changeCollection: E, validateTemplates: g, selectCollection: h, WpDrawer: U, InSegments: L };
|
|
109
106
|
}
|
|
110
107
|
});
|
|
111
108
|
export {
|