md-editor-v3 4.8.3 → 4.9.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2021 imzbf.top
3
+ Copyright (c) 2021 imzbf
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
package/README.md CHANGED
@@ -115,7 +115,7 @@ Inputing prompt and mark, emoji extensions
115
115
  | noKatex | `boolean` | false | Use katex or not |
116
116
  | codeTheme | `'atom' \| 'a11y' \| 'github' \| 'gradient' \| 'kimbie' \| 'paraiso' \| 'qtcreator' \| 'stackoverflow'` | 'atom' | Highlight code style, can be customized also |
117
117
  | mdHeadingId | `(text: string, level: number, index: number) => string` | (text) => text | H1-H6 `ID` generator |
118
- | sanitize | `(html: string) => string` | (html) => html | Sanitize the html, prevent XSS |
118
+ | sanitize | `(html: string) => string` | (html) => html | Sanitize the html, prevent XSS. After 3.x, dangerous code has been processed by default. Please do not use this attribute unless there are special requirements |
119
119
  | noIconfont | `boolean` | false | Not append iconfont script, download different versions [SVG](https://at.alicdn.com/t/c/font_2605852_prouiefeic.js)或[Font Class](https://at.alicdn.com/t/c/font_2605852_prouiefeic.css) and import it by yourself |
120
120
  | formatCopiedText | `(text: string) => string` | (text: string) => text | Format copied code |
121
121
  | codeStyleReverse | `boolean` | true | Code style will be reversed to dark while code block of the theme has a dark background |
@@ -310,15 +310,15 @@ Except for the same as `MdPreview`:
310
310
 
311
311
  | name | type | description |
312
312
  | --- | --- | --- |
313
- | onChange | `value: string` | Content changed event(bind to `oninput` of `textarea`) |
314
- | onSave | `value: string, html: Promise<string>` | Saving content event, `ctrl+s` and clicking button will trigger it |
315
- | onUploadImg | `files: Array<File>, callback: (urls: Array<string>) => void` | Uploading picture event, when picture is uploading the modal will not close, please provide right urls to the callback function |
313
+ | onChange | `value: string` | Content changed(bind to `oninput` of `textarea`) |
314
+ | onSave | `value: string, html: Promise<string>` | Saving content, `ctrl+s` and clicking button will trigger it |
315
+ | onUploadImg | `files: Array<File>, callback: (urls: Array<string>) => void` | Uploading picture, when picture is uploading the modal will not close, please provide right urls to the callback function |
316
316
  | onError | `err: { name: 'Cropper' \| 'fullscreen' \| 'prettier' \| 'overlength'; message: string }` | Catch run-time error, `Cropper`, `fullscreen` and `prettier` are used when they are not loaded. And content exceeds the length limit error |
317
317
  | onBlur | `event: FocusEvent` | Textarea has lost focus |
318
318
  | onFocus | `event: FocusEvent` | Textarea has received focus |
319
319
  | onInput | `event: Event` | Element gets input |
320
- | onDrop | `event: DragEvent` | The event occurs when a selection is being dragged |
321
- | onInputBoxWitdhChange | `(width: string) => void` | Event occurs when width of input box has been changed |
320
+ | onDrop | `event: DragEvent` | Selection is being dragged |
321
+ | onInputBoxWitdhChange | `(width: string) => void` | Width of input box has been changed |
322
322
 
323
323
  ### 🎍 Slots
324
324
 
@@ -742,8 +742,8 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
742
742
  - **events**
743
743
 
744
744
  - `onClick`: `() => void`, necessary.
745
- - `onClose`: `() => void`, necessary, close event.
746
- - `onAdjust`: `(val: boolean) => void`, fullscreen button click event.
745
+ - `onClose`: `() => void`, necessary, closed event.
746
+ - `onAdjust`: `(val: boolean) => void`, fullscreen button was clicked.
747
747
 
748
748
  - **slots**
749
749
 
@@ -766,7 +766,8 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
766
766
 
767
767
  - **events**
768
768
 
769
- - `onClick`: `(e: MouseEvent, t: TocItem) => void`, not necessary.
769
+ - `onClick`: `(e: MouseEvent, t: TocItem) => void`, not necessary, heading was clicked.
770
+ - `onActive`: `(heading: HeadList | undefined) => void`, not necessary, heading was highlighted.
770
771
 
771
772
  ### 🛸 MdModal
772
773
 
@@ -785,8 +786,8 @@ On-demand import. For more examples, refer to [document](https://imzbf.github.io
785
786
 
786
787
  - **events**
787
788
 
788
- - `onClose`: `() => void`, necessary, close event.
789
- - `onAdjust`: `(val: boolean) => void`, fullscreen button click event.
789
+ - `onClose`: `() => void`, necessary, closed event.
790
+ - `onAdjust`: `(val: boolean) => void`, fullscreen button was clicked.
790
791
 
791
792
  - **slots**
792
793
 
@@ -1 +1 @@
1
- "use strict";const o=require("vue"),C=require("@vavt/util"),h=require("./chunks/config.cjs"),p=require("./chunks/index4.cjs"),H={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},scrollElement:{type:[String,Object],default:""},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},y=o.defineComponent({props:H,setup(l){return()=>{const{tocItem:c,mdHeadingId:d,scrollElement:n,onClick:u,scrollElementOffsetTop:g}=l;return o.createVNode("div",{class:[`${h.prefix}-catalog-link`,c.active&&`${h.prefix}-catalog-active`],onClick:r=>{u(r,c),r.stopPropagation();const v=d(c.text,c.level,c.index),m=document.getElementById(v),e=n instanceof Element?n:document.querySelector(n);if(m&&e){let t=m.offsetParent,s=m.offsetTop;if(e.contains(t))for(;t&&e!=t;)s+=t==null?void 0:t.offsetTop,t=t==null?void 0:t.offsetParent;e==null||e.scrollTo({top:s-g,behavior:"smooth"})}}},[o.createVNode("span",{title:c.text},[c.text]),o.createVNode("div",{class:`${h.prefix}-catalog-wrapper`},[c.children&&c.children.map(r=>o.createVNode(y,{mdHeadingId:d,key:`${c.text}-link-${r.level}-${r.text}`,tocItem:r,scrollElement:n,onClick:u,scrollElementOffsetTop:g},null))])])}}}),x=y,$={editorId:{type:String},class:{type:String,default:""},mdHeadingId:{type:Function,default:l=>l},scrollElement:{type:[String,Object]},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function}},b=o.defineComponent({name:"MdCatalog",props:$,emits:["onClick"],setup(l,c){const d=l.editorId,n=o.reactive({list:[],show:!1,scrollElement:l.scrollElement||`#${d}-preview-wrapper`}),u=o.shallowRef(),g=o.computed(()=>{const e=[];return n.list.forEach((t,s)=>{const{text:E,level:I}=t,i={level:I,text:E,index:s+1,active:u.value===t};if(e.length===0)e.push(i);else{let a=e[e.length-1];if(i.level>a.level)for(let f=a.level+1;f<=6;f++){const{children:T}=a;if(!T){a.children=[i];break}if(a=T[T.length-1],i.level<=a.level){T.push(i);break}}else e.push(i)}}),e}),r=()=>n.scrollElement instanceof HTMLElement?n.scrollElement:document.querySelector(n.scrollElement),v=C.throttle(e=>{if(e.length===0)return n.list=[],!1;const{activeHead:t}=e.reduce((s,E,I)=>{const i=document.getElementById(l.mdHeadingId(E.text,E.level,I+1));if(i instanceof HTMLElement){const a=r(),f=p.getRelativeTop(i,a);if(f<l.offsetTop&&f>s.minTop)return{activeHead:E,minTop:f}}return s},{activeHead:e[0],minTop:Number.MIN_SAFE_INTEGER});u.value=t,n.list=e}),m=()=>{v(n.list)};return o.onMounted(()=>{var t;const e=r();(t=e===document.documentElement?window:e)==null||t.addEventListener("scroll",m),p.bus.on(d,{name:p.CATALOG_CHANGED,callback:s=>{v(s)}}),p.bus.emit(d,p.PUSH_CATALOG)}),o.onBeforeUnmount(()=>{var t;const e=r();(t=e===document.documentElement?window:e)==null||t.removeEventListener("scroll",m)}),()=>o.createVNode("div",{class:`${h.prefix}-catalog${l.theme==="dark"?"-dark":""} ${l.class}`},[g.value.map(e=>o.createVNode(x,{mdHeadingId:l.mdHeadingId,tocItem:e,key:`link-${e.level}-${e.text}`,scrollElement:n.scrollElement,onClick:(t,s)=>{l.onClick?l.onClick(t,s):c.emit("onClick",t,s)},scrollElementOffsetTop:l.scrollElementOffsetTop},null))])}}),k=b;k.install=l=>(l.component(k.name,k),l);module.exports=k;
1
+ "use strict";const n=require("vue"),h=require("./chunks/config.cjs"),g=require("./chunks/index4.cjs"),C={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},scrollElement:{type:[String,Object],default:""},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},I=n.defineComponent({props:C,setup(l){return()=>{const{tocItem:o,mdHeadingId:m,scrollElement:c,onClick:f,scrollElementOffsetTop:E}=l;return n.createVNode("div",{class:[`${h.prefix}-catalog-link`,o.active&&`${h.prefix}-catalog-active`],onClick:i=>{f(i,o),i.stopPropagation();const p=m(o.text,o.level,o.index),a=document.getElementById(p),t=c instanceof Element?c:document.querySelector(c);if(a&&t){let e=a.offsetParent,s=a.offsetTop;if(t.contains(e))for(;e&&t!=e;)s+=e==null?void 0:e.offsetTop,e=e==null?void 0:e.offsetParent;t==null||t.scrollTo({top:s-E,behavior:"smooth"})}}},[n.createVNode("span",{title:o.text},[o.text]),n.createVNode("div",{class:`${h.prefix}-catalog-wrapper`},[o.children&&o.children.map(i=>n.createVNode(I,{mdHeadingId:m,key:`${o.text}-link-${i.level}-${i.text}`,tocItem:i,scrollElement:c,onClick:f,scrollElementOffsetTop:E},null))])])}}}),H=I,x={editorId:{type:String},class:{type:String,default:""},mdHeadingId:{type:Function,default:l=>l},scrollElement:{type:[String,Object]},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function},onActive:{type:Function}},$=n.defineComponent({name:"MdCatalog",props:x,emits:["onClick","onActive"],setup(l,o){const m=l.editorId,c=n.reactive({list:[],show:!1,scrollElement:l.scrollElement||`#${m}-preview-wrapper`}),f=n.shallowRef(),E=n.computed(()=>{const t=[];return c.list.forEach((e,s)=>{const{text:v,level:y}=e,r={level:y,text:v,index:s+1,active:f.value===e};if(t.length===0)t.push(r);else{let d=t[t.length-1];if(r.level>d.level)for(let u=d.level+1;u<=6;u++){const{children:T}=d;if(!T){d.children=[r];break}if(d=T[T.length-1],r.level<=d.level){T.push(r);break}}else t.push(r)}}),t}),i=()=>c.scrollElement instanceof HTMLElement?c.scrollElement:document.querySelector(c.scrollElement),p=t=>{if(t.length===0)return c.list=[],!1;const{activeHead:e}=t.reduce((s,v,y)=>{const r=document.getElementById(l.mdHeadingId(v.text,v.level,y+1));if(r instanceof HTMLElement){const d=i(),u=g.getRelativeTop(r,d);if(u<l.offsetTop&&u>s.minTop)return{activeHead:v,minTop:u}}return s},{activeHead:t[0],minTop:Number.MIN_SAFE_INTEGER});f.value=e,c.list=t},a=()=>{p(c.list)};return n.watch(()=>f.value,t=>{const e=t?{...t}:void 0;l.onActive?l.onActive(e):o.emit("onActive",e)}),n.onMounted(()=>{const t=i(),e=t===document.documentElement?window:t;e==null||e.addEventListener("scroll",a),g.bus.on(m,{name:g.CATALOG_CHANGED,callback:s=>{e==null||e.removeEventListener("scroll",a),p(s),e==null||e.addEventListener("scroll",a)}}),g.bus.emit(m,g.PUSH_CATALOG)}),n.onBeforeUnmount(()=>{var e;const t=i();(e=t===document.documentElement?window:t)==null||e.removeEventListener("scroll",a)}),()=>n.createVNode("div",{class:`${h.prefix}-catalog${l.theme==="dark"?"-dark":""} ${l.class}`},[E.value.map(t=>n.createVNode(H,{mdHeadingId:l.mdHeadingId,tocItem:t,key:`link-${t.level}-${t.text}`,scrollElement:c.scrollElement,onClick:(e,s)=>{l.onClick?l.onClick(e,s):o.emit("onClick",e,s)},scrollElementOffsetTop:l.scrollElementOffsetTop},null))])}}),k=$;k.install=l=>(l.component(k.name,k),l);module.exports=k;
@@ -1,8 +1,7 @@
1
- import { defineComponent as y, createVNode as f, reactive as H, shallowRef as $, computed as b, onMounted as x, onBeforeUnmount as O } from "vue";
2
- import { throttle as w } from "@vavt/util";
1
+ import { defineComponent as I, createVNode as u, reactive as H, shallowRef as $, computed as b, watch as A, onMounted as w, onBeforeUnmount as x } from "vue";
3
2
  import { p as T } from "./chunks/config.mjs";
