@useinsider/guido 2.1.0-beta.497ad9c → 2.1.0-beta.4adc9e7

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.
@@ -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, 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";
2
+ import { object as o, number as p, optional as e, string as t, pipe as u, picklist as n, minLength as d, custom as S, boolean as a, array as c, 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,28 +1,26 @@
1
1
  import r from "./FilterItem.vue2.js";
2
2
  /* empty css */
3
- import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var l = function() {
3
+ import l from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var i = 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" }, [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) {
6
+ return e("div", { staticClass: "d-f f-d-c w-1 gap-16", attrs: { "data-filter-group": a.filter.filterGroup, "data-filter-number": a.filter.filterNumber } }, [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, 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) {
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, state: t.getFieldState("attribute"), value: [t.selectedAttributeType] }, on: { select: t.handleAttributeChange } })], 1), e("div", { staticClass: "w-1 d-f a-i-s j-c-s-b gap-16" }, [t.isBooleanAttribute ? e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.booleanValueOptions, state: t.getFieldState("value"), value: [t.selectedBooleanValue] }, on: { select: t.handleBooleanValueChange } }) : [e(t.InSelect, { staticClass: "w-2", attrs: { "button-status": !1, "label-text": t.trans("condition.operator"), options: t.getOperatorOptions(t.selectedAttributeType.type), state: t.getFieldState("operator"), value: [t.selectedOperatorType] }, on: { select: function(s) {
11
9
  return t.updateFilter({ text: "operator", value: s.value });
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) {
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"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
13
11
  t.updateFilter({ text: "value", value: encodeURIComponent(s) });
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) {
12
+ } } })]], 2), 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) {
15
13
  return t.updateFilter({ text: "innerGroupOperator", value: s });
16
14
  } } })], 1) : a._e()]);
17
- }, n = [], o = /* @__PURE__ */ i(
15
+ }, o = [], n = /* @__PURE__ */ l(
18
16
  r,
19
- l,
20
- n,
17
+ i,
18
+ o,
21
19
  !1,
22
20
  null,
23
- "6562e38c"
21
+ "3b53a736"
24
22
  );
25
- const f = o.exports;
23
+ const f = n.exports;
26
24
  export {
27
25
  f as default
28
26
  };
