@useinsider/guido 2.1.0-beta.aa05b06 → 2.1.0-beta.abc38f2

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 (200) hide show
  1. package/dist/@types/config/schemas.js +1 -1
  2. package/dist/components/organisms/base/Toaster.vue.js +4 -4
  3. package/dist/components/organisms/base/Toaster.vue2.js +12 -9
  4. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +5 -5
  5. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +2 -2
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +11 -13
  7. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +54 -23
  8. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +7 -5
  9. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -23
  10. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +11 -11
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +48 -36
  12. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +11 -9
  13. package/dist/components/organisms/header/EditorActions.vue.js +10 -8
  14. package/dist/components/organisms/header/EditorActions.vue2.js +40 -30
  15. package/dist/components/organisms/header/MigrationConfirmModal.vue.js +17 -0
  16. package/dist/components/organisms/header/MigrationConfirmModal.vue2.js +39 -0
  17. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +1 -1
  18. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +19 -19
  19. package/dist/composables/useBlocksConfig.js +21 -20
  20. package/dist/composables/useHtmlValidator.js +114 -104
  21. package/dist/composables/useRecommendation.js +54 -21
  22. package/dist/composables/useStripo.js +25 -23
  23. package/dist/composables/useVersionHistoryApi.js +1 -1
  24. package/dist/config/compiler/recommendationCompilerRules.js +45 -39
  25. package/dist/config/compiler/utils/recommendationCompilerUtils.js +121 -0
  26. package/dist/config/i18n/en/index.js +11 -0
  27. package/dist/config/i18n/en/labels.json.js +12 -0
  28. package/dist/config/i18n/en/toasters.json.js +56 -0
  29. package/dist/config/i18n/en/tooltips.json.js +82 -0
  30. package/dist/config/i18n/index.js +7 -0
  31. package/dist/config/migrator/itemsBlockMigrator.js +129 -120
  32. package/dist/config/migrator/recommendationMigrator.js +58 -54
  33. package/dist/enums/block.js +4 -0
  34. package/dist/enums/extensions/recommendationBlock.js +1 -1
  35. package/dist/enums/recommendation.js +16 -15
  36. package/dist/extensions/Blocks/Items/block.js +30 -21
  37. package/dist/extensions/Blocks/Items/iconsRegistry.js +7 -6
  38. package/dist/extensions/Blocks/Items/items.css.js +48 -0
  39. package/dist/extensions/Blocks/Recommendation/block.js +142 -9
  40. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
  41. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
  42. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +66 -0
  43. package/dist/extensions/Blocks/Recommendation/constants/layout.js +22 -0
  44. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +21 -0
  45. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
  46. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +80 -0
  47. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +232 -0
  48. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
  49. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +92 -0
  50. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +102 -0
  51. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +209 -0
  52. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +52 -0
  53. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +269 -0
  54. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +70 -0
  55. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +160 -0
  56. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +67 -0
  57. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +307 -0
  58. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +21 -0
  59. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
  60. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +108 -0
  61. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
  62. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
  63. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +16 -14
  64. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +16 -14
  65. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
  66. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
  67. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
  68. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
  69. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +222 -0
  70. package/dist/extensions/Blocks/Recommendation/extension.js +40 -17
  71. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +21 -4
  72. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +61 -4
  73. package/dist/extensions/Blocks/Recommendation/services/configService.js +240 -0
  74. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -10
  75. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +311 -218
  76. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +228 -0
  77. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
  78. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +66 -0
  79. package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
  80. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +169 -0
  81. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +73 -0
  82. package/dist/extensions/Blocks/Recommendation/templates/utils.js +134 -0
  83. package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +6 -0
  84. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +12 -12
  85. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +26 -15
  86. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +29 -0
  87. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +46 -0
  88. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +29 -0
  89. package/dist/extensions/Blocks/Unsubscribe/block.js +29 -29
  90. package/dist/extensions/Blocks/Unsubscribe/control.js +12 -9
  91. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +13 -11
  92. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +31 -1
  93. package/dist/extensions/Blocks/common-control.js +12 -4
  94. package/dist/extensions/Blocks/controlFactories.js +125 -93
  95. package/dist/extensions/ModulesTabIcons/extension.js +3 -3
  96. package/dist/guido.css +1 -1
  97. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +242 -186
  98. package/dist/services/recommendationApi.js +11 -8
  99. package/dist/services/stripoApi.js +20 -17
  100. package/dist/services/templateLibraryApi.js +16 -13
  101. package/dist/src/@types/extensions/block.d.ts +2 -0
  102. package/dist/src/components/Guido.vue.d.ts +1 -1
  103. package/dist/src/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +1 -0
  104. package/dist/src/components/organisms/extensions/recommendation/Filters.vue.d.ts +17 -1
  105. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  106. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  107. package/dist/src/components/organisms/header/MigrationConfirmModal.vue.d.ts +6 -0
  108. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  109. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
  110. package/dist/src/components/wrappers/WpModal.vue.d.ts +2 -2
  111. package/dist/src/composables/useRecommendation.d.ts +1 -0
  112. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +17 -0
  113. package/dist/src/config/i18n/en/index.d.ts +1 -0
  114. package/dist/src/config/i18n/index.d.ts +16 -0
  115. package/dist/src/enums/block.d.ts +4 -0
  116. package/dist/src/extensions/Blocks/Items/block.d.ts +3 -1
  117. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +70 -1
  118. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
  119. package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +0 -24
  120. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +49 -0
  121. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +13 -0
  122. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +41 -0
  123. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +35 -0
  124. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
  125. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +31 -0
  126. package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -3
  127. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
  128. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -589
  129. package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +37 -0
  130. package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +29 -0
  131. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +52 -0
  132. package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
  133. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +84 -0
  134. package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +24 -0
  135. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +60 -0
  136. package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +23 -0
  137. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +221 -0
  138. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +29 -0
  139. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
  140. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +34 -0
  141. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
  142. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
  143. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +15 -0
  144. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +15 -0
  145. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
  146. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +15 -0
  147. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +15 -0
  148. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
  149. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +83 -0
  150. package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
  151. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +151 -0
  152. package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +6 -0
  153. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +154 -468
  154. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +20 -0
  155. package/dist/src/extensions/Blocks/Recommendation/templates/{migrationTemplate.d.ts → grid/migration.d.ts} +11 -4
  156. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +33 -0
  157. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +41 -0
  158. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +8 -0
  159. package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +25 -0
  160. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +18 -0
  161. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +66 -0
  162. package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +7 -0
  163. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +166 -0
  164. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +33 -0
  165. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +113 -0
  166. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +77 -0
  167. package/dist/src/extensions/Blocks/Recommendation/validation/filterSchema.d.ts +15 -0
  168. package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
  169. package/dist/src/extensions/Blocks/common-control.d.ts +5 -0
  170. package/dist/src/stores/template.d.ts +29 -0
  171. package/dist/src/utils/migrationBannerHtml.d.ts +2 -0
  172. package/dist/static/assets/info.svg.js +5 -0
  173. package/dist/static/styles/components/notification.css.js +19 -0
  174. package/dist/static/styles/components/tools.css.js +6 -2
  175. package/dist/static/styles/components/version-history.css.js +10 -2
  176. package/dist/static/styles/components/wide-panel.css.js +18 -2
  177. package/dist/static/styles/customEditorStyle.css.js +35 -11
  178. package/dist/static/styles/variables.css.js +2 -0
  179. package/dist/static/templates/empty/index.html.js +74 -0
  180. package/dist/static/templates/empty/style.css.js +779 -0
  181. package/dist/stores/template.js +15 -0
  182. package/dist/stores/unsubscribe.js +37 -34
  183. package/dist/utils/migrationBannerHtml.js +21 -0
  184. package/dist/utils/pairProductVariables.js +57 -56
  185. package/dist/utils/templatePreparation.js +15 -14
  186. package/package.json +2 -2
  187. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -187
  188. package/dist/extensions/Blocks/Recommendation/constants.js +0 -13
  189. package/dist/extensions/Blocks/Recommendation/control.js +0 -336
  190. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
  191. package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -245
  192. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
  193. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
  194. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -181
  195. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
  196. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
  197. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
  198. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +0 -16
  199. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
  200. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
