@w100n/documents 0.18.0 → 0.19.0
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/{SheetView-43JDIP7D.js → SheetView-PUSRW7W2.js} +3 -3
- package/dist/{TextEditor-CYS4U5XA.js → TextEditor-Z4KSBLBV.js} +3 -3
- package/dist/{chunk-ZCSHH24C.js → chunk-JSJEB2CO.js} +192 -60
- package/dist/chunk-JSJEB2CO.js.map +1 -0
- package/dist/{chunk-DATYTA4H.js → chunk-ZQYSBWLK.js} +2 -2
- package/dist/collab.cjs +326 -187
- package/dist/collab.cjs.map +1 -1
- package/dist/collab.d.cts +27 -1
- package/dist/collab.d.ts +27 -1
- package/dist/collab.js +9 -1
- package/dist/index.cjs +373 -396
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +134 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +375 -402
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-ZCSHH24C.js.map +0 -1
- /package/dist/{SheetView-43JDIP7D.js.map → SheetView-PUSRW7W2.js.map} +0 -0
- /package/dist/{TextEditor-CYS4U5XA.js.map → TextEditor-Z4KSBLBV.js.map} +0 -0
- /package/dist/{chunk-DATYTA4H.js.map → chunk-ZQYSBWLK.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -4993,7 +4993,7 @@ var init_wiki = __esm({
|
|
|
4993
4993
|
var version;
|
|
4994
4994
|
var init_package = __esm({
|
|
4995
4995
|
"package.json"() {
|
|
4996
|
-
version = "0.
|
|
4996
|
+
version = "0.19.0";
|
|
4997
4997
|
}
|
|
4998
4998
|
});
|
|
4999
4999
|
|
|
@@ -11058,15 +11058,15 @@ function changes2(before, after) {
|
|
|
11058
11058
|
}
|
|
11059
11059
|
function Compare({ host, documentId, kind, older, t }) {
|
|
11060
11060
|
const rows = useLoad(async (signal) => changes2(await textOf2(kind, older), await textOf2(kind, await host.content(documentId, null, { signal }))), [host, documentId, older]);
|
|
11061
|
-
if (rows.error) return /* @__PURE__ */ (0,
|
|
11062
|
-
if (!rows.data) return /* @__PURE__ */ (0,
|
|
11061
|
+
if (rows.error) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
|
|
11062
|
+
if (!rows.data) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
|
|
11063
11063
|
const added = rows.data.filter((r) => r.op === "+").length, removed = rows.data.filter((r) => r.op === "-").length, edited = rows.data.filter((r) => r.op === "~").length;
|
|
11064
|
-
return /* @__PURE__ */ (0,
|
|
11065
|
-
/* @__PURE__ */ (0,
|
|
11066
|
-
rows.data.map((r, i) => /* @__PURE__ */ (0,
|
|
11064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-page w100n-compare", children: [
|
|
11065
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "w100n-compare-sum", children: added + removed + edited ? t.changeCount.replace("{added}", String(added)).replace("{edited}", String(edited)).replace("{removed}", String(removed)) : t.noChanges }),
|
|
11066
|
+
rows.data.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { "data-op": r.op, children: r.parts.map((p, k) => p.op === "=" ? p.text : p.op === "+" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("ins", { children: p.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("del", { children: p.text }, k)) }, i))
|
|
11067
11067
|
] }) });
|
|
11068
11068
|
}
|
|
11069
|
-
var
|
|
11069
|
+
var import_jsx_runtime17, words2, alike;
|
|
11070
11070
|
var init_Compare = __esm({
|
|
11071
11071
|
"src/Compare.tsx"() {
|
|
11072
11072
|
"use strict";
|
|
@@ -11074,7 +11074,7 @@ var init_Compare = __esm({
|
|
|
11074
11074
|
init_diff();
|
|
11075
11075
|
init_markdown();
|
|
11076
11076
|
init_useLoad();
|
|
11077
|
-
|
|
11077
|
+
import_jsx_runtime17 = require("react/jsx-runtime");
|
|
11078
11078
|
words2 = (text) => text.split(/(\s+)/).filter(Boolean);
|
|
11079
11079
|
alike = (a, b) => {
|
|
11080
11080
|
const x = a.split(/\s+/).filter(Boolean), y = b.split(/\s+/).filter(Boolean);
|
|
@@ -11091,6 +11091,7 @@ __export(index_exports, {
|
|
|
11091
11091
|
FilePreview: () => FilePreview,
|
|
11092
11092
|
GuestDocument: () => GuestDocument,
|
|
11093
11093
|
GuestRefused: () => GuestRefused,
|
|
11094
|
+
PreviewCard: () => PreviewCard,
|
|
11094
11095
|
SlidesView: () => SlidesView,
|
|
11095
11096
|
kindOf: () => kindOf,
|
|
11096
11097
|
kinds: () => kinds,
|
|
@@ -14289,6 +14290,19 @@ function Sharing({ host, doc, t, language, team }) {
|
|
|
14289
14290
|
// src/DocumentsWorkspace.tsx
|
|
14290
14291
|
init_text();
|
|
14291
14292
|
|
|
14293
|
+
// src/PreviewCard.tsx
|
|
14294
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
14295
|
+
function PreviewCard({ thumb, icon, title, lines: lines2 }) {
|
|
14296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-card", children: [
|
|
14297
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-card-thumb", children: thumb }),
|
|
14298
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-card-title", children: [
|
|
14299
|
+
icon,
|
|
14300
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: title })
|
|
14301
|
+
] }),
|
|
14302
|
+
lines2.filter(Boolean).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: line }, i))
|
|
14303
|
+
] });
|
|
14304
|
+
}
|
|
14305
|
+
|
|
14292
14306
|
// src/Thumb.tsx
|
|
14293
14307
|
var import_react17 = require("react");
|
|
14294
14308
|
|
|
@@ -14343,7 +14357,7 @@ function preview(host, doc) {
|
|
|
14343
14357
|
}
|
|
14344
14358
|
|
|
14345
14359
|
// src/Thumb.tsx
|
|
14346
|
-
var
|
|
14360
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
14347
14361
|
function Thumb({ host, item, label }) {
|
|
14348
14362
|
const box2 = (0, import_react17.useRef)(null);
|
|
14349
14363
|
const [seen2, setSeen] = (0, import_react17.useState)(false);
|
|
@@ -14369,26 +14383,26 @@ function Thumb({ host, item, label }) {
|
|
|
14369
14383
|
const text = item.excerpt ?? shot?.text ?? "";
|
|
14370
14384
|
const lines2 = text.split("\n").filter((line) => !line.trim().startsWith("```")).map((line) => line.replace(/^#+\s*/, "").replace(/[*_`>|]/g, "").trim()).filter(Boolean);
|
|
14371
14385
|
const image = item.thumbnailUrl ?? shot?.image;
|
|
14372
|
-
return /* @__PURE__ */ (0,
|
|
14373
|
-
image ? /* @__PURE__ */ (0,
|
|
14374
|
-
/* @__PURE__ */ (0,
|
|
14386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { ref: box2, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
|
|
14387
|
+
image ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines2.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
14388
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: lines2[0] }),
|
|
14375
14389
|
lines2.slice(1, 14).join(" ")
|
|
14376
|
-
] }) : /* @__PURE__ */ (0,
|
|
14377
|
-
/* @__PURE__ */ (0,
|
|
14378
|
-
/* @__PURE__ */ (0,
|
|
14379
|
-
/* @__PURE__ */ (0,
|
|
14380
|
-
/* @__PURE__ */ (0,
|
|
14381
|
-
/* @__PURE__ */ (0,
|
|
14390
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
14391
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
|
|
14392
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
|
|
14393
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
|
|
14394
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {}),
|
|
14395
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("i", {})
|
|
14382
14396
|
] }) }),
|
|
14383
|
-
label && /* @__PURE__ */ (0,
|
|
14397
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
|
|
14384
14398
|
] });
|
|
14385
14399
|
}
|
|
14386
14400
|
|
|
14387
14401
|
// src/Tree.tsx
|
|
14388
14402
|
var import_react18 = require("react");
|
|
14389
14403
|
var import_lucide_react12 = require("lucide-react");
|
|
14390
|
-
var
|
|
14391
|
-
var icons3 = { docx: import_lucide_react12.FileText, markdown: import_lucide_react12.FileType, pdf: import_lucide_react12.
|
|
14404
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
14405
|
+
var icons3 = { docx: import_lucide_react12.FileText, markdown: import_lucide_react12.FileType, pdf: import_lucide_react12.File, sheet: import_lucide_react12.FileSpreadsheet, slides: import_lucide_react12.Presentation };
|
|
14392
14406
|
var dragged = "application/x-w100n-document";
|
|
14393
14407
|
function grow(items, folders, names2, spaceId, other) {
|
|
14394
14408
|
const root = { key: "", name: "", at: spaceId ? { spaceId, folder: "" } : null, folders: [], files: [], count: 0 };
|
|
@@ -14429,7 +14443,7 @@ var remembered = () => {
|
|
|
14429
14443
|
return /* @__PURE__ */ new Set();
|
|
14430
14444
|
}
|
|
14431
14445
|
};
|
|
14432
|
-
function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen, onMenu, onFolderMenu, onMove, onEdit, onEditDone, onWarm }) {
|
|
14446
|
+
function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits, onOpen, onMenu, onFolderMenu, onMove, onEdit, onEditDone, onWarm }) {
|
|
14433
14447
|
const [closed2, setClosed] = (0, import_react18.useState)(remembered);
|
|
14434
14448
|
const [over, setOver] = (0, import_react18.useState)(null);
|
|
14435
14449
|
const flip = (key2) => {
|
|
@@ -14438,7 +14452,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
14438
14452
|
setClosed(next);
|
|
14439
14453
|
localStorage.setItem("w100n-docs-closed", JSON.stringify([...next]));
|
|
14440
14454
|
};
|
|
14441
|
-
const field = (pad, label) => /* @__PURE__ */ (0,
|
|
14455
|
+
const field = (pad, label) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14442
14456
|
"input",
|
|
14443
14457
|
{
|
|
14444
14458
|
className: "w100n-tree-row w100n-tree-input",
|
|
@@ -14475,12 +14489,12 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
14475
14489
|
onMove(id, b.at);
|
|
14476
14490
|
}
|
|
14477
14491
|
} : {};
|
|
14478
|
-
const branch = (b, depth) => /* @__PURE__ */ (0,
|
|
14492
|
+
const branch = (b, depth) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
14479
14493
|
edit?.key === `new:${b.key}` && field(24 + depth * 16, t.folderName),
|
|
14480
14494
|
b.folders.map((f) => {
|
|
14481
14495
|
const open = !closed2.has(f.key) || edit?.key === `new:${f.key}`;
|
|
14482
|
-
return /* @__PURE__ */ (0,
|
|
14483
|
-
edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */ (0,
|
|
14496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { role: "group", "aria-label": f.name, "data-over": over === f.key || void 0, ...target(f), children: [
|
|
14497
|
+
edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14484
14498
|
"button",
|
|
14485
14499
|
{
|
|
14486
14500
|
type: "button",
|
|
@@ -14494,10 +14508,10 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
14494
14508
|
onFolderMenu(f.at, f.key, e);
|
|
14495
14509
|
} : void 0,
|
|
14496
14510
|
children: [
|
|
14497
|
-
open ? /* @__PURE__ */ (0,
|
|
14498
|
-
/* @__PURE__ */ (0,
|
|
14499
|
-
/* @__PURE__ */ (0,
|
|
14500
|
-
f.count > 0 && /* @__PURE__ */ (0,
|
|
14511
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.ChevronDown, { "aria-hidden": true, className: "w100n-tree-fold" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.ChevronRight, { "aria-hidden": true, className: "w100n-tree-fold" }),
|
|
14512
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react12.Folder, { "aria-hidden": true }),
|
|
14513
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: f.name }),
|
|
14514
|
+
f.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { children: f.count })
|
|
14501
14515
|
]
|
|
14502
14516
|
}
|
|
14503
14517
|
),
|
|
@@ -14506,8 +14520,9 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
14506
14520
|
}),
|
|
14507
14521
|
b.files.map((item) => {
|
|
14508
14522
|
const Icon = icons3[item.kind];
|
|
14509
|
-
if (edit?.key === `file:${item.id}`) return /* @__PURE__ */ (0,
|
|
14510
|
-
|
|
14523
|
+
if (edit?.key === `file:${item.id}`) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: field(24 + depth * 16, t.rename) }, item.id);
|
|
14524
|
+
const hit = hits?.get(item.id);
|
|
14525
|
+
const row2 = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
14511
14526
|
"button",
|
|
14512
14527
|
{
|
|
14513
14528
|
type: "button",
|
|
@@ -14521,7 +14536,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
14521
14536
|
e.dataTransfer.effectAllowed = "move";
|
|
14522
14537
|
},
|
|
14523
14538
|
onClick: () => onOpen(item),
|
|
14524
|
-
onPointerEnter: () => onWarm(item),
|
|
14539
|
+
onPointerEnter: (e) => onWarm(item, e.pointerType === "mouse" ? e.currentTarget.getBoundingClientRect() : void 0),
|
|
14525
14540
|
onPointerLeave: () => onWarm(null),
|
|
14526
14541
|
onContextMenu: (e) => {
|
|
14527
14542
|
e.preventDefault();
|
|
@@ -14529,17 +14544,21 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
14529
14544
|
onMenu(item, e);
|
|
14530
14545
|
},
|
|
14531
14546
|
children: [
|
|
14532
|
-
/* @__PURE__ */ (0,
|
|
14533
|
-
/* @__PURE__ */ (0,
|
|
14534
|
-
item.kind !== "markdown" && /* @__PURE__ */ (0,
|
|
14547
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Icon, { "aria-hidden": true, "data-kind": item.kind }),
|
|
14548
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: item.name.replace(/\.[^.]+$/, "") }),
|
|
14549
|
+
item.kind !== "markdown" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { className: "w100n-tree-kind", children: t.kinds[item.kind] })
|
|
14535
14550
|
]
|
|
14536
14551
|
},
|
|
14537
14552
|
item.id
|
|
14538
14553
|
);
|
|
14554
|
+
return hit ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
|
|
14555
|
+
row2,
|
|
14556
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("small", { className: "w100n-tree-hit", style: { paddingLeft: 46 + depth * 16 }, children: hit.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("mark", { children: part }, i) : part) })
|
|
14557
|
+
] }, item.id) : row2;
|
|
14539
14558
|
})
|
|
14540
14559
|
] });
|
|
14541
14560
|
const root = grow(items, folders, names2, spaceId, t.elsewhere);
|
|
14542
|
-
return /* @__PURE__ */ (0,
|
|
14561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
14543
14562
|
"nav",
|
|
14544
14563
|
{
|
|
14545
14564
|
className: "w100n-tree",
|
|
@@ -14557,11 +14576,10 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
14557
14576
|
|
|
14558
14577
|
// src/DocumentsWorkspace.tsx
|
|
14559
14578
|
init_useLoad();
|
|
14560
|
-
var
|
|
14579
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
14561
14580
|
var TextEditor3 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
|
|
14562
14581
|
var SheetView3 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
|
|
14563
14582
|
var Compare2 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_Compare(), Compare_exports)));
|
|
14564
|
-
var icons4 = { docx: import_lucide_react13.FileText, markdown: import_lucide_react13.FileType, pdf: import_lucide_react13.Files, sheet: import_lucide_react13.FileSpreadsheet, slides: import_lucide_react13.Presentation };
|
|
14565
14583
|
function DocumentsWorkspace({ host, language = "en", theme = "light", place: place2, onPlace, start, end, aside, actions }) {
|
|
14566
14584
|
const t = texts[language];
|
|
14567
14585
|
const [own, setOwn] = (0, import_react19.useState)({ spaceId: null, documentId: null });
|
|
@@ -14578,7 +14596,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14578
14596
|
const [renamed2, setRenamed] = (0, import_react19.useState)("idle");
|
|
14579
14597
|
const [statusAt, setStatusAt] = (0, import_react19.useState)(null);
|
|
14580
14598
|
const [listOpen, setListOpen] = (0, import_react19.useState)(true);
|
|
14581
|
-
const [shape3, setShape] = (0, import_react19.useState)(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-view") === "tree" ? "tree" : "cards");
|
|
14582
14599
|
const [jump, setJump] = (0, import_react19.useState)(null);
|
|
14583
14600
|
const finder = (0, import_react19.useRef)(null);
|
|
14584
14601
|
const [panelOpen, setPanelOpen] = (0, import_react19.useState)(true);
|
|
@@ -14636,10 +14653,19 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14636
14653
|
const [menu, setMenu] = (0, import_react19.useState)(null);
|
|
14637
14654
|
const [spot3, setSpot] = (0, import_react19.useState)(null);
|
|
14638
14655
|
const [edit, setEdit] = (0, import_react19.useState)(null);
|
|
14639
|
-
const
|
|
14656
|
+
const popup = (0, import_react19.useRef)(null);
|
|
14657
|
+
(0, import_react19.useLayoutEffect)(() => {
|
|
14658
|
+
const el = popup.current;
|
|
14659
|
+
const at2 = menu ?? spot3;
|
|
14660
|
+
if (!el || !at2) return;
|
|
14661
|
+
el.style.top = `${Math.max(8, Math.min(at2.y, innerHeight - el.offsetHeight - 8))}px`;
|
|
14662
|
+
el.style.left = `${Math.max(8, Math.min(at2.x, innerWidth - el.offsetWidth - 8))}px`;
|
|
14663
|
+
}, [menu, spot3]);
|
|
14640
14664
|
const [notice, setNotice] = (0, import_react19.useState)(null);
|
|
14641
14665
|
const early = (0, import_react19.useRef)(/* @__PURE__ */ new Map());
|
|
14642
14666
|
const hover = (0, import_react19.useRef)(0);
|
|
14667
|
+
const peeking = (0, import_react19.useRef)(0);
|
|
14668
|
+
const [peek, setPeek] = (0, import_react19.useState)(null);
|
|
14643
14669
|
(0, import_react19.useEffect)(() => {
|
|
14644
14670
|
if (!menu && !spot3) return;
|
|
14645
14671
|
const close = (e) => {
|
|
@@ -14727,7 +14753,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14727
14753
|
const inside2 = new Map((deep.data ?? []).map((hit2) => [hit2.id, hit2.excerpt]));
|
|
14728
14754
|
const shown = all.filter((item) => matches(item, query, picked) || inside2.has(item.id) && matches(item, "", picked));
|
|
14729
14755
|
const present = kinds.filter((item) => all.some((doc2) => doc2.kind === item));
|
|
14730
|
-
const folders = spaceId ? [.../* @__PURE__ */ new Set(["", ...shown.map((item) => item.folder ?? "")])].filter((folder2) => shown.some((item) => (item.folder ?? "") === folder2)) : [""];
|
|
14731
14756
|
const names2 = new Map((spaces.data ?? []).map((item) => [item.id, item.name]));
|
|
14732
14757
|
const counts = /* @__PURE__ */ new Map();
|
|
14733
14758
|
for (const item of all) counts.set(item.spaceId, (counts.get(item.spaceId) ?? 0) + 1);
|
|
@@ -14742,9 +14767,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14742
14767
|
return new Intl.DateTimeFormat(language, { day: "numeric", month: "short", year: "numeric" }).format(new Date(iso));
|
|
14743
14768
|
};
|
|
14744
14769
|
const size2 = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(0)} KB` : `${(bytes / 1048576).toFixed(1)} MB`;
|
|
14745
|
-
const failed = (retry) => /* @__PURE__ */ (0,
|
|
14770
|
+
const failed = (retry) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-note", children: [
|
|
14746
14771
|
t.failed,
|
|
14747
|
-
/* @__PURE__ */ (0,
|
|
14772
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: retry, children: t.retry })
|
|
14748
14773
|
] });
|
|
14749
14774
|
const { ask, dialog } = useUnsaved(guard, t);
|
|
14750
14775
|
const side2 = (which, open2) => {
|
|
@@ -14853,7 +14878,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14853
14878
|
setKept({ id: file.id, state: "failed" });
|
|
14854
14879
|
}
|
|
14855
14880
|
};
|
|
14856
|
-
const warm = (item) => {
|
|
14881
|
+
const warm = (item, at2) => {
|
|
14882
|
+
clearTimeout(peeking.current);
|
|
14883
|
+
if (at2) peeking.current = window.setTimeout(() => setPeek({ item, x: Math.min(at2.right + 8, innerWidth - 300), y: Math.min(at2.top, innerHeight - 300) }), 500);
|
|
14857
14884
|
clearTimeout(hover.current);
|
|
14858
14885
|
hover.current = window.setTimeout(() => {
|
|
14859
14886
|
if (item.id === here.documentId) return;
|
|
@@ -14869,6 +14896,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14869
14896
|
early.current.set(item.id, next);
|
|
14870
14897
|
}, 150);
|
|
14871
14898
|
};
|
|
14899
|
+
const card = (item) => {
|
|
14900
|
+
const Icon = icons3[item.kind];
|
|
14901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(PreviewCard, { thumb: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }), icon: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { "aria-hidden": true, "data-kind": item.kind }), title: item.name, lines: [
|
|
14902
|
+
[t.kinds[item.kind], size2(item.size), names2.get(item.spaceId), item.folder].filter(Boolean).join(" \xB7 "),
|
|
14903
|
+
item.createdAt && [t.createdOn.replace("{when}", date(item.createdAt)), item.createdBy?.name].filter(Boolean).join(" \xB7 "),
|
|
14904
|
+
[t.updatedOn.replace("{when}", ago(item.updatedAt)), item.updatedBy?.name].filter(Boolean).join(" \xB7 "),
|
|
14905
|
+
inside2.get(item.id)?.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("mark", { children: part }, i) : part)
|
|
14906
|
+
] });
|
|
14907
|
+
};
|
|
14872
14908
|
const act = async (run3, done) => {
|
|
14873
14909
|
setMenu(null);
|
|
14874
14910
|
setSpot(null);
|
|
@@ -14887,7 +14923,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14887
14923
|
setTimeout(() => URL.revokeObjectURL(url), 1e3);
|
|
14888
14924
|
};
|
|
14889
14925
|
const retitle = async (item, draft) => {
|
|
14890
|
-
setNaming(null);
|
|
14891
14926
|
const ext = /\.[^.]+$/.exec(item.name)?.[0] ?? "";
|
|
14892
14927
|
const name = draft.trim() && (/\.[^.\s]+$/.test(draft.trim()) ? draft.trim() : draft.trim() + ext);
|
|
14893
14928
|
if (!name || name === item.name) return;
|
|
@@ -14999,8 +15034,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14999
15034
|
window.addEventListener("keydown", press, true);
|
|
15000
15035
|
return () => window.removeEventListener("keydown", press, true);
|
|
15001
15036
|
});
|
|
15002
|
-
let stage = /* @__PURE__ */ (0,
|
|
15003
|
-
/* @__PURE__ */ (0,
|
|
15037
|
+
let stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-empty", children: [
|
|
15038
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileText, { "aria-hidden": true }),
|
|
15004
15039
|
t.pick
|
|
15005
15040
|
] });
|
|
15006
15041
|
if (here.documentId) {
|
|
@@ -15008,9 +15043,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15008
15043
|
doc.retry();
|
|
15009
15044
|
content.retry();
|
|
15010
15045
|
});
|
|
15011
|
-
else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0,
|
|
15012
|
-
else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0,
|
|
15013
|
-
else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0,
|
|
15046
|
+
else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
|
|
15047
|
+
else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Compare2, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
|
|
15048
|
+
else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15014
15049
|
TextEditor3,
|
|
15015
15050
|
{
|
|
15016
15051
|
kind: doc.data.kind,
|
|
@@ -15047,7 +15082,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15047
15082
|
},
|
|
15048
15083
|
doc.data.id
|
|
15049
15084
|
) });
|
|
15050
|
-
else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0,
|
|
15085
|
+
else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15051
15086
|
PdfView,
|
|
15052
15087
|
{
|
|
15053
15088
|
bytes: content.data,
|
|
@@ -15069,7 +15104,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15069
15104
|
},
|
|
15070
15105
|
`${doc.data.id}:${versionId ?? ""}`
|
|
15071
15106
|
);
|
|
15072
|
-
else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0,
|
|
15107
|
+
else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15073
15108
|
SlidesView,
|
|
15074
15109
|
{
|
|
15075
15110
|
html: new TextDecoder().decode(content.data),
|
|
@@ -15088,7 +15123,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15088
15123
|
},
|
|
15089
15124
|
doc.data.id
|
|
15090
15125
|
);
|
|
15091
|
-
else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0,
|
|
15126
|
+
else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15092
15127
|
SheetView3,
|
|
15093
15128
|
{
|
|
15094
15129
|
bytes: content.data,
|
|
@@ -15115,9 +15150,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15115
15150
|
},
|
|
15116
15151
|
`${doc.data.id}:${versionId ?? ""}`
|
|
15117
15152
|
) });
|
|
15118
|
-
else stage = /* @__PURE__ */ (0,
|
|
15153
|
+
else stage = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
|
|
15119
15154
|
}
|
|
15120
|
-
const Kind = doc.data ?
|
|
15155
|
+
const Kind = doc.data ? icons3[doc.data.kind] : import_lucide_react13.FileText;
|
|
15121
15156
|
const top = Math.min(...outline2.map((h) => h.level));
|
|
15122
15157
|
const chapters = outline2.reduce((all2, h) => {
|
|
15123
15158
|
if (h.level === top || !all2.length) all2.push({ head: h, subs: [] });
|
|
@@ -15140,7 +15175,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15140
15175
|
if (text && host.comments && !versionId) panelTabs.push(["comments", import_lucide_react13.MessagesSquare, t.comments]);
|
|
15141
15176
|
const sharing = !!host.links && !!doc.data?.rights.edit && !versionId;
|
|
15142
15177
|
if (sharing) panelTabs.push(["sharing", import_lucide_react13.Share2, t.sharing]);
|
|
15143
|
-
const listToggle = /* @__PURE__ */ (0,
|
|
15178
|
+
const listToggle = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15144
15179
|
"button",
|
|
15145
15180
|
{
|
|
15146
15181
|
ref: listButton,
|
|
@@ -15150,10 +15185,10 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15150
15185
|
onClick: () => side2("list", !listOpen),
|
|
15151
15186
|
"aria-label": listOpen ? t.closeList : t.openList,
|
|
15152
15187
|
title: listOpen ? t.closeList : t.openList,
|
|
15153
|
-
children: listOpen ? /* @__PURE__ */ (0,
|
|
15188
|
+
children: listOpen ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelLeftOpen, { "aria-hidden": true })
|
|
15154
15189
|
}
|
|
15155
15190
|
);
|
|
15156
|
-
const panelToggle = doc.data && /* @__PURE__ */ (0,
|
|
15191
|
+
const panelToggle = doc.data && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15157
15192
|
"button",
|
|
15158
15193
|
{
|
|
15159
15194
|
ref: panelButton,
|
|
@@ -15163,16 +15198,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15163
15198
|
onClick: () => side2("panel", !panelOpen),
|
|
15164
15199
|
"aria-label": panelOpen ? t.closePanel : t.openPanel,
|
|
15165
15200
|
title: panelOpen ? t.closePanel : t.openPanel,
|
|
15166
|
-
children: panelOpen ? /* @__PURE__ */ (0,
|
|
15201
|
+
children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.PanelRightOpen, { "aria-hidden": true })
|
|
15167
15202
|
}
|
|
15168
15203
|
);
|
|
15169
|
-
return /* @__PURE__ */ (0,
|
|
15170
|
-
/* @__PURE__ */ (0,
|
|
15171
|
-
start && /* @__PURE__ */ (0,
|
|
15204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs", "data-theme": theme, children: [
|
|
15205
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("header", { className: "w100n-docs-bar", children: [
|
|
15206
|
+
start && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
|
|
15172
15207
|
narrow && listToggle,
|
|
15173
|
-
/* @__PURE__ */ (0,
|
|
15174
|
-
/* @__PURE__ */ (0,
|
|
15175
|
-
renaming !== null && doc.data ? /* @__PURE__ */ (0,
|
|
15208
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Kind, { "aria-hidden": true }) }),
|
|
15209
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-heading", children: [
|
|
15210
|
+
renaming !== null && doc.data ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15176
15211
|
"input",
|
|
15177
15212
|
{
|
|
15178
15213
|
className: "w100n-docs-title w100n-docs-rename",
|
|
@@ -15190,7 +15225,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15190
15225
|
}
|
|
15191
15226
|
}
|
|
15192
15227
|
}
|
|
15193
|
-
) : /* @__PURE__ */ (0,
|
|
15228
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15194
15229
|
"strong",
|
|
15195
15230
|
{
|
|
15196
15231
|
className: "w100n-docs-title",
|
|
@@ -15199,184 +15234,171 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15199
15234
|
children: doc.data?.name ?? t.documents
|
|
15200
15235
|
}
|
|
15201
15236
|
),
|
|
15202
|
-
docbar ? /* @__PURE__ */ (0,
|
|
15203
|
-
i > 0 && /* @__PURE__ */ (0,
|
|
15237
|
+
docbar ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { children: [
|
|
15238
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true }),
|
|
15204
15239
|
item
|
|
15205
|
-
] }, i)) }) : /* @__PURE__ */ (0,
|
|
15240
|
+
] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-hint", children: t.hint })
|
|
15206
15241
|
] }),
|
|
15207
|
-
versionId && /* @__PURE__ */ (0,
|
|
15208
|
-
versionId && text && /* @__PURE__ */ (0,
|
|
15209
|
-
/* @__PURE__ */ (0,
|
|
15242
|
+
versionId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
|
|
15243
|
+
versionId && text && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
|
|
15244
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileDiff, { "aria-hidden": true }),
|
|
15210
15245
|
comparing ? t.hideChanges : t.showChanges
|
|
15211
15246
|
] }),
|
|
15212
|
-
versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0,
|
|
15213
|
-
/* @__PURE__ */ (0,
|
|
15247
|
+
versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
|
|
15248
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.RotateCcw, { "aria-hidden": true }),
|
|
15214
15249
|
t.restore
|
|
15215
15250
|
] }),
|
|
15216
|
-
restoring === "failed" && /* @__PURE__ */ (0,
|
|
15217
|
-
doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0,
|
|
15218
|
-
/* @__PURE__ */ (0,
|
|
15251
|
+
restoring === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
|
|
15252
|
+
doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
|
|
15253
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileSpreadsheet, { "aria-hidden": true }),
|
|
15219
15254
|
t.copyAs
|
|
15220
15255
|
] }),
|
|
15221
|
-
copying === "failed" && /* @__PURE__ */ (0,
|
|
15222
|
-
kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ (0,
|
|
15223
|
-
kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0,
|
|
15224
|
-
renamed2 === "failed" && /* @__PURE__ */ (0,
|
|
15225
|
-
docbar && /* @__PURE__ */ (0,
|
|
15226
|
-
host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0,
|
|
15256
|
+
copying === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", children: t.copyFailed }),
|
|
15257
|
+
kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
|
|
15258
|
+
kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
|
|
15259
|
+
renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
|
|
15260
|
+
docbar && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
|
|
15261
|
+
host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15227
15262
|
"button",
|
|
15228
15263
|
{
|
|
15229
15264
|
type: "button",
|
|
15230
|
-
className: "w100n-docs-action",
|
|
15265
|
+
className: "w100n-docs-action w100n-docs-square",
|
|
15231
15266
|
"data-tone": "blue",
|
|
15232
15267
|
"aria-label": t.sendChat,
|
|
15233
15268
|
title: t.sendChat,
|
|
15234
15269
|
onClick: () => host.send(doc.data.id),
|
|
15235
|
-
children:
|
|
15236
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Send, { "aria-hidden": true }),
|
|
15237
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: t.sendChat })
|
|
15238
|
-
]
|
|
15270
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Send, { "aria-hidden": true })
|
|
15239
15271
|
}
|
|
15240
15272
|
),
|
|
15241
|
-
sharing && /* @__PURE__ */ (0,
|
|
15273
|
+
sharing && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-docs-action w100n-docs-square", "aria-label": t.share, title: t.share, onClick: () => {
|
|
15242
15274
|
setTab("sharing");
|
|
15243
15275
|
side2("panel", true);
|
|
15244
|
-
}, children:
|
|
15245
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Share2, { "aria-hidden": true }),
|
|
15246
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: t.share })
|
|
15247
|
-
] }),
|
|
15276
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Share2, { "aria-hidden": true }) }),
|
|
15248
15277
|
doc.data && !versionId && actions?.(doc.data),
|
|
15249
15278
|
narrow && panelToggle,
|
|
15250
|
-
end && /* @__PURE__ */ (0,
|
|
15279
|
+
end && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
|
|
15251
15280
|
] }),
|
|
15252
|
-
/* @__PURE__ */ (0,
|
|
15253
|
-
listOpen && /* @__PURE__ */ (0,
|
|
15254
|
-
/* @__PURE__ */ (0,
|
|
15255
|
-
/* @__PURE__ */ (0,
|
|
15256
|
-
/* @__PURE__ */ (0,
|
|
15257
|
-
/* @__PURE__ */ (0,
|
|
15281
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: body, className: "w100n-docs-body", children: [
|
|
15282
|
+
listOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
|
|
15283
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-head", children: [
|
|
15284
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-row", children: [
|
|
15285
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
15286
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Files, { "aria-hidden": true }),
|
|
15258
15287
|
t.documents,
|
|
15259
|
-
/* @__PURE__ */ (0,
|
|
15288
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: all.length })
|
|
15260
15289
|
] }),
|
|
15261
|
-
host.create && /* @__PURE__ */ (0,
|
|
15290
|
+
host.create && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-new", onKeyDown: (e) => {
|
|
15262
15291
|
if (e.key === "Escape" && adding) {
|
|
15263
15292
|
e.stopPropagation();
|
|
15264
15293
|
setAdding(false);
|
|
15265
15294
|
}
|
|
15266
15295
|
}, children: [
|
|
15267
|
-
/* @__PURE__ */ (0,
|
|
15268
|
-
/* @__PURE__ */ (0,
|
|
15269
|
-
/* @__PURE__ */ (0,
|
|
15270
|
-
/* @__PURE__ */ (0,
|
|
15296
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
|
|
15297
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Plus, { "aria-hidden": true }),
|
|
15298
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: sending === "busy" ? t.uploading : t.create }),
|
|
15299
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
|
|
15271
15300
|
] }),
|
|
15272
|
-
adding && /* @__PURE__ */ (0,
|
|
15273
|
-
/* @__PURE__ */ (0,
|
|
15301
|
+
adding && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "menu", className: "w100n-docs-menu", children: [
|
|
15302
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15274
15303
|
setAdding(false);
|
|
15275
15304
|
setMaking(true);
|
|
15276
15305
|
}, children: [
|
|
15277
|
-
/* @__PURE__ */ (0,
|
|
15278
|
-
/* @__PURE__ */ (0,
|
|
15306
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FilePlus, { "aria-hidden": true }) }),
|
|
15307
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.newTitle })
|
|
15279
15308
|
] }),
|
|
15280
|
-
/* @__PURE__ */ (0,
|
|
15309
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15281
15310
|
setAdding(false);
|
|
15282
15311
|
upload.current.click();
|
|
15283
15312
|
}, children: [
|
|
15284
|
-
/* @__PURE__ */ (0,
|
|
15285
|
-
/* @__PURE__ */ (0,
|
|
15313
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Upload, { "aria-hidden": true }) }),
|
|
15314
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.uploadFile })
|
|
15286
15315
|
] })
|
|
15287
15316
|
] }),
|
|
15288
|
-
/* @__PURE__ */ (0,
|
|
15317
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
|
|
15289
15318
|
const file = e.target.files?.[0];
|
|
15290
15319
|
e.target.value = "";
|
|
15291
15320
|
if (file) void send(file);
|
|
15292
15321
|
} })
|
|
15293
15322
|
] }),
|
|
15294
|
-
/* @__PURE__ */ (0,
|
|
15323
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side2("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.X, { "aria-hidden": true }) })
|
|
15295
15324
|
] }),
|
|
15296
|
-
(spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0,
|
|
15325
|
+
(spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
|
|
15297
15326
|
if (e.key !== "Escape" || !picking) return;
|
|
15298
15327
|
e.stopPropagation();
|
|
15299
15328
|
setPicking(false);
|
|
15300
15329
|
e.currentTarget.querySelector("button").focus();
|
|
15301
15330
|
}, children: [
|
|
15302
|
-
/* @__PURE__ */ (0,
|
|
15303
|
-
space ? /* @__PURE__ */ (0,
|
|
15304
|
-
/* @__PURE__ */ (0,
|
|
15305
|
-
!space && /* @__PURE__ */ (0,
|
|
15306
|
-
/* @__PURE__ */ (0,
|
|
15331
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
|
|
15332
|
+
space ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.LayoutGrid, { "aria-hidden": true }) }),
|
|
15333
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: space?.name ?? t.allProjects }),
|
|
15334
|
+
!space && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-count", children: all.length }),
|
|
15335
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
|
|
15307
15336
|
] }),
|
|
15308
|
-
picking && /* @__PURE__ */ (0,
|
|
15309
|
-
/* @__PURE__ */ (0,
|
|
15310
|
-
/* @__PURE__ */ (0,
|
|
15311
|
-
/* @__PURE__ */ (0,
|
|
15312
|
-
!spaceId && /* @__PURE__ */ (0,
|
|
15337
|
+
picking && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "listbox", className: "w100n-docs-menu", children: [
|
|
15338
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
|
|
15339
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.LayoutGrid, { "aria-hidden": true }) }),
|
|
15340
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.allProjects }),
|
|
15341
|
+
!spaceId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Check, { "aria-hidden": true })
|
|
15313
15342
|
] }),
|
|
15314
|
-
groups2.map((group) => /* @__PURE__ */ (0,
|
|
15315
|
-
group && /* @__PURE__ */ (0,
|
|
15316
|
-
(spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0,
|
|
15317
|
-
/* @__PURE__ */ (0,
|
|
15318
|
-
/* @__PURE__ */ (0,
|
|
15319
|
-
!spaceId && counts.get(item.id) ? /* @__PURE__ */ (0,
|
|
15320
|
-
item.id === spaceId && /* @__PURE__ */ (0,
|
|
15343
|
+
groups2.map((group) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "group", "aria-label": group || void 0, children: [
|
|
15344
|
+
group && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-menu-caption", children: group }),
|
|
15345
|
+
(spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
|
|
15346
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
|
|
15347
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: item.name }),
|
|
15348
|
+
!spaceId && counts.get(item.id) ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
|
|
15349
|
+
item.id === spaceId && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Check, { "aria-hidden": true })
|
|
15321
15350
|
] }, item.id))
|
|
15322
15351
|
] }, group))
|
|
15323
15352
|
] })
|
|
15324
15353
|
] }),
|
|
15325
|
-
/* @__PURE__ */ (0,
|
|
15326
|
-
/* @__PURE__ */ (0,
|
|
15327
|
-
/* @__PURE__ */ (0,
|
|
15328
|
-
/* @__PURE__ */ (0,
|
|
15329
|
-
/* @__PURE__ */ (0,
|
|
15354
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-filters", children: [
|
|
15355
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
15356
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Search, { "aria-hidden": true }),
|
|
15357
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { ref: finder, value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search }),
|
|
15358
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("kbd", { children: "\u2318O" })
|
|
15330
15359
|
] }),
|
|
15331
|
-
present.length > 1 && /* @__PURE__ */ (0,
|
|
15360
|
+
present.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-types", onKeyDown: (e) => {
|
|
15332
15361
|
if (e.key !== "Escape" || !typing) return;
|
|
15333
15362
|
e.stopPropagation();
|
|
15334
15363
|
setTyping(false);
|
|
15335
15364
|
e.currentTarget.querySelector("button").focus();
|
|
15336
15365
|
}, children: [
|
|
15337
|
-
/* @__PURE__ */ (0,
|
|
15338
|
-
/* @__PURE__ */ (0,
|
|
15339
|
-
/* @__PURE__ */ (0,
|
|
15340
|
-
picked.length > 0 && /* @__PURE__ */ (0,
|
|
15341
|
-
/* @__PURE__ */ (0,
|
|
15366
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
|
|
15367
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ListFilter, { "aria-hidden": true }),
|
|
15368
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.typeFilter }),
|
|
15369
|
+
picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-badge", children: picked.length }),
|
|
15370
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true })
|
|
15342
15371
|
] }),
|
|
15343
|
-
typing && /* @__PURE__ */ (0,
|
|
15372
|
+
typing && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
|
|
15344
15373
|
present.map((item) => {
|
|
15345
|
-
const Icon =
|
|
15374
|
+
const Icon = icons3[item];
|
|
15346
15375
|
const on2 = picked.includes(item);
|
|
15347
|
-
return /* @__PURE__ */ (0,
|
|
15348
|
-
/* @__PURE__ */ (0,
|
|
15349
|
-
/* @__PURE__ */ (0,
|
|
15350
|
-
/* @__PURE__ */ (0,
|
|
15351
|
-
/* @__PURE__ */ (0,
|
|
15376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "option", "aria-selected": on2, onClick: () => setPicked(on2 ? picked.filter((k) => k !== item) : [...picked, item]), children: [
|
|
15377
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-box", children: on2 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Check, { "aria-hidden": true }) }),
|
|
15378
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { "aria-hidden": true }) }),
|
|
15379
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: t.kinds[item] }),
|
|
15380
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
|
|
15352
15381
|
] }, item);
|
|
15353
15382
|
}),
|
|
15354
|
-
/* @__PURE__ */ (0,
|
|
15355
|
-
/* @__PURE__ */ (0,
|
|
15356
|
-
/* @__PURE__ */ (0,
|
|
15383
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-menu-foot", children: [
|
|
15384
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
|
|
15385
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
|
|
15357
15386
|
] })
|
|
15358
15387
|
] })
|
|
15359
15388
|
] })
|
|
15360
15389
|
] }),
|
|
15361
|
-
/* @__PURE__ */ (0,
|
|
15362
|
-
setShape(key2);
|
|
15363
|
-
localStorage.setItem("w100n-docs-view", key2);
|
|
15364
|
-
}, children: [
|
|
15365
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { "aria-hidden": true }),
|
|
15366
|
-
label
|
|
15367
|
-
] }, key2)) }),
|
|
15368
|
-
picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
|
|
15390
|
+
picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
|
|
15369
15391
|
t.kinds[item],
|
|
15370
|
-
/* @__PURE__ */ (0,
|
|
15392
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.X, { "aria-hidden": true })
|
|
15371
15393
|
] }, item)) })
|
|
15372
15394
|
] }),
|
|
15373
|
-
/* @__PURE__ */ (0,
|
|
15374
|
-
sending === "failed" && /* @__PURE__ */ (0,
|
|
15395
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-cards", children: [
|
|
15396
|
+
sending === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
|
|
15375
15397
|
list.error && failed(list.retry),
|
|
15376
|
-
list.loading && !list.data && /* @__PURE__ */ (0,
|
|
15377
|
-
notice && /* @__PURE__ */ (0,
|
|
15378
|
-
list.data && !shown.length && /* @__PURE__ */ (0,
|
|
15379
|
-
|
|
15398
|
+
list.loading && !list.data && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.loading }),
|
|
15399
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", role: "status", children: notice }),
|
|
15400
|
+
list.data && !shown.length && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
|
|
15401
|
+
list.data && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15380
15402
|
Tree,
|
|
15381
15403
|
{
|
|
15382
15404
|
items: shown,
|
|
@@ -15386,11 +15408,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15386
15408
|
current: here.documentId,
|
|
15387
15409
|
t,
|
|
15388
15410
|
edit,
|
|
15411
|
+
hits: query.trim() ? inside2 : void 0,
|
|
15389
15412
|
onEdit: (text2) => setEdit(text2 === null ? null : edit && { ...edit, text: text2 }),
|
|
15390
15413
|
onEditDone: commit,
|
|
15391
15414
|
onOpen: open,
|
|
15392
15415
|
onMenu: (item, e) => {
|
|
15393
15416
|
setSpot(null);
|
|
15417
|
+
setPeek(null);
|
|
15394
15418
|
setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
|
|
15395
15419
|
},
|
|
15396
15420
|
onFolderMenu: host.create || host.makeFolder ? (at2, key2, e) => {
|
|
@@ -15401,86 +15425,43 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15401
15425
|
const item = all.find((x) => x.id === id);
|
|
15402
15426
|
if (item) moveTo(item, to);
|
|
15403
15427
|
} : void 0,
|
|
15404
|
-
onWarm: (item) =>
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
|
|
15408
|
-
|
|
15409
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => naming?.id === item.id ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "w100n-docs-card", children: [
|
|
15410
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
|
|
15411
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w100n-docs-card-text", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
15412
|
-
"input",
|
|
15413
|
-
{
|
|
15414
|
-
className: "w100n-docs-field",
|
|
15415
|
-
autoFocus: true,
|
|
15416
|
-
value: naming.text,
|
|
15417
|
-
"aria-label": t.rename,
|
|
15418
|
-
onFocus: (e) => e.currentTarget.select(),
|
|
15419
|
-
onChange: (e) => setNaming({ ...naming, text: e.target.value }),
|
|
15420
|
-
onBlur: () => void retitle(item, naming.text),
|
|
15421
|
-
onKeyDown: (e) => {
|
|
15422
|
-
if (e.key === "Enter") e.currentTarget.blur();
|
|
15423
|
-
if (e.key === "Escape") {
|
|
15424
|
-
e.stopPropagation();
|
|
15425
|
-
setNaming(null);
|
|
15426
|
-
}
|
|
15427
|
-
}
|
|
15428
|
+
onWarm: (item, at2) => {
|
|
15429
|
+
if (item) warm(item, at2);
|
|
15430
|
+
else {
|
|
15431
|
+
clearTimeout(hover.current);
|
|
15432
|
+
setPeek(null);
|
|
15428
15433
|
}
|
|
15429
|
-
|
|
15430
|
-
|
|
15431
|
-
|
|
15432
|
-
{
|
|
15433
|
-
type: "button",
|
|
15434
|
-
className: "w100n-docs-card",
|
|
15435
|
-
"aria-current": item.id === here.documentId,
|
|
15436
|
-
onClick: () => open(item),
|
|
15437
|
-
title: item.name,
|
|
15438
|
-
onPointerEnter: () => warm(item),
|
|
15439
|
-
onPointerLeave: () => clearTimeout(hover.current),
|
|
15440
|
-
onContextMenu: (e) => {
|
|
15441
|
-
e.preventDefault();
|
|
15442
|
-
setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
|
|
15443
|
-
},
|
|
15444
|
-
children: [
|
|
15445
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }),
|
|
15446
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "w100n-docs-card-text", children: [
|
|
15447
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("b", { children: item.name }),
|
|
15448
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
|
|
15449
|
-
inside2.get(item.id) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { className: "w100n-docs-hit", children: inside2.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("mark", { children: part }, i) : part) })
|
|
15450
|
-
] })
|
|
15451
|
-
]
|
|
15452
|
-
},
|
|
15453
|
-
item.id
|
|
15454
|
-
)) })
|
|
15455
|
-
] }, folder2))
|
|
15434
|
+
}
|
|
15435
|
+
}
|
|
15436
|
+
)
|
|
15456
15437
|
] })
|
|
15457
15438
|
] }),
|
|
15458
15439
|
!narrow && !listOpen && listToggle,
|
|
15459
|
-
/* @__PURE__ */ (0,
|
|
15440
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("main", { className: "w100n-docs-stage", children: [
|
|
15460
15441
|
!narrow && !panelOpen && panelToggle,
|
|
15461
|
-
/* @__PURE__ */ (0,
|
|
15442
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-bare", children: stage })
|
|
15462
15443
|
] }),
|
|
15463
|
-
doc.data && panelOpen && /* @__PURE__ */ (0,
|
|
15464
|
-
/* @__PURE__ */ (0,
|
|
15465
|
-
/* @__PURE__ */ (0,
|
|
15466
|
-
/* @__PURE__ */ (0,
|
|
15467
|
-
(panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0,
|
|
15444
|
+
doc.data && panelOpen && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
|
|
15445
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-head", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-row", children: [
|
|
15446
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key2, Icon, label]) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "tab", "aria-selected": tab === key2, tabIndex: tab === key2 ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key2), children: [
|
|
15447
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { "aria-hidden": true }),
|
|
15448
|
+
(panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: label })
|
|
15468
15449
|
] }, key2)) }),
|
|
15469
|
-
/* @__PURE__ */ (0,
|
|
15450
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => side2("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.X, { "aria-hidden": true }) })
|
|
15470
15451
|
] }) }),
|
|
15471
|
-
/* @__PURE__ */ (0,
|
|
15472
|
-
tab === "outline" && (outline2.length ? /* @__PURE__ */ (0,
|
|
15473
|
-
now && /* @__PURE__ */ (0,
|
|
15474
|
-
/* @__PURE__ */ (0,
|
|
15475
|
-
/* @__PURE__ */ (0,
|
|
15452
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key2]) => key2 === tab)?.[2], children: [
|
|
15453
|
+
tab === "outline" && (outline2.length ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
|
|
15454
|
+
now && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-reading", children: [
|
|
15455
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
|
|
15456
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("small", { children: [
|
|
15476
15457
|
Math.round(now.progress * 100),
|
|
15477
15458
|
"% ",
|
|
15478
15459
|
t.read
|
|
15479
15460
|
] })
|
|
15480
15461
|
] }),
|
|
15481
|
-
outline2.length > 8 && /* @__PURE__ */ (0,
|
|
15482
|
-
/* @__PURE__ */ (0,
|
|
15483
|
-
/* @__PURE__ */ (0,
|
|
15462
|
+
outline2.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
15463
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Search, { "aria-hidden": true }),
|
|
15464
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
|
|
15484
15465
|
] }),
|
|
15485
15466
|
chapters.map((c, i) => {
|
|
15486
15467
|
const subs = words3.length ? c.subs.filter(hit) : c.subs;
|
|
@@ -15488,13 +15469,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15488
15469
|
const opened3 = words3.length > 0 || (fold[c.head.id] ?? i === reached);
|
|
15489
15470
|
const named3 = /^(\d+)[.)]?\s+(.+)$/.exec(c.head.text);
|
|
15490
15471
|
const mark = c.subs.findIndex((s) => s.id === now?.id);
|
|
15491
|
-
return /* @__PURE__ */ (0,
|
|
15492
|
-
/* @__PURE__ */ (0,
|
|
15493
|
-
/* @__PURE__ */ (0,
|
|
15494
|
-
/* @__PURE__ */ (0,
|
|
15495
|
-
/* @__PURE__ */ (0,
|
|
15472
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
|
|
15473
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-chapter-row", children: [
|
|
15474
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-chapter-go", "aria-label": c.head.text, "aria-current": now?.id === c.head.id ? "location" : void 0, onClick: () => reach(c.head), children: [
|
|
15475
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-chapter-num", children: named3 ? named3[1] : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Bookmark, { "aria-hidden": true }) }),
|
|
15476
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: named3 ? named3[2] : c.head.text })
|
|
15496
15477
|
] }),
|
|
15497
|
-
c.subs.length > 0 && /* @__PURE__ */ (0,
|
|
15478
|
+
c.subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15498
15479
|
"button",
|
|
15499
15480
|
{
|
|
15500
15481
|
type: "button",
|
|
@@ -15504,13 +15485,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15504
15485
|
title: opened3 ? t.hideSections : t.showSections,
|
|
15505
15486
|
onClick: () => setFold({ ...fold, [c.head.id]: !opened3 }),
|
|
15506
15487
|
children: [
|
|
15507
|
-
/* @__PURE__ */ (0,
|
|
15508
|
-
opened3 ? /* @__PURE__ */ (0,
|
|
15488
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: c.subs.length }),
|
|
15489
|
+
opened3 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true })
|
|
15509
15490
|
]
|
|
15510
15491
|
}
|
|
15511
15492
|
)
|
|
15512
15493
|
] }),
|
|
15513
|
-
opened3 && subs.length > 0 && /* @__PURE__ */ (0,
|
|
15494
|
+
opened3 && subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15514
15495
|
"button",
|
|
15515
15496
|
{
|
|
15516
15497
|
type: "button",
|
|
@@ -15519,7 +15500,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15519
15500
|
"data-state": i < reached || i === reached && c.subs.indexOf(s) < mark ? "done" : void 0,
|
|
15520
15501
|
"aria-current": now?.id === s.id ? "location" : void 0,
|
|
15521
15502
|
children: [
|
|
15522
|
-
/* @__PURE__ */ (0,
|
|
15503
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", { "aria-hidden": true }),
|
|
15523
15504
|
s.text
|
|
15524
15505
|
]
|
|
15525
15506
|
},
|
|
@@ -15527,47 +15508,47 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15527
15508
|
)) })
|
|
15528
15509
|
] }, c.head.id);
|
|
15529
15510
|
})
|
|
15530
|
-
] }) : /* @__PURE__ */ (0,
|
|
15531
|
-
tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ (0,
|
|
15532
|
-
tab === "versions" && /* @__PURE__ */ (0,
|
|
15511
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.noOutline })),
|
|
15512
|
+
tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Backlinks, { host, current: doc.data, notes: notes3, t, onOpen: open }),
|
|
15513
|
+
tab === "versions" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-versions", children: [
|
|
15533
15514
|
versions.error && failed(versions.retry),
|
|
15534
|
-
(versions.data ?? []).map((item) => /* @__PURE__ */ (0,
|
|
15515
|
+
(versions.data ?? []).map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15535
15516
|
"button",
|
|
15536
15517
|
{
|
|
15537
15518
|
type: "button",
|
|
15538
15519
|
"aria-pressed": (versionId ?? "current") === item.id || !versionId && item.current,
|
|
15539
15520
|
onClick: () => view(item.current ? null : item.id),
|
|
15540
15521
|
children: [
|
|
15541
|
-
/* @__PURE__ */ (0,
|
|
15522
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("b", { children: [
|
|
15542
15523
|
date(item.createdAt),
|
|
15543
|
-
item.current && /* @__PURE__ */ (0,
|
|
15524
|
+
item.current && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "w100n-docs-badge", children: t.current })
|
|
15544
15525
|
] }),
|
|
15545
|
-
/* @__PURE__ */ (0,
|
|
15526
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: [item.author?.name, size2(item.size), item.note].filter(Boolean).join(" \xB7 ") })
|
|
15546
15527
|
]
|
|
15547
15528
|
},
|
|
15548
15529
|
item.id
|
|
15549
15530
|
))
|
|
15550
15531
|
] }),
|
|
15551
|
-
tab === "details" && /* @__PURE__ */ (0,
|
|
15552
|
-
/* @__PURE__ */ (0,
|
|
15553
|
-
/* @__PURE__ */ (0,
|
|
15554
|
-
/* @__PURE__ */ (0,
|
|
15555
|
-
/* @__PURE__ */ (0,
|
|
15556
|
-
/* @__PURE__ */ (0,
|
|
15557
|
-
/* @__PURE__ */ (0,
|
|
15558
|
-
doc.data.updatedBy && /* @__PURE__ */ (0,
|
|
15559
|
-
/* @__PURE__ */ (0,
|
|
15560
|
-
/* @__PURE__ */ (0,
|
|
15532
|
+
tab === "details" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("dl", { className: "w100n-docs-details", children: [
|
|
15533
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.kind }),
|
|
15534
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: t.kinds[doc.data.kind] }),
|
|
15535
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.size }),
|
|
15536
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: size2(doc.data.size) }),
|
|
15537
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.updated }),
|
|
15538
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: date(doc.data.updatedAt) }),
|
|
15539
|
+
doc.data.updatedBy && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
15540
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.by }),
|
|
15541
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: doc.data.updatedBy.name })
|
|
15561
15542
|
] }),
|
|
15562
|
-
/* @__PURE__ */ (0,
|
|
15563
|
-
/* @__PURE__ */ (0,
|
|
15543
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dt", { children: t.rights }),
|
|
15544
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
|
|
15564
15545
|
] }),
|
|
15565
|
-
tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0,
|
|
15566
|
-
/* @__PURE__ */ (0,
|
|
15567
|
-
/* @__PURE__ */ (0,
|
|
15546
|
+
tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-about", children: [
|
|
15547
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
15548
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileDown, { "aria-hidden": true }),
|
|
15568
15549
|
t.exportAs
|
|
15569
15550
|
] }),
|
|
15570
|
-
/* @__PURE__ */ (0,
|
|
15551
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15571
15552
|
"button",
|
|
15572
15553
|
{
|
|
15573
15554
|
type: "button",
|
|
@@ -15575,22 +15556,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15575
15556
|
disabled: exporting === "busy",
|
|
15576
15557
|
onClick: () => void exportAs(doc.data, format),
|
|
15577
15558
|
children: [
|
|
15578
|
-
/* @__PURE__ */ (0,
|
|
15559
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileDown, { "aria-hidden": true }),
|
|
15579
15560
|
format.toUpperCase()
|
|
15580
15561
|
]
|
|
15581
15562
|
},
|
|
15582
15563
|
format
|
|
15583
15564
|
)) }),
|
|
15584
|
-
exporting === "failed" && /* @__PURE__ */ (0,
|
|
15565
|
+
exporting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.exportFailed })
|
|
15585
15566
|
] }),
|
|
15586
|
-
tab === "comments" && /* @__PURE__ */ (0,
|
|
15587
|
-
tab === "sharing" && sharing && /* @__PURE__ */ (0,
|
|
15588
|
-
tab === "signatures" && /* @__PURE__ */ (0,
|
|
15567
|
+
tab === "comments" && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref: setBox }),
|
|
15568
|
+
tab === "sharing" && sharing && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
|
|
15569
|
+
tab === "signatures" && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-versions", children: [
|
|
15589
15570
|
signatures.error && failed(signatures.retry),
|
|
15590
|
-
signatures.data?.length === 0 && /* @__PURE__ */ (0,
|
|
15571
|
+
signatures.data?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-docs-muted", children: t.noSignatures }),
|
|
15591
15572
|
(signatures.data ?? []).map((entry2) => {
|
|
15592
15573
|
const signed = versions.data?.find((v) => v.id === entry2.versionId);
|
|
15593
|
-
return /* @__PURE__ */ (0,
|
|
15574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15594
15575
|
"button",
|
|
15595
15576
|
{
|
|
15596
15577
|
type: "button",
|
|
@@ -15598,15 +15579,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15598
15579
|
"aria-pressed": !!signed && (versionId ?? versions.data?.find((v) => v.current)?.id) === signed.id,
|
|
15599
15580
|
onClick: () => view(signed.current ? null : signed.id),
|
|
15600
15581
|
children: [
|
|
15601
|
-
/* @__PURE__ */ (0,
|
|
15582
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("b", { children: [
|
|
15602
15583
|
entry2.signer.name,
|
|
15603
|
-
/* @__PURE__ */ (0,
|
|
15584
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "w100n-docs-badge", children: [
|
|
15604
15585
|
t.page,
|
|
15605
15586
|
" ",
|
|
15606
15587
|
entry2.page
|
|
15607
15588
|
] })
|
|
15608
15589
|
] }),
|
|
15609
|
-
/* @__PURE__ */ (0,
|
|
15590
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: [date(entry2.signedAt), t.methods[entry2.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
|
|
15610
15591
|
]
|
|
15611
15592
|
},
|
|
15612
15593
|
entry2.id
|
|
@@ -15617,7 +15598,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15617
15598
|
] })
|
|
15618
15599
|
] })
|
|
15619
15600
|
] }),
|
|
15620
|
-
jump && /* @__PURE__ */ (0,
|
|
15601
|
+
jump && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
15621
15602
|
Jump,
|
|
15622
15603
|
{
|
|
15623
15604
|
mode: jump,
|
|
@@ -15630,18 +15611,14 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15630
15611
|
place: (item) => [!spaceId && names2.get(item.spaceId), item.folder].filter(Boolean).join(" / ")
|
|
15631
15612
|
}
|
|
15632
15613
|
),
|
|
15633
|
-
making && /* @__PURE__ */ (0,
|
|
15614
|
+
making && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made2) => {
|
|
15634
15615
|
setMaking(false);
|
|
15635
15616
|
opened2(made2);
|
|
15636
15617
|
} }),
|
|
15637
|
-
menu && /* @__PURE__ */ (0,
|
|
15638
|
-
|
|
15639
|
-
|
|
15640
|
-
|
|
15641
|
-
menu.item.createdAt && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [t.createdOn.replace("{when}", date(menu.item.createdAt)), menu.item.createdBy?.name].filter(Boolean).join(" \xB7 ") }),
|
|
15642
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: [t.updatedOn.replace("{when}", ago(menu.item.updatedAt)), menu.item.updatedBy?.name].filter(Boolean).join(" \xB7 ") })
|
|
15643
|
-
] }),
|
|
15644
|
-
menu.moving ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
15618
|
+
peek && !menu && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-peek", role: "tooltip", style: { left: peek.x, top: peek.y }, children: card(peek.item) }),
|
|
15619
|
+
menu && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
|
|
15620
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-context-head", children: card(menu.item) }),
|
|
15621
|
+
menu.moving ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15645
15622
|
"button",
|
|
15646
15623
|
{
|
|
15647
15624
|
type: "button",
|
|
@@ -15650,100 +15627,99 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15650
15627
|
onClick: () => moveTo(menu.item, { spaceId: menu.item.spaceId, folder: folder2 }),
|
|
15651
15628
|
style: { paddingLeft: 10 + 14 * (folder2 ? folder2.split("/").length : 0) },
|
|
15652
15629
|
children: [
|
|
15653
|
-
/* @__PURE__ */ (0,
|
|
15630
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Folder, { "aria-hidden": true }),
|
|
15654
15631
|
folder2 ? folder2.split("/").pop() : names2.get(menu.item.spaceId) ?? t.topLevel
|
|
15655
15632
|
]
|
|
15656
15633
|
},
|
|
15657
15634
|
folder2
|
|
15658
|
-
)) }) : menu.sure ? /* @__PURE__ */ (0,
|
|
15659
|
-
/* @__PURE__ */ (0,
|
|
15660
|
-
/* @__PURE__ */ (0,
|
|
15661
|
-
/* @__PURE__ */ (0,
|
|
15662
|
-
/* @__PURE__ */ (0,
|
|
15663
|
-
/* @__PURE__ */ (0,
|
|
15635
|
+
)) }) : menu.sure ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-context-ask", children: [
|
|
15636
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
|
|
15637
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
15638
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
|
|
15639
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
|
|
15640
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
|
|
15664
15641
|
t.trash
|
|
15665
15642
|
] })
|
|
15666
15643
|
] })
|
|
15667
|
-
] }) : /* @__PURE__ */ (0,
|
|
15668
|
-
/* @__PURE__ */ (0,
|
|
15644
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
15645
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15669
15646
|
setMenu(null);
|
|
15670
15647
|
open(menu.item);
|
|
15671
15648
|
}, children: [
|
|
15672
|
-
/* @__PURE__ */ (0,
|
|
15649
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FileText, { "aria-hidden": true }),
|
|
15673
15650
|
t.openFile
|
|
15674
15651
|
] }),
|
|
15675
|
-
host.href && /* @__PURE__ */ (0,
|
|
15652
|
+
host.href && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15676
15653
|
setMenu(null);
|
|
15677
15654
|
window.open(host.href(menu.item.id), "_blank", "noopener");
|
|
15678
15655
|
}, children: [
|
|
15679
|
-
/* @__PURE__ */ (0,
|
|
15656
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.ExternalLink, { "aria-hidden": true }),
|
|
15680
15657
|
t.openTab
|
|
15681
15658
|
] }),
|
|
15682
|
-
host.href && /* @__PURE__ */ (0,
|
|
15683
|
-
/* @__PURE__ */ (0,
|
|
15659
|
+
host.href && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
|
|
15660
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Link, { "aria-hidden": true }),
|
|
15684
15661
|
t.copyLink
|
|
15685
15662
|
] }),
|
|
15686
|
-
host.send && /* @__PURE__ */ (0,
|
|
15663
|
+
host.send && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15687
15664
|
setMenu(null);
|
|
15688
15665
|
host.send(menu.item.id);
|
|
15689
15666
|
}, children: [
|
|
15690
|
-
/* @__PURE__ */ (0,
|
|
15667
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Send, { "aria-hidden": true }),
|
|
15691
15668
|
t.sendChat
|
|
15692
15669
|
] }),
|
|
15693
|
-
/* @__PURE__ */ (0,
|
|
15694
|
-
host.rename && /* @__PURE__ */ (0,
|
|
15670
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
|
|
15671
|
+
host.rename && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15695
15672
|
const item = menu.item;
|
|
15696
15673
|
setMenu(null);
|
|
15697
|
-
|
|
15698
|
-
else setNaming({ id: item.id, text: item.name.replace(/\.[^.]+$/, "") });
|
|
15674
|
+
setEdit({ key: `file:${item.id}`, text: item.name.replace(/\.[^.]+$/, ""), run: (text2) => retitle(item, text2) });
|
|
15699
15675
|
}, children: [
|
|
15700
|
-
/* @__PURE__ */ (0,
|
|
15676
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Pencil, { "aria-hidden": true }),
|
|
15701
15677
|
t.rename
|
|
15702
15678
|
] }),
|
|
15703
|
-
host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */ (0,
|
|
15704
|
-
/* @__PURE__ */ (0,
|
|
15679
|
+
host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", "aria-haspopup": "menu", onClick: () => setMenu({ ...menu, moving: true }), children: [
|
|
15680
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FolderInput, { "aria-hidden": true }),
|
|
15705
15681
|
t.moveTo
|
|
15706
15682
|
] }),
|
|
15707
|
-
host.create && /* @__PURE__ */ (0,
|
|
15708
|
-
/* @__PURE__ */ (0,
|
|
15683
|
+
host.create && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy2(await host.document(menu.item.id))), children: [
|
|
15684
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Copy, { "aria-hidden": true }),
|
|
15709
15685
|
t.makeCopy
|
|
15710
15686
|
] }),
|
|
15711
|
-
/* @__PURE__ */ (0,
|
|
15712
|
-
/* @__PURE__ */ (0,
|
|
15687
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
|
|
15688
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Download, { "aria-hidden": true }),
|
|
15713
15689
|
t.download
|
|
15714
15690
|
] }),
|
|
15715
|
-
host.saveTemplate && /* @__PURE__ */ (0,
|
|
15716
|
-
/* @__PURE__ */ (0,
|
|
15691
|
+
host.saveTemplate && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
|
|
15692
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Bookmark, { "aria-hidden": true }),
|
|
15717
15693
|
t.saveTemplate
|
|
15718
15694
|
] }),
|
|
15719
|
-
/* @__PURE__ */ (0,
|
|
15695
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15720
15696
|
setMenu(null);
|
|
15721
15697
|
open(menu.item);
|
|
15722
15698
|
setTab("details");
|
|
15723
15699
|
side2("panel", true);
|
|
15724
15700
|
}, children: [
|
|
15725
|
-
/* @__PURE__ */ (0,
|
|
15701
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Info, { "aria-hidden": true }),
|
|
15726
15702
|
t.details
|
|
15727
15703
|
] }),
|
|
15728
|
-
host.remove && /* @__PURE__ */ (0,
|
|
15729
|
-
/* @__PURE__ */ (0,
|
|
15730
|
-
/* @__PURE__ */ (0,
|
|
15731
|
-
/* @__PURE__ */ (0,
|
|
15704
|
+
host.remove && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
15705
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
|
|
15706
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
|
|
15707
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
|
|
15732
15708
|
t.trash
|
|
15733
15709
|
] })
|
|
15734
15710
|
] })
|
|
15735
15711
|
] })
|
|
15736
15712
|
] }),
|
|
15737
|
-
spot3 && /* @__PURE__ */ (0,
|
|
15738
|
-
/* @__PURE__ */ (0,
|
|
15739
|
-
/* @__PURE__ */ (0,
|
|
15740
|
-
spot3.at.folder && /* @__PURE__ */ (0,
|
|
15713
|
+
spot3 && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.folderActions, style: { left: spot3.x, top: spot3.y }, children: [
|
|
15714
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-context-head", children: [
|
|
15715
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("b", { children: folderNamed(spot3.at) }),
|
|
15716
|
+
spot3.at.folder && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("small", { children: [names2.get(spot3.at.spaceId), ...spot3.at.folder.split("/").slice(0, -1)].filter(Boolean).join(" / ") })
|
|
15741
15717
|
] }),
|
|
15742
|
-
spot3.sure ? /* @__PURE__ */ (0,
|
|
15743
|
-
/* @__PURE__ */ (0,
|
|
15744
|
-
/* @__PURE__ */ (0,
|
|
15745
|
-
/* @__PURE__ */ (0,
|
|
15746
|
-
/* @__PURE__ */ (0,
|
|
15718
|
+
spot3.sure ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-context-ask", children: [
|
|
15719
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: t.folderTrashAsk.replace("{name}", folderNamed(spot3.at)) }),
|
|
15720
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
15721
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setSpot({ ...spot3, sure: false }), children: t.cancel }),
|
|
15722
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => {
|
|
15747
15723
|
const at2 = spot3.at;
|
|
15748
15724
|
const inside3 = doc.data && doc.data.spaceId === at2.spaceId && `${doc.data.folder ?? ""}/`.startsWith(`${at2.folder}/`);
|
|
15749
15725
|
void act(() => host.removeFolder(at2), t.trashed).then(() => {
|
|
@@ -15751,42 +15727,42 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15751
15727
|
if (inside3) go({ spaceId: here.spaceId, documentId: null });
|
|
15752
15728
|
});
|
|
15753
15729
|
}, children: [
|
|
15754
|
-
/* @__PURE__ */ (0,
|
|
15730
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
|
|
15755
15731
|
t.trash
|
|
15756
15732
|
] })
|
|
15757
15733
|
] })
|
|
15758
|
-
] }) : /* @__PURE__ */ (0,
|
|
15759
|
-
host.create && /* @__PURE__ */ (0,
|
|
15734
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
15735
|
+
host.create && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15760
15736
|
const at2 = spot3.at;
|
|
15761
15737
|
setSpot(null);
|
|
15762
15738
|
void note(t.untitled, true, at2);
|
|
15763
15739
|
}, children: [
|
|
15764
|
-
/* @__PURE__ */ (0,
|
|
15740
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FilePlus, { "aria-hidden": true }),
|
|
15765
15741
|
t.newNoteHere
|
|
15766
15742
|
] }),
|
|
15767
|
-
host.makeFolder && /* @__PURE__ */ (0,
|
|
15743
|
+
host.makeFolder && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15768
15744
|
const at2 = spot3.at;
|
|
15769
15745
|
setSpot(null);
|
|
15770
15746
|
setEdit({ key: `new:${spot3.key}`, text: t.newFolder, run: (name) => act(() => host.makeFolder(at2, name)).then(refresh) });
|
|
15771
15747
|
}, children: [
|
|
15772
|
-
/* @__PURE__ */ (0,
|
|
15748
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.FolderPlus, { "aria-hidden": true }),
|
|
15773
15749
|
t.newFolder
|
|
15774
15750
|
] }),
|
|
15775
|
-
spot3.at.folder && host.renameFolder && /* @__PURE__ */ (0,
|
|
15776
|
-
/* @__PURE__ */ (0,
|
|
15777
|
-
/* @__PURE__ */ (0,
|
|
15751
|
+
spot3.at.folder && host.renameFolder && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
15752
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
|
|
15753
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15778
15754
|
const at2 = spot3.at;
|
|
15779
15755
|
setSpot(null);
|
|
15780
15756
|
setEdit({ key: `dir:${spot3.key}`, text: folderNamed(at2), run: (name) => name === folderNamed(at2) ? Promise.resolve() : act(() => host.renameFolder(at2, name)).then(refresh) });
|
|
15781
15757
|
}, children: [
|
|
15782
|
-
/* @__PURE__ */ (0,
|
|
15758
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Pencil, { "aria-hidden": true }),
|
|
15783
15759
|
t.renameFolder
|
|
15784
15760
|
] })
|
|
15785
15761
|
] }),
|
|
15786
|
-
spot3.at.folder && host.removeFolder && /* @__PURE__ */ (0,
|
|
15787
|
-
/* @__PURE__ */ (0,
|
|
15788
|
-
/* @__PURE__ */ (0,
|
|
15789
|
-
/* @__PURE__ */ (0,
|
|
15762
|
+
spot3.at.folder && host.removeFolder && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
15763
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("hr", {}),
|
|
15764
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setSpot({ ...spot3, sure: true }), children: [
|
|
15765
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react13.Trash2, { "aria-hidden": true }),
|
|
15790
15766
|
t.trashFolder
|
|
15791
15767
|
] })
|
|
15792
15768
|
] })
|
|
@@ -15798,12 +15774,12 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15798
15774
|
|
|
15799
15775
|
// src/FilePreview.tsx
|
|
15800
15776
|
var import_react20 = require("react");
|
|
15801
|
-
var
|
|
15777
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
15802
15778
|
function FilePreview({ url, name, mimeType, size: size2 = 0, bytes, pdfWorker }) {
|
|
15803
15779
|
const [source] = (0, import_react20.useState)(() => ({ pdfWorker, content: () => bytes ? bytes(url) : fetch(url, { credentials: "include" }).then((res) => res.ok ? res.arrayBuffer() : Promise.reject(new Error(String(res.status)))) }));
|
|
15804
15780
|
const kind = kindOf(name, mimeType);
|
|
15805
15781
|
if (!kind) return null;
|
|
15806
|
-
return /* @__PURE__ */ (0,
|
|
15782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-preview", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Thumb, { host: source, item: { id: url.split("?")[0], spaceId: "", name, kind, size: size2, updatedAt: "" } }) });
|
|
15807
15783
|
}
|
|
15808
15784
|
|
|
15809
15785
|
// src/GuestDocument.tsx
|
|
@@ -15811,10 +15787,10 @@ var import_react21 = require("react");
|
|
|
15811
15787
|
var import_lucide_react14 = require("lucide-react");
|
|
15812
15788
|
init_text();
|
|
15813
15789
|
init_useLoad();
|
|
15814
|
-
var
|
|
15790
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
15815
15791
|
var TextEditor4 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
|
|
15816
15792
|
var SheetView4 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
|
|
15817
|
-
var
|
|
15793
|
+
var icons4 = { docx: import_lucide_react14.FileText, markdown: import_lucide_react14.FileType, pdf: import_lucide_react14.Files, sheet: import_lucide_react14.FileSpreadsheet, slides: import_lucide_react14.Presentation };
|
|
15818
15794
|
var GuestRefused = class extends Error {
|
|
15819
15795
|
constructor(reason, file = "", sharedBy = "") {
|
|
15820
15796
|
super(reason);
|
|
@@ -15872,18 +15848,18 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15872
15848
|
};
|
|
15873
15849
|
const top = (file2, badge) => {
|
|
15874
15850
|
const kind2 = file2 ? kindOf(file2.name, file2.mimeType) : null;
|
|
15875
|
-
const Kind = kind2 ?
|
|
15876
|
-
return /* @__PURE__ */ (0,
|
|
15877
|
-
brand && /* @__PURE__ */ (0,
|
|
15878
|
-
file2 && /* @__PURE__ */ (0,
|
|
15879
|
-
/* @__PURE__ */ (0,
|
|
15880
|
-
/* @__PURE__ */ (0,
|
|
15881
|
-
/* @__PURE__ */ (0,
|
|
15882
|
-
file2.sharedBy && /* @__PURE__ */ (0,
|
|
15851
|
+
const Kind = kind2 ? icons4[kind2] : import_lucide_react14.FileText;
|
|
15852
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
|
|
15853
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-guest-brand", children: brand }),
|
|
15854
|
+
file2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
15855
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Kind, { "aria-hidden": true }) }),
|
|
15856
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-heading", children: [
|
|
15857
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("strong", { className: "w100n-docs-title", children: file2.name }),
|
|
15858
|
+
file2.sharedBy && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
|
|
15883
15859
|
] }),
|
|
15884
|
-
badge && /* @__PURE__ */ (0,
|
|
15885
|
-
file2.download && /* @__PURE__ */ (0,
|
|
15886
|
-
(kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0,
|
|
15860
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
|
|
15861
|
+
file2.download && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-end", children: [
|
|
15862
|
+
(kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
15887
15863
|
"button",
|
|
15888
15864
|
{
|
|
15889
15865
|
type: "button",
|
|
@@ -15894,25 +15870,25 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15894
15870
|
"aria-label": t.pdfCopy,
|
|
15895
15871
|
title: t.pdfCopy,
|
|
15896
15872
|
children: [
|
|
15897
|
-
/* @__PURE__ */ (0,
|
|
15898
|
-
/* @__PURE__ */ (0,
|
|
15873
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.FileDown, { "aria-hidden": true }),
|
|
15874
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: t.pdfCopy })
|
|
15899
15875
|
]
|
|
15900
15876
|
}
|
|
15901
15877
|
),
|
|
15902
|
-
/* @__PURE__ */ (0,
|
|
15903
|
-
/* @__PURE__ */ (0,
|
|
15904
|
-
/* @__PURE__ */ (0,
|
|
15878
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", disabled: saving === "busy", onClick: () => void download("file"), "aria-label": t.download, title: t.download, children: [
|
|
15879
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Download, { "aria-hidden": true }),
|
|
15880
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: t.download })
|
|
15905
15881
|
] })
|
|
15906
15882
|
] })
|
|
15907
15883
|
] })
|
|
15908
15884
|
] });
|
|
15909
15885
|
};
|
|
15910
|
-
const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0,
|
|
15886
|
+
const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
15911
15887
|
top(null, null),
|
|
15912
|
-
/* @__PURE__ */ (0,
|
|
15913
|
-
/* @__PURE__ */ (0,
|
|
15914
|
-
/* @__PURE__ */ (0,
|
|
15915
|
-
/* @__PURE__ */ (0,
|
|
15888
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-guest-card", children: [
|
|
15889
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { "aria-hidden": true }) }),
|
|
15890
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h2", { children: title }),
|
|
15891
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { children: body }),
|
|
15916
15892
|
form
|
|
15917
15893
|
] }) })
|
|
15918
15894
|
] });
|
|
@@ -15928,7 +15904,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15928
15904
|
password ? import_lucide_react14.Lock : import_lucide_react14.UserRound,
|
|
15929
15905
|
refused.file || t.documents,
|
|
15930
15906
|
shared + (password ? t.passwordAsk : t.nameAsk),
|
|
15931
|
-
/* @__PURE__ */ (0,
|
|
15907
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("form", { className: "w100n-guest-form", onSubmit: (e) => {
|
|
15932
15908
|
e.preventDefault();
|
|
15933
15909
|
if (!typed.trim()) return;
|
|
15934
15910
|
if (password) setAsk({ ...ask, password: typed });
|
|
@@ -15938,7 +15914,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15938
15914
|
}
|
|
15939
15915
|
setTyped("");
|
|
15940
15916
|
}, children: [
|
|
15941
|
-
/* @__PURE__ */ (0,
|
|
15917
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
15942
15918
|
"input",
|
|
15943
15919
|
{
|
|
15944
15920
|
className: "w100n-share-input",
|
|
@@ -15951,21 +15927,21 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15951
15927
|
onChange: (e) => setTyped(e.target.value)
|
|
15952
15928
|
}
|
|
15953
15929
|
),
|
|
15954
|
-
refused.reason === "wrong" && /* @__PURE__ */ (0,
|
|
15955
|
-
/* @__PURE__ */ (0,
|
|
15956
|
-
/* @__PURE__ */ (0,
|
|
15930
|
+
refused.reason === "wrong" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
|
|
15931
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
|
|
15932
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react14.Eye, { "aria-hidden": true }),
|
|
15957
15933
|
t.openDoc
|
|
15958
15934
|
] })
|
|
15959
15935
|
] })
|
|
15960
15936
|
);
|
|
15961
15937
|
}
|
|
15962
15938
|
if (refused?.reason === "busy") return gate("slate", import_lucide_react14.Ban, t.failed, t.tooMany);
|
|
15963
|
-
return gate("slate", import_lucide_react14.Ban, t.failed, "", /* @__PURE__ */ (0,
|
|
15939
|
+
return gate("slate", import_lucide_react14.Ban, t.failed, "", /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: opened2.retry, children: t.retry }));
|
|
15964
15940
|
}
|
|
15965
15941
|
const file = opened2.data;
|
|
15966
|
-
if (!file) return /* @__PURE__ */ (0,
|
|
15942
|
+
if (!file) return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
15967
15943
|
top(null, null),
|
|
15968
|
-
/* @__PURE__ */ (0,
|
|
15944
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.loading })
|
|
15969
15945
|
] });
|
|
15970
15946
|
const kind = kindOf(file.name, file.mimeType);
|
|
15971
15947
|
const text = kind === "docx" || kind === "markdown";
|
|
@@ -15973,23 +15949,23 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15973
15949
|
const rights = { view: true, comment: talk, edit: false };
|
|
15974
15950
|
const quiet3 = () => {
|
|
15975
15951
|
};
|
|
15976
|
-
let stage = /* @__PURE__ */ (0,
|
|
15977
|
-
if (text) stage = /* @__PURE__ */ (0,
|
|
15978
|
-
else if (kind === "pdf") stage = /* @__PURE__ */ (0,
|
|
15979
|
-
else if (kind === "slides") stage = /* @__PURE__ */ (0,
|
|
15980
|
-
else if (kind === "sheet") stage = /* @__PURE__ */ (0,
|
|
15981
|
-
return /* @__PURE__ */ (0,
|
|
15952
|
+
let stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
|
|
15953
|
+
if (text) stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TextEditor4, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes3 : void 0, documentId: file.id, onOutline: quiet3, slot: talk ? slot : null }) });
|
|
15954
|
+
else if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet3 });
|
|
15955
|
+
else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet3 });
|
|
15956
|
+
else if (kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SheetView4, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
|
|
15957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
15982
15958
|
top(file, talk ? t.badgeComment : t.badgeRead),
|
|
15983
|
-
saving === "failed" && /* @__PURE__ */ (0,
|
|
15984
|
-
/* @__PURE__ */ (0,
|
|
15985
|
-
/* @__PURE__ */ (0,
|
|
15986
|
-
talk && /* @__PURE__ */ (0,
|
|
15987
|
-
/* @__PURE__ */ (0,
|
|
15988
|
-
/* @__PURE__ */ (0,
|
|
15989
|
-
/* @__PURE__ */ (0,
|
|
15959
|
+
saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
|
|
15960
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-body w100n-guest-body", children: [
|
|
15961
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "w100n-docs-bare", children: stage }) }),
|
|
15962
|
+
talk && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "w100n-docs-panel-body", children: [
|
|
15963
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("label", { className: "w100n-share-field", children: [
|
|
15964
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: t.yourName }),
|
|
15965
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
|
|
15990
15966
|
] }),
|
|
15991
|
-
/* @__PURE__ */ (0,
|
|
15992
|
-
/* @__PURE__ */ (0,
|
|
15967
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
|
|
15968
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { ref: setSlot })
|
|
15993
15969
|
] }) })
|
|
15994
15970
|
] })
|
|
15995
15971
|
] });
|
|
@@ -16004,6 +15980,7 @@ init_docx();
|
|
|
16004
15980
|
FilePreview,
|
|
16005
15981
|
GuestDocument,
|
|
16006
15982
|
GuestRefused,
|
|
15983
|
+
PreviewCard,
|
|
16007
15984
|
SlidesView,
|
|
16008
15985
|
kindOf,
|
|
16009
15986
|
kinds,
|