@gravity-ui/page-constructor 1.8.0-alfa.0 → 1.8.0

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 (222) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +58 -36
  3. package/build/cjs/blocks/Banner/schema.d.ts +0 -12
  4. package/build/cjs/blocks/Banner/schema.js +0 -2
  5. package/build/cjs/blocks/CardLayout/schema.d.ts +0 -8
  6. package/build/cjs/blocks/CardLayout/schema.js +1 -2
  7. package/build/cjs/blocks/Companies/schema.d.ts +0 -2
  8. package/build/cjs/blocks/Companies/schema.js +0 -2
  9. package/build/cjs/blocks/ContentLayout/schema.d.ts +0 -6
  10. package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
  11. package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +0 -7
  12. package/build/cjs/blocks/ExtendedFeatures/schema.js +1 -4
  13. package/build/cjs/blocks/Header/schema.d.ts +0 -16
  14. package/build/cjs/blocks/Header/schema.js +0 -5
  15. package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -11
  16. package/build/cjs/blocks/Icons/schema.d.ts +0 -6
  17. package/build/cjs/blocks/Icons/schema.js +0 -2
  18. package/build/cjs/blocks/Info/schema.d.ts +0 -10
  19. package/build/cjs/blocks/Info/schema.js +0 -2
  20. package/build/cjs/blocks/LinkTable/schema.d.ts +0 -2
  21. package/build/cjs/blocks/Media/schema.d.ts +0 -9
  22. package/build/cjs/blocks/Media/schema.js +1 -3
  23. package/build/cjs/blocks/Preview/schema.d.ts +0 -2
  24. package/build/cjs/blocks/Preview/schema.js +0 -4
  25. package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +0 -7
  26. package/build/cjs/blocks/PromoFeaturesBlock/schema.js +1 -4
  27. package/build/cjs/blocks/Questions/schema.d.ts +0 -5
  28. package/build/cjs/blocks/Questions/schema.js +0 -2
  29. package/build/cjs/blocks/Security/schema.d.ts +0 -2
  30. package/build/cjs/blocks/Security/schema.js +0 -2
  31. package/build/cjs/blocks/Simple/schema.d.ts +0 -3
  32. package/build/cjs/blocks/Simple/schema.js +0 -1
  33. package/build/cjs/blocks/Slider/schema.d.ts +0 -7
  34. package/build/cjs/blocks/Slider/schema.js +0 -2
  35. package/build/cjs/blocks/Table/schema.d.ts +0 -4
  36. package/build/cjs/blocks/Table/schema.js +0 -3
  37. package/build/cjs/blocks/Tabs/schema.d.ts +0 -8
  38. package/build/cjs/blocks/Tabs/schema.js +0 -4
  39. package/build/cjs/components/Author/schema.d.ts +0 -3
  40. package/build/cjs/components/Image/schema.d.ts +0 -2
  41. package/build/cjs/components/Image/schema.js +0 -2
  42. package/build/cjs/components/OverflowScroller/OverflowScroller.css +2 -0
  43. package/build/cjs/components/RouterLink/RouterLink.d.ts +1 -0
  44. package/build/cjs/components/index.d.ts +2 -0
  45. package/build/cjs/components/index.js +40 -39
  46. package/build/cjs/components/navigation/components/Header/Header.css +85 -0
  47. package/build/cjs/components/navigation/components/Header/Header.d.ts +8 -0
  48. package/build/cjs/components/navigation/components/Header/Header.js +55 -0
  49. package/build/cjs/components/navigation/components/Logo/Logo.css +23 -0
  50. package/build/cjs/components/navigation/components/Logo/Logo.d.ts +7 -0
  51. package/build/cjs/components/navigation/components/Logo/Logo.js +17 -0
  52. package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.css +64 -0
  53. package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +13 -0
  54. package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.js +45 -0
  55. package/build/cjs/components/navigation/components/Navigation/Navigation.css +43 -0
  56. package/build/cjs/components/navigation/components/Navigation/Navigation.d.ts +18 -0
  57. package/build/cjs/components/navigation/components/Navigation/Navigation.js +69 -0
  58. package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.css +40 -0
  59. package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.d.ts +10 -0
  60. package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.js +59 -0
  61. package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.css +33 -0
  62. package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +10 -0
  63. package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.js +45 -0
  64. package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.css +20 -0
  65. package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.d.ts +7 -0
  66. package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.js +14 -0
  67. package/build/cjs/components/navigation/components/index.d.ts +7 -0
  68. package/build/cjs/components/navigation/components/index.js +20 -0
  69. package/build/cjs/components/navigation/containers/Layout/Layout.css +10 -0
  70. package/build/cjs/components/navigation/containers/Layout/Layout.d.ts +8 -0
  71. package/build/cjs/components/navigation/containers/Layout/Layout.js +11 -0
  72. package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +3 -2
  73. package/build/cjs/containers/PageConstructor/PageConstructor.js +12 -10
  74. package/build/cjs/context/locationContext/locationContext.d.ts +1 -0
  75. package/build/cjs/icons/NavigationArrow.d.ts +2 -0
  76. package/build/cjs/icons/NavigationArrow.js +9 -0
  77. package/build/cjs/icons/NavigationClose.d.ts +2 -0
  78. package/build/cjs/icons/NavigationClose.js +9 -0
  79. package/build/cjs/icons/NavigationOpen.d.ts +2 -0
  80. package/build/cjs/icons/NavigationOpen.js +11 -0
  81. package/build/cjs/icons/index.d.ts +3 -0
  82. package/build/cjs/icons/index.js +3 -0
  83. package/build/cjs/models/constructor-items/blocks.d.ts +2 -4
  84. package/build/cjs/models/index.d.ts +1 -0
  85. package/build/cjs/models/index.js +1 -0
  86. package/build/cjs/models/navigation.d.ts +62 -0
  87. package/build/cjs/models/navigation.js +10 -0
  88. package/build/cjs/schema/index.d.ts +0 -2
  89. package/build/cjs/schema/validators/common.d.ts +0 -17
  90. package/build/cjs/schema/validators/common.js +0 -11
  91. package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +0 -5
  92. package/build/cjs/sub-blocks/BasicCard/schema.d.ts +0 -4
  93. package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -8
  94. package/build/cjs/sub-blocks/CardWithImage/schema.js +1 -4
  95. package/build/cjs/sub-blocks/Content/schema.d.ts +0 -8
  96. package/build/cjs/sub-blocks/Content/schema.js +1 -3
  97. package/build/cjs/sub-blocks/MediaCard/schema.d.ts +0 -1
  98. package/build/cjs/sub-blocks/NewsCard/schema.d.ts +0 -1
  99. package/build/cjs/sub-blocks/NewsCard/schema.js +0 -1
  100. package/build/cjs/sub-blocks/Partner/schema.d.ts +0 -1
  101. package/build/cjs/sub-blocks/Partner/schema.js +0 -1
  102. package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +0 -1
  103. package/build/cjs/sub-blocks/PriceDetailed/schema.js +0 -8
  104. package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -4
  105. package/build/cjs/sub-blocks/Quote/schema.js +0 -1
  106. package/build/cjs/sub-blocks/TutorialCard/schema.d.ts +0 -2
  107. package/build/cjs/sub-blocks/TutorialCard/schema.js +0 -2
  108. package/build/cjs/text-transform/blocks.js +0 -1
  109. package/build/esm/blocks/Banner/schema.d.ts +0 -12
  110. package/build/esm/blocks/Banner/schema.js +0 -2
  111. package/build/esm/blocks/CardLayout/schema.d.ts +0 -8
  112. package/build/esm/blocks/CardLayout/schema.js +1 -2
  113. package/build/esm/blocks/Companies/schema.d.ts +0 -2
  114. package/build/esm/blocks/Companies/schema.js +0 -2
  115. package/build/esm/blocks/ContentLayout/schema.d.ts +0 -6
  116. package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
  117. package/build/esm/blocks/ExtendedFeatures/schema.d.ts +0 -7
  118. package/build/esm/blocks/ExtendedFeatures/schema.js +1 -4
  119. package/build/esm/blocks/Header/schema.d.ts +0 -16
  120. package/build/esm/blocks/Header/schema.js +0 -5
  121. package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -11
  122. package/build/esm/blocks/Icons/schema.d.ts +0 -6
  123. package/build/esm/blocks/Icons/schema.js +0 -2
  124. package/build/esm/blocks/Info/schema.d.ts +0 -10
  125. package/build/esm/blocks/Info/schema.js +0 -2
  126. package/build/esm/blocks/LinkTable/schema.d.ts +0 -2
  127. package/build/esm/blocks/Media/schema.d.ts +0 -9
  128. package/build/esm/blocks/Media/schema.js +1 -3
  129. package/build/esm/blocks/Preview/schema.d.ts +0 -2
  130. package/build/esm/blocks/Preview/schema.js +0 -4
  131. package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +0 -7
  132. package/build/esm/blocks/PromoFeaturesBlock/schema.js +1 -4
  133. package/build/esm/blocks/Questions/schema.d.ts +0 -5
  134. package/build/esm/blocks/Questions/schema.js +0 -2
  135. package/build/esm/blocks/Security/schema.d.ts +0 -2
  136. package/build/esm/blocks/Security/schema.js +0 -2
  137. package/build/esm/blocks/Simple/schema.d.ts +0 -3
  138. package/build/esm/blocks/Simple/schema.js +0 -1
  139. package/build/esm/blocks/Slider/schema.d.ts +0 -7
  140. package/build/esm/blocks/Slider/schema.js +0 -2
  141. package/build/esm/blocks/Table/schema.d.ts +0 -4
  142. package/build/esm/blocks/Table/schema.js +0 -3
  143. package/build/esm/blocks/Tabs/schema.d.ts +0 -8
  144. package/build/esm/blocks/Tabs/schema.js +0 -4
  145. package/build/esm/components/Author/schema.d.ts +0 -3
  146. package/build/esm/components/Image/schema.d.ts +0 -2
  147. package/build/esm/components/Image/schema.js +0 -2
  148. package/build/esm/components/OverflowScroller/OverflowScroller.css +2 -0
  149. package/build/esm/components/RouterLink/RouterLink.d.ts +1 -0
  150. package/build/esm/components/index.d.ts +2 -0
  151. package/build/esm/components/index.js +2 -0
  152. package/build/esm/components/navigation/components/Header/Header.css +85 -0
  153. package/build/esm/components/navigation/components/Header/Header.d.ts +9 -0
  154. package/build/esm/components/navigation/components/Header/Header.js +51 -0
  155. package/build/esm/components/navigation/components/Logo/Logo.css +23 -0
  156. package/build/esm/components/navigation/components/Logo/Logo.d.ts +8 -0
  157. package/build/esm/components/navigation/components/Logo/Logo.js +15 -0
  158. package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.css +64 -0
  159. package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +14 -0
  160. package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.js +43 -0
  161. package/build/esm/components/navigation/components/Navigation/Navigation.css +43 -0
  162. package/build/esm/components/navigation/components/Navigation/Navigation.d.ts +19 -0
  163. package/build/esm/components/navigation/components/Navigation/Navigation.js +68 -0
  164. package/build/esm/components/navigation/components/NavigationItem/NavigationItem.css +40 -0
  165. package/build/esm/components/navigation/components/NavigationItem/NavigationItem.d.ts +11 -0
  166. package/build/esm/components/navigation/components/NavigationItem/NavigationItem.js +58 -0
  167. package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.css +33 -0
  168. package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +11 -0
  169. package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.js +41 -0
  170. package/build/esm/components/navigation/components/SocialIcon/SocialIcon.css +20 -0
  171. package/build/esm/components/navigation/components/SocialIcon/SocialIcon.d.ts +8 -0
  172. package/build/esm/components/navigation/components/SocialIcon/SocialIcon.js +12 -0
  173. package/build/esm/components/navigation/components/index.d.ts +7 -0
  174. package/build/esm/components/navigation/components/index.js +7 -0
  175. package/build/esm/components/navigation/containers/Layout/Layout.css +10 -0
  176. package/build/esm/components/navigation/containers/Layout/Layout.d.ts +9 -0
  177. package/build/esm/components/navigation/containers/Layout/Layout.js +9 -0
  178. package/build/esm/containers/PageConstructor/PageConstructor.d.ts +3 -2
  179. package/build/esm/containers/PageConstructor/PageConstructor.js +12 -10
  180. package/build/esm/context/locationContext/locationContext.d.ts +1 -0
  181. package/build/esm/icons/NavigationArrow.d.ts +2 -0
  182. package/build/esm/icons/NavigationArrow.js +4 -0
  183. package/build/esm/icons/NavigationClose.d.ts +2 -0
  184. package/build/esm/icons/NavigationClose.js +4 -0
  185. package/build/esm/icons/NavigationOpen.d.ts +2 -0
  186. package/build/esm/icons/NavigationOpen.js +6 -0
  187. package/build/esm/icons/index.d.ts +3 -0
  188. package/build/esm/icons/index.js +3 -0
  189. package/build/esm/models/constructor-items/blocks.d.ts +2 -4
  190. package/build/esm/models/index.d.ts +1 -0
  191. package/build/esm/models/index.js +1 -0
  192. package/build/esm/models/navigation.d.ts +62 -0
  193. package/build/esm/models/navigation.js +7 -0
  194. package/build/esm/schema/index.d.ts +0 -2
  195. package/build/esm/schema/validators/common.d.ts +0 -17
  196. package/build/esm/schema/validators/common.js +0 -11
  197. package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +0 -5
  198. package/build/esm/sub-blocks/BasicCard/schema.d.ts +0 -4
  199. package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -8
  200. package/build/esm/sub-blocks/CardWithImage/schema.js +1 -4
  201. package/build/esm/sub-blocks/Content/schema.d.ts +0 -8
  202. package/build/esm/sub-blocks/Content/schema.js +1 -3
  203. package/build/esm/sub-blocks/MediaCard/schema.d.ts +0 -1
  204. package/build/esm/sub-blocks/NewsCard/schema.d.ts +0 -1
  205. package/build/esm/sub-blocks/NewsCard/schema.js +0 -1
  206. package/build/esm/sub-blocks/Partner/schema.d.ts +0 -1
  207. package/build/esm/sub-blocks/Partner/schema.js +0 -1
  208. package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +0 -1
  209. package/build/esm/sub-blocks/PriceDetailed/schema.js +0 -8
  210. package/build/esm/sub-blocks/Quote/schema.d.ts +0 -4
  211. package/build/esm/sub-blocks/Quote/schema.js +0 -1
  212. package/build/esm/sub-blocks/TutorialCard/schema.d.ts +0 -2
  213. package/build/esm/sub-blocks/TutorialCard/schema.js +0 -2
  214. package/build/esm/text-transform/blocks.js +0 -1
  215. package/package.json +2 -5
  216. package/server/models/constructor-items/blocks.d.ts +2 -4
  217. package/server/models/index.d.ts +1 -0
  218. package/server/models/index.js +1 -0
  219. package/server/models/navigation.d.ts +62 -0
  220. package/server/models/navigation.js +10 -0
  221. package/server/text-transform/blocks.js +0 -1
  222. package/styles/mixins.scss +38 -0
