@useinsider/guido 1.0.3-beta.1cd6abc → 1.0.3-beta.1d07a49

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 (308) hide show
  1. package/README.md +22 -7
  2. package/dist/components/Guido.vue.js +11 -9
  3. package/dist/components/Guido.vue2.js +76 -70
  4. package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue2.js +15 -15
  6. package/dist/components/organisms/header/RightSlot.vue.js +10 -10
  7. package/dist/components/organisms/header/RightSlot.vue2.js +18 -18
  8. package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +21 -0
  9. package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +99 -0
  10. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  11. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -17
  12. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
  13. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +23 -20
  14. package/dist/composables/useActionsApi.js +33 -24
  15. package/dist/composables/useBlocksConfig.js +21 -31
  16. package/dist/composables/useGuidoActions.js +19 -9
  17. package/dist/composables/useHtmlCompiler.js +15 -13
  18. package/dist/composables/useHtmlValidator.js +36 -35
  19. package/dist/composables/usePartner.js +10 -11
  20. package/dist/composables/useSave.js +11 -10
  21. package/dist/composables/useStripo.js +63 -55
  22. package/dist/composables/useTimerClone.js +75 -0
  23. package/dist/config/compiler/itemsCompilerRules.js +14 -0
  24. package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
  25. package/dist/config/migrator/index.js +7 -6
  26. package/dist/config/migrator/recommendationMigrator.js +293 -0
  27. package/dist/enums/date.js +6 -0
  28. package/dist/enums/defaults.js +6 -4
  29. package/dist/enums/extensions/recommendationBlock.js +2 -2
  30. package/dist/enums/onboarding.js +7 -2
  31. package/dist/enums/unsubscribe.js +27 -25
  32. package/dist/extensions/Blocks/Checkbox/block.js +5 -2
  33. package/dist/extensions/Blocks/Checkbox/control.js +15 -14
  34. package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
  35. package/dist/extensions/Blocks/Checkbox/template.js +14 -9
  36. package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
  37. package/dist/extensions/Blocks/Items/block.js +67 -0
  38. package/dist/extensions/Blocks/Items/controls/button/link.js +68 -0
  39. package/dist/extensions/Blocks/Items/controls/cardComposition.js +193 -0
  40. package/dist/extensions/Blocks/Items/controls/image/link.js +68 -0
  41. package/dist/extensions/Blocks/Items/controls/index.js +217 -0
  42. package/dist/extensions/Blocks/Items/controls/name/trimming.js +70 -0
  43. package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +107 -0
  44. package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +123 -0
  45. package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +76 -0
  46. package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +61 -0
  47. package/dist/extensions/Blocks/Items/controls/settingsControl.js +312 -0
  48. package/dist/extensions/Blocks/Items/enums/controlEnums.js +5 -0
  49. package/dist/extensions/Blocks/Items/enums/productEnums.js +273 -0
  50. package/dist/extensions/Blocks/Items/enums/settingsEnums.js +76 -0
  51. package/dist/extensions/Blocks/Items/extension.js +19 -0
  52. package/dist/extensions/Blocks/Items/iconsRegistry.js +32 -0
  53. package/dist/extensions/Blocks/Items/items.css.js +23 -0
  54. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +62 -0
  55. package/dist/extensions/Blocks/Items/layouts/vertical.html.js +60 -0
  56. package/dist/extensions/Blocks/Items/settingsPanel.js +131 -0
  57. package/dist/extensions/Blocks/Items/store/items-block.js +71 -0
  58. package/dist/extensions/Blocks/Items/template.js +189 -0
  59. package/dist/extensions/Blocks/Items/utils/configBlockUtils.js +17 -0
  60. package/dist/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.js +28 -0
  61. package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +67 -0
  62. package/dist/extensions/Blocks/Items/utils/updateAttributes.js +44 -0
  63. package/dist/extensions/Blocks/RadioButton/block.js +5 -2
  64. package/dist/extensions/Blocks/RadioButton/control.js +18 -17
  65. package/dist/extensions/Blocks/RadioButton/template.js +18 -9
  66. package/dist/extensions/Blocks/Recommendation/block.js +6 -3
  67. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +103 -0
  68. package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
  69. package/dist/extensions/Blocks/Recommendation/control.js +69 -40
  70. package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
  71. package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
  72. package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
  73. package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
  74. package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
  75. package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
  76. package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
  77. package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
  78. package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
  79. package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
  80. package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
  81. package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
  82. package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
  83. package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
  84. package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
  85. package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
  86. package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
  87. package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
  88. package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
  89. package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
  90. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
  91. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
  92. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
  93. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
  94. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
  95. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
  96. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
  97. package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
  98. package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
  99. package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
  100. package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
  101. package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
  102. package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
  103. package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
  104. package/dist/extensions/Blocks/Recommendation/extension.js +42 -7
  105. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +43 -43
  106. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +107 -22
  107. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
  108. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
  109. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
  110. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
  111. package/dist/extensions/Blocks/Unsubscribe/block.js +27 -27
  112. package/dist/extensions/Blocks/common-control.js +201 -55
  113. package/dist/extensions/Blocks/controlFactories.js +223 -0
  114. package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
  115. package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
  116. package/dist/guido.css +1 -1
  117. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +353 -101
  118. package/dist/node_modules/lodash-es/_DataView.js +6 -0
  119. package/dist/node_modules/lodash-es/_Promise.js +6 -0
  120. package/dist/node_modules/lodash-es/_Set.js +6 -0
  121. package/dist/node_modules/lodash-es/_SetCache.js +13 -0
  122. package/dist/node_modules/lodash-es/_WeakMap.js +6 -0
  123. package/dist/node_modules/lodash-es/_arrayFilter.js +10 -0
  124. package/dist/node_modules/lodash-es/_arrayLikeKeys.js +13 -12
  125. package/dist/node_modules/lodash-es/_arrayMap.js +8 -0
  126. package/dist/node_modules/lodash-es/_arrayPush.js +8 -0
  127. package/dist/node_modules/lodash-es/_arraySome.js +9 -0
  128. package/dist/node_modules/lodash-es/_baseEach.js +6 -0
  129. package/dist/node_modules/lodash-es/_baseFlatten.js +13 -0
  130. package/dist/node_modules/lodash-es/_baseForOwn.js +8 -0
  131. package/dist/node_modules/lodash-es/_baseGet.js +11 -0
  132. package/dist/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  133. package/dist/node_modules/lodash-es/_baseHasIn.js +6 -0
  134. package/dist/node_modules/lodash-es/_baseIsEqual.js +8 -0
  135. package/dist/node_modules/lodash-es/_baseIsEqualDeep.js +32 -0
  136. package/dist/node_modules/lodash-es/_baseIsMatch.js +29 -0
  137. package/dist/node_modules/lodash-es/_baseIteratee.js +11 -0
  138. package/dist/node_modules/lodash-es/_baseKeys.js +14 -0
  139. package/dist/node_modules/lodash-es/_baseMap.js +11 -0
  140. package/dist/node_modules/lodash-es/_baseMatches.js +12 -0
  141. package/dist/node_modules/lodash-es/_baseMatchesProperty.js +17 -0
  142. package/dist/node_modules/lodash-es/_baseProperty.js +8 -0
  143. package/dist/node_modules/lodash-es/_basePropertyDeep.js +9 -0
  144. package/dist/node_modules/lodash-es/_baseRange.js +9 -0
  145. package/dist/node_modules/lodash-es/_baseToString.js +18 -0
  146. package/dist/node_modules/lodash-es/_baseTrim.js +8 -0
  147. package/dist/node_modules/lodash-es/_cacheHas.js +6 -0
  148. package/dist/node_modules/lodash-es/_castPath.js +10 -0
  149. package/dist/node_modules/lodash-es/_createBaseEach.js +15 -0
  150. package/dist/node_modules/lodash-es/_createRange.js +11 -0
  151. package/dist/node_modules/lodash-es/_equalArrays.js +40 -0
  152. package/dist/node_modules/lodash-es/_equalByTag.js +45 -0
  153. package/dist/node_modules/lodash-es/_equalObjects.js +36 -0
  154. package/dist/node_modules/lodash-es/_getAllKeys.js +9 -0
  155. package/dist/node_modules/lodash-es/_getMatchData.js +12 -0
  156. package/dist/node_modules/lodash-es/_getSymbols.js +10 -0
  157. package/dist/node_modules/lodash-es/_getTag.js +28 -0
  158. package/dist/node_modules/lodash-es/_hasPath.js +19 -0
  159. package/dist/node_modules/lodash-es/_isFlattenable.js +10 -0
  160. package/dist/node_modules/lodash-es/_isKey.js +12 -0
  161. package/dist/node_modules/lodash-es/_isStrictComparable.js +7 -0
  162. package/dist/node_modules/lodash-es/_mapToArray.js +9 -0
  163. package/dist/node_modules/lodash-es/_matchesStrictComparable.js +8 -0
  164. package/dist/node_modules/lodash-es/_memoizeCapped.js +11 -0
  165. package/dist/node_modules/lodash-es/_nativeKeys.js +5 -0
  166. package/dist/node_modules/lodash-es/_setCacheAdd.js +7 -0
  167. package/dist/node_modules/lodash-es/_setCacheHas.js +6 -0
  168. package/dist/node_modules/lodash-es/_setToArray.js +9 -0
  169. package/dist/node_modules/lodash-es/_stringToPath.js +10 -0
  170. package/dist/node_modules/lodash-es/_toKey.js +10 -0
  171. package/dist/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  172. package/dist/node_modules/lodash-es/flatMap.js +8 -0
  173. package/dist/node_modules/lodash-es/get.js +8 -0
  174. package/dist/node_modules/lodash-es/hasIn.js +8 -0
  175. package/dist/node_modules/lodash-es/isSymbol.js +9 -0
  176. package/dist/node_modules/lodash-es/keys.js +9 -0
  177. package/dist/node_modules/lodash-es/keysIn.js +3 -3
  178. package/dist/node_modules/lodash-es/map.js +11 -0
  179. package/dist/node_modules/lodash-es/property.js +10 -0
  180. package/dist/node_modules/lodash-es/range.js +5 -0
  181. package/dist/node_modules/lodash-es/stubArray.js +6 -0
  182. package/dist/node_modules/lodash-es/toFinite.js +14 -0
  183. package/dist/node_modules/lodash-es/toNumber.js +22 -0
  184. package/dist/node_modules/lodash-es/toString.js +7 -0
  185. package/dist/package.json.js +1 -1
  186. package/dist/services/recommendationApi.js +13 -19
  187. package/dist/services/stripoApi.js +1 -1
  188. package/dist/src/@types/generic.d.ts +35 -6
  189. package/dist/src/components/Guido.vue.d.ts +4 -2
  190. package/dist/src/components/organisms/onboarding/ItemsOnboarding.vue.d.ts +2 -0
  191. package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +3 -1
  192. package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +3 -1
  193. package/dist/src/composables/useActionsApi.d.ts +1 -0
  194. package/dist/src/composables/useBlocksConfig.d.ts +2 -2
  195. package/dist/src/composables/useGuidoActions.d.ts +9 -0
  196. package/dist/src/composables/usePartner.d.ts +0 -1
  197. package/dist/src/composables/useTimerClone.d.ts +6 -0
  198. package/dist/src/config/compiler/itemsCompilerRules.d.ts +2 -0
  199. package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -0
  200. package/dist/src/enums/date.d.ts +4 -0
  201. package/dist/src/enums/defaults.d.ts +1 -1
  202. package/dist/src/enums/onboarding.d.ts +5 -0
  203. package/dist/src/extensions/Blocks/Checkbox/block.d.ts +1 -0
  204. package/dist/src/extensions/Blocks/Checkbox/template.d.ts +1 -1
  205. package/dist/src/extensions/Blocks/Items/block.d.ts +27 -0
  206. package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +14 -0
  207. package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +33 -0
  208. package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +14 -0
  209. package/dist/src/extensions/Blocks/Items/controls/index.d.ts +501 -0
  210. package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +14 -0
  211. package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +19 -0
  212. package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +21 -0
  213. package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +14 -0
  214. package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +13 -0
  215. package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +48 -0
  216. package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +61 -0
  217. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +162 -0
  218. package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +49 -0
  219. package/dist/src/extensions/Blocks/Items/extension.d.ts +2 -0
  220. package/dist/src/extensions/Blocks/Items/iconsRegistry.d.ts +4 -0
  221. package/dist/src/extensions/Blocks/Items/settingsPanel.d.ts +4 -0
  222. package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +41 -0
  223. package/dist/src/extensions/Blocks/Items/template.d.ts +24 -0
  224. package/dist/src/extensions/Blocks/Items/utils/configBlockUtils.d.ts +23 -0
  225. package/dist/src/extensions/Blocks/Items/utils/syncAttributeFromConfigBlock.d.ts +32 -0
  226. package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +44 -0
  227. package/dist/src/extensions/Blocks/Items/utils/updateAttributes.d.ts +8 -0
  228. package/dist/src/extensions/Blocks/RadioButton/block.d.ts +1 -0
  229. package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
  230. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
  231. package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +28 -0
  232. package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -0
  233. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +6 -0
  234. package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
  235. package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
  236. package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
  237. package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
  238. package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
  239. package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
  240. package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
  241. package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
  242. package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
  243. package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
  244. package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
  245. package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
  246. package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
  247. package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
  248. package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
  249. package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
  250. package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
  251. package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
  252. package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
  253. package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
  254. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
  255. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
  256. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
  257. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
  258. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
  259. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
  260. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
  261. package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
  262. package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
  263. package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
  264. package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
  265. package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
  266. package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
  267. package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
  268. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
  269. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
  270. package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +16 -0
  271. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
  272. package/dist/src/extensions/Blocks/common-control.d.ts +65 -7
  273. package/dist/src/extensions/Blocks/controlFactories.d.ts +312 -0
  274. package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
  275. package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
  276. package/dist/src/stores/config.d.ts +6 -2
  277. package/dist/src/stores/dynamic-content.d.ts +3 -3
  278. package/dist/src/stores/editor.d.ts +1 -1
  279. package/dist/src/stores/onboarding.d.ts +335 -1
  280. package/dist/src/stores/preview.d.ts +1 -1
  281. package/dist/src/stores/recommendation.d.ts +1 -1
  282. package/dist/src/stores/save-as-template.d.ts +1 -1
  283. package/dist/src/stores/toaster.d.ts +1 -1
  284. package/dist/src/stores/unsubscribe.d.ts +1 -1
  285. package/dist/src/stores/version-history.d.ts +1 -1
  286. package/dist/src/utils/dateUtil.d.ts +21 -0
  287. package/dist/src/utils/environmentUtil.d.ts +5 -0
  288. package/dist/src/utils/genericUtil.d.ts +1 -0
  289. package/dist/src/utils/pairProductVariables.d.ts +7 -0
  290. package/dist/static/styles/components/narrow-panel.css.js +10 -0
  291. package/dist/static/styles/customEditorStyle.css.js +5 -0
  292. package/dist/stores/config.js +5 -5
  293. package/dist/stores/dynamic-content.js +2 -2
  294. package/dist/stores/editor.js +1 -1
  295. package/dist/stores/onboarding.js +44 -36
  296. package/dist/stores/preview.js +1 -1
  297. package/dist/stores/recommendation.js +3 -3
  298. package/dist/stores/save-as-template.js +2 -2
  299. package/dist/stores/toaster.js +1 -1
  300. package/dist/stores/unsubscribe.js +1 -1
  301. package/dist/stores/version-history.js +4 -4
  302. package/dist/utils/dateUtil.js +24 -3
  303. package/dist/utils/environmentUtil.js +4 -0
  304. package/dist/utils/genericUtil.js +18 -8
  305. package/dist/utils/pairProductVariables.js +136 -0
  306. package/package.json +4 -4
  307. package/dist/extensions/Blocks/Recommendation/template.js +0 -200
  308. package/dist/src/extensions/Blocks/Recommendation/template.d.ts +0 -6
