@gravity-ui/page-constructor 5.18.1-alpha.2 → 5.18.1-alpha.3

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 (201) hide show
  1. package/build/cjs/blocks/Banner/Banner.js +2 -2
  2. package/build/cjs/blocks/CardLayout/schema.d.ts +32 -0
  3. package/build/cjs/blocks/ContentLayout/schema.d.ts +34 -6
  4. package/build/cjs/blocks/Header/Header.css +3 -0
  5. package/build/cjs/blocks/Header/Header.js +2 -1
  6. package/build/cjs/blocks/Header/schema.d.ts +30 -3
  7. package/build/cjs/blocks/HeaderSlider/schema.d.ts +11 -1
  8. package/build/cjs/blocks/Media/schema.d.ts +16 -2
  9. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +8 -1
  10. package/build/cjs/blocks/Slider/Arrow/Arrow.css +1 -1
  11. package/build/cjs/blocks/Slider/Slider.css +20 -1
  12. package/build/cjs/blocks/Slider/Slider.js +83 -29
  13. package/build/cjs/blocks/Slider/i18n/en.json +3 -1
  14. package/build/cjs/blocks/Slider/i18n/index.d.ts +1 -1
  15. package/build/cjs/blocks/Slider/i18n/ru.json +3 -1
  16. package/build/cjs/blocks/Slider/utils.d.ts +10 -0
  17. package/build/cjs/blocks/Slider/utils.js +85 -1
  18. package/build/cjs/blocks/SliderNew/Arrow/Arrow.d.ts +3 -1
  19. package/build/cjs/blocks/SliderNew/Arrow/Arrow.js +2 -2
  20. package/build/cjs/blocks/SliderNew/Slider.css +4 -1
  21. package/build/cjs/blocks/SliderNew/Slider.js +20 -8
  22. package/build/cjs/blocks/SliderNew/i18n/en.json +3 -1
  23. package/build/cjs/blocks/SliderNew/i18n/index.d.ts +1 -1
  24. package/build/cjs/blocks/SliderNew/i18n/ru.json +3 -1
  25. package/build/cjs/blocks/SliderNew/useSlider.d.ts +8 -6
  26. package/build/cjs/blocks/SliderNew/useSlider.js +4 -2
  27. package/build/cjs/blocks/SliderNew/useSliderPagination.d.ts +9 -0
  28. package/build/cjs/blocks/SliderNew/useSliderPagination.js +36 -0
  29. package/build/cjs/blocks/SliderNew/utils.d.ts +2 -0
  30. package/build/cjs/blocks/SliderNew/utils.js +13 -1
  31. package/build/cjs/blocks/Tabs/schema.d.ts +8 -1
  32. package/build/cjs/components/ButtonTabs/ButtonTabs.js +3 -2
  33. package/build/cjs/components/DefaultVideo/DefaultVideo.js +3 -3
  34. package/build/cjs/components/FullscreenImage/FullscreenImage.css +6 -2
  35. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +14 -11
  36. package/build/cjs/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -2
  37. package/build/cjs/components/Image/Image.js +2 -2
  38. package/build/cjs/components/Image/schema.d.ts +40 -0
  39. package/build/cjs/components/Image/schema.js +8 -0
  40. package/build/cjs/components/ImageBase/ImageBase.d.ts +1 -1
  41. package/build/cjs/components/ImageBase/ImageBase.js +8 -2
  42. package/build/cjs/components/Media/Media.js +4 -3
  43. package/build/cjs/components/Media/Video/Video.js +2 -2
  44. package/build/cjs/components/ReactPlayer/ReactPlayer.css +7 -0
  45. package/build/cjs/components/ReactPlayer/ReactPlayer.d.ts +1 -0
  46. package/build/cjs/components/ReactPlayer/ReactPlayer.js +15 -4
  47. package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
  48. package/build/cjs/components/VideoBlock/VideoBlock.js +24 -37
  49. package/build/cjs/constructor-items.d.ts +4 -4
  50. package/build/cjs/containers/PageConstructor/PageConstructor.js +3 -1
  51. package/build/cjs/context/imageContext/imageContext.d.ts +2 -3
  52. package/build/cjs/context/projectSettingsContext/ProjectSettingsContext.d.ts +1 -0
  53. package/build/cjs/editor/components/AddBlock/AddBlock.js +23 -6
  54. package/build/cjs/editor/data/index.d.ts +3 -2
  55. package/build/cjs/editor/data/index.js +19 -12
  56. package/build/cjs/models/constructor-items/common.d.ts +9 -4
  57. package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
  58. package/build/cjs/models/navigation.d.ts +8 -0
  59. package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.css +42 -3
  60. package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.d.ts +1 -1
  61. package/build/cjs/navigation/components/DesktopNavigation/DesktopNavigation.js +7 -2
  62. package/build/cjs/navigation/components/Logo/Logo.d.ts +1 -1
  63. package/build/cjs/navigation/components/Logo/Logo.js +3 -1
  64. package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -1
  65. package/build/cjs/navigation/components/MobileNavigation/MobileNavigation.js +3 -1
  66. package/build/cjs/navigation/components/Navigation/Navigation.d.ts +2 -2
  67. package/build/cjs/navigation/components/Navigation/Navigation.js +5 -24
  68. package/build/cjs/navigation/components/NavigationItem/NavigationItem.d.ts +1 -1
  69. package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +3 -1
  70. package/build/cjs/navigation/components/NavigationItem/hooks/useNavigationItemMap.d.ts +5 -5
  71. package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.d.ts +1 -1
  72. package/build/cjs/navigation/components/NavigationListItem/NavigationListItem.js +3 -1
  73. package/build/cjs/navigation/components/Standalone/index.d.ts +2 -2
  74. package/build/cjs/navigation/containers/Layout/Layout.js +2 -1
  75. package/build/cjs/navigation/hooks/index.d.ts +2 -0
  76. package/build/cjs/navigation/hooks/index.js +10 -0
  77. package/build/cjs/navigation/hooks/useActiveNavItem.d.ts +26 -0
  78. package/build/cjs/navigation/hooks/useActiveNavItem.js +15 -0
  79. package/build/cjs/navigation/hooks/useShowBorder.d.ts +2 -0
  80. package/build/cjs/navigation/hooks/useShowBorder.js +21 -0
  81. package/build/cjs/navigation/index.d.ts +14 -0
  82. package/build/cjs/navigation/index.js +16 -4
  83. package/build/cjs/navigation/models.d.ts +1 -0
  84. package/build/cjs/schema/constants.d.ts +16 -1
  85. package/build/cjs/schema/validators/common.d.ts +14 -1
  86. package/build/cjs/schema/validators/common.js +8 -1
  87. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +8 -0
  88. package/build/cjs/sub-blocks/BannerCard/BannerCard.js +3 -3
  89. package/build/cjs/sub-blocks/Content/Content.css +4 -4
  90. package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +8 -4
  91. package/build/cjs/sub-blocks/ImageCard/ImageCard.css +34 -1
  92. package/build/cjs/sub-blocks/ImageCard/ImageCard.js +1 -1
  93. package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +8 -1
  94. package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +1 -1
  95. package/build/cjs/sub-blocks/LayoutItem/utils.js +1 -1
  96. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +8 -1
  97. package/build/cjs/text-transform/utils.js +1 -1
  98. package/build/esm/blocks/Banner/Banner.js +2 -2
  99. package/build/esm/blocks/CardLayout/schema.d.ts +32 -0
  100. package/build/esm/blocks/ContentLayout/schema.d.ts +34 -6
  101. package/build/esm/blocks/Header/Header.css +3 -0
  102. package/build/esm/blocks/Header/Header.js +2 -1
  103. package/build/esm/blocks/Header/schema.d.ts +30 -3
  104. package/build/esm/blocks/HeaderSlider/schema.d.ts +11 -1
  105. package/build/esm/blocks/Media/schema.d.ts +16 -2
  106. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +8 -1
  107. package/build/esm/blocks/Slider/Arrow/Arrow.css +1 -1
  108. package/build/esm/blocks/Slider/Slider.css +20 -1
  109. package/build/esm/blocks/Slider/Slider.js +84 -30
  110. package/build/esm/blocks/Slider/i18n/en.json +3 -1
  111. package/build/esm/blocks/Slider/i18n/index.d.ts +1 -1
  112. package/build/esm/blocks/Slider/i18n/ru.json +3 -1
  113. package/build/esm/blocks/Slider/utils.d.ts +10 -0
  114. package/build/esm/blocks/Slider/utils.js +82 -0
  115. package/build/esm/blocks/SliderNew/Arrow/Arrow.d.ts +3 -1
  116. package/build/esm/blocks/SliderNew/Arrow/Arrow.js +2 -2
  117. package/build/esm/blocks/SliderNew/Slider.css +4 -1
  118. package/build/esm/blocks/SliderNew/Slider.js +20 -8
  119. package/build/esm/blocks/SliderNew/i18n/en.json +3 -1
  120. package/build/esm/blocks/SliderNew/i18n/index.d.ts +1 -1
  121. package/build/esm/blocks/SliderNew/i18n/ru.json +3 -1
  122. package/build/esm/blocks/SliderNew/useSlider.d.ts +8 -6
  123. package/build/esm/blocks/SliderNew/useSlider.js +6 -3
  124. package/build/esm/blocks/SliderNew/useSliderPagination.d.ts +9 -0
  125. package/build/esm/blocks/SliderNew/useSliderPagination.js +32 -0
  126. package/build/esm/blocks/SliderNew/utils.d.ts +2 -0
  127. package/build/esm/blocks/SliderNew/utils.js +10 -0
  128. package/build/esm/blocks/Tabs/schema.d.ts +8 -1
  129. package/build/esm/components/ButtonTabs/ButtonTabs.js +3 -2
  130. package/build/esm/components/DefaultVideo/DefaultVideo.js +3 -3
  131. package/build/esm/components/FullscreenImage/FullscreenImage.css +6 -2
  132. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.css +14 -11
  133. package/build/esm/components/HeaderBreadcrumbs/HeaderBreadcrumbs.js +4 -2
  134. package/build/esm/components/Image/Image.js +2 -2
  135. package/build/esm/components/Image/schema.d.ts +40 -0
  136. package/build/esm/components/Image/schema.js +8 -0
  137. package/build/esm/components/ImageBase/ImageBase.d.ts +1 -1
  138. package/build/esm/components/ImageBase/ImageBase.js +9 -2
  139. package/build/esm/components/Media/Media.js +5 -4
  140. package/build/esm/components/Media/Video/Video.js +2 -2
  141. package/build/esm/components/ReactPlayer/ReactPlayer.css +7 -0
  142. package/build/esm/components/ReactPlayer/ReactPlayer.d.ts +1 -0
  143. package/build/esm/components/ReactPlayer/ReactPlayer.js +15 -4
  144. package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
  145. package/build/esm/components/VideoBlock/VideoBlock.js +25 -38
  146. package/build/esm/constructor-items.d.ts +4 -4
  147. package/build/esm/containers/PageConstructor/PageConstructor.js +4 -2
  148. package/build/esm/context/imageContext/imageContext.d.ts +2 -3
  149. package/build/esm/context/projectSettingsContext/ProjectSettingsContext.d.ts +1 -0
  150. package/build/esm/editor/components/AddBlock/AddBlock.js +24 -7
  151. package/build/esm/editor/data/index.d.ts +3 -2
  152. package/build/esm/editor/data/index.js +18 -12
  153. package/build/esm/models/constructor-items/common.d.ts +9 -4
  154. package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
  155. package/build/esm/models/navigation.d.ts +8 -0
  156. package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.css +42 -3
  157. package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.d.ts +1 -1
  158. package/build/esm/navigation/components/DesktopNavigation/DesktopNavigation.js +4 -1
  159. package/build/esm/navigation/components/Logo/Logo.d.ts +1 -1
  160. package/build/esm/navigation/components/Logo/Logo.js +1 -1
  161. package/build/esm/navigation/components/MobileNavigation/MobileNavigation.d.ts +1 -1
  162. package/build/esm/navigation/components/MobileNavigation/MobileNavigation.js +1 -1
  163. package/build/esm/navigation/components/Navigation/Navigation.d.ts +2 -2
  164. package/build/esm/navigation/components/Navigation/Navigation.js +6 -25
  165. package/build/esm/navigation/components/NavigationItem/NavigationItem.d.ts +1 -1
  166. package/build/esm/navigation/components/NavigationItem/NavigationItem.js +1 -1
  167. package/build/esm/navigation/components/NavigationItem/hooks/useNavigationItemMap.d.ts +5 -5
  168. package/build/esm/navigation/components/NavigationListItem/NavigationListItem.d.ts +1 -1
  169. package/build/esm/navigation/components/NavigationListItem/NavigationListItem.js +1 -1
  170. package/build/esm/navigation/components/Standalone/index.d.ts +2 -2
  171. package/build/esm/navigation/containers/Layout/Layout.js +2 -1
  172. package/build/esm/navigation/hooks/index.d.ts +2 -0
  173. package/build/esm/navigation/hooks/index.js +2 -0
  174. package/build/esm/navigation/hooks/useActiveNavItem.d.ts +26 -0
  175. package/build/esm/navigation/hooks/useActiveNavItem.js +13 -0
  176. package/build/esm/navigation/hooks/useShowBorder.d.ts +2 -0
  177. package/build/esm/navigation/hooks/useShowBorder.js +19 -0
  178. package/build/esm/navigation/index.d.ts +14 -0
  179. package/build/esm/navigation/index.js +14 -0
  180. package/build/esm/navigation/models.d.ts +1 -0
  181. package/build/esm/schema/constants.d.ts +16 -1
  182. package/build/esm/schema/validators/common.d.ts +14 -1
  183. package/build/esm/schema/validators/common.js +8 -1
  184. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +8 -0
  185. package/build/esm/sub-blocks/BannerCard/BannerCard.js +3 -3
  186. package/build/esm/sub-blocks/Content/Content.css +4 -4
  187. package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +8 -4
  188. package/build/esm/sub-blocks/ImageCard/ImageCard.css +34 -1
  189. package/build/esm/sub-blocks/ImageCard/ImageCard.js +1 -1
  190. package/build/esm/sub-blocks/LayoutItem/schema.d.ts +8 -1
  191. package/build/esm/sub-blocks/LayoutItem/utils.d.ts +1 -1
  192. package/build/esm/sub-blocks/LayoutItem/utils.js +1 -1
  193. package/build/esm/sub-blocks/MediaCard/schema.d.ts +8 -1
  194. package/build/esm/text-transform/utils.js +1 -1
  195. package/package.json +8 -5
  196. package/server/models/constructor-items/common.d.ts +9 -4
  197. package/server/models/constructor-items/sub-blocks.d.ts +2 -1
  198. package/server/models/navigation.d.ts +8 -0
  199. package/server/text-transform/utils.js +1 -1
  200. package/styles/variables.scss +1 -0
  201. package/widget/index.js +1 -1
