@blocklet/editor 2.5.36 → 2.5.38
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.
|
@@ -11,6 +11,7 @@ export declare class TranslationNode extends ElementNode {
|
|
|
11
11
|
constructor(data: TranslationNodeProps, key?: NodeKey);
|
|
12
12
|
static getType(): string;
|
|
13
13
|
static clone(node: TranslationNode): TranslationNode;
|
|
14
|
+
static importJSON(serializedNode: SerializedTranslationNode): TranslationNode;
|
|
14
15
|
createDOM(config: EditorConfig, editor: LexicalEditor): HTMLElement;
|
|
15
16
|
updateDOM(prevNode: this, dom: HTMLElement, config: EditorConfig): boolean;
|
|
16
17
|
}
|
|
@@ -12,6 +12,9 @@ export class TranslationNode extends ElementNode {
|
|
|
12
12
|
static clone(node) {
|
|
13
13
|
return new TranslationNode(node.__data, node.__key);
|
|
14
14
|
}
|
|
15
|
+
static importJSON(serializedNode) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
15
18
|
createDOM(config, editor) {
|
|
16
19
|
const dom = document.createElement('div');
|
|
17
20
|
dom.classList.add(NODE_TYPE, `${NODE_TYPE}-${this.__data.displayMode}`);
|
|
@@ -6,7 +6,7 @@ import { $isListNode, INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, IN
|
|
|
6
6
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
7
7
|
import { $isDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode';
|
|
8
8
|
import { $createHeadingNode, $createQuoteNode, $isHeadingNode } from '@lexical/rich-text';
|
|
9
|
-
import { $getSelectionStyleValueForProperty, $
|
|
9
|
+
import { $getSelectionStyleValueForProperty, $patchStyleText, $selectAll, $setBlocksType, } from '@lexical/selection';
|
|
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';
|
|
@@ -156,7 +156,6 @@ export default function ToolbarPlugin() {
|
|
|
156
156
|
const [canUndo, setCanUndo] = useState(false);
|
|
157
157
|
const [canRedo, setCanRedo] = useState(false);
|
|
158
158
|
const [modal, showModal] = useModal();
|
|
159
|
-
const [isRTL, setIsRTL] = useState(false);
|
|
160
159
|
const [codeLanguage, setCodeLanguage] = useState('');
|
|
161
160
|
const [isEditable, setIsEditable] = useState(() => editor.isEditable());
|
|
162
161
|
const hasNodes = useHasNodes();
|
|
@@ -183,7 +182,6 @@ export default function ToolbarPlugin() {
|
|
|
183
182
|
setIsSubscript(selection.hasFormat('subscript'));
|
|
184
183
|
setIsSuperscript(selection.hasFormat('superscript'));
|
|
185
184
|
setIsCode(selection.hasFormat('code'));
|
|
186
|
-
setIsRTL($isParentElementRTL(selection));
|
|
187
185
|
// Update links
|
|
188
186
|
const node = getSelectedNode(selection);
|
|
189
187
|
const parent = node.getParent();
|
|
@@ -419,9 +417,9 @@ export default function ToolbarPlugin() {
|
|
|
419
417
|
activeEditor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify');
|
|
420
418
|
}, className: "item", children: [_jsx("i", { className: "iconify", "data-icon": icons.justify }), _jsx("span", { className: "text", children: "Justify Align" })] }), _jsx(Divider, {}), _jsxs(DropDownItem, { onClick: () => {
|
|
421
419
|
activeEditor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
|
|
422
|
-
}, className: "item", children: [_jsx("i", { className: "iconify", "data-icon":
|
|
420
|
+
}, className: "item", children: [_jsx("i", { className: "iconify", "data-icon": icons.outdent }), _jsx("span", { className: "text", children: "Outdent" })] }), _jsxs(DropDownItem, { onClick: () => {
|
|
423
421
|
activeEditor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
|
|
424
|
-
}, className: "item", children: [_jsx("i", { className: "iconify", "data-icon":
|
|
422
|
+
}, className: "item", children: [_jsx("i", { className: "iconify", "data-icon": icons.indent }), _jsx("span", { className: "text", children: "Indent" })] })] }, item));
|
|
425
423
|
break;
|
|
426
424
|
}
|
|
427
425
|
case 'media': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/editor",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.38",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,29 +34,29 @@
|
|
|
34
34
|
"@iconify/iconify": "^3.1.1",
|
|
35
35
|
"@iconify/icons-tabler": "^1.2.95",
|
|
36
36
|
"@iconify/react": "^4.1.1",
|
|
37
|
-
"@lexical/clipboard": "^0.
|
|
38
|
-
"@lexical/code": "^0.
|
|
39
|
-
"@lexical/file": "^0.
|
|
40
|
-
"@lexical/hashtag": "^0.
|
|
41
|
-
"@lexical/headless": "^0.
|
|
42
|
-
"@lexical/html": "^0.
|
|
43
|
-
"@lexical/link": "^0.
|
|
44
|
-
"@lexical/list": "^0.
|
|
45
|
-
"@lexical/mark": "^0.
|
|
46
|
-
"@lexical/markdown": "^0.
|
|
47
|
-
"@lexical/overflow": "^0.
|
|
48
|
-
"@lexical/react": "^0.
|
|
49
|
-
"@lexical/rich-text": "^0.
|
|
50
|
-
"@lexical/selection": "^0.
|
|
51
|
-
"@lexical/table": "^0.
|
|
52
|
-
"@lexical/utils": "^0.
|
|
53
|
-
"@lexical/yjs": "^0.
|
|
37
|
+
"@lexical/clipboard": "^0.38.2",
|
|
38
|
+
"@lexical/code": "^0.38.2",
|
|
39
|
+
"@lexical/file": "^0.38.2",
|
|
40
|
+
"@lexical/hashtag": "^0.38.2",
|
|
41
|
+
"@lexical/headless": "^0.38.2",
|
|
42
|
+
"@lexical/html": "^0.38.2",
|
|
43
|
+
"@lexical/link": "^0.38.2",
|
|
44
|
+
"@lexical/list": "^0.38.2",
|
|
45
|
+
"@lexical/mark": "^0.38.2",
|
|
46
|
+
"@lexical/markdown": "^0.38.2",
|
|
47
|
+
"@lexical/overflow": "^0.38.2",
|
|
48
|
+
"@lexical/react": "^0.38.2",
|
|
49
|
+
"@lexical/rich-text": "^0.38.2",
|
|
50
|
+
"@lexical/selection": "^0.38.2",
|
|
51
|
+
"@lexical/table": "^0.38.2",
|
|
52
|
+
"@lexical/utils": "^0.38.2",
|
|
53
|
+
"@lexical/yjs": "^0.38.2",
|
|
54
54
|
"@microsoft/fetch-event-source": "^2.0.1",
|
|
55
55
|
"@popperjs/core": "^2.11.8",
|
|
56
56
|
"ahooks": "^3.8.1",
|
|
57
57
|
"joi": "^17.13.3",
|
|
58
58
|
"leven": "^4.0.0",
|
|
59
|
-
"lexical": "^0.
|
|
59
|
+
"lexical": "^0.38.2",
|
|
60
60
|
"lodash": "^4.17.21",
|
|
61
61
|
"marked": "^15.0.8",
|
|
62
62
|
"markerjs-live": "^1.2.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"ufo": "^1.5.4",
|
|
74
74
|
"url-join": "^4.0.1",
|
|
75
75
|
"zustand": "^4.5.5",
|
|
76
|
-
"@blocklet/pdf": "2.5.
|
|
76
|
+
"@blocklet/pdf": "2.5.38"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"@babel/core": "^7.25.2",
|