@blocknote/mantine 0.30.1 → 0.31.1
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 +120 -113
- 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/form/TextInput.tsx +12 -2
- package/src/style.css +57 -0
- package/src/suggestionMenu/SuggestionMenuItem.tsx +2 -1
- package/src/suggestionMenu/SuggestionMenuLoader.tsx +4 -6
- package/src/toolbar/Toolbar.tsx +1 -2
- package/src/toolbar/ToolbarButton.tsx +1 -2
- package/types/src/form/TextInput.d.ts +5 -1
- package/types/src/suggestionMenu/SuggestionMenuItem.d.ts +1 -1
- package/types/src/suggestionMenu/SuggestionMenuLoader.d.ts +0 -1
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1747989984386,"assets":[{"name":"blocknote-mantine.cjs","size":20586},{"name":"blocknote-mantine.cjs.map","size":312750}],"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":805,"chunks":["ec22802"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["ec22802"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/lib/iconBase.mjs","size":4003,"chunks":["ec22802"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@18.3.1/node_modules/react-icons/hi/index.mjs","size":720,"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":1911,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuLabel.tsx","size":227,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuLoader.tsx","size":233,"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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/mantine"
|
|
12
12
|
},
|
|
13
13
|
"license": "MPL-2.0",
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.31.1",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"types",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@blocknote/core": "0.
|
|
53
|
-
"@blocknote/react": "0.
|
|
52
|
+
"@blocknote/core": "0.31.1",
|
|
53
|
+
"@blocknote/react": "0.31.1",
|
|
54
54
|
"@mantine/core": "^7.10.1",
|
|
55
55
|
"@mantine/hooks": "^7.10.1",
|
|
56
56
|
"@mantine/utils": "^6.0.21",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"eslintConfig": {
|
|
76
76
|
"extends": [
|
|
77
|
-
"../../.eslintrc.
|
|
77
|
+
"../../.eslintrc.json"
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
package/src/form/TextInput.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TextInput as MantineTextInput } from "@mantine/core";
|
|
2
2
|
|
|
3
|
-
import { assertEmpty } from "@blocknote/core";
|
|
3
|
+
import { assertEmpty, mergeCSSClasses } from "@blocknote/core";
|
|
4
4
|
import { ComponentProps } from "@blocknote/react";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
6
|
|
|
@@ -12,13 +12,17 @@ export const TextInput = forwardRef<
|
|
|
12
12
|
className,
|
|
13
13
|
name,
|
|
14
14
|
label,
|
|
15
|
+
variant,
|
|
15
16
|
icon,
|
|
16
17
|
value,
|
|
17
18
|
autoFocus,
|
|
18
19
|
placeholder,
|
|
20
|
+
disabled,
|
|
19
21
|
onKeyDown,
|
|
20
22
|
onChange,
|
|
21
23
|
onSubmit,
|
|
24
|
+
autoComplete,
|
|
25
|
+
rightSection,
|
|
22
26
|
...rest
|
|
23
27
|
} = props;
|
|
24
28
|
|
|
@@ -27,7 +31,10 @@ export const TextInput = forwardRef<
|
|
|
27
31
|
return (
|
|
28
32
|
<MantineTextInput
|
|
29
33
|
size={"xs"}
|
|
30
|
-
className={
|
|
34
|
+
className={mergeCSSClasses(
|
|
35
|
+
className || "",
|
|
36
|
+
variant === "large" ? "bn-mt-input-large" : ""
|
|
37
|
+
)}
|
|
31
38
|
ref={ref}
|
|
32
39
|
name={name}
|
|
33
40
|
label={label}
|
|
@@ -35,10 +42,13 @@ export const TextInput = forwardRef<
|
|
|
35
42
|
value={value}
|
|
36
43
|
autoFocus={autoFocus}
|
|
37
44
|
data-autofocus={autoFocus ? "true" : undefined}
|
|
45
|
+
rightSection={rightSection}
|
|
38
46
|
placeholder={placeholder}
|
|
47
|
+
disabled={disabled}
|
|
39
48
|
onKeyDown={onKeyDown}
|
|
40
49
|
onChange={onChange}
|
|
41
50
|
onSubmit={onSubmit}
|
|
51
|
+
autoComplete={autoComplete}
|
|
42
52
|
/>
|
|
43
53
|
);
|
|
44
54
|
});
|
package/src/style.css
CHANGED
|
@@ -118,6 +118,12 @@
|
|
|
118
118
|
height: 32px;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
.bn-mantine .bn-mt-input-large .mantine-TextInput-input {
|
|
122
|
+
border: none;
|
|
123
|
+
font-size: 14px;
|
|
124
|
+
height: 52px;
|
|
125
|
+
}
|
|
126
|
+
|
|
121
127
|
/* Mantine Tooltip component base styles */
|
|
122
128
|
.bn-mantine .mantine-Tooltip-tooltip {
|
|
123
129
|
background-color: transparent;
|
|
@@ -324,6 +330,12 @@
|
|
|
324
330
|
height: 52px;
|
|
325
331
|
}
|
|
326
332
|
|
|
333
|
+
.bn-mantine .bn-suggestion-menu-item-small {
|
|
334
|
+
height: fit-content;
|
|
335
|
+
/* Made to match with labels */
|
|
336
|
+
padding: calc(var(--mantine-spacing-xs) / 2) var(--mantine-spacing-sm);
|
|
337
|
+
}
|
|
338
|
+
|
|
327
339
|
.bn-mantine .bn-suggestion-menu-item[aria-selected="true"],
|
|
328
340
|
.bn-mantine .bn-suggestion-menu-item:hover {
|
|
329
341
|
background-color: var(--bn-colors-hovered-background);
|
|
@@ -339,6 +351,19 @@
|
|
|
339
351
|
padding: 8px;
|
|
340
352
|
}
|
|
341
353
|
|
|
354
|
+
.bn-suggestion-menu-item-small
|
|
355
|
+
.bn-mt-suggestion-menu-item-section[data-position="left"] {
|
|
356
|
+
background-color: transparent;
|
|
357
|
+
padding: 0;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.bn-suggestion-menu-item-small
|
|
361
|
+
.bn-mt-suggestion-menu-item-section[data-position="left"]
|
|
362
|
+
svg {
|
|
363
|
+
height: 14px;
|
|
364
|
+
width: 14px;
|
|
365
|
+
}
|
|
366
|
+
|
|
342
367
|
.bn-mt-suggestion-menu-item-body {
|
|
343
368
|
align-items: stretch;
|
|
344
369
|
display: flex;
|
|
@@ -357,6 +382,10 @@
|
|
|
357
382
|
padding: 0;
|
|
358
383
|
}
|
|
359
384
|
|
|
385
|
+
.bn-suggestion-menu-item-small .bn-mt-suggestion-menu-item-title {
|
|
386
|
+
font-size: 12px;
|
|
387
|
+
}
|
|
388
|
+
|
|
360
389
|
.bn-mt-suggestion-menu-item-subtitle {
|
|
361
390
|
color: var(--bn-colors-menu-text);
|
|
362
391
|
line-height: 16px;
|
|
@@ -365,6 +394,10 @@
|
|
|
365
394
|
padding: 0;
|
|
366
395
|
}
|
|
367
396
|
|
|
397
|
+
.bn-suggestion-menu-item-small .bn-mt-suggestion-menu-item-subtitle {
|
|
398
|
+
display: none;
|
|
399
|
+
}
|
|
400
|
+
|
|
368
401
|
.bn-mantine .bn-suggestion-menu-label {
|
|
369
402
|
color: var(--bn-colors-hovered-text);
|
|
370
403
|
}
|
|
@@ -732,6 +765,30 @@
|
|
|
732
765
|
justify-content: center;
|
|
733
766
|
}
|
|
734
767
|
|
|
768
|
+
/* Combobox styling */
|
|
769
|
+
.bn-mantine .bn-combobox-input,
|
|
770
|
+
.bn-mantine .bn-combobox-items:not(:empty) {
|
|
771
|
+
background-color: var(--bn-colors-menu-background);
|
|
772
|
+
border: var(--bn-border);
|
|
773
|
+
border-radius: var(--bn-border-radius-medium);
|
|
774
|
+
box-shadow: var(--bn-shadow-medium);
|
|
775
|
+
color: var(--bn-colors-menu-text);
|
|
776
|
+
gap: 4px;
|
|
777
|
+
min-width: 145px;
|
|
778
|
+
padding: 2px;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.bn-mantine .bn-combobox-input .bn-combobox-icon,
|
|
782
|
+
.bn-mantine .bn-combobox-input .bn-combobox-right-section {
|
|
783
|
+
align-items: center;
|
|
784
|
+
display: flex;
|
|
785
|
+
justify-content: center;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
.bn-mantine .bn-combobox-input .bn-combobox-error {
|
|
789
|
+
color: var(--bn-colors-highlights-red-background);
|
|
790
|
+
}
|
|
791
|
+
|
|
735
792
|
/* We need to get rid of the checked icon - you can set the icon prop to an
|
|
736
793
|
empty element (<></>), but even so Mantine leaves extra space for the icon, so
|
|
737
794
|
we just don't display it in CSS instead. */
|
|
@@ -27,7 +27,7 @@ export const SuggestionMenuItem = forwardRef<
|
|
|
27
27
|
|
|
28
28
|
const overflow = elementOverflow(
|
|
29
29
|
itemRef.current,
|
|
30
|
-
document.querySelector(".bn-suggestion-menu")!,
|
|
30
|
+
document.querySelector(".bn-suggestion-menu, #ai-suggestion-menu")!, // TODO
|
|
31
31
|
);
|
|
32
32
|
|
|
33
33
|
if (overflow === "top") {
|
|
@@ -44,6 +44,7 @@ export const SuggestionMenuItem = forwardRef<
|
|
|
44
44
|
ref={mergeRefs(ref, itemRef)}
|
|
45
45
|
id={id}
|
|
46
46
|
role="option"
|
|
47
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
47
48
|
onClick={onClick}
|
|
48
49
|
aria-selected={isSelected || undefined}
|
|
49
50
|
>
|
|
@@ -8,13 +8,11 @@ export const SuggestionMenuLoader = forwardRef<
|
|
|
8
8
|
HTMLDivElement,
|
|
9
9
|
ComponentProps["SuggestionMenu"]["Loader"]
|
|
10
10
|
>((props, ref) => {
|
|
11
|
-
const {
|
|
12
|
-
className,
|
|
13
|
-
children, // unused, using "dots" instead
|
|
14
|
-
...rest
|
|
15
|
-
} = props;
|
|
11
|
+
const { className, ...rest } = props;
|
|
16
12
|
|
|
17
13
|
assertEmpty(rest);
|
|
18
14
|
|
|
19
|
-
return
|
|
15
|
+
return (
|
|
16
|
+
<MantineLoader className={className} type="dots" size={16} ref={ref} />
|
|
17
|
+
);
|
|
20
18
|
});
|
package/src/toolbar/Toolbar.tsx
CHANGED
|
@@ -5,8 +5,7 @@ import { ComponentProps } from "@blocknote/react";
|
|
|
5
5
|
import { mergeRefs, useFocusTrap, useFocusWithin } from "@mantine/hooks";
|
|
6
6
|
import { forwardRef } from "react";
|
|
7
7
|
|
|
8
|
-
type ToolbarProps = ComponentProps["
|
|
9
|
-
ComponentProps["LinkToolbar"]["Root"];
|
|
8
|
+
type ToolbarProps = ComponentProps["Generic"]["Toolbar"]["Root"];
|
|
10
9
|
|
|
11
10
|
export const Toolbar = forwardRef<HTMLDivElement, ToolbarProps>(
|
|
12
11
|
(props, ref) => {
|
|
@@ -26,8 +26,7 @@ export const TooltipContent = (props: {
|
|
|
26
26
|
</MantineStack>
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
-
type ToolbarButtonProps = ComponentProps["
|
|
30
|
-
ComponentProps["LinkToolbar"]["Button"];
|
|
29
|
+
type ToolbarButtonProps = ComponentProps["Generic"]["Toolbar"]["Button"];
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* Helper for basic buttons that show in the formatting toolbar.
|
|
@@ -2,11 +2,15 @@ export declare const TextInput: import("react").ForwardRefExoticComponent<{
|
|
|
2
2
|
className?: string;
|
|
3
3
|
name: string;
|
|
4
4
|
label?: string;
|
|
5
|
+
variant?: "default" | "large";
|
|
5
6
|
icon: import("react").ReactNode;
|
|
7
|
+
rightSection?: import("react").ReactNode;
|
|
6
8
|
autoFocus?: boolean;
|
|
7
|
-
placeholder
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
disabled?: boolean;
|
|
8
11
|
value: string;
|
|
9
12
|
onKeyDown: (event: import("react").KeyboardEvent<HTMLInputElement>) => void;
|
|
10
13
|
onChange: (event: import("react").ChangeEvent<HTMLInputElement>) => void;
|
|
11
14
|
onSubmit?: () => void;
|
|
15
|
+
autoComplete?: import("react").HTMLInputAutoCompleteAttribute;
|
|
12
16
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -3,5 +3,5 @@ export declare const SuggestionMenuItem: import("react").ForwardRefExoticCompone
|
|
|
3
3
|
id: string;
|
|
4
4
|
isSelected: boolean;
|
|
5
5
|
onClick: () => void;
|
|
6
|
-
item: import("@blocknote/react").DefaultReactSuggestionItem
|
|
6
|
+
item: Omit<import("@blocknote/react").DefaultReactSuggestionItem, "onItemClick">;
|
|
7
7
|
} & import("react").RefAttributes<HTMLDivElement>>;
|