@w100n/documents 0.19.0 → 0.19.1

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.js CHANGED
@@ -2412,8 +2412,8 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
2412
2412
 
2413
2413
  // src/DocumentOverlay.tsx
2414
2414
  import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2415
- var TextEditor = lazy(() => import("./TextEditor-Z4KSBLBV.js"));
2416
- var SheetView = lazy(() => import("./SheetView-PUSRW7W2.js"));
2415
+ var TextEditor = lazy(() => import("./TextEditor-U3WODH75.js"));
2416
+ var SheetView = lazy(() => import("./SheetView-P3GH4U73.js"));
2417
2417
  var icons = { docx: FileText, markdown: FileType, pdf: Files, sheet: FileSpreadsheet, slides: Presentation };
2418
2418
  var read = { view: true, comment: false, edit: false };
2419
2419
  var quiet = () => {
@@ -3461,7 +3461,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
3461
3461
  e.dataTransfer.effectAllowed = "move";
3462
3462
  },
3463
3463
  onClick: () => onOpen(item),
3464
- onPointerEnter: (e) => onWarm(item, e.pointerType === "mouse" ? e.currentTarget.getBoundingClientRect() : void 0),
3464
+ onPointerEnter: () => onWarm(item),
3465
3465
  onPointerLeave: () => onWarm(null),
3466
3466
  onContextMenu: (e) => {
3467
3467
  e.preventDefault();
@@ -3501,8 +3501,8 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
3501
3501
 
3502
3502
  // src/DocumentsWorkspace.tsx
3503
3503
  import { Fragment as Fragment11, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
3504
- var TextEditor2 = lazy2(() => import("./TextEditor-Z4KSBLBV.js"));
3505
- var SheetView2 = lazy2(() => import("./SheetView-PUSRW7W2.js"));
3504
+ var TextEditor2 = lazy2(() => import("./TextEditor-U3WODH75.js"));
3505
+ var SheetView2 = lazy2(() => import("./SheetView-P3GH4U73.js"));
3506
3506
  var Compare = lazy2(() => import("./Compare-RHAUAKUJ.js"));
3507
3507
  function DocumentsWorkspace({ host, language = "en", theme = "light", place, onPlace, start, end, aside, actions }) {
3508
3508
  const t = texts[language];
@@ -3588,8 +3588,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3588
3588
  const [notice, setNotice] = useState11(null);
3589
3589
  const early = useRef6(/* @__PURE__ */ new Map());
3590
3590
  const hover = useRef6(0);
3591
- const peeking = useRef6(0);
3592
- const [peek, setPeek] = useState11(null);
3593
3591
  useEffect6(() => {
3594
3592
  if (!menu && !spot2) return;
3595
3593
  const close = (e) => {
@@ -3802,14 +3800,12 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
3802
3800
  setKept({ id: file.id, state: "failed" });
3803
3801
  }
3804
3802
  };
3805
- const warm = (item, at) => {
3806
- clearTimeout(peeking.current);
3807
- if (at) peeking.current = window.setTimeout(() => setPeek({ item, x: Math.min(at.right + 8, innerWidth - 300), y: Math.min(at.top, innerHeight - 300) }), 500);
3803
+ const warm = (item) => {
3808
3804
  clearTimeout(hover.current);
3809
3805
  hover.current = window.setTimeout(() => {
3810
3806
  if (item.id === here.documentId) return;
3811
- if (item.kind === "docx" || item.kind === "markdown") void import("./TextEditor-Z4KSBLBV.js");
3812
- if (item.kind === "sheet") void import("./SheetView-PUSRW7W2.js");
3807
+ if (item.kind === "docx" || item.kind === "markdown") void import("./TextEditor-U3WODH75.js");
3808
+ if (item.kind === "sheet") void import("./SheetView-P3GH4U73.js");
3813
3809
  const kept2 = early.current.get(item.id);
3814
3810
  if (kept2 && Date.now() - kept2.at < 15e3 || item.size > 5e6) return;
3815
3811
  const next = { at: Date.now(), doc: host.document(item.id), bytes: host.content(item.id, null) };
@@ -4338,7 +4334,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
4338
4334
  onOpen: open,
4339
4335
  onMenu: (item, e) => {
4340
4336
  setSpot(null);
4341
- setPeek(null);
4342
4337
  setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
4343
4338
  },
4344
4339
  onFolderMenu: host.create || host.makeFolder ? (at, key, e) => {
@@ -4349,13 +4344,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
4349
4344
  const item = all.find((x) => x.id === id);
4350
4345
  if (item) moveTo(item, to);
4351
4346
  } : void 0,
4352
- onWarm: (item, at) => {
4353
- if (item) warm(item, at);
4354
- else {
4355
- clearTimeout(hover.current);
4356
- setPeek(null);
4357
- }
4358
- }
4347
+ onWarm: (item) => item ? warm(item) : clearTimeout(hover.current)
4359
4348
  }
4360
4349
  )
4361
4350
  ] })
@@ -4539,7 +4528,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
4539
4528
  setMaking(false);
4540
4529
  opened(made);
4541
4530
  } }),
4542
- peek && !menu && /* @__PURE__ */ jsx13("div", { className: "w100n-docs-peek", role: "tooltip", style: { left: peek.x, top: peek.y }, children: card(peek.item) }),
4543
4531
  menu && /* @__PURE__ */ jsxs13("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
4544
4532
  /* @__PURE__ */ jsx13("div", { className: "w100n-docs-context-head", children: card(menu.item) }),
4545
4533
  menu.moving ? /* @__PURE__ */ jsx13("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ jsxs13(
@@ -4710,8 +4698,8 @@ function FilePreview({ url, name, mimeType, size = 0, bytes, pdfWorker }) {
4710
4698
  import { lazy as lazy3, Suspense as Suspense3, useRef as useRef7, useState as useState13 } from "react";
4711
4699
  import { Ban as Ban2, Download as Download4, Eye as Eye2, FileDown as FileDown2, FileSpreadsheet as FileSpreadsheet5, FileText as FileText5, FileType as FileType6, Files as Files3, Lock as Lock2, Presentation as Presentation4, UserRound } from "lucide-react";
4712
4700
  import { Fragment as Fragment12, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
4713
- var TextEditor3 = lazy3(() => import("./TextEditor-Z4KSBLBV.js"));
4714
- var SheetView3 = lazy3(() => import("./SheetView-PUSRW7W2.js"));
4701
+ var TextEditor3 = lazy3(() => import("./TextEditor-U3WODH75.js"));
4702
+ var SheetView3 = lazy3(() => import("./SheetView-P3GH4U73.js"));
4715
4703
  var icons4 = { docx: FileText5, markdown: FileType6, pdf: Files3, sheet: FileSpreadsheet5, slides: Presentation4 };
4716
4704
  var GuestRefused = class extends Error {
4717
4705
  constructor(reason, file = "", sharedBy = "") {