reactjs-tiptap-editor 1.0.6 → 1.0.8
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-htJNI0Fa.js → ActionMenuButton-Cc0vy5hy.js} +10 -13
- package/lib/ActionMenuButton-t7e5GCJp.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.js +23 -25
- package/lib/Blockquote.cjs +2 -2
- package/lib/Blockquote.js +5 -6
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.js +5 -6
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.js +11 -12
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.js +3 -3
- package/lib/Code.cjs +1 -1
- package/lib/Code.js +9 -10
- package/lib/CodeBlock.cjs +39 -39
- package/lib/CodeBlock.js +837 -946
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.js +8 -9
- package/lib/Color.cjs +1 -1
- package/lib/Color.js +18 -19
- package/lib/Column.cjs +1 -1
- package/lib/Column.js +5 -6
- package/lib/{Drawer-1211urKj.js → Drawer-C6WTtcd0.js} +16 -17
- package/lib/Drawer-DRdsK4f_.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.js +3 -3
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.js +15 -16
- package/lib/{Excalidraw-Du3hBR8t.js → Excalidraw-DjO5sCC_.js} +31 -32
- package/lib/Excalidraw-gJ99kWdS.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.js +2 -2
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.js +17 -18
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.js +5 -6
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.js +5 -5
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.js +5 -5
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.js +15 -15
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.js +7 -8
- package/lib/History.cjs +1 -1
- package/lib/History.js +8 -10
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.js +5 -6
- package/lib/Icon-DHNSWrSX.cjs +1 -0
- package/lib/{Icon-C-qYUAS1.js → Icon-prdLEHMN.js} +3 -4
- package/lib/{Iframe-DTYTLQE6.js → Iframe-CERKUXQh.js} +13 -14
- package/lib/Iframe-CvymVtpM.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.js +2 -2
- package/lib/Image.cjs +1 -1
- package/lib/Image.js +48 -49
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.js +22 -23
- package/lib/ImportWord.cjs +2 -2
- package/lib/ImportWord.js +10 -11
- package/lib/{Indent-jOPn3eUM.js → Indent-BfEOOT5B.js} +24 -25
- package/lib/Indent-CE6kk62r.cjs +1 -0
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.js +2 -2
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.js +10 -11
- package/lib/{Katex-CERSrcTP.js → Katex-5KNTSK8T.js} +21 -22
- package/lib/Katex-CJ2Fmvut.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.js +14 -15
- package/lib/Link.cjs +1 -1
- package/lib/Link.js +2 -2
- package/lib/{LinkEditBlock-B5SdhOfa.js → LinkEditBlock-CFkyS2Ze.js} +55 -56
- package/lib/{LinkEditBlock-DaxljgJC.cjs → LinkEditBlock-D6z0Yohc.cjs} +2 -2
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.js +138 -132
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.js +20 -20
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.js +22 -24
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.js +5 -6
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.js +18 -19
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.js +13 -13
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.js +5 -6
- package/lib/{Table-39OkCQbu.js → Table-CWbY_hqo.js} +7 -8
- package/lib/Table-D9pRzwFU.cjs +9 -0
- package/lib/Table.cjs +1 -1
- package/lib/Table.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.js +13 -14
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.js +17 -19
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.js +17 -19
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.js +5 -6
- package/lib/{Twitter-D7PhLycr.js → Twitter-BV7HA-MO.js} +566 -525
- package/lib/Twitter-D7NK3MZe.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.js +2 -2
- package/lib/Video.cjs +1 -1
- package/lib/Video.js +24 -25
- package/lib/bubble.cjs +4 -4
- package/lib/bubble.js +433 -423
- package/lib/{button-Crm67hfl.js → button-0963_Pa8.js} +3 -4
- package/lib/button-Bxfjx9_Y.cjs +1 -0
- package/lib/{checkbox-DViVmgJ6.js → checkbox-D4p6-UMt.js} +1 -1
- package/lib/{checkbox-NQC2MdGT.cjs → checkbox-Q6FcMQW5.cjs} +1 -1
- package/lib/{dialog-Ce9Cjfft.js → dialog-B-9_Z5j2.js} +1 -1
- package/lib/{dialog-DaHBd2zw.cjs → dialog-D-oYxagG.cjs} +1 -1
- package/lib/{dropdown-menu-CQykJhBs.js → dropdown-menu-par18QL5.js} +1 -1
- package/lib/{dropdown-menu-CSCDQtq0.cjs → dropdown-menu-r8XibZQU.cjs} +1 -1
- package/lib/extensions/Mention/Mention.d.ts +3 -1
- package/lib/extensions/Mention/components/NodeViewMentionList.d.ts +7 -1
- package/lib/{index-DCJheRBq.cjs → index--nUS7Y66.cjs} +1 -1
- package/lib/{index-DLqogznp.cjs → index-BBNITgNi.cjs} +7 -7
- package/lib/index-BFXkgG1P.cjs +7 -0
- package/lib/{index-prphFVsp.js → index-BQ6ZdLsu.js} +1 -1
- package/lib/{index-DylewabB.cjs → index-BZ6DfR2r.cjs} +1 -1
- package/lib/{index-D-FhWysc.js → index-BimeTI7q.js} +1 -1
- package/lib/{index-TMqmkmT6.cjs → index-CApXPpjF.cjs} +1 -1
- package/lib/{index-nFjllrEl.js → index-CbIQPoF6.js} +19 -18
- package/lib/{index-BeUrdBxf.js → index-EKFybgpP.js} +1 -1
- package/lib/{index-DuZCJJSp.js → index-pgx8gyoC.js} +1118 -504
- package/lib/index.cjs +2 -2
- package/lib/index.js +8 -9
- package/lib/{input-tU3H__39.cjs → input-CZUkD6wF.cjs} +1 -1
- package/lib/{input-DfqFAyKo.js → input-cclJoUeC.js} +1 -1
- package/lib/{isNumber-CTm1pIvN.js → isNumber-8HKEgTkA.js} +1 -1
- package/lib/{isNumber-C2saEiG2.cjs → isNumber-Bv1Qhmw8.cjs} +1 -1
- package/lib/label-CFaBdRGz.cjs +1 -0
- package/lib/label-aveW7pdK.js +18 -0
- package/lib/{popover-CZWSQZ0q.cjs → popover-BWYZO_fD.cjs} +1 -1
- package/lib/{popover-CoepUobG.js → popover-D5YZPv2r.js} +1 -1
- package/lib/{separator-DCQD8P6s.cjs → separator-B978cwAm.cjs} +1 -1
- package/lib/{separator-6SnwzytZ.js → separator-BHjFVmZr.js} +18 -18
- package/lib/{store-726Zjszt.cjs → store-BsBiawfz.cjs} +1 -1
- package/lib/{store-ibARMQ3h.js → store-BsMMRKFd.js} +1 -1
- package/lib/style.css +1 -1
- package/lib/{tabs-DrkJL_C2.js → tabs-Bj8EvAkY.js} +1 -1
- package/lib/{tabs-B_ArrG09.cjs → tabs-CUMyiV80.cjs} +1 -1
- package/lib/{textarea-CmZVZKOo.cjs → textarea-BKb7LDw1.cjs} +1 -1
- package/lib/{textarea-CIs52G8B.js → textarea-CClyW-74.js} +1 -1
- package/lib/{throttle-CGM5M2yG.js → throttle-BIkZV3Y_.js} +1 -1
- package/lib/{throttle-DXN-aiH5.cjs → throttle-BM3Bmbf_.cjs} +1 -1
- package/lib/{updatePosition-DpMKxYdN.js → updatePosition-GLTrgcib.js} +1 -1
- package/lib/{updatePosition-C17CDdjq.cjs → updatePosition-u2mTh3mG.cjs} +1 -1
- package/lib/useButtonProps-B0riSJs9.cjs +1 -0
- package/lib/{useButtonProps-D0SrPzuG.js → useButtonProps-StwAz7Ha.js} +35 -47
- package/package.json +58 -54
- package/lib/ActionMenuButton-DYT5chmX.cjs +0 -1
- package/lib/Drawer-DUFUd5BW.cjs +0 -1
- package/lib/Excalidraw-CajgZDjU.cjs +0 -1
- package/lib/Icon-BjR_or8V.cjs +0 -1
- package/lib/Iframe-CM6mRQmv.cjs +0 -1
- package/lib/Indent-BmhiEb0S.cjs +0 -1
- package/lib/Katex-CUd3LxLh.cjs +0 -4
- package/lib/Table-3VstSlg4.cjs +0 -9
- package/lib/Twitter-DuHPeVW1.cjs +0 -1
- package/lib/button-xNppt_aK.cjs +0 -1
- package/lib/index-BQ17A_37.js +0 -393
- package/lib/index-CNzHZDls.cjs +0 -7
- package/lib/index-DmOTQudI.cjs +0 -1
- package/lib/label-DC33TZy_.js +0 -19
- package/lib/label-DkDE77kc.cjs +0 -1
- package/lib/toggle-DVCNvcqp.cjs +0 -1
- package/lib/toggle-xchtz-Kf.js +0 -92
- package/lib/tooltip-BTFcHrd9.js +0 -24
- package/lib/tooltip-DFjcKu9a.cjs +0 -1
- package/lib/useButtonProps-bei1vI37.cjs +0 -1
package/lib/bubble.js
CHANGED
|
@@ -1,53 +1,52 @@
|
|
|
1
1
|
import { jsx as p, Fragment as M, jsxs as S } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { a3 as
|
|
4
|
-
import { f as
|
|
5
|
-
import { Plugin as Ce, PluginKey as te, NodeSelection as
|
|
6
|
-
import { C as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { A as y } from "./
|
|
2
|
+
import gs, { useRef as Lt, useEffect as st, useCallback as L, useState as z, useMemo as Pt, Fragment as ti } from "react";
|
|
3
|
+
import { a3 as jr, f as ms, E as ke, a4 as Yr, a5 as Gr, H as ws, a6 as ve, a7 as Jr, U as ei, Q as bs, x as Ae, F as Oe, T as ni, A as qr, v as Xr, a8 as Zr, a9 as Qr } from "./index-CbIQPoF6.js";
|
|
4
|
+
import { f as ys, s as xs, o as Ss, a as ks, b as vs, d as Cs, h as _s, i as Es, c as ii } from "./floating-ui.dom-U1vPFQ5f.js";
|
|
5
|
+
import { Plugin as Ce, PluginKey as te, NodeSelection as to, TextSelection as eo, SelectionRange as no, Selection as io } from "@tiptap/pm/state";
|
|
6
|
+
import { C as so, T as ro } from "./Table-CWbY_hqo.js";
|
|
7
|
+
import { createPortal as Ts } from "react-dom";
|
|
8
|
+
import { k as X, A as y } from "./index-pgx8gyoC.js";
|
|
9
9
|
import { MultipleColumnNode as _i } from "./Column.js";
|
|
10
|
-
import { u as
|
|
11
|
-
import { c as Y, d as
|
|
12
|
-
import { b as Z } from "./index-DuZCJJSp.js";
|
|
10
|
+
import { u as Z, p as We, V as Ei } from "./index-0OnGZkVF.js";
|
|
11
|
+
import { c as Y, d as Ds } from "./useButtonProps-StwAz7Ha.js";
|
|
13
12
|
import { d as _e } from "./delete-node-IyVmiRbI.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { E as oe, t as
|
|
26
|
-
import { I as le, g as
|
|
27
|
-
import
|
|
28
|
-
import { Pencil as
|
|
29
|
-
import { T as
|
|
30
|
-
import { L as Ti, a as
|
|
31
|
-
import { Image as
|
|
32
|
-
import { ImageGif as
|
|
33
|
-
import { Video as
|
|
13
|
+
import { S as Nt } from "./separator-BHjFVmZr.js";
|
|
14
|
+
import { C as oo, D as kn } from "./Drawer-C6WTtcd0.js";
|
|
15
|
+
import { Editor as lo, makeDropdownToolbar as co } from "easydrawer";
|
|
16
|
+
import { s as Is, i as As } from "./shortId-WJVkrvml.js";
|
|
17
|
+
import { B as Jt } from "./button-0963_Pa8.js";
|
|
18
|
+
import { D as on, a as ln, b as cn, c as an, d as hn, e as ao } from "./dialog-B-9_Z5j2.js";
|
|
19
|
+
import { d as Os } from "./file-BLas99n7.js";
|
|
20
|
+
import { u as ee, K as je } from "./Katex-5KNTSK8T.js";
|
|
21
|
+
import { I as Be } from "./input-cclJoUeC.js";
|
|
22
|
+
import { L as vn } from "./label-aveW7pdK.js";
|
|
23
|
+
import { P as ho, a as uo, b as fo } from "./popover-D5YZPv2r.js";
|
|
24
|
+
import { E as oe, t as po } from "./Excalidraw-DjO5sCC_.js";
|
|
25
|
+
import { I as le, g as go } from "./Iframe-CERKUXQh.js";
|
|
26
|
+
import mo from "katex";
|
|
27
|
+
import { Pencil as wo, Trash2 as bo } from "lucide-react";
|
|
28
|
+
import { T as Ms } from "./textarea-CClyW-74.js";
|
|
29
|
+
import { L as Ti, a as yo, R as xo } from "./LinkEditBlock-CFkyS2Ze.js";
|
|
30
|
+
import { Image as So } from "./Image.js";
|
|
31
|
+
import { ImageGif as ko } from "./ImageGif.js";
|
|
32
|
+
import { Video as vo } from "./Video.js";
|
|
34
33
|
import { Mermaid as Un } from "./Mermaid.js";
|
|
35
|
-
import { RichTextBold as
|
|
36
|
-
import { RichTextCode as
|
|
37
|
-
import "./index-
|
|
38
|
-
import { RichTextColor as
|
|
39
|
-
import { RichTextHighlight as
|
|
40
|
-
import { RichTextItalic as
|
|
41
|
-
import { RichTextStrike as
|
|
42
|
-
import { RichTextAlign as
|
|
43
|
-
import { RichTextUnderline as
|
|
44
|
-
import { T as
|
|
45
|
-
import { DecorationSet as
|
|
34
|
+
import { RichTextBold as Co } from "./Bold.js";
|
|
35
|
+
import { RichTextCode as _o } from "./Code.js";
|
|
36
|
+
import "./index-BQ6ZdLsu.js";
|
|
37
|
+
import { RichTextColor as Eo } from "./Color.js";
|
|
38
|
+
import { RichTextHighlight as To } from "./Highlight.js";
|
|
39
|
+
import { RichTextItalic as Do } from "./Italic.js";
|
|
40
|
+
import { RichTextStrike as Io } from "./Strike.js";
|
|
41
|
+
import { RichTextAlign as Ao, TextAlign as Oo } from "./TextAlign.js";
|
|
42
|
+
import { RichTextUnderline as Mo } from "./TextUnderline.js";
|
|
43
|
+
import { T as Di, F as Ro } from "./Twitter-BV7HA-MO.js";
|
|
44
|
+
import { DecorationSet as Ii, Decoration as No } from "@tiptap/pm/view";
|
|
46
45
|
import { NodeRange as Uo } from "@tiptap/pm/model";
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import { I as rt } from "./Icon-
|
|
46
|
+
import { D as Lo, a as Po, b as Bo, f as mt, d as Vo, g as Ai, h as Oi, i as Mi, j as Ri } from "./dropdown-menu-par18QL5.js";
|
|
47
|
+
import { Clear as Ho } from "./Clear.js";
|
|
48
|
+
import { I as $o, a as Ni, s as Ui } from "./Indent-BfEOOT5B.js";
|
|
49
|
+
import { I as rt } from "./Icon-prdLEHMN.js";
|
|
51
50
|
function Fo(e, t) {
|
|
52
51
|
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;
|
|
53
52
|
return new DOMRect(c, a, o, l);
|
|
@@ -80,7 +79,7 @@ var zo = class {
|
|
|
80
79
|
onUpdate: void 0,
|
|
81
80
|
onDestroy: void 0
|
|
82
81
|
}, this.shouldShow = ({ view: d, state: h, from: u, to: f }) => {
|
|
83
|
-
const { doc: g, selection: m } = h, { empty: b } = m, w = !g.textBetween(u, f).length &&
|
|
82
|
+
const { doc: g, selection: m } = h, { empty: b } = m, w = !g.textBetween(u, f).length && jr(h.selection), D = this.element.contains(document.activeElement);
|
|
84
83
|
return !(!(d.hasFocus() || D) || b || w || !this.editor.isEditable);
|
|
85
84
|
}, this.mousedownHandler = () => {
|
|
86
85
|
this.preventHide = !0;
|
|
@@ -128,16 +127,16 @@ var zo = class {
|
|
|
128
127
|
}
|
|
129
128
|
get middlewares() {
|
|
130
129
|
const e = [];
|
|
131
|
-
return this.floatingUIOptions.flip && e.push(
|
|
132
|
-
|
|
130
|
+
return this.floatingUIOptions.flip && e.push(ys(typeof this.floatingUIOptions.flip != "boolean" ? this.floatingUIOptions.flip : void 0)), this.floatingUIOptions.shift && e.push(
|
|
131
|
+
xs(typeof this.floatingUIOptions.shift != "boolean" ? this.floatingUIOptions.shift : void 0)
|
|
133
132
|
), this.floatingUIOptions.offset && e.push(
|
|
134
|
-
|
|
135
|
-
), this.floatingUIOptions.arrow && e.push(
|
|
136
|
-
|
|
133
|
+
Ss(typeof this.floatingUIOptions.offset != "boolean" ? this.floatingUIOptions.offset : void 0)
|
|
134
|
+
), this.floatingUIOptions.arrow && e.push(ks(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(vs(typeof this.floatingUIOptions.size != "boolean" ? this.floatingUIOptions.size : void 0)), this.floatingUIOptions.autoPlacement && e.push(
|
|
135
|
+
Cs(
|
|
137
136
|
typeof this.floatingUIOptions.autoPlacement != "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
138
137
|
)
|
|
139
|
-
), this.floatingUIOptions.hide && e.push(
|
|
140
|
-
|
|
138
|
+
), this.floatingUIOptions.hide && e.push(_s(typeof this.floatingUIOptions.hide != "boolean" ? this.floatingUIOptions.hide : void 0)), this.floatingUIOptions.inline && e.push(
|
|
139
|
+
Es(typeof this.floatingUIOptions.inline != "boolean" ? this.floatingUIOptions.inline : void 0)
|
|
141
140
|
), e;
|
|
142
141
|
}
|
|
143
142
|
get virtualElement() {
|
|
@@ -145,12 +144,12 @@ var zo = class {
|
|
|
145
144
|
const { selection: t } = this.editor.state, n = (e = this.getReferencedVirtualElement) == null ? void 0 : e.call(this);
|
|
146
145
|
if (n)
|
|
147
146
|
return n;
|
|
148
|
-
const i =
|
|
147
|
+
const i = ms(this.view, t.from, t.to);
|
|
149
148
|
let s = {
|
|
150
149
|
getBoundingClientRect: () => i,
|
|
151
150
|
getClientRects: () => [i]
|
|
152
151
|
};
|
|
153
|
-
if (t instanceof
|
|
152
|
+
if (t instanceof to) {
|
|
154
153
|
let r = this.view.nodeDOM(t.from);
|
|
155
154
|
const o = r.dataset.nodeViewWrapper ? r : r.querySelector("[data-node-view-wrapper]");
|
|
156
155
|
o && (r = o), r && (s = {
|
|
@@ -158,7 +157,7 @@ var zo = class {
|
|
|
158
157
|
getClientRects: () => [r.getBoundingClientRect()]
|
|
159
158
|
});
|
|
160
159
|
}
|
|
161
|
-
if (t instanceof
|
|
160
|
+
if (t instanceof so) {
|
|
162
161
|
const { $anchorCell: r, $headCell: o } = t, l = r ? r.pos : o.pos, c = o ? o.pos : r.pos, a = this.view.nodeDOM(l), d = this.view.nodeDOM(c);
|
|
163
162
|
if (!a || !d)
|
|
164
163
|
return;
|
|
@@ -219,7 +218,7 @@ var zo = class {
|
|
|
219
218
|
destroy() {
|
|
220
219
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
221
220
|
}
|
|
222
|
-
},
|
|
221
|
+
}, Rs = (e) => new Ce({
|
|
223
222
|
key: typeof e.pluginKey == "string" ? new te(e.pluginKey) : e.pluginKey,
|
|
224
223
|
view: (t) => new zo({ view: t, ...e })
|
|
225
224
|
});
|
|
@@ -236,7 +235,7 @@ ke.create({
|
|
|
236
235
|
},
|
|
237
236
|
addProseMirrorPlugins() {
|
|
238
237
|
return this.options.element ? [
|
|
239
|
-
|
|
238
|
+
Rs({
|
|
240
239
|
pluginKey: this.options.pluginKey,
|
|
241
240
|
editor: this.editor,
|
|
242
241
|
element: this.options.element,
|
|
@@ -291,20 +290,20 @@ var Ko = class {
|
|
|
291
290
|
}, 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());
|
|
292
291
|
}
|
|
293
292
|
getTextContent(e) {
|
|
294
|
-
return
|
|
293
|
+
return Yr(e, { textSerializers: Gr(this.editor.schema) });
|
|
295
294
|
}
|
|
296
295
|
get middlewares() {
|
|
297
296
|
const e = [];
|
|
298
|
-
return this.floatingUIOptions.flip && e.push(
|
|
299
|
-
|
|
297
|
+
return this.floatingUIOptions.flip && e.push(ys(typeof this.floatingUIOptions.flip != "boolean" ? this.floatingUIOptions.flip : void 0)), this.floatingUIOptions.shift && e.push(
|
|
298
|
+
xs(typeof this.floatingUIOptions.shift != "boolean" ? this.floatingUIOptions.shift : void 0)
|
|
300
299
|
), this.floatingUIOptions.offset && e.push(
|
|
301
|
-
|
|
302
|
-
), this.floatingUIOptions.arrow && e.push(
|
|
303
|
-
|
|
300
|
+
Ss(typeof this.floatingUIOptions.offset != "boolean" ? this.floatingUIOptions.offset : void 0)
|
|
301
|
+
), this.floatingUIOptions.arrow && e.push(ks(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(vs(typeof this.floatingUIOptions.size != "boolean" ? this.floatingUIOptions.size : void 0)), this.floatingUIOptions.autoPlacement && e.push(
|
|
302
|
+
Cs(
|
|
304
303
|
typeof this.floatingUIOptions.autoPlacement != "boolean" ? this.floatingUIOptions.autoPlacement : void 0
|
|
305
304
|
)
|
|
306
|
-
), this.floatingUIOptions.hide && e.push(
|
|
307
|
-
|
|
305
|
+
), this.floatingUIOptions.hide && e.push(_s(typeof this.floatingUIOptions.hide != "boolean" ? this.floatingUIOptions.hide : void 0)), this.floatingUIOptions.inline && e.push(
|
|
306
|
+
Es(typeof this.floatingUIOptions.inline != "boolean" ? this.floatingUIOptions.inline : void 0)
|
|
308
307
|
), e;
|
|
309
308
|
}
|
|
310
309
|
getShouldShow(e) {
|
|
@@ -320,7 +319,7 @@ var Ko = class {
|
|
|
320
319
|
});
|
|
321
320
|
}
|
|
322
321
|
updatePosition() {
|
|
323
|
-
const { selection: e } = this.editor.state, t =
|
|
322
|
+
const { selection: e } = this.editor.state, t = ms(this.view, e.from, e.to);
|
|
324
323
|
ii({
|
|
325
324
|
getBoundingClientRect: () => t,
|
|
326
325
|
getClientRects: () => [t]
|
|
@@ -350,7 +349,7 @@ var Ko = class {
|
|
|
350
349
|
destroy() {
|
|
351
350
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
352
351
|
}
|
|
353
|
-
},
|
|
352
|
+
}, Ns = (e) => new Ce({
|
|
354
353
|
key: typeof e.pluginKey == "string" ? new te(e.pluginKey) : e.pluginKey,
|
|
355
354
|
view: (t) => new Ko({ view: t, ...e })
|
|
356
355
|
});
|
|
@@ -367,7 +366,7 @@ ke.create({
|
|
|
367
366
|
},
|
|
368
367
|
addProseMirrorPlugins() {
|
|
369
368
|
return this.options.element ? [
|
|
370
|
-
|
|
369
|
+
Ns({
|
|
371
370
|
pluginKey: this.options.pluginKey,
|
|
372
371
|
editor: this.editor,
|
|
373
372
|
element: this.options.element,
|
|
@@ -378,7 +377,7 @@ ke.create({
|
|
|
378
377
|
] : [];
|
|
379
378
|
}
|
|
380
379
|
});
|
|
381
|
-
var tt =
|
|
380
|
+
var tt = gs.forwardRef(
|
|
382
381
|
({
|
|
383
382
|
pluginKey: e = "bubbleMenu",
|
|
384
383
|
editor: t,
|
|
@@ -393,7 +392,7 @@ var tt = ms.forwardRef(
|
|
|
393
392
|
}, d) => {
|
|
394
393
|
const h = Lt(document.createElement("div"));
|
|
395
394
|
typeof d == "function" ? d(h.current) : d && (d.current = h.current);
|
|
396
|
-
const { editor: u } =
|
|
395
|
+
const { editor: u } = ws(), f = t || u, g = {
|
|
397
396
|
updateDelay: n,
|
|
398
397
|
resizeDelay: i,
|
|
399
398
|
appendTo: s,
|
|
@@ -411,7 +410,7 @@ var tt = ms.forwardRef(
|
|
|
411
410
|
}
|
|
412
411
|
const b = h.current;
|
|
413
412
|
b.style.visibility = "hidden", b.style.position = "absolute";
|
|
414
|
-
const w =
|
|
413
|
+
const w = Rs({
|
|
415
414
|
...m.current,
|
|
416
415
|
editor: f,
|
|
417
416
|
element: b
|
|
@@ -423,14 +422,14 @@ var tt = ms.forwardRef(
|
|
|
423
422
|
b.parentNode && b.parentNode.removeChild(b);
|
|
424
423
|
});
|
|
425
424
|
};
|
|
426
|
-
}, [f]),
|
|
425
|
+
}, [f]), Ts(/* @__PURE__ */ p("div", { ...a, children: c }), h.current);
|
|
427
426
|
}
|
|
428
427
|
);
|
|
429
|
-
|
|
428
|
+
gs.forwardRef(
|
|
430
429
|
({ pluginKey: e = "floatingMenu", editor: t, appendTo: n, shouldShow: i = null, options: s, children: r, ...o }, l) => {
|
|
431
430
|
const c = Lt(document.createElement("div"));
|
|
432
431
|
typeof l == "function" ? l(c.current) : l && (l.current = c.current);
|
|
433
|
-
const { editor: a } =
|
|
432
|
+
const { editor: a } = ws();
|
|
434
433
|
return st(() => {
|
|
435
434
|
const d = c.current;
|
|
436
435
|
if (d.style.visibility = "hidden", d.style.position = "absolute", t != null && t.isDestroyed || a != null && a.isDestroyed)
|
|
@@ -442,7 +441,7 @@ ms.forwardRef(
|
|
|
442
441
|
);
|
|
443
442
|
return;
|
|
444
443
|
}
|
|
445
|
-
const u =
|
|
444
|
+
const u = Ns({
|
|
446
445
|
editor: h,
|
|
447
446
|
element: d,
|
|
448
447
|
pluginKey: e,
|
|
@@ -455,11 +454,11 @@ ms.forwardRef(
|
|
|
455
454
|
d.parentNode && d.parentNode.removeChild(d);
|
|
456
455
|
});
|
|
457
456
|
};
|
|
458
|
-
}, [t, a, n, e, i, s]),
|
|
457
|
+
}, [t, a, n, e, i, s]), Ts(/* @__PURE__ */ p("div", { ...o, children: r }), c.current);
|
|
459
458
|
}
|
|
460
459
|
);
|
|
461
|
-
function
|
|
462
|
-
const e =
|
|
460
|
+
function Fd() {
|
|
461
|
+
const e = X(), t = Y(), { t: n } = Z(), i = L(() => t.isActive(_i.name), [t]), s = L(() => _e(_i.name, t), [t]), r = L(() => t.chain().focus().addColBefore().run(), [t]), o = L(() => t.chain().focus().addColAfter().run(), [t]), l = L(() => t.chain().focus().deleteCol().run(), [t]);
|
|
463
462
|
return e ? /* @__PURE__ */ p(
|
|
464
463
|
tt,
|
|
465
464
|
{
|
|
@@ -803,10 +802,10 @@ function sl({ editor: e, attrs: t, extension: n }) {
|
|
|
803
802
|
const [i, s] = z(!1), r = Lt(null), o = Lt(null), { alt: l, align: c } = t, a = n == null ? void 0 : n.options.upload, d = () => {
|
|
804
803
|
(async () => {
|
|
805
804
|
const x = document.querySelector("#easydrawer");
|
|
806
|
-
x && (r.current = new
|
|
805
|
+
x && (r.current = new lo(x, {
|
|
807
806
|
wheelEventsEnabled: !1,
|
|
808
807
|
disableZoom: !0
|
|
809
|
-
}), o.current =
|
|
808
|
+
}), o.current = co(r.current), o.current.addDefaultToolWidgets(), r.current.loadFromSVG(decodeURIComponent(l)));
|
|
810
809
|
})();
|
|
811
810
|
};
|
|
812
811
|
st(() => {
|
|
@@ -816,10 +815,10 @@ function sl({ editor: e, attrs: t, extension: n }) {
|
|
|
816
815
|
}, [i]);
|
|
817
816
|
const h = async () => {
|
|
818
817
|
if (r.current) {
|
|
819
|
-
const E = r.current.toSVG(), x = E.outerHTML, k = `drawer-${
|
|
820
|
-
let N =
|
|
818
|
+
const E = r.current.toSVG(), x = E.outerHTML, k = `drawer-${Is()}.svg`;
|
|
819
|
+
let N = As(E.outerHTML);
|
|
821
820
|
if (a) {
|
|
822
|
-
const H =
|
|
821
|
+
const H = Os(N, k);
|
|
823
822
|
N = await a(H);
|
|
824
823
|
}
|
|
825
824
|
e == null || e.chain().focus().setDrawer(
|
|
@@ -889,7 +888,7 @@ function sl({ editor: e, attrs: t, extension: n }) {
|
|
|
889
888
|
}
|
|
890
889
|
),
|
|
891
890
|
/* @__PURE__ */ p(
|
|
892
|
-
|
|
891
|
+
oo,
|
|
893
892
|
{
|
|
894
893
|
changeBorderColorShape: D,
|
|
895
894
|
changeColorShape: b,
|
|
@@ -944,8 +943,8 @@ function rl({ item: e, disabled: t, editor: n }) {
|
|
|
944
943
|
}
|
|
945
944
|
) }) : /* @__PURE__ */ p(M, {});
|
|
946
945
|
}
|
|
947
|
-
function
|
|
948
|
-
const { lang: e, t } =
|
|
946
|
+
function zd() {
|
|
947
|
+
const { lang: e, t } = Z(), n = X(), i = Y(), s = ee(i, kn.name), r = Ds(kn.name), o = ({ editor: c }) => {
|
|
949
948
|
const { selection: a } = c.view.state, { $from: d, to: h } = a;
|
|
950
949
|
let u = !1;
|
|
951
950
|
return c.view.state.doc.nodesBetween(d.pos, h, (f) => {
|
|
@@ -979,8 +978,8 @@ function Kd() {
|
|
|
979
978
|
}
|
|
980
979
|
) : /* @__PURE__ */ p(M, {});
|
|
981
980
|
}
|
|
982
|
-
const
|
|
983
|
-
const { t: r } =
|
|
981
|
+
const Us = ({ width: e, maxWidth: t, height: n, onOk: i, children: s }) => {
|
|
982
|
+
const { t: r } = Z(), [o, l] = z({
|
|
984
983
|
width: "",
|
|
985
984
|
height: "",
|
|
986
985
|
maxWidth: ""
|
|
@@ -995,9 +994,9 @@ const Ls = ({ width: e, maxWidth: t, height: n, onOk: i, children: s }) => {
|
|
|
995
994
|
function c(a) {
|
|
996
995
|
a.preventDefault(), a.stopPropagation(), i(o);
|
|
997
996
|
}
|
|
998
|
-
return /* @__PURE__ */ S(
|
|
999
|
-
/* @__PURE__ */ p(
|
|
1000
|
-
/* @__PURE__ */ p(
|
|
997
|
+
return /* @__PURE__ */ S(ho, { modal: !0, children: [
|
|
998
|
+
/* @__PURE__ */ p(uo, { asChild: !0, children: s }),
|
|
999
|
+
/* @__PURE__ */ p(fo, { children: /* @__PURE__ */ S(
|
|
1001
1000
|
"form",
|
|
1002
1001
|
{
|
|
1003
1002
|
className: "richtext-flex richtext-flex-col richtext-gap-2",
|
|
@@ -1056,8 +1055,8 @@ function ol(e) {
|
|
|
1056
1055
|
s.disconnect();
|
|
1057
1056
|
}), { width: Mt.get("width") };
|
|
1058
1057
|
}
|
|
1059
|
-
function
|
|
1060
|
-
const e =
|
|
1058
|
+
function Kd() {
|
|
1059
|
+
const e = X(), t = Y(), { t: n } = Z(), { width: i } = ol(t), s = ee(t, oe.name, {
|
|
1061
1060
|
defaultShowPicker: !1,
|
|
1062
1061
|
createUser: "",
|
|
1063
1062
|
width: 0,
|
|
@@ -1068,7 +1067,7 @@ function Wd() {
|
|
|
1068
1067
|
},
|
|
1069
1068
|
[t]
|
|
1070
1069
|
), d = L(() => {
|
|
1071
|
-
|
|
1070
|
+
po({ ...s, editor: t });
|
|
1072
1071
|
}, [t, s]), h = L(() => t.isActive(oe.name), [t]), u = L(() => _e(oe.name, t), [t]);
|
|
1073
1072
|
return st(() => {
|
|
1074
1073
|
r && (d(), t.chain().updateAttributes(oe.name, { defaultShowPicker: !1 }).focus().run());
|
|
@@ -1089,7 +1088,7 @@ function Wd() {
|
|
|
1089
1088
|
}
|
|
1090
1089
|
),
|
|
1091
1090
|
/* @__PURE__ */ p(
|
|
1092
|
-
|
|
1091
|
+
Us,
|
|
1093
1092
|
{
|
|
1094
1093
|
height: c,
|
|
1095
1094
|
maxWidth: i,
|
|
@@ -1116,8 +1115,8 @@ function Wd() {
|
|
|
1116
1115
|
}
|
|
1117
1116
|
) : /* @__PURE__ */ p(M, {});
|
|
1118
1117
|
}
|
|
1119
|
-
function
|
|
1120
|
-
const e =
|
|
1118
|
+
function Wd() {
|
|
1119
|
+
const e = X(), t = Y(), { t: n } = Z(), { width: i, height: s, src: r } = ee(t, le.name, {
|
|
1121
1120
|
width: 0,
|
|
1122
1121
|
height: 0,
|
|
1123
1122
|
src: "",
|
|
@@ -1132,7 +1131,7 @@ function jd() {
|
|
|
1132
1131
|
const h = L((w) => {
|
|
1133
1132
|
var I;
|
|
1134
1133
|
(I = w == null ? void 0 : w.preventDefault) == null || I.call(w);
|
|
1135
|
-
const D =
|
|
1134
|
+
const D = go(c);
|
|
1136
1135
|
t.chain().updateAttributes(le.name, {
|
|
1137
1136
|
src: (D == null ? void 0 : D.src) || c
|
|
1138
1137
|
}).setNodeSelection(t.state.selection.from).focus().run(), l(!1);
|
|
@@ -1172,7 +1171,7 @@ function jd() {
|
|
|
1172
1171
|
}
|
|
1173
1172
|
),
|
|
1174
1173
|
/* @__PURE__ */ p(
|
|
1175
|
-
|
|
1174
|
+
Us,
|
|
1176
1175
|
{
|
|
1177
1176
|
height: s,
|
|
1178
1177
|
onOk: g,
|
|
@@ -1205,7 +1204,7 @@ function jd() {
|
|
|
1205
1204
|
children: [
|
|
1206
1205
|
/* @__PURE__ */ p(ln, {}),
|
|
1207
1206
|
/* @__PURE__ */ S(cn, { children: [
|
|
1208
|
-
/* @__PURE__ */ p(
|
|
1207
|
+
/* @__PURE__ */ p(ao, { children: /* @__PURE__ */ p(an, { children: "Edit Link Iframe" }) }),
|
|
1209
1208
|
/* @__PURE__ */ p(
|
|
1210
1209
|
Be,
|
|
1211
1210
|
{
|
|
@@ -1245,7 +1244,7 @@ function ll({
|
|
|
1245
1244
|
visible: t,
|
|
1246
1245
|
toggleVisible: n
|
|
1247
1246
|
}) {
|
|
1248
|
-
const { t: i } =
|
|
1247
|
+
const { t: i } = Z(), s = Y(), r = ee(s, je.name, {
|
|
1249
1248
|
text: "",
|
|
1250
1249
|
defaultShowPicker: !1
|
|
1251
1250
|
}), { text: o, defaultShowPicker: l } = r, [c, a] = z(o || "");
|
|
@@ -1258,7 +1257,7 @@ function ll({
|
|
|
1258
1257
|
s.chain().focus().setKatex({ text: c }).run(), a(""), n(!1);
|
|
1259
1258
|
}, [s, c, n]), h = Pt(() => {
|
|
1260
1259
|
try {
|
|
1261
|
-
return
|
|
1260
|
+
return mo.renderToString(`${c}`);
|
|
1262
1261
|
} catch {
|
|
1263
1262
|
return c;
|
|
1264
1263
|
}
|
|
@@ -1287,7 +1286,7 @@ function ll({
|
|
|
1287
1286
|
style: { height: "100%", border: "1px solid hsl(var(--border))" },
|
|
1288
1287
|
children: /* @__PURE__ */ S("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
|
|
1289
1288
|
/* @__PURE__ */ p(
|
|
1290
|
-
|
|
1289
|
+
Ms,
|
|
1291
1290
|
{
|
|
1292
1291
|
autoFocus: !0,
|
|
1293
1292
|
className: "richtext-flex-1",
|
|
@@ -1325,8 +1324,8 @@ function ll({
|
|
|
1325
1324
|
}
|
|
1326
1325
|
);
|
|
1327
1326
|
}
|
|
1328
|
-
function
|
|
1329
|
-
const e =
|
|
1327
|
+
function jd() {
|
|
1328
|
+
const e = X(), t = Y(), [n, i] = z(!1), s = L(() => t.isActive(je.name), [t]), r = L(() => _e(je.name, t), [t]);
|
|
1330
1329
|
return e ? /* @__PURE__ */ p(
|
|
1331
1330
|
tt,
|
|
1332
1331
|
{
|
|
@@ -1345,7 +1344,7 @@ function Yd() {
|
|
|
1345
1344
|
{
|
|
1346
1345
|
action: () => i(!n),
|
|
1347
1346
|
tooltip: "Edit",
|
|
1348
|
-
children: /* @__PURE__ */ p(
|
|
1347
|
+
children: /* @__PURE__ */ p(wo, { size: 16 })
|
|
1349
1348
|
}
|
|
1350
1349
|
)
|
|
1351
1350
|
}
|
|
@@ -1355,7 +1354,7 @@ function Yd() {
|
|
|
1355
1354
|
{
|
|
1356
1355
|
action: r,
|
|
1357
1356
|
tooltip: "Delete",
|
|
1358
|
-
children: /* @__PURE__ */ p(
|
|
1357
|
+
children: /* @__PURE__ */ p(bo, { size: 16 })
|
|
1359
1358
|
}
|
|
1360
1359
|
)
|
|
1361
1360
|
] })
|
|
@@ -1363,7 +1362,7 @@ function Yd() {
|
|
|
1363
1362
|
) : /* @__PURE__ */ p(M, {});
|
|
1364
1363
|
}
|
|
1365
1364
|
function cl(e) {
|
|
1366
|
-
const { t } =
|
|
1365
|
+
const { t } = Z();
|
|
1367
1366
|
return /* @__PURE__ */ S("div", { className: "richtext-flex richtext-flex-nowrap", children: [
|
|
1368
1367
|
/* @__PURE__ */ p(
|
|
1369
1368
|
y,
|
|
@@ -1401,8 +1400,8 @@ function cl(e) {
|
|
|
1401
1400
|
)
|
|
1402
1401
|
] });
|
|
1403
1402
|
}
|
|
1404
|
-
function
|
|
1405
|
-
const e =
|
|
1403
|
+
function Yd() {
|
|
1404
|
+
const e = X(), t = Y(), [n, i] = z(!1), s = ee(t, Ti.name), r = s == null ? void 0 : s.href, o = L(({ editor: d }) => d.isActive(Ti.name), []), l = (d, h, u) => {
|
|
1406
1405
|
const f = t.state.selection, { from: g } = f, m = (h == null ? void 0 : h.length) ?? 0, b = g + m;
|
|
1407
1406
|
t.chain().extendMarkRange("link").insertContent({
|
|
1408
1407
|
type: "text",
|
|
@@ -1434,7 +1433,7 @@ function Gd() {
|
|
|
1434
1433
|
{
|
|
1435
1434
|
className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none",
|
|
1436
1435
|
children: /* @__PURE__ */ p(
|
|
1437
|
-
|
|
1436
|
+
yo,
|
|
1438
1437
|
{
|
|
1439
1438
|
editor: t,
|
|
1440
1439
|
onClose: a,
|
|
@@ -1480,16 +1479,16 @@ function si({ item: e, disabled: t, editor: n }) {
|
|
|
1480
1479
|
) }) : /* @__PURE__ */ p(M, {});
|
|
1481
1480
|
}
|
|
1482
1481
|
function al(e) {
|
|
1483
|
-
return e.type.name ===
|
|
1482
|
+
return e.type.name === So.name;
|
|
1484
1483
|
}
|
|
1485
1484
|
function hl(e) {
|
|
1486
|
-
return e.type.name ===
|
|
1485
|
+
return e.type.name === ko.name;
|
|
1487
1486
|
}
|
|
1488
1487
|
function dl(e) {
|
|
1489
|
-
return e.type.name ===
|
|
1488
|
+
return e.type.name === vo.name;
|
|
1490
1489
|
}
|
|
1491
|
-
function
|
|
1492
|
-
const { lang: e, t } =
|
|
1490
|
+
function Gd() {
|
|
1491
|
+
const { lang: e, t } = Z(), n = X(), i = Y(), s = ({ editor: o }) => {
|
|
1493
1492
|
const { selection: l } = o.view.state, { $from: c, to: a } = l;
|
|
1494
1493
|
let d = !1;
|
|
1495
1494
|
return o.view.state.doc.nodesBetween(c.pos, a, (h) => {
|
|
@@ -1515,8 +1514,8 @@ function Jd() {
|
|
|
1515
1514
|
}
|
|
1516
1515
|
) : /* @__PURE__ */ p(M, {});
|
|
1517
1516
|
}
|
|
1518
|
-
function
|
|
1519
|
-
const { lang: e, t } =
|
|
1517
|
+
function Jd() {
|
|
1518
|
+
const { lang: e, t } = Z(), n = X(), i = Y(), s = ({ editor: o }) => {
|
|
1520
1519
|
const { selection: l } = o.view.state, { $from: c, to: a } = l;
|
|
1521
1520
|
let d = !1;
|
|
1522
1521
|
return o.view.state.doc.nodesBetween(c.pos, a, (h) => {
|
|
@@ -1542,8 +1541,8 @@ function qd() {
|
|
|
1542
1541
|
}
|
|
1543
1542
|
) : /* @__PURE__ */ p(M, {});
|
|
1544
1543
|
}
|
|
1545
|
-
function
|
|
1546
|
-
const { t: e } =
|
|
1544
|
+
function qd() {
|
|
1545
|
+
const { t: e } = Z(), t = X(), n = Y(), i = ({ editor: r }) => {
|
|
1547
1546
|
const { selection: o } = r.view.state, { $from: l, to: c } = o;
|
|
1548
1547
|
let a = !1;
|
|
1549
1548
|
return r.view.state.doc.nodesBetween(l.pos, c, (d) => {
|
|
@@ -1569,9 +1568,9 @@ function Xd() {
|
|
|
1569
1568
|
}
|
|
1570
1569
|
) : /* @__PURE__ */ p(M, {});
|
|
1571
1570
|
}
|
|
1572
|
-
const
|
|
1571
|
+
const Li = `graph TB
|
|
1573
1572
|
a-->b`, ul = ({ editor: e, attrs: t, extension: n }) => {
|
|
1574
|
-
const { alt: i, align: s } = t, [r, o] = z(decodeURIComponent(i ??
|
|
1573
|
+
const { alt: i, align: s } = t, [r, o] = z(decodeURIComponent(i ?? Li)), [l, c] = z(""), [a, d] = z(!1), h = Lt(null), [u, f] = z(null), g = n == null ? void 0 : n.options.upload, m = L(
|
|
1575
1574
|
(I) => {
|
|
1576
1575
|
I && import("mermaid").then((v) => {
|
|
1577
1576
|
f(v.default);
|
|
@@ -1621,11 +1620,11 @@ a-->b`, ul = ({ editor: e, attrs: t, extension: n }) => {
|
|
|
1621
1620
|
style: { height: "100%", border: "1px solid hsl(var(--border))" },
|
|
1622
1621
|
children: /* @__PURE__ */ S("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
|
|
1623
1622
|
/* @__PURE__ */ p(
|
|
1624
|
-
|
|
1623
|
+
Ms,
|
|
1625
1624
|
{
|
|
1626
1625
|
autoFocus: !0,
|
|
1627
1626
|
className: "richtext-flex-1",
|
|
1628
|
-
defaultValue:
|
|
1627
|
+
defaultValue: Li,
|
|
1629
1628
|
onChange: (I) => o(I.target.value),
|
|
1630
1629
|
placeholder: "Text",
|
|
1631
1630
|
required: !0,
|
|
@@ -1654,10 +1653,10 @@ a-->b`, ul = ({ editor: e, attrs: t, extension: n }) => {
|
|
|
1654
1653
|
onClick: async () => {
|
|
1655
1654
|
if (r !== "") {
|
|
1656
1655
|
if (r) {
|
|
1657
|
-
const I = h.current.querySelector("svg"), { width: v, height: P } = I.getBoundingClientRect(), E = `mermaid-${
|
|
1658
|
-
let x =
|
|
1656
|
+
const I = h.current.querySelector("svg"), { width: v, height: P } = I.getBoundingClientRect(), E = `mermaid-${Is()}.svg`;
|
|
1657
|
+
let x = As(I.outerHTML);
|
|
1659
1658
|
if (g) {
|
|
1660
|
-
const k =
|
|
1659
|
+
const k = Os(x, E);
|
|
1661
1660
|
x = await g(k);
|
|
1662
1661
|
}
|
|
1663
1662
|
e == null || e.chain().focus().setMermaid(
|
|
@@ -1704,8 +1703,8 @@ function fl({ item: e, disabled: t, editor: n }) {
|
|
|
1704
1703
|
function pl(e) {
|
|
1705
1704
|
return e.type.name === Un.name;
|
|
1706
1705
|
}
|
|
1707
|
-
function
|
|
1708
|
-
const { lang: e, t } =
|
|
1706
|
+
function Xd() {
|
|
1707
|
+
const { lang: e, t } = Z(), n = X(), i = Y(), s = ee(i, Un.name), r = Ds(Un.name), o = ({ editor: c }) => {
|
|
1709
1708
|
const { selection: a } = c.view.state, { $from: d, to: h } = a;
|
|
1710
1709
|
let u = !1;
|
|
1711
1710
|
return c.view.state.doc.nodesBetween(d.pos, h, (f) => {
|
|
@@ -1739,9 +1738,9 @@ function Zd() {
|
|
|
1739
1738
|
}
|
|
1740
1739
|
) : /* @__PURE__ */ p(M, {});
|
|
1741
1740
|
}
|
|
1742
|
-
function
|
|
1741
|
+
function Zd({ hiddenActions: e = [] }) {
|
|
1743
1742
|
var m, b, w, D, I, v, P, E, x, k, N, H, et, At, Ot, _, ft, re;
|
|
1744
|
-
const { t } =
|
|
1743
|
+
const { t } = Z(), n = X(), i = Y(), s = ({ editor: Kt }) => Jr(Kt.view.state, ro.name), r = (Kt) => e.includes(Kt);
|
|
1745
1744
|
function o() {
|
|
1746
1745
|
i.chain().focus().addColumnBefore().run();
|
|
1747
1746
|
}
|
|
@@ -1894,13 +1893,12 @@ function Qd({ hiddenActions: e = [] }) {
|
|
|
1894
1893
|
}
|
|
1895
1894
|
function gl() {
|
|
1896
1895
|
return /* @__PURE__ */ S(M, { children: [
|
|
1897
|
-
/* @__PURE__ */ p(
|
|
1896
|
+
/* @__PURE__ */ p(Co, {}),
|
|
1897
|
+
/* @__PURE__ */ p(Do, {}),
|
|
1898
|
+
/* @__PURE__ */ p(Mo, {}),
|
|
1898
1899
|
/* @__PURE__ */ p(Io, {}),
|
|
1899
|
-
/* @__PURE__ */ p(
|
|
1900
|
-
/* @__PURE__ */ p(
|
|
1901
|
-
/* @__PURE__ */ p(Ao, {}),
|
|
1902
|
-
/* @__PURE__ */ p(Eo, {}),
|
|
1903
|
-
/* @__PURE__ */ p(So, {}),
|
|
1900
|
+
/* @__PURE__ */ p(_o, {}),
|
|
1901
|
+
/* @__PURE__ */ p(xo, {}),
|
|
1904
1902
|
/* @__PURE__ */ p(
|
|
1905
1903
|
Nt,
|
|
1906
1904
|
{
|
|
@@ -1908,15 +1906,15 @@ function gl() {
|
|
|
1908
1906
|
orientation: "vertical"
|
|
1909
1907
|
}
|
|
1910
1908
|
),
|
|
1909
|
+
/* @__PURE__ */ p(Eo, {}),
|
|
1911
1910
|
/* @__PURE__ */ p(To, {}),
|
|
1912
|
-
/* @__PURE__ */ p(
|
|
1913
|
-
/* @__PURE__ */ p(Oo, {})
|
|
1911
|
+
/* @__PURE__ */ p(Ao, {})
|
|
1914
1912
|
] });
|
|
1915
1913
|
}
|
|
1916
|
-
function
|
|
1917
|
-
const t = Y(), n =
|
|
1914
|
+
function Qd({ buttonBubble: e }) {
|
|
1915
|
+
const t = Y(), n = X(), i = ({ editor: s }) => {
|
|
1918
1916
|
const { selection: r } = s.view.state, { $from: o, to: l } = r;
|
|
1919
|
-
return o.pos === l ? !1 : r instanceof
|
|
1917
|
+
return o.pos === l ? !1 : r instanceof eo;
|
|
1920
1918
|
};
|
|
1921
1919
|
return n ? /* @__PURE__ */ p(
|
|
1922
1920
|
tt,
|
|
@@ -1929,10 +1927,10 @@ function tu({ buttonBubble: e }) {
|
|
|
1929
1927
|
}
|
|
1930
1928
|
) : /* @__PURE__ */ p(M, {});
|
|
1931
1929
|
}
|
|
1932
|
-
function
|
|
1933
|
-
const { t: e } =
|
|
1930
|
+
function tu() {
|
|
1931
|
+
const { t: e } = Z(), t = X(), n = Y(), [i, s] = z(!1), r = L(({ editor: c }) => c.isActive(Di.name), []), o = (c) => {
|
|
1934
1932
|
n.commands.updateTweet({ src: c }), s(!1);
|
|
1935
|
-
}, l = L(() => _e(
|
|
1933
|
+
}, l = L(() => _e(Di.name, n), [n]);
|
|
1936
1934
|
return t ? /* @__PURE__ */ p(
|
|
1937
1935
|
tt,
|
|
1938
1936
|
{
|
|
@@ -1998,7 +1996,7 @@ const ct = () => /* @__PURE__ */ new Map(), Ln = (e) => {
|
|
|
1998
1996
|
return !0;
|
|
1999
1997
|
return !1;
|
|
2000
1998
|
}, Pn = Array.isArray;
|
|
2001
|
-
class
|
|
1999
|
+
class Ls {
|
|
2002
2000
|
constructor() {
|
|
2003
2001
|
this._observers = ct();
|
|
2004
2002
|
}
|
|
@@ -2060,7 +2058,7 @@ class Ps {
|
|
|
2060
2058
|
this._observers = ct();
|
|
2061
2059
|
}
|
|
2062
2060
|
}
|
|
2063
|
-
const xt = Math.floor, Ve = Math.abs, qt = (e, t) => e < t ? e : t, Et = (e, t) => e > t ? e : t,
|
|
2061
|
+
const xt = Math.floor, Ve = Math.abs, qt = (e, t) => e < t ? e : t, Et = (e, t) => e > t ? e : t, Ps = (e) => e !== 0 ? e < 0 : 1 / e < 0, Pi = 1, Bi = 2, _n = 4, En = 8, ue = 32, bt = 64, j = 128, xl = 1 << 29, dn = 31, Bn = 63, Ut = 127, Sl = 2147483647, Bs = Number.MAX_SAFE_INTEGER, kl = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && xt(e) === e), vl = String.fromCharCode, Cl = (e) => e.toLowerCase(), _l = /^\s*/g, El = (e) => e.replace(_l, ""), Tl = /([A-Z])/g, Vi = (e, t) => El(e.replace(Tl, (n) => `${t}${Cl(n)}`)), Dl = (e) => {
|
|
2064
2062
|
const t = unescape(encodeURIComponent(e)), n = t.length, i = new Uint8Array(n);
|
|
2065
2063
|
for (let s = 0; s < n; s++)
|
|
2066
2064
|
i[s] = /** @type {number} */
|
|
@@ -2104,7 +2102,7 @@ const Te = () => new Ee(), Ol = (e) => {
|
|
|
2104
2102
|
$(e, j | Ut & t), t = xt(t / 128);
|
|
2105
2103
|
$(e, Ut & t);
|
|
2106
2104
|
}, ri = (e, t) => {
|
|
2107
|
-
const n =
|
|
2105
|
+
const n = Ps(t);
|
|
2108
2106
|
for (n && (t = -t), $(e, (t > Bn ? j : 0) | (n ? bt : 0) | Bn & t), t = xt(t / 64); t > 0; )
|
|
2109
2107
|
$(e, (t > Ut ? j : 0) | Ut & t), t = xt(t / 128);
|
|
2110
2108
|
}, Hn = new Uint8Array(3e4), Nl = Hn.length / 3, Ul = (e, t) => {
|
|
@@ -2137,7 +2135,7 @@ fe.encodeInto ? Ul : Ll, un = (e, t) => {
|
|
|
2137
2135
|
}, Pl = (e, t) => oi(e, 4).setFloat32(0, t, !1), Bl = (e, t) => oi(e, 8).setFloat64(0, t, !1), Vl = (e, t) => (
|
|
2138
2136
|
/** @type {any} */
|
|
2139
2137
|
oi(e, 8).setBigInt64(0, t, !1)
|
|
2140
|
-
),
|
|
2138
|
+
), Hi = new DataView(new ArrayBuffer(4)), Hl = (e) => (Hi.setFloat32(0, e), Hi.getFloat32(0) === e), Xt = (e, t) => {
|
|
2141
2139
|
switch (typeof t) {
|
|
2142
2140
|
case "string":
|
|
2143
2141
|
$(e, 119), Wt(e, t);
|
|
@@ -2174,7 +2172,7 @@ fe.encodeInto ? Ul : Ll, un = (e, t) => {
|
|
|
2174
2172
|
$(e, 127);
|
|
2175
2173
|
}
|
|
2176
2174
|
};
|
|
2177
|
-
class
|
|
2175
|
+
class $i extends Ee {
|
|
2178
2176
|
/**
|
|
2179
2177
|
* @param {function(Encoder, T):void} writer
|
|
2180
2178
|
*/
|
|
@@ -2188,7 +2186,7 @@ class Fi extends Ee {
|
|
|
2188
2186
|
this.s === t ? this.count++ : (this.count > 0 && T(this, this.count - 1), this.count = 1, this.w(this, t), this.s = t);
|
|
2189
2187
|
}
|
|
2190
2188
|
}
|
|
2191
|
-
const
|
|
2189
|
+
const Fi = (e) => {
|
|
2192
2190
|
e.count > 0 && (ri(e.encoder, e.count === 1 ? e.s : -e.s), e.count > 1 && T(e.encoder, e.count - 2));
|
|
2193
2191
|
};
|
|
2194
2192
|
class He {
|
|
@@ -2199,7 +2197,7 @@ class He {
|
|
|
2199
2197
|
* @param {number} v
|
|
2200
2198
|
*/
|
|
2201
2199
|
write(t) {
|
|
2202
|
-
this.s === t ? this.count++ : (
|
|
2200
|
+
this.s === t ? this.count++ : (Fi(this), this.count = 1, this.s = t);
|
|
2203
2201
|
}
|
|
2204
2202
|
/**
|
|
2205
2203
|
* Flush the encoded state and transform this to a Uint8Array.
|
|
@@ -2207,10 +2205,10 @@ class He {
|
|
|
2207
2205
|
* Note that this should only be called once.
|
|
2208
2206
|
*/
|
|
2209
2207
|
toUint8Array() {
|
|
2210
|
-
return
|
|
2208
|
+
return Fi(this), lt(this.encoder);
|
|
2211
2209
|
}
|
|
2212
2210
|
}
|
|
2213
|
-
const
|
|
2211
|
+
const zi = (e) => {
|
|
2214
2212
|
if (e.count > 0) {
|
|
2215
2213
|
const t = e.diff * 2 + (e.count === 1 ? 0 : 1);
|
|
2216
2214
|
ri(e.encoder, t), e.count > 1 && T(e.encoder, e.count - 2);
|
|
@@ -2224,7 +2222,7 @@ class Tn {
|
|
|
2224
2222
|
* @param {number} v
|
|
2225
2223
|
*/
|
|
2226
2224
|
write(t) {
|
|
2227
|
-
this.diff === t - this.s ? (this.s = t, this.count++) : (
|
|
2225
|
+
this.diff === t - this.s ? (this.s = t, this.count++) : (zi(this), this.count = 1, this.diff = t - this.s, this.s = t);
|
|
2228
2226
|
}
|
|
2229
2227
|
/**
|
|
2230
2228
|
* Flush the encoded state and transform this to a Uint8Array.
|
|
@@ -2232,7 +2230,7 @@ class Tn {
|
|
|
2232
2230
|
* Note that this should only be called once.
|
|
2233
2231
|
*/
|
|
2234
2232
|
toUint8Array() {
|
|
2235
|
-
return
|
|
2233
|
+
return zi(this), lt(this.encoder);
|
|
2236
2234
|
}
|
|
2237
2235
|
}
|
|
2238
2236
|
class $l {
|
|
@@ -2254,7 +2252,7 @@ const Tt = (e) => new Error(e), at = () => {
|
|
|
2254
2252
|
throw Tt("Method unimplemented");
|
|
2255
2253
|
}, q = () => {
|
|
2256
2254
|
throw Tt("Unexpected case");
|
|
2257
|
-
},
|
|
2255
|
+
}, Vs = Tt("Unexpected end of array"), Hs = Tt("Integer out of Range");
|
|
2258
2256
|
class fn {
|
|
2259
2257
|
/**
|
|
2260
2258
|
* @param {Uint8Array} uint8Array Binary data to decode
|
|
@@ -2273,10 +2271,10 @@ const li = (e) => new fn(e), Fl = (e) => e.pos !== e.arr.length, zl = (e, t) =>
|
|
|
2273
2271
|
const s = e.arr[e.pos++];
|
|
2274
2272
|
if (t = t + (s & Ut) * n, n *= 128, s < j)
|
|
2275
2273
|
return t;
|
|
2276
|
-
if (t >
|
|
2277
|
-
throw
|
|
2274
|
+
if (t > Bs)
|
|
2275
|
+
throw Hs;
|
|
2278
2276
|
}
|
|
2279
|
-
throw
|
|
2277
|
+
throw Vs;
|
|
2280
2278
|
}, ci = (e) => {
|
|
2281
2279
|
let t = e.arr[e.pos++], n = t & Bn, i = 64;
|
|
2282
2280
|
const s = (t & bt) > 0 ? -1 : 1;
|
|
@@ -2286,10 +2284,10 @@ const li = (e) => new fn(e), Fl = (e) => e.pos !== e.arr.length, zl = (e, t) =>
|
|
|
2286
2284
|
for (; e.pos < r; ) {
|
|
2287
2285
|
if (t = e.arr[e.pos++], n = n + (t & Ut) * i, i *= 128, t < j)
|
|
2288
2286
|
return s * n;
|
|
2289
|
-
if (n >
|
|
2290
|
-
throw
|
|
2287
|
+
if (n > Bs)
|
|
2288
|
+
throw Hs;
|
|
2291
2289
|
}
|
|
2292
|
-
throw
|
|
2290
|
+
throw Vs;
|
|
2293
2291
|
}, Kl = (e) => {
|
|
2294
2292
|
let t = R(e);
|
|
2295
2293
|
if (t === 0)
|
|
@@ -2356,7 +2354,7 @@ const li = (e) => new fn(e), Fl = (e) => e.pos !== e.arr.length, zl = (e, t) =>
|
|
|
2356
2354
|
nt
|
|
2357
2355
|
// CASE 116: Uint8Array
|
|
2358
2356
|
], Ye = (e) => Jl[127 - pe(e)](e);
|
|
2359
|
-
class
|
|
2357
|
+
class Ki extends fn {
|
|
2360
2358
|
/**
|
|
2361
2359
|
* @param {Uint8Array} uint8Array
|
|
2362
2360
|
* @param {function(Decoder):T} reader
|
|
@@ -2379,7 +2377,7 @@ class $e extends fn {
|
|
|
2379
2377
|
read() {
|
|
2380
2378
|
if (this.count === 0) {
|
|
2381
2379
|
this.s = ci(this);
|
|
2382
|
-
const t =
|
|
2380
|
+
const t = Ps(this.s);
|
|
2383
2381
|
this.count = 1, t && (this.s = -this.s, this.count = R(this) + 2);
|
|
2384
2382
|
}
|
|
2385
2383
|
return this.count--, /** @type {number} */
|
|
@@ -2419,16 +2417,16 @@ class ql {
|
|
|
2419
2417
|
return this.spos = t, n;
|
|
2420
2418
|
}
|
|
2421
2419
|
}
|
|
2422
|
-
const Xl = crypto.getRandomValues.bind(crypto), Zl = Math.random,
|
|
2420
|
+
const Xl = crypto.getRandomValues.bind(crypto), Zl = Math.random, $s = () => Xl(new Uint32Array(1))[0], Ql = (e) => e[xt(Zl() * e.length)], tc = "10000000-1000-4000-8000" + -1e11, ec = () => tc.replace(
|
|
2423
2421
|
/[018]/g,
|
|
2424
2422
|
/** @param {number} c */
|
|
2425
|
-
(e) => (e ^
|
|
2426
|
-
), nc = Date.now,
|
|
2423
|
+
(e) => (e ^ $s() & 15 >> e / 4).toString(16)
|
|
2424
|
+
), nc = Date.now, Wi = (e) => (
|
|
2427
2425
|
/** @type {Promise<T>} */
|
|
2428
2426
|
new Promise(e)
|
|
2429
2427
|
);
|
|
2430
2428
|
Promise.all.bind(Promise);
|
|
2431
|
-
const
|
|
2429
|
+
const ji = (e) => e === void 0 ? null : e;
|
|
2432
2430
|
class ic {
|
|
2433
2431
|
constructor() {
|
|
2434
2432
|
this.map = /* @__PURE__ */ new Map();
|
|
@@ -2447,27 +2445,27 @@ class ic {
|
|
|
2447
2445
|
return this.map.get(t);
|
|
2448
2446
|
}
|
|
2449
2447
|
}
|
|
2450
|
-
let
|
|
2448
|
+
let Fs = new ic(), sc = !0;
|
|
2451
2449
|
try {
|
|
2452
|
-
typeof localStorage < "u" && localStorage && (
|
|
2450
|
+
typeof localStorage < "u" && localStorage && (Fs = localStorage, sc = !1);
|
|
2453
2451
|
} catch {
|
|
2454
2452
|
}
|
|
2455
|
-
const rc =
|
|
2453
|
+
const rc = Fs, oc = Object.assign, zs = Object.keys, lc = (e, t) => {
|
|
2456
2454
|
for (const n in e)
|
|
2457
2455
|
t(e[n], n);
|
|
2458
|
-
},
|
|
2456
|
+
}, Yi = (e) => zs(e).length, cc = (e) => {
|
|
2459
2457
|
for (const t in e)
|
|
2460
2458
|
return !1;
|
|
2461
2459
|
return !0;
|
|
2462
|
-
},
|
|
2460
|
+
}, Ks = (e, t) => {
|
|
2463
2461
|
for (const n in e)
|
|
2464
2462
|
if (!t(e[n], n))
|
|
2465
2463
|
return !1;
|
|
2466
2464
|
return !0;
|
|
2467
|
-
}, ac = (e, t) => Object.prototype.hasOwnProperty.call(e, t), hc = (e, t) => e === t ||
|
|
2465
|
+
}, ac = (e, t) => Object.prototype.hasOwnProperty.call(e, t), hc = (e, t) => e === t || Yi(e) === Yi(t) && Ks(e, (n, i) => (n !== void 0 || ac(t, i)) && t[i] === n), dc = Object.freeze, Ws = (e) => {
|
|
2468
2466
|
for (const t in e) {
|
|
2469
2467
|
const n = e[t];
|
|
2470
|
-
(typeof n == "object" || typeof n == "function") &&
|
|
2468
|
+
(typeof n == "object" || typeof n == "function") && Ws(e[t]);
|
|
2471
2469
|
}
|
|
2472
2470
|
return dc(e);
|
|
2473
2471
|
}, hi = (e, t, n = 0) => {
|
|
@@ -2477,7 +2475,7 @@ const rc = zs, oc = Object.assign, Ks = Object.keys, lc = (e, t) => {
|
|
|
2477
2475
|
} finally {
|
|
2478
2476
|
n < e.length && hi(e, t, n + 1);
|
|
2479
2477
|
}
|
|
2480
|
-
}, uc = (e, t) => t.includes(e), Zt = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]",
|
|
2478
|
+
}, uc = (e, t) => t.includes(e), Zt = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", js = typeof window < "u" && typeof document < "u" && !Zt;
|
|
2481
2479
|
let pt;
|
|
2482
2480
|
const fc = () => {
|
|
2483
2481
|
if (pt === void 0)
|
|
@@ -2493,19 +2491,19 @@ const fc = () => {
|
|
|
2493
2491
|
} else typeof location == "object" ? (pt = ct(), (location.search || "?").slice(1).split("&").forEach((e) => {
|
|
2494
2492
|
if (e.length !== 0) {
|
|
2495
2493
|
const [t, n] = e.split("=");
|
|
2496
|
-
pt.set(`--${
|
|
2494
|
+
pt.set(`--${Vi(t, "-")}`, n), pt.set(`-${Vi(t, "-")}`, n);
|
|
2497
2495
|
}
|
|
2498
2496
|
})) : pt = ct();
|
|
2499
2497
|
return pt;
|
|
2500
|
-
}, Fn = (e) => fc().has(e), Ge = (e) =>
|
|
2501
|
-
|
|
2498
|
+
}, Fn = (e) => fc().has(e), Ge = (e) => ji(Zt ? process.env[e.toUpperCase().replaceAll("-", "_")] : rc.getItem(e)), Ys = (e) => Fn("--" + e) || Ge(e) !== null;
|
|
2499
|
+
Ys("production");
|
|
2502
2500
|
const pc = Zt && uc(process.env.FORCE_COLOR, ["true", "1", "2"]), gc = pc || !Fn("--no-colors") && // @todo deprecate --no-colors
|
|
2503
|
-
!
|
|
2501
|
+
!Ys("no-color") && (!Zt || process.stdout.isTTY) && (!Zt || Fn("--color") || Ge("COLORTERM") !== null || (Ge("TERM") || "").includes("color")), mc = (e) => {
|
|
2504
2502
|
let t = "";
|
|
2505
2503
|
for (let n = 0; n < e.byteLength; n++)
|
|
2506
2504
|
t += vl(e[n]);
|
|
2507
2505
|
return btoa(t);
|
|
2508
|
-
}, wc = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), bc =
|
|
2506
|
+
}, wc = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), bc = js ? mc : wc, yc = (e) => Ol((t) => Xt(t, e));
|
|
2509
2507
|
class xc {
|
|
2510
2508
|
/**
|
|
2511
2509
|
* @param {L} left
|
|
@@ -2530,7 +2528,7 @@ const kc = (e) => ml(e, (t, n) => `${n}:${t};`).join(""), vc = (e) => class {
|
|
|
2530
2528
|
destroy() {
|
|
2531
2529
|
e(this._);
|
|
2532
2530
|
}
|
|
2533
|
-
}, Cc = vc(clearTimeout),
|
|
2531
|
+
}, Cc = vc(clearTimeout), Gs = (e, t) => new Cc(setTimeout(t, e)), kt = Symbol, Js = kt(), qs = kt(), _c = kt(), Ec = kt(), Tc = kt(), Xs = kt(), Dc = kt(), di = kt(), Ic = kt(), Ac = (e) => {
|
|
2534
2532
|
var s;
|
|
2535
2533
|
e.length === 1 && ((s = e[0]) == null ? void 0 : s.constructor) === Function && (e = /** @type {Array<string|Symbol|Object|number>} */
|
|
2536
2534
|
/** @type {[function]} */
|
|
@@ -2552,12 +2550,12 @@ const kc = (e) => ml(e, (t, n) => `${n}:${t};`).join(""), vc = (e) => class {
|
|
|
2552
2550
|
}
|
|
2553
2551
|
return n;
|
|
2554
2552
|
}, Oc = {
|
|
2555
|
-
[
|
|
2556
|
-
[
|
|
2553
|
+
[Js]: wt("font-weight", "bold"),
|
|
2554
|
+
[qs]: wt("font-weight", "normal"),
|
|
2557
2555
|
[_c]: wt("color", "blue"),
|
|
2558
2556
|
[Tc]: wt("color", "green"),
|
|
2559
2557
|
[Ec]: wt("color", "grey"),
|
|
2560
|
-
[
|
|
2558
|
+
[Xs]: wt("color", "red"),
|
|
2561
2559
|
[Dc]: wt("color", "purple"),
|
|
2562
2560
|
[di]: wt("color", "orange"),
|
|
2563
2561
|
// not well supported in chrome when debugging node with inspector - TODO: deprecate
|
|
@@ -2588,11 +2586,11 @@ const kc = (e) => ml(e, (t, n) => `${n}:${t};`).join(""), vc = (e) => class {
|
|
|
2588
2586
|
l instanceof Symbol || s.push(l);
|
|
2589
2587
|
}
|
|
2590
2588
|
return s;
|
|
2591
|
-
},
|
|
2592
|
-
console.log(...
|
|
2593
|
-
},
|
|
2594
|
-
console.warn(...
|
|
2595
|
-
},
|
|
2589
|
+
}, Zs = gc ? Mc : Ac, Rc = (...e) => {
|
|
2590
|
+
console.log(...Zs(e)), tr.forEach((t) => t.print(e));
|
|
2591
|
+
}, Qs = (...e) => {
|
|
2592
|
+
console.warn(...Zs(e)), e.unshift(di), tr.forEach((t) => t.print(e));
|
|
2593
|
+
}, tr = Bt(), er = (e) => ({
|
|
2596
2594
|
/**
|
|
2597
2595
|
* @return {IterableIterator<T>}
|
|
2598
2596
|
*/
|
|
@@ -2601,13 +2599,13 @@ const kc = (e) => ml(e, (t, n) => `${n}:${t};`).join(""), vc = (e) => class {
|
|
|
2601
2599
|
},
|
|
2602
2600
|
// @ts-ignore
|
|
2603
2601
|
next: e
|
|
2604
|
-
}), Nc = (e, t) =>
|
|
2602
|
+
}), Nc = (e, t) => er(() => {
|
|
2605
2603
|
let n;
|
|
2606
2604
|
do
|
|
2607
2605
|
n = e.next();
|
|
2608
2606
|
while (!n.done && !t(n.value));
|
|
2609
2607
|
return n;
|
|
2610
|
-
}), In = (e, t) =>
|
|
2608
|
+
}), In = (e, t) => er(() => {
|
|
2611
2609
|
const { done: n, value: i } = e.next();
|
|
2612
2610
|
return { done: n, value: n ? void 0 : t(i) };
|
|
2613
2611
|
});
|
|
@@ -2633,7 +2631,7 @@ const Dt = (e, t, n) => t.clients.forEach((i, s) => {
|
|
|
2633
2631
|
if (r != null) {
|
|
2634
2632
|
const o = r[r.length - 1], l = o.id.clock + o.length;
|
|
2635
2633
|
for (let c = 0, a = i[c]; c < i.length && a.clock < l; a = i[++c])
|
|
2636
|
-
|
|
2634
|
+
ar(e, r, a.clock, a.len, n);
|
|
2637
2635
|
}
|
|
2638
2636
|
}), Uc = (e, t) => {
|
|
2639
2637
|
let n = 0, i = e.length - 1;
|
|
@@ -2677,8 +2675,8 @@ const Dt = (e, t, n) => t.clients.forEach((i, s) => {
|
|
|
2677
2675
|
/** @type {Array<DeleteItem>} */
|
|
2678
2676
|
[]
|
|
2679
2677
|
)).push(new ui(n, i));
|
|
2680
|
-
},
|
|
2681
|
-
const t =
|
|
2678
|
+
}, nr = () => new ne(), Lc = (e) => {
|
|
2679
|
+
const t = nr();
|
|
2682
2680
|
return e.clients.forEach((n, i) => {
|
|
2683
2681
|
const s = [];
|
|
2684
2682
|
for (let r = 0; r < n.length; r++) {
|
|
@@ -2719,7 +2717,7 @@ const Dt = (e, t, n) => t.clients.forEach((i, s) => {
|
|
|
2719
2717
|
}
|
|
2720
2718
|
}
|
|
2721
2719
|
return t;
|
|
2722
|
-
},
|
|
2720
|
+
}, Gi = (e, t, n) => {
|
|
2723
2721
|
const i = new ne(), s = R(e.restDecoder);
|
|
2724
2722
|
for (let r = 0; r < s; r++) {
|
|
2725
2723
|
e.resetDsCurVal();
|
|
@@ -2740,18 +2738,18 @@ const Dt = (e, t, n) => t.clients.forEach((i, s) => {
|
|
|
2740
2738
|
return T(r.restEncoder, 0), pi(r, i), r.toUint8Array();
|
|
2741
2739
|
}
|
|
2742
2740
|
return null;
|
|
2743
|
-
},
|
|
2744
|
-
class Ft extends
|
|
2741
|
+
}, ir = $s;
|
|
2742
|
+
class Ft extends Ls {
|
|
2745
2743
|
/**
|
|
2746
2744
|
* @param {DocOpts} opts configuration
|
|
2747
2745
|
*/
|
|
2748
2746
|
constructor({ guid: t = ec(), collectionid: n = null, gc: i = !0, gcFilter: s = () => !0, meta: r = null, autoLoad: o = !1, shouldLoad: l = !0 } = {}) {
|
|
2749
|
-
super(), this.gc = i, this.gcFilter = s, this.clientID =
|
|
2747
|
+
super(), this.gc = i, this.gcFilter = s, this.clientID = ir(), this.guid = t, this.collectionid = n, this.share = /* @__PURE__ */ new Map(), this.store = new lr(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = l, this.autoLoad = o, this.meta = r, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = Wi((a) => {
|
|
2750
2748
|
this.on("load", () => {
|
|
2751
2749
|
this.isLoaded = !0, a(this);
|
|
2752
2750
|
});
|
|
2753
2751
|
});
|
|
2754
|
-
const c = () =>
|
|
2752
|
+
const c = () => Wi((a) => {
|
|
2755
2753
|
const d = (h) => {
|
|
2756
2754
|
(h === void 0 || h === !0) && (this.off("sync", d), a());
|
|
2757
2755
|
};
|
|
@@ -2983,7 +2981,7 @@ class Je extends Bc {
|
|
|
2983
2981
|
* @param {decoding.Decoder} decoder
|
|
2984
2982
|
*/
|
|
2985
2983
|
constructor(t) {
|
|
2986
|
-
super(t), this.keys = [], R(t), this.keyClockDecoder = new Dn(nt(t)), this.clientDecoder = new $e(nt(t)), this.leftClockDecoder = new Dn(nt(t)), this.rightClockDecoder = new Dn(nt(t)), this.infoDecoder = new
|
|
2984
|
+
super(t), this.keys = [], R(t), this.keyClockDecoder = new Dn(nt(t)), this.clientDecoder = new $e(nt(t)), this.leftClockDecoder = new Dn(nt(t)), this.rightClockDecoder = new Dn(nt(t)), this.infoDecoder = new Ki(nt(t), pe), this.stringDecoder = new ql(nt(t)), this.parentInfoDecoder = new Ki(nt(t), pe), this.typeRefDecoder = new $e(nt(t)), this.lenDecoder = new $e(nt(t));
|
|
2987
2985
|
}
|
|
2988
2986
|
/**
|
|
2989
2987
|
* @return {ID}
|
|
@@ -3199,7 +3197,7 @@ class $c {
|
|
|
3199
3197
|
}
|
|
3200
3198
|
class pn extends $c {
|
|
3201
3199
|
constructor() {
|
|
3202
|
-
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new Tn(), this.clientEncoder = new He(), this.leftClockEncoder = new Tn(), this.rightClockEncoder = new Tn(), this.infoEncoder = new
|
|
3200
|
+
super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new Tn(), this.clientEncoder = new He(), this.leftClockEncoder = new Tn(), this.rightClockEncoder = new Tn(), this.infoEncoder = new $i(Vn), this.stringEncoder = new $l(), this.parentInfoEncoder = new $i(Vn), this.typeRefEncoder = new He(), this.lenEncoder = new He();
|
|
3203
3201
|
}
|
|
3204
3202
|
toUint8Array() {
|
|
3205
3203
|
const t = Te();
|
|
@@ -3298,7 +3296,7 @@ const Fc = (e, t, n, i) => {
|
|
|
3298
3296
|
r.write(e, i - r.id.clock);
|
|
3299
3297
|
for (let o = s + 1; o < t.length; o++)
|
|
3300
3298
|
t[o].write(e, 0);
|
|
3301
|
-
},
|
|
3299
|
+
}, sr = (e, t, n) => {
|
|
3302
3300
|
const i = /* @__PURE__ */ new Map();
|
|
3303
3301
|
n.forEach((s, r) => {
|
|
3304
3302
|
B(t, r) > s && i.set(r, s);
|
|
@@ -3347,7 +3345,7 @@ const Fc = (e, t, n, i) => {
|
|
|
3347
3345
|
// parent
|
|
3348
3346
|
h && (d & ue) === ue ? e.readString() : null,
|
|
3349
3347
|
// parentSub
|
|
3350
|
-
|
|
3348
|
+
Or(e, d)
|
|
3351
3349
|
// item content
|
|
3352
3350
|
);
|
|
3353
3351
|
o[a] = u, c += u.length;
|
|
@@ -3379,7 +3377,7 @@ const Fc = (e, t, n, i) => {
|
|
|
3379
3377
|
let o = r();
|
|
3380
3378
|
if (o === null)
|
|
3381
3379
|
return null;
|
|
3382
|
-
const l = new
|
|
3380
|
+
const l = new lr(), c = /* @__PURE__ */ new Map(), a = (f, g) => {
|
|
3383
3381
|
const m = c.get(f);
|
|
3384
3382
|
(m == null || m > g) && c.set(f, g);
|
|
3385
3383
|
};
|
|
@@ -3438,10 +3436,10 @@ const Fc = (e, t, n, i) => {
|
|
|
3438
3436
|
}
|
|
3439
3437
|
if (l.clients.size > 0) {
|
|
3440
3438
|
const f = new pn();
|
|
3441
|
-
return
|
|
3439
|
+
return sr(f, l, /* @__PURE__ */ new Map()), T(f.restEncoder, 0), { missing: c, update: f.toUint8Array() };
|
|
3442
3440
|
}
|
|
3443
3441
|
return null;
|
|
3444
|
-
}, Wc = (e, t) =>
|
|
3442
|
+
}, Wc = (e, t) => sr(e, t.doc.store, t.beforeState), jc = (e, t, n, i = new Je(e)) => O(t, (s) => {
|
|
3445
3443
|
s.local = !1;
|
|
3446
3444
|
let r = !1;
|
|
3447
3445
|
const o = s.doc, l = o.store, c = zc(i, o), a = Kc(s, l, c), d = l.pendingStructs;
|
|
@@ -3456,16 +3454,16 @@ const Fc = (e, t, n, i) => {
|
|
|
3456
3454
|
const g = d.missing.get(u);
|
|
3457
3455
|
(g == null || g > f) && d.missing.set(u, f);
|
|
3458
3456
|
}
|
|
3459
|
-
d.update =
|
|
3457
|
+
d.update = is([d.update, a.update]);
|
|
3460
3458
|
}
|
|
3461
3459
|
} else
|
|
3462
3460
|
l.pendingStructs = a;
|
|
3463
|
-
const h =
|
|
3461
|
+
const h = Gi(i, s, l);
|
|
3464
3462
|
if (l.pendingDs) {
|
|
3465
3463
|
const u = new Je(li(l.pendingDs));
|
|
3466
3464
|
R(u.restDecoder);
|
|
3467
|
-
const f =
|
|
3468
|
-
h && f ? l.pendingDs =
|
|
3465
|
+
const f = Gi(u, s, l);
|
|
3466
|
+
h && f ? l.pendingDs = is([h, f]) : l.pendingDs = h || f;
|
|
3469
3467
|
} else
|
|
3470
3468
|
l.pendingDs = h;
|
|
3471
3469
|
if (r) {
|
|
@@ -3484,10 +3482,10 @@ class Yc {
|
|
|
3484
3482
|
this.l = [];
|
|
3485
3483
|
}
|
|
3486
3484
|
}
|
|
3487
|
-
const
|
|
3485
|
+
const Ji = () => new Yc(), qi = (e, t) => e.l.push(t), Xi = (e, t) => {
|
|
3488
3486
|
const n = e.l, i = n.length;
|
|
3489
3487
|
e.l = n.filter((s) => t !== s), i === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
|
|
3490
|
-
},
|
|
3488
|
+
}, rr = (e, t, n) => hi(e.l, [t, n]);
|
|
3491
3489
|
class jt {
|
|
3492
3490
|
/**
|
|
3493
3491
|
* @param {number} client client id
|
|
@@ -3601,14 +3599,14 @@ class gi {
|
|
|
3601
3599
|
this.ds = t, this.sv = n;
|
|
3602
3600
|
}
|
|
3603
3601
|
}
|
|
3604
|
-
const
|
|
3602
|
+
const or = (e, t) => new gi(e, t), On = (e) => or(Lc(e.store), gn(e.store)), Rt = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !ie(t.ds, e.id), Wn = (e, t) => {
|
|
3605
3603
|
const n = St(e.meta, Wn, Bt), i = e.doc.store;
|
|
3606
3604
|
n.has(t) || (t.sv.forEach((s, r) => {
|
|
3607
3605
|
s < B(i, r) && G(e, C(r, s));
|
|
3608
3606
|
}), Dt(e, t.ds, (s) => {
|
|
3609
3607
|
}), n.add(t));
|
|
3610
3608
|
};
|
|
3611
|
-
class
|
|
3609
|
+
class lr {
|
|
3612
3610
|
constructor() {
|
|
3613
3611
|
this.clients = /* @__PURE__ */ new Map(), this.pendingStructs = null, this.pendingDs = null;
|
|
3614
3612
|
}
|
|
@@ -3625,7 +3623,7 @@ const gn = (e) => {
|
|
|
3625
3623
|
return 0;
|
|
3626
3624
|
const i = n[n.length - 1];
|
|
3627
3625
|
return i.id.clock + i.length;
|
|
3628
|
-
},
|
|
3626
|
+
}, cr = (e, t) => {
|
|
3629
3627
|
let n = e.clients.get(t.id.client);
|
|
3630
3628
|
if (n === void 0)
|
|
3631
3629
|
n = [], e.clients.set(t.id.client, n);
|
|
@@ -3665,7 +3663,7 @@ const gn = (e) => {
|
|
|
3665
3663
|
e.doc.store.clients.get(t.client)
|
|
3666
3664
|
);
|
|
3667
3665
|
return n[jn(e, n, t.clock)];
|
|
3668
|
-
},
|
|
3666
|
+
}, Zi = (e, t, n) => {
|
|
3669
3667
|
const i = t.clients.get(n.client), s = ht(i, n.clock), r = i[s];
|
|
3670
3668
|
return n.clock !== r.id.clock + r.length - 1 && r.constructor !== it && i.splice(s + 1, 0, en(e, r, n.clock - r.id.clock + 1)), r;
|
|
3671
3669
|
}, Qc = (e, t, n) => {
|
|
@@ -3674,7 +3672,7 @@ const gn = (e) => {
|
|
|
3674
3672
|
e.clients.get(t.id.client)
|
|
3675
3673
|
);
|
|
3676
3674
|
i[ht(i, t.id.clock)] = n;
|
|
3677
|
-
},
|
|
3675
|
+
}, ar = (e, t, n, i, s) => {
|
|
3678
3676
|
if (i === 0)
|
|
3679
3677
|
return;
|
|
3680
3678
|
const r = n + i;
|
|
@@ -3693,7 +3691,7 @@ class ta {
|
|
|
3693
3691
|
this.doc = t, this.deleteSet = new ne(), this.beforeState = gn(t.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = n, this.meta = /* @__PURE__ */ new Map(), this.local = i, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
|
|
3694
3692
|
}
|
|
3695
3693
|
}
|
|
3696
|
-
const
|
|
3694
|
+
const Qi = (e, t) => t.deleteSet.clients.size === 0 && !wl(t.afterState, (n, i) => t.beforeState.get(i) !== n) ? !1 : (fi(t.deleteSet), Wc(e, t), pi(e, t.deleteSet), !0), ts = (e, t, n) => {
|
|
3697
3695
|
const i = t._item;
|
|
3698
3696
|
(i === null || i.id.clock < (e.beforeState.get(i.id.client) || 0) && !i.deleted) && St(e.changed, t, Bt).add(n);
|
|
3699
3697
|
}, Fe = (e, t) => {
|
|
@@ -3740,7 +3738,7 @@ const ts = (e, t) => t.deleteSet.clients.size === 0 && !wl(t.afterState, (n, i)
|
|
|
3740
3738
|
c -= 1 + Fe(s, c);
|
|
3741
3739
|
}
|
|
3742
3740
|
});
|
|
3743
|
-
},
|
|
3741
|
+
}, hr = (e, t) => {
|
|
3744
3742
|
if (t < e.length) {
|
|
3745
3743
|
const n = e[t], i = n.doc, s = i.store, r = n.deleteSet, o = n._mergeStructs;
|
|
3746
3744
|
try {
|
|
@@ -3756,7 +3754,7 @@ const ts = (e, t) => t.deleteSet.clients.size === 0 && !wl(t.afterState, (n, i)
|
|
|
3756
3754
|
(d) => d.target._item === null || !d.target._item.deleted
|
|
3757
3755
|
), c.forEach((d) => {
|
|
3758
3756
|
d.currentTarget = a, d._path = null;
|
|
3759
|
-
}), c.sort((d, h) => d.path.length - h.path.length),
|
|
3757
|
+
}), c.sort((d, h) => d.path.length - h.path.length), rr(a._dEH, c, n));
|
|
3760
3758
|
});
|
|
3761
3759
|
}), l.push(() => i.emit("afterTransaction", [n, i])), hi(l, []), n._needFormattingCleanup && ka(n);
|
|
3762
3760
|
} finally {
|
|
@@ -3778,18 +3776,18 @@ const ts = (e, t) => t.deleteSet.clients.size === 0 && !wl(t.afterState, (n, i)
|
|
|
3778
3776
|
), g = ht(f, u);
|
|
3779
3777
|
g + 1 < f.length && Fe(f, g + 1) > 1 || g > 0 && Fe(f, g);
|
|
3780
3778
|
}
|
|
3781
|
-
if (!n.local && n.afterState.get(i.clientID) !== n.beforeState.get(i.clientID) && (Rc(di,
|
|
3779
|
+
if (!n.local && n.afterState.get(i.clientID) !== n.beforeState.get(i.clientID) && (Rc(di, Js, "[yjs] ", qs, Xs, "Changed the client-id because another client seems to be using it."), i.clientID = ir()), i.emit("afterTransactionCleanup", [n, i]), i._observers.has("update")) {
|
|
3782
3780
|
const d = new Hc();
|
|
3783
|
-
|
|
3781
|
+
Qi(d, n) && i.emit("update", [d.toUint8Array(), n.origin, i, n]);
|
|
3784
3782
|
}
|
|
3785
3783
|
if (i._observers.has("updateV2")) {
|
|
3786
3784
|
const d = new pn();
|
|
3787
|
-
|
|
3785
|
+
Qi(d, n) && i.emit("updateV2", [d.toUint8Array(), n.origin, i, n]);
|
|
3788
3786
|
}
|
|
3789
3787
|
const { subdocsAdded: l, subdocsLoaded: c, subdocsRemoved: a } = n;
|
|
3790
3788
|
(l.size > 0 || a.size > 0 || c.size > 0) && (l.forEach((d) => {
|
|
3791
3789
|
d.clientID = i.clientID, d.collectionid == null && (d.collectionid = i.collectionid), i.subdocs.add(d);
|
|
3792
|
-
}), a.forEach((d) => i.subdocs.delete(d)), i.emit("subdocs", [{ loaded: c, added: l, removed: a }, i, n]), a.forEach((d) => d.destroy())), e.length <= t + 1 ? (i._transactionCleanups = [], i.emit("afterAllTransactions", [i, e])) :
|
|
3790
|
+
}), a.forEach((d) => i.subdocs.delete(d)), i.emit("subdocs", [{ loaded: c, added: l, removed: a }, i, n]), a.forEach((d) => d.destroy())), e.length <= t + 1 ? (i._transactionCleanups = [], i.emit("afterAllTransactions", [i, e])) : hr(e, t + 1);
|
|
3793
3791
|
}
|
|
3794
3792
|
}
|
|
3795
3793
|
}, O = (e, t, n = null, i = !0) => {
|
|
@@ -3801,7 +3799,7 @@ const ts = (e, t) => t.deleteSet.clients.size === 0 && !wl(t.afterState, (n, i)
|
|
|
3801
3799
|
} finally {
|
|
3802
3800
|
if (r) {
|
|
3803
3801
|
const l = e._transaction === s[0];
|
|
3804
|
-
e._transaction = null, l &&
|
|
3802
|
+
e._transaction = null, l && hr(s, 0);
|
|
3805
3803
|
}
|
|
3806
3804
|
}
|
|
3807
3805
|
return o;
|
|
@@ -3815,7 +3813,7 @@ class ia {
|
|
|
3815
3813
|
this.insertions = n, this.deletions = t, this.meta = /* @__PURE__ */ new Map();
|
|
3816
3814
|
}
|
|
3817
3815
|
}
|
|
3818
|
-
const
|
|
3816
|
+
const es = (e, t, n) => {
|
|
3819
3817
|
Dt(e, n.deletions, (i) => {
|
|
3820
3818
|
i instanceof A && t.scope.some((s) => s === e.doc || we(
|
|
3821
3819
|
/** @type {AbstractType<any>} */
|
|
@@ -3823,7 +3821,7 @@ const ns = (e, t, n) => {
|
|
|
3823
3821
|
i
|
|
3824
3822
|
)) && xi(i, !1);
|
|
3825
3823
|
});
|
|
3826
|
-
},
|
|
3824
|
+
}, ns = (e, t, n) => {
|
|
3827
3825
|
let i = null;
|
|
3828
3826
|
const s = e.doc, r = e.scope;
|
|
3829
3827
|
O(s, (l) => {
|
|
@@ -3854,7 +3852,7 @@ const ns = (e, t, n) => {
|
|
|
3854
3852
|
)) && // Never redo structs in stackItem.insertions because they were created and deleted in the same capture interval.
|
|
3855
3853
|
!ie(a.insertions, f.id) && d.add(f);
|
|
3856
3854
|
}), d.forEach((f) => {
|
|
3857
|
-
u =
|
|
3855
|
+
u = Ar(l, f, d, a.insertions, e.ignoreRemoteMapChanges, e) !== null || u;
|
|
3858
3856
|
});
|
|
3859
3857
|
for (let f = h.length - 1; f >= 0; f--) {
|
|
3860
3858
|
const g = h[f];
|
|
@@ -3873,7 +3871,7 @@ const ns = (e, t, n) => {
|
|
|
3873
3871
|
}
|
|
3874
3872
|
return o;
|
|
3875
3873
|
};
|
|
3876
|
-
class
|
|
3874
|
+
class dr extends Ls {
|
|
3877
3875
|
/**
|
|
3878
3876
|
* @param {Doc|AbstractType<any>|Array<AbstractType<any>>} typeScope Limits the scope of the UndoManager. If this is set to a ydoc instance, all changes on that ydoc will be undone. If set to a specific type, only changes on that type or its children will be undone. Also accepts an array of types.
|
|
3879
3877
|
* @param {UndoManagerOptions} options
|
|
@@ -3935,7 +3933,7 @@ class ur extends Ps {
|
|
|
3935
3933
|
addToScope(t) {
|
|
3936
3934
|
const n = new Set(this.scope);
|
|
3937
3935
|
t = Pn(t) ? t : [t], t.forEach((i) => {
|
|
3938
|
-
n.has(i) || (n.add(i), (i instanceof F ? i.doc !== this.doc : i !== this.doc) &&
|
|
3936
|
+
n.has(i) || (n.add(i), (i instanceof F ? i.doc !== this.doc : i !== this.doc) && Qs("[yjs#509] Not same Y.Doc"), this.scope.push(i));
|
|
3939
3937
|
});
|
|
3940
3938
|
}
|
|
3941
3939
|
/**
|
|
@@ -3952,7 +3950,7 @@ class ur extends Ps {
|
|
|
3952
3950
|
}
|
|
3953
3951
|
clear(t = !0, n = !0) {
|
|
3954
3952
|
(t && this.canUndo() || n && this.canRedo()) && this.doc.transact((i) => {
|
|
3955
|
-
t && (this.undoStack.forEach((s) =>
|
|
3953
|
+
t && (this.undoStack.forEach((s) => es(i, this, s)), this.undoStack = []), n && (this.redoStack.forEach((s) => es(i, this, s)), this.redoStack = []), this.emit("stack-cleared", [{ undoStackCleared: t, redoStackCleared: n }]);
|
|
3956
3954
|
});
|
|
3957
3955
|
}
|
|
3958
3956
|
/**
|
|
@@ -3987,7 +3985,7 @@ class ur extends Ps {
|
|
|
3987
3985
|
this.undoing = !0;
|
|
3988
3986
|
let t;
|
|
3989
3987
|
try {
|
|
3990
|
-
t =
|
|
3988
|
+
t = ns(this, this.undoStack, "undo");
|
|
3991
3989
|
} finally {
|
|
3992
3990
|
this.undoing = !1;
|
|
3993
3991
|
}
|
|
@@ -4002,7 +4000,7 @@ class ur extends Ps {
|
|
|
4002
4000
|
this.redoing = !0;
|
|
4003
4001
|
let t;
|
|
4004
4002
|
try {
|
|
4005
|
-
t =
|
|
4003
|
+
t = ns(this, this.redoStack, "redo");
|
|
4006
4004
|
} finally {
|
|
4007
4005
|
this.redoing = !1;
|
|
4008
4006
|
}
|
|
@@ -4054,7 +4052,7 @@ function* sa(e) {
|
|
|
4054
4052
|
// parent
|
|
4055
4053
|
c && (l & ue) === ue ? e.readString() : null,
|
|
4056
4054
|
// parentSub
|
|
4057
|
-
|
|
4055
|
+
Or(e, l)
|
|
4058
4056
|
// item content
|
|
4059
4057
|
);
|
|
4060
4058
|
yield a, r += a.length;
|
|
@@ -4114,7 +4112,7 @@ const la = (e, t) => {
|
|
|
4114
4112
|
n.content.splice(t)
|
|
4115
4113
|
);
|
|
4116
4114
|
}
|
|
4117
|
-
},
|
|
4115
|
+
}, is = (e, t = Je, n = pn) => {
|
|
4118
4116
|
if (e.length === 1)
|
|
4119
4117
|
return e[0];
|
|
4120
4118
|
const i = e.map((d) => new t(li(d)));
|
|
@@ -4173,19 +4171,19 @@ const la = (e, t) => {
|
|
|
4173
4171
|
r !== null && (ae(l, r.struct, r.offset), r = null), ca(l);
|
|
4174
4172
|
const c = i.map((d) => Pc(d)), a = zn(c);
|
|
4175
4173
|
return pi(o, a), o.toUint8Array();
|
|
4176
|
-
},
|
|
4174
|
+
}, ur = (e) => {
|
|
4177
4175
|
e.written > 0 && (e.clientStructs.push({ written: e.written, restEncoder: lt(e.encoder.restEncoder) }), e.encoder.restEncoder = Te(), e.written = 0);
|
|
4178
4176
|
}, ae = (e, t, n) => {
|
|
4179
|
-
e.written > 0 && e.currClient !== t.id.client &&
|
|
4177
|
+
e.written > 0 && e.currClient !== t.id.client && ur(e), e.written === 0 && (e.currClient = t.id.client, e.encoder.writeClient(t.id.client), T(e.encoder.restEncoder, t.id.clock + n)), t.write(e.encoder, n), e.written++;
|
|
4180
4178
|
}, ca = (e) => {
|
|
4181
|
-
|
|
4179
|
+
ur(e);
|
|
4182
4180
|
const t = e.encoder.restEncoder;
|
|
4183
4181
|
T(t, e.clientStructs.length);
|
|
4184
4182
|
for (let n = 0; n < e.clientStructs.length; n++) {
|
|
4185
4183
|
const i = e.clientStructs[n];
|
|
4186
4184
|
T(t, i.written), un(t, i.restEncoder);
|
|
4187
4185
|
}
|
|
4188
|
-
},
|
|
4186
|
+
}, ss = "You must not compute changes after the event-handler fired.";
|
|
4189
4187
|
class mn {
|
|
4190
4188
|
/**
|
|
4191
4189
|
* @param {T} target The changed type.
|
|
@@ -4222,12 +4220,12 @@ class mn {
|
|
|
4222
4220
|
return ie(this.transaction.deleteSet, t.id);
|
|
4223
4221
|
}
|
|
4224
4222
|
/**
|
|
4225
|
-
* @type {Map<string, { action: 'add' | 'update' | 'delete', oldValue: any
|
|
4223
|
+
* @type {Map<string, { action: 'add' | 'update' | 'delete', oldValue: any }>}
|
|
4226
4224
|
*/
|
|
4227
4225
|
get keys() {
|
|
4228
4226
|
if (this._keys === null) {
|
|
4229
4227
|
if (this.transaction.doc._transactionCleanups.length === 0)
|
|
4230
|
-
throw Tt(
|
|
4228
|
+
throw Tt(ss);
|
|
4231
4229
|
const t = /* @__PURE__ */ new Map(), n = this.target;
|
|
4232
4230
|
/** @type Set<string|null> */
|
|
4233
4231
|
this.transaction.changed.get(n).forEach((s) => {
|
|
@@ -4295,7 +4293,7 @@ class mn {
|
|
|
4295
4293
|
let t = this._changes;
|
|
4296
4294
|
if (t === null) {
|
|
4297
4295
|
if (this.transaction.doc._transactionCleanups.length === 0)
|
|
4298
|
-
throw Tt(
|
|
4296
|
+
throw Tt(ss);
|
|
4299
4297
|
const n = this.target, i = Bt(), s = Bt(), r = [];
|
|
4300
4298
|
if (t = {
|
|
4301
4299
|
added: i,
|
|
@@ -4339,8 +4337,8 @@ const aa = (e, t) => {
|
|
|
4339
4337
|
}
|
|
4340
4338
|
return n;
|
|
4341
4339
|
}, W = () => {
|
|
4342
|
-
|
|
4343
|
-
},
|
|
4340
|
+
Qs("Invalid access: Add Yjs type to a document before reading data.");
|
|
4341
|
+
}, fr = 80;
|
|
4344
4342
|
let mi = 0;
|
|
4345
4343
|
class ha {
|
|
4346
4344
|
/**
|
|
@@ -4353,12 +4351,12 @@ class ha {
|
|
|
4353
4351
|
}
|
|
4354
4352
|
const da = (e) => {
|
|
4355
4353
|
e.timestamp = mi++;
|
|
4356
|
-
},
|
|
4354
|
+
}, pr = (e, t, n) => {
|
|
4357
4355
|
e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp = mi++;
|
|
4358
4356
|
}, ua = (e, t, n) => {
|
|
4359
|
-
if (e.length >=
|
|
4357
|
+
if (e.length >= fr) {
|
|
4360
4358
|
const i = e.reduce((s, r) => s.timestamp < r.timestamp ? s : r);
|
|
4361
|
-
return
|
|
4359
|
+
return pr(i, t, n), i;
|
|
4362
4360
|
} else {
|
|
4363
4361
|
const i = new ha(t, n);
|
|
4364
4362
|
return e.push(i), i;
|
|
@@ -4381,7 +4379,7 @@ const da = (e) => {
|
|
|
4381
4379
|
for (; i.left !== null && i.left.id.client === i.id.client && i.left.id.clock + i.left.length === i.id.clock; )
|
|
4382
4380
|
i = i.left, !i.deleted && i.countable && (s -= i.length);
|
|
4383
4381
|
return n !== null && Ve(n.index - s) < /** @type {YText|YArray<any>} */
|
|
4384
|
-
i.parent.length /
|
|
4382
|
+
i.parent.length / fr ? (pr(n, i, s), n) : ua(e._searchMarker, i, s);
|
|
4385
4383
|
}, be = (e, t, n) => {
|
|
4386
4384
|
for (let i = e.length - 1; i >= 0; i--) {
|
|
4387
4385
|
const s = e[i];
|
|
@@ -4402,11 +4400,11 @@ const da = (e) => {
|
|
|
4402
4400
|
for (; St(s, e, () => []).push(n), e._item !== null; )
|
|
4403
4401
|
e = /** @type {AbstractType<any>} */
|
|
4404
4402
|
e._item.parent;
|
|
4405
|
-
|
|
4403
|
+
rr(i._eH, n, t);
|
|
4406
4404
|
};
|
|
4407
4405
|
class F {
|
|
4408
4406
|
constructor() {
|
|
4409
|
-
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH =
|
|
4407
|
+
this._item = null, this._map = /* @__PURE__ */ new Map(), this._start = null, this.doc = null, this._length = 0, this._eH = Ji(), this._dEH = Ji(), this._searchMarker = null;
|
|
4410
4408
|
}
|
|
4411
4409
|
/**
|
|
4412
4410
|
* @return {AbstractType<any>|null}
|
|
@@ -4476,7 +4474,7 @@ class F {
|
|
|
4476
4474
|
* @param {function(EventType, Transaction):void} f Observer function
|
|
4477
4475
|
*/
|
|
4478
4476
|
observe(t) {
|
|
4479
|
-
|
|
4477
|
+
qi(this._eH, t);
|
|
4480
4478
|
}
|
|
4481
4479
|
/**
|
|
4482
4480
|
* Observe all events that are created by this type and its children.
|
|
@@ -4484,7 +4482,7 @@ class F {
|
|
|
4484
4482
|
* @param {function(Array<YEvent<any>>,Transaction):void} f Observer function
|
|
4485
4483
|
*/
|
|
4486
4484
|
observeDeep(t) {
|
|
4487
|
-
|
|
4485
|
+
qi(this._dEH, t);
|
|
4488
4486
|
}
|
|
4489
4487
|
/**
|
|
4490
4488
|
* Unregister an observer function.
|
|
@@ -4492,7 +4490,7 @@ class F {
|
|
|
4492
4490
|
* @param {function(EventType,Transaction):void} f Observer function
|
|
4493
4491
|
*/
|
|
4494
4492
|
unobserve(t) {
|
|
4495
|
-
|
|
4493
|
+
Xi(this._eH, t);
|
|
4496
4494
|
}
|
|
4497
4495
|
/**
|
|
4498
4496
|
* Unregister an observer function.
|
|
@@ -4500,7 +4498,7 @@ class F {
|
|
|
4500
4498
|
* @param {function(Array<YEvent<any>>,Transaction):void} f Observer function
|
|
4501
4499
|
*/
|
|
4502
4500
|
unobserveDeep(t) {
|
|
4503
|
-
|
|
4501
|
+
Xi(this._dEH, t);
|
|
4504
4502
|
}
|
|
4505
4503
|
/**
|
|
4506
4504
|
* @abstract
|
|
@@ -4509,7 +4507,7 @@ class F {
|
|
|
4509
4507
|
toJSON() {
|
|
4510
4508
|
}
|
|
4511
4509
|
}
|
|
4512
|
-
const
|
|
4510
|
+
const gr = (e, t, n) => {
|
|
4513
4511
|
e.doc ?? W(), t < 0 && (t = e._length + t), n < 0 && (n = e._length + n);
|
|
4514
4512
|
let i = n - t;
|
|
4515
4513
|
const s = [];
|
|
@@ -4528,7 +4526,7 @@ const mr = (e, t, n) => {
|
|
|
4528
4526
|
r = r.right;
|
|
4529
4527
|
}
|
|
4530
4528
|
return s;
|
|
4531
|
-
},
|
|
4529
|
+
}, mr = (e) => {
|
|
4532
4530
|
e.doc ?? W();
|
|
4533
4531
|
const t = [];
|
|
4534
4532
|
let n = e._start;
|
|
@@ -4541,7 +4539,7 @@ const mr = (e, t, n) => {
|
|
|
4541
4539
|
n = n.right;
|
|
4542
4540
|
}
|
|
4543
4541
|
return t;
|
|
4544
|
-
},
|
|
4542
|
+
}, wr = (e, t) => {
|
|
4545
4543
|
const n = [];
|
|
4546
4544
|
let i = e._start;
|
|
4547
4545
|
for (; i !== null; ) {
|
|
@@ -4563,7 +4561,7 @@ const mr = (e, t, n) => {
|
|
|
4563
4561
|
}
|
|
4564
4562
|
i = i.right;
|
|
4565
4563
|
}
|
|
4566
|
-
},
|
|
4564
|
+
}, br = (e, t) => {
|
|
4567
4565
|
const n = [];
|
|
4568
4566
|
return ye(e, (i, s) => {
|
|
4569
4567
|
n.push(t(i, s, e));
|
|
@@ -4592,7 +4590,7 @@ const mr = (e, t, n) => {
|
|
|
4592
4590
|
};
|
|
4593
4591
|
}
|
|
4594
4592
|
};
|
|
4595
|
-
},
|
|
4593
|
+
}, yr = (e, t) => {
|
|
4596
4594
|
e.doc ?? W();
|
|
4597
4595
|
const n = wn(e, t);
|
|
4598
4596
|
let i = e._start;
|
|
@@ -4644,9 +4642,9 @@ const mr = (e, t, n) => {
|
|
|
4644
4642
|
}
|
|
4645
4643
|
}
|
|
4646
4644
|
}), d();
|
|
4647
|
-
},
|
|
4645
|
+
}, xr = () => Tt("Length exceeded!"), Sr = (e, t, n, i) => {
|
|
4648
4646
|
if (n > t._length)
|
|
4649
|
-
throw
|
|
4647
|
+
throw xr();
|
|
4650
4648
|
if (n === 0)
|
|
4651
4649
|
return t._searchMarker && be(t._searchMarker, n, i.length), Xe(e, t, null, i);
|
|
4652
4650
|
const s = n, r = wn(t, n);
|
|
@@ -4666,7 +4664,7 @@ const mr = (e, t, n) => {
|
|
|
4666
4664
|
for (; s.right; )
|
|
4667
4665
|
s = s.right;
|
|
4668
4666
|
return Xe(e, t, s, n);
|
|
4669
|
-
},
|
|
4667
|
+
}, kr = (e, t, n, i) => {
|
|
4670
4668
|
if (i === 0)
|
|
4671
4669
|
return;
|
|
4672
4670
|
const s = n, r = i, o = wn(t, n);
|
|
@@ -4676,7 +4674,7 @@ const mr = (e, t, n) => {
|
|
|
4676
4674
|
for (; i > 0 && l !== null; )
|
|
4677
4675
|
l.deleted || (i < l.length && G(e, C(l.id.client, l.id.clock + i)), l.delete(e), i -= l.length), l = l.right;
|
|
4678
4676
|
if (i > 0)
|
|
4679
|
-
throw
|
|
4677
|
+
throw xr();
|
|
4680
4678
|
t._searchMarker && be(
|
|
4681
4679
|
t._searchMarker,
|
|
4682
4680
|
s,
|
|
@@ -4725,12 +4723,12 @@ const mr = (e, t, n) => {
|
|
|
4725
4723
|
e.doc ?? W();
|
|
4726
4724
|
const n = e._map.get(t);
|
|
4727
4725
|
return n !== void 0 && !n.deleted ? n.content.getContent()[n.length - 1] : void 0;
|
|
4728
|
-
},
|
|
4726
|
+
}, vr = (e) => {
|
|
4729
4727
|
const t = {};
|
|
4730
4728
|
return e.doc ?? W(), e._map.forEach((n, i) => {
|
|
4731
4729
|
n.deleted || (t[i] = n.content.getContent()[n.length - 1]);
|
|
4732
4730
|
}), t;
|
|
4733
|
-
},
|
|
4731
|
+
}, Cr = (e, t) => {
|
|
4734
4732
|
e.doc ?? W();
|
|
4735
4733
|
const n = e._map.get(t);
|
|
4736
4734
|
return n !== void 0 && !n.deleted;
|
|
@@ -4832,7 +4830,7 @@ class Gt extends F {
|
|
|
4832
4830
|
*/
|
|
4833
4831
|
insert(t, n) {
|
|
4834
4832
|
this.doc !== null ? O(this.doc, (i) => {
|
|
4835
|
-
|
|
4833
|
+
Sr(
|
|
4836
4834
|
i,
|
|
4837
4835
|
this,
|
|
4838
4836
|
t,
|
|
@@ -4874,7 +4872,7 @@ class Gt extends F {
|
|
|
4874
4872
|
*/
|
|
4875
4873
|
delete(t, n = 1) {
|
|
4876
4874
|
this.doc !== null ? O(this.doc, (i) => {
|
|
4877
|
-
|
|
4875
|
+
kr(i, this, t, n);
|
|
4878
4876
|
}) : this._prelimContent.splice(t, n);
|
|
4879
4877
|
}
|
|
4880
4878
|
/**
|
|
@@ -4884,7 +4882,7 @@ class Gt extends F {
|
|
|
4884
4882
|
* @return {T}
|
|
4885
4883
|
*/
|
|
4886
4884
|
get(t) {
|
|
4887
|
-
return
|
|
4885
|
+
return yr(this, t);
|
|
4888
4886
|
}
|
|
4889
4887
|
/**
|
|
4890
4888
|
* Transforms this YArray to a JavaScript Array.
|
|
@@ -4892,7 +4890,7 @@ class Gt extends F {
|
|
|
4892
4890
|
* @return {Array<T>}
|
|
4893
4891
|
*/
|
|
4894
4892
|
toArray() {
|
|
4895
|
-
return
|
|
4893
|
+
return mr(this);
|
|
4896
4894
|
}
|
|
4897
4895
|
/**
|
|
4898
4896
|
* Returns a portion of this YArray into a JavaScript Array selected
|
|
@@ -4903,7 +4901,7 @@ class Gt extends F {
|
|
|
4903
4901
|
* @return {Array<T>}
|
|
4904
4902
|
*/
|
|
4905
4903
|
slice(t = 0, n = this.length) {
|
|
4906
|
-
return
|
|
4904
|
+
return gr(this, t, n);
|
|
4907
4905
|
}
|
|
4908
4906
|
/**
|
|
4909
4907
|
* Transforms this Shared Type to a JSON object.
|
|
@@ -4923,7 +4921,7 @@ class Gt extends F {
|
|
|
4923
4921
|
* callback function
|
|
4924
4922
|
*/
|
|
4925
4923
|
map(t) {
|
|
4926
|
-
return
|
|
4924
|
+
return br(
|
|
4927
4925
|
this,
|
|
4928
4926
|
/** @type {any} */
|
|
4929
4927
|
t
|
|
@@ -5143,7 +5141,7 @@ class Qt extends F {
|
|
|
5143
5141
|
* @return {boolean}
|
|
5144
5142
|
*/
|
|
5145
5143
|
has(t) {
|
|
5146
|
-
return
|
|
5144
|
+
return Cr(this, t);
|
|
5147
5145
|
}
|
|
5148
5146
|
/**
|
|
5149
5147
|
* Removes all elements from this YMap.
|
|
@@ -5192,7 +5190,7 @@ class Yn {
|
|
|
5192
5190
|
this.left = this.right, this.right = this.right.right;
|
|
5193
5191
|
}
|
|
5194
5192
|
}
|
|
5195
|
-
const
|
|
5193
|
+
const rs = (e, t, n) => {
|
|
5196
5194
|
for (; t.right !== null && n > 0; ) {
|
|
5197
5195
|
switch (t.right.content.constructor) {
|
|
5198
5196
|
case V:
|
|
@@ -5213,12 +5211,12 @@ const os = (e, t, n) => {
|
|
|
5213
5211
|
const s = /* @__PURE__ */ new Map(), r = i ? wn(t, n) : null;
|
|
5214
5212
|
if (r) {
|
|
5215
5213
|
const o = new Yn(r.p.left, r.p, r.index, s);
|
|
5216
|
-
return
|
|
5214
|
+
return rs(e, o, n - r.index);
|
|
5217
5215
|
} else {
|
|
5218
5216
|
const o = new Yn(null, t._start, 0, s);
|
|
5219
|
-
return
|
|
5217
|
+
return rs(e, o, n);
|
|
5220
5218
|
}
|
|
5221
|
-
},
|
|
5219
|
+
}, _r = (e, t, n, i) => {
|
|
5222
5220
|
for (; n.right !== null && (n.right.deleted === !0 || n.right.content.constructor === V && Ct(
|
|
5223
5221
|
i.get(
|
|
5224
5222
|
/** @type {ContentFormat} */
|
|
@@ -5239,7 +5237,7 @@ const os = (e, t, n) => {
|
|
|
5239
5237
|
}, se = (e, t) => {
|
|
5240
5238
|
const { key: n, value: i } = t;
|
|
5241
5239
|
i === null ? e.delete(n) : e.set(n, i);
|
|
5242
|
-
},
|
|
5240
|
+
}, Er = (e, t) => {
|
|
5243
5241
|
for (; e.right !== null; ) {
|
|
5244
5242
|
if (!(e.right.deleted || e.right.content.constructor === V && Ct(
|
|
5245
5243
|
t[
|
|
@@ -5251,7 +5249,7 @@ const os = (e, t, n) => {
|
|
|
5251
5249
|
))) break;
|
|
5252
5250
|
e.forward();
|
|
5253
5251
|
}
|
|
5254
|
-
},
|
|
5252
|
+
}, Tr = (e, t, n, i) => {
|
|
5255
5253
|
const s = e.doc, r = s.clientID, o = /* @__PURE__ */ new Map();
|
|
5256
5254
|
for (const l in i) {
|
|
5257
5255
|
const c = i[l], a = n.currentAttributes.get(l) ?? null;
|
|
@@ -5267,17 +5265,17 @@ const os = (e, t, n) => {
|
|
|
5267
5265
|
s[f] === void 0 && (s[f] = null);
|
|
5268
5266
|
});
|
|
5269
5267
|
const r = e.doc, o = r.clientID;
|
|
5270
|
-
|
|
5271
|
-
const l =
|
|
5268
|
+
Er(n, s);
|
|
5269
|
+
const l = Tr(e, t, n, s), c = i.constructor === String ? new dt(
|
|
5272
5270
|
/** @type {string} */
|
|
5273
5271
|
i
|
|
5274
5272
|
) : i instanceof F ? new ut(i) : new zt(i);
|
|
5275
5273
|
let { left: a, right: d, index: h } = n;
|
|
5276
|
-
t._searchMarker && be(t._searchMarker, n.index, c.getLength()), d = new A(C(o, B(r.store, o)), a, a && a.lastId, d, d && d.id, t, null, c), d.integrate(e, 0), n.right = d, n.index = h, n.forward(),
|
|
5277
|
-
},
|
|
5274
|
+
t._searchMarker && be(t._searchMarker, n.index, c.getLength()), d = new A(C(o, B(r.store, o)), a, a && a.lastId, d, d && d.id, t, null, c), d.integrate(e, 0), n.right = d, n.index = h, n.forward(), _r(e, t, n, l);
|
|
5275
|
+
}, os = (e, t, n, i, s) => {
|
|
5278
5276
|
const r = e.doc, o = r.clientID;
|
|
5279
|
-
|
|
5280
|
-
const l =
|
|
5277
|
+
Er(n, s);
|
|
5278
|
+
const l = Tr(e, t, n, s);
|
|
5281
5279
|
t: for (; n.right !== null && (i > 0 || l.size > 0 && (n.right.deleted || n.right.content.constructor === V)); ) {
|
|
5282
5280
|
if (!n.right.deleted)
|
|
5283
5281
|
switch (n.right.content.constructor) {
|
|
@@ -5312,8 +5310,8 @@ const os = (e, t, n) => {
|
|
|
5312
5310
|
`;
|
|
5313
5311
|
n.right = new A(C(o, B(r.store, o)), n.left, n.left && n.left.lastId, n.right, n.right && n.right.id, t, null, new dt(c)), n.right.integrate(e, 0), n.forward();
|
|
5314
5312
|
}
|
|
5315
|
-
|
|
5316
|
-
},
|
|
5313
|
+
_r(e, t, n, l);
|
|
5314
|
+
}, Dr = (e, t, n, i, s) => {
|
|
5317
5315
|
let r = t;
|
|
5318
5316
|
const o = ct();
|
|
5319
5317
|
for (; r && (!r.countable || r.deleted); ) {
|
|
@@ -5385,7 +5383,7 @@ const os = (e, t, n) => {
|
|
|
5385
5383
|
);
|
|
5386
5384
|
break;
|
|
5387
5385
|
default:
|
|
5388
|
-
t +=
|
|
5386
|
+
t += Dr(n, i, s, r, o), r = Ln(o), i = s;
|
|
5389
5387
|
break;
|
|
5390
5388
|
}
|
|
5391
5389
|
s = s.right;
|
|
@@ -5396,7 +5394,7 @@ const os = (e, t, n) => {
|
|
|
5396
5394
|
const t = /* @__PURE__ */ new Set(), n = e.doc;
|
|
5397
5395
|
for (const [i, s] of e.afterState.entries()) {
|
|
5398
5396
|
const r = e.beforeState.get(i) || 0;
|
|
5399
|
-
s !== r &&
|
|
5397
|
+
s !== r && ar(
|
|
5400
5398
|
e,
|
|
5401
5399
|
/** @type {Array<Item|GC>} */
|
|
5402
5400
|
n.store.clients.get(i),
|
|
@@ -5428,7 +5426,7 @@ const os = (e, t, n) => {
|
|
|
5428
5426
|
for (const s of t)
|
|
5429
5427
|
Sa(s);
|
|
5430
5428
|
});
|
|
5431
|
-
},
|
|
5429
|
+
}, ls = (e, t, n) => {
|
|
5432
5430
|
const i = n, s = Ln(t.currentAttributes), r = t.right;
|
|
5433
5431
|
for (; n > 0 && t.right !== null; ) {
|
|
5434
5432
|
if (t.right.deleted === !1)
|
|
@@ -5441,7 +5439,7 @@ const os = (e, t, n) => {
|
|
|
5441
5439
|
}
|
|
5442
5440
|
t.forward();
|
|
5443
5441
|
}
|
|
5444
|
-
r &&
|
|
5442
|
+
r && Dr(e, r, t.right, s, t.currentAttributes);
|
|
5445
5443
|
const o = (
|
|
5446
5444
|
/** @type {AbstractType<any>} */
|
|
5447
5445
|
/** @type {Item} */
|
|
@@ -5664,7 +5662,7 @@ class It extends F {
|
|
|
5664
5662
|
const l = !n && typeof o.insert == "string" && r === t.length - 1 && s.right === null && o.insert.slice(-1) === `
|
|
5665
5663
|
` ? o.insert.slice(0, -1) : o.insert;
|
|
5666
5664
|
(typeof l != "string" || l.length > 0) && Mn(i, this, s, l, o.attributes || {});
|
|
5667
|
-
} else o.retain !== void 0 ?
|
|
5665
|
+
} else o.retain !== void 0 ? os(i, this, s, o.retain, o.attributes || {}) : o.delete !== void 0 && ls(i, s, o.delete);
|
|
5668
5666
|
}
|
|
5669
5667
|
}) : this._pending.push(() => this.applyDelta(t));
|
|
5670
5668
|
}
|
|
@@ -5791,7 +5789,7 @@ class It extends F {
|
|
|
5791
5789
|
return;
|
|
5792
5790
|
const i = this.doc;
|
|
5793
5791
|
i !== null ? O(i, (s) => {
|
|
5794
|
-
|
|
5792
|
+
ls(s, Ue(s, this, t, !0), n);
|
|
5795
5793
|
}) : this._pending.push(() => this.delete(t, n));
|
|
5796
5794
|
}
|
|
5797
5795
|
/**
|
|
@@ -5810,7 +5808,7 @@ class It extends F {
|
|
|
5810
5808
|
const s = this.doc;
|
|
5811
5809
|
s !== null ? O(s, (r) => {
|
|
5812
5810
|
const o = Ue(r, this, t, !1);
|
|
5813
|
-
o.right !== null &&
|
|
5811
|
+
o.right !== null && os(r, this, o, n, i);
|
|
5814
5812
|
}) : this._pending.push(() => this.format(t, n, i));
|
|
5815
5813
|
}
|
|
5816
5814
|
/**
|
|
@@ -5869,7 +5867,7 @@ class It extends F {
|
|
|
5869
5867
|
* @public
|
|
5870
5868
|
*/
|
|
5871
5869
|
getAttributes() {
|
|
5872
|
-
return
|
|
5870
|
+
return vr(this);
|
|
5873
5871
|
}
|
|
5874
5872
|
/**
|
|
5875
5873
|
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
|
|
@@ -6039,7 +6037,7 @@ class Ht extends F {
|
|
|
6039
6037
|
* @return {string} The string representation of all children.
|
|
6040
6038
|
*/
|
|
6041
6039
|
toString() {
|
|
6042
|
-
return
|
|
6040
|
+
return br(this, (t) => t.toString()).join("");
|
|
6043
6041
|
}
|
|
6044
6042
|
/**
|
|
6045
6043
|
* @return {string}
|
|
@@ -6080,7 +6078,7 @@ class Ht extends F {
|
|
|
6080
6078
|
*/
|
|
6081
6079
|
insert(t, n) {
|
|
6082
6080
|
this.doc !== null ? O(this.doc, (i) => {
|
|
6083
|
-
|
|
6081
|
+
Sr(i, this, t, n);
|
|
6084
6082
|
}) : this._prelimContent.splice(t, 0, ...n);
|
|
6085
6083
|
}
|
|
6086
6084
|
/**
|
|
@@ -6117,7 +6115,7 @@ class Ht extends F {
|
|
|
6117
6115
|
*/
|
|
6118
6116
|
delete(t, n = 1) {
|
|
6119
6117
|
this.doc !== null ? O(this.doc, (i) => {
|
|
6120
|
-
|
|
6118
|
+
kr(i, this, t, n);
|
|
6121
6119
|
}) : this._prelimContent.splice(t, n);
|
|
6122
6120
|
}
|
|
6123
6121
|
/**
|
|
@@ -6126,7 +6124,7 @@ class Ht extends F {
|
|
|
6126
6124
|
* @return {Array<YXmlElement|YXmlText|YXmlHook>}
|
|
6127
6125
|
*/
|
|
6128
6126
|
toArray() {
|
|
6129
|
-
return
|
|
6127
|
+
return mr(this);
|
|
6130
6128
|
}
|
|
6131
6129
|
/**
|
|
6132
6130
|
* Appends content to this YArray.
|
|
@@ -6151,7 +6149,7 @@ class Ht extends F {
|
|
|
6151
6149
|
* @return {YXmlElement|YXmlText}
|
|
6152
6150
|
*/
|
|
6153
6151
|
get(t) {
|
|
6154
|
-
return
|
|
6152
|
+
return yr(this, t);
|
|
6155
6153
|
}
|
|
6156
6154
|
/**
|
|
6157
6155
|
* Returns a portion of this YXmlFragment into a JavaScript Array selected
|
|
@@ -6162,7 +6160,7 @@ class Ht extends F {
|
|
|
6162
6160
|
* @return {Array<YXmlElement|YXmlText>}
|
|
6163
6161
|
*/
|
|
6164
6162
|
slice(t = 0, n = this.length) {
|
|
6165
|
-
return
|
|
6163
|
+
return gr(this, t, n);
|
|
6166
6164
|
}
|
|
6167
6165
|
/**
|
|
6168
6166
|
* Executes a provided function on once on every child element.
|
|
@@ -6245,7 +6243,11 @@ class K extends Ht {
|
|
|
6245
6243
|
clone() {
|
|
6246
6244
|
const t = new K(this.nodeName), n = this.getAttributes();
|
|
6247
6245
|
return lc(n, (i, s) => {
|
|
6248
|
-
|
|
6246
|
+
t.setAttribute(
|
|
6247
|
+
s,
|
|
6248
|
+
/** @type {any} */
|
|
6249
|
+
i
|
|
6250
|
+
);
|
|
6249
6251
|
}), t.insert(0, this.toArray().map((i) => i instanceof F ? i.clone() : i)), t;
|
|
6250
6252
|
}
|
|
6251
6253
|
/**
|
|
@@ -6325,7 +6327,7 @@ class K extends Ht {
|
|
|
6325
6327
|
hasAttribute(t) {
|
|
6326
6328
|
return (
|
|
6327
6329
|
/** @type {any} */
|
|
6328
|
-
|
|
6330
|
+
Cr(this, t)
|
|
6329
6331
|
);
|
|
6330
6332
|
}
|
|
6331
6333
|
/**
|
|
@@ -6339,7 +6341,7 @@ class K extends Ht {
|
|
|
6339
6341
|
getAttributes(t) {
|
|
6340
6342
|
return (
|
|
6341
6343
|
/** @type {any} */
|
|
6342
|
-
t ? ga(this, t) :
|
|
6344
|
+
t ? ga(this, t) : vr(this)
|
|
6343
6345
|
);
|
|
6344
6346
|
}
|
|
6345
6347
|
/**
|
|
@@ -6608,7 +6610,7 @@ class it extends yi {
|
|
|
6608
6610
|
* @param {number} offset
|
|
6609
6611
|
*/
|
|
6610
6612
|
integrate(t, n) {
|
|
6611
|
-
n > 0 && (this.id.clock += n, this.length -= n),
|
|
6613
|
+
n > 0 && (this.id.clock += n, this.length -= n), cr(t.doc.store, this);
|
|
6612
6614
|
}
|
|
6613
6615
|
/**
|
|
6614
6616
|
* @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
|
|
@@ -6779,7 +6781,7 @@ class xe {
|
|
|
6779
6781
|
return 1;
|
|
6780
6782
|
}
|
|
6781
6783
|
}
|
|
6782
|
-
const Ma = (e) => new xe(e.readLen()),
|
|
6784
|
+
const Ma = (e) => new xe(e.readLen()), Ir = (e, t) => new Ft({ guid: e, ...t, shouldLoad: t.shouldLoad || t.autoLoad || !1 });
|
|
6783
6785
|
class Ie {
|
|
6784
6786
|
/**
|
|
6785
6787
|
* @param {Doc} doc
|
|
@@ -6811,7 +6813,7 @@ class Ie {
|
|
|
6811
6813
|
* @return {ContentDoc}
|
|
6812
6814
|
*/
|
|
6813
6815
|
copy() {
|
|
6814
|
-
return new Ie(
|
|
6816
|
+
return new Ie(Ir(this.doc.guid, this.opts));
|
|
6815
6817
|
}
|
|
6816
6818
|
/**
|
|
6817
6819
|
* @param {number} offset
|
|
@@ -6859,7 +6861,7 @@ class Ie {
|
|
|
6859
6861
|
return 9;
|
|
6860
6862
|
}
|
|
6861
6863
|
}
|
|
6862
|
-
const Ra = (e) => new Ie(
|
|
6864
|
+
const Ra = (e) => new Ie(Ir(e.readString(), e.readAny()));
|
|
6863
6865
|
class zt {
|
|
6864
6866
|
/**
|
|
6865
6867
|
* @param {Object} embed
|
|
@@ -7112,7 +7114,7 @@ class $t {
|
|
|
7112
7114
|
* @param {Array<any>} arr
|
|
7113
7115
|
*/
|
|
7114
7116
|
constructor(t) {
|
|
7115
|
-
this.arr = t, Pa &&
|
|
7117
|
+
this.arr = t, Pa && Ws(t);
|
|
7116
7118
|
}
|
|
7117
7119
|
/**
|
|
7118
7120
|
* @return {number}
|
|
@@ -7398,11 +7400,11 @@ const Ga = (e) => new ut(Ha[e.readTypeRef()](e)), Gn = (e, t) => {
|
|
|
7398
7400
|
t.content.splice(n)
|
|
7399
7401
|
);
|
|
7400
7402
|
return t.deleted && r.markDeleted(), t.keep && (r.keep = !0), t.redone !== null && (r.redone = C(t.redone.client, t.redone.clock + n)), t.right = r, r.right !== null && (r.right.left = r), e._mergeStructs.push(r), r.parentSub !== null && r.right === null && r.parent._map.set(r.parentSub, r), t.length = n, r;
|
|
7401
|
-
},
|
|
7403
|
+
}, cs = (e, t) => yl(
|
|
7402
7404
|
e,
|
|
7403
7405
|
/** @param {StackItem} s */
|
|
7404
7406
|
(n) => ie(n.deletions, t)
|
|
7405
|
-
),
|
|
7407
|
+
), Ar = (e, t, n, i, s, r) => {
|
|
7406
7408
|
const o = e.doc, l = o.store, c = o.clientID, a = t.redone;
|
|
7407
7409
|
if (a !== null)
|
|
7408
7410
|
return G(e, a);
|
|
@@ -7411,7 +7413,7 @@ const Ga = (e) => new ut(Ha[e.readTypeRef()](e)), Gn = (e, t) => {
|
|
|
7411
7413
|
t.parent._item
|
|
7412
7414
|
), h = null, u;
|
|
7413
7415
|
if (d !== null && d.deleted === !0) {
|
|
7414
|
-
if (d.redone === null && (!n.has(d) ||
|
|
7416
|
+
if (d.redone === null && (!n.has(d) || Ar(e, d, n, i, s, r) === null))
|
|
7415
7417
|
return null;
|
|
7416
7418
|
for (; d.redone !== null; )
|
|
7417
7419
|
d = G(e, d.redone);
|
|
@@ -7449,7 +7451,7 @@ const Ga = (e) => new ut(Ha[e.readTypeRef()](e)), Gn = (e, t) => {
|
|
|
7449
7451
|
u = u.right;
|
|
7450
7452
|
}
|
|
7451
7453
|
} else if (u = null, t.right && !s) {
|
|
7452
|
-
for (h = t; h !== null && h.right !== null && (h.right.redone || ie(i, h.right.id) ||
|
|
7454
|
+
for (h = t; h !== null && h.right !== null && (h.right.redone || ie(i, h.right.id) || cs(r.undoStack, h.right.id) || cs(r.redoStack, h.right.id)); )
|
|
7453
7455
|
for (h = h.right; h.redone; ) h = G(e, h.redone);
|
|
7454
7456
|
if (h && h.right !== null)
|
|
7455
7457
|
return null;
|
|
@@ -7479,7 +7481,7 @@ class A extends yi {
|
|
|
7479
7481
|
* @param {AbstractContent} content
|
|
7480
7482
|
*/
|
|
7481
7483
|
constructor(t, n, i, s, r, o, l, c) {
|
|
7482
|
-
super(t, c.getLength()), this.origin = i, this.left = n, this.right = s, this.rightOrigin = r, this.parent = o, this.parentSub = l, this.redone = null, this.content = c, this.info = this.content.isCountable() ?
|
|
7484
|
+
super(t, c.getLength()), this.origin = i, this.left = n, this.right = s, this.rightOrigin = r, this.parent = o, this.parentSub = l, this.redone = null, this.content = c, this.info = this.content.isCountable() ? Bi : 0;
|
|
7483
7485
|
}
|
|
7484
7486
|
/**
|
|
7485
7487
|
* This is used to mark the item as an indexed fast-search marker
|
|
@@ -7496,13 +7498,13 @@ class A extends yi {
|
|
|
7496
7498
|
* If true, do not garbage collect this Item.
|
|
7497
7499
|
*/
|
|
7498
7500
|
get keep() {
|
|
7499
|
-
return (this.info &
|
|
7501
|
+
return (this.info & Pi) > 0;
|
|
7500
7502
|
}
|
|
7501
7503
|
set keep(t) {
|
|
7502
|
-
this.keep !== t && (this.info ^=
|
|
7504
|
+
this.keep !== t && (this.info ^= Pi);
|
|
7503
7505
|
}
|
|
7504
7506
|
get countable() {
|
|
7505
|
-
return (this.info &
|
|
7507
|
+
return (this.info & Bi) > 0;
|
|
7506
7508
|
}
|
|
7507
7509
|
/**
|
|
7508
7510
|
* Whether this item was deleted or not.
|
|
@@ -7531,7 +7533,7 @@ class A extends yi {
|
|
|
7531
7533
|
return this.rightOrigin.client;
|
|
7532
7534
|
if (this.parent && this.parent.constructor === jt && this.id.client !== this.parent.client && this.parent.clock >= B(n, this.parent.client))
|
|
7533
7535
|
return this.parent.client;
|
|
7534
|
-
if (this.origin && (this.left =
|
|
7536
|
+
if (this.origin && (this.left = Zi(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = G(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === it || this.right && this.right.constructor === it)
|
|
7535
7537
|
this.parent = null;
|
|
7536
7538
|
else if (!this.parent)
|
|
7537
7539
|
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);
|
|
@@ -7547,7 +7549,7 @@ class A extends yi {
|
|
|
7547
7549
|
* @param {number} offset
|
|
7548
7550
|
*/
|
|
7549
7551
|
integrate(t, n) {
|
|
7550
|
-
if (n > 0 && (this.id.clock += n, this.left =
|
|
7552
|
+
if (n > 0 && (this.id.clock += n, this.left = Zi(t, t.doc.store, C(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(n), this.length -= n), this.parent) {
|
|
7551
7553
|
if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
|
|
7552
7554
|
let i = this.left, s;
|
|
7553
7555
|
if (i !== null)
|
|
@@ -7588,7 +7590,7 @@ class A extends yi {
|
|
|
7588
7590
|
this.parent._start, this.parent._start = this;
|
|
7589
7591
|
this.right = i;
|
|
7590
7592
|
}
|
|
7591
|
-
this.right !== null ? this.right.left = this : this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(t)), this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length),
|
|
7593
|
+
this.right !== null ? this.right.left = this : this.parentSub !== null && (this.parent._map.set(this.parentSub, this), this.left !== null && this.left.delete(t)), this.parentSub === null && this.countable && !this.deleted && (this.parent._length += this.length), cr(t.doc.store, this), this.content.integrate(t, this), ts(
|
|
7592
7594
|
t,
|
|
7593
7595
|
/** @type {AbstractType<any>} */
|
|
7594
7596
|
this.parent,
|
|
@@ -7652,7 +7654,7 @@ class A extends yi {
|
|
|
7652
7654
|
/** @type {AbstractType<any>} */
|
|
7653
7655
|
this.parent
|
|
7654
7656
|
);
|
|
7655
|
-
this.countable && this.parentSub === null && (n._length -= this.length), this.markDeleted(), ge(t.deleteSet, this.id.client, this.id.clock, this.length),
|
|
7657
|
+
this.countable && this.parentSub === null && (n._length -= this.length), this.markDeleted(), ge(t.deleteSet, this.id.client, this.id.clock, this.length), ts(t, n, this.parentSub), this.content.delete(t);
|
|
7656
7658
|
}
|
|
7657
7659
|
}
|
|
7658
7660
|
/**
|
|
@@ -7695,7 +7697,7 @@ class A extends yi {
|
|
|
7695
7697
|
this.content.write(t, n);
|
|
7696
7698
|
}
|
|
7697
7699
|
}
|
|
7698
|
-
const
|
|
7700
|
+
const Or = (e, t) => Ja[t & dn](e), Ja = [
|
|
7699
7701
|
() => {
|
|
7700
7702
|
q();
|
|
7701
7703
|
},
|
|
@@ -7759,12 +7761,12 @@ class ot extends yi {
|
|
|
7759
7761
|
return null;
|
|
7760
7762
|
}
|
|
7761
7763
|
}
|
|
7762
|
-
const
|
|
7764
|
+
const Mr = (
|
|
7763
7765
|
/** @type {any} */
|
|
7764
7766
|
typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : {}
|
|
7765
|
-
),
|
|
7766
|
-
Rr
|
|
7767
|
-
Rr
|
|
7767
|
+
), Rr = "__ $YJS$ __";
|
|
7768
|
+
Mr[Rr] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");
|
|
7769
|
+
Mr[Rr] = !0;
|
|
7768
7770
|
const Xa = () => {
|
|
7769
7771
|
let e = !0;
|
|
7770
7772
|
return (t, n) => {
|
|
@@ -7937,7 +7939,7 @@ t.sv.get(e.id.client) > e.id.clock && !ie(t.ds, e.id), uh = [{ light: "#ecd44433
|
|
|
7937
7939
|
mapping: r
|
|
7938
7940
|
} = {}) => {
|
|
7939
7941
|
let o = !1;
|
|
7940
|
-
const l = new wh(e, r), c = new
|
|
7942
|
+
const l = new wh(e, r), c = new bs({
|
|
7941
7943
|
props: {
|
|
7942
7944
|
editable: (a) => {
|
|
7943
7945
|
const d = U.getState(a);
|
|
@@ -7969,7 +7971,7 @@ t.sv.get(e.id.client) > e.id.clock && !ie(t.ds, e.id), uh = [{ light: "#ecd44433
|
|
|
7969
7971
|
for (const u in h)
|
|
7970
7972
|
d[u] = h[u];
|
|
7971
7973
|
}
|
|
7972
|
-
return d.addToHistory = a.getMeta("addToHistory") !== !1, d.isChangeOrigin = h !== void 0 && !!h.isChangeOrigin, d.isUndoRedoOperation = h !== void 0 && !!h.isChangeOrigin && !!h.isUndoRedoOperation, l.prosemirrorView !== null && h !== void 0 && (h.snapshot != null || h.prevSnapshot != null) &&
|
|
7974
|
+
return d.addToHistory = a.getMeta("addToHistory") !== !1, d.isChangeOrigin = h !== void 0 && !!h.isChangeOrigin, d.isUndoRedoOperation = h !== void 0 && !!h.isChangeOrigin && !!h.isUndoRedoOperation, l.prosemirrorView !== null && h !== void 0 && (h.snapshot != null || h.prevSnapshot != null) && Gs(0, () => {
|
|
7973
7975
|
l.prosemirrorView != null && (h.restore == null ? l._renderSnapshot(
|
|
7974
7976
|
h.snapshot,
|
|
7975
7977
|
h.prevSnapshot,
|
|
@@ -8015,7 +8017,7 @@ t.sv.get(e.id.client) > e.id.clock && !ie(t.ds, e.id), uh = [{ light: "#ecd44433
|
|
|
8015
8017
|
}, gh = (e, t, n) => {
|
|
8016
8018
|
if (t !== null && t.anchor !== null && t.head !== null)
|
|
8017
8019
|
if (t.type === "all")
|
|
8018
|
-
e.setSelection(new
|
|
8020
|
+
e.setSelection(new qr(e.doc));
|
|
8019
8021
|
else if (t.type === "node") {
|
|
8020
8022
|
const i = de(
|
|
8021
8023
|
n.doc,
|
|
@@ -8040,7 +8042,7 @@ t.sv.get(e.id.client) > e.id.clock && !ie(t.ds, e.id), uh = [{ light: "#ecd44433
|
|
|
8040
8042
|
}
|
|
8041
8043
|
}, mh = (e, t) => {
|
|
8042
8044
|
const n = e.doc.resolve(t);
|
|
8043
|
-
return n.nodeAfter ?
|
|
8045
|
+
return n.nodeAfter ? Xr.create(e.doc, t) : ni.near(n);
|
|
8044
8046
|
}, Jn = (e, t) => ({
|
|
8045
8047
|
type: (
|
|
8046
8048
|
/** @type {any} */
|
|
@@ -8081,7 +8083,7 @@ class wh {
|
|
|
8081
8083
|
return this.prosemirrorView.state.tr.setMeta("addToHistory", !1);
|
|
8082
8084
|
}
|
|
8083
8085
|
_isLocalCursorInView() {
|
|
8084
|
-
return this.prosemirrorView.hasFocus() ? (
|
|
8086
|
+
return this.prosemirrorView.hasFocus() ? (js && this._domSelectionInView === null && (Gs(0, () => {
|
|
8085
8087
|
this._domSelectionInView = null;
|
|
8086
8088
|
}), this._domSelectionInView = this._isDomSelectionInView()), this._domSelectionInView) : !1;
|
|
8087
8089
|
}
|
|
@@ -8098,7 +8100,7 @@ class wh {
|
|
|
8098
8100
|
* @param {Y.Snapshot} prevSnapshot
|
|
8099
8101
|
*/
|
|
8100
8102
|
renderSnapshot(t, n) {
|
|
8101
|
-
n || (n =
|
|
8103
|
+
n || (n = or(nr(), /* @__PURE__ */ new Map())), this.prosemirrorView.dispatch(
|
|
8102
8104
|
this._tr.setMeta(U, { snapshot: t, prevSnapshot: n })
|
|
8103
8105
|
);
|
|
8104
8106
|
}
|
|
@@ -8183,7 +8185,7 @@ class wh {
|
|
|
8183
8185
|
f
|
|
8184
8186
|
)
|
|
8185
8187
|
};
|
|
8186
|
-
}, a =
|
|
8188
|
+
}, a = wr(
|
|
8187
8189
|
r,
|
|
8188
8190
|
new gi(n.ds, t.sv)
|
|
8189
8191
|
).map((h) => !h._item.deleted || nn(h._item, t) || nn(h._item, n) ? ze(
|
|
@@ -8232,7 +8234,7 @@ class wh {
|
|
|
8232
8234
|
}
|
|
8233
8235
|
), n.changed.forEach(s), n.changedParentTypes.forEach(s);
|
|
8234
8236
|
const r = this.type.toArray().map(
|
|
8235
|
-
(l) =>
|
|
8237
|
+
(l) => Nr(
|
|
8236
8238
|
/** @type {Y.XmlElement | Y.XmlHook} */
|
|
8237
8239
|
l,
|
|
8238
8240
|
this.prosemirrorView.state.schema,
|
|
@@ -8244,7 +8246,7 @@ class wh {
|
|
|
8244
8246
|
this.prosemirrorView.state.doc.content.size,
|
|
8245
8247
|
new Ae(Oe.from(r), 0, 0)
|
|
8246
8248
|
);
|
|
8247
|
-
gh(o, this.beforeTransactionSelection, this), o = o.setMeta(U, { isChangeOrigin: !0, isUndoRedoOperation: n.origin instanceof
|
|
8249
|
+
gh(o, this.beforeTransactionSelection, this), o = o.setMeta(U, { isChangeOrigin: !0, isUndoRedoOperation: n.origin instanceof dr }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && o.scrollIntoView(), this.prosemirrorView.dispatch(o);
|
|
8248
8250
|
});
|
|
8249
8251
|
}
|
|
8250
8252
|
/**
|
|
@@ -8269,7 +8271,7 @@ class wh {
|
|
|
8269
8271
|
this.prosemirrorView != null && (this.prosemirrorView = null, this.type.unobserveDeep(this._observeFunction), this.doc.off("beforeAllTransactions", this.beforeAllTransactions), this.doc.off("afterAllTransactions", this.afterAllTransactions));
|
|
8270
8272
|
}
|
|
8271
8273
|
}
|
|
8272
|
-
const
|
|
8274
|
+
const Nr = (e, t, n, i, s, r) => {
|
|
8273
8275
|
const o = (
|
|
8274
8276
|
/** @type {PModel.Node} */
|
|
8275
8277
|
n.mapping.get(e)
|
|
@@ -8291,7 +8293,7 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8291
8293
|
const o = [], l = (c) => {
|
|
8292
8294
|
var a, d;
|
|
8293
8295
|
if (c instanceof K) {
|
|
8294
|
-
const h =
|
|
8296
|
+
const h = Nr(
|
|
8295
8297
|
c,
|
|
8296
8298
|
t,
|
|
8297
8299
|
n,
|
|
@@ -8324,7 +8326,7 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8324
8326
|
});
|
|
8325
8327
|
}
|
|
8326
8328
|
};
|
|
8327
|
-
i === void 0 || s === void 0 ? e.toArray().forEach(l) :
|
|
8329
|
+
i === void 0 || s === void 0 ? e.toArray().forEach(l) : wr(e, new gi(s.ds, i.sv)).forEach(l);
|
|
8328
8330
|
try {
|
|
8329
8331
|
const c = e.getAttributes(i);
|
|
8330
8332
|
i !== void 0 && (nn(
|
|
@@ -8368,7 +8370,7 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8368
8370
|
const n = new J(), i = e.map((s) => ({
|
|
8369
8371
|
// @ts-ignore
|
|
8370
8372
|
insert: s.text,
|
|
8371
|
-
attributes:
|
|
8373
|
+
attributes: Lr(s.marks, t)
|
|
8372
8374
|
}));
|
|
8373
8375
|
return n.applyDelta(i), t.mapping.set(n, e), n;
|
|
8374
8376
|
}, xh = (e, t) => {
|
|
@@ -8383,12 +8385,12 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8383
8385
|
(i) => qn(i, t)
|
|
8384
8386
|
)
|
|
8385
8387
|
), t.mapping.set(n, e), n;
|
|
8386
|
-
}, qn = (e, t) => e instanceof Array ? yh(e, t) : xh(e, t),
|
|
8388
|
+
}, qn = (e, t) => e instanceof Array ? yh(e, t) : xh(e, t), as = (e) => typeof e == "object" && e !== null, Si = (e, t) => {
|
|
8387
8389
|
const n = Object.keys(e).filter((s) => e[s] !== null);
|
|
8388
8390
|
let i = n.length === Object.keys(t).filter((s) => t[s] !== null).length;
|
|
8389
8391
|
for (let s = 0; s < n.length && i; s++) {
|
|
8390
8392
|
const r = n[s], o = e[r], l = t[r];
|
|
8391
|
-
i = r === "ychange" || o === l ||
|
|
8393
|
+
i = r === "ychange" || o === l || as(o) && as(l) && Si(o, l);
|
|
8392
8394
|
}
|
|
8393
8395
|
return i;
|
|
8394
8396
|
}, yn = (e) => {
|
|
@@ -8404,12 +8406,12 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8404
8406
|
n.push(s);
|
|
8405
8407
|
}
|
|
8406
8408
|
return n;
|
|
8407
|
-
},
|
|
8409
|
+
}, Ur = (e, t) => {
|
|
8408
8410
|
const n = e.toDelta();
|
|
8409
8411
|
return n.length === t.length && n.every(
|
|
8410
8412
|
/** @type {(d:any,i:number) => boolean} */
|
|
8411
8413
|
(i, s) => i.insert === /** @type {any} */
|
|
8412
|
-
t[s].text &&
|
|
8414
|
+
t[s].text && zs(i.attributes || {}).length === t[s].marks.length && Ks(i.attributes, (r, o) => {
|
|
8413
8415
|
var d;
|
|
8414
8416
|
const l = ki(o), c = t[s].marks;
|
|
8415
8417
|
return c.find(
|
|
@@ -8428,10 +8430,10 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8428
8430
|
(i, s) => Se(i, n[s])
|
|
8429
8431
|
);
|
|
8430
8432
|
}
|
|
8431
|
-
return e instanceof J && t instanceof Array &&
|
|
8433
|
+
return e instanceof J && t instanceof Array && Ur(e, t);
|
|
8432
8434
|
}, sn = (e, t) => e === t || e instanceof Array && t instanceof Array && e.length === t.length && e.every(
|
|
8433
8435
|
(n, i) => t[i] === n
|
|
8434
|
-
),
|
|
8436
|
+
), hs = (e, t, n) => {
|
|
8435
8437
|
const i = e.toArray(), s = yn(t), r = s.length, o = i.length, l = qt(o, r);
|
|
8436
8438
|
let c = 0, a = 0, d = !1;
|
|
8437
8439
|
for (; c < l; c++) {
|
|
@@ -8468,7 +8470,7 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8468
8470
|
/** @type {any} */
|
|
8469
8471
|
a.text
|
|
8470
8472
|
),
|
|
8471
|
-
attributes: Object.assign({}, i,
|
|
8473
|
+
attributes: Object.assign({}, i, Lr(a.marks, n))
|
|
8472
8474
|
})), { insert: o, remove: l, index: c } = eh(
|
|
8473
8475
|
s,
|
|
8474
8476
|
r.map((a) => a.insert).join("")
|
|
@@ -8484,7 +8486,7 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8484
8486
|
for (const i in e)
|
|
8485
8487
|
n.push(t.mark(ki(i), e[i]));
|
|
8486
8488
|
return n;
|
|
8487
|
-
},
|
|
8489
|
+
}, Lr = (e, t) => {
|
|
8488
8490
|
const n = {};
|
|
8489
8491
|
return e.forEach((i) => {
|
|
8490
8492
|
if (i.type.name !== "ychange") {
|
|
@@ -8524,17 +8526,17 @@ const Ur = (e, t, n, i, s, r) => {
|
|
|
8524
8526
|
for (; l - a - d > 0 && r - a - d > 0; ) {
|
|
8525
8527
|
const u = o[a], f = s[a], g = o[l - d - 1], m = s[r - d - 1];
|
|
8526
8528
|
if (u instanceof J && f instanceof Array)
|
|
8527
|
-
|
|
8529
|
+
Ur(u, f) || kh(u, f, i), a += 1;
|
|
8528
8530
|
else {
|
|
8529
8531
|
let b = u instanceof K && Zn(u, f), w = g instanceof K && Zn(g, m);
|
|
8530
8532
|
if (b && w) {
|
|
8531
|
-
const D =
|
|
8533
|
+
const D = hs(
|
|
8532
8534
|
/** @type {Y.XmlElement} */
|
|
8533
8535
|
u,
|
|
8534
8536
|
/** @type {PModel.Node} */
|
|
8535
8537
|
f,
|
|
8536
8538
|
i
|
|
8537
|
-
), I =
|
|
8539
|
+
), I = hs(
|
|
8538
8540
|
/** @type {Y.XmlElement} */
|
|
8539
8541
|
g,
|
|
8540
8542
|
/** @type {PModel.Node} */
|
|
@@ -8723,11 +8725,11 @@ const Th = (e) => {
|
|
|
8723
8725
|
const t = yt.getState(e).undoManager;
|
|
8724
8726
|
if (t != null)
|
|
8725
8727
|
return t.redo(), !0;
|
|
8726
|
-
}, Ih = /* @__PURE__ */ new Set(["paragraph"]), Ah = (e, t) => !(e instanceof A) || !(e.content instanceof ut) || !(e.content.type instanceof It || e.content.type instanceof K && t.has(e.content.type.nodeName)) || e.content.type._length === 0, Oh = ({ protectedNodes: e = Ih, trackedOrigins: t = [], undoManager: n = null } = {}) => new
|
|
8728
|
+
}, Ih = /* @__PURE__ */ new Set(["paragraph"]), Ah = (e, t) => !(e instanceof A) || !(e.content instanceof ut) || !(e.content.type instanceof It || e.content.type instanceof K && t.has(e.content.type.nodeName)) || e.content.type._length === 0, Oh = ({ protectedNodes: e = Ih, trackedOrigins: t = [], undoManager: n = null } = {}) => new bs({
|
|
8727
8729
|
key: yt,
|
|
8728
8730
|
state: {
|
|
8729
8731
|
init: (i, s) => {
|
|
8730
|
-
const r = U.getState(s), o = n || new
|
|
8732
|
+
const r = U.getState(s), o = n || new dr(r.type, {
|
|
8731
8733
|
trackedOrigins: new Set([U].concat(t)),
|
|
8732
8734
|
deleteFilter: (l) => Ah(l, e),
|
|
8733
8735
|
captureTransaction: (l) => l.meta.get("addToHistory") !== !1
|
|
@@ -8770,18 +8772,18 @@ const Th = (e) => {
|
|
|
8770
8772
|
};
|
|
8771
8773
|
}
|
|
8772
8774
|
});
|
|
8773
|
-
function
|
|
8775
|
+
function Pr(e) {
|
|
8774
8776
|
return !!e.getMeta(U);
|
|
8775
8777
|
}
|
|
8776
8778
|
function Mh(e, t) {
|
|
8777
8779
|
const n = U.getState(e);
|
|
8778
8780
|
return de(n.doc, n.type, t, n.binding.mapping) || 0;
|
|
8779
8781
|
}
|
|
8780
|
-
function
|
|
8782
|
+
function Br(e, t) {
|
|
8781
8783
|
const n = U.getState(e);
|
|
8782
8784
|
return rn(t, n.type, n.binding.mapping);
|
|
8783
8785
|
}
|
|
8784
|
-
var Ke = class
|
|
8786
|
+
var Ke = class Vr extends Qr {
|
|
8785
8787
|
constructor(t, n) {
|
|
8786
8788
|
super(t), this.yRelativePosition = n;
|
|
8787
8789
|
}
|
|
@@ -8789,7 +8791,7 @@ var Ke = class Hr extends to {
|
|
|
8789
8791
|
* Creates a CollaborationMappablePosition from a JSON object.
|
|
8790
8792
|
*/
|
|
8791
8793
|
static fromJSON(t) {
|
|
8792
|
-
return new
|
|
8794
|
+
return new Vr(t.position, t.yRelativePosition);
|
|
8793
8795
|
}
|
|
8794
8796
|
/**
|
|
8795
8797
|
* Converts the CollaborationMappablePosition to a JSON object.
|
|
@@ -8802,23 +8804,23 @@ var Ke = class Hr extends to {
|
|
|
8802
8804
|
}
|
|
8803
8805
|
};
|
|
8804
8806
|
function Rh(e, t) {
|
|
8805
|
-
const n =
|
|
8807
|
+
const n = Br(t, e);
|
|
8806
8808
|
return new Ke(e, n);
|
|
8807
8809
|
}
|
|
8808
8810
|
function Nh(e, t, n) {
|
|
8809
8811
|
const i = e instanceof Ke ? e.yRelativePosition : null;
|
|
8810
|
-
if (
|
|
8812
|
+
if (Pr(t) && i) {
|
|
8811
8813
|
const o = Mh(n, i);
|
|
8812
8814
|
return {
|
|
8813
8815
|
position: new Ke(o, i),
|
|
8814
8816
|
mapResult: null
|
|
8815
8817
|
};
|
|
8816
8818
|
}
|
|
8817
|
-
const s =
|
|
8819
|
+
const s = Zr(e, t), r = s.position.position;
|
|
8818
8820
|
return {
|
|
8819
8821
|
position: new Ke(
|
|
8820
8822
|
r,
|
|
8821
|
-
i ??
|
|
8823
|
+
i ?? Br(n, r)
|
|
8822
8824
|
),
|
|
8823
8825
|
mapResult: s.mapResult
|
|
8824
8826
|
};
|
|
@@ -8911,9 +8913,9 @@ ke.create({
|
|
|
8911
8913
|
].filter(Boolean);
|
|
8912
8914
|
}
|
|
8913
8915
|
});
|
|
8914
|
-
function
|
|
8916
|
+
function ds(e) {
|
|
8915
8917
|
if (!e.length)
|
|
8916
|
-
return
|
|
8918
|
+
return Ii.empty;
|
|
8917
8919
|
const t = [], n = e[0].$from.node(0);
|
|
8918
8920
|
return e.forEach((i) => {
|
|
8919
8921
|
const s = i.$from.pos, r = i.$from.nodeAfter;
|
|
@@ -8922,7 +8924,7 @@ function us(e) {
|
|
|
8922
8924
|
class: "ProseMirror-selectednoderange"
|
|
8923
8925
|
})
|
|
8924
8926
|
);
|
|
8925
|
-
}),
|
|
8927
|
+
}), Ii.create(n, t);
|
|
8926
8928
|
}
|
|
8927
8929
|
function xn(e, t, n) {
|
|
8928
8930
|
const i = [], s = e.node(0);
|
|
@@ -8932,22 +8934,22 @@ function xn(e, t, n) {
|
|
|
8932
8934
|
const a = o + c, d = a + l.nodeSize;
|
|
8933
8935
|
if (a < r.start || a >= r.end)
|
|
8934
8936
|
return;
|
|
8935
|
-
const h = new
|
|
8937
|
+
const h = new no(s.resolve(a), s.resolve(d));
|
|
8936
8938
|
i.push(h);
|
|
8937
8939
|
}), i;
|
|
8938
8940
|
}
|
|
8939
|
-
var Uh = class
|
|
8941
|
+
var Uh = class Hr {
|
|
8940
8942
|
constructor(t, n) {
|
|
8941
8943
|
this.anchor = t, this.head = n;
|
|
8942
8944
|
}
|
|
8943
8945
|
map(t) {
|
|
8944
|
-
return new
|
|
8946
|
+
return new Hr(t.map(this.anchor), t.map(this.head));
|
|
8945
8947
|
}
|
|
8946
8948
|
resolve(t) {
|
|
8947
8949
|
const n = t.resolve(this.anchor), i = t.resolve(this.head);
|
|
8948
8950
|
return new _t(n, i);
|
|
8949
8951
|
}
|
|
8950
|
-
}, _t = class vt extends
|
|
8952
|
+
}, _t = class vt extends io {
|
|
8951
8953
|
constructor(t, n, i, s = 1) {
|
|
8952
8954
|
const { doc: r } = t, o = t === n, l = t.pos === r.content.size && n.pos === r.content.size, c = o && !l ? r.resolve(n.pos + (s > 0 ? 1 : -1)) : n, a = o && l ? r.resolve(t.pos - (s > 0 ? 1 : -1)) : t, d = xn(a.min(c), a.max(c), i), h = c.pos >= t.pos ? d[0].$from : d[d.length - 1].$to, u = c.pos >= t.pos ? d[d.length - 1].$to : d[0].$from;
|
|
8953
8955
|
super(h, u, d), this.depth = i;
|
|
@@ -9081,12 +9083,12 @@ ke.create({
|
|
|
9081
9083
|
decorations: (n) => {
|
|
9082
9084
|
const { selection: i } = n, s = Le(i);
|
|
9083
9085
|
if (e = !1, !t)
|
|
9084
|
-
return s ? (e = !0,
|
|
9086
|
+
return s ? (e = !0, ds(i.ranges)) : null;
|
|
9085
9087
|
const { $from: r, $to: o } = i;
|
|
9086
9088
|
if (!s && r.sameParent(o))
|
|
9087
9089
|
return null;
|
|
9088
9090
|
const l = xn(r, o, this.options.depth);
|
|
9089
|
-
return l.length ? (e = !0,
|
|
9091
|
+
return l.length ? (e = !0, ds(l)) : null;
|
|
9090
9092
|
}
|
|
9091
9093
|
}
|
|
9092
9094
|
})
|
|
@@ -9120,7 +9122,7 @@ function Vh(e, t, n, i = 5) {
|
|
|
9120
9122
|
let f = l;
|
|
9121
9123
|
return h && u && (f = l), { x: Math.min(Math.max(f.left + i, t), f.right - i), y: a };
|
|
9122
9124
|
}
|
|
9123
|
-
var
|
|
9125
|
+
var $r = (e) => {
|
|
9124
9126
|
const { x: t, y: n, editor: i } = e, { view: s, state: r } = i, { x: o, y: l } = Vh(s, t, n, 5), c = s.root.elementsFromPoint(o, l);
|
|
9125
9127
|
let a;
|
|
9126
9128
|
if (Array.prototype.some.call(c, (u) => {
|
|
@@ -9137,6 +9139,14 @@ var Fr = (e) => {
|
|
|
9137
9139
|
return { resultElement: null, resultNode: null, pos: null };
|
|
9138
9140
|
}
|
|
9139
9141
|
const h = r.doc.nodeAt(d);
|
|
9142
|
+
if (!h) {
|
|
9143
|
+
const u = r.doc.resolve(d), f = u.parent;
|
|
9144
|
+
return {
|
|
9145
|
+
resultElement: a,
|
|
9146
|
+
resultNode: f,
|
|
9147
|
+
pos: u.start()
|
|
9148
|
+
};
|
|
9149
|
+
}
|
|
9140
9150
|
return {
|
|
9141
9151
|
resultElement: a,
|
|
9142
9152
|
resultNode: h,
|
|
@@ -9156,12 +9166,12 @@ function $h(e, t, n) {
|
|
|
9156
9166
|
top: n
|
|
9157
9167
|
};
|
|
9158
9168
|
}
|
|
9159
|
-
function
|
|
9169
|
+
function Fr(e) {
|
|
9160
9170
|
var t;
|
|
9161
9171
|
(t = e.parentNode) == null || t.removeChild(e);
|
|
9162
9172
|
}
|
|
9163
9173
|
function Fh(e, t) {
|
|
9164
|
-
const { doc: n } = t.view.state, i =
|
|
9174
|
+
const { doc: n } = t.view.state, i = $r({
|
|
9165
9175
|
editor: t,
|
|
9166
9176
|
x: e.clientX,
|
|
9167
9177
|
y: e.clientY
|
|
@@ -9188,12 +9198,12 @@ function zh(e, t) {
|
|
|
9188
9198
|
a.forEach((b) => {
|
|
9189
9199
|
const w = n.nodeDOM(b.$from.pos), D = Ph(w);
|
|
9190
9200
|
h.append(D);
|
|
9191
|
-
}), h.style.position = "absolute", h.style.top = "-10000px", document.body.append(h), e.dataTransfer.clearData(), e.dataTransfer.setDragImage(h, 0, 0), n.dragging = { slice: m, move: !0 }, d.setSelection(g), n.dispatch(d), document.addEventListener("drop", () =>
|
|
9201
|
+
}), h.style.position = "absolute", h.style.top = "-10000px", document.body.append(h), e.dataTransfer.clearData(), e.dataTransfer.setDragImage(h, 0, 0), n.dragging = { slice: m, move: !0 }, d.setSelection(g), n.dispatch(d), document.addEventListener("drop", () => Fr(h), { once: !0 });
|
|
9192
9202
|
}
|
|
9193
|
-
var
|
|
9203
|
+
var us = (e, t) => {
|
|
9194
9204
|
const n = e.resolve(t), { depth: i } = n;
|
|
9195
9205
|
return i === 0 ? t : n.pos - n.parentOffset - 1;
|
|
9196
|
-
},
|
|
9206
|
+
}, fs = (e, t) => {
|
|
9197
9207
|
const n = e.nodeAt(t), i = e.resolve(t);
|
|
9198
9208
|
let { depth: s } = i, r = n;
|
|
9199
9209
|
for (; s > 0; ) {
|
|
@@ -9207,13 +9217,13 @@ var fs = (e, t) => {
|
|
|
9207
9217
|
}, Kh = (e, t) => {
|
|
9208
9218
|
const n = U.getState(e);
|
|
9209
9219
|
return n ? de(n.doc, n.type, t, n.binding.mapping) || 0 : -1;
|
|
9210
|
-
},
|
|
9220
|
+
}, ps = (e, t) => {
|
|
9211
9221
|
let n = t;
|
|
9212
9222
|
for (; n != null && n.parentNode && n.parentNode !== e.dom; )
|
|
9213
9223
|
n = n.parentNode;
|
|
9214
9224
|
return n;
|
|
9215
|
-
},
|
|
9216
|
-
pluginKey: e =
|
|
9225
|
+
}, zr = new te("dragHandle"), Kr = ({
|
|
9226
|
+
pluginKey: e = zr,
|
|
9217
9227
|
element: t,
|
|
9218
9228
|
editor: n,
|
|
9219
9229
|
computePositionConfig: i,
|
|
@@ -9271,7 +9281,7 @@ var fs = (e, t) => {
|
|
|
9271
9281
|
if (k !== void 0 && (a = k), N)
|
|
9272
9282
|
return m(), a = !1, d = null, h = -1, r == null || r({ editor: n, node: null, pos: -1 }), P;
|
|
9273
9283
|
if (v.docChanged && h !== -1 && t)
|
|
9274
|
-
if (
|
|
9284
|
+
if (Pr(v)) {
|
|
9275
9285
|
const H = Kh(x, u);
|
|
9276
9286
|
H !== h && (h = H);
|
|
9277
9287
|
} else {
|
|
@@ -9294,14 +9304,14 @@ var fs = (e, t) => {
|
|
|
9294
9304
|
if (a ? t.draggable = !1 : t.draggable = !0, v.state.doc.eq(x.doc) || h === -1)
|
|
9295
9305
|
return;
|
|
9296
9306
|
let k = v.nodeDOM(h);
|
|
9297
|
-
if (k =
|
|
9307
|
+
if (k = ps(v, k), k === v.dom || (k == null ? void 0 : k.nodeType) !== 1)
|
|
9298
9308
|
return;
|
|
9299
|
-
const N = v.posAtDOM(k, 0), H =
|
|
9309
|
+
const N = v.posAtDOM(k, 0), H = fs(n.state.doc, N), et = us(n.state.doc, N);
|
|
9300
9310
|
d = H, h = et, u = Nn(v.state, h), r == null || r({ editor: n, node: d, pos: h }), w(k);
|
|
9301
9311
|
},
|
|
9302
9312
|
// TODO: Kills even on hot reload
|
|
9303
9313
|
destroy() {
|
|
9304
|
-
f && (cancelAnimationFrame(f), f = null, g = null), t &&
|
|
9314
|
+
f && (cancelAnimationFrame(f), f = null, g = null), t && Fr(c);
|
|
9305
9315
|
}
|
|
9306
9316
|
};
|
|
9307
9317
|
},
|
|
@@ -9319,7 +9329,7 @@ var fs = (e, t) => {
|
|
|
9319
9329
|
return;
|
|
9320
9330
|
const { x: E, y: x } = g;
|
|
9321
9331
|
g = null;
|
|
9322
|
-
const k =
|
|
9332
|
+
const k = $r({
|
|
9323
9333
|
x: E,
|
|
9324
9334
|
y: x,
|
|
9325
9335
|
editor: n
|
|
@@ -9327,11 +9337,11 @@ var fs = (e, t) => {
|
|
|
9327
9337
|
if (!k.resultElement)
|
|
9328
9338
|
return;
|
|
9329
9339
|
let N = k.resultElement;
|
|
9330
|
-
if (N =
|
|
9340
|
+
if (N = ps(v, N), N === v.dom || (N == null ? void 0 : N.nodeType) !== 1)
|
|
9331
9341
|
return;
|
|
9332
|
-
const H = v.posAtDOM(N, 0), et =
|
|
9342
|
+
const H = v.posAtDOM(N, 0), et = fs(n.state.doc, H);
|
|
9333
9343
|
if (et !== d) {
|
|
9334
|
-
const At =
|
|
9344
|
+
const At = us(n.state.doc, H);
|
|
9335
9345
|
d = et, h = At, u = Nn(v.state, h), r == null || r({ editor: n, node: d, pos: h }), w(N), b();
|
|
9336
9346
|
}
|
|
9337
9347
|
})), !1;
|
|
@@ -9369,7 +9379,7 @@ ke.create({
|
|
|
9369
9379
|
addProseMirrorPlugins() {
|
|
9370
9380
|
const e = this.options.render();
|
|
9371
9381
|
return [
|
|
9372
|
-
|
|
9382
|
+
Kr({
|
|
9373
9383
|
computePositionConfig: { ...Qn, ...this.options.computePositionConfig },
|
|
9374
9384
|
getReferencedVirtualElement: this.options.getReferencedVirtualElement,
|
|
9375
9385
|
element: e,
|
|
@@ -9386,7 +9396,7 @@ var Wh = (e) => {
|
|
|
9386
9396
|
className: t = "drag-handle",
|
|
9387
9397
|
children: n,
|
|
9388
9398
|
editor: i,
|
|
9389
|
-
pluginKey: s =
|
|
9399
|
+
pluginKey: s = zr,
|
|
9390
9400
|
onNodeChange: r,
|
|
9391
9401
|
onElementDragStart: o,
|
|
9392
9402
|
onElementDragEnd: l,
|
|
@@ -9396,7 +9406,7 @@ var Wh = (e) => {
|
|
|
9396
9406
|
let u = null;
|
|
9397
9407
|
return a ? i.isDestroyed ? () => {
|
|
9398
9408
|
h.current = null;
|
|
9399
|
-
} : (h.current || (u =
|
|
9409
|
+
} : (h.current || (u = Kr({
|
|
9400
9410
|
editor: i,
|
|
9401
9411
|
element: a,
|
|
9402
9412
|
pluginKey: s,
|
|
@@ -9423,9 +9433,9 @@ var Wh = (e) => {
|
|
|
9423
9433
|
}
|
|
9424
9434
|
);
|
|
9425
9435
|
}, jh = Wh;
|
|
9426
|
-
function
|
|
9436
|
+
function nu() {
|
|
9427
9437
|
var E, x, k, N, H, et, At, Ot;
|
|
9428
|
-
const e = Y(), t =
|
|
9438
|
+
const e = Y(), t = X(), { t: n } = Z(), [i, s] = z(null), [r, o] = z(-1), [l, c] = z(!1), a = (x = (E = e == null ? void 0 : e.extensionManager) == null ? void 0 : E.extensions) == null ? void 0 : x.some((_) => (_ == null ? void 0 : _.name) === Oo.name), d = (N = (k = e == null ? void 0 : e.extensionManager) == null ? void 0 : k.extensions) == null ? void 0 : N.some((_) => (_ == null ? void 0 : _.name) === $o.name), h = (et = (H = e == null ? void 0 : e.extensionManager) == null ? void 0 : H.extensions) == null ? void 0 : et.some((_) => (_ == null ? void 0 : _.name) === Ho.name);
|
|
9429
9439
|
function u() {
|
|
9430
9440
|
const _ = e.chain();
|
|
9431
9441
|
_.setNodeSelection(r).unsetAllMarks(), (i == null ? void 0 : i.type.name) !== "paragraph" && _.setParagraph(), _.run();
|
|
@@ -9442,11 +9452,11 @@ function iu() {
|
|
|
9442
9452
|
e.commands.setTextAlign(_);
|
|
9443
9453
|
}
|
|
9444
9454
|
function b() {
|
|
9445
|
-
const _ =
|
|
9455
|
+
const _ = Ui(e.state.tr, r, 1);
|
|
9446
9456
|
_.setMeta("hideDragHandle", !0), e.view.dispatch && e.view.dispatch(_);
|
|
9447
9457
|
}
|
|
9448
9458
|
function w() {
|
|
9449
|
-
const _ =
|
|
9459
|
+
const _ = Ui(e.state.tr, r, -1);
|
|
9450
9460
|
e.view.dispatch && e.view.dispatch(_);
|
|
9451
9461
|
}
|
|
9452
9462
|
function D() {
|
|
@@ -9458,11 +9468,11 @@ function iu() {
|
|
|
9458
9468
|
function v() {
|
|
9459
9469
|
var _;
|
|
9460
9470
|
if (r !== -1) {
|
|
9461
|
-
const ft = (i == null ? void 0 : i.nodeSize) || 0, re = r + ft, Kt = (i == null ? void 0 : i.type.name) === "paragraph" && ((_ = i == null ? void 0 : i.content) == null ? void 0 : _.size) === 0,
|
|
9471
|
+
const ft = (i == null ? void 0 : i.nodeSize) || 0, re = r + ft, Kt = (i == null ? void 0 : i.type.name) === "paragraph" && ((_ = i == null ? void 0 : i.content) == null ? void 0 : _.size) === 0, Wr = Kt ? r + 2 : re + 2;
|
|
9462
9472
|
e.chain().command(({ dispatch: vi, tr: Sn, state: Ci }) => vi ? (Kt ? Sn.insertText("/", r, r + 1) : Sn.insert(
|
|
9463
9473
|
re,
|
|
9464
9474
|
Ci.schema.nodes.paragraph.create(null, [Ci.schema.text("/")])
|
|
9465
|
-
), vi(Sn)) : !0).focus(
|
|
9475
|
+
), vi(Sn)) : !0).focus(Wr).run();
|
|
9466
9476
|
}
|
|
9467
9477
|
}
|
|
9468
9478
|
st(() => (l ? e.commands.setMeta("lockDragHandle", !0) : e.commands.setMeta("lockDragHandle", !1), () => {
|
|
@@ -9503,14 +9513,14 @@ function iu() {
|
|
|
9503
9513
|
}
|
|
9504
9514
|
),
|
|
9505
9515
|
/* @__PURE__ */ S(
|
|
9506
|
-
|
|
9516
|
+
Lo,
|
|
9507
9517
|
{
|
|
9508
9518
|
onOpenChange: P,
|
|
9509
9519
|
open: l,
|
|
9510
9520
|
children: [
|
|
9511
|
-
/* @__PURE__ */ p("div", { className: "richtext-relative richtext-flex richtext-flex-col", children: /* @__PURE__ */ p(
|
|
9521
|
+
/* @__PURE__ */ p("div", { className: "richtext-relative richtext-flex richtext-flex-col", children: /* @__PURE__ */ p(Po, { className: "richtext-absolute richtext-left-0 richtext-top-0 richtext-z-0 richtext-size-[28px]" }) }),
|
|
9512
9522
|
/* @__PURE__ */ S(
|
|
9513
|
-
|
|
9523
|
+
Bo,
|
|
9514
9524
|
{
|
|
9515
9525
|
align: "start",
|
|
9516
9526
|
className: "richtext-w-48",
|
|
@@ -9562,13 +9572,13 @@ function iu() {
|
|
|
9562
9572
|
]
|
|
9563
9573
|
}
|
|
9564
9574
|
),
|
|
9565
|
-
a || d ? /* @__PURE__ */ p(
|
|
9566
|
-
a ? /* @__PURE__ */ S(
|
|
9567
|
-
/* @__PURE__ */ S(
|
|
9575
|
+
a || d ? /* @__PURE__ */ p(Vo, {}) : null,
|
|
9576
|
+
a ? /* @__PURE__ */ S(Ai, { children: [
|
|
9577
|
+
/* @__PURE__ */ S(Oi, { className: "richtext-flex richtext-gap-3", children: [
|
|
9568
9578
|
/* @__PURE__ */ p(rt, { name: "AlignCenter" }),
|
|
9569
9579
|
/* @__PURE__ */ p("span", { children: n("editor.textalign.tooltip") })
|
|
9570
9580
|
] }),
|
|
9571
|
-
/* @__PURE__ */ p(
|
|
9581
|
+
/* @__PURE__ */ p(Mi, { children: /* @__PURE__ */ S(Ri, { children: [
|
|
9572
9582
|
/* @__PURE__ */ S(
|
|
9573
9583
|
mt,
|
|
9574
9584
|
{
|
|
@@ -9604,17 +9614,17 @@ function iu() {
|
|
|
9604
9614
|
)
|
|
9605
9615
|
] }) })
|
|
9606
9616
|
] }) : null,
|
|
9607
|
-
d ? /* @__PURE__ */ S(
|
|
9608
|
-
/* @__PURE__ */ S(
|
|
9617
|
+
d ? /* @__PURE__ */ S(Ai, { children: [
|
|
9618
|
+
/* @__PURE__ */ S(Oi, { className: "richtext-flex richtext-gap-3", children: [
|
|
9609
9619
|
/* @__PURE__ */ p(rt, { name: "IndentIncrease" }),
|
|
9610
9620
|
/* @__PURE__ */ p("span", { children: n("editor.indent") })
|
|
9611
9621
|
] }),
|
|
9612
|
-
/* @__PURE__ */ p(
|
|
9622
|
+
/* @__PURE__ */ p(Mi, { children: /* @__PURE__ */ S(Ri, { children: [
|
|
9613
9623
|
/* @__PURE__ */ S(
|
|
9614
9624
|
mt,
|
|
9615
9625
|
{
|
|
9616
9626
|
className: "richtext-flex richtext-gap-3",
|
|
9617
|
-
disabled: ((At = i == null ? void 0 : i.attrs) == null ? void 0 : At.indent) >=
|
|
9627
|
+
disabled: ((At = i == null ? void 0 : i.attrs) == null ? void 0 : At.indent) >= Ni.max,
|
|
9618
9628
|
onClick: b,
|
|
9619
9629
|
children: [
|
|
9620
9630
|
/* @__PURE__ */ p(rt, { name: "IndentIncrease" }),
|
|
@@ -9626,7 +9636,7 @@ function iu() {
|
|
|
9626
9636
|
mt,
|
|
9627
9637
|
{
|
|
9628
9638
|
className: "richtext-flex richtext-gap-3",
|
|
9629
|
-
disabled: ((Ot = i == null ? void 0 : i.attrs) == null ? void 0 : Ot.indent) <=
|
|
9639
|
+
disabled: ((Ot = i == null ? void 0 : i.attrs) == null ? void 0 : Ot.indent) <= Ni.min,
|
|
9630
9640
|
onClick: w,
|
|
9631
9641
|
children: [
|
|
9632
9642
|
/* @__PURE__ */ p(rt, { name: "IndentDecrease" }),
|
|
@@ -9645,18 +9655,18 @@ function iu() {
|
|
|
9645
9655
|
] });
|
|
9646
9656
|
}
|
|
9647
9657
|
export {
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
|
|
9651
|
-
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
|
|
9655
|
-
|
|
9656
|
-
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
|
|
9661
|
-
|
|
9658
|
+
Fd as RichTextBubbleColumns,
|
|
9659
|
+
zd as RichTextBubbleDrawer,
|
|
9660
|
+
Kd as RichTextBubbleExcalidraw,
|
|
9661
|
+
Wd as RichTextBubbleIframe,
|
|
9662
|
+
Gd as RichTextBubbleImage,
|
|
9663
|
+
Jd as RichTextBubbleImageGif,
|
|
9664
|
+
jd as RichTextBubbleKatex,
|
|
9665
|
+
Yd as RichTextBubbleLink,
|
|
9666
|
+
nu as RichTextBubbleMenuDragHandle,
|
|
9667
|
+
Xd as RichTextBubbleMermaid,
|
|
9668
|
+
Zd as RichTextBubbleTable,
|
|
9669
|
+
Qd as RichTextBubbleText,
|
|
9670
|
+
tu as RichTextBubbleTwitter,
|
|
9671
|
+
qd as RichTextBubbleVideo
|
|
9662
9672
|
};
|