@@ -4,6 +4,7 @@ import Navigation from '../../components/Navigation/Navigation';
4
4
  import './Layout.css';
5
5
  const b = block('layout');
6
6
  const Layout = ({ children, navigation }) => (React.createElement("div", { className: b() },
7
- navigation && (React.createElement(Navigation, { data: navigation.header, logo: navigation.logo, className: b('navigation') })),
7
+ navigation &&
8
+ (navigation.renderNavigation ? (navigation.renderNavigation()) : (React.createElement(Navigation, { data: navigation.header, logo: navigation.logo, className: b('navigation') }))),
8
9
  React.createElement("main", { className: b('content') }, children)));
9
10
  export default Layout;
@@ -0,0 +1,2 @@
1
+ export { default as useActiveNavItem } from './useActiveNavItem';
2
+ export { default as useShowBorder } from './useShowBorder';
@@ -0,0 +1,2 @@
1
+ export { default as useActiveNavItem } from './useActiveNavItem';
2
+ export { default as useShowBorder } from './useShowBorder';
@@ -0,0 +1,26 @@
1
+ import { NavigationItemModel } from '../../models';
2
+ declare const useActiveNavItem: (iconSize: number, leftItems: NavigationItemModel[], rightItems?: NavigationItemModel[]) => {
3
+ activeItemId: string | undefined;
4
+ leftItemsWithIconSize: (import("../../models").NavigationButtonItem | import("../../models").NavigationDropdownItem | {
5
+ type: import("../../models").NavigationItemType.Link;
6
+ url: string;
7
+ urlTitle?: string | undefined;
8
+ arrow?: boolean | undefined;
9
+ target?: string | undefined;
10
+ text: string;
11
+ icon?: import("../../models").ImageProps | undefined;
12
+ iconSize?: number | undefined;
13
+ })[];
14
+ rightItemsWithIconSize: (import("../../models").NavigationButtonItem | import("../../models").NavigationDropdownItem | {
15
+ type: import("../../models").NavigationItemType.Link;
16
+ url: string;
17
+ urlTitle?: string | undefined;
18
+ arrow?: boolean | undefined;
19
+ target?: string | undefined;
20
+ text: string;
21
+ icon?: import("../../models").ImageProps | undefined;
22
+ iconSize?: number | undefined;
23
+ })[] | undefined;
24
+ onActiveItemChange: (id?: string) => void;
25
+ };
26
+ export default useActiveNavItem;
@@ -0,0 +1,13 @@
1
+ import { useMemo, useState } from 'react';
2
+ import { getNavigationItemWithIconSize } from '../utils';
3
+ const useActiveNavItem = (iconSize, leftItems, rightItems) => {
4
+ const [activeItemId, setActiveItemId] = useState(undefined);
5
+ const getNavigationItem = getNavigationItemWithIconSize(iconSize);
6
+ const leftItemsWithIconSize = useMemo(() => leftItems.map(getNavigationItem), [getNavigationItem, leftItems]);
7
+ const rightItemsWithIconSize = useMemo(() => rightItems === null || rightItems === void 0 ? void 0 : rightItems.map(getNavigationItem), [getNavigationItem, rightItems]);
8
+ const onActiveItemChange = (id) => {
9
+ setActiveItemId(id);
10
+ };
11
+ return { activeItemId, leftItemsWithIconSize, rightItemsWithIconSize, onActiveItemChange };
12
+ };
13
+ export default useActiveNavItem;
@@ -0,0 +1,2 @@
1
+ declare const useShowBorder: (withBorder: boolean, withBorderOnScroll: boolean) => boolean[];
2
+ export default useShowBorder;
@@ -0,0 +1,19 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { debounce } from 'lodash';
3
+ const useShowBorder = (withBorder, withBorderOnScroll) => {
4
+ const [showBorder, setShowBorder] = useState(withBorder);
5
+ useEffect(() => {
6
+ if (!withBorderOnScroll)
7
+ return () => { };
8
+ const showBorderOnScroll = () => {
9
+ if (!withBorder) {
10
+ setShowBorder(window.scrollY > 0);
11
+ }
12
+ };
13
+ const scrollHandler = debounce(showBorderOnScroll, 20);
14
+ window.addEventListener('scroll', scrollHandler, { passive: true });
15
+ return () => window.removeEventListener('scroll', scrollHandler);
16
+ });
17
+ return [showBorder];
18
+ };
19
+ export default useShowBorder;
@@ -1 +1,15 @@
1
+ export * from './components/Navigation/Navigation';
2
+ export * from './components/DesktopNavigation/DesktopNavigation';
3
+ export * from './components/MobileNavigation/MobileNavigation';
4
+ export * from './components/MobileMenuButton/MobileMenuButton';
5
+ export * from './components/NavigationList/NavigationList';
6
+ export * from './components/NavigationListItem/NavigationListItem';
7
+ export * from './components/NavigationItem/';
8
+ export * from './components/NavigationItem/NavigationItem';
9
+ export * from './components/NavigationPopup/NavigationPopup';
10
+ export * from './components/SocialIcon/SocialIcon';
11
+ export * from './components/Logo/Logo';
12
+ export * from './hooks';
13
+ export * from './models';
14
+ export * from './utils';
1
15
  export { default as Navigation } from './components/Standalone';
