@useinsider/guido 3.2.0-beta.7e0c6bd → 3.2.0-beta.7fb9b70

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 (337) hide show
  1. package/README.md +117 -1
  2. package/dist/@types/config/schemas.js +153 -95
  3. package/dist/@types/config/validator.js +34 -27
  4. package/dist/components/Guido.vue.js +4 -4
  5. package/dist/components/Guido.vue2.js +95 -88
  6. package/dist/components/organisms/AutoSaveController.vue.js +17 -0
  7. package/dist/components/organisms/AutoSaveController.vue2.js +13 -0
  8. package/dist/components/organisms/base/Toaster.vue2.js +11 -10
  9. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +12 -12
  10. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +6 -6
  11. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +15 -9
  12. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +40 -31
  13. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +20 -19
  14. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +14 -11
  15. package/dist/components/organisms/header/AutoSaveToggle.vue.js +22 -0
  16. package/dist/components/organisms/header/AutoSaveToggle.vue2.js +19 -0
  17. package/dist/components/organisms/header/EditorActions.vue.js +12 -11
  18. package/dist/components/organisms/header/EditorActions.vue2.js +22 -18
  19. package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -12
  20. package/dist/components/organisms/header/LeftSlot.vue2.js +19 -16
  21. package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -14
  22. package/dist/components/organisms/header/RightSlot.vue.js +8 -8
  23. package/dist/components/organisms/header/RightSlot.vue2.js +17 -13
  24. package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +12 -11
  25. package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +26 -24
  26. package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +12 -11
  27. package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +44 -41
  28. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +12 -11
  29. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +38 -36
  30. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +21 -18
  31. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +31 -27
  32. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +12 -11
  33. package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +32 -30
  34. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +12 -11
  35. package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +23 -21
  36. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +9 -8
  37. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +10 -9
  38. package/dist/composables/useActionsApi.js +38 -37
  39. package/dist/composables/useAutoSave.js +71 -0
  40. package/dist/composables/useBlocksConfig.js +26 -26
  41. package/dist/composables/useFullStoryBridge.js +9 -8
  42. package/dist/composables/useHtmlCompiler.js +26 -34
  43. package/dist/composables/useHtmlValidator.js +109 -101
  44. package/dist/composables/useHttp.js +30 -30
  45. package/dist/composables/usePartner.js +1 -1
  46. package/dist/composables/useRecommendation.js +46 -25
  47. package/dist/composables/useRibbonOffset.js +15 -15
  48. package/dist/composables/useSave.js +25 -21
  49. package/dist/composables/useStripo.js +48 -53
  50. package/dist/composables/useSyncModuleExtractor.js +29 -31
  51. package/dist/composables/useTimerClone.js +25 -24
  52. package/dist/composables/useTranslations.js +16 -23
  53. package/dist/composables/useValidation.js +8 -7
  54. package/dist/composables/validators/useCouponBlockValidator.js +24 -0
  55. package/dist/composables/validators/useLiquidValidator.js +13 -13
  56. package/dist/config/compiler/recommendationCompilerRules.js +25 -25
  57. package/dist/config/compiler/unsubscribeCompilerRules.js +19 -17
  58. package/dist/config/compiler/utils/recommendationCompilerUtils.js +105 -71
  59. package/dist/config/migrator/checkboxMigrator.js +21 -20
  60. package/dist/config/migrator/couponBlockMigrator.js +19 -18
  61. package/dist/config/migrator/index.js +9 -9
  62. package/dist/config/migrator/itemsBlockMigrator.js +89 -87
  63. package/dist/config/migrator/radioButtonMigrator.js +63 -42
  64. package/dist/config/migrator/recommendation/compositionMapper.js +98 -0
  65. package/dist/config/migrator/recommendation/extractors.js +27 -0
  66. package/dist/config/migrator/recommendation/htmlBuilder.js +496 -0
  67. package/dist/config/migrator/recommendation/parseLegacyConfig.js +33 -0
  68. package/dist/config/migrator/recommendation/settingsMapper.js +70 -0
  69. package/dist/config/migrator/recommendation/themeMapper.js +93 -0
  70. package/dist/config/migrator/recommendationMigrator.js +74 -287
  71. package/dist/config/migrator/unsubscribeMigrator.js +11 -10
  72. package/dist/enums/extensions/recommendationBlock.js +2 -1
  73. package/dist/enums/unsubscribe.js +19 -18
  74. package/dist/extensions/Blocks/Items/block.js +9 -9
  75. package/dist/extensions/Blocks/Items/controls/button/link.js +14 -14
  76. package/dist/extensions/Blocks/Items/controls/cardComposition.js +97 -89
  77. package/dist/extensions/Blocks/Items/controls/image/link.js +14 -14
  78. package/dist/extensions/Blocks/Items/controls/name/trimming.js +24 -23
  79. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +14 -13
  80. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +47 -44
  81. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -38
  82. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +11 -11
  83. package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +40 -38
  84. package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +35 -35
  85. package/dist/extensions/Blocks/Items/controls/settingsControl.js +162 -155
  86. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  87. package/dist/extensions/Blocks/Items/template.js +210 -210
  88. package/dist/extensions/Blocks/RadioButton/template.js +1 -1
  89. package/dist/extensions/Blocks/Recommendation/block.js +35 -32
  90. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
  91. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +36 -36
  92. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +133 -128
  93. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/index.js +9 -9
  94. package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +10 -10
  95. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +9 -9
  96. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +34 -32
  97. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +6 -4
  98. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -82
  99. package/dist/extensions/Blocks/Recommendation/controls/main/layoutOrientation.js +18 -18
  100. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +4 -4
  101. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +36 -35
  102. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +240 -192
  103. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +24 -24
  104. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +10 -10
  105. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +24 -24
  106. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +24 -24
  107. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +4 -4
  108. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +4 -4
  109. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +24 -24
  110. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +4 -4
  111. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +4 -4
  112. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +24 -24
  113. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +32 -32
  114. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +20 -18
  115. package/dist/extensions/Blocks/Recommendation/extension.js +32 -31
  116. package/dist/extensions/Blocks/Recommendation/services/configService.js +65 -29
  117. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +16 -8
  118. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +150 -109
  119. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +37 -27
  120. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +10 -10
  121. package/dist/extensions/Blocks/Recommendation/templates/index.js +6 -6
  122. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +37 -26
  123. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +1 -1
  124. package/dist/extensions/Blocks/Recommendation/templates/utils.js +47 -45
  125. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +21 -0
  126. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +13 -22
  127. package/dist/extensions/Blocks/Recommendation/validation/filterSchema.js +16 -13
  128. package/dist/extensions/Blocks/Unsubscribe/control.js +13 -11
  129. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +18 -16
  130. package/dist/extensions/Blocks/common-control.js +26 -25
  131. package/dist/extensions/DynamicContent/dynamic-content.js +58 -53
  132. package/dist/guido.css +1 -1
  133. package/dist/library.js +12 -11
  134. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +234 -233
  135. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  136. package/dist/node_modules/lodash-es/_Hash.js +20 -0
  137. package/dist/node_modules/lodash-es/_ListCache.js +20 -0
  138. package/dist/node_modules/lodash-es/_Map.js +6 -0
  139. package/dist/node_modules/lodash-es/_MapCache.js +20 -0
  140. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  141. package/dist/node_modules/lodash-es/_Set.js +6 -0
  142. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  143. package/dist/node_modules/lodash-es/_Stack.js +18 -0
  144. package/dist/node_modules/lodash-es/_Symbol.js +5 -0
  145. package/dist/node_modules/lodash-es/_Uint8Array.js +5 -0
  146. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  147. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  148. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +20 -0
  149. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  150. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  151. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  152. package/dist/node_modules/lodash-es/_assocIndexOf.js +10 -0
  153. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  154. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  155. package/dist/node_modules/lodash-es/_baseFor.js +5 -0
  156. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  157. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  158. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  159. package/dist/node_modules/lodash-es/_baseGetTag.js +10 -0
  160. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  161. package/dist/node_modules/lodash-es/_baseIsArguments.js +9 -0
  162. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  163. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  164. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  165. package/dist/node_modules/lodash-es/_baseIsNative.js +16 -0
  166. package/dist/node_modules/lodash-es/_baseIsTypedArray.js +12 -0
  167. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  168. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  169. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  170. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  171. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  172. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  173. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  174. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  175. package/dist/node_modules/lodash-es/_baseTimes.js +8 -0
  176. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  177. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  178. package/dist/node_modules/lodash-es/_baseUnary.js +8 -0
  179. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  180. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  181. package/dist/node_modules/lodash-es/_coreJsData.js +5 -0
  182. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  183. package/dist/node_modules/lodash-es/_createBaseFor.js +13 -0
  184. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  185. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  186. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  187. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  188. package/dist/node_modules/lodash-es/_freeGlobal.js +4 -0
  189. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  190. package/dist/node_modules/lodash-es/_getMapData.js +8 -0
  191. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  192. package/dist/node_modules/lodash-es/_getNative.js +9 -0
  193. package/dist/node_modules/lodash-es/_getRawTag.js +15 -0
  194. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  195. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  196. package/dist/node_modules/lodash-es/_getValue.js +6 -0
  197. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  198. package/dist/node_modules/lodash-es/_hashClear.js +7 -0
  199. package/dist/node_modules/lodash-es/_hashDelete.js +7 -0
  200. package/dist/node_modules/lodash-es/_hashGet.js +13 -0
  201. package/dist/node_modules/lodash-es/_hashHas.js +9 -0
  202. package/dist/node_modules/lodash-es/_hashSet.js +9 -0
  203. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  204. package/dist/node_modules/lodash-es/_isIndex.js +8 -0
  205. package/dist/node_modules/lodash-es/_isIterateeCall.js +13 -0
  206. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  207. package/dist/node_modules/lodash-es/_isKeyable.js +7 -0
  208. package/dist/node_modules/lodash-es/_isMasked.js +11 -0
  209. package/dist/node_modules/lodash-es/_isPrototype.js +8 -0
  210. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  211. package/dist/node_modules/lodash-es/_listCacheClear.js +6 -0
  212. package/dist/node_modules/lodash-es/_listCacheDelete.js +12 -0
  213. package/dist/node_modules/lodash-es/_listCacheGet.js +8 -0
  214. package/dist/node_modules/lodash-es/_listCacheHas.js +7 -0
  215. package/dist/node_modules/lodash-es/_listCacheSet.js +8 -0
  216. package/dist/node_modules/lodash-es/_mapCacheClear.js +13 -0
  217. package/dist/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  218. package/dist/node_modules/lodash-es/_mapCacheGet.js +7 -0
  219. package/dist/node_modules/lodash-es/_mapCacheHas.js +7 -0
  220. package/dist/node_modules/lodash-es/_mapCacheSet.js +8 -0
  221. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  222. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  223. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  224. package/dist/node_modules/lodash-es/_nativeCreate.js +5 -0
  225. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  226. package/dist/node_modules/lodash-es/_nodeUtil.js +11 -0
  227. package/dist/node_modules/lodash-es/_objectToString.js +7 -0
  228. package/dist/node_modules/lodash-es/_overArg.js +8 -0
  229. package/dist/node_modules/lodash-es/_root.js +5 -0
  230. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  231. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  232. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  233. package/dist/node_modules/lodash-es/_stackClear.js +7 -0
  234. package/dist/node_modules/lodash-es/_stackDelete.js +7 -0
  235. package/dist/node_modules/lodash-es/_stackGet.js +6 -0
  236. package/dist/node_modules/lodash-es/_stackHas.js +6 -0
  237. package/dist/node_modules/lodash-es/_stackSet.js +17 -0
  238. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  239. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  240. package/dist/node_modules/lodash-es/_toSource.js +17 -0
  241. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  242. package/dist/node_modules/lodash-es/eq.js +6 -0
  243. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  244. package/dist/node_modules/lodash-es/get.js +8 -0
  245. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  246. package/dist/node_modules/lodash-es/identity.js +6 -0
  247. package/dist/node_modules/lodash-es/isArguments.js +10 -0
  248. package/dist/node_modules/lodash-es/isArray.js +4 -0
  249. package/dist/node_modules/lodash-es/isArrayLike.js +8 -0
  250. package/dist/node_modules/lodash-es/isBuffer.js +6 -0
  251. package/dist/node_modules/lodash-es/isFunction.js +12 -0
  252. package/dist/node_modules/lodash-es/isLength.js +7 -0
  253. package/dist/node_modules/lodash-es/isObject.js +7 -0
  254. package/dist/node_modules/lodash-es/isObjectLike.js +6 -0
  255. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  256. package/dist/node_modules/lodash-es/isTypedArray.js +7 -0
  257. package/dist/node_modules/lodash-es/keys.js +9 -0
  258. package/dist/node_modules/lodash-es/map.js +11 -0
  259. package/dist/node_modules/lodash-es/memoize.js +18 -0
  260. package/dist/node_modules/lodash-es/property.js +10 -0
  261. package/dist/node_modules/lodash-es/range.js +5 -0
  262. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  263. package/dist/node_modules/lodash-es/stubFalse.js +6 -0
  264. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  265. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  266. package/dist/node_modules/lodash-es/toString.js +7 -0
  267. package/dist/node_modules/valibot/dist/index.js +458 -239
  268. package/dist/services/recommendationApi.js +17 -14
  269. package/dist/services/templateLibraryApi.js +40 -38
  270. package/dist/src/@types/config/defaults.d.ts +5 -1
  271. package/dist/src/@types/config/index.d.ts +3 -3
  272. package/dist/src/@types/config/schemas.d.ts +217 -0
  273. package/dist/src/@types/config/types.d.ts +9 -1
  274. package/dist/src/components/Guido.vue.d.ts +1 -1
  275. package/dist/src/components/organisms/AutoSaveController.vue.d.ts +2 -0
  276. package/dist/src/components/organisms/header/AutoSaveToggle.vue.d.ts +2 -0
  277. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
  278. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
  279. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
  280. package/dist/src/components/wrappers/WpModal.vue.d.ts +2 -2
  281. package/dist/src/composables/useAutoSave.d.ts +3 -0
  282. package/dist/src/composables/useConfig.d.ts +58 -0
  283. package/dist/src/composables/useHtmlCompiler.d.ts +2 -1
  284. package/dist/src/composables/useRecommendation.d.ts +10 -1
  285. package/dist/src/composables/useRecommendation.test.d.ts +1 -0
  286. package/dist/src/composables/useSave.d.ts +1 -1
  287. package/dist/src/composables/useTranslations.d.ts +1 -1
  288. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +3 -0
  289. package/dist/src/config/migrator/index.d.ts +2 -1
  290. package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +2 -0
  291. package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +1 -0
  292. package/dist/src/config/migrator/recommendation/extractors.d.ts +7 -0
  293. package/dist/src/config/migrator/recommendation/extractors.test.d.ts +1 -0
  294. package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +11 -0
  295. package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +15 -0
  296. package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +1 -0
  297. package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +7 -0
  298. package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +1 -0
  299. package/dist/src/config/migrator/recommendation/themeMapper.d.ts +5 -0
  300. package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +1 -0
  301. package/dist/src/config/migrator/recommendation/types.d.ts +205 -0
  302. package/dist/src/config/migrator/recommendationMigrator.d.ts +13 -1
  303. package/dist/src/config/migrator/recommendationMigrator.test.d.ts +1 -0
  304. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  305. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +1 -0
  306. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +10 -0
  307. package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +1 -0
  308. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +34 -0
  309. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
  310. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +21 -0
  311. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +1 -0
  312. package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -3
  313. package/dist/src/library.d.ts +1 -1
  314. package/dist/src/stores/autosave.d.ts +12 -0
  315. package/dist/src/stores/config.d.ts +522 -0
  316. package/dist/src/stores/dynamic-content.d.ts +3 -3
  317. package/dist/src/stores/editor.d.ts +23 -0
  318. package/dist/src/utils/htmlEscape.d.ts +5 -0
  319. package/dist/src/utils/htmlEscape.test.d.ts +1 -0
  320. package/dist/src/utils/timeUtil.d.ts +8 -0
  321. package/dist/stores/autosave.js +17 -0
  322. package/dist/stores/config.js +81 -25
  323. package/dist/stores/dynamic-content.js +11 -6
  324. package/dist/stores/editor.js +3 -1
  325. package/dist/stores/onboarding.js +1 -1
  326. package/dist/stores/preview.js +9 -6
  327. package/dist/stores/unsubscribe.js +4 -1
  328. package/dist/utils/dateUtil.js +10 -7
  329. package/dist/utils/genericUtil.js +13 -10
  330. package/dist/utils/htmlEscape.js +13 -0
  331. package/dist/utils/pairProductVariables.js +89 -87
  332. package/dist/utils/templatePreparation.js +72 -32
  333. package/dist/utils/timeUtil.js +19 -0
  334. package/package.json +7 -6
  335. package/dist/enums/displayConditions.js +0 -80
  336. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  337. package/dist/src/enums/displayConditions.d.ts +0 -2
