From 3f1e5092cf560187b39b1ea0d80dcefd1278909c Mon Sep 17 00:00:00 2001 From: yousefed Date: Wed, 11 Dec 2024 09:45:54 +0100 Subject: [PATCH] fix: typing issue for some users --- packages/ariakit/src/index.tsx | 6 +++--- packages/mantine/src/index.tsx | 10 ++++------ packages/react/src/editor/BlockNoteView.tsx | 5 +---- packages/shadcn/src/index.tsx | 7 ++++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/packages/ariakit/src/index.tsx b/packages/ariakit/src/index.tsx index cd7b217a6..95333bb71 100644 --- a/packages/ariakit/src/index.tsx +++ b/packages/ariakit/src/index.tsx @@ -5,11 +5,11 @@ import { StyleSchema, } from "@blocknote/core"; import { + BlockNoteViewProps, BlockNoteViewRaw, Components, ComponentsContext, } from "@blocknote/react"; -import { ComponentProps } from "react"; import { Form } from "./input/Form.js"; import { TextInput } from "./input/TextInput.js"; @@ -38,8 +38,8 @@ import { SuggestionMenuEmptyItem } from "./suggestionMenu/SuggestionMenuEmptyIte import { SuggestionMenuItem } from "./suggestionMenu/SuggestionMenuItem.js"; import { SuggestionMenuLabel } from "./suggestionMenu/SuggestionMenuLabel.js"; import { SuggestionMenuLoader } from "./suggestionMenu/SuggestionMenuLoader.js"; -import { TableHandle } from "./tableHandle/TableHandle.js"; import { ExtendButton } from "./tableHandle/ExtendButton.js"; +import { TableHandle } from "./tableHandle/TableHandle.js"; import { Toolbar } from "./toolbar/Toolbar.js"; import { ToolbarButton } from "./toolbar/ToolbarButton.js"; import { ToolbarSelect } from "./toolbar/ToolbarSelect.js"; @@ -110,7 +110,7 @@ export const BlockNoteView = < ISchema extends InlineContentSchema, SSchema extends StyleSchema >( - props: ComponentProps> + props: BlockNoteViewProps ) => { const { className, ...rest } = props; diff --git a/packages/mantine/src/index.tsx b/packages/mantine/src/index.tsx index 3941d640d..136e12280 100644 --- a/packages/mantine/src/index.tsx +++ b/packages/mantine/src/index.tsx @@ -5,6 +5,7 @@ import { StyleSchema, } from "@blocknote/core"; import { + BlockNoteViewProps, BlockNoteViewRaw, Components, ComponentsContext, @@ -12,7 +13,7 @@ import { usePrefersColorScheme, } from "@blocknote/react"; import { MantineProvider } from "@mantine/core"; -import { ComponentProps, useCallback } from "react"; +import { useCallback } from "react"; import { applyBlockNoteCSSVariablesFromTheme, @@ -46,8 +47,8 @@ import { SuggestionMenuEmptyItem } from "./suggestionMenu/SuggestionMenuEmptyIte import { SuggestionMenuItem } from "./suggestionMenu/SuggestionMenuItem.js"; import { SuggestionMenuLabel } from "./suggestionMenu/SuggestionMenuLabel.js"; import { SuggestionMenuLoader } from "./suggestionMenu/SuggestionMenuLoader.js"; -import { TableHandle } from "./tableHandle/TableHandle.js"; import { ExtendButton } from "./tableHandle/ExtendButton.js"; +import { TableHandle } from "./tableHandle/TableHandle.js"; import { Toolbar } from "./toolbar/Toolbar.js"; import { ToolbarButton } from "./toolbar/ToolbarButton.js"; import { ToolbarSelect } from "./toolbar/ToolbarSelect.js"; @@ -124,10 +125,7 @@ export const BlockNoteView = < ISchema extends InlineContentSchema, SSchema extends StyleSchema >( - props: Omit< - ComponentProps>, - "theme" - > & { + props: Omit, "theme"> & { theme?: | "light" | "dark" diff --git a/packages/react/src/editor/BlockNoteView.tsx b/packages/react/src/editor/BlockNoteView.tsx index 24733e237..7423810eb 100644 --- a/packages/react/src/editor/BlockNoteView.tsx +++ b/packages/react/src/editor/BlockNoteView.tsx @@ -7,7 +7,6 @@ import { } from "@blocknote/core"; import React, { - ComponentProps, HTMLAttributes, ReactNode, Ref, @@ -185,9 +184,7 @@ export const BlockNoteViewRaw = React.forwardRef(BlockNoteViewComponent) as < ISchema extends InlineContentSchema, SSchema extends StyleSchema >( - props: ComponentProps< - typeof BlockNoteViewComponent - > & { + props: BlockNoteViewProps & { ref?: React.ForwardedRef; } ) => ReturnType>; diff --git a/packages/shadcn/src/index.tsx b/packages/shadcn/src/index.tsx index f5dc69eec..2dd7f0917 100644 --- a/packages/shadcn/src/index.tsx +++ b/packages/shadcn/src/index.tsx @@ -5,11 +5,12 @@ import { StyleSchema, } from "@blocknote/core"; import { + BlockNoteViewProps, BlockNoteViewRaw, Components, ComponentsContext, } from "@blocknote/react"; -import { ComponentProps, useMemo } from "react"; +import { useMemo } from "react"; import { Form } from "./form/Form.js"; import { TextInput } from "./form/TextInput.js"; @@ -39,8 +40,8 @@ import { SuggestionMenuEmptyItem } from "./suggestionMenu/SuggestionMenuEmptyIte import { SuggestionMenuItem } from "./suggestionMenu/SuggestionMenuItem.js"; import { SuggestionMenuLabel } from "./suggestionMenu/SuggestionMenuLabel.js"; import { SuggestionMenuLoader } from "./suggestionMenu/SuggestionMenuLoader.js"; -import { TableHandle } from "./tableHandle/TableHandle.js"; import { ExtendButton } from "./tableHandle/ExtendButton.js"; +import { TableHandle } from "./tableHandle/TableHandle.js"; import { Toolbar, ToolbarButton, ToolbarSelect } from "./toolbar/Toolbar.js"; import { PanelButton } from "./panel/PanelButton.js"; @@ -113,7 +114,7 @@ export const BlockNoteView = < ISchema extends InlineContentSchema, SSchema extends StyleSchema >( - props: ComponentProps> & { + props: BlockNoteViewProps & { /** * (optional)Provide your own shadcn component overrides */