md-editor-v3 4.12.3 → 4.13.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 (78) hide show
  1. package/README.md +24 -0
  2. package/lib/cjs/MdEditor.cjs +59 -24
  3. package/lib/cjs/chunks/config.cjs +5 -2
  4. package/lib/cjs/chunks/index.cjs +34 -9
  5. package/lib/cjs/chunks/index4.cjs +2 -0
  6. package/lib/es/MdEditor.mjs +60 -25
  7. package/lib/es/chunks/config.mjs +5 -2
  8. package/lib/es/chunks/index.mjs +35 -10
  9. package/lib/es/chunks/index4.mjs +11 -9
  10. package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +3 -2
  11. package/lib/types/DropdownToolbar/index.d.ts +17 -16
  12. package/lib/types/MdCatalog/CatalogLink.d.ts +5 -4
  13. package/lib/types/MdCatalog/MdCatalog.d.ts +3 -2
  14. package/lib/types/MdCatalog/index.d.ts +19 -18
  15. package/lib/types/MdEditor/Editor.d.ts +37 -37
  16. package/lib/types/MdEditor/components/Checkbox/index.d.ts +2 -1
  17. package/lib/types/MdEditor/components/Divider/index.d.ts +1 -1
  18. package/lib/types/MdEditor/components/Dropdown/index.d.ts +2 -1
  19. package/lib/types/MdEditor/components/Icon/Icon.d.ts +3 -2
  20. package/lib/types/MdEditor/components/Icon/Str.d.ts +1 -0
  21. package/lib/types/MdEditor/components/Icon/index.d.ts +3 -2
  22. package/lib/types/MdEditor/components/Modal/Modal.d.ts +2 -1
  23. package/lib/types/MdEditor/components/Modal/index.d.ts +18 -17
  24. package/lib/types/MdEditor/components/Popper/index.d.ts +2 -1
  25. package/lib/types/MdEditor/composition.d.ts +4 -4
  26. package/lib/types/MdEditor/config.d.ts +3 -2
  27. package/lib/types/MdEditor/index.d.ts +27 -26
  28. package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +14 -13
  29. package/lib/types/MdEditor/layouts/Content/codemirror/autocompletion.d.ts +2 -1
  30. package/lib/types/MdEditor/layouts/Content/codemirror/commands.d.ts +2 -1
  31. package/lib/types/MdEditor/layouts/Content/codemirror/index.d.ts +3 -2
  32. package/lib/types/MdEditor/layouts/Content/codemirror/themeLight.d.ts +2 -1
  33. package/lib/types/MdEditor/layouts/Content/codemirror/themeOneDark.d.ts +2 -4
  34. package/lib/types/MdEditor/layouts/Content/composition/index.d.ts +7 -6
  35. package/lib/types/MdEditor/layouts/Content/composition/useAttach.d.ts +2 -1
  36. package/lib/types/MdEditor/layouts/Content/composition/useAutoScroll.d.ts +3 -2
  37. package/lib/types/MdEditor/layouts/Content/composition/useCodeMirror.d.ts +4 -3
  38. package/lib/types/MdEditor/layouts/Content/composition/useCopyCode.d.ts +2 -1
  39. package/lib/types/MdEditor/layouts/Content/composition/useHighlight.d.ts +1 -0
  40. package/lib/types/MdEditor/layouts/Content/composition/useKatex.d.ts +1 -0
  41. package/lib/types/MdEditor/layouts/Content/composition/useMarkdownIt.d.ts +3 -2
  42. package/lib/types/MdEditor/layouts/Content/composition/useMermaid.d.ts +2 -1
  43. package/lib/types/MdEditor/layouts/Content/composition/usePasteUpload.d.ts +1 -0
  44. package/lib/types/MdEditor/layouts/Content/composition/useResize.d.ts +2 -1
  45. package/lib/types/MdEditor/layouts/Content/composition/userZoom.d.ts +2 -1
  46. package/lib/types/MdEditor/layouts/Content/index.d.ts +14 -14
  47. package/lib/types/MdEditor/layouts/Content/markdownIt/codetabs/index.d.ts +2 -9
  48. package/lib/types/MdEditor/layouts/Content/markdownIt/heading/index.d.ts +3 -2
  49. package/lib/types/MdEditor/layouts/Content/markdownIt/katex/index.d.ts +1 -5
  50. package/lib/types/MdEditor/layouts/Content/markdownIt/mermaid/index.d.ts +2 -1
  51. package/lib/types/MdEditor/layouts/Content/props.d.ts +4 -3
  52. package/lib/types/MdEditor/layouts/Content/type.d.ts +1 -0
  53. package/lib/types/MdEditor/layouts/Footer/MarkdownTotal.d.ts +2 -1
  54. package/lib/types/MdEditor/layouts/Footer/ScrollAuto.d.ts +2 -1
  55. package/lib/types/MdEditor/layouts/Footer/index.d.ts +3 -2
  56. package/lib/types/MdEditor/layouts/Modals/Clip.d.ts +2 -1
  57. package/lib/types/MdEditor/layouts/Modals/Link.d.ts +2 -1
  58. package/lib/types/MdEditor/layouts/Modals/index.d.ts +2 -1
  59. package/lib/types/MdEditor/layouts/Toolbar/TableShape.d.ts +2 -1
  60. package/lib/types/MdEditor/layouts/Toolbar/composition.d.ts +1 -0
  61. package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +9 -8
  62. package/lib/types/MdEditor/layouts/Toolbar/props.d.ts +4 -3
  63. package/lib/types/MdEditor/props.d.ts +3 -2
  64. package/lib/types/MdEditor/static/event-name.d.ts +1 -0
  65. package/lib/types/MdEditor/type.d.ts +18 -6
  66. package/lib/types/MdEditor/utils/content-help.d.ts +2 -1
  67. package/lib/types/MdEditor/utils/scroll-auto.d.ts +2 -1
  68. package/lib/types/MdEditor/utils/vue-tsx.d.ts +2 -1
  69. package/lib/types/MdPreview/MdPreview.d.ts +18 -18
  70. package/lib/types/MdPreview/composition/useExpose.d.ts +2 -1
  71. package/lib/types/MdPreview/index.d.ts +24 -23
  72. package/lib/types/ModalToolbar/ModalToolbar.d.ts +3 -2
  73. package/lib/types/ModalToolbar/index.d.ts +17 -16
  74. package/lib/types/NormalToolbar/NormalToolbar.d.ts +3 -2
  75. package/lib/types/NormalToolbar/index.d.ts +17 -16
  76. package/lib/types/config.d.ts +2 -2
  77. package/lib/umd/index.js +36 -36
  78. package/package.json +2 -2
