md-editor-v3 2.4.0-beta.0 → 2.4.0-beta.2
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 +4 -3
- package/lib/MdEditor/Editor.d.ts +6 -0
- package/lib/MdEditor/config.d.ts +1 -1
- package/lib/MdEditor/index.d.ts +12 -0
- package/lib/MdEditor/type.d.ts +1 -1
- package/lib/md-editor-v3.es.js +81 -63
- package/lib/md-editor-v3.umd.js +49 -49
- package/lib/style.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -103,8 +103,9 @@ mark and emoji extensions
|
|
|
103
103
|
| sanitize | (html: string) => string | (html) => html | Sanitize the html, prevent XSS |
|
|
104
104
|
| footers | Array<'markdownTotal' \| '=' \| 'scrollSwitch' \| number> | ['markdownTotal', '=', 'scrollSwitch'] | Show contents of footer, they are divided by `'='`. Set it to `[]` to hidden footer |
|
|
105
105
|
| scrollAuto | boolean | true | Scroll default setting |
|
|
106
|
-
| noIconfont | boolean | false | Not append iconfont script, [download](https://at.alicdn.com/t/
|
|
106
|
+
| noIconfont | boolean | false | Not append iconfont script, [download](https://at.alicdn.com/t/c/font_2605852_4cjr7o5jo0f.js) and import it by yourself |
|
|
107
107
|
| formatCopiedText | (text: string) => string | (text: string) => text | Format copied code |
|
|
108
|
+
| noUploadImg | boolean | false | Not show the entrance to upload pictures |
|
|
108
109
|
|
|
109
110
|
<details>
|
|
110
111
|
<summary>[toolbars]</summary>
|
|
@@ -213,7 +214,7 @@ export interface StaticTextDefaultValue {
|
|
|
213
214
|
descLable?: string;
|
|
214
215
|
descLablePlaceHolder?: string;
|
|
215
216
|
urlLable?: string;
|
|
216
|
-
|
|
217
|
+
urlLablePlaceHolder?: string;
|
|
217
218
|
buttonOK?: string;
|
|
218
219
|
};
|
|
219
220
|
// The modal tips of clip the picture, v1.2.0
|
|
@@ -267,7 +268,7 @@ export interface StaticTextDefaultValue {
|
|
|
267
268
|
<normal-toolbar title="mark" @onClick="handler">
|
|
268
269
|
<template #trigger>
|
|
269
270
|
<svg class="md-editor-icon" aria-hidden="true">
|
|
270
|
-
<use xlink:href="#icon-mark"></use>
|
|
271
|
+
<use xlink:href="#md-editor-icon-mark"></use>
|
|
271
272
|
</svg>
|
|
272
273
|
</template>
|
|
273
274
|
</normal-toolbar>
|
package/lib/MdEditor/Editor.d.ts
CHANGED
|
@@ -135,6 +135,9 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
135
135
|
type: import("vue").PropType<(text: string) => string>;
|
|
136
136
|
default: (text: string) => string;
|
|
137
137
|
};
|
|
138
|
+
noUploadImg: {
|
|
139
|
+
type: import("vue").PropType<boolean>;
|
|
140
|
+
};
|
|
138
141
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
139
142
|
modelValue: {
|
|
140
143
|
type: import("vue").PropType<string>;
|
|
@@ -271,6 +274,9 @@ declare const Editor: import("vue").DefineComponent<{
|
|
|
271
274
|
type: import("vue").PropType<(text: string) => string>;
|
|
272
275
|
default: (text: string) => string;
|
|
273
276
|
};
|
|
277
|
+
noUploadImg: {
|
|
278
|
+
type: import("vue").PropType<boolean>;
|
|
279
|
+
};
|
|
274
280
|
}>>, {
|
|
275
281
|
preview: boolean;
|
|
276
282
|
htmlPreview: boolean;
|
package/lib/MdEditor/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodeCss, Config, ConfigOption, Footers, StaticTextDefault } from './type';
|
|
2
2
|
export declare const prefix = "md-editor";
|
|
3
3
|
export declare const iconScriptId = "md-editor-v3";
|
|
4
|
-
export declare const iconfontUrl = "https://at.alicdn.com/t/c/
|
|
4
|
+
export declare const iconfontUrl = "https://at.alicdn.com/t/c/font_2605852_4cjr7o5jo0f.js";
|
|
5
5
|
export declare const cdnBase = "https://cdnjs.cloudflare.com/ajax/libs";
|
|
6
6
|
export declare const highlightUrl: string;
|
|
7
7
|
export declare const prettierUrl: {
|
package/lib/MdEditor/index.d.ts
CHANGED
|
@@ -172,6 +172,9 @@ declare const _default: {
|
|
|
172
172
|
type: import("vue").PropType<(text: string) => string>;
|
|
173
173
|
default: (text: string) => string;
|
|
174
174
|
};
|
|
175
|
+
noUploadImg: {
|
|
176
|
+
type: import("vue").PropType<boolean>;
|
|
177
|
+
};
|
|
175
178
|
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "preview" | "htmlPreview" | "modelValue" | "theme" | "class" | "historyLength" | "pageFullScreen" | "previewOnly" | "language" | "toolbars" | "toolbarsExclude" | "noPrettier" | "editorId" | "tabWidth" | "showCodeRowNumber" | "previewTheme" | "style" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "codeTheme" | "footers" | "scrollAuto" | "formatCopiedText">;
|
|
176
179
|
$attrs: {
|
|
177
180
|
[x: string]: unknown;
|
|
@@ -322,6 +325,9 @@ declare const _default: {
|
|
|
322
325
|
type: import("vue").PropType<(text: string) => string>;
|
|
323
326
|
default: (text: string) => string;
|
|
324
327
|
};
|
|
328
|
+
noUploadImg: {
|
|
329
|
+
type: import("vue").PropType<boolean>;
|
|
330
|
+
};
|
|
325
331
|
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
|
326
332
|
preview: boolean;
|
|
327
333
|
htmlPreview: boolean;
|
|
@@ -506,6 +512,9 @@ declare const _default: {
|
|
|
506
512
|
type: import("vue").PropType<(text: string) => string>;
|
|
507
513
|
default: (text: string) => string;
|
|
508
514
|
};
|
|
515
|
+
noUploadImg: {
|
|
516
|
+
type: import("vue").PropType<boolean>;
|
|
517
|
+
};
|
|
509
518
|
}>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
|
|
510
519
|
__isFragment?: undefined;
|
|
511
520
|
__isTeleport?: undefined;
|
|
@@ -646,6 +655,9 @@ declare const _default: {
|
|
|
646
655
|
type: import("vue").PropType<(text: string) => string>;
|
|
647
656
|
default: (text: string) => string;
|
|
648
657
|
};
|
|
658
|
+
noUploadImg: {
|
|
659
|
+
type: import("vue").PropType<boolean>;
|
|
660
|
+
};
|
|
649
661
|
}>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", {
|
|
650
662
|
preview: boolean;
|
|
651
663
|
htmlPreview: boolean;
|
package/lib/MdEditor/type.d.ts
CHANGED
package/lib/md-editor-v3.es.js
CHANGED
|
@@ -19,7 +19,7 @@ var __spreadValues = (a, b) => {
|
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
import { onMounted, onBeforeUnmount, provide, computed, reactive, watch, ref, defineComponent, createVNode, cloneVNode, nextTick, inject, Fragment, toRef, isVNode } from "vue";
|
|
21
21
|
const prefix = "md-editor";
|
|
22
|
-
const iconfontUrl = "https://at.alicdn.com/t/c/
|
|
22
|
+
const iconfontUrl = "https://at.alicdn.com/t/c/font_2605852_4cjr7o5jo0f.js";
|
|
23
23
|
const cdnBase = "https://cdnjs.cloudflare.com/ajax/libs";
|
|
24
24
|
const highlightUrl = `${cdnBase}/highlight.js/11.5.1/highlight.min.js`;
|
|
25
25
|
const prettierUrl = {
|
|
@@ -116,7 +116,7 @@ const staticTextDefault = {
|
|
|
116
116
|
descLable: "\u94FE\u63A5\u63CF\u8FF0\uFF1A",
|
|
117
117
|
descLablePlaceHolder: "\u8BF7\u8F93\u5165\u63CF\u8FF0...",
|
|
118
118
|
urlLable: "\u94FE\u63A5\u5730\u5740\uFF1A",
|
|
119
|
-
|
|
119
|
+
urlLablePlaceHolder: "\u8BF7\u8F93\u5165\u94FE\u63A5...",
|
|
120
120
|
buttonOK: "\u786E\u5B9A"
|
|
121
121
|
},
|
|
122
122
|
clipModalTips: {
|
|
@@ -196,7 +196,7 @@ const staticTextDefault = {
|
|
|
196
196
|
descLable: "Desc:",
|
|
197
197
|
descLablePlaceHolder: "Enter a description...",
|
|
198
198
|
urlLable: "Link:",
|
|
199
|
-
|
|
199
|
+
urlLablePlaceHolder: "Enter a link...",
|
|
200
200
|
buttonOK: "OK"
|
|
201
201
|
},
|
|
202
202
|
clipModalTips: {
|
|
@@ -1260,7 +1260,7 @@ var Modal = defineComponent({
|
|
|
1260
1260
|
"class": `${prefix}-icon`,
|
|
1261
1261
|
"aria-hidden": "true"
|
|
1262
1262
|
}, [createVNode("use", {
|
|
1263
|
-
"xlink:href": `#icon-${props.isFullscreen ? "suoxiao" : "fangda"}`
|
|
1263
|
+
"xlink:href": `#md-editor-icon-${props.isFullscreen ? "suoxiao" : "fangda"}`
|
|
1264
1264
|
}, null)])]), createVNode("div", {
|
|
1265
1265
|
"class": `${prefix}-modal-close`,
|
|
1266
1266
|
"onClick": (e) => {
|
|
@@ -1271,7 +1271,7 @@ var Modal = defineComponent({
|
|
|
1271
1271
|
"class": `${prefix}-icon`,
|
|
1272
1272
|
"aria-hidden": "true"
|
|
1273
1273
|
}, [createVNode("use", {
|
|
1274
|
-
"xlink:href": "#icon-close"
|
|
1274
|
+
"xlink:href": "#md-editor-icon-close"
|
|
1275
1275
|
}, null)])])])])]);
|
|
1276
1276
|
};
|
|
1277
1277
|
}
|
|
@@ -1355,7 +1355,7 @@ var LinkModal = defineComponent({
|
|
|
1355
1355
|
"class": `${prefix}-lable`,
|
|
1356
1356
|
"for": `link-url-${editorId}`
|
|
1357
1357
|
}, [(_c = ult.value.linkModalTips) == null ? void 0 : _c.urlLable]), createVNode("input", {
|
|
1358
|
-
"placeholder": (_d = ult.value.linkModalTips) == null ? void 0 : _d.
|
|
1358
|
+
"placeholder": (_d = ult.value.linkModalTips) == null ? void 0 : _d.urlLablePlaceHolder,
|
|
1359
1359
|
"class": `${prefix}-input`,
|
|
1360
1360
|
"id": `link-url-${editorId}`,
|
|
1361
1361
|
"type": "text",
|
|
@@ -1499,7 +1499,7 @@ var ClipModal = defineComponent({
|
|
|
1499
1499
|
"class": `${prefix}-icon`,
|
|
1500
1500
|
"aria-hidden": "true"
|
|
1501
1501
|
}, [createVNode("use", {
|
|
1502
|
-
"xlink:href": "#icon-delete"
|
|
1502
|
+
"xlink:href": "#md-editor-icon-delete"
|
|
1503
1503
|
}, null)])])]) : createVNode("div", {
|
|
1504
1504
|
"class": `${prefix}-clip-upload`,
|
|
1505
1505
|
"onClick": () => {
|
|
@@ -1509,7 +1509,7 @@ var ClipModal = defineComponent({
|
|
|
1509
1509
|
"class": `${prefix}-icon`,
|
|
1510
1510
|
"aria-hidden": "true"
|
|
1511
1511
|
}, [createVNode("use", {
|
|
1512
|
-
"xlink:href": "#icon-upload"
|
|
1512
|
+
"xlink:href": "#md-editor-icon-upload"
|
|
1513
1513
|
}, null)])])]), createVNode("div", {
|
|
1514
1514
|
"class": `${prefix}-clip-preview`
|
|
1515
1515
|
}, [createVNode("div", {
|
|
@@ -1710,6 +1710,9 @@ const toolbarProps = () => ({
|
|
|
1710
1710
|
},
|
|
1711
1711
|
defToolbars: {
|
|
1712
1712
|
type: Object
|
|
1713
|
+
},
|
|
1714
|
+
noUploadImg: {
|
|
1715
|
+
type: Boolean
|
|
1713
1716
|
}
|
|
1714
1717
|
});
|
|
1715
1718
|
var ToolBar = defineComponent({
|
|
@@ -1764,7 +1767,7 @@ var ToolBar = defineComponent({
|
|
|
1764
1767
|
uploadRef.value.addEventListener("change", uploadHandler);
|
|
1765
1768
|
});
|
|
1766
1769
|
const barRender = (barItem) => {
|
|
1767
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P;
|
|
1770
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q;
|
|
1768
1771
|
if (allToolbar.includes(barItem)) {
|
|
1769
1772
|
switch (barItem) {
|
|
1770
1773
|
case "-": {
|
|
@@ -1781,7 +1784,7 @@ var ToolBar = defineComponent({
|
|
|
1781
1784
|
"class": `${prefix}-icon`,
|
|
1782
1785
|
"aria-hidden": "true"
|
|
1783
1786
|
}, [createVNode("use", {
|
|
1784
|
-
"xlink:href": "#icon-bold"
|
|
1787
|
+
"xlink:href": "#md-editor-icon-bold"
|
|
1785
1788
|
}, null)])]);
|
|
1786
1789
|
}
|
|
1787
1790
|
case "underline": {
|
|
@@ -1795,7 +1798,7 @@ var ToolBar = defineComponent({
|
|
|
1795
1798
|
"class": `${prefix}-icon`,
|
|
1796
1799
|
"aria-hidden": "true"
|
|
1797
1800
|
}, [createVNode("use", {
|
|
1798
|
-
"xlink:href": "#icon-underline"
|
|
1801
|
+
"xlink:href": "#md-editor-icon-underline"
|
|
1799
1802
|
}, null)])]);
|
|
1800
1803
|
}
|
|
1801
1804
|
case "italic": {
|
|
@@ -1809,7 +1812,7 @@ var ToolBar = defineComponent({
|
|
|
1809
1812
|
"class": `${prefix}-icon`,
|
|
1810
1813
|
"aria-hidden": "true"
|
|
1811
1814
|
}, [createVNode("use", {
|
|
1812
|
-
"xlink:href": "#icon-italic"
|
|
1815
|
+
"xlink:href": "#md-editor-icon-italic"
|
|
1813
1816
|
}, null)])]);
|
|
1814
1817
|
}
|
|
1815
1818
|
case "strikeThrough": {
|
|
@@ -1823,7 +1826,7 @@ var ToolBar = defineComponent({
|
|
|
1823
1826
|
"class": `${prefix}-icon`,
|
|
1824
1827
|
"aria-hidden": "true"
|
|
1825
1828
|
}, [createVNode("use", {
|
|
1826
|
-
"xlink:href": "#icon-strike-through"
|
|
1829
|
+
"xlink:href": "#md-editor-icon-strike-through"
|
|
1827
1830
|
}, null)])]);
|
|
1828
1831
|
}
|
|
1829
1832
|
case "title": {
|
|
@@ -1879,7 +1882,7 @@ var ToolBar = defineComponent({
|
|
|
1879
1882
|
"class": `${prefix}-icon`,
|
|
1880
1883
|
"aria-hidden": "true"
|
|
1881
1884
|
}, [createVNode("use", {
|
|
1882
|
-
"xlink:href": "#icon-title"
|
|
1885
|
+
"xlink:href": "#md-editor-icon-title"
|
|
1883
1886
|
}, null)])])];
|
|
1884
1887
|
}
|
|
1885
1888
|
});
|
|
@@ -1895,7 +1898,7 @@ var ToolBar = defineComponent({
|
|
|
1895
1898
|
"class": `${prefix}-icon`,
|
|
1896
1899
|
"aria-hidden": "true"
|
|
1897
1900
|
}, [createVNode("use", {
|
|
1898
|
-
"xlink:href": "#icon-sub"
|
|
1901
|
+
"xlink:href": "#md-editor-icon-sub"
|
|
1899
1902
|
}, null)])]);
|
|
1900
1903
|
}
|
|
1901
1904
|
case "sup": {
|
|
@@ -1909,7 +1912,7 @@ var ToolBar = defineComponent({
|
|
|
1909
1912
|
"class": `${prefix}-icon`,
|
|
1910
1913
|
"aria-hidden": "true"
|
|
1911
1914
|
}, [createVNode("use", {
|
|
1912
|
-
"xlink:href": "#icon-sup"
|
|
1915
|
+
"xlink:href": "#md-editor-icon-sup"
|
|
1913
1916
|
}, null)])]);
|
|
1914
1917
|
}
|
|
1915
1918
|
case "quote": {
|
|
@@ -1923,7 +1926,7 @@ var ToolBar = defineComponent({
|
|
|
1923
1926
|
"class": `${prefix}-icon`,
|
|
1924
1927
|
"aria-hidden": "true"
|
|
1925
1928
|
}, [createVNode("use", {
|
|
1926
|
-
"xlink:href": "#icon-quote"
|
|
1929
|
+
"xlink:href": "#md-editor-icon-quote"
|
|
1927
1930
|
}, null)])]);
|
|
1928
1931
|
}
|
|
1929
1932
|
case "unorderedList": {
|
|
@@ -1937,7 +1940,7 @@ var ToolBar = defineComponent({
|
|
|
1937
1940
|
"class": `${prefix}-icon`,
|
|
1938
1941
|
"aria-hidden": "true"
|
|
1939
1942
|
}, [createVNode("use", {
|
|
1940
|
-
"xlink:href": "#icon-unordered-list"
|
|
1943
|
+
"xlink:href": "#md-editor-icon-unordered-list"
|
|
1941
1944
|
}, null)])]);
|
|
1942
1945
|
}
|
|
1943
1946
|
case "orderedList": {
|
|
@@ -1951,7 +1954,7 @@ var ToolBar = defineComponent({
|
|
|
1951
1954
|
"class": `${prefix}-icon`,
|
|
1952
1955
|
"aria-hidden": "true"
|
|
1953
1956
|
}, [createVNode("use", {
|
|
1954
|
-
"xlink:href": "#icon-ordered-list"
|
|
1957
|
+
"xlink:href": "#md-editor-icon-ordered-list"
|
|
1955
1958
|
}, null)])]);
|
|
1956
1959
|
}
|
|
1957
1960
|
case "task": {
|
|
@@ -1965,7 +1968,7 @@ var ToolBar = defineComponent({
|
|
|
1965
1968
|
"class": `${prefix}-icon`,
|
|
1966
1969
|
"aria-hidden": "true"
|
|
1967
1970
|
}, [createVNode("use", {
|
|
1968
|
-
"xlink:href": "#icon-task"
|
|
1971
|
+
"xlink:href": "#md-editor-icon-task"
|
|
1969
1972
|
}, null)])]);
|
|
1970
1973
|
}
|
|
1971
1974
|
case "codeRow": {
|
|
@@ -1979,7 +1982,7 @@ var ToolBar = defineComponent({
|
|
|
1979
1982
|
"class": `${prefix}-icon`,
|
|
1980
1983
|
"aria-hidden": "true"
|
|
1981
1984
|
}, [createVNode("use", {
|
|
1982
|
-
"xlink:href": "#icon-code-row"
|
|
1985
|
+
"xlink:href": "#md-editor-icon-code-row"
|
|
1983
1986
|
}, null)])]);
|
|
1984
1987
|
}
|
|
1985
1988
|
case "code": {
|
|
@@ -1993,7 +1996,7 @@ var ToolBar = defineComponent({
|
|
|
1993
1996
|
"class": `${prefix}-icon`,
|
|
1994
1997
|
"aria-hidden": "true"
|
|
1995
1998
|
}, [createVNode("use", {
|
|
1996
|
-
"xlink:href": "#icon-code"
|
|
1999
|
+
"xlink:href": "#md-editor-icon-code"
|
|
1997
2000
|
}, null)])]);
|
|
1998
2001
|
}
|
|
1999
2002
|
case "link": {
|
|
@@ -2008,11 +2011,23 @@ var ToolBar = defineComponent({
|
|
|
2008
2011
|
"class": `${prefix}-icon`,
|
|
2009
2012
|
"aria-hidden": "true"
|
|
2010
2013
|
}, [createVNode("use", {
|
|
2011
|
-
"xlink:href": "#icon-link"
|
|
2014
|
+
"xlink:href": "#md-editor-icon-link"
|
|
2012
2015
|
}, null)])]);
|
|
2013
2016
|
}
|
|
2014
2017
|
case "image": {
|
|
2015
|
-
return createVNode(
|
|
2018
|
+
return props.noUploadImg ? createVNode("div", {
|
|
2019
|
+
"class": `${prefix}-toolbar-item`,
|
|
2020
|
+
"title": (_t = ult.value.toolbarTips) == null ? void 0 : _t.image,
|
|
2021
|
+
"onClick": () => {
|
|
2022
|
+
modalData.type = "image";
|
|
2023
|
+
modalData.linkVisible = true;
|
|
2024
|
+
}
|
|
2025
|
+
}, [createVNode("svg", {
|
|
2026
|
+
"class": `${prefix}-icon`,
|
|
2027
|
+
"aria-hidden": "true"
|
|
2028
|
+
}, [createVNode("use", {
|
|
2029
|
+
"xlink:href": "#md-editor-icon-image"
|
|
2030
|
+
}, null)])]) : createVNode(Dropdown, {
|
|
2016
2031
|
"relative": `#${wrapperId}`,
|
|
2017
2032
|
"visible": visible.image,
|
|
2018
2033
|
"onChange": (v) => {
|
|
@@ -2029,17 +2044,17 @@ var ToolBar = defineComponent({
|
|
|
2029
2044
|
modalData.type = "image";
|
|
2030
2045
|
modalData.linkVisible = true;
|
|
2031
2046
|
}
|
|
2032
|
-
}, [(
|
|
2047
|
+
}, [(_u = ult.value.imgTitleItem) == null ? void 0 : _u.link]), createVNode("li", {
|
|
2033
2048
|
"class": `${prefix}-menu-item`,
|
|
2034
2049
|
"onClick": () => {
|
|
2035
2050
|
uploadRef.value.click();
|
|
2036
2051
|
}
|
|
2037
|
-
}, [(
|
|
2052
|
+
}, [(_v = ult.value.imgTitleItem) == null ? void 0 : _v.upload]), createVNode("li", {
|
|
2038
2053
|
"class": `${prefix}-menu-item`,
|
|
2039
2054
|
"onClick": () => {
|
|
2040
2055
|
modalData.clipVisible = true;
|
|
2041
2056
|
}
|
|
2042
|
-
}, [(
|
|
2057
|
+
}, [(_w = ult.value.imgTitleItem) == null ? void 0 : _w.clip2upload])])
|
|
2043
2058
|
}, {
|
|
2044
2059
|
default: () => {
|
|
2045
2060
|
var _a2;
|
|
@@ -2050,7 +2065,7 @@ var ToolBar = defineComponent({
|
|
|
2050
2065
|
"class": `${prefix}-icon`,
|
|
2051
2066
|
"aria-hidden": "true"
|
|
2052
2067
|
}, [createVNode("use", {
|
|
2053
|
-
"xlink:href": "#icon-image"
|
|
2068
|
+
"xlink:href": "#md-editor-icon-image"
|
|
2054
2069
|
}, null)])])];
|
|
2055
2070
|
}
|
|
2056
2071
|
});
|
|
@@ -2081,7 +2096,7 @@ var ToolBar = defineComponent({
|
|
|
2081
2096
|
"class": `${prefix}-icon`,
|
|
2082
2097
|
"aria-hidden": "true"
|
|
2083
2098
|
}, [createVNode("use", {
|
|
2084
|
-
"xlink:href": "#icon-table"
|
|
2099
|
+
"xlink:href": "#md-editor-icon-table"
|
|
2085
2100
|
}, null)])])];
|
|
2086
2101
|
}
|
|
2087
2102
|
});
|
|
@@ -2089,7 +2104,7 @@ var ToolBar = defineComponent({
|
|
|
2089
2104
|
case "revoke": {
|
|
2090
2105
|
return createVNode("div", {
|
|
2091
2106
|
"class": `${prefix}-toolbar-item`,
|
|
2092
|
-
"title": (
|
|
2107
|
+
"title": (_x = ult.value.toolbarTips) == null ? void 0 : _x.revoke,
|
|
2093
2108
|
"onClick": () => {
|
|
2094
2109
|
bus.emit(editorId, "ctrlZ");
|
|
2095
2110
|
}
|
|
@@ -2097,13 +2112,13 @@ var ToolBar = defineComponent({
|
|
|
2097
2112
|
"class": `${prefix}-icon`,
|
|
2098
2113
|
"aria-hidden": "true"
|
|
2099
2114
|
}, [createVNode("use", {
|
|
2100
|
-
"xlink:href": "#icon-revoke"
|
|
2115
|
+
"xlink:href": "#md-editor-icon-revoke"
|
|
2101
2116
|
}, null)])]);
|
|
2102
2117
|
}
|
|
2103
2118
|
case "next": {
|
|
2104
2119
|
return createVNode("div", {
|
|
2105
2120
|
"class": `${prefix}-toolbar-item`,
|
|
2106
|
-
"title": (
|
|
2121
|
+
"title": (_y = ult.value.toolbarTips) == null ? void 0 : _y.next,
|
|
2107
2122
|
"onClick": () => {
|
|
2108
2123
|
bus.emit(editorId, "ctrlShiftZ");
|
|
2109
2124
|
}
|
|
@@ -2111,13 +2126,13 @@ var ToolBar = defineComponent({
|
|
|
2111
2126
|
"class": `${prefix}-icon`,
|
|
2112
2127
|
"aria-hidden": "true"
|
|
2113
2128
|
}, [createVNode("use", {
|
|
2114
|
-
"xlink:href": "#icon-next"
|
|
2129
|
+
"xlink:href": "#md-editor-icon-next"
|
|
2115
2130
|
}, null)])]);
|
|
2116
2131
|
}
|
|
2117
2132
|
case "save": {
|
|
2118
2133
|
return createVNode("div", {
|
|
2119
2134
|
"class": `${prefix}-toolbar-item`,
|
|
2120
|
-
"title": (
|
|
2135
|
+
"title": (_z = ult.value.toolbarTips) == null ? void 0 : _z.save,
|
|
2121
2136
|
"onClick": () => {
|
|
2122
2137
|
bus.emit(editorId, "onSave");
|
|
2123
2138
|
}
|
|
@@ -2125,13 +2140,13 @@ var ToolBar = defineComponent({
|
|
|
2125
2140
|
"class": `${prefix}-icon`,
|
|
2126
2141
|
"aria-hidden": "true"
|
|
2127
2142
|
}, [createVNode("use", {
|
|
2128
|
-
"xlink:href": "#icon-baocun"
|
|
2143
|
+
"xlink:href": "#md-editor-icon-baocun"
|
|
2129
2144
|
}, null)])]);
|
|
2130
2145
|
}
|
|
2131
2146
|
case "prettier": {
|
|
2132
2147
|
return !props.noPrettier ? createVNode("div", {
|
|
2133
2148
|
"class": `${prefix}-toolbar-item`,
|
|
2134
|
-
"title": (
|
|
2149
|
+
"title": (_A = ult.value.toolbarTips) == null ? void 0 : _A.prettier,
|
|
2135
2150
|
"onClick": () => {
|
|
2136
2151
|
emitHandler("prettier");
|
|
2137
2152
|
}
|
|
@@ -2139,13 +2154,13 @@ var ToolBar = defineComponent({
|
|
|
2139
2154
|
"class": `${prefix}-icon`,
|
|
2140
2155
|
"aria-hidden": "true"
|
|
2141
2156
|
}, [createVNode("use", {
|
|
2142
|
-
"xlink:href": "#icon-prettier"
|
|
2157
|
+
"xlink:href": "#md-editor-icon-prettier"
|
|
2143
2158
|
}, null)])]) : "";
|
|
2144
2159
|
}
|
|
2145
2160
|
case "pageFullscreen": {
|
|
2146
2161
|
return !props.setting.fullscreen && createVNode("div", {
|
|
2147
2162
|
"class": `${prefix}-toolbar-item`,
|
|
2148
|
-
"title": (
|
|
2163
|
+
"title": (_B = ult.value.toolbarTips) == null ? void 0 : _B.pageFullscreen,
|
|
2149
2164
|
"onClick": () => {
|
|
2150
2165
|
props.updateSetting(!props.setting.pageFullScreen, "pageFullScreen");
|
|
2151
2166
|
}
|
|
@@ -2153,25 +2168,25 @@ var ToolBar = defineComponent({
|
|
|
2153
2168
|
"class": `${prefix}-icon`,
|
|
2154
2169
|
"aria-hidden": "true"
|
|
2155
2170
|
}, [createVNode("use", {
|
|
2156
|
-
"xlink:href": `#icon-${props.setting.pageFullScreen ? "suoxiao" : "fangda"}`
|
|
2171
|
+
"xlink:href": `#md-editor-icon-${props.setting.pageFullScreen ? "suoxiao" : "fangda"}`
|
|
2157
2172
|
}, null)])]);
|
|
2158
2173
|
}
|
|
2159
2174
|
case "fullscreen": {
|
|
2160
2175
|
return createVNode("div", {
|
|
2161
2176
|
"class": `${prefix}-toolbar-item`,
|
|
2162
|
-
"title": (
|
|
2177
|
+
"title": (_C = ult.value.toolbarTips) == null ? void 0 : _C.fullscreen,
|
|
2163
2178
|
"onClick": fullScreenHandler
|
|
2164
2179
|
}, [createVNode("svg", {
|
|
2165
2180
|
"class": `${prefix}-icon`,
|
|
2166
2181
|
"aria-hidden": "true"
|
|
2167
2182
|
}, [createVNode("use", {
|
|
2168
|
-
"xlink:href": `#icon-${props.setting.fullscreen ? "fullScreen-exit" : "fullScreen"}`
|
|
2183
|
+
"xlink:href": `#md-editor-icon-${props.setting.fullscreen ? "fullScreen-exit" : "fullScreen"}`
|
|
2169
2184
|
}, null)])]);
|
|
2170
2185
|
}
|
|
2171
2186
|
case "preview": {
|
|
2172
2187
|
return createVNode("div", {
|
|
2173
2188
|
"class": `${prefix}-toolbar-item`,
|
|
2174
|
-
"title": (
|
|
2189
|
+
"title": (_D = ult.value.toolbarTips) == null ? void 0 : _D.preview,
|
|
2175
2190
|
"onClick": () => {
|
|
2176
2191
|
props.updateSetting(!props.setting.preview, "preview");
|
|
2177
2192
|
}
|
|
@@ -2179,13 +2194,13 @@ var ToolBar = defineComponent({
|
|
|
2179
2194
|
"class": `${prefix}-icon`,
|
|
2180
2195
|
"aria-hidden": "true"
|
|
2181
2196
|
}, [createVNode("use", {
|
|
2182
|
-
"xlink:href": "#icon-preview"
|
|
2197
|
+
"xlink:href": "#md-editor-icon-preview"
|
|
2183
2198
|
}, null)])]);
|
|
2184
2199
|
}
|
|
2185
2200
|
case "htmlPreview": {
|
|
2186
2201
|
return createVNode("div", {
|
|
2187
2202
|
"class": `${prefix}-toolbar-item`,
|
|
2188
|
-
"title": (
|
|
2203
|
+
"title": (_E = ult.value.toolbarTips) == null ? void 0 : _E.htmlPreview,
|
|
2189
2204
|
"onClick": () => {
|
|
2190
2205
|
props.updateSetting(!props.setting.htmlPreview, "htmlPreview");
|
|
2191
2206
|
}
|
|
@@ -2193,13 +2208,13 @@ var ToolBar = defineComponent({
|
|
|
2193
2208
|
"class": `${prefix}-icon`,
|
|
2194
2209
|
"aria-hidden": "true"
|
|
2195
2210
|
}, [createVNode("use", {
|
|
2196
|
-
"xlink:href": "#icon-coding"
|
|
2211
|
+
"xlink:href": "#md-editor-icon-coding"
|
|
2197
2212
|
}, null)])]);
|
|
2198
2213
|
}
|
|
2199
2214
|
case "catalog": {
|
|
2200
2215
|
return createVNode("div", {
|
|
2201
2216
|
"class": `${prefix}-toolbar-item`,
|
|
2202
|
-
"title": (
|
|
2217
|
+
"title": (_F = ult.value.toolbarTips) == null ? void 0 : _F.catalog,
|
|
2203
2218
|
"onClick": () => {
|
|
2204
2219
|
bus.emit(editorId, "catalogShow");
|
|
2205
2220
|
},
|
|
@@ -2208,19 +2223,19 @@ var ToolBar = defineComponent({
|
|
|
2208
2223
|
"class": `${prefix}-icon`,
|
|
2209
2224
|
"aria-hidden": "true"
|
|
2210
2225
|
}, [createVNode("use", {
|
|
2211
|
-
"xlink:href": "#icon-catalog"
|
|
2226
|
+
"xlink:href": "#md-editor-icon-catalog"
|
|
2212
2227
|
}, null)])]);
|
|
2213
2228
|
}
|
|
2214
2229
|
case "github": {
|
|
2215
2230
|
return createVNode("div", {
|
|
2216
2231
|
"class": `${prefix}-toolbar-item`,
|
|
2217
|
-
"title": (
|
|
2232
|
+
"title": (_G = ult.value.toolbarTips) == null ? void 0 : _G.github,
|
|
2218
2233
|
"onClick": () => goto("https://github.com/imzbf/md-editor-v3")
|
|
2219
2234
|
}, [createVNode("svg", {
|
|
2220
2235
|
"class": `${prefix}-icon`,
|
|
2221
2236
|
"aria-hidden": "true"
|
|
2222
2237
|
}, [createVNode("use", {
|
|
2223
|
-
"xlink:href": "#icon-github"
|
|
2238
|
+
"xlink:href": "#md-editor-icon-github"
|
|
2224
2239
|
}, null)])]);
|
|
2225
2240
|
}
|
|
2226
2241
|
case "mermaid": {
|
|
@@ -2240,42 +2255,42 @@ var ToolBar = defineComponent({
|
|
|
2240
2255
|
"onClick": () => {
|
|
2241
2256
|
emitHandler("flow");
|
|
2242
2257
|
}
|
|
2243
|
-
}, [(
|
|
2258
|
+
}, [(_H = ult.value.mermaid) == null ? void 0 : _H.flow]), createVNode("li", {
|
|
2244
2259
|
"class": `${prefix}-menu-item`,
|
|
2245
2260
|
"onClick": () => {
|
|
2246
2261
|
emitHandler("sequence");
|
|
2247
2262
|
}
|
|
2248
|
-
}, [(
|
|
2263
|
+
}, [(_I = ult.value.mermaid) == null ? void 0 : _I.sequence]), createVNode("li", {
|
|
2249
2264
|
"class": `${prefix}-menu-item`,
|
|
2250
2265
|
"onClick": () => {
|
|
2251
2266
|
emitHandler("gantt");
|
|
2252
2267
|
}
|
|
2253
|
-
}, [(
|
|
2268
|
+
}, [(_J = ult.value.mermaid) == null ? void 0 : _J.gantt]), createVNode("li", {
|
|
2254
2269
|
"class": `${prefix}-menu-item`,
|
|
2255
2270
|
"onClick": () => {
|
|
2256
2271
|
emitHandler("class");
|
|
2257
2272
|
}
|
|
2258
|
-
}, [(
|
|
2273
|
+
}, [(_K = ult.value.mermaid) == null ? void 0 : _K.class]), createVNode("li", {
|
|
2259
2274
|
"class": `${prefix}-menu-item`,
|
|
2260
2275
|
"onClick": () => {
|
|
2261
2276
|
emitHandler("state");
|
|
2262
2277
|
}
|
|
2263
|
-
}, [(
|
|
2278
|
+
}, [(_L = ult.value.mermaid) == null ? void 0 : _L.state]), createVNode("li", {
|
|
2264
2279
|
"class": `${prefix}-menu-item`,
|
|
2265
2280
|
"onClick": () => {
|
|
2266
2281
|
emitHandler("pie");
|
|
2267
2282
|
}
|
|
2268
|
-
}, [(
|
|
2283
|
+
}, [(_M = ult.value.mermaid) == null ? void 0 : _M.pie]), createVNode("li", {
|
|
2269
2284
|
"class": `${prefix}-menu-item`,
|
|
2270
2285
|
"onClick": () => {
|
|
2271
2286
|
emitHandler("relationship");
|
|
2272
2287
|
}
|
|
2273
|
-
}, [(
|
|
2288
|
+
}, [(_N = ult.value.mermaid) == null ? void 0 : _N.relationship]), createVNode("li", {
|
|
2274
2289
|
"class": `${prefix}-menu-item`,
|
|
2275
2290
|
"onClick": () => {
|
|
2276
2291
|
emitHandler("journey");
|
|
2277
2292
|
}
|
|
2278
|
-
}, [(
|
|
2293
|
+
}, [(_O = ult.value.mermaid) == null ? void 0 : _O.journey])]),
|
|
2279
2294
|
"key": "bar-mermaid"
|
|
2280
2295
|
}, {
|
|
2281
2296
|
default: () => {
|
|
@@ -2287,7 +2302,7 @@ var ToolBar = defineComponent({
|
|
|
2287
2302
|
"class": `${prefix}-icon`,
|
|
2288
2303
|
"aria-hidden": "true"
|
|
2289
2304
|
}, [createVNode("use", {
|
|
2290
|
-
"xlink:href": "#icon-mermaid"
|
|
2305
|
+
"xlink:href": "#md-editor-icon-mermaid"
|
|
2291
2306
|
}, null)])])];
|
|
2292
2307
|
}
|
|
2293
2308
|
});
|
|
@@ -2309,12 +2324,12 @@ var ToolBar = defineComponent({
|
|
|
2309
2324
|
"onClick": () => {
|
|
2310
2325
|
emitHandler("katexInline");
|
|
2311
2326
|
}
|
|
2312
|
-
}, [(
|
|
2327
|
+
}, [(_P = ult.value.katex) == null ? void 0 : _P.inline]), createVNode("li", {
|
|
2313
2328
|
"class": `${prefix}-menu-item`,
|
|
2314
2329
|
"onClick": () => {
|
|
2315
2330
|
emitHandler("katexBlock");
|
|
2316
2331
|
}
|
|
2317
|
-
}, [(
|
|
2332
|
+
}, [(_Q = ult.value.katex) == null ? void 0 : _Q.block])]),
|
|
2318
2333
|
"key": "bar-katex"
|
|
2319
2334
|
}, {
|
|
2320
2335
|
default: () => {
|
|
@@ -2326,7 +2341,7 @@ var ToolBar = defineComponent({
|
|
|
2326
2341
|
"class": `${prefix}-icon`,
|
|
2327
2342
|
"aria-hidden": "true"
|
|
2328
2343
|
}, [createVNode("use", {
|
|
2329
|
-
"xlink:href": "#icon-formula"
|
|
2344
|
+
"xlink:href": "#md-editor-icon-formula"
|
|
2330
2345
|
}, null)])])];
|
|
2331
2346
|
}
|
|
2332
2347
|
});
|
|
@@ -5045,7 +5060,6 @@ const directive2flag = (direct, selectedText = "", inputArea, params) => {
|
|
|
5045
5060
|
case "task": {
|
|
5046
5061
|
targetValue = `- [ ] ${selectedText}`;
|
|
5047
5062
|
deviationStart = 6;
|
|
5048
|
-
deviationEnd = targetValue.length;
|
|
5049
5063
|
select = true;
|
|
5050
5064
|
break;
|
|
5051
5065
|
}
|
|
@@ -6476,6 +6490,9 @@ const editorProps = () => ({
|
|
|
6476
6490
|
formatCopiedText: {
|
|
6477
6491
|
type: Function,
|
|
6478
6492
|
default: (text) => text
|
|
6493
|
+
},
|
|
6494
|
+
noUploadImg: {
|
|
6495
|
+
type: Boolean
|
|
6479
6496
|
}
|
|
6480
6497
|
});
|
|
6481
6498
|
const markedHeadingId = (text) => text;
|
|
@@ -6519,7 +6536,8 @@ const Editor = defineComponent({
|
|
|
6519
6536
|
"setting": setting,
|
|
6520
6537
|
"updateSetting": updateSetting,
|
|
6521
6538
|
"tableShape": props.tableShape,
|
|
6522
|
-
"defToolbars": defToolbars
|
|
6539
|
+
"defToolbars": defToolbars,
|
|
6540
|
+
"noUploadImg": props.noUploadImg
|
|
6523
6541
|
}, null), createVNode(Content, {
|
|
6524
6542
|
"value": props.modelValue,
|
|
6525
6543
|
"onChange": (value) => {
|