@milkdown/crepe 7.3.3 → 7.3.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.
- package/lib/feature/block-edit/handle/index.d.ts.map +1 -1
- package/lib/feature/block-edit/menu/index.d.ts.map +1 -1
- package/lib/feature/toolbar/index.d.ts.map +1 -1
- package/lib/{index-4afXjFMY.js → index-1KQHo-44.js} +4 -4
- package/lib/{index-SdFSDosa.js → index-4p4g7ekJ.js} +1 -1
- package/lib/{index-8Gg-jEP4.js → index-4uesIuIi.js} +4 -4
- package/lib/{index-Pwn25-kf.js → index-51ybuhXd.js} +1 -1
- package/lib/{index-0RbcZMbq.js → index-96I5UgEh.js} +1 -1
- package/lib/{index-vJbZIHYF.js → index-C17brGmy.js} +4 -4
- package/lib/{index-W5Th22-Z.js → index-EhPVaWMa.js} +7 -7
- package/lib/{index-jPA8J9Eo.js → index-IKzcztdD.js} +1 -1
- package/lib/{index-FIk_7oPb.js → index-KDuMRRPt.js} +4 -4
- package/lib/{use-css-light-dom-EKWZDmbJ.js → index-K_kBonEs.js} +24 -23
- package/lib/{index-7MeyepDG.js → index-Mwqn_gij.js} +7 -7
- package/lib/{index-oTRzPo3B.js → index-P2HixfB4.js} +4 -4
- package/lib/{index-rrf6_6DC.js → index-PwfWCMtB.js} +9 -9
- package/lib/{index-XiXSFLmI.js → index-S3dtETwZ.js} +46 -45
- package/lib/{index-yt2EpMtv.js → index-T6CCBIrO.js} +5 -5
- package/lib/{index-9A_GmGh4.js → index-UdINtlLB.js} +154 -152
- package/lib/{index-7pgP6qYs.js → index-WpINpUas.js} +7 -7
- package/lib/{index-LlbrXb_n.js → index-YjIgdsm-.js} +80 -84
- package/lib/{index-vPRh55CO.js → index-ZyvuYqIf.js} +21 -23
- package/lib/{index-8S8qcncB.js → index-brbFUWoa.js} +18 -18
- package/lib/{index-vxy63hib.js → index-cAviWcah.js} +7 -7
- package/lib/{index-lsG76a9s.js → index-f8O1bHwz.js} +4 -4
- package/lib/{index-N9GtIS4X.js → index-f_vMXWyc.js} +4 -4
- package/lib/{index-bknOViGv.js → index-gRh597MD.js} +5 -5
- package/lib/{index-wn1_LgCS.js → index-gaQ0Jeve.js} +4 -4
- package/lib/{index-MovKtgMG.js → index-hcG6NuOF.js} +2 -2
- package/lib/{index-8DvtgRVa.js → index-iECr6hjv.js} +24 -24
- package/lib/{index-bkuIUPFS.js → index-iHi9E5fI.js} +5 -5
- package/lib/{index-Eg39w5kL.js → index-sAnPFt21.js} +6 -6
- package/lib/{index-7QgQq3x3.js → index-wD9meLYq.js} +4 -4
- package/lib/{index-EJJfYLzA.js → index-zY_Ffd-9.js} +4 -4
- package/lib/index.es.js +1 -1
- package/lib/{schema-tKk3m1fu.js → schema-PTbL6iMu.js} +1 -1
- package/lib/{tippy.esm-MZ2vxByW.js → tippy.esm-lHdsQkl8.js} +33 -33
- package/lib/{tooltip-plugin-gcwyQdiT.js → tooltip-plugin-Pjm6nx6a.js} +32 -29
- package/package.json +14 -14
- package/src/feature/block-edit/handle/index.ts +2 -4
- package/src/feature/block-edit/menu/index.ts +2 -3
- package/src/feature/toolbar/index.ts +2 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as Dr, _ as tt } from "./index-S3dtETwZ.js";
|
|
2
2
|
function Mt(e = 0, t = 0, r = 0) {
|
|
3
3
|
return Math.min(Math.max(e, t), r);
|
|
4
4
|
}
|
|
@@ -95,11 +95,11 @@ function Nt(e) {
|
|
|
95
95
|
}
|
|
96
96
|
var _r = Hr;
|
|
97
97
|
const Ci = /* @__PURE__ */ Dr(_r);
|
|
98
|
-
var $ = "top",
|
|
98
|
+
var $ = "top", X = "bottom", Y = "right", W = "left", xt = "auto", Fe = [$, X, Y, W], Ae = "start", Ve = "end", qr = "clippingParents", Qt = "viewport", Re = "popper", zr = "reference", Rt = /* @__PURE__ */ Fe.reduce(function(e, t) {
|
|
99
99
|
return e.concat([t + "-" + Ae, t + "-" + Ve]);
|
|
100
100
|
}, []), er = /* @__PURE__ */ [].concat(Fe, [xt]).reduce(function(e, t) {
|
|
101
101
|
return e.concat([t, t + "-" + Ae, t + "-" + Ve]);
|
|
102
|
-
}, []),
|
|
102
|
+
}, []), Xr = "beforeRead", Yr = "read", Gr = "afterRead", Kr = "beforeMain", Jr = "main", Zr = "afterMain", Qr = "beforeWrite", en = "write", tn = "afterWrite", rn = [Xr, Yr, Gr, Kr, Jr, Zr, Qr, en, tn];
|
|
103
103
|
function te(e) {
|
|
104
104
|
return e ? (e.nodeName || "").toLowerCase() : null;
|
|
105
105
|
}
|
|
@@ -301,9 +301,9 @@ var cn = function(t, r) {
|
|
|
301
301
|
})) : t, or(typeof t != "number" ? t : ar(t, Fe));
|
|
302
302
|
};
|
|
303
303
|
function fn(e) {
|
|
304
|
-
var t, r = e.state, n = e.name, o = e.options, u = r.elements.arrow, f = r.modifiersData.popperOffsets, c = ee(r.placement), s = At(c), d = [W,
|
|
304
|
+
var t, r = e.state, n = e.name, o = e.options, u = r.elements.arrow, f = r.modifiersData.popperOffsets, c = ee(r.placement), s = At(c), d = [W, Y].indexOf(c) >= 0, p = d ? "height" : "width";
|
|
305
305
|
if (!(!u || !f)) {
|
|
306
|
-
var g = cn(o.padding, r), w = Tt(u), m = s === "y" ? $ : W, O = s === "y" ?
|
|
306
|
+
var g = cn(o.padding, r), w = Tt(u), m = s === "y" ? $ : W, O = s === "y" ? X : Y, b = r.rects.reference[p] + r.rects.reference[s] - f[s] - r.rects.popper[p], y = f[s] - r.rects.reference[s], x = Ue(u), D = x ? s === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, S = b / 2 - y / 2, i = g[m], E = D - w[p] - g[O], l = D / 2 - w[p] / 2 + S, T = ke(i, l, E), j = s;
|
|
307
307
|
r.modifiersData[n] = (t = {}, t[j] = T, t.centerOffset = T - l, t);
|
|
308
308
|
}
|
|
309
309
|
}
|
|
@@ -348,16 +348,16 @@ function Bt(e) {
|
|
|
348
348
|
var x = f.hasOwnProperty("x"), D = f.hasOwnProperty("y"), S = W, i = $, E = window;
|
|
349
349
|
if (d) {
|
|
350
350
|
var l = Ue(r), T = "clientHeight", j = "clientWidth";
|
|
351
|
-
if (l === _(r) && (l = fe(r), se(l).position !== "static" && c === "absolute" && (T = "scrollHeight", j = "scrollWidth")), l = l, o === $ || (o === W || o ===
|
|
352
|
-
i =
|
|
351
|
+
if (l === _(r) && (l = fe(r), se(l).position !== "static" && c === "absolute" && (T = "scrollHeight", j = "scrollWidth")), l = l, o === $ || (o === W || o === Y) && u === Ve) {
|
|
352
|
+
i = X;
|
|
353
353
|
var L = g && l === E && E.visualViewport ? E.visualViewport.height : (
|
|
354
354
|
// $FlowFixMe[prop-missing]
|
|
355
355
|
l[T]
|
|
356
356
|
);
|
|
357
357
|
b -= L - n.height, b *= s ? 1 : -1;
|
|
358
358
|
}
|
|
359
|
-
if (o === W || (o === $ || o ===
|
|
360
|
-
S =
|
|
359
|
+
if (o === W || (o === $ || o === X) && u === Ve) {
|
|
360
|
+
S = Y;
|
|
361
361
|
var P = g && l === E && E.visualViewport ? E.visualViewport.width : (
|
|
362
362
|
// $FlowFixMe[prop-missing]
|
|
363
363
|
l[j]
|
|
@@ -538,13 +538,13 @@ function ur(e) {
|
|
|
538
538
|
y: t.y - r.height
|
|
539
539
|
};
|
|
540
540
|
break;
|
|
541
|
-
case
|
|
541
|
+
case X:
|
|
542
542
|
s = {
|
|
543
543
|
x: f,
|
|
544
544
|
y: t.y + t.height
|
|
545
545
|
};
|
|
546
546
|
break;
|
|
547
|
-
case
|
|
547
|
+
case Y:
|
|
548
548
|
s = {
|
|
549
549
|
x: t.x + t.width,
|
|
550
550
|
y: c
|
|
@@ -592,7 +592,7 @@ function $e(e, t) {
|
|
|
592
592
|
if (w === Re && R) {
|
|
593
593
|
var N = R[o];
|
|
594
594
|
Object.keys(P).forEach(function(M) {
|
|
595
|
-
var H = [
|
|
595
|
+
var H = [Y, X].indexOf(M) >= 0 ? 1 : -1, F = [$, X].indexOf(M) >= 0 ? "y" : "x";
|
|
596
596
|
P[M] += N[F] * H;
|
|
597
597
|
});
|
|
598
598
|
}
|
|
@@ -637,13 +637,13 @@ function Sn(e) {
|
|
|
637
637
|
allowedAutoPlacements: b
|
|
638
638
|
}) : G);
|
|
639
639
|
}, []), E = t.rects.reference, l = t.rects.popper, T = /* @__PURE__ */ new Map(), j = !0, L = i[0], P = 0; P < i.length; P++) {
|
|
640
|
-
var R = i[P], N = ee(R), M = Se(R) === Ae, H = [$,
|
|
640
|
+
var R = i[P], N = ee(R), M = Se(R) === Ae, H = [$, X].indexOf(N) >= 0, F = H ? "width" : "height", B = $e(t, {
|
|
641
641
|
placement: R,
|
|
642
642
|
boundary: p,
|
|
643
643
|
rootBoundary: g,
|
|
644
644
|
altBoundary: w,
|
|
645
645
|
padding: d
|
|
646
|
-
}), I = H ? M ?
|
|
646
|
+
}), I = H ? M ? Y : W : M ? X : $;
|
|
647
647
|
E[F] > l[F] && (I = it(I));
|
|
648
648
|
var k = it(I), K = [];
|
|
649
649
|
if (u && K.push(B[N] <= 0), c && K.push(B[I] <= 0, B[k] <= 0), K.every(function(re) {
|
|
@@ -695,7 +695,7 @@ function $t(e, t, r) {
|
|
|
695
695
|
};
|
|
696
696
|
}
|
|
697
697
|
function Wt(e) {
|
|
698
|
-
return [$,
|
|
698
|
+
return [$, Y, X, W].some(function(t) {
|
|
699
699
|
return e[t] >= 0;
|
|
700
700
|
});
|
|
701
701
|
}
|
|
@@ -726,7 +726,7 @@ function Pn(e, t, r) {
|
|
|
726
726
|
var n = ee(e), o = [W, $].indexOf(n) >= 0 ? -1 : 1, u = typeof r == "function" ? r(Object.assign({}, t, {
|
|
727
727
|
placement: e
|
|
728
728
|
})) : r, f = u[0], c = u[1];
|
|
729
|
-
return f = f || 0, c = (c || 0) * o, [W,
|
|
729
|
+
return f = f || 0, c = (c || 0) * o, [W, Y].indexOf(n) >= 0 ? {
|
|
730
730
|
x: c,
|
|
731
731
|
y: f
|
|
732
732
|
} : {
|
|
@@ -786,14 +786,14 @@ function Vn(e) {
|
|
|
786
786
|
};
|
|
787
787
|
if (l) {
|
|
788
788
|
if (u) {
|
|
789
|
-
var M, H = i === "y" ? $ : W, F = i === "y" ?
|
|
789
|
+
var M, H = i === "y" ? $ : W, F = i === "y" ? X : Y, B = i === "y" ? "height" : "width", I = l[i], k = I + y[H], K = I - y[F], J = m ? -j[B] / 2 : 0, pe = D === Ae ? T[B] : j[B], Z = D === Ae ? -j[B] : -T[B], le = t.elements.arrow, re = m && le ? Tt(le) : {
|
|
790
790
|
width: 0,
|
|
791
791
|
height: 0
|
|
792
792
|
}, G = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : ir(), ne = G[H], ye = G[F], ie = ke(0, T[B], re[B]), be = S ? T[B] / 2 - J - ie - ne - P.mainAxis : pe - ie - ne - P.mainAxis, ue = S ? -T[B] / 2 + J + ie + ye + P.mainAxis : Z + ie + ye + P.mainAxis, we = t.elements.arrow && Ue(t.elements.arrow), _e = we ? i === "y" ? we.clientTop || 0 : we.clientLeft || 0 : 0, je = (M = R == null ? void 0 : R[i]) != null ? M : 0, qe = I + be - je - _e, ze = I + ue - je, Le = ke(m ? ot(k, qe) : k, I, m ? he(K, ze) : K);
|
|
793
793
|
l[i] = Le, N[i] = Le - I;
|
|
794
794
|
}
|
|
795
795
|
if (c) {
|
|
796
|
-
var Me,
|
|
796
|
+
var Me, Xe = i === "x" ? $ : W, Ye = i === "x" ? X : Y, oe = l[E], ce = E === "y" ? "height" : "width", Pe = oe + y[Xe], de = oe - y[Ye], Ne = [$, W].indexOf(x) !== -1, Ge = (Me = R == null ? void 0 : R[E]) != null ? Me : 0, Ke = Ne ? Pe : oe - T[ce] - j[ce] - Ge + P.altAxis, Je = Ne ? oe + T[ce] + j[ce] - Ge - P.altAxis : de, Ze = m && Ne ? un(Ke, oe, Je) : ke(m ? Ke : Pe, oe, m ? Je : de);
|
|
797
797
|
l[E] = Ze, N[E] = Ze - oe;
|
|
798
798
|
}
|
|
799
799
|
t.modifiersData[n] = N;
|
|
@@ -873,7 +873,7 @@ function zn(e) {
|
|
|
873
873
|
})), t;
|
|
874
874
|
};
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Xn(e) {
|
|
877
877
|
var t = e.reduce(function(r, n) {
|
|
878
878
|
var o = r[n.name];
|
|
879
879
|
return r[n.name] = o ? Object.assign({}, o, n, {
|
|
@@ -897,7 +897,7 @@ function Ft() {
|
|
|
897
897
|
return !(n && typeof n.getBoundingClientRect == "function");
|
|
898
898
|
});
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function Yn(e) {
|
|
901
901
|
e === void 0 && (e = {});
|
|
902
902
|
var t = e, r = t.defaultModifiers, n = r === void 0 ? [] : r, o = t.defaultOptions, u = o === void 0 ? Ht : o;
|
|
903
903
|
return function(c, s, d) {
|
|
@@ -921,7 +921,7 @@ function Xn(e) {
|
|
|
921
921
|
reference: ge(c) ? Be(c) : c.contextElement ? Be(c.contextElement) : [],
|
|
922
922
|
popper: Be(s)
|
|
923
923
|
};
|
|
924
|
-
var S = qn(
|
|
924
|
+
var S = qn(Xn([].concat(n, p.options.modifiers)));
|
|
925
925
|
return p.orderedModifiers = S.filter(function(i) {
|
|
926
926
|
return i.enabled;
|
|
927
927
|
}), O(), m.update();
|
|
@@ -996,7 +996,7 @@ function Xn(e) {
|
|
|
996
996
|
return m;
|
|
997
997
|
};
|
|
998
998
|
}
|
|
999
|
-
var Gn = [yn, Bn, hn, tr, Rn, jn, $n, ln, Mn], Kn = /* @__PURE__ */
|
|
999
|
+
var Gn = [yn, Bn, hn, tr, Rn, jn, $n, ln, Mn], Kn = /* @__PURE__ */ Yn({
|
|
1000
1000
|
defaultModifiers: Gn
|
|
1001
1001
|
}), Jn = "tippy-box", cr = "tippy-content", Zn = "tippy-backdrop", fr = "tippy-arrow", pr = "tippy-svg-arrow", me = {
|
|
1002
1002
|
passive: !0,
|
|
@@ -1112,7 +1112,7 @@ function vt(e, t, r) {
|
|
|
1112
1112
|
e[n](o, r);
|
|
1113
1113
|
});
|
|
1114
1114
|
}
|
|
1115
|
-
function
|
|
1115
|
+
function Xt(e, t) {
|
|
1116
1116
|
for (var r = t; r; ) {
|
|
1117
1117
|
var n;
|
|
1118
1118
|
if (e.contains(r))
|
|
@@ -1123,13 +1123,13 @@ function Yt(e, t) {
|
|
|
1123
1123
|
}
|
|
1124
1124
|
var Q = {
|
|
1125
1125
|
isTouch: !1
|
|
1126
|
-
},
|
|
1126
|
+
}, Yt = 0;
|
|
1127
1127
|
function fi() {
|
|
1128
1128
|
Q.isTouch || (Q.isTouch = !0, window.performance && document.addEventListener("mousemove", vr));
|
|
1129
1129
|
}
|
|
1130
1130
|
function vr() {
|
|
1131
1131
|
var e = performance.now();
|
|
1132
|
-
e -
|
|
1132
|
+
e - Yt < 20 && (Q.isTouch = !1, document.removeEventListener("mousemove", vr)), Yt = e;
|
|
1133
1133
|
}
|
|
1134
1134
|
function pi() {
|
|
1135
1135
|
var e = document.activeElement;
|
|
@@ -1471,9 +1471,9 @@ function Ti(e, t) {
|
|
|
1471
1471
|
function Z(a) {
|
|
1472
1472
|
if (!(Q.isTouch && (s || a.type === "mousedown"))) {
|
|
1473
1473
|
var v = a.composedPath && a.composedPath()[0] || a.target;
|
|
1474
|
-
if (!(i.props.interactive &&
|
|
1474
|
+
if (!(i.props.interactive && Xt(l, v))) {
|
|
1475
1475
|
if (Te(i.props.triggerTarget || e).some(function(h) {
|
|
1476
|
-
return
|
|
1476
|
+
return Xt(h, v);
|
|
1477
1477
|
})) {
|
|
1478
1478
|
if (Q.isTouch || i.state.isVisible && i.props.trigger.indexOf("click") >= 0)
|
|
1479
1479
|
return;
|
|
@@ -1593,8 +1593,8 @@ function Ti(e, t) {
|
|
|
1593
1593
|
function Me(a) {
|
|
1594
1594
|
return Q.isTouch ? R() !== a.type.indexOf("touch") >= 0 : !1;
|
|
1595
1595
|
}
|
|
1596
|
-
function
|
|
1597
|
-
|
|
1596
|
+
function Xe() {
|
|
1597
|
+
Ye();
|
|
1598
1598
|
var a = i.props, v = a.popperOptions, h = a.placement, C = a.offset, A = a.getReferenceClientRect, V = a.moveTransition, q = N() ? Ot(l).arrow : null, Oe = A ? {
|
|
1599
1599
|
getBoundingClientRect: A,
|
|
1600
1600
|
contextElement: A.contextElement || M()
|
|
@@ -1650,12 +1650,12 @@ function Ti(e, t) {
|
|
|
1650
1650
|
modifiers: ve
|
|
1651
1651
|
}));
|
|
1652
1652
|
}
|
|
1653
|
-
function
|
|
1653
|
+
function Ye() {
|
|
1654
1654
|
i.popperInstance && (i.popperInstance.destroy(), i.popperInstance = null);
|
|
1655
1655
|
}
|
|
1656
1656
|
function oe() {
|
|
1657
1657
|
var a = i.props.appendTo, v, h = M();
|
|
1658
|
-
i.props.interactive && a === lr || a === "parent" ? v = h.parentNode : v = dr(a, [h]), v.contains(l) || v.appendChild(l), i.state.isMounted = !0,
|
|
1658
|
+
i.props.interactive && a === lr || a === "parent" ? v = h.parentNode : v = dr(a, [h]), v.contains(l) || v.appendChild(l), i.state.isMounted = !0, Xe(), process.env.NODE_ENV !== "production" && ae(i.props.interactive && a === U.appendTo && h.nextElementSibling !== l, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", `
|
|
1659
1659
|
|
|
1660
1660
|
`, "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", `
|
|
1661
1661
|
|
|
@@ -1704,7 +1704,7 @@ function Ti(e, t) {
|
|
|
1704
1704
|
}));
|
|
1705
1705
|
i.props = h, we(), v.interactiveDebounce !== h.interactiveDebounce && (pe(), O = Ut(qe, h.interactiveDebounce)), v.triggerTarget && !h.triggerTarget ? Te(v.triggerTarget).forEach(function(C) {
|
|
1706
1706
|
C.removeAttribute("aria-expanded");
|
|
1707
|
-
}) : h.triggerTarget && e.removeAttribute("aria-expanded"), J(), I(), T && T(v, h), i.popperInstance && (
|
|
1707
|
+
}) : h.triggerTarget && e.removeAttribute("aria-expanded"), J(), I(), T && T(v, h), i.popperInstance && (Xe(), ce().forEach(function(C) {
|
|
1708
1708
|
requestAnimationFrame(C._tippy.popperInstance.forceUpdate);
|
|
1709
1709
|
})), k("onAfterUpdate", [i, a]);
|
|
1710
1710
|
}
|
|
@@ -1751,7 +1751,7 @@ function Ti(e, t) {
|
|
|
1751
1751
|
process.env.NODE_ENV !== "production" && ae(i.state.isDestroyed, Ee("hideWithInteractivity")), H().addEventListener("mousemove", O), _t(nt, O), O(a);
|
|
1752
1752
|
}
|
|
1753
1753
|
function Er() {
|
|
1754
|
-
process.env.NODE_ENV !== "production" && ae(i.state.isDestroyed, Ee("unmount")), i.state.isVisible && i.hide(), i.state.isMounted && (
|
|
1754
|
+
process.env.NODE_ENV !== "production" && ae(i.state.isDestroyed, Ee("unmount")), i.state.isVisible && i.hide(), i.state.isMounted && (Ye(), ce().forEach(function(a) {
|
|
1755
1755
|
a._tippy.unmount();
|
|
1756
1756
|
}), l.parentNode && l.parentNode.removeChild(l), mt = mt.filter(function(a) {
|
|
1757
1757
|
return a !== i;
|
|
@@ -7,50 +7,50 @@ var s = (e, o, t) => (x(e, o, "read from private field"), t ? t.call(e) : o.get(
|
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
o instanceof WeakSet ? o.add(e) : o.set(e, t);
|
|
9
9
|
}, p = (e, o, t, i) => (x(e, o, "write to private field"), i ? i.call(e, t) : o.set(e, t), t);
|
|
10
|
-
var
|
|
11
|
-
import { w
|
|
12
|
-
import { l as b, e as
|
|
13
|
-
import { $ as
|
|
14
|
-
import { t as E, p as F, d as q } from "./tippy.esm-
|
|
10
|
+
var S = (e, o, t) => (x(e, o, "access private method"), t);
|
|
11
|
+
import { w, h as O } from "./meta-tAGyVRPE.js";
|
|
12
|
+
import { l as b, e as A, t as B } from "./icons-HYkfuR-O.js";
|
|
13
|
+
import { $ as f, T as N, y as M, P as R, A as _ } from "./index-S3dtETwZ.js";
|
|
14
|
+
import { t as E, p as F, d as q } from "./tippy.esm-lHdsQkl8.js";
|
|
15
15
|
const K = {
|
|
16
16
|
mode: "preview"
|
|
17
|
-
},
|
|
18
|
-
L
|
|
17
|
+
}, L = f({ ...K }, "linkTooltipStateCtx");
|
|
18
|
+
w(L, {
|
|
19
19
|
displayName: "State<link-tooltip>",
|
|
20
20
|
group: "LinkTooltip"
|
|
21
21
|
});
|
|
22
|
-
const
|
|
22
|
+
const D = {
|
|
23
23
|
addLink: () => {
|
|
24
24
|
},
|
|
25
25
|
editLink: () => {
|
|
26
26
|
},
|
|
27
27
|
removeLink: () => {
|
|
28
28
|
}
|
|
29
|
-
}, Q =
|
|
30
|
-
L
|
|
29
|
+
}, Q = f({ ...D }, "linkTooltipAPICtx");
|
|
30
|
+
w(L, {
|
|
31
31
|
displayName: "API<link-tooltip>",
|
|
32
32
|
group: "LinkTooltip"
|
|
33
33
|
});
|
|
34
|
-
const
|
|
34
|
+
const H = {
|
|
35
35
|
linkIcon: () => b,
|
|
36
|
-
editButton: () =>
|
|
37
|
-
removeButton: () =>
|
|
36
|
+
editButton: () => A,
|
|
37
|
+
removeButton: () => B,
|
|
38
38
|
confirmButton: () => O`Confirm ⏎`,
|
|
39
39
|
onCopyLink: () => {
|
|
40
40
|
},
|
|
41
41
|
inputPlaceholder: "Paste link..."
|
|
42
|
-
}, V =
|
|
43
|
-
...
|
|
42
|
+
}, V = f({
|
|
43
|
+
...H
|
|
44
44
|
}, "linkTooltipConfigCtx");
|
|
45
|
-
L
|
|
45
|
+
w(L, {
|
|
46
46
|
displayName: "Config<link-tooltip>",
|
|
47
47
|
group: "LinkTooltip"
|
|
48
48
|
});
|
|
49
|
-
var n, r, h,
|
|
49
|
+
var n, r, h, u, d, y, $;
|
|
50
50
|
class W {
|
|
51
51
|
constructor(o) {
|
|
52
52
|
/// @internal
|
|
53
|
-
l(this,
|
|
53
|
+
l(this, y);
|
|
54
54
|
/// @internal
|
|
55
55
|
l(this, n, void 0);
|
|
56
56
|
/// @internal
|
|
@@ -58,17 +58,20 @@ class W {
|
|
|
58
58
|
/// @internal
|
|
59
59
|
l(this, h, void 0);
|
|
60
60
|
/// @internal
|
|
61
|
-
l(this, m, void 0);
|
|
62
61
|
l(this, u, void 0);
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
l(this, d, void 0);
|
|
63
|
+
p(this, d, (t, i) => {
|
|
64
|
+
const { state: a, composing: c } = t, { selection: m, doc: g } = a, { ranges: k } = m, T = Math.min(...k.map((C) => C.$from.pos)), P = Math.max(...k.map((C) => C.$to.pos)), I = i && i.doc.eq(g) && i.selection.eq(m);
|
|
65
65
|
if (s(this, n) ?? p(this, n, E(t.dom, {
|
|
66
66
|
trigger: "manual",
|
|
67
67
|
interactive: !0,
|
|
68
|
+
delay: 0,
|
|
69
|
+
arrow: !1,
|
|
70
|
+
duration: 0,
|
|
68
71
|
...s(this, r),
|
|
69
72
|
content: this.element
|
|
70
73
|
})), !(c || I)) {
|
|
71
|
-
if (!s(this,
|
|
74
|
+
if (!s(this, u).call(this, t, i)) {
|
|
72
75
|
this.hide();
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
@@ -77,7 +80,7 @@ class W {
|
|
|
77
80
|
}), this.show();
|
|
78
81
|
}
|
|
79
82
|
}), this.update = (t, i) => {
|
|
80
|
-
q(s(this,
|
|
83
|
+
q(s(this, d), s(this, h))(t, i);
|
|
81
84
|
}, this.destroy = () => {
|
|
82
85
|
var t;
|
|
83
86
|
(t = s(this, n)) == null || t.destroy();
|
|
@@ -87,15 +90,15 @@ class W {
|
|
|
87
90
|
}, this.hide = () => {
|
|
88
91
|
var t;
|
|
89
92
|
(t = s(this, n)) == null || t.hide();
|
|
90
|
-
}, this.getInstance = () => s(this, n), this.element = o.content, p(this, r, o.tippyOptions ?? {}), p(this, h, o.debounce ?? 200), p(this,
|
|
93
|
+
}, this.getInstance = () => s(this, n), this.element = o.content, p(this, r, o.tippyOptions ?? {}), p(this, h, o.debounce ?? 200), p(this, u, o.shouldShow ?? S(this, y, $));
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
|
-
n = new WeakMap(), r = new WeakMap(), h = new WeakMap(),
|
|
94
|
-
const { doc: t, selection: i } = o.state, { empty: a, from: c, to:
|
|
95
|
-
return !(T || a ||
|
|
96
|
+
n = new WeakMap(), r = new WeakMap(), h = new WeakMap(), u = new WeakMap(), d = new WeakMap(), y = new WeakSet(), $ = function(o) {
|
|
97
|
+
const { doc: t, selection: i } = o.state, { empty: a, from: c, to: m } = i, g = !t.textBetween(c, m).length && o.state.selection instanceof N, k = this.element.contains(document.activeElement), T = !o.hasFocus() && !k, P = !o.editable;
|
|
98
|
+
return !(T || a || g || P);
|
|
96
99
|
};
|
|
97
100
|
function X(e) {
|
|
98
|
-
const o =
|
|
101
|
+
const o = f({}, `${e}_TOOLTIP_SPEC`), t = M((a) => {
|
|
99
102
|
const c = a.get(o.key);
|
|
100
103
|
return new R({
|
|
101
104
|
key: new _(`${e}_TOOLTIP`),
|
|
@@ -113,7 +116,7 @@ function X(e) {
|
|
|
113
116
|
export {
|
|
114
117
|
W as T,
|
|
115
118
|
Q as a,
|
|
116
|
-
|
|
119
|
+
L as b,
|
|
117
120
|
V as l,
|
|
118
121
|
X as t
|
|
119
122
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milkdown/crepe",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.3.
|
|
4
|
+
"version": "7.3.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"nanoid": "^5.0.0",
|
|
40
40
|
"thememirror": "^2.0.1",
|
|
41
41
|
"tslib": "^2.5.0",
|
|
42
|
-
"@milkdown/components": "7.3.
|
|
43
|
-
"@milkdown/core": "7.3.
|
|
44
|
-
"@milkdown/ctx": "7.3.
|
|
45
|
-
"@milkdown/plugin-block": "7.3.
|
|
46
|
-
"@milkdown/plugin-clipboard": "7.3.
|
|
47
|
-
"@milkdown/plugin-cursor": "7.3.
|
|
48
|
-
"@milkdown/plugin-
|
|
49
|
-
"@milkdown/plugin-
|
|
50
|
-
"@milkdown/plugin-
|
|
51
|
-
"@milkdown/plugin-
|
|
52
|
-
"@milkdown/preset-commonmark": "7.3.
|
|
53
|
-
"@milkdown/prose": "7.3.
|
|
54
|
-
"@milkdown/utils": "7.3.
|
|
42
|
+
"@milkdown/components": "7.3.5",
|
|
43
|
+
"@milkdown/core": "7.3.5",
|
|
44
|
+
"@milkdown/ctx": "7.3.5",
|
|
45
|
+
"@milkdown/plugin-block": "7.3.5",
|
|
46
|
+
"@milkdown/plugin-clipboard": "7.3.5",
|
|
47
|
+
"@milkdown/plugin-cursor": "7.3.5",
|
|
48
|
+
"@milkdown/plugin-history": "7.3.5",
|
|
49
|
+
"@milkdown/plugin-indent": "7.3.5",
|
|
50
|
+
"@milkdown/plugin-slash": "7.3.5",
|
|
51
|
+
"@milkdown/plugin-tooltip": "7.3.5",
|
|
52
|
+
"@milkdown/preset-commonmark": "7.3.5",
|
|
53
|
+
"@milkdown/prose": "7.3.5",
|
|
54
|
+
"@milkdown/utils": "7.3.5"
|
|
55
55
|
},
|
|
56
56
|
"nx": {
|
|
57
57
|
"targets": {
|
|
@@ -5,7 +5,7 @@ import { BlockProvider, block } from '@milkdown/plugin-block'
|
|
|
5
5
|
import type { Ctx } from '@milkdown/ctx'
|
|
6
6
|
import type { EditorView } from '@milkdown/prose/view'
|
|
7
7
|
import type { AtomicoThis } from 'atomico/types/dom'
|
|
8
|
-
import { editorViewCtx } from '@milkdown/core'
|
|
8
|
+
import { editorViewCtx, rootDOMCtx } from '@milkdown/core'
|
|
9
9
|
import { paragraphSchema } from '@milkdown/preset-commonmark'
|
|
10
10
|
import { menuAPI } from '../menu'
|
|
11
11
|
import type { BlockHandleProps } from './component'
|
|
@@ -25,9 +25,7 @@ export class BlockHandleView implements PluginView {
|
|
|
25
25
|
ctx,
|
|
26
26
|
content,
|
|
27
27
|
tippyOptions: {
|
|
28
|
-
|
|
29
|
-
delay: 0,
|
|
30
|
-
duration: 0,
|
|
28
|
+
appendTo: () => ctx.get(rootDOMCtx),
|
|
31
29
|
onShow: () => {
|
|
32
30
|
this.#content.show = true
|
|
33
31
|
},
|
|
@@ -5,6 +5,7 @@ import { SlashProvider, slashFactory } from '@milkdown/plugin-slash'
|
|
|
5
5
|
import type { Ctx } from '@milkdown/ctx'
|
|
6
6
|
import type { AtomicoThis } from 'atomico/types/dom'
|
|
7
7
|
import { $ctx } from '@milkdown/utils'
|
|
8
|
+
import { rootDOMCtx } from '@milkdown/core'
|
|
8
9
|
import { isInCodeBlock, isInList } from '../../../utils'
|
|
9
10
|
import type { MenuProps } from './component'
|
|
10
11
|
import { MenuElement } from './component'
|
|
@@ -43,9 +44,7 @@ class MenuView implements PluginView {
|
|
|
43
44
|
content: this.#content,
|
|
44
45
|
debounce: 20,
|
|
45
46
|
tippyOptions: {
|
|
46
|
-
|
|
47
|
-
delay: 0,
|
|
48
|
-
duration: 0,
|
|
47
|
+
appendTo: () => ctx.get(rootDOMCtx),
|
|
49
48
|
onShow: () => {
|
|
50
49
|
this.#content.show = true
|
|
51
50
|
},
|
|
@@ -5,6 +5,7 @@ import { TextSelection } from '@milkdown/prose/state'
|
|
|
5
5
|
import type { Ctx } from '@milkdown/ctx'
|
|
6
6
|
import type { EditorView } from '@milkdown/prose/view'
|
|
7
7
|
import type { AtomicoThis } from 'atomico/types/dom'
|
|
8
|
+
import { rootDOMCtx } from '@milkdown/core'
|
|
8
9
|
import type { DefineFeature } from '../shared'
|
|
9
10
|
import { injectStyle } from '../../core/slice'
|
|
10
11
|
import type { ToolbarProps } from './component'
|
|
@@ -26,9 +27,7 @@ class ToolbarView implements PluginView {
|
|
|
26
27
|
content: this.#content,
|
|
27
28
|
debounce: 20,
|
|
28
29
|
tippyOptions: {
|
|
29
|
-
|
|
30
|
-
delay: 0,
|
|
31
|
-
duration: 0,
|
|
30
|
+
appendTo: () => ctx.get(rootDOMCtx),
|
|
32
31
|
onShow: () => {
|
|
33
32
|
this.#content.show = true
|
|
34
33
|
},
|