@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,6 +1,6 @@
1
- import { DEFAULT_CARD_COMPOSITION as L, spacer as E, getDefaultProducts as I, createBlockTemplate as _, DEFAULTS as S, buildElementRenderer as b, DEFAULT_CARD_VISIBILITY as A } from "../utils.js";
2
- import { gridElementRenderer as f, ATTRIBUTE_CELL_CLASS as w, DEFAULT_CELL_PADDING as D } from "./elementRenderer.js";
3
- import { DEFAULT_PRODUCTS_PER_ROW as C } from "../../constants/layout.js";
1
+ import { DEFAULT_PRODUCTS_PER_ROW as L } from "../../constants/layout.js";
2
+ import { getDefaultProducts as E, createBlockTemplate as I, DEFAULTS as _, DEFAULT_CARD_COMPOSITION as S, spacer as b, buildElementRenderer as A, DEFAULT_CARD_VISIBILITY as f } from "../utils.js";
3
+ import { ATTRIBUTE_CELL_CLASS as w, DEFAULT_CELL_PADDING as D, gridElementRenderer as C } from "./elementRenderer.js";
4
4
  const O = `
5
5
  <tr class="recommendation-product-row">
6
6
  <td>
@@ -27,10 +27,10 @@ const O = `
27
27
  {-{-CELLS-}-}
28
28
  </tr>
