@redneckz/wildless-cms-uni-blocks 0.9.10 → 0.9.12

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 (392) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +145 -66
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
  5. package/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  6. package/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
  7. package/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
  8. package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  9. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  10. package/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
  11. package/bundle/components/Footer/MediaButton.d.ts +3 -4
  12. package/bundle/content-page-repository/ContentPageRepository.d.ts +1 -5
  13. package/bundle/content-page-repository/alignImg.d.ts +9 -0
  14. package/bundle/content-page-repository/computeImgOutputPath.d.ts +3 -0
  15. package/bundle/content-page-repository/resizeImg.d.ts +3 -0
  16. package/bundle/content-page-repository/transformContentPage.d.ts +1 -0
  17. package/bundle/content-page-repository/transformImg.d.ts +6 -5
  18. package/bundle/content-page-repository/transformPicture.d.ts +1 -1
  19. package/bundle/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  20. package/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  21. package/bundle/utils/arrayByRange.d.ts +1 -0
  22. package/bundle/utils/isPictureSizeEmpty.d.ts +2 -2
  23. package/bundle/utils/mergeIntervals.d.ts +1 -0
  24. package/dist/components/Calculator/CalculatorContent.d.ts +18 -17
  25. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  26. package/dist/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  27. package/dist/components/Calculator/DepositCalculatorForm.js +21 -11
  28. package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  29. package/dist/components/Calculator/constants.js +1 -1
  30. package/dist/components/Calculator/constants.js.map +1 -1
  31. package/dist/components/Calculator/rangeHelpers.d.ts +1 -0
  32. package/dist/components/Calculator/rangeHelpers.js +4 -1
  33. package/dist/components/Calculator/rangeHelpers.js.map +1 -1
  34. package/dist/components/Calculator/renderMonthsInput.d.ts +1 -0
  35. package/dist/components/Calculator/renderMonthsInput.js +3 -2
  36. package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  37. package/dist/components/Calculator/useCreditCalculatorParams.js +27 -29
  38. package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  39. package/dist/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  40. package/dist/components/Calculator/useDepositCalculatorParams.js +22 -6
  41. package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  42. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  43. package/dist/components/Filtration/Filtration.js +1 -1
  44. package/dist/components/Filtration/Filtration.js.map +1 -1
  45. package/dist/components/Filtration/FiltrationContent.d.ts +18 -8
  46. package/dist/components/Filtration/FiltrationInner.js +9 -5
  47. package/dist/components/Filtration/FiltrationInner.js.map +1 -1
  48. package/dist/components/Filtration/renderFormItem.js +6 -5
  49. package/dist/components/Filtration/renderFormItem.js.map +1 -1
  50. package/dist/components/Footer/MediaButton.d.ts +3 -4
  51. package/dist/components/Footer/MediaButton.js.map +1 -1
  52. package/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
  53. package/dist/content-page-repository/ContentPageRepository.js +7 -25
  54. package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  55. package/dist/content-page-repository/alignImg.d.ts +9 -0
  56. package/dist/content-page-repository/alignImg.js +23 -0
  57. package/dist/content-page-repository/alignImg.js.map +1 -0
  58. package/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
  59. package/dist/content-page-repository/computeImgOutputPath.js +18 -0
  60. package/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
  61. package/dist/content-page-repository/resizeImg.d.ts +3 -0
  62. package/dist/content-page-repository/resizeImg.js +19 -0
  63. package/dist/content-page-repository/resizeImg.js.map +1 -0
  64. package/dist/content-page-repository/transformContentPage.d.ts +1 -0
  65. package/dist/content-page-repository/transformContentPage.js +25 -19
  66. package/dist/content-page-repository/transformContentPage.js.map +1 -1
  67. package/dist/content-page-repository/transformImg.d.ts +6 -5
  68. package/dist/content-page-repository/transformImg.js +26 -76
  69. package/dist/content-page-repository/transformImg.js.map +1 -1
  70. package/dist/content-page-repository/transformPicture.d.ts +1 -1
  71. package/dist/content-page-repository/transformPicture.js +8 -16
  72. package/dist/content-page-repository/transformPicture.js.map +1 -1
  73. package/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  74. package/dist/ui-kit/InputListRange/InputListRange.js +41 -0
  75. package/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
  76. package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  77. package/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  78. package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  79. package/dist/ui-kit/Select/Select.js +2 -1
  80. package/dist/ui-kit/Select/Select.js.map +1 -1
  81. package/dist/utils/arrayByRange.d.ts +1 -0
  82. package/dist/utils/arrayByRange.js +5 -0
  83. package/dist/utils/arrayByRange.js.map +1 -0
  84. package/dist/utils/isPictureSizeEmpty.d.ts +2 -2
  85. package/dist/utils/isPictureSizeEmpty.js +1 -1
  86. package/dist/utils/isPictureSizeEmpty.js.map +1 -1
  87. package/dist/utils/mergeIntervals.d.ts +1 -0
  88. package/dist/utils/mergeIntervals.js +20 -0
  89. package/dist/utils/mergeIntervals.js.map +1 -0
  90. package/lib/common.css +1 -1
  91. package/lib/components/Calculator/CalculatorContent.d.ts +18 -17
  92. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  93. package/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  94. package/lib/components/Calculator/DepositCalculatorForm.js +22 -12
  95. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  96. package/lib/components/Calculator/constants.js +1 -1
  97. package/lib/components/Calculator/constants.js.map +1 -1
  98. package/lib/components/Calculator/rangeHelpers.d.ts +1 -0
  99. package/lib/components/Calculator/rangeHelpers.js +2 -0
  100. package/lib/components/Calculator/rangeHelpers.js.map +1 -1
  101. package/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
  102. package/lib/components/Calculator/renderMonthsInput.js +3 -2
  103. package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  104. package/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
  105. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  106. package/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  107. package/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
  108. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  109. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  110. package/lib/components/Filtration/Filtration.js +1 -1
  111. package/lib/components/Filtration/Filtration.js.map +1 -1
  112. package/lib/components/Filtration/FiltrationContent.d.ts +18 -8
  113. package/lib/components/Filtration/FiltrationInner.js +9 -5
  114. package/lib/components/Filtration/FiltrationInner.js.map +1 -1
  115. package/lib/components/Filtration/renderFormItem.js +6 -5
  116. package/lib/components/Filtration/renderFormItem.js.map +1 -1
  117. package/lib/components/Footer/MediaButton.d.ts +3 -4
  118. package/lib/components/Footer/MediaButton.js.map +1 -1
  119. package/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
  120. package/lib/content-page-repository/ContentPageRepository.js +8 -26
  121. package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  122. package/lib/content-page-repository/alignImg.d.ts +9 -0
  123. package/lib/content-page-repository/alignImg.js +17 -0
  124. package/lib/content-page-repository/alignImg.js.map +1 -0
  125. package/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
  126. package/lib/content-page-repository/computeImgOutputPath.js +12 -0
  127. package/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
  128. package/lib/content-page-repository/resizeImg.d.ts +3 -0
  129. package/lib/content-page-repository/resizeImg.js +13 -0
  130. package/lib/content-page-repository/resizeImg.js.map +1 -0
  131. package/lib/content-page-repository/transformContentPage.d.ts +1 -0
  132. package/lib/content-page-repository/transformContentPage.js +23 -18
  133. package/lib/content-page-repository/transformContentPage.js.map +1 -1
  134. package/lib/content-page-repository/transformImg.d.ts +6 -5
  135. package/lib/content-page-repository/transformImg.js +26 -76
  136. package/lib/content-page-repository/transformImg.js.map +1 -1
  137. package/lib/content-page-repository/transformPicture.d.ts +1 -1
  138. package/lib/content-page-repository/transformPicture.js +8 -16
  139. package/lib/content-page-repository/transformPicture.js.map +1 -1
  140. package/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  141. package/lib/ui-kit/InputListRange/InputListRange.js +39 -0
  142. package/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
  143. package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  144. package/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  145. package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  146. package/lib/ui-kit/Select/Select.js +2 -1
  147. package/lib/ui-kit/Select/Select.js.map +1 -1
  148. package/lib/utils/arrayByRange.d.ts +1 -0
  149. package/lib/utils/arrayByRange.js +2 -0
  150. package/lib/utils/arrayByRange.js.map +1 -0
  151. package/lib/utils/isPictureSizeEmpty.d.ts +2 -2
  152. package/lib/utils/isPictureSizeEmpty.js +1 -1
  153. package/lib/utils/isPictureSizeEmpty.js.map +1 -1
  154. package/lib/utils/mergeIntervals.d.ts +1 -0
  155. package/lib/utils/mergeIntervals.js +17 -0
  156. package/lib/utils/mergeIntervals.js.map +1 -0
  157. package/mobile/bundle/bundle.umd.js +1 -1
  158. package/mobile/bundle/bundle.umd.min.js +1 -1
  159. package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
  160. package/mobile/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  161. package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
  162. package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
  163. package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  164. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  165. package/mobile/bundle/components/Filtration/FiltrationContent.d.ts +18 -8
  166. package/mobile/bundle/components/Footer/MediaButton.d.ts +3 -4
  167. package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +1 -5
  168. package/mobile/bundle/content-page-repository/alignImg.d.ts +9 -0
  169. package/mobile/bundle/content-page-repository/computeImgOutputPath.d.ts +3 -0
  170. package/mobile/bundle/content-page-repository/resizeImg.d.ts +3 -0
  171. package/mobile/bundle/content-page-repository/transformContentPage.d.ts +1 -0
  172. package/mobile/bundle/content-page-repository/transformImg.d.ts +6 -5
  173. package/mobile/bundle/content-page-repository/transformPicture.d.ts +1 -1
  174. package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  175. package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  176. package/mobile/bundle/utils/arrayByRange.d.ts +1 -0
  177. package/mobile/bundle/utils/isPictureSizeEmpty.d.ts +2 -2
  178. package/mobile/bundle/utils/mergeIntervals.d.ts +1 -0
  179. package/mobile/dist/components/Calculator/CalculatorContent.d.ts +18 -17
  180. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  181. package/mobile/dist/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  182. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +21 -11
  183. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  184. package/mobile/dist/components/Calculator/constants.js +1 -1
  185. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  186. package/mobile/dist/components/Calculator/rangeHelpers.d.ts +1 -0
  187. package/mobile/dist/components/Calculator/rangeHelpers.js +4 -1
  188. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
  189. package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +1 -0
  190. package/mobile/dist/components/Calculator/renderMonthsInput.js +3 -2
  191. package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  192. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +27 -29
  193. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  194. package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  195. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +22 -6
  196. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  197. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  198. package/mobile/dist/components/Filtration/Filtration.js +1 -1
  199. package/mobile/dist/components/Filtration/Filtration.js.map +1 -1
  200. package/mobile/dist/components/Filtration/FiltrationContent.d.ts +18 -8
  201. package/mobile/dist/components/Filtration/FiltrationInner.js +9 -5
  202. package/mobile/dist/components/Filtration/FiltrationInner.js.map +1 -1
  203. package/mobile/dist/components/Filtration/renderFormItem.js +6 -5
  204. package/mobile/dist/components/Filtration/renderFormItem.js.map +1 -1
  205. package/mobile/dist/components/Footer/MediaButton.d.ts +3 -4
  206. package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
  207. package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
  208. package/mobile/dist/content-page-repository/ContentPageRepository.js +7 -25
  209. package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  210. package/mobile/dist/content-page-repository/alignImg.d.ts +9 -0
  211. package/mobile/dist/content-page-repository/alignImg.js +23 -0
  212. package/mobile/dist/content-page-repository/alignImg.js.map +1 -0
  213. package/mobile/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
  214. package/mobile/dist/content-page-repository/computeImgOutputPath.js +18 -0
  215. package/mobile/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
  216. package/mobile/dist/content-page-repository/resizeImg.d.ts +3 -0
  217. package/mobile/dist/content-page-repository/resizeImg.js +19 -0
  218. package/mobile/dist/content-page-repository/resizeImg.js.map +1 -0
  219. package/mobile/dist/content-page-repository/transformContentPage.d.ts +1 -0
  220. package/mobile/dist/content-page-repository/transformContentPage.js +25 -19
  221. package/mobile/dist/content-page-repository/transformContentPage.js.map +1 -1
  222. package/mobile/dist/content-page-repository/transformImg.d.ts +6 -5
  223. package/mobile/dist/content-page-repository/transformImg.js +26 -76
  224. package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
  225. package/mobile/dist/content-page-repository/transformPicture.d.ts +1 -1
  226. package/mobile/dist/content-page-repository/transformPicture.js +8 -16
  227. package/mobile/dist/content-page-repository/transformPicture.js.map +1 -1
  228. package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  229. package/mobile/dist/ui-kit/InputListRange/InputListRange.js +41 -0
  230. package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
  231. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  232. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  233. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  234. package/mobile/dist/ui-kit/Select/Select.js +2 -1
  235. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  236. package/mobile/dist/utils/arrayByRange.d.ts +1 -0
  237. package/mobile/dist/utils/arrayByRange.js +5 -0
  238. package/mobile/dist/utils/arrayByRange.js.map +1 -0
  239. package/mobile/dist/utils/isPictureSizeEmpty.d.ts +2 -2
  240. package/mobile/dist/utils/isPictureSizeEmpty.js +1 -1
  241. package/mobile/dist/utils/isPictureSizeEmpty.js.map +1 -1
  242. package/mobile/dist/utils/mergeIntervals.d.ts +1 -0
  243. package/mobile/dist/utils/mergeIntervals.js +20 -0
  244. package/mobile/dist/utils/mergeIntervals.js.map +1 -0
  245. package/mobile/lib/components/Calculator/CalculatorContent.d.ts +18 -17
  246. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  247. package/mobile/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  248. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +22 -12
  249. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  250. package/mobile/lib/components/Calculator/constants.js +1 -1
  251. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  252. package/mobile/lib/components/Calculator/rangeHelpers.d.ts +1 -0
  253. package/mobile/lib/components/Calculator/rangeHelpers.js +2 -0
  254. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
  255. package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
  256. package/mobile/lib/components/Calculator/renderMonthsInput.js +3 -2
  257. package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  258. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
  259. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  260. package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  261. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
  262. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  263. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  264. package/mobile/lib/components/Filtration/Filtration.js +1 -1
  265. package/mobile/lib/components/Filtration/Filtration.js.map +1 -1
  266. package/mobile/lib/components/Filtration/FiltrationContent.d.ts +18 -8
  267. package/mobile/lib/components/Filtration/FiltrationInner.js +9 -5
  268. package/mobile/lib/components/Filtration/FiltrationInner.js.map +1 -1
  269. package/mobile/lib/components/Filtration/renderFormItem.js +6 -5
  270. package/mobile/lib/components/Filtration/renderFormItem.js.map +1 -1
  271. package/mobile/lib/components/Footer/MediaButton.d.ts +3 -4
  272. package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
  273. package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
  274. package/mobile/lib/content-page-repository/ContentPageRepository.js +8 -26
  275. package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  276. package/mobile/lib/content-page-repository/alignImg.d.ts +9 -0
  277. package/mobile/lib/content-page-repository/alignImg.js +17 -0
  278. package/mobile/lib/content-page-repository/alignImg.js.map +1 -0
  279. package/mobile/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
  280. package/mobile/lib/content-page-repository/computeImgOutputPath.js +12 -0
  281. package/mobile/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
  282. package/mobile/lib/content-page-repository/resizeImg.d.ts +3 -0
  283. package/mobile/lib/content-page-repository/resizeImg.js +13 -0
  284. package/mobile/lib/content-page-repository/resizeImg.js.map +1 -0
  285. package/mobile/lib/content-page-repository/transformContentPage.d.ts +1 -0
  286. package/mobile/lib/content-page-repository/transformContentPage.js +23 -18
  287. package/mobile/lib/content-page-repository/transformContentPage.js.map +1 -1
  288. package/mobile/lib/content-page-repository/transformImg.d.ts +6 -5
  289. package/mobile/lib/content-page-repository/transformImg.js +26 -76
  290. package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
  291. package/mobile/lib/content-page-repository/transformPicture.d.ts +1 -1
  292. package/mobile/lib/content-page-repository/transformPicture.js +8 -16
  293. package/mobile/lib/content-page-repository/transformPicture.js.map +1 -1
  294. package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  295. package/mobile/lib/ui-kit/InputListRange/InputListRange.js +39 -0
  296. package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
  297. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  298. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  299. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  300. package/mobile/lib/ui-kit/Select/Select.js +2 -1
  301. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  302. package/mobile/lib/utils/arrayByRange.d.ts +1 -0
  303. package/mobile/lib/utils/arrayByRange.js +2 -0
  304. package/mobile/lib/utils/arrayByRange.js.map +1 -0
  305. package/mobile/lib/utils/isPictureSizeEmpty.d.ts +2 -2
  306. package/mobile/lib/utils/isPictureSizeEmpty.js +1 -1
  307. package/mobile/lib/utils/isPictureSizeEmpty.js.map +1 -1
  308. package/mobile/lib/utils/mergeIntervals.d.ts +1 -0
  309. package/mobile/lib/utils/mergeIntervals.js +17 -0
  310. package/mobile/lib/utils/mergeIntervals.js.map +1 -0
  311. package/mobile/src/components/Calculator/Calculator.example.json +3 -1
  312. package/mobile/src/components/Calculator/CalculatorContent.ts +20 -19
  313. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
  314. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
  315. package/mobile/src/components/Calculator/constants.ts +1 -1
  316. package/mobile/src/components/Calculator/rangeHelpers.ts +10 -0
  317. package/mobile/src/components/Calculator/renderMonthsInput.tsx +13 -2
  318. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
  319. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
  320. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
  321. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
  322. package/mobile/src/components/Filtration/Filtration.example.json +39 -19
  323. package/mobile/src/components/Filtration/Filtration.tsx +3 -8
  324. package/mobile/src/components/Filtration/FiltrationContent.ts +19 -8
  325. package/mobile/src/components/Filtration/FiltrationInner.tsx +31 -12
  326. package/mobile/src/components/Filtration/renderFormItem.tsx +20 -20
  327. package/mobile/src/components/Footer/MediaButton.tsx +3 -5
  328. package/mobile/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
  329. package/mobile/src/content-page-repository/ContentPageRepository.ts +8 -40
  330. package/mobile/src/content-page-repository/alignImg.ts +32 -0
  331. package/mobile/src/content-page-repository/computeImgOutputPath.ts +20 -0
  332. package/mobile/src/content-page-repository/resizeImg.ts +18 -0
  333. package/mobile/src/content-page-repository/transformContentPage.ts +25 -18
  334. package/mobile/src/content-page-repository/transformImg.ts +49 -121
  335. package/mobile/src/content-page-repository/transformPicture.ts +9 -21
  336. package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
  337. package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
  338. package/mobile/src/ui-kit/Select/Select.tsx +8 -1
  339. package/mobile/src/utils/arrayByRange.ts +4 -0
  340. package/mobile/src/utils/isPictureSizeEmpty.ts +3 -3
  341. package/mobile/src/utils/mergeIntervals.ts +19 -0
  342. package/package.json +1 -1
  343. package/src/components/Calculator/Calculator.example.json +3 -1
  344. package/src/components/Calculator/Calculator.fixture.tsx +4 -0
  345. package/src/components/Calculator/CalculatorContent.ts +20 -19
  346. package/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
  347. package/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
  348. package/src/components/Calculator/constants.ts +1 -1
  349. package/src/components/Calculator/rangeHelpers.ts +10 -0
  350. package/src/components/Calculator/renderMonthsInput.tsx +13 -2
  351. package/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
  352. package/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
  353. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
  354. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +0 -9
  355. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
  356. package/src/components/Filtration/Filtration.example.json +39 -19
  357. package/src/components/Filtration/Filtration.fixture.tsx +36 -20
  358. package/src/components/Filtration/Filtration.tsx +3 -8
  359. package/src/components/Filtration/FiltrationContent.ts +19 -8
  360. package/src/components/Filtration/FiltrationInner.tsx +31 -12
  361. package/src/components/Filtration/renderFormItem.tsx +20 -20
  362. package/src/components/Footer/MediaButton.tsx +3 -5
  363. package/src/components/RichTextBlock/RichTextBlock.example.json +1 -1
  364. package/src/content-page-repository/ContentPageRepository.ts +8 -40
  365. package/src/content-page-repository/alignImg.ts +32 -0
  366. package/src/content-page-repository/computeImgOutputPath.ts +20 -0
  367. package/src/content-page-repository/resizeImg.ts +18 -0
  368. package/src/content-page-repository/transformContentPage.ts +25 -18
  369. package/src/content-page-repository/transformImg.ts +49 -121
  370. package/src/content-page-repository/transformPicture.ts +9 -21
  371. package/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
  372. package/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
  373. package/src/ui-kit/Select/Select.tsx +8 -1
  374. package/src/utils/arrayByRange.ts +4 -0
  375. package/src/utils/isPictureSizeEmpty.ts +3 -3
  376. package/src/utils/mergeIntervals.ts +19 -0
  377. package/bundle/content-page-repository/transformImgPath.d.ts +0 -8
  378. package/dist/content-page-repository/transformImgPath.d.ts +0 -8
  379. package/dist/content-page-repository/transformImgPath.js +0 -22
  380. package/dist/content-page-repository/transformImgPath.js.map +0 -1
  381. package/lib/content-page-repository/transformImgPath.d.ts +0 -8
  382. package/lib/content-page-repository/transformImgPath.js +0 -16
  383. package/lib/content-page-repository/transformImgPath.js.map +0 -1
  384. package/mobile/bundle/content-page-repository/transformImgPath.d.ts +0 -8
  385. package/mobile/dist/content-page-repository/transformImgPath.d.ts +0 -8
  386. package/mobile/dist/content-page-repository/transformImgPath.js +0 -22
  387. package/mobile/dist/content-page-repository/transformImgPath.js.map +0 -1
  388. package/mobile/lib/content-page-repository/transformImgPath.d.ts +0 -8
  389. package/mobile/lib/content-page-repository/transformImgPath.js +0 -16
  390. package/mobile/lib/content-page-repository/transformImgPath.js.map +0 -1
  391. package/mobile/src/content-page-repository/transformImgPath.ts +0 -30
  392. package/src/content-page-repository/transformImgPath.ts +0 -30
