md-editor-v3 5.4.0-3 → 5.4.0-5

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.
@@ -2895,7 +2895,8 @@ const Content = /* @__PURE__ */ vue.defineComponent({
2895
2895
  "sanitizeMermaid": props2.sanitizeMermaid,
2896
2896
  "codeFoldable": props2.codeFoldable,
2897
2897
  "autoFoldThreshold": props2.autoFoldThreshold,
2898
- "onRemount": props2.onRemount
2898
+ "onRemount": props2.onRemount,
2899
+ "htmlUpdateOnDemand": props2.htmlUpdateOnDemand
2899
2900
  }, null)]), props2.catalogVisible && vue.createVNode(MdCatalog.MdCatalog, {
2900
2901
  "theme": props2.theme,
2901
2902
  "class": `${config.prefix}-catalog-editor ${config.prefix}-catalog-${props2.catalogLayout}`,
@@ -3239,7 +3240,8 @@ const Editor = /* @__PURE__ */ vue.defineComponent({
3239
3240
  (_a = props2.onRemount) == null ? void 0 : _a.call(props2);
3240
3241
  ctx.emit("onRemount");
3241
3242
  },
3242
- "catalogLayout": props2.catalogLayout
3243
+ "catalogLayout": props2.catalogLayout,
3244
+ "htmlUpdateOnDemand": props2.htmlUpdateOnDemand
3243
3245
  }, null), props2.footers.length > 0 && vue.createVNode(Footer, {
3244
3246
  "modelValue": props2.modelValue,
3245
3247
  "footers": props2.footers,
@@ -222,8 +222,8 @@ const zoomMermaid = /* @__PURE__ */ (() => {
222
222
  });
223
223
  return () => {
224
224
  removeEventsMap.forEach(({ removeEvent, removeClick }) => {
225
- if (removeEvent) removeEvent();
226
- if (removeClick) removeClick();
225
+ removeEvent == null ? void 0 : removeEvent();
226
+ removeClick == null ? void 0 : removeClick();
227
227
  });
228
228
  removeEventsMap.clear();
229
229
  };
@@ -145,6 +145,7 @@ const mermaidCache = new lruCache.LRUCache({
145
145
  ttl: 6e5
146
146
  });
147
147
  const useMermaid = (props) => {
148
+ const editorId = vue.inject("editorId");
148
149
  const theme = vue.inject("theme");
149
150
  const rootRef = vue.inject("rootRef");
150
151
  const { editorExtensions, editorExtensionsAttrs, mermaidConfig } = config.configOption;
@@ -244,7 +245,12 @@ const useMermaid = (props) => {
244
245
  p.dataset.line = item.dataset.line;
245
246
  }
246
247
  item.replaceWith(p);
247
- } catch {
248
+ } catch (error) {
249
+ eventName.bus.emit(editorId, eventName.ERROR_CATCHER, {
250
+ name: "mermaid",
251
+ message: error.message,
252
+ error
253
+ });
248
254
  }
249
255
  if (--count === 0) {
250
256
  svgContainingElement.remove();
@@ -1179,6 +1185,9 @@ const contentPreviewProps = {
1179
1185
  },
1180
1186
  onRemount: {
1181
1187
  type: Function
1188
+ },
1189
+ htmlUpdateOnDemand: {
1190
+ type: Boolean
1182
1191
  }
1183
1192
  };
1184
1193
  const contentProps = {
@@ -1261,6 +1270,68 @@ const contentProps = {
1261
1270
  type: String
1262
1271
  }
1263
1272
  };
1273
+ const splitHtml = (html) => {
1274
+ const parser = new DOMParser();
1275
+ const doc = parser.parseFromString(html, "text/html");
1276
+ return Array.from(doc.body.children);
1277
+ };
1278
+ const compareHtml = (newHtml, currentHtml) => {
1279
+ const newNodes = splitHtml(newHtml);
1280
+ const currentNodes = splitHtml(currentHtml);
1281
+ return newNodes.map((node, index2) => {
1282
+ var _a;
1283
+ return {
1284
+ index: index2,
1285
+ newNode: node.outerHTML,
1286
+ isUpdated: ((_a = currentNodes[index2]) == null ? void 0 : _a.outerHTML) !== node.outerHTML
1287
+ };
1288
+ }).filter((update) => update.isUpdated);
1289
+ };
1290
+ const UpdateOnDemand = /* @__PURE__ */ vue.defineComponent({
1291
+ name: "UpdateOnDemand",
1292
+ props: {
1293
+ html: {
1294
+ type: String,
1295
+ required: true
1296
+ }
1297
+ },
1298
+ setup(props) {
1299
+ const editorId = vue.inject("editorId");
1300
+ const previewTheme = vue.inject("previewTheme");
1301
+ const showCodeRowNumber = vue.inject("showCodeRowNumber");
1302
+ const htmlContainer = vue.ref(null);
1303
+ const updateHtmlContent = (updates) => {
1304
+ updates.forEach(({
1305
+ index: index2,
1306
+ newNode
1307
+ }) => {
1308
+ var _a, _b;
1309
+ const targetNode = (_a = htmlContainer.value) == null ? void 0 : _a.children[index2];
1310
+ if (targetNode) {
1311
+ targetNode.outerHTML = newNode;
1312
+ } else {
1313
+ (_b = htmlContainer.value) == null ? void 0 : _b.insertAdjacentHTML("beforeend", newNode);
1314
+ }
1315
+ });
1316
+ };
1317
+ vue.watch(() => props.html, (newHtml, oldHtml) => {
1318
+ const updates = compareHtml(newHtml, oldHtml || "");
1319
+ updateHtmlContent(updates);
1320
+ }, {
1321
+ immediate: true
1322
+ });
1323
+ vue.onMounted(() => {
1324
+ if (htmlContainer.value) {
1325
+ htmlContainer.value.innerHTML = props.html;
1326
+ }
1327
+ });
1328
+ return () => vue.createVNode("div", {
1329
+ "id": `${editorId}-preview`,
1330
+ "class": [`${config.prefix}-preview`, `${previewTheme == null ? void 0 : previewTheme.value}-theme`, showCodeRowNumber && `${config.prefix}-scrn`],
1331
+ "ref": htmlContainer
1332
+ }, null);
1333
+ }
1334
+ });
1264
1335
  const ContentPreview = /* @__PURE__ */ vue.defineComponent({
1265
1336
  name: "ContentPreview",
1266
1337
  props: contentPreviewProps,
@@ -1281,7 +1352,10 @@ const ContentPreview = /* @__PURE__ */ vue.defineComponent({
1281
1352
  "id": `${editorId}-preview-wrapper`,
1282
1353
  "class": `${config.prefix}-preview-wrapper`,
1283
1354
  "key": "content-preview-wrapper"
1284
- }, [vue.createVNode("div", {
1355
+ }, [props.htmlUpdateOnDemand ? vue.createVNode(UpdateOnDemand, {
1356
+ "key": key.value,
1357
+ "html": html.value
1358
+ }, null) : vue.createVNode("div", {
1285
1359
  "key": key.value,
1286
1360
  "id": `${editorId}-preview`,
1287
1361
  "class": [`${config.prefix}-preview`, `${previewTheme == null ? void 0 : previewTheme.value}-theme`, showCodeRowNumber && `${config.prefix}-scrn`],
@@ -1457,11 +1531,9 @@ const useErrorCatcher = (props, context, options) => {
1457
1531
  eventName.bus.on(editorId, {
1458
1532
  name: eventName.ERROR_CATCHER,
1459
1533
  callback: (err) => {
1460
- if (props.onError instanceof Function) {
1461
- props.onError(err);
1462
- } else {
1463
- context.emit("onError", err);
1464
- }
1534
+ var _a;
1535
+ (_a = props.onError) == null ? void 0 : _a.call(props, err);
1536
+ context.emit("onError", err);
1465
1537
  }
1466
1538
  });
1467
1539
  });
@@ -1934,6 +2006,13 @@ const mdPreviewProps = {
1934
2006
  onRemount: {
1935
2007
  type: Function,
1936
2008
  default: void 0
2009
+ },
2010
+ /**
2011
+ * 是否同单层对比,选择性的更新变化的html,流式内容推荐(AI吐字之类的)
2012
+ */
2013
+ htmlUpdateOnDemand: {
2014
+ type: Boolean,
2015
+ default: false
1937
2016
  }
1938
2017
  };
1939
2018
  const editorProps = {
@@ -2312,7 +2391,8 @@ const MdPreview = /* @__PURE__ */ vue.defineComponent({
2312
2391
  var _a;
2313
2392
  (_a = props.onRemount) == null ? void 0 : _a.call(props);
2314
2393
  ctx.emit("onRemount");
2315
- }
2394
+ },
2395
+ "htmlUpdateOnDemand": props.htmlUpdateOnDemand
2316
2396
  }, null)]);
2317
2397
  };
2318
2398
  }
@@ -2894,7 +2894,8 @@ const Content = /* @__PURE__ */ defineComponent({
2894
2894
  "sanitizeMermaid": props2.sanitizeMermaid,
2895
2895
  "codeFoldable": props2.codeFoldable,
2896
2896
  "autoFoldThreshold": props2.autoFoldThreshold,
2897
- "onRemount": props2.onRemount
2897
+ "onRemount": props2.onRemount,
2898
+ "htmlUpdateOnDemand": props2.htmlUpdateOnDemand
2898
2899
  }, null)]), props2.catalogVisible && createVNode(MdCatalog, {
2899
2900
  "theme": props2.theme,
2900
2901
  "class": `${prefix}-catalog-editor ${prefix}-catalog-${props2.catalogLayout}`,
@@ -3238,7 +3239,8 @@ const Editor = /* @__PURE__ */ defineComponent({
3238
3239
  (_a = props2.onRemount) == null ? void 0 : _a.call(props2);
3239
3240
  ctx.emit("onRemount");
3240
3241
  },
3241
- "catalogLayout": props2.catalogLayout
3242
+ "catalogLayout": props2.catalogLayout,
3243
+ "htmlUpdateOnDemand": props2.htmlUpdateOnDemand
3242
3244
  }, null), props2.footers.length > 0 && createVNode(Footer, {
3243
3245
  "modelValue": props2.modelValue,
3244
3246
  "footers": props2.footers,
@@ -221,8 +221,8 @@ const zoomMermaid = /* @__PURE__ */ (() => {
221
221
  });
222
222
  return () => {
223
223
  removeEventsMap.forEach(({ removeEvent, removeClick }) => {
224
- if (removeEvent) removeEvent();
225
- if (removeClick) removeClick();
224
+ removeEvent == null ? void 0 : removeEvent();
225
+ removeClick == null ? void 0 : removeClick();
226
226
  });
227
227
  removeEventsMap.clear();
228
228
  };
@@ -1,6 +1,6 @@
1
1
  import { inject, onMounted, watch, toRef, nextTick, shallowRef, ref, computed, onBeforeUnmount, defineComponent, createVNode, Fragment, reactive, provide, useId } from "vue";
2
2
  import { p as prefix, d as configOption, f as codeCss, s as staticTextDefault, a as allToolbar, b as allFooter } from "./config.mjs";
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";
3
+ import { b as bus, E as ERROR_CATCHER, g as CATALOG_CHANGED, P as PUSH_CATALOG, h as RERENDER, B as BUILD_FINISHED, T as TASK_STATE_CHANGED, c as ON_SAVE, 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 { debounce, randomId, deepMerge, deepClone } from "@vavt/util";
5
5
  import { a as appendHandler, u as updateHandler, S as StrIcon, z as zoomMermaid } from "./dom.mjs";
6
6
  import mediumZoom from "medium-zoom";
@@ -144,6 +144,7 @@ const mermaidCache = new LRUCache({
144
144
  ttl: 6e5
145
145
  });
146
146
  const useMermaid = (props) => {
147
+ const editorId = inject("editorId");
147
148
  const theme = inject("theme");
148
149
  const rootRef = inject("rootRef");
149
150
  const { editorExtensions, editorExtensionsAttrs, mermaidConfig } = configOption;
@@ -243,7 +244,12 @@ const useMermaid = (props) => {
243
244
  p.dataset.line = item.dataset.line;
244
245
  }
245
246
  item.replaceWith(p);
246
- } catch {
247
+ } catch (error) {
248
+ bus.emit(editorId, ERROR_CATCHER, {
249
+ name: "mermaid",
250
+ message: error.message,
251
+ error
252
+ });
247
253
  }
248
254
  if (--count === 0) {
249
255
  svgContainingElement.remove();
@@ -1178,6 +1184,9 @@ const contentPreviewProps = {
1178
1184
  },
1179
1185
  onRemount: {
1180
1186
  type: Function
1187
+ },
1188
+ htmlUpdateOnDemand: {
1189
+ type: Boolean
1181
1190
  }
1182
1191
  };
1183
1192
  const contentProps = {
@@ -1260,6 +1269,68 @@ const contentProps = {
1260
1269
  type: String
1261
1270
  }
1262
1271
  };
1272
+ const splitHtml = (html) => {
1273
+ const parser = new DOMParser();
1274
+ const doc = parser.parseFromString(html, "text/html");
1275
+ return Array.from(doc.body.children);
1276
+ };
1277
+ const compareHtml = (newHtml, currentHtml) => {
1278
+ const newNodes = splitHtml(newHtml);
1279
+ const currentNodes = splitHtml(currentHtml);
1280
+ return newNodes.map((node, index) => {
1281
+ var _a;
1282
+ return {
1283
+ index,
1284
+ newNode: node.outerHTML,
1285
+ isUpdated: ((_a = currentNodes[index]) == null ? void 0 : _a.outerHTML) !== node.outerHTML
1286
+ };
1287
+ }).filter((update) => update.isUpdated);
1288
+ };
1289
+ const UpdateOnDemand = /* @__PURE__ */ defineComponent({
1290
+ name: "UpdateOnDemand",
1291
+ props: {
1292
+ html: {
1293
+ type: String,
1294
+ required: true
1295
+ }
1296
+ },
1297
+ setup(props) {
1298
+ const editorId = inject("editorId");
1299
+ const previewTheme = inject("previewTheme");
1300
+ const showCodeRowNumber = inject("showCodeRowNumber");
1301
+ const htmlContainer = ref(null);
1302
+ const updateHtmlContent = (updates) => {
1303
+ updates.forEach(({
1304
+ index,
1305
+ newNode
1306
+ }) => {
1307
+ var _a, _b;
1308
+ const targetNode = (_a = htmlContainer.value) == null ? void 0 : _a.children[index];
1309
+ if (targetNode) {
1310
+ targetNode.outerHTML = newNode;
1311
+ } else {
1312
+ (_b = htmlContainer.value) == null ? void 0 : _b.insertAdjacentHTML("beforeend", newNode);
1313
+ }
1314
+ });
1315
+ };
1316
+ watch(() => props.html, (newHtml, oldHtml) => {
1317
+ const updates = compareHtml(newHtml, oldHtml || "");
1318
+ updateHtmlContent(updates);
1319
+ }, {
1320
+ immediate: true
1321
+ });
1322
+ onMounted(() => {
1323
+ if (htmlContainer.value) {
1324
+ htmlContainer.value.innerHTML = props.html;
1325
+ }
1326
+ });
1327
+ return () => createVNode("div", {
1328
+ "id": `${editorId}-preview`,
1329
+ "class": [`${prefix}-preview`, `${previewTheme == null ? void 0 : previewTheme.value}-theme`, showCodeRowNumber && `${prefix}-scrn`],
1330
+ "ref": htmlContainer
1331
+ }, null);
1332
+ }
1333
+ });
1263
1334
  const ContentPreview = /* @__PURE__ */ defineComponent({
1264
1335
  name: "ContentPreview",
1265
1336
  props: contentPreviewProps,
@@ -1280,7 +1351,10 @@ const ContentPreview = /* @__PURE__ */ defineComponent({
1280
1351
  "id": `${editorId}-preview-wrapper`,
1281
1352
  "class": `${prefix}-preview-wrapper`,
1282
1353
  "key": "content-preview-wrapper"
1283
- }, [createVNode("div", {
1354
+ }, [props.htmlUpdateOnDemand ? createVNode(UpdateOnDemand, {
1355
+ "key": key.value,
1356
+ "html": html.value
1357
+ }, null) : createVNode("div", {
1284
1358
  "key": key.value,
1285
1359
  "id": `${editorId}-preview`,
1286
1360
  "class": [`${prefix}-preview`, `${previewTheme == null ? void 0 : previewTheme.value}-theme`, showCodeRowNumber && `${prefix}-scrn`],
@@ -1456,11 +1530,9 @@ const useErrorCatcher = (props, context, options) => {
1456
1530
  bus.on(editorId, {
1457
1531
  name: ERROR_CATCHER,
1458
1532
  callback: (err) => {
1459
- if (props.onError instanceof Function) {
1460
- props.onError(err);
1461
- } else {
1462
- context.emit("onError", err);
1463
- }
1533
+ var _a;
1534
+ (_a = props.onError) == null ? void 0 : _a.call(props, err);
1535
+ context.emit("onError", err);
1464
1536
  }
1465
1537
  });
1466
1538
  });
@@ -1933,6 +2005,13 @@ const mdPreviewProps = {
1933
2005
  onRemount: {
1934
2006
  type: Function,
1935
2007
  default: void 0
2008
+ },
2009
+ /**
2010
+ * 是否同单层对比,选择性的更新变化的html,流式内容推荐(AI吐字之类的)
2011
+ */
2012
+ htmlUpdateOnDemand: {
2013
+ type: Boolean,
2014
+ default: false
1936
2015
  }
1937
2016
  };
1938
2017
  const editorProps = {
@@ -2311,7 +2390,8 @@ const MdPreview = /* @__PURE__ */ defineComponent({
2311
2390
  var _a;
2312
2391
  (_a = props.onRemount) == null ? void 0 : _a.call(props);
2313
2392
  ctx.emit("onRemount");
2314
- }
2393
+ },
2394
+ "htmlUpdateOnDemand": props.htmlUpdateOnDemand
2315
2395
  }, null)]);
2316
2396
  };
2317
2397
  }
@@ -245,6 +245,7 @@ declare const Editor: import("vue").DefineComponent<{
245
245
  readonly sanitizeMermaid: (h: string) => Promise<string>;
246
246
  readonly codeFoldable: boolean;
247
247
  readonly autoFoldThreshold: number;
248
+ readonly htmlUpdateOnDemand: boolean;
248
249
  readonly onChange: import("./type").ChangeEvent | undefined;
249
250
  readonly onSave: import("./type").SaveEvent | undefined;
250
251
  readonly onUploadImg: import("./type").UploadImgEvent | undefined;
@@ -514,6 +515,7 @@ declare const Editor: import("vue").DefineComponent<{
514
515
  readonly sanitizeMermaid: (h: string) => Promise<string>;
515
516
  readonly codeFoldable: boolean;
516
517
  readonly autoFoldThreshold: number;
518
+ readonly htmlUpdateOnDemand: boolean;
517
519
  readonly onChange: import("./type").ChangeEvent | undefined;
518
520
  readonly onSave: import("./type").SaveEvent | undefined;
519
521
  readonly onUploadImg: import("./type").UploadImgEvent | undefined;
@@ -614,5 +616,6 @@ declare const Editor: import("vue").DefineComponent<{
614
616
  sanitizeMermaid: (h: string) => Promise<string>;
615
617
  codeFoldable: boolean;
616
618
  autoFoldThreshold: number;
619
+ htmlUpdateOnDemand: boolean;
617
620
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
618
621
  export default Editor;
@@ -20,6 +20,7 @@ declare const ContentPreview: import("vue").DefineComponent<{
20
20
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
21
21
  readonly codeFoldable: boolean | undefined;
22
22
  readonly autoFoldThreshold: number | undefined;
23
+ readonly htmlUpdateOnDemand: boolean | undefined;
23
24
  }, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
24
25
  readonly previewOnly: boolean;
25
26
  readonly onChange: (v: string) => void;
@@ -38,6 +39,7 @@ declare const ContentPreview: import("vue").DefineComponent<{
38
39
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
39
40
  readonly codeFoldable: boolean | undefined;
40
41
  readonly autoFoldThreshold: number | undefined;
42
+ readonly htmlUpdateOnDemand: boolean | undefined;
41
43
  }> & Readonly<{}>, {
42
44
  previewOnly: boolean;
43
45
  onChange: (v: string) => void;
@@ -0,0 +1,12 @@
1
+ declare const UpdateOnDemand: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ html: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
+ html: {
8
+ type: StringConstructor;
9
+ required: true;
10
+ };
11
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
12
+ export default UpdateOnDemand;
@@ -32,6 +32,7 @@ declare const _default: import("vue").DefineComponent<{
32
32
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
33
33
  readonly codeFoldable: boolean | undefined;
34
34
  readonly autoFoldThreshold: number | undefined;
35
+ readonly htmlUpdateOnDemand: boolean | undefined;
35
36
  readonly autofocus: boolean | undefined;
36
37
  readonly catalogVisible: boolean | undefined;
37
38
  readonly readonly: boolean | undefined;
@@ -70,6 +71,7 @@ declare const _default: import("vue").DefineComponent<{
70
71
  readonly sanitizeMermaid: ((h: string) => Promise<string>) | undefined;
71
72
  readonly codeFoldable: boolean | undefined;
72
73
  readonly autoFoldThreshold: number | undefined;
74
+ readonly htmlUpdateOnDemand: boolean | undefined;
73
75
  readonly autofocus: boolean | undefined;
74
76
  readonly catalogVisible: boolean | undefined;
75
77
  readonly readonly: boolean | undefined;
@@ -68,6 +68,9 @@ export declare const contentPreviewProps: {
68
68
  onRemount: {
69
69
  type: PropType<() => void>;
70
70
  };
71
+ htmlUpdateOnDemand: {
72
+ type: PropType<boolean>;
73
+ };
71
74
  };
72
75
  export declare const contentProps: {
73
76
  updateModelValue: {
@@ -208,5 +211,8 @@ export declare const contentProps: {
208
211
  onRemount: {
209
212
  type: PropType<() => void>;
210
213
  };
214
+ htmlUpdateOnDemand: {
215
+ type: PropType<boolean>;
216
+ };
211
217
  };
212
218
  export type ContentProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof contentProps>>>>;
@@ -229,6 +229,13 @@ export declare const mdPreviewProps: {
229
229
  type: PropType<() => void>;
230
230
  default: undefined;
231
231
  };
232
+ /**
233
+ * 是否同单层对比,选择性的更新变化的html,流式内容推荐(AI吐字之类的)
234
+ */
235
+ htmlUpdateOnDemand: {
236
+ type: PropType<boolean>;
237
+ default: boolean;
238
+ };
232
239
  };
233
240
  export declare const editorProps: {
234
241
  /**
@@ -740,6 +747,13 @@ export declare const editorProps: {
740
747
  type: PropType<() => void>;
741
748
  default: undefined;
742
749
  };
750
+ /**
751
+ * 是否同单层对比,选择性的更新变化的html,流式内容推荐(AI吐字之类的)
752
+ */
753
+ htmlUpdateOnDemand: {
754
+ type: PropType<boolean>;
755
+ default: boolean;
756
+ };
743
757
  };
744
758
  export declare const mdPreviewEmits: EditorEmits;
745
759
  export declare const editorEmits: EditorEmits;
@@ -312,9 +312,10 @@ export type Config = (options: Partial<ConfigOption>) => void;
312
312
  * 编辑器操作潜在的错误
313
313
  */
314
314
  export interface InnerError {
315
- name: 'Cropper' | 'fullscreen' | 'prettier' | 'overlength';
315
+ name: 'Cropper' | 'fullscreen' | 'prettier' | 'overlength' | 'mermaid';
316
316
  message: string;
317
- data: any;
317
+ data?: any;
318
+ error?: Error;
318
319
  }
319
320
  export interface CodeCss {
320
321
  [key: string]: {
@@ -225,6 +225,7 @@ declare const MdPreview: import("vue").DefineComponent<{
225
225
  readonly sanitizeMermaid: (h: string) => Promise<string>;
226
226
  readonly codeFoldable: boolean;
227
227
  readonly autoFoldThreshold: number;
228
+ readonly htmlUpdateOnDemand: boolean;
228
229
  readonly onChange: import("../MdEditor/type").ChangeEvent | undefined;
229
230
  readonly onHtmlChanged: import("../MdEditor/type").HtmlChangedEvent | undefined;
230
231
  readonly onGetCatalog: import("../MdEditor/type").GetCatalogEvent | undefined;
@@ -458,6 +459,7 @@ declare const MdPreview: import("vue").DefineComponent<{
458
459
  readonly sanitizeMermaid: (h: string) => Promise<string>;
459
460
  readonly codeFoldable: boolean;
460
461
  readonly autoFoldThreshold: number;
462
+ readonly htmlUpdateOnDemand: boolean;
461
463
  readonly onChange: import("../MdEditor/type").ChangeEvent | undefined;
462
464
  readonly onHtmlChanged: import("../MdEditor/type").HtmlChangedEvent | undefined;
463
465
  readonly onGetCatalog: import("../MdEditor/type").GetCatalogEvent | undefined;
@@ -506,5 +508,6 @@ declare const MdPreview: import("vue").DefineComponent<{
506
508
  sanitizeMermaid: (h: string) => Promise<string>;
507
509
  codeFoldable: boolean;
508
510
  autoFoldThreshold: number;
511
+ htmlUpdateOnDemand: boolean;
509
512
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
510
513
  export default MdPreview;