@jvs-milkdown/crepe 1.2.31 → 1.2.32
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/lib/cjs/index.js +90 -61
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +90 -61
- package/lib/esm/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/feature/fixed-toolbar/component.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/feature/fixed-toolbar/component.tsx +84 -59
- package/src/feature/fixed-toolbar/index.ts +1 -1
package/lib/cjs/index.js
CHANGED
|
@@ -8650,46 +8650,73 @@ const FixedToolbarComponent = vue.defineComponent({
|
|
|
8650
8650
|
const canUndo = (typeof props.canUndo === "boolean" ? props.canUndo : (_b = props.canUndo) == null ? void 0 : _b.value) || false;
|
|
8651
8651
|
const canRedo = (typeof props.canRedo === "boolean" ? props.canRedo : (_c = props.canRedo) == null ? void 0 : _c.value) || false;
|
|
8652
8652
|
const viewState = props.ctx.get(viewMenuStateCtx.key);
|
|
8653
|
-
const maxWidth = vue.computed(
|
|
8653
|
+
const maxWidth = vue.computed(
|
|
8654
|
+
() => editorWidthMap[viewState.editorWidth]
|
|
8655
|
+
);
|
|
8654
8656
|
const isFull = vue.computed(() => maxWidth.value === "none");
|
|
8655
8657
|
if (!viewState.fixedToolbarVisible) {
|
|
8656
8658
|
return /* @__PURE__ */ vue.h(
|
|
8657
|
-
"
|
|
8659
|
+
"div",
|
|
8658
8660
|
{
|
|
8659
|
-
type: "button",
|
|
8660
|
-
class: "fixed-toolbar-expand-btn",
|
|
8661
|
-
title: "\u5C55\u5F00\u5DE5\u5177\u680F",
|
|
8662
|
-
onClick: (e) => {
|
|
8663
|
-
e.preventDefault();
|
|
8664
|
-
e.stopPropagation();
|
|
8665
|
-
viewState.fixedToolbarVisible = true;
|
|
8666
|
-
},
|
|
8667
8661
|
style: {
|
|
8668
|
-
position: "
|
|
8669
|
-
|
|
8670
|
-
|
|
8662
|
+
position: "relative",
|
|
8663
|
+
width: "100%",
|
|
8664
|
+
height: "100%",
|
|
8671
8665
|
display: "flex",
|
|
8672
8666
|
alignItems: "center",
|
|
8673
|
-
justifyContent: "center"
|
|
8674
|
-
width: "32px",
|
|
8675
|
-
height: "24px",
|
|
8676
|
-
border: "1px solid var(--crepe-color-outline-variant, color-mix(in srgb, var(--crepe-color-outline), transparent 85%))",
|
|
8677
|
-
borderTop: "none",
|
|
8678
|
-
background: "var(--crepe-color-surface, #ffffff)",
|
|
8679
|
-
cursor: "pointer",
|
|
8680
|
-
borderRadius: "0 0 6px 6px",
|
|
8681
|
-
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.06)",
|
|
8682
|
-
color: "var(--crepe-color-on-surface, #363b4c)",
|
|
8683
|
-
pointerEvents: "auto",
|
|
8684
|
-
zIndex: 200
|
|
8667
|
+
justifyContent: "center"
|
|
8685
8668
|
}
|
|
8686
8669
|
},
|
|
8687
8670
|
/* @__PURE__ */ vue.h(
|
|
8688
|
-
"
|
|
8671
|
+
"div",
|
|
8689
8672
|
{
|
|
8690
|
-
style: {
|
|
8691
|
-
|
|
8692
|
-
|
|
8673
|
+
style: {
|
|
8674
|
+
position: "relative",
|
|
8675
|
+
width: "100%",
|
|
8676
|
+
maxWidth: isFull.value ? "100%" : maxWidth.value,
|
|
8677
|
+
margin: isFull.value ? "0" : "0 auto",
|
|
8678
|
+
height: "100%"
|
|
8679
|
+
}
|
|
8680
|
+
},
|
|
8681
|
+
/* @__PURE__ */ vue.h(
|
|
8682
|
+
"button",
|
|
8683
|
+
{
|
|
8684
|
+
type: "button",
|
|
8685
|
+
class: "fixed-toolbar-expand-btn",
|
|
8686
|
+
title: "\u5C55\u5F00\u5DE5\u5177\u680F",
|
|
8687
|
+
onClick: (e) => {
|
|
8688
|
+
e.preventDefault();
|
|
8689
|
+
e.stopPropagation();
|
|
8690
|
+
viewState.fixedToolbarVisible = true;
|
|
8691
|
+
},
|
|
8692
|
+
style: {
|
|
8693
|
+
position: "absolute",
|
|
8694
|
+
top: "0",
|
|
8695
|
+
right: "6px",
|
|
8696
|
+
display: "flex",
|
|
8697
|
+
alignItems: "center",
|
|
8698
|
+
justifyContent: "center",
|
|
8699
|
+
width: "28px",
|
|
8700
|
+
height: "24px",
|
|
8701
|
+
border: "1px solid var(--crepe-color-outline-variant, color-mix(in srgb, var(--crepe-color-outline), transparent 85%))",
|
|
8702
|
+
borderTop: "none",
|
|
8703
|
+
background: "var(--crepe-color-surface, #ffffff)",
|
|
8704
|
+
cursor: "pointer",
|
|
8705
|
+
borderRadius: "0 0 6px 6px",
|
|
8706
|
+
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.06)",
|
|
8707
|
+
color: "var(--crepe-color-on-surface, #363b4c)",
|
|
8708
|
+
pointerEvents: "auto",
|
|
8709
|
+
zIndex: 200
|
|
8710
|
+
}
|
|
8711
|
+
},
|
|
8712
|
+
/* @__PURE__ */ vue.h(
|
|
8713
|
+
"span",
|
|
8714
|
+
{
|
|
8715
|
+
style: { display: "inline-flex", alignItems: "center" },
|
|
8716
|
+
innerHTML: chevronDownIcon
|
|
8717
|
+
}
|
|
8718
|
+
)
|
|
8719
|
+
)
|
|
8693
8720
|
)
|
|
8694
8721
|
);
|
|
8695
8722
|
}
|
|
@@ -8709,12 +8736,14 @@ const FixedToolbarComponent = vue.defineComponent({
|
|
|
8709
8736
|
"div",
|
|
8710
8737
|
{
|
|
8711
8738
|
style: {
|
|
8739
|
+
position: "relative",
|
|
8712
8740
|
display: "flex",
|
|
8713
8741
|
alignItems: "center",
|
|
8714
|
-
justifyContent: "
|
|
8742
|
+
justifyContent: "flex-start",
|
|
8715
8743
|
width: "100%",
|
|
8716
8744
|
maxWidth: isFull.value ? "100%" : maxWidth.value,
|
|
8717
8745
|
margin: isFull.value ? "0" : "0 auto",
|
|
8746
|
+
paddingRight: "40px",
|
|
8718
8747
|
gap: "0px",
|
|
8719
8748
|
minWidth: "0",
|
|
8720
8749
|
overflow: "hidden"
|
|
@@ -8836,41 +8865,41 @@ const FixedToolbarComponent = vue.defineComponent({
|
|
|
8836
8865
|
isFixed: true
|
|
8837
8866
|
}
|
|
8838
8867
|
),
|
|
8839
|
-
showShortcuts.value && /* @__PURE__ */ vue.h(ShortcutHelpModal, { ctx: props.ctx, visible: showShortcuts })
|
|
8840
|
-
),
|
|
8841
|
-
/* @__PURE__ */ vue.h(
|
|
8842
|
-
"button",
|
|
8843
|
-
{
|
|
8844
|
-
type: "button",
|
|
8845
|
-
class: "toolbar-item collapse-btn",
|
|
8846
|
-
title: "\u6298\u53E0\u5DE5\u5177\u680F",
|
|
8847
|
-
onClick: (e) => {
|
|
8848
|
-
e.preventDefault();
|
|
8849
|
-
e.stopPropagation();
|
|
8850
|
-
viewState.fixedToolbarVisible = false;
|
|
8851
|
-
},
|
|
8852
|
-
style: {
|
|
8853
|
-
position: "absolute",
|
|
8854
|
-
top: "6px",
|
|
8855
|
-
right: "32px",
|
|
8856
|
-
margin: "0",
|
|
8857
|
-
display: "flex",
|
|
8858
|
-
alignItems: "center",
|
|
8859
|
-
justifyContent: "center",
|
|
8860
|
-
pointerEvents: "auto",
|
|
8861
|
-
zIndex: 200
|
|
8862
|
-
}
|
|
8863
|
-
},
|
|
8868
|
+
showShortcuts.value && /* @__PURE__ */ vue.h(ShortcutHelpModal, { ctx: props.ctx, visible: showShortcuts }),
|
|
8864
8869
|
/* @__PURE__ */ vue.h(
|
|
8865
|
-
"
|
|
8870
|
+
"button",
|
|
8866
8871
|
{
|
|
8872
|
+
type: "button",
|
|
8873
|
+
class: "toolbar-item collapse-btn",
|
|
8874
|
+
title: "\u6298\u53E0\u5DE5\u5177\u680F",
|
|
8875
|
+
onClick: (e) => {
|
|
8876
|
+
e.preventDefault();
|
|
8877
|
+
e.stopPropagation();
|
|
8878
|
+
viewState.fixedToolbarVisible = false;
|
|
8879
|
+
},
|
|
8867
8880
|
style: {
|
|
8868
|
-
|
|
8881
|
+
position: "absolute",
|
|
8882
|
+
top: "6px",
|
|
8883
|
+
right: "6px",
|
|
8884
|
+
margin: "0",
|
|
8885
|
+
display: "flex",
|
|
8869
8886
|
alignItems: "center",
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8887
|
+
justifyContent: "center",
|
|
8888
|
+
pointerEvents: "auto",
|
|
8889
|
+
zIndex: 200
|
|
8890
|
+
}
|
|
8891
|
+
},
|
|
8892
|
+
/* @__PURE__ */ vue.h(
|
|
8893
|
+
"span",
|
|
8894
|
+
{
|
|
8895
|
+
style: {
|
|
8896
|
+
display: "inline-flex",
|
|
8897
|
+
alignItems: "center",
|
|
8898
|
+
transform: "rotate(180deg)"
|
|
8899
|
+
},
|
|
8900
|
+
innerHTML: chevronDownIcon
|
|
8901
|
+
}
|
|
8902
|
+
)
|
|
8874
8903
|
)
|
|
8875
8904
|
)
|
|
8876
8905
|
);
|