@@ -0,0 +1,20 @@
1
+ /* use this for style redefinitions to awoid problems with
2
+ unpredictable css rules order in build */
3
+ .pc-social-icon {
4
+ display: flex;
5
+ justify-content: center;
6
+ align-items: center;
7
+ width: 40px;
8
+ height: 40px;
9
+ margin-right: 8px;
10
+ color: var(--yc-color-base-background);
11
+ border-radius: 50%;
12
+ background-color: var(--yc-color-base-generic);
13
+ }
14
+ .pc-social-icon:hover {
15
+ background-color: var(--yc-color-base-generic-hover);
16
+ }
17
+ .pc-social-icon__icon {
18
+ width: 16px;
19
+ height: 16px;
20
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { NavigationSocialItem } from '../../../../models';
3
+ import './SocialIcon.css';
4
+ export interface NavigationSocialItemProps extends NavigationSocialItem {
5
+ className?: string;
6
+ }
7
+ declare const SocialIcon: React.FC<NavigationSocialItemProps>;
8
+ export default SocialIcon;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { block } from '../../../../utils';
3
+ import { Image } from '../../../index';
4
+ import { getMediaImage } from '../../../Media/Image/utils';
5
+ import './SocialIcon.css';
6
+ const b = block('social-icon');
7
+ const SocialIcon = ({ icon, url, className }) => {
8
+ const iconData = getMediaImage(icon);
9
+ return (React.createElement("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: b(null, className) },
10
+ React.createElement(Image, Object.assign({ className: b('icon') }, iconData))));
11
+ };
12
+ export default SocialIcon;
@@ -0,0 +1,7 @@
1
+ export { default as Header } from './Header/Header';
2
+ export { default as NavigationItem } from './NavigationItem/NavigationItem';
3
+ export { default as Logo } from './Logo/Logo';
4
+ export { default as MobileNavigation } from './MobileNavigation/MobileNavigation';
5
+ export { default as Navigation } from './Navigation/Navigation';
6
+ export { default as NavigationPopup } from './NavigationPopup/NavigationPopup';
7
+ export { default as SocialIcon } from './SocialIcon/SocialIcon';
@@ -0,0 +1,7 @@
1
+ export { default as Header } from './Header/Header';
2
+ export { default as NavigationItem } from './NavigationItem/NavigationItem';
3
+ export { default as Logo } from './Logo/Logo';
4
+ export { default as MobileNavigation } from './MobileNavigation/MobileNavigation';
5
+ export { default as Navigation } from './Navigation/Navigation';
6
+ export { default as NavigationPopup } from './NavigationPopup/NavigationPopup';
7
+ export { default as SocialIcon } from './SocialIcon/SocialIcon';
@@ -0,0 +1,10 @@
1
+ .layout {
2
+ display: flex;
3
+ flex-direction: column;
4
+ min-height: 100vh;
5
+ }
6
+ .layout__content {
7
+ display: flex;
8
+ flex-grow: 1;
9
+ flex-direction: column;
10
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { NavigationData } from '../../../../models';
3
+ import './Layout.css';
4
+ export interface LayoutProps {
5
+ navigation?: NavigationData;
6
+ children?: React.ReactNode;
7
+ }
8
+ declare const Layout: React.FC<LayoutProps>;
9
+ export default Layout;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { block } from '../../../../utils';
3
+ import Header from '../../components/Header/Header';
4
+ import './Layout.css';
5
+ const b = block('layout');
6
+ const Layout = ({ children, navigation }) => (React.createElement("div", { className: b() },
7
+ navigation && React.createElement(Header, { data: navigation.header, logo: navigation.logo }),
8
+ React.createElement("main", { className: b('content') }, children)));
9
+ export default Layout;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems } from '../../models';
3
- import { blockMap, subBlockMap } from '../../constructor-items';
4
2
  import '@doc-tools/transform/dist/js/yfm';
3
+ import { ShouldRenderBlock, CustomConfig, PageContent, CustomItems, NavigationData } from '../../models';
4
+ import { blockMap, subBlockMap } from '../../constructor-items';
5
5
  import './PageConstructor.css';
6
6
  export declare type ItemMap = typeof blockMap & typeof subBlockMap & CustomItems;
7
7
  export interface PageConstructorProps {
@@ -9,6 +9,7 @@ export interface PageConstructorProps {
9
9
  shouldRenderBlock?: ShouldRenderBlock;
10
10
  custom?: CustomConfig;
11
11
  renderMenu?: () => React.ReactNode;
12
+ navigation?: NavigationData;
12
13
  }
13
14
  export declare const Constructor: (props: PageConstructorProps) => JSX.Element;
14
15
  export declare const PageConstructor: (props: PageConstructorProps) => JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import { __rest } from "tslib";
2
2
  import React, { useContext, useMemo } from 'react';
3
+ import '@doc-tools/transform/dist/js/yfm';
3
4
  import { HeaderBlockTypes, BlockTypes, } from '../../models';
4
5
  import { blockMap, subBlockMap } from '../../constructor-items';
5
6
  import { Grid } from '../../grid';
@@ -12,7 +13,7 @@ import { ConstructorRow } from './components/ConstructorRow';
12
13
  import { ConstructorFootnotes } from './components/ConstructorFootnotes';
13
14
  import { ConstructorHeader } from './components/ConstructorItem';
14
15
  import { ConstructorBlocks } from './components/ConstructorBlocks';
15
- import '@doc-tools/transform/dist/js/yfm';
16
+ import Layout from '../../components/navigation/containers/Layout/Layout';
16
17
  import './PageConstructor.css';
17
18
  const b = cnBlock('page-constructor');
18
19
  export const Constructor = (props) => {
@@ -28,7 +29,7 @@ export const Constructor = (props) => {
28
29
  });
29
30
  }, [props.custom]);
