md-editor-v3 1.10.1 → 1.11.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 +59 -28
- package/lib/MdEditor/Editor.d.ts +20 -11
- package/lib/MdEditor/index.d.ts +50 -29
- package/lib/MdEditor/layouts/Catalog/index.d.ts +51 -0
- package/lib/MdEditor/type.d.ts +2 -0
- package/lib/md-editor-v3.es.js +274 -171
- package/lib/md-editor-v3.umd.js +58 -57
- package/lib/style.css +1 -1
- package/package.json +3 -3
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,17 @@ 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 |
|
|
232
|
+
| markedImage | (href: string, title: string, desc: string) => string | :marked-image="xxx" | Overrides the html element structure of the default generated picture |
|
|
234
233
|
|
|
235
234
|
> If `markedHeading` is overridden, be sure to tell the editor the algorithm for generating the title ID by `marketheadingid`.
|
|
236
235
|
|
|
@@ -263,7 +262,39 @@ export interface StaticTextDefaultValue {
|
|
|
263
262
|
| CTRL + ALT + C | code row | | v1.0.0 |
|
|
264
263
|
| CTRL + SHIFT + ALT + T | table | `\|table\|` | v1.4.0 |
|
|
265
264
|
|
|
266
|
-
##
|
|
265
|
+
## Internal components
|
|
266
|
+
|
|
267
|
+
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).
|
|
268
|
+
|
|
269
|
+
### NormalToolbar
|
|
270
|
+
|
|
271
|
+
`Editor.NormalToolbar`
|
|
272
|
+
|
|
273
|
+
- `title`: `string`, not necessary, the tips when hover toolbar;
|
|
274
|
+
- `trigger`: `string | JSX.Element`, necessary, it is usually an icon, which is displayed on the toolbar;
|
|
275
|
+
- `onClick`: `(e: MouseEvent) => void`, necessary.
|
|
276
|
+
|
|
277
|
+
### DropdownToolbar
|
|
278
|
+
|
|
279
|
+
`Editor.DropdownToolbar`
|
|
280
|
+
|
|
281
|
+
- `title`: `string`, not necessary, the tips when hover toolbar;
|
|
282
|
+
- `visible`: `boolean`, necessary;
|
|
283
|
+
- `trigger`: `string | JSX.Element`, necessary, it is usually an icon, which is displayed on the toolbar;
|
|
284
|
+
- `onChange`: `(visible: boolean) => void`, necessary;
|
|
285
|
+
- `overlay`: `string | JSX.Element`, necessary, contents in the drop-down box.
|
|
286
|
+
|
|
287
|
+
### Catalogue
|
|
288
|
+
|
|
289
|
+
`Editor.Catalog`
|
|
290
|
+
|
|
291
|
+
- `editorId`: `string`, necessary, editor's `editorId`, used to register listening events;
|
|
292
|
+
- `class`: `string`, not necessary;
|
|
293
|
+
- `markedHeadingId`: `MarkedHeadingId`, not necessary, same as editor;
|
|
294
|
+
- `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`.
|
|
295
|
+
- `theme`: 'light' | 'dark', not necessary, provide it when you want to change theme online, it is the same as Editor `theme`.
|
|
296
|
+
|
|
297
|
+
## Some examples
|
|
267
298
|
|
|
268
299
|
### Jsx module
|
|
269
300
|
|
|
@@ -313,7 +344,7 @@ export default defineComponent({
|
|
|
313
344
|
|
|
314
345
|
### Upload picture
|
|
315
346
|
|
|
316
|
-
> Tips:When you paste and upload GIF
|
|
347
|
+
> Tips:When you paste and upload GIF, it will upload a static picture. So you should upload it by file system!
|
|
317
348
|
|
|
318
349
|
```js
|
|
319
350
|
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, Themes } from './type';
|
|
3
3
|
export declare const markedHeadingId: MarkedHeadingId;
|
|
4
4
|
declare const _default: import("vue").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
7
|
default: string;
|
|
8
8
|
};
|
|
9
9
|
theme: {
|
|
10
|
-
type: PropType<
|
|
10
|
+
type: PropType<Themes>;
|
|
11
11
|
default: string;
|
|
12
12
|
};
|
|
13
13
|
editorClass: {
|
|
@@ -187,13 +187,17 @@ 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>;
|
|
193
197
|
default: string;
|
|
194
198
|
};
|
|
195
199
|
theme: {
|
|
196
|
-
type: PropType<
|
|
200
|
+
type: PropType<Themes>;
|
|
197
201
|
default: string;
|
|
198
202
|
};
|
|
199
203
|
editorClass: {
|
|
@@ -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;
|
|
390
|
+
theme: Themes;
|
|
391
|
+
historyLength: number;
|
|
392
|
+
previewOnly: boolean;
|
|
383
393
|
showCodeRowNumber: boolean;
|
|
384
394
|
Cropper: Function;
|
|
385
|
-
theme: "dark" | "light";
|
|
386
|
-
historyLength: number;
|
|
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
|
+
theme: import("./type").Themes;
|
|
15
|
+
historyLength: number;
|
|
16
|
+
previewOnly: boolean;
|
|
14
17
|
showCodeRowNumber: boolean;
|
|
15
18
|
Cropper: Function;
|
|
16
|
-
theme: "dark" | "light";
|
|
17
|
-
historyLength: number;
|
|
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,13 +47,14 @@ 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>;
|
|
52
54
|
default: string;
|
|
53
55
|
};
|
|
54
56
|
theme: {
|
|
55
|
-
type: import("vue").PropType<"
|
|
57
|
+
type: import("vue").PropType<import("./type").Themes>;
|
|
56
58
|
default: string;
|
|
57
59
|
};
|
|
58
60
|
editorClass: {
|
|
@@ -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
|
};
|
|
@@ -252,7 +258,7 @@ declare const _default: {
|
|
|
252
258
|
default: string;
|
|
253
259
|
};
|
|
254
260
|
theme: {
|
|
255
|
-
type: import("vue").PropType<"
|
|
261
|
+
type: import("vue").PropType<import("./type").Themes>;
|
|
256
262
|
default: string;
|
|
257
263
|
};
|
|
258
264
|
editorClass: {
|
|
@@ -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;
|
|
451
|
+
theme: import("./type").Themes;
|
|
452
|
+
historyLength: number;
|
|
453
|
+
previewOnly: boolean;
|
|
442
454
|
showCodeRowNumber: boolean;
|
|
443
455
|
Cropper: Function;
|
|
444
|
-
theme: "dark" | "light";
|
|
445
|
-
historyLength: number;
|
|
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;
|
|
@@ -500,7 +511,7 @@ declare const _default: {
|
|
|
500
511
|
default: string;
|
|
501
512
|
};
|
|
502
513
|
theme: {
|
|
503
|
-
type: import("vue").PropType<"
|
|
514
|
+
type: import("vue").PropType<import("./type").Themes>;
|
|
504
515
|
default: string;
|
|
505
516
|
};
|
|
506
517
|
editorClass: {
|
|
@@ -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;
|
|
@@ -690,7 +705,7 @@ declare const _default: {
|
|
|
690
705
|
default: string;
|
|
691
706
|
};
|
|
692
707
|
theme: {
|
|
693
|
-
type: import("vue").PropType<"
|
|
708
|
+
type: import("vue").PropType<import("./type").Themes>;
|
|
694
709
|
default: string;
|
|
695
710
|
};
|
|
696
711
|
editorClass: {
|
|
@@ -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;
|
|
898
|
+
theme: import("./type").Themes;
|
|
899
|
+
historyLength: number;
|
|
900
|
+
previewOnly: boolean;
|
|
880
901
|
showCodeRowNumber: boolean;
|
|
881
902
|
Cropper: Function;
|
|
882
|
-
theme: "dark" | "light";
|
|
883
|
-
historyLength: number;
|
|
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,9 +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;
|
|
920
941
|
export * from './type';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { MarkedHeadingId, Themes } 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
|
+
theme: {
|
|
24
|
+
type: PropType<Themes>;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
}, () => 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<{
|
|
28
|
+
editorId: {
|
|
29
|
+
type: PropType<string>;
|
|
30
|
+
};
|
|
31
|
+
class: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
markedHeadingId: {
|
|
36
|
+
type: PropType<MarkedHeadingId>;
|
|
37
|
+
default: (text: string) => string;
|
|
38
|
+
};
|
|
39
|
+
scrollElement: {
|
|
40
|
+
type: PropType<string | HTMLElement>;
|
|
41
|
+
};
|
|
42
|
+
theme: {
|
|
43
|
+
type: PropType<Themes>;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
}>>, {
|
|
47
|
+
theme: Themes;
|
|
48
|
+
class: string;
|
|
49
|
+
markedHeadingId: MarkedHeadingId;
|
|
50
|
+
}>;
|
|
51
|
+
export default Catalog;
|
package/lib/MdEditor/type.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ export interface SettingType {
|
|
|
97
97
|
preview: boolean;
|
|
98
98
|
htmlPreview: boolean;
|
|
99
99
|
}
|
|
100
|
+
export declare type Themes = 'light' | 'dark';
|
|
100
101
|
export declare type PreviewThemes = 'default' | 'github' | 'vuepress';
|
|
101
102
|
export interface HeadList {
|
|
102
103
|
text: string;
|
|
@@ -111,3 +112,4 @@ export declare type MarkedHeading = (text: string, level: 1 | 2 | 3 | 4 | 5 | 6,
|
|
|
111
112
|
}): string;
|
|
112
113
|
}) => string;
|
|
113
114
|
export declare type MarkedHeadingId = (text: string, level: number) => string;
|
|
115
|
+
export declare type MarkedImage = (href: string, title: string, desc: string) => string;
|