md-editor-v3 1.10.0 → 1.11.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 +57 -28
- package/lib/MdEditor/Editor.d.ts +18 -9
- package/lib/MdEditor/index.d.ts +47 -25
- package/lib/MdEditor/layouts/Catalog/index.d.ts +42 -0
- package/lib/MdEditor/type.d.ts +1 -0
- package/lib/md-editor-v3.es.js +260 -171
- package/lib/md-editor-v3.umd.js +58 -57
- package/lib/style.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,13 +20,11 @@ Markdown editor for vue3, developed in `jsx` and `typescript`.
|
|
|
20
20
|
- Beautify your content by `prettier`(only for markdown content, not the code and other text).
|
|
21
21
|
- Multi-language, build-in Chinese and English(default: Chinese).
|
|
22
22
|
- Upload picture, paste or clip the picture and upload it.
|
|
23
|
-
- Render article directly(no editor
|
|
23
|
+
- Render article directly(no editor, no event listener, only preview content).
|
|
24
24
|
- Preview themes, support `defalut`、`vuepress`、`github` styles(not identical).
|
|
25
25
|
- `mermaid`(>=1.8.0).
|
|
26
26
|
- `katex` mathematical formula(>=1.9.0).
|
|
27
27
|
|
|
28
|
-
> More features are developing, if you have some ideas or find issues, please tell it to me~
|
|
29
|
-
|
|
30
28
|
## Preview
|
|
31
29
|
|
|
32
30
|
| Default theme | Dark theme | Preview only |
|
|
@@ -38,8 +36,8 @@ Markdown editor for vue3, developed in `jsx` and `typescript`.
|
|
|
38
36
|
### Props
|
|
39
37
|
|
|
40
38
|
| name | type | default | description |
|
|
41
|
-
| --- | --- | --- | --- |
|
|
42
|
-
| modelValue | String | '' | Markdown content
|
|
39
|
+
| --- | --- | --- | --- |
|
|
40
|
+
| modelValue | String | '' | Markdown content, use `v-model` in vue template |
|
|
43
41
|
| theme | 'light' \| 'dark' | 'light' | Change editor theme |
|
|
44
42
|
| editorClass | String | '' | |
|
|
45
43
|
| hljs | Object | null | `Highlight` instance, editor will not insert script of it, but you need to import `highlight` code style by yourself |
|
|
@@ -51,17 +49,17 @@ Markdown editor for vue3, developed in `jsx` and `typescript`.
|
|
|
51
49
|
| htmlPreview | Boolean | false | Preview html in editor |
|
|
52
50
|
| previewOnly | Boolean | false | Only render article content, no toolbar, no edit area |
|
|
53
51
|
| language | String | 'zh-CN' | Build-in language('zh-CN','en-US') |
|
|
54
|
-
| languageUserDefined | Object | {key: StaticTextDefaultValue} | Expand language
|
|
55
|
-
| toolbars | Array | [toolbars] | Show some item of toolbars
|
|
56
|
-
| toolbarsExclude | Array | [] | Don't show some item of toolbars
|
|
52
|
+
| languageUserDefined | Object | {key: StaticTextDefaultValue} | Expand language, update `language` api to your key |
|
|
53
|
+
| toolbars | Array | [toolbars] | Show some item of toolbars, all keys<sup>see `toolbars` below</sup> |
|
|
54
|
+
| toolbarsExclude | Array | [] | Don't show some item of toolbars, all keys`toolbars` |
|
|
57
55
|
| prettier | Boolean | true | Use prettier to beautify content or not |
|
|
58
56
|
| prettierCDN | String | [standalone@2.4.0](https://cdn.jsdelivr.net/npm/prettier@2.4.0/standalone.js) | |
|
|
59
57
|
| prettierMDCDN | String | [parser-markdown@2.4.0](https://cdn.jsdelivr.net/npm/prettier@2.4.0/parser-markdown.js) | |
|
|
60
58
|
| cropperCss | String | [cropper.min.css@1.5.12](https://cdn.jsdelivr.net/npm/cropperjs@1.5.12/dist/cropper.min.css) | Cropper css url |
|
|
61
59
|
| cropperJs | String | [cropper.min.js@1.5.12](https://cdn.jsdelivr.net/npm/cropperjs@1.5.12/dist/cropper.min.js) | Cropper js url |
|
|
62
60
|
| iconfontJs | String | [iconfont](https://at.alicdn.com/t/font_2605852_khjf435c7th.js) | Icon url |
|
|
63
|
-
| editorId | String | md-editor-v3 | Editor id,
|
|
64
|
-
| tabWidth | Number | 2 | One tab eq some
|
|
61
|
+
| editorId | String | md-editor-v3 | Editor's id, the html's id also, it is used when there are more than two editors in the same page. |
|
|
62
|
+
| tabWidth | Number | 2 | One tab eq some spaces |
|
|
65
63
|
| showCodeRowNumber | Boolean | false | Show row number for code block or not |
|
|
66
64
|
| screenfull | Object | null | Screenfull instance, editor will not insert script of it |
|
|
67
65
|
| screenfullJs | String | [screenfull@5.1.0](https://cdn.jsdelivr.net/npm/screenfull@5.1.0/dist/screenfull.js) | Screenfull js url |
|
|
@@ -72,12 +70,12 @@ Markdown editor for vue3, developed in `jsx` and `typescript`.
|
|
|
72
70
|
| mermaidJs | String | [mermaid@8.13.5](https://cdn.jsdelivr.net/npm/mermaid@8.13.5/dist/mermaid.min.js) | MermaidJs url |
|
|
73
71
|
| noMermaid | Boolean | false | Do not use mermaid |
|
|
74
72
|
| placeholder | String | '' | |
|
|
75
|
-
| katex | Object | undefined | `katex` instance(
|
|
73
|
+
| katex | Object | undefined | `katex` instance(You need import css by yourself) |
|
|
76
74
|
| katexJs | String | [katex.min.js@0.15.1](https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.js) | KatexJs url |
|
|
77
75
|
| katexCss | String | [katex.min.css@0.15.1](https://cdn.jsdelivr.net/npm/katex@0.15.1/dist/katex.min.css) | KatexCss url |
|
|
78
76
|
| noKatex | Boolean | false | Do not use katex |
|
|
79
|
-
| defToolbars | Array<DropdownToolbar
|
|
80
|
-
| extensions | Array
|
|
77
|
+
| defToolbars | Array<DropdownToolbar \| NormalToolbar> | null | Customize Toolbar, for more usage, please refer to [docs](https://imzbf.github.io/md-editor-v3/docs/index#%F0%9F%92%AA%20defToolbars) and [emoji](https://imzbf.github.io/md-editor-v3/demo/index#💪%20Customize%20Toolbar) |
|
|
78
|
+
| extensions | Array | [] | [marked](https://marked.js.org/using_pro#extensions) extensions |
|
|
81
79
|
|
|
82
80
|
mark and emoji extensions
|
|
83
81
|
|
|
@@ -124,7 +122,7 @@ mark and emoji extensions
|
|
|
124
122
|
|
|
125
123
|
> After v1.10.0, you can customize the toolbar. To display them, put index of `defToolbars` into `toolbars`(this is not standard), for more usage, please refer to[docs]().
|
|
126
124
|
|
|
127
|
-
Expand language
|
|
125
|
+
Expand language, you need to replace all the content here:
|
|
128
126
|
|
|
129
127
|
[StaticTextDefaultValue]
|
|
130
128
|
|
|
@@ -188,12 +186,12 @@ export interface StaticTextDefaultValue {
|
|
|
188
186
|
UrlLablePlaceHolder?: string;
|
|
189
187
|
buttonOK?: string;
|
|
190
188
|
};
|
|
191
|
-
// The modal tips of clip the picture
|
|
189
|
+
// The modal tips of clip the picture, v1.2.0
|
|
192
190
|
clipModalTips?: {
|
|
193
191
|
title?: string;
|
|
194
192
|
buttonUpload?: string;
|
|
195
193
|
};
|
|
196
|
-
// Copy code tips
|
|
194
|
+
// Copy code tips, v1.1.4
|
|
197
195
|
copyCode?: {
|
|
198
196
|
text?: string;
|
|
199
197
|
tips?: string;
|
|
@@ -221,16 +219,16 @@ export interface StaticTextDefaultValue {
|
|
|
221
219
|
|
|
222
220
|
### Event
|
|
223
221
|
|
|
224
|
-
| name | params | description |
|
|
225
|
-
| --- | --- | --- |
|
|
226
|
-
| onChange | v:
|
|
227
|
-
| onSave | v:
|
|
228
|
-
| onUploadImg | files:FileList, callback:Function | Upload picture event
|
|
229
|
-
| onHtmlChanged | h:
|
|
230
|
-
| onGetCatalog | list: HeadList[] | Get catalogue of article |
|
|
231
|
-
| markedHeading | text: string,level: 1-6,raw: string, slugger: Slugger | `marked` head renderer methods |
|
|
232
|
-
| markedHeadingId | (text: string, level: number) => string | title `ID` generator |
|
|
233
|
-
| sanitize | (html: string) => string | Sanitize the html, prevent XSS. |
|
|
222
|
+
| name | params | usage | description |
|
|
223
|
+
| --- | --- | --- | --- |
|
|
224
|
+
| onChange | v:string | @onChange="xxx" | Content changed event(bind to `oninput` of `textarea`) |
|
|
225
|
+
| onSave | v:string | @onSave="xxx" | Save content event, `ctrl+s`and click button will trigger |
|
|
226
|
+
| onUploadImg | files:FileList, callback:Function | @onUploadImg="xxx" | Upload picture event, when picture is uploading the modal will not close, please provide right urls to the callback function |
|
|
227
|
+
| onHtmlChanged | h:string | @onHtmlChanged="xxx" | Compile markdown successful event, you can use it to get the html code |
|
|
228
|
+
| onGetCatalog | list: HeadList[] | @onGetCatalog="xxx" | Get catalogue of article |
|
|
229
|
+
| markedHeading | text: string,level: 1-6,raw: string, slugger: Slugger | :marked-heading="xxx" | `marked` head renderer methods |
|
|
230
|
+
| markedHeadingId | (text: string, level: number) => string | :marked-heading-id="xxx" | title `ID` generator |
|
|
231
|
+
| sanitize | (html: string) => string | :sanitize="xxx" | Sanitize the html, prevent XSS. |
|
|
234
232
|
|
|
235
233
|
> If `markedHeading` is overridden, be sure to tell the editor the algorithm for generating the title ID by `marketheadingid`.
|
|
236
234
|
|
|
@@ -263,7 +261,38 @@ export interface StaticTextDefaultValue {
|
|
|
263
261
|
| CTRL + ALT + C | code row | | v1.0.0 |
|
|
264
262
|
| CTRL + SHIFT + ALT + T | table | `\|table\|` | v1.4.0 |
|
|
265
263
|
|
|
266
|
-
##
|
|
264
|
+
## Internal components
|
|
265
|
+
|
|
266
|
+
Before 1.x, they are used as attributes of the editor component, eg: `Editor.DropdownToolbar`. For more examples, refer to [document](https://imzbf.github.io/md-editor-v3).
|
|
267
|
+
|
|
268
|
+
### NormalToolbar
|
|
269
|
+
|
|
270
|
+
`Editor.NormalToolbar`
|
|
271
|
+
|
|
272
|
+
- `title`: `string`, not necessary, the tips when hover toolbar;
|
|
273
|
+
- `trigger`: `string | JSX.Element`, necessary, it is usually an icon, which is displayed on the toolbar;
|
|
274
|
+
- `onClick`: `(e: MouseEvent) => void`, necessary.
|
|
275
|
+
|
|
276
|
+
### DropdownToolbar
|
|
277
|
+
|
|
278
|
+
`Editor.DropdownToolbar`
|
|
279
|
+
|
|
280
|
+
- `title`: `string`, not necessary, the tips when hover toolbar;
|
|
281
|
+
- `visible`: `boolean`, necessary;
|
|
282
|
+
- `trigger`: `string | JSX.Element`, necessary, it is usually an icon, which is displayed on the toolbar;
|
|
283
|
+
- `onChange`: `(visible: boolean) => void`, necessary;
|
|
284
|
+
- `overlay`: `string | JSX.Element`, necessary, contents in the drop-down box.
|
|
285
|
+
|
|
286
|
+
### Catalogue
|
|
287
|
+
|
|
288
|
+
`Editor.Catalog`
|
|
289
|
+
|
|
290
|
+
- `editorId`: `string`, necessary, editor's `editorId`, used to register listening events;
|
|
291
|
+
- `class`: `string`, not necessary;
|
|
292
|
+
- `markedHeadingId`: `MarkedHeadingId`, not necessary, same as editor;
|
|
293
|
+
- `scrollElement`: `string | HTMLElement`, not necessary, it is an element selector when its type is string. When `previewOnly` eq `true`, it is usually set to `document.documentElement`.
|
|
294
|
+
|
|
295
|
+
## Some examples
|
|
267
296
|
|
|
268
297
|
### Jsx module
|
|
269
298
|
|
|
@@ -313,7 +342,7 @@ export default defineComponent({
|
|
|
313
342
|
|
|
314
343
|
### Upload picture
|
|
315
344
|
|
|
316
|
-
> Tips:When you paste and upload GIF
|
|
345
|
+
> Tips:When you paste and upload GIF, it will upload a static picture. So you should upload it by file system!
|
|
317
346
|
|
|
318
347
|
```js
|
|
319
348
|
async onUploadImg(files: FileList, callback: (urls: string[]) => void) {
|
package/lib/MdEditor/Editor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropType, CSSProperties } from 'vue';
|
|
2
|
-
import { StaticTextDefaultValue, ToolbarNames, HeadList, PreviewThemes, MarkedHeading, MarkedHeadingId } from './type';
|
|
2
|
+
import { StaticTextDefaultValue, ToolbarNames, HeadList, PreviewThemes, MarkedHeading, MarkedHeadingId, MarkedImage } from './type';
|
|
3
3
|
export declare const markedHeadingId: MarkedHeadingId;
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
@@ -187,6 +187,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
187
187
|
extensions: {
|
|
188
188
|
type: PropType<any[]>;
|
|
189
189
|
};
|
|
190
|
+
markedImage: {
|
|
191
|
+
type: PropType<MarkedImage>;
|
|
192
|
+
default: (href: string, _: string, desc: string) => string;
|
|
193
|
+
};
|
|
190
194
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
191
195
|
modelValue: {
|
|
192
196
|
type: PropType<string>;
|
|
@@ -373,18 +377,27 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
373
377
|
extensions: {
|
|
374
378
|
type: PropType<any[]>;
|
|
375
379
|
};
|
|
380
|
+
markedImage: {
|
|
381
|
+
type: PropType<MarkedImage>;
|
|
382
|
+
default: (href: string, _: string, desc: string) => string;
|
|
383
|
+
};
|
|
376
384
|
}>>, {
|
|
377
385
|
editorId: string;
|
|
378
386
|
prettier: boolean;
|
|
379
387
|
preview: boolean;
|
|
380
388
|
htmlPreview: boolean;
|
|
381
|
-
previewOnly: boolean;
|
|
382
389
|
tabWidth: number;
|
|
383
|
-
showCodeRowNumber: boolean;
|
|
384
|
-
Cropper: Function;
|
|
385
390
|
theme: "dark" | "light";
|
|
386
391
|
historyLength: number;
|
|
392
|
+
previewOnly: boolean;
|
|
393
|
+
showCodeRowNumber: boolean;
|
|
394
|
+
Cropper: Function;
|
|
387
395
|
previewTheme: PreviewThemes;
|
|
396
|
+
iconfontJs: string;
|
|
397
|
+
prettierCDN: string;
|
|
398
|
+
prettierMDCDN: string;
|
|
399
|
+
cropperCss: string;
|
|
400
|
+
cropperJs: string;
|
|
388
401
|
style: string | CSSProperties;
|
|
389
402
|
modelValue: string;
|
|
390
403
|
editorClass: string;
|
|
@@ -398,11 +411,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
398
411
|
};
|
|
399
412
|
toolbars: ToolbarNames[];
|
|
400
413
|
toolbarsExclude: ToolbarNames[];
|
|
401
|
-
prettierCDN: string;
|
|
402
|
-
prettierMDCDN: string;
|
|
403
|
-
cropperCss: string;
|
|
404
|
-
cropperJs: string;
|
|
405
|
-
iconfontJs: string;
|
|
406
414
|
screenfull: Record<string, any>;
|
|
407
415
|
screenfullJs: string;
|
|
408
416
|
markedHeading: MarkedHeading;
|
|
@@ -415,5 +423,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
415
423
|
katexJs: string;
|
|
416
424
|
katexCss: string;
|
|
417
425
|
noKatex: boolean;
|
|
426
|
+
markedImage: MarkedImage;
|
|
418
427
|
}>;
|
|
419
428
|
export default _default;
|
package/lib/MdEditor/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import NormalToolbar from './NormalToolbar';
|
|
2
2
|
import DropdownToolbar from './DropdownToolbar';
|
|
3
|
+
import Catalog from './layouts/Catalog';
|
|
3
4
|
declare const _default: {
|
|
4
5
|
new (...args: any[]): {
|
|
5
6
|
$: import("vue").ComponentInternalInstance;
|
|
@@ -9,13 +10,18 @@ declare const _default: {
|
|
|
9
10
|
prettier: boolean;
|
|
10
11
|
preview: boolean;
|
|
11
12
|
htmlPreview: boolean;
|
|
12
|
-
previewOnly: boolean;
|
|
13
13
|
tabWidth: number;
|
|
14
|
-
showCodeRowNumber: boolean;
|
|
15
|
-
Cropper: Function;
|
|
16
14
|
theme: "dark" | "light";
|
|
17
15
|
historyLength: number;
|
|
16
|
+
previewOnly: boolean;
|
|
17
|
+
showCodeRowNumber: boolean;
|
|
18
|
+
Cropper: Function;
|
|
18
19
|
previewTheme: import("./type").PreviewThemes;
|
|
20
|
+
iconfontJs: string;
|
|
21
|
+
prettierCDN: string;
|
|
22
|
+
prettierMDCDN: string;
|
|
23
|
+
cropperCss: string;
|
|
24
|
+
cropperJs: string;
|
|
19
25
|
style: string | import("vue").CSSProperties;
|
|
20
26
|
modelValue: string;
|
|
21
27
|
editorClass: string;
|
|
@@ -29,11 +35,6 @@ declare const _default: {
|
|
|
29
35
|
};
|
|
30
36
|
toolbars: import("./type").ToolbarNames[];
|
|
31
37
|
toolbarsExclude: import("./type").ToolbarNames[];
|
|
32
|
-
prettierCDN: string;
|
|
33
|
-
prettierMDCDN: string;
|
|
34
|
-
cropperCss: string;
|
|
35
|
-
cropperJs: string;
|
|
36
|
-
iconfontJs: string;
|
|
37
38
|
screenfull: Record<string, any>;
|
|
38
39
|
screenfullJs: string;
|
|
39
40
|
markedHeading: import("./type").MarkedHeading;
|
|
@@ -46,6 +47,7 @@ declare const _default: {
|
|
|
46
47
|
katexJs: string;
|
|
47
48
|
katexCss: string;
|
|
48
49
|
noKatex: boolean;
|
|
50
|
+
markedImage: import("./type").MarkedImage;
|
|
49
51
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
|
50
52
|
modelValue: {
|
|
51
53
|
type: import("vue").PropType<string>;
|
|
@@ -232,7 +234,11 @@ declare const _default: {
|
|
|
232
234
|
extensions: {
|
|
233
235
|
type: import("vue").PropType<any[]>;
|
|
234
236
|
};
|
|
235
|
-
|
|
237
|
+
markedImage: {
|
|
238
|
+
type: import("vue").PropType<import("./type").MarkedImage>;
|
|
239
|
+
default: (href: string, _: string, desc: string) => string;
|
|
240
|
+
};
|
|
241
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "editorId" | "prettier" | "preview" | "htmlPreview" | "tabWidth" | "theme" | "historyLength" | "previewOnly" | "showCodeRowNumber" | "Cropper" | "previewTheme" | "iconfontJs" | "prettierCDN" | "prettierMDCDN" | "cropperCss" | "cropperJs" | "style" | "modelValue" | "editorClass" | "hljs" | "highlightJs" | "highlightCss" | "pageFullScreen" | "language" | "languageUserDefined" | "toolbars" | "toolbarsExclude" | "screenfull" | "screenfullJs" | "markedHeading" | "markedHeadingId" | "tableShape" | "mermaidJs" | "noMermaid" | "sanitize" | "placeholder" | "katexJs" | "katexCss" | "noKatex" | "markedImage">;
|
|
236
242
|
$attrs: {
|
|
237
243
|
[x: string]: unknown;
|
|
238
244
|
};
|
|
@@ -432,18 +438,27 @@ declare const _default: {
|
|
|
432
438
|
extensions: {
|
|
433
439
|
type: import("vue").PropType<any[]>;
|
|
434
440
|
};
|
|
441
|
+
markedImage: {
|
|
442
|
+
type: import("vue").PropType<import("./type").MarkedImage>;
|
|
443
|
+
default: (href: string, _: string, desc: string) => string;
|
|
444
|
+
};
|
|
435
445
|
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
436
446
|
editorId: string;
|
|
437
447
|
prettier: boolean;
|
|
438
448
|
preview: boolean;
|
|
439
449
|
htmlPreview: boolean;
|
|
440
|
-
previewOnly: boolean;
|
|
441
450
|
tabWidth: number;
|
|
442
|
-
showCodeRowNumber: boolean;
|
|
443
|
-
Cropper: Function;
|
|
444
451
|
theme: "dark" | "light";
|
|
445
452
|
historyLength: number;
|
|
453
|
+
previewOnly: boolean;
|
|
454
|
+
showCodeRowNumber: boolean;
|
|
455
|
+
Cropper: Function;
|
|
446
456
|
previewTheme: import("./type").PreviewThemes;
|
|
457
|
+
iconfontJs: string;
|
|
458
|
+
prettierCDN: string;
|
|
459
|
+
prettierMDCDN: string;
|
|
460
|
+
cropperCss: string;
|
|
461
|
+
cropperJs: string;
|
|
447
462
|
style: string | import("vue").CSSProperties;
|
|
448
463
|
modelValue: string;
|
|
449
464
|
editorClass: string;
|
|
@@ -457,11 +472,6 @@ declare const _default: {
|
|
|
457
472
|
};
|
|
458
473
|
toolbars: import("./type").ToolbarNames[];
|
|
459
474
|
toolbarsExclude: import("./type").ToolbarNames[];
|
|
460
|
-
prettierCDN: string;
|
|
461
|
-
prettierMDCDN: string;
|
|
462
|
-
cropperCss: string;
|
|
463
|
-
cropperJs: string;
|
|
464
|
-
iconfontJs: string;
|
|
465
475
|
screenfull: Record<string, any>;
|
|
466
476
|
screenfullJs: string;
|
|
467
477
|
markedHeading: import("./type").MarkedHeading;
|
|
@@ -474,6 +484,7 @@ declare const _default: {
|
|
|
474
484
|
katexJs: string;
|
|
475
485
|
katexCss: string;
|
|
476
486
|
noKatex: boolean;
|
|
487
|
+
markedImage: import("./type").MarkedImage;
|
|
477
488
|
}> & {
|
|
478
489
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
479
490
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -680,6 +691,10 @@ declare const _default: {
|
|
|
680
691
|
extensions: {
|
|
681
692
|
type: import("vue").PropType<any[]>;
|
|
682
693
|
};
|
|
694
|
+
markedImage: {
|
|
695
|
+
type: import("vue").PropType<import("./type").MarkedImage>;
|
|
696
|
+
default: (href: string, _: string, desc: string) => string;
|
|
697
|
+
};
|
|
683
698
|
}>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
|
|
684
699
|
__isFragment?: undefined;
|
|
685
700
|
__isTeleport?: undefined;
|
|
@@ -870,18 +885,27 @@ declare const _default: {
|
|
|
870
885
|
extensions: {
|
|
871
886
|
type: import("vue").PropType<any[]>;
|
|
872
887
|
};
|
|
888
|
+
markedImage: {
|
|
889
|
+
type: import("vue").PropType<import("./type").MarkedImage>;
|
|
890
|
+
default: (href: string, _: string, desc: string) => string;
|
|
891
|
+
};
|
|
873
892
|
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
|
874
893
|
editorId: string;
|
|
875
894
|
prettier: boolean;
|
|
876
895
|
preview: boolean;
|
|
877
896
|
htmlPreview: boolean;
|
|
878
|
-
previewOnly: boolean;
|
|
879
897
|
tabWidth: number;
|
|
880
|
-
showCodeRowNumber: boolean;
|
|
881
|
-
Cropper: Function;
|
|
882
898
|
theme: "dark" | "light";
|
|
883
899
|
historyLength: number;
|
|
900
|
+
previewOnly: boolean;
|
|
901
|
+
showCodeRowNumber: boolean;
|
|
902
|
+
Cropper: Function;
|
|
884
903
|
previewTheme: import("./type").PreviewThemes;
|
|
904
|
+
iconfontJs: string;
|
|
905
|
+
prettierCDN: string;
|
|
906
|
+
prettierMDCDN: string;
|
|
907
|
+
cropperCss: string;
|
|
908
|
+
cropperJs: string;
|
|
885
909
|
style: string | import("vue").CSSProperties;
|
|
886
910
|
modelValue: string;
|
|
887
911
|
editorClass: string;
|
|
@@ -895,11 +919,6 @@ declare const _default: {
|
|
|
895
919
|
};
|
|
896
920
|
toolbars: import("./type").ToolbarNames[];
|
|
897
921
|
toolbarsExclude: import("./type").ToolbarNames[];
|
|
898
|
-
prettierCDN: string;
|
|
899
|
-
prettierMDCDN: string;
|
|
900
|
-
cropperCss: string;
|
|
901
|
-
cropperJs: string;
|
|
902
|
-
iconfontJs: string;
|
|
903
922
|
screenfull: Record<string, any>;
|
|
904
923
|
screenfullJs: string;
|
|
905
924
|
markedHeading: import("./type").MarkedHeading;
|
|
@@ -912,8 +931,11 @@ declare const _default: {
|
|
|
912
931
|
katexJs: string;
|
|
913
932
|
katexCss: string;
|
|
914
933
|
noKatex: boolean;
|
|
934
|
+
markedImage: import("./type").MarkedImage;
|
|
915
935
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
916
936
|
readonly NormalToolbar: typeof NormalToolbar;
|
|
917
937
|
readonly DropdownToolbar: typeof DropdownToolbar;
|
|
938
|
+
readonly Catalog: typeof Catalog;
|
|
918
939
|
};
|
|
919
940
|
export default _default;
|
|
941
|
+
export * from './type';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { MarkedHeadingId } from '../../type';
|
|
3
|
+
export interface TocItem {
|
|
4
|
+
text: string;
|
|
5
|
+
level: number;
|
|
6
|
+
children?: Array<TocItem>;
|
|
7
|
+
}
|
|
8
|
+
declare const Catalog: import("vue").DefineComponent<{
|
|
9
|
+
editorId: {
|
|
10
|
+
type: PropType<string>;
|
|
11
|
+
};
|
|
12
|
+
class: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
markedHeadingId: {
|
|
17
|
+
type: PropType<MarkedHeadingId>;
|
|
18
|
+
default: (text: string) => string;
|
|
19
|
+
};
|
|
20
|
+
scrollElement: {
|
|
21
|
+
type: PropType<string | HTMLElement>;
|
|
22
|
+
};
|
|
23
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
editorId: {
|
|
25
|
+
type: PropType<string>;
|
|
26
|
+
};
|
|
27
|
+
class: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
markedHeadingId: {
|
|
32
|
+
type: PropType<MarkedHeadingId>;
|
|
33
|
+
default: (text: string) => string;
|
|
34
|
+
};
|
|
35
|
+
scrollElement: {
|
|
36
|
+
type: PropType<string | HTMLElement>;
|
|
37
|
+
};
|
|
38
|
+
}>>, {
|
|
39
|
+
class: string;
|
|
40
|
+
markedHeadingId: MarkedHeadingId;
|
|
41
|
+
}>;
|
|
42
|
+
export default Catalog;
|
package/lib/MdEditor/type.d.ts
CHANGED
|
@@ -111,3 +111,4 @@ export declare type MarkedHeading = (text: string, level: 1 | 2 | 3 | 4 | 5 | 6,
|
|
|
111
111
|
}): string;
|
|
112
112
|
}) => string;
|
|
113
113
|
export declare type MarkedHeadingId = (text: string, level: number) => string;
|
|
114
|
+
export declare type MarkedImage = (href: string, title: string, desc: string) => string;
|