md-editor-v3 5.3.0-0 → 5.3.0-2

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.
@@ -21,6 +21,7 @@ declare const Editor: import("vue").DefineComponent<{
21
21
  readonly showToolbarName: boolean;
22
22
  readonly inputBoxWidth: string;
23
23
  readonly transformImgUrl: (t: string) => string | Promise<string>;
24
+ readonly catalogLayout: "fixed" | "flat";
24
25
  readonly modelValue: string;
25
26
  readonly theme: import("./type").Themes;
26
27
  readonly showCodeRowNumber: boolean;
@@ -258,6 +259,7 @@ declare const Editor: import("vue").DefineComponent<{
258
259
  readonly onInput: ((event: Event) => void) | undefined;
259
260
  readonly onDrop: ((event: DragEvent) => void) | undefined;
260
261
  readonly oninputBoxWidthChange: ((width: string) => void) | undefined;
262
+ readonly onRemount: (() => void) | undefined;
261
263
  readonly id: string | undefined;
262
264
  readonly defToolbars: string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
263
265
  [key: string]: any;
@@ -268,7 +270,7 @@ declare const Editor: import("vue").DefineComponent<{
268
270
  readonly maxLength: number | undefined;
269
271
  readonly completions: import("@codemirror/autocomplete").CompletionSource[] | undefined;
270
272
  readonly editorId: string | undefined;
271
- }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue" | "onBlur" | "onFocus" | "onInput" | "onDrop" | "oninputBoxWidthChange", import("vue").PublicProps, Readonly<{
273
+ }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("./type").EditorEmits, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue" | "onBlur" | "onFocus" | "onInput" | "onDrop" | "oninputBoxWidthChange" | "onRemount", import("vue").PublicProps, Readonly<{
272
274
  readonly preview: boolean;
273
275
  readonly pageFullscreen: boolean;
274
276
  readonly htmlPreview: boolean;
@@ -291,6 +293,7 @@ declare const Editor: import("vue").DefineComponent<{
291
293
  readonly showToolbarName: boolean;
292
294
  readonly inputBoxWidth: string;
293
295
  readonly transformImgUrl: (t: string) => string | Promise<string>;
296
+ readonly catalogLayout: "fixed" | "flat";
294
297
  readonly modelValue: string;
295
298
  readonly theme: import("./type").Themes;
296
299
  readonly showCodeRowNumber: boolean;
@@ -528,6 +531,7 @@ declare const Editor: import("vue").DefineComponent<{
528
531
  readonly onInput: ((event: Event) => void) | undefined;
529
532
  readonly onDrop: ((event: DragEvent) => void) | undefined;
530
533
  readonly oninputBoxWidthChange: ((width: string) => void) | undefined;
534
+ readonly onRemount: (() => void) | undefined;
531
535
  readonly id: string | undefined;
532
536
  readonly defToolbars: string | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
533
537
  [key: string]: any;
@@ -551,6 +555,7 @@ declare const Editor: import("vue").DefineComponent<{
551
555
  onOnInput?: ((...args: any[]) => any) | undefined;
552
556
  onOnDrop?: ((...args: any[]) => any) | undefined;
553
557
  onOninputBoxWidthChange?: ((...args: any[]) => any) | undefined;
558
+ onOnRemount?: ((...args: any[]) => any) | undefined;
554
559
  }>, {
555
560
  preview: boolean;
556
561
  pageFullscreen: boolean;
@@ -566,6 +571,7 @@ declare const Editor: import("vue").DefineComponent<{
566
571
  onInput: (event: Event) => void;
567
572
  onDrop: (event: DragEvent) => void;
568
573
  oninputBoxWidthChange: (width: string) => void;
574
+ onRemount: () => void;
569
575
  style: string | import("vue").CSSProperties;
570
576
  class: string;
571
577
  id: string;
@@ -594,6 +600,7 @@ declare const Editor: import("vue").DefineComponent<{
594
600
  showToolbarName: boolean;
595
601
  inputBoxWidth: string;
596
602
  transformImgUrl: (t: string) => string | Promise<string>;
603
+ catalogLayout: "fixed" | "flat";
597
604
  modelValue: string;
598
605
  theme: import("./type").Themes;
599
606
  editorId: string;
@@ -26,5 +26,6 @@ export declare const configOption: ConfigOption;
26
26
  export declare const config: Config;
27
27
  /**
28
28
  * 拖拽时最小的宽度
29
+ * 5.3.0开始使用百分比,不能小于10%
29
30
  */
30
- export declare const MinInputBoxWidth = 170;
31
+ export declare const MinInputBoxWidth = 0.1;
@@ -15,6 +15,7 @@ declare const ContentPreview: import("vue").DefineComponent<{
15
15
  readonly formatCopiedText: (text: string) => string;
16
16
  readonly noHighlight: boolean;
17
17
  readonly setting: import("../../type").SettingType;
18
+ readonly onRemount: (() => void) | undefined;
18
19
  readonly noImgZoomIn: boolean | undefined;
19
20
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
20
21
  readonly codeFoldable: boolean | undefined;
@@ -32,6 +33,7 @@ declare const ContentPreview: import("vue").DefineComponent<{
32
33
  readonly formatCopiedText: (text: string) => string;
33
34
  readonly noHighlight: boolean;
34
35
  readonly setting: import("../../type").SettingType;
36
+ readonly onRemount: (() => void) | undefined;
35
37
  readonly noImgZoomIn: boolean | undefined;
36
38
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
37
39
  readonly codeFoldable: boolean | undefined;
@@ -5,4 +5,5 @@ import useCopyCode from './useCopyCode';
5
5
  import useMarkdownIt from './useMarkdownIt';
6
6
  import useResize from './useResize';
7
7
  export * from './useTaskState';
8
+ export * from './useRemount';
8
9
  export { useAutoScroll, useCodeMirror, userZoom, useCopyCode, useMarkdownIt, useResize };
@@ -0,0 +1,3 @@
1
+ import { Ref } from 'vue';
2
+ import { ContentPreviewProps } from '../ContentPreview';
3
+ export declare const useRemount: (props: ContentPreviewProps, html: Ref<string>, key: Ref<string>) => void;
@@ -8,6 +8,5 @@ declare const useResize: (props: ContentProps, contentRef: Ref<HTMLDivElement |
8
8
  left: string | undefined;
9
9
  display: string;
10
10
  };
11
- showPreviewWrapper: Ref<boolean, boolean>;
12
11
  };
13
12
  export default useResize;
@@ -20,12 +20,14 @@ declare const _default: import("vue").DefineComponent<{
20
20
  readonly updateModelValue: (v: string) => void;
21
21
  readonly onInput: ((event: Event) => void) | undefined;
22
22
  readonly oninputBoxWidthChange: ((width: string) => void) | undefined;
23
+ readonly onRemount: (() => void) | undefined;
23
24
  readonly noPrettier: boolean | undefined;
24
25
  readonly scrollAuto: boolean | undefined;
25
26
  readonly disabled: boolean | undefined;
26
27
  readonly autoDetectCode: boolean | undefined;
27
28
  readonly completions: import("@codemirror/autocomplete").CompletionSource[] | undefined;
28
29
  readonly inputBoxWidth: string | undefined;
30
+ readonly catalogLayout: "fixed" | "flat" | undefined;
29
31
  readonly noImgZoomIn: boolean | undefined;
30
32
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
31
33
  readonly codeFoldable: boolean | undefined;
@@ -56,12 +58,14 @@ declare const _default: import("vue").DefineComponent<{
56
58
  readonly updateModelValue: (v: string) => void;
57
59
  readonly onInput: ((event: Event) => void) | undefined;
58
60
  readonly oninputBoxWidthChange: ((width: string) => void) | undefined;
61
+ readonly onRemount: (() => void) | undefined;
59
62
  readonly noPrettier: boolean | undefined;
60
63
  readonly scrollAuto: boolean | undefined;
61
64
  readonly disabled: boolean | undefined;
62
65
  readonly autoDetectCode: boolean | undefined;
63
66
  readonly completions: import("@codemirror/autocomplete").CompletionSource[] | undefined;
64
67
  readonly inputBoxWidth: string | undefined;
68
+ readonly catalogLayout: "fixed" | "flat" | undefined;
65
69
  readonly noImgZoomIn: boolean | undefined;
66
70
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
67
71
  readonly codeFoldable: boolean | undefined;
@@ -15,6 +15,7 @@ export interface CodeTabsPluginOps extends markdownit.Options {
15
15
  codeFoldable: boolean;
16
16
  autoFoldThreshold: number;
17
17
  customIconRef: ComputedRef<CustomIcon>;
18
+ extraTools?: string;
18
19
  }
19
20
  declare const codetabs: (md: markdownit, _opts: CodeTabsPluginOps) => void;
20
21
  export default codetabs;
@@ -65,6 +65,9 @@ export declare const contentPreviewProps: {
65
65
  autoFoldThreshold: {
66
66
  type: PropType<number>;
67
67
  };
68
+ onRemount: {
69
+ type: PropType<() => void>;
70
+ };
68
71
  };
69
72
  export declare const contentProps: {
70
73
  updateModelValue: {
@@ -137,6 +140,9 @@ export declare const contentProps: {
137
140
  type: PropType<(t: string) => string | Promise<string>>;
138
141
  default: (t: string) => string;
139
142
  };
143
+ catalogLayout: {
144
+ type: PropType<"fixed" | "flat">;
145
+ };
140
146
  modelValue: {
141
147
  type: PropType<string>;
142
148
  default: string;
@@ -199,5 +205,8 @@ export declare const contentProps: {
199
205
  autoFoldThreshold: {
200
206
  type: PropType<number>;
201
207
  };
208
+ onRemount: {
209
+ type: PropType<() => void>;
210
+ };
202
211
  };
203
212
  export type ContentProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof contentProps>>>>;
@@ -220,6 +220,15 @@ export declare const mdPreviewProps: {
220
220
  type: PropType<number>;
221
221
  default: number;
222
222
  };
223
+ /**
224
+ * 内容重新挂载事件
225
+ *
226
+ * 相比起onHtmlChanged,onRemount会在重新挂载后触发
227
+ */
228
+ onRemount: {
229
+ type: PropType<() => void>;
230
+ default: undefined;
231
+ };
223
232
  };
224
233
  export declare const editorProps: {
225
234
  /**
@@ -491,6 +500,20 @@ export declare const editorProps: {
491
500
  type: PropType<(t: string) => string | Promise<string>>;
492
501
  default: (t: string) => string;
493
502
  };
503
+ /**
504
+ * 内置的目录显示的状态
505
+ *
506
+ * 'fixed': 悬浮在内容上方
507
+ * 'flat': 展示在右侧
508
+ *
509
+ * \>=5.3.0
510
+ *
511
+ * @default 'fixed'
512
+ */
513
+ catalogLayout: {
514
+ type: PropType<"fixed" | "flat">;
515
+ default: string;
516
+ };
494
517
  /**
495
518
  * markdown content.
496
519
  *
@@ -708,6 +731,15 @@ export declare const editorProps: {
708
731
  type: PropType<number>;
709
732
  default: number;
710
733
  };
734
+ /**
735
+ * 内容重新挂载事件
736
+ *
737
+ * 相比起onHtmlChanged,onRemount会在重新挂载后触发
738
+ */
739
+ onRemount: {
740
+ type: PropType<() => void>;
741
+ default: undefined;
742
+ };
711
743
  };
712
744
  export declare const mdPreviewEmits: EditorEmits;
713
745
  export declare const editorEmits: EditorEmits;
@@ -461,7 +461,7 @@ export interface ExposeParam {
461
461
  export type ExposePreviewParam = Pick<ExposeParam, 'rerender'>;
462
462
  export type EditorProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof editorProps>>>>;
463
463
  export type MdPreviewProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof mdPreviewProps>>>>;
464
- export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput' | 'onDrop' | 'oninputBoxWidthChange'>;
464
+ export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput' | 'onDrop' | 'oninputBoxWidthChange' | 'onRemount'>;
465
465
  export type EditorContext = SetupContext<EditorEmits>;
466
466
  /**
467
467
  * 自定义图标的数据类型
@@ -231,9 +231,10 @@ declare const MdPreview: import("vue").DefineComponent<{
231
231
  readonly onChange: import("../MdEditor/type").ChangeEvent | undefined;
232
232
  readonly onHtmlChanged: import("../MdEditor/type").HtmlChangedEvent | undefined;
233
233
  readonly onGetCatalog: import("../MdEditor/type").GetCatalogEvent | undefined;
234
+ readonly onRemount: (() => void) | undefined;
234
235
  readonly id: string | undefined;
235
236
  readonly editorId: string | undefined;
236
- }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("../MdEditor/type").EditorEmits, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue" | "onBlur" | "onFocus" | "onInput" | "onDrop" | "oninputBoxWidthChange", import("vue").PublicProps, Readonly<{
237
+ }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("../MdEditor/type").EditorEmits, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue" | "onBlur" | "onFocus" | "onInput" | "onDrop" | "oninputBoxWidthChange" | "onRemount", import("vue").PublicProps, Readonly<{
237
238
  readonly style: string | import("vue").CSSProperties;
238
239
  readonly class: string;
239
240
  readonly language: string;
@@ -466,6 +467,7 @@ declare const MdPreview: import("vue").DefineComponent<{
466
467
  readonly onChange: import("../MdEditor/type").ChangeEvent | undefined;
467
468
  readonly onHtmlChanged: import("../MdEditor/type").HtmlChangedEvent | undefined;
468
469
  readonly onGetCatalog: import("../MdEditor/type").GetCatalogEvent | undefined;
470
+ readonly onRemount: (() => void) | undefined;
469
471
  readonly id: string | undefined;
470
472
  readonly editorId: string | undefined;
471
473
  }> & Readonly<{
@@ -481,10 +483,12 @@ declare const MdPreview: import("vue").DefineComponent<{
481
483
  onOnInput?: ((...args: any[]) => any) | undefined;
482
484
  onOnDrop?: ((...args: any[]) => any) | undefined;
483
485
  onOninputBoxWidthChange?: ((...args: any[]) => any) | undefined;
486
+ onOnRemount?: ((...args: any[]) => any) | undefined;
484
487
  }>, {
485
488
  onChange: import("../MdEditor/type").ChangeEvent;
486
489
  onHtmlChanged: import("../MdEditor/type").HtmlChangedEvent;
487
490
  onGetCatalog: import("../MdEditor/type").GetCatalogEvent;
491
+ onRemount: () => void;
488
492
  style: string | import("vue").CSSProperties;
489
493
  class: string;
490
494
  id: string;