30
31
  const { themeValue: theme } = useContext(ThemeValueContext);
31
- const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock, } = props;
32
+ const { content: { blocks = [], background = {}, footnotes = [] } = {}, renderMenu, shouldRenderBlock, navigation, } = props;
32
33
  const hasFootnotes = footnotes.length > 0;
33
34
  const isHeaderBlock = (block) => headerBlockTypes.includes(block.type);
34
35
  const header = blocks === null || blocks === void 0 ? void 0 : blocks.find(isHeaderBlock);
@@ -37,14 +38,15 @@ export const Constructor = (props) => {
37
38
  return (React.createElement(InnerContext.Provider, { value: context },
38
39
  React.createElement("div", { className: b() },
39
40
  React.createElement("div", { className: b('wrapper') },
40
- React.createElement(BackgroundMedia, Object.assign({}, themedBackground, { className: b('background') })),
41
- renderMenu && renderMenu(),
42
- header && React.createElement(ConstructorHeader, { data: header }),
43
- React.createElement(Grid, null,
44
- restBlocks && (React.createElement(ConstructorRow, null,
45
- React.createElement(ConstructorBlocks, { items: restBlocks, shouldRenderBlock: shouldRenderBlock }))),
46
- hasFootnotes && (React.createElement(ConstructorRow, null,
47
- React.createElement(ConstructorFootnotes, { items: footnotes }))))))));
41
+ themedBackground && (React.createElement(BackgroundMedia, Object.assign({}, themedBackground, { className: b('background') }))),
42
+ React.createElement(Layout, { navigation: navigation },
43
+ renderMenu && renderMenu(),
44
+ header && React.createElement(ConstructorHeader, { data: header }),
45
+ React.createElement(Grid, null,
46
+ restBlocks && (React.createElement(ConstructorRow, null,
47
+ React.createElement(ConstructorBlocks, { items: restBlocks, shouldRenderBlock: shouldRenderBlock }))),
48
+ hasFootnotes && (React.createElement(ConstructorRow, null,
49
+ React.createElement(ConstructorFootnotes, { items: footnotes })))))))));
48
50
  };
