@jvs-milkdown/crepe 1.2.30 → 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 +94 -65
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.js +94 -65
- 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 +88 -63
- package/src/feature/fixed-toolbar/index.ts +1 -1
package/lib/esm/index.js
CHANGED
|
@@ -8629,46 +8629,73 @@ const FixedToolbarComponent = defineComponent({
|
|
|
8629
8629
|
const canUndo = (typeof props.canUndo === "boolean" ? props.canUndo : (_b = props.canUndo) == null ? void 0 : _b.value) || false;
|
|
8630
8630
|
const canRedo = (typeof props.canRedo === "boolean" ? props.canRedo : (_c = props.canRedo) == null ? void 0 : _c.value) || false;
|
|
8631
8631
|
const viewState = props.ctx.get(viewMenuStateCtx.key);
|
|
8632
|
-
const maxWidth =
|
|
8633
|
-
|
|
8632
|
+
const maxWidth = computed(
|
|
8633
|
+
() => editorWidthMap[viewState.editorWidth]
|
|
8634
|
+
);
|
|
8635
|
+
const isFull = computed(() => maxWidth.value === "none");
|
|
8634
8636
|
if (!viewState.fixedToolbarVisible) {
|
|
8635
8637
|
return /* @__PURE__ */ h(
|
|
8636
|
-
"
|
|
8638
|
+
"div",
|
|
8637
8639
|
{
|
|
8638
|
-
type: "button",
|
|
8639
|
-
class: "fixed-toolbar-expand-btn",
|
|
8640
|
-
title: "\u5C55\u5F00\u5DE5\u5177\u680F",
|
|
8641
|
-
onClick: (e) => {
|
|
8642
|
-
e.preventDefault();
|
|
8643
|
-
e.stopPropagation();
|
|
8644
|
-
viewState.fixedToolbarVisible = true;
|
|
8645
|
-
},
|
|
8646
8640
|
style: {
|
|
8647
|
-
position: "
|
|
8648
|
-
|
|
8649
|
-
|
|
8641
|
+
position: "relative",
|
|
8642
|
+
width: "100%",
|
|
8643
|
+
height: "100%",
|
|
8650
8644
|
display: "flex",
|
|
8651
8645
|
alignItems: "center",
|
|
8652
|
-
justifyContent: "center"
|
|
8653
|
-
width: "32px",
|
|
8654
|
-
height: "24px",
|
|
8655
|
-
border: "1px solid var(--crepe-color-outline-variant, color-mix(in srgb, var(--crepe-color-outline), transparent 85%))",
|
|
8656
|
-
borderTop: "none",
|
|
8657
|
-
background: "var(--crepe-color-surface, #ffffff)",
|
|
8658
|
-
cursor: "pointer",
|
|
8659
|
-
borderRadius: "0 0 6px 6px",
|
|
8660
|
-
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.06)",
|
|
8661
|
-
color: "var(--crepe-color-on-surface, #363b4c)",
|
|
8662
|
-
pointerEvents: "auto",
|
|
8663
|
-
zIndex: 200
|
|
8646
|
+
justifyContent: "center"
|
|
8664
8647
|
}
|
|
8665
8648
|
},
|
|
8666
8649
|
/* @__PURE__ */ h(
|
|
8667
|
-
"
|
|
8650
|
+
"div",
|
|
8668
8651
|
{
|
|
8669
|
-
style: {
|
|
8670
|
-
|
|
8671
|
-
|
|
8652
|
+
style: {
|
|
8653
|
+
position: "relative",
|
|
8654
|
+
width: "100%",
|
|
8655
|
+
maxWidth: isFull.value ? "100%" : maxWidth.value,
|
|
8656
|
+
margin: isFull.value ? "0" : "0 auto",
|
|
8657
|
+
height: "100%"
|
|
8658
|
+
}
|
|
8659
|
+
},
|
|
8660
|
+
/* @__PURE__ */ h(
|
|
8661
|
+
"button",
|
|
8662
|
+
{
|
|
8663
|
+
type: "button",
|
|
8664
|
+
class: "fixed-toolbar-expand-btn",
|
|
8665
|
+
title: "\u5C55\u5F00\u5DE5\u5177\u680F",
|
|
8666
|
+
onClick: (e) => {
|
|
8667
|
+
e.preventDefault();
|
|
8668
|
+
e.stopPropagation();
|
|
8669
|
+
viewState.fixedToolbarVisible = true;
|
|
8670
|
+
},
|
|
8671
|
+
style: {
|
|
8672
|
+
position: "absolute",
|
|
8673
|
+
top: "0",
|
|
8674
|
+
right: "6px",
|
|
8675
|
+
display: "flex",
|
|
8676
|
+
alignItems: "center",
|
|
8677
|
+
justifyContent: "center",
|
|
8678
|
+
width: "28px",
|
|
8679
|
+
height: "24px",
|
|
8680
|
+
border: "1px solid var(--crepe-color-outline-variant, color-mix(in srgb, var(--crepe-color-outline), transparent 85%))",
|
|
8681
|
+
borderTop: "none",
|
|
8682
|
+
background: "var(--crepe-color-surface, #ffffff)",
|
|
8683
|
+
cursor: "pointer",
|
|
8684
|
+
borderRadius: "0 0 6px 6px",
|
|
8685
|
+
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.06)",
|
|
8686
|
+
color: "var(--crepe-color-on-surface, #363b4c)",
|
|
8687
|
+
pointerEvents: "auto",
|
|
8688
|
+
zIndex: 200
|
|
8689
|
+
}
|
|
8690
|
+
},
|
|
8691
|
+
/* @__PURE__ */ h(
|
|
8692
|
+
"span",
|
|
8693
|
+
{
|
|
8694
|
+
style: { display: "inline-flex", alignItems: "center" },
|
|
8695
|
+
innerHTML: chevronDownIcon
|
|
8696
|
+
}
|
|
8697
|
+
)
|
|
8698
|
+
)
|
|
8672
8699
|
)
|
|
8673
8700
|
);
|
|
8674
8701
|
}
|
|
@@ -8688,12 +8715,14 @@ const FixedToolbarComponent = defineComponent({
|
|
|
8688
8715
|
"div",
|
|
8689
8716
|
{
|
|
8690
8717
|
style: {
|
|
8718
|
+
position: "relative",
|
|
8691
8719
|
display: "flex",
|
|
8692
8720
|
alignItems: "center",
|
|
8693
|
-
justifyContent: "
|
|
8721
|
+
justifyContent: "flex-start",
|
|
8694
8722
|
width: "100%",
|
|
8695
|
-
maxWidth: isFull ? "100%" : maxWidth,
|
|
8696
|
-
margin: isFull ? "0" : "0 auto",
|
|
8723
|
+
maxWidth: isFull.value ? "100%" : maxWidth.value,
|
|
8724
|
+
margin: isFull.value ? "0" : "0 auto",
|
|
8725
|
+
paddingRight: "40px",
|
|
8697
8726
|
gap: "0px",
|
|
8698
8727
|
minWidth: "0",
|
|
8699
8728
|
overflow: "hidden"
|
|
@@ -8815,41 +8844,41 @@ const FixedToolbarComponent = defineComponent({
|
|
|
8815
8844
|
isFixed: true
|
|
8816
8845
|
}
|
|
8817
8846
|
),
|
|
8818
|
-
showShortcuts.value && /* @__PURE__ */ h(ShortcutHelpModal, { ctx: props.ctx, visible: showShortcuts })
|
|
8819
|
-
),
|
|
8820
|
-
/* @__PURE__ */ h(
|
|
8821
|
-
"button",
|
|
8822
|
-
{
|
|
8823
|
-
type: "button",
|
|
8824
|
-
class: "toolbar-item collapse-btn",
|
|
8825
|
-
title: "\u6298\u53E0\u5DE5\u5177\u680F",
|
|
8826
|
-
onClick: (e) => {
|
|
8827
|
-
e.preventDefault();
|
|
8828
|
-
e.stopPropagation();
|
|
8829
|
-
viewState.fixedToolbarVisible = false;
|
|
8830
|
-
},
|
|
8831
|
-
style: {
|
|
8832
|
-
position: "absolute",
|
|
8833
|
-
top: "6px",
|
|
8834
|
-
right: "32px",
|
|
8835
|
-
margin: "0",
|
|
8836
|
-
display: "flex",
|
|
8837
|
-
alignItems: "center",
|
|
8838
|
-
justifyContent: "center",
|
|
8839
|
-
pointerEvents: "auto",
|
|
8840
|
-
zIndex: 200
|
|
8841
|
-
}
|
|
8842
|
-
},
|
|
8847
|
+
showShortcuts.value && /* @__PURE__ */ h(ShortcutHelpModal, { ctx: props.ctx, visible: showShortcuts }),
|
|
8843
8848
|
/* @__PURE__ */ h(
|
|
8844
|
-
"
|
|
8849
|
+
"button",
|
|
8845
8850
|
{
|
|
8851
|
+
type: "button",
|
|
8852
|
+
class: "toolbar-item collapse-btn",
|
|
8853
|
+
title: "\u6298\u53E0\u5DE5\u5177\u680F",
|
|
8854
|
+
onClick: (e) => {
|
|
8855
|
+
e.preventDefault();
|
|
8856
|
+
e.stopPropagation();
|
|
8857
|
+
viewState.fixedToolbarVisible = false;
|
|
8858
|
+
},
|
|
8846
8859
|
style: {
|
|
8847
|
-
|
|
8860
|
+
position: "absolute",
|
|
8861
|
+
top: "6px",
|
|
8862
|
+
right: "6px",
|
|
8863
|
+
margin: "0",
|
|
8864
|
+
display: "flex",
|
|
8848
8865
|
alignItems: "center",
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8866
|
+
justifyContent: "center",
|
|
8867
|
+
pointerEvents: "auto",
|
|
8868
|
+
zIndex: 200
|
|
8869
|
+
}
|
|
8870
|
+
},
|
|
8871
|
+
/* @__PURE__ */ h(
|
|
8872
|
+
"span",
|
|
8873
|
+
{
|
|
8874
|
+
style: {
|
|
8875
|
+
display: "inline-flex",
|
|
8876
|
+
alignItems: "center",
|
|
8877
|
+
transform: "rotate(180deg)"
|
|
8878
|
+
},
|
|
8879
|
+
innerHTML: chevronDownIcon
|
|
8880
|
+
}
|
|
8881
|
+
)
|
|
8853
8882
|
)
|
|
8854
8883
|
)
|
|
8855
8884
|
);
|
|
@@ -10891,7 +10920,7 @@ class FixedToolbarView {
|
|
|
10891
10920
|
}
|
|
10892
10921
|
const maxWidth = editorWidthMap[viewState2.editorWidth];
|
|
10893
10922
|
const isFull = maxWidth === "none";
|
|
10894
|
-
const px = isFull ? "80px" : "
|
|
10923
|
+
const px = isFull ? "80px" : "0px";
|
|
10895
10924
|
__privateGet$4(this, _view$1).dom.style.maxWidth = maxWidth;
|
|
10896
10925
|
__privateGet$4(this, _view$1).dom.style.width = isFull ? "100%" : maxWidth;
|
|
10897
10926
|
__privateGet$4(this, _view$1).dom.style.margin = isFull ? "0" : "0 auto";
|