md-editor-v3 3.0.1 → 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.
- package/README.md +131 -95
- package/lib/cjs/DropdownToolbar.cjs +1 -0
- package/lib/cjs/MdCatalog.cjs +1 -0
- package/lib/cjs/MdEditor.cjs +60 -0
- package/lib/cjs/MdPreview.cjs +1 -0
- package/lib/cjs/ModalToolbar.cjs +1 -0
- package/lib/cjs/NormalToolbar.cjs +1 -0
- package/lib/cjs/chunks/config.cjs +1 -0
- package/lib/cjs/chunks/dom.cjs +1 -0
- package/lib/cjs/chunks/event-bus.cjs +1 -0
- package/lib/cjs/chunks/index.cjs +8 -0
- package/lib/cjs/chunks/index2.cjs +1 -0
- package/lib/cjs/chunks/index3.cjs +1 -0
- package/lib/cjs/chunks/index4.cjs +2 -0
- package/lib/cjs/chunks/vue-tsx.cjs +1 -0
- package/lib/cjs/config.cjs +1 -0
- package/lib/cjs/index.cjs +1 -0
- package/lib/es/DropdownToolbar.mjs +7 -0
- package/lib/es/MdCatalog.mjs +215 -0
- package/lib/es/MdEditor.mjs +2286 -0
- package/lib/es/MdPreview.mjs +15 -0
- package/lib/es/ModalToolbar.mjs +9 -0
- package/lib/es/NormalToolbar.mjs +39 -0
- package/lib/es/chunks/config.mjs +271 -0
- package/lib/es/chunks/dom.mjs +32 -0
- package/lib/es/chunks/event-bus.mjs +38 -0
- package/lib/es/chunks/index.mjs +1061 -0
- package/lib/es/chunks/index2.mjs +135 -0
- package/lib/es/chunks/index3.mjs +229 -0
- package/lib/es/chunks/index4.mjs +57 -0
- package/lib/es/chunks/vue-tsx.mjs +11 -0
- package/lib/es/config.mjs +4 -0
- package/lib/es/index.mjs +35 -0
- package/lib/preview.css +1 -0
- package/lib/style.css +1 -1
- package/lib/types/DropdownToolbar/index.d.ts +129 -0
- package/lib/{MdEditor/extensions → types}/MdCatalog/CatalogLink.d.ts +4 -4
- package/lib/{MdEditor/extensions/MdCatalog/index.d.ts → types/MdCatalog/MdCatalog.d.ts} +3 -3
- package/lib/types/MdCatalog/index.d.ts +193 -0
- package/lib/{MdEditor → types/MdEditor}/Editor.d.ts +153 -162
- package/lib/types/MdEditor/components/Checkbox/index.d.ts +24 -0
- package/lib/types/MdEditor/components/Divider/index.d.ts +2 -0
- package/lib/types/MdEditor/components/Dropdown/index.d.ts +53 -0
- package/lib/types/MdEditor/components/Modal/index.d.ts +84 -0
- package/lib/types/MdEditor/composition.d.ts +66 -0
- package/lib/{MdEditor → types/MdEditor}/index.d.ts +343 -388
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +154 -0
- package/lib/types/MdEditor/layouts/Content/codemirror/commands.d.ts +4 -0
- package/lib/types/MdEditor/layouts/Content/codemirror/index.d.ts +56 -0
- package/lib/types/MdEditor/layouts/Content/codemirror/themeLight.d.ts +23 -0
- package/lib/types/MdEditor/layouts/Content/codemirror/themeOneDark.d.ts +26 -0
- package/lib/types/MdEditor/layouts/Content/composition/index.d.ts +6 -0
- package/lib/types/MdEditor/layouts/Content/composition/useAttach.d.ts +7 -0
- package/lib/types/MdEditor/layouts/Content/composition/useAutoScroll.d.ts +5 -0
- package/lib/types/MdEditor/layouts/Content/composition/useCodeMirror.d.ts +13 -0
- package/lib/types/MdEditor/layouts/Content/composition/useCopyCode.d.ts +4 -0
- package/lib/types/MdEditor/layouts/Content/composition/useHighlight.d.ts +8 -0
- package/lib/types/MdEditor/layouts/Content/composition/useKatex.d.ts +8 -0
- package/lib/types/MdEditor/layouts/Content/composition/useMarkdownIt.d.ts +5 -0
- package/lib/types/MdEditor/layouts/Content/composition/useMermaid.d.ts +11 -0
- package/lib/types/MdEditor/layouts/Content/composition/usePasteUpload.d.ts +6 -0
- package/lib/types/MdEditor/layouts/Content/composition/userZoom.d.ts +10 -0
- package/lib/types/MdEditor/layouts/Content/index.d.ts +173 -0
- package/lib/types/MdEditor/layouts/Content/markdownIt/admonition/index.d.ts +5 -0
- package/lib/types/MdEditor/layouts/Content/markdownIt/codetabs/index.d.ts +14 -0
- package/lib/types/MdEditor/layouts/Content/markdownIt/heading/index.d.ts +9 -0
- package/lib/types/MdEditor/layouts/Content/markdownIt/katex/index.d.ts +10 -0
- package/lib/types/MdEditor/layouts/Content/markdownIt/mermaid/index.d.ts +6 -0
- package/lib/types/MdEditor/layouts/Content/props.d.ts +89 -0
- package/lib/types/MdEditor/layouts/Footer/MarkdownTotal.d.ts +15 -0
- package/lib/types/MdEditor/layouts/Footer/ScrollAuto.d.ts +21 -0
- package/lib/types/MdEditor/layouts/Footer/index.d.ts +50 -0
- package/lib/types/MdEditor/layouts/Modals/Clip.d.ts +33 -0
- package/lib/types/MdEditor/layouts/Modals/Link.d.ts +42 -0
- package/lib/types/MdEditor/layouts/Modals/index.d.ts +51 -0
- package/lib/types/MdEditor/layouts/Toolbar/TableShape.d.ts +28 -0
- package/lib/types/MdEditor/layouts/Toolbar/composition.d.ts +4 -0
- package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +91 -0
- package/lib/types/MdEditor/layouts/Toolbar/props.d.ts +45 -0
- package/lib/types/MdEditor/props.d.ts +546 -0
- package/lib/types/MdEditor/static/event-name.d.ts +9 -0
- package/lib/{MdEditor → types/MdEditor}/type.d.ts +2 -1
- package/lib/types/MdEditor/utils/content-help.d.ts +19 -0
- package/lib/types/MdEditor/utils/dom.d.ts +22 -0
- package/lib/types/MdEditor/utils/event-bus.d.ts +17 -0
- package/lib/types/MdEditor/utils/index.d.ts +66 -0
- package/lib/types/MdEditor/utils/scroll-auto.d.ts +18 -0
- package/lib/types/MdEditor/utils/smooth-scroll.d.ts +8 -0
- package/lib/types/MdEditor/utils/vue-tsx.d.ts +23 -0
- package/lib/types/MdPreview/MdPreview.d.ts +186 -0
- package/lib/types/MdPreview/index.d.ts +453 -0
- package/lib/types/ModalToolbar/index.d.ts +244 -0
- package/lib/types/NormalToolbar/index.d.ts +105 -0
- package/lib/types/config.d.ts +1 -0
- package/lib/types/index.d.ts +8 -0
- package/lib/{md-editor-v3.umd.js → umd/index.js} +38 -38
- package/package.json +16 -20
- package/lib/md-editor-v3.cjs +0 -63
- package/lib/md-editor-v3.mjs +0 -4143
- /package/lib/{MdEditor/extensions → types/DropdownToolbar}/DropdownToolbar.d.ts +0 -0
- /package/lib/{MdEditor → types/MdEditor}/config.d.ts +0 -0
- /package/lib/{MdEditor/extensions → types/ModalToolbar}/ModalToolbar.d.ts +0 -0
- /package/lib/{MdEditor/extensions → types/NormalToolbar}/NormalToolbar.d.ts +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { PropType, EmitsOptions, ExtractPropTypes } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
trigger: {
|
|
4
|
+
type: PropType<"hover" | "click">;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
overlay: {
|
|
8
|
+
type: PropType<string | JSX.Element>;
|
|
9
|
+
default: string;
|
|
10
|
+
};
|
|
11
|
+
visible: {
|
|
12
|
+
type: PropType<boolean>;
|
|
13
|
+
default: boolean;
|
|
14
|
+
};
|
|
15
|
+
onChange: {
|
|
16
|
+
type: PropType<(v: boolean) => void>;
|
|
17
|
+
default: () => void;
|
|
18
|
+
};
|
|
19
|
+
relative: {
|
|
20
|
+
type: PropType<string>;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
}, () => import("vue").VNode<unknown, unknown, {
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
26
|
+
trigger: {
|
|
27
|
+
type: PropType<"hover" | "click">;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
overlay: {
|
|
31
|
+
type: PropType<string | JSX.Element>;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
visible: {
|
|
35
|
+
type: PropType<boolean>;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
onChange: {
|
|
39
|
+
type: PropType<(v: boolean) => void>;
|
|
40
|
+
default: () => void;
|
|
41
|
+
};
|
|
42
|
+
relative: {
|
|
43
|
+
type: PropType<string>;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
}>>, {
|
|
47
|
+
visible: boolean;
|
|
48
|
+
trigger: "hover" | "click";
|
|
49
|
+
onChange: (v: boolean) => void;
|
|
50
|
+
overlay: string | JSX.Element;
|
|
51
|
+
relative: string;
|
|
52
|
+
}>;
|
|
53
|
+
export default _default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
title: {
|
|
4
|
+
type: PropType<string>;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
visible: {
|
|
8
|
+
type: PropType<boolean>;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
width: {
|
|
12
|
+
type: PropType<string>;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
height: {
|
|
16
|
+
type: PropType<string>;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
onClose: {
|
|
20
|
+
type: PropType<() => void>;
|
|
21
|
+
default: () => void;
|
|
22
|
+
};
|
|
23
|
+
showAdjust: {
|
|
24
|
+
type: PropType<boolean>;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
isFullscreen: {
|
|
28
|
+
type: PropType<boolean>;
|
|
29
|
+
default: boolean;
|
|
30
|
+
};
|
|
31
|
+
onAdjust: {
|
|
32
|
+
type: PropType<(val: boolean) => void>;
|
|
33
|
+
default: () => void;
|
|
34
|
+
};
|
|
35
|
+
class: {
|
|
36
|
+
type: PropType<string>;
|
|
37
|
+
};
|
|
38
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
39
|
+
title: {
|
|
40
|
+
type: PropType<string>;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
visible: {
|
|
44
|
+
type: PropType<boolean>;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
width: {
|
|
48
|
+
type: PropType<string>;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
height: {
|
|
52
|
+
type: PropType<string>;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
onClose: {
|
|
56
|
+
type: PropType<() => void>;
|
|
57
|
+
default: () => void;
|
|
58
|
+
};
|
|
59
|
+
showAdjust: {
|
|
60
|
+
type: PropType<boolean>;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
63
|
+
isFullscreen: {
|
|
64
|
+
type: PropType<boolean>;
|
|
65
|
+
default: boolean;
|
|
66
|
+
};
|
|
67
|
+
onAdjust: {
|
|
68
|
+
type: PropType<(val: boolean) => void>;
|
|
69
|
+
default: () => void;
|
|
70
|
+
};
|
|
71
|
+
class: {
|
|
72
|
+
type: PropType<string>;
|
|
73
|
+
};
|
|
74
|
+
}>>, {
|
|
75
|
+
title: string;
|
|
76
|
+
visible: boolean;
|
|
77
|
+
onClose: () => void;
|
|
78
|
+
onAdjust: (val: boolean) => void;
|
|
79
|
+
width: string;
|
|
80
|
+
height: string;
|
|
81
|
+
showAdjust: boolean;
|
|
82
|
+
isFullscreen: boolean;
|
|
83
|
+
}>;
|
|
84
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { SettingType, UpdateSetting, MdPreviewProps } from './type';
|
|
3
|
+
import { EditorContext, EditorProps } from './type';
|
|
4
|
+
/**
|
|
5
|
+
* 处理保存逻辑,主要是需要异步返回编译后的html
|
|
6
|
+
*
|
|
7
|
+
* @param props
|
|
8
|
+
* @param context
|
|
9
|
+
*/
|
|
10
|
+
export declare const useOnSave: (props: EditorProps, context: EditorContext) => void;
|
|
11
|
+
/**
|
|
12
|
+
* 抽离预览组件需要提供的组件全局属性
|
|
13
|
+
*
|
|
14
|
+
* @param props 预览组件的props
|
|
15
|
+
*/
|
|
16
|
+
export declare const useProvidePreview: (props: MdPreviewProps) => void;
|
|
17
|
+
/**
|
|
18
|
+
* 向下提供部分公共参数
|
|
19
|
+
*
|
|
20
|
+
* @param props
|
|
21
|
+
*/
|
|
22
|
+
export declare const useProvide: (props: EditorProps) => void;
|
|
23
|
+
/**
|
|
24
|
+
* 抽离预览组件需要嵌入的脚本
|
|
25
|
+
*
|
|
26
|
+
* @param props 预览组件的props
|
|
27
|
+
*/
|
|
28
|
+
export declare const useExpansionPreview: (props: MdPreviewProps) => void;
|
|
29
|
+
/**
|
|
30
|
+
* 插入编辑器支持的扩展外链
|
|
31
|
+
*
|
|
32
|
+
* @param props
|
|
33
|
+
*/
|
|
34
|
+
export declare const useExpansion: (props: EditorProps) => void;
|
|
35
|
+
/**
|
|
36
|
+
* 错误收集
|
|
37
|
+
*
|
|
38
|
+
* @param props
|
|
39
|
+
* @param context
|
|
40
|
+
*/
|
|
41
|
+
export declare const useErrorCatcher: (props: EditorProps, context: EditorContext) => void;
|
|
42
|
+
/**
|
|
43
|
+
* 收集整理公共配置
|
|
44
|
+
*
|
|
45
|
+
* @param props
|
|
46
|
+
* @param context
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
export declare const useConfig: (props: EditorProps, context: EditorContext) => [setting: SettingType, updateSetting: UpdateSetting];
|
|
50
|
+
/**
|
|
51
|
+
* 目录状态整理
|
|
52
|
+
*
|
|
53
|
+
* @param props
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
export declare const useCatalog: (props: EditorProps) => import("vue").ComputedRef<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* 向外暴露属性
|
|
59
|
+
*
|
|
60
|
+
* @param props 组件属性
|
|
61
|
+
* @param ctx vue conext
|
|
62
|
+
* @param catalogVisible 目录显示状态
|
|
63
|
+
* @param setting 内部状态集合
|
|
64
|
+
* @param updateSetting 更新内部集合
|
|
65
|
+
*/
|
|
66
|
+
export declare const useExpose: (props: EditorProps, ctx: EditorContext, catalogVisible: Ref<boolean>, setting: SettingType, updateSetting: UpdateSetting) => void;
|