@@ -1,13 +1,27 @@
1
+ import { arrayByRange } from '../../utils/arrayByRange.js';
2
+ import { mergeIntervals } from '../../utils/mergeIntervals.js';
1
3
  import { DEFAULT_DEPOSIT_CALCULATOR_PARAMS, DEPOSIT_CALC_DEFAULT_DIR } from './constants.js';
2
4
  import { checkRangeByKeys, getRangeByKeys } from './rangeHelpers.js';
3
5
  import { useCalculatorParams } from './useCalculatorParams.js';
4
- export const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
5
- const { isMonthlyInterestPayment, isRemoteRegistration, moneyValue, monthsValue } = userInputParams;
6
+ export const useDepositCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
7
+ const { moneyValue, monthsValue } = userInputParams;
6
8
  const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
7
- const depositCalculatorSourceBookParams = data?.rows?.find((_) => isMonthlyInterestPayment === _.isMonthlyInterestPayment &&
8
- isRemoteRegistration === _.isRemoteRegistration &&
9
- checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], _) &&
10
- checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], _)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
9
+ const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
10
+ const isExcludeRemoteRegistration = !paramsViewSettings?.isShowRemoteRegistration;
11
+ const depositCalculatorSourceBookParams = data?.rows?.find((row) => checkRowByParam({
12
+ row,
13
+ userInputParams,
14
+ paramKey: 'isMonthlyInterestPayment',
15
+ isExclude: isExcludeMonthlyInterestPayment,
16
+ }) &&
17
+ checkRowByParam({
18
+ row,
19
+ userInputParams,
20
+ paramKey: 'isRemoteRegistration',
21
+ isExclude: isExcludeRemoteRegistration,
22
+ }) &&
23
+ checkRangeByKeys(moneyValue, ['minSum', 'maxSum'], row) &&
24
+ checkRangeByKeys(monthsValue, ['minMonths', 'maxMonths'], row)) || DEFAULT_DEPOSIT_CALCULATOR_PARAMS;
11
25
  const { rate } = depositCalculatorSourceBookParams;
