@redneckz/wildless-cms-uni-blocks 0.9.11 → 0.9.13

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 (350) hide show
  1. package/bin/migrateContentUnit.js +1 -1
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +131 -56
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
  6. package/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  7. package/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
  8. package/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
  9. package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  10. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  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/Footer/MediaButton.d.ts +3 -4
  44. package/dist/components/Footer/MediaButton.js.map +1 -1
  45. package/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
  46. package/dist/content-page-repository/ContentPageRepository.js +7 -25
  47. package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  48. package/dist/content-page-repository/alignImg.d.ts +9 -0
  49. package/dist/content-page-repository/alignImg.js +23 -0
  50. package/dist/content-page-repository/alignImg.js.map +1 -0
  51. package/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
  52. package/dist/content-page-repository/computeImgOutputPath.js +18 -0
  53. package/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
  54. package/dist/content-page-repository/resizeImg.d.ts +3 -0
  55. package/dist/content-page-repository/resizeImg.js +19 -0
  56. package/dist/content-page-repository/resizeImg.js.map +1 -0
  57. package/dist/content-page-repository/transformContentPage.d.ts +1 -0
  58. package/dist/content-page-repository/transformContentPage.js +25 -19
  59. package/dist/content-page-repository/transformContentPage.js.map +1 -1
  60. package/dist/content-page-repository/transformImg.d.ts +6 -5
  61. package/dist/content-page-repository/transformImg.js +26 -76
  62. package/dist/content-page-repository/transformImg.js.map +1 -1
  63. package/dist/content-page-repository/transformPicture.d.ts +1 -1
  64. package/dist/content-page-repository/transformPicture.js +8 -16
  65. package/dist/content-page-repository/transformPicture.js.map +1 -1
  66. package/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  67. package/dist/ui-kit/InputListRange/InputListRange.js +41 -0
  68. package/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
  69. package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  70. package/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  71. package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  72. package/dist/ui-kit/Select/Select.js +2 -1
  73. package/dist/ui-kit/Select/Select.js.map +1 -1
  74. package/dist/utils/arrayByRange.d.ts +1 -0
  75. package/dist/utils/arrayByRange.js +5 -0
  76. package/dist/utils/arrayByRange.js.map +1 -0
  77. package/dist/utils/isPictureSizeEmpty.d.ts +2 -2
  78. package/dist/utils/isPictureSizeEmpty.js +1 -1
  79. package/dist/utils/isPictureSizeEmpty.js.map +1 -1
  80. package/dist/utils/mergeIntervals.d.ts +1 -0
  81. package/dist/utils/mergeIntervals.js +20 -0
  82. package/dist/utils/mergeIntervals.js.map +1 -0
  83. package/lib/common.css +1 -1
  84. package/lib/components/Calculator/CalculatorContent.d.ts +18 -17
  85. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  86. package/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  87. package/lib/components/Calculator/DepositCalculatorForm.js +22 -12
  88. package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  89. package/lib/components/Calculator/constants.js +1 -1
  90. package/lib/components/Calculator/constants.js.map +1 -1
  91. package/lib/components/Calculator/rangeHelpers.d.ts +1 -0
  92. package/lib/components/Calculator/rangeHelpers.js +2 -0
  93. package/lib/components/Calculator/rangeHelpers.js.map +1 -1
  94. package/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
  95. package/lib/components/Calculator/renderMonthsInput.js +3 -2
  96. package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  97. package/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
  98. package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  99. package/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  100. package/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
  101. package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  102. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  103. package/lib/components/Footer/MediaButton.d.ts +3 -4
  104. package/lib/components/Footer/MediaButton.js.map +1 -1
  105. package/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
  106. package/lib/content-page-repository/ContentPageRepository.js +8 -26
  107. package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  108. package/lib/content-page-repository/alignImg.d.ts +9 -0
  109. package/lib/content-page-repository/alignImg.js +17 -0
  110. package/lib/content-page-repository/alignImg.js.map +1 -0
  111. package/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
  112. package/lib/content-page-repository/computeImgOutputPath.js +12 -0
  113. package/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
  114. package/lib/content-page-repository/resizeImg.d.ts +3 -0
  115. package/lib/content-page-repository/resizeImg.js +13 -0
  116. package/lib/content-page-repository/resizeImg.js.map +1 -0
  117. package/lib/content-page-repository/transformContentPage.d.ts +1 -0
  118. package/lib/content-page-repository/transformContentPage.js +23 -18
  119. package/lib/content-page-repository/transformContentPage.js.map +1 -1
  120. package/lib/content-page-repository/transformImg.d.ts +6 -5
  121. package/lib/content-page-repository/transformImg.js +26 -76
  122. package/lib/content-page-repository/transformImg.js.map +1 -1
  123. package/lib/content-page-repository/transformPicture.d.ts +1 -1
  124. package/lib/content-page-repository/transformPicture.js +8 -16
  125. package/lib/content-page-repository/transformPicture.js.map +1 -1
  126. package/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  127. package/lib/ui-kit/InputListRange/InputListRange.js +39 -0
  128. package/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
  129. package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  130. package/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  131. package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  132. package/lib/ui-kit/Select/Select.js +2 -1
  133. package/lib/ui-kit/Select/Select.js.map +1 -1
  134. package/lib/utils/arrayByRange.d.ts +1 -0
  135. package/lib/utils/arrayByRange.js +2 -0
  136. package/lib/utils/arrayByRange.js.map +1 -0
  137. package/lib/utils/isPictureSizeEmpty.d.ts +2 -2
  138. package/lib/utils/isPictureSizeEmpty.js +1 -1
  139. package/lib/utils/isPictureSizeEmpty.js.map +1 -1
  140. package/lib/utils/mergeIntervals.d.ts +1 -0
  141. package/lib/utils/mergeIntervals.js +17 -0
  142. package/lib/utils/mergeIntervals.js.map +1 -0
  143. package/mobile/bundle/bundle.umd.js +1 -1
  144. package/mobile/bundle/bundle.umd.min.js +1 -1
  145. package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
  146. package/mobile/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  147. package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
  148. package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
  149. package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  150. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  151. package/mobile/bundle/components/Footer/MediaButton.d.ts +3 -4
  152. package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +1 -5
  153. package/mobile/bundle/content-page-repository/alignImg.d.ts +9 -0
  154. package/mobile/bundle/content-page-repository/computeImgOutputPath.d.ts +3 -0
  155. package/mobile/bundle/content-page-repository/resizeImg.d.ts +3 -0
  156. package/mobile/bundle/content-page-repository/transformContentPage.d.ts +1 -0
  157. package/mobile/bundle/content-page-repository/transformImg.d.ts +6 -5
  158. package/mobile/bundle/content-page-repository/transformPicture.d.ts +1 -1
  159. package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  160. package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  161. package/mobile/bundle/utils/arrayByRange.d.ts +1 -0
  162. package/mobile/bundle/utils/isPictureSizeEmpty.d.ts +2 -2
  163. package/mobile/bundle/utils/mergeIntervals.d.ts +1 -0
  164. package/mobile/dist/components/Calculator/CalculatorContent.d.ts +18 -17
  165. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  166. package/mobile/dist/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  167. package/mobile/dist/components/Calculator/DepositCalculatorForm.js +21 -11
  168. package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
  169. package/mobile/dist/components/Calculator/constants.js +1 -1
  170. package/mobile/dist/components/Calculator/constants.js.map +1 -1
  171. package/mobile/dist/components/Calculator/rangeHelpers.d.ts +1 -0
  172. package/mobile/dist/components/Calculator/rangeHelpers.js +4 -1
  173. package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
  174. package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +1 -0
  175. package/mobile/dist/components/Calculator/renderMonthsInput.js +3 -2
  176. package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
  177. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +27 -29
  178. package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  179. package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  180. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +22 -6
  181. package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  182. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  183. package/mobile/dist/components/Footer/MediaButton.d.ts +3 -4
  184. package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
  185. package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
  186. package/mobile/dist/content-page-repository/ContentPageRepository.js +7 -25
  187. package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
  188. package/mobile/dist/content-page-repository/alignImg.d.ts +9 -0
  189. package/mobile/dist/content-page-repository/alignImg.js +23 -0
  190. package/mobile/dist/content-page-repository/alignImg.js.map +1 -0
  191. package/mobile/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
  192. package/mobile/dist/content-page-repository/computeImgOutputPath.js +18 -0
  193. package/mobile/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
  194. package/mobile/dist/content-page-repository/resizeImg.d.ts +3 -0
  195. package/mobile/dist/content-page-repository/resizeImg.js +19 -0
  196. package/mobile/dist/content-page-repository/resizeImg.js.map +1 -0
  197. package/mobile/dist/content-page-repository/transformContentPage.d.ts +1 -0
  198. package/mobile/dist/content-page-repository/transformContentPage.js +25 -19
  199. package/mobile/dist/content-page-repository/transformContentPage.js.map +1 -1
  200. package/mobile/dist/content-page-repository/transformImg.d.ts +6 -5
  201. package/mobile/dist/content-page-repository/transformImg.js +26 -76
  202. package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
  203. package/mobile/dist/content-page-repository/transformPicture.d.ts +1 -1
  204. package/mobile/dist/content-page-repository/transformPicture.js +8 -16
  205. package/mobile/dist/content-page-repository/transformPicture.js.map +1 -1
  206. package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  207. package/mobile/dist/ui-kit/InputListRange/InputListRange.js +41 -0
  208. package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
  209. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  210. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  211. package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  212. package/mobile/dist/ui-kit/Select/Select.js +2 -1
  213. package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
  214. package/mobile/dist/utils/arrayByRange.d.ts +1 -0
  215. package/mobile/dist/utils/arrayByRange.js +5 -0
  216. package/mobile/dist/utils/arrayByRange.js.map +1 -0
  217. package/mobile/dist/utils/isPictureSizeEmpty.d.ts +2 -2
  218. package/mobile/dist/utils/isPictureSizeEmpty.js +1 -1
  219. package/mobile/dist/utils/isPictureSizeEmpty.js.map +1 -1
  220. package/mobile/dist/utils/mergeIntervals.d.ts +1 -0
  221. package/mobile/dist/utils/mergeIntervals.js +20 -0
  222. package/mobile/dist/utils/mergeIntervals.js.map +1 -0
  223. package/mobile/lib/components/Calculator/CalculatorContent.d.ts +18 -17
  224. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  225. package/mobile/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
  226. package/mobile/lib/components/Calculator/DepositCalculatorForm.js +22 -12
  227. package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
  228. package/mobile/lib/components/Calculator/constants.js +1 -1
  229. package/mobile/lib/components/Calculator/constants.js.map +1 -1
  230. package/mobile/lib/components/Calculator/rangeHelpers.d.ts +1 -0
  231. package/mobile/lib/components/Calculator/rangeHelpers.js +2 -0
  232. package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
  233. package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
  234. package/mobile/lib/components/Calculator/renderMonthsInput.js +3 -2
  235. package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
  236. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
  237. package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
  238. package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
  239. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
  240. package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
  241. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
  242. package/mobile/lib/components/Footer/MediaButton.d.ts +3 -4
  243. package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
  244. package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
  245. package/mobile/lib/content-page-repository/ContentPageRepository.js +8 -26
  246. package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
  247. package/mobile/lib/content-page-repository/alignImg.d.ts +9 -0
  248. package/mobile/lib/content-page-repository/alignImg.js +17 -0
  249. package/mobile/lib/content-page-repository/alignImg.js.map +1 -0
  250. package/mobile/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
  251. package/mobile/lib/content-page-repository/computeImgOutputPath.js +12 -0
  252. package/mobile/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
  253. package/mobile/lib/content-page-repository/resizeImg.d.ts +3 -0
  254. package/mobile/lib/content-page-repository/resizeImg.js +13 -0
  255. package/mobile/lib/content-page-repository/resizeImg.js.map +1 -0
  256. package/mobile/lib/content-page-repository/transformContentPage.d.ts +1 -0
  257. package/mobile/lib/content-page-repository/transformContentPage.js +23 -18
  258. package/mobile/lib/content-page-repository/transformContentPage.js.map +1 -1
  259. package/mobile/lib/content-page-repository/transformImg.d.ts +6 -5
  260. package/mobile/lib/content-page-repository/transformImg.js +26 -76
  261. package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
  262. package/mobile/lib/content-page-repository/transformPicture.d.ts +1 -1
  263. package/mobile/lib/content-page-repository/transformPicture.js +8 -16
  264. package/mobile/lib/content-page-repository/transformPicture.js.map +1 -1
  265. package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
  266. package/mobile/lib/ui-kit/InputListRange/InputListRange.js +39 -0
  267. package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
  268. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
  269. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
  270. package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
  271. package/mobile/lib/ui-kit/Select/Select.js +2 -1
  272. package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
  273. package/mobile/lib/utils/arrayByRange.d.ts +1 -0
  274. package/mobile/lib/utils/arrayByRange.js +2 -0
  275. package/mobile/lib/utils/arrayByRange.js.map +1 -0
  276. package/mobile/lib/utils/isPictureSizeEmpty.d.ts +2 -2
  277. package/mobile/lib/utils/isPictureSizeEmpty.js +1 -1
  278. package/mobile/lib/utils/isPictureSizeEmpty.js.map +1 -1
  279. package/mobile/lib/utils/mergeIntervals.d.ts +1 -0
  280. package/mobile/lib/utils/mergeIntervals.js +17 -0
  281. package/mobile/lib/utils/mergeIntervals.js.map +1 -0
  282. package/mobile/src/components/Calculator/Calculator.example.json +3 -1
  283. package/mobile/src/components/Calculator/CalculatorContent.ts +20 -19
  284. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
  285. package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
  286. package/mobile/src/components/Calculator/constants.ts +1 -1
  287. package/mobile/src/components/Calculator/rangeHelpers.ts +10 -0
  288. package/mobile/src/components/Calculator/renderMonthsInput.tsx +13 -2
  289. package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
  290. package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
  291. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
  292. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
  293. package/mobile/src/components/Footer/MediaButton.tsx +3 -5
  294. package/mobile/src/content-page-repository/ContentPageRepository.ts +8 -40
  295. package/mobile/src/content-page-repository/alignImg.ts +32 -0
  296. package/mobile/src/content-page-repository/computeImgOutputPath.ts +20 -0
  297. package/mobile/src/content-page-repository/resizeImg.ts +18 -0
  298. package/mobile/src/content-page-repository/transformContentPage.ts +25 -18
  299. package/mobile/src/content-page-repository/transformImg.ts +49 -121
  300. package/mobile/src/content-page-repository/transformPicture.ts +9 -21
  301. package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
  302. package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
  303. package/mobile/src/ui-kit/Select/Select.tsx +8 -1
  304. package/mobile/src/utils/arrayByRange.ts +4 -0
  305. package/mobile/src/utils/isPictureSizeEmpty.ts +3 -3
  306. package/mobile/src/utils/mergeIntervals.ts +19 -0
  307. package/package.json +1 -1
  308. package/src/components/Calculator/Calculator.example.json +3 -1
  309. package/src/components/Calculator/Calculator.fixture.tsx +4 -0
  310. package/src/components/Calculator/CalculatorContent.ts +20 -19
  311. package/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
  312. package/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
  313. package/src/components/Calculator/constants.ts +1 -1
  314. package/src/components/Calculator/rangeHelpers.ts +10 -0
  315. package/src/components/Calculator/renderMonthsInput.tsx +13 -2
  316. package/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
  317. package/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
  318. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
  319. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +0 -9
  320. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
  321. package/src/components/Footer/MediaButton.tsx +3 -5
  322. package/src/content-page-repository/ContentPageRepository.ts +8 -40
  323. package/src/content-page-repository/alignImg.ts +32 -0
  324. package/src/content-page-repository/computeImgOutputPath.ts +20 -0
  325. package/src/content-page-repository/resizeImg.ts +18 -0
  326. package/src/content-page-repository/transformContentPage.ts +25 -18
  327. package/src/content-page-repository/transformImg.ts +49 -121
  328. package/src/content-page-repository/transformPicture.ts +9 -21
  329. package/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
  330. package/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
  331. package/src/ui-kit/Select/Select.tsx +8 -1
  332. package/src/utils/arrayByRange.ts +4 -0
  333. package/src/utils/isPictureSizeEmpty.ts +3 -3
  334. package/src/utils/mergeIntervals.ts +19 -0
  335. package/bundle/content-page-repository/transformImgPath.d.ts +0 -8
  336. package/dist/content-page-repository/transformImgPath.d.ts +0 -8
  337. package/dist/content-page-repository/transformImgPath.js +0 -22
  338. package/dist/content-page-repository/transformImgPath.js.map +0 -1
  339. package/lib/content-page-repository/transformImgPath.d.ts +0 -8
  340. package/lib/content-page-repository/transformImgPath.js +0 -16
  341. package/lib/content-page-repository/transformImgPath.js.map +0 -1
  342. package/mobile/bundle/content-page-repository/transformImgPath.d.ts +0 -8
  343. package/mobile/dist/content-page-repository/transformImgPath.d.ts +0 -8
  344. package/mobile/dist/content-page-repository/transformImgPath.js +0 -22
  345. package/mobile/dist/content-page-repository/transformImgPath.js.map +0 -1
  346. package/mobile/lib/content-page-repository/transformImgPath.d.ts +0 -8
  347. package/mobile/lib/content-page-repository/transformImgPath.js +0 -16
  348. package/mobile/lib/content-page-repository/transformImgPath.js.map +0 -1
  349. package/mobile/src/content-page-repository/transformImgPath.ts +0 -30
  350. package/src/content-page-repository/transformImgPath.ts +0 -30
