md-editor-v3 4.13.5 → 4.14.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 +18 -2
- package/lib/cjs/MdCatalog.cjs +14 -8
- package/lib/cjs/MdEditor.cjs +120 -85
- package/lib/cjs/ModalToolbar.cjs +3 -0
- package/lib/cjs/chunks/config.cjs +174 -16
- package/lib/cjs/chunks/dom.cjs +24 -20
- package/lib/cjs/chunks/event-name.cjs +95 -0
- package/lib/cjs/chunks/index.cjs +219 -177
- package/lib/cjs/chunks/index2.cjs +3 -0
- package/lib/cjs/chunks/index3.cjs +3 -8
- package/lib/cjs/chunks/index4.cjs +7 -94
- package/lib/cjs/config.cjs +1 -0
- package/lib/cjs/index.cjs +1 -0
- package/lib/es/MdCatalog.mjs +12 -6
- package/lib/es/MdEditor.mjs +66 -31
- package/lib/es/ModalToolbar.mjs +3 -0
- package/lib/es/chunks/config.mjs +176 -18
- package/lib/es/chunks/dom.mjs +24 -20
- package/lib/es/chunks/event-name.mjs +96 -0
- package/lib/es/chunks/index.mjs +170 -128
- package/lib/es/chunks/index2.mjs +3 -0
- package/lib/es/chunks/index3.mjs +4 -9
- package/lib/es/chunks/index4.mjs +11 -98
- package/lib/es/config.mjs +2 -1
- package/lib/es/index.mjs +2 -1
- package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +6 -0
- package/lib/types/DropdownToolbar/index.d.ts +12 -0
- package/lib/types/MdCatalog/MdCatalog.d.ts +1 -1
- package/lib/types/MdCatalog/index.d.ts +3 -3
- package/lib/types/MdEditor/Editor.d.ts +0 -3
- package/lib/types/MdEditor/config.d.ts +1 -0
- package/lib/types/MdEditor/index.d.ts +0 -7
- package/lib/types/MdEditor/props.d.ts +2 -1
- package/lib/types/MdEditor/type.d.ts +46 -0
- package/lib/types/MdEditor/utils/dom.d.ts +10 -2
- package/lib/types/MdEditor/utils/index.d.ts +4 -0
- package/lib/types/ModalToolbar/ModalToolbar.d.ts +6 -0
- package/lib/types/ModalToolbar/index.d.ts +12 -0
- package/lib/types/config.d.ts +1 -1
- package/lib/umd/index.js +41 -41
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ Except for the same as `MdPreview`:
|
|
|
138
138
|
| toolbarsExclude | `Array<ToolbarNames \| number>` | [] | Don't show contents of toolbar, all keys`toolbars` |
|
|
139
139
|
| noPrettier | `boolean` | false | Use prettier to beautify content or not |
|
|
140
140
|
| tabWidth | `number` | 2 | One tab eq some spaces |
|
|
141
|
-
| tableShape | `[number, number]` | [6, 4] | Preset the size of the table, [columns, rows] |
|
|
141
|
+
| tableShape | `[number, number] \| [number, number, number, number]` | [6, 4] | Preset the size of the table, [columns, rows, Maximum number of columns, Maximum number of rows] |
|
|
142
142
|
| placeholder | `string` | '' | |
|
|
143
143
|
| footers | `Array<'markdownTotal' \| '=' \| 'scrollSwitch' \| number>` | ['markdownTotal', '=', 'scrollSwitch'] | Show contents of footer, they are divided by `'='`. Set it to `[]` to hidden footer |
|
|
144
144
|
| scrollAuto | `boolean` | true | Scroll default setting |
|
|
@@ -658,7 +658,9 @@ config({
|
|
|
658
658
|
...more
|
|
659
659
|
},
|
|
660
660
|
// Default 500ms. It is set to 0ms when preview only and not set.
|
|
661
|
-
renderDelay: 500
|
|
661
|
+
renderDelay: 500,
|
|
662
|
+
// for modal component
|
|
663
|
+
zIndex: 2000
|
|
662
664
|
}
|
|
663
665
|
});
|
|
664
666
|
```
|
|
@@ -718,6 +720,20 @@ export interface EditorExtensions {
|
|
|
718
720
|
|
|
719
721
|
</details>
|
|
720
722
|
|
|
723
|
+
### editorExtensionsAttrs
|
|
724
|
+
|
|
725
|
+
Synchronously add attributes to the CDN link tags, consistent with the type of `editorExtensions`, with a value type of `HTMLElementTagNameMap['tagName']`.
|
|
726
|
+
|
|
727
|
+
```js
|
|
728
|
+
import { config, editorExtensionsAttrs } from 'md-editor-rt';
|
|
729
|
+
|
|
730
|
+
config({
|
|
731
|
+
editorExtensionsAttrs
|
|
732
|
+
});
|
|
733
|
+
```
|
|
734
|
+
|
|
735
|
+
Do not attempt to define the src \ onload \ id of the script and rel \ href \ id of the link in editorExtensionsAttrs, as they will be overwritten by default values
|
|
736
|
+
|
|
721
737
|
### 🫨 iconfontType
|
|
722
738
|
|
|
723
739
|
Set the way to display icons:
|
package/lib/cjs/MdCatalog.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
const vue = require("vue");
|
|
3
3
|
const config = require("./chunks/config.cjs");
|
|
4
4
|
const index = require("./chunks/index4.cjs");
|
|
5
|
+
const eventName = require("./chunks/event-name.cjs");
|
|
5
6
|
const props$1 = {
|
|
6
7
|
tocItem: {
|
|
7
8
|
type: Object,
|
|
@@ -225,18 +226,23 @@ const MdCatalog = /* @__PURE__ */ vue.defineComponent({
|
|
|
225
226
|
}
|
|
226
227
|
});
|
|
227
228
|
vue.onMounted(() => {
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
229
|
+
let scrollContainer = window;
|
|
230
|
+
const findScrollContainer = () => {
|
|
231
|
+
const scrollElement_ = getScrollElement();
|
|
232
|
+
scrollContainer = scrollElement_ === document.documentElement ? window : scrollElement_;
|
|
233
|
+
};
|
|
234
|
+
eventName.bus.on(editorId, {
|
|
235
|
+
name: eventName.CATALOG_CHANGED,
|
|
233
236
|
callback: (_list) => {
|
|
234
|
-
|
|
237
|
+
scrollContainer == null ? void 0 : scrollContainer.removeEventListener("scroll", scrollHandler);
|
|
235
238
|
findActiveHeading(_list);
|
|
236
|
-
|
|
239
|
+
findScrollContainer();
|
|
240
|
+
scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", scrollHandler);
|
|
237
241
|
}
|
|
238
242
|
});
|
|
239
|
-
|
|
243
|
+
eventName.bus.emit(editorId, eventName.PUSH_CATALOG);
|
|
244
|
+
findScrollContainer();
|
|
245
|
+
scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", scrollHandler);
|
|
240
246
|
});
|
|
241
247
|
vue.onBeforeUnmount(() => {
|
|
242
248
|
var _a;
|