@fileverse-dev/ddoc 7.1.6-pages.0 → 7.1.6-pages.2
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
CHANGED
|
@@ -2,16 +2,16 @@ var Td = Object.defineProperty;
|
|
|
2
2
|
var Ed = (e, t, n) => t in e ? Td(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var ne = (e, t, n) => Ed(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import { jsx as r, jsxs as v, Fragment as nt } from "react/jsx-runtime";
|
|
5
|
-
import { P as os, a as rs, i as Ya, p as Xa, N as Ad, C as Rd, E as is, g as Id, b as Dd, u as Qa, l as Md, d as
|
|
6
|
-
import { c2 as yx, c3 as xx } from "./use-headless-editor-
|
|
5
|
+
import { P as os, a as rs, i as Ya, p as Xa, N as Ad, C as Rd, E as is, g as Id, b as Dd, u as Qa, l as Md, d as wt, e as z, f as Zt, r as Za, n as as, h as Eo, j as Fd, k as Bs, F as Bd, L as Od, m as Ja, o as Ld, q as Os, s as gr, I as We, S as _d, t as yr, v as Pd, T as it, w as el, x as Ud, y as Di, z as Hd, A as tl, B as zd, D as Kd, G as nl, H as es, J as sl, K as Br, M as jd, O as Or, Q as ol, R as Pn, U as rl, V as Vd, W as Lr, X as Wd, Y as $d, Z as qd, _ as Gd, $ as il, a0 as Yd, a1 as Xd, a2 as Qd, a3 as oo, a4 as Zd, a5 as Xo, a6 as Jd, a7 as eu, a8 as gt, a9 as tu, aa as Mi, ab as nu, ac as su, ad as ou, ae as ru, af as Fn, ag as al, ah as iu, ai as Es, aj as au, ak as Ao, al as lu, am as cu, an as du, ao as uu, ap as hu, aq as ll, ar as Ls, as as cl, at as dl, au as Sn, av as mu, aw as xr, ax as Fi, ay as Bi, az as pu, aA as fu, aB as gu, aC as ul, aD as yu, aE as xu, aF as wu, aG as bu, aH as Cu, aI as vu, aJ as ku, aK as Su, aL as Nu, aM as Tu, aN as Eu, aO as Au, aP as Ru, aQ as Iu, aR as Du, aS as Qo, aT as hl, aU as Mu, aV as ml, aW as Fu, aX as Bu, aY as Ou, aZ as Lu, a_ as fn, a$ as _u, b0 as Oi, b1 as As, b2 as _r, b3 as Pu, b4 as Pr, b5 as Uu, b6 as Zo, b7 as Hu, b8 as pl, b9 as dt, ba as zu, bb as Li, bc as Ku, bd as ju, be as fl, bf as Vu, bg as ws, bh as Wu, bi as $u, bj as qu, bk as Gu, bl as Yu, bm as Xu, bn as Qu, bo as Zu, bp as Ju, bq as eh, br as th, bs as wr, bt as br, bu as nh, bv as Jo, bw as sh, bx as oh, by as rh, bz as ih, bA as ah, bB as _i, bC as lh, bD as ch, bE as Pi, bF as dh, bG as uh, bH as hh, bI as mh, bJ as ph, bK as Ui, bL as Cr, bM as Hi, bN as fh, bO as gh, bP as yh, bQ as xh, bR as wh, bS as gl, bT as zi, bU as Ki, bV as bh, bW as Ch, bX as vh, bY as ji, bZ as kh, b_ as Sh, b$ as Nh, c0 as Th, c1 as Eh } from "./use-headless-editor-DfHwB1_9.mjs";
|
|
6
|
+
import { c2 as yx, c3 as xx } from "./use-headless-editor-DfHwB1_9.mjs";
|
|
7
7
|
import { flip as yl, shift as xl, offset as wl, arrow as bl, size as Cl, autoPlacement as vl, hide as kl, inline as Sl, computePosition as Ur, platform as bs } from "@floating-ui/dom";
|
|
8
|
-
import
|
|
9
|
-
import { createPortal as
|
|
8
|
+
import Ze, { useRef as F, useEffect as j, useState as Y, useCallback as M, createContext as Ah, useContext as Rh, useMemo as ve, forwardRef as bt, useReducer as Ih, useLayoutEffect as yt, memo as Ro, createElement as vr, lazy as Nl, Suspense as Vi, useSyncExternalStore as Wi, useImperativeHandle as Tl } from "react";
|
|
9
|
+
import { createPortal as Tn } from "react-dom";
|
|
10
10
|
import ye from "classnames";
|
|
11
|
-
import { DynamicDropdown as
|
|
11
|
+
import { DynamicDropdown as vt, LucideIcon as he, Dialog as Hr, DialogContent as zr, cn as ae, DialogHeader as Kr, DialogTitle as jr, DialogFooter as Vr, DialogClose as go, Button as Ne, Tooltip as Ge, IconButton as be, Skeleton as yo, Avatar as Jt, PopoverClose as Io, TextAreaFieldV2 as Nn, DynamicModal as Wr, Select as Rs, SelectTrigger as Is, SelectValue as Ds, SelectContent as Ms, SelectItem as Fs, DropdownMenu as Un, DropdownMenuTrigger as Hn, DropdownMenuContent as zn, DropdownMenuSub as $i, DropdownMenuSubTrigger as qi, DropdownMenuSubContent as Gi, DropdownMenuItem as _t, useTheme as Dh, Popover as ls, PopoverTrigger as _s, PopoverContent as cs, SelectGroup as Mh, Checkbox as Fh, toast as xo, Drawer as Bh, DrawerTrigger as Oh, TextField as Qt, AnimatedLoader as Lh, Label as po, DynamicDropdownV2 as El, DynamicDrawerV2 as _h, BottomDrawer as Ph, ButtonGroup as Uh, Divider as Al, UltimateIcons as Hh, PopoverAnchor as zh, Tag as wo, TagInput as Rl } from "@fileverse/ui";
|
|
12
12
|
import { create as Kh } from "zustand";
|
|
13
13
|
import jh from "react-uuid";
|
|
14
|
-
import { g as Cs, a as
|
|
14
|
+
import { g as Cs, a as kt, b as ds, c as ns, d as bo, D as tt, e as Yi, M as Co, f as $r, s as Xi, L as Vh, h as vo, A as Wh, m as $h } from "./tab-utils-Cvs3qmhi.mjs";
|
|
15
15
|
import { htmlToOdt as qh } from "odf-kit";
|
|
16
16
|
import "lib0/mutex";
|
|
17
17
|
import "lib0/math";
|
|
@@ -25,15 +25,15 @@ 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 at, fromUint8Array as Pt } from "js-base64";
|
|
29
29
|
import { Ollama as Yh } from "ollama/browser";
|
|
30
|
-
import { AnimatePresence as Ps, motion as
|
|
30
|
+
import { AnimatePresence as Ps, motion as Ut, MotionConfig as Xh } from "framer-motion";
|
|
31
31
|
import qr from "markdown-it";
|
|
32
32
|
import { generateRandomBytes as kr } from "@fileverse/crypto/utils";
|
|
33
33
|
import { IndexeddbPersistence as Qh } from "y-indexeddb";
|
|
34
34
|
import { applyAwarenessUpdate as Zh, removeAwarenessStates as On, encodeAwarenessUpdate as Jh, Awareness as em } from "y-protocols/awareness.js";
|
|
35
35
|
import { io as tm } from "socket.io-client";
|
|
36
|
-
import * as
|
|
36
|
+
import * as rn from "@ucans/ucans";
|
|
37
37
|
import { generateKeyPairFromSeed as er } from "@stablelib/ed25519";
|
|
38
38
|
import { eciesDecrypt as nm, eciesEncrypt as sm, generateECKeyPair as om } from "@fileverse/crypto/ecies";
|
|
39
39
|
import { deriveHKDFKey as rm } from "@fileverse/crypto/kdf";
|
|
@@ -382,7 +382,7 @@ is.create({
|
|
|
382
382
|
] : [];
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
|
-
var Do =
|
|
385
|
+
var Do = Ze.forwardRef(
|
|
386
386
|
({
|
|
387
387
|
pluginKey: e = "bubbleMenu",
|
|
388
388
|
editor: t,
|
|
@@ -427,10 +427,10 @@ var Do = Qe.forwardRef(
|
|
|
427
427
|
g.parentNode && g.parentNode.removeChild(g);
|
|
428
428
|
});
|
|
429
429
|
};
|
|
430
|
-
}, [p]),
|
|
430
|
+
}, [p]), Tn(/* @__PURE__ */ r("div", { ...u, children: c }), h.current);
|
|
431
431
|
}
|
|
432
432
|
);
|
|
433
|
-
|
|
433
|
+
Ze.forwardRef(
|
|
434
434
|
({ pluginKey: e = "floatingMenu", editor: t, appendTo: n, shouldShow: s = null, options: o, children: i, ...a }, l) => {
|
|
435
435
|
const c = F(document.createElement("div"));
|
|
436
436
|
typeof l == "function" ? l(c.current) : l && (l.current = c.current);
|
|
@@ -459,7 +459,7 @@ Qe.forwardRef(
|
|
|
459
459
|
d.parentNode && d.parentNode.removeChild(d);
|
|
460
460
|
});
|
|
461
461
|
};
|
|
462
|
-
}, [t, u, n, e, s, o]),
|
|
462
|
+
}, [t, u, n, e, s, o]), Tn(/* @__PURE__ */ r("div", { ...a, children: i }), c.current);
|
|
463
463
|
}
|
|
464
464
|
);
|
|
465
465
|
const Mm = ({ editor: e, elementRef: t }) => {
|
|
@@ -525,7 +525,7 @@ const Mm = ({ 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(
|
|
@@ -573,7 +573,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
573
573
|
},
|
|
574
574
|
"NodeSelector"
|
|
575
575
|
);
|
|
576
|
-
},
|
|
576
|
+
}, Ht = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M0%2012C0%205.37258%205.37258%200%2012%200C18.6274%200%2024%205.37258%2024%2012C24%2018.6274%2018.6274%2024%2012%2024C5.37258%2024%200%2018.6274%200%2012Z'%20fill='url(%23pattern0_2594_44493)'/%3e%3cdefs%3e%3cpattern%20id='pattern0_2594_44493'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_2594_44493'%20transform='translate(0%20-0.0714286)%20scale(0.0102041)'/%3e%3c/pattern%3e%3cimage%20id='image0_2594_44493'%20width='98'%20height='112'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABwCAYAAADlu6WeAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABJOSURBVHgB7Z0LeFXVlcf/+9xcQgCBovazWhVRrFP5KFrbiuUhmhBEBPohtGodwVpbdfCBUkAeOSHhpShaqq2vGSxYHcXailISQgIKfTjWMs44MrU6tIOOjxFQECXJPbv/dU4SktzXed3kXMLv+3I53LvPueeetffaa6+19t4K+YbWCotqj0fCmAjdkIA5+mct75fX3s2jdeh3cBtuHHsQeYSBfMKsOw5mzU1oRA104ieA+mLLZ1OeMiiMkVD6OewurIRZfTzyCIV8oGx9bxjdh/LhL+Itnw37vtVOoOGrMMfsbim3oPZiGNYTPOrBv5cQ01djfsnryAOi3SKufTmOhVvOguq2Atr6FR/+V2ELQVuAdV8bIQh7Pqvh6yNOGZyLhHoR5TXfg2lGvuVH9wYXv3AsTth7G6zGZ/m/q/nXvdWn/wYUrEo6ZyX7BR1bDo3tTe8czeMHgWFPY+66ExBhoqeazLoCWIlJVCsV0GpgcgH1CWv6SFRc8Me011hYOxKW9TREEIfYxVY0H9i7FuaU/YgY0WoRFdUD2dmu5V2tSS0EQT+cUQiCpf7A1/vbvcuO3VhJ2SyGuXEAIkY0WoRZR7XDjlUlTArg2PQF1V/4MIfCHPX/2S7Jh30Sy27idU9LcZ2XqPIqcUyiOipmbue3CLPuDCCxmtX43sxCsDvoMldCsK9b8jeqpzt4lOJB66/DiK2imTud398LEaDzBCF9wcKa24FGUSOX8q8g8wnGc8C2J+AFY5tYUI+n+bQfBbuMlWALFlZ9A51M56gmR20s5QBsCu8glv0E9S4f2pWs5TXwivn8cTS4trIVnJqh1EdQxjK2yDvZ4hrRCXRsixB73qwdC6U288Fc5k4IgvoFBwkvwA/mxe/ye2YipYpqoQ8Hi5VsHWs4ePwiOgGXDyIEZHSsBsxlzV7BB/t5D2dyTKBnw7zkffjl/AF/Bk4SS2lI+kJKtMMg1s1LcMHUXfY5mzdrdBAd0yLMDafBKPwlHygFoXp4OPMA1dcSYOtfEATTZEd/cA6//52sZRXNZq3ZAkc85Ki1jiH3fUT5pov4wx7mkQ8nnH6MffjU0PT2gk3f50DxPo624+5OUG+xBdNFUrIZOSZ3ghCrSFm3Uggm2ronXCIddOMomKU7EBaTn4zhzH6/5tHFHs46wL+7qMXvYIXI2Yg8N6pJBmgqcQ9N/8XwJQTBeiRUIQhPTUnw9UdsaV76G1GldI1YVaio/RJyRPiCqKg6hS2B8QLcwFrt7/oKr1ElLUcuMIv/iy6QGfyOBk/nQZ+HhPV7Bp9m4pbfFiFkwhXEom1DkChYT3X0TfiHHlTjdqqBvcgVRuxfOWZYC+/0ZSu/A30+peOw5nSESHiCkE654bMNrDlnIAgKHEGr9cgldudvzebR3+ALPZYvm1BRNzGsWEc4nfXCmqGwIA+vL4Kg9Acw2Jrmj34DHUE5w64a98A/n7ETn453jnoUD57jUdW1Jbg0y+uuoBDYEgIKgVWUD2V2hwlB0LH7KP1q+IeGSOMDOP6jNTCfCfT7gwlChKATkkXRG8H5Ld0Ya9CR2CpKT+dRgP5IDBL6zHDUapjPHgOf+BdEee2EJiGE4UYWnU2H25R6dDRmMd0fehGCMw7o+ajfkKw/QSyu+TIdZD9FOEIginHpeG476IwUSGqOP6diG/RoxHss9dMyvHfWtv+lcB2PzkE4cAQdk6jbTnQmplQu/Ts+kqBqtp593TqofdfA/JZrleetRYjbAt1ktByWEIgu63QhCDLQA1YgON1YvSexz1gB88lubk/yJgiVGMWXyxAaog72rEJU0A2SsvkSwkDjSuCYH9qpoC5wr5rsAH+CwXich3BgB62+AfPCVxAlFlaPpAtkvUd3fRr0HgpkLMpLfp+tpIcWkRjDC4epkh6PnBCEBSVspepehIL6HOMbD7iJ+nlRTdfwwq51XhbExb0AkURp6PqlsMc1oTDYThm1NUp63AnC3NCPSiy81qBQCfOinYgq5WM/pm6/lUdhxR8mAg3fyVTAnSCMbqfwxj6HcKCLPPYooo7axk6b0bxwoLWp5qKsLq2KcicIC2eGpJZ28zpluYx0hYYd59Y/5v3+J0JBncY4zYJ0VpQ7QWirPwKjLbpl6Ol8MasFERnM0e/QjUMVpUNyvegrUF6VMr/KnSCU9u3ManWRV6C7PeLUtDxCxWv5mMJSpTSJ4z9KFcNwaTWpoPlPB1kbfgpzWPZ0lqghHtr6hjIaGG8iFDQHxMOSEqNdqiZ8iiAo8fl/+izylcVj/o+adQYfxMcIDh2l+rr25uwhQUhzkfiCnZfaDsN4G/55n4KkuTreXRZ3ZBHvsPHPkGoZGEX3B/q3fqdVixh6Pjumh/k15yadZ1j/4+8GJJXeYMzixZeR7zhBpH+h1RMs69DhaBiNl9p5Vk20EkTBtyChPwPJgY36RhHEJ/CM2g6tHsq7DjodZvGrVLOMXegDCIo2JmJgYYsR1EoQdmaCFBicdFKs8E12Vh/CG/TFG4tQPmoXDid0/SonkBVQRWnrLMR7faX5v44g5lWdwk/628dKfzPJLyIDMK09RrBsD2YnRt1yhLg/ALGiAqooxrqVmtL8P0cQ8diIlqw8jS/QLzIo6TzLeh52+oib78B7lPhKCtBd+XzDjnOrJfydwaxJbY1oPmx++Oe3+rgXhw2lSSc1FNU6s/2zYlG9/dzx1RzGaONxPrcgqTiifU7F3KoT5bC5j2gb7NHWd52waCuWjPiAMQlaDUhkvjj+A/X77jpsOuh0SGtP6HJIjNo31ELdYqPlyOADl567XR4nHVRoTDZjYT3MB/3f6S8M6Utuw+IJ76ErUFHyJ2fyTQA0iuUftojGQSk+FrfttCSfiL32hZIAe5qJI2qtrwmHeU2BpGxuh3/sCi89d7qcfwYzhqeYc/bhz5E6ekUztSGMRK38QgZ6mi6LtJUzK/1FKxnsdAakKSDzkG9LbhWSjdc4004YboNVzhYTxqgz/3CSA5bAN/WD2SL0iekLqAlsFcl9hTnmJeo2mdXvDGqkg0Z8Fbo0uyv5HP4EXxScLgm0mWZO9qCgZidZUDZ7GL3SMmCT+cu3dtZE8chgawo93/tMJME6laqpzVI6qRhDVTQ+5RcfLJwGS09CWfFGHIHeuKIX+Dyfh1e0cbKCWSMOvf4ZCyr8O/T/ngtz2uE5Ug6T+RvPQkyEob7g+hyFOrd5TYOhTpqWWkUdoQ079tBDiwp4saKoldxG6BT12EwkGv8BR8iMTCHWBU/x6DkPZ/Vyn+mn1SmIqZvtNTWOkBlZUypBq1KpD1yeYVAQykuO0eUw4iVuM5y7NHvrX6HH+jG3xY3kgVlGutvu3/kbT8MRMiMrbqr6ZTza6aY4zVe1B17QGIiC2IxsSbVdikWbzk45KcVeK0otzuqxBj6WPsLHpG8tWQghpujnMSaF0KAZq+l3Z8rPtbGawsiWPLFXVJOfmHJPWmdzWmchdElsc17LXIo+/LueY7JLk8tIlFIvzZK2+b64OPwm2Y7BoH4/RFdGWZfYi6U4yBhrEeZuSeG7iz2XcWK9Um8bsApeg7+7EPfIUpi/6Y+uiMyu1bi73Qo8pyPecEdyWTsnSjruNBaqfsNoSnd5F/7oRa/rSnRFdPfb+HJy0vsKE1BedVHyCQXiKt+c+lp4s1maQVLlx8GsnoquhLlxGPvWHyDVZFCNIujYvCQryvFOy8SXFK6P2PYmQahNCISxEpXPn4yugL34iboLmVddoEXZ9/Kkd3v32MLXv7Z7920K6V1HEEZDHYJlrvVConDmYe8UFI+C6sOwqB6SpSRbg7oG5rNtpwjPOE/yoJ5uV3arvDiCWDBGOuxgcxdkgnesKW3zcKWi7st0fl7nahqbUvRY905e6tqwnYGtwgmqlSAErYJOZ+1N34qJuZsivWGGb0Tn64QstHWiq/IaR8FqHJ70/seJV/jZey2lHG3UOgnZWuuk0QdA4yuI60ova1DkDeo4OjvVt72dg1FJrqDlpZ/w/Wbj6J0mbdQmLZ8twvgzgiHXmwh19CQcTsg8c10vawB6DQEMRKwhuQUp3bQRid7S/NYhQSgZSySqEJy+drZfqplH+YidThS7utUI2gufR32qFaCNXXaSgYUnW9459IW0cxMFqyFL+AdnMCWbF7tdZSU26kv8LdPhbw3bOOPXyVv0qIZXWVnvxr49LW6PtuZmbP/r0EXV7PEnIxhy3euB4TI+8TivIkJINNJKSG6r/9atYsnGi9MvzG79VrssvvEyJUnWLAojW+MY6sLlWPbro5CvGIWltF/GIwja9sxm/6qkd1SB+M69BL4z3cTXcKDnLXkZWp1TI/leN/EvWEXS7izRZEE4SbUyhA8nc8/ADFRUDUY+IX1bd0xlaxiKoBjaVQQ0dQdkz/ax1iEMpGla8R9j8S+zZRRGiOFDWBlnwO8i862xYq4WFE79RfZsH2Megro9WtAj0ND72rxQUc4AbD6FEMbuvwfYT+50UzC9xJ1VH+8NPNpuQd+CyppgC7h3CIlxvNeJCAX9Fh/xW25KZm56uv5nrBmbEQay2V9CLY509ofsly3pQuHxqtsNDDMLQuYUJ4wbqef/inCg+6PhKkQWPS/1lpq+kFU8n3FbOHtnVHHBa+z5b0BYVhRUhbPqcMQwq2Srzu8jNNQOjpA3uC3tMgl522/sXXPDwN6PlOZxDraH8Y3jT1qB8FbxZKVtXORlyTyXq1yKFVUg+7iF4RQURqPvgasRFdQIWRBmDMKDA+JunrbO8WZOStAnrtfau98GtbEl51Yztiu77HYmZjXNVLXFmVseCrSSYhd6Xe/c28NcdKEsoMXONlYbPIgkKspY0fke2lh5aEJQ2IcEvutn0XnvD8FeEMSSrc1CWAzLor0+bAo6i4W1I1kjpiIc6BpSt6Oi+Hfwgb/aaAsjdpVjGQTBVm/LaLF42UQ2HCSca1mzkHUfbVc0OruyyGpt/vCvFsxROxj0GNe0iFQQ6OuP3dvhCc3q2Mv48EoRHEkupkALKoNMcQ6mn+df+CY+KvoOf5CsRxFgnKGn4Mx+Ie5LkQXpoLVVGYJT7zNYaiqw9Z6g88zDccJd+3IcJ+y5mVbQPP9bw+gdONgwAkvGepnB5B3bOBj2II++h2DsZR83HWUljzGiGXjly3AsFtkMr6zkTt6QOMtehS/UGSiML8i5FWWcN9xZBDcAskIbrKtgjl4ThhDs20KYlBXX0U1QwqNH4EtVKQ7yhp+PXGHW9YJlLA20W4rCG7SOxlIIoS4oHH7tM0vfp1V1DWudCGQnvMEHZD2Qu53V9RxnMOoThWegY1/PxU4wuVMDsiu6rqcaUE/AU+uQwVVhBcLGnlBjXe+zg2601za36qfmalfh3Orj8rG7+BVX8sfLwlJefsDl9NCG5/txtm2THVL87Ccqy4veRPP0xqalRnNCx4Uuzeoh/DqZvlTsslYybr6v1Mumemkpr5W0GHHCedxJ0t7E4waqopznZnWcn8ccvZ21agLswY/srJIFha8BfW5HUCq3nEghmPAiBCXzotUvEN9f3BFCcL6yMzCrz7FnGSHFgvBt+YS6eZzd3/hBxjfH75llb6fj1pWh1If2bpE69kBHLgbWeVkVZh31dUJG5JLqnj6OLWtFHdAjsazEe05uWd25UAmZoeMmI0PGA3+AkfgnLCj9IzqYznNBi/VhFk/l0TQ+7UyT7gejyN6KzOP1OTBUlpyXXQj20tLG/bTySjtDCM4tRAE7e0I2CFQUSsrWsY81+wqUlbpPejOrx/N6T7kIf25lmVnsC8LaANAX0Un4ksxrFf9H3pLU4v7JBTTjH59e5GpnFhlBw2JcQA9KW0ax/9Ga/VTBslyNDbwQnfkLto2+7X4+IekzfoWkQaA6G6rnZFczV5XY/WmFoO1lQbVtBMyJghCEaKZAOqrqZh5d186by/i2NYmmcProoJ0WE5MoWYrBm95Nt/Vy9Oz+E8watg8RItq5qI6Z+xCPWs1rZqD/4MHJKd3lszb2QZHtUmk/Kt/P81YzfLDQXkMpgkR7apVd82Pir1qOlskz1nAUFf4gpYoqoimsUdLqHUlwqGHrmoz9jTOjKgQhfyaQOL4nWctiAGRknsBEBupfPPS5TCnu93rT5/LL3mY/QEusYL0ssYCIE+0W0RqzeAMHgBPsrRFkmm0Bytt8ro6diWYhSQvSCfq0tq3KByEI+TelyjFzGQk0vo3XPhxvr7MqmDX3SNYa1RCDUt125Nta5X8H3LvgGvQafyIAAAAASUVORK5CYII='/%3e%3c/defs%3e%3c/svg%3e", us = "data:image/svg+xml,%3csvg%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.76891%200.220314C7.29839%20-0.0734379%206.70161%20-0.0734378%206.23109%200.220314L4.81636%201.10354C4.68024%201.18851%204.53098%201.25034%204.37464%201.2865L2.74974%201.66233C2.20932%201.78733%201.78733%202.20932%201.66233%202.74974L1.2865%204.37464C1.25034%204.53098%201.18851%204.68024%201.10354%204.81636L0.220314%206.23109C-0.0734379%206.70161%20-0.0734378%207.29839%200.220314%207.76891L1.10354%209.18364C1.18851%209.31976%201.25034%209.46902%201.2865%209.62537L1.66233%2011.2503C1.78733%2011.7907%202.20932%2012.2127%202.74974%2012.3377L4.37464%2012.7135C4.53098%2012.7497%204.68024%2012.8115%204.81636%2012.8965L6.23109%2013.7797C6.70161%2014.0734%207.29839%2014.0734%207.76891%2013.7797L9.18364%2012.8965C9.31976%2012.8115%209.46902%2012.7497%209.62537%2012.7135L11.2503%2012.3377C11.7907%2012.2127%2012.2127%2011.7907%2012.3377%2011.2503L12.7135%209.62536C12.7497%209.46902%2012.8115%209.31976%2012.8965%209.18364L13.7797%207.76891C14.0734%207.29839%2014.0734%206.70161%2013.7797%206.23109L12.8965%204.81636C12.8115%204.68024%2012.7497%204.53098%2012.7135%204.37464L12.3377%202.74974C12.2127%202.20932%2011.7907%201.78733%2011.2503%201.66233L9.62537%201.2865C9.46902%201.25034%209.31976%201.18851%209.18364%201.10354L7.76891%200.220314ZM9.45472%204.37291C9.70279%204.12484%2010.105%204.12484%2010.3531%204.37291C10.6011%204.62098%2010.6011%205.02318%2010.3531%205.27126L6.36021%209.2641C6.11214%209.51218%205.70994%209.51218%205.46187%209.2641L3.64694%207.44917C3.39887%207.2011%203.39887%206.7989%203.64694%206.55083C3.89501%206.30276%204.29721%206.30276%204.54528%206.55083L5.91104%207.91659L9.45472%204.37291Z'%20fill='%234A99E9'/%3e%3c/svg%3e", Fm = ({ size: e = "lg" }) => /* @__PURE__ */ r("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ r(
|
|
577
577
|
he,
|
|
578
578
|
{
|
|
579
579
|
name: "LoaderCircle",
|
|
@@ -592,7 +592,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
592
592
|
description: a,
|
|
593
593
|
confirmLabel: l = "Delete"
|
|
594
594
|
}) => {
|
|
595
|
-
const c =
|
|
595
|
+
const c = wt("(max-width: 1000px)"), u = a ?? "Do you really want to delete this comment?";
|
|
596
596
|
return e ? c ? /* @__PURE__ */ r(
|
|
597
597
|
Hr,
|
|
598
598
|
{
|
|
@@ -683,7 +683,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
683
683
|
]
|
|
684
684
|
}
|
|
685
685
|
) : null;
|
|
686
|
-
},
|
|
686
|
+
}, en = (e) => {
|
|
687
687
|
const t = z((i) => i.getEnsStatus), n = z(
|
|
688
688
|
(i) => e ? i.ensCache[e] : void 0
|
|
689
689
|
), [s, o] = Y(() => ({
|
|
@@ -716,7 +716,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
716
716
|
id: h,
|
|
717
717
|
isFocused: m
|
|
718
718
|
}) => {
|
|
719
|
-
const p = F(null), f = F(null), [x, g] = Y(!1), [y, A] = Y(!1), E = z((L) => L.openReplyId), k = z((L) => L.setOpenReplyId), R = z((L) => L.requestEditComment), C = z((L) => L.username), { isBelow1280px: T } =
|
|
719
|
+
const p = F(null), f = F(null), [x, g] = Y(!1), [y, A] = Y(!1), E = z((L) => L.openReplyId), k = z((L) => L.setOpenReplyId), R = z((L) => L.requestEditComment), C = z((L) => L.username), { isBelow1280px: T } = Zt(), S = en(e), w = () => {
|
|
720
720
|
var L;
|
|
721
721
|
if ((L = p.current) != null && L.parentElement) {
|
|
722
722
|
const G = p.current.closest('[role="dialog"]');
|
|
@@ -824,12 +824,12 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
824
824
|
] })
|
|
825
825
|
] }) : s ? /* @__PURE__ */ r("p", { className: ae(i, "color-text-secondary italic"), children: s }) : null;
|
|
826
826
|
}, Fl = ({ username: e, createdAt: t }) => {
|
|
827
|
-
const n =
|
|
827
|
+
const n = en(e);
|
|
828
828
|
return /* @__PURE__ */ v("div", { className: "flex justify-start items-center gap-2", children: [
|
|
829
829
|
/* @__PURE__ */ r(
|
|
830
|
-
|
|
830
|
+
Jt,
|
|
831
831
|
{
|
|
832
|
-
src: n.isEns ?
|
|
832
|
+
src: n.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
833
833
|
n.name
|
|
834
834
|
)}`,
|
|
835
835
|
size: "sm",
|
|
@@ -837,7 +837,7 @@ const Mm = ({ 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: as(n.name) }),
|
|
842
842
|
n.isEns && /* @__PURE__ */ r("img", { src: us, alt: "verified", className: "w-3.5 h-3.5" })
|
|
843
843
|
] }) }),
|
|
@@ -875,7 +875,7 @@ const Mm = ({ 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,9 +977,9 @@ const Mm = ({ 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
|
+
Jt,
|
|
981
981
|
{
|
|
982
|
-
src: n.isEns ?
|
|
982
|
+
src: n.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
983
983
|
m.username || ""
|
|
984
984
|
)}`,
|
|
985
985
|
size: "sm",
|
|
@@ -1082,7 +1082,7 @@ const Mm = ({ 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: c ? "Available in a moment" : "",
|
|
1088
1088
|
sideOffset: 0,
|
|
@@ -1096,7 +1096,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1096
1096
|
),
|
|
1097
1097
|
children: [
|
|
1098
1098
|
oe && !o && /* @__PURE__ */ r(
|
|
1099
|
-
|
|
1099
|
+
Ge,
|
|
1100
1100
|
{
|
|
1101
1101
|
text: !c && (p ? "Accept suggestion" : "Mark as resolved"),
|
|
1102
1102
|
position: "bottom",
|
|
@@ -1113,7 +1113,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
),
|
|
1115
1115
|
u && /* @__PURE__ */ r("div", { onClick: (le) => le.stopPropagation(), children: /* @__PURE__ */ r(
|
|
1116
|
-
|
|
1116
|
+
vt,
|
|
1117
1117
|
{
|
|
1118
1118
|
align: "end",
|
|
1119
1119
|
sideOffset: 4,
|
|
@@ -1173,7 +1173,7 @@ const Mm = ({ 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
|
be,
|
|
1178
1178
|
{
|
|
1179
1179
|
icon: "Info",
|
|
@@ -1398,7 +1398,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1398
1398
|
}, [e, R, C]);
|
|
1399
1399
|
const G = () => /* @__PURE__ */ v("div", { className: "p-3 flex flex-col gap-2 color-bg-secondary rounded-md", children: [
|
|
1400
1400
|
/* @__PURE__ */ r(
|
|
1401
|
-
|
|
1401
|
+
Nn,
|
|
1402
1402
|
{
|
|
1403
1403
|
"data-testid": "comment-dropdown-input",
|
|
1404
1404
|
value: (d == null ? void 0 : d.text) || "",
|
|
@@ -1442,14 +1442,14 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1442
1442
|
")"
|
|
1443
1443
|
] }),
|
|
1444
1444
|
/* @__PURE__ */ r("div", { className: "relative flex items-center gap-1", children: (I || s) && !P && /* @__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 Mm = ({ 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 Mm = ({ 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
|
+
Nn,
|
|
1541
1541
|
{
|
|
1542
1542
|
value: o,
|
|
1543
1543
|
onChange: me,
|
|
@@ -1605,7 +1605,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1605
1605
|
[e, t, n, s]
|
|
1606
1606
|
);
|
|
1607
1607
|
return /* @__PURE__ */ r(Ul.Provider, { value: i, children: o });
|
|
1608
|
-
}, hs = () => Rh(Ul), jm =
|
|
1608
|
+
}, hs = () => Rh(Ul), jm = Ze.memo(Bd), Vm = Ze.memo(Od), Wm = "61", $m = (e) => {
|
|
1609
1609
|
const {
|
|
1610
1610
|
editor: t,
|
|
1611
1611
|
onError: n,
|
|
@@ -1620,7 +1620,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1620
1620
|
fetchV1ImageFn: h
|
|
1621
1621
|
} = e, m = Ja(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: A } =
|
|
1623
|
+
}, { isBelow1280px: y, isNativeMobile: A } = Zt(), { isFocusMode: E } = Ld(), { scale: k } = hs(), R = F({ isBelow1280px: y, scale: k });
|
|
1624
1624
|
R.current = { isBelow1280px: y, scale: k };
|
|
1625
1625
|
const C = () => R.current.isBelow1280px ? R.current.scale : 1, T = !y && !A, { toolRef: S, setToolVisibility: w, toolVisibility: b } = Os({
|
|
1626
1626
|
editor: t ?? null,
|
|
@@ -1762,7 +1762,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1762
1762
|
]
|
|
1763
1763
|
), U = M(() => {
|
|
1764
1764
|
o == null || o(!0), B();
|
|
1765
|
-
}, [B, o]), ce = /* @__PURE__ */ r(
|
|
1765
|
+
}, [B, o]), ce = /* @__PURE__ */ r(Ze.Fragment, { children: /* @__PURE__ */ r(
|
|
1766
1766
|
it,
|
|
1767
1767
|
{
|
|
1768
1768
|
ref: ee,
|
|
@@ -1827,7 +1827,7 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1827
1827
|
),
|
|
1828
1828
|
children: ce
|
|
1829
1829
|
}
|
|
1830
|
-
) : /* @__PURE__ */ r(
|
|
1830
|
+
) : /* @__PURE__ */ r(Ze.Fragment, { children: s ? T ? /* @__PURE__ */ r(
|
|
1831
1831
|
it,
|
|
1832
1832
|
{
|
|
1833
1833
|
ref: ee,
|
|
@@ -1840,7 +1840,7 @@ const Mm = ({ 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 Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1865
1865
|
}) : null
|
|
1866
1866
|
},
|
|
1867
1867
|
"Comment"
|
|
1868
|
-
) : q ? /* @__PURE__ */ r(
|
|
1869
|
-
|
|
1868
|
+
) : q ? /* @__PURE__ */ r(Ze.Fragment, { children: /* @__PURE__ */ r(
|
|
1869
|
+
vt,
|
|
1870
1870
|
{
|
|
1871
1871
|
sideOffset: 15,
|
|
1872
1872
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -1890,11 +1890,11 @@ const Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
)
|
|
1892
1892
|
}
|
|
1893
|
-
) }) : /* @__PURE__ */ v(
|
|
1893
|
+
) }) : /* @__PURE__ */ v(Ze.Fragment, { children: [
|
|
1894
1894
|
/* @__PURE__ */ r(Mm, { 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 Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1926
1926
|
We.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 Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1963
1963
|
}
|
|
1964
1964
|
),
|
|
1965
1965
|
G === 3 && /* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider ml-2" })
|
|
1966
|
-
] }, G) : L.name === "Alignment" ? /* @__PURE__ */ v(
|
|
1966
|
+
] }, G) : L.name === "Alignment" ? /* @__PURE__ */ v(Ze.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 Mm = ({ editor: e, elementRef: t }) => {
|
|
|
1988
1988
|
We.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 Mm = ({ 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 Mm = ({ editor: e, elementRef: t }) => {
|
|
|
2029
2029
|
},
|
|
2030
2030
|
L.name
|
|
2031
2031
|
)
|
|
2032
|
-
] }, G) : L.name === "Link" || L.name === "Scripts" ? /* @__PURE__ */ r(
|
|
2033
|
-
|
|
2032
|
+
] }, G) : L.name === "Link" || L.name === "Scripts" ? /* @__PURE__ */ r(Ze.Fragment, { children: /* @__PURE__ */ r(
|
|
2033
|
+
vt,
|
|
2034
2034
|
{
|
|
2035
2035
|
sideOffset: 15,
|
|
2036
2036
|
anchorTrigger: /* @__PURE__ */ r(
|
|
@@ -2060,7 +2060,7 @@ const Mm = ({ 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 Mm = ({ editor: e, elementRef: t }) => {
|
|
|
2094
2094
|
] }) })
|
|
2095
2095
|
}
|
|
2096
2096
|
) : null;
|
|
2097
|
-
}, Hl =
|
|
2097
|
+
}, Hl = Ze.memo($m);
|
|
2098
2098
|
Hl.displayName = "EditorBubbleMenu";
|
|
2099
2099
|
const zl = (e, t) => e ? async (n) => {
|
|
2100
2100
|
const { encryptionKey: s, nonce: o, authTag: i, url: a, contentRef: l } = await e(n);
|
|
@@ -2126,7 +2126,7 @@ const zl = (e, t) => e ? async (n) => {
|
|
|
2126
2126
|
for (u.tagName || (u = c.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
|
-
}, Xr =
|
|
2129
|
+
}, Xr = bt(
|
|
2130
2130
|
({ children: e, className: t, withShadow: n = !0, withBorder: s = !1, ...o }, i) => {
|
|
2131
2131
|
const a = ae(
|
|
2132
2132
|
t,
|
|
@@ -2138,7 +2138,7 @@ const zl = (e, t) => e ? async (n) => {
|
|
|
2138
2138
|
}
|
|
2139
2139
|
);
|
|
2140
2140
|
Xr.displayName = "Surface";
|
|
2141
|
-
const jl =
|
|
2141
|
+
const jl = bt(
|
|
2142
2142
|
({
|
|
2143
2143
|
shouldShowContent: e = !0,
|
|
2144
2144
|
children: t,
|
|
@@ -2155,7 +2155,7 @@ const jl = wt(
|
|
|
2155
2155
|
}
|
|
2156
2156
|
);
|
|
2157
2157
|
jl.displayName = "Toolbar";
|
|
2158
|
-
const Gm =
|
|
2158
|
+
const Gm = bt(
|
|
2159
2159
|
({ horizontal: e, className: t, ...n }, s) => {
|
|
2160
2160
|
const o = ye(
|
|
2161
2161
|
"bg-neutral-200",
|
|
@@ -2741,7 +2741,7 @@ ${te.getHTML()}`
|
|
|
2741
2741
|
/* @__PURE__ */ r(Gi, { sideOffset: 6, children: n.filter((C) => C !== null).map((C, T) => {
|
|
2742
2742
|
var S, w, b;
|
|
2743
2743
|
return /* @__PURE__ */ v(
|
|
2744
|
-
|
|
2744
|
+
_t,
|
|
2745
2745
|
{
|
|
2746
2746
|
disabled: C == null ? void 0 : C.disabled,
|
|
2747
2747
|
onClick: () => {
|
|
@@ -2774,7 +2774,7 @@ ${te.getHTML()}`
|
|
|
2774
2774
|
/* @__PURE__ */ r(Gi, { sideOffset: 6, children: s.filter((C) => C !== null).map((C, T) => {
|
|
2775
2775
|
var S, w, b;
|
|
2776
2776
|
return /* @__PURE__ */ v(
|
|
2777
|
-
|
|
2777
|
+
_t,
|
|
2778
2778
|
{
|
|
2779
2779
|
className: "hover:color-bg-default-hover h-8 rounded p-2 w-full text-left flex items-center justify-between transition text-body-sm",
|
|
2780
2780
|
"data-testid": `import-${((w = (S = C == null ? void 0 : C.title) == null ? void 0 : S.match(/\(\.(\w+)\)/)) == null ? void 0 : w[1]) || ((b = C == null ? void 0 : C.title) == null ? void 0 : b.toLowerCase().replace(/[^a-z]/g, "-"))}`,
|
|
@@ -2789,7 +2789,7 @@ ${te.getHTML()}`
|
|
|
2789
2789
|
}) })
|
|
2790
2790
|
] }),
|
|
2791
2791
|
/* @__PURE__ */ v(
|
|
2792
|
-
|
|
2792
|
+
_t,
|
|
2793
2793
|
{
|
|
2794
2794
|
className: "appearance-none bg-transparent hover:color-bg-default-hover h-8 rounded gap-2 p-2 w-full text-left flex items-center justify-start transition text-body-sm",
|
|
2795
2795
|
onClick: A,
|
|
@@ -2831,7 +2831,7 @@ ${te.getHTML()}`
|
|
|
2831
2831
|
/* @__PURE__ */ r(he, { name: "ChevronDown", size: "sm" })
|
|
2832
2832
|
] }) }),
|
|
2833
2833
|
/* @__PURE__ */ r(zn, { children: ko.map((s) => /* @__PURE__ */ r(
|
|
2834
|
-
|
|
2834
|
+
_t,
|
|
2835
2835
|
{
|
|
2836
2836
|
className: "h-8 rounded py-1 px-2 w-full text-left space-x-2 text-sm color-text-default transition",
|
|
2837
2837
|
onClick: () => {
|
|
@@ -2863,7 +2863,7 @@ ${te.getHTML()}`
|
|
|
2863
2863
|
const o = $d();
|
|
2864
2864
|
return /* @__PURE__ */ v("div", { className: "z-50 flex flex-col justify-center items-center overflow-hidden rounded color-bg-default p-2 gap-1 shadow-elevation-1", children: [
|
|
2865
2865
|
o.map((i) => /* @__PURE__ */ v(
|
|
2866
|
-
|
|
2866
|
+
_t,
|
|
2867
2867
|
{
|
|
2868
2868
|
onMouseDown: (a) => a.preventDefault(),
|
|
2869
2869
|
onClick: () => n(i.value),
|
|
@@ -2883,7 +2883,7 @@ ${te.getHTML()}`
|
|
|
2883
2883
|
)),
|
|
2884
2884
|
/* @__PURE__ */ r("div", { className: "w-full my-1 h-[1px] color-bg-default-hover" }),
|
|
2885
2885
|
qd(e).map((i) => /* @__PURE__ */ v(
|
|
2886
|
-
|
|
2886
|
+
_t,
|
|
2887
2887
|
{
|
|
2888
2888
|
onMouseDown: (a) => a.preventDefault(),
|
|
2889
2889
|
onClick: i.onSelect,
|
|
@@ -2897,7 +2897,7 @@ ${te.getHTML()}`
|
|
|
2897
2897
|
)),
|
|
2898
2898
|
/* @__PURE__ */ r("div", { className: "w-full my-1 h-[1px] color-bg-default-hover" }),
|
|
2899
2899
|
/* @__PURE__ */ v(
|
|
2900
|
-
|
|
2900
|
+
_t,
|
|
2901
2901
|
{
|
|
2902
2902
|
onMouseDown: (i) => i.preventDefault(),
|
|
2903
2903
|
onClick: s,
|
|
@@ -2937,7 +2937,7 @@ ${te.getHTML()}`
|
|
|
2937
2937
|
Gd.map((t) => {
|
|
2938
2938
|
const s = il(t.color) === "#000000" ? "text-black" : "text-white";
|
|
2939
2939
|
return /* @__PURE__ */ r(
|
|
2940
|
-
|
|
2940
|
+
_t,
|
|
2941
2941
|
{
|
|
2942
2942
|
onMouseDown: (o) => o.preventDefault(),
|
|
2943
2943
|
onClick: () => {
|
|
@@ -2965,7 +2965,7 @@ ${te.getHTML()}`
|
|
|
2965
2965
|
);
|
|
2966
2966
|
}),
|
|
2967
2967
|
/* @__PURE__ */ v(
|
|
2968
|
-
|
|
2968
|
+
_t,
|
|
2969
2969
|
{
|
|
2970
2970
|
onMouseDown: (t) => t.preventDefault(),
|
|
2971
2971
|
onClick: () => {
|
|
@@ -3000,7 +3000,7 @@ ${te.getHTML()}`
|
|
|
3000
3000
|
n[t] || n.light
|
|
3001
3001
|
) === "#000000" ? "text-black" : "text-white", i = `var(--color-editor-${n.name})`;
|
|
3002
3002
|
return /* @__PURE__ */ r(
|
|
3003
|
-
|
|
3003
|
+
_t,
|
|
3004
3004
|
{
|
|
3005
3005
|
onMouseDown: (a) => a.preventDefault(),
|
|
3006
3006
|
onClick: () => {
|
|
@@ -3028,7 +3028,7 @@ ${te.getHTML()}`
|
|
|
3028
3028
|
);
|
|
3029
3029
|
}) }),
|
|
3030
3030
|
/* @__PURE__ */ v(
|
|
3031
|
-
|
|
3031
|
+
_t,
|
|
3032
3032
|
{
|
|
3033
3033
|
onMouseDown: (n) => n.preventDefault(),
|
|
3034
3034
|
onClick: () => {
|
|
@@ -3062,7 +3062,7 @@ ${te.getHTML()}`
|
|
|
3062
3062
|
{ value: "right", icon: "AlignRight" },
|
|
3063
3063
|
{ value: "justify", icon: "AlignJustify" }
|
|
3064
3064
|
], lp = ({ editor: e }) => /* @__PURE__ */ r("div", { className: "z-50 h-auto flex flex-wrap gap-1 max-h-[330px] overflow-y-auto scroll-smooth rounded color-bg-default px-1 py-2 shadow-elevation-3 transition-all", children: ap.map((t) => /* @__PURE__ */ r(
|
|
3065
|
-
|
|
3065
|
+
_t,
|
|
3066
3066
|
{
|
|
3067
3067
|
onMouseDown: (n) => n.preventDefault(),
|
|
3068
3068
|
onClick: () => {
|
|
@@ -3179,7 +3179,7 @@ ${te.getHTML()}`
|
|
|
3179
3179
|
onDocxImport: x,
|
|
3180
3180
|
fetchV1ImageFn: y
|
|
3181
3181
|
}), P = Ja(e), Q = M(() => {
|
|
3182
|
-
}, []), ee = e ? P.currentSize : void 0, me = e ? P.onSetFontSize : Q, W = e ? P.currentLineHeight : void 0, oe = e ? P.onSetLineHeight : Q, le =
|
|
3182
|
+
}, []), ee = e ? P.currentSize : void 0, me = e ? P.onSetFontSize : Q, W = e ? P.currentLineHeight : void 0, oe = e ? P.onSetLineHeight : Q, le = wt("(max-width: 1560px)"), O = wt("(max-width: 1370px)"), H = wt("(max-width: 1270px)"), U = wt("(max-width: 1160px)"), ce = wt("(max-width: 1030px)"), q = ve(() => {
|
|
3183
3183
|
switch (!0) {
|
|
3184
3184
|
case ce:
|
|
3185
3185
|
return 1030;
|
|
@@ -3229,7 +3229,7 @@ ${te.getHTML()}`
|
|
|
3229
3229
|
}
|
|
3230
3230
|
),
|
|
3231
3231
|
/* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider mx-1" }),
|
|
3232
|
-
/* @__PURE__ */ r("div", { className: "flex gap-1 justify-center items-center", children: I.map((K, V) => K ? /* @__PURE__ */ r(
|
|
3232
|
+
/* @__PURE__ */ r("div", { className: "flex gap-1 justify-center items-center", children: I.map((K, V) => K ? /* @__PURE__ */ r(Ge, { text: K.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
3233
3233
|
be,
|
|
3234
3234
|
{
|
|
3235
3235
|
className: "disabled:bg-transparent",
|
|
@@ -3369,7 +3369,7 @@ ${te.getHTML()}`
|
|
|
3369
3369
|
onError: t
|
|
3370
3370
|
},
|
|
3371
3371
|
K.title
|
|
3372
|
-
) : /* @__PURE__ */ r(
|
|
3372
|
+
) : /* @__PURE__ */ r(Ge, { text: K.title, asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
3373
3373
|
it,
|
|
3374
3374
|
{
|
|
3375
3375
|
icon: K.icon,
|
|
@@ -3390,7 +3390,7 @@ ${te.getHTML()}`
|
|
|
3390
3390
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-1", children: [
|
|
3391
3391
|
/* @__PURE__ */ r("div", { className: "w-[1px] h-4 vertical-divider mx-2" }),
|
|
3392
3392
|
S && /* @__PURE__ */ r(
|
|
3393
|
-
|
|
3393
|
+
Ge,
|
|
3394
3394
|
{
|
|
3395
3395
|
text: T ? "Back to editor" : "Markdown view",
|
|
3396
3396
|
asTriggerChild: !0,
|
|
@@ -3406,7 +3406,7 @@ ${te.getHTML()}`
|
|
|
3406
3406
|
)
|
|
3407
3407
|
}
|
|
3408
3408
|
),
|
|
3409
|
-
/* @__PURE__ */ r(
|
|
3409
|
+
/* @__PURE__ */ r(Ge, { text: "Enter focus mode", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
3410
3410
|
be,
|
|
3411
3411
|
{
|
|
3412
3412
|
icon: "Focus",
|
|
@@ -3429,7 +3429,7 @@ ${te.getHTML()}`
|
|
|
3429
3429
|
]
|
|
3430
3430
|
}
|
|
3431
3431
|
) : null;
|
|
3432
|
-
}, $l =
|
|
3432
|
+
}, $l = Ze.memo(cp);
|
|
3433
3433
|
$l.displayName = "TiptapToolBar";
|
|
3434
3434
|
const dp = ({
|
|
3435
3435
|
ydoc: e,
|
|
@@ -3477,7 +3477,7 @@ const dp = ({
|
|
|
3477
3477
|
const n = document.createElement("div");
|
|
3478
3478
|
n.classList.add("custom-cursor__label-container"), n.setAttribute("style", `border: 1px solid ${e.color}`);
|
|
3479
3479
|
const s = document.createElement("img");
|
|
3480
|
-
s.src =
|
|
3480
|
+
s.src = Ht, s.classList.add("custom-cursor__icon");
|
|
3481
3481
|
const o = document.createElement("div");
|
|
3482
3482
|
o.classList.add("custom-cursor__label");
|
|
3483
3483
|
const i = document.createElement("span");
|
|
@@ -3769,7 +3769,7 @@ const dp = ({
|
|
|
3769
3769
|
command: t,
|
|
3770
3770
|
editor: n
|
|
3771
3771
|
}) => {
|
|
3772
|
-
const [s, o] = Y(0), [i, a] = Y(e), l =
|
|
3772
|
+
const [s, o] = Y(0), [i, a] = Y(e), l = wt("(max-width: 640px)"), c = io(n, "callout"), u = io(n, "codeBlock"), d = io(n, "column"), h = io(n, "table"), m = M(
|
|
3773
3773
|
(f) => {
|
|
3774
3774
|
const x = i[f];
|
|
3775
3775
|
x && (x.title === "Continue writing" || t(x));
|
|
@@ -4086,7 +4086,7 @@ const ra = () => {
|
|
|
4086
4086
|
var Se;
|
|
4087
4087
|
const [i, a] = Y(!1), [l, c] = Y(!1), [u, d] = Y(e.attrs.prompt), [h, m] = Y(!!e.attrs.content), [p, f] = Y(""), [x, g] = Y(!1), [y, A] = Y(!1), [E, k] = Y([]), [R, C] = Y(
|
|
4088
4088
|
!!localStorage.getItem("include-ddoc-context")
|
|
4089
|
-
), [T, S] = Y(!0), { prompt: w, content: b } = e.attrs, N = F(null), I = F(null), B = F(null), { isSuggestionMode: _ } = nl(), X = !t.isEditable || !!_, { isWindows: $ } =
|
|
4089
|
+
), [T, S] = Y(!0), { prompt: w, content: b } = e.attrs, N = F(null), I = F(null), B = F(null), { isSuggestionMode: _ } = nl(), X = !t.isEditable || !!_, { isWindows: $ } = Zt(), te = $ ? "Ctrl" : "Cmd", P = window.__MODEL_CONTEXT__, Q = F(null), [ee, me] = Y(
|
|
4090
4090
|
ra()
|
|
4091
4091
|
), W = iu({
|
|
4092
4092
|
extensions: [lu, ...cu],
|
|
@@ -4123,9 +4123,9 @@ const ra = () => {
|
|
|
4123
4123
|
(async () => {
|
|
4124
4124
|
if (P != null && P.defaultModels)
|
|
4125
4125
|
try {
|
|
4126
|
-
const ue = P.defaultModels.map((
|
|
4127
|
-
value:
|
|
4128
|
-
label:
|
|
4126
|
+
const ue = P.defaultModels.map((De) => ({
|
|
4127
|
+
value: De.modelName,
|
|
4128
|
+
label: De.label
|
|
4129
4129
|
}));
|
|
4130
4130
|
k(ue);
|
|
4131
4131
|
} catch (ue) {
|
|
@@ -4138,43 +4138,43 @@ const ra = () => {
|
|
|
4138
4138
|
d(w), m(!!b);
|
|
4139
4139
|
}, [w, b]);
|
|
4140
4140
|
const oe = M(() => {
|
|
4141
|
-
var je,
|
|
4141
|
+
var je, zt;
|
|
4142
4142
|
if (!R) return "";
|
|
4143
4143
|
const J = t.getJSON();
|
|
4144
4144
|
if (typeof n() != "number") return "";
|
|
4145
|
-
const
|
|
4145
|
+
const De = 2e3;
|
|
4146
4146
|
let Ee = "";
|
|
4147
|
-
const He = (Xe) => Xe ? Xe.text ? Xe.text : Xe.content ? Xe.content.map((
|
|
4148
|
-
let ze = "",
|
|
4149
|
-
const
|
|
4150
|
-
for (let Xe =
|
|
4151
|
-
const
|
|
4152
|
-
if (
|
|
4153
|
-
ze =
|
|
4147
|
+
const He = (Xe) => Xe ? Xe.text ? Xe.text : Xe.content ? Xe.content.map((Qe) => He(Qe)).join(" ") : "" : "";
|
|
4148
|
+
let ze = "", Ye = 0;
|
|
4149
|
+
const xt = ((je = J.content) == null ? void 0 : je.slice(0, -1)) || [];
|
|
4150
|
+
for (let Xe = xt.length - 1; Xe >= 0; Xe--) {
|
|
4151
|
+
const Qe = He(xt[Xe]);
|
|
4152
|
+
if (Ye + Qe.length > De) {
|
|
4153
|
+
ze = Qe.slice(-(De - Ye)) + ze;
|
|
4154
4154
|
break;
|
|
4155
4155
|
}
|
|
4156
|
-
ze =
|
|
4157
|
-
` + ze,
|
|
4156
|
+
ze = Qe + `
|
|
4157
|
+
` + ze, Ye += Qe.length;
|
|
4158
4158
|
}
|
|
4159
|
-
let
|
|
4160
|
-
const
|
|
4161
|
-
for (const Xe of
|
|
4162
|
-
const
|
|
4163
|
-
if (
|
|
4164
|
-
|
|
4159
|
+
let ht = "", Ke = 0;
|
|
4160
|
+
const lt = ((zt = J.content) == null ? void 0 : zt.slice(-1)) || [];
|
|
4161
|
+
for (const Xe of lt) {
|
|
4162
|
+
const Qe = He(Xe);
|
|
4163
|
+
if (Ke + Qe.length > De) {
|
|
4164
|
+
ht += Qe.slice(0, De - Ke);
|
|
4165
4165
|
break;
|
|
4166
4166
|
}
|
|
4167
|
-
|
|
4168
|
-
`,
|
|
4167
|
+
ht += Qe + `
|
|
4168
|
+
`, Ke += Qe.length;
|
|
4169
4169
|
}
|
|
4170
|
-
return Ee = (ze +
|
|
4170
|
+
return Ee = (ze + ht).trim(), Ee && (Ee = `Document context (${Ye} chars before, ${Ke} chars after):
|
|
4171
4171
|
${Ee}`), Ee;
|
|
4172
4172
|
}, [t, n, R]), le = M(async () => {
|
|
4173
4173
|
var J;
|
|
4174
4174
|
if (u.trim())
|
|
4175
4175
|
try {
|
|
4176
4176
|
a(!0), c(!0), f(""), m(!1), (J = P == null ? void 0 : P.onPromptUsage) == null || J.call(P);
|
|
4177
|
-
const ue = oe(),
|
|
4177
|
+
const ue = oe(), De = R ? `Context from document:
|
|
4178
4178
|
${ue}
|
|
4179
4179
|
|
|
4180
4180
|
User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
@@ -4184,7 +4184,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4184
4184
|
let He = "";
|
|
4185
4185
|
try {
|
|
4186
4186
|
await Ee.streamModel(
|
|
4187
|
-
|
|
4187
|
+
De,
|
|
4188
4188
|
P.activeModel.modelName,
|
|
4189
4189
|
(ze) => {
|
|
4190
4190
|
He += ze, f(He);
|
|
@@ -4205,7 +4205,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4205
4205
|
}
|
|
4206
4206
|
} else if (Ee != null && Ee.callModel) {
|
|
4207
4207
|
const He = await Ee.callModel(
|
|
4208
|
-
|
|
4208
|
+
De,
|
|
4209
4209
|
P.activeModel.modelName
|
|
4210
4210
|
);
|
|
4211
4211
|
s == null || s({
|
|
@@ -4242,8 +4242,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4242
4242
|
if (typeof n == "function") {
|
|
4243
4243
|
g(!0);
|
|
4244
4244
|
const J = setTimeout(() => {
|
|
4245
|
-
t.commands.command(({ tr: ue, dispatch:
|
|
4246
|
-
if (
|
|
4245
|
+
t.commands.command(({ tr: ue, dispatch: De }) => {
|
|
4246
|
+
if (De) {
|
|
4247
4247
|
const Ee = n();
|
|
4248
4248
|
if (Ee !== void 0) {
|
|
4249
4249
|
ue.delete(Ee, Ee + e.nodeSize);
|
|
@@ -4261,8 +4261,8 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4261
4261
|
if (typeof n == "function") {
|
|
4262
4262
|
g(!0);
|
|
4263
4263
|
const J = setTimeout(() => {
|
|
4264
|
-
t.commands.command(({ tr: ue, dispatch:
|
|
4265
|
-
if (
|
|
4264
|
+
t.commands.command(({ tr: ue, dispatch: De }) => {
|
|
4265
|
+
if (De) {
|
|
4266
4266
|
const Ee = n();
|
|
4267
4267
|
if (Ee !== void 0) {
|
|
4268
4268
|
ue.delete(Ee, Ee + e.nodeSize);
|
|
@@ -4287,17 +4287,17 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4287
4287
|
(J) => {
|
|
4288
4288
|
s == null || s({ model: J });
|
|
4289
4289
|
const ue = P == null ? void 0 : P.defaultModels.find(
|
|
4290
|
-
(
|
|
4290
|
+
(De) => De.modelName === J
|
|
4291
4291
|
);
|
|
4292
4292
|
ue && (P != null && P.setActiveModel) && P.setActiveModel(ue);
|
|
4293
4293
|
},
|
|
4294
4294
|
[s, P]
|
|
4295
4295
|
), G = M(() => {
|
|
4296
|
-
var ue,
|
|
4296
|
+
var ue, De;
|
|
4297
4297
|
if (s == null || s({ content: "" }), m(!1), f(""), !N.current) return;
|
|
4298
4298
|
(ue = N.current) == null || ue.focus();
|
|
4299
4299
|
const J = N.current.value.length;
|
|
4300
|
-
(
|
|
4300
|
+
(De = N.current) == null || De.setSelectionRange(J, J), N.current.scrollTop = N.current.scrollHeight;
|
|
4301
4301
|
}, [s]), K = M(() => {
|
|
4302
4302
|
A(!0);
|
|
4303
4303
|
}, []), V = M(() => {
|
|
@@ -4364,7 +4364,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4364
4364
|
className: "flex items-center gap-1",
|
|
4365
4365
|
children: [
|
|
4366
4366
|
/* @__PURE__ */ r(
|
|
4367
|
-
|
|
4367
|
+
Ut.span,
|
|
4368
4368
|
{
|
|
4369
4369
|
initial: { opacity: 0, y: 4 },
|
|
4370
4370
|
animate: { opacity: 1, y: 0 },
|
|
@@ -4662,7 +4662,7 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4662
4662
|
})
|
|
4663
4663
|
};
|
|
4664
4664
|
}
|
|
4665
|
-
}),
|
|
4665
|
+
}), Xt = (e) => {
|
|
4666
4666
|
try {
|
|
4667
4667
|
e();
|
|
4668
4668
|
} catch {
|
|
@@ -4684,37 +4684,37 @@ User prompt: ${u} /no_think` : `${u} /no_think`;
|
|
|
4684
4684
|
if (!e)
|
|
4685
4685
|
return;
|
|
4686
4686
|
const t = Rp(e);
|
|
4687
|
-
t && (
|
|
4687
|
+
t && (Xt(() => {
|
|
4688
4688
|
var n;
|
|
4689
4689
|
return (n = t.destroy) == null ? void 0 : n.call(t);
|
|
4690
|
-
}),
|
|
4690
|
+
}), Xt(() => {
|
|
4691
4691
|
var n, s;
|
|
4692
4692
|
return (s = (n = t.mapping) == null ? void 0 : n.clear) == null ? void 0 : s.call(n);
|
|
4693
|
-
}),
|
|
4693
|
+
}), Xt(() => {
|
|
4694
4694
|
var n, s;
|
|
4695
4695
|
return (s = (n = t.isOMark) == null ? void 0 : n.clear) == null ? void 0 : s.call(n);
|
|
4696
|
-
}),
|
|
4696
|
+
}), Xt(() => {
|
|
4697
4697
|
t.beforeTransactionSelection = null;
|
|
4698
|
-
}),
|
|
4698
|
+
}), Xt(() => {
|
|
4699
4699
|
t._domSelectionInView = null;
|
|
4700
4700
|
}));
|
|
4701
4701
|
}, la = (e) => {
|
|
4702
4702
|
if (!e)
|
|
4703
4703
|
return;
|
|
4704
4704
|
const t = Ap(e), n = t == null ? void 0 : t.undoManager;
|
|
4705
|
-
n && (
|
|
4705
|
+
n && (Xt(() => {
|
|
4706
4706
|
var s;
|
|
4707
4707
|
return (s = n.clear) == null ? void 0 : s.call(n, !0, !0);
|
|
4708
|
-
}),
|
|
4708
|
+
}), Xt(() => {
|
|
4709
4709
|
var s;
|
|
4710
4710
|
return (s = n.destroy) == null ? void 0 : s.call(n);
|
|
4711
|
-
}),
|
|
4711
|
+
}), Xt(() => {
|
|
4712
4712
|
n.restore = null;
|
|
4713
|
-
}),
|
|
4713
|
+
}), Xt(() => {
|
|
4714
4714
|
n.undoStack = [];
|
|
4715
|
-
}),
|
|
4715
|
+
}), Xt(() => {
|
|
4716
4716
|
n.redoStack = [];
|
|
4717
|
-
}),
|
|
4717
|
+
}), Xt(() => {
|
|
4718
4718
|
t.prevSel = null;
|
|
4719
4719
|
}));
|
|
4720
4720
|
}, Ip = (e) => {
|
|
@@ -4984,20 +4984,20 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
4984
4984
|
}) => {
|
|
4985
4985
|
const V = (c == null ? void 0 : c.enabled) === !0, D = V ? c.connection : null, { activeCommentId: se, setActiveCommentId: fe, focusCommentWithActiveId: re } = Wp(), Se = F(H);
|
|
4986
4986
|
Se.current = H;
|
|
4987
|
-
const J = F(null), ue = !!(R && T), { tocItems:
|
|
4987
|
+
const J = F(null), ue = !!(R && T), { tocItems: De, setTocItems: Ee, handleTocUpdateForTab: He } = $p(H), ze = !!(i && a === "suggest"), Ye = F(cl), xt = G ?? Ye, ht = M(
|
|
4988
4988
|
(we, pe) => {
|
|
4989
4989
|
Se.current === we && (fe(pe || null), pe && setTimeout(() => re(pe)));
|
|
4990
4990
|
},
|
|
4991
4991
|
[re, fe]
|
|
4992
|
-
),
|
|
4992
|
+
), Ke = M(
|
|
4993
4993
|
(we, pe, Te) => {
|
|
4994
4994
|
Se.current === we && He(we, pe, Te);
|
|
4995
4995
|
},
|
|
4996
4996
|
[He]
|
|
4997
4997
|
), {
|
|
4998
|
-
buildExtensionsForTab:
|
|
4998
|
+
buildExtensionsForTab: lt,
|
|
4999
4999
|
commentAnchorsRef: je,
|
|
5000
|
-
draftAnchorsRef:
|
|
5000
|
+
draftAnchorsRef: zt,
|
|
5001
5001
|
storeApiRef: Xe
|
|
5002
5002
|
} = qp({
|
|
5003
5003
|
ydoc: e,
|
|
@@ -5014,24 +5014,24 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5014
5014
|
maxTokens: C,
|
|
5015
5015
|
hasAvailableModels: ue,
|
|
5016
5016
|
activeCommentId: se,
|
|
5017
|
-
onCommentActivated:
|
|
5018
|
-
onTocUpdateForTab:
|
|
5017
|
+
onCommentActivated: ht,
|
|
5018
|
+
onTocUpdateForTab: Ke,
|
|
5019
5019
|
externalExtensions: le,
|
|
5020
5020
|
initialCommentAnchors: L,
|
|
5021
5021
|
isSuggestionMode: ze,
|
|
5022
|
-
dBlockRuntimeStateRef:
|
|
5022
|
+
dBlockRuntimeStateRef: xt,
|
|
5023
5023
|
docSchemaVersion: K
|
|
5024
|
-
}), { handleCommentInteraction:
|
|
5024
|
+
}), { handleCommentInteraction: Qe, handleCommentClick: St } = Gp({
|
|
5025
5025
|
isFocusMode: m,
|
|
5026
5026
|
onCommentInteraction: p
|
|
5027
|
-
}),
|
|
5027
|
+
}), an = F(m);
|
|
5028
5028
|
j(() => {
|
|
5029
|
-
|
|
5029
|
+
an.current = m;
|
|
5030
5030
|
}, [m]);
|
|
5031
|
-
const
|
|
5031
|
+
const ln = M(
|
|
5032
5032
|
(we, pe) => {
|
|
5033
5033
|
var Ae;
|
|
5034
|
-
if (!vs(we, J.current) ||
|
|
5034
|
+
if (!vs(we, J.current) || an.current)
|
|
5035
5035
|
return !1;
|
|
5036
5036
|
const Te = nr(pe.target), ge = Te == null ? void 0 : Te.closest(
|
|
5037
5037
|
"[data-suggestion-id][data-comment-id]"
|
|
@@ -5039,14 +5039,14 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5039
5039
|
return !Fe || !(((Ae = Xe.current) == null ? void 0 : Ae.getState().focusSubmittedSuggestionFromEditor(Fe)) ?? !1) ? !1 : (pe.preventDefault(), pe.stopPropagation(), we.dom.blur(), !0);
|
|
5040
5040
|
},
|
|
5041
5041
|
[Xe]
|
|
5042
|
-
),
|
|
5043
|
-
|
|
5042
|
+
), Kt = F(!0), [cn, ms] = Y([]), gn = F(X);
|
|
5043
|
+
gn.current = X, j(() => {
|
|
5044
5044
|
H && fe(null);
|
|
5045
5045
|
}, [H, fe]);
|
|
5046
5046
|
const ps = M(
|
|
5047
5047
|
(we) => {
|
|
5048
|
-
const pe = !
|
|
5049
|
-
extensions:
|
|
5048
|
+
const pe = !gn.current && Kt.current && Se.current === we, Te = new dl({
|
|
5049
|
+
extensions: lt(we),
|
|
5050
5050
|
editorProps: {
|
|
5051
5051
|
clipboardTextSerializer(ge) {
|
|
5052
5052
|
return ge.content.textBetween(0, ge.content.size, `
|
|
@@ -5055,13 +5055,13 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5055
5055
|
},
|
|
5056
5056
|
...ql,
|
|
5057
5057
|
handleDOMEvents: {
|
|
5058
|
-
mousedown:
|
|
5059
|
-
mouseover: (ge, Fe) => vs(ge, J.current) ?
|
|
5058
|
+
mousedown: ln,
|
|
5059
|
+
mouseover: (ge, Fe) => vs(ge, J.current) ? Qe(ge, Fe) : !1,
|
|
5060
5060
|
keydown: (ge, Fe) => {
|
|
5061
5061
|
if (!vs(ge, J.current))
|
|
5062
5062
|
return !1;
|
|
5063
5063
|
if (["ArrowUp", "ArrowDown", "Enter"].includes(Fe.key)) {
|
|
5064
|
-
const
|
|
5064
|
+
const Ie = ge.dom.ownerDocument, Ae = Ie.getElementById("slash-command"), _e = Ie.getElementById("emoji-list");
|
|
5065
5065
|
if (Ae || _e)
|
|
5066
5066
|
return !0;
|
|
5067
5067
|
}
|
|
@@ -5076,33 +5076,33 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5076
5076
|
});
|
|
5077
5077
|
}), !1)
|
|
5078
5078
|
},
|
|
5079
|
-
handleClick: (ge, Fe,
|
|
5079
|
+
handleClick: (ge, Fe, Ie) => {
|
|
5080
5080
|
var Ce;
|
|
5081
5081
|
if (!vs(ge, J.current))
|
|
5082
5082
|
return !1;
|
|
5083
|
-
const Ae =
|
|
5083
|
+
const Ae = Ie.metaKey || Ie.ctrlKey, _e = nr(Ie.target), Oe = _e == null ? void 0 : _e.closest("a");
|
|
5084
5084
|
if (Oe != null && Oe.href) {
|
|
5085
5085
|
const Tt = new URL(Oe.href, window.location.href);
|
|
5086
5086
|
if (Tt.hash && Tt.origin === window.location.origin) {
|
|
5087
5087
|
const Dt = decodeURIComponent(Tt.hash.slice(1)), Et = new URLSearchParams(Dt).get("heading");
|
|
5088
5088
|
if (Et) {
|
|
5089
|
-
|
|
5090
|
-
const
|
|
5091
|
-
if (
|
|
5089
|
+
Ie.preventDefault();
|
|
5090
|
+
const Gt = Et.split("-").pop();
|
|
5091
|
+
if (Gt) {
|
|
5092
5092
|
const Yn = ge.dom.querySelectorAll("[data-toc-id]"), Vs = Array.from(Yn).find(
|
|
5093
|
-
(
|
|
5093
|
+
(bn) => {
|
|
5094
5094
|
var Rn;
|
|
5095
|
-
return (Rn =
|
|
5095
|
+
return (Rn = bn.dataset.tocId) == null ? void 0 : Rn.includes(Gt);
|
|
5096
5096
|
}
|
|
5097
5097
|
);
|
|
5098
5098
|
if (Vs) {
|
|
5099
|
-
const
|
|
5099
|
+
const bn = Sn({
|
|
5100
5100
|
targetElement: Vs,
|
|
5101
5101
|
editorRoot: ge.dom
|
|
5102
5102
|
});
|
|
5103
|
-
return
|
|
5104
|
-
const Rn =
|
|
5105
|
-
|
|
5103
|
+
return bn && requestAnimationFrame(() => {
|
|
5104
|
+
const Rn = bn.getBoundingClientRect(), Ws = Vs.getBoundingClientRect();
|
|
5105
|
+
bn.scrollBy({
|
|
5106
5106
|
top: Ws.top - Rn.top,
|
|
5107
5107
|
behavior: "smooth"
|
|
5108
5108
|
});
|
|
@@ -5115,11 +5115,11 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5115
5115
|
return !1;
|
|
5116
5116
|
if (((Ce = Oe == null ? void 0 : Oe.textContent) == null ? void 0 : Ce.match(mu)) ?? !1) {
|
|
5117
5117
|
if (Ae)
|
|
5118
|
-
return
|
|
5118
|
+
return Ie.preventDefault(), window.open(Oe.href, "_blank"), !0;
|
|
5119
5119
|
} else
|
|
5120
|
-
return
|
|
5120
|
+
return Ie.preventDefault(), window.open(Oe.href, "_blank"), !0;
|
|
5121
5121
|
}
|
|
5122
|
-
return St ? St(ge, Fe,
|
|
5122
|
+
return St ? St(ge, Fe, Ie) : !1;
|
|
5123
5123
|
},
|
|
5124
5124
|
// `...DdocEditorProps` above already sets `attributes` as ONE key
|
|
5125
5125
|
// inside this same object literal — a later `attributes:` key
|
|
@@ -5136,18 +5136,18 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5136
5136
|
textDirection: "auto",
|
|
5137
5137
|
autofocus: pe ? "start" : !1
|
|
5138
5138
|
});
|
|
5139
|
-
return
|
|
5139
|
+
return Kt.current = !1, Te;
|
|
5140
5140
|
},
|
|
5141
5141
|
[
|
|
5142
|
-
|
|
5143
|
-
|
|
5142
|
+
lt,
|
|
5143
|
+
ln,
|
|
5144
5144
|
St,
|
|
5145
|
-
|
|
5145
|
+
Qe,
|
|
5146
5146
|
K
|
|
5147
5147
|
]
|
|
5148
|
-
), Kn = ve(() => V, [V]), En = ve(() => !(i && !ze), [i, ze]),
|
|
5148
|
+
), Kn = ve(() => V, [V]), En = ve(() => !(i && !ze), [i, ze]), yn = M((we) => {
|
|
5149
5149
|
Fi(we), Ip(we), Fi(we);
|
|
5150
|
-
}, []), { editor: ie, cachedEditorEntries:
|
|
5150
|
+
}, []), { editor: ie, cachedEditorEntries: xn } = Fp({
|
|
5151
5151
|
activeTabId: H,
|
|
5152
5152
|
tabIds: U,
|
|
5153
5153
|
activeTabIdRef: Se,
|
|
@@ -5155,23 +5155,23 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5155
5155
|
editorRef: q,
|
|
5156
5156
|
readyState: En,
|
|
5157
5157
|
createEditorForTab: ps,
|
|
5158
|
-
destroyEditor:
|
|
5158
|
+
destroyEditor: yn
|
|
5159
5159
|
});
|
|
5160
5160
|
j(() => {
|
|
5161
|
-
ie && (
|
|
5161
|
+
ie && (Kt.current = !1);
|
|
5162
5162
|
}, [ie]), j(() => {
|
|
5163
5163
|
var pe;
|
|
5164
5164
|
if (!ie || ie.isDestroyed) return;
|
|
5165
5165
|
const we = (pe = ie.view) == null ? void 0 : pe.dom;
|
|
5166
5166
|
we && (ze ? we.setAttribute("data-suggestion-mode", "true") : we.removeAttribute("data-suggestion-mode"));
|
|
5167
5167
|
}, [ie, ze]);
|
|
5168
|
-
const At = F(null),
|
|
5168
|
+
const At = F(null), tn = F(null), Pe = F(0), Me = F(""), st = M(
|
|
5169
5169
|
(we) => {
|
|
5170
5170
|
!ie || ie.isDestroyed || (At.current && clearTimeout(At.current), At.current = setTimeout(() => {
|
|
5171
5171
|
At.current = null;
|
|
5172
5172
|
const pe = ++Pe.current;
|
|
5173
|
-
ao(
|
|
5174
|
-
|
|
5173
|
+
ao(tn.current), tn.current = ha(() => {
|
|
5174
|
+
tn.current = null, pe === Pe.current && J.current === ie && !ie.isDestroyed && ie.commands.updateTableOfContents();
|
|
5175
5175
|
});
|
|
5176
5176
|
}, we));
|
|
5177
5177
|
},
|
|
@@ -5189,13 +5189,13 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5189
5189
|
Te !== Me.current && (Me.current = Te, st(300));
|
|
5190
5190
|
};
|
|
5191
5191
|
return ie.on("transaction", we), () => {
|
|
5192
|
-
ie.off("transaction", we), At.current && clearTimeout(At.current), ao(
|
|
5192
|
+
ie.off("transaction", we), At.current && clearTimeout(At.current), ao(tn.current), tn.current = null, Pe.current += 1;
|
|
5193
5193
|
};
|
|
5194
5194
|
}, [ie, st]), j(() => {
|
|
5195
5195
|
if (!i) return;
|
|
5196
5196
|
const we = (pe) => {
|
|
5197
|
-
var
|
|
5198
|
-
const Te = nr(pe.target), ge = (
|
|
5197
|
+
var Ie;
|
|
5198
|
+
const Te = nr(pe.target), ge = (Ie = J.current) == null ? void 0 : Ie.view.dom;
|
|
5199
5199
|
if (!ge || !Te || !ge.contains(Te))
|
|
5200
5200
|
return;
|
|
5201
5201
|
const Fe = Te.closest("a");
|
|
@@ -5210,19 +5210,19 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5210
5210
|
const It = Array.from(
|
|
5211
5211
|
ge.querySelectorAll("[data-toc-id]")
|
|
5212
5212
|
).find((Dt) => {
|
|
5213
|
-
var
|
|
5214
|
-
return (
|
|
5213
|
+
var hn;
|
|
5214
|
+
return (hn = Dt.dataset.tocId) == null ? void 0 : hn.includes(Tt);
|
|
5215
5215
|
});
|
|
5216
5216
|
if (It) {
|
|
5217
5217
|
pe.preventDefault(), pe.stopPropagation();
|
|
5218
|
-
const Dt =
|
|
5218
|
+
const Dt = Sn({
|
|
5219
5219
|
targetElement: It,
|
|
5220
5220
|
editorRoot: ge
|
|
5221
5221
|
});
|
|
5222
5222
|
Dt && requestAnimationFrame(() => {
|
|
5223
|
-
const
|
|
5223
|
+
const hn = Dt.getBoundingClientRect(), Et = It.getBoundingClientRect();
|
|
5224
5224
|
Dt.scrollBy({
|
|
5225
|
-
top: Et.top -
|
|
5225
|
+
top: Et.top - hn.top,
|
|
5226
5226
|
behavior: "smooth"
|
|
5227
5227
|
});
|
|
5228
5228
|
});
|
|
@@ -5236,9 +5236,9 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5236
5236
|
}, [i]), j(() => {
|
|
5237
5237
|
Kn && _(!u && !W);
|
|
5238
5238
|
}, [Kn, u, W]);
|
|
5239
|
-
const
|
|
5239
|
+
const Re = F(!1), jt = F(null), rt = M(
|
|
5240
5240
|
(we) => {
|
|
5241
|
-
const pe = we.map((Te) =>
|
|
5241
|
+
const pe = we.map((Te) => at(Te));
|
|
5242
5242
|
qe.applyUpdate(e, qe.mergeUpdates(pe), "self");
|
|
5243
5243
|
},
|
|
5244
5244
|
[e]
|
|
@@ -5258,16 +5258,16 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5258
5258
|
return;
|
|
5259
5259
|
}
|
|
5260
5260
|
const pe = `${o || "no-version-id"}:${H || "default"}`;
|
|
5261
|
-
if (!n &&
|
|
5261
|
+
if (!n && Re.current) {
|
|
5262
5262
|
B(!1);
|
|
5263
5263
|
return;
|
|
5264
5264
|
}
|
|
5265
|
-
if (n &&
|
|
5265
|
+
if (n && jt.current === pe) {
|
|
5266
5266
|
B(!1);
|
|
5267
5267
|
return;
|
|
5268
5268
|
}
|
|
5269
5269
|
B(!0), queueMicrotask(() => {
|
|
5270
|
-
if (l !== "" && l !== void 0 && (ct(l) ? Array.isArray(l) ? rt(l) : qe.applyUpdate(e,
|
|
5270
|
+
if (l !== "" && l !== void 0 && (ct(l) ? Array.isArray(l) ? rt(l) : qe.applyUpdate(e, at(l), "self") : ie.commands.setContent(
|
|
5271
5271
|
fu({
|
|
5272
5272
|
data: l,
|
|
5273
5273
|
ignoreCorruptedData: P,
|
|
@@ -5275,7 +5275,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5275
5275
|
wrapInDBlock: !!ie.schema.nodes.dBlock
|
|
5276
5276
|
})
|
|
5277
5277
|
)), n) {
|
|
5278
|
-
|
|
5278
|
+
jt.current = pe, B(!1);
|
|
5279
5279
|
return;
|
|
5280
5280
|
}
|
|
5281
5281
|
const Te = l === void 0 && ie.isEmpty;
|
|
@@ -5283,7 +5283,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5283
5283
|
}).finally(() => {
|
|
5284
5284
|
Te && B(!1);
|
|
5285
5285
|
});
|
|
5286
|
-
}),
|
|
5286
|
+
}), Re.current = !0;
|
|
5287
5287
|
}, [
|
|
5288
5288
|
l,
|
|
5289
5289
|
V,
|
|
@@ -5301,7 +5301,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5301
5301
|
oe
|
|
5302
5302
|
]);
|
|
5303
5303
|
const mt = F(() => {
|
|
5304
|
-
}), jn = F(null), An = 3e4,
|
|
5304
|
+
}), jn = F(null), An = 3e4, Vt = F(null), nn = F(!1);
|
|
5305
5305
|
Yp({
|
|
5306
5306
|
editor: ie,
|
|
5307
5307
|
isReady: u,
|
|
@@ -5317,18 +5317,18 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5317
5317
|
pe.state.doc.nodesBetween(
|
|
5318
5318
|
Te,
|
|
5319
5319
|
ge,
|
|
5320
|
-
(
|
|
5321
|
-
|
|
5320
|
+
(Ie, Ae) => {
|
|
5321
|
+
Ie.marks && Ie.marks.forEach((_e) => {
|
|
5322
5322
|
_e.type.name === "textStyle" && _e.attrs.color && Fe.push({
|
|
5323
5323
|
from: Ae,
|
|
5324
|
-
to: Ae +
|
|
5324
|
+
to: Ae + Ie.nodeSize,
|
|
5325
5325
|
mark: _e
|
|
5326
5326
|
});
|
|
5327
5327
|
});
|
|
5328
5328
|
}
|
|
5329
|
-
), pe.chain().setTextSelection({ from: Te, to: ge }).setColor("").run(), Fe.forEach(({ from:
|
|
5329
|
+
), pe.chain().setTextSelection({ from: Te, to: ge }).setColor("").run(), Fe.forEach(({ from: Ie, to: Ae, mark: _e }) => {
|
|
5330
5330
|
const Oe = _e.attrs.color;
|
|
5331
|
-
hl(Oe) || pe.chain().setTextSelection({ from:
|
|
5331
|
+
hl(Oe) || pe.chain().setTextSelection({ from: Ie, to: Ae }).setColor(Oe).run();
|
|
5332
5332
|
}), pe.commands.setTextSelection(ge);
|
|
5333
5333
|
}, 0);
|
|
5334
5334
|
};
|
|
@@ -5336,9 +5336,9 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5336
5336
|
ie.off("paste", we);
|
|
5337
5337
|
};
|
|
5338
5338
|
}, [ie]);
|
|
5339
|
-
const
|
|
5339
|
+
const Wt = F(null), Nt = F(null), pt = F(0), $t = F(
|
|
5340
5340
|
null
|
|
5341
|
-
), Rt = F({}),
|
|
5341
|
+
), Rt = F({}), wn = F(0), Vn = F(I);
|
|
5342
5342
|
j(() => {
|
|
5343
5343
|
Vn.current = I;
|
|
5344
5344
|
});
|
|
@@ -5349,22 +5349,22 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5349
5349
|
return (pe = Vn.current) == null ? void 0 : pe.call(Vn, we);
|
|
5350
5350
|
}
|
|
5351
5351
|
));
|
|
5352
|
-
const xe = Wn.current,
|
|
5352
|
+
const xe = Wn.current, qt = !!I;
|
|
5353
5353
|
j(() => {
|
|
5354
|
-
if (!N && !
|
|
5354
|
+
if (!N && !qt)
|
|
5355
5355
|
return;
|
|
5356
5356
|
const we = gu();
|
|
5357
|
-
return
|
|
5358
|
-
|
|
5357
|
+
return $t.current = we, () => {
|
|
5358
|
+
$t.current === we && ($t.current = null), we.destroy();
|
|
5359
5359
|
};
|
|
5360
|
-
}, [N,
|
|
5361
|
-
if (!ie || !S && !w && !b && !N && !
|
|
5360
|
+
}, [N, qt]), j(() => {
|
|
5361
|
+
if (!ie || !S && !w && !b && !N && !qt)
|
|
5362
5362
|
return;
|
|
5363
5363
|
const we = () => {
|
|
5364
|
-
if (!b && !
|
|
5364
|
+
if (!b && !qt || J.current !== ie || ie.isDestroyed)
|
|
5365
5365
|
return;
|
|
5366
|
-
const { from: ge, to: Fe, empty:
|
|
5367
|
-
if (
|
|
5366
|
+
const { from: ge, to: Fe, empty: Ie } = ie.state.selection;
|
|
5367
|
+
if (Ie) {
|
|
5368
5368
|
b == null || b(0), xe.publish({ selectedWords: 0 });
|
|
5369
5369
|
return;
|
|
5370
5370
|
}
|
|
@@ -5375,23 +5375,23 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5375
5375
|
ge ? [
|
|
5376
5376
|
...ge.transaction ? [ge.transaction] : [],
|
|
5377
5377
|
...ge.appendedTransactions ?? []
|
|
5378
|
-
].some(Kp) && (
|
|
5378
|
+
].some(Kp) && (wn.current += 1) : (wn.current += 1, xe.beginTab(
|
|
5379
5379
|
((Fe = Rt.current[H]) == null ? void 0 : Fe.pageCount) ?? null
|
|
5380
|
-
)),
|
|
5381
|
-
if (
|
|
5382
|
-
const
|
|
5383
|
-
S == null || S(
|
|
5380
|
+
)), Wt.current && clearTimeout(Wt.current), Wt.current = setTimeout(() => {
|
|
5381
|
+
if (Wt.current = null, ie && J.current === ie && !ie.isDestroyed) {
|
|
5382
|
+
const Ie = ie.storage.characterCount.characters() ?? 0;
|
|
5383
|
+
S == null || S(Ie);
|
|
5384
5384
|
const Ae = ie.storage.characterCount.words() ?? 0;
|
|
5385
|
-
if (w == null || w(Ae), xe.publish({ characters:
|
|
5386
|
-
const _e =
|
|
5385
|
+
if (w == null || w(Ae), xe.publish({ characters: Ie, words: Ae }, { tick: !0 }), (N || qt) && Gl(ie) === null) {
|
|
5386
|
+
const _e = $t.current;
|
|
5387
5387
|
if (!_e)
|
|
5388
5388
|
return;
|
|
5389
5389
|
const Oe = Rt.current[H];
|
|
5390
|
-
if (Oe &&
|
|
5390
|
+
if (Oe && Ie > Up && Oe.structuralVersion === wn.current && Math.abs(Ie - Oe.characters) < Oe.characters * Hp && Date.now() - Oe.at < zp) {
|
|
5391
5391
|
const It = Math.max(
|
|
5392
5392
|
1,
|
|
5393
5393
|
Math.round(
|
|
5394
|
-
Oe.pageCount *
|
|
5394
|
+
Oe.pageCount * Ie / Oe.characters
|
|
5395
5395
|
)
|
|
5396
5396
|
);
|
|
5397
5397
|
N == null || N(It), xe.publish({ pages: It });
|
|
@@ -5401,19 +5401,19 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5401
5401
|
ao(Nt.current), Nt.current = ha(() => {
|
|
5402
5402
|
if (Nt.current = null, Ce !== pt.current || J.current !== ie || ie.isDestroyed)
|
|
5403
5403
|
return;
|
|
5404
|
-
const It = ie.getHTML(), Dt = ie.state.doc === Tt ?
|
|
5404
|
+
const It = ie.getHTML(), Dt = ie.state.doc === Tt ? Ie : ie.storage.characterCount.characters() ?? 0, hn = wn.current;
|
|
5405
5405
|
_e.getPageCount(It).then((Et) => {
|
|
5406
5406
|
Ce === pt.current && J.current === ie && ie && !ie.isDestroyed && (Rt.current[H] = {
|
|
5407
5407
|
characters: Dt,
|
|
5408
5408
|
pageCount: Et,
|
|
5409
5409
|
at: Date.now(),
|
|
5410
|
-
structuralVersion:
|
|
5410
|
+
structuralVersion: hn
|
|
5411
5411
|
}, N == null || N(Et), xe.publish({ pages: Et }));
|
|
5412
5412
|
}).catch(() => {
|
|
5413
5413
|
var Et;
|
|
5414
5414
|
if (Ce === pt.current && J.current === ie && ie && !ie.isDestroyed) {
|
|
5415
|
-
const
|
|
5416
|
-
N == null || N(
|
|
5415
|
+
const Gt = ((Et = Rt.current[H]) == null ? void 0 : Et.pageCount) ?? 1;
|
|
5416
|
+
N == null || N(Gt), xe.publish({ pages: Gt });
|
|
5417
5417
|
}
|
|
5418
5418
|
});
|
|
5419
5419
|
});
|
|
@@ -5422,17 +5422,17 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5422
5422
|
}, 500);
|
|
5423
5423
|
};
|
|
5424
5424
|
pe(), we();
|
|
5425
|
-
const Te = N ||
|
|
5425
|
+
const Te = N || qt ? Lp(
|
|
5426
5426
|
ie,
|
|
5427
5427
|
(ge) => {
|
|
5428
5428
|
J.current === ie && (N == null || N(ge), xe.publish({ pages: ge }));
|
|
5429
5429
|
},
|
|
5430
5430
|
() => {
|
|
5431
|
-
|
|
5431
|
+
wn.current += 1, pe({});
|
|
5432
5432
|
}
|
|
5433
5433
|
) : void 0;
|
|
5434
5434
|
return ie.on("update", pe), ie.on("selectionUpdate", we), () => {
|
|
5435
|
-
Te == null || Te(), ie.off("update", pe), ie.off("selectionUpdate", we),
|
|
5435
|
+
Te == null || Te(), ie.off("update", pe), ie.off("selectionUpdate", we), Wt.current && clearTimeout(Wt.current), ao(Nt.current), Nt.current = null, pt.current += 1;
|
|
5436
5436
|
};
|
|
5437
5437
|
}, [
|
|
5438
5438
|
H,
|
|
@@ -5441,32 +5441,32 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5441
5441
|
N,
|
|
5442
5442
|
w,
|
|
5443
5443
|
b,
|
|
5444
|
-
|
|
5444
|
+
qt,
|
|
5445
5445
|
xe
|
|
5446
5446
|
]), j(() => {
|
|
5447
5447
|
const we = (pe) => {
|
|
5448
|
-
(pe.ctrlKey || pe.metaKey) && pe.key === "p" && (pe.preventDefault(), ie && _p(ie, $,
|
|
5448
|
+
(pe.ctrlKey || pe.metaKey) && pe.key === "p" && (pe.preventDefault(), ie && _p(ie, $, cn));
|
|
5449
5449
|
};
|
|
5450
5450
|
return window.addEventListener("keydown", we), () => {
|
|
5451
5451
|
window.removeEventListener("keydown", we);
|
|
5452
5452
|
};
|
|
5453
|
-
}, [ie, $,
|
|
5453
|
+
}, [ie, $, cn]), j(() => {
|
|
5454
5454
|
if (!V || !D) return;
|
|
5455
5455
|
const we = D.livePresence === !0 || D.connectOnOpen === !0, pe = () => {
|
|
5456
|
-
|
|
5456
|
+
nn.current || (nn.current = !0, Q(D));
|
|
5457
5457
|
}, Te = () => {
|
|
5458
|
-
|
|
5458
|
+
nn.current && (nn.current = !1, ee());
|
|
5459
5459
|
}, ge = () => {
|
|
5460
|
-
|
|
5461
|
-
|
|
5460
|
+
Vt.current && clearTimeout(Vt.current), Vt.current = setTimeout(() => {
|
|
5461
|
+
Vt.current = null, D.livePresence !== !0 && D.connectOnOpen !== !0 && Te();
|
|
5462
5462
|
}, An);
|
|
5463
5463
|
};
|
|
5464
5464
|
we && pe();
|
|
5465
|
-
const Fe = (
|
|
5465
|
+
const Fe = (Ie, Ae) => {
|
|
5466
5466
|
Ae === "self" || Ae === "remote" || !me || (pe(), ge());
|
|
5467
5467
|
};
|
|
5468
5468
|
return e == null || e.on("update", Fe), () => {
|
|
5469
|
-
e == null || e.off("update", Fe),
|
|
5469
|
+
e == null || e.off("update", Fe), Vt.current && (clearTimeout(Vt.current), Vt.current = null);
|
|
5470
5470
|
};
|
|
5471
5471
|
}, [
|
|
5472
5472
|
V,
|
|
@@ -5480,7 +5480,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5480
5480
|
ee,
|
|
5481
5481
|
me
|
|
5482
5482
|
]);
|
|
5483
|
-
const $n = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, { isNativeMobile: qn } =
|
|
5483
|
+
const $n = window.location.hash.startsWith("#") ? window.location.hash.substring(1) : window.location.hash, { isNativeMobile: qn } = Zt(t), fs = new URLSearchParams($n), dn = fs.get("heading"), ft = dn == null ? void 0 : dn.split("-").pop(), Gn = M(
|
|
5484
5484
|
(we) => {
|
|
5485
5485
|
if (ie)
|
|
5486
5486
|
try {
|
|
@@ -5493,11 +5493,11 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5493
5493
|
if (!Te) return;
|
|
5494
5494
|
const ge = ul(
|
|
5495
5495
|
Te == null ? void 0 : Te.textContent
|
|
5496
|
-
), Fe =
|
|
5496
|
+
), Fe = dn == null ? void 0 : dn.split("-").slice(0, -1).join("-");
|
|
5497
5497
|
ge !== Fe && (fs.set("heading", `${ge}-${we}`), window.location.hash = fs.toString());
|
|
5498
|
-
const
|
|
5499
|
-
Ae.setSelection(new Es(Ae.doc.resolve(
|
|
5500
|
-
const _e =
|
|
5498
|
+
const Ie = ie.view.posAtDOM(Te, 0), Ae = ie.view.state.tr;
|
|
5499
|
+
Ae.setSelection(new Es(Ae.doc.resolve(Ie))), ie.view.dispatch(Ae);
|
|
5500
|
+
const _e = Sn({
|
|
5501
5501
|
targetElement: Te,
|
|
5502
5502
|
editorRoot: ie.view.dom
|
|
5503
5503
|
});
|
|
@@ -5531,7 +5531,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5531
5531
|
const we = setTimeout(() => {
|
|
5532
5532
|
const { tr: pe, doc: Te } = ie.state;
|
|
5533
5533
|
let ge = !1;
|
|
5534
|
-
Te.descendants((Fe,
|
|
5534
|
+
Te.descendants((Fe, Ie) => {
|
|
5535
5535
|
if (!Fe.marks || Fe.marks.length === 0) return;
|
|
5536
5536
|
const Ae = Fe.marks.find(
|
|
5537
5537
|
(Ce) => Ce.type.name === "textStyle" && Ce.attrs.color
|
|
@@ -5548,29 +5548,29 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5548
5548
|
color: Oe,
|
|
5549
5549
|
"data-original-color": _e
|
|
5550
5550
|
});
|
|
5551
|
-
pe.removeMark(
|
|
5551
|
+
pe.removeMark(Ie, Ie + Fe.nodeSize, Ae), pe.addMark(Ie, Ie + Fe.nodeSize, Ce);
|
|
5552
5552
|
}
|
|
5553
5553
|
}), ge && (pe.setMeta("addToHistory", !1), ie.view.dispatch(pe));
|
|
5554
5554
|
}, 0);
|
|
5555
5555
|
return () => clearTimeout(we);
|
|
5556
5556
|
}, [ie, l, O, ce]), Xp(ie, l, !1);
|
|
5557
|
-
const
|
|
5557
|
+
const un = F(null);
|
|
5558
5558
|
return j(() => {
|
|
5559
|
-
ie &&
|
|
5559
|
+
ie && un.current !== se && (un.current = se, xu(ie));
|
|
5560
5560
|
}, [se, ie]), {
|
|
5561
5561
|
editor: ie,
|
|
5562
|
-
cachedEditorEntries:
|
|
5562
|
+
cachedEditorEntries: xn,
|
|
5563
5563
|
ref: jn,
|
|
5564
|
-
slides:
|
|
5564
|
+
slides: cn,
|
|
5565
5565
|
setSlides: ms,
|
|
5566
|
-
tocItems:
|
|
5566
|
+
tocItems: De,
|
|
5567
5567
|
setTocItems: Ee,
|
|
5568
5568
|
activeCommentId: se,
|
|
5569
5569
|
setActiveCommentId: fe,
|
|
5570
5570
|
focusCommentWithActiveId: re,
|
|
5571
5571
|
isContentLoading: O,
|
|
5572
5572
|
commentAnchorsRef: je,
|
|
5573
|
-
draftAnchorsRef:
|
|
5573
|
+
draftAnchorsRef: zt,
|
|
5574
5574
|
storeApiRef: Xe
|
|
5575
5575
|
};
|
|
5576
5576
|
}, Wp = () => {
|
|
@@ -5964,7 +5964,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5964
5964
|
}, 100);
|
|
5965
5965
|
return () => window.clearTimeout(i);
|
|
5966
5966
|
}, [e, t, n]);
|
|
5967
|
-
}, Zr = (e) =>
|
|
5967
|
+
}, Zr = (e) => kt(e).parentById.size > 0, Nr = (e) => (e == null ? void 0 : e.depth) ?? 1, ss = (e, t) => {
|
|
5968
5968
|
const n = e.findIndex((i) => i.id === t);
|
|
5969
5969
|
if (n === -1) return [];
|
|
5970
5970
|
const s = Nr(e[n]), o = [t];
|
|
@@ -5978,7 +5978,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5978
5978
|
const n = e.toArray(), s = Math.max(-1, ...t.map((o) => n.indexOf(o)));
|
|
5979
5979
|
return s === -1 ? n.length : s + 1;
|
|
5980
5980
|
}, Zp = (e, t, n) => {
|
|
5981
|
-
const s =
|
|
5981
|
+
const s = kt(e), o = s.parentById.get(t);
|
|
5982
5982
|
e.transact(() => {
|
|
5983
5983
|
if (o === void 0) {
|
|
5984
5984
|
s.order.push(n);
|
|
@@ -5988,7 +5988,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5988
5988
|
n.forEach((a) => s.parentById.set(a, o)), s.order.insert(Fo(s.order, i), n);
|
|
5989
5989
|
});
|
|
5990
5990
|
}, Jp = (e, t, n, s) => {
|
|
5991
|
-
const o =
|
|
5991
|
+
const o = kt(e), i = ds(o), a = i.find((u) => u.id === t);
|
|
5992
5992
|
if (!a || !Qp(a)) return null;
|
|
5993
5993
|
const l = ss(i, t), c = i.filter((u) => u.parentId === t).length;
|
|
5994
5994
|
return e.transact(() => {
|
|
@@ -5997,7 +5997,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
5997
5997
|
]);
|
|
5998
5998
|
}), n;
|
|
5999
5999
|
}, ef = (e, t, n) => {
|
|
6000
|
-
const s =
|
|
6000
|
+
const s = kt(e), { order: o } = s;
|
|
6001
6001
|
if (!Zr(e)) {
|
|
6002
6002
|
const h = o.toArray(), m = h.indexOf(n), p = h.indexOf(t);
|
|
6003
6003
|
return m === -1 || p === -1 ? !1 : (e.transact(() => {
|
|
@@ -6013,7 +6013,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6013
6013
|
o.insert(h, c);
|
|
6014
6014
|
}), !0;
|
|
6015
6015
|
}, tf = (e, t, n, s) => {
|
|
6016
|
-
const o =
|
|
6016
|
+
const o = kt(e), { order: i } = o, a = ns(o, t);
|
|
6017
6017
|
if (!a) return;
|
|
6018
6018
|
if (!Zr(e)) {
|
|
6019
6019
|
const m = n();
|
|
@@ -6043,7 +6043,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6043
6043
|
}), h;
|
|
6044
6044
|
}, nf = (e, t, n, s) => {
|
|
6045
6045
|
var f, x;
|
|
6046
|
-
const o =
|
|
6046
|
+
const o = kt(e), { order: i } = o;
|
|
6047
6047
|
if (!Zr(e)) {
|
|
6048
6048
|
if (i.length <= 1)
|
|
6049
6049
|
throw new Error("Cannot delete the last remaining tab");
|
|
@@ -6085,7 +6085,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6085
6085
|
}), p && s && o.tabState.set("activeTabId", p), Yl(i, u);
|
|
6086
6086
|
}), { snapshots: h, fallbackId: p };
|
|
6087
6087
|
}, sf = (e, t, n) => {
|
|
6088
|
-
const s =
|
|
6088
|
+
const s = kt(e), { order: o } = s, i = t.filter(
|
|
6089
6089
|
(l) => !s.nameById.has(l.tabId)
|
|
6090
6090
|
);
|
|
6091
6091
|
if (i.length === 0) return !1;
|
|
@@ -6103,7 +6103,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6103
6103
|
}, of = (e) => {
|
|
6104
6104
|
const t = F([]), n = F([]), s = F(!1), o = M(
|
|
6105
6105
|
(c, u) => {
|
|
6106
|
-
const d =
|
|
6106
|
+
const d = kt(e);
|
|
6107
6107
|
if (!ns(d, c.tabId))
|
|
6108
6108
|
return !1;
|
|
6109
6109
|
const m = u === "undo" ? c.previousName : c.nextName, p = u === "undo" ? c.previousEmoji : c.nextEmoji;
|
|
@@ -6128,7 +6128,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6128
6128
|
return {
|
|
6129
6129
|
applyRename: M(
|
|
6130
6130
|
({ tabId: c, newName: u, emoji: d }) => {
|
|
6131
|
-
const h =
|
|
6131
|
+
const h = kt(e), m = ns(h, c);
|
|
6132
6132
|
if (!m)
|
|
6133
6133
|
return { tabNotFound: !0 };
|
|
6134
6134
|
const p = m.name, f = m.emoji, x = u ?? p, g = d ?? f, y = u !== void 0 && x !== p, A = d !== void 0 && g !== f;
|
|
@@ -6147,7 +6147,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6147
6147
|
undo: i,
|
|
6148
6148
|
redo: a
|
|
6149
6149
|
};
|
|
6150
|
-
}, ma = 1e4, sr = () =>
|
|
6150
|
+
}, ma = 1e4, sr = () => Pt(kr(5), !0), pa = (e, t) => e && (t.length === 0 || t.some((n) => n.id === e)) ? e : void 0, rf = ({
|
|
6151
6151
|
ydoc: e,
|
|
6152
6152
|
initialContent: t,
|
|
6153
6153
|
enableCollaboration: n,
|
|
@@ -6250,7 +6250,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6250
6250
|
k(O);
|
|
6251
6251
|
return;
|
|
6252
6252
|
}
|
|
6253
|
-
const H =
|
|
6253
|
+
const H = kt(e);
|
|
6254
6254
|
e.transact(() => {
|
|
6255
6255
|
H.tabState.set("activeTabId", O);
|
|
6256
6256
|
}, "self"), k(O);
|
|
@@ -6265,40 +6265,40 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6265
6265
|
O.didWrite && x(), a && bo(O) !== w.current && e.transact(() => {
|
|
6266
6266
|
O.tabState.set("activeTabId", w.current);
|
|
6267
6267
|
}, "self");
|
|
6268
|
-
const H =
|
|
6268
|
+
const H = kt(e), U = (G = O, K = !1) => {
|
|
6269
6269
|
var ue;
|
|
6270
|
-
const V = ds(G), D = G.order.toArray(), se = new Set(V.map((
|
|
6270
|
+
const V = ds(G), D = G.order.toArray(), se = new Set(V.map((De) => De.id)), fe = b.current;
|
|
6271
6271
|
b.current = se;
|
|
6272
6272
|
const re = l ? se.has(l) : !1;
|
|
6273
6273
|
C(V);
|
|
6274
6274
|
const Se = bo(G), J = ((ue = V[0]) == null ? void 0 : ue.id) ?? (D.length > 0 ? D[0] : tt);
|
|
6275
6275
|
if (a) {
|
|
6276
|
-
const
|
|
6276
|
+
const De = Se && se.has(Se) ? Se : J;
|
|
6277
6277
|
k(
|
|
6278
|
-
(Ee) => Ee ===
|
|
6278
|
+
(Ee) => Ee === De ? Ee : De
|
|
6279
6279
|
);
|
|
6280
6280
|
} else if (l && re && A.current !== l)
|
|
6281
6281
|
A.current = l, k(
|
|
6282
|
-
(
|
|
6282
|
+
(De) => De === l ? De : l
|
|
6283
6283
|
);
|
|
6284
6284
|
else {
|
|
6285
|
-
const
|
|
6285
|
+
const De = (He) => {
|
|
6286
6286
|
if (se.has(He)) return He;
|
|
6287
6287
|
const ze = /* @__PURE__ */ new Set([He]);
|
|
6288
|
-
let
|
|
6289
|
-
for (;
|
|
6290
|
-
if (se.has(
|
|
6291
|
-
ze.add(
|
|
6288
|
+
let Ye = G.parentById.get(He);
|
|
6289
|
+
for (; Ye && !ze.has(Ye); ) {
|
|
6290
|
+
if (se.has(Ye)) return Ye;
|
|
6291
|
+
ze.add(Ye), Ye = G.parentById.get(Ye);
|
|
6292
6292
|
}
|
|
6293
6293
|
return J;
|
|
6294
6294
|
}, Ee = w.current;
|
|
6295
|
-
K && G.parentById.size > 0 && fe.has(Ee) &&
|
|
6295
|
+
K && G.parentById.size > 0 && fe.has(Ee) && De(Ee) !== Ee && xo({
|
|
6296
6296
|
title: "This tab was deleted",
|
|
6297
6297
|
description: "Someone else deleted the tab you were in."
|
|
6298
|
-
}), k(
|
|
6298
|
+
}), k(De);
|
|
6299
6299
|
}
|
|
6300
6300
|
}, ce = (G, K) => {
|
|
6301
|
-
U(
|
|
6301
|
+
U(kt(e), !K.local);
|
|
6302
6302
|
}, q = e.getMap(Vh), L = () => {
|
|
6303
6303
|
const G = Xi(
|
|
6304
6304
|
e,
|
|
@@ -6322,7 +6322,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6322
6322
|
d
|
|
6323
6323
|
]);
|
|
6324
6324
|
const $ = M(() => {
|
|
6325
|
-
const O =
|
|
6325
|
+
const O = kt(e), H = O.order, U = sr(), ce = {
|
|
6326
6326
|
name: `Tab ${H.length + 1}`,
|
|
6327
6327
|
emoji: null,
|
|
6328
6328
|
id: U
|
|
@@ -6434,7 +6434,7 @@ const _p = (e, t, n) => t ? ml(n) : Fu(e).then(
|
|
|
6434
6434
|
orderTab: oe
|
|
6435
6435
|
};
|
|
6436
6436
|
};
|
|
6437
|
-
var
|
|
6437
|
+
var Yt = /* @__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))(Yt || {}), ot = /* @__PURE__ */ ((e) => (e.CLOSED = "CLOSED", e.CONNECTED = "CONNECTED", e.CONNECTING = "CONNECTING", e.DISCONNECTING = "DISCONNECTING", e.DISCONNECTED = "DISCONNECTED", e))(ot || {});
|
|
6438
6438
|
const Xl = "#9CA3AF", or = [
|
|
6439
6439
|
"#30bced",
|
|
6440
6440
|
"#6eeb83",
|
|
@@ -6500,7 +6500,7 @@ function df(e, t) {
|
|
|
6500
6500
|
const uf = "FVXC1", Tr = "__n__", Ql = uf + Tr, hf = new TextEncoder().encode(
|
|
6501
6501
|
"FILEVERSE-COLLAB-WIRE-XCHACHA20POLY1305-FVXC1"
|
|
6502
6502
|
), fa = 24, mf = 8, ks = /* @__PURE__ */ new Map(), ga = (e) => {
|
|
6503
|
-
const t =
|
|
6503
|
+
const t = Pt(e), n = ks.get(t);
|
|
6504
6504
|
if (n) return n;
|
|
6505
6505
|
const s = rm(e, new Uint8Array(0), hf);
|
|
6506
6506
|
if (ks.size >= mf) {
|
|
@@ -6508,12 +6508,12 @@ const uf = "FVXC1", Tr = "__n__", Ql = uf + Tr, hf = new TextEncoder().encode(
|
|
|
6508
6508
|
o !== void 0 && ks.delete(o);
|
|
6509
6509
|
}
|
|
6510
6510
|
return ks.set(t, s), s;
|
|
6511
|
-
}, Er = (e) => typeof e == "string" && e.startsWith(Ql),
|
|
6511
|
+
}, Er = (e) => typeof e == "string" && e.startsWith(Ql), Lt = {
|
|
6512
6512
|
generateKeyPair: () => om(),
|
|
6513
6513
|
encryptData: (e, t, n = "ecies") => {
|
|
6514
6514
|
if (n === "xchacha") {
|
|
6515
6515
|
const o = kr(fa), i = Qi(ga(e), o).encrypt(t);
|
|
6516
|
-
return Ql +
|
|
6516
|
+
return Ql + Pt(o) + Tr + Pt(i);
|
|
6517
6517
|
}
|
|
6518
6518
|
const s = im.getPublicKey(e);
|
|
6519
6519
|
return sm(s, t, "base64");
|
|
@@ -6523,11 +6523,11 @@ const uf = "FVXC1", Tr = "__n__", Ql = uf + Tr, hf = new TextEncoder().encode(
|
|
|
6523
6523
|
const n = t.split(Tr);
|
|
6524
6524
|
if (n.length !== 3 || !n[1] || !n[2])
|
|
6525
6525
|
throw new Error("Invalid FVXC1 wire format");
|
|
6526
|
-
const s =
|
|
6526
|
+
const s = at(n[1]);
|
|
6527
6527
|
if (s.length !== fa)
|
|
6528
6528
|
throw new Error("Invalid FVXC1 nonce length");
|
|
6529
6529
|
return Qi(ga(e), s).decrypt(
|
|
6530
|
-
|
|
6530
|
+
at(n[2])
|
|
6531
6531
|
);
|
|
6532
6532
|
}
|
|
6533
6533
|
return nm(e, t);
|
|
@@ -6665,9 +6665,9 @@ class Jr {
|
|
|
6665
6665
|
"SocketClient: Server did not response with the server DID"
|
|
6666
6666
|
);
|
|
6667
6667
|
if (this.collaborationUcan && this.serverClock.isUsable(this.collaborationUcan))
|
|
6668
|
-
return this._lastSessionToken =
|
|
6668
|
+
return this._lastSessionToken = rn.encode(this.collaborationUcan), this._lastSessionToken;
|
|
6669
6669
|
const t = this.getCollaborationKeyPair();
|
|
6670
|
-
return this.collaborationUcan = await
|
|
6670
|
+
return this.collaborationUcan = await rn.build({
|
|
6671
6671
|
audience: this._websocketServiceDid,
|
|
6672
6672
|
issuer: t,
|
|
6673
6673
|
...this.serverClock.ucanWindow(),
|
|
@@ -6680,7 +6680,7 @@ class Jr {
|
|
|
6680
6680
|
can: { namespace: "collaboration", segments: ["COLLABORATE"] }
|
|
6681
6681
|
}
|
|
6682
6682
|
]
|
|
6683
|
-
}), this._lastSessionToken =
|
|
6683
|
+
}), this._lastSessionToken = rn.encode(this.collaborationUcan), this._lastSessionToken;
|
|
6684
6684
|
});
|
|
6685
6685
|
// Builds the /auth args and emits, shared by the initial handshake and rekey's in-place
|
|
6686
6686
|
// re-auth (rotationCutover: true) on an already-connected socket.
|
|
@@ -6692,8 +6692,8 @@ class Jr {
|
|
|
6692
6692
|
documentId: this.roomId,
|
|
6693
6693
|
wireFormats: ["ecies", "xchacha"]
|
|
6694
6694
|
};
|
|
6695
|
-
this.roomInfo && (s.roomInfo =
|
|
6696
|
-
|
|
6695
|
+
this.roomInfo && (s.roomInfo = Lt.encryptData(
|
|
6696
|
+
at(this.roomKey),
|
|
6697
6697
|
new TextEncoder().encode(JSON.stringify(this.roomInfo)),
|
|
6698
6698
|
this.wireFormat
|
|
6699
6699
|
)), 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);
|
|
@@ -6733,8 +6733,8 @@ class Jr {
|
|
|
6733
6733
|
const n = this.roomKey, s = t.data.position;
|
|
6734
6734
|
if (n)
|
|
6735
6735
|
try {
|
|
6736
|
-
const o =
|
|
6737
|
-
|
|
6736
|
+
const o = Lt.decryptData(
|
|
6737
|
+
at(n),
|
|
6738
6738
|
s
|
|
6739
6739
|
);
|
|
6740
6740
|
Zh(
|
|
@@ -6757,11 +6757,11 @@ class Jr {
|
|
|
6757
6757
|
});
|
|
6758
6758
|
this._socketUrl = t.wsUrl || "ws://localhost:5000", this._restBase = (t.wsUrl || "http://localhost:5000").replace(/^ws(s?):\/\//, "http$1://").replace(/\/+$/, "");
|
|
6759
6759
|
const { secretKey: n } = er(
|
|
6760
|
-
|
|
6760
|
+
at(t.roomKey)
|
|
6761
6761
|
);
|
|
6762
|
-
this.roomKey = t.roomKey, this.roomId = t.roomId, this.collaborationKeyPair =
|
|
6763
|
-
|
|
6764
|
-
), t.ownerEdSecret && (this.ownerKeyPair =
|
|
6762
|
+
this.roomKey = t.roomKey, this.roomId = t.roomId, this.collaborationKeyPair = rn.EdKeypair.fromSecretKey(
|
|
6763
|
+
Pt(n)
|
|
6764
|
+
), t.ownerEdSecret && (this.ownerKeyPair = rn.EdKeypair.fromSecretKey(t.ownerEdSecret)), t.contractAddress && (this.contractAddress = t.contractAddress), t.ownerAddress && (this.ownerAddress = t.ownerAddress), t.ddocId && (this.ddocId = t.ddocId), t.editLock && (this.editLock = t.editLock), t.identityToken && (this.identityToken = t.identityToken), t.editUcan && (this.editUcan = t.editUcan), this.lastGoodEditUcan = t.editUcan, t.refreshEditClaim && (this.refreshEditClaim = t.refreshEditClaim), t.actorHandle && (this.actorHandle = t.actorHandle), t.joinOnly && (this.joinOnly = t.joinOnly), t.encryptedTitle && (this.encryptedTitle = t.encryptedTitle), t.onHandshakeData && (this._onHandshakeData = t.onHandshakeData), t.onEpochAvailable && (this._onEpochAvailable = t.onEpochAvailable), t.onCutover && (this._onCutover = t.onCutover), t.roomInfo && (this.roomInfo = t.roomInfo);
|
|
6765
6765
|
}
|
|
6766
6766
|
get isConnected() {
|
|
6767
6767
|
return this._webSocketStatus === ot.CONNECTED;
|
|
@@ -6909,9 +6909,9 @@ class Jr {
|
|
|
6909
6909
|
const o = this.roomKey, i = this.editLock;
|
|
6910
6910
|
try {
|
|
6911
6911
|
s && (this.lastGoodEditUcan = s), this.roomKey = t;
|
|
6912
|
-
const { secretKey: a } = er(
|
|
6913
|
-
this.collaborationKeyPair =
|
|
6914
|
-
|
|
6912
|
+
const { secretKey: a } = er(at(t));
|
|
6913
|
+
this.collaborationKeyPair = rn.EdKeypair.fromSecretKey(
|
|
6914
|
+
Pt(a)
|
|
6915
6915
|
), this.collaborationUcan = void 0, n !== void 0 && (this.editLock = n);
|
|
6916
6916
|
const l = await this._authenticate({ rotationCutover: !0 });
|
|
6917
6917
|
if (l.statusCode !== 200)
|
|
@@ -6921,9 +6921,9 @@ class Jr {
|
|
|
6921
6921
|
this._webSocketStatus = ot.CONNECTED;
|
|
6922
6922
|
} catch (a) {
|
|
6923
6923
|
this.roomKey = o;
|
|
6924
|
-
const { secretKey: l } = er(
|
|
6925
|
-
throw this.collaborationKeyPair =
|
|
6926
|
-
|
|
6924
|
+
const { secretKey: l } = er(at(o));
|
|
6925
|
+
throw this.collaborationKeyPair = rn.EdKeypair.fromSecretKey(
|
|
6926
|
+
Pt(l)
|
|
6927
6927
|
), this.collaborationUcan = void 0, this.editLock = i, a;
|
|
6928
6928
|
} finally {
|
|
6929
6929
|
this._rotating = !1;
|
|
@@ -6962,7 +6962,7 @@ class Jr {
|
|
|
6962
6962
|
async getOwnerToken() {
|
|
6963
6963
|
if (!this.ownerKeyPair || !this.contractAddress)
|
|
6964
6964
|
throw new Error("SocketClient: No owner key pair or contract address");
|
|
6965
|
-
return this.ownerUcan && this.serverClock.isUsable(this.ownerUcan) ?
|
|
6965
|
+
return this.ownerUcan && this.serverClock.isUsable(this.ownerUcan) ? rn.encode(this.ownerUcan) : (this.ownerUcan = await rn.build({
|
|
6966
6966
|
audience: this._websocketServiceDid,
|
|
6967
6967
|
issuer: this.ownerKeyPair,
|
|
6968
6968
|
...this.serverClock.ucanWindow(),
|
|
@@ -6975,7 +6975,7 @@ class Jr {
|
|
|
6975
6975
|
can: { namespace: "collaboration", segments: ["CREATE"] }
|
|
6976
6976
|
}
|
|
6977
6977
|
]
|
|
6978
|
-
}),
|
|
6978
|
+
}), rn.encode(this.ownerUcan));
|
|
6979
6979
|
}
|
|
6980
6980
|
connectSocket(t) {
|
|
6981
6981
|
return this._webSocketStatus === ot.CONNECTED || this._webSocketStatus === ot.CONNECTING ? Promise.resolve() : (this._webSocketStatus = ot.CONNECTING, new Promise((n, s) => {
|
|
@@ -7077,8 +7077,8 @@ class Jr {
|
|
|
7077
7077
|
this.awareness.clientID
|
|
7078
7078
|
]), u = this.roomKey;
|
|
7079
7079
|
if (u) {
|
|
7080
|
-
const d =
|
|
7081
|
-
|
|
7080
|
+
const d = Lt.encryptData(
|
|
7081
|
+
at(u),
|
|
7082
7082
|
c,
|
|
7083
7083
|
this.wireFormat
|
|
7084
7084
|
);
|
|
@@ -7097,8 +7097,8 @@ const wa = (e, t, n, s) => {
|
|
|
7097
7097
|
o = [];
|
|
7098
7098
|
const u = am(e, c);
|
|
7099
7099
|
if (t.isConnected) {
|
|
7100
|
-
const d =
|
|
7101
|
-
|
|
7100
|
+
const d = Lt.encryptData(
|
|
7101
|
+
at(n),
|
|
7102
7102
|
u,
|
|
7103
7103
|
s()
|
|
7104
7104
|
);
|
|
@@ -7140,7 +7140,7 @@ function Nf(e, t) {
|
|
|
7140
7140
|
o.decrypted || (s = !0), !s && o.isTail && typeof o.seq == "number" && n.push(o.seq);
|
|
7141
7141
|
return { seqs: n, incomplete: s };
|
|
7142
7142
|
}
|
|
7143
|
-
const
|
|
7143
|
+
const kn = {
|
|
7144
7144
|
hasUnmergedPeerUpdates: !1,
|
|
7145
7145
|
reconnectAttempt: 0,
|
|
7146
7146
|
maxReconnectAttempts: 3,
|
|
@@ -7162,7 +7162,7 @@ function Tf(e, t, n) {
|
|
|
7162
7162
|
} : s === "SESSION_TERMINATED" ? {
|
|
7163
7163
|
status: "terminated",
|
|
7164
7164
|
context: { terminationReason: t.reason }
|
|
7165
|
-
} : s === "RESET" ? { status: "idle", context: { ...
|
|
7165
|
+
} : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
|
|
7166
7166
|
case "syncing":
|
|
7167
7167
|
return s === "SYNC_COMPLETE" ? { status: "ready", context: { hasUnmergedPeerUpdates: !1 } } : s === "SOCKET_DROPPED" ? {
|
|
7168
7168
|
status: "reconnecting",
|
|
@@ -7179,7 +7179,7 @@ function Tf(e, t, n) {
|
|
|
7179
7179
|
} : s === "SESSION_TERMINATED" ? {
|
|
7180
7180
|
status: "terminated",
|
|
7181
7181
|
context: { terminationReason: t.reason }
|
|
7182
|
-
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...
|
|
7182
|
+
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
|
|
7183
7183
|
case "ready":
|
|
7184
7184
|
return s === "SOCKET_DROPPED" ? {
|
|
7185
7185
|
status: "reconnecting",
|
|
@@ -7190,7 +7190,7 @@ function Tf(e, t, n) {
|
|
|
7190
7190
|
} : s === "ERROR" ? {
|
|
7191
7191
|
status: "error",
|
|
7192
7192
|
context: { error: t.error }
|
|
7193
|
-
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...
|
|
7193
|
+
} : s === "CUTOVER" ? { status: e, context: {} } : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
|
|
7194
7194
|
case "reconnecting":
|
|
7195
7195
|
return s === "RECONNECTED" ? {
|
|
7196
7196
|
status: "syncing",
|
|
@@ -7215,11 +7215,11 @@ function Tf(e, t, n) {
|
|
|
7215
7215
|
} : s === "SESSION_TERMINATED" ? {
|
|
7216
7216
|
status: "terminated",
|
|
7217
7217
|
context: { terminationReason: t.reason }
|
|
7218
|
-
} : s === "RESET" ? { status: "idle", context: { ...
|
|
7218
|
+
} : s === "RESET" ? { status: "idle", context: { ...kn } } : null;
|
|
7219
7219
|
case "error":
|
|
7220
|
-
return s === "RESET" ? { status: "idle", context: { ...
|
|
7220
|
+
return s === "RESET" ? { status: "idle", context: { ...kn } } : null;
|
|
7221
7221
|
case "terminated":
|
|
7222
|
-
return s === "RESET" ? { status: "idle", context: { ...
|
|
7222
|
+
return s === "RESET" ? { status: "idle", context: { ...kn } } : null;
|
|
7223
7223
|
default:
|
|
7224
7224
|
return null;
|
|
7225
7225
|
}
|
|
@@ -7274,7 +7274,7 @@ class Mf {
|
|
|
7274
7274
|
constructor(t, n) {
|
|
7275
7275
|
// --- State machine ---
|
|
7276
7276
|
ne(this, "_status", "idle");
|
|
7277
|
-
ne(this, "_context", { ...
|
|
7277
|
+
ne(this, "_context", { ...kn });
|
|
7278
7278
|
ne(this, "_awareness", null);
|
|
7279
7279
|
// --- Internal state ---
|
|
7280
7280
|
ne(this, "socketClient", null);
|
|
@@ -7361,7 +7361,7 @@ class Mf {
|
|
|
7361
7361
|
return this.wireFormat;
|
|
7362
7362
|
}
|
|
7363
7363
|
encryptForWire(t) {
|
|
7364
|
-
const n =
|
|
7364
|
+
const n = Lt.encryptData(
|
|
7365
7365
|
this.roomKeyBytes,
|
|
7366
7366
|
t,
|
|
7367
7367
|
this.wireFormat
|
|
@@ -7455,7 +7455,7 @@ class Mf {
|
|
|
7455
7455
|
var o, i;
|
|
7456
7456
|
if (this._status !== "idle") return;
|
|
7457
7457
|
const n = ++this.sessionGen;
|
|
7458
|
-
this.resuming || (this.updateQueue = []), this.resumable = !1, this.lastConnectConfig = t, this.roomKey = t.roomKey, this.roomKeyBytes =
|
|
7458
|
+
this.resuming || (this.updateQueue = []), this.resumable = !1, this.lastConnectConfig = t, this.roomKey = t.roomKey, this.roomKeyBytes = at(t.roomKey), this.isOwner = t.isOwner, this.joinOnly = t.joinOnly ?? !1, this.encryptMirror = t.encryptMirror ?? null, this.fileKeyEpoch = t.fileKeyEpoch ?? 0, this.socketClient = new Jr({
|
|
7459
7459
|
wsUrl: t.wsUrl,
|
|
7460
7460
|
roomKey: t.roomKey,
|
|
7461
7461
|
roomId: t.roomId,
|
|
@@ -7484,7 +7484,7 @@ class Mf {
|
|
|
7484
7484
|
try {
|
|
7485
7485
|
const c = JSON.parse(
|
|
7486
7486
|
new TextDecoder().decode(
|
|
7487
|
-
|
|
7487
|
+
Lt.decryptData(this.roomKeyBytes, a.payload)
|
|
7488
7488
|
)
|
|
7489
7489
|
), u = t.onRotationPrepare ? await t.onRotationPrepare(c) : null, d = typeof u == "string" ? u : u == null ? void 0 : u.roomKey;
|
|
7490
7490
|
d || console.warn(
|
|
@@ -7603,7 +7603,7 @@ class Mf {
|
|
|
7603
7603
|
return;
|
|
7604
7604
|
this.rotating = !0;
|
|
7605
7605
|
const o = this.sessionGen, i = this.roomKey;
|
|
7606
|
-
this.roomKeyBytesPrev = this.roomKeyBytes, this.roomKey = t, this.roomKeyBytes =
|
|
7606
|
+
this.roomKeyBytesPrev = this.roomKeyBytes, this.roomKey = t, this.roomKeyBytes = at(t);
|
|
7607
7607
|
try {
|
|
7608
7608
|
if (await ((a = this.socketClient) == null ? void 0 : a.rekey(t, n, s)), o === this.sessionGen && this.lastConnectConfig && (this.lastConnectConfig = {
|
|
7609
7609
|
...this.lastConnectConfig,
|
|
@@ -7644,7 +7644,7 @@ class Mf {
|
|
|
7644
7644
|
return this.rotating || !t ? Promise.resolve("failed") : (this.healingPromise = (async () => {
|
|
7645
7645
|
try {
|
|
7646
7646
|
const s = await t();
|
|
7647
|
-
return s ? this.roomKeyBytes && Df(
|
|
7647
|
+
return s ? this.roomKeyBytes && Df(at(s), this.roomKeyBytes) ? "current-key-ok" : (await this.rekey(s), this.healBackoffUntil = 0, "rekeyed") : (console.warn(
|
|
7648
7648
|
"SyncManager: rotation self-heal yielded no key (post-rotation blob may not be anchored yet)"
|
|
7649
7649
|
), this.healBackoffUntil = Date.now() + lo, "failed");
|
|
7650
7650
|
} catch (s) {
|
|
@@ -7822,13 +7822,13 @@ class Mf {
|
|
|
7822
7822
|
}
|
|
7823
7823
|
}
|
|
7824
7824
|
isRevocationResponse(t) {
|
|
7825
|
-
return (t == null ? void 0 : t.statusCode) === 403 && (t.errorCode ===
|
|
7825
|
+
return (t == null ? void 0 : t.statusCode) === 403 && (t.errorCode === Yt.JOIN_DISABLED || t.errorCode === Yt.EDIT_REVOKED);
|
|
7826
7826
|
}
|
|
7827
7827
|
// A write ack'd 409/SESSION_TERMINATED means this session's old sessionDid was cut over
|
|
7828
7828
|
// out from under an in-flight write — distinct from isRevocationResponse's 403s, and the
|
|
7829
7829
|
// fix is a decrypt-miss self-heal, not a reconnect.
|
|
7830
7830
|
isSessionTerminatedResponse(t) {
|
|
7831
|
-
return (t == null ? void 0 : t.statusCode) === 409 && t.errorCode ===
|
|
7831
|
+
return (t == null ? void 0 : t.statusCode) === 409 && t.errorCode === Yt.SESSION_TERMINATED;
|
|
7832
7832
|
}
|
|
7833
7833
|
// A write ack'd 404/SESSION_NOT_FOUND means the server has no runtime session for this
|
|
7834
7834
|
// sessionDid: a live editor whose OLD session was terminated by a rotation drain it never
|
|
@@ -7836,7 +7836,7 @@ class Mf {
|
|
|
7836
7836
|
// resolve the current-epoch roomKey and rekey — NOT a plain reconnect, which would just
|
|
7837
7837
|
// re-auth back into the same dead sessionDid.
|
|
7838
7838
|
isSessionNotFoundResponse(t) {
|
|
7839
|
-
return (t == null ? void 0 : t.statusCode) === 404 && t.errorCode ===
|
|
7839
|
+
return (t == null ? void 0 : t.statusCode) === 404 && t.errorCode === Yt.SESSION_NOT_FOUND;
|
|
7840
7840
|
}
|
|
7841
7841
|
classifyRevocation() {
|
|
7842
7842
|
return "soft";
|
|
@@ -7903,7 +7903,7 @@ class Mf {
|
|
|
7903
7903
|
}
|
|
7904
7904
|
forceCleanup() {
|
|
7905
7905
|
var n;
|
|
7906
|
-
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 && On(this._awareness, [this.ydoc.clientID], "cleanup"), this.cleanupAwareness(), (n = this.socketClient) == null || n.disconnect(), this.resetInternalState(), this._status = "idle", this._context = { ...
|
|
7906
|
+
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 && On(this._awareness, [this.ydoc.clientID], "cleanup"), this.cleanupAwareness(), (n = this.socketClient) == null || n.disconnect(), this.resetInternalState(), this._status = "idle", this._context = { ...kn };
|
|
7907
7907
|
const t = rr(this._status, this._context);
|
|
7908
7908
|
this.onCollabStateChange(t);
|
|
7909
7909
|
}
|
|
@@ -7963,7 +7963,7 @@ class Mf {
|
|
|
7963
7963
|
onHandShakeError: (c, u, d) => {
|
|
7964
7964
|
var h, m, p, f, x;
|
|
7965
7965
|
if (!a() && !(u === void 0 && !((h = this.socketClient) != null && h.isSocketOpen))) {
|
|
7966
|
-
if (d ===
|
|
7966
|
+
if (d === Yt.WIRE_FORMAT_UNSUPPORTED) {
|
|
7967
7967
|
s || (s = !0, t()), this.emitWireTelemetry({ type: "refused" }), (m = this.socketClient) == null || m.disconnect(), this.resetInternalState(), this.send({
|
|
7968
7968
|
type: "SESSION_TERMINATED",
|
|
7969
7969
|
reason: "WIRE_FORMAT_UNSUPPORTED"
|
|
@@ -7973,7 +7973,7 @@ class Mf {
|
|
|
7973
7973
|
if (this.joinOnly) {
|
|
7974
7974
|
(p = this.socketClient) == null || p.disconnect(), this.resetInternalState(), this.send({
|
|
7975
7975
|
type: "SESSION_TERMINATED",
|
|
7976
|
-
reason: d ===
|
|
7976
|
+
reason: d === Yt.ROOM_NOT_ESTABLISHED ? "ROOM_NOT_ESTABLISHED" : u === 403 && (d === Yt.JOIN_DISABLED || d === Yt.EDIT_REVOKED) ? "WORKSPACE_EDIT_DISABLED" : "JOIN_REJECTED"
|
|
7977
7977
|
}), s || (s = !0, t());
|
|
7978
7978
|
return;
|
|
7979
7979
|
}
|
|
@@ -8005,7 +8005,7 @@ class Mf {
|
|
|
8005
8005
|
g();
|
|
8006
8006
|
return;
|
|
8007
8007
|
}
|
|
8008
|
-
if (u === 403 && (d ===
|
|
8008
|
+
if (u === 403 && (d === Yt.JOIN_DISABLED || d === Yt.EDIT_REVOKED)) {
|
|
8009
8009
|
(x = this.socketClient) == null || x.disconnect(), this.resetInternalState(), this.send({ type: "SESSION_TERMINATED", reason: "EDIT_REVOKED" }), s || (s = !0, t());
|
|
8010
8010
|
return;
|
|
8011
8011
|
}
|
|
@@ -8076,11 +8076,11 @@ class Mf {
|
|
|
8076
8076
|
// next inbound row — try the current key, then the pre-rotation key, before giving up.
|
|
8077
8077
|
tryDecrypt(t) {
|
|
8078
8078
|
try {
|
|
8079
|
-
return
|
|
8079
|
+
return Lt.decryptData(this.roomKeyBytes, t);
|
|
8080
8080
|
} catch {
|
|
8081
8081
|
if (this.roomKeyBytesPrev)
|
|
8082
8082
|
try {
|
|
8083
|
-
return
|
|
8083
|
+
return Lt.decryptData(this.roomKeyBytesPrev, t);
|
|
8084
8084
|
} catch {
|
|
8085
8085
|
}
|
|
8086
8086
|
return null;
|
|
@@ -8175,7 +8175,7 @@ class Mf {
|
|
|
8175
8175
|
const l = await this.catchUpFloor(t, i);
|
|
8176
8176
|
if (!n() || (l && this.isOwner && this.send({ type: "SET_UNMERGED_UPDATES", hasUpdates: !0 }), !s || !o) || i.pages === 0 || i.incomplete && i.merged === null) return;
|
|
8177
8177
|
const c = Sf(this.ydoc, i.merged);
|
|
8178
|
-
c && n() && await this.broadcastLocalContents(
|
|
8178
|
+
c && n() && await this.broadcastLocalContents(Pt(c), t);
|
|
8179
8179
|
}, "hydrate"), s && i.pages > 0 && n() && this.emitWireTelemetry({
|
|
8180
8180
|
type: "hydrate",
|
|
8181
8181
|
eciesRows: i.eciesRows,
|
|
@@ -8227,7 +8227,7 @@ class Mf {
|
|
|
8227
8227
|
var a;
|
|
8228
8228
|
const s = () => this.isCurrentSyncAttempt(n);
|
|
8229
8229
|
if (!t) return;
|
|
8230
|
-
const o = this.encryptForWire(
|
|
8230
|
+
const o = this.encryptForWire(at(t));
|
|
8231
8231
|
if (!s()) return;
|
|
8232
8232
|
const i = await ((a = this.socketClient) == null ? void 0 : a.sendUpdate({
|
|
8233
8233
|
update: o
|
|
@@ -8377,8 +8377,8 @@ class Mf {
|
|
|
8377
8377
|
var n;
|
|
8378
8378
|
try {
|
|
8379
8379
|
this.onLocalUpdate && typeof this.onLocalUpdate == "function" && this.onLocalUpdate(
|
|
8380
|
-
|
|
8381
|
-
|
|
8380
|
+
Pt(qe.encodeStateAsUpdate(this.ydoc)),
|
|
8381
|
+
Pt(t)
|
|
8382
8382
|
);
|
|
8383
8383
|
} catch (s) {
|
|
8384
8384
|
console.error("SyncManager: onLocalUpdate callback threw", s);
|
|
@@ -8776,7 +8776,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
8776
8776
|
const X = M(
|
|
8777
8777
|
(te) => {
|
|
8778
8778
|
var P;
|
|
8779
|
-
B.current && B.current(
|
|
8779
|
+
B.current && B.current(Pt(qe.encodeStateAsUpdate(c)), te), (P = _.current) == null || P.call(_);
|
|
8780
8780
|
},
|
|
8781
8781
|
[c]
|
|
8782
8782
|
), $ = M(() => {
|
|
@@ -8786,7 +8786,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
8786
8786
|
const te = (P, Q) => {
|
|
8787
8787
|
if (Q === "self" || Q === f.current)
|
|
8788
8788
|
return;
|
|
8789
|
-
const ee = B.current ?
|
|
8789
|
+
const ee = B.current ? Pt(P) : "";
|
|
8790
8790
|
I.current && clearTimeout(I.current), I.current = setTimeout(() => {
|
|
8791
8791
|
I.current = null, X(ee);
|
|
8792
8792
|
}, 300);
|
|
@@ -8855,7 +8855,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
8855
8855
|
onSchemaStampGuard: O,
|
|
8856
8856
|
...H
|
|
8857
8857
|
}) => {
|
|
8858
|
-
var
|
|
8858
|
+
var Kt;
|
|
8859
8859
|
j(() => {
|
|
8860
8860
|
Bu(W ?? []);
|
|
8861
8861
|
}, [W]);
|
|
@@ -8886,54 +8886,54 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
8886
8886
|
collaboration: o,
|
|
8887
8887
|
onCollaboratorChange: c,
|
|
8888
8888
|
onIndexedDbError: P
|
|
8889
|
-
}), { initialiseYjsIndexedDbProvider: J } = Se, ue = !!(A && y && !D && !K && V !== null && !V && !Se.isIndexeddbSynced),
|
|
8889
|
+
}), { initialiseYjsIndexedDbProvider: J } = Se, ue = !!(A && y && !D && !K && V !== null && !V && !Se.isIndexeddbSynced), De = K ? !V : V === null, Ee = F(!1);
|
|
8890
8890
|
j(() => {
|
|
8891
|
-
!ue ||
|
|
8891
|
+
!ue || Ee.current || (Ee.current = !0, J());
|
|
8892
8892
|
}, [ue, J]);
|
|
8893
|
-
const
|
|
8894
|
-
() =>
|
|
8893
|
+
const He = M(
|
|
8894
|
+
() => Ee.current ? Promise.resolve() : J(),
|
|
8895
8895
|
[J]
|
|
8896
|
-
),
|
|
8896
|
+
), ze = !!(A && !D && H.isDDocOwner && !K && !e && !V), Ye = !!(!K && !e && !D && H.isDDocOwner), xt = l === !0, ht = !!(H.isDDocOwner && !D && !V), Ke = rf({
|
|
8897
8897
|
ydoc: Se.ydoc,
|
|
8898
8898
|
initialContent: V,
|
|
8899
|
-
isNewDocument:
|
|
8899
|
+
isNewDocument: xt,
|
|
8900
8900
|
enableCollaboration: D,
|
|
8901
8901
|
isDDocOwner: H.isDDocOwner || !1,
|
|
8902
8902
|
createDefaultTabIfMissing: !!(!K && !e && H.isDDocOwner && !D && // Wait for y-indexedDB sync before deciding whether an unsaved local doc
|
|
8903
8903
|
// still needs a default tab, otherwise refresh keeps bootstrapping one.
|
|
8904
|
-
(!
|
|
8905
|
-
defaultTabId: (
|
|
8906
|
-
shouldSyncActiveTab:
|
|
8904
|
+
(!ze || Se.isIndexeddbSynced)),
|
|
8905
|
+
defaultTabId: (Kt = H.tabConfig) == null ? void 0 : Kt.defaultTabId,
|
|
8906
|
+
shouldSyncActiveTab: Ye,
|
|
8907
8907
|
// Viewers (non-owners) should land on the first tab, not whatever the
|
|
8908
8908
|
// owner last selected, since active-tab is persisted in the shared Yjs doc.
|
|
8909
8909
|
preferFirstTabOnInit: !H.isDDocOwner,
|
|
8910
8910
|
onVersionHistoryActiveTabChange: s == null ? void 0 : s.onActiveTabChange,
|
|
8911
8911
|
getEditor: () => G.current,
|
|
8912
8912
|
flushPendingUpdate: Se.flushPendingUpdate
|
|
8913
|
-
}),
|
|
8914
|
-
() => Ke.tabs.map((
|
|
8913
|
+
}), lt = ve(
|
|
8914
|
+
() => Ke.tabs.map((cn) => cn.id),
|
|
8915
8915
|
[Ke.tabs]
|
|
8916
|
-
),
|
|
8916
|
+
), je = F(!1);
|
|
8917
8917
|
j(() => {
|
|
8918
|
-
|
|
8918
|
+
xt || !ht || je.current || K || e || (je.current = !0, O == null || O({
|
|
8919
8919
|
kind: "unasserted-new",
|
|
8920
8920
|
preferredSchemaVersion: oe ?? 1
|
|
8921
8921
|
}));
|
|
8922
8922
|
}, [
|
|
8923
|
-
|
|
8924
|
-
|
|
8923
|
+
xt,
|
|
8924
|
+
ht,
|
|
8925
8925
|
K,
|
|
8926
8926
|
e,
|
|
8927
8927
|
O,
|
|
8928
8928
|
oe
|
|
8929
8929
|
]);
|
|
8930
|
-
const { docSchemaVersion:
|
|
8930
|
+
const { docSchemaVersion: zt, isSchemaUnsupported: Xe } = dp({
|
|
8931
8931
|
ydoc: Se.ydoc,
|
|
8932
|
-
isNewDdoc:
|
|
8933
|
-
isContentResolved: !
|
|
8932
|
+
isNewDdoc: xt,
|
|
8933
|
+
isContentResolved: !ze || Se.isIndexeddbSynced,
|
|
8934
8934
|
preferredSchemaVersion: oe,
|
|
8935
8935
|
onSchemaStampGuard: O
|
|
8936
|
-
}),
|
|
8936
|
+
}), Qe = Vp({
|
|
8937
8937
|
ydoc: Se.ydoc,
|
|
8938
8938
|
editorWidthStore: le,
|
|
8939
8939
|
isPreviewMode: e,
|
|
@@ -8972,32 +8972,33 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
8972
8972
|
onDisconnect: Se.onDisconnect,
|
|
8973
8973
|
isIndexeddbSynced: Se.isIndexeddbSynced,
|
|
8974
8974
|
hasCollabContentInitialised: Se.hasCollabContentInitialised,
|
|
8975
|
-
initialiseYjsIndexedDbProvider:
|
|
8975
|
+
initialiseYjsIndexedDbProvider: He,
|
|
8976
8976
|
externalExtensions: b,
|
|
8977
8977
|
// An empty activeTabId makes useTabEditorCache destroy every editor and
|
|
8978
8978
|
// create none, so this build never binds y-sync to a newer-schema doc,
|
|
8979
8979
|
// nor to a doc whose store has not loaded yet (isAwaitingStore, which
|
|
8980
|
-
// starts the store load itself so holding the editor cannot deadlock)
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8980
|
+
// starts the store load itself so holding the editor cannot deadlock),
|
|
8981
|
+
// nor before a body the host has promised (isAwaitingBody).
|
|
8982
|
+
activeTabId: Xe || ue || De ? "" : Ke.activeTabId,
|
|
8983
|
+
tabIds: lt,
|
|
8984
|
+
docSchemaVersion: zt,
|
|
8984
8985
|
hasTabState: Ke.hasTabState,
|
|
8985
8986
|
isVersionMode: K,
|
|
8986
8987
|
theme: R,
|
|
8987
8988
|
editorRef: G,
|
|
8988
8989
|
initialCommentAnchors: ee,
|
|
8989
8990
|
dBlockRuntimeStateRef: re
|
|
8990
|
-
}),
|
|
8991
|
+
}), St = !!(A && !Se.isIndexeddbSynced && Ye && Ke.tabs.length > 1), an = D ? o.connection.isOwner : !0, ln = (D && !an ? Qe.isContentLoading || q : Qe.isContentLoading) || St;
|
|
8991
8992
|
return {
|
|
8992
|
-
...
|
|
8993
|
+
...Qe,
|
|
8993
8994
|
...Se,
|
|
8994
8995
|
ydoc: Se.ydoc,
|
|
8995
8996
|
awareness: Se.awareness,
|
|
8996
8997
|
refreshYjsIndexedDbProvider: Se.refreshYjsIndexedDbProvider,
|
|
8997
8998
|
terminateSession: Se.terminateSession,
|
|
8998
8999
|
isContentLoading: !!ln,
|
|
8999
|
-
isSchemaUnsupported:
|
|
9000
|
-
docSchemaVersion:
|
|
9000
|
+
isSchemaUnsupported: Xe,
|
|
9001
|
+
docSchemaVersion: zt,
|
|
9001
9002
|
tabs: Ke.tabs,
|
|
9002
9003
|
hasTabState: Ke.hasTabState,
|
|
9003
9004
|
dBlockRuntimeState: fe,
|
|
@@ -9161,7 +9162,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
9161
9162
|
title: "Link",
|
|
9162
9163
|
content: /* @__PURE__ */ v("div", { className: "flex flex-col gap-4 w-full h-full text-base", children: [
|
|
9163
9164
|
/* @__PURE__ */ r(
|
|
9164
|
-
|
|
9165
|
+
Qt,
|
|
9165
9166
|
{
|
|
9166
9167
|
label: "Text",
|
|
9167
9168
|
placeholder: "Link text",
|
|
@@ -9175,7 +9176,7 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
9175
9176
|
}
|
|
9176
9177
|
),
|
|
9177
9178
|
/* @__PURE__ */ r(
|
|
9178
|
-
|
|
9179
|
+
Qt,
|
|
9179
9180
|
{
|
|
9180
9181
|
label: "Link",
|
|
9181
9182
|
placeholder: "Paste URL",
|
|
@@ -9208,14 +9209,14 @@ const Ff = { status: "idle" }, Bf = (e) => {
|
|
|
9208
9209
|
}
|
|
9209
9210
|
)
|
|
9210
9211
|
] });
|
|
9211
|
-
}, tc =
|
|
9212
|
+
}, tc = Ze.memo(Wf);
|
|
9212
9213
|
tc.displayName = "MobileToolbar";
|
|
9213
9214
|
new qr({
|
|
9214
9215
|
html: !0,
|
|
9215
9216
|
linkify: !0,
|
|
9216
9217
|
typographer: !0
|
|
9217
9218
|
}).enable("table");
|
|
9218
|
-
|
|
9219
|
+
fn.addRule("pageBreak", {
|
|
9219
9220
|
filter: function(e) {
|
|
9220
9221
|
return e.nodeName === "BR" && e.getAttribute("data-page-break") === "true";
|
|
9221
9222
|
},
|
|
@@ -9240,29 +9241,29 @@ const $f = (e) => {
|
|
|
9240
9241
|
return "";
|
|
9241
9242
|
}
|
|
9242
9243
|
};
|
|
9243
|
-
|
|
9244
|
+
fn.addRule("heading", {
|
|
9244
9245
|
filter: ["h1", "h2", "h3"],
|
|
9245
9246
|
replacement: function(e, t) {
|
|
9246
9247
|
const n = $f(t), s = e.replace(/\n\n===\n\n/g, "<br>");
|
|
9247
9248
|
return `${n} ${s}`;
|
|
9248
9249
|
}
|
|
9249
9250
|
});
|
|
9250
|
-
|
|
9251
|
+
fn.addRule("superscript", {
|
|
9251
9252
|
filter: "sup",
|
|
9252
9253
|
replacement: function(e) {
|
|
9253
9254
|
return `<sup>${e}</sup>`;
|
|
9254
9255
|
}
|
|
9255
9256
|
});
|
|
9256
|
-
|
|
9257
|
+
fn.addRule("subscript", {
|
|
9257
9258
|
filter: "sub",
|
|
9258
9259
|
replacement: function(e) {
|
|
9259
9260
|
return `<sub>${e}</sub>`;
|
|
9260
9261
|
}
|
|
9261
9262
|
});
|
|
9262
|
-
|
|
9263
|
+
fn.addRule("table", {
|
|
9263
9264
|
filter: "table",
|
|
9264
9265
|
replacement: function(e, t) {
|
|
9265
|
-
const n = t, s = Array.from(n.rows), o = Array.from(s[0].cells).map((h) =>
|
|
9266
|
+
const n = t, s = Array.from(n.rows), o = Array.from(s[0].cells).map((h) => fn.turndown(h.innerHTML).trim()), i = o.map((h) => h.length), a = s.slice(1).map((h) => Array.from(h.cells).map((m, p) => {
|
|
9266
9267
|
let f = m.innerHTML.trim();
|
|
9267
9268
|
if (m.querySelector("ul, ol")) {
|
|
9268
9269
|
const x = m.querySelector("ul") ? "ul" : "ol", g = Array.from(m.querySelectorAll("li")).map(
|
|
@@ -9275,7 +9276,7 @@ pn.addRule("table", {
|
|
|
9275
9276
|
"</li><li>"
|
|
9276
9277
|
)}</li></${x}>`;
|
|
9277
9278
|
} else
|
|
9278
|
-
f =
|
|
9279
|
+
f = fn.turndown(f);
|
|
9279
9280
|
return i[p] = Math.max(
|
|
9280
9281
|
i[p],
|
|
9281
9282
|
f.length
|
|
@@ -9298,7 +9299,7 @@ ${d.join(
|
|
|
9298
9299
|
`;
|
|
9299
9300
|
}
|
|
9300
9301
|
});
|
|
9301
|
-
|
|
9302
|
+
fn.addRule("taskListItem", {
|
|
9302
9303
|
filter: (e) => {
|
|
9303
9304
|
const t = e.parentElement;
|
|
9304
9305
|
return e.nodeName === "LI" && (t == null ? void 0 : t.getAttribute("data-type")) === "taskList";
|
|
@@ -9322,7 +9323,7 @@ const qf = async (e, t, n) => {
|
|
|
9322
9323
|
), a = i.getHTML();
|
|
9323
9324
|
Oi(!0);
|
|
9324
9325
|
try {
|
|
9325
|
-
return
|
|
9326
|
+
return fn.turndown(a);
|
|
9326
9327
|
} finally {
|
|
9327
9328
|
Oi(!1), i.destroy();
|
|
9328
9329
|
}
|
|
@@ -9333,7 +9334,7 @@ const qf = async (e, t, n) => {
|
|
|
9333
9334
|
documentStyling: s,
|
|
9334
9335
|
theme: o = "light"
|
|
9335
9336
|
}) => {
|
|
9336
|
-
const i = F({}), a = F(null), { isNativeMobile: l } =
|
|
9337
|
+
const i = F({}), a = F(null), { isNativeMobile: l } = Zt(), c = Us("(max-width: 1279px)");
|
|
9337
9338
|
j(() => {
|
|
9338
9339
|
var m;
|
|
9339
9340
|
!c && i.current[t] && ((m = i.current[t]) == null || m.scrollIntoView({
|
|
@@ -9417,12 +9418,12 @@ const qf = async (e, t, n) => {
|
|
|
9417
9418
|
]
|
|
9418
9419
|
}
|
|
9419
9420
|
);
|
|
9420
|
-
},
|
|
9421
|
+
}, Ct = new qr({
|
|
9421
9422
|
html: !0,
|
|
9422
9423
|
linkify: !0,
|
|
9423
9424
|
typographer: !0
|
|
9424
9425
|
}).use(pm).enable(["table", "list"]);
|
|
9425
|
-
|
|
9426
|
+
Ct.renderer.rules.list_item_open = (e, t) => {
|
|
9426
9427
|
const n = e[t + 2];
|
|
9427
9428
|
if (n && n.content) {
|
|
9428
9429
|
const s = n.content.match(/^\[([ xX])\]\s*(.*)$/);
|
|
@@ -9531,13 +9532,13 @@ function e0(e, t = {}) {
|
|
|
9531
9532
|
const N = va(C, w);
|
|
9532
9533
|
T.push({
|
|
9533
9534
|
type: "content",
|
|
9534
|
-
content:
|
|
9535
|
+
content: Ct.render(N[0])
|
|
9535
9536
|
});
|
|
9536
9537
|
for (let I = 1; I < N.length; I++)
|
|
9537
9538
|
l.push(T), T = [
|
|
9538
9539
|
{
|
|
9539
9540
|
type: "content",
|
|
9540
|
-
content:
|
|
9541
|
+
content: Ct.render(N[I])
|
|
9541
9542
|
}
|
|
9542
9543
|
];
|
|
9543
9544
|
return T;
|
|
@@ -9557,7 +9558,7 @@ function e0(e, t = {}) {
|
|
|
9557
9558
|
va(C, w).forEach((I, B) => {
|
|
9558
9559
|
(B > 0 || m(I, T)) && T.length > 0 && (l.push(T), T = []), T.push({
|
|
9559
9560
|
type: "content",
|
|
9560
|
-
content:
|
|
9561
|
+
content: Ct.render(I)
|
|
9561
9562
|
});
|
|
9562
9563
|
});
|
|
9563
9564
|
return T;
|
|
@@ -9589,7 +9590,7 @@ function e0(e, t = {}) {
|
|
|
9589
9590
|
const T = C.filter((I) => I.trim().length > 0);
|
|
9590
9591
|
if (T.length < 2) return [""];
|
|
9591
9592
|
const S = T[0].split("|").map((I) => I.trim()).filter(Boolean), w = T[1], b = T.slice(2);
|
|
9592
|
-
return T.length <= a ? [`<div class="table-wrapper">${
|
|
9593
|
+
return T.length <= a ? [`<div class="table-wrapper">${Ct.render(C.join(`
|
|
9593
9594
|
`))}</div>`] : Yf(S, b, a).map((I) => {
|
|
9594
9595
|
const B = [
|
|
9595
9596
|
`|${S.join("|")}|`,
|
|
@@ -9597,7 +9598,7 @@ function e0(e, t = {}) {
|
|
|
9597
9598
|
...I.rows
|
|
9598
9599
|
].join(`
|
|
9599
9600
|
`);
|
|
9600
|
-
return `<div class="table-wrapper">${
|
|
9601
|
+
return `<div class="table-wrapper">${Ct.render(B)}</div>`;
|
|
9601
9602
|
});
|
|
9602
9603
|
}, y = e.split(`
|
|
9603
9604
|
`);
|
|
@@ -9612,16 +9613,16 @@ function e0(e, t = {}) {
|
|
|
9612
9613
|
b.length > 10 ? ka(S).forEach((B, _) => {
|
|
9613
9614
|
(_ > 0 || m(B, c)) && f(), c.push({
|
|
9614
9615
|
type: "content",
|
|
9615
|
-
content:
|
|
9616
|
+
content: Ct.render(B)
|
|
9616
9617
|
});
|
|
9617
9618
|
}) : b.length < 10 && N > 50 ? ka(S, 6).forEach((B, _) => {
|
|
9618
9619
|
(_ > 0 || m(B, c)) && f(), c.push({
|
|
9619
9620
|
type: "content",
|
|
9620
|
-
content:
|
|
9621
|
+
content: Ct.render(B)
|
|
9621
9622
|
});
|
|
9622
9623
|
}) : (m(S, c) && f(), c.push({
|
|
9623
9624
|
type: "content",
|
|
9624
|
-
content:
|
|
9625
|
+
content: Ct.render(S)
|
|
9625
9626
|
})), C = w;
|
|
9626
9627
|
continue;
|
|
9627
9628
|
}
|
|
@@ -9647,7 +9648,7 @@ function e0(e, t = {}) {
|
|
|
9647
9648
|
u = [];
|
|
9648
9649
|
}
|
|
9649
9650
|
f();
|
|
9650
|
-
const S = T.substring(2), w =
|
|
9651
|
+
const S = T.substring(2), w = Ct.renderInline(S);
|
|
9651
9652
|
l.push([{ type: "h1", content: w }]);
|
|
9652
9653
|
continue;
|
|
9653
9654
|
}
|
|
@@ -9662,7 +9663,7 @@ function e0(e, t = {}) {
|
|
|
9662
9663
|
}
|
|
9663
9664
|
f();
|
|
9664
9665
|
const S = T.substring(3);
|
|
9665
|
-
c = [{ type: "h2", content:
|
|
9666
|
+
c = [{ type: "h2", content: Ct.renderInline(S) }];
|
|
9666
9667
|
continue;
|
|
9667
9668
|
}
|
|
9668
9669
|
if (T.startsWith("|") || T.match(/^\s*[-|]+\s*$/)) {
|
|
@@ -9684,7 +9685,7 @@ function e0(e, t = {}) {
|
|
|
9684
9685
|
Xf(d, 23).forEach((w, b) => {
|
|
9685
9686
|
(b > 0 || m(w, c)) && f(), c.push({
|
|
9686
9687
|
type: "content",
|
|
9687
|
-
content:
|
|
9688
|
+
content: Ct.render(w)
|
|
9688
9689
|
});
|
|
9689
9690
|
});
|
|
9690
9691
|
else {
|
|
@@ -9692,7 +9693,7 @@ function e0(e, t = {}) {
|
|
|
9692
9693
|
`);
|
|
9693
9694
|
m(S, c) && f(), c.push({
|
|
9694
9695
|
type: "content",
|
|
9695
|
-
content:
|
|
9696
|
+
content: Ct.render(S)
|
|
9696
9697
|
});
|
|
9697
9698
|
}
|
|
9698
9699
|
d = [];
|
|
@@ -9751,7 +9752,7 @@ function e0(e, t = {}) {
|
|
|
9751
9752
|
case "table":
|
|
9752
9753
|
return T.content;
|
|
9753
9754
|
default:
|
|
9754
|
-
return
|
|
9755
|
+
return Ct.render(T.content);
|
|
9755
9756
|
}
|
|
9756
9757
|
}).filter(Boolean).join(`
|
|
9757
9758
|
`)).filter(Boolean).join(`
|
|
@@ -9825,7 +9826,7 @@ const t0 = ({
|
|
|
9825
9826
|
fetchV1ImageFn: g,
|
|
9826
9827
|
theme: y = "light"
|
|
9827
9828
|
}) => {
|
|
9828
|
-
const [A, E] = Y(!1), [k, R] = Y(0), [C, T] = Y(!0), { isNativeMobile: S } =
|
|
9829
|
+
const [A, E] = Y(!1), [k, R] = Y(0), [C, T] = Y(!0), { isNativeMobile: S } = Zt(), [w, b] = Y(null), [N, I] = Y(null), B = 50, [_, X] = Y(
|
|
9829
9830
|
"forward"
|
|
9830
9831
|
), $ = As(
|
|
9831
9832
|
x == null ? void 0 : x.canvasBackground,
|
|
@@ -9977,7 +9978,7 @@ const t0 = ({
|
|
|
9977
9978
|
] }),
|
|
9978
9979
|
/* @__PURE__ */ v("div", { className: "flex justify-center items-center gap-2", children: [
|
|
9979
9980
|
m == null ? void 0 : m(),
|
|
9980
|
-
!l && /* @__PURE__ */ r(
|
|
9981
|
+
!l && /* @__PURE__ */ r(Ge, { text: "Download", sideOffset: 10, children: /* @__PURE__ */ r(
|
|
9981
9982
|
be,
|
|
9982
9983
|
{
|
|
9983
9984
|
variant: "ghost",
|
|
@@ -9986,7 +9987,7 @@ const t0 = ({
|
|
|
9986
9987
|
size: "md"
|
|
9987
9988
|
}
|
|
9988
9989
|
) }),
|
|
9989
|
-
/* @__PURE__ */ r(
|
|
9990
|
+
/* @__PURE__ */ r(Ge, { text: "Comments", sideOffset: 10, children: /* @__PURE__ */ r(
|
|
9990
9991
|
be,
|
|
9991
9992
|
{
|
|
9992
9993
|
variant: "ghost",
|
|
@@ -9996,7 +9997,7 @@ const t0 = ({
|
|
|
9996
9997
|
}
|
|
9997
9998
|
) }),
|
|
9998
9999
|
!l && /* @__PURE__ */ v(
|
|
9999
|
-
|
|
10000
|
+
Ge,
|
|
10000
10001
|
{
|
|
10001
10002
|
text: a ? "Copy to Share" : "Link is preparing...",
|
|
10002
10003
|
sideOffset: 10,
|
|
@@ -10027,7 +10028,7 @@ const t0 = ({
|
|
|
10027
10028
|
]
|
|
10028
10029
|
}
|
|
10029
10030
|
),
|
|
10030
|
-
/* @__PURE__ */ r(
|
|
10031
|
+
/* @__PURE__ */ r(Ge, { text: "Press F to toggle fullscreen", sideOffset: 10, children: /* @__PURE__ */ r(
|
|
10031
10032
|
be,
|
|
10032
10033
|
{
|
|
10033
10034
|
variant: "ghost",
|
|
@@ -10060,7 +10061,7 @@ const t0 = ({
|
|
|
10060
10061
|
}
|
|
10061
10062
|
},
|
|
10062
10063
|
children: /* @__PURE__ */ r(Pr, { isPreviewMode: !0, isPresentationMode: !0, children: n ? /* @__PURE__ */ r(Ps, { mode: "wait", children: /* @__PURE__ */ r(
|
|
10063
|
-
|
|
10064
|
+
Ut.div,
|
|
10064
10065
|
{
|
|
10065
10066
|
initial: {
|
|
10066
10067
|
opacity: 0,
|
|
@@ -10158,7 +10159,7 @@ const t0 = ({
|
|
|
10158
10159
|
/* @__PURE__ */ v("div", { className: "flex flex-col gap-2", children: [
|
|
10159
10160
|
/* @__PURE__ */ v("div", { className: "flex gap-3 mt-2", children: [
|
|
10160
10161
|
/* @__PURE__ */ r(
|
|
10161
|
-
|
|
10162
|
+
Qt,
|
|
10162
10163
|
{
|
|
10163
10164
|
"data-testid": "comment-name-input",
|
|
10164
10165
|
type: "text",
|
|
@@ -10243,7 +10244,7 @@ const t0 = ({
|
|
|
10243
10244
|
replyCount: t,
|
|
10244
10245
|
commentUsername: n
|
|
10245
10246
|
}) => {
|
|
10246
|
-
const s = z((R) => R.reply), o = z((R) => R.replyEditTarget), i = z((R) => R.editRequest), a = z((R) => R.clearEditRequest), l = z((R) => R.setReply), c = z((R) => R.setReplyEditTarget), u = z((R) => R.cancelReplyEdit), d = z((R) => R.handleReplyChange), h = z((R) => R.handleReplyKeyDown), m = z((R) => R.handleReplySubmit), p = z((R) => R.setOpenReplyId), f = z((R) => R.username), { isBelow1280px: x } =
|
|
10247
|
+
const s = z((R) => R.reply), o = z((R) => R.replyEditTarget), i = z((R) => R.editRequest), a = z((R) => R.clearEditRequest), l = z((R) => R.setReply), c = z((R) => R.setReplyEditTarget), u = z((R) => R.cancelReplyEdit), d = z((R) => R.handleReplyChange), h = z((R) => R.handleReplyKeyDown), m = z((R) => R.handleReplySubmit), p = z((R) => R.setOpenReplyId), f = z((R) => R.username), { isBelow1280px: x } = Zt(), g = !!s.trim(), y = !!o, A = !!(!s.trim() || !f || y && s.trim() === ((o == null ? void 0 : o.originalText) ?? "").trim()), E = F(null), k = en(f);
|
|
10247
10248
|
return j(() => {
|
|
10248
10249
|
var R;
|
|
10249
10250
|
!i || i.commentId !== e || (l(i.text), c({
|
|
@@ -10265,16 +10266,16 @@ const t0 = ({
|
|
|
10265
10266
|
),
|
|
10266
10267
|
children: [
|
|
10267
10268
|
/* @__PURE__ */ r(
|
|
10268
|
-
|
|
10269
|
+
Jt,
|
|
10269
10270
|
{
|
|
10270
|
-
src: k.isEns ?
|
|
10271
|
+
src: k.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
10271
10272
|
k.name || ""
|
|
10272
10273
|
)}`,
|
|
10273
10274
|
className: "w-[16px] h-[16px]"
|
|
10274
10275
|
}
|
|
10275
10276
|
),
|
|
10276
10277
|
/* @__PURE__ */ r(
|
|
10277
|
-
|
|
10278
|
+
Nn,
|
|
10278
10279
|
{
|
|
10279
10280
|
ref: E,
|
|
10280
10281
|
"data-testid": "comment-reply-input",
|
|
@@ -10342,7 +10343,7 @@ const t0 = ({
|
|
|
10342
10343
|
)
|
|
10343
10344
|
] });
|
|
10344
10345
|
}, c0 = ({ tabId: e }) => {
|
|
10345
|
-
const t = z((c) => c.comment), n = z((c) => c.username), s = z((c) => c.handleCommentChange), o = z((c) => c.handleCommentKeyDown), i = z((c) => c.handleCommentSubmit), a = F(null), l =
|
|
10346
|
+
const t = z((c) => c.comment), n = z((c) => c.username), s = z((c) => c.handleCommentChange), o = z((c) => c.handleCommentKeyDown), i = z((c) => c.handleCommentSubmit), a = F(null), l = en(n);
|
|
10346
10347
|
return j(() => {
|
|
10347
10348
|
a.current && ut(a.current, 96);
|
|
10348
10349
|
}, [t]), /* @__PURE__ */ v("div", { className: "flex flex-col gap-3 color-bg-default border-t color-border-default pt-[20px] rounded-b-lg", children: [
|
|
@@ -10354,16 +10355,16 @@ const t0 = ({
|
|
|
10354
10355
|
),
|
|
10355
10356
|
children: [
|
|
10356
10357
|
/* @__PURE__ */ r(
|
|
10357
|
-
|
|
10358
|
+
Jt,
|
|
10358
10359
|
{
|
|
10359
|
-
src: l.isEns ?
|
|
10360
|
+
src: l.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
10360
10361
|
l.name
|
|
10361
10362
|
)}`,
|
|
10362
10363
|
className: "w-[16px] h-[16px]"
|
|
10363
10364
|
}
|
|
10364
10365
|
),
|
|
10365
10366
|
/* @__PURE__ */ r(
|
|
10366
|
-
|
|
10367
|
+
Nn,
|
|
10367
10368
|
{
|
|
10368
10369
|
ref: a,
|
|
10369
10370
|
"data-testid": "comment-section-input",
|
|
@@ -10423,7 +10424,7 @@ const sc = ({
|
|
|
10423
10424
|
onCommentFocus: d,
|
|
10424
10425
|
onReset: h
|
|
10425
10426
|
}) => {
|
|
10426
|
-
const m = z((U) => U.tabComments), p = z((U) => U.username), f = z((U) => U.setUsername), x = z((U) => U.focusCommentInEditor), g = z((U) => U.setActiveCommentId), y = z((U) => U.setOpenReplyId), A = z((U) => U.openReplyId), E = z((U) => U.resolveComment), k = z((U) => U.unresolveComment), R = z((U) => U.deleteComment), C = z((U) => U.acceptSuggestion), T = z((U) => U.isConnected), S = z((U) => U.connectViaWallet), w = z((U) => U.isLoading), b = z((U) => U.connectViaUsername), N = z((U) => U.isDDocOwner), { commentsSectionRef: I, replySectionRef: B } = Bs(), { isBelow1280px: _ } =
|
|
10427
|
+
const m = z((U) => U.tabComments), p = z((U) => U.username), f = z((U) => U.setUsername), x = z((U) => U.focusCommentInEditor), g = z((U) => U.setActiveCommentId), y = z((U) => U.setOpenReplyId), A = z((U) => U.openReplyId), E = z((U) => U.resolveComment), k = z((U) => U.unresolveComment), R = z((U) => U.deleteComment), C = z((U) => U.acceptSuggestion), T = z((U) => U.isConnected), S = z((U) => U.connectViaWallet), w = z((U) => U.isLoading), b = z((U) => U.connectViaUsername), N = z((U) => U.isDDocOwner), { commentsSectionRef: I, replySectionRef: B } = Bs(), { isBelow1280px: _ } = Zt(), X = s && !!A, [$, te] = Y(null), [P, Q] = Y(null), ee = (o ?? m).filter((U) => !U.deleted).sort(
|
|
10427
10428
|
(U, ce) => new Date(ce.createdAt).getTime() - new Date(U.createdAt).getTime()
|
|
10428
10429
|
), me = ee.filter(
|
|
10429
10430
|
(U) => !U.resolved
|
|
@@ -10591,7 +10592,7 @@ const sc = ({
|
|
|
10591
10592
|
onSetOpenReplyId: p
|
|
10592
10593
|
}) => {
|
|
10593
10594
|
var E, k;
|
|
10594
|
-
const [f, x] = Y(!1), { isBelow1280px: g } =
|
|
10595
|
+
const [f, x] = Y(!1), { isBelow1280px: g } = Zt(), y = d0(
|
|
10595
10596
|
e.id,
|
|
10596
10597
|
e.selectedContent,
|
|
10597
10598
|
e.tabId,
|
|
@@ -10841,7 +10842,7 @@ const sc = ({
|
|
|
10841
10842
|
onSubmit: c,
|
|
10842
10843
|
onUpdateDraftText: u
|
|
10843
10844
|
}) => {
|
|
10844
|
-
const d = F(null), h = z((g) => g.username), m =
|
|
10845
|
+
const d = F(null), h = z((g) => g.username), m = en(h), { handleDraftBlur: p, handleDraftFocus: f, submitLabel: x } = Yr({
|
|
10845
10846
|
draftId: t,
|
|
10846
10847
|
canAutoSubmit: n && !!t && !!(e != null && e.text.trim()) && !s,
|
|
10847
10848
|
onSubmit: c
|
|
@@ -10867,16 +10868,16 @@ const sc = ({
|
|
|
10867
10868
|
] }),
|
|
10868
10869
|
/* @__PURE__ */ v("div", { className: "border flex px-[12px] items-center justify-between py-[8px] gap-[8px] rounded-[4px]", children: [
|
|
10869
10870
|
/* @__PURE__ */ r(
|
|
10870
|
-
|
|
10871
|
+
Jt,
|
|
10871
10872
|
{
|
|
10872
|
-
src: m.isEns ?
|
|
10873
|
+
src: m.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
10873
10874
|
m.name
|
|
10874
10875
|
)}`,
|
|
10875
10876
|
className: "w-[16px] h-[16px]"
|
|
10876
10877
|
}
|
|
10877
10878
|
),
|
|
10878
10879
|
/* @__PURE__ */ r(
|
|
10879
|
-
|
|
10880
|
+
Nn,
|
|
10880
10881
|
{
|
|
10881
10882
|
ref: d,
|
|
10882
10883
|
value: (e == null ? void 0 : e.text) || "",
|
|
@@ -10937,7 +10938,7 @@ const sc = ({
|
|
|
10937
10938
|
children: [
|
|
10938
10939
|
/* @__PURE__ */ v("div", { className: "flex flex-col gap-2", children: [
|
|
10939
10940
|
/* @__PURE__ */ r(
|
|
10940
|
-
|
|
10941
|
+
Qt,
|
|
10941
10942
|
{
|
|
10942
10943
|
type: "text",
|
|
10943
10944
|
value: o,
|
|
@@ -11003,7 +11004,7 @@ const sc = ({
|
|
|
11003
11004
|
onFocusSuggestionText: l,
|
|
11004
11005
|
onSubmit: c
|
|
11005
11006
|
}) => {
|
|
11006
|
-
const u =
|
|
11007
|
+
const u = en(s), d = !!e.selectedText, h = !!e.insertedText, m = !!e.linkHref, p = d || h || m, { submitLabel: f } = oc({
|
|
11007
11008
|
suggestionId: e.suggestionId,
|
|
11008
11009
|
canAutoSubmit: t && p && !n,
|
|
11009
11010
|
onSubmit: c
|
|
@@ -11032,9 +11033,9 @@ const sc = ({
|
|
|
11032
11033
|
t ? /* @__PURE__ */ v("div", { className: "flex flex-col gap-[8px]", children: [
|
|
11033
11034
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
11034
11035
|
/* @__PURE__ */ r(
|
|
11035
|
-
|
|
11036
|
+
Jt,
|
|
11036
11037
|
{
|
|
11037
|
-
src: u.isEns ?
|
|
11038
|
+
src: u.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
11038
11039
|
u.name
|
|
11039
11040
|
)}`,
|
|
11040
11041
|
size: "sm",
|
|
@@ -11518,7 +11519,7 @@ const sc = ({
|
|
|
11518
11519
|
}) => {
|
|
11519
11520
|
const d = z((je) => je.initialComments), h = z((je) => je.isConnected), m = z((je) => je.focusCommentInEditor), p = z(
|
|
11520
11521
|
(je) => je.focusSuggestionDraftInEditor
|
|
11521
|
-
), f = z((je) => je.isCommentOpen), x = z((je) => je.openReplyId), g = z((je) => je.setOpenReplyId), y = z((je) => je.setIsCommentOpen), A = z((je) => je.username), { isBelow1280px: E } =
|
|
11522
|
+
), f = z((je) => je.isCommentOpen), x = z((je) => je.openReplyId), g = z((je) => je.setOpenReplyId), y = z((je) => je.setIsCommentOpen), A = z((je) => je.username), { isBelow1280px: E } = Zt(), k = F(null), { mobileDraftRef: R } = Bs(), C = E && !!x, {
|
|
11522
11523
|
closeFilterSelects: T,
|
|
11523
11524
|
commentType: S,
|
|
11524
11525
|
commentTypeOptions: w,
|
|
@@ -11558,13 +11559,13 @@ const sc = ({
|
|
|
11558
11559
|
onTabChange: a,
|
|
11559
11560
|
setOpenReplyId: g
|
|
11560
11561
|
}), {
|
|
11561
|
-
canGoToNextMobileComment:
|
|
11562
|
+
canGoToNextMobileComment: De,
|
|
11562
11563
|
canGoToPreviousMobileComment: Ee,
|
|
11563
11564
|
handleNextMobileComment: He,
|
|
11564
11565
|
handlePreviousMobileComment: ze,
|
|
11565
|
-
handleViewAllComments:
|
|
11566
|
-
mobileActiveCommentsCount:
|
|
11567
|
-
mobileFocusedCommentIndex:
|
|
11566
|
+
handleViewAllComments: Ye,
|
|
11567
|
+
mobileActiveCommentsCount: xt,
|
|
11568
|
+
mobileFocusedCommentIndex: ht
|
|
11568
11569
|
} = k0({
|
|
11569
11570
|
comments: d,
|
|
11570
11571
|
mobileDrawerRef: k,
|
|
@@ -11583,14 +11584,14 @@ const sc = ({
|
|
|
11583
11584
|
setIsDiscardCommentOverlayVisible: D,
|
|
11584
11585
|
setIsDiscardSuggestionOverlayVisible: se
|
|
11585
11586
|
});
|
|
11586
|
-
const
|
|
11587
|
+
const lt = /* @__PURE__ */ r("div", { ref: k, "data-testid": "comment-drawer", children: E ? /* @__PURE__ */ r(
|
|
11587
11588
|
y0,
|
|
11588
11589
|
{
|
|
11589
11590
|
activeCommentId: o,
|
|
11590
11591
|
activeDraft: le,
|
|
11591
11592
|
activeDraftId: O,
|
|
11592
11593
|
activeSuggestionDraftCard: H,
|
|
11593
|
-
canGoToNextMobileComment:
|
|
11594
|
+
canGoToNextMobileComment: De,
|
|
11594
11595
|
canGoToPreviousMobileComment: Ee,
|
|
11595
11596
|
comments: d,
|
|
11596
11597
|
isCommentMobileFocused: C,
|
|
@@ -11601,9 +11602,9 @@ const sc = ({
|
|
|
11601
11602
|
isMobileDrawerVisible: Se,
|
|
11602
11603
|
isNavbarVisible: n,
|
|
11603
11604
|
isPresentationMode: s,
|
|
11604
|
-
mobileActiveCommentsCount:
|
|
11605
|
+
mobileActiveCommentsCount: xt,
|
|
11605
11606
|
mobileDraftRef: R,
|
|
11606
|
-
mobileFocusedCommentIndex:
|
|
11607
|
+
mobileFocusedCommentIndex: ht,
|
|
11607
11608
|
onAttemptCloseNewComment: () => D(!0),
|
|
11608
11609
|
onAttemptCloseSuggestionDraft: () => se(!0),
|
|
11609
11610
|
onCancelDiscardComment: () => D(!1),
|
|
@@ -11624,7 +11625,7 @@ const sc = ({
|
|
|
11624
11625
|
onStartNewMobileComment: q,
|
|
11625
11626
|
onSubmitSuggestionDraft: L,
|
|
11626
11627
|
onUpdateInlineDraftText: fe,
|
|
11627
|
-
onViewAllComments:
|
|
11628
|
+
onViewAllComments: Ye,
|
|
11628
11629
|
tabNameById: oe,
|
|
11629
11630
|
username: A
|
|
11630
11631
|
}
|
|
@@ -11657,7 +11658,7 @@ const sc = ({
|
|
|
11657
11658
|
tabNameById: oe
|
|
11658
11659
|
}
|
|
11659
11660
|
) });
|
|
11660
|
-
return E && u ?
|
|
11661
|
+
return E && u ? Tn(lt, u) : lt;
|
|
11661
11662
|
}, N0 = (e) => {
|
|
11662
11663
|
const [t, n] = Y(!1);
|
|
11663
11664
|
return j(() => {
|
|
@@ -12224,7 +12225,7 @@ const sc = ({
|
|
|
12224
12225
|
);
|
|
12225
12226
|
const K = M(() => {
|
|
12226
12227
|
G.current.rafId === null && (G.current.rafId = window.requestAnimationFrame(() => {
|
|
12227
|
-
var
|
|
12228
|
+
var tn;
|
|
12228
12229
|
G.current.rafId = null;
|
|
12229
12230
|
const D = Q.current, se = cr(n), fe = u.current, re = P.current;
|
|
12230
12231
|
if (!se || !fe || !re || !D.length || !l) {
|
|
@@ -12240,7 +12241,7 @@ const sc = ({
|
|
|
12240
12241
|
activeFloatingCards: Ee,
|
|
12241
12242
|
activeFloatingCardMap: He,
|
|
12242
12243
|
floatingCardIdsToClose: ze,
|
|
12243
|
-
shouldScheduleFollowUp:
|
|
12244
|
+
shouldScheduleFollowUp: Ye
|
|
12244
12245
|
} = g({
|
|
12245
12246
|
currentCycle: Se,
|
|
12246
12247
|
currentDocVersion: J,
|
|
@@ -12254,93 +12255,93 @@ const sc = ({
|
|
|
12254
12255
|
markRecomputeFromIndex: b,
|
|
12255
12256
|
getOrderedFloatingCardIndex: k
|
|
12256
12257
|
});
|
|
12257
|
-
ue || (ue =
|
|
12258
|
-
const { orderedFloatingCardIds:
|
|
12259
|
-
if (
|
|
12260
|
-
b(
|
|
12261
|
-
const Pe =
|
|
12258
|
+
ue || (ue = Ye);
|
|
12259
|
+
const { orderedFloatingCardIds: xt, firstChangedIndex: ht } = _(Ee);
|
|
12260
|
+
if (ht !== null) {
|
|
12261
|
+
b(ht);
|
|
12262
|
+
const Pe = xt[ht];
|
|
12262
12263
|
Pe && S(
|
|
12263
12264
|
Pe,
|
|
12264
12265
|
dt.Anchor
|
|
12265
12266
|
);
|
|
12266
12267
|
}
|
|
12267
12268
|
B(new Set(He.keys()));
|
|
12268
|
-
const
|
|
12269
|
+
const Ke = fe.getBoundingClientRect(), lt = re.getBoundingClientRect(), je = (tn = s.current) == null ? void 0 : tn.getBoundingClientRect(), zt = je !== void 0 ? Math.max(
|
|
12269
12270
|
0,
|
|
12270
|
-
je.bottom -
|
|
12271
|
+
je.bottom - lt.top
|
|
12271
12272
|
) : 0;
|
|
12272
12273
|
ce.current !== re && (ce.current = re, q.current = null), (U.current === null || Math.abs(
|
|
12273
|
-
U.current -
|
|
12274
|
-
) > 0.5) && (U.current =
|
|
12275
|
-
const Xe =
|
|
12274
|
+
U.current - lt.top
|
|
12275
|
+
) > 0.5) && (U.current = lt.top, L.current.containerOffset += 1);
|
|
12276
|
+
const Xe = Ke.height, Qe = Ke.top - lt.top, St = Qe + Xe, an = L.current.appliedScroll !== L.current.scroll, ln = L.current.appliedContainerOffset !== L.current.containerOffset;
|
|
12276
12277
|
I.current.forEach((Pe, Me) => {
|
|
12277
12278
|
const st = He.get(Pe);
|
|
12278
12279
|
if (!st)
|
|
12279
12280
|
return;
|
|
12280
|
-
const
|
|
12281
|
+
const Re = R(Pe), { anchorId: jt } = So(st), rt = m.current.get(jt);
|
|
12281
12282
|
if (!rt) {
|
|
12282
|
-
|
|
12283
|
+
Re.isInViewport && (Re.isInViewport = !1, S(
|
|
12283
12284
|
Pe,
|
|
12284
12285
|
dt.Visibility
|
|
12285
|
-
), b(Me)),
|
|
12286
|
+
), b(Me)), Re.anchorTop = null, Re.anchorHeight = 0;
|
|
12286
12287
|
return;
|
|
12287
12288
|
}
|
|
12288
12289
|
let ct = rt.cachedRect ? B0({
|
|
12289
12290
|
cachedRect: rt.cachedRect,
|
|
12290
12291
|
scrollTop: fe.scrollTop,
|
|
12291
|
-
containerTop:
|
|
12292
|
+
containerTop: lt.top
|
|
12292
12293
|
}) : null;
|
|
12293
|
-
ct && (
|
|
12294
|
+
ct && (Re.anchorTop = ct.top, Re.anchorHeight = ct.height);
|
|
12294
12295
|
const mt = ct !== null && dr({
|
|
12295
12296
|
top: ct.top,
|
|
12296
12297
|
bottom: ct.top + ct.height,
|
|
12297
|
-
viewportTop:
|
|
12298
|
+
viewportTop: Qe,
|
|
12298
12299
|
viewportBottom: St,
|
|
12299
12300
|
viewportHeight: Xe
|
|
12300
|
-
}), jn =
|
|
12301
|
-
if ((!rt.cachedRect ||
|
|
12301
|
+
}), jn = Re.anchorVersion !== rt.anchorVersion;
|
|
12302
|
+
if ((!rt.cachedRect || Re.isInViewport || mt || jn || !Re.isMeasured || ln && mt || an && Re.isInViewport) && Sa(rt, se)) {
|
|
12302
12303
|
const pt = O0({
|
|
12303
12304
|
elements: rt.elements,
|
|
12304
|
-
viewportTop:
|
|
12305
|
-
viewportBottom:
|
|
12305
|
+
viewportTop: Ke.top,
|
|
12306
|
+
viewportBottom: Ke.bottom
|
|
12306
12307
|
});
|
|
12307
12308
|
if (pt) {
|
|
12308
|
-
const
|
|
12309
|
-
|
|
12310
|
-
top:
|
|
12309
|
+
const $t = pt.top - lt.top;
|
|
12310
|
+
Re.anchorTop = $t, Re.anchorHeight = pt.height, rt.cachedRect = {
|
|
12311
|
+
top: $t,
|
|
12311
12312
|
height: pt.height,
|
|
12312
12313
|
scrollTop: fe.scrollTop,
|
|
12313
|
-
containerTop:
|
|
12314
|
-
}, ct = { top:
|
|
12315
|
-
} else ct && (
|
|
12314
|
+
containerTop: lt.top
|
|
12315
|
+
}, ct = { top: $t, height: pt.height };
|
|
12316
|
+
} else ct && (Re.anchorTop = ct.top, Re.anchorHeight = ct.height);
|
|
12316
12317
|
}
|
|
12317
|
-
|
|
12318
|
-
const
|
|
12319
|
-
top:
|
|
12320
|
-
bottom:
|
|
12321
|
-
viewportTop:
|
|
12318
|
+
Re.anchorVersion = rt.anchorVersion;
|
|
12319
|
+
const Vt = Re.anchorTop !== null && dr({
|
|
12320
|
+
top: Re.anchorTop,
|
|
12321
|
+
bottom: Re.anchorTop + Math.max(Re.anchorHeight, 1),
|
|
12322
|
+
viewportTop: Qe,
|
|
12322
12323
|
viewportBottom: St,
|
|
12323
12324
|
viewportHeight: Xe
|
|
12324
|
-
}),
|
|
12325
|
-
top:
|
|
12326
|
-
bottom:
|
|
12327
|
-
viewportTop:
|
|
12325
|
+
}), nn = Re.translateY ?? Re.lastCommittedTranslateY, Wt = Re.isMeasured && nn !== null && dr({
|
|
12326
|
+
top: nn,
|
|
12327
|
+
bottom: nn + Re.height,
|
|
12328
|
+
viewportTop: Qe,
|
|
12328
12329
|
viewportBottom: St,
|
|
12329
12330
|
viewportHeight: Xe
|
|
12330
|
-
}), Nt =
|
|
12331
|
-
if (
|
|
12332
|
-
const pt =
|
|
12333
|
-
|
|
12331
|
+
}), Nt = Vt || Wt;
|
|
12332
|
+
if (Re.isInViewport !== Nt) {
|
|
12333
|
+
const pt = Re.isInViewport;
|
|
12334
|
+
Re.isInViewport = Nt, S(
|
|
12334
12335
|
Pe,
|
|
12335
12336
|
dt.Visibility
|
|
12336
|
-
), b(Me), !pt && Nt && (
|
|
12337
|
+
), b(Me), !pt && Nt && (Re.needsTransformSync = !0, C.current.add(Pe), ue = !0);
|
|
12337
12338
|
}
|
|
12338
12339
|
}), L.current.appliedScroll = L.current.scroll, L.current.appliedContainerOffset = L.current.containerOffset;
|
|
12339
|
-
const
|
|
12340
|
+
const Kt = I.current.filter((Pe) => {
|
|
12340
12341
|
const Me = A.current.get(Pe);
|
|
12341
12342
|
return !!(Me != null && Me.isInViewport);
|
|
12342
|
-
}), { didChange:
|
|
12343
|
-
|
|
12343
|
+
}), { didChange: cn, previousMountedFloatingCardIds: ms } = $(Kt);
|
|
12344
|
+
cn && Kt.forEach((Pe) => {
|
|
12344
12345
|
if (ms.has(Pe))
|
|
12345
12346
|
return;
|
|
12346
12347
|
C.current.add(Pe);
|
|
@@ -12353,46 +12354,46 @@ const sc = ({
|
|
|
12353
12354
|
const Me = W.current.cardNodes.get(Pe), st = A.current.get(Pe);
|
|
12354
12355
|
if (!Me || !st)
|
|
12355
12356
|
return;
|
|
12356
|
-
const
|
|
12357
|
-
if (
|
|
12358
|
-
st.height =
|
|
12359
|
-
const
|
|
12357
|
+
const Re = Math.round(Me.offsetHeight);
|
|
12358
|
+
if (Re > 0 && (!st.isMeasured || st.height !== Re)) {
|
|
12359
|
+
st.height = Re, st.isMeasured = !0;
|
|
12360
|
+
const jt = k(Pe);
|
|
12360
12361
|
S(
|
|
12361
12362
|
Pe,
|
|
12362
12363
|
dt.Height
|
|
12363
|
-
), b(
|
|
12364
|
+
), b(jt ?? 0);
|
|
12364
12365
|
}
|
|
12365
12366
|
}), C.current.clear();
|
|
12366
|
-
let
|
|
12367
|
+
let gn = Number.POSITIVE_INFINITY;
|
|
12367
12368
|
const ps = I.current.reduce(
|
|
12368
12369
|
(Pe, Me, st) => {
|
|
12369
|
-
const
|
|
12370
|
-
return !
|
|
12370
|
+
const Re = A.current.get(Me);
|
|
12371
|
+
return !Re || Re.invalidationFlags === dt.None ? Pe : (gn = Math.min(gn, st), st);
|
|
12371
12372
|
},
|
|
12372
12373
|
-1
|
|
12373
12374
|
), Kn = Math.min(
|
|
12374
12375
|
T.current.recomputeFromIndex,
|
|
12375
12376
|
Math.max(I.current.length - 1, 0)
|
|
12376
|
-
), En = !!me.current && O.current && I.current.length > 0,
|
|
12377
|
+
), En = !!me.current && O.current && I.current.length > 0, yn = zu({
|
|
12377
12378
|
floatingCards: E(),
|
|
12378
12379
|
recomputeStartIndex: Kn,
|
|
12379
|
-
firstInvalidatedIndex: En ? 0 :
|
|
12380
|
+
firstInvalidatedIndex: En ? 0 : gn,
|
|
12380
12381
|
lastInvalidatedIndex: En ? I.current.length - 1 : ps,
|
|
12381
12382
|
gap: Ku,
|
|
12382
12383
|
focusedFloatingCardId: me.current
|
|
12383
12384
|
});
|
|
12384
|
-
En &&
|
|
12385
|
+
En && yn.usedFocusedLayout && (O.current = !1);
|
|
12385
12386
|
let ie = 0;
|
|
12386
12387
|
I.current.forEach((Pe) => {
|
|
12387
12388
|
const Me = A.current.get(Pe), st = W.current.cardNodes.get(Pe);
|
|
12388
12389
|
if (!Me)
|
|
12389
12390
|
return;
|
|
12390
|
-
const
|
|
12391
|
+
const Re = yn.placements.get(Pe) ?? {
|
|
12391
12392
|
translateY: Me.translateY,
|
|
12392
12393
|
isVisible: Me.lastCommittedVisible
|
|
12393
|
-
},
|
|
12394
|
-
if (!c && Me.isMeasured &&
|
|
12395
|
-
const An = Li(
|
|
12394
|
+
}, jt = Re.translateY ?? Me.translateY ?? Me.lastCommittedTranslateY;
|
|
12395
|
+
if (!c && Me.isMeasured && jt !== null) {
|
|
12396
|
+
const An = Li(jt);
|
|
12396
12397
|
An !== null && (ie = Math.max(
|
|
12397
12398
|
ie,
|
|
12398
12399
|
An + Me.height
|
|
@@ -12400,19 +12401,19 @@ const sc = ({
|
|
|
12400
12401
|
}
|
|
12401
12402
|
if (!st)
|
|
12402
12403
|
return;
|
|
12403
|
-
|
|
12404
|
-
const rt = Li(
|
|
12404
|
+
yn.placements.has(Pe) && (Me.translateY = Re.translateY);
|
|
12405
|
+
const rt = Li(Re.translateY);
|
|
12405
12406
|
(Me.needsTransformSync && rt !== null || rt !== Me.lastCommittedTranslateY) && rt !== null && (st.style.transform = `translateY(${rt}px)`, Me.lastCommittedTranslateY = rt, Me.needsTransformSync = !1);
|
|
12406
|
-
const mt = !!
|
|
12407
|
+
const mt = !!Re.isVisible && Me.isMeasured && Me.anchorTop !== null && !c;
|
|
12407
12408
|
(mt !== Me.lastCommittedVisible || (Me.invalidationFlags & (dt.Visibility | dt.Height)) !== 0) && (st.style.visibility = mt ? "visible" : "hidden", st.style.opacity = mt ? "1" : "0", Me.lastCommittedVisible = mt);
|
|
12408
12409
|
});
|
|
12409
|
-
const
|
|
12410
|
-
Math.max(
|
|
12410
|
+
const xn = ie > 0 ? ie + ju : 0, At = Math.ceil(
|
|
12411
|
+
Math.max(zt, xn)
|
|
12411
12412
|
);
|
|
12412
12413
|
q.current !== At && (re.style.setProperty(
|
|
12413
12414
|
K0,
|
|
12414
12415
|
`${At}px`
|
|
12415
|
-
), q.current = At), y(
|
|
12416
|
+
), q.current = At), y(yn.stopIndex), T.current.recomputeFromIndex = I.current.length, ze.size > 0 && ze.forEach((Pe) => {
|
|
12416
12417
|
t(Pe);
|
|
12417
12418
|
}), ue && Ee.length > 0 && K();
|
|
12418
12419
|
}));
|
|
@@ -12600,7 +12601,7 @@ const sc = ({
|
|
|
12600
12601
|
const ue = ee.current.get(J);
|
|
12601
12602
|
if (!ue)
|
|
12602
12603
|
return;
|
|
12603
|
-
const { anchorId:
|
|
12604
|
+
const { anchorId: De } = So(ue), Ee = m.current.get(De);
|
|
12604
12605
|
(!Ee || !Sa(Ee, re)) && (p(J), Se = !0);
|
|
12605
12606
|
}), Se && K();
|
|
12606
12607
|
};
|
|
@@ -12767,7 +12768,7 @@ const sc = ({
|
|
|
12767
12768
|
};
|
|
12768
12769
|
}, Y0 = (e) => e instanceof Element ? !!e.closest(
|
|
12769
12770
|
'button, [role="button"], a, [data-inline-comment-actions-menu], [data-radix-popper-content-wrapper]'
|
|
12770
|
-
) : !1, js =
|
|
12771
|
+
) : !1, js = bt(({ floatingCardId: e, isHidden: t, isFocused: n, onFocus: s, children: o }, i) => /* @__PURE__ */ r(
|
|
12771
12772
|
"div",
|
|
12772
12773
|
{
|
|
12773
12774
|
ref: i,
|
|
@@ -12794,7 +12795,7 @@ const X0 = ({
|
|
|
12794
12795
|
isHidden: t,
|
|
12795
12796
|
registerCardNode: n
|
|
12796
12797
|
}) => {
|
|
12797
|
-
const s = z((d) => d.focusFloatingCard), o = z((d) => d.inlineDrafts[e.draftId]), i = z((d) => d.username), a = z((d) => d.isConnected), l = F(null), c =
|
|
12798
|
+
const s = z((d) => d.focusFloatingCard), o = z((d) => d.inlineDrafts[e.draftId]), i = z((d) => d.username), a = z((d) => d.isConnected), l = F(null), c = en(i), u = M(
|
|
12798
12799
|
(d) => {
|
|
12799
12800
|
l.current = d, n(e.floatingCardId, d);
|
|
12800
12801
|
},
|
|
@@ -12822,9 +12823,9 @@ const X0 = ({
|
|
|
12822
12823
|
children: a ? /* @__PURE__ */ v(nt, { children: [
|
|
12823
12824
|
/* @__PURE__ */ v("div", { className: "flex justify-start items-center gap-2 color-border-default px-3 pb-2 pt-3", children: [
|
|
12824
12825
|
/* @__PURE__ */ r(
|
|
12825
|
-
|
|
12826
|
+
Jt,
|
|
12826
12827
|
{
|
|
12827
|
-
src: c.isEns ?
|
|
12828
|
+
src: c.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
12828
12829
|
c.name
|
|
12829
12830
|
)}`,
|
|
12830
12831
|
size: "sm",
|
|
@@ -12862,7 +12863,7 @@ const X0 = ({
|
|
|
12862
12863
|
a.current && ut(a.current);
|
|
12863
12864
|
}, [e == null ? void 0 : e.text]), /* @__PURE__ */ v("div", { className: "flex flex-col gap-3 p-3 pb-0 pt-0", children: [
|
|
12864
12865
|
/* @__PURE__ */ r("div", { className: "border flex px-[12px] py-[8px] gap-[8px] rounded-[4px]", children: /* @__PURE__ */ r(
|
|
12865
|
-
|
|
12866
|
+
Nn,
|
|
12866
12867
|
{
|
|
12867
12868
|
ref: a,
|
|
12868
12869
|
value: e.text,
|
|
@@ -12905,7 +12906,7 @@ const X0 = ({
|
|
|
12905
12906
|
isHidden: t,
|
|
12906
12907
|
registerCardNode: n
|
|
12907
12908
|
}) => {
|
|
12908
|
-
const s = z((y) => y.focusFloatingCard), o = z((y) => y.submitDraft), i = z((y) => y.discardDraft), a = z((y) => y.isConnected), l = !!e.selectedText, c = !!e.insertedText, u = !!e.linkHref, d = l || c || u, h = z((y) => y.username), m =
|
|
12909
|
+
const s = z((y) => y.focusFloatingCard), o = z((y) => y.submitDraft), i = z((y) => y.discardDraft), a = z((y) => y.isConnected), l = !!e.selectedText, c = !!e.insertedText, u = !!e.linkHref, d = l || c || u, h = z((y) => y.username), m = en(h), p = M(() => {
|
|
12909
12910
|
o(e.suggestionId);
|
|
12910
12911
|
}, [e.suggestionId, o]), { submitLabel: f } = oc({
|
|
12911
12912
|
suggestionId: e.suggestionId,
|
|
@@ -12928,9 +12929,9 @@ const X0 = ({
|
|
|
12928
12929
|
children: a ? /* @__PURE__ */ v("div", { className: "flex flex-col gap-2 p-3 pb-0", children: [
|
|
12929
12930
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
12930
12931
|
/* @__PURE__ */ r(
|
|
12931
|
-
|
|
12932
|
+
Jt,
|
|
12932
12933
|
{
|
|
12933
|
-
src: m.isEns ?
|
|
12934
|
+
src: m.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
12934
12935
|
m.name
|
|
12935
12936
|
)}`,
|
|
12936
12937
|
size: "sm",
|
|
@@ -13052,12 +13053,12 @@ const X0 = ({
|
|
|
13052
13053
|
onAccept: i,
|
|
13053
13054
|
onReject: a
|
|
13054
13055
|
}) => {
|
|
13055
|
-
const l =
|
|
13056
|
+
const l = en(e);
|
|
13056
13057
|
return /* @__PURE__ */ v("div", { className: "flex items-center gap-2", children: [
|
|
13057
13058
|
/* @__PURE__ */ r(
|
|
13058
|
-
|
|
13059
|
+
Jt,
|
|
13059
13060
|
{
|
|
13060
|
-
src: l.isEns ?
|
|
13061
|
+
src: l.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
13061
13062
|
l.name
|
|
13062
13063
|
)}`,
|
|
13063
13064
|
size: "sm",
|
|
@@ -13159,7 +13160,7 @@ const X0 = ({
|
|
|
13159
13160
|
thread: e,
|
|
13160
13161
|
comment: t
|
|
13161
13162
|
}) => {
|
|
13162
|
-
const n = z((g) => g.username), s = z((g) => g.isConnected), o = z((g) => g.handleAddReply), i = z((g) => g.setCommentDrawerOpen), [a, l] = Y(""), [c, u] = Y(!1), d = F(null), h = !t.resolved && !t.deleted, m = !!a.trim(), p = s && (e.isFocused || m), f =
|
|
13163
|
+
const n = z((g) => g.username), s = z((g) => g.isConnected), o = z((g) => g.handleAddReply), i = z((g) => g.setCommentDrawerOpen), [a, l] = Y(""), [c, u] = Y(!1), d = F(null), h = !t.resolved && !t.deleted, m = !!a.trim(), p = s && (e.isFocused || m), f = en(n);
|
|
13163
13164
|
j(() => {
|
|
13164
13165
|
d.current && ut(d.current);
|
|
13165
13166
|
}, [a]);
|
|
@@ -13182,16 +13183,16 @@ const X0 = ({
|
|
|
13182
13183
|
),
|
|
13183
13184
|
children: [
|
|
13184
13185
|
/* @__PURE__ */ r(
|
|
13185
|
-
|
|
13186
|
+
Jt,
|
|
13186
13187
|
{
|
|
13187
|
-
src: f.isEns ?
|
|
13188
|
+
src: f.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
13188
13189
|
f.name || ""
|
|
13189
13190
|
)}`,
|
|
13190
13191
|
className: "w-[16px] h-[16px]"
|
|
13191
13192
|
}
|
|
13192
13193
|
),
|
|
13193
13194
|
/* @__PURE__ */ r(
|
|
13194
|
-
|
|
13195
|
+
Nn,
|
|
13195
13196
|
{
|
|
13196
13197
|
ref: d,
|
|
13197
13198
|
value: a,
|
|
@@ -13317,7 +13318,7 @@ const X0 = ({
|
|
|
13317
13318
|
comment: e,
|
|
13318
13319
|
thread: t
|
|
13319
13320
|
}) => {
|
|
13320
|
-
const n = z((b) => b.username), [s, o] = Y(!1), i = !(e != null && e.resolved) && !!e, a = z((b) => b.setCommentDrawerOpen), l = z((b) => b.handleAddReply), c = z((b) => b.editRequest), u = z((b) => b.clearEditRequest), d = z((b) => b.replyEditTarget), h = z((b) => b.setReplyEditTarget), m = z((b) => b.cancelReplyEdit), p = z((b) => b.editCompletion), f = z((b) => b.editCommentContent), x = z((b) => b.editReplyContent), g = F(null), [y, A] = Y(""), E = z((b) => b.isConnected), k =
|
|
13321
|
+
const n = z((b) => b.username), [s, o] = Y(!1), i = !(e != null && e.resolved) && !!e, a = z((b) => b.setCommentDrawerOpen), l = z((b) => b.handleAddReply), c = z((b) => b.editRequest), u = z((b) => b.clearEditRequest), d = z((b) => b.replyEditTarget), h = z((b) => b.setReplyEditTarget), m = z((b) => b.cancelReplyEdit), p = z((b) => b.editCompletion), f = z((b) => b.editCommentContent), x = z((b) => b.editReplyContent), g = F(null), [y, A] = Y(""), E = z((b) => b.isConnected), k = en(n), R = () => {
|
|
13321
13322
|
if (!(!t.commentId || !y.trim())) {
|
|
13322
13323
|
if (!E) {
|
|
13323
13324
|
a == null || a(!0);
|
|
@@ -13357,16 +13358,16 @@ const X0 = ({
|
|
|
13357
13358
|
),
|
|
13358
13359
|
children: [
|
|
13359
13360
|
/* @__PURE__ */ r(
|
|
13360
|
-
|
|
13361
|
+
Jt,
|
|
13361
13362
|
{
|
|
13362
|
-
src: k.isEns ?
|
|
13363
|
+
src: k.isEns ? Ht : `https://api.dicebear.com/9.x/identicon/svg?seed=${encodeURIComponent(
|
|
13363
13364
|
k.name
|
|
13364
13365
|
)}`,
|
|
13365
13366
|
className: "w-[16px] h-[16px]"
|
|
13366
13367
|
}
|
|
13367
13368
|
),
|
|
13368
13369
|
/* @__PURE__ */ r(
|
|
13369
|
-
|
|
13370
|
+
Nn,
|
|
13370
13371
|
{
|
|
13371
13372
|
ref: g,
|
|
13372
13373
|
value: y,
|
|
@@ -13559,7 +13560,7 @@ const X0 = ({
|
|
|
13559
13560
|
children: [
|
|
13560
13561
|
/* @__PURE__ */ r("span", { className: "truncate", children: e.textContent }),
|
|
13561
13562
|
/* @__PURE__ */ r(
|
|
13562
|
-
|
|
13563
|
+
Ge,
|
|
13563
13564
|
{
|
|
13564
13565
|
text: l ? "Heading link copied" : "Copy heading link",
|
|
13565
13566
|
position: "right",
|
|
@@ -13590,7 +13591,7 @@ const ac = Ro(() => /* @__PURE__ */ r("p", { className: "text-helper-text-sm px-
|
|
|
13590
13591
|
ac.displayName = "ToCEmptyState";
|
|
13591
13592
|
const lc = Ro(
|
|
13592
13593
|
({ items: e = [], editor: t, setItems: n, orientation: s }) => {
|
|
13593
|
-
const [o, i] = Y(null), a =
|
|
13594
|
+
const [o, i] = Y(null), a = wt("(max-width: 1280px)"), l = wt("(min-width: 1280px)"), c = F(null), u = F(0), d = F(null), h = ve(() => e.map((y) => ({
|
|
13594
13595
|
...y,
|
|
13595
13596
|
isActive: Bn(y.id) && y.id === o
|
|
13596
13597
|
})), [e, o]), m = M(() => {
|
|
@@ -13674,7 +13675,7 @@ const lc = Ro(
|
|
|
13674
13675
|
const C = setTimeout(() => {
|
|
13675
13676
|
const T = t.view.posAtDOM(R, 0), S = t.view.state.tr;
|
|
13676
13677
|
S.setSelection(new Es(S.doc.resolve(T))), t.view.dispatch(S);
|
|
13677
|
-
const w =
|
|
13678
|
+
const w = Sn({
|
|
13678
13679
|
targetElement: R,
|
|
13679
13680
|
editorRoot: t.view.dom
|
|
13680
13681
|
});
|
|
@@ -13728,7 +13729,7 @@ const lc = Ro(
|
|
|
13728
13729
|
}
|
|
13729
13730
|
);
|
|
13730
13731
|
lc.displayName = "ToC";
|
|
13731
|
-
const No =
|
|
13732
|
+
const No = Ze.memo(lc), Ar = ({
|
|
13732
13733
|
emoji: e,
|
|
13733
13734
|
setEmoji: t,
|
|
13734
13735
|
isEditing: n,
|
|
@@ -13845,7 +13846,7 @@ const No = Qe.memo(lc), Ar = ({
|
|
|
13845
13846
|
ref: (x) => {
|
|
13846
13847
|
c.current = x;
|
|
13847
13848
|
},
|
|
13848
|
-
children: /* @__PURE__ */ r(
|
|
13849
|
+
children: /* @__PURE__ */ r(Ge, { position: "top", text: "Choose emoji", children: /* @__PURE__ */ r(
|
|
13849
13850
|
he,
|
|
13850
13851
|
{
|
|
13851
13852
|
onClick: () => {
|
|
@@ -14288,7 +14289,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14288
14289
|
}
|
|
14289
14290
|
),
|
|
14290
14291
|
e ? /* @__PURE__ */ r(
|
|
14291
|
-
|
|
14292
|
+
Qt,
|
|
14292
14293
|
{
|
|
14293
14294
|
"data-testid": "tab-rename-input",
|
|
14294
14295
|
ref: W,
|
|
@@ -14309,7 +14310,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14309
14310
|
},
|
|
14310
14311
|
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))]"
|
|
14311
14312
|
}
|
|
14312
|
-
) : /* @__PURE__ */ r("div", { className: "min-w-0 flex [&>*]:w-full", children: /* @__PURE__ */ r(
|
|
14313
|
+
) : /* @__PURE__ */ r("div", { className: "min-w-0 flex [&>*]:w-full", children: /* @__PURE__ */ r(Ge, { text: Q, position: "bottom", children: /* @__PURE__ */ r(
|
|
14313
14314
|
"span",
|
|
14314
14315
|
{
|
|
14315
14316
|
"data-testid": `tab-name-${n}`,
|
|
@@ -14394,7 +14395,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14394
14395
|
onMouseEnter: () => n(!0),
|
|
14395
14396
|
onMouseLeave: () => n(!1),
|
|
14396
14397
|
className: "[&_[data-testid='tooltip-trigger']]:w-full [&_[data-testid='tooltip-trigger']]:block",
|
|
14397
|
-
children: /* @__PURE__ */ r(
|
|
14398
|
+
children: /* @__PURE__ */ r(Ge, { text: e.tooltipText, position: "top", open: t, children: o })
|
|
14398
14399
|
}
|
|
14399
14400
|
) : o;
|
|
14400
14401
|
}, dc = ({
|
|
@@ -14598,7 +14599,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14598
14599
|
} : { title: void 0, text: void 0 }, wg = 24, bg = ({
|
|
14599
14600
|
tabSectionContainer: e,
|
|
14600
14601
|
...t
|
|
14601
|
-
}) => !e && t.isVersionHistoryMode ? null : e ?
|
|
14602
|
+
}) => !e && t.isVersionHistoryMode ? null : e ? Tn(/* @__PURE__ */ r(Aa, { ...t }), e) : /* @__PURE__ */ r(Aa, { ...t }), Aa = ({
|
|
14602
14603
|
tabs: e,
|
|
14603
14604
|
activeTabId: t,
|
|
14604
14605
|
setActiveTabId: n,
|
|
@@ -14771,7 +14772,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14771
14772
|
),
|
|
14772
14773
|
children: [
|
|
14773
14774
|
(!R || s) && /* @__PURE__ */ r(
|
|
14774
|
-
|
|
14775
|
+
Ge,
|
|
14775
14776
|
{
|
|
14776
14777
|
text: s ? "Hide tabs and outlines" : "Show tabs and outlines",
|
|
14777
14778
|
position: "right",
|
|
@@ -14991,7 +14992,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
14991
14992
|
) }),
|
|
14992
14993
|
/* @__PURE__ */ r(Kr, { className: "border-b px-4 py-3", children: /* @__PURE__ */ r(jr, { children: /* @__PURE__ */ r("p", { className: "text-heading-sm", children: "Rename tab" }) }) }),
|
|
14993
14994
|
/* @__PURE__ */ r("div", { className: "space-x-md", children: /* @__PURE__ */ r(
|
|
14994
|
-
|
|
14995
|
+
Qt,
|
|
14995
14996
|
{
|
|
14996
14997
|
"data-testid": "tab-rename-modal-input",
|
|
14997
14998
|
autoFocus: !0,
|
|
@@ -15417,7 +15418,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15417
15418
|
]
|
|
15418
15419
|
}
|
|
15419
15420
|
);
|
|
15420
|
-
return H ? k ?
|
|
15421
|
+
return H ? k ? Tn(U, k) : null : U;
|
|
15421
15422
|
}, Ng = ({
|
|
15422
15423
|
editor: e,
|
|
15423
15424
|
hasToC: t,
|
|
@@ -15427,7 +15428,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15427
15428
|
setShowTOC: i,
|
|
15428
15429
|
orientation: a
|
|
15429
15430
|
}) => {
|
|
15430
|
-
const l =
|
|
15431
|
+
const l = wt("(max-width:1280px)"), c = n.length < 2;
|
|
15431
15432
|
return l ? /* @__PURE__ */ r(
|
|
15432
15433
|
Ph,
|
|
15433
15434
|
{
|
|
@@ -15461,7 +15462,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15461
15462
|
),
|
|
15462
15463
|
children: [
|
|
15463
15464
|
/* @__PURE__ */ r(
|
|
15464
|
-
|
|
15465
|
+
Ge,
|
|
15465
15466
|
{
|
|
15466
15467
|
text: o ? "Hide document outline" : "Show document outline",
|
|
15467
15468
|
position: "right",
|
|
@@ -15528,7 +15529,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15528
15529
|
tabPanelSlot: b,
|
|
15529
15530
|
ddocId: N
|
|
15530
15531
|
}) => {
|
|
15531
|
-
const I =
|
|
15532
|
+
const I = wt("(max-width:1280px)");
|
|
15532
15533
|
return c.length ? !I || E ? /* @__PURE__ */ r(
|
|
15533
15534
|
bg,
|
|
15534
15535
|
{
|
|
@@ -15605,7 +15606,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15605
15606
|
animate: { opacity: 1 },
|
|
15606
15607
|
exit: { opacity: 0 }
|
|
15607
15608
|
}, pc = (e, t) => /* @__PURE__ */ r(
|
|
15608
|
-
|
|
15609
|
+
Ut.div,
|
|
15609
15610
|
{
|
|
15610
15611
|
variants: Tg,
|
|
15611
15612
|
initial: "initial",
|
|
@@ -15620,7 +15621,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15620
15621
|
animate: { y: 0, opacity: 1 },
|
|
15621
15622
|
exit: { y: -10, opacity: 0 }
|
|
15622
15623
|
}, fc = (e, t) => /* @__PURE__ */ r(
|
|
15623
|
-
|
|
15624
|
+
Ut.div,
|
|
15624
15625
|
{
|
|
15625
15626
|
variants: Eg,
|
|
15626
15627
|
initial: "initial",
|
|
@@ -15635,7 +15636,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15635
15636
|
className: t,
|
|
15636
15637
|
children: n
|
|
15637
15638
|
}) => /* @__PURE__ */ r(
|
|
15638
|
-
|
|
15639
|
+
Ut.div,
|
|
15639
15640
|
{
|
|
15640
15641
|
initial: !1,
|
|
15641
15642
|
animate: { opacity: e ? 1 : 0 },
|
|
@@ -15643,7 +15644,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15643
15644
|
className: ye(t, !e && "invisible pointer-events-none"),
|
|
15644
15645
|
children: n
|
|
15645
15646
|
}
|
|
15646
|
-
), Ag = "h-6 bg-gradient-to-r [--from:210,_17%,_98%,_1] [--to:0,_0%,_93%,_1] dark:[--from:0,0%,16%,1] dark:[--to:0,0%,12%,1] from-[hsl(var(--from))] to-[hsl(var(--to))]",
|
|
15647
|
+
), Ag = "h-6 bg-gradient-to-r [--from:210,_17%,_98%,_1] [--to:0,_0%,_93%,_1] dark:[--from:0,0%,16%,1] dark:[--to:0,0%,12%,1] from-[hsl(var(--from))] to-[hsl(var(--to))]", Bt = ({ className: e }) => /* @__PURE__ */ r("div", { className: ae(Ag, e) }), gc = () => /* @__PURE__ */ r("div", { className: "flex flex-col gap-8", children: /* @__PURE__ */ v(
|
|
15647
15648
|
Xh,
|
|
15648
15649
|
{
|
|
15649
15650
|
transition: {
|
|
@@ -15653,47 +15654,47 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15653
15654
|
},
|
|
15654
15655
|
children: [
|
|
15655
15656
|
/* @__PURE__ */ v(
|
|
15656
|
-
|
|
15657
|
+
Ut.div,
|
|
15657
15658
|
{
|
|
15658
15659
|
className: "space-y-4",
|
|
15659
15660
|
animate: {
|
|
15660
15661
|
opacity: [0.4, 1, 1, 1, 0.4]
|
|
15661
15662
|
},
|
|
15662
15663
|
children: [
|
|
15663
|
-
/* @__PURE__ */ r(
|
|
15664
|
-
/* @__PURE__ */ r(
|
|
15665
|
-
/* @__PURE__ */ r(
|
|
15666
|
-
/* @__PURE__ */ r(
|
|
15664
|
+
/* @__PURE__ */ r(Bt, { className: "h-10" }),
|
|
15665
|
+
/* @__PURE__ */ r(Bt, { className: "w-[77.54%]" }),
|
|
15666
|
+
/* @__PURE__ */ r(Bt, { className: "w-[83.62%]" }),
|
|
15667
|
+
/* @__PURE__ */ r(Bt, { className: "w-[51.01%]" })
|
|
15667
15668
|
]
|
|
15668
15669
|
}
|
|
15669
15670
|
),
|
|
15670
15671
|
/* @__PURE__ */ v(
|
|
15671
|
-
|
|
15672
|
+
Ut.div,
|
|
15672
15673
|
{
|
|
15673
15674
|
className: "space-y-4",
|
|
15674
15675
|
animate: {
|
|
15675
15676
|
opacity: [0.2, 0.4, 1, 1, 0.2]
|
|
15676
15677
|
},
|
|
15677
15678
|
children: [
|
|
15678
|
-
/* @__PURE__ */ r(
|
|
15679
|
-
/* @__PURE__ */ r(
|
|
15680
|
-
/* @__PURE__ */ r(
|
|
15681
|
-
/* @__PURE__ */ r(
|
|
15679
|
+
/* @__PURE__ */ r(Bt, { className: "w-[83.62%]" }),
|
|
15680
|
+
/* @__PURE__ */ r(Bt, { className: "w-[90.43%]" }),
|
|
15681
|
+
/* @__PURE__ */ r(Bt, { className: "w-[77.54%]" }),
|
|
15682
|
+
/* @__PURE__ */ r(Bt, { className: "w-[72.75%]" })
|
|
15682
15683
|
]
|
|
15683
15684
|
}
|
|
15684
15685
|
),
|
|
15685
15686
|
/* @__PURE__ */ v(
|
|
15686
|
-
|
|
15687
|
+
Ut.div,
|
|
15687
15688
|
{
|
|
15688
15689
|
className: "space-y-4",
|
|
15689
15690
|
animate: {
|
|
15690
15691
|
opacity: [0.1, 0.2, 0.4, 1, 0.1]
|
|
15691
15692
|
},
|
|
15692
15693
|
children: [
|
|
15693
|
-
/* @__PURE__ */ r(
|
|
15694
|
-
/* @__PURE__ */ r(
|
|
15695
|
-
/* @__PURE__ */ r(
|
|
15696
|
-
/* @__PURE__ */ r(
|
|
15694
|
+
/* @__PURE__ */ r(Bt, { className: "w-[83.62%]" }),
|
|
15695
|
+
/* @__PURE__ */ r(Bt, { className: "w-[90.43%]" }),
|
|
15696
|
+
/* @__PURE__ */ r(Bt, { className: "w-[77.54%]" }),
|
|
15697
|
+
/* @__PURE__ */ r(Bt, { className: "w-[72.75%]" })
|
|
15697
15698
|
]
|
|
15698
15699
|
}
|
|
15699
15700
|
)
|
|
@@ -15865,7 +15866,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15865
15866
|
}
|
|
15866
15867
|
),
|
|
15867
15868
|
/* @__PURE__ */ r(
|
|
15868
|
-
|
|
15869
|
+
Qt,
|
|
15869
15870
|
{
|
|
15870
15871
|
type: "number",
|
|
15871
15872
|
id: "lineHeight",
|
|
@@ -15895,7 +15896,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15895
15896
|
}
|
|
15896
15897
|
),
|
|
15897
15898
|
/* @__PURE__ */ r(
|
|
15898
|
-
|
|
15899
|
+
Qt,
|
|
15899
15900
|
{
|
|
15900
15901
|
type: "number",
|
|
15901
15902
|
min: 0,
|
|
@@ -15927,7 +15928,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
15927
15928
|
}
|
|
15928
15929
|
),
|
|
15929
15930
|
/* @__PURE__ */ r(
|
|
15930
|
-
|
|
15931
|
+
Qt,
|
|
15931
15932
|
{
|
|
15932
15933
|
type: "number",
|
|
15933
15934
|
id: "spaceAfter",
|
|
@@ -16098,7 +16099,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
16098
16099
|
"zoom-levels"
|
|
16099
16100
|
),
|
|
16100
16101
|
/* @__PURE__ */ r(
|
|
16101
|
-
|
|
16102
|
+
Ge,
|
|
16102
16103
|
{
|
|
16103
16104
|
text: n ? "Hide tabs and outlines sidebar" : "Show tabs and outlines sidebar",
|
|
16104
16105
|
position: "bottom",
|
|
@@ -16115,7 +16116,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
16115
16116
|
)
|
|
16116
16117
|
}
|
|
16117
16118
|
),
|
|
16118
|
-
/* @__PURE__ */ r(
|
|
16119
|
+
/* @__PURE__ */ r(Ge, { text: "Exit focus mode", children: /* @__PURE__ */ r(
|
|
16119
16120
|
be,
|
|
16120
16121
|
{
|
|
16121
16122
|
icon: "Minimize",
|
|
@@ -18913,7 +18914,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18913
18914
|
type: "text",
|
|
18914
18915
|
text: e,
|
|
18915
18916
|
...t ? { marks: t } : {}
|
|
18916
|
-
}),
|
|
18917
|
+
}), Ot = (e) => ({
|
|
18917
18918
|
type: "paragraph",
|
|
18918
18919
|
attrs: { textAlign: "left" },
|
|
18919
18920
|
content: e
|
|
@@ -18921,12 +18922,12 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18921
18922
|
type: "heading",
|
|
18922
18923
|
attrs: { textAlign: "left", level: e },
|
|
18923
18924
|
content: t
|
|
18924
|
-
}),
|
|
18925
|
+
}), et = (e) => ({
|
|
18925
18926
|
type: "dBlock",
|
|
18926
18927
|
content: [e]
|
|
18927
18928
|
}), Le = (e) => Be(e, [{ type: "bold" }]), $e = (e) => Be(e, [{ type: "italic" }]), Hg = (e) => ({
|
|
18928
18929
|
type: "listItem",
|
|
18929
|
-
content: [
|
|
18930
|
+
content: [Ot(e)]
|
|
18930
18931
|
}), ts = (e) => ({
|
|
18931
18932
|
type: "bulletList",
|
|
18932
18933
|
attrs: { tight: !0 },
|
|
@@ -18934,7 +18935,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18934
18935
|
}), zg = {
|
|
18935
18936
|
type: "doc",
|
|
18936
18937
|
content: [
|
|
18937
|
-
|
|
18938
|
+
et(
|
|
18938
18939
|
_n(1, [
|
|
18939
18940
|
Be("Fanfic Planner ⋆⁺₊✧", [
|
|
18940
18941
|
{
|
|
@@ -18944,10 +18945,10 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18944
18945
|
])
|
|
18945
18946
|
])
|
|
18946
18947
|
),
|
|
18947
|
-
|
|
18948
|
+
et({
|
|
18948
18949
|
type: "callout",
|
|
18949
18950
|
content: [
|
|
18950
|
-
|
|
18951
|
+
Ot([
|
|
18951
18952
|
Be("✨ "),
|
|
18952
18953
|
Le("Welcome dear writer!"),
|
|
18953
18954
|
Be(
|
|
@@ -18956,9 +18957,9 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18956
18957
|
])
|
|
18957
18958
|
]
|
|
18958
18959
|
}),
|
|
18959
|
-
|
|
18960
|
-
|
|
18961
|
-
|
|
18960
|
+
et(Ot([])),
|
|
18961
|
+
et(_n(1, [Be("☾ Ship Basis")])),
|
|
18962
|
+
et(
|
|
18962
18963
|
ts([
|
|
18963
18964
|
[Le("Title"), Be(":")],
|
|
18964
18965
|
[Le("Fandom:")],
|
|
@@ -18970,21 +18971,21 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18970
18971
|
[Le("Length:")]
|
|
18971
18972
|
])
|
|
18972
18973
|
),
|
|
18973
|
-
|
|
18974
|
-
|
|
18975
|
-
|
|
18974
|
+
et(_n(3, [Be("Premise")])),
|
|
18975
|
+
et(
|
|
18976
|
+
Ot([$e("[The idea that made you open this cute dDoc]")])
|
|
18976
18977
|
),
|
|
18977
|
-
|
|
18978
|
-
|
|
18979
|
-
|
|
18978
|
+
et(_n(3, [Be("Summary")])),
|
|
18979
|
+
et(
|
|
18980
|
+
Ot([$e("[A little spicy blurb to hook your readers in]")])
|
|
18980
18981
|
)
|
|
18981
18982
|
]
|
|
18982
18983
|
}, Kg = {
|
|
18983
18984
|
type: "doc",
|
|
18984
18985
|
content: [
|
|
18985
|
-
|
|
18986
|
-
|
|
18987
|
-
|
|
18986
|
+
et(_n(1, [Be("★Plot & outline")])),
|
|
18987
|
+
et(
|
|
18988
|
+
Ot([
|
|
18988
18989
|
Le("Brain dump"),
|
|
18989
18990
|
Be(" "),
|
|
18990
18991
|
$e(
|
|
@@ -18992,8 +18993,8 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
18992
18993
|
)
|
|
18993
18994
|
])
|
|
18994
18995
|
),
|
|
18995
|
-
|
|
18996
|
-
|
|
18996
|
+
et(Ot([Le("The spine")])),
|
|
18997
|
+
et(
|
|
18997
18998
|
ts([
|
|
18998
18999
|
[
|
|
18999
19000
|
Le("Hook"),
|
|
@@ -19014,8 +19015,8 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19014
19015
|
]
|
|
19015
19016
|
])
|
|
19016
19017
|
),
|
|
19017
|
-
|
|
19018
|
-
|
|
19018
|
+
et(Ot([Le("The skeleton")])),
|
|
19019
|
+
et(
|
|
19019
19020
|
ts([
|
|
19020
19021
|
[
|
|
19021
19022
|
Le("Beginning"),
|
|
@@ -19034,8 +19035,8 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19034
19035
|
]
|
|
19035
19036
|
])
|
|
19036
19037
|
),
|
|
19037
|
-
|
|
19038
|
-
|
|
19038
|
+
et(
|
|
19039
|
+
Ot([
|
|
19039
19040
|
Le("Scenes in order"),
|
|
19040
19041
|
Be(" "),
|
|
19041
19042
|
$e(
|
|
@@ -19043,14 +19044,14 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19043
19044
|
)
|
|
19044
19045
|
])
|
|
19045
19046
|
),
|
|
19046
|
-
|
|
19047
|
-
|
|
19047
|
+
et(
|
|
19048
|
+
Ot([
|
|
19048
19049
|
Le("Chapter breakdown"),
|
|
19049
19050
|
Be(" "),
|
|
19050
19051
|
$e("(if multichap)")
|
|
19051
19052
|
])
|
|
19052
19053
|
),
|
|
19053
|
-
|
|
19054
|
+
et(
|
|
19054
19055
|
ts([
|
|
19055
19056
|
[Le("Chapter 1"), Be(": "), $e("[beat + hook]")],
|
|
19056
19057
|
[Le("Chapter 2"), Be(": "), $e("[beat + hook]")]
|
|
@@ -19060,9 +19061,9 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19060
19061
|
}, jg = {
|
|
19061
19062
|
type: "doc",
|
|
19062
19063
|
content: [
|
|
19063
|
-
|
|
19064
|
-
|
|
19065
|
-
|
|
19064
|
+
et(_n(1, [Be("𖠋 Characters")])),
|
|
19065
|
+
et(Ot([$e("[Copy this block for each character]")])),
|
|
19066
|
+
et(
|
|
19066
19067
|
ts([
|
|
19067
19068
|
[Le("name / role"), Be(":")],
|
|
19068
19069
|
[
|
|
@@ -19108,15 +19109,15 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19108
19109
|
}, Vg = {
|
|
19109
19110
|
type: "doc",
|
|
19110
19111
|
content: [
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
|
|
19112
|
+
et(_n(1, [Be("꩜ World & Canon")])),
|
|
19113
|
+
et(
|
|
19114
|
+
Ot([
|
|
19114
19115
|
$e(
|
|
19115
19116
|
"[for AUs, canon-divergence, and fix-its. Skip if canon-compliant]"
|
|
19116
19117
|
)
|
|
19117
19118
|
])
|
|
19118
19119
|
),
|
|
19119
|
-
|
|
19120
|
+
et(
|
|
19120
19121
|
ts([
|
|
19121
19122
|
[
|
|
19122
19123
|
Le("Divergence"),
|
|
@@ -19236,7 +19237,7 @@ const mg = "space-xsm gap-xsm hover:color-bg-default-hover cursor-pointer h-[30p
|
|
|
19236
19237
|
u
|
|
19237
19238
|
)),
|
|
19238
19239
|
/* @__PURE__ */ r(
|
|
19239
|
-
|
|
19240
|
+
vt,
|
|
19240
19241
|
{
|
|
19241
19242
|
align: "end",
|
|
19242
19243
|
sideOffset: 10,
|
|
@@ -19321,9 +19322,9 @@ var Xg = class wc {
|
|
|
19321
19322
|
}
|
|
19322
19323
|
resolve(t) {
|
|
19323
19324
|
const n = t.resolve(this.anchor), s = t.resolve(this.head);
|
|
19324
|
-
return new
|
|
19325
|
+
return new pn(n, s);
|
|
19325
19326
|
}
|
|
19326
|
-
},
|
|
19327
|
+
}, pn = class vn extends Zu {
|
|
19327
19328
|
constructor(t, n, s, o = 1) {
|
|
19328
19329
|
const { doc: i } = t, a = t === n, l = t.pos === i.content.size && n.pos === i.content.size, c = a && !l ? i.resolve(n.pos + (o > 0 ? 1 : -1)) : n, u = a && l ? i.resolve(t.pos - (o > 0 ? 1 : -1)) : t, d = Bo(u.min(c), u.max(c), s), h = c.pos >= t.pos ? d[0].$from : d[d.length - 1].$to, m = c.pos >= t.pos ? d[d.length - 1].$to : d[0].$from;
|
|
19329
19330
|
super(h, m, d), this.depth = s;
|
|
@@ -19334,11 +19335,11 @@ var Xg = class wc {
|
|
|
19334
19335
|
return this.ranges[this.ranges.length - 1].$to;
|
|
19335
19336
|
}
|
|
19336
19337
|
eq(t) {
|
|
19337
|
-
return t instanceof
|
|
19338
|
+
return t instanceof vn && t.$from.pos === this.$from.pos && t.$to.pos === this.$to.pos;
|
|
19338
19339
|
}
|
|
19339
19340
|
map(t, n) {
|
|
19340
19341
|
const s = t.resolve(n.map(this.anchor)), o = t.resolve(n.map(this.head));
|
|
19341
|
-
return new
|
|
19342
|
+
return new vn(s, o);
|
|
19342
19343
|
}
|
|
19343
19344
|
toJSON() {
|
|
19344
19345
|
return {
|
|
@@ -19357,22 +19358,22 @@ var Xg = class wc {
|
|
|
19357
19358
|
const { doc: t } = this.$from;
|
|
19358
19359
|
if (this.isForwards && this.ranges.length > 1) {
|
|
19359
19360
|
const o = this.ranges.slice(0, -1), i = o[0].$from, a = o[o.length - 1].$to;
|
|
19360
|
-
return new
|
|
19361
|
+
return new vn(i, a, this.depth);
|
|
19361
19362
|
}
|
|
19362
19363
|
const n = this.ranges[0], s = t.resolve(Math.max(0, n.$from.pos - 1));
|
|
19363
|
-
return new
|
|
19364
|
+
return new vn(this.$anchor, s, this.depth);
|
|
19364
19365
|
}
|
|
19365
19366
|
extendForwards() {
|
|
19366
19367
|
const { doc: t } = this.$from;
|
|
19367
19368
|
if (this.isBackwards && this.ranges.length > 1) {
|
|
19368
19369
|
const o = this.ranges.slice(1), i = o[0].$from, a = o[o.length - 1].$to;
|
|
19369
|
-
return new
|
|
19370
|
+
return new vn(a, i, this.depth);
|
|
19370
19371
|
}
|
|
19371
19372
|
const n = this.ranges[this.ranges.length - 1], s = t.resolve(Math.min(t.content.size, n.$to.pos + 1));
|
|
19372
|
-
return new
|
|
19373
|
+
return new vn(this.$anchor, s, this.depth);
|
|
19373
19374
|
}
|
|
19374
19375
|
static fromJSON(t, n) {
|
|
19375
|
-
return new
|
|
19376
|
+
return new vn(t.resolve(n.anchor), t.resolve(n.head));
|
|
19376
19377
|
}
|
|
19377
19378
|
static create(t, n, s, o, i = 1) {
|
|
19378
19379
|
return new this(t.resolve(n), t.resolve(s), o, i);
|
|
@@ -19381,9 +19382,9 @@ var Xg = class wc {
|
|
|
19381
19382
|
return new Xg(this.anchor, this.head);
|
|
19382
19383
|
}
|
|
19383
19384
|
};
|
|
19384
|
-
|
|
19385
|
+
pn.prototype.visible = !1;
|
|
19385
19386
|
function co(e) {
|
|
19386
|
-
return e instanceof
|
|
19387
|
+
return e instanceof pn;
|
|
19387
19388
|
}
|
|
19388
19389
|
is.create({
|
|
19389
19390
|
name: "nodeRange",
|
|
@@ -19399,7 +19400,7 @@ is.create({
|
|
|
19399
19400
|
"Shift-ArrowUp": ({ editor: e }) => {
|
|
19400
19401
|
const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, selection: i, tr: a } = s, { anchor: l, head: c } = i;
|
|
19401
19402
|
if (!co(i)) {
|
|
19402
|
-
const d =
|
|
19403
|
+
const d = pn.create(o, l, c, t, -1);
|
|
19403
19404
|
return a.setSelection(d), n.dispatch(a), !0;
|
|
19404
19405
|
}
|
|
19405
19406
|
const u = i.extendBackwards();
|
|
@@ -19409,7 +19410,7 @@ is.create({
|
|
|
19409
19410
|
"Shift-ArrowDown": ({ editor: e }) => {
|
|
19410
19411
|
const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, selection: i, tr: a } = s, { anchor: l, head: c } = i;
|
|
19411
19412
|
if (!co(i)) {
|
|
19412
|
-
const d =
|
|
19413
|
+
const d = pn.create(o, l, c, t);
|
|
19413
19414
|
return a.setSelection(d), n.dispatch(a), !0;
|
|
19414
19415
|
}
|
|
19415
19416
|
const u = i.extendForwards();
|
|
@@ -19417,7 +19418,7 @@ is.create({
|
|
|
19417
19418
|
},
|
|
19418
19419
|
// add `NodeRangeSelection` to all nodes
|
|
19419
19420
|
"Mod-a": ({ editor: e }) => {
|
|
19420
|
-
const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, tr: i } = s, a =
|
|
19421
|
+
const { depth: t } = this.options, { view: n, state: s } = e, { doc: o, tr: i } = s, a = pn.create(o, 0, o.content.size, t);
|
|
19421
19422
|
return i.setSelection(a), n.dispatch(i), !0;
|
|
19422
19423
|
}
|
|
19423
19424
|
};
|
|
@@ -19445,7 +19446,7 @@ is.create({
|
|
|
19445
19446
|
const { state: h } = n, { doc: m, selection: p, tr: f } = h, { $anchor: x, $head: g } = p;
|
|
19446
19447
|
if (x.sameParent(g))
|
|
19447
19448
|
return;
|
|
19448
|
-
const y =
|
|
19449
|
+
const y = pn.create(m, x.pos, g.pos, this.options.depth);
|
|
19449
19450
|
f.setSelection(y), n.dispatch(f);
|
|
19450
19451
|
},
|
|
19451
19452
|
{ once: !0 }
|
|
@@ -19560,7 +19561,7 @@ function o2(e, t) {
|
|
|
19560
19561
|
const { empty: s, $from: o, $to: i } = n.state.selection, a = s2(e, t), l = Bo(o, i, 0), c = l.some((g) => a.find((y) => y.$from === g.$from && y.$to === g.$to)), u = s || !c ? a : l;
|
|
19561
19562
|
if (!u.length)
|
|
19562
19563
|
return;
|
|
19563
|
-
const { tr: d } = n.state, h = document.createElement("div"), m = u[0].$from.pos, p = u[u.length - 1].$to.pos, f =
|
|
19564
|
+
const { tr: d } = n.state, h = document.createElement("div"), m = u[0].$from.pos, p = u[u.length - 1].$to.pos, f = pn.create(n.state.doc, m, p), x = f.content();
|
|
19564
19565
|
u.forEach((g) => {
|
|
19565
19566
|
const y = n.nodeDOM(g.$from.pos), A = Zg(y);
|
|
19566
19567
|
h.append(A);
|
|
@@ -19857,8 +19858,8 @@ const l2 = (e, t) => {
|
|
|
19857
19858
|
copyNodeToClipboard: i,
|
|
19858
19859
|
deleteNode: a
|
|
19859
19860
|
};
|
|
19860
|
-
}, Ts =
|
|
19861
|
-
|
|
19861
|
+
}, Ts = Ze.memo(
|
|
19862
|
+
bt(({ onClick: e, icon: t, text: n, variant: s = "ghost", className: o = "" }, i) => /* @__PURE__ */ r(Io, { asChild: !0, children: /* @__PURE__ */ v(
|
|
19862
19863
|
Ne,
|
|
19863
19864
|
{
|
|
19864
19865
|
ref: i,
|
|
@@ -19873,8 +19874,8 @@ const l2 = (e, t) => {
|
|
|
19873
19874
|
) }))
|
|
19874
19875
|
);
|
|
19875
19876
|
Ts.displayName = "ActionButton";
|
|
19876
|
-
const Sc =
|
|
19877
|
-
|
|
19877
|
+
const Sc = Ze.memo(
|
|
19878
|
+
bt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
|
|
19878
19879
|
be,
|
|
19879
19880
|
{
|
|
19880
19881
|
icon: "GripVertical",
|
|
@@ -19891,8 +19892,8 @@ const Sc = Qe.memo(
|
|
|
19891
19892
|
))
|
|
19892
19893
|
);
|
|
19893
19894
|
Sc.displayName = "GripButton";
|
|
19894
|
-
const Nc =
|
|
19895
|
-
|
|
19895
|
+
const Nc = Ze.memo(
|
|
19896
|
+
bt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
|
|
19896
19897
|
be,
|
|
19897
19898
|
{
|
|
19898
19899
|
icon: "Plus",
|
|
@@ -19906,8 +19907,8 @@ const Nc = Qe.memo(
|
|
|
19906
19907
|
))
|
|
19907
19908
|
);
|
|
19908
19909
|
Nc.displayName = "PlusButton";
|
|
19909
|
-
const Tc =
|
|
19910
|
-
|
|
19910
|
+
const Tc = Ze.memo(
|
|
19911
|
+
bt(({ isCollapsed: e, onToggle: t, className: n, ...s }, o) => /* @__PURE__ */ r(
|
|
19911
19912
|
be,
|
|
19912
19913
|
{
|
|
19913
19914
|
variant: "ghost",
|
|
@@ -19922,8 +19923,8 @@ const Tc = Qe.memo(
|
|
|
19922
19923
|
))
|
|
19923
19924
|
);
|
|
19924
19925
|
Tc.displayName = "CollapseButton";
|
|
19925
|
-
const Ec =
|
|
19926
|
-
|
|
19926
|
+
const Ec = Ze.memo(
|
|
19927
|
+
bt(({ onClick: e, className: t, ...n }, s) => /* @__PURE__ */ r(
|
|
19927
19928
|
be,
|
|
19928
19929
|
{
|
|
19929
19930
|
variant: "ghost",
|
|
@@ -19938,14 +19939,14 @@ const Ec = Qe.memo(
|
|
|
19938
19939
|
))
|
|
19939
19940
|
);
|
|
19940
19941
|
Ec.displayName = "CopyLinkButton";
|
|
19941
|
-
const Ac =
|
|
19942
|
+
const Ac = bt(
|
|
19942
19943
|
// flex kills the inherited line-box height (24px) that otherwise makes
|
|
19943
19944
|
// this wrapper taller than the 20px grip button and top-aligns it 2px
|
|
19944
19945
|
// above its sibling buttons in the cluster row.
|
|
19945
19946
|
(e, t) => /* @__PURE__ */ r("div", { ref: t, className: "flex items-center", children: e.children })
|
|
19946
19947
|
);
|
|
19947
19948
|
Ac.displayName = "MenuTrigger";
|
|
19948
|
-
const c2 =
|
|
19949
|
+
const c2 = Ze.memo(
|
|
19949
19950
|
({ isOpen: e, onOpenChange: t, trigger: n, actions: s }) => /* @__PURE__ */ r(Tm, { onMountAutoFocus: (o) => o.preventDefault(), trapped: !1, children: /* @__PURE__ */ v(ls, { open: e, onOpenChange: t, children: [
|
|
19950
19951
|
/* @__PURE__ */ r(_s, { asChild: !0, children: /* @__PURE__ */ r(Ac, { children: n }) }),
|
|
19951
19952
|
/* @__PURE__ */ r(
|
|
@@ -20014,13 +20015,13 @@ const c2 = Qe.memo(
|
|
|
20014
20015
|
}
|
|
20015
20016
|
};
|
|
20016
20017
|
}
|
|
20017
|
-
}, Oo =
|
|
20018
|
+
}, Oo = Ze.memo(
|
|
20018
20019
|
({
|
|
20019
20020
|
text: e,
|
|
20020
20021
|
position: t = "bottom",
|
|
20021
20022
|
children: n
|
|
20022
|
-
}) => /* @__PURE__ */ r(
|
|
20023
|
-
), u2 =
|
|
20023
|
+
}) => /* @__PURE__ */ r(Ge, { text: e, position: t, asTriggerChild: !0, children: n })
|
|
20024
|
+
), u2 = Ze.memo(
|
|
20024
20025
|
({ children: e }) => /* @__PURE__ */ r(
|
|
20025
20026
|
Oo,
|
|
20026
20027
|
{
|
|
@@ -20032,7 +20033,7 @@ const c2 = Qe.memo(
|
|
|
20032
20033
|
children: e
|
|
20033
20034
|
}
|
|
20034
20035
|
)
|
|
20035
|
-
), h2 =
|
|
20036
|
+
), h2 = Ze.memo(
|
|
20036
20037
|
({ children: e }) => /* @__PURE__ */ r(
|
|
20037
20038
|
Oo,
|
|
20038
20039
|
{
|
|
@@ -20044,7 +20045,7 @@ const c2 = Qe.memo(
|
|
|
20044
20045
|
children: e
|
|
20045
20046
|
}
|
|
20046
20047
|
)
|
|
20047
|
-
), m2 =
|
|
20048
|
+
), m2 = Ze.memo(
|
|
20048
20049
|
({
|
|
20049
20050
|
isCollapsed: e,
|
|
20050
20051
|
children: t
|
|
@@ -20056,7 +20057,7 @@ const c2 = Qe.memo(
|
|
|
20056
20057
|
children: t
|
|
20057
20058
|
}
|
|
20058
20059
|
)
|
|
20059
|
-
), p2 =
|
|
20060
|
+
), p2 = Ze.memo(
|
|
20060
20061
|
({ children: e }) => /* @__PURE__ */ r(Oo, { text: "Copy link to heading", position: "bottom", children: e })
|
|
20061
20062
|
), f2 = 24, Ua = (e, t) => {
|
|
20062
20063
|
try {
|
|
@@ -20080,7 +20081,7 @@ const c2 = Qe.memo(
|
|
|
20080
20081
|
return o ? { editor: e, node: o, pos: t } : null;
|
|
20081
20082
|
}, y2 = (e, t, n, s) => {
|
|
20082
20083
|
if (n.childCount > 0 || !s.dataTransfer) return !1;
|
|
20083
|
-
const { view: o } = e, i =
|
|
20084
|
+
const { view: o } = e, i = pn.create(
|
|
20084
20085
|
o.state.doc,
|
|
20085
20086
|
t,
|
|
20086
20087
|
t + n.nodeSize
|
|
@@ -20105,7 +20106,7 @@ const c2 = Qe.memo(
|
|
|
20105
20106
|
}) => {
|
|
20106
20107
|
const [s, o] = Y(null), [i, a] = Y(!1), l = F(null), { scale: c } = hs(), u = F(c);
|
|
20107
20108
|
u.current = c;
|
|
20108
|
-
const d =
|
|
20109
|
+
const d = wt("(max-width: 767px)"), h = M(
|
|
20109
20110
|
() => s ? g2(e, s.pos) : null,
|
|
20110
20111
|
[e, s]
|
|
20111
20112
|
), m = l2(e, h), p = M(
|
|
@@ -20350,7 +20351,7 @@ const c2 = Qe.memo(
|
|
|
20350
20351
|
), g = M(() => {
|
|
20351
20352
|
i((E) => (l(E ? 2 : x.length), !E));
|
|
20352
20353
|
}, [x.length]), y = e && !e.isDestroyed ? e.view.dom.closest("[data-ddoc-editor-panel]") : null;
|
|
20353
|
-
return !m || h || !y || !(e == null ? void 0 : e.view.dom.firstElementChild) ? null :
|
|
20354
|
+
return !m || h || !y || !(e == null ? void 0 : e.view.dom.firstElementChild) ? null : Tn(
|
|
20354
20355
|
/* @__PURE__ */ r(
|
|
20355
20356
|
"div",
|
|
20356
20357
|
{
|
|
@@ -20496,10 +20497,10 @@ const c2 = Qe.memo(
|
|
|
20496
20497
|
arrowPadding: 12,
|
|
20497
20498
|
container: document.querySelector("#editor-canvas"),
|
|
20498
20499
|
className: "pt-2 border-none bg-transparent",
|
|
20499
|
-
children: /* @__PURE__ */ v(
|
|
20500
|
+
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: [
|
|
20500
20501
|
/* @__PURE__ */ v("div", { className: "flex items-center gap-2 pr-1 pl-2 border rounded-md", children: [
|
|
20501
20502
|
/* @__PURE__ */ r(
|
|
20502
|
-
|
|
20503
|
+
Qt,
|
|
20503
20504
|
{
|
|
20504
20505
|
placeholder: "Search text...",
|
|
20505
20506
|
value: s,
|
|
@@ -20511,7 +20512,7 @@ const c2 = Qe.memo(
|
|
|
20511
20512
|
p !== void 0 && /* @__PURE__ */ r(nt, { 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 }),
|
|
20512
20513
|
p !== void 0 && /* @__PURE__ */ v("div", { className: "flex items-center", children: [
|
|
20513
20514
|
/* @__PURE__ */ v("div", { className: "flex items-center", children: [
|
|
20514
|
-
/* @__PURE__ */ r(
|
|
20515
|
+
/* @__PURE__ */ r(Ge, { text: "Previous", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
20515
20516
|
be,
|
|
20516
20517
|
{
|
|
20517
20518
|
icon: "ArrowUp",
|
|
@@ -20522,7 +20523,7 @@ const c2 = Qe.memo(
|
|
|
20522
20523
|
onClick: w
|
|
20523
20524
|
}
|
|
20524
20525
|
) }),
|
|
20525
|
-
/* @__PURE__ */ r(
|
|
20526
|
+
/* @__PURE__ */ r(Ge, { text: "Next", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
20526
20527
|
be,
|
|
20527
20528
|
{
|
|
20528
20529
|
icon: "ArrowDown",
|
|
@@ -20534,7 +20535,7 @@ const c2 = Qe.memo(
|
|
|
20534
20535
|
}
|
|
20535
20536
|
) })
|
|
20536
20537
|
] }),
|
|
20537
|
-
!n && /* @__PURE__ */ r(
|
|
20538
|
+
!n && /* @__PURE__ */ r(Ge, { text: "Replace", children: /* @__PURE__ */ r(
|
|
20538
20539
|
be,
|
|
20539
20540
|
{
|
|
20540
20541
|
icon: "Replace",
|
|
@@ -20548,7 +20549,7 @@ const c2 = Qe.memo(
|
|
|
20548
20549
|
/* @__PURE__ */ r(Io, { asChild: !0, onClick: y, children: /* @__PURE__ */ r(be, { icon: "X", variant: "ghost", size: "sm" }) })
|
|
20549
20550
|
] }),
|
|
20550
20551
|
/* @__PURE__ */ r(Ps, { children: a && !n && /* @__PURE__ */ v(
|
|
20551
|
-
|
|
20552
|
+
Ut.div,
|
|
20552
20553
|
{
|
|
20553
20554
|
className: "space-y-2 overflow-clip",
|
|
20554
20555
|
initial: { height: 0 },
|
|
@@ -20557,7 +20558,7 @@ const c2 = Qe.memo(
|
|
|
20557
20558
|
layout: "size",
|
|
20558
20559
|
children: [
|
|
20559
20560
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 px-2 border rounded-md", children: /* @__PURE__ */ r(
|
|
20560
|
-
|
|
20561
|
+
Qt,
|
|
20561
20562
|
{
|
|
20562
20563
|
placeholder: "Replace with...",
|
|
20563
20564
|
value: o,
|
|
@@ -20628,7 +20629,7 @@ var N2 = {
|
|
|
20628
20629
|
* This source code is licensed under the ISC license.
|
|
20629
20630
|
* See the LICENSE file in the root directory of this source tree.
|
|
20630
20631
|
*/
|
|
20631
|
-
const T2 =
|
|
20632
|
+
const T2 = bt(
|
|
20632
20633
|
({
|
|
20633
20634
|
color: e = "currentColor",
|
|
20634
20635
|
size: t = 24,
|
|
@@ -20663,7 +20664,7 @@ const T2 = wt(
|
|
|
20663
20664
|
* See the LICENSE file in the root directory of this source tree.
|
|
20664
20665
|
*/
|
|
20665
20666
|
const E2 = (e, t) => {
|
|
20666
|
-
const n =
|
|
20667
|
+
const n = bt(
|
|
20667
20668
|
({ className: s, ...o }, i) => vr(T2, {
|
|
20668
20669
|
ref: i,
|
|
20669
20670
|
iconNode: t,
|
|
@@ -20813,7 +20814,7 @@ const A2 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], R2 = E2("ChevronRi
|
|
|
20813
20814
|
),
|
|
20814
20815
|
/* @__PURE__ */ v("div", { className: "flex items-center pl-1 shrink-0", children: [
|
|
20815
20816
|
/* @__PURE__ */ r(Al, { className: "mr-1", direction: "vertical" }),
|
|
20816
|
-
/* @__PURE__ */ r(
|
|
20817
|
+
/* @__PURE__ */ r(Ge, { text: "Back to editor", asTriggerChild: !0, children: /* @__PURE__ */ r(
|
|
20817
20818
|
be,
|
|
20818
20819
|
{
|
|
20819
20820
|
variant: "ghost",
|
|
@@ -20956,7 +20957,7 @@ const A2 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], R2 = E2("ChevronRi
|
|
|
20956
20957
|
ydoc: o
|
|
20957
20958
|
});
|
|
20958
20959
|
}), mh(s.tabs[0].content, t);
|
|
20959
|
-
const l =
|
|
20960
|
+
const l = kt(o);
|
|
20960
20961
|
return o.transact(() => {
|
|
20961
20962
|
s.tabs.forEach((u, d) => {
|
|
20962
20963
|
const h = a[d];
|
|
@@ -21040,7 +21041,7 @@ const A2 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], R2 = E2("ChevronRi
|
|
|
21040
21041
|
}, ja = (e) => {
|
|
21041
21042
|
var n;
|
|
21042
21043
|
const t = e && !e.isDestroyed ? (n = e.view) == null ? void 0 : n.dom : null;
|
|
21043
|
-
return t ?
|
|
21044
|
+
return t ? Sn({ targetElement: t, editorRoot: t }) : document.querySelector($2);
|
|
21044
21045
|
}, q2 = ({
|
|
21045
21046
|
editor: e,
|
|
21046
21047
|
activeTabId: t,
|
|
@@ -21331,7 +21332,7 @@ function oy({
|
|
|
21331
21332
|
const H = Ga(me, P);
|
|
21332
21333
|
x(H.top), y(H.left);
|
|
21333
21334
|
}
|
|
21334
|
-
const W =
|
|
21335
|
+
const W = Sn({ targetElement: Q });
|
|
21335
21336
|
if (T && $a(u.current, W, l), !W) {
|
|
21336
21337
|
E(0), R(i - 1);
|
|
21337
21338
|
return;
|
|
@@ -21350,7 +21351,7 @@ function oy({
|
|
|
21350
21351
|
var le;
|
|
21351
21352
|
if (!i || !e || e.isDestroyed) return;
|
|
21352
21353
|
w();
|
|
21353
|
-
const P = e.view.dom, Q =
|
|
21354
|
+
const P = e.view.dom, Q = Sn({ targetElement: P });
|
|
21354
21355
|
let ee = 0;
|
|
21355
21356
|
const me = () => {
|
|
21356
21357
|
ee || (ee = requestAnimationFrame(() => {
|
|
@@ -21369,7 +21370,7 @@ function oy({
|
|
|
21369
21370
|
const P = e.view.dom;
|
|
21370
21371
|
$a(
|
|
21371
21372
|
u.current,
|
|
21372
|
-
|
|
21373
|
+
Sn({ targetElement: P }),
|
|
21373
21374
|
l
|
|
21374
21375
|
);
|
|
21375
21376
|
}, [S, e, l, A, k, d, m, f, a]), !e || !i) return null;
|
|
@@ -21427,7 +21428,7 @@ function oy({
|
|
|
21427
21428
|
));
|
|
21428
21429
|
return /* @__PURE__ */ v(nt, { children: [
|
|
21429
21430
|
/* @__PURE__ */ r("div", { ref: c, className: "ddoc-page-sheets", "aria-hidden": "true", children: B }),
|
|
21430
|
-
m &&
|
|
21431
|
+
m && Tn(
|
|
21431
21432
|
/* @__PURE__ */ r("div", { ref: u, className: "ddoc-page-masks", "aria-hidden": "true", children: $ }),
|
|
21432
21433
|
m
|
|
21433
21434
|
)
|
|
@@ -21473,14 +21474,14 @@ const iy = () => {
|
|
|
21473
21474
|
},
|
|
21474
21475
|
liveEditor: e
|
|
21475
21476
|
});
|
|
21476
|
-
return n ? s ? null :
|
|
21477
|
+
return n ? s ? null : Tn(o, n) : /* @__PURE__ */ r(
|
|
21477
21478
|
"div",
|
|
21478
21479
|
{
|
|
21479
21480
|
className: ye("ddoc-navbar-row", s && "ddoc-navbar-row--hidden"),
|
|
21480
21481
|
children: o
|
|
21481
21482
|
}
|
|
21482
21483
|
);
|
|
21483
|
-
}, pr = (e) => !!(e != null && e.enabled && (e.connection.livePresence ?? !0)), ax =
|
|
21484
|
+
}, pr = (e) => !!(e != null && e.enabled && (e.connection.livePresence ?? !0)), ax = bt(
|
|
21484
21485
|
({
|
|
21485
21486
|
isPreviewMode: e = !1,
|
|
21486
21487
|
viewerMode: t,
|
|
@@ -21539,61 +21540,61 @@ const iy = () => {
|
|
|
21539
21540
|
onFocusModeChange: Se,
|
|
21540
21541
|
onMarkdownExport: J,
|
|
21541
21542
|
onMarkdownImport: ue,
|
|
21542
|
-
onPdfExport:
|
|
21543
|
+
onPdfExport: De,
|
|
21543
21544
|
onHtmlExport: Ee,
|
|
21544
21545
|
onTxtExport: He,
|
|
21545
21546
|
onOdtExport: ze,
|
|
21546
|
-
onDocxImport:
|
|
21547
|
-
editorCanvasClassNames:
|
|
21548
|
-
sharedSlidesLink:
|
|
21549
|
-
documentName:
|
|
21550
|
-
onInvalidContentError:
|
|
21547
|
+
onDocxImport: Ye,
|
|
21548
|
+
editorCanvasClassNames: xt,
|
|
21549
|
+
sharedSlidesLink: ht,
|
|
21550
|
+
documentName: Ke,
|
|
21551
|
+
onInvalidContentError: lt,
|
|
21551
21552
|
ignoreCorruptedData: je,
|
|
21552
|
-
commentDrawerOpen:
|
|
21553
|
+
commentDrawerOpen: zt,
|
|
21553
21554
|
setCommentDrawerOpen: Xe,
|
|
21554
|
-
onCommentDrawerOpenChange:
|
|
21555
|
+
onCommentDrawerOpenChange: Qe,
|
|
21555
21556
|
initialComments: St = [],
|
|
21556
|
-
initialCommentAnchors:
|
|
21557
|
-
onNewComment:
|
|
21558
|
-
onEditComment:
|
|
21559
|
-
onEditReply:
|
|
21557
|
+
initialCommentAnchors: an,
|
|
21558
|
+
onNewComment: ln,
|
|
21559
|
+
onEditComment: Kt,
|
|
21560
|
+
onEditReply: cn,
|
|
21560
21561
|
onCommentReply: ms,
|
|
21561
|
-
setInitialComments:
|
|
21562
|
+
setInitialComments: gn,
|
|
21562
21563
|
onSlidesShare: ps,
|
|
21563
21564
|
onResolveComment: Kn,
|
|
21564
21565
|
onUnresolveComment: En,
|
|
21565
|
-
onDeleteComment:
|
|
21566
|
+
onDeleteComment: yn,
|
|
21566
21567
|
onDeleteReply: ie,
|
|
21567
|
-
theme:
|
|
21568
|
+
theme: xn,
|
|
21568
21569
|
showTOC: At,
|
|
21569
|
-
setShowTOC:
|
|
21570
|
+
setShowTOC: tn,
|
|
21570
21571
|
onShowTOCChange: Pe,
|
|
21571
21572
|
isConnected: Me,
|
|
21572
21573
|
connectViaWallet: st,
|
|
21573
|
-
isLoading:
|
|
21574
|
-
connectViaUsername:
|
|
21574
|
+
isLoading: Re,
|
|
21575
|
+
connectViaUsername: jt,
|
|
21575
21576
|
isDDocOwner: rt,
|
|
21576
21577
|
isCollabDocumentPublished: ct = !0,
|
|
21577
21578
|
disableInlineComment: mt,
|
|
21578
21579
|
renderThemeToggle: jn,
|
|
21579
21580
|
renderToolbarLeading: An,
|
|
21580
|
-
metadataProxyUrl:
|
|
21581
|
-
extensions:
|
|
21582
|
-
onCopyHeadingLink:
|
|
21581
|
+
metadataProxyUrl: Vt,
|
|
21582
|
+
extensions: nn,
|
|
21583
|
+
onCopyHeadingLink: Wt,
|
|
21583
21584
|
tabConfig: Nt,
|
|
21584
21585
|
imageFetchFn: pt,
|
|
21585
|
-
ipfsImageFetchFn:
|
|
21586
|
+
ipfsImageFetchFn: $t,
|
|
21586
21587
|
fetchV1ImageFn: Rt,
|
|
21587
|
-
activeModel:
|
|
21588
|
+
activeModel: wn,
|
|
21588
21589
|
maxTokens: Vn,
|
|
21589
21590
|
isAIAgentEnabled: Wn,
|
|
21590
21591
|
// Document styling object
|
|
21591
21592
|
documentStyling: xe,
|
|
21592
|
-
fonts:
|
|
21593
|
+
fonts: qt,
|
|
21593
21594
|
...$n
|
|
21594
21595
|
}, qn) => {
|
|
21595
21596
|
var Ai, Ri, Ii;
|
|
21596
|
-
const [fs,
|
|
21597
|
+
const [fs, dn] = Mn(
|
|
21597
21598
|
W,
|
|
21598
21599
|
"1",
|
|
21599
21600
|
le,
|
|
@@ -21603,22 +21604,22 @@ const iy = () => {
|
|
|
21603
21604
|
!0,
|
|
21604
21605
|
V,
|
|
21605
21606
|
K
|
|
21606
|
-
), [
|
|
21607
|
+
), [un, we] = Mn(
|
|
21607
21608
|
At,
|
|
21608
21609
|
!1,
|
|
21609
21610
|
Pe,
|
|
21610
|
-
|
|
21611
|
+
tn
|
|
21611
21612
|
), [pe, Te] = Mn(
|
|
21612
|
-
|
|
21613
|
+
zt,
|
|
21613
21614
|
!1,
|
|
21614
|
-
|
|
21615
|
+
Qe,
|
|
21615
21616
|
Xe
|
|
21616
21617
|
), [ge, Fe] = Mn(
|
|
21617
21618
|
O,
|
|
21618
21619
|
!1,
|
|
21619
21620
|
U,
|
|
21620
21621
|
H
|
|
21621
|
-
), [
|
|
21622
|
+
), [Ie, Ae] = Mn(
|
|
21622
21623
|
ce,
|
|
21623
21624
|
!1,
|
|
21624
21625
|
L,
|
|
@@ -21627,44 +21628,44 @@ const iy = () => {
|
|
|
21627
21628
|
() => zl(A, E),
|
|
21628
21629
|
[A, E]
|
|
21629
21630
|
), Oe = ve(
|
|
21630
|
-
() => Kl(pt,
|
|
21631
|
-
[pt,
|
|
21631
|
+
() => Kl(pt, $t),
|
|
21632
|
+
[pt, $t]
|
|
21632
21633
|
), { isFocusMode: Ce, toggleFocusMode: Tt } = Og({
|
|
21633
21634
|
isFocusMode: re,
|
|
21634
21635
|
onFocusModeChange: Se,
|
|
21635
21636
|
onFocusMode: (Z) => {
|
|
21636
21637
|
pe && (Te == null || Te(!1)), fe == null || fe(Z);
|
|
21637
21638
|
}
|
|
21638
|
-
}), [It, Dt] = Y(!1), [
|
|
21639
|
+
}), [It, Dt] = Y(!1), [hn, Et] = Y(!1), Gt = F(null), Yn = F({ isPagesActive: !1 }), bn = (() => {
|
|
21639
21640
|
if (!xe)
|
|
21640
21641
|
return { canvas: void 0, background: void 0 };
|
|
21641
|
-
const Z = {}, ke = {}, Ve =
|
|
21642
|
+
const Z = {}, ke = {}, Ve = xn ?? "light";
|
|
21642
21643
|
if (xe.canvasBackground) {
|
|
21643
|
-
const
|
|
21644
|
+
const Je = As(
|
|
21644
21645
|
xe.canvasBackground,
|
|
21645
21646
|
Ve
|
|
21646
21647
|
);
|
|
21647
|
-
Z.backgroundColor =
|
|
21648
|
+
Z.backgroundColor = Je;
|
|
21648
21649
|
}
|
|
21649
21650
|
if (xe.textColor) {
|
|
21650
|
-
const
|
|
21651
|
+
const Je = _r(
|
|
21651
21652
|
xe.textColor,
|
|
21652
21653
|
Ve
|
|
21653
21654
|
);
|
|
21654
|
-
|
|
21655
|
+
Je && (Z.color = Je);
|
|
21655
21656
|
}
|
|
21656
21657
|
if (xe.fontFamily && (Z.fontFamily = xe.fontFamily), xe.background) {
|
|
21657
|
-
const
|
|
21658
|
+
const Je = As(
|
|
21658
21659
|
xe.background,
|
|
21659
21660
|
Ve
|
|
21660
21661
|
);
|
|
21661
|
-
ke.background =
|
|
21662
|
+
ke.background = Je;
|
|
21662
21663
|
}
|
|
21663
21664
|
return {
|
|
21664
21665
|
canvas: Object.keys(Z).length > 0 ? Z : void 0,
|
|
21665
21666
|
background: Object.keys(ke).length > 0 ? ke : void 0
|
|
21666
21667
|
};
|
|
21667
|
-
})(), Rn = () =>
|
|
21668
|
+
})(), Rn = () => bn.canvas, Ws = () => bn.background, Oc = F(null), ti = F(null), ni = F(null), Lo = F(null), [si, Lc] = Y(
|
|
21668
21669
|
null
|
|
21669
21670
|
), [_c, Pc] = Y(null), _o = F(null), Po = F(null);
|
|
21670
21671
|
Po.current || (Po.current = ry());
|
|
@@ -21672,7 +21673,7 @@ const iy = () => {
|
|
|
21672
21673
|
yt(() => {
|
|
21673
21674
|
Uc(iy());
|
|
21674
21675
|
}, []);
|
|
21675
|
-
const { isBelow1280px: $s, isNativeMobile: Xn } =
|
|
21676
|
+
const { isBelow1280px: $s, isNativeMobile: Xn } = Zt(In), [ri, Uo] = Y(!1), ii = F(null), Hc = (_ == null ? void 0 : _.slice(0, 4)) || [], ai = _ ? Math.max(0, _.length - 4) : 0;
|
|
21676
21677
|
Hs(ii, () => {
|
|
21677
21678
|
Uo(!1);
|
|
21678
21679
|
}), j(() => {
|
|
@@ -21683,7 +21684,7 @@ const iy = () => {
|
|
|
21683
21684
|
cachedEditorEntries: qs,
|
|
21684
21685
|
ref: Qn,
|
|
21685
21686
|
isContentLoading: Gs,
|
|
21686
|
-
ydoc:
|
|
21687
|
+
ydoc: mn,
|
|
21687
21688
|
awareness: Ys,
|
|
21688
21689
|
refreshYjsIndexedDbProvider: jc,
|
|
21689
21690
|
activeCommentId: Xs,
|
|
@@ -21695,7 +21696,7 @@ const iy = () => {
|
|
|
21695
21696
|
setTocItems: li,
|
|
21696
21697
|
terminateSession: Gc,
|
|
21697
21698
|
updateTitle: Yc,
|
|
21698
|
-
tabs:
|
|
21699
|
+
tabs: Cn,
|
|
21699
21700
|
setTabs: ci,
|
|
21700
21701
|
activeTabId: Mt,
|
|
21701
21702
|
setActiveTabId: Xc,
|
|
@@ -21741,34 +21742,34 @@ const iy = () => {
|
|
|
21741
21742
|
setIsCommentSectionOpen: te,
|
|
21742
21743
|
setInlineCommentData: P,
|
|
21743
21744
|
inlineCommentData: Q,
|
|
21744
|
-
initialCommentAnchors:
|
|
21745
|
-
theme:
|
|
21745
|
+
initialCommentAnchors: an,
|
|
21746
|
+
theme: xn,
|
|
21746
21747
|
isNavbarVisible: ft,
|
|
21747
21748
|
setIsNavbarVisible: Gn,
|
|
21748
|
-
onDocxImport:
|
|
21749
|
-
onInvalidContentError:
|
|
21749
|
+
onDocxImport: Ye,
|
|
21750
|
+
onInvalidContentError: lt,
|
|
21750
21751
|
ignoreCorruptedData: je,
|
|
21751
21752
|
isPresentationMode: ge,
|
|
21752
|
-
metadataProxyUrl:
|
|
21753
|
-
extensions:
|
|
21754
|
-
onCopyHeadingLink:
|
|
21753
|
+
metadataProxyUrl: Vt,
|
|
21754
|
+
extensions: nn,
|
|
21755
|
+
onCopyHeadingLink: Wt,
|
|
21755
21756
|
disableInlineComment: mt,
|
|
21756
21757
|
isFocusMode: Ce,
|
|
21757
21758
|
isConnected: Me,
|
|
21758
|
-
activeModel:
|
|
21759
|
+
activeModel: wn,
|
|
21759
21760
|
maxTokens: Vn,
|
|
21760
21761
|
isAIAgentEnabled: Wn,
|
|
21761
21762
|
isDDocOwner: rt,
|
|
21762
21763
|
tabConfig: Nt,
|
|
21763
|
-
onNewComment:
|
|
21764
|
-
fonts:
|
|
21764
|
+
onNewComment: ln,
|
|
21765
|
+
fonts: qt,
|
|
21765
21766
|
...$n
|
|
21766
21767
|
}), ed = ve(
|
|
21767
21768
|
() => {
|
|
21768
21769
|
var Z;
|
|
21769
|
-
return ((Z =
|
|
21770
|
+
return ((Z = Cn.find((ke) => ke.id === (Mt || tt))) == null ? void 0 : Z.name) || vo;
|
|
21770
21771
|
},
|
|
21771
|
-
[Mt,
|
|
21772
|
+
[Mt, Cn]
|
|
21772
21773
|
), td = M(
|
|
21773
21774
|
(Z) => {
|
|
21774
21775
|
!de || de.isDestroyed || !Mt || P2({
|
|
@@ -21776,10 +21777,10 @@ const iy = () => {
|
|
|
21776
21777
|
editor: de,
|
|
21777
21778
|
flushPendingUpdate: yi,
|
|
21778
21779
|
template: Z,
|
|
21779
|
-
ydoc:
|
|
21780
|
+
ydoc: mn
|
|
21780
21781
|
});
|
|
21781
21782
|
},
|
|
21782
|
-
[Mt, de, yi,
|
|
21783
|
+
[Mt, de, yi, mn]
|
|
21783
21784
|
), { switchTab: Ko } = q2({
|
|
21784
21785
|
editor: de,
|
|
21785
21786
|
activeTabId: Mt,
|
|
@@ -21788,13 +21789,13 @@ const iy = () => {
|
|
|
21788
21789
|
isContentLoading: Gs,
|
|
21789
21790
|
isNativeMobile: Xn,
|
|
21790
21791
|
disabled: !!((Ai = $n.versionHistoryState) != null && Ai.enabled) || !!ge
|
|
21791
|
-
}), Qs =
|
|
21792
|
+
}), Qs = wt(
|
|
21792
21793
|
"(min-width: 960px)",
|
|
21793
21794
|
In
|
|
21794
|
-
), gs = pr(s), Ue = !!
|
|
21795
|
+
), gs = pr(s), Ue = !!Ie && !e && Qs && !gs;
|
|
21795
21796
|
j(() => {
|
|
21796
|
-
(!Qs || gs) &&
|
|
21797
|
-
}, [Qs, gs,
|
|
21797
|
+
(!Qs || gs) && Ie && (Ae == null || Ae(!1));
|
|
21798
|
+
}, [Qs, gs, Ie, Ae]);
|
|
21798
21799
|
const nd = ve(
|
|
21799
21800
|
() => ({ ...gi, isSplitView: Ue }),
|
|
21800
21801
|
[gi, Ue]
|
|
@@ -21832,14 +21833,14 @@ const iy = () => {
|
|
|
21832
21833
|
qn,
|
|
21833
21834
|
() => ({
|
|
21834
21835
|
getEditor: () => de,
|
|
21835
|
-
getYdoc: () =>
|
|
21836
|
+
getYdoc: () => mn,
|
|
21836
21837
|
createTab: zo,
|
|
21837
21838
|
refreshYjsIndexedDbProvider: jc,
|
|
21838
21839
|
mergeYjsContents: (Z) => {
|
|
21839
21840
|
const ke = $h(Z);
|
|
21840
21841
|
return qe.applyUpdate(
|
|
21841
|
-
|
|
21842
|
-
|
|
21842
|
+
mn,
|
|
21843
|
+
at(ke),
|
|
21843
21844
|
"self"
|
|
21844
21845
|
), ke;
|
|
21845
21846
|
},
|
|
@@ -21847,8 +21848,8 @@ const iy = () => {
|
|
|
21847
21848
|
if (de) {
|
|
21848
21849
|
const ke = await de.commands.exportMarkdownFile();
|
|
21849
21850
|
if (ke) {
|
|
21850
|
-
const Ve = ke,
|
|
21851
|
-
|
|
21851
|
+
const Ve = ke, Je = document.createElement("a");
|
|
21852
|
+
Je.href = Ve, Je.download = Z, document.body.appendChild(Je), Je.click(), document.body.removeChild(Je), URL.revokeObjectURL(Ve);
|
|
21852
21853
|
}
|
|
21853
21854
|
}
|
|
21854
21855
|
},
|
|
@@ -21857,16 +21858,16 @@ const iy = () => {
|
|
|
21857
21858
|
console.debug("collab: cannot find editor or awareness");
|
|
21858
21859
|
return;
|
|
21859
21860
|
}
|
|
21860
|
-
const ke = Ys.getLocalState(), Ve = ke == null ? void 0 : ke.user,
|
|
21861
|
+
const ke = Ys.getLocalState(), Ve = ke == null ? void 0 : ke.user, Je = {
|
|
21861
21862
|
name: Z,
|
|
21862
21863
|
color: Ve == null ? void 0 : Ve.color,
|
|
21863
21864
|
isEns: Ve == null ? void 0 : Ve.isEns
|
|
21864
21865
|
};
|
|
21865
|
-
Ys.setLocalStateField("user",
|
|
21866
|
+
Ys.setLocalStateField("user", Je), de.setEditable(!0);
|
|
21866
21867
|
},
|
|
21867
21868
|
exportCurrentTabOrOpenExportModal: (Z = "pdf", ke) => {
|
|
21868
21869
|
var Ve;
|
|
21869
|
-
(Ve =
|
|
21870
|
+
(Ve = Gt.current) == null || Ve.call(Gt, Z, ke);
|
|
21870
21871
|
},
|
|
21871
21872
|
printCurrentTab: async () => {
|
|
21872
21873
|
if (!de) return;
|
|
@@ -21897,12 +21898,12 @@ const iy = () => {
|
|
|
21897
21898
|
return (B == null ? void 0 : B.find(
|
|
21898
21899
|
(Nd) => Nd.name.toLowerCase() === so.toLowerCase()
|
|
21899
21900
|
)) || { name: so, color: Z.color };
|
|
21900
|
-
}),
|
|
21901
|
+
}), Je = [...ke];
|
|
21901
21902
|
return Ve.forEach((no) => {
|
|
21902
|
-
|
|
21903
|
+
Je.some(
|
|
21903
21904
|
(so) => so.name.toLowerCase() === no.name.toLowerCase()
|
|
21904
|
-
) ||
|
|
21905
|
-
}),
|
|
21905
|
+
) || Je.push(no);
|
|
21906
|
+
}), Je.slice(0, 6);
|
|
21906
21907
|
});
|
|
21907
21908
|
}, bi = (Z) => {
|
|
21908
21909
|
X == null || X(
|
|
@@ -21910,8 +21911,8 @@ const iy = () => {
|
|
|
21910
21911
|
);
|
|
21911
21912
|
}, dd = () => {
|
|
21912
21913
|
Fe == null || Fe(!1);
|
|
21913
|
-
const Z = new URL(window.location.href), ke = Z.hash, [Ve,
|
|
21914
|
-
|
|
21914
|
+
const Z = new URL(window.location.href), ke = Z.hash, [Ve, Je] = ke.split("&");
|
|
21915
|
+
Je && Je.startsWith("slides=") && (Z.hash = Ve, window.history.replaceState({}, "", Z.toString()));
|
|
21915
21916
|
}, ud = () => {
|
|
21916
21917
|
Fe == null || Fe(!0), pe && (Te == null || Te(!1));
|
|
21917
21918
|
};
|
|
@@ -21919,11 +21920,11 @@ const iy = () => {
|
|
|
21919
21920
|
if (de && Xn) {
|
|
21920
21921
|
const { selection: Z } = de.state, ke = Ya(Z), Ve = () => {
|
|
21921
21922
|
Dt(!0);
|
|
21922
|
-
},
|
|
21923
|
+
}, Je = () => {
|
|
21923
21924
|
Dt(!1);
|
|
21924
21925
|
};
|
|
21925
|
-
return !ke && de.on("focus", Ve), ke && de.on("blur",
|
|
21926
|
-
de.off("focus", Ve), de.off("blur",
|
|
21926
|
+
return !ke && de.on("focus", Ve), ke && de.on("blur", Je), () => {
|
|
21927
|
+
de.off("focus", Ve), de.off("blur", Je);
|
|
21927
21928
|
};
|
|
21928
21929
|
}
|
|
21929
21930
|
}, [Xn, de]), j(() => {
|
|
@@ -21957,7 +21958,7 @@ const iy = () => {
|
|
|
21957
21958
|
}, [de, Qn, Xn]), j(() => {
|
|
21958
21959
|
!Ce || !de || de.isDestroyed || de.commands.focus();
|
|
21959
21960
|
}, [Ce, de]);
|
|
21960
|
-
const
|
|
21961
|
+
const sn = wt(
|
|
21961
21962
|
"(max-width: 850px)",
|
|
21962
21963
|
In
|
|
21963
21964
|
), Ci = ve(() => (St || []).reduce(
|
|
@@ -21967,32 +21968,32 @@ const iy = () => {
|
|
|
21967
21968
|
return Z[Ve] = (Z[Ve] || 0) + 1, Z;
|
|
21968
21969
|
},
|
|
21969
21970
|
{}
|
|
21970
|
-
), [St]), hd = N0(fi), Vo = !!pe || !!mt, vi = hd && !Vo, Zs = (xe == null ? void 0 : xe.orientation) === "landscape", md =
|
|
21971
|
+
), [St]), hd = N0(fi), Vo = !!pe || !!mt, vi = hd && !Vo, Zs = (xe == null ? void 0 : xe.orientation) === "landscape", md = wt(
|
|
21971
21972
|
"(min-width: 1024px)",
|
|
21972
21973
|
In
|
|
21973
|
-
),
|
|
21974
|
-
pageSetup:
|
|
21974
|
+
), on = xe == null ? void 0 : xe.pageSetup, Ft = yh({
|
|
21975
|
+
pageSetup: on,
|
|
21975
21976
|
isWideEnough: md,
|
|
21976
21977
|
isSplitViewActive: Ue,
|
|
21977
21978
|
isVersionHistory: !!((Ri = $n.versionHistoryState) != null && Ri.enabled)
|
|
21978
21979
|
});
|
|
21979
21980
|
Yn.current = {
|
|
21980
|
-
pageSetup:
|
|
21981
|
+
pageSetup: on,
|
|
21981
21982
|
orientation: xe == null ? void 0 : xe.orientation,
|
|
21982
|
-
isPagesActive:
|
|
21983
|
+
isPagesActive: Ft,
|
|
21983
21984
|
ipfsImageFetchFn: Oe,
|
|
21984
21985
|
fetchV1ImageFn: Rt
|
|
21985
21986
|
};
|
|
21986
|
-
const Js =
|
|
21987
|
+
const Js = Ft && on ? xh(on, xe == null ? void 0 : xe.orientation) : Zs ? 1190 : 850, Zn = bh(fs), ys = Qs && !Ue, Wo = ys && Zn === "fit", xs = (
|
|
21987
21988
|
// Hidden in Split View — the right pane has its own tabs panel (the
|
|
21988
21989
|
// List button in the split header), so the editor's native left rail
|
|
21989
21990
|
// would just duplicate it.
|
|
21990
|
-
!Ue && (
|
|
21991
|
+
!Ue && (Cn.length > 0 || Ho.length > 0 && !((Ii = $n.versionHistoryState) != null && Ii.enabled)) && (!Ce || un)
|
|
21991
21992
|
), pd = xs ? 148 : 0, ki = xs && !$s, fd = vh({
|
|
21992
21993
|
hasLeftRail: ki,
|
|
21993
21994
|
isCommentColumnVisible: vi,
|
|
21994
21995
|
isLandscape: Zs,
|
|
21995
|
-
isPagesMode:
|
|
21996
|
+
isPagesMode: Ft
|
|
21996
21997
|
}), { shouldHideRight: Si, shouldScroll: gd, fitScale: $o } = Y2({
|
|
21997
21998
|
canvasRef: Lo,
|
|
21998
21999
|
rootRef: ni,
|
|
@@ -22007,10 +22008,10 @@ const iy = () => {
|
|
|
22007
22008
|
enabled: ys && !ge && Nh(W, le, oe),
|
|
22008
22009
|
onStep: (Z) => {
|
|
22009
22010
|
const ke = Th(Zn, Z, $o);
|
|
22010
|
-
ke !== Zn &&
|
|
22011
|
+
ke !== Zn && dn(ke);
|
|
22011
22012
|
}
|
|
22012
22013
|
});
|
|
22013
|
-
const Ni = Js * Dn, qo =
|
|
22014
|
+
const Ni = Js * Dn, qo = on == null ? void 0 : on.mode, Jn = on == null ? void 0 : on.paper, Go = xe == null ? void 0 : xe.orientation, yd = ve(
|
|
22014
22015
|
() => qo && Jn ? { mode: qo, paper: Jn } : void 0,
|
|
22015
22016
|
[qo, Jn]
|
|
22016
22017
|
), eo = ve(
|
|
@@ -22021,13 +22022,13 @@ const iy = () => {
|
|
|
22021
22022
|
pageSetup: yd,
|
|
22022
22023
|
orientation: Go,
|
|
22023
22024
|
zoom: Dn,
|
|
22024
|
-
isPagesMode:
|
|
22025
|
+
isPagesMode: Ft,
|
|
22025
22026
|
onPagesError: T,
|
|
22026
22027
|
printInputs: () => Yn.current
|
|
22027
22028
|
});
|
|
22028
22029
|
const Yo = (() => {
|
|
22029
22030
|
const Z = Rn();
|
|
22030
|
-
return
|
|
22031
|
+
return Ft && Z ? { ...Z, backgroundColor: void 0 } : Z;
|
|
22031
22032
|
})(), Ti = Ue ? ti : Lo;
|
|
22032
22033
|
Q2({
|
|
22033
22034
|
wrapperRef: _o,
|
|
@@ -22081,18 +22082,18 @@ const iy = () => {
|
|
|
22081
22082
|
ipfsImageUploadFn: _e,
|
|
22082
22083
|
onMarkdownExport: J,
|
|
22083
22084
|
onMarkdownImport: ue,
|
|
22084
|
-
onPdfExport:
|
|
22085
|
+
onPdfExport: De,
|
|
22085
22086
|
onHtmlExport: Ee,
|
|
22086
22087
|
onTxtExport: He,
|
|
22087
22088
|
onOdtExport: ze,
|
|
22088
|
-
onDocxImport:
|
|
22089
|
+
onDocxImport: Ye,
|
|
22089
22090
|
ipfsImageFetchFn: Oe,
|
|
22090
22091
|
fetchV1ImageFn: Rt,
|
|
22091
22092
|
isConnected: Me,
|
|
22092
|
-
tabs:
|
|
22093
|
-
ydoc:
|
|
22093
|
+
tabs: Cn,
|
|
22094
|
+
ydoc: mn,
|
|
22094
22095
|
toggleFocusMode: Tt,
|
|
22095
|
-
isSplitView:
|
|
22096
|
+
isSplitView: Ie,
|
|
22096
22097
|
onToggleSplitView: (
|
|
22097
22098
|
// Hidden during collaboration (Split View is solo-only in v1)
|
|
22098
22099
|
// and when the host fixed `isSplitView` with no callback: the
|
|
@@ -22100,9 +22101,9 @@ const iy = () => {
|
|
|
22100
22101
|
!gs && (ce === void 0 || L || q) ? () => Ae((Z) => !Z) : void 0
|
|
22101
22102
|
),
|
|
22102
22103
|
onRegisterExportTrigger: (Z) => {
|
|
22103
|
-
|
|
22104
|
+
Gt.current = Z;
|
|
22104
22105
|
},
|
|
22105
|
-
fonts:
|
|
22106
|
+
fonts: qt,
|
|
22106
22107
|
renderToolbarLeading: An
|
|
22107
22108
|
}
|
|
22108
22109
|
) })
|
|
@@ -22133,7 +22134,7 @@ const iy = () => {
|
|
|
22133
22134
|
ipfsImageUploadFn: _e,
|
|
22134
22135
|
ipfsImageFetchFn: Oe,
|
|
22135
22136
|
fetchV1ImageFn: Rt,
|
|
22136
|
-
fonts:
|
|
22137
|
+
fonts: qt
|
|
22137
22138
|
}
|
|
22138
22139
|
)
|
|
22139
22140
|
}
|
|
@@ -22144,21 +22145,21 @@ const iy = () => {
|
|
|
22144
22145
|
Bg,
|
|
22145
22146
|
{
|
|
22146
22147
|
editor: de,
|
|
22147
|
-
ydoc:
|
|
22148
|
-
tabs:
|
|
22148
|
+
ydoc: mn,
|
|
22149
|
+
tabs: Cn,
|
|
22149
22150
|
onRegisterExportTrigger: (Z) => {
|
|
22150
|
-
|
|
22151
|
+
Gt.current = Z;
|
|
22151
22152
|
},
|
|
22152
22153
|
onError: C,
|
|
22153
22154
|
ipfsImageUploadFn: _e,
|
|
22154
22155
|
onMarkdownExport: J,
|
|
22155
22156
|
onMarkdownImport: ue,
|
|
22156
|
-
onPdfExport:
|
|
22157
|
+
onPdfExport: De,
|
|
22157
22158
|
onHtmlExport: Ee,
|
|
22158
22159
|
onTxtExport: He,
|
|
22159
22160
|
onOdtExport: ze,
|
|
22160
22161
|
ipfsImageFetchFn: Oe,
|
|
22161
|
-
onDocxImport:
|
|
22162
|
+
onDocxImport: Ye,
|
|
22162
22163
|
fetchV1ImageFn: Rt,
|
|
22163
22164
|
isConnected: Me
|
|
22164
22165
|
}
|
|
@@ -22169,13 +22170,13 @@ const iy = () => {
|
|
|
22169
22170
|
{
|
|
22170
22171
|
editor: de,
|
|
22171
22172
|
onClose: dd,
|
|
22172
|
-
isFullscreen:
|
|
22173
|
+
isFullscreen: hn,
|
|
22173
22174
|
setIsFullscreen: Et,
|
|
22174
22175
|
onError: C,
|
|
22175
22176
|
setCommentDrawerOpen: Te,
|
|
22176
|
-
sharedSlidesLink:
|
|
22177
|
+
sharedSlidesLink: ht,
|
|
22177
22178
|
isPreviewMode: e,
|
|
22178
|
-
documentName:
|
|
22179
|
+
documentName: Ke,
|
|
22179
22180
|
onSlidesShare: ps,
|
|
22180
22181
|
slides: $c,
|
|
22181
22182
|
setSlides: qc,
|
|
@@ -22184,7 +22185,7 @@ const iy = () => {
|
|
|
22184
22185
|
ipfsImageFetchFn: Oe,
|
|
22185
22186
|
documentStyling: xe,
|
|
22186
22187
|
fetchV1ImageFn: Rt,
|
|
22187
|
-
theme:
|
|
22188
|
+
theme: xn ?? "light"
|
|
22188
22189
|
}
|
|
22189
22190
|
) }),
|
|
22190
22191
|
/* @__PURE__ */ v(
|
|
@@ -22206,7 +22207,7 @@ const iy = () => {
|
|
|
22206
22207
|
className: ye(
|
|
22207
22208
|
"editor-left-rail",
|
|
22208
22209
|
xs && "editor-left-rail-has-outline",
|
|
22209
|
-
!
|
|
22210
|
+
!sn && "max-w-[263px] w-full sticky top-0 self-start z-[2]",
|
|
22210
22211
|
// The top gap is padding, not margin: a sticky rail with a
|
|
22211
22212
|
// margin rests below top-0 and jumps up when the page scrolls.
|
|
22212
22213
|
!e && !Ce && ft && "-mt-[1.5rem] ddoc-md:mt-0 ddoc-md:pt-[0.8rem]",
|
|
@@ -22216,7 +22217,7 @@ const iy = () => {
|
|
|
22216
22217
|
"-mt-[1.5rem] ddoc-md:mt-0 ddoc-md:pt-[0.7rem]": !ft && !e
|
|
22217
22218
|
},
|
|
22218
22219
|
Ce && "pt-[48px]",
|
|
22219
|
-
Ce && !
|
|
22220
|
+
Ce && !un && Si && "hidden"
|
|
22220
22221
|
),
|
|
22221
22222
|
children: de && xs && /* @__PURE__ */ r(
|
|
22222
22223
|
Dr,
|
|
@@ -22225,11 +22226,11 @@ const iy = () => {
|
|
|
22225
22226
|
hasToC: !0,
|
|
22226
22227
|
items: Ho,
|
|
22227
22228
|
setItems: li,
|
|
22228
|
-
showTOC:
|
|
22229
|
+
showTOC: un,
|
|
22229
22230
|
setShowTOC: we,
|
|
22230
22231
|
isPreviewMode: e || !ft,
|
|
22231
22232
|
orientation: xe == null ? void 0 : xe.orientation,
|
|
22232
|
-
tabs:
|
|
22233
|
+
tabs: Cn,
|
|
22233
22234
|
setTabs: ci,
|
|
22234
22235
|
activeTabId: Mt,
|
|
22235
22236
|
setActiveTabId: Ko,
|
|
@@ -22239,7 +22240,7 @@ const iy = () => {
|
|
|
22239
22240
|
duplicateTab: hi,
|
|
22240
22241
|
orderTab: mi,
|
|
22241
22242
|
deleteTab: pi,
|
|
22242
|
-
ydoc:
|
|
22243
|
+
ydoc: mn,
|
|
22243
22244
|
tabCommentCounts: Ci,
|
|
22244
22245
|
tabConfig: Nt,
|
|
22245
22246
|
isConnected: Me,
|
|
@@ -22262,16 +22263,16 @@ const iy = () => {
|
|
|
22262
22263
|
"flex min-h-full items-start",
|
|
22263
22264
|
// Split View: wrap to the right pane's width (no min-w-max),
|
|
22264
22265
|
// so there's no horizontal scroll.
|
|
22265
|
-
!
|
|
22266
|
+
!sn && !Ue && "min-w-max"
|
|
22266
22267
|
),
|
|
22267
22268
|
children: /* @__PURE__ */ r(
|
|
22268
22269
|
"div",
|
|
22269
22270
|
{
|
|
22270
22271
|
className: ye(
|
|
22271
22272
|
"editor-main-lane flex-grow min-w-0 flex overflow-visible items-stretch",
|
|
22272
|
-
!Ue && "mb-12",
|
|
22273
|
+
Ft && !Ue && "mb-12",
|
|
22273
22274
|
gd ? "justify-start" : "justify-center",
|
|
22274
|
-
|
|
22275
|
+
sn && "w-full",
|
|
22275
22276
|
!Ue && !e && !Ce && (ft ? "ddoc-md:mt-[0.8rem]" : null),
|
|
22276
22277
|
!Ue && e && "ddoc-md:mt-[1rem]",
|
|
22277
22278
|
{
|
|
@@ -22294,7 +22295,7 @@ const iy = () => {
|
|
|
22294
22295
|
{
|
|
22295
22296
|
className: ye(
|
|
22296
22297
|
"editor-comment-layout relative shrink-0 overflow-visible",
|
|
22297
|
-
|
|
22298
|
+
sn && "w-full"
|
|
22298
22299
|
),
|
|
22299
22300
|
style: {
|
|
22300
22301
|
...$s && {
|
|
@@ -22303,12 +22304,12 @@ const iy = () => {
|
|
|
22303
22304
|
// The rail absorbs the left gutter; this keeps the right
|
|
22304
22305
|
// one. With no rail, the left gutter is a margin too.
|
|
22305
22306
|
...Wo && {
|
|
22306
|
-
marginRight: ji + (
|
|
22307
|
+
marginRight: ji + (Ft ? kh : 0) + (vi ? Sh : 0),
|
|
22307
22308
|
marginLeft: ki ? void 0 : ji
|
|
22308
22309
|
}
|
|
22309
22310
|
},
|
|
22310
22311
|
children: [
|
|
22311
|
-
|
|
22312
|
+
sn && e && /* @__PURE__ */ v("p", { className: "text-center color-text-secondary text-helper-text-sm flex gap-2 items-center justify-center py-1.5", children: [
|
|
22312
22313
|
/* @__PURE__ */ r(
|
|
22313
22314
|
he,
|
|
22314
22315
|
{
|
|
@@ -22326,10 +22327,10 @@ const iy = () => {
|
|
|
22326
22327
|
className: ye(
|
|
22327
22328
|
"w-full flex-grow min-w-0 no-scrollbar rounded mx-auto",
|
|
22328
22329
|
!Wo && "transition-[width,max-width] duration-300 ease-in-out",
|
|
22329
|
-
!(xe != null && xe.canvasBackground) && !Ce && !
|
|
22330
|
+
!(xe != null && xe.canvasBackground) && !Ce && !Ft && "color-bg-default"
|
|
22330
22331
|
),
|
|
22331
22332
|
style: {
|
|
22332
|
-
...
|
|
22333
|
+
...sn ? {} : {
|
|
22333
22334
|
width: `${Ni}px`,
|
|
22334
22335
|
maxWidth: `${Ni}px`
|
|
22335
22336
|
},
|
|
@@ -22348,11 +22349,11 @@ const iy = () => {
|
|
|
22348
22349
|
className: ye(
|
|
22349
22350
|
"w-full",
|
|
22350
22351
|
e && "pt-3",
|
|
22351
|
-
|
|
22352
|
+
Ft && "relative isolate"
|
|
22352
22353
|
),
|
|
22353
22354
|
"data-ddoc-zoom-layer": "",
|
|
22354
22355
|
"data-ddoc-zoom": String(Dn),
|
|
22355
|
-
style:
|
|
22356
|
+
style: sn ? {} : Ue ? (
|
|
22356
22357
|
// Split View: fill the pane, no page width / zoom.
|
|
22357
22358
|
{ width: "100%" }
|
|
22358
22359
|
) : {
|
|
@@ -22361,7 +22362,7 @@ const iy = () => {
|
|
|
22361
22362
|
transformOrigin: "top left"
|
|
22362
22363
|
},
|
|
22363
22364
|
children: [
|
|
22364
|
-
|
|
22365
|
+
Ft && eo && /* @__PURE__ */ r(
|
|
22365
22366
|
oy,
|
|
22366
22367
|
{
|
|
22367
22368
|
editor: de,
|
|
@@ -22412,11 +22413,11 @@ const iy = () => {
|
|
|
22412
22413
|
/* @__PURE__ */ r(
|
|
22413
22414
|
"div",
|
|
22414
22415
|
{
|
|
22415
|
-
className: `${
|
|
22416
|
+
className: `${sn ? "px-9 pt-6" : "p-20"}`,
|
|
22416
22417
|
children: e ? /* @__PURE__ */ r(gc, {}) : /* @__PURE__ */ r(
|
|
22417
22418
|
yo,
|
|
22418
22419
|
{
|
|
22419
|
-
className: `${
|
|
22420
|
+
className: `${sn ? "w-full" : "w-[400px]"} h-[32px] rounded-sm mb-4`
|
|
22420
22421
|
}
|
|
22421
22422
|
)
|
|
22422
22423
|
}
|
|
@@ -22468,7 +22469,7 @@ const iy = () => {
|
|
|
22468
22469
|
}
|
|
22469
22470
|
),
|
|
22470
22471
|
ri && /* @__PURE__ */ r(
|
|
22471
|
-
|
|
22472
|
+
Ut.div,
|
|
22472
22473
|
{
|
|
22473
22474
|
initial: { opacity: 0, height: 0 },
|
|
22474
22475
|
animate: {
|
|
@@ -22512,7 +22513,7 @@ const iy = () => {
|
|
|
22512
22513
|
enableFanficTemplate: R,
|
|
22513
22514
|
runtimeState: nd,
|
|
22514
22515
|
onApplyTabbedTemplate: td,
|
|
22515
|
-
onCopyHeadingLink:
|
|
22516
|
+
onCopyHeadingLink: Wt,
|
|
22516
22517
|
children: /* @__PURE__ */ r("div", { className: "grammarly-wrapper", children: (qs != null && qs.length ? qs : de ? [
|
|
22517
22518
|
{
|
|
22518
22519
|
tabId: Mt,
|
|
@@ -22556,7 +22557,7 @@ const iy = () => {
|
|
|
22556
22557
|
className: ye(
|
|
22557
22558
|
"w-full h-auto",
|
|
22558
22559
|
e && "preview-mode",
|
|
22559
|
-
|
|
22560
|
+
wn !== void 0 && Wn && "has-available-models",
|
|
22560
22561
|
mt && "hide-inline-comments"
|
|
22561
22562
|
)
|
|
22562
22563
|
}
|
|
@@ -22611,7 +22612,7 @@ const iy = () => {
|
|
|
22611
22612
|
{
|
|
22612
22613
|
className: ye(
|
|
22613
22614
|
"editor-right-rail",
|
|
22614
|
-
!
|
|
22615
|
+
!sn && "max-w-[263px] w-full ddoc-xl:shrink-[2]",
|
|
22615
22616
|
!e && !Ce && ft && "-mt-[1.5rem] ddoc-md:mt-[0.8rem]",
|
|
22616
22617
|
e && "ddoc-md:mt-[1rem]",
|
|
22617
22618
|
{ "ddoc-md:mt-[0.7rem]": !e && !Ce },
|
|
@@ -22619,7 +22620,7 @@ const iy = () => {
|
|
|
22619
22620
|
"-mt-[1.5rem] ddoc-md:mt-[0.7rem]": !ft && !e
|
|
22620
22621
|
},
|
|
22621
22622
|
Ce && "mt-[48px]",
|
|
22622
|
-
Ce && !
|
|
22623
|
+
Ce && !un && Si && "hidden"
|
|
22623
22624
|
)
|
|
22624
22625
|
}
|
|
22625
22626
|
)
|
|
@@ -22662,7 +22663,7 @@ const iy = () => {
|
|
|
22662
22663
|
gl,
|
|
22663
22664
|
{
|
|
22664
22665
|
documentStyling: xe,
|
|
22665
|
-
theme:
|
|
22666
|
+
theme: xn ?? "light",
|
|
22666
22667
|
isFocusMode: Ce,
|
|
22667
22668
|
children: /* @__PURE__ */ r(
|
|
22668
22669
|
"div",
|
|
@@ -22673,8 +22674,8 @@ const iy = () => {
|
|
|
22673
22674
|
ge ? "color-bg-default" : "color-bg-secondary",
|
|
22674
22675
|
oi && "ddoc-editor-cq"
|
|
22675
22676
|
),
|
|
22676
|
-
"data-page-mode":
|
|
22677
|
-
style:
|
|
22677
|
+
"data-page-mode": Ft ? "pages" : void 0,
|
|
22678
|
+
style: Ft && eo ? {
|
|
22678
22679
|
"--ddoc-page-text-h": `${eo.textHeight}px`
|
|
22679
22680
|
} : void 0,
|
|
22680
22681
|
children: /* @__PURE__ */ r(zi.Provider, { value: In, children: /* @__PURE__ */ v(
|
|
@@ -22683,7 +22684,7 @@ const iy = () => {
|
|
|
22683
22684
|
zoomLevel: Zn,
|
|
22684
22685
|
scale: Dn,
|
|
22685
22686
|
fitScale: $o,
|
|
22686
|
-
setZoomLevel:
|
|
22687
|
+
setZoomLevel: dn,
|
|
22687
22688
|
children: [
|
|
22688
22689
|
wi ? /* @__PURE__ */ r("style", { dangerouslySetInnerHTML: { __html: wi } }) : null,
|
|
22689
22690
|
/* @__PURE__ */ v(
|
|
@@ -22691,7 +22692,7 @@ const iy = () => {
|
|
|
22691
22692
|
{
|
|
22692
22693
|
isInlineCommentAvailable: !gs && !mt && ct,
|
|
22693
22694
|
editor: de ?? null,
|
|
22694
|
-
ydoc:
|
|
22695
|
+
ydoc: mn,
|
|
22695
22696
|
isFocusMode: Ce,
|
|
22696
22697
|
username: o,
|
|
22697
22698
|
setUsername: i,
|
|
@@ -22700,20 +22701,20 @@ const iy = () => {
|
|
|
22700
22701
|
activeTabId: Mt,
|
|
22701
22702
|
focusCommentWithActiveId: Wc,
|
|
22702
22703
|
initialComments: St,
|
|
22703
|
-
setInitialComments:
|
|
22704
|
-
onNewComment:
|
|
22705
|
-
onEditComment:
|
|
22706
|
-
onEditReply:
|
|
22704
|
+
setInitialComments: gn,
|
|
22705
|
+
onNewComment: ln,
|
|
22706
|
+
onEditComment: Kt,
|
|
22707
|
+
onEditReply: cn,
|
|
22707
22708
|
onCommentReply: ms,
|
|
22708
22709
|
onResolveComment: Kn,
|
|
22709
22710
|
onUnresolveComment: En,
|
|
22710
|
-
onDeleteComment:
|
|
22711
|
+
onDeleteComment: yn,
|
|
22711
22712
|
onDeleteReply: ie,
|
|
22712
22713
|
ensResolutionUrl: y,
|
|
22713
22714
|
isConnected: Me,
|
|
22714
22715
|
connectViaWallet: st,
|
|
22715
|
-
isLoading:
|
|
22716
|
-
connectViaUsername:
|
|
22716
|
+
isLoading: Re,
|
|
22717
|
+
connectViaUsername: jt,
|
|
22717
22718
|
isDDocOwner: rt,
|
|
22718
22719
|
onInlineComment: se,
|
|
22719
22720
|
onComment: D,
|
|
@@ -22721,7 +22722,7 @@ const iy = () => {
|
|
|
22721
22722
|
commentAnchorsRef: Qc,
|
|
22722
22723
|
draftAnchorsRef: Zc,
|
|
22723
22724
|
storeApiRef: fi,
|
|
22724
|
-
initialCommentAnchors:
|
|
22725
|
+
initialCommentAnchors: an,
|
|
22725
22726
|
children: [
|
|
22726
22727
|
/* @__PURE__ */ r(
|
|
22727
22728
|
ay,
|
|
@@ -22739,7 +22740,7 @@ const iy = () => {
|
|
|
22739
22740
|
{
|
|
22740
22741
|
dropdownOpen: zc,
|
|
22741
22742
|
setDropdownOpen: Kc,
|
|
22742
|
-
showTOC:
|
|
22743
|
+
showTOC: un,
|
|
22743
22744
|
setShowTOC: we,
|
|
22744
22745
|
toggleFocusMode: Tt
|
|
22745
22746
|
}
|
|
@@ -22758,7 +22759,7 @@ const iy = () => {
|
|
|
22758
22759
|
// Split View: the right-pane wrapper owns the scroll.
|
|
22759
22760
|
Ue ? "overflow-hidden" : "overflow-auto",
|
|
22760
22761
|
ge ? "color-bg-default" : "color-bg-secondary",
|
|
22761
|
-
|
|
22762
|
+
xt
|
|
22762
22763
|
),
|
|
22763
22764
|
style: Ce ? void 0 : Ws(),
|
|
22764
22765
|
children: [
|
|
@@ -22782,7 +22783,7 @@ const iy = () => {
|
|
|
22782
22783
|
activeTabId: Mt,
|
|
22783
22784
|
onTabChange: Ko,
|
|
22784
22785
|
isPreviewMode: e,
|
|
22785
|
-
tabs:
|
|
22786
|
+
tabs: Cn,
|
|
22786
22787
|
mobileContainer: _c
|
|
22787
22788
|
}
|
|
22788
22789
|
) })
|
|
@@ -22863,11 +22864,11 @@ const iy = () => {
|
|
|
22863
22864
|
hasToC: !0,
|
|
22864
22865
|
items: Ho,
|
|
22865
22866
|
setItems: li,
|
|
22866
|
-
showTOC:
|
|
22867
|
+
showTOC: un,
|
|
22867
22868
|
setShowTOC: we,
|
|
22868
22869
|
isPreviewMode: !1,
|
|
22869
22870
|
orientation: xe == null ? void 0 : xe.orientation,
|
|
22870
|
-
tabs:
|
|
22871
|
+
tabs: Cn,
|
|
22871
22872
|
setTabs: ci,
|
|
22872
22873
|
activeTabId: Mt,
|
|
22873
22874
|
setActiveTabId: Ko,
|
|
@@ -22877,7 +22878,7 @@ const iy = () => {
|
|
|
22877
22878
|
duplicateTab: hi,
|
|
22878
22879
|
orderTab: mi,
|
|
22879
22880
|
deleteTab: pi,
|
|
22880
|
-
ydoc:
|
|
22881
|
+
ydoc: mn,
|
|
22881
22882
|
tabCommentCounts: Ci,
|
|
22882
22883
|
tabConfig: Nt,
|
|
22883
22884
|
isConnected: Me,
|
|
@@ -22930,7 +22931,7 @@ const iy = () => {
|
|
|
22930
22931
|
}
|
|
22931
22932
|
);
|
|
22932
22933
|
}
|
|
22933
|
-
), ly =
|
|
22934
|
+
), ly = bt(
|
|
22934
22935
|
({
|
|
22935
22936
|
isPreviewMode: e = !1,
|
|
22936
22937
|
initialContent: t,
|
|
@@ -23131,7 +23132,7 @@ const iy = () => {
|
|
|
23131
23132
|
}
|
|
23132
23133
|
),
|
|
23133
23134
|
/* @__PURE__ */ r(Ps, { children: Q && /* @__PURE__ */ r(
|
|
23134
|
-
|
|
23135
|
+
Ut.div,
|
|
23135
23136
|
{
|
|
23136
23137
|
initial: { opacity: 0, height: 0 },
|
|
23137
23138
|
animate: { opacity: 1, height: "auto" },
|
|
@@ -23190,7 +23191,7 @@ const iy = () => {
|
|
|
23190
23191
|
)
|
|
23191
23192
|
] });
|
|
23192
23193
|
}
|
|
23193
|
-
), lx =
|
|
23194
|
+
), lx = bt(
|
|
23194
23195
|
(e, t) => {
|
|
23195
23196
|
var i, a;
|
|
23196
23197
|
const n = !!((i = e.versionHistoryState) != null && i.enabled), s = ((a = e.versionHistoryState) == null ? void 0 : a.versionId) || "default", o = n ? s : "default";
|
|
@@ -23511,7 +23512,7 @@ function dx(e) {
|
|
|
23511
23512
|
t.isDestroyed || t.destroy();
|
|
23512
23513
|
}
|
|
23513
23514
|
}
|
|
23514
|
-
const ux = (e, t, n = "ecies") =>
|
|
23515
|
+
const ux = (e, t, n = "ecies") => Lt.encryptData(at(e), t, n), hx = (e, t) => Lt.decryptData(at(e), t);
|
|
23515
23516
|
function Fc(e, t, n, s) {
|
|
23516
23517
|
return {
|
|
23517
23518
|
wsUrl: e.wsUrl,
|
|
@@ -23565,7 +23566,7 @@ async function mx(e) {
|
|
|
23565
23566
|
);
|
|
23566
23567
|
try {
|
|
23567
23568
|
await Bc(t);
|
|
23568
|
-
const n =
|
|
23569
|
+
const n = at(e.roomKey), s = [];
|
|
23569
23570
|
let o;
|
|
23570
23571
|
for (; ; ) {
|
|
23571
23572
|
const i = await t.fetchHydrationRange(o);
|
|
@@ -23573,7 +23574,7 @@ async function mx(e) {
|
|
|
23573
23574
|
throw new Error((i == null ? void 0 : i.error) || "fetchSessionState: history pull failed");
|
|
23574
23575
|
for (const a of i.data.history)
|
|
23575
23576
|
try {
|
|
23576
|
-
s.push(
|
|
23577
|
+
s.push(Lt.decryptData(n, a.data));
|
|
23577
23578
|
} catch {
|
|
23578
23579
|
}
|
|
23579
23580
|
if (i.data.hasMore && typeof i.data.nextSeq == "number") {
|
|
@@ -23597,8 +23598,8 @@ async function px(e) {
|
|
|
23597
23598
|
);
|
|
23598
23599
|
try {
|
|
23599
23600
|
await Bc(t);
|
|
23600
|
-
const n =
|
|
23601
|
-
|
|
23601
|
+
const n = Lt.encryptData(
|
|
23602
|
+
at(e.newRoomKey),
|
|
23602
23603
|
e.state,
|
|
23603
23604
|
t.getWireFormat()
|
|
23604
23605
|
), s = await t.sendSnapshot({ data: n, floorSeq: 0 });
|