@@ -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 _, computed as l } from "vue";
2
+ import { useTranslations as C } from "../../../../composables/useTranslations.js";
3
+ import { getOperatorOptions as p } from "../../../../enums/extensions/recommendationBlock.js";
4
+ import { useRecommendationExtensionStore as V } 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__ */ _({
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, n = C(), a = V(), y = [
18
20
  {
19
21
  text: n("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
+ ], i = [
25
+ { text: "True", value: "true" },
26
+ { text: "False", value: "false" }
27
+ ], d = l(() => t.filter.attribute || ""), r = l(() => a.getFilterList.find((e) => e.value === d.value) || { text: "", value: "", type: "" }), F = l(
28
+ () => {
29
+ var e;
30
+ return ((e = r.value) == null ? void 0 : e.type) === "Boolean";
31
+ }
32
+ ), b = l(() => {
33
+ var e;
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
+ });
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: n, store: a, props: t, filterTypeOptions: y, booleanValueOptions: i, attributeType: d, selectedAttributeType: r, isBooleanAttribute: F, selectedOperatorType: b, selectedBooleanValue: g, emit: v, invalidFields: u, getFieldState: h, valueErrorMessage: B, isNumericAttribute: c, valueInputType: x, updateFilter: T, handleAttributeChange: (e) => {
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 };
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
1
  import s from "./Filters.vue2.js";
2
2
  /* empty css */
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(
3
+ import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
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-options": t.getTooltipOptions("add-filter-group-tooltip"), "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(l, i) {
7
+ return e(t.FilterItem, { key: i, attrs: { filter: l, "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
+ }, d = [], n = /* @__PURE__ */ o(
10
10
  s,
11
- o,
11
+ a,
12
12
  d,
13
13
  !1,
14
14
  null,
15
- "1ccb6d4a"
15
+ "c5dee797"
16
16
  );
17
- const _ = n.exports;
17
+ const g = n.exports;
18
18
  export {
19
- _ as default
19
+ g as default
20
20
  };
@@ -1,44 +1,54 @@
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 h, computed as l, ref as O, watch as v } 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";
4
+ import { getTooltipOptions as R } from "../../../../utils/tooltipUtils.js";
5
+ import { InButtonV2 as T, InSegments as U } from "@useinsider/design-system-vue";
6
+ import E from "./FilterItem.vue.js";
6
7
  import A from "./LogicAdapter.vue.js";
7
- const E = /* @__PURE__ */ m({
8
+ const y = /* @__PURE__ */ h({
8
9
  __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) => {
10
+ props: {
11
+ submitted: { type: Boolean }
12
+ },
13
+ setup(C, { expose: a }) {
14
+ const i = f(), t = g(), u = l(() => t.getUniqueFilterGroups.map((e) => ({
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) => {
14
24
  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");
25
+ };
26
+ a({ switchToGroup: s });
27
+ const p = () => {
28
+ const e = t.getUniqueFilterGroups, o = e.length > 0 ? Math.max(...e) + 1 : 1;
29
+ t.addFilterGroup(o), r.value = o;
30
+ }, 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), m = l(() => {
31
+ var o;
32
+ return ((o = n.value[0]) == null ? void 0 : o.outerGroupOperator) || "*";
33
+ });
34
+ return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, MAX_FILTER_PER_GROUP_COUNT: 10, trans: i, store: t, filterGroupList: u, selectedFilterGroup: r, switchToGroup: s, handleAddFilterGroup: p, isMaxFilterGroupCount: c, selectedFilterGroupFilters: n, isMaxFilterPerGroupCount: d, hasLogicAdapter: F, hasRemoveFilterButton: _, outerGroupOperator: m, handleOuterGroupOperatorChange: (e) => {
35
+ n.value.forEach((o) => {
36
+ t.updateFilter({ ...o, outerGroupOperator: e });
37
+ });
38
+ }, handleAddFilter: () => {
39
+ t.addFilter(
40
+ t.createDefaultFilter(
41
+ r.value,
42
+ n.value.length + 1
43
+ )
44
+ );
35
45
  }, handleDeleteFilter: (e) => {
36
- console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
46
+ t.deleteFilter(e);
37
47
  }, 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 };
48
+ u.value.length <= 1 || t.deleteFilterGroup(r.value);
49
+ }, getTooltipOptions: R, InSegments: U, InButtonV2: T, FilterItem: E, LogicAdapter: A };
40
50
  }
41
51
  });
42
52
  export {
43
- E as default
53
+ y as default
44
54
  };
@@ -1,8 +1,8 @@
1
- var d = Object.defineProperty;
2
- var m = (c, s, t) => s in c ? d(c, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[s] = t;
3
- var n = (c, s, t) => m(c, typeof s != "symbol" ? s + "" : s, t);
4
- import { CommonControl as h } from "../../../common-control.js";
5
- import { RecommendationConfigService as f } from "../../services/configService.js";
1
+ var m = Object.defineProperty;
2
+ var h = (c, s, t) => s in c ? m(c, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[s] = t;
3
+ var n = (c, s, t) => h(c, typeof s != "symbol" ? s + "" : s, t);
4
+ import { CommonControl as f } from "../../../common-control.js";
5
+ import { RecommendationConfigService as l } from "../../services/configService.js";
6
6
  import { useRecommendationExtensionStore as C } from "../../store/recommendation.js";
7
7
  import { AlgorithmControl as p } from "./algorithm.js";
8
8
  import { ALGORITHM_CONTROL_ID as W } from "./algorithm.js";
@@ -10,17 +10,17 @@ import { CurrencyControl as g } from "./currency.js";
10
10
  import { CURRENCY_CONTROL_ID as H } from "./currency.js";
11
11
  import { FiltersControl as R } from "./filters.js";
12
12
  import { FILTERS_CONTROL_ID as j } from "./filters.js";
13
- import { LocaleControl as y } from "./locale.js";
13
+ import { LocaleControl as N } from "./locale.js";
14
14
  import { LOCALE_CONTROL_ID as K } from "./locale.js";
15
- import { ProductLayoutControl as _ } from "./productLayout.js";
15
+ import { ProductLayoutControl as y } from "./productLayout.js";
16
16
  import { PRODUCT_LAYOUT_CONTROL_ID as J } from "./productLayout.js";
17
- import { ShuffleControl as N } from "./shuffle.js";
17
+ import { ShuffleControl as _ } from "./shuffle.js";
18
18
  import { SHUFFLE_CONTROL_ID as X } from "./shuffle.js";
19
- import { regenerateProductRowsWithStyles as b, getBlockElement as P, updateProductContentInPlace as I } from "./utils.js";
20
- import { formatProductPrice as tt, getCardComposition as et, getCurrentLayout as ot, reapplySpacing as rt, regenerateMobileProductRows as nt, regenerateProductRows as it, setCurrencyAttributes as st, updatePricesInPlace as ct, updateSingleProductContent as at } from "./utils.js";
21
- import { useDebounceFn as l } from "../../../../../node_modules/@vueuse/shared/index.js";
19
+ import { regenerateProductRowsWithStyles as b, getBlockElement as I, updateProductContentInPlace as P } from "./utils.js";
20
+ import { formatProductPrice as tt, getCardComposition as et, getCurrentLayout as ot, reapplySpacing as rt, regenerateMobileProductRows as it, regenerateProductRows as nt, setCurrencyAttributes as st, updatePricesInPlace as ct, updateSingleProductContent as at } from "./utils.js";
21
+ import { useDebounceFn as u } from "../../../../../node_modules/@vueuse/shared/index.js";
22
22
  const T = "recommendation-id", S = "ui-elements-recommendation-block";
23
- class $ extends h {
23
+ class z extends f {
24
24
  constructor() {
25
25
  super(...arguments);
26
26
  n(this, "store", C());
@@ -36,19 +36,19 @@ class $ extends h {
36
36
  /**
37
37
  * Debounced product fetch to prevent rapid API calls during config changes
38
38
  */
39
- n(this, "_debouncedFetchProducts", l(() => {
39
+ n(this, "_debouncedFetchProducts", u(() => {
40
40
  this.store.fetchRecommendationProducts();
41
41
  }, 500));
42
42
  /**
43
43
  * Debounced regeneration when products arrive from API
44
44
  * Tries in-place update first to preserve styles, falls back to full regeneration
45
45
  */
46
- n(this, "_debouncedRegenerateWithProducts", l(() => {
46
+ n(this, "_debouncedRegenerateWithProducts", u(() => {
47
47
  const t = this.store.recommendationProducts;
48
48
  if (!this.currentNode || !this.api)
49
49
  return;
50
50
  const e = this.api.getDocumentModifier();
51
- I({
51
+ P({
52
52
  currentNode: this.currentNode,
53
53
  documentModifier: e,
54
54
  products: t
@@ -59,7 +59,7 @@ class $ extends h {
59
59
  return S;
60
60
  }
61
61
  getTemplate() {
62
- return this.algorithmControl = new p(), this.localeControl = new y(), this.currencyControl = new g(), this.productLayoutControl = new _(), this.filtersControl = new R(), this.shuffleControl = new N(), `
62
+ return this.algorithmControl = new p(), this.localeControl = new N(), this.currencyControl = new g(), this.productLayoutControl = new y(), this.filtersControl = new R(), this.shuffleControl = new _(), `
63
63
  <div class="recommendation-controls-container">
64
64
  ${this.algorithmControl.getTemplate()}
65
65
  ${this.localeControl.getTemplate()}
@@ -95,19 +95,19 @@ class $ extends h {
95
95
  });
96
96
  }
97
97
  onTemplateNodeUpdated(t) {
98
- var i;
98
+ var r;
99
99
  super.onTemplateNodeUpdated(t);
100
100
  const e = this._getRecommendationIdFromNode(t);
101
- e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), this._syncNodeConfigToStore(), e !== null && !((i = this.store.blockStates[e]) != null && i.isInitialized) && this._fetchBlockData(e), [
101
+ e !== null && e !== this.store.currentRecommendationId && this.store.setCurrentBlock(e), this._syncNodeConfigToStore(), e !== null && !((r = this.store.blockStates[e]) != null && r.isInitialized) && this._fetchBlockData(e), [
102
102
  this.algorithmControl,
103
103
  this.localeControl,
104
104
  this.currencyControl,
105
105
  this.productLayoutControl,
106
106
  this.filtersControl,
107
107
  this.shuffleControl
108
- ].forEach((r) => {
108
+ ].forEach((i) => {
109
109
  var a;
110
- r != null && r.api && (r.currentNode = t, (a = r.onTemplateNodeUpdated) == null || a.call(r, t));
110
+ i != null && i.api && (i.currentNode = t, (a = i.onTemplateNodeUpdated) == null || a.call(i, t));
111
111
  });
112
112
  }
113
113
  onDestroy() {
@@ -152,13 +152,17 @@ class $ extends h {
152
152
  * values are being prepared for the upcoming initial fetch.
153
153
  */
154
154
  _syncNodeConfigToStore() {
155
- const t = f.getConfig(this.currentNode);
155
+ var r;
156
+ const t = l.getConfig(this.currentNode), e = this.store.currentRecommendationId, o = e !== null && ((r = this.store.blockStates[e]) == null ? void 0 : r.isInitialized);
156
157
  this.store.patchCurrentBlockConfig({
157
158
  strategy: t.strategy,
158
159
  language: t.language,
159
160
  size: t.size,
160
161
  productIds: t.productIds,
161
- filters: t.filters,
162
+ // Only sync filters from node config during initial load.
163
+ // After initialization, the Pinia store is the source of truth
164
+ // for filters (edited via the filter drawer).
165
+ ...o ? {} : { filters: t.filters },
162
166
  shuffleProducts: t.shuffleProducts,
163
167
  currencySettings: {
164
168
  name: t.currency.code,
@@ -181,26 +185,26 @@ class $ extends h {
181
185
  this.store.fetchRecommendationFilters(),
182
186
  this.store.fetchRecommendationCreateData(),
183
187
  this.store.fetchRecommendationProducts()
184
- ])).forEach((o, i) => {
188
+ ])).forEach((o, r) => {
185
189
  o.status === "rejected" && console.warn(`Recommendation block: ${[
186
190
  "fetchRecommendationFilters",
187
191
  "fetchRecommendationCreateData",
188
192
  "fetchRecommendationProducts"
189
- ][i]} failed`, o.reason);
193
+ ][r]} failed`, o.reason);
190
194
  });
191
195
  }
192
196
  /**
193
197
  * Reads the recommendation-id attribute from the block element within the node
194
198
  */
195
199
  _getRecommendationIdFromNode(t) {
196
- const e = P(t);
200
+ const e = I(t);
197
201
  if (!e || !("getAttribute" in e))
198
202
  return null;
199
203
  const o = e.getAttribute(T);
200
204
  if (!o)
201
205
  return null;
202
- const i = parseInt(o);
203
- return Number.isNaN(i) ? null : i;
206
+ const r = parseInt(o);
207
+ return Number.isNaN(r) ? null : r;
204
208
  }
205
209
  /**
206
210
  * Listen to store changes that require product refresh or regeneration.
@@ -213,12 +217,27 @@ class $ extends h {
213
217
  const { store: t } = this;
214
218
  let e = t.recommendationProducts, o = t.$state.configVersion;
215
219
  this.storeUnsubscription = t.$subscribe(() => {
216
- const i = t.$state.configVersion;
217
- i !== o && (o = i, this._debouncedFetchProducts());
218
- const r = t.recommendationProducts, a = r !== e, u = Array.isArray(r) && r.length > 0;
219
- a && u && (e = r, this._debouncedRegenerateWithProducts());
220
+ const r = t.$state.configVersion;
221
+ r !== o && (o = r, this._persistFiltersToNodeConfig(), this._debouncedFetchProducts());
222
+ const i = t.recommendationProducts, a = i !== e, d = Array.isArray(i) && i.length > 0;
223
+ a && d && (e = i, this._debouncedRegenerateWithProducts());
220
224
  });
221
225
  }
226
+ /**
227
+ * Persists the current filter state from Pinia store to the Stripo node config.
228
+ * This ensures filters survive template save/reload cycles.
229
+ */
230
+ _persistFiltersToNodeConfig() {
231
+ if (!this.currentNode || !this.api)
232
+ return;
233
+ const { filters: t } = this.store.recommendationConfigs;
234
+ l.updateConfig(
235
+ this.api,
236
+ this.currentNode,
237
+ { filters: t },
238
+ "Update recommendation filters"
239
+ );
240
+ }
222
241
  }
223
242
  export {
224
243
  W as ALGORITHM_CONTROL_ID,
@@ -229,22 +248,22 @@ export {
229
248
  j as FILTERS_CONTROL_ID,
230
249
  R as FiltersControl,
231
250
  K as LOCALE_CONTROL_ID,
232
- y as LocaleControl,
251
+ N as LocaleControl,
233
252
  J as PRODUCT_LAYOUT_CONTROL_ID,
234
- _ as ProductLayoutControl,
235
- $ as RecommendationBlockControl,
253
+ y as ProductLayoutControl,
254
+ z as RecommendationBlockControl,
236
255
  X as SHUFFLE_CONTROL_ID,
237
- N as ShuffleControl,
256
+ _ as ShuffleControl,
238
257
  tt as formatProductPrice,
239
- P as getBlockElement,
258
+ I as getBlockElement,
240
259
  et as getCardComposition,
241
260
  ot as getCurrentLayout,
242
261
  rt as reapplySpacing,
243
- nt as regenerateMobileProductRows,
244
- it as regenerateProductRows,
262
+ it as regenerateMobileProductRows,
263
+ nt as regenerateProductRows,
245
264
  b as regenerateProductRowsWithStyles,
246
265
  st as setCurrencyAttributes,
247
266
  ct as updatePricesInPlace,
248
- I as updateProductContentInPlace,
267
+ P as updateProductContentInPlace,
249
268
  at as updateSingleProductContent
250
269
  };
@@ -1,14 +1,15 @@
1
- import { RecommendationFeedSourceMaps as d, PriceAttributes as S } from "../../../../enums/extensions/recommendationBlock.js";
2
- import { useRecommendationApi as p } from "../../../../services/recommendationApi.js";
3
- import { useConfigStore as b } from "../../../../stores/config.js";
4
- import { defineStore as I } from "pinia";
5
- import { DEFAULT_CARDS_IN_ROW as R } from "../constants/layout.js";
6
- import { getDefaultProducts as k } from "../templates/utils.js";
1
+ import { RecommendationFeedSourceMaps as d, getOperatorOptions as S, PriceAttributes as p } from "../../../../enums/extensions/recommendationBlock.js";
2
+ import { useRecommendationApi as b } from "../../../../services/recommendationApi.js";
3
+ import { useConfigStore as I } from "../../../../stores/config.js";
4
+ import { defineStore as R } from "pinia";
5
+ import { DEFAULT_CARDS_IN_ROW as k } from "../constants/layout.js";
6
+ import { getDefaultProducts as C } from "../templates/utils.js";
7
7
  import { generateCompleteFilterQuery as f } from "../utils/filterUtil.js";
8
- const m = p();
8
+ import { isFilterValid as y } from "../validation/filterSchema.js";
9
+ const m = b();
9
10
  function h() {
10
11
  return {
11
- cardsInRow: R,
12
+ cardsInRow: k,
12
13
  currencySettings: {
13
14
  name: "USD",
14
15
  value: "USD",
@@ -32,17 +33,18 @@ function h() {
32
33
  size: "6"
33
34
  };
34
35
  }
35
- function C() {
36
+ function G() {
36
37
  return {
37
38
  recommendationConfigs: h(),
38
39
  recommendationProducts: [],
39
40
  filterStatus: !1,
40
41
  filterSelectionDrawerStatus: !1,
41
42
  filterGroup: 1,
42
- isInitialized: !1
43
+ isInitialized: !1,
44
+ filterSnapshot: null
43
45
  };
44
46
  }
45
- const y = () => ({
47
+ const F = () => ({
46
48
  recommendationCampaignUrls: {},
47
49
  activePredictiveAlgorithms: [],
48
50
  languages: {},
@@ -51,8 +53,8 @@ const y = () => ({
51
53
  blockStates: {},
52
54
  currentRecommendationId: null,
53
55
  configVersion: 0
54
- }), A = I("guidoRecommendationExtension", {
55
- state: () => y(),
56
+ }), V = R("guidoRecommendationExtension", {
57
+ state: () => F(),
56
58
  getters: {
57
59
  // ====================================================================
58
60
  // Proxy Getters — Backward Compatible Access to Current Block State
@@ -94,9 +96,17 @@ const y = () => ({
94
96
  hasFilters() {
95
97
  return !!this.recommendationConfigs.filters.length;
96
98
  },
99
+ hasValidFilters() {
100
+ const { filters: t } = this.recommendationConfigs;
101
+ return t.length ? t.every((r) => r.isValid) : !1;
102
+ },
97
103
  getFilterGroupCount() {
98
104
  const { filters: t } = this.recommendationConfigs;
99
- return t.length && t[t.length - 1].filterGroup || 0;
105
+ return t.length ? new Set(t.map((r) => r.filterGroup)).size : 0;
106
+ },
107
+ getUniqueFilterGroups() {
108
+ const { filters: t } = this.recommendationConfigs;
109
+ return [...new Set(t.map((r) => r.filterGroup))].sort((r, e) => r - e);
100
110
  },
101
111
  getActivePredictiveAlgorithms: (t) => {
102
112
  const r = [];
@@ -117,7 +127,7 @@ const y = () => ({
117
127
  })),
118
128
  getFilterList() {
119
129
  return Object.values(this.filterList).map((t) => {
120
- const r = t.type === "defaultAttribute", e = S.includes(t.attributeName);
130
+ const r = t.type === "defaultAttribute", e = p.includes(t.attributeName);
121
131
  let n = r ? t.attributeName : `product_attributes.${t.attributeName}`;
122
132
  return n = e ? `${n}.${this.recommendationConfigs.currencySettings.value}` : n, {
123
133
  text: t.displayName,
@@ -141,7 +151,7 @@ const y = () => ({
141
151
  setCurrentBlock(t) {
142
152
  this.blockStates[t] || (this.blockStates = {
143
153
  ...this.blockStates,
144
- [t]: C()
154
+ [t]: G()
145
155
  }), this.currentRecommendationId = t;
146
156
  },
147
157
  /**
@@ -181,33 +191,56 @@ const y = () => ({
181
191
  const { triggerRefetch: n = !0 } = r;
182
192
  n && this.configVersion++;
183
193
  },
194
+ /**
195
+ * Creates a filter with the first available attribute and operator pre-selected.
196
+ */
197
+ createDefaultFilter(t, r) {
198
+ const [e] = this.getFilterList, [n] = S(e == null ? void 0 : e.type);
199
+ return {
200
+ type: "standardFilter",
201
+ attribute: (e == null ? void 0 : e.value) ?? "",
202
+ operator: (n == null ? void 0 : n.value) ?? "",
203
+ innerGroupOperator: "*",
204
+ outerGroupOperator: "*",
205
+ filterNumber: r,
206
+ filterGroup: t,
207
+ isValid: !1,
208
+ value: ""
209
+ };
210
+ },
184
211
  /**
185
212
  * Opens the filter selection drawer for the current block.
186
- * If no filters exist, initializes with a default empty filter
213
+ * Saves a snapshot of current filters for cancel/revert.
214
+ * If no filters exist, initializes with a default filter
187
215
  * so the user has a starting point for input.
188
216
  */
189
217
  openFilterDrawer() {
190
218
  if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
191
219
  return;
192
220
  const t = this.blockStates[this.currentRecommendationId];
193
- t.recommendationConfigs.filters.length || (t.recommendationConfigs.filters = [{
194
- type: "standardFilter",
195
- attribute: "",
196
- operatorReplace: "",
197
- operator: "",
198
- innerGroupOperator: "*",
199
- outerGroupOperator: "*",
200
- filterNumber: 1,
201
- filterGroup: 1,
202
- isValid: !1,
203
- value: ""
204
- }]), t.filterSelectionDrawerStatus = !0;
221
+ t.filterSnapshot = JSON.parse(
222
+ JSON.stringify(t.recommendationConfigs.filters)
223
+ ), t.recommendationConfigs.filters.length || (t.recommendationConfigs.filters = [this.createDefaultFilter(1, 1)]), t.filterSelectionDrawerStatus = !0;
205
224
  },
206
225
  /**
207
- * Closes the filter selection drawer for the current block
226
+ * Closes the filter selection drawer for the current block.
227
+ * Called after successful apply — discards the snapshot.
208
228
  */
209
229
  closeFilterDrawer() {
210
- this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || (this.blockStates[this.currentRecommendationId].filterSelectionDrawerStatus = !1);
230
+ if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
231
+ return;
232
+ const t = this.blockStates[this.currentRecommendationId];
233
+ t.filterSnapshot = null, t.filterSelectionDrawerStatus = !1;
234
+ },
235
+ /**
236
+ * Cancels the filter selection drawer and reverts filters
237
+ * to the snapshot taken when the drawer was opened.
238
+ */
239
+ cancelFilterDrawer() {
240
+ if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
241
+ return;
242
+ const t = this.blockStates[this.currentRecommendationId];
243
+ t.filterSnapshot !== null && (t.recommendationConfigs.filters = t.filterSnapshot, t.filterSnapshot = null), t.filterSelectionDrawerStatus = !1;
211
244
  },
212
245
  // ====================================================================
213
246
  // Shared Data Fetching (fetched once, used by all blocks)
@@ -234,18 +267,18 @@ const y = () => ({
234
267
  // Per-Block Filter Actions
235
268
  // ====================================================================
236
269
  addFilterGroup(t) {
237
- this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || this.blockStates[this.currentRecommendationId].recommendationConfigs.filters.push({
238
- type: "standardFilter",
239
- attribute: "",
240
- operatorReplace: "",
241
- operator: "",
242
- innerGroupOperator: "",
243
- outerGroupOperator: "",
244
- value: "",
245
- filterNumber: 1,
246
- isValid: !0,
247
- filterGroup: t
248
- });
270
+ this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId] || this.blockStates[this.currentRecommendationId].recommendationConfigs.filters.push(
271
+ this.createDefaultFilter(t, 1)
272
+ );
273
+ },
274
+ deleteFilterGroup(t) {
275
+ if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
276
+ return;
277
+ const r = this.blockStates[this.currentRecommendationId], e = r.recommendationConfigs.filters.filter((i) => i.filterGroup !== t), n = [...new Set(e.map((i) => i.filterGroup))].sort((i, o) => i - o), s = new Map(n.map((i, o) => [i, o + 1]));
278
+ r.recommendationConfigs.filters = e.map((i) => ({
279
+ ...i,
280
+ filterGroup: s.get(i.filterGroup) ?? i.filterGroup
281
+ }));
249
282
  },
250
283
  updateFilter(t) {
251
284
  if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
@@ -253,7 +286,10 @@ const y = () => ({
253
286
  const r = this.blockStates[this.currentRecommendationId], e = r.recommendationConfigs.filters.findIndex((n) => n.filterNumber === t.filterNumber && n.filterGroup === t.filterGroup);
254
287
  if (e !== -1) {
255
288
  const n = [...r.recommendationConfigs.filters];
256
- n[e] = t, t.value.length && t.operator && t.attribute && t.innerGroupOperator && t.outerGroupOperator ? n[e].isValid = !0 : n[e].isValid = !1, r.recommendationConfigs.filters = n;
289
+ n[e] = {
290
+ ...t,
291
+ isValid: y(t)
292
+ }, r.recommendationConfigs.filters = n;
257
293
  }
258
294
  },
259
295
  deleteFilter(t) {
@@ -268,15 +304,15 @@ const y = () => ({
268
304
  addFilter(t) {
269
305
  if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
270
306
  return;
271
- const r = this.blockStates[this.currentRecommendationId], e = [...r.recommendationConfigs.filters], o = e.filter(
272
- (i) => i.filterGroup === t.filterGroup
273
- ).length + 1, s = e.findLastIndex((i) => i.filterGroup === t.filterGroup);
274
- s !== -1 ? e.splice(s + 1, 0, {
307
+ const r = this.blockStates[this.currentRecommendationId], e = [...r.recommendationConfigs.filters], s = e.filter(
308
+ (o) => o.filterGroup === t.filterGroup
309
+ ).length + 1, i = e.findLastIndex((o) => o.filterGroup === t.filterGroup);
310
+ i !== -1 ? e.splice(i + 1, 0, {
275
311
  ...t,
276
- filterNumber: o
312
+ filterNumber: s
277
313
  }) : e.push({
278
314
  ...t,
279
- filterNumber: o
315
+ filterNumber: s
280
316
  }), r.recommendationConfigs.filters = e;
281
317
  },
282
318
  generateFilterQuery() {
@@ -289,26 +325,26 @@ const y = () => ({
289
325
  var u;
290
326
  if (this.currentRecommendationId === null || !this.blockStates[this.currentRecommendationId])
291
327
  return;
292
- const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((l) => l.isValid), o = f(n), s = ((u = d.find((l) => l.key === e.strategy)) == null ? void 0 : u.path) || "", i = b(), c = {
328
+ const t = this.currentRecommendationId, r = this.blockStates[t], { recommendationConfigs: e } = r, n = e.filters.filter((l) => l.isValid), s = f(n), i = ((u = d.find((l) => l.key === e.strategy)) == null ? void 0 : u.path) || "", o = I(), c = {
293
329
  locale: e.language,
294
330
  currency: e.currencySettings.value,
295
- partnerName: i.partnerName,
331
+ partnerName: o.partnerName,
296
332
  size: e.size,
297
333
  details: !0,
298
- campaignId: i.variationId
334
+ campaignId: o.variationId
299
335
  };
300
- e.strategy === "manualMerchandising" ? c.productId = e.productIds.join(",") : e.strategy === "similarViewed" && (c.productId = "{itemId}"), o && (c.filter = o), e.shuffleProducts && (c.shuffle = !0);
336
+ e.strategy === "manualMerchandising" ? c.productId = e.productIds.join(",") : e.strategy === "similarViewed" && (c.productId = "{itemId}"), s && (c.filter = s), e.shuffleProducts && (c.shuffle = !0);
301
337
  const g = parseInt(e.size) || 6;
302
338
  let a;
303
339
  try {
304
- a = await m.fetchRecommendationProducts(s, c);
340
+ a = await m.fetchRecommendationProducts(i, c);
305
341
  } catch {
306
342
  a = [];
307
343
  }
308
- this.blockStates[t] && (this.blockStates[t].recommendationProducts = a.length > 0 ? a : k(g));
344
+ this.blockStates[t] && (this.blockStates[t].recommendationProducts = a.length > 0 ? a : C(g));
309
345
  }
310
346
  }
311
347
  });
312
348
  export {
313
- A as useRecommendationExtensionStore
349
+ V as useRecommendationExtensionStore
314
350
  };
@@ -1,22 +1,22 @@
1
1
  function l(t) {
2
2
  if (t.length === 0)
3
3
  return "";
4
- const o = t.sort((r, e) => r.filterNumber - e.filterNumber), n = o.map((r) => `[${r.attribute}][${r.operatorReplace}][${r.value}]`), [i, ...p] = n;
5
- let u = i;
6
- for (let r = 0; r < p.length; r++) {
7
- const e = o[r + 1].innerGroupOperator;
8
- u += `${e}${p[r]}`;
4
+ const o = t.sort((r, e) => r.filterNumber - e.filterNumber), n = o.map((r) => `[${r.attribute}][${r.operator}][${r.value}]`), [p, ...i] = n;
5
+ let u = p;
6
+ for (let r = 0; r < i.length; r++) {
7
+ const e = o[r].innerGroupOperator;
8
+ u += `${e}${i[r]}`;
9
9
  }
10
10
  return `(${u})`;
11
11
  }
12
12
  function f(t) {
13
13
  if (!t || t.length === 0)
14
14
  return "";
15
- const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), n = Object.keys(o).map(Number).sort((r, e) => r - e), i = n.map((r) => {
15
+ const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), n = Object.keys(o).map(Number).sort((r, e) => r - e), p = n.map((r) => {
16
16
  const e = o[r];
17
17
  return l(e);
18
- }), [p, ...u] = i;
19
- let s = p;
18
+ }), [i, ...u] = p;
19
+ let s = i;
20
20
  for (let r = 0; r < u.length; r++) {
21
21
  const e = n[r + 1], c = o[e][0].outerGroupOperator;
22
22
  s += `${c}${u[r]}`;
@@ -0,0 +1,29 @@
1
+ import { safeParse as o, object as p, boolean as l, number as i, pipe as c, minLength as f, string as m } from "../../../../node_modules/valibot/dist/index.js";
2
+ const e = c(m(), f(1)), s = p({
3
+ type: e,
4
+ attribute: e,
5
+ operator: e,
6
+ innerGroupOperator: e,
7
+ outerGroupOperator: e,
8
+ value: e,
9
+ filterGroup: i(),
10
+ filterNumber: i(),
11
+ isValid: l()
12
+ });
13
+ function g(t) {
14
+ return o(s, t).success;
15
+ }
16
+ function S(t) {
17
+ const r = o(s, t);
18
+ return r.success ? /* @__PURE__ */ new Set() : new Set(
19
+ r.issues.flatMap((u) => {
20
+ var n;
21
+ return ((n = u.path) == null ? void 0 : n.map((a) => String(a.key))) ?? [];
22
+ })
23
+ );
24
+ }
25
+ export {
26
+ s as FilterSchema,
27
+ S as getInvalidFilterFields,
28
+ g as isFilterValid
29
+ };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-913a3417] .in-progress-wrapper__progress p span:last-child{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.editor-actions[data-v-17dd4d8b]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-16abb398]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-16abb398]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-16abb398]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
1
+ .gap-16[data-v-3b53a736],.gap-16[data-v-c5dee797]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-913a3417] .in-progress-wrapper__progress p span:last-child{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.editor-actions[data-v-17dd4d8b]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-16abb398]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-16abb398]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-16abb398]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  filter: Filter;
4
4
  index: number;
5
5
  hasLogicAdapter?: boolean;
6
+ submitted: boolean;
6
7
  };
7
8
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
8
9
  "delete-filter": (filter: Filter) => void;
@@ -1,2 +1,16 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ type __VLS_Props = {
2
+ submitted: boolean;
3
+ };
4
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {
5
+ switchToGroup: (groupId: number) => void;
6
+ }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
2
7
  export default _default;
8
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
+ type __VLS_TypePropsToOption<T> = {
10
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
11
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
+ } : {
13
+ type: import('vue').PropType<T[K]>;
14
+ required: true;
15
+ };
16
+ };
@@ -76,4 +76,9 @@ export declare class RecommendationBlockControl extends CommonControl {
76
76
  * (e.g., fetchRecommendationCreateData setting preferred currency).
77
77
  */
78
78
  _listenStateUpdates(): void;
79
+ /**
80
+ * Persists the current filter state from Pinia store to the Stripo node config.
81
+ * This ensures filters survive template save/reload cycles.
82
+ */
83
+ private _persistFiltersToNodeConfig;
79
84
  }
@@ -31,6 +31,8 @@ interface PerBlockState {
31
31
  filterGroup: number;
32
32
  /** Whether initial API data (filters, algorithms, products) has been fetched for this block */
33
33
  isInitialized: boolean;
34
+ /** Snapshot of filters taken when the drawer opens, used to revert on cancel */
35
+ filterSnapshot: Filter[] | null;
34
36
  }
35
37
  interface StoreState {
36
38
  recommendationCampaignUrls: Record<string, string>;
@@ -125,7 +127,9 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
125
127
  configVersion: number;
126
128
  } & import("pinia").PiniaCustomStateProperties<StoreState>): number;
127
129
  hasFilters(): boolean;
130
+ hasValidFilters(): boolean;
128
131
  getFilterGroupCount(): number;
132
+ getUniqueFilterGroups(): number[];
129
133
  getActivePredictiveAlgorithms: (state: {
130
134
  recommendationCampaignUrls: Record<string, string>;
131
135
  activePredictiveAlgorithms: number[];
@@ -203,19 +207,31 @@ export declare const useRecommendationExtensionStore: import("pinia").StoreDefin
203
207
  patchCurrentBlockConfig(updates: Partial<PerBlockConfigs>, options?: {
204
208
  triggerRefetch?: boolean;
205
209
  }): void;
210
+ /**
211
+ * Creates a filter with the first available attribute and operator pre-selected.
212
+ */
213
+ createDefaultFilter(filterGroup: number, filterNumber: number): Filter;
206
214
  /**
207
215
  * Opens the filter selection drawer for the current block.
208
- * If no filters exist, initializes with a default empty filter
216
+ * Saves a snapshot of current filters for cancel/revert.
217
+ * If no filters exist, initializes with a default filter
209
218
  * so the user has a starting point for input.
210
219
  */
211
220
  openFilterDrawer(): void;
212
221
  /**
213
- * Closes the filter selection drawer for the current block
222
+ * Closes the filter selection drawer for the current block.
223
+ * Called after successful apply — discards the snapshot.
214
224
  */
215
225
  closeFilterDrawer(): void;
226
+ /**
227
+ * Cancels the filter selection drawer and reverts filters
228
+ * to the snapshot taken when the drawer was opened.
229
+ */
230
+ cancelFilterDrawer(): void;
216
231
  fetchRecommendationCreateData(): Promise<void>;
217
232
  fetchRecommendationFilters(): Promise<void>;
218
233
  addFilterGroup(filterGroup: number): void;
234
+ deleteFilterGroup(groupId: number): void;
219
235
  updateFilter(updatedFilter: Filter): void;
220
236
  deleteFilter(filter: Filter): void;
221
237
  addFilter(filter: Filter): void;
@@ -0,0 +1,15 @@
1
+ import type { Filter } from '@@/Types/recommendation';
2
+ import * as v from 'valibot';
3
+ export declare const FilterSchema: v.ObjectSchema<{
4
+ readonly type: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
5
+ readonly attribute: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
6
+ readonly operator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
7
+ readonly innerGroupOperator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
8
+ readonly outerGroupOperator: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
9
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
10
+ readonly filterGroup: v.NumberSchema<undefined>;
11
+ readonly filterNumber: v.NumberSchema<undefined>;
12
+ readonly isValid: v.BooleanSchema<undefined>;
13
+ }, undefined>;
14
+ export declare function isFilterValid(filter: Filter): boolean;
15
+ export declare function getInvalidFilterFields(filter: Filter): Set<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "2.1.0-beta.497ad9c",
3
+ "version": "2.1.0-beta.4adc9e7",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",