md-editor-v3 2.2.1 → 2.3.0-beta.1

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 CHANGED
@@ -90,6 +90,7 @@ mark and emoji extensions
90
90
  | footers | Array<'markdownTotal' \| '=' \| 'scrollSwitch' \| number> | ['markdownTotal', '=', 'scrollSwitch'] | Show contents of footer, they are divided by `'='`. Set it to `[]` to hidden footer |
91
91
  | scrollAuto | boolean | true | Scroll default setting |
92
92
  | noIconfont | boolean | false | Not append iconfont script, [download](https://at.alicdn.com/t/font_2605852_pqekijay2ij.js) and import it by yourself |
93
+ | formatCopiedText | (text: string) => string | (text: string) => text | Format copied code |
93
94
 
94
95
  <details>
95
96
  <summary>[toolbars]</summary>
@@ -504,6 +505,7 @@ They are used as attributes of the editor component, eg: `Editor.DropdownToolbar
504
505
  - `markedHeadingId`: `MarkedHeadingId`, not necessary, same as editor.
505
506
  - `scrollElement`: `string | HTMLElement`, not necessary, it is an element selector when its type is string. When `previewOnly` eq `true`, it is usually set to `document.documentElement`.
506
507
  - `theme`: `'light' | 'dark'`, not necessary, provide it when you want to change theme online, it is the same as Editor `theme`.
508
+ - `offsetTop`: `number`, not necessary, highlight current item of catalogs when title is `offsetTop` pixels from the top, defalut 20.
507
509
 
508
510
  - **events**
509
511
 
@@ -131,6 +131,10 @@ declare const Editor: import("vue").DefineComponent<{
131
131
  noIconfont: {
132
132
  type: import("vue").PropType<boolean>;
133
133
  };
134
+ formatCopiedText: {
135
+ type: import("vue").PropType<(text: string) => string>;
136
+ default: (text: string) => string;
137
+ };
134
138
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
135
139
  modelValue: {
136
140
  type: import("vue").PropType<string>;
@@ -263,6 +267,10 @@ declare const Editor: import("vue").DefineComponent<{
263
267
  noIconfont: {
264
268
  type: import("vue").PropType<boolean>;
265
269
  };
270
+ formatCopiedText: {
271
+ type: import("vue").PropType<(text: string) => string>;
272
+ default: (text: string) => string;
273
+ };
266
274
  }>>, {
267
275
  preview: boolean;
268
276
  htmlPreview: boolean;
@@ -290,5 +298,6 @@ declare const Editor: import("vue").DefineComponent<{
290
298
  codeTheme: string;
291
299
  footers: import("./type").Footers[];
292
300
  scrollAuto: boolean;
301
+ formatCopiedText: (text: string) => string;
293
302
  }>;
294
303
  export default Editor;
@@ -4,6 +4,7 @@ export interface TocItem {
4
4
  text: string;
5
5
  level: number;
6
6
  index: number;
7
+ active: boolean;
7
8
  children?: Array<TocItem>;
8
9
  }
9
10
  declare const MdCatalog: import("vue").DefineComponent<{
@@ -19,12 +20,16 @@ declare const MdCatalog: import("vue").DefineComponent<{
19
20
  default: (text: string) => string;
20
21
  };
21
22
  scrollElement: {
22
- type: PropType<string | Element>;
23
+ type: PropType<string | HTMLElement>;
23
24
  };
24
25
  theme: {
25
26
  type: PropType<Themes>;
26
27
  default: string;
27
28
  };
29
+ offsetTop: {
30
+ type: PropType<number>;
31
+ default: number;
32
+ };
28
33
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "onClick"[], "onClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
29
34
  editorId: {
30
35
  type: PropType<string>;
@@ -38,17 +43,22 @@ declare const MdCatalog: import("vue").DefineComponent<{
38
43
  default: (text: string) => string;
39
44
  };
40
45
  scrollElement: {
41
- type: PropType<string | Element>;
46
+ type: PropType<string | HTMLElement>;
42
47
  };
43
48
  theme: {
44
49
  type: PropType<Themes>;
45
50
  default: string;
46
51
  };
52
+ offsetTop: {
53
+ type: PropType<number>;
54
+ default: number;
55
+ };
47
56
  }>> & {
48
57
  onOnClick?: ((...args: any[]) => any) | undefined;
49
58
  }, {
50
59
  theme: Themes;
51
60
  class: string;
52
61
  markedHeadingId: MarkedHeadingId;
62
+ offsetTop: number;
53
63
  }>;
54
64
  export default MdCatalog;
@@ -35,6 +35,7 @@ declare const _default: {
35
35
  codeTheme: string;
36
36
  footers: import("./type").Footers[];
37
37
  scrollAuto: boolean;
38
+ formatCopiedText: (text: string) => string;
38
39
  }> & Omit<Readonly<import("vue").ExtractPropTypes<{
39
40
  modelValue: {
40
41
  type: import("vue").PropType<string>;
@@ -167,7 +168,11 @@ declare const _default: {
167
168
  noIconfont: {
168
169
  type: import("vue").PropType<boolean>;
169
170
  };
170
- }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "preview" | "htmlPreview" | "modelValue" | "theme" | "class" | "historyLength" | "pageFullScreen" | "previewOnly" | "language" | "toolbars" | "toolbarsExclude" | "noPrettier" | "editorId" | "tabWidth" | "showCodeRowNumber" | "previewTheme" | "style" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "codeTheme" | "footers" | "scrollAuto">;
171
+ formatCopiedText: {
172
+ type: import("vue").PropType<(text: string) => string>;
173
+ default: (text: string) => string;
174
+ };
175
+ }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "preview" | "htmlPreview" | "modelValue" | "theme" | "class" | "historyLength" | "pageFullScreen" | "previewOnly" | "language" | "toolbars" | "toolbarsExclude" | "noPrettier" | "editorId" | "tabWidth" | "showCodeRowNumber" | "previewTheme" | "style" | "markedHeadingId" | "tableShape" | "noMermaid" | "sanitize" | "placeholder" | "noKatex" | "codeTheme" | "footers" | "scrollAuto" | "formatCopiedText">;
171
176
  $attrs: {
172
177
  [x: string]: unknown;
173
178
  };
@@ -313,6 +318,10 @@ declare const _default: {
313
318
  noIconfont: {
314
319
  type: import("vue").PropType<boolean>;
315
320
  };
321
+ formatCopiedText: {
322
+ type: import("vue").PropType<(text: string) => string>;
323
+ default: (text: string) => string;
324
+ };
316
325
  }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
317
326
  preview: boolean;
318
327
  htmlPreview: boolean;
@@ -340,6 +349,7 @@ declare const _default: {
340
349
  codeTheme: string;
341
350
  footers: import("./type").Footers[];
342
351
  scrollAuto: boolean;
352
+ formatCopiedText: (text: string) => string;
343
353
  }> & {
344
354
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
345
355
  created?: ((() => void) | (() => void)[]) | undefined;
@@ -492,6 +502,10 @@ declare const _default: {
492
502
  noIconfont: {
493
503
  type: import("vue").PropType<boolean>;
494
504
  };
505
+ formatCopiedText: {
506
+ type: import("vue").PropType<(text: string) => string>;
507
+ default: (text: string) => string;
508
+ };
495
509
  }>> & import("vue").ShallowUnwrapRef<() => JSX.Element> & {} & {} & import("vue").ComponentCustomProperties;
496
510
  __isFragment?: undefined;
497
511
  __isTeleport?: undefined;
@@ -628,6 +642,10 @@ declare const _default: {
628
642
  noIconfont: {
629
643
  type: import("vue").PropType<boolean>;
630
644
  };
645
+ formatCopiedText: {
646
+ type: import("vue").PropType<(text: string) => string>;
647
+ default: (text: string) => string;
648
+ };
631
649
  }>>, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "onChange" | "onSave" | "onUploadImg" | "onHtmlChanged" | "onGetCatalog" | "onError" | "update:modelValue", {
632
650
  preview: boolean;
633
651
  htmlPreview: boolean;
@@ -655,6 +673,7 @@ declare const _default: {
655
673
  codeTheme: string;
656
674
  footers: import("./type").Footers[];
657
675
  scrollAuto: boolean;
676
+ formatCopiedText: (text: string) => string;
658
677
  }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
659
678
  readonly NormalToolbar: typeof NormalToolbar;
660
679
  readonly DropdownToolbar: typeof DropdownToolbar;
@@ -110,6 +110,7 @@ export declare type PreviewThemes = string;
110
110
  export interface HeadList {
111
111
  text: string;
112
112
  level: 1 | 2 | 3 | 4 | 5 | 6;
113
+ active?: boolean;
113
114
  }
114
115
  export declare type MarkedHeadingId = (text: string, level: number, index: number) => string;
115
116
  export interface MermaidTemplate {
@@ -17,7 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { onMounted, onBeforeUnmount, provide, computed, reactive, watch, ref, defineComponent, createVNode, cloneVNode, nextTick, inject, Fragment, toRef, createTextVNode, isVNode } from "vue";
20
+ import { onMounted, onBeforeUnmount, provide, computed, reactive, watch, ref, defineComponent, createVNode, cloneVNode, nextTick, inject, Fragment, toRef, isVNode } from "vue";
21
21
  const prefix = "md";
22
22
  const iconfontUrl = "https://at.alicdn.com/t/font_2605852_pqekijay2ij.js";
23
23
  const cdnBase = "https://cdnjs.cloudflare.com/ajax/libs";
@@ -452,6 +452,28 @@ const debounce = (fn, ms = 200) => {
452
452
  }, ms);
453
453
  };
454
454
  };
455
+ const throttle = (fn, ms = 200) => {
456
+ let start = 0;
457
+ let _params = null;
458
+ return (...params) => {
459
+ const handler = (timeStamp) => {
460
+ if (start === 0) {
461
+ start = timeStamp;
462
+ }
463
+ if (timeStamp - start >= ms) {
464
+ fn.apply(globalThis, _params);
465
+ _params = null;
466
+ start = 0;
467
+ } else {
468
+ window.requestAnimationFrame(handler);
469
+ }
470
+ };
471
+ if (_params === null) {
472
+ window.requestAnimationFrame(handler);
473
+ }
474
+ _params = params;
475
+ };
476
+ };
455
477
  const splitKatexValue = (str, key = "$") => {
456
478
  const arr = str.split(key);
457
479
  let regText = key;
@@ -476,6 +498,14 @@ const getSelectionText = (textarea) => {
476
498
  }
477
499
  return ((_a = window.getSelection()) == null ? void 0 : _a.toString()) || "";
478
500
  };
501
+ const getRelativeTop = (element, container) => {
502
+ const eleRect = element == null ? void 0 : element.getBoundingClientRect();
503
+ if (container === document.documentElement) {
504
+ return eleRect.top - container.clientTop;
505
+ }
506
+ const conRect = container == null ? void 0 : container.getBoundingClientRect();
507
+ return eleRect.top - conRect.top;
508
+ };
479
509
  const keyMove = (trigger, moveHandler) => {
480
510
  const triggerMouseDown = (mdown) => {
481
511
  const parent = trigger.parentElement || document.body;
@@ -1425,7 +1455,9 @@ var ClipModal = defineComponent({
1425
1455
  });
1426
1456
  });
1427
1457
  const reset = () => {
1458
+ cropper.clear();
1428
1459
  cropper.destroy();
1460
+ cropper = null;
1429
1461
  uploadRef.value.value = "";
1430
1462
  data.imgSelected = false;
1431
1463
  };
@@ -1486,9 +1518,11 @@ var ClipModal = defineComponent({
1486
1518
  "class": `${prefix}-btn`,
1487
1519
  "type": "button",
1488
1520
  "onClick": () => {
1489
- const cvs = cropper.getCroppedCanvas();
1490
- bus.emit(editorId, "uploadImage", [base642File(cvs.toDataURL("image/png"))], props.onOk);
1491
- reset();
1521
+ if (cropper) {
1522
+ const cvs = cropper.getCroppedCanvas();
1523
+ bus.emit(editorId, "uploadImage", [base642File(cvs.toDataURL("image/png"))], props.onOk);
1524
+ reset();
1525
+ }
1492
1526
  }
1493
1527
  }, [(_a3 = ult.value.linkModalTips) == null ? void 0 : _a3.buttonOK])]), createVNode("input", {
1494
1528
  "ref": uploadRef,
@@ -5626,7 +5660,8 @@ const useAutoScroll = (props, html, textAreaRef, previewRef, htmlRef) => {
5626
5660
  copyButton.innerText = copyBtnText;
5627
5661
  copyButton.addEventListener("click", () => {
5628
5662
  var _a2, _b;
5629
- const success = copyToClipboard(pre.querySelector("code").innerText);
5663
+ const codeText = pre.querySelector("code").innerText;
5664
+ const success = copyToClipboard(props.formatCopiedText(codeText));
5630
5665
  const succssTip = ((_a2 = ult.value.copyCode) == null ? void 0 : _a2.successTips) || "\u5DF2\u590D\u5236\uFF01";
5631
5666
  const failTip = ((_b = ult.value.copyCode) == null ? void 0 : _b.failTips) || "\u5DF2\u590D\u5236\uFF01";
5632
5667
  copyButton.innerText = success ? succssTip : failTip;
@@ -5857,6 +5892,10 @@ const contentProps = () => ({
5857
5892
  },
5858
5893
  scrollAuto: {
5859
5894
  type: Boolean
5895
+ },
5896
+ formatCopiedText: {
5897
+ type: Function,
5898
+ default: (text) => text
5860
5899
  }
5861
5900
  });
5862
5901
  var Content = defineComponent({
@@ -5932,12 +5971,12 @@ var MarkdownTotal = defineComponent({
5932
5971
  setup(props) {
5933
5972
  const ult = inject("usedLanguageText");
5934
5973
  return () => {
5935
- var _a;
5974
+ var _a, _b;
5936
5975
  return createVNode("div", {
5937
5976
  "class": `${prefix}-footer-item`
5938
5977
  }, [createVNode("label", {
5939
5978
  "class": `${prefix}-footer-label`
5940
- }, [(_a = ult.value.footer) == null ? void 0 : _a.markdownTotal, createTextVNode(":")]), createVNode("span", null, [props.modelValue.length])]);
5979
+ }, [`${(_a = ult.value.footer) == null ? void 0 : _a.markdownTotal}:`]), createVNode("span", null, [((_b = props.modelValue) == null ? void 0 : _b.length) || 0])]);
5941
5980
  };
5942
5981
  }
5943
5982
  });
@@ -6085,46 +6124,49 @@ const catalogLinkProps = () => ({
6085
6124
  });
6086
6125
  const CatalogLink = defineComponent({
6087
6126
  props: catalogLinkProps(),
6088
- setup({
6089
- tocItem,
6090
- markedHeadingId: markedHeadingId2,
6091
- scrollElement,
6092
- onClick
6093
- }) {
6094
- return () => createVNode("div", {
6095
- "class": `${prefix}-catalog-link`,
6096
- "onClick": (e) => {
6097
- onClick(e, tocItem);
6098
- e.stopPropagation();
6099
- const id = markedHeadingId2(tocItem.text, tocItem.level, tocItem.index);
6100
- const targetHeadEle = document.getElementById(id);
6101
- const scrollContainer = scrollElement instanceof Element ? scrollElement : document.querySelector(scrollElement);
6102
- if (targetHeadEle && scrollContainer) {
6103
- let par = targetHeadEle.offsetParent;
6104
- let offsetTop = targetHeadEle.offsetTop;
6105
- if (scrollContainer.contains(par)) {
6106
- while (par && scrollContainer != par) {
6107
- offsetTop += par == null ? void 0 : par.offsetTop;
6108
- par = par == null ? void 0 : par.offsetParent;
6127
+ setup(props) {
6128
+ return () => {
6129
+ const {
6130
+ tocItem,
6131
+ markedHeadingId: markedHeadingId2,
6132
+ scrollElement,
6133
+ onClick
6134
+ } = props;
6135
+ return createVNode("div", {
6136
+ "class": [`${prefix}-catalog-link`, tocItem.active && `${prefix}-catalog-active`],
6137
+ "onClick": (e) => {
6138
+ onClick(e, tocItem);
6139
+ e.stopPropagation();
6140
+ const id = markedHeadingId2(tocItem.text, tocItem.level, tocItem.index);
6141
+ const targetHeadEle = document.getElementById(id);
6142
+ const scrollContainer = scrollElement instanceof Element ? scrollElement : document.querySelector(scrollElement);
6143
+ if (targetHeadEle && scrollContainer) {
6144
+ let par = targetHeadEle.offsetParent;
6145
+ let offsetTop = targetHeadEle.offsetTop;
6146
+ if (scrollContainer.contains(par)) {
6147
+ while (par && scrollContainer != par) {
6148
+ offsetTop += par == null ? void 0 : par.offsetTop;
6149
+ par = par == null ? void 0 : par.offsetParent;
6150
+ }
6109
6151
  }
6152
+ scrollContainer == null ? void 0 : scrollContainer.scrollTo({
6153
+ top: offsetTop,
6154
+ behavior: "smooth"
6155
+ });
6110
6156
  }
6111
- scrollContainer == null ? void 0 : scrollContainer.scrollTo({
6112
- top: offsetTop,
6113
- behavior: "smooth"
6114
- });
6115
6157
  }
6116
- }
6117
- }, [createVNode("span", {
6118
- "title": tocItem.text
6119
- }, [tocItem.text]), createVNode("div", {
6120
- "class": `${prefix}-catalog-wrapper`
6121
- }, [tocItem.children && tocItem.children.map((item) => createVNode(CatalogLink, {
6122
- "markedHeadingId": markedHeadingId2,
6123
- "key": item.text,
6124
- "tocItem": item,
6125
- "scrollElement": scrollElement,
6126
- "onClick": onClick
6127
- }, null))])]);
6158
+ }, [createVNode("span", {
6159
+ "title": tocItem.text
6160
+ }, [tocItem.text]), createVNode("div", {
6161
+ "class": `${prefix}-catalog-wrapper`
6162
+ }, [tocItem.children && tocItem.children.map((item) => createVNode(CatalogLink, {
6163
+ "markedHeadingId": markedHeadingId2,
6164
+ "key": `${tocItem.text}-link-${item.level}-${item.text}`,
6165
+ "tocItem": item,
6166
+ "scrollElement": scrollElement,
6167
+ "onClick": onClick
6168
+ }, null))])]);
6169
+ };
6128
6170
  }
6129
6171
  });
6130
6172
  var style = "";
@@ -6146,6 +6188,10 @@ const mdCatalogProps = () => ({
6146
6188
  theme: {
6147
6189
  type: String,
6148
6190
  default: "light"
6191
+ },
6192
+ offsetTop: {
6193
+ type: Number,
6194
+ default: 20
6149
6195
  }
6150
6196
  });
6151
6197
  const MdCatalog = defineComponent({
@@ -6163,12 +6209,14 @@ const MdCatalog = defineComponent({
6163
6209
  const tocItems = [];
6164
6210
  state.list.forEach(({
6165
6211
  text,
6166
- level
6212
+ level,
6213
+ active
6167
6214
  }, index2) => {
6168
6215
  const item = {
6169
6216
  level,
6170
6217
  text,
6171
- index: index2 + 1
6218
+ index: index2 + 1,
6219
+ active: !!active
6172
6220
  };
6173
6221
  if (tocItems.length === 0) {
6174
6222
  tocItems.push(item);
@@ -6200,18 +6248,62 @@ const MdCatalog = defineComponent({
6200
6248
  bus.on(editorId, {
6201
6249
  name: "catalogChanged",
6202
6250
  callback: (_list) => {
6203
- state.list = _list;
6251
+ state.list = _list.map((item, index2) => {
6252
+ if (index2 === 0) {
6253
+ return __spreadProps(__spreadValues({}, item), {
6254
+ active: true
6255
+ });
6256
+ }
6257
+ return __spreadValues({}, item);
6258
+ });
6204
6259
  }
6205
6260
  });
6206
6261
  bus.emit(editorId, "pushCatalog");
6207
6262
  });
6263
+ onMounted(() => {
6264
+ var _a;
6265
+ const scrollElement = state.scrollElement instanceof HTMLElement ? state.scrollElement : document.querySelector(state.scrollElement);
6266
+ (_a = scrollElement === document.documentElement ? window : scrollElement) == null ? void 0 : _a.addEventListener("scroll", throttle(() => {
6267
+ if (state.list.length === 0) {
6268
+ return false;
6269
+ }
6270
+ const {
6271
+ activeHead
6272
+ } = state.list.reduce((activeData, link, index2) => {
6273
+ const linkEle = document.getElementById(props.markedHeadingId(link.text, link.level, index2 + 1));
6274
+ if (linkEle instanceof HTMLElement) {
6275
+ const relativeTop = getRelativeTop(linkEle, scrollElement);
6276
+ if (relativeTop < props.offsetTop && relativeTop > activeData.minTop) {
6277
+ return {
6278
+ activeHead: link,
6279
+ minTop: relativeTop
6280
+ };
6281
+ }
6282
+ }
6283
+ return activeData;
6284
+ }, {
6285
+ activeHead: state.list[0],
6286
+ minTop: Number.MIN_SAFE_INTEGER
6287
+ });
6288
+ state.list = state.list.map((item) => {
6289
+ if (item === activeHead) {
6290
+ return __spreadProps(__spreadValues({}, item), {
6291
+ active: true
6292
+ });
6293
+ }
6294
+ return __spreadProps(__spreadValues({}, item), {
6295
+ active: false
6296
+ });
6297
+ });
6298
+ }));
6299
+ });
6208
6300
  return () => createVNode("div", {
6209
6301
  "class": `${prefix}-catalog${props.theme === "dark" ? "-dark" : ""} ${props.class}`
6210
6302
  }, [catalogs.value.map((item) => {
6211
6303
  return createVNode(CatalogLink, {
6212
6304
  "markedHeadingId": props.markedHeadingId,
6213
6305
  "tocItem": item,
6214
- "key": item.text,
6306
+ "key": `link-${item.level}-${item.text}`,
6215
6307
  "scrollElement": state.scrollElement,
6216
6308
  "onClick": (e, t) => {
6217
6309
  ctx.emit("onClick", e, t);
@@ -6353,6 +6445,10 @@ const editorProps = () => ({
6353
6445
  },
6354
6446
  noIconfont: {
6355
6447
  type: Boolean
6448
+ },
6449
+ formatCopiedText: {
6450
+ type: Function,
6451
+ default: (text) => text
6356
6452
  }
6357
6453
  });
6358
6454
  const markedHeadingId = (text) => text;
@@ -6428,14 +6524,15 @@ const Editor = defineComponent({
6428
6524
  "sanitize": props.sanitize,
6429
6525
  "placeholder": props.placeholder,
6430
6526
  "noKatex": props.noKatex,
6431
- "scrollAuto": state.scrollAuto
6527
+ "scrollAuto": state.scrollAuto,
6528
+ "formatCopiedText": props.formatCopiedText
6432
6529
  }, null), !props.previewOnly && ((_a = props.footers) == null ? void 0 : _a.length) > 0 && createVNode(Footer, {
6433
6530
  "modelValue": props.modelValue,
6434
6531
  "footers": props.footers,
6435
6532
  "defFooters": defFooters,
6436
6533
  "scrollAuto": state.scrollAuto,
6437
6534
  "onScrollAutoChange": (v) => state.scrollAuto = v
6438
- }, null), catalogShow.value && createVNode(MdCatalog, {
6535
+ }, null), catalogShow.value && !props.previewOnly && createVNode(MdCatalog, {
6439
6536
  "theme": props.theme,
6440
6537
  "style": {
6441
6538
  display: catalogVisible.value ? "block" : "none"