@fileverse-dev/ddoc 7.1.3 → 7.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +613 -612
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -2,16 +2,16 @@ var od = Object.defineProperty;
|
|
|
2
2
|
var rd = (e, t, n) => t in e ? od(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var J = (e, t, n) => rd(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as r, jsxs as v, Fragment as rt } from "react/jsx-runtime";
|
|
5
|
-
import { P as Qn, a as Zn, i as Ma, p as Fa, N as id, C as ad, E as Jn, g as ld, b as cd, u as Oa, l as dd, d as
|
|
5
|
+
import { P as Qn, a as Zn, i as Ma, p as Fa, N as id, C as ad, E as Jn, g as ld, b as cd, u as Oa, l as dd, d as kt, e as U, f as Yt, r as Ba, n as es, h as bo, j as ud, k as Es, F as hd, L as md, m as La, o as pd, q as As, s as lr, I as Ve, S as fd, t as cr, v as gd, T as at, w as _a, x as yd, y as bi, z as xd, A as Ua, B as wd, D as bd, G as Pa, H as $n, J as Ha, K as Nr, M as Tr, O as za, Q as Cd, R as Er, U as vd, V as kd, W as Sd, X as Nd, Y as Ka, Z as Td, _ as Ed, $ as Ad, a0 as Qs, a1 as Rd, a2 as Ko, a3 as Id, a4 as Dd, a5 as gt, a6 as Md, a7 as Ci, a8 as Fd, a9 as Od, aa as Bd, ab as Ld, ac as Tn, ad as ja, ae as _d, af as bs, ag as Ud, ah as Co, ai as Pd, aj as Hd, ak as zd, al as Kd, am as jd, an as Va, ao as Rs, ap as Wa, aq as qa, ar as ws, as as Vd, at as dr, au as vi, av as ki, aw as Wd, ax as qd, ay as $d, az as $a, aA as Gd, aB as Yd, aC as Xd, aD as Qd, aE as Zd, aF as Jd, aG as eu, aH as tu, aI as nu, aJ as su, aK as ou, aL as ru, aM as iu, aN as au, aO as jo, aP as Ga, aQ as Ya, aR as lu, aS as cu, aT as du, aU as uu, aV as dn, aW as hu, aX as Si, aY as Cs, aZ as Ar, a_ as mu, a$ as Rr, b0 as pu, b1 as Vo, b2 as fu, b3 as Xa, b4 as ut, b5 as gu, b6 as Ni, b7 as yu, b8 as xu, b9 as Qa, ba as wu, bb as us, bc as bu, bd as Cu, be as vu, bf as ku, bg as Su, bh as Nu, bi as Tu, bj as Eu, bk as Au, bl as Ru, bm as Iu, bn as ur, bo as hr, bp as Du, bq as Wo, br as Mu, bs as Fu, bt as Ou, bu as Bu, bv as Lu, bw as Ti, bx as _u, by as Uu, bz as Ei, bA as Pu, bB as Hu, bC as zu, bD as Ku, bE as ju, bF as Ai, bG as Vu, bH as Za, bI as Ri, bJ as Ii, bK as Wu, bL as qu, bM as $u, bN as Di, bO as Gu, bP as Yu, bQ as Xu, bR as Qu } from "./use-headless-editor-rSxRep1e.mjs";
|
|
6
6
|
import { bS as My, bT as Fy } from "./use-headless-editor-rSxRep1e.mjs";
|
|
7
7
|
import { flip as Ja, shift as el, offset as tl, arrow as nl, size as sl, autoPlacement as ol, hide as rl, inline as il, computePosition as Ir, platform as hs } from "@floating-ui/dom";
|
|
8
|
-
import
|
|
8
|
+
import Xe, { useRef as O, useEffect as H, useState as G, useCallback as M, createContext as Zu, useContext as Ju, useMemo as ke, forwardRef as wt, useReducer as eh, useLayoutEffect as nn, memo as vo, createElement as mr, lazy as al, Suspense as Mi, useImperativeHandle as ll } from "react";
|
|
9
9
|
import { createPortal as Dn } from "react-dom";
|
|
10
10
|
import ye from "classnames";
|
|
11
|
-
import { DynamicDropdown as
|
|
11
|
+
import { DynamicDropdown as vt, LucideIcon as ue, Dialog as Dr, DialogContent as Mr, cn as ie, DialogHeader as Fr, DialogTitle as Or, DialogFooter as Br, DialogClose as lo, Button as Ne, Tooltip as Ge, IconButton as we, Skeleton as co, Avatar as Xt, PopoverClose as ko, TextAreaFieldV2 as yn, DynamicModal as Lr, Select as vs, SelectTrigger as ks, SelectValue as Ss, SelectContent as Ns, SelectItem as Ts, DropdownMenu as Mn, DropdownMenuTrigger as Fn, DropdownMenuContent as On, DropdownMenuSub as Fi, DropdownMenuSubTrigger as Oi, DropdownMenuSubContent as Bi, DropdownMenuItem as Lt, useTheme as th, Popover as ts, PopoverTrigger as Is, PopoverContent as ns, SelectGroup as nh, Checkbox as sh, toast as uo, Drawer as oh, DrawerTrigger as rh, TextField as Gt, AnimatedLoader as ih, Label as io, DynamicDropdownV2 as cl, DynamicDrawerV2 as ah, BottomDrawer as lh, ButtonGroup as ch, Divider as dl, UltimateIcons as dh, PopoverAnchor as uh, Tag as ho, TagInput as ul } from "@fileverse/ui";
|
|
12
12
|
import { create as hh } from "zustand";
|
|
13
13
|
import mh from "react-uuid";
|
|
14
|
-
import { g as ms, a as
|
|
14
|
+
import { g as ms, a as St, b as ss, c as Yn, d as mo, D as et, e as Li, M as po, f as _r, s as _i, L as ph, h as fo, A as fh, m as gh } from "./tab-utils-Cvs3qmhi.mjs";
|
|
15
15
|
import { htmlToOdt as yh } from "odf-kit";
|
|
16
16
|
import "lib0/mutex";
|
|
17
17
|
import "lib0/math";
|
|
@@ -25,7 +25,7 @@ import "lib0/environment";
|
|
|
25
25
|
import "lib0/dom";
|
|
26
26
|
import "lib0/eventloop";
|
|
27
27
|
import "lib0/map";
|
|
28
|
-
import { toUint8Array as
|
|
28
|
+
import { toUint8Array as lt, fromUint8Array as _t } from "js-base64";
|
|
29
29
|
import { Ollama as wh } from "ollama/browser";
|
|
30
30
|
import { AnimatePresence as Ds, motion as Ut, MotionConfig as bh } from "framer-motion";
|
|
31
31
|
import Ur from "markdown-it";
|
|
@@ -382,7 +382,7 @@ Jn.create({
|
|
|
382
382
|
] : [];
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
|
-
var So =
|
|
385
|
+
var So = Xe.forwardRef(
|
|
386
386
|
({
|
|
387
387
|
pluginKey: e = "bubbleMenu",
|
|
388
388
|
editor: t,
|
|
@@ -430,7 +430,7 @@ var So = Qe.forwardRef(
|
|
|
430
430
|
}, [p]), Dn(/* @__PURE__ */ r("div", { ...u, children: l }), h.current);
|
|
431
431
|
}
|
|
432
432
|
);
|
|
433
|
-
|
|
433
|
+
Xe.forwardRef(
|
|
434
434
|
({ pluginKey: e = "floatingMenu", editor: t, appendTo: n, shouldShow: s = null, options: o, children: i, ...a }, c) => {
|
|
435
435
|
const l = O(document.createElement("div"));
|
|
436
436
|
typeof c == "function" ? c(l.current) : c && (c.current = l.current);
|
|
@@ -525,7 +525,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
525
525
|
name: "Multiple"
|
|
526
526
|
};
|
|
527
527
|
return /* @__PURE__ */ r(
|
|
528
|
-
|
|
528
|
+
vt,
|
|
529
529
|
{
|
|
530
530
|
sideOffset: 15,
|
|
531
531
|
anchorTrigger: /* @__PURE__ */ v(
|
|
@@ -592,7 +592,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
592
592
|
description: a,
|
|
593
593
|
confirmLabel: c = "Delete"
|
|
594
594
|
}) => {
|
|
595
|
-
const l =
|
|
595
|
+
const l = kt("(max-width: 1000px)"), u = a ?? "Do you really want to delete this comment?";
|
|
596
596
|
return e ? l ? /* @__PURE__ */ r(
|
|
597
597
|
Dr,
|
|
598
598
|
{
|
|
@@ -683,7 +683,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
683
683
|
]
|
|
684
684
|
}
|
|
685
685
|
) : null;
|
|
686
|
-
},
|
|
686
|
+
}, Qt = (e) => {
|
|
687
687
|
const t = U((i) => i.getEnsStatus), n = U(
|
|
688
688
|
(i) => e ? i.ensCache[e] : void 0
|
|
689
689
|
), [s, o] = G(() => ({
|
|
@@ -716,7 +716,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
716
716
|
id: h,
|
|
717
717
|
isFocused: m
|
|
718
718
|
}) => {
|
|
719
|
-
const p = O(null), f = O(null), [x, g] = G(!1), [y, R] = G(!1), E = U((B) => B.openReplyId), k = U((B) => B.setOpenReplyId), A = U((B) => B.requestEditComment), C = U((B) => B.username), { isBelow1280px: N } =
|
|
719
|
+
const p = O(null), f = O(null), [x, g] = G(!1), [y, R] = G(!1), E = U((B) => B.openReplyId), k = U((B) => B.setOpenReplyId), A = U((B) => B.requestEditComment), C = U((B) => B.username), { isBelow1280px: N } = Yt(), S = Qt(e), w = () => {
|
|
720
720
|
var B;
|
|
721
721
|
if ((B = p.current) != null && B.parentElement) {
|
|
722
722
|
const q = p.current.closest('[role="dialog"]');
|
|
@@ -824,10 +824,10 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
824
824
|
] })
|
|
825
825
|
] }) : s ? /* @__PURE__ */ r("p", { className: ie(i, "color-text-secondary italic"), children: s }) : null;
|
|
826
826
|
}, fl = ({ username: e, createdAt: t }) => {
|
|
827
|
-
const n =
|
|
827
|
+
const n = Qt(e);
|
|
828
828
|
return /* @__PURE__ */ v("div", { className: "flex justify-start items-center gap-2", children: [
|
|
829
829
|
/* @__PURE__ */ r(
|
|
830
|
-
|
|
830
|
+
Xt,
|
|
831
831
|
{
|
|
832
832
|
src: n.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
833
833
|
n.name
|
|
@@ -837,7 +837,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
837
837
|
}
|
|
838
838
|
),
|
|
839
839
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-[8px] flex-wrap", children: [
|
|
840
|
-
/* @__PURE__ */ r(
|
|
840
|
+
/* @__PURE__ */ r(Ge, { text: n.name, children: /* @__PURE__ */ v("span", { className: "text-body-sm-bold flex items-center gap-1 whitespace-nowrap", children: [
|
|
841
841
|
/* @__PURE__ */ r("p", { className: "truncate max-w-[100px]", children: es(n.name) }),
|
|
842
842
|
n.isEns && /* @__PURE__ */ r("img", { src: os, alt: "verified", className: "w-3.5 h-3.5" })
|
|
843
843
|
] }) }),
|
|
@@ -875,7 +875,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
875
875
|
className: "opacity-0 group-hover:opacity-100",
|
|
876
876
|
onClick: (k) => k.stopPropagation(),
|
|
877
877
|
children: /* @__PURE__ */ r(
|
|
878
|
-
|
|
878
|
+
vt,
|
|
879
879
|
{
|
|
880
880
|
align: "end",
|
|
881
881
|
sideOffset: 4,
|
|
@@ -977,7 +977,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
977
977
|
}
|
|
978
978
|
),
|
|
979
979
|
!d && /* @__PURE__ */ r("div", { className: "flex items-center -space-x-1", children: h.slice(0, 2).map((m) => /* @__PURE__ */ r(
|
|
980
|
-
|
|
980
|
+
Xt,
|
|
981
981
|
{
|
|
982
982
|
src: n.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
983
983
|
m.username || ""
|
|
@@ -1082,7 +1082,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1082
1082
|
/* @__PURE__ */ v("div", { className: "flex justify-between items-center", children: [
|
|
1083
1083
|
/* @__PURE__ */ r(fl, { username: t, createdAt: s }),
|
|
1084
1084
|
i === "2" ? /* @__PURE__ */ r(
|
|
1085
|
-
|
|
1085
|
+
Ge,
|
|
1086
1086
|
{
|
|
1087
1087
|
text: l ? "Available in a moment" : "",
|
|
1088
1088
|
sideOffset: 0,
|
|
@@ -1096,7 +1096,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1096
1096
|
),
|
|
1097
1097
|
children: [
|
|
1098
1098
|
ae && !o && /* @__PURE__ */ r(
|
|
1099
|
-
|
|
1099
|
+
Ge,
|
|
1100
1100
|
{
|
|
1101
1101
|
text: !l && (p ? "Accept suggestion" : "Mark as resolved"),
|
|
1102
1102
|
position: "bottom",
|
|
@@ -1113,7 +1113,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
),
|
|
1115
1115
|
u && /* @__PURE__ */ r("div", { onClick: (de) => de.stopPropagation(), children: /* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
vt,
|
|
1117
1117
|
{
|
|
1118
1118
|
align: "end",
|
|
1119
1119
|
sideOffset: 4,
|
|
@@ -1173,7 +1173,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1173
1173
|
}
|
|
1174
1174
|
)
|
|
1175
1175
|
}
|
|
1176
|
-
) : /* @__PURE__ */ r(
|
|
1176
|
+
) : /* @__PURE__ */ r(Ge, { text: "Actions are not supported for old comments", children: /* @__PURE__ */ r(
|
|
1177
1177
|
we,
|
|
1178
1178
|
{
|
|
1179
1179
|
icon: "Info",
|
|
@@ -1398,7 +1398,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1398
1398
|
}, [e, A, C]);
|
|
1399
1399
|
const q = () => /* @__PURE__ */ v("div", { className: "p-3 flex flex-col gap-2 color-bg-secondary rounded-md", children: [
|
|
1400
1400
|
/* @__PURE__ */ r(
|
|
1401
|
-
|
|
1401
|
+
yn,
|
|
1402
1402
|
{
|
|
1403
1403
|
"data-testid": "comment-dropdown-input",
|
|
1404
1404
|
value: (d == null ? void 0 : d.text) || "",
|
|
@@ -1442,14 +1442,14 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1442
1442
|
")"
|
|
1443
1443
|
] }),
|
|
1444
1444
|
/* @__PURE__ */ r("div", { className: "relative flex items-center gap-1", children: (I || s) && !$ && /* @__PURE__ */ v(
|
|
1445
|
-
|
|
1445
|
+
Ge,
|
|
1446
1446
|
{
|
|
1447
1447
|
text: n ? "Available in a moment" : "",
|
|
1448
1448
|
sideOffset: 0,
|
|
1449
1449
|
position: "top",
|
|
1450
1450
|
children: [
|
|
1451
1451
|
/* @__PURE__ */ r(
|
|
1452
|
-
|
|
1452
|
+
vt,
|
|
1453
1453
|
{
|
|
1454
1454
|
align: "end",
|
|
1455
1455
|
sideOffset: 4,
|
|
@@ -1489,7 +1489,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1489
1489
|
"more-actions"
|
|
1490
1490
|
),
|
|
1491
1491
|
/* @__PURE__ */ r(
|
|
1492
|
-
|
|
1492
|
+
Ge,
|
|
1493
1493
|
{
|
|
1494
1494
|
text: n ? "" : m != null && m.resolved ? "Unresolve" : "Resolve",
|
|
1495
1495
|
sideOffset: 5,
|
|
@@ -1537,7 +1537,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1537
1537
|
),
|
|
1538
1538
|
/* @__PURE__ */ v("div", { className: "color-bg-secondary border-t color-border-default p-3 rounded-b", children: [
|
|
1539
1539
|
/* @__PURE__ */ r(
|
|
1540
|
-
|
|
1540
|
+
yn,
|
|
1541
1541
|
{
|
|
1542
1542
|
value: o,
|
|
1543
1543
|
onChange: ge,
|
|
@@ -1605,7 +1605,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1605
1605
|
[e, t, n, s]
|
|
1606
1606
|
);
|
|
1607
1607
|
return /* @__PURE__ */ r(Cl.Provider, { value: i, children: o });
|
|
1608
|
-
}, Bs = () => Ju(Cl), mm =
|
|
1608
|
+
}, Bs = () => Ju(Cl), mm = Xe.memo(hd), pm = Xe.memo(md), fm = "61", gm = (e) => {
|
|
1609
1609
|
const {
|
|
1610
1610
|
editor: t,
|
|
1611
1611
|
onError: n,
|
|
@@ -1620,7 +1620,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1620
1620
|
fetchV1ImageFn: h
|
|
1621
1621
|
} = e, m = La(t), p = t ? m.currentSize : void 0, f = t ? m.currentLineHeight : void 0, x = t ? m.onSetFontSize : () => {
|
|
1622
1622
|
}, g = t ? m.onSetLineHeight : () => {
|
|
1623
|
-
}, { isBelow1280px: y, isNativeMobile: R } =
|
|
1623
|
+
}, { isBelow1280px: y, isNativeMobile: R } = Yt(), { isFocusMode: E } = pd(), { scale: k } = Bs(), A = O({ isBelow1280px: y, scale: k });
|
|
1624
1624
|
A.current = { isBelow1280px: y, scale: k };
|
|
1625
1625
|
const C = () => A.current.isBelow1280px ? A.current.scale : 1, N = !y && !R, { toolRef: S, setToolVisibility: w, toolVisibility: b } = As({
|
|
1626
1626
|
editor: t ?? null,
|
|
@@ -1762,7 +1762,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1762
1762
|
]
|
|
1763
1763
|
), _ = M(() => {
|
|
1764
1764
|
o == null || o(!0), F();
|
|
1765
|
-
}, [F, o]), le = /* @__PURE__ */ r(
|
|
1765
|
+
}, [F, o]), le = /* @__PURE__ */ r(Xe.Fragment, { children: /* @__PURE__ */ r(
|
|
1766
1766
|
at,
|
|
1767
1767
|
{
|
|
1768
1768
|
ref: se,
|
|
@@ -1827,7 +1827,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1827
1827
|
),
|
|
1828
1828
|
children: le
|
|
1829
1829
|
}
|
|
1830
|
-
) : /* @__PURE__ */ r(
|
|
1830
|
+
) : /* @__PURE__ */ r(Xe.Fragment, { children: s ? N ? /* @__PURE__ */ r(
|
|
1831
1831
|
at,
|
|
1832
1832
|
{
|
|
1833
1833
|
ref: se,
|
|
@@ -1840,7 +1840,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1840
1840
|
classNames: "disabled:!bg-transparent"
|
|
1841
1841
|
}
|
|
1842
1842
|
) : /* @__PURE__ */ r(
|
|
1843
|
-
|
|
1843
|
+
vt,
|
|
1844
1844
|
{
|
|
1845
1845
|
side: "bottom",
|
|
1846
1846
|
sideOffset: 15,
|
|
@@ -1865,8 +1865,8 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1865
1865
|
}) : null
|
|
1866
1866
|
},
|
|
1867
1867
|
"Comment"
|
|
1868
|
-
) : W ? /* @__PURE__ */ r(
|
|
1869
|
-
|
|
1868
|
+
) : W ? /* @__PURE__ */ r(Xe.Fragment, { children: /* @__PURE__ */ r(
|
|
1869
|
+
vt,
|
|
1870
1870
|
{
|
|
1871
1871
|
sideOffset: 15,
|
|
1872
1872
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -1890,11 +1890,11 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
)
|
|
1892
1892
|
}
|
|
1893
|
-
) }) : /* @__PURE__ */ v(
|
|
1893
|
+
) }) : /* @__PURE__ */ v(Xe.Fragment, { children: [
|
|
1894
1894
|
/* @__PURE__ */ r(nm, { editor: t, elementRef: S }),
|
|
1895
1895
|
/* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider" }),
|
|
1896
1896
|
/* @__PURE__ */ r(
|
|
1897
|
-
|
|
1897
|
+
vt,
|
|
1898
1898
|
{
|
|
1899
1899
|
sideOffset: 8,
|
|
1900
1900
|
anchorTrigger: /* @__PURE__ */ v(
|
|
@@ -1926,7 +1926,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1926
1926
|
Ve.FONT_SIZE
|
|
1927
1927
|
),
|
|
1928
1928
|
/* @__PURE__ */ r(
|
|
1929
|
-
|
|
1929
|
+
vt,
|
|
1930
1930
|
{
|
|
1931
1931
|
sideOffset: 15,
|
|
1932
1932
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -1963,9 +1963,9 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1963
1963
|
}
|
|
1964
1964
|
),
|
|
1965
1965
|
q === 3 && /* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider ml-2" })
|
|
1966
|
-
] }, q) : B.name === "Alignment" ? /* @__PURE__ */ v(
|
|
1966
|
+
] }, q) : B.name === "Alignment" ? /* @__PURE__ */ v(Xe.Fragment, { children: [
|
|
1967
1967
|
/* @__PURE__ */ r(
|
|
1968
|
-
|
|
1968
|
+
vt,
|
|
1969
1969
|
{
|
|
1970
1970
|
sideOffset: 15,
|
|
1971
1971
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -1988,7 +1988,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
1988
1988
|
Ve.TEXT_COLOR
|
|
1989
1989
|
),
|
|
1990
1990
|
/* @__PURE__ */ r(
|
|
1991
|
-
|
|
1991
|
+
vt,
|
|
1992
1992
|
{
|
|
1993
1993
|
sideOffset: 15,
|
|
1994
1994
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -2012,7 +2012,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
2012
2012
|
),
|
|
2013
2013
|
/* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider" }),
|
|
2014
2014
|
/* @__PURE__ */ r(
|
|
2015
|
-
|
|
2015
|
+
vt,
|
|
2016
2016
|
{
|
|
2017
2017
|
sideOffset: 15,
|
|
2018
2018
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -2029,8 +2029,8 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
2029
2029
|
},
|
|
2030
2030
|
B.name
|
|
2031
2031
|
)
|
|
2032
|
-
] }, q) : B.name === "Link" || B.name === "Scripts" ? /* @__PURE__ */ r(
|
|
2033
|
-
|
|
2032
|
+
] }, q) : B.name === "Link" || B.name === "Scripts" ? /* @__PURE__ */ r(Xe.Fragment, { children: /* @__PURE__ */ r(
|
|
2033
|
+
vt,
|
|
2034
2034
|
{
|
|
2035
2035
|
sideOffset: 15,
|
|
2036
2036
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -2060,7 +2060,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
2060
2060
|
},
|
|
2061
2061
|
"Comment"
|
|
2062
2062
|
) : /* @__PURE__ */ r(
|
|
2063
|
-
|
|
2063
|
+
vt,
|
|
2064
2064
|
{
|
|
2065
2065
|
side: "bottom",
|
|
2066
2066
|
sideOffset: 15,
|
|
@@ -2094,7 +2094,7 @@ const nm = ({ editor: e, elementRef: t }) => {
|
|
|
2094
2094
|
] }) })
|
|
2095
2095
|
}
|
|
2096
2096
|
) : null;
|
|
2097
|
-
}, vl =
|
|
2097
|
+
}, vl = Xe.memo(gm);
|
|
2098
2098
|
vl.displayName = "EditorBubbleMenu";
|
|
2099
2099
|
const kl = (e, t) => e ? async (n) => {
|
|
2100
2100
|
const { encryptionKey: s, nonce: o, authTag: i, url: a, contentRef: c } = await e(n);
|
|
@@ -2126,7 +2126,7 @@ const kl = (e, t) => e ? async (n) => {
|
|
|
2126
2126
|
for (u.tagName || (u = l.parentElement); u && !(u.getAttribute("data-type") && u.getAttribute("data-type") === t) && !u.classList.contains(t); )
|
|
2127
2127
|
u = u.parentElement;
|
|
2128
2128
|
return u;
|
|
2129
|
-
}, zr =
|
|
2129
|
+
}, zr = wt(
|
|
2130
2130
|
({ children: e, className: t, withShadow: n = !0, withBorder: s = !1, ...o }, i) => {
|
|
2131
2131
|
const a = ie(
|
|
2132
2132
|
t,
|
|
@@ -2138,7 +2138,7 @@ const kl = (e, t) => e ? async (n) => {
|
|
|
2138
2138
|
}
|
|
2139
2139
|
);
|
|
2140
2140
|
zr.displayName = "Surface";
|
|
2141
|
-
const Nl =
|
|
2141
|
+
const Nl = wt(
|
|
2142
2142
|
({
|
|
2143
2143
|
shouldShowContent: e = !0,
|
|
2144
2144
|
children: t,
|
|
@@ -2155,7 +2155,7 @@ const Nl = xt(
|
|
|
2155
2155
|
}
|
|
2156
2156
|
);
|
|
2157
2157
|
Nl.displayName = "Toolbar";
|
|
2158
|
-
const xm =
|
|
2158
|
+
const xm = wt(
|
|
2159
2159
|
({ horizontal: e, className: t, ...n }, s) => {
|
|
2160
2160
|
const o = ye(
|
|
2161
2161
|
"bg-neutral-200",
|
|
@@ -3163,7 +3163,7 @@ ${te.getHTML()}`
|
|
|
3163
3163
|
onDocxImport: x,
|
|
3164
3164
|
fetchV1ImageFn: y
|
|
3165
3165
|
}), $ = La(e), ne = M(() => {
|
|
3166
|
-
}, []), se = e ? $.currentSize : void 0, ge = e ? $.onSetFontSize : ne, Y = e ? $.currentLineHeight : void 0, ae = e ? $.onSetLineHeight : ne, de =
|
|
3166
|
+
}, []), se = e ? $.currentSize : void 0, ge = e ? $.onSetFontSize : ne, Y = e ? $.currentLineHeight : void 0, ae = e ? $.onSetLineHeight : ne, de = kt("(max-width: 1560px)"), L = kt("(max-width: 1370px)"), z = kt("(max-width: 1270px)"), _ = kt("(max-width: 1160px)"), le = kt("(max-width: 1030px)"), W = ke(() => {
|
|
3167
3167
|
switch (!0) {
|
|
3168
3168
|
case le:
|
|
3169
3169
|
return 1030;
|
|
@@ -3213,7 +3213,7 @@ ${te.getHTML()}`
|
|
|
3213
3213
|
}
|
|
3214
3214
|
),
|
|
3215
3215
|
/* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider mx-1" }),
|
|
3216
|
-
/* @__PURE__ */ r("div", { className: "flex gap-1 justify-center items-center", children: I.map((P, K) => P ? /* @__PURE__ */ r(
|
|
3216
|
+
/* @__PURE__ */ r("div", { className: "flex gap-1 justify-center items-center", children: I.map((P, K) => P ? /* @__PURE__ */ r(Ge, { text: P.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
3217
3217
|
we,
|
|
3218
3218
|
{
|
|
3219
3219
|
className: "disabled:bg-transparent",
|
|
@@ -3353,7 +3353,7 @@ ${te.getHTML()}`
|
|
|
3353
3353
|
onError: t
|
|
3354
3354
|
},
|
|
3355
3355
|
P.title
|
|
3356
|
-
) : /* @__PURE__ */ r(
|
|
3356
|
+
) : /* @__PURE__ */ r(Ge, { text: P.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
3357
3357
|
at,
|
|
3358
3358
|
{
|
|
3359
3359
|
icon: P.icon,
|
|
@@ -3374,7 +3374,7 @@ ${te.getHTML()}`
|
|
|
3374
3374
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-1", children: [
|
|
3375
3375
|
/* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider mx-2" }),
|
|
3376
3376
|
S && /* @__PURE__ */ r(
|
|
3377
|
-
|
|
3377
|
+
Ge,
|
|
3378
3378
|
{
|
|
3379
3379
|
text: N ? "Back to editor" : "Markdown view",
|
|
3380
3380
|
asTriggerChild: !0,
|
|
@@ -3390,7 +3390,7 @@ ${te.getHTML()}`
|
|
|
3390
3390
|
)
|
|
3391
3391
|
}
|
|
3392
3392
|
),
|
|
3393
|
-
/* @__PURE__ */ r(
|
|
3393
|
+
/* @__PURE__ */ r(Ge, { text: "Enter focus mode", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
3394
3394
|
we,
|
|
3395
3395
|
{
|
|
3396
3396
|
icon: "Focus",
|
|
@@ -3413,7 +3413,7 @@ ${te.getHTML()}`
|
|
|
3413
3413
|
]
|
|
3414
3414
|
}
|
|
3415
3415
|
) : null;
|
|
3416
|
-
}, Al =
|
|
3416
|
+
}, Al = Xe.memo(Mm);
|
|
3417
3417
|
Al.displayName = "TiptapToolBar";
|
|
3418
3418
|
const Fm = ({
|
|
3419
3419
|
ydoc: e,
|
|
@@ -3753,7 +3753,7 @@ const Fm = ({
|
|
|
3753
3753
|
command: t,
|
|
3754
3754
|
editor: n
|
|
3755
3755
|
}) => {
|
|
3756
|
-
const [s, o] = G(0), [i, a] = G(e), c =
|
|
3756
|
+
const [s, o] = G(0), [i, a] = G(e), c = kt("(max-width: 640px)"), l = Js(n, "callout"), u = Js(n, "codeBlock"), d = Js(n, "column"), h = Js(n, "table"), m = M(
|
|
3757
3757
|
(f) => {
|
|
3758
3758
|
const x = i[f];
|
|
3759
3759
|
x && (x.title === "Continue writing" || t(x));
|
|
@@ -4070,7 +4070,7 @@ const qi = () => {
|
|
|
4070
4070
|
var ve;
|
|
4071
4071
|
const [i, a] = G(!1), [c, l] = G(!1), [u, d] = G(e.attrs.prompt), [h, m] = G(!!e.attrs.content), [p, f] = G(""), [x, g] = G(!1), [y, R] = G(!1), [E, k] = G([]), [A, C] = G(
|
|
4072
4072
|
!!localStorage.getItem("include-ddoc-context")
|
|
4073
|
-
), [N, S] = G(!0), { prompt: w, content: b } = e.attrs, T = O(null), I = O(null), F = O(null), { isSuggestionMode: j } = Pa(), Z = !t.isEditable || !!j, { isWindows: V } =
|
|
4073
|
+
), [N, S] = G(!0), { prompt: w, content: b } = e.attrs, T = O(null), I = O(null), F = O(null), { isSuggestionMode: j } = Pa(), Z = !t.isEditable || !!j, { isWindows: V } = Yt(), te = V ? "Ctrl" : "Cmd", $ = window.__MODEL_CONTEXT__, ne = O(null), [se, ge] = G(
|
|
4074
4074
|
qi()
|
|
4075
4075
|
), Y = _d({
|
|
4076
4076
|
extensions: [Pd, ...Hd],
|
|
@@ -4107,9 +4107,9 @@ const qi = () => {
|
|
|
4107
4107
|
(async () => {
|
|
4108
4108
|
if ($ != null && $.defaultModels)
|
|
4109
4109
|
try {
|
|
4110
|
-
const ce = $.defaultModels.map((
|
|
4111
|
-
value:
|
|
4112
|
-
label:
|
|
4110
|
+
const ce = $.defaultModels.map((Me) => ({
|
|
4111
|
+
value: Me.modelName,
|
|
4112
|
+
label: Me.label
|
|
4113
4113
|
}));
|
|
4114
4114
|
k(ce);
|
|
4115
4115
|
} catch (ce) {
|
|
@@ -4126,39 +4126,39 @@ const qi = () => {
|
|
|
4126
4126
|
if (!A) return "";
|
|
4127
4127
|
const Q = t.getJSON();
|
|
4128
4128
|
if (typeof n() != "number") return "";
|
|
4129
|
-
const
|
|
4129
|
+
const Me = 2e3;
|
|
4130
4130
|
let Te = "";
|
|
4131
|
-
const Ue = (
|
|
4132
|
-
let Pe = "",
|
|
4133
|
-
const
|
|
4134
|
-
for (let
|
|
4135
|
-
const
|
|
4136
|
-
if (
|
|
4137
|
-
Pe =
|
|
4131
|
+
const Ue = (Ye) => Ye ? Ye.text ? Ye.text : Ye.content ? Ye.content.map(($e) => Ue($e)).join(" ") : "" : "";
|
|
4132
|
+
let Pe = "", Je = 0;
|
|
4133
|
+
const yt = ((Ke = Q.content) == null ? void 0 : Ke.slice(0, -1)) || [];
|
|
4134
|
+
for (let Ye = yt.length - 1; Ye >= 0; Ye--) {
|
|
4135
|
+
const $e = Ue(yt[Ye]);
|
|
4136
|
+
if (Je + $e.length > Me) {
|
|
4137
|
+
Pe = $e.slice(-(Me - Je)) + Pe;
|
|
4138
4138
|
break;
|
|
4139
4139
|
}
|
|
4140
|
-
Pe =
|
|
4141
|
-
` + Pe,
|
|
4140
|
+
Pe = $e + `
|
|
4141
|
+
` + Pe, Je += $e.length;
|
|
4142
4142
|
}
|
|
4143
|
-
let
|
|
4144
|
-
const
|
|
4145
|
-
for (const
|
|
4146
|
-
const
|
|
4147
|
-
if (
|
|
4148
|
-
|
|
4143
|
+
let mt = "", ze = 0;
|
|
4144
|
+
const ct = ((Ht = Q.content) == null ? void 0 : Ht.slice(-1)) || [];
|
|
4145
|
+
for (const Ye of ct) {
|
|
4146
|
+
const $e = Ue(Ye);
|
|
4147
|
+
if (ze + $e.length > Me) {
|
|
4148
|
+
mt += $e.slice(0, Me - ze);
|
|
4149
4149
|
break;
|
|
4150
4150
|
}
|
|
4151
|
-
|
|
4152
|
-
`,
|
|
4151
|
+
mt += $e + `
|
|
4152
|
+
`, ze += $e.length;
|
|
4153
4153
|
}
|
|
4154
|
-
return Te = (Pe +
|
|
4154
|
+
return Te = (Pe + mt).trim(), Te && (Te = `Document context (${Je} chars before, ${ze} chars after):
|
|
4155
4155
|
${Te}`), Te;
|
|
4156
4156
|
}, [t, n, A]), de = M(async () => {
|
|
4157
4157
|
var Q;
|
|
4158
4158
|
if (u.trim())
|
|
4159
4159
|
try {
|
|
4160
4160
|
a(!0), l(!0), f(""), m(!1), (Q = $ == null ? void 0 : $.onPromptUsage) == null || Q.call($);
|
|
4161
|
-
const ce = ae(),
|
|
4161
|
+
const ce = ae(), Me = A ? `Context from document:
|
|
4162
4162
|
${ce}
|
|
4163
4163
|
|
|
4164
4164
|
User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
@@ -4168,7 +4168,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4168
4168
|
let Ue = "";
|
|
4169
4169
|
try {
|
|
4170
4170
|
await Te.streamModel(
|
|
4171
|
-
|
|
4171
|
+
Me,
|
|
4172
4172
|
$.activeModel.modelName,
|
|
4173
4173
|
(Pe) => {
|
|
4174
4174
|
Ue += Pe, f(Ue);
|
|
@@ -4189,7 +4189,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4189
4189
|
}
|
|
4190
4190
|
} else if (Te != null && Te.callModel) {
|
|
4191
4191
|
const Ue = await Te.callModel(
|
|
4192
|
-
|
|
4192
|
+
Me,
|
|
4193
4193
|
$.activeModel.modelName
|
|
4194
4194
|
);
|
|
4195
4195
|
s == null || s({
|
|
@@ -4226,8 +4226,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4226
4226
|
if (typeof n == "function") {
|
|
4227
4227
|
g(!0);
|
|
4228
4228
|
const Q = setTimeout(() => {
|
|
4229
|
-
t.commands.command(({ tr: ce, dispatch:
|
|
4230
|
-
if (
|
|
4229
|
+
t.commands.command(({ tr: ce, dispatch: Me }) => {
|
|
4230
|
+
if (Me) {
|
|
4231
4231
|
const Te = n();
|
|
4232
4232
|
if (Te !== void 0) {
|
|
4233
4233
|
ce.delete(Te, Te + e.nodeSize);
|
|
@@ -4245,8 +4245,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4245
4245
|
if (typeof n == "function") {
|
|
4246
4246
|
g(!0);
|
|
4247
4247
|
const Q = setTimeout(() => {
|
|
4248
|
-
t.commands.command(({ tr: ce, dispatch:
|
|
4249
|
-
if (
|
|
4248
|
+
t.commands.command(({ tr: ce, dispatch: Me }) => {
|
|
4249
|
+
if (Me) {
|
|
4250
4250
|
const Te = n();
|
|
4251
4251
|
if (Te !== void 0) {
|
|
4252
4252
|
ce.delete(Te, Te + e.nodeSize);
|
|
@@ -4271,17 +4271,17 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4271
4271
|
(Q) => {
|
|
4272
4272
|
s == null || s({ model: Q });
|
|
4273
4273
|
const ce = $ == null ? void 0 : $.defaultModels.find(
|
|
4274
|
-
(
|
|
4274
|
+
(Me) => Me.modelName === Q
|
|
4275
4275
|
);
|
|
4276
4276
|
ce && ($ != null && $.setActiveModel) && $.setActiveModel(ce);
|
|
4277
4277
|
},
|
|
4278
4278
|
[s, $]
|
|
4279
4279
|
), q = M(() => {
|
|
4280
|
-
var ce,
|
|
4280
|
+
var ce, Me;
|
|
4281
4281
|
if (s == null || s({ content: "" }), m(!1), f(""), !T.current) return;
|
|
4282
4282
|
(ce = T.current) == null || ce.focus();
|
|
4283
4283
|
const Q = T.current.value.length;
|
|
4284
|
-
(
|
|
4284
|
+
(Me = T.current) == null || Me.setSelectionRange(Q, Q), T.current.scrollTop = T.current.scrollHeight;
|
|
4285
4285
|
}, [s]), P = M(() => {
|
|
4286
4286
|
R(!0);
|
|
4287
4287
|
}, []), K = M(() => {
|
|
@@ -4639,7 +4639,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4639
4639
|
})
|
|
4640
4640
|
};
|
|
4641
4641
|
}
|
|
4642
|
-
}),
|
|
4642
|
+
}), $t = (e) => {
|
|
4643
4643
|
try {
|
|
4644
4644
|
e();
|
|
4645
4645
|
} catch {
|
|
@@ -4661,37 +4661,37 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4661
4661
|
if (!e)
|
|
4662
4662
|
return;
|
|
4663
4663
|
const t = Zm(e);
|
|
4664
|
-
t && (
|
|
4664
|
+
t && ($t(() => {
|
|
4665
4665
|
var n;
|
|
4666
4666
|
return (n = t.destroy) == null ? void 0 : n.call(t);
|
|
4667
|
-
}),
|
|
4667
|
+
}), $t(() => {
|
|
4668
4668
|
var n, s;
|
|
4669
4669
|
return (s = (n = t.mapping) == null ? void 0 : n.clear) == null ? void 0 : s.call(n);
|
|
4670
|
-
}),
|
|
4670
|
+
}), $t(() => {
|
|
4671
4671
|
var n, s;
|
|
4672
4672
|
return (s = (n = t.isOMark) == null ? void 0 : n.clear) == null ? void 0 : s.call(n);
|
|
4673
|
-
}),
|
|
4673
|
+
}), $t(() => {
|
|
4674
4674
|
t.beforeTransactionSelection = null;
|
|
4675
|
-
}),
|
|
4675
|
+
}), $t(() => {
|
|
4676
4676
|
t._domSelectionInView = null;
|
|
4677
4677
|
}));
|
|
4678
4678
|
}, Yi = (e) => {
|
|
4679
4679
|
if (!e)
|
|
4680
4680
|
return;
|
|
4681
4681
|
const t = Qm(e), n = t == null ? void 0 : t.undoManager;
|
|
4682
|
-
n && (
|
|
4682
|
+
n && ($t(() => {
|
|
4683
4683
|
var s;
|
|
4684
4684
|
return (s = n.clear) == null ? void 0 : s.call(n, !0, !0);
|
|
4685
|
-
}),
|
|
4685
|
+
}), $t(() => {
|
|
4686
4686
|
var s;
|
|
4687
4687
|
return (s = n.destroy) == null ? void 0 : s.call(n);
|
|
4688
|
-
}),
|
|
4688
|
+
}), $t(() => {
|
|
4689
4689
|
n.restore = null;
|
|
4690
|
-
}),
|
|
4690
|
+
}), $t(() => {
|
|
4691
4691
|
n.undoStack = [];
|
|
4692
|
-
}),
|
|
4692
|
+
}), $t(() => {
|
|
4693
4693
|
n.redoStack = [];
|
|
4694
|
-
}),
|
|
4694
|
+
}), $t(() => {
|
|
4695
4695
|
t.prevSel = null;
|
|
4696
4696
|
}));
|
|
4697
4697
|
}, Jm = (e) => {
|
|
@@ -4934,21 +4934,21 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4934
4934
|
}) => {
|
|
4935
4935
|
const K = (l == null ? void 0 : l.enabled) === !0, D = K ? l.connection : null, { activeCommentId: ee, setActiveCommentId: fe, focusCommentWithActiveId: oe } = hp(), ve = O(z);
|
|
4936
4936
|
ve.current = z;
|
|
4937
|
-
const Q = O(null), ce = !!(A && N), { tocItems:
|
|
4937
|
+
const Q = O(null), ce = !!(A && N), { tocItems: Me, setTocItems: Te, handleTocUpdateForTab: Ue } = mp(z), Pe = !!(i && a === "suggest"), Je = O(Wa), yt = q ?? Je, mt = M(
|
|
4938
4938
|
(pe, me) => {
|
|
4939
4939
|
ve.current === pe && (fe(me || null), me && setTimeout(() => oe(me)));
|
|
4940
4940
|
},
|
|
4941
4941
|
[oe, fe]
|
|
4942
|
-
),
|
|
4942
|
+
), ze = M(
|
|
4943
4943
|
(pe, me, be) => {
|
|
4944
4944
|
ve.current === pe && Ue(pe, me, be);
|
|
4945
4945
|
},
|
|
4946
4946
|
[Ue]
|
|
4947
4947
|
), {
|
|
4948
|
-
buildExtensionsForTab:
|
|
4948
|
+
buildExtensionsForTab: ct,
|
|
4949
4949
|
commentAnchorsRef: Ke,
|
|
4950
4950
|
draftAnchorsRef: Ht,
|
|
4951
|
-
storeApiRef:
|
|
4951
|
+
storeApiRef: Ye
|
|
4952
4952
|
} = pp({
|
|
4953
4953
|
ydoc: e,
|
|
4954
4954
|
onError: f,
|
|
@@ -4964,39 +4964,39 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4964
4964
|
maxTokens: C,
|
|
4965
4965
|
hasAvailableModels: ce,
|
|
4966
4966
|
activeCommentId: ee,
|
|
4967
|
-
onCommentActivated:
|
|
4968
|
-
onTocUpdateForTab:
|
|
4967
|
+
onCommentActivated: mt,
|
|
4968
|
+
onTocUpdateForTab: ze,
|
|
4969
4969
|
externalExtensions: de,
|
|
4970
4970
|
initialCommentAnchors: B,
|
|
4971
4971
|
isSuggestionMode: Pe,
|
|
4972
|
-
dBlockRuntimeStateRef:
|
|
4972
|
+
dBlockRuntimeStateRef: yt,
|
|
4973
4973
|
docSchemaVersion: P
|
|
4974
|
-
}), { handleCommentInteraction:
|
|
4974
|
+
}), { handleCommentInteraction: $e, handleCommentClick: Tt } = fp({
|
|
4975
4975
|
isFocusMode: m,
|
|
4976
4976
|
onCommentInteraction: p
|
|
4977
4977
|
}), sn = O(m);
|
|
4978
4978
|
H(() => {
|
|
4979
4979
|
sn.current = m;
|
|
4980
4980
|
}, [m]);
|
|
4981
|
-
const
|
|
4981
|
+
const un = M(
|
|
4982
4982
|
(pe, me) => {
|
|
4983
|
-
var
|
|
4983
|
+
var Ie;
|
|
4984
4984
|
if (!ps(pe, Q.current) || sn.current)
|
|
4985
4985
|
return !1;
|
|
4986
4986
|
const be = Go(me.target), Ce = be == null ? void 0 : be.closest(
|
|
4987
4987
|
"[data-suggestion-id][data-comment-id]"
|
|
4988
4988
|
), Ee = (Ce == null ? void 0 : Ce.dataset.commentId) ?? (Ce == null ? void 0 : Ce.dataset.suggestionId) ?? null;
|
|
4989
|
-
return !Ee || !(((
|
|
4989
|
+
return !Ee || !(((Ie = Ye.current) == null ? void 0 : Ie.getState().focusSubmittedSuggestionFromEditor(Ee)) ?? !1) ? !1 : (me.preventDefault(), me.stopPropagation(), pe.dom.blur(), !0);
|
|
4990
4990
|
},
|
|
4991
|
-
[
|
|
4992
|
-
),
|
|
4993
|
-
|
|
4991
|
+
[Ye]
|
|
4992
|
+
), zt = O(!0), [on, rs] = G([]), hn = O(Z);
|
|
4993
|
+
hn.current = Z, H(() => {
|
|
4994
4994
|
z && fe(null);
|
|
4995
4995
|
}, [z, fe]);
|
|
4996
4996
|
const is = M(
|
|
4997
4997
|
(pe) => {
|
|
4998
|
-
const me = !
|
|
4999
|
-
extensions:
|
|
4998
|
+
const me = !hn.current && zt.current && ve.current === pe, be = new qa({
|
|
4999
|
+
extensions: ct(pe),
|
|
5000
5000
|
editorProps: {
|
|
5001
5001
|
clipboardTextSerializer(Ce) {
|
|
5002
5002
|
return Ce.content.textBetween(0, Ce.content.size, `
|
|
@@ -5005,14 +5005,14 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5005
5005
|
},
|
|
5006
5006
|
...Rl,
|
|
5007
5007
|
handleDOMEvents: {
|
|
5008
|
-
mousedown:
|
|
5009
|
-
mouseover: (Ce, Ee) => ps(Ce, Q.current) ?
|
|
5008
|
+
mousedown: un,
|
|
5009
|
+
mouseover: (Ce, Ee) => ps(Ce, Q.current) ? $e(Ce, Ee) : !1,
|
|
5010
5010
|
keydown: (Ce, Ee) => {
|
|
5011
5011
|
if (!ps(Ce, Q.current))
|
|
5012
5012
|
return !1;
|
|
5013
5013
|
if (["ArrowUp", "ArrowDown", "Enter"].includes(Ee.key)) {
|
|
5014
|
-
const
|
|
5015
|
-
if (
|
|
5014
|
+
const Re = Ce.dom.ownerDocument, Ie = Re.getElementById("slash-command"), Be = Re.getElementById("emoji-list");
|
|
5015
|
+
if (Ie || Be)
|
|
5016
5016
|
return !0;
|
|
5017
5017
|
}
|
|
5018
5018
|
return !1;
|
|
@@ -5026,17 +5026,17 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5026
5026
|
});
|
|
5027
5027
|
}), !1)
|
|
5028
5028
|
},
|
|
5029
|
-
handleClick: (Ce, Ee,
|
|
5029
|
+
handleClick: (Ce, Ee, Re) => {
|
|
5030
5030
|
var it;
|
|
5031
5031
|
if (!ps(Ce, Q.current))
|
|
5032
5032
|
return !1;
|
|
5033
|
-
const
|
|
5033
|
+
const Ie = Re.metaKey || Re.ctrlKey, Be = Go(Re.target), xe = Be == null ? void 0 : Be.closest("a");
|
|
5034
5034
|
if (xe != null && xe.href) {
|
|
5035
5035
|
const ft = new URL(xe.href, window.location.href);
|
|
5036
5036
|
if (ft.hash && ft.origin === window.location.origin) {
|
|
5037
|
-
const
|
|
5037
|
+
const Wt = decodeURIComponent(ft.hash.slice(1)), Nt = new URLSearchParams(Wt).get("heading");
|
|
5038
5038
|
if (Nt) {
|
|
5039
|
-
|
|
5039
|
+
Re.preventDefault();
|
|
5040
5040
|
const Io = Nt.split("-").pop();
|
|
5041
5041
|
if (Io) {
|
|
5042
5042
|
const Us = Ce.dom.querySelectorAll("[data-toc-id]"), kn = Array.from(Us).find(
|
|
@@ -5064,12 +5064,12 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5064
5064
|
if (!Ce.editable)
|
|
5065
5065
|
return !1;
|
|
5066
5066
|
if (((it = xe == null ? void 0 : xe.textContent) == null ? void 0 : it.match(Vd)) ?? !1) {
|
|
5067
|
-
if (
|
|
5068
|
-
return
|
|
5067
|
+
if (Ie)
|
|
5068
|
+
return Re.preventDefault(), window.open(xe.href, "_blank"), !0;
|
|
5069
5069
|
} else
|
|
5070
|
-
return
|
|
5070
|
+
return Re.preventDefault(), window.open(xe.href, "_blank"), !0;
|
|
5071
5071
|
}
|
|
5072
|
-
return Tt ? Tt(Ce, Ee,
|
|
5072
|
+
return Tt ? Tt(Ce, Ee, Re) : !1;
|
|
5073
5073
|
},
|
|
5074
5074
|
// `...DdocEditorProps` above already sets `attributes` as ONE key
|
|
5075
5075
|
// inside this same object literal — a later `attributes:` key
|
|
@@ -5086,16 +5086,16 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5086
5086
|
textDirection: "auto",
|
|
5087
5087
|
autofocus: me ? "start" : !1
|
|
5088
5088
|
});
|
|
5089
|
-
return
|
|
5089
|
+
return zt.current = !1, be;
|
|
5090
5090
|
},
|
|
5091
5091
|
[
|
|
5092
|
-
|
|
5093
|
-
|
|
5092
|
+
ct,
|
|
5093
|
+
un,
|
|
5094
5094
|
Tt,
|
|
5095
|
-
|
|
5095
|
+
$e,
|
|
5096
5096
|
P
|
|
5097
5097
|
]
|
|
5098
|
-
), Bn = ke(() => K, [K]), xn = ke(() => !(i && !Pe), [i, Pe]),
|
|
5098
|
+
), Bn = ke(() => K, [K]), xn = ke(() => !(i && !Pe), [i, Pe]), mn = M((pe) => {
|
|
5099
5099
|
vi(pe), Jm(pe), vi(pe);
|
|
5100
5100
|
}, []), { editor: re, cachedEditorEntries: as } = np({
|
|
5101
5101
|
activeTabId: z,
|
|
@@ -5105,10 +5105,10 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5105
5105
|
editorRef: W,
|
|
5106
5106
|
readyState: xn,
|
|
5107
5107
|
createEditorForTab: is,
|
|
5108
|
-
destroyEditor:
|
|
5108
|
+
destroyEditor: mn
|
|
5109
5109
|
});
|
|
5110
5110
|
H(() => {
|
|
5111
|
-
re && (
|
|
5111
|
+
re && (zt.current = !1);
|
|
5112
5112
|
}, [re]), H(() => {
|
|
5113
5113
|
var me;
|
|
5114
5114
|
if (!re || re.isDestroyed) return;
|
|
@@ -5144,35 +5144,35 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5144
5144
|
}, [re, tt]), H(() => {
|
|
5145
5145
|
if (!i) return;
|
|
5146
5146
|
const pe = (me) => {
|
|
5147
|
-
var
|
|
5148
|
-
const be = Go(me.target), Ce = (
|
|
5147
|
+
var Re;
|
|
5148
|
+
const be = Go(me.target), Ce = (Re = Q.current) == null ? void 0 : Re.view.dom;
|
|
5149
5149
|
if (!Ce || !be || !Ce.contains(be))
|
|
5150
5150
|
return;
|
|
5151
5151
|
const Ee = be.closest("a");
|
|
5152
5152
|
if (Ee != null && Ee.href)
|
|
5153
5153
|
try {
|
|
5154
|
-
const
|
|
5155
|
-
if (!
|
|
5156
|
-
const Be = decodeURIComponent(
|
|
5154
|
+
const Ie = new URL(Ee.href, window.location.href);
|
|
5155
|
+
if (!Ie.hash || Ie.origin !== window.location.origin) return;
|
|
5156
|
+
const Be = decodeURIComponent(Ie.hash.slice(1)), it = new URLSearchParams(Be).get("heading");
|
|
5157
5157
|
if (!it) return;
|
|
5158
5158
|
const ft = it.split("-").pop();
|
|
5159
5159
|
if (ft) {
|
|
5160
5160
|
const an = Array.from(
|
|
5161
5161
|
Ce.querySelectorAll("[data-toc-id]")
|
|
5162
|
-
).find((
|
|
5163
|
-
var
|
|
5164
|
-
return (
|
|
5162
|
+
).find((Wt) => {
|
|
5163
|
+
var bt;
|
|
5164
|
+
return (bt = Wt.dataset.tocId) == null ? void 0 : bt.includes(ft);
|
|
5165
5165
|
});
|
|
5166
5166
|
if (an) {
|
|
5167
5167
|
me.preventDefault(), me.stopPropagation();
|
|
5168
|
-
const
|
|
5168
|
+
const Wt = ws({
|
|
5169
5169
|
targetElement: an,
|
|
5170
5170
|
editorRoot: Ce
|
|
5171
5171
|
});
|
|
5172
|
-
|
|
5173
|
-
const
|
|
5174
|
-
|
|
5175
|
-
top: Nt.top -
|
|
5172
|
+
Wt && requestAnimationFrame(() => {
|
|
5173
|
+
const bt = Wt.getBoundingClientRect(), Nt = an.getBoundingClientRect();
|
|
5174
|
+
Wt.scrollBy({
|
|
5175
|
+
top: Nt.top - bt.top,
|
|
5176
5176
|
behavior: "smooth"
|
|
5177
5177
|
});
|
|
5178
5178
|
});
|
|
@@ -5186,9 +5186,9 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5186
5186
|
}, [i]), H(() => {
|
|
5187
5187
|
Bn && j(!u && !Y);
|
|
5188
5188
|
}, [Bn, u, Y]);
|
|
5189
|
-
const
|
|
5189
|
+
const Ae = O(!1), At = O(null), nt = M(
|
|
5190
5190
|
(pe) => {
|
|
5191
|
-
const me = pe.map((be) =>
|
|
5191
|
+
const me = pe.map((be) => lt(be));
|
|
5192
5192
|
qe.applyUpdate(e, qe.mergeUpdates(me), "self");
|
|
5193
5193
|
},
|
|
5194
5194
|
[e]
|
|
@@ -5208,7 +5208,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5208
5208
|
return;
|
|
5209
5209
|
}
|
|
5210
5210
|
const me = `${o || "no-version-id"}:${z || "default"}`;
|
|
5211
|
-
if (!n &&
|
|
5211
|
+
if (!n && Ae.current) {
|
|
5212
5212
|
F(!1);
|
|
5213
5213
|
return;
|
|
5214
5214
|
}
|
|
@@ -5217,7 +5217,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5217
5217
|
return;
|
|
5218
5218
|
}
|
|
5219
5219
|
F(!0), queueMicrotask(() => {
|
|
5220
|
-
if (c !== "" && c !== void 0 && (st(c) ? Array.isArray(c) ? nt(c) : qe.applyUpdate(e,
|
|
5220
|
+
if (c !== "" && c !== void 0 && (st(c) ? Array.isArray(c) ? nt(c) : qe.applyUpdate(e, lt(c), "self") : re.commands.setContent(
|
|
5221
5221
|
qd({
|
|
5222
5222
|
data: c,
|
|
5223
5223
|
ignoreCorruptedData: $,
|
|
@@ -5233,7 +5233,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5233
5233
|
}).finally(() => {
|
|
5234
5234
|
be && F(!1);
|
|
5235
5235
|
});
|
|
5236
|
-
}),
|
|
5236
|
+
}), Ae.current = !0;
|
|
5237
5237
|
}, [
|
|
5238
5238
|
c,
|
|
5239
5239
|
K,
|
|
@@ -5250,14 +5250,14 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5250
5250
|
st,
|
|
5251
5251
|
ae
|
|
5252
5252
|
]);
|
|
5253
|
-
const
|
|
5254
|
-
}), Ln = O(null), wn = 3e4,
|
|
5253
|
+
const Kt = O(() => {
|
|
5254
|
+
}), Ln = O(null), wn = 3e4, jt = O(null), Vt = O(!1);
|
|
5255
5255
|
gp({
|
|
5256
5256
|
editor: re,
|
|
5257
5257
|
isReady: u,
|
|
5258
5258
|
awareness: d,
|
|
5259
5259
|
collaboration: l,
|
|
5260
|
-
collaborationCleanupRef:
|
|
5260
|
+
collaborationCleanupRef: Kt
|
|
5261
5261
|
}), H(() => {
|
|
5262
5262
|
if (!re) return;
|
|
5263
5263
|
const pe = ({ editor: me }) => {
|
|
@@ -5267,18 +5267,18 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5267
5267
|
me.state.doc.nodesBetween(
|
|
5268
5268
|
be,
|
|
5269
5269
|
Ce,
|
|
5270
|
-
(
|
|
5271
|
-
|
|
5270
|
+
(Re, Ie) => {
|
|
5271
|
+
Re.marks && Re.marks.forEach((Be) => {
|
|
5272
5272
|
Be.type.name === "textStyle" && Be.attrs.color && Ee.push({
|
|
5273
|
-
from:
|
|
5274
|
-
to:
|
|
5273
|
+
from: Ie,
|
|
5274
|
+
to: Ie + Re.nodeSize,
|
|
5275
5275
|
mark: Be
|
|
5276
5276
|
});
|
|
5277
5277
|
});
|
|
5278
5278
|
}
|
|
5279
|
-
), me.chain().setTextSelection({ from: be, to: Ce }).setColor("").run(), Ee.forEach(({ from:
|
|
5279
|
+
), me.chain().setTextSelection({ from: be, to: Ce }).setColor("").run(), Ee.forEach(({ from: Re, to: Ie, mark: Be }) => {
|
|
5280
5280
|
const xe = Be.attrs.color;
|
|
5281
|
-
Ga(xe) || me.chain().setTextSelection({ from:
|
|
5281
|
+
Ga(xe) || me.chain().setTextSelection({ from: Re, to: Ie }).setColor(xe).run();
|
|
5282
5282
|
}), me.commands.setTextSelection(Ce);
|
|
5283
5283
|
}, 0);
|
|
5284
5284
|
};
|
|
@@ -5286,26 +5286,26 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5286
5286
|
re.off("paste", pe);
|
|
5287
5287
|
};
|
|
5288
5288
|
}, [re]);
|
|
5289
|
-
const Rt = O(null), It = O(null), pt = O(0),
|
|
5289
|
+
const Rt = O(null), It = O(null), pt = O(0), xt = O(
|
|
5290
5290
|
null
|
|
5291
5291
|
), bn = O({}), _n = O(0), Cn = O(I);
|
|
5292
5292
|
H(() => {
|
|
5293
5293
|
Cn.current = I;
|
|
5294
5294
|
});
|
|
5295
|
-
const
|
|
5296
|
-
|
|
5295
|
+
const De = O(null);
|
|
5296
|
+
De.current || (De.current = op(
|
|
5297
5297
|
(pe) => {
|
|
5298
5298
|
var me;
|
|
5299
5299
|
return (me = Cn.current) == null ? void 0 : me.call(Cn, pe);
|
|
5300
5300
|
}
|
|
5301
5301
|
));
|
|
5302
|
-
const Dt =
|
|
5302
|
+
const Dt = De.current, Jt = !!I;
|
|
5303
5303
|
H(() => {
|
|
5304
5304
|
if (!T && !Jt)
|
|
5305
5305
|
return;
|
|
5306
5306
|
const pe = $d();
|
|
5307
|
-
return
|
|
5308
|
-
|
|
5307
|
+
return xt.current = pe, () => {
|
|
5308
|
+
xt.current === pe && (xt.current = null), pe.destroy();
|
|
5309
5309
|
};
|
|
5310
5310
|
}, [T, Jt]), H(() => {
|
|
5311
5311
|
if (!re || !S && !w && !b && !T && !Jt)
|
|
@@ -5318,8 +5318,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5318
5318
|
b == null || b(0), Dt.publish({ selectedWords: 0 });
|
|
5319
5319
|
return;
|
|
5320
5320
|
}
|
|
5321
|
-
const
|
|
5322
|
-
b == null || b(
|
|
5321
|
+
const Ie = re.state.doc.textBetween(be, Ce, " ", " ").split(" ").filter((Be) => Be !== "").length;
|
|
5322
|
+
b == null || b(Ie), Dt.publish({ selectedWords: Ie });
|
|
5323
5323
|
}, me = (be) => {
|
|
5324
5324
|
var Ce;
|
|
5325
5325
|
be ? [
|
|
@@ -5331,10 +5331,10 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5331
5331
|
if (Rt.current = null, re && Q.current === re && !re.isDestroyed) {
|
|
5332
5332
|
const Ee = re.storage.characterCount.characters() ?? 0;
|
|
5333
5333
|
S == null || S(Ee);
|
|
5334
|
-
const
|
|
5335
|
-
if (w == null || w(
|
|
5336
|
-
const
|
|
5337
|
-
if (!
|
|
5334
|
+
const Re = re.storage.characterCount.words() ?? 0;
|
|
5335
|
+
if (w == null || w(Re), Dt.publish({ characters: Ee, words: Re }, { tick: !0 }), T || Jt) {
|
|
5336
|
+
const Ie = xt.current;
|
|
5337
|
+
if (!Ie)
|
|
5338
5338
|
return;
|
|
5339
5339
|
const Be = bn.current[z];
|
|
5340
5340
|
if (Be && Ee > ip && Be.structuralVersion === _n.current && Math.abs(Ee - Be.characters) < Be.characters * ap && Date.now() - Be.at < lp) {
|
|
@@ -5351,18 +5351,18 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5351
5351
|
eo(It.current), It.current = Ji(() => {
|
|
5352
5352
|
if (It.current = null, xe !== pt.current || Q.current !== re || re.isDestroyed)
|
|
5353
5353
|
return;
|
|
5354
|
-
const ft = re.getHTML(), an = re.state.doc === it ? Ee : re.storage.characterCount.characters() ?? 0,
|
|
5355
|
-
|
|
5354
|
+
const ft = re.getHTML(), an = re.state.doc === it ? Ee : re.storage.characterCount.characters() ?? 0, Wt = _n.current;
|
|
5355
|
+
Ie.getPageCount(ft).then((bt) => {
|
|
5356
5356
|
xe === pt.current && Q.current === re && re && !re.isDestroyed && (bn.current[z] = {
|
|
5357
5357
|
characters: an,
|
|
5358
|
-
pageCount:
|
|
5358
|
+
pageCount: bt,
|
|
5359
5359
|
at: Date.now(),
|
|
5360
|
-
structuralVersion:
|
|
5361
|
-
}, T == null || T(
|
|
5360
|
+
structuralVersion: Wt
|
|
5361
|
+
}, T == null || T(bt), Dt.publish({ pages: bt }));
|
|
5362
5362
|
}).catch(() => {
|
|
5363
|
-
var
|
|
5363
|
+
var bt;
|
|
5364
5364
|
if (xe === pt.current && Q.current === re && re && !re.isDestroyed) {
|
|
5365
|
-
const Nt = ((
|
|
5365
|
+
const Nt = ((bt = bn.current[z]) == null ? void 0 : bt.pageCount) ?? 1;
|
|
5366
5366
|
T == null || T(Nt), Dt.publish({ pages: Nt });
|
|
5367
5367
|
}
|
|
5368
5368
|
});
|
|
@@ -5385,28 +5385,28 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5385
5385
|
Dt
|
|
5386
5386
|
]), H(() => {
|
|
5387
5387
|
const pe = (me) => {
|
|
5388
|
-
(me.ctrlKey || me.metaKey) && me.key === "p" && (me.preventDefault(), re && (V ? Ya(
|
|
5388
|
+
(me.ctrlKey || me.metaKey) && me.key === "p" && (me.preventDefault(), re && (V ? Ya(on) : Tr(re.getHTML())));
|
|
5389
5389
|
};
|
|
5390
5390
|
return window.addEventListener("keydown", pe), () => {
|
|
5391
5391
|
window.removeEventListener("keydown", pe);
|
|
5392
5392
|
};
|
|
5393
|
-
}, [re, V,
|
|
5393
|
+
}, [re, V, on]), H(() => {
|
|
5394
5394
|
if (!K || !D) return;
|
|
5395
5395
|
const pe = D.livePresence === !0 || D.connectOnOpen === !0, me = () => {
|
|
5396
|
-
|
|
5396
|
+
Vt.current || (Vt.current = !0, ne(D));
|
|
5397
5397
|
}, be = () => {
|
|
5398
|
-
|
|
5398
|
+
Vt.current && (Vt.current = !1, se());
|
|
5399
5399
|
}, Ce = () => {
|
|
5400
|
-
|
|
5401
|
-
|
|
5400
|
+
jt.current && clearTimeout(jt.current), jt.current = setTimeout(() => {
|
|
5401
|
+
jt.current = null, D.livePresence !== !0 && D.connectOnOpen !== !0 && be();
|
|
5402
5402
|
}, wn);
|
|
5403
5403
|
};
|
|
5404
5404
|
pe && me();
|
|
5405
|
-
const Ee = (
|
|
5406
|
-
|
|
5405
|
+
const Ee = (Re, Ie) => {
|
|
5406
|
+
Ie === "self" || Ie === "remote" || !ge || (me(), Ce());
|
|
5407
5407
|
};
|
|
5408
5408
|
return e == null || e.on("update", Ee), () => {
|
|
5409
|
-
e == null || e.off("update", Ee),
|
|
5409
|
+
e == null || e.off("update", Ee), jt.current && (clearTimeout(jt.current), jt.current = null);
|
|
5410
5410
|
};
|
|
5411
5411
|
}, [
|
|
5412
5412
|
K,
|
|
@@ -5420,7 +5420,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5420
5420
|
se,
|
|
5421
5421
|
ge
|
|
5422
5422
|
]);
|
|
5423
|
-
const Ro = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, { isNativeMobile: Un } =
|
|
5423
|
+
const Ro = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, { isNativeMobile: Un } = Yt(t), Pn = new URLSearchParams(Ro), dt = Pn.get("heading"), vn = dt == null ? void 0 : dt.split("-").pop(), rn = M(
|
|
5424
5424
|
(pe) => {
|
|
5425
5425
|
if (re)
|
|
5426
5426
|
try {
|
|
@@ -5435,8 +5435,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5435
5435
|
be == null ? void 0 : be.textContent
|
|
5436
5436
|
), Ee = dt == null ? void 0 : dt.split("-").slice(0, -1).join("-");
|
|
5437
5437
|
Ce !== Ee && (Pn.set("heading", `${Ce}-${pe}`), window.location.hash = Pn.toString());
|
|
5438
|
-
const
|
|
5439
|
-
|
|
5438
|
+
const Re = re.view.posAtDOM(be, 0), Ie = re.view.state.tr;
|
|
5439
|
+
Ie.setSelection(new bs(Ie.doc.resolve(Re))), re.view.dispatch(Ie);
|
|
5440
5440
|
const Be = ws({
|
|
5441
5441
|
targetElement: be,
|
|
5442
5442
|
editorRoot: re.view.dom
|
|
@@ -5471,24 +5471,24 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5471
5471
|
const pe = setTimeout(() => {
|
|
5472
5472
|
const { tr: me, doc: be } = re.state;
|
|
5473
5473
|
let Ce = !1;
|
|
5474
|
-
be.descendants((Ee,
|
|
5474
|
+
be.descendants((Ee, Re) => {
|
|
5475
5475
|
if (!Ee.marks || Ee.marks.length === 0) return;
|
|
5476
|
-
const
|
|
5476
|
+
const Ie = Ee.marks.find(
|
|
5477
5477
|
(it) => it.type.name === "textStyle" && it.attrs.color
|
|
5478
5478
|
);
|
|
5479
|
-
if (!
|
|
5480
|
-
const Be =
|
|
5479
|
+
if (!Ie) return;
|
|
5480
|
+
const Be = Ie.attrs["data-original-color"] || Ie.attrs.color;
|
|
5481
5481
|
if (Be.startsWith("var(--color-editor-") || Be === "inherit")
|
|
5482
5482
|
return;
|
|
5483
5483
|
const xe = Gd(Be, le);
|
|
5484
|
-
if (xe !==
|
|
5484
|
+
if (xe !== Ie.attrs.color) {
|
|
5485
5485
|
Ce = !0;
|
|
5486
|
-
const it =
|
|
5487
|
-
...
|
|
5486
|
+
const it = Ie.type.create({
|
|
5487
|
+
...Ie.attrs,
|
|
5488
5488
|
color: xe,
|
|
5489
5489
|
"data-original-color": Be
|
|
5490
5490
|
});
|
|
5491
|
-
me.removeMark(
|
|
5491
|
+
me.removeMark(Re, Re + Ee.nodeSize, Ie), me.addMark(Re, Re + Ee.nodeSize, it);
|
|
5492
5492
|
}
|
|
5493
5493
|
}), Ce && (me.setMeta("addToHistory", !1), re.view.dispatch(me));
|
|
5494
5494
|
}, 0);
|
|
@@ -5501,9 +5501,9 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5501
5501
|
editor: re,
|
|
5502
5502
|
cachedEditorEntries: as,
|
|
5503
5503
|
ref: Ln,
|
|
5504
|
-
slides:
|
|
5504
|
+
slides: on,
|
|
5505
5505
|
setSlides: rs,
|
|
5506
|
-
tocItems:
|
|
5506
|
+
tocItems: Me,
|
|
5507
5507
|
setTocItems: Te,
|
|
5508
5508
|
activeCommentId: ee,
|
|
5509
5509
|
setActiveCommentId: fe,
|
|
@@ -5511,7 +5511,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5511
5511
|
isContentLoading: L,
|
|
5512
5512
|
commentAnchorsRef: Ke,
|
|
5513
5513
|
draftAnchorsRef: Ht,
|
|
5514
|
-
storeApiRef:
|
|
5514
|
+
storeApiRef: Ye
|
|
5515
5515
|
};
|
|
5516
5516
|
}, hp = () => {
|
|
5517
5517
|
const [e, t] = G(null), n = O(null), s = M((o) => {
|
|
@@ -5903,7 +5903,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5903
5903
|
}, 100);
|
|
5904
5904
|
return () => window.clearTimeout(i);
|
|
5905
5905
|
}, [e, t, n]);
|
|
5906
|
-
}, jr = (e) =>
|
|
5906
|
+
}, jr = (e) => St(e).parentById.size > 0, gr = (e) => (e == null ? void 0 : e.depth) ?? 1, Xn = (e, t) => {
|
|
5907
5907
|
const n = e.findIndex((i) => i.id === t);
|
|
5908
5908
|
if (n === -1) return [];
|
|
5909
5909
|
const s = gr(e[n]), o = [t];
|
|
@@ -5917,7 +5917,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5917
5917
|
const n = e.toArray(), s = Math.max(-1, ...t.map((o) => n.indexOf(o)));
|
|
5918
5918
|
return s === -1 ? n.length : s + 1;
|
|
5919
5919
|
}, wp = (e, t, n) => {
|
|
5920
|
-
const s =
|
|
5920
|
+
const s = St(e), o = s.parentById.get(t);
|
|
5921
5921
|
e.transact(() => {
|
|
5922
5922
|
if (o === void 0) {
|
|
5923
5923
|
s.order.push(n);
|
|
@@ -5927,7 +5927,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5927
5927
|
n.forEach((a) => s.parentById.set(a, o)), s.order.insert(To(s.order, i), n);
|
|
5928
5928
|
});
|
|
5929
5929
|
}, bp = (e, t, n, s) => {
|
|
5930
|
-
const o =
|
|
5930
|
+
const o = St(e), i = ss(o), a = i.find((u) => u.id === t);
|
|
5931
5931
|
if (!a || !xp(a)) return null;
|
|
5932
5932
|
const c = Xn(i, t), l = i.filter((u) => u.parentId === t).length;
|
|
5933
5933
|
return e.transact(() => {
|
|
@@ -5936,7 +5936,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5936
5936
|
]);
|
|
5937
5937
|
}), n;
|
|
5938
5938
|
}, Cp = (e, t, n) => {
|
|
5939
|
-
const s =
|
|
5939
|
+
const s = St(e), { order: o } = s;
|
|
5940
5940
|
if (!jr(e)) {
|
|
5941
5941
|
const h = o.toArray(), m = h.indexOf(n), p = h.indexOf(t);
|
|
5942
5942
|
return m === -1 || p === -1 ? !1 : (e.transact(() => {
|
|
@@ -5952,7 +5952,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5952
5952
|
o.insert(h, l);
|
|
5953
5953
|
}), !0;
|
|
5954
5954
|
}, vp = (e, t, n, s) => {
|
|
5955
|
-
const o =
|
|
5955
|
+
const o = St(e), { order: i } = o, a = Yn(o, t);
|
|
5956
5956
|
if (!a) return;
|
|
5957
5957
|
if (!jr(e)) {
|
|
5958
5958
|
const m = n();
|
|
@@ -5982,7 +5982,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
5982
5982
|
}), h;
|
|
5983
5983
|
}, kp = (e, t, n, s) => {
|
|
5984
5984
|
var f, x;
|
|
5985
|
-
const o =
|
|
5985
|
+
const o = St(e), { order: i } = o;
|
|
5986
5986
|
if (!jr(e)) {
|
|
5987
5987
|
if (i.length <= 1)
|
|
5988
5988
|
throw new Error("Cannot delete the last remaining tab");
|
|
@@ -6024,7 +6024,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
6024
6024
|
}), p && s && o.tabState.set("activeTabId", p), Il(i, u);
|
|
6025
6025
|
}), { snapshots: h, fallbackId: p };
|
|
6026
6026
|
}, Sp = (e, t, n) => {
|
|
6027
|
-
const s =
|
|
6027
|
+
const s = St(e), { order: o } = s, i = t.filter(
|
|
6028
6028
|
(c) => !s.nameById.has(c.tabId)
|
|
6029
6029
|
);
|
|
6030
6030
|
if (i.length === 0) return !1;
|
|
@@ -6042,7 +6042,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
6042
6042
|
}, Np = (e) => {
|
|
6043
6043
|
const t = O([]), n = O([]), s = O(!1), o = M(
|
|
6044
6044
|
(l, u) => {
|
|
6045
|
-
const d =
|
|
6045
|
+
const d = St(e);
|
|
6046
6046
|
if (!Yn(d, l.tabId))
|
|
6047
6047
|
return !1;
|
|
6048
6048
|
const m = u === "undo" ? l.previousName : l.nextName, p = u === "undo" ? l.previousEmoji : l.nextEmoji;
|
|
@@ -6067,7 +6067,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
6067
6067
|
return {
|
|
6068
6068
|
applyRename: M(
|
|
6069
6069
|
({ tabId: l, newName: u, emoji: d }) => {
|
|
6070
|
-
const h =
|
|
6070
|
+
const h = St(e), m = Yn(h, l);
|
|
6071
6071
|
if (!m)
|
|
6072
6072
|
return { tabNotFound: !0 };
|
|
6073
6073
|
const p = m.name, f = m.emoji, x = u ?? p, g = d ?? f, y = u !== void 0 && x !== p, R = d !== void 0 && g !== f;
|
|
@@ -6189,7 +6189,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
6189
6189
|
k(L);
|
|
6190
6190
|
return;
|
|
6191
6191
|
}
|
|
6192
|
-
const z =
|
|
6192
|
+
const z = St(e);
|
|
6193
6193
|
e.transact(() => {
|
|
6194
6194
|
z.tabState.set("activeTabId", L);
|
|
6195
6195
|
}, "self"), k(L);
|
|
@@ -6204,40 +6204,40 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
6204
6204
|
L.didWrite && x(), a && mo(L) !== w.current && e.transact(() => {
|
|
6205
6205
|
L.tabState.set("activeTabId", w.current);
|
|
6206
6206
|
}, "self");
|
|
6207
|
-
const z =
|
|
6207
|
+
const z = St(e), _ = (q = L, P = !1) => {
|
|
6208
6208
|
var ce;
|
|
6209
|
-
const K = ss(q), D = q.order.toArray(), ee = new Set(K.map((
|
|
6209
|
+
const K = ss(q), D = q.order.toArray(), ee = new Set(K.map((Me) => Me.id)), fe = b.current;
|
|
6210
6210
|
b.current = ee;
|
|
6211
6211
|
const oe = c ? ee.has(c) : !1;
|
|
6212
6212
|
C(K);
|
|
6213
6213
|
const ve = mo(q), Q = ((ce = K[0]) == null ? void 0 : ce.id) ?? (D.length > 0 ? D[0] : et);
|
|
6214
6214
|
if (a) {
|
|
6215
|
-
const
|
|
6215
|
+
const Me = ve && ee.has(ve) ? ve : Q;
|
|
6216
6216
|
k(
|
|
6217
|
-
(Te) => Te ===
|
|
6217
|
+
(Te) => Te === Me ? Te : Me
|
|
6218
6218
|
);
|
|
6219
6219
|
} else if (c && oe && R.current !== c)
|
|
6220
6220
|
R.current = c, k(
|
|
6221
|
-
(
|
|
6221
|
+
(Me) => Me === c ? Me : c
|
|
6222
6222
|
);
|
|
6223
6223
|
else {
|
|
6224
|
-
const
|
|
6224
|
+
const Me = (Ue) => {
|
|
6225
6225
|
if (ee.has(Ue)) return Ue;
|
|
6226
6226
|
const Pe = /* @__PURE__ */ new Set([Ue]);
|
|
6227
|
-
let
|
|
6228
|
-
for (;
|
|
6229
|
-
if (ee.has(
|
|
6230
|
-
Pe.add(
|
|
6227
|
+
let Je = q.parentById.get(Ue);
|
|
6228
|
+
for (; Je && !Pe.has(Je); ) {
|
|
6229
|
+
if (ee.has(Je)) return Je;
|
|
6230
|
+
Pe.add(Je), Je = q.parentById.get(Je);
|
|
6231
6231
|
}
|
|
6232
6232
|
return Q;
|
|
6233
6233
|
}, Te = w.current;
|
|
6234
|
-
P && q.parentById.size > 0 && fe.has(Te) &&
|
|
6234
|
+
P && q.parentById.size > 0 && fe.has(Te) && Me(Te) !== Te && uo({
|
|
6235
6235
|
title: "This tab was deleted",
|
|
6236
6236
|
description: "Someone else deleted the tab you were in."
|
|
6237
|
-
}), k(
|
|
6237
|
+
}), k(Me);
|
|
6238
6238
|
}
|
|
6239
6239
|
}, le = (q, P) => {
|
|
6240
|
-
_(
|
|
6240
|
+
_(St(e), !P.local);
|
|
6241
6241
|
}, W = e.getMap(ph), B = () => {
|
|
6242
6242
|
const q = _i(
|
|
6243
6243
|
e,
|
|
@@ -6261,7 +6261,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
6261
6261
|
d
|
|
6262
6262
|
]);
|
|
6263
6263
|
const V = M(() => {
|
|
6264
|
-
const L =
|
|
6264
|
+
const L = St(e), z = L.order, _ = Yo(), le = {
|
|
6265
6265
|
name: `Tab ${z.length + 1}`,
|
|
6266
6266
|
emoji: null,
|
|
6267
6267
|
id: _
|
|
@@ -6373,7 +6373,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
6373
6373
|
orderTab: ae
|
|
6374
6374
|
};
|
|
6375
6375
|
};
|
|
6376
|
-
var
|
|
6376
|
+
var qt = /* @__PURE__ */ ((e) => (e.AUTH_TOKEN_MISSING = "AUTH_TOKEN_MISSING", e.AUTH_TOKEN_INVALID = "AUTH_TOKEN_INVALID", e.SESSION_NOT_FOUND = "SESSION_NOT_FOUND", e.SESSION_TERMINATED = "SESSION_TERMINATED", e.SESSION_DID_MISSING = "SESSION_DID_MISSING", e.DOCUMENT_ID_MISSING = "DOCUMENT_ID_MISSING", e.UPDATE_DATA_MISSING = "UPDATE_DATA_MISSING", e.COMMIT_UNAUTHORIZED = "COMMIT_UNAUTHORIZED", e.COMMIT_MISSING_DATA = "COMMIT_MISSING_DATA", e.INVALID_ADDRESS = "INVALID_ADDRESS", e.NOT_AUTHENTICATED = "NOT_AUTHENTICATED", e.DB_ERROR = "DB_ERROR", e.INTERNAL_ERROR = "INTERNAL_ERROR", e.JOIN_DISABLED = "JOIN_DISABLED", e.EDIT_REVOKED = "EDIT_REVOKED", e.ROOM_NOT_ESTABLISHED = "ROOM_NOT_ESTABLISHED", e.WIRE_FORMAT_UNSUPPORTED = "WIRE_FORMAT_UNSUPPORTED", e))(qt || {}), ot = /* @__PURE__ */ ((e) => (e.CLOSED = "CLOSED", e.CONNECTED = "CONNECTED", e.CONNECTING = "CONNECTING", e.DISCONNECTING = "DISCONNECTING", e.DISCONNECTED = "DISCONNECTED", e))(ot || {});
|
|
6377
6377
|
const Dl = "#9CA3AF", Xo = [
|
|
6378
6378
|
"#30bced",
|
|
6379
6379
|
"#6eeb83",
|
|
@@ -6462,11 +6462,11 @@ const Dp = "FVXC1", yr = "__n__", Ml = Dp + yr, Mp = new TextEncoder().encode(
|
|
|
6462
6462
|
const n = t.split(yr);
|
|
6463
6463
|
if (n.length !== 3 || !n[1] || !n[2])
|
|
6464
6464
|
throw new Error("Invalid FVXC1 wire format");
|
|
6465
|
-
const s =
|
|
6465
|
+
const s = lt(n[1]);
|
|
6466
6466
|
if (s.length !== na)
|
|
6467
6467
|
throw new Error("Invalid FVXC1 nonce length");
|
|
6468
6468
|
return Ui(sa(e), s).decrypt(
|
|
6469
|
-
|
|
6469
|
+
lt(n[2])
|
|
6470
6470
|
);
|
|
6471
6471
|
}
|
|
6472
6472
|
return Th(e, t);
|
|
@@ -6632,7 +6632,7 @@ class Vr {
|
|
|
6632
6632
|
wireFormats: ["ecies", "xchacha"]
|
|
6633
6633
|
};
|
|
6634
6634
|
this.roomInfo && (s.roomInfo = Bt.encryptData(
|
|
6635
|
-
|
|
6635
|
+
lt(this.roomKey),
|
|
6636
6636
|
new TextEncoder().encode(JSON.stringify(this.roomInfo)),
|
|
6637
6637
|
this.wireFormat
|
|
6638
6638
|
)), this.ownerKeyPair && (s.ownerToken = await this.getOwnerToken()), this.ownerAddress && (s.ownerAddress = this.ownerAddress), this.contractAddress && (s.contractAddress = this.contractAddress), this.ddocId && (s.ddocId = this.ddocId), this.identityToken && (s.identityToken = this.identityToken);
|
|
@@ -6673,7 +6673,7 @@ class Vr {
|
|
|
6673
6673
|
if (n)
|
|
6674
6674
|
try {
|
|
6675
6675
|
const o = Bt.decryptData(
|
|
6676
|
-
|
|
6676
|
+
lt(n),
|
|
6677
6677
|
s
|
|
6678
6678
|
);
|
|
6679
6679
|
vh(
|
|
@@ -6696,7 +6696,7 @@ class Vr {
|
|
|
6696
6696
|
});
|
|
6697
6697
|
this._socketUrl = t.wsUrl || "ws://localhost:5000", this._restBase = (t.wsUrl || "http://localhost:5000").replace(/^ws(s?):\/\//, "http$1://").replace(/\/+$/, "");
|
|
6698
6698
|
const { secretKey: n } = qo(
|
|
6699
|
-
|
|
6699
|
+
lt(t.roomKey)
|
|
6700
6700
|
);
|
|
6701
6701
|
this.roomKey = t.roomKey, this.roomId = t.roomId, this.collaborationKeyPair = tn.EdKeypair.fromSecretKey(
|
|
6702
6702
|
_t(n)
|
|
@@ -6848,7 +6848,7 @@ class Vr {
|
|
|
6848
6848
|
const o = this.roomKey, i = this.editLock;
|
|
6849
6849
|
try {
|
|
6850
6850
|
s && (this.lastGoodEditUcan = s), this.roomKey = t;
|
|
6851
|
-
const { secretKey: a } = qo(
|
|
6851
|
+
const { secretKey: a } = qo(lt(t));
|
|
6852
6852
|
this.collaborationKeyPair = tn.EdKeypair.fromSecretKey(
|
|
6853
6853
|
_t(a)
|
|
6854
6854
|
), this.collaborationUcan = void 0, n !== void 0 && (this.editLock = n);
|
|
@@ -6860,7 +6860,7 @@ class Vr {
|
|
|
6860
6860
|
this._webSocketStatus = ot.CONNECTED;
|
|
6861
6861
|
} catch (a) {
|
|
6862
6862
|
this.roomKey = o;
|
|
6863
|
-
const { secretKey: c } = qo(
|
|
6863
|
+
const { secretKey: c } = qo(lt(o));
|
|
6864
6864
|
throw this.collaborationKeyPair = tn.EdKeypair.fromSecretKey(
|
|
6865
6865
|
_t(c)
|
|
6866
6866
|
), this.collaborationUcan = void 0, this.editLock = i, a;
|
|
@@ -7017,7 +7017,7 @@ class Vr {
|
|
|
7017
7017
|
]), u = this.roomKey;
|
|
7018
7018
|
if (u) {
|
|
7019
7019
|
const d = Bt.encryptData(
|
|
7020
|
-
|
|
7020
|
+
lt(u),
|
|
7021
7021
|
l,
|
|
7022
7022
|
this.wireFormat
|
|
7023
7023
|
);
|
|
@@ -7037,7 +7037,7 @@ const ia = (e, t, n, s) => {
|
|
|
7037
7037
|
const u = Dh(e, l);
|
|
7038
7038
|
if (t.isConnected) {
|
|
7039
7039
|
const d = Bt.encryptData(
|
|
7040
|
-
|
|
7040
|
+
lt(n),
|
|
7041
7041
|
u,
|
|
7042
7042
|
s()
|
|
7043
7043
|
);
|
|
@@ -7079,7 +7079,7 @@ function Wp(e, t) {
|
|
|
7079
7079
|
o.decrypted || (s = !0), !s && o.isTail && typeof o.seq == "number" && n.push(o.seq);
|
|
7080
7080
|
return { seqs: n, incomplete: s };
|
|
7081
7081
|
}
|
|
7082
|
-
const
|
|
7082
|
+
const gn = {
|
|
7083
7083
|
hasUnmergedPeerUpdates: !1,
|
|
7084
7084
|
reconnectAttempt: 0,
|
|
7085
7085
|
maxReconnectAttempts: 3,
|
|
@@ -7101,7 +7101,7 @@ function qp(e, t, n) {
|
|
|
7101
7101
|
} : s === "SESSION_TERMINATED" ? {
|
|
7102
7102
|
status: "terminated",
|
|
7103
7103
|
context: { terminationReason: t.reason }
|
|
7104
|
-
} : s === "RESET" ? { status: "idle", context: { ...
|
|
7104
|
+
} : s === "RESET" ? { status: "idle", context: { ...gn } } : null;
|
|
7105
7105
|
case "syncing":
|
|
7106
7106
|
return s === "SYNC_COMPLETE" ? { status: "ready", context: { hasUnmergedPeerUpdates: !1 } } : s === "SOCKET_DROPPED" ? {
|
|
7107
7107
|
status: "reconnecting",
|
|
@@ -7118,7 +7118,7 @@ function qp(e, t, n) {
|
|
|
7118
7118
|
} : s === "SESSION_TERMINATED" ? {
|
|
7119
7119
|
status: "terminated",
|
|
7120
7120
|
context: { terminationReason: t.reason }
|
|
7121
|
-
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...
|
|
7121
|
+
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...gn } } : null;
|
|
7122
7122
|
case "ready":
|
|
7123
7123
|
return s === "SOCKET_DROPPED" ? {
|
|
7124
7124
|
status: "reconnecting",
|
|
@@ -7129,7 +7129,7 @@ function qp(e, t, n) {
|
|
|
7129
7129
|
} : s === "ERROR" ? {
|
|
7130
7130
|
status: "error",
|
|
7131
7131
|
context: { error: t.error }
|
|
7132
|
-
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...
|
|
7132
|
+
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...gn } } : null;
|
|
7133
7133
|
case "reconnecting":
|
|
7134
7134
|
return s === "RECONNECTED" ? {
|
|
7135
7135
|
status: "syncing",
|
|
@@ -7154,11 +7154,11 @@ function qp(e, t, n) {
|
|
|
7154
7154
|
} : s === "SESSION_TERMINATED" ? {
|
|
7155
7155
|
status: "terminated",
|
|
7156
7156
|
context: { terminationReason: t.reason }
|
|
7157
|
-
} : s === "RESET" ? { status: "idle", context: { ...
|
|
7157
|
+
} : s === "RESET" ? { status: "idle", context: { ...gn } } : null;
|
|
7158
7158
|
case "error":
|
|
7159
|
-
return s === "RESET" ? { status: "idle", context: { ...
|
|
7159
|
+
return s === "RESET" ? { status: "idle", context: { ...gn } } : null;
|
|
7160
7160
|
case "terminated":
|
|
7161
|
-
return s === "RESET" ? { status: "idle", context: { ...
|
|
7161
|
+
return s === "RESET" ? { status: "idle", context: { ...gn } } : null;
|
|
7162
7162
|
default:
|
|
7163
7163
|
return null;
|
|
7164
7164
|
}
|
|
@@ -7213,7 +7213,7 @@ class Zp {
|
|
|
7213
7213
|
constructor(t, n) {
|
|
7214
7214
|
// --- State machine ---
|
|
7215
7215
|
J(this, "_status", "idle");
|
|
7216
|
-
J(this, "_context", { ...
|
|
7216
|
+
J(this, "_context", { ...gn });
|
|
7217
7217
|
J(this, "_awareness", null);
|
|
7218
7218
|
// --- Internal state ---
|
|
7219
7219
|
J(this, "socketClient", null);
|
|
@@ -7394,7 +7394,7 @@ class Zp {
|
|
|
7394
7394
|
var o, i;
|
|
7395
7395
|
if (this._status !== "idle") return;
|
|
7396
7396
|
const n = ++this.sessionGen;
|
|
7397
|
-
this.resuming || (this.updateQueue = []), this.resumable = !1, this.lastConnectConfig = t, this.roomKey = t.roomKey, this.roomKeyBytes =
|
|
7397
|
+
this.resuming || (this.updateQueue = []), this.resumable = !1, this.lastConnectConfig = t, this.roomKey = t.roomKey, this.roomKeyBytes = lt(t.roomKey), this.isOwner = t.isOwner, this.joinOnly = t.joinOnly ?? !1, this.encryptMirror = t.encryptMirror ?? null, this.fileKeyEpoch = t.fileKeyEpoch ?? 0, this.socketClient = new Vr({
|
|
7398
7398
|
wsUrl: t.wsUrl,
|
|
7399
7399
|
roomKey: t.roomKey,
|
|
7400
7400
|
roomId: t.roomId,
|
|
@@ -7542,7 +7542,7 @@ class Zp {
|
|
|
7542
7542
|
return;
|
|
7543
7543
|
this.rotating = !0;
|
|
7544
7544
|
const o = this.sessionGen, i = this.roomKey;
|
|
7545
|
-
this.roomKeyBytesPrev = this.roomKeyBytes, this.roomKey = t, this.roomKeyBytes =
|
|
7545
|
+
this.roomKeyBytesPrev = this.roomKeyBytes, this.roomKey = t, this.roomKeyBytes = lt(t);
|
|
7546
7546
|
try {
|
|
7547
7547
|
if (await ((a = this.socketClient) == null ? void 0 : a.rekey(t, n, s)), o === this.sessionGen && this.lastConnectConfig && (this.lastConnectConfig = {
|
|
7548
7548
|
...this.lastConnectConfig,
|
|
@@ -7583,7 +7583,7 @@ class Zp {
|
|
|
7583
7583
|
return this.rotating || !t ? Promise.resolve("failed") : (this.healingPromise = (async () => {
|
|
7584
7584
|
try {
|
|
7585
7585
|
const s = await t();
|
|
7586
|
-
return s ? this.roomKeyBytes && Qp(
|
|
7586
|
+
return s ? this.roomKeyBytes && Qp(lt(s), this.roomKeyBytes) ? "current-key-ok" : (await this.rekey(s), this.healBackoffUntil = 0, "rekeyed") : (console.warn(
|
|
7587
7587
|
"SyncManager: rotation self-heal yielded no key (post-rotation blob may not be anchored yet)"
|
|
7588
7588
|
), this.healBackoffUntil = Date.now() + to, "failed");
|
|
7589
7589
|
} catch (s) {
|
|
@@ -7761,13 +7761,13 @@ class Zp {
|
|
|
7761
7761
|
}
|
|
7762
7762
|
}
|
|
7763
7763
|
isRevocationResponse(t) {
|
|
7764
|
-
return (t == null ? void 0 : t.statusCode) === 403 && (t.errorCode ===
|
|
7764
|
+
return (t == null ? void 0 : t.statusCode) === 403 && (t.errorCode === qt.JOIN_DISABLED || t.errorCode === qt.EDIT_REVOKED);
|
|
7765
7765
|
}
|
|
7766
7766
|
// A write ack'd 409/SESSION_TERMINATED means this session's old sessionDid was cut over
|
|
7767
7767
|
// out from under an in-flight write — distinct from isRevocationResponse's 403s, and the
|
|
7768
7768
|
// fix is a decrypt-miss self-heal, not a reconnect.
|
|
7769
7769
|
isSessionTerminatedResponse(t) {
|
|
7770
|
-
return (t == null ? void 0 : t.statusCode) === 409 && t.errorCode ===
|
|
7770
|
+
return (t == null ? void 0 : t.statusCode) === 409 && t.errorCode === qt.SESSION_TERMINATED;
|
|
7771
7771
|
}
|
|
7772
7772
|
// A write ack'd 404/SESSION_NOT_FOUND means the server has no runtime session for this
|
|
7773
7773
|
// sessionDid: a live editor whose OLD session was terminated by a rotation drain it never
|
|
@@ -7775,7 +7775,7 @@ class Zp {
|
|
|
7775
7775
|
// resolve the current-epoch roomKey and rekey — NOT a plain reconnect, which would just
|
|
7776
7776
|
// re-auth back into the same dead sessionDid.
|
|
7777
7777
|
isSessionNotFoundResponse(t) {
|
|
7778
|
-
return (t == null ? void 0 : t.statusCode) === 404 && t.errorCode ===
|
|
7778
|
+
return (t == null ? void 0 : t.statusCode) === 404 && t.errorCode === qt.SESSION_NOT_FOUND;
|
|
7779
7779
|
}
|
|
7780
7780
|
classifyRevocation() {
|
|
7781
7781
|
return "soft";
|
|
@@ -7842,7 +7842,7 @@ class Zp {
|
|
|
7842
7842
|
}
|
|
7843
7843
|
forceCleanup() {
|
|
7844
7844
|
var n;
|
|
7845
|
-
this.resumable = !1, this.resuming = !1, this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.mirrorIdleTimer && (clearTimeout(this.mirrorIdleTimer), this.mirrorIdleTimer = null), this.fireBeacon(), this.updateQueue = [], this._awareness && An(this._awareness, [this.ydoc.clientID], "cleanup"), this.cleanupAwareness(), (n = this.socketClient) == null || n.disconnect(), this.resetInternalState(), this._status = "idle", this._context = { ...
|
|
7845
|
+
this.resumable = !1, this.resuming = !1, this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.mirrorIdleTimer && (clearTimeout(this.mirrorIdleTimer), this.mirrorIdleTimer = null), this.fireBeacon(), this.updateQueue = [], this._awareness && An(this._awareness, [this.ydoc.clientID], "cleanup"), this.cleanupAwareness(), (n = this.socketClient) == null || n.disconnect(), this.resetInternalState(), this._status = "idle", this._context = { ...gn };
|
|
7846
7846
|
const t = Qo(this._status, this._context);
|
|
7847
7847
|
this.onCollabStateChange(t);
|
|
7848
7848
|
}
|
|
@@ -7902,7 +7902,7 @@ class Zp {
|
|
|
7902
7902
|
onHandShakeError: (l, u, d) => {
|
|
7903
7903
|
var h, m, p, f, x;
|
|
7904
7904
|
if (!a() && !(u === void 0 && !((h = this.socketClient) != null && h.isSocketOpen))) {
|
|
7905
|
-
if (d ===
|
|
7905
|
+
if (d === qt.WIRE_FORMAT_UNSUPPORTED) {
|
|
7906
7906
|
s || (s = !0, t()), this.emitWireTelemetry({ type: "refused" }), (m = this.socketClient) == null || m.disconnect(), this.resetInternalState(), this.send({
|
|
7907
7907
|
type: "SESSION_TERMINATED",
|
|
7908
7908
|
reason: "WIRE_FORMAT_UNSUPPORTED"
|
|
@@ -7912,7 +7912,7 @@ class Zp {
|
|
|
7912
7912
|
if (this.joinOnly) {
|
|
7913
7913
|
(p = this.socketClient) == null || p.disconnect(), this.resetInternalState(), this.send({
|
|
7914
7914
|
type: "SESSION_TERMINATED",
|
|
7915
|
-
reason: d ===
|
|
7915
|
+
reason: d === qt.ROOM_NOT_ESTABLISHED ? "ROOM_NOT_ESTABLISHED" : u === 403 && (d === qt.JOIN_DISABLED || d === qt.EDIT_REVOKED) ? "WORKSPACE_EDIT_DISABLED" : "JOIN_REJECTED"
|
|
7916
7916
|
}), s || (s = !0, t());
|
|
7917
7917
|
return;
|
|
7918
7918
|
}
|
|
@@ -7944,7 +7944,7 @@ class Zp {
|
|
|
7944
7944
|
g();
|
|
7945
7945
|
return;
|
|
7946
7946
|
}
|
|
7947
|
-
if (u === 403 && (d ===
|
|
7947
|
+
if (u === 403 && (d === qt.JOIN_DISABLED || d === qt.EDIT_REVOKED)) {
|
|
7948
7948
|
(x = this.socketClient) == null || x.disconnect(), this.resetInternalState(), this.send({ type: "SESSION_TERMINATED", reason: "EDIT_REVOKED" }), s || (s = !0, t());
|
|
7949
7949
|
return;
|
|
7950
7950
|
}
|
|
@@ -8166,7 +8166,7 @@ class Zp {
|
|
|
8166
8166
|
var a;
|
|
8167
8167
|
const s = () => this.isCurrentSyncAttempt(n);
|
|
8168
8168
|
if (!t) return;
|
|
8169
|
-
const o = this.encryptForWire(
|
|
8169
|
+
const o = this.encryptForWire(lt(t));
|
|
8170
8170
|
if (!s()) return;
|
|
8171
8171
|
const i = await ((a = this.socketClient) == null ? void 0 : a.sendUpdate({
|
|
8172
8172
|
update: o
|
|
@@ -8794,7 +8794,7 @@ const Jp = { status: "idle" }, ef = (e) => {
|
|
|
8794
8794
|
onSchemaStampGuard: L,
|
|
8795
8795
|
...z
|
|
8796
8796
|
}) => {
|
|
8797
|
-
var
|
|
8797
|
+
var zt;
|
|
8798
8798
|
H(() => {
|
|
8799
8799
|
cu(Y ?? []);
|
|
8800
8800
|
}, [Y]);
|
|
@@ -8825,54 +8825,54 @@ const Jp = { status: "idle" }, ef = (e) => {
|
|
|
8825
8825
|
collaboration: o,
|
|
8826
8826
|
onCollaboratorChange: l,
|
|
8827
8827
|
onIndexedDbError: $
|
|
8828
|
-
}), { initialiseYjsIndexedDbProvider: Q } = ve, ce = !!(R && y && !D && !P && K !== null && !K && !ve.isIndexeddbSynced),
|
|
8828
|
+
}), { initialiseYjsIndexedDbProvider: Q } = ve, ce = !!(R && y && !D && !P && K !== null && !K && !ve.isIndexeddbSynced), Me = P ? !K : K === null, Te = O(!1);
|
|
8829
8829
|
H(() => {
|
|
8830
|
-
!ce ||
|
|
8830
|
+
!ce || Te.current || (Te.current = !0, Q());
|
|
8831
8831
|
}, [ce, Q]);
|
|
8832
|
-
const
|
|
8833
|
-
() =>
|
|
8832
|
+
const Ue = M(
|
|
8833
|
+
() => Te.current ? Promise.resolve() : Q(),
|
|
8834
8834
|
[Q]
|
|
8835
|
-
),
|
|
8835
|
+
), Pe = !!(R && !D && z.isDDocOwner && !P && !e && !K), Je = !!(!P && !e && !D && z.isDDocOwner), yt = c === !0, mt = !!(z.isDDocOwner && !D && !K), ze = Tp({
|
|
8836
8836
|
ydoc: ve.ydoc,
|
|
8837
8837
|
initialContent: K,
|
|
8838
|
-
isNewDocument:
|
|
8838
|
+
isNewDocument: yt,
|
|
8839
8839
|
enableCollaboration: D,
|
|
8840
8840
|
isDDocOwner: z.isDDocOwner || !1,
|
|
8841
8841
|
createDefaultTabIfMissing: !!(!P && !e && z.isDDocOwner && !D && // Wait for y-indexedDB sync before deciding whether an unsaved local doc
|
|
8842
8842
|
// still needs a default tab, otherwise refresh keeps bootstrapping one.
|
|
8843
|
-
(!
|
|
8844
|
-
defaultTabId: (
|
|
8845
|
-
shouldSyncActiveTab:
|
|
8843
|
+
(!Pe || ve.isIndexeddbSynced)),
|
|
8844
|
+
defaultTabId: (zt = z.tabConfig) == null ? void 0 : zt.defaultTabId,
|
|
8845
|
+
shouldSyncActiveTab: Je,
|
|
8846
8846
|
// Viewers (non-owners) should land on the first tab, not whatever the
|
|
8847
8847
|
// owner last selected, since active-tab is persisted in the shared Yjs doc.
|
|
8848
8848
|
preferFirstTabOnInit: !z.isDDocOwner,
|
|
8849
8849
|
onVersionHistoryActiveTabChange: s == null ? void 0 : s.onActiveTabChange,
|
|
8850
8850
|
getEditor: () => q.current,
|
|
8851
8851
|
flushPendingUpdate: ve.flushPendingUpdate
|
|
8852
|
-
}),
|
|
8853
|
-
() => ze.tabs.map((
|
|
8852
|
+
}), ct = ke(
|
|
8853
|
+
() => ze.tabs.map((on) => on.id),
|
|
8854
8854
|
[ze.tabs]
|
|
8855
|
-
),
|
|
8855
|
+
), Ke = O(!1);
|
|
8856
8856
|
H(() => {
|
|
8857
|
-
|
|
8857
|
+
yt || !mt || Ke.current || P || e || (Ke.current = !0, L == null || L({
|
|
8858
8858
|
kind: "unasserted-new",
|
|
8859
8859
|
preferredSchemaVersion: ae ?? 1
|
|
8860
8860
|
}));
|
|
8861
8861
|
}, [
|
|
8862
|
-
|
|
8863
|
-
|
|
8862
|
+
yt,
|
|
8863
|
+
mt,
|
|
8864
8864
|
P,
|
|
8865
8865
|
e,
|
|
8866
8866
|
L,
|
|
8867
8867
|
ae
|
|
8868
8868
|
]);
|
|
8869
|
-
const { docSchemaVersion:
|
|
8869
|
+
const { docSchemaVersion: Ht, isSchemaUnsupported: Ye } = Fm({
|
|
8870
8870
|
ydoc: ve.ydoc,
|
|
8871
|
-
isNewDdoc:
|
|
8872
|
-
isContentResolved: !
|
|
8871
|
+
isNewDdoc: yt,
|
|
8872
|
+
isContentResolved: !Pe || ve.isIndexeddbSynced,
|
|
8873
8873
|
preferredSchemaVersion: ae,
|
|
8874
8874
|
onSchemaStampGuard: L
|
|
8875
|
-
}),
|
|
8875
|
+
}), $e = up({
|
|
8876
8876
|
ydoc: ve.ydoc,
|
|
8877
8877
|
editorWidthStore: de,
|
|
8878
8878
|
isPreviewMode: e,
|
|
@@ -8911,32 +8911,33 @@ const Jp = { status: "idle" }, ef = (e) => {
|
|
|
8911
8911
|
onDisconnect: ve.onDisconnect,
|
|
8912
8912
|
isIndexeddbSynced: ve.isIndexeddbSynced,
|
|
8913
8913
|
hasCollabContentInitialised: ve.hasCollabContentInitialised,
|
|
8914
|
-
initialiseYjsIndexedDbProvider:
|
|
8914
|
+
initialiseYjsIndexedDbProvider: Ue,
|
|
8915
8915
|
externalExtensions: b,
|
|
8916
8916
|
// An empty activeTabId makes useTabEditorCache destroy every editor and
|
|
8917
8917
|
// create none, so this build never binds y-sync to a newer-schema doc,
|
|
8918
8918
|
// nor to a doc whose store has not loaded yet (isAwaitingStore, which
|
|
8919
|
-
// starts the store load itself so holding the editor cannot deadlock)
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8919
|
+
// starts the store load itself so holding the editor cannot deadlock),
|
|
8920
|
+
// nor before a body the host has promised (isAwaitingBody).
|
|
8921
|
+
activeTabId: Ye || ce || Me ? "" : ze.activeTabId,
|
|
8922
|
+
tabIds: ct,
|
|
8923
|
+
docSchemaVersion: Ht,
|
|
8923
8924
|
hasTabState: ze.hasTabState,
|
|
8924
8925
|
isVersionMode: P,
|
|
8925
8926
|
theme: A,
|
|
8926
8927
|
editorRef: q,
|
|
8927
8928
|
initialCommentAnchors: se,
|
|
8928
8929
|
dBlockRuntimeStateRef: oe
|
|
8929
|
-
}),
|
|
8930
|
+
}), Tt = !!(R && !ve.isIndexeddbSynced && Je && ze.tabs.length > 1), sn = D ? o.connection.isOwner : !0, un = (D && !sn ? $e.isContentLoading || W : $e.isContentLoading) || Tt;
|
|
8930
8931
|
return {
|
|
8931
|
-
|
|
8932
|
+
...$e,
|
|
8932
8933
|
...ve,
|
|
8933
8934
|
ydoc: ve.ydoc,
|
|
8934
8935
|
awareness: ve.awareness,
|
|
8935
8936
|
refreshYjsIndexedDbProvider: ve.refreshYjsIndexedDbProvider,
|
|
8936
8937
|
terminateSession: ve.terminateSession,
|
|
8937
|
-
isContentLoading: !!
|
|
8938
|
-
isSchemaUnsupported:
|
|
8939
|
-
docSchemaVersion:
|
|
8938
|
+
isContentLoading: !!un,
|
|
8939
|
+
isSchemaUnsupported: Ye,
|
|
8940
|
+
docSchemaVersion: Ht,
|
|
8940
8941
|
tabs: ze.tabs,
|
|
8941
8942
|
hasTabState: ze.hasTabState,
|
|
8942
8943
|
dBlockRuntimeState: fe,
|
|
@@ -9100,7 +9101,7 @@ const Jp = { status: "idle" }, ef = (e) => {
|
|
|
9100
9101
|
title: "Link",
|
|
9101
9102
|
content: /* @__PURE__ */ v("div", { className: "flex flex-col gap-4 w-full h-full text-base", children: [
|
|
9102
9103
|
/* @__PURE__ */ r(
|
|
9103
|
-
|
|
9104
|
+
Gt,
|
|
9104
9105
|
{
|
|
9105
9106
|
label: "Text",
|
|
9106
9107
|
placeholder: "Link text",
|
|
@@ -9114,7 +9115,7 @@ const Jp = { status: "idle" }, ef = (e) => {
|
|
|
9114
9115
|
}
|
|
9115
9116
|
),
|
|
9116
9117
|
/* @__PURE__ */ r(
|
|
9117
|
-
|
|
9118
|
+
Gt,
|
|
9118
9119
|
{
|
|
9119
9120
|
label: "Link",
|
|
9120
9121
|
placeholder: "Paste URL",
|
|
@@ -9147,7 +9148,7 @@ const Jp = { status: "idle" }, ef = (e) => {
|
|
|
9147
9148
|
}
|
|
9148
9149
|
)
|
|
9149
9150
|
] });
|
|
9150
|
-
}, Ll =
|
|
9151
|
+
}, Ll = Xe.memo(hf);
|
|
9151
9152
|
Ll.displayName = "MobileToolbar";
|
|
9152
9153
|
new Ur({
|
|
9153
9154
|
html: !0,
|
|
@@ -9272,7 +9273,7 @@ const pf = async (e, t, n) => {
|
|
|
9272
9273
|
documentStyling: s,
|
|
9273
9274
|
theme: o = "light"
|
|
9274
9275
|
}) => {
|
|
9275
|
-
const i = O({}), a = O(null), { isNativeMobile: c } =
|
|
9276
|
+
const i = O({}), a = O(null), { isNativeMobile: c } = Yt(), l = Ms("(max-width: 1279px)");
|
|
9276
9277
|
H(() => {
|
|
9277
9278
|
var m;
|
|
9278
9279
|
!l && i.current[t] && ((m = i.current[t]) == null || m.scrollIntoView({
|
|
@@ -9356,12 +9357,12 @@ const pf = async (e, t, n) => {
|
|
|
9356
9357
|
]
|
|
9357
9358
|
}
|
|
9358
9359
|
);
|
|
9359
|
-
},
|
|
9360
|
+
}, Ct = new Ur({
|
|
9360
9361
|
html: !0,
|
|
9361
9362
|
linkify: !0,
|
|
9362
9363
|
typographer: !0
|
|
9363
9364
|
}).use(Uh).enable(["table", "list"]);
|
|
9364
|
-
|
|
9365
|
+
Ct.renderer.rules.list_item_open = (e, t) => {
|
|
9365
9366
|
const n = e[t + 2];
|
|
9366
9367
|
if (n && n.content) {
|
|
9367
9368
|
const s = n.content.match(/^\[([ xX])\]\s*(.*)$/);
|
|
@@ -9470,13 +9471,13 @@ function Cf(e, t = {}) {
|
|
|
9470
9471
|
const T = ca(C, w);
|
|
9471
9472
|
N.push({
|
|
9472
9473
|
type: "content",
|
|
9473
|
-
content:
|
|
9474
|
+
content: Ct.render(T[0])
|
|
9474
9475
|
});
|
|
9475
9476
|
for (let I = 1; I < T.length; I++)
|
|
9476
9477
|
c.push(N), N = [
|
|
9477
9478
|
{
|
|
9478
9479
|
type: "content",
|
|
9479
|
-
content:
|
|
9480
|
+
content: Ct.render(T[I])
|
|
9480
9481
|
}
|
|
9481
9482
|
];
|
|
9482
9483
|
return N;
|
|
@@ -9496,7 +9497,7 @@ function Cf(e, t = {}) {
|
|
|
9496
9497
|
ca(C, w).forEach((I, F) => {
|
|
9497
9498
|
(F > 0 || m(I, N)) && N.length > 0 && (c.push(N), N = []), N.push({
|
|
9498
9499
|
type: "content",
|
|
9499
|
-
content:
|
|
9500
|
+
content: Ct.render(I)
|
|
9500
9501
|
});
|
|
9501
9502
|
});
|
|
9502
9503
|
return N;
|
|
@@ -9528,7 +9529,7 @@ function Cf(e, t = {}) {
|
|
|
9528
9529
|
const N = C.filter((I) => I.trim().length > 0);
|
|
9529
9530
|
if (N.length < 2) return [""];
|
|
9530
9531
|
const S = N[0].split("|").map((I) => I.trim()).filter(Boolean), w = N[1], b = N.slice(2);
|
|
9531
|
-
return N.length <= a ? [`<div class="table-wrapper">${
|
|
9532
|
+
return N.length <= a ? [`<div class="table-wrapper">${Ct.render(C.join(`
|
|
9532
9533
|
`))}</div>`] : gf(S, b, a).map((I) => {
|
|
9533
9534
|
const F = [
|
|
9534
9535
|
`|${S.join("|")}|`,
|
|
@@ -9536,7 +9537,7 @@ function Cf(e, t = {}) {
|
|
|
9536
9537
|
...I.rows
|
|
9537
9538
|
].join(`
|
|
9538
9539
|
`);
|
|
9539
|
-
return `<div class="table-wrapper">${
|
|
9540
|
+
return `<div class="table-wrapper">${Ct.render(F)}</div>`;
|
|
9540
9541
|
});
|
|
9541
9542
|
}, y = e.split(`
|
|
9542
9543
|
`);
|
|
@@ -9551,16 +9552,16 @@ function Cf(e, t = {}) {
|
|
|
9551
9552
|
b.length > 10 ? da(S).forEach((F, j) => {
|
|
9552
9553
|
(j > 0 || m(F, l)) && f(), l.push({
|
|
9553
9554
|
type: "content",
|
|
9554
|
-
content:
|
|
9555
|
+
content: Ct.render(F)
|
|
9555
9556
|
});
|
|
9556
9557
|
}) : b.length < 10 && T > 50 ? da(S, 6).forEach((F, j) => {
|
|
9557
9558
|
(j > 0 || m(F, l)) && f(), l.push({
|
|
9558
9559
|
type: "content",
|
|
9559
|
-
content:
|
|
9560
|
+
content: Ct.render(F)
|
|
9560
9561
|
});
|
|
9561
9562
|
}) : (m(S, l) && f(), l.push({
|
|
9562
9563
|
type: "content",
|
|
9563
|
-
content:
|
|
9564
|
+
content: Ct.render(S)
|
|
9564
9565
|
})), C = w;
|
|
9565
9566
|
continue;
|
|
9566
9567
|
}
|
|
@@ -9586,7 +9587,7 @@ function Cf(e, t = {}) {
|
|
|
9586
9587
|
u = [];
|
|
9587
9588
|
}
|
|
9588
9589
|
f();
|
|
9589
|
-
const S = N.substring(2), w =
|
|
9590
|
+
const S = N.substring(2), w = Ct.renderInline(S);
|
|
9590
9591
|
c.push([{ type: "h1", content: w }]);
|
|
9591
9592
|
continue;
|
|
9592
9593
|
}
|
|
@@ -9601,7 +9602,7 @@ function Cf(e, t = {}) {
|
|
|
9601
9602
|
}
|
|
9602
9603
|
f();
|
|
9603
9604
|
const S = N.substring(3);
|
|
9604
|
-
l = [{ type: "h2", content:
|
|
9605
|
+
l = [{ type: "h2", content: Ct.renderInline(S) }];
|
|
9605
9606
|
continue;
|
|
9606
9607
|
}
|
|
9607
9608
|
if (N.startsWith("|") || N.match(/^\s*[-|]+\s*$/)) {
|
|
@@ -9623,7 +9624,7 @@ function Cf(e, t = {}) {
|
|
|
9623
9624
|
yf(d, 23).forEach((w, b) => {
|
|
9624
9625
|
(b > 0 || m(w, l)) && f(), l.push({
|
|
9625
9626
|
type: "content",
|
|
9626
|
-
content:
|
|
9627
|
+
content: Ct.render(w)
|
|
9627
9628
|
});
|
|
9628
9629
|
});
|
|
9629
9630
|
else {
|
|
@@ -9631,7 +9632,7 @@ function Cf(e, t = {}) {
|
|
|
9631
9632
|
`);
|
|
9632
9633
|
m(S, l) && f(), l.push({
|
|
9633
9634
|
type: "content",
|
|
9634
|
-
content:
|
|
9635
|
+
content: Ct.render(S)
|
|
9635
9636
|
});
|
|
9636
9637
|
}
|
|
9637
9638
|
d = [];
|
|
@@ -9690,7 +9691,7 @@ function Cf(e, t = {}) {
|
|
|
9690
9691
|
case "table":
|
|
9691
9692
|
return N.content;
|
|
9692
9693
|
default:
|
|
9693
|
-
return
|
|
9694
|
+
return Ct.render(N.content);
|
|
9694
9695
|
}
|
|
9695
9696
|
}).filter(Boolean).join(`
|
|
9696
9697
|
`)).filter(Boolean).join(`
|
|
@@ -9764,7 +9765,7 @@ const vf = ({
|
|
|
9764
9765
|
fetchV1ImageFn: g,
|
|
9765
9766
|
theme: y = "light"
|
|
9766
9767
|
}) => {
|
|
9767
|
-
const [R, E] = G(!1), [k, A] = G(0), [C, N] = G(!0), { isNativeMobile: S } =
|
|
9768
|
+
const [R, E] = G(!1), [k, A] = G(0), [C, N] = G(!0), { isNativeMobile: S } = Yt(), [w, b] = G(null), [T, I] = G(null), F = 50, [j, Z] = G(
|
|
9768
9769
|
"forward"
|
|
9769
9770
|
), V = Cs(
|
|
9770
9771
|
x == null ? void 0 : x.canvasBackground,
|
|
@@ -9916,7 +9917,7 @@ const vf = ({
|
|
|
9916
9917
|
] }),
|
|
9917
9918
|
/* @__PURE__ */ v("div", { className: "flex justify-center items-center gap-2", children: [
|
|
9918
9919
|
m == null ? void 0 : m(),
|
|
9919
|
-
!c && /* @__PURE__ */ r(
|
|
9920
|
+
!c && /* @__PURE__ */ r(Ge, { text: "Download", sideOffset: 10, children: /* @__PURE__ */ r(
|
|
9920
9921
|
we,
|
|
9921
9922
|
{
|
|
9922
9923
|
variant: "ghost",
|
|
@@ -9925,7 +9926,7 @@ const vf = ({
|
|
|
9925
9926
|
size: "md"
|
|
9926
9927
|
}
|
|
9927
9928
|
) }),
|
|
9928
|
-
/* @__PURE__ */ r(
|
|
9929
|
+
/* @__PURE__ */ r(Ge, { text: "Comments", sideOffset: 10, children: /* @__PURE__ */ r(
|
|
9929
9930
|
we,
|
|
9930
9931
|
{
|
|
9931
9932
|
variant: "ghost",
|
|
@@ -9935,7 +9936,7 @@ const vf = ({
|
|
|
9935
9936
|
}
|
|
9936
9937
|
) }),
|
|
9937
9938
|
!c && /* @__PURE__ */ v(
|
|
9938
|
-
|
|
9939
|
+
Ge,
|
|
9939
9940
|
{
|
|
9940
9941
|
text: a ? "Copy to Share" : "Link is preparing...",
|
|
9941
9942
|
sideOffset: 10,
|
|
@@ -9966,7 +9967,7 @@ const vf = ({
|
|
|
9966
9967
|
]
|
|
9967
9968
|
}
|
|
9968
9969
|
),
|
|
9969
|
-
/* @__PURE__ */ r(
|
|
9970
|
+
/* @__PURE__ */ r(Ge, { text: "Press F to toggle fullscreen", sideOffset: 10, children: /* @__PURE__ */ r(
|
|
9970
9971
|
we,
|
|
9971
9972
|
{
|
|
9972
9973
|
variant: "ghost",
|
|
@@ -10097,7 +10098,7 @@ const vf = ({
|
|
|
10097
10098
|
/* @__PURE__ */ v("div", { className: "flex flex-col gap-2", children: [
|
|
10098
10099
|
/* @__PURE__ */ v("div", { className: "flex gap-3 mt-2", children: [
|
|
10099
10100
|
/* @__PURE__ */ r(
|
|
10100
|
-
|
|
10101
|
+
Gt,
|
|
10101
10102
|
{
|
|
10102
10103
|
"data-testid": "comment-name-input",
|
|
10103
10104
|
type: "text",
|
|
@@ -10182,7 +10183,7 @@ const vf = ({
|
|
|
10182
10183
|
replyCount: t,
|
|
10183
10184
|
commentUsername: n
|
|
10184
10185
|
}) => {
|
|
10185
|
-
const s = U((A) => A.reply), o = U((A) => A.replyEditTarget), i = U((A) => A.editRequest), a = U((A) => A.clearEditRequest), c = U((A) => A.setReply), l = U((A) => A.setReplyEditTarget), u = U((A) => A.cancelReplyEdit), d = U((A) => A.handleReplyChange), h = U((A) => A.handleReplyKeyDown), m = U((A) => A.handleReplySubmit), p = U((A) => A.setOpenReplyId), f = U((A) => A.username), { isBelow1280px: x } =
|
|
10186
|
+
const s = U((A) => A.reply), o = U((A) => A.replyEditTarget), i = U((A) => A.editRequest), a = U((A) => A.clearEditRequest), c = U((A) => A.setReply), l = U((A) => A.setReplyEditTarget), u = U((A) => A.cancelReplyEdit), d = U((A) => A.handleReplyChange), h = U((A) => A.handleReplyKeyDown), m = U((A) => A.handleReplySubmit), p = U((A) => A.setOpenReplyId), f = U((A) => A.username), { isBelow1280px: x } = Yt(), g = !!s.trim(), y = !!o, R = !!(!s.trim() || !f || y && s.trim() === ((o == null ? void 0 : o.originalText) ?? "").trim()), E = O(null), k = Qt(f);
|
|
10186
10187
|
return H(() => {
|
|
10187
10188
|
var A;
|
|
10188
10189
|
!i || i.commentId !== e || (c(i.text), l({
|
|
@@ -10204,7 +10205,7 @@ const vf = ({
|
|
|
10204
10205
|
),
|
|
10205
10206
|
children: [
|
|
10206
10207
|
/* @__PURE__ */ r(
|
|
10207
|
-
|
|
10208
|
+
Xt,
|
|
10208
10209
|
{
|
|
10209
10210
|
src: k.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
10210
10211
|
k.name || ""
|
|
@@ -10213,7 +10214,7 @@ const vf = ({
|
|
|
10213
10214
|
}
|
|
10214
10215
|
),
|
|
10215
10216
|
/* @__PURE__ */ r(
|
|
10216
|
-
|
|
10217
|
+
yn,
|
|
10217
10218
|
{
|
|
10218
10219
|
ref: E,
|
|
10219
10220
|
"data-testid": "comment-reply-input",
|
|
@@ -10281,7 +10282,7 @@ const vf = ({
|
|
|
10281
10282
|
)
|
|
10282
10283
|
] });
|
|
10283
10284
|
}, If = ({ tabId: e }) => {
|
|
10284
|
-
const t = U((l) => l.comment), n = U((l) => l.username), s = U((l) => l.handleCommentChange), o = U((l) => l.handleCommentKeyDown), i = U((l) => l.handleCommentSubmit), a = O(null), c =
|
|
10285
|
+
const t = U((l) => l.comment), n = U((l) => l.username), s = U((l) => l.handleCommentChange), o = U((l) => l.handleCommentKeyDown), i = U((l) => l.handleCommentSubmit), a = O(null), c = Qt(n);
|
|
10285
10286
|
return H(() => {
|
|
10286
10287
|
a.current && ht(a.current, 96);
|
|
10287
10288
|
}, [t]), /* @__PURE__ */ v("div", { className: "flex flex-col gap-3 color-bg-default border-t color-border-default pt-[20px] rounded-b-lg", children: [
|
|
@@ -10293,7 +10294,7 @@ const vf = ({
|
|
|
10293
10294
|
),
|
|
10294
10295
|
children: [
|
|
10295
10296
|
/* @__PURE__ */ r(
|
|
10296
|
-
|
|
10297
|
+
Xt,
|
|
10297
10298
|
{
|
|
10298
10299
|
src: c.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
10299
10300
|
c.name
|
|
@@ -10302,7 +10303,7 @@ const vf = ({
|
|
|
10302
10303
|
}
|
|
10303
10304
|
),
|
|
10304
10305
|
/* @__PURE__ */ r(
|
|
10305
|
-
|
|
10306
|
+
yn,
|
|
10306
10307
|
{
|
|
10307
10308
|
ref: a,
|
|
10308
10309
|
"data-testid": "comment-section-input",
|
|
@@ -10362,7 +10363,7 @@ const Ul = ({
|
|
|
10362
10363
|
onCommentFocus: d,
|
|
10363
10364
|
onReset: h
|
|
10364
10365
|
}) => {
|
|
10365
|
-
const m = U((_) => _.tabComments), p = U((_) => _.username), f = U((_) => _.setUsername), x = U((_) => _.focusCommentInEditor), g = U((_) => _.setActiveCommentId), y = U((_) => _.setOpenReplyId), R = U((_) => _.openReplyId), E = U((_) => _.resolveComment), k = U((_) => _.unresolveComment), A = U((_) => _.deleteComment), C = U((_) => _.acceptSuggestion), N = U((_) => _.isConnected), S = U((_) => _.connectViaWallet), w = U((_) => _.isLoading), b = U((_) => _.connectViaUsername), T = U((_) => _.isDDocOwner), { commentsSectionRef: I, replySectionRef: F } = Es(), { isBelow1280px: j } =
|
|
10366
|
+
const m = U((_) => _.tabComments), p = U((_) => _.username), f = U((_) => _.setUsername), x = U((_) => _.focusCommentInEditor), g = U((_) => _.setActiveCommentId), y = U((_) => _.setOpenReplyId), R = U((_) => _.openReplyId), E = U((_) => _.resolveComment), k = U((_) => _.unresolveComment), A = U((_) => _.deleteComment), C = U((_) => _.acceptSuggestion), N = U((_) => _.isConnected), S = U((_) => _.connectViaWallet), w = U((_) => _.isLoading), b = U((_) => _.connectViaUsername), T = U((_) => _.isDDocOwner), { commentsSectionRef: I, replySectionRef: F } = Es(), { isBelow1280px: j } = Yt(), Z = s && !!R, [V, te] = G(null), [$, ne] = G(null), se = (o ?? m).filter((_) => !_.deleted).sort(
|
|
10366
10367
|
(_, le) => new Date(le.createdAt).getTime() - new Date(_.createdAt).getTime()
|
|
10367
10368
|
), ge = se.filter(
|
|
10368
10369
|
(_) => !_.resolved
|
|
@@ -10530,7 +10531,7 @@ const Ul = ({
|
|
|
10530
10531
|
onSetOpenReplyId: p
|
|
10531
10532
|
}) => {
|
|
10532
10533
|
var E, k;
|
|
10533
|
-
const [f, x] = G(!1), { isBelow1280px: g } =
|
|
10534
|
+
const [f, x] = G(!1), { isBelow1280px: g } = Yt(), y = Df(
|
|
10534
10535
|
e.id,
|
|
10535
10536
|
e.selectedContent,
|
|
10536
10537
|
e.tabId,
|
|
@@ -10780,7 +10781,7 @@ const Ul = ({
|
|
|
10780
10781
|
onSubmit: l,
|
|
10781
10782
|
onUpdateDraftText: u
|
|
10782
10783
|
}) => {
|
|
10783
|
-
const d = O(null), h = U((g) => g.username), m =
|
|
10784
|
+
const d = O(null), h = U((g) => g.username), m = Qt(h), { handleDraftBlur: p, handleDraftFocus: f, submitLabel: x } = Hr({
|
|
10784
10785
|
draftId: t,
|
|
10785
10786
|
canAutoSubmit: n && !!t && !!(e != null && e.text.trim()) && !s,
|
|
10786
10787
|
onSubmit: l
|
|
@@ -10806,7 +10807,7 @@ const Ul = ({
|
|
|
10806
10807
|
] }),
|
|
10807
10808
|
/* @__PURE__ */ v("div", { className: "border flex px-[12px] items-center justify-between py-[8px] gap-[8px] rounded-[4px]", children: [
|
|
10808
10809
|
/* @__PURE__ */ r(
|
|
10809
|
-
|
|
10810
|
+
Xt,
|
|
10810
10811
|
{
|
|
10811
10812
|
src: m.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
10812
10813
|
m.name
|
|
@@ -10815,7 +10816,7 @@ const Ul = ({
|
|
|
10815
10816
|
}
|
|
10816
10817
|
),
|
|
10817
10818
|
/* @__PURE__ */ r(
|
|
10818
|
-
|
|
10819
|
+
yn,
|
|
10819
10820
|
{
|
|
10820
10821
|
ref: d,
|
|
10821
10822
|
value: (e == null ? void 0 : e.text) || "",
|
|
@@ -10876,7 +10877,7 @@ const Ul = ({
|
|
|
10876
10877
|
children: [
|
|
10877
10878
|
/* @__PURE__ */ v("div", { className: "flex flex-col gap-2", children: [
|
|
10878
10879
|
/* @__PURE__ */ r(
|
|
10879
|
-
|
|
10880
|
+
Gt,
|
|
10880
10881
|
{
|
|
10881
10882
|
type: "text",
|
|
10882
10883
|
value: o,
|
|
@@ -10942,7 +10943,7 @@ const Ul = ({
|
|
|
10942
10943
|
onFocusSuggestionText: c,
|
|
10943
10944
|
onSubmit: l
|
|
10944
10945
|
}) => {
|
|
10945
|
-
const u =
|
|
10946
|
+
const u = Qt(s), d = !!e.selectedText, h = !!e.insertedText, m = !!e.linkHref, p = d || h || m, { submitLabel: f } = Pl({
|
|
10946
10947
|
suggestionId: e.suggestionId,
|
|
10947
10948
|
canAutoSubmit: t && p && !n,
|
|
10948
10949
|
onSubmit: l
|
|
@@ -10971,7 +10972,7 @@ const Ul = ({
|
|
|
10971
10972
|
t ? /* @__PURE__ */ v("div", { className: "flex flex-col gap-[8px]", children: [
|
|
10972
10973
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
10973
10974
|
/* @__PURE__ */ r(
|
|
10974
|
-
|
|
10975
|
+
Xt,
|
|
10975
10976
|
{
|
|
10976
10977
|
src: u.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
10977
10978
|
u.name
|
|
@@ -11457,7 +11458,7 @@ const Ul = ({
|
|
|
11457
11458
|
}) => {
|
|
11458
11459
|
const d = U((Ke) => Ke.initialComments), h = U((Ke) => Ke.isConnected), m = U((Ke) => Ke.focusCommentInEditor), p = U(
|
|
11459
11460
|
(Ke) => Ke.focusSuggestionDraftInEditor
|
|
11460
|
-
), f = U((Ke) => Ke.isCommentOpen), x = U((Ke) => Ke.openReplyId), g = U((Ke) => Ke.setOpenReplyId), y = U((Ke) => Ke.setIsCommentOpen), R = U((Ke) => Ke.username), { isBelow1280px: E } =
|
|
11461
|
+
), f = U((Ke) => Ke.isCommentOpen), x = U((Ke) => Ke.openReplyId), g = U((Ke) => Ke.setOpenReplyId), y = U((Ke) => Ke.setIsCommentOpen), R = U((Ke) => Ke.username), { isBelow1280px: E } = Yt(), k = O(null), { mobileDraftRef: A } = Es(), C = E && !!x, {
|
|
11461
11462
|
closeFilterSelects: N,
|
|
11462
11463
|
commentType: S,
|
|
11463
11464
|
commentTypeOptions: w,
|
|
@@ -11497,13 +11498,13 @@ const Ul = ({
|
|
|
11497
11498
|
onTabChange: a,
|
|
11498
11499
|
setOpenReplyId: g
|
|
11499
11500
|
}), {
|
|
11500
|
-
canGoToNextMobileComment:
|
|
11501
|
+
canGoToNextMobileComment: Me,
|
|
11501
11502
|
canGoToPreviousMobileComment: Te,
|
|
11502
11503
|
handleNextMobileComment: Ue,
|
|
11503
11504
|
handlePreviousMobileComment: Pe,
|
|
11504
|
-
handleViewAllComments:
|
|
11505
|
-
mobileActiveCommentsCount:
|
|
11506
|
-
mobileFocusedCommentIndex:
|
|
11505
|
+
handleViewAllComments: Je,
|
|
11506
|
+
mobileActiveCommentsCount: yt,
|
|
11507
|
+
mobileFocusedCommentIndex: mt
|
|
11507
11508
|
} = Vf({
|
|
11508
11509
|
comments: d,
|
|
11509
11510
|
mobileDrawerRef: k,
|
|
@@ -11522,14 +11523,14 @@ const Ul = ({
|
|
|
11522
11523
|
setIsDiscardCommentOverlayVisible: D,
|
|
11523
11524
|
setIsDiscardSuggestionOverlayVisible: ee
|
|
11524
11525
|
});
|
|
11525
|
-
const
|
|
11526
|
+
const ct = /* @__PURE__ */ r("div", { ref: k, "data-testid": "comment-drawer", children: E ? /* @__PURE__ */ r(
|
|
11526
11527
|
Uf,
|
|
11527
11528
|
{
|
|
11528
11529
|
activeCommentId: o,
|
|
11529
11530
|
activeDraft: de,
|
|
11530
11531
|
activeDraftId: L,
|
|
11531
11532
|
activeSuggestionDraftCard: z,
|
|
11532
|
-
canGoToNextMobileComment:
|
|
11533
|
+
canGoToNextMobileComment: Me,
|
|
11533
11534
|
canGoToPreviousMobileComment: Te,
|
|
11534
11535
|
comments: d,
|
|
11535
11536
|
isCommentMobileFocused: C,
|
|
@@ -11540,9 +11541,9 @@ const Ul = ({
|
|
|
11540
11541
|
isMobileDrawerVisible: ve,
|
|
11541
11542
|
isNavbarVisible: n,
|
|
11542
11543
|
isPresentationMode: s,
|
|
11543
|
-
mobileActiveCommentsCount:
|
|
11544
|
+
mobileActiveCommentsCount: yt,
|
|
11544
11545
|
mobileDraftRef: A,
|
|
11545
|
-
mobileFocusedCommentIndex:
|
|
11546
|
+
mobileFocusedCommentIndex: mt,
|
|
11546
11547
|
onAttemptCloseNewComment: () => D(!0),
|
|
11547
11548
|
onAttemptCloseSuggestionDraft: () => ee(!0),
|
|
11548
11549
|
onCancelDiscardComment: () => D(!1),
|
|
@@ -11563,7 +11564,7 @@ const Ul = ({
|
|
|
11563
11564
|
onStartNewMobileComment: W,
|
|
11564
11565
|
onSubmitSuggestionDraft: B,
|
|
11565
11566
|
onUpdateInlineDraftText: fe,
|
|
11566
|
-
onViewAllComments:
|
|
11567
|
+
onViewAllComments: Je,
|
|
11567
11568
|
tabNameById: ae,
|
|
11568
11569
|
username: R
|
|
11569
11570
|
}
|
|
@@ -11596,7 +11597,7 @@ const Ul = ({
|
|
|
11596
11597
|
tabNameById: ae
|
|
11597
11598
|
}
|
|
11598
11599
|
) });
|
|
11599
|
-
return E && u ? Dn(
|
|
11600
|
+
return E && u ? Dn(ct, u) : ct;
|
|
11600
11601
|
}, qf = (e) => {
|
|
11601
11602
|
const [t, n] = G(!1);
|
|
11602
11603
|
return H(() => {
|
|
@@ -12179,7 +12180,7 @@ const Ul = ({
|
|
|
12179
12180
|
activeFloatingCards: Te,
|
|
12180
12181
|
activeFloatingCardMap: Ue,
|
|
12181
12182
|
floatingCardIdsToClose: Pe,
|
|
12182
|
-
shouldScheduleFollowUp:
|
|
12183
|
+
shouldScheduleFollowUp: Je
|
|
12183
12184
|
} = g({
|
|
12184
12185
|
currentCycle: ve,
|
|
12185
12186
|
currentDocVersion: Q,
|
|
@@ -12193,93 +12194,93 @@ const Ul = ({
|
|
|
12193
12194
|
markRecomputeFromIndex: b,
|
|
12194
12195
|
getOrderedFloatingCardIndex: k
|
|
12195
12196
|
});
|
|
12196
|
-
ce || (ce =
|
|
12197
|
-
const { orderedFloatingCardIds:
|
|
12198
|
-
if (
|
|
12199
|
-
b(
|
|
12200
|
-
const Oe =
|
|
12197
|
+
ce || (ce = Je);
|
|
12198
|
+
const { orderedFloatingCardIds: yt, firstChangedIndex: mt } = j(Te);
|
|
12199
|
+
if (mt !== null) {
|
|
12200
|
+
b(mt);
|
|
12201
|
+
const Oe = yt[mt];
|
|
12201
12202
|
Oe && S(
|
|
12202
12203
|
Oe,
|
|
12203
12204
|
ut.Anchor
|
|
12204
12205
|
);
|
|
12205
12206
|
}
|
|
12206
12207
|
F(new Set(Ue.keys()));
|
|
12207
|
-
const
|
|
12208
|
+
const ze = fe.getBoundingClientRect(), ct = oe.getBoundingClientRect(), Ke = (Zt = s.current) == null ? void 0 : Zt.getBoundingClientRect(), Ht = Ke !== void 0 ? Math.max(
|
|
12208
12209
|
0,
|
|
12209
|
-
Ke.bottom -
|
|
12210
|
+
Ke.bottom - ct.top
|
|
12210
12211
|
) : 0;
|
|
12211
12212
|
le.current !== oe && (le.current = oe, W.current = null), (_.current === null || Math.abs(
|
|
12212
|
-
_.current -
|
|
12213
|
-
) > 0.5) && (_.current =
|
|
12214
|
-
const
|
|
12213
|
+
_.current - ct.top
|
|
12214
|
+
) > 0.5) && (_.current = ct.top, B.current.containerOffset += 1);
|
|
12215
|
+
const Ye = ze.height, $e = ze.top - ct.top, Tt = $e + Ye, sn = B.current.appliedScroll !== B.current.scroll, un = B.current.appliedContainerOffset !== B.current.containerOffset;
|
|
12215
12216
|
I.current.forEach((Oe, Le) => {
|
|
12216
12217
|
const tt = Ue.get(Oe);
|
|
12217
12218
|
if (!tt)
|
|
12218
12219
|
return;
|
|
12219
|
-
const
|
|
12220
|
+
const Ae = A(Oe), { anchorId: At } = yo(tt), nt = m.current.get(At);
|
|
12220
12221
|
if (!nt) {
|
|
12221
|
-
|
|
12222
|
+
Ae.isInViewport && (Ae.isInViewport = !1, S(
|
|
12222
12223
|
Oe,
|
|
12223
12224
|
ut.Visibility
|
|
12224
|
-
), b(Le)),
|
|
12225
|
+
), b(Le)), Ae.anchorTop = null, Ae.anchorHeight = 0;
|
|
12225
12226
|
return;
|
|
12226
12227
|
}
|
|
12227
12228
|
let st = nt.cachedRect ? t0({
|
|
12228
12229
|
cachedRect: nt.cachedRect,
|
|
12229
12230
|
scrollTop: fe.scrollTop,
|
|
12230
|
-
containerTop:
|
|
12231
|
+
containerTop: ct.top
|
|
12231
12232
|
}) : null;
|
|
12232
|
-
st && (
|
|
12233
|
-
const
|
|
12233
|
+
st && (Ae.anchorTop = st.top, Ae.anchorHeight = st.height);
|
|
12234
|
+
const Kt = st !== null && nr({
|
|
12234
12235
|
top: st.top,
|
|
12235
12236
|
bottom: st.top + st.height,
|
|
12236
|
-
viewportTop:
|
|
12237
|
+
viewportTop: $e,
|
|
12237
12238
|
viewportBottom: Tt,
|
|
12238
|
-
viewportHeight:
|
|
12239
|
-
}), Ln =
|
|
12240
|
-
if ((!nt.cachedRect ||
|
|
12239
|
+
viewportHeight: Ye
|
|
12240
|
+
}), Ln = Ae.anchorVersion !== nt.anchorVersion;
|
|
12241
|
+
if ((!nt.cachedRect || Ae.isInViewport || Kt || Ln || !Ae.isMeasured || un && Kt || sn && Ae.isInViewport) && ua(nt, ee)) {
|
|
12241
12242
|
const pt = n0({
|
|
12242
12243
|
elements: nt.elements,
|
|
12243
|
-
viewportTop:
|
|
12244
|
-
viewportBottom:
|
|
12244
|
+
viewportTop: ze.top,
|
|
12245
|
+
viewportBottom: ze.bottom
|
|
12245
12246
|
});
|
|
12246
12247
|
if (pt) {
|
|
12247
|
-
const
|
|
12248
|
-
|
|
12249
|
-
top:
|
|
12248
|
+
const xt = pt.top - ct.top;
|
|
12249
|
+
Ae.anchorTop = xt, Ae.anchorHeight = pt.height, nt.cachedRect = {
|
|
12250
|
+
top: xt,
|
|
12250
12251
|
height: pt.height,
|
|
12251
12252
|
scrollTop: fe.scrollTop,
|
|
12252
|
-
containerTop:
|
|
12253
|
-
}, st = { top:
|
|
12254
|
-
} else st && (
|
|
12253
|
+
containerTop: ct.top
|
|
12254
|
+
}, st = { top: xt, height: pt.height };
|
|
12255
|
+
} else st && (Ae.anchorTop = st.top, Ae.anchorHeight = st.height);
|
|
12255
12256
|
}
|
|
12256
|
-
|
|
12257
|
-
const
|
|
12258
|
-
top:
|
|
12259
|
-
bottom:
|
|
12260
|
-
viewportTop:
|
|
12257
|
+
Ae.anchorVersion = nt.anchorVersion;
|
|
12258
|
+
const jt = Ae.anchorTop !== null && nr({
|
|
12259
|
+
top: Ae.anchorTop,
|
|
12260
|
+
bottom: Ae.anchorTop + Math.max(Ae.anchorHeight, 1),
|
|
12261
|
+
viewportTop: $e,
|
|
12261
12262
|
viewportBottom: Tt,
|
|
12262
|
-
viewportHeight:
|
|
12263
|
-
}),
|
|
12264
|
-
top:
|
|
12265
|
-
bottom:
|
|
12266
|
-
viewportTop:
|
|
12263
|
+
viewportHeight: Ye
|
|
12264
|
+
}), Vt = Ae.translateY ?? Ae.lastCommittedTranslateY, Rt = Ae.isMeasured && Vt !== null && nr({
|
|
12265
|
+
top: Vt,
|
|
12266
|
+
bottom: Vt + Ae.height,
|
|
12267
|
+
viewportTop: $e,
|
|
12267
12268
|
viewportBottom: Tt,
|
|
12268
|
-
viewportHeight:
|
|
12269
|
-
}), It =
|
|
12270
|
-
if (
|
|
12271
|
-
const pt =
|
|
12272
|
-
|
|
12269
|
+
viewportHeight: Ye
|
|
12270
|
+
}), It = jt || Rt;
|
|
12271
|
+
if (Ae.isInViewport !== It) {
|
|
12272
|
+
const pt = Ae.isInViewport;
|
|
12273
|
+
Ae.isInViewport = It, S(
|
|
12273
12274
|
Oe,
|
|
12274
12275
|
ut.Visibility
|
|
12275
|
-
), b(Le), !pt && It && (
|
|
12276
|
+
), b(Le), !pt && It && (Ae.needsTransformSync = !0, C.current.add(Oe), ce = !0);
|
|
12276
12277
|
}
|
|
12277
12278
|
}), B.current.appliedScroll = B.current.scroll, B.current.appliedContainerOffset = B.current.containerOffset;
|
|
12278
|
-
const
|
|
12279
|
+
const zt = I.current.filter((Oe) => {
|
|
12279
12280
|
const Le = R.current.get(Oe);
|
|
12280
12281
|
return !!(Le != null && Le.isInViewport);
|
|
12281
|
-
}), { didChange:
|
|
12282
|
-
|
|
12282
|
+
}), { didChange: on, previousMountedFloatingCardIds: rs } = V(zt);
|
|
12283
|
+
on && zt.forEach((Oe) => {
|
|
12283
12284
|
if (rs.has(Oe))
|
|
12284
12285
|
return;
|
|
12285
12286
|
C.current.add(Oe);
|
|
@@ -12292,9 +12293,9 @@ const Ul = ({
|
|
|
12292
12293
|
const Le = Y.current.cardNodes.get(Oe), tt = R.current.get(Oe);
|
|
12293
12294
|
if (!Le || !tt)
|
|
12294
12295
|
return;
|
|
12295
|
-
const
|
|
12296
|
-
if (
|
|
12297
|
-
tt.height =
|
|
12296
|
+
const Ae = Math.round(Le.offsetHeight);
|
|
12297
|
+
if (Ae > 0 && (!tt.isMeasured || tt.height !== Ae)) {
|
|
12298
|
+
tt.height = Ae, tt.isMeasured = !0;
|
|
12298
12299
|
const At = k(Oe);
|
|
12299
12300
|
S(
|
|
12300
12301
|
Oe,
|
|
@@ -12302,34 +12303,34 @@ const Ul = ({
|
|
|
12302
12303
|
), b(At ?? 0);
|
|
12303
12304
|
}
|
|
12304
12305
|
}), C.current.clear();
|
|
12305
|
-
let
|
|
12306
|
+
let hn = Number.POSITIVE_INFINITY;
|
|
12306
12307
|
const is = I.current.reduce(
|
|
12307
12308
|
(Oe, Le, tt) => {
|
|
12308
|
-
const
|
|
12309
|
-
return !
|
|
12309
|
+
const Ae = R.current.get(Le);
|
|
12310
|
+
return !Ae || Ae.invalidationFlags === ut.None ? Oe : (hn = Math.min(hn, tt), tt);
|
|
12310
12311
|
},
|
|
12311
12312
|
-1
|
|
12312
12313
|
), Bn = Math.min(
|
|
12313
12314
|
N.current.recomputeFromIndex,
|
|
12314
12315
|
Math.max(I.current.length - 1, 0)
|
|
12315
|
-
), xn = !!ge.current && L.current && I.current.length > 0,
|
|
12316
|
+
), xn = !!ge.current && L.current && I.current.length > 0, mn = gu({
|
|
12316
12317
|
floatingCards: E(),
|
|
12317
12318
|
recomputeStartIndex: Bn,
|
|
12318
|
-
firstInvalidatedIndex: xn ? 0 :
|
|
12319
|
+
firstInvalidatedIndex: xn ? 0 : hn,
|
|
12319
12320
|
lastInvalidatedIndex: xn ? I.current.length - 1 : is,
|
|
12320
12321
|
gap: yu,
|
|
12321
12322
|
focusedFloatingCardId: ge.current
|
|
12322
12323
|
});
|
|
12323
|
-
xn &&
|
|
12324
|
+
xn && mn.usedFocusedLayout && (L.current = !1);
|
|
12324
12325
|
let re = 0;
|
|
12325
12326
|
I.current.forEach((Oe) => {
|
|
12326
12327
|
const Le = R.current.get(Oe), tt = Y.current.cardNodes.get(Oe);
|
|
12327
12328
|
if (!Le)
|
|
12328
12329
|
return;
|
|
12329
|
-
const
|
|
12330
|
+
const Ae = mn.placements.get(Oe) ?? {
|
|
12330
12331
|
translateY: Le.translateY,
|
|
12331
12332
|
isVisible: Le.lastCommittedVisible
|
|
12332
|
-
}, At =
|
|
12333
|
+
}, At = Ae.translateY ?? Le.translateY ?? Le.lastCommittedTranslateY;
|
|
12333
12334
|
if (!l && Le.isMeasured && At !== null) {
|
|
12334
12335
|
const wn = Ni(At);
|
|
12335
12336
|
wn !== null && (re = Math.max(
|
|
@@ -12339,11 +12340,11 @@ const Ul = ({
|
|
|
12339
12340
|
}
|
|
12340
12341
|
if (!tt)
|
|
12341
12342
|
return;
|
|
12342
|
-
|
|
12343
|
-
const nt = Ni(
|
|
12343
|
+
mn.placements.has(Oe) && (Le.translateY = Ae.translateY);
|
|
12344
|
+
const nt = Ni(Ae.translateY);
|
|
12344
12345
|
(Le.needsTransformSync && nt !== null || nt !== Le.lastCommittedTranslateY) && nt !== null && (tt.style.transform = `translateY(${nt}px)`, Le.lastCommittedTranslateY = nt, Le.needsTransformSync = !1);
|
|
12345
|
-
const
|
|
12346
|
-
(
|
|
12346
|
+
const Kt = !!Ae.isVisible && Le.isMeasured && Le.anchorTop !== null && !l;
|
|
12347
|
+
(Kt !== Le.lastCommittedVisible || (Le.invalidationFlags & (ut.Visibility | ut.Height)) !== 0) && (tt.style.visibility = Kt ? "visible" : "hidden", tt.style.opacity = Kt ? "1" : "0", Le.lastCommittedVisible = Kt);
|
|
12347
12348
|
});
|
|
12348
12349
|
const as = re > 0 ? re + xu : 0, Et = Math.ceil(
|
|
12349
12350
|
Math.max(Ht, as)
|
|
@@ -12351,7 +12352,7 @@ const Ul = ({
|
|
|
12351
12352
|
W.current !== Et && (oe.style.setProperty(
|
|
12352
12353
|
c0,
|
|
12353
12354
|
`${Et}px`
|
|
12354
|
-
), W.current = Et), y(
|
|
12355
|
+
), W.current = Et), y(mn.stopIndex), N.current.recomputeFromIndex = I.current.length, Pe.size > 0 && Pe.forEach((Oe) => {
|
|
12355
12356
|
t(Oe);
|
|
12356
12357
|
}), ce && Te.length > 0 && P();
|
|
12357
12358
|
}));
|
|
@@ -12539,7 +12540,7 @@ const Ul = ({
|
|
|
12539
12540
|
const ce = se.current.get(Q);
|
|
12540
12541
|
if (!ce)
|
|
12541
12542
|
return;
|
|
12542
|
-
const { anchorId:
|
|
12543
|
+
const { anchorId: Me } = yo(ce), Te = m.current.get(Me);
|
|
12543
12544
|
(!Te || !ua(Te, oe)) && (p(Q), ve = !0);
|
|
12544
12545
|
}), ve && P();
|
|
12545
12546
|
};
|
|
@@ -12706,7 +12707,7 @@ const Ul = ({
|
|
|
12706
12707
|
};
|
|
12707
12708
|
}, g0 = (e) => e instanceof Element ? !!e.closest(
|
|
12708
12709
|
'button, [role="button"], a, [data-inline-comment-actions-menu], [data-radix-popper-content-wrapper]'
|
|
12709
|
-
) : !1, _s =
|
|
12710
|
+
) : !1, _s = wt(({ floatingCardId: e, isHidden: t, isFocused: n, onFocus: s, children: o }, i) => /* @__PURE__ */ r(
|
|
12710
12711
|
"div",
|
|
12711
12712
|
{
|
|
12712
12713
|
ref: i,
|
|
@@ -12733,7 +12734,7 @@ const y0 = ({
|
|
|
12733
12734
|
isHidden: t,
|
|
12734
12735
|
registerCardNode: n
|
|
12735
12736
|
}) => {
|
|
12736
|
-
const s = U((d) => d.focusFloatingCard), o = U((d) => d.inlineDrafts[e.draftId]), i = U((d) => d.username), a = U((d) => d.isConnected), c = O(null), l =
|
|
12737
|
+
const s = U((d) => d.focusFloatingCard), o = U((d) => d.inlineDrafts[e.draftId]), i = U((d) => d.username), a = U((d) => d.isConnected), c = O(null), l = Qt(i), u = M(
|
|
12737
12738
|
(d) => {
|
|
12738
12739
|
c.current = d, n(e.floatingCardId, d);
|
|
12739
12740
|
},
|
|
@@ -12761,7 +12762,7 @@ const y0 = ({
|
|
|
12761
12762
|
children: a ? /* @__PURE__ */ v(rt, { children: [
|
|
12762
12763
|
/* @__PURE__ */ v("div", { className: "flex justify-start items-center gap-2 color-border-default px-3 pb-2 pt-3", children: [
|
|
12763
12764
|
/* @__PURE__ */ r(
|
|
12764
|
-
|
|
12765
|
+
Xt,
|
|
12765
12766
|
{
|
|
12766
12767
|
src: l.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
12767
12768
|
l.name
|
|
@@ -12801,7 +12802,7 @@ const y0 = ({
|
|
|
12801
12802
|
a.current && ht(a.current);
|
|
12802
12803
|
}, [e == null ? void 0 : e.text]), /* @__PURE__ */ v("div", { className: "flex flex-col gap-3 p-3 pb-0 pt-0", children: [
|
|
12803
12804
|
/* @__PURE__ */ r("div", { className: "border flex px-[12px] py-[8px] gap-[8px] rounded-[4px]", children: /* @__PURE__ */ r(
|
|
12804
|
-
|
|
12805
|
+
yn,
|
|
12805
12806
|
{
|
|
12806
12807
|
ref: a,
|
|
12807
12808
|
value: e.text,
|
|
@@ -12844,7 +12845,7 @@ const y0 = ({
|
|
|
12844
12845
|
isHidden: t,
|
|
12845
12846
|
registerCardNode: n
|
|
12846
12847
|
}) => {
|
|
12847
|
-
const s = U((y) => y.focusFloatingCard), o = U((y) => y.submitDraft), i = U((y) => y.discardDraft), a = U((y) => y.isConnected), c = !!e.selectedText, l = !!e.insertedText, u = !!e.linkHref, d = c || l || u, h = U((y) => y.username), m =
|
|
12848
|
+
const s = U((y) => y.focusFloatingCard), o = U((y) => y.submitDraft), i = U((y) => y.discardDraft), a = U((y) => y.isConnected), c = !!e.selectedText, l = !!e.insertedText, u = !!e.linkHref, d = c || l || u, h = U((y) => y.username), m = Qt(h), p = M(() => {
|
|
12848
12849
|
o(e.suggestionId);
|
|
12849
12850
|
}, [e.suggestionId, o]), { submitLabel: f } = Pl({
|
|
12850
12851
|
suggestionId: e.suggestionId,
|
|
@@ -12867,7 +12868,7 @@ const y0 = ({
|
|
|
12867
12868
|
children: a ? /* @__PURE__ */ v("div", { className: "flex flex-col gap-2 p-3 pb-0", children: [
|
|
12868
12869
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
12869
12870
|
/* @__PURE__ */ r(
|
|
12870
|
-
|
|
12871
|
+
Xt,
|
|
12871
12872
|
{
|
|
12872
12873
|
src: m.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
12873
12874
|
m.name
|
|
@@ -12991,10 +12992,10 @@ const y0 = ({
|
|
|
12991
12992
|
onAccept: i,
|
|
12992
12993
|
onReject: a
|
|
12993
12994
|
}) => {
|
|
12994
|
-
const c =
|
|
12995
|
+
const c = Qt(e);
|
|
12995
12996
|
return /* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
12996
12997
|
/* @__PURE__ */ r(
|
|
12997
|
-
|
|
12998
|
+
Xt,
|
|
12998
12999
|
{
|
|
12999
13000
|
src: c.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
13000
13001
|
c.name
|
|
@@ -13098,7 +13099,7 @@ const y0 = ({
|
|
|
13098
13099
|
thread: e,
|
|
13099
13100
|
comment: t
|
|
13100
13101
|
}) => {
|
|
13101
|
-
const n = U((g) => g.username), s = U((g) => g.isConnected), o = U((g) => g.handleAddReply), i = U((g) => g.setCommentDrawerOpen), [a, c] = G(""), [l, u] = G(!1), d = O(null), h = !t.resolved && !t.deleted, m = !!a.trim(), p = s && (e.isFocused || m), f =
|
|
13102
|
+
const n = U((g) => g.username), s = U((g) => g.isConnected), o = U((g) => g.handleAddReply), i = U((g) => g.setCommentDrawerOpen), [a, c] = G(""), [l, u] = G(!1), d = O(null), h = !t.resolved && !t.deleted, m = !!a.trim(), p = s && (e.isFocused || m), f = Qt(n);
|
|
13102
13103
|
H(() => {
|
|
13103
13104
|
d.current && ht(d.current);
|
|
13104
13105
|
}, [a]);
|
|
@@ -13121,7 +13122,7 @@ const y0 = ({
|
|
|
13121
13122
|
),
|
|
13122
13123
|
children: [
|
|
13123
13124
|
/* @__PURE__ */ r(
|
|
13124
|
-
|
|
13125
|
+
Xt,
|
|
13125
13126
|
{
|
|
13126
13127
|
src: f.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
13127
13128
|
f.name || ""
|
|
@@ -13130,7 +13131,7 @@ const y0 = ({
|
|
|
13130
13131
|
}
|
|
13131
13132
|
),
|
|
13132
13133
|
/* @__PURE__ */ r(
|
|
13133
|
-
|
|
13134
|
+
yn,
|
|
13134
13135
|
{
|
|
13135
13136
|
ref: d,
|
|
13136
13137
|
value: a,
|
|
@@ -13256,7 +13257,7 @@ const y0 = ({
|
|
|
13256
13257
|
comment: e,
|
|
13257
13258
|
thread: t
|
|
13258
13259
|
}) => {
|
|
13259
|
-
const n = U((b) => b.username), [s, o] = G(!1), i = !(e != null && e.resolved) && !!e, a = U((b) => b.setCommentDrawerOpen), c = U((b) => b.handleAddReply), l = U((b) => b.editRequest), u = U((b) => b.clearEditRequest), d = U((b) => b.replyEditTarget), h = U((b) => b.setReplyEditTarget), m = U((b) => b.cancelReplyEdit), p = U((b) => b.editCompletion), f = U((b) => b.editCommentContent), x = U((b) => b.editReplyContent), g = O(null), [y, R] = G(""), E = U((b) => b.isConnected), k =
|
|
13260
|
+
const n = U((b) => b.username), [s, o] = G(!1), i = !(e != null && e.resolved) && !!e, a = U((b) => b.setCommentDrawerOpen), c = U((b) => b.handleAddReply), l = U((b) => b.editRequest), u = U((b) => b.clearEditRequest), d = U((b) => b.replyEditTarget), h = U((b) => b.setReplyEditTarget), m = U((b) => b.cancelReplyEdit), p = U((b) => b.editCompletion), f = U((b) => b.editCommentContent), x = U((b) => b.editReplyContent), g = O(null), [y, R] = G(""), E = U((b) => b.isConnected), k = Qt(n), A = () => {
|
|
13260
13261
|
if (!(!t.commentId || !y.trim())) {
|
|
13261
13262
|
if (!E) {
|
|
13262
13263
|
a == null || a(!0);
|
|
@@ -13296,7 +13297,7 @@ const y0 = ({
|
|
|
13296
13297
|
),
|
|
13297
13298
|
children: [
|
|
13298
13299
|
/* @__PURE__ */ r(
|
|
13299
|
-
|
|
13300
|
+
Xt,
|
|
13300
13301
|
{
|
|
13301
13302
|
src: k.isEns ? Pt : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
13302
13303
|
k.name
|
|
@@ -13305,7 +13306,7 @@ const y0 = ({
|
|
|
13305
13306
|
}
|
|
13306
13307
|
),
|
|
13307
13308
|
/* @__PURE__ */ r(
|
|
13308
|
-
|
|
13309
|
+
yn,
|
|
13309
13310
|
{
|
|
13310
13311
|
ref: g,
|
|
13311
13312
|
value: y,
|
|
@@ -13498,7 +13499,7 @@ const y0 = ({
|
|
|
13498
13499
|
children: [
|
|
13499
13500
|
/* @__PURE__ */ r("span", { className: "truncate", children: e.textContent }),
|
|
13500
13501
|
/* @__PURE__ */ r(
|
|
13501
|
-
|
|
13502
|
+
Ge,
|
|
13502
13503
|
{
|
|
13503
13504
|
text: c ? "Heading link copied" : "Copy heading link",
|
|
13504
13505
|
position: "right",
|
|
@@ -13529,7 +13530,7 @@ const Kl = vo(() => /* @__PURE__ */ r("p", { className: "text-helper-text-sm px-
|
|
|
13529
13530
|
Kl.displayName = "ToCEmptyState";
|
|
13530
13531
|
const jl = vo(
|
|
13531
13532
|
({ items: e = [], editor: t, setItems: n, orientation: s }) => {
|
|
13532
|
-
const [o, i] = G(null), a =
|
|
13533
|
+
const [o, i] = G(null), a = kt("(max-width: 1280px)"), c = kt("(min-width: 1280px)"), l = O(null), u = O(0), d = O(null), h = ke(() => e.map((y) => ({
|
|
13533
13534
|
...y,
|
|
13534
13535
|
isActive: En(y.id) && y.id === o
|
|
13535
13536
|
})), [e, o]), m = M(() => {
|
|
@@ -13667,7 +13668,7 @@ const jl = vo(
|
|
|
13667
13668
|
}
|
|
13668
13669
|
);
|
|
13669
13670
|
jl.displayName = "ToC";
|
|
13670
|
-
const xo =
|
|
13671
|
+
const xo = Xe.memo(jl), wr = ({
|
|
13671
13672
|
emoji: e,
|
|
13672
13673
|
setEmoji: t,
|
|
13673
13674
|
isEditing: n,
|
|
@@ -13784,7 +13785,7 @@ const xo = Qe.memo(jl), wr = ({
|
|
|
13784
13785
|
ref: (x) => {
|
|
13785
13786
|
l.current = x;
|
|
13786
13787
|
},
|
|
13787
|
-
children: /* @__PURE__ */ r(
|
|
13788
|
+
children: /* @__PURE__ */ r(Ge, { position: "top", text: "Choose emoji", children: /* @__PURE__ */ r(
|
|
13788
13789
|
ue,
|
|
13789
13790
|
{
|
|
13790
13791
|
onClick: () => {
|
|
@@ -14227,7 +14228,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14227
14228
|
}
|
|
14228
14229
|
),
|
|
14229
14230
|
e ? /* @__PURE__ */ r(
|
|
14230
|
-
|
|
14231
|
+
Gt,
|
|
14231
14232
|
{
|
|
14232
14233
|
"data-testid": "tab-rename-input",
|
|
14233
14234
|
ref: Y,
|
|
@@ -14248,7 +14249,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14248
14249
|
},
|
|
14249
14250
|
className: "h-[24px] px-[6px] py-0 rounded-[6px] text-heading-xsm border-transparent focus-visible:ring-2 focus-visible:ring-[hsl(var(--color-border-focused))]"
|
|
14250
14251
|
}
|
|
14251
|
-
) : /* @__PURE__ */ r("div", { className: "min-w-0 flex [&>*]:w-full", children: /* @__PURE__ */ r(
|
|
14252
|
+
) : /* @__PURE__ */ r("div", { className: "min-w-0 flex [&>*]:w-full", children: /* @__PURE__ */ r(Ge, { text: ne, position: "bottom", children: /* @__PURE__ */ r(
|
|
14252
14253
|
"span",
|
|
14253
14254
|
{
|
|
14254
14255
|
"data-testid": `tab-name-${n}`,
|
|
@@ -14333,7 +14334,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14333
14334
|
onMouseEnter: () => n(!0),
|
|
14334
14335
|
onMouseLeave: () => n(!1),
|
|
14335
14336
|
className: "[&_[data-testid='tooltip-trigger']]:w-full [&_[data-testid='tooltip-trigger']]:block",
|
|
14336
|
-
children: /* @__PURE__ */ r(
|
|
14337
|
+
children: /* @__PURE__ */ r(Ge, { text: e.tooltipText, position: "top", open: t, children: o })
|
|
14337
14338
|
}
|
|
14338
14339
|
) : o;
|
|
14339
14340
|
}, Wl = ({
|
|
@@ -14710,7 +14711,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14710
14711
|
),
|
|
14711
14712
|
children: [
|
|
14712
14713
|
(!A || s) && /* @__PURE__ */ r(
|
|
14713
|
-
|
|
14714
|
+
Ge,
|
|
14714
14715
|
{
|
|
14715
14716
|
text: s ? "Hide tabs and outlines" : "Show tabs and outlines",
|
|
14716
14717
|
position: "right",
|
|
@@ -14930,7 +14931,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14930
14931
|
) }),
|
|
14931
14932
|
/* @__PURE__ */ r(Fr, { className: "border-b px-4 py-3", children: /* @__PURE__ */ r(Or, { children: /* @__PURE__ */ r("p", { className: "text-heading-sm", children: "Rename tab" }) }) }),
|
|
14932
14933
|
/* @__PURE__ */ r("div", { className: "space-x-md", children: /* @__PURE__ */ r(
|
|
14933
|
-
|
|
14934
|
+
Gt,
|
|
14934
14935
|
{
|
|
14935
14936
|
"data-testid": "tab-rename-modal-input",
|
|
14936
14937
|
autoFocus: !0,
|
|
@@ -15366,7 +15367,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15366
15367
|
setShowTOC: i,
|
|
15367
15368
|
orientation: a
|
|
15368
15369
|
}) => {
|
|
15369
|
-
const c =
|
|
15370
|
+
const c = kt("(max-width:1280px)"), l = n.length < 2;
|
|
15370
15371
|
return c ? /* @__PURE__ */ r(
|
|
15371
15372
|
lh,
|
|
15372
15373
|
{
|
|
@@ -15400,7 +15401,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15400
15401
|
),
|
|
15401
15402
|
children: [
|
|
15402
15403
|
/* @__PURE__ */ r(
|
|
15403
|
-
|
|
15404
|
+
Ge,
|
|
15404
15405
|
{
|
|
15405
15406
|
text: o ? "Hide document outline" : "Show document outline",
|
|
15406
15407
|
position: "right",
|
|
@@ -15467,7 +15468,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15467
15468
|
tabPanelSlot: b,
|
|
15468
15469
|
ddocId: T
|
|
15469
15470
|
}) => {
|
|
15470
|
-
const I =
|
|
15471
|
+
const I = kt("(max-width:1280px)");
|
|
15471
15472
|
return l.length ? !I || E ? /* @__PURE__ */ r(
|
|
15472
15473
|
z0,
|
|
15473
15474
|
{
|
|
@@ -15803,7 +15804,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15803
15804
|
}
|
|
15804
15805
|
),
|
|
15805
15806
|
/* @__PURE__ */ r(
|
|
15806
|
-
|
|
15807
|
+
Gt,
|
|
15807
15808
|
{
|
|
15808
15809
|
type: "number",
|
|
15809
15810
|
id: "lineHeight",
|
|
@@ -15833,7 +15834,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15833
15834
|
}
|
|
15834
15835
|
),
|
|
15835
15836
|
/* @__PURE__ */ r(
|
|
15836
|
-
|
|
15837
|
+
Gt,
|
|
15837
15838
|
{
|
|
15838
15839
|
type: "number",
|
|
15839
15840
|
min: 0,
|
|
@@ -15865,7 +15866,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15865
15866
|
}
|
|
15866
15867
|
),
|
|
15867
15868
|
/* @__PURE__ */ r(
|
|
15868
|
-
|
|
15869
|
+
Gt,
|
|
15869
15870
|
{
|
|
15870
15871
|
type: "number",
|
|
15871
15872
|
id: "spaceAfter",
|
|
@@ -16036,7 +16037,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
16036
16037
|
"zoom-levels"
|
|
16037
16038
|
),
|
|
16038
16039
|
/* @__PURE__ */ r(
|
|
16039
|
-
|
|
16040
|
+
Ge,
|
|
16040
16041
|
{
|
|
16041
16042
|
text: n ? "Hide tabs and outlines sidebar" : "Show tabs and outlines sidebar",
|
|
16042
16043
|
position: "bottom",
|
|
@@ -16053,7 +16054,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
16053
16054
|
)
|
|
16054
16055
|
}
|
|
16055
16056
|
),
|
|
16056
|
-
/* @__PURE__ */ r(
|
|
16057
|
+
/* @__PURE__ */ r(Ge, { text: "Exit focus mode", children: /* @__PURE__ */ r(
|
|
16057
16058
|
we,
|
|
16058
16059
|
{
|
|
16059
16060
|
icon: "Minimize",
|
|
@@ -18859,7 +18860,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18859
18860
|
type: "heading",
|
|
18860
18861
|
attrs: { textAlign: "left", level: e },
|
|
18861
18862
|
content: t
|
|
18862
|
-
}),
|
|
18863
|
+
}), Ze = (e) => ({
|
|
18863
18864
|
type: "dBlock",
|
|
18864
18865
|
content: [e]
|
|
18865
18866
|
}), _e = (e) => Fe(e, [{ type: "bold" }]), We = (e) => Fe(e, [{ type: "italic" }]), ig = (e) => ({
|
|
@@ -18872,7 +18873,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18872
18873
|
}), ag = {
|
|
18873
18874
|
type: "doc",
|
|
18874
18875
|
content: [
|
|
18875
|
-
|
|
18876
|
+
Ze(
|
|
18876
18877
|
In(1, [
|
|
18877
18878
|
Fe("Fanfic Planner ⋆⁺₊✧", [
|
|
18878
18879
|
{
|
|
@@ -18882,7 +18883,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18882
18883
|
])
|
|
18883
18884
|
])
|
|
18884
18885
|
),
|
|
18885
|
-
|
|
18886
|
+
Ze({
|
|
18886
18887
|
type: "callout",
|
|
18887
18888
|
content: [
|
|
18888
18889
|
Ot([
|
|
@@ -18894,9 +18895,9 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18894
18895
|
])
|
|
18895
18896
|
]
|
|
18896
18897
|
}),
|
|
18897
|
-
|
|
18898
|
-
|
|
18899
|
-
|
|
18898
|
+
Ze(Ot([])),
|
|
18899
|
+
Ze(In(1, [Fe("☾ Ship Basis")])),
|
|
18900
|
+
Ze(
|
|
18900
18901
|
Gn([
|
|
18901
18902
|
[_e("Title"), Fe(":")],
|
|
18902
18903
|
[_e("Fandom:")],
|
|
@@ -18908,20 +18909,20 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18908
18909
|
[_e("Length:")]
|
|
18909
18910
|
])
|
|
18910
18911
|
),
|
|
18911
|
-
|
|
18912
|
-
|
|
18912
|
+
Ze(In(3, [Fe("Premise")])),
|
|
18913
|
+
Ze(
|
|
18913
18914
|
Ot([We("[The idea that made you open this cute dDoc]")])
|
|
18914
18915
|
),
|
|
18915
|
-
|
|
18916
|
-
|
|
18916
|
+
Ze(In(3, [Fe("Summary")])),
|
|
18917
|
+
Ze(
|
|
18917
18918
|
Ot([We("[A little spicy blurb to hook your readers in]")])
|
|
18918
18919
|
)
|
|
18919
18920
|
]
|
|
18920
18921
|
}, lg = {
|
|
18921
18922
|
type: "doc",
|
|
18922
18923
|
content: [
|
|
18923
|
-
|
|
18924
|
-
|
|
18924
|
+
Ze(In(1, [Fe("★Plot & outline")])),
|
|
18925
|
+
Ze(
|
|
18925
18926
|
Ot([
|
|
18926
18927
|
_e("Brain dump"),
|
|
18927
18928
|
Fe(" "),
|
|
@@ -18930,8 +18931,8 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18930
18931
|
)
|
|
18931
18932
|
])
|
|
18932
18933
|
),
|
|
18933
|
-
|
|
18934
|
-
|
|
18934
|
+
Ze(Ot([_e("The spine")])),
|
|
18935
|
+
Ze(
|
|
18935
18936
|
Gn([
|
|
18936
18937
|
[
|
|
18937
18938
|
_e("Hook"),
|
|
@@ -18952,8 +18953,8 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18952
18953
|
]
|
|
18953
18954
|
])
|
|
18954
18955
|
),
|
|
18955
|
-
|
|
18956
|
-
|
|
18956
|
+
Ze(Ot([_e("The skeleton")])),
|
|
18957
|
+
Ze(
|
|
18957
18958
|
Gn([
|
|
18958
18959
|
[
|
|
18959
18960
|
_e("Beginning"),
|
|
@@ -18972,7 +18973,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18972
18973
|
]
|
|
18973
18974
|
])
|
|
18974
18975
|
),
|
|
18975
|
-
|
|
18976
|
+
Ze(
|
|
18976
18977
|
Ot([
|
|
18977
18978
|
_e("Scenes in order"),
|
|
18978
18979
|
Fe(" "),
|
|
@@ -18981,14 +18982,14 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18981
18982
|
)
|
|
18982
18983
|
])
|
|
18983
18984
|
),
|
|
18984
|
-
|
|
18985
|
+
Ze(
|
|
18985
18986
|
Ot([
|
|
18986
18987
|
_e("Chapter breakdown"),
|
|
18987
18988
|
Fe(" "),
|
|
18988
18989
|
We("(if multichap)")
|
|
18989
18990
|
])
|
|
18990
18991
|
),
|
|
18991
|
-
|
|
18992
|
+
Ze(
|
|
18992
18993
|
Gn([
|
|
18993
18994
|
[_e("Chapter 1"), Fe(": "), We("[beat + hook]")],
|
|
18994
18995
|
[_e("Chapter 2"), Fe(": "), We("[beat + hook]")]
|
|
@@ -18998,9 +18999,9 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18998
18999
|
}, cg = {
|
|
18999
19000
|
type: "doc",
|
|
19000
19001
|
content: [
|
|
19001
|
-
|
|
19002
|
-
|
|
19003
|
-
|
|
19002
|
+
Ze(In(1, [Fe("𖠋 Characters")])),
|
|
19003
|
+
Ze(Ot([We("[Copy this block for each character]")])),
|
|
19004
|
+
Ze(
|
|
19004
19005
|
Gn([
|
|
19005
19006
|
[_e("name / role"), Fe(":")],
|
|
19006
19007
|
[
|
|
@@ -19046,15 +19047,15 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19046
19047
|
}, dg = {
|
|
19047
19048
|
type: "doc",
|
|
19048
19049
|
content: [
|
|
19049
|
-
|
|
19050
|
-
|
|
19050
|
+
Ze(In(1, [Fe("꩜ World & Canon")])),
|
|
19051
|
+
Ze(
|
|
19051
19052
|
Ot([
|
|
19052
19053
|
We(
|
|
19053
19054
|
"[for AUs, canon-divergence, and fix-its. Skip if canon-compliant]"
|
|
19054
19055
|
)
|
|
19055
19056
|
])
|
|
19056
19057
|
),
|
|
19057
|
-
|
|
19058
|
+
Ze(
|
|
19058
19059
|
Gn([
|
|
19059
19060
|
[
|
|
19060
19061
|
_e("Divergence"),
|
|
@@ -19174,7 +19175,7 @@ const O0 = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19174
19175
|
u
|
|
19175
19176
|
)),
|
|
19176
19177
|
/* @__PURE__ */ r(
|
|
19177
|
-
|
|
19178
|
+
vt,
|
|
19178
19179
|
{
|
|
19179
19180
|
align: "end",
|
|
19180
19181
|
sideOffset: 10,
|
|
@@ -19261,7 +19262,7 @@ var gg = class ec {
|
|
|
19261
19262
|
const n = t.resolve(this.anchor), s = t.resolve(this.head);
|
|
19262
19263
|
return new cn(n, s);
|
|
19263
19264
|
}
|
|
19264
|
-
}, cn = class
|
|
19265
|
+
}, cn = class fn extends Eu {
|
|
19265
19266
|
constructor(t, n, s, o = 1) {
|
|
19266
19267
|
const { doc: i } = t, a = t === n, c = t.pos === i.content.size && n.pos === i.content.size, l = a && !c ? i.resolve(n.pos + (o > 0 ? 1 : -1)) : n, u = a && c ? i.resolve(t.pos - (o > 0 ? 1 : -1)) : t, d = Eo(u.min(l), u.max(l), s), h = l.pos >= t.pos ? d[0].$from : d[d.length - 1].$to, m = l.pos >= t.pos ? d[d.length - 1].$to : d[0].$from;
|
|
19267
19268
|
super(h, m, d), this.depth = s;
|
|
@@ -19272,11 +19273,11 @@ var gg = class ec {
|
|
|
19272
19273
|
return this.ranges[this.ranges.length - 1].$to;
|
|
19273
19274
|
}
|
|
19274
19275
|
eq(t) {
|
|
19275
|
-
return t instanceof
|
|
19276
|
+
return t instanceof fn && t.$from.pos === this.$from.pos && t.$to.pos === this.$to.pos;
|
|
19276
19277
|
}
|
|
19277
19278
|
map(t, n) {
|
|
19278
19279
|
const s = t.resolve(n.map(this.anchor)), o = t.resolve(n.map(this.head));
|
|
19279
|
-
return new
|
|
19280
|
+
return new fn(s, o);
|
|
19280
19281
|
}
|
|
19281
19282
|
toJSON() {
|
|
19282
19283
|
return {
|
|
@@ -19295,22 +19296,22 @@ var gg = class ec {
|
|
|
19295
19296
|
const { doc: t } = this.$from;
|
|
19296
19297
|
if (this.isForwards && this.ranges.length > 1) {
|
|
19297
19298
|
const o = this.ranges.slice(0, -1), i = o[0].$from, a = o[o.length - 1].$to;
|
|
19298
|
-
return new
|
|
19299
|
+
return new fn(i, a, this.depth);
|
|
19299
19300
|
}
|
|
19300
19301
|
const n = this.ranges[0], s = t.resolve(Math.max(0, n.$from.pos - 1));
|
|
19301
|
-
return new
|
|
19302
|
+
return new fn(this.$anchor, s, this.depth);
|
|
19302
19303
|
}
|
|
19303
19304
|
extendForwards() {
|
|
19304
19305
|
const { doc: t } = this.$from;
|
|
19305
19306
|
if (this.isBackwards && this.ranges.length > 1) {
|
|
19306
19307
|
const o = this.ranges.slice(1), i = o[0].$from, a = o[o.length - 1].$to;
|
|
19307
|
-
return new
|
|
19308
|
+
return new fn(a, i, this.depth);
|
|
19308
19309
|
}
|
|
19309
19310
|
const n = this.ranges[this.ranges.length - 1], s = t.resolve(Math.min(t.content.size, n.$to.pos + 1));
|
|
19310
|
-
return new
|
|
19311
|
+
return new fn(this.$anchor, s, this.depth);
|
|
19311
19312
|
}
|
|
19312
19313
|
static fromJSON(t, n) {
|
|
19313
|
-
return new
|
|
19314
|
+
return new fn(t.resolve(n.anchor), t.resolve(n.head));
|
|
19314
19315
|
}
|
|
19315
19316
|
static create(t, n, s, o, i = 1) {
|
|
19316
19317
|
return new this(t.resolve(n), t.resolve(s), o, i);
|
|
@@ -19795,8 +19796,8 @@ const Ag = (e, t) => {
|
|
|
19795
19796
|
copyNodeToClipboard: i,
|
|
19796
19797
|
deleteNode: a
|
|
19797
19798
|
};
|
|
19798
|
-
}, xs =
|
|
19799
|
-
|
|
19799
|
+
}, xs = Xe.memo(
|
|
19800
|
+
wt(({ onClick: e, icon: t, text: n, variant: s = "ghost", className: o = "" }, i) => /* @__PURE__ */ r(ko, { asChild: !0, children: /* @__PURE__ */ v(
|
|
19800
19801
|
Ne,
|
|
19801
19802
|
{
|
|
19802
19803
|
ref: i,
|
|
@@ -19811,8 +19812,8 @@ const Ag = (e, t) => {
|
|
|
19811
19812
|
) }))
|
|
19812
19813
|
);
|
|
19813
19814
|
xs.displayName = "ActionButton";
|
|
19814
|
-
const rc =
|
|
19815
|
-
|
|
19815
|
+
const rc = Xe.memo(
|
|
19816
|
+
wt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
|
|
19816
19817
|
we,
|
|
19817
19818
|
{
|
|
19818
19819
|
icon: "GripVertical",
|
|
@@ -19829,8 +19830,8 @@ const rc = Qe.memo(
|
|
|
19829
19830
|
))
|
|
19830
19831
|
);
|
|
19831
19832
|
rc.displayName = "GripButton";
|
|
19832
|
-
const ic =
|
|
19833
|
-
|
|
19833
|
+
const ic = Xe.memo(
|
|
19834
|
+
wt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
|
|
19834
19835
|
we,
|
|
19835
19836
|
{
|
|
19836
19837
|
icon: "Plus",
|
|
@@ -19844,8 +19845,8 @@ const ic = Qe.memo(
|
|
|
19844
19845
|
))
|
|
19845
19846
|
);
|
|
19846
19847
|
ic.displayName = "PlusButton";
|
|
19847
|
-
const ac =
|
|
19848
|
-
|
|
19848
|
+
const ac = Xe.memo(
|
|
19849
|
+
wt(({ isCollapsed: e, onToggle: t, className: n, ...s }, o) => /* @__PURE__ */ r(
|
|
19849
19850
|
we,
|
|
19850
19851
|
{
|
|
19851
19852
|
variant: "ghost",
|
|
@@ -19860,8 +19861,8 @@ const ac = Qe.memo(
|
|
|
19860
19861
|
))
|
|
19861
19862
|
);
|
|
19862
19863
|
ac.displayName = "CollapseButton";
|
|
19863
|
-
const lc =
|
|
19864
|
-
|
|
19864
|
+
const lc = Xe.memo(
|
|
19865
|
+
wt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
|
|
19865
19866
|
we,
|
|
19866
19867
|
{
|
|
19867
19868
|
variant: "ghost",
|
|
@@ -19876,14 +19877,14 @@ const lc = Qe.memo(
|
|
|
19876
19877
|
))
|
|
19877
19878
|
);
|
|
19878
19879
|
lc.displayName = "CopyLinkButton";
|
|
19879
|
-
const cc =
|
|
19880
|
+
const cc = wt(
|
|
19880
19881
|
// flex kills the inherited line-box height (24px) that otherwise makes
|
|
19881
19882
|
// this wrapper taller than the 20px grip button and top-aligns it 2px
|
|
19882
19883
|
// above its sibling buttons in the cluster row.
|
|
19883
19884
|
(e, t) => /* @__PURE__ */ r("div", { ref: t, className: "flex items-center", children: e.children })
|
|
19884
19885
|
);
|
|
19885
19886
|
cc.displayName = "MenuTrigger";
|
|
19886
|
-
const Rg =
|
|
19887
|
+
const Rg = Xe.memo(
|
|
19887
19888
|
({ isOpen: e, onOpenChange: t, trigger: n, actions: s }) => /* @__PURE__ */ r(Xh, { onMountAutoFocus: (o) => o.preventDefault(), trapped: !1, children: /* @__PURE__ */ v(ts, { open: e, onOpenChange: t, children: [
|
|
19888
19889
|
/* @__PURE__ */ r(Is, { asChild: !0, children: /* @__PURE__ */ r(cc, { children: n }) }),
|
|
19889
19890
|
/* @__PURE__ */ r(
|
|
@@ -19952,13 +19953,13 @@ const Rg = Qe.memo(
|
|
|
19952
19953
|
}
|
|
19953
19954
|
};
|
|
19954
19955
|
}
|
|
19955
|
-
}, Ao =
|
|
19956
|
+
}, Ao = Xe.memo(
|
|
19956
19957
|
({
|
|
19957
19958
|
text: e,
|
|
19958
19959
|
position: t = "bottom",
|
|
19959
19960
|
children: n
|
|
19960
|
-
}) => /* @__PURE__ */ r(
|
|
19961
|
-
), Dg =
|
|
19961
|
+
}) => /* @__PURE__ */ r(Ge, { text: e, position: t, asTriggerChild: !0, children: n })
|
|
19962
|
+
), Dg = Xe.memo(
|
|
19962
19963
|
({ children: e }) => /* @__PURE__ */ r(
|
|
19963
19964
|
Ao,
|
|
19964
19965
|
{
|
|
@@ -19970,7 +19971,7 @@ const Rg = Qe.memo(
|
|
|
19970
19971
|
children: e
|
|
19971
19972
|
}
|
|
19972
19973
|
)
|
|
19973
|
-
), Mg =
|
|
19974
|
+
), Mg = Xe.memo(
|
|
19974
19975
|
({ children: e }) => /* @__PURE__ */ r(
|
|
19975
19976
|
Ao,
|
|
19976
19977
|
{
|
|
@@ -19982,7 +19983,7 @@ const Rg = Qe.memo(
|
|
|
19982
19983
|
children: e
|
|
19983
19984
|
}
|
|
19984
19985
|
)
|
|
19985
|
-
), Fg =
|
|
19986
|
+
), Fg = Xe.memo(
|
|
19986
19987
|
({
|
|
19987
19988
|
isCollapsed: e,
|
|
19988
19989
|
children: t
|
|
@@ -19994,7 +19995,7 @@ const Rg = Qe.memo(
|
|
|
19994
19995
|
children: t
|
|
19995
19996
|
}
|
|
19996
19997
|
)
|
|
19997
|
-
), Og =
|
|
19998
|
+
), Og = Xe.memo(
|
|
19998
19999
|
({ children: e }) => /* @__PURE__ */ r(Ao, { text: "Copy link to heading", position: "bottom", children: e })
|
|
19999
20000
|
), Bg = 24, Ta = (e, t) => {
|
|
20000
20001
|
try {
|
|
@@ -20043,7 +20044,7 @@ const Rg = Qe.memo(
|
|
|
20043
20044
|
}) => {
|
|
20044
20045
|
const [s, o] = G(null), [i, a] = G(!1), c = O(null), { scale: l } = Bs(), u = O(l);
|
|
20045
20046
|
u.current = l;
|
|
20046
|
-
const d =
|
|
20047
|
+
const d = kt("(max-width: 767px)"), h = M(
|
|
20047
20048
|
() => s ? Lg(e, s.pos) : null,
|
|
20048
20049
|
[e, s]
|
|
20049
20050
|
), m = Ag(e, h), p = M(
|
|
@@ -20437,7 +20438,7 @@ const Rg = Qe.memo(
|
|
|
20437
20438
|
children: /* @__PURE__ */ v(Ut.div, { className: "p-2 border color-border-default w-80 max-w-full rounded-lg space-y-2 color-bg-default", children: [
|
|
20438
20439
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-2 pr-1 pl-2 border rounded-md", children: [
|
|
20439
20440
|
/* @__PURE__ */ r(
|
|
20440
|
-
|
|
20441
|
+
Gt,
|
|
20441
20442
|
{
|
|
20442
20443
|
placeholder: "Search text...",
|
|
20443
20444
|
value: s,
|
|
@@ -20449,7 +20450,7 @@ const Rg = Qe.memo(
|
|
|
20449
20450
|
p !== void 0 && /* @__PURE__ */ r(rt, { children: p > 0 ? /* @__PURE__ */ r("span", { className: "color-text-secondary text-sm", children: `${typeof f == "number" ? f + 1 : "?"}/${p}` }) : s !== "" ? /* @__PURE__ */ r("span", { className: "color-text-secondary text-sm", children: "0/0" }) : null }),
|
|
20450
20451
|
p !== void 0 && /* @__PURE__ */ v("div", { className: "flex items-center", children: [
|
|
20451
20452
|
/* @__PURE__ */ v("div", { className: "flex items-center", children: [
|
|
20452
|
-
/* @__PURE__ */ r(
|
|
20453
|
+
/* @__PURE__ */ r(Ge, { text: "Previous", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
20453
20454
|
we,
|
|
20454
20455
|
{
|
|
20455
20456
|
icon: "ArrowUp",
|
|
@@ -20460,7 +20461,7 @@ const Rg = Qe.memo(
|
|
|
20460
20461
|
onClick: w
|
|
20461
20462
|
}
|
|
20462
20463
|
) }),
|
|
20463
|
-
/* @__PURE__ */ r(
|
|
20464
|
+
/* @__PURE__ */ r(Ge, { text: "Next", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
20464
20465
|
we,
|
|
20465
20466
|
{
|
|
20466
20467
|
icon: "ArrowDown",
|
|
@@ -20472,7 +20473,7 @@ const Rg = Qe.memo(
|
|
|
20472
20473
|
}
|
|
20473
20474
|
) })
|
|
20474
20475
|
] }),
|
|
20475
|
-
!n && /* @__PURE__ */ r(
|
|
20476
|
+
!n && /* @__PURE__ */ r(Ge, { text: "Replace", children: /* @__PURE__ */ r(
|
|
20476
20477
|
we,
|
|
20477
20478
|
{
|
|
20478
20479
|
icon: "Replace",
|
|
@@ -20495,7 +20496,7 @@ const Rg = Qe.memo(
|
|
|
20495
20496
|
layout: "size",
|
|
20496
20497
|
children: [
|
|
20497
20498
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 px-2 border rounded-md", children: /* @__PURE__ */ r(
|
|
20498
|
-
|
|
20499
|
+
Gt,
|
|
20499
20500
|
{
|
|
20500
20501
|
placeholder: "Replace with...",
|
|
20501
20502
|
value: o,
|
|
@@ -20566,7 +20567,7 @@ var Wg = {
|
|
|
20566
20567
|
* This source code is licensed under the ISC license.
|
|
20567
20568
|
* See the LICENSE file in the root directory of this source tree.
|
|
20568
20569
|
*/
|
|
20569
|
-
const qg =
|
|
20570
|
+
const qg = wt(
|
|
20570
20571
|
({
|
|
20571
20572
|
color: e = "currentColor",
|
|
20572
20573
|
size: t = 24,
|
|
@@ -20601,7 +20602,7 @@ const qg = xt(
|
|
|
20601
20602
|
* See the LICENSE file in the root directory of this source tree.
|
|
20602
20603
|
*/
|
|
20603
20604
|
const $g = (e, t) => {
|
|
20604
|
-
const n =
|
|
20605
|
+
const n = wt(
|
|
20605
20606
|
({ className: s, ...o }, i) => mr(qg, {
|
|
20606
20607
|
ref: i,
|
|
20607
20608
|
iconNode: t,
|
|
@@ -20751,7 +20752,7 @@ const Gg = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Yg = $g("ChevronRi
|
|
|
20751
20752
|
),
|
|
20752
20753
|
/* @__PURE__ */ v("div", { className: "flex items-center pl-1 shrink-0", children: [
|
|
20753
20754
|
/* @__PURE__ */ r(dl, { className: "mr-1", direction: "vertical" }),
|
|
20754
|
-
/* @__PURE__ */ r(
|
|
20755
|
+
/* @__PURE__ */ r(Ge, { text: "Back to editor", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
20755
20756
|
we,
|
|
20756
20757
|
{
|
|
20757
20758
|
variant: "ghost",
|
|
@@ -20894,7 +20895,7 @@ const Gg = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Yg = $g("ChevronRi
|
|
|
20894
20895
|
ydoc: o
|
|
20895
20896
|
});
|
|
20896
20897
|
}), Ku(s.tabs[0].content, t);
|
|
20897
|
-
const c =
|
|
20898
|
+
const c = St(o);
|
|
20898
20899
|
return o.transact(() => {
|
|
20899
20900
|
s.tabs.forEach((u, d) => {
|
|
20900
20901
|
const h = a[d];
|
|
@@ -21224,7 +21225,7 @@ const C2 = () => {
|
|
|
21224
21225
|
children: o
|
|
21225
21226
|
}
|
|
21226
21227
|
);
|
|
21227
|
-
}, ir = (e) => !!(e != null && e.enabled && (e.connection.livePresence ?? !0)), vy =
|
|
21228
|
+
}, ir = (e) => !!(e != null && e.enabled && (e.connection.livePresence ?? !0)), vy = wt(
|
|
21228
21229
|
({
|
|
21229
21230
|
isPreviewMode: e = !1,
|
|
21230
21231
|
viewerMode: t,
|
|
@@ -21283,30 +21284,30 @@ const C2 = () => {
|
|
|
21283
21284
|
onMarkdownExport: ve,
|
|
21284
21285
|
onMarkdownImport: Q,
|
|
21285
21286
|
onPdfExport: ce,
|
|
21286
|
-
onHtmlExport:
|
|
21287
|
+
onHtmlExport: Me,
|
|
21287
21288
|
onTxtExport: Te,
|
|
21288
21289
|
onOdtExport: Ue,
|
|
21289
21290
|
onDocxImport: Pe,
|
|
21290
|
-
editorCanvasClassNames:
|
|
21291
|
-
sharedSlidesLink:
|
|
21292
|
-
documentName:
|
|
21293
|
-
onInvalidContentError:
|
|
21294
|
-
ignoreCorruptedData:
|
|
21291
|
+
editorCanvasClassNames: Je,
|
|
21292
|
+
sharedSlidesLink: yt,
|
|
21293
|
+
documentName: mt,
|
|
21294
|
+
onInvalidContentError: ze,
|
|
21295
|
+
ignoreCorruptedData: ct,
|
|
21295
21296
|
commentDrawerOpen: Ke,
|
|
21296
21297
|
setCommentDrawerOpen: Ht,
|
|
21297
|
-
onCommentDrawerOpenChange:
|
|
21298
|
-
initialComments:
|
|
21298
|
+
onCommentDrawerOpenChange: Ye,
|
|
21299
|
+
initialComments: $e = [],
|
|
21299
21300
|
initialCommentAnchors: Tt,
|
|
21300
21301
|
onNewComment: sn,
|
|
21301
|
-
onEditComment:
|
|
21302
|
-
onEditReply:
|
|
21303
|
-
onCommentReply:
|
|
21302
|
+
onEditComment: un,
|
|
21303
|
+
onEditReply: zt,
|
|
21304
|
+
onCommentReply: on,
|
|
21304
21305
|
setInitialComments: rs,
|
|
21305
|
-
onSlidesShare:
|
|
21306
|
+
onSlidesShare: hn,
|
|
21306
21307
|
onResolveComment: is,
|
|
21307
21308
|
onUnresolveComment: Bn,
|
|
21308
21309
|
onDeleteComment: xn,
|
|
21309
|
-
onDeleteReply:
|
|
21310
|
+
onDeleteReply: mn,
|
|
21310
21311
|
theme: re,
|
|
21311
21312
|
showTOC: as,
|
|
21312
21313
|
setShowTOC: Et,
|
|
@@ -21314,24 +21315,24 @@ const C2 = () => {
|
|
|
21314
21315
|
isConnected: Oe,
|
|
21315
21316
|
connectViaWallet: Le,
|
|
21316
21317
|
isLoading: tt,
|
|
21317
|
-
connectViaUsername:
|
|
21318
|
+
connectViaUsername: Ae,
|
|
21318
21319
|
isDDocOwner: At,
|
|
21319
21320
|
isCollabDocumentPublished: nt = !0,
|
|
21320
21321
|
disableInlineComment: st,
|
|
21321
|
-
renderThemeToggle:
|
|
21322
|
+
renderThemeToggle: Kt,
|
|
21322
21323
|
renderToolbarLeading: Ln,
|
|
21323
21324
|
metadataProxyUrl: wn,
|
|
21324
|
-
extensions:
|
|
21325
|
-
onCopyHeadingLink:
|
|
21325
|
+
extensions: jt,
|
|
21326
|
+
onCopyHeadingLink: Vt,
|
|
21326
21327
|
tabConfig: Rt,
|
|
21327
21328
|
imageFetchFn: It,
|
|
21328
21329
|
ipfsImageFetchFn: pt,
|
|
21329
|
-
fetchV1ImageFn:
|
|
21330
|
+
fetchV1ImageFn: xt,
|
|
21330
21331
|
activeModel: bn,
|
|
21331
21332
|
maxTokens: _n,
|
|
21332
21333
|
isAIAgentEnabled: Cn,
|
|
21333
21334
|
// Document styling object
|
|
21334
|
-
documentStyling:
|
|
21335
|
+
documentStyling: De,
|
|
21335
21336
|
fonts: Dt,
|
|
21336
21337
|
...Jt
|
|
21337
21338
|
}, Ro) => {
|
|
@@ -21354,19 +21355,19 @@ const C2 = () => {
|
|
|
21354
21355
|
), [pe, me] = Nn(
|
|
21355
21356
|
Ke,
|
|
21356
21357
|
!1,
|
|
21357
|
-
|
|
21358
|
+
Ye,
|
|
21358
21359
|
Ht
|
|
21359
21360
|
), [be, Ce] = Nn(
|
|
21360
21361
|
de,
|
|
21361
21362
|
!1,
|
|
21362
21363
|
z,
|
|
21363
21364
|
L
|
|
21364
|
-
), [Ee,
|
|
21365
|
+
), [Ee, Re] = Nn(
|
|
21365
21366
|
_,
|
|
21366
21367
|
!1,
|
|
21367
21368
|
W,
|
|
21368
21369
|
le
|
|
21369
|
-
),
|
|
21370
|
+
), Ie = ke(
|
|
21370
21371
|
() => kl(R, E),
|
|
21371
21372
|
[R, E]
|
|
21372
21373
|
), Be = ke(
|
|
@@ -21378,30 +21379,30 @@ const C2 = () => {
|
|
|
21378
21379
|
onFocusMode: (X) => {
|
|
21379
21380
|
pe && (me == null || me(!1)), ee == null || ee(X);
|
|
21380
21381
|
}
|
|
21381
|
-
}), [ft, an] = G(!1), [
|
|
21382
|
-
if (!
|
|
21382
|
+
}), [ft, an] = G(!1), [Wt, bt] = G(!1), Nt = O(null), Us = (() => {
|
|
21383
|
+
if (!De)
|
|
21383
21384
|
return { canvas: void 0, background: void 0 };
|
|
21384
21385
|
const X = {}, Se = {}, je = re ?? "light";
|
|
21385
|
-
if (
|
|
21386
|
-
const
|
|
21387
|
-
|
|
21386
|
+
if (De.canvasBackground) {
|
|
21387
|
+
const Qe = Cs(
|
|
21388
|
+
De.canvasBackground,
|
|
21388
21389
|
je
|
|
21389
21390
|
);
|
|
21390
|
-
X.backgroundColor =
|
|
21391
|
+
X.backgroundColor = Qe;
|
|
21391
21392
|
}
|
|
21392
|
-
if (
|
|
21393
|
-
const
|
|
21394
|
-
|
|
21393
|
+
if (De.textColor) {
|
|
21394
|
+
const Qe = Ar(
|
|
21395
|
+
De.textColor,
|
|
21395
21396
|
je
|
|
21396
21397
|
);
|
|
21397
|
-
|
|
21398
|
+
Qe && (X.color = Qe);
|
|
21398
21399
|
}
|
|
21399
|
-
if (
|
|
21400
|
-
const
|
|
21401
|
-
|
|
21400
|
+
if (De.fontFamily && (X.fontFamily = De.fontFamily), De.background) {
|
|
21401
|
+
const Qe = Cs(
|
|
21402
|
+
De.background,
|
|
21402
21403
|
je
|
|
21403
21404
|
);
|
|
21404
|
-
Se.background =
|
|
21405
|
+
Se.background = Qe;
|
|
21405
21406
|
}
|
|
21406
21407
|
return {
|
|
21407
21408
|
canvas: Object.keys(X).length > 0 ? X : void 0,
|
|
@@ -21415,7 +21416,7 @@ const C2 = () => {
|
|
|
21415
21416
|
nn(() => {
|
|
21416
21417
|
wc(C2());
|
|
21417
21418
|
}, []);
|
|
21418
|
-
const { isBelow1280px: Hs, isNativeMobile: jn } =
|
|
21419
|
+
const { isBelow1280px: Hs, isNativeMobile: jn } = Yt(Kn), [Yr, Oo] = G(!1), Xr = O(null), bc = (F == null ? void 0 : F.slice(0, 4)) || [], Qr = F ? Math.max(0, F.length - 4) : 0;
|
|
21419
21420
|
Fs(Xr, () => {
|
|
21420
21421
|
Oo(!1);
|
|
21421
21422
|
}), H(() => {
|
|
@@ -21438,7 +21439,7 @@ const C2 = () => {
|
|
|
21438
21439
|
setTocItems: Zr,
|
|
21439
21440
|
terminateSession: Ac,
|
|
21440
21441
|
updateTitle: Rc,
|
|
21441
|
-
tabs:
|
|
21442
|
+
tabs: pn,
|
|
21442
21443
|
setTabs: Jr,
|
|
21443
21444
|
activeTabId: Mt,
|
|
21444
21445
|
setActiveTabId: Ic,
|
|
@@ -21456,9 +21457,9 @@ const C2 = () => {
|
|
|
21456
21457
|
flushPendingUpdate: ai
|
|
21457
21458
|
} = Bl({
|
|
21458
21459
|
editorWidthStore: Kn,
|
|
21459
|
-
documentStyling:
|
|
21460
|
+
documentStyling: De,
|
|
21460
21461
|
ipfsImageFetchFn: Be,
|
|
21461
|
-
fetchV1ImageFn:
|
|
21462
|
+
fetchV1ImageFn: xt,
|
|
21462
21463
|
enableIndexeddbSync: ne,
|
|
21463
21464
|
ddocId: se,
|
|
21464
21465
|
isPreviewMode: e,
|
|
@@ -21479,7 +21480,7 @@ const C2 = () => {
|
|
|
21479
21480
|
setSelectedWordCount: w,
|
|
21480
21481
|
setPageCount: b,
|
|
21481
21482
|
onStatsChange: T,
|
|
21482
|
-
ipfsImageUploadFn:
|
|
21483
|
+
ipfsImageUploadFn: Ie,
|
|
21483
21484
|
isCommentSectionOpen: Z,
|
|
21484
21485
|
setIsCommentSectionOpen: V,
|
|
21485
21486
|
setInlineCommentData: te,
|
|
@@ -21489,12 +21490,12 @@ const C2 = () => {
|
|
|
21489
21490
|
isNavbarVisible: dt,
|
|
21490
21491
|
setIsNavbarVisible: vn,
|
|
21491
21492
|
onDocxImport: Pe,
|
|
21492
|
-
onInvalidContentError:
|
|
21493
|
-
ignoreCorruptedData:
|
|
21493
|
+
onInvalidContentError: ze,
|
|
21494
|
+
ignoreCorruptedData: ct,
|
|
21494
21495
|
isPresentationMode: be,
|
|
21495
21496
|
metadataProxyUrl: wn,
|
|
21496
|
-
extensions:
|
|
21497
|
-
onCopyHeadingLink:
|
|
21497
|
+
extensions: jt,
|
|
21498
|
+
onCopyHeadingLink: Vt,
|
|
21498
21499
|
disableInlineComment: st,
|
|
21499
21500
|
isFocusMode: xe,
|
|
21500
21501
|
isConnected: Oe,
|
|
@@ -21509,9 +21510,9 @@ const C2 = () => {
|
|
|
21509
21510
|
}), Oc = ke(
|
|
21510
21511
|
() => {
|
|
21511
21512
|
var X;
|
|
21512
|
-
return ((X =
|
|
21513
|
+
return ((X = pn.find((Se) => Se.id === (Mt || et))) == null ? void 0 : X.name) || fo;
|
|
21513
21514
|
},
|
|
21514
|
-
[Mt,
|
|
21515
|
+
[Mt, pn]
|
|
21515
21516
|
), Bc = M(
|
|
21516
21517
|
(X) => {
|
|
21517
21518
|
!he || he.isDestroyed || !Mt || o2({
|
|
@@ -21531,13 +21532,13 @@ const C2 = () => {
|
|
|
21531
21532
|
isContentLoading: Ks,
|
|
21532
21533
|
isNativeMobile: jn,
|
|
21533
21534
|
disabled: !!((xi = Jt.versionHistoryState) != null && xi.enabled) || !!be
|
|
21534
|
-
}), Ws =
|
|
21535
|
+
}), Ws = kt(
|
|
21535
21536
|
"(min-width: 960px)",
|
|
21536
21537
|
Kn
|
|
21537
21538
|
), ls = ir(s), He = !!Ee && !e && Ws && !ls;
|
|
21538
21539
|
H(() => {
|
|
21539
|
-
(!Ws || ls) && Ee && (
|
|
21540
|
-
}, [Ws, ls, Ee,
|
|
21540
|
+
(!Ws || ls) && Ee && (Re == null || Re(!1));
|
|
21541
|
+
}, [Ws, ls, Ee, Re]);
|
|
21541
21542
|
const Lc = ke(
|
|
21542
21543
|
() => ({ ...ii, isSplitView: He }),
|
|
21543
21544
|
[ii, He]
|
|
@@ -21554,22 +21555,22 @@ const C2 = () => {
|
|
|
21554
21555
|
isSplitView: He,
|
|
21555
21556
|
isPreviewMode: e,
|
|
21556
21557
|
activeTabId: Mt,
|
|
21557
|
-
ipfsImageUploadFn:
|
|
21558
|
+
ipfsImageUploadFn: Ie,
|
|
21558
21559
|
onSeedError: () => {
|
|
21559
|
-
C == null || C("Could not open Markdown view — please try again."),
|
|
21560
|
+
C == null || C("Could not open Markdown view — please try again."), Re == null || Re(!1);
|
|
21560
21561
|
}
|
|
21561
21562
|
});
|
|
21562
21563
|
H(() => {
|
|
21563
21564
|
var Se;
|
|
21564
21565
|
const X = (Se = he == null ? void 0 : he.storage) == null ? void 0 : Se.markdownPasteHandler;
|
|
21565
|
-
X && (X.customCSS = (
|
|
21566
|
-
}, [he,
|
|
21566
|
+
X && (X.customCSS = (De == null ? void 0 : De.customCSS) ?? "");
|
|
21567
|
+
}, [he, De == null ? void 0 : De.customCSS]);
|
|
21567
21568
|
const ci = ke(
|
|
21568
21569
|
() => Vu(
|
|
21569
|
-
|
|
21570
|
+
De == null ? void 0 : De.customCSS,
|
|
21570
21571
|
".ProseMirror.ProseMirror"
|
|
21571
21572
|
),
|
|
21572
|
-
[
|
|
21573
|
+
[De == null ? void 0 : De.customCSS]
|
|
21573
21574
|
);
|
|
21574
21575
|
ll(
|
|
21575
21576
|
Ro,
|
|
@@ -21582,7 +21583,7 @@ const C2 = () => {
|
|
|
21582
21583
|
const Se = gh(X);
|
|
21583
21584
|
return qe.applyUpdate(
|
|
21584
21585
|
ln,
|
|
21585
|
-
|
|
21586
|
+
lt(Se),
|
|
21586
21587
|
"self"
|
|
21587
21588
|
), Se;
|
|
21588
21589
|
},
|
|
@@ -21590,8 +21591,8 @@ const C2 = () => {
|
|
|
21590
21591
|
if (he) {
|
|
21591
21592
|
const Se = await he.commands.exportMarkdownFile();
|
|
21592
21593
|
if (Se) {
|
|
21593
|
-
const je = Se,
|
|
21594
|
-
|
|
21594
|
+
const je = Se, Qe = document.createElement("a");
|
|
21595
|
+
Qe.href = je, Qe.download = X, document.body.appendChild(Qe), Qe.click(), document.body.removeChild(Qe), URL.revokeObjectURL(je);
|
|
21595
21596
|
}
|
|
21596
21597
|
}
|
|
21597
21598
|
},
|
|
@@ -21600,12 +21601,12 @@ const C2 = () => {
|
|
|
21600
21601
|
console.debug("collab: cannot find editor or awareness");
|
|
21601
21602
|
return;
|
|
21602
21603
|
}
|
|
21603
|
-
const Se = js.getLocalState(), je = Se == null ? void 0 : Se.user,
|
|
21604
|
+
const Se = js.getLocalState(), je = Se == null ? void 0 : Se.user, Qe = {
|
|
21604
21605
|
name: X,
|
|
21605
21606
|
color: je == null ? void 0 : je.color,
|
|
21606
21607
|
isEns: je == null ? void 0 : je.isEns
|
|
21607
21608
|
};
|
|
21608
|
-
js.setLocalStateField("user",
|
|
21609
|
+
js.setLocalStateField("user", Qe), he.setEditable(!0);
|
|
21609
21610
|
},
|
|
21610
21611
|
exportCurrentTabOrOpenExportModal: (X = "pdf", Se) => {
|
|
21611
21612
|
var je;
|
|
@@ -21628,12 +21629,12 @@ const C2 = () => {
|
|
|
21628
21629
|
return (I == null ? void 0 : I.find(
|
|
21629
21630
|
(sd) => sd.name.toLowerCase() === Xs.toLowerCase()
|
|
21630
21631
|
)) || { name: Xs, color: X.color };
|
|
21631
|
-
}),
|
|
21632
|
+
}), Qe = [...Se];
|
|
21632
21633
|
return je.forEach((Ys) => {
|
|
21633
|
-
|
|
21634
|
+
Qe.some(
|
|
21634
21635
|
(Xs) => Xs.name.toLowerCase() === Ys.name.toLowerCase()
|
|
21635
|
-
) ||
|
|
21636
|
-
}),
|
|
21636
|
+
) || Qe.push(Ys);
|
|
21637
|
+
}), Qe.slice(0, 6);
|
|
21637
21638
|
});
|
|
21638
21639
|
}, di = (X) => {
|
|
21639
21640
|
j == null || j(
|
|
@@ -21641,8 +21642,8 @@ const C2 = () => {
|
|
|
21641
21642
|
);
|
|
21642
21643
|
}, Vc = () => {
|
|
21643
21644
|
Ce == null || Ce(!1);
|
|
21644
|
-
const X = new URL(window.location.href), Se = X.hash, [je,
|
|
21645
|
-
|
|
21645
|
+
const X = new URL(window.location.href), Se = X.hash, [je, Qe] = Se.split("&");
|
|
21646
|
+
Qe && Qe.startsWith("slides=") && (X.hash = je, window.history.replaceState({}, "", X.toString()));
|
|
21646
21647
|
}, Wc = () => {
|
|
21647
21648
|
Ce == null || Ce(!0), pe && (me == null || me(!1));
|
|
21648
21649
|
};
|
|
@@ -21650,11 +21651,11 @@ const C2 = () => {
|
|
|
21650
21651
|
if (he && jn) {
|
|
21651
21652
|
const { selection: X } = he.state, Se = Ma(X), je = () => {
|
|
21652
21653
|
an(!0);
|
|
21653
|
-
},
|
|
21654
|
+
}, Qe = () => {
|
|
21654
21655
|
an(!1);
|
|
21655
21656
|
};
|
|
21656
|
-
return !Se && he.on("focus", je), Se && he.on("blur",
|
|
21657
|
-
he.off("focus", je), he.off("blur",
|
|
21657
|
+
return !Se && he.on("focus", je), Se && he.on("blur", Qe), () => {
|
|
21658
|
+
he.off("focus", je), he.off("blur", Qe);
|
|
21658
21659
|
};
|
|
21659
21660
|
}
|
|
21660
21661
|
}, [jn, he]), H(() => {
|
|
@@ -21688,21 +21689,21 @@ const C2 = () => {
|
|
|
21688
21689
|
}, [he, Vn, jn]), H(() => {
|
|
21689
21690
|
!xe || !he || he.isDestroyed || he.commands.focus();
|
|
21690
21691
|
}, [xe, he]);
|
|
21691
|
-
const en =
|
|
21692
|
+
const en = kt(
|
|
21692
21693
|
"(max-width: 850px)",
|
|
21693
21694
|
Kn
|
|
21694
|
-
), ui = ke(() => (
|
|
21695
|
+
), ui = ke(() => ($e || []).reduce(
|
|
21695
21696
|
(X, Se) => {
|
|
21696
21697
|
if (Se.deleted) return X;
|
|
21697
21698
|
const je = Se.tabId || et;
|
|
21698
21699
|
return X[je] = (X[je] || 0) + 1, X;
|
|
21699
21700
|
},
|
|
21700
21701
|
{}
|
|
21701
|
-
), [
|
|
21702
|
+
), [$e]), qc = qf(ri), Po = !!pe || !!st, hi = qc && !Po, qs = (De == null ? void 0 : De.orientation) === "landscape", $s = qs ? 1190 : 850, Wn = Wu(Un), cs = Ws && !He, Ho = cs && Wn === "fit", ds = (
|
|
21702
21703
|
// Hidden in Split View — the right pane has its own tabs panel (the
|
|
21703
21704
|
// List button in the split header), so the editor's native left rail
|
|
21704
21705
|
// would just duplicate it.
|
|
21705
|
-
!He && (
|
|
21706
|
+
!He && (pn.length > 0 || Bo.length > 0 && !((wi = Jt.versionHistoryState) != null && wi.enabled)) && (!xe || rn)
|
|
21706
21707
|
), $c = ds ? 148 : 0, mi = ds && !Hs, Gc = $u({
|
|
21707
21708
|
hasLeftRail: mi,
|
|
21708
21709
|
isCommentColumnVisible: hi,
|
|
@@ -21774,18 +21775,18 @@ const C2 = () => {
|
|
|
21774
21775
|
isNavbarVisible: dt,
|
|
21775
21776
|
setIsNavbarVisible: vn,
|
|
21776
21777
|
showNavbarToggle: l,
|
|
21777
|
-
ipfsImageUploadFn:
|
|
21778
|
+
ipfsImageUploadFn: Ie,
|
|
21778
21779
|
onMarkdownExport: ve,
|
|
21779
21780
|
onMarkdownImport: Q,
|
|
21780
21781
|
onPdfExport: ce,
|
|
21781
|
-
onHtmlExport:
|
|
21782
|
+
onHtmlExport: Me,
|
|
21782
21783
|
onTxtExport: Te,
|
|
21783
21784
|
onOdtExport: Ue,
|
|
21784
21785
|
onDocxImport: Pe,
|
|
21785
21786
|
ipfsImageFetchFn: Be,
|
|
21786
|
-
fetchV1ImageFn:
|
|
21787
|
+
fetchV1ImageFn: xt,
|
|
21787
21788
|
isConnected: Oe,
|
|
21788
|
-
tabs:
|
|
21789
|
+
tabs: pn,
|
|
21789
21790
|
ydoc: ln,
|
|
21790
21791
|
toggleFocusMode: it,
|
|
21791
21792
|
isSplitView: Ee,
|
|
@@ -21793,7 +21794,7 @@ const C2 = () => {
|
|
|
21793
21794
|
// Hidden during collaboration (Split View is solo-only in v1)
|
|
21794
21795
|
// and when the host fixed `isSplitView` with no callback: the
|
|
21795
21796
|
// toggle would compute a new value and notify nobody.
|
|
21796
|
-
!ls && (_ === void 0 || W || le) ? () =>
|
|
21797
|
+
!ls && (_ === void 0 || W || le) ? () => Re((X) => !X) : void 0
|
|
21797
21798
|
),
|
|
21798
21799
|
onRegisterExportTrigger: (X) => {
|
|
21799
21800
|
Nt.current = X;
|
|
@@ -21826,9 +21827,9 @@ const C2 = () => {
|
|
|
21826
21827
|
isNavbarVisible: dt,
|
|
21827
21828
|
setIsNavbarVisible: vn,
|
|
21828
21829
|
showNavbarToggle: l,
|
|
21829
|
-
ipfsImageUploadFn:
|
|
21830
|
+
ipfsImageUploadFn: Ie,
|
|
21830
21831
|
ipfsImageFetchFn: Be,
|
|
21831
|
-
fetchV1ImageFn:
|
|
21832
|
+
fetchV1ImageFn: xt,
|
|
21832
21833
|
fonts: Dt
|
|
21833
21834
|
}
|
|
21834
21835
|
)
|
|
@@ -21841,21 +21842,21 @@ const C2 = () => {
|
|
|
21841
21842
|
{
|
|
21842
21843
|
editor: he,
|
|
21843
21844
|
ydoc: ln,
|
|
21844
|
-
tabs:
|
|
21845
|
+
tabs: pn,
|
|
21845
21846
|
onRegisterExportTrigger: (X) => {
|
|
21846
21847
|
Nt.current = X;
|
|
21847
21848
|
},
|
|
21848
21849
|
onError: C,
|
|
21849
|
-
ipfsImageUploadFn:
|
|
21850
|
+
ipfsImageUploadFn: Ie,
|
|
21850
21851
|
onMarkdownExport: ve,
|
|
21851
21852
|
onMarkdownImport: Q,
|
|
21852
21853
|
onPdfExport: ce,
|
|
21853
|
-
onHtmlExport:
|
|
21854
|
+
onHtmlExport: Me,
|
|
21854
21855
|
onTxtExport: Te,
|
|
21855
21856
|
onOdtExport: Ue,
|
|
21856
21857
|
ipfsImageFetchFn: Be,
|
|
21857
21858
|
onDocxImport: Pe,
|
|
21858
|
-
fetchV1ImageFn:
|
|
21859
|
+
fetchV1ImageFn: xt,
|
|
21859
21860
|
isConnected: Oe
|
|
21860
21861
|
}
|
|
21861
21862
|
),
|
|
@@ -21865,21 +21866,21 @@ const C2 = () => {
|
|
|
21865
21866
|
{
|
|
21866
21867
|
editor: he,
|
|
21867
21868
|
onClose: Vc,
|
|
21868
|
-
isFullscreen:
|
|
21869
|
-
setIsFullscreen:
|
|
21869
|
+
isFullscreen: Wt,
|
|
21870
|
+
setIsFullscreen: bt,
|
|
21870
21871
|
onError: C,
|
|
21871
21872
|
setCommentDrawerOpen: me,
|
|
21872
|
-
sharedSlidesLink:
|
|
21873
|
+
sharedSlidesLink: yt,
|
|
21873
21874
|
isPreviewMode: e,
|
|
21874
|
-
documentName:
|
|
21875
|
-
onSlidesShare:
|
|
21875
|
+
documentName: mt,
|
|
21876
|
+
onSlidesShare: hn,
|
|
21876
21877
|
slides: Tc,
|
|
21877
21878
|
setSlides: Ec,
|
|
21878
|
-
renderThemeToggle:
|
|
21879
|
+
renderThemeToggle: Kt,
|
|
21879
21880
|
isContentLoading: Ks,
|
|
21880
21881
|
ipfsImageFetchFn: Be,
|
|
21881
|
-
documentStyling:
|
|
21882
|
-
fetchV1ImageFn:
|
|
21882
|
+
documentStyling: De,
|
|
21883
|
+
fetchV1ImageFn: xt,
|
|
21883
21884
|
theme: re ?? "light"
|
|
21884
21885
|
}
|
|
21885
21886
|
) }),
|
|
@@ -21924,8 +21925,8 @@ const C2 = () => {
|
|
|
21924
21925
|
showTOC: rn,
|
|
21925
21926
|
setShowTOC: Hn,
|
|
21926
21927
|
isPreviewMode: e || !dt,
|
|
21927
|
-
orientation:
|
|
21928
|
-
tabs:
|
|
21928
|
+
orientation: De == null ? void 0 : De.orientation,
|
|
21929
|
+
tabs: pn,
|
|
21929
21930
|
setTabs: Jr,
|
|
21930
21931
|
activeTabId: Mt,
|
|
21931
21932
|
setActiveTabId: _o,
|
|
@@ -22021,7 +22022,7 @@ const C2 = () => {
|
|
|
22021
22022
|
className: ye(
|
|
22022
22023
|
"w-full flex-grow min-w-0 no-scrollbar rounded mx-auto",
|
|
22023
22024
|
!Ho && "transition-[width,max-width] duration-300 ease-in-out",
|
|
22024
|
-
!(
|
|
22025
|
+
!(De != null && De.canvasBackground) && !xe && "color-bg-default"
|
|
22025
22026
|
),
|
|
22026
22027
|
style: {
|
|
22027
22028
|
...en ? {} : {
|
|
@@ -22071,8 +22072,8 @@ const C2 = () => {
|
|
|
22071
22072
|
activeCommentId: Vs,
|
|
22072
22073
|
isCollabDocumentPublished: nt,
|
|
22073
22074
|
ipfsImageFetchFn: Be,
|
|
22074
|
-
fetchV1ImageFn:
|
|
22075
|
-
ipfsImageUploadFn:
|
|
22075
|
+
fetchV1ImageFn: xt,
|
|
22076
|
+
ipfsImageUploadFn: Ie,
|
|
22076
22077
|
enableCollaboration: ir(
|
|
22077
22078
|
s
|
|
22078
22079
|
),
|
|
@@ -22194,7 +22195,7 @@ const C2 = () => {
|
|
|
22194
22195
|
enableFanficTemplate: A,
|
|
22195
22196
|
runtimeState: Lc,
|
|
22196
22197
|
onApplyTabbedTemplate: Bc,
|
|
22197
|
-
onCopyHeadingLink:
|
|
22198
|
+
onCopyHeadingLink: Vt,
|
|
22198
22199
|
children: /* @__PURE__ */ r("div", { className: "grammarly-wrapper", children: (zs != null && zs.length ? zs : he ? [
|
|
22199
22200
|
{
|
|
22200
22201
|
tabId: Mt,
|
|
@@ -22343,7 +22344,7 @@ const C2 = () => {
|
|
|
22343
22344
|
] }) }) : /* @__PURE__ */ r(
|
|
22344
22345
|
Za,
|
|
22345
22346
|
{
|
|
22346
|
-
documentStyling:
|
|
22347
|
+
documentStyling: De,
|
|
22347
22348
|
theme: re ?? "light",
|
|
22348
22349
|
isFocusMode: xe,
|
|
22349
22350
|
children: /* @__PURE__ */ r(
|
|
@@ -22377,21 +22378,21 @@ const C2 = () => {
|
|
|
22377
22378
|
setActiveCommentId: Sc,
|
|
22378
22379
|
activeTabId: Mt,
|
|
22379
22380
|
focusCommentWithActiveId: Nc,
|
|
22380
|
-
initialComments:
|
|
22381
|
+
initialComments: $e,
|
|
22381
22382
|
setInitialComments: rs,
|
|
22382
22383
|
onNewComment: sn,
|
|
22383
|
-
onEditComment:
|
|
22384
|
-
onEditReply:
|
|
22385
|
-
onCommentReply:
|
|
22384
|
+
onEditComment: un,
|
|
22385
|
+
onEditReply: zt,
|
|
22386
|
+
onCommentReply: on,
|
|
22386
22387
|
onResolveComment: is,
|
|
22387
22388
|
onUnresolveComment: Bn,
|
|
22388
22389
|
onDeleteComment: xn,
|
|
22389
|
-
onDeleteReply:
|
|
22390
|
+
onDeleteReply: mn,
|
|
22390
22391
|
ensResolutionUrl: y,
|
|
22391
22392
|
isConnected: Oe,
|
|
22392
22393
|
connectViaWallet: Le,
|
|
22393
22394
|
isLoading: tt,
|
|
22394
|
-
connectViaUsername:
|
|
22395
|
+
connectViaUsername: Ae,
|
|
22395
22396
|
isDDocOwner: At,
|
|
22396
22397
|
onInlineComment: D,
|
|
22397
22398
|
onComment: K,
|
|
@@ -22436,7 +22437,7 @@ const C2 = () => {
|
|
|
22436
22437
|
// Split View: the right-pane wrapper owns the scroll.
|
|
22437
22438
|
He ? "overflow-hidden" : "overflow-auto",
|
|
22438
22439
|
be ? "color-bg-default" : "color-bg-secondary",
|
|
22439
|
-
|
|
22440
|
+
Je
|
|
22440
22441
|
),
|
|
22441
22442
|
style: xe ? void 0 : Sn(),
|
|
22442
22443
|
children: [
|
|
@@ -22460,7 +22461,7 @@ const C2 = () => {
|
|
|
22460
22461
|
activeTabId: Mt,
|
|
22461
22462
|
onTabChange: _o,
|
|
22462
22463
|
isPreviewMode: e,
|
|
22463
|
-
tabs:
|
|
22464
|
+
tabs: pn,
|
|
22464
22465
|
mobileContainer: yc
|
|
22465
22466
|
}
|
|
22466
22467
|
) })
|
|
@@ -22480,9 +22481,9 @@ const C2 = () => {
|
|
|
22480
22481
|
{
|
|
22481
22482
|
markdown: Hc,
|
|
22482
22483
|
onMarkdownChange: zc,
|
|
22483
|
-
ipfsImageUploadFn:
|
|
22484
|
+
ipfsImageUploadFn: Ie,
|
|
22484
22485
|
onError: C,
|
|
22485
|
-
customCSS:
|
|
22486
|
+
customCSS: De == null ? void 0 : De.customCSS,
|
|
22486
22487
|
style: { flexGrow: Uo }
|
|
22487
22488
|
}
|
|
22488
22489
|
),
|
|
@@ -22511,7 +22512,7 @@ const C2 = () => {
|
|
|
22511
22512
|
e2,
|
|
22512
22513
|
{
|
|
22513
22514
|
editor: he,
|
|
22514
|
-
onExitSplitView: () =>
|
|
22515
|
+
onExitSplitView: () => Re == null ? void 0 : Re(!1),
|
|
22515
22516
|
showTabsPanel: li,
|
|
22516
22517
|
onToggleTabsPanel: () => Pc((X) => !X)
|
|
22517
22518
|
}
|
|
@@ -22544,8 +22545,8 @@ const C2 = () => {
|
|
|
22544
22545
|
showTOC: rn,
|
|
22545
22546
|
setShowTOC: Hn,
|
|
22546
22547
|
isPreviewMode: !1,
|
|
22547
|
-
orientation:
|
|
22548
|
-
tabs:
|
|
22548
|
+
orientation: De == null ? void 0 : De.orientation,
|
|
22549
|
+
tabs: pn,
|
|
22549
22550
|
setTabs: Jr,
|
|
22550
22551
|
activeTabId: Mt,
|
|
22551
22552
|
setActiveTabId: _o,
|
|
@@ -22608,7 +22609,7 @@ const C2 = () => {
|
|
|
22608
22609
|
}
|
|
22609
22610
|
);
|
|
22610
22611
|
}
|
|
22611
|
-
), k2 =
|
|
22612
|
+
), k2 = wt(
|
|
22612
22613
|
({
|
|
22613
22614
|
isPreviewMode: e = !1,
|
|
22614
22615
|
initialContent: t,
|
|
@@ -22868,7 +22869,7 @@ const C2 = () => {
|
|
|
22868
22869
|
)
|
|
22869
22870
|
] });
|
|
22870
22871
|
}
|
|
22871
|
-
), ky =
|
|
22872
|
+
), ky = wt(
|
|
22872
22873
|
(e, t) => {
|
|
22873
22874
|
var i, a;
|
|
22874
22875
|
const n = !!((i = e.versionHistoryState) != null && i.enabled), s = ((a = e.versionHistoryState) == null ? void 0 : a.versionId) || "default", o = n ? s : "default";
|
|
@@ -23169,7 +23170,7 @@ function Ny(e) {
|
|
|
23169
23170
|
t.isDestroyed || t.destroy();
|
|
23170
23171
|
}
|
|
23171
23172
|
}
|
|
23172
|
-
const Ty = (e, t, n = "ecies") => Bt.encryptData(
|
|
23173
|
+
const Ty = (e, t, n = "ecies") => Bt.encryptData(lt(e), t, n), Ey = (e, t) => Bt.decryptData(lt(e), t);
|
|
23173
23174
|
function pc(e, t, n, s) {
|
|
23174
23175
|
return {
|
|
23175
23176
|
wsUrl: e.wsUrl,
|
|
@@ -23223,7 +23224,7 @@ async function Ay(e) {
|
|
|
23223
23224
|
);
|
|
23224
23225
|
try {
|
|
23225
23226
|
await fc(t);
|
|
23226
|
-
const n =
|
|
23227
|
+
const n = lt(e.roomKey), s = [];
|
|
23227
23228
|
let o;
|
|
23228
23229
|
for (; ; ) {
|
|
23229
23230
|
const i = await t.fetchHydrationRange(o);
|
|
@@ -23256,7 +23257,7 @@ async function Ry(e) {
|
|
|
23256
23257
|
try {
|
|
23257
23258
|
await fc(t);
|
|
23258
23259
|
const n = Bt.encryptData(
|
|
23259
|
-
|
|
23260
|
+
lt(e.newRoomKey),
|
|
23260
23261
|
e.state,
|
|
23261
23262
|
t.getWireFormat()
|
|
23262
23263
|
), s = await t.sendSnapshot({ data: n, floorSeq: 0 });
|