12
26
  const income = getDepositIncome(rate, userInputParams);
13
27
  const finalSum = moneyValue + income;
@@ -16,6 +30,7 @@ export const useDepositCalculatorParams = (userInputParams, sourceBookDir) => {
16
30
  ...depositCalculatorSourceBookParams,
17
31
  ...getRangeByKeys(['minSum', 'maxSum'], sourceBookRows),
18
32
  ...getRangeByKeys(['minMonths', 'maxMonths'], sourceBookRows),
33
+ availableMonths: mergeIntervals(sourceBookRows.map((row) => [row['minMonths'], row['maxMonths']])).flatMap(([start, end]) => arrayByRange(start, end)),
19
34
  ...userInputParams,
20
35
  income,
21
36
  finalSum,
@@ -33,4 +48,5 @@ const getDepositIncome = (rate, userInputParams) => {
33
48
  return Math.round((moneyValue * rate * 30 * monthsValue) / 365 / 100);
34
49
  }
35
50
  };
51
+ const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
36
52
  //# sourceMappingURL=useDepositCalculatorParams.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDepositCalculatorParams.js","sourceRoot":"","sources":["../../../src/components/Calculator/useDepositCalculatorParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA+B5D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,eAAiD,EACjD,aAAsB,EACG,EAAE;IAC3B,MAAM,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE,GAC/E,eAAe,CAAC;IAElB,MAAM,IAAI,GAAG,mBAAmB,CAC9B,aAAa,IAAI,wBAAwB,CAC1C,CAAC;IAEF,MAAM,iCAAiC,GACrC,IAAI,EAAE,IAAI,EAAE,IAAI,CACd,CAAC,CAAC,EAAE,EAAE,CACJ,wBAAwB,KAAK,CAAC,CAAC,wBAAwB;QACvD,oBAAoB,KAAK,C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;AASF,MAAM,eAAe,GAAG,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAwB,EAAE,EAAE,CAC9F,SAAS,IAAI,eAAe,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,15 +1,11 @@
