@useinsider/guido 2.1.0-beta.7d0f92a → 2.1.0-beta.7ffef92

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.
Files changed (62) hide show
  1. package/README.md +36 -0
  2. package/dist/@types/config/schemas.js +70 -65
  3. package/dist/components/Guido.vue.js +1 -1
  4. package/dist/components/Guido.vue2.js +69 -58
  5. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +11 -13
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +55 -24
  7. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +3 -3
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +34 -21
  9. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +9 -9
  10. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -35
  11. package/dist/composables/useBlocksConfig.js +26 -16
  12. package/dist/composables/useHtmlValidator.js +107 -119
  13. package/dist/config/compiler/utils/recommendationCompilerUtils.js +27 -22
  14. package/dist/config/migrator/itemsBlockMigrator.js +101 -97
  15. package/dist/enums/defaults.js +8 -4
  16. package/dist/extensions/Blocks/Recommendation/block.js +26 -23
  17. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +27 -26
  18. package/dist/extensions/Blocks/Recommendation/constants/layout.js +6 -4
  19. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +12 -10
  20. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +124 -72
  21. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +87 -37
  22. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +138 -117
  23. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  24. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +179 -133
  25. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +25 -30
  26. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -30
  27. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +20 -25
  28. package/dist/extensions/Blocks/Recommendation/templates/utils.js +43 -31
  29. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
  30. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +29 -0
  31. package/dist/extensions/ModulesTabIcons/extension.js +17 -0
  32. package/dist/guido.css +1 -1
  33. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +257 -187
  34. package/dist/services/recommendationApi.js +11 -9
  35. package/dist/services/stripoApi.js +20 -17
  36. package/dist/src/@types/config/schemas.d.ts +8 -0
  37. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +1 -0
  38. package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +15 -1
  39. package/dist/src/composables/useConfig.d.ts +4 -0
  40. package/dist/src/enums/defaults.d.ts +4 -0
  41. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  42. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +6 -0
  43. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +4 -0
  44. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +17 -1
  45. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +22 -4
  46. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +9 -2
  47. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  48. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +25 -2
  49. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +1 -1
  50. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +2 -0
  51. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +12 -3
  52. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  53. package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +15 -0
  54. package/dist/src/extensions/ModulesTabIcons/extension.d.ts +2 -0
  55. package/dist/src/stores/config.d.ts +36 -0
  56. package/dist/static/styles/components/notification.css.js +1 -0
  57. package/dist/static/styles/components/version-history.css.js +10 -2
  58. package/dist/static/styles/components/wide-panel.css.js +18 -2
  59. package/dist/static/styles/customEditorStyle.css.js +10 -9
  60. package/dist/static/templates/empty/index.html.js +74 -0
  61. package/dist/static/templates/empty/style.css.js +779 -0
  62. package/package.json +1 -1
