@blocknote/core 0.54.1 → 0.55.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/BlockNoteExtension-BJCLnwrE.cjs.map +1 -1
- package/dist/BlockNoteExtension-CbvDA0F7.js.map +1 -1
- package/dist/blocknote.cjs +1 -1
- package/dist/blocknote.js +6 -6
- package/dist/blocks-DLgTreVu.cjs +12 -0
- package/dist/blocks-DLgTreVu.cjs.map +1 -0
- package/dist/{blocks-Dol85hpH.js → blocks-DaEUT0O1.js} +346 -340
- package/dist/blocks-DaEUT0O1.js.map +1 -0
- package/dist/blocks.cjs +1 -1
- package/dist/blocks.js +1 -1
- package/dist/comments.cjs +1 -1
- package/dist/comments.cjs.map +1 -1
- package/dist/comments.js +62 -36
- package/dist/comments.js.map +1 -1
- package/dist/{en-uzHzj6eH.js → en-BAn9gxr-.js} +5 -2
- package/dist/{en-uzHzj6eH.js.map → en-BAn9gxr-.js.map} +1 -1
- package/dist/{en-BuzSuuTq.cjs → en-CHnrV5l8.cjs} +2 -2
- package/dist/{en-BuzSuuTq.cjs.map → en-CHnrV5l8.cjs.map} +1 -1
- package/dist/{extensions-D6JcJCwd.js → extensions-B1JQURVF.js} +221 -221
- package/dist/extensions-B1JQURVF.js.map +1 -0
- package/dist/{extensions-B7Rsp_Ft.cjs → extensions-CZkqKzJO.cjs} +3 -3
- package/dist/extensions-CZkqKzJO.cjs.map +1 -0
- package/dist/extensions.cjs +1 -1
- package/dist/extensions.js +2 -2
- package/dist/locales.cjs +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.js +89 -23
- package/dist/locales.js.map +1 -1
- package/dist/{src-Buuo5l7X.js → src-D5w0XAHX.js} +702 -640
- package/dist/src-D5w0XAHX.js.map +1 -0
- package/dist/{src-C54Ok9E0.cjs → src-th5uZEvx.cjs} +8 -8
- package/dist/src-th5uZEvx.cjs.map +1 -0
- package/dist/webpack-stats.json +1 -1
- package/dist/y.cjs +1 -1
- package/dist/y.js +3 -3
- package/dist/yjs.cjs +1 -1
- package/dist/yjs.js +1 -1
- package/package.json +12 -12
- package/src/comments/CommentEditorSubmitExtension.test.ts +141 -0
- package/src/comments/CommentEditorSubmitExtension.ts +56 -0
- package/src/comments/extension.ts +8 -0
- package/src/comments/index.ts +1 -0
- package/src/editor/BlockNoteEditor.ts +94 -41
- package/src/editor/BlockNoteExtension.ts +6 -1
- package/src/editor/managers/EventManager.browser.test.ts +334 -0
- package/src/editor/managers/EventManager.ts +128 -31
- package/src/editor/managers/ExtensionManager/ExtensionManager.test.ts +88 -1
- package/src/editor/managers/ExtensionManager/index.ts +30 -7
- package/src/editor/managers/StyleManager.browser.test.ts +122 -0
- package/src/editor/managers/StyleManager.test.ts +98 -0
- package/src/editor/managers/StyleManager.ts +31 -15
- package/src/editor/managers/index.ts +1 -0
- package/src/extensions/FormattingToolbar/FormattingToolbar.ts +23 -0
- package/src/extensions/SideMenu/SideMenu.ts +15 -0
- package/src/extensions/TableHandles/TableHandles.browser.test.ts +3 -1
- package/src/i18n/locales/ar.ts +1 -0
- package/src/i18n/locales/de.ts +1 -0
- package/src/i18n/locales/en.ts +1 -0
- package/src/i18n/locales/es.ts +1 -0
- package/src/i18n/locales/fa.ts +1 -0
- package/src/i18n/locales/fr.ts +1 -0
- package/src/i18n/locales/he.ts +1 -0
- package/src/i18n/locales/hr.ts +1 -0
- package/src/i18n/locales/is.ts +1 -0
- package/src/i18n/locales/it.ts +1 -0
- package/src/i18n/locales/ja.ts +1 -0
- package/src/i18n/locales/ko.ts +1 -0
- package/src/i18n/locales/nl.ts +1 -0
- package/src/i18n/locales/no.ts +1 -0
- package/src/i18n/locales/pl.ts +1 -0
- package/src/i18n/locales/pt.ts +1 -0
- package/src/i18n/locales/ru.ts +1 -0
- package/src/i18n/locales/sk.ts +1 -0
- package/src/i18n/locales/uk.ts +1 -0
- package/src/i18n/locales/uz.ts +1 -0
- package/src/i18n/locales/vi.ts +1 -0
- package/src/i18n/locales/zh-tw.ts +1 -0
- package/src/i18n/locales/zh.ts +1 -0
- package/src/index.ts +1 -0
- package/src/util/browser.ts +24 -0
- package/types/src/blocks/Code/helpers/extensions/CodeKeyboardShortcutsExtension.d.ts +4 -0
- package/types/src/comments/CommentEditorSubmitExtension.d.ts +19 -0
- package/types/src/comments/CommentEditorSubmitExtension.test.d.ts +1 -0
- package/types/src/comments/extension.d.ts +7 -0
- package/types/src/comments/index.d.ts +1 -0
- package/types/src/editor/BlockNoteEditor.d.ts +52 -19
- package/types/src/editor/BlockNoteExtension.d.ts +3 -0
- package/types/src/editor/managers/EventManager.browser.test.d.ts +1 -0
- package/types/src/editor/managers/EventManager.d.ts +55 -0
- package/types/src/editor/managers/StyleManager.browser.test.d.ts +1 -0
- package/types/src/editor/managers/StyleManager.d.ts +4 -2
- package/types/src/editor/managers/StyleManager.test.d.ts +1 -0
- package/types/src/editor/managers/index.d.ts +1 -0
- package/types/src/extensions/SourceBlockWithPreview/SourceBlockWithPreview.d.ts +3 -0
- package/types/src/extensions/SourceInlineContentWithPreview/SourceInlineContentWithPreview.d.ts +1 -0
- package/types/src/i18n/locales/en.d.ts +1 -0
- package/types/src/i18n/locales/fa.d.ts +1 -0
- package/types/src/i18n/locales/sk.d.ts +1 -0
- package/types/src/index.d.ts +1 -0
- package/types/src/util/browser.d.ts +2 -0
- package/dist/blocks-CTB_5Vyj.cjs +0 -12
- package/dist/blocks-CTB_5Vyj.cjs.map +0 -1
- package/dist/blocks-Dol85hpH.js.map +0 -1
- package/dist/extensions-B7Rsp_Ft.cjs.map +0 -1
- package/dist/extensions-D6JcJCwd.js.map +0 -1
- package/dist/src-Buuo5l7X.js.map +0 -1
- package/dist/src-C54Ok9E0.cjs.map +0 -1
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { Bt as e, Gt as t,
|
|
1
|
+
import { Bt as e, Gt as t, Ht as n, It as r, Kt as i, Lt as a, Nt as o, Pt as s, Rt as c, Tn as l, Ut as u, Vt as d, Wn as f, Wt as p, _ as m, h, qt as g, r as ee, sr as _, v as te, wn as v, zt as ne } from "./blocks-DaEUT0O1.js";
|
|
2
2
|
import { n as y, t as b } from "./BlockNoteExtension-CbvDA0F7.js";
|
|
3
3
|
import { n as re } from "./UserStore-C4TzkGEn.js";
|
|
4
|
-
import { DOMSerializer as
|
|
5
|
-
import { Mapping as
|
|
6
|
-
import { combineTransactionSteps as
|
|
7
|
-
import { uuidv4 as
|
|
8
|
-
import { NodeSelection as
|
|
9
|
-
import { DOMParser as
|
|
10
|
-
import { CellSelection as
|
|
11
|
-
import { Plugin as
|
|
12
|
-
import { Decoration as
|
|
13
|
-
import
|
|
14
|
-
import { history as
|
|
15
|
-
import { createHighlightPlugin as
|
|
16
|
-
import { createParser as
|
|
17
|
-
function
|
|
4
|
+
import { DOMSerializer as ie, Fragment as x, Slice as ae } from "prosemirror-model";
|
|
5
|
+
import { Mapping as oe, dropPoint as se } from "prosemirror-transform";
|
|
6
|
+
import { combineTransactionSteps as ce, findChildrenInRange as le, posToDOMRect as ue } from "@tiptap/core";
|
|
7
|
+
import { uuidv4 as de } from "lib0/random";
|
|
8
|
+
import { NodeSelection as fe, Plugin as S, PluginKey as C, Selection as w, TextSelection as T } from "prosemirror-state";
|
|
9
|
+
import { DOMParser as pe, Slice as me } from "@tiptap/pm/model";
|
|
10
|
+
import { CellSelection as he, addColumnAfter as ge, addColumnBefore as _e, addRowAfter as ve, addRowBefore as ye, deleteColumn as be, deleteRow as xe, mergeCells as Se, splitCell as Ce } from "prosemirror-tables";
|
|
11
|
+
import { Plugin as we, PluginKey as Te, TextSelection as Ee } from "@tiptap/pm/state";
|
|
12
|
+
import { Decoration as E, DecorationSet as D } from "prosemirror-view";
|
|
13
|
+
import De from "fast-deep-equal";
|
|
14
|
+
import { history as Oe, redo as ke, undo as Ae } from "@tiptap/pm/history";
|
|
15
|
+
import { createHighlightPlugin as je } from "prosemirror-highlight";
|
|
16
|
+
import { createParser as Me } from "prosemirror-highlight/shiki";
|
|
17
|
+
function Ne(e) {
|
|
18
18
|
let t = Array.from(e.classList).filter((e) => !e.startsWith("bn-")) || [];
|
|
19
19
|
t.length > 0 ? e.className = t.join(" ") : e.removeAttribute("class");
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
let
|
|
21
|
+
function Pe(e, t, n, i) {
|
|
22
|
+
let o;
|
|
23
23
|
if (!t) throw Error("blockContent is required");
|
|
24
|
-
if (typeof t == "string")
|
|
25
|
-
else if (Array.isArray(t))
|
|
26
|
-
else if (t.type === "tableContent")
|
|
27
|
-
else throw new
|
|
28
|
-
let
|
|
29
|
-
for (let t of
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
32
|
-
let
|
|
24
|
+
if (typeof t == "string") o = r([t], e.pmSchema, i?.blockType);
|
|
25
|
+
else if (Array.isArray(t)) o = r(t, e.pmSchema, i?.blockType);
|
|
26
|
+
else if (t.type === "tableContent") o = a(t, e.pmSchema);
|
|
27
|
+
else throw new f(t.type);
|
|
28
|
+
let s = (i?.document ?? document).createDocumentFragment();
|
|
29
|
+
for (let t of o) if (t.type.name !== "text" && e.schema.inlineContentSchema[t.type.name]) {
|
|
30
|
+
let r = e.schema.inlineContentSpecs[t.type.name].implementation;
|
|
31
|
+
if (r) {
|
|
32
|
+
let a = l(t, e.schema.inlineContentSchema, e.schema.styleSchema), o = r.toExternalHTML ? r.toExternalHTML(a, e) : r.render.call({
|
|
33
33
|
renderType: "dom",
|
|
34
34
|
props: void 0
|
|
35
|
-
},
|
|
35
|
+
}, a, () => {}, e);
|
|
36
36
|
if (o) {
|
|
37
|
-
if (
|
|
38
|
-
let e =
|
|
37
|
+
if (s.appendChild(o.dom), o.contentDOM) {
|
|
38
|
+
let e = n.serializeFragment(t.content, i);
|
|
39
39
|
o.contentDOM.dataset.editable = "", o.contentDOM.appendChild(e);
|
|
40
40
|
}
|
|
41
41
|
continue;
|
|
@@ -47,17 +47,17 @@ function Ne(e, t, r, a) {
|
|
|
47
47
|
let t = (e.schema.styleSpecs[r.type.name].implementation.toExternalHTML ?? e.schema.styleSpecs[r.type.name].implementation.render)(r.attrs.stringValue, e);
|
|
48
48
|
t.contentDOM.appendChild(n), n = t.dom;
|
|
49
49
|
} else {
|
|
50
|
-
let e = r.type.spec.toDOM(r, !0), t =
|
|
50
|
+
let e = r.type.spec.toDOM(r, !0), t = ie.renderSpec(document, e);
|
|
51
51
|
t.contentDOM.appendChild(n), n = t.dom;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
s.appendChild(n);
|
|
54
54
|
} else {
|
|
55
|
-
let e =
|
|
56
|
-
|
|
55
|
+
let e = n.serializeFragment(x.from([t]), i);
|
|
56
|
+
s.appendChild(e);
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return s.childNodes.length === 1 && s.firstChild?.nodeType === 1 && Ne(s.firstChild), s;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Fe(e, t, n, r, i, a, o, s) {
|
|
61
61
|
let c = s?.document ?? document, l = t.pmSchema.nodes.blockContainer, u = n.props || {};
|
|
62
62
|
for (let [e, r] of Object.entries(t.schema.blockSchema[n.type].propSchema)) !(e in u) && r.default !== void 0 && (u[e] = r.default);
|
|
63
63
|
let d = l.spec?.toDOM?.(l.create({
|
|
@@ -73,11 +73,11 @@ function Pe(e, t, n, r, i, a, o, s) {
|
|
|
73
73
|
if (m.dom.classList.contains("bn-block-content")) {
|
|
74
74
|
let e = [...f, ...Array.from(m.dom.attributes)].filter((e) => e.name.startsWith("data") && e.name !== "data-content-type" && e.name !== "data-file-block" && e.name !== "data-node-view-wrapper" && e.name !== "data-node-type" && e.name !== "data-id" && e.name !== "data-editable");
|
|
75
75
|
for (let t of e) m.dom.firstChild.setAttribute(t.name, t.value);
|
|
76
|
-
|
|
76
|
+
Ne(m.dom.firstChild), o > 0 && m.dom.firstChild.setAttribute("data-nesting-level", o.toString()), h.append(...Array.from(m.dom.childNodes));
|
|
77
77
|
} else h.append(m.dom), o > 0 && m.dom.setAttribute("data-nesting-level", o.toString());
|
|
78
78
|
if (m.contentDOM) {
|
|
79
79
|
if (n.content) {
|
|
80
|
-
let e =
|
|
80
|
+
let e = Pe(t, n.content, r, {
|
|
81
81
|
...s,
|
|
82
82
|
blockType: n.type
|
|
83
83
|
});
|
|
@@ -96,20 +96,20 @@ function Pe(e, t, n, r, i, a, o, s) {
|
|
|
96
96
|
} else e.append(h);
|
|
97
97
|
if (n.children && n.children.length > 0) {
|
|
98
98
|
let l = c.createDocumentFragment();
|
|
99
|
-
if (
|
|
99
|
+
if (Ie(l, t, n.children, r, i, a, o + 1, s), e.lastChild?.nodeName === "UL" || e.lastChild?.nodeName === "OL") for (; l.firstChild?.nodeName === "UL" || l.firstChild?.nodeName === "OL";) e.lastChild.lastChild.appendChild(l.firstChild);
|
|
100
100
|
"childrenDOM" in m && m.childrenDOM ? m.childrenDOM.append(l) : t.pmSchema.nodes[n.type].isInGroup("blockContent") ? e.append(l) : m.contentDOM?.append(l);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
var
|
|
104
|
-
for (let c of n)
|
|
105
|
-
},
|
|
103
|
+
var Ie = (e, t, n, r, i, a, o = 0, s) => {
|
|
104
|
+
for (let c of n) Fe(e, t, c, r, i, a, o, s);
|
|
105
|
+
}, Le = (e, t, n, r, i, a) => {
|
|
106
106
|
let o = (a?.document ?? document).createDocumentFragment();
|
|
107
|
-
return
|
|
108
|
-
},
|
|
109
|
-
let n =
|
|
107
|
+
return Ie(o, e, t, n, r, i, 0, a), o;
|
|
108
|
+
}, O = (e, t) => {
|
|
109
|
+
let n = ie.fromSchema(e);
|
|
110
110
|
return {
|
|
111
111
|
exportBlocks: (e, r) => {
|
|
112
|
-
let i =
|
|
112
|
+
let i = Le(t, e, n, /* @__PURE__ */ new Set(["numberedListItem"]), /* @__PURE__ */ new Set([
|
|
113
113
|
"bulletListItem",
|
|
114
114
|
"checkListItem",
|
|
115
115
|
"toggleListItem"
|
|
@@ -117,14 +117,14 @@ var Fe = (e, t, n, r, i, a, o = 0, s) => {
|
|
|
117
117
|
return a.append(i), a.innerHTML;
|
|
118
118
|
},
|
|
119
119
|
exportInlineContent: (e, r) => {
|
|
120
|
-
let i =
|
|
120
|
+
let i = Pe(t, e, n, r), a = document.createElement("div");
|
|
121
121
|
return a.append(i.cloneNode(!0)), a.innerHTML;
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
124
|
};
|
|
125
125
|
//#endregion
|
|
126
126
|
//#region src/api/getChangedRange.ts
|
|
127
|
-
function
|
|
127
|
+
function k(e) {
|
|
128
128
|
let { mapping: t, steps: n } = e, r = Infinity, i = -Infinity;
|
|
129
129
|
for (let e = 0; e < t.maps.length; e++) {
|
|
130
130
|
let a = t.maps[e];
|
|
@@ -149,7 +149,7 @@ function Re(e, t) {
|
|
|
149
149
|
let n = e.resolve(t);
|
|
150
150
|
for (let t = n.depth; t > 0; t--) {
|
|
151
151
|
let r = n.node(t);
|
|
152
|
-
if (
|
|
152
|
+
if (s(r)) return _(r, e);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
function ze(e) {
|
|
@@ -158,12 +158,12 @@ function ze(e) {
|
|
|
158
158
|
function Be(e, t) {
|
|
159
159
|
let n = {}, r = {}, i = Math.max(0, Math.min(t.from, e.content.size)), a = Math.max(i, Math.min(t.to, e.content.size));
|
|
160
160
|
return e.nodesBetween(i, a, (t, i) => {
|
|
161
|
-
if (!
|
|
161
|
+
if (!s(t)) return !0;
|
|
162
162
|
let a = Re(e, i), o = a ?? "__root__";
|
|
163
163
|
r[o] || (r[o] = []);
|
|
164
|
-
let
|
|
164
|
+
let c = v(t, e), l = _(t, e);
|
|
165
165
|
return n[l] = {
|
|
166
|
-
block:
|
|
166
|
+
block: c,
|
|
167
167
|
parentId: a
|
|
168
168
|
}, r[o].push(l), !0;
|
|
169
169
|
}), {
|
|
@@ -196,7 +196,7 @@ function Ve(e, t) {
|
|
|
196
196
|
return n;
|
|
197
197
|
}
|
|
198
198
|
function He(e, t = []) {
|
|
199
|
-
let n = ze(e), r =
|
|
199
|
+
let n = ze(e), r = ce(e.before, [e, ...t]), i = k(r);
|
|
200
200
|
if (!i) return [];
|
|
201
201
|
let a = r.mapping.invert(), o = {
|
|
202
202
|
from: a.map(i.from, -1),
|
|
@@ -218,7 +218,7 @@ function He(e, t = []) {
|
|
|
218
218
|
}), u.add(e);
|
|
219
219
|
}), Object.keys(c.byId).filter((e) => e in s.byId).forEach((e) => {
|
|
220
220
|
let t = s.byId[e], r = c.byId[e];
|
|
221
|
-
t.parentId === r.parentId ?
|
|
221
|
+
t.parentId === r.parentId ? De({
|
|
222
222
|
...t.block,
|
|
223
223
|
children: void 0
|
|
224
224
|
}, {
|
|
@@ -260,8 +260,8 @@ var Ue = b(() => {
|
|
|
260
260
|
let e = [];
|
|
261
261
|
return {
|
|
262
262
|
key: "blockChange",
|
|
263
|
-
prosemirrorPlugins: [new
|
|
264
|
-
key: new
|
|
263
|
+
prosemirrorPlugins: [new S({
|
|
264
|
+
key: new C("blockChange"),
|
|
265
265
|
filterTransaction: (t) => {
|
|
266
266
|
let n;
|
|
267
267
|
return e.reduce((e, r) => e === !1 ? e : r({
|
|
@@ -367,7 +367,7 @@ var Ye = "bn-drag-exclude", Xe = b(({ editor: e, options: t }) => {
|
|
|
367
367
|
if (i && !d) {
|
|
368
368
|
let t = i.pos;
|
|
369
369
|
if (r.dragging && r.dragging.slice) {
|
|
370
|
-
let e =
|
|
370
|
+
let e = se(r.state.doc, t, r.dragging.slice);
|
|
371
371
|
e != null && (t = e);
|
|
372
372
|
}
|
|
373
373
|
let a = !r.state.doc.resolve(t).parent.inlineContent, c = {
|
|
@@ -410,10 +410,10 @@ var Ye = "bn-drag-exclude", Xe = b(({ editor: e, options: t }) => {
|
|
|
410
410
|
};
|
|
411
411
|
}), Ze = b(() => ({
|
|
412
412
|
key: "history",
|
|
413
|
-
prosemirrorPlugins: [
|
|
414
|
-
undoCommand:
|
|
415
|
-
redoCommand:
|
|
416
|
-
})), Qe = new
|
|
413
|
+
prosemirrorPlugins: [Oe()],
|
|
414
|
+
undoCommand: Ae,
|
|
415
|
+
redoCommand: ke
|
|
416
|
+
})), Qe = new C("inline-content-boundary-edit");
|
|
417
417
|
function $e(e, t, n) {
|
|
418
418
|
if (!e.empty) return e.from <= n.from && e.to >= n.to;
|
|
419
419
|
let r = n.to - n.from === 1;
|
|
@@ -421,7 +421,7 @@ function $e(e, t, n) {
|
|
|
421
421
|
}
|
|
422
422
|
var et = b(() => ({
|
|
423
423
|
key: "inlineContentBoundaryEdit",
|
|
424
|
-
prosemirrorPlugins: [new
|
|
424
|
+
prosemirrorPlugins: [new S({
|
|
425
425
|
key: Qe,
|
|
426
426
|
props: { handleKeyDown: (e, t) => {
|
|
427
427
|
if (!e.editable) return !1;
|
|
@@ -432,14 +432,14 @@ var et = b(() => ({
|
|
|
432
432
|
let a = r.$from.before(), o = a + 1, s = a + 1 + i.content.size;
|
|
433
433
|
if (n && i.content.size === 0) {
|
|
434
434
|
let n = e.state.tr.insert(o, e.state.schema.text(t.key));
|
|
435
|
-
return n.setSelection(
|
|
435
|
+
return n.setSelection(T.create(n.doc, o + t.key.length)), e.dispatch(n), !0;
|
|
436
436
|
}
|
|
437
437
|
if (i.content.size > 0 && $e(r, t.key, {
|
|
438
438
|
from: o,
|
|
439
439
|
to: s
|
|
440
440
|
})) {
|
|
441
441
|
let t = e.state.tr.delete(o, s);
|
|
442
|
-
return t.setSelection(
|
|
442
|
+
return t.setSelection(T.create(t.doc, o)), e.dispatch(t), !0;
|
|
443
443
|
}
|
|
444
444
|
return !1;
|
|
445
445
|
} }
|
|
@@ -465,7 +465,7 @@ var et = b(() => ({
|
|
|
465
465
|
return n.text;
|
|
466
466
|
},
|
|
467
467
|
get position() {
|
|
468
|
-
return
|
|
468
|
+
return ue(e.prosemirrorView, n.from, n.to).toJSON();
|
|
469
469
|
}
|
|
470
470
|
};
|
|
471
471
|
}
|
|
@@ -502,9 +502,9 @@ var et = b(() => ({
|
|
|
502
502
|
"sms",
|
|
503
503
|
"cid",
|
|
504
504
|
"xmpp"
|
|
505
|
-
], rt = "https", it = new
|
|
505
|
+
], rt = "https", it = new C("node-selection-keyboard"), at = b(() => ({
|
|
506
506
|
key: "nodeSelectionKeyboard",
|
|
507
|
-
prosemirrorPlugins: [new
|
|
507
|
+
prosemirrorPlugins: [new S({
|
|
508
508
|
key: it,
|
|
509
509
|
props: { handleKeyDown: (e, t) => {
|
|
510
510
|
if ("node" in e.state.selection) {
|
|
@@ -512,20 +512,20 @@ var et = b(() => ({
|
|
|
512
512
|
if (t.key.length === 1) return t.preventDefault(), !0;
|
|
513
513
|
if (t.key === "Enter" && !t.isComposing && !t.shiftKey && !t.altKey && !t.ctrlKey && !t.metaKey) {
|
|
514
514
|
let t = e.state.tr;
|
|
515
|
-
return e.dispatch(t.insert(e.state.tr.selection.$to.after(), e.state.schema.nodes.paragraph.createChecked()).setSelection(new
|
|
515
|
+
return e.dispatch(t.insert(e.state.tr.selection.$to.after(), e.state.schema.nodes.paragraph.createChecked()).setSelection(new T(t.doc.resolve(e.state.tr.selection.$to.after() + 1)))), !0;
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
return !1;
|
|
519
519
|
} }
|
|
520
520
|
})]
|
|
521
|
-
})), ot = new
|
|
521
|
+
})), ot = new C("blocknote-placeholder"), st = b(({ editor: e, options: t }) => {
|
|
522
522
|
let n = t.placeholders;
|
|
523
523
|
return {
|
|
524
524
|
key: "placeholder",
|
|
525
|
-
prosemirrorPlugins: [new
|
|
525
|
+
prosemirrorPlugins: [new S({
|
|
526
526
|
key: ot,
|
|
527
527
|
view: (t) => {
|
|
528
|
-
let r = `placeholder-selector-${
|
|
528
|
+
let r = `placeholder-selector-${de()}`;
|
|
529
529
|
t.dom.classList.add(r);
|
|
530
530
|
let i = document.createElement("style"), a = e._tiptapEditor.options.injectNonce;
|
|
531
531
|
a && i.setAttribute("nonce", a), t.root instanceof window.ShadowRoot ? t.root.append(i) : t.root.head.appendChild(i);
|
|
@@ -548,20 +548,20 @@ var et = b(() => ({
|
|
|
548
548
|
let { doc: n, selection: r } = t;
|
|
549
549
|
if (!e.isEditable || !r.empty || r.$from.parent.type.spec.code) return;
|
|
550
550
|
let i = [];
|
|
551
|
-
t.doc.content.size === 6 && i.push(
|
|
551
|
+
t.doc.content.size === 6 && i.push(E.node(2, 4, { "data-is-only-empty-block": "true" }));
|
|
552
552
|
let a = r.$anchor, o = a.parent;
|
|
553
553
|
if (o.content.size === 0) {
|
|
554
554
|
let e = a.before();
|
|
555
|
-
i.push(
|
|
555
|
+
i.push(E.node(e, e + o.nodeSize, { "data-is-empty-and-focused": "true" }));
|
|
556
556
|
}
|
|
557
|
-
return
|
|
557
|
+
return D.create(n, i);
|
|
558
558
|
} }
|
|
559
559
|
})]
|
|
560
560
|
};
|
|
561
561
|
}), ct = b(({ editor: e }) => {
|
|
562
|
-
let t = new
|
|
562
|
+
let t = new oe(), n = 0;
|
|
563
563
|
function r() {
|
|
564
|
-
t = new
|
|
564
|
+
t = new oe(), n = 0;
|
|
565
565
|
}
|
|
566
566
|
let i = typeof FinalizationRegistry < "u" ? new FinalizationRegistry(() => {
|
|
567
567
|
n--, n === 0 && r();
|
|
@@ -580,7 +580,7 @@ var et = b(() => ({
|
|
|
580
580
|
return i && i.register(o, void 0), o;
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
|
-
}), lt = new
|
|
583
|
+
}), lt = new C("previous-blocks"), ut = {
|
|
584
584
|
index: "index",
|
|
585
585
|
level: "level",
|
|
586
586
|
type: "type",
|
|
@@ -590,7 +590,7 @@ var et = b(() => ({
|
|
|
590
590
|
let e;
|
|
591
591
|
return {
|
|
592
592
|
key: "previousBlockType",
|
|
593
|
-
prosemirrorPlugins: [new
|
|
593
|
+
prosemirrorPlugins: [new S({
|
|
594
594
|
key: lt,
|
|
595
595
|
view(t) {
|
|
596
596
|
return {
|
|
@@ -614,14 +614,14 @@ var et = b(() => ({
|
|
|
614
614
|
},
|
|
615
615
|
apply(e, t, n, r) {
|
|
616
616
|
if (t.currentTransactionOldBlockAttrs = {}, t.updatedBlocks.clear(), !e.docChanged) return t;
|
|
617
|
-
let i =
|
|
617
|
+
let i = k(e);
|
|
618
618
|
if (!i) return t;
|
|
619
619
|
let a = e.mapping.invert(), o = {
|
|
620
620
|
from: a.map(i.from, -1),
|
|
621
621
|
to: a.map(i.to, 1)
|
|
622
|
-
}, s = {}, c =
|
|
622
|
+
}, s = {}, c = le(n.doc, o, (e) => e.attrs.id), l = new Map(c.map((e) => [_(e.node, n.doc), e])), u = le(r.doc, i, (e) => e.attrs.id);
|
|
623
623
|
for (let e of u) {
|
|
624
|
-
let i =
|
|
624
|
+
let i = _(e.node, r.doc), a = l.get(i), o = a?.node.firstChild, c = e.node.firstChild;
|
|
625
625
|
if (a && o && c) {
|
|
626
626
|
let l = {
|
|
627
627
|
index: c.attrs.index,
|
|
@@ -646,12 +646,12 @@ var et = b(() => ({
|
|
|
646
646
|
let n = [];
|
|
647
647
|
return e.doc.descendants((r, i) => {
|
|
648
648
|
if (!r.attrs.id) return;
|
|
649
|
-
let a =
|
|
649
|
+
let a = _(r, e.doc);
|
|
650
650
|
if (!t.updatedBlocks.has(a)) return;
|
|
651
651
|
let o = t.currentTransactionOldBlockAttrs[a], s = {};
|
|
652
652
|
for (let [e, t] of Object.entries(o)) s["data-prev-" + ut[e]] = t || "none";
|
|
653
|
-
n.push(
|
|
654
|
-
}),
|
|
653
|
+
n.push(E.node(i, i + r.nodeSize, { ...s }));
|
|
654
|
+
}), D.create(e.doc, n);
|
|
655
655
|
} }
|
|
656
656
|
})]
|
|
657
657
|
};
|
|
@@ -1031,11 +1031,11 @@ function z(e) {
|
|
|
1031
1031
|
return pt(e.split("").join(""));
|
|
1032
1032
|
}
|
|
1033
1033
|
function Rt(e, t, n, r) {
|
|
1034
|
-
return z(
|
|
1034
|
+
return z(O(t, n).exportBlocks(e, r));
|
|
1035
1035
|
}
|
|
1036
1036
|
//#endregion
|
|
1037
1037
|
//#region src/api/nodeConversions/fragmentToBlocks.ts
|
|
1038
|
-
function
|
|
1038
|
+
function zt(e) {
|
|
1039
1039
|
let t = [];
|
|
1040
1040
|
return e.descendants((e) => e.type.name === "blockContainer" && e.firstChild?.type.name === "blockGroup" ? !0 : e.type.name === "columnList" && e.childCount === 1 ? (e.firstChild?.forEach((n) => {
|
|
1041
1041
|
t.push(v(n, e));
|
|
@@ -1043,7 +1043,7 @@ function B(e) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
//#endregion
|
|
1045
1045
|
//#region src/extensions/SideMenu/MultipleNodeSelection.ts
|
|
1046
|
-
var
|
|
1046
|
+
var B = class e extends w {
|
|
1047
1047
|
nodes;
|
|
1048
1048
|
constructor(e, t) {
|
|
1049
1049
|
super(e, t);
|
|
@@ -1056,7 +1056,7 @@ var V = class e extends T {
|
|
|
1056
1056
|
return new e(t.resolve(n), t.resolve(r));
|
|
1057
1057
|
}
|
|
1058
1058
|
content() {
|
|
1059
|
-
return new
|
|
1059
|
+
return new ae(x.from(this.nodes), 0, 0);
|
|
1060
1060
|
}
|
|
1061
1061
|
eq(t) {
|
|
1062
1062
|
if (!(t instanceof e) || this.nodes.length !== t.nodes.length || this.from !== t.from || this.to !== t.to) return !1;
|
|
@@ -1065,7 +1065,7 @@ var V = class e extends T {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
map(t, n) {
|
|
1067
1067
|
let r = n.mapResult(this.from), i = n.mapResult(this.to);
|
|
1068
|
-
return i.deleted ?
|
|
1068
|
+
return i.deleted ? w.near(t.resolve(r.pos)) : r.deleted ? w.near(t.resolve(i.pos)) : new e(t.resolve(r.pos), t.resolve(i.pos));
|
|
1069
1069
|
}
|
|
1070
1070
|
toJSON() {
|
|
1071
1071
|
return {
|
|
@@ -1075,11 +1075,11 @@ var V = class e extends T {
|
|
|
1075
1075
|
};
|
|
1076
1076
|
}
|
|
1077
1077
|
};
|
|
1078
|
-
|
|
1078
|
+
w.jsonID("multiple-node", B);
|
|
1079
1079
|
//#endregion
|
|
1080
1080
|
//#region src/extensions/SideMenu/dragging.ts
|
|
1081
|
-
var
|
|
1082
|
-
function
|
|
1081
|
+
var V;
|
|
1082
|
+
function Bt(e, t) {
|
|
1083
1083
|
let n, r, i = t.resolve(e.from).node().type.spec.group === "blockContent", a = t.resolve(e.to).node().type.spec.group === "blockContent", o = Math.min(e.$anchor.depth, e.$head.depth);
|
|
1084
1084
|
if (i && a) {
|
|
1085
1085
|
let i = e.$from.start(o - 1), a = e.$to.end(o - 1);
|
|
@@ -1090,51 +1090,51 @@ function zt(e, t) {
|
|
|
1090
1090
|
to: r
|
|
1091
1091
|
};
|
|
1092
1092
|
}
|
|
1093
|
-
function
|
|
1093
|
+
function Vt(e, t, n = t) {
|
|
1094
1094
|
t === n && (n += e.state.doc.resolve(t + 1).node().nodeSize);
|
|
1095
1095
|
let r = e.domAtPos(t).node.cloneNode(!0), i = e.domAtPos(t).node, a = (e, t) => Array.prototype.indexOf.call(e.children, t), o = a(i, e.domAtPos(t + 1).node.parentElement), s = a(i, e.domAtPos(n - 1).node.parentElement);
|
|
1096
1096
|
for (let e = i.childElementCount - 1; e >= 0; e--) (e > s || e < o) && r.removeChild(r.children[e]);
|
|
1097
|
-
|
|
1097
|
+
Ht(e.root), V = r, V.querySelectorAll("iframe, embed, object").forEach((e) => e.parentElement?.removeChild(e));
|
|
1098
1098
|
let c = e.dom.className.split(" ").filter((e) => e !== "ProseMirror" && e !== "bn-root" && e !== "bn-editor").join(" ");
|
|
1099
|
-
|
|
1099
|
+
V.className = V.className + " bn-drag-preview " + c, e.root instanceof ShadowRoot ? e.root.appendChild(V) : e.root.body.appendChild(V);
|
|
1100
1100
|
}
|
|
1101
|
-
function
|
|
1102
|
-
|
|
1101
|
+
function Ht(e) {
|
|
1102
|
+
V !== void 0 && (e instanceof ShadowRoot ? e.removeChild(V) : e.body.removeChild(V), V = void 0);
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function Ut(e, t, n) {
|
|
1105
1105
|
if (!e.dataTransfer || n.headless) return;
|
|
1106
|
-
let r = n.prosemirrorView, i =
|
|
1106
|
+
let r = n.prosemirrorView, i = o(t.id, r.state.doc);
|
|
1107
1107
|
if (!i) throw Error(`Block with ID ${t.id} not found`);
|
|
1108
1108
|
let a = i.posBeforeNode;
|
|
1109
1109
|
if (a != null) {
|
|
1110
|
-
let t = r.state.selection, i = r.state.doc, { from: o, to: s } =
|
|
1111
|
-
c && l ? (r.dispatch(r.state.tr.setSelection(
|
|
1112
|
-
let u = r.state.selection.content(), d = n.pmSchema, f = r.serializeForClipboard(u).dom.innerHTML, p =
|
|
1113
|
-
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", f), e.dataTransfer.setData("text/html", h), e.dataTransfer.setData("text/plain", g), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(
|
|
1110
|
+
let t = r.state.selection, i = r.state.doc, { from: o, to: s } = Bt(t, i), c = o <= a && a < s, l = t.$anchor.node() !== t.$head.node() || t instanceof B;
|
|
1111
|
+
c && l ? (r.dispatch(r.state.tr.setSelection(B.create(i, o, s))), Vt(r, o, s)) : (r.dispatch(r.state.tr.setSelection(fe.create(r.state.doc, a))), Vt(r, a));
|
|
1112
|
+
let u = r.state.selection.content(), d = n.pmSchema, f = r.serializeForClipboard(u).dom.innerHTML, p = O(d, n), m = zt(u.content), h = p.exportBlocks(m, {}), g = z(h);
|
|
1113
|
+
e.dataTransfer.clearData(), e.dataTransfer.setData("blocknote/html", f), e.dataTransfer.setData("text/html", h), e.dataTransfer.setData("text/plain", g), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setDragImage(V, 0, 0);
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
1116
|
//#endregion
|
|
1117
1117
|
//#region src/extensions/SideMenu/SideMenu.ts
|
|
1118
|
-
var
|
|
1119
|
-
function
|
|
1118
|
+
var Wt = 250;
|
|
1119
|
+
function H(e, t, n = !0) {
|
|
1120
1120
|
let r = e.root.elementsFromPoint(t.left, t.top);
|
|
1121
|
-
for (let i of r) if (e.dom.contains(i)) return n && i.closest("[data-node-type=columnList]") ?
|
|
1121
|
+
for (let i of r) if (e.dom.contains(i)) return n && i.closest("[data-node-type=columnList]") ? H(e, {
|
|
1122
1122
|
left: t.left + 50,
|
|
1123
1123
|
top: t.top
|
|
1124
1124
|
}, !1) : ft(i, e);
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1126
|
+
function Gt(e, t) {
|
|
1127
1127
|
if (!t.dom.firstChild) return;
|
|
1128
|
-
let n = t.dom.firstChild.getBoundingClientRect(), r =
|
|
1128
|
+
let n = t.dom.firstChild.getBoundingClientRect(), r = H(t, {
|
|
1129
1129
|
left: Math.min(Math.max(n.left + 10, e.x), n.right - 10),
|
|
1130
1130
|
top: e.y
|
|
1131
1131
|
});
|
|
1132
|
-
if (r) return
|
|
1132
|
+
if (r) return H(t, {
|
|
1133
1133
|
left: r.node.getBoundingClientRect().right - 10,
|
|
1134
1134
|
top: e.y
|
|
1135
1135
|
}, !1);
|
|
1136
1136
|
}
|
|
1137
|
-
var
|
|
1137
|
+
var Kt = class {
|
|
1138
1138
|
editor;
|
|
1139
1139
|
pmView;
|
|
1140
1140
|
state;
|
|
@@ -1158,11 +1158,11 @@ var Gt = class {
|
|
|
1158
1158
|
clientX: this.mousePos.x,
|
|
1159
1159
|
clientY: this.mousePos.y
|
|
1160
1160
|
});
|
|
1161
|
-
if (e?.element !== this.pmView.dom || e.distance >
|
|
1161
|
+
if (e?.element !== this.pmView.dom || e.distance > Wt) {
|
|
1162
1162
|
this.state?.show && (this.state.show = !1, this.updateState(this.state));
|
|
1163
1163
|
return;
|
|
1164
1164
|
}
|
|
1165
|
-
let t =
|
|
1165
|
+
let t = Gt(this.mousePos, this.pmView);
|
|
1166
1166
|
if (!t || !this.editor.isEditable) {
|
|
1167
1167
|
this.state?.show && (this.state.show = !1, this.updateState(this.state));
|
|
1168
1168
|
return;
|
|
@@ -1185,9 +1185,9 @@ var Gt = class {
|
|
|
1185
1185
|
if (!t || this.pmView.dragging) return;
|
|
1186
1186
|
let n = document.createElement("div");
|
|
1187
1187
|
n.innerHTML = t;
|
|
1188
|
-
let r =
|
|
1188
|
+
let r = pe.fromSchema(this.pmView.state.schema).parse(n, { topNode: this.pmView.state.schema.nodes.blockGroup.create() });
|
|
1189
1189
|
this.pmView.dragging = {
|
|
1190
|
-
slice: new
|
|
1190
|
+
slice: new me(r.content, 0, 0),
|
|
1191
1191
|
move: !0
|
|
1192
1192
|
};
|
|
1193
1193
|
};
|
|
@@ -1219,7 +1219,7 @@ var Gt = class {
|
|
|
1219
1219
|
getDragEventContext = (e) => {
|
|
1220
1220
|
if (!(this.pmView.dragging !== null || this.isDragOrigin || e.dataTransfer?.types.includes("blocknote/html") || e.target instanceof Node && this.pmView.dom.contains(e.target))) return;
|
|
1221
1221
|
let t = !e.dataTransfer?.types.includes("blocknote/html") && !!this.pmView.dragging, n = !!this.isDragOrigin, r = t || n, i = this.findClosestEditorElement(e);
|
|
1222
|
-
if (!i || i.distance >
|
|
1222
|
+
if (!i || i.distance > Wt) return;
|
|
1223
1223
|
let a = i.element === this.pmView.dom, o = a && i.distance === 0;
|
|
1224
1224
|
if (!(!a && !r)) return {
|
|
1225
1225
|
isDropPoint: a,
|
|
@@ -1237,7 +1237,7 @@ var Gt = class {
|
|
|
1237
1237
|
let { isDropPoint: n, isDropWithinEditorBounds: r, isDragOrigin: i } = t;
|
|
1238
1238
|
if (!r && n && this.dispatchSyntheticEvent(e), n) {
|
|
1239
1239
|
if (this.pmView.dragging) return;
|
|
1240
|
-
this.pmView.dispatch(this.pmView.state.tr.setSelection(
|
|
1240
|
+
this.pmView.dispatch(this.pmView.state.tr.setSelection(Ee.create(this.pmView.state.tr.doc, this.pmView.state.tr.selection.anchor)));
|
|
1241
1241
|
return;
|
|
1242
1242
|
}
|
|
1243
1243
|
if (i) {
|
|
@@ -1252,7 +1252,7 @@ var Gt = class {
|
|
|
1252
1252
|
this.state?.show && this.editor.isFocused() && (this.state.show = !1, this.emitUpdate(this.state));
|
|
1253
1253
|
};
|
|
1254
1254
|
onMouseMove = (e) => {
|
|
1255
|
-
if (this.menuFrozen || !Number.isFinite(e.clientX) || !Number.isFinite(e.clientY)) return;
|
|
1255
|
+
if (this.menuFrozen || !Number.isFinite(e.clientX) || !Number.isFinite(e.clientY) || e.target instanceof Node && !this.pmView.dom.contains(e.target) && this.editor.isWithinEditor(e.target)) return;
|
|
1256
1256
|
this.mousePos = {
|
|
1257
1257
|
x: e.clientX,
|
|
1258
1258
|
y: e.clientY
|
|
@@ -1274,22 +1274,22 @@ var Gt = class {
|
|
|
1274
1274
|
destroy() {
|
|
1275
1275
|
this.state?.show && (this.state.show = !1, this.emitUpdate(this.state)), this.pmView.root.removeEventListener("mousemove", this.onMouseMove, !0), this.pmView.root.removeEventListener("dragstart", this.onDragStart), this.pmView.root.removeEventListener("dragover", this.onDragOver), this.pmView.root.removeEventListener("drop", this.onDrop, !0), this.pmView.root.removeEventListener("dragend", this.onDragEnd, !0), this.pmView.root.removeEventListener("keydown", this.onKeyDown, !0);
|
|
1276
1276
|
}
|
|
1277
|
-
},
|
|
1277
|
+
}, qt = new Te("SideMenuPlugin"), Jt = b(({ editor: e }) => {
|
|
1278
1278
|
let t, n = y(void 0);
|
|
1279
1279
|
return {
|
|
1280
1280
|
key: "sideMenu",
|
|
1281
1281
|
store: n,
|
|
1282
|
-
prosemirrorPlugins: [new
|
|
1283
|
-
key:
|
|
1284
|
-
view: (r) => (t = new
|
|
1282
|
+
prosemirrorPlugins: [new we({
|
|
1283
|
+
key: qt,
|
|
1284
|
+
view: (r) => (t = new Kt(e, r, (e) => {
|
|
1285
1285
|
n.setState({ ...e });
|
|
1286
1286
|
}), t)
|
|
1287
1287
|
})],
|
|
1288
1288
|
blockDragStart(n, r) {
|
|
1289
|
-
t && (t.isDragOrigin = !0),
|
|
1289
|
+
t && (t.isDragOrigin = !0), Ut(n, r, e);
|
|
1290
1290
|
},
|
|
1291
1291
|
blockDragEnd() {
|
|
1292
|
-
|
|
1292
|
+
Ht(e.prosemirrorView.root), t && (t.isDragOrigin = !1), e.blur();
|
|
1293
1293
|
},
|
|
1294
1294
|
get menuFrozen() {
|
|
1295
1295
|
return t.menuFrozen;
|
|
@@ -1304,7 +1304,7 @@ var Gt = class {
|
|
|
1304
1304
|
!t.menuFrozen && t.state?.show && (t.state.show = !1, t.emitUpdate(t.state));
|
|
1305
1305
|
}
|
|
1306
1306
|
};
|
|
1307
|
-
}),
|
|
1307
|
+
}), Yt = b(({ editor: e }) => {
|
|
1308
1308
|
let t = y({
|
|
1309
1309
|
popupOpen: void 0,
|
|
1310
1310
|
selected: void 0
|
|
@@ -1341,7 +1341,7 @@ var Gt = class {
|
|
|
1341
1341
|
let { block: r } = e.getTextCursorPosition();
|
|
1342
1342
|
if (!n(r) || t.state.popupOpen !== r.id) return !1;
|
|
1343
1343
|
let i = e.prosemirrorView, { $from: a } = i.state.selection;
|
|
1344
|
-
return a.parent.type.name === r.type && (i.dispatch(i.state.tr.setSelection(
|
|
1344
|
+
return a.parent.type.name === r.type && (i.dispatch(i.state.tr.setSelection(T.create(i.state.doc, a.start(), a.end()))), !0);
|
|
1345
1345
|
},
|
|
1346
1346
|
ArrowUp: r("prev"),
|
|
1347
1347
|
ArrowLeft: r("prev"),
|
|
@@ -1379,11 +1379,11 @@ var Gt = class {
|
|
|
1379
1379
|
});
|
|
1380
1380
|
}
|
|
1381
1381
|
};
|
|
1382
|
-
}),
|
|
1382
|
+
}), Xt = b(({ editor: e }) => {
|
|
1383
1383
|
let t = y({ selected: void 0 }), n = (t) => !!e.schema.inlineContentSpecs[t]?.implementation?.meta?.hasPreview, r = (e) => ({ editor: t }) => {
|
|
1384
1384
|
let { $from: r } = t.prosemirrorState.selection, i = r.node();
|
|
1385
1385
|
if (!n(i.type.name)) return !1;
|
|
1386
|
-
let a = t.prosemirrorView, o =
|
|
1386
|
+
let a = t.prosemirrorView, o = w.near(a.state.doc.resolve(e === "before" ? r.before() : r.after()), e === "before" ? -1 : 1);
|
|
1387
1387
|
return a.dispatch(a.state.tr.setSelection(o)), !0;
|
|
1388
1388
|
};
|
|
1389
1389
|
return {
|
|
@@ -1399,7 +1399,7 @@ var Gt = class {
|
|
|
1399
1399
|
let { $from: t } = e.prosemirrorState.selection;
|
|
1400
1400
|
if (!n(t.node().type.name)) return !1;
|
|
1401
1401
|
let r = e.prosemirrorView;
|
|
1402
|
-
return r.dispatch(r.state.tr.setSelection(
|
|
1402
|
+
return r.dispatch(r.state.tr.setSelection(T.create(r.state.doc, t.start(), t.end()))), !0;
|
|
1403
1403
|
}
|
|
1404
1404
|
},
|
|
1405
1405
|
mount: ({ dom: r, signal: i }) => {
|
|
@@ -1420,22 +1420,22 @@ var Gt = class {
|
|
|
1420
1420
|
});
|
|
1421
1421
|
}
|
|
1422
1422
|
};
|
|
1423
|
-
}),
|
|
1423
|
+
}), Zt = Symbol.for("blocknote.shikiParser"), U = Symbol.for("blocknote.shikiHighlighterPromise"), Qt = [
|
|
1424
1424
|
"text",
|
|
1425
1425
|
"none",
|
|
1426
1426
|
"plaintext",
|
|
1427
1427
|
"txt"
|
|
1428
1428
|
];
|
|
1429
|
-
function
|
|
1429
|
+
function $t(e, t, n) {
|
|
1430
1430
|
let r = globalThis, i, a, o = /* @__PURE__ */ new Set();
|
|
1431
|
-
return
|
|
1431
|
+
return je({
|
|
1432
1432
|
parser: (t) => {
|
|
1433
1433
|
if (!e.createHighlighter) return [];
|
|
1434
|
-
if (!i) return r[
|
|
1434
|
+
if (!i) return r[U] = r[U] || e.createHighlighter(), r[U].then((e) => {
|
|
1435
1435
|
i = e;
|
|
1436
1436
|
});
|
|
1437
1437
|
let n = t.language;
|
|
1438
|
-
return !n ||
|
|
1438
|
+
return !n || Qt.includes(n) || o.has(n) ? [] : i.getLoadedLanguages().includes(n) ? (a || (a = r[Zt] || Me(i, en(i)), r[Zt] = a), a(t)) : i.loadLanguage(n).catch(() => {
|
|
1439
1439
|
o.add(n);
|
|
1440
1440
|
});
|
|
1441
1441
|
},
|
|
@@ -1449,7 +1449,7 @@ function Qt(e, t, n) {
|
|
|
1449
1449
|
nodeTypes: t
|
|
1450
1450
|
});
|
|
1451
1451
|
}
|
|
1452
|
-
function
|
|
1452
|
+
function en(e) {
|
|
1453
1453
|
let t = e.getLoadedThemes(), n = t.find((e) => /light/i.test(e)), r = t.find((e) => /dark/i.test(e));
|
|
1454
1454
|
if (n && r) return {
|
|
1455
1455
|
themes: {
|
|
@@ -1461,26 +1461,26 @@ function $t(e) {
|
|
|
1461
1461
|
}
|
|
1462
1462
|
//#endregion
|
|
1463
1463
|
//#region src/extensions/SyntaxHighlighting/SyntaxHighlighting.ts
|
|
1464
|
-
function
|
|
1464
|
+
function tn(e) {
|
|
1465
1465
|
let t = Object.values(e.blockSpecs).filter((e) => typeof e?.config == "object" && e.config.content === "plain" && !!e.implementation?.meta?.highlight).map((e) => e.config.type), n = Object.values(e.inlineContentSpecs).filter((e) => typeof e?.config == "object" && e.config.content === "plain" && !!e.implementation?.meta?.highlight).map((e) => e.config.type);
|
|
1466
1466
|
return [...t, ...n];
|
|
1467
1467
|
}
|
|
1468
|
-
var
|
|
1468
|
+
var nn = b(({ editor: e, options: t }) => ({
|
|
1469
1469
|
key: "syntaxHighlighting",
|
|
1470
|
-
prosemirrorPlugins: [
|
|
1471
|
-
})),
|
|
1472
|
-
async function
|
|
1473
|
-
return
|
|
1470
|
+
prosemirrorPlugins: [$t(t, tn(e.schema), e.schema)]
|
|
1471
|
+
})), W;
|
|
1472
|
+
async function rn() {
|
|
1473
|
+
return W || (W = (async () => {
|
|
1474
1474
|
let [e, t] = await Promise.all([import("emoji-mart"), import("@emoji-mart/data")]), n = "default" in e ? e.default : e, r = "default" in t ? t.default : t;
|
|
1475
1475
|
return await n.init({ data: r }), {
|
|
1476
1476
|
emojiMart: n,
|
|
1477
1477
|
emojiData: r
|
|
1478
1478
|
};
|
|
1479
|
-
})(),
|
|
1479
|
+
})(), W);
|
|
1480
1480
|
}
|
|
1481
|
-
async function
|
|
1482
|
-
if (!("text" in e.schema.inlineContentSchema) || e.schema.inlineContentSchema.text !==
|
|
1483
|
-
let { emojiData: n, emojiMart: r } = await
|
|
1481
|
+
async function an(e, t) {
|
|
1482
|
+
if (!("text" in e.schema.inlineContentSchema) || e.schema.inlineContentSchema.text !== ee.text) return [];
|
|
1483
|
+
let { emojiData: n, emojiMart: r } = await rn();
|
|
1484
1484
|
return (t.trim() === "" ? Object.values(n.emojis) : await r.SearchIndex.search(t)).map((t) => ({
|
|
1485
1485
|
id: t.skins[0].native,
|
|
1486
1486
|
onItemClick: () => e.insertInlineContent(t.skins[0].native + " ")
|
|
@@ -1488,12 +1488,12 @@ async function rn(e, t) {
|
|
|
1488
1488
|
}
|
|
1489
1489
|
//#endregion
|
|
1490
1490
|
//#region src/extensions/TableHandles/TableHandles.ts
|
|
1491
|
-
var
|
|
1492
|
-
function
|
|
1493
|
-
|
|
1491
|
+
var G;
|
|
1492
|
+
function K(e) {
|
|
1493
|
+
G || (G = document.createElement("div"), G.innerHTML = "_", G.style.opacity = "0", G.style.height = "1px", G.style.width = "1px", e instanceof Document ? e.body.appendChild(G) : e.appendChild(G));
|
|
1494
1494
|
}
|
|
1495
1495
|
function on(e) {
|
|
1496
|
-
|
|
1496
|
+
G &&= (e instanceof Document ? e.body.removeChild(G) : e.removeChild(G), void 0);
|
|
1497
1497
|
}
|
|
1498
1498
|
function q(e) {
|
|
1499
1499
|
return Array.prototype.indexOf.call(e.parentElement.childNodes, e);
|
|
@@ -1560,19 +1560,19 @@ var ln = class {
|
|
|
1560
1560
|
let n = t.tbodyNode.getBoundingClientRect(), r = ft(t.domNode, this.pmView);
|
|
1561
1561
|
if (!r) return;
|
|
1562
1562
|
let { pmNodeInfo: i, doc: a } = this.editor.transact((e) => ({
|
|
1563
|
-
pmNodeInfo:
|
|
1563
|
+
pmNodeInfo: o(r.id, e.doc),
|
|
1564
1564
|
doc: e.doc
|
|
1565
1565
|
}));
|
|
1566
1566
|
if (!i) {
|
|
1567
1567
|
this.hideHandles();
|
|
1568
1568
|
return;
|
|
1569
1569
|
}
|
|
1570
|
-
let
|
|
1571
|
-
if (!
|
|
1570
|
+
let s = v(i.node, a);
|
|
1571
|
+
if (!h(s, this.editor, "table")) {
|
|
1572
1572
|
this.hideHandles();
|
|
1573
1573
|
return;
|
|
1574
1574
|
}
|
|
1575
|
-
let c =
|
|
1575
|
+
let c = s;
|
|
1576
1576
|
this.tablePos = i.posBeforeNode + 1, this.tableElement = r.node, this.tableId = r.id;
|
|
1577
1577
|
let l = t.domNode.closest(".tableWrapper")?.querySelector(".table-widgets-container");
|
|
1578
1578
|
if (t?.type === "wrapper") {
|
|
@@ -1624,12 +1624,12 @@ var ln = class {
|
|
|
1624
1624
|
if (this.mouseState = "up", this.state === void 0 || this.state.draggingState === void 0) return !1;
|
|
1625
1625
|
if (this.state.rowIndex === void 0 || this.state.colIndex === void 0) throw Error("Attempted to drop table row or column, but no table block was hovered prior.");
|
|
1626
1626
|
t.preventDefault();
|
|
1627
|
-
let { draggingState: n, colIndex: r, rowIndex:
|
|
1627
|
+
let { draggingState: n, colIndex: r, rowIndex: a } = this.state;
|
|
1628
1628
|
this.state.draggingState = void 0;
|
|
1629
1629
|
let o = this.state.block.content.columnWidths;
|
|
1630
1630
|
if (n.draggedCellOrientation === "row") {
|
|
1631
|
-
if (!
|
|
1632
|
-
let e =
|
|
1631
|
+
if (!d(this.state.block, n.originalIndex, a)) return !1;
|
|
1632
|
+
let e = g(this.state.block, n.originalIndex, a);
|
|
1633
1633
|
this.editor.updateBlock(this.state.block, {
|
|
1634
1634
|
type: "table",
|
|
1635
1635
|
content: {
|
|
@@ -1639,8 +1639,8 @@ var ln = class {
|
|
|
1639
1639
|
});
|
|
1640
1640
|
} else {
|
|
1641
1641
|
if (!e(this.state.block, n.originalIndex, r)) return !1;
|
|
1642
|
-
let t =
|
|
1643
|
-
o.splice(r, 0,
|
|
1642
|
+
let t = i(this.state.block, n.originalIndex, r), [a] = o.splice(n.originalIndex, 1);
|
|
1643
|
+
o.splice(r, 0, a), this.editor.updateBlock(this.state.block, {
|
|
1644
1644
|
type: "table",
|
|
1645
1645
|
content: {
|
|
1646
1646
|
...this.state.block.content,
|
|
@@ -1653,7 +1653,7 @@ var ln = class {
|
|
|
1653
1653
|
};
|
|
1654
1654
|
getTablePos(e) {
|
|
1655
1655
|
if (this.tableId === void 0) return;
|
|
1656
|
-
let t =
|
|
1656
|
+
let t = o(this.tableId, e);
|
|
1657
1657
|
return t && t.posBeforeNode + 1;
|
|
1658
1658
|
}
|
|
1659
1659
|
update() {
|
|
@@ -1677,94 +1677,94 @@ var ln = class {
|
|
|
1677
1677
|
destroy() {
|
|
1678
1678
|
this.pmView.dom.removeEventListener("mousemove", this.mouseMoveHandler), window.removeEventListener("mouseup", this.mouseUpHandler), this.pmView.dom.removeEventListener("mousedown", this.viewMousedownHandler), this.pmView.root.removeEventListener("dragover", this.dragOverHandler), this.pmView.root.removeEventListener("drop", this.dropHandler);
|
|
1679
1679
|
}
|
|
1680
|
-
}, J = new
|
|
1681
|
-
let
|
|
1680
|
+
}, J = new C("TableHandlesPlugin"), un = b(({ editor: t }) => {
|
|
1681
|
+
let r, i = y(void 0);
|
|
1682
1682
|
return {
|
|
1683
1683
|
key: "tableHandles",
|
|
1684
1684
|
store: i,
|
|
1685
|
-
prosemirrorPlugins: [new
|
|
1685
|
+
prosemirrorPlugins: [new S({
|
|
1686
1686
|
key: J,
|
|
1687
|
-
view: (e) => (
|
|
1687
|
+
view: (e) => (r = new ln(t, e, (e) => {
|
|
1688
1688
|
i.setState(e?.block ? {
|
|
1689
1689
|
...e,
|
|
1690
1690
|
draggingState: e.draggingState ? { ...e.draggingState } : void 0
|
|
1691
1691
|
} : void 0);
|
|
1692
|
-
}),
|
|
1692
|
+
}), r),
|
|
1693
1693
|
props: { decorations: (t) => {
|
|
1694
|
-
if (
|
|
1695
|
-
let
|
|
1696
|
-
if (
|
|
1697
|
-
let i =
|
|
1694
|
+
if (r === void 0 || r.state === void 0 || r.state.draggingState === void 0) return;
|
|
1695
|
+
let n = r.getTablePos(t.doc);
|
|
1696
|
+
if (n === void 0) return;
|
|
1697
|
+
let i = r.state.draggingState.draggedCellOrientation === "row" ? r.state.rowIndex : r.state.colIndex;
|
|
1698
1698
|
if (i === void 0) return;
|
|
1699
|
-
let a = [], { block: o, draggingState: s } =
|
|
1700
|
-
if (i === c || !o || l === "row" && !
|
|
1701
|
-
let
|
|
1702
|
-
return
|
|
1703
|
-
let r = t.doc.resolve(
|
|
1704
|
-
a.push(
|
|
1699
|
+
let a = [], { block: o, draggingState: s } = r.state, { originalIndex: c, draggedCellOrientation: l } = s;
|
|
1700
|
+
if (i === c || !o || l === "row" && !d(o, c, i) || l === "col" && !e(o, c, i)) return D.create(t.doc, a);
|
|
1701
|
+
let f = t.doc.resolve(n + 1);
|
|
1702
|
+
return r.state.draggingState.draggedCellOrientation === "row" ? p(r.state.block, i).forEach(({ row: e, col: n }) => {
|
|
1703
|
+
let r = t.doc.resolve(f.posAtIndex(e) + 1), o = t.doc.resolve(r.posAtIndex(n) + 1), s = o.node(), l = o.pos + (i > c ? s.nodeSize - 2 : 0);
|
|
1704
|
+
a.push(E.widget(l, () => {
|
|
1705
1705
|
let e = document.createElement("div");
|
|
1706
1706
|
return e.className = "bn-table-drop-cursor", e.style.left = "0", e.style.right = "0", i > c ? e.style.bottom = "-2px" : e.style.top = "-3px", e.style.height = "4px", e;
|
|
1707
1707
|
}));
|
|
1708
|
-
}) :
|
|
1709
|
-
let r = t.doc.resolve(
|
|
1710
|
-
a.push(
|
|
1708
|
+
}) : u(r.state.block, i).forEach(({ row: e, col: n }) => {
|
|
1709
|
+
let r = t.doc.resolve(f.posAtIndex(e) + 1), o = t.doc.resolve(r.posAtIndex(n) + 1), s = o.node(), l = o.pos + (i > c ? s.nodeSize - 2 : 0);
|
|
1710
|
+
a.push(E.widget(l, () => {
|
|
1711
1711
|
let e = document.createElement("div");
|
|
1712
1712
|
return e.className = "bn-table-drop-cursor", e.style.top = "0", e.style.bottom = "0", i > c ? e.style.right = "-2px" : e.style.left = "-3px", e.style.width = "4px", e;
|
|
1713
1713
|
}));
|
|
1714
|
-
}),
|
|
1714
|
+
}), D.create(t.doc, a);
|
|
1715
1715
|
} }
|
|
1716
1716
|
})],
|
|
1717
1717
|
colDragStart(e) {
|
|
1718
|
-
if (
|
|
1719
|
-
|
|
1718
|
+
if (r === void 0 || r.state === void 0 || r.state.colIndex === void 0) throw Error("Attempted to drag table column, but no table block was hovered prior.");
|
|
1719
|
+
r.state.draggingState = {
|
|
1720
1720
|
draggedCellOrientation: "col",
|
|
1721
|
-
originalIndex:
|
|
1721
|
+
originalIndex: r.state.colIndex,
|
|
1722
1722
|
mousePos: e.clientX
|
|
1723
|
-
},
|
|
1724
|
-
draggedCellOrientation:
|
|
1725
|
-
originalIndex:
|
|
1726
|
-
newIndex:
|
|
1727
|
-
tablePos:
|
|
1728
|
-
})), !t.headless && (
|
|
1723
|
+
}, r.emitUpdate(), t.transact((e) => e.setMeta(J, {
|
|
1724
|
+
draggedCellOrientation: r.state.draggingState.draggedCellOrientation,
|
|
1725
|
+
originalIndex: r.state.colIndex,
|
|
1726
|
+
newIndex: r.state.colIndex,
|
|
1727
|
+
tablePos: r.tablePos
|
|
1728
|
+
})), !t.headless && (K(t.prosemirrorView.root), e.dataTransfer.setDragImage(G, 0, 0), e.dataTransfer.effectAllowed = "move");
|
|
1729
1729
|
},
|
|
1730
1730
|
rowDragStart(e) {
|
|
1731
|
-
if (
|
|
1732
|
-
|
|
1731
|
+
if (r.state === void 0 || r.state.rowIndex === void 0) throw Error("Attempted to drag table row, but no table block was hovered prior.");
|
|
1732
|
+
r.state.draggingState = {
|
|
1733
1733
|
draggedCellOrientation: "row",
|
|
1734
|
-
originalIndex:
|
|
1734
|
+
originalIndex: r.state.rowIndex,
|
|
1735
1735
|
mousePos: e.clientY
|
|
1736
|
-
},
|
|
1737
|
-
draggedCellOrientation:
|
|
1738
|
-
originalIndex:
|
|
1739
|
-
newIndex:
|
|
1740
|
-
tablePos:
|
|
1741
|
-
})), !t.headless && (
|
|
1736
|
+
}, r.emitUpdate(), t.transact((e) => e.setMeta(J, {
|
|
1737
|
+
draggedCellOrientation: r.state.draggingState.draggedCellOrientation,
|
|
1738
|
+
originalIndex: r.state.rowIndex,
|
|
1739
|
+
newIndex: r.state.rowIndex,
|
|
1740
|
+
tablePos: r.tablePos
|
|
1741
|
+
})), !t.headless && (K(t.prosemirrorView.root), e.dataTransfer.setDragImage(G, 0, 0), e.dataTransfer.effectAllowed = "copyMove");
|
|
1742
1742
|
},
|
|
1743
1743
|
dragEnd() {
|
|
1744
|
-
if (
|
|
1745
|
-
|
|
1744
|
+
if (r.state === void 0) throw Error("Attempted to drag table row, but no table block was hovered prior.");
|
|
1745
|
+
r.state.draggingState = void 0, r.emitUpdate(), t.transact((e) => e.setMeta(J, null)), !t.headless && on(t.prosemirrorView.root);
|
|
1746
1746
|
},
|
|
1747
1747
|
freezeHandles() {
|
|
1748
|
-
|
|
1748
|
+
r.menuFrozen = !0;
|
|
1749
1749
|
},
|
|
1750
1750
|
unfreezeHandles() {
|
|
1751
|
-
|
|
1751
|
+
r.menuFrozen = !1;
|
|
1752
1752
|
},
|
|
1753
1753
|
hideHandlesIfNotFrozen() {
|
|
1754
|
-
|
|
1754
|
+
r.menuFrozen || r.hideHandles();
|
|
1755
1755
|
},
|
|
1756
1756
|
getCellsAtRowHandle(e, t) {
|
|
1757
1757
|
return p(e, t);
|
|
1758
1758
|
},
|
|
1759
1759
|
getCellsAtColumnHandle(e, t) {
|
|
1760
|
-
return
|
|
1760
|
+
return u(e, t);
|
|
1761
1761
|
},
|
|
1762
|
-
setCellSelection(e, t,
|
|
1763
|
-
if (!
|
|
1764
|
-
let i =
|
|
1762
|
+
setCellSelection(e, t, n = t) {
|
|
1763
|
+
if (!r) throw Error("Table handles view not initialized");
|
|
1764
|
+
let i = r.getTablePos(e.doc);
|
|
1765
1765
|
if (i === void 0) throw Error("Attempted to select table cells, but the hovered table is no longer in the document.");
|
|
1766
|
-
let a = e.doc.resolve(i + 1), o = e.doc.resolve(a.posAtIndex(t.row) + 1), s = e.doc.resolve(o.posAtIndex(t.col)), c = e.doc.resolve(a.posAtIndex(
|
|
1767
|
-
return u.setSelection(new
|
|
1766
|
+
let a = e.doc.resolve(i + 1), o = e.doc.resolve(a.posAtIndex(t.row) + 1), s = e.doc.resolve(o.posAtIndex(t.col)), c = e.doc.resolve(a.posAtIndex(n.row) + 1), l = e.doc.resolve(c.posAtIndex(n.col)), u = e.tr;
|
|
1767
|
+
return u.setSelection(new he(s, l)), e.apply(u);
|
|
1768
1768
|
},
|
|
1769
1769
|
addRowOrColumn(e, n) {
|
|
1770
1770
|
t.exec((t, r) => {
|
|
@@ -1775,7 +1775,7 @@ var ln = class {
|
|
|
1775
1775
|
row: 0,
|
|
1776
1776
|
col: e
|
|
1777
1777
|
});
|
|
1778
|
-
return n.orientation === "row" ? n.side === "above" ?
|
|
1778
|
+
return n.orientation === "row" ? n.side === "above" ? ye(i, r) : ve(i, r) : n.side === "left" ? _e(i, r) : ge(i, r);
|
|
1779
1779
|
});
|
|
1780
1780
|
},
|
|
1781
1781
|
removeRowOrColumn(e, n) {
|
|
@@ -1784,31 +1784,31 @@ var ln = class {
|
|
|
1784
1784
|
row: e,
|
|
1785
1785
|
col: 0
|
|
1786
1786
|
});
|
|
1787
|
-
return
|
|
1787
|
+
return xe(r, n);
|
|
1788
1788
|
}) : t.exec((t, n) => {
|
|
1789
1789
|
let r = this.setCellSelection(t, {
|
|
1790
1790
|
row: 0,
|
|
1791
1791
|
col: e
|
|
1792
1792
|
});
|
|
1793
|
-
return
|
|
1793
|
+
return be(r, n);
|
|
1794
1794
|
});
|
|
1795
1795
|
},
|
|
1796
1796
|
mergeCells(e) {
|
|
1797
1797
|
return t.exec((t, n) => {
|
|
1798
1798
|
let r = e ? this.setCellSelection(t, e.relativeStartCell, e.relativeEndCell) : t;
|
|
1799
|
-
return
|
|
1799
|
+
return Se(r, n);
|
|
1800
1800
|
});
|
|
1801
1801
|
},
|
|
1802
1802
|
splitCell(e) {
|
|
1803
1803
|
return t.exec((t, n) => {
|
|
1804
1804
|
let r = e ? this.setCellSelection(t, e) : t;
|
|
1805
|
-
return
|
|
1805
|
+
return Ce(r, n);
|
|
1806
1806
|
});
|
|
1807
1807
|
},
|
|
1808
1808
|
getCellSelection() {
|
|
1809
1809
|
return t.transact((e) => {
|
|
1810
1810
|
let t = e.selection, n = t.$from, r = t.$to;
|
|
1811
|
-
if (
|
|
1811
|
+
if (te(t)) {
|
|
1812
1812
|
let { ranges: e } = t;
|
|
1813
1813
|
e.forEach((e) => {
|
|
1814
1814
|
n = e.$from.min(n ?? e.$from), r = e.$to.max(r ?? e.$to);
|
|
@@ -1837,20 +1837,20 @@ var ln = class {
|
|
|
1837
1837
|
},
|
|
1838
1838
|
getMergeDirection(e) {
|
|
1839
1839
|
return t.transact((t) => {
|
|
1840
|
-
let n =
|
|
1840
|
+
let n = te(t.selection) ? t.selection : void 0;
|
|
1841
1841
|
if (!n || !e || n.ranges.length <= 1) return;
|
|
1842
1842
|
let r = this.getCellSelection();
|
|
1843
1843
|
if (r) return ne(r.from, r.to, e) ? "vertical" : "horizontal";
|
|
1844
1844
|
});
|
|
1845
1845
|
},
|
|
1846
1846
|
cropEmptyRowsOrColumns(e, t) {
|
|
1847
|
-
return
|
|
1847
|
+
return n(e, t);
|
|
1848
1848
|
},
|
|
1849
1849
|
addRowsOrColumns(e, t, n) {
|
|
1850
|
-
return
|
|
1850
|
+
return c(e, t, n);
|
|
1851
1851
|
}
|
|
1852
1852
|
};
|
|
1853
|
-
}), Y = new
|
|
1853
|
+
}), Y = new C("trailingNode");
|
|
1854
1854
|
function X(e) {
|
|
1855
1855
|
let t = e.lastChild, n = t?.firstChild;
|
|
1856
1856
|
return t?.type.name !== "blockContainer" || n?.type.name !== "paragraph" || n.content.size !== 0;
|
|
@@ -1865,7 +1865,7 @@ function dn(e) {
|
|
|
1865
1865
|
}
|
|
1866
1866
|
var fn = b(({ editor: e }) => {
|
|
1867
1867
|
function t(t) {
|
|
1868
|
-
return
|
|
1868
|
+
return E.widget(t, () => {
|
|
1869
1869
|
let t = document.createElement("div");
|
|
1870
1870
|
return t.className = "bn-trailing-block", t.contentEditable = "false", t.addEventListener("mousedown", (n) => {
|
|
1871
1871
|
n.preventDefault();
|
|
@@ -1887,10 +1887,10 @@ var fn = b(({ editor: e }) => {
|
|
|
1887
1887
|
}
|
|
1888
1888
|
return {
|
|
1889
1889
|
key: "trailingNode",
|
|
1890
|
-
prosemirrorPlugins: [new
|
|
1890
|
+
prosemirrorPlugins: [new S({
|
|
1891
1891
|
key: Y,
|
|
1892
1892
|
state: {
|
|
1893
|
-
init: (t, r) => n(r.tr,
|
|
1893
|
+
init: (t, r) => n(r.tr, D.empty, e.isEditable),
|
|
1894
1894
|
apply: (t, r) => !t.docChanged && !t.getMeta(Y) ? r : n(t, r, e.isEditable)
|
|
1895
1895
|
},
|
|
1896
1896
|
view(e) {
|
|
@@ -1905,7 +1905,7 @@ var fn = b(({ editor: e }) => {
|
|
|
1905
1905
|
if (n.key !== "ArrowRight" && n.key !== "ArrowDown") return !1;
|
|
1906
1906
|
let { selection: r } = t.state;
|
|
1907
1907
|
if (!r.empty) return !1;
|
|
1908
|
-
let i =
|
|
1908
|
+
let i = w.atEnd(t.state.doc);
|
|
1909
1909
|
if (r.$head.pos !== i.$head.pos) return !1;
|
|
1910
1910
|
let a = t.state.doc.lastChild;
|
|
1911
1911
|
return !e.isEditable || !a || !X(a) ? !1 : (n.preventDefault(), !0);
|
|
@@ -2133,6 +2133,6 @@ function _n(e) {
|
|
|
2133
2133
|
};
|
|
2134
2134
|
}
|
|
2135
2135
|
//#endregion
|
|
2136
|
-
export { Ze as A, ct as C, nt as D, rt as E,
|
|
2136
|
+
export { Ze as A, ct as C, nt as D, rt as E, O as F, Xe as M, Ue as N, tt as O, He as P, dt as S, at as T, Kt as _, pn as a, Rt as b, un as c, an as d, nn as f, Jt as g, Yt as h, Z as i, Ye as j, et as k, ln as l, Xt as m, _n as n, Q as o, tn as p, gn as r, fn as s, hn as t, J as u, qt as v, st as w, z as x, zt as y };
|
|
2137
2137
|
|
|
2138
|
-
//# sourceMappingURL=extensions-
|
|
2138
|
+
//# sourceMappingURL=extensions-B1JQURVF.js.map
|