@remarkablejames/editor 0.0.1 → 0.0.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/lib/{ActionMenuButton-B0EHT9CC.js → ActionMenuButton-D5HLfRzv.js} +1 -1
- package/lib/{ActionMenuButton-J1el_e6Z.cjs → ActionMenuButton-DN6VHLkp.cjs} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.js +5 -5
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +1 -1
- package/lib/Callout.cjs +1 -1
- package/lib/Callout.js +2 -2
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -44
- package/lib/CodeBlock.js +181 -3857
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +2 -2
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +1 -1
- package/lib/{Drawer-BCWVN-4l.js → Drawer-B9l1SoRJ.js} +21 -21
- package/lib/{Drawer-BTouEroZ.cjs → Drawer-BN0lYcnJ.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +2 -2
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +12 -12
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +3 -3
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +3 -3
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +3 -3
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +2 -2
- package/lib/History.cjs +1 -1
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +1 -1
- package/lib/{Iframe-BfBLILDA.cjs → Iframe-CXFk3GEq.cjs} +1 -1
- package/lib/{Iframe-BdgiWGml.js → Iframe-MjeJ2OOI.js} +9 -9
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +22 -22
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.js +1 -1
- package/lib/{Indent-Dvqz_WEn.cjs → Indent-BPX9XRos.cjs} +1 -1
- package/lib/{Indent-BpMcZKok.js → Indent-CgwDItIf.js} +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +1 -1
- package/lib/{Katex-B8_uprkO.js → Katex-CZ4g3vA9.js} +2 -2
- package/lib/{Katex-BQyeCeQ0.cjs → Katex-DIgsR_dS.cjs} +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +1 -1
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +2 -2
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +1 -1
- package/lib/{LinkEditBlock-CIshn_8F.cjs → LinkEditBlock-B2bU0Mcr.cjs} +1 -1
- package/lib/{LinkEditBlock-BX0fXXpF.js → LinkEditBlock-CaDV3Vq5.js} +2 -2
- package/lib/{Mermaid-0GiGVxn0.cjs → Mermaid-B9h7XKFo.cjs} +1 -1
- package/lib/{Mermaid-D8bbIgAl.js → Mermaid-EhYj_ICn.js} +2 -2
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.js +1 -1
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +2 -2
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +1 -1
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +2 -2
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +2 -2
- package/lib/{SlashCommandNodeView-rDJ7OjRd.cjs → SlashCommandNodeView-COlWSlnE.cjs} +1 -1
- package/lib/{SlashCommandNodeView-BcmtKbEE.js → SlashCommandNodeView-CY3peX5x.js} +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +1 -1
- package/lib/{Table-DbxuP5xh.js → Table-Bw7rLue7.js} +2 -2
- package/lib/{Table-BEhNBeuA.cjs → Table-DLrtX6T7.cjs} +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +2 -2
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +2 -2
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +1 -1
- package/lib/{Twitter-BuEBgpi9.cjs → Twitter-Ck6vGefg.cjs} +1 -1
- package/lib/{Twitter-9I6BLNmg.js → Twitter-pM0y5Z-L.js} +2 -2
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +1 -1
- package/lib/bubble.cjs +1 -1
- package/lib/bubble.js +103 -103
- package/lib/{dropdown-menu-DjWlG2-J.cjs → dropdown-menu-DwR8tTs9.cjs} +1 -1
- package/lib/{dropdown-menu-Bs69ZBbO.js → dropdown-menu-nX-u8e2w.js} +1 -1
- package/lib/extensions/CodeBlock/CodeBlock.d.ts +1 -1
- package/lib/extensions/Image/Image.d.ts +11 -0
- package/lib/extensions/Image/components/ImageCropper.d.ts +1 -1
- package/lib/index-Dib4cXXf.cjs +10 -0
- package/lib/{index-lj3VWExo.js → index-_WrFM-Fk.js} +1289 -1118
- package/lib/index.cjs +1 -1
- package/lib/index.js +1 -1
- package/lib/{popover-D-hUKDYu.cjs → popover-BY7j9SiD.cjs} +1 -1
- package/lib/{popover-CPr9bHYn.js → popover-CSvY4C-l.js} +1 -1
- package/lib/{select-CuE_HaQJ.js → select-BelNLNvT.js} +1 -1
- package/lib/{select-C2KF4RNg.cjs → select-Bu-5iIA9.cjs} +1 -1
- package/lib/{separator-CHzYNMVt.js → separator-Br5kcIJa.js} +2 -2
- package/lib/{separator-_gvUNba_.cjs → separator-Cp9Lg3HU.cjs} +1 -1
- package/lib/style.css +1 -1
- package/lib/{textarea-gEoNp9CA.js → textarea-Ceev4t42.js} +1 -1
- package/lib/{textarea-DZj6EY-N.cjs → textarea-DfqvYaA6.cjs} +1 -1
- package/lib/theme/theme.d.ts +1 -1
- package/package.json +1 -1
- package/lib/index-D9oM__YW.cjs +0 -1
package/lib/bubble.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { jsx as f, Fragment as I, jsxs as x } from "react/jsx-runtime";
|
|
2
|
-
import { a0 as
|
|
2
|
+
import { a0 as Gr, d as ws, E as Ce, a1 as Jr, a2 as qr, a3 as bs, a4 as _e, a5 as Xr, Q as ti, O as xs, v as Me, F as Re, T as ei, A as Zr, u as Qr, a6 as to, a7 as eo } from "./clsx-CDyrfCnw.js";
|
|
3
3
|
import { f as ys, s as Ss, o as ks, a as vs, b as Cs, d as _s, h as Es, e as Ts, c as ni } from "./index-CsSfYR30.js";
|
|
4
4
|
import { Plugin as Ee, PluginKey as ne, NodeSelection as no, TextSelection as io, SelectionRange as so, Selection as ro } from "@tiptap/pm/state";
|
|
5
|
-
import { C as oo, T as lo } from "./Table-
|
|
5
|
+
import { C as oo, T as lo } from "./Table-Bw7rLue7.js";
|
|
6
6
|
import Ds, { useRef as Xt, useEffect as pt, useState as F, useCallback as M, useMemo as yt, Fragment as ii } from "react";
|
|
7
7
|
import { createPortal as As } from "react-dom";
|
|
8
|
-
import {
|
|
9
|
-
import { S as mo, a as wo, b as bo, c as xo, d as yo } from "./select-
|
|
8
|
+
import { w as Z, h as W, D as ln, m as cn, A as y, n as an, o as hn, L as Tt, j as jt, p as dn, B as Bt, Y as co, q as ao, E as ho, v as uo, Z as fo, t as po, _ as go, I as tt } from "./index-_WrFM-Fk.js";
|
|
9
|
+
import { S as mo, a as wo, b as bo, c as xo, d as yo } from "./select-BelNLNvT.js";
|
|
10
10
|
import { Callout as Ne } from "./Callout.js";
|
|
11
|
-
import { u as ie, K as Un, s as So } from "./Katex-
|
|
11
|
+
import { u as ie, K as Un, s as So } from "./Katex-CZ4g3vA9.js";
|
|
12
12
|
import { u as Y, n as Ye, V as Ei } from "./index-4Q5IhypJ.js";
|
|
13
13
|
import { d as se } from "./delete-node-eQHsyyhR.js";
|
|
14
14
|
import { MultipleColumnNode as Ti } from "./Column.js";
|
|
15
15
|
import "./theme.js";
|
|
16
|
-
import { C as ko, s as vo, i as Co, D as vn } from "./Drawer-
|
|
16
|
+
import { C as ko, s as vo, i as Co, D as vn } from "./Drawer-B9l1SoRJ.js";
|
|
17
17
|
import { Editor as _o, makeDropdownToolbar as Eo } from "easydrawer";
|
|
18
|
-
import { S as Dt } from "./separator-
|
|
19
|
-
import { P as Is, a as Os, b as Ms } from "./popover-
|
|
18
|
+
import { S as Dt } from "./separator-Br5kcIJa.js";
|
|
19
|
+
import { P as Is, a as Os, b as Ms } from "./popover-CSvY4C-l.js";
|
|
20
20
|
import { Excalidraw as ce } from "./Excalidraw.js";
|
|
21
|
-
import { I as ae, g as To } from "./Iframe-
|
|
21
|
+
import { I as ae, g as To } from "./Iframe-MjeJ2OOI.js";
|
|
22
22
|
import Do from "katex";
|
|
23
23
|
import { Pencil as Ao, Trash2 as Io, Check as Di } from "lucide-react";
|
|
24
|
-
import { T as Ai } from "./textarea-
|
|
25
|
-
import { L as Ii, a as Oo, R as Mo } from "./LinkEditBlock-
|
|
24
|
+
import { T as Ai } from "./textarea-Ceev4t42.js";
|
|
25
|
+
import { L as Ii, a as Oo, R as Mo } from "./LinkEditBlock-CaDV3Vq5.js";
|
|
26
26
|
import { ImageGif as Ro } from "./ImageGif.js";
|
|
27
|
-
import { M as Rs, E as No } from "./Mermaid-
|
|
27
|
+
import { M as Rs, E as No } from "./Mermaid-EhYj_ICn.js";
|
|
28
28
|
import { RichTextBold as Uo } from "./Bold.js";
|
|
29
29
|
import { RichTextCode as Lo } from "./Code.js";
|
|
30
30
|
import "./index-C1WCZhyA.js";
|
|
31
31
|
import { RichTextColor as Po } from "./Color.js";
|
|
32
32
|
import { RichTextHighlight as Bo } from "./Highlight.js";
|
|
33
33
|
import { RichTextItalic as Vo } from "./Italic.js";
|
|
34
|
-
import { r as Ho } from "./SlashCommandNodeView-
|
|
34
|
+
import { r as Ho } from "./SlashCommandNodeView-CY3peX5x.js";
|
|
35
35
|
import { RichTextStrike as $o } from "./Strike.js";
|
|
36
36
|
import { RichTextAlign as Fo, TextAlign as zo } from "./TextAlign.js";
|
|
37
37
|
import { RichTextUnderline as Wo } from "./TextUnderline.js";
|
|
38
|
-
import { T as Oi, F as Ko } from "./Twitter-
|
|
38
|
+
import { T as Oi, F as Ko } from "./Twitter-pM0y5Z-L.js";
|
|
39
39
|
import { DecorationSet as Mi, Decoration as jo } from "@tiptap/pm/view";
|
|
40
40
|
import { NodeRange as Yo } from "@tiptap/pm/model";
|
|
41
|
-
import { Clear as
|
|
42
|
-
import { I as
|
|
43
|
-
import { D as qo, a as Xo, b as Zo, f as mt, d as Qo, g as Ui, h as Li, i as Pi, j as Bi } from "./dropdown-menu-
|
|
41
|
+
import { Clear as Go } from "./Clear.js";
|
|
42
|
+
import { I as Jo, a as Ri, s as Ni } from "./Indent-CgwDItIf.js";
|
|
43
|
+
import { D as qo, a as Xo, b as Zo, f as mt, d as Qo, g as Ui, h as Li, i as Pi, j as Bi } from "./dropdown-menu-nX-u8e2w.js";
|
|
44
44
|
function tl(e, t) {
|
|
45
45
|
const n = Math.min(e.top, t.top), i = Math.max(e.bottom, t.bottom), s = Math.min(e.left, t.left), o = Math.max(e.right, t.right) - s, l = i - n, c = s, a = n;
|
|
46
46
|
return new DOMRect(c, a, o, l);
|
|
@@ -73,7 +73,7 @@ var el = class {
|
|
|
73
73
|
onUpdate: void 0,
|
|
74
74
|
onDestroy: void 0
|
|
75
75
|
}, this.shouldShow = ({ view: h, state: d, from: u, to: p }) => {
|
|
76
|
-
const { doc: g, selection: m } = d, { empty: w } = m, b = !g.textBetween(u, p).length &&
|
|
76
|
+
const { doc: g, selection: m } = d, { empty: w } = m, b = !g.textBetween(u, p).length && Gr(d.selection), _ = this.element.contains(document.activeElement);
|
|
77
77
|
return !(!(h.hasFocus() || _) || w || b || !this.editor.isEditable);
|
|
78
78
|
}, this.mousedownHandler = () => {
|
|
79
79
|
this.preventHide = !0;
|
|
@@ -284,7 +284,7 @@ var nl = class {
|
|
|
284
284
|
}, this.element.tabIndex = 0, r && (this.shouldShow = r), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.update(n, n.state), this.getShouldShow() && (this.show(), this.updatePosition());
|
|
285
285
|
}
|
|
286
286
|
getTextContent(e) {
|
|
287
|
-
return
|
|
287
|
+
return Jr(e, { textSerializers: qr(this.editor.schema) });
|
|
288
288
|
}
|
|
289
289
|
get middlewares() {
|
|
290
290
|
const e = [];
|
|
@@ -458,7 +458,7 @@ const il = [
|
|
|
458
458
|
{ value: "warning", label: "Warning", icon: "TriangleAlert" },
|
|
459
459
|
{ value: "caution", label: "Caution", icon: "OctagonAlert" }
|
|
460
460
|
];
|
|
461
|
-
function
|
|
461
|
+
function Jd() {
|
|
462
462
|
const e = Z(), t = W(), { t: n } = Y(), { type: i, title: s, body: r } = ie(t, Ne.name, {
|
|
463
463
|
type: "note",
|
|
464
464
|
title: "",
|
|
@@ -1931,7 +1931,7 @@ class Bs {
|
|
|
1931
1931
|
this._observers = lt();
|
|
1932
1932
|
}
|
|
1933
1933
|
}
|
|
1934
|
-
const St = Math.floor, $e = Math.abs, Zt = (e, t) => e < t ? e : t, At = (e, t) => e > t ? e : t, Vs = (e) => e !== 0 ? e < 0 : 1 / e < 0, Vi = 1, Hi = 2, _n = 4, En = 8, pe = 32, bt = 64,
|
|
1934
|
+
const St = Math.floor, $e = Math.abs, Zt = (e, t) => e < t ? e : t, At = (e, t) => e > t ? e : t, Vs = (e) => e !== 0 ? e < 0 : 1 / e < 0, Vi = 1, Hi = 2, _n = 4, En = 8, pe = 32, bt = 64, G = 128, Rl = 1 << 29, un = 31, Bn = 63, Pt = 127, Nl = 2147483647, Hs = Number.MAX_SAFE_INTEGER, Ul = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && St(e) === e), Ll = String.fromCharCode, Pl = (e) => e.toLowerCase(), Bl = /^\s*/g, Vl = (e) => e.replace(Bl, ""), Hl = /([A-Z])/g, $i = (e, t) => Vl(e.replace(Hl, (n) => `${t}${Pl(n)}`)), $l = (e) => {
|
|
1935
1935
|
const t = unescape(encodeURIComponent(e)), n = t.length, i = new Uint8Array(n);
|
|
1936
1936
|
for (let s = 0; s < n; s++)
|
|
1937
1937
|
i[s] = /** @type {number} */
|
|
@@ -1972,13 +1972,13 @@ const De = () => new Te(), Wl = (e) => {
|
|
|
1972
1972
|
e.cpos === n && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(n * 2), e.cpos = 0), e.cbuf[e.cpos++] = t;
|
|
1973
1973
|
}, Vn = $, T = (e, t) => {
|
|
1974
1974
|
for (; t > Pt; )
|
|
1975
|
-
$(e,
|
|
1975
|
+
$(e, G | Pt & t), t = St(t / 128);
|
|
1976
1976
|
$(e, Pt & t);
|
|
1977
1977
|
}, ri = (e, t) => {
|
|
1978
1978
|
const n = Vs(t);
|
|
1979
|
-
for (n && (t = -t), $(e, (t > Bn ?
|
|
1980
|
-
$(e, (t > Pt ?
|
|
1981
|
-
}, Hn = new Uint8Array(3e4), Yl = Hn.length / 3,
|
|
1979
|
+
for (n && (t = -t), $(e, (t > Bn ? G : 0) | (n ? bt : 0) | Bn & t), t = St(t / 64); t > 0; )
|
|
1980
|
+
$(e, (t > Pt ? G : 0) | Pt & t), t = St(t / 128);
|
|
1981
|
+
}, Hn = new Uint8Array(3e4), Yl = Hn.length / 3, Gl = (e, t) => {
|
|
1982
1982
|
if (t.length < Yl) {
|
|
1983
1983
|
const n = ge.encodeInto(t, Hn).written || 0;
|
|
1984
1984
|
T(e, n);
|
|
@@ -1986,7 +1986,7 @@ const De = () => new Te(), Wl = (e) => {
|
|
|
1986
1986
|
$(e, Hn[i]);
|
|
1987
1987
|
} else
|
|
1988
1988
|
et(e, zl(t));
|
|
1989
|
-
},
|
|
1989
|
+
}, Jl = (e, t) => {
|
|
1990
1990
|
const n = unescape(encodeURIComponent(t)), i = n.length;
|
|
1991
1991
|
T(e, i);
|
|
1992
1992
|
for (let s = 0; s < i; s++)
|
|
@@ -1996,7 +1996,7 @@ const De = () => new Te(), Wl = (e) => {
|
|
|
1996
1996
|
n.codePointAt(s)
|
|
1997
1997
|
);
|
|
1998
1998
|
}, Yt = ge && /** @type {any} */
|
|
1999
|
-
ge.encodeInto ?
|
|
1999
|
+
ge.encodeInto ? Gl : Jl, fn = (e, t) => {
|
|
2000
2000
|
const n = e.cbuf.length, i = e.cpos, s = Zt(n - i, t.length), r = t.length - s;
|
|
2001
2001
|
e.cbuf.set(t.subarray(0, s), i), e.cpos += s, r > 0 && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(At(n * 2, r)), e.cbuf.set(t.subarray(s)), e.cpos = r);
|
|
2002
2002
|
}, et = (e, t) => {
|
|
@@ -2142,7 +2142,7 @@ const li = (e) => new pn(e), ec = (e) => e.pos !== e.arr.length, nc = (e, t) =>
|
|
|
2142
2142
|
const i = e.arr.length;
|
|
2143
2143
|
for (; e.pos < i; ) {
|
|
2144
2144
|
const s = e.arr[e.pos++];
|
|
2145
|
-
if (t = t + (s & Pt) * n, n *= 128, s <
|
|
2145
|
+
if (t = t + (s & Pt) * n, n *= 128, s < G)
|
|
2146
2146
|
return t;
|
|
2147
2147
|
if (t > Hs)
|
|
2148
2148
|
throw Fs;
|
|
@@ -2151,11 +2151,11 @@ const li = (e) => new pn(e), ec = (e) => e.pos !== e.arr.length, nc = (e, t) =>
|
|
|
2151
2151
|
}, ci = (e) => {
|
|
2152
2152
|
let t = e.arr[e.pos++], n = t & Bn, i = 64;
|
|
2153
2153
|
const s = (t & bt) > 0 ? -1 : 1;
|
|
2154
|
-
if ((t &
|
|
2154
|
+
if ((t & G) === 0)
|
|
2155
2155
|
return s * n;
|
|
2156
2156
|
const r = e.arr.length;
|
|
2157
2157
|
for (; e.pos < r; ) {
|
|
2158
|
-
if (t = e.arr[e.pos++], n = n + (t & Pt) * i, i *= 128, t <
|
|
2158
|
+
if (t = e.arr[e.pos++], n = n + (t & Pt) * i, i *= 128, t < G)
|
|
2159
2159
|
return s * n;
|
|
2160
2160
|
if (n > Hs)
|
|
2161
2161
|
throw Fs;
|
|
@@ -2214,19 +2214,19 @@ const li = (e) => new pn(e), ec = (e) => e.pos !== e.arr.length, nc = (e, t) =>
|
|
|
2214
2214
|
const t = R(e), n = {};
|
|
2215
2215
|
for (let i = 0; i < t; i++) {
|
|
2216
2216
|
const s = $n(e);
|
|
2217
|
-
n[s] =
|
|
2217
|
+
n[s] = Ge(e);
|
|
2218
2218
|
}
|
|
2219
2219
|
return n;
|
|
2220
2220
|
},
|
|
2221
2221
|
(e) => {
|
|
2222
2222
|
const t = R(e), n = [];
|
|
2223
2223
|
for (let i = 0; i < t; i++)
|
|
2224
|
-
n.push(
|
|
2224
|
+
n.push(Ge(e));
|
|
2225
2225
|
return n;
|
|
2226
2226
|
},
|
|
2227
2227
|
it
|
|
2228
2228
|
// CASE 116: Uint8Array
|
|
2229
|
-
],
|
|
2229
|
+
], Ge = (e) => cc[127 - me(e)](e);
|
|
2230
2230
|
class ji extends pn {
|
|
2231
2231
|
/**
|
|
2232
2232
|
* @param {Uint8Array} uint8Array
|
|
@@ -2299,7 +2299,7 @@ const hc = crypto.getRandomValues.bind(crypto), dc = Math.random, zs = () => hc(
|
|
|
2299
2299
|
new Promise(e)
|
|
2300
2300
|
);
|
|
2301
2301
|
Promise.all.bind(Promise);
|
|
2302
|
-
const
|
|
2302
|
+
const Gi = (e) => e === void 0 ? null : e;
|
|
2303
2303
|
class mc {
|
|
2304
2304
|
constructor() {
|
|
2305
2305
|
this.map = /* @__PURE__ */ new Map();
|
|
@@ -2326,7 +2326,7 @@ try {
|
|
|
2326
2326
|
const bc = Ws, xc = Object.assign, Ks = Object.keys, yc = (e, t) => {
|
|
2327
2327
|
for (const n in e)
|
|
2328
2328
|
t(e[n], n);
|
|
2329
|
-
},
|
|
2329
|
+
}, Ji = (e) => Ks(e).length, Sc = (e) => {
|
|
2330
2330
|
for (const t in e)
|
|
2331
2331
|
return !1;
|
|
2332
2332
|
return !0;
|
|
@@ -2335,7 +2335,7 @@ const bc = Ws, xc = Object.assign, Ks = Object.keys, yc = (e, t) => {
|
|
|
2335
2335
|
if (!t(e[n], n))
|
|
2336
2336
|
return !1;
|
|
2337
2337
|
return !0;
|
|
2338
|
-
}, kc = (e, t) => Object.prototype.hasOwnProperty.call(e, t), vc = (e, t) => e === t ||
|
|
2338
|
+
}, kc = (e, t) => Object.prototype.hasOwnProperty.call(e, t), vc = (e, t) => e === t || Ji(e) === Ji(t) && js(e, (n, i) => (n !== void 0 || kc(t, i)) && t[i] === n), Cc = Object.freeze, Ys = (e) => {
|
|
2339
2339
|
for (const t in e) {
|
|
2340
2340
|
const n = e[t];
|
|
2341
2341
|
(typeof n == "object" || typeof n == "function") && Ys(e[t]);
|
|
@@ -2348,7 +2348,7 @@ const bc = Ws, xc = Object.assign, Ks = Object.keys, yc = (e, t) => {
|
|
|
2348
2348
|
} finally {
|
|
2349
2349
|
n < e.length && hi(e, t, n + 1);
|
|
2350
2350
|
}
|
|
2351
|
-
}, _c = (e, t) => t.includes(e), te = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]",
|
|
2351
|
+
}, _c = (e, t) => t.includes(e), te = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", Gs = typeof window < "u" && typeof document < "u" && !te;
|
|
2352
2352
|
let ut;
|
|
2353
2353
|
const Ec = () => {
|
|
2354
2354
|
if (ut === void 0)
|
|
@@ -2368,15 +2368,15 @@ const Ec = () => {
|
|
|
2368
2368
|
}
|
|
2369
2369
|
})) : ut = lt();
|
|
2370
2370
|
return ut;
|
|
2371
|
-
}, Fn = (e) => Ec().has(e),
|
|
2372
|
-
|
|
2371
|
+
}, Fn = (e) => Ec().has(e), Je = (e) => Gi(te ? process.env[e.toUpperCase().replaceAll("-", "_")] : bc.getItem(e)), Js = (e) => Fn("--" + e) || Je(e) !== null;
|
|
2372
|
+
Js("production");
|
|
2373
2373
|
const Tc = te && _c(process.env.FORCE_COLOR, ["true", "1", "2"]), Dc = Tc || !Fn("--no-colors") && // @todo deprecate --no-colors
|
|
2374
|
-
!
|
|
2374
|
+
!Js("no-color") && (!te || process.stdout.isTTY) && (!te || Fn("--color") || Je("COLORTERM") !== null || (Je("TERM") || "").includes("color")), Ac = (e) => {
|
|
2375
2375
|
let t = "";
|
|
2376
2376
|
for (let n = 0; n < e.byteLength; n++)
|
|
2377
2377
|
t += Ll(e[n]);
|
|
2378
2378
|
return btoa(t);
|
|
2379
|
-
}, Ic = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), Oc =
|
|
2379
|
+
}, Ic = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), Oc = Gs ? Ac : Ic, Mc = (e) => Wl((t) => Qt(t, e));
|
|
2380
2380
|
class Rc {
|
|
2381
2381
|
/**
|
|
2382
2382
|
* @param {L} left
|
|
@@ -2506,7 +2506,7 @@ const Ot = (e, t, n) => t.clients.forEach((i, s) => {
|
|
|
2506
2506
|
for (let c = 0, a = i[c]; c < i.length && a.clock < l; a = i[++c])
|
|
2507
2507
|
dr(e, r, a.clock, a.len, n);
|
|
2508
2508
|
}
|
|
2509
|
-
}),
|
|
2509
|
+
}), Gc = (e, t) => {
|
|
2510
2510
|
let n = 0, i = e.length - 1;
|
|
2511
2511
|
for (; n <= i; ) {
|
|
2512
2512
|
const s = St((n + i) / 2), r = e[s], o = r.clock;
|
|
@@ -2520,7 +2520,7 @@ const Ot = (e, t, n) => t.clients.forEach((i, s) => {
|
|
|
2520
2520
|
return null;
|
|
2521
2521
|
}, oe = (e, t) => {
|
|
2522
2522
|
const n = e.clients.get(t.client);
|
|
2523
|
-
return n !== void 0 &&
|
|
2523
|
+
return n !== void 0 && Gc(n, t.clock) !== null;
|
|
2524
2524
|
}, fi = (e) => {
|
|
2525
2525
|
e.clients.forEach((t) => {
|
|
2526
2526
|
t.sort((s, r) => s.clock - r.clock);
|
|
@@ -2548,7 +2548,7 @@ const Ot = (e, t, n) => t.clients.forEach((i, s) => {
|
|
|
2548
2548
|
/** @type {Array<DeleteItem>} */
|
|
2549
2549
|
[]
|
|
2550
2550
|
)).push(new ui(n, i));
|
|
2551
|
-
}, sr = () => new re(),
|
|
2551
|
+
}, sr = () => new re(), Jc = (e) => {
|
|
2552
2552
|
const t = sr();
|
|
2553
2553
|
return e.clients.forEach((n, i) => {
|
|
2554
2554
|
const s = [];
|
|
@@ -2860,13 +2860,13 @@ class qe extends Xc {
|
|
|
2860
2860
|
* @return {ID}
|
|
2861
2861
|
*/
|
|
2862
2862
|
readLeftID() {
|
|
2863
|
-
return new
|
|
2863
|
+
return new Gt(this.clientDecoder.read(), this.leftClockDecoder.read());
|
|
2864
2864
|
}
|
|
2865
2865
|
/**
|
|
2866
2866
|
* @return {ID}
|
|
2867
2867
|
*/
|
|
2868
2868
|
readRightID() {
|
|
2869
|
-
return new
|
|
2869
|
+
return new Gt(this.clientDecoder.read(), this.rightClockDecoder.read());
|
|
2870
2870
|
}
|
|
2871
2871
|
/**
|
|
2872
2872
|
* Read the next client id.
|
|
@@ -2914,7 +2914,7 @@ class qe extends Xc {
|
|
|
2914
2914
|
* @return {any}
|
|
2915
2915
|
*/
|
|
2916
2916
|
readAny() {
|
|
2917
|
-
return
|
|
2917
|
+
return Ge(this.restDecoder);
|
|
2918
2918
|
}
|
|
2919
2919
|
/**
|
|
2920
2920
|
* @return {Uint8Array}
|
|
@@ -2930,7 +2930,7 @@ class qe extends Xc {
|
|
|
2930
2930
|
* @return {any}
|
|
2931
2931
|
*/
|
|
2932
2932
|
readJSON() {
|
|
2933
|
-
return
|
|
2933
|
+
return Ge(this.restDecoder);
|
|
2934
2934
|
}
|
|
2935
2935
|
/**
|
|
2936
2936
|
* @return {string}
|
|
@@ -3204,11 +3204,11 @@ const ea = (e, t, n, i) => {
|
|
|
3204
3204
|
break;
|
|
3205
3205
|
}
|
|
3206
3206
|
default: {
|
|
3207
|
-
const d = (h & (bt |
|
|
3207
|
+
const d = (h & (bt | G)) === 0, u = new A(
|
|
3208
3208
|
C(l, c),
|
|
3209
3209
|
null,
|
|
3210
3210
|
// left
|
|
3211
|
-
(h &
|
|
3211
|
+
(h & G) === G ? e.readLeftID() : null,
|
|
3212
3212
|
// origin
|
|
3213
3213
|
null,
|
|
3214
3214
|
// right
|
|
@@ -3359,7 +3359,7 @@ const Xi = () => new oa(), Zi = (e, t) => e.l.push(t), Qi = (e, t) => {
|
|
|
3359
3359
|
const n = e.l, i = n.length;
|
|
3360
3360
|
e.l = n.filter((s) => t !== s), i === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
|
|
3361
3361
|
}, lr = (e, t, n) => hi(e.l, [t, n]);
|
|
3362
|
-
class
|
|
3362
|
+
class Gt {
|
|
3363
3363
|
/**
|
|
3364
3364
|
* @param {number} client client id
|
|
3365
3365
|
* @param {number} clock unique per client id, continuous number
|
|
@@ -3368,7 +3368,7 @@ class Jt {
|
|
|
3368
3368
|
this.client = t, this.clock = n;
|
|
3369
3369
|
}
|
|
3370
3370
|
}
|
|
3371
|
-
const Ue = (e, t) => e === t || e !== null && t !== null && e.client === t.client && e.clock === t.clock, C = (e, t) => new
|
|
3371
|
+
const Ue = (e, t) => e === t || e !== null && t !== null && e.client === t.client && e.clock === t.clock, C = (e, t) => new Gt(e, t), be = (e) => {
|
|
3372
3372
|
for (const [t, n] of e.doc.share.entries())
|
|
3373
3373
|
if (n === e)
|
|
3374
3374
|
return t;
|
|
@@ -3425,7 +3425,7 @@ const ca = (e, t, n = 0) => new la(e, t, n), Le = (e, t, n) => {
|
|
|
3425
3425
|
}
|
|
3426
3426
|
return Le(e, null, n);
|
|
3427
3427
|
}, aa = (e, t) => {
|
|
3428
|
-
const n =
|
|
3428
|
+
const n = Jt(e, t), i = t.clock - n.id.clock;
|
|
3429
3429
|
return {
|
|
3430
3430
|
item: n,
|
|
3431
3431
|
diff: i
|
|
@@ -3436,7 +3436,7 @@ const ca = (e, t, n = 0) => new la(e, t, n), Le = (e, t, n) => {
|
|
|
3436
3436
|
if (s !== null) {
|
|
3437
3437
|
if (L(i, s.client) <= s.clock)
|
|
3438
3438
|
return null;
|
|
3439
|
-
const h = n ?
|
|
3439
|
+
const h = n ? Gn(i, s) : aa(i, s), d = h.item;
|
|
3440
3440
|
if (!(d instanceof A))
|
|
3441
3441
|
return null;
|
|
3442
3442
|
if (c = /** @type {AbstractType<any>} */
|
|
@@ -3452,7 +3452,7 @@ const ca = (e, t, n = 0) => new la(e, t, n), Le = (e, t, n) => {
|
|
|
3452
3452
|
else if (r !== null) {
|
|
3453
3453
|
if (L(i, r.client) <= r.clock)
|
|
3454
3454
|
return null;
|
|
3455
|
-
const { item: h } = n ?
|
|
3455
|
+
const { item: h } = n ? Gn(i, r) : { item: Jt(i, r) };
|
|
3456
3456
|
if (h instanceof A && h.content instanceof dt)
|
|
3457
3457
|
c = h.content.type;
|
|
3458
3458
|
else
|
|
@@ -3472,10 +3472,10 @@ class gi {
|
|
|
3472
3472
|
this.ds = t, this.sv = n;
|
|
3473
3473
|
}
|
|
3474
3474
|
}
|
|
3475
|
-
const cr = (e, t) => new gi(e, t), On = (e) => cr(
|
|
3475
|
+
const cr = (e, t) => new gi(e, t), On = (e) => cr(Jc(e.store), mn(e.store)), Lt = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !oe(t.ds, e.id), Kn = (e, t) => {
|
|
3476
3476
|
const n = kt(e.meta, Kn, Vt), i = e.doc.store;
|
|
3477
3477
|
n.has(t) || (t.sv.forEach((s, r) => {
|
|
3478
|
-
s < L(i, r) &&
|
|
3478
|
+
s < L(i, r) && J(e, C(r, s));
|
|
3479
3479
|
}), Ot(e, t.ds, (s) => {
|
|
3480
3480
|
}), n.add(t));
|
|
3481
3481
|
};
|
|
@@ -3524,13 +3524,13 @@ const mn = (e) => {
|
|
|
3524
3524
|
}, da = (e, t) => {
|
|
3525
3525
|
const n = e.clients.get(t.client);
|
|
3526
3526
|
return n[at(n, t.clock)];
|
|
3527
|
-
},
|
|
3527
|
+
}, Jt = (
|
|
3528
3528
|
/** @type {function(StructStore,ID):Item} */
|
|
3529
3529
|
da
|
|
3530
3530
|
), jn = (e, t, n) => {
|
|
3531
3531
|
const i = at(t, n), s = t[i];
|
|
3532
3532
|
return s.id.clock < n && s instanceof A ? (t.splice(i + 1, 0, nn(e, s, n - s.id.clock)), i + 1) : i;
|
|
3533
|
-
},
|
|
3533
|
+
}, J = (e, t) => {
|
|
3534
3534
|
const n = (
|
|
3535
3535
|
/** @type {Array<Item>} */
|
|
3536
3536
|
e.doc.store.clients.get(t.client)
|
|
@@ -3707,8 +3707,8 @@ const is = (e, t, n) => {
|
|
|
3707
3707
|
Ot(l, a.insertions, (p) => {
|
|
3708
3708
|
if (p instanceof A) {
|
|
3709
3709
|
if (p.redone !== null) {
|
|
3710
|
-
let { item: g, diff: m } =
|
|
3711
|
-
m > 0 && (g =
|
|
3710
|
+
let { item: g, diff: m } = Gn(c, p.id);
|
|
3711
|
+
m > 0 && (g = J(l, C(g.id.client, g.id.clock + m))), p = g;
|
|
3712
3712
|
}
|
|
3713
3713
|
!p.deleted && r.some((g) => g === l.doc || xe(
|
|
3714
3714
|
/** @type {AbstractType<any>} */
|
|
@@ -3910,11 +3910,11 @@ function* wa(e) {
|
|
|
3910
3910
|
const c = R(e.restDecoder);
|
|
3911
3911
|
yield new rt(C(s, r), c), r += c;
|
|
3912
3912
|
} else if ((un & l) !== 0) {
|
|
3913
|
-
const c = (l & (bt |
|
|
3913
|
+
const c = (l & (bt | G)) === 0, a = new A(
|
|
3914
3914
|
C(s, r),
|
|
3915
3915
|
null,
|
|
3916
3916
|
// left
|
|
3917
|
-
(l &
|
|
3917
|
+
(l & G) === G ? e.readLeftID() : null,
|
|
3918
3918
|
// origin
|
|
3919
3919
|
null,
|
|
3920
3920
|
// right
|
|
@@ -4525,7 +4525,7 @@ const wr = (e, t, n) => {
|
|
|
4525
4525
|
for (r !== null && (o = r.p, n -= r.index, n === 0 && (o = o.prev, n += o && o.countable && !o.deleted ? o.length : 0)); o !== null; o = o.right)
|
|
4526
4526
|
if (!o.deleted && o.countable) {
|
|
4527
4527
|
if (n <= o.length) {
|
|
4528
|
-
n < o.length &&
|
|
4528
|
+
n < o.length && J(e, C(o.id.client, o.id.clock + n));
|
|
4529
4529
|
break;
|
|
4530
4530
|
}
|
|
4531
4531
|
n -= o.length;
|
|
@@ -4543,9 +4543,9 @@ const wr = (e, t, n) => {
|
|
|
4543
4543
|
const s = n, r = i, o = bn(t, n);
|
|
4544
4544
|
let l = t._start;
|
|
4545
4545
|
for (o !== null && (l = o.p, n -= o.index); l !== null && n > 0; l = l.right)
|
|
4546
|
-
!l.deleted && l.countable && (n < l.length &&
|
|
4546
|
+
!l.deleted && l.countable && (n < l.length && J(e, C(l.id.client, l.id.clock + n)), n -= l.length);
|
|
4547
4547
|
for (; i > 0 && l !== null; )
|
|
4548
|
-
l.deleted || (i < l.length &&
|
|
4548
|
+
l.deleted || (i < l.length && J(e, C(l.id.client, l.id.clock + i)), l.delete(e), i -= l.length), l = l.right;
|
|
4549
4549
|
if (i > 0)
|
|
4550
4550
|
throw kr();
|
|
4551
4551
|
t._searchMarker && ye(
|
|
@@ -5074,7 +5074,7 @@ const ls = (e, t, n) => {
|
|
|
5074
5074
|
);
|
|
5075
5075
|
break;
|
|
5076
5076
|
default:
|
|
5077
|
-
t.right.deleted || (n < t.right.length &&
|
|
5077
|
+
t.right.deleted || (n < t.right.length && J(e, C(t.right.id.client, t.right.id.clock + n)), t.index += t.right.length, n -= t.right.length);
|
|
5078
5078
|
break;
|
|
5079
5079
|
}
|
|
5080
5080
|
t.left = t.right, t.right = t.right.right;
|
|
@@ -5171,7 +5171,7 @@ const ls = (e, t, n) => {
|
|
|
5171
5171
|
break;
|
|
5172
5172
|
}
|
|
5173
5173
|
default:
|
|
5174
|
-
i < n.right.length &&
|
|
5174
|
+
i < n.right.length && J(e, C(n.right.id.client, n.right.id.clock + i)), i -= n.right.length;
|
|
5175
5175
|
break;
|
|
5176
5176
|
}
|
|
5177
5177
|
n.forward();
|
|
@@ -5307,7 +5307,7 @@ const ls = (e, t, n) => {
|
|
|
5307
5307
|
case dt:
|
|
5308
5308
|
case Wt:
|
|
5309
5309
|
case ht:
|
|
5310
|
-
n < t.right.length &&
|
|
5310
|
+
n < t.right.length && J(e, C(t.right.id.client, t.right.id.clock + n)), n -= t.right.length, t.right.delete(e);
|
|
5311
5311
|
break;
|
|
5312
5312
|
}
|
|
5313
5313
|
t.forward();
|
|
@@ -6892,7 +6892,7 @@ class B {
|
|
|
6892
6892
|
return 6;
|
|
6893
6893
|
}
|
|
6894
6894
|
}
|
|
6895
|
-
const
|
|
6895
|
+
const Ga = (e) => new B(e.readKey(), e.readJSON());
|
|
6896
6896
|
class en {
|
|
6897
6897
|
/**
|
|
6898
6898
|
* @param {Array<any>} arr
|
|
@@ -6974,14 +6974,14 @@ class en {
|
|
|
6974
6974
|
return 2;
|
|
6975
6975
|
}
|
|
6976
6976
|
}
|
|
6977
|
-
const
|
|
6977
|
+
const Ja = (e) => {
|
|
6978
6978
|
const t = e.readLen(), n = [];
|
|
6979
6979
|
for (let i = 0; i < t; i++) {
|
|
6980
6980
|
const s = e.readString();
|
|
6981
6981
|
s === "undefined" ? n.push(void 0) : n.push(JSON.parse(s));
|
|
6982
6982
|
}
|
|
6983
6983
|
return new en(n);
|
|
6984
|
-
}, qa =
|
|
6984
|
+
}, qa = Je("node_env") === "development";
|
|
6985
6985
|
class Ft {
|
|
6986
6986
|
/**
|
|
6987
6987
|
* @param {Array<any>} arr
|
|
@@ -7248,10 +7248,10 @@ class dt {
|
|
|
7248
7248
|
return 7;
|
|
7249
7249
|
}
|
|
7250
7250
|
}
|
|
7251
|
-
const lh = (e) => new dt(Qa[e.readTypeRef()](e)),
|
|
7251
|
+
const lh = (e) => new dt(Qa[e.readTypeRef()](e)), Gn = (e, t) => {
|
|
7252
7252
|
let n = t, i = 0, s;
|
|
7253
7253
|
do
|
|
7254
|
-
i > 0 && (n = C(n.client, n.clock + i)), s =
|
|
7254
|
+
i > 0 && (n = C(n.client, n.clock + i)), s = Jt(e, n), i = n.clock - s.id.clock, n = s.redone;
|
|
7255
7255
|
while (n !== null && s instanceof A);
|
|
7256
7256
|
return {
|
|
7257
7257
|
item: s,
|
|
@@ -7280,7 +7280,7 @@ const lh = (e) => new dt(Qa[e.readTypeRef()](e)), Jn = (e, t) => {
|
|
|
7280
7280
|
), Mr = (e, t, n, i, s, r) => {
|
|
7281
7281
|
const o = e.doc, l = o.store, c = o.clientID, a = t.redone;
|
|
7282
7282
|
if (a !== null)
|
|
7283
|
-
return
|
|
7283
|
+
return J(e, a);
|
|
7284
7284
|
let h = (
|
|
7285
7285
|
/** @type {AbstractType<any>} */
|
|
7286
7286
|
t.parent._item
|
|
@@ -7289,7 +7289,7 @@ const lh = (e) => new dt(Qa[e.readTypeRef()](e)), Jn = (e, t) => {
|
|
|
7289
7289
|
if (h.redone === null && (!n.has(h) || Mr(e, h, n, i, s, r) === null))
|
|
7290
7290
|
return null;
|
|
7291
7291
|
for (; h.redone !== null; )
|
|
7292
|
-
h =
|
|
7292
|
+
h = J(e, h.redone);
|
|
7293
7293
|
}
|
|
7294
7294
|
const p = h === null ? (
|
|
7295
7295
|
/** @type {AbstractType<any>} */
|
|
@@ -7303,7 +7303,7 @@ const lh = (e) => new dt(Qa[e.readTypeRef()](e)), Jn = (e, t) => {
|
|
|
7303
7303
|
let b = d;
|
|
7304
7304
|
for (; b !== null && /** @type {AbstractType<any>} */
|
|
7305
7305
|
b.parent._item !== h; )
|
|
7306
|
-
b = b.redone === null ? null :
|
|
7306
|
+
b = b.redone === null ? null : J(e, b.redone);
|
|
7307
7307
|
if (b !== null && /** @type {AbstractType<any>} */
|
|
7308
7308
|
b.parent._item === h) {
|
|
7309
7309
|
d = b;
|
|
@@ -7315,7 +7315,7 @@ const lh = (e) => new dt(Qa[e.readTypeRef()](e)), Jn = (e, t) => {
|
|
|
7315
7315
|
let b = u;
|
|
7316
7316
|
for (; b !== null && /** @type {AbstractType<any>} */
|
|
7317
7317
|
b.parent._item !== h; )
|
|
7318
|
-
b = b.redone === null ? null :
|
|
7318
|
+
b = b.redone === null ? null : J(e, b.redone);
|
|
7319
7319
|
if (b !== null && /** @type {AbstractType<any>} */
|
|
7320
7320
|
b.parent._item === h) {
|
|
7321
7321
|
u = b;
|
|
@@ -7325,7 +7325,7 @@ const lh = (e) => new dt(Qa[e.readTypeRef()](e)), Jn = (e, t) => {
|
|
|
7325
7325
|
}
|
|
7326
7326
|
} else if (u = null, t.right && !s) {
|
|
7327
7327
|
for (d = t; d !== null && d.right !== null && (d.right.redone || oe(i, d.right.id) || hs(r.undoStack, d.right.id) || hs(r.redoStack, d.right.id)); )
|
|
7328
|
-
for (d = d.right; d.redone; ) d =
|
|
7328
|
+
for (d = d.right; d.redone; ) d = J(e, d.redone);
|
|
7329
7329
|
if (d && d.right !== null)
|
|
7330
7330
|
return null;
|
|
7331
7331
|
} else
|
|
@@ -7404,14 +7404,14 @@ class A extends xi {
|
|
|
7404
7404
|
return this.origin.client;
|
|
7405
7405
|
if (this.rightOrigin && this.rightOrigin.client !== this.id.client && this.rightOrigin.clock >= L(n, this.rightOrigin.client))
|
|
7406
7406
|
return this.rightOrigin.client;
|
|
7407
|
-
if (this.parent && this.parent.constructor ===
|
|
7407
|
+
if (this.parent && this.parent.constructor === Gt && this.id.client !== this.parent.client && this.parent.clock >= L(n, this.parent.client))
|
|
7408
7408
|
return this.parent.client;
|
|
7409
|
-
if (this.origin && (this.left = ts(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right =
|
|
7409
|
+
if (this.origin && (this.left = ts(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = J(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === st || this.right && this.right.constructor === st)
|
|
7410
7410
|
this.parent = null;
|
|
7411
7411
|
else if (!this.parent)
|
|
7412
7412
|
this.left && this.left.constructor === A ? (this.parent = this.left.parent, this.parentSub = this.left.parentSub) : this.right && this.right.constructor === A && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
|
|
7413
|
-
else if (this.parent.constructor ===
|
|
7414
|
-
const i =
|
|
7413
|
+
else if (this.parent.constructor === Gt) {
|
|
7414
|
+
const i = Jt(n, this.parent);
|
|
7415
7415
|
i.constructor === st ? this.parent = null : this.parent = /** @type {ContentType} */
|
|
7416
7416
|
i.content.type;
|
|
7417
7417
|
}
|
|
@@ -7441,8 +7441,8 @@ class A extends xi {
|
|
|
7441
7441
|
i = s, r.clear();
|
|
7442
7442
|
else if (Ue(this.rightOrigin, s.rightOrigin))
|
|
7443
7443
|
break;
|
|
7444
|
-
} else if (s.origin !== null && o.has(
|
|
7445
|
-
r.has(
|
|
7444
|
+
} else if (s.origin !== null && o.has(Jt(t.doc.store, s.origin)))
|
|
7445
|
+
r.has(Jt(t.doc.store, s.origin)) || (i = s, r.clear());
|
|
7446
7446
|
else
|
|
7447
7447
|
break;
|
|
7448
7448
|
s = s.right;
|
|
@@ -7549,7 +7549,7 @@ class A extends xi {
|
|
|
7549
7549
|
* @param {number} offset
|
|
7550
7550
|
*/
|
|
7551
7551
|
write(t, n) {
|
|
7552
|
-
const i = n > 0 ? C(this.id.client, this.id.clock + n - 1) : this.origin, s = this.rightOrigin, r = this.parentSub, o = this.content.getRef() & un | (i === null ? 0 :
|
|
7552
|
+
const i = n > 0 ? C(this.id.client, this.id.clock + n - 1) : this.origin, s = this.rightOrigin, r = this.parentSub, o = this.content.getRef() & un | (i === null ? 0 : G) | // origin is defined
|
|
7553
7553
|
(s === null ? 0 : bt) | // right origin is defined
|
|
7554
7554
|
(r === null ? 0 : pe);
|
|
7555
7555
|
if (t.writeInfo(o), i !== null && t.writeLeftID(i), s !== null && t.writeRightID(s), i === null && s === null) {
|
|
@@ -7564,7 +7564,7 @@ class A extends xi {
|
|
|
7564
7564
|
t.writeParentInfo(!0), t.writeString(a);
|
|
7565
7565
|
} else
|
|
7566
7566
|
t.writeParentInfo(!1), t.writeLeftID(c.id);
|
|
7567
|
-
} else l.constructor === String ? (t.writeParentInfo(!0), t.writeString(l)) : l.constructor ===
|
|
7567
|
+
} else l.constructor === String ? (t.writeParentInfo(!0), t.writeString(l)) : l.constructor === Gt ? (t.writeParentInfo(!1), t.writeLeftID(l)) : X();
|
|
7568
7568
|
r !== null && t.writeString(r);
|
|
7569
7569
|
}
|
|
7570
7570
|
this.content.write(t, n);
|
|
@@ -7577,7 +7577,7 @@ const Rr = (e, t) => ch[t & un](e), ch = [
|
|
|
7577
7577
|
// GC is not ItemContent
|
|
7578
7578
|
Ka,
|
|
7579
7579
|
// 1
|
|
7580
|
-
|
|
7580
|
+
Ja,
|
|
7581
7581
|
// 2
|
|
7582
7582
|
Wa,
|
|
7583
7583
|
// 3
|
|
@@ -7585,7 +7585,7 @@ const Rr = (e, t) => ch[t & un](e), ch = [
|
|
|
7585
7585
|
// 4
|
|
7586
7586
|
Ya,
|
|
7587
7587
|
// 5
|
|
7588
|
-
|
|
7588
|
+
Ga,
|
|
7589
7589
|
// 6
|
|
7590
7590
|
lh,
|
|
7591
7591
|
// 7
|
|
@@ -7766,7 +7766,7 @@ class Sh {
|
|
|
7766
7766
|
if (n % 64 !== 0) {
|
|
7767
7767
|
for (this._W.fill(0, o, 16); n < t.length; )
|
|
7768
7768
|
this._W[o] |= t[n] << (3 - n % 4) * 8, n++;
|
|
7769
|
-
this._W[o] |=
|
|
7769
|
+
this._W[o] |= G << (3 - n % 4) * 8;
|
|
7770
7770
|
}
|
|
7771
7771
|
this._updateHash();
|
|
7772
7772
|
}
|
|
@@ -7776,7 +7776,7 @@ class Sh {
|
|
|
7776
7776
|
for (; n < t.length; s++)
|
|
7777
7777
|
for (let o = 3; o >= 0 && n < t.length; o--)
|
|
7778
7778
|
this._W[s] |= t[n++] << o * 8;
|
|
7779
|
-
i || (this._W[s - (n % 4 === 0 ? 0 : 1)] |=
|
|
7779
|
+
i || (this._W[s - (n % 4 === 0 ? 0 : 1)] |= G << (3 - n % 4) * 8), this._W[14] = t.byteLength / Rl, this._W[15] = t.byteLength * 8, this._updateHash();
|
|
7780
7780
|
const r = new Uint8Array(32);
|
|
7781
7781
|
for (let o = 0; o < this._H.length; o++)
|
|
7782
7782
|
for (let l = 0; l < 4; l++)
|
|
@@ -7916,7 +7916,7 @@ t.sv.get(e.id.client) > e.id.clock && !oe(t.ds, e.id), _h = [{ light: "#ecd44433
|
|
|
7916
7916
|
}, Ah = (e, t) => {
|
|
7917
7917
|
const n = e.doc.resolve(t);
|
|
7918
7918
|
return n.nodeAfter ? Qr.create(e.doc, t) : ei.near(n);
|
|
7919
|
-
},
|
|
7919
|
+
}, Jn = (e, t) => ({
|
|
7920
7920
|
type: (
|
|
7921
7921
|
/** @type {any} */
|
|
7922
7922
|
t.selection.jsonID
|
|
@@ -7939,7 +7939,7 @@ class Ih {
|
|
|
7939
7939
|
*/
|
|
7940
7940
|
constructor(t, n = /* @__PURE__ */ new Map()) {
|
|
7941
7941
|
this.type = t, this.prosemirrorView = null, this.mux = hh(), this.mapping = n, this.isOMark = /* @__PURE__ */ new Map(), this._observeFunction = this._typeChanged.bind(this), this.doc = t.doc, this.beforeTransactionSelection = null, this.beforeAllTransactions = () => {
|
|
7942
|
-
this.beforeTransactionSelection === null && this.prosemirrorView != null && (this.beforeTransactionSelection =
|
|
7942
|
+
this.beforeTransactionSelection === null && this.prosemirrorView != null && (this.beforeTransactionSelection = Jn(
|
|
7943
7943
|
this,
|
|
7944
7944
|
this.prosemirrorView.state
|
|
7945
7945
|
));
|
|
@@ -7956,7 +7956,7 @@ class Ih {
|
|
|
7956
7956
|
return this.prosemirrorView.state.tr.setMeta("addToHistory", !1);
|
|
7957
7957
|
}
|
|
7958
7958
|
_isLocalCursorInView() {
|
|
7959
|
-
return this.prosemirrorView.hasFocus() ? (
|
|
7959
|
+
return this.prosemirrorView.hasFocus() ? (Gs && this._domSelectionInView === null && (qs(0, () => {
|
|
7960
7960
|
this._domSelectionInView = null;
|
|
7961
7961
|
}), this._domSelectionInView = this._isDomSelectionInView()), this._domSelectionInView) : !1;
|
|
7962
7962
|
}
|
|
@@ -8127,7 +8127,7 @@ class Ih {
|
|
|
8127
8127
|
*/
|
|
8128
8128
|
_prosemirrorChanged(t) {
|
|
8129
8129
|
this.doc.transact(() => {
|
|
8130
|
-
Xn(this.doc, this.type, t, this), this.beforeTransactionSelection =
|
|
8130
|
+
Xn(this.doc, this.type, t, this), this.beforeTransactionSelection = Jn(
|
|
8131
8131
|
this,
|
|
8132
8132
|
this.prosemirrorView.state
|
|
8133
8133
|
);
|
|
@@ -8621,7 +8621,7 @@ const Hh = (e) => {
|
|
|
8621
8621
|
const l = U.getState(o).binding, c = s.undoManager, a = c.undoStack.length > 0, h = c.redoStack.length > 0;
|
|
8622
8622
|
return l ? {
|
|
8623
8623
|
undoManager: c,
|
|
8624
|
-
prevSel:
|
|
8624
|
+
prevSel: Jn(l, r),
|
|
8625
8625
|
hasUndoOps: a,
|
|
8626
8626
|
hasRedoOps: h
|
|
8627
8627
|
} : a !== s.hasUndoOps || h !== s.hasRedoOps ? Object.assign({}, s, {
|
|
@@ -8811,7 +8811,7 @@ function Sn(e, t, n) {
|
|
|
8811
8811
|
i.push(d);
|
|
8812
8812
|
}), i;
|
|
8813
8813
|
}
|
|
8814
|
-
var
|
|
8814
|
+
var Gh = class Fr {
|
|
8815
8815
|
constructor(t, n) {
|
|
8816
8816
|
this.anchor = t, this.head = n;
|
|
8817
8817
|
}
|
|
@@ -8877,7 +8877,7 @@ var Jh = class Fr {
|
|
|
8877
8877
|
return new this(t.resolve(n), t.resolve(i), s, r);
|
|
8878
8878
|
}
|
|
8879
8879
|
getBookmark() {
|
|
8880
|
-
return new
|
|
8880
|
+
return new Gh(this.anchor, this.head);
|
|
8881
8881
|
}
|
|
8882
8882
|
};
|
|
8883
8883
|
Et.prototype.visible = !1;
|
|
@@ -8968,7 +8968,7 @@ Ce.create({
|
|
|
8968
8968
|
];
|
|
8969
8969
|
}
|
|
8970
8970
|
});
|
|
8971
|
-
function
|
|
8971
|
+
function Jh(e) {
|
|
8972
8972
|
let t = "";
|
|
8973
8973
|
const n = getComputedStyle(e);
|
|
8974
8974
|
for (let i = 0; i < n.length; i += 1)
|
|
@@ -8978,7 +8978,7 @@ function Gh(e) {
|
|
|
8978
8978
|
function qh(e) {
|
|
8979
8979
|
const t = e.cloneNode(!0), n = [e, ...Array.from(e.getElementsByTagName("*"))], i = [t, ...Array.from(t.getElementsByTagName("*"))];
|
|
8980
8980
|
return n.forEach((s, r) => {
|
|
8981
|
-
i[r].style.cssText =
|
|
8981
|
+
i[r].style.cssText = Jh(s);
|
|
8982
8982
|
}), t;
|
|
8983
8983
|
}
|
|
8984
8984
|
function Xh(e, t) {
|
|
@@ -9311,9 +9311,9 @@ function hu() {
|
|
|
9311
9311
|
const e = W(), t = Z(), { t: n } = Y(), [i, s] = F(null), [r, o] = F(-1), [l, c] = F(!1), a = (S = (D = e == null ? void 0 : e.extensionManager) == null ? void 0 : D.extensions) == null ? void 0 : S.some(
|
|
9312
9312
|
(v) => (v == null ? void 0 : v.name) === zo.name
|
|
9313
9313
|
), h = (N = (k = e == null ? void 0 : e.extensionManager) == null ? void 0 : k.extensions) == null ? void 0 : N.some(
|
|
9314
|
-
(v) => (v == null ? void 0 : v.name) === Go.name
|
|
9315
|
-
), d = (nt = (H = e == null ? void 0 : e.extensionManager) == null ? void 0 : H.extensions) == null ? void 0 : nt.some(
|
|
9316
9314
|
(v) => (v == null ? void 0 : v.name) === Jo.name
|
|
9315
|
+
), d = (nt = (H = e == null ? void 0 : e.extensionManager) == null ? void 0 : H.extensions) == null ? void 0 : nt.some(
|
|
9316
|
+
(v) => (v == null ? void 0 : v.name) === Go.name
|
|
9317
9317
|
);
|
|
9318
9318
|
function u() {
|
|
9319
9319
|
const v = e.chain();
|
|
@@ -9515,7 +9515,7 @@ function hu() {
|
|
|
9515
9515
|
);
|
|
9516
9516
|
}
|
|
9517
9517
|
export {
|
|
9518
|
-
|
|
9518
|
+
Jd as RichTextBubbleCallout,
|
|
9519
9519
|
qd as RichTextBubbleColumns,
|
|
9520
9520
|
Xd as RichTextBubbleDrawer,
|
|
9521
9521
|
Zd as RichTextBubbleExcalidraw,
|