md-editor-v3 3.0.1 → 4.0.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.
Files changed (103) hide show
  1. package/README.md +131 -95
  2. package/lib/cjs/DropdownToolbar.cjs +1 -0
  3. package/lib/cjs/MdCatalog.cjs +1 -0
  4. package/lib/cjs/MdEditor.cjs +60 -0
  5. package/lib/cjs/MdPreview.cjs +1 -0
  6. package/lib/cjs/ModalToolbar.cjs +1 -0
  7. package/lib/cjs/NormalToolbar.cjs +1 -0
  8. package/lib/cjs/chunks/config.cjs +1 -0
  9. package/lib/cjs/chunks/dom.cjs +1 -0
  10. package/lib/cjs/chunks/event-bus.cjs +1 -0
  11. package/lib/cjs/chunks/index.cjs +8 -0
  12. package/lib/cjs/chunks/index2.cjs +1 -0
  13. package/lib/cjs/chunks/index3.cjs +1 -0
  14. package/lib/cjs/chunks/index4.cjs +2 -0
  15. package/lib/cjs/chunks/vue-tsx.cjs +1 -0
  16. package/lib/cjs/config.cjs +1 -0
  17. package/lib/cjs/index.cjs +1 -0
  18. package/lib/es/DropdownToolbar.mjs +7 -0
  19. package/lib/es/MdCatalog.mjs +215 -0
  20. package/lib/es/MdEditor.mjs +2286 -0
  21. package/lib/es/MdPreview.mjs +15 -0
  22. package/lib/es/ModalToolbar.mjs +9 -0
  23. package/lib/es/NormalToolbar.mjs +39 -0
  24. package/lib/es/chunks/config.mjs +271 -0
  25. package/lib/es/chunks/dom.mjs +32 -0
  26. package/lib/es/chunks/event-bus.mjs +38 -0
  27. package/lib/es/chunks/index.mjs +1061 -0
  28. package/lib/es/chunks/index2.mjs +135 -0
  29. package/lib/es/chunks/index3.mjs +229 -0
  30. package/lib/es/chunks/index4.mjs +57 -0
  31. package/lib/es/chunks/vue-tsx.mjs +11 -0
  32. package/lib/es/config.mjs +4 -0
  33. package/lib/es/index.mjs +35 -0
  34. package/lib/preview.css +1 -0
  35. package/lib/style.css +1 -1
  36. package/lib/types/DropdownToolbar/index.d.ts +129 -0
  37. package/lib/{MdEditor/extensions → types}/MdCatalog/CatalogLink.d.ts +4 -4
  38. package/lib/{MdEditor/extensions/MdCatalog/index.d.ts → types/MdCatalog/MdCatalog.d.ts} +3 -3
  39. package/lib/types/MdCatalog/index.d.ts +193 -0
  40. package/lib/{MdEditor → types/MdEditor}/Editor.d.ts +153 -162
  41. package/lib/types/MdEditor/components/Checkbox/index.d.ts +24 -0
  42. package/lib/types/MdEditor/components/Divider/index.d.ts +2 -0
  43. package/lib/types/MdEditor/components/Dropdown/index.d.ts +53 -0
  44. package/lib/types/MdEditor/components/Modal/index.d.ts +84 -0
  45. package/lib/types/MdEditor/composition.d.ts +66 -0
  46. package/lib/{MdEditor → types/MdEditor}/index.d.ts +343 -388
  47. package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +154 -0
  48. package/lib/types/MdEditor/layouts/Content/codemirror/commands.d.ts +4 -0
  49. package/lib/types/MdEditor/layouts/Content/codemirror/index.d.ts +56 -0
  50. package/lib/types/MdEditor/layouts/Content/codemirror/themeLight.d.ts +23 -0
  51. package/lib/types/MdEditor/layouts/Content/codemirror/themeOneDark.d.ts +26 -0
  52. package/lib/types/MdEditor/layouts/Content/composition/index.d.ts +6 -0
  53. package/lib/types/MdEditor/layouts/Content/composition/useAttach.d.ts +7 -0
  54. package/lib/types/MdEditor/layouts/Content/composition/useAutoScroll.d.ts +5 -0
  55. package/lib/types/MdEditor/layouts/Content/composition/useCodeMirror.d.ts +13 -0
  56. package/lib/types/MdEditor/layouts/Content/composition/useCopyCode.d.ts +4 -0
  57. package/lib/types/MdEditor/layouts/Content/composition/useHighlight.d.ts +8 -0
  58. package/lib/types/MdEditor/layouts/Content/composition/useKatex.d.ts +8 -0
  59. package/lib/types/MdEditor/layouts/Content/composition/useMarkdownIt.d.ts +5 -0
  60. package/lib/types/MdEditor/layouts/Content/composition/useMermaid.d.ts +11 -0
  61. package/lib/types/MdEditor/layouts/Content/composition/usePasteUpload.d.ts +6 -0
  62. package/lib/types/MdEditor/layouts/Content/composition/userZoom.d.ts +10 -0
  63. package/lib/types/MdEditor/layouts/Content/index.d.ts +173 -0
  64. package/lib/types/MdEditor/layouts/Content/markdownIt/admonition/index.d.ts +5 -0
  65. package/lib/types/MdEditor/layouts/Content/markdownIt/codetabs/index.d.ts +14 -0
  66. package/lib/types/MdEditor/layouts/Content/markdownIt/heading/index.d.ts +9 -0
  67. package/lib/types/MdEditor/layouts/Content/markdownIt/katex/index.d.ts +10 -0
  68. package/lib/types/MdEditor/layouts/Content/markdownIt/mermaid/index.d.ts +6 -0
  69. package/lib/types/MdEditor/layouts/Content/props.d.ts +89 -0
  70. package/lib/types/MdEditor/layouts/Footer/MarkdownTotal.d.ts +15 -0
  71. package/lib/types/MdEditor/layouts/Footer/ScrollAuto.d.ts +21 -0
  72. package/lib/types/MdEditor/layouts/Footer/index.d.ts +50 -0
  73. package/lib/types/MdEditor/layouts/Modals/Clip.d.ts +33 -0
  74. package/lib/types/MdEditor/layouts/Modals/Link.d.ts +42 -0
  75. package/lib/types/MdEditor/layouts/Modals/index.d.ts +51 -0
  76. package/lib/types/MdEditor/layouts/Toolbar/TableShape.d.ts +28 -0
  77. package/lib/types/MdEditor/layouts/Toolbar/composition.d.ts +4 -0
  78. package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +91 -0
  79. package/lib/types/MdEditor/layouts/Toolbar/props.d.ts +45 -0
  80. package/lib/types/MdEditor/props.d.ts +546 -0
  81. package/lib/types/MdEditor/static/event-name.d.ts +9 -0
  82. package/lib/{MdEditor → types/MdEditor}/type.d.ts +2 -1
  83. package/lib/types/MdEditor/utils/content-help.d.ts +19 -0
  84. package/lib/types/MdEditor/utils/dom.d.ts +22 -0
  85. package/lib/types/MdEditor/utils/event-bus.d.ts +17 -0
  86. package/lib/types/MdEditor/utils/index.d.ts +66 -0
  87. package/lib/types/MdEditor/utils/scroll-auto.d.ts +18 -0
  88. package/lib/types/MdEditor/utils/smooth-scroll.d.ts +8 -0
  89. package/lib/types/MdEditor/utils/vue-tsx.d.ts +23 -0
  90. package/lib/types/MdPreview/MdPreview.d.ts +186 -0
  91. package/lib/types/MdPreview/index.d.ts +453 -0
  92. package/lib/types/ModalToolbar/index.d.ts +244 -0
  93. package/lib/types/NormalToolbar/index.d.ts +105 -0
  94. package/lib/types/config.d.ts +1 -0
  95. package/lib/types/index.d.ts +8 -0
  96. package/lib/{md-editor-v3.umd.js → umd/index.js} +38 -38
  97. package/package.json +16 -20
  98. package/lib/md-editor-v3.cjs +0 -63
  99. package/lib/md-editor-v3.mjs +0 -4143
  100. /package/lib/{MdEditor/extensions → types/DropdownToolbar}/DropdownToolbar.d.ts +0 -0
  101. /package/lib/{MdEditor → types/MdEditor}/config.d.ts +0 -0
  102. /package/lib/{MdEditor/extensions → types/ModalToolbar}/ModalToolbar.d.ts +0 -0
  103. /package/lib/{MdEditor/extensions → types/NormalToolbar}/NormalToolbar.d.ts +0 -0
