@w100n/documents 0.19.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SheetView-43MPR64N.css → SheetView-GBGCZMYL.css} +22 -1
- package/dist/{SheetView-43MPR64N.css.map → SheetView-GBGCZMYL.css.map} +1 -1
- package/dist/{SheetView-PUSRW7W2.js → SheetView-P3GH4U73.js} +43 -23
- package/dist/SheetView-P3GH4U73.js.map +1 -0
- package/dist/{TextEditor-Z4KSBLBV.js → TextEditor-U3WODH75.js} +18 -6
- package/dist/TextEditor-U3WODH75.js.map +1 -0
- package/dist/{chunk-ZQYSBWLK.js → chunk-SJVSGMNK.js} +48 -3
- package/dist/chunk-SJVSGMNK.js.map +1 -0
- package/dist/{chunk-JSJEB2CO.js → chunk-VG7UW2CQ.js} +11 -2
- package/dist/{chunk-JSJEB2CO.js.map → chunk-VG7UW2CQ.js.map} +1 -1
- package/dist/collab.cjs +10 -1
- package/dist/collab.cjs.map +1 -1
- package/dist/collab.js +1 -1
- package/dist/{grid-IR5YFFSF.js → grid-7OGS3FPU.js} +27 -2
- package/dist/grid-7OGS3FPU.js.map +1 -0
- package/dist/index.cjs +1109 -1007
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +78 -12
- package/dist/index.css.map +1 -1
- package/dist/index.js +11 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/SheetView-PUSRW7W2.js.map +0 -1
- package/dist/TextEditor-Z4KSBLBV.js.map +0 -1
- package/dist/chunk-ZQYSBWLK.js.map +0 -1
- package/dist/grid-IR5YFFSF.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -3905,21 +3905,21 @@ var init_write = __esm({
|
|
|
3905
3905
|
head2 = `<w:tbl>${tblPr}<w:tblGrid>${`<w:gridCol w:w="${Math.floor(this.textWidth() / cols)}"/>`.repeat(cols)}</w:tblGrid>`;
|
|
3906
3906
|
}
|
|
3907
3907
|
const width = Math.floor(this.textWidth() / cols);
|
|
3908
|
-
const
|
|
3908
|
+
const sized2 = [];
|
|
3909
3909
|
for (const r of layout2) for (const sl of r) {
|
|
3910
3910
|
const own2 = sl.cell && value("colwidth", sl.cell.attrs?.colwidth);
|
|
3911
3911
|
if (own2 && own2.length === sl.span) own2.forEach((w, k) => {
|
|
3912
3912
|
var _a;
|
|
3913
|
-
return
|
|
3913
|
+
return sized2[_a = sl.col + k] ?? (sized2[_a] = w);
|
|
3914
3914
|
});
|
|
3915
3915
|
}
|
|
3916
|
-
const known =
|
|
3916
|
+
const known = sized2.length === cols && sized2.every(Boolean);
|
|
3917
3917
|
const had = [...head2.matchAll(/<w:gridCol\b[^>]*\bw:w="(\d+)"/g)].map((m) => Math.floor(+m[1] / 15));
|
|
3918
|
-
if (known && had.join() !==
|
|
3919
|
-
const list =
|
|
3918
|
+
if (known && had.join() !== sized2.join()) {
|
|
3919
|
+
const list = sized2.map((w) => `<w:gridCol w:w="${Math.round(w * 15)}"/>`).join("");
|
|
3920
3920
|
head2 = head2.replace(/(<w:tblGrid\b[^>]*>)[\s\S]*?(<\/w:tblGrid>)/, `$1${list}$2`);
|
|
3921
3921
|
}
|
|
3922
|
-
const own = (col, span2) => known ?
|
|
3922
|
+
const own = (col, span2) => known ? sized2.slice(col, col + span2) : null;
|
|
3923
3923
|
const borders = value("borders", o.node.attrs?.borders);
|
|
3924
3924
|
if (borders !== value("borders", b?.node.attrs?.borders)) {
|
|
3925
3925
|
const line = (side2) => `<w:${side2} w:val="${borders === "none" ? "none" : "single"}" w:sz="4" w:space="0" w:color="${borders === "none" ? "auto" : "94A3B8"}"/>`;
|
|
@@ -3986,15 +3986,15 @@ var init_write = __esm({
|
|
|
3986
3986
|
const el = src && kid(src.el, "w:tcPr");
|
|
3987
3987
|
const xml = el ? s.slice(el.start, el.end) : "";
|
|
3988
3988
|
const tcW = el && kid(el, "w:tcW");
|
|
3989
|
-
const
|
|
3990
|
-
const resized =
|
|
3989
|
+
const sized2 = own ? Math.round(own.reduce((a, w) => a + w, 0) * 15) : null;
|
|
3990
|
+
const resized = sized2 !== null && !(tcW && attr(s, tcW, "w:type") === "dxa" && Math.abs(+(attr(s, tcW, "w:w") ?? 0) - sized2) < 15);
|
|
3991
3991
|
const was = src?.node ? value("background", src.node.attrs?.background) : null;
|
|
3992
3992
|
const painted = fill3 !== void 0 && fill3 !== was;
|
|
3993
3993
|
if (!clone && src && src.span === span2 && src.vm === vm && !resized && !painted) return xml;
|
|
3994
3994
|
const set = { "w:gridSpan": span2 > 1 ? `<w:gridSpan w:val="${span2}"/>` : null, "w:vMerge": vm === "restart" ? '<w:vMerge w:val="restart"/>' : vm ? "<w:vMerge/>" : null, "w:hMerge": null };
|
|
3995
3995
|
if (clone) Object.assign(set, { "w:cellIns": null, "w:cellDel": null, "w:cellMerge": null, "w:tcPrChange": null });
|
|
3996
3996
|
if (painted) set["w:shd"] = fill3 ? `<w:shd w:val="clear" w:color="auto" w:fill="${fill3.slice(1).toUpperCase()}"/>` : null;
|
|
3997
|
-
if (resized) set["w:tcW"] = `<w:tcW w:w="${
|
|
3997
|
+
if (resized) set["w:tcW"] = `<w:tcW w:w="${sized2}" w:type="dxa"/>`;
|
|
3998
3998
|
else if (!tcW && !src) set["w:tcW"] = `<w:tcW w:w="${width * span2}" w:type="dxa"/>`;
|
|
3999
3999
|
else if (tcW && src && src.span !== span2 && attr(xml, tcW, "w:type") === "dxa") set["w:tcW"] = `<w:tcW w:w="${Math.round(+(attr(xml, tcW, "w:w") ?? 0) * span2 / src.span)}" w:type="dxa"/>`;
|
|
4000
4000
|
return rebuild(xml, "w:tcPr", TC, set);
|
|
@@ -4067,17 +4067,17 @@ function DocxView({ bytes, onOutline, failed }) {
|
|
|
4067
4067
|
let live = true;
|
|
4068
4068
|
let width = 0;
|
|
4069
4069
|
const root = box2.current;
|
|
4070
|
-
const
|
|
4070
|
+
const fit2 = () => {
|
|
4071
4071
|
const wrapper = root.querySelector(".w100n-docx-wrapper");
|
|
4072
4072
|
if (wrapper && width) wrapper.style.zoom = String(Math.min(1, root.clientWidth / width));
|
|
4073
4073
|
};
|
|
4074
|
-
const watch = new ResizeObserver(
|
|
4074
|
+
const watch = new ResizeObserver(fit2);
|
|
4075
4075
|
root.replaceChildren();
|
|
4076
4076
|
setError(false);
|
|
4077
4077
|
import("docx-preview").then(({ renderAsync }) => renderAsync(bytes, root, void 0, { inWrapper: true, className: "w100n-docx", ignoreLastRenderedPageBreak: true, renderAltChunks: false })).then(() => {
|
|
4078
4078
|
if (!live) return;
|
|
4079
4079
|
width = Math.max(0, ...[...root.querySelectorAll("section.w100n-docx")].map((page) => page.offsetWidth));
|
|
4080
|
-
|
|
4080
|
+
fit2();
|
|
4081
4081
|
watch.observe(root);
|
|
4082
4082
|
onOutline(collect(root, '[class*="heading"]', (el) => Number(/heading(\d)/i.exec(el.className)?.[1] ?? 1)));
|
|
4083
4083
|
}).catch(() => {
|
|
@@ -4993,7 +4993,7 @@ var init_wiki = __esm({
|
|
|
4993
4993
|
var version;
|
|
4994
4994
|
var init_package = __esm({
|
|
4995
4995
|
"package.json"() {
|
|
4996
|
-
version = "0.19.
|
|
4996
|
+
version = "0.19.1";
|
|
4997
4997
|
}
|
|
4998
4998
|
});
|
|
4999
4999
|
|
|
@@ -7746,6 +7746,9 @@ var init_text2 = __esm({
|
|
|
7746
7746
|
loading: "Opening the sheet",
|
|
7747
7747
|
failed: "This sheet could not be opened",
|
|
7748
7748
|
retry: "Try again",
|
|
7749
|
+
fontSize: "Font size",
|
|
7750
|
+
smaller: "Smaller text",
|
|
7751
|
+
bigger: "Bigger text",
|
|
7749
7752
|
undo: "Undo",
|
|
7750
7753
|
redo: "Redo",
|
|
7751
7754
|
bold: "Bold",
|
|
@@ -7819,6 +7822,9 @@ var init_text2 = __esm({
|
|
|
7819
7822
|
loading: "Otwieranie arkusza",
|
|
7820
7823
|
failed: "Nie uda\u0142o si\u0119 otworzy\u0107 tego arkusza",
|
|
7821
7824
|
retry: "Spr\xF3buj ponownie",
|
|
7825
|
+
fontSize: "Rozmiar czcionki",
|
|
7826
|
+
smaller: "Mniejszy tekst",
|
|
7827
|
+
bigger: "Wi\u0119kszy tekst",
|
|
7822
7828
|
undo: "Cofnij",
|
|
7823
7829
|
redo: "Pon\xF3w",
|
|
7824
7830
|
bold: "Pogrubienie",
|
|
@@ -7892,6 +7898,9 @@ var init_text2 = __esm({
|
|
|
7892
7898
|
loading: "\u0412\u0456\u0434\u043A\u0440\u0438\u0432\u0430\u0454\u043C\u043E \u0442\u0430\u0431\u043B\u0438\u0446\u044E",
|
|
7893
7899
|
failed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0432\u0456\u0434\u043A\u0440\u0438\u0442\u0438 \u0446\u044E \u0442\u0430\u0431\u043B\u0438\u0446\u044E",
|
|
7894
7900
|
retry: "\u0421\u043F\u0440\u043E\u0431\u0443\u0432\u0430\u0442\u0438 \u0449\u0435",
|
|
7901
|
+
fontSize: "\u0420\u043E\u0437\u043C\u0456\u0440 \u0448\u0440\u0438\u0444\u0442\u0443",
|
|
7902
|
+
smaller: "\u041C\u0435\u043D\u0448\u0438\u0439 \u0442\u0435\u043A\u0441\u0442",
|
|
7903
|
+
bigger: "\u0411\u0456\u043B\u044C\u0448\u0438\u0439 \u0442\u0435\u043A\u0441\u0442",
|
|
7895
7904
|
undo: "\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",
|
|
7896
7905
|
redo: "\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0438",
|
|
7897
7906
|
bold: "\u0416\u0438\u0440\u043D\u0438\u0439",
|
|
@@ -8355,6 +8364,56 @@ var init_Mentions = __esm({
|
|
|
8355
8364
|
}
|
|
8356
8365
|
});
|
|
8357
8366
|
|
|
8367
|
+
// src/Swatches.tsx
|
|
8368
|
+
function Swatches({ current, none, onPick, onNone }) {
|
|
8369
|
+
const chosen = current?.toLowerCase() ?? null;
|
|
8370
|
+
const swatch = (c) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
8371
|
+
"button",
|
|
8372
|
+
{
|
|
8373
|
+
type: "button",
|
|
8374
|
+
className: "w100n-swatch",
|
|
8375
|
+
"aria-label": c,
|
|
8376
|
+
"aria-pressed": chosen === c,
|
|
8377
|
+
"data-light": light(c) || void 0,
|
|
8378
|
+
style: { background: c },
|
|
8379
|
+
onClick: () => onPick(c),
|
|
8380
|
+
children: chosen === c && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react5.Check, { "aria-hidden": true })
|
|
8381
|
+
},
|
|
8382
|
+
c
|
|
8383
|
+
);
|
|
8384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "w100n-swatches", role: "group", children: [
|
|
8385
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "w100n-swatches-none", "aria-pressed": !chosen, onClick: onNone, children: none }),
|
|
8386
|
+
neutrals.map(swatch),
|
|
8387
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "w100n-swatches-gap" }),
|
|
8388
|
+
[0, 1, 2].flatMap((tone) => hues.map((h) => swatch(h[tone])))
|
|
8389
|
+
] });
|
|
8390
|
+
}
|
|
8391
|
+
var import_lucide_react5, import_jsx_runtime7, neutrals, hues, light;
|
|
8392
|
+
var init_Swatches = __esm({
|
|
8393
|
+
"src/Swatches.tsx"() {
|
|
8394
|
+
"use strict";
|
|
8395
|
+
import_lucide_react5 = require("lucide-react");
|
|
8396
|
+
import_jsx_runtime7 = require("react/jsx-runtime");
|
|
8397
|
+
neutrals = ["#000000", "#475569", "#94a3b8", "#e2e8f0", "#ffffff"];
|
|
8398
|
+
hues = [
|
|
8399
|
+
["#fecaca", "#dc2626", "#991b1b"],
|
|
8400
|
+
["#fed7aa", "#ea580c", "#9a3412"],
|
|
8401
|
+
["#fde68a", "#d97706", "#92400e"],
|
|
8402
|
+
["#fef08a", "#ca8a04", "#854d0e"],
|
|
8403
|
+
["#bbf7d0", "#16a34a", "#166534"],
|
|
8404
|
+
["#99f6e4", "#0d9488", "#115e59"],
|
|
8405
|
+
["#bae6fd", "#0284c7", "#075985"],
|
|
8406
|
+
["#bfdbfe", "#2563eb", "#1e40af"],
|
|
8407
|
+
["#ddd6fe", "#7c3aed", "#5b21b6"],
|
|
8408
|
+
["#fbcfe8", "#db2777", "#9d174d"]
|
|
8409
|
+
];
|
|
8410
|
+
light = (hex2) => {
|
|
8411
|
+
const n = parseInt(hex2.slice(1), 16);
|
|
8412
|
+
return ((n >> 16) * 299 + (n >> 8 & 255) * 587 + (n & 255) * 114) / 1e3 > 150;
|
|
8413
|
+
};
|
|
8414
|
+
}
|
|
8415
|
+
});
|
|
8416
|
+
|
|
8358
8417
|
// src/editor/TextEditor.tsx
|
|
8359
8418
|
var TextEditor_exports = {};
|
|
8360
8419
|
__export(TextEditor_exports, {
|
|
@@ -8690,8 +8749,8 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
8690
8749
|
(0, import_react11.useEffect)(() => {
|
|
8691
8750
|
if (editor && !editor.isDestroyed) editor.view.dispatch(editor.state.tr.setMeta("wiki", true));
|
|
8692
8751
|
}, [editor, roster]);
|
|
8693
|
-
if (source.error) return docx2 ? /* @__PURE__ */ (0,
|
|
8694
|
-
if (!source.data || !editor || !state || live && !live.ready && !live.late && !live.denied) return /* @__PURE__ */ (0,
|
|
8752
|
+
if (source.error) return docx2 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DocxView, { bytes, onOutline, failed: t.failed }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
|
|
8753
|
+
if (!source.data || !editor || !state || live && !live.ready && !live.late && !live.denied) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
|
|
8695
8754
|
const save2 = async (auto = false) => {
|
|
8696
8755
|
if (live) {
|
|
8697
8756
|
if (!can.edit || !live.ready || !live.online || !live.pending || saving === "busy") return false;
|
|
@@ -8866,11 +8925,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
8866
8925
|
};
|
|
8867
8926
|
const tool = (icon, label, run3, pressed, disabled) => {
|
|
8868
8927
|
const Icon = icon;
|
|
8869
|
-
return /* @__PURE__ */ (0,
|
|
8928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled, onClick: () => {
|
|
8870
8929
|
run3();
|
|
8871
|
-
}, children: /* @__PURE__ */ (0,
|
|
8930
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { "aria-hidden": true }) });
|
|
8872
8931
|
};
|
|
8873
|
-
const gap = /* @__PURE__ */ (0,
|
|
8932
|
+
const gap = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-pdf-gap" });
|
|
8874
8933
|
const known = source.data.styles;
|
|
8875
8934
|
const named3 = (test) => {
|
|
8876
8935
|
const name = known.find(test)?.name;
|
|
@@ -8889,28 +8948,28 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
8889
8948
|
];
|
|
8890
8949
|
const margins = [[t.marginsNormal, [96, 96, 96, 96]], [t.marginsNarrow, [48, 48, 48, 48]], [t.marginsWide, [96, 192, 96, 192]]];
|
|
8891
8950
|
const when = (iso) => new Intl.DateTimeFormat(language, { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" }).format(new Date(iso));
|
|
8892
|
-
const person = (c) => /* @__PURE__ */ (0,
|
|
8893
|
-
c.author.avatarUrl ? /* @__PURE__ */ (0,
|
|
8894
|
-
/* @__PURE__ */ (0,
|
|
8895
|
-
/* @__PURE__ */ (0,
|
|
8951
|
+
const person = (c) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { children: [
|
|
8952
|
+
c.author.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { className: "w100n-text-face", src: c.author.avatarUrl, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: c.author.name.slice(0, 1).toUpperCase() }),
|
|
8953
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-who", children: [
|
|
8954
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("b", { children: [
|
|
8896
8955
|
c.author.name,
|
|
8897
|
-
c.author.id.startsWith("guest:") && /* @__PURE__ */ (0,
|
|
8956
|
+
c.author.id.startsWith("guest:") && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-docs-badge", children: t.guest })
|
|
8898
8957
|
] }),
|
|
8899
|
-
/* @__PURE__ */ (0,
|
|
8958
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: when(c.createdAt) })
|
|
8900
8959
|
] }),
|
|
8901
|
-
drops(c) && /* @__PURE__ */ (0,
|
|
8902
|
-
mine(c) && host.editComment && /* @__PURE__ */ (0,
|
|
8960
|
+
drops(c) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-own", onClick: (e) => e.stopPropagation(), children: [
|
|
8961
|
+
mine(c) && host.editComment && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": t.editComment, title: t.editComment, onClick: () => {
|
|
8903
8962
|
setDropping(null);
|
|
8904
8963
|
setEditing({ id: c.id, body: c.body });
|
|
8905
|
-
}, children: /* @__PURE__ */ (0,
|
|
8906
|
-
host.deleteComment && /* @__PURE__ */ (0,
|
|
8964
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Pencil, { "aria-hidden": true }) }),
|
|
8965
|
+
host.deleteComment && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-tone": "red", "aria-label": t.delete, title: t.delete, onClick: () => {
|
|
8907
8966
|
setEditing(null);
|
|
8908
8967
|
setDropping(c.id);
|
|
8909
|
-
}, children: /* @__PURE__ */ (0,
|
|
8968
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Trash2, { "aria-hidden": true }) })
|
|
8910
8969
|
] })
|
|
8911
8970
|
] });
|
|
8912
|
-
const words3 = (c) => editing?.id === c.id ? /* @__PURE__ */ (0,
|
|
8913
|
-
/* @__PURE__ */ (0,
|
|
8971
|
+
const words3 = (c) => editing?.id === c.id ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-reply w100n-text-edit", onClick: (e) => e.stopPropagation(), children: [
|
|
8972
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
8914
8973
|
"textarea",
|
|
8915
8974
|
{
|
|
8916
8975
|
autoFocus: true,
|
|
@@ -8922,33 +8981,33 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
8922
8981
|
}
|
|
8923
8982
|
}
|
|
8924
8983
|
),
|
|
8925
|
-
/* @__PURE__ */ (0,
|
|
8926
|
-
/* @__PURE__ */ (0,
|
|
8927
|
-
/* @__PURE__ */ (0,
|
|
8928
|
-
/* @__PURE__ */ (0,
|
|
8984
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
8985
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setEditing(null), children: t.cancel }),
|
|
8986
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !editing.body.trim() || editing.body.trim() === c.body || posting === "busy", onClick: () => void change(c.id, editing.body.trim()), children: [
|
|
8987
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Save, { "aria-hidden": true }),
|
|
8929
8988
|
t.save
|
|
8930
8989
|
] })
|
|
8931
8990
|
] })
|
|
8932
|
-
] }) : dropping === c.id ? /* @__PURE__ */ (0,
|
|
8933
|
-
/* @__PURE__ */ (0,
|
|
8934
|
-
/* @__PURE__ */ (0,
|
|
8935
|
-
/* @__PURE__ */ (0,
|
|
8936
|
-
/* @__PURE__ */ (0,
|
|
8937
|
-
/* @__PURE__ */ (0,
|
|
8991
|
+
] }) : dropping === c.id ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-confirm", role: "group", "aria-label": t.delete, onClick: (e) => e.stopPropagation(), children: [
|
|
8992
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: c.replyTo || !all.some((r) => r.replyTo === c.id) ? t.deleteAsk : t.deleteThread }),
|
|
8993
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
8994
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", autoFocus: true, onClick: () => setDropping(null), children: t.cancel }),
|
|
8995
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: posting === "busy", onClick: () => void change(c.id, null), children: [
|
|
8996
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Trash2, { "aria-hidden": true }),
|
|
8938
8997
|
t.delete
|
|
8939
8998
|
] })
|
|
8940
8999
|
] })
|
|
8941
|
-
] }) : /* @__PURE__ */ (0,
|
|
9000
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: c.body });
|
|
8942
9001
|
const pick = (next) => setPop(pop === next ? null : next);
|
|
8943
|
-
const swatches = (list, current, set, none) => /* @__PURE__ */ (0,
|
|
8944
|
-
/* @__PURE__ */ (0,
|
|
9002
|
+
const swatches = (list, current, set, none) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-swatches", role: "group", children: [
|
|
9003
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-text-none", onClick: () => {
|
|
8945
9004
|
set(null);
|
|
8946
9005
|
setPop(null);
|
|
8947
9006
|
}, children: none }),
|
|
8948
|
-
list.map((c, i) => /* @__PURE__ */ (0,
|
|
9007
|
+
list.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": c, "aria-pressed": current === c, onClick: () => {
|
|
8949
9008
|
set(c);
|
|
8950
9009
|
setPop(null);
|
|
8951
|
-
}, children: /* @__PURE__ */ (0,
|
|
9010
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { style: { background: c } }) }, i))
|
|
8952
9011
|
] });
|
|
8953
9012
|
const mod = /Mac|iPhone|iPad/.test(navigator.platform) ? "\u2318" : "Ctrl+";
|
|
8954
9013
|
const item = (label, run3, more2 = {}) => ({ label, run: run3, ...more2 });
|
|
@@ -8957,7 +9016,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
8957
9016
|
editor.chain().focus().insertContentAt(at2, { type: "toc", attrs: { entries: JSON.stringify(entries(editor.state.doc, !docx2, at2 - 1)) } }).run();
|
|
8958
9017
|
};
|
|
8959
9018
|
const suggest2 = () => editor.view.dispatch(editor.state.tr.setMeta(suggesting, { on: !state.suggest, me: host?.me.name ?? "" }));
|
|
8960
|
-
const aligns = [[
|
|
9019
|
+
const aligns = [[import_lucide_react6.AlignLeft, t.alignLeft, "left"], [import_lucide_react6.AlignCenter, t.alignCenter, "center"], [import_lucide_react6.AlignRight, t.alignRight, "right"], [import_lucide_react6.AlignJustify, t.justify, "justify"]];
|
|
8961
9020
|
const lines2 = [[1, t.single], [1.15, "1.15"], [1.5, "1.5"], [2, t.double]];
|
|
8962
9021
|
const menus = [
|
|
8963
9022
|
["file", t.menuFile, [
|
|
@@ -9074,17 +9133,17 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9074
9133
|
item(t.deleteColumn, () => editor.chain().focus().deleteColumn().run())
|
|
9075
9134
|
] : []
|
|
9076
9135
|
];
|
|
9077
|
-
const rows = (list) => list.filter((x) => x !== false).filter((x, i, all2) => x !== "-" || i > 0 && all2[i - 1] !== "-" && i < all2.length - 1).map((x, i) => x === "-" ? /* @__PURE__ */ (0,
|
|
9136
|
+
const rows = (list) => list.filter((x) => x !== false).filter((x, i, all2) => x !== "-" || i > 0 && all2[i - 1] !== "-" && i < all2.length - 1).map((x, i) => x === "-" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", {}, i) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", role: x.on === void 0 ? "menuitem" : "menuitemcheckbox", "aria-checked": x.on, disabled: x.off, onClick: () => {
|
|
9078
9137
|
setPop(null);
|
|
9079
9138
|
x.run();
|
|
9080
9139
|
}, children: [
|
|
9081
|
-
/* @__PURE__ */ (0,
|
|
9082
|
-
/* @__PURE__ */ (0,
|
|
9083
|
-
x.keys && /* @__PURE__ */ (0,
|
|
9140
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { "aria-hidden": true }),
|
|
9141
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: x.label }),
|
|
9142
|
+
x.keys && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("kbd", { children: x.keys })
|
|
9084
9143
|
] }, i));
|
|
9085
|
-
const menu = ([key2, label, list]) => /* @__PURE__ */ (0,
|
|
9086
|
-
/* @__PURE__ */ (0,
|
|
9087
|
-
pop === key2 && /* @__PURE__ */ (0,
|
|
9144
|
+
const menu = ([key2, label, list]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9145
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-text-menu-button", "data-pop": true, "aria-haspopup": "menu", "aria-expanded": pop === key2, onClick: () => pick(key2), children: label }),
|
|
9146
|
+
pop === key2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-pop w100n-text-menu", role: "menu", "aria-label": label, children: rows(list) })
|
|
9088
9147
|
] }, key2);
|
|
9089
9148
|
const seek = (next) => {
|
|
9090
9149
|
editor.view.dispatch(editor.state.tr.setMeta(searching, next));
|
|
@@ -9096,11 +9155,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9096
9155
|
}
|
|
9097
9156
|
};
|
|
9098
9157
|
const found = searching.getState(editor.state);
|
|
9099
|
-
const finder = /* @__PURE__ */ (0,
|
|
9100
|
-
/* @__PURE__ */ (0,
|
|
9101
|
-
pop === "find" && /* @__PURE__ */ (0,
|
|
9102
|
-
/* @__PURE__ */ (0,
|
|
9103
|
-
/* @__PURE__ */ (0,
|
|
9158
|
+
const finder = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9159
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "find", "aria-label": t.findReplace, title: t.findReplace, onClick: () => pick("find"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Search, { "aria-hidden": true }) }),
|
|
9160
|
+
pop === "find" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-find", role: "search", "aria-label": t.findReplace, children: [
|
|
9161
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-docs-row", children: [
|
|
9162
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
9104
9163
|
"input",
|
|
9105
9164
|
{
|
|
9106
9165
|
autoFocus: true,
|
|
@@ -9120,27 +9179,27 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9120
9179
|
}
|
|
9121
9180
|
}
|
|
9122
9181
|
),
|
|
9123
|
-
/* @__PURE__ */ (0,
|
|
9124
|
-
/* @__PURE__ */ (0,
|
|
9125
|
-
/* @__PURE__ */ (0,
|
|
9126
|
-
/* @__PURE__ */ (0,
|
|
9182
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-find-end", children: [
|
|
9183
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { "aria-live": "polite", children: query ? found?.hits.length ? `${(found.at ?? 0) + 1} / ${found.hits.length}` : t.noHits : "" }),
|
|
9184
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": t.previous, title: t.previous, disabled: !found?.hits.length, onClick: () => seek({ at: found.at - 1 }), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronUp, { "aria-hidden": true }) }),
|
|
9185
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": t.next, title: t.next, disabled: !found?.hits.length, onClick: () => seek({ at: found.at + 1 }), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true }) })
|
|
9127
9186
|
] })
|
|
9128
9187
|
] }),
|
|
9129
|
-
can.edit && /* @__PURE__ */ (0,
|
|
9130
|
-
/* @__PURE__ */ (0,
|
|
9131
|
-
/* @__PURE__ */ (0,
|
|
9132
|
-
/* @__PURE__ */ (0,
|
|
9188
|
+
can.edit && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-docs-row", children: [
|
|
9189
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { value: swap, placeholder: t.replaceWith, "aria-label": t.replaceWith, onChange: (e) => setSwap(e.target.value) }),
|
|
9190
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-find-end", children: [
|
|
9191
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", disabled: !found?.hits.length, onClick: () => {
|
|
9133
9192
|
replace(editor, swap, false);
|
|
9134
9193
|
seek({});
|
|
9135
9194
|
}, children: t.replaceOne }),
|
|
9136
|
-
/* @__PURE__ */ (0,
|
|
9195
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-docs-action", disabled: !found?.hits.length, onClick: () => {
|
|
9137
9196
|
replace(editor, swap, true);
|
|
9138
9197
|
seek({});
|
|
9139
9198
|
}, children: t.replaceAll })
|
|
9140
9199
|
] })
|
|
9141
9200
|
] }),
|
|
9142
|
-
/* @__PURE__ */ (0,
|
|
9143
|
-
/* @__PURE__ */ (0,
|
|
9201
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "w100n-setup-check", children: [
|
|
9202
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "checkbox", checked: matchCase, onChange: (e) => {
|
|
9144
9203
|
setMatchCase(e.target.checked);
|
|
9145
9204
|
seek({ matchCase: e.target.checked, at: 0 });
|
|
9146
9205
|
} }),
|
|
@@ -9165,47 +9224,47 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9165
9224
|
spacing(editor, { line: paint2.block.line, after: paint2.block.after });
|
|
9166
9225
|
if (!paint2.keep) setPaint(null);
|
|
9167
9226
|
};
|
|
9168
|
-
const fontPicker = /* @__PURE__ */ (0,
|
|
9169
|
-
/* @__PURE__ */ (0,
|
|
9170
|
-
/* @__PURE__ */ (0,
|
|
9171
|
-
/* @__PURE__ */ (0,
|
|
9227
|
+
const fontPicker = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9228
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "mid", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "font", "aria-label": t.font, title: t.font, onClick: () => pick("font"), children: [
|
|
9229
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { fontFamily: state.font ?? void 0 }, children: state.font ?? t.defaultFont }),
|
|
9230
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true })
|
|
9172
9231
|
] }),
|
|
9173
|
-
pop === "font" && /* @__PURE__ */ (0,
|
|
9174
|
-
/* @__PURE__ */ (0,
|
|
9232
|
+
pop === "font" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.font, children: [
|
|
9233
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": !state.font, onClick: () => {
|
|
9175
9234
|
editor.chain().focus().unsetFontFamily().run();
|
|
9176
9235
|
setPop(null);
|
|
9177
9236
|
}, children: t.defaultFont }),
|
|
9178
|
-
faces.map((f) => /* @__PURE__ */ (0,
|
|
9237
|
+
faces.map((f) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": state.font === f, style: { fontFamily: f }, onClick: () => {
|
|
9179
9238
|
editor.chain().focus().setFontFamily(f).run();
|
|
9180
9239
|
setPop(null);
|
|
9181
9240
|
}, children: f }, f))
|
|
9182
9241
|
] })
|
|
9183
9242
|
] });
|
|
9184
|
-
const sizePicker = /* @__PURE__ */ (0,
|
|
9185
|
-
/* @__PURE__ */ (0,
|
|
9243
|
+
const sizePicker = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9244
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "small", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "size", "aria-label": t.fontSize, title: t.fontSize, onClick: () => pick("size"), children: [
|
|
9186
9245
|
state.size ? parseFloat(state.size) : t.defaultFont,
|
|
9187
|
-
/* @__PURE__ */ (0,
|
|
9246
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true })
|
|
9188
9247
|
] }),
|
|
9189
|
-
pop === "size" && /* @__PURE__ */ (0,
|
|
9190
|
-
/* @__PURE__ */ (0,
|
|
9248
|
+
pop === "size" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.fontSize, children: [
|
|
9249
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": !state.size, onClick: () => {
|
|
9191
9250
|
editor.chain().focus().unsetFontSize().run();
|
|
9192
9251
|
setPop(null);
|
|
9193
9252
|
}, children: t.defaultFont }),
|
|
9194
|
-
sizes.map((n) => /* @__PURE__ */ (0,
|
|
9253
|
+
sizes.map((n) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": state.size !== null && parseFloat(state.size) === n, onClick: () => {
|
|
9195
9254
|
editor.chain().focus().setFontSize(`${n}pt`).run();
|
|
9196
9255
|
setPop(null);
|
|
9197
9256
|
}, children: n }, n))
|
|
9198
9257
|
] })
|
|
9199
9258
|
] });
|
|
9200
|
-
const spacer = /* @__PURE__ */ (0,
|
|
9201
|
-
/* @__PURE__ */ (0,
|
|
9202
|
-
pop === "spacing" && /* @__PURE__ */ (0,
|
|
9203
|
-
lines2.map(([v, label]) => /* @__PURE__ */ (0,
|
|
9259
|
+
const spacer = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9260
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "spacing", "aria-label": t.lineSpacing, title: t.lineSpacing, onClick: () => pick("spacing"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.UnfoldVertical, { "aria-hidden": true }) }),
|
|
9261
|
+
pop === "spacing" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.lineSpacing, children: [
|
|
9262
|
+
lines2.map(([v, label]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": state.line === v, onClick: () => {
|
|
9204
9263
|
spacing(editor, { line: v });
|
|
9205
9264
|
setPop(null);
|
|
9206
9265
|
}, children: label }, v)),
|
|
9207
|
-
/* @__PURE__ */ (0,
|
|
9208
|
-
/* @__PURE__ */ (0,
|
|
9266
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", {}),
|
|
9267
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": false, onClick: () => {
|
|
9209
9268
|
spacing(editor, { after: state.after === 0 ? 8 : 0 });
|
|
9210
9269
|
setPop(null);
|
|
9211
9270
|
}, children: state.after === 0 ? t.spaceAfter : t.noSpaceAfter })
|
|
@@ -9228,18 +9287,18 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9228
9287
|
setDraft2(null);
|
|
9229
9288
|
};
|
|
9230
9289
|
const zooms = [50, 75, 90, 100, 125, 150, 200];
|
|
9231
|
-
const zoomer = /* @__PURE__ */ (0,
|
|
9232
|
-
/* @__PURE__ */ (0,
|
|
9290
|
+
const zoomer = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9291
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "small", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "zoom", "aria-label": t.zoom, title: t.zoom, onClick: () => pick("zoom"), children: [
|
|
9233
9292
|
percent,
|
|
9234
9293
|
"%",
|
|
9235
|
-
/* @__PURE__ */ (0,
|
|
9294
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true })
|
|
9236
9295
|
] }),
|
|
9237
|
-
pop === "zoom" && /* @__PURE__ */ (0,
|
|
9238
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9296
|
+
pop === "zoom" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.zoom, children: [
|
|
9297
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": zoom === null, onClick: () => {
|
|
9239
9298
|
setZoom(null);
|
|
9240
9299
|
setPop(null);
|
|
9241
9300
|
}, children: t.fitWidth }),
|
|
9242
|
-
zooms.map((z) => /* @__PURE__ */ (0,
|
|
9301
|
+
zooms.map((z) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", role: "option", "aria-selected": zoom === z, onClick: () => {
|
|
9243
9302
|
setZoom(z);
|
|
9244
9303
|
setPop(null);
|
|
9245
9304
|
}, children: [
|
|
@@ -9248,10 +9307,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9248
9307
|
] }, z))
|
|
9249
9308
|
] })
|
|
9250
9309
|
] });
|
|
9251
|
-
const Aligned = aligns.find(([, , value3]) => value3 === state.align)?.[0] ??
|
|
9252
|
-
const aligner = /* @__PURE__ */ (0,
|
|
9253
|
-
/* @__PURE__ */ (0,
|
|
9254
|
-
pop === "align" && /* @__PURE__ */ (0,
|
|
9310
|
+
const Aligned = aligns.find(([, , value3]) => value3 === state.align)?.[0] ?? import_lucide_react6.AlignLeft;
|
|
9311
|
+
const aligner = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9312
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "align", "aria-label": t.align, title: t.align, onClick: () => pick("align"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Aligned, { "aria-hidden": true }) }),
|
|
9313
|
+
pop === "align" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-pop", role: "group", "aria-label": t.align, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-tools", children: aligns.map(([icon, label, value3], i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react11.Fragment, { children: tool(icon, label, () => {
|
|
9255
9314
|
align2(editor, value3);
|
|
9256
9315
|
setPop(null);
|
|
9257
9316
|
}, state.align === value3) }, i)) }) })
|
|
@@ -9260,13 +9319,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9260
9319
|
localStorage.setItem("w100n-docs-more", more ? "" : "1");
|
|
9261
9320
|
setMore(!more);
|
|
9262
9321
|
};
|
|
9263
|
-
const main = can.edit ? /* @__PURE__ */ (0,
|
|
9264
|
-
/* @__PURE__ */ (0,
|
|
9265
|
-
/* @__PURE__ */ (0,
|
|
9322
|
+
const main = can.edit ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9323
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9324
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-text-picker", "data-size": "mid", "data-pop": true, "aria-haspopup": "listbox", "aria-expanded": pop === "style", "aria-label": t.paragraphStyle, title: t.paragraphStyle, onClick: () => pick("style"), children: [
|
|
9266
9325
|
styles2.find(([key2]) => key2 === state.style)?.[1] ?? t.normal,
|
|
9267
|
-
/* @__PURE__ */ (0,
|
|
9326
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true })
|
|
9268
9327
|
] }),
|
|
9269
|
-
pop === "style" && /* @__PURE__ */ (0,
|
|
9328
|
+
pop === "style" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.paragraphStyle, children: styles2.map(([key2, label, run3]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
9270
9329
|
"button",
|
|
9271
9330
|
{
|
|
9272
9331
|
type: "button",
|
|
@@ -9283,52 +9342,58 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9283
9342
|
)) })
|
|
9284
9343
|
] }),
|
|
9285
9344
|
gap,
|
|
9286
|
-
tool(
|
|
9287
|
-
tool(
|
|
9288
|
-
docx2 ? tool(
|
|
9289
|
-
!docx2 && tool(
|
|
9290
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9291
|
-
/* @__PURE__ */ (0,
|
|
9292
|
-
/* @__PURE__ */ (0,
|
|
9293
|
-
/* @__PURE__ */ (0,
|
|
9345
|
+
tool(import_lucide_react6.Bold, t.bold, () => editor.chain().focus().toggleBold().run(), state.bold),
|
|
9346
|
+
tool(import_lucide_react6.Italic, t.italic, () => editor.chain().focus().toggleItalic().run(), state.italic),
|
|
9347
|
+
docx2 ? tool(import_lucide_react6.Underline, t.underline, () => editor.chain().focus().toggleUnderline().run(), state.underline) : tool(import_lucide_react6.Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
|
|
9348
|
+
!docx2 && tool(import_lucide_react6.Code, t.code, () => editor.chain().focus().toggleCode().run(), state.code),
|
|
9349
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9350
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "color", "aria-label": t.textColour, title: t.textColour, onClick: () => pick("color"), children: [
|
|
9351
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Baseline, { "aria-hidden": true }),
|
|
9352
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { className: "w100n-text-bar", style: { background: state.color ?? "currentColor" } })
|
|
9294
9353
|
] }),
|
|
9295
|
-
pop === "color" &&
|
|
9354
|
+
pop === "color" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-pop", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Swatches, { current: state.color, none: t.automatic, onPick: (c) => {
|
|
9355
|
+
editor.chain().focus().setColor(c).run();
|
|
9356
|
+
setPop(null);
|
|
9357
|
+
}, onNone: () => {
|
|
9358
|
+
editor.chain().focus().unsetColor().run();
|
|
9359
|
+
setPop(null);
|
|
9360
|
+
} }) })
|
|
9296
9361
|
] }),
|
|
9297
9362
|
gap,
|
|
9298
9363
|
aligner,
|
|
9299
|
-
tool(
|
|
9300
|
-
tool(
|
|
9301
|
-
!docx2 && tool(
|
|
9364
|
+
tool(import_lucide_react6.List, t.bullets, () => editor.chain().focus().toggleBulletList().run(), state.bullets),
|
|
9365
|
+
tool(import_lucide_react6.ListOrdered, t.numbers, () => editor.chain().focus().toggleOrderedList().run(), state.numbers),
|
|
9366
|
+
!docx2 && tool(import_lucide_react6.ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
|
|
9302
9367
|
gap,
|
|
9303
|
-
/* @__PURE__ */ (0,
|
|
9304
|
-
/* @__PURE__ */ (0,
|
|
9305
|
-
pop === "link" && /* @__PURE__ */ (0,
|
|
9306
|
-
/* @__PURE__ */ (0,
|
|
9368
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9369
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "link", "aria-pressed": state.link, "aria-label": t.link, title: t.link, onClick: () => pop === "link" ? setPop(null) : linkUp(), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Link, { "aria-hidden": true }) }),
|
|
9370
|
+
pop === "link" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-form", children: [
|
|
9371
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { autoFocus: true, value: href, placeholder: t.linkAddress, "aria-label": t.linkAddress, onChange: (e) => setHref(e.target.value), onKeyDown: (e) => {
|
|
9307
9372
|
if (e.key === "Enter") putLink();
|
|
9308
9373
|
} }),
|
|
9309
|
-
/* @__PURE__ */ (0,
|
|
9310
|
-
state.link && /* @__PURE__ */ (0,
|
|
9374
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-docs-row", children: [
|
|
9375
|
+
state.link && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
|
|
9311
9376
|
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
9312
9377
|
setPop(null);
|
|
9313
9378
|
}, children: [
|
|
9314
|
-
/* @__PURE__ */ (0,
|
|
9379
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Link2Off, { "aria-hidden": true }),
|
|
9315
9380
|
t.unlink
|
|
9316
9381
|
] }),
|
|
9317
|
-
/* @__PURE__ */ (0,
|
|
9318
|
-
/* @__PURE__ */ (0,
|
|
9382
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: putLink, children: [
|
|
9383
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Link, { "aria-hidden": true }),
|
|
9319
9384
|
t.apply
|
|
9320
9385
|
] })
|
|
9321
9386
|
] })
|
|
9322
9387
|
] })
|
|
9323
9388
|
] }),
|
|
9324
|
-
can.comment && tool(
|
|
9325
|
-
/* @__PURE__ */ (0,
|
|
9326
|
-
/* @__PURE__ */ (0,
|
|
9389
|
+
can.comment && tool(import_lucide_react6.MessageSquarePlus, t.addComment, begin, void 0, state.empty),
|
|
9390
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9391
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "image", "aria-label": t.image, title: t.image, onClick: () => {
|
|
9327
9392
|
setHref("");
|
|
9328
9393
|
pick("image");
|
|
9329
|
-
}, children: /* @__PURE__ */ (0,
|
|
9330
|
-
pop === "image" && /* @__PURE__ */ (0,
|
|
9331
|
-
/* @__PURE__ */ (0,
|
|
9394
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ImagePlus, { "aria-hidden": true }) }),
|
|
9395
|
+
pop === "image" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-form", children: [
|
|
9396
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
9332
9397
|
"input",
|
|
9333
9398
|
{
|
|
9334
9399
|
autoFocus: true,
|
|
@@ -9344,10 +9409,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9344
9409
|
}
|
|
9345
9410
|
}
|
|
9346
9411
|
),
|
|
9347
|
-
/* @__PURE__ */ (0,
|
|
9348
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9412
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-docs-row", children: [
|
|
9413
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "w100n-pdf-link", children: [
|
|
9349
9414
|
t.chooseFile,
|
|
9350
|
-
/* @__PURE__ */ (0,
|
|
9415
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "file", accept: "image/png,image/jpeg,image/gif", hidden: true, onChange: (e) => {
|
|
9351
9416
|
const file2 = e.target.files?.[0];
|
|
9352
9417
|
if (!file2) return;
|
|
9353
9418
|
const reader = new FileReader();
|
|
@@ -9358,23 +9423,23 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9358
9423
|
reader.readAsDataURL(file2);
|
|
9359
9424
|
} })
|
|
9360
9425
|
] }),
|
|
9361
|
-
/* @__PURE__ */ (0,
|
|
9426
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: () => {
|
|
9362
9427
|
editor.chain().focus().setImage({ src: href.trim() }).run();
|
|
9363
9428
|
setPop(null);
|
|
9364
9429
|
}, children: [
|
|
9365
|
-
/* @__PURE__ */ (0,
|
|
9430
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ImagePlus, { "aria-hidden": true }),
|
|
9366
9431
|
t.put
|
|
9367
9432
|
] })
|
|
9368
9433
|
] })
|
|
9369
9434
|
] })
|
|
9370
9435
|
] }),
|
|
9371
|
-
/* @__PURE__ */ (0,
|
|
9372
|
-
/* @__PURE__ */ (0,
|
|
9373
|
-
pop === "table" && /* @__PURE__ */ (0,
|
|
9374
|
-
/* @__PURE__ */ (0,
|
|
9436
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9437
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "table", "aria-label": t.table, title: t.table, onClick: () => pick("table"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Table, { "aria-hidden": true }) }),
|
|
9438
|
+
pop === "table" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-grid", role: "group", "aria-label": t.table, onPointerLeave: () => setGrid({ rows: 0, cols: 0 }), children: [
|
|
9439
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: Array.from({ length: 48 }, (_, i) => {
|
|
9375
9440
|
const rows2 = Math.floor(i / 8) + 1;
|
|
9376
9441
|
const cols = i % 8 + 1;
|
|
9377
|
-
return /* @__PURE__ */ (0,
|
|
9442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
9378
9443
|
"button",
|
|
9379
9444
|
{
|
|
9380
9445
|
type: "button",
|
|
@@ -9389,89 +9454,95 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9389
9454
|
i
|
|
9390
9455
|
);
|
|
9391
9456
|
}) }),
|
|
9392
|
-
/* @__PURE__ */ (0,
|
|
9457
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: grid3.rows ? `${grid3.rows} \xD7 ${grid3.cols}` : t.table })
|
|
9393
9458
|
] })
|
|
9394
9459
|
] }),
|
|
9395
9460
|
gap,
|
|
9396
|
-
/* @__PURE__ */ (0,
|
|
9397
|
-
] }) : /* @__PURE__ */ (0,
|
|
9398
|
-
/* @__PURE__ */ (0,
|
|
9399
|
-
/* @__PURE__ */ (0,
|
|
9461
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-expanded": more, "aria-label": more ? t.fewerTools : t.moreTools, title: more ? t.fewerTools : t.moreTools, onClick: widen, children: more ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ChevronUp, { "aria-hidden": true }) })
|
|
9462
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9463
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("outline"), children: [
|
|
9464
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.ListTree, { "aria-hidden": true }),
|
|
9400
9465
|
t.outline
|
|
9401
9466
|
] }),
|
|
9402
|
-
can.comment && /* @__PURE__ */ (0,
|
|
9403
|
-
/* @__PURE__ */ (0,
|
|
9404
|
-
/* @__PURE__ */ (0,
|
|
9405
|
-
/* @__PURE__ */ (0,
|
|
9467
|
+
can.comment && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9468
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-grow" }),
|
|
9469
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: state.empty, onClick: begin, children: [
|
|
9470
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.MessageSquarePlus, { "aria-hidden": true }),
|
|
9406
9471
|
t.addComment
|
|
9407
9472
|
] })
|
|
9408
9473
|
] }),
|
|
9409
|
-
!!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */ (0,
|
|
9410
|
-
/* @__PURE__ */ (0,
|
|
9474
|
+
!!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("comments"), children: [
|
|
9475
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.MessagesSquare, { "aria-hidden": true }),
|
|
9411
9476
|
t.comments,
|
|
9412
|
-
/* @__PURE__ */ (0,
|
|
9477
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: open.length })
|
|
9413
9478
|
] })
|
|
9414
9479
|
] });
|
|
9415
|
-
const extra = can.edit && more && /* @__PURE__ */ (0,
|
|
9416
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9480
|
+
const extra = can.edit && more && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9481
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9417
9482
|
fontPicker,
|
|
9418
9483
|
sizePicker,
|
|
9419
9484
|
gap
|
|
9420
9485
|
] }),
|
|
9421
|
-
docx2 && tool(
|
|
9422
|
-
docx2 && tool(
|
|
9423
|
-
docx2 && tool(
|
|
9424
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9425
|
-
/* @__PURE__ */ (0,
|
|
9486
|
+
docx2 && tool(import_lucide_react6.Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
|
|
9487
|
+
docx2 && tool(import_lucide_react6.Superscript, t.superscript, () => editor.chain().focus().toggleMark("superscript").run(), state.sup),
|
|
9488
|
+
docx2 && tool(import_lucide_react6.Subscript, t.subscript, () => editor.chain().focus().toggleMark("subscript").run(), state.sub),
|
|
9489
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9490
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "mark", "aria-pressed": state.glow, "aria-label": t.highlight, title: t.highlight, onClick: () => pick("mark"), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Highlighter, { "aria-hidden": true }) }),
|
|
9426
9491
|
pop === "mark" && swatches(glows, null, (c) => c ? editor.chain().focus().setHighlight({ color: c }).run() : editor.chain().focus().unsetHighlight().run(), t.noColour)
|
|
9427
9492
|
] }),
|
|
9428
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9493
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9429
9494
|
gap,
|
|
9430
9495
|
spacer
|
|
9431
9496
|
] }),
|
|
9432
|
-
tool(
|
|
9433
|
-
tool(
|
|
9434
|
-
docx2 && tool(
|
|
9497
|
+
tool(import_lucide_react6.ListIndentDecrease, t.outdent, () => indent(editor, -1)),
|
|
9498
|
+
tool(import_lucide_react6.ListIndentIncrease, t.indent, () => indent(editor, 1)),
|
|
9499
|
+
docx2 && tool(import_lucide_react6.ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
|
|
9435
9500
|
gap,
|
|
9436
|
-
/* @__PURE__ */ (0,
|
|
9437
|
-
tool(
|
|
9438
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9501
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": t.painter, title: paint2 ? t.painterHint : t.painter, "aria-pressed": !!paint2, onClick: () => take(false), onDoubleClick: () => take(true), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.PaintRoller, { "aria-hidden": true }) }),
|
|
9502
|
+
tool(import_lucide_react6.RemoveFormatting, t.clearFormat, () => clear(editor)),
|
|
9503
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9439
9504
|
gap,
|
|
9440
|
-
tool(
|
|
9505
|
+
tool(import_lucide_react6.FilePenLine, t.suggest, suggest2, state.suggest)
|
|
9441
9506
|
] })
|
|
9442
9507
|
] });
|
|
9443
|
-
const context = can.edit && (state.table ? /* @__PURE__ */ (0,
|
|
9444
|
-
tool(
|
|
9445
|
-
tool(
|
|
9446
|
-
tool(
|
|
9447
|
-
tool(
|
|
9448
|
-
tool(
|
|
9449
|
-
docx2 && tool(
|
|
9450
|
-
docx2 && /* @__PURE__ */ (0,
|
|
9451
|
-
/* @__PURE__ */ (0,
|
|
9452
|
-
/* @__PURE__ */ (0,
|
|
9453
|
-
/* @__PURE__ */ (0,
|
|
9508
|
+
const context = can.edit && (state.table ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9509
|
+
tool(import_lucide_react6.BetweenHorizontalStart, t.rowAbove, () => editor.chain().focus().addRowBefore().run()),
|
|
9510
|
+
tool(import_lucide_react6.BetweenHorizontalEnd, t.rowBelow, () => editor.chain().focus().addRowAfter().run()),
|
|
9511
|
+
tool(import_lucide_react6.BetweenVerticalStart, t.columnLeft, () => editor.chain().focus().addColumnBefore().run()),
|
|
9512
|
+
tool(import_lucide_react6.BetweenVerticalEnd, t.columnRight, () => editor.chain().focus().addColumnAfter().run()),
|
|
9513
|
+
tool(import_lucide_react6.PanelTop, t.headerRow, () => editor.chain().focus().toggleHeaderRow().run()),
|
|
9514
|
+
docx2 && tool(import_lucide_react6.TableCellsMerge, t.mergeCells, () => editor.chain().focus().mergeOrSplit().run()),
|
|
9515
|
+
docx2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-anchor", children: [
|
|
9516
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", "data-pop": true, "aria-expanded": pop === "fill", "aria-label": t.cellFill, title: t.cellFill, onClick: () => pick("fill"), children: [
|
|
9517
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.PaintBucket, { "aria-hidden": true }),
|
|
9518
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("i", { className: "w100n-text-bar", style: { background: state.fill ?? "transparent" } })
|
|
9454
9519
|
] }),
|
|
9455
|
-
pop === "fill" &&
|
|
9520
|
+
pop === "fill" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-pop", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Swatches, { current: state.fill, none: t.noColour, onPick: (c) => {
|
|
9521
|
+
editor.chain().focus().setCellAttribute("background", c).run();
|
|
9522
|
+
setPop(null);
|
|
9523
|
+
}, onNone: () => {
|
|
9524
|
+
editor.chain().focus().setCellAttribute("background", null).run();
|
|
9525
|
+
setPop(null);
|
|
9526
|
+
} }) })
|
|
9456
9527
|
] }),
|
|
9457
|
-
docx2 && tool(
|
|
9458
|
-
tool(
|
|
9459
|
-
tool(
|
|
9460
|
-
tool(
|
|
9461
|
-
] }) : state.img && /* @__PURE__ */ (0,
|
|
9462
|
-
const status = (can.edit || live) && /* @__PURE__ */ (0,
|
|
9463
|
-
live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */ (0,
|
|
9464
|
-
/* @__PURE__ */ (0,
|
|
9528
|
+
docx2 && tool(import_lucide_react6.Grid3x3, t.tableBorders, () => editor.chain().focus().updateAttributes("table", { borders: state.bare ? null : "none" }).run(), !state.bare),
|
|
9529
|
+
tool(import_lucide_react6.TableRowsSplit, t.deleteRow, () => editor.chain().focus().deleteRow().run()),
|
|
9530
|
+
tool(import_lucide_react6.TableColumnsSplit, t.deleteColumn, () => editor.chain().focus().deleteColumn().run()),
|
|
9531
|
+
tool(import_lucide_react6.Trash2, t.deleteTable, () => editor.chain().focus().deleteTable().run())
|
|
9532
|
+
] }) : state.img && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: [[import_lucide_react6.Image, t.wrapInline, "inline"], [import_lucide_react6.PanelLeft, t.wrapLeft, "left"], [import_lucide_react6.PanelRight, t.wrapRight, "right"]].map(([icon, label, value3]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react11.Fragment, { children: tool(icon, label, () => editor.chain().focus().updateAttributes("image", { wrap: value3 === "inline" ? null : value3 }).run(), state.img === value3) }, value3)) }));
|
|
9533
|
+
const status = (can.edit || live) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-end", children: [
|
|
9534
|
+
live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-live", title: live.denied ? void 0 : t.offlineHint, children: [
|
|
9535
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.WifiOff, { "aria-hidden": true }),
|
|
9465
9536
|
live.denied ? t.liveOff : t.offline
|
|
9466
9537
|
] }),
|
|
9467
|
-
state.suggest && /* @__PURE__ */ (0,
|
|
9468
|
-
can.edit && saving === "failed" && /* @__PURE__ */ (0,
|
|
9469
|
-
/* @__PURE__ */ (0,
|
|
9470
|
-
/* @__PURE__ */ (0,
|
|
9538
|
+
state.suggest && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-docs-badge", children: t.suggesting }),
|
|
9539
|
+
can.edit && saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-text-saved", title: `${t.save} (${mod}S)`, onClick: () => void save2(), children: [
|
|
9540
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.CloudAlert, { "aria-hidden": true }),
|
|
9541
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t.saveFailed })
|
|
9471
9542
|
] }),
|
|
9472
|
-
live && live.people.length > 0 && /* @__PURE__ */ (0,
|
|
9543
|
+
live && live.people.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: live.people.map((p) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) })
|
|
9473
9544
|
] });
|
|
9474
|
-
const menubar = /* @__PURE__ */ (0,
|
|
9545
|
+
const menubar = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-menus", role: "menubar", "aria-label": t.textTools, children: menus.filter(([, , list]) => list.some((x) => x && x !== "-")).map(menu) });
|
|
9475
9546
|
const keep = (e) => {
|
|
9476
9547
|
if (e.target.closest("button")) e.preventDefault();
|
|
9477
9548
|
};
|
|
@@ -9509,15 +9580,15 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9509
9580
|
if (note) return wiki.open(note.id);
|
|
9510
9581
|
if (wiki.create) void wiki.create(wikiName(target)).then((id) => id && wiki.open(id));
|
|
9511
9582
|
};
|
|
9512
|
-
return /* @__PURE__ */ (0,
|
|
9513
|
-
head2 ? /* @__PURE__ */ (0,
|
|
9514
|
-
head2.menus && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0,
|
|
9515
|
-
head2.status && status && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0,
|
|
9516
|
-
] }) : /* @__PURE__ */ (0,
|
|
9583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { ref: root, className: "w100n-text", "data-kind": kind, "data-docs-find": true, onKeyDown: keys2, children: [
|
|
9584
|
+
head2 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9585
|
+
head2.menus && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-ribbon w100n-text-docbar", onKeyDown: rove, onPointerDown: keep, children: menubar }), head2.menus),
|
|
9586
|
+
head2.status && status && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-ribbon w100n-text-docbar", onPointerDown: keep, children: status }), head2.status)
|
|
9587
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-ribbon w100n-text-top", onKeyDown: rove, onPointerDown: keep, children: [
|
|
9517
9588
|
menubar,
|
|
9518
9589
|
status
|
|
9519
9590
|
] }),
|
|
9520
|
-
/* @__PURE__ */ (0,
|
|
9591
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { ref: scroller, className: "w100n-text-scroll", "data-paint": !!paint2, onMouseUp: lay, onPointerDown: (e) => {
|
|
9521
9592
|
touch.current = e.pointerType === "touch";
|
|
9522
9593
|
}, onContextMenu: (e) => {
|
|
9523
9594
|
if (touch.current || e.shiftKey || pop === "context" || !e.target.closest(".ProseMirror")) return setPop(null);
|
|
@@ -9542,8 +9613,8 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9542
9613
|
if (!id) return;
|
|
9543
9614
|
setActive(id);
|
|
9544
9615
|
onPanel?.("comments");
|
|
9545
|
-
}, children: /* @__PURE__ */ (0,
|
|
9546
|
-
askSpot && /* @__PURE__ */ (0,
|
|
9616
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-zoomed", style: { zoom: percent / 100 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: docx2 ? `w100n-text-sheet${flow ? " is-flow" : ""}` : "w100n-docs-page w100n-text-column", style: sheet2, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react10.EditorContent, { editor }) }) }) }),
|
|
9617
|
+
askSpot && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
9547
9618
|
"span",
|
|
9548
9619
|
{
|
|
9549
9620
|
className: "w100n-text-pop w100n-text-menu w100n-wiki-ask",
|
|
@@ -9552,61 +9623,61 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9552
9623
|
style: { left: Math.min(askSpot.left, innerWidth - 340), top: askSpot.bottom + 6 },
|
|
9553
9624
|
onPointerDown: (e) => e.preventDefault(),
|
|
9554
9625
|
children: [
|
|
9555
|
-
options.map((option, i) => /* @__PURE__ */ (0,
|
|
9556
|
-
/* @__PURE__ */ (0,
|
|
9557
|
-
/* @__PURE__ */ (0,
|
|
9558
|
-
option.note.folder && /* @__PURE__ */ (0,
|
|
9559
|
-
] }) : /* @__PURE__ */ (0,
|
|
9560
|
-
/* @__PURE__ */ (0,
|
|
9561
|
-
/* @__PURE__ */ (0,
|
|
9562
|
-
/* @__PURE__ */ (0,
|
|
9626
|
+
options.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", role: "option", "aria-selected": i === Math.min(askAt, options.length - 1), onClick: () => void choose(option), children: "note" in option ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9627
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.FileText, { "aria-hidden": true }),
|
|
9628
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: option.note.name.replace(/\.(md|markdown)$/i, "") }),
|
|
9629
|
+
option.note.folder && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: option.note.folder })
|
|
9630
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9631
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Plus, { "aria-hidden": true }),
|
|
9632
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: t.wikiCreate.replace("{name}", option.make) }),
|
|
9633
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: t.wikiNew })
|
|
9563
9634
|
] }) }, "note" in option ? option.note.id : "make")),
|
|
9564
|
-
/* @__PURE__ */ (0,
|
|
9635
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { className: "w100n-text-hint", children: t.wikiKeys })
|
|
9565
9636
|
]
|
|
9566
9637
|
}
|
|
9567
9638
|
),
|
|
9568
|
-
pop === "context" && /* @__PURE__ */ (0,
|
|
9639
|
+
pop === "context" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-pop w100n-text-menu w100n-text-context", role: "menu", "aria-label": t.textTools, style: { left: spot3.x, top: spot3.y }, onPointerDown: keep, children: [
|
|
9569
9640
|
rows(near),
|
|
9570
|
-
spell && /* @__PURE__ */ (0,
|
|
9641
|
+
spell && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { className: "w100n-text-hint", children: t.spellHint })
|
|
9571
9642
|
] }),
|
|
9572
|
-
/* @__PURE__ */ (0,
|
|
9573
|
-
tool(
|
|
9643
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "left", onPointerDown: keep, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.zoom, children: [
|
|
9644
|
+
tool(import_lucide_react6.Minus, t.zoomOut, () => zoomBy(-10)),
|
|
9574
9645
|
zoomer,
|
|
9575
|
-
tool(
|
|
9646
|
+
tool(import_lucide_react6.Plus, t.zoomIn, () => zoomBy(10))
|
|
9576
9647
|
] }) }),
|
|
9577
|
-
/* @__PURE__ */ (0,
|
|
9578
|
-
context && /* @__PURE__ */ (0,
|
|
9579
|
-
extra && /* @__PURE__ */ (0,
|
|
9580
|
-
/* @__PURE__ */ (0,
|
|
9648
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-ribbon w100n-text-island", role: "toolbar", "aria-label": t.textTools, onKeyDown: rove, onPointerDown: keep, children: [
|
|
9649
|
+
context && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": state.table ? t.table : t.image, children: context }),
|
|
9650
|
+
extra && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.moreTools, children: extra }),
|
|
9651
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.textTools, children: main })
|
|
9581
9652
|
] }),
|
|
9582
|
-
/* @__PURE__ */ (0,
|
|
9583
|
-
can.edit && /* @__PURE__ */ (0,
|
|
9584
|
-
tool(
|
|
9585
|
-
tool(
|
|
9653
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "right", onPointerDown: keep, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-tools", role: "group", "aria-label": t.findReplace, children: [
|
|
9654
|
+
can.edit && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9655
|
+
tool(import_lucide_react6.Undo2, t.undo, () => editor.chain().focus().undo().run(), void 0, !state.undo),
|
|
9656
|
+
tool(import_lucide_react6.Redo2, t.redo, () => editor.chain().focus().redo().run(), void 0, !state.redo),
|
|
9586
9657
|
gap
|
|
9587
9658
|
] }),
|
|
9588
9659
|
finder
|
|
9589
9660
|
] }) }),
|
|
9590
|
-
dialog && /* @__PURE__ */ (0,
|
|
9661
|
+
dialog && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
|
|
9591
9662
|
if (e.key === "Escape") {
|
|
9592
9663
|
e.stopPropagation();
|
|
9593
9664
|
setDialog(null);
|
|
9594
9665
|
}
|
|
9595
|
-
}, children: dialog.kind === "symbol" ? /* @__PURE__ */ (0,
|
|
9596
|
-
/* @__PURE__ */ (0,
|
|
9597
|
-
/* @__PURE__ */ (0,
|
|
9598
|
-
/* @__PURE__ */ (0,
|
|
9599
|
-
/* @__PURE__ */ (0,
|
|
9666
|
+
}, children: dialog.kind === "symbol" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.symbols, children: [
|
|
9667
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-new-head", children: [
|
|
9668
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-new-tile", "data-tone": "pink", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Omega, { "aria-hidden": true }) }),
|
|
9669
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.symbols }),
|
|
9670
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.X, { "aria-hidden": true }) })
|
|
9600
9671
|
] }),
|
|
9601
|
-
/* @__PURE__ */ (0,
|
|
9602
|
-
/* @__PURE__ */ (0,
|
|
9603
|
-
/* @__PURE__ */ (0,
|
|
9672
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
9673
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Search, { "aria-hidden": true }),
|
|
9674
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { autoFocus: true, value: dialog.query, placeholder: t.symbolSearch, "aria-label": t.symbolSearch, onChange: (e) => setDialog({ kind: "symbol", query: e.target.value }) })
|
|
9604
9675
|
] }),
|
|
9605
|
-
/* @__PURE__ */ (0,
|
|
9676
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-insert-grid", role: "group", "aria-label": t.symbols, children: symbols.filter(([ch, name]) => !dialog.query.trim() || name.includes(dialog.query.trim().toLowerCase()) || ch === dialog.query.trim()).map(([ch, name]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": name, title: name, onClick: () => {
|
|
9606
9677
|
editor.chain().focus().insertContent(ch).run();
|
|
9607
9678
|
setDialog(null);
|
|
9608
9679
|
}, children: ch }, ch)) })
|
|
9609
|
-
] }) : dialog.kind === "formula" ? /* @__PURE__ */ (0,
|
|
9680
|
+
] }) : dialog.kind === "formula" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.formula, onSubmit: (e) => {
|
|
9610
9681
|
e.preventDefault();
|
|
9611
9682
|
const latex = dialog.latex.trim();
|
|
9612
9683
|
if (!latex) return;
|
|
@@ -9617,13 +9688,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9617
9688
|
else editor.chain().focus().insertContent({ type: "math", attrs: { latex } }).run();
|
|
9618
9689
|
setDialog(null);
|
|
9619
9690
|
}, children: [
|
|
9620
|
-
/* @__PURE__ */ (0,
|
|
9621
|
-
/* @__PURE__ */ (0,
|
|
9622
|
-
/* @__PURE__ */ (0,
|
|
9623
|
-
/* @__PURE__ */ (0,
|
|
9691
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-new-head", children: [
|
|
9692
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Sigma, { "aria-hidden": true }) }),
|
|
9693
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.formula }),
|
|
9694
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.X, { "aria-hidden": true }) })
|
|
9624
9695
|
] }),
|
|
9625
|
-
/* @__PURE__ */ (0,
|
|
9626
|
-
/* @__PURE__ */ (0,
|
|
9696
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { ref: field, autoFocus: true, className: "w100n-insert-latex", value: dialog.latex, "aria-label": t.formula, placeholder: "F = 900 + 12 \\\\cdot n", onChange: (e) => setDialog({ ...dialog, latex: e.target.value }) }),
|
|
9697
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-insert-tools", role: "group", "aria-label": t.formula, children: helpers.map(([label, code]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", onClick: () => {
|
|
9627
9698
|
const el = field.current;
|
|
9628
9699
|
const at2 = el.selectionStart ?? dialog.latex.length;
|
|
9629
9700
|
const latex = dialog.latex.slice(0, at2) + code + dialog.latex.slice(el.selectionEnd ?? at2);
|
|
@@ -9634,15 +9705,15 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9634
9705
|
el.setSelectionRange(caret, caret);
|
|
9635
9706
|
});
|
|
9636
9707
|
}, children: label }, label)) }),
|
|
9637
|
-
/* @__PURE__ */ (0,
|
|
9638
|
-
/* @__PURE__ */ (0,
|
|
9639
|
-
/* @__PURE__ */ (0,
|
|
9640
|
-
/* @__PURE__ */ (0,
|
|
9641
|
-
/* @__PURE__ */ (0,
|
|
9708
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-insert-preview", "aria-live": "polite", dangerouslySetInnerHTML: { __html: dialog.latex.trim() ? mathml(dialog.latex) : "" } }),
|
|
9709
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
9710
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
|
|
9711
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.latex.trim(), children: [
|
|
9712
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { "aria-hidden": true }),
|
|
9642
9713
|
dialog.at !== null ? t.update : t.put
|
|
9643
9714
|
] })
|
|
9644
9715
|
] })
|
|
9645
|
-
] }) : /* @__PURE__ */ (0,
|
|
9716
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.footnote, onSubmit: (e) => {
|
|
9646
9717
|
e.preventDefault();
|
|
9647
9718
|
const text = dialog.text.trim();
|
|
9648
9719
|
if (!text) return;
|
|
@@ -9659,12 +9730,12 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9659
9730
|
}
|
|
9660
9731
|
setDialog(null);
|
|
9661
9732
|
}, children: [
|
|
9662
|
-
/* @__PURE__ */ (0,
|
|
9663
|
-
/* @__PURE__ */ (0,
|
|
9664
|
-
/* @__PURE__ */ (0,
|
|
9665
|
-
/* @__PURE__ */ (0,
|
|
9733
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-new-head", children: [
|
|
9734
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-new-tile", "data-tone": "violet", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Superscript, { "aria-hidden": true }) }),
|
|
9735
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.footnote }),
|
|
9736
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.X, { "aria-hidden": true }) })
|
|
9666
9737
|
] }),
|
|
9667
|
-
/* @__PURE__ */ (0,
|
|
9738
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
9668
9739
|
"textarea",
|
|
9669
9740
|
{
|
|
9670
9741
|
autoFocus: true,
|
|
@@ -9678,40 +9749,40 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9678
9749
|
}
|
|
9679
9750
|
}
|
|
9680
9751
|
),
|
|
9681
|
-
/* @__PURE__ */ (0,
|
|
9682
|
-
dialog.at !== null && /* @__PURE__ */ (0,
|
|
9752
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
9753
|
+
dialog.at !== null && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
|
|
9683
9754
|
editor.chain().focus().deleteRange({ from: dialog.at, to: dialog.at + 1 }).run();
|
|
9684
9755
|
setDialog(null);
|
|
9685
9756
|
}, children: t.removeFootnote }),
|
|
9686
|
-
/* @__PURE__ */ (0,
|
|
9687
|
-
/* @__PURE__ */ (0,
|
|
9688
|
-
/* @__PURE__ */ (0,
|
|
9757
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
|
|
9758
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.text.trim(), children: [
|
|
9759
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { "aria-hidden": true }),
|
|
9689
9760
|
dialog.at !== null ? t.update : t.put
|
|
9690
9761
|
] })
|
|
9691
9762
|
] })
|
|
9692
9763
|
] }) }),
|
|
9693
|
-
draft2 && /* @__PURE__ */ (0,
|
|
9764
|
+
draft2 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
|
|
9694
9765
|
if (e.key === "Escape") {
|
|
9695
9766
|
e.stopPropagation();
|
|
9696
9767
|
setDraft2(null);
|
|
9697
9768
|
}
|
|
9698
|
-
}, children: /* @__PURE__ */ (0,
|
|
9769
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("form", { className: "w100n-pdf-dialog w100n-setup", role: "dialog", "aria-modal": true, "aria-label": t.pageSetup, onSubmit: (e) => {
|
|
9699
9770
|
e.preventDefault();
|
|
9700
9771
|
applySetup();
|
|
9701
9772
|
}, children: [
|
|
9702
|
-
/* @__PURE__ */ (0,
|
|
9703
|
-
/* @__PURE__ */ (0,
|
|
9704
|
-
/* @__PURE__ */ (0,
|
|
9705
|
-
/* @__PURE__ */ (0,
|
|
9773
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-new-head", children: [
|
|
9774
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Ruler, { "aria-hidden": true }) }),
|
|
9775
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { className: "w100n-pdf-dialog-title", children: t.pageSetup }),
|
|
9776
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => setDraft2(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.X, { "aria-hidden": true }) })
|
|
9706
9777
|
] }),
|
|
9707
|
-
/* @__PURE__ */ (0,
|
|
9708
|
-
/* @__PURE__ */ (0,
|
|
9778
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "w100n-docs-caption", children: t.pageSize }),
|
|
9779
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.pageSize, children: [["A4", a4], ["Letter", letter], ["Legal", legal]].map(([label, size2]) => {
|
|
9709
9780
|
const land = draft2.width > draft2.height;
|
|
9710
9781
|
const on2 = Math.abs(Math.min(draft2.width, draft2.height) - size2.width) < 2 && Math.abs(Math.max(draft2.width, draft2.height) - size2.height) < 2;
|
|
9711
|
-
return /* @__PURE__ */ (0,
|
|
9782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-pressed": on2, onClick: () => setDraft2({ ...draft2, width: land ? size2.height : size2.width, height: land ? size2.width : size2.height }), children: label }, label);
|
|
9712
9783
|
}) }),
|
|
9713
|
-
/* @__PURE__ */ (0,
|
|
9714
|
-
/* @__PURE__ */ (0,
|
|
9784
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "w100n-docs-caption", children: t.orientation }),
|
|
9785
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.orientation, children: [[false, t.portrait], [true, t.landscape]].map(([land, label]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
9715
9786
|
"button",
|
|
9716
9787
|
{
|
|
9717
9788
|
type: "button",
|
|
@@ -9723,11 +9794,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9723
9794
|
},
|
|
9724
9795
|
label
|
|
9725
9796
|
)) }),
|
|
9726
|
-
/* @__PURE__ */ (0,
|
|
9727
|
-
/* @__PURE__ */ (0,
|
|
9728
|
-
/* @__PURE__ */ (0,
|
|
9729
|
-
/* @__PURE__ */ (0,
|
|
9730
|
-
/* @__PURE__ */ (0,
|
|
9797
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "w100n-docs-caption", children: t.marginsCm }),
|
|
9798
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.margins, children: margins.map(([label, values]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-pressed": values.every((v, n) => Math.abs(cm(v) - draft2.margins[n]) < 0.05), onClick: () => setDraft2({ ...draft2, margins: values.map(cm) }), children: label }, label)) }),
|
|
9799
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w100n-setup-grid", children: [t.mTop, t.mRight, t.mBottom, t.mLeft].map((label, n) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
|
|
9800
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: label }),
|
|
9801
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
9731
9802
|
"input",
|
|
9732
9803
|
{
|
|
9733
9804
|
className: "w100n-docs-field",
|
|
@@ -9740,111 +9811,111 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9740
9811
|
}
|
|
9741
9812
|
)
|
|
9742
9813
|
] }, n)) }),
|
|
9743
|
-
/* @__PURE__ */ (0,
|
|
9744
|
-
/* @__PURE__ */ (0,
|
|
9745
|
-
/* @__PURE__ */ (0,
|
|
9814
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "w100n-setup-line", children: [
|
|
9815
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t.headerText }),
|
|
9816
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { className: "w100n-docs-field", value: draft2.header, onChange: (e) => setDraft2({ ...draft2, header: e.target.value }) })
|
|
9746
9817
|
] }),
|
|
9747
|
-
/* @__PURE__ */ (0,
|
|
9748
|
-
/* @__PURE__ */ (0,
|
|
9749
|
-
/* @__PURE__ */ (0,
|
|
9818
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "w100n-setup-line", children: [
|
|
9819
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: t.footerText }),
|
|
9820
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { className: "w100n-docs-field", value: draft2.footer, onChange: (e) => setDraft2({ ...draft2, footer: e.target.value }) })
|
|
9750
9821
|
] }),
|
|
9751
|
-
/* @__PURE__ */ (0,
|
|
9752
|
-
/* @__PURE__ */ (0,
|
|
9822
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "w100n-setup-check", children: [
|
|
9823
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "checkbox", checked: draft2.numbers, onChange: (e) => setDraft2({ ...draft2, numbers: e.target.checked }) }),
|
|
9753
9824
|
t.pageNumbers
|
|
9754
9825
|
] }),
|
|
9755
|
-
/* @__PURE__ */ (0,
|
|
9756
|
-
/* @__PURE__ */ (0,
|
|
9757
|
-
/* @__PURE__ */ (0,
|
|
9758
|
-
/* @__PURE__ */ (0,
|
|
9826
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-pdf-dialog-end", children: [
|
|
9827
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDraft2(null), children: t.cancel }),
|
|
9828
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: applySetup, children: [
|
|
9829
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { "aria-hidden": true }),
|
|
9759
9830
|
t.apply
|
|
9760
9831
|
] })
|
|
9761
9832
|
] })
|
|
9762
9833
|
] }) }),
|
|
9763
|
-
slot && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0,
|
|
9764
|
-
draft && /* @__PURE__ */ (0,
|
|
9765
|
-
/* @__PURE__ */ (0,
|
|
9766
|
-
/* @__PURE__ */ (0,
|
|
9767
|
-
tagged(draft.body, people).length > 0 && /* @__PURE__ */ (0,
|
|
9768
|
-
/* @__PURE__ */ (0,
|
|
9834
|
+
slot && (0, import_react_dom2.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-notes", children: [
|
|
9835
|
+
draft && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-card w100n-text-draft", children: [
|
|
9836
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("blockquote", { children: draft.quote }),
|
|
9837
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Mentions, { autoFocus: true, value: draft.body, placeholder: t.writeComment, label: t.writeComment, people, onChange: (body) => setDraft({ ...draft, body }), onSend: () => void post() }),
|
|
9838
|
+
tagged(draft.body, people).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "w100n-setup-check", children: [
|
|
9839
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "checkbox", checked: draft.give, onChange: (e) => setDraft({ ...draft, give: e.target.checked }) }),
|
|
9769
9840
|
t.assignTo.replace("{name}", tagged(draft.body, people)[0].name)
|
|
9770
9841
|
] }),
|
|
9771
|
-
/* @__PURE__ */ (0,
|
|
9772
|
-
/* @__PURE__ */ (0,
|
|
9773
|
-
/* @__PURE__ */ (0,
|
|
9774
|
-
/* @__PURE__ */ (0,
|
|
9842
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
9843
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: drop2, children: t.cancel }),
|
|
9844
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !draft.body.trim() || posting === "busy", onClick: () => void post(), children: [
|
|
9845
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.MessageSquarePlus, { "aria-hidden": true }),
|
|
9775
9846
|
t.post
|
|
9776
9847
|
] })
|
|
9777
9848
|
] })
|
|
9778
9849
|
] }),
|
|
9779
|
-
suggested.length > 0 && /* @__PURE__ */ (0,
|
|
9780
|
-
/* @__PURE__ */ (0,
|
|
9781
|
-
/* @__PURE__ */ (0,
|
|
9850
|
+
suggested.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
9851
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
9852
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.FilePenLine, { "aria-hidden": true }),
|
|
9782
9853
|
t.suggestions,
|
|
9783
|
-
/* @__PURE__ */ (0,
|
|
9854
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: suggested.length })
|
|
9784
9855
|
] }),
|
|
9785
|
-
suggested.map((c, i) => /* @__PURE__ */ (0,
|
|
9786
|
-
/* @__PURE__ */ (0,
|
|
9787
|
-
/* @__PURE__ */ (0,
|
|
9788
|
-
/* @__PURE__ */ (0,
|
|
9789
|
-
/* @__PURE__ */ (0,
|
|
9790
|
-
c.date && /* @__PURE__ */ (0,
|
|
9856
|
+
suggested.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("article", { className: "w100n-text-card w100n-text-change", "data-kind": c.kind, onClick: () => jump(c.from), children: [
|
|
9857
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { children: [
|
|
9858
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: (c.author || "?").slice(0, 1).toUpperCase() }),
|
|
9859
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-who", children: [
|
|
9860
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("b", { children: c.author || t.someone }),
|
|
9861
|
+
c.date && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: when(c.date) })
|
|
9791
9862
|
] })
|
|
9792
9863
|
] }),
|
|
9793
|
-
/* @__PURE__ */ (0,
|
|
9864
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { children: [
|
|
9794
9865
|
c.kind === "insertion" ? t.added : t.removed,
|
|
9795
9866
|
" ",
|
|
9796
|
-
/* @__PURE__ */ (0,
|
|
9867
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("q", { children: c.text })
|
|
9797
9868
|
] }),
|
|
9798
|
-
can.edit && /* @__PURE__ */ (0,
|
|
9799
|
-
/* @__PURE__ */ (0,
|
|
9800
|
-
/* @__PURE__ */ (0,
|
|
9869
|
+
can.edit && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
|
|
9870
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => decide(editor, true, c.id), children: [
|
|
9871
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { "aria-hidden": true }),
|
|
9801
9872
|
t.accept
|
|
9802
9873
|
] }),
|
|
9803
|
-
/* @__PURE__ */ (0,
|
|
9804
|
-
/* @__PURE__ */ (0,
|
|
9874
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => decide(editor, false, c.id), children: [
|
|
9875
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.X, { "aria-hidden": true }),
|
|
9805
9876
|
t.reject
|
|
9806
9877
|
] })
|
|
9807
9878
|
] })
|
|
9808
9879
|
] }, i))
|
|
9809
9880
|
] }),
|
|
9810
|
-
posting === "failed" && /* @__PURE__ */ (0,
|
|
9811
|
-
failed && /* @__PURE__ */ (0,
|
|
9812
|
-
/* @__PURE__ */ (0,
|
|
9813
|
-
/* @__PURE__ */ (0,
|
|
9814
|
-
/* @__PURE__ */ (0,
|
|
9881
|
+
posting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.commentFailed }),
|
|
9882
|
+
failed && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.changeFailed }),
|
|
9883
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-docs-row", children: [
|
|
9884
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
9885
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.MessagesSquare, { "aria-hidden": true }),
|
|
9815
9886
|
t.comments,
|
|
9816
|
-
/* @__PURE__ */ (0,
|
|
9887
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: open.length })
|
|
9817
9888
|
] }),
|
|
9818
|
-
/* @__PURE__ */ (0,
|
|
9889
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-docs-chips", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-pressed": resolved, onClick: () => setResolved(!resolved), children: t.showResolved }) })
|
|
9819
9890
|
] }),
|
|
9820
|
-
!threads.length && !draft && /* @__PURE__ */ (0,
|
|
9821
|
-
threads.map((c) => /* @__PURE__ */ (0,
|
|
9891
|
+
!threads.length && !draft && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "w100n-docs-muted", children: can.comment ? t.commentHint : t.noComments }),
|
|
9892
|
+
threads.map((c) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("article", { className: "w100n-text-card", "aria-current": active === c.id, "data-resolved": c.resolved, onClick: () => show(c), children: [
|
|
9822
9893
|
person(c),
|
|
9823
|
-
c.assignee && /* @__PURE__ */ (0,
|
|
9824
|
-
c.quote && /* @__PURE__ */ (0,
|
|
9894
|
+
c.assignee && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-text-given", "data-me": c.assignee.id === host?.me.id, children: c.assignee.id === host?.me.id ? t.assignedYou : t.assignedTo.replace("{name}", c.assignee.name) }),
|
|
9895
|
+
c.quote && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("blockquote", { children: c.quote }),
|
|
9825
9896
|
words3(c),
|
|
9826
|
-
all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */ (0,
|
|
9897
|
+
all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-reply", children: [
|
|
9827
9898
|
person(r),
|
|
9828
9899
|
words3(r)
|
|
9829
9900
|
] }, r.id)),
|
|
9830
|
-
reply?.id === c.id && /* @__PURE__ */ (0,
|
|
9831
|
-
/* @__PURE__ */ (0,
|
|
9832
|
-
/* @__PURE__ */ (0,
|
|
9833
|
-
/* @__PURE__ */ (0,
|
|
9834
|
-
/* @__PURE__ */ (0,
|
|
9835
|
-
/* @__PURE__ */ (0,
|
|
9901
|
+
reply?.id === c.id && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-text-reply", onClick: (e) => e.stopPropagation(), children: [
|
|
9902
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Mentions, { autoFocus: true, value: reply.body, placeholder: t.writeComment, label: t.reply, people, onChange: (body) => setReply({ ...reply, body }), onSend: () => void answer(c) }),
|
|
9903
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
9904
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setReply(null), children: t.cancel }),
|
|
9905
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !reply.body.trim() || posting === "busy", onClick: () => void answer(c), children: [
|
|
9906
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Reply, { "aria-hidden": true }),
|
|
9836
9907
|
t.reply
|
|
9837
9908
|
] })
|
|
9838
9909
|
] })
|
|
9839
9910
|
] }),
|
|
9840
|
-
can.comment && reply?.id !== c.id && /* @__PURE__ */ (0,
|
|
9841
|
-
c.resolved && /* @__PURE__ */ (0,
|
|
9842
|
-
!c.resolved && /* @__PURE__ */ (0,
|
|
9843
|
-
/* @__PURE__ */ (0,
|
|
9911
|
+
can.comment && reply?.id !== c.id && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
|
|
9912
|
+
c.resolved && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w100n-docs-badge", children: t.resolved }),
|
|
9913
|
+
!c.resolved && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: () => setReply({ id: c.id, body: "" }), children: [
|
|
9914
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Reply, { "aria-hidden": true }),
|
|
9844
9915
|
t.reply
|
|
9845
9916
|
] }),
|
|
9846
|
-
host?.resolveComment && /* @__PURE__ */ (0,
|
|
9847
|
-
c.resolved ? /* @__PURE__ */ (0,
|
|
9917
|
+
host?.resolveComment && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => void settle2(c), children: [
|
|
9918
|
+
c.resolved ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.RotateCcw, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react6.Check, { "aria-hidden": true }),
|
|
9848
9919
|
c.resolved ? t.reopen : t.resolve
|
|
9849
9920
|
] })
|
|
9850
9921
|
] })
|
|
@@ -9852,12 +9923,12 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
9852
9923
|
] }), slot)
|
|
9853
9924
|
] });
|
|
9854
9925
|
}
|
|
9855
|
-
var import_react10,
|
|
9926
|
+
var import_react10, import_lucide_react6, import_react11, import_react_dom2, import_jsx_runtime8, legal, symbols, helpers, cm, glows, faces, sizes, uid2;
|
|
9856
9927
|
var init_TextEditor = __esm({
|
|
9857
9928
|
"src/editor/TextEditor.tsx"() {
|
|
9858
9929
|
"use strict";
|
|
9859
9930
|
import_react10 = require("@tiptap/react");
|
|
9860
|
-
|
|
9931
|
+
import_lucide_react6 = require("lucide-react");
|
|
9861
9932
|
import_react11 = require("react");
|
|
9862
9933
|
import_react_dom2 = require("react-dom");
|
|
9863
9934
|
init_docx();
|
|
@@ -9871,7 +9942,8 @@ var init_TextEditor = __esm({
|
|
|
9871
9942
|
init_math();
|
|
9872
9943
|
init_Mentions();
|
|
9873
9944
|
init_pager();
|
|
9874
|
-
|
|
9945
|
+
init_Swatches();
|
|
9946
|
+
import_jsx_runtime8 = require("react/jsx-runtime");
|
|
9875
9947
|
legal = { width: 816, height: 1344 };
|
|
9876
9948
|
symbols = [
|
|
9877
9949
|
["\xA9", "copyright"],
|
|
@@ -9927,7 +9999,6 @@ var init_TextEditor = __esm({
|
|
|
9927
9999
|
];
|
|
9928
10000
|
helpers = [["x\xB2", "^{2}"], ["x\u2099", "_{n}"], ["\u221Ax", "\\sqrt{}"], ["a/b", "\\frac{}{}"], ["\u2211", "\\sum_{}^{}"], ["\u222B", "\\int "], ["\u03C0", "\\pi "], ["\u2264", "\\le "], ["\u2265", "\\ge "], ["\u2260", "\\ne "], ["\xB1", "\\pm "], ["\xB7", "\\cdot "]];
|
|
9929
10001
|
cm = (px2) => Math.round(px2 / 96 * 254) / 100;
|
|
9930
|
-
inks = ["#0f172a", "#475569", "#dc2626", "#ea580c", "#ca8a04", "#16a34a", "#0891b2", "#2563eb", "#7c3aed", "#db2777"];
|
|
9931
10002
|
glows = ["#fef08a", "#bbf7d0", "#bfdbfe", "#fbcfe8", "#fed7aa", "#ddd6fe"];
|
|
9932
10003
|
faces = ["Arial", "Calibri", "Cambria", "Courier New", "Georgia", "Inter", "Roboto", "Times New Roman", "Verdana"];
|
|
9933
10004
|
sizes = [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72];
|
|
@@ -10088,7 +10159,7 @@ function bind(api, injector, doc, model, edit) {
|
|
|
10088
10159
|
if (canon(now) === canon(empty)) m.delete(name);
|
|
10089
10160
|
else m.set(name, now);
|
|
10090
10161
|
};
|
|
10091
|
-
const
|
|
10162
|
+
const fit2 = (list, now) => {
|
|
10092
10163
|
if (list.length > now.length) list.delete(now.length, list.length - now.length);
|
|
10093
10164
|
else if (list.length < now.length) list.push(now.slice(list.length));
|
|
10094
10165
|
};
|
|
@@ -10171,10 +10242,10 @@ function bind(api, injector, doc, model, edit) {
|
|
|
10171
10242
|
return shift(cols, p.sourceRange.startColumn, count(p.sourceRange, false), p.targetRange.startColumn);
|
|
10172
10243
|
case "sheet.mutation.set-worksheet-row-count":
|
|
10173
10244
|
at2.delete(sid);
|
|
10174
|
-
return
|
|
10245
|
+
return fit2(rows, l.rows);
|
|
10175
10246
|
case "sheet.mutation.set-worksheet-column-count":
|
|
10176
10247
|
at2.delete(sid);
|
|
10177
|
-
return
|
|
10248
|
+
return fit2(cols, l.cols);
|
|
10178
10249
|
case "sheet.mutation.set-worksheet-row-height":
|
|
10179
10250
|
case "sheet.mutation.set-worksheet-row-is-auto-height":
|
|
10180
10251
|
case "sheet.mutation.set-row-hidden":
|
|
@@ -10460,6 +10531,7 @@ var init_calm = __esm({
|
|
|
10460
10531
|
var grid_exports = {};
|
|
10461
10532
|
__export(grid_exports, {
|
|
10462
10533
|
bolder: () => bolder,
|
|
10534
|
+
fit: () => fit,
|
|
10463
10535
|
grid: () => grid2,
|
|
10464
10536
|
marks: () => marks
|
|
10465
10537
|
});
|
|
@@ -10490,6 +10562,29 @@ function grid2(container, language, edit) {
|
|
|
10490
10562
|
]
|
|
10491
10563
|
});
|
|
10492
10564
|
}
|
|
10565
|
+
function fit(injector, unitId) {
|
|
10566
|
+
const book = injector.get(import_core6.IUniverInstanceService).getUnit(unitId);
|
|
10567
|
+
const skeletons = injector.get(import_preset_sheets_core.IRenderManagerService).getRenderUnitById(unitId)?.with(import_preset_sheets_core.SheetSkeletonManagerService);
|
|
10568
|
+
if (!book || !skeletons) return;
|
|
10569
|
+
const commands = injector.get(import_core6.ICommandService);
|
|
10570
|
+
for (const sheet2 of book.getSheets()) {
|
|
10571
|
+
const rows = /* @__PURE__ */ new Set();
|
|
10572
|
+
sheet2.getCellMatrix().forValue((r, _, cell2) => {
|
|
10573
|
+
if (book.getStyles().getStyleByCell(cell2)?.tb === import_core6.WrapStrategy.WRAP) rows.add(r);
|
|
10574
|
+
});
|
|
10575
|
+
if (!rows.size) continue;
|
|
10576
|
+
const subUnitId = sheet2.getSheetId(), last2 = sheet2.getMaxColumns() - 1, all = [...rows];
|
|
10577
|
+
const line = (r) => ({ startRow: r, endRow: r, startColumn: 0, endColumn: last2 });
|
|
10578
|
+
const was = Object.fromEntries(all.map((r) => [r, sheet2.getConfig().rowData[r]?.ia ?? null]));
|
|
10579
|
+
const stored2 = Object.fromEntries(all.map((r) => [r, sheet2.getRowHeight(r)]));
|
|
10580
|
+
const auto = (list, info) => commands.syncExecuteCommand(import_preset_sheets_core.SetWorksheetRowIsAutoHeightMutation.id, { unitId, subUnitId, ranges: list.map(line), autoHeightInfo: info }, { onlyLocal: true });
|
|
10581
|
+
auto(all, 1);
|
|
10582
|
+
const grow2 = (skeletons.ensureSkeleton(subUnitId)?.calculateAutoHeightInRange(all.map(line)) ?? []).filter((x) => (x.autoHeight ?? 0) > stored2[x.row]);
|
|
10583
|
+
const keep = all.filter((r) => !grow2.some((x) => x.row === r));
|
|
10584
|
+
if (keep.length) auto(keep, was);
|
|
10585
|
+
if (grow2.length) commands.syncExecuteCommand(import_preset_sheets_core.SetWorksheetRowAutoHeightMutation.id, { unitId, subUnitId, rowsAutoHeightInfo: grow2 }, { onlyLocal: true });
|
|
10586
|
+
}
|
|
10587
|
+
}
|
|
10493
10588
|
function marks({ univer, univerAPI: api }) {
|
|
10494
10589
|
const service = univer.__getInjector().get(import_preset_sheets_core.IMarkSelectionService);
|
|
10495
10590
|
let list = [];
|
|
@@ -10515,7 +10610,7 @@ function marks({ univer, univerAPI: api }) {
|
|
|
10515
10610
|
}
|
|
10516
10611
|
};
|
|
10517
10612
|
}
|
|
10518
|
-
var import_lib, import_lib2, import_lib3, import_lib4, import_lib5, import_lib6, import_presets, import_preset_sheets_core, import_preset_sheets_data_validation, import_preset_sheets_filter, import_preset_sheets_find_replace, import_preset_sheets_note, import_preset_sheets_sort, import_en_US, import_pl_PL, import_en_US2, import_pl_PL2, import_en_US3, import_pl_PL3, import_en_US4, import_pl_PL4, import_en_US5, import_pl_PL5, import_en_US6, import_pl_PL6, draw;
|
|
10613
|
+
var import_lib, import_lib2, import_lib3, import_lib4, import_lib5, import_lib6, import_presets, import_core6, import_preset_sheets_core, import_preset_sheets_data_validation, import_preset_sheets_filter, import_preset_sheets_find_replace, import_preset_sheets_note, import_preset_sheets_sort, import_en_US, import_pl_PL, import_en_US2, import_pl_PL2, import_en_US3, import_pl_PL3, import_en_US4, import_pl_PL4, import_en_US5, import_pl_PL5, import_en_US6, import_pl_PL6, draw;
|
|
10519
10614
|
var init_grid = __esm({
|
|
10520
10615
|
"src/sheets/grid.ts"() {
|
|
10521
10616
|
"use strict";
|
|
@@ -10526,6 +10621,7 @@ var init_grid = __esm({
|
|
|
10526
10621
|
import_lib5 = require("@univerjs/preset-sheets-data-validation/lib/index.css");
|
|
10527
10622
|
import_lib6 = require("@univerjs/preset-sheets-note/lib/index.css");
|
|
10528
10623
|
import_presets = require("@univerjs/presets");
|
|
10624
|
+
import_core6 = require("@univerjs/core");
|
|
10529
10625
|
import_preset_sheets_core = require("@univerjs/preset-sheets-core");
|
|
10530
10626
|
import_preset_sheets_data_validation = require("@univerjs/preset-sheets-data-validation");
|
|
10531
10627
|
import_preset_sheets_filter = require("@univerjs/preset-sheets-filter");
|
|
@@ -10561,6 +10657,7 @@ __export(SheetView_exports, {
|
|
|
10561
10657
|
decimals: () => decimals,
|
|
10562
10658
|
default: () => SheetView_default,
|
|
10563
10659
|
readSheet: () => readSheet,
|
|
10660
|
+
sized: () => sized,
|
|
10564
10661
|
writeSheet: () => writeSheet
|
|
10565
10662
|
});
|
|
10566
10663
|
function autoSum(r, numeric2) {
|
|
@@ -10591,6 +10688,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10591
10688
|
const [refusal, setRefusal] = (0, import_react12.useState)(null);
|
|
10592
10689
|
const [pop, setPop] = (0, import_react12.useState)(null);
|
|
10593
10690
|
const [look, setLook] = (0, import_react12.useState)(null);
|
|
10691
|
+
const [size2, setSize] = (0, import_react12.useState)(null);
|
|
10594
10692
|
const edit = rights.edit && !!onSaveRequest && (!room || !!shared && !room.readonly);
|
|
10595
10693
|
const notes3 = !edit && rights.comment && !!onSaveRequest && !room;
|
|
10596
10694
|
(0, import_react12.useEffect)(() => {
|
|
@@ -10614,7 +10712,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10614
10712
|
setDirty(false);
|
|
10615
10713
|
const families = new Set([model.book.defaultStyle, ...Object.values(model.book.styles)].map((s) => typeof s === "object" ? s?.ff : null).filter(Boolean));
|
|
10616
10714
|
const fonts = Promise.race([Promise.all([...families].flatMap((f) => ["", "bold ", "italic "].map((w) => document.fonts.load(`${w}11pt "${f}"`).catch(() => [])))), new Promise((r) => setTimeout(r, 800))]);
|
|
10617
|
-
Promise.all([Promise.resolve().then(() => (init_grid(), grid_exports)), fonts]).then(([{ bolder: bolder2, grid: grid3, marks: marks2 }]) => {
|
|
10715
|
+
Promise.all([Promise.resolve().then(() => (init_grid(), grid_exports)), fonts]).then(([{ bolder: bolder2, fit: fit2, grid: grid3, marks: marks2 }]) => {
|
|
10618
10716
|
if (gone) return;
|
|
10619
10717
|
shared?.doc.off("update", change);
|
|
10620
10718
|
if (shared && moved) model = extras(shared.doc, build(shared.doc));
|
|
@@ -10627,6 +10725,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10627
10725
|
const unbold = bolder2(univer.__getInjector());
|
|
10628
10726
|
if (model.active) wb.setActiveSheet(model.active);
|
|
10629
10727
|
if (!edit) wb.setEditable(false);
|
|
10728
|
+
const fitting = setTimeout(() => fit2(univer.__getInjector(), wb.getId()));
|
|
10630
10729
|
const state = { api: api2, model, original: bytes, changes: 0 };
|
|
10631
10730
|
const untrack = track2(api2, model, { view: true, comment: notes3, edit }, () => {
|
|
10632
10731
|
state.changes++;
|
|
@@ -10654,7 +10753,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10654
10753
|
last2 = JSON.stringify(here);
|
|
10655
10754
|
people.setLocalStateField("selection", here);
|
|
10656
10755
|
}
|
|
10657
|
-
setLook({ bl: s.bl === 1, it: s.it === 1, ul: !!s.ul?.s, st: !!s.st?.s, ht: s.ht ?? 0, tb: s.tb === 3, merged: range2.isMerged() || range2.isPartOfMerge(), n: s.n?.pattern ?? "General", cl: s.cl?.rgb ?? "", bg: s.bg?.rgb ?? "" });
|
|
10756
|
+
setLook({ bl: s.bl === 1, it: s.it === 1, ul: !!s.ul?.s, st: !!s.st?.s, fs: s.fs ?? 11, ht: s.ht ?? 0, tb: s.tb === 3, merged: range2.isMerged() || range2.isPartOfMerge(), n: s.n?.pattern ?? "General", cl: s.cl?.rgb ?? "", bg: s.bg?.rgb ?? "" });
|
|
10658
10757
|
};
|
|
10659
10758
|
const later = () => {
|
|
10660
10759
|
if (!frame) frame = requestAnimationFrame(refresh);
|
|
@@ -10670,6 +10769,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10670
10769
|
selection.dispose();
|
|
10671
10770
|
commands.dispose();
|
|
10672
10771
|
cancelAnimationFrame(frame);
|
|
10772
|
+
clearTimeout(fitting);
|
|
10673
10773
|
host2.hidden = true;
|
|
10674
10774
|
setTimeout(() => {
|
|
10675
10775
|
univer.dispose();
|
|
@@ -10763,15 +10863,15 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10763
10863
|
setPop(null);
|
|
10764
10864
|
}
|
|
10765
10865
|
};
|
|
10766
|
-
const tool = (Icon, label, onClick, pressed) => /* @__PURE__ */ (0,
|
|
10767
|
-
const gap = /* @__PURE__ */ (0,
|
|
10768
|
-
const anchor = (key2, trigger, body) => /* @__PURE__ */ (0,
|
|
10866
|
+
const tool = (Icon, label, onClick, pressed) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled: phase !== "ready", onClick, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { "aria-hidden": true }) });
|
|
10867
|
+
const gap = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-sheet-gap" });
|
|
10868
|
+
const anchor = (key2, trigger, body) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "w100n-sheet-anchor", children: [
|
|
10769
10869
|
trigger,
|
|
10770
|
-
pop === key2 && /* @__PURE__ */ (0,
|
|
10870
|
+
pop === key2 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-sheet-pop", role: "dialog", children: body })
|
|
10771
10871
|
] });
|
|
10772
|
-
const opener = (key2, Icon, label, bar) => /* @__PURE__ */ (0,
|
|
10773
|
-
/* @__PURE__ */ (0,
|
|
10774
|
-
bar !== void 0 && /* @__PURE__ */ (0,
|
|
10872
|
+
const opener = (key2, Icon, label, bar) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", "aria-label": label, title: label, "aria-expanded": pop === key2, disabled: phase !== "ready", onClick: () => setPop(pop === key2 ? null : key2), children: [
|
|
10873
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { "aria-hidden": true }),
|
|
10874
|
+
bar !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("i", { className: "w100n-sheet-bar", style: { background: bar || "currentColor" } })
|
|
10775
10875
|
] });
|
|
10776
10876
|
const currency = language === "pl" ? '#,##0.00 "z\u0142"' : language === "uk" ? '#,##0.00 "\u20B4"' : '"$"#,##0.00';
|
|
10777
10877
|
const formats = [
|
|
@@ -10788,7 +10888,7 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10788
10888
|
const sum = () => {
|
|
10789
10889
|
const r = range()?.getRange();
|
|
10790
10890
|
const ws = sheet2();
|
|
10791
|
-
const numeric2 = (row2, c) => ws?.getRange(row2, c).getCellData()?.t ===
|
|
10891
|
+
const numeric2 = (row2, c) => ws?.getRange(row2, c).getCellData()?.t === import_core7.CellValueType.NUMBER;
|
|
10792
10892
|
if (r && ws) for (const x of autoSum(r, numeric2)) ws.getRange(x.row, x.col).setValue({ f: x.f });
|
|
10793
10893
|
};
|
|
10794
10894
|
const shown = formats.find(([, p]) => p === look?.n)?.[0] ?? (look && look.n !== "General" ? look.n : t.general);
|
|
@@ -10803,22 +10903,18 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10803
10903
|
if (rows) ws.deleteRows(r.startRow, r.endRow - r.startRow + 1);
|
|
10804
10904
|
else ws.deleteColumns(r.startColumn, r.endColumn - r.startColumn + 1);
|
|
10805
10905
|
};
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "w100n-sheet-none", onClick: reset, children: none })
|
|
10809
|
-
] });
|
|
10810
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-sheet", "data-theme": theme, onKeyDownCapture: keys2, children: [
|
|
10811
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w100n-sheet-ribbon", role: "toolbar", "aria-label": t.tools, onKeyDown: rove, onPointerDown: (e) => {
|
|
10906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-sheet", "data-theme": theme, onKeyDownCapture: keys2, children: [
|
|
10907
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-sheet-ribbon", role: "toolbar", "aria-label": t.tools, onKeyDown: rove, onPointerDown: (e) => {
|
|
10812
10908
|
if (e.target.closest("button")) e.preventDefault();
|
|
10813
10909
|
}, children: [
|
|
10814
|
-
/* @__PURE__ */ (0,
|
|
10815
|
-
edit && /* @__PURE__ */ (0,
|
|
10816
|
-
tool(
|
|
10817
|
-
tool(
|
|
10910
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-sheet-tools", children: [
|
|
10911
|
+
edit && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
10912
|
+
tool(import_lucide_react7.Undo2, t.undo, () => void api()?.undo()),
|
|
10913
|
+
tool(import_lucide_react7.Redo2, t.redo, () => void api()?.redo()),
|
|
10818
10914
|
gap,
|
|
10819
10915
|
anchor(
|
|
10820
10916
|
"format",
|
|
10821
|
-
/* @__PURE__ */ (0,
|
|
10917
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
10822
10918
|
"button",
|
|
10823
10919
|
{
|
|
10824
10920
|
type: "button",
|
|
@@ -10829,12 +10925,12 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10829
10925
|
disabled: phase !== "ready",
|
|
10830
10926
|
onClick: () => setPop(pop === "format" ? null : "format"),
|
|
10831
10927
|
children: [
|
|
10832
|
-
/* @__PURE__ */ (0,
|
|
10833
|
-
/* @__PURE__ */ (0,
|
|
10928
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: shown }),
|
|
10929
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.ChevronDown, { "aria-hidden": true })
|
|
10834
10930
|
]
|
|
10835
10931
|
}
|
|
10836
10932
|
),
|
|
10837
|
-
/* @__PURE__ */ (0,
|
|
10933
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-sheet-list", children: formats.map(([label, pattern], i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
10838
10934
|
"button",
|
|
10839
10935
|
{
|
|
10840
10936
|
type: "button",
|
|
@@ -10845,123 +10941,139 @@ function SheetView({ bytes, name, kind, rights, language, theme, onChange, onSav
|
|
|
10845
10941
|
},
|
|
10846
10942
|
children: [
|
|
10847
10943
|
label,
|
|
10848
|
-
/* @__PURE__ */ (0,
|
|
10944
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("small", { children: pattern === "General" ? "" : pattern })
|
|
10849
10945
|
]
|
|
10850
10946
|
},
|
|
10851
10947
|
i
|
|
10852
10948
|
)) })
|
|
10853
10949
|
),
|
|
10854
|
-
tool(
|
|
10855
|
-
tool(
|
|
10856
|
-
tool(
|
|
10857
|
-
tool(
|
|
10950
|
+
tool(import_lucide_react7.Euro, t.asCurrency, () => range()?.setNumberFormat('#,##0.00 "\u20AC"'), look?.n === '#,##0.00 "\u20AC"'),
|
|
10951
|
+
tool(import_lucide_react7.Percent, t.asPercent, () => range()?.setNumberFormat("0.00%"), look?.n === "0.00%"),
|
|
10952
|
+
tool(import_lucide_react7.DecimalsArrowLeft, t.fewerDecimals, () => places(-1)),
|
|
10953
|
+
tool(import_lucide_react7.DecimalsArrowRight, t.moreDecimals, () => places(1)),
|
|
10858
10954
|
gap,
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10955
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "w100n-sheet-size", role: "group", "aria-label": t.fontSize, children: [
|
|
10956
|
+
tool(import_lucide_react7.Minus, t.smaller, () => run3("sheet.command.set-range-fontsize", { value: sized((look?.fs ?? 11) - 1) })),
|
|
10957
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
10958
|
+
"input",
|
|
10959
|
+
{
|
|
10960
|
+
"aria-label": t.fontSize,
|
|
10961
|
+
inputMode: "numeric",
|
|
10962
|
+
disabled: phase !== "ready",
|
|
10963
|
+
value: size2 ?? look?.fs ?? 11,
|
|
10964
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
10965
|
+
onChange: (e) => setSize(e.target.value.replace(/\D/g, "").slice(0, 3)),
|
|
10966
|
+
onBlur: () => {
|
|
10967
|
+
const n = Number(size2);
|
|
10968
|
+
if (size2 !== null && n) run3("sheet.command.set-range-fontsize", { value: sized(n) });
|
|
10969
|
+
setSize(null);
|
|
10970
|
+
},
|
|
10971
|
+
onKeyDown: (e) => {
|
|
10972
|
+
if (e.key === "Enter") e.currentTarget.blur();
|
|
10973
|
+
if (e.key === "Escape") {
|
|
10974
|
+
setSize(null);
|
|
10975
|
+
e.currentTarget.blur();
|
|
10976
|
+
}
|
|
10977
|
+
}
|
|
10978
|
+
}
|
|
10979
|
+
),
|
|
10980
|
+
tool(import_lucide_react7.Plus, t.bigger, () => run3("sheet.command.set-range-fontsize", { value: sized((look?.fs ?? 11) + 1) }))
|
|
10981
|
+
] }),
|
|
10982
|
+
gap,
|
|
10983
|
+
tool(import_lucide_react7.Bold, t.bold, () => run3("sheet.command.set-range-bold"), look?.bl),
|
|
10984
|
+
tool(import_lucide_react7.Italic, t.italic, () => run3("sheet.command.set-range-italic"), look?.it),
|
|
10985
|
+
tool(import_lucide_react7.Underline, t.underline, () => run3("sheet.command.set-range-underline"), look?.ul),
|
|
10986
|
+
tool(import_lucide_react7.Strikethrough, t.strike, () => run3("sheet.command.set-range-stroke"), look?.st),
|
|
10863
10987
|
anchor(
|
|
10864
10988
|
"text",
|
|
10865
|
-
opener("text",
|
|
10866
|
-
|
|
10867
|
-
["#0f172a", "#475569", "#dc2626", "#ea580c", "#ca8a04", "#16a34a", "#0891b2", "#2563eb", "#7c3aed", "#db2777"],
|
|
10868
|
-
(c) => run3("sheet.command.set-range-text-color", { value: c }),
|
|
10869
|
-
t.automatic,
|
|
10870
|
-
() => run3("sheet.command.reset-range-text-color"),
|
|
10871
|
-
look?.cl ?? ""
|
|
10872
|
-
)
|
|
10989
|
+
opener("text", import_lucide_react7.Baseline, t.textColour, look?.cl ?? ""),
|
|
10990
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Swatches, { current: look?.cl ?? null, none: t.automatic, onPick: (c) => run3("sheet.command.set-range-text-color", { value: c }), onNone: () => run3("sheet.command.reset-range-text-color") })
|
|
10873
10991
|
),
|
|
10874
10992
|
anchor(
|
|
10875
10993
|
"fill",
|
|
10876
|
-
opener("fill",
|
|
10877
|
-
|
|
10878
|
-
["#fee2e2", "#ffedd5", "#fef9c3", "#dcfce7", "#cffafe", "#dbeafe", "#ede9fe", "#fce7f3", "#f1f5f9", "#cbd5e1"],
|
|
10879
|
-
(c) => run3("sheet.command.set-background-color", { value: c }),
|
|
10880
|
-
t.noFill,
|
|
10881
|
-
() => run3("sheet.command.reset-background-color"),
|
|
10882
|
-
look?.bg ?? ""
|
|
10883
|
-
)
|
|
10994
|
+
opener("fill", import_lucide_react7.PaintBucket, t.fill, look?.bg ?? ""),
|
|
10995
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Swatches, { current: look?.bg ?? null, none: t.noFill, onPick: (c) => run3("sheet.command.set-background-color", { value: c }), onNone: () => run3("sheet.command.reset-background-color") })
|
|
10884
10996
|
),
|
|
10885
10997
|
anchor(
|
|
10886
10998
|
"border",
|
|
10887
|
-
opener("border",
|
|
10888
|
-
/* @__PURE__ */ (0,
|
|
10889
|
-
/* @__PURE__ */ (0,
|
|
10999
|
+
opener("border", import_lucide_react7.Grid2x2, t.borders),
|
|
11000
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-sheet-list", children: [[import_lucide_react7.Grid2x2, t.borderAll, "all"], [import_lucide_react7.Square, t.borderOuter, "outside"], [import_lucide_react7.PanelBottom, t.borderBottom, "bottom"], [import_lucide_react7.SquareDashed, t.borderNone, "none"]].map(([Icon, label, type]) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", onClick: () => border(type), children: [
|
|
11001
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon, { "aria-hidden": true }),
|
|
10890
11002
|
label
|
|
10891
11003
|
] }, type)) })
|
|
10892
11004
|
),
|
|
10893
11005
|
gap,
|
|
10894
|
-
tool(
|
|
10895
|
-
tool(
|
|
10896
|
-
tool(
|
|
10897
|
-
tool(
|
|
10898
|
-
look?.merged ? tool(
|
|
11006
|
+
tool(import_lucide_react7.TextAlignStart, t.alignLeft, () => run3("sheet.command.set-horizontal-text-align", { value: 1 }), look?.ht === 1),
|
|
11007
|
+
tool(import_lucide_react7.TextAlignCenter, t.alignCenter, () => run3("sheet.command.set-horizontal-text-align", { value: 2 }), look?.ht === 2),
|
|
11008
|
+
tool(import_lucide_react7.TextAlignEnd, t.alignRight, () => run3("sheet.command.set-horizontal-text-align", { value: 3 }), look?.ht === 3),
|
|
11009
|
+
tool(import_lucide_react7.TextWrap, t.wrap, () => run3("sheet.command.set-text-wrap", { value: look?.tb ? 1 : 3 }), look?.tb),
|
|
11010
|
+
look?.merged ? tool(import_lucide_react7.TableCellsSplit, t.unmerge, () => run3("sheet.command.remove-worksheet-merge"), true) : tool(import_lucide_react7.TableCellsMerge, t.merge, () => run3("sheet.command.add-worksheet-merge-all")),
|
|
10899
11011
|
gap,
|
|
10900
|
-
tool(
|
|
10901
|
-
tool(
|
|
10902
|
-
tool(
|
|
10903
|
-
tool(
|
|
10904
|
-
tool(
|
|
10905
|
-
tool(
|
|
11012
|
+
tool(import_lucide_react7.BetweenHorizontalStart, t.rowAbove, () => run3("sheet.command.insert-row-before")),
|
|
11013
|
+
tool(import_lucide_react7.BetweenHorizontalEnd, t.rowBelow, () => run3("sheet.command.insert-row-after")),
|
|
11014
|
+
tool(import_lucide_react7.BetweenVerticalStart, t.columnLeft, () => run3("sheet.command.insert-col-before")),
|
|
11015
|
+
tool(import_lucide_react7.BetweenVerticalEnd, t.columnRight, () => run3("sheet.command.insert-col-after")),
|
|
11016
|
+
tool(import_lucide_react7.TableRowsSplit, t.deleteRows, () => lines2(true)),
|
|
11017
|
+
tool(import_lucide_react7.TableColumnsSplit, t.deleteColumns, () => lines2(false)),
|
|
10906
11018
|
anchor(
|
|
10907
11019
|
"freeze",
|
|
10908
|
-
opener("freeze",
|
|
10909
|
-
/* @__PURE__ */ (0,
|
|
10910
|
-
/* @__PURE__ */ (0,
|
|
11020
|
+
opener("freeze", import_lucide_react7.Snowflake, t.freeze),
|
|
11021
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "w100n-sheet-list", children: [
|
|
11022
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick: () => {
|
|
10911
11023
|
sheet2()?.setFrozenRows(1);
|
|
10912
11024
|
setPop(null);
|
|
10913
11025
|
}, children: t.freezeRow }),
|
|
10914
|
-
/* @__PURE__ */ (0,
|
|
11026
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick: () => {
|
|
10915
11027
|
sheet2()?.setFrozenColumns(1);
|
|
10916
11028
|
setPop(null);
|
|
10917
11029
|
}, children: t.freezeColumn }),
|
|
10918
|
-
/* @__PURE__ */ (0,
|
|
10919
|
-
/* @__PURE__ */ (0,
|
|
11030
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick: () => run3("sheet.command.set-selection-frozen"), children: t.freezeHere }),
|
|
11031
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", onClick: () => {
|
|
10920
11032
|
sheet2()?.cancelFreeze();
|
|
10921
11033
|
setPop(null);
|
|
10922
11034
|
}, children: t.freezeNone })
|
|
10923
11035
|
] })
|
|
10924
11036
|
),
|
|
10925
11037
|
gap,
|
|
10926
|
-
tool(
|
|
10927
|
-
tool(
|
|
10928
|
-
tool(
|
|
10929
|
-
!room && tool(
|
|
11038
|
+
tool(import_lucide_react7.Sigma, t.sum, sum),
|
|
11039
|
+
tool(import_lucide_react7.ArrowDownAZ, t.sortUp, () => run3("sheet.command.sort-range-asc")),
|
|
11040
|
+
tool(import_lucide_react7.ArrowDownZA, t.sortDown, () => run3("sheet.command.sort-range-desc")),
|
|
11041
|
+
!room && tool(import_lucide_react7.Funnel, t.filter, () => run3("sheet.command.smart-toggle-filter")),
|
|
10930
11042
|
gap
|
|
10931
11043
|
] }),
|
|
10932
|
-
(edit || notes3) && tool(
|
|
10933
|
-
tool(
|
|
11044
|
+
(edit || notes3) && tool(import_lucide_react7.StickyNote, t.note, () => run3("sheet.operation.add-note-popup")),
|
|
11045
|
+
tool(import_lucide_react7.Search, t.find, () => run3("ui.operation.open-find-dialog"))
|
|
10934
11046
|
] }),
|
|
10935
|
-
/* @__PURE__ */ (0,
|
|
10936
|
-
room && (room.ready ? !room.online : room.late || room.denied) && /* @__PURE__ */ (0,
|
|
10937
|
-
/* @__PURE__ */ (0,
|
|
11047
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "w100n-sheet-end", children: [
|
|
11048
|
+
room && (room.ready ? !room.online : room.late || room.denied) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "w100n-text-live", title: room.denied ? void 0 : t.offlineHint, children: [
|
|
11049
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.WifiOff, { "aria-hidden": true }),
|
|
10938
11050
|
room.denied ? t.liveOff : t.offline
|
|
10939
11051
|
] }),
|
|
10940
|
-
room && room.people.length > 0 && /* @__PURE__ */ (0,
|
|
10941
|
-
!edit && /* @__PURE__ */ (0,
|
|
10942
|
-
saving === "failed" && /* @__PURE__ */ (0,
|
|
10943
|
-
(edit || notes3) && /* @__PURE__ */ (0,
|
|
10944
|
-
/* @__PURE__ */ (0,
|
|
11052
|
+
room && room.people.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: room.people.map((p) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) }),
|
|
11053
|
+
!edit && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-docs-badge", children: notes3 ? t.notesOnly : t.viewOnly }),
|
|
11054
|
+
saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "w100n-sheet-muted", role: "alert", children: refusal ? t.refused[refusal.code].replace("{sheet}", refusal.sheet) : t.saveFailed }),
|
|
11055
|
+
(edit || notes3) && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !pending2 || saving === "busy" || phase !== "ready" || !!room && !room.online, onClick: () => void save2(), children: [
|
|
11056
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react7.Save, { "aria-hidden": true }),
|
|
10945
11057
|
saving === "busy" ? t.saving : !pending2 && saving === "done" ? t.saved : t.save
|
|
10946
11058
|
] })
|
|
10947
11059
|
] })
|
|
10948
11060
|
] }),
|
|
10949
|
-
/* @__PURE__ */ (0,
|
|
10950
|
-
/* @__PURE__ */ (0,
|
|
10951
|
-
phase !== "ready" && /* @__PURE__ */ (0,
|
|
11061
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w100n-sheet-stage", onPointerDown: () => setPop(null), children: [
|
|
11062
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: box2, className: "w100n-sheet-grid" }),
|
|
11063
|
+
phase !== "ready" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w100n-sheet-cover", children: phase === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: t.loading }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { children: [
|
|
10952
11064
|
t.failed,
|
|
10953
|
-
/* @__PURE__ */ (0,
|
|
11065
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: () => setAttempt((n) => n + 1), children: t.retry })
|
|
10954
11066
|
] }) })
|
|
10955
11067
|
] })
|
|
10956
11068
|
] });
|
|
10957
11069
|
}
|
|
10958
|
-
var import_react12,
|
|
11070
|
+
var import_react12, import_lucide_react7, import_core7, import_jsx_runtime9, sized, decimals, letters2, SheetView_default;
|
|
10959
11071
|
var init_SheetView = __esm({
|
|
10960
11072
|
"src/sheets/SheetView.tsx"() {
|
|
10961
11073
|
"use strict";
|
|
10962
11074
|
import_react12 = require("react");
|
|
10963
|
-
|
|
10964
|
-
|
|
11075
|
+
import_lucide_react7 = require("lucide-react");
|
|
11076
|
+
import_core7 = require("@univerjs/core");
|
|
10965
11077
|
init_live();
|
|
10966
11078
|
init_focus();
|
|
10967
11079
|
init_bind();
|
|
@@ -10972,8 +11084,10 @@ var init_SheetView = __esm({
|
|
|
10972
11084
|
init_shared();
|
|
10973
11085
|
init_text2();
|
|
10974
11086
|
init_xlsx();
|
|
11087
|
+
init_Swatches();
|
|
10975
11088
|
init_sheets();
|
|
10976
|
-
|
|
11089
|
+
import_jsx_runtime9 = require("react/jsx-runtime");
|
|
11090
|
+
sized = (n) => Math.min(96, Math.max(6, Math.round(n)));
|
|
10977
11091
|
decimals = (pattern, step) => {
|
|
10978
11092
|
const p = pattern === "General" ? "0" : pattern;
|
|
10979
11093
|
const next = Math.max(0, (/0(?:\.(0+))?/.exec(p)?.[1]?.length ?? 0) + step);
|
|
@@ -11058,15 +11172,15 @@ function changes2(before, after) {
|
|
|
11058
11172
|
}
|
|
11059
11173
|
function Compare({ host, documentId, kind, older, t }) {
|
|
11060
11174
|
const rows = useLoad(async (signal) => changes2(await textOf2(kind, older), await textOf2(kind, await host.content(documentId, null, { signal }))), [host, documentId, older]);
|
|
11061
|
-
if (rows.error) return /* @__PURE__ */ (0,
|
|
11062
|
-
if (!rows.data) return /* @__PURE__ */ (0,
|
|
11175
|
+
if (rows.error) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.failed });
|
|
11176
|
+
if (!rows.data) return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
|
|
11063
11177
|
const added = rows.data.filter((r) => r.op === "+").length, removed = rows.data.filter((r) => r.op === "-").length, edited = rows.data.filter((r) => r.op === "~").length;
|
|
11064
|
-
return /* @__PURE__ */ (0,
|
|
11065
|
-
/* @__PURE__ */ (0,
|
|
11066
|
-
rows.data.map((r, i) => /* @__PURE__ */ (0,
|
|
11178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w100n-docs-page w100n-compare", children: [
|
|
11179
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "w100n-compare-sum", children: added + removed + edited ? t.changeCount.replace("{added}", String(added)).replace("{edited}", String(edited)).replace("{removed}", String(removed)) : t.noChanges }),
|
|
11180
|
+
rows.data.map((r, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { "data-op": r.op, children: r.parts.map((p, k) => p.op === "=" ? p.text : p.op === "+" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("ins", { children: p.text }, k) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("del", { children: p.text }, k)) }, i))
|
|
11067
11181
|
] }) });
|
|
11068
11182
|
}
|
|
11069
|
-
var
|
|
11183
|
+
var import_jsx_runtime18, words2, alike;
|
|
11070
11184
|
var init_Compare = __esm({
|
|
11071
11185
|
"src/Compare.tsx"() {
|
|
11072
11186
|
"use strict";
|
|
@@ -11074,7 +11188,7 @@ var init_Compare = __esm({
|
|
|
11074
11188
|
init_diff();
|
|
11075
11189
|
init_markdown();
|
|
11076
11190
|
init_useLoad();
|
|
11077
|
-
|
|
11191
|
+
import_jsx_runtime18 = require("react/jsx-runtime");
|
|
11078
11192
|
words2 = (text) => text.split(/(\s+)/).filter(Boolean);
|
|
11079
11193
|
alike = (a, b) => {
|
|
11080
11194
|
const x = a.split(/\s+/).filter(Boolean), y = b.split(/\s+/).filter(Boolean);
|
|
@@ -11105,7 +11219,7 @@ __export(index_exports, {
|
|
|
11105
11219
|
module.exports = __toCommonJS(index_exports);
|
|
11106
11220
|
|
|
11107
11221
|
// src/DocumentOverlay.tsx
|
|
11108
|
-
var
|
|
11222
|
+
var import_lucide_react8 = require("lucide-react");
|
|
11109
11223
|
var import_react13 = require("react");
|
|
11110
11224
|
var import_react_dom3 = require("react-dom");
|
|
11111
11225
|
init_focus();
|
|
@@ -11989,7 +12103,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
|
|
|
11989
12103
|
pages.current.set(id, page);
|
|
11990
12104
|
return page;
|
|
11991
12105
|
};
|
|
11992
|
-
const
|
|
12106
|
+
const fit2 = (box2, pad = 0) => box2.w > pad && box2.h > pad ? Math.min((box2.w - pad) / deck.width, (box2.h - pad) / deck.height) : 0.5;
|
|
11993
12107
|
const byKey = (a, b) => deck.slides[a].key < deck.slides[b].key ? -1 : 1;
|
|
11994
12108
|
const around3 = (i) => [i - 1, i, i + 1].filter((k) => k >= 0 && k < count).sort(byKey);
|
|
11995
12109
|
const caption = (i) => `${t.slide} ${i + 1}${deck.slides[i].title ? `: ${deck.slides[i].title}` : ""}`;
|
|
@@ -12332,7 +12446,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
|
|
|
12332
12446
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w100n-slides-main", children: [
|
|
12333
12447
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: stageRef, className: "w100n-slides-stage", style: { "--w100n-ratio": `${deck.width} / ${deck.height}` }, children: around3(index).map((i) => {
|
|
12334
12448
|
const id = `m:${deck.slides[i].key}:${epoch}`;
|
|
12335
|
-
return frame(id, frozen2(deck.slides[i], id, "edit"),
|
|
12449
|
+
return frame(id, frozen2(deck.slides[i], id, "edit"), fit2(stageBox, 32), caption(i), i !== index);
|
|
12336
12450
|
}) }),
|
|
12337
12451
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "w100n-slides-notes", "aria-label": t.notes, children: [
|
|
12338
12452
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { children: [
|
|
@@ -12359,7 +12473,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
|
|
|
12359
12473
|
children: [
|
|
12360
12474
|
around3(nav.at).map((i) => {
|
|
12361
12475
|
const id = `p:${deck.slides[i].key}:${epoch}`;
|
|
12362
|
-
return frame(id, frozen2(deck.slides[i], id, "present"),
|
|
12476
|
+
return frame(id, frozen2(deck.slides[i], id, "present"), fit2(showBox), caption(i), i !== nav.at, true);
|
|
12363
12477
|
}),
|
|
12364
12478
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "w100n-slides-count", children: [
|
|
12365
12479
|
nav.at + 1,
|
|
@@ -12406,7 +12520,7 @@ function SlidesView({ html, name, rights, language = "en", theme = "light", base
|
|
|
12406
12520
|
] })
|
|
12407
12521
|
] }),
|
|
12408
12522
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w100n-slides-desk", children: [
|
|
12409
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: nowRef, className: "w100n-slides-now", children: frame(`q:${shown.key}:${epoch}`, frozen2(shown, `q:${shown.key}:${epoch}`, "present"),
|
|
12523
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: nowRef, className: "w100n-slides-now", children: frame(`q:${shown.key}:${epoch}`, frozen2(shown, `q:${shown.key}:${epoch}`, "present"), fit2(nowBox, 16), caption(nav.at), false, true) }),
|
|
12410
12524
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("aside", { className: "w100n-slides-side", children: [
|
|
12411
12525
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "w100n-docs-caption", children: t.upNext }),
|
|
12412
12526
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: nextRef, className: "w100n-slides-next", children: nav.at < count - 1 ? frame(
|
|
@@ -12846,7 +12960,7 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
|
|
|
12846
12960
|
const [box2, setBox] = (0, import_react6.useState)({ w: 0, h: 0 });
|
|
12847
12961
|
const [top, setTop] = (0, import_react6.useState)(0);
|
|
12848
12962
|
const [railTop, setRailTop] = (0, import_react6.useState)(0);
|
|
12849
|
-
const [
|
|
12963
|
+
const [fit2, setFit] = (0, import_react6.useState)("auto");
|
|
12850
12964
|
const [zoom, setZoom] = (0, import_react6.useState)(100);
|
|
12851
12965
|
const [rail, setRail] = (0, import_react6.useState)(false);
|
|
12852
12966
|
const [typed, setTyped] = (0, import_react6.useState)(null);
|
|
@@ -12954,7 +13068,7 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
|
|
|
12954
13068
|
const widest = Math.max(1, ...sizes2.map((s) => s.w));
|
|
12955
13069
|
const tallest = Math.max(1, ...sizes2.map((s) => s.h));
|
|
12956
13070
|
const room = { w: Math.max(120, box2.w - 32), h: Math.max(120, box2.h - 32) };
|
|
12957
|
-
const scale =
|
|
13071
|
+
const scale = fit2 === "auto" ? Math.min(room.w / widest, 5 / 3) : fit2 === "width" ? room.w / widest : fit2 === "page" ? Math.min(room.w / widest, room.h / tallest) : zoom / 75;
|
|
12958
13072
|
const percent = Math.round(scale * 75);
|
|
12959
13073
|
const tops = [];
|
|
12960
13074
|
let end = 16;
|
|
@@ -13302,8 +13416,8 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
|
|
|
13302
13416
|
"%"
|
|
13303
13417
|
] }) },
|
|
13304
13418
|
{ key: "in", at: 2, Icon: import_lucide_react4.Plus, label: t.zoomIn, run: () => zoomBy(1), stay: true },
|
|
13305
|
-
{ key: "width", at: 1, Icon: import_lucide_react4.MoveHorizontal, label: t.fitWidth, run: () => setFit("width"), pressed:
|
|
13306
|
-
{ key: "fit", at: 1, Icon: import_lucide_react4.Maximize, label: t.fitPage, run: () => setFit("page"), pressed:
|
|
13419
|
+
{ key: "width", at: 1, Icon: import_lucide_react4.MoveHorizontal, label: t.fitWidth, run: () => setFit("width"), pressed: fit2 === "width" },
|
|
13420
|
+
{ key: "fit", at: 1, Icon: import_lucide_react4.Maximize, label: t.fitPage, run: () => setFit("page"), pressed: fit2 === "page" },
|
|
13307
13421
|
{ key: "g2", at: 2, node: gap },
|
|
13308
13422
|
{ key: "find", at: 0, Icon: import_lucide_react4.Search, label: t.find, run: () => setQuery(query === null ? "" : null), pressed: query !== null },
|
|
13309
13423
|
...can.mark ? [
|
|
@@ -13513,10 +13627,10 @@ function PdfView({ bytes, t, language, worker, rights, host, documentId, onSaved
|
|
|
13513
13627
|
}
|
|
13514
13628
|
|
|
13515
13629
|
// src/DocumentOverlay.tsx
|
|
13516
|
-
var
|
|
13630
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
13517
13631
|
var TextEditor2 = (0, import_react13.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
|
|
13518
13632
|
var SheetView2 = (0, import_react13.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
|
|
13519
|
-
var icons = { docx:
|
|
13633
|
+
var icons = { docx: import_lucide_react8.FileText, markdown: import_lucide_react8.FileType, pdf: import_lucide_react8.Files, sheet: import_lucide_react8.FileSpreadsheet, slides: import_lucide_react8.Presentation };
|
|
13520
13634
|
var read = { view: true, comment: false, edit: false };
|
|
13521
13635
|
var quiet2 = () => {
|
|
13522
13636
|
};
|
|
@@ -13565,10 +13679,10 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
|
|
|
13565
13679
|
setTimeout(() => URL.revokeObjectURL(url), 1e3);
|
|
13566
13680
|
};
|
|
13567
13681
|
const sheet2 = readable(name, mimeType) !== "sheet" ? null : /\.csv$/i.test(name) || mimeType === "text/csv" ? "csv" : "xlsx";
|
|
13568
|
-
const wait = /* @__PURE__ */ (0,
|
|
13682
|
+
const wait = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
|
|
13569
13683
|
let stage = null;
|
|
13570
13684
|
if (bytes && !doc.loading) {
|
|
13571
|
-
if (kind === "pdf") stage = /* @__PURE__ */ (0,
|
|
13685
|
+
if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
13572
13686
|
PdfView,
|
|
13573
13687
|
{
|
|
13574
13688
|
bytes,
|
|
@@ -13582,37 +13696,37 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
|
|
|
13582
13696
|
guard
|
|
13583
13697
|
}
|
|
13584
13698
|
);
|
|
13585
|
-
else if (kind === "docx" || kind === "markdown") stage = /* @__PURE__ */ (0,
|
|
13586
|
-
else if (kind === "slides") stage = /* @__PURE__ */ (0,
|
|
13587
|
-
else if (sheet2) stage = /* @__PURE__ */ (0,
|
|
13588
|
-
else stage = /* @__PURE__ */ (0,
|
|
13589
|
-
}
|
|
13590
|
-
return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0,
|
|
13591
|
-
/* @__PURE__ */ (0,
|
|
13592
|
-
/* @__PURE__ */ (0,
|
|
13593
|
-
/* @__PURE__ */ (0,
|
|
13594
|
-
/* @__PURE__ */ (0,
|
|
13595
|
-
info && /* @__PURE__ */ (0,
|
|
13699
|
+
else if (kind === "docx" || kind === "markdown") stage = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react13.Suspense, { fallback: wait, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TextEditor2, { kind, bytes, t, language, rights: read, documentId: documentId ?? name, onOutline: quiet2, slot: null }) });
|
|
13700
|
+
else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SlidesView, { html: new TextDecoder().decode(bytes), name, rights: read, language, theme, onOutline: quiet2 });
|
|
13701
|
+
else if (sheet2) stage = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react13.Suspense, { fallback: wait, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetView2, { bytes, name, kind: sheet2, rights: read, language, theme, documentId: documentId ?? name }) });
|
|
13702
|
+
else stage = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
|
|
13703
|
+
}
|
|
13704
|
+
return (0, import_react_dom3.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { ref: box2, className: "w100n-docs w100n-docs-overlay", "data-theme": theme, role: "dialog", "aria-modal": true, "aria-label": name, tabIndex: -1, children: [
|
|
13705
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "w100n-docs-bar", children: [
|
|
13706
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Kind, { "aria-hidden": true }) }),
|
|
13707
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-docs-heading", children: [
|
|
13708
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("strong", { className: "w100n-docs-title", children: name }),
|
|
13709
|
+
info && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "w100n-docs-crumbs", children: info })
|
|
13596
13710
|
] }),
|
|
13597
|
-
/* @__PURE__ */ (0,
|
|
13711
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-docs-end", children: [
|
|
13598
13712
|
actions,
|
|
13599
|
-
download && !saved || !bytes ? /* @__PURE__ */ (0,
|
|
13600
|
-
/* @__PURE__ */ (0,
|
|
13601
|
-
/* @__PURE__ */ (0,
|
|
13602
|
-
] }) : /* @__PURE__ */ (0,
|
|
13603
|
-
/* @__PURE__ */ (0,
|
|
13604
|
-
/* @__PURE__ */ (0,
|
|
13713
|
+
download && !saved || !bytes ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("a", { className: "w100n-docs-action", href: download ?? (typeof source === "string" ? source : void 0), download: name, "aria-label": t.download, children: [
|
|
13714
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Download, { "aria-hidden": true }),
|
|
13715
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t.download })
|
|
13716
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: save2, "aria-label": t.download, children: [
|
|
13717
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.Download, { "aria-hidden": true }),
|
|
13718
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t.download })
|
|
13605
13719
|
] }),
|
|
13606
|
-
onOpen && /* @__PURE__ */ (0,
|
|
13607
|
-
/* @__PURE__ */ (0,
|
|
13608
|
-
/* @__PURE__ */ (0,
|
|
13720
|
+
onOpen && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "w100n-docs-action", onClick: () => ask(onOpen), "aria-label": t.openInDocuments, children: [
|
|
13721
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.ExternalLink, { "aria-hidden": true }),
|
|
13722
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: t.openInDocuments })
|
|
13609
13723
|
] }),
|
|
13610
|
-
/* @__PURE__ */ (0,
|
|
13724
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: close, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react8.X, { "aria-hidden": true }) })
|
|
13611
13725
|
] })
|
|
13612
13726
|
] }),
|
|
13613
|
-
/* @__PURE__ */ (0,
|
|
13727
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "w100n-docs-body", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("main", { className: "w100n-docs-stage", children: loaded.error ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "w100n-docs-empty", children: [
|
|
13614
13728
|
t.failed,
|
|
13615
|
-
/* @__PURE__ */ (0,
|
|
13729
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: loaded.retry, children: t.retry })
|
|
13616
13730
|
] }) : stage ?? wait }) }),
|
|
13617
13731
|
dialog
|
|
13618
13732
|
] }), document.body);
|
|
@@ -13621,13 +13735,13 @@ function DocumentOverlay({ source, name, mimeType, info, download, actions, onCl
|
|
|
13621
13735
|
// src/DocumentsWorkspace.tsx
|
|
13622
13736
|
var import_react19 = require("react");
|
|
13623
13737
|
var import_react_dom4 = require("react-dom");
|
|
13624
|
-
var
|
|
13738
|
+
var import_lucide_react14 = require("lucide-react");
|
|
13625
13739
|
|
|
13626
13740
|
// src/Backlinks.tsx
|
|
13627
|
-
var
|
|
13741
|
+
var import_lucide_react9 = require("lucide-react");
|
|
13628
13742
|
init_wiki();
|
|
13629
13743
|
init_useLoad();
|
|
13630
|
-
var
|
|
13744
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
13631
13745
|
var wikis = /\[\[([^[\]\n|]+?)(?:\|([^[\]\n]+?))?\]\]/g;
|
|
13632
13746
|
var around2 = (text, from, to) => ({
|
|
13633
13747
|
before: text.slice(Math.max(0, from - 70), from).replace(/^\S*\s/, "").replace(/\s+/g, " "),
|
|
@@ -13676,33 +13790,33 @@ function Backlinks({ host, current, notes: notes3, t, onOpen }) {
|
|
|
13676
13790
|
}));
|
|
13677
13791
|
return mentions(current, notes3, texts2);
|
|
13678
13792
|
}, [host, current.id, current.name, others.map((item) => `${item.id}:${item.updatedAt}`).join()]);
|
|
13679
|
-
if (found.loading && !found.data) return /* @__PURE__ */ (0,
|
|
13680
|
-
if (found.error) return /* @__PURE__ */ (0,
|
|
13793
|
+
if (found.loading && !found.data) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w100n-docs-muted", children: t.loading });
|
|
13794
|
+
if (found.error) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w100n-docs-muted", children: t.failed });
|
|
13681
13795
|
const { linked, unlinked } = found.data;
|
|
13682
|
-
const card = (m) => /* @__PURE__ */ (0,
|
|
13683
|
-
/* @__PURE__ */ (0,
|
|
13684
|
-
/* @__PURE__ */ (0,
|
|
13796
|
+
const card = (m) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "w100n-links-card", onClick: () => onOpen(m.item), children: [
|
|
13797
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("b", { children: [
|
|
13798
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react9.FileType, { "aria-hidden": true }),
|
|
13685
13799
|
m.item.name.replace(/\.(md|markdown)$/i, "")
|
|
13686
13800
|
] }),
|
|
13687
|
-
/* @__PURE__ */ (0,
|
|
13801
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("small", { children: [
|
|
13688
13802
|
"\u2026",
|
|
13689
13803
|
m.before,
|
|
13690
|
-
/* @__PURE__ */ (0,
|
|
13804
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("mark", { children: m.hit }),
|
|
13691
13805
|
m.after,
|
|
13692
13806
|
"\u2026"
|
|
13693
13807
|
] }),
|
|
13694
|
-
m.item.folder && /* @__PURE__ */ (0,
|
|
13808
|
+
m.item.folder && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { className: "w100n-links-folder", children: m.item.folder })
|
|
13695
13809
|
] }, m.item.id);
|
|
13696
|
-
return /* @__PURE__ */ (0,
|
|
13697
|
-
/* @__PURE__ */ (0,
|
|
13810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "w100n-links", children: [
|
|
13811
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
13698
13812
|
t.linked,
|
|
13699
|
-
/* @__PURE__ */ (0,
|
|
13813
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: linked.length })
|
|
13700
13814
|
] }),
|
|
13701
|
-
linked.length ? linked.map(card) : /* @__PURE__ */ (0,
|
|
13702
|
-
unlinked.length > 0 && /* @__PURE__ */ (0,
|
|
13703
|
-
/* @__PURE__ */ (0,
|
|
13815
|
+
linked.length ? linked.map(card) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "w100n-docs-muted", children: t.noBacklinks }),
|
|
13816
|
+
unlinked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
13817
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
13704
13818
|
t.unlinked,
|
|
13705
|
-
/* @__PURE__ */ (0,
|
|
13819
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: unlinked.length })
|
|
13706
13820
|
] }),
|
|
13707
13821
|
unlinked.map(card)
|
|
13708
13822
|
] })
|
|
@@ -13714,8 +13828,8 @@ init_focus();
|
|
|
13714
13828
|
|
|
13715
13829
|
// src/Jump.tsx
|
|
13716
13830
|
var import_react14 = require("react");
|
|
13717
|
-
var
|
|
13718
|
-
var
|
|
13831
|
+
var import_lucide_react10 = require("lucide-react");
|
|
13832
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
13719
13833
|
var bare3 = (name) => name.replace(/\.(md|markdown)$/i, "");
|
|
13720
13834
|
function rank(item, q) {
|
|
13721
13835
|
const name = bare3(item.name).toLowerCase();
|
|
@@ -13732,9 +13846,9 @@ function rank(item, q) {
|
|
|
13732
13846
|
}
|
|
13733
13847
|
var lit = (text, q) => {
|
|
13734
13848
|
const at2 = q ? text.toLowerCase().indexOf(q) : -1;
|
|
13735
|
-
return at2 < 0 ? text : /* @__PURE__ */ (0,
|
|
13849
|
+
return at2 < 0 ? text : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
13736
13850
|
text.slice(0, at2),
|
|
13737
|
-
/* @__PURE__ */ (0,
|
|
13851
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("mark", { children: text.slice(at2, at2 + q.length) }),
|
|
13738
13852
|
text.slice(at2 + q.length)
|
|
13739
13853
|
] });
|
|
13740
13854
|
};
|
|
@@ -13753,12 +13867,12 @@ function Jump({ mode, items, actions, t, place: place2, onOpen, onCreate, onClos
|
|
|
13753
13867
|
else if (mode === "run") doing[i]?.run();
|
|
13754
13868
|
else if (make2) onCreate(query.trim());
|
|
13755
13869
|
};
|
|
13756
|
-
return /* @__PURE__ */ (0,
|
|
13870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w100n-jump-back", onPointerDown: (e) => {
|
|
13757
13871
|
if (e.target === e.currentTarget) onClose();
|
|
13758
|
-
}, children: /* @__PURE__ */ (0,
|
|
13759
|
-
/* @__PURE__ */ (0,
|
|
13760
|
-
mode === "open" ? /* @__PURE__ */ (0,
|
|
13761
|
-
/* @__PURE__ */ (0,
|
|
13872
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w100n-jump", role: "dialog", "aria-modal": true, "aria-label": mode === "open" ? t.openNote : t.commands, children: [
|
|
13873
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "w100n-jump-field", children: [
|
|
13874
|
+
mode === "open" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react10.Search, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react10.Command, { "aria-hidden": true }),
|
|
13875
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
13762
13876
|
"input",
|
|
13763
13877
|
{
|
|
13764
13878
|
autoFocus: true,
|
|
@@ -13784,29 +13898,29 @@ function Jump({ mode, items, actions, t, place: place2, onOpen, onCreate, onClos
|
|
|
13784
13898
|
}
|
|
13785
13899
|
)
|
|
13786
13900
|
] }),
|
|
13787
|
-
/* @__PURE__ */ (0,
|
|
13788
|
-
found.map((item, i) => /* @__PURE__ */ (0,
|
|
13789
|
-
/* @__PURE__ */ (0,
|
|
13790
|
-
/* @__PURE__ */ (0,
|
|
13791
|
-
/* @__PURE__ */ (0,
|
|
13901
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w100n-jump-list", role: "listbox", "aria-label": mode === "open" ? t.openNote : t.commands, children: [
|
|
13902
|
+
found.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", role: "option", "aria-selected": i === pick, onPointerMove: () => setAt(i), onClick: () => go(i), children: [
|
|
13903
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react10.FileType, { "aria-hidden": true }),
|
|
13904
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: lit(bare3(item.name), q) }),
|
|
13905
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { children: place2(item) })
|
|
13792
13906
|
] }, item.id)),
|
|
13793
|
-
doing.map((a, i) => /* @__PURE__ */ (0,
|
|
13794
|
-
/* @__PURE__ */ (0,
|
|
13795
|
-
/* @__PURE__ */ (0,
|
|
13796
|
-
a.keys && /* @__PURE__ */ (0,
|
|
13907
|
+
doing.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", role: "option", "aria-selected": i === pick, onPointerMove: () => setAt(i), onClick: () => go(i), children: [
|
|
13908
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(a.icon, { "aria-hidden": true }),
|
|
13909
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: lit(a.label, q) }),
|
|
13910
|
+
a.keys && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("kbd", { children: a.keys })
|
|
13797
13911
|
] }, a.id)),
|
|
13798
|
-
make2 && /* @__PURE__ */ (0,
|
|
13799
|
-
/* @__PURE__ */ (0,
|
|
13800
|
-
/* @__PURE__ */ (0,
|
|
13912
|
+
make2 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", role: "option", "aria-selected": pick === found.length, onPointerMove: () => setAt(found.length), onClick: () => go(found.length), children: [
|
|
13913
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react10.Plus, { "aria-hidden": true }),
|
|
13914
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: t.createNote.replace("{name}", query.trim()) })
|
|
13801
13915
|
] }),
|
|
13802
|
-
!total && /* @__PURE__ */ (0,
|
|
13916
|
+
!total && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "w100n-docs-muted", children: t.noNote })
|
|
13803
13917
|
] }),
|
|
13804
|
-
/* @__PURE__ */ (0,
|
|
13918
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "w100n-jump-keys", children: mode === "open" ? t.keysOpen : t.keysRun })
|
|
13805
13919
|
] }) });
|
|
13806
13920
|
}
|
|
13807
13921
|
|
|
13808
13922
|
// src/NewDocument.tsx
|
|
13809
|
-
var
|
|
13923
|
+
var import_lucide_react11 = require("lucide-react");
|
|
13810
13924
|
var import_react15 = require("react");
|
|
13811
13925
|
|
|
13812
13926
|
// src/blank.ts
|
|
@@ -13933,8 +14047,8 @@ function blank4(kind, name, template = "blank") {
|
|
|
13933
14047
|
// src/NewDocument.tsx
|
|
13934
14048
|
init_focus();
|
|
13935
14049
|
init_useLoad();
|
|
13936
|
-
var
|
|
13937
|
-
var icons2 = { docx:
|
|
14050
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
14051
|
+
var icons2 = { docx: import_lucide_react11.FileText, markdown: import_lucide_react11.FileType, sheet: import_lucide_react11.FileSpreadsheet, slides: import_lucide_react11.Presentation };
|
|
13938
14052
|
var shaped = ["blank", "letter", "contract", "notes", "invoice", "report"];
|
|
13939
14053
|
function NewDocument({ host, t, onClose, onMade }) {
|
|
13940
14054
|
const id = (0, import_react15.useId)();
|
|
@@ -13959,77 +14073,77 @@ function NewDocument({ host, t, onClose, onMade }) {
|
|
|
13959
14073
|
setState("failed");
|
|
13960
14074
|
}
|
|
13961
14075
|
};
|
|
13962
|
-
return /* @__PURE__ */ (0,
|
|
14076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
|
|
13963
14077
|
if (e.key === "Escape") {
|
|
13964
14078
|
e.stopPropagation();
|
|
13965
14079
|
onClose();
|
|
13966
14080
|
}
|
|
13967
|
-
}, children: /* @__PURE__ */ (0,
|
|
14081
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("form", { className: "w100n-pdf-dialog w100n-new", role: "dialog", "aria-modal": true, "aria-labelledby": `${id}t`, onSubmit: (e) => {
|
|
13968
14082
|
e.preventDefault();
|
|
13969
14083
|
void make2();
|
|
13970
14084
|
}, children: [
|
|
13971
|
-
/* @__PURE__ */ (0,
|
|
13972
|
-
/* @__PURE__ */ (0,
|
|
13973
|
-
/* @__PURE__ */ (0,
|
|
13974
|
-
/* @__PURE__ */ (0,
|
|
14085
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-new-head", children: [
|
|
14086
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-new-tile", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.Plus, { "aria-hidden": true }) }),
|
|
14087
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { id: `${id}t`, className: "w100n-pdf-dialog-title", children: t.newTitle }),
|
|
14088
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: onClose, "aria-label": t.close, title: t.close, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.X, { "aria-hidden": true }) })
|
|
13975
14089
|
] }),
|
|
13976
|
-
/* @__PURE__ */ (0,
|
|
14090
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { role: "radiogroup", "aria-label": t.kind, className: "w100n-new-kinds", children: Object.keys(icons2).map((item) => {
|
|
13977
14091
|
const Icon = icons2[item];
|
|
13978
|
-
return /* @__PURE__ */ (0,
|
|
14092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "radio", "aria-checked": kind === item, "data-kind": item, onClick: () => {
|
|
13979
14093
|
setKind(item);
|
|
13980
14094
|
setTeam(null);
|
|
13981
14095
|
if (item === "sheet" || item === "slides") setTemplate("blank");
|
|
13982
14096
|
}, children: [
|
|
13983
|
-
/* @__PURE__ */ (0,
|
|
13984
|
-
/* @__PURE__ */ (0,
|
|
13985
|
-
/* @__PURE__ */ (0,
|
|
13986
|
-
/* @__PURE__ */ (0,
|
|
14097
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon, { "aria-hidden": true }) }),
|
|
14098
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
14099
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("b", { children: t.newKinds[item] }),
|
|
14100
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("small", { children: t.kindHints[item] })
|
|
13987
14101
|
] })
|
|
13988
14102
|
] }, item);
|
|
13989
14103
|
}) }),
|
|
13990
|
-
/* @__PURE__ */ (0,
|
|
13991
|
-
/* @__PURE__ */ (0,
|
|
14104
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-caption", children: t.startFrom }),
|
|
14105
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { role: "radiogroup", "aria-label": t.startFrom, className: "w100n-new-templates", children: choices.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "radio", "aria-checked": !team && template === item, onClick: () => {
|
|
13992
14106
|
setTeam(null);
|
|
13993
14107
|
setTemplate(item);
|
|
13994
14108
|
}, children: [
|
|
13995
|
-
/* @__PURE__ */ (0,
|
|
13996
|
-
/* @__PURE__ */ (0,
|
|
13997
|
-
/* @__PURE__ */ (0,
|
|
13998
|
-
/* @__PURE__ */ (0,
|
|
13999
|
-
/* @__PURE__ */ (0,
|
|
14000
|
-
/* @__PURE__ */ (0,
|
|
14001
|
-
/* @__PURE__ */ (0,
|
|
14109
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-new-sheet", "data-blank": item === "blank", children: item === "blank" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.Plus, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
14110
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { "data-head": true }),
|
|
14111
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
14112
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
14113
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { "data-accent": true }),
|
|
14114
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
14115
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {})
|
|
14002
14116
|
] }) }),
|
|
14003
|
-
/* @__PURE__ */ (0,
|
|
14117
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: t.templates[item] })
|
|
14004
14118
|
] }, item)) }),
|
|
14005
|
-
ours2.length > 0 && /* @__PURE__ */ (0,
|
|
14006
|
-
/* @__PURE__ */ (0,
|
|
14007
|
-
/* @__PURE__ */ (0,
|
|
14008
|
-
/* @__PURE__ */ (0,
|
|
14009
|
-
/* @__PURE__ */ (0,
|
|
14010
|
-
/* @__PURE__ */ (0,
|
|
14011
|
-
/* @__PURE__ */ (0,
|
|
14012
|
-
/* @__PURE__ */ (0,
|
|
14013
|
-
/* @__PURE__ */ (0,
|
|
14119
|
+
ours2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
14120
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-caption", children: t.teamTemplates }),
|
|
14121
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { role: "radiogroup", "aria-label": t.teamTemplates, className: "w100n-new-templates", children: ours2.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "button", role: "radio", "aria-checked": team?.id === item.id, onClick: () => setTeam(item), children: [
|
|
14122
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "w100n-new-sheet", children: [
|
|
14123
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { "data-head": true }),
|
|
14124
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
14125
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", { "data-accent": true }),
|
|
14126
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {}),
|
|
14127
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("i", {})
|
|
14014
14128
|
] }),
|
|
14015
|
-
/* @__PURE__ */ (0,
|
|
14129
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { title: item.name, children: stem(item.name) })
|
|
14016
14130
|
] }, item.id)) })
|
|
14017
14131
|
] }),
|
|
14018
|
-
/* @__PURE__ */ (0,
|
|
14019
|
-
/* @__PURE__ */ (0,
|
|
14020
|
-
/* @__PURE__ */ (0,
|
|
14021
|
-
/* @__PURE__ */ (0,
|
|
14132
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-new-fields", children: [
|
|
14133
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("label", { children: [
|
|
14134
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-caption", children: t.name }),
|
|
14135
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { className: "w100n-docs-field", autoFocus: true, value: name, onChange: (e) => setName(e.target.value), placeholder: team ? stem(team.name) : template === "blank" ? t.untitled : t.templates[template] })
|
|
14022
14136
|
] }),
|
|
14023
|
-
host.createIn && /* @__PURE__ */ (0,
|
|
14024
|
-
/* @__PURE__ */ (0,
|
|
14025
|
-
/* @__PURE__ */ (0,
|
|
14137
|
+
host.createIn && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
14138
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-caption", children: t.savesTo }),
|
|
14139
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "w100n-docs-field w100n-new-place", children: host.createIn })
|
|
14026
14140
|
] })
|
|
14027
14141
|
] }),
|
|
14028
|
-
state === "failed" && /* @__PURE__ */ (0,
|
|
14029
|
-
/* @__PURE__ */ (0,
|
|
14030
|
-
/* @__PURE__ */ (0,
|
|
14031
|
-
/* @__PURE__ */ (0,
|
|
14032
|
-
/* @__PURE__ */ (0,
|
|
14142
|
+
state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.makeFailed }),
|
|
14143
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w100n-pdf-dialog-end", children: [
|
|
14144
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: onClose, children: t.cancel }),
|
|
14145
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: state === "busy", children: [
|
|
14146
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react11.Check, { "aria-hidden": true }),
|
|
14033
14147
|
state === "busy" ? t.making : t.make
|
|
14034
14148
|
] })
|
|
14035
14149
|
] })
|
|
@@ -14038,9 +14152,9 @@ function NewDocument({ host, t, onClose, onMade }) {
|
|
|
14038
14152
|
|
|
14039
14153
|
// src/Sharing.tsx
|
|
14040
14154
|
var import_react16 = require("react");
|
|
14041
|
-
var
|
|
14155
|
+
var import_lucide_react12 = require("lucide-react");
|
|
14042
14156
|
init_useLoad();
|
|
14043
|
-
var
|
|
14157
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
14044
14158
|
var blank5 = { id: null, comment: false, download: false, askName: true, works: "30", day: "", password: false, secret: "", had: false };
|
|
14045
14159
|
var local = (iso) => {
|
|
14046
14160
|
const at2 = new Date(iso);
|
|
@@ -14112,31 +14226,31 @@ function Sharing({ host, doc, t, language, team }) {
|
|
|
14112
14226
|
setCopied(null);
|
|
14113
14227
|
}
|
|
14114
14228
|
};
|
|
14115
|
-
if (form) return /* @__PURE__ */ (0,
|
|
14116
|
-
/* @__PURE__ */ (0,
|
|
14117
|
-
/* @__PURE__ */ (0,
|
|
14229
|
+
if (form) return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share", children: [
|
|
14230
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
14231
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Link, { "aria-hidden": true }),
|
|
14118
14232
|
form.id ? t.changeLink : t.newLink
|
|
14119
14233
|
] }),
|
|
14120
|
-
text && /* @__PURE__ */ (0,
|
|
14121
|
-
/* @__PURE__ */ (0,
|
|
14122
|
-
/* @__PURE__ */ (0,
|
|
14123
|
-
/* @__PURE__ */ (0,
|
|
14124
|
-
/* @__PURE__ */ (0,
|
|
14234
|
+
text && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share-field", children: [
|
|
14235
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: t.guestsCan }),
|
|
14236
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-chips", children: [
|
|
14237
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", "aria-pressed": !form.comment, onClick: () => setForm({ ...form, comment: false }), children: [
|
|
14238
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Eye, { "aria-hidden": true }),
|
|
14125
14239
|
t.canRead
|
|
14126
14240
|
] }),
|
|
14127
|
-
/* @__PURE__ */ (0,
|
|
14128
|
-
/* @__PURE__ */ (0,
|
|
14241
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", "aria-pressed": form.comment, onClick: () => setForm({ ...form, comment: true }), children: [
|
|
14242
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.MessageSquarePlus, { "aria-hidden": true }),
|
|
14129
14243
|
t.canComment
|
|
14130
14244
|
] })
|
|
14131
14245
|
] })
|
|
14132
14246
|
] }),
|
|
14133
|
-
/* @__PURE__ */ (0,
|
|
14134
|
-
/* @__PURE__ */ (0,
|
|
14135
|
-
/* @__PURE__ */ (0,
|
|
14136
|
-
key2 === "day" && /* @__PURE__ */ (0,
|
|
14247
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share-field", children: [
|
|
14248
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: t.linkWorks }),
|
|
14249
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-docs-chips", children: [["7", t.days7], ["30", t.days30], ["off", t.untilTurnOff], ["day", t.pickDay]].map(([key2, label]) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", "aria-pressed": form.works === key2, onClick: () => setForm({ ...form, works: key2 }), children: [
|
|
14250
|
+
key2 === "day" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.CalendarDays, { "aria-hidden": true }),
|
|
14137
14251
|
label
|
|
14138
14252
|
] }, key2)) }),
|
|
14139
|
-
form.works === "day" && /* @__PURE__ */ (0,
|
|
14253
|
+
form.works === "day" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14140
14254
|
"input",
|
|
14141
14255
|
{
|
|
14142
14256
|
type: "date",
|
|
@@ -14148,14 +14262,14 @@ function Sharing({ host, doc, t, language, team }) {
|
|
|
14148
14262
|
}
|
|
14149
14263
|
)
|
|
14150
14264
|
] }),
|
|
14151
|
-
/* @__PURE__ */ (0,
|
|
14152
|
-
/* @__PURE__ */ (0,
|
|
14153
|
-
/* @__PURE__ */ (0,
|
|
14154
|
-
/* @__PURE__ */ (0,
|
|
14155
|
-
/* @__PURE__ */ (0,
|
|
14265
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "w100n-share-toggle", children: [
|
|
14266
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { type: "checkbox", checked: form.password, onChange: (e) => setForm({ ...form, password: e.target.checked }) }),
|
|
14267
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14268
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.passwordOn }),
|
|
14269
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: t.passwordHint })
|
|
14156
14270
|
] })
|
|
14157
14271
|
] }),
|
|
14158
|
-
form.password && /* @__PURE__ */ (0,
|
|
14272
|
+
form.password && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
14159
14273
|
"input",
|
|
14160
14274
|
{
|
|
14161
14275
|
type: "password",
|
|
@@ -14167,120 +14281,120 @@ function Sharing({ host, doc, t, language, team }) {
|
|
|
14167
14281
|
onChange: (e) => setForm({ ...form, secret: e.target.value })
|
|
14168
14282
|
}
|
|
14169
14283
|
),
|
|
14170
|
-
/* @__PURE__ */ (0,
|
|
14171
|
-
/* @__PURE__ */ (0,
|
|
14172
|
-
/* @__PURE__ */ (0,
|
|
14173
|
-
/* @__PURE__ */ (0,
|
|
14174
|
-
/* @__PURE__ */ (0,
|
|
14284
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "w100n-share-toggle", children: [
|
|
14285
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { type: "checkbox", checked: form.download, onChange: (e) => setForm({ ...form, download: e.target.checked }) }),
|
|
14286
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14287
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.downloadFile }),
|
|
14288
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: t.downloadHint })
|
|
14175
14289
|
] })
|
|
14176
14290
|
] }),
|
|
14177
|
-
/* @__PURE__ */ (0,
|
|
14178
|
-
/* @__PURE__ */ (0,
|
|
14179
|
-
/* @__PURE__ */ (0,
|
|
14180
|
-
/* @__PURE__ */ (0,
|
|
14181
|
-
/* @__PURE__ */ (0,
|
|
14291
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "w100n-share-toggle", children: [
|
|
14292
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { type: "checkbox", checked: form.askName, onChange: (e) => setForm({ ...form, askName: e.target.checked }) }),
|
|
14293
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14294
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.askName }),
|
|
14295
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: t.askNameHint })
|
|
14182
14296
|
] })
|
|
14183
14297
|
] }),
|
|
14184
|
-
/* @__PURE__ */ (0,
|
|
14185
|
-
state === "failed" && /* @__PURE__ */ (0,
|
|
14186
|
-
/* @__PURE__ */ (0,
|
|
14187
|
-
/* @__PURE__ */ (0,
|
|
14298
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: t.lastSaved }),
|
|
14299
|
+
state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
|
|
14300
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
14301
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
|
|
14188
14302
|
setForm(null);
|
|
14189
14303
|
setState("idle");
|
|
14190
14304
|
}, children: t.cancel }),
|
|
14191
|
-
/* @__PURE__ */ (0,
|
|
14192
|
-
/* @__PURE__ */ (0,
|
|
14305
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: !ready || state === "busy", onClick: () => void submit(), children: [
|
|
14306
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Link, { "aria-hidden": true }),
|
|
14193
14307
|
form.id ? t.saveLink : t.makeLink
|
|
14194
14308
|
] })
|
|
14195
14309
|
] })
|
|
14196
14310
|
] });
|
|
14197
14311
|
const on2 = links.data ?? [];
|
|
14198
|
-
return /* @__PURE__ */ (0,
|
|
14199
|
-
/* @__PURE__ */ (0,
|
|
14200
|
-
/* @__PURE__ */ (0,
|
|
14312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share", children: [
|
|
14313
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
14314
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Link, { "aria-hidden": true }),
|
|
14201
14315
|
t.guestLinks,
|
|
14202
|
-
on2.length > 0 && /* @__PURE__ */ (0,
|
|
14316
|
+
on2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: on2.filter((l) => !l.ended).length })
|
|
14203
14317
|
] }),
|
|
14204
|
-
links.error && /* @__PURE__ */ (0,
|
|
14318
|
+
links.error && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-docs-note", children: [
|
|
14205
14319
|
t.failed,
|
|
14206
|
-
/* @__PURE__ */ (0,
|
|
14320
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", onClick: links.retry, children: t.retry })
|
|
14207
14321
|
] }),
|
|
14208
|
-
links.data && !on2.length && /* @__PURE__ */ (0,
|
|
14209
|
-
state === "failed" && /* @__PURE__ */ (0,
|
|
14210
|
-
on2.map((l) => /* @__PURE__ */ (0,
|
|
14211
|
-
/* @__PURE__ */ (0,
|
|
14212
|
-
/* @__PURE__ */ (0,
|
|
14213
|
-
/* @__PURE__ */ (0,
|
|
14214
|
-
/* @__PURE__ */ (0,
|
|
14215
|
-
/* @__PURE__ */ (0,
|
|
14322
|
+
links.data && !on2.length && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", children: t.noLinks }),
|
|
14323
|
+
state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.shareFailed }),
|
|
14324
|
+
on2.map((l) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("article", { className: "w100n-share-link", "data-ended": l.ended, children: [
|
|
14325
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { children: [
|
|
14326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-share-tile", "data-tone": l.comment ? "amber" : "blue", children: l.comment ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.MessageSquarePlus, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Eye, { "aria-hidden": true }) }),
|
|
14327
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14328
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: l.comment ? t.commentLink : t.viewLink }),
|
|
14329
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
|
|
14216
14330
|
t.madeBy.replace("{name}", l.createdBy.name),
|
|
14217
14331
|
" \xB7 ",
|
|
14218
14332
|
day(l.createdAt)
|
|
14219
14333
|
] })
|
|
14220
14334
|
] })
|
|
14221
14335
|
] }),
|
|
14222
|
-
/* @__PURE__ */ (0,
|
|
14223
|
-
/* @__PURE__ */ (0,
|
|
14224
|
-
/* @__PURE__ */ (0,
|
|
14336
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share-chips", children: [
|
|
14337
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14338
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Clock, { "aria-hidden": true }),
|
|
14225
14339
|
l.ended ? t.linkEnded : l.endsAt ? t.endsOn.replace("{date}", day(l.endsAt)) : t.untilOff
|
|
14226
14340
|
] }),
|
|
14227
|
-
l.download && /* @__PURE__ */ (0,
|
|
14228
|
-
/* @__PURE__ */ (0,
|
|
14341
|
+
l.download && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14342
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Download, { "aria-hidden": true }),
|
|
14229
14343
|
t.downloadOn
|
|
14230
14344
|
] }),
|
|
14231
|
-
l.password && /* @__PURE__ */ (0,
|
|
14232
|
-
/* @__PURE__ */ (0,
|
|
14345
|
+
l.password && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14346
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Lock, { "aria-hidden": true }),
|
|
14233
14347
|
t.passwordOn
|
|
14234
14348
|
] }),
|
|
14235
|
-
/* @__PURE__ */ (0,
|
|
14236
|
-
/* @__PURE__ */ (0,
|
|
14349
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14350
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Eye, { "aria-hidden": true }),
|
|
14237
14351
|
count(l.guests.reduce((n, g) => n + g.opens, 0), t.openForms)
|
|
14238
14352
|
] })
|
|
14239
14353
|
] }),
|
|
14240
|
-
/* @__PURE__ */ (0,
|
|
14241
|
-
/* @__PURE__ */ (0,
|
|
14242
|
-
/* @__PURE__ */ (0,
|
|
14243
|
-
/* @__PURE__ */ (0,
|
|
14354
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share-url", children: [
|
|
14355
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: l.url.replace(/^https?:\/\//, "") }),
|
|
14356
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", onClick: () => void copy2(l), children: [
|
|
14357
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Copy, { "aria-hidden": true }),
|
|
14244
14358
|
copied === l.id ? t.copied : t.copy
|
|
14245
14359
|
] })
|
|
14246
14360
|
] }),
|
|
14247
|
-
l.guests.length > 0 && /* @__PURE__ */ (0,
|
|
14248
|
-
/* @__PURE__ */ (0,
|
|
14249
|
-
/* @__PURE__ */ (0,
|
|
14250
|
-
/* @__PURE__ */ (0,
|
|
14361
|
+
l.guests.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w100n-share-who", children: l.guests.map((g, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
14362
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-text-face", "aria-hidden": true, children: (g.name || "?").slice(0, 1).toUpperCase() }),
|
|
14363
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: g.name || t.unnamed }),
|
|
14364
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("small", { children: [
|
|
14251
14365
|
g.comments ? count(g.comments, t.commentForms) : count(g.opens, t.openForms),
|
|
14252
14366
|
" \xB7 ",
|
|
14253
14367
|
ago(g.lastAt)
|
|
14254
14368
|
] })
|
|
14255
14369
|
] }, i)) }),
|
|
14256
|
-
/* @__PURE__ */ (0,
|
|
14257
|
-
/* @__PURE__ */ (0,
|
|
14258
|
-
/* @__PURE__ */ (0,
|
|
14370
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share-tools", children: [
|
|
14371
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "slate", disabled: state === "busy", onClick: () => edit(l), children: [
|
|
14372
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Clock, { "aria-hidden": true }),
|
|
14259
14373
|
t.changeLink
|
|
14260
14374
|
] }),
|
|
14261
|
-
/* @__PURE__ */ (0,
|
|
14262
|
-
/* @__PURE__ */ (0,
|
|
14375
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: state === "busy", onClick: () => void off(l), children: [
|
|
14376
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Ban, { "aria-hidden": true }),
|
|
14263
14377
|
t.turnOff
|
|
14264
14378
|
] })
|
|
14265
14379
|
] })
|
|
14266
14380
|
] }, l.id)),
|
|
14267
|
-
/* @__PURE__ */ (0,
|
|
14381
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("button", { type: "button", className: "w100n-docs-action w100n-share-new", onClick: () => {
|
|
14268
14382
|
setState("idle");
|
|
14269
14383
|
setForm(blank5);
|
|
14270
14384
|
}, children: [
|
|
14271
|
-
/* @__PURE__ */ (0,
|
|
14385
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Plus, { "aria-hidden": true }),
|
|
14272
14386
|
t.newLink
|
|
14273
14387
|
] }),
|
|
14274
|
-
team && /* @__PURE__ */ (0,
|
|
14275
|
-
/* @__PURE__ */ (0,
|
|
14276
|
-
/* @__PURE__ */ (0,
|
|
14388
|
+
team && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
14389
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
14390
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Users, { "aria-hidden": true }),
|
|
14277
14391
|
t.inTeam
|
|
14278
14392
|
] }),
|
|
14279
|
-
/* @__PURE__ */ (0,
|
|
14280
|
-
/* @__PURE__ */ (0,
|
|
14281
|
-
/* @__PURE__ */ (0,
|
|
14282
|
-
/* @__PURE__ */ (0,
|
|
14283
|
-
/* @__PURE__ */ (0,
|
|
14393
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w100n-share-team", children: [
|
|
14394
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "w100n-share-tile", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react12.Users, { "aria-hidden": true }) }),
|
|
14395
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { children: [
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("b", { children: t.peopleOf.replace("{space}", team) }),
|
|
14397
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("small", { children: t.teamHint })
|
|
14284
14398
|
] })
|
|
14285
14399
|
] })
|
|
14286
14400
|
] })
|
|
@@ -14291,15 +14405,15 @@ function Sharing({ host, doc, t, language, team }) {
|
|
|
14291
14405
|
init_text();
|
|
14292
14406
|
|
|
14293
14407
|
// src/PreviewCard.tsx
|
|
14294
|
-
var
|
|
14408
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
14295
14409
|
function PreviewCard({ thumb, icon, title, lines: lines2 }) {
|
|
14296
|
-
return /* @__PURE__ */ (0,
|
|
14297
|
-
/* @__PURE__ */ (0,
|
|
14298
|
-
/* @__PURE__ */ (0,
|
|
14410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-card", children: [
|
|
14411
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "w100n-card-thumb", children: thumb }),
|
|
14412
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "w100n-card-title", children: [
|
|
14299
14413
|
icon,
|
|
14300
|
-
/* @__PURE__ */ (0,
|
|
14414
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("b", { children: title })
|
|
14301
14415
|
] }),
|
|
14302
|
-
lines2.filter(Boolean).map((line, i) => /* @__PURE__ */ (0,
|
|
14416
|
+
lines2.filter(Boolean).map((line, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("small", { children: line }, i))
|
|
14303
14417
|
] });
|
|
14304
14418
|
}
|
|
14305
14419
|
|
|
@@ -14357,7 +14471,7 @@ function preview(host, doc) {
|
|
|
14357
14471
|
}
|
|
14358
14472
|
|
|
14359
14473
|
// src/Thumb.tsx
|
|
14360
|
-
var
|
|
14474
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
14361
14475
|
function Thumb({ host, item, label }) {
|
|
14362
14476
|
const box2 = (0, import_react17.useRef)(null);
|
|
14363
14477
|
const [seen2, setSeen] = (0, import_react17.useState)(false);
|
|
@@ -14383,26 +14497,26 @@ function Thumb({ host, item, label }) {
|
|
|
14383
14497
|
const text = item.excerpt ?? shot?.text ?? "";
|
|
14384
14498
|
const lines2 = text.split("\n").filter((line) => !line.trim().startsWith("```")).map((line) => line.replace(/^#+\s*/, "").replace(/[*_`>|]/g, "").trim()).filter(Boolean);
|
|
14385
14499
|
const image = item.thumbnailUrl ?? shot?.image;
|
|
14386
|
-
return /* @__PURE__ */ (0,
|
|
14387
|
-
image ? /* @__PURE__ */ (0,
|
|
14388
|
-
/* @__PURE__ */ (0,
|
|
14500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { ref: box2, className: "w100n-docs-thumb", "data-kind": item.kind, children: [
|
|
14501
|
+
image ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { src: image, alt: "" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "w100n-docs-paper", "aria-hidden": true, children: lines2.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
14502
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("b", { children: lines2[0] }),
|
|
14389
14503
|
lines2.slice(1, 14).join(" ")
|
|
14390
|
-
] }) : /* @__PURE__ */ (0,
|
|
14391
|
-
/* @__PURE__ */ (0,
|
|
14392
|
-
/* @__PURE__ */ (0,
|
|
14393
|
-
/* @__PURE__ */ (0,
|
|
14394
|
-
/* @__PURE__ */ (0,
|
|
14395
|
-
/* @__PURE__ */ (0,
|
|
14504
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
14505
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", {}),
|
|
14506
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", {}),
|
|
14507
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", {}),
|
|
14508
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", {}),
|
|
14509
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", {})
|
|
14396
14510
|
] }) }),
|
|
14397
|
-
label && /* @__PURE__ */ (0,
|
|
14511
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "w100n-docs-kind", "data-kind": item.kind, children: label })
|
|
14398
14512
|
] });
|
|
14399
14513
|
}
|
|
14400
14514
|
|
|
14401
14515
|
// src/Tree.tsx
|
|
14402
14516
|
var import_react18 = require("react");
|
|
14403
|
-
var
|
|
14404
|
-
var
|
|
14405
|
-
var icons3 = { docx:
|
|
14517
|
+
var import_lucide_react13 = require("lucide-react");
|
|
14518
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
14519
|
+
var icons3 = { docx: import_lucide_react13.FileText, markdown: import_lucide_react13.FileType, pdf: import_lucide_react13.File, sheet: import_lucide_react13.FileSpreadsheet, slides: import_lucide_react13.Presentation };
|
|
14406
14520
|
var dragged = "application/x-w100n-document";
|
|
14407
14521
|
function grow(items, folders, names2, spaceId, other) {
|
|
14408
14522
|
const root = { key: "", name: "", at: spaceId ? { spaceId, folder: "" } : null, folders: [], files: [], count: 0 };
|
|
@@ -14452,7 +14566,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
|
|
|
14452
14566
|
setClosed(next);
|
|
14453
14567
|
localStorage.setItem("w100n-docs-closed", JSON.stringify([...next]));
|
|
14454
14568
|
};
|
|
14455
|
-
const field = (pad, label) => /* @__PURE__ */ (0,
|
|
14569
|
+
const field = (pad, label) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14456
14570
|
"input",
|
|
14457
14571
|
{
|
|
14458
14572
|
className: "w100n-tree-row w100n-tree-input",
|
|
@@ -14489,12 +14603,12 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
|
|
|
14489
14603
|
onMove(id, b.at);
|
|
14490
14604
|
}
|
|
14491
14605
|
} : {};
|
|
14492
|
-
const branch = (b, depth) => /* @__PURE__ */ (0,
|
|
14606
|
+
const branch = (b, depth) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
14493
14607
|
edit?.key === `new:${b.key}` && field(24 + depth * 16, t.folderName),
|
|
14494
14608
|
b.folders.map((f) => {
|
|
14495
14609
|
const open = !closed2.has(f.key) || edit?.key === `new:${f.key}`;
|
|
14496
|
-
return /* @__PURE__ */ (0,
|
|
14497
|
-
edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */ (0,
|
|
14610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { role: "group", "aria-label": f.name, "data-over": over === f.key || void 0, ...target(f), children: [
|
|
14611
|
+
edit?.key === `dir:${f.key}` ? field(24 + depth * 16, t.renameFolder) : /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
14498
14612
|
"button",
|
|
14499
14613
|
{
|
|
14500
14614
|
type: "button",
|
|
@@ -14508,10 +14622,10 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
|
|
|
14508
14622
|
onFolderMenu(f.at, f.key, e);
|
|
14509
14623
|
} : void 0,
|
|
14510
14624
|
children: [
|
|
14511
|
-
open ? /* @__PURE__ */ (0,
|
|
14512
|
-
/* @__PURE__ */ (0,
|
|
14513
|
-
/* @__PURE__ */ (0,
|
|
14514
|
-
f.count > 0 && /* @__PURE__ */ (0,
|
|
14625
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronDown, { "aria-hidden": true, className: "w100n-tree-fold" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.ChevronRight, { "aria-hidden": true, className: "w100n-tree-fold" }),
|
|
14626
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react13.Folder, { "aria-hidden": true }),
|
|
14627
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: f.name }),
|
|
14628
|
+
f.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { children: f.count })
|
|
14515
14629
|
]
|
|
14516
14630
|
}
|
|
14517
14631
|
),
|
|
@@ -14520,9 +14634,9 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
|
|
|
14520
14634
|
}),
|
|
14521
14635
|
b.files.map((item) => {
|
|
14522
14636
|
const Icon = icons3[item.kind];
|
|
14523
|
-
if (edit?.key === `file:${item.id}`) return /* @__PURE__ */ (0,
|
|
14637
|
+
if (edit?.key === `file:${item.id}`) return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: field(24 + depth * 16, t.rename) }, item.id);
|
|
14524
14638
|
const hit = hits?.get(item.id);
|
|
14525
|
-
const row2 = /* @__PURE__ */ (0,
|
|
14639
|
+
const row2 = /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
14526
14640
|
"button",
|
|
14527
14641
|
{
|
|
14528
14642
|
type: "button",
|
|
@@ -14536,7 +14650,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
|
|
|
14536
14650
|
e.dataTransfer.effectAllowed = "move";
|
|
14537
14651
|
},
|
|
14538
14652
|
onClick: () => onOpen(item),
|
|
14539
|
-
onPointerEnter: (
|
|
14653
|
+
onPointerEnter: () => onWarm(item),
|
|
14540
14654
|
onPointerLeave: () => onWarm(null),
|
|
14541
14655
|
onContextMenu: (e) => {
|
|
14542
14656
|
e.preventDefault();
|
|
@@ -14544,21 +14658,21 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
|
|
|
14544
14658
|
onMenu(item, e);
|
|
14545
14659
|
},
|
|
14546
14660
|
children: [
|
|
14547
|
-
/* @__PURE__ */ (0,
|
|
14548
|
-
/* @__PURE__ */ (0,
|
|
14549
|
-
item.kind !== "markdown" && /* @__PURE__ */ (0,
|
|
14661
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon, { "aria-hidden": true, "data-kind": item.kind }),
|
|
14662
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: item.name.replace(/\.[^.]+$/, "") }),
|
|
14663
|
+
item.kind !== "markdown" && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { className: "w100n-tree-kind", children: t.kinds[item.kind] })
|
|
14550
14664
|
]
|
|
14551
14665
|
},
|
|
14552
14666
|
item.id
|
|
14553
14667
|
);
|
|
14554
|
-
return hit ? /* @__PURE__ */ (0,
|
|
14668
|
+
return hit ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
14555
14669
|
row2,
|
|
14556
|
-
/* @__PURE__ */ (0,
|
|
14670
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("small", { className: "w100n-tree-hit", style: { paddingLeft: 46 + depth * 16 }, children: hit.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("mark", { children: part }, i) : part) })
|
|
14557
14671
|
] }, item.id) : row2;
|
|
14558
14672
|
})
|
|
14559
14673
|
] });
|
|
14560
14674
|
const root = grow(items, folders, names2, spaceId, t.elsewhere);
|
|
14561
|
-
return /* @__PURE__ */ (0,
|
|
14675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
14562
14676
|
"nav",
|
|
14563
14677
|
{
|
|
14564
14678
|
className: "w100n-tree",
|
|
@@ -14576,7 +14690,7 @@ function Tree({ items, folders, names: names2, spaceId, current, t, edit, hits,
|
|
|
14576
14690
|
|
|
14577
14691
|
// src/DocumentsWorkspace.tsx
|
|
14578
14692
|
init_useLoad();
|
|
14579
|
-
var
|
|
14693
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
14580
14694
|
var TextEditor3 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
|
|
14581
14695
|
var SheetView3 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
|
|
14582
14696
|
var Compare2 = (0, import_react19.lazy)(() => Promise.resolve().then(() => (init_Compare(), Compare_exports)));
|
|
@@ -14664,8 +14778,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14664
14778
|
const [notice, setNotice] = (0, import_react19.useState)(null);
|
|
14665
14779
|
const early = (0, import_react19.useRef)(/* @__PURE__ */ new Map());
|
|
14666
14780
|
const hover = (0, import_react19.useRef)(0);
|
|
14667
|
-
const peeking = (0, import_react19.useRef)(0);
|
|
14668
|
-
const [peek, setPeek] = (0, import_react19.useState)(null);
|
|
14669
14781
|
(0, import_react19.useEffect)(() => {
|
|
14670
14782
|
if (!menu && !spot3) return;
|
|
14671
14783
|
const close = (e) => {
|
|
@@ -14767,9 +14879,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14767
14879
|
return new Intl.DateTimeFormat(language, { day: "numeric", month: "short", year: "numeric" }).format(new Date(iso));
|
|
14768
14880
|
};
|
|
14769
14881
|
const size2 = (bytes) => bytes < 1024 ? `${bytes} B` : bytes < 1048576 ? `${(bytes / 1024).toFixed(0)} KB` : `${(bytes / 1048576).toFixed(1)} MB`;
|
|
14770
|
-
const failed = (retry) => /* @__PURE__ */ (0,
|
|
14882
|
+
const failed = (retry) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-note", children: [
|
|
14771
14883
|
t.failed,
|
|
14772
|
-
/* @__PURE__ */ (0,
|
|
14884
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: retry, children: t.retry })
|
|
14773
14885
|
] });
|
|
14774
14886
|
const { ask, dialog } = useUnsaved(guard, t);
|
|
14775
14887
|
const side2 = (which, open2) => {
|
|
@@ -14878,9 +14990,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14878
14990
|
setKept({ id: file.id, state: "failed" });
|
|
14879
14991
|
}
|
|
14880
14992
|
};
|
|
14881
|
-
const warm = (item
|
|
14882
|
-
clearTimeout(peeking.current);
|
|
14883
|
-
if (at2) peeking.current = window.setTimeout(() => setPeek({ item, x: Math.min(at2.right + 8, innerWidth - 300), y: Math.min(at2.top, innerHeight - 300) }), 500);
|
|
14993
|
+
const warm = (item) => {
|
|
14884
14994
|
clearTimeout(hover.current);
|
|
14885
14995
|
hover.current = window.setTimeout(() => {
|
|
14886
14996
|
if (item.id === here.documentId) return;
|
|
@@ -14898,11 +15008,11 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
14898
15008
|
};
|
|
14899
15009
|
const card = (item) => {
|
|
14900
15010
|
const Icon = icons3[item.kind];
|
|
14901
|
-
return /* @__PURE__ */ (0,
|
|
15011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PreviewCard, { thumb: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Thumb, { host, item, label: t.kinds[item.kind] }), icon: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { "aria-hidden": true, "data-kind": item.kind }), title: item.name, lines: [
|
|
14902
15012
|
[t.kinds[item.kind], size2(item.size), names2.get(item.spaceId), item.folder].filter(Boolean).join(" \xB7 "),
|
|
14903
15013
|
item.createdAt && [t.createdOn.replace("{when}", date(item.createdAt)), item.createdBy?.name].filter(Boolean).join(" \xB7 "),
|
|
14904
15014
|
[t.updatedOn.replace("{when}", ago(item.updatedAt)), item.updatedBy?.name].filter(Boolean).join(" \xB7 "),
|
|
14905
|
-
inside2.get(item.id)?.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0,
|
|
15015
|
+
inside2.get(item.id)?.split(/[«»]/).map((part, i) => i % 2 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("mark", { children: part }, i) : part)
|
|
14906
15016
|
] });
|
|
14907
15017
|
};
|
|
14908
15018
|
const act = async (run3, done) => {
|
|
@@ -15004,20 +15114,20 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15004
15114
|
};
|
|
15005
15115
|
const current = doc.data && all.find((item) => item.id === doc.data.id);
|
|
15006
15116
|
const commands = [
|
|
15007
|
-
...host.create ? [{ id: "new", label: t.newNote, icon:
|
|
15008
|
-
{ id: "open", label: t.openNote, icon:
|
|
15009
|
-
{ id: "search", label: t.searchAll, icon:
|
|
15117
|
+
...host.create ? [{ id: "new", label: t.newNote, icon: import_lucide_react14.FilePlus, keys: "\u2318N", run: () => void note(t.untitled, true) }] : [],
|
|
15118
|
+
{ id: "open", label: t.openNote, icon: import_lucide_react14.Search, keys: "\u2318O", run: () => setJump("open") },
|
|
15119
|
+
{ id: "search", label: t.searchAll, icon: import_lucide_react14.Search, run: () => {
|
|
15010
15120
|
side2("list", true);
|
|
15011
15121
|
requestAnimationFrame(() => finder.current?.focus());
|
|
15012
15122
|
} },
|
|
15013
15123
|
...doc.data ? [
|
|
15014
|
-
{ id: "outline", label: t.showOutline, icon:
|
|
15015
|
-
...doc.data.kind === "markdown" ? [{ id: "links", label: t.showLinks, icon:
|
|
15016
|
-
{ id: "versions", label: t.showVersions, icon:
|
|
15017
|
-
...text && host.comments ? [{ id: "comments", label: t.showComments, icon:
|
|
15018
|
-
...host.send && !doc.data.id.includes(":") ? [{ id: "send", label: t.sendChat, icon:
|
|
15019
|
-
...host.rename && doc.data.rights.edit ? [{ id: "rename", label: t.rename, icon:
|
|
15020
|
-
...host.remove && current ? [{ id: "trash", label: t.trash, icon:
|
|
15124
|
+
{ id: "outline", label: t.showOutline, icon: import_lucide_react14.ListTree, run: () => panelOn("outline") },
|
|
15125
|
+
...doc.data.kind === "markdown" ? [{ id: "links", label: t.showLinks, icon: import_lucide_react14.Link2, run: () => panelOn("links") }] : [],
|
|
15126
|
+
{ id: "versions", label: t.showVersions, icon: import_lucide_react14.History, run: () => panelOn("versions") },
|
|
15127
|
+
...text && host.comments ? [{ id: "comments", label: t.showComments, icon: import_lucide_react14.MessagesSquare, run: () => panelOn("comments") }] : [],
|
|
15128
|
+
...host.send && !doc.data.id.includes(":") ? [{ id: "send", label: t.sendChat, icon: import_lucide_react14.Send, run: () => host.send(doc.data.id) }] : [],
|
|
15129
|
+
...host.rename && doc.data.rights.edit ? [{ id: "rename", label: t.rename, icon: import_lucide_react14.Pencil, run: () => setRenaming(doc.data.name.replace(/\.[^.]+$/, "")) }] : [],
|
|
15130
|
+
...host.remove && current ? [{ id: "trash", label: t.trash, icon: import_lucide_react14.Trash2, run: () => void drop2(current) }] : []
|
|
15021
15131
|
] : []
|
|
15022
15132
|
];
|
|
15023
15133
|
(0, import_react19.useEffect)(() => {
|
|
@@ -15034,8 +15144,8 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15034
15144
|
window.addEventListener("keydown", press, true);
|
|
15035
15145
|
return () => window.removeEventListener("keydown", press, true);
|
|
15036
15146
|
});
|
|
15037
|
-
let stage = /* @__PURE__ */ (0,
|
|
15038
|
-
/* @__PURE__ */ (0,
|
|
15147
|
+
let stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-empty", children: [
|
|
15148
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FileText, { "aria-hidden": true }),
|
|
15039
15149
|
t.pick
|
|
15040
15150
|
] });
|
|
15041
15151
|
if (here.documentId) {
|
|
@@ -15043,9 +15153,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15043
15153
|
doc.retry();
|
|
15044
15154
|
content.retry();
|
|
15045
15155
|
});
|
|
15046
|
-
else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0,
|
|
15047
|
-
else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0,
|
|
15048
|
-
else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0,
|
|
15156
|
+
else if (!doc.data || !content.data) stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.loading });
|
|
15157
|
+
else if (comparing && versionId && (doc.data.kind === "markdown" || doc.data.kind === "docx")) stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Compare2, { host, documentId: doc.data.id, kind: doc.data.kind, older: content.data, t }, versionId) });
|
|
15158
|
+
else if (doc.data.kind === "markdown" || doc.data.kind === "docx") stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15049
15159
|
TextEditor3,
|
|
15050
15160
|
{
|
|
15051
15161
|
kind: doc.data.kind,
|
|
@@ -15082,7 +15192,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15082
15192
|
},
|
|
15083
15193
|
doc.data.id
|
|
15084
15194
|
) });
|
|
15085
|
-
else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0,
|
|
15195
|
+
else if (doc.data.kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15086
15196
|
PdfView,
|
|
15087
15197
|
{
|
|
15088
15198
|
bytes: content.data,
|
|
@@ -15104,7 +15214,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15104
15214
|
},
|
|
15105
15215
|
`${doc.data.id}:${versionId ?? ""}`
|
|
15106
15216
|
);
|
|
15107
|
-
else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0,
|
|
15217
|
+
else if (doc.data.kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15108
15218
|
SlidesView,
|
|
15109
15219
|
{
|
|
15110
15220
|
html: new TextDecoder().decode(content.data),
|
|
@@ -15123,7 +15233,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15123
15233
|
},
|
|
15124
15234
|
doc.data.id
|
|
15125
15235
|
);
|
|
15126
|
-
else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0,
|
|
15236
|
+
else if (doc.data.kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react19.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15127
15237
|
SheetView3,
|
|
15128
15238
|
{
|
|
15129
15239
|
bytes: content.data,
|
|
@@ -15150,9 +15260,9 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15150
15260
|
},
|
|
15151
15261
|
`${doc.data.id}:${versionId ?? ""}`
|
|
15152
15262
|
) });
|
|
15153
|
-
else stage = /* @__PURE__ */ (0,
|
|
15263
|
+
else stage = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
|
|
15154
15264
|
}
|
|
15155
|
-
const Kind = doc.data ? icons3[doc.data.kind] :
|
|
15265
|
+
const Kind = doc.data ? icons3[doc.data.kind] : import_lucide_react14.FileText;
|
|
15156
15266
|
const top = Math.min(...outline2.map((h) => h.level));
|
|
15157
15267
|
const chapters = outline2.reduce((all2, h) => {
|
|
15158
15268
|
if (h.level === top || !all2.length) all2.push({ head: h, subs: [] });
|
|
@@ -15166,16 +15276,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15166
15276
|
const reach = (h) => h.go ? h.go() : document.getElementById(h.id)?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
15167
15277
|
const crumbs = doc.data ? [names2.get(doc.data.spaceId), doc.data.folder].filter(Boolean) : space ? [space.name] : [];
|
|
15168
15278
|
const panelTabs = [
|
|
15169
|
-
["outline",
|
|
15170
|
-
...doc.data?.kind === "markdown" ? [["links",
|
|
15171
|
-
["versions",
|
|
15172
|
-
["details",
|
|
15279
|
+
["outline", import_lucide_react14.ListTree, t.outline],
|
|
15280
|
+
...doc.data?.kind === "markdown" ? [["links", import_lucide_react14.Link2, t.links]] : [],
|
|
15281
|
+
["versions", import_lucide_react14.History, t.versions],
|
|
15282
|
+
["details", import_lucide_react14.Info, t.details]
|
|
15173
15283
|
];
|
|
15174
|
-
if (pdf && host.signatures) panelTabs.push(["signatures",
|
|
15175
|
-
if (text && host.comments && !versionId) panelTabs.push(["comments",
|
|
15284
|
+
if (pdf && host.signatures) panelTabs.push(["signatures", import_lucide_react14.Signature, t.signatures]);
|
|
15285
|
+
if (text && host.comments && !versionId) panelTabs.push(["comments", import_lucide_react14.MessagesSquare, t.comments]);
|
|
15176
15286
|
const sharing = !!host.links && !!doc.data?.rights.edit && !versionId;
|
|
15177
|
-
if (sharing) panelTabs.push(["sharing",
|
|
15178
|
-
const listToggle = /* @__PURE__ */ (0,
|
|
15287
|
+
if (sharing) panelTabs.push(["sharing", import_lucide_react14.Share2, t.sharing]);
|
|
15288
|
+
const listToggle = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15179
15289
|
"button",
|
|
15180
15290
|
{
|
|
15181
15291
|
ref: listButton,
|
|
@@ -15185,10 +15295,10 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15185
15295
|
onClick: () => side2("list", !listOpen),
|
|
15186
15296
|
"aria-label": listOpen ? t.closeList : t.openList,
|
|
15187
15297
|
title: listOpen ? t.closeList : t.openList,
|
|
15188
|
-
children: listOpen ? /* @__PURE__ */ (0,
|
|
15298
|
+
children: listOpen ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.PanelLeftClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.PanelLeftOpen, { "aria-hidden": true })
|
|
15189
15299
|
}
|
|
15190
15300
|
);
|
|
15191
|
-
const panelToggle = doc.data && /* @__PURE__ */ (0,
|
|
15301
|
+
const panelToggle = doc.data && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15192
15302
|
"button",
|
|
15193
15303
|
{
|
|
15194
15304
|
ref: panelButton,
|
|
@@ -15198,16 +15308,16 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15198
15308
|
onClick: () => side2("panel", !panelOpen),
|
|
15199
15309
|
"aria-label": panelOpen ? t.closePanel : t.openPanel,
|
|
15200
15310
|
title: panelOpen ? t.closePanel : t.openPanel,
|
|
15201
|
-
children: panelOpen ? /* @__PURE__ */ (0,
|
|
15311
|
+
children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.PanelRightClose, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.PanelRightOpen, { "aria-hidden": true })
|
|
15202
15312
|
}
|
|
15203
15313
|
);
|
|
15204
|
-
return /* @__PURE__ */ (0,
|
|
15205
|
-
/* @__PURE__ */ (0,
|
|
15206
|
-
start && /* @__PURE__ */ (0,
|
|
15314
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs", "data-theme": theme, children: [
|
|
15315
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("header", { className: "w100n-docs-bar", children: [
|
|
15316
|
+
start && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-start w100n-docs-slot", children: slot(start) }),
|
|
15207
15317
|
narrow && listToggle,
|
|
15208
|
-
/* @__PURE__ */ (0,
|
|
15209
|
-
/* @__PURE__ */ (0,
|
|
15210
|
-
renaming !== null && doc.data ? /* @__PURE__ */ (0,
|
|
15318
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-tile", "data-kind": doc.data?.kind, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Kind, { "aria-hidden": true }) }),
|
|
15319
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-heading", children: [
|
|
15320
|
+
renaming !== null && doc.data ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15211
15321
|
"input",
|
|
15212
15322
|
{
|
|
15213
15323
|
className: "w100n-docs-title w100n-docs-rename",
|
|
@@ -15225,7 +15335,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15225
15335
|
}
|
|
15226
15336
|
}
|
|
15227
15337
|
}
|
|
15228
|
-
) : /* @__PURE__ */ (0,
|
|
15338
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15229
15339
|
"strong",
|
|
15230
15340
|
{
|
|
15231
15341
|
className: "w100n-docs-title",
|
|
@@ -15234,31 +15344,31 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15234
15344
|
children: doc.data?.name ?? t.documents
|
|
15235
15345
|
}
|
|
15236
15346
|
),
|
|
15237
|
-
docbar ? /* @__PURE__ */ (0,
|
|
15238
|
-
i > 0 && /* @__PURE__ */ (0,
|
|
15347
|
+
docbar ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref: setMenusAt, className: "w100n-docs-menus" }) : crumbs.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-crumbs", children: crumbs.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { children: [
|
|
15348
|
+
i > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ChevronRight, { "aria-hidden": true }),
|
|
15239
15349
|
item
|
|
15240
|
-
] }, i)) }) : /* @__PURE__ */ (0,
|
|
15350
|
+
] }, i)) }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-hint", children: t.hint })
|
|
15241
15351
|
] }),
|
|
15242
|
-
versionId && /* @__PURE__ */ (0,
|
|
15243
|
-
versionId && text && /* @__PURE__ */ (0,
|
|
15244
|
-
/* @__PURE__ */ (0,
|
|
15352
|
+
versionId && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-badge", children: versions.data?.find((v) => v.id === versionId) && date(versions.data.find((v) => v.id === versionId).createdAt) }),
|
|
15353
|
+
versionId && text && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", "aria-pressed": comparing, onClick: () => setComparing(!comparing), children: [
|
|
15354
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FileDiff, { "aria-hidden": true }),
|
|
15245
15355
|
comparing ? t.hideChanges : t.showChanges
|
|
15246
15356
|
] }),
|
|
15247
|
-
versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0,
|
|
15248
|
-
/* @__PURE__ */ (0,
|
|
15357
|
+
versionId && here.documentId && host.restore && doc.data?.rights.edit && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-action", disabled: restoring === "busy", onClick: () => void restore(here.documentId, versionId), children: [
|
|
15358
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.RotateCcw, { "aria-hidden": true }),
|
|
15249
15359
|
t.restore
|
|
15250
15360
|
] }),
|
|
15251
|
-
restoring === "failed" && /* @__PURE__ */ (0,
|
|
15252
|
-
doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0,
|
|
15253
|
-
/* @__PURE__ */ (0,
|
|
15361
|
+
restoring === "failed" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-muted", children: t.restoreFailed }),
|
|
15362
|
+
doc.data?.convert && host.copyAs && !versionId && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", disabled: copying === "busy", onClick: () => void copyAs(doc.data), children: [
|
|
15363
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FileSpreadsheet, { "aria-hidden": true }),
|
|
15254
15364
|
t.copyAs
|
|
15255
15365
|
] }),
|
|
15256
|
-
copying === "failed" && /* @__PURE__ */ (0,
|
|
15257
|
-
kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ (0,
|
|
15258
|
-
kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0,
|
|
15259
|
-
renamed2 === "failed" && /* @__PURE__ */ (0,
|
|
15260
|
-
docbar && /* @__PURE__ */ (0,
|
|
15261
|
-
host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0,
|
|
15366
|
+
copying === "failed" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-muted", children: t.copyFailed }),
|
|
15367
|
+
kept?.id === here.documentId && kept.state === "done" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-muted", role: "status", children: t.templateSaved }),
|
|
15368
|
+
kept?.id === here.documentId && kept.state === "failed" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-muted", role: "alert", children: t.templateFailed }),
|
|
15369
|
+
renamed2 === "failed" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-muted", children: t.renameFailed }),
|
|
15370
|
+
docbar && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { ref: setStatusAt, className: "w100n-docs-status" }),
|
|
15371
|
+
host.send && doc.data && !versionId && !doc.data.id.includes(":") && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15262
15372
|
"button",
|
|
15263
15373
|
{
|
|
15264
15374
|
type: "button",
|
|
@@ -15267,138 +15377,138 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15267
15377
|
"aria-label": t.sendChat,
|
|
15268
15378
|
title: t.sendChat,
|
|
15269
15379
|
onClick: () => host.send(doc.data.id),
|
|
15270
|
-
children: /* @__PURE__ */ (0,
|
|
15380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Send, { "aria-hidden": true })
|
|
15271
15381
|
}
|
|
15272
15382
|
),
|
|
15273
|
-
sharing && /* @__PURE__ */ (0,
|
|
15383
|
+
sharing && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "w100n-docs-action w100n-docs-square", "aria-label": t.share, title: t.share, onClick: () => {
|
|
15274
15384
|
setTab("sharing");
|
|
15275
15385
|
side2("panel", true);
|
|
15276
|
-
}, children: /* @__PURE__ */ (0,
|
|
15386
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Share2, { "aria-hidden": true }) }),
|
|
15277
15387
|
doc.data && !versionId && actions?.(doc.data),
|
|
15278
15388
|
narrow && panelToggle,
|
|
15279
|
-
end && /* @__PURE__ */ (0,
|
|
15389
|
+
end && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-end w100n-docs-slot", children: slot(end) })
|
|
15280
15390
|
] }),
|
|
15281
|
-
/* @__PURE__ */ (0,
|
|
15282
|
-
listOpen && /* @__PURE__ */ (0,
|
|
15283
|
-
/* @__PURE__ */ (0,
|
|
15284
|
-
/* @__PURE__ */ (0,
|
|
15285
|
-
/* @__PURE__ */ (0,
|
|
15286
|
-
/* @__PURE__ */ (0,
|
|
15391
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: body, className: "w100n-docs-body", children: [
|
|
15392
|
+
listOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("aside", { className: "w100n-docs-side w100n-docs-list", "aria-label": t.documents, children: [
|
|
15393
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-head", children: [
|
|
15394
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-row", children: [
|
|
15395
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
15396
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Files, { "aria-hidden": true }),
|
|
15287
15397
|
t.documents,
|
|
15288
|
-
/* @__PURE__ */ (0,
|
|
15398
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: all.length })
|
|
15289
15399
|
] }),
|
|
15290
|
-
host.create && /* @__PURE__ */ (0,
|
|
15400
|
+
host.create && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-new", onKeyDown: (e) => {
|
|
15291
15401
|
if (e.key === "Escape" && adding) {
|
|
15292
15402
|
e.stopPropagation();
|
|
15293
15403
|
setAdding(false);
|
|
15294
15404
|
}
|
|
15295
15405
|
}, children: [
|
|
15296
|
-
/* @__PURE__ */ (0,
|
|
15297
|
-
/* @__PURE__ */ (0,
|
|
15298
|
-
/* @__PURE__ */ (0,
|
|
15299
|
-
/* @__PURE__ */ (0,
|
|
15406
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-action", "aria-haspopup": "menu", "aria-expanded": adding, disabled: sending === "busy", onClick: () => setAdding(!adding), children: [
|
|
15407
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Plus, { "aria-hidden": true }),
|
|
15408
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: sending === "busy" ? t.uploading : t.create }),
|
|
15409
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ChevronDown, { "aria-hidden": true })
|
|
15300
15410
|
] }),
|
|
15301
|
-
adding && /* @__PURE__ */ (0,
|
|
15302
|
-
/* @__PURE__ */ (0,
|
|
15411
|
+
adding && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { role: "menu", className: "w100n-docs-menu", children: [
|
|
15412
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15303
15413
|
setAdding(false);
|
|
15304
15414
|
setMaking(true);
|
|
15305
15415
|
}, children: [
|
|
15306
|
-
/* @__PURE__ */ (0,
|
|
15307
|
-
/* @__PURE__ */ (0,
|
|
15416
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FilePlus, { "aria-hidden": true }) }),
|
|
15417
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: t.newTitle })
|
|
15308
15418
|
] }),
|
|
15309
|
-
/* @__PURE__ */ (0,
|
|
15419
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15310
15420
|
setAdding(false);
|
|
15311
15421
|
upload.current.click();
|
|
15312
15422
|
}, children: [
|
|
15313
|
-
/* @__PURE__ */ (0,
|
|
15314
|
-
/* @__PURE__ */ (0,
|
|
15423
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Upload, { "aria-hidden": true }) }),
|
|
15424
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: t.uploadFile })
|
|
15315
15425
|
] })
|
|
15316
15426
|
] }),
|
|
15317
|
-
/* @__PURE__ */ (0,
|
|
15427
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { ref: upload, type: "file", hidden: true, "aria-label": t.uploadFile, accept: ".docx,.md,.markdown,.pdf,.xlsx,.csv,.html,.htm", onChange: (e) => {
|
|
15318
15428
|
const file = e.target.files?.[0];
|
|
15319
15429
|
e.target.value = "";
|
|
15320
15430
|
if (file) void send(file);
|
|
15321
15431
|
} })
|
|
15322
15432
|
] }),
|
|
15323
|
-
/* @__PURE__ */ (0,
|
|
15433
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { ref: listClose, type: "button", className: "w100n-docs-close", onClick: () => side2("list", false), "aria-label": t.closeList, title: t.closeList, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.X, { "aria-hidden": true }) })
|
|
15324
15434
|
] }),
|
|
15325
|
-
(spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0,
|
|
15435
|
+
(spaces.data?.length ?? 0) > 1 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-picker", onKeyDown: (e) => {
|
|
15326
15436
|
if (e.key !== "Escape" || !picking) return;
|
|
15327
15437
|
e.stopPropagation();
|
|
15328
15438
|
setPicking(false);
|
|
15329
15439
|
e.currentTarget.querySelector("button").focus();
|
|
15330
15440
|
}, children: [
|
|
15331
|
-
/* @__PURE__ */ (0,
|
|
15332
|
-
space ? /* @__PURE__ */ (0,
|
|
15333
|
-
/* @__PURE__ */ (0,
|
|
15334
|
-
!space && /* @__PURE__ */ (0,
|
|
15335
|
-
/* @__PURE__ */ (0,
|
|
15441
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": picking, onClick: () => setPicking(!picking), children: [
|
|
15442
|
+
space ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-dot", style: { background: space.color ?? void 0 } }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.LayoutGrid, { "aria-hidden": true }) }),
|
|
15443
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: space?.name ?? t.allProjects }),
|
|
15444
|
+
!space && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-count", children: all.length }),
|
|
15445
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ChevronDown, { "aria-hidden": true })
|
|
15336
15446
|
] }),
|
|
15337
|
-
picking && /* @__PURE__ */ (0,
|
|
15338
|
-
/* @__PURE__ */ (0,
|
|
15339
|
-
/* @__PURE__ */ (0,
|
|
15340
|
-
/* @__PURE__ */ (0,
|
|
15341
|
-
!spaceId && /* @__PURE__ */ (0,
|
|
15447
|
+
picking && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { role: "listbox", className: "w100n-docs-menu", children: [
|
|
15448
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "option", "aria-selected": !spaceId, onClick: () => pick(null), children: [
|
|
15449
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-all", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.LayoutGrid, { "aria-hidden": true }) }),
|
|
15450
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: t.allProjects }),
|
|
15451
|
+
!spaceId && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Check, { "aria-hidden": true })
|
|
15342
15452
|
] }),
|
|
15343
|
-
groups2.map((group) => /* @__PURE__ */ (0,
|
|
15344
|
-
group && /* @__PURE__ */ (0,
|
|
15345
|
-
(spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0,
|
|
15346
|
-
/* @__PURE__ */ (0,
|
|
15347
|
-
/* @__PURE__ */ (0,
|
|
15348
|
-
!spaceId && counts.get(item.id) ? /* @__PURE__ */ (0,
|
|
15349
|
-
item.id === spaceId && /* @__PURE__ */ (0,
|
|
15453
|
+
groups2.map((group) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { role: "group", "aria-label": group || void 0, children: [
|
|
15454
|
+
group && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-menu-caption", children: group }),
|
|
15455
|
+
(spaces.data ?? []).filter((item) => (item.group ?? "") === group).map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "option", "aria-selected": item.id === spaceId, onClick: () => pick(item.id), children: [
|
|
15456
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-dot", style: { background: item.color ?? void 0 } }),
|
|
15457
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: item.name }),
|
|
15458
|
+
!spaceId && counts.get(item.id) ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-count", children: counts.get(item.id) }) : null,
|
|
15459
|
+
item.id === spaceId && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Check, { "aria-hidden": true })
|
|
15350
15460
|
] }, item.id))
|
|
15351
15461
|
] }, group))
|
|
15352
15462
|
] })
|
|
15353
15463
|
] }),
|
|
15354
|
-
/* @__PURE__ */ (0,
|
|
15355
|
-
/* @__PURE__ */ (0,
|
|
15356
|
-
/* @__PURE__ */ (0,
|
|
15357
|
-
/* @__PURE__ */ (0,
|
|
15358
|
-
/* @__PURE__ */ (0,
|
|
15464
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-filters", children: [
|
|
15465
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
15466
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Search, { "aria-hidden": true }),
|
|
15467
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { ref: finder, value: query, onChange: (event) => setQuery(event.target.value), placeholder: t.search, "aria-label": t.search }),
|
|
15468
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("kbd", { children: "\u2318O" })
|
|
15359
15469
|
] }),
|
|
15360
|
-
present.length > 1 && /* @__PURE__ */ (0,
|
|
15470
|
+
present.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-types", onKeyDown: (e) => {
|
|
15361
15471
|
if (e.key !== "Escape" || !typing) return;
|
|
15362
15472
|
e.stopPropagation();
|
|
15363
15473
|
setTyping(false);
|
|
15364
15474
|
e.currentTarget.querySelector("button").focus();
|
|
15365
15475
|
}, children: [
|
|
15366
|
-
/* @__PURE__ */ (0,
|
|
15367
|
-
/* @__PURE__ */ (0,
|
|
15368
|
-
/* @__PURE__ */ (0,
|
|
15369
|
-
picked.length > 0 && /* @__PURE__ */ (0,
|
|
15370
|
-
/* @__PURE__ */ (0,
|
|
15476
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-field", "aria-haspopup": "listbox", "aria-expanded": typing, "data-on": picked.length > 0, onClick: () => setTyping(!typing), children: [
|
|
15477
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ListFilter, { "aria-hidden": true }),
|
|
15478
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: t.typeFilter }),
|
|
15479
|
+
picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-badge", children: picked.length }),
|
|
15480
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ChevronDown, { "aria-hidden": true })
|
|
15371
15481
|
] }),
|
|
15372
|
-
typing && /* @__PURE__ */ (0,
|
|
15482
|
+
typing && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { role: "listbox", "aria-multiselectable": true, "aria-label": t.kind, className: "w100n-docs-menu", children: [
|
|
15373
15483
|
present.map((item) => {
|
|
15374
15484
|
const Icon = icons3[item];
|
|
15375
15485
|
const on2 = picked.includes(item);
|
|
15376
|
-
return /* @__PURE__ */ (0,
|
|
15377
|
-
/* @__PURE__ */ (0,
|
|
15378
|
-
/* @__PURE__ */ (0,
|
|
15379
|
-
/* @__PURE__ */ (0,
|
|
15380
|
-
/* @__PURE__ */ (0,
|
|
15486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "option", "aria-selected": on2, onClick: () => setPicked(on2 ? picked.filter((k) => k !== item) : [...picked, item]), children: [
|
|
15487
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-box", children: on2 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Check, { "aria-hidden": true }) }),
|
|
15488
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-tile", "data-kind": item, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { "aria-hidden": true }) }),
|
|
15489
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: t.kinds[item] }),
|
|
15490
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-count", children: all.filter((doc2) => doc2.kind === item).length })
|
|
15381
15491
|
] }, item);
|
|
15382
15492
|
}),
|
|
15383
|
-
/* @__PURE__ */ (0,
|
|
15384
|
-
/* @__PURE__ */ (0,
|
|
15385
|
-
/* @__PURE__ */ (0,
|
|
15493
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-menu-foot", children: [
|
|
15494
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setPicked(present), children: t.selectAll }),
|
|
15495
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", onClick: () => setPicked([]), children: t.clearPick })
|
|
15386
15496
|
] })
|
|
15387
15497
|
] })
|
|
15388
15498
|
] })
|
|
15389
15499
|
] }),
|
|
15390
|
-
picked.length > 0 && /* @__PURE__ */ (0,
|
|
15500
|
+
picked.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.kind, children: picked.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", "aria-pressed": true, "aria-label": `${t.clearPick}: ${t.kinds[item]}`, onClick: () => setPicked(picked.filter((k) => k !== item)), children: [
|
|
15391
15501
|
t.kinds[item],
|
|
15392
|
-
/* @__PURE__ */ (0,
|
|
15502
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.X, { "aria-hidden": true })
|
|
15393
15503
|
] }, item)) })
|
|
15394
15504
|
] }),
|
|
15395
|
-
/* @__PURE__ */ (0,
|
|
15396
|
-
sending === "failed" && /* @__PURE__ */ (0,
|
|
15505
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-cards", children: [
|
|
15506
|
+
sending === "failed" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.uploadFailed }),
|
|
15397
15507
|
list.error && failed(list.retry),
|
|
15398
|
-
list.loading && !list.data && /* @__PURE__ */ (0,
|
|
15399
|
-
notice && /* @__PURE__ */ (0,
|
|
15400
|
-
list.data && !shown.length && /* @__PURE__ */ (0,
|
|
15401
|
-
list.data && /* @__PURE__ */ (0,
|
|
15508
|
+
list.loading && !list.data && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", children: t.loading }),
|
|
15509
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", role: "status", children: notice }),
|
|
15510
|
+
list.data && !shown.length && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", children: all.length ? t.nothing : t.empty }),
|
|
15511
|
+
list.data && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15402
15512
|
Tree,
|
|
15403
15513
|
{
|
|
15404
15514
|
items: shown,
|
|
@@ -15414,7 +15524,6 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15414
15524
|
onOpen: open,
|
|
15415
15525
|
onMenu: (item, e) => {
|
|
15416
15526
|
setSpot(null);
|
|
15417
|
-
setPeek(null);
|
|
15418
15527
|
setMenu({ item, x: Math.min(e.clientX, innerWidth - 290), y: Math.min(e.clientY, innerHeight - 440), sure: false });
|
|
15419
15528
|
},
|
|
15420
15529
|
onFolderMenu: host.create || host.makeFolder ? (at2, key2, e) => {
|
|
@@ -15425,43 +15534,37 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15425
15534
|
const item = all.find((x) => x.id === id);
|
|
15426
15535
|
if (item) moveTo(item, to);
|
|
15427
15536
|
} : void 0,
|
|
15428
|
-
onWarm: (item
|
|
15429
|
-
if (item) warm(item, at2);
|
|
15430
|
-
else {
|
|
15431
|
-
clearTimeout(hover.current);
|
|
15432
|
-
setPeek(null);
|
|
15433
|
-
}
|
|
15434
|
-
}
|
|
15537
|
+
onWarm: (item) => item ? warm(item) : clearTimeout(hover.current)
|
|
15435
15538
|
}
|
|
15436
15539
|
)
|
|
15437
15540
|
] })
|
|
15438
15541
|
] }),
|
|
15439
15542
|
!narrow && !listOpen && listToggle,
|
|
15440
|
-
/* @__PURE__ */ (0,
|
|
15543
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("main", { className: "w100n-docs-stage", children: [
|
|
15441
15544
|
!narrow && !panelOpen && panelToggle,
|
|
15442
|
-
/* @__PURE__ */ (0,
|
|
15545
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-bare", children: stage })
|
|
15443
15546
|
] }),
|
|
15444
|
-
doc.data && panelOpen && /* @__PURE__ */ (0,
|
|
15445
|
-
/* @__PURE__ */ (0,
|
|
15446
|
-
/* @__PURE__ */ (0,
|
|
15447
|
-
/* @__PURE__ */ (0,
|
|
15448
|
-
(panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0,
|
|
15547
|
+
doc.data && panelOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("aside", { ref: panel, className: "w100n-docs-side w100n-docs-panel", "aria-label": t.details, children: [
|
|
15548
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-head", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-row", children: [
|
|
15549
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-tabs", role: "tablist", "aria-label": t.details, "data-compact": panelTabs.length > 3, onKeyDown: rove, children: panelTabs.map(([key2, Icon, label]) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "tab", "aria-selected": tab === key2, tabIndex: tab === key2 ? 0 : -1, "aria-label": label, title: label, onClick: () => setTab(key2), children: [
|
|
15550
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Icon, { "aria-hidden": true }),
|
|
15551
|
+
(panelTabs.length < 4 || tab === key2 && panelTabs.length < 5) && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: label })
|
|
15449
15552
|
] }, key2)) }),
|
|
15450
|
-
/* @__PURE__ */ (0,
|
|
15553
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "w100n-docs-close", onClick: () => side2("panel", false), "aria-label": t.closePanel, title: t.closePanel, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.X, { "aria-hidden": true }) })
|
|
15451
15554
|
] }) }),
|
|
15452
|
-
/* @__PURE__ */ (0,
|
|
15453
|
-
tab === "outline" && (outline2.length ? /* @__PURE__ */ (0,
|
|
15454
|
-
now && /* @__PURE__ */ (0,
|
|
15455
|
-
/* @__PURE__ */ (0,
|
|
15456
|
-
/* @__PURE__ */ (0,
|
|
15555
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-panel-body", role: "tabpanel", "aria-label": panelTabs.find(([key2]) => key2 === tab)?.[2], children: [
|
|
15556
|
+
tab === "outline" && (outline2.length ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("nav", { className: "w100n-docs-outline", "aria-label": t.outline, children: [
|
|
15557
|
+
now && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-reading", children: [
|
|
15558
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { style: { width: `${Math.round(now.progress * 100)}%` } }) }),
|
|
15559
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("small", { children: [
|
|
15457
15560
|
Math.round(now.progress * 100),
|
|
15458
15561
|
"% ",
|
|
15459
15562
|
t.read
|
|
15460
15563
|
] })
|
|
15461
15564
|
] }),
|
|
15462
|
-
outline2.length > 8 && /* @__PURE__ */ (0,
|
|
15463
|
-
/* @__PURE__ */ (0,
|
|
15464
|
-
/* @__PURE__ */ (0,
|
|
15565
|
+
outline2.length > 8 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
15566
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Search, { "aria-hidden": true }),
|
|
15567
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("input", { value: hunt, onChange: (e) => setHunt(e.target.value), placeholder: t.findHeading, "aria-label": t.findHeading })
|
|
15465
15568
|
] }),
|
|
15466
15569
|
chapters.map((c, i) => {
|
|
15467
15570
|
const subs = words3.length ? c.subs.filter(hit) : c.subs;
|
|
@@ -15469,13 +15572,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15469
15572
|
const opened3 = words3.length > 0 || (fold[c.head.id] ?? i === reached);
|
|
15470
15573
|
const named3 = /^(\d+)[.)]?\s+(.+)$/.exec(c.head.text);
|
|
15471
15574
|
const mark = c.subs.findIndex((s) => s.id === now?.id);
|
|
15472
|
-
return /* @__PURE__ */ (0,
|
|
15473
|
-
/* @__PURE__ */ (0,
|
|
15474
|
-
/* @__PURE__ */ (0,
|
|
15475
|
-
/* @__PURE__ */ (0,
|
|
15476
|
-
/* @__PURE__ */ (0,
|
|
15575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-chapter", "data-state": reached < 0 ? void 0 : i < reached ? "done" : i === reached ? "now" : void 0, children: [
|
|
15576
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-chapter-row", children: [
|
|
15577
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-chapter-go", "aria-label": c.head.text, "aria-current": now?.id === c.head.id ? "location" : void 0, onClick: () => reach(c.head), children: [
|
|
15578
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-chapter-num", children: named3 ? named3[1] : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Bookmark, { "aria-hidden": true }) }),
|
|
15579
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: named3 ? named3[2] : c.head.text })
|
|
15477
15580
|
] }),
|
|
15478
|
-
c.subs.length > 0 && /* @__PURE__ */ (0,
|
|
15581
|
+
c.subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15479
15582
|
"button",
|
|
15480
15583
|
{
|
|
15481
15584
|
type: "button",
|
|
@@ -15485,13 +15588,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15485
15588
|
title: opened3 ? t.hideSections : t.showSections,
|
|
15486
15589
|
onClick: () => setFold({ ...fold, [c.head.id]: !opened3 }),
|
|
15487
15590
|
children: [
|
|
15488
|
-
/* @__PURE__ */ (0,
|
|
15489
|
-
opened3 ? /* @__PURE__ */ (0,
|
|
15591
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: c.subs.length }),
|
|
15592
|
+
opened3 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ChevronRight, { "aria-hidden": true })
|
|
15490
15593
|
]
|
|
15491
15594
|
}
|
|
15492
15595
|
)
|
|
15493
15596
|
] }),
|
|
15494
|
-
opened3 && subs.length > 0 && /* @__PURE__ */ (0,
|
|
15597
|
+
opened3 && subs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-sections", children: subs.map((s) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15495
15598
|
"button",
|
|
15496
15599
|
{
|
|
15497
15600
|
type: "button",
|
|
@@ -15500,7 +15603,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15500
15603
|
"data-state": i < reached || i === reached && c.subs.indexOf(s) < mark ? "done" : void 0,
|
|
15501
15604
|
"aria-current": now?.id === s.id ? "location" : void 0,
|
|
15502
15605
|
children: [
|
|
15503
|
-
/* @__PURE__ */ (0,
|
|
15606
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", { "aria-hidden": true }),
|
|
15504
15607
|
s.text
|
|
15505
15608
|
]
|
|
15506
15609
|
},
|
|
@@ -15508,47 +15611,47 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15508
15611
|
)) })
|
|
15509
15612
|
] }, c.head.id);
|
|
15510
15613
|
})
|
|
15511
|
-
] }) : /* @__PURE__ */ (0,
|
|
15512
|
-
tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ (0,
|
|
15513
|
-
tab === "versions" && /* @__PURE__ */ (0,
|
|
15614
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", children: t.noOutline })),
|
|
15615
|
+
tab === "links" && doc.data.kind === "markdown" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Backlinks, { host, current: doc.data, notes: notes3, t, onOpen: open }),
|
|
15616
|
+
tab === "versions" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-versions", children: [
|
|
15514
15617
|
versions.error && failed(versions.retry),
|
|
15515
|
-
(versions.data ?? []).map((item) => /* @__PURE__ */ (0,
|
|
15618
|
+
(versions.data ?? []).map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15516
15619
|
"button",
|
|
15517
15620
|
{
|
|
15518
15621
|
type: "button",
|
|
15519
15622
|
"aria-pressed": (versionId ?? "current") === item.id || !versionId && item.current,
|
|
15520
15623
|
onClick: () => view(item.current ? null : item.id),
|
|
15521
15624
|
children: [
|
|
15522
|
-
/* @__PURE__ */ (0,
|
|
15625
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("b", { children: [
|
|
15523
15626
|
date(item.createdAt),
|
|
15524
|
-
item.current && /* @__PURE__ */ (0,
|
|
15627
|
+
item.current && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w100n-docs-badge", children: t.current })
|
|
15525
15628
|
] }),
|
|
15526
|
-
/* @__PURE__ */ (0,
|
|
15629
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: [item.author?.name, size2(item.size), item.note].filter(Boolean).join(" \xB7 ") })
|
|
15527
15630
|
]
|
|
15528
15631
|
},
|
|
15529
15632
|
item.id
|
|
15530
15633
|
))
|
|
15531
15634
|
] }),
|
|
15532
|
-
tab === "details" && /* @__PURE__ */ (0,
|
|
15533
|
-
/* @__PURE__ */ (0,
|
|
15534
|
-
/* @__PURE__ */ (0,
|
|
15535
|
-
/* @__PURE__ */ (0,
|
|
15536
|
-
/* @__PURE__ */ (0,
|
|
15537
|
-
/* @__PURE__ */ (0,
|
|
15538
|
-
/* @__PURE__ */ (0,
|
|
15539
|
-
doc.data.updatedBy && /* @__PURE__ */ (0,
|
|
15540
|
-
/* @__PURE__ */ (0,
|
|
15541
|
-
/* @__PURE__ */ (0,
|
|
15635
|
+
tab === "details" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("dl", { className: "w100n-docs-details", children: [
|
|
15636
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.kind }),
|
|
15637
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: t.kinds[doc.data.kind] }),
|
|
15638
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.size }),
|
|
15639
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: size2(doc.data.size) }),
|
|
15640
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.updated }),
|
|
15641
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: date(doc.data.updatedAt) }),
|
|
15642
|
+
doc.data.updatedBy && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
15643
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.by }),
|
|
15644
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: doc.data.updatedBy.name })
|
|
15542
15645
|
] }),
|
|
15543
|
-
/* @__PURE__ */ (0,
|
|
15544
|
-
/* @__PURE__ */ (0,
|
|
15646
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dt", { children: t.rights }),
|
|
15647
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("dd", { children: [doc.data.rights.view && t.view, doc.data.rights.comment && t.comment, doc.data.rights.edit && t.edit].filter(Boolean).join(", ") })
|
|
15545
15648
|
] }),
|
|
15546
|
-
tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0,
|
|
15547
|
-
/* @__PURE__ */ (0,
|
|
15548
|
-
/* @__PURE__ */ (0,
|
|
15649
|
+
tab === "details" && host.exportAs && !!doc.data.exports?.length && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-about", children: [
|
|
15650
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "w100n-docs-caption", children: [
|
|
15651
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FileDown, { "aria-hidden": true }),
|
|
15549
15652
|
t.exportAs
|
|
15550
15653
|
] }),
|
|
15551
|
-
/* @__PURE__ */ (0,
|
|
15654
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-chips", children: doc.data.exports.map((format) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15552
15655
|
"button",
|
|
15553
15656
|
{
|
|
15554
15657
|
type: "button",
|
|
@@ -15556,22 +15659,22 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15556
15659
|
disabled: exporting === "busy",
|
|
15557
15660
|
onClick: () => void exportAs(doc.data, format),
|
|
15558
15661
|
children: [
|
|
15559
|
-
/* @__PURE__ */ (0,
|
|
15662
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FileDown, { "aria-hidden": true }),
|
|
15560
15663
|
format.toUpperCase()
|
|
15561
15664
|
]
|
|
15562
15665
|
},
|
|
15563
15666
|
format
|
|
15564
15667
|
)) }),
|
|
15565
|
-
exporting === "failed" && /* @__PURE__ */ (0,
|
|
15668
|
+
exporting === "failed" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", children: t.exportFailed })
|
|
15566
15669
|
] }),
|
|
15567
|
-
tab === "comments" && /* @__PURE__ */ (0,
|
|
15568
|
-
tab === "sharing" && sharing && /* @__PURE__ */ (0,
|
|
15569
|
-
tab === "signatures" && /* @__PURE__ */ (0,
|
|
15670
|
+
tab === "comments" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { ref: setBox }),
|
|
15671
|
+
tab === "sharing" && sharing && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Sharing, { host, doc: doc.data, t, language, team: names2.get(doc.data.spaceId) }),
|
|
15672
|
+
tab === "signatures" && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-versions", children: [
|
|
15570
15673
|
signatures.error && failed(signatures.retry),
|
|
15571
|
-
signatures.data?.length === 0 && /* @__PURE__ */ (0,
|
|
15674
|
+
signatures.data?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "w100n-docs-muted", children: t.noSignatures }),
|
|
15572
15675
|
(signatures.data ?? []).map((entry2) => {
|
|
15573
15676
|
const signed = versions.data?.find((v) => v.id === entry2.versionId);
|
|
15574
|
-
return /* @__PURE__ */ (0,
|
|
15677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15575
15678
|
"button",
|
|
15576
15679
|
{
|
|
15577
15680
|
type: "button",
|
|
@@ -15579,15 +15682,15 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15579
15682
|
"aria-pressed": !!signed && (versionId ?? versions.data?.find((v) => v.current)?.id) === signed.id,
|
|
15580
15683
|
onClick: () => view(signed.current ? null : signed.id),
|
|
15581
15684
|
children: [
|
|
15582
|
-
/* @__PURE__ */ (0,
|
|
15685
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("b", { children: [
|
|
15583
15686
|
entry2.signer.name,
|
|
15584
|
-
/* @__PURE__ */ (0,
|
|
15687
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "w100n-docs-badge", children: [
|
|
15585
15688
|
t.page,
|
|
15586
15689
|
" ",
|
|
15587
15690
|
entry2.page
|
|
15588
15691
|
] })
|
|
15589
15692
|
] }),
|
|
15590
|
-
/* @__PURE__ */ (0,
|
|
15693
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: [date(entry2.signedAt), t.methods[entry2.method], signed && (signed.current ? t.current : `${t.version} ${date(signed.createdAt)}`)].filter(Boolean).join(" \xB7 ") })
|
|
15591
15694
|
]
|
|
15592
15695
|
},
|
|
15593
15696
|
entry2.id
|
|
@@ -15598,7 +15701,7 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15598
15701
|
] })
|
|
15599
15702
|
] })
|
|
15600
15703
|
] }),
|
|
15601
|
-
jump && /* @__PURE__ */ (0,
|
|
15704
|
+
jump && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
15602
15705
|
Jump,
|
|
15603
15706
|
{
|
|
15604
15707
|
mode: jump,
|
|
@@ -15611,14 +15714,13 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15611
15714
|
place: (item) => [!spaceId && names2.get(item.spaceId), item.folder].filter(Boolean).join(" / ")
|
|
15612
15715
|
}
|
|
15613
15716
|
),
|
|
15614
|
-
making && /* @__PURE__ */ (0,
|
|
15717
|
+
making && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(NewDocument, { host, t, onClose: () => setMaking(false), onMade: (made2) => {
|
|
15615
15718
|
setMaking(false);
|
|
15616
15719
|
opened2(made2);
|
|
15617
15720
|
} }),
|
|
15618
|
-
|
|
15619
|
-
|
|
15620
|
-
/* @__PURE__ */ (0,
|
|
15621
|
-
menu.moving ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
15721
|
+
menu && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.fileActions, style: { left: menu.x, top: menu.y }, children: [
|
|
15722
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-context-head", children: card(menu.item) }),
|
|
15723
|
+
menu.moving ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "w100n-docs-context-list", children: ["", ...dirs.data.get(menu.item.spaceId)].map((folder2) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
15622
15724
|
"button",
|
|
15623
15725
|
{
|
|
15624
15726
|
type: "button",
|
|
@@ -15627,99 +15729,99 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15627
15729
|
onClick: () => moveTo(menu.item, { spaceId: menu.item.spaceId, folder: folder2 }),
|
|
15628
15730
|
style: { paddingLeft: 10 + 14 * (folder2 ? folder2.split("/").length : 0) },
|
|
15629
15731
|
children: [
|
|
15630
|
-
/* @__PURE__ */ (0,
|
|
15732
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Folder, { "aria-hidden": true }),
|
|
15631
15733
|
folder2 ? folder2.split("/").pop() : names2.get(menu.item.spaceId) ?? t.topLevel
|
|
15632
15734
|
]
|
|
15633
15735
|
},
|
|
15634
15736
|
folder2
|
|
15635
|
-
)) }) : menu.sure ? /* @__PURE__ */ (0,
|
|
15636
|
-
/* @__PURE__ */ (0,
|
|
15637
|
-
/* @__PURE__ */ (0,
|
|
15638
|
-
/* @__PURE__ */ (0,
|
|
15639
|
-
/* @__PURE__ */ (0,
|
|
15640
|
-
/* @__PURE__ */ (0,
|
|
15737
|
+
)) }) : menu.sure ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-context-ask", children: [
|
|
15738
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: t.trashAsk.replace("{name}", menu.item.name) }),
|
|
15739
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
15740
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setMenu({ ...menu, sure: false }), children: t.cancel }),
|
|
15741
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => void drop2(menu.item), children: [
|
|
15742
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Trash2, { "aria-hidden": true }),
|
|
15641
15743
|
t.trash
|
|
15642
15744
|
] })
|
|
15643
15745
|
] })
|
|
15644
|
-
] }) : /* @__PURE__ */ (0,
|
|
15645
|
-
/* @__PURE__ */ (0,
|
|
15746
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
15747
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15646
15748
|
setMenu(null);
|
|
15647
15749
|
open(menu.item);
|
|
15648
15750
|
}, children: [
|
|
15649
|
-
/* @__PURE__ */ (0,
|
|
15751
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FileText, { "aria-hidden": true }),
|
|
15650
15752
|
t.openFile
|
|
15651
15753
|
] }),
|
|
15652
|
-
host.href && /* @__PURE__ */ (0,
|
|
15754
|
+
host.href && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15653
15755
|
setMenu(null);
|
|
15654
15756
|
window.open(host.href(menu.item.id), "_blank", "noopener");
|
|
15655
15757
|
}, children: [
|
|
15656
|
-
/* @__PURE__ */ (0,
|
|
15758
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.ExternalLink, { "aria-hidden": true }),
|
|
15657
15759
|
t.openTab
|
|
15658
15760
|
] }),
|
|
15659
|
-
host.href && /* @__PURE__ */ (0,
|
|
15660
|
-
/* @__PURE__ */ (0,
|
|
15761
|
+
host.href && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => navigator.clipboard.writeText(host.href(menu.item.id)), t.linkCopied), children: [
|
|
15762
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Link, { "aria-hidden": true }),
|
|
15661
15763
|
t.copyLink
|
|
15662
15764
|
] }),
|
|
15663
|
-
host.send && /* @__PURE__ */ (0,
|
|
15765
|
+
host.send && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15664
15766
|
setMenu(null);
|
|
15665
15767
|
host.send(menu.item.id);
|
|
15666
15768
|
}, children: [
|
|
15667
|
-
/* @__PURE__ */ (0,
|
|
15769
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Send, { "aria-hidden": true }),
|
|
15668
15770
|
t.sendChat
|
|
15669
15771
|
] }),
|
|
15670
|
-
/* @__PURE__ */ (0,
|
|
15671
|
-
host.rename && /* @__PURE__ */ (0,
|
|
15772
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", {}),
|
|
15773
|
+
host.rename && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15672
15774
|
const item = menu.item;
|
|
15673
15775
|
setMenu(null);
|
|
15674
15776
|
setEdit({ key: `file:${item.id}`, text: item.name.replace(/\.[^.]+$/, ""), run: (text2) => retitle(item, text2) });
|
|
15675
15777
|
}, children: [
|
|
15676
|
-
/* @__PURE__ */ (0,
|
|
15778
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Pencil, { "aria-hidden": true }),
|
|
15677
15779
|
t.rename
|
|
15678
15780
|
] }),
|
|
15679
|
-
host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */ (0,
|
|
15680
|
-
/* @__PURE__ */ (0,
|
|
15781
|
+
host.move && dirs.data?.has(menu.item.spaceId) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", "aria-haspopup": "menu", onClick: () => setMenu({ ...menu, moving: true }), children: [
|
|
15782
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FolderInput, { "aria-hidden": true }),
|
|
15681
15783
|
t.moveTo
|
|
15682
15784
|
] }),
|
|
15683
|
-
host.create && /* @__PURE__ */ (0,
|
|
15684
|
-
/* @__PURE__ */ (0,
|
|
15785
|
+
host.create && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(async () => copy2(await host.document(menu.item.id))), children: [
|
|
15786
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Copy, { "aria-hidden": true }),
|
|
15685
15787
|
t.makeCopy
|
|
15686
15788
|
] }),
|
|
15687
|
-
/* @__PURE__ */ (0,
|
|
15688
|
-
/* @__PURE__ */ (0,
|
|
15789
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => fetchFile(menu.item)), children: [
|
|
15790
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Download, { "aria-hidden": true }),
|
|
15689
15791
|
t.download
|
|
15690
15792
|
] }),
|
|
15691
|
-
host.saveTemplate && /* @__PURE__ */ (0,
|
|
15692
|
-
/* @__PURE__ */ (0,
|
|
15793
|
+
host.saveTemplate && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => void act(() => host.saveTemplate(menu.item.id), t.templateSaved), children: [
|
|
15794
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Bookmark, { "aria-hidden": true }),
|
|
15693
15795
|
t.saveTemplate
|
|
15694
15796
|
] }),
|
|
15695
|
-
/* @__PURE__ */ (0,
|
|
15797
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15696
15798
|
setMenu(null);
|
|
15697
15799
|
open(menu.item);
|
|
15698
15800
|
setTab("details");
|
|
15699
15801
|
side2("panel", true);
|
|
15700
15802
|
}, children: [
|
|
15701
|
-
/* @__PURE__ */ (0,
|
|
15803
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Info, { "aria-hidden": true }),
|
|
15702
15804
|
t.details
|
|
15703
15805
|
] }),
|
|
15704
|
-
host.remove && /* @__PURE__ */ (0,
|
|
15705
|
-
/* @__PURE__ */ (0,
|
|
15706
|
-
/* @__PURE__ */ (0,
|
|
15707
|
-
/* @__PURE__ */ (0,
|
|
15806
|
+
host.remove && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
15807
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", {}),
|
|
15808
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setMenu({ ...menu, sure: true }), children: [
|
|
15809
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Trash2, { "aria-hidden": true }),
|
|
15708
15810
|
t.trash
|
|
15709
15811
|
] })
|
|
15710
15812
|
] })
|
|
15711
15813
|
] })
|
|
15712
15814
|
] }),
|
|
15713
|
-
spot3 && /* @__PURE__ */ (0,
|
|
15714
|
-
/* @__PURE__ */ (0,
|
|
15715
|
-
/* @__PURE__ */ (0,
|
|
15716
|
-
spot3.at.folder && /* @__PURE__ */ (0,
|
|
15815
|
+
spot3 && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: popup, className: "w100n-docs-menu w100n-docs-context", role: "menu", "aria-label": t.folderActions, style: { left: spot3.x, top: spot3.y }, children: [
|
|
15816
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-context-head", children: [
|
|
15817
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("b", { children: folderNamed(spot3.at) }),
|
|
15818
|
+
spot3.at.folder && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("small", { children: [names2.get(spot3.at.spaceId), ...spot3.at.folder.split("/").slice(0, -1)].filter(Boolean).join(" / ") })
|
|
15717
15819
|
] }),
|
|
15718
|
-
spot3.sure ? /* @__PURE__ */ (0,
|
|
15719
|
-
/* @__PURE__ */ (0,
|
|
15720
|
-
/* @__PURE__ */ (0,
|
|
15721
|
-
/* @__PURE__ */ (0,
|
|
15722
|
-
/* @__PURE__ */ (0,
|
|
15820
|
+
spot3.sure ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "w100n-docs-context-ask", children: [
|
|
15821
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { children: t.folderTrashAsk.replace("{name}", folderNamed(spot3.at)) }),
|
|
15822
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "w100n-pdf-dialog-end", children: [
|
|
15823
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("button", { type: "button", className: "w100n-pdf-link", onClick: () => setSpot({ ...spot3, sure: false }), children: t.cancel }),
|
|
15824
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => {
|
|
15723
15825
|
const at2 = spot3.at;
|
|
15724
15826
|
const inside3 = doc.data && doc.data.spaceId === at2.spaceId && `${doc.data.folder ?? ""}/`.startsWith(`${at2.folder}/`);
|
|
15725
15827
|
void act(() => host.removeFolder(at2), t.trashed).then(() => {
|
|
@@ -15727,42 +15829,42 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15727
15829
|
if (inside3) go({ spaceId: here.spaceId, documentId: null });
|
|
15728
15830
|
});
|
|
15729
15831
|
}, children: [
|
|
15730
|
-
/* @__PURE__ */ (0,
|
|
15832
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Trash2, { "aria-hidden": true }),
|
|
15731
15833
|
t.trash
|
|
15732
15834
|
] })
|
|
15733
15835
|
] })
|
|
15734
|
-
] }) : /* @__PURE__ */ (0,
|
|
15735
|
-
host.create && /* @__PURE__ */ (0,
|
|
15836
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
15837
|
+
host.create && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15736
15838
|
const at2 = spot3.at;
|
|
15737
15839
|
setSpot(null);
|
|
15738
15840
|
void note(t.untitled, true, at2);
|
|
15739
15841
|
}, children: [
|
|
15740
|
-
/* @__PURE__ */ (0,
|
|
15842
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FilePlus, { "aria-hidden": true }),
|
|
15741
15843
|
t.newNoteHere
|
|
15742
15844
|
] }),
|
|
15743
|
-
host.makeFolder && /* @__PURE__ */ (0,
|
|
15845
|
+
host.makeFolder && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15744
15846
|
const at2 = spot3.at;
|
|
15745
15847
|
setSpot(null);
|
|
15746
15848
|
setEdit({ key: `new:${spot3.key}`, text: t.newFolder, run: (name) => act(() => host.makeFolder(at2, name)).then(refresh) });
|
|
15747
15849
|
}, children: [
|
|
15748
|
-
/* @__PURE__ */ (0,
|
|
15850
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.FolderPlus, { "aria-hidden": true }),
|
|
15749
15851
|
t.newFolder
|
|
15750
15852
|
] }),
|
|
15751
|
-
spot3.at.folder && host.renameFolder && /* @__PURE__ */ (0,
|
|
15752
|
-
/* @__PURE__ */ (0,
|
|
15753
|
-
/* @__PURE__ */ (0,
|
|
15853
|
+
spot3.at.folder && host.renameFolder && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
15854
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", {}),
|
|
15855
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", onClick: () => {
|
|
15754
15856
|
const at2 = spot3.at;
|
|
15755
15857
|
setSpot(null);
|
|
15756
15858
|
setEdit({ key: `dir:${spot3.key}`, text: folderNamed(at2), run: (name) => name === folderNamed(at2) ? Promise.resolve() : act(() => host.renameFolder(at2, name)).then(refresh) });
|
|
15757
15859
|
}, children: [
|
|
15758
|
-
/* @__PURE__ */ (0,
|
|
15860
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Pencil, { "aria-hidden": true }),
|
|
15759
15861
|
t.renameFolder
|
|
15760
15862
|
] })
|
|
15761
15863
|
] }),
|
|
15762
|
-
spot3.at.folder && host.removeFolder && /* @__PURE__ */ (0,
|
|
15763
|
-
/* @__PURE__ */ (0,
|
|
15764
|
-
/* @__PURE__ */ (0,
|
|
15765
|
-
/* @__PURE__ */ (0,
|
|
15864
|
+
spot3.at.folder && host.removeFolder && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
15865
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("hr", {}),
|
|
15866
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("button", { type: "button", role: "menuitem", "data-tone": "red", onClick: () => setSpot({ ...spot3, sure: true }), children: [
|
|
15867
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react14.Trash2, { "aria-hidden": true }),
|
|
15766
15868
|
t.trashFolder
|
|
15767
15869
|
] })
|
|
15768
15870
|
] })
|
|
@@ -15774,23 +15876,23 @@ function DocumentsWorkspace({ host, language = "en", theme = "light", place: pla
|
|
|
15774
15876
|
|
|
15775
15877
|
// src/FilePreview.tsx
|
|
15776
15878
|
var import_react20 = require("react");
|
|
15777
|
-
var
|
|
15879
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
15778
15880
|
function FilePreview({ url, name, mimeType, size: size2 = 0, bytes, pdfWorker }) {
|
|
15779
15881
|
const [source] = (0, import_react20.useState)(() => ({ pdfWorker, content: () => bytes ? bytes(url) : fetch(url, { credentials: "include" }).then((res) => res.ok ? res.arrayBuffer() : Promise.reject(new Error(String(res.status)))) }));
|
|
15780
15882
|
const kind = kindOf(name, mimeType);
|
|
15781
15883
|
if (!kind) return null;
|
|
15782
|
-
return /* @__PURE__ */ (0,
|
|
15884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w100n-preview", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Thumb, { host: source, item: { id: url.split("?")[0], spaceId: "", name, kind, size: size2, updatedAt: "" } }) });
|
|
15783
15885
|
}
|
|
15784
15886
|
|
|
15785
15887
|
// src/GuestDocument.tsx
|
|
15786
15888
|
var import_react21 = require("react");
|
|
15787
|
-
var
|
|
15889
|
+
var import_lucide_react15 = require("lucide-react");
|
|
15788
15890
|
init_text();
|
|
15789
15891
|
init_useLoad();
|
|
15790
|
-
var
|
|
15892
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
15791
15893
|
var TextEditor4 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_TextEditor(), TextEditor_exports)));
|
|
15792
15894
|
var SheetView4 = (0, import_react21.lazy)(() => Promise.resolve().then(() => (init_SheetView(), SheetView_exports)));
|
|
15793
|
-
var icons4 = { docx:
|
|
15895
|
+
var icons4 = { docx: import_lucide_react15.FileText, markdown: import_lucide_react15.FileType, pdf: import_lucide_react15.Files, sheet: import_lucide_react15.FileSpreadsheet, slides: import_lucide_react15.Presentation };
|
|
15794
15896
|
var GuestRefused = class extends Error {
|
|
15795
15897
|
constructor(reason, file = "", sharedBy = "") {
|
|
15796
15898
|
super(reason);
|
|
@@ -15848,18 +15950,18 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15848
15950
|
};
|
|
15849
15951
|
const top = (file2, badge) => {
|
|
15850
15952
|
const kind2 = file2 ? kindOf(file2.name, file2.mimeType) : null;
|
|
15851
|
-
const Kind = kind2 ? icons4[kind2] :
|
|
15852
|
-
return /* @__PURE__ */ (0,
|
|
15853
|
-
brand && /* @__PURE__ */ (0,
|
|
15854
|
-
file2 && /* @__PURE__ */ (0,
|
|
15855
|
-
/* @__PURE__ */ (0,
|
|
15856
|
-
/* @__PURE__ */ (0,
|
|
15857
|
-
/* @__PURE__ */ (0,
|
|
15858
|
-
file2.sharedBy && /* @__PURE__ */ (0,
|
|
15953
|
+
const Kind = kind2 ? icons4[kind2] : import_lucide_react15.FileText;
|
|
15954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("header", { className: "w100n-docs-bar w100n-guest-bar", children: [
|
|
15955
|
+
brand && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w100n-guest-brand", children: brand }),
|
|
15956
|
+
file2 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
|
|
15957
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w100n-docs-tile", "data-kind": kind2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Kind, { "aria-hidden": true }) }),
|
|
15958
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-docs-heading", children: [
|
|
15959
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { className: "w100n-docs-title", children: file2.name }),
|
|
15960
|
+
file2.sharedBy && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w100n-docs-crumbs", children: t.sharedBy.replace("{name}", file2.sharedBy) })
|
|
15859
15961
|
] }),
|
|
15860
|
-
badge && /* @__PURE__ */ (0,
|
|
15861
|
-
file2.download && /* @__PURE__ */ (0,
|
|
15862
|
-
(kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0,
|
|
15962
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w100n-docs-badge", "data-kind": kind2, children: badge }),
|
|
15963
|
+
file2.download && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-docs-end", children: [
|
|
15964
|
+
(kind2 === "docx" || kind2 === "markdown" || kind2 === "sheet" || kind2 === "slides") && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
15863
15965
|
"button",
|
|
15864
15966
|
{
|
|
15865
15967
|
type: "button",
|
|
@@ -15870,41 +15972,41 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15870
15972
|
"aria-label": t.pdfCopy,
|
|
15871
15973
|
title: t.pdfCopy,
|
|
15872
15974
|
children: [
|
|
15873
|
-
/* @__PURE__ */ (0,
|
|
15874
|
-
/* @__PURE__ */ (0,
|
|
15975
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react15.FileDown, { "aria-hidden": true }),
|
|
15976
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: t.pdfCopy })
|
|
15875
15977
|
]
|
|
15876
15978
|
}
|
|
15877
15979
|
),
|
|
15878
|
-
/* @__PURE__ */ (0,
|
|
15879
|
-
/* @__PURE__ */ (0,
|
|
15880
|
-
/* @__PURE__ */ (0,
|
|
15980
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "button", className: "w100n-docs-action", "data-tone": "blue", disabled: saving === "busy", onClick: () => void download("file"), "aria-label": t.download, title: t.download, children: [
|
|
15981
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react15.Download, { "aria-hidden": true }),
|
|
15982
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: t.download })
|
|
15881
15983
|
] })
|
|
15882
15984
|
] })
|
|
15883
15985
|
] })
|
|
15884
15986
|
] });
|
|
15885
15987
|
};
|
|
15886
|
-
const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0,
|
|
15988
|
+
const gate = (tone, Icon, title, body, form) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
15887
15989
|
top(null, null),
|
|
15888
|
-
/* @__PURE__ */ (0,
|
|
15889
|
-
/* @__PURE__ */ (0,
|
|
15890
|
-
/* @__PURE__ */ (0,
|
|
15891
|
-
/* @__PURE__ */ (0,
|
|
15990
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w100n-guest-gate", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-guest-card", children: [
|
|
15991
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w100n-share-tile", "data-tone": tone, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon, { "aria-hidden": true }) }),
|
|
15992
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h2", { children: title }),
|
|
15993
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { children: body }),
|
|
15892
15994
|
form
|
|
15893
15995
|
] }) })
|
|
15894
15996
|
] });
|
|
15895
15997
|
if (opened2.error) {
|
|
15896
15998
|
const refused = opened2.error instanceof GuestRefused ? opened2.error : null;
|
|
15897
|
-
if (refused?.reason === "ended") return gate("slate",
|
|
15898
|
-
if (refused?.reason === "missing") return gate("slate",
|
|
15999
|
+
if (refused?.reason === "ended") return gate("slate", import_lucide_react15.Ban, t.endedTitle, t.endedText);
|
|
16000
|
+
if (refused?.reason === "missing") return gate("slate", import_lucide_react15.Ban, t.missingTitle, t.missingText);
|
|
15899
16001
|
if (refused?.reason === "password" || refused?.reason === "wrong" || refused?.reason === "name") {
|
|
15900
16002
|
const password = refused.reason !== "name";
|
|
15901
16003
|
const shared = refused.sharedBy ? `${t.sharedBy.replace("{name}", refused.sharedBy)}. ` : "";
|
|
15902
16004
|
return gate(
|
|
15903
16005
|
"violet",
|
|
15904
|
-
password ?
|
|
16006
|
+
password ? import_lucide_react15.Lock : import_lucide_react15.UserRound,
|
|
15905
16007
|
refused.file || t.documents,
|
|
15906
16008
|
shared + (password ? t.passwordAsk : t.nameAsk),
|
|
15907
|
-
/* @__PURE__ */ (0,
|
|
16009
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { className: "w100n-guest-form", onSubmit: (e) => {
|
|
15908
16010
|
e.preventDefault();
|
|
15909
16011
|
if (!typed.trim()) return;
|
|
15910
16012
|
if (password) setAsk({ ...ask, password: typed });
|
|
@@ -15914,7 +16016,7 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15914
16016
|
}
|
|
15915
16017
|
setTyped("");
|
|
15916
16018
|
}, children: [
|
|
15917
|
-
/* @__PURE__ */ (0,
|
|
16019
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
15918
16020
|
"input",
|
|
15919
16021
|
{
|
|
15920
16022
|
className: "w100n-share-input",
|
|
@@ -15927,21 +16029,21 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15927
16029
|
onChange: (e) => setTyped(e.target.value)
|
|
15928
16030
|
}
|
|
15929
16031
|
),
|
|
15930
|
-
refused.reason === "wrong" && /* @__PURE__ */ (0,
|
|
15931
|
-
/* @__PURE__ */ (0,
|
|
15932
|
-
/* @__PURE__ */ (0,
|
|
16032
|
+
refused.reason === "wrong" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "w100n-docs-muted", role: "alert", children: t.wrongPassword }),
|
|
16033
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("button", { type: "submit", className: "w100n-docs-action", disabled: !typed.trim(), children: [
|
|
16034
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react15.Eye, { "aria-hidden": true }),
|
|
15933
16035
|
t.openDoc
|
|
15934
16036
|
] })
|
|
15935
16037
|
] })
|
|
15936
16038
|
);
|
|
15937
16039
|
}
|
|
15938
|
-
if (refused?.reason === "busy") return gate("slate",
|
|
15939
|
-
return gate("slate",
|
|
16040
|
+
if (refused?.reason === "busy") return gate("slate", import_lucide_react15.Ban, t.failed, t.tooMany);
|
|
16041
|
+
return gate("slate", import_lucide_react15.Ban, t.failed, "", /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "w100n-docs-action", onClick: opened2.retry, children: t.retry }));
|
|
15940
16042
|
}
|
|
15941
16043
|
const file = opened2.data;
|
|
15942
|
-
if (!file) return /* @__PURE__ */ (0,
|
|
16044
|
+
if (!file) return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
15943
16045
|
top(null, null),
|
|
15944
|
-
/* @__PURE__ */ (0,
|
|
16046
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w100n-docs-empty", children: t.loading })
|
|
15945
16047
|
] });
|
|
15946
16048
|
const kind = kindOf(file.name, file.mimeType);
|
|
15947
16049
|
const text = kind === "docx" || kind === "markdown";
|
|
@@ -15949,23 +16051,23 @@ function GuestDocument({ host, language = "en", theme = "light", brand }) {
|
|
|
15949
16051
|
const rights = { view: true, comment: talk, edit: false };
|
|
15950
16052
|
const quiet3 = () => {
|
|
15951
16053
|
};
|
|
15952
|
-
let stage = /* @__PURE__ */ (0,
|
|
15953
|
-
if (text) stage = /* @__PURE__ */ (0,
|
|
15954
|
-
else if (kind === "pdf") stage = /* @__PURE__ */ (0,
|
|
15955
|
-
else if (kind === "slides") stage = /* @__PURE__ */ (0,
|
|
15956
|
-
else if (kind === "sheet") stage = /* @__PURE__ */ (0,
|
|
15957
|
-
return /* @__PURE__ */ (0,
|
|
16054
|
+
let stage = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w100n-docs-empty", children: t.unsupported });
|
|
16055
|
+
if (text) stage = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TextEditor4, { kind, bytes: file.bytes, t, language, rights, host: talk ? notes3 : void 0, documentId: file.id, onOutline: quiet3, slot: talk ? slot : null }) });
|
|
16056
|
+
else if (kind === "pdf") stage = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(PdfView, { bytes: file.bytes, t, language, worker: host.pdfWorker, rights, documentId: file.id, onOutline: quiet3 });
|
|
16057
|
+
else if (kind === "slides") stage = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SlidesView, { html: new TextDecoder().decode(file.bytes), name: file.name, rights, language, theme, onOutline: quiet3 });
|
|
16058
|
+
else if (kind === "sheet") stage = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react21.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w100n-docs-empty", children: t.loading }), children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SheetView4, { bytes: file.bytes, name: file.name, kind: /\.csv$/i.test(file.name) || file.mimeType === "text/csv" ? "csv" : "xlsx", rights, language, theme, documentId: file.id }) });
|
|
16059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-docs w100n-guest", "data-theme": theme, children: [
|
|
15958
16060
|
top(file, talk ? t.badgeComment : t.badgeRead),
|
|
15959
|
-
saving === "failed" && /* @__PURE__ */ (0,
|
|
15960
|
-
/* @__PURE__ */ (0,
|
|
15961
|
-
/* @__PURE__ */ (0,
|
|
15962
|
-
talk && /* @__PURE__ */ (0,
|
|
15963
|
-
/* @__PURE__ */ (0,
|
|
15964
|
-
/* @__PURE__ */ (0,
|
|
15965
|
-
/* @__PURE__ */ (0,
|
|
16061
|
+
saving === "failed" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "w100n-docs-muted w100n-guest-note", role: "alert", children: t.exportFailed }),
|
|
16062
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-docs-body w100n-guest-body", children: [
|
|
16063
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("main", { className: "w100n-docs-stage", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "w100n-docs-bare", children: stage }) }),
|
|
16064
|
+
talk && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("aside", { className: "w100n-docs-side w100n-docs-panel w100n-guest-panel", "aria-label": t.comments, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w100n-docs-panel-body", children: [
|
|
16065
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "w100n-share-field", children: [
|
|
16066
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: t.yourName }),
|
|
16067
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("input", { className: "w100n-share-input", value: name, autoComplete: "name", placeholder: t.yourName, onChange: (e) => typeName(e.target.value) })
|
|
15966
16068
|
] }),
|
|
15967
|
-
/* @__PURE__ */ (0,
|
|
15968
|
-
/* @__PURE__ */ (0,
|
|
16069
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "w100n-docs-muted", children: name.trim() ? t.nameHint : t.nameNeeded }),
|
|
16070
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { ref: setSlot })
|
|
15969
16071
|
] }) })
|
|
15970
16072
|
] })
|
|
15971
16073
|
] });
|