@lobehub/editor 1.5.2 β 1.5.4
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/README.md +74 -23
- package/es/editor-kernel/kernel.d.ts +1 -0
- package/es/editor-kernel/kernel.js +57 -16
- package/es/editor-kernel/react/useDecorators.js +14 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +11 -4
- package/es/plugins/common/node/cursor.js +5 -3
- package/es/plugins/file/command/index.js +3 -1
- package/es/plugins/file/plugin/index.js +3 -1
- package/es/plugins/image/command/index.js +3 -1
- package/es/plugins/image/plugin/index.js +1 -1
- package/es/plugins/markdown/service/shortcut.d.ts +1 -0
- package/es/plugins/markdown/service/shortcut.js +3 -1
- package/es/plugins/math/plugin/index.js +3 -1
- package/es/plugins/math/react/component/MathInline.js +3 -1
- package/es/plugins/math/react/index.js +1 -1
- package/es/plugins/mention/react/ReactMentionPlugin.js +1 -1
- package/es/plugins/slash/plugin/index.js +1 -1
- package/es/plugins/slash/service/i-slash-service.d.ts +1 -0
- package/es/plugins/slash/service/i-slash-service.js +4 -1
- package/es/plugins/upload/plugin/index.js +5 -3
- package/es/react/Editor/Editor.js +2 -1
- package/es/utils/debug.d.ts +429 -0
- package/es/utils/debug.js +348 -0
- package/package.json +2 -1
|
@@ -20,6 +20,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
20
20
|
/* eslint-disable @typescript-eslint/no-redeclare */
|
|
21
21
|
import { $createRangeSelection, $getSelection, $isLineBreakNode, $isRangeSelection, $isRootOrShadowRoot, $isTextNode, $setSelection } from 'lexical';
|
|
22
22
|
import { genServiceId } from "../../../editor-kernel";
|
|
23
|
+
import { createDebugLogger } from "../../../utils/debug";
|
|
23
24
|
import { PUNCTUATION_OR_SPACE, getOpenTagStartIndex, indexBy, isEqualSubString } from "../utils";
|
|
24
25
|
export var IMarkdownShortCutService = genServiceId('MarkdownShortCutService');
|
|
25
26
|
function testElementTransformers(parentNode, anchorNode, anchorOffset, elementTransformers, fromTrigger) {
|
|
@@ -293,6 +294,7 @@ export var MarkdownShortCutService = /*#__PURE__*/function () {
|
|
|
293
294
|
_defineProperty(this, "elementTransformers", []);
|
|
294
295
|
_defineProperty(this, "textFormatTransformers", []);
|
|
295
296
|
_defineProperty(this, "textMatchTransformers", []);
|
|
297
|
+
_defineProperty(this, "logger", createDebugLogger('service', 'markdown'));
|
|
296
298
|
_defineProperty(this, "_markdownWriters", {});
|
|
297
299
|
_defineProperty(this, "_textFormatTransformersByTrigger", null);
|
|
298
300
|
_defineProperty(this, "_textMatchTransformersByTrigger", null);
|
|
@@ -397,7 +399,7 @@ export var MarkdownShortCutService = /*#__PURE__*/function () {
|
|
|
397
399
|
return;
|
|
398
400
|
}
|
|
399
401
|
if ((_this$kernel = this.kernel) !== null && _this$kernel !== void 0 && _this$kernel.isHotReloadMode()) {
|
|
400
|
-
|
|
402
|
+
this.logger.warn("\uD83D\uDD04 Hot reload: markdown writer \"".concat(type, "\""));
|
|
401
403
|
this._markdownWriters[type] = writer;
|
|
402
404
|
return;
|
|
403
405
|
}
|
|
@@ -22,6 +22,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
22
22
|
import { $createNodeSelection, $setSelection } from 'lexical';
|
|
23
23
|
import { KernelPlugin } from "../../../editor-kernel/plugin";
|
|
24
24
|
import { IMarkdownShortCutService } from "../../markdown";
|
|
25
|
+
import { createDebugLogger } from "../../../utils/debug";
|
|
25
26
|
import { registerMathCommand } from "../command";
|
|
26
27
|
import { $createMathBlockNode, $createMathInlineNode, MathBlockNode, MathInlineNode } from "../node";
|
|
27
28
|
|
|
@@ -35,6 +36,7 @@ export var MathPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
|
|
|
35
36
|
var _this;
|
|
36
37
|
_classCallCheck(this, MathPlugin);
|
|
37
38
|
_this = _super.call(this);
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "logger", createDebugLogger('plugin', 'math'));
|
|
38
40
|
_this.kernel = kernel;
|
|
39
41
|
_this.config = config;
|
|
40
42
|
kernel.registerNodes([MathInlineNode, MathBlockNode]);
|
|
@@ -53,7 +55,7 @@ export var MathPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
|
|
|
53
55
|
var _match = _slicedToArray(match, 2),
|
|
54
56
|
code = _match[1];
|
|
55
57
|
var mathNode = $createMathInlineNode(code);
|
|
56
|
-
|
|
58
|
+
_this.logger.debug('Math node inserted:', mathNode);
|
|
57
59
|
// textNode.replace(mathNode);
|
|
58
60
|
textNode.insertBefore(mathNode);
|
|
59
61
|
textNode.setTextContent('');
|
|
@@ -10,9 +10,11 @@ import { $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_PRIORITY_NORMAL
|
|
|
10
10
|
import { memo, useEffect, useRef, useState } from 'react';
|
|
11
11
|
import { useLexicalEditor } from "../../../../editor-kernel/react";
|
|
12
12
|
import { useLexicalNodeSelection } from "../../../../editor-kernel/react/useLexicalNodeSelection";
|
|
13
|
+
import { createDebugLogger } from "../../../../utils/debug";
|
|
13
14
|
import { $isMathNode, MathBlockNode } from "../../node";
|
|
14
15
|
import Placeholder from "./Placeholder";
|
|
15
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
var logger = createDebugLogger('plugin', 'math');
|
|
16
18
|
var MathInline = /*#__PURE__*/memo(function (_ref) {
|
|
17
19
|
var editor = _ref.editor,
|
|
18
20
|
node = _ref.node,
|
|
@@ -56,7 +58,7 @@ var MathInline = /*#__PURE__*/memo(function (_ref) {
|
|
|
56
58
|
}, [isSelected, isEditing, editor, node]);
|
|
57
59
|
useLexicalEditor(function (editor) {
|
|
58
60
|
return editor.registerCommand(CLICK_COMMAND, function (payload) {
|
|
59
|
-
|
|
61
|
+
logger.debug('π Math click event:', payload.target === ref.current);
|
|
60
62
|
if (payload.target && payload.target instanceof Node) {
|
|
61
63
|
var _ref$current;
|
|
62
64
|
// θ·εθηΉε―ΉεΊη DOM ε
η΄
|
|
@@ -35,7 +35,7 @@ var ReactMentionPlugin = function ReactMentionPlugin(_ref) {
|
|
|
35
35
|
markdownWriter: markdownWriter,
|
|
36
36
|
theme: theme || styles
|
|
37
37
|
});
|
|
38
|
-
}, [editor]);
|
|
38
|
+
}, [editor, className, markdownWriter, theme, styles]);
|
|
39
39
|
return null;
|
|
40
40
|
};
|
|
41
41
|
ReactMentionPlugin.displayName = 'ReactMentionPlugin';
|
|
@@ -129,4 +129,4 @@ export var SlashPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
|
|
|
129
129
|
}
|
|
130
130
|
}]);
|
|
131
131
|
return SlashPlugin;
|
|
132
|
-
}(KernelPlugin), _defineProperty(_class, "pluginName", '
|
|
132
|
+
}(KernelPlugin), _defineProperty(_class, "pluginName", 'SlashPlugin'), _class);
|
|
@@ -30,6 +30,7 @@ export declare class SlashService implements ISlashService {
|
|
|
30
30
|
private triggerMap;
|
|
31
31
|
private triggerFnMap;
|
|
32
32
|
private triggerFuseMap;
|
|
33
|
+
private logger;
|
|
33
34
|
constructor(kernel: IEditorKernel);
|
|
34
35
|
registerSlash(options: SlashOptions): void;
|
|
35
36
|
getSlashOptions(trigger: string): SlashOptions | undefined;
|
|
@@ -10,6 +10,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
10
10
|
|
|
11
11
|
import Fuse from 'fuse.js';
|
|
12
12
|
import { genServiceId } from "../../../editor-kernel";
|
|
13
|
+
import { createDebugLogger } from "../../../utils/debug";
|
|
13
14
|
import { getBasicTypeaheadTriggerMatch } from "../utils/utils";
|
|
14
15
|
export var ISlashService = genServiceId('SlashService');
|
|
15
16
|
export var SlashService = /*#__PURE__*/function () {
|
|
@@ -18,6 +19,7 @@ export var SlashService = /*#__PURE__*/function () {
|
|
|
18
19
|
_defineProperty(this, "triggerMap", new Map());
|
|
19
20
|
_defineProperty(this, "triggerFnMap", new Map());
|
|
20
21
|
_defineProperty(this, "triggerFuseMap", new Map());
|
|
22
|
+
_defineProperty(this, "logger", createDebugLogger('service', 'slash'));
|
|
21
23
|
this.kernel = kernel;
|
|
22
24
|
}
|
|
23
25
|
// Specific service methods can be added here
|
|
@@ -26,7 +28,7 @@ export var SlashService = /*#__PURE__*/function () {
|
|
|
26
28
|
value: function registerSlash(options) {
|
|
27
29
|
if (this.triggerMap.has(options.trigger)) {
|
|
28
30
|
if (this.kernel.isHotReloadMode()) {
|
|
29
|
-
|
|
31
|
+
this.logger.warn("\uD83D\uDD04 Overriding slash trigger \"".concat(options.trigger, "\""));
|
|
30
32
|
} else {
|
|
31
33
|
throw new Error("Slash trigger \"".concat(options.trigger, "\" is already registered."));
|
|
32
34
|
}
|
|
@@ -38,6 +40,7 @@ export var SlashService = /*#__PURE__*/function () {
|
|
|
38
40
|
minLength: options.minLength,
|
|
39
41
|
punctuation: options.punctuation
|
|
40
42
|
}));
|
|
43
|
+
this.logger.debug("\u26A1 Slash trigger: ".concat(options.trigger));
|
|
41
44
|
if (Array.isArray(options.items)) {
|
|
42
45
|
// Filter out divider items for search functionality
|
|
43
46
|
var searchableItems = options.items.filter(function (item) {
|
|
@@ -19,6 +19,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
19
19
|
import { DRAG_DROP_PASTE } from '@lexical/rich-text';
|
|
20
20
|
import { COMMAND_PRIORITY_HIGH, DROP_COMMAND } from 'lexical';
|
|
21
21
|
import { KernelPlugin } from "../../../editor-kernel/plugin";
|
|
22
|
+
import { createDebugLogger } from "../../../utils/debug";
|
|
22
23
|
import { IUploadService, UploadService } from "../service/i-upload-service";
|
|
23
24
|
import { getDragSelection } from "../utils";
|
|
24
25
|
|
|
@@ -32,6 +33,7 @@ export var UploadPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
|
|
|
32
33
|
_classCallCheck(this, UploadPlugin);
|
|
33
34
|
_this = _super.call(this);
|
|
34
35
|
// Register the upload service
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "logger", createDebugLogger('plugin', 'upload'));
|
|
35
37
|
_this.kernel = kernel;
|
|
36
38
|
_this.config = config;
|
|
37
39
|
kernel.registerService(IUploadService, new UploadService());
|
|
@@ -50,7 +52,7 @@ export var UploadPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
|
|
|
50
52
|
var uploadService = _this2.kernel.requireService(IUploadService);
|
|
51
53
|
if (uploadService) {
|
|
52
54
|
uploadService.uploadFile(file, 'drop', getDragSelection(event)).catch(function (error) {
|
|
53
|
-
|
|
55
|
+
_this2.logger.error('Upload failed:', error);
|
|
54
56
|
});
|
|
55
57
|
}
|
|
56
58
|
}
|
|
@@ -65,7 +67,7 @@ export var UploadPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
|
|
|
65
67
|
var uploadService = _this2.kernel.requireService(IUploadService);
|
|
66
68
|
if (uploadService) {
|
|
67
69
|
uploadService.uploadFile(file, 'drag-drop-paste', null).catch(function (error) {
|
|
68
|
-
|
|
70
|
+
_this2.logger.error('Upload failed:', error);
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
73
|
}
|
|
@@ -79,4 +81,4 @@ export var UploadPlugin = (_class = /*#__PURE__*/function (_KernelPlugin) {
|
|
|
79
81
|
}
|
|
80
82
|
}]);
|
|
81
83
|
return UploadPlugin;
|
|
82
|
-
}(KernelPlugin), _defineProperty(_class, "pluginName", '
|
|
84
|
+
}(KernelPlugin), _defineProperty(_class, "pluginName", 'UploadPlugin'), _class);
|
|
@@ -63,9 +63,10 @@ var Editor = /*#__PURE__*/memo(function (_ref) {
|
|
|
63
63
|
var memoMention = useMemo(function () {
|
|
64
64
|
if (!enableMention) return;
|
|
65
65
|
return /*#__PURE__*/_jsx(ReactMentionPlugin, {
|
|
66
|
+
className: className,
|
|
66
67
|
markdownWriter: markdownWriter
|
|
67
68
|
});
|
|
68
|
-
}, [enableMention, markdownWriter]);
|
|
69
|
+
}, [enableMention, markdownWriter, className]);
|
|
69
70
|
var memoSlash = useMemo(function () {
|
|
70
71
|
if (!enableSlash && !enableMention) return null;
|
|
71
72
|
return /*#__PURE__*/_jsxs(ReactSlashPlugin, {
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import createDebug from 'debug';
|
|
2
|
+
/**
|
|
3
|
+
* Development mode check
|
|
4
|
+
*/
|
|
5
|
+
declare const isDev: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Debug utility factory for LobeHub Editor
|
|
8
|
+
* Creates namespaced debug functions following the pattern: lobe-editor:category
|
|
9
|
+
*/
|
|
10
|
+
export declare class DebugLogger {
|
|
11
|
+
private debuggers;
|
|
12
|
+
/**
|
|
13
|
+
* Get or create a debug function for a specific namespace
|
|
14
|
+
* @param category - The debug category (e.g., 'kernel', 'plugin', 'upload')
|
|
15
|
+
* @param subcategory - Optional subcategory for more specific debugging
|
|
16
|
+
* @returns Debug function
|
|
17
|
+
*/
|
|
18
|
+
getDebugger(category: string, subcategory?: string): createDebug.Debugger;
|
|
19
|
+
/**
|
|
20
|
+
* Create a scoped debug logger for a specific component/service
|
|
21
|
+
* @param category - Main category
|
|
22
|
+
* @param subcategory - Optional subcategory
|
|
23
|
+
* @returns Object with debug methods
|
|
24
|
+
*/
|
|
25
|
+
createLogger(category: string, subcategory?: string): {
|
|
26
|
+
/**
|
|
27
|
+
* General debug logging
|
|
28
|
+
*/
|
|
29
|
+
debug: createDebug.Debugger;
|
|
30
|
+
/**
|
|
31
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
32
|
+
*/
|
|
33
|
+
error: (...args: any[]) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Info level logging
|
|
36
|
+
*/
|
|
37
|
+
info: createDebug.Debugger;
|
|
38
|
+
/**
|
|
39
|
+
* Log function - alias for debug for compatibility
|
|
40
|
+
*/
|
|
41
|
+
log: createDebug.Debugger;
|
|
42
|
+
/**
|
|
43
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
44
|
+
*/
|
|
45
|
+
warn: (...args: any[]) => void;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Enable debug for specific namespaces
|
|
49
|
+
* @param namespaces - Comma-separated list of namespaces to enable
|
|
50
|
+
*/
|
|
51
|
+
enable(namespaces: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Disable all debug output
|
|
54
|
+
*/
|
|
55
|
+
disable(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a namespace is enabled
|
|
58
|
+
* @param namespace - The namespace to check
|
|
59
|
+
* @returns Whether the namespace is enabled
|
|
60
|
+
*/
|
|
61
|
+
enabled(namespace: string): boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Global debug logger instance
|
|
65
|
+
*/
|
|
66
|
+
export declare const debugLogger: DebugLogger;
|
|
67
|
+
/**
|
|
68
|
+
* Convenience function to create a debug logger for a specific category
|
|
69
|
+
* @param category - Main category (e.g., 'kernel', 'plugin', 'upload')
|
|
70
|
+
* @param subcategory - Optional subcategory
|
|
71
|
+
* @returns Logger object with debug methods
|
|
72
|
+
*/
|
|
73
|
+
export declare function createDebugLogger(category: string, subcategory?: string): {
|
|
74
|
+
/**
|
|
75
|
+
* General debug logging
|
|
76
|
+
*/
|
|
77
|
+
debug: createDebug.Debugger;
|
|
78
|
+
/**
|
|
79
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
80
|
+
*/
|
|
81
|
+
error: (...args: any[]) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Info level logging
|
|
84
|
+
*/
|
|
85
|
+
info: createDebug.Debugger;
|
|
86
|
+
/**
|
|
87
|
+
* Log function - alias for debug for compatibility
|
|
88
|
+
*/
|
|
89
|
+
log: createDebug.Debugger;
|
|
90
|
+
/**
|
|
91
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
92
|
+
*/
|
|
93
|
+
warn: (...args: any[]) => void;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Pre-configured debug loggers for common categories
|
|
97
|
+
*/
|
|
98
|
+
export declare const debugLoggers: {
|
|
99
|
+
demo: {
|
|
100
|
+
/**
|
|
101
|
+
* General debug logging
|
|
102
|
+
*/
|
|
103
|
+
debug: createDebug.Debugger;
|
|
104
|
+
/**
|
|
105
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
106
|
+
*/
|
|
107
|
+
error: (...args: any[]) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Info level logging
|
|
110
|
+
*/
|
|
111
|
+
info: createDebug.Debugger;
|
|
112
|
+
/**
|
|
113
|
+
* Log function - alias for debug for compatibility
|
|
114
|
+
*/
|
|
115
|
+
log: createDebug.Debugger;
|
|
116
|
+
/**
|
|
117
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
118
|
+
*/
|
|
119
|
+
warn: (...args: any[]) => void;
|
|
120
|
+
};
|
|
121
|
+
file: {
|
|
122
|
+
/**
|
|
123
|
+
* General debug logging
|
|
124
|
+
*/
|
|
125
|
+
debug: createDebug.Debugger;
|
|
126
|
+
/**
|
|
127
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
128
|
+
*/
|
|
129
|
+
error: (...args: any[]) => void;
|
|
130
|
+
/**
|
|
131
|
+
* Info level logging
|
|
132
|
+
*/
|
|
133
|
+
info: createDebug.Debugger;
|
|
134
|
+
/**
|
|
135
|
+
* Log function - alias for debug for compatibility
|
|
136
|
+
*/
|
|
137
|
+
log: createDebug.Debugger;
|
|
138
|
+
/**
|
|
139
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
140
|
+
*/
|
|
141
|
+
warn: (...args: any[]) => void;
|
|
142
|
+
};
|
|
143
|
+
image: {
|
|
144
|
+
/**
|
|
145
|
+
* General debug logging
|
|
146
|
+
*/
|
|
147
|
+
debug: createDebug.Debugger;
|
|
148
|
+
/**
|
|
149
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
150
|
+
*/
|
|
151
|
+
error: (...args: any[]) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Info level logging
|
|
154
|
+
*/
|
|
155
|
+
info: createDebug.Debugger;
|
|
156
|
+
/**
|
|
157
|
+
* Log function - alias for debug for compatibility
|
|
158
|
+
*/
|
|
159
|
+
log: createDebug.Debugger;
|
|
160
|
+
/**
|
|
161
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
162
|
+
*/
|
|
163
|
+
warn: (...args: any[]) => void;
|
|
164
|
+
};
|
|
165
|
+
kernel: {
|
|
166
|
+
/**
|
|
167
|
+
* General debug logging
|
|
168
|
+
*/
|
|
169
|
+
debug: createDebug.Debugger;
|
|
170
|
+
/**
|
|
171
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
172
|
+
*/
|
|
173
|
+
error: (...args: any[]) => void;
|
|
174
|
+
/**
|
|
175
|
+
* Info level logging
|
|
176
|
+
*/
|
|
177
|
+
info: createDebug.Debugger;
|
|
178
|
+
/**
|
|
179
|
+
* Log function - alias for debug for compatibility
|
|
180
|
+
*/
|
|
181
|
+
log: createDebug.Debugger;
|
|
182
|
+
/**
|
|
183
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
184
|
+
*/
|
|
185
|
+
warn: (...args: any[]) => void;
|
|
186
|
+
};
|
|
187
|
+
markdown: {
|
|
188
|
+
/**
|
|
189
|
+
* General debug logging
|
|
190
|
+
*/
|
|
191
|
+
debug: createDebug.Debugger;
|
|
192
|
+
/**
|
|
193
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
194
|
+
*/
|
|
195
|
+
error: (...args: any[]) => void;
|
|
196
|
+
/**
|
|
197
|
+
* Info level logging
|
|
198
|
+
*/
|
|
199
|
+
info: createDebug.Debugger;
|
|
200
|
+
/**
|
|
201
|
+
* Log function - alias for debug for compatibility
|
|
202
|
+
*/
|
|
203
|
+
log: createDebug.Debugger;
|
|
204
|
+
/**
|
|
205
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
206
|
+
*/
|
|
207
|
+
warn: (...args: any[]) => void;
|
|
208
|
+
};
|
|
209
|
+
math: {
|
|
210
|
+
/**
|
|
211
|
+
* General debug logging
|
|
212
|
+
*/
|
|
213
|
+
debug: createDebug.Debugger;
|
|
214
|
+
/**
|
|
215
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
216
|
+
*/
|
|
217
|
+
error: (...args: any[]) => void;
|
|
218
|
+
/**
|
|
219
|
+
* Info level logging
|
|
220
|
+
*/
|
|
221
|
+
info: createDebug.Debugger;
|
|
222
|
+
/**
|
|
223
|
+
* Log function - alias for debug for compatibility
|
|
224
|
+
*/
|
|
225
|
+
log: createDebug.Debugger;
|
|
226
|
+
/**
|
|
227
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
228
|
+
*/
|
|
229
|
+
warn: (...args: any[]) => void;
|
|
230
|
+
};
|
|
231
|
+
mention: {
|
|
232
|
+
/**
|
|
233
|
+
* General debug logging
|
|
234
|
+
*/
|
|
235
|
+
debug: createDebug.Debugger;
|
|
236
|
+
/**
|
|
237
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
238
|
+
*/
|
|
239
|
+
error: (...args: any[]) => void;
|
|
240
|
+
/**
|
|
241
|
+
* Info level logging
|
|
242
|
+
*/
|
|
243
|
+
info: createDebug.Debugger;
|
|
244
|
+
/**
|
|
245
|
+
* Log function - alias for debug for compatibility
|
|
246
|
+
*/
|
|
247
|
+
log: createDebug.Debugger;
|
|
248
|
+
/**
|
|
249
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
250
|
+
*/
|
|
251
|
+
warn: (...args: any[]) => void;
|
|
252
|
+
};
|
|
253
|
+
plugin: {
|
|
254
|
+
/**
|
|
255
|
+
* General debug logging
|
|
256
|
+
*/
|
|
257
|
+
debug: createDebug.Debugger;
|
|
258
|
+
/**
|
|
259
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
260
|
+
*/
|
|
261
|
+
error: (...args: any[]) => void;
|
|
262
|
+
/**
|
|
263
|
+
* Info level logging
|
|
264
|
+
*/
|
|
265
|
+
info: createDebug.Debugger;
|
|
266
|
+
/**
|
|
267
|
+
* Log function - alias for debug for compatibility
|
|
268
|
+
*/
|
|
269
|
+
log: createDebug.Debugger;
|
|
270
|
+
/**
|
|
271
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
272
|
+
*/
|
|
273
|
+
warn: (...args: any[]) => void;
|
|
274
|
+
};
|
|
275
|
+
react: {
|
|
276
|
+
/**
|
|
277
|
+
* General debug logging
|
|
278
|
+
*/
|
|
279
|
+
debug: createDebug.Debugger;
|
|
280
|
+
/**
|
|
281
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
282
|
+
*/
|
|
283
|
+
error: (...args: any[]) => void;
|
|
284
|
+
/**
|
|
285
|
+
* Info level logging
|
|
286
|
+
*/
|
|
287
|
+
info: createDebug.Debugger;
|
|
288
|
+
/**
|
|
289
|
+
* Log function - alias for debug for compatibility
|
|
290
|
+
*/
|
|
291
|
+
log: createDebug.Debugger;
|
|
292
|
+
/**
|
|
293
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
294
|
+
*/
|
|
295
|
+
warn: (...args: any[]) => void;
|
|
296
|
+
};
|
|
297
|
+
service: {
|
|
298
|
+
/**
|
|
299
|
+
* General debug logging
|
|
300
|
+
*/
|
|
301
|
+
debug: createDebug.Debugger;
|
|
302
|
+
/**
|
|
303
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
304
|
+
*/
|
|
305
|
+
error: (...args: any[]) => void;
|
|
306
|
+
/**
|
|
307
|
+
* Info level logging
|
|
308
|
+
*/
|
|
309
|
+
info: createDebug.Debugger;
|
|
310
|
+
/**
|
|
311
|
+
* Log function - alias for debug for compatibility
|
|
312
|
+
*/
|
|
313
|
+
log: createDebug.Debugger;
|
|
314
|
+
/**
|
|
315
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
316
|
+
*/
|
|
317
|
+
warn: (...args: any[]) => void;
|
|
318
|
+
};
|
|
319
|
+
slash: {
|
|
320
|
+
/**
|
|
321
|
+
* General debug logging
|
|
322
|
+
*/
|
|
323
|
+
debug: createDebug.Debugger;
|
|
324
|
+
/**
|
|
325
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
326
|
+
*/
|
|
327
|
+
error: (...args: any[]) => void;
|
|
328
|
+
/**
|
|
329
|
+
* Info level logging
|
|
330
|
+
*/
|
|
331
|
+
info: createDebug.Debugger;
|
|
332
|
+
/**
|
|
333
|
+
* Log function - alias for debug for compatibility
|
|
334
|
+
*/
|
|
335
|
+
log: createDebug.Debugger;
|
|
336
|
+
/**
|
|
337
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
338
|
+
*/
|
|
339
|
+
warn: (...args: any[]) => void;
|
|
340
|
+
};
|
|
341
|
+
upload: {
|
|
342
|
+
/**
|
|
343
|
+
* General debug logging
|
|
344
|
+
*/
|
|
345
|
+
debug: createDebug.Debugger;
|
|
346
|
+
/**
|
|
347
|
+
* Error level logging - uses console.error for proper browser dev tool support
|
|
348
|
+
*/
|
|
349
|
+
error: (...args: any[]) => void;
|
|
350
|
+
/**
|
|
351
|
+
* Info level logging
|
|
352
|
+
*/
|
|
353
|
+
info: createDebug.Debugger;
|
|
354
|
+
/**
|
|
355
|
+
* Log function - alias for debug for compatibility
|
|
356
|
+
*/
|
|
357
|
+
log: createDebug.Debugger;
|
|
358
|
+
/**
|
|
359
|
+
* Warning level logging - uses console.warn for proper browser dev tool support
|
|
360
|
+
*/
|
|
361
|
+
warn: (...args: any[]) => void;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* Development mode utilities
|
|
366
|
+
*/
|
|
367
|
+
export { isDev };
|
|
368
|
+
/**
|
|
369
|
+
* Conditional console logging - only logs in development mode
|
|
370
|
+
* Use this for demo files and development-only logging
|
|
371
|
+
*/
|
|
372
|
+
export declare const devConsole: {
|
|
373
|
+
error: (...args: any[]) => void;
|
|
374
|
+
info: (...args: any[]) => void;
|
|
375
|
+
log: (...args: any[]) => void;
|
|
376
|
+
warn: (...args: any[]) => void;
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Production-safe error logging
|
|
380
|
+
* Always logs errors and warnings regardless of environment using native console methods
|
|
381
|
+
* for proper browser dev tool support. Debug/info uses debug package.
|
|
382
|
+
*/
|
|
383
|
+
export declare const prodSafeLogger: {
|
|
384
|
+
/**
|
|
385
|
+
* Debug info - only shown when debug is enabled
|
|
386
|
+
*/
|
|
387
|
+
debug: createDebug.Debugger;
|
|
388
|
+
/**
|
|
389
|
+
* Log critical errors that should always be visible (uses console.error)
|
|
390
|
+
*/
|
|
391
|
+
error: (...args: any[]) => void;
|
|
392
|
+
/**
|
|
393
|
+
* Info logging - only shown when debug is enabled
|
|
394
|
+
*/
|
|
395
|
+
info: createDebug.Debugger;
|
|
396
|
+
/**
|
|
397
|
+
* Log warnings that should always be visible (uses console.warn)
|
|
398
|
+
*/
|
|
399
|
+
warn: (...args: any[]) => void;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Browser debug utilities for Next.js and other client-side frameworks
|
|
403
|
+
*/
|
|
404
|
+
export declare const browserDebug: {
|
|
405
|
+
/**
|
|
406
|
+
* Disable debug logging in browser environment
|
|
407
|
+
*/
|
|
408
|
+
disable: () => void;
|
|
409
|
+
/**
|
|
410
|
+
* Enable debug logging in browser environment
|
|
411
|
+
* @param namespaces - Debug namespaces to enable (e.g., 'lobe-editor:*')
|
|
412
|
+
*/
|
|
413
|
+
enable: (namespaces?: string) => void;
|
|
414
|
+
/**
|
|
415
|
+
* Get current debug configuration
|
|
416
|
+
*/
|
|
417
|
+
getConfig: () => {
|
|
418
|
+
enabled: string | boolean;
|
|
419
|
+
source: string;
|
|
420
|
+
};
|
|
421
|
+
/**
|
|
422
|
+
* Show available debug categories
|
|
423
|
+
*/
|
|
424
|
+
showCategories: () => void;
|
|
425
|
+
/**
|
|
426
|
+
* Show current debug status and configuration
|
|
427
|
+
*/
|
|
428
|
+
showStatus: () => void;
|
|
429
|
+
};
|