@redneckz/wildless-cms-uni-blocks 0.8.2 → 0.8.4

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 (255) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +110 -29
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/Carousel/CarouselContent.d.ts +6 -1
  5. package/bundle/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  6. package/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  7. package/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  8. package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  9. package/bundle/components/Footer/MediaButton.d.ts +2 -2
  10. package/bundle/components/Footer/SocialMedia.d.ts +2 -2
  11. package/bundle/hooks/useLink.d.ts +1 -1
  12. package/bundle/services/sitemap/isHrefActive.d.ts +2 -1
  13. package/bundle/services/sitemap/isTopItemActive.d.ts +2 -3
  14. package/dist/components/Blocks.js +2 -0
  15. package/dist/components/Blocks.js.map +1 -1
  16. package/dist/components/Carousel/Carousel.js +27 -6
  17. package/dist/components/Carousel/Carousel.js.map +1 -1
  18. package/dist/components/Carousel/CarouselContent.d.ts +6 -1
  19. package/dist/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  20. package/dist/components/Carousel/CarouselScrollButtons.js +35 -0
  21. package/dist/components/Carousel/CarouselScrollButtons.js.map +1 -0
  22. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  23. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +46 -0
  24. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  25. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  26. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  27. package/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  28. package/dist/components/CarouselCard/CarouselCard.js +1 -1
  29. package/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  30. package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  31. package/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  32. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  33. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  34. package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  35. package/dist/components/Footer/MediaButton.d.ts +2 -2
  36. package/dist/components/Footer/SocialMedia.d.ts +2 -2
  37. package/dist/components/Footer/SocialMedia.js +2 -1
  38. package/dist/components/Footer/SocialMedia.js.map +1 -1
  39. package/dist/hooks/useLink.d.ts +1 -1
  40. package/dist/hooks/useLink.js +2 -2
  41. package/dist/hooks/useLink.js.map +1 -1
  42. package/dist/services/sitemap/findActiveSubItem.js +2 -2
  43. package/dist/services/sitemap/findActiveSubItem.js.map +1 -1
  44. package/dist/services/sitemap/isHrefActive.d.ts +2 -1
  45. package/dist/services/sitemap/isHrefActive.js +6 -2
  46. package/dist/services/sitemap/isHrefActive.js.map +1 -1
  47. package/dist/services/sitemap/isTopItemActive.d.ts +2 -3
  48. package/dist/services/sitemap/isTopItemActive.js +1 -2
  49. package/dist/services/sitemap/isTopItemActive.js.map +1 -1
  50. package/dist/ui-kit/TopItem/TopItem.js +1 -1
  51. package/dist/ui-kit/TopItem/TopItem.js.map +1 -1
  52. package/dist/utils/url.js +1 -7
  53. package/dist/utils/url.js.map +1 -1
  54. package/lib/common.css +1 -1
  55. package/lib/components/Blocks.js +2 -0
  56. package/lib/components/Blocks.js.map +1 -1
  57. package/lib/components/Carousel/Carousel.fixture.d.ts +1 -0
  58. package/lib/components/Carousel/Carousel.js +28 -7
  59. package/lib/components/Carousel/Carousel.js.map +1 -1
  60. package/lib/components/Carousel/CarouselContent.d.ts +6 -1
  61. package/lib/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  62. package/lib/components/Carousel/CarouselScrollButtons.js +33 -0
  63. package/lib/components/Carousel/CarouselScrollButtons.js.map +1 -0
  64. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  65. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.d.ts +15 -0
  66. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +44 -0
  67. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  68. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  69. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  70. package/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  71. package/lib/components/CarouselCard/CarouselCard.js +1 -1
  72. package/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  73. package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  74. package/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  75. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  76. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  77. package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  78. package/lib/components/Footer/MediaButton.d.ts +2 -2
  79. package/lib/components/Footer/SocialMedia.d.ts +2 -2
  80. package/lib/components/Footer/SocialMedia.js +2 -1
  81. package/lib/components/Footer/SocialMedia.js.map +1 -1
  82. package/lib/hooks/useLink.d.ts +1 -1
  83. package/lib/hooks/useLink.js +2 -2
  84. package/lib/hooks/useLink.js.map +1 -1
  85. package/lib/services/sitemap/findActiveSubItem.js +2 -2
  86. package/lib/services/sitemap/findActiveSubItem.js.map +1 -1
  87. package/lib/services/sitemap/isHrefActive.d.ts +2 -1
  88. package/lib/services/sitemap/isHrefActive.js +7 -3
  89. package/lib/services/sitemap/isHrefActive.js.map +1 -1
  90. package/lib/services/sitemap/isTopItemActive.d.ts +2 -3
  91. package/lib/services/sitemap/isTopItemActive.js +1 -2
  92. package/lib/services/sitemap/isTopItemActive.js.map +1 -1
  93. package/lib/ui-kit/TopItem/TopItem.js +1 -1
  94. package/lib/ui-kit/TopItem/TopItem.js.map +1 -1
  95. package/lib/utils/url.js +1 -7
  96. package/lib/utils/url.js.map +1 -1
  97. package/mobile/bundle/bundle.umd.js +12 -19
  98. package/mobile/bundle/bundle.umd.min.js +1 -1
  99. package/mobile/bundle/components/Carousel/CarouselContent.d.ts +6 -1
  100. package/mobile/bundle/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  101. package/mobile/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  102. package/mobile/bundle/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  103. package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  104. package/mobile/bundle/components/Footer/MediaButton.d.ts +2 -2
  105. package/mobile/bundle/hooks/useLink.d.ts +1 -1
  106. package/mobile/bundle/services/sitemap/isHrefActive.d.ts +2 -1
  107. package/mobile/bundle/services/sitemap/isTopItemActive.d.ts +2 -3
  108. package/mobile/dist/components/Carousel/Carousel.js +27 -6
  109. package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
  110. package/mobile/dist/components/Carousel/CarouselContent.d.ts +6 -1
  111. package/mobile/dist/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  112. package/mobile/dist/components/Carousel/CarouselScrollButtons.js +35 -0
  113. package/mobile/dist/components/Carousel/CarouselScrollButtons.js.map +1 -0
  114. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  115. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +46 -0
  116. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  117. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  118. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  119. package/mobile/dist/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  120. package/mobile/dist/components/CarouselCard/CarouselCard.js +1 -1
  121. package/mobile/dist/components/CarouselCard/CarouselCard.js.map +1 -1
  122. package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  123. package/mobile/dist/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  124. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  125. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  126. package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  127. package/mobile/dist/components/Footer/MediaButton.d.ts +2 -2
  128. package/mobile/dist/hooks/useLink.d.ts +1 -1
  129. package/mobile/dist/hooks/useLink.js +2 -2
  130. package/mobile/dist/hooks/useLink.js.map +1 -1
  131. package/mobile/dist/services/sitemap/findActiveSubItem.js +2 -2
  132. package/mobile/dist/services/sitemap/findActiveSubItem.js.map +1 -1
  133. package/mobile/dist/services/sitemap/isHrefActive.d.ts +2 -1
  134. package/mobile/dist/services/sitemap/isHrefActive.js +6 -2
  135. package/mobile/dist/services/sitemap/isHrefActive.js.map +1 -1
  136. package/mobile/dist/services/sitemap/isTopItemActive.d.ts +2 -3
  137. package/mobile/dist/services/sitemap/isTopItemActive.js +1 -2
  138. package/mobile/dist/services/sitemap/isTopItemActive.js.map +1 -1
  139. package/mobile/dist/ui-kit/TopItem/TopItem.js +1 -1
  140. package/mobile/dist/ui-kit/TopItem/TopItem.js.map +1 -1
  141. package/mobile/dist/utils/url.js +1 -7
  142. package/mobile/dist/utils/url.js.map +1 -1
  143. package/mobile/lib/components/Carousel/Carousel.js +28 -7
  144. package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
  145. package/mobile/lib/components/Carousel/CarouselContent.d.ts +6 -1
  146. package/mobile/lib/components/Carousel/CarouselScrollButtons.d.ts +13 -0
  147. package/mobile/lib/components/Carousel/CarouselScrollButtons.js +33 -0
  148. package/mobile/lib/components/Carousel/CarouselScrollButtons.js.map +1 -0
  149. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.d.ts +9 -0
  150. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js +44 -0
  151. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCard.js.map +1 -0
  152. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.d.ts +9 -0
  153. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js +2 -0
  154. package/mobile/lib/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.js.map +1 -0
  155. package/mobile/lib/components/CarouselCard/CarouselCard.js +1 -1
  156. package/mobile/lib/components/CarouselCard/CarouselCard.js.map +1 -1
  157. package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js +1 -1
  158. package/mobile/lib/components/CarouselCatalogCard/CarouselCatalogCard.js.map +1 -1
  159. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
  160. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
  161. package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +0 -1
  162. package/mobile/lib/components/Footer/MediaButton.d.ts +2 -2
  163. package/mobile/lib/hooks/useLink.d.ts +1 -1
  164. package/mobile/lib/hooks/useLink.js +2 -2
  165. package/mobile/lib/hooks/useLink.js.map +1 -1
  166. package/mobile/lib/services/sitemap/findActiveSubItem.js +2 -2
  167. package/mobile/lib/services/sitemap/findActiveSubItem.js.map +1 -1
  168. package/mobile/lib/services/sitemap/isHrefActive.d.ts +2 -1
  169. package/mobile/lib/services/sitemap/isHrefActive.js +7 -3
  170. package/mobile/lib/services/sitemap/isHrefActive.js.map +1 -1
  171. package/mobile/lib/services/sitemap/isTopItemActive.d.ts +2 -3
  172. package/mobile/lib/services/sitemap/isTopItemActive.js +1 -2
  173. package/mobile/lib/services/sitemap/isTopItemActive.js.map +1 -1
  174. package/mobile/lib/ui-kit/TopItem/TopItem.js +1 -1
  175. package/mobile/lib/ui-kit/TopItem/TopItem.js.map +1 -1
  176. package/mobile/lib/utils/url.js +1 -7
  177. package/mobile/lib/utils/url.js.map +1 -1
  178. package/mobile/src/common.css +17 -0
  179. package/mobile/src/components/Carousel/Carousel.tsx +43 -32
  180. package/mobile/src/components/Carousel/CarouselContent.ts +6 -1
  181. package/mobile/src/components/Carousel/CarouselScrollButtons.tsx +81 -0
  182. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.example.json +4 -0
  183. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +85 -0
  184. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.ui.json +1 -0
  185. package/mobile/src/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.ts +9 -0
  186. package/mobile/src/components/CarouselCard/CarouselCard.tsx +2 -2
  187. package/mobile/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -1
  188. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -1
  189. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +10 -9
  190. package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +0 -1
  191. package/mobile/src/components/Footer/MediaButton.tsx +2 -2
  192. package/mobile/src/hooks/useLink.ts +4 -4
  193. package/mobile/src/services/sitemap/findActiveSubItem.ts +2 -2
  194. package/mobile/src/services/sitemap/isHrefActive.ts +14 -6
  195. package/mobile/src/services/sitemap/isTopItemActive.ts +3 -3
  196. package/mobile/src/ui-kit/TopItem/TopItem.tsx +1 -1
  197. package/mobile/src/utils/url.ts +1 -9
  198. package/package.json +3 -3
  199. package/src/common.css +17 -0
  200. package/src/components/Blocks.ts +2 -0
  201. package/src/components/Carousel/Carousel.fixture.tsx +20 -0
  202. package/src/components/Carousel/Carousel.tsx +43 -32
  203. package/src/components/Carousel/CarouselContent.ts +6 -1
  204. package/src/components/Carousel/CarouselScrollButtons.tsx +81 -0
  205. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.example.json +4 -0
  206. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.fixture.tsx +19 -0
  207. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.tsx +85 -0
  208. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCard.ui.json +1 -0
  209. package/src/components/CarouselBankHistoryCard/CarouselBankHistoryCardContent.ts +9 -0
  210. package/src/components/CarouselCard/CarouselCard.tsx +2 -2
  211. package/src/components/CarouselCatalogCard/CarouselCatalogCard.tsx +1 -1
  212. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +1 -1
  213. package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.ui.json +10 -9
  214. package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +0 -1
  215. package/src/components/Footer/MediaButton.tsx +2 -2
  216. package/src/components/Footer/SocialMedia.tsx +6 -3
  217. package/src/hooks/useLink.ts +4 -4
  218. package/src/services/sitemap/findActiveSubItem.ts +2 -2
  219. package/src/services/sitemap/isHrefActive.ts +14 -6
  220. package/src/services/sitemap/isTopItemActive.ts +3 -3
  221. package/src/ui-kit/TopItem/TopItem.tsx +1 -1
  222. package/src/utils/url.ts +1 -9
  223. package/tailwind.config.cjs +2 -0
  224. package/bundle/services/sitemap/isSubItemActive.d.ts +0 -4
  225. package/bundle/utils/adjustHref.d.ts +0 -1
  226. package/dist/services/sitemap/isSubItemActive.d.ts +0 -4
  227. package/dist/services/sitemap/isSubItemActive.js +0 -6
  228. package/dist/services/sitemap/isSubItemActive.js.map +0 -1
  229. package/dist/utils/adjustHref.d.ts +0 -1
  230. package/dist/utils/adjustHref.js +0 -9
  231. package/dist/utils/adjustHref.js.map +0 -1
  232. package/lib/services/sitemap/isSubItemActive.d.ts +0 -4
  233. package/lib/services/sitemap/isSubItemActive.js +0 -3
  234. package/lib/services/sitemap/isSubItemActive.js.map +0 -1
  235. package/lib/utils/adjustHref.d.ts +0 -1
  236. package/lib/utils/adjustHref.js +0 -6
  237. package/lib/utils/adjustHref.js.map +0 -1
  238. package/mobile/bundle/services/sitemap/isSubItemActive.d.ts +0 -4
  239. package/mobile/bundle/utils/adjustHref.d.ts +0 -1
  240. package/mobile/dist/services/sitemap/isSubItemActive.d.ts +0 -4
  241. package/mobile/dist/services/sitemap/isSubItemActive.js +0 -6
  242. package/mobile/dist/services/sitemap/isSubItemActive.js.map +0 -1
  243. package/mobile/dist/utils/adjustHref.d.ts +0 -1
  244. package/mobile/dist/utils/adjustHref.js +0 -9
  245. package/mobile/dist/utils/adjustHref.js.map +0 -1
  246. package/mobile/lib/services/sitemap/isSubItemActive.d.ts +0 -4
  247. package/mobile/lib/services/sitemap/isSubItemActive.js +0 -3
  248. package/mobile/lib/services/sitemap/isSubItemActive.js.map +0 -1
  249. package/mobile/lib/utils/adjustHref.d.ts +0 -1
  250. package/mobile/lib/utils/adjustHref.js +0 -6
  251. package/mobile/lib/utils/adjustHref.js.map +0 -1
  252. package/mobile/src/services/sitemap/isSubItemActive.ts +0 -7
  253. package/mobile/src/utils/adjustHref.ts +0 -7
  254. package/src/services/sitemap/isSubItemActive.ts +0 -7
  255. package/src/utils/adjustHref.ts +0 -7
