@lobehub/editor 1.0.0 → 1.0.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/es/editor-kernel/utils.js +1 -0
- package/es/plugins/common/data-source/json-data-source.d.ts +1 -2
- package/es/plugins/common/data-source/json-data-source.js +0 -4
- package/es/plugins/common/node/ElementDOMSlot.js +1 -0
- package/es/plugins/hr/react/style.js +1 -1
- package/es/plugins/table/react/style.js +1 -1
- package/package.json +2 -4
- package/patches/lexical+0.33.1.patch +0 -88
- package/scripts/patch-lexical-package-json.js +0 -20
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
2
|
import { DataSource } from "../../../editor-kernel";
|
|
3
|
-
export declare function createEmptyEditorState(): EditorState;
|
|
4
3
|
export default class JSONDataSource extends DataSource {
|
|
5
4
|
read(editor: LexicalEditor, data: any): void;
|
|
6
5
|
write(editor: LexicalEditor): any;
|
|
@@ -11,11 +11,7 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
11
11
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
-
import { EditorState, RootNode } from 'lexical';
|
|
15
14
|
import { DataSource } from "../../../editor-kernel";
|
|
16
|
-
export function createEmptyEditorState() {
|
|
17
|
-
return new EditorState(new Map([['root', new RootNode()]]));
|
|
18
|
-
}
|
|
19
15
|
var JSONDataSource = /*#__PURE__*/function (_DataSource) {
|
|
20
16
|
_inherits(JSONDataSource, _DataSource);
|
|
21
17
|
var _super = _createSuper(JSONDataSource);
|
|
@@ -14,6 +14,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
14
14
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
15
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
16
|
import { ElementDOMSlot } from 'lexical';
|
|
17
|
+
// @ts-ignore
|
|
17
18
|
export var MElementDOMSlot = /*#__PURE__*/function (_ElementDOMSlot) {
|
|
18
19
|
_inherits(MElementDOMSlot, _ElementDOMSlot);
|
|
19
20
|
var _super = _createSuper(MElementDOMSlot);
|
|
@@ -4,5 +4,5 @@ import { createStyles } from 'antd-style';
|
|
|
4
4
|
export var useStyles = createStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css,
|
|
6
6
|
token = _ref.token;
|
|
7
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n width: 100%;\n height: 4px;\n margin-block: calc(var(--lobe-markdown-margin-multiple) *
|
|
7
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n width: 100%;\n height: 4px;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n border-color: ", ";\n border-style: dashed;\n border-width: 1px;\n border-block-start: none;\n border-inline-start: none;\n border-inline-end: none;\n\n &.selected {\n border-color: ", ";\n }\n "])), token.colorBorder, token.yellow);
|
|
8
8
|
});
|
|
@@ -4,5 +4,5 @@ import { createStyles } from 'antd-style';
|
|
|
4
4
|
export var useStyles = createStyles(function (_ref) {
|
|
5
5
|
var css = _ref.css,
|
|
6
6
|
token = _ref.token;
|
|
7
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: auto;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em);\n\n .editor_table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n\n width: fit-content;\n\n text-align: start;\n text-indent: initial;\n text-wrap: pretty;\n word-break: auto-phrase;\n overflow-wrap: break-word;\n\n background: ", ";\n\n > tr:first-of-type {\n background: ", ";\n\n .editor_table_cell_header {\n font-weight: bold;\n }\n }\n }\n\n code {\n word-break: break-word;\n }\n\n .editor_table_cell_header {\n font-weight: normal;\n }\n\n .editor_table_cell {\n position: relative;\n\n overflow: auto;\n\n width: 75px;\n padding-block: 6px;\n padding-inline: 8px;\n border: 1px solid ", ";\n\n text-align: start;\n vertical-align: top;\n\n outline: none;\n }\n\n .editor_table_cell_selected {\n color: #000;\n background-color: ", ";\n caret-color: transparent;\n }\n "])), token.colorFillQuaternary, token.colorFillQuaternary, token.colorFillSecondary, token.yellow);
|
|
7
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: auto;\n margin-block: calc(var(--lobe-markdown-margin-multiple) * 0.5em)\n calc(var(--lobe-markdown-margin-multiple) * 0.5em + 16px);\n\n .editor_table {\n table-layout: fixed;\n border-spacing: 0;\n border-collapse: collapse;\n\n width: fit-content;\n\n text-align: start;\n text-indent: initial;\n text-wrap: pretty;\n word-break: auto-phrase;\n overflow-wrap: break-word;\n\n background: ", ";\n\n > tr:first-of-type {\n background: ", ";\n\n .editor_table_cell_header {\n font-weight: bold;\n }\n }\n }\n\n code {\n word-break: break-word;\n }\n\n .editor_table_cell_header {\n font-weight: normal;\n }\n\n .editor_table_cell {\n position: relative;\n\n overflow: auto;\n\n width: 75px;\n padding-block: 6px;\n padding-inline: 8px;\n border: 1px solid ", ";\n\n text-align: start;\n vertical-align: top;\n\n outline: none;\n }\n\n .editor_table_cell_selected {\n color: #000;\n background-color: ", ";\n caret-color: transparent;\n }\n "])), token.colorFillQuaternary, token.colorFillQuaternary, token.colorFillSecondary, token.yellow);
|
|
8
8
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -24,9 +24,7 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"es",
|
|
26
26
|
"react.d.ts",
|
|
27
|
-
"react.js"
|
|
28
|
-
"patches",
|
|
29
|
-
"scripts/patch-lexical-package-json.js"
|
|
27
|
+
"react.js"
|
|
30
28
|
],
|
|
31
29
|
"dependencies": {
|
|
32
30
|
"@floating-ui/dom": "^1.7.3",
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/lexical/Lexical.dev.js b/node_modules/lexical/Lexical.dev.js
|
|
2
|
-
index f129fe0..4a6af35 100644
|
|
3
|
-
--- a/node_modules/lexical/Lexical.dev.js
|
|
4
|
-
+++ b/node_modules/lexical/Lexical.dev.js
|
|
5
|
-
@@ -13865,3 +13865,5 @@ exports.removeFromParent = removeFromParent;
|
|
6
|
-
exports.resetRandomKey = resetRandomKey;
|
|
7
|
-
exports.setDOMUnmanaged = setDOMUnmanaged;
|
|
8
|
-
exports.setNodeIndentFromDOM = setNodeIndentFromDOM;
|
|
9
|
-
+exports.EditorState = EditorState;
|
|
10
|
-
+exports.ElementDOMSlot = ElementDOMSlot;
|
|
11
|
-
diff --git a/node_modules/lexical/Lexical.dev.mjs b/node_modules/lexical/Lexical.dev.mjs
|
|
12
|
-
index ab18d70..28cb4ab 100644
|
|
13
|
-
--- a/node_modules/lexical/Lexical.dev.mjs
|
|
14
|
-
+++ b/node_modules/lexical/Lexical.dev.mjs
|
|
15
|
-
@@ -6,6 +6,8 @@
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
+import { EditorStateReadOptions } from "./Lexical.dev";
|
|
20
|
-
+
|
|
21
|
-
/**
|
|
22
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
-
*
|
|
24
|
-
@@ -13665,4 +13667,4 @@ function $splitAtPointCaretNext(pointCaret, {
|
|
25
|
-
return parentCaret;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
-export { $addUpdateTag, $applyNodeReplacement, $caretFromPoint, $caretRangeFromSelection, $cloneWithProperties, $comparePointCaretNext, $copyNode, $create, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createRangeSelectionFromDom, $createTabNode, $createTextNode, $extendCaretToRange, $getAdjacentChildCaret, $getAdjacentNode, $getAdjacentSiblingOrParentSiblingCaret, $getCaretInDirection, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getChildCaretAtIndex, $getChildCaretOrSelf, $getCollapsedCaretRange, $getCommonAncestor, $getCommonAncestorResultBranchOrder, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getPreviousSelection, $getRoot, $getSelection, $getSiblingCaret, $getState, $getStateChange, $getTextContent, $getTextNodeOffset, $getTextPointCaret, $getTextPointCaretSlice, $getWritableNodeState, $hasAncestor, $hasUpdateTag, $insertNodes, $isBlockElementNode, $isChildCaret, $isDecoratorNode, $isElementNode, $isExtendableTextPointCaret, $isInlineElementOrDecoratorNode, $isLeafNode, $isLineBreakNode, $isNodeCaret, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isSiblingCaret, $isTabNode, $isTextNode, $isTextPointCaret, $isTextPointCaretSlice, $isTokenOrSegmented, $isTokenOrTab, $nodesOfType, $normalizeCaret, $normalizeSelection as $normalizeSelection__EXPERIMENTAL, $onUpdate, $parseSerializedNode, $removeTextFromCaretRange, $rewindSiblingCaret, $selectAll, $setCompositionKey, $setPointFromCaret, $setSelection, $setSelectionFromCaretRange, $setState, $splitAtPointCaretNext, $splitNode, $updateRangeSelectionFromCaretRange, ArtificialNode__DO_NOT_USE, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, CUT_COMMAND, DELETE_CHARACTER_COMMAND, DELETE_LINE_COMMAND, DELETE_WORD_COMMAND, DRAGEND_COMMAND, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, DecoratorNode, ElementNode, FOCUS_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_MERGE_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, INTERNAL_$isBlock, IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_MODIFIER_COMMAND, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, LineBreakNode, MOVE_TO_END, MOVE_TO_START, NODE_STATE_KEY, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, PASTE_TAG, ParagraphNode, REDO_COMMAND, REMOVE_TEXT_COMMAND, RootNode, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, SKIP_COLLAB_TAG, SKIP_DOM_SELECTION_TAG, SKIP_SCROLL_INTO_VIEW_TAG, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, buildImportMap, createCommand, createEditor, createSharedNodeState, createState, flipDirection, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, getRegisteredNode, getRegisteredNodeOrThrow, isBlockDomNode, isCurrentlyReadOnlyMode, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isDocumentFragment, isExactShortcutMatch, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isModifierMatch, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, makeStepwiseIterator, removeFromParent, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM };
|
|
29
|
-
+export { $addUpdateTag, $applyNodeReplacement, $caretFromPoint, $caretRangeFromSelection, $cloneWithProperties, $comparePointCaretNext, $copyNode, $create, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createRangeSelectionFromDom, $createTabNode, $createTextNode, $extendCaretToRange, $getAdjacentChildCaret, $getAdjacentNode, $getAdjacentSiblingOrParentSiblingCaret, $getCaretInDirection, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getChildCaretAtIndex, $getChildCaretOrSelf, $getCollapsedCaretRange, $getCommonAncestor, $getCommonAncestorResultBranchOrder, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getPreviousSelection, $getRoot, $getSelection, $getSiblingCaret, $getState, $getStateChange, $getTextContent, $getTextNodeOffset, $getTextPointCaret, $getTextPointCaretSlice, $getWritableNodeState, $hasAncestor, $hasUpdateTag, $insertNodes, $isBlockElementNode, $isChildCaret, $isDecoratorNode, $isElementNode, $isExtendableTextPointCaret, $isInlineElementOrDecoratorNode, $isLeafNode, $isLineBreakNode, $isNodeCaret, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isSiblingCaret, $isTabNode, $isTextNode, $isTextPointCaret, $isTextPointCaretSlice, $isTokenOrSegmented, $isTokenOrTab, $nodesOfType, $normalizeCaret, $normalizeSelection as $normalizeSelection__EXPERIMENTAL, $onUpdate, $parseSerializedNode, $removeTextFromCaretRange, $rewindSiblingCaret, $selectAll, $setCompositionKey, $setPointFromCaret, $setSelection, $setSelectionFromCaretRange, $setState, $splitAtPointCaretNext, $splitNode, $updateRangeSelectionFromCaretRange, ArtificialNode__DO_NOT_USE, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, CUT_COMMAND, DELETE_CHARACTER_COMMAND, DELETE_LINE_COMMAND, DELETE_WORD_COMMAND, DRAGEND_COMMAND, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, DecoratorNode, ElementNode, FOCUS_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_MERGE_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, INTERNAL_$isBlock, IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_MODIFIER_COMMAND, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, LineBreakNode, MOVE_TO_END, MOVE_TO_START, NODE_STATE_KEY, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, PASTE_TAG, ParagraphNode, REDO_COMMAND, REMOVE_TEXT_COMMAND, RootNode, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, SKIP_COLLAB_TAG, SKIP_DOM_SELECTION_TAG, SKIP_SCROLL_INTO_VIEW_TAG, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, buildImportMap, createCommand, createEditor, createSharedNodeState, createState, flipDirection, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, getRegisteredNode, getRegisteredNodeOrThrow, isBlockDomNode, isCurrentlyReadOnlyMode, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isDocumentFragment, isExactShortcutMatch, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isModifierMatch, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, makeStepwiseIterator, removeFromParent, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM, EditorState, ElementDOMSlot };
|
|
30
|
-
diff --git a/node_modules/lexical/Lexical.js b/node_modules/lexical/Lexical.js
|
|
31
|
-
index d2e1194..d4d1894 100644
|
|
32
|
-
--- a/node_modules/lexical/Lexical.js
|
|
33
|
-
+++ b/node_modules/lexical/Lexical.js
|
|
34
|
-
@@ -7,5 +7,5 @@
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
'use strict'
|
|
38
|
-
-const Lexical = process.env.NODE_ENV !== 'production' ? require('./Lexical.dev.js') : require('./Lexical.prod.js');
|
|
39
|
-
+const Lexical = require('./Lexical.dev.js');
|
|
40
|
-
module.exports = Lexical;
|
|
41
|
-
|
|
42
|
-
diff --git a/node_modules/lexical/Lexical.mjs b/node_modules/lexical/Lexical.mjs
|
|
43
|
-
index a6b0b72..4ef410d 100644
|
|
44
|
-
--- a/node_modules/lexical/Lexical.mjs
|
|
45
|
-
+++ b/node_modules/lexical/Lexical.mjs
|
|
46
|
-
@@ -7,8 +7,7 @@
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
import * as modDev from './Lexical.dev.mjs';
|
|
50
|
-
-import * as modProd from './Lexical.prod.mjs';
|
|
51
|
-
-const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
|
|
52
|
-
+const mod = modDev;
|
|
53
|
-
export const $addUpdateTag = mod.$addUpdateTag;
|
|
54
|
-
export const $applyNodeReplacement = mod.$applyNodeReplacement;
|
|
55
|
-
export const $caretFromPoint = mod.$caretFromPoint;
|
|
56
|
-
diff --git a/node_modules/lexical/Lexical.node.mjs b/node_modules/lexical/Lexical.node.mjs
|
|
57
|
-
index 15045bc..e1e9480 100644
|
|
58
|
-
--- a/node_modules/lexical/Lexical.node.mjs
|
|
59
|
-
+++ b/node_modules/lexical/Lexical.node.mjs
|
|
60
|
-
@@ -205,3 +205,5 @@ export const removeFromParent = mod.removeFromParent;
|
|
61
|
-
export const resetRandomKey = mod.resetRandomKey;
|
|
62
|
-
export const setDOMUnmanaged = mod.setDOMUnmanaged;
|
|
63
|
-
export const setNodeIndentFromDOM = mod.setNodeIndentFromDOM;
|
|
64
|
-
+export const EditorState = mod.EditorState;
|
|
65
|
-
+export const ElementDOMSlot = mod.ElementDOMSlot;
|
|
66
|
-
diff --git a/node_modules/lexical/index.d.ts b/node_modules/lexical/index.d.ts
|
|
67
|
-
index 4d1c06d..d480555 100644
|
|
68
|
-
--- a/node_modules/lexical/index.d.ts
|
|
69
|
-
+++ b/node_modules/lexical/index.d.ts
|
|
70
|
-
@@ -12,7 +12,7 @@ export { BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND,
|
|
71
|
-
export { IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, NODE_STATE_KEY, TEXT_TYPE_TO_FORMAT, } from './LexicalConstants';
|
|
72
|
-
export type { CommandListener, CommandListenerPriority, CommandPayloadType, CreateEditorArgs, EditableListener, EditorConfig, EditorSetOptions, EditorThemeClasses, EditorThemeClassName, EditorUpdateOptions, HTMLConfig, Klass, KlassConstructor, LexicalCommand, LexicalEditor, LexicalNodeConfig, LexicalNodeReplacement, MutationListener, NodeMutation, RootListener, SerializedEditor, Spread, Transform, UpdateListener, UpdateListenerPayload, } from './LexicalEditor';
|
|
73
|
-
export { COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, createEditor, } from './LexicalEditor';
|
|
74
|
-
-export type { EditorState, EditorStateReadOptions, SerializedEditorState, } from './LexicalEditorState';
|
|
75
|
-
+export { EditorState, EditorStateReadOptions, SerializedEditorState, } from './LexicalEditorState';
|
|
76
|
-
export type { EventHandler } from './LexicalEvents';
|
|
77
|
-
export type { BaseStaticNodeConfig, DOMChildConversion, DOMConversion, DOMConversionFn, DOMConversionMap, DOMConversionOutput, DOMExportOutput, DOMExportOutputMap, LexicalExportJSON, LexicalNode, LexicalUpdateJSON, NodeKey, NodeMap, SerializedLexicalNode, StaticNodeConfig, StaticNodeConfigRecord, StaticNodeConfigValue, } from './LexicalNode';
|
|
78
|
-
export { buildImportMap } from './LexicalNode';
|
|
79
|
-
@@ -24,7 +24,8 @@ export { $parseSerializedNode, isCurrentlyReadOnlyMode } from './LexicalUpdates'
|
|
80
|
-
export { $addUpdateTag, $applyNodeReplacement, $cloneWithProperties, $copyNode, $create, $getAdjacentNode, $getEditor, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getRoot, $hasAncestor, $hasUpdateTag, $isInlineElementOrDecoratorNode, $isLeafNode, $isRootOrShadowRoot, $isTokenOrSegmented, $isTokenOrTab, $nodesOfType, $onUpdate, $selectAll, $setCompositionKey, $setSelection, $splitNode, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, getRegisteredNode, getRegisteredNodeOrThrow, INTERNAL_$isBlock, isBlockDomNode, isDocumentFragment, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isExactShortcutMatch, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isModifierMatch, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, removeFromParent, resetRandomKey, setDOMUnmanaged, setNodeIndentFromDOM, } from './LexicalUtils';
|
|
81
|
-
export { ArtificialNode__DO_NOT_USE } from './nodes/ArtificialNode';
|
|
82
|
-
export { $isDecoratorNode, DecoratorNode } from './nodes/LexicalDecoratorNode';
|
|
83
|
-
-export type { ElementDOMSlot, ElementFormatType, SerializedElementNode, } from './nodes/LexicalElementNode';
|
|
84
|
-
+export type { ElementFormatType, SerializedElementNode, } from './nodes/LexicalElementNode';
|
|
85
|
-
+export { ElementDOMSlot } from './nodes/LexicalElementNode';
|
|
86
|
-
export { $isElementNode, ElementNode } from './nodes/LexicalElementNode';
|
|
87
|
-
export type { SerializedLineBreakNode } from './nodes/LexicalLineBreakNode';
|
|
88
|
-
export { $createLineBreakNode, $isLineBreakNode, LineBreakNode, } from './nodes/LexicalLineBreakNode';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const fs = require('node:fs');
|
|
2
|
-
const path = require('node:path');
|
|
3
|
-
|
|
4
|
-
// 定位 lexical 的 package.json 文件
|
|
5
|
-
const packageJsonPath = path.resolve(__dirname, '../node_modules/lexical/package.json');
|
|
6
|
-
|
|
7
|
-
// 读取 package.json
|
|
8
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
9
|
-
|
|
10
|
-
// 修改 package.json 的内容
|
|
11
|
-
const expt = packageJson.exports['.'];
|
|
12
|
-
Object.keys(expt).forEach((key) => {
|
|
13
|
-
const obj = expt[key];
|
|
14
|
-
obj.production = obj.development; // 将 development 指向 production
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// 写回修改后的 package.json
|
|
18
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
|
|
19
|
-
|
|
20
|
-
console.log('lexical package.json has been patched!');
|