1
- import type { ButtonVersion } from '../../model/ButtonVersion';
2
1
  import type { HeadlineCommonProps } from '../../model/HeadlineType';
3
2
  import type { UniBlockContent } from '../../model/JSXBlock';
4
3
  import type { LinkCommonProps } from '../../model/LinkProps';
5
4
  import type { IconProps } from '../../model/Picture';
6
- import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
5
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
7
6
  import type { ListContent } from '../../ui-kit/List/ListContent';
8
7
  import type { TextAlign } from '../../ui-kit/Text/TextProps';
9
- export declare type RecommendationSocialMedia = LinkCommonProps & IconProps & ButtonWithIconProps & {
10
- version: ButtonVersion;
11
- rounded?: boolean;
12
- };
8
+ export declare type RecommendationSocialMedia = LinkCommonProps & IconProps & ButtonProps;
13
9
  /**
14
10
  * @title Карточка рекомендаций
15
11
  */
@@ -8,7 +8,7 @@ import { FiltrationInner } from './FiltrationInner.js';
8
8
  import { renderFormItem } from './renderFormItem.js';
9
9
  export const Filtration = JSX(({ className, filtrationSchema = {}, resetButton, ...rest }) => {
10
10
  const { formState, register, resetForm } = useForm();
11
- return (_jsxs(BlockWrapper, { className: style('p-9', className), ...rest, children: [_jsxs("form", { className: "flex justify-between", children: [_jsx("div", { className: "flex gap-11", children: Object.keys(filtrationSchema).map(renderFormItem(filtrationSchema, register)) }), resetButton ? (_jsx("div", { children: _jsx(Button, { className: "w-72", text: resetButton.text, version: resetButton.buttonVersion, onClick: resetForm }) })) : null] }), _jsx(FiltrationInner, { filtrationState: formState, ...rest })] }));
11
+ return (_jsxs(BlockWrapper, { className: style(className), version: "transparent", ...rest, children: [_jsxs("form", { className: "flex justify-between bg-white p-9 mb-1", children: [_jsx("div", { className: "flex gap-11", children: Object.keys(filtrationSchema).map(renderFormItem(filtrationSchema, register)) }), resetButton ? (_jsx("div", { children: _jsx(Button, { className: "w-72", onClick: resetForm, ...resetButton }) })) : null] }), _jsx(FiltrationInner, { filtrationState: formState, ...rest })] }));
12
12
  });
