md-editor-v3 4.21.0 → 4.21.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/lib/cjs/MdEditor.cjs +73 -27
- package/lib/cjs/chunks/config.cjs +178 -186
- package/lib/cjs/chunks/dom.cjs +64 -52
- package/lib/cjs/chunks/index.cjs +85 -49
- package/lib/cjs/chunks/index3.cjs +11 -11
- package/lib/es/MdEditor.mjs +73 -27
- package/lib/es/chunks/config.mjs +178 -186
- package/lib/es/chunks/dom.mjs +64 -52
- package/lib/es/chunks/index.mjs +85 -49
- package/lib/es/chunks/index3.mjs +11 -11
- package/lib/types/MdEditor/config.d.ts +7 -7
- package/lib/umd/index.js +85 -51
- package/package.json +1 -9
package/lib/es/chunks/index3.mjs
CHANGED
|
@@ -509,6 +509,15 @@ const MdCatalog = /* @__PURE__ */ defineComponent({
|
|
|
509
509
|
const scrollHandler = () => {
|
|
510
510
|
findActiveHeading(state.list);
|
|
511
511
|
};
|
|
512
|
+
const catalogChangedHandler = (_list) => {
|
|
513
|
+
var _a, _b;
|
|
514
|
+
const scrollElement = getScrollElement();
|
|
515
|
+
scrollElementRef.value = scrollElement;
|
|
516
|
+
scrollContainerRef.value = scrollElement === document.documentElement ? document : scrollElement;
|
|
517
|
+
(_a = scrollContainerRef.value) == null ? void 0 : _a.removeEventListener("scroll", scrollHandler);
|
|
518
|
+
findActiveHeading(_list);
|
|
519
|
+
(_b = scrollContainerRef.value) == null ? void 0 : _b.addEventListener("scroll", scrollHandler);
|
|
520
|
+
};
|
|
512
521
|
watch(() => activeItem.value, (nVal) => {
|
|
513
522
|
const activeHeading = nVal ? {
|
|
514
523
|
...nVal
|
|
@@ -521,24 +530,15 @@ const MdCatalog = /* @__PURE__ */ defineComponent({
|
|
|
521
530
|
});
|
|
522
531
|
onMounted(() => {
|
|
523
532
|
rootNodeRef.value = catalogRef.value.getRootNode();
|
|
524
|
-
let scrollElement = getScrollElement();
|
|
525
|
-
scrollElementRef.value = scrollElement;
|
|
526
533
|
bus.on(editorId, {
|
|
527
534
|
name: CATALOG_CHANGED,
|
|
528
|
-
callback:
|
|
529
|
-
var _a, _b;
|
|
530
|
-
scrollElement = getScrollElement();
|
|
531
|
-
scrollElementRef.value = scrollElement;
|
|
532
|
-
scrollContainerRef.value = scrollElement === document.documentElement ? document : scrollElement;
|
|
533
|
-
(_a = scrollContainerRef.value) == null ? void 0 : _a.removeEventListener("scroll", scrollHandler);
|
|
534
|
-
findActiveHeading(_list);
|
|
535
|
-
(_b = scrollContainerRef.value) == null ? void 0 : _b.addEventListener("scroll", scrollHandler);
|
|
536
|
-
}
|
|
535
|
+
callback: catalogChangedHandler
|
|
537
536
|
});
|
|
538
537
|
bus.emit(editorId, PUSH_CATALOG);
|
|
539
538
|
});
|
|
540
539
|
onBeforeUnmount(() => {
|
|
541
540
|
var _a;
|
|
541
|
+
bus.remove(editorId, CATALOG_CHANGED, catalogChangedHandler);
|
|
542
542
|
(_a = scrollContainerRef.value) == null ? void 0 : _a.removeEventListener("scroll", scrollHandler);
|
|
543
543
|
});
|
|
544
544
|
return () => createVNode("div", {
|
|
@@ -3,8 +3,8 @@ export declare const prefix = "md-editor";
|
|
|
3
3
|
export declare const defaultEditorId = "md-editor-v3";
|
|
4
4
|
export declare const iconfontSvgUrl = "https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.js";
|
|
5
5
|
export declare const iconfontClassUrl = "https://at.alicdn.com/t/c/font_2605852_cmafimm6hot.css";
|
|
6
|
-
export declare const cdnBase = "https://
|
|
7
|
-
export declare const highlightUrl = "https://
|
|
6
|
+
export declare const cdnBase = "https://unpkg.com";
|
|
7
|
+
export declare const highlightUrl = "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/highlight.min.js";
|
|
8
8
|
export declare const prettierUrl: {
|
|
9
9
|
main: string;
|
|
10
10
|
markdown: string;
|
|
@@ -13,17 +13,17 @@ export declare const cropperUrl: {
|
|
|
13
13
|
css: string;
|
|
14
14
|
js: string;
|
|
15
15
|
};
|
|
16
|
-
export declare const screenfullUrl = "https://
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const allFooter: Array<Footers>;
|
|
19
|
-
export declare const staticTextDefault: StaticTextDefault;
|
|
20
|
-
export declare const mermaidUrl = "https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.6.1/mermaid.esm.min.mjs";
|
|
16
|
+
export declare const screenfullUrl = "https://unpkg.com/screenfull@5.2.0/dist/screenfull.js";
|
|
17
|
+
export declare const mermaidUrl = "https://unpkg.com/mermaid@11.3.0/dist/mermaid.min.js";
|
|
21
18
|
export declare const katexUrl: {
|
|
22
19
|
js: string;
|
|
23
20
|
css: string;
|
|
24
21
|
};
|
|
25
22
|
export declare const codeCss: CodeCss;
|
|
26
23
|
export declare const editorExtensionsAttrs: ConfigOption['editorExtensionsAttrs'];
|
|
24
|
+
export declare const allToolbar: string[];
|
|
25
|
+
export declare const allFooter: Array<Footers>;
|
|
26
|
+
export declare const staticTextDefault: StaticTextDefault;
|
|
27
27
|
export declare const configOption: ConfigOption;
|
|
28
28
|
export declare const config: Config;
|
|
29
29
|
/**
|