md-editor-v3 2.3.0 → 2.4.0-beta.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 CHANGED
@@ -31,6 +31,20 @@ Markdown editor for vue3, developed in `jsx` and `typescript`.
31
31
  yarn add md-editor-v3
32
32
  ```
33
33
 
34
+ Please install `@types/marked` in your typescript project if you want to configure `renderer`:
35
+
36
+ ```shell
37
+ yarn add @types/marked -D
38
+ ```
39
+
40
+ Install existing extension of language and preview theme:
41
+
42
+ ```shell
43
+ yarn add @vavt/md-editor-extension
44
+ ```
45
+
46
+ For more ways to use or contribute, please refer to: [md-editor-extension](https://github.com/imzbf/md-editor-extension)
47
+
34
48
  ## Usage
35
49
 
36
50
  ```vue
@@ -89,8 +103,9 @@ mark and emoji extensions
89
103
  | sanitize | (html: string) => string | (html) => html | Sanitize the html, prevent XSS |
90
104
  | footers | Array<'markdownTotal' \| '=' \| 'scrollSwitch' \| number> | ['markdownTotal', '=', 'scrollSwitch'] | Show contents of footer, they are divided by `'='`. Set it to `[]` to hidden footer |
91
105
  | scrollAuto | boolean | true | Scroll default setting |
