@powerduck/md-editor 0.7.0 → 0.8.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/README.md +27 -0
- package/dist/Editor.d.ts +20 -0
- package/dist/icons.d.ts +3 -0
- package/dist/index.cjs +21 -16
- package/dist/index.d.ts +17 -0
- package/dist/index.mjs +2184 -1695
- package/dist/plugins/doclink.d.ts +98 -0
- package/dist/plugins/mention.d.ts +69 -0
- package/dist/plugins/mindmap.d.ts +7 -0
- package/dist/plugins/popup.d.ts +1 -0
- package/dist/plugins/tasklist.d.ts +7 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { MentionOptions } from './plugins/mention.js';
|
|
2
|
+
import type { DocLinkOptions } from './plugins/doclink.js';
|
|
1
3
|
import './styles/editor.css';
|
|
2
4
|
export type EditorMode = 'simple' | 'complex';
|
|
3
5
|
export type EditorTheme = 'light' | 'dark';
|
|
@@ -41,6 +43,19 @@ export interface MarkdownEditorOptions {
|
|
|
41
43
|
* image URL. The URL is inserted as `` at the cursor.
|
|
42
44
|
*/
|
|
43
45
|
onImageUpload?: (file: File) => Promise<string>;
|
|
46
|
+
/**
|
|
47
|
+
* @mention dropdown configuration. When provided, typing @ in the editor
|
|
48
|
+
* shows a searchable dropdown. onMentionSearch returns matching items;
|
|
49
|
+
* onMentionSelect returns the text to insert.
|
|
50
|
+
*/
|
|
51
|
+
mention?: MentionOptions;
|
|
52
|
+
/**
|
|
53
|
+
* Document/article link inserter configuration. When provided, typing /
|
|
54
|
+
* in the editor shows a document search dropdown. onDocSearch returns
|
|
55
|
+
* matching documents; on selection, inserts either a plain link or a
|
|
56
|
+
* :::doc-link preview card with auto-fetched title/thumbnail/description.
|
|
57
|
+
*/
|
|
58
|
+
docLink?: DocLinkOptions;
|
|
44
59
|
renderDebounce?: number | false;
|
|
45
60
|
autoPreview?: boolean;
|
|
46
61
|
}
|
|
@@ -84,6 +99,8 @@ export declare class MarkdownEditor {
|
|
|
84
99
|
private handleImageFile;
|
|
85
100
|
private showTipsPopup;
|
|
86
101
|
private setupCopyHandler;
|
|
102
|
+
private copyToClipboard;
|
|
103
|
+
private fallbackCopy;
|
|
87
104
|
private insertSnippet;
|
|
88
105
|
private wrapSnippet;
|
|
89
106
|
private togglePreview;
|