@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,14 +1,14 @@
|
|
|
1
|
-
import { L as P, a as q, s as g, t as r, p as l } from "./index-
|
|
2
|
-
import { html as c } from "./index-
|
|
3
|
-
import { javascriptLanguage as s } from "./index-
|
|
4
|
-
import { L as m, E as p } from "./index-
|
|
1
|
+
import { L as P, a as q, s as g, t as r, p as l } from "./index-iECr6hjv.js";
|
|
2
|
+
import { html as c } from "./index-sAnPFt21.js";
|
|
3
|
+
import { javascriptLanguage as s } from "./index-f8O1bHwz.js";
|
|
4
|
+
import { L as m, E as p } from "./index-4p4g7ekJ.js";
|
|
5
5
|
import "./meta-tAGyVRPE.js";
|
|
6
6
|
import "./icons-HYkfuR-O.js";
|
|
7
|
-
import "./index-
|
|
7
|
+
import "./index-S3dtETwZ.js";
|
|
8
8
|
import "./hooks-82sqkbtE.js";
|
|
9
|
-
import "./
|
|
9
|
+
import "./index-K_kBonEs.js";
|
|
10
10
|
import "./clsx-7d8NmkQq.js";
|
|
11
|
-
import "./index-
|
|
11
|
+
import "./index-zY_Ffd-9.js";
|
|
12
12
|
const R = 1, b = 33, $ = 34, v = 35, x = 36, W = /* @__PURE__ */ new p((O) => {
|
|
13
13
|
let t = O.pos;
|
|
14
14
|
for (; ; ) {
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O = (n, t, r) => {
|
|
2
2
|
if (!t.has(n))
|
|
3
3
|
throw TypeError("Cannot " + r);
|
|
4
4
|
};
|
|
5
|
-
var i = (n, t, r) => (
|
|
5
|
+
var i = (n, t, r) => (O(n, t, "read from private field"), r ? r.call(n) : t.get(n)), c = (n, t, r) => {
|
|
6
6
|
if (t.has(n))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(n) : t.set(n, r);
|
|
9
|
-
}, d = (n, t, r, e) => (
|
|
10
|
-
import { t as j,
|
|
11
|
-
import { w as
|
|
12
|
-
import { d as R, f as _, T as
|
|
13
|
-
import { d as
|
|
14
|
-
import { u as
|
|
15
|
-
import { c as
|
|
9
|
+
}, d = (n, t, r, e) => (O(n, t, "write to private field"), e ? e.call(n, r) : t.set(n, r), r);
|
|
10
|
+
import { t as j, l as D, a as B, b as H, T as z } from "./tooltip-plugin-Pjm6nx6a.js";
|
|
11
|
+
import { w as V, c as K, h as M, u as Q, a as U } from "./meta-tAGyVRPE.js";
|
|
12
|
+
import { d as R, f as Y, g as _, T as tt, i as et } from "./index-S3dtETwZ.js";
|
|
13
|
+
import { d as it, p as q } from "./tippy.esm-lHdsQkl8.js";
|
|
14
|
+
import { u as nt } from "./hooks-82sqkbtE.js";
|
|
15
|
+
import { c as ot } from "./clsx-7d8NmkQq.js";
|
|
16
16
|
import "./icons-HYkfuR-O.js";
|
|
17
17
|
const $ = j("LINK_PREVIEW");
|
|
18
|
-
|
|
18
|
+
V($[0], {
|
|
19
19
|
displayName: "PreviewTooltipSpec<link-tooltip>",
|
|
20
20
|
group: "LinkTooltip"
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
V($[1], {
|
|
23
23
|
displayName: "PreviewTooltipPlugin<link-tooltip>",
|
|
24
24
|
group: "LinkTooltip"
|
|
25
25
|
});
|
|
26
26
|
const Z = j("LINK_EDIT");
|
|
27
|
-
|
|
27
|
+
V(Z[0], {
|
|
28
28
|
displayName: "EditTooltipSpec<link-tooltip>",
|
|
29
29
|
group: "LinkTooltip"
|
|
30
30
|
});
|
|
31
|
-
|
|
31
|
+
V(Z[1], {
|
|
32
32
|
displayName: "EditTooltipPlugin<link-tooltip>",
|
|
33
33
|
group: "LinkTooltip"
|
|
34
34
|
});
|
|
35
|
-
function
|
|
35
|
+
function st(n, t, r, e) {
|
|
36
36
|
let o = { start: -1, end: -1 };
|
|
37
37
|
return t.nodesBetween(r, e, (s, p) => {
|
|
38
38
|
if (o.start > -1)
|
|
@@ -43,7 +43,7 @@ function ot(n, t, r, e) {
|
|
|
43
43
|
});
|
|
44
44
|
}), o;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function rt(n, t, r) {
|
|
47
47
|
const e = t.posAtCoords({ left: r.clientX, top: r.clientY });
|
|
48
48
|
if (!e)
|
|
49
49
|
return;
|
|
@@ -54,7 +54,7 @@ function st(n, t, r) {
|
|
|
54
54
|
if (!(!p || !$.pluginKey()))
|
|
55
55
|
return { show: !0, pos: o, node: s, mark: p };
|
|
56
56
|
}
|
|
57
|
-
const
|
|
57
|
+
const W = ({ config: n, src: t, onEdit: r, onRemove: e }) => {
|
|
58
58
|
const o = (l) => {
|
|
59
59
|
l.stopPropagation(), l.preventDefault(), r == null || r();
|
|
60
60
|
}, s = (l) => {
|
|
@@ -83,34 +83,25 @@ const q = ({ config: n, src: t, onEdit: r, onRemove: e }) => {
|
|
|
83
83
|
</host>
|
|
84
84
|
`;
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
W.props = {
|
|
87
87
|
config: Object,
|
|
88
88
|
src: String,
|
|
89
89
|
onEdit: Function,
|
|
90
90
|
onRemove: Function
|
|
91
91
|
};
|
|
92
|
-
const
|
|
93
|
-
var u, w,
|
|
94
|
-
class
|
|
92
|
+
const X = K(W);
|
|
93
|
+
var u, w, f, x, T, L, b, C, y;
|
|
94
|
+
class lt {
|
|
95
95
|
constructor(t, r) {
|
|
96
96
|
c(this, x);
|
|
97
97
|
c(this, u, void 0);
|
|
98
98
|
c(this, w, void 0);
|
|
99
|
-
c(this,
|
|
99
|
+
c(this, f, void 0);
|
|
100
100
|
c(this, L, void 0);
|
|
101
101
|
c(this, b, void 0);
|
|
102
102
|
c(this, C, void 0);
|
|
103
103
|
c(this, y, void 0);
|
|
104
|
-
this.ctx = t, d(this, u, new
|
|
105
|
-
debounce: 0,
|
|
106
|
-
content: i(this, u),
|
|
107
|
-
shouldShow: () => !1,
|
|
108
|
-
tippyOptions: {
|
|
109
|
-
arrow: !1,
|
|
110
|
-
delay: 0,
|
|
111
|
-
duration: 0
|
|
112
|
-
}
|
|
113
|
-
})), d(this, g, !1), this.setRect = (e) => {
|
|
104
|
+
this.ctx = t, d(this, u, new X()), d(this, f, !1), this.setRect = (e) => {
|
|
114
105
|
var o;
|
|
115
106
|
(o = i(this, w).getInstance()) == null || o.setProps({
|
|
116
107
|
getReferenceClientRect: () => e
|
|
@@ -118,41 +109,48 @@ class rt {
|
|
|
118
109
|
}, d(this, L, ({ mode: e }) => {
|
|
119
110
|
e === "edit" && i(this, y).call(this);
|
|
120
111
|
}), d(this, b, () => {
|
|
121
|
-
d(this,
|
|
112
|
+
d(this, f, !0);
|
|
122
113
|
}), d(this, C, () => {
|
|
123
|
-
d(this,
|
|
114
|
+
d(this, f, !1);
|
|
124
115
|
}), d(this, y, () => {
|
|
125
116
|
var e, o;
|
|
126
117
|
i(this, w).hide(), (e = i(this, x, T)) == null || e.popper.addEventListener("mouseenter", i(this, b)), (o = i(this, x, T)) == null || o.popper.addEventListener("mouseleave", i(this, C));
|
|
127
118
|
}), this.show = (e, o, s) => {
|
|
128
119
|
var l, a;
|
|
129
|
-
const p = this.ctx.get(
|
|
120
|
+
const p = this.ctx.get(D.key);
|
|
130
121
|
i(this, u).config = p, i(this, u).src = e.attrs.href, i(this, u).onEdit = () => {
|
|
131
122
|
this.ctx.get(B.key).editLink(e, o, s);
|
|
132
123
|
}, i(this, u).onRemove = () => {
|
|
133
124
|
this.ctx.get(B.key).removeLink(o, s), i(this, y).call(this);
|
|
134
125
|
}, i(this, w).show(), (l = i(this, x, T)) == null || l.popper.addEventListener("mouseenter", i(this, b)), (a = i(this, x, T)) == null || a.popper.addEventListener("mouseleave", i(this, C));
|
|
135
126
|
}, this.hide = () => {
|
|
136
|
-
i(this,
|
|
127
|
+
i(this, f) || i(this, y).call(this);
|
|
137
128
|
}, this.update = () => {
|
|
138
129
|
}, this.destroy = () => {
|
|
139
130
|
this.ctx.use(H.key).off(i(this, L)), i(this, w).destroy(), i(this, u).remove();
|
|
140
|
-
},
|
|
131
|
+
}, d(this, w, new z({
|
|
132
|
+
debounce: 0,
|
|
133
|
+
content: i(this, u),
|
|
134
|
+
shouldShow: () => !1,
|
|
135
|
+
tippyOptions: {
|
|
136
|
+
appendTo: () => t.get(Y)
|
|
137
|
+
}
|
|
138
|
+
})), i(this, w).update(r), t.use(H.key).on(i(this, L));
|
|
141
139
|
}
|
|
142
140
|
}
|
|
143
|
-
u = new WeakMap(), w = new WeakMap(),
|
|
141
|
+
u = new WeakMap(), w = new WeakMap(), f = new WeakMap(), x = new WeakSet(), T = function() {
|
|
144
142
|
return i(this, w).getInstance();
|
|
145
143
|
}, L = new WeakMap(), b = new WeakMap(), C = new WeakMap(), y = new WeakMap();
|
|
146
|
-
customElements.define("milkdown-link-preview",
|
|
147
|
-
function
|
|
144
|
+
customElements.define("milkdown-link-preview", X);
|
|
145
|
+
function pt(n) {
|
|
148
146
|
let t;
|
|
149
|
-
const e =
|
|
147
|
+
const e = it((s, p) => {
|
|
150
148
|
if (!t || !s.hasFocus() || n.get(H.key).mode === "edit")
|
|
151
149
|
return;
|
|
152
|
-
const a =
|
|
150
|
+
const a = rt(n, s, p);
|
|
153
151
|
if (a) {
|
|
154
|
-
const h = s.state.doc.resolve(a.pos), E =
|
|
155
|
-
t.setRect(
|
|
152
|
+
const h = s.state.doc.resolve(a.pos), E = st(a.mark, s.state.doc, h.before(), h.after()), F = E.start, A = E.end;
|
|
153
|
+
t.setRect(q(s, F, A)), t.show(a.mark, F, A);
|
|
156
154
|
return;
|
|
157
155
|
}
|
|
158
156
|
t.hide();
|
|
@@ -168,17 +166,17 @@ function lt(n) {
|
|
|
168
166
|
mouseleave: o
|
|
169
167
|
}
|
|
170
168
|
},
|
|
171
|
-
view: (s) => (t = new
|
|
169
|
+
view: (s) => (t = new lt(n, s), t)
|
|
172
170
|
});
|
|
173
171
|
}
|
|
174
|
-
const
|
|
172
|
+
const G = ({
|
|
175
173
|
src: n,
|
|
176
174
|
onConfirm: t,
|
|
177
175
|
onCancel: r,
|
|
178
176
|
config: e
|
|
179
177
|
}) => {
|
|
180
|
-
const o =
|
|
181
|
-
|
|
178
|
+
const o = Q(), [s, p] = nt(n);
|
|
179
|
+
U(() => {
|
|
182
180
|
p(n ?? "");
|
|
183
181
|
}, [n]);
|
|
184
182
|
const l = () => {
|
|
@@ -199,39 +197,39 @@ const X = ({
|
|
|
199
197
|
oninput=${(h) => p(h.target.value)}
|
|
200
198
|
value=${s}
|
|
201
199
|
/>
|
|
202
|
-
<span class=${
|
|
200
|
+
<span class=${ot("button confirm", s.length === 0 && "hidden")} onclick=${l}>
|
|
203
201
|
${e == null ? void 0 : e.confirmButton()}
|
|
204
202
|
</span>
|
|
205
203
|
</div>
|
|
206
204
|
</host>
|
|
207
205
|
`;
|
|
208
206
|
};
|
|
209
|
-
|
|
207
|
+
G.props = {
|
|
210
208
|
config: Object,
|
|
211
209
|
src: String,
|
|
212
210
|
onConfirm: Function,
|
|
213
211
|
onCancel: Function
|
|
214
212
|
};
|
|
215
|
-
const
|
|
213
|
+
const J = K(G), N = {
|
|
216
214
|
from: -1,
|
|
217
215
|
to: -1,
|
|
218
216
|
mark: null
|
|
219
217
|
};
|
|
220
|
-
var k, m, v,
|
|
221
|
-
class
|
|
218
|
+
var k, m, v, g, I, S, P;
|
|
219
|
+
class at {
|
|
222
220
|
constructor(t, r) {
|
|
223
221
|
c(this, k, void 0);
|
|
224
222
|
c(this, m, void 0);
|
|
225
223
|
c(this, v, void 0);
|
|
226
|
-
c(this,
|
|
224
|
+
c(this, g, void 0);
|
|
227
225
|
c(this, I, void 0);
|
|
228
226
|
c(this, S, void 0);
|
|
229
227
|
c(this, P, void 0);
|
|
230
|
-
this.ctx = t, d(this, k, new
|
|
228
|
+
this.ctx = t, d(this, k, new J()), d(this, v, { ...N }), d(this, g, () => {
|
|
231
229
|
i(this, m).hide(), this.ctx.update(H.key, (e) => ({
|
|
232
230
|
...e,
|
|
233
231
|
mode: "preview"
|
|
234
|
-
})), d(this, v, { ...
|
|
232
|
+
})), d(this, v, { ...N });
|
|
235
233
|
}), d(this, I, (e) => {
|
|
236
234
|
var o;
|
|
237
235
|
(o = i(this, m).getInstance()) == null || o.setProps({
|
|
@@ -240,25 +238,25 @@ class pt {
|
|
|
240
238
|
}), d(this, S, (e) => {
|
|
241
239
|
const o = this.ctx.get(_), { from: s, to: p, mark: l } = i(this, v), a = R.type(this.ctx);
|
|
242
240
|
if (l && l.attrs.href === e) {
|
|
243
|
-
i(this,
|
|
241
|
+
i(this, g).call(this);
|
|
244
242
|
return;
|
|
245
243
|
}
|
|
246
244
|
const h = o.state.tr;
|
|
247
|
-
l && h.removeMark(s, p, l), h.addMark(s, p, a.create({ href: e })), o.dispatch(h), i(this,
|
|
245
|
+
l && h.removeMark(s, p, l), h.addMark(s, p, a.create({ href: e })), o.dispatch(h), i(this, g).call(this);
|
|
248
246
|
}), d(this, P, (e, o, s) => {
|
|
249
|
-
const p = this.ctx.get(
|
|
247
|
+
const p = this.ctx.get(D.key);
|
|
250
248
|
i(this, k).config = p, i(this, k).src = e, this.ctx.update(H.key, (a) => ({
|
|
251
249
|
...a,
|
|
252
250
|
mode: "edit"
|
|
253
251
|
}));
|
|
254
252
|
const l = this.ctx.get(_);
|
|
255
|
-
i(this, I).call(this,
|
|
253
|
+
i(this, I).call(this, q(l, o, s)), l.dispatch(l.state.tr.setSelection(tt.create(l.state.doc, o, s))), i(this, m).show(), requestAnimationFrame(() => {
|
|
256
254
|
var a;
|
|
257
255
|
(a = i(this, k).querySelector("input")) == null || a.focus();
|
|
258
256
|
});
|
|
259
257
|
}), this.update = (e) => {
|
|
260
258
|
const { state: o } = e, { selection: s } = o, { from: p, to: l } = s;
|
|
261
|
-
p === i(this, v).from && l === i(this, v).to || i(this,
|
|
259
|
+
p === i(this, v).from && l === i(this, v).to || i(this, g).call(this);
|
|
262
260
|
}, this.destroy = () => {
|
|
263
261
|
i(this, m).destroy(), i(this, k).remove();
|
|
264
262
|
}, this.addLink = (e, o) => {
|
|
@@ -275,27 +273,25 @@ class pt {
|
|
|
275
273
|
}), i(this, P).call(this, e.attrs.href, o, s);
|
|
276
274
|
}, this.removeLink = (e, o) => {
|
|
277
275
|
const s = this.ctx.get(_), p = s.state.tr;
|
|
278
|
-
p.removeMark(e, o, R.type(this.ctx)), s.dispatch(p), i(this,
|
|
276
|
+
p.removeMark(e, o, R.type(this.ctx)), s.dispatch(p), i(this, g).call(this);
|
|
279
277
|
}, d(this, m, new z({
|
|
280
278
|
content: i(this, k),
|
|
281
279
|
debounce: 0,
|
|
282
280
|
shouldShow: () => !1,
|
|
283
281
|
tippyOptions: {
|
|
284
|
-
|
|
285
|
-
delay: 0,
|
|
286
|
-
duration: 0,
|
|
282
|
+
appendTo: () => t.get(Y),
|
|
287
283
|
onHidden: () => {
|
|
288
284
|
i(this, k).update().catch((e) => {
|
|
289
285
|
throw e;
|
|
290
286
|
}), t.get(_).dom.focus();
|
|
291
287
|
}
|
|
292
288
|
}
|
|
293
|
-
})), i(this, m).update(r), i(this, k).onConfirm = i(this, S), i(this, k).onCancel = i(this,
|
|
289
|
+
})), i(this, m).update(r), i(this, k).onConfirm = i(this, S), i(this, k).onCancel = i(this, g);
|
|
294
290
|
}
|
|
295
291
|
}
|
|
296
|
-
k = new WeakMap(), m = new WeakMap(), v = new WeakMap(),
|
|
297
|
-
customElements.define("milkdown-link-edit",
|
|
298
|
-
function
|
|
292
|
+
k = new WeakMap(), m = new WeakMap(), v = new WeakMap(), g = new WeakMap(), I = new WeakMap(), S = new WeakMap(), P = new WeakMap();
|
|
293
|
+
customElements.define("milkdown-link-edit", J);
|
|
294
|
+
function dt(n) {
|
|
299
295
|
let t;
|
|
300
296
|
n.update(B.key, (r) => ({
|
|
301
297
|
...r,
|
|
@@ -309,17 +305,17 @@ function at(n) {
|
|
|
309
305
|
t == null || t.removeLink(e, o);
|
|
310
306
|
}
|
|
311
307
|
})), n.set(Z.key, {
|
|
312
|
-
view: (r) => (t = new
|
|
308
|
+
view: (r) => (t = new at(n, r), t)
|
|
313
309
|
});
|
|
314
310
|
}
|
|
315
|
-
function
|
|
316
|
-
|
|
311
|
+
function ht(n) {
|
|
312
|
+
pt(n), dt(n);
|
|
317
313
|
}
|
|
318
|
-
const
|
|
314
|
+
const ct = [H, B, D, $, Z].flat(), kt = M`
|
|
319
315
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
320
316
|
<path d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z" fill="#817567"/>
|
|
321
317
|
</svg>
|
|
322
|
-
`,
|
|
318
|
+
`, ut = M`
|
|
323
319
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
324
320
|
<g clip-path="url(#clip0_1013_1585)">
|
|
325
321
|
<path d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z" fill="#817567"/>
|
|
@@ -330,7 +326,7 @@ const ht = [H, B, V, $, Z].flat(), ct = M`
|
|
|
330
326
|
</clipPath>
|
|
331
327
|
</defs>
|
|
332
328
|
</svg>
|
|
333
|
-
`,
|
|
329
|
+
`, wt = M`
|
|
334
330
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
335
331
|
<g clip-path="url(#clip0_1013_1627)">
|
|
336
332
|
<path d="M6 19C6 20.1 6.9 21 8 21H16C17.1 21 18 20.1 18 19V9C18 7.9 17.1 7 16 7H8C6.9 7 6 7.9 6 9V19ZM9 9H15C15.55 9 16 9.45 16 10V18C16 18.55 15.55 19 15 19H9C8.45 19 8 18.55 8 18V10C8 9.45 8.45 9 9 9ZM15.5 4L14.79 3.29C14.61 3.11 14.35 3 14.09 3H9.91C9.65 3 9.39 3.11 9.21 3.29L8.5 4H6C5.45 4 5 4.45 5 5C5 5.55 5.45 6 6 6H18C18.55 6 19 5.55 19 5C19 4.45 18.55 4 18 4H15.5Z" fill="#817567"/>
|
|
@@ -341,7 +337,7 @@ const ht = [H, B, V, $, Z].flat(), ct = M`
|
|
|
341
337
|
</clipPath>
|
|
342
338
|
</defs>
|
|
343
339
|
</svg>
|
|
344
|
-
`,
|
|
340
|
+
`, vt = M`
|
|
345
341
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
346
342
|
<g clip-path="url(#clip0_1013_1545)">
|
|
347
343
|
<path d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z" fill="#817567"/>
|
|
@@ -352,17 +348,17 @@ const ht = [H, B, V, $, Z].flat(), ct = M`
|
|
|
352
348
|
</clipPath>
|
|
353
349
|
</defs>
|
|
354
350
|
</svg>
|
|
355
|
-
`,
|
|
356
|
-
n.config(
|
|
357
|
-
t.update(
|
|
351
|
+
`, mt = '.milkdown milkdown-link-preview>.link-preview{height:32px;display:flex;justify-content:center;padding:4px 10px;background:var(--crepe-color-surface);gap:10px;border-radius:8px;cursor:pointer;box-shadow:var(--crepe-shadow-1)}.milkdown milkdown-link-preview>.link-preview>.link-display:hover:before{display:block}.milkdown milkdown-link-preview>.link-preview>.link-display:before{content:"click to copy link";position:absolute;transform:translate(50%,-120%);padding:3px 10px;font-size:12px;border-radius:8px;color:color-mix(in srgb,var(--crepe-color-on-background),transparent 60%);background:var(--crepe-color-background);text-align:center;display:none}.milkdown milkdown-link-preview>.link-preview>.link-icon{padding:3px;line-height:24px}.milkdown milkdown-link-preview>.link-preview>.link-icon>svg{width:18px;height:18px}.milkdown milkdown-link-preview>.link-preview>.link-display{width:240px;line-height:24px;overflow:hidden;text-overflow:ellipsis;font-size:14px}.milkdown milkdown-link-preview>.link-preview>.link-display:hover{text-decoration:underline}.milkdown milkdown-link-preview>.link-preview>.button{padding:3px;border-radius:8px;line-height:24px}.milkdown milkdown-link-preview>.link-preview>.button>svg{width:18px;height:18px;color:var(--crepe-color-outline)}.milkdown milkdown-link-preview>.link-preview>.button:hover{background:var(--crepe-color-hover)}.milkdown milkdown-link-edit>.link-edit{height:32px;display:flex;justify-content:center;padding:4px 10px 4px 20px;background:var(--crepe-color-surface);gap:8px;border-radius:8px;box-shadow:var(--crepe-shadow-1)}.milkdown milkdown-link-edit>.link-edit>.input-area{outline:none;background:transparent;width:200px;font-size:14px;color:var(--crepe-color-on-background)}.milkdown milkdown-link-edit>.link-edit>.button{padding:3px;cursor:pointer;border-radius:8px;font-size:12px;line-height:24px}.milkdown milkdown-link-edit>.link-edit>.button>svg{width:18px;height:18px;color:var(--crepe-color-outline)}.milkdown milkdown-link-edit>.link-edit>.button:hover{background:var(--crepe-color-hover)}.milkdown milkdown-link-edit>.link-edit>.button.hidden{visibility:hidden}', Ht = (n) => {
|
|
352
|
+
n.config(et(mt)).config(ht).config((t) => {
|
|
353
|
+
t.update(D.key, (r) => ({
|
|
358
354
|
...r,
|
|
359
|
-
linkIcon: () =>
|
|
360
|
-
editButton: () =>
|
|
361
|
-
removeButton: () =>
|
|
362
|
-
confirmButton: () =>
|
|
355
|
+
linkIcon: () => kt,
|
|
356
|
+
editButton: () => ut,
|
|
357
|
+
removeButton: () => wt,
|
|
358
|
+
confirmButton: () => vt
|
|
363
359
|
}));
|
|
364
|
-
}).use(
|
|
360
|
+
}).use(ct);
|
|
365
361
|
};
|
|
366
362
|
export {
|
|
367
|
-
|
|
363
|
+
Ht as defineFeature
|
|
368
364
|
};
|
|
@@ -7,31 +7,31 @@ var a = (o, t, n) => (v(o, t, "read from private field"), n ? n.call(o) : t.get(
|
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
t instanceof WeakSet ? t.add(o) : t.set(o, n);
|
|
9
9
|
}, g = (o, t, n, c) => (v(o, t, "write to private field"), c ? c.call(o, n) : t.set(o, n), n);
|
|
10
|
-
import {
|
|
11
|
-
import { h as m, c as
|
|
10
|
+
import { Q as B, R as S, U as E, d as b, g as f, V as u, W as I, X as F, Y as O, i as P, f as R, T as k } from "./index-S3dtETwZ.js";
|
|
11
|
+
import { h as m, c as A, f as j, a as D } from "./meta-tAGyVRPE.js";
|
|
12
12
|
import { c as p } from "./clsx-7d8NmkQq.js";
|
|
13
|
-
import { a as H, t as U, T as
|
|
13
|
+
import { a as H, t as U, T as N } from "./tooltip-plugin-Pjm6nx6a.js";
|
|
14
14
|
import "./icons-HYkfuR-O.js";
|
|
15
|
-
import "./tippy.esm-
|
|
16
|
-
const
|
|
15
|
+
import "./tippy.esm-lHdsQkl8.js";
|
|
16
|
+
const Q = m`
|
|
17
17
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
18
18
|
<path d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z" fill="#817567"/>
|
|
19
19
|
</svg>
|
|
20
|
-
`,
|
|
20
|
+
`, W = m`
|
|
21
21
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
22
22
|
<path d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z" fill="#817567"/>
|
|
23
23
|
</svg>
|
|
24
|
-
`,
|
|
24
|
+
`, X = m`
|
|
25
25
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
26
26
|
<path d="M4.46924 12.0158L8.52694 16.0735C8.66541 16.212 8.73624 16.386 8.73944 16.5956C8.74266 16.8052 8.67183 16.9824 8.52694 17.1273C8.38208 17.2722 8.20644 17.3446 8.00004 17.3446C7.79364 17.3446 7.61801 17.2722 7.47315 17.1273L2.97892 12.6331C2.88532 12.5395 2.81929 12.4408 2.78084 12.3369C2.74238 12.2331 2.72314 12.1209 2.72314 12.0004C2.72314 11.8799 2.74238 11.7677 2.78084 11.6639C2.81929 11.56 2.88532 11.4613 2.97892 11.3677L7.47315 6.87351C7.62184 6.72479 7.79844 6.64882 8.00292 6.6456C8.2074 6.6424 8.38721 6.71837 8.54234 6.87351C8.69746 7.02862 8.77502 7.20682 8.77502 7.4081C8.77502 7.60937 8.69746 7.78757 8.54234 7.94271L4.46924 12.0158ZM19.5308 11.985L15.4731 7.9273C15.3347 7.78885 15.2638 7.61482 15.2606 7.40521C15.2574 7.19561 15.3283 7.01837 15.4731 6.87351C15.618 6.72862 15.7936 6.65618 16 6.65618C16.2064 6.65618 16.3821 6.72862 16.5269 6.87351L21.0212 11.3677C21.1148 11.4613 21.1808 11.56 21.2192 11.6639C21.2577 11.7677 21.2769 11.8799 21.2769 12.0004C21.2769 12.1209 21.2577 12.2331 21.2192 12.3369C21.1808 12.4408 21.1148 12.5395 21.0212 12.6331L16.5269 17.1273C16.3782 17.276 16.2042 17.3494 16.0048 17.3475C15.8055 17.3456 15.6283 17.2671 15.4731 17.1119C15.318 16.9568 15.2404 16.7786 15.2404 16.5773C15.2404 16.376 15.318 16.1978 15.4731 16.0427L19.5308 11.985Z" fill="#817567"/>
|
|
27
27
|
</svg>
|
|
28
|
-
`,
|
|
28
|
+
`, Y = m`
|
|
29
29
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
30
30
|
<path d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z" fill="#817567"/>
|
|
31
31
|
</svg>
|
|
32
32
|
`, V = ({ ctx: o, hide: t, show: n }) => {
|
|
33
|
-
const c =
|
|
34
|
-
|
|
33
|
+
const c = j();
|
|
34
|
+
D(() => {
|
|
35
35
|
c();
|
|
36
36
|
}, [n]);
|
|
37
37
|
const s = (e) => (i) => {
|
|
@@ -49,7 +49,7 @@ const N = m`
|
|
|
49
49
|
e.get(u).call(I.key);
|
|
50
50
|
})}
|
|
51
51
|
>
|
|
52
|
-
${
|
|
52
|
+
${Q}
|
|
53
53
|
</button>
|
|
54
54
|
<button
|
|
55
55
|
class=${p("toolbar-item", o && r(S.type(o)) && "active")}
|
|
@@ -57,7 +57,7 @@ const N = m`
|
|
|
57
57
|
e.get(u).call(F.key);
|
|
58
58
|
})}
|
|
59
59
|
>
|
|
60
|
-
${
|
|
60
|
+
${W}
|
|
61
61
|
</button>
|
|
62
62
|
<div class="divider"></div>
|
|
63
63
|
<button
|
|
@@ -66,7 +66,7 @@ const N = m`
|
|
|
66
66
|
e.get(u).call(O.key);
|
|
67
67
|
})}
|
|
68
68
|
>
|
|
69
|
-
${
|
|
69
|
+
${X}
|
|
70
70
|
</button>
|
|
71
71
|
<button
|
|
72
72
|
class=${p("toolbar-item", o && r(b.type(o)) && "active")}
|
|
@@ -79,7 +79,7 @@ const N = m`
|
|
|
79
79
|
e.get(H.key).addLink(d.from, d.to), t == null || t();
|
|
80
80
|
})}
|
|
81
81
|
>
|
|
82
|
-
${
|
|
82
|
+
${Y}
|
|
83
83
|
</button>
|
|
84
84
|
</host>`;
|
|
85
85
|
};
|
|
@@ -88,7 +88,7 @@ V.props = {
|
|
|
88
88
|
hide: Function,
|
|
89
89
|
show: Boolean
|
|
90
90
|
};
|
|
91
|
-
const x =
|
|
91
|
+
const x = A(V), _ = ".milkdown milkdown-toolbar{display:flex;background:var(--crepe-color-surface);box-shadow:var(--crepe-shadow-1);border-radius:8px;overflow:hidden}.milkdown milkdown-toolbar .divider{width:1px;background:color-mix(in srgb,var(--crepe-color-outline),transparent 80%);height:24px;margin:10px}.milkdown milkdown-toolbar .toolbar-item{width:44px;height:44px;padding:10px;cursor:pointer}.milkdown milkdown-toolbar .toolbar-item:hover{background:var(--crepe-color-hover)}.milkdown milkdown-toolbar .toolbar-item.active{background:var(--crepe-color-selected)}.milkdown milkdown-toolbar .toolbar-item svg{height:24px;width:24px;color:var(--crepe-color-outline)}", y = U("CREPE_TOOLBAR");
|
|
92
92
|
var C, l;
|
|
93
93
|
class q {
|
|
94
94
|
constructor(t, n) {
|
|
@@ -102,13 +102,11 @@ class q {
|
|
|
102
102
|
a(this, C).hide();
|
|
103
103
|
};
|
|
104
104
|
const c = new x();
|
|
105
|
-
g(this, l, c), a(this, l).ctx = t, a(this, l).hide = this.hide, g(this, C, new
|
|
105
|
+
g(this, l, c), a(this, l).ctx = t, a(this, l).hide = this.hide, g(this, C, new N({
|
|
106
106
|
content: a(this, l),
|
|
107
107
|
debounce: 20,
|
|
108
108
|
tippyOptions: {
|
|
109
|
-
|
|
110
|
-
delay: 0,
|
|
111
|
-
duration: 0,
|
|
109
|
+
appendTo: () => t.get(R),
|
|
112
110
|
onShow: () => {
|
|
113
111
|
a(this, l).show = !0;
|
|
114
112
|
},
|
|
@@ -117,15 +115,15 @@ class q {
|
|
|
117
115
|
}
|
|
118
116
|
},
|
|
119
117
|
shouldShow(s) {
|
|
120
|
-
const { doc: r, selection: e } = s.state, { empty: i, from: d, to: h } = e, L = !r.textBetween(d, h).length && e instanceof k,
|
|
121
|
-
return !(
|
|
118
|
+
const { doc: r, selection: e } = s.state, { empty: i, from: d, to: h } = e, L = !r.textBetween(d, h).length && e instanceof k, M = !(e instanceof k), T = c.contains(document.activeElement), $ = !s.hasFocus() && !T, Z = !s.editable;
|
|
119
|
+
return !($ || M || i || L || Z);
|
|
122
120
|
}
|
|
123
121
|
})), this.update(n);
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
124
|
C = new WeakMap(), l = new WeakMap();
|
|
127
125
|
customElements.define("milkdown-toolbar", x);
|
|
128
|
-
const
|
|
126
|
+
const n1 = (o) => {
|
|
129
127
|
o.config(P(_)).config((t) => {
|
|
130
128
|
t.set(y.key, {
|
|
131
129
|
view: (n) => new q(t, n)
|
|
@@ -133,5 +131,5 @@ const e1 = (o) => {
|
|
|
133
131
|
}).use(y);
|
|
134
132
|
};
|
|
135
133
|
export {
|
|
136
|
-
|
|
134
|
+
n1 as defineFeature
|
|
137
135
|
};
|