@@ -5,7 +5,7 @@ import blockOrigin from 'bem-cn-lite';
55
66import BackgroundMedia from '../../components/BackgroundMedia/BackgroundMedia' ;
77import { UIKIT_ROOT_CLASS } from '../../components/constants' ;
8- import { blockMap , subBlockMap } from '../../constructor-items' ;
8+ import { blockMap , navItemMap , subBlockMap } from '../../constructor-items' ;
99import { AnimateContext } from '../../context/animateContext' ;
1010import { InnerContext } from '../../context/innerContext' ;
1111import { useTheme } from '../../context/theme' ;
@@ -17,17 +17,16 @@ import {
1717 CustomItems ,
1818 HeaderBlockTypes ,
1919 NavigationData ,
20+ NavigationItemTypes ,
2021 PageContent ,
2122 ShouldRenderBlock ,
2223 SubBlockTypes ,
2324} from '../../models' ;
2425import Layout from '../../navigation/containers/Layout/Layout' ;
2526import {
2627 block as cnBlock ,
27- getCustomBlockTypes ,
28- getCustomHeaderTypes ,
2928 getCustomItems ,
30- getCustomSubBlockTypes ,
29+ getCustomTypes ,
3130 getHeaderBlock ,
3231 getOrderedBlocks ,
3332 getThemedValue ,
@@ -44,6 +43,8 @@ const ycr = blockOrigin(UIKIT_ROOT_CLASS);
4443
4544export type ItemMap = typeof blockMap & typeof subBlockMap & CustomItems ;
4645
46+ export type NavItemMap = typeof navItemMap & CustomItems ;
47+
4748export interface PageConstructorProps {
4849 content ?: PageContent ;
4950 shouldRenderBlock ?: ShouldRenderBlock ;
@@ -64,13 +65,21 @@ export const Constructor = (props: PageConstructorProps) => {
6465 const { context} = useMemo (
6566 ( ) => ( {
6667 context : {
67- blockTypes : [ ...BlockTypes , ...getCustomBlockTypes ( custom ) ] ,
68- subBlockTypes : [ ...SubBlockTypes , ...getCustomSubBlockTypes ( custom ) ] ,
69- headerBlockTypes : [ ...HeaderBlockTypes , ...getCustomHeaderTypes ( custom ) ] ,
68+ blockTypes : [ ...BlockTypes , ...getCustomTypes ( [ 'blocks' , 'headers' ] , custom ) ] ,
69+ subBlockTypes : [ ...SubBlockTypes , ...getCustomTypes ( [ 'subBlocks' ] , custom ) ] ,
70+ headerBlockTypes : [ ...HeaderBlockTypes , ...getCustomTypes ( [ 'headers' ] , custom ) ] ,
71+ navigationBlockTypes : [
72+ ...NavigationItemTypes ,
73+ ...getCustomTypes ( [ 'navigation' ] , custom ) ,
74+ ] ,
7075 itemMap : {
7176 ...blockMap ,
7277 ...subBlockMap ,
73- ...getCustomItems ( custom ) ,
78+ ...getCustomItems ( [ 'blocks' , 'headers' , 'subBlocks' ] , custom ) ,
79+ } ,
80+ navItemMap : {
81+ ...navItemMap ,
82+ ...getCustomItems ( [ 'navigation' ] , custom ) ,
7483 } ,
7584 loadables : custom ?. loadable ,
7685 shouldRenderBlock,
0 commit comments