@milkdown/crepe 7.3.4 → 7.3.6
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/core/crepe.d.ts +1 -1
- package/lib/core/crepe.d.ts.map +1 -1
- 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-wbiYuOxV.js → index-BSv6537G.js} +93 -89
- package/lib/{index-kJIKUIIa.js → index-BoI246Ti.js} +18 -18
- package/lib/{index-KpfNv3rh.js → index-DDSXiQ90.js} +4 -4
- package/lib/{index-TsIsEZU1.js → index-ECCvmC6D.js} +12 -6
- package/lib/{index-hNRb95TL.js → index-EI1FcaSv.js} +4 -4
- package/lib/{index-h_6aZnx8.js → index-ESoQGvsE.js} +8 -8
- package/lib/{index-Gz6CQY-t.js → index-GOH7H2i9.js} +4 -4
- package/lib/{index-j2S9Lybz.js → index-GjFRg3RJ.js} +1 -1
- package/lib/index-GzVCh3P9.js +353 -0
- package/lib/{index-fJFWq6Y-.js → index-KCykNSJx.js} +7 -7
- package/lib/{index-yP4hAgM2.js → index-Ls2I7eOW.js} +61 -50
- package/lib/{index-7mRbGzci.js → index-P4-KqpEN.js} +5 -5
- package/lib/{index-bnwzlBfQ.js → index-Qcks_HSE.js} +6 -6
- package/lib/{index-YMk3n5vO.js → index-RKThEh9x.js} +4 -4
- package/lib/{index-qQMehYhQ.js → index-UqF8o9eD.js} +3246 -3092
- package/lib/{index-xkrG0YF8.js → index-_VrGF4z-.js} +5 -5
- package/lib/{index-H0TD0r41.js → index-cteyPSwp.js} +1 -1
- package/lib/{index-0c09be_R.js → index-f0pbmfJP.js} +4 -4
- package/lib/{index-kwrazjQE.js → index-gMYRN2wV.js} +7 -7
- package/lib/{index-5QLddZAp.js → index-jZuF1Iix.js} +4 -4
- package/lib/{index-Gg_apETx.js → index-kyD7hUif.js} +5 -5
- package/lib/{index-Zxe2neJQ.js → index-oszOFbwW.js} +149 -147
- package/lib/{index-b2y_N_O5.js → index-pC1MPpe2.js} +31 -31
- package/lib/{index-JGveSciI.js → index-q3iu4cef.js} +7 -7
- package/lib/{index-TRbxSkC1.js → index-qMeqmZtK.js} +4 -4
- package/lib/index-rs4SJ8Gd.js +253 -0
- package/lib/{index-oOHgRzEu.js → index-w-CiezW1.js} +21 -20
- package/lib/{index-WAhmZOxr.js → index-x6C6leag.js} +4 -4
- package/lib/{index-3qfZtuPz.js → index-xa7wUurf.js} +1 -1
- package/lib/{index-8NLp8LdC.js → index-xjkoF_Bn.js} +9 -9
- package/lib/{index-Ic30Lzgg.js → index-yrfirMbY.js} +4 -4
- package/lib/{index-2Cm9HHYj.js → index-zNGl_CdN.js} +1 -1
- package/lib/{index-ffdCLz6T.js → index-zc51oyS8.js} +2 -2
- package/lib/index.es.js +1 -1
- package/lib/{schema-t8-IDHY6.js → schema-ywm7RaKF.js} +1 -1
- package/lib/{tippy.esm-xX0Dh8mH.js → tippy.esm-4ny8MQOF.js} +33 -33
- package/lib/{tooltip-plugin-0UgO85XO.js → tooltip-plugin-NpyG8C5u.js} +17 -17
- package/package.json +14 -14
- package/src/core/crepe.ts +1 -0
- package/src/feature/block-edit/handle/index.ts +2 -1
- package/src/feature/block-edit/menu/index.ts +2 -0
- package/src/feature/toolbar/index.ts +2 -0
- package/lib/yaml-DnNTfjXK.js +0 -53
|
@@ -8,20 +8,20 @@ var l = (i, t, o) => (wt(i, t, "read from private field"), o ? o.call(i) : t.get
|
|
|
8
8
|
t instanceof WeakSet ? t.add(i) : t.set(i, o);
|
|
9
9
|
}, c = (i, t, o, e) => (wt(i, t, "write to private field"), e ? e.call(i, o) : t.set(i, o), o);
|
|
10
10
|
var Ct = (i, t, o) => (wt(i, t, "access private method"), o);
|
|
11
|
-
import { d as
|
|
12
|
-
import {
|
|
13
|
-
import { i as
|
|
14
|
-
import { h as w, c as
|
|
15
|
-
import { a as
|
|
16
|
-
import { i as
|
|
17
|
-
const E = typeof navigator < "u" ? navigator : null,
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
function
|
|
11
|
+
import { d as Tt, t as It, p as ne } from "./tippy.esm-4ny8MQOF.js";
|
|
12
|
+
import { o as oe, z as se, t as Lt, g as y, $ as at, y as Rt, A as Dt, P as At, T as Ot, B as ie, E as Nt, G as K, H as le, I as re, J as ce, K as ae, c as de, L as he, f as zt, i as pe } from "./index-Ls2I7eOW.js";
|
|
13
|
+
import { i as ue, a as me } from "./index-xHADmDT3.js";
|
|
14
|
+
import { h as w, c as Ft, e as ge, u as qt, a as yt } from "./meta-tAGyVRPE.js";
|
|
15
|
+
import { a as fe, u as we, b as W } from "./hooks-82sqkbtE.js";
|
|
16
|
+
import { i as Ce } from "./schema-ywm7RaKF.js";
|
|
17
|
+
const E = typeof navigator < "u" ? navigator : null, St = typeof document < "u" ? document : null, q = E && E.userAgent || "", bt = /Edge\/(\d+)/.exec(q), Kt = /MSIE \d/.exec(q), Ht = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(q), mt = !!(Kt || Ht || bt), ve = Kt ? document.documentMode : Ht ? +Ht[1] : bt ? +bt[1] : 0, ke = !mt && /gecko\/(\d+)/i.test(q);
|
|
18
|
+
ke && +(/Firefox\/(\d+)/.exec(q) || [0, 0])[1];
|
|
19
|
+
const Bt = !mt && /Chrome\/(\d+)/.exec(q);
|
|
20
|
+
Bt && +Bt[1];
|
|
21
|
+
const ye = !mt && !!E && /Apple Computer/.test(E.vendor), Wt = ye && (/Mobile\/\w+/.test(q) || !!E && E.maxTouchPoints > 2);
|
|
22
|
+
Wt || E && /Mac/.test(E.platform);
|
|
23
|
+
const be = !!St && "webkitFontSmoothing" in St.documentElement.style, He = be ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
|
|
24
|
+
function xe(i, t) {
|
|
25
25
|
var n;
|
|
26
26
|
const { state: o } = i, e = o.selection.$anchor;
|
|
27
27
|
for (let s = e.depth; s > 0; s--)
|
|
@@ -32,7 +32,7 @@ function He(i, t) {
|
|
|
32
32
|
const u = (n = i.dragging) == null ? void 0 : n.slice;
|
|
33
33
|
if (!u)
|
|
34
34
|
return null;
|
|
35
|
-
const m = i.state.doc.resolve(d.pos), v =
|
|
35
|
+
const m = i.state.doc.resolve(d.pos), v = oe(i.state.doc, m.pos, u);
|
|
36
36
|
if (v == null || v < 0)
|
|
37
37
|
return null;
|
|
38
38
|
let g = o.tr;
|
|
@@ -42,7 +42,7 @@ function He(i, t) {
|
|
|
42
42
|
}
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function Me(i, t, o) {
|
|
46
46
|
let e = i.nodeDOM(o.pos);
|
|
47
47
|
e || (e = i.nodeDOM(o.pos - 1));
|
|
48
48
|
let n = e == null ? void 0 : e.parentElement;
|
|
@@ -50,13 +50,13 @@ function xe(i, t, o) {
|
|
|
50
50
|
e = n, n = n.parentElement;
|
|
51
51
|
return e;
|
|
52
52
|
}
|
|
53
|
-
const
|
|
54
|
-
function
|
|
53
|
+
const Ve = (i) => !i.type.isBlock;
|
|
54
|
+
function _e(i) {
|
|
55
55
|
let t = i.parent;
|
|
56
56
|
const o = i.node();
|
|
57
57
|
return t === o && (t = i.node(i.depth - 1)), !t || t.type.name === "doc" ? !1 : t.firstChild === o;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Pe(i, t, o) {
|
|
60
60
|
const e = t.dom.parentElement;
|
|
61
61
|
if (!e)
|
|
62
62
|
return null;
|
|
@@ -70,14 +70,14 @@ function _e(i, t, o) {
|
|
|
70
70
|
return null;
|
|
71
71
|
r = u;
|
|
72
72
|
}
|
|
73
|
-
for (; r && (
|
|
73
|
+
for (; r && (Ve(r) || _e(s) || !o(r)); )
|
|
74
74
|
s = t.state.doc.resolve(s.before()), r = s.node();
|
|
75
75
|
s = s.pos - s.parentOffset === 0 ? s : t.state.doc.resolve(s.pos - s.parentOffset);
|
|
76
|
-
const d =
|
|
76
|
+
const d = Me(t, e, s);
|
|
77
77
|
return d ? { node: r, $pos: s, el: d } : null;
|
|
78
78
|
}
|
|
79
79
|
let $t = null;
|
|
80
|
-
function
|
|
80
|
+
function Le() {
|
|
81
81
|
return $t || ($t = document.implementation.createHTMLDocument("title"));
|
|
82
82
|
}
|
|
83
83
|
const Se = {
|
|
@@ -102,7 +102,7 @@ function Be(i, t) {
|
|
|
102
102
|
k.attrs !== k.type.defaultAttrs ? k.attrs : null
|
|
103
103
|
), s = k.content;
|
|
104
104
|
}
|
|
105
|
-
const r = i.someProp("clipboardSerializer") ||
|
|
105
|
+
const r = i.someProp("clipboardSerializer") || se.fromSchema(i.state.schema), d = Le(), u = d.createElement("div");
|
|
106
106
|
u.appendChild(r.serializeFragment(s, { document: d }));
|
|
107
107
|
let m = u.firstChild, v, g = 0;
|
|
108
108
|
for (; m && m.nodeType === 1 && (v = Se[m.nodeName.toLowerCase()]); ) {
|
|
@@ -123,9 +123,9 @@ function Be(i, t) {
|
|
|
123
123
|
`);
|
|
124
124
|
return { dom: u, text: C };
|
|
125
125
|
}
|
|
126
|
-
const Zt = mt &&
|
|
127
|
-
var j, tt, R, V, U, x, ht,
|
|
128
|
-
class
|
|
126
|
+
const Zt = mt && ve < 15 || Wt && He < 604, Et = 20;
|
|
127
|
+
var j, tt, R, V, U, x, ht, jt, D, Y, A, O, et, G, J, Q, nt;
|
|
128
|
+
class $e {
|
|
129
129
|
constructor() {
|
|
130
130
|
/// @internal
|
|
131
131
|
p(this, ht);
|
|
@@ -150,8 +150,8 @@ class Le {
|
|
|
150
150
|
if (!l(this, V))
|
|
151
151
|
return null;
|
|
152
152
|
const t = l(this, V), o = l(this, D, Y);
|
|
153
|
-
if (o &&
|
|
154
|
-
const e =
|
|
153
|
+
if (o && Lt.isSelectable(t.node)) {
|
|
154
|
+
const e = Lt.create(o.state.doc, t.$pos.pos - (t.node.isLeaf ? 0 : 1));
|
|
155
155
|
return o.dispatch(o.state.tr.setSelection(e)), o.focus(), c(this, R, e), e;
|
|
156
156
|
}
|
|
157
157
|
return null;
|
|
@@ -193,7 +193,7 @@ class Le {
|
|
|
193
193
|
move: !0
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
|
-
}), this.keydownCallback = () => (l(this, O).call(this), !1), c(this, nt, (t, o) => {
|
|
196
|
+
}), this.keydownCallback = () => (l(this, O).call(this), !1), c(this, nt, Tt((t, o) => {
|
|
197
197
|
if (!t.editable || l(this, x))
|
|
198
198
|
return;
|
|
199
199
|
const { y: e } = o, n = t.dom.getBoundingClientRect().width / 2, s = document.elementFromPoint(n, e);
|
|
@@ -201,16 +201,16 @@ class Le {
|
|
|
201
201
|
l(this, O).call(this);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
const r = l(this, ht,
|
|
204
|
+
const r = l(this, ht, jt);
|
|
205
205
|
if (!r)
|
|
206
206
|
return;
|
|
207
|
-
const d =
|
|
207
|
+
const d = Pe(s, t, r);
|
|
208
208
|
if (!d) {
|
|
209
209
|
l(this, O).call(this);
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
212
|
l(this, et).call(this, d);
|
|
213
|
-
}), this.mousemoveCallback = (t, o) => (t.composing || !t.editable ||
|
|
213
|
+
}, 20)), this.mousemoveCallback = (t, o) => (t.composing || !t.editable || l(this, nt).call(this, t, o), !1), this.dragoverCallback = (t, o) => {
|
|
214
214
|
var e;
|
|
215
215
|
if (l(this, x)) {
|
|
216
216
|
const n = (e = l(this, D, Y)) == null ? void 0 : e.dom.parentElement;
|
|
@@ -235,12 +235,12 @@ class Le {
|
|
|
235
235
|
}, this.dragleaveCallback = () => {
|
|
236
236
|
c(this, x, !1), c(this, V, null);
|
|
237
237
|
}, this.dropCallback = (t, o) => {
|
|
238
|
-
const e = o, n =
|
|
238
|
+
const e = o, n = xe(t, e);
|
|
239
239
|
return c(this, x, !1), n ? (t.dispatch(n), e.preventDefault(), !0) : !1;
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
|
-
j = new WeakMap(), tt = new WeakMap(), R = new WeakMap(), V = new WeakMap(), U = new WeakMap(), x = new WeakMap(), ht = new WeakSet(),
|
|
243
|
+
j = new WeakMap(), tt = new WeakMap(), R = new WeakMap(), V = new WeakMap(), U = new WeakMap(), x = new WeakMap(), ht = new WeakSet(), jt = function() {
|
|
244
244
|
var t;
|
|
245
245
|
return (t = l(this, j)) == null ? void 0 : t.get(dt.key).filterNodes;
|
|
246
246
|
}, D = new WeakSet(), Y = function() {
|
|
@@ -255,14 +255,14 @@ function gt(i, t) {
|
|
|
255
255
|
}
|
|
256
256
|
}), i;
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const Ze = (i) => {
|
|
259
259
|
const { name: t } = i.type;
|
|
260
260
|
return !(t.startsWith("table") && t !== "table");
|
|
261
|
-
}, dt = at({ filterNodes:
|
|
261
|
+
}, dt = at({ filterNodes: Ze }, "blockConfig");
|
|
262
262
|
gt(dt, {
|
|
263
263
|
displayName: "Ctx<blockConfig>"
|
|
264
264
|
});
|
|
265
|
-
const xt = at(new
|
|
265
|
+
const xt = at(new $e(), "blockService");
|
|
266
266
|
gt(dt, {
|
|
267
267
|
displayName: "Ctx<blockService>"
|
|
268
268
|
});
|
|
@@ -291,15 +291,15 @@ const Vt = Rt((i) => {
|
|
|
291
291
|
gt(Vt, {
|
|
292
292
|
displayName: "Prose<block>"
|
|
293
293
|
});
|
|
294
|
-
var _,
|
|
295
|
-
class
|
|
294
|
+
var _, L, ot, X, N, z, pt, Ut;
|
|
295
|
+
class Ee {
|
|
296
296
|
constructor(t) {
|
|
297
297
|
/// @internal
|
|
298
298
|
p(this, pt);
|
|
299
299
|
/// @internal
|
|
300
300
|
p(this, _, void 0);
|
|
301
301
|
/// @internal
|
|
302
|
-
p(this,
|
|
302
|
+
p(this, L, void 0);
|
|
303
303
|
/// @internal
|
|
304
304
|
p(this, ot, void 0);
|
|
305
305
|
/// @internal
|
|
@@ -311,13 +311,13 @@ class Ze {
|
|
|
311
311
|
requestAnimationFrame(() => {
|
|
312
312
|
if (!l(this, _))
|
|
313
313
|
try {
|
|
314
|
-
Ct(this, pt,
|
|
314
|
+
Ct(this, pt, Ut).call(this, o);
|
|
315
315
|
} catch {
|
|
316
316
|
}
|
|
317
317
|
});
|
|
318
318
|
}, this.destroy = () => {
|
|
319
319
|
var o, e, n;
|
|
320
|
-
(o = l(this, N)) == null || o.unBind(), (e = l(this, N)) == null || e.removeEvent(l(this,
|
|
320
|
+
(o = l(this, N)) == null || o.unBind(), (e = l(this, N)) == null || e.removeEvent(l(this, L)), (n = l(this, _)) == null || n.destroy(), c(this, _, void 0);
|
|
321
321
|
}, this.show = (o) => {
|
|
322
322
|
requestAnimationFrame(() => {
|
|
323
323
|
var e, n;
|
|
@@ -328,17 +328,17 @@ class Ze {
|
|
|
328
328
|
}, this.hide = () => {
|
|
329
329
|
var o;
|
|
330
330
|
(o = l(this, _)) == null || o.hide();
|
|
331
|
-
}, c(this, X, t.ctx), c(this,
|
|
331
|
+
}, c(this, X, t.ctx), c(this, L, t.content), c(this, ot, t.tippyOptions ?? {});
|
|
332
332
|
}
|
|
333
333
|
get activeNode() {
|
|
334
334
|
return l(this, z);
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
_ = new WeakMap(),
|
|
337
|
+
_ = new WeakMap(), L = new WeakMap(), ot = new WeakMap(), X = new WeakMap(), N = new WeakMap(), z = new WeakMap(), pt = new WeakSet(), Ut = function(t) {
|
|
338
338
|
const o = l(this, X).get(xt.key);
|
|
339
339
|
o.bind(l(this, X), (e) => {
|
|
340
340
|
e.type === "hide" ? (this.hide(), c(this, z, null)) : (this.show(e.active), c(this, z, e.active));
|
|
341
|
-
}), c(this, N, o), l(this, N).addEvent(l(this,
|
|
341
|
+
}), c(this, N, o), l(this, N).addEvent(l(this, L)), l(this, L).draggable = !0, c(this, _, It(t.dom, {
|
|
342
342
|
trigger: "manual",
|
|
343
343
|
placement: "left-start",
|
|
344
344
|
interactive: !0,
|
|
@@ -346,13 +346,13 @@ _ = new WeakMap(), S = new WeakMap(), ot = new WeakMap(), X = new WeakMap(), N =
|
|
|
346
346
|
arrow: !1,
|
|
347
347
|
duration: 0,
|
|
348
348
|
...l(this, ot),
|
|
349
|
-
content: l(this,
|
|
349
|
+
content: l(this, L)
|
|
350
350
|
}));
|
|
351
351
|
};
|
|
352
352
|
const ft = [Mt, dt, xt, Vt];
|
|
353
353
|
ft.key = Mt.key;
|
|
354
354
|
ft.pluginKey = Vt.key;
|
|
355
|
-
function
|
|
355
|
+
function Te(i) {
|
|
356
356
|
const t = at({}, `${i}_SLASH_SPEC`), o = Rt((n) => {
|
|
357
357
|
const s = n.get(t.key);
|
|
358
358
|
return new At({
|
|
@@ -368,7 +368,7 @@ function Ee(i) {
|
|
|
368
368
|
displayName: `Prose<slash>|${i}`
|
|
369
369
|
}, e;
|
|
370
370
|
}
|
|
371
|
-
var P, st, it, F, lt, rt, ut,
|
|
371
|
+
var P, st, it, F, lt, rt, ut, Gt;
|
|
372
372
|
class Ie {
|
|
373
373
|
constructor(t) {
|
|
374
374
|
/// @internal
|
|
@@ -386,7 +386,7 @@ class Ie {
|
|
|
386
386
|
p(this, rt, void 0);
|
|
387
387
|
c(this, rt, (o, e) => {
|
|
388
388
|
const { state: n, composing: s } = o, { selection: r, doc: d } = n, { ranges: u } = r, m = Math.min(...u.map((C) => C.$from.pos)), v = Math.max(...u.map((C) => C.$to.pos)), g = e && e.doc.eq(d) && e.selection.eq(r);
|
|
389
|
-
if (l(this, P) ?? c(this, P,
|
|
389
|
+
if (l(this, P) ?? c(this, P, It(o.dom, {
|
|
390
390
|
trigger: "manual",
|
|
391
391
|
placement: "bottom-start",
|
|
392
392
|
interactive: !0,
|
|
@@ -401,13 +401,13 @@ class Ie {
|
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
403
|
l(this, P).setProps({
|
|
404
|
-
getReferenceClientRect: () =>
|
|
404
|
+
getReferenceClientRect: () => ne(o, m, v)
|
|
405
405
|
}), this.show();
|
|
406
406
|
}
|
|
407
407
|
}), this.update = (o, e) => {
|
|
408
|
-
|
|
408
|
+
Tt(l(this, rt), l(this, it))(o, e);
|
|
409
409
|
}, this.getContent = (o, e = (n) => n.type.name === "paragraph") => {
|
|
410
|
-
const { selection: n } = o.state, { empty: s, $from: r } = n, d = o.state.selection instanceof Ot, u = this.element.contains(document.activeElement), m = !o.hasFocus() && !u, v = !o.editable, C = !
|
|
410
|
+
const { selection: n } = o.state, { empty: s, $from: r } = n, d = o.state.selection instanceof Ot, u = this.element.contains(document.activeElement), m = !o.hasFocus() && !u, v = !o.editable, C = !ie(e)(o.state.selection);
|
|
411
411
|
if (!(m || v || !s || !d || C))
|
|
412
412
|
return r.parent.textBetween(Math.max(0, r.parentOffset - 500), r.parentOffset, void 0, "");
|
|
413
413
|
}, this.destroy = () => {
|
|
@@ -419,17 +419,17 @@ class Ie {
|
|
|
419
419
|
}, this.hide = () => {
|
|
420
420
|
var o;
|
|
421
421
|
(o = l(this, P)) == null || o.hide();
|
|
422
|
-
}, this.getInstance = () => l(this, P), this.element = t.content, c(this, st, t.tippyOptions ?? {}), c(this, it, t.debounce ?? 200), c(this, lt, t.shouldShow ?? Ct(this, ut,
|
|
422
|
+
}, this.getInstance = () => l(this, P), this.element = t.content, c(this, st, t.tippyOptions ?? {}), c(this, it, t.debounce ?? 200), c(this, lt, t.shouldShow ?? Ct(this, ut, Gt)), c(this, F, t.trigger ?? "/");
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
|
-
P = new WeakMap(), st = new WeakMap(), it = new WeakMap(), F = new WeakMap(), lt = new WeakMap(), rt = new WeakMap(), ut = new WeakSet(),
|
|
425
|
+
P = new WeakMap(), st = new WeakMap(), it = new WeakMap(), F = new WeakMap(), lt = new WeakMap(), rt = new WeakMap(), ut = new WeakSet(), Gt = function(t) {
|
|
426
426
|
const o = this.getContent(t);
|
|
427
427
|
if (!o)
|
|
428
428
|
return !1;
|
|
429
429
|
const e = o.at(-1);
|
|
430
430
|
return e ? Array.isArray(l(this, F)) ? l(this, F).includes(e) : l(this, F) === e : !1;
|
|
431
431
|
};
|
|
432
|
-
const
|
|
432
|
+
const Re = w`
|
|
433
433
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
434
434
|
<g clip-path="url(#clip0_992_5547)">
|
|
435
435
|
<path d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z" fill="#817567"/>
|
|
@@ -440,7 +440,7 @@ const Te = w`
|
|
|
440
440
|
</clipPath>
|
|
441
441
|
</defs>
|
|
442
442
|
</svg>
|
|
443
|
-
`,
|
|
443
|
+
`, De = w`
|
|
444
444
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
445
445
|
<g clip-path="url(#clip0_992_5553)">
|
|
446
446
|
<path d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z" fill="#817567"/>
|
|
@@ -451,7 +451,7 @@ const Te = w`
|
|
|
451
451
|
</clipPath>
|
|
452
452
|
</defs>
|
|
453
453
|
</svg>
|
|
454
|
-
`,
|
|
454
|
+
`, Ae = w`
|
|
455
455
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
456
456
|
<g clip-path="url(#clip0_992_5559)">
|
|
457
457
|
<path d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z" fill="#817567"/>
|
|
@@ -462,7 +462,7 @@ const Te = w`
|
|
|
462
462
|
</clipPath>
|
|
463
463
|
</defs>
|
|
464
464
|
</svg>
|
|
465
|
-
`,
|
|
465
|
+
`, Oe = w`
|
|
466
466
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
467
467
|
<g clip-path="url(#clip0_992_5565)">
|
|
468
468
|
<path d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z" fill="#817567"/>
|
|
@@ -473,7 +473,7 @@ const Te = w`
|
|
|
473
473
|
</clipPath>
|
|
474
474
|
</defs>
|
|
475
475
|
</svg>
|
|
476
|
-
`,
|
|
476
|
+
`, Ne = w`
|
|
477
477
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
478
478
|
<g clip-path="url(#clip0_977_7757)">
|
|
479
479
|
<path d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z" fill="#817567"/>
|
|
@@ -484,7 +484,7 @@ const Te = w`
|
|
|
484
484
|
</clipPath>
|
|
485
485
|
</defs>
|
|
486
486
|
</svg>
|
|
487
|
-
`,
|
|
487
|
+
`, ze = w`
|
|
488
488
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
489
489
|
<g clip-path="url(#clip0_977_7760)">
|
|
490
490
|
<path d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z" fill="#817567"/>
|
|
@@ -495,7 +495,7 @@ const Te = w`
|
|
|
495
495
|
</clipPath>
|
|
496
496
|
</defs>
|
|
497
497
|
</svg>
|
|
498
|
-
`,
|
|
498
|
+
`, Fe = w`
|
|
499
499
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
500
500
|
<g clip-path="url(#clip0_977_7763)">
|
|
501
501
|
<path d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z" fill="#817567"/>
|
|
@@ -506,7 +506,7 @@ const Te = w`
|
|
|
506
506
|
</clipPath>
|
|
507
507
|
</defs>
|
|
508
508
|
</svg>
|
|
509
|
-
`,
|
|
509
|
+
`, qe = w`
|
|
510
510
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
511
511
|
<g clip-path="url(#clip0_977_8070)">
|
|
512
512
|
<path d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z" fill="#817567"/>
|
|
@@ -517,7 +517,7 @@ const Te = w`
|
|
|
517
517
|
</clipPath>
|
|
518
518
|
</defs>
|
|
519
519
|
</svg>
|
|
520
|
-
`,
|
|
520
|
+
`, Ke = w`
|
|
521
521
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
522
522
|
<g clip-path="url(#clip0_977_8067)">
|
|
523
523
|
<path d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z" fill="#817567"/>
|
|
@@ -528,7 +528,7 @@ const Te = w`
|
|
|
528
528
|
</clipPath>
|
|
529
529
|
</defs>
|
|
530
530
|
</svg>
|
|
531
|
-
`,
|
|
531
|
+
`, We = w`
|
|
532
532
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
533
533
|
<g clip-path="url(#clip0_977_7897)">
|
|
534
534
|
<path d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z" fill="#817567"/>
|
|
@@ -539,7 +539,7 @@ const Te = w`
|
|
|
539
539
|
</clipPath>
|
|
540
540
|
</defs>
|
|
541
541
|
</svg>
|
|
542
|
-
`,
|
|
542
|
+
`, je = w`
|
|
543
543
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
544
544
|
<g clip-path="url(#clip0_977_7900)">
|
|
545
545
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z" fill="#817567"/>
|
|
@@ -550,7 +550,7 @@ const Te = w`
|
|
|
550
550
|
</clipPath>
|
|
551
551
|
</defs>
|
|
552
552
|
</svg>
|
|
553
|
-
`,
|
|
553
|
+
`, Ue = w`
|
|
554
554
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
555
555
|
<g clip-path="url(#clip0_977_8075)">
|
|
556
556
|
<path d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z" fill="#817567"/>
|
|
@@ -561,7 +561,7 @@ const Te = w`
|
|
|
561
561
|
</clipPath>
|
|
562
562
|
</defs>
|
|
563
563
|
</svg>
|
|
564
|
-
`,
|
|
564
|
+
`, Ge = w`
|
|
565
565
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
566
566
|
<g clip-path="url(#clip0_977_8081)">
|
|
567
567
|
<path d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z" fill="#817567"/>
|
|
@@ -577,22 +577,22 @@ function _t(i) {
|
|
|
577
577
|
const { $from: t, $to: o } = i.selection, { pos: e } = t, { pos: n } = o;
|
|
578
578
|
return i = i.deleteRange(e - t.node().content.size, n), i;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function Je(i, t, o = null) {
|
|
581
581
|
const { from: e, to: n } = i.selection;
|
|
582
582
|
return i.setBlockType(e, n, t, o);
|
|
583
583
|
}
|
|
584
|
-
function
|
|
585
|
-
const { $from: e, $to: n } = i.selection, s = e.blockRange(n), r = s &&
|
|
584
|
+
function Qe(i, t, o = null) {
|
|
585
|
+
const { $from: e, $to: n } = i.selection, s = e.blockRange(n), r = s && he(s, t, o);
|
|
586
586
|
return r ? i.wrap(s, r) : null;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function Xe(i, t, o = null) {
|
|
589
589
|
const e = t.createAndFill(o);
|
|
590
590
|
return e ? i.replaceSelectionWith(e) : null;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function I(i, t = null) {
|
|
593
593
|
return (o, e) => {
|
|
594
594
|
if (e) {
|
|
595
|
-
const n =
|
|
595
|
+
const n = Je(_t(o.tr), i, t);
|
|
596
596
|
e(n.scrollIntoView());
|
|
597
597
|
}
|
|
598
598
|
return !0;
|
|
@@ -600,17 +600,17 @@ function T(i, t = null) {
|
|
|
600
600
|
}
|
|
601
601
|
function vt(i, t = null) {
|
|
602
602
|
return (o, e) => {
|
|
603
|
-
const n =
|
|
603
|
+
const n = Qe(_t(o.tr), i, t);
|
|
604
604
|
return n ? (e && e(n.scrollIntoView()), !0) : !1;
|
|
605
605
|
};
|
|
606
606
|
}
|
|
607
607
|
function kt(i, t = null) {
|
|
608
608
|
return (o, e) => {
|
|
609
|
-
const n =
|
|
609
|
+
const n = Xe(_t(o.tr), i, t);
|
|
610
610
|
return n ? (e && e(n.scrollIntoView()), !0) : !1;
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Ye(i) {
|
|
614
614
|
let t = [
|
|
615
615
|
{
|
|
616
616
|
key: "text",
|
|
@@ -619,82 +619,82 @@ function Xe(i) {
|
|
|
619
619
|
{
|
|
620
620
|
key: "text",
|
|
621
621
|
label: "Text",
|
|
622
|
-
icon:
|
|
622
|
+
icon: Re,
|
|
623
623
|
onRun: (e) => {
|
|
624
624
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
625
|
-
|
|
625
|
+
I(Nt.type(e))(r, s);
|
|
626
626
|
}
|
|
627
627
|
},
|
|
628
628
|
{
|
|
629
629
|
key: "h1",
|
|
630
630
|
label: "Heading 1",
|
|
631
|
-
icon:
|
|
631
|
+
icon: De,
|
|
632
632
|
onRun: (e) => {
|
|
633
633
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
634
|
-
|
|
634
|
+
I(K.type(e), { level: 1 })(r, s);
|
|
635
635
|
}
|
|
636
636
|
},
|
|
637
637
|
{
|
|
638
638
|
key: "h2",
|
|
639
639
|
label: "Heading 2",
|
|
640
|
-
icon:
|
|
640
|
+
icon: Ae,
|
|
641
641
|
onRun: (e) => {
|
|
642
642
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
643
|
-
|
|
643
|
+
I(K.type(e), { level: 2 })(r, s);
|
|
644
644
|
}
|
|
645
645
|
},
|
|
646
646
|
{
|
|
647
647
|
key: "h3",
|
|
648
648
|
label: "Heading 3",
|
|
649
|
-
icon:
|
|
649
|
+
icon: Oe,
|
|
650
650
|
onRun: (e) => {
|
|
651
651
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
652
|
-
|
|
652
|
+
I(K.type(e), { level: 3 })(r, s);
|
|
653
653
|
}
|
|
654
654
|
},
|
|
655
655
|
{
|
|
656
656
|
key: "h4",
|
|
657
657
|
label: "Heading 4",
|
|
658
|
-
icon:
|
|
658
|
+
icon: Ne,
|
|
659
659
|
onRun: (e) => {
|
|
660
660
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
661
|
-
|
|
661
|
+
I(K.type(e), { level: 4 })(r, s);
|
|
662
662
|
}
|
|
663
663
|
},
|
|
664
664
|
{
|
|
665
665
|
key: "h5",
|
|
666
666
|
label: "Heading 5",
|
|
667
|
-
icon:
|
|
667
|
+
icon: ze,
|
|
668
668
|
onRun: (e) => {
|
|
669
669
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
670
|
-
|
|
670
|
+
I(K.type(e), { level: 5 })(r, s);
|
|
671
671
|
}
|
|
672
672
|
},
|
|
673
673
|
{
|
|
674
674
|
key: "h6",
|
|
675
675
|
label: "Heading 6",
|
|
676
|
-
icon:
|
|
676
|
+
icon: Fe,
|
|
677
677
|
onRun: (e) => {
|
|
678
678
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
679
|
-
|
|
679
|
+
I(K.type(e), { level: 6 })(r, s);
|
|
680
680
|
}
|
|
681
681
|
},
|
|
682
682
|
{
|
|
683
683
|
key: "quote",
|
|
684
684
|
label: "Quote",
|
|
685
|
-
icon:
|
|
685
|
+
icon: We,
|
|
686
686
|
onRun: (e) => {
|
|
687
687
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
688
|
-
vt(
|
|
688
|
+
vt(le.type(e))(r, s);
|
|
689
689
|
}
|
|
690
690
|
},
|
|
691
691
|
{
|
|
692
692
|
key: "divider",
|
|
693
693
|
label: "Divider",
|
|
694
|
-
icon:
|
|
694
|
+
icon: je,
|
|
695
695
|
onRun: (e) => {
|
|
696
696
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
697
|
-
kt(
|
|
697
|
+
kt(re.type(e))(r, s);
|
|
698
698
|
}
|
|
699
699
|
}
|
|
700
700
|
]
|
|
@@ -706,19 +706,19 @@ function Xe(i) {
|
|
|
706
706
|
{
|
|
707
707
|
key: "bullet-list",
|
|
708
708
|
label: "Bullet List",
|
|
709
|
-
icon:
|
|
709
|
+
icon: qe,
|
|
710
710
|
onRun: (e) => {
|
|
711
711
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
712
|
-
vt(
|
|
712
|
+
vt(ce.type(e))(r, s);
|
|
713
713
|
}
|
|
714
714
|
},
|
|
715
715
|
{
|
|
716
716
|
key: "ordered-list",
|
|
717
717
|
label: "Ordered List",
|
|
718
|
-
icon:
|
|
718
|
+
icon: Ke,
|
|
719
719
|
onRun: (e) => {
|
|
720
720
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
721
|
-
vt(
|
|
721
|
+
vt(ae.type(e))(r, s);
|
|
722
722
|
}
|
|
723
723
|
}
|
|
724
724
|
]
|
|
@@ -730,19 +730,19 @@ function Xe(i) {
|
|
|
730
730
|
{
|
|
731
731
|
key: "image",
|
|
732
732
|
label: "Image",
|
|
733
|
-
icon:
|
|
733
|
+
icon: Ue,
|
|
734
734
|
onRun: (e) => {
|
|
735
735
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
736
|
-
kt(
|
|
736
|
+
kt(Ce.type(e))(r, s);
|
|
737
737
|
}
|
|
738
738
|
},
|
|
739
739
|
{
|
|
740
740
|
key: "code",
|
|
741
741
|
label: "Code",
|
|
742
|
-
icon:
|
|
742
|
+
icon: Ge,
|
|
743
743
|
onRun: (e) => {
|
|
744
744
|
const n = e.get(y), { dispatch: s, state: r } = n;
|
|
745
|
-
kt(
|
|
745
|
+
kt(de.type(e))(r, s);
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
]
|
|
@@ -770,13 +770,13 @@ function Xe(i) {
|
|
|
770
770
|
size: o.length
|
|
771
771
|
};
|
|
772
772
|
}
|
|
773
|
-
const
|
|
773
|
+
const Jt = ({
|
|
774
774
|
show: i,
|
|
775
775
|
hide: t,
|
|
776
776
|
ctx: o,
|
|
777
777
|
filter: e
|
|
778
778
|
}) => {
|
|
779
|
-
const { groups: n, size: s } =
|
|
779
|
+
const { groups: n, size: s } = fe(() => Ye(e), [e]), r = ge(), [d, u] = we(0), m = qt({ x: -999, y: -999 }), v = W((h) => {
|
|
780
780
|
const a = m.current;
|
|
781
781
|
if (!a)
|
|
782
782
|
return;
|
|
@@ -811,7 +811,7 @@ const Gt = ({
|
|
|
811
811
|
return h.preventDefault(), g((a) => a <= 0 ? a : a - 1, C);
|
|
812
812
|
if (h.key === "ArrowLeft")
|
|
813
813
|
return h.preventDefault(), g((a) => {
|
|
814
|
-
const f = n.find((
|
|
814
|
+
const f = n.find((T) => T.range[0] <= a && T.range[1] > a);
|
|
815
815
|
if (!f)
|
|
816
816
|
return a;
|
|
817
817
|
const H = n[n.indexOf(f) - 1];
|
|
@@ -819,19 +819,19 @@ const Gt = ({
|
|
|
819
819
|
}, C);
|
|
820
820
|
if (h.key === "ArrowRight")
|
|
821
821
|
return h.preventDefault(), g((a) => {
|
|
822
|
-
const f = n.find((
|
|
822
|
+
const f = n.find((T) => T.range[0] <= a && T.range[1] > a);
|
|
823
823
|
if (!f)
|
|
824
824
|
return a;
|
|
825
825
|
const H = n[n.indexOf(f) + 1];
|
|
826
826
|
return H ? H.range[0] : a;
|
|
827
827
|
}, C);
|
|
828
828
|
h.key === "Enter" && (h.preventDefault(), k(d));
|
|
829
|
-
}, [t, n, d]),
|
|
829
|
+
}, [t, n, d]), ee = W((h) => (a) => {
|
|
830
830
|
const f = m.current;
|
|
831
831
|
if (!f)
|
|
832
832
|
return;
|
|
833
|
-
const { x: H, y:
|
|
834
|
-
H === f.x &&
|
|
833
|
+
const { x: H, y: T } = a;
|
|
834
|
+
H === f.x && T === f.y || g(h);
|
|
835
835
|
}, []);
|
|
836
836
|
return yt(() => (i ? document.addEventListener("keydown", b, { capture: !0 }) : document.removeEventListener("keydown", b, { capture: !0 }), () => {
|
|
837
837
|
document.removeEventListener("keydown", b, { capture: !0 });
|
|
@@ -858,7 +858,7 @@ const Gt = ({
|
|
|
858
858
|
key=${a.key}
|
|
859
859
|
data-index=${a.index}
|
|
860
860
|
class=${d === a.index ? "hover" : ""}
|
|
861
|
-
onmouseenter=${
|
|
861
|
+
onmouseenter=${ee(a.index)}
|
|
862
862
|
onmousedown=${() => {
|
|
863
863
|
var f;
|
|
864
864
|
(f = r.current.querySelector(`[data-index="${a.index}"]`)) == null || f.classList.add("active");
|
|
@@ -879,44 +879,45 @@ const Gt = ({
|
|
|
879
879
|
</host>
|
|
880
880
|
`;
|
|
881
881
|
};
|
|
882
|
-
|
|
882
|
+
Jt.props = {
|
|
883
883
|
ctx: Object,
|
|
884
884
|
show: Boolean,
|
|
885
885
|
filter: String,
|
|
886
886
|
hide: Function
|
|
887
887
|
};
|
|
888
|
-
const
|
|
888
|
+
const Qt = Ft(Jt), Xt = Te("CREPE_MENU"), Pt = at({
|
|
889
889
|
show: () => {
|
|
890
890
|
},
|
|
891
891
|
hide: () => {
|
|
892
892
|
}
|
|
893
893
|
}, "menuAPICtx");
|
|
894
|
-
customElements.define("milkdown-slash-menu",
|
|
895
|
-
function
|
|
896
|
-
i.set(
|
|
897
|
-
view: (t) => new
|
|
894
|
+
customElements.define("milkdown-slash-menu", Qt);
|
|
895
|
+
function tn(i) {
|
|
896
|
+
i.set(Xt.key, {
|
|
897
|
+
view: (t) => new en(i, t)
|
|
898
898
|
});
|
|
899
899
|
}
|
|
900
|
-
var M,
|
|
901
|
-
class
|
|
900
|
+
var M, S, B;
|
|
901
|
+
class en {
|
|
902
902
|
constructor(t, o) {
|
|
903
903
|
p(this, M, void 0);
|
|
904
|
+
p(this, S, void 0);
|
|
904
905
|
p(this, B, void 0);
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
l(this, B).update(n);
|
|
906
|
+
c(this, B, null), this.update = (n) => {
|
|
907
|
+
l(this, S).update(n);
|
|
908
908
|
}, this.show = (n) => {
|
|
909
|
-
c(this,
|
|
909
|
+
c(this, B, n), l(this, M).filter = "", l(this, S).show();
|
|
910
910
|
}, this.hide = () => {
|
|
911
|
-
c(this,
|
|
911
|
+
c(this, B, null), l(this, S).hide();
|
|
912
912
|
}, this.destroy = () => {
|
|
913
|
-
l(this,
|
|
914
|
-
}, c(this, M, new
|
|
913
|
+
l(this, S).destroy(), l(this, M).remove();
|
|
914
|
+
}, c(this, M, new Qt()), l(this, M).hide = this.hide, l(this, M).ctx = t;
|
|
915
915
|
const e = this;
|
|
916
|
-
c(this,
|
|
916
|
+
c(this, S, new Ie({
|
|
917
917
|
content: l(this, M),
|
|
918
918
|
debounce: 20,
|
|
919
919
|
tippyOptions: {
|
|
920
|
+
appendTo: () => t.get(zt),
|
|
920
921
|
onShow: () => {
|
|
921
922
|
l(this, M).show = !0;
|
|
922
923
|
},
|
|
@@ -925,13 +926,13 @@ class tn {
|
|
|
925
926
|
}
|
|
926
927
|
},
|
|
927
928
|
shouldShow(n) {
|
|
928
|
-
if (
|
|
929
|
+
if (ue(n.state.selection) || me(n.state.selection))
|
|
929
930
|
return !1;
|
|
930
931
|
const s = this.getContent(n, (d) => ["paragraph", "heading"].includes(d.type.name));
|
|
931
932
|
if (s == null)
|
|
932
933
|
return !1;
|
|
933
|
-
const r = l(e,
|
|
934
|
-
return l(e, M).filter = s.startsWith("/") ? s.slice(1) : s, typeof r == "number" ? n.state.doc.resolve(r).node() !== n.state.doc.resolve(n.state.selection.from).node() ? (c(e,
|
|
934
|
+
const r = l(e, B);
|
|
935
|
+
return l(e, M).filter = s.startsWith("/") ? s.slice(1) : s, typeof r == "number" ? n.state.doc.resolve(r).node() !== n.state.doc.resolve(n.state.selection.from).node() ? (c(e, B, null), !1) : !0 : !!s.startsWith("/");
|
|
935
936
|
}
|
|
936
937
|
})), this.update(o), t.set(Pt.key, {
|
|
937
938
|
show: (n) => this.show(n),
|
|
@@ -939,8 +940,8 @@ class tn {
|
|
|
939
940
|
});
|
|
940
941
|
}
|
|
941
942
|
}
|
|
942
|
-
M = new WeakMap(),
|
|
943
|
-
const
|
|
943
|
+
M = new WeakMap(), S = new WeakMap(), B = new WeakMap();
|
|
944
|
+
const nn = w`
|
|
944
945
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
945
946
|
<g clip-path="url(#clip0_971_7680)">
|
|
946
947
|
<path d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z" fill="#817567"/>
|
|
@@ -951,7 +952,7 @@ const en = w`
|
|
|
951
952
|
</clipPath>
|
|
952
953
|
</defs>
|
|
953
954
|
</svg>
|
|
954
|
-
`,
|
|
955
|
+
`, on = w`
|
|
955
956
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
956
957
|
<g clip-path="url(#clip0_971_7676)">
|
|
957
958
|
<path d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z" fill="#817567"/>
|
|
@@ -962,8 +963,8 @@ const en = w`
|
|
|
962
963
|
</clipPath>
|
|
963
964
|
</defs>
|
|
964
965
|
</svg>
|
|
965
|
-
`,
|
|
966
|
-
const t =
|
|
966
|
+
`, Yt = ({ onAdd: i }) => {
|
|
967
|
+
const t = qt();
|
|
967
968
|
return yt(() => {
|
|
968
969
|
var n;
|
|
969
970
|
(n = t.current) == null || n.classList.remove("active");
|
|
@@ -976,21 +977,21 @@ const en = w`
|
|
|
976
977
|
var s;
|
|
977
978
|
n.preventDefault(), n.stopPropagation(), i == null || i(), (s = t.current) == null || s.classList.remove("active");
|
|
978
979
|
}} class="operation-item">
|
|
979
|
-
${
|
|
980
|
+
${on}
|
|
980
981
|
</div>
|
|
981
982
|
<div class="operation-item">
|
|
982
|
-
${
|
|
983
|
+
${nn}
|
|
983
984
|
</div>
|
|
984
985
|
</host>
|
|
985
986
|
`;
|
|
986
987
|
};
|
|
987
|
-
|
|
988
|
+
Yt.props = {
|
|
988
989
|
show: Boolean,
|
|
989
990
|
onAdd: Function
|
|
990
991
|
};
|
|
991
|
-
const
|
|
992
|
+
const te = Ft(Yt);
|
|
992
993
|
var $, Z, ct;
|
|
993
|
-
class
|
|
994
|
+
class sn {
|
|
994
995
|
constructor(t, o) {
|
|
995
996
|
p(this, $, void 0);
|
|
996
997
|
p(this, Z, void 0);
|
|
@@ -1009,11 +1010,12 @@ class on {
|
|
|
1009
1010
|
let b = r.tr.insert(C, Nt.type(n).create());
|
|
1010
1011
|
b = b.setSelection(Ot.create(b.doc, C + k)), d(b.scrollIntoView()), l(this, Z).hide(), n.get(Pt.key).show(b.selection.from);
|
|
1011
1012
|
}, c(this, ct, t);
|
|
1012
|
-
const e = new
|
|
1013
|
-
c(this, $, e), l(this, $).onAdd = this.onAdd, c(this, Z, new
|
|
1013
|
+
const e = new te();
|
|
1014
|
+
c(this, $, e), l(this, $).onAdd = this.onAdd, c(this, Z, new Ee({
|
|
1014
1015
|
ctx: t,
|
|
1015
1016
|
content: e,
|
|
1016
1017
|
tippyOptions: {
|
|
1018
|
+
appendTo: () => t.get(zt),
|
|
1017
1019
|
onShow: () => {
|
|
1018
1020
|
l(this, $).show = !0;
|
|
1019
1021
|
},
|
|
@@ -1025,15 +1027,15 @@ class on {
|
|
|
1025
1027
|
}
|
|
1026
1028
|
}
|
|
1027
1029
|
$ = new WeakMap(), Z = new WeakMap(), ct = new WeakMap();
|
|
1028
|
-
customElements.define("milkdown-block-handle",
|
|
1029
|
-
function
|
|
1030
|
+
customElements.define("milkdown-block-handle", te);
|
|
1031
|
+
function ln(i) {
|
|
1030
1032
|
i.set(ft.key, {
|
|
1031
|
-
view: (t) => new
|
|
1033
|
+
view: (t) => new sn(i, t)
|
|
1032
1034
|
});
|
|
1033
1035
|
}
|
|
1034
|
-
const
|
|
1035
|
-
i.config(
|
|
1036
|
+
const rn = '.milkdown milkdown-block-handle{cursor:pointer;display:flex;justify-content:center;align-items:center;gap:2px;padding-right:4px}.milkdown milkdown-block-handle .operation-item{border-radius:4px;width:32px;height:32px;padding:4px}.milkdown milkdown-block-handle .operation-item svg{width:24px;height:24px}.milkdown milkdown-block-handle .operation-item:hover{background:var(--crepe-color-hover)}.milkdown milkdown-block-handle .operation-item.active{background:var(--crepe-color-selected)}.milkdown milkdown-slash-menu{display:block;width:254px;font-family:var(--crepe-font-default);color:var(--crepe-color-on-surface);background:var(--crepe-color-surface);border-radius:12px;box-shadow:var(--crepe-shadow-1)}.milkdown milkdown-slash-menu ul{list-style-type:none}.milkdown milkdown-slash-menu ul li{cursor:pointer;border-radius:8px}.milkdown milkdown-slash-menu .tab-group{border-bottom:1px solid color-mix(in srgb,var(--crepe-color-outline),transparent 80%);padding:12px 12px 0}.milkdown milkdown-slash-menu .tab-group ul{padding:8px 10px;display:flex;gap:10px;flex-wrap:nowrap}.milkdown milkdown-slash-menu .tab-group ul li{padding:6px 10px;font-size:14px;font-style:normal;font-weight:600;line-height:20px}.milkdown milkdown-slash-menu .tab-group ul li:hover{background:var(--crepe-color-hover)}.milkdown milkdown-slash-menu .tab-group ul li.selected{background:var(--crepe-color-selected)}.milkdown milkdown-slash-menu .menu-groups{padding:0 12px 12px;max-height:420px;overflow:auto}.milkdown milkdown-slash-menu .menu-groups .menu-group h6{font-size:14px;font-style:normal;font-weight:600;line-height:20px;padding:14px 10px;text-transform:uppercase;color:color-mix(in srgb,var(--crepe-color-on-surface),transparent 40%)}.milkdown milkdown-slash-menu .menu-groups .menu-group li{display:flex;justify-content:flex-start;align-items:center;gap:16px;padding:14px 10px}.milkdown milkdown-slash-menu .menu-groups .menu-group li.hover{background:var(--crepe-color-hover)}.milkdown milkdown-slash-menu .menu-groups .menu-group li.active{background:var(--crepe-color-selected)}.milkdown milkdown-slash-menu .menu-groups .menu-group li>svg{width:24px;height:24px;color:var(--crepe-color-outline)}.milkdown milkdown-slash-menu .menu-groups .menu-group li>span{font-size:14px;font-style:normal;font-weight:600;line-height:20px}.milkdown milkdown-slash-menu .menu-groups .menu-group+.menu-group:before{content:"";display:block;height:1px;background:color-mix(in srgb,var(--crepe-color-outline),transparent 80%);margin:0 10px}', gn = (i) => {
|
|
1037
|
+
i.config(pe(rn)).config(ln).config(tn).use(Pt).use(ft).use(Xt);
|
|
1036
1038
|
};
|
|
1037
1039
|
export {
|
|
1038
|
-
|
|
1040
|
+
gn as defineFeature
|
|
1039
1041
|
};
|