13
13
  Filtration.childrenTypes = ['ProductTile'];
14
14
  Filtration.childSchema = (content) => content?.filtrationSchema || {};
@@ -1 +1 @@
1
- {"version":3,"file":"Filtration.js","sourceRoot":"","sources":["../../../src/components/Filtration/Filtration.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIlD,MAAM,CAAC,MAAM,UAAU,GAA8B,GAAG,CACtD,CAAC,EAAE,SAAS,EAAE,gBAAgB,GAAG,EAAE,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAC7D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,OAAO,EAAE,CAAC;IAErD,OAAO,CACL,MAAC,YAAY,IAAC,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,KAAM,IAAI,aACxD,gBAAM,SAAS,EAAC,sBAAsB,aACpC,cAAK,SAAS,EAAC,aAAa,YACzB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC,GAC1E,EACL,WAAW,CAAC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gBAAM,SAAS,EAAC,wCAAwC,aACtD,cAAK,SAAS,EAAC,aAAa,YACzB,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC,GAC1E,EACL,WAAW,CAAC,CAAC,CAAC,CACb,wBACE,KAAC,MAAM,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAE,SAAS,KAAM,WAAW,GAAI,GAC5D,CACP,CAAC,CAAC,CAAC,IAAI,IACH,EACP,KAAC,eAAe,IAAC,eAAe,EAAE,SAAS,KAAM,IAAI,GAAI,IAC5C,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,aAAa,GAAG,CAAC,aAAa,CAAC,CAAC;AAC3C,UAAU,CAAC,WAAW,GAAG,CAAC,OAA2B,EAAE,EAAE,CAAC,OAAO,EAAE,gBAAgB,IAAI,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { ButtonVersion } from '../../model/ButtonVersion';
2
+ import type { DescriptionProps, TitleProps } from '../../model/HeadlineType';
2
3
  /**
3
4
  * @title Заголовок
4
5
  */
@@ -28,6 +29,7 @@ export declare type StringArray = {
28
29
  * @hidden
29
30
  */
30
31
  type?: 'array';
32
+ /** @title */
31
33
  items?: {
32
34
  /**
33
35
  * @default string
@@ -40,13 +42,13 @@ export declare type StringArray = {
40
42
  };
41
43
  export declare type FiltrationSchema = {
42
44
  /** @title Тип недвижимости */
43
- propertyType?: StringEnum;
45
+ propertyType?: StringArray;
44
46
  /** @title Этап строительства */
45
- stage?: StringEnum;
47
+ stage?: StringArray;
46
48
  /** @title Категории */
47
- categories?: StringEnum;
49
+ categories?: StringArray;
48
50
  /** @title Дополнительно */
49
- extraOptions?: StringEnum;
51
+ extraOptions?: StringArray;
50
52
  };
51
53
  /**
52
54
  * @title Кнопка сброса
@@ -59,13 +61,22 @@ export declare type ResetButton = {
59
61
  /**
60
62
  * @title Цвет кнопки
61
63
  */
62
- buttonVersion: ButtonVersion;
64
+ version: ButtonVersion;
63
65
  };
66
+ /**
67
+ * @title Плитка "Не найдено"
68
+ */
69
+ export declare type NotFound = TitleProps & DescriptionProps;
64
70
  export interface FiltrationInnerContent {
65
- /** @title Название кнопки */
71
+ /** @title Название сворачивающейся кнопки */
66
72
  label?: string;
67
- /** @title Количество отображаемых предметов */
73
+ /**
74
+ * @title Количество отображаемых предметов
75
+ * @minimum 1
76
+ */
68
77
  topItemsCount?: number;
78
+ resetButton?: ResetButton;
79
+ notFound?: NotFound;
69
80
  }
70
81
  /**
71
82
  * @title Фильтрация
@@ -73,6 +84,5 @@ export interface FiltrationInnerContent {
73
84
  export interface FiltrationContent extends FiltrationInnerContent {
74
85
  /** @title Параметры фильтрации */
75
86
  filtrationSchema?: FiltrationSchema;
76
- resetButton?: ResetButton;
77
87
  }
78
88
  export {};
@@ -4,18 +4,22 @@ import { renderBlocksList } from '../../BlockRenderer/renderBlockList.js';
4
4
  import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton.js';
5
5
  import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
6
6
  import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
7
+ import { Paragraph } from '../../ui-kit/Paragraph/Paragraph.js';
8
+ import { Text } from '../../ui-kit/Text/Text.js';
7
9
  import { style } from '../../utils/style.js';
8
- import { ErrorBlock } from '../ErrorBlock/ErrorBlock.js';
9
10
  import { checkShouldRenderBlock } from './checkShouldRenderBlock.js';
10
11
  const ICONS = ['ArrowDownIcon', 'ArrowUpIcon'];
11
12
  const resultsGridStyle = 'grid grid-cols-12 gap-1 border-box';
12
- export const FiltrationInner = JSX(({ label = '', filtrationState = {}, topItemsCount = 0, block, ...rest }) => {
13
+ export const FiltrationInner = JSX(({ label = '', filtrationState = {}, topItemsCount = 0, block, notFound, ...rest }) => {
13
14
  const blocksToRender = block?.blocks?.filter((b) => checkShouldRenderBlock(filtrationState, b.content || {})) || [];
14
15
  const [visibleBlocks, hiddenBlocks] = topItemsCount > 0
15
16
  ? [blocksToRender.slice(0, topItemsCount), blocksToRender.slice(topItemsCount)]
16
17
  : [blocksToRender, []];
17
- return (_jsxs("div", { children: [_jsx("div", { className: style(blocksToRender.length ? 'hidden' : ''), children: _jsx(ErrorBlock, { error: { errorContentType: 'Image' }, title: "\u041D\u0435\u0442 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0435\u0439 \u0438\u043F\u043E\u0442\u0435\u0447\u043D\u043E\u0439 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B", subtitle: "\u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B" }) }), _jsxs("div", { className: style(blocksToRender.length ? '' : 'hidden'), children: [_jsx("div", { className: resultsGridStyle, children: renderBlocksList(visibleBlocks, { ...rest.options, parent: block }) }), _jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => {
18
- return (_jsx(FoldableSection, { className: resultsGridStyle, isUnfolded: isUnfolded, children: renderBlocksList(hiddenBlocks, { ...rest.options, parent: block }) }));
19
- }, renderFoldButton: ({ isUnfolded, onToggle }) => (_jsx(DefaultFoldButton, { className: style('mt-11', topItemsCount < 1 ? 'hidden' : ''), disabled: !hiddenBlocks?.length, label: label, icon: ICONS[Number(isUnfolded)], dataTheme: rest.options?.page?.colorPalette, onClick: onToggle })) })] })] }));
18
+ return (_jsxs("div", { children: [_jsx("div", { className: style(blocksToRender.length ? 'hidden' : 'block'), children: notFound ? renderNotFound(notFound) : null }), _jsxs("div", { className: style(blocksToRender.length ? '' : 'hidden'), children: [_jsx("div", { className: style('mb-1', resultsGridStyle), children: renderBlocksList(visibleBlocks, { ...rest.options, parent: block }) }), _jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => {
19
+ return (_jsx(FoldableSection, { className: style(resultsGridStyle, isUnfolded ? 'mb-1' : ''), isUnfolded: isUnfolded, children: renderBlocksList(hiddenBlocks, { ...rest.options, parent: block }) }));
20
+ }, renderFoldButton: ({ isUnfolded, onToggle }) => (_jsx(DefaultFoldButton, { className: style(topItemsCount < 1 ? 'hidden' : ''), disabled: !hiddenBlocks?.length, label: label, icon: ICONS[Number(isUnfolded)], dataTheme: rest.options?.page?.colorPalette, onClick: onToggle })) })] })] }));
20
21
  });
