md-editor-v3 4.12.4 → 4.13.0
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 +25 -0
- package/lib/cjs/MdEditor.cjs +96 -30
- package/lib/cjs/chunks/config.cjs +5 -2
- package/lib/cjs/chunks/index.cjs +48 -9
- package/lib/cjs/chunks/index4.cjs +2 -0
- package/lib/es/MdEditor.mjs +97 -31
- package/lib/es/chunks/config.mjs +5 -2
- package/lib/es/chunks/index.mjs +49 -10
- package/lib/es/chunks/index4.mjs +11 -9
- package/lib/style.css +58 -0
- package/lib/types/MdEditor/Editor.d.ts +10 -1
- package/lib/types/MdEditor/components/Icon/Icon.d.ts +1 -1
- package/lib/types/MdEditor/composition.d.ts +1 -1
- package/lib/types/MdEditor/config.d.ts +2 -2
- package/lib/types/MdEditor/index.d.ts +23 -4
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Content/composition/usePasteUpload.d.ts +3 -1
- package/lib/types/MdEditor/layouts/Content/index.d.ts +10 -1
- package/lib/types/MdEditor/layouts/Content/props.d.ts +4 -0
- package/lib/types/MdEditor/props.d.ts +10 -0
- package/lib/types/MdEditor/static/event-name.d.ts +1 -0
- package/lib/types/MdEditor/type.d.ts +11 -0
- package/lib/types/MdPreview/MdPreview.d.ts +1 -1
- package/lib/types/MdPreview/index.d.ts +4 -4
- package/lib/umd/index.js +40 -39
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ declare const _default: {
|
|
|
10
10
|
htmlPreview: boolean;
|
|
11
11
|
class: string;
|
|
12
12
|
style: string | import('vue').CSSProperties;
|
|
13
|
+
language: string;
|
|
13
14
|
toolbars: import('./type').ToolbarNames[];
|
|
14
15
|
toolbarsExclude: import('./type').ToolbarNames[];
|
|
15
16
|
noPrettier: boolean;
|
|
@@ -20,9 +21,9 @@ declare const _default: {
|
|
|
20
21
|
scrollAuto: boolean;
|
|
21
22
|
showToolbarName: boolean;
|
|
22
23
|
inputBoxWitdh: string;
|
|
24
|
+
transformImgUrl: (t: string) => string;
|
|
23
25
|
modelValue: string;
|
|
24
26
|
theme: import('./type').Themes;
|
|
25
|
-
language: string;
|
|
26
27
|
editorId: string;
|
|
27
28
|
showCodeRowNumber: boolean;
|
|
28
29
|
previewTheme: string;
|
|
@@ -145,6 +146,10 @@ declare const _default: {
|
|
|
145
146
|
onInputBoxWitdhChange: {
|
|
146
147
|
type: import("vue").PropType<(width: string) => void>;
|
|
147
148
|
};
|
|
149
|
+
transformImgUrl: {
|
|
150
|
+
type: import("vue").PropType<(t: string) => string>;
|
|
151
|
+
default: (t: string) => string;
|
|
152
|
+
};
|
|
148
153
|
modelValue: {
|
|
149
154
|
type: import("vue").PropType<string>;
|
|
150
155
|
default: string;
|
|
@@ -247,7 +252,7 @@ declare const _default: {
|
|
|
247
252
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
248
253
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
249
254
|
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
250
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "preview" | "pageFullscreen" | "htmlPreview" | "class" | "style" | "toolbars" | "toolbarsExclude" | "noPrettier" | "tabWidth" | "tableShape" | "placeholder" | "footers" | "scrollAuto" | "showToolbarName" | "inputBoxWitdh" | "
|
|
255
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "preview" | "pageFullscreen" | "htmlPreview" | "class" | "style" | "language" | "toolbars" | "toolbarsExclude" | "noPrettier" | "tabWidth" | "tableShape" | "placeholder" | "footers" | "scrollAuto" | "showToolbarName" | "inputBoxWitdh" | "transformImgUrl" | "modelValue" | "theme" | "editorId" | "showCodeRowNumber" | "previewTheme" | "mdHeadingId" | "sanitize" | "noMermaid" | "noKatex" | "codeTheme" | "formatCopiedText" | "codeStyleReverse" | "codeStyleReverseList" | "noHighlight" | "noImgZoomIn" | "customIcon" | "sanitizeMermaid">;
|
|
251
256
|
$attrs: {
|
|
252
257
|
[x: string]: unknown;
|
|
253
258
|
};
|
|
@@ -368,6 +373,10 @@ declare const _default: {
|
|
|
368
373
|
onInputBoxWitdhChange: {
|
|
369
374
|
type: import("vue").PropType<(width: string) => void>;
|
|
370
375
|
};
|
|
376
|
+
transformImgUrl: {
|
|
377
|
+
type: import("vue").PropType<(t: string) => string>;
|
|
378
|
+
default: (t: string) => string;
|
|
379
|
+
};
|
|
371
380
|
modelValue: {
|
|
372
381
|
type: import("vue").PropType<string>;
|
|
373
382
|
default: string;
|
|
@@ -476,6 +485,7 @@ declare const _default: {
|
|
|
476
485
|
htmlPreview: boolean;
|
|
477
486
|
class: string;
|
|
478
487
|
style: string | import("vue").CSSProperties;
|
|
488
|
+
language: string;
|
|
479
489
|
toolbars: import("./type").ToolbarNames[];
|
|
480
490
|
toolbarsExclude: import("./type").ToolbarNames[];
|
|
481
491
|
noPrettier: boolean;
|
|
@@ -486,9 +496,9 @@ declare const _default: {
|
|
|
486
496
|
scrollAuto: boolean;
|
|
487
497
|
showToolbarName: boolean;
|
|
488
498
|
inputBoxWitdh: string;
|
|
499
|
+
transformImgUrl: (t: string) => string;
|
|
489
500
|
modelValue: string;
|
|
490
501
|
theme: import("./type").Themes;
|
|
491
|
-
language: string;
|
|
492
502
|
editorId: string;
|
|
493
503
|
showCodeRowNumber: boolean;
|
|
494
504
|
previewTheme: string;
|
|
@@ -631,6 +641,10 @@ declare const _default: {
|
|
|
631
641
|
onInputBoxWitdhChange: {
|
|
632
642
|
type: import("vue").PropType<(width: string) => void>;
|
|
633
643
|
};
|
|
644
|
+
transformImgUrl: {
|
|
645
|
+
type: import("vue").PropType<(t: string) => string>;
|
|
646
|
+
default: (t: string) => string;
|
|
647
|
+
};
|
|
634
648
|
modelValue: {
|
|
635
649
|
type: import("vue").PropType<string>;
|
|
636
650
|
default: string;
|
|
@@ -844,6 +858,10 @@ declare const _default: {
|
|
|
844
858
|
onInputBoxWitdhChange: {
|
|
845
859
|
type: import("vue").PropType<(width: string) => void>;
|
|
846
860
|
};
|
|
861
|
+
transformImgUrl: {
|
|
862
|
+
type: import("vue").PropType<(t: string) => string>;
|
|
863
|
+
default: (t: string) => string;
|
|
864
|
+
};
|
|
847
865
|
modelValue: {
|
|
848
866
|
type: import("vue").PropType<string>;
|
|
849
867
|
default: string;
|
|
@@ -952,6 +970,7 @@ declare const _default: {
|
|
|
952
970
|
htmlPreview: boolean;
|
|
953
971
|
class: string;
|
|
954
972
|
style: string | import("vue").CSSProperties;
|
|
973
|
+
language: string;
|
|
955
974
|
toolbars: import("./type").ToolbarNames[];
|
|
956
975
|
toolbarsExclude: import("./type").ToolbarNames[];
|
|
957
976
|
noPrettier: boolean;
|
|
@@ -962,9 +981,9 @@ declare const _default: {
|
|
|
962
981
|
scrollAuto: boolean;
|
|
963
982
|
showToolbarName: boolean;
|
|
964
983
|
inputBoxWitdh: string;
|
|
984
|
+
transformImgUrl: (t: string) => string;
|
|
965
985
|
modelValue: string;
|
|
966
986
|
theme: import("./type").Themes;
|
|
967
|
-
language: string;
|
|
968
987
|
editorId: string;
|
|
969
988
|
showCodeRowNumber: boolean;
|
|
970
989
|
previewTheme: string;
|
|
@@ -110,6 +110,7 @@ declare const ContentPreview: import('vue').DefineComponent<{
|
|
|
110
110
|
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
111
111
|
};
|
|
112
112
|
}>>, {
|
|
113
|
+
previewOnly: boolean;
|
|
113
114
|
onHtmlChanged: (h: string) => void;
|
|
114
115
|
onGetCatalog: (list: import("~/type").HeadList[]) => void;
|
|
115
116
|
modelValue: string;
|
|
@@ -120,6 +121,5 @@ declare const ContentPreview: import('vue').DefineComponent<{
|
|
|
120
121
|
formatCopiedText: (text: string) => string;
|
|
121
122
|
noHighlight: boolean;
|
|
122
123
|
setting: import("~/type").SettingType;
|
|
123
|
-
previewOnly: boolean;
|
|
124
124
|
}>;
|
|
125
125
|
export default ContentPreview;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { default as CodeMirrorUt } from '../codemirror';
|
|
1
2
|
import { ContentProps } from '../props';
|
|
3
|
+
import { ShallowRef } from 'vue';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* 处理粘贴板
|
|
5
7
|
*/
|
|
6
|
-
declare const usePasteUpload: (props: ContentProps) => (e: ClipboardEvent) => void;
|
|
8
|
+
declare const usePasteUpload: (props: ContentProps, codeMirrorUt: ShallowRef<CodeMirrorUt | undefined>) => (e: ClipboardEvent) => void;
|
|
7
9
|
export default usePasteUpload;
|
|
@@ -63,6 +63,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
63
63
|
onInputBoxWitdhChange: {
|
|
64
64
|
type: import("vue").PropType<(width: string) => void>;
|
|
65
65
|
};
|
|
66
|
+
transformImgUrl: {
|
|
67
|
+
type: import("vue").PropType<(t: string) => string>;
|
|
68
|
+
default: (t: string) => string;
|
|
69
|
+
};
|
|
66
70
|
modelValue: {
|
|
67
71
|
type: import("vue").PropType<string>;
|
|
68
72
|
default: string;
|
|
@@ -180,6 +184,10 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
180
184
|
onInputBoxWitdhChange: {
|
|
181
185
|
type: import("vue").PropType<(width: string) => void>;
|
|
182
186
|
};
|
|
187
|
+
transformImgUrl: {
|
|
188
|
+
type: import("vue").PropType<(t: string) => string>;
|
|
189
|
+
default: (t: string) => string;
|
|
190
|
+
};
|
|
183
191
|
modelValue: {
|
|
184
192
|
type: import("vue").PropType<string>;
|
|
185
193
|
default: string;
|
|
@@ -233,6 +241,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
233
241
|
type: import("vue").PropType<(h: string) => Promise<string>>;
|
|
234
242
|
};
|
|
235
243
|
}>>, {
|
|
244
|
+
previewOnly: boolean;
|
|
236
245
|
onChange: (v: string) => void;
|
|
237
246
|
onHtmlChanged: (h: string) => void;
|
|
238
247
|
onGetCatalog: (list: import("~/type").HeadList[]) => void;
|
|
@@ -240,6 +249,7 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
240
249
|
onFocus: (event: FocusEvent) => void;
|
|
241
250
|
onDrop: (event: DragEvent) => void;
|
|
242
251
|
placeholder: string;
|
|
252
|
+
transformImgUrl: (t: string) => string;
|
|
243
253
|
modelValue: string;
|
|
244
254
|
theme: import("~/type").Themes;
|
|
245
255
|
mdHeadingId: import("~/type").MdHeadingId;
|
|
@@ -250,6 +260,5 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
250
260
|
noHighlight: boolean;
|
|
251
261
|
setting: import("~/type").SettingType;
|
|
252
262
|
updateModelValue: (v: string) => void;
|
|
253
|
-
previewOnly: boolean;
|
|
254
263
|
}>;
|
|
255
264
|
export default _default;
|
|
@@ -128,6 +128,10 @@ export declare const contentProps: {
|
|
|
128
128
|
onInputBoxWitdhChange: {
|
|
129
129
|
type: PropType<(width: string) => void>;
|
|
130
130
|
};
|
|
131
|
+
transformImgUrl: {
|
|
132
|
+
type: PropType<(t: string) => string>;
|
|
133
|
+
default: (t: string) => string;
|
|
134
|
+
};
|
|
131
135
|
modelValue: {
|
|
132
136
|
type: PropType<string>;
|
|
133
137
|
default: string;
|
|
@@ -439,6 +439,16 @@ export declare const editorProps: {
|
|
|
439
439
|
onInputBoxWitdhChange: {
|
|
440
440
|
type: PropType<(width: string) => void>;
|
|
441
441
|
};
|
|
442
|
+
/**
|
|
443
|
+
* 替换粘贴的图片链接
|
|
444
|
+
*
|
|
445
|
+
* @param t 图片链接
|
|
446
|
+
* @returns
|
|
447
|
+
*/
|
|
448
|
+
transformImgUrl: {
|
|
449
|
+
type: PropType<(t: string) => string>;
|
|
450
|
+
default: (t: string) => string;
|
|
451
|
+
};
|
|
442
452
|
/**
|
|
443
453
|
* markdown content.
|
|
444
454
|
*
|
|
@@ -4,6 +4,7 @@ export declare const CHANGE_FULL_SCREEN = "changeFullscreen";
|
|
|
4
4
|
export declare const PAGE_FULL_SCREEN_CHANGED = "pageFullscreenChanged";
|
|
5
5
|
export declare const FULL_SCREEN_CHANGED = "fullscreenChanged";
|
|
6
6
|
export declare const PREVIEW_CHANGED = "previewChanged";
|
|
7
|
+
export declare const PREVIEW_ONLY_CHANGED = "previewOnlyChanged";
|
|
7
8
|
export declare const HTML_PREVIEW_CHANGED = "htmlPreviewChanged";
|
|
8
9
|
export declare const CATALOG_VISIBLE_CHANGED = "catalogVisibleChanged";
|
|
9
10
|
export declare const TEXTAREA_FOCUS = "textareaFocus";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ToolDirective } from './utils/content-help';
|
|
1
2
|
import { IconName } from './components/Icon/Icon';
|
|
2
3
|
import { editorProps, mdPreviewProps } from './props';
|
|
3
4
|
import { KeyBinding, EditorView } from '@codemirror/view';
|
|
@@ -43,6 +44,7 @@ export interface ToolbarTips {
|
|
|
43
44
|
pageFullscreen?: string;
|
|
44
45
|
fullscreen?: string;
|
|
45
46
|
preview?: string;
|
|
47
|
+
previewOnly?: string;
|
|
46
48
|
htmlPreview?: string;
|
|
47
49
|
catalog?: string;
|
|
48
50
|
github?: string;
|
|
@@ -113,6 +115,7 @@ export interface SettingType {
|
|
|
113
115
|
fullscreen: boolean;
|
|
114
116
|
preview: boolean;
|
|
115
117
|
htmlPreview: boolean;
|
|
118
|
+
previewOnly: boolean;
|
|
116
119
|
}
|
|
117
120
|
export type Themes = 'light' | 'dark';
|
|
118
121
|
/**
|
|
@@ -300,6 +303,7 @@ export interface ExposeEvent {
|
|
|
300
303
|
pageFullscreen(status: boolean): void;
|
|
301
304
|
fullscreen(status: boolean): void;
|
|
302
305
|
preview(status: boolean): void;
|
|
306
|
+
previewOnly(status: boolean): void;
|
|
303
307
|
htmlPreview(status: boolean): void;
|
|
304
308
|
catalog(status: boolean): void;
|
|
305
309
|
}
|
|
@@ -351,6 +355,7 @@ export interface ExposeParam {
|
|
|
351
355
|
* @param status 是否显示预览
|
|
352
356
|
*/
|
|
353
357
|
togglePreview(status?: boolean): void;
|
|
358
|
+
togglePreviewOnly(status?: boolean): void;
|
|
354
359
|
/**
|
|
355
360
|
* 切换是否显示html预览
|
|
356
361
|
*
|
|
@@ -406,6 +411,12 @@ export interface ExposeParam {
|
|
|
406
411
|
* @param handlers
|
|
407
412
|
*/
|
|
408
413
|
domEventHandlers(handlers: DOMEventHandlers): void;
|
|
414
|
+
/**
|
|
415
|
+
* 执行内部插入命令
|
|
416
|
+
*
|
|
417
|
+
* @param direct
|
|
418
|
+
*/
|
|
419
|
+
execCommand(direct: ToolDirective): void;
|
|
409
420
|
}
|
|
410
421
|
export type ExposePreviewParam = Pick<ExposeParam, 'rerender'>;
|
|
411
422
|
export type EditorProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof editorProps>>>>;
|
|
@@ -194,9 +194,9 @@ declare const MdPreview: import('vue').DefineComponent<{
|
|
|
194
194
|
}, {
|
|
195
195
|
class: string;
|
|
196
196
|
style: string | import("vue").CSSProperties;
|
|
197
|
+
language: string;
|
|
197
198
|
modelValue: string;
|
|
198
199
|
theme: import("~/type").Themes;
|
|
199
|
-
language: string;
|
|
200
200
|
editorId: string;
|
|
201
201
|
showCodeRowNumber: boolean;
|
|
202
202
|
previewTheme: string;
|
|
@@ -7,9 +7,9 @@ declare const _default: {
|
|
|
7
7
|
$props: Partial<{
|
|
8
8
|
class: string;
|
|
9
9
|
style: string | import('vue').CSSProperties;
|
|
10
|
+
language: string;
|
|
10
11
|
modelValue: string;
|
|
11
12
|
theme: import('..').Themes;
|
|
12
|
-
language: string;
|
|
13
13
|
editorId: string;
|
|
14
14
|
showCodeRowNumber: boolean;
|
|
15
15
|
previewTheme: string;
|
|
@@ -128,7 +128,7 @@ declare const _default: {
|
|
|
128
128
|
onOnInput?: ((...args: any[]) => any) | undefined;
|
|
129
129
|
onOnDrop?: ((...args: any[]) => any) | undefined;
|
|
130
130
|
onOnInputBoxWitdhChange?: ((...args: any[]) => any) | undefined;
|
|
131
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "class" | "style" | "
|
|
131
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "class" | "style" | "language" | "modelValue" | "theme" | "editorId" | "showCodeRowNumber" | "previewTheme" | "mdHeadingId" | "sanitize" | "noMermaid" | "noKatex" | "codeTheme" | "formatCopiedText" | "codeStyleReverse" | "codeStyleReverseList" | "noHighlight" | "noImgZoomIn" | "customIcon" | "sanitizeMermaid">;
|
|
132
132
|
$attrs: {
|
|
133
133
|
[x: string]: unknown;
|
|
134
134
|
};
|
|
@@ -248,9 +248,9 @@ declare const _default: {
|
|
|
248
248
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, string, {
|
|
249
249
|
class: string;
|
|
250
250
|
style: string | import("vue").CSSProperties;
|
|
251
|
+
language: string;
|
|
251
252
|
modelValue: string;
|
|
252
253
|
theme: import("..").Themes;
|
|
253
|
-
language: string;
|
|
254
254
|
editorId: string;
|
|
255
255
|
showCodeRowNumber: boolean;
|
|
256
256
|
previewTheme: string;
|
|
@@ -499,9 +499,9 @@ declare const _default: {
|
|
|
499
499
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("..").EditorEmits, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue" | "onBlur" | "onFocus" | "onInput" | "onDrop" | "onInputBoxWitdhChange", {
|
|
500
500
|
class: string;
|
|
501
501
|
style: string | import("vue").CSSProperties;
|
|
502
|
+
language: string;
|
|
502
503
|
modelValue: string;
|
|
503
504
|
theme: import("..").Themes;
|
|
504
|
-
language: string;
|
|
505
505
|
editorId: string;
|
|
506
506
|
showCodeRowNumber: boolean;
|
|
507
507
|
previewTheme: string;
|