@useinsider/guido 3.8.0-beta.84f6c0a → 3.8.0-beta.910d4af
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 +5 -5
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +42 -37
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +3 -3
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +40 -37
- package/dist/composables/usePreviewInteractionGuard.js +17 -0
- package/dist/composables/useSave.js +14 -14
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +26 -17
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +25 -19
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +10 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +26 -24
- package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +39 -30
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +34 -28
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +333 -285
- package/dist/extensions/Blocks/Recommendation/extension.js +5 -6
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +2 -3
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +173 -142
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +30 -56
- package/dist/extensions/Blocks/Recommendation/templates/index.js +8 -29
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +105 -132
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +23 -44
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +64 -112
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +19 -24
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +22 -30
- package/dist/extensions/Blocks/Unsubscribe/block.js +40 -37
- package/dist/extensions/Blocks/Unsubscribe/control.js +19 -16
- package/dist/extensions/Blocks/controlFactories.js +133 -159
- package/dist/guido.css +1 -1
- package/dist/src/composables/usePreviewInteractionGuard.d.ts +3 -0
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +1 -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 +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/layoutOrientation.d.ts +1 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +47 -20
- 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 +2 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +11 -165
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +9 -29
- package/dist/src/extensions/Blocks/controlFactories.d.ts +1 -11
- package/dist/src/stores/unsubscribe.d.ts +11 -1
- package/dist/stores/unsubscribe.js +8 -7
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/captureStyleTemplates.js +0 -219
- package/dist/src/extensions/Blocks/Recommendation/utils/captureStyleTemplates.d.ts +0 -78
|
@@ -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
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import n from "./UnsubscribePageSelection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
3
|
+
import a 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__ */ a(
|
|
14
|
+
n,
|
|
15
15
|
o,
|
|
16
16
|
i,
|
|
17
17
|
!1,
|
|
18
18
|
null,
|
|
19
|
-
"
|
|
19
|
+
"669fe7cf"
|
|
20
20
|
);
|
|
21
21
|
const _ = c.exports;
|
|
22
22
|
export {
|
|
@@ -1,66 +1,71 @@
|
|
|
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
|
-
|
|
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
|
+
import { useToaster as B } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as C } from "../../../composables/useTranslations.js";
|
|
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 I from "./UnsubscribeBreadcrumb.vue.js";
|
|
10
|
+
const N = /* @__PURE__ */ y({
|
|
10
11
|
__name: "UnsubscribePageSelection",
|
|
11
|
-
setup(
|
|
12
|
-
const s =
|
|
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(() => ({
|
|
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
|
+
detail: { blockId: e.pendingBlockId }
|
|
34
|
+
}));
|
|
35
|
+
}, b = () => {
|
|
33
36
|
if (e.isActiveTypeFirstInCollection) {
|
|
34
37
|
n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
|
|
35
38
|
return;
|
|
36
39
|
}
|
|
37
40
|
e.setPreviousType();
|
|
38
|
-
},
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
}, f = () => {
|
|
42
|
+
if (!r.isPreviewModeOpen) {
|
|
43
|
+
if (e.isActiveTypeLastInCollection) {
|
|
44
|
+
o.value = !0;
|
|
45
|
+
const t = e.selectedCollectionType, u = e.getSelectedTemplatesByCollection(t), S = e.getSelectedUnsubscribePagesByCollection(t);
|
|
46
|
+
e.removeUnsubscribePages(S), e.addUnsubscribePages(u), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
|
|
47
|
+
detail: {
|
|
48
|
+
collectionType: t,
|
|
49
|
+
selectedPages: u
|
|
50
|
+
}
|
|
51
|
+
})), n(() => {
|
|
52
|
+
o.value = !1, c({
|
|
53
|
+
type: h.Success,
|
|
54
|
+
message: s("global-unsubscribe.pages-were-attached")
|
|
55
|
+
});
|
|
51
56
|
});
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
e.setNextType();
|
|
54
60
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
e.setSelectedTemplate(t);
|
|
61
|
+
}, g = (t) => {
|
|
62
|
+
r.isPreviewModeOpen || e.setSelectedTemplate(t);
|
|
58
63
|
};
|
|
59
|
-
return
|
|
64
|
+
return v(() => e.pageSelectionDrawerStatus, (t) => {
|
|
60
65
|
t && e.pageSelectionUpdateStatus && e.fetchTemplates();
|
|
61
|
-
}), { __sfc: !0, trans: s, unsubscribeStore: e,
|
|
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 };
|
|
62
67
|
}
|
|
63
68
|
});
|
|
64
69
|
export {
|
|
65
|
-
|
|
70
|
+
N as default
|
|
66
71
|
};
|
|
@@ -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 e = this, s = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return s(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", "description-text": t.descriptionText, "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.typeSelectionDrawerStatus, "title-text": t.trans("unsubscription-preference.select-unsubscribe-page-title") }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.selectCollection } }, [s(t.InSegments, { staticClass: "w-1", attrs: { "with-icon": "", align: "vertical", disable: t.isSelecting, "segment-list": t.segmentList, selected: t.selectedCollection, "skeleton-sizing": { width: 495, height: 180 }, "skeleton-status": t.skeletonStatus }, on: { click: t.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
|
+
"7a305bb2"
|
|
14
14
|
);
|
|
15
15
|
const _ = c.exports;
|
|
16
16
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as _, ref as b, computed as f, watch as v } from "vue";
|
|
2
2
|
import U from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
3
|
+
import { useToaster as w } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as N } 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 I } from "../../../enums/toaster.js";
|
|
7
|
+
import { PAGE_TYPES as l, getTypeTranslations as R, UNSUBSCRIBE_PAGES_LINK as P } from "../../../enums/unsubscribe.js";
|
|
8
|
+
import { useUnsubscribeStore as G } from "../../../stores/unsubscribe.js";
|
|
9
9
|
import { InSegments as L } from "@useinsider/design-system-vue";
|
|
10
|
-
const W = /* @__PURE__ */
|
|
10
|
+
const W = /* @__PURE__ */ _({
|
|
11
11
|
__name: "UnsubscribeTypeSelection",
|
|
12
|
-
setup(
|
|
13
|
-
const t =
|
|
12
|
+
setup(k) {
|
|
13
|
+
const t = N(), { showToaster: d } = w(), e = G(), n = b(!1), o = b(!0), r = 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__ */ v({
|
|
|
31
31
|
disable: e.isSubscriptionPreferencesCenterDisabled,
|
|
32
32
|
tooltipText: e.isSubscriptionPreferencesCenterDisabled ? t("unsubscription-preference.pref-center-added") : ""
|
|
33
33
|
}
|
|
34
|
-
]),
|
|
34
|
+
]), g = f(
|
|
35
35
|
() => e.isGlobalUnsubscribeDisabled && e.isSubscriptionPreferencesCenterDisabled
|
|
36
36
|
), C = f(() => ({
|
|
37
37
|
primaryButton: {
|
|
@@ -41,8 +41,8 @@ const W = /* @__PURE__ */ v({
|
|
|
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: g.value,
|
|
45
|
+
skeletonStatus: o.value,
|
|
46
46
|
skeletonSizing: { width: 168, height: 40 }
|
|
47
47
|
},
|
|
48
48
|
cancelOrBackButton: {
|
|
@@ -50,59 +50,62 @@ const W = /* @__PURE__ */ v({
|
|
|
50
50
|
type: "secondary",
|
|
51
51
|
labelText: t("products.cancel"),
|
|
52
52
|
disabledStatus: n.value,
|
|
53
|
-
skeletonStatus:
|
|
53
|
+
skeletonStatus: o.value,
|
|
54
54
|
skeletonSizing: { width: 78, height: 40 }
|
|
55
55
|
}
|
|
56
|
-
})),
|
|
57
|
-
e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel"
|
|
56
|
+
})), S = (s) => {
|
|
57
|
+
e.typeSelectionDrawerStatus = !1, document.dispatchEvent(new CustomEvent("unsubscribe:cancel", {
|
|
58
|
+
detail: { blockId: e.pendingBlockId }
|
|
59
|
+
})), s && setTimeout(() => {
|
|
58
60
|
s();
|
|
59
61
|
}, 500);
|
|
60
62
|
}, E = (s) => {
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
const s = e.hasTemplatesByCollectionType,
|
|
64
|
-
if (Object.entries(s).forEach(([
|
|
65
|
-
p ||
|
|
66
|
-
}),
|
|
63
|
+
r.value = s;
|
|
64
|
+
}, m = () => {
|
|
65
|
+
const s = e.hasTemplatesByCollectionType, a = [];
|
|
66
|
+
if (Object.entries(s).forEach(([i, p]) => {
|
|
67
|
+
p || a.push(Number(i));
|
|
68
|
+
}), a.length === 0)
|
|
67
69
|
return !0;
|
|
68
|
-
const
|
|
70
|
+
const h = R(), c = a.map((i) => h[i]);
|
|
69
71
|
let u = "";
|
|
70
|
-
if (
|
|
72
|
+
if (a.length === 1)
|
|
71
73
|
u = t("unsubscription-preference.create-page-to-continue", {
|
|
72
|
-
page:
|
|
74
|
+
page: c[0]
|
|
73
75
|
});
|
|
74
|
-
else if (
|
|
76
|
+
else if (a.length === 2)
|
|
75
77
|
u = t("unsubscription-preference.create-pages-to-continue", {
|
|
76
|
-
page1:
|
|
77
|
-
page2:
|
|
78
|
+
page1: c[0],
|
|
79
|
+
page2: c[1]
|
|
78
80
|
});
|
|
79
81
|
else {
|
|
80
|
-
const
|
|
82
|
+
const i = c.pop() ?? "", p = c.join(", ");
|
|
81
83
|
u = t("unsubscription-preference.create-multiple-pages-to-continue", {
|
|
82
84
|
pages: p,
|
|
83
|
-
lastPage:
|
|
85
|
+
lastPage: i
|
|
84
86
|
});
|
|
85
87
|
}
|
|
86
88
|
return d({
|
|
87
|
-
type:
|
|
89
|
+
type: I.Warning,
|
|
88
90
|
message: u,
|
|
89
91
|
actionButton: {
|
|
90
92
|
text: "Go to Unsubscribe Pages",
|
|
91
93
|
onClick: () => {
|
|
92
|
-
window.location.href
|
|
94
|
+
const i = new URL(P, window.location.origin).href;
|
|
95
|
+
window.open(i, "_blank", "noopener");
|
|
93
96
|
}
|
|
94
97
|
}
|
|
95
98
|
}), !1;
|
|
96
|
-
},
|
|
97
|
-
if (n.value = !0, await e.fetchTemplates(), e.setCollection(
|
|
98
|
-
n.value = !1,
|
|
99
|
+
}, B = async () => {
|
|
100
|
+
if (n.value = !0, await e.fetchTemplates(!0), e.setCollection(r.value), !m()) {
|
|
101
|
+
n.value = !1, S();
|
|
99
102
|
return;
|
|
100
103
|
}
|
|
101
104
|
n.value = !1, e.typeSelectionDrawerStatus = !1, e.pageSelectionDrawerStatus = !0;
|
|
102
105
|
};
|
|
103
|
-
return
|
|
104
|
-
s && (
|
|
105
|
-
}), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus:
|
|
106
|
+
return v(() => e.typeSelectionDrawerStatus, (s) => {
|
|
107
|
+
s && (o.value = !0, r.value = l.GLOBAL_UNSUBSCRIBE, e.isGlobalUnsubscribeDisabled && (r.value = e.isSubscriptionPreferencesCenterDisabled ? 0 : l.SUBSCRIPTION_PREFERENCE_CENTER), o.value = !1);
|
|
108
|
+
}), { __sfc: !0, trans: t, showToaster: d, unsubscribeStore: e, isSelecting: n, skeletonStatus: o, selectedCollection: r, descriptionText: T, segmentList: y, hasNoSelectableType: g, footerButtonGroupOptions: C, closeModal: S, changeCollection: E, validateTemplates: m, selectCollection: B, WpDrawer: U, InSegments: L };
|
|
106
109
|
}
|
|
107
110
|
});
|
|
108
111
|
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,32 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as H } from "./useActionsApi.js";
|
|
2
2
|
import { useConfig as y } from "./useConfig.js";
|
|
3
|
-
import { useSaveStart as w, useSaveComplete as
|
|
3
|
+
import { useSaveStart as w, useSaveComplete as k } from "./useGuidoActions.js";
|
|
4
4
|
import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
|
|
5
5
|
import { useStripoApi as C } from "../services/stripoApi.js";
|
|
6
6
|
import { useTemplatePreparation as E } from "../utils/templatePreparation.js";
|
|
7
|
-
import { useHtmlValidator as
|
|
7
|
+
import { useHtmlValidator as B } from "./useHtmlValidator.js";
|
|
8
8
|
import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
|
|
9
9
|
import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
|
|
10
|
-
import { useUnsubscribeBlockValidator as
|
|
11
|
-
const
|
|
12
|
-
const o = w(), s =
|
|
13
|
-
return { save: async (f = !1,
|
|
10
|
+
import { useUnsubscribeBlockValidator as U } from "./validators/useUnsubscribeBlockValidator.js";
|
|
11
|
+
const K = () => {
|
|
12
|
+
const o = w(), s = k(), { validateHtml: r } = B(), { validateLiquidSyntax: l } = P(), { validateCouponBlockTags: n } = L(), { validateUnsubscribeBlockUniqueness: d, validateUnsubscribeBlockHasTemplate: c } = U(), { callbacks: i, isFeatureEnabled: u } = y(), { extractSyncModuleData: m } = q(), { setSyncModuleUnsubscriptionPages: p } = C(), { editorSave: v } = H();
|
|
13
|
+
return { save: async (f = !1, S = !1) => {
|
|
14
14
|
var a;
|
|
15
15
|
o();
|
|
16
|
-
const { prepareTemplateDetails:
|
|
17
|
-
if (!
|
|
16
|
+
const { prepareTemplateDetails: V } = E(), t = await V();
|
|
17
|
+
if (!n(t.compiledHtml) || !d(t.compiledHtml) || !c(t.compiledHtml))
|
|
18
18
|
return;
|
|
19
19
|
if (u("liquidSyntax")) {
|
|
20
|
-
if (!await
|
|
20
|
+
if (!await l(t.compiledHtml))
|
|
21
21
|
return;
|
|
22
22
|
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
23
23
|
return;
|
|
24
|
-
if ((a = i.value) != null && a.externalValidation && !await i.value.externalValidation(t) || !await
|
|
24
|
+
if ((a = i.value) != null && a.externalValidation && !await i.value.externalValidation(t) || !await v())
|
|
25
25
|
return;
|
|
26
|
-
const { unsubscribePayload:
|
|
27
|
-
return await
|
|
26
|
+
const { unsubscribePayload: b, stripoModules: x } = m(t.rawHtml);
|
|
27
|
+
return await p(b), t.modules = x, f || s({ ...t, silent: S }), t;
|
|
28
28
|
} };
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
K as useSave
|
|
32
32
|
};
|
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
import { ToasterTypeOptions as i } from "../../enums/toaster.js";
|
|
2
|
-
import { PAGE_TYPES as
|
|
3
|
-
import { UNSUBSCRIBE_BLOCK_SELECTOR as
|
|
4
|
-
import { useToaster as
|
|
2
|
+
import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
4
|
+
import { useToaster as m } from "../useToaster.js";
|
|
5
5
|
import { useTranslations as E } from "../useTranslations.js";
|
|
6
|
-
const
|
|
6
|
+
const T = [
|
|
7
7
|
{
|
|
8
|
-
pageType:
|
|
8
|
+
pageType: u.GLOBAL_UNSUBSCRIBE,
|
|
9
9
|
messageKey: "unsubscription-preference.duplicate-global-unsub"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
|
-
pageType:
|
|
12
|
+
pageType: u.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
13
13
|
messageKey: "unsubscription-preference.duplicate-pref-center"
|
|
14
14
|
}
|
|
15
|
-
], g = "unsubscription-preference.duplicate-both",
|
|
16
|
-
const { showToaster:
|
|
17
|
-
return { validateUnsubscribeBlockUniqueness: (
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
const r = Number(e.getAttribute(
|
|
21
|
-
|
|
15
|
+
], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
|
|
16
|
+
const { showToaster: c } = m(), p = E();
|
|
17
|
+
return { validateUnsubscribeBlockUniqueness: (n) => {
|
|
18
|
+
const o = new DOMParser().parseFromString(n, "text/html"), s = /* @__PURE__ */ new Map();
|
|
19
|
+
o.querySelectorAll(l).forEach((e) => {
|
|
20
|
+
const r = Number(e.getAttribute(a.PAGE_TYPE));
|
|
21
|
+
s.set(r, (s.get(r) ?? 0) + 1);
|
|
22
22
|
});
|
|
23
|
-
const
|
|
24
|
-
return
|
|
23
|
+
const t = T.filter((e) => (s.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
|
|
24
|
+
return t.length ? (c({
|
|
25
25
|
type: i.Alert,
|
|
26
|
-
message:
|
|
26
|
+
message: p(t.length > 1 ? g : t[0])
|
|
27
|
+
}), !1) : !0;
|
|
28
|
+
}, validateUnsubscribeBlockHasTemplate: (n) => {
|
|
29
|
+
const o = new DOMParser().parseFromString(n, "text/html");
|
|
30
|
+
return Array.from(o.querySelectorAll(l)).some((t) => {
|
|
31
|
+
const e = t.getAttribute(a.PAGE_TYPE), r = t.getAttribute(a.PAGE_LIST);
|
|
32
|
+
return !e || !r;
|
|
33
|
+
}) ? (c({
|
|
34
|
+
type: i.Warning,
|
|
35
|
+
message: p(b)
|
|
27
36
|
}), !1) : !0;
|
|
28
37
|
} };
|
|
29
38
|
};
|
|
30
39
|
export {
|
|
31
|
-
|
|
40
|
+
P as useUnsubscribeBlockValidator
|
|
32
41
|
};
|