@redneckz/wildless-cms-uni-blocks 0.8.28 → 0.8.30

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 (484) hide show
  1. package/bin/migration-scripts/0.8.29.js +41 -0
  2. package/bundle/blocks.schema.json +1 -1
  3. package/bundle/bundle.umd.js +127 -97
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +2 -3
  6. package/bundle/components/ImgBlock/ImgBlockContent.d.ts +1 -1
  7. package/bundle/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  8. package/bundle/components/TariffsTable/TariffsTableContent.d.ts +3 -3
  9. package/bundle/components/TextBlock/TextBlockContent.d.ts +2 -7
  10. package/bundle/{services/sitemap → hooks}/fallbackWCMSResource.d.ts +1 -1
  11. package/bundle/hooks/useLink.d.ts +1 -1
  12. package/bundle/services/{sitemap/search → search}/jaroWinklerDistance.d.ts +0 -0
  13. package/bundle/services/{sitemap/search → search}/joinMaps.d.ts +0 -0
  14. package/bundle/services/{sitemap/search → search}/search.d.ts +0 -0
  15. package/bundle/services/{sitemap/search → search}/textRank.d.ts +0 -0
  16. package/bundle/services/{sitemap/search → search}/tokenize.d.ts +0 -0
  17. package/{dist/services/sitemap → bundle/services/search}/useSearch.d.ts +1 -1
  18. package/bundle/ui-kit/Button/ButtonProps.d.ts +2 -3
  19. package/bundle/ui-kit/Dialog/CloseButton.d.ts +7 -0
  20. package/bundle/ui-kit/Dialog/Dialog.d.ts +7 -0
  21. package/bundle/ui-kit/Location/LocationProps.d.ts +2 -2
  22. package/bundle/{model → ui-kit}/PreventableEvent.d.ts +0 -0
  23. package/bundle/ui-kit/SearchBar/SearchBarInner.d.ts +2 -3
  24. package/bundle/ui-kit/SearchBar/SearchBarInput.d.ts +9 -0
  25. package/bundle/{components/Footer → ui-kit/Sitemap}/Sitemap.d.ts +2 -2
  26. package/bundle/ui-kit/TopItem/TopItem.d.ts +1 -1
  27. package/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  28. package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  29. package/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  30. package/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  31. package/dist/components/Blocks.js +0 -2
  32. package/dist/components/Blocks.js.map +1 -1
  33. package/dist/components/Footer/Footer.fallback.js +1 -1
  34. package/dist/components/Footer/Footer.fallback.js.map +1 -1
  35. package/dist/components/Footer/Footer.js +2 -21
  36. package/dist/components/Footer/Footer.js.map +1 -1
  37. package/dist/components/Header/Header.fallback.js +1 -1
  38. package/dist/components/Header/Header.fallback.js.map +1 -1
  39. package/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  40. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  41. package/dist/components/Header/HeaderSecondaryMenuButton.d.ts +2 -3
  42. package/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  43. package/dist/components/ImgBlock/ImgBlockContent.d.ts +1 -1
  44. package/dist/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  45. package/dist/components/TariffsTable/TariffsTableContent.d.ts +3 -3
  46. package/dist/components/TextBlock/TextBlockContent.d.ts +2 -7
  47. package/dist/{services/sitemap → hooks}/fallbackWCMSResource.d.ts +1 -1
  48. package/dist/{services/sitemap → hooks}/fallbackWCMSResource.js +0 -0
  49. package/dist/hooks/fallbackWCMSResource.js.map +1 -0
  50. package/dist/hooks/useLink.d.ts +1 -1
  51. package/dist/services/{sitemap/search → search}/jaroWinklerDistance.d.ts +0 -0
  52. package/dist/services/{sitemap/search → search}/jaroWinklerDistance.js +0 -0
  53. package/dist/services/search/jaroWinklerDistance.js.map +1 -0
  54. package/dist/services/{sitemap/search → search}/joinMaps.d.ts +0 -0
  55. package/dist/services/{sitemap/search → search}/joinMaps.js +0 -0
  56. package/dist/services/search/joinMaps.js.map +1 -0
  57. package/dist/services/{sitemap/search → search}/search.d.ts +0 -0
  58. package/{mobile/dist/services/sitemap → dist/services}/search/search.js +2 -2
  59. package/dist/services/search/search.js.map +1 -0
  60. package/dist/services/{sitemap/search → search}/textRank.d.ts +0 -0
  61. package/{mobile/dist/services/sitemap → dist/services}/search/textRank.js +2 -2
  62. package/dist/services/search/textRank.js.map +1 -0
  63. package/dist/services/{sitemap/search → search}/tokenize.d.ts +0 -0
  64. package/dist/services/{sitemap/search → search}/tokenize.js +0 -0
  65. package/dist/services/search/tokenize.js.map +1 -0
  66. package/{lib/services/sitemap → dist/services/search}/useSearch.d.ts +1 -1
  67. package/{mobile/dist/services/sitemap → dist/services/search}/useSearch.js +1 -1
  68. package/dist/services/search/useSearch.js.map +1 -0
  69. package/dist/ui-kit/Button/ButtonProps.d.ts +2 -3
  70. package/dist/ui-kit/Dialog/CloseButton.d.ts +7 -0
  71. package/dist/ui-kit/Dialog/CloseButton.js +8 -0
  72. package/dist/ui-kit/Dialog/CloseButton.js.map +1 -0
  73. package/dist/ui-kit/Dialog/Dialog.d.ts +7 -0
  74. package/dist/ui-kit/Dialog/Dialog.js +26 -0
  75. package/dist/ui-kit/Dialog/Dialog.js.map +1 -0
  76. package/dist/ui-kit/Location/Location.js +9 -11
  77. package/dist/ui-kit/Location/Location.js.map +1 -1
  78. package/dist/ui-kit/Location/LocationProps.d.ts +2 -2
  79. package/dist/{model → ui-kit}/PreventableEvent.d.ts +0 -0
  80. package/dist/{model → ui-kit}/PreventableEvent.js +0 -0
  81. package/dist/ui-kit/PreventableEvent.js.map +1 -0
  82. package/dist/ui-kit/SearchBar/SearchBarInner.d.ts +2 -3
  83. package/dist/ui-kit/SearchBar/SearchBarInner.js +46 -14
  84. package/dist/ui-kit/SearchBar/SearchBarInner.js.map +1 -1
  85. package/dist/ui-kit/SearchBar/SearchBarInput.d.ts +9 -0
  86. package/dist/ui-kit/SearchBar/SearchBarInput.js +14 -0
  87. package/dist/ui-kit/SearchBar/SearchBarInput.js.map +1 -0
  88. package/{lib/components/Footer → dist/ui-kit/Sitemap}/Sitemap.d.ts +2 -2
  89. package/dist/ui-kit/Sitemap/Sitemap.js +23 -0
  90. package/dist/ui-kit/Sitemap/Sitemap.js.map +1 -0
  91. package/dist/ui-kit/TopItem/TopItem.d.ts +1 -1
  92. package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
  93. package/dist/utils/groupBy.js +6 -6
  94. package/dist/utils/groupBy.js.map +1 -1
  95. package/lib/common.css +1 -1
  96. package/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  97. package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  98. package/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  99. package/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  100. package/lib/components/Blocks.js +0 -2
  101. package/lib/components/Blocks.js.map +1 -1
  102. package/lib/components/Footer/Footer.fallback.js +1 -1
  103. package/lib/components/Footer/Footer.fallback.js.map +1 -1
  104. package/lib/components/Footer/Footer.js +2 -21
  105. package/lib/components/Footer/Footer.js.map +1 -1
  106. package/lib/components/Header/Header.fallback.js +1 -1
  107. package/lib/components/Header/Header.fallback.js.map +1 -1
  108. package/lib/components/Header/HeaderSecondaryMenu.js +1 -1
  109. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  110. package/lib/components/Header/HeaderSecondaryMenuButton.d.ts +2 -3
  111. package/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  112. package/lib/components/ImgBlock/ImgBlockContent.d.ts +1 -1
  113. package/lib/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  114. package/lib/components/TariffsTable/TariffsTableContent.d.ts +3 -3
  115. package/lib/components/TextBlock/TextBlockContent.d.ts +2 -7
  116. package/lib/{services/sitemap → hooks}/fallbackWCMSResource.d.ts +1 -1
  117. package/lib/{services/sitemap → hooks}/fallbackWCMSResource.js +0 -0
  118. package/lib/hooks/fallbackWCMSResource.js.map +1 -0
  119. package/lib/hooks/useLink.d.ts +1 -1
  120. package/lib/services/{sitemap/search → search}/jaroWinklerDistance.d.ts +0 -0
  121. package/lib/services/{sitemap/search → search}/jaroWinklerDistance.js +0 -0
  122. package/lib/services/search/jaroWinklerDistance.js.map +1 -0
  123. package/lib/services/{sitemap/search → search}/joinMaps.d.ts +0 -0
  124. package/lib/services/{sitemap/search → search}/joinMaps.js +0 -0
  125. package/lib/services/search/joinMaps.js.map +1 -0
  126. package/lib/services/{sitemap/search → search}/search.d.ts +0 -0
  127. package/lib/services/{sitemap/search → search}/search.js +2 -2
  128. package/lib/services/search/search.js.map +1 -0
  129. package/lib/services/{sitemap/search → search}/textRank.d.ts +0 -0
  130. package/{mobile/lib/services/sitemap → lib/services}/search/textRank.js +2 -2
  131. package/lib/services/search/textRank.js.map +1 -0
  132. package/lib/services/{sitemap/search → search}/tokenize.d.ts +0 -0
  133. package/lib/services/{sitemap/search → search}/tokenize.js +0 -0
  134. package/lib/services/search/tokenize.js.map +1 -0
  135. package/{mobile/bundle/services/sitemap → lib/services/search}/useSearch.d.ts +1 -1
  136. package/lib/services/{sitemap → search}/useSearch.js +1 -1
  137. package/lib/services/search/useSearch.js.map +1 -0
  138. package/lib/ui-kit/Button/ButtonProps.d.ts +2 -3
  139. package/lib/ui-kit/Dialog/CloseButton.d.ts +7 -0
  140. package/lib/ui-kit/Dialog/CloseButton.js +6 -0
  141. package/lib/ui-kit/Dialog/CloseButton.js.map +1 -0
  142. package/lib/ui-kit/Dialog/Dialog.d.ts +7 -0
  143. package/lib/ui-kit/Dialog/Dialog.js +24 -0
  144. package/lib/ui-kit/Dialog/Dialog.js.map +1 -0
  145. package/lib/ui-kit/Location/Location.js +9 -11
  146. package/lib/ui-kit/Location/Location.js.map +1 -1
  147. package/lib/ui-kit/Location/LocationProps.d.ts +2 -2
  148. package/lib/{model → ui-kit}/PreventableEvent.d.ts +0 -0
  149. package/lib/{model → ui-kit}/PreventableEvent.js +0 -0
  150. package/lib/ui-kit/PreventableEvent.js.map +1 -0
  151. package/lib/ui-kit/SearchBar/SearchBarInner.d.ts +2 -3
  152. package/lib/ui-kit/SearchBar/SearchBarInner.js +46 -14
  153. package/lib/ui-kit/SearchBar/SearchBarInner.js.map +1 -1
  154. package/lib/ui-kit/SearchBar/SearchBarInput.d.ts +9 -0
  155. package/lib/ui-kit/SearchBar/SearchBarInput.js +12 -0
  156. package/lib/ui-kit/SearchBar/SearchBarInput.js.map +1 -0
  157. package/{mobile/bundle/components/Footer → lib/ui-kit/Sitemap}/Sitemap.d.ts +2 -2
  158. package/lib/ui-kit/Sitemap/Sitemap.js +21 -0
  159. package/lib/ui-kit/Sitemap/Sitemap.js.map +1 -0
  160. package/lib/ui-kit/TopItem/TopItem.d.ts +1 -1
  161. package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
  162. package/lib/utils/groupBy.js +6 -6
  163. package/lib/utils/groupBy.js.map +1 -1
  164. package/mobile/bundle/bundle.umd.js +248 -13
  165. package/mobile/bundle/bundle.umd.min.js +1 -1
  166. package/mobile/bundle/components/Header/HeaderSecondaryMenuButton.d.ts +2 -3
  167. package/mobile/bundle/components/ImgBlock/ImgBlockContent.d.ts +1 -1
  168. package/mobile/bundle/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  169. package/mobile/bundle/components/TariffsTable/TariffsTableContent.d.ts +3 -3
  170. package/mobile/bundle/components/TextBlock/TextBlockContent.d.ts +2 -7
  171. package/mobile/bundle/{services/sitemap → hooks}/fallbackWCMSResource.d.ts +1 -1
  172. package/mobile/bundle/hooks/useLink.d.ts +1 -1
  173. package/mobile/bundle/services/{sitemap/search → search}/jaroWinklerDistance.d.ts +0 -0
  174. package/mobile/bundle/services/{sitemap/search → search}/joinMaps.d.ts +0 -0
  175. package/mobile/bundle/services/{sitemap/search → search}/search.d.ts +0 -0
  176. package/mobile/bundle/services/{sitemap/search → search}/textRank.d.ts +0 -0
  177. package/mobile/bundle/services/{sitemap/search → search}/tokenize.d.ts +0 -0
  178. package/{bundle/services/sitemap → mobile/bundle/services/search}/useSearch.d.ts +1 -1
  179. package/mobile/bundle/ui-kit/Button/ButtonProps.d.ts +2 -3
  180. package/mobile/bundle/ui-kit/Dialog/CloseButton.d.ts +7 -0
  181. package/mobile/bundle/ui-kit/Dialog/Dialog.d.ts +7 -0
  182. package/mobile/bundle/ui-kit/Location/LocationProps.d.ts +2 -2
  183. package/mobile/bundle/{model → ui-kit}/PreventableEvent.d.ts +0 -0
  184. package/mobile/bundle/ui-kit/SearchBar/SearchBarInner.d.ts +2 -3
  185. package/mobile/bundle/ui-kit/SearchBar/SearchBarInput.d.ts +9 -0
  186. package/{dist/components/Footer → mobile/bundle/ui-kit/Sitemap}/Sitemap.d.ts +2 -2
  187. package/mobile/bundle/ui-kit/TopItem/TopItem.d.ts +1 -1
  188. package/mobile/dist/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  189. package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  190. package/mobile/dist/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  191. package/mobile/dist/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  192. package/mobile/dist/components/Footer/Footer.fallback.js +1 -1
  193. package/mobile/dist/components/Footer/Footer.fallback.js.map +1 -1
  194. package/mobile/dist/components/Header/Header.fallback.js +1 -1
  195. package/mobile/dist/components/Header/Header.fallback.js.map +1 -1
  196. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  197. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  198. package/mobile/dist/components/Header/HeaderSecondaryMenuButton.d.ts +2 -3
  199. package/mobile/dist/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  200. package/mobile/dist/components/ImgBlock/ImgBlockContent.d.ts +1 -1
  201. package/mobile/dist/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  202. package/mobile/dist/components/TariffsTable/TariffsTableContent.d.ts +3 -3
  203. package/mobile/dist/components/TextBlock/TextBlockContent.d.ts +2 -7
  204. package/mobile/dist/hooks/fallbackWCMSResource.d.ts +2 -0
  205. package/mobile/dist/{services/sitemap → hooks}/fallbackWCMSResource.js +0 -0
  206. package/mobile/dist/hooks/fallbackWCMSResource.js.map +1 -0
  207. package/mobile/dist/hooks/useLink.d.ts +1 -1
  208. package/mobile/dist/services/{sitemap/search → search}/jaroWinklerDistance.d.ts +0 -0
  209. package/mobile/dist/services/{sitemap/search → search}/jaroWinklerDistance.js +0 -0
  210. package/mobile/dist/services/search/jaroWinklerDistance.js.map +1 -0
  211. package/mobile/dist/services/{sitemap/search → search}/joinMaps.d.ts +0 -0
  212. package/mobile/dist/services/{sitemap/search → search}/joinMaps.js +0 -0
  213. package/mobile/dist/services/search/joinMaps.js.map +1 -0
  214. package/mobile/dist/services/{sitemap/search → search}/search.d.ts +0 -0
  215. package/{dist/services/sitemap → mobile/dist/services}/search/search.js +2 -2
  216. package/mobile/dist/services/search/search.js.map +1 -0
  217. package/mobile/dist/services/{sitemap/search → search}/textRank.d.ts +0 -0
  218. package/{dist/services/sitemap → mobile/dist/services}/search/textRank.js +2 -2
  219. package/mobile/dist/services/search/textRank.js.map +1 -0
  220. package/mobile/dist/services/{sitemap/search → search}/tokenize.d.ts +0 -0
  221. package/mobile/dist/services/{sitemap/search → search}/tokenize.js +0 -0
  222. package/mobile/dist/services/search/tokenize.js.map +1 -0
  223. package/mobile/dist/services/search/useSearch.d.ts +8 -0
  224. package/{dist/services/sitemap → mobile/dist/services/search}/useSearch.js +1 -1
  225. package/mobile/dist/services/search/useSearch.js.map +1 -0
  226. package/mobile/dist/ui-kit/Button/ButtonProps.d.ts +2 -3
  227. package/mobile/dist/ui-kit/Dialog/CloseButton.d.ts +7 -0
  228. package/mobile/dist/ui-kit/Dialog/CloseButton.js +8 -0
  229. package/mobile/dist/ui-kit/Dialog/CloseButton.js.map +1 -0
  230. package/mobile/dist/ui-kit/Dialog/Dialog.d.ts +7 -0
  231. package/mobile/dist/ui-kit/Dialog/Dialog.js +26 -0
  232. package/mobile/dist/ui-kit/Dialog/Dialog.js.map +1 -0
  233. package/mobile/dist/ui-kit/Location/Location.js +9 -11
  234. package/mobile/dist/ui-kit/Location/Location.js.map +1 -1
  235. package/mobile/dist/ui-kit/Location/LocationProps.d.ts +2 -2
  236. package/mobile/dist/{model → ui-kit}/PreventableEvent.d.ts +0 -0
  237. package/mobile/dist/{model → ui-kit}/PreventableEvent.js +0 -0
  238. package/mobile/dist/ui-kit/PreventableEvent.js.map +1 -0
  239. package/mobile/dist/ui-kit/SearchBar/SearchBarInner.d.ts +2 -3
  240. package/mobile/dist/ui-kit/SearchBar/SearchBarInner.js +46 -14
  241. package/mobile/dist/ui-kit/SearchBar/SearchBarInner.js.map +1 -1
  242. package/mobile/dist/ui-kit/SearchBar/SearchBarInput.d.ts +9 -0
  243. package/mobile/dist/ui-kit/SearchBar/SearchBarInput.js +14 -0
  244. package/mobile/dist/ui-kit/SearchBar/SearchBarInput.js.map +1 -0
  245. package/mobile/dist/ui-kit/Sitemap/Sitemap.d.ts +6 -0
  246. package/mobile/dist/ui-kit/Sitemap/Sitemap.js +23 -0
  247. package/mobile/dist/ui-kit/Sitemap/Sitemap.js.map +1 -0
  248. package/mobile/dist/ui-kit/TopItem/TopItem.d.ts +1 -1
  249. package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
  250. package/mobile/dist/utils/groupBy.js +6 -6
  251. package/mobile/dist/utils/groupBy.js.map +1 -1
  252. package/mobile/lib/components/ApplicationForm/ApplicationFormAcquiring.js.map +1 -1
  253. package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
  254. package/mobile/lib/components/ApplicationForm/ApplicationFormDeposit.js.map +1 -1
  255. package/mobile/lib/components/ApplicationForm/ApplicationFormWed.js.map +1 -1
  256. package/mobile/lib/components/Footer/Footer.fallback.js +1 -1
  257. package/mobile/lib/components/Footer/Footer.fallback.js.map +1 -1
  258. package/mobile/lib/components/Header/Header.fallback.js +1 -1
  259. package/mobile/lib/components/Header/Header.fallback.js.map +1 -1
  260. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +1 -1
  261. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  262. package/mobile/lib/components/Header/HeaderSecondaryMenuButton.d.ts +2 -3
  263. package/mobile/lib/components/Header/HeaderSecondaryMenuButton.js.map +1 -1
  264. package/mobile/lib/components/ImgBlock/ImgBlockContent.d.ts +1 -1
  265. package/mobile/lib/components/StepsBlock/StepsBlockContent.d.ts +4 -1
  266. package/mobile/lib/components/TariffsTable/TariffsTableContent.d.ts +3 -3
  267. package/mobile/lib/components/TextBlock/TextBlockContent.d.ts +2 -7
  268. package/mobile/lib/hooks/fallbackWCMSResource.d.ts +2 -0
  269. package/mobile/lib/{services/sitemap → hooks}/fallbackWCMSResource.js +0 -0
  270. package/mobile/lib/hooks/fallbackWCMSResource.js.map +1 -0
  271. package/mobile/lib/hooks/useLink.d.ts +1 -1
  272. package/mobile/lib/services/{sitemap/search → search}/jaroWinklerDistance.d.ts +0 -0
  273. package/mobile/lib/services/{sitemap/search → search}/jaroWinklerDistance.js +0 -0
  274. package/mobile/lib/services/search/jaroWinklerDistance.js.map +1 -0
  275. package/mobile/lib/services/{sitemap/search → search}/joinMaps.d.ts +0 -0
  276. package/mobile/lib/services/{sitemap/search → search}/joinMaps.js +0 -0
  277. package/mobile/lib/services/search/joinMaps.js.map +1 -0
  278. package/mobile/lib/services/{sitemap/search → search}/search.d.ts +0 -0
  279. package/mobile/lib/services/{sitemap/search → search}/search.js +2 -2
  280. package/mobile/lib/services/search/search.js.map +1 -0
  281. package/mobile/lib/services/{sitemap/search → search}/textRank.d.ts +0 -0
  282. package/{lib/services/sitemap → mobile/lib/services}/search/textRank.js +2 -2
  283. package/mobile/lib/services/search/textRank.js.map +1 -0
  284. package/mobile/lib/services/{sitemap/search → search}/tokenize.d.ts +0 -0
  285. package/mobile/lib/services/{sitemap/search → search}/tokenize.js +0 -0
  286. package/mobile/lib/services/search/tokenize.js.map +1 -0
  287. package/mobile/lib/services/search/useSearch.d.ts +8 -0
  288. package/mobile/lib/services/{sitemap → search}/useSearch.js +1 -1
  289. package/mobile/lib/services/search/useSearch.js.map +1 -0
  290. package/mobile/lib/ui-kit/Button/ButtonProps.d.ts +2 -3
  291. package/mobile/lib/ui-kit/Dialog/CloseButton.d.ts +7 -0
  292. package/mobile/lib/ui-kit/Dialog/CloseButton.js +6 -0
  293. package/mobile/lib/ui-kit/Dialog/CloseButton.js.map +1 -0
  294. package/mobile/lib/ui-kit/Dialog/Dialog.d.ts +7 -0
  295. package/mobile/lib/ui-kit/Dialog/Dialog.js +24 -0
  296. package/mobile/lib/ui-kit/Dialog/Dialog.js.map +1 -0
  297. package/mobile/lib/ui-kit/Location/Location.js +9 -11
  298. package/mobile/lib/ui-kit/Location/Location.js.map +1 -1
  299. package/mobile/lib/ui-kit/Location/LocationProps.d.ts +2 -2
  300. package/mobile/lib/{model → ui-kit}/PreventableEvent.d.ts +0 -0
  301. package/mobile/lib/{model → ui-kit}/PreventableEvent.js +0 -0
  302. package/mobile/lib/ui-kit/PreventableEvent.js.map +1 -0
  303. package/mobile/lib/ui-kit/SearchBar/SearchBarInner.d.ts +2 -3
  304. package/mobile/lib/ui-kit/SearchBar/SearchBarInner.js +46 -14
  305. package/mobile/lib/ui-kit/SearchBar/SearchBarInner.js.map +1 -1
  306. package/mobile/lib/ui-kit/SearchBar/SearchBarInput.d.ts +9 -0
  307. package/mobile/lib/ui-kit/SearchBar/SearchBarInput.js +12 -0
  308. package/mobile/lib/ui-kit/SearchBar/SearchBarInput.js.map +1 -0
  309. package/mobile/lib/ui-kit/Sitemap/Sitemap.d.ts +6 -0
  310. package/mobile/lib/ui-kit/Sitemap/Sitemap.js +21 -0
  311. package/mobile/lib/ui-kit/Sitemap/Sitemap.js.map +1 -0
  312. package/mobile/lib/ui-kit/TopItem/TopItem.d.ts +1 -1
  313. package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
  314. package/mobile/lib/utils/groupBy.js +6 -6
  315. package/mobile/lib/utils/groupBy.js.map +1 -1
  316. package/mobile/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +1 -1
  317. package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +1 -1
  318. package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
  319. package/mobile/src/components/ApplicationForm/ApplicationFormDeposit.tsx +1 -1
  320. package/mobile/src/components/ApplicationForm/ApplicationFormWed.tsx +1 -1
  321. package/mobile/src/components/Footer/Footer.fallback.ts +1 -1
  322. package/mobile/src/components/Header/Header.fallback.ts +1 -1
  323. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  324. package/mobile/src/components/Header/HeaderSecondaryMenuButton.tsx +2 -1
  325. package/mobile/src/components/ImgBlock/ImgBlockContent.ts +1 -1
  326. package/mobile/src/components/StepsBlock/StepsBlockContent.ts +4 -1
  327. package/mobile/src/components/TariffsTable/TariffsTableContent.ts +4 -3
  328. package/mobile/src/components/TextBlock/TextBlockContent.ts +3 -8
  329. package/mobile/src/{services/sitemap → hooks}/fallbackWCMSResource.ts +1 -1
  330. package/mobile/src/hooks/useLink.ts +1 -1
  331. package/mobile/src/services/{sitemap/search → search}/jaroWinklerDistance.ts +0 -0
  332. package/mobile/src/services/{sitemap/search → search}/joinMaps.ts +0 -0
  333. package/mobile/src/services/{sitemap/search → search}/search.ts +2 -2
  334. package/mobile/src/services/{sitemap/search → search}/textRank.ts +2 -2
  335. package/mobile/src/services/{sitemap/search → search}/tokenize.ts +0 -0
  336. package/{src/services/sitemap → mobile/src/services/search}/useSearch.ts +1 -1
  337. package/mobile/src/ui-kit/Button/ButtonProps.ts +2 -1
  338. package/mobile/src/ui-kit/Dialog/CloseButton.tsx +22 -0
  339. package/mobile/src/ui-kit/Dialog/Dialog.tsx +54 -0
  340. package/mobile/src/ui-kit/Location/Location.tsx +36 -44
  341. package/mobile/src/ui-kit/Location/LocationProps.ts +2 -2
  342. package/mobile/src/{model → ui-kit}/PreventableEvent.ts +0 -0
  343. package/mobile/src/ui-kit/SearchBar/SearchBarInner.tsx +100 -63
  344. package/mobile/src/ui-kit/SearchBar/SearchBarInput.tsx +46 -0
  345. package/mobile/src/{components/Footer → ui-kit/Sitemap}/Sitemap.tsx +12 -8
  346. package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -1
  347. package/mobile/src/utils/groupBy.ts +8 -7
  348. package/package.json +2 -2
  349. package/src/components/ApplicationForm/ApplicationFormAcquiring.tsx +1 -1
  350. package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +1 -1
  351. package/src/components/ApplicationForm/ApplicationFormCredit.tsx +1 -1
  352. package/src/components/ApplicationForm/ApplicationFormDeposit.tsx +1 -1
  353. package/src/components/ApplicationForm/ApplicationFormWed.tsx +1 -1
  354. package/src/components/Blocks.ts +0 -2
  355. package/src/components/Footer/Footer.fallback.ts +1 -1
  356. package/src/components/Footer/Footer.tsx +3 -31
  357. package/src/components/Header/Header.fallback.ts +1 -1
  358. package/src/components/Header/HeaderSecondaryMenu.tsx +2 -2
  359. package/src/components/Header/HeaderSecondaryMenuButton.tsx +2 -1
  360. package/src/components/ImgBlock/ImgBlockContent.ts +1 -1
  361. package/src/components/StepsBlock/StepsBlockContent.ts +4 -1
  362. package/src/components/TariffsTable/TariffsTableContent.ts +4 -3
  363. package/src/components/TextBlock/TextBlock.fixture.mobile.tsx +11 -20
  364. package/src/components/TextBlock/TextBlockContent.ts +3 -8
  365. package/src/{services/sitemap → hooks}/fallbackWCMSResource.ts +1 -1
  366. package/src/hooks/useLink.ts +1 -1
  367. package/src/services/{sitemap/search → search}/jaroWinklerDistance.ts +0 -0
  368. package/src/services/{sitemap/search → search}/joinMaps.ts +0 -0
  369. package/src/services/{sitemap/search → search}/search.ts +2 -2
  370. package/src/services/{sitemap/search → search}/textRank.ts +2 -2
  371. package/src/services/{sitemap/search → search}/tokenize.ts +0 -0
  372. package/{mobile/src/services/sitemap → src/services/search}/useSearch.ts +1 -1
  373. package/src/ui-kit/Button/ButtonProps.ts +2 -1
  374. package/src/ui-kit/Dialog/CloseButton.tsx +22 -0
  375. package/src/ui-kit/Dialog/Dialog.tsx +54 -0
  376. package/src/ui-kit/Location/Location.fixture.tsx +1 -1
  377. package/src/ui-kit/Location/Location.tsx +36 -44
  378. package/src/ui-kit/Location/LocationProps.ts +2 -2
  379. package/src/{model → ui-kit}/PreventableEvent.ts +0 -0
  380. package/src/ui-kit/SearchBar/SearchBarInner.tsx +100 -63
  381. package/src/ui-kit/SearchBar/SearchBarInput.tsx +46 -0
  382. package/src/{components/Footer → ui-kit/Sitemap}/Sitemap.tsx +12 -8
  383. package/src/ui-kit/TopItem/TopItem.tsx +1 -1
  384. package/src/utils/groupBy.ts +8 -7
  385. package/bundle/components/OtherProducts/OtherProducts.d.ts +0 -5
  386. package/bundle/components/OtherProducts/OtherProductsContent.d.ts +0 -8
  387. package/bundle/model/SitemapProps.d.ts +0 -24
  388. package/dist/components/Footer/Sitemap.js +0 -22
  389. package/dist/components/Footer/Sitemap.js.map +0 -1
  390. package/dist/components/OtherProducts/OtherProducts.d.ts +0 -5
  391. package/dist/components/OtherProducts/OtherProducts.js +0 -9
  392. package/dist/components/OtherProducts/OtherProducts.js.map +0 -1
  393. package/dist/components/OtherProducts/OtherProductsContent.d.ts +0 -8
  394. package/dist/components/OtherProducts/OtherProductsContent.js +0 -2
  395. package/dist/components/OtherProducts/OtherProductsContent.js.map +0 -1
  396. package/dist/model/PreventableEvent.js.map +0 -1
  397. package/dist/model/SitemapProps.d.ts +0 -24
  398. package/dist/model/SitemapProps.js +0 -2
  399. package/dist/model/SitemapProps.js.map +0 -1
  400. package/dist/services/sitemap/fallbackWCMSResource.js.map +0 -1
  401. package/dist/services/sitemap/search/jaroWinklerDistance.js.map +0 -1
  402. package/dist/services/sitemap/search/joinMaps.js.map +0 -1
  403. package/dist/services/sitemap/search/search.js.map +0 -1
  404. package/dist/services/sitemap/search/textRank.js.map +0 -1
  405. package/dist/services/sitemap/search/tokenize.js.map +0 -1
  406. package/dist/services/sitemap/useSearch.js.map +0 -1
  407. package/lib/components/Footer/Sitemap.js +0 -20
  408. package/lib/components/Footer/Sitemap.js.map +0 -1
  409. package/lib/components/OtherProducts/OtherProducts.d.ts +0 -5
  410. package/lib/components/OtherProducts/OtherProducts.fixture.d.ts +0 -8
  411. package/lib/components/OtherProducts/OtherProducts.js +0 -7
  412. package/lib/components/OtherProducts/OtherProducts.js.map +0 -1
  413. package/lib/components/OtherProducts/OtherProductsContent.d.ts +0 -8
  414. package/lib/components/OtherProducts/OtherProductsContent.js +0 -2
  415. package/lib/components/OtherProducts/OtherProductsContent.js.map +0 -1
  416. package/lib/model/PreventableEvent.js.map +0 -1
  417. package/lib/model/SitemapProps.d.ts +0 -24
  418. package/lib/model/SitemapProps.js +0 -2
  419. package/lib/model/SitemapProps.js.map +0 -1
  420. package/lib/services/sitemap/fallbackWCMSResource.js.map +0 -1
  421. package/lib/services/sitemap/search/jaroWinklerDistance.js.map +0 -1
  422. package/lib/services/sitemap/search/joinMaps.js.map +0 -1
  423. package/lib/services/sitemap/search/search.js.map +0 -1
  424. package/lib/services/sitemap/search/textRank.js.map +0 -1
  425. package/lib/services/sitemap/search/tokenize.js.map +0 -1
  426. package/lib/services/sitemap/useSearch.js.map +0 -1
  427. package/mobile/bundle/components/OtherProducts/OtherProducts.d.ts +0 -5
  428. package/mobile/bundle/components/OtherProducts/OtherProductsContent.d.ts +0 -8
  429. package/mobile/bundle/model/SitemapProps.d.ts +0 -24
  430. package/mobile/dist/components/Footer/Sitemap.d.ts +0 -6
  431. package/mobile/dist/components/Footer/Sitemap.js +0 -22
  432. package/mobile/dist/components/Footer/Sitemap.js.map +0 -1
  433. package/mobile/dist/components/OtherProducts/OtherProducts.d.ts +0 -5
  434. package/mobile/dist/components/OtherProducts/OtherProducts.js +0 -9
  435. package/mobile/dist/components/OtherProducts/OtherProducts.js.map +0 -1
  436. package/mobile/dist/components/OtherProducts/OtherProductsContent.d.ts +0 -8
  437. package/mobile/dist/components/OtherProducts/OtherProductsContent.js +0 -2
  438. package/mobile/dist/components/OtherProducts/OtherProductsContent.js.map +0 -1
  439. package/mobile/dist/model/PreventableEvent.js.map +0 -1
  440. package/mobile/dist/model/SitemapProps.d.ts +0 -24
  441. package/mobile/dist/model/SitemapProps.js +0 -2
  442. package/mobile/dist/model/SitemapProps.js.map +0 -1
  443. package/mobile/dist/services/sitemap/fallbackWCMSResource.d.ts +0 -2
  444. package/mobile/dist/services/sitemap/fallbackWCMSResource.js.map +0 -1
  445. package/mobile/dist/services/sitemap/search/jaroWinklerDistance.js.map +0 -1
  446. package/mobile/dist/services/sitemap/search/joinMaps.js.map +0 -1
  447. package/mobile/dist/services/sitemap/search/search.js.map +0 -1
  448. package/mobile/dist/services/sitemap/search/textRank.js.map +0 -1
  449. package/mobile/dist/services/sitemap/search/tokenize.js.map +0 -1
  450. package/mobile/dist/services/sitemap/useSearch.d.ts +0 -8
  451. package/mobile/dist/services/sitemap/useSearch.js.map +0 -1
  452. package/mobile/lib/components/Footer/Sitemap.d.ts +0 -6
  453. package/mobile/lib/components/Footer/Sitemap.js +0 -20
  454. package/mobile/lib/components/Footer/Sitemap.js.map +0 -1
  455. package/mobile/lib/components/OtherProducts/OtherProducts.d.ts +0 -5
  456. package/mobile/lib/components/OtherProducts/OtherProducts.js +0 -7
  457. package/mobile/lib/components/OtherProducts/OtherProducts.js.map +0 -1
  458. package/mobile/lib/components/OtherProducts/OtherProductsContent.d.ts +0 -8
  459. package/mobile/lib/components/OtherProducts/OtherProductsContent.js +0 -2
  460. package/mobile/lib/components/OtherProducts/OtherProductsContent.js.map +0 -1
  461. package/mobile/lib/model/PreventableEvent.js.map +0 -1
  462. package/mobile/lib/model/SitemapProps.d.ts +0 -24
  463. package/mobile/lib/model/SitemapProps.js +0 -2
  464. package/mobile/lib/model/SitemapProps.js.map +0 -1
  465. package/mobile/lib/services/sitemap/fallbackWCMSResource.d.ts +0 -2
  466. package/mobile/lib/services/sitemap/fallbackWCMSResource.js.map +0 -1
  467. package/mobile/lib/services/sitemap/search/jaroWinklerDistance.js.map +0 -1
  468. package/mobile/lib/services/sitemap/search/joinMaps.js.map +0 -1
  469. package/mobile/lib/services/sitemap/search/search.js.map +0 -1
  470. package/mobile/lib/services/sitemap/search/textRank.js.map +0 -1
  471. package/mobile/lib/services/sitemap/search/tokenize.js.map +0 -1
  472. package/mobile/lib/services/sitemap/useSearch.d.ts +0 -8
  473. package/mobile/lib/services/sitemap/useSearch.js.map +0 -1
  474. package/mobile/src/components/OtherProducts/OtherProducts.example.json +0 -30
  475. package/mobile/src/components/OtherProducts/OtherProducts.tsx +0 -17
  476. package/mobile/src/components/OtherProducts/OtherProducts.ui.json +0 -1
  477. package/mobile/src/components/OtherProducts/OtherProductsContent.ts +0 -9
  478. package/mobile/src/model/SitemapProps.ts +0 -27
  479. package/src/components/OtherProducts/OtherProducts.example.json +0 -30
  480. package/src/components/OtherProducts/OtherProducts.fixture.tsx +0 -88
  481. package/src/components/OtherProducts/OtherProducts.tsx +0 -17
  482. package/src/components/OtherProducts/OtherProducts.ui.json +0 -1
  483. package/src/components/OtherProducts/OtherProductsContent.ts +0 -9
  484. package/src/model/SitemapProps.ts +0 -27
