From b207b87a6d48ed4d00e21546d59e311032bbe2af Mon Sep 17 00:00:00 2001 From: David Matejka Date: Mon, 17 Jun 2024 14:52:40 +0200 Subject: [PATCH] fix: use staticContextFactoryName in children analyzers --- packages/react-board/src/internal/boardAnalyzer.ts | 2 ++ packages/react-slate-editor-legacy/src/blocks/blockAnalyzer.ts | 1 + .../react-slate-editor/src/internal/helpers/blockAnalyzer.ts | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/react-board/src/internal/boardAnalyzer.ts b/packages/react-board/src/internal/boardAnalyzer.ts index 5bce73bb1..af653e5d6 100644 --- a/packages/react-board/src/internal/boardAnalyzer.ts +++ b/packages/react-board/src/internal/boardAnalyzer.ts @@ -14,6 +14,7 @@ export const boardColumnsAnalyzer = new ChildrenAnalyzer< Environment >([columnLeaf], { staticRenderFactoryName: 'staticRender', + staticContextFactoryName: 'generateEnvironment', }) export const boardItemsAnalyzer = new ChildrenAnalyzer< @@ -22,4 +23,5 @@ export const boardItemsAnalyzer = new ChildrenAnalyzer< Environment >([itemLeaf], { staticRenderFactoryName: 'staticRender', + staticContextFactoryName: 'generateEnvironment', }) diff --git a/packages/react-slate-editor-legacy/src/blocks/blockAnalyzer.ts b/packages/react-slate-editor-legacy/src/blocks/blockAnalyzer.ts index c81bb05ba..9b22b98e2 100644 --- a/packages/react-slate-editor-legacy/src/blocks/blockAnalyzer.ts +++ b/packages/react-slate-editor-legacy/src/blocks/blockAnalyzer.ts @@ -7,5 +7,6 @@ const blockLeaf = new Leaf(node => node.props, Block) export const blockAnalyzer = new ChildrenAnalyzer([blockLeaf], { ignoreUnhandledNodes: true, staticRenderFactoryName: 'staticRender', + staticContextFactoryName: 'generateEnvironment', // unhandledNodeErrorMessage: 'Only Block children are supported.', }) diff --git a/packages/react-slate-editor/src/internal/helpers/blockAnalyzer.ts b/packages/react-slate-editor/src/internal/helpers/blockAnalyzer.ts index 5812001c1..2ee6dbb51 100644 --- a/packages/react-slate-editor/src/internal/helpers/blockAnalyzer.ts +++ b/packages/react-slate-editor/src/internal/helpers/blockAnalyzer.ts @@ -10,5 +10,6 @@ export const blockAnalyzer = new ChildrenAnalyzer< Environment >([columnLeaf], { staticRenderFactoryName: 'staticRender', - unhandledNodeErrorMessage: 'Only Block children are supported.', + staticContextFactoryName: 'generateEnvironment', + // unhandledNodeErrorMessage: 'Only Block children are supported.', })