@useinsider/guido 2.1.0-beta.4bfe3ad → 2.1.0-beta.52e56ab
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/@types/config/schemas.js +1 -1
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +13 -11
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +23 -54
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +3 -3
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +21 -34
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +11 -11
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +34 -44
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
- package/dist/composables/useStripo.js +25 -23
- package/dist/composables/useVersionHistoryApi.js +1 -1
- package/dist/config/i18n/en/index.js +11 -0
- package/dist/config/i18n/en/labels.json.js +7 -0
- package/dist/config/i18n/en/toasters.json.js +56 -0
- package/dist/config/i18n/en/tooltips.json.js +82 -0
- package/dist/config/i18n/index.js +7 -0
- package/dist/config/migrator/itemsBlockMigrator.js +65 -64
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +39 -58
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +57 -93
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
- package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
- package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
- package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -1
- package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +1 -15
- package/dist/src/config/i18n/en/index.d.ts +1 -0
- package/dist/src/config/i18n/index.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -18
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/static/styles/components/notification.css.js +18 -0
- package/dist/static/styles/components/tools.css.js +6 -2
- package/dist/static/styles/variables.css.js +2 -0
- package/dist/stores/unsubscribe.js +37 -34
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +0 -29
- package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +0 -15
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModuleFolderDefaults as b } from "../../enums/defaults.js";
|
|
2
|
-
import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n,
|
|
2
|
+
import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, custom as S, boolean as a, array as c, minLength as d, literal as r, variant as k } from "../../node_modules/valibot/dist/index.js";
|
|
3
3
|
const m = {
|
|
4
4
|
/** Promotional/marketing emails */
|
|
5
5
|
PROMOTIONAL: 1,
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import r from "./FilterItem.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var l = function() {
|
|
5
5
|
var a = this, e = a._self._c, t = a._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f f-d-c w-1 gap-16"
|
|
6
|
+
return e("div", { staticClass: "d-f f-d-c w-1 gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b pt-4", class: { "bor-t-s-s bor-t-w-1 bor-t-c-50": a.index === 0 } }, [e("p", [a._v(" " + a._s(t.trans("newsletter.filter")) + " " + a._s(a.index + 1) + " ")]), e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: function(s) {
|
|
7
7
|
return t.emit("delete-filter", t.props.filter);
|
|
8
|
-
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList,
|
|
8
|
+
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "disabled-status": "", "search-status": "", "button-status": !1, "label-text": t.trans("action-builder.filter-type"), options: t.filterTypeOptions, value: [t.filterTypeOptions[0]] } }), e(t.InSelect, { staticClass: "w-2", attrs: { id: "filter-item-input--attribute-type", "search-status": "", "static-position": "bottom right", "button-status": !1, "label-text": t.trans("condition.attribute"), options: t.store.getFilterList, value: [t.selectedAttributeType] }, on: { select: function(s) {
|
|
9
|
+
return t.updateFilter({ text: "attribute", value: s.value });
|
|
10
|
+
} } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), value: [t.selectedOperatorType] }, on: { select: function(s) {
|
|
9
11
|
return t.updateFilter({ text: "operator", value: s.value });
|
|
10
|
-
} } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "
|
|
12
|
+
} } }), e(t.InBasicTextInput, { staticClass: "w-2", attrs: { id: "filter-item-input--value", name: "imageUrl", type: "text", "character-counter-status": !1, "label-text": t.trans("condition.value"), "max-character-length": 25, "placeholder-text": t.trans("condition.enter-value-placeholder"), "tooltip-status": !1, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
|
|
11
13
|
t.updateFilter({ text: "value", value: encodeURIComponent(s) });
|
|
12
|
-
} } })]
|
|
14
|
+
} } })], 1), t.props.hasLogicAdapter ? e("div", { staticClass: "w-1 d-f a-i-c j-c-c p-r bor-b-s-s bor-b-w-1 bor-b-c-50 mt-4" }, [e(t.LogicAdapter, { staticClass: "p-a", attrs: { logic: t.props.filter.innerGroupOperator }, on: { change: function(s) {
|
|
13
15
|
return t.updateFilter({ text: "innerGroupOperator", value: s });
|
|
14
16
|
} } })], 1) : a._e()]);
|
|
15
|
-
},
|
|
17
|
+
}, n = [], o = /* @__PURE__ */ i(
|
|
16
18
|
r,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
l,
|
|
20
|
+
n,
|
|
19
21
|
!1,
|
|
20
22
|
null,
|
|
21
|
-
"
|
|
23
|
+
"6562e38c"
|
|
22
24
|
);
|
|
23
|
-
const f =
|
|
25
|
+
const f = o.exports;
|
|
24
26
|
export {
|
|
25
27
|
f as default
|
|
26
28
|
};
|
|
@@ -1,69 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
3
|
-
import { getOperatorOptions as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
const K = /* @__PURE__ */ _({
|
|
1
|
+
import { defineComponent as f, computed as i } from "vue";
|
|
2
|
+
import { useTranslations as v } from "../../../../composables/useTranslations.js";
|
|
3
|
+
import { getOperatorOptions as a } from "../../../../enums/extensions/recommendationBlock.js";
|
|
4
|
+
import { useRecommendationExtensionStore as x } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import { InButtonV2 as y, InSelect as F, InBasicTextInput as T } from "@useinsider/design-system-vue";
|
|
6
|
+
import _ from "./LogicAdapter.vue.js";
|
|
7
|
+
import { useDebounceFn as b } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
8
|
+
const h = /* @__PURE__ */ f({
|
|
10
9
|
__name: "FilterItem",
|
|
11
10
|
props: {
|
|
12
11
|
filter: null,
|
|
13
12
|
index: null,
|
|
14
|
-
hasLogicAdapter: { type: Boolean }
|
|
15
|
-
submitted: { type: Boolean }
|
|
13
|
+
hasLogicAdapter: { type: Boolean }
|
|
16
14
|
},
|
|
17
15
|
emits: ["delete-filter"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
16
|
+
setup(p, { emit: u }) {
|
|
17
|
+
const e = p, n = v(), r = x(), m = [
|
|
20
18
|
{
|
|
21
19
|
text: n("email-editor.standard-filter"),
|
|
22
20
|
value: "standardFilter"
|
|
23
21
|
}
|
|
24
|
-
], i =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return p((e = r.value) == null ? void 0 : e.type).find((o) => o.value === t.filter.operator);
|
|
35
|
-
}), g = l(
|
|
36
|
-
() => i.find((e) => e.value === t.filter.value) || i[0]
|
|
37
|
-
), u = l(() => t.submitted ? A(t.filter) : /* @__PURE__ */ new Set()), h = (e) => u.value.has(e) ? "error" : "default", B = l(
|
|
38
|
-
() => u.value.has("value") ? n("action-builder.filter-empty-value-error") : ""
|
|
39
|
-
), c = l(
|
|
40
|
-
() => {
|
|
41
|
-
var e;
|
|
42
|
-
return ((e = r.value) == null ? void 0 : e.type) === "Number";
|
|
43
|
-
}
|
|
44
|
-
), x = l(() => c.value ? "number" : "text"), T = N((e) => {
|
|
45
|
-
a.updateFilter({
|
|
46
|
-
...t.filter,
|
|
47
|
-
[e.text]: e.value
|
|
48
|
-
});
|
|
22
|
+
], s = i(() => e.filter.attribute || ""), l = i(() => r.getFilterList.find((t) => t.value === s.value) || { text: "", value: "", type: "" }), c = i(() => {
|
|
23
|
+
var t;
|
|
24
|
+
return a((t = l.value) == null ? void 0 : t.type).find((o) => o.value === e.filter.operator);
|
|
25
|
+
}), d = b((t) => {
|
|
26
|
+
console.debug("updateFilter: ", t);
|
|
27
|
+
const o = {
|
|
28
|
+
...e.filter,
|
|
29
|
+
[t.text]: t.value
|
|
30
|
+
};
|
|
31
|
+
r.updateFilter(o);
|
|
49
32
|
}, 500);
|
|
50
|
-
return { __sfc: !0, trans: n, store:
|
|
51
|
-
const o = a.getFilterList.find((I) => I.value === e.value), m = (o == null ? void 0 : o.type) === "Boolean", [s] = p(o == null ? void 0 : o.type);
|
|
52
|
-
a.updateFilter({
|
|
53
|
-
...t.filter,
|
|
54
|
-
attribute: e.value,
|
|
55
|
-
operator: m ? "=" : (s == null ? void 0 : s.value) ?? "",
|
|
56
|
-
value: m ? "true" : ""
|
|
57
|
-
});
|
|
58
|
-
}, handleBooleanValueChange: (e) => {
|
|
59
|
-
a.updateFilter({
|
|
60
|
-
...t.filter,
|
|
61
|
-
operator: "=",
|
|
62
|
-
value: e.value
|
|
63
|
-
});
|
|
64
|
-
}, getOperatorOptions: p, InBasicTextInput: S, InSelect: O, InButtonV2: L, LogicAdapter: E };
|
|
33
|
+
return { __sfc: !0, trans: n, store: r, props: e, filterTypeOptions: m, attributeType: s, selectedAttributeType: l, selectedOperatorType: c, emit: u, updateFilter: d, getOperatorOptions: a, InBasicTextInput: T, InSelect: F, InButtonV2: y, LogicAdapter: _ };
|
|
65
34
|
}
|
|
66
35
|
});
|
|
67
36
|
export {
|
|
68
|
-
|
|
37
|
+
h as default
|
|
69
38
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import o from "./FilterSelectionDrawer.vue2.js";
|
|
2
2
|
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
-
var
|
|
3
|
+
var l = function() {
|
|
4
4
|
var e = this, r = e._self._c, t = e._self._setupProxy;
|
|
5
|
-
return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "
|
|
5
|
+
return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "title-text": "Filter Selection", "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.filterSelectionDrawerStatus }, on: { cancelOrBackButtonEvent: t.closeModal, onCloseEvent: t.closeModal, primaryButtonEvent: t.applyFilter } }, [r(t.Filters)], 1);
|
|
6
6
|
}, s = [], a = /* @__PURE__ */ n(
|
|
7
7
|
o,
|
|
8
|
-
|
|
8
|
+
l,
|
|
9
9
|
s,
|
|
10
10
|
!1,
|
|
11
11
|
null,
|
|
@@ -1,51 +1,38 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { useRecommendationExtensionStore as
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const I = /* @__PURE__ */ d({
|
|
1
|
+
import { defineComponent as n, ref as a, computed as l } from "vue";
|
|
2
|
+
import i from "../../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useTranslations as c } from "../../../../composables/useTranslations.js";
|
|
4
|
+
import { useRecommendationExtensionStore as p } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
5
|
+
import u from "./Filters.vue.js";
|
|
6
|
+
const v = /* @__PURE__ */ n({
|
|
8
7
|
__name: "FilterSelectionDrawer",
|
|
9
|
-
setup(
|
|
10
|
-
const r =
|
|
11
|
-
y(() => e.filterSelectionDrawerStatus, (n) => {
|
|
12
|
-
n && (o.value = !1);
|
|
13
|
-
});
|
|
14
|
-
const f = g(() => ({
|
|
8
|
+
setup(f) {
|
|
9
|
+
const r = c(), t = p(), e = a(!1), s = l(() => ({
|
|
15
10
|
primaryButton: {
|
|
16
11
|
styling: "solid",
|
|
17
12
|
type: "primary",
|
|
18
13
|
labelText: r(
|
|
19
|
-
|
|
14
|
+
e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
|
|
20
15
|
),
|
|
21
|
-
loadingStatus:
|
|
16
|
+
loadingStatus: e.value,
|
|
17
|
+
disabledStatus: !1
|
|
22
18
|
},
|
|
23
19
|
cancelOrBackButton: {
|
|
24
20
|
styling: "ghost",
|
|
25
21
|
type: "secondary",
|
|
26
22
|
labelText: r("products.cancel"),
|
|
27
|
-
disabledStatus:
|
|
23
|
+
disabledStatus: e.value
|
|
28
24
|
}
|
|
29
|
-
}))
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const { filters: n } = e.recommendationConfigs, i = n.find((l) => !_(l));
|
|
36
|
-
if (i) {
|
|
37
|
-
(u = c.value) == null || u.switchToGroup(i.filterGroup), await v();
|
|
38
|
-
const { filterGroup: l, filterNumber: p } = i, m = `[data-filter-group="${l}"][data-filter-number="${p}"]`, s = document.querySelector(m);
|
|
39
|
-
s == null || s.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
t.value = !0, e.patchCurrentBlockConfig(
|
|
43
|
-
{ filters: e.recommendationConfigs.filters },
|
|
25
|
+
})), o = () => {
|
|
26
|
+
t.closeFilterDrawer();
|
|
27
|
+
};
|
|
28
|
+
return { __sfc: !0, trans: r, store: t, isApplying: e, footerButtonGroupOptions: s, closeModal: o, applyFilter: () => {
|
|
29
|
+
e.value = !0, t.patchCurrentBlockConfig(
|
|
30
|
+
{ filters: t.recommendationConfigs.filters },
|
|
44
31
|
{ triggerRefetch: !0 }
|
|
45
|
-
),
|
|
46
|
-
}, WpDrawer:
|
|
32
|
+
), o(), e.value = !1;
|
|
33
|
+
}, WpDrawer: i, Filters: u };
|
|
47
34
|
}
|
|
48
35
|
});
|
|
49
36
|
export {
|
|
50
|
-
|
|
37
|
+
v as default
|
|
51
38
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import s from "./Filters.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
return e("div", { staticClass: "d-f f-d-c gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e(t.InSegments, { staticClass: "f-g-1 w-1", attrs: { id: "guido__filter-group-segments", "segment-list": t.filterGroupList, selected: t.selectedFilterGroup, "with-icon": !1 }, on: { click: t.
|
|
7
|
-
return e(t.FilterItem, { key:
|
|
8
|
-
}), 1), e("div", { staticClass: "d-f a-i-c j-c-c mt-3" }, [e(t.InButtonV2, { staticClass: "w-11-s", attrs: { id: "filter-group--add-filter-button", "left-icon": "line-plus-netural", type: "subtle-primary", "
|
|
9
|
-
}, d = [], n = /* @__PURE__ */
|
|
3
|
+
import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
|
+
var i = this, e = i._self._c, t = i._self._setupProxy;
|
|
6
|
+
return e("div", { staticClass: "d-f f-d-c gap-16" }, [e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e(t.InSegments, { staticClass: "f-g-1 w-1", attrs: { id: "guido__filter-group-segments", "segment-list": t.filterGroupList, selected: t.selectedFilterGroup, "with-icon": !1 }, on: { click: t.changeFilterGroup } }), e(t.InButtonV2, { staticClass: "w-20-s f-g-1", attrs: { id: "guido__add-filter-group-button", "left-icon": "line-plus-netural", type: "secondary", "disabled-status": t.isMaxFilterGroupCount, "label-text": t.trans("smart-recommender.add-filter-group"), "tooltip-text": t.isMaxFilterGroupCount ? t.trans("email-editor.add-filter-tooltip") : "" }, on: { click: t.handleAddFilterGroup } })], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b gap-16" }, [e("div", { staticClass: "d-f a-i-c" }, [t.selectedFilterGroup > 1 ? e(t.LogicAdapter, { staticClass: "mr-2" }) : i._e(), e("p", [i._v(" " + i._s(t.trans("email-editor.filter-group")) + " " + i._s(t.selectedFilterGroup) + " ")])], 1), t.hasRemoveFilterButton ? e(t.InButtonV2, { attrs: { id: "guido__delete-filter-group-button", "left-icon": "line-delete", styling: "text", type: "danger", "label-text-status": !1 }, on: { click: t.handleDeleteFilterGroup } }) : i._e()], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b f-d-c" }, i._l(t.selectedFilterGroupFilters, function(l, r) {
|
|
7
|
+
return e(t.FilterItem, { key: r, attrs: { filter: l, "has-logic-adapter": t.hasLogicAdapter && r !== t.selectedFilterGroupFilters.length - 1, index: r }, on: { "delete-filter": t.handleDeleteFilter } });
|
|
8
|
+
}), 1), e("div", { staticClass: "d-f a-i-c j-c-c mt-3" }, [e(t.InButtonV2, { staticClass: "w-11-s", attrs: { id: "filter-group--add-filter-button", "left-icon": "line-plus-netural", type: "subtle-primary", "label-text": t.trans("smart-recommender.add-filter-condition") }, on: { click: t.handleAddFilter } })], 1)]);
|
|
9
|
+
}, d = [], n = /* @__PURE__ */ a(
|
|
10
10
|
s,
|
|
11
|
-
|
|
11
|
+
o,
|
|
12
12
|
d,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"1ccb6d4a"
|
|
16
16
|
);
|
|
17
|
-
const
|
|
17
|
+
const _ = n.exports;
|
|
18
18
|
export {
|
|
19
|
-
|
|
19
|
+
_ as default
|
|
20
20
|
};
|
|
@@ -1,54 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTranslations as
|
|
1
|
+
import { defineComponent as m, computed as o, ref as h } from "vue";
|
|
2
|
+
import { useTranslations as G } from "../../../../composables/useTranslations.js";
|
|
3
3
|
import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import E from "./FilterItem.vue.js";
|
|
4
|
+
import { InButtonV2 as v, InSegments as f } from "@useinsider/design-system-vue";
|
|
5
|
+
import _ from "./FilterItem.vue.js";
|
|
7
6
|
import A from "./LogicAdapter.vue.js";
|
|
8
|
-
const
|
|
7
|
+
const E = /* @__PURE__ */ m({
|
|
9
8
|
__name: "Filters",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
text: e.toString(),
|
|
16
|
-
value: e
|
|
17
|
-
}))), r = O(1);
|
|
18
|
-
v(u, (e) => {
|
|
19
|
-
if (!e.length)
|
|
20
|
-
return;
|
|
21
|
-
e.some((G) => G.value === r.value) || (r.value = e[0].value);
|
|
22
|
-
});
|
|
23
|
-
const s = (e) => {
|
|
9
|
+
setup(R) {
|
|
10
|
+
const i = G(), l = g(), u = o(() => l.getFilterGroupCount), t = o(() => Array.from({ length: u.value }, (e, a) => ({
|
|
11
|
+
text: (a + 1).toString(),
|
|
12
|
+
value: a + 1
|
|
13
|
+
}))), r = h(1), s = (e) => {
|
|
24
14
|
r.value = e;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
);
|
|
15
|
+
}, d = () => {
|
|
16
|
+
const e = t.value.length + 1;
|
|
17
|
+
console.debug("handleAddFilterGroup", e), t.value.push({
|
|
18
|
+
text: e.toString(),
|
|
19
|
+
value: e
|
|
20
|
+
}), l.addFilterGroup(e);
|
|
21
|
+
}, p = o(() => t.value.length >= 3), n = o(() => l.getSelectedFilterGroup(r.value)), c = o(() => n.value.length > 1), F = o(() => t.value.length > 1);
|
|
22
|
+
return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, trans: i, store: l, filterGroupCount: u, filterGroupList: t, selectedFilterGroup: r, changeFilterGroup: s, handleAddFilterGroup: d, isMaxFilterGroupCount: p, selectedFilterGroupFilters: n, hasLogicAdapter: c, hasRemoveFilterButton: F, handleAddFilter: () => {
|
|
23
|
+
l.addFilter({
|
|
24
|
+
type: "standardFilter",
|
|
25
|
+
attribute: "",
|
|
26
|
+
operatorReplace: "",
|
|
27
|
+
operator: "",
|
|
28
|
+
innerGroupOperator: "*",
|
|
29
|
+
outerGroupOperator: "*",
|
|
30
|
+
filterNumber: n.value.length + 1,
|
|
31
|
+
filterGroup: r.value,
|
|
32
|
+
isValid: !1,
|
|
33
|
+
value: ""
|
|
34
|
+
}), console.debug("handleAddFilter");
|
|
45
35
|
}, handleDeleteFilter: (e) => {
|
|
46
|
-
|
|
36
|
+
console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
|
|
47
37
|
}, handleDeleteFilterGroup: () => {
|
|
48
|
-
|
|
49
|
-
},
|
|
38
|
+
t.value.length !== 1 && (console.debug("handleDeleteFilterGroup"), t.value.splice(r.value - 1, 1), r.value > 1 && r.value--);
|
|
39
|
+
}, InSegments: f, InButtonV2: v, FilterItem: _, LogicAdapter: A };
|
|
50
40
|
}
|
|
51
41
|
});
|
|
52
42
|
export {
|
|
53
|
-
|
|
43
|
+
E as default
|
|
54
44
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { defineComponent as g, ref as y, computed as n, watch as S } from "vue";
|
|
2
|
+
import T from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useToaster as v } from "../../../composables/useToaster.js";
|
|
4
|
+
import { useTranslations as B } from "../../../composables/useTranslations.js";
|
|
5
|
+
import { ToasterTypeOptions as C } from "../../../enums/toaster.js";
|
|
6
6
|
import { useUnsubscribeStore as w } from "../../../stores/unsubscribe.js";
|
|
7
|
-
import { InContainer as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
7
|
+
import { InContainer as h } from "@useinsider/design-system-vue";
|
|
8
|
+
import U from "./UnsubscribeBreadcrumb.vue.js";
|
|
9
|
+
const F = /* @__PURE__ */ g({
|
|
10
10
|
__name: "UnsubscribePageSelection",
|
|
11
|
-
setup(
|
|
12
|
-
const s =
|
|
11
|
+
setup(P) {
|
|
12
|
+
const s = B(), e = w(), { showToaster: a } = v(), o = y(!1), c = n(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = n(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = n(() => ({
|
|
13
13
|
primaryButton: {
|
|
14
14
|
styling: "solid",
|
|
15
15
|
type: "primary",
|
|
@@ -23,28 +23,28 @@ const E = /* @__PURE__ */ f({
|
|
|
23
23
|
labelText: i.value,
|
|
24
24
|
disabledStatus: o.value
|
|
25
25
|
}
|
|
26
|
-
})),
|
|
26
|
+
})), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", r = (t) => {
|
|
27
27
|
e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
|
|
28
28
|
t();
|
|
29
29
|
}, 500);
|
|
30
|
-
},
|
|
30
|
+
}, d = () => {
|
|
31
31
|
if (e.isActiveTypeFirstInCollection) {
|
|
32
32
|
r(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
35
|
e.setPreviousType();
|
|
36
|
-
},
|
|
36
|
+
}, m = () => {
|
|
37
37
|
if (e.isActiveTypeLastInCollection) {
|
|
38
38
|
o.value = !0;
|
|
39
|
-
const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t);
|
|
40
|
-
e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
|
|
39
|
+
const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), f = e.getSelectedUnsubscribePagesByCollection(t);
|
|
40
|
+
e.removeUnsubscribePages(f), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
|
|
41
41
|
detail: {
|
|
42
42
|
collectionType: t,
|
|
43
43
|
selectedPages: l
|
|
44
44
|
}
|
|
45
45
|
})), r(() => {
|
|
46
46
|
o.value = !1, a({
|
|
47
|
-
type:
|
|
47
|
+
type: C.Success,
|
|
48
48
|
message: s("global-unsubscribe.pages-were-attached")
|
|
49
49
|
});
|
|
50
50
|
});
|
|
@@ -54,11 +54,11 @@ const E = /* @__PURE__ */ f({
|
|
|
54
54
|
}, b = (t) => {
|
|
55
55
|
e.setSelectedTemplate(t);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
57
|
+
return S(() => e.pageSelectionDrawerStatus, (t) => {
|
|
58
58
|
t && e.pageSelectionUpdateStatus && e.fetchTemplates();
|
|
59
|
-
}), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions:
|
|
59
|
+
}), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: a, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: r, handleBack: d, handleSave: m, selectTemplate: b, WpDrawer: T, InContainer: h, UnsubscribeBreadcrumb: U };
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
F as default
|
|
64
64
|
};
|
|
@@ -4,21 +4,22 @@ import { useConfig as v } from "./useConfig.js";
|
|
|
4
4
|
import { useCustomInterfaceAppearance as A } from "./useCustomInterfaceAppearance.js";
|
|
5
5
|
import { useStripoEventHandler as F } from "./useStripoEventHandler.js";
|
|
6
6
|
import { useToaster as D } from "./useToaster.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import U from "../
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import H from "../
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import { localePatch as I } from "../config/i18n/index.js";
|
|
8
|
+
import { displayConditions as M } from "../enums/displayConditions.js";
|
|
9
|
+
import { useStripoApi as U } from "../services/stripoApi.js";
|
|
10
|
+
import P from "../static/styles/customEditorStyle.css.js";
|
|
11
|
+
import { useEditorStore as R } from "../stores/editor.js";
|
|
12
|
+
import { dynamicContentToMergeTags as H } from "../utils/genericUtil.js";
|
|
13
|
+
import O from "../package.json.js";
|
|
14
|
+
const Z = (c) => {
|
|
15
|
+
const { features: l, template: y } = v(), { handleError: u } = D(), { getToken: C, getCustomFonts: S } = U(), { handleEvent: E } = F(), { getStripoBlocksConfig: h } = B(), w = async (i, r = []) => {
|
|
16
|
+
var m, f, g;
|
|
17
|
+
const o = R(), { html: n, css: p } = i, { baseBlocks: s, extensions: t } = await h(), a = ((m = l.value) == null ? void 0 : m.displayConditions) ?? !0, k = ((f = l.value) == null ? void 0 : f.modulesDisabled) ?? !1, T = ((g = y.value) == null ? void 0 : g.forceRecreate) ?? !1;
|
|
17
18
|
window.UIEditor.initEditor(
|
|
18
19
|
document.querySelector("#guido-editor"),
|
|
19
20
|
{
|
|
20
21
|
metadata: c,
|
|
21
|
-
html:
|
|
22
|
+
html: n,
|
|
22
23
|
css: p,
|
|
23
24
|
forceRecreate: T,
|
|
24
25
|
locale: "en",
|
|
@@ -30,10 +31,10 @@ const W = (c) => {
|
|
|
30
31
|
customAppearanceMergetags: !0,
|
|
31
32
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
32
33
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
33
|
-
customViewStyles:
|
|
34
|
+
customViewStyles: P,
|
|
34
35
|
conditionsEnabled: a,
|
|
35
36
|
customConditionsEnabled: a,
|
|
36
|
-
conditionCategories:
|
|
37
|
+
conditionCategories: M,
|
|
37
38
|
enableXSSSecurity: !0,
|
|
38
39
|
modulesDisabled: k,
|
|
39
40
|
messageSettingsEnabled: !0,
|
|
@@ -46,11 +47,11 @@ const W = (c) => {
|
|
|
46
47
|
editorFonts: {
|
|
47
48
|
showDefaultStandardFonts: !0,
|
|
48
49
|
showDefaultNotStandardFonts: !0,
|
|
49
|
-
customFonts:
|
|
50
|
+
customFonts: r
|
|
50
51
|
},
|
|
51
52
|
mergeTags: [
|
|
52
53
|
{
|
|
53
|
-
entries:
|
|
54
|
+
entries: H(c.preselectedDynamicContentList)
|
|
54
55
|
}
|
|
55
56
|
],
|
|
56
57
|
async onTokenRefreshRequest(e) {
|
|
@@ -89,29 +90,30 @@ const W = (c) => {
|
|
|
89
90
|
".in-on-board-wrapper",
|
|
90
91
|
".in-drawer__container"
|
|
91
92
|
],
|
|
92
|
-
extensions: t
|
|
93
|
+
extensions: t,
|
|
94
|
+
localePatch: I
|
|
93
95
|
}
|
|
94
96
|
);
|
|
95
|
-
}, b = (i) => new Promise((
|
|
97
|
+
}, b = (i) => new Promise((r, o) => {
|
|
96
98
|
var a;
|
|
97
99
|
if (document.getElementById("UiEditorScript")) {
|
|
98
|
-
i(),
|
|
100
|
+
i(), r();
|
|
99
101
|
return;
|
|
100
102
|
}
|
|
101
|
-
const
|
|
103
|
+
const n = O.guido, s = `https://email-static.useinsider.com/guido/${(a = n == null ? void 0 : n.stripo) == null ? void 0 : a.version}/UIEditor.js`, t = document.createElement("script");
|
|
102
104
|
t.id = "UiEditorScript", t.type = "module", t.src = s, t.onload = () => {
|
|
103
|
-
i(),
|
|
105
|
+
i(), r();
|
|
104
106
|
}, t.onerror = () => {
|
|
105
107
|
o(new Error(`Failed to load Stripo UIEditor script from S3: ${s}`));
|
|
106
108
|
}, document.body.appendChild(t);
|
|
107
109
|
});
|
|
108
110
|
return { initPlugin: async (i) => {
|
|
109
111
|
await b(async () => {
|
|
110
|
-
const
|
|
111
|
-
await w(i,
|
|
112
|
+
const r = await S();
|
|
113
|
+
await w(i, r);
|
|
112
114
|
});
|
|
113
115
|
} };
|
|
114
116
|
};
|
|
115
117
|
export {
|
|
116
|
-
|
|
118
|
+
Z as useStripo
|
|
117
119
|
};
|