@blocknote/mantine 0.25.2 → 0.26.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/dist/blocknote-mantine.cjs +1 -1
- package/dist/blocknote-mantine.cjs.map +1 -1
- package/dist/blocknote-mantine.js +416 -368
- package/dist/blocknote-mantine.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/comments/Card.tsx +56 -7
- package/src/comments/Comment.tsx +7 -3
- package/src/comments/Editor.tsx +3 -2
- package/src/components.tsx +4 -1
- package/src/style.css +35 -13
- package/types/src/comments/Card.d.ts +9 -0
- package/types/src/comments/Comment.d.ts +1 -0
- package/types/src/comments/Editor.d.ts +1 -0
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1742379518184,"assets":[{"name":"blocknote-mantine.cjs","size":20415},{"name":"blocknote-mantine.cjs.map","size":311787}],"chunks":[{"id":"ec22802","entry":true,"initial":true,"files":["blocknote-mantine.cjs"],"names":["blocknote-mantine"]}],"modules":[{"name":"./src/BlockNoteTheme.ts","size":2185,"chunks":["ec22802"]},{"name":"./src/toolbar/ToolbarButton.tsx","size":2674,"chunks":["ec22802"]},{"name":"./src/badge/Badge.tsx","size":1437,"chunks":["ec22802"]},{"name":"./src/comments/Card.tsx","size":1403,"chunks":["ec22802"]},{"name":"./src/comments/Comment.tsx","size":2082,"chunks":["ec22802"]},{"name":"./src/comments/Editor.tsx","size":965,"chunks":["ec22802"]},{"name":"./src/form/TextInput.tsx","size":575,"chunks":["ec22802"]},{"name":"../../node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["ec22802"]},{"name":"../../node_modules/react-icons/lib/iconBase.mjs","size":4014,"chunks":["ec22802"]},{"name":"../../node_modules/react-icons/hi/index.mjs","size":744,"chunks":["ec22802"]},{"name":"./src/menu/Menu.tsx","size":4095,"chunks":["ec22802"]},{"name":"./src/menu/Button.tsx","size":765,"chunks":["ec22802"]},{"name":"./src/panel/Panel.tsx","size":1015,"chunks":["ec22802"]},{"name":"./src/panel/PanelButton.tsx","size":345,"chunks":["ec22802"]},{"name":"./src/panel/PanelFileInput.tsx","size":367,"chunks":["ec22802"]},{"name":"./src/panel/PanelTab.tsx","size":209,"chunks":["ec22802"]},{"name":"./src/panel/PanelTextInput.tsx","size":392,"chunks":["ec22802"]},{"name":"./src/popover/Popover.tsx","size":679,"chunks":["ec22802"]},{"name":"./src/sideMenu/SideMenu.tsx","size":309,"chunks":["ec22802"]},{"name":"./src/sideMenu/SideMenuButton.tsx","size":773,"chunks":["ec22802"]},{"name":"./src/style.css","size":0,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenu.tsx","size":307,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuEmptyItem.tsx","size":338,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuItem.tsx","size":1822,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuLabel.tsx","size":227,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuLoader.tsx","size":283,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenu.tsx","size":361,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuEmptyItem.tsx","size":436,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.tsx","size":855,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuLoader.tsx","size":385,"chunks":["ec22802"]},{"name":"./src/tableHandle/ExtendButton.tsx","size":333,"chunks":["ec22802"]},{"name":"./src/tableHandle/TableHandle.tsx","size":452,"chunks":["ec22802"]},{"name":"./src/toolbar/Toolbar.tsx","size":666,"chunks":["ec22802"]},{"name":"./src/toolbar/ToolbarSelect.tsx","size":1785,"chunks":["ec22802"]},{"name":"./src/components.tsx","size":1540,"chunks":["ec22802"]},{"name":"./src/BlockNoteView.tsx","size":1638,"chunks":["ec22802"]},{"name":"./src/defaultThemes.ts","size":2023,"chunks":["ec22802"]},{"name":"./src/index.tsx","size":0,"chunks":["ec22802"]}]}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"*.css"
|
|
7
7
|
],
|
|
8
8
|
"license": "MPL-2.0",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.26.0",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"types",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"clean": "rimraf dist && rimraf types"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@blocknote/core": "^0.
|
|
54
|
-
"@blocknote/react": "^0.
|
|
53
|
+
"@blocknote/core": "^0.26.0",
|
|
54
|
+
"@blocknote/react": "^0.26.0",
|
|
55
55
|
"@mantine/core": "^7.10.1",
|
|
56
56
|
"@mantine/hooks": "^7.10.1",
|
|
57
57
|
"@mantine/utils": "^6.0.21",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"access": "public",
|
|
84
84
|
"registry": "https://registry.npmjs.org/"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "7d8c79c62c750db921208c373e6ae7b0c42f994c"
|
|
87
87
|
}
|
package/src/comments/Card.tsx
CHANGED
|
@@ -1,18 +1,50 @@
|
|
|
1
|
-
import { assertEmpty } from "@blocknote/core";
|
|
2
|
-
import { ComponentProps } from "@blocknote/react";
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
2
|
+
import { ComponentProps, mergeRefs } from "@blocknote/react";
|
|
3
|
+
import {
|
|
4
|
+
Card as MantineCard,
|
|
5
|
+
Divider as MantineDivider,
|
|
6
|
+
Text as MantineText,
|
|
7
|
+
} from "@mantine/core";
|
|
8
|
+
import { forwardRef, useEffect, useRef } from "react";
|
|
5
9
|
|
|
6
10
|
export const Card = forwardRef<
|
|
7
11
|
HTMLDivElement,
|
|
8
12
|
ComponentProps["Comments"]["Card"]
|
|
9
13
|
>((props, ref) => {
|
|
10
|
-
const {
|
|
14
|
+
const {
|
|
15
|
+
className,
|
|
16
|
+
children,
|
|
17
|
+
headerText,
|
|
18
|
+
selected,
|
|
19
|
+
onFocus,
|
|
20
|
+
onBlur,
|
|
21
|
+
tabIndex,
|
|
22
|
+
...rest
|
|
23
|
+
} = props;
|
|
11
24
|
|
|
12
25
|
assertEmpty(rest, false);
|
|
13
26
|
|
|
27
|
+
// Makes the card scroll into view when selected.
|
|
28
|
+
const scrollRef = useRef<HTMLDivElement>(null);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (selected) {
|
|
31
|
+
scrollRef.current?.scrollIntoView({
|
|
32
|
+
behavior: "smooth",
|
|
33
|
+
block: "center",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}, [selected]);
|
|
37
|
+
|
|
14
38
|
return (
|
|
15
|
-
<MantineCard
|
|
39
|
+
<MantineCard
|
|
40
|
+
className={mergeCSSClasses(className, selected ? "selected" : "")}
|
|
41
|
+
onFocus={onFocus}
|
|
42
|
+
onBlur={onBlur}
|
|
43
|
+
tabIndex={tabIndex}
|
|
44
|
+
ref={mergeRefs([ref, scrollRef])}>
|
|
45
|
+
{headerText && (
|
|
46
|
+
<MantineText className={"bn-header-text"}>{headerText}</MantineText>
|
|
47
|
+
)}
|
|
16
48
|
{children}
|
|
17
49
|
</MantineCard>
|
|
18
50
|
);
|
|
@@ -27,8 +59,25 @@ export const CardSection = forwardRef<
|
|
|
27
59
|
assertEmpty(rest, false);
|
|
28
60
|
|
|
29
61
|
return (
|
|
30
|
-
<MantineCard.Section
|
|
62
|
+
<MantineCard.Section className={className} ref={ref}>
|
|
31
63
|
{children}
|
|
32
64
|
</MantineCard.Section>
|
|
33
65
|
);
|
|
34
66
|
});
|
|
67
|
+
|
|
68
|
+
export const ExpandSectionsPrompt = forwardRef<
|
|
69
|
+
HTMLDivElement,
|
|
70
|
+
ComponentProps["Comments"]["ExpandSectionsPrompt"]
|
|
71
|
+
>((props, ref) => {
|
|
72
|
+
const { className, children, ...rest } = props;
|
|
73
|
+
|
|
74
|
+
assertEmpty(rest, false);
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<MantineDivider
|
|
78
|
+
className={className}
|
|
79
|
+
label={<MantineText>{children}</MantineText>}
|
|
80
|
+
ref={ref}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
});
|
package/src/comments/Comment.tsx
CHANGED
|
@@ -6,9 +6,12 @@ import { forwardRef } from "react";
|
|
|
6
6
|
|
|
7
7
|
const AuthorInfo = forwardRef<
|
|
8
8
|
HTMLDivElement,
|
|
9
|
-
Pick<
|
|
9
|
+
Pick<
|
|
10
|
+
ComponentProps["Comments"]["Comment"],
|
|
11
|
+
"authorInfo" | "timeString" | "edited"
|
|
12
|
+
>
|
|
10
13
|
>((props, _ref) => {
|
|
11
|
-
const { authorInfo, timeString, ...rest } = props;
|
|
14
|
+
const { authorInfo, timeString, edited, ...rest } = props;
|
|
12
15
|
|
|
13
16
|
assertEmpty(rest, false);
|
|
14
17
|
|
|
@@ -37,7 +40,7 @@ const AuthorInfo = forwardRef<
|
|
|
37
40
|
<Text fz="sm" fw={"bold"}>
|
|
38
41
|
{authorInfo.username}
|
|
39
42
|
<Text fz="xs" c="dimmed" span ml={"xs"}>
|
|
40
|
-
{timeString}
|
|
43
|
+
{timeString} {edited && "(edited)"}
|
|
41
44
|
</Text>
|
|
42
45
|
</Text>
|
|
43
46
|
</Group>
|
|
@@ -53,6 +56,7 @@ export const Comment = forwardRef<
|
|
|
53
56
|
showActions,
|
|
54
57
|
authorInfo,
|
|
55
58
|
timeString,
|
|
59
|
+
edited,
|
|
56
60
|
actions,
|
|
57
61
|
children,
|
|
58
62
|
...rest
|
package/src/comments/Editor.tsx
CHANGED
|
@@ -12,13 +12,14 @@ export const Editor = forwardRef<
|
|
|
12
12
|
HTMLDivElement,
|
|
13
13
|
ComponentProps["Comments"]["Editor"]
|
|
14
14
|
>((props, ref) => {
|
|
15
|
-
const { className, onFocus, onBlur, editor, editable, ...rest } =
|
|
15
|
+
const { className, autoFocus, onFocus, onBlur, editor, editable, ...rest } =
|
|
16
|
+
props;
|
|
16
17
|
|
|
17
18
|
assertEmpty(rest, false);
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
21
|
<BlockNoteView
|
|
21
|
-
autoFocus={
|
|
22
|
+
autoFocus={autoFocus}
|
|
22
23
|
className={className}
|
|
23
24
|
editor={props.editor}
|
|
24
25
|
sideMenu={false}
|
package/src/components.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Components } from "@blocknote/react";
|
|
2
2
|
import { Badge, BadgeGroup } from "./badge/Badge.js";
|
|
3
|
-
import { Card, CardSection } from "./comments/Card.js";
|
|
3
|
+
import { Card, CardSection, ExpandSectionsPrompt } from "./comments/Card.js";
|
|
4
4
|
import { Comment } from "./comments/Comment.js";
|
|
5
5
|
import { Editor } from "./comments/Editor.js";
|
|
6
6
|
import { TextInput } from "./form/TextInput.js";
|
|
@@ -59,6 +59,7 @@ export const components: Components = {
|
|
|
59
59
|
LinkToolbar: {
|
|
60
60
|
Root: Toolbar,
|
|
61
61
|
Button: ToolbarButton,
|
|
62
|
+
Select: ToolbarSelect,
|
|
62
63
|
},
|
|
63
64
|
SideMenu: {
|
|
64
65
|
Root: SideMenu,
|
|
@@ -101,6 +102,7 @@ export const components: Components = {
|
|
|
101
102
|
Toolbar: {
|
|
102
103
|
Root: Toolbar,
|
|
103
104
|
Button: ToolbarButton,
|
|
105
|
+
Select: ToolbarSelect,
|
|
104
106
|
},
|
|
105
107
|
},
|
|
106
108
|
Comments: {
|
|
@@ -108,5 +110,6 @@ export const components: Components = {
|
|
|
108
110
|
Editor,
|
|
109
111
|
Card,
|
|
110
112
|
CardSection,
|
|
113
|
+
ExpandSectionsPrompt,
|
|
111
114
|
},
|
|
112
115
|
};
|
package/src/style.css
CHANGED
|
@@ -256,8 +256,7 @@
|
|
|
256
256
|
max-height: 100%;
|
|
257
257
|
position: relative;
|
|
258
258
|
box-shadow: var(--mantine-shadow-md);
|
|
259
|
-
border: calc(0.0625rem * var(--mantine-scale)) solid
|
|
260
|
-
var(--mantine-color-gray-2);
|
|
259
|
+
border: calc(0.0625rem * var(--mantine-scale)) solid var(--mantine-color-gray-2);
|
|
261
260
|
border-radius: var(--mantine-radius-default);
|
|
262
261
|
padding: 4px;
|
|
263
262
|
}
|
|
@@ -577,8 +576,8 @@
|
|
|
577
576
|
}
|
|
578
577
|
|
|
579
578
|
.bn-mt-sub-menu-item
|
|
580
|
-
|
|
581
|
-
|
|
579
|
+
> .mantine-Menu-itemLabel
|
|
580
|
+
> div:not(.mantine-Menu-dropdown) {
|
|
582
581
|
align-items: center;
|
|
583
582
|
display: flex;
|
|
584
583
|
justify-content: space-between;
|
|
@@ -591,13 +590,30 @@
|
|
|
591
590
|
border-radius: var(--bn-border-radius-medium);
|
|
592
591
|
box-shadow: var(--bn-shadow-medium);
|
|
593
592
|
color: var(--bn-colors-menu-text);
|
|
593
|
+
display: flex;
|
|
594
|
+
flex-direction: column;
|
|
595
|
+
gap: 16px;
|
|
596
|
+
min-width: 350px;
|
|
594
597
|
overflow: visible;
|
|
595
598
|
}
|
|
596
599
|
|
|
597
|
-
.bn-mantine .bn-
|
|
598
|
-
|
|
600
|
+
.bn-mantine .bn-threads-sidebar .bn-thread {
|
|
601
|
+
box-shadow: none;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.bn-mantine .bn-thread:not(.selected) {
|
|
605
|
+
cursor: pointer;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
.bn-mantine .bn-thread-comments,
|
|
609
|
+
.bn-mantine .bn-thread-composer {
|
|
599
610
|
display: flex;
|
|
600
611
|
flex-direction: column;
|
|
612
|
+
margin: 0;
|
|
613
|
+
padding: 0;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.bn-mantine .bn-thread-comments {
|
|
601
617
|
gap: 1rem;
|
|
602
618
|
}
|
|
603
619
|
|
|
@@ -615,6 +631,12 @@
|
|
|
615
631
|
color: var(--bn-colors-menu-text);
|
|
616
632
|
}
|
|
617
633
|
|
|
634
|
+
.bn-mantine .bn-thread .bn-header-text,
|
|
635
|
+
.bn-mantine .bn-thread-comment .bn-resolved-text {
|
|
636
|
+
font-size: 0.8rem;
|
|
637
|
+
font-style: italic;
|
|
638
|
+
}
|
|
639
|
+
|
|
618
640
|
.bn-mantine .bn-comment-actions-wrapper {
|
|
619
641
|
width: 100%;
|
|
620
642
|
display: flex;
|
|
@@ -692,18 +714,18 @@
|
|
|
692
714
|
}
|
|
693
715
|
|
|
694
716
|
.bn-mantine
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
717
|
+
.bn-badge
|
|
718
|
+
.mantine-Chip-label
|
|
719
|
+
> span:not(.mantine-Chip-iconWrapper) {
|
|
698
720
|
display: inline-flex;
|
|
699
721
|
gap: 4px;
|
|
700
722
|
}
|
|
701
723
|
|
|
702
724
|
.bn-mantine
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
725
|
+
.bn-badge
|
|
726
|
+
.mantine-Chip-label
|
|
727
|
+
> span:not(.mantine-Chip-iconWrapper)
|
|
728
|
+
> span {
|
|
707
729
|
align-items: center;
|
|
708
730
|
display: inline-flex;
|
|
709
731
|
justify-content: center;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Card: import("react").ForwardRefExoticComponent<{
|
|
3
3
|
className?: string | undefined;
|
|
4
|
+
headerText?: string | undefined;
|
|
5
|
+
selected?: boolean | undefined;
|
|
6
|
+
onFocus?: ((event: import("react").FocusEvent<Element, Element>) => void) | undefined;
|
|
7
|
+
onBlur?: ((event: import("react").FocusEvent<Element, Element>) => void) | undefined;
|
|
8
|
+
tabIndex?: number | undefined;
|
|
4
9
|
children?: import("react").ReactNode;
|
|
5
10
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
11
|
export declare const CardSection: import("react").ForwardRefExoticComponent<{
|
|
7
12
|
className?: string | undefined;
|
|
8
13
|
children?: import("react").ReactNode;
|
|
9
14
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
15
|
+
export declare const ExpandSectionsPrompt: import("react").ForwardRefExoticComponent<{
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -4,6 +4,7 @@ export declare const Comment: import("react").ForwardRefExoticComponent<{
|
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
authorInfo: "loading" | import("@blocknote/core/types/src/comments").User;
|
|
6
6
|
timeString: string;
|
|
7
|
+
edited: boolean;
|
|
7
8
|
actions?: import("react").ReactNode;
|
|
8
9
|
showActions?: boolean | "hover" | undefined;
|
|
9
10
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Editor: import("react").ForwardRefExoticComponent<{
|
|
3
3
|
className?: string | undefined;
|
|
4
|
+
autoFocus?: boolean | undefined;
|
|
4
5
|
editable: boolean;
|
|
5
6
|
editor: import("@blocknote/core").BlockNoteEditor<any, any, any>;
|
|
6
7
|
onFocus?: (() => void) | undefined;
|