29
29
  `;
30
- function P(t, e, o, r = L, n = {}) {
31
- const c = (100 / e).toFixed(2), i = e - t.length, l = `<td class="${w}" style="padding: ${D};" width="${c}%"></td>`, d = i > 0 ? l.repeat(i) : "", a = b(o, r, n);
30
+ function P(t, e, o, r = S, n = {}) {
31
+ const c = (100 / e).toFixed(2), i = e - t.length, l = `<td class="${w}" style="padding: ${D};" width="${c}%"></td>`, d = i > 0 ? l.repeat(i) : "", a = A(o, r, n);
32
32
  return r.filter((s) => a[s]).map((s) => {
33
- const T = A[s] ?? !0, u = T ? "" : 'style="display: none;"', R = t.map((m) => a[s](m).replace("<td", `<td width="${c}%"`)).join("");
33
+ const T = f[s] ?? !0, u = T ? "" : 'style="display: none;"', R = t.map((m) => a[s](m).replace("<td", `<td width="${c}%"`)).join("");
34
34
  return g.replace("{-{-ATTR_TYPE-}-}", s).replace("{-{-VISIBILITY-}-}", T ? "1" : "0").replace("{-{-DISPLAY_STYLE-}-}", u).replace("{-{-CELLS-}-}", R + d);
35
35
  }).join("");
36
36
  }
@@ -46,15 +46,15 @@ function U(t, e, o, r, n = {}) {
46
46
  r,
47
47
  n
48
48
  ), p = O.replace("{-{-ATTRIBUTE_ROWS-}-}", a);
49
- return d > 0 ? E + p : p;
49
+ return d > 0 ? b + p : p;
50
50
  }).join("");
51
51
  }
52
52
  function h(t, e, o, r = {}) {
53
- return U(t, e, f, o, r);
53
+ return U(t, e, C, o, r);
54
54
  }
55
55
  function F(t) {
56
- const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = _("grid", e), r = I(), n = h(r, C);
57
- return o.replace("{-{-TITLE-}-}", S.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
56
+ const e = t ? `ins-recommendation-v3-block-${t}` : void 0, o = I("grid", e), r = E(), n = h(r, L);
57
+ return o.replace("{-{-TITLE-}-}", _.TITLE).replace("{-{-PRODUCT_ROWS-}-}", n).replace("{-{-MOBILE_PRODUCT_ROWS-}-}", "");
58
58
  }
59
59
  export {
60
60
  F as getDefaultTemplate,
@@ -1,11 +1,11 @@
1
- import { prepareProductRows as s } from "./grid/template.js";
2
- import { prepareProductRows as c } from "./list/template.js";
3
- import { DEFAULT_PRODUCTS_PER_ROW as R } from "../constants/layout.js";
1
+ import { DEFAULT_PRODUCTS_PER_ROW as s } from "../constants/layout.js";
2
+ import { prepareProductRows as c } from "./grid/template.js";
3
+ import { prepareProductRows as R } from "./list/template.js";
4
4
  function a(o, t, r = {}) {
5
5
  if (t === "list")
6
- return c(o, r.composition, r.filterList);
7
- const { productsPerRow: e = R, composition: p, filterList: i } = r;
8
- return s(o, e, p, i);
6
+ return R(o, r.composition, r.filterList);
7
+ const { productsPerRow: e = s, composition: p, filterList: i } = r;
8
+ return c(o, e, p, i);
9
9
  }
10
10
  export {
11
11
  a as prepareProductRows
@@ -1,10 +1,10 @@
1
- import { useRecommendationExtensionStore as p } from "../../store/recommendation.js";
2
- import { formatPrice as b } from "../../utils/priceFormatter.js";
3
- import { sanitizeImageUrl as u, CUSTOM_CELL_HTML as m } from "../utils.js";
4
- import { ATTR_PRODUCT_ATTR as g, ATTR_PRODUCT_BUTTON as i, ATTR_PRODUCT_IMAGE as c, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_OMNIBUS_PRICE as T, ATTR_PRODUCT_OLD_PRICE as x, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_NAME as R } from "../../constants/selectors.js";
5
1
  import { RecommendationBlockId as o } from "../../constants/blockIds.js";
6
- function l() {
7
- const t = p(), { currencySettings: e } = t.recommendationConfigs;
2
+ import { ATTR_PRODUCT_ATTR as m, ATTR_PRODUCT_BUTTON as c, ATTR_PRODUCT_IMAGE as d, ATTR_PRODUCT_OMNIBUS_DISCOUNT as u, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OLD_PRICE as f, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_NAME as x } from "../../constants/selectors.js";
3
+ import { useRecommendationExtensionStore as _ } from "../../store/recommendation.js";
4
+ import { formatPrice as R } from "../../utils/priceFormatter.js";
5
+ import { sanitizeImageUrl as y, CUSTOM_CELL_HTML as C } from "../utils.js";
6
+ function p() {
7
+ const t = _(), { currencySettings: e } = t.recommendationConfigs;
8
8
  return {
9
9
  code: e.value,
10
10
  symbol: e.symbol,
@@ -15,29 +15,29 @@ function l() {
15
15
  };
16
16
  }
17
17
  function s(t, e = "price") {
18
- const n = l(), r = t[e], a = r?.[n.code] ?? Object.values(r ?? {})[0] ?? 0;
19
- return b({
20
- price: a,
18
+ const n = p(), a = t[e], r = (a == null ? void 0 : a[n.code]) ?? Object.values(a ?? {})[0] ?? 0;
19
+ return R({
20
+ price: r,
21
21
  currency: n
22
22
  });
23
23
  }
24
- const P = {
24
+ const U = {
25
25
  /**
26
26
  * Image cell - left column (120px fixed width)
27
27
  * Has recommendation-attribute-row class and data attributes for Card Composition control
28
28
  */
29
- [c]: (t) => `
29
+ [d]: (t) => `
30
30
  <td
31
31
  width="120"
32
32
  class="esd-block-image product-image-cell recommendation-attribute-row es-p5"
33
33
  esd-extension-block-id="${o.IMAGE}"
34
- data-attribute-type="${c}"
34
+ data-attribute-type="${d}"
35
35
  data-visibility="1"
36
36
  align="center"
37
37
  valign="middle">
38
38
  <a target="_blank" href="${t.url}">
39
39
  <img
40
- src="${u(t.image_url)}"
40
+ src="${y(t.image_url)}"
41
41
  alt="${t.name}"
42
42
  style="display: block; max-width: 100%; height: auto;"
43
43
  class="adapt-img product-image">
@@ -47,7 +47,7 @@ const P = {
47
47
  /**
48
48
  * Name element - row for info cell table
49
49
  */
50
- [R]: (t) => `
50
+ [x]: (t) => `
51
51
  <tr>
52
52
  <td
53
53
  class="esd-block-text product-name"
@@ -62,7 +62,7 @@ const P = {
62
62
  /**
63
63
  * Price element - row for info cell table
64
64
  */
65
- [_]: (t) => `
65
+ [T]: (t) => `
66
66
  <tr>
67
67
  <td
68
68
  class="esd-block-text product-price"
@@ -77,7 +77,7 @@ const P = {
77
77
  /**
78
78
  * Old price element - row for info cell table
79
79
  */
80
- [x]: (t) => `
80
+ [f]: (t) => `
81
81
  <tr>
82
82
  <td
83
83
  class="esd-block-text product-old-price"
@@ -94,7 +94,7 @@ const P = {
94
94
  /**
95
95
  * Omnibus price element - row for info cell table
96
96
  */
97
- [T]: (t) => `
97
+ [g]: (t) => `
98
98
  <tr>
99
99
  <td
100
100
  class="esd-block-text product-omnibus-price"
@@ -113,8 +113,9 @@ const P = {
113
113
  /**
114
114
  * Omnibus discount element - row for info cell table
115
115
  */
116
- [f]: (t) => {
117
- const e = l(), n = t.original_price?.[e.code] ?? Object.values(t.original_price ?? {})[0] ?? 0, r = t.price?.[e.code] ?? Object.values(t.price ?? {})[0] ?? 0, a = n > 0 ? Math.round((n - r) / n * 100) : 0, d = a > 0 ? `-${a}%` : "0%";
116
+ [u]: (t) => {
117
+ var i, l;
118
+ const e = p(), n = ((i = t.original_price) == null ? void 0 : i[e.code]) ?? Object.values(t.original_price ?? {})[0] ?? 0, a = ((l = t.price) == null ? void 0 : l[e.code]) ?? Object.values(t.price ?? {})[0] ?? 0, r = n > 0 ? Math.round((n - a) / n * 100) : 0, b = r > 0 ? `-${r}%` : "0%";
118
119
  return `
