bi-components-library 1.3.8-next.2 → 1.3.8-next.3
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/index.es.js +195 -190
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -34499,12 +34499,12 @@ class Un {
|
|
|
34499
34499
|
function ZS(e) {
|
|
34500
34500
|
return typeof e == "number";
|
|
34501
34501
|
}
|
|
34502
|
-
class
|
|
34502
|
+
class e8 {
|
|
34503
34503
|
constructor(t) {
|
|
34504
34504
|
this.find = t.find, this.handler = t.handler;
|
|
34505
34505
|
}
|
|
34506
34506
|
}
|
|
34507
|
-
const
|
|
34507
|
+
const t8 = (e, t, n) => {
|
|
34508
34508
|
if (Vu(t))
|
|
34509
34509
|
return [...e.matchAll(t)];
|
|
34510
34510
|
const r = t(e, n);
|
|
@@ -34513,7 +34513,7 @@ const tk = (e, t, n) => {
|
|
|
34513
34513
|
return a.index = l.index, a.input = e, a.data = l.data, l.replaceWith && (l.text.includes(l.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), a.push(l.replaceWith)), a;
|
|
34514
34514
|
}) : [];
|
|
34515
34515
|
};
|
|
34516
|
-
function
|
|
34516
|
+
function n8(e) {
|
|
34517
34517
|
const { editor: t, state: n, from: r, to: l, rule: a, pasteEvent: i, dropEvent: s } = e, { commands: o, chain: u, can: c } = new Fi({
|
|
34518
34518
|
editor: t,
|
|
34519
34519
|
state: n
|
|
@@ -34522,7 +34522,7 @@ function nk(e) {
|
|
|
34522
34522
|
if (!f.isTextblock || f.type.spec.code)
|
|
34523
34523
|
return;
|
|
34524
34524
|
const g = Math.max(r, m), b = Math.min(l, m + f.content.size), y = f.textBetween(g - m, b - m, void 0, "");
|
|
34525
|
-
|
|
34525
|
+
t8(y, a.find, i).forEach((C) => {
|
|
34526
34526
|
if (C.index === void 0)
|
|
34527
34527
|
return;
|
|
34528
34528
|
const I = g + C.index + 1, M = I + C[0].length, x = {
|
|
@@ -34543,14 +34543,14 @@ function nk(e) {
|
|
|
34543
34543
|
}), d.every((f) => f !== null);
|
|
34544
34544
|
}
|
|
34545
34545
|
let La = null;
|
|
34546
|
-
const
|
|
34546
|
+
const r8 = (e) => {
|
|
34547
34547
|
var t;
|
|
34548
34548
|
const n = new ClipboardEvent("paste", {
|
|
34549
34549
|
clipboardData: new DataTransfer()
|
|
34550
34550
|
});
|
|
34551
34551
|
return (t = n.clipboardData) === null || t === void 0 || t.setData("text/html", e), n;
|
|
34552
34552
|
};
|
|
34553
|
-
function
|
|
34553
|
+
function l8(e) {
|
|
34554
34554
|
const { editor: t, rules: n } = e;
|
|
34555
34555
|
let r = null, l = !1, a = !1, i = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, s;
|
|
34556
34556
|
try {
|
|
@@ -34563,7 +34563,7 @@ function lk(e) {
|
|
|
34563
34563
|
state: c,
|
|
34564
34564
|
transaction: g
|
|
34565
34565
|
});
|
|
34566
|
-
if (!(!
|
|
34566
|
+
if (!(!n8({
|
|
34567
34567
|
editor: t,
|
|
34568
34568
|
state: b,
|
|
34569
34569
|
from: Math.max(d - 1, 0),
|
|
@@ -34621,7 +34621,7 @@ function lk(e) {
|
|
|
34621
34621
|
if (A) {
|
|
34622
34622
|
let { text: M } = y;
|
|
34623
34623
|
typeof M == "string" ? M = M : M = zu(X.from(M), f.schema);
|
|
34624
|
-
const { from: x } = y, w = x + M.length, N =
|
|
34624
|
+
const { from: x } = y, w = x + M.length, N = r8(M);
|
|
34625
34625
|
return o({
|
|
34626
34626
|
rule: c,
|
|
34627
34627
|
state: f,
|
|
@@ -34642,7 +34642,7 @@ function lk(e) {
|
|
|
34642
34642
|
}
|
|
34643
34643
|
}));
|
|
34644
34644
|
}
|
|
34645
|
-
function
|
|
34645
|
+
function a8(e) {
|
|
34646
34646
|
const t = e.filter((n, r) => e.indexOf(n) !== r);
|
|
34647
34647
|
return Array.from(new Set(t));
|
|
34648
34648
|
}
|
|
@@ -34657,7 +34657,7 @@ class Fr {
|
|
|
34657
34657
|
* @returns An flattened and sorted array of Tiptap extensions
|
|
34658
34658
|
*/
|
|
34659
34659
|
static resolve(t) {
|
|
34660
|
-
const n = Fr.sort(Fr.flatten(t)), r =
|
|
34660
|
+
const n = Fr.sort(Fr.flatten(t)), r = a8(n.map((l) => l.name));
|
|
34661
34661
|
return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((l) => `'${l}'`).join(", ")}]. This can lead to issues.`), n;
|
|
34662
34662
|
}
|
|
34663
34663
|
/**
|
|
@@ -34741,7 +34741,7 @@ class Fr {
|
|
|
34741
34741
|
editor: t,
|
|
34742
34742
|
rules: r
|
|
34743
34743
|
}),
|
|
34744
|
-
...
|
|
34744
|
+
...l8({
|
|
34745
34745
|
editor: t,
|
|
34746
34746
|
rules: l
|
|
34747
34747
|
}),
|
|
@@ -34868,7 +34868,7 @@ function n1(e, t, n) {
|
|
|
34868
34868
|
function r1(e) {
|
|
34869
34869
|
return Object.fromEntries(Object.entries(e.nodes).filter(([, t]) => t.spec.toText).map(([t, n]) => [t, n.spec.toText]));
|
|
34870
34870
|
}
|
|
34871
|
-
const
|
|
34871
|
+
const i8 = mt.create({
|
|
34872
34872
|
name: "clipboardTextSerializer",
|
|
34873
34873
|
addOptions() {
|
|
34874
34874
|
return {
|
|
@@ -34891,10 +34891,10 @@ const ik = mt.create({
|
|
|
34891
34891
|
})
|
|
34892
34892
|
];
|
|
34893
34893
|
}
|
|
34894
|
-
}),
|
|
34894
|
+
}), s8 = () => ({ editor: e, view: t }) => (requestAnimationFrame(() => {
|
|
34895
34895
|
var n;
|
|
34896
34896
|
e.isDestroyed || (t.dom.blur(), (n = window?.getSelection()) === null || n === void 0 || n.removeAllRanges());
|
|
34897
|
-
}), !0),
|
|
34897
|
+
}), !0), o8 = (e = !1) => ({ commands: t }) => t.setContent("", e), u8 = () => ({ state: e, tr: t, dispatch: n }) => {
|
|
34898
34898
|
const { selection: r } = t, { ranges: l } = r;
|
|
34899
34899
|
return n && l.forEach(({ $from: a, $to: i }) => {
|
|
34900
34900
|
e.doc.nodesBetween(a.pos, i.pos, (s, o) => {
|
|
@@ -34911,12 +34911,12 @@ const ik = mt.create({
|
|
|
34911
34911
|
(m || m === 0) && t.lift(f, m);
|
|
34912
34912
|
});
|
|
34913
34913
|
}), !0;
|
|
34914
|
-
},
|
|
34914
|
+
}, c8 = (e) => (t) => e(t), d8 = () => ({ state: e, dispatch: t }) => Qm(e, t), f8 = (e, t) => ({ editor: n, tr: r }) => {
|
|
34915
34915
|
const { state: l } = n, a = l.doc.slice(e.from, e.to);
|
|
34916
34916
|
r.deleteRange(e.from, e.to);
|
|
34917
34917
|
const i = r.mapping.map(t);
|
|
34918
34918
|
return r.insert(i, a.content), r.setSelection(new Ee(r.doc.resolve(Math.max(i - 1, 0)))), !0;
|
|
34919
|
-
},
|
|
34919
|
+
}, h8 = () => ({ tr: e, dispatch: t }) => {
|
|
34920
34920
|
const { selection: n } = e, r = n.$anchor.node();
|
|
34921
34921
|
if (r.content.size > 0)
|
|
34922
34922
|
return !1;
|
|
@@ -34930,7 +34930,7 @@ const ik = mt.create({
|
|
|
34930
34930
|
return !0;
|
|
34931
34931
|
}
|
|
34932
34932
|
return !1;
|
|
34933
|
-
},
|
|
34933
|
+
}, p8 = (e) => ({ tr: t, state: n, dispatch: r }) => {
|
|
34934
34934
|
const l = st(e, n.schema), a = t.selection.$anchor;
|
|
34935
34935
|
for (let i = a.depth; i > 0; i -= 1)
|
|
34936
34936
|
if (a.node(i).type === l) {
|
|
@@ -34941,10 +34941,10 @@ const ik = mt.create({
|
|
|
34941
34941
|
return !0;
|
|
34942
34942
|
}
|
|
34943
34943
|
return !1;
|
|
34944
|
-
},
|
|
34944
|
+
}, m8 = (e) => ({ tr: t, dispatch: n }) => {
|
|
34945
34945
|
const { from: r, to: l } = e;
|
|
34946
34946
|
return n && t.delete(r, l), !0;
|
|
34947
|
-
},
|
|
34947
|
+
}, b8 = () => ({ state: e, dispatch: t }) => Pu(e, t), g8 = () => ({ commands: e }) => e.keyboardShortcut("Enter"), v8 = () => ({ state: e, dispatch: t }) => _S(e, t);
|
|
34948
34948
|
function mi(e, t, n = { strict: !0 }) {
|
|
34949
34949
|
const r = Object.keys(t);
|
|
34950
34950
|
return r.length ? r.every((l) => n.strict ? t[l] === e[l] : Vu(t[l]) ? t[l].test(e[l]) : t[l] === e[l]) : !0;
|
|
@@ -34984,7 +34984,7 @@ function jn(e, t) {
|
|
|
34984
34984
|
}
|
|
34985
34985
|
return e;
|
|
34986
34986
|
}
|
|
34987
|
-
const
|
|
34987
|
+
const y8 = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
34988
34988
|
const a = jn(e, r.schema), { doc: i, selection: s } = n, { $from: o, from: u, to: c } = s;
|
|
34989
34989
|
if (l) {
|
|
34990
34990
|
const d = $u(o, a, t);
|
|
@@ -34994,7 +34994,7 @@ const yk = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
|
34994
34994
|
}
|
|
34995
34995
|
}
|
|
34996
34996
|
return !0;
|
|
34997
|
-
},
|
|
34997
|
+
}, E8 = (e) => (t) => {
|
|
34998
34998
|
const n = typeof e == "function" ? e(t) : e;
|
|
34999
34999
|
for (let r = 0; r < n.length; r += 1)
|
|
35000
35000
|
if (n[r](t))
|
|
@@ -35031,17 +35031,17 @@ function bi() {
|
|
|
35031
35031
|
"iPod"
|
|
35032
35032
|
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
|
|
35033
35033
|
}
|
|
35034
|
-
function
|
|
35034
|
+
function T8() {
|
|
35035
35035
|
return typeof navigator < "u" ? /^((?!chrome|android).)*safari/i.test(navigator.userAgent) : !1;
|
|
35036
35036
|
}
|
|
35037
|
-
const
|
|
35037
|
+
const C8 = (e = null, t = {}) => ({ editor: n, view: r, tr: l, dispatch: a }) => {
|
|
35038
35038
|
t = {
|
|
35039
35039
|
scrollIntoView: !0,
|
|
35040
35040
|
...t
|
|
35041
35041
|
};
|
|
35042
35042
|
const i = () => {
|
|
35043
35043
|
(bi() || nh()) && r.dom.focus(), requestAnimationFrame(() => {
|
|
35044
|
-
n.isDestroyed || (r.focus(),
|
|
35044
|
+
n.isDestroyed || (r.focus(), T8() && !bi() && !nh() && r.dom.focus({ preventScroll: !0 }));
|
|
35045
35045
|
});
|
|
35046
35046
|
};
|
|
35047
35047
|
if (r.hasFocus() && e === null || e === !1)
|
|
@@ -35050,7 +35050,7 @@ const Ck = (e = null, t = {}) => ({ editor: n, view: r, tr: l, dispatch: a }) =>
|
|
|
35050
35050
|
return i(), !0;
|
|
35051
35051
|
const s = i1(l.doc, e) || n.state.selection, o = n.state.selection.eq(s);
|
|
35052
35052
|
return a && (o || l.setSelection(s), o && l.storedMarks && l.setStoredMarks(l.storedMarks), i()), !0;
|
|
35053
|
-
},
|
|
35053
|
+
}, x8 = (e, t) => (n) => e.every((r, l) => t(r, { ...n, index: l })), S8 = (e, t) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, e, t), s1 = (e) => {
|
|
35054
35054
|
const t = e.childNodes;
|
|
35055
35055
|
for (let n = t.length - 1; n >= 0; n -= 1) {
|
|
35056
35056
|
const r = t[n];
|
|
@@ -35111,7 +35111,7 @@ function Gl(e, t, n) {
|
|
|
35111
35111
|
}
|
|
35112
35112
|
return Gl("", t, n);
|
|
35113
35113
|
}
|
|
35114
|
-
function
|
|
35114
|
+
function k8(e, t, n) {
|
|
35115
35115
|
const r = e.steps.length - 1;
|
|
35116
35116
|
if (r < t)
|
|
35117
35117
|
return;
|
|
@@ -35124,7 +35124,7 @@ function kk(e, t, n) {
|
|
|
35124
35124
|
i === 0 && (i = c);
|
|
35125
35125
|
}), e.setSelection(Ae.near(e.doc.resolve(i), n));
|
|
35126
35126
|
}
|
|
35127
|
-
const
|
|
35127
|
+
const A8 = (e) => !("type" in e), N8 = (e, t, n) => ({ tr: r, dispatch: l, editor: a }) => {
|
|
35128
35128
|
var i;
|
|
35129
35129
|
if (l) {
|
|
35130
35130
|
n = {
|
|
@@ -35165,7 +35165,7 @@ const Ak = (e) => !("type" in e), Nk = (e, t, n) => ({ tr: r, dispatch: l, edito
|
|
|
35165
35165
|
return o(b), !1;
|
|
35166
35166
|
}
|
|
35167
35167
|
let { from: c, to: d } = typeof e == "number" ? { from: e, to: e } : { from: e.from, to: e.to }, h = !0, f = !0;
|
|
35168
|
-
if ((
|
|
35168
|
+
if ((A8(s) ? s : [s]).forEach((b) => {
|
|
35169
35169
|
b.check(), h = h ? b.isText && b.marks.length === 0 : !1, f = f ? b.isBlock : !1;
|
|
35170
35170
|
}), c === d && f) {
|
|
35171
35171
|
const { parent: b } = r.doc.resolve(c);
|
|
@@ -35184,28 +35184,28 @@ const Ak = (e) => !("type" in e), Nk = (e, t, n) => ({ tr: r, dispatch: l, edito
|
|
|
35184
35184
|
r.insertText(g, c, d);
|
|
35185
35185
|
} else
|
|
35186
35186
|
g = s, r.replaceWith(c, d, g);
|
|
35187
|
-
n.updateSelection &&
|
|
35187
|
+
n.updateSelection && k8(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: c, text: g }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: c, text: g });
|
|
35188
35188
|
}
|
|
35189
35189
|
return !0;
|
|
35190
|
-
},
|
|
35190
|
+
}, w8 = () => ({ state: e, dispatch: t }) => NS(e, t), I8 = () => ({ state: e, dispatch: t }) => wS(e, t), _8 = () => ({ state: e, dispatch: t }) => $m(e, t), O8 = () => ({ state: e, dispatch: t }) => jm(e, t), M8 = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
35191
35191
|
try {
|
|
35192
35192
|
const r = Oi(e.doc, e.selection.$from.pos, -1);
|
|
35193
35193
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
35194
35194
|
} catch {
|
|
35195
35195
|
return !1;
|
|
35196
35196
|
}
|
|
35197
|
-
},
|
|
35197
|
+
}, R8 = () => ({ state: e, dispatch: t, tr: n }) => {
|
|
35198
35198
|
try {
|
|
35199
35199
|
const r = Oi(e.doc, e.selection.$from.pos, 1);
|
|
35200
35200
|
return r == null ? !1 : (n.join(r, 2), t && t(n), !0);
|
|
35201
35201
|
} catch {
|
|
35202
35202
|
return !1;
|
|
35203
35203
|
}
|
|
35204
|
-
},
|
|
35204
|
+
}, D8 = () => ({ state: e, dispatch: t }) => kS(e, t), L8 = () => ({ state: e, dispatch: t }) => AS(e, t);
|
|
35205
35205
|
function o1() {
|
|
35206
35206
|
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
|
|
35207
35207
|
}
|
|
35208
|
-
function
|
|
35208
|
+
function P8(e) {
|
|
35209
35209
|
const t = e.split(/-(?!$)/);
|
|
35210
35210
|
let n = t[t.length - 1];
|
|
35211
35211
|
n === "Space" && (n = " ");
|
|
@@ -35227,8 +35227,8 @@ function Pk(e) {
|
|
|
35227
35227
|
}
|
|
35228
35228
|
return r && (n = `Alt-${n}`), l && (n = `Ctrl-${n}`), i && (n = `Meta-${n}`), a && (n = `Shift-${n}`), n;
|
|
35229
35229
|
}
|
|
35230
|
-
const
|
|
35231
|
-
const a =
|
|
35230
|
+
const B8 = (e) => ({ editor: t, view: n, tr: r, dispatch: l }) => {
|
|
35231
|
+
const a = P8(e).split(/-(?!$)/), i = a.find((u) => !["Alt", "Ctrl", "Meta", "Shift"].includes(u)), s = new KeyboardEvent("keydown", {
|
|
35232
35232
|
key: i === "Space" ? " " : i,
|
|
35233
35233
|
altKey: a.includes("Alt"),
|
|
35234
35234
|
ctrlKey: a.includes("Ctrl"),
|
|
@@ -35259,13 +35259,13 @@ function Ql(e, t, n = {}) {
|
|
|
35259
35259
|
const o = l - r, u = s.filter((d) => i ? i.name === d.node.type.name : !0).filter((d) => mi(d.node.attrs, n, { strict: !1 }));
|
|
35260
35260
|
return a ? !!u.length : u.reduce((d, h) => d + h.to - h.from, 0) >= o;
|
|
35261
35261
|
}
|
|
35262
|
-
const
|
|
35262
|
+
const F8 = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
35263
35263
|
const l = st(e, n.schema);
|
|
35264
35264
|
return Ql(n, l, t) ? IS(n, r) : !1;
|
|
35265
|
-
},
|
|
35265
|
+
}, H8 = () => ({ state: e, dispatch: t }) => Xm(e, t), U8 = (e) => ({ state: t, dispatch: n }) => {
|
|
35266
35266
|
const r = st(e, t.schema);
|
|
35267
35267
|
return zS(r)(t, n);
|
|
35268
|
-
},
|
|
35268
|
+
}, z8 = () => ({ state: e, dispatch: t }) => Gm(e, t);
|
|
35269
35269
|
function Vi(e, t) {
|
|
35270
35270
|
return t.nodes[e] ? "node" : t.marks[e] ? "mark" : null;
|
|
35271
35271
|
}
|
|
@@ -35273,7 +35273,7 @@ function rh(e, t) {
|
|
|
35273
35273
|
const n = typeof t == "string" ? [t] : t;
|
|
35274
35274
|
return Object.keys(e).reduce((r, l) => (n.includes(l) || (r[l] = e[l]), r), {});
|
|
35275
35275
|
}
|
|
35276
|
-
const
|
|
35276
|
+
const V8 = (e, t) => ({ tr: n, state: r, dispatch: l }) => {
|
|
35277
35277
|
let a = null, i = null;
|
|
35278
35278
|
const s = Vi(typeof e == "string" ? e : e.name, r.schema);
|
|
35279
35279
|
return s ? (s === "node" && (a = st(e, r.schema)), s === "mark" && (i = jn(e, r.schema)), l && n.selection.ranges.forEach((o) => {
|
|
@@ -35283,13 +35283,13 @@ const Vk = (e, t) => ({ tr: n, state: r, dispatch: l }) => {
|
|
|
35283
35283
|
});
|
|
35284
35284
|
});
|
|
35285
35285
|
}), !0) : !1;
|
|
35286
|
-
}, $
|
|
35286
|
+
}, $8 = () => ({ tr: e, dispatch: t }) => (t && e.scrollIntoView(), !0), q8 = () => ({ tr: e, dispatch: t }) => {
|
|
35287
35287
|
if (t) {
|
|
35288
35288
|
const n = new Pt(e.doc);
|
|
35289
35289
|
e.setSelection(n);
|
|
35290
35290
|
}
|
|
35291
35291
|
return !0;
|
|
35292
|
-
},
|
|
35292
|
+
}, W8 = () => ({ state: e, dispatch: t }) => Wm(e, t), Y8 = () => ({ state: e, dispatch: t }) => Km(e, t), j8 = () => ({ state: e, dispatch: t }) => RS(e, t), K8 = () => ({ state: e, dispatch: t }) => PS(e, t), G8 = () => ({ state: e, dispatch: t }) => LS(e, t);
|
|
35293
35293
|
function Po(e, t, n = {}, r = {}) {
|
|
35294
35294
|
return Gl(e, t, {
|
|
35295
35295
|
slice: !1,
|
|
@@ -35297,7 +35297,7 @@ function Po(e, t, n = {}, r = {}) {
|
|
|
35297
35297
|
errorOnInvalidContent: r.errorOnInvalidContent
|
|
35298
35298
|
});
|
|
35299
35299
|
}
|
|
35300
|
-
const
|
|
35300
|
+
const Q8 = (e, t = !1, n = {}, r = {}) => ({ editor: l, tr: a, dispatch: i, commands: s }) => {
|
|
35301
35301
|
var o, u;
|
|
35302
35302
|
const { doc: c } = a;
|
|
35303
35303
|
if (n.preserveWhitespace !== "full") {
|
|
@@ -35319,7 +35319,7 @@ function u1(e, t) {
|
|
|
35319
35319
|
const s = i.find((o) => o.type.name === n.name);
|
|
35320
35320
|
return s ? { ...s.attrs } : {};
|
|
35321
35321
|
}
|
|
35322
|
-
function
|
|
35322
|
+
function X8(e) {
|
|
35323
35323
|
for (let t = 0; t < e.edgeCount; t += 1) {
|
|
35324
35324
|
const { type: n } = e.edge(t);
|
|
35325
35325
|
if (n.isTextblock && !n.hasRequiredAttrs())
|
|
@@ -35327,7 +35327,7 @@ function Xk(e) {
|
|
|
35327
35327
|
}
|
|
35328
35328
|
return null;
|
|
35329
35329
|
}
|
|
35330
|
-
function
|
|
35330
|
+
function J8(e, t) {
|
|
35331
35331
|
for (let n = e.depth; n > 0; n -= 1) {
|
|
35332
35332
|
const r = e.node(n);
|
|
35333
35333
|
if (t(r))
|
|
@@ -35340,16 +35340,16 @@ function Jk(e, t) {
|
|
|
35340
35340
|
}
|
|
35341
35341
|
}
|
|
35342
35342
|
function qu(e) {
|
|
35343
|
-
return (t) =>
|
|
35343
|
+
return (t) => J8(t.$from, e);
|
|
35344
35344
|
}
|
|
35345
|
-
function
|
|
35345
|
+
function Z8(e, t) {
|
|
35346
35346
|
const n = {
|
|
35347
35347
|
from: 0,
|
|
35348
35348
|
to: e.content.size
|
|
35349
35349
|
};
|
|
35350
35350
|
return n1(e, n, t);
|
|
35351
35351
|
}
|
|
35352
|
-
function
|
|
35352
|
+
function ek(e, t) {
|
|
35353
35353
|
const n = st(t, e.schema), { from: r, to: l } = e.selection, a = [];
|
|
35354
35354
|
e.doc.nodesBetween(r, l, (s) => {
|
|
35355
35355
|
a.push(s);
|
|
@@ -35357,9 +35357,9 @@ function e8(e, t) {
|
|
|
35357
35357
|
const i = a.reverse().find((s) => s.type.name === n.name);
|
|
35358
35358
|
return i ? { ...i.attrs } : {};
|
|
35359
35359
|
}
|
|
35360
|
-
function
|
|
35360
|
+
function tk(e, t) {
|
|
35361
35361
|
const n = Vi(typeof t == "string" ? t : t.name, e.schema);
|
|
35362
|
-
return n === "node" ?
|
|
35362
|
+
return n === "node" ? ek(e, t) : n === "mark" ? u1(e, t) : {};
|
|
35363
35363
|
}
|
|
35364
35364
|
function c1(e, t, n) {
|
|
35365
35365
|
const r = [];
|
|
@@ -35406,7 +35406,7 @@ function Bo(e, t, n = {}) {
|
|
|
35406
35406
|
const o = s.filter((d) => a ? a.name === d.mark.type.name : !0).filter((d) => mi(d.mark.attrs, n, { strict: !1 })).reduce((d, h) => d + h.to - h.from, 0), u = s.filter((d) => a ? d.mark.type !== a && d.mark.type.excludes(a) : !0).reduce((d, h) => d + h.to - h.from, 0);
|
|
35407
35407
|
return (o > 0 ? o + u : o) >= i;
|
|
35408
35408
|
}
|
|
35409
|
-
function
|
|
35409
|
+
function nk(e, t, n = {}) {
|
|
35410
35410
|
if (!t)
|
|
35411
35411
|
return Ql(e, null, n) || Bo(e, null, n);
|
|
35412
35412
|
const r = Vi(t, e.schema);
|
|
@@ -35445,10 +35445,10 @@ function $i(e, { checkChildren: t = !0, ignoreWhitespace: n = !1 } = {}) {
|
|
|
35445
35445
|
}
|
|
35446
35446
|
return !1;
|
|
35447
35447
|
}
|
|
35448
|
-
function
|
|
35448
|
+
function rk(e) {
|
|
35449
35449
|
return e instanceof be;
|
|
35450
35450
|
}
|
|
35451
|
-
function
|
|
35451
|
+
function lk(e, t, n) {
|
|
35452
35452
|
var r;
|
|
35453
35453
|
const { selection: l } = t;
|
|
35454
35454
|
let a = null;
|
|
@@ -35470,7 +35470,7 @@ function l8(e, t, n) {
|
|
|
35470
35470
|
}), u;
|
|
35471
35471
|
});
|
|
35472
35472
|
}
|
|
35473
|
-
const
|
|
35473
|
+
const ak = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
35474
35474
|
const { selection: a } = n, { empty: i, ranges: s } = a, o = jn(e, r.schema);
|
|
35475
35475
|
if (l)
|
|
35476
35476
|
if (i) {
|
|
@@ -35492,24 +35492,24 @@ const a8 = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
|
35492
35492
|
}) : n.addMark(m, g, o.create(t));
|
|
35493
35493
|
});
|
|
35494
35494
|
});
|
|
35495
|
-
return
|
|
35496
|
-
},
|
|
35495
|
+
return lk(r, n, o);
|
|
35496
|
+
}, ik = (e, t) => ({ tr: n }) => (n.setMeta(e, t), !0), sk = (e, t = {}) => ({ state: n, dispatch: r, chain: l }) => {
|
|
35497
35497
|
const a = st(e, n.schema);
|
|
35498
35498
|
let i;
|
|
35499
35499
|
return n.selection.$anchor.sameParent(n.selection.$head) && (i = n.selection.$anchor.parent.attrs), a.isTextblock ? l().command(({ commands: s }) => Xf(a, { ...i, ...t })(n) ? !0 : s.clearNodes()).command(({ state: s }) => Xf(a, { ...i, ...t })(s, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
|
|
35500
|
-
},
|
|
35500
|
+
}, ok = (e) => ({ tr: t, dispatch: n }) => {
|
|
35501
35501
|
if (n) {
|
|
35502
35502
|
const { doc: r } = t, l = sr(e, 0, r.content.size), a = be.create(r, l);
|
|
35503
35503
|
t.setSelection(a);
|
|
35504
35504
|
}
|
|
35505
35505
|
return !0;
|
|
35506
|
-
},
|
|
35506
|
+
}, uk = (e) => ({ tr: t, dispatch: n }) => {
|
|
35507
35507
|
if (n) {
|
|
35508
35508
|
const { doc: r } = t, { from: l, to: a } = typeof e == "number" ? { from: e, to: e } : e, i = Ee.atStart(r).from, s = Ee.atEnd(r).to, o = sr(l, i, s), u = sr(a, i, s), c = Ee.create(r, o, u);
|
|
35509
35509
|
t.setSelection(c);
|
|
35510
35510
|
}
|
|
35511
35511
|
return !0;
|
|
35512
|
-
},
|
|
35512
|
+
}, ck = (e) => ({ state: t, dispatch: n }) => {
|
|
35513
35513
|
const r = st(e, t.schema);
|
|
35514
35514
|
return qS(r)(t, n);
|
|
35515
35515
|
};
|
|
@@ -35520,13 +35520,13 @@ function ah(e, t) {
|
|
|
35520
35520
|
e.tr.ensureMarks(r);
|
|
35521
35521
|
}
|
|
35522
35522
|
}
|
|
35523
|
-
const
|
|
35523
|
+
const dk = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, editor: l }) => {
|
|
35524
35524
|
const { selection: a, doc: i } = t, { $from: s, $to: o } = a, u = l.extensionManager.attributes, c = Ga(u, s.node().type.name, s.node().attrs);
|
|
35525
35525
|
if (a instanceof be && a.node.isBlock)
|
|
35526
35526
|
return !s.parentOffset || !hn(i, s.pos) ? !1 : (r && (e && ah(n, l.extensionManager.splittableMarks), t.split(s.pos).scrollIntoView()), !0);
|
|
35527
35527
|
if (!s.parent.isBlock)
|
|
35528
35528
|
return !1;
|
|
35529
|
-
const d = o.parentOffset === o.parent.content.size, h = s.depth === 0 ? void 0 :
|
|
35529
|
+
const d = o.parentOffset === o.parent.content.size, h = s.depth === 0 ? void 0 : X8(s.node(-1).contentMatchAt(s.indexAfter(-1)));
|
|
35530
35530
|
let f = d && h ? [
|
|
35531
35531
|
{
|
|
35532
35532
|
type: h,
|
|
@@ -35546,7 +35546,7 @@ const d8 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35546
35546
|
e && ah(n, l.extensionManager.splittableMarks), t.scrollIntoView();
|
|
35547
35547
|
}
|
|
35548
35548
|
return m;
|
|
35549
|
-
},
|
|
35549
|
+
}, fk = (e, t = {}) => ({ tr: n, state: r, dispatch: l, editor: a }) => {
|
|
35550
35550
|
var i;
|
|
35551
35551
|
const s = st(e, r.schema), { $from: o, $to: u } = r.selection, c = r.selection.node;
|
|
35552
35552
|
if (c && c.isBlock || o.depth < 2 || !o.sameParent(u))
|
|
@@ -35619,7 +35619,7 @@ const d8 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35619
35619
|
return !0;
|
|
35620
35620
|
const l = e.doc.nodeAt(r);
|
|
35621
35621
|
return n.node.type === l?.type && Wn(e.doc, r) && e.join(r), !0;
|
|
35622
|
-
},
|
|
35622
|
+
}, hk = (e, t, n, r = {}) => ({ editor: l, tr: a, state: i, dispatch: s, chain: o, commands: u, can: c }) => {
|
|
35623
35623
|
const { extensions: d, splittableMarks: h } = l.extensionManager, f = st(e, i.schema), m = st(t, i.schema), { selection: g, storedMarks: b } = i, { $from: y, $to: A } = g, C = y.blockRange(A), I = b || g.$to.parentOffset && g.$from.marks();
|
|
35624
35624
|
if (!C)
|
|
35625
35625
|
return !1;
|
|
@@ -35634,17 +35634,17 @@ const d8 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35634
35634
|
const x = c().wrapInList(f, r), w = I.filter((N) => h.includes(N.type.name));
|
|
35635
35635
|
return a.ensureMarks(w), x ? !0 : u.clearNodes();
|
|
35636
35636
|
}).wrapInList(f, r).command(() => js(a, f)).command(() => Ks(a, f)).run();
|
|
35637
|
-
},
|
|
35637
|
+
}, pk = (e, t = {}, n = {}) => ({ state: r, commands: l }) => {
|
|
35638
35638
|
const { extendEmptyMarkRange: a = !1 } = n, i = jn(e, r.schema);
|
|
35639
35639
|
return Bo(r, i, t) ? l.unsetMark(i, { extendEmptyMarkRange: a }) : l.setMark(i, t);
|
|
35640
|
-
},
|
|
35640
|
+
}, mk = (e, t, n = {}) => ({ state: r, commands: l }) => {
|
|
35641
35641
|
const a = st(e, r.schema), i = st(t, r.schema), s = Ql(r, a, n);
|
|
35642
35642
|
let o;
|
|
35643
35643
|
return r.selection.$anchor.sameParent(r.selection.$head) && (o = r.selection.$anchor.parent.attrs), s ? l.setNode(i, o) : l.setNode(a, { ...o, ...n });
|
|
35644
|
-
},
|
|
35644
|
+
}, bk = (e, t = {}) => ({ state: n, commands: r }) => {
|
|
35645
35645
|
const l = st(e, n.schema);
|
|
35646
35646
|
return Ql(n, l, t) ? r.lift(l) : r.wrapIn(l, t);
|
|
35647
|
-
},
|
|
35647
|
+
}, gk = () => ({ state: e, dispatch: t }) => {
|
|
35648
35648
|
const n = e.plugins;
|
|
35649
35649
|
for (let r = 0; r < n.length; r += 1) {
|
|
35650
35650
|
const l = n[r];
|
|
@@ -35664,12 +35664,12 @@ const d8 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35664
35664
|
}
|
|
35665
35665
|
}
|
|
35666
35666
|
return !1;
|
|
35667
|
-
},
|
|
35667
|
+
}, vk = () => ({ tr: e, dispatch: t }) => {
|
|
35668
35668
|
const { selection: n } = e, { empty: r, ranges: l } = n;
|
|
35669
35669
|
return r || t && l.forEach((a) => {
|
|
35670
35670
|
e.removeMark(a.$from.pos, a.$to.pos);
|
|
35671
35671
|
}), !0;
|
|
35672
|
-
},
|
|
35672
|
+
}, yk = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
35673
35673
|
var a;
|
|
35674
35674
|
const { extendEmptyMarkRange: i = !1 } = t, { selection: s } = n, o = jn(e, r.schema), { $from: u, empty: c, ranges: d } = s;
|
|
35675
35675
|
if (!l)
|
|
@@ -35683,7 +35683,7 @@ const d8 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35683
35683
|
n.removeMark(h.$from.pos, h.$to.pos, o);
|
|
35684
35684
|
});
|
|
35685
35685
|
return n.removeStoredMark(o), !0;
|
|
35686
|
-
},
|
|
35686
|
+
}, Ek = (e, t = {}) => ({ tr: n, state: r, dispatch: l }) => {
|
|
35687
35687
|
let a = null, i = null;
|
|
35688
35688
|
const s = Vi(typeof e == "string" ? e : e.name, r.schema);
|
|
35689
35689
|
return s ? (s === "node" && (a = st(e, r.schema)), s === "mark" && (i = jn(e, r.schema)), l && n.selection.ranges.forEach((o) => {
|
|
@@ -35714,82 +35714,82 @@ const d8 = ({ keepMarks: e = !0 } = {}) => ({ tr: t, state: n, dispatch: r, edit
|
|
|
35714
35714
|
}));
|
|
35715
35715
|
}));
|
|
35716
35716
|
}), !0) : !1;
|
|
35717
|
-
},
|
|
35717
|
+
}, Tk = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
35718
35718
|
const l = st(e, n.schema);
|
|
35719
35719
|
return BS(l, t)(n, r);
|
|
35720
|
-
},
|
|
35720
|
+
}, Ck = (e, t = {}) => ({ state: n, dispatch: r }) => {
|
|
35721
35721
|
const l = st(e, n.schema);
|
|
35722
35722
|
return FS(l, t)(n, r);
|
|
35723
35723
|
};
|
|
35724
|
-
var
|
|
35724
|
+
var xk = /* @__PURE__ */ Object.freeze({
|
|
35725
35725
|
__proto__: null,
|
|
35726
|
-
blur:
|
|
35727
|
-
clearContent:
|
|
35728
|
-
clearNodes:
|
|
35729
|
-
command:
|
|
35730
|
-
createParagraphNear:
|
|
35731
|
-
cut:
|
|
35732
|
-
deleteCurrentNode:
|
|
35733
|
-
deleteNode:
|
|
35734
|
-
deleteRange:
|
|
35735
|
-
deleteSelection:
|
|
35736
|
-
enter:
|
|
35737
|
-
exitCode:
|
|
35738
|
-
extendMarkRange:
|
|
35739
|
-
first:
|
|
35740
|
-
focus:
|
|
35741
|
-
forEach:
|
|
35742
|
-
insertContent:
|
|
35743
|
-
insertContentAt:
|
|
35744
|
-
joinBackward:
|
|
35745
|
-
joinDown:
|
|
35746
|
-
joinForward:
|
|
35747
|
-
joinItemBackward:
|
|
35748
|
-
joinItemForward:
|
|
35749
|
-
joinTextblockBackward:
|
|
35750
|
-
joinTextblockForward:
|
|
35751
|
-
joinUp:
|
|
35752
|
-
keyboardShortcut:
|
|
35753
|
-
lift:
|
|
35754
|
-
liftEmptyBlock:
|
|
35755
|
-
liftListItem:
|
|
35756
|
-
newlineInCode:
|
|
35757
|
-
resetAttributes:
|
|
35758
|
-
scrollIntoView: $
|
|
35759
|
-
selectAll:
|
|
35760
|
-
selectNodeBackward:
|
|
35761
|
-
selectNodeForward:
|
|
35762
|
-
selectParentNode:
|
|
35763
|
-
selectTextblockEnd:
|
|
35764
|
-
selectTextblockStart:
|
|
35765
|
-
setContent:
|
|
35766
|
-
setMark:
|
|
35767
|
-
setMeta:
|
|
35768
|
-
setNode:
|
|
35769
|
-
setNodeSelection:
|
|
35770
|
-
setTextSelection:
|
|
35771
|
-
sinkListItem:
|
|
35772
|
-
splitBlock:
|
|
35773
|
-
splitListItem:
|
|
35774
|
-
toggleList:
|
|
35775
|
-
toggleMark:
|
|
35776
|
-
toggleNode:
|
|
35777
|
-
toggleWrap:
|
|
35778
|
-
undoInputRule:
|
|
35779
|
-
unsetAllMarks:
|
|
35780
|
-
unsetMark:
|
|
35781
|
-
updateAttributes:
|
|
35782
|
-
wrapIn:
|
|
35783
|
-
wrapInList:
|
|
35726
|
+
blur: s8,
|
|
35727
|
+
clearContent: o8,
|
|
35728
|
+
clearNodes: u8,
|
|
35729
|
+
command: c8,
|
|
35730
|
+
createParagraphNear: d8,
|
|
35731
|
+
cut: f8,
|
|
35732
|
+
deleteCurrentNode: h8,
|
|
35733
|
+
deleteNode: p8,
|
|
35734
|
+
deleteRange: m8,
|
|
35735
|
+
deleteSelection: b8,
|
|
35736
|
+
enter: g8,
|
|
35737
|
+
exitCode: v8,
|
|
35738
|
+
extendMarkRange: y8,
|
|
35739
|
+
first: E8,
|
|
35740
|
+
focus: C8,
|
|
35741
|
+
forEach: x8,
|
|
35742
|
+
insertContent: S8,
|
|
35743
|
+
insertContentAt: N8,
|
|
35744
|
+
joinBackward: _8,
|
|
35745
|
+
joinDown: I8,
|
|
35746
|
+
joinForward: O8,
|
|
35747
|
+
joinItemBackward: M8,
|
|
35748
|
+
joinItemForward: R8,
|
|
35749
|
+
joinTextblockBackward: D8,
|
|
35750
|
+
joinTextblockForward: L8,
|
|
35751
|
+
joinUp: w8,
|
|
35752
|
+
keyboardShortcut: B8,
|
|
35753
|
+
lift: F8,
|
|
35754
|
+
liftEmptyBlock: H8,
|
|
35755
|
+
liftListItem: U8,
|
|
35756
|
+
newlineInCode: z8,
|
|
35757
|
+
resetAttributes: V8,
|
|
35758
|
+
scrollIntoView: $8,
|
|
35759
|
+
selectAll: q8,
|
|
35760
|
+
selectNodeBackward: W8,
|
|
35761
|
+
selectNodeForward: Y8,
|
|
35762
|
+
selectParentNode: j8,
|
|
35763
|
+
selectTextblockEnd: K8,
|
|
35764
|
+
selectTextblockStart: G8,
|
|
35765
|
+
setContent: Q8,
|
|
35766
|
+
setMark: ak,
|
|
35767
|
+
setMeta: ik,
|
|
35768
|
+
setNode: sk,
|
|
35769
|
+
setNodeSelection: ok,
|
|
35770
|
+
setTextSelection: uk,
|
|
35771
|
+
sinkListItem: ck,
|
|
35772
|
+
splitBlock: dk,
|
|
35773
|
+
splitListItem: fk,
|
|
35774
|
+
toggleList: hk,
|
|
35775
|
+
toggleMark: pk,
|
|
35776
|
+
toggleNode: mk,
|
|
35777
|
+
toggleWrap: bk,
|
|
35778
|
+
undoInputRule: gk,
|
|
35779
|
+
unsetAllMarks: vk,
|
|
35780
|
+
unsetMark: yk,
|
|
35781
|
+
updateAttributes: Ek,
|
|
35782
|
+
wrapIn: Tk,
|
|
35783
|
+
wrapInList: Ck
|
|
35784
35784
|
});
|
|
35785
|
-
const
|
|
35785
|
+
const Sk = mt.create({
|
|
35786
35786
|
name: "commands",
|
|
35787
35787
|
addCommands() {
|
|
35788
35788
|
return {
|
|
35789
|
-
...
|
|
35789
|
+
...xk
|
|
35790
35790
|
};
|
|
35791
35791
|
}
|
|
35792
|
-
}),
|
|
35792
|
+
}), kk = mt.create({
|
|
35793
35793
|
name: "drop",
|
|
35794
35794
|
addProseMirrorPlugins() {
|
|
35795
35795
|
return [
|
|
@@ -35808,7 +35808,7 @@ const S8 = mt.create({
|
|
|
35808
35808
|
})
|
|
35809
35809
|
];
|
|
35810
35810
|
}
|
|
35811
|
-
}),
|
|
35811
|
+
}), Ak = mt.create({
|
|
35812
35812
|
name: "editable",
|
|
35813
35813
|
addProseMirrorPlugins() {
|
|
35814
35814
|
return [
|
|
@@ -35820,13 +35820,13 @@ const S8 = mt.create({
|
|
|
35820
35820
|
})
|
|
35821
35821
|
];
|
|
35822
35822
|
}
|
|
35823
|
-
}),
|
|
35823
|
+
}), Nk = new Kt("focusEvents"), wk = mt.create({
|
|
35824
35824
|
name: "focusEvents",
|
|
35825
35825
|
addProseMirrorPlugins() {
|
|
35826
35826
|
const { editor: e } = this;
|
|
35827
35827
|
return [
|
|
35828
35828
|
new xt({
|
|
35829
|
-
key:
|
|
35829
|
+
key: Nk,
|
|
35830
35830
|
props: {
|
|
35831
35831
|
handleDOMEvents: {
|
|
35832
35832
|
focus: (t, n) => {
|
|
@@ -35844,7 +35844,7 @@ const S8 = mt.create({
|
|
|
35844
35844
|
})
|
|
35845
35845
|
];
|
|
35846
35846
|
}
|
|
35847
|
-
}),
|
|
35847
|
+
}), Ik = mt.create({
|
|
35848
35848
|
name: "keymap",
|
|
35849
35849
|
addKeyboardShortcuts() {
|
|
35850
35850
|
const e = () => this.editor.commands.first(({ commands: i }) => [
|
|
@@ -35922,7 +35922,7 @@ const S8 = mt.create({
|
|
|
35922
35922
|
})
|
|
35923
35923
|
];
|
|
35924
35924
|
}
|
|
35925
|
-
}),
|
|
35925
|
+
}), _k = mt.create({
|
|
35926
35926
|
name: "paste",
|
|
35927
35927
|
addProseMirrorPlugins() {
|
|
35928
35928
|
return [
|
|
@@ -35940,7 +35940,7 @@ const S8 = mt.create({
|
|
|
35940
35940
|
})
|
|
35941
35941
|
];
|
|
35942
35942
|
}
|
|
35943
|
-
}),
|
|
35943
|
+
}), Ok = mt.create({
|
|
35944
35944
|
name: "tabindex",
|
|
35945
35945
|
addProseMirrorPlugins() {
|
|
35946
35946
|
return [
|
|
@@ -36079,7 +36079,7 @@ class rr {
|
|
|
36079
36079
|
}), this.editor.view.dispatch(n);
|
|
36080
36080
|
}
|
|
36081
36081
|
}
|
|
36082
|
-
const
|
|
36082
|
+
const Mk = `.ProseMirror {
|
|
36083
36083
|
position: relative;
|
|
36084
36084
|
}
|
|
36085
36085
|
|
|
@@ -36154,14 +36154,14 @@ img.ProseMirror-separator {
|
|
|
36154
36154
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
36155
36155
|
opacity: 0
|
|
36156
36156
|
}`;
|
|
36157
|
-
function
|
|
36157
|
+
function Rk(e, t, n) {
|
|
36158
36158
|
const r = document.querySelector("style[data-tiptap-style]");
|
|
36159
36159
|
if (r !== null)
|
|
36160
36160
|
return r;
|
|
36161
36161
|
const l = document.createElement("style");
|
|
36162
36162
|
return t && l.setAttribute("nonce", t), l.setAttribute("data-tiptap-style", ""), l.innerHTML = e, document.getElementsByTagName("head")[0].appendChild(l), l;
|
|
36163
36163
|
}
|
|
36164
|
-
class
|
|
36164
|
+
class Dk extends WS {
|
|
36165
36165
|
constructor(t = {}) {
|
|
36166
36166
|
super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
|
|
36167
36167
|
element: document.createElement("div"),
|
|
@@ -36224,7 +36224,7 @@ class D8 extends WS {
|
|
|
36224
36224
|
* Inject CSS styles.
|
|
36225
36225
|
*/
|
|
36226
36226
|
injectCSS() {
|
|
36227
|
-
this.options.injectCSS && document && (this.css =
|
|
36227
|
+
this.options.injectCSS && document && (this.css = Rk(Mk, this.options.injectNonce));
|
|
36228
36228
|
}
|
|
36229
36229
|
/**
|
|
36230
36230
|
* Update editor options.
|
|
@@ -36293,16 +36293,16 @@ class D8 extends WS {
|
|
|
36293
36293
|
createExtensionManager() {
|
|
36294
36294
|
var t, n;
|
|
36295
36295
|
const l = [...this.options.enableCoreExtensions ? [
|
|
36296
|
-
|
|
36297
|
-
|
|
36296
|
+
Ak,
|
|
36297
|
+
i8.configure({
|
|
36298
36298
|
blockSeparator: (n = (t = this.options.coreExtensionOptions) === null || t === void 0 ? void 0 : t.clipboardTextSerializer) === null || n === void 0 ? void 0 : n.blockSeparator
|
|
36299
36299
|
}),
|
|
36300
|
-
|
|
36301
|
-
|
|
36302
|
-
|
|
36303
|
-
|
|
36304
|
-
|
|
36305
|
-
|
|
36300
|
+
Sk,
|
|
36301
|
+
wk,
|
|
36302
|
+
Ik,
|
|
36303
|
+
Ok,
|
|
36304
|
+
kk,
|
|
36305
|
+
_k
|
|
36306
36306
|
].filter((a) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[a.name] !== !1 : !0) : [], ...this.options.extensions].filter((a) => ["extension", "node", "mark"].includes(a?.type));
|
|
36307
36307
|
this.extensionManager = new Fr(l, this);
|
|
36308
36308
|
}
|
|
@@ -36428,11 +36428,11 @@ class D8 extends WS {
|
|
|
36428
36428
|
* Get attributes of the currently selected node or mark.
|
|
36429
36429
|
*/
|
|
36430
36430
|
getAttributes(t) {
|
|
36431
|
-
return
|
|
36431
|
+
return tk(this.state, t);
|
|
36432
36432
|
}
|
|
36433
36433
|
isActive(t, n) {
|
|
36434
36434
|
const r = typeof t == "string" ? t : null, l = typeof t == "string" ? n : t;
|
|
36435
|
-
return
|
|
36435
|
+
return nk(this.state, r, l);
|
|
36436
36436
|
}
|
|
36437
36437
|
/**
|
|
36438
36438
|
* Get the document as JSON.
|
|
@@ -36453,7 +36453,7 @@ class D8 extends WS {
|
|
|
36453
36453
|
const { blockSeparator: n = `
|
|
36454
36454
|
|
|
36455
36455
|
`, textSerializers: r = {} } = t || {};
|
|
36456
|
-
return
|
|
36456
|
+
return Z8(this.state.doc, {
|
|
36457
36457
|
blockSeparator: n,
|
|
36458
36458
|
textSerializers: {
|
|
36459
36459
|
...r1(this.schema),
|
|
@@ -36527,7 +36527,7 @@ function Kr(e) {
|
|
|
36527
36527
|
}
|
|
36528
36528
|
});
|
|
36529
36529
|
}
|
|
36530
|
-
function
|
|
36530
|
+
function Lk(e) {
|
|
36531
36531
|
return new Ui({
|
|
36532
36532
|
find: e.find,
|
|
36533
36533
|
handler: ({ state: t, range: n, match: r }) => {
|
|
@@ -36618,7 +36618,7 @@ class It {
|
|
|
36618
36618
|
}
|
|
36619
36619
|
}
|
|
36620
36620
|
function Gr(e) {
|
|
36621
|
-
return new
|
|
36621
|
+
return new e8({
|
|
36622
36622
|
find: e.find,
|
|
36623
36623
|
handler: ({ state: t, range: n, match: r, pasteEvent: l }) => {
|
|
36624
36624
|
const a = Ne(e.getAttributes, void 0, r, l);
|
|
@@ -36635,7 +36635,7 @@ function Gr(e) {
|
|
|
36635
36635
|
}
|
|
36636
36636
|
});
|
|
36637
36637
|
}
|
|
36638
|
-
function
|
|
36638
|
+
function Pk(e, t) {
|
|
36639
36639
|
const { selection: n } = e, { $from: r } = n;
|
|
36640
36640
|
if (n instanceof be) {
|
|
36641
36641
|
const a = r.index();
|
|
@@ -36650,7 +36650,7 @@ function P8(e, t) {
|
|
|
36650
36650
|
}
|
|
36651
36651
|
return !1;
|
|
36652
36652
|
}
|
|
36653
|
-
function
|
|
36653
|
+
function Bk(e) {
|
|
36654
36654
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
36655
36655
|
}
|
|
36656
36656
|
var Ho = { exports: {} }, Gs = {};
|
|
@@ -36664,7 +36664,7 @@ var Ho = { exports: {} }, Gs = {};
|
|
|
36664
36664
|
* LICENSE file in the root directory of this source tree.
|
|
36665
36665
|
*/
|
|
36666
36666
|
var ih;
|
|
36667
|
-
function
|
|
36667
|
+
function Fk() {
|
|
36668
36668
|
if (ih) return Gs;
|
|
36669
36669
|
ih = 1;
|
|
36670
36670
|
var e = ve;
|
|
@@ -36709,7 +36709,7 @@ var Qs = {};
|
|
|
36709
36709
|
* LICENSE file in the root directory of this source tree.
|
|
36710
36710
|
*/
|
|
36711
36711
|
var sh;
|
|
36712
|
-
function
|
|
36712
|
+
function Hk() {
|
|
36713
36713
|
return sh || (sh = 1, process.env.NODE_ENV !== "production" && function() {
|
|
36714
36714
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
36715
36715
|
var e = ve, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
@@ -36779,17 +36779,17 @@ function H8() {
|
|
|
36779
36779
|
Qs.useSyncExternalStore = A, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
36780
36780
|
}()), Qs;
|
|
36781
36781
|
}
|
|
36782
|
-
process.env.NODE_ENV === "production" ? Ho.exports =
|
|
36782
|
+
process.env.NODE_ENV === "production" ? Ho.exports = Fk() : Ho.exports = Hk();
|
|
36783
36783
|
var qi = Ho.exports;
|
|
36784
|
-
const
|
|
36784
|
+
const Uk = (...e) => (t) => {
|
|
36785
36785
|
e.forEach((n) => {
|
|
36786
36786
|
typeof n == "function" ? n(t) : n && (n.current = t);
|
|
36787
36787
|
});
|
|
36788
|
-
},
|
|
36788
|
+
}, zk = ({ contentComponent: e }) => {
|
|
36789
36789
|
const t = qi.useSyncExternalStore(e.subscribe, e.getSnapshot, e.getServerSnapshot);
|
|
36790
36790
|
return ve.createElement(ve.Fragment, null, Object.values(t));
|
|
36791
36791
|
};
|
|
36792
|
-
function
|
|
36792
|
+
function Vk() {
|
|
36793
36793
|
const e = /* @__PURE__ */ new Set();
|
|
36794
36794
|
let t = {};
|
|
36795
36795
|
return {
|
|
@@ -36825,7 +36825,7 @@ function V8() {
|
|
|
36825
36825
|
}
|
|
36826
36826
|
};
|
|
36827
36827
|
}
|
|
36828
|
-
class $
|
|
36828
|
+
class $k extends ve.Component {
|
|
36829
36829
|
constructor(t) {
|
|
36830
36830
|
var n;
|
|
36831
36831
|
super(t), this.editorContentRef = ve.createRef(), this.initialized = !1, this.state = {
|
|
@@ -36846,7 +36846,7 @@ class $8 extends ve.Component {
|
|
|
36846
36846
|
const n = this.editorContentRef.current;
|
|
36847
36847
|
n.append(...t.options.element.childNodes), t.setOptions({
|
|
36848
36848
|
element: n
|
|
36849
|
-
}), t.contentComponent =
|
|
36849
|
+
}), t.contentComponent = Vk(), this.state.hasContentComponentInitialized || (this.unsubscribeToContentComponent = t.contentComponent.subscribe(() => {
|
|
36850
36850
|
this.setState((r) => r.hasContentComponentInitialized ? r : {
|
|
36851
36851
|
hasContentComponentInitialized: !0
|
|
36852
36852
|
}), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent();
|
|
@@ -36869,20 +36869,20 @@ class $8 extends ve.Component {
|
|
|
36869
36869
|
return ve.createElement(
|
|
36870
36870
|
ve.Fragment,
|
|
36871
36871
|
null,
|
|
36872
|
-
ve.createElement("div", { ref:
|
|
36873
|
-
t?.contentComponent && ve.createElement(
|
|
36872
|
+
ve.createElement("div", { ref: Uk(n, this.editorContentRef), ...r }),
|
|
36873
|
+
t?.contentComponent && ve.createElement(zk, { contentComponent: t.contentComponent })
|
|
36874
36874
|
);
|
|
36875
36875
|
}
|
|
36876
36876
|
}
|
|
36877
|
-
const
|
|
36877
|
+
const qk = mb((e, t) => {
|
|
36878
36878
|
const n = ve.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
|
|
36879
|
-
return ve.createElement($
|
|
36879
|
+
return ve.createElement($k, {
|
|
36880
36880
|
key: n,
|
|
36881
36881
|
innerRef: t,
|
|
36882
36882
|
...e
|
|
36883
36883
|
});
|
|
36884
|
-
}),
|
|
36885
|
-
var
|
|
36884
|
+
}), Wk = ve.memo(qk);
|
|
36885
|
+
var Yk = function e(t, n) {
|
|
36886
36886
|
if (t === n) return !0;
|
|
36887
36887
|
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
36888
36888
|
if (t.constructor !== n.constructor) return !1;
|
|
@@ -36927,7 +36927,7 @@ var Y8 = function e(t, n) {
|
|
|
36927
36927
|
return !0;
|
|
36928
36928
|
}
|
|
36929
36929
|
return t !== t && n !== n;
|
|
36930
|
-
},
|
|
36930
|
+
}, jk = /* @__PURE__ */ Bk(Yk), Uo = { exports: {} }, Xs = {};
|
|
36931
36931
|
/**
|
|
36932
36932
|
* @license React
|
|
36933
36933
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
@@ -36938,7 +36938,7 @@ var Y8 = function e(t, n) {
|
|
|
36938
36938
|
* LICENSE file in the root directory of this source tree.
|
|
36939
36939
|
*/
|
|
36940
36940
|
var oh;
|
|
36941
|
-
function
|
|
36941
|
+
function Kk() {
|
|
36942
36942
|
if (oh) return Xs;
|
|
36943
36943
|
oh = 1;
|
|
36944
36944
|
var e = ve, t = qi;
|
|
@@ -36989,7 +36989,7 @@ var Js = {};
|
|
|
36989
36989
|
* LICENSE file in the root directory of this source tree.
|
|
36990
36990
|
*/
|
|
36991
36991
|
var uh;
|
|
36992
|
-
function
|
|
36992
|
+
function Gk() {
|
|
36993
36993
|
return uh || (uh = 1, process.env.NODE_ENV !== "production" && function() {
|
|
36994
36994
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
36995
36995
|
var e = ve, t = qi;
|
|
@@ -37034,10 +37034,10 @@ function G8() {
|
|
|
37034
37034
|
Js.useSyncExternalStoreWithSelector = u, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
37035
37035
|
}()), Js;
|
|
37036
37036
|
}
|
|
37037
|
-
process.env.NODE_ENV === "production" ? Uo.exports =
|
|
37038
|
-
var
|
|
37039
|
-
const
|
|
37040
|
-
class
|
|
37037
|
+
process.env.NODE_ENV === "production" ? Uo.exports = Kk() : Uo.exports = Gk();
|
|
37038
|
+
var Qk = Uo.exports;
|
|
37039
|
+
const Xk = typeof window < "u" ? ze : he;
|
|
37040
|
+
class Jk {
|
|
37041
37041
|
constructor(t) {
|
|
37042
37042
|
this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = t, this.lastSnapshot = { editor: t, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
|
|
37043
37043
|
}
|
|
@@ -37075,10 +37075,10 @@ class J8 {
|
|
|
37075
37075
|
}
|
|
37076
37076
|
}
|
|
37077
37077
|
}
|
|
37078
|
-
function
|
|
37078
|
+
function Zk(e) {
|
|
37079
37079
|
var t;
|
|
37080
|
-
const [n] = K(() => new
|
|
37081
|
-
return
|
|
37080
|
+
const [n] = K(() => new Jk(e.editor)), r = Qk.useSyncExternalStoreWithSelector(n.subscribe, n.getSnapshot, n.getServerSnapshot, e.selector, (t = e.equalityFn) !== null && t !== void 0 ? t : jk);
|
|
37081
|
+
return Xk(() => n.watch(e.editor), [e.editor, n]), Nh(r), r;
|
|
37082
37082
|
}
|
|
37083
37083
|
const ch = process.env.NODE_ENV !== "production", zo = typeof window > "u", eA = zo || !!(typeof window < "u" && window.next);
|
|
37084
37084
|
class Wu {
|
|
@@ -37147,7 +37147,7 @@ class Wu {
|
|
|
37147
37147
|
return (a = (l = this.options.current).onPaste) === null || a === void 0 ? void 0 : a.call(l, ...r);
|
|
37148
37148
|
}
|
|
37149
37149
|
};
|
|
37150
|
-
return new
|
|
37150
|
+
return new Dk(t);
|
|
37151
37151
|
}
|
|
37152
37152
|
/**
|
|
37153
37153
|
* Get the current editor instance.
|
|
@@ -37222,7 +37222,7 @@ function tA(e = {}, t = []) {
|
|
|
37222
37222
|
const n = J(e);
|
|
37223
37223
|
n.current = e;
|
|
37224
37224
|
const [r] = K(() => new Wu(n)), l = qi.useSyncExternalStore(r.subscribe, r.getEditor, r.getServerSnapshot);
|
|
37225
|
-
return Nh(l), he(r.onRender(t)),
|
|
37225
|
+
return Nh(l), he(r.onRender(t)), Zk({
|
|
37226
37226
|
editor: l,
|
|
37227
37227
|
selector: ({ transactionNumber: a }) => e.shouldRerenderOnTransaction === !1 ? null : e.immediatelyRender && a === 0 ? 0 : a + 1
|
|
37228
37228
|
}), l;
|
|
@@ -38366,7 +38366,7 @@ const p1 = h1(!1, !0), m1 = h1(!0, !0), $A = mt.create({
|
|
|
38366
38366
|
addCommands() {
|
|
38367
38367
|
return {
|
|
38368
38368
|
setHorizontalRule: () => ({ chain: e, state: t }) => {
|
|
38369
|
-
if (!
|
|
38369
|
+
if (!Pk(t, t.schema.nodes[this.name]))
|
|
38370
38370
|
return !1;
|
|
38371
38371
|
const { selection: n } = t, { $from: r, $to: l } = n, a = e();
|
|
38372
38372
|
return r.parentOffset === 0 ? a.insertContentAt({
|
|
@@ -38374,7 +38374,7 @@ const p1 = h1(!1, !0), m1 = h1(!0, !0), $A = mt.create({
|
|
|
38374
38374
|
to: l.pos
|
|
38375
38375
|
}, {
|
|
38376
38376
|
type: this.name
|
|
38377
|
-
}) :
|
|
38377
|
+
}) : rk(n) ? a.insertContentAt(l.pos, {
|
|
38378
38378
|
type: this.name
|
|
38379
38379
|
}) : a.insertContent({ type: this.name }), a.command(({ tr: i, dispatch: s }) => {
|
|
38380
38380
|
var o;
|
|
@@ -38395,7 +38395,7 @@ const p1 = h1(!1, !0), m1 = h1(!0, !0), $A = mt.create({
|
|
|
38395
38395
|
},
|
|
38396
38396
|
addInputRules() {
|
|
38397
38397
|
return [
|
|
38398
|
-
|
|
38398
|
+
Lk({
|
|
38399
38399
|
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
|
|
38400
38400
|
type: this.type
|
|
38401
38401
|
})
|
|
@@ -38776,7 +38776,7 @@ const sN = ({ expanded: e, onToggle: t }) => /* @__PURE__ */ W(
|
|
|
38776
38776
|
className: `rte-richtext-container ${d ? "rte-richtext-host-expanded" : ""} ${l ? "rte-richtext-error" : ""}`,
|
|
38777
38777
|
"data-key": e.key,
|
|
38778
38778
|
children: /* @__PURE__ */ W("div", { className: A, style: y, children: [
|
|
38779
|
-
/* @__PURE__ */ v(
|
|
38779
|
+
/* @__PURE__ */ v(Wk, { editor: g }),
|
|
38780
38780
|
c && /* @__PURE__ */ v(sN, { expanded: d, onToggle: b })
|
|
38781
38781
|
] })
|
|
38782
38782
|
}
|
|
@@ -40215,13 +40215,18 @@ const ZN = 10 * 1024 * 1024, e9 = 50 * 1024 * 1024, t9 = "图片大小不能超
|
|
|
40215
40215
|
"div",
|
|
40216
40216
|
{
|
|
40217
40217
|
className: "rte-footer-upload-btn",
|
|
40218
|
-
title: "上传",
|
|
40219
40218
|
style: {
|
|
40220
40219
|
cursor: n ? "not-allowed" : "pointer",
|
|
40221
40220
|
opacity: n ? 0.6 : 1,
|
|
40222
40221
|
pointerEvents: n ? "none" : "auto"
|
|
40223
40222
|
},
|
|
40224
|
-
children: /* @__PURE__ */ v("
|
|
40223
|
+
children: /* @__PURE__ */ v("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ v(
|
|
40224
|
+
"path",
|
|
40225
|
+
{
|
|
40226
|
+
d: "M8.05044 1.00098C8.57059 1.00105 8.93598 1.41865 8.93598 1.88652V7.11543H14.1145C14.5842 7.11543 15 7.53122 15 8.00098C14.9999 8.47053 14.5862 8.88649 14.1164 8.88652H8.93598V14.1154C8.93598 14.5851 8.52013 15.0009 8.05044 15.001C7.58068 15.001 7.16489 14.5852 7.16489 14.1154V8.88652H1.88555C1.41584 8.88652 1.00008 8.47067 1 8.00098C1 7.53122 1.41579 7.11543 1.88555 7.11543H7.16489V1.88652C7.16489 1.41677 7.58068 1.00098 8.05044 1.00098Z",
|
|
40227
|
+
fill: "currentColor"
|
|
40228
|
+
}
|
|
40229
|
+
) })
|
|
40225
40230
|
}
|
|
40226
40231
|
)
|
|
40227
40232
|
}
|