@blocknote/mantine 0.14.0 → 0.14.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.js +587 -565
- package/dist/blocknote-mantine.js.map +1 -1
- package/dist/blocknote-mantine.umd.cjs +15 -10
- package/dist/blocknote-mantine.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +6 -6
- package/src/style.css +2 -1
- package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +1 -1
- package/src/suggestionMenu/SuggestionMenuItem.tsx +20 -3
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1718240408085,"assets":[{"name":"blocknote-mantine.umd.cjs","size":30368},{"name":"blocknote-mantine.umd.cjs.map","size":354058}],"chunks":[{"id":"ec22802","entry":true,"initial":true,"files":["blocknote-mantine.umd.cjs"],"names":["index"]}],"modules":[{"name":"../../node_modules/react/jsx-runtime.js?commonjs-module","size":31,"chunks":["ec22802"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.production.min.js?commonjs-exports","size":40,"chunks":["ec22802"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.production.min.js","size":1200,"chunks":["ec22802"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.development.js?commonjs-exports","size":37,"chunks":["ec22802"]},{"name":"../../node_modules/react/cjs/react-jsx-runtime.development.js","size":44073,"chunks":["ec22802"]},{"name":"../../node_modules/react/jsx-runtime.js","size":225,"chunks":["ec22802"]},{"name":"./src/BlockNoteTheme.ts","size":2185,"chunks":["ec22802"]},{"name":"./src/form/TextInput.tsx","size":582,"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":4155,"chunks":["ec22802"]},{"name":"./src/panel/Panel.tsx","size":1057,"chunks":["ec22802"]},{"name":"./src/panel/PanelButton.tsx","size":352,"chunks":["ec22802"]},{"name":"./src/panel/PanelFileInput.tsx","size":374,"chunks":["ec22802"]},{"name":"./src/panel/PanelTab.tsx","size":216,"chunks":["ec22802"]},{"name":"./src/panel/PanelTextInput.tsx","size":399,"chunks":["ec22802"]},{"name":"./src/popover/Popover.tsx","size":759,"chunks":["ec22802"]},{"name":"./src/sideMenu/SideMenu.tsx","size":316,"chunks":["ec22802"]},{"name":"./src/sideMenu/SideMenuButton.tsx","size":787,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenu.tsx","size":314,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuEmptyItem.tsx","size":352,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuItem.tsx","size":1806,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuLabel.tsx","size":234,"chunks":["ec22802"]},{"name":"./src/suggestionMenu/SuggestionMenuLoader.tsx","size":290,"chunks":["ec22802"]},{"name":"./src/tableHandle/TableHandle.tsx","size":459,"chunks":["ec22802"]},{"name":"./src/toolbar/Toolbar.tsx","size":569,"chunks":["ec22802"]},{"name":"./src/toolbar/ToolbarButton.tsx","size":2278,"chunks":["ec22802"]},{"name":"./src/toolbar/ToolbarSelect.tsx","size":1841,"chunks":["ec22802"]},{"name":"./src/style.css","size":17,"chunks":["ec22802"]},{"name":"./src/defaultThemes.ts","size":3405,"chunks":["ec22802"]},{"name":"./src/index.tsx","size":2464,"chunks":["ec22802"]}]}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"*.css"
|
|
7
7
|
],
|
|
8
8
|
"license": "MPL-2.0",
|
|
9
|
-
"version": "0.14.
|
|
9
|
+
"version": "0.14.1",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"types",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"clean": "rimraf dist && rimraf types"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@blocknote/core": "^0.14.
|
|
55
|
-
"@blocknote/react": "^0.14.
|
|
56
|
-
"@mantine/core": "^7.
|
|
57
|
-
"@mantine/hooks": "^7.
|
|
54
|
+
"@blocknote/core": "^0.14.1",
|
|
55
|
+
"@blocknote/react": "^0.14.1",
|
|
56
|
+
"@mantine/core": "^7.10.1",
|
|
57
|
+
"@mantine/hooks": "^7.10.1",
|
|
58
58
|
"@mantine/utils": "^6.0.21",
|
|
59
59
|
"react": "^18",
|
|
60
60
|
"react-dom": "^18",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"access": "public",
|
|
88
88
|
"registry": "https://registry.npmjs.org/"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "de69d1d3902499577ceb870499a03170c66380b1"
|
|
91
91
|
}
|
package/src/style.css
CHANGED
|
@@ -322,7 +322,6 @@
|
|
|
322
322
|
|
|
323
323
|
.bn-mt-suggestion-menu-item-body {
|
|
324
324
|
align-items: stretch;
|
|
325
|
-
color: var(--bn-colors-menu-text);
|
|
326
325
|
display: flex;
|
|
327
326
|
flex: 1;
|
|
328
327
|
flex-direction: column;
|
|
@@ -331,6 +330,7 @@
|
|
|
331
330
|
}
|
|
332
331
|
|
|
333
332
|
.bn-mt-suggestion-menu-item-title {
|
|
333
|
+
color: var(--bn-colors-menu-text);
|
|
334
334
|
line-height: 20px;
|
|
335
335
|
font-weight: 500;
|
|
336
336
|
font-size: 14px;
|
|
@@ -339,6 +339,7 @@
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
.bn-mt-suggestion-menu-item-subtitle {
|
|
342
|
+
color: var(--bn-colors-menu-text);
|
|
342
343
|
line-height: 16px;
|
|
343
344
|
font-size: 10px;
|
|
344
345
|
margin: 0;
|
|
@@ -14,7 +14,7 @@ export const SuggestionMenuEmptyItem = forwardRef<
|
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
16
|
<MantineGroup className={className} ref={ref}>
|
|
17
|
-
<MantineGroup className="bn-mt-suggestion-menu-item-
|
|
17
|
+
<MantineGroup className="bn-mt-suggestion-menu-item-title">
|
|
18
18
|
{children}
|
|
19
19
|
</MantineGroup>
|
|
20
20
|
</MantineGroup>
|
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
Stack as MantineStack,
|
|
5
5
|
Text as MantineText,
|
|
6
6
|
} from "@mantine/core";
|
|
7
|
+
import { mergeRefs } from "@mantine/hooks";
|
|
7
8
|
|
|
8
9
|
import { assertEmpty } from "@blocknote/core";
|
|
9
|
-
import { ComponentProps } from "@blocknote/react";
|
|
10
|
-
import { forwardRef } from "react";
|
|
10
|
+
import { ComponentProps, elementOverflow } from "@blocknote/react";
|
|
11
|
+
import { forwardRef, useEffect, useRef } from "react";
|
|
11
12
|
|
|
12
13
|
export const SuggestionMenuItem = forwardRef<
|
|
13
14
|
HTMLDivElement,
|
|
@@ -17,11 +18,27 @@ export const SuggestionMenuItem = forwardRef<
|
|
|
17
18
|
|
|
18
19
|
assertEmpty(rest);
|
|
19
20
|
|
|
21
|
+
const itemRef = useRef<HTMLDivElement>(null);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!itemRef.current || !isSelected) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const overflow = elementOverflow(itemRef.current);
|
|
29
|
+
|
|
30
|
+
if (overflow === "top") {
|
|
31
|
+
itemRef.current.scrollIntoView(true);
|
|
32
|
+
} else if (overflow === "bottom") {
|
|
33
|
+
itemRef.current.scrollIntoView(false);
|
|
34
|
+
}
|
|
35
|
+
}, [isSelected]);
|
|
36
|
+
|
|
20
37
|
return (
|
|
21
38
|
<MantineGroup
|
|
22
39
|
gap={0}
|
|
23
40
|
className={className}
|
|
24
|
-
ref={ref}
|
|
41
|
+
ref={mergeRefs(ref, itemRef)}
|
|
25
42
|
id={id}
|
|
26
43
|
role="option"
|
|
27
44
|
onClick={onClick}
|