md-editor-v3 4.12.0-beta.2 → 4.12.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.
Files changed (43) hide show
  1. package/README.md +12 -0
  2. package/lib/cjs/DropdownToolbar.cjs +3 -1
  3. package/lib/cjs/MdCatalog.cjs +270 -1
  4. package/lib/cjs/MdEditor.cjs +3101 -58
  5. package/lib/cjs/MdModal.cjs +3 -1
  6. package/lib/cjs/MdPreview.cjs +3 -1
  7. package/lib/cjs/ModalToolbar.cjs +124 -1
  8. package/lib/cjs/NormalToolbar.cjs +61 -1
  9. package/lib/cjs/chunks/config.cjs +290 -1
  10. package/lib/cjs/chunks/dom.cjs +64 -1
  11. package/lib/cjs/chunks/index.cjs +1863 -8
  12. package/lib/cjs/chunks/index2.cjs +198 -1
  13. package/lib/cjs/chunks/index3.cjs +270 -1
  14. package/lib/cjs/chunks/index4.cjs +141 -2
  15. package/lib/cjs/chunks/vue-tsx.cjs +10 -1
  16. package/lib/cjs/config.cjs +12 -1
  17. package/lib/cjs/index.cjs +25 -1
  18. package/lib/es/DropdownToolbar.mjs +2 -2
  19. package/lib/es/MdCatalog.mjs +164 -114
  20. package/lib/es/MdEditor.mjs +2297 -1654
  21. package/lib/es/MdModal.mjs +2 -2
  22. package/lib/es/MdPreview.mjs +2 -2
  23. package/lib/es/ModalToolbar.mjs +55 -38
  24. package/lib/es/NormalToolbar.mjs +26 -18
  25. package/lib/es/chunks/config.mjs +73 -54
  26. package/lib/es/chunks/dom.mjs +57 -24
  27. package/lib/es/chunks/index.mjs +1099 -609
  28. package/lib/es/chunks/index2.mjs +126 -78
  29. package/lib/es/chunks/index3.mjs +185 -111
  30. package/lib/es/chunks/index4.mjs +124 -72
  31. package/lib/es/chunks/vue-tsx.mjs +8 -8
  32. package/lib/es/config.mjs +11 -10
  33. package/lib/es/index.mjs +23 -23
  34. package/lib/preview.css +200 -1
  35. package/lib/style.css +592 -1
  36. package/lib/types/MdEditor/components/Modal/Modal.d.ts +1 -1
  37. package/lib/types/MdEditor/components/Modal/index.d.ts +3 -3
  38. package/lib/types/MdEditor/layouts/Content/index.d.ts +9 -0
  39. package/lib/types/MdEditor/layouts/Content/props.d.ts +4 -0
  40. package/lib/types/MdEditor/static/event-name.d.ts +1 -0
  41. package/lib/types/MdEditor/type.d.ts +10 -1
  42. package/lib/umd/index.js +75625 -114
  43. package/package.json +1 -1
@@ -38,7 +38,7 @@ declare const _default: import("vue").DefineComponent<{
38
38
  type: PropType<CSSProperties>;
39
39
  default: () => {};
40
40
  };
41
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], "onClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
41
+ }, () => "" | JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], "onClose", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
42
42
  title: {
43
43
  type: PropType<string>;
44
44
  default: string;
@@ -112,7 +112,7 @@ declare const _default: {
112
112
  };
113
113
  }>> & {
114
114
  onOnClose?: ((...args: any[]) => any) | undefined;
115
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], string, {
115
+ }, () => "" | JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], string, {
116
116
  title: string;
117
117
  style: import("vue").CSSProperties;
118
118
  visible: boolean;
@@ -182,7 +182,7 @@ declare const _default: {
182
182
  };
183
183
  }>> & {
184
184
  onOnClose?: ((...args: any[]) => any) | undefined;
185
- } & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
185
+ } & import("vue").ShallowUnwrapRef<() => "" | JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
186
186
  __isFragment?: undefined;