@@ -1 +1,15 @@
1
+ export * from './components/Navigation/Navigation';
2
+ export * from './components/DesktopNavigation/DesktopNavigation';
3
+ export * from './components/MobileNavigation/MobileNavigation';
4
+ export * from './components/MobileMenuButton/MobileMenuButton';
5
+ export * from './components/NavigationList/NavigationList';
6
+ export * from './components/NavigationListItem/NavigationListItem';
7
+ export * from './components/NavigationItem/';
8
+ export * from './components/NavigationItem/NavigationItem';
9
+ export * from './components/NavigationPopup/NavigationPopup';
10
+ export * from './components/SocialIcon/SocialIcon';
11
+ export * from './components/Logo/Logo';
12
+ export * from './hooks';
13
+ export * from './models';
14
+ export * from './utils';
1
15
  export { default as Navigation } from './components/Standalone';
@@ -44,6 +44,7 @@ export interface DesktopNavigationProps extends MobileMenuButtonProps, ActiveIte
44
44
  logo: ThemedNavigationLogoData;
45
45
  leftItemsWithIconSize: NavigationItemModel[];
46
46
  rightItemsWithIconSize?: NavigationItemModel[];
47
+ customMobileHeaderItems?: NavigationItemModel[];
47
48
  }
48
49
  export interface MobileNavigationProps extends ClassNameProps, ActiveItemProps {
49
50
  isOpened?: boolean;
@@ -796,6 +796,14 @@ export declare const cardSchemas: {
796
796
  disableCompress: {
797
797
  type: string;
798
798
  };
799
+ loading: {
800
+ type: string;
801
+ enum: string[];
802
+ };
803
+ fetchPriority: {
804
+ type: string;
805
+ enum: string[];
806
+ };
799
807
  };
800
808
  } & {
801
809
  optionName: string;
@@ -1541,11 +1549,17 @@ export declare const cardSchemas: {
1541
1549
  ariaLabel: {
1542
1550
  type: string;
1543
1551
  };
1552
+ contain: {
1553
+ type: string;
1554
+ };
1544
1555
  };
1545
1556
  };