@@ -1,126 +1,133 @@
1
- import { defineComponent as X, defineAsyncComponent as s, ref as R, computed as A, watch as Y, onMounted as Z, onUnmounted as ee } from "vue";
2
- import { provideGuidoActions as te } from "../composables/useGuidoActions.js";
3
- import { usePartner as oe } from "../composables/usePartner.js";
4
- import { useStripo as ne } from "../composables/useStripo.js";
5
- import { useTimerClone as re } from "../composables/useTimerClone.js";
6
- import { migrate as I } from "../config/migrator/index.js";
7
- import { ModuleFolderDefaults as W } from "../enums/defaults.js";
8
- import { RIBBON_SELECTOR as se } from "../enums/onboarding.js";
9
- import ie from "./organisms/base/Toaster.vue.js";
1
+ import { defineComponent as J, defineAsyncComponent as I, ref as W, computed as B, watch as Q, onMounted as X, onUnmounted as Y } from "vue";
2
+ import { provideGuidoActions as Z } from "../composables/useGuidoActions.js";
3
+ import { usePartner as ee } from "../composables/usePartner.js";
4
+ import { useStripo as oe } from "../composables/useStripo.js";
5
+ import { useTimerClone as te } from "../composables/useTimerClone.js";
6
+ import { migrate as H } from "../config/migrator/index.js";
7
+ import { ModuleFolderDefaults as x } from "../enums/defaults.js";
8
+ import { RIBBON_SELECTOR as ne } from "../enums/onboarding.js";
9
+ import re from "./organisms/AutoSaveController.vue.js";
10
+ import se from "./organisms/base/Toaster.vue.js";
11
+ import ce from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
10
12
  import ae from "./organisms/header/HeaderWrapper.vue.js";