49
51
  export const PageConstructor = (props) => {
50
52
  const { content: { animated = true } = {} } = props, rest = __rest(props, ["content"]);
@@ -16,5 +16,6 @@ export declare type LocationContextProps = {
16
16
  pathname?: string;
17
17
  hostname?: string;
18
18
  Link?: RouterLink;
19
+ asPath?: string;
19
20
  };
20
21
  export declare const LocationContext: React.Context<LocationContextProps>;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const NavigationArrow: React.FC<React.SVGProps<SVGSVGElement>>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { a11yHiddenSvgProps } from '../utils/svg';
3
+ export const NavigationArrow = (props) => (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "9", height: "9", fill: "none", viewBox: "0 0 9 9" }, a11yHiddenSvgProps, props),
4
+ React.createElement("path", { d: "M3 1H8M8 1V6M8 1L1 8", stroke: "currentColor", strokeOpacity: "0.7", strokeWidth: "1.2", strokeLinecap: "square" })));
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const NavigationClose: React.FC<React.SVGProps<SVGSVGElement>>;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { a11yHiddenSvgProps } from '../utils/svg';
3
+ export const NavigationClose = (props) => (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", fill: "none" }, a11yHiddenSvgProps, props),
4
+ React.createElement("path", { d: "M26 10 10 26m16 0L10 10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })));
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const NavigationOpen: React.FC<React.SVGProps<SVGSVGElement>>;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { a11yHiddenSvgProps } from '../utils/svg';
3
+ export const NavigationOpen = (props) => (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "36", height: "36", fill: "none" }, a11yHiddenSvgProps, props),
4
+ React.createElement("rect", { x: "8", y: "10", width: "20", height: "2", rx: "1", fill: "currentColor" }),
5
+ React.createElement("rect", { x: "8", y: "17", width: "20", height: "2", rx: "1", fill: "currentColor" }),
6
+ React.createElement("rect", { x: "8", y: "24", width: "20", height: "2", rx: "1", fill: "currentColor" })));
@@ -6,3 +6,6 @@ export * from './Github';
6
6
  export * from './NavigationChevron';