1546
1557
  youtube: {
1547
1558
  type: string;
1548
1559
  };
1560
+ videoIframe: {
1561
+ type: string;
1562
+ };
1549
1563
  parallax: {
1550
1564
  type: string;
1551
1565
  };
@@ -1579,7 +1593,8 @@ export declare const cardSchemas: {
1579
1593
  type: string;
1580
1594
  };
1581
1595
  ratio: {
1582
- type: string;
1596
+ type: string[];
1597
+ pattern: string;
1583
1598
  };
1584
1599
  iframe: {
1585
1600
  type: string;
@@ -203,6 +203,9 @@ export declare const VideoProps: {
203
203
  ariaLabel: {
204
204
  type: string;
205
205
  };
206
+ contain: {
207
+ type: string;
208
+ };
206
209
  };
207
210
  };
208
211
  export declare const ThemeProps: {
@@ -365,6 +368,9 @@ export declare const BackgroundProps: {
365
368
  ariaLabel: {
366
369
  type: string;
367
370
  };
371
+ contain: {
372
+ type: string;
373
+ };
368
374
  };
369
375
  };
370
376
  height: {
@@ -1129,11 +1135,17 @@ export declare const MediaProps: {
1129
1135
  ariaLabel: {
1130
1136
  type: string;
1131
1137
  };
1138
+ contain: {
1139
+ type: string;
1140
+ };
1132
1141
  };
1133
1142
  };
