md-editor-v3 5.7.1 → 5.8.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/lib/cjs/DropdownToolbar.cjs +1 -1
- package/lib/cjs/MdCatalog.cjs +1 -1
- package/lib/cjs/MdEditor.cjs +7 -6
- package/lib/cjs/MdModal.cjs +1 -1
- package/lib/cjs/MdPreview.cjs +1 -1
- package/lib/cjs/ModalToolbar.cjs +1 -1
- package/lib/cjs/chunks/index.cjs +186 -2398
- package/lib/cjs/chunks/index2.cjs +285 -198
- package/lib/cjs/chunks/index3.cjs +2333 -525
- package/lib/cjs/chunks/index4.cjs +598 -281
- package/lib/cjs/index.cjs +6 -6
- package/lib/es/DropdownToolbar.mjs +1 -1
- package/lib/es/MdCatalog.mjs +1 -1
- package/lib/es/MdEditor.mjs +7 -6
- package/lib/es/MdModal.mjs +1 -1
- package/lib/es/MdPreview.mjs +1 -1
- package/lib/es/ModalToolbar.mjs +1 -1
- package/lib/es/chunks/index.mjs +188 -2400
- package/lib/es/chunks/index2.mjs +287 -200
- package/lib/es/chunks/index3.mjs +2337 -529
- package/lib/es/chunks/index4.mjs +601 -284
- package/lib/es/index.mjs +8 -8
- package/lib/types/config.d.ts +2 -2
- package/lib/types/index.d.ts +1 -6
- package/lib/types/preview.d.ts +6 -0
- package/lib/umd/index.js +2 -2
- package/lib/umd/preview.js +83 -0
- package/package.json +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const MdEditor = require("./MdEditor.cjs");
|
|
4
|
-
const MdPreview = require("./chunks/index.cjs");
|
|
5
4
|
const NormalToolbar = require("./NormalToolbar.cjs");
|
|
6
|
-
const DropdownToolbar = require("./chunks/
|
|
5
|
+
const DropdownToolbar = require("./chunks/index.cjs");
|
|
7
6
|
const ModalToolbar = require("./ModalToolbar.cjs");
|
|
8
|
-
const
|
|
9
|
-
const MdModal = require("./chunks/index4.cjs");
|
|
7
|
+
const MdModal = require("./chunks/index2.cjs");
|
|
10
8
|
const dom = require("./chunks/dom.cjs");
|
|
11
9
|
const vue = require("vue");
|
|
12
10
|
const vueTsx = require("./chunks/vue-tsx.cjs");
|
|
13
11
|
const config$1 = require("./chunks/config.cjs");
|
|
12
|
+
const MdPreview = require("./chunks/index3.cjs");
|
|
13
|
+
const MdCatalog = require("./chunks/index4.cjs");
|
|
14
14
|
const config = require("./config.cjs");
|
|
15
15
|
function _mergeNamespaces(n, m) {
|
|
16
16
|
for (var i = 0; i < m.length; i++) {
|
|
@@ -1379,11 +1379,9 @@ const clearSideEffects = () => {
|
|
|
1379
1379
|
});
|
|
1380
1380
|
};
|
|
1381
1381
|
exports.MdEditor = MdEditor;
|
|
1382
|
-
exports.MdPreview = MdPreview.MdPreview;
|
|
1383
1382
|
exports.NormalToolbar = NormalToolbar;
|
|
1384
1383
|
exports.DropdownToolbar = DropdownToolbar.DropdownToolbar;
|
|
1385
1384
|
exports.ModalToolbar = ModalToolbar;
|
|
1386
|
-
exports.MdCatalog = MdCatalog.MdCatalog;
|
|
1387
1385
|
exports.MdModal = MdModal.MdModal;
|
|
1388
1386
|
exports.StrIcon = dom.StrIcon;
|
|
1389
1387
|
exports.allFooter = config$1.allFooter;
|
|
@@ -1391,6 +1389,8 @@ exports.allToolbar = config$1.allToolbar;
|
|
|
1391
1389
|
exports.config = config$1.config;
|
|
1392
1390
|
exports.editorExtensionsAttrs = config$1.editorExtensionsAttrs;
|
|
1393
1391
|
exports.prefix = config$1.prefix;
|
|
1392
|
+
exports.MdPreview = MdPreview.MdPreview;
|
|
1393
|
+
exports.MdCatalog = MdCatalog.MdCatalog;
|
|
1394
1394
|
exports.en_US = config.en_US;
|
|
1395
1395
|
exports.zh_CN = config.zh_CN;
|
|
1396
1396
|
exports.NormalFooterToolbar = NormalFooterToolbar;
|
package/lib/es/MdCatalog.mjs
CHANGED
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -4,13 +4,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import { defineComponent, createVNode, inject, ref, onMounted, reactive, computed, watch, toRef, nextTick, Fragment, cloneVNode, shallowRef, onBeforeUnmount } from "vue";
|
|
5
5
|
import { p as prefix, g as globalConfig, a as allToolbar, M as MinInputBoxWidth, b as allFooter } from "./chunks/config.mjs";
|
|
6
6
|
import { draggingScroll, linkTo, throttle, createSmoothScroll } from "@vavt/util";
|
|
7
|
-
import { a as Dropdown, D as DropdownToolbar } from "./chunks/
|
|
7
|
+
import { a as Dropdown, D as DropdownToolbar } from "./chunks/index.mjs";
|
|
8
8
|
import { b as bus, C as CHANGE_FULL_SCREEN, E as ERROR_CATCHER, U as UPLOAD_IMAGE, O as OPEN_MODALS, R as REPLACE, a as CHANGE_CATALOG_VISIBLE, c as ON_SAVE, d as CTRL_SHIFT_Z, e as CTRL_Z, f as EVENT_LISTENER, T as TASK_STATE_CHANGED, S as SEND_EDITOR_VIEW, G as GET_EDITOR_VIEW } from "./chunks/event-name.mjs";
|
|
9
9
|
import { a as appendHandler } from "./chunks/dom.mjs";
|
|
10
|
-
import { C as CDN_IDS, c as contentProps, a as ContentPreview, e as editorEmits, b as editorProps, u as useProvide, d as useConfig, f as useCatalog, g as useOnSave, h as useExpansion, i as useErrorCatcher, j as useExpose, M as MdPreview } from "./chunks/
|
|
11
|
-
import { M as MdModal, I as Icon } from "./chunks/
|
|
10
|
+
import { C as CDN_IDS, c as contentProps, a as ContentPreview, e as editorEmits, b as editorProps, u as useProvide, d as useConfig, f as useCatalog, g as useOnSave, h as useExpansion, i as useErrorCatcher, j as useExpose, M as MdPreview } from "./chunks/index3.mjs";
|
|
11
|
+
import { M as MdModal, I as Icon } from "./chunks/index2.mjs";
|
|
12
12
|
import { b as base642File } from "./chunks/index5.mjs";
|
|
13
|
-
import { s as scrollAuto, a as scrollAutoWithScale, M as MdCatalog } from "./chunks/
|
|
13
|
+
import { s as scrollAuto, a as scrollAutoWithScale, M as MdCatalog } from "./chunks/index4.mjs";
|
|
14
14
|
import { EditorView as EditorView$1 } from "codemirror";
|
|
15
15
|
import { EditorView, placeholder, keymap, drawSelection } from "@codemirror/view";
|
|
16
16
|
import { languages } from "@codemirror/language-data";
|
|
@@ -1608,6 +1608,7 @@ ${mermaidTemplates[type]}
|
|
|
1608
1608
|
const handleImage = (params) => {
|
|
1609
1609
|
const { desc = "", url = "", urls } = params;
|
|
1610
1610
|
let text = "";
|
|
1611
|
+
const urlIsEmpty = url === "" && (!urls || urls instanceof Array && urls.length === 0);
|
|
1611
1612
|
if (urls instanceof Array) {
|
|
1612
1613
|
text = urls.reduce((pVal, _url) => {
|
|
1613
1614
|
const {
|
|
@@ -1626,8 +1627,8 @@ const handleImage = (params) => {
|
|
|
1626
1627
|
text,
|
|
1627
1628
|
options: {
|
|
1628
1629
|
select: url === "",
|
|
1629
|
-
deviationStart: text.length - url.length - 2,
|
|
1630
|
-
deviationEnd: -2
|
|
1630
|
+
deviationStart: urlIsEmpty ? text.length - url.length - 2 : text.length,
|
|
1631
|
+
deviationEnd: urlIsEmpty ? -2 : 0
|
|
1631
1632
|
}
|
|
1632
1633
|
};
|
|
1633
1634
|
};
|
package/lib/es/MdModal.mjs
CHANGED
package/lib/es/MdPreview.mjs
CHANGED
package/lib/es/ModalToolbar.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, createVNode, Fragment, isVNode } from "vue";
|
|
2
2
|
import { p as prefix } from "./chunks/config.mjs";
|
|
3
3
|
import { g as getSlot } from "./chunks/vue-tsx.mjs";
|
|
4
|
-
import { M as MdModal } from "./chunks/
|
|
4
|
+
import { M as MdModal } from "./chunks/index2.mjs";
|
|
5
5
|
function _isSlot(s) {
|
|
6
6
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
7
7
|
}
|