reactjs-tiptap-editor 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.cts +93 -40
- package/lib/index.d.ts +93 -40
- package/lib/locales-DGuGIThE.cjs +1 -0
- package/lib/{locales-Bhf4s7qu.js → locales-Q7lP5hGr.js} +12 -8
- package/lib/reactjs-tiptap-editor.cjs +1 -1
- package/lib/reactjs-tiptap-editor.js +25 -24
- package/lib/style.css +1 -1
- package/lib/{tiptap-CRe0XXRC.cjs → tiptap-BS6QuLRv.cjs} +12 -12
- package/lib/{tiptap-DDFwn3BG.js → tiptap-jB0nHg9c.js} +289 -276
- package/lib/utils-NHDj1Qz8.cjs +152 -0
- package/lib/{utils-BruH7AB4.js → utils-fG0reqOH.js} +2155 -1974
- package/package.json +2 -1
- package/lib/locales-PeLfQTj6.cjs +0 -1
- package/lib/utils-CbCqz5yx.cjs +0 -152
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var st = (e, t, n) =>
|
|
1
|
+
var nn = Object.defineProperty;
|
|
2
|
+
var rn = (e, t, n) => t in e ? nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var st = (e, t, n) => rn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import Le from "tippy.js";
|
|
5
|
-
import { P as H, a as _, N as tt, S as W, f as
|
|
6
|
-
import L, { forwardRef as
|
|
7
|
-
import
|
|
5
|
+
import { P as H, a as _, N as tt, S as W, f as sn, c as Wt, T as on, l as an, b as ln, d as I, e as cn, g as dn, j as un, h as pn, i as hn, k as fn, m as Re, n as mn, o as gn, p as yn, q as vn, r as bn, s as Mn, t as Sn, u as kn, v as wn, w as En, x as Tn, y as ne, z as Cn, A as dt, F as ut, B as xn, C as An, D as On, E as Ln, G as Rn, H as Pn, I as Pe, J as xt, R as Hn, K as _n, L as $n, M as In, O as Dn, Q as Nn, U as Bn, V as re, W as He, X as jn, Y as Fn, Z as zn, _ as Wn, $ as Vn, a0 as Kn, a1 as ht, a2 as Vt, a3 as qn, a4 as Un, a5 as Gn, a6 as Jn, a7 as Yn, a8 as Xn, a9 as Qn, aa as Zn, ab as se, ac as oe, ad as ie, ae as tr, af as er, ag as ae, ah as nr, ai as _e, aj as rr, ak as sr } from "./vendor-wdh2A0rt.js";
|
|
6
|
+
import L, { forwardRef as or, createContext as $e, useState as Kt, useEffect as qt, useRef as ir, useDebugValue as Ie, useContext as De } from "react";
|
|
7
|
+
import ar, { flushSync as lr } from "react-dom";
|
|
8
8
|
function yt(e) {
|
|
9
9
|
const { state: t, transaction: n } = e;
|
|
10
10
|
let { selection: r } = n, { doc: s } = n, { storedMarks: o } = n;
|
|
@@ -90,7 +90,7 @@ class vt {
|
|
|
90
90
|
return a;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
class
|
|
93
|
+
class cr {
|
|
94
94
|
constructor() {
|
|
95
95
|
this.callbacks = {};
|
|
96
96
|
}
|
|
@@ -218,13 +218,13 @@ function ft(e, t) {
|
|
|
218
218
|
function Be(e) {
|
|
219
219
|
return typeof e == "function";
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function T(e, t = void 0, ...n) {
|
|
222
222
|
return Be(e) ? t ? e.bind(t)(...n) : e(...n) : e;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function dr(e = {}) {
|
|
225
225
|
return Object.keys(e).length === 0 && e.constructor === Object;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function ur(e) {
|
|
228
228
|
return typeof e != "string" ? e : e.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(e) : e === "true" ? !0 : e === "false" ? !1 : e;
|
|
229
229
|
}
|
|
230
230
|
function le(e, t) {
|
|
@@ -235,7 +235,7 @@ function le(e, t) {
|
|
|
235
235
|
if (r === !1)
|
|
236
236
|
return !1;
|
|
237
237
|
const s = t.reduce((o, i) => {
|
|
238
|
-
const a = i.attribute.parseHTML ? i.attribute.parseHTML(n) :
|
|
238
|
+
const a = i.attribute.parseHTML ? i.attribute.parseHTML(n) : ur(n.getAttribute(i.name));
|
|
239
239
|
return a == null ? o : {
|
|
240
240
|
...o,
|
|
241
241
|
[i.name]: a
|
|
@@ -248,10 +248,10 @@ function le(e, t) {
|
|
|
248
248
|
function ce(e) {
|
|
249
249
|
return Object.fromEntries(
|
|
250
250
|
// @ts-ignore
|
|
251
|
-
Object.entries(e).filter(([t, n]) => t === "attrs" &&
|
|
251
|
+
Object.entries(e).filter(([t, n]) => t === "attrs" && dr(n) ? !1 : n != null)
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function pr(e, t) {
|
|
255
255
|
var n;
|
|
256
256
|
const r = Ne(e), { nodeExtensions: s, markExtensions: o } = bt(e), i = (n = s.find((l) => S(l, "topNode"))) === null || n === void 0 ? void 0 : n.name, a = Object.fromEntries(s.map((l) => {
|
|
257
257
|
const u = r.filter((y) => y.type === l.name), d = {
|
|
@@ -267,22 +267,22 @@ function ur(e, t) {
|
|
|
267
267
|
};
|
|
268
268
|
}, {}), h = ce({
|
|
269
269
|
...p,
|
|
270
|
-
content:
|
|
271
|
-
marks:
|
|
272
|
-
group:
|
|
273
|
-
inline:
|
|
274
|
-
atom:
|
|
275
|
-
selectable:
|
|
276
|
-
draggable:
|
|
277
|
-
code:
|
|
278
|
-
whitespace:
|
|
279
|
-
defining:
|
|
280
|
-
isolating:
|
|
270
|
+
content: T(S(l, "content", d)),
|
|
271
|
+
marks: T(S(l, "marks", d)),
|
|
272
|
+
group: T(S(l, "group", d)),
|
|
273
|
+
inline: T(S(l, "inline", d)),
|
|
274
|
+
atom: T(S(l, "atom", d)),
|
|
275
|
+
selectable: T(S(l, "selectable", d)),
|
|
276
|
+
draggable: T(S(l, "draggable", d)),
|
|
277
|
+
code: T(S(l, "code", d)),
|
|
278
|
+
whitespace: T(S(l, "whitespace", d)),
|
|
279
|
+
defining: T(S(l, "defining", d)),
|
|
280
|
+
isolating: T(S(l, "isolating", d)),
|
|
281
281
|
attrs: Object.fromEntries(u.map((y) => {
|
|
282
282
|
var k;
|
|
283
283
|
return [y.name, { default: (k = y == null ? void 0 : y.attribute) === null || k === void 0 ? void 0 : k.default }];
|
|
284
284
|
}))
|
|
285
|
-
}), f =
|
|
285
|
+
}), f = T(S(l, "parseHTML", d));
|
|
286
286
|
f && (h.parseDOM = f.map((y) => le(y, u)));
|
|
287
287
|
const m = S(l, "renderHTML", d);
|
|
288
288
|
m && (h.toDOM = (y) => m({
|
|
@@ -305,16 +305,16 @@ function ur(e, t) {
|
|
|
305
305
|
};
|
|
306
306
|
}, {}), h = ce({
|
|
307
307
|
...p,
|
|
308
|
-
inclusive:
|
|
309
|
-
excludes:
|
|
310
|
-
group:
|
|
311
|
-
spanning:
|
|
312
|
-
code:
|
|
308
|
+
inclusive: T(S(l, "inclusive", d)),
|
|
309
|
+
excludes: T(S(l, "excludes", d)),
|
|
310
|
+
group: T(S(l, "group", d)),
|
|
311
|
+
spanning: T(S(l, "spanning", d)),
|
|
312
|
+
code: T(S(l, "code", d)),
|
|
313
313
|
attrs: Object.fromEntries(u.map((g) => {
|
|
314
314
|
var y;
|
|
315
315
|
return [g.name, { default: (y = g == null ? void 0 : g.attribute) === null || y === void 0 ? void 0 : y.default }];
|
|
316
316
|
}))
|
|
317
|
-
}), f =
|
|
317
|
+
}), f = T(S(l, "parseHTML", d));
|
|
318
318
|
f && (h.parseDOM = f.map((g) => le(g, u)));
|
|
319
319
|
const m = S(l, "renderHTML", d);
|
|
320
320
|
return m && (h.toDOM = (g) => m({
|
|
@@ -334,7 +334,7 @@ function At(e, t) {
|
|
|
334
334
|
function de(e, t) {
|
|
335
335
|
return Array.isArray(t) ? t.some((n) => (typeof n == "string" ? n : n.name) === e.name) : t;
|
|
336
336
|
}
|
|
337
|
-
const
|
|
337
|
+
const hr = (e, t = 500) => {
|
|
338
338
|
let n = "";
|
|
339
339
|
const r = e.parentOffset;
|
|
340
340
|
return e.parent.nodesBetween(Math.max(0, r - t), r, (s, o, i, a) => {
|
|
@@ -356,7 +356,7 @@ class Mt {
|
|
|
356
356
|
this.find = t.find, this.handler = t.handler;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
const
|
|
359
|
+
const fr = (e, t) => {
|
|
360
360
|
if (Ut(t))
|
|
361
361
|
return t.exec(e);
|
|
362
362
|
const n = t(e);
|
|
@@ -377,11 +377,11 @@ function ot(e) {
|
|
|
377
377
|
)
|
|
378
378
|
return !1;
|
|
379
379
|
let u = !1;
|
|
380
|
-
const d =
|
|
380
|
+
const d = hr(l) + o;
|
|
381
381
|
return i.forEach((p) => {
|
|
382
382
|
if (u)
|
|
383
383
|
return;
|
|
384
|
-
const h =
|
|
384
|
+
const h = fr(d, p.find);
|
|
385
385
|
if (!h)
|
|
386
386
|
return;
|
|
387
387
|
const f = c.state.tr, m = yt({
|
|
@@ -409,7 +409,7 @@ function ot(e) {
|
|
|
409
409
|
}), c.dispatch(f), u = !0);
|
|
410
410
|
}), u;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function mr(e) {
|
|
413
413
|
const { editor: t, rules: n } = e, r = new H({
|
|
414
414
|
state: {
|
|
415
415
|
init() {
|
|
@@ -479,11 +479,11 @@ function fr(e) {
|
|
|
479
479
|
});
|
|
480
480
|
return r;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function gr(e) {
|
|
483
483
|
return Object.prototype.toString.call(e).slice(8, -1);
|
|
484
484
|
}
|
|
485
485
|
function it(e) {
|
|
486
|
-
return
|
|
486
|
+
return gr(e) !== "Object" ? !1 : e.constructor === Object && Object.getPrototypeOf(e) === Object.prototype;
|
|
487
487
|
}
|
|
488
488
|
function St(e, t) {
|
|
489
489
|
const n = { ...e };
|
|
@@ -499,9 +499,9 @@ class D {
|
|
|
499
499
|
}, this.config = {
|
|
500
500
|
...this.config,
|
|
501
501
|
...t
|
|
502
|
-
}, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
502
|
+
}, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = T(S(this, "addOptions", {
|
|
503
503
|
name: this.name
|
|
504
|
-
}))), this.storage =
|
|
504
|
+
}))), this.storage = T(S(this, "addStorage", {
|
|
505
505
|
name: this.name,
|
|
506
506
|
options: this.options
|
|
507
507
|
})) || {};
|
|
@@ -518,9 +518,9 @@ class D {
|
|
|
518
518
|
}
|
|
519
519
|
extend(t = {}) {
|
|
520
520
|
const n = new D(t);
|
|
521
|
-
return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options =
|
|
521
|
+
return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = T(S(n, "addOptions", {
|
|
522
522
|
name: n.name
|
|
523
|
-
})), n.storage =
|
|
523
|
+
})), n.storage = T(S(n, "addStorage", {
|
|
524
524
|
name: n.name,
|
|
525
525
|
options: n.options
|
|
526
526
|
})), n;
|
|
@@ -537,10 +537,10 @@ class D {
|
|
|
537
537
|
return !1;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function yr(e) {
|
|
541
541
|
return typeof e == "number";
|
|
542
542
|
}
|
|
543
|
-
class
|
|
543
|
+
class je {
|
|
544
544
|
constructor(t) {
|
|
545
545
|
this.find = t.find, this.handler = t.handler;
|
|
546
546
|
}
|
|
@@ -569,7 +569,7 @@ function br(e) {
|
|
|
569
569
|
const v = m + b.index + 1, E = v + b[0].length, M = {
|
|
570
570
|
from: n.tr.mapping.map(v),
|
|
571
571
|
to: n.tr.mapping.map(E)
|
|
572
|
-
},
|
|
572
|
+
}, C = o.handler({
|
|
573
573
|
state: n,
|
|
574
574
|
range: M,
|
|
575
575
|
match: b,
|
|
@@ -579,7 +579,7 @@ function br(e) {
|
|
|
579
579
|
pasteEvent: i,
|
|
580
580
|
dropEvent: a
|
|
581
581
|
});
|
|
582
|
-
d.push(
|
|
582
|
+
d.push(C);
|
|
583
583
|
});
|
|
584
584
|
}), d.every((h) => h !== null);
|
|
585
585
|
}
|
|
@@ -637,17 +637,17 @@ function Sr(e) {
|
|
|
637
637
|
if (!m && !g && !k)
|
|
638
638
|
return;
|
|
639
639
|
if (k) {
|
|
640
|
-
const { from: E, text: M } = y,
|
|
640
|
+
const { from: E, text: M } = y, C = E + M.length, A = Mr(M);
|
|
641
641
|
return c({
|
|
642
642
|
rule: u,
|
|
643
643
|
state: h,
|
|
644
644
|
from: E,
|
|
645
|
-
to: { b:
|
|
645
|
+
to: { b: C },
|
|
646
646
|
pasteEvt: A
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
649
|
const b = p.doc.content.findDiffStart(h.doc.content), v = p.doc.content.findDiffEnd(h.doc.content);
|
|
650
|
-
if (!(!
|
|
650
|
+
if (!(!yr(b) || !v || b === v.b))
|
|
651
651
|
return c({
|
|
652
652
|
rule: u,
|
|
653
653
|
state: h,
|
|
@@ -664,7 +664,7 @@ function kr(e) {
|
|
|
664
664
|
}
|
|
665
665
|
class Z {
|
|
666
666
|
constructor(t, n) {
|
|
667
|
-
this.splittableMarks = [], this.editor = n, this.extensions = Z.resolve(t), this.schema =
|
|
667
|
+
this.splittableMarks = [], this.editor = n, this.extensions = Z.resolve(t), this.schema = pr(this.extensions, n), this.setupExtensions();
|
|
668
668
|
}
|
|
669
669
|
/**
|
|
670
670
|
* Returns a flattened and sorted extension list while
|
|
@@ -739,7 +739,7 @@ class Z {
|
|
|
739
739
|
const m = Object.fromEntries(Object.entries(l()).map(([g, y]) => [g, () => y({ editor: t })]));
|
|
740
740
|
u = { ...u, ...m };
|
|
741
741
|
}
|
|
742
|
-
const d =
|
|
742
|
+
const d = Pn(u);
|
|
743
743
|
c.push(d);
|
|
744
744
|
const p = S(i, "addInputRules", a);
|
|
745
745
|
de(i, t.options.enableInputRules) && p && r.push(...p());
|
|
@@ -753,7 +753,7 @@ class Z {
|
|
|
753
753
|
return c;
|
|
754
754
|
}).flat();
|
|
755
755
|
return [
|
|
756
|
-
|
|
756
|
+
mr({
|
|
757
757
|
editor: t,
|
|
758
758
|
rules: r
|
|
759
759
|
}),
|
|
@@ -820,7 +820,7 @@ class Z {
|
|
|
820
820
|
editor: this.editor,
|
|
821
821
|
type: At(t.name, this.schema)
|
|
822
822
|
};
|
|
823
|
-
t.type === "mark" && (!((n =
|
|
823
|
+
t.type === "mark" && (!((n = T(S(t, "keepOnSplit", r))) !== null && n !== void 0) || n) && this.splittableMarks.push(t.name);
|
|
824
824
|
const s = S(t, "onBeforeCreate", r), o = S(t, "onCreate", r), i = S(t, "onUpdate", r), a = S(t, "onSelectionUpdate", r), c = S(t, "onTransaction", r), l = S(t, "onFocus", r), u = S(t, "onBlur", r), d = S(t, "onDestroy", r);
|
|
825
825
|
s && this.editor.on("beforeCreate", s), o && this.editor.on("create", o), i && this.editor.on("update", i), a && this.editor.on("selectionUpdate", a), c && this.editor.on("transaction", c), l && this.editor.on("focus", l), u && this.editor.on("blur", u), d && this.editor.on("destroy", d);
|
|
826
826
|
});
|
|
@@ -834,9 +834,9 @@ class P {
|
|
|
834
834
|
}, this.config = {
|
|
835
835
|
...this.config,
|
|
836
836
|
...t
|
|
837
|
-
}, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
837
|
+
}, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = T(S(this, "addOptions", {
|
|
838
838
|
name: this.name
|
|
839
|
-
}))), this.storage =
|
|
839
|
+
}))), this.storage = T(S(this, "addStorage", {
|
|
840
840
|
name: this.name,
|
|
841
841
|
options: this.options
|
|
842
842
|
})) || {};
|
|
@@ -853,15 +853,15 @@ class P {
|
|
|
853
853
|
}
|
|
854
854
|
extend(t = {}) {
|
|
855
855
|
const n = new P({ ...this.config, ...t });
|
|
856
|
-
return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options =
|
|
856
|
+
return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = T(S(n, "addOptions", {
|
|
857
857
|
name: n.name
|
|
858
|
-
})), n.storage =
|
|
858
|
+
})), n.storage = T(S(n, "addStorage", {
|
|
859
859
|
name: n.name,
|
|
860
860
|
options: n.options
|
|
861
861
|
})), n;
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function Fe(e, t, n) {
|
|
865
865
|
const { from: r, to: s } = t, { blockSeparator: o = `
|
|
866
866
|
|
|
867
867
|
`, textSerializers: i = {} } = n || {};
|
|
@@ -881,7 +881,7 @@ function je(e, t, n) {
|
|
|
881
881
|
c.isText && (a += (p = c == null ? void 0 : c.text) === null || p === void 0 ? void 0 : p.slice(Math.max(r, l) - l, s - l));
|
|
882
882
|
}), a;
|
|
883
883
|
}
|
|
884
|
-
function
|
|
884
|
+
function ze(e) {
|
|
885
885
|
return Object.fromEntries(Object.entries(e.nodes).filter(([, t]) => t.spec.toText).map(([t, n]) => [t, n.spec.toText]));
|
|
886
886
|
}
|
|
887
887
|
const wr = P.create({
|
|
@@ -897,8 +897,8 @@ const wr = P.create({
|
|
|
897
897
|
key: new _("clipboardTextSerializer"),
|
|
898
898
|
props: {
|
|
899
899
|
clipboardTextSerializer: () => {
|
|
900
|
-
const { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: s } = t, { ranges: o } = s, i = Math.min(...o.map((u) => u.$from.pos)), a = Math.max(...o.map((u) => u.$to.pos)), c =
|
|
901
|
-
return
|
|
900
|
+
const { editor: e } = this, { state: t, schema: n } = e, { doc: r, selection: s } = t, { ranges: o } = s, i = Math.min(...o.map((u) => u.$from.pos)), a = Math.max(...o.map((u) => u.$to.pos)), c = ze(n);
|
|
901
|
+
return Fe(r, { from: i, to: a }, {
|
|
902
902
|
...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
|
|
903
903
|
textSerializers: c
|
|
904
904
|
});
|
|
@@ -919,7 +919,7 @@ const wr = P.create({
|
|
|
919
919
|
const { doc: l, mapping: u } = t, d = l.resolve(u.map(c)), p = l.resolve(u.map(c + a.nodeSize)), h = d.blockRange(p);
|
|
920
920
|
if (!h)
|
|
921
921
|
return;
|
|
922
|
-
const f =
|
|
922
|
+
const f = an(h);
|
|
923
923
|
if (a.type.isTextblock) {
|
|
924
924
|
const { defaultType: m } = d.parent.contentMatchAt(d.index());
|
|
925
925
|
t.setNodeMarkup(h.start, m);
|
|
@@ -927,7 +927,7 @@ const wr = P.create({
|
|
|
927
927
|
(f || f === 0) && t.lift(h, f);
|
|
928
928
|
});
|
|
929
929
|
}), !0;
|
|
930
|
-
}, xr = (e) => (t) => e(t), Ar = () => ({ state: e, dispatch: t }) =>
|
|
930
|
+
}, xr = (e) => (t) => e(t), Ar = () => ({ state: e, dispatch: t }) => ln(e, t), Or = (e, t) => ({ editor: n, tr: r }) => {
|
|
931
931
|
const { state: s } = n, o = s.doc.slice(e.from, e.to);
|
|
932
932
|
r.deleteRange(e.from, e.to);
|
|
933
933
|
const i = r.mapping.map(t);
|
|
@@ -960,7 +960,7 @@ const wr = P.create({
|
|
|
960
960
|
}, Pr = (e) => ({ tr: t, dispatch: n }) => {
|
|
961
961
|
const { from: r, to: s } = e;
|
|
962
962
|
return n && t.delete(r, s), !0;
|
|
963
|
-
}, Hr = () => ({ state: e, dispatch: t }) =>
|
|
963
|
+
}, Hr = () => ({ state: e, dispatch: t }) => cn(e, t), _r = () => ({ commands: e }) => e.keyboardShortcut("Enter"), $r = () => ({ state: e, dispatch: t }) => dn(e, t);
|
|
964
964
|
function mt(e, t, n = { strict: !0 }) {
|
|
965
965
|
const r = Object.keys(t);
|
|
966
966
|
return r.length ? r.every((s) => n.strict ? t[s] === e[s] : Ut(t[s]) ? t[s].test(e[s]) : t[s] === e[s]) : !0;
|
|
@@ -1021,7 +1021,7 @@ function Jt(e) {
|
|
|
1021
1021
|
function j(e = 0, t = 0, n = 0) {
|
|
1022
1022
|
return Math.min(Math.max(e, t), n);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function We(e, t = null) {
|
|
1025
1025
|
if (!t)
|
|
1026
1026
|
return null;
|
|
1027
1027
|
const n = W.atStart(e), r = W.atEnd(e);
|
|
@@ -1056,19 +1056,19 @@ const Br = (e = null, t = {}) => ({ editor: n, view: r, tr: s, dispatch: o }) =>
|
|
|
1056
1056
|
return !0;
|
|
1057
1057
|
if (o && e === null && !Jt(n.state.selection))
|
|
1058
1058
|
return i(), !0;
|
|
1059
|
-
const a =
|
|
1059
|
+
const a = We(s.doc, e) || n.state.selection, c = n.state.selection.eq(a);
|
|
1060
1060
|
return o && (c || s.setSelection(a), c && s.storedMarks && s.setStoredMarks(s.storedMarks), i()), !0;
|
|
1061
|
-
}, jr = (e, t) => (n) => e.every((r, s) => t(r, { ...n, index: s })), Fr = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, e, t),
|
|
1061
|
+
}, jr = (e, t) => (n) => e.every((r, s) => t(r, { ...n, index: s })), Fr = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, e, t), Ve = (e) => {
|
|
1062
1062
|
const t = e.childNodes;
|
|
1063
1063
|
for (let n = t.length - 1; n >= 0; n -= 1) {
|
|
1064
1064
|
const r = t[n];
|
|
1065
|
-
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 &&
|
|
1065
|
+
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? e.removeChild(r) : r.nodeType === 1 && Ve(r);
|
|
1066
1066
|
}
|
|
1067
1067
|
return e;
|
|
1068
1068
|
};
|
|
1069
1069
|
function at(e) {
|
|
1070
1070
|
const t = `<body>${e}</body>`, n = new window.DOMParser().parseFromString(t, "text/html").body;
|
|
1071
|
-
return
|
|
1071
|
+
return Ve(n);
|
|
1072
1072
|
}
|
|
1073
1073
|
function gt(e, t, n) {
|
|
1074
1074
|
n = {
|
|
@@ -1122,7 +1122,7 @@ function zr(e, t, n) {
|
|
|
1122
1122
|
if (r < t)
|
|
1123
1123
|
return;
|
|
1124
1124
|
const s = e.steps[r];
|
|
1125
|
-
if (!(s instanceof
|
|
1125
|
+
if (!(s instanceof Hn || s instanceof _n))
|
|
1126
1126
|
return;
|
|
1127
1127
|
const o = e.mapping.maps[r];
|
|
1128
1128
|
let i = 0;
|
|
@@ -1169,7 +1169,7 @@ const Wr = (e) => !("type" in e), Vr = (e, t, n) => ({ tr: r, dispatch: s, edito
|
|
|
1169
1169
|
u ? (Array.isArray(t) ? h = t.map((f) => f.text || "").join("") : typeof t == "object" && t && t.text ? h = t.text : h = t, r.insertText(h, c, l)) : (h = a, r.replaceWith(c, l, h)), n.updateSelection && zr(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: c, text: h }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: c, text: h });
|
|
1170
1170
|
}
|
|
1171
1171
|
return !0;
|
|
1172
|
-
}, Kr = () => ({ state: e, dispatch: t }) =>
|
|
1172
|
+
}, Kr = () => ({ state: e, dispatch: t }) => un(e, t), qr = () => ({ state: e, dispatch: t }) => pn(e, t), Ur = () => ({ state: e, dispatch: t }) => hn(e, t), Gr = () => ({ state: e, dispatch: t }) => fn(e, t), Jr = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
1173
1173
|
try {
|
|
1174
1174
|
const r = Re(e.doc, e.selection.$from.pos, -1);
|
|
1175
1175
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
@@ -1183,8 +1183,8 @@ const Wr = (e) => !("type" in e), Vr = (e, t, n) => ({ tr: r, dispatch: s, edito
|
|
|
1183
1183
|
} catch {
|
|
1184
1184
|
return !1;
|
|
1185
1185
|
}
|
|
1186
|
-
}, Xr = () => ({ state: e, dispatch: t }) =>
|
|
1187
|
-
function
|
|
1186
|
+
}, Xr = () => ({ state: e, dispatch: t }) => mn(e, t), Qr = () => ({ state: e, dispatch: t }) => gn(e, t);
|
|
1187
|
+
function Ke() {
|
|
1188
1188
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
1189
1189
|
}
|
|
1190
1190
|
function Zr(e) {
|
|
@@ -1203,7 +1203,7 @@ function Zr(e) {
|
|
|
1203
1203
|
else if (/^s(hift)?$/i.test(c))
|
|
1204
1204
|
o = !0;
|
|
1205
1205
|
else if (/^mod$/i.test(c))
|
|
1206
|
-
kt() ||
|
|
1206
|
+
kt() || Ke() ? i = !0 : s = !0;
|
|
1207
1207
|
else
|
|
1208
1208
|
throw new Error(`Unrecognized modifier name: ${c}`);
|
|
1209
1209
|
}
|
|
@@ -1243,11 +1243,11 @@ function rt(e, t, n = {}) {
|
|
|
1243
1243
|
}
|
|
1244
1244
|
const es = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
1245
1245
|
const s = $(e, n.schema);
|
|
1246
|
-
return rt(n, s, t) ?
|
|
1247
|
-
}, ns = () => ({ state: e, dispatch: t }) =>
|
|
1246
|
+
return rt(n, s, t) ? yn(n, r) : !1;
|
|
1247
|
+
}, ns = () => ({ state: e, dispatch: t }) => vn(e, t), rs = (e) => ({ state: t, dispatch: n }) => {
|
|
1248
1248
|
const r = $(e, t.schema);
|
|
1249
|
-
return
|
|
1250
|
-
}, ss = () => ({ state: e, dispatch: t }) =>
|
|
1249
|
+
return bn(r)(t, n);
|
|
1250
|
+
}, ss = () => ({ state: e, dispatch: t }) => Mn(e, t);
|
|
1251
1251
|
function wt(e, t) {
|
|
1252
1252
|
return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
|
|
1253
1253
|
}
|
|
@@ -1268,7 +1268,7 @@ const os = (e, t) => ({ tr: n, state: r, dispatch: s }) => {
|
|
|
1268
1268
|
}, is = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), as = () => ({ tr: e, commands: t }) => t.setTextSelection({
|
|
1269
1269
|
from: 0,
|
|
1270
1270
|
to: e.doc.content.size
|
|
1271
|
-
}), ls = () => ({ state: e, dispatch: t }) =>
|
|
1271
|
+
}), ls = () => ({ state: e, dispatch: t }) => Sn(e, t), cs = () => ({ state: e, dispatch: t }) => kn(e, t), ds = () => ({ state: e, dispatch: t }) => wn(e, t), us = () => ({ state: e, dispatch: t }) => En(e, t), ps = () => ({ state: e, dispatch: t }) => Tn(e, t);
|
|
1272
1272
|
function Dt(e, t, n = {}, r = {}) {
|
|
1273
1273
|
return gt(e, t, {
|
|
1274
1274
|
slice: !1,
|
|
@@ -1299,7 +1299,7 @@ function Yt(e, t) {
|
|
|
1299
1299
|
return a ? { ...a.attrs } : {};
|
|
1300
1300
|
}
|
|
1301
1301
|
function fs(e, t) {
|
|
1302
|
-
const n = new
|
|
1302
|
+
const n = new on(e);
|
|
1303
1303
|
return t.forEach((r) => {
|
|
1304
1304
|
r.steps.forEach((s) => {
|
|
1305
1305
|
n.step(s);
|
|
@@ -1332,7 +1332,7 @@ function gs(e, t, n) {
|
|
|
1332
1332
|
});
|
|
1333
1333
|
}), r;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1335
|
+
function qe(e, t) {
|
|
1336
1336
|
for (let n = e.depth; n > 0; n -= 1) {
|
|
1337
1337
|
const r = e.node(n);
|
|
1338
1338
|
if (t(r))
|
|
@@ -1345,10 +1345,10 @@ function Ke(e, t) {
|
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
1347
|
function Xt(e) {
|
|
1348
|
-
return (t) =>
|
|
1348
|
+
return (t) => qe(t.$from, e);
|
|
1349
1349
|
}
|
|
1350
1350
|
function ys(e, t) {
|
|
1351
|
-
const n =
|
|
1351
|
+
const n = $n.fromSchema(t).serializeFragment(e), s = document.implementation.createHTMLDocument().createElement("div");
|
|
1352
1352
|
return s.appendChild(n), s.innerHTML;
|
|
1353
1353
|
}
|
|
1354
1354
|
function vs(e, t) {
|
|
@@ -1356,7 +1356,7 @@ function vs(e, t) {
|
|
|
1356
1356
|
from: 0,
|
|
1357
1357
|
to: e.content.size
|
|
1358
1358
|
};
|
|
1359
|
-
return
|
|
1359
|
+
return Fe(e, n, t);
|
|
1360
1360
|
}
|
|
1361
1361
|
function bs(e, t) {
|
|
1362
1362
|
const n = $(t, e.schema), { from: r, to: s } = e.selection, o = [];
|
|
@@ -1366,7 +1366,7 @@ function bs(e, t) {
|
|
|
1366
1366
|
const i = o.reverse().find((a) => a.type.name === n.name);
|
|
1367
1367
|
return i ? { ...i.attrs } : {};
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1369
|
+
function Ue(e, t) {
|
|
1370
1370
|
const n = wt(typeof t == "string" ? t : t.name, e.schema);
|
|
1371
1371
|
return n === "node" ? bs(e, t) : n === "mark" ? Yt(e, t) : {};
|
|
1372
1372
|
}
|
|
@@ -1469,7 +1469,7 @@ function pe(e, t) {
|
|
|
1469
1469
|
name: r.name,
|
|
1470
1470
|
options: r.options,
|
|
1471
1471
|
storage: r.storage
|
|
1472
|
-
}, o =
|
|
1472
|
+
}, o = T(S(r, "group", s));
|
|
1473
1473
|
return typeof o != "string" ? !1 : o.split(" ").includes("list");
|
|
1474
1474
|
}
|
|
1475
1475
|
function Et(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
@@ -1494,7 +1494,7 @@ function Et(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
1494
1494
|
}
|
|
1495
1495
|
return !1;
|
|
1496
1496
|
}
|
|
1497
|
-
function
|
|
1497
|
+
function Ge(e) {
|
|
1498
1498
|
return e instanceof tt;
|
|
1499
1499
|
}
|
|
1500
1500
|
function Es(e, t, n) {
|
|
@@ -1575,7 +1575,7 @@ const Cs = (e, t = {}) => ({ tr: n, state: r, dispatch: s }) => {
|
|
|
1575
1575
|
return !0;
|
|
1576
1576
|
}, Rs = (e) => ({ state: t, dispatch: n }) => {
|
|
1577
1577
|
const r = $(e, t.schema);
|
|
1578
|
-
return
|
|
1578
|
+
return Cn(r)(t, n);
|
|
1579
1579
|
};
|
|
1580
1580
|
function he(e, t) {
|
|
1581
1581
|
const n = e.storedMarks || e.selection.$to.parentOffset && e.selection.$from.marks();
|
|
@@ -1633,13 +1633,13 @@ const Ps = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
1633
1633
|
}, E = ((i = a.contentMatch.defaultType) === null || i === void 0 ? void 0 : i.createAndFill(v)) || void 0;
|
|
1634
1634
|
y = y.append(ut.from(a.createAndFill(null, E) || void 0));
|
|
1635
1635
|
const M = c.before(c.depth - (k - 1));
|
|
1636
|
-
n.replace(M, c.after(-b), new
|
|
1637
|
-
let
|
|
1636
|
+
n.replace(M, c.after(-b), new xn(y, 4 - k, 0));
|
|
1637
|
+
let C = -1;
|
|
1638
1638
|
n.doc.nodesBetween(M, n.doc.content.size, (A, w) => {
|
|
1639
|
-
if (
|
|
1639
|
+
if (C > -1)
|
|
1640
1640
|
return !1;
|
|
1641
|
-
A.isTextblock && A.content.size === 0 && (
|
|
1642
|
-
}),
|
|
1641
|
+
A.isTextblock && A.content.size === 0 && (C = w + 1);
|
|
1642
|
+
}), C > -1 && n.setSelection(I.near(n.doc.resolve(C))), n.scrollIntoView();
|
|
1643
1643
|
}
|
|
1644
1644
|
return !0;
|
|
1645
1645
|
}
|
|
@@ -1695,8 +1695,8 @@ const Ps = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
1695
1695
|
return c().command(() => (o.setNodeMarkup(E.pos, h), !0)).command(() => Ot(o, h)).command(() => Lt(o, h)).run();
|
|
1696
1696
|
}
|
|
1697
1697
|
return !n || !v || !a ? c().command(() => u().wrapInList(h, r) ? !0 : l.clearNodes()).wrapInList(h, r).command(() => Ot(o, h)).command(() => Lt(o, h)).run() : c().command(() => {
|
|
1698
|
-
const M = u().wrapInList(h, r),
|
|
1699
|
-
return o.ensureMarks(
|
|
1698
|
+
const M = u().wrapInList(h, r), C = v.filter((A) => p.includes(A.type.name));
|
|
1699
|
+
return o.ensureMarks(C), M ? !0 : l.clearNodes();
|
|
1700
1700
|
}).wrapInList(h, r).command(() => Ot(o, h)).command(() => Lt(o, h)).run();
|
|
1701
1701
|
}, $s = (e, t = {}, n = {}) => ({ state: r, commands: s }) => {
|
|
1702
1702
|
const { extendEmptyMarkRange: o = !1 } = n, i = K(e, r.schema);
|
|
@@ -1769,10 +1769,10 @@ const Ps = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
1769
1769
|
}), !0) : !1;
|
|
1770
1770
|
}, zs = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
1771
1771
|
const s = $(e, n.schema);
|
|
1772
|
-
return
|
|
1772
|
+
return An(s, t)(n, r);
|
|
1773
1773
|
}, Ws = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
1774
1774
|
const s = $(e, n.schema);
|
|
1775
|
-
return
|
|
1775
|
+
return On(s, t)(n, r);
|
|
1776
1776
|
};
|
|
1777
1777
|
var Vs = /* @__PURE__ */ Object.freeze({
|
|
1778
1778
|
__proto__: null,
|
|
@@ -1942,7 +1942,7 @@ const Ks = P.create({
|
|
|
1942
1942
|
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
|
|
1943
1943
|
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
|
|
1944
1944
|
};
|
|
1945
|
-
return kt() ||
|
|
1945
|
+
return kt() || Ke() ? o : s;
|
|
1946
1946
|
},
|
|
1947
1947
|
addProseMirrorPlugins() {
|
|
1948
1948
|
return [
|
|
@@ -2209,7 +2209,7 @@ function Zs(e, t, n) {
|
|
|
2209
2209
|
const s = document.createElement("style");
|
|
2210
2210
|
return t && s.setAttribute("nonce", t), s.setAttribute("data-tiptap-style", ""), s.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(s), s;
|
|
2211
2211
|
}
|
|
2212
|
-
class to extends
|
|
2212
|
+
class to extends cr {
|
|
2213
2213
|
constructor(t = {}) {
|
|
2214
2214
|
super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
|
|
2215
2215
|
element: document.createElement("div"),
|
|
@@ -2385,11 +2385,11 @@ class to extends lr {
|
|
|
2385
2385
|
}
|
|
2386
2386
|
}), t = Dt(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
|
|
2387
2387
|
}
|
|
2388
|
-
const n =
|
|
2389
|
-
this.view = new
|
|
2388
|
+
const n = We(t, this.options.autofocus);
|
|
2389
|
+
this.view = new Ln(this.options.element, {
|
|
2390
2390
|
...this.options.editorProps,
|
|
2391
2391
|
dispatchTransaction: this.dispatchTransaction.bind(this),
|
|
2392
|
-
state:
|
|
2392
|
+
state: Rn.create({
|
|
2393
2393
|
doc: t,
|
|
2394
2394
|
selection: n || void 0
|
|
2395
2395
|
})
|
|
@@ -2469,7 +2469,7 @@ class to extends lr {
|
|
|
2469
2469
|
* Get attributes of the currently selected node or mark.
|
|
2470
2470
|
*/
|
|
2471
2471
|
getAttributes(t) {
|
|
2472
|
-
return
|
|
2472
|
+
return Ue(this.state, t);
|
|
2473
2473
|
}
|
|
2474
2474
|
isActive(t, n) {
|
|
2475
2475
|
const r = typeof t == "string" ? t : null, s = typeof t == "string" ? n : t;
|
|
@@ -2497,7 +2497,7 @@ class to extends lr {
|
|
|
2497
2497
|
return vs(this.state.doc, {
|
|
2498
2498
|
blockSeparator: n,
|
|
2499
2499
|
textSerializers: {
|
|
2500
|
-
...
|
|
2500
|
+
...ze(this.schema),
|
|
2501
2501
|
...r
|
|
2502
2502
|
}
|
|
2503
2503
|
});
|
|
@@ -2553,7 +2553,7 @@ function Y(e) {
|
|
|
2553
2553
|
return new Mt({
|
|
2554
2554
|
find: e.find,
|
|
2555
2555
|
handler: ({ state: t, range: n, match: r }) => {
|
|
2556
|
-
const s =
|
|
2556
|
+
const s = T(e.getAttributes, void 0, r);
|
|
2557
2557
|
if (s === !1 || s === null)
|
|
2558
2558
|
return null;
|
|
2559
2559
|
const { tr: o } = t, i = r[r.length - 1], a = r[0];
|
|
@@ -2568,11 +2568,11 @@ function Y(e) {
|
|
|
2568
2568
|
}
|
|
2569
2569
|
});
|
|
2570
2570
|
}
|
|
2571
|
-
function
|
|
2571
|
+
function Je(e) {
|
|
2572
2572
|
return new Mt({
|
|
2573
2573
|
find: e.find,
|
|
2574
2574
|
handler: ({ state: t, range: n, match: r }) => {
|
|
2575
|
-
const s =
|
|
2575
|
+
const s = T(e.getAttributes, void 0, r) || {}, { tr: o } = t, i = n.from;
|
|
2576
2576
|
let a = n.to;
|
|
2577
2577
|
const c = e.type.create(s);
|
|
2578
2578
|
if (r[1]) {
|
|
@@ -2593,7 +2593,7 @@ function Bt(e) {
|
|
|
2593
2593
|
return new Mt({
|
|
2594
2594
|
find: e.find,
|
|
2595
2595
|
handler: ({ state: t, range: n, match: r }) => {
|
|
2596
|
-
const s = t.doc.resolve(n.from), o =
|
|
2596
|
+
const s = t.doc.resolve(n.from), o = T(e.getAttributes, void 0, r) || {};
|
|
2597
2597
|
if (!s.node(-1).canReplaceWith(s.index(-1), s.indexAfter(-1), e.type))
|
|
2598
2598
|
return null;
|
|
2599
2599
|
t.tr.delete(n.from, n.to).setBlockType(n.from, n.from, e.type, o);
|
|
@@ -2604,7 +2604,7 @@ function et(e) {
|
|
|
2604
2604
|
return new Mt({
|
|
2605
2605
|
find: e.find,
|
|
2606
2606
|
handler: ({ state: t, range: n, match: r, chain: s }) => {
|
|
2607
|
-
const o =
|
|
2607
|
+
const o = T(e.getAttributes, void 0, r) || {}, i = t.tr.delete(n.from, n.to), c = i.doc.resolve(n.from).blockRange(), l = c && sn(c, e.type, o);
|
|
2608
2608
|
if (!l)
|
|
2609
2609
|
return null;
|
|
2610
2610
|
if (i.wrap(c, l), e.keepMarks && e.editor) {
|
|
@@ -2631,9 +2631,9 @@ class R {
|
|
|
2631
2631
|
}, this.config = {
|
|
2632
2632
|
...this.config,
|
|
2633
2633
|
...t
|
|
2634
|
-
}, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options =
|
|
2634
|
+
}, this.name = this.config.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = T(S(this, "addOptions", {
|
|
2635
2635
|
name: this.name
|
|
2636
|
-
}))), this.storage =
|
|
2636
|
+
}))), this.storage = T(S(this, "addStorage", {
|
|
2637
2637
|
name: this.name,
|
|
2638
2638
|
options: this.options
|
|
2639
2639
|
})) || {};
|
|
@@ -2650,9 +2650,9 @@ class R {
|
|
|
2650
2650
|
}
|
|
2651
2651
|
extend(t = {}) {
|
|
2652
2652
|
const n = new R(t);
|
|
2653
|
-
return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options =
|
|
2653
|
+
return n.parent = this, this.child = n, n.name = t.name ? t.name : n.parent.name, t.defaultOptions && Object.keys(t.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = T(S(n, "addOptions", {
|
|
2654
2654
|
name: n.name
|
|
2655
|
-
})), n.storage =
|
|
2655
|
+
})), n.storage = T(S(n, "addStorage", {
|
|
2656
2656
|
name: n.name,
|
|
2657
2657
|
options: n.options
|
|
2658
2658
|
})), n;
|
|
@@ -2756,10 +2756,10 @@ class no {
|
|
|
2756
2756
|
}
|
|
2757
2757
|
}
|
|
2758
2758
|
function V(e) {
|
|
2759
|
-
return new
|
|
2759
|
+
return new je({
|
|
2760
2760
|
find: e.find,
|
|
2761
2761
|
handler: ({ state: t, range: n, match: r, pasteEvent: s }) => {
|
|
2762
|
-
const o =
|
|
2762
|
+
const o = T(e.getAttributes, void 0, r, s);
|
|
2763
2763
|
if (o === !1 || o === null)
|
|
2764
2764
|
return null;
|
|
2765
2765
|
const { tr: i } = t, a = r[r.length - 1], c = r[0];
|
|
@@ -2776,7 +2776,19 @@ function V(e) {
|
|
|
2776
2776
|
function ro(e) {
|
|
2777
2777
|
return e.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
2778
2778
|
}
|
|
2779
|
-
|
|
2779
|
+
function bi(e) {
|
|
2780
|
+
return new je({
|
|
2781
|
+
find: e.find,
|
|
2782
|
+
handler({ match: t, chain: n, range: r, pasteEvent: s }) {
|
|
2783
|
+
const o = T(e.getAttributes, void 0, t, s), i = T(e.getContent, void 0, o);
|
|
2784
|
+
if (o === !1 || o === null)
|
|
2785
|
+
return null;
|
|
2786
|
+
const a = { type: e.type.name, attrs: o };
|
|
2787
|
+
i && (a.content = i), t.input && n().deleteRange(r).insertContentAt(r.from, a);
|
|
2788
|
+
}
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
const so = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, oo = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, io = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, ao = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, Mi = D.create({
|
|
2780
2792
|
name: "bold",
|
|
2781
2793
|
addOptions() {
|
|
2782
2794
|
return {
|
|
@@ -2888,10 +2900,10 @@ class lo {
|
|
|
2888
2900
|
}
|
|
2889
2901
|
(p = this.tippy) === null || p === void 0 || p.setProps({
|
|
2890
2902
|
getReferenceClientRect: ((h = this.tippyOptions) === null || h === void 0 ? void 0 : h.getReferenceClientRect) || (() => {
|
|
2891
|
-
if (
|
|
2903
|
+
if (Ge(f.selection)) {
|
|
2892
2904
|
let M = a.nodeDOM(b);
|
|
2893
|
-
const
|
|
2894
|
-
if (
|
|
2905
|
+
const C = M.dataset.nodeViewWrapper ? M : M.querySelector("[data-node-view-wrapper]");
|
|
2906
|
+
if (C && (M = C.firstChild), M)
|
|
2895
2907
|
return M.getBoundingClientRect();
|
|
2896
2908
|
}
|
|
2897
2909
|
return Es(a, b, v);
|
|
@@ -2934,7 +2946,7 @@ class lo {
|
|
|
2934
2946
|
!((t = this.tippy) === null || t === void 0) && t.popper.firstChild && this.tippy.popper.firstChild.removeEventListener("blur", this.tippyBlurHandler), (n = this.tippy) === null || n === void 0 || n.destroy(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler);
|
|
2935
2947
|
}
|
|
2936
2948
|
}
|
|
2937
|
-
const
|
|
2949
|
+
const Ye = (e) => new H({
|
|
2938
2950
|
key: typeof e.pluginKey == "string" ? new _(e.pluginKey) : e.pluginKey,
|
|
2939
2951
|
view: (t) => new lo({ view: t, ...e })
|
|
2940
2952
|
});
|
|
@@ -2951,7 +2963,7 @@ P.create({
|
|
|
2951
2963
|
},
|
|
2952
2964
|
addProseMirrorPlugins() {
|
|
2953
2965
|
return this.options.element ? [
|
|
2954
|
-
|
|
2966
|
+
Ye({
|
|
2955
2967
|
pluginKey: this.options.pluginKey,
|
|
2956
2968
|
editor: this.editor,
|
|
2957
2969
|
element: this.options.element,
|
|
@@ -3034,8 +3046,8 @@ function po() {
|
|
|
3034
3046
|
}
|
|
3035
3047
|
function r(b, v, E) {
|
|
3036
3048
|
{
|
|
3037
|
-
var M = t.ReactDebugCurrentFrame,
|
|
3038
|
-
|
|
3049
|
+
var M = t.ReactDebugCurrentFrame, C = M.getStackAddendum();
|
|
3050
|
+
C !== "" && (v += "%s", E = E.concat([C]));
|
|
3039
3051
|
var A = E.map(function(w) {
|
|
3040
3052
|
return String(w);
|
|
3041
3053
|
});
|
|
@@ -3050,8 +3062,8 @@ function po() {
|
|
|
3050
3062
|
u || e.startTransition !== void 0 && (u = !0, n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
3051
3063
|
var M = v();
|
|
3052
3064
|
if (!d) {
|
|
3053
|
-
var
|
|
3054
|
-
o(M,
|
|
3065
|
+
var C = v();
|
|
3066
|
+
o(M, C) || (n("The result of getSnapshot should be cached to avoid an infinite loop"), d = !0);
|
|
3055
3067
|
}
|
|
3056
3068
|
var A = i({
|
|
3057
3069
|
inst: {
|
|
@@ -3125,7 +3137,7 @@ function mo() {
|
|
|
3125
3137
|
setRenderer(n, r) {
|
|
3126
3138
|
t = {
|
|
3127
3139
|
...t,
|
|
3128
|
-
[n]:
|
|
3140
|
+
[n]: ar.createPortal(r.reactElement, r.element, n)
|
|
3129
3141
|
}, e.forEach((s) => s());
|
|
3130
3142
|
},
|
|
3131
3143
|
/**
|
|
@@ -3186,14 +3198,14 @@ class go extends L.Component {
|
|
|
3186
3198
|
);
|
|
3187
3199
|
}
|
|
3188
3200
|
}
|
|
3189
|
-
const yo =
|
|
3201
|
+
const yo = or((e, t) => {
|
|
3190
3202
|
const n = L.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
|
|
3191
3203
|
return L.createElement(go, {
|
|
3192
3204
|
key: n,
|
|
3193
3205
|
innerRef: t,
|
|
3194
3206
|
...e
|
|
3195
3207
|
});
|
|
3196
|
-
}),
|
|
3208
|
+
}), Si = L.memo(yo);
|
|
3197
3209
|
var vo = function e(t, n) {
|
|
3198
3210
|
if (t === n) return !0;
|
|
3199
3211
|
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
@@ -3268,14 +3280,14 @@ function Mo() {
|
|
|
3268
3280
|
function y(M) {
|
|
3269
3281
|
if (!k) {
|
|
3270
3282
|
if (k = !0, b = M, M = p(M), h !== void 0 && m.hasValue) {
|
|
3271
|
-
var
|
|
3272
|
-
if (h(
|
|
3283
|
+
var C = m.value;
|
|
3284
|
+
if (h(C, M)) return v = C;
|
|
3273
3285
|
}
|
|
3274
3286
|
return v = M;
|
|
3275
3287
|
}
|
|
3276
|
-
if (
|
|
3288
|
+
if (C = v, r(b, M)) return C;
|
|
3277
3289
|
var A = p(M);
|
|
3278
|
-
return h !== void 0 && h(
|
|
3290
|
+
return h !== void 0 && h(C, A) ? C : (b = M, v = A);
|
|
3279
3291
|
}
|
|
3280
3292
|
var k = !1, b, v, E = d === void 0 ? null : d;
|
|
3281
3293
|
return [function() {
|
|
@@ -3316,22 +3328,22 @@ function So() {
|
|
|
3316
3328
|
value: null
|
|
3317
3329
|
}, m.current = g) : g = m.current;
|
|
3318
3330
|
var y = a(function() {
|
|
3319
|
-
var E = !1, M,
|
|
3331
|
+
var E = !1, M, C, A = function(F) {
|
|
3320
3332
|
if (!E) {
|
|
3321
3333
|
E = !0, M = F;
|
|
3322
3334
|
var X = h(F);
|
|
3323
3335
|
if (f !== void 0 && g.hasValue) {
|
|
3324
3336
|
var q = g.value;
|
|
3325
3337
|
if (f(q, X))
|
|
3326
|
-
return
|
|
3338
|
+
return C = q, q;
|
|
3327
3339
|
}
|
|
3328
|
-
return
|
|
3340
|
+
return C = X, X;
|
|
3329
3341
|
}
|
|
3330
|
-
var U = M, z =
|
|
3342
|
+
var U = M, z = C;
|
|
3331
3343
|
if (r(U, F))
|
|
3332
3344
|
return z;
|
|
3333
3345
|
var G = h(F);
|
|
3334
|
-
return f !== void 0 && f(z, G) ? z : (M = F,
|
|
3346
|
+
return f !== void 0 && f(z, G) ? z : (M = F, C = G, G);
|
|
3335
3347
|
}, w = p === void 0 ? null : p, O = function() {
|
|
3336
3348
|
return A(d());
|
|
3337
3349
|
}, B = w === null ? void 0 : function() {
|
|
@@ -3523,8 +3535,8 @@ class Co {
|
|
|
3523
3535
|
}, 1);
|
|
3524
3536
|
}
|
|
3525
3537
|
}
|
|
3526
|
-
function
|
|
3527
|
-
const n =
|
|
3538
|
+
function ki(e = {}, t = []) {
|
|
3539
|
+
const n = ir(e);
|
|
3528
3540
|
n.current = e;
|
|
3529
3541
|
const [r] = Kt(() => new Co(n)), s = Tt.useSyncExternalStore(r.subscribe, r.getEditor, r.getServerSnapshot);
|
|
3530
3542
|
return Ie(s), qt(r.onRender(t)), Eo({
|
|
@@ -3532,11 +3544,11 @@ function Si(e = {}, t = []) {
|
|
|
3532
3544
|
selector: ({ transactionNumber: o }) => e.shouldRerenderOnTransaction === !1 ? null : e.immediatelyRender && o === 0 ? 0 : o + 1
|
|
3533
3545
|
}), s;
|
|
3534
3546
|
}
|
|
3535
|
-
const
|
|
3547
|
+
const Xe = $e({
|
|
3536
3548
|
editor: null
|
|
3537
3549
|
});
|
|
3538
|
-
|
|
3539
|
-
const xo = () => De(
|
|
3550
|
+
Xe.Consumer;
|
|
3551
|
+
const xo = () => De(Xe), wi = (e) => {
|
|
3540
3552
|
const [t, n] = Kt(null), { editor: r } = xo();
|
|
3541
3553
|
return qt(() => {
|
|
3542
3554
|
var s;
|
|
@@ -3547,7 +3559,7 @@ const xo = () => De(Ye), ki = (e) => {
|
|
|
3547
3559
|
console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");
|
|
3548
3560
|
return;
|
|
3549
3561
|
}
|
|
3550
|
-
const d =
|
|
3562
|
+
const d = Ye({
|
|
3551
3563
|
updateDelay: c,
|
|
3552
3564
|
editor: u,
|
|
3553
3565
|
element: t,
|
|
@@ -3559,10 +3571,10 @@ const xo = () => De(Ye), ki = (e) => {
|
|
|
3559
3571
|
u.unregisterPlugin(o);
|
|
3560
3572
|
};
|
|
3561
3573
|
}, [e.editor, r, t]), L.createElement("div", { ref: n, className: e.className, style: { visibility: "hidden" } }, e.children);
|
|
3562
|
-
},
|
|
3574
|
+
}, Qe = $e({
|
|
3563
3575
|
onDragStart: void 0
|
|
3564
|
-
}),
|
|
3565
|
-
const t = e.as || "div", { nodeViewContentRef: n } =
|
|
3576
|
+
}), Ze = () => De(Qe), Ei = (e) => {
|
|
3577
|
+
const t = e.as || "div", { nodeViewContentRef: n } = Ze();
|
|
3566
3578
|
return (
|
|
3567
3579
|
// @ts-ignore
|
|
3568
3580
|
L.createElement(t, { ...e, ref: n, "data-node-view-content": "", style: {
|
|
@@ -3570,8 +3582,8 @@ const xo = () => De(Ye), ki = (e) => {
|
|
|
3570
3582
|
...e.style
|
|
3571
3583
|
} })
|
|
3572
3584
|
);
|
|
3573
|
-
},
|
|
3574
|
-
const { onDragStart: n } =
|
|
3585
|
+
}, Ti = L.forwardRef((e, t) => {
|
|
3586
|
+
const { onDragStart: n } = Ze(), r = e.as || "div";
|
|
3575
3587
|
return (
|
|
3576
3588
|
// @ts-ignore
|
|
3577
3589
|
L.createElement(r, { ...e, ref: t, "data-node-view-wrapper": "", onDragStart: n, style: {
|
|
@@ -3592,7 +3604,7 @@ class Lo {
|
|
|
3592
3604
|
* Immediately creates element and renders the provided React component.
|
|
3593
3605
|
*/
|
|
3594
3606
|
constructor(t, { editor: n, props: r = {}, as: s = "div", className: o = "" }) {
|
|
3595
|
-
this.ref = null, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = t, this.editor = n, this.props = r, this.element = document.createElement(s), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isInitialized ?
|
|
3607
|
+
this.ref = null, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = t, this.editor = n, this.props = r, this.element = document.createElement(s), this.element.classList.add("react-renderer"), o && this.element.classList.add(...o.split(" ")), this.editor.isInitialized ? lr(() => {
|
|
3596
3608
|
this.render();
|
|
3597
3609
|
}) : this.render();
|
|
3598
3610
|
}
|
|
@@ -3657,7 +3669,7 @@ class Ro extends no {
|
|
|
3657
3669
|
}
|
|
3658
3670
|
const s = { onDragStart: this.onDragStart.bind(this), nodeViewContentRef: (l) => {
|
|
3659
3671
|
l && this.contentDOMElement && l.firstChild !== this.contentDOMElement && l.appendChild(this.contentDOMElement);
|
|
3660
|
-
} }, o = this.component, i = L.memo((l) => L.createElement(
|
|
3672
|
+
} }, o = this.component, i = L.memo((l) => L.createElement(Qe.Provider, { value: s }, L.createElement(o, l)));
|
|
3661
3673
|
i.displayName = "ReactNodeView", this.node.isLeaf ? this.contentDOMElement = null : this.options.contentDOMElementTag ? this.contentDOMElement = document.createElement(this.options.contentDOMElementTag) : this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement && (this.contentDOMElement.dataset.nodeViewContentReact = "", this.contentDOMElement.style.whiteSpace = "inherit");
|
|
3662
3674
|
let a = this.node.isInline ? "span" : "div";
|
|
3663
3675
|
this.options.as && (a = this.options.as);
|
|
@@ -3767,18 +3779,18 @@ class Ro extends no {
|
|
|
3767
3779
|
}
|
|
3768
3780
|
}
|
|
3769
3781
|
}
|
|
3770
|
-
function
|
|
3782
|
+
function Ci(e, t) {
|
|
3771
3783
|
return (n) => n.editor.contentComponent ? new Ro(e, n, t) : {};
|
|
3772
3784
|
}
|
|
3773
3785
|
function Zt(e, t, n) {
|
|
3774
3786
|
const r = [], s = e.node(0);
|
|
3775
3787
|
n = typeof n == "number" && n >= 0 ? n : e.sameParent(t) ? Math.max(0, e.sharedDepth(t.pos) - 1) : e.sharedDepth(t.pos);
|
|
3776
|
-
const o = new
|
|
3788
|
+
const o = new Bn(e, t, n), i = o.depth === 0 ? 0 : s.resolve(o.start).posAtIndex(0);
|
|
3777
3789
|
return o.parent.forEach((a, c) => {
|
|
3778
3790
|
const l = i + c, u = l + a.nodeSize;
|
|
3779
3791
|
if (l < o.start || l >= o.end)
|
|
3780
3792
|
return;
|
|
3781
|
-
const d = new
|
|
3793
|
+
const d = new In(s.resolve(l), s.resolve(u));
|
|
3782
3794
|
r.push(d);
|
|
3783
3795
|
}), r;
|
|
3784
3796
|
}
|
|
@@ -3871,7 +3883,7 @@ function Ho(e = 0, t = 0, n = 0) {
|
|
|
3871
3883
|
function be(e) {
|
|
3872
3884
|
e.parentNode !== null && e.parentNode !== void 0 && e.parentNode.removeChild(e);
|
|
3873
3885
|
}
|
|
3874
|
-
const
|
|
3886
|
+
const tn = (e) => {
|
|
3875
3887
|
const { x: t, y: n, direction: r, editor: s } = e;
|
|
3876
3888
|
let o = null, i = null, a = null, c = t;
|
|
3877
3889
|
for (; i === null && c < window.innerWidth && c > 0; ) {
|
|
@@ -3888,7 +3900,7 @@ const Ze = (e) => {
|
|
|
3888
3900
|
return { resultElement: o, resultNode: i, pos: a !== null ? a : null };
|
|
3889
3901
|
};
|
|
3890
3902
|
function _o(e, t) {
|
|
3891
|
-
const { doc: n } = t.view.state, r =
|
|
3903
|
+
const { doc: n } = t.view.state, r = tn({ editor: t, x: e.clientX, y: e.clientY, direction: "right" });
|
|
3892
3904
|
if (!r.resultNode || r.pos === null)
|
|
3893
3905
|
return [];
|
|
3894
3906
|
const s = e.clientX, o = function(u, d, p) {
|
|
@@ -3915,14 +3927,14 @@ const Me = (e, t) => {
|
|
|
3915
3927
|
}
|
|
3916
3928
|
return o;
|
|
3917
3929
|
}, $t = (e, t) => {
|
|
3918
|
-
const n =
|
|
3919
|
-
return n ?
|
|
3930
|
+
const n = Dn.getState(e);
|
|
3931
|
+
return n ? Nn(t, n.type, n.binding.mapping) : null;
|
|
3920
3932
|
}, ke = (e, t) => {
|
|
3921
3933
|
let n = t;
|
|
3922
3934
|
for (; n && n.parentNode && n.parentNode !== e.dom; )
|
|
3923
3935
|
n = n.parentNode;
|
|
3924
3936
|
return n;
|
|
3925
|
-
}, $o = new _("dragHandle"),
|
|
3937
|
+
}, $o = new _("dragHandle"), xi = ({ pluginKey: e = $o, element: t, editor: n, tippyOptions: r, onNodeChange: s }) => {
|
|
3926
3938
|
const o = document.createElement("div");
|
|
3927
3939
|
let i = null, a = !1, c = null, l = -1;
|
|
3928
3940
|
return t.addEventListener("dragstart", (u) => {
|
|
@@ -3932,11 +3944,11 @@ const Me = (e, t) => {
|
|
|
3932
3944
|
const { empty: p, $from: h, $to: f } = d.state.selection, m = _o(u, n), g = Zt(h, f, 0), y = g.some((w) => m.find((O) => O.$from === w.$from && O.$to === w.$to)), k = p || !y ? m : g;
|
|
3933
3945
|
if (!k.length)
|
|
3934
3946
|
return;
|
|
3935
|
-
const { tr: b } = d.state, v = document.createElement("div"), E = k[0].$from.pos, M = k[k.length - 1].$to.pos,
|
|
3947
|
+
const { tr: b } = d.state, v = document.createElement("div"), E = k[0].$from.pos, M = k[k.length - 1].$to.pos, C = N.create(d.state.doc, E, M), A = C.content();
|
|
3936
3948
|
k.forEach((w) => {
|
|
3937
3949
|
const O = Po(d.nodeDOM(w.$from.pos));
|
|
3938
3950
|
v.append(O);
|
|
3939
|
-
}), v.style.position = "absolute", v.style.top = "-10000px", document.body.append(v), u.dataTransfer.clearData(), u.dataTransfer.setDragImage(v, 0, 0), d.dragging = { slice: A, move: !0 }, b.setSelection(
|
|
3951
|
+
}), v.style.position = "absolute", v.style.top = "-10000px", document.body.append(v), u.dataTransfer.clearData(), u.dataTransfer.setDragImage(v, 0, 0), d.dragging = { slice: A, move: !0 }, b.setSelection(C), d.dispatch(b), document.addEventListener("drop", () => be(v), { once: !0 }), setTimeout(() => {
|
|
3940
3952
|
t && (t.style.pointerEvents = "none");
|
|
3941
3953
|
}, 0);
|
|
3942
3954
|
}), t.addEventListener("dragend", () => {
|
|
@@ -3999,7 +4011,7 @@ const Me = (e, t) => {
|
|
|
3999
4011
|
mousemove(u, d) {
|
|
4000
4012
|
if (!t || !i || a)
|
|
4001
4013
|
return !1;
|
|
4002
|
-
const p =
|
|
4014
|
+
const p = tn({ x: d.clientX, y: d.clientY, direction: "right", editor: n });
|
|
4003
4015
|
if (!p.resultElement)
|
|
4004
4016
|
return !1;
|
|
4005
4017
|
let h = p.resultElement;
|
|
@@ -4015,7 +4027,7 @@ const Me = (e, t) => {
|
|
|
4015
4027
|
}
|
|
4016
4028
|
}
|
|
4017
4029
|
});
|
|
4018
|
-
}, Io = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Do = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, No = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Bo = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,
|
|
4030
|
+
}, Io = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, Do = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, No = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, Bo = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, Ai = D.create({
|
|
4019
4031
|
name: "italic",
|
|
4020
4032
|
addOptions() {
|
|
4021
4033
|
return {
|
|
@@ -4080,7 +4092,7 @@ const Me = (e, t) => {
|
|
|
4080
4092
|
})
|
|
4081
4093
|
];
|
|
4082
4094
|
}
|
|
4083
|
-
}),
|
|
4095
|
+
}), Oi = D.create({
|
|
4084
4096
|
name: "underline",
|
|
4085
4097
|
addOptions() {
|
|
4086
4098
|
return {
|
|
@@ -4115,7 +4127,7 @@ const Me = (e, t) => {
|
|
|
4115
4127
|
"Mod-U": () => this.editor.commands.toggleUnderline()
|
|
4116
4128
|
};
|
|
4117
4129
|
}
|
|
4118
|
-
}), jo = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Fo = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,
|
|
4130
|
+
}), jo = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, Fo = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, Li = D.create({
|
|
4119
4131
|
name: "strike",
|
|
4120
4132
|
addOptions() {
|
|
4121
4133
|
return {
|
|
@@ -4171,7 +4183,7 @@ const Me = (e, t) => {
|
|
|
4171
4183
|
})
|
|
4172
4184
|
];
|
|
4173
4185
|
}
|
|
4174
|
-
}), zo = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/, Wo = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,
|
|
4186
|
+
}), zo = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/, Wo = /(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g, Ri = D.create({
|
|
4175
4187
|
name: "code",
|
|
4176
4188
|
addOptions() {
|
|
4177
4189
|
return {
|
|
@@ -4217,7 +4229,7 @@ const Me = (e, t) => {
|
|
|
4217
4229
|
})
|
|
4218
4230
|
];
|
|
4219
4231
|
}
|
|
4220
|
-
}), Vo = /^```([a-z]+)?[\s\n]$/, Ko = /^~~~([a-z]+)?[\s\n]$/,
|
|
4232
|
+
}), Vo = /^```([a-z]+)?[\s\n]$/, Ko = /^~~~([a-z]+)?[\s\n]$/, Pi = R.create({
|
|
4221
4233
|
name: "codeBlock",
|
|
4222
4234
|
addOptions() {
|
|
4223
4235
|
return {
|
|
@@ -4344,7 +4356,7 @@ const Me = (e, t) => {
|
|
|
4344
4356
|
})
|
|
4345
4357
|
];
|
|
4346
4358
|
}
|
|
4347
|
-
}),
|
|
4359
|
+
}), Hi = D.create({
|
|
4348
4360
|
name: "textStyle",
|
|
4349
4361
|
priority: 101,
|
|
4350
4362
|
addOptions() {
|
|
@@ -4371,7 +4383,7 @@ const Me = (e, t) => {
|
|
|
4371
4383
|
}
|
|
4372
4384
|
};
|
|
4373
4385
|
}
|
|
4374
|
-
}),
|
|
4386
|
+
}), _i = P.create({
|
|
4375
4387
|
name: "fontFamily",
|
|
4376
4388
|
addOptions() {
|
|
4377
4389
|
return {
|
|
@@ -4403,7 +4415,7 @@ const Me = (e, t) => {
|
|
|
4403
4415
|
unsetFontFamily: () => ({ chain: e }) => e().setMark("textStyle", { fontFamily: null }).removeEmptyTextStyle().run()
|
|
4404
4416
|
};
|
|
4405
4417
|
}
|
|
4406
|
-
}),
|
|
4418
|
+
}), $i = R.create({
|
|
4407
4419
|
name: "heading",
|
|
4408
4420
|
addOptions() {
|
|
4409
4421
|
return {
|
|
@@ -4452,7 +4464,7 @@ const Me = (e, t) => {
|
|
|
4452
4464
|
}
|
|
4453
4465
|
}));
|
|
4454
4466
|
}
|
|
4455
|
-
}),
|
|
4467
|
+
}), Ii = P.create({
|
|
4456
4468
|
name: "textAlign",
|
|
4457
4469
|
addOptions() {
|
|
4458
4470
|
return {
|
|
@@ -4492,7 +4504,7 @@ const Me = (e, t) => {
|
|
|
4492
4504
|
"Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
|
|
4493
4505
|
};
|
|
4494
4506
|
}
|
|
4495
|
-
}),
|
|
4507
|
+
}), Di = P.create({
|
|
4496
4508
|
name: "color",
|
|
4497
4509
|
addOptions() {
|
|
4498
4510
|
return {
|
|
@@ -4524,7 +4536,7 @@ const Me = (e, t) => {
|
|
|
4524
4536
|
unsetColor: () => ({ chain: e }) => e().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
|
|
4525
4537
|
};
|
|
4526
4538
|
}
|
|
4527
|
-
}), qo = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Uo = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,
|
|
4539
|
+
}), qo = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, Uo = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, Ni = D.create({
|
|
4528
4540
|
name: "highlight",
|
|
4529
4541
|
addOptions() {
|
|
4530
4542
|
return {
|
|
@@ -4582,7 +4594,7 @@ const Me = (e, t) => {
|
|
|
4582
4594
|
})
|
|
4583
4595
|
];
|
|
4584
4596
|
}
|
|
4585
|
-
}), Go = "listItem", we = "textStyle", Ee = /^\s*([-+*])\s$/,
|
|
4597
|
+
}), Go = "listItem", we = "textStyle", Ee = /^\s*([-+*])\s$/, Bi = R.create({
|
|
4586
4598
|
name: "bulletList",
|
|
4587
4599
|
addOptions() {
|
|
4588
4600
|
return {
|
|
@@ -4630,7 +4642,7 @@ const Me = (e, t) => {
|
|
|
4630
4642
|
e
|
|
4631
4643
|
];
|
|
4632
4644
|
}
|
|
4633
|
-
}), Jo = "listItem", Te = "textStyle", Ce = /^(\d+)\.\s$/,
|
|
4645
|
+
}), Jo = "listItem", Te = "textStyle", Ce = /^(\d+)\.\s$/, ji = R.create({
|
|
4634
4646
|
name: "orderedList",
|
|
4635
4647
|
addOptions() {
|
|
4636
4648
|
return {
|
|
@@ -4696,7 +4708,7 @@ const Me = (e, t) => {
|
|
|
4696
4708
|
e
|
|
4697
4709
|
];
|
|
4698
4710
|
}
|
|
4699
|
-
}), Yo = /^\s*(\[([( |x])?\])\s$/,
|
|
4711
|
+
}), Yo = /^\s*(\[([( |x])?\])\s$/, Fi = R.create({
|
|
4700
4712
|
name: "taskItem",
|
|
4701
4713
|
addOptions() {
|
|
4702
4714
|
return {
|
|
@@ -4803,7 +4815,7 @@ const Me = (e, t) => {
|
|
|
4803
4815
|
})
|
|
4804
4816
|
];
|
|
4805
4817
|
}
|
|
4806
|
-
}),
|
|
4818
|
+
}), zi = R.create({
|
|
4807
4819
|
name: "taskList",
|
|
4808
4820
|
addOptions() {
|
|
4809
4821
|
return {
|
|
@@ -4836,7 +4848,7 @@ const Me = (e, t) => {
|
|
|
4836
4848
|
"Mod-Shift-9": () => this.editor.commands.toggleTaskList()
|
|
4837
4849
|
};
|
|
4838
4850
|
}
|
|
4839
|
-
}), Xo = /^\s*>\s$/,
|
|
4851
|
+
}), Xo = /^\s*>\s$/, Wi = R.create({
|
|
4840
4852
|
name: "blockquote",
|
|
4841
4853
|
addOptions() {
|
|
4842
4854
|
return {
|
|
@@ -4896,7 +4908,7 @@ function Zo(e) {
|
|
|
4896
4908
|
const f = h[h.length - 1], m = d.pos + p.lastIndexOf(f);
|
|
4897
4909
|
if (!f)
|
|
4898
4910
|
return !1;
|
|
4899
|
-
const g =
|
|
4911
|
+
const g = jn(f).map((y) => y.toObject(e.defaultProtocol));
|
|
4900
4912
|
if (!Qo(g))
|
|
4901
4913
|
return !1;
|
|
4902
4914
|
g.filter((y) => y.isLink).map((y) => ({
|
|
@@ -4928,7 +4940,7 @@ function ti(e) {
|
|
|
4928
4940
|
a.push(i), i = i.parentNode;
|
|
4929
4941
|
if (!a.find((p) => p.nodeName === "A"))
|
|
4930
4942
|
return !1;
|
|
4931
|
-
const c =
|
|
4943
|
+
const c = Ue(t.state, e.type.name), l = r.target, u = (s = l == null ? void 0 : l.href) !== null && s !== void 0 ? s : c.href, d = (o = l == null ? void 0 : l.target) !== null && o !== void 0 ? o : c.target;
|
|
4932
4944
|
return l && u ? (window.open(u, d), !0) : !1;
|
|
4933
4945
|
}
|
|
4934
4946
|
}
|
|
@@ -4962,7 +4974,7 @@ function xe(e, t) {
|
|
|
4962
4974
|
s && n.push(s);
|
|
4963
4975
|
}), !e || e.replace(ni, "").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`, "i"));
|
|
4964
4976
|
}
|
|
4965
|
-
const
|
|
4977
|
+
const Vi = D.create({
|
|
4966
4978
|
name: "link",
|
|
4967
4979
|
priority: 1e3,
|
|
4968
4980
|
keepOnSplit: !1,
|
|
@@ -4977,7 +4989,7 @@ const Wi = D.create({
|
|
|
4977
4989
|
});
|
|
4978
4990
|
},
|
|
4979
4991
|
onDestroy() {
|
|
4980
|
-
|
|
4992
|
+
Fn();
|
|
4981
4993
|
},
|
|
4982
4994
|
inclusive() {
|
|
4983
4995
|
return this.options.autolink;
|
|
@@ -5076,7 +5088,7 @@ const Wi = D.create({
|
|
|
5076
5088
|
type: this.type
|
|
5077
5089
|
})), e;
|
|
5078
5090
|
}
|
|
5079
|
-
}),
|
|
5091
|
+
}), Ki = R.create({
|
|
5080
5092
|
name: "horizontalRule",
|
|
5081
5093
|
addOptions() {
|
|
5082
5094
|
return {
|
|
@@ -5099,7 +5111,7 @@ const Wi = D.create({
|
|
|
5099
5111
|
to: s.pos
|
|
5100
5112
|
}, {
|
|
5101
5113
|
type: this.name
|
|
5102
|
-
}) :
|
|
5114
|
+
}) : Ge(n) ? o.insertContentAt(s.pos, {
|
|
5103
5115
|
type: this.name
|
|
5104
5116
|
}) : o.insertContent({ type: this.name }), o.command(({ tr: i, dispatch: a }) => {
|
|
5105
5117
|
var c;
|
|
@@ -5120,13 +5132,13 @@ const Wi = D.create({
|
|
|
5120
5132
|
},
|
|
5121
5133
|
addInputRules() {
|
|
5122
5134
|
return [
|
|
5123
|
-
|
|
5135
|
+
Je({
|
|
5124
5136
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
5125
5137
|
type: this.type
|
|
5126
5138
|
})
|
|
5127
5139
|
];
|
|
5128
5140
|
}
|
|
5129
|
-
}),
|
|
5141
|
+
}), qi = P.create({
|
|
5130
5142
|
name: "history",
|
|
5131
5143
|
addOptions() {
|
|
5132
5144
|
return {
|
|
@@ -5136,13 +5148,13 @@ const Wi = D.create({
|
|
|
5136
5148
|
},
|
|
5137
5149
|
addCommands() {
|
|
5138
5150
|
return {
|
|
5139
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
5140
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
5151
|
+
undo: () => ({ state: e, dispatch: t }) => zn(e, t),
|
|
5152
|
+
redo: () => ({ state: e, dispatch: t }) => Wn(e, t)
|
|
5141
5153
|
};
|
|
5142
5154
|
},
|
|
5143
5155
|
addProseMirrorPlugins() {
|
|
5144
5156
|
return [
|
|
5145
|
-
|
|
5157
|
+
Vn(this.options)
|
|
5146
5158
|
];
|
|
5147
5159
|
},
|
|
5148
5160
|
addKeyboardShortcuts() {
|
|
@@ -5155,7 +5167,7 @@ const Wi = D.create({
|
|
|
5155
5167
|
"Shift-Mod-я": () => this.editor.commands.redo()
|
|
5156
5168
|
};
|
|
5157
5169
|
}
|
|
5158
|
-
}),
|
|
5170
|
+
}), Ui = P.create({
|
|
5159
5171
|
name: "characterCount",
|
|
5160
5172
|
addOptions() {
|
|
5161
5173
|
return {
|
|
@@ -5203,7 +5215,7 @@ const Wi = D.create({
|
|
|
5203
5215
|
})
|
|
5204
5216
|
];
|
|
5205
5217
|
}
|
|
5206
|
-
}),
|
|
5218
|
+
}), Gi = P.create({
|
|
5207
5219
|
name: "dropCursor",
|
|
5208
5220
|
addOptions() {
|
|
5209
5221
|
return {
|
|
@@ -5214,10 +5226,10 @@ const Wi = D.create({
|
|
|
5214
5226
|
},
|
|
5215
5227
|
addProseMirrorPlugins() {
|
|
5216
5228
|
return [
|
|
5217
|
-
|
|
5229
|
+
Kn(this.options)
|
|
5218
5230
|
];
|
|
5219
5231
|
}
|
|
5220
|
-
}),
|
|
5232
|
+
}), Ji = P.create({
|
|
5221
5233
|
name: "focus",
|
|
5222
5234
|
addOptions() {
|
|
5223
5235
|
return {
|
|
@@ -5257,11 +5269,11 @@ const Wi = D.create({
|
|
|
5257
5269
|
})
|
|
5258
5270
|
];
|
|
5259
5271
|
}
|
|
5260
|
-
}),
|
|
5272
|
+
}), Yi = P.create({
|
|
5261
5273
|
name: "gapCursor",
|
|
5262
5274
|
addProseMirrorPlugins() {
|
|
5263
5275
|
return [
|
|
5264
|
-
|
|
5276
|
+
qn()
|
|
5265
5277
|
];
|
|
5266
5278
|
},
|
|
5267
5279
|
extendNodeSchema(e) {
|
|
@@ -5272,10 +5284,10 @@ const Wi = D.create({
|
|
|
5272
5284
|
storage: e.storage
|
|
5273
5285
|
};
|
|
5274
5286
|
return {
|
|
5275
|
-
allowGapCursor: (t =
|
|
5287
|
+
allowGapCursor: (t = T(S(e, "allowGapCursor", n))) !== null && t !== void 0 ? t : null
|
|
5276
5288
|
};
|
|
5277
5289
|
}
|
|
5278
|
-
}),
|
|
5290
|
+
}), Xi = R.create({
|
|
5279
5291
|
name: "hardBreak",
|
|
5280
5292
|
addOptions() {
|
|
5281
5293
|
return {
|
|
@@ -5324,7 +5336,7 @@ const Wi = D.create({
|
|
|
5324
5336
|
"Shift-Enter": () => this.editor.commands.setHardBreak()
|
|
5325
5337
|
};
|
|
5326
5338
|
}
|
|
5327
|
-
}),
|
|
5339
|
+
}), Qi = R.create({
|
|
5328
5340
|
name: "listItem",
|
|
5329
5341
|
addOptions() {
|
|
5330
5342
|
return {
|
|
@@ -5352,7 +5364,7 @@ const Wi = D.create({
|
|
|
5352
5364
|
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
5353
5365
|
};
|
|
5354
5366
|
}
|
|
5355
|
-
}),
|
|
5367
|
+
}), Zi = R.create({
|
|
5356
5368
|
name: "paragraph",
|
|
5357
5369
|
priority: 1e3,
|
|
5358
5370
|
addOptions() {
|
|
@@ -5380,7 +5392,7 @@ const Wi = D.create({
|
|
|
5380
5392
|
"Mod-Alt-0": () => this.editor.commands.setParagraph()
|
|
5381
5393
|
};
|
|
5382
5394
|
}
|
|
5383
|
-
}),
|
|
5395
|
+
}), ta = P.create({
|
|
5384
5396
|
name: "placeholder",
|
|
5385
5397
|
addOptions() {
|
|
5386
5398
|
return {
|
|
@@ -5425,14 +5437,14 @@ const Wi = D.create({
|
|
|
5425
5437
|
})
|
|
5426
5438
|
];
|
|
5427
5439
|
}
|
|
5428
|
-
}),
|
|
5440
|
+
}), ea = R.create({
|
|
5429
5441
|
name: "text",
|
|
5430
5442
|
group: "inline"
|
|
5431
|
-
}),
|
|
5443
|
+
}), na = R.create({
|
|
5432
5444
|
name: "doc",
|
|
5433
5445
|
topNode: !0,
|
|
5434
5446
|
content: "block+"
|
|
5435
|
-
}),
|
|
5447
|
+
}), ra = D.create({
|
|
5436
5448
|
name: "subscript",
|
|
5437
5449
|
addOptions() {
|
|
5438
5450
|
return {
|
|
@@ -5467,7 +5479,7 @@ const Wi = D.create({
|
|
|
5467
5479
|
"Mod-,": () => this.editor.commands.toggleSubscript()
|
|
5468
5480
|
};
|
|
5469
5481
|
}
|
|
5470
|
-
}),
|
|
5482
|
+
}), sa = D.create({
|
|
5471
5483
|
name: "superscript",
|
|
5472
5484
|
addOptions() {
|
|
5473
5485
|
return {
|
|
@@ -5533,7 +5545,7 @@ function oi({ pluginKey: e = si, editor: t, char: n = "@", allowSpaces: r = !1,
|
|
|
5533
5545
|
view() {
|
|
5534
5546
|
return {
|
|
5535
5547
|
update: async (g, y) => {
|
|
5536
|
-
var k, b, v, E, M,
|
|
5548
|
+
var k, b, v, E, M, C, A;
|
|
5537
5549
|
const w = (k = this.key) === null || k === void 0 ? void 0 : k.getState(y), O = (b = this.key) === null || b === void 0 ? void 0 : b.getState(g.state), B = w.active && O.active && w.range.from !== O.range.from, F = !w.active && O.active, X = w.active && !O.active, q = !F && !X && w.query !== O.query, U = F || B && q, z = q || B, G = X || B && q;
|
|
5538
5550
|
if (!U && !z && !G)
|
|
5539
5551
|
return;
|
|
@@ -5554,13 +5566,13 @@ function oi({ pluginKey: e = si, editor: t, char: n = "@", allowSpaces: r = !1,
|
|
|
5554
5566
|
// this can be used for building popups without a DOM node
|
|
5555
5567
|
clientRect: ee ? () => {
|
|
5556
5568
|
var nt;
|
|
5557
|
-
const { decorationId:
|
|
5569
|
+
const { decorationId: en } = (nt = this.key) === null || nt === void 0 ? void 0 : nt.getState(t.state), Ct = g.dom.querySelector(`[data-decoration-id="${en}"]`);
|
|
5558
5570
|
return (Ct == null ? void 0 : Ct.getBoundingClientRect()) || null;
|
|
5559
5571
|
} : null
|
|
5560
5572
|
}, U && ((v = f == null ? void 0 : f.onBeforeStart) === null || v === void 0 || v.call(f, h)), z && ((E = f == null ? void 0 : f.onBeforeUpdate) === null || E === void 0 || E.call(f, h)), (z || U) && (h.items = await l({
|
|
5561
5573
|
editor: t,
|
|
5562
5574
|
query: Q.query
|
|
5563
|
-
})), G && ((M = f == null ? void 0 : f.onExit) === null || M === void 0 || M.call(f, h)), z && ((
|
|
5575
|
+
})), G && ((M = f == null ? void 0 : f.onExit) === null || M === void 0 || M.call(f, h)), z && ((C = f == null ? void 0 : f.onUpdate) === null || C === void 0 || C.call(f, h)), U && ((A = f == null ? void 0 : f.onStart) === null || A === void 0 || A.call(f, h));
|
|
5564
5576
|
},
|
|
5565
5577
|
destroy: () => {
|
|
5566
5578
|
var g;
|
|
@@ -5584,8 +5596,8 @@ function oi({ pluginKey: e = si, editor: t, char: n = "@", allowSpaces: r = !1,
|
|
|
5584
5596
|
},
|
|
5585
5597
|
// Apply changes to the plugin state from a view transaction.
|
|
5586
5598
|
apply(g, y, k, b) {
|
|
5587
|
-
const { isEditable: v } = t, { composing: E } = t.view, { selection: M } = g, { empty:
|
|
5588
|
-
if (w.composing = E, v && (
|
|
5599
|
+
const { isEditable: v } = t, { composing: E } = t.view, { selection: M } = g, { empty: C, from: A } = M, w = { ...y };
|
|
5600
|
+
if (w.composing = E, v && (C || t.view.composing)) {
|
|
5589
5601
|
(A < y.range.from || A > y.range.to) && !E && !y.composing && (w.active = !1);
|
|
5590
5602
|
const O = p({
|
|
5591
5603
|
char: n,
|
|
@@ -5627,7 +5639,7 @@ function oi({ pluginKey: e = si, editor: t, char: n = "@", allowSpaces: r = !1,
|
|
|
5627
5639
|
});
|
|
5628
5640
|
return m;
|
|
5629
5641
|
}
|
|
5630
|
-
const ii = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,
|
|
5642
|
+
const ii = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, oa = R.create({
|
|
5631
5643
|
name: "image",
|
|
5632
5644
|
addOptions() {
|
|
5633
5645
|
return {
|
|
@@ -5676,7 +5688,7 @@ const ii = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, sa = R.cr
|
|
|
5676
5688
|
},
|
|
5677
5689
|
addInputRules() {
|
|
5678
5690
|
return [
|
|
5679
|
-
|
|
5691
|
+
Je({
|
|
5680
5692
|
find: ii,
|
|
5681
5693
|
type: this.type,
|
|
5682
5694
|
getAttributes: (e) => {
|
|
@@ -5686,7 +5698,7 @@ const ii = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, sa = R.cr
|
|
|
5686
5698
|
})
|
|
5687
5699
|
];
|
|
5688
5700
|
}
|
|
5689
|
-
}),
|
|
5701
|
+
}), ia = R.create({
|
|
5690
5702
|
name: "tableRow",
|
|
5691
5703
|
addOptions() {
|
|
5692
5704
|
return {
|
|
@@ -5780,13 +5792,13 @@ const ct = ({ editor: e }) => {
|
|
|
5780
5792
|
if (!ui(t))
|
|
5781
5793
|
return !1;
|
|
5782
5794
|
let n = 0;
|
|
5783
|
-
const r =
|
|
5795
|
+
const r = qe(t.ranges[0].$from, (o) => o.type.name === "table");
|
|
5784
5796
|
return r == null || r.node.descendants((o) => {
|
|
5785
5797
|
if (o.type.name === "table")
|
|
5786
5798
|
return !1;
|
|
5787
5799
|
["tableCell", "tableHeader"].includes(o.type.name) && (n += 1);
|
|
5788
5800
|
}), n === t.ranges.length ? (e.commands.deleteTable(), !0) : !1;
|
|
5789
|
-
},
|
|
5801
|
+
}, aa = R.create({
|
|
5790
5802
|
name: "table",
|
|
5791
5803
|
// @ts-ignore
|
|
5792
5804
|
addOptions() {
|
|
@@ -5829,23 +5841,23 @@ const ct = ({ editor: e }) => {
|
|
|
5829
5841
|
}
|
|
5830
5842
|
return !0;
|
|
5831
5843
|
},
|
|
5832
|
-
addColumnBefore: () => ({ state: e, dispatch: t }) =>
|
|
5833
|
-
addColumnAfter: () => ({ state: e, dispatch: t }) =>
|
|
5834
|
-
deleteColumn: () => ({ state: e, dispatch: t }) =>
|
|
5835
|
-
addRowBefore: () => ({ state: e, dispatch: t }) =>
|
|
5836
|
-
addRowAfter: () => ({ state: e, dispatch: t }) =>
|
|
5837
|
-
deleteRow: () => ({ state: e, dispatch: t }) =>
|
|
5838
|
-
deleteTable: () => ({ state: e, dispatch: t }) =>
|
|
5844
|
+
addColumnBefore: () => ({ state: e, dispatch: t }) => Un(e, t),
|
|
5845
|
+
addColumnAfter: () => ({ state: e, dispatch: t }) => Gn(e, t),
|
|
5846
|
+
deleteColumn: () => ({ state: e, dispatch: t }) => Jn(e, t),
|
|
5847
|
+
addRowBefore: () => ({ state: e, dispatch: t }) => Yn(e, t),
|
|
5848
|
+
addRowAfter: () => ({ state: e, dispatch: t }) => Xn(e, t),
|
|
5849
|
+
deleteRow: () => ({ state: e, dispatch: t }) => Qn(e, t),
|
|
5850
|
+
deleteTable: () => ({ state: e, dispatch: t }) => Zn(e, t),
|
|
5839
5851
|
mergeCells: () => ({ state: e, dispatch: t }) => se(e, t),
|
|
5840
5852
|
splitCell: () => ({ state: e, dispatch: t }) => oe(e, t),
|
|
5841
5853
|
toggleHeaderColumn: () => ({ state: e, dispatch: t }) => ie("column")(e, t),
|
|
5842
5854
|
toggleHeaderRow: () => ({ state: e, dispatch: t }) => ie("row")(e, t),
|
|
5843
|
-
toggleHeaderCell: () => ({ state: e, dispatch: t }) =>
|
|
5855
|
+
toggleHeaderCell: () => ({ state: e, dispatch: t }) => tr(e, t),
|
|
5844
5856
|
mergeOrSplit: () => ({ state: e, dispatch: t }) => se(e, t) ? !0 : oe(e, t),
|
|
5845
|
-
setCellAttribute: (e, t) => ({ state: n, dispatch: r }) =>
|
|
5857
|
+
setCellAttribute: (e, t) => ({ state: n, dispatch: r }) => er(e, t)(n, r),
|
|
5846
5858
|
goToNextCell: () => ({ state: e, dispatch: t }) => ae(1)(e, t),
|
|
5847
5859
|
goToPreviousCell: () => ({ state: e, dispatch: t }) => ae(-1)(e, t),
|
|
5848
|
-
fixTables: () => ({ state: e, dispatch: t }) => (t &&
|
|
5860
|
+
fixTables: () => ({ state: e, dispatch: t }) => (t && nr(e), !0),
|
|
5849
5861
|
setCellSelection: (e) => ({ tr: t, dispatch: n }) => {
|
|
5850
5862
|
if (n) {
|
|
5851
5863
|
const r = _e.create(t.doc, e.anchorCell, e.headCell);
|
|
@@ -5868,14 +5880,14 @@ const ct = ({ editor: e }) => {
|
|
|
5868
5880
|
addProseMirrorPlugins() {
|
|
5869
5881
|
return [
|
|
5870
5882
|
...this.options.resizable && this.editor.isEditable ? [
|
|
5871
|
-
|
|
5883
|
+
rr({
|
|
5872
5884
|
handleWidth: this.options.handleWidth,
|
|
5873
5885
|
cellMinWidth: this.options.cellMinWidth,
|
|
5874
5886
|
View: this.options.View,
|
|
5875
5887
|
lastColumnResizable: this.options.lastColumnResizable
|
|
5876
5888
|
})
|
|
5877
5889
|
] : [],
|
|
5878
|
-
|
|
5890
|
+
sr({
|
|
5879
5891
|
allowTableNodeSelection: this.options.allowTableNodeSelection
|
|
5880
5892
|
})
|
|
5881
5893
|
];
|
|
@@ -5887,10 +5899,10 @@ const ct = ({ editor: e }) => {
|
|
|
5887
5899
|
storage: e.storage
|
|
5888
5900
|
};
|
|
5889
5901
|
return {
|
|
5890
|
-
tableRole:
|
|
5902
|
+
tableRole: T(S(e, "tableRole", t))
|
|
5891
5903
|
};
|
|
5892
5904
|
}
|
|
5893
|
-
}),
|
|
5905
|
+
}), la = R.create({
|
|
5894
5906
|
name: "tableCell",
|
|
5895
5907
|
addOptions() {
|
|
5896
5908
|
return {
|
|
@@ -5925,7 +5937,7 @@ const ct = ({ editor: e }) => {
|
|
|
5925
5937
|
renderHTML({ HTMLAttributes: e }) {
|
|
5926
5938
|
return ["td", x(this.options.HTMLAttributes, e), 0];
|
|
5927
5939
|
}
|
|
5928
|
-
}),
|
|
5940
|
+
}), ca = R.create({
|
|
5929
5941
|
name: "tableHeader",
|
|
5930
5942
|
addOptions() {
|
|
5931
5943
|
return {
|
|
@@ -5960,7 +5972,7 @@ const ct = ({ editor: e }) => {
|
|
|
5960
5972
|
renderHTML({ HTMLAttributes: e }) {
|
|
5961
5973
|
return ["th", x(this.options.HTMLAttributes, e), 0];
|
|
5962
5974
|
}
|
|
5963
|
-
}), pi = new _("mention"),
|
|
5975
|
+
}), pi = new _("mention"), da = R.create({
|
|
5964
5976
|
name: "mention",
|
|
5965
5977
|
priority: 101,
|
|
5966
5978
|
addOptions() {
|
|
@@ -6085,62 +6097,63 @@ const ct = ({ editor: e }) => {
|
|
|
6085
6097
|
}
|
|
6086
6098
|
});
|
|
6087
6099
|
export {
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6100
|
+
ia as $,
|
|
6101
|
+
Ui as A,
|
|
6102
|
+
wi as B,
|
|
6103
|
+
Ri as C,
|
|
6104
|
+
xi as D,
|
|
6105
|
+
Si as E,
|
|
6106
|
+
_i as F,
|
|
6107
|
+
Yi as G,
|
|
6108
|
+
$i as H,
|
|
6109
|
+
Ai as I,
|
|
6110
|
+
Zi as J,
|
|
6111
|
+
Xi as K,
|
|
6112
|
+
Vi as L,
|
|
6113
|
+
Qi as M,
|
|
6114
|
+
Ti as N,
|
|
6115
|
+
ji as O,
|
|
6116
|
+
ta as P,
|
|
6117
|
+
Hi as Q,
|
|
6118
|
+
Ci as R,
|
|
6119
|
+
Li as S,
|
|
6120
|
+
Ii as T,
|
|
6121
|
+
Oi as U,
|
|
6122
|
+
ra as V,
|
|
6123
|
+
sa as W,
|
|
6112
6124
|
oi as X,
|
|
6113
6125
|
Lo as Y,
|
|
6114
|
-
|
|
6115
|
-
|
|
6126
|
+
oa as Z,
|
|
6127
|
+
aa as _,
|
|
6116
6128
|
R as a,
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6129
|
+
ca as a0,
|
|
6130
|
+
la as a1,
|
|
6131
|
+
da as a2,
|
|
6132
|
+
yr as a3,
|
|
6133
|
+
bi as a4,
|
|
6121
6134
|
ws as b,
|
|
6122
|
-
|
|
6135
|
+
Mi as c,
|
|
6123
6136
|
$o as d,
|
|
6124
|
-
|
|
6137
|
+
Ei as e,
|
|
6125
6138
|
vi as f,
|
|
6126
|
-
|
|
6139
|
+
Pi as g,
|
|
6127
6140
|
P as h,
|
|
6128
6141
|
pe as i,
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6142
|
+
Di as j,
|
|
6143
|
+
Ni as k,
|
|
6144
|
+
Bi as l,
|
|
6132
6145
|
x as m,
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6146
|
+
Je as n,
|
|
6147
|
+
zi as o,
|
|
6148
|
+
Fi as p,
|
|
6149
|
+
Wi as q,
|
|
6137
6150
|
Gt as r,
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6151
|
+
Ki as s,
|
|
6152
|
+
qi as t,
|
|
6153
|
+
ki as u,
|
|
6154
|
+
na as v,
|
|
6142
6155
|
Xt as w,
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6156
|
+
Ji as x,
|
|
6157
|
+
ea as y,
|
|
6158
|
+
Gi as z
|
|
6146
6159
|
};
|