@@ -4,10 +4,10 @@ import { useBool } from '../../hooks/useBool';
4
4
  import { useLocation } from '../../hooks/useLocation';
5
5
  import type { BlockVersion } from '../../model/BlockVersion';
6
6
  import type { IconVersion } from '../../model/IconVersion';
7
- import type { PreventableEvent } from '../../model/PreventableEvent';
8
7
  import { projectSettings } from '../../ProjectSettings';
9
8
  import type { ForeignOffice } from '../../services/sitemap/SitemapData';
10
9
  import { Location } from '../../ui-kit/Location/Location';
10
+ import type { PreventableEvent } from '../../ui-kit/PreventableEvent';
11
11
  import { TopItem } from '../../ui-kit/TopItem/TopItem';
12
12
  import { style } from '../../utils/style';
13
13
  import { HeaderChatBotButton } from './HeaderChatBotButton';
@@ -64,7 +64,7 @@ export const HeaderSecondaryMenu = JSX<HeaderSecondaryMenuProps>(
64
64
  currentLocation={location}
65
65
  foreignOffices={foreignOffices}
66
66
  onChangeLocation={onChangeLocation}
67
- close={hideLocationModal}
67
+ onClose={hideLocationModal}
68
68
  />
69
69
  ) : null}
70
70
  </div>
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { Img } from '../../ui-kit/Img/Img';
3
3
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
4
+ import type { PreventableEvent } from '../../ui-kit/PreventableEvent';
4
5
  import { style } from '../../utils/style';