4
- import { g as S, b as I, C as L, P as N } from "./chunks/index4.mjs";
5
- const A = {
3
+ import { b as y, C as O, P as L, g as S } from "./chunks/index4.mjs";
4
+ const N = {
6
5
  tocItem: {
7
6
  type: Object,
8
7
  default: () => ({})
@@ -25,44 +24,44 @@ const A = {
25
24
  type: Number,
26
25
  default: 0
27
26
  }
28
- }, C = /* @__PURE__ */ y({
29
- props: A,
27
+ }, C = /* @__PURE__ */ I({
28
+ props: N,
30
29
  setup(l) {
31
30
  return () => {
32
31
  const {
33
- tocItem: o,
34
- mdHeadingId: i,
35
- scrollElement: n,
36
- onClick: u,
37
- scrollElementOffsetTop: p
32
+ tocItem: n,
33
+ mdHeadingId: d,
34
+ scrollElement: o,
35
+ onClick: m,
36
+ scrollElementOffsetTop: v
38
37
  } = l;
39
- return f("div", {
40
- class: [`${T}-catalog-link`, o.active && `${T}-catalog-active`],
38
+ return u("div", {
39
+ class: [`${T}-catalog-link`, n.active && `${T}-catalog-active`],
41
40
  onClick: (s) => {
42
- u(s, o), s.stopPropagation();
43
- const g = i(o.text, o.level, o.index), d = document.getElementById(g), e = n instanceof Element ? n : document.querySelector(n);
44
- if (d && e) {
45
- let t = d.offsetParent, c = d.offsetTop;
46
- if (e.contains(t))
47
- for (; t && e != t; )
48
- c += t == null ? void 0 : t.offsetTop, t = t == null ? void 0 : t.offsetParent;
49
- e == null || e.scrollTo({
50
- top: c - p,
41
+ m(s, n), s.stopPropagation();
42
+ const E = d(n.text, n.level, n.index), a = document.getElementById(E), t = o instanceof Element ? o : document.querySelector(o);
43
+ if (a && t) {
44
+ let e = a.offsetParent, c = a.offsetTop;
45
+ if (t.contains(e))
46
+ for (; e && t != e; )
47
+ c += e == null ? void 0 : e.offsetTop, e = e == null ? void 0 : e.offsetParent;
48
+ t == null || t.scrollTo({
49
+ top: c - v,
51
50
  behavior: "smooth"
52
51
  });
53
52
  }
54
53
  }
55
- }, [f("span", {
56
- title: o.text
57
- }, [o.text]), f("div", {
54
+ }, [u("span", {
55
+ title: n.text
56
+ }, [n.text]), u("div", {
58
57
  class: `${T}-catalog-wrapper`
59
- }, [o.children && o.children.map((s) => f(C, {
60
- mdHeadingId: i,
61
- key: `${o.text}-link-${s.level}-${s.text}`,
58
+ }, [n.children && n.children.map((s) => u(C, {
59
+ mdHeadingId: d,
60
+ key: `${n.text}-link-${s.level}-${s.text}`,
62
61
  tocItem: s,
63
- scrollElement: n,
64
- onClick: u,
65
- scrollElementOffsetTop: p
62
+ scrollElement: o,
63
+ onClick: m,
64
+ scrollElementOffsetTop: v
66
65
  }, null))])]);
67
66
  };
68
67
  }
@@ -114,96 +113,103 @@ const A = {
114
113
  },
115
114
  onClick: {
116
115
  type: Function
116
+ },
117
+ onActive: {
118
+ type: Function
117
119
  }
118
- }, P = /* @__PURE__ */ y({
120
+ }, P = /* @__PURE__ */ I({
119
121
  name: "MdCatalog",
120
122
  props: F,
121
- emits: ["onClick"],
122
- setup(l, o) {
123
- const i = l.editorId, n = H({
123
+ emits: ["onClick", "onActive"],
124
+ setup(l, n) {
125
+ const d = l.editorId, o = H({
124
126
  list: [],
125
127
  show: !1,
126
- scrollElement: l.scrollElement || `#${i}-preview-wrapper`
127
- }), u = $(), p = b(() => {
128
- const e = [];
129
- return n.list.forEach((t, c) => {
128
+ scrollElement: l.scrollElement || `#${d}-preview-wrapper`
129
+ }), m = $(), v = b(() => {
130
+ const t = [];
131
+ return o.list.forEach((e, c) => {
130
132
  const {
131
- text: E,
133
+ text: g,
132
134
  level: h
133
- } = t, a = {
135
+ } = e, i = {
134
136
  level: h,
135
- text: E,
137
+ text: g,
136
138
  index: c + 1,
137
- active: u.value === t
139
+ active: m.value === e
138
140
  };
139
- if (e.length === 0)
140
- e.push(a);
141
+ if (t.length === 0)
142
+ t.push(i);
141
143
  else {
142
- let r = e[e.length - 1];
143
- if (a.level > r.level)
144
- for (let m = r.level + 1; m <= 6; m++) {
144
+ let r = t[t.length - 1];
145
+ if (i.level > r.level)
146
+ for (let f = r.level + 1; f <= 6; f++) {
145
147
  const {
146
- children: v
148
+ children: p
147
149
  } = r;
148
- if (!v) {
149
- r.children = [a];
150
+ if (!p) {
151
+ r.children = [i];
150
152
  break;
151
153
  }
152
- if (r = v[v.length - 1], a.level <= r.level) {
153
- v.push(a);
154
+ if (r = p[p.length - 1], i.level <= r.level) {
155
+ p.push(i);
154
156
  break;
155
157
  }
156
158
  }
157
159
  else
158
- e.push(a);
160
+ t.push(i);
159
161
  }
160
- }), e;
161
- }), s = () => n.scrollElement instanceof HTMLElement ? n.scrollElement : document.querySelector(n.scrollElement), g = w((e) => {
162
- if (e.length === 0)
163
- return n.list = [], !1;
162
+ }), t;
163
+ }), s = () => o.scrollElement instanceof HTMLElement ? o.scrollElement : document.querySelector(o.scrollElement), E = (t) => {
164
+ if (t.length === 0)
165
+ return o.list = [], !1;
164
166
  const {
165
- activeHead: t
166
- } = e.reduce((c, E, h) => {
167
- const a = document.getElementById(l.mdHeadingId(E.text, E.level, h + 1));
168
- if (a instanceof HTMLElement) {
169
- const r = s(), m = S(a, r);
170
- if (m < l.offsetTop && m > c.minTop)
167
+ activeHead: e
168
+ } = t.reduce((c, g, h) => {
169
+ const i = document.getElementById(l.mdHeadingId(g.text, g.level, h + 1));
170
+ if (i instanceof HTMLElement) {
171
+ const r = s(), f = S(i, r);
172
+ if (f < l.offsetTop && f > c.minTop)
171
173
  return {
172
- activeHead: E,
173
- minTop: m
174
+ activeHead: g,
175
+ minTop: f
174
176
  };
175
177
  }
176
178
  return c;
177
179
  }, {
178
- activeHead: e[0],
180
+ activeHead: t[0],
179
181
  minTop: Number.MIN_SAFE_INTEGER
180
182
  });
181
- u.value = t, n.list = e;
182
- }), d = () => {
183
- g(n.list);
183
+ m.value = e, o.list = t;
184
+ }, a = () => {
185
+ E(o.list);
184
186
  };
185
- return x(() => {
186
- var t;
187
- const e = s();
188
- (t = e === document.documentElement ? window : e) == null || t.addEventListener("scroll", d), I.on(i, {
189
- name: L,
187
+ return A(() => m.value, (t) => {
188
+ const e = t ? {
189
+ ...t
190
+ } : void 0;
191
+ l.onActive ? l.onActive(e) : n.emit("onActive", e);
192
+ }), w(() => {
193
+ const t = s(), e = t === document.documentElement ? window : t;
194
+ e == null || e.addEventListener("scroll", a), y.on(d, {
195
+ name: O,
190
196
  callback: (c) => {
191
- g(c);
197
+ e == null || e.removeEventListener("scroll", a), E(c), e == null || e.addEventListener("scroll", a);
192
198
  }
193
- }), I.emit(i, N);
194
- }), O(() => {
195
- var t;
196
- const e = s();
197
- (t = e === document.documentElement ? window : e) == null || t.removeEventListener("scroll", d);
198
- }), () => f("div", {
199
+ }), y.emit(d, L);
200
+ }), x(() => {
201
+ var e;
202
+ const t = s();
203
+ (e = t === document.documentElement ? window : t) == null || e.removeEventListener("scroll", a);
204
+ }), () => u("div", {
199
205
  class: `${T}-catalog${l.theme === "dark" ? "-dark" : ""} ${l.class}`
200
- }, [p.value.map((e) => f(M, {
206
+ }, [v.value.map((t) => u(M, {
201
207
  mdHeadingId: l.mdHeadingId,
202
- tocItem: e,
203
- key: `link-${e.level}-${e.text}`,
204
- scrollElement: n.scrollElement,
205
- onClick: (t, c) => {
206
- l.onClick ? l.onClick(t, c) : o.emit("onClick", t, c);
208
+ tocItem: t,
209
+ key: `link-${t.level}-${t.text}`,
210
+ scrollElement: o.scrollElement,
211
+ onClick: (e, c) => {
212
+ l.onClick ? l.onClick(e, c) : n.emit("onClick", e, c);
207
213
  },
208
214
  scrollElementOffsetTop: l.scrollElementOffsetTop
209
215
  }, null))]);
@@ -1,5 +1,5 @@
1
1
  import { PropType, ExtractPropTypes } from 'vue';
2
- import { MdHeadingId, Themes } from '../MdEditor/type';
2
+ import { HeadList, MdHeadingId, Themes } from '../MdEditor/type';
3
3
  export interface TocItem {
4
4
  text: string;
5
5
  level: number;
@@ -56,7 +56,10 @@ declare const MdCatalog: import("vue").DefineComponent<{
56
56
  onClick: {
57
57
  type: PropType<(e: MouseEvent, t: TocItem) => void>;
58
58
  };
59
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], "onClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
59
+ onActive: {
60
+ type: PropType<(heading: HeadList | undefined) => void>;
61
+ };
62
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onClick" | "onActive")[], "onClick" | "onActive", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
60
63
  /**
61
64
  * 编辑器的Id,务必与需要绑定的编辑器Id相同
62
65
  */
@@ -105,8 +108,12 @@ declare const MdCatalog: import("vue").DefineComponent<{
105
108
  onClick: {
106
109
  type: PropType<(e: MouseEvent, t: TocItem) => void>;
107
110
  };
111
+ onActive: {
112
+ type: PropType<(heading: HeadList | undefined) => void>;
113
+ };
108
114
  }>> & {
109
115
  onOnClick?: ((...args: any[]) => any) | undefined;
116
+ onOnActive?: ((...args: any[]) => any) | undefined;
110
117
  }, {
111
118
  theme: Themes;
112
119
  class: string;
@@ -55,7 +55,9 @@ declare const _default: {
55
55
  style?: unknown;
56
56
  readonly onClick?: ((e: MouseEvent, t: import("./MdCatalog").TocItem) => void) | undefined;
57
57
  readonly scrollElement?: string | HTMLElement | undefined;
58
+ readonly onActive?: ((heading: import("..").HeadList | undefined) => void) | undefined;
58
59
  onOnClick?: ((...args: any[]) => any) | undefined;
60
+ onOnActive?: ((...args: any[]) => any) | undefined;
59
61
  };
60
62
  $attrs: {
61
63
  [x: string]: unknown;
@@ -68,7 +70,7 @@ declare const _default: {
68
70
  }>;
69
71
  $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
70
72
  $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}>, {}, {}> | null;
71
- $emit: (event: "onClick", ...args: any[]) => void;
73
+ $emit: (event: "onClick" | "onActive", ...args: any[]) => void;
72
74
  $el: any;
73
75
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
74
76
  editorId: {
@@ -100,9 +102,13 @@ declare const _default: {
100
102
  onClick: {
101
103
  type: import("vue").PropType<(e: MouseEvent, t: import("./MdCatalog").TocItem) => void>;
102
104
  };
105
+ onActive: {
106
+ type: import("vue").PropType<(heading: import("..").HeadList | undefined) => void>;
107
+ };
103
108
  }>> & {
104
109
  onOnClick?: ((...args: any[]) => any) | undefined;
105
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], string, {
110
+ onOnActive?: ((...args: any[]) => any) | undefined;
111
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onClick" | "onActive")[], string, {
106
112
  theme: import("..").Themes;
107
113
  class: string;
108
114
  mdHeadingId: import("..").MdHeadingId;
@@ -158,8 +164,12 @@ declare const _default: {
158
164
  onClick: {
159
165
  type: import("vue").PropType<(e: MouseEvent, t: import("./MdCatalog").TocItem) => void>;
160
166
  };
167
+ onActive: {
168
+ type: import("vue").PropType<(heading: import("..").HeadList | undefined) => void>;
169
+ };
161
170
  }>> & {
162
171
  onOnClick?: ((...args: any[]) => any) | undefined;
172
+ onOnActive?: ((...args: any[]) => any) | undefined;
163
173
  } & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & import("vue").ComponentCustomProperties & {};
164
174
  __isFragment?: undefined;
165
175
  __isTeleport?: undefined;
@@ -194,9 +204,13 @@ declare const _default: {
194
204
  onClick: {
195
205
  type: import("vue").PropType<(e: MouseEvent, t: import("./MdCatalog").TocItem) => void>;
196
206
  };
207
+ onActive: {
208
+ type: import("vue").PropType<(heading: import("..").HeadList | undefined) => void>;
209
+ };
197
210
  }>> & {
198
211
  onOnClick?: ((...args: any[]) => any) | undefined;
199
- }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], "onClick", {
212
+ onOnActive?: ((...args: any[]) => any) | undefined;
213
+ }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onClick" | "onActive")[], "onClick" | "onActive", {
200
214
  theme: import("..").Themes;
201
215
  class: string;
202
216
  mdHeadingId: import("..").MdHeadingId;