@lobehub/editor 1.14.1 → 1.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.
@@ -16,6 +16,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
16
16
  import { $isCodeNode } from '@lexical/code';
17
17
  import { $getNodeByKey, $getSelection, $isRangeSelection, $isTextNode, COLLABORATION_TAG, COMMAND_PRIORITY_CRITICAL, HISTORIC_TAG, KEY_ENTER_COMMAND, PASTE_COMMAND } from 'lexical';
18
18
  import { KernelPlugin } from "../../../editor-kernel/plugin";
19
+ import { createDebugLogger } from "../../../utils/debug";
19
20
  import MarkdownDataSource from "../data-source/markdown-data-source";
20
21
  import { parseMarkdownToLexical } from "../data-source/markdown/parse";
21
22
  import { IMarkdownShortCutService, MarkdownShortCutService } from "../service/shortcut";
@@ -30,6 +31,7 @@ export var MarkdownPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
30
31
  var _this;
31
32
  _classCallCheck(this, MarkdownPlugin);
32
33
  _this = _super.call(this);
34
+ _defineProperty(_assertThisInitialized(_this), "logger", createDebugLogger('plugin', 'markdown'));
33
35
  _defineProperty(_assertThisInitialized(_this), "service", void 0);
34
36
  _this.kernel = kernel;
35
37
  _this.service = new MarkdownShortCutService(kernel);
@@ -133,13 +135,13 @@ export var MarkdownPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
133
135
  // If there's HTML content, it's a rich text paste
134
136
  // Let Lexical's rich text handler process it
135
137
  if (html && html.trim()) {
136
- console.log('paste content analysis: HTML detected, letting Lexical handle it');
138
+ _this2.logger.debug('paste content analysis: HTML detected, letting Lexical handle it');
137
139
  return false;
138
140
  }
139
141
 
140
142
  // Only handle plain text paste - check for markdown patterns
141
143
  var hasMarkdownContent = _this2.detectMarkdownContent(text);
142
- console.log('paste content analysis:', {
144
+ _this2.logger.debug('paste content analysis:', {
143
145
  hasHTML: false,
144
146
  hasMarkdown: hasMarkdownContent,
145
147
  markdownPatterns: _this2.getMarkdownPatterns(text),
@@ -256,7 +258,7 @@ export var MarkdownPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
256
258
  $insertGeneratedNodes(editor, nodes, selection);
257
259
  return true;
258
260
  } catch (error) {
259
- console.error('Failed to handle markdown paste:', error);
261
+ this.logger.error('Failed to handle markdown paste:', error);
260
262
  }
261
263
  return false;
262
264
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/editor",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
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",