@jvs-milkdown/crepe 1.2.10 → 1.2.12

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.
Files changed (45) hide show
  1. package/lib/cjs/feature/block-edit/index.js +1 -0
  2. package/lib/cjs/feature/block-edit/index.js.map +1 -1
  3. package/lib/cjs/feature/toolbar/index.js +5 -1
  4. package/lib/cjs/feature/toolbar/index.js.map +1 -1
  5. package/lib/cjs/index.js +91 -85
  6. package/lib/cjs/index.js.map +1 -1
  7. package/lib/esm/feature/block-edit/index.js +1 -0
  8. package/lib/esm/feature/block-edit/index.js.map +1 -1
  9. package/lib/esm/feature/toolbar/index.js +5 -1
  10. package/lib/esm/feature/toolbar/index.js.map +1 -1
  11. package/lib/esm/index.js +152 -146
  12. package/lib/esm/index.js.map +1 -1
  13. package/lib/theme/common/block-edit.css +2 -1
  14. package/lib/tsconfig.tsbuildinfo +1 -1
  15. package/lib/types/feature/attachment/view/components/attachment-block.d.ts +1 -1
  16. package/lib/types/feature/attachment/view/components/attachment-block.d.ts.map +1 -1
  17. package/lib/types/feature/block-edit/handle/component.d.ts +17 -1
  18. package/lib/types/feature/block-edit/handle/component.d.ts.map +1 -1
  19. package/lib/types/feature/block-edit/menu/component.d.ts +13 -1
  20. package/lib/types/feature/block-edit/menu/component.d.ts.map +1 -1
  21. package/lib/types/feature/fixed-toolbar/component.d.ts +13 -1
  22. package/lib/types/feature/fixed-toolbar/component.d.ts.map +1 -1
  23. package/lib/types/feature/fixed-toolbar/document-header.d.ts +21 -1
  24. package/lib/types/feature/fixed-toolbar/document-header.d.ts.map +1 -1
  25. package/lib/types/feature/fixed-toolbar/menu-bar.d.ts +21 -1
  26. package/lib/types/feature/fixed-toolbar/menu-bar.d.ts.map +1 -1
  27. package/lib/types/feature/fixed-toolbar/outline-panel.d.ts +12 -1
  28. package/lib/types/feature/fixed-toolbar/outline-panel.d.ts.map +1 -1
  29. package/lib/types/feature/fixed-toolbar/shortcut-help-modal.d.ts +8 -1
  30. package/lib/types/feature/fixed-toolbar/shortcut-help-modal.d.ts.map +1 -1
  31. package/lib/types/feature/fixed-toolbar/view-menu-state.d.ts +20 -2
  32. package/lib/types/feature/fixed-toolbar/view-menu-state.d.ts.map +1 -1
  33. package/lib/types/feature/latex/inline-tooltip/component.d.ts +12 -1
  34. package/lib/types/feature/latex/inline-tooltip/component.d.ts.map +1 -1
  35. package/lib/types/feature/toolbar/component.d.ts +14 -1
  36. package/lib/types/feature/toolbar/component.d.ts.map +1 -1
  37. package/package.json +12 -5
  38. package/src/feature/attachment/view/components/attachment-block.tsx +1 -1
  39. package/src/feature/block-edit/menu/index.ts +1 -0
  40. package/src/feature/fixed-toolbar/component.tsx +1 -1
  41. package/src/feature/fixed-toolbar/document-header.tsx +5 -0
  42. package/src/feature/fixed-toolbar/menu-bar.tsx +1 -1
  43. package/src/feature/fixed-toolbar/outline-panel.tsx +1 -1
  44. package/src/feature/toolbar/component.tsx +5 -1
  45. package/src/theme/common/block-edit.css +2 -1