187
187
  __isTeleport?: undefined;
188
188
  __isSuspense?: undefined;
@@ -227,7 +227,7 @@ declare const _default: {
227
227
  };
228
228
  }>> & {
229
229
  onOnClose?: ((...args: any[]) => any) | undefined;
230
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], "onClose", {
230
+ }, () => "" | JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClose"[], "onClose", {
231
231
  title: string;
232
232
  style: import("vue").CSSProperties;
233
233
  visible: boolean;
@@ -1,4 +1,8 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
+ updateModelValue: {
3
+ type: import("vue").PropType<(v: string) => void>;
4
+ default: () => void;
5
+ };
2
6
  onChange: {
3
7
  type: import("vue").PropType<(v: string) => void>;
4
8
  default: () => void;
@@ -112,6 +116,10 @@ declare const _default: import("vue").DefineComponent<{
112
116
  type: import("vue").PropType<(h: string) => Promise<string>>;
113
117
  };
114
118
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
119
+ updateModelValue: {
120
+ type: import("vue").PropType<(v: string) => void>;
121
+ default: () => void;
122
+ };
115
123
  onChange: {
116
124
  type: import("vue").PropType<(v: string) => void>;
117
125
  default: () => void;
@@ -241,6 +249,7 @@ declare const _default: import("vue").DefineComponent<{
241
249
  formatCopiedText: (text: string) => string;
242
250
  noHighlight: boolean;
243
251
  setting: import('../../type').SettingType;
252
+ updateModelValue: (v: string) => void;
244
253
  previewOnly: boolean;
245
254
  }, {}>;
246
255
  export default _default;
@@ -57,6 +57,10 @@ export declare const contentPreviewProps: {
57
57
  };
58
58
  };
59
59
  export declare const contentProps: {
60
+ updateModelValue: {
61
+ type: PropType<(v: string) => void>;
62
+ default: () => void;
63
+ };
60
64
  onChange: {
61
65
  type: PropType<(v: string) => void>;
62
66
  default: () => void;
@@ -17,3 +17,4 @@ export declare const CTRL_SHIFT_Z = "ctrlShiftZ";
17
17
  export declare const CATALOG_CHANGED = "catalogChanged";
18
18
  export declare const PUSH_CATALOG = "pushCatalog";
19
19
  export declare const RERENDER = "rerender";
20
+ export declare const EVENT_LISTENER = "eventListener";
@@ -2,7 +2,7 @@ import { LooseRequired } from '@vue/shared';
2
2
  import markdownit from 'markdown-it/lib';
3
3
  import { Component, ExtractPropTypes, SetupContext } from 'vue';
4
4
  import { Extension } from '@codemirror/state';
5
- import { KeyBinding } from '@codemirror/view';
5
+ import { KeyBinding, EditorView } from '@codemirror/view';
6
6
  import { editorProps, mdPreviewProps } from './props';
7
7
  import { IconName } from './components/Icon/Icon';
8
8
  declare global {
@@ -302,6 +302,9 @@ export interface ExposeEvent {
302
302
  htmlPreview(status: boolean): void;
303
303
  catalog(status: boolean): void;
304
304
  }
305
+ export type DOMEventHandlers = {
306
+ [e in keyof HTMLElementEventMap]?: (event: HTMLElementEventMap[e], view: EditorView) => boolean | void;
307
+ };
305
308
  export interface InsertParam {
306
309
  targetValue: string;
307
310
  select?: boolean;
@@ -396,6 +399,12 @@ export interface ExposeParam {
396
399
  * 重置已经存在的历史记录
397
400
  */
398
401
  resetHistory(): void;
402
+ /**
403
+ * codemirror事件
404
+ *
405
+ * @param handlers
406
+ */
407
+ domEventHandlers(handlers: DOMEventHandlers): void;
399
408
  }
400
409
  export type ExposePreviewParam = Pick<ExposeParam, 'rerender'>;
401
410
  export type EditorProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof editorProps>>>>;