@gravity-ui/page-constructor 2.20.1 → 2.22.0-alpha
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.
- package/CHANGELOG.md +0 -46
- package/README.md +1 -1
- package/build/cjs/blocks/Header/schema.d.ts +18 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +6 -0
- package/build/cjs/blocks/Media/schema.d.ts +12 -0
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
- package/build/cjs/blocks/Security/schema.d.ts +6 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +6 -0
- package/build/cjs/components/Anchor/Anchor.d.ts +2 -2
- package/build/cjs/components/Anchor/Anchor.js +1 -1
- package/build/cjs/components/Anchor/__tests__/Anchor.test.js +21 -0
- package/build/cjs/components/AnimateBlock/__tests__/AnimateBlock.test.js +36 -0
- package/build/cjs/components/Author/__tests__/Author.test.d.ts +1 -0
- package/build/cjs/components/Author/__tests__/Author.test.js +49 -0
- package/build/cjs/components/BackLink/__tests__/BackLink.test.d.ts +1 -0
- package/build/cjs/components/BackLink/__tests__/BackLink.test.js +63 -0
- package/build/cjs/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/cjs/components/BlockBase/BlockBase.d.ts +2 -3
- package/build/cjs/components/BlockBase/BlockBase.js +2 -4
- package/build/cjs/components/BlockBase/__tests__/BlockBase.test.d.ts +1 -0
- package/build/cjs/components/BlockBase/__tests__/BlockBase.test.js +44 -0
- package/build/cjs/components/Button/Button.css +0 -3
- package/build/cjs/components/Button/Button.js +4 -5
- package/build/cjs/components/Button/__tests__/Button.test.d.ts +1 -0
- package/build/cjs/components/Button/__tests__/Button.test.js +91 -0
- package/build/cjs/components/ButtonTabs/__tests__/ButtonTabs.test.d.ts +1 -0
- package/build/cjs/components/ButtonTabs/__tests__/ButtonTabs.test.js +58 -0
- package/build/cjs/components/FullscreenImage/FullscreenImage.d.ts +2 -2
- package/build/cjs/components/FullscreenImage/FullscreenImage.js +5 -5
- package/build/cjs/components/FullscreenMedia/FullscreenMedia.d.ts +13 -0
- package/build/cjs/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +3 -3
- package/build/cjs/components/Image/Image.d.ts +0 -1
- package/build/cjs/components/Image/Image.js +2 -2
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
- package/build/cjs/components/Media/FullscreenVideo/FullscreenVideo.js +10 -0
- package/build/cjs/components/Media/Image/Image.d.ts +1 -0
- package/build/cjs/components/Media/Image/Image.js +10 -3
- package/build/cjs/components/Media/Media.js +25 -4
- package/build/cjs/components/Media/Video/Video.d.ts +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +4 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +3 -3
- package/build/cjs/components/index.d.ts +1 -1
- package/build/cjs/components/index.js +2 -2
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/containers/Loadable/Loadable.d.ts +2 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.js +3 -5
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +2 -3
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -5
- package/build/cjs/context/innerContext/InnerContext.d.ts +1 -2
- package/build/cjs/grid/Col/Col.d.ts +1 -1
- package/build/cjs/internal-typings/global.d.ts +16 -18
- package/build/cjs/models/constructor-items/blocks.d.ts +11 -1
- package/build/cjs/models/constructor-items/blocks.js +2 -0
- package/build/cjs/models/constructor-items/common.d.ts +7 -3
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +4 -0
- package/build/cjs/models/constructor.d.ts +1 -4
- package/build/cjs/models/index.d.ts +0 -1
- package/build/cjs/models/index.js +0 -1
- package/build/cjs/schema/validators/common.d.ts +6 -0
- package/build/cjs/schema/validators/common.js +6 -0
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -2
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js +2 -5
- package/build/cjs/sub-blocks/HubspotForm/index.d.ts +1 -1
- package/build/cjs/sub-blocks/HubspotForm/index.js +5 -6
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +4 -4
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +9 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +2 -0
- package/build/cjs/sub-blocks/LayoutItem/utils.d.ts +2 -2
- package/build/cjs/sub-blocks/LayoutItem/utils.js +5 -5
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +6 -0
- package/build/cjs/utils/blocks.d.ts +1 -4
- package/build/cjs/utils/blocks.js +1 -11
- package/build/esm/blocks/Header/schema.d.ts +18 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +6 -0
- package/build/esm/blocks/Media/schema.d.ts +12 -0
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +6 -0
- package/build/esm/blocks/Security/schema.d.ts +6 -0
- package/build/esm/blocks/Tabs/Tabs.js +2 -2
- package/build/esm/blocks/Tabs/schema.d.ts +6 -0
- package/build/esm/components/Anchor/Anchor.d.ts +2 -2
- package/build/esm/components/Anchor/Anchor.js +1 -1
- package/build/esm/components/Anchor/__tests__/Anchor.test.d.ts +1 -0
- package/build/esm/components/Anchor/__tests__/Anchor.test.js +18 -0
- package/build/esm/components/AnimateBlock/__tests__/AnimateBlock.test.d.ts +1 -0
- package/build/esm/components/AnimateBlock/__tests__/AnimateBlock.test.js +33 -0
- package/build/esm/components/Author/__tests__/Author.test.d.ts +1 -0
- package/build/esm/components/Author/__tests__/Author.test.js +46 -0
- package/build/esm/components/BackLink/__tests__/BackLink.test.d.ts +1 -0
- package/build/esm/components/BackLink/__tests__/BackLink.test.js +60 -0
- package/build/esm/components/BackgroundImage/BackgroundImage.js +2 -2
- package/build/esm/components/BlockBase/BlockBase.d.ts +2 -3
- package/build/esm/components/BlockBase/BlockBase.js +2 -4
- package/build/esm/components/BlockBase/__tests__/BlockBase.test.d.ts +1 -0
- package/build/esm/components/BlockBase/__tests__/BlockBase.test.js +41 -0
- package/build/esm/components/Button/Button.css +0 -3
- package/build/esm/components/Button/Button.js +4 -5
- package/build/esm/components/Button/__tests__/Button.test.d.ts +1 -0
- package/build/esm/components/Button/__tests__/Button.test.js +88 -0
- package/build/esm/components/ButtonTabs/__tests__/ButtonTabs.test.d.ts +1 -0
- package/build/esm/components/ButtonTabs/__tests__/ButtonTabs.test.js +55 -0
- package/build/esm/components/FullscreenImage/FullscreenImage.d.ts +3 -3
- package/build/esm/components/FullscreenImage/FullscreenImage.js +6 -6
- package/build/esm/components/FullscreenMedia/FullscreenMedia.d.ts +14 -0
- package/build/esm/components/FullscreenMedia/{FullScreenMedia.js → FullscreenMedia.js} +4 -4
- package/build/esm/components/Image/Image.d.ts +0 -1
- package/build/esm/components/Image/Image.js +2 -2
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.d.ts +4 -0
- package/build/esm/components/Media/FullscreenVideo/FullscreenVideo.js +7 -0
- package/build/esm/components/Media/Image/Image.d.ts +1 -0
- package/build/esm/components/Media/Image/Image.js +12 -5
- package/build/esm/components/Media/Media.js +25 -4
- package/build/esm/components/Media/Video/Video.d.ts +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +4 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +3 -3
- package/build/esm/components/index.d.ts +1 -1
- package/build/esm/components/index.js +1 -1
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/containers/Loadable/Loadable.d.ts +2 -2
- package/build/esm/containers/PageConstructor/PageConstructor.js +4 -6
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +2 -3
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.d.ts +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorItem/ConstructorItem.js +5 -5
- package/build/esm/context/innerContext/InnerContext.d.ts +1 -2
- package/build/esm/grid/Col/Col.d.ts +1 -1
- package/build/esm/internal-typings/global.d.ts +16 -18
- package/build/esm/models/constructor-items/blocks.d.ts +11 -1
- package/build/esm/models/constructor-items/blocks.js +2 -0
- package/build/esm/models/constructor-items/common.d.ts +7 -3
- package/build/esm/models/constructor-items/sub-blocks.d.ts +4 -0
- package/build/esm/models/constructor.d.ts +1 -4
- package/build/esm/models/index.d.ts +0 -1
- package/build/esm/models/index.js +0 -1
- package/build/esm/schema/validators/common.d.ts +6 -0
- package/build/esm/schema/validators/common.js +6 -0
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -2
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js +3 -6
- package/build/esm/sub-blocks/HubspotForm/index.d.ts +1 -1
- package/build/esm/sub-blocks/HubspotForm/index.js +6 -7
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +5 -5
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +9 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +2 -0
- package/build/esm/sub-blocks/LayoutItem/utils.d.ts +2 -2
- package/build/esm/sub-blocks/LayoutItem/utils.js +2 -2
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +6 -0
- package/build/esm/utils/blocks.d.ts +1 -4
- package/build/esm/utils/blocks.js +0 -7
- package/package.json +6 -4
- package/server/models/constructor-items/blocks.d.ts +11 -1
- package/server/models/constructor-items/blocks.js +2 -0
- package/server/models/constructor-items/common.d.ts +7 -3
- package/server/models/constructor-items/sub-blocks.d.ts +4 -0
- package/server/models/constructor.d.ts +1 -4
- package/server/models/index.d.ts +0 -1
- package/server/models/index.js +0 -1
- package/server/utils/blocks.d.ts +1 -4
- package/server/utils/blocks.js +1 -11
- package/build/cjs/components/FullscreenMedia/FullScreenMedia.d.ts +0 -9
- package/build/cjs/customization/BlockDecoration.d.ts +0 -3
- package/build/cjs/customization/BlockDecoration.js +0 -22
- package/build/cjs/editor/Components/AddBlock/AddBlock.css +0 -82
- package/build/cjs/editor/Components/AddBlock/AddBlock.d.ts +0 -7
- package/build/cjs/editor/Components/AddBlock/AddBlock.js +0 -43
- package/build/cjs/editor/Components/EditBlock/EditBlock.css +0 -47
- package/build/cjs/editor/Components/EditBlock/EditBlock.d.ts +0 -4
- package/build/cjs/editor/Components/EditBlock/EditBlock.js +0 -32
- package/build/cjs/editor/Containers/Editor.d.ts +0 -2
- package/build/cjs/editor/Containers/Editor.js +0 -24
- package/build/cjs/editor/data/index.d.ts +0 -13
- package/build/cjs/editor/data/index.js +0 -27
- package/build/cjs/editor/data/previews/default-preview.d.ts +0 -3
- package/build/cjs/editor/data/previews/default-preview.js +0 -18
- package/build/cjs/editor/data/previews/header-block.d.ts +0 -3
- package/build/cjs/editor/data/previews/header-block.js +0 -19
- package/build/cjs/editor/index.d.ts +0 -2
- package/build/cjs/editor/index.js +0 -7
- package/build/cjs/editor/store/index.d.ts +0 -15
- package/build/cjs/editor/store/index.js +0 -32
- package/build/cjs/editor/store/reducer.d.ts +0 -41
- package/build/cjs/editor/store/reducer.js +0 -59
- package/build/cjs/editor/store/utils.d.ts +0 -13
- package/build/cjs/editor/store/utils.js +0 -34
- package/build/cjs/editor/styles/mixins.css +0 -0
- package/build/cjs/editor/styles/variables.css +0 -0
- package/build/cjs/editor/types/index.d.ts +0 -17
- package/build/cjs/editor/types/index.js +0 -2
- package/build/cjs/editor/utils/index.d.ts +0 -11
- package/build/cjs/editor/utils/index.js +0 -12
- package/build/cjs/models/customization.d.ts +0 -9
- package/build/cjs/models/customization.js +0 -2
- package/build/esm/components/FullscreenMedia/FullScreenMedia.d.ts +0 -10
- package/build/esm/customization/BlockDecoration.d.ts +0 -3
- package/build/esm/customization/BlockDecoration.js +0 -17
- package/build/esm/editor/Components/AddBlock/AddBlock.css +0 -82
- package/build/esm/editor/Components/AddBlock/AddBlock.d.ts +0 -8
- package/build/esm/editor/Components/AddBlock/AddBlock.js +0 -41
- package/build/esm/editor/Components/EditBlock/EditBlock.css +0 -47
- package/build/esm/editor/Components/EditBlock/EditBlock.d.ts +0 -5
- package/build/esm/editor/Components/EditBlock/EditBlock.js +0 -30
- package/build/esm/editor/Containers/Editor.d.ts +0 -2
- package/build/esm/editor/Containers/Editor.js +0 -20
- package/build/esm/editor/data/index.d.ts +0 -13
- package/build/esm/editor/data/index.js +0 -24
- package/build/esm/editor/data/previews/default-preview.d.ts +0 -3
- package/build/esm/editor/data/previews/default-preview.js +0 -15
- package/build/esm/editor/data/previews/header-block.d.ts +0 -3
- package/build/esm/editor/data/previews/header-block.js +0 -16
- package/build/esm/editor/index.d.ts +0 -2
- package/build/esm/editor/index.js +0 -2
- package/build/esm/editor/store/index.d.ts +0 -15
- package/build/esm/editor/store/index.js +0 -28
- package/build/esm/editor/store/reducer.d.ts +0 -41
- package/build/esm/editor/store/reducer.js +0 -55
- package/build/esm/editor/store/utils.d.ts +0 -13
- package/build/esm/editor/store/utils.js +0 -26
- package/build/esm/editor/styles/mixins.css +0 -0
- package/build/esm/editor/styles/variables.css +0 -0
- package/build/esm/editor/types/index.d.ts +0 -17
- package/build/esm/editor/utils/index.d.ts +0 -11
- package/build/esm/editor/utils/index.js +0 -6
- package/build/esm/models/customization.d.ts +0 -9
- package/server/models/customization.d.ts +0 -9
- package/server/models/customization.js +0 -2
- /package/build/{esm/editor/types/index.js → cjs/components/Anchor/__tests__/Anchor.test.d.ts} +0 -0
- /package/build/{esm/models/customization.js → cjs/components/AnimateBlock/__tests__/AnimateBlock.test.d.ts} +0 -0
- /package/build/cjs/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +0 -0
- /package/build/cjs/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
- /package/build/esm/components/FullscreenImage/{FullScreenImage.css → FullscreenImage.css} +0 -0
- /package/build/esm/components/FullscreenMedia/{FullScreenMedia.css → FullscreenMedia.css} +0 -0
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { getHeaderBlock, getOrderedBlocks } from '../../utils';
|
|
2
|
-
import { addBlock, changeBlocksOrder, duplicateBlock, getNewBlockIndex } from './utils';
|
|
3
|
-
// actions
|
|
4
|
-
export const SELECT_BLOCK = 'SELECT_BLOCK';
|
|
5
|
-
export const DELETE_BLOCK = 'DELETE_BLOCK';
|
|
6
|
-
export const COPY_BLOCK = 'COPY_BLOCK';
|
|
7
|
-
export const ADD_BLOCK = 'ADD_BLOCK';
|
|
8
|
-
export const SET_REGION = 'SET_REGION';
|
|
9
|
-
export const ORDER_BLOCK = 'ORDER_BLOCK';
|
|
10
|
-
// reducer
|
|
11
|
-
export const getReducer = (headerBlockTypes) => (state, action) => {
|
|
12
|
-
const { content } = state;
|
|
13
|
-
const header = getHeaderBlock(content.blocks, headerBlockTypes);
|
|
14
|
-
const orderedBlocks = getOrderedBlocks(content.blocks, headerBlockTypes);
|
|
15
|
-
const withHeader = (blocks) => [header, ...blocks].filter(Boolean);
|
|
16
|
-
const getNewState = (blocks, activeBlockId) => (Object.assign(Object.assign({}, state), { content: Object.assign(Object.assign({}, content), { blocks }), activeBlockId, orderedBlocksCount: orderedBlocks.length }));
|
|
17
|
-
switch (action.type) {
|
|
18
|
-
case SELECT_BLOCK:
|
|
19
|
-
return getNewState(content.blocks, action.payload);
|
|
20
|
-
case DELETE_BLOCK: {
|
|
21
|
-
const blockId = action.payload;
|
|
22
|
-
return getNewState(typeof blockId === 'string'
|
|
23
|
-
? content.blocks.filter(({ type }) => type !== blockId)
|
|
24
|
-
: withHeader(orderedBlocks.filter((_block, index) => index !== blockId)), -1);
|
|
25
|
-
}
|
|
26
|
-
case COPY_BLOCK: {
|
|
27
|
-
const index = action.payload;
|
|
28
|
-
return getNewState(withHeader(duplicateBlock(orderedBlocks, index)), index + 1);
|
|
29
|
-
}
|
|
30
|
-
case ADD_BLOCK: {
|
|
31
|
-
let blocks;
|
|
32
|
-
let activeBlockId;
|
|
33
|
-
const block = action.payload;
|
|
34
|
-
if (headerBlockTypes.includes(block.type)) {
|
|
35
|
-
blocks = header ? blocks : [block, ...orderedBlocks];
|
|
36
|
-
activeBlockId = block.type;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const newBlockIndex = getNewBlockIndex(state.activeBlockId, orderedBlocks.length);
|
|
40
|
-
blocks = withHeader(addBlock(orderedBlocks, block, newBlockIndex));
|
|
41
|
-
activeBlockId = newBlockIndex;
|
|
42
|
-
}
|
|
43
|
-
if (blocks) {
|
|
44
|
-
return getNewState(blocks, activeBlockId);
|
|
45
|
-
}
|
|
46
|
-
return state;
|
|
47
|
-
}
|
|
48
|
-
case ORDER_BLOCK: {
|
|
49
|
-
const { oldIndex, newIndex } = action.payload;
|
|
50
|
-
return getNewState(withHeader(changeBlocksOrder(orderedBlocks, oldIndex, newIndex)), newIndex);
|
|
51
|
-
}
|
|
52
|
-
default:
|
|
53
|
-
return state;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Block, PageContent } from '../../models';
|
|
2
|
-
import { EditorBlockId } from './reducer';
|
|
3
|
-
export declare const changeBlocksOrder: (array: Block[], oldIndex: number, newIndex: number) => Block[];
|
|
4
|
-
export declare const duplicateBlock: (array: Block[], index: number) => Block[];
|
|
5
|
-
export declare const getNewBlockIndex: (id: EditorBlockId, orderedBlocksCount: number) => number;
|
|
6
|
-
export declare const addBlock: (array: Block[], block: Block, index: number) => Block[];
|
|
7
|
-
export declare const addEditorProps: (content: PageContent) => {
|
|
8
|
-
animated: boolean;
|
|
9
|
-
blocks: Block[];
|
|
10
|
-
menu?: import("../../models").Menu | undefined;
|
|
11
|
-
background?: import("../../models").ThemedMediaProps | undefined;
|
|
12
|
-
footnotes?: string[] | undefined;
|
|
13
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export const changeBlocksOrder = (array, oldIndex, newIndex) => {
|
|
2
|
-
const result = [...array];
|
|
3
|
-
const element = result.splice(oldIndex, 1)[0];
|
|
4
|
-
result.splice(newIndex, 0, element);
|
|
5
|
-
return result;
|
|
6
|
-
};
|
|
7
|
-
export const duplicateBlock = (array, index) => {
|
|
8
|
-
const result = [...array];
|
|
9
|
-
result.splice(index + 1, 0, result[index]);
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
export const getNewBlockIndex = (id, orderedBlocksCount) => {
|
|
13
|
-
if (id === -1) {
|
|
14
|
-
return orderedBlocksCount;
|
|
15
|
-
}
|
|
16
|
-
// id === 'string' - header block
|
|
17
|
-
return typeof id === 'string' ? 0 : id + 1;
|
|
18
|
-
};
|
|
19
|
-
export const addBlock = (array, block, index) => {
|
|
20
|
-
const result = [...array];
|
|
21
|
-
result.splice(index, 0, block);
|
|
22
|
-
return result;
|
|
23
|
-
};
|
|
24
|
-
export const addEditorProps = (content) => {
|
|
25
|
-
return Object.assign(Object.assign({}, content), { animated: false });
|
|
26
|
-
};
|
|
File without changes
|
|
File without changes
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { PageConstructorProps } from '../../containers/PageConstructor';
|
|
3
|
-
import { BlockDecoratorProps, PageData } from '../../models';
|
|
4
|
-
export type EditorBlockId = number | string;
|
|
5
|
-
export interface EditorProps extends Required<Pick<PageConstructorProps, 'content'>>, Partial<Omit<PageConstructorProps, 'content'>> {
|
|
6
|
-
children: (props: Partial<PageConstructorProps>) => React.ReactNode;
|
|
7
|
-
onChange?: (data: PageData) => void;
|
|
8
|
-
}
|
|
9
|
-
export interface EditBlockEditorProps {
|
|
10
|
-
activeBlockId: EditorBlockId;
|
|
11
|
-
orderedBlocksCount: number;
|
|
12
|
-
onSelect: (index: EditorBlockId) => void;
|
|
13
|
-
onDelete: (index: EditorBlockId) => void;
|
|
14
|
-
onCopy: (index: number) => void;
|
|
15
|
-
onOrderChange: (index: number, newIndex: number) => void;
|
|
16
|
-
}
|
|
17
|
-
export type EditBlockProps = EditBlockEditorProps & BlockDecoratorProps;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BlockDecorator, CustomConfig } from '../../models';
|
|
2
|
-
export declare const formatBlockName: (name: string) => string;
|
|
3
|
-
export declare const addCustomDecorator: (decorator: BlockDecorator, custom?: CustomConfig) => {
|
|
4
|
-
decorators: {
|
|
5
|
-
block: ((props: import("../../models").BlockDecoratorProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>)[];
|
|
6
|
-
};
|
|
7
|
-
blocks?: import("../../models").CustomItems | undefined;
|
|
8
|
-
subBlocks?: import("../../models").CustomItems | undefined;
|
|
9
|
-
headers?: import("../../models").CustomItems | undefined;
|
|
10
|
-
loadable?: import("../../models").LoadableConfig | undefined;
|
|
11
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
export const formatBlockName = (name) => _.capitalize(name).replace(/(block|-)/g, ' ');
|
|
3
|
-
export const addCustomDecorator = (decorator, custom = {}) => {
|
|
4
|
-
const decorators = custom.decorators || {};
|
|
5
|
-
return Object.assign(Object.assign({}, custom), { decorators: Object.assign(Object.assign({}, decorators), { block: [...(decorators.block || []), decorator] }) });
|
|
6
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
export interface BlockDecorationProps extends PropsWithChildren {
|
|
3
|
-
id?: string;
|
|
4
|
-
}
|
|
5
|
-
export interface BlockDecoratorProps extends PropsWithChildren {
|
|
6
|
-
id: string | number;
|
|
7
|
-
isHeader?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export type BlockDecorator = (props: BlockDecoratorProps) => React.ReactElement;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
export interface BlockDecorationProps extends PropsWithChildren {
|
|
3
|
-
id?: string;
|
|
4
|
-
}
|
|
5
|
-
export interface BlockDecoratorProps extends PropsWithChildren {
|
|
6
|
-
id: string | number;
|
|
7
|
-
isHeader?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export type BlockDecorator = (props: BlockDecoratorProps) => React.ReactElement;
|
/package/build/{esm/editor/types/index.js → cjs/components/Anchor/__tests__/Anchor.test.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|