1134
1143
  youtube: {
1135
1144
  type: string;
1136
1145
  };
1146
+ videoIframe: {
1147
+ type: string;
1148
+ };
1137
1149
  parallax: {
1138
1150
  type: string;
1139
1151
  };
@@ -1245,7 +1257,8 @@ export declare const MediaProps: {
1245
1257
  })[];
1246
1258
  };
1247
1259
  ratio: {
1248
- type: string;
1260
+ type: string[];
1261
+ pattern: string;
1249
1262
  };
1250
1263
  iframe: {
1251
1264
  type: string;
@@ -160,6 +160,9 @@ export const VideoProps = {
160
160
  ariaLabel: {
161
161
  type: 'string',
162
162
  },
163
+ contain: {
164
+ type: 'boolean',
165
+ },
163
166
  },
164
167
  };
165
168
  export const ThemeProps = {
@@ -522,6 +525,9 @@ export const MediaProps = {
522
525
  youtube: {
523
526
  type: 'string',
524
527
  },
528
+ videoIframe: {
529
+ type: 'string',
530
+ },
525
531
  parallax: {
526
532
  type: 'boolean',
527
533
  },
@@ -539,7 +545,8 @@ export const MediaProps = {
539
545
  anyOf: [AnalyticsEventSchema, { type: 'array', items: AnalyticsEventSchema }],
540
546
  },
541
547
  ratio: {
542
- type: 'number',
548
+ type: ['number', 'string'],
549
+ pattern: '^auto$',
543
550
  },
544
551
  iframe: Object.assign({}, IframeProps),
545
552
  margins: {
@@ -45,6 +45,14 @@ export declare const BackgroundCard: {
45
45
  disableCompress: {
46
46
  type: string;
47
47
  };
48
+ loading: {
49
+ type: string;
50
+ enum: string[];
51
+ };
52
+ fetchPriority: {
53
+ type: string;
54
+ enum: string[];
55
+ };
48
56
  };
49
57
  } & {
50
58
  optionName: string;
@@ -5,7 +5,7 @@ import { block, getThemedValue } from '../../utils';
5
5
  import './BannerCard.css';
6
6
  const b = block('banner-card');
7
7
  export const BannerCard = (props) => {
8
- const { title, subtitle, button: { url, text, target, theme: buttonTheme = 'raised' }, color, theme: textTheme = 'light', image, disableCompress, mediaView = 'full', } = props;
8
+ const { title, subtitle, button: { url, text, target, theme: buttonTheme = 'raised' } = {}, color, theme: textTheme = 'light', image, disableCompress, mediaView = 'full', } = props;
9
9
  const theme = useTheme();
10
10
  const contentStyle = {};
11
11
  if (color) {
@@ -18,8 +18,8 @@ export const BannerCard = (props) => {
18
18
  React.createElement("h2", { className: b('title') },
19
19
  React.createElement(HTML, null, title)),
20
20
  subtitle && (React.createElement(YFMWrapper, { className: b('subtitle'), content: subtitle, modifiers: { constructor: true } }))),
21
- React.createElement(RouterLink, { href: url },
22
- React.createElement(Button, { className: b('button'), theme: buttonTheme, size: "xl", text: text, url: url, target: target }))),
21
+ url && (React.createElement(RouterLink, { href: url },
22
+ React.createElement(Button, { className: b('button'), theme: buttonTheme, size: "xl", text: text !== null && text !== void 0 ? text : '', url: url, target: target })))),
23
23
  React.createElement(BackgroundImage, { className: b('image'), src: getThemedValue(image, theme), disableCompress: disableCompress }))));
24
24
  };
25
25
  export default BannerCard;
@@ -148,12 +148,12 @@ unpredictable css rules order in build */
148
148
  .pc-content_theme_light .pc-content__title a:hover {
149
149
  color: var(--g-color-text-dark-secondary);
150
150
  }
151
- .pc-content_control-position_bottom .pc-content__notice:has(+ .pc-content__buttons), .pc-content_control-position_bottom .pc-content__notice:has(+ .pc-content__link),
151
+ .pc-content_control-position_bottom .pc-content__notice:has(+ .pc-content__buttons), .pc-content_control-position_bottom .pc-content__notice:has(+ .pc-content__links),
152
152
  .pc-content_control-position_bottom .pc-content__list:has(+ .pc-content__buttons),
153
- .pc-content_control-position_bottom .pc-content__list:has(+ .pc-content__link),
153
+ .pc-content_control-position_bottom .pc-content__list:has(+ .pc-content__links),
154
154
  .pc-content_control-position_bottom .pc-content__text:has(+ .pc-content__buttons),
