md-editor-v3 4.3.0-beta.1 → 4.3.0-beta.3

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.
Files changed (37) hide show
  1. package/README.md +60 -8
  2. package/lib/cjs/MdCatalog.cjs +1 -1
  3. package/lib/cjs/MdEditor.cjs +25 -25
  4. package/lib/cjs/MdModal.cjs +1 -0
  5. package/lib/cjs/MdPreview.cjs +1 -1
  6. package/lib/cjs/ModalToolbar.cjs +1 -1
  7. package/lib/cjs/chunks/config.cjs +1 -1
  8. package/lib/cjs/chunks/index.cjs +7 -7
  9. package/lib/cjs/chunks/index2.cjs +1 -1
  10. package/lib/cjs/chunks/index3.cjs +2 -1
  11. package/lib/cjs/index.cjs +1 -1
  12. package/lib/es/MdCatalog.mjs +1 -1
  13. package/lib/es/MdEditor.mjs +1046 -971
  14. package/lib/es/MdModal.mjs +141 -0
  15. package/lib/es/MdPreview.mjs +1 -1
  16. package/lib/es/ModalToolbar.mjs +97 -5
  17. package/lib/es/chunks/config.mjs +2 -1
  18. package/lib/es/chunks/index.mjs +369 -321
  19. package/lib/es/chunks/index2.mjs +46 -40
  20. package/lib/es/chunks/index3.mjs +61 -227
  21. package/lib/es/index.mjs +4 -2
  22. package/lib/style.css +1 -1
  23. package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +6 -0
  24. package/lib/types/DropdownToolbar/index.d.ts +12 -0
  25. package/lib/types/MdEditor/Editor.d.ts +9 -0
  26. package/lib/types/MdEditor/components/Modal/Modal.d.ts +78 -0
  27. package/lib/types/MdEditor/components/Modal/index.d.ts +173 -51
  28. package/lib/types/MdEditor/index.d.ts +20 -1
  29. package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +6 -0
  30. package/lib/types/MdEditor/layouts/Toolbar/props.d.ts +8 -0
  31. package/lib/types/MdEditor/props.d.ts +9 -0
  32. package/lib/types/MdEditor/type.d.ts +13 -0
  33. package/lib/types/index.d.ts +1 -0
  34. package/lib/umd/index.js +42 -42
  35. package/package.json +2 -2
  36. package/lib/cjs/chunks/index4.cjs +0 -2
  37. package/lib/es/chunks/index4.mjs +0 -69
