@blocknote/mantine 0.39.1 → 0.41.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 +536 -577
- package/dist/blocknote-mantine.js.map +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +14 -9
- package/src/BlockNoteView.tsx +32 -28
- package/src/blocknoteStyles.css +795 -0
- package/src/components.tsx +0 -1
- package/src/mantineStyles.css +558 -39
- package/src/menu/Menu.tsx +41 -133
- package/src/style.css +1 -796
- package/types/src/BlockNoteView.d.ts +0 -1
- package/types/src/components.d.ts +0 -1
- package/dist/style.css +0 -1
package/dist/webpack-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"builtAt":
|
|
1
|
+
{"builtAt":1759917866578,"assets":[{"name":"blocknote-mantine.cjs","size":20091},{"name":"blocknote-mantine.cjs.map","size":310073}],"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":2137,"chunks":["ec22802"]},{"name":"./src/comments/Editor.tsx","size":1075,"chunks":["ec22802"]},{"name":"./src/form/TextInput.tsx","size":805,"chunks":["ec22802"]},{"name":"./src/menu/Menu.tsx","size":3140,"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/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":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.1.0/node_modules/react-icons/lib/iconContext.mjs","size":251,"chunks":["ec22802"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.1.0/node_modules/react-icons/lib/iconBase.mjs","size":4003,"chunks":["ec22802"]},{"name":"../../node_modules/.pnpm/react-icons@5.5.0_react@19.1.0/node_modules/react-icons/hi/index.mjs","size":375,"chunks":["ec22802"]},{"name":"./src/toolbar/ToolbarSelect.tsx","size":1785,"chunks":["ec22802"]},{"name":"./src/components.tsx","size":1540,"chunks":["ec22802"]},{"name":"./src/BlockNoteView.tsx","size":1614,"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.41.0",
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
17
|
"types",
|
|
@@ -43,17 +43,19 @@
|
|
|
43
43
|
"require": "./dist/blocknote-mantine.cjs"
|
|
44
44
|
},
|
|
45
45
|
"./style.css": {
|
|
46
|
-
"import": "./
|
|
47
|
-
"require": "./
|
|
48
|
-
"style": "./
|
|
46
|
+
"import": "./src/style.css",
|
|
47
|
+
"require": "./src/style.css",
|
|
48
|
+
"style": "./src/style.css"
|
|
49
|
+
},
|
|
50
|
+
"./blocknoteStyles.css": {
|
|
51
|
+
"import": "./src/blocknoteStyles.css",
|
|
52
|
+
"require": "./src/blocknoteStyles.css",
|
|
53
|
+
"style": "./src/blocknoteStyles.css"
|
|
49
54
|
}
|
|
50
55
|
},
|
|
51
56
|
"dependencies": {
|
|
52
|
-
"@blocknote/core": "0.
|
|
53
|
-
"@blocknote/react": "0.
|
|
54
|
-
"@mantine/core": "^7.17.3",
|
|
55
|
-
"@mantine/hooks": "^7.17.3",
|
|
56
|
-
"@mantine/utils": "^6.0.21",
|
|
57
|
+
"@blocknote/core": "0.41.0",
|
|
58
|
+
"@blocknote/react": "0.41.0",
|
|
57
59
|
"react-icons": "^5.2.1"
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
@@ -71,6 +73,9 @@
|
|
|
71
73
|
"vite-plugin-externalize-deps": "^0.8.0"
|
|
72
74
|
},
|
|
73
75
|
"peerDependencies": {
|
|
76
|
+
"@mantine/core": "^8.3.2",
|
|
77
|
+
"@mantine/hooks": "^8.3.2",
|
|
78
|
+
"@mantine/utils": "^6.0.22",
|
|
74
79
|
"react": "^18.0 || ^19.0 || >= 19.0.0-rc",
|
|
75
80
|
"react-dom": "^18.0 || ^19.0 || >= 19.0.0-rc"
|
|
76
81
|
},
|
package/src/BlockNoteView.tsx
CHANGED
|
@@ -10,20 +10,14 @@ import {
|
|
|
10
10
|
useBlockNoteContext,
|
|
11
11
|
usePrefersColorScheme,
|
|
12
12
|
} from "@blocknote/react";
|
|
13
|
-
import { MantineProvider } from "@mantine/core";
|
|
14
|
-
import React, { useCallback } from "react";
|
|
13
|
+
import { MantineContext, MantineProvider } from "@mantine/core";
|
|
14
|
+
import React, { useCallback, useContext } from "react";
|
|
15
15
|
import {
|
|
16
16
|
applyBlockNoteCSSVariablesFromTheme,
|
|
17
17
|
removeBlockNoteCSSVariables,
|
|
18
18
|
Theme,
|
|
19
19
|
} from "./BlockNoteTheme.js";
|
|
20
20
|
import { components } from "./components.js";
|
|
21
|
-
import "./style.css";
|
|
22
|
-
|
|
23
|
-
const mantineTheme = {
|
|
24
|
-
// Removes button press effect
|
|
25
|
-
activeClassName: "",
|
|
26
|
-
};
|
|
27
21
|
|
|
28
22
|
export const BlockNoteView = <
|
|
29
23
|
BSchema extends BlockSchema,
|
|
@@ -76,6 +70,8 @@ export const BlockNoteView = <
|
|
|
76
70
|
[defaultColorScheme, theme],
|
|
77
71
|
);
|
|
78
72
|
|
|
73
|
+
const mantineContext = useContext(MantineContext);
|
|
74
|
+
|
|
79
75
|
const finalTheme =
|
|
80
76
|
typeof theme === "string"
|
|
81
77
|
? theme
|
|
@@ -83,27 +79,35 @@ export const BlockNoteView = <
|
|
|
83
79
|
? defaultColorScheme
|
|
84
80
|
: "light";
|
|
85
81
|
|
|
86
|
-
|
|
82
|
+
const view = (
|
|
87
83
|
<ComponentsContext.Provider value={components}>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// editor container element. Instead, we set it to `undefined` and set it
|
|
96
|
-
// manually in `BlockNoteViewRaw`.
|
|
97
|
-
getRootElement={() => undefined}
|
|
98
|
-
>
|
|
99
|
-
<BlockNoteViewRaw
|
|
100
|
-
data-mantine-color-scheme={finalTheme}
|
|
101
|
-
className={mergeCSSClasses("bn-mantine", className || "")}
|
|
102
|
-
theme={typeof theme === "object" ? undefined : theme}
|
|
103
|
-
{...rest}
|
|
104
|
-
ref={ref}
|
|
105
|
-
/>
|
|
106
|
-
</MantineProvider>
|
|
84
|
+
<BlockNoteViewRaw
|
|
85
|
+
data-mantine-color-scheme={finalTheme}
|
|
86
|
+
className={mergeCSSClasses("bn-mantine", className || "")}
|
|
87
|
+
theme={typeof theme === "object" ? undefined : theme}
|
|
88
|
+
{...rest}
|
|
89
|
+
ref={ref}
|
|
90
|
+
/>
|
|
107
91
|
</ComponentsContext.Provider>
|
|
108
92
|
);
|
|
93
|
+
|
|
94
|
+
if (mantineContext) {
|
|
95
|
+
return view;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return (
|
|
99
|
+
<MantineProvider
|
|
100
|
+
// By default, Mantine adds its CSS variables to the root. This disables
|
|
101
|
+
// that, as we instead set the variables on `.bn-mantine` in
|
|
102
|
+
// `mantineStyles.css`.
|
|
103
|
+
withCssVariables={false}
|
|
104
|
+
// This gets the element to set `data-mantine-color-scheme` on. This
|
|
105
|
+
// element needs to already be rendered, so we can't set it to the
|
|
106
|
+
// editor container element. Instead, we set it to `undefined` and set it
|
|
107
|
+
// manually in `BlockNoteViewRaw`.
|
|
108
|
+
getRootElement={() => undefined}
|
|
109
|
+
>
|
|
110
|
+
{view}
|
|
111
|
+
</MantineProvider>
|
|
112
|
+
);
|
|
109
113
|
};
|