md-editor-v3 4.21.1 → 5.0.0-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 +3 -3
- package/lib/cjs/MdEditor.cjs +50 -26
- package/lib/cjs/ModalToolbar.cjs +20 -10
- package/lib/cjs/chunks/config.cjs +0 -15
- package/lib/cjs/chunks/dom.cjs +6 -2
- package/lib/cjs/chunks/index.cjs +111 -1412
- package/lib/cjs/chunks/index2.cjs +19 -9
- package/lib/cjs/chunks/index3.cjs +47 -17
- package/lib/cjs/chunks/index4.cjs +538 -10
- package/lib/cjs/chunks/index5.cjs +0 -7
- package/lib/cjs/config.cjs +0 -2
- package/lib/cjs/index.cjs +1311 -3
- package/lib/es/MdEditor.mjs +52 -28
- package/lib/es/ModalToolbar.mjs +20 -10
- package/lib/es/chunks/config.mjs +4 -19
- package/lib/es/chunks/dom.mjs +6 -2
- package/lib/es/chunks/index.mjs +118 -1419
- package/lib/es/chunks/index2.mjs +19 -9
- package/lib/es/chunks/index3.mjs +49 -19
- package/lib/es/chunks/index4.mjs +541 -13
- package/lib/es/chunks/index5.mjs +2 -9
- package/lib/es/config.mjs +3 -5
- package/lib/es/index.mjs +1314 -6
- package/lib/preview.css +20 -7
- package/lib/style.css +20 -7
- package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +46 -87
- package/lib/types/DropdownToolbar/index.d.ts +2 -171
- package/lib/types/MdCatalog/CatalogLink.d.ts +18 -35
- package/lib/types/MdCatalog/MdCatalog.d.ts +29 -129
- package/lib/types/MdCatalog/index.d.ts +2 -194
- package/lib/types/MdEditor/Editor.d.ts +584 -427
- package/lib/types/MdEditor/components/Checkbox/index.d.ts +7 -20
- package/lib/types/MdEditor/components/Divider/index.d.ts +1 -1
- package/lib/types/MdEditor/components/Dropdown/index.d.ts +16 -40
- package/lib/types/MdEditor/components/Icon/Github.d.ts +2 -0
- package/lib/types/MdEditor/components/Icon/Icon.d.ts +7 -5
- package/lib/types/MdEditor/components/Icon/Str.d.ts +2 -1
- package/lib/types/MdEditor/components/Icon/index.d.ts +5 -5
- package/lib/types/MdEditor/components/Modal/Modal.d.ts +29 -90
- package/lib/types/MdEditor/components/Modal/index.d.ts +2 -223
- package/lib/types/MdEditor/composition.d.ts +26 -8
- package/lib/types/MdEditor/config.d.ts +0 -2
- package/lib/types/MdEditor/index.d.ts +2 -1017
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +35 -127
- package/lib/types/MdEditor/layouts/Content/composition/useCodeMirror.d.ts +2 -2
- package/lib/types/MdEditor/layouts/Content/composition/useHighlight.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Content/composition/useKatex.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Content/composition/useMarkdownIt.d.ts +2 -2
- package/lib/types/MdEditor/layouts/Content/composition/useMermaid.d.ts +2 -2
- package/lib/types/MdEditor/layouts/Content/composition/useResize.d.ts +1 -1
- package/lib/types/MdEditor/layouts/Content/index.d.ts +73 -255
- package/lib/types/MdEditor/layouts/Content/markdownIt/xss/index.d.ts +1 -2
- package/lib/types/MdEditor/layouts/Content/props.d.ts +3 -3
- package/lib/types/MdEditor/layouts/Footer/MarkdownTotal.d.ts +4 -4
- package/lib/types/MdEditor/layouts/Footer/ScrollAuto.d.ts +7 -18
- package/lib/types/MdEditor/layouts/Footer/index.d.ts +20 -50
- package/lib/types/MdEditor/layouts/Modals/Clip.d.ts +10 -29
- package/lib/types/MdEditor/layouts/Modals/Link.d.ts +12 -37
- package/lib/types/MdEditor/layouts/Modals/index.d.ts +13 -44
- package/lib/types/MdEditor/layouts/Toolbar/TableShape.d.ts +7 -20
- package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +31 -93
- package/lib/types/MdEditor/layouts/Toolbar/props.d.ts +4 -6
- package/lib/types/MdEditor/props.d.ts +66 -24
- package/lib/types/MdEditor/type.d.ts +1 -20
- package/lib/types/MdEditor/utils/index.d.ts +0 -4
- package/lib/types/MdPreview/MdPreview.d.ts +491 -206
- package/lib/types/MdPreview/composition/useExpose.d.ts +3 -1
- package/lib/types/MdPreview/index.d.ts +2 -538
- package/lib/types/ModalToolbar/ModalToolbar.d.ts +57 -143
- package/lib/types/ModalToolbar/index.d.ts +2 -309
- package/lib/types/NormalFooterToolbar/NormalFooterToolbar.d.ts +7 -10
- package/lib/types/NormalFooterToolbar/index.d.ts +2 -37
- package/lib/types/NormalToolbar/NormalToolbar.d.ts +21 -53
- package/lib/types/NormalToolbar/index.d.ts +2 -115
- package/lib/types/config.d.ts +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/umd/index.js +241 -56
- package/package.json +21 -20
- package/lib/types/MdEditor/components/Popper/index.d.ts +0 -15
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ Except for the same as `MdPreview`:
|
|
|
154
154
|
| autoDetectCode | `boolean` | false | auto detect the type of pasted code, only support that copied from `vscode` |
|
|
155
155
|
| completions | `Array<CompletionSource>` | [] | `@codemirror/autocomplete` List of function to match keywords |
|
|
156
156
|
| showToolbarName | `boolean` | false | Show toolbar name or not |
|
|
157
|
-
|
|
|
157
|
+
| inputBoxWidth | `string` | '50%' | Default width of input box |
|
|
158
158
|
| transformImgUrl | `(imgUrl: string) => string \| Promise<string>` | t => t | Transform image links |
|
|
159
159
|
|
|
160
160
|
<details>
|
|
@@ -326,7 +326,7 @@ Except for the same as `MdPreview`:
|
|
|
326
326
|
| onFocus | `event: FocusEvent` | Textarea has received focus |
|
|
327
327
|
| onInput | `event: Event` | Element gets input |
|
|
328
328
|
| onDrop | `event: DragEvent` | Selection is being dragged |
|
|
329
|
-
|
|
|
329
|
+
| oninputBoxWidthChange | `(width: string) => void` | Width of input box has been changed |
|
|
330
330
|
|
|
331
331
|
### 🎍 Slots
|
|
332
332
|
|
|
@@ -877,7 +877,7 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
|
|
|
877
877
|
- **events**
|
|
878
878
|
|
|
879
879
|
- `onClick`: `(e: MouseEvent, t: TocItem) => void`, not required, heading was clicked.
|
|
880
|
-
- `onActive`: `(heading: HeadList | undefined) => void`, not required, heading was highlighted.
|
|
880
|
+
- `onActive`: `(heading: HeadList | undefined, activeElement: HTMLDivElement) => void`, not required, heading was highlighted.
|
|
881
881
|
|
|
882
882
|
### 🛸 MdModal
|
|
883
883
|
|
package/lib/cjs/MdEditor.cjs
CHANGED
|
@@ -26,6 +26,7 @@ const vueTsx = require("./chunks/vue-tsx.cjs");
|
|
|
26
26
|
const NormalToolbar = require("./NormalToolbar.cjs");
|
|
27
27
|
const ModalToolbar = require("./ModalToolbar.cjs");
|
|
28
28
|
const Divider = /* @__PURE__ */ vue.defineComponent({
|
|
29
|
+
name: `${config.prefix}-divider`,
|
|
29
30
|
setup() {
|
|
30
31
|
return () => vue.createVNode("div", {
|
|
31
32
|
"class": `${config.prefix}-divider`
|
|
@@ -240,6 +241,7 @@ const props$5 = {
|
|
|
240
241
|
}
|
|
241
242
|
};
|
|
242
243
|
const LinkModal = /* @__PURE__ */ vue.defineComponent({
|
|
244
|
+
name: `${config.prefix}-modal-link`,
|
|
243
245
|
props: props$5,
|
|
244
246
|
setup(props2) {
|
|
245
247
|
const ult = vue.inject("usedLanguageText");
|
|
@@ -339,6 +341,7 @@ const props$4 = {
|
|
|
339
341
|
}
|
|
340
342
|
};
|
|
341
343
|
const ClipModal = /* @__PURE__ */ vue.defineComponent({
|
|
344
|
+
name: `${config.prefix}-modal-clip`,
|
|
342
345
|
props: props$4,
|
|
343
346
|
setup(props2) {
|
|
344
347
|
const ult = vue.inject("usedLanguageText");
|
|
@@ -506,6 +509,7 @@ const props$3 = {
|
|
|
506
509
|
}
|
|
507
510
|
};
|
|
508
511
|
const Modals = /* @__PURE__ */ vue.defineComponent({
|
|
512
|
+
name: `${config.prefix}-modals`,
|
|
509
513
|
props: props$3,
|
|
510
514
|
setup(props2) {
|
|
511
515
|
return () => vue.createVNode(vue.Fragment, null, [vue.createVNode(LinkModal, {
|
|
@@ -950,7 +954,7 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
|
|
|
950
954
|
eventName.bus.emit(editorId, eventName.ON_SAVE);
|
|
951
955
|
}
|
|
952
956
|
}, [vue.createVNode(MdModal.Icon, {
|
|
953
|
-
"name": "
|
|
957
|
+
"name": "save"
|
|
954
958
|
}, null), props2.showToolbarName && vue.createVNode("div", {
|
|
955
959
|
"class": `${config.prefix}-toolbar-item-name`
|
|
956
960
|
}, [(_Q = ult.value.toolbarTips) == null ? void 0 : _Q.save])]);
|
|
@@ -976,7 +980,7 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
|
|
|
976
980
|
props2.updateSetting("pageFullscreen");
|
|
977
981
|
}
|
|
978
982
|
}, [vue.createVNode(MdModal.Icon, {
|
|
979
|
-
"name": props2.setting.pageFullscreen ? "
|
|
983
|
+
"name": props2.setting.pageFullscreen ? "minimize" : "maximize"
|
|
980
984
|
}, null), props2.showToolbarName && vue.createVNode("div", {
|
|
981
985
|
"class": `${config.prefix}-toolbar-item-name`
|
|
982
986
|
}, [(_U = ult.value.toolbarTips) == null ? void 0 : _U.pageFullscreen])]);
|
|
@@ -1028,7 +1032,7 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
|
|
|
1028
1032
|
props2.updateSetting("htmlPreview");
|
|
1029
1033
|
}
|
|
1030
1034
|
}, [vue.createVNode(MdModal.Icon, {
|
|
1031
|
-
"name": "
|
|
1035
|
+
"name": "preview-html"
|
|
1032
1036
|
}, null), props2.showToolbarName && vue.createVNode("div", {
|
|
1033
1037
|
"class": `${config.prefix}-toolbar-item-name`
|
|
1034
1038
|
}, [(_aa = ult.value.toolbarTips) == null ? void 0 : _aa.htmlPreview])]);
|
|
@@ -1956,9 +1960,13 @@ const createAutocompletion = (completions) => {
|
|
|
1956
1960
|
const toggleWith = (view2) => {
|
|
1957
1961
|
const mc = new state.Compartment();
|
|
1958
1962
|
const toggle = (extension) => {
|
|
1959
|
-
mc.get(view2.state)
|
|
1960
|
-
effects:
|
|
1961
|
-
}
|
|
1963
|
+
if (mc.get(view2.state)) {
|
|
1964
|
+
view2.dispatch({ effects: mc.reconfigure(extension) });
|
|
1965
|
+
} else {
|
|
1966
|
+
view2.dispatch({
|
|
1967
|
+
effects: state.StateEffect.appendConfig.of(mc.of(extension))
|
|
1968
|
+
});
|
|
1969
|
+
}
|
|
1962
1970
|
return true;
|
|
1963
1971
|
};
|
|
1964
1972
|
return toggle;
|
|
@@ -2495,9 +2503,9 @@ const useCodeMirror = (props2) => {
|
|
|
2495
2503
|
nc.setTabSize(tabWidth);
|
|
2496
2504
|
nc.setDisabled(props2.disabled);
|
|
2497
2505
|
nc.setReadOnly(props2.readonly);
|
|
2498
|
-
props2.placeholder
|
|
2499
|
-
typeof props2.maxlength === "number"
|
|
2500
|
-
props2.autofocus
|
|
2506
|
+
if (props2.placeholder) nc.setPlaceholder(props2.placeholder);
|
|
2507
|
+
if (typeof props2.maxlength === "number") nc.setMaxLength(props2.maxlength);
|
|
2508
|
+
if (props2.autofocus) view2.focus();
|
|
2501
2509
|
}, 0);
|
|
2502
2510
|
eventName.bus.on(editorId, {
|
|
2503
2511
|
name: eventName.CTRL_Z,
|
|
@@ -2668,13 +2676,13 @@ const useCodeMirror = (props2) => {
|
|
|
2668
2676
|
};
|
|
2669
2677
|
const useResize = (props2, contentRef, resizeRef) => {
|
|
2670
2678
|
const state2 = vue.reactive({
|
|
2671
|
-
resizedWidth: props2.
|
|
2679
|
+
resizedWidth: props2.inputBoxWidth
|
|
2672
2680
|
});
|
|
2673
2681
|
const inputWrapperStyle = vue.reactive({
|
|
2674
|
-
width: props2.
|
|
2682
|
+
width: props2.inputBoxWidth
|
|
2675
2683
|
});
|
|
2676
2684
|
const resizeOperateStyle = vue.reactive({
|
|
2677
|
-
left: props2.
|
|
2685
|
+
left: props2.inputBoxWidth,
|
|
2678
2686
|
display: "initial"
|
|
2679
2687
|
});
|
|
2680
2688
|
const showPreviewWrapper = vue.ref(props2.setting.preview || props2.setting.htmlPreview);
|
|
@@ -2692,7 +2700,7 @@ const useResize = (props2, contentRef, resizeRef) => {
|
|
|
2692
2700
|
inputWrapperStyle.width = ibw;
|
|
2693
2701
|
resizeOperateStyle.left = ibw;
|
|
2694
2702
|
state2.resizedWidth = ibw;
|
|
2695
|
-
(_c = props2.
|
|
2703
|
+
(_c = props2.oninputBoxWidthChange) == null ? void 0 : _c.call(props2, ibw);
|
|
2696
2704
|
};
|
|
2697
2705
|
const resizeMousedown = () => {
|
|
2698
2706
|
document.addEventListener("mousemove", resizeMousemove);
|
|
@@ -2717,7 +2725,7 @@ const useResize = (props2, contentRef, resizeRef) => {
|
|
|
2717
2725
|
(_b = resizeRef.value) == null ? void 0 : _b.removeEventListener("mouseup", resizeMouseup);
|
|
2718
2726
|
});
|
|
2719
2727
|
vue.watch(
|
|
2720
|
-
() => props2.
|
|
2728
|
+
() => props2.inputBoxWidth,
|
|
2721
2729
|
(nVal) => {
|
|
2722
2730
|
if (nVal) {
|
|
2723
2731
|
state2.resizedWidth = nVal;
|
|
@@ -2860,6 +2868,7 @@ const props$2 = {
|
|
|
2860
2868
|
}
|
|
2861
2869
|
};
|
|
2862
2870
|
const Checkbox = /* @__PURE__ */ vue.defineComponent({
|
|
2871
|
+
name: `${config.prefix}-checkbox`,
|
|
2863
2872
|
props: props$2,
|
|
2864
2873
|
setup(props2) {
|
|
2865
2874
|
return () => {
|
|
@@ -2978,7 +2987,6 @@ const Editor = /* @__PURE__ */ vue.defineComponent({
|
|
|
2978
2987
|
emits: MdPreview.editorEmits,
|
|
2979
2988
|
setup(props2, ctx) {
|
|
2980
2989
|
const {
|
|
2981
|
-
editorId,
|
|
2982
2990
|
noKatex,
|
|
2983
2991
|
noMermaid,
|
|
2984
2992
|
noPrettier,
|
|
@@ -2990,16 +2998,32 @@ const Editor = /* @__PURE__ */ vue.defineComponent({
|
|
|
2990
2998
|
});
|
|
2991
2999
|
const rootRef = vue.ref();
|
|
2992
3000
|
const codeRef = vue.ref();
|
|
2993
|
-
|
|
2994
|
-
|
|
3001
|
+
const {
|
|
3002
|
+
editorId
|
|
3003
|
+
} = MdPreview.useProvide(props2, rootRef);
|
|
3004
|
+
const [setting, updateSetting] = MdPreview.useConfig(props2, ctx, {
|
|
3005
|
+
editorId
|
|
3006
|
+
});
|
|
3007
|
+
const catalogVisible = MdPreview.useCatalog(props2, {
|
|
3008
|
+
editorId
|
|
3009
|
+
});
|
|
3010
|
+
MdPreview.useOnSave(props2, ctx, {
|
|
3011
|
+
editorId
|
|
3012
|
+
});
|
|
2995
3013
|
MdPreview.useExpansion(props2);
|
|
2996
|
-
MdPreview.useErrorCatcher(props2, ctx
|
|
2997
|
-
|
|
2998
|
-
|
|
3014
|
+
MdPreview.useErrorCatcher(props2, ctx, {
|
|
3015
|
+
editorId
|
|
3016
|
+
});
|
|
3017
|
+
MdPreview.useExpose(props2, ctx, {
|
|
3018
|
+
editorId,
|
|
3019
|
+
catalogVisible,
|
|
3020
|
+
setting,
|
|
3021
|
+
updateSetting,
|
|
3022
|
+
codeRef
|
|
3023
|
+
});
|
|
2999
3024
|
vue.onBeforeUnmount(() => {
|
|
3000
3025
|
eventName.bus.clear(editorId);
|
|
3001
3026
|
});
|
|
3002
|
-
MdPreview.useExpose(props2, ctx, catalogVisible, setting, updateSetting, codeRef);
|
|
3003
3027
|
return () => {
|
|
3004
3028
|
const defToolbars = vueTsx.getSlot({
|
|
3005
3029
|
props: props2,
|
|
@@ -3092,12 +3116,12 @@ const Editor = /* @__PURE__ */ vue.defineComponent({
|
|
|
3092
3116
|
}
|
|
3093
3117
|
ctx.emit("onDrop", e);
|
|
3094
3118
|
},
|
|
3095
|
-
"
|
|
3096
|
-
"
|
|
3097
|
-
if (props2.
|
|
3098
|
-
props2.
|
|
3119
|
+
"inputBoxWidth": props2.inputBoxWidth,
|
|
3120
|
+
"oninputBoxWidthChange": (width) => {
|
|
3121
|
+
if (props2.oninputBoxWidthChange) {
|
|
3122
|
+
props2.oninputBoxWidthChange(width);
|
|
3099
3123
|
}
|
|
3100
|
-
ctx.emit("
|
|
3124
|
+
ctx.emit("oninputBoxWidthChange", width);
|
|
3101
3125
|
},
|
|
3102
3126
|
"sanitizeMermaid": props2.sanitizeMermaid,
|
|
3103
3127
|
"transformImgUrl": props2.transformImgUrl,
|
package/lib/cjs/ModalToolbar.cjs
CHANGED
|
@@ -28,13 +28,16 @@ const props = {
|
|
|
28
28
|
},
|
|
29
29
|
// 展示在工具栏的内容,通常是个图标
|
|
30
30
|
trigger: {
|
|
31
|
-
type: [String, Object]
|
|
31
|
+
type: [String, Object],
|
|
32
|
+
default: void 0
|
|
32
33
|
},
|
|
33
34
|
onClick: {
|
|
34
|
-
type: Function
|
|
35
|
+
type: Function,
|
|
36
|
+
default: void 0
|
|
35
37
|
},
|
|
36
38
|
onClose: {
|
|
37
|
-
type: Function
|
|
39
|
+
type: Function,
|
|
40
|
+
default: void 0
|
|
38
41
|
},
|
|
39
42
|
/**
|
|
40
43
|
* 显示全屏按钮
|
|
@@ -48,13 +51,16 @@ const props = {
|
|
|
48
51
|
default: false
|
|
49
52
|
},
|
|
50
53
|
onAdjust: {
|
|
51
|
-
type: Function
|
|
54
|
+
type: Function,
|
|
55
|
+
default: void 0
|
|
52
56
|
},
|
|
53
57
|
class: {
|
|
54
|
-
type: String
|
|
58
|
+
type: String,
|
|
59
|
+
default: void 0
|
|
55
60
|
},
|
|
56
61
|
style: {
|
|
57
|
-
type: [Object, String]
|
|
62
|
+
type: [Object, String],
|
|
63
|
+
default: void 0
|
|
58
64
|
},
|
|
59
65
|
showMask: {
|
|
60
66
|
type: Boolean,
|
|
@@ -64,16 +70,20 @@ const props = {
|
|
|
64
70
|
* ==没有意义,仅用于规避克隆组件自动嵌入insert方法时,传入的是该组件而产生的waring
|
|
65
71
|
*/
|
|
66
72
|
insert: {
|
|
67
|
-
type: Function
|
|
73
|
+
type: Function,
|
|
74
|
+
default: void 0
|
|
68
75
|
},
|
|
69
76
|
language: {
|
|
70
|
-
type: String
|
|
77
|
+
type: String,
|
|
78
|
+
default: void 0
|
|
71
79
|
},
|
|
72
80
|
theme: {
|
|
73
|
-
type: String
|
|
81
|
+
type: String,
|
|
82
|
+
default: void 0
|
|
74
83
|
},
|
|
75
84
|
previewTheme: {
|
|
76
|
-
type: String
|
|
85
|
+
type: String,
|
|
86
|
+
default: void 0
|
|
77
87
|
}
|
|
78
88
|
/**
|
|
79
89
|
* ==结束
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const util = require("@vavt/util");
|
|
3
3
|
const prefix = "md-editor";
|
|
4
|
-
const iconfontSvgUrl = "https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.js";
|
|
5
|
-
const iconfontClassUrl = "https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.css";
|
|
6
4
|
const cdnBase = "https://cdnjs.cloudflare.com/ajax/libs";
|
|
7
5
|
const highlightUrl = `${cdnBase}/highlight.js/11.10.0/highlight.min.js`;
|
|
8
6
|
const prettierUrl = {
|
|
@@ -364,14 +362,6 @@ const editorExtensionsAttrs = {
|
|
|
364
362
|
crossOrigin: "anonymous"
|
|
365
363
|
}
|
|
366
364
|
},
|
|
367
|
-
iconfont: {
|
|
368
|
-
integrity: "sha384-HRrf1e8/EiqrIZQftejl7pMTeuLeYczOz7rolAGxgw86N7UjiXkex67Uf2XTZz5z",
|
|
369
|
-
crossOrigin: "anonymous"
|
|
370
|
-
},
|
|
371
|
-
iconfontClass: {
|
|
372
|
-
integrity: "sha384-81pjilF/gLoQvAfd8madmeylVdv8IagPQaq1C/OZbysLav7k9g+Ir3XD5qK00Q5r",
|
|
373
|
-
crossOrigin: "anonymous"
|
|
374
|
-
},
|
|
375
365
|
screenfull: {
|
|
376
366
|
js: {
|
|
377
367
|
integrity: "sha384-ELVAm9p9T4LGCG4lz8hbYalUYAppIpI1zV8IXYDCBUJFiVnV+EeG8vGSYQi+Wi4S",
|
|
@@ -408,8 +398,6 @@ const configOption = {
|
|
|
408
398
|
cropper: {
|
|
409
399
|
...cropperUrl
|
|
410
400
|
},
|
|
411
|
-
iconfont: iconfontSvgUrl,
|
|
412
|
-
iconfontClass: iconfontClassUrl,
|
|
413
401
|
screenfull: {
|
|
414
402
|
js: screenfullUrl
|
|
415
403
|
},
|
|
@@ -431,7 +419,6 @@ const configOption = {
|
|
|
431
419
|
markdownItConfig: () => {
|
|
432
420
|
},
|
|
433
421
|
markdownItPlugins: (s) => s,
|
|
434
|
-
iconfontType: "svg",
|
|
435
422
|
mermaidConfig: (c) => c,
|
|
436
423
|
katexConfig: (c) => c
|
|
437
424
|
};
|
|
@@ -450,7 +437,5 @@ exports.codeCss = codeCss;
|
|
|
450
437
|
exports.config = config;
|
|
451
438
|
exports.configOption = configOption;
|
|
452
439
|
exports.editorExtensionsAttrs = editorExtensionsAttrs;
|
|
453
|
-
exports.iconfontClassUrl = iconfontClassUrl;
|
|
454
|
-
exports.iconfontSvgUrl = iconfontSvgUrl;
|
|
455
440
|
exports.prefix = prefix;
|
|
456
441
|
exports.staticTextDefault = staticTextDefault;
|
package/lib/cjs/chunks/dom.cjs
CHANGED
|
@@ -38,13 +38,17 @@ const appendHandler = (tagName, attributes, checkKey = "") => {
|
|
|
38
38
|
const attrsCopy = { ...attributes };
|
|
39
39
|
attrsCopy.onload = null;
|
|
40
40
|
const ele = createHTMLElement(tagName, attrsCopy);
|
|
41
|
-
|
|
41
|
+
if (attributes.onload) {
|
|
42
|
+
ele.addEventListener("load", attributes.onload);
|
|
43
|
+
}
|
|
42
44
|
document.head.appendChild(ele);
|
|
43
45
|
} else if (checkKey !== "") {
|
|
44
46
|
if (Reflect.get(window, checkKey)) {
|
|
45
47
|
(_a = attributes.onload) == null ? void 0 : _a.call(insertedEle, new Event("load"));
|
|
46
48
|
} else {
|
|
47
|
-
|
|
49
|
+
if (attributes.onload) {
|
|
50
|
+
insertedEle.addEventListener("load", attributes.onload);
|
|
51
|
+
}
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
};
|