@@ -1,77 +1,197 @@
1
- import { PropType, ExtractPropTypes } from 'vue';
2
- declare const _default: import("vue").DefineComponent<{
1
+ import { App } from 'vue';
2
+ declare const _default: {
3
+ new (...args: any[]): {
4
+ $: import("vue").ComponentInternalInstance;
5
+ $data: {};
6
+ $props: Partial<{
7
+ title: string;
8
+ visible: boolean;
9
+ onClose: () => void;
10
+ onAdjust: (val: boolean) => void;
11
+ width: string;
12
+ height: string;
13
+ showAdjust: boolean;
14
+ isFullscreen: boolean;
15
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<{
16
+ title: {
17
+ type: import("vue").PropType<string>;
18
+ default: string;
19
+ };
20
+ visible: {
21
+ type: import("vue").PropType<boolean>;
22
+ default: boolean;
23
+ };
24
+ width: {
25
+ type: import("vue").PropType<string>;
26
+ default: string;
27
+ };
28
+ height: {
29
+ type: import("vue").PropType<string>;
30
+ default: string;
31
+ };
32
+ onClose: {
33
+ type: import("vue").PropType<() => void>;
34
+ default: () => void;
35
+ };
36
+ showAdjust: {
37
+ type: import("vue").PropType<boolean>;
38
+ default: boolean;
39
+ };
40
+ isFullscreen: {
41
+ type: import("vue").PropType<boolean>;
42
+ default: boolean;
43
+ };
44
+ onAdjust: {
45
+ type: import("vue").PropType<(val: boolean) => void>;
46
+ default: () => void;
47
+ };
48
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "visible" | "onClose" | "onAdjust" | "width" | "height" | "showAdjust" | "isFullscreen">;
49
+ $attrs: {
50
+ [x: string]: unknown;
51
+ };
52
+ $refs: {
53
+ [x: string]: unknown;
54
+ };
55
+ $slots: Readonly<{
56
+ [name: string]: import("vue").Slot | undefined;
57
+ }>;
58
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
59
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
60
+ $emit: (event: string, ...args: any[]) => void;
61
+ $el: any;
62
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
63
+ title: {
64
+ type: import("vue").PropType<string>;
65
+ default: string;
66
+ };
67
+ visible: {
68
+ type: import("vue").PropType<boolean>;
69
+ default: boolean;
70
+ };
71
+ width: {
72
+ type: import("vue").PropType<string>;
73
+ default: string;
74
+ };
75
+ height: {
76
+ type: import("vue").PropType<string>;
77
+ default: string;
78
+ };
79
+ onClose: {
80
+ type: import("vue").PropType<() => void>;
81
+ default: () => void;
82
+ };
83
+ showAdjust: {
84
+ type: import("vue").PropType<boolean>;
85
+ default: boolean;
86
+ };
87
+ isFullscreen: {
88
+ type: import("vue").PropType<boolean>;
89
+ default: boolean;
90
+ };
91
+ onAdjust: {
92
+ type: import("vue").PropType<(val: boolean) => void>;
93
+ default: () => void;
94
+ };
95
+ }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
96
+ title: string;
97
+ visible: boolean;
98
+ onClose: () => void;
99
+ onAdjust: (val: boolean) => void;
100
+ width: string;
101
+ height: string;
102
+ showAdjust: boolean;
103
+ isFullscreen: boolean;
104
+ }, {}, string> & {
105
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
106
+ created?: ((() => void) | (() => void)[]) | undefined;
107
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
108
+ mounted?: ((() => void) | (() => void)[]) | undefined;
109
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
110
+ updated?: ((() => void) | (() => void)[]) | undefined;
111
+ activated?: ((() => void) | (() => void)[]) | undefined;
112
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
113
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
114
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
115
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
116
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
117
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
118
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
119
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
120
+ };
121
+ $forceUpdate: () => void;
122
+ $nextTick: typeof import("vue").nextTick;
123
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
124
+ } & Readonly<import("vue").ExtractPropTypes<{
125
+ title: {
126
+ type: import("vue").PropType<string>;
127
+ default: string;
128
+ };
129
+ visible: {
130
+ type: import("vue").PropType<boolean>;
131
+ default: boolean;
132
+ };
133
+ width: {
134
+ type: import("vue").PropType<string>;
135
+ default: string;
136
+ };
137
+ height: {
138
+ type: import("vue").PropType<string>;
139
+ default: string;
140
+ };
141
+ onClose: {
142
+ type: import("vue").PropType<() => void>;
143
+ default: () => void;
144
+ };
145
+ showAdjust: {
146
+ type: import("vue").PropType<boolean>;
147
+ default: boolean;
148
+ };
149
+ isFullscreen: {
150
+ type: import("vue").PropType<boolean>;
151
+ default: boolean;
152
+ };
153
+ onAdjust: {
154
+ type: import("vue").PropType<(val: boolean) => void>;
155
+ default: () => void;
156
+ };
157
+ }>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
158
+ __isFragment?: undefined;
159
+ __isTeleport?: undefined;
160
+ __isSuspense?: undefined;
161
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
3
162
  title: {
4
- type: PropType<string>;
163
+ type: import("vue").PropType<string>;
5
164
  default: string;
6
165
  };
7
166
  visible: {
8
- type: PropType<boolean>;
167
+ type: import("vue").PropType<boolean>;
9
168
  default: boolean;
10
169
  };
11
170
  width: {
12
- type: PropType<string>;
171
+ type: import("vue").PropType<string>;
13
172
  default: string;
14
173
  };
15
174
  height: {
16
- type: PropType<string>;
175
+ type: import("vue").PropType<string>;
17
176
  default: string;
18
177
  };
19
178
  onClose: {
20
- type: PropType<() => void>;
179
+ type: import("vue").PropType<() => void>;
21
180
  default: () => void;
22
181
  };
23
182
  showAdjust: {
24
- type: PropType<boolean>;
183
+ type: import("vue").PropType<boolean>;
25
184
  default: boolean;
26
185
  };
27
186
  isFullscreen: {
28
- type: PropType<boolean>;
187
+ type: import("vue").PropType<boolean>;
29
188
  default: boolean;
30
189
  };
31
190
  onAdjust: {
32
- type: PropType<(val: boolean) => void>;
191
+ type: import("vue").PropType<(val: boolean) => void>;
33
192
  default: () => void;
34
193
  };
35
- class: {
36
- type: PropType<string>;
37
- };
38
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
39
- title: {
40
- type: PropType<string>;
41
- default: string;
42
- };
43
- visible: {
44
- type: PropType<boolean>;
45
- default: boolean;
46
- };
47
- width: {
48
- type: PropType<string>;
49
- default: string;
50
- };
51
- height: {
52
- type: PropType<string>;
53
- default: string;
54
- };
55
- onClose: {
56
- type: PropType<() => void>;
57
- default: () => void;
58
- };
59
- showAdjust: {
60
- type: PropType<boolean>;
61
- default: boolean;
62
- };
63
- isFullscreen: {
64
- type: PropType<boolean>;
65
- default: boolean;
66
- };
67
- onAdjust: {
68
- type: PropType<(val: boolean) => void>;
69
- default: () => void;
70
- };
71
- class: {
72
- type: PropType<string>;
73
- };
74
- }>>, {
194
+ }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
75
195
  title: string;
76
196
  visible: boolean;
77
197
  onClose: () => void;
@@ -80,5 +200,7 @@ declare const _default: import("vue").DefineComponent<{
80
200
  height: string;
81
201
  showAdjust: boolean;
82
202
  isFullscreen: boolean;
83
- }>;
203
+ }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
204
+ install: (app: App) => App;
205
+ };
84
206
  export default _default;
