md-editor-v3 3.0.0 → 4.0.0-beta.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 -4146
  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,154 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+ import { LooseRequired } from '@vue/shared';
3
+ import { HeadList, MdHeadingId, SettingType } from '../../type';
4
+ export declare const contentPreviewProps: {
5
+ modelValue: {
6
+ type: PropType<string>;
7
+ default: string;
8
+ };
9
+ setting: {
10
+ type: PropType<SettingType>;
11
+ default: () => {};
12
+ };
13
+ onHtmlChanged: {
14
+ type: PropType<(h: string) => void>;
15
+ default: () => void;
16
+ };
17
+ onGetCatalog: {
18
+ type: PropType<(list: HeadList[]) => void>;
19
+ default: () => void;
20
+ };
21
+ mdHeadingId: {
22
+ type: PropType<MdHeadingId>;
23
+ default: () => string;
24
+ };
25
+ noMermaid: {
26
+ type: PropType<boolean>;
27
+ default: boolean;
28
+ };
29
+ sanitize: {
30
+ type: PropType<(html: string) => string>;
31
+ default: (html: string) => string;
32
+ };
33
+ noKatex: {
34
+ type: PropType<boolean>;
35
+ default: boolean;
36
+ };
37
+ formatCopiedText: {
38
+ type: PropType<(text: string) => string>;
39
+ default: (text: string) => string;
40
+ };
41
+ noHighlight: {
42
+ type: PropType<boolean>;
43
+ default: boolean;
44
+ };
45
+ previewOnly: {
46
+ type: PropType<boolean>;
47
+ default: boolean;
48
+ };
49
+ };
50
+ export type ContentPreviewProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof contentPreviewProps>>>>;
51
+ declare const ContentPreview: import("vue").DefineComponent<{
52
+ modelValue: {
53
+ type: PropType<string>;
54
+ default: string;
55
+ };
56
+ setting: {
57
+ type: PropType<SettingType>;
58
+ default: () => {};
59
+ };
60
+ onHtmlChanged: {
61
+ type: PropType<(h: string) => void>;
62
+ default: () => void;
63
+ };
64
+ onGetCatalog: {
65
+ type: PropType<(list: HeadList[]) => void>;
66
+ default: () => void;
67
+ };
68
+ mdHeadingId: {
69
+ type: PropType<MdHeadingId>;
70
+ default: () => string;
71
+ };
72
+ noMermaid: {
73
+ type: PropType<boolean>;
74
+ default: boolean;
75
+ };
76
+ sanitize: {
77
+ type: PropType<(html: string) => string>;
78
+ default: (html: string) => string;
79
+ };
80
+ noKatex: {
81
+ type: PropType<boolean>;
82
+ default: boolean;
83
+ };
84
+ formatCopiedText: {
85
+ type: PropType<(text: string) => string>;
86
+ default: (text: string) => string;
87
+ };
88
+ noHighlight: {
89
+ type: PropType<boolean>;
90
+ default: boolean;
91
+ };
92
+ previewOnly: {
93
+ type: PropType<boolean>;
94
+ default: boolean;
95
+ };
96
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
97
+ modelValue: {
98
+ type: PropType<string>;
99
+ default: string;
100
+ };
101
+ setting: {
102
+ type: PropType<SettingType>;
103
+ default: () => {};
104
+ };
105
+ onHtmlChanged: {
106
+ type: PropType<(h: string) => void>;
107
+ default: () => void;
108
+ };
109
+ onGetCatalog: {
110
+ type: PropType<(list: HeadList[]) => void>;
111
+ default: () => void;
112
+ };
113
+ mdHeadingId: {
114
+ type: PropType<MdHeadingId>;
115
+ default: () => string;
116
+ };
117
+ noMermaid: {
118
+ type: PropType<boolean>;
119
+ default: boolean;
120
+ };
121
+ sanitize: {
122
+ type: PropType<(html: string) => string>;
123
+ default: (html: string) => string;
124
+ };
125
+ noKatex: {
126
+ type: PropType<boolean>;
127
+ default: boolean;
128
+ };
129
+ formatCopiedText: {
130
+ type: PropType<(text: string) => string>;
131
+ default: (text: string) => string;
132
+ };
133
+ noHighlight: {
134
+ type: PropType<boolean>;
135
+ default: boolean;
136
+ };
137
+ previewOnly: {
138
+ type: PropType<boolean>;
139
+ default: boolean;
140
+ };
141
+ }>>, {
142
+ mdHeadingId: MdHeadingId;
143
+ modelValue: string;
144
+ onHtmlChanged: (h: string) => void;
145
+ onGetCatalog: (list: HeadList[]) => void;
146
+ sanitize: (html: string) => string;
147
+ noMermaid: boolean;
148
+ noKatex: boolean;
149
+ formatCopiedText: (text: string) => string;
150
+ noHighlight: boolean;
151
+ setting: SettingType;
152
+ previewOnly: boolean;
153
+ }>;
154
+ export default ContentPreview;
@@ -0,0 +1,4 @@
1
+ import { KeyBinding } from '@codemirror/view';
2
+ import { ContentProps } from '../props';
3
+ declare const createCommands: (id: string, contentProps: ContentProps) => KeyBinding[];
4
+ export default createCommands;
@@ -0,0 +1,56 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { EditorView } from '@codemirror/view';
3
+ export default class CodeMirrorUt {
4
+ view: EditorView;
5
+ private toggleTabSize;
6
+ private togglePlaceholder;
7
+ /**
8
+ * 设置全部的扩展
9
+ */
10
+ setExtensions: (extensions: Extension[]) => void;
11
+ toggleDisabled: (extensions: Extension[]) => void;
12
+ toggleReadOnly: (extensions: Extension[]) => void;
13
+ toggleMaxlength: (extensions: Extension[]) => void;
14
+ getValue(): string;
15
+ /**
16
+ * 设置内容
17
+ *
18
+ * @param insert 待插入内容
19
+ * @param from 插入开始位置
20
+ * @param to 插入结束位置
21
+ */
22
+ setValue(insert: string, from?: number, to?: number): void;
23
+ /**
24
+ * 获取选中的文本
25
+ */
26
+ getSelectedText(): string;
27
+ /**
28
+ * 使用新的内容替换选中的内容
29
+ *
30
+ * @param text 待替换内容
31
+ * @param options 替换后是否选中
32
+ */
33
+ replaceSelectedText(text: string, options?: {
34
+ select: boolean;
35
+ deviationStart: number;
36
+ deviationEnd: number;
37
+ replaceAll: boolean;
38
+ }): void;
39
+ constructor(view: EditorView);
40
+ /**
41
+ * 设置tabSize
42
+ *
43
+ * @param tabSize 需要切换的大小
44
+ */
45
+ setTabSize(tabSize: number): void;
46
+ /**
47
+ * 设置placeholder
48
+ *
49
+ * @param t 目标内容
50
+ */
51
+ setPlaceholder(t: string): void;
52
+ focus(): void;
53
+ setDisabled(d: boolean): void;
54
+ setReadOnly(r: boolean): void;
55
+ setMaxLength(ml: number): void;
56
+ }
@@ -0,0 +1,23 @@
1
+ import { Extension } from '@codemirror/state';
2
+ import { HighlightStyle } from '@codemirror/language';
3
+ export declare const color: {
4
+ chalky: string;
5
+ coral: string;
6
+ cyan: string;
7
+ invalid: string;
8
+ ivory: string;
9
+ stone: string;
10
+ malibu: string;
11
+ sage: string;
12
+ whiskey: string;
13
+ violet: string;
14
+ darkBackground: string;
15
+ highlightBackground: string;
16
+ background: string;
17
+ tooltipBackground: string;
18
+ selection: string;
19
+ cursor: string;
20
+ };
21
+ export declare const oneLightTheme: Extension;
22
+ export declare const oneLightHighlightStyle: HighlightStyle;
23
+ export declare const oneLight: Extension;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * From https://github.com/codemirror/theme-one-dark
3
+ */
4
+ import { Extension } from '@codemirror/state';
5
+ import { HighlightStyle } from '@codemirror/language';
6
+ export declare const color: {
7
+ chalky: string;
8
+ coral: string;
9
+ cyan: string;
10
+ invalid: string;
11
+ ivory: string;
12
+ stone: string;
13
+ malibu: string;
14
+ sage: string;
15
+ whiskey: string;
16
+ violet: string;
17
+ darkBackground: string;
18
+ highlightBackground: string;
19
+ background: string;
20
+ tooltipBackground: string;
21
+ selection: string;
22
+ cursor: string;
23
+ };
24
+ export declare const oneDarkTheme: Extension;
25
+ export declare const oneDarkHighlightStyle: HighlightStyle;
26
+ export declare const oneDark: Extension;
@@ -0,0 +1,6 @@
1
+ import useAutoScroll from './useAutoScroll';
2
+ import useCodeMirror from './useCodeMirror';
3
+ import userZoom from './userZoom';
4
+ import useCopyCode from './useCopyCode';
5
+ import useMarkdownIt from './useMarkdownIt';
6
+ export { useAutoScroll, useCodeMirror, userZoom, useCopyCode, useMarkdownIt };
@@ -0,0 +1,7 @@
1
+ import { Ref } from 'vue';
2
+ import CodeMirrorUt from '../codemirror';
3
+ /**
4
+ * 一些附带的设置
5
+ */
6
+ declare const useAttach: (codeMirrorUt: Ref<CodeMirrorUt | undefined>) => void;
7
+ export default useAttach;
@@ -0,0 +1,5 @@
1
+ import { Ref } from 'vue';
2
+ import CodeMirrorUt from '../codemirror';
3
+ import { ContentProps } from '../props';
4
+ declare const useAutoScroll: (props: ContentProps, html: Ref<string>, codeMirrorUt: Ref<CodeMirrorUt | undefined>) => void;
5
+ export default useAutoScroll;
@@ -0,0 +1,13 @@
1
+ import { ContentProps } from '../props';
2
+ import CodeMirrorUt from '../codemirror';
3
+ /**
4
+ * 文本编辑区组件
5
+ *
6
+ * @param props
7
+ * @returns
8
+ */
9
+ declare const useCodeMirror: (props: ContentProps) => {
10
+ inputWrapperRef: import("vue").Ref<HTMLDivElement | undefined>;
11
+ codeMirrorUt: import("vue").ShallowRef<CodeMirrorUt | undefined>;
12
+ };
13
+ export default useCodeMirror;
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'vue';
2
+ import { ContentPreviewProps } from '../ContentPreview';
3
+ declare const useCopyCode: (props: ContentPreviewProps, html: Ref<string>) => void;
4
+ export default useCopyCode;
@@ -0,0 +1,8 @@
1
+ import { ContentPreviewProps } from '../ContentPreview';
2
+ /**
3
+ * 注册代码高亮扩展到页面
4
+ *
5
+ * @param props 内容组件props
6
+ */
7
+ declare const useHighlight: (props: ContentPreviewProps) => any;
8
+ export default useHighlight;
@@ -0,0 +1,8 @@
1
+ import { ContentPreviewProps } from '../ContentPreview';
2
+ /**
3
+ * 注册katex扩展到页面
4
+ *
5
+ * @param props 内容组件props
6
+ */
7
+ declare const useKatex: (props: ContentPreviewProps) => any;
8
+ export default useKatex;
@@ -0,0 +1,5 @@
1
+ import { ContentPreviewProps } from '../ContentPreview';
2
+ declare const useMarkdownIt: (props: ContentPreviewProps, previewOnly: boolean) => {
3
+ html: import("vue").Ref<string>;
4
+ };
5
+ export default useMarkdownIt;
@@ -0,0 +1,11 @@
1
+ import { ContentPreviewProps } from '../ContentPreview';
2
+ /**
3
+ * 注册katex扩展到页面
4
+ *
5
+ */
6
+ declare const useMermaid: (props: ContentPreviewProps) => {
7
+ mermaidRef: any;
8
+ reRenderRef: import("vue").ShallowRef<boolean>;
9
+ replaceMermaid: () => void;
10
+ };
11
+ export default useMermaid;
@@ -0,0 +1,6 @@
1
+ import { ContentProps } from '../props';
2
+ /**
3
+ * 处理粘贴板
4
+ */
5
+ declare const usePasteUpload: (props: ContentProps) => (e: ClipboardEvent) => void;
6
+ export default usePasteUpload;
@@ -0,0 +1,10 @@
1
+ import { Ref } from 'vue';
2
+ import { ContentPreviewProps } from '../ContentPreview';
3
+ /**
4
+ * 放大图片
5
+ *
6
+ * @param props 基础属性
7
+ * @param html 编译后的html
8
+ */
9
+ declare const userZoom: (props: ContentPreviewProps, html: Ref<string>) => void;
10
+ export default userZoom;
@@ -0,0 +1,173 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ value: {
3
+ type: import("vue").PropType<string>;
4
+ default: string;
5
+ };
6
+ onChange: {
7
+ type: import("vue").PropType<(v: string) => void>;
8
+ default: () => void;
9
+ };
10
+ setting: {
11
+ type: import("vue").PropType<import("../../type").SettingType>;
12
+ default: () => {};
13
+ };
14
+ onHtmlChanged: {
15
+ type: import("vue").PropType<(h: string) => void>;
16
+ default: () => void;
17
+ };
18
+ onGetCatalog: {
19
+ type: import("vue").PropType<(list: import("../../type").HeadList[]) => void>;
20
+ default: () => void;
21
+ };
22
+ mdHeadingId: {
23
+ type: import("vue").PropType<import("../../type").MdHeadingId>;
24
+ default: () => string;
25
+ };
26
+ noMermaid: {
27
+ type: import("vue").PropType<boolean>;
28
+ default: boolean;
29
+ };
30
+ sanitize: {
31
+ type: import("vue").PropType<(html: string) => string>;
32
+ default: (html: string) => string;
33
+ };
34
+ placeholder: {
35
+ type: import("vue").PropType<string>;
36
+ default: string;
37
+ };
38
+ noKatex: {
39
+ type: import("vue").PropType<boolean>;
40
+ default: boolean;
41
+ };
42
+ scrollAuto: {
43
+ type: import("vue").PropType<boolean>;
44
+ };
45
+ formatCopiedText: {
46
+ type: import("vue").PropType<(text: string) => string>;
47
+ default: (text: string) => string;
48
+ };
49
+ autofocus: {
50
+ type: import("vue").PropType<boolean>;
51
+ };
52
+ disabled: {
53
+ type: import("vue").PropType<boolean>;
54
+ };
55
+ readonly: {
56
+ type: import("vue").PropType<boolean>;
57
+ };
58
+ maxlength: {
59
+ type: import("vue").PropType<number>;
60
+ };
61
+ autoDetectCode: {
62
+ type: import("vue").PropType<boolean>;
63
+ };
64
+ onBlur: {
65
+ type: import("vue").PropType<(event: FocusEvent) => void>;
66
+ default: () => void;
67
+ };
68
+ onFocus: {
69
+ type: import("vue").PropType<(event: FocusEvent) => void>;
70
+ default: () => void;
71
+ };
72
+ noPrettier: {
73
+ type: import("vue").PropType<boolean>;
74
+ };
75
+ noHighlight: {
76
+ type: import("vue").PropType<boolean>;
77
+ default: boolean;
78
+ };
79
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
80
+ value: {
81
+ type: import("vue").PropType<string>;
82
+ default: string;
83
+ };
84
+ onChange: {
85
+ type: import("vue").PropType<(v: string) => void>;
86
+ default: () => void;
87
+ };
88
+ setting: {
89
+ type: import("vue").PropType<import("../../type").SettingType>;
90
+ default: () => {};
91
+ };
92
+ onHtmlChanged: {
93
+ type: import("vue").PropType<(h: string) => void>;
94
+ default: () => void;
95
+ };
96
+ onGetCatalog: {
97
+ type: import("vue").PropType<(list: import("../../type").HeadList[]) => void>;
98
+ default: () => void;
99
+ };
100
+ mdHeadingId: {
101
+ type: import("vue").PropType<import("../../type").MdHeadingId>;
102
+ default: () => string;
103
+ };
104
+ noMermaid: {
105
+ type: import("vue").PropType<boolean>;
106
+ default: boolean;
107
+ };
108
+ sanitize: {
109
+ type: import("vue").PropType<(html: string) => string>;
110
+ default: (html: string) => string;
111
+ };
112
+ placeholder: {
113
+ type: import("vue").PropType<string>;
114
+ default: string;
115
+ };
116
+ noKatex: {
117
+ type: import("vue").PropType<boolean>;
118
+ default: boolean;
119
+ };
120
+ scrollAuto: {
121
+ type: import("vue").PropType<boolean>;
122
+ };
123
+ formatCopiedText: {
124
+ type: import("vue").PropType<(text: string) => string>;
125
+ default: (text: string) => string;
126
+ };
127
+ autofocus: {
128
+ type: import("vue").PropType<boolean>;
129
+ };
130
+ disabled: {
131
+ type: import("vue").PropType<boolean>;
132
+ };
133
+ readonly: {
134
+ type: import("vue").PropType<boolean>;
135
+ };
136
+ maxlength: {
137
+ type: import("vue").PropType<number>;
138
+ };
139
+ autoDetectCode: {
140
+ type: import("vue").PropType<boolean>;
141
+ };
142
+ onBlur: {
143
+ type: import("vue").PropType<(event: FocusEvent) => void>;
144
+ default: () => void;
145
+ };
146
+ onFocus: {
147
+ type: import("vue").PropType<(event: FocusEvent) => void>;
148
+ default: () => void;
149
+ };
150
+ noPrettier: {
151
+ type: import("vue").PropType<boolean>;
152
+ };
153
+ noHighlight: {
154
+ type: import("vue").PropType<boolean>;
155
+ default: boolean;
156
+ };
157
+ }>>, {
158
+ onChange: (v: string) => void;
159
+ onFocus: (event: FocusEvent) => void;
160
+ onBlur: (event: FocusEvent) => void;
161
+ mdHeadingId: import("../../type").MdHeadingId;
162
+ placeholder: string;
163
+ onHtmlChanged: (h: string) => void;
164
+ onGetCatalog: (list: import("../../type").HeadList[]) => void;
165
+ sanitize: (html: string) => string;
166
+ noMermaid: boolean;
167
+ noKatex: boolean;
168
+ formatCopiedText: (text: string) => string;
169
+ noHighlight: boolean;
170
+ setting: import("../../type").SettingType;
171
+ value: string;
172
+ }>;
173
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export interface AdmonitionPluginOps {
2
+ marker: string;
3
+ }
4
+ declare const AdmonitionPlugin: (md: markdownit, options: AdmonitionPluginOps) => void;
5
+ export default AdmonitionPlugin;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 源码来自:https://github.com/cncws/markdown-it-codetabs
3
+ *
4
+ * 这里仅做适配
5
+ *
6
+ * 源码如果在页面中存在多个编辑器,但是内容又是相同的时候,第二个开始的内容有点混乱
7
+ * 需要与编辑器的editorId绑定
8
+ */
9
+ import markdownit from 'markdown-it/lib';
10
+ export interface CodeTabsPluginOps extends markdownit.Options {
11
+ editorId: string;
12
+ }
13
+ declare const codetabs: (md: markdownit, _opts: CodeTabsPluginOps) => void;
14
+ export default codetabs;
@@ -0,0 +1,9 @@
1
+ import markdownit from 'markdown-it/lib';
2
+ import { Ref } from 'vue';
3
+ import { HeadList, MdHeadingId } from '../../../../type';
4
+ export interface HeadingPluginOps extends markdownit.Options {
5
+ mdHeadingId: MdHeadingId;
6
+ headsRef: Ref<HeadList[]>;
7
+ }
8
+ declare const HeadingPlugin: (md: markdownit, options: HeadingPluginOps) => void;
9
+ export default HeadingPlugin;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 源码来自https://github.com/waylonflinn/markdown-it-katex
3
+ *
4
+ * 该代码只是正对md-editor-v3系列功能做了适配
5
+ */
6
+ import { ShallowRef } from 'vue';
7
+ declare const KatexPlugin: (md: markdownit, options: {
8
+ katexRef: ShallowRef;
9
+ }) => void;
10
+ export default KatexPlugin;
@@ -0,0 +1,6 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { Themes } from '../../../../type';
3
+ declare const MermaidPlugin: (md: markdownit, options: {
4
+ themeRef: ComputedRef<Themes>;
5
+ }) => void;
6
+ export default MermaidPlugin;
@@ -0,0 +1,89 @@
1
+ import { ExtractPropTypes, PropType } from 'vue';
2
+ import { LooseRequired } from '@vue/shared';
3
+ import { HeadList, SettingType, MdHeadingId } from '../../type';
4
+ export declare const contentProps: {
5
+ value: {
6
+ type: PropType<string>;
7
+ default: string;
8
+ };
9
+ onChange: {
10
+ type: PropType<(v: string) => void>;
11
+ default: () => void;
12
+ };
13
+ setting: {
14
+ type: PropType<SettingType>;
15
+ default: () => {};
16
+ };
17
+ onHtmlChanged: {
18
+ type: PropType<(h: string) => void>;
19
+ default: () => void;
20
+ };
21
+ onGetCatalog: {
22
+ type: PropType<(list: HeadList[]) => void>;
23
+ default: () => void;
24
+ };
25
+ mdHeadingId: {
26
+ type: PropType<MdHeadingId>;
27
+ default: () => string;
28
+ };
29
+ noMermaid: {
30
+ type: PropType<boolean>;
31
+ default: boolean;
32
+ };
33
+ sanitize: {
34
+ type: PropType<(html: string) => string>;
35
+ default: (html: string) => string;
36
+ };
37
+ placeholder: {
38
+ type: PropType<string>;
39
+ default: string;
40
+ };
41
+ noKatex: {
42
+ type: PropType<boolean>;
43
+ default: boolean;
44
+ };
45
+ scrollAuto: {
46
+ type: PropType<boolean>;
47
+ };
48
+ formatCopiedText: {
49
+ type: PropType<(text: string) => string>;
50
+ default: (text: string) => string;
51
+ };
52
+ autofocus: {
53
+ type: PropType<boolean>;
54
+ };
55
+ disabled: {
56
+ type: PropType<boolean>;
57
+ };
58
+ readonly: {
59
+ type: PropType<boolean>;
60
+ };
61
+ maxlength: {
62
+ type: PropType<number>;
63
+ };
64
+ autoDetectCode: {
65
+ type: PropType<boolean>;
66
+ };
67
+ /**
68
+ * 输入框失去焦点时触发事件
69
+ */
70
+ onBlur: {
71
+ type: PropType<(event: FocusEvent) => void>;
72
+ default: () => void;
73
+ };
74
+ /**
75
+ * 输入框获得焦点时触发事件
76
+ */
77
+ onFocus: {
78
+ type: PropType<(event: FocusEvent) => void>;
79
+ default: () => void;
80
+ };
81
+ noPrettier: {
82
+ type: PropType<boolean>;
83
+ };
84
+ noHighlight: {
85
+ type: PropType<boolean>;
86
+ default: boolean;
87
+ };
88
+ };
89
+ export type ContentProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof contentProps>>>>;