@useinsider/guido 2.1.0-beta.a873eb7 → 2.1.0-beta.ab9a598

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 (68) hide show
  1. package/dist/@types/config/schemas.js +1 -1
  2. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +13 -11
  3. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +23 -54
  4. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +3 -3
  5. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +21 -34
  6. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +11 -11
  7. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +34 -44
  8. package/dist/components/organisms/header/EditorActions.vue.js +10 -8
  9. package/dist/components/organisms/header/EditorActions.vue2.js +40 -30
  10. package/dist/components/organisms/header/MigrationConfirmModal.vue.js +17 -0
  11. package/dist/components/organisms/header/MigrationConfirmModal.vue2.js +39 -0
  12. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
  13. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
  14. package/dist/composables/useStripo.js +25 -23
  15. package/dist/composables/useVersionHistoryApi.js +1 -1
  16. package/dist/config/i18n/en/index.js +11 -0
  17. package/dist/config/i18n/en/labels.json.js +12 -0
  18. package/dist/config/i18n/en/toasters.json.js +56 -0
  19. package/dist/config/i18n/en/tooltips.json.js +82 -0
  20. package/dist/config/i18n/index.js +7 -0
  21. package/dist/config/migrator/itemsBlockMigrator.js +136 -131
  22. package/dist/config/migrator/recommendationMigrator.js +58 -54
  23. package/dist/enums/block.js +4 -0
  24. package/dist/extensions/Blocks/Items/block.js +30 -21
  25. package/dist/extensions/Blocks/Items/iconsRegistry.js +7 -6
  26. package/dist/extensions/Blocks/Items/items.css.js +48 -0
  27. package/dist/extensions/Blocks/Recommendation/block.js +22 -13
  28. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +39 -58
  29. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +5 -4
  30. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +48 -0
  31. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +57 -93
  32. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +8 -8
  33. package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
  34. package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
  35. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
  36. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
  37. package/dist/extensions/Blocks/common-control.js +12 -4
  38. package/dist/guido.css +1 -1
  39. package/dist/src/@types/extensions/block.d.ts +2 -0
  40. package/dist/src/components/Guido.vue.d.ts +1 -1
  41. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -1
  42. package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +1 -15
  43. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  44. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  45. package/dist/src/components/organisms/header/MigrationConfirmModal.vue.d.ts +6 -0
  46. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  47. package/dist/src/components/wrappers/WpModal.vue.d.ts +2 -2
  48. package/dist/src/config/i18n/en/index.d.ts +1 -0
  49. package/dist/src/config/i18n/index.d.ts +16 -0
  50. package/dist/src/enums/block.d.ts +4 -0
  51. package/dist/src/extensions/Blocks/Items/block.d.ts +3 -1
  52. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +3 -1
  53. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -5
  54. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +2 -18
  55. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  56. package/dist/src/extensions/Blocks/common-control.d.ts +5 -0
  57. package/dist/src/stores/template.d.ts +29 -0
  58. package/dist/src/utils/migrationBannerHtml.d.ts +2 -0
  59. package/dist/static/assets/info.svg.js +5 -0
  60. package/dist/static/styles/components/notification.css.js +18 -0
  61. package/dist/static/styles/components/tools.css.js +6 -2
  62. package/dist/static/styles/variables.css.js +2 -0
  63. package/dist/stores/template.js +15 -0
  64. package/dist/stores/unsubscribe.js +37 -34
  65. package/dist/utils/migrationBannerHtml.js +21 -0
  66. package/package.json +1 -1
  67. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +0 -29
  68. 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, 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";
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 l from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var i = function() {
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", 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) {
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, 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) {
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"), "state-message": t.valueErrorMessage, states: t.getFieldState("value"), "tooltip-status": !1, type: t.valueInputType, value: decodeURIComponent(t.props.filter.value) }, on: { input: function(s) {
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
- } } })]], 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) {
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
- }, o = [], n = /* @__PURE__ */ l(
17
+ }, n = [], o = /* @__PURE__ */ i(
16
18
  r,
17
- i,
18
- o,
19
+ l,
20
+ n,
19
21
  !1,
20
22
  null,
21
- "3b53a736"
23
+ "6562e38c"
22
24
  );