@@ -20,6 +20,7 @@ declare const _default: {
20
20
  placeholder: string;
21
21
  footers: import("./type").Footers[];
22
22
  scrollAuto: boolean;
23
+ showToolbarName: boolean;
23
24
  modelValue: string;
24
25
  language: string;
25
26
  showCodeRowNumber: boolean;
@@ -122,6 +123,10 @@ declare const _default: {
122
123
  completions: {
123
124
  type: import("vue").PropType<import("@codemirror/autocomplete").CompletionSource[]>;
124
125
  };
126
+ showToolbarName: {
127
+ type: import("vue").PropType<boolean>;
128
+ default: boolean;
129
+ };
125
130
  modelValue: {
126
131
  type: import("vue").PropType<string>;
127
132
  default: string;
@@ -209,7 +214,7 @@ declare const _default: {
209
214
  onOnHtmlChanged?: ((...args: any[]) => any) | undefined;
210
215
  onOnGetCatalog?: ((...args: any[]) => any) | undefined;
211
216
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
212
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "editorId" | "class" | "style" | "mdHeadingId" | "theme" | "pageFullscreen" | "preview" | "htmlPreview" | "toolbars" | "toolbarsExclude" | "noPrettier" | "tabWidth" | "tableShape" | "placeholder" | "footers" | "scrollAuto" | "modelValue" | "language" | "showCodeRowNumber" | "previewTheme" | "sanitize" | "noMermaid" | "noKatex" | "codeTheme" | "formatCopiedText" | "codeStyleReverse" | "codeStyleReverseList" | "noHighlight">;
217
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "editorId" | "class" | "style" | "mdHeadingId" | "theme" | "pageFullscreen" | "preview" | "htmlPreview" | "toolbars" | "toolbarsExclude" | "noPrettier" | "tabWidth" | "tableShape" | "placeholder" | "footers" | "scrollAuto" | "showToolbarName" | "modelValue" | "language" | "showCodeRowNumber" | "previewTheme" | "sanitize" | "noMermaid" | "noKatex" | "codeTheme" | "formatCopiedText" | "codeStyleReverse" | "codeStyleReverseList" | "noHighlight">;
213
218
  $attrs: {
214
219
  [x: string]: unknown;
215
220
  };
@@ -313,6 +318,10 @@ declare const _default: {
313
318
  completions: {
314
319
  type: import("vue").PropType<import("@codemirror/autocomplete").CompletionSource[]>;
315
320
  };
321
+ showToolbarName: {
322
+ type: import("vue").PropType<boolean>;
323
+ default: boolean;
324
+ };
316
325
  modelValue: {
317
326
  type: import("vue").PropType<string>;
318
327
  default: string;
@@ -417,6 +426,7 @@ declare const _default: {
417
426
  placeholder: string;
418
427
  footers: import("./type").Footers[];
419
428
  scrollAuto: boolean;
429
+ showToolbarName: boolean;
420
430
  modelValue: string;
421
431
  language: string;
422
432
  showCodeRowNumber: boolean;
@@ -539,6 +549,10 @@ declare const _default: {
539
549
  completions: {
540
550
  type: import("vue").PropType<import("@codemirror/autocomplete").CompletionSource[]>;
541
551
  };
552
+ showToolbarName: {
553
+ type: import("vue").PropType<boolean>;
554
+ default: boolean;
555
+ };
542
556
  modelValue: {
543
557
  type: import("vue").PropType<string>;
544
558
  default: string;
@@ -720,6 +734,10 @@ declare const _default: {
720
734
  completions: {
721
735
  type: import("vue").PropType<import("@codemirror/autocomplete").CompletionSource[]>;
722
736
  };
737
+ showToolbarName: {
738
+ type: import("vue").PropType<boolean>;
739
+ default: boolean;
740
+ };
723
741
  modelValue: {
724
742
  type: import("vue").PropType<string>;
725
743
  default: string;
@@ -824,6 +842,7 @@ declare const _default: {
824
842
  placeholder: string;
825
843
  footers: import("./type").Footers[];
826
844
  scrollAuto: boolean;
845
+ showToolbarName: boolean;
827
846
  modelValue: string;
828
847
  language: string;
829
848
  showCodeRowNumber: boolean;
@@ -40,6 +40,9 @@ declare const _default: import("vue").DefineComponent<{
40
40
  noUploadImg: {
41
41
  type: import("vue").PropType<boolean>;
42
42
  };
43
+ showToolbarName: {
44
+ type: import("vue").PropType<boolean>;
45
+ };
43
46
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
44
47
  noPrettier: {
45
48
  type: import("vue").PropType<boolean>;
@@ -80,6 +83,9 @@ declare const _default: import("vue").DefineComponent<{
80
83
  noUploadImg: {
81
84
  type: import("vue").PropType<boolean>;
82
85
  };
86
+ showToolbarName: {
87
+ type: import("vue").PropType<boolean>;
88
+ };
83
89
  }>>, {
84
90
  toolbars: ToolbarNames[];
85
91
  toolbarsExclude: ToolbarNames[];
@@ -41,5 +41,13 @@ export declare const toolbarProps: {
41
41
  noUploadImg: {
42
42
  type: PropType<boolean>;
43
43
  };
44
+ /**
45
+ * 是否在工具栏下面显示对应的文字名称
46
+ *
47
+ * @default false
48
+ */
49
+ showToolbarName: {
50
+ type: PropType<boolean>;
51
+ };
44
52
  };
45
53
  export type ToolbarProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof toolbarProps>>>>;
@@ -386,6 +386,15 @@ export declare const editorProps: {
386
386
  completions: {
387
387
  type: PropType<CompletionSource[]>;
388
388
  };
389
+ /**
390
+ * 是否在工具栏下面显示对应的文字名称
391
+ *
392
+ * @default false
393
+ */
394
+ showToolbarName: {
395
+ type: PropType<boolean>;
396
+ default: boolean;
397
+ };
389
398
  /**
390
399
  * markdown content.
391
400
  *
@@ -1,4 +1,5 @@
1
1
  import { LooseRequired } from '@vue/shared';
2
+ import markdownit from 'markdown-it/lib';
2
3
  import { ExtractPropTypes, SetupContext } from 'vue';
3
4
  import { Extension } from '@codemirror/state';
4
5
  import { KeyBinding } from '@codemirror/view';
@@ -158,6 +159,11 @@ export interface MermaidTemplate {
158
159
  */
159
160
  journey?: string;
160
161
  }
162
+ export interface MarkdownItConfigPlugin {
163
+ type: string;
164
+ plugin: markdownit.PluginWithParams;
165
+ options: any;
166
+ }
161
167
  export interface ConfigOption {
162
168
  /**
163
169
  * 编辑器内部依赖库
@@ -227,6 +233,13 @@ export interface ConfigOption {
227
233
  * 自定义markdown-it核心库扩展、属性等
228
234
  */
229
235
  markdownItConfig?: (md: markdownit) => void;
236
+ /**
237
+ * 挑选编辑器已预设的markdownIt的扩展
238
+ *
239
+ * @param plugins markdownIt的扩展,带编辑器已设定的属性
240
+ * @returns plugins
241
+ */
242
+ markdownItPlugins?: (plugins: Array<MarkdownItConfigPlugin>) => Array<MarkdownItConfigPlugin>;
230
243
  }
231
244
  /**
232
245
  * 扩展编辑器内部功能,包括marked和一些内部依赖实例,如highlight、cropper等
@@ -5,4 +5,5 @@ export { default as DropdownToolbar } from './DropdownToolbar';
5
5
  export { default as ModalToolbar } from './ModalToolbar';
6
6
  export { default as MdCatalog } from './MdCatalog';
7
7
  export { default as config } from './config';
8
+ export { default as MdModal } from './MdEditor/components/Modal';
8
9
  export * from './MdEditor/type';