@blocknote/core 0.43.0 → 0.44.0
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/dist/{BlockNoteSchema-D8TyvlfU.cjs → BlockNoteSchema-B4gm-Qco.cjs} +2 -2
- package/dist/{BlockNoteSchema-D8TyvlfU.cjs.map → BlockNoteSchema-B4gm-Qco.cjs.map} +1 -1
- package/dist/{BlockNoteSchema-CbSavEwr.js → BlockNoteSchema-C-l154WP.js} +2 -2
- package/dist/{BlockNoteSchema-CbSavEwr.js.map → BlockNoteSchema-C-l154WP.js.map} +1 -1
- package/dist/{TrailingNode-BUhuMJrB.js → TrailingNode-B_zPMWxw.js} +235 -233
- package/dist/{TrailingNode-BUhuMJrB.js.map → TrailingNode-B_zPMWxw.js.map} +1 -1
- package/dist/TrailingNode-CRHrgOnK.cjs +2 -0
- package/dist/{TrailingNode-CaT_wbho.cjs.map → TrailingNode-CRHrgOnK.cjs.map} +1 -1
- package/dist/blocknote.cjs +4 -4
- package/dist/blocknote.cjs.map +1 -1
- package/dist/blocknote.js +508 -506
- package/dist/blocknote.js.map +1 -1
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +2 -2
- package/dist/defaultBlocks-DLJ4Q1_J.cjs +6 -0
- package/dist/{defaultBlocks-BxFclIGP.cjs.map → defaultBlocks-DLJ4Q1_J.cjs.map} +1 -1
- package/dist/{defaultBlocks-BJtxTOM2.js → defaultBlocks-DgA_mtQV.js} +463 -460
- package/dist/{defaultBlocks-BJtxTOM2.js.map → defaultBlocks-DgA_mtQV.js.map} +1 -1
- package/dist/extensions.cjs +1 -1
- package/dist/extensions.js +3 -3
- package/dist/webpack-stats.json +1 -1
- package/package.json +1 -1
- package/dist/TrailingNode-CaT_wbho.cjs +0 -2
- package/dist/defaultBlocks-BxFclIGP.cjs +0 -6
package/dist/blocknote.js
CHANGED
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (n, e, t) =>
|
|
4
|
-
import { Slice as
|
|
5
|
-
import { ReplaceStep as
|
|
6
|
-
import { n as U, i as O, g as B, b as Y, a as b, t as
|
|
7
|
-
import { B as
|
|
8
|
-
import { ak as $, al as
|
|
9
|
-
import { aw as
|
|
10
|
-
import { j as
|
|
11
|
-
import { s as
|
|
12
|
-
import { C as
|
|
13
|
-
import { Node as
|
|
14
|
-
import { E as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
|
|
1
|
+
var Ne = Object.defineProperty;
|
|
2
|
+
var Oe = (n, e, t) => e in n ? Ne(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var h = (n, e, t) => Oe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { Slice as N, Fragment as A, DOMSerializer as he, DOMParser as Fe, Node as He } from "prosemirror-model";
|
|
5
|
+
import { ReplaceStep as $e, ReplaceAroundStep as V } from "prosemirror-transform";
|
|
6
|
+
import { n as U, i as O, g as B, b as Y, a as b, t as Ve, U as F, q as _, r as H, d as Ue, s as ze, u as Ge, v as q, w as S, x as me, y as Re, z as ke, A as z } from "./blockToNode-DBNbhwwC.js";
|
|
7
|
+
import { B as es, G as ts, C as os, D as ns, N as ss, E as rs, O as is, F as as, H as cs, I as ls, L as ds, J as us, M as ps, K as fs } from "./blockToNode-DBNbhwwC.js";
|
|
8
|
+
import { ak as $, al as je, am as We, an as Ke, aj as E, ao as Je, ap as Ye, a5 as qe, a8 as G, aq as Qe, ar as Xe, a6 as Ze, as as Q, a9 as ge, at as et } from "./defaultBlocks-DgA_mtQV.js";
|
|
9
|
+
import { aw as ms, av as ks, E as gs, a as bs, F as ys, r as Ss, N as Bs, a4 as Cs, ad as Es, aG as xs, ax as Ms, b as ws, d as Ts, e as Ps, a0 as vs, aM as Is, au as As, c as _s, f as Ds, ag as Ls, ah as Ns, aB as Os, x as Fs, y as Hs, A as $s, z as Vs, g as Us, h as zs, T as Gs, j as Rs, k as js, l as Ws, n as Ks, o as Js, q as Ys, s as qs, w as Qs, aC as Xs, aH as Zs, B as er, C as tr, H as or, I as nr, J as sr, K as rr, aE as ir, aI as ar, M as cr, D as lr, G as dr, S as ur, O as pr, Q as fr, W as hr, U as mr, _ as kr, Z as gr, a2 as br, Y as yr, X as Sr, R as Br, $ as Cr, m as Er, aN as xr, aK as Mr, az as wr, af as Tr, i as Pr, ay as vr, aD as Ir, ae as Ar, a7 as _r, t as Dr, u as Lr, v as Nr, aJ as Or, ai as Fr, aL as Hr, a1 as $r, V as Vr, p as Ur, a3 as zr, aF as Gr, L as Rr, aO as jr, P as Wr, aA as Kr } from "./defaultBlocks-DgA_mtQV.js";
|
|
10
|
+
import { j as tt, k as be, l as ot, m as nt, n as st, c as R, B as rt, D as it, L as at, N as ct, P as lt, g as dt, i as ut, F as pt, Y as ft, a as ht, b as mt, S as kt, H as gt, h as bt, e as yt, V as St, d as Bt } from "./TrailingNode-B_zPMWxw.js";
|
|
11
|
+
import { s as Ct, B as Et } from "./BlockNoteSchema-C-l154WP.js";
|
|
12
|
+
import { C as Yr, b as qr, c as Qr, a as Xr, g as Zr, u as ei, w as ti } from "./BlockNoteSchema-C-l154WP.js";
|
|
13
|
+
import { Node as D, Extension as x, mergeAttributes as xt, Mark as X, extensions as I, isNodeSelection as Mt, posToDOMRect as wt, selectionToInsertionEnd as Tt, getSchema as Pt, createDocument as vt, Editor as It } from "@tiptap/core";
|
|
14
|
+
import { E as ye } from "./EventEmitter-CjSwpTbz.js";
|
|
15
|
+
import { Fragment as Z, Slice as ne } from "@tiptap/pm/model";
|
|
16
|
+
import { e as At } from "./en-njEqD7AG.js";
|
|
17
|
+
import { inputRules as _t, InputRule as Dt } from "@handlewithcare/prosemirror-inputrules";
|
|
18
|
+
import { keymap as Lt } from "@tiptap/pm/keymap";
|
|
19
|
+
import { o as Nt } from "./BlockNoteExtension-C2X7LW-V.js";
|
|
20
|
+
import { c as ni, a as si } from "./BlockNoteExtension-C2X7LW-V.js";
|
|
21
|
+
import { Gapcursor as Ot } from "@tiptap/extension-gapcursor";
|
|
22
|
+
import { Link as Ft } from "@tiptap/extension-link";
|
|
23
|
+
import { Text as Ht } from "@tiptap/extension-text";
|
|
24
|
+
import { NodeSelection as L, TextSelection as M, Plugin as ee } from "prosemirror-state";
|
|
25
|
+
import { CellSelection as te, TableMap as se } from "prosemirror-tables";
|
|
26
|
+
import { S as $t } from "./ShowSelection-Dz-NEase.js";
|
|
27
|
+
import Vt from "remark-gfm";
|
|
28
|
+
import Ut from "remark-parse";
|
|
29
|
+
import zt, { defaultHandlers as re } from "remark-rehype";
|
|
30
|
+
import Gt from "rehype-stringify";
|
|
31
|
+
import { unified as Rt } from "unified";
|
|
32
|
+
import { TextSelection as jt } from "@tiptap/pm/state";
|
|
33
|
+
function Wt(n, e) {
|
|
32
34
|
const t = [
|
|
33
35
|
{
|
|
34
36
|
tag: `[data-inline-content-type="${n.type}"]`,
|
|
@@ -48,9 +50,9 @@ function Gt(n, e) {
|
|
|
48
50
|
}
|
|
49
51
|
}), t;
|
|
50
52
|
}
|
|
51
|
-
function
|
|
53
|
+
function Jn(n, e) {
|
|
52
54
|
var o;
|
|
53
|
-
const t =
|
|
55
|
+
const t = D.create({
|
|
54
56
|
name: n.type,
|
|
55
57
|
inline: !0,
|
|
56
58
|
group: "inline",
|
|
@@ -59,13 +61,13 @@ function Gn(n, e) {
|
|
|
59
61
|
atom: n.content === "none",
|
|
60
62
|
content: n.content === "styled" ? "inline*" : "",
|
|
61
63
|
addAttributes() {
|
|
62
|
-
return
|
|
64
|
+
return We(n.propSchema);
|
|
63
65
|
},
|
|
64
66
|
addKeyboardShortcuts() {
|
|
65
|
-
return
|
|
67
|
+
return je(n);
|
|
66
68
|
},
|
|
67
69
|
parseHTML() {
|
|
68
|
-
return
|
|
70
|
+
return Wt(
|
|
69
71
|
n,
|
|
70
72
|
e.parse
|
|
71
73
|
);
|
|
@@ -117,7 +119,7 @@ function Gn(n, e) {
|
|
|
117
119
|
};
|
|
118
120
|
}
|
|
119
121
|
});
|
|
120
|
-
return
|
|
122
|
+
return Ke(
|
|
121
123
|
t,
|
|
122
124
|
n.propSchema,
|
|
123
125
|
{
|
|
@@ -139,15 +141,15 @@ function Gn(n, e) {
|
|
|
139
141
|
}
|
|
140
142
|
);
|
|
141
143
|
}
|
|
142
|
-
function
|
|
144
|
+
function Kt(n, e, t, o = "before") {
|
|
143
145
|
const s = typeof t == "string" ? t : t.id, i = B(n), r = e.map(
|
|
144
146
|
(d) => Y(d, i)
|
|
145
|
-
), c =
|
|
147
|
+
), c = E(s, n.doc);
|
|
146
148
|
if (!c)
|
|
147
149
|
throw new Error(`Block with ID ${s} not found`);
|
|
148
150
|
let a = c.posBeforeNode;
|
|
149
151
|
return o === "after" && (a += c.node.nodeSize), n.step(
|
|
150
|
-
new
|
|
152
|
+
new $e(a, a, new N(A.from(r), 0, 0))
|
|
151
153
|
), r.map(
|
|
152
154
|
(d) => b(d, i)
|
|
153
155
|
);
|
|
@@ -163,7 +165,7 @@ function j(n) {
|
|
|
163
165
|
throw new Error("Invalid blockContainer: does not have child node.");
|
|
164
166
|
return n.childCount === 1 && e.childCount === 1 && t.type.name === "paragraph" && t.content.content.length === 0;
|
|
165
167
|
}
|
|
166
|
-
function
|
|
168
|
+
function Jt(n, e) {
|
|
167
169
|
const t = n.doc.resolve(e), o = t.nodeAfter;
|
|
168
170
|
if (!o || o.type.name !== "columnList")
|
|
169
171
|
throw new Error(
|
|
@@ -177,7 +179,7 @@ function jt(n, e) {
|
|
|
177
179
|
}
|
|
178
180
|
}
|
|
179
181
|
function W(n, e) {
|
|
180
|
-
|
|
182
|
+
Jt(n, e);
|
|
181
183
|
const o = n.doc.resolve(e).nodeAfter;
|
|
182
184
|
if (!o || o.type.name !== "columnList")
|
|
183
185
|
throw new Error(
|
|
@@ -205,7 +207,7 @@ function W(n, e) {
|
|
|
205
207
|
c - l.nodeSize + 1,
|
|
206
208
|
c - 1,
|
|
207
209
|
// Doesn't append anything.
|
|
208
|
-
|
|
210
|
+
N.empty,
|
|
209
211
|
0,
|
|
210
212
|
!1
|
|
211
213
|
)
|
|
@@ -222,7 +224,7 @@ function W(n, e) {
|
|
|
222
224
|
s + 1,
|
|
223
225
|
s + r.nodeSize - 1,
|
|
224
226
|
// Doesn't append anything.
|
|
225
|
-
|
|
227
|
+
N.empty,
|
|
226
228
|
0,
|
|
227
229
|
!1
|
|
228
230
|
)
|
|
@@ -230,7 +232,7 @@ function W(n, e) {
|
|
|
230
232
|
return;
|
|
231
233
|
}
|
|
232
234
|
}
|
|
233
|
-
function
|
|
235
|
+
function ie(n, e, t) {
|
|
234
236
|
const o = B(n), s = t.map(
|
|
235
237
|
(u) => Y(u, o)
|
|
236
238
|
), i = new Set(
|
|
@@ -265,7 +267,7 @@ function se(n, e, t) {
|
|
|
265
267
|
(u) => b(u, o)
|
|
266
268
|
), removedBlocks: r };
|
|
267
269
|
}
|
|
268
|
-
function
|
|
270
|
+
function Yt(n, e, t, o, s) {
|
|
269
271
|
let i;
|
|
270
272
|
if (e)
|
|
271
273
|
if (typeof e == "string")
|
|
@@ -273,7 +275,7 @@ function Wt(n, e, t, o, s) {
|
|
|
273
275
|
else if (Array.isArray(e))
|
|
274
276
|
i = O(e, n.pmSchema, o);
|
|
275
277
|
else if (e.type === "tableContent")
|
|
276
|
-
i =
|
|
278
|
+
i = Ve(e, n.pmSchema);
|
|
277
279
|
else
|
|
278
280
|
throw new F(e.type);
|
|
279
281
|
else throw new Error("blockContent is required");
|
|
@@ -316,20 +318,20 @@ function Wt(n, e, t, o, s) {
|
|
|
316
318
|
const u = n.schema.styleSpecs[d.type.name].implementation.render(d.attrs.stringValue, n);
|
|
317
319
|
u.contentDOM.appendChild(l), l = u.dom;
|
|
318
320
|
} else {
|
|
319
|
-
const u = d.type.spec.toDOM(d, !0), p =
|
|
321
|
+
const u = d.type.spec.toDOM(d, !0), p = he.renderSpec(document, u);
|
|
320
322
|
p.contentDOM.appendChild(l), l = p.dom;
|
|
321
323
|
}
|
|
322
324
|
c.appendChild(l);
|
|
323
325
|
} else {
|
|
324
326
|
const l = t.serializeFragment(
|
|
325
|
-
|
|
327
|
+
A.from([a]),
|
|
326
328
|
s
|
|
327
329
|
);
|
|
328
330
|
c.appendChild(l);
|
|
329
331
|
}
|
|
330
332
|
return c;
|
|
331
333
|
}
|
|
332
|
-
function
|
|
334
|
+
function qt(n, e, t, o) {
|
|
333
335
|
var u, p, m, f, k;
|
|
334
336
|
const s = n.pmSchema.nodes.blockContainer, i = e.props || {};
|
|
335
337
|
for (const [g, y] of Object.entries(
|
|
@@ -345,7 +347,7 @@ function Kt(n, e, t, o) {
|
|
|
345
347
|
n
|
|
346
348
|
);
|
|
347
349
|
if (a.contentDOM && e.content) {
|
|
348
|
-
const g =
|
|
350
|
+
const g = Yt(
|
|
349
351
|
n,
|
|
350
352
|
e.content,
|
|
351
353
|
// TODO
|
|
@@ -357,7 +359,7 @@ function Kt(n, e, t, o) {
|
|
|
357
359
|
}
|
|
358
360
|
if (n.pmSchema.nodes[e.type].isInGroup("bnBlock")) {
|
|
359
361
|
if (e.children && e.children.length > 0) {
|
|
360
|
-
const g =
|
|
362
|
+
const g = Se(
|
|
361
363
|
n,
|
|
362
364
|
e.children,
|
|
363
365
|
t,
|
|
@@ -375,44 +377,44 @@ function Kt(n, e, t, o) {
|
|
|
375
377
|
})
|
|
376
378
|
);
|
|
377
379
|
return (f = d.contentDOM) == null || f.appendChild(a.dom), e.children && e.children.length > 0 && ((k = d.contentDOM) == null || k.appendChild(
|
|
378
|
-
|
|
380
|
+
Be(n, e.children, t, o)
|
|
379
381
|
)), d.dom;
|
|
380
382
|
}
|
|
381
|
-
function
|
|
383
|
+
function Se(n, e, t, o) {
|
|
382
384
|
const i = ((o == null ? void 0 : o.document) ?? document).createDocumentFragment();
|
|
383
385
|
for (const r of e) {
|
|
384
|
-
const c =
|
|
386
|
+
const c = qt(n, r, t, o);
|
|
385
387
|
i.appendChild(c);
|
|
386
388
|
}
|
|
387
389
|
return i;
|
|
388
390
|
}
|
|
389
|
-
const
|
|
391
|
+
const Be = (n, e, t, o) => {
|
|
390
392
|
var c;
|
|
391
|
-
const s = n.pmSchema.nodes.blockGroup, i = s.spec.toDOM(s.create({})), r =
|
|
393
|
+
const s = n.pmSchema.nodes.blockGroup, i = s.spec.toDOM(s.create({})), r = Se(n, e, t, o);
|
|
392
394
|
return (c = i.contentDOM) == null || c.appendChild(r), i.dom;
|
|
393
|
-
},
|
|
394
|
-
const t =
|
|
395
|
+
}, Qt = (n, e) => {
|
|
396
|
+
const t = he.fromSchema(n);
|
|
395
397
|
return {
|
|
396
|
-
serializeBlocks: (o, s) =>
|
|
398
|
+
serializeBlocks: (o, s) => Be(e, o, t, s).outerHTML
|
|
397
399
|
};
|
|
398
400
|
};
|
|
399
|
-
function
|
|
401
|
+
function Xt(n) {
|
|
400
402
|
return n.transact((e) => {
|
|
401
|
-
const t =
|
|
402
|
-
if (e.selection instanceof
|
|
403
|
+
const t = _(e.doc, e.selection.anchor);
|
|
404
|
+
if (e.selection instanceof te)
|
|
403
405
|
return {
|
|
404
406
|
type: "cell",
|
|
405
407
|
anchorBlockId: t.node.attrs.id,
|
|
406
408
|
anchorCellOffset: e.selection.$anchorCell.pos - t.posBeforeNode,
|
|
407
409
|
headCellOffset: e.selection.$headCell.pos - t.posBeforeNode
|
|
408
410
|
};
|
|
409
|
-
if (e.selection instanceof
|
|
411
|
+
if (e.selection instanceof L)
|
|
410
412
|
return {
|
|
411
413
|
type: "node",
|
|
412
414
|
anchorBlockId: t.node.attrs.id
|
|
413
415
|
};
|
|
414
416
|
{
|
|
415
|
-
const o =
|
|
417
|
+
const o = _(e.doc, e.selection.head);
|
|
416
418
|
return {
|
|
417
419
|
type: "text",
|
|
418
420
|
anchorBlockId: t.node.attrs.id,
|
|
@@ -423,29 +425,29 @@ function Yt(n) {
|
|
|
423
425
|
}
|
|
424
426
|
});
|
|
425
427
|
}
|
|
426
|
-
function
|
|
428
|
+
function Zt(n, e) {
|
|
427
429
|
var s, i;
|
|
428
|
-
const t = (s =
|
|
430
|
+
const t = (s = E(e.anchorBlockId, n.doc)) == null ? void 0 : s.posBeforeNode;
|
|
429
431
|
if (t === void 0)
|
|
430
432
|
throw new Error(
|
|
431
433
|
`Could not find block with ID ${e.anchorBlockId} to update selection`
|
|
432
434
|
);
|
|
433
435
|
let o;
|
|
434
436
|
if (e.type === "cell")
|
|
435
|
-
o =
|
|
437
|
+
o = te.create(
|
|
436
438
|
n.doc,
|
|
437
439
|
t + e.anchorCellOffset,
|
|
438
440
|
t + e.headCellOffset
|
|
439
441
|
);
|
|
440
442
|
else if (e.type === "node")
|
|
441
|
-
o =
|
|
443
|
+
o = L.create(n.doc, t + 1);
|
|
442
444
|
else {
|
|
443
|
-
const r = (i =
|
|
445
|
+
const r = (i = E(e.headBlockId, n.doc)) == null ? void 0 : i.posBeforeNode;
|
|
444
446
|
if (r === void 0)
|
|
445
447
|
throw new Error(
|
|
446
448
|
`Could not find block with ID ${e.headBlockId} to update selection`
|
|
447
449
|
);
|
|
448
|
-
o =
|
|
450
|
+
o = M.create(
|
|
449
451
|
n.doc,
|
|
450
452
|
t + e.anchorOffset,
|
|
451
453
|
r + e.headOffset
|
|
@@ -459,69 +461,69 @@ function K(n) {
|
|
|
459
461
|
children: K(e.children)
|
|
460
462
|
}).flat();
|
|
461
463
|
}
|
|
462
|
-
function
|
|
464
|
+
function Ce(n, e, t) {
|
|
463
465
|
n.transact((o) => {
|
|
464
466
|
var r;
|
|
465
467
|
const s = ((r = n.getSelection()) == null ? void 0 : r.blocks) || [
|
|
466
468
|
n.getTextCursorPosition().block
|
|
467
|
-
], i =
|
|
468
|
-
n.removeBlocks(s), n.insertBlocks(K(s), e, t),
|
|
469
|
+
], i = Xt(n);
|
|
470
|
+
n.removeBlocks(s), n.insertBlocks(K(s), e, t), Zt(o, i);
|
|
469
471
|
});
|
|
470
472
|
}
|
|
471
|
-
function
|
|
473
|
+
function Ee(n) {
|
|
472
474
|
return !n || n.type !== "columnList";
|
|
473
475
|
}
|
|
474
|
-
function
|
|
476
|
+
function xe(n, e, t) {
|
|
475
477
|
let o, s;
|
|
476
478
|
if (e ? e.children.length > 0 ? (o = e.children[e.children.length - 1], s = "after") : (o = e, s = "before") : t && (o = t, s = "before"), !o || !s)
|
|
477
479
|
return;
|
|
478
480
|
const i = n.getParentBlock(o);
|
|
479
|
-
return
|
|
481
|
+
return Ee(i) ? { referenceBlock: o, placement: s } : xe(
|
|
480
482
|
n,
|
|
481
483
|
s === "after" ? o : n.getPrevBlock(o),
|
|
482
484
|
i
|
|
483
485
|
);
|
|
484
486
|
}
|
|
485
|
-
function
|
|
487
|
+
function Me(n, e, t) {
|
|
486
488
|
let o, s;
|
|
487
489
|
if (e ? e.children.length > 0 ? (o = e.children[0], s = "before") : (o = e, s = "after") : t && (o = t, s = "after"), !o || !s)
|
|
488
490
|
return;
|
|
489
491
|
const i = n.getParentBlock(o);
|
|
490
|
-
return
|
|
492
|
+
return Ee(i) ? { referenceBlock: o, placement: s } : Me(
|
|
491
493
|
n,
|
|
492
494
|
s === "before" ? o : n.getNextBlock(o),
|
|
493
495
|
i
|
|
494
496
|
);
|
|
495
497
|
}
|
|
496
|
-
function
|
|
498
|
+
function eo(n) {
|
|
497
499
|
n.transact(() => {
|
|
498
|
-
const e = n.getSelection(), t = (e == null ? void 0 : e.blocks[0]) || n.getTextCursorPosition().block, o =
|
|
500
|
+
const e = n.getSelection(), t = (e == null ? void 0 : e.blocks[0]) || n.getTextCursorPosition().block, o = xe(
|
|
499
501
|
n,
|
|
500
502
|
n.getPrevBlock(t),
|
|
501
503
|
n.getParentBlock(t)
|
|
502
504
|
);
|
|
503
|
-
o &&
|
|
505
|
+
o && Ce(
|
|
504
506
|
n,
|
|
505
507
|
o.referenceBlock,
|
|
506
508
|
o.placement
|
|
507
509
|
);
|
|
508
510
|
});
|
|
509
511
|
}
|
|
510
|
-
function
|
|
512
|
+
function to(n) {
|
|
511
513
|
n.transact(() => {
|
|
512
|
-
const e = n.getSelection(), t = (e == null ? void 0 : e.blocks[(e == null ? void 0 : e.blocks.length) - 1]) || n.getTextCursorPosition().block, o =
|
|
514
|
+
const e = n.getSelection(), t = (e == null ? void 0 : e.blocks[(e == null ? void 0 : e.blocks.length) - 1]) || n.getTextCursorPosition().block, o = Me(
|
|
513
515
|
n,
|
|
514
516
|
n.getNextBlock(t),
|
|
515
517
|
n.getParentBlock(t)
|
|
516
518
|
);
|
|
517
|
-
o &&
|
|
519
|
+
o && Ce(
|
|
518
520
|
n,
|
|
519
521
|
o.referenceBlock,
|
|
520
522
|
o.placement
|
|
521
523
|
);
|
|
522
524
|
});
|
|
523
525
|
}
|
|
524
|
-
function
|
|
526
|
+
function oo(n, e, t) {
|
|
525
527
|
const { $from: o, $to: s } = n.selection, i = o.blockRange(
|
|
526
528
|
s,
|
|
527
529
|
(f) => f.childCount > 0 && (f.type.name === "blockGroup" || f.type.name === "column")
|
|
@@ -535,9 +537,9 @@ function Zt(n, e, t) {
|
|
|
535
537
|
const a = i.parent.child(r - 1);
|
|
536
538
|
if (a.type !== e)
|
|
537
539
|
return !1;
|
|
538
|
-
const l = a.lastChild && a.lastChild.type === t, d =
|
|
539
|
-
|
|
540
|
-
e.create(null,
|
|
540
|
+
const l = a.lastChild && a.lastChild.type === t, d = A.from(l ? e.create() : null), u = new N(
|
|
541
|
+
A.from(
|
|
542
|
+
e.create(null, A.from(t.create(null, d)))
|
|
541
543
|
// change necessary to create "groupType" instead of parent.type
|
|
542
544
|
),
|
|
543
545
|
l ? 3 : 1,
|
|
@@ -555,43 +557,43 @@ function Zt(n, e, t) {
|
|
|
555
557
|
)
|
|
556
558
|
).scrollIntoView(), !0;
|
|
557
559
|
}
|
|
558
|
-
function
|
|
559
|
-
return n.transact((e) =>
|
|
560
|
+
function we(n) {
|
|
561
|
+
return n.transact((e) => oo(
|
|
560
562
|
e,
|
|
561
563
|
n.pmSchema.nodes.blockContainer,
|
|
562
564
|
n.pmSchema.nodes.blockGroup
|
|
563
565
|
));
|
|
564
566
|
}
|
|
565
|
-
function
|
|
567
|
+
function no(n) {
|
|
566
568
|
n._tiptapEditor.commands.liftListItem("blockContainer");
|
|
567
569
|
}
|
|
568
|
-
function
|
|
570
|
+
function so(n) {
|
|
569
571
|
return n.transact((e) => {
|
|
570
572
|
const { bnBlock: t } = H(e);
|
|
571
573
|
return e.doc.resolve(t.beforePos).nodeBefore !== null;
|
|
572
574
|
});
|
|
573
575
|
}
|
|
574
|
-
function
|
|
576
|
+
function ro(n) {
|
|
575
577
|
return n.transact((e) => {
|
|
576
578
|
const { bnBlock: t } = H(e);
|
|
577
579
|
return e.doc.resolve(t.beforePos).depth > 1;
|
|
578
580
|
});
|
|
579
581
|
}
|
|
580
|
-
function
|
|
581
|
-
const t = typeof e == "string" ? e : e.id, o = B(n), s =
|
|
582
|
+
function io(n, e) {
|
|
583
|
+
const t = typeof e == "string" ? e : e.id, o = B(n), s = E(t, n);
|
|
582
584
|
if (s)
|
|
583
585
|
return b(s.node, o);
|
|
584
586
|
}
|
|
585
|
-
function
|
|
586
|
-
const t = typeof e == "string" ? e : e.id, o =
|
|
587
|
+
function ao(n, e) {
|
|
588
|
+
const t = typeof e == "string" ? e : e.id, o = E(t, n), s = B(n);
|
|
587
589
|
if (!o)
|
|
588
590
|
return;
|
|
589
591
|
const r = n.resolve(o.posBeforeNode).nodeBefore;
|
|
590
592
|
if (r)
|
|
591
593
|
return b(r, s);
|
|
592
594
|
}
|
|
593
|
-
function
|
|
594
|
-
const t = typeof e == "string" ? e : e.id, o =
|
|
595
|
+
function co(n, e) {
|
|
596
|
+
const t = typeof e == "string" ? e : e.id, o = E(t, n), s = B(n);
|
|
595
597
|
if (!o)
|
|
596
598
|
return;
|
|
597
599
|
const r = n.resolve(
|
|
@@ -600,15 +602,15 @@ function ro(n, e) {
|
|
|
600
602
|
if (r)
|
|
601
603
|
return b(r, s);
|
|
602
604
|
}
|
|
603
|
-
function
|
|
604
|
-
const t = typeof e == "string" ? e : e.id, o = B(n), s =
|
|
605
|
+
function lo(n, e) {
|
|
606
|
+
const t = typeof e == "string" ? e : e.id, o = B(n), s = E(t, n);
|
|
605
607
|
if (!s)
|
|
606
608
|
return;
|
|
607
609
|
const i = n.resolve(s.posBeforeNode), r = i.node(), c = i.node(-1), a = c.type.name !== "doc" ? r.type.name === "blockGroup" ? c : r : void 0;
|
|
608
610
|
if (a)
|
|
609
611
|
return b(a, o);
|
|
610
612
|
}
|
|
611
|
-
class
|
|
613
|
+
class uo {
|
|
612
614
|
constructor(e) {
|
|
613
615
|
this.editor = e;
|
|
614
616
|
}
|
|
@@ -617,7 +619,7 @@ class ao {
|
|
|
617
619
|
* @returns A snapshot of all top-level (non-nested) blocks in the editor.
|
|
618
620
|
*/
|
|
619
621
|
get document() {
|
|
620
|
-
return this.editor.transact((e) =>
|
|
622
|
+
return this.editor.transact((e) => Ue(e.doc, this.editor.pmSchema));
|
|
621
623
|
}
|
|
622
624
|
/**
|
|
623
625
|
* Gets a snapshot of an existing block from the editor.
|
|
@@ -627,7 +629,7 @@ class ao {
|
|
|
627
629
|
* matching block was found.
|
|
628
630
|
*/
|
|
629
631
|
getBlock(e) {
|
|
630
|
-
return this.editor.transact((t) =>
|
|
632
|
+
return this.editor.transact((t) => io(t.doc, e));
|
|
631
633
|
}
|
|
632
634
|
/**
|
|
633
635
|
* Gets a snapshot of the previous sibling of an existing block from the
|
|
@@ -639,7 +641,7 @@ class ao {
|
|
|
639
641
|
* in the document.
|
|
640
642
|
*/
|
|
641
643
|
getPrevBlock(e) {
|
|
642
|
-
return this.editor.transact((t) =>
|
|
644
|
+
return this.editor.transact((t) => ao(t.doc, e));
|
|
643
645
|
}
|
|
644
646
|
/**
|
|
645
647
|
* Gets a snapshot of the next sibling of an existing block from the editor.
|
|
@@ -650,7 +652,7 @@ class ao {
|
|
|
650
652
|
* the document.
|
|
651
653
|
*/
|
|
652
654
|
getNextBlock(e) {
|
|
653
|
-
return this.editor.transact((t) =>
|
|
655
|
+
return this.editor.transact((t) => co(t.doc, e));
|
|
654
656
|
}
|
|
655
657
|
/**
|
|
656
658
|
* Gets a snapshot of the parent of an existing block from the editor.
|
|
@@ -661,7 +663,7 @@ class ao {
|
|
|
661
663
|
*/
|
|
662
664
|
getParentBlock(e) {
|
|
663
665
|
return this.editor.transact(
|
|
664
|
-
(t) =>
|
|
666
|
+
(t) => lo(t.doc, e)
|
|
665
667
|
);
|
|
666
668
|
}
|
|
667
669
|
/**
|
|
@@ -694,7 +696,7 @@ class ao {
|
|
|
694
696
|
*/
|
|
695
697
|
insertBlocks(e, t, o = "before") {
|
|
696
698
|
return this.editor.transact(
|
|
697
|
-
(s) =>
|
|
699
|
+
(s) => Kt(s, e, t, o)
|
|
698
700
|
);
|
|
699
701
|
}
|
|
700
702
|
/**
|
|
@@ -705,7 +707,7 @@ class ao {
|
|
|
705
707
|
* @param update A partial block which defines how the existing block should be changed.
|
|
706
708
|
*/
|
|
707
709
|
updateBlock(e, t) {
|
|
708
|
-
return this.editor.transact((o) =>
|
|
710
|
+
return this.editor.transact((o) => Je(o, e, t));
|
|
709
711
|
}
|
|
710
712
|
/**
|
|
711
713
|
* Removes existing blocks from the editor. Throws an error if any of the blocks could not be found.
|
|
@@ -713,7 +715,7 @@ class ao {
|
|
|
713
715
|
*/
|
|
714
716
|
removeBlocks(e) {
|
|
715
717
|
return this.editor.transact(
|
|
716
|
-
(t) =>
|
|
718
|
+
(t) => ie(t, e, []).removedBlocks
|
|
717
719
|
);
|
|
718
720
|
}
|
|
719
721
|
/**
|
|
@@ -725,32 +727,32 @@ class ao {
|
|
|
725
727
|
*/
|
|
726
728
|
replaceBlocks(e, t) {
|
|
727
729
|
return this.editor.transact(
|
|
728
|
-
(o) =>
|
|
730
|
+
(o) => ie(o, e, t)
|
|
729
731
|
);
|
|
730
732
|
}
|
|
731
733
|
/**
|
|
732
734
|
* Checks if the block containing the text cursor can be nested.
|
|
733
735
|
*/
|
|
734
736
|
canNestBlock() {
|
|
735
|
-
return
|
|
737
|
+
return so(this.editor);
|
|
736
738
|
}
|
|
737
739
|
/**
|
|
738
740
|
* Nests the block containing the text cursor into the block above it.
|
|
739
741
|
*/
|
|
740
742
|
nestBlock() {
|
|
741
|
-
|
|
743
|
+
we(this.editor);
|
|
742
744
|
}
|
|
743
745
|
/**
|
|
744
746
|
* Checks if the block containing the text cursor is nested.
|
|
745
747
|
*/
|
|
746
748
|
canUnnestBlock() {
|
|
747
|
-
return
|
|
749
|
+
return ro(this.editor);
|
|
748
750
|
}
|
|
749
751
|
/**
|
|
750
752
|
* Lifts the block containing the text cursor out of its parent.
|
|
751
753
|
*/
|
|
752
754
|
unnestBlock() {
|
|
753
|
-
|
|
755
|
+
no(this.editor);
|
|
754
756
|
}
|
|
755
757
|
/**
|
|
756
758
|
* Moves the selected blocks up. If the previous block has children, moves
|
|
@@ -758,7 +760,7 @@ class ao {
|
|
|
758
760
|
* current blocks share a common parent, moves them out of & before it.
|
|
759
761
|
*/
|
|
760
762
|
moveBlocksUp() {
|
|
761
|
-
return
|
|
763
|
+
return eo(this.editor);
|
|
762
764
|
}
|
|
763
765
|
/**
|
|
764
766
|
* Moves the selected blocks down. If the next block has children, moves
|
|
@@ -766,10 +768,10 @@ class ao {
|
|
|
766
768
|
* current blocks share a common parent, moves them out of & after it.
|
|
767
769
|
*/
|
|
768
770
|
moveBlocksDown() {
|
|
769
|
-
return
|
|
771
|
+
return to(this.editor);
|
|
770
772
|
}
|
|
771
773
|
}
|
|
772
|
-
class
|
|
774
|
+
class po extends ye {
|
|
773
775
|
constructor(e) {
|
|
774
776
|
super(), this.editor = e, e.on("create", () => {
|
|
775
777
|
e._tiptapEditor.on(
|
|
@@ -794,9 +796,9 @@ class co extends ge {
|
|
|
794
796
|
transaction: s,
|
|
795
797
|
appendedTransactions: i
|
|
796
798
|
}) => {
|
|
797
|
-
!t &&
|
|
799
|
+
!t && ae(s) || e(this.editor, {
|
|
798
800
|
getChanges() {
|
|
799
|
-
return
|
|
801
|
+
return tt(
|
|
800
802
|
s,
|
|
801
803
|
i
|
|
802
804
|
);
|
|
@@ -812,7 +814,7 @@ class co extends ge {
|
|
|
812
814
|
*/
|
|
813
815
|
onSelectionChange(e, t = !1) {
|
|
814
816
|
const o = (s) => {
|
|
815
|
-
!t &&
|
|
817
|
+
!t && ae(s.transaction) || e(this.editor);
|
|
816
818
|
};
|
|
817
819
|
return this.on("onSelectionChange", o), () => {
|
|
818
820
|
this.off("onSelectionChange", o);
|
|
@@ -835,31 +837,31 @@ class co extends ge {
|
|
|
835
837
|
};
|
|
836
838
|
}
|
|
837
839
|
}
|
|
838
|
-
function
|
|
840
|
+
function ae(n) {
|
|
839
841
|
return !!n.getMeta("y-sync$");
|
|
840
842
|
}
|
|
841
|
-
function
|
|
843
|
+
function fo(n) {
|
|
842
844
|
return Array.prototype.indexOf.call(n.parentElement.childNodes, n);
|
|
843
845
|
}
|
|
844
|
-
function
|
|
846
|
+
function ho(n) {
|
|
845
847
|
return n.nodeType === 3 && !/\S/.test(n.nodeValue || "");
|
|
846
848
|
}
|
|
847
|
-
function
|
|
849
|
+
function mo(n) {
|
|
848
850
|
n.querySelectorAll("li > ul, li > ol").forEach((e) => {
|
|
849
|
-
const t =
|
|
851
|
+
const t = fo(e), o = e.parentElement, s = Array.from(o.childNodes).slice(
|
|
850
852
|
t + 1
|
|
851
853
|
);
|
|
852
854
|
e.remove(), s.forEach((i) => {
|
|
853
855
|
i.remove();
|
|
854
856
|
}), o.insertAdjacentElement("afterend", e), s.reverse().forEach((i) => {
|
|
855
|
-
if (
|
|
857
|
+
if (ho(i))
|
|
856
858
|
return;
|
|
857
859
|
const r = document.createElement("li");
|
|
858
860
|
r.append(i), e.insertAdjacentElement("afterend", r);
|
|
859
861
|
}), o.childNodes.length === 0 && o.remove();
|
|
860
862
|
});
|
|
861
863
|
}
|
|
862
|
-
function
|
|
864
|
+
function ko(n) {
|
|
863
865
|
n.querySelectorAll("li + ul, li + ol").forEach((e) => {
|
|
864
866
|
var i, r;
|
|
865
867
|
const t = e.previousElementSibling, o = document.createElement("div");
|
|
@@ -869,26 +871,26 @@ function fo(n) {
|
|
|
869
871
|
s.append(o.nextElementSibling);
|
|
870
872
|
});
|
|
871
873
|
}
|
|
872
|
-
let
|
|
873
|
-
function
|
|
874
|
-
return
|
|
874
|
+
let ce = null;
|
|
875
|
+
function go() {
|
|
876
|
+
return ce || (ce = document.implementation.createHTMLDocument("title"));
|
|
875
877
|
}
|
|
876
|
-
function
|
|
878
|
+
function bo(n) {
|
|
877
879
|
if (typeof n == "string") {
|
|
878
|
-
const e =
|
|
880
|
+
const e = go().createElement("div");
|
|
879
881
|
e.innerHTML = n, n = e;
|
|
880
882
|
}
|
|
881
|
-
return
|
|
883
|
+
return mo(n), ko(n), n;
|
|
882
884
|
}
|
|
883
|
-
function
|
|
884
|
-
const t =
|
|
885
|
+
function Te(n, e) {
|
|
886
|
+
const t = bo(n), s = Fe.fromSchema(e).parse(t, {
|
|
885
887
|
topNode: e.nodes.blockGroup.create()
|
|
886
888
|
}), i = [];
|
|
887
889
|
for (let r = 0; r < s.childCount; r++)
|
|
888
890
|
i.push(b(s.child(r), e));
|
|
889
891
|
return i;
|
|
890
892
|
}
|
|
891
|
-
function
|
|
893
|
+
function yo(n, e) {
|
|
892
894
|
const t = e.value ? e.value : "", o = {};
|
|
893
895
|
e.lang && (o["data-language"] = e.lang);
|
|
894
896
|
let s = {
|
|
@@ -904,7 +906,7 @@ function ko(n, e) {
|
|
|
904
906
|
children: [s]
|
|
905
907
|
}, n.patch(e, s), s;
|
|
906
908
|
}
|
|
907
|
-
function
|
|
909
|
+
function So(n, e) {
|
|
908
910
|
var i;
|
|
909
911
|
const t = String((e == null ? void 0 : e.url) || ""), o = e != null && e.title ? String(e.title) : void 0;
|
|
910
912
|
let s = {
|
|
@@ -920,23 +922,23 @@ function go(n, e) {
|
|
|
920
922
|
};
|
|
921
923
|
return (i = n.patch) == null || i.call(n, e, s), s = n.applyData ? n.applyData(e, s) : s, s;
|
|
922
924
|
}
|
|
923
|
-
function
|
|
924
|
-
return
|
|
925
|
+
function Pe(n) {
|
|
926
|
+
return Rt().use(Ut).use(Vt).use(zt, {
|
|
925
927
|
handlers: {
|
|
926
|
-
...
|
|
928
|
+
...re,
|
|
927
929
|
image: (t, o) => {
|
|
928
930
|
const s = String((o == null ? void 0 : o.url) || "");
|
|
929
|
-
return
|
|
931
|
+
return Ye(s) ? So(t, o) : re.image(t, o);
|
|
930
932
|
},
|
|
931
|
-
code:
|
|
933
|
+
code: yo
|
|
932
934
|
}
|
|
933
|
-
}).use(
|
|
935
|
+
}).use(Gt).processSync(n).value;
|
|
934
936
|
}
|
|
935
|
-
function
|
|
936
|
-
const t =
|
|
937
|
-
return
|
|
937
|
+
function Bo(n, e) {
|
|
938
|
+
const t = Pe(n);
|
|
939
|
+
return Te(t, e);
|
|
938
940
|
}
|
|
939
|
-
class
|
|
941
|
+
class Co {
|
|
940
942
|
constructor(e) {
|
|
941
943
|
this.editor = e;
|
|
942
944
|
}
|
|
@@ -948,7 +950,7 @@ class yo {
|
|
|
948
950
|
* @returns The blocks, serialized as an HTML string.
|
|
949
951
|
*/
|
|
950
952
|
blocksToHTMLLossy(e = this.editor.document) {
|
|
951
|
-
return
|
|
953
|
+
return be(
|
|
952
954
|
this.editor.pmSchema,
|
|
953
955
|
this.editor
|
|
954
956
|
).exportBlocks(e, {});
|
|
@@ -963,7 +965,7 @@ class yo {
|
|
|
963
965
|
* @returns The blocks, serialized as an HTML string.
|
|
964
966
|
*/
|
|
965
967
|
blocksToFullHTML(e = this.editor.document) {
|
|
966
|
-
return
|
|
968
|
+
return Qt(
|
|
967
969
|
this.editor.pmSchema,
|
|
968
970
|
this.editor
|
|
969
971
|
).serializeBlocks(e, {});
|
|
@@ -976,7 +978,7 @@ class yo {
|
|
|
976
978
|
* @returns The blocks parsed from the HTML string.
|
|
977
979
|
*/
|
|
978
980
|
tryParseHTMLToBlocks(e) {
|
|
979
|
-
return
|
|
981
|
+
return Te(e, this.editor.pmSchema);
|
|
980
982
|
}
|
|
981
983
|
/**
|
|
982
984
|
* Serializes blocks into a Markdown string. The output is simplified as Markdown does not support all features of
|
|
@@ -985,7 +987,7 @@ class yo {
|
|
|
985
987
|
* @returns The blocks, serialized as a Markdown string.
|
|
986
988
|
*/
|
|
987
989
|
blocksToMarkdownLossy(e = this.editor.document) {
|
|
988
|
-
return
|
|
990
|
+
return ot(e, this.editor.pmSchema, this.editor, {});
|
|
989
991
|
}
|
|
990
992
|
/**
|
|
991
993
|
* Creates a list of blocks from a Markdown string. Tries to create `Block` and `InlineNode` objects based on
|
|
@@ -995,7 +997,7 @@ class yo {
|
|
|
995
997
|
* @returns The blocks parsed from the Markdown string.
|
|
996
998
|
*/
|
|
997
999
|
tryParseMarkdownToBlocks(e) {
|
|
998
|
-
return
|
|
1000
|
+
return Bo(e, this.editor.pmSchema);
|
|
999
1001
|
}
|
|
1000
1002
|
/**
|
|
1001
1003
|
* Paste HTML into the editor. Defaults to converting HTML to BlockNote HTML.
|
|
@@ -1024,11 +1026,11 @@ class yo {
|
|
|
1024
1026
|
* @param markdown The markdown to paste.
|
|
1025
1027
|
*/
|
|
1026
1028
|
pasteMarkdown(e) {
|
|
1027
|
-
const t =
|
|
1029
|
+
const t = Pe(e);
|
|
1028
1030
|
return this.pasteHTML(t);
|
|
1029
1031
|
}
|
|
1030
1032
|
}
|
|
1031
|
-
const
|
|
1033
|
+
const oe = [
|
|
1032
1034
|
"vscode-editor-data",
|
|
1033
1035
|
"blocknote/html",
|
|
1034
1036
|
"text/markdown",
|
|
@@ -1036,12 +1038,12 @@ const te = [
|
|
|
1036
1038
|
"text/plain",
|
|
1037
1039
|
"Files"
|
|
1038
1040
|
];
|
|
1039
|
-
function
|
|
1041
|
+
function Eo(n, e) {
|
|
1040
1042
|
if (!n.startsWith(".") || !e.startsWith("."))
|
|
1041
1043
|
throw new Error("The strings provided are not valid file extensions.");
|
|
1042
1044
|
return n === e;
|
|
1043
1045
|
}
|
|
1044
|
-
function
|
|
1046
|
+
function xo(n, e) {
|
|
1045
1047
|
const t = n.split("/"), o = e.split("/");
|
|
1046
1048
|
if (t.length !== 2)
|
|
1047
1049
|
throw new Error(`The string ${n} is not a valid MIME type.`);
|
|
@@ -1049,7 +1051,7 @@ function Bo(n, e) {
|
|
|
1049
1051
|
throw new Error(`The string ${e} is not a valid MIME type.`);
|
|
1050
1052
|
return t[1] === "*" || o[1] === "*" ? t[0] === o[0] : (t[0] === "*" || o[0] === "*" || t[0] === o[0]) && t[1] === o[1];
|
|
1051
1053
|
}
|
|
1052
|
-
function
|
|
1054
|
+
function le(n, e, t, o = "after") {
|
|
1053
1055
|
let s;
|
|
1054
1056
|
return Array.isArray(e.content) && e.content.length === 0 ? s = n.updateBlock(e, t).id : s = n.insertBlocks(
|
|
1055
1057
|
[t],
|
|
@@ -1057,7 +1059,7 @@ function ae(n, e, t, o = "after") {
|
|
|
1057
1059
|
o
|
|
1058
1060
|
)[0].id, s;
|
|
1059
1061
|
}
|
|
1060
|
-
async function
|
|
1062
|
+
async function ve(n, e) {
|
|
1061
1063
|
var i;
|
|
1062
1064
|
if (!e.uploadFile) {
|
|
1063
1065
|
console.warn(
|
|
@@ -1069,7 +1071,7 @@ async function Te(n, e) {
|
|
|
1069
1071
|
if (t === null)
|
|
1070
1072
|
return;
|
|
1071
1073
|
let o = null;
|
|
1072
|
-
for (const r of
|
|
1074
|
+
for (const r of oe)
|
|
1073
1075
|
if (t.types.includes(r)) {
|
|
1074
1076
|
o = r;
|
|
1075
1077
|
break;
|
|
@@ -1084,7 +1086,7 @@ async function Te(n, e) {
|
|
|
1084
1086
|
for (const l of Object.values(e.schema.blockSpecs))
|
|
1085
1087
|
for (const d of ((i = l.implementation.meta) == null ? void 0 : i.fileBlockAccept) || []) {
|
|
1086
1088
|
const u = d.startsWith("."), p = s[r].getAsFile();
|
|
1087
|
-
if (p && (!u && p.type &&
|
|
1089
|
+
if (p && (!u && p.type && xo(s[r].type, d) || u && Eo(
|
|
1088
1090
|
"." + p.name.split(".").pop(),
|
|
1089
1091
|
d
|
|
1090
1092
|
))) {
|
|
@@ -1103,7 +1105,7 @@ async function Te(n, e) {
|
|
|
1103
1105
|
let d;
|
|
1104
1106
|
if (n.type === "paste") {
|
|
1105
1107
|
const m = e.getTextCursorPosition().block;
|
|
1106
|
-
d =
|
|
1108
|
+
d = le(e, m, l);
|
|
1107
1109
|
} else if (n.type === "drop") {
|
|
1108
1110
|
const m = {
|
|
1109
1111
|
left: n.clientX,
|
|
@@ -1112,14 +1114,14 @@ async function Te(n, e) {
|
|
|
1112
1114
|
if (!f)
|
|
1113
1115
|
return;
|
|
1114
1116
|
d = e.transact((k) => {
|
|
1115
|
-
const g =
|
|
1117
|
+
const g = _(k.doc, f.pos), y = e.prosemirrorView.dom.querySelector(
|
|
1116
1118
|
`[data-id="${g.node.attrs.id}"]`
|
|
1117
|
-
),
|
|
1118
|
-
return
|
|
1119
|
+
), T = y == null ? void 0 : y.getBoundingClientRect();
|
|
1120
|
+
return le(
|
|
1119
1121
|
e,
|
|
1120
1122
|
e.getBlock(g.node.attrs.id),
|
|
1121
1123
|
l,
|
|
1122
|
-
|
|
1124
|
+
T && (T.top + T.bottom) / 2 > m.top ? "before" : "after"
|
|
1123
1125
|
);
|
|
1124
1126
|
});
|
|
1125
1127
|
} else
|
|
@@ -1134,31 +1136,31 @@ async function Te(n, e) {
|
|
|
1134
1136
|
}
|
|
1135
1137
|
}
|
|
1136
1138
|
}
|
|
1137
|
-
const
|
|
1139
|
+
const Mo = (n) => x.create({
|
|
1138
1140
|
name: "dropFile",
|
|
1139
1141
|
addProseMirrorPlugins() {
|
|
1140
1142
|
return [
|
|
1141
|
-
new
|
|
1143
|
+
new ee({
|
|
1142
1144
|
props: {
|
|
1143
1145
|
handleDOMEvents: {
|
|
1144
1146
|
drop(e, t) {
|
|
1145
1147
|
if (!n.isEditable)
|
|
1146
1148
|
return;
|
|
1147
1149
|
let o = null;
|
|
1148
|
-
for (const s of
|
|
1150
|
+
for (const s of oe)
|
|
1149
1151
|
if (t.dataTransfer.types.includes(s)) {
|
|
1150
1152
|
o = s;
|
|
1151
1153
|
break;
|
|
1152
1154
|
}
|
|
1153
|
-
return o === null ? !0 : o === "Files" ? (
|
|
1155
|
+
return o === null ? !0 : o === "Files" ? (ve(t, n), !0) : !1;
|
|
1154
1156
|
}
|
|
1155
1157
|
}
|
|
1156
1158
|
}
|
|
1157
1159
|
})
|
|
1158
1160
|
];
|
|
1159
1161
|
}
|
|
1160
|
-
}),
|
|
1161
|
-
async function
|
|
1162
|
+
}), wo = /(^|\n) {0,3}#{1,6} {1,8}[^\n]{1,64}\r?\n\r?\n\s{0,32}\S/, To = /(_|__|\*|\*\*|~~|==|\+\+)(?!\s)(?:[^\s](?:.{0,62}[^\s])?|\S)(?=\1)/, Po = /\[[^\]]{1,128}\]\(https?:\/\/\S{1,999}\)/, vo = /(?:\s|^)`(?!\s)(?:[^\s`](?:[^`]{0,46}[^\s`])?|[^\s`])`([^\w]|$)/, Io = /(?:^|\n)\s{0,5}-\s{1}[^\n]+\n\s{0,15}-\s/, Ao = /(?:^|\n)\s{0,5}\d+\.\s{1}[^\n]+\n\s{0,15}\d+\.\s/, _o = /\n{2} {0,3}-{2,48}\n{2}/, Do = /(?:\n|^)(```|~~~|\$\$)(?!`|~)[^\s]{0,64} {0,64}[^\n]{0,64}\n[\s\S]{0,9999}?\s*\1 {0,64}(?:\n+|$)/, Lo = /(?:\n|^)(?!\s)\w[^\n]{0,64}\r?\n(-|=)\1{0,64}\n\n\s{0,64}(\w|$)/, No = /(?:^|(\r?\n\r?\n))( {0,3}>[^\n]{1,333}\n){1,999}($|(\r?\n))/, Oo = /^\s*\|(.+\|)+\s*$/m, Fo = /^\s*\|(\s*[-:]+[-:]\s*\|)+\s*$/m, Ho = /^\s*\|(.+\|)+\s*$/m, $o = (n) => wo.test(n) || To.test(n) || Po.test(n) || vo.test(n) || Io.test(n) || Ao.test(n) || _o.test(n) || Do.test(n) || Lo.test(n) || No.test(n) || Oo.test(n) || Fo.test(n) || Ho.test(n);
|
|
1163
|
+
async function Vo(n, e) {
|
|
1162
1164
|
const { schema: t } = e.state;
|
|
1163
1165
|
if (!n.clipboardData)
|
|
1164
1166
|
return !1;
|
|
@@ -1176,7 +1178,7 @@ async function Fo(n, e) {
|
|
|
1176
1178
|
)}</code></pre>`
|
|
1177
1179
|
), !0) : !1;
|
|
1178
1180
|
}
|
|
1179
|
-
function
|
|
1181
|
+
function Uo({
|
|
1180
1182
|
event: n,
|
|
1181
1183
|
editor: e,
|
|
1182
1184
|
prioritizeMarkdownOverHTML: t,
|
|
@@ -1191,7 +1193,7 @@ function Ho({
|
|
|
1191
1193
|
return e.pasteText(a), !0;
|
|
1192
1194
|
}
|
|
1193
1195
|
let i;
|
|
1194
|
-
for (const a of
|
|
1196
|
+
for (const a of oe)
|
|
1195
1197
|
if (n.clipboardData.types.includes(a)) {
|
|
1196
1198
|
i = a;
|
|
1197
1199
|
break;
|
|
@@ -1199,9 +1201,9 @@ function Ho({
|
|
|
1199
1201
|
if (!i)
|
|
1200
1202
|
return !0;
|
|
1201
1203
|
if (i === "vscode-editor-data")
|
|
1202
|
-
return
|
|
1204
|
+
return Vo(n, e.prosemirrorView), !0;
|
|
1203
1205
|
if (i === "Files")
|
|
1204
|
-
return
|
|
1206
|
+
return ve(n, e), !0;
|
|
1205
1207
|
const r = n.clipboardData.getData(i);
|
|
1206
1208
|
if (i === "blocknote/html")
|
|
1207
1209
|
return e.pasteHTML(r, !0), !0;
|
|
@@ -1209,16 +1211,16 @@ function Ho({
|
|
|
1209
1211
|
return e.pasteMarkdown(r), !0;
|
|
1210
1212
|
if (t) {
|
|
1211
1213
|
const a = n.clipboardData.getData("text/plain");
|
|
1212
|
-
if (
|
|
1214
|
+
if ($o(a))
|
|
1213
1215
|
return e.pasteMarkdown(a), !0;
|
|
1214
1216
|
}
|
|
1215
1217
|
return i === "text/html" ? (e.pasteHTML(r), !0) : o ? (e.pasteMarkdown(r), !0) : (e.pasteText(r), !0);
|
|
1216
1218
|
}
|
|
1217
|
-
const
|
|
1219
|
+
const zo = (n, e) => x.create({
|
|
1218
1220
|
name: "pasteFromClipboard",
|
|
1219
1221
|
addProseMirrorPlugins() {
|
|
1220
1222
|
return [
|
|
1221
|
-
new
|
|
1223
|
+
new ee({
|
|
1222
1224
|
props: {
|
|
1223
1225
|
handleDOMEvents: {
|
|
1224
1226
|
paste(t, o) {
|
|
@@ -1229,7 +1231,7 @@ const $o = (n, e) => M.create({
|
|
|
1229
1231
|
defaultPasteHandler: ({
|
|
1230
1232
|
prioritizeMarkdownOverHTML: s = !0,
|
|
1231
1233
|
plainTextAsMarkdown: i = !0
|
|
1232
|
-
} = {}) =>
|
|
1234
|
+
} = {}) => Uo({
|
|
1233
1235
|
event: o,
|
|
1234
1236
|
editor: n,
|
|
1235
1237
|
prioritizeMarkdownOverHTML: s,
|
|
@@ -1243,10 +1245,10 @@ const $o = (n, e) => M.create({
|
|
|
1243
1245
|
];
|
|
1244
1246
|
}
|
|
1245
1247
|
});
|
|
1246
|
-
function
|
|
1248
|
+
function Go(n, e, t) {
|
|
1247
1249
|
var c;
|
|
1248
1250
|
let o = !1;
|
|
1249
|
-
const s = n.state.selection instanceof
|
|
1251
|
+
const s = n.state.selection instanceof te;
|
|
1250
1252
|
if (!s) {
|
|
1251
1253
|
const a = n.state.doc.slice(
|
|
1252
1254
|
n.state.selection.from,
|
|
@@ -1260,13 +1262,13 @@ function Vo(n, e, t) {
|
|
|
1260
1262
|
) === void 0, o && (e = a);
|
|
1261
1263
|
}
|
|
1262
1264
|
let i;
|
|
1263
|
-
const r =
|
|
1265
|
+
const r = be(
|
|
1264
1266
|
n.state.schema,
|
|
1265
1267
|
t
|
|
1266
1268
|
);
|
|
1267
1269
|
if (s) {
|
|
1268
1270
|
((c = e.firstChild) == null ? void 0 : c.type.name) === "table" && (e = e.firstChild.content);
|
|
1269
|
-
const a =
|
|
1271
|
+
const a = ze(
|
|
1270
1272
|
e,
|
|
1271
1273
|
t.schema.inlineContentSchema,
|
|
1272
1274
|
t.schema.styleSchema
|
|
@@ -1276,34 +1278,34 @@ function Vo(n, e, t) {
|
|
|
1276
1278
|
{}
|
|
1277
1279
|
)}</table>`;
|
|
1278
1280
|
} else if (o) {
|
|
1279
|
-
const a =
|
|
1281
|
+
const a = Ge(
|
|
1280
1282
|
e,
|
|
1281
1283
|
t.schema.inlineContentSchema,
|
|
1282
1284
|
t.schema.styleSchema
|
|
1283
1285
|
);
|
|
1284
1286
|
i = r.exportInlineContent(a, {});
|
|
1285
1287
|
} else {
|
|
1286
|
-
const a =
|
|
1288
|
+
const a = st(e);
|
|
1287
1289
|
i = r.exportBlocks(a, {});
|
|
1288
1290
|
}
|
|
1289
1291
|
return i;
|
|
1290
1292
|
}
|
|
1291
|
-
function
|
|
1293
|
+
function Ie(n, e) {
|
|
1292
1294
|
"node" in n.state.selection && n.state.selection.node.type.spec.group === "blockContent" && e.transact(
|
|
1293
1295
|
(r) => r.setSelection(
|
|
1294
|
-
new
|
|
1296
|
+
new L(r.doc.resolve(n.state.selection.from - 1))
|
|
1295
1297
|
)
|
|
1296
1298
|
);
|
|
1297
1299
|
const t = n.serializeForClipboard(
|
|
1298
1300
|
n.state.selection.content()
|
|
1299
|
-
).dom.innerHTML, o = n.state.selection.content().content, s =
|
|
1301
|
+
).dom.innerHTML, o = n.state.selection.content().content, s = Go(
|
|
1300
1302
|
n,
|
|
1301
1303
|
o,
|
|
1302
1304
|
e
|
|
1303
|
-
), i =
|
|
1305
|
+
), i = nt(s);
|
|
1304
1306
|
return { clipboardHTML: t, externalHTML: s, markdown: i };
|
|
1305
1307
|
}
|
|
1306
|
-
const
|
|
1308
|
+
const de = () => {
|
|
1307
1309
|
const n = window.getSelection();
|
|
1308
1310
|
if (!n || n.isCollapsed)
|
|
1309
1311
|
return !0;
|
|
@@ -1314,25 +1316,25 @@ const ce = () => {
|
|
|
1314
1316
|
e = e.parentElement;
|
|
1315
1317
|
}
|
|
1316
1318
|
return !1;
|
|
1317
|
-
},
|
|
1319
|
+
}, ue = (n, e, t) => {
|
|
1318
1320
|
t.preventDefault(), t.clipboardData.clearData();
|
|
1319
|
-
const { clipboardHTML: o, externalHTML: s, markdown: i } =
|
|
1321
|
+
const { clipboardHTML: o, externalHTML: s, markdown: i } = Ie(
|
|
1320
1322
|
e,
|
|
1321
1323
|
n
|
|
1322
1324
|
);
|
|
1323
1325
|
t.clipboardData.setData("blocknote/html", o), t.clipboardData.setData("text/html", s), t.clipboardData.setData("text/plain", i);
|
|
1324
|
-
},
|
|
1326
|
+
}, Ro = (n) => x.create({
|
|
1325
1327
|
name: "copyToClipboard",
|
|
1326
1328
|
addProseMirrorPlugins() {
|
|
1327
1329
|
return [
|
|
1328
|
-
new
|
|
1330
|
+
new ee({
|
|
1329
1331
|
props: {
|
|
1330
1332
|
handleDOMEvents: {
|
|
1331
1333
|
copy(e, t) {
|
|
1332
|
-
return
|
|
1334
|
+
return de() || ue(n, e, t), !0;
|
|
1333
1335
|
},
|
|
1334
1336
|
cut(e, t) {
|
|
1335
|
-
return
|
|
1337
|
+
return de() || (ue(n, e, t), e.editable && e.dispatch(e.state.tr.deleteSelection())), !0;
|
|
1336
1338
|
},
|
|
1337
1339
|
// This is for the use-case in which only a block without content
|
|
1338
1340
|
// is selected, e.g. an image block, and dragged (not using the
|
|
@@ -1342,12 +1344,12 @@ const ce = () => {
|
|
|
1342
1344
|
return;
|
|
1343
1345
|
n.transact(
|
|
1344
1346
|
(r) => r.setSelection(
|
|
1345
|
-
new
|
|
1347
|
+
new L(
|
|
1346
1348
|
r.doc.resolve(e.state.selection.from - 1)
|
|
1347
1349
|
)
|
|
1348
1350
|
)
|
|
1349
1351
|
), t.preventDefault(), t.dataTransfer.clearData();
|
|
1350
|
-
const { clipboardHTML: o, externalHTML: s, markdown: i } =
|
|
1352
|
+
const { clipboardHTML: o, externalHTML: s, markdown: i } = Ie(e, n);
|
|
1351
1353
|
return t.dataTransfer.setData("blocknote/html", o), t.dataTransfer.setData("text/html", s), t.dataTransfer.setData("text/plain", i), !0;
|
|
1352
1354
|
}
|
|
1353
1355
|
}
|
|
@@ -1355,19 +1357,19 @@ const ce = () => {
|
|
|
1355
1357
|
})
|
|
1356
1358
|
];
|
|
1357
1359
|
}
|
|
1358
|
-
}),
|
|
1360
|
+
}), jo = x.create({
|
|
1359
1361
|
name: "blockBackgroundColor",
|
|
1360
1362
|
addGlobalAttributes() {
|
|
1361
1363
|
return [
|
|
1362
1364
|
{
|
|
1363
1365
|
types: ["tableCell", "tableHeader"],
|
|
1364
1366
|
attributes: {
|
|
1365
|
-
backgroundColor:
|
|
1367
|
+
backgroundColor: qe()
|
|
1366
1368
|
}
|
|
1367
1369
|
}
|
|
1368
1370
|
];
|
|
1369
1371
|
}
|
|
1370
|
-
}),
|
|
1372
|
+
}), Wo = D.create({
|
|
1371
1373
|
name: "hardBreak",
|
|
1372
1374
|
inline: !0,
|
|
1373
1375
|
group: "inline",
|
|
@@ -1378,7 +1380,7 @@ const ce = () => {
|
|
|
1378
1380
|
return [{ tag: "br" }];
|
|
1379
1381
|
},
|
|
1380
1382
|
renderHTML({ HTMLAttributes: n }) {
|
|
1381
|
-
return ["br",
|
|
1383
|
+
return ["br", xt(this.options.HTMLAttributes, n)];
|
|
1382
1384
|
},
|
|
1383
1385
|
renderText() {
|
|
1384
1386
|
return `
|
|
@@ -1392,13 +1394,13 @@ const ce = () => {
|
|
|
1392
1394
|
return q(
|
|
1393
1395
|
n.resolve(s)
|
|
1394
1396
|
);
|
|
1395
|
-
},
|
|
1397
|
+
}, Ae = (n, e) => {
|
|
1396
1398
|
for (; e.childContainer; ) {
|
|
1397
1399
|
const t = e.childContainer.node, o = n.resolve(e.childContainer.beforePos + 1).posAtIndex(t.childCount - 1);
|
|
1398
1400
|
e = q(n.resolve(o));
|
|
1399
1401
|
}
|
|
1400
1402
|
return e;
|
|
1401
|
-
},
|
|
1403
|
+
}, Ko = (n, e) => n.isBlockContainer && n.blockContent.node.type.spec.content === "inline*" && n.blockContent.node.childCount > 0 && e.isBlockContainer && e.blockContent.node.type.spec.content === "inline*", Jo = (n, e, t, o) => {
|
|
1402
1404
|
if (!o.isBlockContainer)
|
|
1403
1405
|
throw new Error(
|
|
1404
1406
|
`Attempted to merge block at position ${o.bnBlock.beforePos} into previous block at position ${t.bnBlock.beforePos}, but next block is not a block container`
|
|
@@ -1427,7 +1429,7 @@ const ce = () => {
|
|
|
1427
1429
|
);
|
|
1428
1430
|
}
|
|
1429
1431
|
return !0;
|
|
1430
|
-
},
|
|
1432
|
+
}, pe = (n) => ({
|
|
1431
1433
|
state: e,
|
|
1432
1434
|
dispatch: t
|
|
1433
1435
|
}) => {
|
|
@@ -1437,12 +1439,12 @@ const ce = () => {
|
|
|
1437
1439
|
);
|
|
1438
1440
|
if (!i)
|
|
1439
1441
|
return !1;
|
|
1440
|
-
const r =
|
|
1442
|
+
const r = Ae(
|
|
1441
1443
|
e.doc,
|
|
1442
1444
|
i
|
|
1443
1445
|
);
|
|
1444
|
-
return
|
|
1445
|
-
},
|
|
1446
|
+
return Ko(r, s) ? Jo(e, t, r, s) : !1;
|
|
1447
|
+
}, Yo = x.create({
|
|
1446
1448
|
priority: 50,
|
|
1447
1449
|
// TODO: The shortcuts need a refactor. Do we want to use a command priority
|
|
1448
1450
|
// design as there is now, or clump the logic into a single function?
|
|
@@ -1459,7 +1461,7 @@ const ce = () => {
|
|
|
1459
1461
|
return !1;
|
|
1460
1462
|
const c = i.selection.from === r.blockContent.beforePos + 1, a = r.blockContent.node.type.name === "paragraph";
|
|
1461
1463
|
return c && !a ? s.command(
|
|
1462
|
-
|
|
1464
|
+
Xe(r.bnBlock.beforePos, {
|
|
1463
1465
|
type: "paragraph",
|
|
1464
1466
|
props: {}
|
|
1465
1467
|
})
|
|
@@ -1480,7 +1482,7 @@ const ce = () => {
|
|
|
1480
1482
|
if (!r.isBlockContainer)
|
|
1481
1483
|
return !1;
|
|
1482
1484
|
const { bnBlock: c, blockContent: a } = r, l = i.selection.from === a.beforePos + 1, d = i.selection.empty, u = c.beforePos;
|
|
1483
|
-
return l && d ? o().command(
|
|
1485
|
+
return l && d ? o().command(pe(u)).scrollIntoView().run() : !1;
|
|
1484
1486
|
}),
|
|
1485
1487
|
() => s.command(({ state: i, tr: r, dispatch: c }) => {
|
|
1486
1488
|
const a = S(i);
|
|
@@ -1499,9 +1501,9 @@ const ce = () => {
|
|
|
1499
1501
|
a.bnBlock.beforePos,
|
|
1500
1502
|
a.bnBlock.afterPos
|
|
1501
1503
|
), f.index() === 0 ? (W(r, k), r.insert(k, g), r.setSelection(
|
|
1502
|
-
|
|
1504
|
+
M.near(r.doc.resolve(k))
|
|
1503
1505
|
)) : (r.insert(f.pos - 1, g), r.setSelection(
|
|
1504
|
-
|
|
1506
|
+
M.near(r.doc.resolve(f.pos - 1))
|
|
1505
1507
|
), W(r, k));
|
|
1506
1508
|
}
|
|
1507
1509
|
return !0;
|
|
@@ -1553,7 +1555,7 @@ const ce = () => {
|
|
|
1553
1555
|
r.bnBlock.beforePos
|
|
1554
1556
|
);
|
|
1555
1557
|
if (l && c && a) {
|
|
1556
|
-
const d =
|
|
1558
|
+
const d = Ae(
|
|
1557
1559
|
i.doc,
|
|
1558
1560
|
l
|
|
1559
1561
|
);
|
|
@@ -1592,7 +1594,7 @@ const ce = () => {
|
|
|
1592
1594
|
let f = l, k = r.afterPos + 1, g = s.doc.resolve(k).depth;
|
|
1593
1595
|
for (; g < f; )
|
|
1594
1596
|
f = g, k += 2, g = s.doc.resolve(k).depth;
|
|
1595
|
-
return o.command(
|
|
1597
|
+
return o.command(pe(k - 1));
|
|
1596
1598
|
}
|
|
1597
1599
|
return !1;
|
|
1598
1600
|
})
|
|
@@ -1643,7 +1645,7 @@ const ce = () => {
|
|
|
1643
1645
|
if (c) {
|
|
1644
1646
|
const g = r.schema.nodes.blockContainer.createAndFill();
|
|
1645
1647
|
r.tr.insert(f, g).scrollIntoView(), r.tr.setSelection(
|
|
1646
|
-
new
|
|
1648
|
+
new M(r.doc.resolve(k))
|
|
1647
1649
|
);
|
|
1648
1650
|
}
|
|
1649
1651
|
return !0;
|
|
@@ -1658,7 +1660,7 @@ const ce = () => {
|
|
|
1658
1660
|
return !1;
|
|
1659
1661
|
const { blockContent: l } = a, d = r.selection.$anchor.parentOffset === 0;
|
|
1660
1662
|
return l.node.childCount === 0 ? !1 : (c().deleteSelection().command(
|
|
1661
|
-
|
|
1663
|
+
Qe(
|
|
1662
1664
|
r.selection.from,
|
|
1663
1665
|
d,
|
|
1664
1666
|
d
|
|
@@ -1675,7 +1677,7 @@ const ce = () => {
|
|
|
1675
1677
|
// editor since the browser will try to use tab for keyboard navigation.
|
|
1676
1678
|
Tab: () => {
|
|
1677
1679
|
var o, s;
|
|
1678
|
-
return this.options.tabBehavior !== "prefer-indent" && ((o = this.options.editor.getExtension(R)) != null && o.store.state || ((s = this.options.editor.getExtension(G)) == null ? void 0 : s.store.state) !== void 0) ? !1 :
|
|
1680
|
+
return this.options.tabBehavior !== "prefer-indent" && ((o = this.options.editor.getExtension(R)) != null && o.store.state || ((s = this.options.editor.getExtension(G)) == null ? void 0 : s.store.state) !== void 0) ? !1 : we(this.options.editor);
|
|
1679
1681
|
},
|
|
1680
1682
|
"Shift-Tab": () => {
|
|
1681
1683
|
var o, s;
|
|
@@ -1688,7 +1690,7 @@ const ce = () => {
|
|
|
1688
1690
|
"Shift-Mod-z": () => this.options.editor.redo()
|
|
1689
1691
|
};
|
|
1690
1692
|
}
|
|
1691
|
-
}),
|
|
1693
|
+
}), qo = X.create({
|
|
1692
1694
|
name: "insertion",
|
|
1693
1695
|
inclusive: !1,
|
|
1694
1696
|
excludes: "deletion modification insertion",
|
|
@@ -1726,7 +1728,7 @@ const ce = () => {
|
|
|
1726
1728
|
]
|
|
1727
1729
|
};
|
|
1728
1730
|
}
|
|
1729
|
-
}),
|
|
1731
|
+
}), Qo = X.create({
|
|
1730
1732
|
name: "deletion",
|
|
1731
1733
|
inclusive: !1,
|
|
1732
1734
|
excludes: "insertion modification deletion",
|
|
@@ -1767,7 +1769,7 @@ const ce = () => {
|
|
|
1767
1769
|
]
|
|
1768
1770
|
};
|
|
1769
1771
|
}
|
|
1770
|
-
}),
|
|
1772
|
+
}), Xo = X.create({
|
|
1771
1773
|
name: "modification",
|
|
1772
1774
|
inclusive: !1,
|
|
1773
1775
|
excludes: "deletion insertion",
|
|
@@ -1830,7 +1832,7 @@ const ce = () => {
|
|
|
1830
1832
|
]
|
|
1831
1833
|
};
|
|
1832
1834
|
}
|
|
1833
|
-
}),
|
|
1835
|
+
}), Zo = x.create({
|
|
1834
1836
|
name: "textAlignment",
|
|
1835
1837
|
addGlobalAttributes() {
|
|
1836
1838
|
return [
|
|
@@ -1852,25 +1854,25 @@ const ce = () => {
|
|
|
1852
1854
|
}
|
|
1853
1855
|
];
|
|
1854
1856
|
}
|
|
1855
|
-
}),
|
|
1857
|
+
}), en = x.create({
|
|
1856
1858
|
name: "blockTextColor",
|
|
1857
1859
|
addGlobalAttributes() {
|
|
1858
1860
|
return [
|
|
1859
1861
|
{
|
|
1860
1862
|
types: ["table", "tableCell", "tableHeader"],
|
|
1861
1863
|
attributes: {
|
|
1862
|
-
textColor:
|
|
1864
|
+
textColor: Ze()
|
|
1863
1865
|
}
|
|
1864
1866
|
}
|
|
1865
1867
|
];
|
|
1866
1868
|
}
|
|
1867
|
-
}),
|
|
1869
|
+
}), tn = {
|
|
1868
1870
|
blockColor: "data-block-color",
|
|
1869
1871
|
blockStyle: "data-block-style",
|
|
1870
1872
|
id: "data-id",
|
|
1871
1873
|
depth: "data-depth",
|
|
1872
1874
|
depthChange: "data-depth-change"
|
|
1873
|
-
},
|
|
1875
|
+
}, on = D.create({
|
|
1874
1876
|
name: "blockContainer",
|
|
1875
1877
|
group: "blockGroupChild bnBlock",
|
|
1876
1878
|
// A block always contains content, and optionally a blockGroup which contains nested blocks
|
|
@@ -1887,7 +1889,7 @@ const ce = () => {
|
|
|
1887
1889
|
if (typeof n == "string")
|
|
1888
1890
|
return !1;
|
|
1889
1891
|
const e = {};
|
|
1890
|
-
for (const [t, o] of Object.entries(
|
|
1892
|
+
for (const [t, o] of Object.entries(tn))
|
|
1891
1893
|
n.getAttribute(o) && (e[t] = n.getAttribute(o));
|
|
1892
1894
|
return e;
|
|
1893
1895
|
}
|
|
@@ -1917,7 +1919,7 @@ const ce = () => {
|
|
|
1917
1919
|
contentDOM: o
|
|
1918
1920
|
};
|
|
1919
1921
|
}
|
|
1920
|
-
}),
|
|
1922
|
+
}), nn = D.create({
|
|
1921
1923
|
name: "blockGroup",
|
|
1922
1924
|
group: "childContainer",
|
|
1923
1925
|
content: "blockGroupChild+",
|
|
@@ -1947,66 +1949,66 @@ const ce = () => {
|
|
|
1947
1949
|
contentDOM: t
|
|
1948
1950
|
};
|
|
1949
1951
|
}
|
|
1950
|
-
}),
|
|
1952
|
+
}), sn = D.create({
|
|
1951
1953
|
name: "doc",
|
|
1952
1954
|
topNode: !0,
|
|
1953
1955
|
content: "blockGroup",
|
|
1954
1956
|
marks: "insertion modification deletion"
|
|
1955
1957
|
});
|
|
1956
|
-
let
|
|
1957
|
-
function
|
|
1958
|
+
let fe = !1;
|
|
1959
|
+
function rn(n, e) {
|
|
1958
1960
|
const t = [
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1961
|
+
I.ClipboardTextSerializer,
|
|
1962
|
+
I.Commands,
|
|
1963
|
+
I.Editable,
|
|
1964
|
+
I.FocusEvents,
|
|
1965
|
+
I.Tabindex,
|
|
1966
|
+
Ot,
|
|
1967
|
+
me.configure({
|
|
1966
1968
|
// everything from bnBlock group (nodes that represent a BlockNote block should have an id)
|
|
1967
1969
|
types: ["blockContainer", "columnList", "column"],
|
|
1968
1970
|
setIdAttribute: e.setIdAttribute
|
|
1969
1971
|
}),
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
+
Wo,
|
|
1973
|
+
Ht,
|
|
1972
1974
|
// marks:
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1975
|
+
qo,
|
|
1976
|
+
Qo,
|
|
1977
|
+
Xo,
|
|
1978
|
+
Ft.extend({
|
|
1977
1979
|
inclusive: !1
|
|
1978
1980
|
}).configure({
|
|
1979
|
-
defaultProtocol:
|
|
1981
|
+
defaultProtocol: Bt,
|
|
1980
1982
|
// only call this once if we have multiple editors installed. Or fix https://github.com/ueberdosis/tiptap/issues/5450
|
|
1981
|
-
protocols:
|
|
1983
|
+
protocols: fe ? [] : St
|
|
1982
1984
|
}),
|
|
1983
1985
|
...Object.values(n.schema.styleSpecs).map((o) => o.implementation.mark.configure({
|
|
1984
1986
|
editor: n
|
|
1985
1987
|
})),
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1988
|
+
en,
|
|
1989
|
+
jo,
|
|
1990
|
+
Zo,
|
|
1989
1991
|
// make sure escape blurs editor, so that we can tab to other elements in the host page (accessibility)
|
|
1990
|
-
|
|
1992
|
+
x.create({
|
|
1991
1993
|
name: "OverrideEscape",
|
|
1992
1994
|
addKeyboardShortcuts: () => ({
|
|
1993
1995
|
Escape: () => {
|
|
1994
1996
|
var o;
|
|
1995
|
-
return (o = n.getExtension(
|
|
1997
|
+
return (o = n.getExtension(ge)) != null && o.shown() ? !1 : (n.blur(), !0);
|
|
1996
1998
|
}
|
|
1997
1999
|
})
|
|
1998
2000
|
}),
|
|
1999
2001
|
// nodes
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
+
sn,
|
|
2003
|
+
on.configure({
|
|
2002
2004
|
editor: n,
|
|
2003
2005
|
domAttributes: e.domAttributes
|
|
2004
2006
|
}),
|
|
2005
|
-
|
|
2007
|
+
Yo.configure({
|
|
2006
2008
|
editor: n,
|
|
2007
2009
|
tabBehavior: e.tabBehavior
|
|
2008
2010
|
}),
|
|
2009
|
-
|
|
2011
|
+
nn.configure({
|
|
2010
2012
|
domAttributes: e.domAttributes
|
|
2011
2013
|
}),
|
|
2012
2014
|
...Object.values(n.schema.inlineContentSpecs).filter((o) => o.config !== "link" && o.config !== "text").map((o) => o.implementation.node.configure({
|
|
@@ -2021,33 +2023,33 @@ function on(n, e) {
|
|
|
2021
2023
|
})
|
|
2022
2024
|
] : []
|
|
2023
2025
|
]),
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
+
Ro(n),
|
|
2027
|
+
zo(
|
|
2026
2028
|
n,
|
|
2027
2029
|
e.pasteHandler || ((o) => o.defaultPasteHandler())
|
|
2028
2030
|
),
|
|
2029
|
-
|
|
2031
|
+
Mo(n)
|
|
2030
2032
|
];
|
|
2031
|
-
return
|
|
2033
|
+
return fe = !0, t;
|
|
2032
2034
|
}
|
|
2033
|
-
function
|
|
2035
|
+
function an(n, e) {
|
|
2034
2036
|
var o;
|
|
2035
2037
|
const t = [
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
+
rt(),
|
|
2039
|
+
it(e),
|
|
2038
2040
|
G(e),
|
|
2039
2041
|
R(e),
|
|
2040
|
-
rt(e),
|
|
2041
|
-
it(),
|
|
2042
2042
|
at(e),
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2043
|
+
ct(),
|
|
2044
|
+
lt(e),
|
|
2045
|
+
$t(e),
|
|
2046
|
+
dt(e),
|
|
2047
|
+
ge(e),
|
|
2048
|
+
...e.trailingBlock !== !1 ? [ut()] : []
|
|
2047
2049
|
];
|
|
2048
|
-
return e.collaboration ? (t.push(
|
|
2050
|
+
return e.collaboration ? (t.push(pt(e.collaboration)), (o = e.collaboration.provider) != null && o.awareness && t.push(ft(e.collaboration)), t.push(ht(e.collaboration)), t.push(mt(e.collaboration)), t.push(kt(e.collaboration))) : t.push(gt()), "table" in n.schema.blockSpecs && t.push(bt(e)), e.animations !== !1 && t.push(yt()), t;
|
|
2049
2051
|
}
|
|
2050
|
-
class
|
|
2052
|
+
class cn {
|
|
2051
2053
|
constructor(e, t) {
|
|
2052
2054
|
/**
|
|
2053
2055
|
* A set of extension keys which are disabled by the options
|
|
@@ -2086,7 +2088,7 @@ class sn {
|
|
|
2086
2088
|
for (const [o, s] of this.abortMap.entries())
|
|
2087
2089
|
this.abortMap.delete(o), s.abort();
|
|
2088
2090
|
}), this.disabledExtensions = new Set(t.disableExtensions || []);
|
|
2089
|
-
for (const o of
|
|
2091
|
+
for (const o of an(this.editor, this.options))
|
|
2090
2092
|
this.addExtension(o);
|
|
2091
2093
|
for (const o of this.options.extensions ?? [])
|
|
2092
2094
|
this.addExtension(o);
|
|
@@ -2130,7 +2132,7 @@ class sn {
|
|
|
2130
2132
|
let t;
|
|
2131
2133
|
if (typeof e == "function" ? t = e({ editor: this.editor }) : t = e, !(!t || this.disabledExtensions.has(t.key))) {
|
|
2132
2134
|
if (typeof e == "function") {
|
|
2133
|
-
const o = t[
|
|
2135
|
+
const o = t[Nt];
|
|
2134
2136
|
typeof o == "function" && this.extensionFactories.set(o, t);
|
|
2135
2137
|
}
|
|
2136
2138
|
return this.extensions.push(t), t;
|
|
@@ -2203,15 +2205,15 @@ class sn {
|
|
|
2203
2205
|
*/
|
|
2204
2206
|
getTiptapExtensions() {
|
|
2205
2207
|
var s;
|
|
2206
|
-
const e =
|
|
2208
|
+
const e = rn(
|
|
2207
2209
|
this.editor,
|
|
2208
2210
|
this.options
|
|
2209
|
-
), t =
|
|
2211
|
+
), t = Ct(this.extensions), o = /* @__PURE__ */ new Map();
|
|
2210
2212
|
for (const i of this.extensions) {
|
|
2211
2213
|
i.tiptapExtensions && e.push(...i.tiptapExtensions);
|
|
2212
2214
|
const r = t(i.key), { plugins: c, inputRules: a } = this.getProsemirrorPluginsFromExtension(i);
|
|
2213
2215
|
c.length && e.push(
|
|
2214
|
-
|
|
2216
|
+
x.create({
|
|
2215
2217
|
name: i.key,
|
|
2216
2218
|
priority: r,
|
|
2217
2219
|
addProseMirrorPlugins: () => c
|
|
@@ -2219,13 +2221,13 @@ class sn {
|
|
|
2219
2221
|
), a.length && (o.has(r) || o.set(r, []), o.get(r).push(...a));
|
|
2220
2222
|
}
|
|
2221
2223
|
e.push(
|
|
2222
|
-
|
|
2224
|
+
x.create({
|
|
2223
2225
|
name: "blocknote-input-rules",
|
|
2224
2226
|
addProseMirrorPlugins() {
|
|
2225
2227
|
const i = [];
|
|
2226
2228
|
return Array.from(o.keys()).sort().reverse().forEach((r) => {
|
|
2227
2229
|
i.push(...o.get(r));
|
|
2228
|
-
}), [
|
|
2230
|
+
}), [_t({ rules: i })];
|
|
2229
2231
|
}
|
|
2230
2232
|
})
|
|
2231
2233
|
);
|
|
@@ -2243,7 +2245,7 @@ class sn {
|
|
|
2243
2245
|
var s, i, r;
|
|
2244
2246
|
const t = [...e.prosemirrorPlugins ?? []], o = [];
|
|
2245
2247
|
return !((s = e.prosemirrorPlugins) != null && s.length) && !Object.keys(e.keyboardShortcuts || {}).length && !((i = e.inputRules) != null && i.length) ? { plugins: t, inputRules: o } : (this.extensionPlugins.set(e, t), (r = e.inputRules) != null && r.length && o.push(
|
|
2246
|
-
...e.inputRules.map((c) => new
|
|
2248
|
+
...e.inputRules.map((c) => new Dt(c.find, (a, l, d, u) => {
|
|
2247
2249
|
const p = c.replace({
|
|
2248
2250
|
match: l,
|
|
2249
2251
|
range: { from: d, to: u },
|
|
@@ -2254,12 +2256,12 @@ class sn {
|
|
|
2254
2256
|
if (this.editor.schema.blockSchema[m.block.type].content !== "inline")
|
|
2255
2257
|
return null;
|
|
2256
2258
|
const f = H(a.tr), k = a.tr.deleteRange(d, u);
|
|
2257
|
-
return
|
|
2259
|
+
return et(k, f.bnBlock.beforePos, p), k;
|
|
2258
2260
|
}
|
|
2259
2261
|
return null;
|
|
2260
2262
|
}))
|
|
2261
2263
|
), Object.keys(e.keyboardShortcuts || {}).length && t.push(
|
|
2262
|
-
|
|
2264
|
+
Lt(
|
|
2263
2265
|
Object.fromEntries(
|
|
2264
2266
|
Object.entries(e.keyboardShortcuts).map(([c, a]) => [
|
|
2265
2267
|
c,
|
|
@@ -2294,14 +2296,14 @@ class sn {
|
|
|
2294
2296
|
return typeof e == "string" ? this.extensions.some((t) => t.key === e) : typeof e == "object" && "key" in e ? this.extensions.some((t) => t.key === e.key) : typeof e == "function" ? this.extensionFactories.has(e) : !1;
|
|
2295
2297
|
}
|
|
2296
2298
|
}
|
|
2297
|
-
function
|
|
2299
|
+
function ln(n) {
|
|
2298
2300
|
const e = B(n);
|
|
2299
2301
|
if (n.selection.empty || "node" in n.selection)
|
|
2300
2302
|
return;
|
|
2301
2303
|
const t = n.doc.resolve(
|
|
2302
|
-
|
|
2304
|
+
_(n.doc, n.selection.from).posBeforeNode
|
|
2303
2305
|
), o = n.doc.resolve(
|
|
2304
|
-
|
|
2306
|
+
_(n.doc, n.selection.to).posBeforeNode
|
|
2305
2307
|
), s = (l, d) => {
|
|
2306
2308
|
const u = t.posAtIndex(l, d), p = n.doc.resolve(u).nodeAfter;
|
|
2307
2309
|
if (!p)
|
|
@@ -2330,16 +2332,16 @@ function rn(n) {
|
|
|
2330
2332
|
blocks: i
|
|
2331
2333
|
};
|
|
2332
2334
|
}
|
|
2333
|
-
function
|
|
2334
|
-
const o = typeof e == "string" ? e : e.id, s = typeof t == "string" ? t : t.id, i = B(n), r =
|
|
2335
|
+
function dn(n, e, t) {
|
|
2336
|
+
const o = typeof e == "string" ? e : e.id, s = typeof t == "string" ? t : t.id, i = B(n), r = ke(i);
|
|
2335
2337
|
if (o === s)
|
|
2336
2338
|
throw new Error(
|
|
2337
2339
|
`Attempting to set selection with the same anchor and head blocks (id ${o})`
|
|
2338
2340
|
);
|
|
2339
|
-
const c =
|
|
2341
|
+
const c = E(o, n.doc);
|
|
2340
2342
|
if (!c)
|
|
2341
2343
|
throw new Error(`Block with ID ${o} not found`);
|
|
2342
|
-
const a =
|
|
2344
|
+
const a = E(s, n.doc);
|
|
2343
2345
|
if (!a)
|
|
2344
2346
|
throw new Error(`Block with ID ${s} not found`);
|
|
2345
2347
|
const l = z(c), d = z(a), u = r.blockSchema[l.blockNoteType], p = r.blockSchema[d.blockNoteType];
|
|
@@ -2353,12 +2355,12 @@ function an(n, e, t) {
|
|
|
2353
2355
|
);
|
|
2354
2356
|
let m, f;
|
|
2355
2357
|
if (u.content === "table") {
|
|
2356
|
-
const k =
|
|
2358
|
+
const k = se.get(l.blockContent.node);
|
|
2357
2359
|
m = l.blockContent.beforePos + k.positionAt(0, 0, l.blockContent.node) + 1 + 2;
|
|
2358
2360
|
} else
|
|
2359
2361
|
m = l.blockContent.beforePos + 1;
|
|
2360
2362
|
if (p.content === "table") {
|
|
2361
|
-
const k =
|
|
2363
|
+
const k = se.get(d.blockContent.node), g = d.blockContent.beforePos + k.positionAt(
|
|
2362
2364
|
k.height - 1,
|
|
2363
2365
|
k.width - 1,
|
|
2364
2366
|
d.blockContent.node
|
|
@@ -2366,9 +2368,9 @@ function an(n, e, t) {
|
|
|
2366
2368
|
f = g + y - 2;
|
|
2367
2369
|
} else
|
|
2368
2370
|
f = d.blockContent.afterPos - 1;
|
|
2369
|
-
n.setSelection(
|
|
2371
|
+
n.setSelection(M.create(n.doc, m, f));
|
|
2370
2372
|
}
|
|
2371
|
-
function
|
|
2373
|
+
function un(n) {
|
|
2372
2374
|
const e = B(n);
|
|
2373
2375
|
let t = n.selection.$from, o = n.selection.$to;
|
|
2374
2376
|
for (; o.parentOffset >= o.parent.nodeSize - 2 && o.depth > 0; )
|
|
@@ -2379,7 +2381,7 @@ function cn(n) {
|
|
|
2379
2381
|
t = n.doc.resolve(t.pos - 1);
|
|
2380
2382
|
for (; t.parentOffset >= t.parent.nodeSize - 2 && t.depth > 0; )
|
|
2381
2383
|
t = n.doc.resolve(t.pos + 1);
|
|
2382
|
-
const s =
|
|
2384
|
+
const s = Re(
|
|
2383
2385
|
n.doc.slice(t.pos, o.pos, !0),
|
|
2384
2386
|
e
|
|
2385
2387
|
);
|
|
@@ -2391,7 +2393,7 @@ function cn(n) {
|
|
|
2391
2393
|
...s
|
|
2392
2394
|
};
|
|
2393
2395
|
}
|
|
2394
|
-
function
|
|
2396
|
+
function pn(n) {
|
|
2395
2397
|
const { bnBlock: e } = H(n), t = B(n.doc), o = n.doc.resolve(e.beforePos), s = o.nodeBefore, i = n.doc.resolve(e.afterPos).nodeAfter;
|
|
2396
2398
|
let r;
|
|
2397
2399
|
return o.depth > 1 && (r = o.node(), r.type.isInGroup("bnBlock") || (r = o.node(o.depth - 1))), {
|
|
@@ -2401,37 +2403,37 @@ function ln(n) {
|
|
|
2401
2403
|
parentBlock: r === void 0 ? void 0 : b(r, t)
|
|
2402
2404
|
};
|
|
2403
2405
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const o = typeof e == "string" ? e : e.id, s = B(n.doc), i =
|
|
2406
|
+
function _e(n, e, t = "start") {
|
|
2407
|
+
const o = typeof e == "string" ? e : e.id, s = B(n.doc), i = ke(s), r = E(o, n.doc);
|
|
2406
2408
|
if (!r)
|
|
2407
2409
|
throw new Error(`Block with ID ${o} not found`);
|
|
2408
2410
|
const c = z(r), a = i.blockSchema[c.blockNoteType].content;
|
|
2409
2411
|
if (c.isBlockContainer) {
|
|
2410
2412
|
const l = c.blockContent;
|
|
2411
2413
|
if (a === "none") {
|
|
2412
|
-
n.setSelection(
|
|
2414
|
+
n.setSelection(L.create(n.doc, l.beforePos));
|
|
2413
2415
|
return;
|
|
2414
2416
|
}
|
|
2415
2417
|
if (a === "inline")
|
|
2416
2418
|
t === "start" ? n.setSelection(
|
|
2417
|
-
|
|
2419
|
+
M.create(n.doc, l.beforePos + 1)
|
|
2418
2420
|
) : n.setSelection(
|
|
2419
|
-
|
|
2421
|
+
M.create(n.doc, l.afterPos - 1)
|
|
2420
2422
|
);
|
|
2421
2423
|
else if (a === "table")
|
|
2422
2424
|
t === "start" ? n.setSelection(
|
|
2423
|
-
|
|
2425
|
+
M.create(n.doc, l.beforePos + 4)
|
|
2424
2426
|
) : n.setSelection(
|
|
2425
|
-
|
|
2427
|
+
M.create(n.doc, l.afterPos - 4)
|
|
2426
2428
|
);
|
|
2427
2429
|
else
|
|
2428
2430
|
throw new F(a);
|
|
2429
2431
|
} else {
|
|
2430
2432
|
const l = t === "start" ? c.childContainer.node.firstChild : c.childContainer.node.lastChild;
|
|
2431
|
-
|
|
2433
|
+
_e(n, l.attrs.id, t);
|
|
2432
2434
|
}
|
|
2433
2435
|
}
|
|
2434
|
-
class
|
|
2436
|
+
class fn {
|
|
2435
2437
|
constructor(e) {
|
|
2436
2438
|
this.editor = e;
|
|
2437
2439
|
}
|
|
@@ -2442,7 +2444,7 @@ class dn {
|
|
|
2442
2444
|
* If the selection starts / ends halfway through a block, the returned data will contain the entire block.
|
|
2443
2445
|
*/
|
|
2444
2446
|
getSelection() {
|
|
2445
|
-
return this.editor.transact((e) =>
|
|
2447
|
+
return this.editor.transact((e) => ln(e));
|
|
2446
2448
|
}
|
|
2447
2449
|
/**
|
|
2448
2450
|
* Gets a snapshot of the current selection. This contains all blocks (included nested blocks)
|
|
@@ -2452,7 +2454,7 @@ class dn {
|
|
|
2452
2454
|
* only the part of the block that is included in the selection.
|
|
2453
2455
|
*/
|
|
2454
2456
|
getSelectionCutBlocks() {
|
|
2455
|
-
return this.editor.transact((e) =>
|
|
2457
|
+
return this.editor.transact((e) => un(e));
|
|
2456
2458
|
}
|
|
2457
2459
|
/**
|
|
2458
2460
|
* Sets the selection to a range of blocks.
|
|
@@ -2460,14 +2462,14 @@ class dn {
|
|
|
2460
2462
|
* @param endBlock The identifier of the block that should be the end of the selection.
|
|
2461
2463
|
*/
|
|
2462
2464
|
setSelection(e, t) {
|
|
2463
|
-
return this.editor.transact((o) =>
|
|
2465
|
+
return this.editor.transact((o) => dn(o, e, t));
|
|
2464
2466
|
}
|
|
2465
2467
|
/**
|
|
2466
2468
|
* Gets a snapshot of the current text cursor position.
|
|
2467
2469
|
* @returns A snapshot of the current text cursor position.
|
|
2468
2470
|
*/
|
|
2469
2471
|
getTextCursorPosition() {
|
|
2470
|
-
return this.editor.transact((e) =>
|
|
2472
|
+
return this.editor.transact((e) => pn(e));
|
|
2471
2473
|
}
|
|
2472
2474
|
/**
|
|
2473
2475
|
* Sets the text cursor position to the start or end of an existing block. Throws an error if the target block could
|
|
@@ -2477,7 +2479,7 @@ class dn {
|
|
|
2477
2479
|
*/
|
|
2478
2480
|
setTextCursorPosition(e, t = "start") {
|
|
2479
2481
|
return this.editor.transact(
|
|
2480
|
-
(o) =>
|
|
2482
|
+
(o) => _e(o, e, t)
|
|
2481
2483
|
);
|
|
2482
2484
|
}
|
|
2483
2485
|
/**
|
|
@@ -2487,19 +2489,19 @@ class dn {
|
|
|
2487
2489
|
if (!this.editor.prosemirrorView)
|
|
2488
2490
|
return;
|
|
2489
2491
|
const { selection: e } = this.editor.prosemirrorState, { ranges: t } = e, o = Math.min(...t.map((i) => i.$from.pos)), s = Math.max(...t.map((i) => i.$to.pos));
|
|
2490
|
-
if (
|
|
2492
|
+
if (Mt(e)) {
|
|
2491
2493
|
const i = this.editor.prosemirrorView.nodeDOM(o);
|
|
2492
2494
|
if (i)
|
|
2493
2495
|
return i.getBoundingClientRect();
|
|
2494
2496
|
}
|
|
2495
|
-
return
|
|
2497
|
+
return wt(
|
|
2496
2498
|
this.editor.prosemirrorView,
|
|
2497
2499
|
o,
|
|
2498
2500
|
s
|
|
2499
2501
|
).toJSON();
|
|
2500
2502
|
}
|
|
2501
2503
|
}
|
|
2502
|
-
class
|
|
2504
|
+
class hn {
|
|
2503
2505
|
constructor(e) {
|
|
2504
2506
|
/**
|
|
2505
2507
|
* Stores the currently active transaction, which is the accumulated transaction from all {@link dispatch} calls during a {@link transact} calls
|
|
@@ -2675,7 +2677,7 @@ class un {
|
|
|
2675
2677
|
throw new Error("No redo plugin found");
|
|
2676
2678
|
}
|
|
2677
2679
|
}
|
|
2678
|
-
function
|
|
2680
|
+
function mn(n, e, t, o = { updateSelection: !0 }) {
|
|
2679
2681
|
let { from: s, to: i } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, r = !0, c = !0, a = "";
|
|
2680
2682
|
if (t.forEach((l) => {
|
|
2681
2683
|
l.check(), r && l.isText && l.marks.length === 0 ? a += l.text : r = !1, c = c ? l.isBlock : !1;
|
|
@@ -2683,9 +2685,9 @@ function pn(n, e, t, o = { updateSelection: !0 }) {
|
|
|
2683
2685
|
const { parent: l } = n.doc.resolve(s);
|
|
2684
2686
|
l.isTextblock && !l.type.spec.code && !l.childCount && (s -= 1, i += 1);
|
|
2685
2687
|
}
|
|
2686
|
-
return r ? n.insertText(a, s, i) : n.replaceWith(s, i, t), o.updateSelection &&
|
|
2688
|
+
return r ? n.insertText(a, s, i) : n.replaceWith(s, i, t), o.updateSelection && Tt(n, n.steps.length - 1, -1), !0;
|
|
2687
2689
|
}
|
|
2688
|
-
class
|
|
2690
|
+
class kn {
|
|
2689
2691
|
constructor(e) {
|
|
2690
2692
|
this.editor = e;
|
|
2691
2693
|
}
|
|
@@ -2697,7 +2699,7 @@ class fn {
|
|
|
2697
2699
|
insertInlineContent(e, { updateSelection: t = !1 } = {}) {
|
|
2698
2700
|
const o = O(e, this.editor.pmSchema);
|
|
2699
2701
|
this.editor.transact((s) => {
|
|
2700
|
-
|
|
2702
|
+
mn(
|
|
2701
2703
|
s,
|
|
2702
2704
|
{
|
|
2703
2705
|
from: s.selection.from,
|
|
@@ -2798,7 +2800,7 @@ class fn {
|
|
|
2798
2800
|
const o = this.editor.pmSchema.mark("link", { href: e });
|
|
2799
2801
|
this.editor.transact((s) => {
|
|
2800
2802
|
const { from: i, to: r } = s.selection;
|
|
2801
|
-
t ? s.insertText(t, i, r).addMark(i, i + t.length, o) : s.setSelection(
|
|
2803
|
+
t ? s.insertText(t, i, r).addMark(i, i + t.length, o) : s.setSelection(jt.create(s.doc, r)).addMark(
|
|
2802
2804
|
i,
|
|
2803
2805
|
r,
|
|
2804
2806
|
o
|
|
@@ -2806,13 +2808,13 @@ class fn {
|
|
|
2806
2808
|
});
|
|
2807
2809
|
}
|
|
2808
2810
|
}
|
|
2809
|
-
function
|
|
2811
|
+
function gn(n, e) {
|
|
2810
2812
|
const t = [];
|
|
2811
2813
|
return n.forEach((o, s, i) => {
|
|
2812
2814
|
i !== e && t.push(o);
|
|
2813
|
-
}),
|
|
2815
|
+
}), Z.from(t);
|
|
2814
2816
|
}
|
|
2815
|
-
function
|
|
2817
|
+
function bn(n, e) {
|
|
2816
2818
|
const t = [];
|
|
2817
2819
|
for (let o = 0; o < n.childCount; o++)
|
|
2818
2820
|
if (n.child(o).type.name === "tableRow")
|
|
@@ -2828,18 +2830,18 @@ function mn(n, e) {
|
|
|
2828
2830
|
}
|
|
2829
2831
|
else
|
|
2830
2832
|
t.push(n.child(o));
|
|
2831
|
-
return n =
|
|
2833
|
+
return n = Z.from(t), n;
|
|
2832
2834
|
}
|
|
2833
|
-
function
|
|
2834
|
-
let t =
|
|
2835
|
-
if (t =
|
|
2836
|
-
return new
|
|
2835
|
+
function yn(n, e) {
|
|
2836
|
+
let t = Z.from(n.content);
|
|
2837
|
+
if (t = bn(t, e.state.schema), !Sn(t, e))
|
|
2838
|
+
return new ne(t, n.openStart, n.openEnd);
|
|
2837
2839
|
for (let o = 0; o < t.childCount; o++)
|
|
2838
2840
|
if (t.child(o).type.spec.group === "blockContent") {
|
|
2839
2841
|
const s = [t.child(o)];
|
|
2840
2842
|
if (o + 1 < t.childCount && t.child(o + 1).type.name === "blockGroup") {
|
|
2841
2843
|
const r = t.child(o + 1).child(0).child(0);
|
|
2842
|
-
(r.type.name === "bulletListItem" || r.type.name === "numberedListItem" || r.type.name === "checkListItem") && (s.push(t.child(o + 1)), t =
|
|
2844
|
+
(r.type.name === "bulletListItem" || r.type.name === "numberedListItem" || r.type.name === "checkListItem") && (s.push(t.child(o + 1)), t = gn(t, o + 1));
|
|
2843
2845
|
}
|
|
2844
2846
|
const i = e.state.schema.nodes.blockContainer.createChecked(
|
|
2845
2847
|
void 0,
|
|
@@ -2847,9 +2849,9 @@ function kn(n, e) {
|
|
|
2847
2849
|
);
|
|
2848
2850
|
t = t.replaceChild(o, i);
|
|
2849
2851
|
}
|
|
2850
|
-
return new
|
|
2852
|
+
return new ne(t, n.openStart, n.openEnd);
|
|
2851
2853
|
}
|
|
2852
|
-
function
|
|
2854
|
+
function Sn(n, e) {
|
|
2853
2855
|
var i, r;
|
|
2854
2856
|
const t = n.childCount === 1, o = ((i = n.firstChild) == null ? void 0 : i.type.spec.content) === "inline*", s = ((r = n.firstChild) == null ? void 0 : r.type.spec.content) === "tableRow+";
|
|
2855
2857
|
if (t) {
|
|
@@ -2863,14 +2865,14 @@ function gn(n, e) {
|
|
|
2863
2865
|
}
|
|
2864
2866
|
return !0;
|
|
2865
2867
|
}
|
|
2866
|
-
const
|
|
2868
|
+
const Bn = {
|
|
2867
2869
|
enableInputRules: !0,
|
|
2868
2870
|
enablePasteRules: !0,
|
|
2869
2871
|
enableCoreExtensions: !1
|
|
2870
2872
|
};
|
|
2871
|
-
class
|
|
2873
|
+
class De extends ye {
|
|
2872
2874
|
constructor(t) {
|
|
2873
|
-
var l, d, u, p, m, f, k, g, y,
|
|
2875
|
+
var l, d, u, p, m, f, k, g, y, T;
|
|
2874
2876
|
super();
|
|
2875
2877
|
/**
|
|
2876
2878
|
* The underlying prosemirror schema
|
|
@@ -2950,7 +2952,7 @@ class Ae extends ge {
|
|
|
2950
2952
|
h(this, "unmount", () => {
|
|
2951
2953
|
this._tiptapEditor.unmount();
|
|
2952
2954
|
});
|
|
2953
|
-
this.options = t, this.dictionary = t.dictionary ||
|
|
2955
|
+
this.options = t, this.dictionary = t.dictionary || At, this.settings = {
|
|
2954
2956
|
tables: {
|
|
2955
2957
|
splitCells: ((l = t == null ? void 0 : t.tables) == null ? void 0 : l.splitCells) ?? !1,
|
|
2956
2958
|
cellBackgroundColor: ((d = t == null ? void 0 : t.tables) == null ? void 0 : d.cellBackgroundColor) ?? !1,
|
|
@@ -2960,7 +2962,7 @@ class Ae extends ge {
|
|
|
2960
2962
|
};
|
|
2961
2963
|
const o = {
|
|
2962
2964
|
defaultStyles: !0,
|
|
2963
|
-
schema: t.schema ||
|
|
2965
|
+
schema: t.schema || Et.create(),
|
|
2964
2966
|
...t,
|
|
2965
2967
|
placeholders: {
|
|
2966
2968
|
...this.dictionary.placeholders,
|
|
@@ -2969,26 +2971,26 @@ class Ae extends ge {
|
|
|
2969
2971
|
};
|
|
2970
2972
|
if (this.schema = o.schema, this.blockImplementations = o.schema.blockSpecs, this.inlineContentImplementations = o.schema.inlineContentSpecs, this.styleImplementations = o.schema.styleSpecs, o.uploadFile) {
|
|
2971
2973
|
const C = o.uploadFile;
|
|
2972
|
-
this.uploadFile = async (
|
|
2974
|
+
this.uploadFile = async (P, w) => {
|
|
2973
2975
|
this.onUploadStartCallbacks.forEach(
|
|
2974
|
-
(
|
|
2976
|
+
(v) => v.apply(this, [w])
|
|
2975
2977
|
);
|
|
2976
2978
|
try {
|
|
2977
|
-
return await C(
|
|
2979
|
+
return await C(P, w);
|
|
2978
2980
|
} finally {
|
|
2979
2981
|
this.onUploadEndCallbacks.forEach(
|
|
2980
|
-
(
|
|
2982
|
+
(v) => v.apply(this, [w])
|
|
2981
2983
|
);
|
|
2982
2984
|
}
|
|
2983
2985
|
};
|
|
2984
2986
|
}
|
|
2985
|
-
this.resolveFileUrl = o.resolveFileUrl, this._eventManager = new
|
|
2987
|
+
this.resolveFileUrl = o.resolveFileUrl, this._eventManager = new po(this), this._extensionManager = new cn(this, o);
|
|
2986
2988
|
const s = this._extensionManager.getTiptapExtensions(), i = this._extensionManager.hasExtension("ySync") || this._extensionManager.hasExtension("liveblocksExtension");
|
|
2987
2989
|
i && o.initialContent && console.warn(
|
|
2988
2990
|
"When using Collaboration, initialContent might cause conflicts, because changes should come from the collaboration provider"
|
|
2989
2991
|
);
|
|
2990
2992
|
const r = {
|
|
2991
|
-
...
|
|
2993
|
+
...Bn,
|
|
2992
2994
|
...o._tiptapOptions,
|
|
2993
2995
|
element: null,
|
|
2994
2996
|
autofocus: o.autofocus ?? !1,
|
|
@@ -3005,10 +3007,10 @@ class Ae extends ge {
|
|
|
3005
3007
|
class: Q(
|
|
3006
3008
|
"bn-editor",
|
|
3007
3009
|
o.defaultStyles ? "bn-default-styles" : "",
|
|
3008
|
-
((
|
|
3010
|
+
((T = (y = o.domAttributes) == null ? void 0 : y.editor) == null ? void 0 : T.class) || ""
|
|
3009
3011
|
)
|
|
3010
3012
|
},
|
|
3011
|
-
transformPasted:
|
|
3013
|
+
transformPasted: yn
|
|
3012
3014
|
}
|
|
3013
3015
|
};
|
|
3014
3016
|
try {
|
|
@@ -3020,16 +3022,16 @@ class Ae extends ge {
|
|
|
3020
3022
|
] : [
|
|
3021
3023
|
{
|
|
3022
3024
|
type: "paragraph",
|
|
3023
|
-
id:
|
|
3025
|
+
id: me.options.generateID()
|
|
3024
3026
|
}
|
|
3025
3027
|
]);
|
|
3026
3028
|
if (!Array.isArray(C) || C.length === 0)
|
|
3027
3029
|
throw new Error(
|
|
3028
3030
|
"initialContent must be a non-empty array of blocks, received: " + C
|
|
3029
3031
|
);
|
|
3030
|
-
const
|
|
3031
|
-
(
|
|
3032
|
-
),
|
|
3032
|
+
const P = Pt(r.extensions), w = C.map(
|
|
3033
|
+
(Le) => Y(Le, P, this.schema.styleSchema).toJSON()
|
|
3034
|
+
), v = vt(
|
|
3033
3035
|
{
|
|
3034
3036
|
type: "doc",
|
|
3035
3037
|
content: [
|
|
@@ -3039,12 +3041,12 @@ class Ae extends ge {
|
|
|
3039
3041
|
}
|
|
3040
3042
|
]
|
|
3041
3043
|
},
|
|
3042
|
-
|
|
3044
|
+
P,
|
|
3043
3045
|
r.parseOptions
|
|
3044
3046
|
);
|
|
3045
|
-
this._tiptapEditor = new
|
|
3047
|
+
this._tiptapEditor = new It({
|
|
3046
3048
|
...r,
|
|
3047
|
-
content:
|
|
3049
|
+
content: v.toJSON()
|
|
3048
3050
|
}), this.pmSchema = this._tiptapEditor.schema;
|
|
3049
3051
|
} catch (C) {
|
|
3050
3052
|
throw new Error(
|
|
@@ -3057,12 +3059,12 @@ class Ae extends ge {
|
|
|
3057
3059
|
this.pmSchema.nodes.doc.createAndFill = (...C) => {
|
|
3058
3060
|
if (c)
|
|
3059
3061
|
return c;
|
|
3060
|
-
const
|
|
3061
|
-
return w.content[0].content[0].attrs.id = "initialBlockId", c =
|
|
3062
|
-
}, this.pmSchema.cached.blockNoteEditor = this, this._blockManager = new
|
|
3062
|
+
const P = a.apply(this.pmSchema.nodes.doc, C), w = JSON.parse(JSON.stringify(P.toJSON()));
|
|
3063
|
+
return w.content[0].content[0].attrs.id = "initialBlockId", c = He.fromJSON(this.pmSchema, w), c;
|
|
3064
|
+
}, this.pmSchema.cached.blockNoteEditor = this, this._blockManager = new uo(this), this._exportManager = new Co(this), this._selectionManager = new fn(this), this._stateManager = new hn(this), this._styleManager = new kn(this), this.emit("create");
|
|
3063
3065
|
}
|
|
3064
3066
|
static create(t) {
|
|
3065
|
-
return new
|
|
3067
|
+
return new De(t ?? {});
|
|
3066
3068
|
}
|
|
3067
3069
|
/**
|
|
3068
3070
|
* BlockNote extensions that are added to the editor, keyed by the extension key
|
|
@@ -3590,7 +3592,7 @@ class Ae extends ge {
|
|
|
3590
3592
|
return this._exportManager.pasteMarkdown(t);
|
|
3591
3593
|
}
|
|
3592
3594
|
}
|
|
3593
|
-
class
|
|
3595
|
+
class Yn {
|
|
3594
3596
|
constructor(e, t, o) {
|
|
3595
3597
|
this.mappings = t, this.options = o;
|
|
3596
3598
|
}
|
|
@@ -3623,14 +3625,14 @@ class Rn {
|
|
|
3623
3625
|
);
|
|
3624
3626
|
}
|
|
3625
3627
|
}
|
|
3626
|
-
function
|
|
3628
|
+
function qn(n) {
|
|
3627
3629
|
return {
|
|
3628
3630
|
createBlockMapping: (e) => e,
|
|
3629
3631
|
createInlineContentMapping: (e) => e,
|
|
3630
3632
|
createStyleMapping: (e) => e
|
|
3631
3633
|
};
|
|
3632
3634
|
}
|
|
3633
|
-
function
|
|
3635
|
+
function Qn(n, ...e) {
|
|
3634
3636
|
const t = [...n];
|
|
3635
3637
|
for (const o of e)
|
|
3636
3638
|
for (const s of o) {
|
|
@@ -3642,171 +3644,171 @@ function Wn(n, ...e) {
|
|
|
3642
3644
|
return t;
|
|
3643
3645
|
}
|
|
3644
3646
|
export {
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3647
|
+
De as BlockNoteEditor,
|
|
3648
|
+
Et as BlockNoteSchema,
|
|
3649
|
+
ms as COLORS_DARK_MODE_DEFAULT,
|
|
3650
|
+
ks as COLORS_DEFAULT,
|
|
3651
|
+
Yr as CustomBlockNoteSchema,
|
|
3652
|
+
gs as EMPTY_CELL_HEIGHT,
|
|
3653
|
+
bs as EMPTY_CELL_WIDTH,
|
|
3654
|
+
ye as EventEmitter,
|
|
3655
|
+
Yn as Exporter,
|
|
3656
|
+
ys as FILE_AUDIO_ICON_SVG,
|
|
3657
|
+
Ss as FILE_IMAGE_ICON_SVG,
|
|
3658
|
+
Bs as FILE_VIDEO_ICON_SVG,
|
|
3659
|
+
Te as HTMLToBlocks,
|
|
3660
|
+
me as UniqueID,
|
|
3659
3661
|
F as UnreachableCaseError,
|
|
3660
|
-
|
|
3662
|
+
Cs as addDefaultPropsExternalHTML,
|
|
3661
3663
|
$ as addInlineContentAttributes,
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3664
|
+
je as addInlineContentKeyboardShortcuts,
|
|
3665
|
+
Es as addNodeAndExtensionsToSpec,
|
|
3666
|
+
xs as addStyleAttributes,
|
|
3667
|
+
Ms as applyNonSelectableBlockFix,
|
|
3668
|
+
es as assertEmpty,
|
|
3669
|
+
ws as audioParse,
|
|
3670
|
+
Ts as audioRender,
|
|
3671
|
+
Ps as audioToExternalHTML,
|
|
3672
|
+
vs as blockHasType,
|
|
3671
3673
|
Y as blockToNode,
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3674
|
+
ot as blocksToMarkdown,
|
|
3675
|
+
Is as camelToDataKebab,
|
|
3676
|
+
As as captureCellAnchor,
|
|
3677
|
+
qr as checkPageBreakBlocksInSchema,
|
|
3678
|
+
nt as cleanHTMLToMarkdown,
|
|
3679
|
+
Qn as combineByGroup,
|
|
3680
|
+
Ge as contentNodeToInlineContent,
|
|
3681
|
+
ze as contentNodeToTableContent,
|
|
3682
|
+
_s as createAudioBlockConfig,
|
|
3683
|
+
Ds as createAudioBlockSpec,
|
|
3684
|
+
Ls as createBlockConfig,
|
|
3685
|
+
Ns as createBlockSpec,
|
|
3686
|
+
Os as createBlockSpecFromTiptapNode,
|
|
3687
|
+
Fs as createBulletListItemBlockConfig,
|
|
3688
|
+
Hs as createBulletListItemBlockSpec,
|
|
3689
|
+
$s as createCheckListItemBlockSpec,
|
|
3690
|
+
Vs as createCheckListItemConfig,
|
|
3691
|
+
Us as createCodeBlockConfig,
|
|
3692
|
+
zs as createCodeBlockSpec,
|
|
3693
|
+
Gs as createDefaultBlockDOMOutputSpec,
|
|
3694
|
+
Rs as createDividerBlockConfig,
|
|
3695
|
+
js as createDividerBlockSpec,
|
|
3696
|
+
ni as createExtension,
|
|
3697
|
+
be as createExternalHTMLExporter,
|
|
3698
|
+
Ws as createFileBlockConfig,
|
|
3699
|
+
Ks as createFileBlockSpec,
|
|
3700
|
+
Js as createHeadingBlockConfig,
|
|
3701
|
+
Ys as createHeadingBlockSpec,
|
|
3702
|
+
qs as createImageBlockConfig,
|
|
3703
|
+
Qs as createImageBlockSpec,
|
|
3704
|
+
Jn as createInlineContentSpec,
|
|
3705
|
+
Ke as createInlineContentSpecFromTipTapNode,
|
|
3706
|
+
Qt as createInternalHTMLSerializer,
|
|
3707
|
+
Xs as createInternalInlineContentSpec,
|
|
3708
|
+
Zs as createInternalStyleSpec,
|
|
3709
|
+
er as createNumberedListItemBlockConfig,
|
|
3710
|
+
tr as createNumberedListItemBlockSpec,
|
|
3711
|
+
Qr as createPageBreakBlockConfig,
|
|
3712
|
+
Xr as createPageBreakBlockSpec,
|
|
3713
|
+
or as createParagraphBlockConfig,
|
|
3714
|
+
nr as createParagraphBlockSpec,
|
|
3715
|
+
sr as createQuoteBlockConfig,
|
|
3716
|
+
rr as createQuoteBlockSpec,
|
|
3717
|
+
si as createStore,
|
|
3718
|
+
ir as createStyleSpec,
|
|
3719
|
+
ar as createStyleSpecFromTipTapMark,
|
|
3720
|
+
cr as createTableBlockSpec,
|
|
3721
|
+
lr as createToggleListItemBlockConfig,
|
|
3722
|
+
dr as createToggleListItemBlockSpec,
|
|
3723
|
+
ur as createToggleWrapper,
|
|
3724
|
+
pr as createVideoBlockConfig,
|
|
3725
|
+
fr as createVideoBlockSpec,
|
|
3726
|
+
hr as defaultBlockSpecs,
|
|
3727
|
+
mr as defaultBlockToHTML,
|
|
3728
|
+
kr as defaultInlineContentSchema,
|
|
3729
|
+
gr as defaultInlineContentSpecs,
|
|
3730
|
+
br as defaultProps,
|
|
3731
|
+
yr as defaultStyleSchema,
|
|
3732
|
+
Sr as defaultStyleSpecs,
|
|
3733
|
+
Br as defaultToggledState,
|
|
3734
|
+
Ue as docToBlocks,
|
|
3735
|
+
Cr as editorHasBlockWithType,
|
|
3736
|
+
Er as fileParse,
|
|
3737
|
+
xr as filenameFromURL,
|
|
3736
3738
|
W as fixColumnList,
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3739
|
+
Mr as formatKeyboardShortcut,
|
|
3740
|
+
qe as getBackgroundColorAttribute,
|
|
3741
|
+
io as getBlock,
|
|
3742
|
+
ts as getBlockCache,
|
|
3743
|
+
wr as getBlockFromPos,
|
|
3742
3744
|
z as getBlockInfo,
|
|
3743
3745
|
q as getBlockInfoFromResolvedPos,
|
|
3744
3746
|
S as getBlockInfoFromSelection,
|
|
3745
3747
|
H as getBlockInfoFromTransaction,
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3748
|
+
os as getBlockInfoWithManualOffset,
|
|
3749
|
+
ke as getBlockNoteSchema,
|
|
3750
|
+
ns as getBlockSchema,
|
|
3751
|
+
tt as getBlocksChangedByTransaction,
|
|
3752
|
+
ss as getColspan,
|
|
3753
|
+
Wt as getInlineContentParseRules,
|
|
3754
|
+
rs as getInlineContentSchema,
|
|
3755
|
+
Tr as getInlineContentSchemaFromSpecs,
|
|
3756
|
+
Pr as getLanguageId,
|
|
3757
|
+
_ as getNearestBlockPos,
|
|
3758
|
+
co as getNextBlock,
|
|
3759
|
+
E as getNodeById,
|
|
3760
|
+
Zr as getPageBreakSlashMenuItems,
|
|
3761
|
+
lo as getParentBlock,
|
|
3762
|
+
vr as getParseRules,
|
|
3761
3763
|
B as getPmSchema,
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3764
|
+
ao as getPrevBlock,
|
|
3765
|
+
is as getRowspan,
|
|
3766
|
+
Ir as getStyleParseRules,
|
|
3767
|
+
as as getStyleSchema,
|
|
3768
|
+
Ar as getStyleSchemaFromSpecs,
|
|
3769
|
+
_r as getTextAlignmentAttribute,
|
|
3770
|
+
Ze as getTextColorAttribute,
|
|
3771
|
+
Dr as imageParse,
|
|
3772
|
+
Lr as imageRender,
|
|
3773
|
+
Nr as imageToExternalHTML,
|
|
3772
3774
|
O as inlineContentToNodes,
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
+
Kt as insertBlocks,
|
|
3776
|
+
Or as isAppleOS,
|
|
3775
3777
|
j as isEmptyColumn,
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3778
|
+
cs as isLinkInlineContent,
|
|
3779
|
+
Fr as isNodeBlock,
|
|
3780
|
+
ls as isPartialLinkInlineContent,
|
|
3781
|
+
ds as isPartialTableCell,
|
|
3782
|
+
Hr as isSafari,
|
|
3783
|
+
us as isStyledTextInlineContent,
|
|
3784
|
+
ps as isTableCell,
|
|
3785
|
+
$r as isTableCellSelection,
|
|
3786
|
+
Ye as isVideoUrl,
|
|
3787
|
+
fs as mapTableCell,
|
|
3788
|
+
qn as mappingFactory,
|
|
3789
|
+
Bo as markdownToBlocks,
|
|
3790
|
+
Pe as markdownToHTML,
|
|
3789
3791
|
Q as mergeCSSClasses,
|
|
3790
|
-
|
|
3792
|
+
Vr as mergeParagraphs,
|
|
3791
3793
|
b as nodeToBlock,
|
|
3792
3794
|
U as nodeToCustomInlineContent,
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3795
|
+
Ur as parseAudioElement,
|
|
3796
|
+
zr as parseDefaultProps,
|
|
3797
|
+
We as propsToAttributes,
|
|
3798
|
+
Re as prosemirrorSliceToSlicedBlocks,
|
|
3799
|
+
ie as removeAndInsertBlocks,
|
|
3800
|
+
Jt as removeEmptyColumns,
|
|
3801
|
+
Ie as selectedFragmentToHTML,
|
|
3802
|
+
Gr as stylePropsToAttributes,
|
|
3803
|
+
Ve as tableContentToNodes,
|
|
3804
|
+
Rr as tablePropSchema,
|
|
3805
|
+
jr as trackPosition,
|
|
3806
|
+
Je as updateBlock,
|
|
3807
|
+
Xe as updateBlockCommand,
|
|
3808
|
+
et as updateBlockTr,
|
|
3809
|
+
ei as uploadToTmpFilesDotOrg_DEV_ONLY,
|
|
3810
|
+
Wr as videoParse,
|
|
3811
|
+
ti as withPageBreak,
|
|
3812
|
+
Kr as wrapInBlockStructure
|
|
3811
3813
|
};
|
|
3812
3814
|
//# sourceMappingURL=blocknote.js.map
|