@w100n/documents 0.18.1 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SheetView-43MPR64N.css → SheetView-GBGCZMYL.css} +22 -1
- package/dist/{SheetView-43MPR64N.css.map → SheetView-GBGCZMYL.css.map} +1 -1
- package/dist/{SheetView-F4CBWEOS.js → SheetView-P3GH4U73.js} +43 -23
- package/dist/SheetView-P3GH4U73.js.map +1 -0
- package/dist/{TextEditor-ZY4B7YIF.js → TextEditor-U3WODH75.js} +18 -6
- package/dist/TextEditor-U3WODH75.js.map +1 -0
- package/dist/{chunk-TSB2QS56.js → chunk-SJVSGMNK.js} +48 -3
- package/dist/chunk-SJVSGMNK.js.map +1 -0
- package/dist/{chunk-2G34AIPU.js → chunk-VG7UW2CQ.js} +201 -60
- package/dist/chunk-VG7UW2CQ.js.map +1 -0
- package/dist/collab.cjs +335 -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/{grid-IR5YFFSF.js → grid-7OGS3FPU.js} +27 -2
- package/dist/grid-7OGS3FPU.js.map +1 -0
- package/dist/index.cjs +1130 -1053
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +189 -0
- 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 +351 -392
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/SheetView-F4CBWEOS.js.map +0 -1
- package/dist/TextEditor-ZY4B7YIF.js.map +0 -1
- package/dist/chunk-2G34AIPU.js.map +0 -1
- package/dist/chunk-TSB2QS56.js.map +0 -1
- package/dist/grid-IR5YFFSF.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -2412,8 +2412,8 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
|
|
|
2412
2412
|
|
|
2413
2413
|
// src/DocumentOverlay.tsx
|
|
2414
2414
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2415
|
-
var TextEditor = lazy(() => import("./TextEditor-
|
|
2416
|
-
var SheetView = lazy(() => import("./SheetView-
|
|
2415
|
+
var TextEditor = lazy(() => import("./TextEditor-U3WODH75.js"));
|
|
2416
|
+
var SheetView = lazy(() => import("./SheetView-P3GH4U73.js"));
|
|
2417
2417
|
var icons = { docx: FileText, markdown: FileType, pdf: Files, sheet: FileSpreadsheet, slides: Presentation };
|
|
2418
2418
|
var read = { view: true, comment: false, edit: false };
|
|
2419
2419
|
var quiet = () => {
|
|
@@ -2537,12 +2537,10 @@ import {
|
|
|
2537
2537
|
FilePlus,
|
|
2538
2538
|
FileSpreadsheet as FileSpreadsheet4,
|
|
2539
2539
|
FileText as FileText4,
|
|
2540
|
-
|
|
2541
|
-
Files as Files3,
|
|
2540
|
+
Files as Files2,
|
|
2542
2541
|
Folder as Folder2,
|
|
2543
2542
|
FolderInput,
|
|
2544
2543
|
FolderPlus,
|
|
2545
|
-
FolderTree,
|
|
2546
2544
|
History,
|
|
2547
2545
|
Info,
|
|
2548
2546
|
LayoutGrid,
|
|
@@ -2554,7 +2552,6 @@ import {
|
|
|
2554
2552
|
PanelRightClose,
|
|
2555
2553
|
PanelRightOpen,
|
|
2556
2554
|
Plus as Plus5,
|
|
2557
|
-
Presentation as Presentation4,
|
|
2558
2555
|
RotateCcw as RotateCcw2,
|
|
2559
2556
|
Search as Search3,
|
|
2560
2557
|
Share2,
|
|
@@ -3218,6 +3215,19 @@ function Sharing({ host, doc, t, language, team }) {
|
|
|
3218
3215
|
] });
|
|
3219
3216
|
}
|
|
3220
3217
|
|
|
3218
|
+
// src/PreviewCard.tsx
|
|
3219
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3220
|
+
function PreviewCard({ thumb, icon, title, lines }) {
|
|
3221
|
+
return /* @__PURE__ */ jsxs10("div", { className: "w100n-card", children: [
|
|
3222
|
+
/* @__PURE__ */ jsx10("div", { className: "w100n-card-thumb", children: thumb }),
|
|
3223
|
+
/* @__PURE__ */ jsxs10("div", { className: "w100n-card-title", children: [
|
|
3224
|
+
icon,
|
|
3225
|
+
/* @__PURE__ */ jsx10("b", { children: title })
|
|
3226
|
+
] }),
|
|
3227
|
+
lines.filter(Boolean).map((line, i) => /* @__PURE__ */ jsx10("small", { children: line }, i))
|
|
3228
|
+
] });
|
|
3229
|
+
}
|
|
3230
|
+
|
|
3221
3231
|
// src/Thumb.tsx
|
|
3222
3232
|
import { useEffect as useEffect5, useRef as useRef5, useState as useState9 } from "react";
|
|
3223
3233
|
|
|
@@ -3272,7 +3282,7 @@ function preview(host, doc) {
|
|
|
3272
3282
|
}
|
|
3273
3283
|
|
|
3274
3284
|
// src/Thumb.tsx
|
|
3275
|
-
import { Fragment as Fragment9, jsx as
|
|
3285
|
+
import { Fragment as Fragment9, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3276
3286
|
function Thumb({ host, item, label }) {
|
|
3277
3287
|
const box = useRef5(null);
|
|
3278
3288
|
const [seen, setSeen] = useState9(false);
|
|
@@ -3298,26 +3308,26 @@ function Thumb({ host, item, label }) {
|
|
|
3298
3308
|
const text = item.excerpt ?? shot?.text ?? "";
|
|
3299
3309
|
const lines = text.split("\n").filter((line) => !line.trim().startsWith("```")).map((line) => line.replace(/^#+\s*/, "").replace(/[*_`>|]/g, "").trim()).filter(Boolean);
|
|
3300
3310
|
const image = item.thumbnailUrl ?? shot?.image;
|
|
3301
|
-
return /* @__PURE__ */
|
|
3302
|
-
image ? /* @__PURE__ */
|
|
3303
|
-
/* @__PURE__ */
|
|
3311
|
+
return /* @__PURE__ */ jsxs11("span", { ref: box, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
|
|
3312
|
+
image ? /* @__PURE__ */ jsx11("img", { src: image, alt: "" }) : /* @__PURE__ */ jsx11("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines.length ? /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
3313
|
+
/* @__PURE__ */ jsx11("b", { children: lines[0] }),
|
|
3304
3314
|
lines.slice(1, 14).join(" ")
|
|
3305
|
-
] }) : /* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
3307
|
-
/* @__PURE__ */
|
|
3308
|
-
/* @__PURE__ */
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3315
|
+
] }) : /* @__PURE__ */ jsxs11(Fragment9, { children: [
|
|
3316
|
+
/* @__PURE__ */ jsx11("i", {}),
|
|
3317
|
+
/* @__PURE__ */ jsx11("i", {}),
|
|
3318
|
+
/* @__PURE__ */ jsx11("i", {}),
|
|
3319
|
+
/* @__PURE__ */ jsx11("i", {}),
|
|
3320
|
+
/* @__PURE__ */ jsx11("i", {})
|
|
3311
3321
|
] }) }),
|
|
3312
|
-
label && /* @__PURE__ */
|
|
3322
|
+
label && /* @__PURE__ */ jsx11("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
|
|
3313
3323
|
] });
|
|
3314
3324
|
}
|
|
3315
3325
|
|
|
3316
3326
|
// src/Tree.tsx
|
|
3317
3327
|
import { useState as useState10 } from "react";
|
|
3318
|
-
import { ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, FileSpreadsheet as FileSpreadsheet3, FileText as FileText3, FileType as FileType5,
|
|
3319
|
-
import { Fragment as Fragment10, jsx as
|
|
3320
|
-
var icons3 = { docx: FileText3, markdown: FileType5, pdf:
|
|
3328
|
+
import { ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, File, FileSpreadsheet as FileSpreadsheet3, FileText as FileText3, FileType as FileType5, Folder, Presentation as Presentation3 } from "lucide-react";
|
|
3329
|
+
import { Fragment as Fragment10, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3330
|
+
var icons3 = { docx: FileText3, markdown: FileType5, pdf: File, sheet: FileSpreadsheet3, slides: Presentation3 };
|
|
3321
3331
|
var dragged = "application/x-w100n-document";
|
|
3322
3332
|
function grow(items, folders, names2, spaceId, other) {
|
|
3323
3333
|
const root = { key: "", name: "", at: spaceId ? { spaceId, folder: "" } : null, folders: [], files: [], count: 0 };
|
|
@@ -3358,7 +3368,7 @@ var remembered = () => {
|
|
|
3358
3368
|
return /* @__PURE__ */ new Set();
|
|
3359
3369
|
}
|
|
3360
3370
|
};
|
|
3361
|
-
function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen, onMenu, onFolderMenu, onMove, onEdit, onEditDone, onWarm }) {
|
|
3371
|
+
function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits, onOpen, onMenu, onFolderMenu, onMove, onEdit, onEditDone, onWarm }) {
|
|
3362
3372
|
const [closed, setClosed] = useState10(remembered);
|
|
3363
3373
|
const [over, setOver] = useState10(null);
|
|
3364
3374
|
const flip = (key) => {
|
|
@@ -3367,7 +3377,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
3367
3377
|
setClosed(next);
|
|
3368
3378
|
localStorage.setItem("w100n-docs-closed", JSON.stringify([...next]));
|
|
3369
3379
|
};
|
|
3370
|
-
const field = (pad, label) => /* @__PURE__ */
|
|
3380
|
+
const field = (pad, label) => /* @__PURE__ */ jsx12(
|
|
3371
3381
|
"input",
|
|
3372
3382
|
{
|
|
3373
3383
|
className: "w100n-tree-row w100n-tree-input",
|
|
@@ -3404,12 +3414,12 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
3404
3414
|
onMove(id, b.at);
|
|
3405
3415
|
}
|
|
3406
3416
|
} : {};
|
|
3407
|
-
const branch = (b, depth) => /* @__PURE__ */
|
|
3417
|
+
const branch = (b, depth) => /* @__PURE__ */ jsxs12(Fragment10, { children: [
|
|
3408
3418
|
edit?.key === `new:${b.key}` && field(24 + depth * 16, t.folderName),
|
|
3409
3419
|
b.folders.map((f) => {
|
|
3410
3420
|
const open = !closed.has(f.key) || edit?.key === `new:${f.key}`;
|
|
3411
|
-
return /* @__PURE__ */
|
|
3412
|
-
edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */
|
|
3421
|
+
return /* @__PURE__ */ jsxs12("div", { role: "group", "aria-label": f.name, "data-over": over === f.key || void 0, ...target(f), children: [
|
|
3422
|
+
edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */ jsxs12(
|
|
3413
3423
|
"button",
|
|
3414
3424
|
{
|
|
3415
3425
|
type: "button",
|
|
@@ -3423,10 +3433,10 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
3423
3433
|
onFolderMenu(f.at, f.key, e);
|
|
3424
3434
|
} : void 0,
|
|
3425
3435
|
children: [
|
|
3426
|
-
open ? /* @__PURE__ */
|
|
3427
|
-
/* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
f.count > 0 && /* @__PURE__ */
|
|
3436
|
+
open ? /* @__PURE__ */ jsx12(ChevronDown2, { "aria-hidden": true, className: "w100n-tree-fold" }) : /* @__PURE__ */ jsx12(ChevronRight2, { "aria-hidden": true, className: "w100n-tree-fold" }),
|
|
3437
|
+
/* @__PURE__ */ jsx12(Folder, { "aria-hidden": true }),
|
|
3438
|
+
/* @__PURE__ */ jsx12("span", { children: f.name }),
|
|
3439
|
+
f.count > 0 && /* @__PURE__ */ jsx12("small", { children: f.count })
|
|
3430
3440
|
]
|
|
3431
3441
|
}
|
|
3432
3442
|
),
|
|
@@ -3435,8 +3445,9 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
3435
3445
|
}),
|
|
3436
3446
|
b.files.map((item) => {
|
|
3437
3447
|
const Icon = icons3[item.kind];
|
|
3438
|
-
if (edit?.key === `file:${item.id}`) return /* @__PURE__ */
|
|
3439
|
-
|
|
3448
|
+
if (edit?.key === `file:${item.id}`) return /* @__PURE__ */ jsx12("div", { children: field(24 + depth * 16, t.rename) }, item.id);
|
|
3449
|
+
const hit = hits?.get(item.id);
|
|
3450
|
+
const row = /* @__PURE__ */ jsxs12(
|
|
3440
3451
|
"button",
|
|
3441
3452
|
{
|
|
3442
3453
|
type: "button",
|
|
@@ -3458,17 +3469,21 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
3458
3469
|
onMenu(item, e);
|
|
3459
3470
|
},
|
|
3460
3471
|
children: [
|
|
3461
|
-
/* @__PURE__ */
|
|
3462
|
-
/* @__PURE__ */
|
|
3463
|
-
item.kind !== "markdown" && /* @__PURE__ */
|
|
3472
|
+
/* @__PURE__ */ jsx12(Icon, { "aria-hidden": true, "data-kind": item.kind }),
|
|
3473
|
+
/* @__PURE__ */ jsx12("span", { children: item.name.replace(/\.[^.]+$/, "") }),
|
|
3474
|
+
item.kind !== "markdown" && /* @__PURE__ */ jsx12("small", { className: "w100n-tree-kind", children: t.kinds[item.kind] })
|
|
3464
3475
|
]
|
|
3465
3476
|
},
|
|
3466
3477
|
item.id
|
|
3467
3478
|
);
|
|
3479
|
+
return hit ? /* @__PURE__ */ jsxs12("div", { children: [
|
|
3480
|
+
row,
|
|
3481
|
+
/* @__PURE__ */ jsx12("small", { className: "w100n-tree-hit", style: { paddingLeft: 46 + depth * 16 }, children: hit.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ jsx12("mark", { children: part }, i) : part) })
|
|
3482
|
+
] }, item.id) : row;
|
|
3468
3483
|
})
|
|
3469
3484
|
] });
|
|
3470
3485
|
const root = grow(items, folders, names2, spaceId, t.elsewhere);
|
|
3471
|
-
return /* @__PURE__ */
|
|
3486
|
+
return /* @__PURE__ */ jsx12(
|
|
3472
3487
|
"nav",
|
|
3473
3488
|
{
|
|
3474
3489
|
className: "w100n-tree",
|
|
@@ -3485,11 +3500,10 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, onOpen
|
|
|
3485
3500
|
}
|
|
3486
3501
|
|
|
3487
3502
|
// src/DocumentsWorkspace.tsx
|
|
3488
|
-
import { Fragment as Fragment11, jsx as
|
|
3489
|
-
var TextEditor2 = lazy2(() => import("./TextEditor-
|
|
3490
|
-
var SheetView2 = lazy2(() => import("./SheetView-
|
|
3503
|
+
import { Fragment as Fragment11, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3504
|
+
var TextEditor2 = lazy2(() => import("./TextEditor-U3WODH75.js"));
|
|
3505
|
+
var SheetView2 = lazy2(() => import("./SheetView-P3GH4U73.js"));
|
|
3491
3506
|
var Compare = lazy2(() => import("./Compare-RHAUAKUJ.js"));
|
|
3492
|
-
var icons4 = { docx: FileText4, markdown: FileType6, pdf: Files3, sheet: FileSpreadsheet4, slides: Presentation4 };
|
|
3493
3507
|
function DocumentsWorkspace({ host, language = "en", theme = "light", place, onPlace, start, end, aside, actions }) {
|
|
3494
3508
|
const t = texts[language];
|
|
3495
3509
|
const [own, setOwn] = useState11({ spaceId: null, documentId: null });
|
|
@@ -3506,7 +3520,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3506
3520
|
const [renamed, setRenamed] = useState11("idle");
|
|
3507
3521
|
const [statusAt, setStatusAt] = useState11(null);
|
|
3508
3522
|
const [listOpen, setListOpen] = useState11(true);
|
|
3509
|
-
const [shape2, setShape] = useState11(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-view") === "tree" ? "tree" : "cards");
|
|
3510
3523
|
const [jump, setJump] = useState11(null);
|
|
3511
3524
|
const finder = useRef6(null);
|
|
3512
3525
|
const [panelOpen, setPanelOpen] = useState11(true);
|
|
@@ -3572,7 +3585,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3572
3585
|
el.style.top = `${Math.max(8, Math.min(at.y, innerHeight - el.offsetHeight - 8))}px`;
|
|
3573
3586
|
el.style.left = `${Math.max(8, Math.min(at.x, innerWidth - el.offsetWidth - 8))}px`;
|
|
3574
3587
|
}, [menu, spot2]);
|
|
3575
|
-
const [naming, setNaming] = useState11(null);
|
|
3576
3588
|
const [notice, setNotice] = useState11(null);
|
|
3577
3589
|
const early = useRef6(/* @__PURE__ */ new Map());
|
|
3578
3590
|
const hover = useRef6(0);
|
|
@@ -3663,7 +3675,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3663
3675
|
const inside = new Map((deep.data ?? []).map((hit2) => [hit2.id, hit2.excerpt]));
|
|
3664
3676
|
const shown = all.filter((item) => matches(item, query, picked) || inside.has(item.id) && matches(item, "", picked));
|
|
3665
3677
|
const present = kinds.filter((item) => all.some((doc2) => doc2.kind === item));
|
|
3666
|
-
const folders = spaceId ? [.../* @__PURE__ */ new Set(["", ...shown.map((item) => item.folder ?? "")])].filter((folder2) => shown.some((item) => (item.folder ?? "") === folder2)) : [""];
|
|
3667
3678
|
const names2 = new Map((spaces.data ?? []).map((item) => [item.id, item.name]));
|
|
3668
3679
|
const counts = /* @__PURE__ */ new Map();
|
|
3669
3680
|
for (const item of all) counts.set(item.spaceId, (counts.get(item.spaceId) ?? 0) + 1);
|
|
@@ -3678,9 +3689,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3678
3689
|
return new Intl.DateTimeFormat(language, { day: "numeric", month: "short", year: "numeric" }).format(new Date(iso));
|
|
3679
3690
|
};
|
|
3680
3691
|
const size = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(0)} KB` : `${(bytes / 1048576).toFixed(1)} MB`;
|
|
3681
|
-
const failed = (retry) => /* @__PURE__ */
|
|
3692
|
+
const failed = (retry) => /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-note", children: [
|
|
3682
3693
|
t.failed,
|
|
3683
|
-
/* @__PURE__ */
|
|
3694
|
+
/* @__PURE__ */ jsx13("button", { type: "button", onClick: retry, children: t.retry })
|
|
3684
3695
|
] });
|
|
3685
3696
|
const { ask, dialog } = useUnsaved(guard, t);
|
|
3686
3697
|
const side = (which, open2) => {
|
|
@@ -3793,8 +3804,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3793
3804
|
clearTimeout(hover.current);
|
|
3794
3805
|
hover.current = window.setTimeout(() => {
|
|
3795
3806
|
if (item.id === here.documentId) return;
|
|
3796
|
-
if (item.kind === "docx" || item.kind === "markdown") void import("./TextEditor-
|
|
3797
|
-
if (item.kind === "sheet") void import("./SheetView-
|
|
3807
|
+
if (item.kind === "docx" || item.kind === "markdown") void import("./TextEditor-U3WODH75.js");
|
|
3808
|
+
if (item.kind === "sheet") void import("./SheetView-P3GH4U73.js");
|
|
3798
3809
|
const kept2 = early.current.get(item.id);
|
|
3799
3810
|
if (kept2 && Date.now() - kept2.at < 15e3 || item.size > 5e6) return;
|
|
3800
3811
|
const next = { at: Date.now(), doc: host.document(item.id), bytes: host.content(item.id, null) };
|
|
@@ -3805,6 +3816,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3805
3816
|
early.current.set(item.id, next);
|
|
3806
3817
|
}, 150);
|
|
3807
3818
|
};
|
|
3819
|
+
const card = (item) => {
|
|
3820
|
+
const Icon = icons3[item.kind];
|
|
3821
|
+
return /* @__PURE__ */ jsx13(PreviewCard, { thumb: /* @__PURE__ */ jsx13(Thumb, { host, item, label: t.kinds[item.kind] }), icon: /* @__PURE__ */ jsx13(Icon, { "aria-hidden": true, "data-kind": item.kind }), title: item.name, lines: [
|
|
3822
|
+
[t.kinds[item.kind], size(item.size), names2.get(item.spaceId), item.folder].filter(Boolean).join(" \xB7 "),
|
|
3823
|
+
item.createdAt && [t.createdOn.replace("{when}", date(item.createdAt)), item.createdBy?.name].filter(Boolean).join(" \xB7 "),
|
|
3824
|
+
[t.updatedOn.replace("{when}", ago(item.updatedAt)), item.updatedBy?.name].filter(Boolean).join(" \xB7 "),
|
|
3825
|
+
inside.get(item.id)?.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ jsx13("mark", { children: part }, i) : part)
|
|
3826
|
+
] });
|
|
3827
|
+
};
|
|
3808
3828
|
const act = async (run2, done) => {
|
|
3809
3829
|
setMenu(null);
|
|
3810
3830
|
setSpot(null);
|
|
@@ -3823,7 +3843,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3823
3843
|
setTimeout(() => URL.revokeObjectURL(url), 1e3);
|
|
3824
3844
|
};
|
|
3825
3845
|
const retitle = async (item, draft) => {
|
|
3826
|
-
setNaming(null);
|
|
3827
3846
|
const ext = /\.[^.]+$/.exec(item.name)?.[0] ?? "";
|
|
3828
3847
|
const name = draft.trim() && (/\.[^.\s]+$/.test(draft.trim()) ? draft.trim() : draft.trim() + ext);
|
|
3829
3848
|
if (!name || name === item.name) return;
|
|
@@ -3935,8 +3954,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3935
3954
|
window.addEventListener("keydown", press, true);
|
|
3936
3955
|
return () => window.removeEventListener("keydown", press, true);
|
|
3937
3956
|
});
|
|
3938
|
-
let stage = /* @__PURE__ */
|
|
3939
|
-
/* @__PURE__ */
|
|
3957
|
+
let stage = /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-empty", children: [
|
|
3958
|
+
/* @__PURE__ */ jsx13(FileText4, { "aria-hidden": true }),
|
|
3940
3959
|
t.pick
|
|
3941
3960
|
] });
|
|
3942
3961
|
if (here.documentId) {
|
|
@@ -3944,9 +3963,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3944
3963
|
doc.retry();
|
|
3945
3964
|
content.retry();
|
|
3946
3965
|
});
|
|
3947
|
-
else if (!doc.data || !content.data) stage = /* @__PURE__ */
|
|
3948
|
-
else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */
|
|
3949
|
-
else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */
|
|
3966
|
+
else if (!doc.data || !content.data) stage = /* @__PURE__ */ jsx13("div", { className: "w100n-docs-empty", children: t.loading });
|
|
3967
|
+
else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ jsx13(Suspense2, { fallback: /* @__PURE__ */ jsx13("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx13(Compare, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
|
|
3968
|
+
else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ jsx13(Suspense2, { fallback: /* @__PURE__ */ jsx13("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx13(
|
|
3950
3969
|
TextEditor2,
|
|
3951
3970
|
{
|
|
3952
3971
|
kind: doc.data.kind,
|
|
@@ -3983,7 +4002,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3983
4002
|
},
|
|
3984
4003
|
doc.data.id
|
|
3985
4004
|
) });
|
|
3986
|
-
else if (doc.data.kind === "pdf") stage = /* @__PURE__ */
|
|
4005
|
+
else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ jsx13(
|
|
3987
4006
|
PdfView,
|
|
3988
4007
|
{
|
|
3989
4008
|
bytes: content.data,
|
|
@@ -4005,7 +4024,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4005
4024
|
},
|
|
4006
4025
|
`${doc.data.id}:${versionId ?? ""}`
|
|
4007
4026
|
);
|
|
4008
|
-
else if (doc.data.kind === "slides") stage = /* @__PURE__ */
|
|
4027
|
+
else if (doc.data.kind === "slides") stage = /* @__PURE__ */ jsx13(
|
|
4009
4028
|
SlidesView,
|
|
4010
4029
|
{
|
|
4011
4030
|
html: new TextDecoder().decode(content.data),
|
|
@@ -4024,7 +4043,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4024
4043
|
},
|
|
4025
4044
|
doc.data.id
|
|
4026
4045
|
);
|
|
4027
|
-
else if (doc.data.kind === "sheet") stage = /* @__PURE__ */
|
|
4046
|
+
else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ jsx13(Suspense2, { fallback: /* @__PURE__ */ jsx13("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx13(
|
|
4028
4047
|
SheetView2,
|
|
4029
4048
|
{
|
|
4030
4049
|
bytes: content.data,
|
|
@@ -4051,9 +4070,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4051
4070
|
},
|
|
4052
4071
|
`${doc.data.id}:${versionId ?? ""}`
|
|
4053
4072
|
) });
|
|
4054
|
-
else stage = /* @__PURE__ */
|
|
4073
|
+
else stage = /* @__PURE__ */ jsx13("div", { className: "w100n-docs-empty", children: t.unsupported });
|
|
4055
4074
|
}
|
|
4056
|
-
const Kind = doc.data ?
|
|
4075
|
+
const Kind = doc.data ? icons3[doc.data.kind] : FileText4;
|
|
4057
4076
|
const top = Math.min(...outline.map((h) => h.level));
|
|
4058
4077
|
const chapters = outline.reduce((all2, h) => {
|
|
4059
4078
|
if (h.level === top || !all2.length) all2.push({ head: h, subs: [] });
|
|
@@ -4076,7 +4095,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4076
4095
|
if (text && host.comments && !versionId) panelTabs.push(["comments", MessagesSquare, t.comments]);
|
|
4077
4096
|
const sharing = !!host.links && !!doc.data?.rights.edit && !versionId;
|
|
4078
4097
|
if (sharing) panelTabs.push(["sharing", Share2, t.sharing]);
|
|
4079
|
-
const listToggle = /* @__PURE__ */
|
|
4098
|
+
const listToggle = /* @__PURE__ */ jsx13(
|
|
4080
4099
|
"button",
|
|
4081
4100
|
{
|
|
4082
4101
|
ref: listButton,
|
|
@@ -4086,10 +4105,10 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4086
4105
|
onClick: () => side("list", !listOpen),
|
|
4087
4106
|
"aria-label": listOpen ? t.closeList : t.openList,
|
|
4088
4107
|
title: listOpen ? t.closeList : t.openList,
|
|
4089
|
-
children: listOpen ? /* @__PURE__ */
|
|
4108
|
+
children: listOpen ? /* @__PURE__ */ jsx13(PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx13(PanelLeftOpen, { "aria-hidden": true })
|
|
4090
4109
|
}
|
|
4091
4110
|
);
|
|
4092
|
-
const panelToggle = doc.data && /* @__PURE__ */
|
|
4111
|
+
const panelToggle = doc.data && /* @__PURE__ */ jsx13(
|
|
4093
4112
|
"button",
|
|
4094
4113
|
{
|
|
4095
4114
|
ref: panelButton,
|
|
@@ -4099,16 +4118,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4099
4118
|
onClick: () => side("panel", !panelOpen),
|
|
4100
4119
|
"aria-label": panelOpen ? t.closePanel : t.openPanel,
|
|
4101
4120
|
title: panelOpen ? t.closePanel : t.openPanel,
|
|
4102
|
-
children: panelOpen ? /* @__PURE__ */
|
|
4121
|
+
children: panelOpen ? /* @__PURE__ */ jsx13(PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ jsx13(PanelRightOpen, { "aria-hidden": true })
|
|
4103
4122
|
}
|
|
4104
4123
|
);
|
|
4105
|
-
return /* @__PURE__ */
|
|
4106
|
-
/* @__PURE__ */
|
|
4107
|
-
start && /* @__PURE__ */
|
|
4124
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w100n-docs", "data-theme": theme, children: [
|
|
4125
|
+
/* @__PURE__ */ jsxs13("header", { className: "w100n-docs-bar", children: [
|
|
4126
|
+
start && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
|
|
4108
4127
|
narrow && listToggle,
|
|
4109
|
-
/* @__PURE__ */
|
|
4110
|
-
/* @__PURE__ */
|
|
4111
|
-
renaming !== null && doc.data ? /* @__PURE__ */
|
|
4128
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ jsx13(Kind, { "aria-hidden": true }) }),
|
|
4129
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-heading", children: [
|
|
4130
|
+
renaming !== null && doc.data ? /* @__PURE__ */ jsx13(
|
|
4112
4131
|
"input",
|
|
4113
4132
|
{
|
|
4114
4133
|
className: "w100n-docs-title w100n-docs-rename",
|
|
@@ -4126,7 +4145,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4126
4145
|
}
|
|
4127
4146
|
}
|
|
4128
4147
|
}
|
|
4129
|
-
) : /* @__PURE__ */
|
|
4148
|
+
) : /* @__PURE__ */ jsx13(
|
|
4130
4149
|
"strong",
|
|
4131
4150
|
{
|
|
4132
4151
|
className: "w100n-docs-title",
|
|
@@ -4135,31 +4154,31 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4135
4154
|
children: doc.data?.name ?? t.documents
|
|
4136
4155
|
}
|
|
4137
4156
|
),
|
|
4138
|
-
docbar ? /* @__PURE__ */
|
|
4139
|
-
i > 0 && /* @__PURE__ */
|
|
4157
|
+
docbar ? /* @__PURE__ */ jsx13("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ jsx13("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ jsxs13("span", { children: [
|
|
4158
|
+
i > 0 && /* @__PURE__ */ jsx13(ChevronRight3, { "aria-hidden": true }),
|
|
4140
4159
|
item
|
|
4141
|
-
] }, i)) }) : /* @__PURE__ */
|
|
4160
|
+
] }, i)) }) : /* @__PURE__ */ jsx13("span", { className: "w100n-docs-hint", children: t.hint })
|
|
4142
4161
|
] }),
|
|
4143
|
-
versionId && /* @__PURE__ */
|
|
4144
|
-
versionId && text && /* @__PURE__ */
|
|
4145
|
-
/* @__PURE__ */
|
|
4162
|
+
versionId && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
|
|
4163
|
+
versionId && text && /* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
|
|
4164
|
+
/* @__PURE__ */ jsx13(FileDiff, { "aria-hidden": true }),
|
|
4146
4165
|
comparing ? t.hideChanges : t.showChanges
|
|
4147
4166
|
] }),
|
|
4148
|
-
versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */
|
|
4149
|
-
/* @__PURE__ */
|
|
4167
|
+
versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
|
|
4168
|
+
/* @__PURE__ */ jsx13(RotateCcw2, { "aria-hidden": true }),
|
|
4150
4169
|
t.restore
|
|
4151
4170
|
] }),
|
|
4152
|
-
restoring === "failed" && /* @__PURE__ */
|
|
4153
|
-
doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */
|
|
4154
|
-
/* @__PURE__ */
|
|
4171
|
+
restoring === "failed" && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
|
|
4172
|
+
doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
|
|
4173
|
+
/* @__PURE__ */ jsx13(FileSpreadsheet4, { "aria-hidden": true }),
|
|
4155
4174
|
t.copyAs
|
|
4156
4175
|
] }),
|
|
4157
|
-
copying === "failed" && /* @__PURE__ */
|
|
4158
|
-
kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */
|
|
4159
|
-
kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */
|
|
4160
|
-
renamed === "failed" && /* @__PURE__ */
|
|
4161
|
-
docbar && /* @__PURE__ */
|
|
4162
|
-
host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */
|
|
4176
|
+
copying === "failed" && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-muted", children: t.copyFailed }),
|
|
4177
|
+
kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
|
|
4178
|
+
kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
|
|
4179
|
+
renamed === "failed" && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-muted", children: t.renameFailed }),
|
|
4180
|
+
docbar && /* @__PURE__ */ jsx13("span", { ref: setStatusAt, className: "w100n-docs-status" }),
|
|
4181
|
+
host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ jsx13(
|
|
4163
4182
|
"button",
|
|
4164
4183
|
{
|
|
4165
4184
|
type: "button",
|
|
@@ -4168,145 +4187,138 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4168
4187
|
"aria-label": t.sendChat,
|
|
4169
4188
|
title: t.sendChat,
|
|
4170
4189
|
onClick: () => host.send(doc.data.id),
|
|
4171
|
-
children: /* @__PURE__ */
|
|
4190
|
+
children: /* @__PURE__ */ jsx13(Send, { "aria-hidden": true })
|
|
4172
4191
|
}
|
|
4173
4192
|
),
|
|
4174
|
-
sharing && /* @__PURE__ */
|
|
4193
|
+
sharing && /* @__PURE__ */ jsx13("button", { type: "button", className: "w100n-docs-action w100n-docs-square", "aria-label": t.share, title: t.share, onClick: () => {
|
|
4175
4194
|
setTab("sharing");
|
|
4176
4195
|
side("panel", true);
|
|
4177
|
-
}, children: /* @__PURE__ */
|
|
4196
|
+
}, children: /* @__PURE__ */ jsx13(Share2, { "aria-hidden": true }) }),
|
|
4178
4197
|
doc.data && !versionId && actions?.(doc.data),
|
|
4179
4198
|
narrow && panelToggle,
|
|
4180
|
-
end && /* @__PURE__ */
|
|
4199
|
+
end && /* @__PURE__ */ jsx13("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
|
|
4181
4200
|
] }),
|
|
4182
|
-
/* @__PURE__ */
|
|
4183
|
-
listOpen && /* @__PURE__ */
|
|
4184
|
-
/* @__PURE__ */
|
|
4185
|
-
/* @__PURE__ */
|
|
4186
|
-
/* @__PURE__ */
|
|
4187
|
-
/* @__PURE__ */
|
|
4201
|
+
/* @__PURE__ */ jsxs13("div", { ref: body, className: "w100n-docs-body", children: [
|
|
4202
|
+
listOpen && /* @__PURE__ */ jsxs13("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
|
|
4203
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-head", children: [
|
|
4204
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-row", children: [
|
|
4205
|
+
/* @__PURE__ */ jsxs13("p", { className: "w100n-docs-caption", children: [
|
|
4206
|
+
/* @__PURE__ */ jsx13(Files2, { "aria-hidden": true }),
|
|
4188
4207
|
t.documents,
|
|
4189
|
-
/* @__PURE__ */
|
|
4208
|
+
/* @__PURE__ */ jsx13("span", { children: all.length })
|
|
4190
4209
|
] }),
|
|
4191
|
-
host.create && /* @__PURE__ */
|
|
4210
|
+
host.create && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-new", onKeyDown: (e) => {
|
|
4192
4211
|
if (e.key === "Escape" && adding) {
|
|
4193
4212
|
e.stopPropagation();
|
|
4194
4213
|
setAdding(false);
|
|
4195
4214
|
}
|
|
4196
4215
|
}, children: [
|
|
4197
|
-
/* @__PURE__ */
|
|
4198
|
-
/* @__PURE__ */
|
|
4199
|
-
/* @__PURE__ */
|
|
4200
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
|
|
4217
|
+
/* @__PURE__ */ jsx13(Plus5, { "aria-hidden": true }),
|
|
4218
|
+
/* @__PURE__ */ jsx13("span", { children: sending === "busy" ? t.uploading : t.create }),
|
|
4219
|
+
/* @__PURE__ */ jsx13(ChevronDown3, { "aria-hidden": true })
|
|
4201
4220
|
] }),
|
|
4202
|
-
adding && /* @__PURE__ */
|
|
4203
|
-
/* @__PURE__ */
|
|
4221
|
+
adding && /* @__PURE__ */ jsxs13("div", { role: "menu", className: "w100n-docs-menu", children: [
|
|
4222
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4204
4223
|
setAdding(false);
|
|
4205
4224
|
setMaking(true);
|
|
4206
4225
|
}, children: [
|
|
4207
|
-
/* @__PURE__ */
|
|
4208
|
-
/* @__PURE__ */
|
|
4226
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx13(FilePlus, { "aria-hidden": true }) }),
|
|
4227
|
+
/* @__PURE__ */ jsx13("b", { children: t.newTitle })
|
|
4209
4228
|
] }),
|
|
4210
|
-
/* @__PURE__ */
|
|
4229
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4211
4230
|
setAdding(false);
|
|
4212
4231
|
upload.current.click();
|
|
4213
4232
|
}, children: [
|
|
4214
|
-
/* @__PURE__ */
|
|
4215
|
-
/* @__PURE__ */
|
|
4233
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx13(Upload, { "aria-hidden": true }) }),
|
|
4234
|
+
/* @__PURE__ */ jsx13("b", { children: t.uploadFile })
|
|
4216
4235
|
] })
|
|
4217
4236
|
] }),
|
|
4218
|
-
/* @__PURE__ */
|
|
4237
|
+
/* @__PURE__ */ jsx13("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
|
|
4219
4238
|
const file = e.target.files?.[0];
|
|
4220
4239
|
e.target.value = "";
|
|
4221
4240
|
if (file) void send(file);
|
|
4222
4241
|
} })
|
|
4223
4242
|
] }),
|
|
4224
|
-
/* @__PURE__ */
|
|
4243
|
+
/* @__PURE__ */ jsx13("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ jsx13(X6, { "aria-hidden": true }) })
|
|
4225
4244
|
] }),
|
|
4226
|
-
(spaces.data?.length ?? 0) > 1 && /* @__PURE__ */
|
|
4245
|
+
(spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
|
|
4227
4246
|
if (e.key !== "Escape" || !picking) return;
|
|
4228
4247
|
e.stopPropagation();
|
|
4229
4248
|
setPicking(false);
|
|
4230
4249
|
e.currentTarget.querySelector("button").focus();
|
|
4231
4250
|
}, children: [
|
|
4232
|
-
/* @__PURE__ */
|
|
4233
|
-
space ? /* @__PURE__ */
|
|
4234
|
-
/* @__PURE__ */
|
|
4235
|
-
!space && /* @__PURE__ */
|
|
4236
|
-
/* @__PURE__ */
|
|
4251
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
|
|
4252
|
+
space ? /* @__PURE__ */ jsx13("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ jsx13("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx13(LayoutGrid, { "aria-hidden": true }) }),
|
|
4253
|
+
/* @__PURE__ */ jsx13("b", { children: space?.name ?? t.allProjects }),
|
|
4254
|
+
!space && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-count", children: all.length }),
|
|
4255
|
+
/* @__PURE__ */ jsx13(ChevronDown3, { "aria-hidden": true })
|
|
4237
4256
|
] }),
|
|
4238
|
-
picking && /* @__PURE__ */
|
|
4239
|
-
/* @__PURE__ */
|
|
4240
|
-
/* @__PURE__ */
|
|
4241
|
-
/* @__PURE__ */
|
|
4242
|
-
!spaceId && /* @__PURE__ */
|
|
4257
|
+
picking && /* @__PURE__ */ jsxs13("div", { role: "listbox", className: "w100n-docs-menu", children: [
|
|
4258
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
|
|
4259
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-all", children: /* @__PURE__ */ jsx13(LayoutGrid, { "aria-hidden": true }) }),
|
|
4260
|
+
/* @__PURE__ */ jsx13("b", { children: t.allProjects }),
|
|
4261
|
+
!spaceId && /* @__PURE__ */ jsx13(Check2, { "aria-hidden": true })
|
|
4243
4262
|
] }),
|
|
4244
|
-
groups.map((group) => /* @__PURE__ */
|
|
4245
|
-
group && /* @__PURE__ */
|
|
4246
|
-
(spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */
|
|
4247
|
-
/* @__PURE__ */
|
|
4248
|
-
/* @__PURE__ */
|
|
4249
|
-
!spaceId && counts.get(item.id) ? /* @__PURE__ */
|
|
4250
|
-
item.id === spaceId && /* @__PURE__ */
|
|
4263
|
+
groups.map((group) => /* @__PURE__ */ jsxs13("div", { role: "group", "aria-label": group || void 0, children: [
|
|
4264
|
+
group && /* @__PURE__ */ jsx13("p", { className: "w100n-docs-menu-caption", children: group }),
|
|
4265
|
+
(spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ jsxs13("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
|
|
4266
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
|
|
4267
|
+
/* @__PURE__ */ jsx13("b", { children: item.name }),
|
|
4268
|
+
!spaceId && counts.get(item.id) ? /* @__PURE__ */ jsx13("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
|
|
4269
|
+
item.id === spaceId && /* @__PURE__ */ jsx13(Check2, { "aria-hidden": true })
|
|
4251
4270
|
] }, item.id))
|
|
4252
4271
|
] }, group))
|
|
4253
4272
|
] })
|
|
4254
4273
|
] }),
|
|
4255
|
-
/* @__PURE__ */
|
|
4256
|
-
/* @__PURE__ */
|
|
4257
|
-
/* @__PURE__ */
|
|
4258
|
-
/* @__PURE__ */
|
|
4259
|
-
/* @__PURE__ */
|
|
4274
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-filters", children: [
|
|
4275
|
+
/* @__PURE__ */ jsxs13("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
4276
|
+
/* @__PURE__ */ jsx13(Search3, { "aria-hidden": true }),
|
|
4277
|
+
/* @__PURE__ */ jsx13("input", { ref: finder, value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search }),
|
|
4278
|
+
/* @__PURE__ */ jsx13("kbd", { children: "\u2318O" })
|
|
4260
4279
|
] }),
|
|
4261
|
-
present.length > 1 && /* @__PURE__ */
|
|
4280
|
+
present.length > 1 && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-types", onKeyDown: (e) => {
|
|
4262
4281
|
if (e.key !== "Escape" || !typing) return;
|
|
4263
4282
|
e.stopPropagation();
|
|
4264
4283
|
setTyping(false);
|
|
4265
4284
|
e.currentTarget.querySelector("button").focus();
|
|
4266
4285
|
}, children: [
|
|
4267
|
-
/* @__PURE__ */
|
|
4268
|
-
/* @__PURE__ */
|
|
4269
|
-
/* @__PURE__ */
|
|
4270
|
-
picked.length > 0 && /* @__PURE__ */
|
|
4271
|
-
/* @__PURE__ */
|
|
4286
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
|
|
4287
|
+
/* @__PURE__ */ jsx13(ListFilter, { "aria-hidden": true }),
|
|
4288
|
+
/* @__PURE__ */ jsx13("b", { children: t.typeFilter }),
|
|
4289
|
+
picked.length > 0 && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-badge", children: picked.length }),
|
|
4290
|
+
/* @__PURE__ */ jsx13(ChevronDown3, { "aria-hidden": true })
|
|
4272
4291
|
] }),
|
|
4273
|
-
typing && /* @__PURE__ */
|
|
4292
|
+
typing && /* @__PURE__ */ jsxs13("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
|
|
4274
4293
|
present.map((item) => {
|
|
4275
|
-
const Icon =
|
|
4294
|
+
const Icon = icons3[item];
|
|
4276
4295
|
const on = picked.includes(item);
|
|
4277
|
-
return /* @__PURE__ */
|
|
4278
|
-
/* @__PURE__ */
|
|
4279
|
-
/* @__PURE__ */
|
|
4280
|
-
/* @__PURE__ */
|
|
4281
|
-
/* @__PURE__ */
|
|
4296
|
+
return /* @__PURE__ */ jsxs13("button", { type: "button", role: "option", "aria-selected": on, onClick: () => setPicked(on ? picked.filter((k) => k !== item) : [...picked, item]), children: [
|
|
4297
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-box", children: on && /* @__PURE__ */ jsx13(Check2, { "aria-hidden": true }) }),
|
|
4298
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ jsx13(Icon, { "aria-hidden": true }) }),
|
|
4299
|
+
/* @__PURE__ */ jsx13("b", { children: t.kinds[item] }),
|
|
4300
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
|
|
4282
4301
|
] }, item);
|
|
4283
4302
|
}),
|
|
4284
|
-
/* @__PURE__ */
|
|
4285
|
-
/* @__PURE__ */
|
|
4286
|
-
/* @__PURE__ */
|
|
4303
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-menu-foot", children: [
|
|
4304
|
+
/* @__PURE__ */ jsx13("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
|
|
4305
|
+
/* @__PURE__ */ jsx13("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
|
|
4287
4306
|
] })
|
|
4288
4307
|
] })
|
|
4289
4308
|
] })
|
|
4290
4309
|
] }),
|
|
4291
|
-
/* @__PURE__ */
|
|
4292
|
-
setShape(key);
|
|
4293
|
-
localStorage.setItem("w100n-docs-view", key);
|
|
4294
|
-
}, children: [
|
|
4295
|
-
/* @__PURE__ */ jsx12(Icon, { "aria-hidden": true }),
|
|
4296
|
-
label
|
|
4297
|
-
] }, key)) }),
|
|
4298
|
-
picked.length > 0 && /* @__PURE__ */ jsx12("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ jsxs12("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
|
|
4310
|
+
picked.length > 0 && /* @__PURE__ */ jsx13("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ jsxs13("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
|
|
4299
4311
|
t.kinds[item],
|
|
4300
|
-
/* @__PURE__ */
|
|
4312
|
+
/* @__PURE__ */ jsx13(X6, { "aria-hidden": true })
|
|
4301
4313
|
] }, item)) })
|
|
4302
4314
|
] }),
|
|
4303
|
-
/* @__PURE__ */
|
|
4304
|
-
sending === "failed" && /* @__PURE__ */
|
|
4315
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-cards", children: [
|
|
4316
|
+
sending === "failed" && /* @__PURE__ */ jsx13("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
|
|
4305
4317
|
list.error && failed(list.retry),
|
|
4306
|
-
list.loading && !list.data && /* @__PURE__ */
|
|
4307
|
-
notice && /* @__PURE__ */
|
|
4308
|
-
list.data && !shown.length && /* @__PURE__ */
|
|
4309
|
-
|
|
4318
|
+
list.loading && !list.data && /* @__PURE__ */ jsx13("p", { className: "w100n-docs-muted", children: t.loading }),
|
|
4319
|
+
notice && /* @__PURE__ */ jsx13("p", { className: "w100n-docs-muted", role: "status", children: notice }),
|
|
4320
|
+
list.data && !shown.length && /* @__PURE__ */ jsx13("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
|
|
4321
|
+
list.data && /* @__PURE__ */ jsx13(
|
|
4310
4322
|
Tree,
|
|
4311
4323
|
{
|
|
4312
4324
|
items: shown,
|
|
@@ -4316,6 +4328,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4316
4328
|
current: here.documentId,
|
|
4317
4329
|
t,
|
|
4318
4330
|
edit,
|
|
4331
|
+
hits: query.trim() ? inside : void 0,
|
|
4319
4332
|
onEdit: (text2) => setEdit(text2 === null ? null : edit && { ...edit, text: text2 }),
|
|
4320
4333
|
onEditDone: commit,
|
|
4321
4334
|
onOpen: open,
|
|
@@ -4333,84 +4346,35 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4333
4346
|
} : void 0,
|
|
4334
4347
|
onWarm: (item) => item ? warm(item) : clearTimeout(hover.current)
|
|
4335
4348
|
}
|
|
4336
|
-
)
|
|
4337
|
-
shape2 === "cards" && folders.map((folder2) => /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
|
|
4338
|
-
folders.length > 1 && /* @__PURE__ */ jsx12("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
|
|
4339
|
-
/* @__PURE__ */ jsx12("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => naming?.id === item.id ? /* @__PURE__ */ jsxs12("div", { className: "w100n-docs-card", children: [
|
|
4340
|
-
/* @__PURE__ */ jsx12(Thumb, { host, item, label: t.kinds[item.kind] }),
|
|
4341
|
-
/* @__PURE__ */ jsx12("span", { className: "w100n-docs-card-text", children: /* @__PURE__ */ jsx12(
|
|
4342
|
-
"input",
|
|
4343
|
-
{
|
|
4344
|
-
className: "w100n-docs-field",
|
|
4345
|
-
autoFocus: true,
|
|
4346
|
-
value: naming.text,
|
|
4347
|
-
"aria-label": t.rename,
|
|
4348
|
-
onFocus: (e) => e.currentTarget.select(),
|
|
4349
|
-
onChange: (e) => setNaming({ ...naming, text: e.target.value }),
|
|
4350
|
-
onBlur: () => void retitle(item, naming.text),
|
|
4351
|
-
onKeyDown: (e) => {
|
|
4352
|
-
if (e.key === "Enter") e.currentTarget.blur();
|
|
4353
|
-
if (e.key === "Escape") {
|
|
4354
|
-
e.stopPropagation();
|
|
4355
|
-
setNaming(null);
|
|
4356
|
-
}
|
|
4357
|
-
}
|
|
4358
|
-
}
|
|
4359
|
-
) })
|
|
4360
|
-
] }, item.id) : /* @__PURE__ */ jsxs12(
|
|
4361
|
-
"button",
|
|
4362
|
-
{
|
|
4363
|
-
type: "button",
|
|
4364
|
-
className: "w100n-docs-card",
|
|
4365
|
-
"aria-current": item.id === here.documentId,
|
|
4366
|
-
onClick: () => open(item),
|
|
4367
|
-
title: item.name,
|
|
4368
|
-
onPointerEnter: () => warm(item),
|
|
4369
|
-
onPointerLeave: () => clearTimeout(hover.current),
|
|
4370
|
-
onContextMenu: (e) => {
|
|
4371
|
-
e.preventDefault();
|
|
4372
|
-
setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
|
|
4373
|
-
},
|
|
4374
|
-
children: [
|
|
4375
|
-
/* @__PURE__ */ jsx12(Thumb, { host, item, label: t.kinds[item.kind] }),
|
|
4376
|
-
/* @__PURE__ */ jsxs12("span", { className: "w100n-docs-card-text", children: [
|
|
4377
|
-
/* @__PURE__ */ jsx12("b", { children: item.name }),
|
|
4378
|
-
/* @__PURE__ */ jsx12("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
|
|
4379
|
-
inside.get(item.id) && /* @__PURE__ */ jsx12("small", { className: "w100n-docs-hit", children: inside.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ jsx12("mark", { children: part }, i) : part) })
|
|
4380
|
-
] })
|
|
4381
|
-
]
|
|
4382
|
-
},
|
|
4383
|
-
item.id
|
|
4384
|
-
)) })
|
|
4385
|
-
] }, folder2))
|
|
4349
|
+
)
|
|
4386
4350
|
] })
|
|
4387
4351
|
] }),
|
|
4388
4352
|
!narrow && !listOpen && listToggle,
|
|
4389
|
-
/* @__PURE__ */
|
|
4353
|
+
/* @__PURE__ */ jsxs13("main", { className: "w100n-docs-stage", children: [
|
|
4390
4354
|
!narrow && !panelOpen && panelToggle,
|
|
4391
|
-
/* @__PURE__ */
|
|
4355
|
+
/* @__PURE__ */ jsx13("div", { className: "w100n-docs-bare", children: stage })
|
|
4392
4356
|
] }),
|
|
4393
|
-
doc.data && panelOpen && /* @__PURE__ */
|
|
4394
|
-
/* @__PURE__ */
|
|
4395
|
-
/* @__PURE__ */
|
|
4396
|
-
/* @__PURE__ */
|
|
4397
|
-
(panelTabs.length < 4 || tab === key && panelTabs.length < 5) && /* @__PURE__ */
|
|
4357
|
+
doc.data && panelOpen && /* @__PURE__ */ jsxs13("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
|
|
4358
|
+
/* @__PURE__ */ jsx13("div", { className: "w100n-docs-head", children: /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-row", children: [
|
|
4359
|
+
/* @__PURE__ */ jsx13("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key, Icon, label]) => /* @__PURE__ */ jsxs13("button", { type: "button", role: "tab", "aria-selected": tab === key, tabIndex: tab === key ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key), children: [
|
|
4360
|
+
/* @__PURE__ */ jsx13(Icon, { "aria-hidden": true }),
|
|
4361
|
+
(panelTabs.length < 4 || tab === key && panelTabs.length < 5) && /* @__PURE__ */ jsx13("span", { children: label })
|
|
4398
4362
|
] }, key)) }),
|
|
4399
|
-
/* @__PURE__ */
|
|
4363
|
+
/* @__PURE__ */ jsx13("button", { type: "button", className: "w100n-docs-close", onClick: () => side("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ jsx13(X6, { "aria-hidden": true }) })
|
|
4400
4364
|
] }) }),
|
|
4401
|
-
/* @__PURE__ */
|
|
4402
|
-
tab === "outline" && (outline.length ? /* @__PURE__ */
|
|
4403
|
-
now && /* @__PURE__ */
|
|
4404
|
-
/* @__PURE__ */
|
|
4405
|
-
/* @__PURE__ */
|
|
4365
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key]) => key === tab)?.[2], children: [
|
|
4366
|
+
tab === "outline" && (outline.length ? /* @__PURE__ */ jsxs13("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
|
|
4367
|
+
now && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-reading", children: [
|
|
4368
|
+
/* @__PURE__ */ jsx13("span", { children: /* @__PURE__ */ jsx13("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
|
|
4369
|
+
/* @__PURE__ */ jsxs13("small", { children: [
|
|
4406
4370
|
Math.round(now.progress * 100),
|
|
4407
4371
|
"% ",
|
|
4408
4372
|
t.read
|
|
4409
4373
|
] })
|
|
4410
4374
|
] }),
|
|
4411
|
-
outline.length > 8 && /* @__PURE__ */
|
|
4412
|
-
/* @__PURE__ */
|
|
4413
|
-
/* @__PURE__ */
|
|
4375
|
+
outline.length > 8 && /* @__PURE__ */ jsxs13("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
4376
|
+
/* @__PURE__ */ jsx13(Search3, { "aria-hidden": true }),
|
|
4377
|
+
/* @__PURE__ */ jsx13("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
|
|
4414
4378
|
] }),
|
|
4415
4379
|
chapters.map((c, i) => {
|
|
4416
4380
|
const subs = words.length ? c.subs.filter(hit) : c.subs;
|
|
@@ -4418,13 +4382,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4418
4382
|
const opened2 = words.length > 0 || (fold[c.head.id] ?? i === reached);
|
|
4419
4383
|
const named = /^(\d+)[.)]?\s+(.+)$/.exec(c.head.text);
|
|
4420
4384
|
const mark = c.subs.findIndex((s) => s.id === now?.id);
|
|
4421
|
-
return /* @__PURE__ */
|
|
4422
|
-
/* @__PURE__ */
|
|
4423
|
-
/* @__PURE__ */
|
|
4424
|
-
/* @__PURE__ */
|
|
4425
|
-
/* @__PURE__ */
|
|
4385
|
+
return /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
|
|
4386
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-chapter-row", children: [
|
|
4387
|
+
/* @__PURE__ */ jsxs13("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: [
|
|
4388
|
+
/* @__PURE__ */ jsx13("span", { className: "w100n-docs-chapter-num", children: named ? named[1] : /* @__PURE__ */ jsx13(Bookmark, { "aria-hidden": true }) }),
|
|
4389
|
+
/* @__PURE__ */ jsx13("b", { children: named ? named[2] : c.head.text })
|
|
4426
4390
|
] }),
|
|
4427
|
-
c.subs.length > 0 && /* @__PURE__ */
|
|
4391
|
+
c.subs.length > 0 && /* @__PURE__ */ jsxs13(
|
|
4428
4392
|
"button",
|
|
4429
4393
|
{
|
|
4430
4394
|
type: "button",
|
|
@@ -4434,13 +4398,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4434
4398
|
title: opened2 ? t.hideSections : t.showSections,
|
|
4435
4399
|
onClick: () => setFold({ ...fold, [c.head.id]: !opened2 }),
|
|
4436
4400
|
children: [
|
|
4437
|
-
/* @__PURE__ */
|
|
4438
|
-
opened2 ? /* @__PURE__ */
|
|
4401
|
+
/* @__PURE__ */ jsx13("small", { children: c.subs.length }),
|
|
4402
|
+
opened2 ? /* @__PURE__ */ jsx13(ChevronDown3, { "aria-hidden": true }) : /* @__PURE__ */ jsx13(ChevronRight3, { "aria-hidden": true })
|
|
4439
4403
|
]
|
|
4440
4404
|
}
|
|
4441
4405
|
)
|
|
4442
4406
|
] }),
|
|
4443
|
-
opened2 && subs.length > 0 && /* @__PURE__ */
|
|
4407
|
+
opened2 && subs.length > 0 && /* @__PURE__ */ jsx13("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ jsxs13(
|
|
4444
4408
|
"button",
|
|
4445
4409
|
{
|
|
4446
4410
|
type: "button",
|
|
@@ -4449,7 +4413,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4449
4413
|
"data-state": i < reached || i === reached && c.subs.indexOf(s) < mark ? "done" : void 0,
|
|
4450
4414
|
"aria-current": now?.id === s.id ? "location" : void 0,
|
|
4451
4415
|
children: [
|
|
4452
|
-
/* @__PURE__ */
|
|
4416
|
+
/* @__PURE__ */ jsx13("i", { "aria-hidden": true }),
|
|
4453
4417
|
s.text
|
|
4454
4418
|
]
|
|
4455
4419
|
},
|
|
@@ -4457,47 +4421,47 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4457
4421
|
)) })
|
|
4458
4422
|
] }, c.head.id);
|
|
4459
4423
|
})
|
|
4460
|
-
] }) : /* @__PURE__ */
|
|
4461
|
-
tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */
|
|
4462
|
-
tab === "versions" && /* @__PURE__ */
|
|
4424
|
+
] }) : /* @__PURE__ */ jsx13("p", { className: "w100n-docs-muted", children: t.noOutline })),
|
|
4425
|
+
tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ jsx13(Backlinks, { host, current: doc.data, notes, t, onOpen: open }),
|
|
4426
|
+
tab === "versions" && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-versions", children: [
|
|
4463
4427
|
versions.error && failed(versions.retry),
|
|
4464
|
-
(versions.data ?? []).map((item) => /* @__PURE__ */
|
|
4428
|
+
(versions.data ?? []).map((item) => /* @__PURE__ */ jsxs13(
|
|
4465
4429
|
"button",
|
|
4466
4430
|
{
|
|
4467
4431
|
type: "button",
|
|
4468
4432
|
"aria-pressed": (versionId ?? "current") === item.id || !versionId && item.current,
|
|
4469
4433
|
onClick: () => view(item.current ? null : item.id),
|
|
4470
4434
|
children: [
|
|
4471
|
-
/* @__PURE__ */
|
|
4435
|
+
/* @__PURE__ */ jsxs13("b", { children: [
|
|
4472
4436
|
date(item.createdAt),
|
|
4473
|
-
item.current && /* @__PURE__ */
|
|
4437
|
+
item.current && /* @__PURE__ */ jsx13("span", { className: "w100n-docs-badge", children: t.current })
|
|
4474
4438
|
] }),
|
|
4475
|
-
/* @__PURE__ */
|
|
4439
|
+
/* @__PURE__ */ jsx13("small", { children: [item.author?.name, size(item.size), item.note].filter(Boolean).join(" \xB7 ") })
|
|
4476
4440
|
]
|
|
4477
4441
|
},
|
|
4478
4442
|
item.id
|
|
4479
4443
|
))
|
|
4480
4444
|
] }),
|
|
4481
|
-
tab === "details" && /* @__PURE__ */
|
|
4482
|
-
/* @__PURE__ */
|
|
4483
|
-
/* @__PURE__ */
|
|
4484
|
-
/* @__PURE__ */
|
|
4485
|
-
/* @__PURE__ */
|
|
4486
|
-
/* @__PURE__ */
|
|
4487
|
-
/* @__PURE__ */
|
|
4488
|
-
doc.data.updatedBy && /* @__PURE__ */
|
|
4489
|
-
/* @__PURE__ */
|
|
4490
|
-
/* @__PURE__ */
|
|
4445
|
+
tab === "details" && /* @__PURE__ */ jsxs13("dl", { className: "w100n-docs-details", children: [
|
|
4446
|
+
/* @__PURE__ */ jsx13("dt", { children: t.kind }),
|
|
4447
|
+
/* @__PURE__ */ jsx13("dd", { children: t.kinds[doc.data.kind] }),
|
|
4448
|
+
/* @__PURE__ */ jsx13("dt", { children: t.size }),
|
|
4449
|
+
/* @__PURE__ */ jsx13("dd", { children: size(doc.data.size) }),
|
|
4450
|
+
/* @__PURE__ */ jsx13("dt", { children: t.updated }),
|
|
4451
|
+
/* @__PURE__ */ jsx13("dd", { children: date(doc.data.updatedAt) }),
|
|
4452
|
+
doc.data.updatedBy && /* @__PURE__ */ jsxs13(Fragment11, { children: [
|
|
4453
|
+
/* @__PURE__ */ jsx13("dt", { children: t.by }),
|
|
4454
|
+
/* @__PURE__ */ jsx13("dd", { children: doc.data.updatedBy.name })
|
|
4491
4455
|
] }),
|
|
4492
|
-
/* @__PURE__ */
|
|
4493
|
-
/* @__PURE__ */
|
|
4456
|
+
/* @__PURE__ */ jsx13("dt", { children: t.rights }),
|
|
4457
|
+
/* @__PURE__ */ jsx13("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
|
|
4494
4458
|
] }),
|
|
4495
|
-
tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */
|
|
4496
|
-
/* @__PURE__ */
|
|
4497
|
-
/* @__PURE__ */
|
|
4459
|
+
tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-about", children: [
|
|
4460
|
+
/* @__PURE__ */ jsxs13("p", { className: "w100n-docs-caption", children: [
|
|
4461
|
+
/* @__PURE__ */ jsx13(FileDown, { "aria-hidden": true }),
|
|
4498
4462
|
t.exportAs
|
|
4499
4463
|
] }),
|
|
4500
|
-
/* @__PURE__ */
|
|
4464
|
+
/* @__PURE__ */ jsx13("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ jsxs13(
|
|
4501
4465
|
"button",
|
|
4502
4466
|
{
|
|
4503
4467
|
type: "button",
|
|
@@ -4505,22 +4469,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4505
4469
|
disabled: exporting === "busy",
|
|
4506
4470
|
onClick: () => void exportAs(doc.data, format),
|
|
4507
4471
|
children: [
|
|
4508
|
-
/* @__PURE__ */
|
|
4472
|
+
/* @__PURE__ */ jsx13(FileDown, { "aria-hidden": true }),
|
|
4509
4473
|
format.toUpperCase()
|
|
4510
4474
|
]
|
|
4511
4475
|
},
|
|
4512
4476
|
format
|
|
4513
4477
|
)) }),
|
|
4514
|
-
exporting === "failed" && /* @__PURE__ */
|
|
4478
|
+
exporting === "failed" && /* @__PURE__ */ jsx13("p", { className: "w100n-docs-muted", children: t.exportFailed })
|
|
4515
4479
|
] }),
|
|
4516
|
-
tab === "comments" && /* @__PURE__ */
|
|
4517
|
-
tab === "sharing" && sharing && /* @__PURE__ */
|
|
4518
|
-
tab === "signatures" && /* @__PURE__ */
|
|
4480
|
+
tab === "comments" && /* @__PURE__ */ jsx13("div", { ref: setBox }),
|
|
4481
|
+
tab === "sharing" && sharing && /* @__PURE__ */ jsx13(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
|
|
4482
|
+
tab === "signatures" && /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-versions", children: [
|
|
4519
4483
|
signatures.error && failed(signatures.retry),
|
|
4520
|
-
signatures.data?.length === 0 && /* @__PURE__ */
|
|
4484
|
+
signatures.data?.length === 0 && /* @__PURE__ */ jsx13("p", { className: "w100n-docs-muted", children: t.noSignatures }),
|
|
4521
4485
|
(signatures.data ?? []).map((entry) => {
|
|
4522
4486
|
const signed = versions.data?.find((v) => v.id === entry.versionId);
|
|
4523
|
-
return /* @__PURE__ */
|
|
4487
|
+
return /* @__PURE__ */ jsxs13(
|
|
4524
4488
|
"button",
|
|
4525
4489
|
{
|
|
4526
4490
|
type: "button",
|
|
@@ -4528,15 +4492,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4528
4492
|
"aria-pressed": !!signed && (versionId ?? versions.data?.find((v) => v.current)?.id) === signed.id,
|
|
4529
4493
|
onClick: () => view(signed.current ? null : signed.id),
|
|
4530
4494
|
children: [
|
|
4531
|
-
/* @__PURE__ */
|
|
4495
|
+
/* @__PURE__ */ jsxs13("b", { children: [
|
|
4532
4496
|
entry.signer.name,
|
|
4533
|
-
/* @__PURE__ */
|
|
4497
|
+
/* @__PURE__ */ jsxs13("span", { className: "w100n-docs-badge", children: [
|
|
4534
4498
|
t.page,
|
|
4535
4499
|
" ",
|
|
4536
4500
|
entry.page
|
|
4537
4501
|
] })
|
|
4538
4502
|
] }),
|
|
4539
|
-
/* @__PURE__ */
|
|
4503
|
+
/* @__PURE__ */ jsx13("small", { children: [date(entry.signedAt), t.methods[entry.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
|
|
4540
4504
|
]
|
|
4541
4505
|
},
|
|
4542
4506
|
entry.id
|
|
@@ -4547,7 +4511,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4547
4511
|
] })
|
|
4548
4512
|
] })
|
|
4549
4513
|
] }),
|
|
4550
|
-
jump && /* @__PURE__ */
|
|
4514
|
+
jump && /* @__PURE__ */ jsx13(
|
|
4551
4515
|
Jump,
|
|
4552
4516
|
{
|
|
4553
4517
|
mode: jump,
|
|
@@ -4560,18 +4524,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4560
4524
|
place: (item) => [!spaceId && names2.get(item.spaceId), item.folder].filter(Boolean).join(" / ")
|
|
4561
4525
|
}
|
|
4562
4526
|
),
|
|
4563
|
-
making && /* @__PURE__ */
|
|
4527
|
+
making && /* @__PURE__ */ jsx13(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made) => {
|
|
4564
4528
|
setMaking(false);
|
|
4565
4529
|
opened(made);
|
|
4566
4530
|
} }),
|
|
4567
|
-
menu && /* @__PURE__ */
|
|
4568
|
-
/* @__PURE__ */
|
|
4569
|
-
|
|
4570
|
-
/* @__PURE__ */ jsx12("small", { children: [t.kinds[menu.item.kind], size(menu.item.size), names2.get(menu.item.spaceId), menu.item.folder].filter(Boolean).join(" \xB7 ") }),
|
|
4571
|
-
menu.item.createdAt && /* @__PURE__ */ jsx12("small", { children: [t.createdOn.replace("{when}", date(menu.item.createdAt)), menu.item.createdBy?.name].filter(Boolean).join(" \xB7 ") }),
|
|
4572
|
-
/* @__PURE__ */ jsx12("small", { children: [t.updatedOn.replace("{when}", ago(menu.item.updatedAt)), menu.item.updatedBy?.name].filter(Boolean).join(" \xB7 ") })
|
|
4573
|
-
] }),
|
|
4574
|
-
menu.moving ? /* @__PURE__ */ jsx12("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ jsxs12(
|
|
4531
|
+
menu && /* @__PURE__ */ jsxs13("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
|
|
4532
|
+
/* @__PURE__ */ jsx13("div", { className: "w100n-docs-context-head", children: card(menu.item) }),
|
|
4533
|
+
menu.moving ? /* @__PURE__ */ jsx13("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ jsxs13(
|
|
4575
4534
|
"button",
|
|
4576
4535
|
{
|
|
4577
4536
|
type: "button",
|
|
@@ -4580,100 +4539,99 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4580
4539
|
onClick: () => moveTo(menu.item, { spaceId: menu.item.spaceId, folder: folder2 }),
|
|
4581
4540
|
style: { paddingLeft: 10 + 14 * (folder2 ? folder2.split("/").length : 0) },
|
|
4582
4541
|
children: [
|
|
4583
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsx13(Folder2, { "aria-hidden": true }),
|
|
4584
4543
|
folder2 ? folder2.split("/").pop() : names2.get(menu.item.spaceId) ?? t.topLevel
|
|
4585
4544
|
]
|
|
4586
4545
|
},
|
|
4587
4546
|
folder2
|
|
4588
|
-
)) }) : menu.sure ? /* @__PURE__ */
|
|
4589
|
-
/* @__PURE__ */
|
|
4590
|
-
/* @__PURE__ */
|
|
4591
|
-
/* @__PURE__ */
|
|
4592
|
-
/* @__PURE__ */
|
|
4593
|
-
/* @__PURE__ */
|
|
4547
|
+
)) }) : menu.sure ? /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-context-ask", children: [
|
|
4548
|
+
/* @__PURE__ */ jsx13("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
|
|
4549
|
+
/* @__PURE__ */ jsxs13("span", { className: "w100n-pdf-dialog-end", children: [
|
|
4550
|
+
/* @__PURE__ */ jsx13("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
|
|
4551
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
|
|
4552
|
+
/* @__PURE__ */ jsx13(Trash24, { "aria-hidden": true }),
|
|
4594
4553
|
t.trash
|
|
4595
4554
|
] })
|
|
4596
4555
|
] })
|
|
4597
|
-
] }) : /* @__PURE__ */
|
|
4598
|
-
/* @__PURE__ */
|
|
4556
|
+
] }) : /* @__PURE__ */ jsxs13(Fragment11, { children: [
|
|
4557
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4599
4558
|
setMenu(null);
|
|
4600
4559
|
open(menu.item);
|
|
4601
4560
|
}, children: [
|
|
4602
|
-
/* @__PURE__ */
|
|
4561
|
+
/* @__PURE__ */ jsx13(FileText4, { "aria-hidden": true }),
|
|
4603
4562
|
t.openFile
|
|
4604
4563
|
] }),
|
|
4605
|
-
host.href && /* @__PURE__ */
|
|
4564
|
+
host.href && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4606
4565
|
setMenu(null);
|
|
4607
4566
|
window.open(host.href(menu.item.id), "_blank", "noopener");
|
|
4608
4567
|
}, children: [
|
|
4609
|
-
/* @__PURE__ */
|
|
4568
|
+
/* @__PURE__ */ jsx13(ExternalLink2, { "aria-hidden": true }),
|
|
4610
4569
|
t.openTab
|
|
4611
4570
|
] }),
|
|
4612
|
-
host.href && /* @__PURE__ */
|
|
4613
|
-
/* @__PURE__ */
|
|
4571
|
+
host.href && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
|
|
4572
|
+
/* @__PURE__ */ jsx13(Link2, { "aria-hidden": true }),
|
|
4614
4573
|
t.copyLink
|
|
4615
4574
|
] }),
|
|
4616
|
-
host.send && /* @__PURE__ */
|
|
4575
|
+
host.send && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4617
4576
|
setMenu(null);
|
|
4618
4577
|
host.send(menu.item.id);
|
|
4619
4578
|
}, children: [
|
|
4620
|
-
/* @__PURE__ */
|
|
4579
|
+
/* @__PURE__ */ jsx13(Send, { "aria-hidden": true }),
|
|
4621
4580
|
t.sendChat
|
|
4622
4581
|
] }),
|
|
4623
|
-
/* @__PURE__ */
|
|
4624
|
-
host.rename && /* @__PURE__ */
|
|
4582
|
+
/* @__PURE__ */ jsx13("hr", {}),
|
|
4583
|
+
host.rename && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4625
4584
|
const item = menu.item;
|
|
4626
4585
|
setMenu(null);
|
|
4627
|
-
|
|
4628
|
-
else setNaming({ id: item.id, text: item.name.replace(/\.[^.]+$/, "") });
|
|
4586
|
+
setEdit({ key: `file:${item.id}`, text: item.name.replace(/\.[^.]+$/, ""), run: (text2) => retitle(item, text2) });
|
|
4629
4587
|
}, children: [
|
|
4630
|
-
/* @__PURE__ */
|
|
4588
|
+
/* @__PURE__ */ jsx13(Pencil, { "aria-hidden": true }),
|
|
4631
4589
|
t.rename
|
|
4632
4590
|
] }),
|
|
4633
|
-
host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */
|
|
4634
|
-
/* @__PURE__ */
|
|
4591
|
+
host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", "aria-haspopup": "menu", onClick: () => setMenu({ ...menu, moving: true }), children: [
|
|
4592
|
+
/* @__PURE__ */ jsx13(FolderInput, { "aria-hidden": true }),
|
|
4635
4593
|
t.moveTo
|
|
4636
4594
|
] }),
|
|
4637
|
-
host.create && /* @__PURE__ */
|
|
4638
|
-
/* @__PURE__ */
|
|
4595
|
+
host.create && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy(await host.document(menu.item.id))), children: [
|
|
4596
|
+
/* @__PURE__ */ jsx13(Copy3, { "aria-hidden": true }),
|
|
4639
4597
|
t.makeCopy
|
|
4640
4598
|
] }),
|
|
4641
|
-
/* @__PURE__ */
|
|
4642
|
-
/* @__PURE__ */
|
|
4599
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
|
|
4600
|
+
/* @__PURE__ */ jsx13(Download3, { "aria-hidden": true }),
|
|
4643
4601
|
t.download
|
|
4644
4602
|
] }),
|
|
4645
|
-
host.saveTemplate && /* @__PURE__ */
|
|
4646
|
-
/* @__PURE__ */
|
|
4603
|
+
host.saveTemplate && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
|
|
4604
|
+
/* @__PURE__ */ jsx13(Bookmark, { "aria-hidden": true }),
|
|
4647
4605
|
t.saveTemplate
|
|
4648
4606
|
] }),
|
|
4649
|
-
/* @__PURE__ */
|
|
4607
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4650
4608
|
setMenu(null);
|
|
4651
4609
|
open(menu.item);
|
|
4652
4610
|
setTab("details");
|
|
4653
4611
|
side("panel", true);
|
|
4654
4612
|
}, children: [
|
|
4655
|
-
/* @__PURE__ */
|
|
4613
|
+
/* @__PURE__ */ jsx13(Info, { "aria-hidden": true }),
|
|
4656
4614
|
t.details
|
|
4657
4615
|
] }),
|
|
4658
|
-
host.remove && /* @__PURE__ */
|
|
4659
|
-
/* @__PURE__ */
|
|
4660
|
-
/* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4616
|
+
host.remove && /* @__PURE__ */ jsxs13(Fragment11, { children: [
|
|
4617
|
+
/* @__PURE__ */ jsx13("hr", {}),
|
|
4618
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
|
|
4619
|
+
/* @__PURE__ */ jsx13(Trash24, { "aria-hidden": true }),
|
|
4662
4620
|
t.trash
|
|
4663
4621
|
] })
|
|
4664
4622
|
] })
|
|
4665
4623
|
] })
|
|
4666
4624
|
] }),
|
|
4667
|
-
spot2 && /* @__PURE__ */
|
|
4668
|
-
/* @__PURE__ */
|
|
4669
|
-
/* @__PURE__ */
|
|
4670
|
-
spot2.at.folder && /* @__PURE__ */
|
|
4625
|
+
spot2 && /* @__PURE__ */ jsxs13("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.folderActions, style: { left: spot2.x, top: spot2.y }, children: [
|
|
4626
|
+
/* @__PURE__ */ jsxs13("div", { className: "w100n-docs-context-head", children: [
|
|
4627
|
+
/* @__PURE__ */ jsx13("b", { children: folderNamed(spot2.at) }),
|
|
4628
|
+
spot2.at.folder && /* @__PURE__ */ jsx13("small", { children: [names2.get(spot2.at.spaceId), ...spot2.at.folder.split("/").slice(0, -1)].filter(Boolean).join(" / ") })
|
|
4671
4629
|
] }),
|
|
4672
|
-
spot2.sure ? /* @__PURE__ */
|
|
4673
|
-
/* @__PURE__ */
|
|
4674
|
-
/* @__PURE__ */
|
|
4675
|
-
/* @__PURE__ */
|
|
4676
|
-
/* @__PURE__ */
|
|
4630
|
+
spot2.sure ? /* @__PURE__ */ jsxs13("div", { className: "w100n-docs-context-ask", children: [
|
|
4631
|
+
/* @__PURE__ */ jsx13("p", { children: t.folderTrashAsk.replace("{name}", folderNamed(spot2.at)) }),
|
|
4632
|
+
/* @__PURE__ */ jsxs13("span", { className: "w100n-pdf-dialog-end", children: [
|
|
4633
|
+
/* @__PURE__ */ jsx13("button", { type: "button", className: "w100n-pdf-link", onClick: () => setSpot({ ...spot2, sure: false }), children: t.cancel }),
|
|
4634
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => {
|
|
4677
4635
|
const at = spot2.at;
|
|
4678
4636
|
const inside2 = doc.data && doc.data.spaceId === at.spaceId && `${doc.data.folder ?? ""}/`.startsWith(`${at.folder}/`);
|
|
4679
4637
|
void act(() => host.removeFolder(at), t.trashed).then(() => {
|
|
@@ -4681,42 +4639,42 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4681
4639
|
if (inside2) go({ spaceId: here.spaceId, documentId: null });
|
|
4682
4640
|
});
|
|
4683
4641
|
}, children: [
|
|
4684
|
-
/* @__PURE__ */
|
|
4642
|
+
/* @__PURE__ */ jsx13(Trash24, { "aria-hidden": true }),
|
|
4685
4643
|
t.trash
|
|
4686
4644
|
] })
|
|
4687
4645
|
] })
|
|
4688
|
-
] }) : /* @__PURE__ */
|
|
4689
|
-
host.create && /* @__PURE__ */
|
|
4646
|
+
] }) : /* @__PURE__ */ jsxs13(Fragment11, { children: [
|
|
4647
|
+
host.create && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4690
4648
|
const at = spot2.at;
|
|
4691
4649
|
setSpot(null);
|
|
4692
4650
|
void note(t.untitled, true, at);
|
|
4693
4651
|
}, children: [
|
|
4694
|
-
/* @__PURE__ */
|
|
4652
|
+
/* @__PURE__ */ jsx13(FilePlus, { "aria-hidden": true }),
|
|
4695
4653
|
t.newNoteHere
|
|
4696
4654
|
] }),
|
|
4697
|
-
host.makeFolder && /* @__PURE__ */
|
|
4655
|
+
host.makeFolder && /* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4698
4656
|
const at = spot2.at;
|
|
4699
4657
|
setSpot(null);
|
|
4700
4658
|
setEdit({ key: `new:${spot2.key}`, text: t.newFolder, run: (name) => act(() => host.makeFolder(at, name)).then(refresh) });
|
|
4701
4659
|
}, children: [
|
|
4702
|
-
/* @__PURE__ */
|
|
4660
|
+
/* @__PURE__ */ jsx13(FolderPlus, { "aria-hidden": true }),
|
|
4703
4661
|
t.newFolder
|
|
4704
4662
|
] }),
|
|
4705
|
-
spot2.at.folder && host.renameFolder && /* @__PURE__ */
|
|
4706
|
-
/* @__PURE__ */
|
|
4707
|
-
/* @__PURE__ */
|
|
4663
|
+
spot2.at.folder && host.renameFolder && /* @__PURE__ */ jsxs13(Fragment11, { children: [
|
|
4664
|
+
/* @__PURE__ */ jsx13("hr", {}),
|
|
4665
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4708
4666
|
const at = spot2.at;
|
|
4709
4667
|
setSpot(null);
|
|
4710
4668
|
setEdit({ key: `dir:${spot2.key}`, text: folderNamed(at), run: (name) => name === folderNamed(at) ? Promise.resolve() : act(() => host.renameFolder(at, name)).then(refresh) });
|
|
4711
4669
|
}, children: [
|
|
4712
|
-
/* @__PURE__ */
|
|
4670
|
+
/* @__PURE__ */ jsx13(Pencil, { "aria-hidden": true }),
|
|
4713
4671
|
t.renameFolder
|
|
4714
4672
|
] })
|
|
4715
4673
|
] }),
|
|
4716
|
-
spot2.at.folder && host.removeFolder && /* @__PURE__ */
|
|
4717
|
-
/* @__PURE__ */
|
|
4718
|
-
/* @__PURE__ */
|
|
4719
|
-
/* @__PURE__ */
|
|
4674
|
+
spot2.at.folder && host.removeFolder && /* @__PURE__ */ jsxs13(Fragment11, { children: [
|
|
4675
|
+
/* @__PURE__ */ jsx13("hr", {}),
|
|
4676
|
+
/* @__PURE__ */ jsxs13("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setSpot({ ...spot2, sure: true }), children: [
|
|
4677
|
+
/* @__PURE__ */ jsx13(Trash24, { "aria-hidden": true }),
|
|
4720
4678
|
t.trashFolder
|
|
4721
4679
|
] })
|
|
4722
4680
|
] })
|
|
@@ -4728,21 +4686,21 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
4728
4686
|
|
|
4729
4687
|
// src/FilePreview.tsx
|
|
4730
4688
|
import { useState as useState12 } from "react";
|
|
4731
|
-
import { jsx as
|
|
4689
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
4732
4690
|
function FilePreview({ url, name, mimeType, size = 0, bytes, pdfWorker }) {
|
|
4733
4691
|
const [source] = useState12(() => ({ pdfWorker, content: () => bytes ? bytes(url) : fetch(url, { credentials: "include" }).then((res) => res.ok ? res.arrayBuffer() : Promise.reject(new Error(String(res.status)))) }));
|
|
4734
4692
|
const kind = kindOf(name, mimeType);
|
|
4735
4693
|
if (!kind) return null;
|
|
4736
|
-
return /* @__PURE__ */
|
|
4694
|
+
return /* @__PURE__ */ jsx14("span", { className: "w100n-preview", children: /* @__PURE__ */ jsx14(Thumb, { host: source, item: { id: url.split("?")[0], spaceId: "", name, kind, size, updatedAt: "" } }) });
|
|
4737
4695
|
}
|
|
4738
4696
|
|
|
4739
4697
|
// src/GuestDocument.tsx
|
|
4740
4698
|
import { lazy as lazy3, Suspense as Suspense3, useRef as useRef7, useState as useState13 } from "react";
|
|
4741
|
-
import { Ban as Ban2, Download as Download4, Eye as Eye2, FileDown as FileDown2, FileSpreadsheet as FileSpreadsheet5, FileText as FileText5, FileType as
|
|
4742
|
-
import { Fragment as Fragment12, jsx as
|
|
4743
|
-
var TextEditor3 = lazy3(() => import("./TextEditor-
|
|
4744
|
-
var SheetView3 = lazy3(() => import("./SheetView-
|
|
4745
|
-
var
|
|
4699
|
+
import { Ban as Ban2, Download as Download4, Eye as Eye2, FileDown as FileDown2, FileSpreadsheet as FileSpreadsheet5, FileText as FileText5, FileType as FileType6, Files as Files3, Lock as Lock2, Presentation as Presentation4, UserRound } from "lucide-react";
|
|
4700
|
+
import { Fragment as Fragment12, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4701
|
+
var TextEditor3 = lazy3(() => import("./TextEditor-U3WODH75.js"));
|
|
4702
|
+
var SheetView3 = lazy3(() => import("./SheetView-P3GH4U73.js"));
|
|
4703
|
+
var icons4 = { docx: FileText5, markdown: FileType6, pdf: Files3, sheet: FileSpreadsheet5, slides: Presentation4 };
|
|
4746
4704
|
var GuestRefused = class extends Error {
|
|
4747
4705
|
constructor(reason, file = "", sharedBy = "") {
|
|
4748
4706
|
super(reason);
|
|
@@ -4800,18 +4758,18 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
4800
4758
|
};
|
|
4801
4759
|
const top = (file2, badge) => {
|
|
4802
4760
|
const kind2 = file2 ? kindOf(file2.name, file2.mimeType) : null;
|
|
4803
|
-
const Kind = kind2 ?
|
|
4804
|
-
return /* @__PURE__ */
|
|
4805
|
-
brand && /* @__PURE__ */
|
|
4806
|
-
file2 && /* @__PURE__ */
|
|
4807
|
-
/* @__PURE__ */
|
|
4808
|
-
/* @__PURE__ */
|
|
4809
|
-
/* @__PURE__ */
|
|
4810
|
-
file2.sharedBy && /* @__PURE__ */
|
|
4761
|
+
const Kind = kind2 ? icons4[kind2] : FileText5;
|
|
4762
|
+
return /* @__PURE__ */ jsxs14("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
|
|
4763
|
+
brand && /* @__PURE__ */ jsx15("span", { className: "w100n-guest-brand", children: brand }),
|
|
4764
|
+
file2 && /* @__PURE__ */ jsxs14(Fragment12, { children: [
|
|
4765
|
+
/* @__PURE__ */ jsx15("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ jsx15(Kind, { "aria-hidden": true }) }),
|
|
4766
|
+
/* @__PURE__ */ jsxs14("div", { className: "w100n-docs-heading", children: [
|
|
4767
|
+
/* @__PURE__ */ jsx15("strong", { className: "w100n-docs-title", children: file2.name }),
|
|
4768
|
+
file2.sharedBy && /* @__PURE__ */ jsx15("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
|
|
4811
4769
|
] }),
|
|
4812
|
-
badge && /* @__PURE__ */
|
|
4813
|
-
file2.download && /* @__PURE__ */
|
|
4814
|
-
(kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */
|
|
4770
|
+
badge && /* @__PURE__ */ jsx15("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
|
|
4771
|
+
file2.download && /* @__PURE__ */ jsxs14("div", { className: "w100n-docs-end", children: [
|
|
4772
|
+
(kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ jsxs14(
|
|
4815
4773
|
"button",
|
|
4816
4774
|
{
|
|
4817
4775
|
type: "button",
|
|
@@ -4822,25 +4780,25 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
4822
4780
|
"aria-label": t.pdfCopy,
|
|
4823
4781
|
title: t.pdfCopy,
|
|
4824
4782
|
children: [
|
|
4825
|
-
/* @__PURE__ */
|
|
4826
|
-
/* @__PURE__ */
|
|
4783
|
+
/* @__PURE__ */ jsx15(FileDown2, { "aria-hidden": true }),
|
|
4784
|
+
/* @__PURE__ */ jsx15("span", { children: t.pdfCopy })
|
|
4827
4785
|
]
|
|
4828
4786
|
}
|
|
4829
4787
|
),
|
|
4830
|
-
/* @__PURE__ */
|
|
4831
|
-
/* @__PURE__ */
|
|
4832
|
-
/* @__PURE__ */
|
|
4788
|
+
/* @__PURE__ */ jsxs14("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: [
|
|
4789
|
+
/* @__PURE__ */ jsx15(Download4, { "aria-hidden": true }),
|
|
4790
|
+
/* @__PURE__ */ jsx15("span", { children: t.download })
|
|
4833
4791
|
] })
|
|
4834
4792
|
] })
|
|
4835
4793
|
] })
|
|
4836
4794
|
] });
|
|
4837
4795
|
};
|
|
4838
|
-
const gate = (tone, Icon, title, body, form) => /* @__PURE__ */
|
|
4796
|
+
const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ jsxs14("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
4839
4797
|
top(null, null),
|
|
4840
|
-
/* @__PURE__ */
|
|
4841
|
-
/* @__PURE__ */
|
|
4842
|
-
/* @__PURE__ */
|
|
4843
|
-
/* @__PURE__ */
|
|
4798
|
+
/* @__PURE__ */ jsx15("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ jsxs14("div", { className: "w100n-guest-card", children: [
|
|
4799
|
+
/* @__PURE__ */ jsx15("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ jsx15(Icon, { "aria-hidden": true }) }),
|
|
4800
|
+
/* @__PURE__ */ jsx15("h2", { children: title }),
|
|
4801
|
+
/* @__PURE__ */ jsx15("p", { children: body }),
|
|
4844
4802
|
form
|
|
4845
4803
|
] }) })
|
|
4846
4804
|
] });
|
|
@@ -4856,7 +4814,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
4856
4814
|
password ? Lock2 : UserRound,
|
|
4857
4815
|
refused.file || t.documents,
|
|
4858
4816
|
shared + (password ? t.passwordAsk : t.nameAsk),
|
|
4859
|
-
/* @__PURE__ */
|
|
4817
|
+
/* @__PURE__ */ jsxs14("form", { className: "w100n-guest-form", onSubmit: (e) => {
|
|
4860
4818
|
e.preventDefault();
|
|
4861
4819
|
if (!typed.trim()) return;
|
|
4862
4820
|
if (password) setAsk({ ...ask, password: typed });
|
|
@@ -4866,7 +4824,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
4866
4824
|
}
|
|
4867
4825
|
setTyped("");
|
|
4868
4826
|
}, children: [
|
|
4869
|
-
/* @__PURE__ */
|
|
4827
|
+
/* @__PURE__ */ jsx15(
|
|
4870
4828
|
"input",
|
|
4871
4829
|
{
|
|
4872
4830
|
className: "w100n-share-input",
|
|
@@ -4879,21 +4837,21 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
4879
4837
|
onChange: (e) => setTyped(e.target.value)
|
|
4880
4838
|
}
|
|
4881
4839
|
),
|
|
4882
|
-
refused.reason === "wrong" && /* @__PURE__ */
|
|
4883
|
-
/* @__PURE__ */
|
|
4884
|
-
/* @__PURE__ */
|
|
4840
|
+
refused.reason === "wrong" && /* @__PURE__ */ jsx15("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
|
|
4841
|
+
/* @__PURE__ */ jsxs14("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
|
|
4842
|
+
/* @__PURE__ */ jsx15(Eye2, { "aria-hidden": true }),
|
|
4885
4843
|
t.openDoc
|
|
4886
4844
|
] })
|
|
4887
4845
|
] })
|
|
4888
4846
|
);
|
|
4889
4847
|
}
|
|
4890
4848
|
if (refused?.reason === "busy") return gate("slate", Ban2, t.failed, t.tooMany);
|
|
4891
|
-
return gate("slate", Ban2, t.failed, "", /* @__PURE__ */
|
|
4849
|
+
return gate("slate", Ban2, t.failed, "", /* @__PURE__ */ jsx15("button", { type: "button", className: "w100n-docs-action", onClick: opened.retry, children: t.retry }));
|
|
4892
4850
|
}
|
|
4893
4851
|
const file = opened.data;
|
|
4894
|
-
if (!file) return /* @__PURE__ */
|
|
4852
|
+
if (!file) return /* @__PURE__ */ jsxs14("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
4895
4853
|
top(null, null),
|
|
4896
|
-
/* @__PURE__ */
|
|
4854
|
+
/* @__PURE__ */ jsx15("div", { className: "w100n-docs-empty", children: t.loading })
|
|
4897
4855
|
] });
|
|
4898
4856
|
const kind = kindOf(file.name, file.mimeType);
|
|
4899
4857
|
const text = kind === "docx" || kind === "markdown";
|
|
@@ -4901,23 +4859,23 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
4901
4859
|
const rights = { view: true, comment: talk, edit: false };
|
|
4902
4860
|
const quiet2 = () => {
|
|
4903
4861
|
};
|
|
4904
|
-
let stage = /* @__PURE__ */
|
|
4905
|
-
if (text) stage = /* @__PURE__ */
|
|
4906
|
-
else if (kind === "pdf") stage = /* @__PURE__ */
|
|
4907
|
-
else if (kind === "slides") stage = /* @__PURE__ */
|
|
4908
|
-
else if (kind === "sheet") stage = /* @__PURE__ */
|
|
4909
|
-
return /* @__PURE__ */
|
|
4862
|
+
let stage = /* @__PURE__ */ jsx15("div", { className: "w100n-docs-empty", children: t.unsupported });
|
|
4863
|
+
if (text) stage = /* @__PURE__ */ jsx15(Suspense3, { fallback: /* @__PURE__ */ jsx15("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx15(TextEditor3, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes : void 0, documentId: file.id, onOutline: quiet2, slot: talk ? slot : null }) });
|
|
4864
|
+
else if (kind === "pdf") stage = /* @__PURE__ */ jsx15(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet2 });
|
|
4865
|
+
else if (kind === "slides") stage = /* @__PURE__ */ jsx15(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet2 });
|
|
4866
|
+
else if (kind === "sheet") stage = /* @__PURE__ */ jsx15(Suspense3, { fallback: /* @__PURE__ */ jsx15("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ jsx15(SheetView3, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
|
|
4867
|
+
return /* @__PURE__ */ jsxs14("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
4910
4868
|
top(file, talk ? t.badgeComment : t.badgeRead),
|
|
4911
|
-
saving === "failed" && /* @__PURE__ */
|
|
4912
|
-
/* @__PURE__ */
|
|
4913
|
-
/* @__PURE__ */
|
|
4914
|
-
talk && /* @__PURE__ */
|
|
4915
|
-
/* @__PURE__ */
|
|
4916
|
-
/* @__PURE__ */
|
|
4917
|
-
/* @__PURE__ */
|
|
4869
|
+
saving === "failed" && /* @__PURE__ */ jsx15("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
|
|
4870
|
+
/* @__PURE__ */ jsxs14("div", { className: "w100n-docs-body w100n-guest-body", children: [
|
|
4871
|
+
/* @__PURE__ */ jsx15("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ jsx15("div", { className: "w100n-docs-bare", children: stage }) }),
|
|
4872
|
+
talk && /* @__PURE__ */ jsx15("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ jsxs14("div", { className: "w100n-docs-panel-body", children: [
|
|
4873
|
+
/* @__PURE__ */ jsxs14("label", { className: "w100n-share-field", children: [
|
|
4874
|
+
/* @__PURE__ */ jsx15("span", { children: t.yourName }),
|
|
4875
|
+
/* @__PURE__ */ jsx15("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
|
|
4918
4876
|
] }),
|
|
4919
|
-
/* @__PURE__ */
|
|
4920
|
-
/* @__PURE__ */
|
|
4877
|
+
/* @__PURE__ */ jsx15("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
|
|
4878
|
+
/* @__PURE__ */ jsx15("div", { ref: setSlot })
|
|
4921
4879
|
] }) })
|
|
4922
4880
|
] })
|
|
4923
4881
|
] });
|
|
@@ -4928,6 +4886,7 @@ export {
|
|
|
4928
4886
|
FilePreview,
|
|
4929
4887
|
GuestDocument,
|
|
4930
4888
|
GuestRefused,
|
|
4889
|
+
PreviewCard,
|
|
4931
4890
|
SlidesView,
|
|
4932
4891
|
kindOf,
|
|
4933
4892
|
kinds,
|