@w100n/documents 0.16.2 → 0.16.3
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-S5AFXKPA.js → SheetView-KXFUAILH.js} +7 -5
- package/dist/SheetView-KXFUAILH.js.map +1 -0
- package/dist/{TextEditor-7WQJFUUU.js → TextEditor-RNHXPYJX.js} +4 -4
- package/dist/{chunk-KGAQT5M3.js → chunk-E2FVJNDT.js} +3 -3
- package/dist/{chunk-KGAQT5M3.js.map → chunk-E2FVJNDT.js.map} +1 -1
- package/dist/{chunk-LZYITB56.js → chunk-VNXZVOPN.js} +37 -1
- package/dist/chunk-VNXZVOPN.js.map +1 -0
- package/dist/{chunk-JC4DLTMI.js → chunk-XFLYD3JS.js} +2 -2
- package/dist/collab.cjs +37 -1
- package/dist/collab.cjs.map +1 -1
- package/dist/collab.d.cts +1 -1
- package/dist/collab.d.ts +1 -1
- package/dist/collab.js +2 -2
- package/dist/{grid-AZLMNS7K.js → grid-IR5YFFSF.js} +20 -2
- package/dist/grid-IR5YFFSF.js.map +1 -0
- package/dist/index.cjs +279 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +64 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +232 -18
- package/dist/index.js.map +1 -1
- package/dist/kinds.d.cts +1 -1
- package/dist/kinds.d.ts +1 -1
- package/dist/memory.cjs +6 -0
- package/dist/memory.cjs.map +1 -1
- package/dist/memory.d.cts +1 -1
- package/dist/memory.d.ts +1 -1
- package/dist/memory.js +6 -0
- package/dist/memory.js.map +1 -1
- package/dist/{types-DNcaU6SK.d.cts → types-BUO0OzOl.d.cts} +5 -0
- package/dist/{types-DNcaU6SK.d.ts → types-BUO0OzOl.d.ts} +5 -0
- package/package.json +1 -1
- package/dist/SheetView-S5AFXKPA.js.map +0 -1
- package/dist/chunk-LZYITB56.js.map +0 -1
- package/dist/grid-AZLMNS7K.js.map +0 -1
- /package/dist/{TextEditor-7WQJFUUU.js.map → TextEditor-RNHXPYJX.js.map} +0 -0
- /package/dist/{chunk-JC4DLTMI.js.map → chunk-XFLYD3JS.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { L as Language, D as DocumentsHost, P as Place, a as DocumentFile, G as GuestHost, R as Rights } from './types-
|
|
4
|
-
export { C as Comment, b as DocumentKind, c as DocumentSummary, d as DocumentVersion, F as Fetch, e as GuestFile, f as GuestLink, g as LinkEntry, h as Person, S as Signature, i as SignatureMethod, j as Space } from './types-
|
|
3
|
+
import { L as Language, D as DocumentsHost, P as Place, a as DocumentFile, G as GuestHost, R as Rights } from './types-BUO0OzOl.cjs';
|
|
4
|
+
export { C as Comment, b as DocumentKind, c as DocumentSummary, d as DocumentVersion, F as Fetch, e as GuestFile, f as GuestLink, g as LinkEntry, h as Person, S as Signature, i as SignatureMethod, j as Space } from './types-BUO0OzOl.cjs';
|
|
5
5
|
import { JSONContent } from '@tiptap/core';
|
|
6
6
|
import { I as Img, S as Setup } from './write-BCI8yool.cjs';
|
|
7
7
|
export { kindOf, kinds, matches, readable } from './kinds.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, RefObject } from 'react';
|
|
3
|
-
import { L as Language, D as DocumentsHost, P as Place, a as DocumentFile, G as GuestHost, R as Rights } from './types-
|
|
4
|
-
export { C as Comment, b as DocumentKind, c as DocumentSummary, d as DocumentVersion, F as Fetch, e as GuestFile, f as GuestLink, g as LinkEntry, h as Person, S as Signature, i as SignatureMethod, j as Space } from './types-
|
|
3
|
+
import { L as Language, D as DocumentsHost, P as Place, a as DocumentFile, G as GuestHost, R as Rights } from './types-BUO0OzOl.js';
|
|
4
|
+
export { C as Comment, b as DocumentKind, c as DocumentSummary, d as DocumentVersion, F as Fetch, e as GuestFile, f as GuestLink, g as LinkEntry, h as Person, S as Signature, i as SignatureMethod, j as Space } from './types-BUO0OzOl.js';
|
|
5
5
|
import { JSONContent } from '@tiptap/core';
|
|
6
6
|
import { I as Img, S as Setup } from './write-BCI8yool.js';
|
|
7
7
|
export { kindOf, kinds, matches, readable } from './kinds.js';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-TDP6OJET.js";
|
|
15
15
|
import {
|
|
16
16
|
texts
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VNXZVOPN.js";
|
|
18
18
|
import {
|
|
19
19
|
escape,
|
|
20
20
|
readDocx,
|
|
@@ -2409,8 +2409,8 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
|
|
|
2409
2409
|
|
|
2410
2410
|
// src/DocumentOverlay.tsx
|
|
2411
2411
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2412
|
-
var TextEditor = lazy(() => import("./TextEditor-
|
|
2413
|
-
var SheetView = lazy(() => import("./SheetView-
|
|
2412
|
+
var TextEditor = lazy(() => import("./TextEditor-RNHXPYJX.js"));
|
|
2413
|
+
var SheetView = lazy(() => import("./SheetView-KXFUAILH.js"));
|
|
2414
2414
|
var icons = { docx: FileText, markdown: FileType, pdf: Files, sheet: FileSpreadsheet, slides: Presentation };
|
|
2415
2415
|
var read = { view: true, comment: false, edit: false };
|
|
2416
2416
|
var quiet = () => {
|
|
@@ -2521,8 +2521,15 @@ import {
|
|
|
2521
2521
|
Check as Check2,
|
|
2522
2522
|
ChevronDown as ChevronDown2,
|
|
2523
2523
|
ChevronRight as ChevronRight2,
|
|
2524
|
+
Copy as Copy3,
|
|
2525
|
+
Download as Download3,
|
|
2526
|
+
ExternalLink as ExternalLink2,
|
|
2524
2527
|
FileDiff,
|
|
2525
2528
|
FileDown,
|
|
2529
|
+
Link as Link2,
|
|
2530
|
+
Pencil,
|
|
2531
|
+
Send,
|
|
2532
|
+
Trash2 as Trash24,
|
|
2526
2533
|
FilePlus,
|
|
2527
2534
|
FileSpreadsheet as FileSpreadsheet3,
|
|
2528
2535
|
FileText as FileText3,
|
|
@@ -3123,8 +3130,8 @@ function Thumb({ host, item, label }) {
|
|
|
3123
3130
|
|
|
3124
3131
|
// src/DocumentsWorkspace.tsx
|
|
3125
3132
|
import { Fragment as Fragment8, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
3126
|
-
var TextEditor2 = lazy2(() => import("./TextEditor-
|
|
3127
|
-
var SheetView2 = lazy2(() => import("./SheetView-
|
|
3133
|
+
var TextEditor2 = lazy2(() => import("./TextEditor-RNHXPYJX.js"));
|
|
3134
|
+
var SheetView2 = lazy2(() => import("./SheetView-KXFUAILH.js"));
|
|
3128
3135
|
var Compare = lazy2(() => import("./Compare-M57FG4R3.js"));
|
|
3129
3136
|
var icons3 = { docx: FileText3, markdown: FileType3, pdf: Files2, sheet: FileSpreadsheet3, slides: Presentation3 };
|
|
3130
3137
|
function DocumentsWorkspace({ host, language = "en", theme = "light", place, onPlace, start, end, aside, actions }) {
|
|
@@ -3195,6 +3202,27 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3195
3202
|
document.addEventListener("pointerdown", close);
|
|
3196
3203
|
return () => document.removeEventListener("pointerdown", close);
|
|
3197
3204
|
}, [picking]);
|
|
3205
|
+
const [menu, setMenu] = useState9(null);
|
|
3206
|
+
const [naming, setNaming] = useState9(null);
|
|
3207
|
+
const [notice, setNotice] = useState9(null);
|
|
3208
|
+
const early = useRef6(/* @__PURE__ */ new Map());
|
|
3209
|
+
const hover = useRef6(0);
|
|
3210
|
+
useEffect6(() => {
|
|
3211
|
+
if (!menu) return;
|
|
3212
|
+
const close = (e) => {
|
|
3213
|
+
if (e.type === "pointerdown" && e.target.closest(".w100n-docs-context")) return;
|
|
3214
|
+
if (e.type === "keydown" && e.key !== "Escape") return;
|
|
3215
|
+
setMenu(null);
|
|
3216
|
+
};
|
|
3217
|
+
document.addEventListener("pointerdown", close);
|
|
3218
|
+
window.addEventListener("keydown", close);
|
|
3219
|
+
window.addEventListener("scroll", close, true);
|
|
3220
|
+
return () => {
|
|
3221
|
+
document.removeEventListener("pointerdown", close);
|
|
3222
|
+
window.removeEventListener("keydown", close);
|
|
3223
|
+
window.removeEventListener("scroll", close, true);
|
|
3224
|
+
};
|
|
3225
|
+
}, [menu]);
|
|
3198
3226
|
const [tab, setTab] = useState9("outline");
|
|
3199
3227
|
const [outline, setOutline] = useState9([]);
|
|
3200
3228
|
const [reading, setReading] = useState9(null);
|
|
@@ -3236,9 +3264,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3236
3264
|
document.removeEventListener("visibilitychange", sync);
|
|
3237
3265
|
};
|
|
3238
3266
|
}, []);
|
|
3239
|
-
const
|
|
3267
|
+
const take = (id, key) => {
|
|
3268
|
+
const kept2 = early.current.get(id);
|
|
3269
|
+
const found = kept2 && Date.now() - kept2.at < 15e3 ? kept2[key] : void 0;
|
|
3270
|
+
if (kept2) delete kept2[key];
|
|
3271
|
+
return found;
|
|
3272
|
+
};
|
|
3273
|
+
const doc = useLoad((signal) => here.documentId ? take(here.documentId, "doc") ?? host.document(here.documentId, { signal }) : Promise.resolve(null), [host, here.documentId]);
|
|
3240
3274
|
const versions = useLoad((signal) => here.documentId ? host.versions(here.documentId, { signal }) : Promise.resolve([]), [host, here.documentId]);
|
|
3241
|
-
const content = useLoad((signal) => here.documentId ? host.content(here.documentId, versionId, { signal }) : Promise.resolve(null), [host, here.documentId, versionId]);
|
|
3275
|
+
const content = useLoad((signal) => here.documentId ? !versionId && take(here.documentId, "bytes") || host.content(here.documentId, versionId, { signal }) : Promise.resolve(null), [host, here.documentId, versionId]);
|
|
3242
3276
|
const pdf = doc.data?.kind === "pdf";
|
|
3243
3277
|
const text = doc.data?.kind === "markdown" || doc.data?.kind === "docx";
|
|
3244
3278
|
const docbar = text && !versionId && !narrow;
|
|
@@ -3370,6 +3404,52 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3370
3404
|
setKept({ id: file.id, state: "failed" });
|
|
3371
3405
|
}
|
|
3372
3406
|
};
|
|
3407
|
+
const warm = (item) => {
|
|
3408
|
+
clearTimeout(hover.current);
|
|
3409
|
+
hover.current = window.setTimeout(() => {
|
|
3410
|
+
if (item.id === here.documentId) return;
|
|
3411
|
+
if (item.kind === "docx" || item.kind === "markdown") void import("./TextEditor-RNHXPYJX.js");
|
|
3412
|
+
if (item.kind === "sheet") void import("./SheetView-KXFUAILH.js");
|
|
3413
|
+
const kept2 = early.current.get(item.id);
|
|
3414
|
+
if (kept2 && Date.now() - kept2.at < 15e3 || item.size > 5e6) return;
|
|
3415
|
+
const next = { at: Date.now(), doc: host.document(item.id), bytes: host.content(item.id, null) };
|
|
3416
|
+
next.doc.catch(() => {
|
|
3417
|
+
});
|
|
3418
|
+
next.bytes.catch(() => {
|
|
3419
|
+
});
|
|
3420
|
+
early.current.set(item.id, next);
|
|
3421
|
+
}, 150);
|
|
3422
|
+
};
|
|
3423
|
+
const act = async (run2, done) => {
|
|
3424
|
+
setMenu(null);
|
|
3425
|
+
setNotice(null);
|
|
3426
|
+
try {
|
|
3427
|
+
await run2();
|
|
3428
|
+
if (done) setNotice(done);
|
|
3429
|
+
} catch {
|
|
3430
|
+
setNotice(t.actionFailed);
|
|
3431
|
+
}
|
|
3432
|
+
};
|
|
3433
|
+
const fetchFile = async (item) => {
|
|
3434
|
+
const url = URL.createObjectURL(new Blob([await host.content(item.id)]));
|
|
3435
|
+
const link = Object.assign(document.createElement("a"), { href: url, download: item.name });
|
|
3436
|
+
link.click();
|
|
3437
|
+
setTimeout(() => URL.revokeObjectURL(url), 1e3);
|
|
3438
|
+
};
|
|
3439
|
+
const retitle = async (item, draft) => {
|
|
3440
|
+
setNaming(null);
|
|
3441
|
+
const ext = /\.[^.]+$/.exec(item.name)?.[0] ?? "";
|
|
3442
|
+
const name = draft.trim() && (/\.[^.\s]+$/.test(draft.trim()) ? draft.trim() : draft.trim() + ext);
|
|
3443
|
+
if (!name || name === item.name) return;
|
|
3444
|
+
await act(() => host.rename(item.id, name));
|
|
3445
|
+
list.retry();
|
|
3446
|
+
if (item.id === here.documentId) doc.retry();
|
|
3447
|
+
};
|
|
3448
|
+
const drop2 = async (item) => {
|
|
3449
|
+
await act(() => host.remove(item.id), t.trashed);
|
|
3450
|
+
list.retry();
|
|
3451
|
+
if (item.id === here.documentId) go({ spaceId: here.spaceId, documentId: null });
|
|
3452
|
+
};
|
|
3373
3453
|
const rename = async (file, draft) => {
|
|
3374
3454
|
setRenaming(null);
|
|
3375
3455
|
const ext = /\.[^.]+$/.exec(file.name)?.[0] ?? "";
|
|
@@ -3616,6 +3696,21 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3616
3696
|
kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
|
|
3617
3697
|
renamed === "failed" && /* @__PURE__ */ jsx9("span", { className: "w100n-docs-muted", children: t.renameFailed }),
|
|
3618
3698
|
docbar && /* @__PURE__ */ jsx9("span", { ref: setStatusAt, className: "w100n-docs-status" }),
|
|
3699
|
+
host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ jsxs9(
|
|
3700
|
+
"button",
|
|
3701
|
+
{
|
|
3702
|
+
type: "button",
|
|
3703
|
+
className: "w100n-docs-action",
|
|
3704
|
+
"data-tone": "blue",
|
|
3705
|
+
"aria-label": t.sendChat,
|
|
3706
|
+
title: t.sendChat,
|
|
3707
|
+
onClick: () => host.send(doc.data.id),
|
|
3708
|
+
children: [
|
|
3709
|
+
/* @__PURE__ */ jsx9(Send, { "aria-hidden": true }),
|
|
3710
|
+
/* @__PURE__ */ jsx9("span", { children: t.sendChat })
|
|
3711
|
+
]
|
|
3712
|
+
}
|
|
3713
|
+
),
|
|
3619
3714
|
sharing && /* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "aria-label": t.share, title: t.share, onClick: () => {
|
|
3620
3715
|
setTab("sharing");
|
|
3621
3716
|
side("panel", true);
|
|
@@ -3744,17 +3839,56 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3744
3839
|
sending === "failed" && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
|
|
3745
3840
|
list.error && failed(list.retry),
|
|
3746
3841
|
list.loading && !list.data && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: t.loading }),
|
|
3842
|
+
notice && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", role: "status", children: notice }),
|
|
3747
3843
|
list.data && !shown.length && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
|
|
3748
3844
|
folders.map((folder2) => /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-folder", role: "group", "aria-label": folder2 || t.loose, children: [
|
|
3749
3845
|
folders.length > 1 && /* @__PURE__ */ jsx9("p", { className: "w100n-docs-group", children: folder2 || t.loose }),
|
|
3750
|
-
/* @__PURE__ */ jsx9("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => /* @__PURE__ */ jsxs9("
|
|
3846
|
+
/* @__PURE__ */ jsx9("div", { className: "w100n-docs-grid", children: shown.filter((item) => !spaceId || (item.folder ?? "") === folder2).map((item) => naming?.id === item.id ? /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-card", children: [
|
|
3751
3847
|
/* @__PURE__ */ jsx9(Thumb, { host, item, label: t.kinds[item.kind] }),
|
|
3752
|
-
/* @__PURE__ */
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3848
|
+
/* @__PURE__ */ jsx9("span", { className: "w100n-docs-card-text", children: /* @__PURE__ */ jsx9(
|
|
3849
|
+
"input",
|
|
3850
|
+
{
|
|
3851
|
+
className: "w100n-docs-field",
|
|
3852
|
+
autoFocus: true,
|
|
3853
|
+
value: naming.text,
|
|
3854
|
+
"aria-label": t.rename,
|
|
3855
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
3856
|
+
onChange: (e) => setNaming({ ...naming, text: e.target.value }),
|
|
3857
|
+
onBlur: () => void retitle(item, naming.text),
|
|
3858
|
+
onKeyDown: (e) => {
|
|
3859
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
3860
|
+
if (e.key === "Escape") {
|
|
3861
|
+
e.stopPropagation();
|
|
3862
|
+
setNaming(null);
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
}
|
|
3866
|
+
) })
|
|
3867
|
+
] }, item.id) : /* @__PURE__ */ jsxs9(
|
|
3868
|
+
"button",
|
|
3869
|
+
{
|
|
3870
|
+
type: "button",
|
|
3871
|
+
className: "w100n-docs-card",
|
|
3872
|
+
"aria-current": item.id === here.documentId,
|
|
3873
|
+
onClick: () => open(item),
|
|
3874
|
+
title: item.name,
|
|
3875
|
+
onPointerEnter: () => warm(item),
|
|
3876
|
+
onPointerLeave: () => clearTimeout(hover.current),
|
|
3877
|
+
onContextMenu: (e) => {
|
|
3878
|
+
e.preventDefault();
|
|
3879
|
+
setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
|
|
3880
|
+
},
|
|
3881
|
+
children: [
|
|
3882
|
+
/* @__PURE__ */ jsx9(Thumb, { host, item, label: t.kinds[item.kind] }),
|
|
3883
|
+
/* @__PURE__ */ jsxs9("span", { className: "w100n-docs-card-text", children: [
|
|
3884
|
+
/* @__PURE__ */ jsx9("b", { children: item.name }),
|
|
3885
|
+
/* @__PURE__ */ jsx9("small", { children: [!spaceId && names2.get(item.spaceId), ago(item.updatedAt)].filter(Boolean).join(" \xB7 ") }),
|
|
3886
|
+
inside.get(item.id) && /* @__PURE__ */ jsx9("small", { className: "w100n-docs-hit", children: inside.get(item.id).split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ jsx9("mark", { children: part }, i) : part) })
|
|
3887
|
+
] })
|
|
3888
|
+
]
|
|
3889
|
+
},
|
|
3890
|
+
item.id
|
|
3891
|
+
)) })
|
|
3758
3892
|
] }, folder2))
|
|
3759
3893
|
] })
|
|
3760
3894
|
] }),
|
|
@@ -3923,16 +4057,96 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place, onP
|
|
|
3923
4057
|
setMaking(false);
|
|
3924
4058
|
opened(made);
|
|
3925
4059
|
} }),
|
|
4060
|
+
menu && /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
|
|
4061
|
+
/* @__PURE__ */ jsxs9("div", { className: "w100n-docs-context-head", children: [
|
|
4062
|
+
/* @__PURE__ */ jsx9("b", { children: menu.item.name }),
|
|
4063
|
+
/* @__PURE__ */ jsx9("small", { children: [t.kinds[menu.item.kind], size(menu.item.size), names2.get(menu.item.spaceId), menu.item.folder].filter(Boolean).join(" \xB7 ") }),
|
|
4064
|
+
menu.item.createdAt && /* @__PURE__ */ jsx9("small", { children: [t.createdOn.replace("{when}", date(menu.item.createdAt)), menu.item.createdBy?.name].filter(Boolean).join(" \xB7 ") }),
|
|
4065
|
+
/* @__PURE__ */ jsx9("small", { children: [t.updatedOn.replace("{when}", ago(menu.item.updatedAt)), menu.item.updatedBy?.name].filter(Boolean).join(" \xB7 ") })
|
|
4066
|
+
] }),
|
|
4067
|
+
menu.sure ? /* @__PURE__ */ jsxs9("div", { className: "w100n-docs-context-ask", children: [
|
|
4068
|
+
/* @__PURE__ */ jsx9("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
|
|
4069
|
+
/* @__PURE__ */ jsxs9("span", { className: "w100n-pdf-dialog-end", children: [
|
|
4070
|
+
/* @__PURE__ */ jsx9("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
|
|
4071
|
+
/* @__PURE__ */ jsxs9("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
|
|
4072
|
+
/* @__PURE__ */ jsx9(Trash24, { "aria-hidden": true }),
|
|
4073
|
+
t.trash
|
|
4074
|
+
] })
|
|
4075
|
+
] })
|
|
4076
|
+
] }) : /* @__PURE__ */ jsxs9(Fragment8, { children: [
|
|
4077
|
+
/* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4078
|
+
setMenu(null);
|
|
4079
|
+
open(menu.item);
|
|
4080
|
+
}, children: [
|
|
4081
|
+
/* @__PURE__ */ jsx9(FileText3, { "aria-hidden": true }),
|
|
4082
|
+
t.openFile
|
|
4083
|
+
] }),
|
|
4084
|
+
host.href && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4085
|
+
setMenu(null);
|
|
4086
|
+
window.open(host.href(menu.item.id), "_blank", "noopener");
|
|
4087
|
+
}, children: [
|
|
4088
|
+
/* @__PURE__ */ jsx9(ExternalLink2, { "aria-hidden": true }),
|
|
4089
|
+
t.openTab
|
|
4090
|
+
] }),
|
|
4091
|
+
host.href && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
|
|
4092
|
+
/* @__PURE__ */ jsx9(Link2, { "aria-hidden": true }),
|
|
4093
|
+
t.copyLink
|
|
4094
|
+
] }),
|
|
4095
|
+
host.send && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4096
|
+
setMenu(null);
|
|
4097
|
+
host.send(menu.item.id);
|
|
4098
|
+
}, children: [
|
|
4099
|
+
/* @__PURE__ */ jsx9(Send, { "aria-hidden": true }),
|
|
4100
|
+
t.sendChat
|
|
4101
|
+
] }),
|
|
4102
|
+
/* @__PURE__ */ jsx9("hr", {}),
|
|
4103
|
+
host.rename && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4104
|
+
setMenu(null);
|
|
4105
|
+
setNaming({ id: menu.item.id, text: menu.item.name.replace(/\.[^.]+$/, "") });
|
|
4106
|
+
}, children: [
|
|
4107
|
+
/* @__PURE__ */ jsx9(Pencil, { "aria-hidden": true }),
|
|
4108
|
+
t.rename
|
|
4109
|
+
] }),
|
|
4110
|
+
host.create && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy(await host.document(menu.item.id))), children: [
|
|
4111
|
+
/* @__PURE__ */ jsx9(Copy3, { "aria-hidden": true }),
|
|
4112
|
+
t.makeCopy
|
|
4113
|
+
] }),
|
|
4114
|
+
/* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
|
|
4115
|
+
/* @__PURE__ */ jsx9(Download3, { "aria-hidden": true }),
|
|
4116
|
+
t.download
|
|
4117
|
+
] }),
|
|
4118
|
+
host.saveTemplate && /* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
|
|
4119
|
+
/* @__PURE__ */ jsx9(Bookmark, { "aria-hidden": true }),
|
|
4120
|
+
t.saveTemplate
|
|
4121
|
+
] }),
|
|
4122
|
+
/* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", onClick: () => {
|
|
4123
|
+
setMenu(null);
|
|
4124
|
+
open(menu.item);
|
|
4125
|
+
setTab("details");
|
|
4126
|
+
side("panel", true);
|
|
4127
|
+
}, children: [
|
|
4128
|
+
/* @__PURE__ */ jsx9(Info, { "aria-hidden": true }),
|
|
4129
|
+
t.details
|
|
4130
|
+
] }),
|
|
4131
|
+
host.remove && /* @__PURE__ */ jsxs9(Fragment8, { children: [
|
|
4132
|
+
/* @__PURE__ */ jsx9("hr", {}),
|
|
4133
|
+
/* @__PURE__ */ jsxs9("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
|
|
4134
|
+
/* @__PURE__ */ jsx9(Trash24, { "aria-hidden": true }),
|
|
4135
|
+
t.trash
|
|
4136
|
+
] })
|
|
4137
|
+
] })
|
|
4138
|
+
] })
|
|
4139
|
+
] }),
|
|
3926
4140
|
dialog
|
|
3927
4141
|
] });
|
|
3928
4142
|
}
|
|
3929
4143
|
|
|
3930
4144
|
// src/GuestDocument.tsx
|
|
3931
4145
|
import { lazy as lazy3, Suspense as Suspense3, useRef as useRef7, useState as useState10 } from "react";
|
|
3932
|
-
import { Ban as Ban2, Download as
|
|
4146
|
+
import { Ban as Ban2, Download as Download4, Eye as Eye2, FileDown as FileDown2, FileSpreadsheet as FileSpreadsheet4, FileText as FileText4, FileType as FileType4, Files as Files3, Lock as Lock2, Presentation as Presentation4, UserRound } from "lucide-react";
|
|
3933
4147
|
import { Fragment as Fragment9, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3934
|
-
var TextEditor3 = lazy3(() => import("./TextEditor-
|
|
3935
|
-
var SheetView3 = lazy3(() => import("./SheetView-
|
|
4148
|
+
var TextEditor3 = lazy3(() => import("./TextEditor-RNHXPYJX.js"));
|
|
4149
|
+
var SheetView3 = lazy3(() => import("./SheetView-KXFUAILH.js"));
|
|
3936
4150
|
var icons4 = { docx: FileText4, markdown: FileType4, pdf: Files3, sheet: FileSpreadsheet4, slides: Presentation4 };
|
|
3937
4151
|
var GuestRefused = class extends Error {
|
|
3938
4152
|
constructor(reason, file = "", sharedBy = "") {
|
|
@@ -4019,7 +4233,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
4019
4233
|
}
|
|
4020
4234
|
),
|
|
4021
4235
|
/* @__PURE__ */ jsxs10("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: [
|
|
4022
|
-
/* @__PURE__ */ jsx10(
|
|
4236
|
+
/* @__PURE__ */ jsx10(Download4, { "aria-hidden": true }),
|
|
4023
4237
|
/* @__PURE__ */ jsx10("span", { children: t.download })
|
|
4024
4238
|
] })
|
|
4025
4239
|
] })
|