155
- .pc-content_control-position_bottom .pc-content__text:has(+ .pc-content__link),
155
+ .pc-content_control-position_bottom .pc-content__text:has(+ .pc-content__links),
156
156
  .pc-content_control-position_bottom .pc-content__title:has(+ .pc-content__buttons),
157
- .pc-content_control-position_bottom .pc-content__title:has(+ .pc-content__link) {
157
+ .pc-content_control-position_bottom .pc-content__title:has(+ .pc-content__links) {
158
158
  margin-bottom: auto;
159
159
  }
@@ -234,16 +234,18 @@ unpredictable css rules order in build */
234
234
  }
235
235
  .pc-hubspot-form .hs-richtext p {
236
236
  color: var(--g-color-text-primary);
237
+ font-family: var(--g-text-body-font-family);
238
+ font-weight: var(--g-text-body-font-weight);
237
239
  font-size: var(--g-text-body-2-font-size);
238
240
  line-height: var(--g-text-body-2-line-height);
239
- font-weight: var(--g-text-body-font-weight);
240
241
  margin: 20px 0;
241
242
  }
242
243
  .pc-hubspot-form .hs_error_rollup {
243
244
  padding-left: 10px;
245
+ font-family: var(--g-text-body-font-family);
246
+ font-weight: var(--g-text-body-font-weight);
244
247
  font-size: var(--g-text-body-1-font-size);
245
248
  line-height: var(--g-text-body-1-line-height);
246
- font-weight: var(--g-text-body-font-weight);
247
249
  color: var(--g-color-text-danger);
248
250
  }
249
251
  .pc-hubspot-form .legal-consent-container {
@@ -274,9 +276,10 @@ unpredictable css rules order in build */
274
276
  order: 4;
275
277
  }
276
278
  .pc-hubspot-form .hs-error-msg {
279
+ font-family: var(--g-text-body-font-family);
280
+ font-weight: var(--g-text-body-font-weight);
277
281
  font-size: var(--g-text-body-1-font-size);
278
282
  line-height: var(--g-text-body-1-line-height);
279
- font-weight: var(--g-text-body-font-weight);
280
283
  color: var(--g-color-text-danger);
281
284
  display: block;
282
285
  }
@@ -333,9 +336,10 @@ unpredictable css rules order in build */
333
336
  border: 1px solid var(--g-color-line-generic);
334
337
  }
335
338
  .pc-hubspot-form .hs_recaptcha div {
339
+ font-family: var(--g-text-body-font-family);
340
+ font-weight: var(--g-text-body-font-weight);
336
341
  font-size: var(--g-text-body-2-font-size);
337
342
  line-height: var(--g-text-body-2-line-height);
338
- font-weight: var(--g-text-body-font-weight);
339
343
  }
340
344
  .pc-hubspot-form_mobile .hs-richtext,
341
345
  .pc-hubspot-form_mobile .hs-form-field,
@@ -1,4 +1,4 @@
1
- .pc-image-card_border_shadow {
1
+ a.pc-image-card_border_shadow, .pc-image-card_border_shadow {
2
2
  box-shadow: 0px 4px 24px var(--pc-color-sfx-shadow), 0px 2px 8px var(--pc-color-sfx-shadow);
3
3
  }
4
4
 
@@ -58,4 +58,37 @@ unpredictable css rules order in build */
58
58
  }
59
59
  .pc-image-card_with-content.pc-image-card_direction_reverse .pc-image-card__content {
60
60
  padding-bottom: 24px;
61
+ }
62
+
63
+ a.pc-image-card {
64
+ color: inherit;
65
+ text-decoration: none;
66
+ min-height: 248px;
67
+ height: 100%;
68
+ overflow-x: hidden;
69
+ border-radius: var(--pc-border-radius);
70
+ background-color: var(--g-color-base-float);
71
+ transition: box-shadow 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
72
+ }
73
+ a.pc-image-card:hover, a.pc-image-card:active {
74
+ --pc-text-header-color: inherit;
75
+ color: inherit;
76
+ }
77
+ a.pc-image-card_border_line {
78
+ border: 1px solid var(--g-color-line-generic);
79
+ }
80
+ a.pc-image-card_border_line, a.pc-image-card_border_none {
81
+ transition: transform 0.3s ease-out;
82
+ }
83
+ a.pc-image-card_border_line:hover, a.pc-image-card_border_none:hover {
84
+ transform: translateY(-8px);
85
+ }
86
+ a.pc-image-card_border_shadow {
87
+ transition: transform 0.3s ease-out;
88
+ }
89
+ a.pc-image-card_border_shadow:hover {
90
+ transform: translateY(-8px);
91
+ }
92
+ a.pc-image-card_border_shadow:hover {
93
+ background-color: var(--pc-color-base-float-hover);
61
94
  }
@@ -22,7 +22,7 @@ const ImageCard = (props) => {
22
22
  React.createElement(Image, Object.assign({ className: b('image_inner', { radius: enableImageBorderRadius }) }, imageProps))),
23
23
  hasContent && (React.createElement("div", { className: b('content') },
24
24
  React.createElement(Content, { titleId: titleId, title: title, text: text, links: links, buttons: buttons, list: list, theme: cardTheme, additionalInfo: additionalInfo, size: size, colSizes: CONTENT_COL_SIZES, controlPosition: areControlsInFooter ? 'bottom' : 'default' })))));
