From 0ec6df030cb966fd8c5511e978fe4b1673717212 Mon Sep 17 00:00:00 2001 From: Bayu Aldi Yansyah Date: Tue, 16 Feb 2021 23:47:00 +0700 Subject: [PATCH 1/4] Add block to CustomBlockComponentProps --- src/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/types.ts b/src/types.ts index 2157557..d509f00 100644 --- a/src/types.ts +++ b/src/types.ts @@ -346,6 +346,7 @@ export type BlockValueProp = Extract; export interface CustomBlockComponentProps { renderComponent: () => JSX.Element | null; + block: BlockType; blockValue: T extends BlockValueType ? BlockValueProp : BaseValueType; level: number; } From 6db4b1d0fa7062778d055069f06bc7e8b320100c Mon Sep 17 00:00:00 2001 From: Bayu Aldi Yansyah Date: Tue, 16 Feb 2021 23:48:20 +0700 Subject: [PATCH 2/4] Pass current block to CustomComponent --- src/block.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/block.tsx b/src/block.tsx index 09effe0..1c01ea8 100644 --- a/src/block.tsx +++ b/src/block.tsx @@ -505,6 +505,7 @@ export const Block: React.FC = props => { return ( } level={level} > From 67f4c8442d1a561988697106e3239e46c61c0d8d Mon Sep 17 00:00:00 2001 From: Bayu Aldi Yansyah Date: Wed, 17 Feb 2021 14:36:22 +0700 Subject: [PATCH 3/4] Update block.tsx --- src/block.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/block.tsx b/src/block.tsx index 1c01ea8..c7725d0 100644 --- a/src/block.tsx +++ b/src/block.tsx @@ -505,7 +505,7 @@ export const Block: React.FC = props => { return ( } level={level} > From dbca971594c03ece8aed94893e01ad50dd48c029 Mon Sep 17 00:00:00 2001 From: Bayu Aldi Yansyah Date: Wed, 17 Feb 2021 14:37:19 +0700 Subject: [PATCH 4/4] Pass blockMap instead of the current block --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index d509f00..104c985 100644 --- a/src/types.ts +++ b/src/types.ts @@ -346,7 +346,7 @@ export type BlockValueProp = Extract; export interface CustomBlockComponentProps { renderComponent: () => JSX.Element | null; - block: BlockType; + blockMap: BlockMapType; blockValue: T extends BlockValueType ? BlockValueProp : BaseValueType; level: number; }