22
+ function renderNotFound({ title, description }) {
23
+ return (_jsxs("div", { className: "bg-white py-20", children: [title ? (_jsx("div", { className: "mb-2", children: _jsx(Paragraph, { align: "text-center", children: _jsx(Text, { size: "text-h4", children: title }) }) })) : null, description ? (_jsx(Paragraph, { size: "text-xl", font: "font-light", align: "text-center", children: description })) : null] }));
24
+ }
21
25
  //# sourceMappingURL=FiltrationInner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FiltrationInner.js","sourceRoot":"","sources":["../../../src/components/Filtration/FiltrationInner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAGvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,MAAM,KAAK,GAAe,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;AAE3D,MAAM,gBAAgB,GAAG,oCAAoC,CAAC;AAM9D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAChC,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,eAAe,GAAG,EAAE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5
5
  const item = filtrationSchema[key];
6
6
  const type = item?.type;
7
7
  switch (type) {
8
- case 'string':
9
- return renderRadioButtons(key, register)(item);
8
+ case 'array':
9
+ return renderCheckboxes(key, register)(item);
10
10
  default:
11
11
  return null;
12
12
  }
13
13
  };
14
- const renderRadioButtons = (key, register) => (item) => {
15
- const options = item?.enum?.map((e, i) => ({ value: e, title: item?.enumNames?.[i] || '' })) || [];
16
- return (_jsxs("div", { role: "radiogroup", children: [item?.title ? (_jsx("div", { className: "mb-4", children: _jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: item.title }) })) : null, _jsx(SlideCheckboxGroup, { items: options, multiple: false, ...register(key) })] }, key));
14
+ const renderCheckboxes = (key, register) => (item) => {
15
+ const options = item?.items?.enum?.map((e, i) => ({ value: e, title: item?.items?.enumNames?.[i] || '' })) ||
16
+ [];
17
+ return (_jsxs("div", { children: [item?.title ? (_jsx("div", { className: "mb-4", children: _jsx(Text, { size: "text-m", font: "font-light", color: "text-secondary-text", children: item.title }) })) : null, _jsx(SlideCheckboxGroup, { items: options, multiple: true, ...register(key) })] }, key));
17
18
  };
18
19
  //# sourceMappingURL=renderFormItem.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderFormItem.js","sourceRoot":"","sources":["../../../src/components/Filtration/renderFormItem.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAG9C,MAAM,CAAC,MAAM,cAAc,GACzB,CAAC,gBAAkC,EAAE,QAA+B,EAAE,EAAE,CAAC,CAAC,GAAW,EAAE,EAAE;IACvF,MAAM,IAAI,GAAG,gBAAgB,CAAC,GAAoC,CAAC,CAAC;IACpE,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,CAAC;IAExB,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ;YACX,OAAO,kBAAkB,CAAC,GAAG,EAAE,QAAQ,CA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,CAAC;IAExB,QAAQ,IAAI,EAAE;QACZ,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/C;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AAEJ,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAE,QAA+B,EAAE,EAAE,CAAC,CAAC,IAAkB,EAAE,EAAE;IAChG,MAAM,OAAO,GACX,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1F,EAAE,CAAC;IAEL,OAAO,CACL,0BACG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CACb,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,YAAY,EAAC,KAAK,EAAC,qBAAqB,YAC9D,IAAI,CAAC,KAAK,GACN,GACH,CACP,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,kBAAkB,IAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,WAAK,QAAQ,CAAC,GAAG,CAAC,GAAI,KAR1D,GAAG,CASP,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -1,8 +1,7 @@
1
- import type { IconVersion } from '../../model/IconVersion';
2
- import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
1
+ import type { IconProps } from '../../model/Picture';
2
+ import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
3
3
  export declare type ButtonSize = 'default' | 'small';