package/lib/cjs/index.js CHANGED
@@ -1198,7 +1198,7 @@ const MilkdownAttachmentBlock = vue.defineComponent({
1198
1198
  return () => {
1199
1199
  var _a;
1200
1200
  if (!((_a = src.value) == null ? void 0 : _a.length)) {
1201
- return /* @__PURE__ */ h(
1201
+ return /* @__PURE__ */ vue.h(
1202
1202
  "div",
1203
1203
  {
1204
1204
  class: [
@@ -1206,7 +1206,7 @@ const MilkdownAttachmentBlock = vue.defineComponent({
1206
1206
  props.selected.value ? "selected" : ""
1207
1207
  ]
1208
1208
  },
1209
- /* @__PURE__ */ h("div", { class: "milkdown-attachment-uploader", onClick: triggerUpload }, /* @__PURE__ */ h(component.Icon, { icon: fileLinkIcon }), /* @__PURE__ */ h("span", { class: "milkdown-attachment-upload-text" }, isUploading.value ? "Uploading..." : props.config.uploadButton), /* @__PURE__ */ h(
1209
+ /* @__PURE__ */ vue.h("div", { class: "milkdown-attachment-uploader", onClick: triggerUpload }, /* @__PURE__ */ vue.h(component.Icon, { icon: fileLinkIcon }), /* @__PURE__ */ vue.h("span", { class: "milkdown-attachment-upload-text" }, isUploading.value ? "Uploading..." : props.config.uploadButton), /* @__PURE__ */ vue.h(
1210
1210
  "input",
1211
1211
  {
1212
1212
  type: "file",
@@ -1220,7 +1220,7 @@ const MilkdownAttachmentBlock = vue.defineComponent({
1220
1220
  if (isVideo.value) {
1221
1221
  const savedWidth = videoWidth.value;
1222
1222
  const widthStyle = isResizing.value && currentWidth.value > 0 ? `${currentWidth.value}px` : savedWidth && savedWidth > 0 ? `${savedWidth}px` : "100%";
1223
- return /* @__PURE__ */ h(
1223
+ return /* @__PURE__ */ vue.h(
1224
1224
  "div",
1225
1225
  {
1226
1226
  ref: videoWrapperRef,
@@ -1234,7 +1234,7 @@ const MilkdownAttachmentBlock = vue.defineComponent({
1234
1234
  position: "relative"
1235
1235
  }
1236
1236
  },
1237
- /* @__PURE__ */ h(
1237
+ /* @__PURE__ */ vue.h(
1238
1238
  "video",
1239
1239
  {
1240
1240
  src: src.value,
@@ -1243,28 +1243,28 @@ const MilkdownAttachmentBlock = vue.defineComponent({
1243
1243
  onMousedown: (e) => e.stopPropagation()
1244
1244
  }
1245
1245
  ),
1246
- /* @__PURE__ */ h(
1246
+ /* @__PURE__ */ vue.h(
1247
1247
  "div",
1248
1248
  {
1249
1249
  class: "video-resize-handle top-left",
1250
1250
  onPointerdown: (e) => onResizePointerDown(e, "top-left")
1251
1251
  }
1252
1252
  ),
1253
- /* @__PURE__ */ h(
1253
+ /* @__PURE__ */ vue.h(
1254
1254
  "div",
1255
1255
  {
1256
1256
  class: "video-resize-handle top-right",
1257
1257
  onPointerdown: (e) => onResizePointerDown(e, "top-right")
1258
1258
  }
1259
1259
  ),
1260
- /* @__PURE__ */ h(
1260
+ /* @__PURE__ */ vue.h(
1261
1261
  "div",
1262
1262
  {
1263
1263
  class: "video-resize-handle bottom-left",
1264
1264
  onPointerdown: (e) => onResizePointerDown(e, "bottom-left")
1265
1265
  }
1266
1266
  ),
1267
- /* @__PURE__ */ h(
1267
+ /* @__PURE__ */ vue.h(
1268
1268
  "div",
1269
1269
  {
1270
1270
  class: "video-resize-handle bottom-right",
@@ -1273,7 +1273,7 @@ const MilkdownAttachmentBlock = vue.defineComponent({
1273
1273
  )
1274
1274
  );
1275
1275
  }
1276
- return /* @__PURE__ */ h(
1276
+ return /* @__PURE__ */ vue.h(
1277
1277
  "div",
1278
1278
  {
1279
1279
  class: [
@@ -1281,16 +1281,16 @@ const MilkdownAttachmentBlock = vue.defineComponent({
1281
1281
  props.selected.value ? "selected" : ""
1282
1282
  ]
1283
1283
  },
1284
- /* @__PURE__ */ h("div", { class: "milkdown-attachment-icon-wrapper" }, /* @__PURE__ */ h("div", { class: "milkdown-attachment-raw-icon-bg" }, /* @__PURE__ */ h(component.Icon, { icon: fileLinkIcon }))),
1285
- /* @__PURE__ */ h("div", { class: "milkdown-attachment-info" }, /* @__PURE__ */ h("div", { class: "milkdown-attachment-name" }, name.value), /* @__PURE__ */ h("div", { class: "milkdown-attachment-size" }, (size.value || 0) > 0 ? formatBytes(size.value) : "")),
1286
- /* @__PURE__ */ h(
1284
+ /* @__PURE__ */ vue.h("div", { class: "milkdown-attachment-icon-wrapper" }, /* @__PURE__ */ vue.h("div", { class: "milkdown-attachment-raw-icon-bg" }, /* @__PURE__ */ vue.h(component.Icon, { icon: fileLinkIcon }))),
1285
+ /* @__PURE__ */ vue.h("div", { class: "milkdown-attachment-info" }, /* @__PURE__ */ vue.h("div", { class: "milkdown-attachment-name" }, name.value), /* @__PURE__ */ vue.h("div", { class: "milkdown-attachment-size" }, (size.value || 0) > 0 ? formatBytes(size.value) : "")),
1286
+ /* @__PURE__ */ vue.h(
1287
1287
  "div",
1288
1288
  {
1289
1289
  class: "milkdown-attachment-action",
1290
1290
  onClick: openLink,
1291
1291
  title: props.config.downloadText
1292
1292
  },
1293
- /* @__PURE__ */ h(component.Icon, { icon: downloadIcon })
1293
+ /* @__PURE__ */ vue.h(component.Icon, { icon: downloadIcon })
1294
1294
  )
1295
1295
  );
1296
1296
  };
@@ -3677,6 +3677,7 @@ class MenuView {
3677
3677
  this.hide = () => {
3678
3678
  __privateSet$5(this, _programmaticallyPos, null);
3679
3679
  __privateSet$5(this, _mode, null);
3680
+ __privateGet$5(this, _content$4).removeAttribute("data-mode");
3680
3681
  this.cancelHide();
3681
3682
  __privateGet$5(this, _slashProvider).hide();
3682
3683
  };
@@ -6220,7 +6221,11 @@ const Toolbar = vue.defineComponent({
6220
6221
  }
6221
6222
  });
6222
6223
  const nonHeadingGroups = toolbarGroupInfo.value.filter(
6223
- (group) => group.key !== "heading"
6224
+ (group) => {
6225
+ if (group.key === "heading") return false;
6226
+ if (props.isFixed && group.key === "function") return false;
6227
+ return true;
6228
+ }
6224
6229
  );
6225
6230
  const isSectionOverflowed = (idx) => idx >= overflowVisibleCount.value;
6226
6231
  const hasOverflow = overflowVisibleCount.value < totalSectionCount.value;
@@ -7531,7 +7536,7 @@ const ToggleSwitch = vue.defineComponent({
7531
7536
  },
7532
7537
  emits: ["update:modelValue"],
7533
7538
  setup(props, { emit }) {
7534
- return () => /* @__PURE__ */ h(
7539
+ return () => /* @__PURE__ */ vue.h(
7535
7540
  "div",
7536
7541
  {
7537
7542
  onClick: (e) => {
@@ -7548,7 +7553,7 @@ const ToggleSwitch = vue.defineComponent({
7548
7553
  transition: "background-color 0.2s"
7549
7554
  }
7550
7555
  },
7551
- /* @__PURE__ */ h(
7556
+ /* @__PURE__ */ vue.h(
7552
7557
  "div",
7553
7558
  {
7554
7559
  style: {
@@ -7634,7 +7639,7 @@ const MenuBar = vue.defineComponent({
7634
7639
  const hasSubmenu = (key) => key === "view";
7635
7640
  return () => {
7636
7641
  const state = viewState.value;
7637
- return /* @__PURE__ */ h(
7642
+ return /* @__PURE__ */ vue.h(
7638
7643
  "div",
7639
7644
  {
7640
7645
  class: "milkdown-menu-bar",
@@ -7646,7 +7651,7 @@ const MenuBar = vue.defineComponent({
7646
7651
  position: "relative"
7647
7652
  }
7648
7653
  },
7649
- /* @__PURE__ */ h(
7654
+ /* @__PURE__ */ vue.h(
7650
7655
  "div",
7651
7656
  {
7652
7657
  ref: buttonRef,
@@ -7669,7 +7674,7 @@ const MenuBar = vue.defineComponent({
7669
7674
  e.currentTarget.style.backgroundColor = "transparent";
7670
7675
  }
7671
7676
  },
7672
- /* @__PURE__ */ h(
7677
+ /* @__PURE__ */ vue.h(
7673
7678
  "span",
7674
7679
  {
7675
7680
  style: {
@@ -7680,9 +7685,9 @@ const MenuBar = vue.defineComponent({
7680
7685
  justifyContent: "center"
7681
7686
  }
7682
7687
  },
7683
- /* @__PURE__ */ h(component.Icon, { icon: menuIcon })
7688
+ /* @__PURE__ */ vue.h(component.Icon, { icon: menuIcon })
7684
7689
  ),
7685
- /* @__PURE__ */ h(
7690
+ /* @__PURE__ */ vue.h(
7686
7691
  "span",
7687
7692
  {
7688
7693
  style: {
@@ -7695,7 +7700,7 @@ const MenuBar = vue.defineComponent({
7695
7700
  "\u83DC\u5355"
7696
7701
  )
7697
7702
  ),
7698
- showMenu.value ? /* @__PURE__ */ h(
7703
+ showMenu.value ? /* @__PURE__ */ vue.h(
7699
7704
  "div",
7700
7705
  {
7701
7706
  ref: mainRef,
@@ -7722,7 +7727,7 @@ const MenuBar = vue.defineComponent({
7722
7727
  menuKeys.map((menuKey) => {
7723
7728
  const isHovered = activeSubmenu.value === menuKey;
7724
7729
  const label = i18n(props.ctx, `menuBar.${menuKey}`) || menuKey;
7725
- return /* @__PURE__ */ h(
7730
+ return /* @__PURE__ */ vue.h(
7726
7731
  "div",
7727
7732
  {
7728
7733
  key: menuKey,
@@ -7744,7 +7749,7 @@ const MenuBar = vue.defineComponent({
7744
7749
  backgroundColor: isHovered ? "var(--crepe-color-hover, #f5f5f5)" : "transparent"
7745
7750
  }
7746
7751
  },
7747
- /* @__PURE__ */ h(
7752
+ /* @__PURE__ */ vue.h(
7748
7753
  "span",
7749
7754
  {
7750
7755
  style: {
@@ -7754,7 +7759,7 @@ const MenuBar = vue.defineComponent({
7754
7759
  },
7755
7760
  label
7756
7761
  ),
7757
- hasSubmenu(menuKey) ? /* @__PURE__ */ h(
7762
+ hasSubmenu(menuKey) ? /* @__PURE__ */ vue.h(
7758
7763
  "span",
7759
7764
  {
7760
7765
  style: {
@@ -7763,7 +7768,7 @@ const MenuBar = vue.defineComponent({
7763
7768
  display: "flex"
7764
7769
  }
7765
7770
  },
7766
- /* @__PURE__ */ h(
7771
+ /* @__PURE__ */ vue.h(
7767
7772
  "svg",
7768
7773
  {
7769
7774
  width: "12",
@@ -7775,10 +7780,10 @@ const MenuBar = vue.defineComponent({
7775
7780
  "stroke-linecap": "round",
7776
7781
  "stroke-linejoin": "round"
7777
7782
  },
7778
- /* @__PURE__ */ h("polyline", { points: "9 18 15 12 9 6" })
7783
+ /* @__PURE__ */ vue.h("polyline", { points: "9 18 15 12 9 6" })
7779
7784
  )
7780
7785
  ) : null,
7781
- menuKey === "view" && isHovered ? /* @__PURE__ */ h(
7786
+ menuKey === "view" && isHovered ? /* @__PURE__ */ vue.h(
7782
7787
  "div",
7783
7788
  {
7784
7789
  style: {
@@ -7796,7 +7801,7 @@ const MenuBar = vue.defineComponent({
7796
7801
  cursor: "default"
7797
7802
  }
7798
7803
  },
7799
- /* @__PURE__ */ h(
7804
+ /* @__PURE__ */ vue.h(
7800
7805
  "div",
7801
7806
  {
7802
7807
  style: {
@@ -7806,7 +7811,7 @@ const MenuBar = vue.defineComponent({
7806
7811
  alignItems: "center"
7807
7812
  }
7808
7813
  },
7809
- /* @__PURE__ */ h(
7814
+ /* @__PURE__ */ vue.h(
7810
7815
  "span",
7811
7816
  {
7812
7817
  style: {
@@ -7816,7 +7821,7 @@ const MenuBar = vue.defineComponent({
7816
7821
  },
7817
7822
  i18n(props.ctx, "view.title") || "\u6807\u9898"
7818
7823
  ),
7819
- /* @__PURE__ */ h(
7824
+ /* @__PURE__ */ vue.h(
7820
7825
  ToggleSwitch,
7821
7826
  {
7822
7827
  modelValue: state.showTitle,
@@ -7824,7 +7829,7 @@ const MenuBar = vue.defineComponent({
7824
7829
  }
7825
7830
  )
7826
7831
  ),
7827
- /* @__PURE__ */ h(
7832
+ /* @__PURE__ */ vue.h(
7828
7833
  "div",
7829
7834
  {
7830
7835
  style: {
@@ -7834,7 +7839,7 @@ const MenuBar = vue.defineComponent({
7834
7839
  alignItems: "center"
7835
7840
  }
7836
7841
  },
7837
- /* @__PURE__ */ h(
7842
+ /* @__PURE__ */ vue.h(
7838
7843
  "span",
7839
7844
  {
7840
7845
  style: {
@@ -7844,7 +7849,7 @@ const MenuBar = vue.defineComponent({
7844
7849
  },
7845
7850
  i18n(props.ctx, "view.outline") || "\u5927\u7EB2"
7846
7851
  ),
7847
- /* @__PURE__ */ h(
7852
+ /* @__PURE__ */ vue.h(
7848
7853
  ToggleSwitch,
7849
7854
  {
7850
7855
  modelValue: state.outlineVisible,
@@ -7852,7 +7857,7 @@ const MenuBar = vue.defineComponent({
7852
7857
  }
7853
7858
  )
7854
7859
  ),
7855
- /* @__PURE__ */ h(
7860
+ /* @__PURE__ */ vue.h(
7856
7861
  "div",
7857
7862
  {
7858
7863
  style: {
@@ -7862,7 +7867,7 @@ const MenuBar = vue.defineComponent({
7862
7867
  alignItems: "center"
7863
7868
  }
7864
7869
  },
7865
- /* @__PURE__ */ h(
7870
+ /* @__PURE__ */ vue.h(
7866
7871
  "span",
7867
7872
  {
7868
7873
  style: {
@@ -7872,7 +7877,7 @@ const MenuBar = vue.defineComponent({
7872
7877
  },
7873
7878
  i18n(props.ctx, "view.cover") || "\u5C01\u9762"
7874
7879
  ),
7875
- /* @__PURE__ */ h(
7880
+ /* @__PURE__ */ vue.h(
7876
7881
  ToggleSwitch,
7877
7882
  {
7878
7883
  modelValue: state.showCover,
@@ -7888,7 +7893,7 @@ const MenuBar = vue.defineComponent({
7888
7893
  }
7889
7894
  )
7890
7895
  ),
7891
- /* @__PURE__ */ h(
7896
+ /* @__PURE__ */ vue.h(
7892
7897
  "div",
7893
7898
  {
7894
7899
  style: {
@@ -7898,7 +7903,7 @@ const MenuBar = vue.defineComponent({
7898
7903
  }
7899
7904
  }
7900
7905
  ),
7901
- /* @__PURE__ */ h(
7906
+ /* @__PURE__ */ vue.h(
7902
7907
  "div",
7903
7908
  {
7904
7909
  style: {
@@ -7908,7 +7913,7 @@ const MenuBar = vue.defineComponent({
7908
7913
  alignItems: "center"
7909
7914
  }
7910
7915
  },
7911
- /* @__PURE__ */ h(
7916
+ /* @__PURE__ */ vue.h(
7912
7917
  "span",
7913
7918
  {
7914
7919
  style: {
@@ -7919,7 +7924,7 @@ const MenuBar = vue.defineComponent({
7919
7924
  i18n(props.ctx, "view.docBackground") || "\u6587\u6863\u80CC\u666F"
7920
7925
  )
7921
7926
  ),
7922
- /* @__PURE__ */ h(
7927
+ /* @__PURE__ */ vue.h(
7923
7928
  "div",
7924
7929
  {
7925
7930
  style: {
@@ -7929,7 +7934,7 @@ const MenuBar = vue.defineComponent({
7929
7934
  gap: "6px"
7930
7935
  }
7931
7936
  },
7932
- bgColors.map((bg) => /* @__PURE__ */ h(
7937
+ bgColors.map((bg) => /* @__PURE__ */ vue.h(
7933
7938
  "div",
7934
7939
  {
7935
7940
  key: bg.value || "default",
@@ -7951,7 +7956,7 @@ const MenuBar = vue.defineComponent({
7951
7956
  justifyContent: "center"
7952
7957
  }
7953
7958
  },
7954
- bg.value === null ? /* @__PURE__ */ h(
7959
+ bg.value === null ? /* @__PURE__ */ vue.h(
7955
7960
  "div",
7956
7961
  {
7957
7962
  style: {
@@ -7964,7 +7969,7 @@ const MenuBar = vue.defineComponent({
7964
7969
  borderRadius: "3px"
7965
7970
  }
7966
7971
  },
7967
- /* @__PURE__ */ h(
7972
+ /* @__PURE__ */ vue.h(
7968
7973
  "div",
7969
7974
  {
7970
7975
  style: {
@@ -7982,7 +7987,7 @@ const MenuBar = vue.defineComponent({
7982
7987
  ) : null
7983
7988
  ))
7984
7989
  ),
7985
- /* @__PURE__ */ h(
7990
+ /* @__PURE__ */ vue.h(
7986
7991
  "div",
7987
7992
  {
7988
7993
  style: {
@@ -7992,7 +7997,7 @@ const MenuBar = vue.defineComponent({
7992
7997
  }
7993
7998
  }
7994
7999
  ),
7995
- /* @__PURE__ */ h(
8000
+ /* @__PURE__ */ vue.h(
7996
8001
  "div",
7997
8002
  {
7998
8003
  style: {
@@ -8002,7 +8007,7 @@ const MenuBar = vue.defineComponent({
8002
8007
  alignItems: "center"
8003
8008
  }
8004
8009
  },
8005
- /* @__PURE__ */ h(
8010
+ /* @__PURE__ */ vue.h(
8006
8011
  "span",
8007
8012
  {
8008
8013
  style: {
@@ -8013,7 +8018,7 @@ const MenuBar = vue.defineComponent({
8013
8018
  i18n(props.ctx, "view.editorWidth") || "\u5185\u5BB9\u5BBD\u5EA6"
8014
8019
  )
8015
8020
  ),
8016
- /* @__PURE__ */ h(
8021
+ /* @__PURE__ */ vue.h(
8017
8022
  "div",
8018
8023
  {
8019
8024
  style: {
@@ -8035,7 +8040,7 @@ const MenuBar = vue.defineComponent({
8035
8040
  key: "full",
8036
8041
  labelKey: "view.widthFull"
8037
8042
  }
8038
- ].map(({ key, labelKey }) => /* @__PURE__ */ h(
8043
+ ].map(({ key, labelKey }) => /* @__PURE__ */ vue.h(
8039
8044
  "button",
8040
8045
  {
8041
8046
  key,
@@ -8262,7 +8267,7 @@ const FixedToolbarComponent = vue.defineComponent({
8262
8267
  },
8263
8268
  setup(props) {
8264
8269
  const showShortcuts = vue.ref(false);
8265
- return () => /* @__PURE__ */ h(
8270
+ return () => /* @__PURE__ */ vue.h(
8266
8271
  "div",
8267
8272
  {
8268
8273
  style: {
@@ -8273,8 +8278,8 @@ const FixedToolbarComponent = vue.defineComponent({
8273
8278
  gap: "0px"
8274
8279
  }
8275
8280
  },
8276
- /* @__PURE__ */ h(MenuBar, { ctx: props.ctx, config: props.config }),
8277
- /* @__PURE__ */ h(
8281
+ /* @__PURE__ */ vue.h(MenuBar, { ctx: props.ctx, config: props.config }),
8282
+ /* @__PURE__ */ vue.h(
8278
8283
  "div",
8279
8284
  {
8280
8285
  style: {
@@ -8285,7 +8290,7 @@ const FixedToolbarComponent = vue.defineComponent({
8285
8290
  }
8286
8291
  }
8287
8292
  ),
8288
- /* @__PURE__ */ h(
8293
+ /* @__PURE__ */ vue.h(
8289
8294
  Toolbar,
8290
8295
  {
8291
8296
  ctx: props.ctx,
@@ -8296,7 +8301,7 @@ const FixedToolbarComponent = vue.defineComponent({
8296
8301
  isFixed: true
8297
8302
  }
8298
8303
  ),
8299
- /* @__PURE__ */ h(
8304
+ /* @__PURE__ */ vue.h(
8300
8305
  "div",
8301
8306
  {
8302
8307
  style: {
@@ -8308,7 +8313,7 @@ const FixedToolbarComponent = vue.defineComponent({
8308
8313
  }
8309
8314
  }
8310
8315
  ),
8311
- /* @__PURE__ */ h(
8316
+ /* @__PURE__ */ vue.h(
8312
8317
  "button",
8313
8318
  {
8314
8319
  type: "button",
@@ -8318,9 +8323,9 @@ const FixedToolbarComponent = vue.defineComponent({
8318
8323
  showShortcuts.value = true;
8319
8324
  }
8320
8325
  },
8321
- /* @__PURE__ */ h(component.Icon, { icon: keyboardIcon })
8326
+ /* @__PURE__ */ vue.h(component.Icon, { icon: keyboardIcon })
8322
8327
  ),
8323
- showShortcuts.value && /* @__PURE__ */ h(ShortcutHelpModal, { ctx: props.ctx, visible: showShortcuts })
8328
+ showShortcuts.value && /* @__PURE__ */ vue.h(ShortcutHelpModal, { ctx: props.ctx, visible: showShortcuts })
8324
8329
  );
8325
8330
  }
8326
8331
  });
@@ -8750,6 +8755,7 @@ function buildDefaultFixedToolbar(builder, _config, ctx) {
8750
8755
  return builder.build();
8751
8756
  }
8752
8757
 
8758
+ keepAlive(vue.h);
8753
8759
  const DocumentHeader = vue.defineComponent({
8754
8760
  props: {
8755
8761
  ctx: { type: Object, required: true },
@@ -8826,13 +8832,13 @@ const DocumentHeader = vue.defineComponent({
8826
8832
  var _a, _b;
8827
8833
  const state = viewState.value;
8828
8834
  if (!state.showTitle && !state.showCover) return null;
8829
- return /* @__PURE__ */ h(
8835
+ return /* @__PURE__ */ vue.h(
8830
8836
  "div",
8831
8837
  {
8832
8838
  class: "milkdown-document-header",
8833
8839
  style: { width: "100%", display: "flex", flexDirection: "column" }
8834
8840
  },
8835
- state.showCover ? /* @__PURE__ */ h(
8841
+ state.showCover ? /* @__PURE__ */ vue.h(
8836
8842
  "div",
8837
8843
  {
8838
8844
  class: "milkdown-document-cover",
@@ -8850,7 +8856,7 @@ const DocumentHeader = vue.defineComponent({
8850
8856
  overflow: "hidden"
8851
8857
  }
8852
8858
  },
8853
- /* @__PURE__ */ h(
8859
+ /* @__PURE__ */ vue.h(
8854
8860
  "img",
8855
8861
  {
8856
8862
  src: state.coverUrl,
@@ -8863,7 +8869,7 @@ const DocumentHeader = vue.defineComponent({
8863
8869
  }
8864
8870
  }
8865
8871
  ),
8866
- /* @__PURE__ */ h(
8872
+ /* @__PURE__ */ vue.h(
8867
8873
  "div",
8868
8874
  {
8869
8875
  style: {
@@ -8880,7 +8886,7 @@ const DocumentHeader = vue.defineComponent({
8880
8886
  background: "linear-gradient(transparent, rgba(0,0,0,0.7))"
8881
8887
  }
8882
8888
  },
8883
- /* @__PURE__ */ h(
8889
+ /* @__PURE__ */ vue.h(
8884
8890
  "div",
8885
8891
  {
8886
8892
  style: {
@@ -8892,7 +8898,7 @@ const DocumentHeader = vue.defineComponent({
8892
8898
  },
8893
8899
  (lastUploadedUrl.value ? [lastUploadedUrl.value] : []).concat(
8894
8900
  ((_b = (_a = props.config) == null ? void 0 : _a.defaultCoverImages) == null ? void 0 : _b.length) ? props.config.defaultCoverImages : builtInCoverImages
8895
- ).map((src, i) => /* @__PURE__ */ h(
8901
+ ).map((src, i) => /* @__PURE__ */ vue.h(
8896
8902
  "img",
8897
8903
  {
8898
8904
  key: i,
@@ -8922,7 +8928,7 @@ const DocumentHeader = vue.defineComponent({
8922
8928
  }
8923
8929
  ))
8924
8930
  ),
8925
- /* @__PURE__ */ h(
8931
+ /* @__PURE__ */ vue.h(
8926
8932
  "div",
8927
8933
  {
8928
8934
  onClick: () => {
@@ -8950,7 +8956,7 @@ const DocumentHeader = vue.defineComponent({
8950
8956
  e.currentTarget.style.backgroundColor = "rgba(255,255,255,0.2)";
8951
8957
  }
8952
8958
  },
8953
- /* @__PURE__ */ h(
8959
+ /* @__PURE__ */ vue.h(
8954
8960
  "svg",
8955
8961
  {
8956
8962
  width: "14",
@@ -8962,14 +8968,14 @@ const DocumentHeader = vue.defineComponent({
8962
8968
  "stroke-linecap": "round",
8963
8969
  "stroke-linejoin": "round"
8964
8970
  },
8965
- /* @__PURE__ */ h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
8966
- /* @__PURE__ */ h("polyline", { points: "17 8 12 3 7 8" }),
8967
- /* @__PURE__ */ h("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
8971
+ /* @__PURE__ */ vue.h("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
8972
+ /* @__PURE__ */ vue.h("polyline", { points: "17 8 12 3 7 8" }),
8973
+ /* @__PURE__ */ vue.h("line", { x1: "12", y1: "3", x2: "12", y2: "15" })
8968
8974
  ),
8969
8975
  "\u4E0A\u4F20"
8970
8976
  )
8971
8977
  ),
8972
- /* @__PURE__ */ h(
8978
+ /* @__PURE__ */ vue.h(
8973
8979
  "input",
8974
8980
  {
8975
8981
  type: "file",
@@ -8980,7 +8986,7 @@ const DocumentHeader = vue.defineComponent({
8980
8986
  }
8981
8987
  )
8982
8988
  ) : null,
8983
- state.showTitle ? /* @__PURE__ */ h(
8989
+ state.showTitle ? /* @__PURE__ */ vue.h(
8984
8990
  "div",
8985
8991
  {
8986
8992
  class: "milkdown-document-title-wrapper",
@@ -8991,8 +8997,8 @@ const DocumentHeader = vue.defineComponent({
8991
8997
  padding: `40px ${editorWidthMap[state.editorWidth] === "none" ? "80px" : "0"} 0`
8992
8998
  }
8993
8999
  },
8994
- /* @__PURE__ */ h("style", null, `.milkdown-document-title::placeholder { color: #BFBFBF; }`),
8995
- /* @__PURE__ */ h(
9000
+ /* @__PURE__ */ vue.h("style", null, `.milkdown-document-title::placeholder { color: #BFBFBF; }`),
9001
+ /* @__PURE__ */ vue.h(
8996
9002
  "textarea",
8997
9003
  {
8998
9004
  ref: titleTextareaRef,
@@ -9227,7 +9233,7 @@ const OutlinePanel = vue.defineComponent({
9227
9233
  const state = viewState.value;
9228
9234
  if (!state.outlineVisible) return null;
9229
9235
  const isLeft = state.outlinePosition === "left";
9230
- return /* @__PURE__ */ h(
9236
+ return /* @__PURE__ */ vue.h(
9231
9237
  "div",
9232
9238
  {
9233
9239
  class: "milkdown-outline-panel",
@@ -9248,7 +9254,7 @@ const OutlinePanel = vue.defineComponent({
9248
9254
  overflow: "hidden"
9249
9255
  }
9250
9256
  },
9251
- /* @__PURE__ */ h(
9257
+ /* @__PURE__ */ vue.h(
9252
9258
  "div",
9253
9259
  {
9254
9260
  style: {
@@ -9262,8 +9268,8 @@ const OutlinePanel = vue.defineComponent({
9262
9268
  alignItems: "center"
9263
9269
  }
9264
9270
  },
9265
- /* @__PURE__ */ h("span", null, i18n(props.ctx, "view.outline")),
9266
- /* @__PURE__ */ h(
9271
+ /* @__PURE__ */ vue.h("span", null, i18n(props.ctx, "view.outline")),
9272
+ /* @__PURE__ */ vue.h(
9267
9273
  "div",
9268
9274
  {
9269
9275
  style: {
@@ -9287,7 +9293,7 @@ const OutlinePanel = vue.defineComponent({
9287
9293
  },
9288
9294
  title: "\u5173\u95ED\u5927\u7EB2"
9289
9295
  },
9290
- /* @__PURE__ */ h(
9296
+ /* @__PURE__ */ vue.h(
9291
9297
  "svg",
9292
9298
  {
9293
9299
  width: "16",
@@ -9299,12 +9305,12 @@ const OutlinePanel = vue.defineComponent({
9299
9305
  "stroke-linecap": "round",
9300
9306
  "stroke-linejoin": "round"
9301
9307
  },
9302
- /* @__PURE__ */ h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
9303
- /* @__PURE__ */ h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
9308
+ /* @__PURE__ */ vue.h("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
9309
+ /* @__PURE__ */ vue.h("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
9304
9310
  )
9305
9311
  )
9306
9312
  ),
9307
- /* @__PURE__ */ h("div", { style: { flexGrow: 1, overflowY: "auto", padding: "12px 0" } }, items.value.length === 0 ? /* @__PURE__ */ h(
9313
+ /* @__PURE__ */ vue.h("div", { style: { flexGrow: 1, overflowY: "auto", padding: "12px 0" } }, items.value.length === 0 ? /* @__PURE__ */ vue.h(
9308
9314
  "div",
9309
9315
  {
9310
9316
  style: {
@@ -9317,7 +9323,7 @@ const OutlinePanel = vue.defineComponent({
9317
9323
  ) : null, visibleItems.value.map(({ item, hasChildren: hasKids }) => {
9318
9324
  const isActive = activeId.value === item.id;
9319
9325
  const collapsed = collapsedIds.value.has(item.id);
9320
- return /* @__PURE__ */ h(
9326
+ return /* @__PURE__ */ vue.h(
9321
9327
  "div",
9322
9328
  {
9323
9329
  key: item.id,
@@ -9350,7 +9356,7 @@ const OutlinePanel = vue.defineComponent({
9350
9356
  }
9351
9357
  }
9352
9358
  },
9353
- /* @__PURE__ */ h(
9359
+ /* @__PURE__ */ vue.h(
9354
9360
  "span",
9355
9361
  {
9356
9362
  onClick: (e) => {
@@ -9383,7 +9389,7 @@ const OutlinePanel = vue.defineComponent({
9383
9389
  "\uFFFD?",
9384
9390
  " "
9385
9391
  ),
9386
- /* @__PURE__ */ h(
9392
+ /* @__PURE__ */ vue.h(
9387
9393
  "span",
9388
9394
  {
9389
9395
  title: item.text,
@@ -9396,7 +9402,7 @@ const OutlinePanel = vue.defineComponent({
9396
9402
  )
9397
9403
  );
9398
9404
  })),
9399
- /* @__PURE__ */ h(
9405
+ /* @__PURE__ */ vue.h(
9400
9406
  "div",
9401
9407
  {
9402
9408
  onPointerdown: onPointerDown,
@@ -9611,7 +9617,7 @@ class FixedToolbarView {
9611
9617
  __privateGet$3(this, _view).dom.style.margin = isFull ? "0" : "0 auto";
9612
9618
  __privateGet$3(this, _view).dom.style.padding = `20px ${px} 0`;
9613
9619
  if (__privateGet$3(this, _headerContent)) {
9614
- __privateGet$3(this, _headerContent).style.margin = isFull ? "0" : "0 auto";
9620
+ __privateGet$3(this, _headerContent).style.margin = isFull && !viewState.showCover ? "0 auto" : "0";
9615
9621
  __privateGet$3(this, _headerContent).style.padding = `0px`;
9616
9622
  }
9617
9623
  vue.nextTick(() => {