@blocknote/mantine 0.14.0 → 0.14.2
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 +766 -743
- 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/index.tsx +9 -3
- package/src/mantineStyles.css +11 -11
- package/src/style.css +48 -47
- 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":1719257230545,"assets":[{"name":"blocknote-mantine.umd.cjs","size":30426},{"name":"blocknote-mantine.umd.cjs.map","size":354224}],"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":2547,"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.2",
|
|
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.2",
|
|
55
|
+
"@blocknote/react": "^0.14.2",
|
|
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": "edfb6e84dbcefc26feb5045bd9a6351b05aefdd8"
|
|
91
91
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
BlockSchema,
|
|
3
|
+
InlineContentSchema,
|
|
4
|
+
mergeCSSClasses,
|
|
5
|
+
StyleSchema,
|
|
6
|
+
} from "@blocknote/core";
|
|
2
7
|
import {
|
|
3
8
|
BlockNoteViewRaw,
|
|
4
9
|
Components,
|
|
@@ -122,7 +127,7 @@ export const BlockNoteView = <
|
|
|
122
127
|
};
|
|
123
128
|
}
|
|
124
129
|
) => {
|
|
125
|
-
const { theme, ...rest } = props;
|
|
130
|
+
const { className, theme, ...rest } = props;
|
|
126
131
|
|
|
127
132
|
const existingContext = useBlockNoteContext();
|
|
128
133
|
const systemColorScheme = usePrefersColorScheme();
|
|
@@ -160,12 +165,13 @@ export const BlockNoteView = <
|
|
|
160
165
|
{/* as proposed here: https://github.com/orgs/mantinedev/discussions/5685 */}
|
|
161
166
|
<MantineProvider
|
|
162
167
|
theme={mantineTheme}
|
|
163
|
-
cssVariablesSelector=".bn-
|
|
168
|
+
cssVariablesSelector=".bn-mantine"
|
|
164
169
|
// This gets the element to set `data-mantine-color-scheme` on. Since we
|
|
165
170
|
// don't need this attribute (we use our own theming API), we return
|
|
166
171
|
// undefined here.
|
|
167
172
|
getRootElement={() => undefined}>
|
|
168
173
|
<BlockNoteViewRaw
|
|
174
|
+
className={mergeCSSClasses("bn-mantine", className || "")}
|
|
169
175
|
theme={typeof theme === "object" ? undefined : theme}
|
|
170
176
|
{...rest}
|
|
171
177
|
ref={ref}
|
package/src/mantineStyles.css
CHANGED
|
@@ -89,50 +89,50 @@
|
|
|
89
89
|
(src: https://github.com/mantinedev/mantine/blob/master/packages/%40mantine/core/src/core/MantineProvider/global.css)
|
|
90
90
|
but with styles set on `body` and `html` instead set on `bn-container`, as
|
|
91
91
|
well as other minor changes. */
|
|
92
|
-
.bn-
|
|
92
|
+
.bn-mantine *, .bn-mantine :after, .bn-mantine :before {
|
|
93
93
|
box-sizing: border-box
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
.bn-
|
|
97
|
-
.bn-
|
|
96
|
+
.bn-mantine button,
|
|
97
|
+
.bn-mantine select {
|
|
98
98
|
text-transform: none
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
@media screen and (max-device-width: 500px) {
|
|
102
|
-
.bn-
|
|
102
|
+
.bn-mantine {
|
|
103
103
|
-webkit-text-size-adjust: 100%
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
@media (prefers-reduced-motion: reduce) {
|
|
108
|
-
.bn-
|
|
108
|
+
.bn-mantine [data-respect-reduced-motion] [data-reduce-motion] {
|
|
109
109
|
animation: none;
|
|
110
110
|
transition: none
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
.bn-
|
|
114
|
+
.bn-mantine [data-mantine-color-scheme=dark] .mantine-dark-hidden, .bn-mantine [data-mantine-color-scheme=light] .mantine-light-hidden {
|
|
115
115
|
display: none
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
.bn-
|
|
118
|
+
.bn-mantine .mantine-focus-auto:focus-visible {
|
|
119
119
|
outline: calc(.125rem * var(--mantine-scale)) solid var(--mantine-primary-color-filled);
|
|
120
120
|
outline-offset: calc(.125rem * var(--mantine-scale))
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.bn-
|
|
123
|
+
.bn-mantine .mantine-focus-always:focus {
|
|
124
124
|
outline: calc(.125rem * var(--mantine-scale)) solid var(--mantine-primary-color-filled);
|
|
125
125
|
outline-offset: calc(.125rem * var(--mantine-scale))
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
.bn-
|
|
128
|
+
.bn-mantine .mantine-focus-never:focus {
|
|
129
129
|
outline: none
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
.bn-
|
|
132
|
+
.bn-mantine .mantine-active:active {
|
|
133
133
|
transform: translateY(calc(.0625rem * var(--mantine-scale)))
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.bn-
|
|
136
|
+
.bn-mantine[dir=rtl] .mantine-rotate-rtl {
|
|
137
137
|
transform: rotate(180deg)
|
|
138
138
|
}
|
package/src/style.css
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
/* Mantine base styles*/
|
|
5
5
|
|
|
6
6
|
/* Mantine Badge component base styles */
|
|
7
|
-
.
|
|
7
|
+
.mantine-Badge-root {
|
|
8
8
|
background-color: var(--bn-colors-tooltip-background);
|
|
9
9
|
color: var(--bn-colors-tooltip-text);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/* Mantine FileInput component base styles */
|
|
13
|
-
.
|
|
13
|
+
.mantine-FileInput-input {
|
|
14
14
|
align-items: center;
|
|
15
15
|
background-color: var(--bn-colors-menu-background);
|
|
16
16
|
border: none;
|
|
@@ -21,22 +21,22 @@
|
|
|
21
21
|
justify-content: center;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.
|
|
24
|
+
.mantine-FileInput-input:hover {
|
|
25
25
|
background-color: var(--bn-colors-hovered-background);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.
|
|
28
|
+
.mantine-FileInput-wrapper {
|
|
29
29
|
border: solid var(--bn-colors-border) 1px;
|
|
30
30
|
border-radius: 4px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.
|
|
33
|
+
.mantine-InputPlaceholder-placeholder {
|
|
34
34
|
color: var(--bn-colors-menu-text);
|
|
35
35
|
font-weight: 600;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/* Mantine Menu component base styles */
|
|
39
|
-
.
|
|
39
|
+
.mantine-Menu-dropdown {
|
|
40
40
|
background-color: var(--bn-colors-menu-background);
|
|
41
41
|
border: var(--bn-border);
|
|
42
42
|
border-radius: var(--bn-border-radius-medium);
|
|
@@ -47,27 +47,27 @@
|
|
|
47
47
|
overflow: auto;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.
|
|
50
|
+
.mantine-Menu-label {
|
|
51
51
|
background-color: var(--bn-colors-menu-background);
|
|
52
52
|
color: var(--bn-colors-menu-text);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.
|
|
55
|
+
.mantine-Menu-item {
|
|
56
56
|
background-color: var(--bn-colors-menu-background);
|
|
57
57
|
border: none;
|
|
58
58
|
border-radius: var(--bn-border-radius-small);
|
|
59
59
|
color: var(--bn-colors-menu-text);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
.
|
|
63
|
-
.
|
|
62
|
+
.mantine-Menu-item[aria-selected="true"],
|
|
63
|
+
.mantine-Menu-item:hover {
|
|
64
64
|
background-color: var(--bn-colors-hovered-background);
|
|
65
65
|
border: none;
|
|
66
66
|
color: var(--bn-colors-hovered-text);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/* Mantine Popover component base styles */
|
|
70
|
-
.
|
|
70
|
+
.mantine-Popover-dropdown {
|
|
71
71
|
background-color: transparent;
|
|
72
72
|
border: none;
|
|
73
73
|
border-radius: 0;
|
|
@@ -76,38 +76,38 @@
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
/* Mantine Tabs component base styles */
|
|
79
|
-
.
|
|
79
|
+
.mantine-Tabs-root {
|
|
80
80
|
width: 100%;
|
|
81
81
|
background-color: var(--bn-colors-menu-background);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
.
|
|
84
|
+
.mantine-Tabs-list:before {
|
|
85
85
|
border-color: var(--bn-colors-hovered-background);
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
.
|
|
88
|
+
.mantine-Tabs-tab {
|
|
89
89
|
color: var(--bn-colors-menu-text);
|
|
90
90
|
border-color: var(--bn-colors-hovered-background);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
.
|
|
93
|
+
.mantine-Tabs-tab:hover {
|
|
94
94
|
background-color: var(--bn-colors-hovered-background);
|
|
95
95
|
border-color: var(--bn-colors-hovered-background);
|
|
96
96
|
color: var(--bn-colors-hovered-text);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
.
|
|
100
|
-
.
|
|
99
|
+
.mantine-Tabs-tab[data-active],
|
|
100
|
+
.mantine-Tabs-tab[data-active]:hover {
|
|
101
101
|
border-color: var(--bn-colors-menu-text);
|
|
102
102
|
color: var(--bn-colors-menu-text);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
.
|
|
105
|
+
.mantine-Tabs-panel {
|
|
106
106
|
padding: 8px;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/* Mantine TextInput component base styles */
|
|
110
|
-
.
|
|
110
|
+
.mantine-TextInput-input {
|
|
111
111
|
background-color: var(--bn-colors-menu-background);
|
|
112
112
|
border: solid var(--bn-colors-border) 1px;
|
|
113
113
|
border-radius: 4px;
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/* Mantine Tooltip component base styles */
|
|
119
|
-
.
|
|
119
|
+
.mantine-Tooltip-tooltip {
|
|
120
120
|
background-color: transparent;
|
|
121
121
|
border: none;
|
|
122
122
|
border-radius: 0;
|
|
@@ -127,12 +127,12 @@
|
|
|
127
127
|
/* UI element styling */
|
|
128
128
|
|
|
129
129
|
/* Select styling */
|
|
130
|
-
.bn-select {
|
|
130
|
+
.bn-mantine .bn-select {
|
|
131
131
|
overflow: auto;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/* Toolbar styling */
|
|
135
|
-
.bn-toolbar {
|
|
135
|
+
.bn-mantine .bn-toolbar {
|
|
136
136
|
background-color: var(--bn-colors-menu-background);
|
|
137
137
|
border: var(--bn-border);
|
|
138
138
|
border-radius: var(--bn-border-radius-medium);
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
width: fit-content;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
.bn-toolbar:empty {
|
|
146
|
+
.bn-mantine .bn-toolbar:empty {
|
|
147
147
|
display: none;
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
background-color: var(--bn-colors-hovered-background);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
.bn-
|
|
188
|
+
.bn-mantine .bn-form-popover {
|
|
189
189
|
background-color: var(--bn-colors-menu-background);
|
|
190
190
|
border: var(--bn-border);
|
|
191
191
|
border-radius: var(--bn-border-radius-medium);
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
/* Unfortunately necessary, as we can't use a Menu.Dropdown component on its
|
|
236
236
|
own. */
|
|
237
237
|
/* https://github.com/mantinedev/mantine/blob/e3e3bb834de1f2f75a27dbc757dc0a2fc6a6cba8/packages/%40mantine/core/src/components/Menu/Menu.module.css */
|
|
238
|
-
.bn-suggestion-menu {
|
|
238
|
+
.bn-mantine .bn-suggestion-menu {
|
|
239
239
|
max-height: 100%;
|
|
240
240
|
position: relative;
|
|
241
241
|
box-shadow: var(--mantine-shadow-md);
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
padding: 4px;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
.bn-suggestion-menu-label {
|
|
248
|
+
.bn-mantine .bn-suggestion-menu-label {
|
|
249
249
|
color: var(--mantine-color-dimmed);
|
|
250
250
|
font-weight: 500;
|
|
251
251
|
font-size: var(--mantine-font-size-xs);
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
cursor: default;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
.bn-suggestion-menu-item {
|
|
256
|
+
.bn-mantine .bn-suggestion-menu-item {
|
|
257
257
|
font-size: var(--mantine-font-size-sm);
|
|
258
258
|
width: 100%;
|
|
259
259
|
padding: calc(var(--mantine-spacing-xs) / 1.5) var(--mantine-spacing-sm);
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
.bn-suggestion-menu {
|
|
292
|
+
.bn-mantine .bn-suggestion-menu {
|
|
293
293
|
background-color: var(--bn-colors-menu-background);
|
|
294
294
|
border: var(--bn-border);
|
|
295
295
|
border-radius: var(--bn-border-radius-medium);
|
|
@@ -300,13 +300,13 @@
|
|
|
300
300
|
padding: 2px;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
.bn-suggestion-menu-item {
|
|
303
|
+
.bn-mantine .bn-suggestion-menu-item {
|
|
304
304
|
cursor: pointer;
|
|
305
305
|
height: 52px;
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
.bn-suggestion-menu-item[aria-selected="true"],
|
|
309
|
-
.bn-suggestion-menu-item:hover {
|
|
308
|
+
.bn-mantine .bn-suggestion-menu-item[aria-selected="true"],
|
|
309
|
+
.bn-mantine .bn-suggestion-menu-item:hover {
|
|
310
310
|
background-color: var(--bn-colors-hovered-background);
|
|
311
311
|
}
|
|
312
312
|
|
|
@@ -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,27 +339,28 @@
|
|
|
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;
|
|
345
346
|
padding: 0;
|
|
346
347
|
}
|
|
347
348
|
|
|
348
|
-
.bn-suggestion-menu-label {
|
|
349
|
+
.bn-mantine .bn-suggestion-menu-label {
|
|
349
350
|
color: var(--bn-colors-hovered-text);
|
|
350
351
|
}
|
|
351
352
|
|
|
352
|
-
.bn-suggestion-menu-loader {
|
|
353
|
+
.bn-mantine .bn-suggestion-menu-loader {
|
|
353
354
|
height: 20px;
|
|
354
355
|
width: 100%;
|
|
355
356
|
}
|
|
356
357
|
|
|
357
|
-
.bn-suggestion-menu-loader span {
|
|
358
|
+
.bn-mantine .bn-suggestion-menu-loader span {
|
|
358
359
|
background-color: var(--bn-colors-side-menu);
|
|
359
360
|
}
|
|
360
361
|
|
|
361
362
|
/* Side Menu styling */
|
|
362
|
-
.bn-side-menu {
|
|
363
|
+
.bn-mantine .bn-side-menu {
|
|
363
364
|
background-color: transparent;
|
|
364
365
|
overflow: visible;
|
|
365
366
|
}
|
|
@@ -385,7 +386,7 @@
|
|
|
385
386
|
width: 22px;
|
|
386
387
|
}
|
|
387
388
|
|
|
388
|
-
.bn-side-menu > [draggable="true"] {
|
|
389
|
+
.bn-mantine .bn-side-menu > [draggable="true"] {
|
|
389
390
|
display: flex;
|
|
390
391
|
}
|
|
391
392
|
|
|
@@ -396,7 +397,7 @@
|
|
|
396
397
|
}
|
|
397
398
|
|
|
398
399
|
/* Image Panel styling*/
|
|
399
|
-
.bn-panel {
|
|
400
|
+
.bn-mantine .bn-panel {
|
|
400
401
|
background-color: var(--bn-colors-menu-background);
|
|
401
402
|
border: var(--bn-border);
|
|
402
403
|
border-radius: var(--bn-border-radius-medium);
|
|
@@ -405,7 +406,7 @@
|
|
|
405
406
|
width: 500px;
|
|
406
407
|
}
|
|
407
408
|
|
|
408
|
-
.bn-panel .bn-tab-panel {
|
|
409
|
+
.bn-mantine .bn-panel .bn-tab-panel {
|
|
409
410
|
align-items: center;
|
|
410
411
|
display: flex;
|
|
411
412
|
flex-direction: column;
|
|
@@ -431,12 +432,12 @@
|
|
|
431
432
|
background-color: var(--bn-colors-hovered-background);
|
|
432
433
|
}
|
|
433
434
|
|
|
434
|
-
.bn-panel.mantine-Text-root {
|
|
435
|
+
.bn-panel .mantine-Text-root {
|
|
435
436
|
text-align: center;
|
|
436
437
|
}
|
|
437
438
|
|
|
438
439
|
/* Table Handle styling */
|
|
439
|
-
.bn-table-handle {
|
|
440
|
+
.bn-mantine .bn-table-handle {
|
|
440
441
|
align-items: center;
|
|
441
442
|
background-color: var(--bn-colors-menu-background);
|
|
442
443
|
border: var(--bn-border);
|
|
@@ -451,22 +452,22 @@
|
|
|
451
452
|
padding: 0;
|
|
452
453
|
}
|
|
453
454
|
|
|
454
|
-
.bn-table-handle svg {
|
|
455
|
+
.bn-mantine .bn-table-handle svg {
|
|
455
456
|
margin-inline: -4px;
|
|
456
457
|
}
|
|
457
458
|
|
|
458
|
-
.bn-table-handle:hover,
|
|
459
|
-
.bn-table-handle-dragging {
|
|
459
|
+
.bn-mantine .bn-table-handle:hover,
|
|
460
|
+
.bn-mantine .bn-table-handle-dragging {
|
|
460
461
|
background-color: var(--bn-colors-hovered-background);
|
|
461
462
|
}
|
|
462
463
|
|
|
463
464
|
/* Drag Handle & Table Handle Menu styling */
|
|
464
|
-
.bn-
|
|
465
|
+
.bn-mantine .bn-drag-handle-menu {
|
|
465
466
|
overflow: visible;
|
|
466
467
|
}
|
|
467
468
|
|
|
468
469
|
/* Tooltip styling */
|
|
469
|
-
.bn-tooltip {
|
|
470
|
+
.bn-mantine .bn-tooltip {
|
|
470
471
|
background-color: var(--bn-colors-tooltip-background);
|
|
471
472
|
border: var(--bn-border);
|
|
472
473
|
border-radius: var(--bn-border-radius-medium);
|
|
@@ -477,7 +478,7 @@
|
|
|
477
478
|
}
|
|
478
479
|
|
|
479
480
|
/* Additional menu styles */
|
|
480
|
-
.bn-tick-space {
|
|
481
|
+
.bn-mantine .bn-tick-space {
|
|
481
482
|
padding: 0;
|
|
482
483
|
width: 20px;
|
|
483
484
|
}
|
|
@@ -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}
|