11
- import ce from "./organisms/LoadingWrapper.vue.js";
12
- import { useStripoApi as me } from "../services/stripoApi.js";
13
- import { useConfigStore as de } from "../stores/config.js";
14
- import { useDynamicContentStore as le } from "../stores/dynamic-content.js";
15
- import { useEditorStore as pe } from "../stores/editor.js";
16
- import { usePreviewStore as ue } from "../stores/preview.js";
17
- import { useUnsubscribeStore as fe } from "../stores/unsubscribe.js";
18
- const Me = /* @__PURE__ */ X({
13
+ import ie from "./organisms/LoadingWrapper.vue.js";
14
+ import me from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
15
+ import de from "./organisms/unsubscribe/UnsubscribeWrapper.vue.js";
16
+ import { useStripoApi as le } from "../services/stripoApi.js";
17
+ import { useConfigStore as ue } from "../stores/config.js";
18
+ import { useDynamicContentStore as pe } from "../stores/dynamic-content.js";
19
+ import { useEditorStore as fe } from "../stores/editor.js";
20
+ import { usePreviewStore as ve } from "../stores/preview.js";
21
+ import { useUnsubscribeStore as ye } from "../stores/unsubscribe.js";
22
+ const We = /* @__PURE__ */ J({
19
23
  __name: "Guido",
20
24
  props: {
21
25
  config: null
22
26
  },
23
27
  emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
24
- setup(B, { expose: H, emit: o }) {
25
- const y = B, x = s(
26
- () => import("./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js")
27
- ), G = s(
28
- () => import("./organisms/save-as-template/SaveAsTemplateDrawer.vue.js")
29
- ), z = s(
30
- () => import("./organisms/unsubscribe/UnsubscribeWrapper.vue.js")
31
- ), q = s(
28
+ setup(G, { expose: z, emit: n }) {
29
+ const g = G, q = I(
32
30
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
33
- ), K = s(
31
+ ), K = I(
34
32
  () => import("./organisms/onboarding/OnboardingWrapper.vue.js")
35
- ), h = R(), m = R(), d = le(), S = fe(), n = de();
36
- n.init(y.config);
37
- const l = pe(), V = ue(), i = A(() => l.hasChanges), { isTestPartner: $ } = oe(), C = () => h.value?.handleSave(!0), {
38
- templateId: p,
39
- userId: w,
40
- partnerName: E,
41
- username: D,
42
- template: r,
43
- editor: u
44
- } = n, a = r?.html || "", T = r?.css || "", f = r?.preselectedDynamicContent || [], O = u?.savedModulesFolderName || W.SAVED_MODULES, k = u?.defaultModulesFolderName || W.DEFAULT_MODULES;
45
- l.templateId = p;
46
- const b = {
47
- emailId: p,
48
- userId: w,
49
- username: D,
50
- partnerName: E,
51
- savedModulesFolderName: O,
52
- defaultModulesFolderName: k
53
- }, F = {
54
- preselectedDynamicContentList: f,
33
+ ), w = W(), u = W(), p = pe(), E = ye(), i = ue();
34
+ i.init(g.config);
35
+ const f = fe(), V = ve(), m = B(() => f.hasChanges), { isTestPartner: $ } = ee(), D = () => {
36
+ var e;
37
+ return (e = w.value) == null ? void 0 : e.handleSave(!0);
38
+ }, {
39
+ templateId: v,
40
+ userId: C,
41
+ partnerName: T,
42
+ username: k,
43
+ template: o,
44
+ editor: s
45
+ } = i, d = (o == null ? void 0 : o.html) || "", F = (o == null ? void 0 : o.css) || "", y = (o == null ? void 0 : o.preselectedDynamicContent) || [], L = (s == null ? void 0 : s.savedModulesFolderName) || x.SAVED_MODULES, U = (s == null ? void 0 : s.defaultModulesFolderName) || x.DEFAULT_MODULES;
46
+ f.templateId = v;
47
+ const h = {
48
+ emailId: v,
49
+ userId: C,
50
+ username: k,
51
+ partnerName: T,
52
+ savedModulesFolderName: L,
53
+ defaultModulesFolderName: U
54
+ }, _ = {
55
+ preselectedDynamicContentList: y,
55
56
  onReady: () => {
56
- console.debug("guido:ready"), o("ready");
57
+ console.debug("guido:ready"), n("ready");
57
58
  }
58
- }, { initPlugin: L } = ne(b, F), { getDefaultTemplate: U } = me(), { cloneTimersOnSave: _, hasTimerBlocks: M } = re(), j = A(() => !n.ui?.showHeader);
59
- te({
59
+ }, { initPlugin: M } = oe(h, _), { getDefaultTemplate: O } = le(), { cloneTimersOnSave: P, hasTimerBlocks: A } = te(), j = B(() => {
60
+ var e;
61
+ return !((e = i.ui) != null && e.showHeader);
62
+ });
63
+ Z({
60
64
  onBack: () => {
61
- console.debug("guido:back"), o("back");
65
+ console.debug("guido:back"), n("back");
62
66
  },
63
67
  onSaveStart: () => {
64
- console.debug("guido:save:start"), o("save:start");
68
+ console.debug("guido:save:start"), n("save:start");
65
69
  },
66
- onSaveComplete: (t) => {
67
- const e = { ...t, metadata: b };
68
- console.debug("guido:save:complete", e), o("save:complete", e);
70
+ onSaveComplete: (e) => {
71
+ const t = { ...e, metadata: h };
72
+ console.debug("guido:save:complete", t), n("save:complete", t);
69
73
  },
70
74
  onTestEmailClick: () => {
71
- console.debug("guido:test-email:click"), o("test-email:click");
75
+ console.debug("guido:test-email:click"), n("test-email:click");
72
76
  }
73
77
  });
74
- const P = (t) => {
75
- console.debug("dynamic-content:close", t), d.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
76
- }, N = () => {
78
+ const N = (e) => {
79
+ console.debug("dynamic-content:close", e), p.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
80
+ }, R = () => {
77
81
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
78
82
  };
79
- Y(() => i.value, () => {
80
- o("on-change", i.value);
83
+ Q(() => m.value, () => {
84
+ n("on-change", m.value);
81
85
  });
82
- const v = (t) => {
83
- const e = t, { attribute: J, position: Q } = e.detail;
84
- console.debug("dynamic-content:open", e.detail), o("dynamic-content:open", J, Q);
86
+ const S = (e) => {
87
+ const t = e, { attribute: l, position: a } = t.detail;
88
+ console.debug("dynamic-content:open", t.detail), n("dynamic-content:open", l, a);
85
89
  };
86
90
  let c = null;
87
- const g = () => {
88
- const t = document.querySelector(se);
89
- m.value?.style.setProperty("--ribbon-offset", `${t?.offsetHeight ?? 0}px`);
91
+ const b = () => {
92
+ var t;
93
+ const e = document.querySelector(ne);
94
+ (t = u.value) == null || t.style.setProperty("--ribbon-offset", `${(e == null ? void 0 : e.offsetHeight) ?? 0}px`);
90
95
  };
91
- return Z(async () => {
92
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), g();
93
- const t = m.value?.parentElement;
94
- t && (c = new ResizeObserver(g), c.observe(t));
96
+ return X(async () => {
97
+ var t, l;
98
+ console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), b();
99
+ const e = (t = u.value) == null ? void 0 : t.parentElement;
100
+ e && (c = new ResizeObserver(b), c.observe(e));
95
101
  try {
96
- S.selectedUnsubscribePages = r?.selectedUnsubscribePages || [];
97
- let e = {
98
- html: a && await I(a),
99
- css: T
102
+ E.selectedUnsubscribePages = (o == null ? void 0 : o.selectedUnsubscribePages) || [];
103
+ const a = ((l = o == null ? void 0 : o.migration) == null ? void 0 : l.recommendationConfigs) ?? {};
104
+ let r = {
105
+ html: d && await H(d, a),
106
+ css: F
100
107
  };
101
- e.html || (e = await U(), e.html = await I(e.html)), M(e.html) && (e.html = await _(e.html)), await L(e), d.selectedDynamicContentList = f;
102
- } catch (e) {
103
- console.error("Failed to initialize Stripo editor:", e);
108
+ r.html || (r = await O(), r.html = await H(r.html, a)), A(r.html) && (r.html = await P(r.html)), await M(r), p.selectedDynamicContentList = y;
109
+ } catch (a) {
110
+ console.error("Failed to initialize Stripo editor:", a);
104
111
  }
105
- document.addEventListener("dynamic-content:open", v);
106
- }), ee(() => {
107
- c?.disconnect(), document.removeEventListener("dynamic-content:open", v);
112
+ document.addEventListener("dynamic-content:open", S);
113
+ }), Y(() => {
114
+ c == null || c.disconnect(), document.removeEventListener("dynamic-content:open", S);
108
115
  try {
109
116
  window.UIEditor.removeEditor();
110
117
  } catch {
111
118
  console.debug("Failed to remove Stripo editor: No editor found");
112
119
  }
113
- n.reset();
114
- }), H({
120
+ i.reset();
121
+ }), z({
115
122
  dynamicContent: {
116
- insert: P,
117
- close: N
123
+ insert: N,
124
+ close: R
118
125
  },
119
- hasChanges: i,
120
- saveSilent: C
121
- }), { __sfc: !0, FilterSelectionDrawer: x, SaveAsTemplateDrawer: G, UnsubscribeWrapper: z, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: h, wrapperRef: m, dynamicContentStore: d, unsubscribeStore: S, props: y, configStore: n, editorStore: l, previewStore: V, hasChanges: i, isTestPartner: $, saveSilent: C, templateId: p, userId: w, partnerName: E, username: D, templateConfig: r, editorConfig: u, html: a, css: T, preselectedDynamicContentList: f, savedModulesFolderName: O, defaultModulesFolderName: k, emit: o, metadata: b, options: F, initPlugin: L, getDefaultTemplate: U, cloneTimersOnSave: _, hasTimerBlocks: M, noHeader: j, insertDynamicContent: P, closeDynamicContent: N, handleDynamicContentOpen: v, ribbonObserver: c, updateRibbonOffset: g, Toaster: ie, HeaderWrapper: ae, LoadingWrapper: ce };
126
+ hasChanges: m,
127
+ saveSilent: D
128
+ }), { __sfc: !0, PreviewContainer: q, OnboardingWrapper: K, headerWrapperRef: w, wrapperRef: u, dynamicContentStore: p, unsubscribeStore: E, props: g, configStore: i, editorStore: f, previewStore: V, hasChanges: m, isTestPartner: $, saveSilent: D, templateId: v, userId: C, partnerName: T, username: k, templateConfig: o, editorConfig: s, html: d, css: F, preselectedDynamicContentList: y, savedModulesFolderName: L, defaultModulesFolderName: U, emit: n, metadata: h, options: _, initPlugin: M, getDefaultTemplate: O, cloneTimersOnSave: P, hasTimerBlocks: A, noHeader: j, insertDynamicContent: N, closeDynamicContent: R, handleDynamicContentOpen: S, ribbonObserver: c, updateRibbonOffset: b, AutoSaveController: re, Toaster: se, FilterSelectionDrawer: ce, HeaderWrapper: ae, LoadingWrapper: ie, SaveAsTemplateDrawer: me, UnsubscribeWrapper: de };
122
129
  }
123
130
  });
124
131
  export {
125
- Me as default
132
+ We as default
126
133
  };
@@ -0,0 +1,17 @@
1
+ import n from "./AutoSaveController.vue2.js";
2
+ import t from "../../_virtual/_plugin-vue2_normalizer.js";
3
+ var o = function() {
4
+ var r = this, e = r._self._c;
5
+ return r._self._setupProxy, e("div", { staticClass: "d-n" });
6
+ }, s = [], _ = /* @__PURE__ */ t(
7
+ n,
8
+ o,
9
+ s,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const f = _.exports;
15
+ export {
16
+ f as default
17
+ };
@@ -0,0 +1,13 @@
1
+ import { defineComponent as t } from "vue";
2
+ import { useAutoSave as r } from "../../composables/useAutoSave.js";
3
+ import { useSave as s } from "../../composables/useSave.js";
4
+ const f = /* @__PURE__ */ t({
5
+ __name: "AutoSaveController",
6
+ setup(a) {
7
+ const { save: e } = s(), o = () => e(!1, !0);
8
+ return r(o), { __sfc: !0, save: e, backgroundSave: o };
9
+ }
10
+ });
11
+ export {
12
+ f as default
13
+ };
@@ -1,17 +1,18 @@
1
- import { defineComponent as r, ref as s, computed as a, onBeforeUnmount as c } from "vue";
2
- import { useToasterStore as i } from "../../../stores/toaster.js";
3
- import { InToasts as u } from "@useinsider/design-system-vue";
4
- const _ = /* @__PURE__ */ r({
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(f) {
7
- const t = i(), o = s(null), e = a(() => t.actionButton ? [{ text: t.actionButton.text }] : []), n = () => {
6
+ setup(p) {
7
+ const t = f(), o = c(null), r = i(() => t.actionButton ? [{ text: t.actionButton.text }] : []), s = () => {
8
8
  t.actionButton && t.actionButton.onClick(), t.hideToaster();
9
9
  };
10
- return c(() => {
11
- t.$reset(), o.value?.$el?.remove();
12
- }), { __sfc: !0, store: t, toastRef: o, actionButtonsConfig: e, handleActionClick: n, InToasts: u };
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 };
13
14
  }
14
15
  });
15
16
  export {
16
- _ as default
17
+ d as default
17
18
  };
@@ -1,23 +1,23 @@
1
1
  import { defineComponent as f, ref as s, onMounted as c, onBeforeUnmount as m, nextTick as u } from "vue";
2
2
  import { useTranslations as p } from "../../../../composables/useTranslations.js";
3
3
  import { usePreviewStore as l } from "../../../../stores/preview.js";
4
- import v from "./DesktopBrowserHeader.vue.js";
5
- const R = /* @__PURE__ */ f({
4
+ import _ from "./DesktopBrowserHeader.vue.js";
5
+ const x = /* @__PURE__ */ f({
6
6
  __name: "DesktopPreview",
7
- setup(_) {
8
- const i = p(), r = s(), o = s(!1), a = l();
7
+ setup(v) {
8
+ const a = p(), o = s(), n = s(!1), i = l();
9
9
  let e = null;
10
- const n = () => {
11
- r.value && (e = new ResizeObserver(() => {
12
- }), e.observe(r.value), u(() => {
13
- o.value = !0;
10
+ const t = () => {
11
+ o.value && (e = new ResizeObserver(() => {
12
+ }), e.observe(o.value), u(() => {
13
+ n.value = !0;
14
14
  }));
15
- }, t = () => {
16
- e?.disconnect();
15
+ }, r = () => {
16
+ e == null || e.disconnect();
17
17
  };
18
- return c(n), m(t), { __sfc: !0, trans: i, containerRef: r, isContainerReady: o, previewStore: a, resizeObserver: e, initIframe: n, cleanIframe: t, DesktopBrowserHeader: v };
18
+ return c(t), m(r), { __sfc: !0, trans: a, containerRef: o, isContainerReady: n, previewStore: i, resizeObserver: e, initIframe: t, cleanIframe: r, DesktopBrowserHeader: _ };
19
19
  }
20
20
  });
21
21
  export {
22
- R as default
22
+ x as default
23
23
  };
@@ -7,14 +7,14 @@ const h = /* @__PURE__ */ m({
7
7
  __name: "ContentView",
8
8
  emits: ["back-to-inbox"],
9
9
  setup(v) {
10
- const i = a(), r = p(), t = c(), { setupResponsivePreview: n } = f(), s = (e) => {
11
- ["transform", "transform-origin", "height"].forEach((o) => {
12
- e.documentElement.style.removeProperty(o);
10
+ const i = a(), t = p(), n = c(), { setupResponsivePreview: r } = f(), s = (o) => {
11
+ ["transform", "transform-origin", "height"].forEach((e) => {
12
+ o.documentElement.style.removeProperty(e);
13
13
  });
14
14
  };
15
- return { __sfc: !0, trans: i, previewStore: r, iframeRef: t, setupResponsivePreview: n, clearAMPTransforms: s, onLoad: () => {
16
- const e = t.value, o = e?.contentDocument;
17
- o && (n(e), r.isAMPResponsive && s(o));
15
+ return { __sfc: !0, trans: i, previewStore: t, iframeRef: n, setupResponsivePreview: r, clearAMPTransforms: s, onLoad: () => {
16
+ const o = n.value, e = o == null ? void 0 : o.contentDocument;
17
+ e && (r(o), t.isAMPResponsive && s(e));
18
18
  }, InIcons: u };
19
19
  }
20
20
  });
@@ -1,15 +1,21 @@
1
- import { defineComponent as m, computed as o } from "vue";
2
- import { useConfig as a } from "../../../../composables/useConfig.js";
3
- import { useTranslations as i } from "../../../../composables/useTranslations.js";
4
- import { InIcons as c } from "@useinsider/design-system-vue";
5
- const _ = /* @__PURE__ */ m({
1
+ import { defineComponent as c, computed as r } from "vue";
2
+ import { useConfig as u } from "../../../../composables/useConfig.js";
3
+ import { useTranslations as d } from "../../../../composables/useTranslations.js";
4
+ import { InIcons as f } from "@useinsider/design-system-vue";
5
+ const j = /* @__PURE__ */ c({
6
6
  __name: "InboxView",
7
7
  emits: ["open-email"],
8
- setup(u, { emit: n }) {
9
- const e = i(), { config: t } = a(), s = o(() => t.value?.editor?.emailHeader?.senderName || e("settings.sender-name")), r = o(() => t.value?.editor?.emailHeader?.subject || e("email-editor.default-subject"));
10
- return { __sfc: !0, emit: n, trans: e, config: t, senderName: s, subject: r, InIcons: c };
8
+ setup(p, { emit: m }) {
9
+ const n = d(), { config: s } = u(), a = r(() => {
10
+ var e, t, o;
11
+ return ((o = (t = (e = s.value) == null ? void 0 : e.editor) == null ? void 0 : t.emailHeader) == null ? void 0 : o.senderName) || n("settings.sender-name");
12
+ }), i = r(() => {
13
+ var e, t, o;
14
+ return ((o = (t = (e = s.value) == null ? void 0 : e.editor) == null ? void 0 : t.emailHeader) == null ? void 0 : o.subject) || n("email-editor.default-subject");
15
+ });
16
+ return { __sfc: !0, emit: m, trans: n, config: s, senderName: a, subject: i, InIcons: f };
11
17
  }
12
18
  });
13
19
  export {
14
- _ as default
20
+ j as default
15
21
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as I, computed as r } from "vue";
2
- import { useTranslations as O } from "../../../../composables/useTranslations.js";
3
- import { getOperatorOptions as u } from "../../../../enums/extensions/recommendationBlock.js";
4
- import { useRecommendationExtensionStore as _ } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { getInvalidFilterFields as C } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
6
- import { InButtonV2 as V, InSelect as L, InBasicTextInput as S } from "@useinsider/design-system-vue";
7
- import w from "./LogicAdapter.vue.js";
8
- import { useDebounceFn as E } from "../../../../node_modules/@vueuse/shared/index.js";
9
- const J = /* @__PURE__ */ I({
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__ */ _({
10
10
  __name: "FilterItem",
11
11
  props: {
12
12
  filter: null,
@@ -15,46 +15,55 @@ const J = /* @__PURE__ */ I({
15
15
  submitted: { type: Boolean }
16
16
  },
17
17
  emits: ["delete-filter"],
18
- setup(f, { emit: m }) {
19
- const t = f, l = O(), o = _(), v = [
18
+ setup(f, { emit: v }) {
19
+ const t = f, n = C(), a = V(), y = [
20
20
  {
21
- text: l("email-editor.standard-filter"),
21
+ text: n("email-editor.standard-filter"),
22
22
  value: "standardFilter"
23
23
  }
24
- ], n = [
24
+ ], i = [
25
25
  { text: "True", value: "true" },
26
26
  { text: "False", value: "false" }
27
- ], s = r(() => t.filter.attribute || ""), a = r(() => o.getFilterList.find((e) => e.value === s.value) || { text: "", value: "", type: "" }), b = r(
28
- () => a.value?.type === "Boolean"
29
- ), y = r(() => u(a.value?.type).find((e) => e.value === t.filter.operator)), F = r(
30
- () => n.find((e) => e.value === t.filter.value) || n[0]
31
- ), i = r(() => t.submitted ? C(t.filter) : /* @__PURE__ */ new Set()), g = (e) => i.value.has(e) ? "error" : "default", h = r(
32
- () => i.value.has("value") ? l("action-builder.filter-empty-value-error") : ""
33
- ), p = r(
34
- () => a.value?.type === "Number"
35
- ), B = r(() => p.value ? "number" : "text"), x = E((e) => {
36
- o.updateFilter({
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({
37
46
  ...t.filter,
38
47
  [e.text]: e.value
39
48
  });
40
49
  }, 500);
41
- return { __sfc: !0, trans: l, store: o, props: t, filterTypeOptions: v, booleanValueOptions: n, attributeType: s, selectedAttributeType: a, isBooleanAttribute: b, selectedOperatorType: y, selectedBooleanValue: F, emit: m, invalidFields: i, getFieldState: g, valueErrorMessage: h, isNumericAttribute: p, valueInputType: B, updateFilter: x, handleAttributeChange: (e) => {
42
- const d = o.getFilterList.find((T) => T.value === e.value), c = d?.type === "Boolean", [A] = u(d?.type);
43
- o.updateFilter({
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({
44
53
  ...t.filter,
45
54
  attribute: e.value,
46
- operator: c ? "=" : A?.value ?? "",
47
- value: c ? "true" : ""
55
+ operator: m ? "=" : (s == null ? void 0 : s.value) ?? "",
56
+ value: m ? "true" : ""
48
57
  });
49
58
  }, handleBooleanValueChange: (e) => {
50
- o.updateFilter({
59
+ a.updateFilter({
51
60
  ...t.filter,
52
61
  operator: "=",
53
62
  value: e.value
54
63
  });
55
- }, getOperatorOptions: u, InBasicTextInput: S, InSelect: L, InButtonV2: V, LogicAdapter: w };
64
+ }, getOperatorOptions: p, InBasicTextInput: S, InSelect: O, InButtonV2: L, LogicAdapter: E };
56
65
  }
57
66
  });
58
67
  export {
59
- J as default
68
+ K as default
60
69
  };
@@ -1,17 +1,17 @@
1
- import { defineComponent as p, ref as s, watch as m, computed as d, nextTick as y } from "vue";
2
- import g from "../../../wrappers/WpDrawer.vue.js";
3
- import { useTranslations as v } from "../../../../composables/useTranslations.js";
4
- import { useRecommendationExtensionStore as b } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
5
- import { isFilterValid as w } from "../../../../extensions/Blocks/Recommendation/validation/filterSchema.js";
6
- import F from "./Filters.vue.js";
7
- const R = /* @__PURE__ */ p({
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({
8
8
  __name: "FilterSelectionDrawer",
9
- setup(_) {
10
- const r = v(), e = b(), t = s(!1), o = s(!1), a = s();
11
- m(() => e.filterSelectionDrawerStatus, (n) => {
9
+ setup(S) {
10
+ const r = w(), e = F(), t = a(!1), o = a(!1), c = a();
11
+ y(() => e.filterSelectionDrawerStatus, (n) => {
12
12
  n && (o.value = !1);
13
13
  });
14
- const c = d(() => ({
14
+ const f = g(() => ({
15
15
  primaryButton: {
16
16
  styling: "solid",
17
17
  type: "primary",
@@ -27,24 +27,25 @@ const R = /* @__PURE__ */ p({
27
27
  disabledStatus: t.value
28
28
  }
29
29
  }));
30
- return { __sfc: !0, trans: r, store: e, isApplying: t, submitted: o, filtersRef: a, footerButtonGroupOptions: c, cancelModal: () => {
30
+ return { __sfc: !0, trans: r, store: e, isApplying: t, submitted: o, filtersRef: c, footerButtonGroupOptions: f, cancelModal: () => {
31
31
  e.cancelFilterDrawer();
32
32
  }, applyFilter: async () => {
33
+ var u;
33
34
  o.value = !0;
34
- const { filters: n } = e.recommendationConfigs, l = n.find((i) => !w(i));
35
- if (l) {
36
- a.value?.switchToGroup(l.filterGroup), await y();
37
- const { filterGroup: i, filterNumber: u } = l, f = `[data-filter-group="${i}"][data-filter-number="${u}"]`;
38
- document.querySelector(f)?.scrollIntoView({ behavior: "smooth", block: "center" });
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" });
39
40
  return;
40
41
  }
41
42
  t.value = !0, e.patchCurrentBlockConfig(
42
43
  { filters: e.recommendationConfigs.filters },
43
44
  { triggerRefetch: !0 }
44
45
  ), e.closeFilterDrawer(), t.value = !1;
45
- }, WpDrawer: g, Filters: F };
46
+ }, WpDrawer: b, Filters: h };
46
47
  }
47
48
  });
48
49
  export {
49
- R as default
50
+ I as default
50
51
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as v, computed as o, ref as O, watch as f } from "vue";
1
+ import { defineComponent as v, computed as l, ref as O, watch as f } from "vue";
2
2
  import { useTranslations as g } from "../../../../composables/useTranslations.js";
3
3
  import { useRecommendationExtensionStore as R } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
4
4
  import { getTooltipOptions as T } from "../../../../utils/tooltipUtils.js";
@@ -12,11 +12,11 @@ const V = /* @__PURE__ */ v({
12
12
  },
13
13
  emits: ["reset-validation"],
14
14
  setup(x, { expose: u, emit: s }) {
15
- const p = g(), t = R(), n = o(() => t.getUniqueFilterGroups.map((e) => ({
15
+ const p = g(), t = R(), a = l(() => t.getUniqueFilterGroups.map((e) => ({
16
16
  text: e.toString(),
17
17
  value: e
18
18
  }))), r = O(1);
19
- f(n, (e) => {
19
+ f(a, (e) => {
20
20
  if (!e.length)
21
21
  return;
22
22
  e.some((h) => h.value === r.value) || (r.value = e[0].value);
@@ -27,24 +27,27 @@ const V = /* @__PURE__ */ v({
27
27
  u({ switchToGroup: i });
28
28
  const c = () => {
29
29
  s("reset-validation");
30
- const e = t.getUniqueFilterGroups, a = e.length > 0 ? Math.max(...e) + 1 : 1;
31
- t.addFilterGroup(a), r.value = a;
32
- }, d = o(() => n.value.length >= 3), l = o(() => t.getSelectedFilterGroup(r.value)), F = o(() => l.value.length >= 10), _ = o(() => l.value.length > 1), G = o(() => n.value.length > 1), m = o(() => l.value[0]?.outerGroupOperator || "*");
33
- return { __sfc: !0, MAX_FILTER_GROUP_COUNT: 3, MAX_FILTER_PER_GROUP_COUNT: 10, trans: p, store: t, emit: s, filterGroupList: n, selectedFilterGroup: r, switchToGroup: i, handleAddFilterGroup: c, isMaxFilterGroupCount: d, selectedFilterGroupFilters: l, isMaxFilterPerGroupCount: F, hasLogicAdapter: _, hasRemoveFilterButton: G, outerGroupOperator: m, handleOuterGroupOperatorChange: (e) => {
34
- l.value.forEach((a) => {
35
- t.updateFilter({ ...a, outerGroupOperator: e });
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 });
36
39
  });
37
40
  }, handleAddFilter: () => {
38
41
  s("reset-validation"), t.addFilter(
39
42
  t.createDefaultFilter(
40
43
  r.value,
41
- l.value.length + 1
44
+ n.value.length + 1
42
45
  )
43
46
  );
44
47
  }, handleDeleteFilter: (e) => {
45
48
  t.deleteFilter(e);
46
49
  }, handleDeleteFilterGroup: () => {
47
- n.value.length <= 1 || t.deleteFilterGroup(r.value);
50
+ a.value.length <= 1 || t.deleteFilterGroup(r.value);
48
51
  }, getTooltipOptions: T, InSegments: E, InButtonV2: U, FilterItem: A, LogicAdapter: C };
49
52
  }
50
53
  });