@@ -1,12 +1,12 @@
1
1
  import type { Router } from '../../hooks/useRouter';
2
2
  import type { LinkProps } from '../../model/LinkProps';
3
3
  import { maxBy } from '../../utils/maxBy';
4
- import { isSubItemActive } from './isSubItemActive';
4
+ import { isHrefActive } from './isHrefActive';
5
5
 
6
6
  export const findActiveSubItem =
7
7
  (router: Router) =>
8
8
  <T extends LinkProps>(items: T[] = []): T | undefined => {
9
- const possibleActiveSubItems = items?.filter(isSubItemActive(router));
9
+ const possibleActiveSubItems = items?.filter(isHrefActive(router));
10
10
 
11
11
  return possibleActiveSubItems?.length
12
12
  ? maxBy((_: T) => _.href?.length || 0)(possibleActiveSubItems) // More specific item with max length
@@ -1,7 +1,15 @@
1
- import { adjustHref } from '../../utils/adjustHref';
2
- import { getPathname, isURL, withoutQuery } from '../../utils/url';
1
+ import type { Router } from '../../hooks/useRouter';
2
+ import { projectSettings } from '../../ProjectSettings';
3
+ import { isURL, withoutQuery } from '../../utils/url';
3
4
 
4
- export const isHrefActive = (href: string | undefined, router: { href?: string }) =>
5
- withoutQuery(isURL(href) ? router.href : getPathname(router.href)).startsWith(
6
- withoutQuery(adjustHref(href)),
7
- );
5
+ export const isHrefActive =
6
+ (router: Router) =>
7
+ ({ href }: { href?: string }): boolean => {
8
+ const { BASE_PATH } = projectSettings;
9
+ const relativeHref =
10
+ BASE_PATH && href?.startsWith(BASE_PATH) ? href.substring(BASE_PATH.length) : href;
11
+
12
+ return withoutQuery(isURL(href) ? router.href : router.pathname).startsWith(
13
+ withoutQuery(relativeHref),
14
+ );
15
+ };
@@ -1,8 +1,8 @@
1
+ import type { Router } from '../../hooks/useRouter';
1
2
  import { isHrefActive } from './isHrefActive';
2
- import { isSubItemActive } from './isSubItemActive';
3
3
  import { TopMenuItem } from './SitemapProps';
4
4
 
5
5
  export const isTopItemActive =
6
- (router: { href?: string }) =>
6
+ (router: Router) =>
7
7
  (topItem: TopMenuItem): boolean =>
8
- topItem.items?.some(isSubItemActive(router)) || isHrefActive(topItem.href, router);
8
+ topItem.items?.some(isHrefActive(router)) || isHrefActive(router)(topItem);
@@ -15,7 +15,7 @@ export interface TopItemProps extends TopItemContent {
15
15
  }
16
16
 
17
17
  export const TopItem = JSX<TopItemProps>(({ className = '', active, flat, children, ...rest }) => {
18
- const link = useLink();
18
+ const link = useLink(true);
19
19
  const { href, target, text, onClick } = link(rest);
20
20
 
21
21
  return (
package/src/utils/url.ts CHANGED
@@ -1,18 +1,10 @@
1
1
  import type { Target } from '../model/LinkProps';
2
- import { projectSettings } from '../ProjectSettings';
3
2
 
4
3
  export const isURL = (href?: string): href is `${string}//${string}` =>
5
4
  Boolean(href?.includes('//'));
6
5
 
7
6
  export const isLocalURL = (href: string | undefined, target?: Target) =>
8
- Boolean(
9
- href &&
10
- !isURL(href) &&
11
- (projectSettings.BASE_PATH
12
- ? href.startsWith(projectSettings.BASE_PATH)
13
- : !href.startsWith('/')) &&
14
- (!target || target === '_self'),
15
- );
7
+ Boolean(href && !isURL(href) && (!target || target === '_self'));
16
8
 
17
9
  export const isHash = (href?: string): href is `#${string}` => Boolean(href?.startsWith('#'));
18
10
 
@@ -59,6 +59,7 @@ module.exports = {
59
59
  'm-title': ['1.375rem', '1.8125rem'], // 22px 29px // Временно оставлен до готовности нового мобильного дизайна
60
60
  'm-title-xs': ['1.0625rem', '1.375rem'], // 17px 22px // Временно оставлен до готовности нового мобильного дизайна
61
61
 
62
+ 'title-large': ['7.5rem', '10rem'], // 120px 160px
62
63
  'title-extra': ['15.625rem', '14.687rem'], // 250px 235px
63
64
  'title-huge': ['12.5rem', '15.625rem'], // 200px 250px
64
65
  h0: [
@@ -237,6 +238,7 @@ module.exports = {
237
238
  'green-dark': 'rgba(var(--color-green-dark), <alpha-value>)',
238
239
  'green-more-dark': 'rgba(var(--color-green-more-dark), <alpha-value>)',
239
240
  yellow: 'rgba(var(--color-yellow), <alpha-value>)',
241
+ 'yellow-light': 'rgba(206, 200, 51, <alpha-value>)',
240
242
  gray: 'rgba(var(--color-gray), <alpha-value>)',
241
243
  error: 'rgba(242, 48, 48, <alpha-value>)',
242
244
  },
@@ -1,4 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- export declare const isSubItemActive: (router: {
3
- href?: string;
4
- }) => (subItem: LinkProps) => boolean;
@@ -1 +0,0 @@
1
- export declare const adjustHref: (href: string | undefined) => string | undefined;
@@ -1,4 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- export declare const isSubItemActive: (router: {
3
- href?: string;
4
- }) => (subItem: LinkProps) => boolean;
@@ -1,6 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.isSubItemActive = void 0;
3
- const isHrefActive_1 = require("./isHrefActive");
4
- const isSubItemActive = (router) => (subItem) => (0, isHrefActive_1.isHrefActive)(subItem.href, router);
5
- exports.isSubItemActive = isSubItemActive;
6
- //# sourceMappingURL=isSubItemActive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSubItemActive.js","sourceRoot":"","sources":["../../../src/services/sitemap/isSubItemActive.ts"],"names":[],"mappings":";;AACA,iDAA8C;AAEvC,MAAM,eAAe,GAC1B,CAAC,MAAyB,EAAE,EAAE,CAC9B,CAAC,OAAkB,EAAW,EAAE,CAC9B,IAAA,2BAAY,EAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAH1B,QAAA,eAAe,mBAGW"}
@@ -1 +0,0 @@
1
- export declare const adjustHref: (href: string | undefined) => string | undefined;
@@ -1,9 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.adjustHref = void 0;
3
- const ProjectSettings_1 = require("../ProjectSettings");
4
- const url_1 = require("./url");
5
- const adjustHref = (href) => href && ProjectSettings_1.projectSettings.BASE_PATH && !((0, url_1.isURL)(href) || href.startsWith('/'))
6
- ? `${ProjectSettings_1.projectSettings.BASE_PATH}${href}`
7
- : href;
8
- exports.adjustHref = adjustHref;
9
- //# sourceMappingURL=adjustHref.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustHref.js","sourceRoot":"","sources":["../../src/utils/adjustHref.ts"],"names":[],"mappings":";;AAAA,wDAAqD;AACrD,+BAA8B;AAEvB,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,EAAE,CACrD,IAAI,IAAI,iCAAe,CAAC,SAAS,IAAI,CAAC,CAAC,IAAA,WAAK,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC,CAAC,GAAG,iCAAe,CAAC,SAAS,GAAG,IAAI,EAAE;IACvC,CAAC,CAAC,IAAI,CAAC;AAHE,QAAA,UAAU,cAGZ"}
@@ -1,4 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- export declare const isSubItemActive: (router: {
3
- href?: string;
4
- }) => (subItem: LinkProps) => boolean;
@@ -1,3 +0,0 @@
1
- import { isHrefActive } from './isHrefActive.js';
2
- export const isSubItemActive = (router) => (subItem) => isHrefActive(subItem.href, router);
3
- //# sourceMappingURL=isSubItemActive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSubItemActive.js","sourceRoot":"","sources":["../../../src/services/sitemap/isSubItemActive.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,MAAyB,EAAE,EAAE,CAC9B,CAAC,OAAkB,EAAW,EAAE,CAC9B,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const adjustHref: (href: string | undefined) => string | undefined;
@@ -1,6 +0,0 @@
1
- import { projectSettings } from '../ProjectSettings.js';
2
- import { isURL } from './url.js';
3
- export const adjustHref = (href) => href && projectSettings.BASE_PATH && !(isURL(href) || href.startsWith('/'))
4
- ? `${projectSettings.BASE_PATH}${href}`
5
- : href;
6
- //# sourceMappingURL=adjustHref.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustHref.js","sourceRoot":"","sources":["../../src/utils/adjustHref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,EAAE,CACrD,IAAI,IAAI,eAAe,CAAC,SAAS,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC,CAAC,GAAG,eAAe,CAAC,SAAS,GAAG,IAAI,EAAE;IACvC,CAAC,CAAC,IAAI,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- export declare const isSubItemActive: (router: {
3
- href?: string;
4
- }) => (subItem: LinkProps) => boolean;
@@ -1 +0,0 @@
1
- export declare const adjustHref: (href: string | undefined) => string | undefined;
@@ -1,4 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- export declare const isSubItemActive: (router: {
3
- href?: string;
4
- }) => (subItem: LinkProps) => boolean;
@@ -1,6 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.isSubItemActive = void 0;
3
- const isHrefActive_1 = require("./isHrefActive");
4
- const isSubItemActive = (router) => (subItem) => (0, isHrefActive_1.isHrefActive)(subItem.href, router);
5
- exports.isSubItemActive = isSubItemActive;
6
- //# sourceMappingURL=isSubItemActive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSubItemActive.js","sourceRoot":"","sources":["../../../src/services/sitemap/isSubItemActive.ts"],"names":[],"mappings":";;AACA,iDAA8C;AAEvC,MAAM,eAAe,GAC1B,CAAC,MAAyB,EAAE,EAAE,CAC9B,CAAC,OAAkB,EAAW,EAAE,CAC9B,IAAA,2BAAY,EAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAH1B,QAAA,eAAe,mBAGW"}
@@ -1 +0,0 @@
1
- export declare const adjustHref: (href: string | undefined) => string | undefined;
@@ -1,9 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.adjustHref = void 0;
3
- const ProjectSettings_1 = require("../ProjectSettings");
4
- const url_1 = require("./url");
5
- const adjustHref = (href) => href && ProjectSettings_1.projectSettings.BASE_PATH && !((0, url_1.isURL)(href) || href.startsWith('/'))
6
- ? `${ProjectSettings_1.projectSettings.BASE_PATH}${href}`
7
- : href;
8
- exports.adjustHref = adjustHref;
9
- //# sourceMappingURL=adjustHref.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustHref.js","sourceRoot":"","sources":["../../src/utils/adjustHref.ts"],"names":[],"mappings":";;AAAA,wDAAqD;AACrD,+BAA8B;AAEvB,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,EAAE,CACrD,IAAI,IAAI,iCAAe,CAAC,SAAS,IAAI,CAAC,CAAC,IAAA,WAAK,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC,CAAC,GAAG,iCAAe,CAAC,SAAS,GAAG,IAAI,EAAE;IACvC,CAAC,CAAC,IAAI,CAAC;AAHE,QAAA,UAAU,cAGZ"}
@@ -1,4 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- export declare const isSubItemActive: (router: {
3
- href?: string;
4
- }) => (subItem: LinkProps) => boolean;
@@ -1,3 +0,0 @@
1
- import { isHrefActive } from './isHrefActive.js';
2
- export const isSubItemActive = (router) => (subItem) => isHrefActive(subItem.href, router);
3
- //# sourceMappingURL=isSubItemActive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isSubItemActive.js","sourceRoot":"","sources":["../../../src/services/sitemap/isSubItemActive.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,MAAyB,EAAE,EAAE,CAC9B,CAAC,OAAkB,EAAW,EAAE,CAC9B,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export declare const adjustHref: (href: string | undefined) => string | undefined;
@@ -1,6 +0,0 @@
1
- import { projectSettings } from '../ProjectSettings.js';
2
- import { isURL } from './url.js';
3
- export const adjustHref = (href) => href && projectSettings.BASE_PATH && !(isURL(href) || href.startsWith('/'))
4
- ? `${projectSettings.BASE_PATH}${href}`
5
- : href;
6
- //# sourceMappingURL=adjustHref.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustHref.js","sourceRoot":"","sources":["../../src/utils/adjustHref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAwB,EAAE,EAAE,CACrD,IAAI,IAAI,eAAe,CAAC,SAAS,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACzE,CAAC,CAAC,GAAG,eAAe,CAAC,SAAS,GAAG,IAAI,EAAE;IACvC,CAAC,CAAC,IAAI,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- import { isHrefActive } from './isHrefActive';
3
-
4
- export const isSubItemActive =
5
- (router: { href?: string }) =>
6
- (subItem: LinkProps): boolean =>
7
- isHrefActive(subItem.href, router);
@@ -1,7 +0,0 @@
1
- import { projectSettings } from '../ProjectSettings';
2
- import { isURL } from './url';
3
-
4
- export const adjustHref = (href: string | undefined) =>
5
- href && projectSettings.BASE_PATH && !(isURL(href) || href.startsWith('/'))
6
- ? `${projectSettings.BASE_PATH}${href}`
7
- : href;
@@ -1,7 +0,0 @@
1
- import type { LinkProps } from '../../model/LinkProps';
2
- import { isHrefActive } from './isHrefActive';
3
-
4
- export const isSubItemActive =
5
- (router: { href?: string }) =>
6
- (subItem: LinkProps): boolean =>
7
- isHrefActive(subItem.href, router);
@@ -1,7 +0,0 @@
1
- import { projectSettings } from '../ProjectSettings';
2
- import { isURL } from './url';
3
-
4
- export const adjustHref = (href: string | undefined) =>
5
- href && projectSettings.BASE_PATH && !(isURL(href) || href.startsWith('/'))
6
- ? `${projectSettings.BASE_PATH}${href}`
7
- : href;