@@ -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,10 +1,10 @@
1
- import e from "./Toaster.vue2.js";
1
+ import n from "./Toaster.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var r = function() {
4
- var o = this, n = o._self._c, t = o._self._setupProxy;
5
- return n(t.InToasts, { attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
4
+ var o = this, e = o._self._c, t = o._self._setupProxy;
5
+ return e(t.InToasts, { ref: "toastRef", attrs: { "action-buttons-config": t.actionButtonsConfig, status: t.store.status, text: t.store.text, type: t.store.type }, on: { actionButtonClick0: t.handleActionClick } });
6
6
  }, a = [], _ = /* @__PURE__ */ s(
7
- e,
7
+ n,
8
8
  r,
9
9
  a,
10
10
  !1,
@@ -1,15 +1,18 @@
1
- import { defineComponent as n, computed as e } from "vue";
2
- import { useToasterStore as i } from "../../../stores/toaster.js";
3
- import { InToasts as c } from "@useinsider/design-system-vue";
4
- const f = /* @__PURE__ */ n({
1
+ import { defineComponent as a, ref as c, computed as i, onBeforeUnmount as u } from "vue";
2
+ import { useToasterStore as f } from "../../../stores/toaster.js";
3
+ import { InToasts as m } from "@useinsider/design-system-vue";
4
+ const d = /* @__PURE__ */ a({
5
5
  __name: "Toaster",
6
- setup(s) {
7
- const t = i(), o = e(() => t.actionButton ? [{ text: t.actionButton.text }] : []);
8
- return { __sfc: !0, store: t, actionButtonsConfig: o, handleActionClick: () => {
6
+ setup(p) {
7
+ const t = f(), o = c(null), r = i(() => t.actionButton ? [{ text: t.actionButton.text }] : []), s = () => {
9
8
  t.actionButton && t.actionButton.onClick(), t.hideToaster();
10
- }, InToasts: c };
9
+ };
10
+ return u(() => {
11
+ var e, n;
12
+ t.$reset(), (n = (e = o.value) == null ? void 0 : e.$el) == null || n.remove();
13
+ }), { __sfc: !0, store: t, toastRef: o, actionButtonsConfig: r, handleActionClick: s, InToasts: m };
11
14
  }
12
15
  });
13
16
  export {
14
- f as default
17
+ d as default
15
18
  };
@@ -1,16 +1,16 @@
1
- import i from "./EmailSizeIndicator.vue2.js";
1
+ import s from "./EmailSizeIndicator.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var o = function() {
5
- var t = this, s = t._self._c, e = t._self._setupProxy;
6
- return e.previewStore.previewHtml ? s("div", { staticClass: "d-f a-i-c j-c-c" }, [s(e.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: e.htmlSize, "max-value": e.MAX_EMAIL_SIZE_IN_KB, type: e.progress.type, value: e.progress.value } }), s(e.InTooltip, { staticClass: "d-f ml-1", attrs: { id: "email-size-tooltip", align: "center", position: "bottom", text: e.trans("email-editor.preview-design-size-tooltip") } })], 1) : t._e();
5
+ var e = this, i = e._self._c, t = e._self._setupProxy;
6
+ return t.previewStore.previewHtml ? i("div", { staticClass: "d-f a-i-c j-c-c" }, [i(t.InProgress, { staticClass: "min-w-15-s", attrs: { id: "email-size-progress", "description-status": "", "description-position": "left", description: t.htmlSize, "max-value": t.MAX_EMAIL_SIZE_IN_KB, type: t.progress.type, value: t.progress.value } }), i(t.InTooltipV2, { attrs: { id: "email-size-tooltip", "icon-status": "", "static-position": "bottom center", "dynamic-position": !1, text: t.trans("email-editor.preview-design-size-tooltip") } })], 1) : e._e();
7
7
  }, a = [], n = /* @__PURE__ */ r(
8
- i,
8
+ s,
9
9
  o,
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "913a3417"
13
+ "079d2bf7"
14
14
  );
15
15
  const m = n.exports;
16
16
  export {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as c, ref as n, computed as l, watch as u } from "vue";
2
2
  import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
3
  import { usePreviewStore as _ } from "../../../../stores/preview.js";
4
- import { InTooltip as v, InProgress as f } from "@useinsider/design-system-vue";
4
+ import { InTooltipV2 as v, InProgress as f } from "@useinsider/design-system-vue";
5
5
  const S = /* @__PURE__ */ c({
6
6
  __name: "EmailSizeIndicator",
7
7
  setup(w) {
@@ -17,7 +17,7 @@ const S = /* @__PURE__ */ c({
17
17
  }, i = p();
18
18
  return u(() => t.previewHtml, () => {
19
19
  r();
20
- }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltip: v };
20
+ }, { immediate: !0 }), { __sfc: !0, previewStore: t, MAX_EMAIL_SIZE_IN_KB: o, htmlKB: e, progress: s, htmlSize: a, calculateProgress: r, trans: i, InProgress: f, InTooltipV2: v };
21
21
  }
22
22
  });
23
23
  export {
@@ -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,17 +1,19 @@
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 }, on: { "reset-validation": function(c) {
6
+ t.submitted = !1;
7
+ } } }) : e._e()], 1);
6
8
  }, s = [], a = /* @__PURE__ */ n(
7
9
  o,
8
- l,
10
+ i,
9
11
  s,
10
12
  !1,
11
13
  null,
12
14
  null
13
15
  );