92
- | noIconfont | boolean | false | Not append iconfont script, [download](https://at.alicdn.com/t/font_2605852_pqekijay2ij.js) and import it by yourself |
106
+ | noIconfont | boolean | false | Not append iconfont script, [download](https://at.alicdn.com/t/c/font_2605852_4cjr7o5jo0f.js) and import it by yourself |
93
107
  | formatCopiedText | (text: string) => string | (text: string) => text | Format copied code |
108
+ | noUploadImg | boolean | false | Not show the entrance to upload pictures |
94
109
 
95
110
  <details>
96
111
  <summary>[toolbars]</summary>
@@ -108,6 +123,7 @@ mark and emoji extensions
108
123
  'quote',
109
124
  'unorderedList',
110
125
  'orderedList',
126
+ 'task', // ^2.4.0
111
127
  '-',
112
128
  'codeRow',
113
129
  'code',
@@ -153,6 +169,7 @@ export interface ToolbarTips {
153
169
  quote?: string;
154
170
  unorderedList?: string;
155
171
  orderedList?: string;
172
+ task?: string; // ^2.4.0
156
173
  codeRow?: string;
157
174
  code?: string;
158
175
  link?: string;
@@ -197,7 +214,7 @@ export interface StaticTextDefaultValue {
197
214
  descLable?: string;
198
215
  descLablePlaceHolder?: string;
199
216
  urlLable?: string;
200
- UrlLablePlaceHolder?: string;
217
+ urlLablePlaceHolder?: string;
201
218
  buttonOK?: string;
202
219
  };
203
220
  // The modal tips of clip the picture, v1.2.0
@@ -250,8 +267,8 @@ export interface StaticTextDefaultValue {
250
267
  <template #defToolbars>
251
268
  <normal-toolbar title="mark" @onClick="handler">
252
269
  <template #trigger>
253
- <svg class="md-icon" aria-hidden="true">
254
- <use xlink:href="#icon-mark"></use>
270
+ <svg class="md-editor-icon" aria-hidden="true">
271
+ <use xlink:href="#md-editor-icon-mark"></use>
255
272
  </svg>
256
273
  </template>
257
274
  </normal-toolbar>
@@ -591,11 +608,11 @@ const onUploadImg = async (files, callback) => {
591
608
  --md-scrollbar-thumb-avtive-color: if(@isDark, #3a3a3a, #00000061);
592
609
  }
593
610
 
594
- .md {
611
+ .md-editor {
595
612
  .css-vars(false);
596
613
  }
597
614
 
598
- .md-dark {
615
+ .md-editor-dark {
599
616
  .css-vars(true);
600
617
  }
601
618
  ```
@@ -603,7 +620,7 @@ const onUploadImg = async (files, callback) => {
603
620
  Change background color in dark mode:
604
621
 
605
622
  ```css
606
- .md-dark {
623
+ .md-editor-dark {
607
624
  --md-bk-color: #333 !important;
608
625
  }
609
626
  ```
@@ -135,6 +135,9 @@ declare const Editor: import("vue").DefineComponent<{
135
135
  type: import("vue").PropType<(text: string) => string>;
136
136
  default: (text: string) => string;
137
137
  };
138
+ noUploadImg: {
139
+ type: import("vue").PropType<boolean>;
140
+ };
138
141
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
139
142
  modelValue: {
140
143
  type: import("vue").PropType<string>;
@@ -271,6 +274,9 @@ declare const Editor: import("vue").DefineComponent<{
271
274
  type: import("vue").PropType<(text: string) => string>;
272
275
  default: (text: string) => string;
273
276
  };
277
+ noUploadImg: {
278
+ type: import("vue").PropType<boolean>;
279
+ };
274
280
  }>>, {
275
281
  preview: boolean;
276
282
  htmlPreview: boolean;
@@ -1,7 +1,7 @@
1
1
  import { CodeCss, Config, ConfigOption, Footers, StaticTextDefault } from './type';
2
- export declare const prefix = "md";
2
+ export declare const prefix = "md-editor";
3
3
  export declare const iconScriptId = "md-editor-v3";
4
- export declare const iconfontUrl = "https://at.alicdn.com/t/font_2605852_pqekijay2ij.js";
4
+ export declare const iconfontUrl = "https://at.alicdn.com/t/c/font_2605852_4cjr7o5jo0f.js";
5
5
  export declare const cdnBase = "https://cdnjs.cloudflare.com/ajax/libs";
6
6
  export declare const highlightUrl: string;
7
7
  export declare const prettierUrl: {
@@ -172,6 +172,9 @@ declare const _default: {
172
172
  type: import("vue").PropType<(text: string) => string>;
173
173
  default: (text: string) => string;
174
174
  };
175
+ noUploadImg: {
176
+ type: import("vue").PropType<boolean>;
177
+ };
175
178
  }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "preview" | "htmlPreview" | "modelValue" | "theme" | "class" | "historyLength" | "pageFullScreen" | "previewOnly" | "language" | "toolbars" | "toolbarsExclude" | "noPrettier" | "editorId" | "tabWidth" | "showCodeRowNumber" | "previewTheme" | "style" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "codeTheme" | "footers" | "scrollAuto" | "formatCopiedText">;
176
179
  $attrs: {
177
180
  [x: string]: unknown;
@@ -322,6 +325,9 @@ declare const _default: {
322
325
  type: import("vue").PropType<(text: string) => string>;
323
326
  default: (text: string) => string;
324
327
  };
328
+ noUploadImg: {
329
+ type: import("vue").PropType<boolean>;
330
+ };
325
331
  }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
326
332
  preview: boolean;
327
333
  htmlPreview: boolean;
@@ -506,6 +512,9 @@ declare const _default: {
506
512
  type: import("vue").PropType<(text: string) => string>;
507
513
  default: (text: string) => string;
508
514
  };
515
+ noUploadImg: {
516
+ type: import("vue").PropType<boolean>;
517
+ };
509
518
  }>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
510
519
  __isFragment?: undefined;
511
520
  __isTeleport?: undefined;
@@ -646,6 +655,9 @@ declare const _default: {
646
655
  type: import("vue").PropType<(text: string) => string>;
647
656
  default: (text: string) => string;
648
657
  };
658
+ noUploadImg: {
659
+ type: import("vue").PropType<boolean>;
660
+ };
649
661
  }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", {
650
662
  preview: boolean;
651
663
  htmlPreview: boolean;
@@ -21,6 +21,7 @@ export interface ToolbarTips {
21
21
  quote?: string;
22
22
  unorderedList?: string;
23
23
  orderedList?: string;
24
+ task?: string;
24
25
  codeRow?: string;
25
26
  code?: string;
26
27
  link?: string;
@@ -61,7 +62,7 @@ export interface StaticTextDefaultValue {
61
62
  descLable?: string;
62
63
  descLablePlaceHolder?: string;
63
64
  urlLable?: string;
64
- UrlLablePlaceHolder?: string;
65
+ urlLablePlaceHolder?: string;
65
66
  buttonOK?: string;
66
67
  };
67
68
  clipModalTips?: {