@blocklet/editor 2.3.12 → 2.3.15
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/lib/main/index.css
CHANGED
|
@@ -845,7 +845,6 @@ button.action-button:disabled {
|
|
|
845
845
|
.toolbar {
|
|
846
846
|
display: flex;
|
|
847
847
|
margin-bottom: 1px;
|
|
848
|
-
background: #fff;
|
|
849
848
|
padding: 4px;
|
|
850
849
|
border-top-left-radius: 4px;
|
|
851
850
|
border-top-right-radius: 4px;
|
|
@@ -864,7 +863,6 @@ button.action-button:disabled {
|
|
|
864
863
|
vertical-align: middle;
|
|
865
864
|
flex-shrink: 0;
|
|
866
865
|
align-items: center;
|
|
867
|
-
color: #4b5563;
|
|
868
866
|
}
|
|
869
867
|
|
|
870
868
|
.toolbar button.toolbar-item:disabled {
|
|
@@ -892,18 +890,10 @@ button.action-button:disabled {
|
|
|
892
890
|
opacity: 0.2;
|
|
893
891
|
}
|
|
894
892
|
|
|
895
|
-
.toolbar button.toolbar-item.active {
|
|
896
|
-
background-color: rgba(223, 232, 250, 0.3);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
893
|
.toolbar button.toolbar-item.active i {
|
|
900
894
|
opacity: 1;
|
|
901
895
|
}
|
|
902
896
|
|
|
903
|
-
.toolbar .toolbar-item:hover:not([disabled]) {
|
|
904
|
-
background-color: #eee;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
897
|
.toolbar .toolbar-item.font-family .text {
|
|
908
898
|
display: block;
|
|
909
899
|
max-width: 40px;
|
|
@@ -9,6 +9,7 @@ import { $setBlocksType } from '@lexical/selection';
|
|
|
9
9
|
import { $findMatchingParent, $getNearestNodeOfType, mergeRegister } from '@lexical/utils';
|
|
10
10
|
import { $createParagraphNode, $getNodeByKey, $getSelection, $isRangeSelection, $isRootOrShadowRoot, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, FORMAT_TEXT_COMMAND, SELECTION_CHANGE_COMMAND, } from 'lexical';
|
|
11
11
|
import { useCallback, useEffect, useState } from 'react';
|
|
12
|
+
import { Box } from '@mui/material';
|
|
12
13
|
import { IS_APPLE } from '../../../shared/environment';
|
|
13
14
|
import useHasNodes from '../../hooks/useHasNodes';
|
|
14
15
|
import useModal from '../../hooks/useModal';
|
|
@@ -340,14 +341,24 @@ export default function ToolbarPlugin() {
|
|
|
340
341
|
if (menus.length === 0) {
|
|
341
342
|
return null;
|
|
342
343
|
}
|
|
343
|
-
return (_jsxs(
|
|
344
|
+
return (_jsxs(Box, { className: "toolbar", sx: {
|
|
345
|
+
position: 'sticky',
|
|
346
|
+
top: 0,
|
|
347
|
+
zIndex: 10,
|
|
348
|
+
height: 'auto',
|
|
349
|
+
bgcolor: 'background.paper',
|
|
350
|
+
'& button.toolbar-item, & button.toolbar-item .text': {
|
|
351
|
+
color: 'text.primary',
|
|
352
|
+
},
|
|
353
|
+
'& button.toolbar-item.active': {
|
|
354
|
+
backgroundColor: 'action.selected',
|
|
355
|
+
},
|
|
356
|
+
'& .toolbar-item:hover:not([disabled])': {
|
|
357
|
+
backgroundColor: 'action.hover',
|
|
358
|
+
},
|
|
359
|
+
}, children: [menus, modal] }));
|
|
344
360
|
}
|
|
345
|
-
const Toolbar = styled.div
|
|
346
|
-
z-index: 10;
|
|
347
|
-
position: sticky;
|
|
348
|
-
top: 0;
|
|
349
|
-
height: auto;
|
|
350
|
-
`;
|
|
361
|
+
const Toolbar = styled.div ``;
|
|
351
362
|
const FormatButton = styled.button `
|
|
352
363
|
display: flex;
|
|
353
364
|
align-items: center;
|
|
@@ -10,6 +10,7 @@ import { $getSelectionStyleValueForProperty, $isParentElementRTL, $patchStyleTex
|
|
|
10
10
|
import { $findMatchingParent, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, mergeRegister, } from '@lexical/utils';
|
|
11
11
|
import { $createParagraphNode, $getNodeByKey, $getSelection, $isRangeSelection, $isRootOrShadowRoot, $isTextNode, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, SELECTION_CHANGE_COMMAND, } from 'lexical';
|
|
12
12
|
import { useCallback, useEffect, useState } from 'react';
|
|
13
|
+
import { Box } from '@mui/material';
|
|
13
14
|
import { useEditorConfig } from '../../../config';
|
|
14
15
|
import { IS_APPLE } from '../../../shared/environment';
|
|
15
16
|
import useHasNodes from '../../hooks/useHasNodes';
|
|
@@ -438,14 +439,23 @@ export default function ToolbarPlugin() {
|
|
|
438
439
|
if (menus.length === 0) {
|
|
439
440
|
return null;
|
|
440
441
|
}
|
|
441
|
-
return (_jsxs(
|
|
442
|
+
return (_jsxs(Box, { className: "toolbar", sx: {
|
|
443
|
+
position: 'sticky',
|
|
444
|
+
top: 0,
|
|
445
|
+
zIndex: 10,
|
|
446
|
+
height: 'auto',
|
|
447
|
+
bgcolor: 'background.paper',
|
|
448
|
+
'& button.toolbar-item, & button.toolbar-item .text': {
|
|
449
|
+
color: 'text.primary',
|
|
450
|
+
},
|
|
451
|
+
'& button.toolbar-item.active': {
|
|
452
|
+
backgroundColor: 'action.selected',
|
|
453
|
+
},
|
|
454
|
+
'& .toolbar-item:hover:not([disabled])': {
|
|
455
|
+
backgroundColor: 'action.hover',
|
|
456
|
+
},
|
|
457
|
+
}, children: [menus, modal] }));
|
|
442
458
|
}
|
|
443
|
-
const Toolbar = styled.div `
|
|
444
|
-
z-index: 10;
|
|
445
|
-
position: sticky;
|
|
446
|
-
top: 0;
|
|
447
|
-
height: auto;
|
|
448
|
-
`;
|
|
449
459
|
const FormatButton = styled.button `
|
|
450
460
|
display: flex;
|
|
451
461
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/editor",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.15",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"ufo": "^1.5.4",
|
|
69
69
|
"url-join": "^4.0.1",
|
|
70
70
|
"zustand": "^4.5.5",
|
|
71
|
-
"@blocklet/pdf": "^2.3.
|
|
71
|
+
"@blocklet/pdf": "^2.3.15"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@babel/core": "^7.25.2",
|