14
- const p = a.exports;
16
+ const d = a.exports;
15
17
  export {
16
- p as default
18
+ d as default
17
19
  };
@@ -1,37 +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 p } from "../../../../composables/useTranslations.js";
4
- import { useRecommendationExtensionStore as c } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import u from "./Filters.vue.js";
6
- const b = /* @__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(m) {
9
- const t = p(), o = c(), 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
- labelText: t(
14
- e.value ? "unsubscription-preference.selecting-type" : "products.select-and-continue"
18
+ labelText: r(
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
- labelText: t("products.cancel"),
23
- disabledStatus: e.value
26
+ labelText: r("products.cancel"),
27
+ disabledStatus: t.value
24
28
  }
25
- })), r = () => {
26
- o.filterSelectionDrawerStatus = !1;
27
- };
28
- return { __sfc: !0, trans: t, store: o, isApplying: e, footerButtonGroupOptions: s, closeModal: r, applyFilter: () => {
29
- e.value = !0, setTimeout(() => {
30
- console.debug("Filter applied!"), r(), o.generateFilterQuery();
31
- }, 2e3);
32
- }, WpDrawer: i, Filters: u };
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 },
44
+ { triggerRefetch: !0 }
45
+ ), e.closeFilterDrawer(), t.value = !1;
46
+ }, WpDrawer: b, Filters: h };
33
47
  }
34
48
  });
35
49
  export {
36
- b as default
50
+ I as default
37
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
+ "0e1b0c54"
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,56 @@
1
- import { defineComponent as m, computed as o, ref as h } from "vue";
2
- import { useTranslations as G } from "../../../../composables/useTranslations.js";
3
- import { useRecommendationExtensionStore as g } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
- import { InButtonV2 as v, InSegments as f } from "@useinsider/design-system-vue";
5
- import _ from "./FilterItem.vue.js";
6
- import A from "./LogicAdapter.vue.js";
7
- const E = /* @__PURE__ */ m({
1
+ import { defineComponent as v, computed as l, ref as O, watch as f } from "vue";
2
+ import { useTranslations as g } from "../../../../composables/useTranslations.js";
3
+ import { useRecommendationExtensionStore as R } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
+ import { getTooltipOptions as T } from "../../../../utils/tooltipUtils.js";
5
+ import { InButtonV2 as U, InSegments as E } from "@useinsider/design-system-vue";
6
+ import A from "./FilterItem.vue.js";
7
+ import C from "./LogicAdapter.vue.js";
8
+ const V = /* @__PURE__ */ v({
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
+ emits: ["reset-validation"],
14
+ setup(x, { expose: u, emit: s }) {
15
+ const p = g(), t = R(), a = l(() => t.getUniqueFilterGroups.map((e) => ({
16
+ text: e.toString(),
17
+ value: e
18
+ }))), r = O(1);
19
+ f(a, (e) => {
20
+ if (!e.length)
21
+ return;
22
+ e.some((h) => h.value === r.value) || (r.value = e[0].value);
23
+ });
24
+ const i = (e) => {
14
25
  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");
26
+ };
27
+ u({ switchToGroup: i });
28
+ const c = () => {
29
+ s("reset-validation");
30
+ const e = t.getUniqueFilterGroups, o = e.length > 0 ? Math.max(...e) + 1 : 1;
31
+ t.addFilterGroup(o), r.value = o;
32
+ }, d = l(() => a.value.length >= 3), n = l(() => t.getSelectedFilterGroup(r.value)), F = l(() => n.value.length >= 10), _ = l(() => n.value.length > 1), G = l(() => a.value.length > 1), m = l(() => {
33
+ var o;
34
+ return ((o = n.value[0]) == null ? void 0 : o.outerGroupOperator) || "*";
35
+ });
36
+ return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, MAX_FILTER_PER_GROUP_COUNT: 10, trans: p, store: t, emit: s, filterGroupList: a, selectedFilterGroup: r, switchToGroup: i, handleAddFilterGroup: c, isMaxFilterGroupCount: d, selectedFilterGroupFilters: n, isMaxFilterPerGroupCount: F, hasLogicAdapter: _, hasRemoveFilterButton: G, outerGroupOperator: m, handleOuterGroupOperatorChange: (e) => {
37
+ n.value.forEach((o) => {
38
+ t.updateFilter({ ...o, outerGroupOperator: e });
39
+ });
40
+ }, handleAddFilter: () => {
41
+ s("reset-validation"), t.addFilter(
42
+ t.createDefaultFilter(
43
+ r.value,
44
+ n.value.length + 1
45
+ )
46
+ );
35
47
  }, handleDeleteFilter: (e) => {
36
- console.debug("handleDeleteFilter: ", e), l.deleteFilter(e);
48
+ t.deleteFilter(e);
37
49
  }, 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 };
50
+ a.value.length <= 1 || t.deleteFilterGroup(r.value);
51
+ }, getTooltipOptions: T, InSegments: E, InButtonV2: U, FilterItem: A, LogicAdapter: C };
40
52
  }
41
53
  });