25
- return url ? (React.createElement(Link, { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: b({ border, 'with-content': hasContent, direction }), title: urlTitle, extraProps: {
25
+ return url ? (React.createElement(Link, { href: url, target: target, rel: target === '_blank' ? 'noopener noreferrer' : undefined, className: b({ border, 'with-content': hasContent, direction }), title: urlTitle, style: { backgroundColor }, extraProps: {
26
26
  draggable: false,
27
27
  onDragStart: (e) => e.preventDefault(),
28
28
  } }, cardContent)) : (React.createElement("div", { className: b({ border, 'with-content': hasContent, direction }), style: { backgroundColor } }, cardContent));
@@ -157,11 +157,17 @@ export declare const LayoutItem: {
157
157
  ariaLabel: {
158
158
  type: string;
159
159
  };
160
+ contain: {
161
+ type: string;
162
+ };
160
163
  };
161
164
  };
162
165
  youtube: {
163
166
  type: string;
164
167
  };
168
+ videoIframe: {
169
+ type: string;
170
+ };
165
171
  parallax: {
166
172
  type: string;
167
173
  };
@@ -273,7 +279,8 @@ export declare const LayoutItem: {
273
279
  })[];
274
280
  };
275
281
  ratio: {
276
- type: string;
282
+ type: string[];
283
+ pattern: string;
277
284
  };
278
285
  iframe: {
279
286
  type: string;
@@ -14,4 +14,4 @@ export declare const getLayoutItemLinks: (links: LayoutItemProps['content']['lin
14
14
  tabIndex?: number | undefined;
15
15
  }[] | undefined;
16
16
  export declare const hasFullscreen: ({ dataLens, image }: MediaProps) => boolean;
17
- export declare const showFullscreenIcon: ({ youtube }: MediaProps) => boolean;
17
+ export declare const showFullscreenIcon: ({ youtube, videoIframe }: MediaProps) => boolean;
@@ -3,4 +3,4 @@ export const hasFullscreen = ({ dataLens, image }) => {
3
3
  // datalens and slider media card don't support fullscreen mode
4
4
  return !(dataLens || Array.isArray(image));
5
5
  };
6
- export const showFullscreenIcon = ({ youtube }) => !youtube;
6
+ export const showFullscreenIcon = ({ youtube, videoIframe }) => !(youtube || videoIframe);
@@ -240,11 +240,17 @@ export declare const MediaCardBlock: {
240
240
  ariaLabel: {
241
241
  type: string;
242
242
  };
243
+ contain: {
244
+ type: string;
245
+ };
243
246
  };
244
247
  };
245
248
  youtube: {
246
249
  type: string;
247
250
  };
251
+ videoIframe: {
252
+ type: string;
253
+ };
248
254
  parallax: {
249
255
  type: string;
250
256
  };
@@ -278,7 +284,8 @@ export declare const MediaCardBlock: {
278
284
  type: string;
279
285
  };
280
286
  ratio: {
281
- type: string;
287
+ type: string[];
288
+ pattern: string;
282
289
  };
283
290
  iframe: {
284
291
  type: string;
@@ -49,7 +49,7 @@ export function typograf(text, lang = 'ru') {
49
49
  en: ['en-US', 'ru'],
50
50
  };
51
51
  const tp = new Typograf({
52
- locale: localeByLang[lang],
52
+ locale: localeByLang[lang] || lang,
53
53
  htmlEntity: { type: 'name' },
54
54
  });
55
55
  enableRules(tp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "5.18.1-alpha.2",
3
+ "version": "5.18.1-alpha.3",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -80,6 +80,7 @@
80
80
  "test:watch": "jest --watchAll",
81
81
  "playwright": "playwright test --config=playwright/playwright.config.ts",
82
82
  "playwright:update": "npm run playwright -- -u",
83
+ "playwright:clear-cache": "rm -rf ./playwright/.cache",
83
84
  "playwright:docker": "./scripts/playwright-docker.sh 'npm run playwright'",
84
85
  "playwright:docker:update": "./scripts/playwright-docker.sh 'npm run playwright:update'",
85
86
  "playwright:docker:clear-cache": "./scripts/playwright-docker.sh clear-cache",
@@ -87,8 +88,8 @@
87
88
  },
88
89
  "dependencies": {
89
90
  "@bem-react/classname": "^1.6.0",
90
- "@gravity-ui/components": "^3.0.0",
91
- "@gravity-ui/dynamic-forms": "^4.0.0",
91
+ "@gravity-ui/components": "^3.8.0",
92
+ "@gravity-ui/dynamic-forms": "^4.11.0",
92
93
  "@gravity-ui/i18n": "^1.3.0",
93
94
  "@react-spring/web": "^9.7.3",
94
95
  "ajv": "^8.12.0",
@@ -125,11 +126,11 @@
125
126
  "@commitlint/config-conventional": "^17.1.0",
126
127
  "@diplodoc/transform": "^4.10.8",
127
128
  "@gravity-ui/eslint-config": "^2.2.0",
128
- "@gravity-ui/icons": "^2.8.1",
129
+ "@gravity-ui/icons": "^2.10.0",
129
130
  "@gravity-ui/prettier-config": "^1.0.1",
130
131
  "@gravity-ui/stylelint-config": "^1.0.0",
131
132
  "@gravity-ui/tsconfig": "^1.0.0",
132
- "@gravity-ui/uikit": "^6.2.0",
133
+ "@gravity-ui/uikit": "^6.23.1",
133
134
  "@playwright/experimental-ct-react": "^1.45.3",
134
135
  "@playwright/test": "^1.45.3",
135
136
  "@storybook/addon-actions": "8.0.5",
@@ -202,6 +203,8 @@
202
203
  "ts-jest": "^29.0.3",
203
204
  "tslib": "^2.4.0",
204
205
  "typescript": "^4.9.4",
206
+ "vite-plugin-commonjs": "^0.10.1",
207
+ "vite-plugin-svgr": "^4.2.0",
205
208
  "webpack": "^5.88.2",
206
209
  "webpack-cli": "^5.1.4",
207
210
  "webpack-shell-plugin-next": "^2.3.1"
@@ -1,4 +1,4 @@
1
- import React, { CSSProperties, HTMLProps, ReactNode } from 'react';
1
+ import React, { CSSProperties, DetailedHTMLProps, HTMLProps, ImgHTMLAttributes, ReactNode } from 'react';
2
2
  import { ButtonView, ButtonProps as UikitButtonProps } from '@gravity-ui/uikit';
3
3
  import { ThemeSupporting } from '../../utils';
4
4
  import { AnalyticsEventsBase, AnalyticsEventsProp, ClassNameProps, QAProps } from '../common';
@@ -96,8 +96,9 @@ interface LoopProps {
96
96
  start: number;
97
97
  end?: number;
98
98
  }
99
- export interface ImageInfoProps extends Pick<HTMLProps<HTMLImageElement>, 'aria-describedby'> {
99
+ export interface ImageInfoProps extends Pick<DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, 'aria-describedby' | 'loading'> {
100
100
  alt?: string;
101
+ fetchPriority?: 'high' | 'low' | 'auto';
101
102
  disableCompress?: boolean;
102
103
  }
103
104
  export interface ImageObjectProps extends ImageInfoProps {
@@ -126,6 +127,7 @@ export interface MediaVideoProps extends AnalyticsEventsBase {
126
127
  controls?: MediaVideoControlsType;
127
128
  customControlsOptions?: CustomControlsOptions;
128
129
  ariaLabel?: string;
130
+ contain?: boolean;
129
131
  }
130
132
  export interface LinkProps extends AnalyticsEventsBase, Stylable, Tabbable {
131
133
  url: string;
@@ -178,9 +180,12 @@ export type ThemedMediaVideoProps = ThemeSupporting<MediaVideoProps>;
178
180
  export interface MediaComponentVideoProps extends AnalyticsEventsBase {
179
181
  video: MediaVideoProps;
180
182
  height?: number;
181
- ratio?: number;
183
+ ratio?: number | 'auto';
182
184
  previewImg?: string;
183
185
  }
186
+ export interface MediaComponentVideoIframeProps {
187
+ videoIframe: string;
188
+ }
184
189
  export interface MediaComponentYoutubeProps {
185
190
  youtube: string;
186
191
  previewImg?: string;
@@ -200,7 +205,7 @@ export interface MediaComponentIframeProps {
200
205
  iframe: IframeProps;
201
206
  margins?: boolean;
202
207
  }
203
- export interface MediaProps extends Animatable, Partial<MediaComponentDataLensProps>, Partial<MediaComponentYoutubeProps>, Partial<MediaComponentImageProps>, Partial<MediaComponentIframeProps>, Partial<MediaComponentVideoProps> {
208
+ export interface MediaProps extends Animatable, Partial<MediaComponentDataLensProps>, Partial<MediaComponentYoutubeProps>, Partial<MediaComponentVideoIframeProps>, Partial<MediaComponentImageProps>, Partial<MediaComponentIframeProps>, Partial<MediaComponentVideoProps> {
204
209
  color?: string;
205
210
  }
206
211
  export interface BackgroundMediaProps extends MediaProps, Animatable, QAProps {
@@ -113,11 +113,12 @@ export interface BasicCardProps extends CardBaseProps, AnalyticsEventsBase, Card
113
113
  export interface BannerCardProps {
114
114
  title: string;
115
115
  subtitle?: string;
116
+ className?: string;
116
117
  image?: ThemeSupporting<string>;
117
118
  disableCompress?: boolean;
118
119
  color?: ThemeSupporting<string>;
119
120
  theme?: TextTheme;
120
- button: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;
121
+ button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;
121
122
  mediaView?: MediaView;
122
123
  }
123
124
  export interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ThemeSupporting } from '../utils';
2
3
  import { ButtonProps, ImageProps } from './constructor-items';
3
4
  export declare enum NavigationItemType {
@@ -69,6 +70,12 @@ export type ThemedNavigationLogoData = NavigationLogoData & ThemeSupporting<Navi
69
70
  export interface HeaderData {
70
71
  leftItems: NavigationItemModel[];
71
72
  rightItems?: NavigationItemModel[];
73
+ /**
74
+ * Items for the navigation header on mobile devices.
75
+ * They are located to the right of the Logo and to the left of the MobileMenuButton.
76
+ * @type {NavigationItemModel[]}
77
+ */
78
+ customMobileHeaderItems?: NavigationItemModel[];
72
79
  iconSize?: number;
73
80
  withBorder?: boolean;
74
81
  withBorderOnScroll?: boolean;
@@ -90,4 +97,5 @@ export interface NavigationData {
90
97
  logo: ThemedNavigationLogoData;
91
98
  header: HeaderData;
92
99
  footer?: FooterData;
100
+ renderNavigation?: () => React.ReactNode;
93
101
  }
@@ -66,7 +66,7 @@ function typograf(text, lang = 'ru') {
66
66
  en: ['en-US', 'ru'],
67
67
  };
68
68
  const tp = new typograf_1.default({
69
- locale: localeByLang[lang],
69
+ locale: localeByLang[lang] || lang,
70
70
  htmlEntity: { type: 'name' },
71
71
  });
72
72
  enableRules(tp);
@@ -37,6 +37,7 @@ $animationDuration: 300ms;
37
37
 
38
38
  //colors
39
39
  $videoPlayButtonGrey: #eff2f8;
40
+ $videoPlayerBg: #000;
40
41
  $secondary: var(--g-color-text-secondary);
41
42
  $lightSecondary: var(--g-color-text-light-secondary);
42
43