4
- interface MediaButtonProps extends ButtonWithIconProps {
5
- iconVersion?: IconVersion;
4
+ interface MediaButtonProps extends ButtonProps, IconProps {
6
5
  buttonSize?: ButtonSize;
7
6
  }
8
7
  export declare const MediaButton: import("@redneckz/uni-jsx").UNIComponent<MediaButtonProps, any, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"MediaButton.js","sourceRoot":"","sources":["../../../src/components/Footer/MediaButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGxC,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,MAAM,SAAS,GAIV;IACH;QACE,OAAO,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC;QACjC,UAAU,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;QACpC,KAAK,EAAE,UAAU;KAClB;IACD;QACE,OAAO,EAAE,CAAC,QAAQ,CAAC;QACnB,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,KAAK,EAAE,WAAW;KACnB;IACD;QACE,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC9B,KAAK,EAAE,eAAe;KACvB;IACD;QACE,OAAO,EAAE,CAAC,gBAAgB,CAAC;QAC3B,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;QACjC,KAAK,EAAE,WAAW;KACnB;IACD;QACE,OAAO,EAAE,CAAC,iBAAiB,CAAC;QAC5B,UAAU,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;QACtC,KAAK,EAAE,aAAa;KACrB;IACD;QACE,OAAO,EAAE,CAAC,aAAa,CAAC;QACxB,UAAU,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE;QACnC,KAAK,EAAE,SAAS;KACjB;CACF,CAAC;AASF,MAAM,gBAAgB,GAAG;IACvB,OA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K,CACd,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,YAAY,EACvC,8CAA8C,EAC9C,wCAAwC,EACxC,wCAAwC,EACxC,iGAAiG,EACjG,8BAA8B,EAC9B,oBAAoB,CAAC,IAAI,EAAE,UAAU,CAAC,CACvC,gBACW,KAAK,EACjB,GAAG,EAAC,qBAAqB,EACzB,MAAM,EAAC,QAAQ,EACf,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,KACZ,IAAI,YAEP,eAAe,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAC1B,KAAC,GAAG,IACF,KAAK,EAAE,eAAe,EACtB,cAAc,EAAC,8BAA8B,EAC7C,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,KAAK,SACL,CACH,CAAC,CAAC,CAAC,IAAI,GACD,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,IAAyB,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC"}
@@ -3,12 +3,8 @@ import type { TransformationOptions } from './TransformationOptions';
3
3
  export declare class ContentPageRepository {
4
4
  private readonly options;
5
5
  static readonly inst: ContentPageRepository;
6
- private cache;
7
6
  constructor(options?: TransformationOptions);
8
7
  listAllContentPages(): Promise<string[]>;
9
- getAllContentPages(): Promise<ContentPageDef[]>;
10
- getSecondaryContentPages(customPageType?: string): Promise<ContentPageDef[]>;
11
- getContentPageBySlug(slug: string): Promise<ContentPageDef | undefined>;
12
- getIndexPage(): Promise<ContentPageDef | undefined>;
13
8
  readPage(filePath: string): Promise<ContentPageDef>;
9
+ generatePage(filePath: string): Promise<ContentPageDef>;
14
10
  }
@@ -1,44 +1,26 @@
1
+ import fs from 'fs';
1
2
  import glob from 'glob';
2
3
  import util from 'util';
3
- import { transformContentPage } from './transformContentPage.js';
4
- const INDEX_PAGE_SLUG = 'index';
4
+ import { generatedPagePath, transformContentPage } from './transformContentPage.js';
5
5
  const find = util.promisify(glob);
6
- const bySlug = (slug) => (content) => content.slug === slug;
7
- const byCustomPageType = (type) => (content) => type ? content._customPageType === type : !content._customPageType;
8
- const not = (predicate) => (_) => !predicate(_);
6
+ const readFile = util.promisify(fs.readFile);
9
7
  export class ContentPageRepository {
10
8
  options;
11
9
  static inst = new ContentPageRepository();
12
- cache = {};
13
10
  constructor(options = {
14
11
  contentDir: 'content',
15
12
  publicDir: 'public',
16
13
  }) {
17
14
  this.options = options;
18
15
  }
19
- async listAllContentPages() {
16
+ listAllContentPages() {
20
17
  return find(`${this.options.contentDir}/**/*.page.json`);
21
18
  }
22
- async getAllContentPages() {
23
- const pagePaths = await this.listAllContentPages();
24
- return Promise.all(pagePaths.map((_) => this.readPage(_)));
25
- }
26
- async getSecondaryContentPages(customPageType) {
27
- const pages = await this.getAllContentPages();
28
- return pages.filter(not(bySlug(INDEX_PAGE_SLUG))).filter(byCustomPageType(customPageType));
29
- }
30
- async getContentPageBySlug(slug) {
31
- const pages = await this.getAllContentPages();
32
- return pages.find(bySlug(slug));
33
- }
34
- async getIndexPage() {
35
- return this.getContentPageBySlug(INDEX_PAGE_SLUG);
36
- }
37
19
  async readPage(filePath) {
38
- if (!(filePath in this.cache)) {
39
- this.cache[filePath] = await transformContentPage(filePath, this.options);
40
- }
41
- return this.cache[filePath];
20
+ return JSON.parse(await readFile(generatedPagePath(filePath), 'utf-8'));
21
+ }
22
+ generatePage(filePath) {
23
+ return transformContentPage(filePath, this.options);
42
24
  }
43
25
  }
44
26
  //# sourceMappingURL=ContentPageRepository.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPageRepository.js","sourceRoot":"","sources":["../../src/content-page-repository/ContentPageRepository.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,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AM,CAAU,IAAI,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAE1D,YACmB,UAAiC;QAChD,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,QAAQ;KACpB;QAHgB,YAAO,GAAP,OAAO,CAGvB;IACA,CAAC;IAEJ,mBAAmB;QACjB,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,iBAAiB,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,YAAY,CAAC,QAAgB;QAC3B,OAAO,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Sharp } from 'sharp';
2
+ import type { ImageSize } from '../model/ImageSize';
3
+ import type { ImgAlignment } from '../model/Picture';
4
+ interface ImgAlignmentParams {
5
+ containerSize?: Partial<ImageSize>;
6
+ alignment?: ImgAlignment;
7
+ }
8
+ export declare const alignImg: ({ containerSize, alignment }: ImgAlignmentParams) => (chain: Sharp) => Promise<Sharp>;
9
+ export {};
@@ -0,0 +1,17 @@
1
+ import sharp from 'sharp';
2
+ export const alignImg = ({ containerSize, alignment }) => async (chain) => containerSize?.width && containerSize?.height && alignment
3
+ ? createTransparentBack(containerSize).composite([
4
+ {
5
+ input: await toBuffer(chain),
6
+ gravity: alignment,
7
+ },
8
+ ])
9
+ : chain;
10
+ const toBuffer = async (chain) => (await chain.toBuffer({ resolveWithObject: true })).data;
11
+ function createTransparentBack({ width, height }) {
12
+ const channels = 4;
13
+ const rgbaColor = 0x00000000;
14
+ const canvas = Buffer.alloc(width * height * channels, rgbaColor);
15
+ return sharp(canvas, { raw: { width, height, channels } });
16
+ }
17
+ //# sourceMappingURL=alignImg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alignImg.js","sourceRoot":"","sources":["../../src/content-page-repository/alignImg.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,MAAM,CAAC,MAAM,QAAQ,GACnB,CAAC,EAAE,aAAa,EAAE,SAAS,EAAsB,EAAE,EAAE,CACrD,KAAK,EAAE,KAAY,EAAkB,EAAE,CACrC,aAAa,EAAE,KAAK,IAAI,aAAa,EAAE,MAAM,IAAI,SAAS;IACxD,CAAC,CAAC,qBAAqB,CAAC,aAA0B,CAAC,CAAC,SAAS,CAAC;QAC1D;YACE,KAAK,EAAE,MAAM,QAAQ,CAAC,KAAK,CAAC;YAC5B,OAAO,EAAE,SAAS;SACnB;KACF,CAAC;IACJ,CAAC,CAAC,KAAK,CAAC;AAEd,MAAM,QAAQ,GAAG,KAAK,EAAE,KAAY,EAAE,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAElG,SAAS,qBAAqB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAa;IACzD,MAAM,QAAQ,GAAG,CAAC,CAAC;IACnB,MAAM,SAAS,GAAG,UAAU,CAAC;IAE7B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM,GAAG,QAAQ,EAAE,SAAS,CAAC,CAAC;IAElE,OAAO,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ImgSource } from '../model/Picture';
2
+ import type { TransformationOptions } from './TransformationOptions';
3
+ export declare function computeImgOutputPath(imgInputPath: string, { contentDir, publicDir, format, size, alignment }: TransformationOptions & ImgSource): string;
@@ -0,0 +1,12 @@
1
+ import path from 'path';
2
+ export function computeImgOutputPath(imgInputPath, { contentDir, publicDir, format, size, alignment }) {
3
+ const imgRelativePath = path.relative(contentDir, imgInputPath);
4
+ const imgDir = path.dirname(imgRelativePath);
5
+ const inputExt = path.extname(imgRelativePath);
6
+ const fileName = path.basename(imgRelativePath, inputExt);
7
+ const suffixParts = [size?.width, size?.height, alignment].filter(Boolean);
8
+ const suffix = suffixParts.length ? `-${suffixParts.join('-')}` : '';
9
+ const ext = format ? `.${format}` : inputExt;
10
+ return path.join(publicDir, imgDir, `${fileName}${suffix}${ext}`);
11
+ }
12
+ //# sourceMappingURL=computeImgOutputPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeImgOutputPath.js","sourceRoot":"","sources":["../../src/content-page-repository/computeImgOutputPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAIxB,MAAM,UAAU,oBAAoB,CAClC,YAAoB,EACpB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAqC;IAErF,MAAM,eAAe,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAEhE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAE7C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3E,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE7C,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ResizeOptions, Sharp } from 'sharp';
2
+ import type { ImageSize } from '../model/ImageSize';
3
+ export declare const resizeImg: (size?: Partial<ImageSize>, options?: ResizeOptions) => (chain: Sharp) => Sharp;
@@ -0,0 +1,13 @@
1
+ import sharp from 'sharp';
2
+ export const resizeImg = (size, options) => (chain) => size
3
+ ? chain.resize(size.width || null, size.height || null, {
4
+ /*
5
+ * Editor behaviour with one dimension present: resize by given dimension maintaining aspect ratio. (fit: contain)
6
+ * With two dimensions present: resize trying to fill given dimensions (fit: fill)
7
+ */
8
+ fit: size.width && size.height ? sharp.fit.fill : sharp.fit.contain,
9
+ background: { r: 0, g: 0, b: 0, alpha: 0 },
10
+ ...options,
11
+ })
12
+ : chain;
13
+ //# sourceMappingURL=resizeImg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizeImg.js","sourceRoot":"","sources":["../../src/content-page-repository/resizeImg.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,CAAC,MAAM,SAAS,GACpB,CAAC,IAAyB,EAAE,OAAuB,EAAE,EAAE,CACvD,CAAC,KAAY,EAAS,EAAE,CACtB,IAAI;IACF,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;QACpD;;;WAGG;QACH,GAAG,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO;QACnE,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QAC1C,GAAG,OAAO;KACX,CAAC;IACJ,CAAC,CAAC,KAAK,CAAC"}
@@ -1,3 +1,4 @@
1
1
  import type { ContentPageDef } from '../model/ContentPageDef';
2
2
  import type { TransformationOptions } from './TransformationOptions';
3
3
  export declare function transformContentPage(pagePath: string, options: TransformationOptions): Promise<ContentPageDef>;
4
+ export declare const generatedPagePath: (pagePath: string) => string;
@@ -5,32 +5,37 @@ import { transformHTML } from './transformHTML.js';
5
5
  import { transformMarkdown } from './transformMarkdown.js';
6
6
  import { transformPicture } from './transformPicture.js';
7
7
  const readFile = util.promisify(fs.readFile);
8
+ const writeFile = util.promisify(fs.writeFile);
9
+ const OUTPUT_SUFFIX = '.static';
8
10
  export async function transformContentPage(pagePath, options) {
9
11
  const content = await readFile(pagePath, 'utf8');
10
12
  // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
11
- return mapJSON(JSON.parse(content), async (value, [key]) => {
12
- const isMarkdown = typeof value === 'string' && key?.endsWith('__md');
13
- const isHTML = typeof value === 'string' && key?.endsWith('__html');
14
- if (isMarkdown) {
15
- return await transformMarkdown(value);
16
- }
17
- else if (isHTML) {
18
- return await transformHTML(value);
19
- }
20
- else if (isPicture(value)) {
21
- try {
22
- return await transformPicture(pagePath, value, options);
13
+ const result = await mapJSON(JSON.parse(content), async (value, [key]) => {
14
+ const isMarkdown = isString(value) && key?.endsWith('__md');
15
+ const isHTML = isString(value) && key?.endsWith('__html');
16
+ try {
17
+ if (isMarkdown) {
18
+ return await transformMarkdown(value);
23
19
  }
24
- catch (ex) {
25
- console.warn('Error while transforming picture on page: %s', pagePath);
26
- console.error(ex);
20
+ else if (isHTML) {
21
+ return await transformHTML(value);
27
22
  }
23
+ else if (isPicture(value)) {
24
+ return await transformPicture(value, pagePath, options);
25
+ }
26
+ }
27
+ catch (ex) {
28
+ console.warn(`Error while transforming field "${key}" on page: ${pagePath}`);
29
+ console.error(ex);
28
30
  }
29
31
  return value;
30
32
  });
33
+ await writeFile(generatedPagePath(pagePath), JSON.stringify(result), 'utf-8');
34
+ return result;
31
35
  }
32
- const isLocalPath = (_) => isString(_) && _.length < 512 && !isURL(_);
33
- const isString = (_) => Boolean(_ && typeof _ === 'string');
34
- const isURL = (src) => ['data:', 'https:', 'http:'].some((proto) => src.startsWith(proto));
36
+ export const generatedPagePath = (pagePath) => `${pagePath}${OUTPUT_SUFFIX}`;
35
37
  const isPicture = (_) => Boolean(_ && isLocalPath(_?.src));
38
+ const isLocalPath = (_) => isString(_) && _.length < 1024 && !isURL(_);
39
+ const isURL = (src) => ['data:', 'https:', 'http:'].some((proto) => src.startsWith(proto));
40
+ const isString = (_) => Boolean(_ && typeof _ === 'string');
36
41
  //# sourceMappingURL=transformContentPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformContentPage.js","sourceRoot":"","sources":["../../src/content-page-repository/transformContentPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,OAA8B;IAE9B,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEjD,iEAAiE;IACjE,OAAO,OAAO,CAAiB,IAAI,CAAC,KAAK,CAA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AQ,GAAG,CAAC,CAAM,EAAe,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import type { ImageSize } from '../model/ImageSize';
2
2
  import type { ImgSource } from '../model/Picture';
3
3
  import type { TransformationOptions } from './TransformationOptions';
4
- declare type TransformImgParams = {
5
- pagePath: string;
6
- src: string;
4
+ declare type ImgOutputPath = string;
5
+ declare type TransformationTaskKey = ImgOutputPath;
6
+ declare type TransformationTasksCache = Map<TransformationTaskKey, Promise<ImgOutputPath>>;
7
+ declare type TransformImgOptions = TransformationOptions & ImgSource & {
7
8
  containerSize?: ImageSize;
8
- transformationOptions: TransformationOptions & ImgSource;
9
+ cache?: TransformationTasksCache;
9
10
  };
10
- export declare function transformImg({ pagePath, src, containerSize, transformationOptions, }: TransformImgParams): Promise<string>;
11
+ export declare function transformImg(src: string, pagePath: string, options: TransformImgOptions): ImgOutputPath | Promise<ImgOutputPath>;
11
12
  export {};