119
120
  <tr>
120
121
  <td
@@ -125,7 +126,7 @@ const P = {
125
126
  align="left">
126
127
  <p contenteditable="false" style="font-size: 12px; color: #666666; margin: 0;">
127
128
  <span class="omnibus-text-before"></span>
128
- <span class="omnibus-discount-value">${d}</span>
129
+ <span class="omnibus-discount-value">${b}</span>
129
130
  <span class="omnibus-text-after"></span>
130
131
  </p>
131
132
  </td>
@@ -136,12 +137,12 @@ const P = {
136
137
  * Button cell - right column (100px fixed width)
137
138
  * Has recommendation-attribute-row class and data attributes for Card Composition control
138
139
  */
139
- [i]: (t) => `
140
+ [c]: (t) => `
140
141
  <td
141
142
  width="100"
142
143
  class="esd-block-button button-cell recommendation-attribute-row product-button es-p5l es-p5r"
143
144
  esd-extension-block-id="${o.BUTTON}"
144
- data-attribute-type="${i}"
145
+ data-attribute-type="${c}"
145
146
  data-visibility="1"
146
147
  align="center"
147
148
  valign="middle">
@@ -156,7 +157,17 @@ const P = {
156
157
  href="${t.url}"
157
158
  target="_blank"
158
159
  class="es-button buy-button"
159
- style="color: rgb(56, 118, 29); background: rgb(217, 234, 211); padding: 5px 30px;">
160
+ style="
161
+ color: rgb(56, 118, 29);
162
+ background: rgb(217, 234, 211);
163
+ font-family: arial, 'helvetica neue', helvetica, sans-serif;
164
+ font-size: 16px;
165
+ font-weight: normal;
166
+ line-height: 120%;
167
+ padding: 5px 30px;
168
+ mso-border-alt: 10px solid rgb(217, 234, 211);
169
+ mso-padding-alt: 0;
170
+ ">
160
171
  Buy
161
172
  </a>
162
173
  </span>
@@ -168,10 +179,10 @@ const P = {
168
179
  * @param productAttrValue - Resolved product-attr value (e.g., "brand" for default, "product_attribute.rating_star" for custom)
169
180
  * @param content - Display content for the cell
170
181
  */
171
- [m]: (t, e) => `
182
+ [C]: (t, e) => `
172
183
  <tr>
173
184
  <td
174
- ${g}="${t}"
185
+ ${m}="${t}"
175
186
  class="esd-block-text product-custom-attribute"
176
187
  esd-extension-block-id="${o.CUSTOM_ATTRIBUTE}"
177
188
  align="left">
@@ -181,5 +192,5 @@ const P = {
181
192
  `
182
193
  };
183
194
  export {
184
- P as listElementRenderer
195
+ U as listElementRenderer
185
196
  };
@@ -1,6 +1,6 @@
1
+ import { ATTR_PRODUCT_IMAGE as a, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
1
2
  import { DEFAULT_CARD_COMPOSITION as b, spacer as m, buildElementRenderer as C, DEFAULT_CARD_VISIBILITY as T } from "../utils.js";
2
3
  import { listElementRenderer as f } from "./elementRenderer.js";
3
- import { ATTR_PRODUCT_IMAGE as a, ATTR_PRODUCT_BUTTON as d } from "../../constants/selectors.js";
4
4
  function R(r, n, l) {
5
5
  const t = l ? "" : ' style="display: none;"', o = r.replace(/<tr>/, "").replace(/<\/tr>/, "");
6
6
  return `<tr
@@ -1,58 +1,60 @@
1
- import { ATTR_PRODUCT_IMAGE as u, ATTR_PRODUCT_NAME as m, ATTR_PRODUCT_OLD_PRICE as b, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as _, ATTR_PRODUCT_OMNIBUS_DISCOUNT as g, ATTR_PRODUCT_BUTTON as C, ATTR_CUSTOM_PREFIX as p } from "../constants/selectors.js";
2
- function O(t) {
1
+ import { ATTR_CUSTOM_PREFIX as u, ATTR_PRODUCT_IMAGE as m, ATTR_PRODUCT_NAME as b, ATTR_PRODUCT_OLD_PRICE as T, ATTR_PRODUCT_PRICE as _, ATTR_PRODUCT_OMNIBUS_PRICE as g, ATTR_PRODUCT_OMNIBUS_DISCOUNT as C, ATTR_PRODUCT_BUTTON as f } from "../constants/selectors.js";
2
+ function U(t) {
3
3
  return t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
4
4
  }
5
- function f(t, e) {
6
- return Object.values(e).find((r) => r.attributeName === t)?.type === "defaultAttribute";
5
+ function R(t, e) {
6
+ const n = Object.values(e).find((r) => r.attributeName === t);
7
+ return (n == null ? void 0 : n.type) === "defaultAttribute";
7
8
  }
8
- function U(t, e) {
9
- return f(t, e) ? t : `product_attribute.${t}`;
9
+ function y(t, e) {
10
+ return R(t, e) ? t : `product_attribute.${t}`;
10
11
  }
11
- const y = Symbol("customCellHtml");
12
- function E(t, e, n = {}) {
13
- const r = t[y];
12
+ const P = Symbol("customCellHtml");
13
+ function S(t, e, n = {}) {
14
+ const r = t[P];
14
15
  if (!r)
15
16
  return { ...t };
16
17
  const l = { ...t };
17
- return e.filter((o) => o.startsWith(p) && !l[o]).forEach((o) => {
18
- const s = o.substring(p.length), a = O(s), A = U(s, n), D = f(s, n);
18
+ return e.filter((o) => o.startsWith(u) && !l[o]).forEach((o) => {
19
+ const s = o.substring(u.length), a = U(s), D = y(s, n), O = R(s, n);
19
20
  l[o] = (d) => {
20
- const i = D ? d[s] : d.product_attributes?.[s];
21
+ var p;
22
+ const i = O ? d[s] : (p = d.product_attributes) == null ? void 0 : p[s];
21
23
  let c = a;
22
- return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(A, c);
24
+ return typeof i == "string" ? c = i : typeof i == "number" && (c = String(i)), r(D, c);
23
25
  };
24
26
  }), l;
25
27
  }
26
- const S = {
28
+ const L = {
27
29
  TITLE: "You May Also Like!"
28
- }, L = [
29
- u,
30
+ }, M = [
30
31
  m,
31
32
  b,
32
33
  T,
33
34
  _,
34
35
  g,
35
- C
36
- ], M = {
37
- [u]: !0,
36
+ C,
37
+ f
38
+ ], $ = {
38
39
  [m]: !0,
39
- [T]: !0,
40
40
  [b]: !0,
41
- [_]: !1,
41
+ [_]: !0,
42
+ [T]: !0,
42
43
  [g]: !1,
43
- [C]: !0
44
- }, P = `
44
+ [C]: !1,
45
+ [f]: !0
46
+ }, h = `
45
47
  <tr>
46
48
  <td class="spacer" style="height: 10px;"></td>
47
49
  </tr>
48
- `, R = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
49
- function $(t) {
50
- return !t || typeof t != "string" || t.trim() === "" ? R : t.startsWith("http://") ? t.replace("http://", "https://") : t;
50
+ `, A = "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png";
51
+ function w(t) {
52
+ return !t || typeof t != "string" || t.trim() === "" ? A : t.startsWith("http://") ? t.replace("http://", "https://") : t;
51
53
  }
52
- function h(t) {
54
+ function I(t) {
53
55
  return {
54
56
  name: "Product Name",
55
- image_url: R,
57
+ image_url: A,
56
58
  price: { USD: 18 },
57
59
  original_price: { USD: 20 },
58
60
  discount: { USD: 2 },
@@ -64,13 +66,13 @@ function h(t) {
64
66
  category: []
65
67
  };
66
68
  }
67
- function w(t = 6) {
69
+ function N(t = 6) {
68
70
  return Array.from(
69
71
  { length: t },
70
- (e, n) => h(String(n + 1))
72
+ (e, n) => I(String(n + 1))
71
73
  );
72
74
  }
73
- function N(t = "grid", e) {
75
+ function k(t = "grid", e) {
74
76
  const n = t === "list" ? `
75
77
  data-layout="list"` : "", r = e ? ` ${e}` : "";
76
78
  return `
@@ -108,7 +110,7 @@ function N(t = "grid", e) {
108
110
  </table>
109
111
  </td>
110
112
  </tr>
111
- ${P}
113
+ ${h}
112
114
  <tr>
113
115
  <td>
114
116
  <table
@@ -147,17 +149,17 @@ function N(t = "grid", e) {
147
149
  `;
148
150
  }
149
151
  export {
150
- y as CUSTOM_CELL_HTML,
151
- S as DEFAULTS,
152
- L as DEFAULT_CARD_COMPOSITION,
153
- M as DEFAULT_CARD_VISIBILITY,
154
- R as PLACEHOLDER_IMAGE,
155
- E as buildElementRenderer,
156
- N as createBlockTemplate,
157
- w as getDefaultProducts,
158
- f as isDefaultAttribute,
159
- U as resolveProductAttrValue,
160
- $ as sanitizeImageUrl,
161
- P as spacer,
162
- O as toDisplayName
152
+ P as CUSTOM_CELL_HTML,
153
+ L as DEFAULTS,
154
+ M as DEFAULT_CARD_COMPOSITION,
155
+ $ as DEFAULT_CARD_VISIBILITY,
156
+ A as PLACEHOLDER_IMAGE,
157
+ S as buildElementRenderer,
158
+ k as createBlockTemplate,
159
+ N as getDefaultProducts,
160
+ R as isDefaultAttribute,
161
+ y as resolveProductAttrValue,
162
+ w as sanitizeImageUrl,
163
+ h as spacer,
164
+ U as toDisplayName
163
165
  };
@@ -0,0 +1,21 @@
1
+ function r(e) {
2
+ if (!e)
3
+ return e;
4
+ switch (e) {
5
+ case "viewedTogether":
6
+ return "similarViewed";
7
+ case "purchasedTogether":
8
+ return "similarBought";
9
+ case "trending":
10
+ return "trendingProducts";
11
+ case "mostValuable":
12
+ return "mostValuableOfPartner";
13
+ case "topSellers":
14
+ return "mostPurchased";
15
+ default:
16
+ return e;
17
+ }
18
+ }
19
+ export {
20
+ r as mapLegacyStrategy
21
+ };
@@ -1,36 +1,27 @@
1
- function m(t) {
2
- const e = {
3
- "&": "&amp;",
4
- "<": "&lt;",
5
- ">": "&gt;",
6
- '"': "&quot;",
7
- "'": "&#39;"
8
- };
9
- return t.replace(/[&<>"']/g, (n) => e[n]);
10
- }
11
- function p(t) {
1
+ import { escapeHtml as m } from "../../../../utils/htmlEscape.js";
2
+ function T(t) {
12
3
  return "getInnerHTML" in t && typeof t.getInnerHTML == "function" ? t.getInnerHTML().trim() : "innerHTML" in t ? t.innerHTML : "";
13
4
  }
14
- function T(t, e) {
15
- const n = m(e);
5
+ function H(t, f) {
6
+ const n = m(f);
16
7
  if (!t)
17
8
  return n;
18
- const r = p(t);
9
+ const r = T(t);
19
10
  if (!r || r.trim() === "" || !/<(strong|em|u|s|b|i)\b/i.test(r))
20
11
  return n;
21
- const i = [], o = [];
22
- let c = r.trim();
12
+ const e = [], s = [];
13
+ let o = r.trim();
23
14
  for (; ; ) {
24
- const u = c.match(/^<(strong|em|u|s|b|i)(\s[^>]*)?>(.*)$/is);
15
+ const u = o.match(/^<(strong|em|u|s|b|i)(\s[^>]*)?>(.*)$/is);
25
16
  if (!u)
26
17
  break;
27
- const [, s, f = "", g] = u, a = new RegExp(`</${s}>$`, "i");
28
- if (!a.test(g))
18
+ const [, i, a = "", c] = u, g = new RegExp(`</${i}>$`, "i");
19
+ if (!g.test(c))
29
20
  break;
30
- i.push(`<${s}${f}>`), o.unshift(`</${s}>`), c = g.replace(a, "").trim();
21
+ e.push(`<${i}${a}>`), s.unshift(`</${i}>`), o = c.replace(g, "").trim();
31
22
  }
32
- return i.length > 0 ? i.join("") + n + o.join("") : n;
23
+ return e.length > 0 ? e.join("") + n + s.join("") : n;
33
24
  }
34
25
  export {
35
- T as preserveTextStyles
26
+ H as preserveTextStyles
36
27
  };
@@ -1,26 +1,29 @@
1
- import { safeParse as i, object as a, boolean as p, number as n, pipe as l, minLength as c, string as f } from "../../../../node_modules/valibot/dist/index.js";
2
- const e = l(f(), c(1)), o = a({
1
+ import { safeParse as o, object as p, boolean as l, number as i, pipe as c, minLength as f, string as m } from "../../../../node_modules/valibot/dist/index.js";
2
+ const e = c(m(), f(1)), s = p({
3
3
  type: e,
4
4
  attribute: e,
5
5
  operator: e,
6
6
  innerGroupOperator: e,
7
7
  outerGroupOperator: e,
8
8
  value: e,
9
- filterGroup: n(),
10
- filterNumber: n(),
11
- isValid: p()
9
+ filterGroup: i(),
10
+ filterNumber: i(),
11
+ isValid: l()
12
12
  });
13
- function b(t) {
14
- return i(o, t).success;
15
- }
16
13
  function g(t) {
17
- const r = i(o, t);
14
+ return o(s, t).success;
15
+ }
16
+ function S(t) {
17
+ const r = o(s, t);
18
18
  return r.success ? /* @__PURE__ */ new Set() : new Set(
19
- r.issues.flatMap((s) => s.path?.map((u) => String(u.key)) ?? [])
19
+ r.issues.flatMap((u) => {
20
+ var n;
21
+ return ((n = u.path) == null ? void 0 : n.map((a) => String(a.key))) ?? [];
22
+ })
20
23
  );
21
24
  }
22
25
  export {
23
- o as FilterSchema,
24
- g as getInvalidFilterFields,
25
- b as isFilterValid
26
+ s as FilterSchema,
27
+ S as getInvalidFilterFields,
28
+ g as isFilterValid
26
29
  };
@@ -47,7 +47,8 @@ class B extends T {
47
47
  }), this.valueChangeHandlers = [], this.currentNode = void 0, this.currentPages = void 0, this.currentPreviewIndex = 0, this.lastParsedAttribute = void 0;
48
48
  }
49
49
  get totalTemplates() {
50
- return this.currentPages?.length ?? 0;
50
+ var e;
51
+ return ((e = this.currentPages) == null ? void 0 : e.length) ?? 0;
51
52
  }
52
53
  _listenToFormUpdates() {
53
54
  this.valueChangeHandlers.push(
@@ -76,23 +77,24 @@ class B extends T {
76
77
  await l().fetchTemplates(), this._updatePreview(), this._updateCounter();
77
78
  }
78
79
  _updatePreview() {
79
- if (this.currentPages?.length)
80
+ var e;
81
+ if ((e = this.currentPages) != null && e.length)
80
82
  try {
81
- const e = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(e);
83
+ const t = this.currentPages[this.currentPreviewIndex], o = l().getThumbnailByTemplateId(t);
82
84
  if (!o) {
83
- console.warn("[UnsubscribeControl] No thumbnail found for page:", e);
85
+ console.warn("[UnsubscribeControl] No thumbnail found for page:", t);
84
86
  return;
85
87
  }
86
88
  this.api.updateValues({
87
89
  [r.PREVIEW_IMAGE]: o
88
90
  });
89
- } catch (e) {
90
- console.error("[UnsubscribeControl] Failed to update preview:", e);
91
+ } catch (t) {
92
+ console.error("[UnsubscribeControl] Failed to update preview:", t);
91
93
  }
92
94
  }
93
95
  _updateCounter() {
94
- const e = this.currentPreviewIndex + 1, t = this.totalTemplates, o = this.currentPreviewIndex === 0, c = this.currentPreviewIndex >= t - 1;
95
- this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(
96
+ const e = this.currentPreviewIndex + 1, t = this.totalTemplates, c = this.currentPreviewIndex === 0, o = this.currentPreviewIndex >= t - 1;
97
+ this.api.setUIEAttribute(r.PREV_BUTTON, i.BUTTON.disabled, c), this.api.setUIEAttribute(r.NEXT_BUTTON, i.BUTTON.disabled, o), this.api.setUIEAttribute(
96
98
  r.COUNTER_TEXT,
97
99
  i.LABEL.text,
98
100
  `${this.api.translate("Showing")} ${e} ${this.api.translate("of")} ${t}`
@@ -133,14 +135,14 @@ class B extends T {
133
135
  </${n.LABEL}>
134
136
  `;
135
137
  }
136
- _getIconButton(e, t, o) {
137
- const c = o ? `${i.BUTTON.disabled}="true"` : "";
138
+ _getIconButton(e, t, c) {
139
+ const o = c ? `${i.BUTTON.disabled}="true"` : "";
138
140
  return `
139
141
  <${n.BUTTON}
140
142
  id="${e}"
141
143
  class="flat-inline flat-white"
142
144
  ${i.BUTTON.name}="${e}"
143
- ${c}
145
+ ${o}
144
146
  >
145
147
  <${n.ICON}
146
148
  src="${t}"
@@ -1,15 +1,15 @@
1
- var r = Object.defineProperty;
2
- var n = (s, e, i) => e in s ? r(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i;
3
- var t = (s, e, i) => n(s, typeof e != "symbol" ? e + "" : e, i);
4
- import { UIElement as m } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- const l = "unsubscribe-preview", E = "img", c = "Unsubscribe page preview", a = "is-loaded";
6
- class u extends m {
1
+ var n = Object.defineProperty;
2
+ var m = (s, i, e) => i in s ? n(s, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[i] = e;
3
+ var r = (s, i, e) => m(s, typeof i != "symbol" ? i + "" : i, e);
4
+ import { UIElement as l } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ const E = "unsubscribe-preview", c = "img", a = "Unsubscribe page preview", g = "is-loaded";
6
+ class d extends l {
7
7
  constructor() {
8
8
  super(...arguments);
9
- t(this, "imgElement");
9
+ r(this, "imgElement");
10
10
  }
11
11
  getId() {
12
- return l;
12
+ return E;
13
13
  }
14
14
  getTemplate() {
15
15
  return `
@@ -17,26 +17,28 @@ class u extends m {
17
17
  <div class="unsubscribe-preview-loader"></div>
18
18
  <img
19
19
  src=""
20
- alt="${c}"
20
+ alt="${a}"
21
21
  class="unsubscribe-preview-image"
22
22
  />
23
23
  </div>
24
24
  `;
25
25
  }
26
- onRender(i) {
27
- this.imgElement = i.querySelector(E);
26
+ onRender(e) {
27
+ this.imgElement = e.querySelector(c);
28
28
  }
29
- setValue(i) {
30
- this.imgElement && (this.imgElement.src = i, this.imgElement.parentElement?.classList.add(a));
29
+ setValue(e) {
30
+ var t;
31
+ this.imgElement && (this.imgElement.src = e, (t = this.imgElement.parentElement) == null || t.classList.add(g));
31
32
  }
32
33
  getValue() {
33
- return this.imgElement?.src ?? "";
34
+ var e;
35
+ return ((e = this.imgElement) == null ? void 0 : e.src) ?? "";
34
36
  }
35
37
  onDestroy() {
36
38
  this.imgElement = void 0;
37
39
  }
38
40
  }
39
41
  export {
40
- l as PREVIEW_UI_ELEMENT_ID,
41
- u as PreviewUIElement
42
+ E as PREVIEW_UI_ELEMENT_ID,
43
+ d as PreviewUIElement
42
44
  };