42
54
  export {
43
- E as default
55
+ V as default
44
56
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as s, ref as n } from "vue";
2
- import { InSegments as p } from "@useinsider/design-system-vue";
3
- const l = /* @__PURE__ */ s({
1
+ import { defineComponent as s, ref as n, watch as p } from "vue";
2
+ import { InSegments as g } from "@useinsider/design-system-vue";
3
+ const m = /* @__PURE__ */ s({
4
4
  __name: "LogicAdapter",
5
5
  props: {
6
6
  logic: null
7
7
  },
8
8
  emits: ["change"],
9
- setup(r, { emit: e }) {
10
- const t = r, a = n([
9
+ setup(a, { emit: c }) {
10
+ const t = a, r = n([
11
11
  {
12
12
  text: "and",
13
13
  value: "*"
@@ -17,11 +17,13 @@ const l = /* @__PURE__ */ s({
17
17
  value: "|"
18
18
  }
19
19
  ]), o = n(t.logic || "*");
20
- return { __sfc: !0, logicAdapterList: a, emit: e, props: t, selectedLogicAdapter: o, changeLogicAdapter: (c) => {
21
- o.value = c, e("change", c);
22
- }, InSegments: p };
20
+ return p(() => t.logic, (e) => {
21
+ o.value = e || "*";
22
+ }), { __sfc: !0, logicAdapterList: r, emit: c, props: t, selectedLogicAdapter: o, changeLogicAdapter: (e) => {
23
+ o.value = e, c("change", e);
24
+ }, InSegments: g };
23
25
  }
24
26
  });
25
27
  export {
26
- l as default
28
+ m as default
27
29
  };
@@ -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
  };