@@ -0,0 +1,15 @@
1
+ import { PropType } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ modelValue: {
4
+ type: PropType<string>;
5
+ default: string;
6
+ };
7
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ modelValue: {
9
+ type: PropType<string>;
10
+ default: string;
11
+ };
12
+ }>>, {
13
+ modelValue: string;
14
+ }>;
15
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { PropType, ExtractPropTypes } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ scrollAuto: {
4
+ type: PropType<boolean>;
5
+ };
6
+ onScrollAutoChange: {
7
+ type: PropType<(v: boolean) => void>;
8
+ default: () => void;
9
+ };
10
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
11
+ scrollAuto: {
12
+ type: PropType<boolean>;
13
+ };
14
+ onScrollAutoChange: {
15
+ type: PropType<(v: boolean) => void>;
16
+ default: () => void;
17
+ };
18
+ }>>, {
19
+ onScrollAutoChange: (v: boolean) => void;
20
+ }>;
21
+ export default _default;
@@ -0,0 +1,50 @@
1
+ import { PropType, VNode, ExtractPropTypes } from 'vue';
2
+ import { Footers } from '../../type';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ modelValue: {
5
+ type: PropType<string>;
6
+ default: string;
7
+ };
8
+ footers: {
9
+ type: PropType<Footers[]>;
10
+ default: never[];
11
+ };
12
+ scrollAuto: {
13
+ type: PropType<boolean>;
14
+ };
15
+ onScrollAutoChange: {
16
+ type: PropType<(v: boolean) => void>;
17
+ default: () => void;
18
+ };
19
+ defFooters: {
20
+ type: PropType<VNode<import("vue").RendererNode, import("vue").RendererElement, {
21
+ [key: string]: any;
22
+ }>>;
23
+ };
24
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
25
+ modelValue: {
26
+ type: PropType<string>;
27
+ default: string;
28
+ };
29
+ footers: {
30
+ type: PropType<Footers[]>;
31
+ default: never[];
32
+ };
33
+ scrollAuto: {
34
+ type: PropType<boolean>;
35
+ };
36
+ onScrollAutoChange: {
37
+ type: PropType<(v: boolean) => void>;
38
+ default: () => void;
39
+ };
40
+ defFooters: {
41
+ type: PropType<VNode<import("vue").RendererNode, import("vue").RendererElement, {
42
+ [key: string]: any;
43
+ }>>;
44
+ };
45
+ }>>, {
46
+ footers: Footers[];
47
+ modelValue: string;
48
+ onScrollAutoChange: (v: boolean) => void;
49
+ }>;
50
+ export default _default;
@@ -0,0 +1,33 @@
1
+ import { PropType, ExtractPropTypes } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ visible: {
4
+ type: PropType<boolean>;
5
+ default: boolean;
6
+ };
7
+ onCancel: {
8
+ type: PropType<() => void>;
9
+ default: () => void;
10
+ };
11
+ onOk: {
12
+ type: PropType<(data?: any) => void>;
13
+ default: () => void;
14
+ };
15
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
16
+ visible: {
17
+ type: PropType<boolean>;
18
+ default: boolean;
19
+ };
20
+ onCancel: {
21
+ type: PropType<() => void>;
22
+ default: () => void;
23
+ };
24
+ onOk: {
25
+ type: PropType<(data?: any) => void>;
26
+ default: () => void;
27
+ };
28
+ }>>, {
29
+ visible: boolean;
30
+ onCancel: () => void;
31
+ onOk: (data?: any) => void;
32
+ }>;
33
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import { PropType, ExtractPropTypes } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ type: {
4
+ type: PropType<"link" | "image" | "help">;
5
+ default: string;
6
+ };
7
+ visible: {
8
+ type: PropType<boolean>;
9
+ default: boolean;
10
+ };
11
+ onCancel: {
12
+ type: PropType<() => void>;
13
+ default: () => void;
14
+ };
15
+ onOk: {
16
+ type: PropType<(data?: any) => void>;
17
+ default: () => void;
18
+ };
19
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
20
+ type: {
21
+ type: PropType<"link" | "image" | "help">;
22
+ default: string;
23
+ };
24
+ visible: {
25
+ type: PropType<boolean>;
26
+ default: boolean;
27
+ };
28
+ onCancel: {
29
+ type: PropType<() => void>;
30
+ default: () => void;
31
+ };
32
+ onOk: {
33
+ type: PropType<(data?: any) => void>;
34
+ default: () => void;
35
+ };
36
+ }>>, {
37
+ visible: boolean;
38
+ type: "link" | "image" | "help";
39
+ onCancel: () => void;
40
+ onOk: (data?: any) => void;
41
+ }>;
42
+ export default _default;
@@ -0,0 +1,51 @@
1
+ import { PropType, ExtractPropTypes } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ type: {
4
+ type: PropType<"link" | "image" | "help">;
5
+ default: string;
6
+ };
7
+ linkVisible: {
8
+ type: PropType<boolean>;
9
+ default: boolean;
10
+ };
11
+ clipVisible: {
12
+ type: PropType<boolean>;
13
+ default: boolean;
14
+ };
15
+ onCancel: {
16
+ type: PropType<() => void>;
17
+ default: () => void;
18
+ };
19
+ onOk: {
20
+ type: PropType<(data?: any) => void>;
21
+ default: () => void;
22
+ };
23
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
24
+ type: {
25
+ type: PropType<"link" | "image" | "help">;
26
+ default: string;
27
+ };
28
+ linkVisible: {
29
+ type: PropType<boolean>;
30
+ default: boolean;
31
+ };
32
+ clipVisible: {
33
+ type: PropType<boolean>;
34
+ default: boolean;
35
+ };
36
+ onCancel: {
37
+ type: PropType<() => void>;
38
+ default: () => void;
39
+ };
40
+ onOk: {
41
+ type: PropType<(data?: any) => void>;
42
+ default: () => void;
43
+ };
44
+ }>>, {
45
+ type: "link" | "image" | "help";
46
+ onCancel: () => void;
47
+ onOk: (data?: any) => void;
48
+ linkVisible: boolean;
49
+ clipVisible: boolean;
50
+ }>;
51
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { PropType, ExtractPropTypes } from 'vue';
2
+ interface HoverData {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ declare const TableShape: import("vue").DefineComponent<{
7
+ tableShape: {
8
+ type: PropType<number[]>;
9
+ default: () => number[];
10
+ };
11
+ onSelected: {
12
+ type: PropType<(data: HoverData) => void>;
13
+ default: () => void;
14
+ };
15
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
16
+ tableShape: {
17
+ type: PropType<number[]>;
18
+ default: () => number[];
19
+ };
20
+ onSelected: {
21
+ type: PropType<(data: HoverData) => void>;
22
+ default: () => void;
23
+ };
24
+ }>>, {
25
+ tableShape: number[];
26
+ onSelected: (data: HoverData) => void;
27
+ }>;
28
+ export default TableShape;
@@ -0,0 +1,4 @@
1
+ import { ToolbarProps } from './props';
2
+ export declare const useSreenfull: (props: ToolbarProps) => {
3
+ fullscreenHandler: (status?: boolean) => void;
4
+ };
@@ -0,0 +1,91 @@
1
+ import { ToolbarNames } from '../../type';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ noPrettier: {
4
+ type: import("vue").PropType<boolean>;
5
+ };
6
+ toolbars: {
7
+ type: import("vue").PropType<ToolbarNames[]>;
8
+ default: () => never[];
9
+ };
10
+ toolbarsExclude: {
11
+ type: import("vue").PropType<ToolbarNames[]>;
12
+ default: () => never[];
13
+ };
14
+ setting: {
15
+ type: import("vue").PropType<import('../../type').SettingType>;
16
+ default: () => {};
17
+ };
18
+ screenfull: {
19
+ type: ObjectConstructor;
20
+ default: null;
21
+ };
22
+ screenfullJs: {
23
+ type: import("vue").PropType<string>;
24
+ default: string;
25
+ };
26
+ updateSetting: {
27
+ type: import("vue").PropType<import('../../type').UpdateSetting>;
28
+ default: () => void;
29
+ };
30
+ tableShape: {
31
+ type: import("vue").PropType<number[]>;
32
+ default: () => number[];
33
+ };
34
+ defToolbars: {
35
+ type: import("vue").PropType<import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
36
+ [key: string]: any;
37
+ }>>;
38
+ };
39
+ noUploadImg: {
40
+ type: import("vue").PropType<boolean>;
41
+ };
42
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
43
+ noPrettier: {
44
+ type: import("vue").PropType<boolean>;
45
+ };
46
+ toolbars: {
47
+ type: import("vue").PropType<ToolbarNames[]>;
48
+ default: () => never[];
49
+ };
50
+ toolbarsExclude: {
51
+ type: import("vue").PropType<ToolbarNames[]>;
52
+ default: () => never[];
53
+ };
54
+ setting: {
55
+ type: import("vue").PropType<import('../../type').SettingType>;
56
+ default: () => {};
57
+ };
58
+ screenfull: {
59
+ type: ObjectConstructor;
60
+ default: null;
61
+ };
62
+ screenfullJs: {
63
+ type: import("vue").PropType<string>;
64
+ default: string;
65
+ };
66
+ updateSetting: {
67
+ type: import("vue").PropType<import('../../type').UpdateSetting>;
68
+ default: () => void;
69
+ };
70
+ tableShape: {
71
+ type: import("vue").PropType<number[]>;
72
+ default: () => number[];
73
+ };
74
+ defToolbars: {
75
+ type: import("vue").PropType<import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
76
+ [key: string]: any;
77
+ }>>;
78
+ };
79
+ noUploadImg: {
80
+ type: import("vue").PropType<boolean>;
81
+ };
82
+ }>>, {
83
+ toolbars: ToolbarNames[];
84
+ toolbarsExclude: ToolbarNames[];
85
+ tableShape: number[];
86
+ setting: import('../../type').SettingType;
87
+ updateSetting: import('../../type').UpdateSetting;
88
+ screenfull: Record<string, any>;
89
+ screenfullJs: string;
90
+ }>;
91
+ export default _default;
@@ -0,0 +1,45 @@
1
+ import { PropType, VNode, ExtractPropTypes } from 'vue';
2
+ import { LooseRequired } from '@vue/shared';
3
+ import { ToolbarNames, SettingType, UpdateSetting } from '../../type';
4
+ export declare const toolbarProps: {
5
+ noPrettier: {
6
+ type: PropType<boolean>;
7
+ };
8
+ toolbars: {
9
+ type: PropType<ToolbarNames[]>;
10
+ default: () => never[];
11
+ };
12
+ toolbarsExclude: {
13
+ type: PropType<ToolbarNames[]>;
14
+ default: () => never[];
15
+ };
16
+ setting: {
17
+ type: PropType<SettingType>;
18
+ default: () => {};
19
+ };
20
+ screenfull: {
21
+ type: ObjectConstructor;
22
+ default: null;
23
+ };
24
+ screenfullJs: {
25
+ type: PropType<string>;
26
+ default: string;
27
+ };
28
+ updateSetting: {
29
+ type: PropType<UpdateSetting>;
30
+ default: () => void;
31
+ };
32
+ tableShape: {
33
+ type: PropType<number[]>;
34
+ default: () => number[];
35
+ };
36
+ defToolbars: {
37
+ type: PropType<VNode<import("vue").RendererNode, import("vue").RendererElement, {
38
+ [key: string]: any;
39
+ }>>;
40
+ };
41
+ noUploadImg: {
42
+ type: PropType<boolean>;
43
+ };
44
+ };
45
+ export type ToolbarProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof toolbarProps>>>>;