@@ -5,42 +5,30 @@ import type { TransformationOptions } from './TransformationOptions';
5
5
  import { transformImg } from './transformImg';
6
6
 
7
7
  export async function transformPicture(
8
- pagePath: string,
9
8
  picture: Picture,
9
+ pagePath: string,
10
10
  options: TransformationOptions,
11
11
  ): Promise<Picture> {
12
- const sources = picture.sources || [];
13
12
  const src = picture?.src || '';
14
13
 
15
- const transformedPicture = await transformImg({
16
- pagePath,
17
- src,
18
- transformationOptions: { ...options, ...picture },
19
- });
20
-
21
- const { width, height } = await sharp(
22
- path.resolve(options.publicDir, transformedPicture),
23
- ).metadata();
14
+ const transformedImgPath = await transformImg(src, pagePath, { ...options, ...picture });
24
15
 
16
+ const { width, height } = await sharp(transformedImgPath).metadata();
25
17
  const containerSize = width && height ? { width, height } : undefined;
26
18
 
19
+ const sources = picture.sources || [];
27
20
  const transformedSources = await Promise.all(
28
- sources.map((_) =>
29
- transformImg({
30
- pagePath,
31
- src,
32
- containerSize,
33
- transformationOptions: { ...options, ..._ },
34
- }),
35
- ),
21
+ sources.map((_) => transformImg(src, pagePath, { ...options, ..._, containerSize })),
36
22
  );
37
23
 
24
+ const imgPathToSrc = (_: string) => path.join('/', path.relative(options.publicDir, _));
25
+
38
26
  return {
39
27
  ...picture,
40
- src: path.join('/', transformedPicture),
28
+ src: imgPathToSrc(transformedImgPath),
41
29
  sources: transformedSources.map((_, i) => ({
42
30
  ...sources[i],
43
- src: path.join('/', _),
31
+ src: imgPathToSrc(_),
44
32
  size: { width, height },
45
33
  })),
46
34
  };
@@ -0,0 +1,99 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
3
+ import { clamp } from '../../utils/clamp';
4
+ import { getSanitizedValue } from '../../utils/getSanitizedValue';
5
+ import type { InputListRangeProps } from './InputListRangeProps';
6
+
7
+ const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
8
+
9
+ export const InputListRange = JSX<InputListRangeProps>(
10
+ ({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
11
+ const min = 0;
12
+ const max = list.length - 1;
13
+ const step = 1;
14
+
15
+ const handleTextChange: JSX.IntrinsicElements['input']['onChange'] = (e) => {
16
+ if (!onChange) {
17
+ return;
18
+ }
19
+ const newValue = parseInt(e.target.value);
20
+
21
+ const closetValue = list.reduce(function (prev, curr) {
22
+ return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
23
+ });
24
+
25
+ onChange(Number(getSanitizedValue(closetValue.toString())));
26
+ };
27
+
28
+ const handleRangeChange: JSX.IntrinsicElements['input']['onChange'] = (e) => {
29
+ if (!onChange) {
30
+ return;
31
+ }
32
+
33
+ const val = list.at(clamp(parseInt(e.target.value), min, max)) || 0;
34
+ onChange(Number(getSanitizedValue(val.toString())));
35
+ };
36
+
37
+ const valueIndex = list.findIndex((item) => item === value) || 0;
38
+ const inputStyle = {
39
+ backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
40
+ };
41
+
42
+ return (
43
+ <div className={className}>
44
+ <label className="block relative">
45
+ {title ? <span className="text-m-light text-primary-text">{title}</span> : null}
46
+ <input
47
+ className={`m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
48
+ outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`}
49
+ value={addSpacesBetweenNumbers(value)}
50
+ disabled={disabled}
51
+ onChange={handleTextChange}
52
+ onBlur={handleTextChange}
53
+ />
54
+ {list.length ? (
55
+ <div className="absolute w-full flex justify-between -bottom-[3px] px-4">
56
+ {list.map(renderTick(valueIndex, disabled))}
57
+ </div>
58
+ ) : null}
59
+ <div className="absolute inset-x-0 -bottom-1 px-4 leading-[18px]">
60
+ <input
61
+ className="box-border w-full m-0 cursor-pointer slider relative z-10"
62
+ type="range"
63
+ min={min}
64
+ max={max}
65
+ step={step}
66
+ value={valueIndex}
67
+ disabled={disabled}
68
+ onChange={handleRangeChange}
69
+ style={inputStyle}
70
+ />
71
+ </div>
72
+ </label>
73
+ {renderRangeCaption(items)}
74
+ </div>
75
+ );
76
+ },
77
+ );
78
+
79
+ const renderTick = (valueIndex: number, disabled: boolean) => (value: number, i: number) =>
80
+ (
81
+ <span
82
+ key={String(i)}
83
+ className={`w-2 h-2 rounded-full ${
84
+ valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'
85
+ }`}
86
+ />
87
+ );
88
+
89
+ function renderRangeCaption(items: string[]) {
90
+ return (
91
+ <div className="flex justify-between my-2">
92
+ {items.map((item, i) => (
93
+ <span key={String(i)} className="text-s-light text-secondary-text">
94
+ {item}
95
+ </span>
96
+ ))}
97
+ </div>
98
+ );
99
+ }
@@ -0,0 +1,11 @@
1
+ import type { ListContent } from '../List/ListContent';
2
+
3
+ export interface InputListRangeProps extends ListContent {
4
+ className?: string;
5
+ items?: string[];
6
+ list?: number[];
7
+ value?: number;
8
+ title?: string;
9
+ disabled?: boolean;
10
+ onChange?: (value: number) => void;
11
+ }
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useOutsideClick } from '../../hooks/useOutsideClick';
4
4
  import { LabelProps } from '../../model/HeadlineType';
5
+ import { Text } from '../../ui-kit/Text/Text';
5
6
  import { Icon } from '../Icon/Icon';
6
7
 
7
8
  export interface OptionProps {
@@ -39,7 +40,13 @@ export const Select = JSX<SelectProps>(
39
40
 
40
41
  return (
41
42
  <div className={`${className}`} ref={wrapperRef}>
42
- {label ? <span className="mb-2 flex text-primary-text">{label}</span> : null}
43
+ {label ? (
44
+ <div className="mb-2">
45
+ <Text size="text-m" color="text-primary-text" font="font-light">
46
+ {label}
47
+ </Text>
48
+ </div>
49
+ ) : null}
43
50
  <div className={`relative ${isOpen ? 'z-20' : 'z-10'}`}>
44
51
  <div
45
52
  className={`text-l flex justify-between items-center mb-0.5 text-primary-text cursor-pointer
@@ -0,0 +1,4 @@
1
+ export const arrayByRange = (start: number, stop: number, step = 1) =>
2
+ Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) =>
3
+ stop >= start ? start + index * step : start - index * step,
4
+ );
@@ -1,5 +1,5 @@
1
- import type { Picture } from '../model/Picture';
1
+ import type { ImageSize } from '../model/ImageSize';
2
2
 
3
- export function isPictureSizeEmpty(size: Picture['size']): boolean {
4
- return !(size?.width || size?.height);
3
+ export function isPictureSizeEmpty(size: Partial<ImageSize> | undefined): boolean {
4
+ return !size?.width && !size?.height;
5
5
  }
@@ -0,0 +1,19 @@
1
+ export const mergeIntervals = (intervals: number[][]): number[][] => {
2
+ const result = [...intervals];
3
+ result.sort(([a], [c]) => a - c);
4
+
5
+ let i = 1;
6
+
7
+ while (i < result.length) {
8
+ const [a, b] = result[i - 1];
9
+ const [c, d] = result[i];
10
+
11
+ if (b >= c) {
12
+ result.splice(i - 1, 2, [a, Math.max(b, d)]);
13
+ } else {
14
+ i++;
15
+ }
16
+ }
17
+
18
+ return result;
19
+ };
@@ -1,8 +0,0 @@
1
- import type { ImgSource } from '../model/Picture';
2
- import type { TransformationOptions } from './TransformationOptions';
3
- interface DirectoryParams {
4
- pageDir: string;
5
- contentDir: string;
6
- }
7
- export declare function transformImgPath(src: string, { pageDir, contentDir }: DirectoryParams, { format, size }: TransformationOptions & ImgSource): string;
8
- export {};
@@ -1,8 +0,0 @@
1
- import type { ImgSource } from '../model/Picture';
2
- import type { TransformationOptions } from './TransformationOptions';
3
- interface DirectoryParams {
4
- pageDir: string;
5
- contentDir: string;
6
- }
7
- export declare function transformImgPath(src: string, { pageDir, contentDir }: DirectoryParams, { format, size }: TransformationOptions & ImgSource): string;
8
- export {};
@@ -1,22 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.transformImgPath = void 0;
6
- const path_1 = __importDefault(require("path"));
7
- const isPictureSizeEmpty_1 = require("../utils/isPictureSizeEmpty");
8
- function transformImgPath(src, { pageDir, contentDir }, { format, size }) {
9
- const noTransform = (0, isPictureSizeEmpty_1.isPictureSizeEmpty)(size) && !format;
10
- if (noTransform) {
11
- return src;
12
- }
13
- const imgPath = path_1.default.relative(contentDir, path_1.default.join(pageDir, src));
14
- const imgDir = path_1.default.dirname(imgPath);
15
- const fileName = path_1.default.basename(src, path_1.default.extname(src));
16
- const fileSizes = [size?.width, size?.height].filter(Boolean);
17
- const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
18
- const ext = format ? String(format) : 'webp';
19
- return path_1.default.join(imgDir, `${fileName}${suffix}.${ext}`);
20
- }
21
- exports.transformImgPath = transformImgPath;
22
- //# sourceMappingURL=transformImgPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformImgPath.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImgPath.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,oEAAiE;AAQjE,SAAgB,gBAAgB,CAC9B,GAAW,EACX,EAAE,OAAO,EAAE,UAAU,EAAmB,EACxC,EAAE,MAAM,EAAE,IAAI,EAAqC;IAEnD,MAAM,WAAW,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACxD,IAAI,WAAW,EAAE;QACf,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,OAAO,GAAG,cAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAErC,MAAM,QAAQ,GAAG,cAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE7C,OAAO,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;AAC1D,CAAC;AAnBD,4CAmBC"}
@@ -1,8 +0,0 @@
1
- import type { ImgSource } from '../model/Picture';
2
- import type { TransformationOptions } from './TransformationOptions';
3
- interface DirectoryParams {
4
- pageDir: string;
5
- contentDir: string;
6
- }
7
- export declare function transformImgPath(src: string, { pageDir, contentDir }: DirectoryParams, { format, size }: TransformationOptions & ImgSource): string;
8
- export {};
@@ -1,16 +0,0 @@
1
- import path from 'path';
2
- import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty.js';
3
- export function transformImgPath(src, { pageDir, contentDir }, { format, size }) {
4
- const noTransform = isPictureSizeEmpty(size) && !format;
5
- if (noTransform) {
6
- return src;
7
- }
8
- const imgPath = path.relative(contentDir, path.join(pageDir, src));
9
- const imgDir = path.dirname(imgPath);
10
- const fileName = path.basename(src, path.extname(src));
11
- const fileSizes = [size?.width, size?.height].filter(Boolean);
12
- const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
13
- const ext = format ? String(format) : 'webp';
14
- return path.join(imgDir, `${fileName}${suffix}.${ext}`);
15
- }
16
- //# sourceMappingURL=transformImgPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformImgPath.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImgPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAQjE,MAAM,UAAU,gBAAgB,CAC9B,GAAW,EACX,EAAE,OAAO,EAAE,UAAU,EAAmB,EACxC,EAAE,MAAM,EAAE,IAAI,EAAqC;IAEnD,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACxD,IAAI,WAAW,EAAE;QACf,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE7C,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { ImgSource } from '../model/Picture';
2
- import type { TransformationOptions } from './TransformationOptions';
3
- interface DirectoryParams {
4
- pageDir: string;
5
- contentDir: string;
6
- }
7
- export declare function transformImgPath(src: string, { pageDir, contentDir }: DirectoryParams, { format, size }: TransformationOptions & ImgSource): string;
8
- export {};
@@ -1,8 +0,0 @@
1
- import type { ImgSource } from '../model/Picture';
2
- import type { TransformationOptions } from './TransformationOptions';
3
- interface DirectoryParams {
4
- pageDir: string;
5
- contentDir: string;
6
- }
7
- export declare function transformImgPath(src: string, { pageDir, contentDir }: DirectoryParams, { format, size }: TransformationOptions & ImgSource): string;
8
- export {};
@@ -1,22 +0,0 @@
1
- var __importDefault = (this && this.__importDefault) || function (mod) {
2
- return (mod && mod.__esModule) ? mod : { "default": mod };
3
- };
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.transformImgPath = void 0;
6
- const path_1 = __importDefault(require("path"));
7
- const isPictureSizeEmpty_1 = require("../utils/isPictureSizeEmpty");
8
- function transformImgPath(src, { pageDir, contentDir }, { format, size }) {
9
- const noTransform = (0, isPictureSizeEmpty_1.isPictureSizeEmpty)(size) && !format;
10
- if (noTransform) {
11
- return src;
12
- }
13
- const imgPath = path_1.default.relative(contentDir, path_1.default.join(pageDir, src));
14
- const imgDir = path_1.default.dirname(imgPath);
15
- const fileName = path_1.default.basename(src, path_1.default.extname(src));
16
- const fileSizes = [size?.width, size?.height].filter(Boolean);
17
- const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
18
- const ext = format ? String(format) : 'webp';
19
- return path_1.default.join(imgDir, `${fileName}${suffix}.${ext}`);
20
- }
21
- exports.transformImgPath = transformImgPath;
22
- //# sourceMappingURL=transformImgPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformImgPath.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImgPath.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,oEAAiE;AAQjE,SAAgB,gBAAgB,CAC9B,GAAW,EACX,EAAE,OAAO,EAAE,UAAU,EAAmB,EACxC,EAAE,MAAM,EAAE,IAAI,EAAqC;IAEnD,MAAM,WAAW,GAAG,IAAA,uCAAkB,EAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACxD,IAAI,WAAW,EAAE;QACf,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,OAAO,GAAG,cAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAErC,MAAM,QAAQ,GAAG,cAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE7C,OAAO,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;AAC1D,CAAC;AAnBD,4CAmBC"}
@@ -1,8 +0,0 @@
1
- import type { ImgSource } from '../model/Picture';
2
- import type { TransformationOptions } from './TransformationOptions';
3
- interface DirectoryParams {
4
- pageDir: string;
5
- contentDir: string;
6
- }
7
- export declare function transformImgPath(src: string, { pageDir, contentDir }: DirectoryParams, { format, size }: TransformationOptions & ImgSource): string;
8
- export {};
@@ -1,16 +0,0 @@
1
- import path from 'path';
2
- import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty.js';
3
- export function transformImgPath(src, { pageDir, contentDir }, { format, size }) {
4
- const noTransform = isPictureSizeEmpty(size) && !format;
5
- if (noTransform) {
6
- return src;
7
- }
8
- const imgPath = path.relative(contentDir, path.join(pageDir, src));
9
- const imgDir = path.dirname(imgPath);
10
- const fileName = path.basename(src, path.extname(src));
11
- const fileSizes = [size?.width, size?.height].filter(Boolean);
12
- const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
13
- const ext = format ? String(format) : 'webp';
14
- return path.join(imgDir, `${fileName}${suffix}.${ext}`);
15
- }
16
- //# sourceMappingURL=transformImgPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transformImgPath.js","sourceRoot":"","sources":["../../src/content-page-repository/transformImgPath.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAQjE,MAAM,UAAU,gBAAgB,CAC9B,GAAW,EACX,EAAE,OAAO,EAAE,UAAU,EAAmB,EACxC,EAAE,MAAM,EAAE,IAAI,EAAqC;IAEnD,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IACxD,IAAI,WAAW,EAAE;QACf,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE7C,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC;AAC1D,CAAC"}
@@ -1,30 +0,0 @@
1
- import path from 'path';
2
- import type { ImgSource } from '../model/Picture';
3
- import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
4
- import type { TransformationOptions } from './TransformationOptions';
5
-
6
- interface DirectoryParams {
7
- pageDir: string;
8
- contentDir: string;
9
- }
10
-
11
- export function transformImgPath(
12
- src: string,
13
- { pageDir, contentDir }: DirectoryParams,
14
- { format, size }: TransformationOptions & ImgSource,
15
- ): string {
16
- const noTransform = isPictureSizeEmpty(size) && !format;
17
- if (noTransform) {
18
- return src;
19
- }
20
-
21
- const imgPath = path.relative(contentDir, path.join(pageDir, src));
22
- const imgDir = path.dirname(imgPath);
23
-
24
- const fileName = path.basename(src, path.extname(src));
25
- const fileSizes = [size?.width, size?.height].filter(Boolean);
26
- const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
27
- const ext = format ? String(format) : 'webp';
28
-
29
- return path.join(imgDir, `${fileName}${suffix}.${ext}`);
30
- }
@@ -1,30 +0,0 @@
1
- import path from 'path';
2
- import type { ImgSource } from '../model/Picture';
3
- import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
4
- import type { TransformationOptions } from './TransformationOptions';
5
-
6
- interface DirectoryParams {
7
- pageDir: string;
8
- contentDir: string;
9
- }
10
-
11
- export function transformImgPath(
12
- src: string,
13
- { pageDir, contentDir }: DirectoryParams,
14
- { format, size }: TransformationOptions & ImgSource,
15
- ): string {
16
- const noTransform = isPictureSizeEmpty(size) && !format;
17
- if (noTransform) {
18
- return src;
19
- }
20
-
21
- const imgPath = path.relative(contentDir, path.join(pageDir, src));
22
- const imgDir = path.dirname(imgPath);
23
-
24
- const fileName = path.basename(src, path.extname(src));
25
- const fileSizes = [size?.width, size?.height].filter(Boolean);
26
- const suffix = fileSizes.length ? `-${fileSizes.join('-')}` : '';
27
- const ext = format ? String(format) : 'webp';
28
-
29
- return path.join(imgDir, `${fileName}${suffix}.${ext}`);
30
- }