7
7
  export * from './PlayVideo';
8
8
  export * from './PreviewClose';
9
+ export * from './NavigationClose';
10
+ export * from './NavigationOpen';
11
+ export * from './NavigationArrow';
@@ -6,3 +6,6 @@ export * from './Github';
6
6
  export * from './NavigationChevron';
7
7
  export * from './PlayVideo';
8
8
  export * from './PreviewClose';
9
+ export * from './NavigationClose';
10
+ export * from './NavigationOpen';
11
+ export * from './NavigationArrow';
@@ -114,14 +114,12 @@ export interface SimpleBlockProps extends Animatable, Childable {
114
114
  title: TitleBaseProps;
115
115
  description: string;
116
116
  }
117
- export interface ExtendedFeaturesItem {
118
- title?: string;
119
- text?: string;
117
+ export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
118
+ title: string;
120
119
  label?: string;
121
120
  icon?: ThemedImage;
122
121
  /** @deprecated **/
123
122
  link?: LinkProps;
124
- links?: LinkProps[];
125
123
  }
126
124
  export interface ExtendedFeaturesProps extends Animatable {
127
125
  items: ExtendedFeaturesItem[];
@@ -4,3 +4,4 @@ export * from './common';
4
4
  export * from './components';
5
5
  export * from './guards';
6
6
  export * from './react';
7
+ export * from './navigation';
@@ -4,3 +4,4 @@ export * from './common';
4
4
  export * from './components';
5
5
  export * from './guards';
6
6
  export * from './react';
7
+ export * from './navigation';
@@ -0,0 +1,62 @@
1
+ import { ImageProps, ButtonProps } from './constructor-items';
2
+ export declare enum NavigationItemType {
3
+ Link = "link",
4
+ Dropdown = "dropdown",
5
+ Button = "button",
6
+ Social = "social"
7
+ }
8
+ export interface NavigationItemBase {
9
+ text: string;
10
+ icon?: ImageProps;
11
+ url?: string;
12
+ }
13
+ export interface NavigationLinkItem extends NavigationItemBase {
14
+ type: NavigationItemType.Link;
15
+ url: string;
16
+ arrow?: boolean;
17
+ target?: string;
18
+ }
19
+ export interface NavigationButtonItem extends ButtonProps {
20
+ type: NavigationItemType.Button;
21
+ url: string;
22
+ target?: string;
23
+ }
24
+ export interface NavigationDropdownItem extends NavigationItemBase {
25
+ type: NavigationItemType.Dropdown;
26
+ items: NavigationLinkItem[];
27
+ }
28
+ export interface NavigationSocialItem extends Omit<NavigationItemBase, 'text'> {
29
+ type: NavigationItemType.Social;
30
+ icon: ImageProps;
31
+ url: string;
32
+ }
33
+ export declare type NavigationItem = NavigationLinkItem | NavigationButtonItem | NavigationDropdownItem;
34
+ export declare type NavigationItemData = NavigationLinkItem | NavigationButtonItem | NavigationSocialItem | DropdownItemData;
35
+ export declare type DropdownItemData = Omit<NavigationDropdownItem, 'items'>;
36
+ export interface NavigationLogo {
37
+ icon: ImageProps;
38
+ text?: string;
39
+ url?: string;
40
+ }
41
+ export interface HeaderData {
42
+ leftItems: NavigationItem[];
43
+ rightItems?: NavigationItem[];
44
+ }
45
+ export interface FooterColumn {
46
+ title: string;
47
+ links: NavigationItem[];
48
+ }
49
+ export interface FooterUnderline {
50
+ links?: NavigationItem[];
51
+ copyright?: string;
52
+ }
53
+ export interface FooterData {
54
+ columns: FooterColumn[];
55
+ social?: NavigationSocialItem[];
56
+ underline?: FooterUnderline;
57
+ }
58
+ export interface NavigationData {
59
+ logo: NavigationLogo;
60
+ header: HeaderData;
61
+ footer?: FooterData;
62
+ }
@@ -0,0 +1,7 @@
1
+ export var NavigationItemType;
2
+ (function (NavigationItemType) {
3
+ NavigationItemType["Link"] = "link";
4
+ NavigationItemType["Dropdown"] = "dropdown";
5
+ NavigationItemType["Button"] = "button";
6
+ NavigationItemType["Social"] = "social";
7
+ })(NavigationItemType || (NavigationItemType = {}));
@@ -43,7 +43,6 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
43
43
  properties: {
44
44
  title: {
45
45
  type: string;
46
- content: string;
47
46
  };
48
47
  };
49
48
  };