@@ -1,17 +1,17 @@
1
- import s from "./NewVersionPopup.vue2.js";
1
+ import t from "./NewVersionPopup.vue2.js";
2
2
  import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var r = function() {
4
- var e = this, t = e._self._c, o = e._self._setupProxy;
5
- return o.isVisible ? t(o.WpModal, { attrs: { id: "guido__new-version-popup", "close-on-outside-click": !1, "footer-button-options": o.footerButtonOptions, title: o.trans("email-editor.onboarding-title") }, on: { close: o.handleClose, "primary-action": o.handleDiscoverNow, "secondary-action": o.handleRemindLater } }, [t("div", { staticClass: "d-f f-d-c" }, [t("img", { staticClass: "w-1 h-1 d-b p-e-n mb-5", attrs: { src: o.onboardingImageSvg } }), t("p", { staticClass: "f-s-2 f-w-400", domProps: { innerHTML: e._s(o.trans("email-editor.onboarding-description")) } })])]) : e._e();
6
- }, i = [], a = /* @__PURE__ */ n(
7
- s,
8
- r,
3
+ var i = function() {
4
+ var e = this, s = e._self._c, o = e._self._setupProxy;
5
+ return o.isVisible ? s(o.WpModal, { attrs: { id: "guido__new-version-popup", size: "medium", "close-on-outside-click": !1, "footer-button-options": o.footerButtonOptions, title: o.popupTitle }, on: { close: o.handleClose, "primary-action": o.handleDiscoverNow, "secondary-action": o.handleRemindLater } }, [s("div", { staticClass: "d-f f-d-c" }, [s("img", { staticClass: "w-1 h-1 d-b p-e-n mb-5", attrs: { src: o.onboardingImageSvg } }), s("p", { staticClass: "f-s-2 f-w-400", domProps: { innerHTML: e._s(o.popupDescription) } })])]) : e._e();
6
+ }, r = [], a = /* @__PURE__ */ n(
7
+ t,
9
8
  i,
9
+ r,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const p = a.exports;
14
+ const _ = a.exports;
15
15
  export {
16
- p as default
16
+ _ as default
17
17
  };
@@ -1,30 +1,43 @@
1
- import { defineComponent as s, ref as r } from "vue";
2
- import a from "../../wrappers/WpModal.vue.js";
3
- import { useTranslations as i } from "../../../composables/useTranslations.js";
4
- import l from "../../../static/assets/onboarding-img.svg.js";
5
- import { useOnboardingStore as m } from "../../../stores/onboarding.js";
6
- const w = /* @__PURE__ */ s({
1
+ import { defineComponent as g, ref as b, computed as o } from "vue";
2
+ import v from "../../wrappers/WpModal.vue.js";
3
+ import { useConfig as D } from "../../../composables/useConfig.js";
4
+ import { useTranslations as h } from "../../../composables/useTranslations.js";
5
+ import { ACADEMY_LINK as l } from "../../../enums/onboarding.js";
6
+ import y from "../../../static/assets/onboarding-img.svg.js";
7
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
8
+ import { isAfterDate as C, formatShortDate as L } from "../../../utils/dateUtil.js";
9
+ const I = /* @__PURE__ */ g({
7
10
  __name: "NewVersionPopup",
8
- setup(p) {
9
- const n = i(), e = m(), o = r(!0), t = r({
11
+ emits: ["onboarding-finished"],
12
+ setup(w, { emit: a }) {
13
+ const e = h(), t = _(), s = b(!0), { config: p } = D(), i = o(() => p.migrationDate), n = o(() => C(i.value || 0)), d = o(() => L(
14
+ i.value
15
+ )), m = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-title") : e("email-editor.onboarding-title")), c = o(() => n.value ? e("email-editor.onboarding-popup-sunsetted-description", {
16
+ sunsetDate: d.value,
17
+ academyLink: l
18
+ }) : e("email-editor.onboarding-description", {
19
+ academyLink: l
20
+ })), u = o(() => n.value ? e("products.cancel") : e("products.remind-me-later")), f = o(() => ({
10
21
  primaryButton: {
11
22
  type: "primary",
12
- labelText: n("left-menu.discover-now")
23
+ labelText: e("left-menu.discover-now")
13
24
  },
14
25
  secondaryButton: {
15
26
  type: "subtle-primary",
16
- labelText: n("products.remind-me-later")
27
+ labelText: u.value
17
28
  }
18
- });
19
- return { __sfc: !0, trans: n, onboardingStore: e, isVisible: o, footerButtonOptions: t, handleDiscoverNow: () => {
20
- e.onDiscoverNowClicked(), o.value = !1;
29
+ })), r = () => {
30
+ s.value = !1, a("onboarding-finished");
31
+ };
32
+ return { __sfc: !0, emit: a, trans: e, onboardingStore: t, isVisible: s, config: p, migrationDate: i, isAfterMigrationDate: n, formattedSunsetDate: d, popupTitle: m, popupDescription: c, secondaryButtonLabel: u, footerButtonOptions: f, closePopup: r, handleDiscoverNow: () => {
33
+ t.onDiscoverNowClicked(), r();
21
34
  }, handleRemindLater: () => {
22
- e.onRemindMeLater(), o.value = !1;
35
+ t.onRemindMeLater(), r();
23
36
  }, handleClose: () => {
24
- e.onNewVersionPopupClose(), o.value = !1;
25
- }, WpModal: a, onboardingImageSvg: l };
37
+ t.onNewVersionPopupClose(), r();
38
+ }, WpModal: v, onboardingImageSvg: y };
26
39
  }
27
40
  });
28
41
  export {
29
- w as default
42
+ I as default
30
43
  };
@@ -1,19 +1,21 @@
1
- import o from "./OnboardingWrapper.vue2.js";
2
- import _ from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import t from "./OnboardingWrapper.vue2.js";
2
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var s = function() {
4
- var n = this, e = n._self._c, t = n._self._setupProxy;
5
- return e("div", n._l(t.visibleOnboardings, function(r) {
6
- return e(r.component, { key: r.type, tag: "component" });
4
+ var n = this, e = n._self._c, r = n._self._setupProxy;
5
+ return e("div", n._l(r.visibleOnboardings, function(o) {
6
+ return e(o.component, { key: o.type, tag: "component", on: { "onboarding-finished": function(p) {
7
+ return r.emit("onboarding-finished");
8
+ } } });
7
9
  }), 1);
8
- }, a = [], p = /* @__PURE__ */ _(
9
- o,
10
+ }, _ = [], a = /* @__PURE__ */ i(
11
+ t,
10
12
  s,
11
- a,
13
+ _,
12
14
  !1,
13
15
  null,
14
16
  null
15
17
  );
16
- const m = p.exports;
18
+ const d = a.exports;
17
19
  export {
18
- m as default
20
+ d as default
19
21
  };
@@ -1,24 +1,27 @@
1
- import { defineComponent as g, computed as e, onMounted as b, watch as t } from "vue";
2
- import { usePartner as O } from "../../../composables/usePartner.js";
3
- import { useEditorStore as u } from "../../../stores/editor.js";
4
- import { useOnboardingStore as v } from "../../../stores/onboarding.js";
5
- import { usePreviewStore as l } from "../../../stores/preview.js";
6
- import y from "./AMPOnboarding.vue.js";
7
- import S from "./GenericOnboarding.vue.js";
8
- import w from "./NewVersionPopup.vue.js";
9
- import P from "./TextBlockOnboarding.vue.js";
1
+ import { defineComponent as b, computed as e, onMounted as O, watch as t } from "vue";
2
+ import u from "./AMPOnboarding.vue.js";
3
+ import v from "./GenericOnboarding.vue.js";
4
+ import l from "./ItemsOnboarding.vue.js";
5
+ import y from "./NewVersionPopup.vue.js";
6
+ import S from "./TextBlockOnboarding.vue.js";
10
7
  import h from "./VersionHistoryOnboarding.vue.js";
11
- const E = /* @__PURE__ */ g({
8
+ import { usePartner as w } from "../../../composables/usePartner.js";
9
+ import { useEditorStore as P } from "../../../stores/editor.js";
10
+ import { useOnboardingStore as _ } from "../../../stores/onboarding.js";
11
+ import { usePreviewStore as A } from "../../../stores/preview.js";
12
+ const G = /* @__PURE__ */ b({
12
13
  __name: "OnboardingWrapper",
13
- setup(_) {
14
- const o = v(), r = u(), s = l(), { isTestPartner: a } = O(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
15
- { type: "newVersionPopup", component: w },
16
- { type: "genericOnboarding", component: S },
17
- { type: "textBlockOnboarding", component: P },
14
+ emits: ["onboarding-finished"],
15
+ setup(H, { emit: f }) {
16
+ const o = _(), r = P(), s = A(), { isTestPartner: a } = w(), p = e(() => r.isStripoInitialized), d = e(() => a()), m = [
17
+ { type: "newVersionPopup", component: y },
18
+ { type: "genericOnboarding", component: v },
19
+ { type: "textBlockOnboarding", component: S },
18
20
  { type: "versionHistoryOnboarding", component: h },
19
- { type: "ampOnboarding", component: y }
20
- ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), f = e(() => m.filter((n) => c(n.type)));
21
- return b(async () => {
21
+ { type: "ampOnboarding", component: u },
22
+ { type: "itemsOnboarding", component: l }
23
+ ], c = (n) => d.value || !p.value ? !1 : n === "newVersionPopup" ? o.shouldShowOnboarding(n) : o.isActive(n), g = e(() => m.filter((n) => c(n.type)));
24
+ return O(async () => {
22
25
  await o.fetchUserModalState();
23
26
  }), t(
24
27
  () => r.isVersionHistoryOpen,
@@ -35,9 +38,9 @@ const E = /* @__PURE__ */ g({
35
38
  (n) => {
36
39
  !n && o.isActive("ampOnboarding") && o.close("ampOnboarding");
37
40
  }
38
- ), { __sfc: !0, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: f };
41
+ ), { __sfc: !0, emit: f, onboardingStore: o, editorStore: r, previewStore: s, isTestPartner: a, isStripoReady: p, isTestPartnerActive: d, onboardingConfigs: m, shouldShow: c, visibleOnboardings: g };
39
42
  }
40
43
  });
41
44
  export {
42
- E as default
45
+ G as default
43
46
  };
@@ -1,6 +1,6 @@
1
- import { useToaster as g } from "./useToaster.js";
1
+ import { useToaster as w } from "./useToaster.js";
2
2
  const A = () => {
3
- const { handleError: l } = g(), n = (t = {}) => new Promise((e, a) => {
3
+ const { handleError: l } = w(), s = (e = {}) => new Promise((t, a) => {
4
4
  const i = { ...{
5
5
  minimize: !0,
6
6
  utmEntity: {
@@ -17,16 +17,16 @@ const A = () => {
17
17
  ]
18
18
  },
19
19
  mergeTags: ["Tag1", "Tag2"],
20
- forseAmp: !1,
20
+ forceAmp: !1,
21
21
  resetDataSavedFlag: !1,
22
22
  disableLineHeightsReplace: !0
23
- }, ...t }, m = {
24
- callback: (s, c, p, u, d) => {
25
- s ? a(s) : e({
26
- html: c,
27
- ampHtml: p,
28
- ampErrors: u,
29
- displayConditions: d
23
+ }, ...e }, m = {
24
+ callback: (n, p, c, d, u) => {
25
+ n ? a(n) : t({
26
+ html: p,
27
+ ampHtml: c,
28
+ ampErrors: d,
29
+ displayConditions: u
30
30
  });
31
31
  },
32
32
  ...i
@@ -34,44 +34,53 @@ const A = () => {
34
34
  window.StripoEditorApi.actionsApi.compileEmail(m);
35
35
  });
36
36
  return {
37
- getCompiledEmail: n,
38
- getTemplateData: () => new Promise((t) => {
39
- const e = ({ html: a, css: o, width: i, height: r, utmParams: m, syncModulesIds: s }) => t({
37
+ getCompiledEmail: s,
38
+ getTemplateData: () => new Promise((e) => {
39
+ const t = ({ html: a, css: o, width: i, height: r, utmParams: m, syncModulesIds: n }) => e({
40
40
  html: a,
41
41
  css: o,
42
42
  width: i,
43
43
  height: r,
44
44
  utmParams: m,
45
- syncModulesIds: s
45
+ syncModulesIds: n
46
46
  });
47
- window.StripoEditorApi.actionsApi.getTemplateData(e);
47
+ window.StripoEditorApi.actionsApi.getTemplateData(t);
48
48
  }),
49
- activateCustomViewStyles: (t = !0) => {
50
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
49
+ activateCustomViewStyles: (e = !0) => {
50
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(e);
51
51
  },
52
- getPreviewData: async (t) => {
52
+ getPreviewData: async (e) => {
53
53
  try {
54
54
  const {
55
- html: e,
55
+ html: t,
56
56
  displayConditions: a,
57
57
  ampHtml: o = "",
58
58
  ampErrors: i = []
59
- } = await n({ minimize: !1, resetDataSavedFlag: !1, ...t });
59
+ } = await s({ minimize: !1, resetDataSavedFlag: !1, ...e });
60
60
  return {
61
- html: e,
61
+ html: t,
62
62
  ampHtml: o,
63
63
  ampErrors: i,
64
64
  displayConditions: a
65
65
  };
66
- } catch (e) {
67
- return l(e, "Error loading preview"), {
66
+ } catch (t) {
67
+ return l(t, "Error loading preview"), {
68
68
  html: "",
69
69
  ampHtml: "",
70
70
  ampErrors: [],
71
71
  displayConditions: []
72
72
  };
73
73
  }
74
- }
74
+ },
75
+ updateTimerInClonedTemplate: () => new Promise((e) => {
76
+ try {
77
+ window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((t, a) => {
78
+ t ? (l(t, "Failed to update timer in cloned template"), e(null)) : e(a || null);
79
+ });
80
+ } catch (t) {
81
+ l(t, "Failed to call updateTimerInClonedTemplate"), e(null);
82
+ }
83
+ })
75
84
  };
76
85
  };
77
86
  export {
@@ -1,10 +1,4 @@
1
- import c from "../extensions/Blocks/Checkbox/extension.js";
2
- import r from "../extensions/Blocks/CouponBlock/extension.js";
3
- import i from "../extensions/Blocks/RadioButton/extension.js";
4
- import l from "../extensions/Blocks/Recommendation/extension.js";
5
- import s from "../extensions/Blocks/Unsubscribe/extension.js";
6
- import b from "../extensions/DynamicContent/extension.js";
7
- const a = {
1
+ const l = {
8
2
  "amp-accordion": "ampAccordionEnabled",
9
3
  "amp-carousel": "ampCarouselEnabled",
10
4
  "amp-form-controls": "ampFormControlsEnabled",
@@ -18,41 +12,37 @@ const a = {
18
12
  "text-block": "textEnabled",
19
13
  "timer-block": "timerEnabled",
20
14
  "video-block": "videoEnabled"
21
- }, m = {
22
- "dynamic-content": b,
23
- "checkbox-block": c,
24
- "radio-button-block": i,
25
- "recommendation-block": l,
26
- "unsubscribe-block": s,
27
- "coupon-block": r,
28
- "items-block": null
29
- // TODO: Add ItemsBlock extension when available
30
- }, E = (n) => {
15
+ }, c = {
16
+ "dynamic-content": () => import("../extensions/DynamicContent/extension.js"),
17
+ "checkbox-block": () => import("../extensions/Blocks/Checkbox/extension.js"),
18
+ "radio-button-block": () => import("../extensions/Blocks/RadioButton/extension.js"),
19
+ "recommendation-block": () => import("../extensions/Blocks/Recommendation/extension.js"),
20
+ "unsubscribe-block": () => import("../extensions/Blocks/Unsubscribe/extension.js"),
21
+ "coupon-block": () => import("../extensions/Blocks/CouponBlock/extension.js"),
22
+ "items-block": () => import("../extensions/Blocks/Items/extension.js")
23
+ }, a = (n) => {
31
24
  if (!n || !n.length)
32
25
  return {};
33
26
  const o = {};
34
27
  return n.forEach((e) => {
35
- const t = a[e];
28
+ const t = l[e];
36
29
  t && (o[t] = !1);
37
30
  }), o;
38
- }, d = (n) => {
39
- if (!n || !n.length)
40
- return [];
41
- const o = [];
42
- return n.forEach((e) => {
43
- const t = m[e];
44
- t && o.push(t);
45
- }), o;
46
- }, C = () => ({
47
- getStripoBlocksConfig: () => {
31
+ }, r = async (n) => !n || !n.length ? [] : (await Promise.all(
32
+ n.map(async (e) => {
33
+ const t = c[e];
34
+ return t ? (await t()).default : null;
35
+ })
36
+ )).filter((e) => e !== null), s = () => ({
37
+ getStripoBlocksConfig: async () => {
48
38
  var e;
49
39
  const o = (e = window.GuidoConfig) == null ? void 0 : e.blocks;
50
40
  return {
51
- baseBlocks: E(o == null ? void 0 : o.excludeDefaults),
52
- extensions: d(o == null ? void 0 : o.includeCustoms)
41
+ baseBlocks: a(o == null ? void 0 : o.excludeDefaults),
42
+ extensions: await r(o == null ? void 0 : o.includeCustoms)
53
43
  };
54
44
  }
55
45
  });
56
46
  export {
57
- C as useBlocksConfig
47
+ s as useBlocksConfig
58
48
  };
@@ -1,6 +1,6 @@
1
1
  import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
2
- const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symbol.for("guido.save.complete"), s = (e) => {
3
- o(r, e.onBack), o(n, e.onSaveStart), o(a, e.onSaveComplete);
2
+ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), c = Symbol.for("guido.save.complete"), a = Symbol.for("guido.test.email.click"), i = (e) => {
3
+ o(r, e.onBack), o(n, e.onSaveStart), o(c, e.onSaveComplete), o(a, e.onTestEmailClick);
4
4
  }, u = () => {
5
5
  try {
6
6
  return t(r);
@@ -9,7 +9,7 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
9
9
  "useBack: No back handler provided. Make sure Guido component is in the component tree."
10
10
  );
11
11
  }
12
- }, d = () => {
12
+ }, l = () => {
13
13
  try {
14
14
  return t(n);
15
15
  } catch {
@@ -17,21 +17,31 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
17
17
  "useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
18
18
  );
19
19
  }
20
- }, i = () => {
20
+ }, d = () => {
21
21
  try {
22
- return t(a);
22
+ return t(c);
23
23
  } catch {
24
24
  throw new Error(
25
25
  "useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
26
26
  );
27
27
  }
28
+ }, m = () => {
29
+ try {
30
+ return t(a);
31
+ } catch {
32
+ throw new Error(
33
+ "useTestEmailClick: No test email click handler provided. Make sure Guido component is in the component tree."
34
+ );
35
+ }
28
36
  };
29
37
  export {
30
38
  r as BACK_KEY,
31
- a as SAVE_COMPLETE_KEY,
39
+ c as SAVE_COMPLETE_KEY,
32
40
  n as SAVE_START_KEY,
33
- s as provideGuidoActions,
41
+ a as TEST_EMAIL_CLICK_KEY,
42
+ i as provideGuidoActions,
34
43
  u as useBack,
35
- i as useSaveComplete,
36
- d as useSaveStart
44
+ d as useSaveComplete,
45
+ l as useSaveStart,
46
+ m as useTestEmailClick
37
47
  };
@@ -1,25 +1,27 @@
1
1
  import { defaultHtmlCompilerRules as t } from "../config/compiler/htmlCompilerRules.js";
2
- import { outlookCompilerRules as p } from "../config/compiler/outlookCompilerRules.js";
3
- import { recommendationCompilerRules as s } from "../config/compiler/recommendationCompilerRules.js";
4
- import { socialCompilerRules as u } from "../config/compiler/socialCompilerRules.js";
5
- import { unsubscribeCompilerRules as n } from "../config/compiler/unsubscribeCompilerRules.js";
6
- import { createHtmlCompiler as c } from "../utils/htmlCompiler.js";
7
- import { useConfig as f } from "./useConfig.js";
8
- const h = () => {
9
- const { config: e } = f(), l = e.htmlCompilerRules || [], m = [
2
+ import { itemsCompilerRules as p } from "../config/compiler/itemsCompilerRules.js";
3
+ import { outlookCompilerRules as s } from "../config/compiler/outlookCompilerRules.js";
4
+ import { recommendationCompilerRules as u } from "../config/compiler/recommendationCompilerRules.js";
5
+ import { socialCompilerRules as n } from "../config/compiler/socialCompilerRules.js";
6
+ import { unsubscribeCompilerRules as c } from "../config/compiler/unsubscribeCompilerRules.js";
7
+ import { createHtmlCompiler as f } from "../utils/htmlCompiler.js";
8
+ import { useConfig as R } from "./useConfig.js";
9
+ const x = () => {
10
+ const { config: e } = R(), m = e.htmlCompilerRules || [], l = [
10
11
  ...!!e.ignoreDefaultHtmlCompilerRules ? [] : t,
12
+ ...u,
13
+ ...c,
14
+ ...p,
11
15
  ...s,
12
16
  ...n,
13
- ...p,
14
- ...u,
15
- ...l.map((o, i) => ({
17
+ ...m.map((o, i) => ({
16
18
  ...o,
17
19
  priority: o.priority + 1e3 + i
18
20
  // Ensure additional rules run after default rules
19
21
  }))
20
- ], r = c(m);
22
+ ], r = f(l);
21
23
  return { compileHtml: (o) => r.compile(o) };
22
24
  };
23
25
  export {
24
- h as useHtmlCompiler
26
+ x as useHtmlCompiler
25
27
  };
@@ -1,18 +1,19 @@
1
- import { useConfig as H } from "./useConfig.js";
2
- import { TemplateTypes as V } from "../enums/defaults.js";
3
- import { DISPLAY_CONDITIONS_REGEX as D, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as P, CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as _ } from "../enums/html-validator.js";
1
+ import { useConfig as V } from "./useConfig.js";
2
+ import { TemplateTypes as D } from "../enums/defaults.js";
3
+ import { DISPLAY_CONDITIONS_REGEX as H, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as P, CampaignCouldNotBeSavedKey as R, CanNotMakeAnyChangesForRunningKey as _ } from "../enums/html-validator.js";
4
4
  import { ToasterTypeOptions as l } from "../enums/toaster.js";
5
- import { useRecommendationStore as G } from "../stores/recommendation.js";
6
- import { base64EncodeWithSpecialChars as $ } from "../utils/base64.js";
7
- import { useHttp as j } from "./useHttp.js";
8
- import { useToaster as q } from "./useToaster.js";
9
- import { useTranslations as M } from "./useTranslations.js";
10
- const se = () => {
5
+ import { itemsBlockDynamicVariables as G } from "../extensions/Blocks/Items/enums/productEnums.js";
6
+ import { useRecommendationStore as $ } from "../stores/recommendation.js";
7
+ import { base64EncodeWithSpecialChars as j } from "../utils/base64.js";
8
+ import { useHttp as q } from "./useHttp.js";
9
+ import { useToaster as M } from "./useToaster.js";
10
+ import { useTranslations as X } from "./useTranslations.js";
11
+ const ie = () => {
11
12
  var d;
12
- const { showToaster: c } = q(), { post: y } = j(), { config: h } = H(), a = M(), m = G(), u = ((d = h.partner) == null ? void 0 : d.messageType) === V.transactional, v = async (e) => {
13
+ const { showToaster: c } = M(), { post: y } = q(), { config: h } = V(), a = X(), m = $(), u = ((d = h.partner) == null ? void 0 : d.messageType) === D.transactional, v = async (e) => {
13
14
  const t = await y(
14
15
  "/newsletter/template-library/check-template-html-body",
15
- { html: $(e) }
16
+ { html: j(e) }
16
17
  ), { status: n, message: r } = t.data;
17
18
  return n || c({
18
19
  type: l.Alert,
@@ -25,10 +26,10 @@ const se = () => {
25
26
  const t = e.match(/({%(.*?)%})/g);
26
27
  let n = !0;
27
28
  return t !== null && !u && t.forEach((r) => {
28
- const o = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
29
- if (o && o.length > 0) {
30
- const [i] = o;
31
- C(i) && !s.includes(i) && (c({
29
+ const i = r.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
30
+ if (i && i.length > 0) {
31
+ const [o] = i;
32
+ C(o) && !s.includes(o) && (c({
32
33
  type: l.Warning,
33
34
  message: a("custom-fields.invalid-custom-fields")
34
35
  }), n = !1);
@@ -58,19 +59,19 @@ const se = () => {
58
59
  }, k = (e, s) => {
59
60
  const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
60
61
  if (t && !u) {
61
- const n = new Set(s.map((o) => o.toLowerCase())), r = [];
62
- if (t.forEach((o) => {
63
- const i = o.slice(2, -2).trim().toLowerCase();
64
- (!n.has(i) || i === "") && r.push(i);
62
+ const n = new Set(s.map((i) => i.toLowerCase())), r = [];
63
+ if (t.forEach((i) => {
64
+ const o = i.slice(2, -2).trim().toLowerCase();
65
+ (!n.has(o) || o === "") && r.push(o);
65
66
  }), r.length > 0) {
66
- const o = `
67
+ const i = `
67
68
  <ul>
68
- ${r.map((i) => `<li>${i}</li>`).join("")}
69
+ ${r.map((o) => `<li>${o}</li>`).join("")}
69
70
  </ul>
70
71
  `;
71
72
  return c({
72
73
  type: l.Alert,
73
- message: a("custom-fields.invalid-custom-fields") + o
74
+ message: a("custom-fields.invalid-custom-fields") + i
74
75
  }), !1;
75
76
  }
76
77
  }
@@ -79,11 +80,11 @@ const se = () => {
79
80
  const s = e.match(/{%(.*?)%}/g), t = [];
80
81
  let n = !0;
81
82
  if (s && s.forEach((r) => {
82
- const o = r.match(D), i = r.match(P), B = (o == null ? void 0 : o.join("")) || "";
83
- (!o || r !== B) && !i && (c({
83
+ const i = r.match(H), o = r.match(P), B = (i == null ? void 0 : i.join("")) || "";
84
+ (!i || r !== B) && !o && (c({
84
85
  type: l.Alert,
85
86
  message: a("newsletter.display-conditions-invalid-syntax")
86
- }), n = !1), o && o.forEach((f) => {
87
+ }), n = !1), i && i.forEach((f) => {
87
88
  f.trim() === "=" && (c({
88
89
  type: l.Alert,
89
90
  message: a("custom-conditions.wrong-equality-operators")
@@ -94,8 +95,8 @@ const se = () => {
94
95
  });
95
96
  });
96
97
  }), t.length) {
97
- const r = t.filter((i) => i === "if"), o = t.filter((i) => i === "endif");
98
- r.length !== o.length && (c({
98
+ const r = t.filter((o) => o === "if"), i = t.filter((o) => o === "endif");
99
+ r.length !== i.length && (c({
99
100
  type: l.Alert,
100
101
  message: a("custom-conditions.missing-if-endif-tag")
101
102
  }), n = !1);
@@ -121,28 +122,28 @@ const se = () => {
121
122
  }), !1);
122
123
  }, N = (e) => {
123
124
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
124
- return Array.from(n).find((o) => {
125
- var i;
126
- return !((i = o.id) != null && i.trim());
125
+ return Array.from(n).find((i) => {
126
+ var o;
127
+ return !((o = i.id) != null && o.trim());
127
128
  }) ? (c({
128
129
  type: l.Alert,
129
130
  message: a("unsubscribe-templates.select-checkbox-groups")
130
131
  }), !1) : !0;
131
132
  }, O = (e) => {
132
133
  const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
133
- return Array.from(n).find((o) => {
134
- var i;
135
- return !((i = o.id) != null && i.trim());
134
+ return Array.from(n).find((i) => {
135
+ var o;
136
+ return !((o = i.id) != null && o.trim());
136
137
  }) ? (c({
137
138
  type: l.Alert,
138
139
  message: a("unsubscribe-templates.select-radio-button-groups")
139
140
  }), !1) : !0;
140
141
  };
141
142
  return { validateHtml: async (e, s, t = !1) => {
142
- const n = s.map((o) => o.value);
143
+ const n = [...s.map((i) => i.value), ...G];
143
144
  return await b(e, n, t) && E(e) && A(e) && x(e) && k(e, n) && T(e) && F(e) && I(e) && W() && L(e) && N(e) && O(e);
144
145
  } };
145
146
  };
146
147
  export {
147
- se as useHtmlValidator
148
+ ie as useHtmlValidator
148
149
  };
@@ -1,19 +1,18 @@
1
- import { ProductIds as r, TEST_PARTNER_LIST as n, DefaultProductType as o } from "../enums/defaults.js";
2
- const u = () => {
3
- const e = () => window.location.hostname.split(".")[0] || "", s = () => {
4
- const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
5
- return r[t] || 0;
6
- };
1
+ import { TEST_PARTNER_LIST as r, DefaultProductType as o, ProductIds as n } from "../enums/defaults.js";
2
+ const i = () => {
3
+ const e = () => window.location.hostname.split(".")[0] || "";
7
4
  return {
8
5
  getPartnerName: e,
9
- getProductType: s,
6
+ getProductType: () => {
7
+ const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
8
+ return n[t] || 0;
9
+ },
10
10
  isTestPartner: () => {
11
11
  const t = e();
12
- return n.includes(t);
13
- },
14
- isUnsubscribePages: () => s() === r.unsubscribePages
12
+ return r.includes(t);
13
+ }
15
14
  };
16
15
  };
17
16
  export {
18
- u as usePartner
17
+ i as usePartner
19
18
  };