5
6
 
6
7
  export interface HeaderSecondaryMenuButtonProps extends ImageContent {
@@ -8,7 +9,7 @@ export interface HeaderSecondaryMenuButtonProps extends ImageContent {
8
9
  isRounded?: boolean;
9
10
  disabled?: boolean;
10
11
  ariaLabel?: string;
11
- onClick?: (ev?: { preventDefault: () => void }) => void;
12
+ onClick?: (ev?: PreventableEvent) => void;
12
13
  }
13
14
 
14
15
  export const HeaderSecondaryMenuButton = JSX<HeaderSecondaryMenuButtonProps>(
@@ -4,4 +4,4 @@ import type { ImageContent } from '../../ui-kit/Img/ImgProps';
4
4
  /**
5
5
  * @title Картинка
6
6
  */
7
- export type ImgBlockContent = UniBlockContent & ImageContent & {};
7
+ export type ImgBlockContent = UniBlockContent & ImageContent;
@@ -9,7 +9,7 @@ import type { RichTextItem } from '../../model/RichTextItem';
9
9
  import type { SizeVersion } from '../../model/SizeVersion';
10
10
  import type { ListContent } from '../../ui-kit/List/ListContent';
11
11
 
12
- type StepCommonProps = IconProps & ButtonCommonIconProps & BulletsProps & ListContent & {};
12
+ type StepCommonProps = IconProps & ButtonCommonIconProps & BulletsProps & ListContent;
13
13
 
14
14
  /**
15
15
  * @title Стандартный
@@ -23,6 +23,9 @@ type RichTextStep = RichTextItem & IconProps;
23
23
 
24
24
  /**
25
25
  * @title Шаг
26
+ * @default {
27
+ * "type": "default"
28
+ * }
26
29
  */
27
30
  export type Step = DefaultStep | RichTextStep;
28
31
 
@@ -1,6 +1,6 @@
1
1
  import type { EmptyOption } from '../../model/EmptyOptionType';
2
2
  import type { DescriptionProps, LabelProps, TitleProps } from '../../model/HeadlineType';
3
- import type { UniBlockProps } from '../../model/JSXBlock';
3
+ import type { UniBlockContent, UniBlockProps } from '../../model/JSXBlock';
4
4
  import type { ListOrientation } from '../../model/ListOrientation';
5
5
  import type { IconProps } from '../../model/Picture';
6
6
  import type { ButtonContent } from '../../ui-kit/Button/ButtonProps';
@@ -43,7 +43,7 @@ export type Data = {
43
43
  /**
44
44
  * @title Параметр
45
45
  */
46
- export type TariffsTableRowHeader = TitleProps & IconProps & {};
46
+ export type TariffsTableRowHeader = TitleProps & IconProps;
47
47
 
48
48
  /**
49
49
  * @title Изображение
@@ -112,7 +112,8 @@ export interface TariffsTableColumn {
112
112
  /**
113
113
  * @title Таблица тарифов
114
114
  */
115
- export type TariffsTableContent = TitleProps &
115
+ export type TariffsTableContent = UniBlockContent &
116
+ TitleProps &
116
117
  DescriptionProps & {
117
118
  /** @title Колонки */
118
119
  tariffsColumns?: TariffsTableColumn[];
@@ -1,15 +1,10 @@
1
1
  import type { BulletsProps } from '../../model/Bullets';
2
2
  import type { HeadlineCommonProps } from '../../model/HeadlineType';
3
+ import type { UniBlockContent } from '../../model/JSXBlock';
3
4
  import type { ImageContent } from '../../ui-kit/Img/ImgProps';
4
5
  import type { ListContent } from '../../ui-kit/List/ListContent';
5
6
  import type { RichTextProps } from '../../ui-kit/RichText/RichTextProps';
6
7
 
7
- /**
8
- * @title Цвет блока
9
- * @enumNames ["Основная", "Второстепенная", "Второстепенная прозрачная"]
10
- */
11
- export type TextBlockVersion = 'primary' | 'secondary' | 'secondary-light';
12
-
13
8
  /**
14
9
  * @title Размер иконки
15
10
  * @enumNames ["Нет", "Маленькая", "Большая"]
@@ -19,11 +14,11 @@ type TextBlockIconVersion = 'none' | 'small' | 'big';
19
14
  /**
20
15
  * @title Текстовый блок
21
16
  */
22
- export type TextBlockContent = HeadlineCommonProps &
17
+ export type TextBlockContent = UniBlockContent &
18
+ HeadlineCommonProps &
23
19
  RichTextProps &
24
20
  ImageContent &
25
21
  ListContent &
26
22
  BulletsProps & {
27
23
  iconVersion?: TextBlockIconVersion;
28
- blockVersion?: TextBlockVersion;
29
24
  };
@@ -1,5 +1,5 @@
1
1
  import { readFile } from 'fs/promises';
2
- import type { FallbackMap } from '../../model/Fallback';
2
+ import type { FallbackMap } from '../model/Fallback';
3
3
 
4
4
  export const fallbackWCMSResource = (filename: string): FallbackMap => ({
5
5
  [`/wcms-resources/${filename}.json`]: async () =>
@@ -1,5 +1,5 @@
1
1
  import type { LinkProps } from '../model/LinkProps';
2
- import type { PreventableEvent } from '../model/PreventableEvent';
2
+ import type { PreventableEvent } from '../ui-kit/PreventableEvent';
3
3
  import { adjustHref } from '../utils/adjustHref';
4
4
  import { isLocalURL } from '../utils/url';
5
5
  import { handlerDecorator } from './handlerDecorator';
@@ -1,5 +1,5 @@
1
- import { compareBy, desc } from '../../../utils/Comparator';
2
- import { zip } from '../../../utils/zip';
1
+ import { compareBy, desc } from '../../utils/Comparator';
2
+ import { zip } from '../../utils/zip';
3
3
  import { jaroWinklerDistance } from './jaroWinklerDistance';
4
4
  import { joinMaps } from './joinMaps';
5
5
  import { textRank } from './textRank';
@@ -1,5 +1,5 @@
1
- import { max } from '../../../utils/maxBy';
2
- import { sum } from '../../../utils/sum';
1
+ import { max } from '../../utils/maxBy';
2
+ import { sum } from '../../utils/sum';
3
3
  import { jaroWinklerDistance } from './jaroWinklerDistance';
4
4
  import { tokenize } from './tokenize';
5
5
 
@@ -2,7 +2,7 @@ import { useCallback, useEffect, useMemo, useState } from '@redneckz/uni-jsx/lib
2
2
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
3
3
  import { fetchJSON } from '../../utils/fetchJSON';
4
4
  import { joinPath } from '../../utils/url';
5
- import { CorpusItem, search, SearchIndex } from './search/search';
5
+ import { CorpusItem, search, SearchIndex } from './search';
6
6
 
7
7
  const SEARCH_INDEX_FILENAME = 'search.index.json';
8
8
 
@@ -2,6 +2,7 @@ import type { ButtonVersion } from '../../model/ButtonVersion';
2
2
  import type { LinkProps } from '../../model/LinkProps';
3
3
  import type { IconProps, Picture } from '../../model/Picture';
4
4
  import type { VNode } from '../../model/VNode';
5
+ import type { PreventableEvent } from '../PreventableEvent';
5
6
 
6
7
  /**
7
8
  * @hidden
@@ -11,7 +12,7 @@ export interface ButtonAdditionalProps {
11
12
  disabled?: boolean;
12
13
  rel?: string;
13
14
  ariaLabel?: string;
14
- onClick?: (ev?: { preventDefault: () => void }) => void;
15
+ onClick?: (ev?: PreventableEvent) => void;
15
16
  }
16
17
 
17
18
  /**
@@ -0,0 +1,22 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { style } from '../../utils/style';
3
+ import { Img } from '../Img/Img';
4
+ import type { PreventableEvent } from '../PreventableEvent';
5
+
6
+ interface CloseButtonProps {
7
+ className?: string;
8
+ onClick?: (ev: PreventableEvent) => void;
9
+ }
10
+
11
+ export const CloseButton = JSX<CloseButtonProps>(({ className, onClick }) => (
12
+ <button
13
+ className={style(
14
+ 'visible peer-placeholder-shown:invisible w-6 h-6 p-1 bg-transparent border-none',
15
+ className,
16
+ )}
17
+ onClick={onClick}
18
+ title="Закрыть"
19
+ >
20
+ <Img image={{ icon: 'CloseIcon' }} width="24" height="24" />
21
+ </button>
22
+ ));
@@ -0,0 +1,54 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
+ import type { VNode } from '../../model/VNode';
4
+ import { style } from '../../utils/style';
5
+ import type { PreventableEvent } from '../PreventableEvent';
6
+ import { CloseButton } from './CloseButton';
7
+
8
+ export interface DialogProps {
9
+ className?: string;
10
+ head?: VNode;
11
+ onClose?: () => void;
12
+ }
13
+
14
+ export const Dialog = JSX<DialogProps>(({ className, head, children, onClose }) => {
15
+ const handleClose = useCallback(
16
+ (ev: PreventableEvent) => {
17
+ ev.preventDefault();
18
+ onClose && onClose();
19
+ },
20
+ [onClose],
21
+ );
22
+
23
+ useEffect(() => {
24
+ const handleEscape = ({ key }: { key: string }) => {
25
+ if (key === 'Escape') {
26
+ onClose && onClose();
27
+ }
28
+ };
29
+
30
+ globalThis.document?.addEventListener('keydown', handleEscape);
31
+
32
+ return () => {
33
+ globalThis.document?.removeEventListener('keydown', handleEscape);
34
+ };
35
+ }, [onClose]);
36
+
37
+ return (
38
+ <div
39
+ className={style(
40
+ 'fixed inset-0 bg-white text-l-light z-50 overflow-x-hidden overflow-y-scroll no-scrollbar',
41
+ className,
42
+ )}
43
+ role="dialog"
44
+ >
45
+ <div className="relative container pb-12 min-h-full">
46
+ <div className="sticky bg-white pt-6 top-0">
47
+ <CloseButton className="absolute top-3 -right-6" onClick={handleClose} />
48
+ {head}
49
+ </div>
50
+ {children}
51
+ </div>
52
+ </div>
53
+ );
54
+ });
@@ -1,25 +1,26 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useLink } from '../../hooks/useLink';
4
+ import type { Region } from '../../hooks/useRegions';
4
5
  import { useRegions } from '../../hooks/useRegions';
6
+ import { jaroWinklerDistance } from '../../services/search/jaroWinklerDistance';
7
+ import type { ForeignOffice } from '../../services/sitemap/SitemapData';
5
8
  import { Text } from '../../ui-kit/Text/Text';
6
9
  import { groupBy } from '../../utils/groupBy';
10
+ import { Dialog, type DialogProps } from '../Dialog/Dialog';
7
11
  import { Img } from '../Img/Img';
8
- import { SearchBar } from './SearchBar';
9
- import type { ForeignOffice } from '../../services/sitemap/SitemapData';
10
- import type { Region } from '../../hooks/useRegions';
11
12
  import type {
12
- LocationProps,
13
13
  CurrentLocationProps,
14
- CloseButtonProps,
15
- RegionLinkProps,
16
14
  ForeignOfficeProps,
15
+ LocationProps,
16
+ RegionLinkProps,
17
17
  } from './LocationProps';
18
+ import { SearchBar } from './SearchBar';
18
19
 
19
20
  const SEARCH_TERM_MIN_LENGTH = 3;
20
21
 
21
22
  export const Location = JSX<LocationProps>(
22
- ({ currentLocation, onChangeLocation, close, foreignOffices }) => {
23
+ ({ currentLocation, onChangeLocation, onClose, foreignOffices }) => {
23
24
  const [query, setQuery] = useState('');
24
25
 
25
26
  const regions: Region[] = cleanUpRegions(useRegions()).sort((a, b) =>
@@ -28,31 +29,34 @@ export const Location = JSX<LocationProps>(
28
29
  const regionsGroupByLetter: Map<string, Region[]> = groupBy(regions, regionFirstLetter);
29
30
 
30
31
  return (
31
- <div className="absolute h-full w-full inset-0 bg-white text-l-light z-50 overflow-x-hidden overflow-y-scroll">
32
- <div className="relative container pt-6 pb-12">
33
- <div className="sticky bg-white pt-6 top-0">
34
- <CloseButton close={close} />
32
+ <Dialog
33
+ head={
34
+ <div>
35
35
  <CurrentLocation currentLocation={currentLocation} />
36
36
  <SearchBar onSearch={setQuery} searchTerm={query} className="mb-7" />
37
37
  </div>
38
+ }
39
+ onClose={onClose}
40
+ >
41
+ {query && query.length >= SEARCH_TERM_MIN_LENGTH ? (
42
+ <div>
43
+ {regions
44
+ .filter(
45
+ ({ name }) =>
46
+ name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8,
47
+ )
48
+ .map(renderRegion({ onChangeLocation, onClose }))}
49
+ </div>
50
+ ) : (
51
+ <div className="columns-5">
52
+ {Array.from(regionsGroupByLetter.entries()).map(
53
+ renderRegionGroup({ onChangeLocation, onClose }),
54
+ )}
55
+ </div>
56
+ )}
38
57
 
39
- {query && query.length >= SEARCH_TERM_MIN_LENGTH ? (
40
- <div>
41
- {regions
42
- .filter((region) => region.name?.startsWith(query))
43
- .map(renderRegion({ onChangeLocation, close }))}
44
- </div>
45
- ) : (
46
- <div className="columns-5">
47
- {Array.from(regionsGroupByLetter.entries()).map(
48
- renderRegionGroup({ onChangeLocation, close }),
49
- )}
50
- </div>
51
- )}
52
-
53
- <ForeignOffices foreignOffices={foreignOffices} />
54
- </div>
55
- </div>
58
+ <ForeignOffices foreignOffices={foreignOffices} />
59
+ </Dialog>
56
60
  );
57
61
  },
58
62
  );
@@ -78,32 +82,20 @@ const CurrentLocation = JSX<CurrentLocationProps>(({ currentLocation }) =>
78
82
  ) : null,
79
83
  );
80
84
 
81
- const CloseButton = JSX<CloseButtonProps>(({ close }) => (
82
- <button
83
- className="visible peer-placeholder-shown:invisible absolute top-0 -right-6 w-6 h-6 p-1 bg-transparent cursor-pointer border-none"
84
- onClick={(e) => {
85
- e.preventDefault();
86
- close && close();
87
- }}
88
- >
89
- <Img image={{ icon: 'CloseIcon' }} width="24" height="24" />
90
- </button>
91
- ));
92
-
93
85
  const renderRegionGroup =
94
- ({ onChangeLocation, close }: RegionLinkProps & CloseButtonProps) =>
86
+ ({ onChangeLocation, onClose }: RegionLinkProps & DialogProps) =>
95
87
  ([letter, regions]: [string, Region[]]) =>
96
88
  (
97
89
  <div key={letter} className="break-inside-avoid mb-7 w-[224px]">
98
90
  <div className="mb-2.5">
99
91
  <Text size="text-h6">{letter}</Text>
100
92
  </div>
101
- {regions.map(renderRegion({ onChangeLocation, close }))}
93
+ {regions.map(renderRegion({ onChangeLocation, onClose }))}
102
94
  </div>
103
95
  );
104
96
 
105
97
  const renderRegion =
106
- ({ onChangeLocation, close }: RegionLinkProps & CloseButtonProps) =>
98
+ ({ onChangeLocation, onClose }: RegionLinkProps & DialogProps) =>
107
99
  (region: Region) =>
108
100
  (
109
101
  <div key={region.id} className="mb-1">
@@ -111,7 +103,7 @@ const renderRegion =
111
103
  className="cursor-pointer hover:text-primary-hover"
112
104
  onClick={() => {
113
105
  onChangeLocation && onChangeLocation(region);
114
- close && close();
106
+ onClose && onClose();
115
107
  }}
116
108
  >
117
109
  {region.name || ''}
@@ -1,13 +1,13 @@
1
1
  import { Region } from '../../hooks/useRegions';
2
- import { ForeignOffice } from '../../services/sitemap/SitemapData';
3
2
  import { UniBlockProps } from '../../model/JSXBlock';
3
+ import { ForeignOffice } from '../../services/sitemap/SitemapData';
4
4
 
5
5
  export interface RegionLinkProps {
6
6
  onChangeLocation?: (region: Region) => void;
7
7
  }
8
8
 
9
9
  export interface CloseButtonProps {
10
- close?: () => void;
10
+ onClose?: () => void;
11
11
  }
12
12
 
13
13
  export interface CurrentLocationProps {
File without changes
@@ -1,72 +1,109 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import { Button } from '../Button/Button';
3
- import { Img } from '../Img/Img';
2
+ import { useCallback, useEffect, useMemo } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { useBool } from '../../hooks/useBool';
4
+ import type { LinkProps } from '../../model/LinkProps';
5
+ import { useSearch, type SearchResult } from '../../services/search/useSearch';
6
+ import type { TopMenuItem } from '../../services/sitemap/SitemapData';
7
+ import { zip } from '../../utils/zip';
8
+ import { CloseButton } from '../Dialog/CloseButton';
9
+ import { Dialog } from '../Dialog/Dialog';
10
+ import { Sitemap } from '../Sitemap/Sitemap';
11
+ import { SearchBarInput } from './SearchBarInput';
4
12
 
5
13
  export interface SearchBarInnerProps {
6
14
  isMobile?: boolean;
7
15
  className?: string;
8
- value?: string;
9
- onChange?: (value: string) => void;
10
- onFocus?: () => void;
16
+ topItems?: TopMenuItem[];
11
17
  }
12
18
 
13
- export const SearchBarInner = JSX<SearchBarInnerProps>(
14
- ({ className, isMobile, value: query, onChange, onFocus }) => {
15
- const LoupeIconClassName = isMobile ? 'w-5 h-5' : 'w-6 h-6';
16
- const SearchBarLabelClassName = isMobile ? 'text-s' : 'text-l-light';
17
- const SearchBarInputClassName = isMobile ? ' placeholder-transparent' : 'h-full';
18
- const inputPlaceholder = isMobile ? 'some search' : undefined;
19
+ const MIN_QUERY_LEN = 3;
19
20
 
20
- return (
21
- <form className={`font-sans relative ${className}`}>
22
- <div className="absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none">
23
- <div className={LoupeIconClassName}>
24
- <Img image={{ icon: 'LoupeIcon' }} width="24" height="24" />
25
- </div>
26
- {query ? null : (
27
- <label
28
- htmlFor="search-bar-input"
29
- className={`text-secondary-text ${SearchBarLabelClassName}`}
30
- >
31
- Поиск по сайту
32
- </label>
33
- )}
34
- </div>
35
- <input
36
- id="search-bar-input"
37
- className={`h-12 pl-12 w-full peer text-l text-black border border-solid rounded-md box-border
38
- outline-none pr-[6%] border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text ${SearchBarInputClassName}`}
39
- value={query}
40
- onChange={(e) => onChange && onChange(e.target.value || '')}
41
- onFocus={onFocus}
42
- type="text"
43
- name="search-bar-input"
44
- placeholder={inputPlaceholder}
21
+ export const SearchBarInner = JSX<SearchBarInnerProps>(({ className, isMobile, topItems }) => {
22
+ const basePathList = topItems?.map((_) => _.href || '/');
23
+ const [searchResult, searchInputProps] = useSearch(basePathList);
24
+
25
+ const { value, onChange, onFocus } = searchInputProps;
26
+
27
+ const searchItems = useMemo(
28
+ () => combineTopItemsAndSearchResult(topItems)(searchResult),
29
+ [topItems, searchResult],
30
+ );
31
+
32
+ useEffect(() => printSearchItems(searchItems), [searchItems]); // Temp
33
+
34
+ const [isSearchDialogOpen, { setTrue: openSearchDialog, setFalse: hideSearchDialog }] = useBool();
35
+
36
+ const handleInitialInputChange = useCallback(
37
+ (_: string) => {
38
+ onChange(_);
39
+ if (isQueryLongEnough(_)) {
40
+ openSearchDialog();
41
+ }
42
+ },
43
+ [onChange, isQueryLongEnough],
44
+ );
45
+ const handleInitialInputFocus = useCallback(() => {
46
+ onFocus();
47
+ if (isQueryLongEnough(value)) {
48
+ openSearchDialog();
49
+ }
50
+ }, [value, onFocus]);
51
+
52
+ return (
53
+ <div className={className}>
54
+ <SearchBarInput
55
+ isMobile={isMobile}
56
+ value={value}
57
+ onChange={handleInitialInputChange}
58
+ onFocus={handleInitialInputFocus}
59
+ />
60
+ {isMobile ? (
61
+ <CloseButton
62
+ className="absolute top-2 right-3"
63
+ onClick={(e) => {
64
+ e.preventDefault();
65
+ onChange('');
66
+ }}
45
67
  />
46
- {isMobile ? (
47
- <button
48
- className="visible peer-placeholder-shown:invisible absolute top-2 right-3 w-6 h-6 p-1 bg-transparent cursor-pointer border-none"
49
- onClick={(e) => {
50
- e.preventDefault();
51
- onChange && onChange('');
52
- }}
53
- >
54
- <Img image={{ icon: 'CloseIcon' }} width="24" height="24" />
55
- </button>
56
- ) : (
57
- <Button
58
- version="primary"
59
- text="Найти"
60
- className="invisible peer-focus:visible absolute top-[3px] right-1"
61
- onClick={(ev) => {
62
- ev?.preventDefault();
63
- console.log('click');
64
- }}
65
- >
66
- <div className="text-s px-9 py-2.5">Найти</div>
67
- </Button>
68
- )}
69
- </form>
70
- );
71
- },
72
- );
68
+ ) : null}
69
+ {isSearchDialogOpen ? (
70
+ <Dialog
71
+ head={
72
+ <SearchBarInput
73
+ className="my-5"
74
+ isMobile={isMobile}
75
+ autoFocus={true}
76
+ {...searchInputProps}
77
+ />
78
+ }
79
+ onClose={hideSearchDialog}
80
+ >
81
+ <Sitemap topItems={searchItems} />
82
+ </Dialog>
83
+ ) : null}
84
+ </div>
85
+ );
86
+ });
87
+
88
+ const isQueryLongEnough = (_: string) => _ && _.length >= MIN_QUERY_LEN;
89
+
90
+ const combineTopItemsAndSearchResult =
91
+ (topItems: TopMenuItem[] | undefined) =>
92
+ (searchResult: SearchResult | null | undefined): TopMenuItem[] =>
93
+ topItems?.length && searchResult?.length
94
+ ? zip(topItems, searchResult).map(([_, portalSearchResult]) => ({
95
+ ..._,
96
+ items: portalSearchResult?.map(
97
+ ({ title, uri }): LinkProps => ({ text: title, href: uri }),
98
+ ),
99
+ }))
100
+ : [];
101
+
102
+ // Temp
103
+ function printSearchItems(topItems: TopMenuItem[]) {
104
+ for (const _ of topItems.filter(({ items }) => items?.length)) {
105
+ console.group(_.text);
106
+ console.table(_.items, ['text', 'href']);
107
+ console.groupEnd();
108
+ }
109
+ }
@@ -0,0 +1,46 @@
1
+ import { JSX } from '@redneckz/uni-jsx';
2
+ import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
3
+ import { style } from '../../utils/style';
4
+ import { Img } from '../Img/Img';
5
+
6
+ export interface SearchBarInputProps {
7
+ className?: string;
8
+ isMobile?: boolean;
9
+ value?: string;
10
+ autoFocus?: boolean;
11
+ onChange?: (value: string) => void;
12
+ onFocus?: () => void;
13
+ }
14
+
15
+ export const SearchBarInput = JSX<SearchBarInputProps>(
16
+ ({ className, isMobile, value, autoFocus, onChange, onFocus }) => {
17
+ const handleChange = useCallback(
18
+ (ev: { target?: { value?: string } }) => {
19
+ onChange && onChange(ev.target?.value || '');
20
+ },
21
+ [onChange],
22
+ );
23
+
24
+ return (
25
+ <div className={style('font-sans relative', className)} role="form">
26
+ <div className="absolute h-full flex items-center pl-4 pointer-events-none">
27
+ <Img image={{ icon: 'LoupeIcon' }} width="24" height="24" />
28
+ </div>
29
+ <input
30
+ className={style(
31
+ 'h-12 pl-12 w-full text-l text-black outline-none box-border',
32
+ 'border border-solid rounded-md border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text',
33
+ isMobile ? '' : 'h-full',
34
+ )}
35
+ value={value}
36
+ type="text"
37
+ name="search-bar-input"
38
+ placeholder="Поиск по сайту"
39
+ autoFocus={autoFocus}
40
+ onChange={handleChange}
41
+ onFocus={onFocus}
42
+ />
43
+ </div>
44
+ );
45
+ },
46
+ );