md-editor-v3 4.20.4 → 4.21.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 +52 -40
- package/lib/cjs/MdEditor.cjs +9 -1
- package/lib/cjs/chunks/config.cjs +2 -2
- package/lib/cjs/chunks/index.cjs +4 -4
- package/lib/cjs/index.cjs +38 -3
- package/lib/es/MdEditor.mjs +10 -2
- package/lib/es/chunks/config.mjs +2 -2
- package/lib/es/chunks/event-name.mjs +7 -7
- package/lib/es/chunks/index.mjs +6 -6
- package/lib/es/chunks/index3.mjs +2 -2
- package/lib/es/chunks/index4.mjs +1 -1
- package/lib/es/chunks/index5.mjs +4 -4
- package/lib/es/index.mjs +37 -1
- package/lib/style.css +2 -0
- package/lib/types/NormalFooterToolbar/NormalFooterToolbar.d.ts +13 -0
- package/lib/types/NormalFooterToolbar/index.d.ts +41 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/umd/index.js +37 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -803,15 +803,15 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
|
|
|
803
803
|
|
|
804
804
|
- **props**
|
|
805
805
|
|
|
806
|
-
- `title`: `string`, not
|
|
806
|
+
- `title`: `string`, not required, title of toolbar.
|
|
807
807
|
|
|
808
808
|
- **events**
|
|
809
809
|
|
|
810
|
-
- `onClick`: `(e: MouseEvent) => void`,
|
|
810
|
+
- `onClick`: `(e: MouseEvent) => void`, required.
|
|
811
811
|
|
|
812
812
|
- **slots**
|
|
813
813
|
|
|
814
|
-
- `trigger`: `VNode | JSX.Element`,
|
|
814
|
+
- `trigger`: `VNode | JSX.Element`, required, it is usually an icon, which is displayed on the toolbar.
|
|
815
815
|
|
|
816
816
|
### 🐼 DropdownToolbar
|
|
817
817
|
|
|
@@ -819,17 +819,17 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
|
|
|
819
819
|
|
|
820
820
|
- **props**
|
|
821
821
|
|
|
822
|
-
- `title`: `string`, not
|
|
823
|
-
- `visible`: `boolean`,
|
|
822
|
+
- `title`: `string`, not required, title of toolbar.
|
|
823
|
+
- `visible`: `boolean`, required.
|
|
824
824
|
|
|
825
825
|
- **events**
|
|
826
826
|
|
|
827
|
-
- `onChange`: `(visible: boolean) => void`,
|
|
827
|
+
- `onChange`: `(visible: boolean) => void`, required.
|
|
828
828
|
|
|
829
829
|
- **slots**
|
|
830
830
|
|
|
831
|
-
- `trigger`: `VNode | JSX.Element`,
|
|
832
|
-
- `overlay`: `VNode | JSX.Element`,
|
|
831
|
+
- `trigger`: `VNode | JSX.Element`, required, it is usually an icon, which is displayed on the toolbar.
|
|
832
|
+
- `overlay`: `VNode | JSX.Element`, required, content of dropdown box.
|
|
833
833
|
|
|
834
834
|
### 🦉 ModalToolbar
|
|
835
835
|
|
|
@@ -837,27 +837,27 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
|
|
|
837
837
|
|
|
838
838
|
- **props**
|
|
839
839
|
|
|
840
|
-
- `title`: `string`, not
|
|
841
|
-
- `modalTitle`: `string`, not
|
|
842
|
-
- `visible`: `boolean`,
|
|
843
|
-
- `width`: `string`, not
|
|
840
|
+
- `title`: `string`, not required, title of toolbar.
|
|
841
|
+
- `modalTitle`: `string`, not required, title of the Modal.
|
|
842
|
+
- `visible`: `boolean`, required, visibility of Modal.
|
|
843
|
+
- `width`: `string`, not required, width of Modal, default `auto`.
|
|
844
844
|
- `height`: `string`, same as `width`.
|
|
845
|
-
- `showAdjust`: `boolean`, not
|
|
846
|
-
- `isFullscreen`: `boolean`,
|
|
847
|
-
- `class`: `string`, not
|
|
848
|
-
- `style`: `CSSProperties | string`, not
|
|
849
|
-
- `showMask`: `boolean`, not
|
|
845
|
+
- `showAdjust`: `boolean`, not required, visibility of fullscreen button.
|
|
846
|
+
- `isFullscreen`: `boolean`, required when `showAdjust = true`, status of fullscreen.
|
|
847
|
+
- `class`: `string`, not required.
|
|
848
|
+
- `style`: `CSSProperties | string`, not required.
|
|
849
|
+
- `showMask`: `boolean`, not required, whether to display the mask layer, default `true`.
|
|
850
850
|
|
|
851
851
|
- **events**
|
|
852
852
|
|
|
853
|
-
- `onClick`: `() => void`,
|
|
854
|
-
- `onClose`: `() => void`,
|
|
853
|
+
- `onClick`: `() => void`, required.
|
|
854
|
+
- `onClose`: `() => void`, required, closed event.
|
|
855
855
|
- `onAdjust`: `(val: boolean) => void`, fullscreen button was clicked.
|
|
856
856
|
|
|
857
857
|
- **slots**
|
|
858
858
|
|
|
859
|
-
- `trigger`: `VNode | JSX.Element`,
|
|
860
|
-
- `default`: `VNode | JSX.Element`,
|
|
859
|
+
- `trigger`: `VNode | JSX.Element`, required, it is usually an icon, which is displayed on the toolbar.
|
|
860
|
+
- `default`: `VNode | JSX.Element`, required, content of Modal.
|
|
861
861
|
|
|
862
862
|
### 🐻 MdCatalog
|
|
863
863
|
|
|
@@ -865,19 +865,19 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
|
|
|
865
865
|
|
|
866
866
|
- **props**
|
|
867
867
|
|
|
868
|
-
- `editorId`: `string`,
|
|
869
|
-
- `class`: `string`, not
|
|
870
|
-
- `mdHeadingId`: `MdHeadingId`, not
|
|
871
|
-
- `scrollElement`: `string | HTMLElement`, not
|
|
872
|
-
- `theme`: `'light' | 'dark'`, not
|
|
873
|
-
- `offsetTop`: `number`, not
|
|
874
|
-
- `scrollElementOffsetTop`: `number`, not
|
|
868
|
+
- `editorId`: `string`, required, same as editor's `editorId`, used to register listening events.
|
|
869
|
+
- `class`: `string`, not required.
|
|
870
|
+
- `mdHeadingId`: `MdHeadingId`, not required, same as editor.
|
|
871
|
+
- `scrollElement`: `string | HTMLElement`, not required, it is an element selector when its type is string. When `previewOnly` eq `true`, it is usually set to `document.documentElement`.
|
|
872
|
+
- `theme`: `'light' | 'dark'`, not required, provide it when you want to change theme online, it is the same as Editor `theme`.
|
|
873
|
+
- `offsetTop`: `number`, not required, highlight current item of catalogs when title is `offsetTop` pixels from the top, default 20.
|
|
874
|
+
- `scrollElementOffsetTop`: `number`, not required, offsetTop of the scroll container,default 0.
|
|
875
875
|
- `isScrollElementInShadow`: `boolean`, whether the scroll container is in web component, default false.
|
|
876
876
|
|
|
877
877
|
- **events**
|
|
878
878
|
|
|
879
|
-
- `onClick`: `(e: MouseEvent, t: TocItem) => void`, not
|
|
880
|
-
- `onActive`: `(heading: HeadList | undefined) => void`, not
|
|
879
|
+
- `onClick`: `(e: MouseEvent, t: TocItem) => void`, not required, heading was clicked.
|
|
880
|
+
- `onActive`: `(heading: HeadList | undefined) => void`, not required, heading was highlighted.
|
|
881
881
|
|
|
882
882
|
### 🛸 MdModal
|
|
883
883
|
|
|
@@ -885,24 +885,36 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
|
|
|
885
885
|
|
|
886
886
|
- **props**
|
|
887
887
|
|
|
888
|
-
- `title`: `string`, not
|
|
889
|
-
- `visible`: `boolean`,
|
|
890
|
-
- `width`: `string`, not
|
|
888
|
+
- `title`: `string`, not required, title of Modal.
|
|
889
|
+
- `visible`: `boolean`, required, visibility of Modal.
|
|
890
|
+
- `width`: `string`, not required, width of Modal, default `auto`.
|
|
891
891
|
- `height`: `string`, same as `width`.
|
|
892
|
-
- `showAdjust`: `boolean`, not
|
|
893
|
-
- `isFullscreen`: `boolean`,
|
|
894
|
-
- `class`: `string`, not
|
|
895
|
-
- `style`: `CSSProperties | string`, not
|
|
896
|
-
- `showMask`: `boolean`, not
|
|
892
|
+
- `showAdjust`: `boolean`, not required, visibility of fullscreen button.
|
|
893
|
+
- `isFullscreen`: `boolean`, required when `showAdjust = true`, status of fullscreen.
|
|
894
|
+
- `class`: `string`, not required.
|
|
895
|
+
- `style`: `CSSProperties | string`, not required.
|
|
896
|
+
- `showMask`: `boolean`, not required, whether to display the mask layer, default `true`.
|
|
897
897
|
|
|
898
898
|
- **events**
|
|
899
899
|
|
|
900
|
-
- `onClose`: `() => void`,
|
|
900
|
+
- `onClose`: `() => void`, required, closed event.
|
|
901
901
|
- `onAdjust`: `(val: boolean) => void`, fullscreen button was clicked.
|
|
902
902
|
|
|
903
903
|
- **slots**
|
|
904
904
|
|
|
905
|
-
- `default`: `VNode | JSX.Element`,
|
|
905
|
+
- `default`: `VNode | JSX.Element`, required, content of Modal.
|
|
906
|
+
|
|
907
|
+
### 🛸 NormalFooterToolbar
|
|
908
|
+
|
|
909
|
+
`NormalFooterToolbar`
|
|
910
|
+
|
|
911
|
+
- **events**
|
|
912
|
+
|
|
913
|
+
- `onClick`: `(e: MouseEvent) => void`, not required, toolbar was clicked.
|
|
914
|
+
|
|
915
|
+
- **slots**
|
|
916
|
+
|
|
917
|
+
- `default`: `VNode | JSX.Element`, required, content.
|
|
906
918
|
|
|
907
919
|
## 🪤 Internal Configuration
|
|
908
920
|
|
package/lib/cjs/MdEditor.cjs
CHANGED
|
@@ -1187,6 +1187,7 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
|
|
|
1187
1187
|
immediate: true
|
|
1188
1188
|
});
|
|
1189
1189
|
return () => {
|
|
1190
|
+
var _a;
|
|
1190
1191
|
const LeftBar = splitedbar.value[0].map((barItem) => barRender(barItem));
|
|
1191
1192
|
const RightBar = splitedbar.value[1].map((barItem) => barRender(barItem));
|
|
1192
1193
|
return vue.createVNode(vue.Fragment, null, [props2.toolbars.length > 0 && vue.createVNode("div", {
|
|
@@ -1200,7 +1201,14 @@ const ToolBar = /* @__PURE__ */ vue.defineComponent({
|
|
|
1200
1201
|
"ref": toolbarLeftRef
|
|
1201
1202
|
}, [LeftBar]), vue.createVNode("div", {
|
|
1202
1203
|
"class": `${config.prefix}-toolbar-right`
|
|
1203
|
-
}, [RightBar])])]), vue.createVNode("
|
|
1204
|
+
}, [RightBar])])]), vue.createVNode("label", {
|
|
1205
|
+
"for": `${wrapperId}_label`,
|
|
1206
|
+
"style": {
|
|
1207
|
+
display: "none"
|
|
1208
|
+
},
|
|
1209
|
+
"aria-label": (_a = ult.value.imgTitleItem) == null ? void 0 : _a.upload
|
|
1210
|
+
}, null), vue.createVNode("input", {
|
|
1211
|
+
"id": `${wrapperId}_label`,
|
|
1204
1212
|
"ref": uploadRef,
|
|
1205
1213
|
"accept": "image/*",
|
|
1206
1214
|
"type": "file",
|
package/lib/cjs/chunks/index.cjs
CHANGED
|
@@ -662,7 +662,7 @@ const codetabs = (md, _opts) => {
|
|
|
662
662
|
<div class="${config.prefix}-code-flag"><span></span><span></span><span></span></div>
|
|
663
663
|
<div class="${config.prefix}-code-action">
|
|
664
664
|
<span class="${config.prefix}-code-lang">${tokens[idx].info.trim()}</span>
|
|
665
|
-
<span class="${config.prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}
|
|
665
|
+
<span class="${config.prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
666
666
|
${tagContainer2 === "details" ? collapseTips : ""}
|
|
667
667
|
</div>
|
|
668
668
|
</${tagHeader2}>${codeRendered}</${tagContainer2}>`;
|
|
@@ -685,8 +685,8 @@ const codetabs = (md, _opts) => {
|
|
|
685
685
|
const className = `${config.prefix}-codetab-${_opts.editorId}-${idx}-${i - idx}`;
|
|
686
686
|
checked = i - idx > 0 ? "" : "checked";
|
|
687
687
|
labels += `<li>
|
|
688
|
-
<input type="radio" name="${config.prefix}-codetab-label-${_opts.editorId}-${idx}" class="${className}" ${checked}>
|
|
689
|
-
<label onclick="this.getRootNode().querySelectorAll('.${className}').forEach(e => e.click())">${tab || getLangName(token)}</label>
|
|
688
|
+
<input type="radio" id="label-${config.prefix}-codetab-label-1-${_opts.editorId}-${idx}-${i - idx}" name="${config.prefix}-codetab-label-${_opts.editorId}-${idx}" class="${className}" ${checked}>
|
|
689
|
+
<label for="label-${config.prefix}-codetab-label-1-${_opts.editorId}-${idx}-${i - idx}" onclick="this.getRootNode().querySelectorAll('.${className}').forEach(e => e.click())">${tab || getLangName(token)}</label>
|
|
690
690
|
</li>`;
|
|
691
691
|
pres += `<input type="radio" name="${config.prefix}-codetab-pre-${_opts.editorId}-${idx}" class="${className}" ${checked}>
|
|
692
692
|
${defaultRender(tokens, i, options, env, slf)}`;
|
|
@@ -700,7 +700,7 @@ const codetabs = (md, _opts) => {
|
|
|
700
700
|
</div>
|
|
701
701
|
<div class="${config.prefix}-code-action">
|
|
702
702
|
<span class="${config.prefix}-codetab-lang">${langs}</span>
|
|
703
|
-
<span class="${config.prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}
|
|
703
|
+
<span class="${config.prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
704
704
|
${tagContainer === "details" ? collapseTips : ""}
|
|
705
705
|
</div>
|
|
706
706
|
</${tagHeader}>${pres}</${tagContainer}>`;
|
package/lib/cjs/index.cjs
CHANGED
|
@@ -7,8 +7,42 @@ const DropdownToolbar = require("./chunks/index2.cjs");
|
|
|
7
7
|
const ModalToolbar = require("./ModalToolbar.cjs");
|
|
8
8
|
const MdCatalog = require("./chunks/index3.cjs");
|
|
9
9
|
const MdModal = require("./chunks/index4.cjs");
|
|
10
|
-
const
|
|
10
|
+
const vue = require("vue");
|
|
11
|
+
const vueTsx = require("./chunks/vue-tsx.cjs");
|
|
11
12
|
const config$1 = require("./chunks/config.cjs");
|
|
13
|
+
const config = require("./config.cjs");
|
|
14
|
+
const props = {
|
|
15
|
+
onClick: {
|
|
16
|
+
type: Function
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const NormalFooterToolbar = /* @__PURE__ */ vue.defineComponent({
|
|
20
|
+
name: "NormalFooterToolbar",
|
|
21
|
+
props,
|
|
22
|
+
emits: ["onClick"],
|
|
23
|
+
setup(props2, ctx) {
|
|
24
|
+
return () => {
|
|
25
|
+
const Children = vueTsx.getSlot({
|
|
26
|
+
props: props2,
|
|
27
|
+
ctx
|
|
28
|
+
});
|
|
29
|
+
return vue.createVNode("div", {
|
|
30
|
+
"class": `${config$1.prefix}-footer-item`,
|
|
31
|
+
"onClick": (e) => {
|
|
32
|
+
if (props2.onClick instanceof Function) {
|
|
33
|
+
props2.onClick(e);
|
|
34
|
+
} else {
|
|
35
|
+
ctx.emit("onClick", e);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}, [Children]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
NormalFooterToolbar.install = (app) => {
|
|
43
|
+
app.component(NormalFooterToolbar.name, NormalFooterToolbar);
|
|
44
|
+
return app;
|
|
45
|
+
};
|
|
12
46
|
exports.MdEditor = MdEditor;
|
|
13
47
|
exports.MdPreview = MdPreview.MdPreview;
|
|
14
48
|
exports.StrIcon = MdPreview.StrIcon;
|
|
@@ -17,11 +51,12 @@ exports.DropdownToolbar = DropdownToolbar.DropdownToolbar;
|
|
|
17
51
|
exports.ModalToolbar = ModalToolbar;
|
|
18
52
|
exports.MdCatalog = MdCatalog.MdCatalog;
|
|
19
53
|
exports.MdModal = MdModal.MdModal;
|
|
20
|
-
exports.en_US = config.en_US;
|
|
21
|
-
exports.zh_CN = config.zh_CN;
|
|
22
54
|
exports.allFooter = config$1.allFooter;
|
|
23
55
|
exports.allToolbar = config$1.allToolbar;
|
|
24
56
|
exports.config = config$1.config;
|
|
25
57
|
exports.editorExtensionsAttrs = config$1.editorExtensionsAttrs;
|
|
26
58
|
exports.iconfontClassUrl = config$1.iconfontClassUrl;
|
|
27
59
|
exports.iconfontSvgUrl = config$1.iconfontSvgUrl;
|
|
60
|
+
exports.en_US = config.en_US;
|
|
61
|
+
exports.zh_CN = config.zh_CN;
|
|
62
|
+
exports.NormalFooterToolbar = NormalFooterToolbar;
|
package/lib/es/MdEditor.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { defineComponent, createVNode, inject, ref, onMounted, reactive, compute
|
|
|
5
5
|
import { p as prefix, f as configOption, b as allToolbar, M as MinInputBoxWidth, d as allFooter } from "./chunks/config.mjs";
|
|
6
6
|
import { draggingScroll, linkTo, throttle } from "@vavt/util";
|
|
7
7
|
import { a as Dropdown, D as DropdownToolbar } from "./chunks/index2.mjs";
|
|
8
|
-
import { b as bus,
|
|
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 } from "./chunks/event-name.mjs";
|
|
9
9
|
import { a as appendHandler } from "./chunks/dom.mjs";
|
|
10
10
|
import { M as MdModal, I as Icon } from "./chunks/index4.mjs";
|
|
11
11
|
import { b as base642File } from "./chunks/index5.mjs";
|
|
@@ -1186,6 +1186,7 @@ const ToolBar = /* @__PURE__ */ defineComponent({
|
|
|
1186
1186
|
immediate: true
|
|
1187
1187
|
});
|
|
1188
1188
|
return () => {
|
|
1189
|
+
var _a;
|
|
1189
1190
|
const LeftBar = splitedbar.value[0].map((barItem) => barRender(barItem));
|
|
1190
1191
|
const RightBar = splitedbar.value[1].map((barItem) => barRender(barItem));
|
|
1191
1192
|
return createVNode(Fragment, null, [props2.toolbars.length > 0 && createVNode("div", {
|
|
@@ -1199,7 +1200,14 @@ const ToolBar = /* @__PURE__ */ defineComponent({
|
|
|
1199
1200
|
"ref": toolbarLeftRef
|
|
1200
1201
|
}, [LeftBar]), createVNode("div", {
|
|
1201
1202
|
"class": `${prefix}-toolbar-right`
|
|
1202
|
-
}, [RightBar])])]), createVNode("
|
|
1203
|
+
}, [RightBar])])]), createVNode("label", {
|
|
1204
|
+
"for": `${wrapperId}_label`,
|
|
1205
|
+
"style": {
|
|
1206
|
+
display: "none"
|
|
1207
|
+
},
|
|
1208
|
+
"aria-label": (_a = ult.value.imgTitleItem) == null ? void 0 : _a.upload
|
|
1209
|
+
}, null), createVNode("input", {
|
|
1210
|
+
"id": `${wrapperId}_label`,
|
|
1203
1211
|
"ref": uploadRef,
|
|
1204
1212
|
"accept": "image/*",
|
|
1205
1213
|
"type": "file",
|
package/lib/es/chunks/config.mjs
CHANGED
|
@@ -71,7 +71,7 @@ const EVENT_LISTENER = "eventListener";
|
|
|
71
71
|
const TASK_STATE_CHANGED = "taskStateChanged";
|
|
72
72
|
export {
|
|
73
73
|
BUILD_FINISHED as B,
|
|
74
|
-
|
|
74
|
+
CHANGE_FULL_SCREEN as C,
|
|
75
75
|
ERROR_CATCHER as E,
|
|
76
76
|
FULL_SCREEN_CHANGED as F,
|
|
77
77
|
HTML_PREVIEW_CHANGED as H,
|
|
@@ -80,13 +80,13 @@ export {
|
|
|
80
80
|
REPLACE as R,
|
|
81
81
|
TASK_STATE_CHANGED as T,
|
|
82
82
|
UPLOAD_IMAGE as U,
|
|
83
|
-
|
|
83
|
+
CHANGE_CATALOG_VISIBLE as a,
|
|
84
84
|
bus as b,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
ON_SAVE as c,
|
|
86
|
+
CTRL_SHIFT_Z as d,
|
|
87
|
+
CTRL_Z as e,
|
|
88
|
+
EVENT_LISTENER as f,
|
|
89
|
+
CATALOG_CHANGED as g,
|
|
90
90
|
RERENDER as h,
|
|
91
91
|
PAGE_FULL_SCREEN_CHANGED as i,
|
|
92
92
|
PREVIEW_CHANGED as j,
|
package/lib/es/chunks/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, onMounted, watch, toRef, nextTick, shallowRef, ref, computed, onBeforeUnmount, defineComponent, createVNode, Fragment, reactive, provide } from "vue";
|
|
2
2
|
import { p as prefix, f as configOption, g as codeCss, s as staticTextDefault, b as allToolbar, d as allFooter } from "./config.mjs";
|
|
3
|
-
import { b as bus,
|
|
3
|
+
import { b as bus, g as CATALOG_CHANGED, P as PUSH_CATALOG, h as RERENDER, B as BUILD_FINISHED, T as TASK_STATE_CHANGED, c as ON_SAVE, E as ERROR_CATCHER, U as UPLOAD_IMAGE, a as CHANGE_CATALOG_VISIBLE, i as PAGE_FULL_SCREEN_CHANGED, F as FULL_SCREEN_CHANGED, j as PREVIEW_CHANGED, k as PREVIEW_ONLY_CHANGED, H as HTML_PREVIEW_CHANGED, l as CATALOG_VISIBLE_CHANGED, R as REPLACE, C as CHANGE_FULL_SCREEN, f as EVENT_LISTENER } from "./event-name.mjs";
|
|
4
4
|
import { a as appendHandler, u as updateHandler, z as zoomMermaid } from "./dom.mjs";
|
|
5
5
|
import { debounce, randomId, deepMerge, deepClone } from "@vavt/util";
|
|
6
6
|
import mediumZoom from "medium-zoom";
|
|
@@ -9,7 +9,7 @@ import mdit from "markdown-it";
|
|
|
9
9
|
import ImageFiguresPlugin from "markdown-it-image-figures";
|
|
10
10
|
import SubPlugin from "markdown-it-sub";
|
|
11
11
|
import SupPlugin from "markdown-it-sup";
|
|
12
|
-
import {
|
|
12
|
+
import { g as generateCodeRowNumber, a as getNextId } from "./index5.mjs";
|
|
13
13
|
import { LRUCache } from "lru-cache";
|
|
14
14
|
function _mergeNamespaces(n, m) {
|
|
15
15
|
for (var i = 0; i < m.length; i++) {
|
|
@@ -661,7 +661,7 @@ const codetabs = (md, _opts) => {
|
|
|
661
661
|
<div class="${prefix}-code-flag"><span></span><span></span><span></span></div>
|
|
662
662
|
<div class="${prefix}-code-action">
|
|
663
663
|
<span class="${prefix}-code-lang">${tokens[idx].info.trim()}</span>
|
|
664
|
-
<span class="${prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}
|
|
664
|
+
<span class="${prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
665
665
|
${tagContainer2 === "details" ? collapseTips : ""}
|
|
666
666
|
</div>
|
|
667
667
|
</${tagHeader2}>${codeRendered}</${tagContainer2}>`;
|
|
@@ -684,8 +684,8 @@ const codetabs = (md, _opts) => {
|
|
|
684
684
|
const className = `${prefix}-codetab-${_opts.editorId}-${idx}-${i - idx}`;
|
|
685
685
|
checked = i - idx > 0 ? "" : "checked";
|
|
686
686
|
labels += `<li>
|
|
687
|
-
<input type="radio" name="${prefix}-codetab-label-${_opts.editorId}-${idx}" class="${className}" ${checked}>
|
|
688
|
-
<label onclick="this.getRootNode().querySelectorAll('.${className}').forEach(e => e.click())">${tab || getLangName(token)}</label>
|
|
687
|
+
<input type="radio" id="label-${prefix}-codetab-label-1-${_opts.editorId}-${idx}-${i - idx}" name="${prefix}-codetab-label-${_opts.editorId}-${idx}" class="${className}" ${checked}>
|
|
688
|
+
<label for="label-${prefix}-codetab-label-1-${_opts.editorId}-${idx}-${i - idx}" onclick="this.getRootNode().querySelectorAll('.${className}').forEach(e => e.click())">${tab || getLangName(token)}</label>
|
|
689
689
|
</li>`;
|
|
690
690
|
pres += `<input type="radio" name="${prefix}-codetab-pre-${_opts.editorId}-${idx}" class="${className}" ${checked}>
|
|
691
691
|
${defaultRender(tokens, i, options, env, slf)}`;
|
|
@@ -699,7 +699,7 @@ const codetabs = (md, _opts) => {
|
|
|
699
699
|
</div>
|
|
700
700
|
<div class="${prefix}-code-action">
|
|
701
701
|
<span class="${prefix}-codetab-lang">${langs}</span>
|
|
702
|
-
<span class="${prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}
|
|
702
|
+
<span class="${prefix}-copy-button" data-tips="${codeCodeText}"${isIcon ? " data-is-icon=true" : ""}>${copyBtnHtml}</span>
|
|
703
703
|
${tagContainer === "details" ? collapseTips : ""}
|
|
704
704
|
</div>
|
|
705
705
|
</${tagHeader}>${pres}</${tagContainer}>`;
|
package/lib/es/chunks/index3.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, inject, createVNode, reactive, shallowRef, ref, provide, computed, watch, onMounted, onBeforeUnmount } from "vue";
|
|
2
2
|
import { p as prefix } from "./config.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { b as bus,
|
|
3
|
+
import { c as getRelativeTop } from "./index5.mjs";
|
|
4
|
+
import { b as bus, g as CATALOG_CHANGED, P as PUSH_CATALOG } from "./event-name.mjs";
|
|
5
5
|
import { debounce, createSmoothScroll } from "@vavt/util";
|
|
6
6
|
const DATA_LINE_SELECTOR = `.${prefix}-preview > [data-line]`;
|
|
7
7
|
const getComputedStyleNum = (ele, key) => {
|
package/lib/es/chunks/index4.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { defineComponent, createVNode, inject, h, ref, shallowRef, reactive, com
|
|
|
2
2
|
import { p as prefix, f as configOption } from "./config.mjs";
|
|
3
3
|
import { g as getSlot } from "./vue-tsx.mjs";
|
|
4
4
|
import { k as keyMove } from "./dom.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { d as getZIndexIncrement } from "./index5.mjs";
|
|
6
6
|
const Icon$1 = /* @__PURE__ */ defineComponent({
|
|
7
7
|
props: {
|
|
8
8
|
name: {
|
package/lib/es/chunks/index5.mjs
CHANGED
|
@@ -50,9 +50,9 @@ const getZIndexIncrement = /* @__PURE__ */ (() => {
|
|
|
50
50
|
};
|
|
51
51
|
})();
|
|
52
52
|
export {
|
|
53
|
-
|
|
53
|
+
getNextId as a,
|
|
54
54
|
base642File as b,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
getRelativeTop as c,
|
|
56
|
+
getZIndexIncrement as d,
|
|
57
|
+
generateCodeRowNumber as g
|
|
58
58
|
};
|
package/lib/es/index.mjs
CHANGED
|
@@ -5,8 +5,43 @@ import { D } from "./chunks/index2.mjs";
|
|
|
5
5
|
import { default as default4 } from "./ModalToolbar.mjs";
|
|
6
6
|
import { M as M2 } from "./chunks/index3.mjs";
|
|
7
7
|
import { M as M3 } from "./chunks/index4.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { defineComponent, createVNode } from "vue";
|
|
9
|
+
import { g as getSlot } from "./chunks/vue-tsx.mjs";
|
|
10
|
+
import { p as prefix } from "./chunks/config.mjs";
|
|
9
11
|
import { d, b, c, e, i, a } from "./chunks/config.mjs";
|
|
12
|
+
import { en_US, zh_CN } from "./config.mjs";
|
|
13
|
+
const props = {
|
|
14
|
+
onClick: {
|
|
15
|
+
type: Function
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const NormalFooterToolbar = /* @__PURE__ */ defineComponent({
|
|
19
|
+
name: "NormalFooterToolbar",
|
|
20
|
+
props,
|
|
21
|
+
emits: ["onClick"],
|
|
22
|
+
setup(props2, ctx) {
|
|
23
|
+
return () => {
|
|
24
|
+
const Children = getSlot({
|
|
25
|
+
props: props2,
|
|
26
|
+
ctx
|
|
27
|
+
});
|
|
28
|
+
return createVNode("div", {
|
|
29
|
+
"class": `${prefix}-footer-item`,
|
|
30
|
+
"onClick": (e2) => {
|
|
31
|
+
if (props2.onClick instanceof Function) {
|
|
32
|
+
props2.onClick(e2);
|
|
33
|
+
} else {
|
|
34
|
+
ctx.emit("onClick", e2);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}, [Children]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
NormalFooterToolbar.install = (app) => {
|
|
42
|
+
app.component(NormalFooterToolbar.name, NormalFooterToolbar);
|
|
43
|
+
return app;
|
|
44
|
+
};
|
|
10
45
|
export {
|
|
11
46
|
D as DropdownToolbar,
|
|
12
47
|
M2 as MdCatalog,
|
|
@@ -14,6 +49,7 @@ export {
|
|
|
14
49
|
M3 as MdModal,
|
|
15
50
|
M as MdPreview,
|
|
16
51
|
default4 as ModalToolbar,
|
|
52
|
+
NormalFooterToolbar,
|
|
17
53
|
default3 as NormalToolbar,
|
|
18
54
|
S as StrIcon,
|
|
19
55
|
d as allFooter,
|
package/lib/style.css
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
onClick: {
|
|
4
|
+
type: PropType<(e: MouseEvent) => void>;
|
|
5
|
+
};
|
|
6
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], "onClick", import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
7
|
+
onClick: {
|
|
8
|
+
type: PropType<(e: MouseEvent) => void>;
|
|
9
|
+
};
|
|
10
|
+
}>> & {
|
|
11
|
+
onOnClick?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
}, {}, {}>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstance<Readonly<import("vue").ExtractPropTypes<{
|
|
4
|
+
onClick: {
|
|
5
|
+
type: import("vue").PropType<(e: MouseEvent) => void>;
|
|
6
|
+
};
|
|
7
|
+
}>> & {
|
|
8
|
+
onOnClick?: ((...args: any[]) => any) | undefined;
|
|
9
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
+
onClick: {
|
|
11
|
+
type: import("vue").PropType<(e: MouseEvent) => void>;
|
|
12
|
+
};
|
|
13
|
+
}>> & {
|
|
14
|
+
onOnClick?: ((...args: any[]) => any) | undefined;
|
|
15
|
+
}, {}, true, {}, {}, {
|
|
16
|
+
P: {};
|
|
17
|
+
B: {};
|
|
18
|
+
D: {};
|
|
19
|
+
C: {};
|
|
20
|
+
M: {};
|
|
21
|
+
Defaults: {};
|
|
22
|
+
}, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
onClick: {
|
|
24
|
+
type: import("vue").PropType<(e: MouseEvent) => void>;
|
|
25
|
+
};
|
|
26
|
+
}>> & {
|
|
27
|
+
onOnClick?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
}, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {}>;
|
|
29
|
+
__isFragment?: undefined;
|
|
30
|
+
__isTeleport?: undefined;
|
|
31
|
+
__isSuspense?: undefined;
|
|
32
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
|
33
|
+
onClick: {
|
|
34
|
+
type: import("vue").PropType<(e: MouseEvent) => void>;
|
|
35
|
+
};
|
|
36
|
+
}>> & {
|
|
37
|
+
onOnClick?: ((...args: any[]) => any) | undefined;
|
|
38
|
+
}, () => import("vue/jsx-runtime").JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], "onClick", {}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
39
|
+
install: (app: App) => App;
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ export { default as ModalToolbar } from './ModalToolbar';
|
|
|
6
6
|
export { default as MdCatalog } from './MdCatalog';
|
|
7
7
|
export { default as MdModal } from './MdEditor/components/Modal';
|
|
8
8
|
export { default as StrIcon } from './MdEditor/components/Icon/Str';
|
|
9
|
+
export { default as NormalFooterToolbar } from './NormalFooterToolbar';
|
|
9
10
|
export * from './config';
|
|
10
11
|
export * from './MdEditor/type';
|