@@ -1,38 +1,69 @@
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({
1
+ import { defineComponent as V, computed as o } from "vue";
2
+ import { useTranslations as _ } from "../../../../composables/useTranslations.js";
3
+ import { getOperatorOptions as s } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { useRecommendationExtensionStore as C } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { getInvalidFilterFields as A } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
6
+ import { InButtonV2 as L, InSelect as O, InBasicTextInput as S } from "@useinsider/design-system-vue";
7
+ import E from "./LogicAdapter.vue.js";
8
+ import { useDebounceFn as N } from "../../../../node_modules/@vueuse/shared/index.js";
9
+ const K = /* @__PURE__ */ V({
9
10
  __name: "FilterItem",
10
11
  props: {
11
12
  filter: null,
12
13
  index: null,
13
- hasLogicAdapter: { type: Boolean }
14
+ hasLogicAdapter: { type: Boolean },
15
+ submitted: { type: Boolean }
14
16
  },
15
17
  emits: ["delete-filter"],
16
- setup(p, { emit: u }) {
17
- const e = p, n = v(), r = x(), m = [
18
+ setup(f, { emit: v }) {
19
+ const t = f, p = _(), l = C(), F = [
18
20
  {
19
- text: n("email-editor.standard-filter"),
21
+ text: p("email-editor.standard-filter"),
20
22
  value: "standardFilter"
21
23
  }
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);
24
+ ], n = [
25
+ { text: "True", value: "true" },
26
+ { text: "False", value: "false" }
27
+ ], c = o(() => t.filter.attribute || ""), r = o(() => l.getFilterList.find((e) => e.value === c.value) || { text: "", value: "", type: "" }), y = o(
28
+ () => {
29
+ var e;
30
+ return ((e = r.value) == null ? void 0 : e.type) === "Boolean";
31
+ }
32
+ ), g = o(() => {
33
+ var e;
34
+ return s((e = r.value) == null ? void 0 : e.type).find((a) => a.value === t.filter.operator);
35
+ }), b = o(
36
+ () => n.find((e) => e.value === t.filter.value) || n[0]
37
+ ), i = o(() => t.submitted ? A(t.filter) : /* @__PURE__ */ new Set()), h = (e) => i.value.has(e) ? "error" : "default", B = o(
38
+ () => i.value.has("value") ? "Enter Value to continue." : ""
39
+ ), d = o(
40
+ () => {
41
+ var e;
42
+ return ((e = r.value) == null ? void 0 : e.type) === "Number";
43
+ }
44
+ ), x = o(() => d.value ? "number" : "text"), T = N((e) => {
45
+ l.updateFilter({
46
+ ...t.filter,
47
+ [e.text]: e.value
48
+ });
32
49
  }, 500);
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: _ };
50
+ return { __sfc: !0, trans: p, store: l, props: t, filterTypeOptions: F, booleanValueOptions: n, attributeType: c, selectedAttributeType: r, isBooleanAttribute: y, selectedOperatorType: g, selectedBooleanValue: b, emit: v, invalidFields: i, getFieldState: h, valueErrorMessage: B, isNumericAttribute: d, valueInputType: x, updateFilter: T, handleAttributeChange: (e) => {
51
+ const a = l.getFilterList.find((I) => I.value === e.value), m = (a == null ? void 0 : a.type) === "Boolean", [u] = s(a == null ? void 0 : a.type);
52
+ l.updateFilter({
53
+ ...t.filter,
54
+ attribute: e.value,
55
+ operator: m ? "=" : (u == null ? void 0 : u.value) ?? "",
56
+ value: m ? "true" : ""
57
+ });
58
+ }, handleBooleanValueChange: (e) => {
59
+ l.updateFilter({
60
+ ...t.filter,
61
+ operator: "=",
62
+ value: e.value
63
+ });
64
+ }, getOperatorOptions: s, InBasicTextInput: S, InSelect: O, InButtonV2: L, LogicAdapter: E };
34
65
  }
35
66
  });
36
67
  export {
37
- h as default
68
+ K as default
38
69
  };
@@ -1,11 +1,11 @@
1
1
  import o from "./FilterSelectionDrawer.vue2.js";
2
2
  import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
- var l = function() {
3
+ var i = function() {
4
4
  var e = this, r = e._self._c, t = e._self._setupProxy;
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);
5
+ return r(t.WpDrawer, { attrs: { id: "recommendation-filter-drawer", "description-status": "", "description-text": t.trans("email-editor.filter-description"), "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.filterSelectionDrawerStatus, "title-text": t.trans("email-editor.add-filters") }, on: { cancelOrBackButtonEvent: t.cancelModal, onCloseEvent: t.cancelModal, primaryButtonEvent: t.applyFilter } }, [t.store.filterSelectionDrawerStatus ? r(t.Filters, { ref: "filtersRef", attrs: { submitted: t.submitted } }) : e._e()], 1);
6
6
  }, s = [], a = /* @__PURE__ */ n(
7
7
  o,
8
- l,
8
+ i,
9
9
  s,
10
10
  !1,
11
11
  null,
@@ -1,38 +1,51 @@
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({
1
+ import { defineComponent as d, ref as a, watch as y, computed as g, nextTick as v } from "vue";
2
+ import b from "../../../wrappers/WpDrawer.vue.js";
3
+ import { useTranslations as w } from "../../../../composables/useTranslations.js";
4
+ import { useRecommendationExtensionStore as F } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
+ import { isFilterValid as _ } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
6
+ import h from "./Filters.vue.js";
7
+ const I = /* @__PURE__ */ d({
7
8
  __name: "FilterSelectionDrawer",
8
- setup(f) {
9
- const r = c(), t = p(), e = a(!1), s = l(() => ({
9
+ setup(S) {
10
+ const r = w(), e = F(), t = a(!1), o = a(!1), c = a();
11
+ y(() => e.filterSelectionDrawerStatus, (n) => {
12
+ n && (o.value = !1);
13
+ });
14
+ const f = g(() => ({
10
15
  primaryButton: {
11
16
  styling: "solid",
12
17
  type: "primary",
13
18
  labelText: r(
14
- e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
19
+ t.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
15
20
  ),
16
- loadingStatus: e.value,
17
- disabledStatus: !1
21
+ loadingStatus: t.value
18
22
  },
19
23
  cancelOrBackButton: {
20
24
  styling: "ghost",
21
25
  type: "secondary",
22
26
  labelText: r("products.cancel"),
23
- disabledStatus: e.value
27
+ disabledStatus: t.value
24
28
  }
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 },
29
+ }));
30
+ return { __sfc: !0, trans: r, store: e, isApplying: t, submitted: o, filtersRef: c, footerButtonGroupOptions: f, cancelModal: () => {
31
+ e.cancelFilterDrawer();
32
+ }, applyFilter: async () => {
33
+ var u;
34
+ o.value = !0;
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 },
31
44
  { triggerRefetch: !0 }
32
- ), o(), e.value = !1;
33
- }, WpDrawer: i, Filters: u };
45
+ ), e.closeFilterDrawer(), t.value = !1;
46
+ }, WpDrawer: b, Filters: h };
34
47
  }
35
48
  });
36
49
  export {
37
- v as default
50
+ I as default
38
51
  };
@@ -1,20 +1,20 @@
1
- import s from "./Filters.vue2.js";
1
+ import l from "./Filters.vue2.js";
2
2
  /* empty css */
3
3
  import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
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)]);
5
+ var r = this, e = r._self._c, t = r._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.switchToGroup } }), 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-group-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", attrs: { logic: t.outerGroupOperator }, on: { change: t.handleOuterGroupOperatorChange } }) : r._e(), e("p", [r._v(" " + r._s(t.trans("email-editor.filter-group")) + " " + r._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 } }) : r._e()], 1), e("div", { staticClass: "d-f a-i-c j-c-s-b f-d-c" }, r._l(t.selectedFilterGroupFilters, function(s, i) {
7
+ return e(t.FilterItem, { key: i, attrs: { filter: s, "has-logic-adapter": t.hasLogicAdapter && i !== t.selectedFilterGroupFilters.length - 1, index: i, submitted: r.submitted }, 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", "disabled-status": t.isMaxFilterPerGroupCount, "label-text": t.trans("smart-recommender.add-filter-condition"), "tooltip-text": t.isMaxFilterPerGroupCount ? t.trans("email-editor.add-filter-tooltip") : "" }, on: { click: t.handleAddFilter } })], 1)]);
9
9
  }, d = [], n = /* @__PURE__ */ a(
10
- s,
10
+ l,
11
11
  o,
12
12
  d,
13
13
  !1,
14
14
  null,
15
- "1ccb6d4a"
15
+ "bd89e39d"
16
16
  );
17
- const _ = n.exports;
17
+ const m = n.exports;
18
18
  export {
19
- _ as default
19
+ m as default
20
20
  };
@@ -1,44 +1,53 @@
1
- import { defineComponent as m, computed as o, ref as h } from "vue";
2
- import { useTranslations as G } from "../../../../composables/useTranslations.js";
1
+ import { defineComponent as m, computed as l, ref as v, watch as O } from "vue";
2
+ import { useTranslations as f } from "../../../../composables/useTranslations.js";
3
3
  import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { InButtonV2 as v, InSegments as f } from "@useinsider/design-system-vue";
5
- import _ from "./FilterItem.vue.js";
6
- import A from "./LogicAdapter.vue.js";
7
- const E = /* @__PURE__ */ m({
4
+ import { InButtonV2 as R, InSegments as T } from "@useinsider/design-system-vue";
5
+ import U from "./FilterItem.vue.js";
6
+ import E from "./LogicAdapter.vue.js";
7
+ const w = /* @__PURE__ */ m({
8
8
  __name: "Filters",
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) => {
9
+ props: {
10
+ submitted: { type: Boolean }
11
+ },
12
+ setup(A, { expose: s }) {
13
+ const i = f(), t = g(), u = l(() => t.getUniqueFilterGroups.map((e) => ({
14
+ text: e.toString(),
15
+ value: e
16
+ }))), r = v(1);
17
+ O(u, (e) => {
18
+ if (!e.length)
19
+ return;
20
+ e.some((h) => h.value === r.value) || (r.value = e[0].value);
21
+ });
22
+ const a = (e) => {
14
23
  r.value = e;
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");
24
+ };
25
+ s({ switchToGroup: a });
26
+ const p = () => {
27
+ const e = t.getUniqueFilterGroups, o = e.length > 0 ? Math.max(...e) + 1 : 1;
28
+ t.addFilterGroup(o), r.value = o;
29
+ }, c = l(() => u.value.length >= 3), n = l(() => t.getSelectedFilterGroup(r.value)), d = l(() => n.value.length >= 10), F = l(() => n.value.length > 1), _ = l(() => u.value.length > 1), G = l(() => {
30
+ var o;
31
+ return ((o = n.value[0]) == null ? void 0 : o.outerGroupOperator) || "*";
32
+ });
33
+ return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, MAX_FILTER_PER_GROUP_COUNT: 10, trans: i, store: t, filterGroupList: u, selectedFilterGroup: r, switchToGroup: a, handleAddFilterGroup: p, isMaxFilterGroupCount: c, selectedFilterGroupFilters: n, isMaxFilterPerGroupCount: d, hasLogicAdapter: F, hasRemoveFilterButton: _, outerGroupOperator: G, handleOuterGroupOperatorChange: (e) => {
34
+ n.value.forEach((o) => {
35
+ t.updateFilter({ ...o, outerGroupOperator: e });
36
+ });
37
+ }, handleAddFilter: () => {
38
+ t.addFilter(
39
+ t.createDefaultFilter(
40
+ r.value,
41
+ n.value.length + 1
42
+ )
43
+ );
35
44
  }, handleDeleteFilter: (e) => {
36
- console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
45
+ t.deleteFilter(e);
37
46
  }, handleDeleteFilterGroup: () => {
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 };
47
+ u.value.length <= 1 || t.deleteFilterGroup(r.value);
48
+ }, InSegments: T, InButtonV2: R, FilterItem: U, LogicAdapter: E };
40
49
  }
41
50
  });
42
51
  export {
43
- E as default
52
+ w as default
44
53
  };
@@ -1,5 +1,6 @@
1
+ import r from "../extensions/ModulesTabIcons/extension.js";
1
2
  import { useConfigStore as l } from "../stores/config.js";
2
- const r = {
3
+ const a = {
3
4
  "amp-accordion": "ampAccordionEnabled",
4
5
  "amp-carousel": "ampCarouselEnabled",
5
6
  "amp-form-controls": "ampFormControlsEnabled",
@@ -13,7 +14,7 @@ const r = {
13
14
  "text-block": "textEnabled",
14
15
  "timer-block": "timerEnabled",
15
16
  "video-block": "videoEnabled"
16
- }, c = {
17
+ }, s = {
17
18
  "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
18
19
  "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
19
20
  "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
@@ -21,31 +22,40 @@ const r = {
21
22
  "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
22
23
  "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
23
24
  "items-block": () => import("../extensions/Blocks/Items/extension.js")
24
- }, a = (n) => {
25
+ }, i = (n) => {
25
26
  if (!n || !n.length)
26
27
  return {};
27
- const e = {};
28
+ const t = {};
28
29
  return n.forEach((o) => {
29
- const t = r[o];
30
- t && (e[t] = !1);
31
- }), e;
32
- }, i = async (n) => !n || !n.length ? [] : (await Promise.all(
33
- n.map(async (o) => {
34
- const t = c[o];
35
- return t ? (await t()).default : null;
36
- })
37
- )).filter((o) => o !== null), m = () => {
30
+ const e = a[o];
31
+ e && (t[e] = !1);
32
+ }), t;
33
+ }, b = () => [r], m = async (n) => {
34
+ const t = b();
35
+ if (!n || !n.length)
36
+ return t;
37
+ const o = await Promise.all(
38
+ n.map(async (e) => {
39
+ const c = s[e];
40
+ return c ? (await c()).default : null;
41
+ })
42
+ );
43
+ return [
44
+ ...t,
45
+ ...o.filter((e) => e !== null)
46
+ ];
47
+ }, E = () => {
38
48
  const n = l();
39
49
  return {
40
50
  getStripoBlocksConfig: async () => {
41
51
  const o = n.blocks;
42
52
  return {
43
- baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
44
- extensions: await i(o == null ? void 0 : o.includeCustoms)
53
+ baseBlocks: i(o == null ? void 0 : o.excludeDefaults),
54
+ extensions: await m(o == null ? void 0 : o.includeCustoms)
45
55
  };
46
56
  }
47
57
  };
48
58
  };
49
59
  export {
50
- m as useBlocksConfig
60
+ E as useBlocksConfig
51
61
  };