@lobehub/editor 1.5.8 → 1.5.9

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.
@@ -13,6 +13,7 @@ export declare class CodeNode extends CardLikeElementNode {
13
13
  canIndent(): boolean;
14
14
  canInsertTextBefore(): boolean;
15
15
  canInsertTextAfter(): boolean;
16
+ updateDOM(prevNode: CodeNode, dom: HTMLElement, config: EditorConfig): boolean;
16
17
  }
17
18
  export declare function $createCodeNode(textContent?: string): CodeNode;
18
19
  export declare function $isCodeInlineNode(node: unknown): node is CodeNode;
@@ -80,6 +80,16 @@ export var CodeNode = /*#__PURE__*/function (_CardLikeElementNode) {
80
80
  value: function canInsertTextAfter() {
81
81
  return true;
82
82
  }
83
+ }, {
84
+ key: "updateDOM",
85
+ value: function updateDOM(prevNode, dom, config) {
86
+ // Update the class names if theme has changed
87
+ var prevTheme = prevNode ? prevNode : null;
88
+ if (prevTheme !== this) {
89
+ addClassNamesToElement(dom, config.theme.codeInline);
90
+ }
91
+ return false;
92
+ }
83
93
  }], [{
84
94
  key: "getType",
85
95
  value: function getType() {
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
15
15
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
16
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
17
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
- import { COMMAND_PRIORITY_EDITOR, KEY_DOWN_COMMAND } from 'lexical';
18
+ import { COMMAND_PRIORITY_LOW, KEY_DOWN_COMMAND } from 'lexical';
19
19
  import { Children, memo, useEffect, useLayoutEffect, useRef, useState } from 'react';
20
20
  import { LexicalErrorBoundary } from "../../../editor-kernel/react/LexicalErrorBoundary";
21
21
  import { useLexicalComposerContext } from "../../../editor-kernel/react/react-context";
@@ -117,7 +117,7 @@ var ReactPlainText = /*#__PURE__*/memo(function (_ref) {
117
117
  return true; // Indicate that the event has been handled
118
118
  }
119
119
  return false; // Allow other handlers to process the event
120
- }, COMMAND_PRIORITY_EDITOR);
120
+ }, COMMAND_PRIORITY_LOW);
121
121
  }
122
122
  }, [editor, onPressEnter, onKeyDown]);
123
123
  useEffect(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "1.5.8",
3
+ "version": "1.5.9",
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",