23
- const f = n.exports;
25
+ const f = o.exports;
24
26
  export {
25
27
  f as default
26
28
  };
@@ -1,69 +1,38 @@
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__ */ _({
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(f, { emit: v }) {
19
- const t = f, n = C(), a = V(), y = [
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
- { 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
- });
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: 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 };
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
- K as default
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 i = function() {
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", "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);
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
- i,
8
+ l,
9
9
  s,
10
10
  !1,
11
11
  null,
@@ -1,51 +1,38 @@
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({
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(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(() => ({
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
- t.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
14
+ e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
20
15
  ),
21
- loadingStatus: t.value
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: t.value
23
+ disabledStatus: e.value
28
24
  }
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 },
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
- ), e.closeFilterDrawer(), t.value = !1;
46
- }, WpDrawer: b, Filters: h };
32
+ ), o(), e.value = !1;
33
+ }, WpDrawer: i, Filters: u };
47
34
  }
48
35
  });
49
36
  export {
50
- I as default
37
+ v as default
51
38
  };
@@ -1,20 +1,20 @@
1
1
  import s from "./Filters.vue2.js";
2
2
  /* empty css */
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(
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
- a,
11
+ o,
12
12
  d,
13
13
  !1,
14
14
  null,
15
- "c5dee797"
15
+ "1ccb6d4a"
16
16
  );
17
- const g = n.exports;
17
+ const _ = n.exports;
18
18
  export {
19
- g as default
19
+ _ as default
20
20
  };
@@ -1,54 +1,44 @@
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";
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 { 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";
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 y = /* @__PURE__ */ h({
7
+ const E = /* @__PURE__ */ m({
9
8
  __name: "Filters",
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) => {
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
- 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
- );
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
- t.deleteFilter(e);
36
+ console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
47
37
  }, handleDeleteFilterGroup: () => {
48
- u.value.length <= 1 || t.deleteFilterGroup(r.value);
49
- }, getTooltipOptions: R, InSegments: U, InButtonV2: T, FilterItem: E, LogicAdapter: A };
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
- y as default
43
+ E as default
54
44
  };
@@ -1,21 +1,23 @@
1
1
  import l from "./EditorActions.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var d = function() {
3
+ import d from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var u = function() {
5
5
  var s, i, n, a;
6
- var e = this, o = e._self._c, t = e._self._setupProxy;
7
- return o("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? o(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : e._e(), o(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? o(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : e._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? o(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : e._e(), t.editorStore.isPreviewModeOpen ? e._e() : o(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(_) {
6
+ var o = this, e = o._self._c, t = o._self._setupProxy;
7
+ return e("div", { staticClass: "d-f editor-actions" }, [t.isVersionHistoryButtonVisible ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = (s = t.config) == null ? void 0 : s.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), (a = (n = t.config) == null ? void 0 : n.features) != null && a.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button", { staticPosition: "bottom right" }), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : o._e(), t.editorStore.isPreviewModeOpen ? o._e() : e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(r) {
8
8
  return t.handleSave(!1);
9
+ } } }), e(t.MigrationConfirmModal, { ref: "migrationModalRef", on: { confirm: function(r) {
10
+ return t.executeSave(!1);
9
11
  } } })], 1);
10
- }, u = [], p = /* @__PURE__ */ r(
12
+ }, p = [], c = /* @__PURE__ */ d(
11
13
  l,
12
- d,
13
14
  u,
15
+ p,
14
16
  !1,
15
17
  null,
16
- "17dd4d8b"
18
+ "a289b9e9"
17
19
  );
18
- const v = p.exports;
20
+ const v = c.exports;
19
21
  export {
20
22
  v as default
21
23
  };