@@ -1,6 +1,6 @@
1
1
  const prefix = "md-editor";
2
- const iconfontSvgUrl = "https://at.alicdn.com/t/c/font_2605852_prouiefeic.js";
3
- const iconfontClassUrl = "https://at.alicdn.com/t/c/font_2605852_prouiefeic.css";
2
+ const iconfontSvgUrl = "https://at.alicdn.com/t/c/font_2605852_rfu1p40qggh.js";
3
+ const iconfontClassUrl = "https://at.alicdn.com/t/c/font_2605852_rfu1p40qggh.css";
4
4
  const cdnBase = "https://cdnjs.cloudflare.com/ajax/libs";
5
5
  const highlightUrl = `${cdnBase}/highlight.js/11.8.0/highlight.min.js`;
6
6
  const prettierUrl = {
@@ -42,6 +42,7 @@ const allToolbar = [
42
42
  "pageFullscreen",
43
43
  "fullscreen",
44
44
  "preview",
45
+ "previewOnly",
45
46
  "htmlPreview",
46
47
  "catalog",
47
48
  "github"
@@ -75,6 +76,7 @@ const staticTextDefault = {
75
76
  pageFullscreen: "浏览器全屏",
76
77
  fullscreen: "屏幕全屏",
77
78
  preview: "预览",
79
+ previewOnly: "仅预览",
78
80
  htmlPreview: "html代码预览",
79
81
  catalog: "目录",
80
82
  github: "源码地址"
@@ -156,6 +158,7 @@ const staticTextDefault = {
156
158
  pageFullscreen: "fullscreen in page",
157
159
  fullscreen: "fullscreen",
158
160
  preview: "preview",
161
+ previewOnly: "preview only",
159
162
  htmlPreview: "html preview",
160
163
  catalog: "catalog",
161
164
  github: "source code"
@@ -1,9 +1,9 @@
1
1
  import { inject, watch, toRef, onMounted, nextTick, shallowRef, ref, computed, defineComponent, createVNode, Fragment, reactive, provide, onBeforeUnmount } from "vue";
2
2
  import { e as configOption, p as prefix, m as mermaidUrl, k as katexUrl, f as codeCss, h as highlightUrl, s as staticTextDefault, a as iconfontSvgUrl, i as iconfontClassUrl, g as prettierUrl, j as cropperUrl, b as allToolbar, d as allFooter } from "./config.mjs";
3
- import { a as generateCodeRowNumber, b as bus, P as PUSH_CATALOG, C as CATALOG_CHANGED, R as RERENDER, B as BUILD_FINISHED, O as ON_SAVE, E as ERROR_CATCHER, U as UPLOAD_IMAGE, c as CHANGE_CATALOG_VISIBLE, d as PAGE_FULL_SCREEN_CHANGED, F as FULL_SCREEN_CHANGED, e as PREVIEW_CHANGED, H as HTML_PREVIEW_CHANGED, f as CATALOG_VISIBLE_CHANGED, h as REPLACE, i as CHANGE_FULL_SCREEN, j as EVENT_LISTENER, k as getNextId } from "./index4.mjs";
3
+ import { a as generateCodeRowNumber, b as bus, P as PUSH_CATALOG, C as CATALOG_CHANGED, R as RERENDER, B as BUILD_FINISHED, O as ON_SAVE, E as ERROR_CATCHER, U as UPLOAD_IMAGE, c as CHANGE_CATALOG_VISIBLE, d as PAGE_FULL_SCREEN_CHANGED, F as FULL_SCREEN_CHANGED, e as PREVIEW_CHANGED, f as PREVIEW_ONLY_CHANGED, H as HTML_PREVIEW_CHANGED, h as CATALOG_VISIBLE_CHANGED, i as REPLACE, j as CHANGE_FULL_SCREEN, k as EVENT_LISTENER, l as getNextId } from "./index4.mjs";
4
4
  import { a as appendHandler, u as updateHandler } from "./dom.mjs";
5
+ import { debounce, uuid, deepMerge, deepClone } from "@vavt/util";
5
6
  import mediumZoom from "medium-zoom";
6
- import { debounce, uuid } from "@vavt/util";
7
7
  import copy from "copy-to-clipboard";
8
8
  import mdit from "markdown-it";
9
9
  import ImageFiguresPlugin from "markdown-it-image-figures";
@@ -1049,11 +1049,10 @@ const useProvidePreview = (props) => {
1049
1049
  ...staticTextDefault,
1050
1050
  ...(_b2 = (_a2 = configOption) == null ? void 0 : _a2.editorConfig) == null ? void 0 : _b2.languageUserDefined
1051
1051
  };
1052
- if (allText[props.language]) {
1053
- return allText[props.language];
1054
- } else {
1055
- return staticTextDefault["zh-CN"];
1056
- }
1052
+ return deepMerge(
1053
+ deepClone(staticTextDefault["en-US"]),
1054
+ allText[props.language] || {}
1055
+ );
1057
1056
  });
1058
1057
  provide("usedLanguageText", usedLanguageText);
1059
1058
  provide(
@@ -1144,14 +1143,19 @@ const useConfig = (props, context) => {
1144
1143
  pageFullscreen: props.pageFullscreen,
1145
1144
  fullscreen: false,
1146
1145
  preview: props.preview,
1147
- htmlPreview: props.preview ? false : props.htmlPreview
1146
+ htmlPreview: props.preview ? false : props.htmlPreview,
1147
+ previewOnly: false
1148
1148
  });
1149
1149
  const updateSetting = (k, v) => {
1150
1150
  setting[k] = v === void 0 ? !setting[k] : v;
1151
- if (k === "preview" && setting.preview) {
1151
+ if (k === "preview") {
1152
1152
  setting.htmlPreview = false;
1153
- } else if (k === "htmlPreview" && setting.htmlPreview) {
1153
+ setting.previewOnly = false;
1154
+ } else if (k === "htmlPreview") {
1154
1155
  setting.preview = false;
1156
+ setting.previewOnly = false;
1157
+ } else if (k === "previewOnly" && !setting.preview && !setting.htmlPreview) {
1158
+ setting.preview = true;
1155
1159
  }
1156
1160
  };
1157
1161
  let bodyOverflowHistory = "";
@@ -1226,6 +1230,12 @@ const useExpose$1 = (props, ctx, catalogVisible, setting, updateSetting, codeRef
1226
1230
  bus.emit(editorId, PREVIEW_CHANGED, newVal);
1227
1231
  }
1228
1232
  );
1233
+ watch(
1234
+ () => setting.previewOnly,
1235
+ (newVal) => {
1236
+ bus.emit(editorId, PREVIEW_ONLY_CHANGED, newVal);
1237
+ }
1238
+ );
1229
1239
  watch(
1230
1240
  () => setting.htmlPreview,
1231
1241
  (newVal) => {
@@ -1265,6 +1275,15 @@ const useExpose$1 = (props, ctx, catalogVisible, setting, updateSetting, codeRef
1265
1275
  });
1266
1276
  break;
1267
1277
  }
1278
+ case "previewOnly": {
1279
+ bus.on(editorId, {
1280
+ name: PREVIEW_ONLY_CHANGED,
1281
+ callback(status) {
1282
+ callBack(status);
1283
+ }
1284
+ });
1285
+ break;
1286
+ }
1268
1287
  case "htmlPreview": {
1269
1288
  bus.on(editorId, {
1270
1289
  name: HTML_PREVIEW_CHANGED,
@@ -1294,6 +1313,9 @@ const useExpose$1 = (props, ctx, catalogVisible, setting, updateSetting, codeRef
1294
1313
  togglePreview(status) {
1295
1314
  updateSetting("preview", status);
1296
1315
  },
1316
+ togglePreviewOnly(status) {
1317
+ updateSetting("previewOnly", status);
1318
+ },
1297
1319
  toggleHtmlPreview(status) {
1298
1320
  updateSetting("htmlPreview", status);
1299
1321
  },
@@ -1323,6 +1345,9 @@ const useExpose$1 = (props, ctx, catalogVisible, setting, updateSetting, codeRef
1323
1345
  },
1324
1346
  domEventHandlers(handlers) {
1325
1347
  bus.emit(editorId, EVENT_LISTENER, handlers);
1348
+ },
1349
+ execCommand(direct) {
1350
+ bus.emit(editorId, REPLACE, direct);
1326
1351
  }
1327
1352
  };
1328
1353
  ctx.expose(exposeParam);
@@ -57,6 +57,7 @@ const CHANGE_FULL_SCREEN = "changeFullscreen";
57
57
  const PAGE_FULL_SCREEN_CHANGED = "pageFullscreenChanged";
58
58
  const FULL_SCREEN_CHANGED = "fullscreenChanged";
59
59
  const PREVIEW_CHANGED = "previewChanged";
60
+ const PREVIEW_ONLY_CHANGED = "previewOnlyChanged";
60
61
  const HTML_PREVIEW_CHANGED = "htmlPreviewChanged";
61
62
  const CATALOG_VISIBLE_CHANGED = "catalogVisibleChanged";
62
63
  const BUILD_FINISHED = "buildFinished";
@@ -129,14 +130,15 @@ export {
129
130
  CHANGE_CATALOG_VISIBLE as c,
130
131
  PAGE_FULL_SCREEN_CHANGED as d,
131
132
  PREVIEW_CHANGED as e,
132
- CATALOG_VISIBLE_CHANGED as f,
133
+ PREVIEW_ONLY_CHANGED as f,
133
134
  getRelativeTop as g,
134
- REPLACE as h,
135
- CHANGE_FULL_SCREEN as i,
136
- EVENT_LISTENER as j,
137
- getNextId as k,
138
- base642File as l,
139
- OPEN_MODALS as m,
140
- CTRL_SHIFT_Z as n,
141
- CTRL_Z as o
135
+ CATALOG_VISIBLE_CHANGED as h,
136
+ REPLACE as i,
137
+ CHANGE_FULL_SCREEN as j,
138
+ EVENT_LISTENER as k,
139
+ getNextId as l,
140
+ base642File as m,
141
+ OPEN_MODALS as n,
142
+ CTRL_SHIFT_Z as o,
143
+ CTRL_Z as p
142
144
  };
@@ -1,6 +1,7 @@
1
- import { PropType, ExtractPropTypes } from 'vue';
2
1
  import { Themes } from '../MdEditor/type';
3
- declare const _default: import("vue").DefineComponent<{
2
+ import { PropType, ExtractPropTypes } from 'vue';
3
+
4
+ declare const _default: import('vue').DefineComponent<{
4
5
  title: {
5
6
  type: PropType<string>;
6
7
  default: string;
@@ -1,11 +1,12 @@
1
1
  import { App } from 'vue';
2
+
2
3
  declare const _default: {
3
4
  new (...args: any[]): {
4
- $: import("vue").ComponentInternalInstance;
5
+ $: import('vue').ComponentInternalInstance;
5
6
  $data: {};
6
7
  $props: Partial<{
7
8
  title: string;
8
- }> & Omit<Readonly<import("vue").ExtractPropTypes<{
9
+ }> & Omit<Readonly<import('vue').ExtractPropTypes<{
9
10
  title: {
10
11
  type: import("vue").PropType<string>;
11
12
  default: string;
@@ -36,7 +37,7 @@ declare const _default: {
36
37
  };
37
38
  }>> & {
38
39
  onOnChange?: ((...args: any[]) => any) | undefined;
39
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title">;
40
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "title">;
40
41
  $attrs: {
41
42
  [x: string]: unknown;
42
43
  };
@@ -44,13 +45,13 @@ declare const _default: {
44
45
  [x: string]: unknown;
45
46
  };
46
47
  $slots: Readonly<{
47
- [name: string]: import("vue").Slot | undefined;
48
+ [name: string]: import('vue').Slot | undefined;
48
49
  }>;
49
- $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
50
- $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
50
+ $root: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
51
+ $parent: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
51
52
  $emit: (event: "onChange", ...args: any[]) => void;
52
53
  $el: any;
53
- $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
54
+ $options: import('vue').ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
54
55
  title: {
55
56
  type: import("vue").PropType<string>;
56
57
  default: string;
@@ -96,14 +97,14 @@ declare const _default: {
96
97
  beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
97
98
  destroyed?: ((() => void) | (() => void)[]) | undefined;
98
99
  unmounted?: ((() => void) | (() => void)[]) | undefined;
99
- renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
100
- renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
101
- errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
100
+ renderTracked?: (((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[]) | undefined;
101
+ renderTriggered?: (((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[]) | undefined;
102
+ errorCaptured?: (((err: unknown, instance: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
102
103
  };
103
104
  $forceUpdate: () => void;
104
- $nextTick: typeof import("vue").nextTick;
105
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
106
- } & Readonly<import("vue").ExtractPropTypes<{
105
+ $nextTick: typeof import('vue').nextTick;
106
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import('vue').WatchOptions<boolean> | undefined): import('vue').WatchStopHandle;
107
+ } & Readonly<import('vue').ExtractPropTypes<{
107
108
  title: {
108
109
  type: import("vue").PropType<string>;
109
110
  default: string;
@@ -134,11 +135,11 @@ declare const _default: {
134
135
  };
135
136
  }>> & {
136
137
  onOnChange?: ((...args: any[]) => any) | undefined;
137
- } & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
138
+ } & import('vue').ShallowUnwrapRef<() => JSX.Element> & {} & import('vue').ComponentCustomProperties & {};
138
139
  __isFragment?: undefined;
139
140
  __isTeleport?: undefined;
140
141
  __isSuspense?: undefined;
141
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
142
+ } & import('vue').ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
142
143
  title: {
143
144
  type: import("vue").PropType<string>;
144
145
  default: string;
@@ -171,7 +172,7 @@ declare const _default: {
171
172
  onOnChange?: ((...args: any[]) => any) | undefined;
172
173
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onChange"[], "onChange", {
173
174
  title: string;
174
- }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
175
+ }, {}, string> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
175
176
  install: (app: App) => App;
176
177
  };
177
178
  export default _default;
@@ -1,7 +1,8 @@
1
- import { PropType, ExtractPropTypes } from 'vue';
2
- import { LooseRequired } from '@vue/shared';
3
- import { MdHeadingId } from '../MdEditor/type';
4
1
  import { TocItem } from './MdCatalog';
2
+ import { MdHeadingId } from '../MdEditor/type';
3
+ import { LooseRequired } from '@vue/shared';
4
+ import { PropType, ExtractPropTypes } from 'vue';
5
+
5
6
  declare const props: {
6
7
  tocItem: {
7
8
  type: PropType<TocItem>;
@@ -25,7 +26,7 @@ declare const props: {
25
26
  };
26
27
  };
27
28
  export type CatalogLinkProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof props>>>>;
28
- declare const CatalogLink: import("vue").DefineComponent<{
29
+ declare const CatalogLink: import('vue').DefineComponent<{
29
30
  tocItem: {
30
31
  type: PropType<TocItem>;
31
32
  default: () => {};
@@ -1,5 +1,6 @@
1
- import { PropType, ExtractPropTypes } from 'vue';
2
1
  import { HeadList, MdHeadingId, Themes } from '../MdEditor/type';
2
+ import { PropType, ExtractPropTypes } from 'vue';
3
+
3
4
  export interface TocItem {
4
5
  text: string;
5
6
  level: number;
@@ -7,7 +8,7 @@ export interface TocItem {
7
8
  active: boolean;
8
9
  children?: Array<TocItem>;
9
10
  }
10
- declare const MdCatalog: import("vue").DefineComponent<{
11
+ declare const MdCatalog: import('vue').DefineComponent<{
11
12
  /**
12
13
  * 编辑器的Id,务必与需要绑定的编辑器Id相同
13
14
  */
@@ -1,15 +1,16 @@
1
1
  import { App } from 'vue';
2
+
2
3
  declare const _default: {
3
4
  new (...args: any[]): {
4
- $: import("vue").ComponentInternalInstance;
5
+ $: import('vue').ComponentInternalInstance;
5
6
  $data: {};
6
7
  $props: Partial<{
7
8
  class: string;
8
- theme: import("..").Themes;
9
- mdHeadingId: import("..").MdHeadingId;
9
+ theme: import('..').Themes;
10
+ mdHeadingId: import('..').MdHeadingId;
10
11
  scrollElementOffsetTop: number;
11
12
  offsetTop: number;
12
- }> & Omit<Readonly<import("vue").ExtractPropTypes<{
13
+ }> & Omit<Readonly<import('vue').ExtractPropTypes<{
13
14
  editorId: {
14
15
  type: import("vue").PropType<string>;
15
16
  };
@@ -45,7 +46,7 @@ declare const _default: {
45
46
  }>> & {
46
47
  onOnClick?: ((...args: any[]) => any) | undefined;
47
48
  onOnActive?: ((...args: any[]) => any) | undefined;
48
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "class" | "theme" | "mdHeadingId" | "scrollElementOffsetTop" | "offsetTop">;
49
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "class" | "theme" | "mdHeadingId" | "scrollElementOffsetTop" | "offsetTop">;
49
50
  $attrs: {
50
51
  [x: string]: unknown;
51
52
  };
@@ -53,13 +54,13 @@ declare const _default: {
53
54
  [x: string]: unknown;
54
55
  };
55
56
  $slots: Readonly<{
56
- [name: string]: import("vue").Slot | undefined;
57
+ [name: string]: import('vue').Slot | undefined;
57
58
  }>;
58
- $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
59
- $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
59
+ $root: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
60
+ $parent: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
60
61
  $emit: (event: "onClick" | "onActive", ...args: any[]) => void;
61
62
  $el: any;
62
- $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
63
+ $options: import('vue').ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
63
64
  editorId: {
64
65
  type: import("vue").PropType<string>;
65
66
  };
@@ -114,14 +115,14 @@ declare const _default: {
114
115
  beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
115
116
  destroyed?: ((() => void) | (() => void)[]) | undefined;
116
117
  unmounted?: ((() => void) | (() => void)[]) | undefined;
117
- renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
118
- renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
119
- errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
118
+ renderTracked?: (((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[]) | undefined;
119
+ renderTriggered?: (((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[]) | undefined;
120
+ errorCaptured?: (((err: unknown, instance: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
120
121
  };
121
122
  $forceUpdate: () => void;
122
- $nextTick: typeof import("vue").nextTick;
123
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
124
- } & Readonly<import("vue").ExtractPropTypes<{
123
+ $nextTick: typeof import('vue').nextTick;
124
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import('vue').WatchOptions<boolean> | undefined): import('vue').WatchStopHandle;
125
+ } & Readonly<import('vue').ExtractPropTypes<{
125
126
  editorId: {
126
127
  type: import("vue").PropType<string>;
127
128
  };
@@ -157,11 +158,11 @@ declare const _default: {
157
158
  }>> & {
158
159
  onOnClick?: ((...args: any[]) => any) | undefined;
159
160
  onOnActive?: ((...args: any[]) => any) | undefined;
160
- } & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
161
+ } & import('vue').ShallowUnwrapRef<() => JSX.Element> & {} & import('vue').ComponentCustomProperties & {};
161
162
  __isFragment?: undefined;
162
163
  __isTeleport?: undefined;
163
164
  __isSuspense?: undefined;
164
- } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
165
+ } & import('vue').ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
165
166
  editorId: {
166
167
  type: import("vue").PropType<string>;
167
168
  };
@@ -203,7 +204,7 @@ declare const _default: {
203
204
  mdHeadingId: import("..").MdHeadingId;
204
205
  scrollElementOffsetTop: number;
205
206
  offsetTop: number;
206
- }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
207
+ }, {}, string> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
207
208
  install: (app: App) => App;
208
209
  };
209
210
  export default _default;
@@ -1,12 +1,12 @@
1
- declare const Editor: import("vue").DefineComponent<{
1
+ declare const Editor: import('vue').DefineComponent<{
2
2
  onChange: {
3
- type: import("vue").PropType<import('./type').ChangeEvent>;
3
+ type: import("vue").PropType<import("~/type").ChangeEvent>;
4
4
  };
5
5
  onSave: {
6
- type: import("vue").PropType<import('./type').SaveEvent>;
6
+ type: import("vue").PropType<import("~/type").SaveEvent>;
7
7
  };
8
8
  onUploadImg: {
9
- type: import("vue").PropType<import('./type').UploadImgEvent>;
9
+ type: import("vue").PropType<import("~/type").UploadImgEvent>;
10
10
  };
11
11
  pageFullscreen: {
12
12
  type: import("vue").PropType<boolean>;
@@ -21,11 +21,11 @@ declare const Editor: import("vue").DefineComponent<{
21
21
  default: boolean;
22
22
  };
23
23
  toolbars: {
24
- type: import("vue").PropType<import('./type').ToolbarNames[]>;
24
+ type: import("vue").PropType<import("~/type").ToolbarNames[]>;
25
25
  default: string[];
26
26
  };
27
27
  toolbarsExclude: {
28
- type: import("vue").PropType<import('./type').ToolbarNames[]>;
28
+ type: import("vue").PropType<import("~/type").ToolbarNames[]>;
29
29
  default: never[];
30
30
  };
31
31
  noPrettier: {
@@ -48,11 +48,11 @@ declare const Editor: import("vue").DefineComponent<{
48
48
  type: import("vue").PropType<string | JSX.Element>;
49
49
  };
50
50
  onError: {
51
- type: import("vue").PropType<import('./type').ErrorEvent>;
51
+ type: import("vue").PropType<import("~/type").ErrorEvent>;
52
52
  };
53
53
  footers: {
54
- type: import("vue").PropType<import('./type').Footers[]>;
55
- default: import('./type').Footers[];
54
+ type: import("vue").PropType<import("~/type").Footers[]>;
55
+ default: import("~/type").Footers[];
56
56
  };
57
57
  scrollAuto: {
58
58
  type: import("vue").PropType<boolean>;
@@ -110,7 +110,7 @@ declare const Editor: import("vue").DefineComponent<{
110
110
  default: string;
111
111
  };
112
112
  theme: {
113
- type: import("vue").PropType<import('./type').Themes>;
113
+ type: import("vue").PropType<import("~/type").Themes>;
114
114
  default: string;
115
115
  };
116
116
  class: {
@@ -122,10 +122,10 @@ declare const Editor: import("vue").DefineComponent<{
122
122
  default: string;
123
123
  };
124
124
  onHtmlChanged: {
125
- type: import("vue").PropType<import('./type').HtmlChangedEvent>;
125
+ type: import("vue").PropType<import("~/type").HtmlChangedEvent>;
126
126
  };
127
127
  onGetCatalog: {
128
- type: import("vue").PropType<import('./type').GetCatalogEvent>;
128
+ type: import("vue").PropType<import("~/type").GetCatalogEvent>;
129
129
  };
130
130
  editorId: {
131
131
  type: import("vue").PropType<string>;
@@ -144,8 +144,8 @@ declare const Editor: import("vue").DefineComponent<{
144
144
  default: () => {};
145
145
  };
146
146
  mdHeadingId: {
147
- type: import("vue").PropType<import('./type').MdHeadingId>;
148
- default: import('./type').MdHeadingId;
147
+ type: import("vue").PropType<import("~/type").MdHeadingId>;
148
+ default: import("~/type").MdHeadingId;
149
149
  };
150
150
  sanitize: {
151
151
  type: import("vue").PropType<(html: string) => string>;
@@ -187,22 +187,22 @@ declare const Editor: import("vue").DefineComponent<{
187
187
  default: boolean;
188
188
  };
189
189
  customIcon: {
190
- type: import("vue").PropType<import('./type').CustomIcon>;
190
+ type: import("vue").PropType<import("~/type").CustomIcon>;
191
191
  default: {};
192
192
  };
193
193
  sanitizeMermaid: {
194
194
  type: import("vue").PropType<(h: string) => Promise<string>>;
195
195
  default: (h: string) => Promise<string>;
196
196
  };
197
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import('./type').EditorEmits, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue" | "onBlur" | "onFocus" | "onInput" | "onDrop" | "onInputBoxWitdhChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
197
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("~/type").EditorEmits, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue" | "onBlur" | "onFocus" | "onInput" | "onDrop" | "onInputBoxWitdhChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
198
198
  onChange: {
199
- type: import("vue").PropType<import('./type').ChangeEvent>;
199
+ type: import("vue").PropType<import("~/type").ChangeEvent>;
200
200
  };
201
201
  onSave: {
202
- type: import("vue").PropType<import('./type').SaveEvent>;
202
+ type: import("vue").PropType<import("~/type").SaveEvent>;
203
203
  };
204
204
  onUploadImg: {
205
- type: import("vue").PropType<import('./type').UploadImgEvent>;
205
+ type: import("vue").PropType<import("~/type").UploadImgEvent>;
206
206
  };
207
207
  pageFullscreen: {
208
208
  type: import("vue").PropType<boolean>;
@@ -217,11 +217,11 @@ declare const Editor: import("vue").DefineComponent<{
217
217
  default: boolean;
218
218
  };
219
219
  toolbars: {
220
- type: import("vue").PropType<import('./type').ToolbarNames[]>;
220
+ type: import("vue").PropType<import("~/type").ToolbarNames[]>;
221
221
  default: string[];
222
222
  };
223
223
  toolbarsExclude: {
224
- type: import("vue").PropType<import('./type').ToolbarNames[]>;
224
+ type: import("vue").PropType<import("~/type").ToolbarNames[]>;
225
225
  default: never[];
226
226
  };
227
227
  noPrettier: {
@@ -244,11 +244,11 @@ declare const Editor: import("vue").DefineComponent<{
244
244
  type: import("vue").PropType<string | JSX.Element>;
245
245
  };
246
246
  onError: {
247
- type: import("vue").PropType<import('./type').ErrorEvent>;
247
+ type: import("vue").PropType<import("~/type").ErrorEvent>;
248
248
  };
249
249
  footers: {
250
- type: import("vue").PropType<import('./type').Footers[]>;
251
- default: import('./type').Footers[];
250
+ type: import("vue").PropType<import("~/type").Footers[]>;
251
+ default: import("~/type").Footers[];
252
252
  };
253
253
  scrollAuto: {
254
254
  type: import("vue").PropType<boolean>;
@@ -306,7 +306,7 @@ declare const Editor: import("vue").DefineComponent<{
306
306
  default: string;
307
307
  };
308
308
  theme: {
309
- type: import("vue").PropType<import('./type').Themes>;
309
+ type: import("vue").PropType<import("~/type").Themes>;
310
310
  default: string;
311
311
  };
312
312
  class: {
@@ -318,10 +318,10 @@ declare const Editor: import("vue").DefineComponent<{
318
318
  default: string;
319
319
  };
320
320
  onHtmlChanged: {
321
- type: import("vue").PropType<import('./type').HtmlChangedEvent>;
321
+ type: import("vue").PropType<import("~/type").HtmlChangedEvent>;
322
322
  };
323
323
  onGetCatalog: {
324
- type: import("vue").PropType<import('./type').GetCatalogEvent>;
324
+ type: import("vue").PropType<import("~/type").GetCatalogEvent>;
325
325
  };
326
326
  editorId: {
327
327
  type: import("vue").PropType<string>;
@@ -340,8 +340,8 @@ declare const Editor: import("vue").DefineComponent<{
340
340
  default: () => {};
341
341
  };
342
342
  mdHeadingId: {
343
- type: import("vue").PropType<import('./type').MdHeadingId>;
344
- default: import('./type').MdHeadingId;
343
+ type: import("vue").PropType<import("~/type").MdHeadingId>;
344
+ default: import("~/type").MdHeadingId;
345
345
  };
346
346
  sanitize: {
347
347
  type: import("vue").PropType<(html: string) => string>;
@@ -383,7 +383,7 @@ declare const Editor: import("vue").DefineComponent<{
383
383
  default: boolean;
384
384
  };
385
385
  customIcon: {
386
- type: import("vue").PropType<import('./type').CustomIcon>;
386
+ type: import("vue").PropType<import("~/type").CustomIcon>;
387
387
  default: {};
388
388
  };
389
389
  sanitizeMermaid: {
@@ -409,23 +409,23 @@ declare const Editor: import("vue").DefineComponent<{
409
409
  htmlPreview: boolean;
410
410
  class: string;
411
411
  style: string | import("vue").CSSProperties;
412
- toolbars: import('./type').ToolbarNames[];
413
- toolbarsExclude: import('./type').ToolbarNames[];
412
+ language: string;
413
+ toolbars: import("~/type").ToolbarNames[];
414
+ toolbarsExclude: import("~/type").ToolbarNames[];
414
415
  noPrettier: boolean;
415
416
  tabWidth: number;
416
417
  tableShape: number[];
417
418
  placeholder: string;
418
- footers: import('./type').Footers[];
419
+ footers: import("~/type").Footers[];
419
420
  scrollAuto: boolean;
420
421
  showToolbarName: boolean;
421
422
  inputBoxWitdh: string;
422
423
  modelValue: string;
423
- theme: import('./type').Themes;
424
- language: string;
424
+ theme: import("~/type").Themes;
425
425
  editorId: string;
426
426
  showCodeRowNumber: boolean;
427
427
  previewTheme: string;
428
- mdHeadingId: import('./type').MdHeadingId;
428
+ mdHeadingId: import("~/type").MdHeadingId;
429
429
  sanitize: (html: string) => string;
430
430
  noMermaid: boolean;
431
431
  noKatex: boolean;
@@ -435,7 +435,7 @@ declare const Editor: import("vue").DefineComponent<{
435
435
  codeStyleReverseList: string[];
436
436
  noHighlight: boolean;
437
437
  noImgZoomIn: boolean;
438
- customIcon: import('./type').CustomIcon;
438
+ customIcon: import("~/type").CustomIcon;
439
439
  sanitizeMermaid: (h: string) => Promise<string>;
440
440
  }>;
441
441
  export default Editor;
@@ -1,5 +1,6 @@
1
1
  import { PropType, ExtractPropTypes } from 'vue';
2
- declare const _default: import("vue").DefineComponent<{
2
+
3
+ declare const _default: import('vue').DefineComponent<{
3
4
  checked: {
4
5
  type: PropType<boolean>;
5
6
  default: boolean;
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import('vue').DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import { PropType, EmitsOptions, ExtractPropTypes } from 'vue';
2
- declare const _default: import("vue").DefineComponent<{
2
+
3
+ declare const _default: import('vue').DefineComponent<{
3
4
  overlay: {
4
5
  type: PropType<string | JSX.Element>;
5
6
  default: string;