@blocknote/ariakit 0.13.0
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/LICENSE +373 -0
- package/dist/blocknote-ariakit.js +1146 -0
- package/dist/blocknote-ariakit.js.map +1 -0
- package/dist/blocknote-ariakit.umd.cjs +28 -0
- package/dist/blocknote-ariakit.umd.cjs.map +1 -0
- package/dist/style.css +1 -0
- package/dist/webpack-stats.json +1 -0
- package/package.json +84 -0
- package/src/ariakitStyles.css +1005 -0
- package/src/index.tsx +103 -0
- package/src/input/Form.tsx +12 -0
- package/src/input/TextInput.tsx +48 -0
- package/src/menu/Menu.tsx +130 -0
- package/src/panel/Panel.tsx +55 -0
- package/src/panel/PanelButton.tsx +24 -0
- package/src/panel/PanelFileInput.tsx +28 -0
- package/src/panel/PanelTab.tsx +18 -0
- package/src/panel/PanelTextInput.tsx +29 -0
- package/src/popover/Popover.tsx +47 -0
- package/src/sideMenu/SideMenu.tsx +20 -0
- package/src/sideMenu/SideMenuButton.tsx +44 -0
- package/src/style.css +136 -0
- package/src/suggestionMenu/SuggestionMenu.tsx +24 -0
- package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +20 -0
- package/src/suggestionMenu/SuggestionMenuItem.tsx +43 -0
- package/src/suggestionMenu/SuggestionMenuLabel.tsx +20 -0
- package/src/suggestionMenu/SuggestionMenuLoader.tsx +18 -0
- package/src/tableHandle/TableHandle.tsx +42 -0
- package/src/toolbar/Toolbar.tsx +26 -0
- package/src/toolbar/ToolbarButton.tsx +73 -0
- package/src/toolbar/ToolbarSelect.tsx +47 -0
- package/types/src/index.d.ts +6 -0
- package/types/src/input/Form.d.ts +2 -0
- package/types/src/input/TextInput.d.ts +13 -0
- package/types/src/menu/Menu.d.ts +24 -0
- package/types/src/panel/Panel.d.ts +12 -0
- package/types/src/panel/PanelButton.d.ts +11 -0
- package/types/src/panel/PanelFileInput.d.ts +7 -0
- package/types/src/panel/PanelTab.d.ts +5 -0
- package/types/src/panel/PanelTextInput.d.ts +8 -0
- package/types/src/popover/Popover.d.ts +11 -0
- package/types/src/sideMenu/SideMenu.d.ts +5 -0
- package/types/src/sideMenu/SideMenuButton.d.ts +15 -0
- package/types/src/suggestionMenu/SuggestionMenu.d.ts +6 -0
- package/types/src/suggestionMenu/SuggestionMenuEmptyItem.d.ts +5 -0
- package/types/src/suggestionMenu/SuggestionMenuItem.d.ts +8 -0
- package/types/src/suggestionMenu/SuggestionMenuLabel.d.ts +5 -0
- package/types/src/suggestionMenu/SuggestionMenuLoader.d.ts +5 -0
- package/types/src/tableHandle/TableHandle.d.ts +14 -0
- package/types/src/toolbar/Toolbar.d.ts +10 -0
- package/types/src/toolbar/ToolbarButton.d.ts +8 -0
- package/types/src/toolbar/ToolbarSelect.d.ts +12 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Ariakit from "@ariakit/react";
|
|
2
|
+
|
|
3
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
4
|
+
import { ComponentProps } from "@blocknote/react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
|
|
7
|
+
export const SuggestionMenu = forwardRef<
|
|
8
|
+
HTMLDivElement,
|
|
9
|
+
ComponentProps["SuggestionMenu"]["Root"]
|
|
10
|
+
>((props, ref) => {
|
|
11
|
+
const { className, children, id, ...rest } = props;
|
|
12
|
+
|
|
13
|
+
assertEmpty(rest);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Ariakit.Group
|
|
17
|
+
className={mergeCSSClasses("bn-ak-menu", className || "")}
|
|
18
|
+
id={id}
|
|
19
|
+
role="listbox"
|
|
20
|
+
ref={ref}>
|
|
21
|
+
{children}
|
|
22
|
+
</Ariakit.Group>
|
|
23
|
+
);
|
|
24
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
2
|
+
import { ComponentProps } from "@blocknote/react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
export const SuggestionMenuEmptyItem = forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
ComponentProps["SuggestionMenu"]["EmptyItem"]
|
|
8
|
+
>((props, ref) => {
|
|
9
|
+
const { className, children, ...rest } = props;
|
|
10
|
+
|
|
11
|
+
assertEmpty(rest);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={mergeCSSClasses("bn-ak-menu-item", className || "")}
|
|
16
|
+
ref={ref}>
|
|
17
|
+
<div className="bn-ak-suggestion-menu-item-label">{children}</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
2
|
+
import { ComponentProps } from "@blocknote/react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
export const SuggestionMenuItem = forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
ComponentProps["SuggestionMenu"]["Item"]
|
|
8
|
+
>((props, ref) => {
|
|
9
|
+
const { className, item, isSelected, onClick, id, ...rest } = props;
|
|
10
|
+
|
|
11
|
+
assertEmpty(rest);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={mergeCSSClasses("bn-ak-menu-item", className || "")}
|
|
16
|
+
ref={ref}
|
|
17
|
+
id={id}
|
|
18
|
+
onClick={onClick}
|
|
19
|
+
role="option"
|
|
20
|
+
aria-selected={isSelected || undefined}>
|
|
21
|
+
{item.icon && (
|
|
22
|
+
<div
|
|
23
|
+
className="bn-ak-suggestion-menu-item-section"
|
|
24
|
+
data-position="left">
|
|
25
|
+
{item.icon}
|
|
26
|
+
</div>
|
|
27
|
+
)}
|
|
28
|
+
<div className="bn-ak-suggestion-menu-item-body">
|
|
29
|
+
<div className="bn-ak-suggestion-menu-item-title">{item.title}</div>
|
|
30
|
+
<div className="bn-ak-suggestion-menu-item-subtitle">
|
|
31
|
+
{item.subtext}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
{item.badge && (
|
|
35
|
+
<div
|
|
36
|
+
data-position="right"
|
|
37
|
+
className="bn-ak-suggestion-menu-item-section">
|
|
38
|
+
<div>{item.badge}</div>
|
|
39
|
+
</div>
|
|
40
|
+
)}
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
43
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
2
|
+
import { ComponentProps } from "@blocknote/react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
export const SuggestionMenuLabel = forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
ComponentProps["SuggestionMenu"]["Label"]
|
|
8
|
+
>((props, ref) => {
|
|
9
|
+
const { className, children, ...rest } = props;
|
|
10
|
+
|
|
11
|
+
assertEmpty(rest);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={mergeCSSClasses("bn-ak-group-label", className || "")}
|
|
16
|
+
ref={ref}>
|
|
17
|
+
{children}
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { assertEmpty } from "@blocknote/core";
|
|
2
|
+
import { ComponentProps } from "@blocknote/react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
export const SuggestionMenuLoader = forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
ComponentProps["SuggestionMenu"]["Loader"]
|
|
8
|
+
>((props, ref) => {
|
|
9
|
+
const { className, children, ...rest } = props;
|
|
10
|
+
|
|
11
|
+
assertEmpty(rest);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={className} ref={ref}>
|
|
15
|
+
{children}
|
|
16
|
+
</div>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as Ariakit from "@ariakit/react";
|
|
2
|
+
|
|
3
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
4
|
+
import { ComponentProps } from "@blocknote/react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
|
|
7
|
+
export const TableHandle = forwardRef<
|
|
8
|
+
HTMLButtonElement,
|
|
9
|
+
ComponentProps["TableHandle"]["Root"]
|
|
10
|
+
>((props, ref) => {
|
|
11
|
+
const {
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
draggable,
|
|
15
|
+
onDragStart,
|
|
16
|
+
onDragEnd,
|
|
17
|
+
style,
|
|
18
|
+
label,
|
|
19
|
+
...rest
|
|
20
|
+
} = props;
|
|
21
|
+
|
|
22
|
+
// false, because rest props can be added by ariakit when button is used as a trigger
|
|
23
|
+
// assertEmpty in this case is only used at typescript level, not runtime level
|
|
24
|
+
assertEmpty(rest, false);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Ariakit.Button
|
|
28
|
+
className={mergeCSSClasses(
|
|
29
|
+
"bn-ak-button bn-ak-secondary",
|
|
30
|
+
className || ""
|
|
31
|
+
)}
|
|
32
|
+
ref={ref}
|
|
33
|
+
aria-label={label}
|
|
34
|
+
draggable={draggable}
|
|
35
|
+
onDragStart={onDragStart}
|
|
36
|
+
onDragEnd={onDragEnd}
|
|
37
|
+
style={style}
|
|
38
|
+
{...rest}>
|
|
39
|
+
{children}
|
|
40
|
+
</Ariakit.Button>
|
|
41
|
+
);
|
|
42
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as Ariakit from "@ariakit/react";
|
|
2
|
+
|
|
3
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
4
|
+
import { ComponentProps } from "@blocknote/react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
|
|
7
|
+
type ToolbarProps = ComponentProps["FormattingToolbar"]["Root"] &
|
|
8
|
+
ComponentProps["LinkToolbar"]["Root"];
|
|
9
|
+
|
|
10
|
+
export const Toolbar = forwardRef<HTMLDivElement, ToolbarProps>(
|
|
11
|
+
(props, ref) => {
|
|
12
|
+
const { className, children, onMouseEnter, onMouseLeave, ...rest } = props;
|
|
13
|
+
|
|
14
|
+
assertEmpty(rest);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Ariakit.Toolbar
|
|
18
|
+
className={mergeCSSClasses("bn-ak-toolbar", className || "")}
|
|
19
|
+
ref={ref}
|
|
20
|
+
onMouseEnter={onMouseEnter}
|
|
21
|
+
onMouseLeave={onMouseLeave}>
|
|
22
|
+
{children}
|
|
23
|
+
</Ariakit.Toolbar>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as Ariakit from "@ariakit/react";
|
|
2
|
+
|
|
3
|
+
import { assertEmpty, isSafari, mergeCSSClasses } from "@blocknote/core";
|
|
4
|
+
import { ComponentProps } from "@blocknote/react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
|
|
7
|
+
type ToolbarButtonProps = ComponentProps["FormattingToolbar"]["Button"] &
|
|
8
|
+
ComponentProps["LinkToolbar"]["Button"];
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Helper for basic buttons that show in the formatting toolbar.
|
|
12
|
+
*/
|
|
13
|
+
export const ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(
|
|
14
|
+
(props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
children,
|
|
18
|
+
mainTooltip,
|
|
19
|
+
secondaryTooltip,
|
|
20
|
+
icon,
|
|
21
|
+
isSelected,
|
|
22
|
+
isDisabled,
|
|
23
|
+
onClick,
|
|
24
|
+
label,
|
|
25
|
+
...rest
|
|
26
|
+
} = props;
|
|
27
|
+
|
|
28
|
+
// false, because rest props can be added by ariakit when button is used as a trigger
|
|
29
|
+
// assertEmpty in this case is only used at typescript level, not runtime level
|
|
30
|
+
assertEmpty(rest, false);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Ariakit.TooltipProvider>
|
|
34
|
+
<Ariakit.TooltipAnchor
|
|
35
|
+
className="link"
|
|
36
|
+
render={
|
|
37
|
+
<Ariakit.ToolbarItem
|
|
38
|
+
aria-label={label}
|
|
39
|
+
className={mergeCSSClasses(
|
|
40
|
+
"bn-ak-button bn-ak-secondary",
|
|
41
|
+
className || ""
|
|
42
|
+
)}
|
|
43
|
+
// Needed as Safari doesn't focus button elements on mouse down
|
|
44
|
+
// unlike other browsers.
|
|
45
|
+
onMouseDown={(e) => {
|
|
46
|
+
if (isSafari()) {
|
|
47
|
+
(e.currentTarget as HTMLButtonElement).focus();
|
|
48
|
+
}
|
|
49
|
+
}}
|
|
50
|
+
onClick={onClick}
|
|
51
|
+
aria-pressed={isSelected}
|
|
52
|
+
data-selected={isSelected ? "true" : undefined}
|
|
53
|
+
data-test={
|
|
54
|
+
props.mainTooltip.slice(0, 1).toLowerCase() +
|
|
55
|
+
props.mainTooltip.replace(/\s+/g, "").slice(1)
|
|
56
|
+
}
|
|
57
|
+
// size={"xs"}
|
|
58
|
+
disabled={isDisabled || false}
|
|
59
|
+
ref={ref}
|
|
60
|
+
{...rest}>
|
|
61
|
+
{icon}
|
|
62
|
+
{children}
|
|
63
|
+
</Ariakit.ToolbarItem>
|
|
64
|
+
}
|
|
65
|
+
/>
|
|
66
|
+
<Ariakit.Tooltip className="bn-ak-tooltip">
|
|
67
|
+
<span>{mainTooltip}</span>
|
|
68
|
+
{secondaryTooltip && <span>{secondaryTooltip}</span>}
|
|
69
|
+
</Ariakit.Tooltip>
|
|
70
|
+
</Ariakit.TooltipProvider>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as Ariakit from "@ariakit/react";
|
|
2
|
+
|
|
3
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
4
|
+
import { ComponentProps } from "@blocknote/react";
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
|
|
7
|
+
export const ToolbarSelect = forwardRef<
|
|
8
|
+
HTMLDivElement,
|
|
9
|
+
ComponentProps["FormattingToolbar"]["Select"]
|
|
10
|
+
>((props, ref) => {
|
|
11
|
+
const { className, items, isDisabled, ...rest } = props;
|
|
12
|
+
|
|
13
|
+
assertEmpty(rest);
|
|
14
|
+
|
|
15
|
+
const selectedItem = props.items.filter((p) => p.isSelected)[0];
|
|
16
|
+
|
|
17
|
+
const setValue = (value: string) => {
|
|
18
|
+
items.find((item) => item.text === value)!.onClick?.();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Ariakit.SelectProvider value={selectedItem.text} setValue={setValue}>
|
|
23
|
+
<Ariakit.Select
|
|
24
|
+
className={"bn-ak-button bn-ak-secondary"}
|
|
25
|
+
disabled={isDisabled}
|
|
26
|
+
aria-label="Text alignment"
|
|
27
|
+
render={<Ariakit.ToolbarItem />}>
|
|
28
|
+
{selectedItem.icon} {selectedItem.text} <Ariakit.SelectArrow />
|
|
29
|
+
</Ariakit.Select>
|
|
30
|
+
<Ariakit.SelectPopover
|
|
31
|
+
className={mergeCSSClasses("bn-ak-popover", className || "")}
|
|
32
|
+
ref={ref}
|
|
33
|
+
gutter={4}>
|
|
34
|
+
{items.map((option) => (
|
|
35
|
+
<Ariakit.SelectItem
|
|
36
|
+
className={"bn-ak-select-item"}
|
|
37
|
+
key={option.text}
|
|
38
|
+
value={option.text}>
|
|
39
|
+
{option.icon}
|
|
40
|
+
{option.text}
|
|
41
|
+
{option.text === selectedItem.text && <Ariakit.SelectItemCheck />}
|
|
42
|
+
</Ariakit.SelectItem>
|
|
43
|
+
))}
|
|
44
|
+
</Ariakit.SelectPopover>
|
|
45
|
+
</Ariakit.SelectProvider>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InlineContentSchema, StyleSchema } from "@blocknote/core";
|
|
2
|
+
import { BlockNoteViewRaw, Components } from "@blocknote/react";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
import "./style.css";
|
|
5
|
+
export declare const components: Components;
|
|
6
|
+
export declare const BlockNoteView: <BSchema extends Record<string, import("@blocknote/core").BlockConfig>, ISchema extends InlineContentSchema, SSchema extends StyleSchema>(props: ComponentProps<typeof BlockNoteViewRaw<BSchema, ISchema, SSchema>>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
name: string;
|
|
5
|
+
label?: string | undefined;
|
|
6
|
+
icon: import("react").ReactNode;
|
|
7
|
+
autoFocus?: boolean | undefined;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
value: string;
|
|
10
|
+
onKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
|
|
11
|
+
onChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
+
onSubmit?: (() => void) | undefined;
|
|
13
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps } from "@blocknote/react";
|
|
3
|
+
export declare const Menu: (props: ComponentProps["Generic"]["Menu"]["Root"]) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const MenuDropdown: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
children?: import("react").ReactNode;
|
|
7
|
+
sub?: boolean | undefined;
|
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const MenuItem: import("react").ForwardRefExoticComponent<{
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
children?: import("react").ReactNode;
|
|
12
|
+
subTrigger?: boolean | undefined;
|
|
13
|
+
icon?: import("react").ReactNode;
|
|
14
|
+
checked?: boolean | undefined;
|
|
15
|
+
onClick?: (() => void) | undefined;
|
|
16
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
export declare const MenuLabel: import("react").ForwardRefExoticComponent<{
|
|
18
|
+
className?: string | undefined;
|
|
19
|
+
children?: import("react").ReactNode;
|
|
20
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare const MenuTrigger: (props: ComponentProps["Generic"]["Menu"]["Trigger"]) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | null | undefined;
|
|
22
|
+
export declare const MenuDivider: import("react").ForwardRefExoticComponent<{
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
} & import("react").RefAttributes<HTMLHRElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Panel: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
tabs: {
|
|
5
|
+
name: string;
|
|
6
|
+
tabPanel: import("react").ReactNode;
|
|
7
|
+
}[];
|
|
8
|
+
openTab: string;
|
|
9
|
+
setOpenTab: (name: string) => void;
|
|
10
|
+
defaultOpenTab: string;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PanelButton: import("react").ForwardRefExoticComponent<({
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
} & ({
|
|
6
|
+
children: import("react").ReactNode;
|
|
7
|
+
label?: string | undefined;
|
|
8
|
+
} | {
|
|
9
|
+
children?: undefined;
|
|
10
|
+
label: string;
|
|
11
|
+
})) & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PanelFileInput: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
value: File | null;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
onChange: (payload: File | null) => void;
|
|
7
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const PanelTextInput: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
value: string;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
onChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
onKeyDown: (event: import("react").KeyboardEvent<Element>) => void;
|
|
8
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps } from "@blocknote/react";
|
|
3
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const PopoverContent: import("react").ForwardRefExoticComponent<{
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
variant: "form-popover" | "panel-popover";
|
|
9
|
+
children?: import("react").ReactNode;
|
|
10
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const Popover: (props: ComponentProps["Generic"]["Popover"]["Root"]) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SideMenuButton: import("react").ForwardRefExoticComponent<({
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
onClick?: ((e: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
|
|
5
|
+
icon?: import("react").ReactNode;
|
|
6
|
+
onDragStart?: ((e: import("react").DragEvent<Element>) => void) | undefined;
|
|
7
|
+
onDragEnd?: ((e: import("react").DragEvent<Element>) => void) | undefined;
|
|
8
|
+
draggable?: boolean | undefined;
|
|
9
|
+
} & ({
|
|
10
|
+
children: import("react").ReactNode;
|
|
11
|
+
label?: string | undefined;
|
|
12
|
+
} | {
|
|
13
|
+
children?: undefined;
|
|
14
|
+
label: string;
|
|
15
|
+
})) & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SuggestionMenuItem: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
id: string;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
item: import("@blocknote/react").DefaultReactSuggestionItem;
|
|
8
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const TableHandle: import("react").ForwardRefExoticComponent<({
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
draggable: boolean;
|
|
5
|
+
onDragStart: (e: import("react").DragEvent<Element>) => void;
|
|
6
|
+
onDragEnd: () => void;
|
|
7
|
+
style?: import("react").CSSProperties | undefined;
|
|
8
|
+
} & ({
|
|
9
|
+
children: import("react").ReactNode;
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
} | {
|
|
12
|
+
children?: undefined;
|
|
13
|
+
label: string;
|
|
14
|
+
})) & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Toolbar: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
children?: import("react").ReactNode;
|
|
5
|
+
} & {
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
children?: import("react").ReactNode;
|
|
8
|
+
onMouseEnter?: (() => void) | undefined;
|
|
9
|
+
onMouseLeave?: (() => void) | undefined;
|
|
10
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentProps } from "@blocknote/react";
|
|
3
|
+
type ToolbarButtonProps = ComponentProps["FormattingToolbar"]["Button"] & ComponentProps["LinkToolbar"]["Button"];
|
|
4
|
+
/**
|
|
5
|
+
* Helper for basic buttons that show in the formatting toolbar.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ToolbarButton: import("react").ForwardRefExoticComponent<ToolbarButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const ToolbarSelect: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
className?: string | undefined;
|
|
4
|
+
items: {
|
|
5
|
+
text: string;
|
|
6
|
+
icon: import("react").ReactNode;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
isDisabled?: boolean | undefined;
|
|
10
|
+
}[];
|
|
11
|
+
isDisabled?: boolean | undefined;
|
|
12
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|