@@ -1,41 +1,51 @@
1
- import { defineComponent as g, ref as u, computed as f } from "vue";
2
- import { useConfig as E } from "../../../composables/useConfig.js";
3
- import { useExport as h } from "../../../composables/useExport.js";
4
- import { useTestEmailClick as w } from "../../../composables/useGuidoActions.js";
5
- import { useSave as x } from "../../../composables/useSave.js";
6
- import { useTranslations as T } from "../../../composables/useTranslations.js";
7
- import { useVersionHistoryApi as O } from "../../../composables/useVersionHistoryApi.js";
8
- import { useEditorStore as A } from "../../../stores/editor.js";
9
- import { getTooltipOptions as C } from "../../../utils/tooltipUtils.js";
10
- import { InButtonV2 as k } from "@useinsider/design-system-vue";
11
- const J = /* @__PURE__ */ g({
1
+ import { defineComponent as E, ref as n, computed as g } from "vue";
2
+ import { useConfig as w } from "../../../composables/useConfig.js";
3
+ import { useExport as C } from "../../../composables/useExport.js";
4
+ import { useTestEmailClick as M } from "../../../composables/useGuidoActions.js";
5
+ import { useSave as O } from "../../../composables/useSave.js";
6
+ import { useTranslations as A } from "../../../composables/useTranslations.js";
7
+ import { useVersionHistoryApi as k } from "../../../composables/useVersionHistoryApi.js";
8
+ import { useEditorStore as B } from "../../../stores/editor.js";
9
+ import { useTemplateStore as R } from "../../../stores/template.js";
10
+ import { getTooltipOptions as b } from "../../../utils/tooltipUtils.js";
11
+ import { InButtonV2 as D } from "@useinsider/design-system-vue";
12
+ import { storeToRefs as I } from "pinia";
13
+ import P from "./MigrationConfirmModal.vue.js";
14
+ const Z = /* @__PURE__ */ E({
12
15
  __name: "EditorActions",
13
- setup(B, { expose: v }) {
14
- const { config: n } = E(), { exportHtml: a } = h(), { save: l } = x(), { openVersionHistory: p, closeVersionHistory: c } = O(), o = A(), s = T(), r = u(!1), i = u(!1), d = w(), y = () => {
15
- if (o.isVersionHistoryOpen) {
16
+ setup(j, { expose: H }) {
17
+ const { config: a } = w(), { exportHtml: m } = C(), { save: p } = O(), { openVersionHistory: l, closeVersionHistory: c } = k(), e = B(), u = R(), { hasMigrations: f } = I(u), s = A(), r = n(!1), i = n(!1), v = n(), S = M(), V = () => {
18
+ if (e.isVersionHistoryOpen) {
16
19
  c();
17
20
  return;
18
21
  }
19
- p();
20
- }, H = async () => {
21
- r.value = !0, await a(), r.value = !1;
22
- }, V = () => {
23
- o.isSaveAsTemplateDrawerOpen = !0;
24
- }, S = f(() => o.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), _ = f(
22
+ l();
23
+ }, T = async () => {
24
+ r.value = !0, await m(), r.value = !1;
25
+ }, _ = () => {
26
+ e.isSaveAsTemplateDrawerOpen = !0;
27
+ }, h = g(() => e.isVersionHistoryOpen ? s("newsletter.close-version-history") : s("newsletter.version-history")), x = g(
25
28
  () => {
26
- var t, e;
27
- return ((e = (t = n.value) == null ? void 0 : t.features) == null ? void 0 : e.versionHistory) && !o.isPreviewModeOpen;
29
+ var o, t;
30
+ return ((t = (o = a.value) == null ? void 0 : o.features) == null ? void 0 : t.versionHistory) && !e.isPreviewModeOpen;
28
31
  }
29
- ), m = async (t) => {
30
- i.value = !0, o.loadingStatus = !0;
31
- const e = await l(t);
32
- return i.value = !1, (t || !e) && (o.loadingStatus = !1), e;
32
+ ), d = async (o) => {
33
+ i.value = !0, e.loadingStatus = !0;
34
+ const t = await p(o);
35
+ return i.value = !1, (o || !t) && (e.loadingStatus = !1), t;
36
+ }, y = (o) => {
37
+ var t;
38
+ if (!o && f.value) {
39
+ (t = v.value) == null || t.open();
40
+ return;
41
+ }
42
+ d(o);
33
43
  };
34
- return v({
35
- handleSave: m
36
- }), { __sfc: !0, config: n, exportHtml: a, save: l, openVersionHistory: p, closeVersionHistory: c, editorStore: o, trans: s, isExporting: r, isSaving: i, testEmailClick: d, handleVersionHistory: y, handleExport: H, handleSaveAs: V, versionHistoryTooltipText: S, isVersionHistoryButtonVisible: _, handleSave: m, getTooltipOptions: C, InButtonV2: k };
44
+ return H({
45
+ handleSave: y
46
+ }), { __sfc: !0, config: a, exportHtml: m, save: p, openVersionHistory: l, closeVersionHistory: c, editorStore: e, templateStore: u, hasMigrations: f, trans: s, isExporting: r, isSaving: i, migrationModalRef: v, testEmailClick: S, handleVersionHistory: V, handleExport: T, handleSaveAs: _, versionHistoryTooltipText: h, isVersionHistoryButtonVisible: x, executeSave: d, handleSave: y, getTooltipOptions: b, InButtonV2: D, MigrationConfirmModal: P };
37
47
  }
38
48
  });
39
49
  export {
40
- J as default
50
+ Z as default
41
51
  };
@@ -0,0 +1,17 @@
1
+ import n from "./MigrationConfirmModal.vue2.js";
2
+ import t from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var e = this, r = e._self._c, o = e._self._setupProxy;
5
+ return o.isVisible ? r(o.WpModal, { attrs: { id: "migration-confirm-modal", size: "X-small", "close-on-outside-click": !1, "footer-button-options": o.footerButtonOptions, title: o.trans("email-editor.migration-confirm-save") }, on: { close: o.close, "primary-action": o.handleConfirm } }, [r("p", { domProps: { innerHTML: e._s(o.confirmMessage) } })]) : e._e();
6
+ }, s = [], a = /* @__PURE__ */ t(
7
+ n,
8
+ i,
9
+ s,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const c = a.exports;
15
+ export {
16
+ c as default
17
+ };
@@ -0,0 +1,39 @@
1
+ import { defineComponent as g, ref as m, computed as s } from "vue";
2
+ import _ from "../../wrappers/WpModal.vue.js";
3
+ import { useTranslations as b } from "../../../composables/useTranslations.js";
4
+ import { useTemplateStore as M } from "../../../stores/template.js";
5
+ const k = /* @__PURE__ */ g({
6
+ __name: "MigrationConfirmModal",
7
+ emits: ["confirm"],
8
+ setup(y, { expose: c, emit: n }) {
9
+ const t = m(!1), o = M(), e = b(), l = m({
10
+ cancelOrBackButton: {
11
+ type: "secondary",
12
+ labelText: e("campaign-builder.cancel"),
13
+ styling: "ghost"
14
+ },
15
+ primaryButton: {
16
+ type: "primary",
17
+ labelText: e("email-editor.migration-confirm-save")
18
+ }
19
+ }), i = s(() => {
20
+ if (o.hasRecommendationMigrations && o.hasItemsMigrations) {
21
+ const d = e("email-recommendation.recommendation"), u = e("email-editor.items");
22
+ return `${d} ${e("campaign-builder.or")} ${u}`;
23
+ }
24
+ return o.hasItemsMigrations ? e("email-editor.items") : e("email-recommendation.recommendation");
25
+ }), f = s(() => e("email-editor.migration-confirm-message", {
26
+ blockNames: i.value
27
+ })), r = () => {
28
+ t.value = !0;
29
+ }, a = () => {
30
+ t.value = !1;
31
+ }, p = () => {
32
+ a(), n("confirm");
33
+ };
34
+ return c({ open: r }), { __sfc: !0, emit: n, isVisible: t, templateStore: o, trans: e, footerButtonOptions: l, blockNames: i, confirmMessage: f, open: r, close: a, handleConfirm: p, WpModal: _ };
35
+ }
36
+ });
37
+ export {
38
+ k as default
39
+ };
@@ -16,7 +16,7 @@ var o = function() {
16
16
  i,
17
17
  !1,
18
18
  null,
19
- "a86fc486"
19
+ "df672485"
20
20
  );
21
21
  const _ = c.exports;
22
22
  export {