@@ -122,7 +121,6 @@ export declare function generateDefaultSchema(config?: SchemaCustomConfig): {
122
121
  };
123
122
  text: {
124
123
  type: string;
125
- content: string;
126
124
  };
127
125
  };
128
126
  };
@@ -83,7 +83,6 @@ export declare const PlayIconProps: {
83
83
  };
84
84
  text: {
85
85
  type: string;
86
- content: string;
87
86
  };
88
87
  };
89
88
  };
@@ -142,7 +141,6 @@ export declare const VideoProps: {
142
141
  };
143
142
  text: {
144
143
  type: string;
145
- content: string;
146
144
  };
147
145
  };
148
146
  };
@@ -266,7 +264,6 @@ export declare const BackgroundProps: {
266
264
  };
267
265
  text: {
268
266
  type: string;
269
- content: string;
270
267
  };
271
268
  };
272
269
  };
@@ -298,7 +295,6 @@ export declare const LinkProps: {
298
295
  properties: {
299
296
  text: {
300
297
  type: string;
301
- content: string;
302
298
  };
303
299
  url: {
304
300
  type: string;
@@ -332,7 +328,6 @@ export declare const FileLinkProps: {
332
328
  };
333
329
  text: {
334
330
  type: string;
335
- content: string;
336
331
  };
337
332
  type: {
338
333
  type: string;
@@ -354,11 +349,9 @@ export declare const authorItem: {
354
349
  properties: {
355
350
  firstName: {
356
351
  type: string;
357
- content: string;
358
352
  };
359
353
  secondName: {
360
354
  type: string;
361
- content: string;
362
355
  };
363
356
  avatar: {
364
357
  type: string;
@@ -366,14 +359,12 @@ export declare const authorItem: {
366
359
  };
367
360
  description: {
368
361
  type: string;
369
- content: string;
370
362
  };
371
363
  };
372
364
  };
373
365
  export declare const ButtonProps: {
374
366
  text: {
375
367
  type: string;
376
- content: string;
377
368
  };
378
369
  url: {
379
370
  type: string;
@@ -409,7 +400,6 @@ export declare const ButtonProps: {
409
400
  };
410
401
  alt: {
411
402
  type: string;
412
- content: string;
413
403
  };
414
404
  };
415
405
  })[];
@@ -510,7 +500,6 @@ export declare const MenuProps: {
510
500
  properties: {
511
501
  title: {
512
502
  type: string;
513
- content: string;
514
503
  };
515
504
  };
516
505
  };
@@ -529,7 +518,6 @@ export declare const AnchorProps: {
529
518
  properties: {
530
519
  text: {
531
520
  type: string;
532
- content: string;
533
521
  };
534
522
  url: {
535
523
  type: string;
@@ -544,7 +532,6 @@ export declare const BlockBaseProps: {
544
532
  properties: {
545
533
  text: {
546
534
  type: string;
547
- content: string;
548
535
  };
549
536
  url: {
550
537
  type: string;
@@ -568,7 +555,6 @@ export declare const TitleProps: {
568
555
  properties: {
569
556
  text: {
570
557
  type: string;
571
- content: string;
572
558
  };
573
559
  textSize: {
574
560
  type: string;
@@ -588,7 +574,6 @@ export declare const ButtonBlock: {
588
574
  properties: {
589
575
  text: {
590
576
  type: string;
591
- content: string;
592
577
  };
593
578
  url: {
594
579
  type: string;
@@ -624,7 +609,6 @@ export declare const ButtonBlock: {
624
609
  };
625
610
  alt: {
626
611
  type: string;
627
- content: string;
628
612
  };
629
613
  };
630
614
  })[];
@@ -822,7 +806,6 @@ export declare const MediaProps: {
822
806
  };
823
807
  text: {
824
808
  type: string;
825
- content: string;
826
809
  };
827
810
  };
828
811
  };
@@ -76,7 +76,6 @@ export const PlayIconProps = {
76
76
  },
77
77
  text: {
78
78
  type: 'string',
79
- content: 'string',
80
79
  },
81
80
  },
82
81
  };
@@ -160,7 +159,6 @@ export const LinkProps = {
160
159
  required: ['text', 'url'],
161
160
  properties: Object.assign(Object.assign({}, BaseProps), { text: {
162
161
  type: 'string',
163
- content: 'string',
164
162
  }, url: {
165
163
  type: 'string',
166
164
  }, arrow: {
@@ -186,7 +184,6 @@ export const FileLinkProps = {
186
184
  },
187
185
  text: {
188
186
  type: 'string',
189
- content: 'string',
190
187
  },
191
188
  type: {
192
189
  type: 'string',
@@ -208,11 +205,9 @@ export const authorItem = {
208
205
  properties: {
209
206
  firstName: {
210
207
  type: 'string',
211
- content: 'string',
212
208
  },
213
209
  secondName: {
214
210
  type: 'string',
215
- content: 'string',
216
211
  },
217
212
  avatar: {
218
213
  type: 'string',
@@ -220,14 +215,12 @@ export const authorItem = {
220
215
  },
221
216
  description: {
222
217
  type: 'string',
223
- content: 'yfm',
224
218
  },
225
219
  },
226
220
  };
227
221
  export const ButtonProps = {
228
222
  text: {
229
223
  type: 'string',
230
- content: 'string',
231
224
  },
232
225
  url: {
233
226
  type: 'string',
@@ -300,7 +293,6 @@ export const ButtonProps = {
300
293
  },
301
294
  alt: {
302
295
  type: 'string',
303
- content: 'string',
304
296
  },
305
297
  },
306
298
  },
@@ -340,7 +332,6 @@ export const MenuProps = {
340
332
  properties: {
341
333
  title: {
342
334
  type: 'string',
343
- content: 'string',
344
335
  },
345
336
  },
346
337
  };
@@ -364,7 +355,6 @@ export const AnchorProps = {
364
355
  properties: {
365
356
  text: {
366
357
  type: 'string',
367
- content: 'string',
368
358
  },
369
359
  url: {
370
360
  type: 'string',
@@ -384,7 +374,6 @@ export const TitleProps = {
384
374
  properties: {
385
375
  text: {
386
376
  type: 'string',
387
- content: 'string',
388
377
  },
389
378
  textSize: {
390
379
  type: 'string',
@@ -18,7 +18,6 @@ export declare const BackgroundCard: {
18
18
  };
19
19
  alt: {
20
20
  type: string;
21
- content: string;
22
21
  };
23
22
  disableCompress: {
24
23
  type: string;
@@ -46,7 +45,6 @@ export declare const BackgroundCard: {
46
45
  properties: {
47
46
  text: {
48
47
  type: string;
49
- content: string;
50
48
  };
51
49
  textSize: {
52
50
  type: string;
@@ -61,12 +59,10 @@ export declare const BackgroundCard: {
61
59
  };
62
60
  } | {
63
61
  type: string;
64
- content: string;
65
62
  })[];
66
63
  };
67
64
  text: {
68
65
  type: string;
69
- content: string;
70
66
  };
71
67
  theme: {
72
68
  type: string;
@@ -74,7 +70,6 @@ export declare const BackgroundCard: {
74
70
  };
75
71
  additionalInfo: {
76
72
  type: string;
77
- content: string;
78
73
  };
79
74
  links: {
80
75
  type: string;
@@ -27,7 +27,6 @@ export declare const BasicCard: {
27
27
  properties: {
28
28
  text: {
29
29
  type: string;
30
- content: string;
31
30
  };
32
31
  textSize: {
33
32
  type: string;
@@ -42,16 +41,13 @@ export declare const BasicCard: {
42
41
  };
43
42
  } | {
44
43
  type: string;
45
- content: string;
46
44
  })[];
47
45
  };
48
46
  text: {
49
47
  type: string;
50
- content: string;
51
48
  };
52
49
  additionalInfo: {
53
50
  type: string;
54
- content: string;
55
51
  };
56
52
  links: {
57
53
  type: string;
@@ -13,7 +13,6 @@ export declare const CardWithImageItem: {
13
13
  properties: {
14
14
  text: {
15
15
  type: string;
16
- content: string;
17
16
  };
18
17
  textSize: {
19
18
  type: string;
@@ -28,16 +27,13 @@ export declare const CardWithImageItem: {
28
27
  };
29
28
  } | {
30
29
  type: string;
31
- content: string;
32
30
  })[];
33
31
  };
34
32
  description: {
35
33
  type: string;
36
- content: string;
37
34
  };
38
35
  additionalInfo: {
39
36
  type: string;
40
- content: string;
41
37
  };
42
38
  disableCompress: {
43
39
  type: string;
@@ -90,7 +86,6 @@ export declare const CardWithImage: {
90
86
  properties: {
91
87
  text: {
92
88
  type: string;
93
- content: string;
94
89
  };
95
90
  textSize: {
96
91
  type: string;
@@ -105,16 +100,13 @@ export declare const CardWithImage: {
105
100
  };
106
101
  } | {
107
102
  type: string;
108
- content: string;
109
103
  })[];
110
104
  };
111
105
  description: {
112
106
  type: string;
113
- content: string;
114
107
  };
115
108
  additionalInfo: {
116
109
  type: string;
117
- content: string;
118
110
  };
119
111
  disableCompress: {
120
112
  type: string;