Skip to content

Commit 2439b8f

Browse files
authored
fix: typing issue for some users (#1316)
1 parent 6fa2c8f commit 2439b8f

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

packages/ariakit/src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import {
55
StyleSchema,
66
} from "@blocknote/core";
77
import {
8+
BlockNoteViewProps,
89
BlockNoteViewRaw,
910
Components,
1011
ComponentsContext,
1112
} from "@blocknote/react";
12-
import { ComponentProps } from "react";
1313

1414
import { Form } from "./input/Form.js";
1515
import { TextInput } from "./input/TextInput.js";
@@ -38,8 +38,8 @@ import { SuggestionMenuEmptyItem } from "./suggestionMenu/SuggestionMenuEmptyIte
3838
import { SuggestionMenuItem } from "./suggestionMenu/SuggestionMenuItem.js";
3939
import { SuggestionMenuLabel } from "./suggestionMenu/SuggestionMenuLabel.js";
4040
import { SuggestionMenuLoader } from "./suggestionMenu/SuggestionMenuLoader.js";
41-
import { TableHandle } from "./tableHandle/TableHandle.js";
4241
import { ExtendButton } from "./tableHandle/ExtendButton.js";
42+
import { TableHandle } from "./tableHandle/TableHandle.js";
4343
import { Toolbar } from "./toolbar/Toolbar.js";
4444
import { ToolbarButton } from "./toolbar/ToolbarButton.js";
4545
import { ToolbarSelect } from "./toolbar/ToolbarSelect.js";
@@ -110,7 +110,7 @@ export const BlockNoteView = <
110110
ISchema extends InlineContentSchema,
111111
SSchema extends StyleSchema
112112
>(
113-
props: ComponentProps<typeof BlockNoteViewRaw<BSchema, ISchema, SSchema>>
113+
props: BlockNoteViewProps<BSchema, ISchema, SSchema>
114114
) => {
115115
const { className, ...rest } = props;
116116

packages/mantine/src/index.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ import {
55
StyleSchema,
66
} from "@blocknote/core";
77
import {
8+
BlockNoteViewProps,
89
BlockNoteViewRaw,
910
Components,
1011
ComponentsContext,
1112
useBlockNoteContext,
1213
usePrefersColorScheme,
1314
} from "@blocknote/react";
1415
import { MantineProvider } from "@mantine/core";
15-
import { ComponentProps, useCallback } from "react";
16+
import { useCallback } from "react";
1617

1718
import {
1819
applyBlockNoteCSSVariablesFromTheme,
@@ -46,8 +47,8 @@ import { SuggestionMenuEmptyItem } from "./suggestionMenu/SuggestionMenuEmptyIte
4647
import { SuggestionMenuItem } from "./suggestionMenu/SuggestionMenuItem.js";
4748
import { SuggestionMenuLabel } from "./suggestionMenu/SuggestionMenuLabel.js";
4849
import { SuggestionMenuLoader } from "./suggestionMenu/SuggestionMenuLoader.js";
49-
import { TableHandle } from "./tableHandle/TableHandle.js";
5050
import { ExtendButton } from "./tableHandle/ExtendButton.js";
51+
import { TableHandle } from "./tableHandle/TableHandle.js";
5152
import { Toolbar } from "./toolbar/Toolbar.js";
5253
import { ToolbarButton } from "./toolbar/ToolbarButton.js";
5354
import { ToolbarSelect } from "./toolbar/ToolbarSelect.js";
@@ -124,10 +125,7 @@ export const BlockNoteView = <
124125
ISchema extends InlineContentSchema,
125126
SSchema extends StyleSchema
126127
>(
127-
props: Omit<
128-
ComponentProps<typeof BlockNoteViewRaw<BSchema, ISchema, SSchema>>,
129-
"theme"
130-
> & {
128+
props: Omit<BlockNoteViewProps<BSchema, ISchema, SSchema>, "theme"> & {
131129
theme?:
132130
| "light"
133131
| "dark"

packages/react/src/editor/BlockNoteView.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
} from "@blocknote/core";
88

99
import React, {
10-
ComponentProps,
1110
HTMLAttributes,
1211
ReactNode,
1312
Ref,
@@ -185,9 +184,7 @@ export const BlockNoteViewRaw = React.forwardRef(BlockNoteViewComponent) as <
185184
ISchema extends InlineContentSchema,
186185
SSchema extends StyleSchema
187186
>(
188-
props: ComponentProps<
189-
typeof BlockNoteViewComponent<BSchema, ISchema, SSchema>
190-
> & {
187+
props: BlockNoteViewProps<BSchema, ISchema, SSchema> & {
191188
ref?: React.ForwardedRef<HTMLDivElement>;
192189
}
193190
) => ReturnType<typeof BlockNoteViewComponent<BSchema, ISchema, SSchema>>;

packages/shadcn/src/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import {
55
StyleSchema,
66
} from "@blocknote/core";
77
import {
8+
BlockNoteViewProps,
89
BlockNoteViewRaw,
910
Components,
1011
ComponentsContext,
1112
} from "@blocknote/react";
12-
import { ComponentProps, useMemo } from "react";
13+
import { useMemo } from "react";
1314

1415
import { Form } from "./form/Form.js";
1516
import { TextInput } from "./form/TextInput.js";
@@ -39,8 +40,8 @@ import { SuggestionMenuEmptyItem } from "./suggestionMenu/SuggestionMenuEmptyIte
3940
import { SuggestionMenuItem } from "./suggestionMenu/SuggestionMenuItem.js";
4041
import { SuggestionMenuLabel } from "./suggestionMenu/SuggestionMenuLabel.js";
4142
import { SuggestionMenuLoader } from "./suggestionMenu/SuggestionMenuLoader.js";
42-
import { TableHandle } from "./tableHandle/TableHandle.js";
4343
import { ExtendButton } from "./tableHandle/ExtendButton.js";
44+
import { TableHandle } from "./tableHandle/TableHandle.js";
4445
import { Toolbar, ToolbarButton, ToolbarSelect } from "./toolbar/Toolbar.js";
4546

4647
import { PanelButton } from "./panel/PanelButton.js";
@@ -113,7 +114,7 @@ export const BlockNoteView = <
113114
ISchema extends InlineContentSchema,
114115
SSchema extends StyleSchema
115116
>(
116-
props: ComponentProps<typeof BlockNoteViewRaw<BSchema, ISchema, SSchema>> & {
117+
props: BlockNoteViewProps<BSchema, ISchema, SSchema> & {
117118
/**
118119
* (optional)Provide your own shadcn component overrides
119120
*/

0 commit comments

Comments
 (0)