@w100n/documents 0.16.0 → 0.16.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-EFBSMY7K.js → SheetView-FVLKQR7J.js} +4 -4
- package/dist/{TextEditor-MGCSGGGA.js → TextEditor-BF6HCNHL.js} +389 -343
- package/dist/TextEditor-BF6HCNHL.js.map +1 -0
- package/dist/{chunk-2L3TK7UF.js → chunk-GN3ZOD36.js} +3 -3
- package/dist/{chunk-2L3TK7UF.js.map → chunk-GN3ZOD36.js.map} +1 -1
- package/dist/{chunk-RKV3N6OS.js → chunk-LZYITB56.js} +22 -1
- package/dist/chunk-LZYITB56.js.map +1 -0
- package/dist/{chunk-3OLRFIHQ.js → chunk-NPVH2YDI.js} +2 -2
- package/dist/collab.cjs +22 -1
- package/dist/collab.cjs.map +1 -1
- package/dist/collab.d.cts +1 -1
- package/dist/collab.d.ts +1 -1
- package/dist/collab.js +2 -2
- package/dist/index.cjs +992 -873
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +52 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +58 -14
- package/dist/index.js.map +1 -1
- package/dist/kinds.d.cts +1 -1
- package/dist/kinds.d.ts +1 -1
- package/dist/memory.cjs +25 -2
- package/dist/memory.cjs.map +1 -1
- package/dist/memory.d.cts +3 -2
- package/dist/memory.d.ts +3 -2
- package/dist/memory.js +25 -2
- package/dist/memory.js.map +1 -1
- package/dist/{types-BTsVooZw.d.cts → types-DNcaU6SK.d.cts} +9 -0
- package/dist/{types-BTsVooZw.d.ts → types-DNcaU6SK.d.ts} +9 -0
- package/package.json +1 -1
- package/dist/TextEditor-MGCSGGGA.js.map +0 -1
- package/dist/chunk-RKV3N6OS.js.map +0 -1
- /package/dist/{SheetView-EFBSMY7K.js.map → SheetView-FVLKQR7J.js.map} +0 -0
- /package/dist/{chunk-3OLRFIHQ.js.map → chunk-NPVH2YDI.js.map} +0 -0
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-QDH7EZAF.js";
|
|
5
5
|
import {
|
|
6
6
|
useLive
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NPVH2YDI.js";
|
|
8
8
|
import {
|
|
9
9
|
a4,
|
|
10
10
|
align,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
searching,
|
|
24
24
|
spacing,
|
|
25
25
|
suggesting
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GN3ZOD36.js";
|
|
27
27
|
import {
|
|
28
28
|
fromMarkdown,
|
|
29
29
|
toMarkdown,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
rove,
|
|
34
34
|
useRestore
|
|
35
35
|
} from "./chunk-TDP6OJET.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-LZYITB56.js";
|
|
37
37
|
import {
|
|
38
38
|
mathml,
|
|
39
39
|
readDocx,
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
WifiOff,
|
|
107
107
|
X
|
|
108
108
|
} from "lucide-react";
|
|
109
|
-
import { Fragment as Fragment2, useEffect, useRef as
|
|
109
|
+
import { Fragment as Fragment2, useEffect, useRef as useRef3, useState as useState3 } from "react";
|
|
110
110
|
import { createPortal } from "react-dom";
|
|
111
111
|
|
|
112
112
|
// src/viewers/DocxView.tsx
|
|
@@ -159,8 +159,70 @@ function DocxView({ bytes, onOutline, failed }) {
|
|
|
159
159
|
] });
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
// src/editor/Mentions.tsx
|
|
163
|
+
import { useRef as useRef2, useState as useState2 } from "react";
|
|
164
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
165
|
+
var tagged = (body, people) => people.filter((p) => body.toLocaleLowerCase().includes(`@${p.name.toLocaleLowerCase()}`));
|
|
166
|
+
function Mentions({ value, onChange, onSend, people, label, placeholder, autoFocus }) {
|
|
167
|
+
const field = useRef2(null);
|
|
168
|
+
const [caret, setCaret] = useState2(0);
|
|
169
|
+
const [at, setAt] = useState2(0);
|
|
170
|
+
const [shut, setShut] = useState2(false);
|
|
171
|
+
const typed = /(?:^|\s)@([\p{L}\p{N}.'-]*)$/u.exec(value.slice(0, caret));
|
|
172
|
+
const query = typed?.[1].toLocaleLowerCase() ?? "";
|
|
173
|
+
const found = typed && !shut ? people.filter((p) => p.name.toLocaleLowerCase().split(/\s+/).some((w) => w.startsWith(query)) || p.name.toLocaleLowerCase().startsWith(query)).slice(0, 6) : [];
|
|
174
|
+
const choose = (p) => {
|
|
175
|
+
const start = caret - query.length - 1;
|
|
176
|
+
const next = `${value.slice(0, start)}@${p.name} ${value.slice(caret)}`;
|
|
177
|
+
const end = start + p.name.length + 2;
|
|
178
|
+
onChange(next);
|
|
179
|
+
setCaret(end);
|
|
180
|
+
requestAnimationFrame(() => field.current?.setSelectionRange(end, end));
|
|
181
|
+
};
|
|
182
|
+
return /* @__PURE__ */ jsxs2("span", { className: "w100n-text-mentions", children: [
|
|
183
|
+
/* @__PURE__ */ jsx2(
|
|
184
|
+
"textarea",
|
|
185
|
+
{
|
|
186
|
+
ref: field,
|
|
187
|
+
autoFocus,
|
|
188
|
+
value,
|
|
189
|
+
placeholder,
|
|
190
|
+
"aria-label": label,
|
|
191
|
+
"aria-autocomplete": "list",
|
|
192
|
+
"aria-expanded": found.length > 0,
|
|
193
|
+
onChange: (e) => {
|
|
194
|
+
onChange(e.target.value);
|
|
195
|
+
setCaret(e.target.selectionStart);
|
|
196
|
+
setAt(0);
|
|
197
|
+
setShut(false);
|
|
198
|
+
},
|
|
199
|
+
onClick: (e) => setCaret(e.currentTarget.selectionStart),
|
|
200
|
+
onKeyUp: (e) => {
|
|
201
|
+
if (["ArrowLeft", "ArrowRight", "Home", "End"].includes(e.key)) setCaret(e.currentTarget.selectionStart);
|
|
202
|
+
},
|
|
203
|
+
onKeyDown: (e) => {
|
|
204
|
+
if (found.length && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
205
|
+
e.preventDefault();
|
|
206
|
+
setAt((at + (e.key === "ArrowDown" ? 1 : found.length - 1)) % found.length);
|
|
207
|
+
} else if (found.length && (e.key === "Enter" || e.key === "Tab") && !e.metaKey && !e.ctrlKey) {
|
|
208
|
+
e.preventDefault();
|
|
209
|
+
choose(found[Math.min(at, found.length - 1)]);
|
|
210
|
+
} else if (found.length && e.key === "Escape") {
|
|
211
|
+
e.stopPropagation();
|
|
212
|
+
setShut(true);
|
|
213
|
+
} else if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) onSend();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
found.length > 0 && /* @__PURE__ */ jsx2("span", { className: "w100n-text-pop w100n-text-menu w100n-text-people-list", role: "listbox", "aria-label": label, children: found.map((p, i) => /* @__PURE__ */ jsxs2("button", { type: "button", role: "option", "aria-selected": i === Math.min(at, found.length - 1), onMouseDown: (e) => e.preventDefault(), onClick: () => choose(p), children: [
|
|
218
|
+
p.avatarUrl ? /* @__PURE__ */ jsx2("img", { className: "w100n-text-face", src: p.avatarUrl, alt: "" }) : /* @__PURE__ */ jsx2("span", { className: "w100n-text-face", "aria-hidden": true, children: p.name.slice(0, 1).toUpperCase() }),
|
|
219
|
+
/* @__PURE__ */ jsx2("span", { children: p.name })
|
|
220
|
+
] }, p.id)) })
|
|
221
|
+
] });
|
|
222
|
+
}
|
|
223
|
+
|
|
162
224
|
// src/editor/TextEditor.tsx
|
|
163
|
-
import { Fragment as Fragment3, jsx as
|
|
225
|
+
import { Fragment as Fragment3, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
164
226
|
var legal = { width: 816, height: 1344 };
|
|
165
227
|
var symbols = [
|
|
166
228
|
["\xA9", "copyright"],
|
|
@@ -232,43 +294,43 @@ function TextEditor({ kind, bytes, t, language, rights, host, together, document
|
|
|
232
294
|
const live = useLive(together ? host : void 0, documentId, kind, bytes, source.data?.doc, language, can.edit, onSaved);
|
|
233
295
|
const shared = live?.ready ? live.wire : null;
|
|
234
296
|
if (live?.readonly) can.edit = false;
|
|
235
|
-
const baseline =
|
|
236
|
-
const anchors =
|
|
237
|
-
const scroller =
|
|
238
|
-
const root =
|
|
239
|
-
const [pop, setPop] =
|
|
240
|
-
const [spot, setSpot] =
|
|
241
|
-
const touch =
|
|
242
|
-
const [spell, setSpell] =
|
|
243
|
-
const [dialog, setDialog] =
|
|
244
|
-
const field =
|
|
245
|
-
const [more, setMore] =
|
|
246
|
-
const [zoom, setZoom] =
|
|
247
|
-
const [layout, setLayout] =
|
|
248
|
-
const [room, setRoom] =
|
|
249
|
-
const [printed, setPrinted] =
|
|
297
|
+
const baseline = useRef3(null);
|
|
298
|
+
const anchors = useRef3(/* @__PURE__ */ new Map());
|
|
299
|
+
const scroller = useRef3(null);
|
|
300
|
+
const root = useRef3(null);
|
|
301
|
+
const [pop, setPop] = useState3(null);
|
|
302
|
+
const [spot, setSpot] = useState3({ x: 0, y: 0 });
|
|
303
|
+
const touch = useRef3(false);
|
|
304
|
+
const [spell, setSpell] = useState3(() => typeof localStorage === "undefined" || localStorage.getItem("w100n-docs-spell") !== "0");
|
|
305
|
+
const [dialog, setDialog] = useState3(null);
|
|
306
|
+
const field = useRef3(null);
|
|
307
|
+
const [more, setMore] = useState3(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-more") === "1");
|
|
308
|
+
const [zoom, setZoom] = useState3(null);
|
|
309
|
+
const [layout, setLayout] = useState3(null);
|
|
310
|
+
const [room, setRoom] = useState3(0);
|
|
311
|
+
const [printed, setPrinted] = useState3(null);
|
|
250
312
|
const flow = docx && !(printed ?? !(room > 0 && room < 640));
|
|
251
|
-
const [saving, setSaving] =
|
|
252
|
-
const [href, setHref] =
|
|
253
|
-
const [grid, setGrid] =
|
|
254
|
-
const [draft, setDraft] =
|
|
255
|
-
const [reply, setReply] =
|
|
256
|
-
const [active, setActive] =
|
|
257
|
-
const [resolved, setResolved] =
|
|
258
|
-
const [posting, setPosting] =
|
|
259
|
-
const [added, setAdded] =
|
|
260
|
-
const [changed, setChanged] =
|
|
261
|
-
const [editing, setEditing] =
|
|
262
|
-
const [dropping, setDropping] =
|
|
263
|
-
const [failed, setFailed] =
|
|
264
|
-
const [paint, setPaint] =
|
|
265
|
-
const [query, setQuery] =
|
|
266
|
-
const [swap, setSwap] =
|
|
267
|
-
const [matchCase, setMatchCase] =
|
|
268
|
-
const [count, setCount] =
|
|
269
|
-
const [marg, setMarg] =
|
|
270
|
-
const [unsetup, setUnsetup] =
|
|
271
|
-
const [draft2, setDraft2] =
|
|
313
|
+
const [saving, setSaving] = useState3("idle");
|
|
314
|
+
const [href, setHref] = useState3("");
|
|
315
|
+
const [grid, setGrid] = useState3({ rows: 0, cols: 0 });
|
|
316
|
+
const [draft, setDraft] = useState3(null);
|
|
317
|
+
const [reply, setReply] = useState3(null);
|
|
318
|
+
const [active, setActive] = useState3(null);
|
|
319
|
+
const [resolved, setResolved] = useState3(false);
|
|
320
|
+
const [posting, setPosting] = useState3("idle");
|
|
321
|
+
const [added, setAdded] = useState3([]);
|
|
322
|
+
const [changed, setChanged] = useState3({});
|
|
323
|
+
const [editing, setEditing] = useState3(null);
|
|
324
|
+
const [dropping, setDropping] = useState3(null);
|
|
325
|
+
const [failed, setFailed] = useState3(false);
|
|
326
|
+
const [paint, setPaint] = useState3(null);
|
|
327
|
+
const [query, setQuery] = useState3("");
|
|
328
|
+
const [swap, setSwap] = useState3("");
|
|
329
|
+
const [matchCase, setMatchCase] = useState3(false);
|
|
330
|
+
const [count, setCount] = useState3({ words: 0, pages: 0 });
|
|
331
|
+
const [marg, setMarg] = useState3(null);
|
|
332
|
+
const [unsetup, setUnsetup] = useState3(false);
|
|
333
|
+
const [draft2, setDraft2] = useState3(null);
|
|
272
334
|
useRestore(pop !== null);
|
|
273
335
|
useRestore(editing !== null);
|
|
274
336
|
useRestore(dropping !== null);
|
|
@@ -369,6 +431,8 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
369
431
|
return () => map.unobserve(sync);
|
|
370
432
|
}, [shared, docx]);
|
|
371
433
|
const loaded = useLoad((signal) => host?.comments ? host.comments(documentId, { signal }) : Promise.resolve([]), [host, documentId]);
|
|
434
|
+
const crowd = useLoad((signal) => host?.people && can.comment ? host.people(documentId, { signal }) : Promise.resolve([]), [host, documentId]);
|
|
435
|
+
const people = (crowd.data ?? []).filter((p) => p.id !== host?.me.id);
|
|
372
436
|
const all = [...loaded.data ?? [], ...added].flatMap((c) => c.id in changed ? changed[c.id] ?? [] : [c]).filter((c) => !c.replyTo || changed[c.replyTo] !== null);
|
|
373
437
|
const open = all.filter((c) => !c.replyTo && !c.resolved);
|
|
374
438
|
const threads = all.filter((c) => !c.replyTo && (resolved || !c.resolved)).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
@@ -522,8 +586,8 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
522
586
|
window.removeEventListener("scroll", off, true);
|
|
523
587
|
};
|
|
524
588
|
}, [pop]);
|
|
525
|
-
if (source.error) return docx ? /* @__PURE__ */
|
|
526
|
-
if (!source.data || !editor || !state || live && !live.ready && !live.late && !live.denied) return /* @__PURE__ */
|
|
589
|
+
if (source.error) return docx ? /* @__PURE__ */ jsx3("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ jsx3(DocxView, { bytes, onOutline, failed: t.failed }) }) : /* @__PURE__ */ jsx3("div", { className: "w100n-docs-empty", children: t.failed });
|
|
590
|
+
if (!source.data || !editor || !state || live && !live.ready && !live.late && !live.denied) return /* @__PURE__ */ jsx3("div", { className: "w100n-docs-empty", children: t.loading });
|
|
527
591
|
const save = async (auto = false) => {
|
|
528
592
|
if (live) {
|
|
529
593
|
if (!can.edit || !live.ready || !live.online || !live.pending || saving === "busy") return false;
|
|
@@ -587,7 +651,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
587
651
|
const { from, to, empty } = editor.state.selection;
|
|
588
652
|
if (empty || !can.comment) return;
|
|
589
653
|
editor.view.dispatch(editor.state.tr.setMeta(notes, { pending: { from, to } }));
|
|
590
|
-
setDraft({ quote: editor.state.doc.textBetween(from, to, "\n", " "), body: "" });
|
|
654
|
+
setDraft({ quote: editor.state.doc.textBetween(from, to, "\n", " "), body: "", give: false });
|
|
591
655
|
setPosting("idle");
|
|
592
656
|
onPanel?.("comments");
|
|
593
657
|
};
|
|
@@ -600,7 +664,7 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
600
664
|
setPosting("busy");
|
|
601
665
|
try {
|
|
602
666
|
const anchor = uid();
|
|
603
|
-
const made = await host.comment(documentId, { body: draft.body.trim(), quote: draft.quote, replyTo: null, anchor });
|
|
667
|
+
const made = await host.comment(documentId, { body: draft.body.trim(), quote: draft.quote, replyTo: null, anchor, assignee: draft.give ? tagged(draft.body, people)[0]?.id ?? null : null });
|
|
604
668
|
anchors.current.set(made.id, anchor);
|
|
605
669
|
const range = notes.getState(editor.state).pending;
|
|
606
670
|
editor.view.dispatch(editor.state.tr.setMeta(notes, { pending: null, spots: [...notes.getState(editor.state).spots, ...range ? [{ id: made.id, ...range }] : []] }));
|
|
@@ -698,11 +762,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
698
762
|
};
|
|
699
763
|
const tool = (icon, label, run, pressed, disabled) => {
|
|
700
764
|
const Icon = icon;
|
|
701
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ jsx3("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled, onClick: () => {
|
|
702
766
|
run();
|
|
703
|
-
}, children: /* @__PURE__ */
|
|
767
|
+
}, children: /* @__PURE__ */ jsx3(Icon, { "aria-hidden": true }) });
|
|
704
768
|
};
|
|
705
|
-
const gap = /* @__PURE__ */
|
|
769
|
+
const gap = /* @__PURE__ */ jsx3("span", { className: "w100n-pdf-gap" });
|
|
706
770
|
const known = source.data.styles;
|
|
707
771
|
const named = (test) => {
|
|
708
772
|
const name = known.find(test)?.name;
|
|
@@ -721,28 +785,28 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
721
785
|
];
|
|
722
786
|
const margins = [[t.marginsNormal, [96, 96, 96, 96]], [t.marginsNarrow, [48, 48, 48, 48]], [t.marginsWide, [96, 192, 96, 192]]];
|
|
723
787
|
const when = (iso) => new Intl.DateTimeFormat(language, { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" }).format(new Date(iso));
|
|
724
|
-
const person = (c) => /* @__PURE__ */
|
|
725
|
-
c.author.avatarUrl ? /* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
788
|
+
const person = (c) => /* @__PURE__ */ jsxs3("header", { children: [
|
|
789
|
+
c.author.avatarUrl ? /* @__PURE__ */ jsx3("img", { className: "w100n-text-face", src: c.author.avatarUrl, alt: "" }) : /* @__PURE__ */ jsx3("span", { className: "w100n-text-face", "aria-hidden": true, children: c.author.name.slice(0, 1).toUpperCase() }),
|
|
790
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-text-who", children: [
|
|
791
|
+
/* @__PURE__ */ jsxs3("b", { children: [
|
|
728
792
|
c.author.name,
|
|
729
|
-
c.author.id.startsWith("guest:") && /* @__PURE__ */
|
|
793
|
+
c.author.id.startsWith("guest:") && /* @__PURE__ */ jsx3("span", { className: "w100n-docs-badge", children: t.guest })
|
|
730
794
|
] }),
|
|
731
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ jsx3("small", { children: when(c.createdAt) })
|
|
732
796
|
] }),
|
|
733
|
-
drops(c) && /* @__PURE__ */
|
|
734
|
-
mine(c) && host.editComment && /* @__PURE__ */
|
|
797
|
+
drops(c) && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-own", onClick: (e) => e.stopPropagation(), children: [
|
|
798
|
+
mine(c) && host.editComment && /* @__PURE__ */ jsx3("button", { type: "button", "aria-label": t.editComment, title: t.editComment, onClick: () => {
|
|
735
799
|
setDropping(null);
|
|
736
800
|
setEditing({ id: c.id, body: c.body });
|
|
737
|
-
}, children: /* @__PURE__ */
|
|
738
|
-
host.deleteComment && /* @__PURE__ */
|
|
801
|
+
}, children: /* @__PURE__ */ jsx3(Pencil, { "aria-hidden": true }) }),
|
|
802
|
+
host.deleteComment && /* @__PURE__ */ jsx3("button", { type: "button", "data-tone": "red", "aria-label": t.delete, title: t.delete, onClick: () => {
|
|
739
803
|
setEditing(null);
|
|
740
804
|
setDropping(c.id);
|
|
741
|
-
}, children: /* @__PURE__ */
|
|
805
|
+
}, children: /* @__PURE__ */ jsx3(Trash2, { "aria-hidden": true }) })
|
|
742
806
|
] })
|
|
743
807
|
] });
|
|
744
|
-
const words = (c) => editing?.id === c.id ? /* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */
|
|
808
|
+
const words = (c) => editing?.id === c.id ? /* @__PURE__ */ jsxs3("div", { className: "w100n-text-reply w100n-text-edit", onClick: (e) => e.stopPropagation(), children: [
|
|
809
|
+
/* @__PURE__ */ jsx3(
|
|
746
810
|
"textarea",
|
|
747
811
|
{
|
|
748
812
|
autoFocus: true,
|
|
@@ -754,33 +818,33 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
754
818
|
}
|
|
755
819
|
}
|
|
756
820
|
),
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
|
|
822
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setEditing(null), children: t.cancel }),
|
|
823
|
+
/* @__PURE__ */ jsxs3("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: [
|
|
824
|
+
/* @__PURE__ */ jsx3(Save, { "aria-hidden": true }),
|
|
761
825
|
t.save
|
|
762
826
|
] })
|
|
763
827
|
] })
|
|
764
|
-
] }) : dropping === c.id ? /* @__PURE__ */
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
769
|
-
/* @__PURE__ */
|
|
828
|
+
] }) : dropping === c.id ? /* @__PURE__ */ jsxs3("div", { className: "w100n-text-confirm", role: "group", "aria-label": t.delete, onClick: (e) => e.stopPropagation(), children: [
|
|
829
|
+
/* @__PURE__ */ jsx3("p", { children: c.replyTo || !all.some((r) => r.replyTo === c.id) ? t.deleteAsk : t.deleteThread }),
|
|
830
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
|
|
831
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", autoFocus: true, onClick: () => setDropping(null), children: t.cancel }),
|
|
832
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: posting === "busy", onClick: () => void change(c.id, null), children: [
|
|
833
|
+
/* @__PURE__ */ jsx3(Trash2, { "aria-hidden": true }),
|
|
770
834
|
t.delete
|
|
771
835
|
] })
|
|
772
836
|
] })
|
|
773
|
-
] }) : /* @__PURE__ */
|
|
837
|
+
] }) : /* @__PURE__ */ jsx3("p", { children: c.body });
|
|
774
838
|
const pick = (next) => setPop(pop === next ? null : next);
|
|
775
|
-
const swatches = (list, current, set, none) => /* @__PURE__ */
|
|
776
|
-
/* @__PURE__ */
|
|
839
|
+
const swatches = (list, current, set, none) => /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-swatches", role: "group", children: [
|
|
840
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-text-none", onClick: () => {
|
|
777
841
|
set(null);
|
|
778
842
|
setPop(null);
|
|
779
843
|
}, children: none }),
|
|
780
|
-
list.map((c, i) => /* @__PURE__ */
|
|
844
|
+
list.map((c, i) => /* @__PURE__ */ jsx3("button", { type: "button", "aria-label": c, "aria-pressed": current === c, onClick: () => {
|
|
781
845
|
set(c);
|
|
782
846
|
setPop(null);
|
|
783
|
-
}, children: /* @__PURE__ */
|
|
847
|
+
}, children: /* @__PURE__ */ jsx3("i", { style: { background: c } }) }, i))
|
|
784
848
|
] });
|
|
785
849
|
const mod = /Mac|iPhone|iPad/.test(navigator.platform) ? "\u2318" : "Ctrl+";
|
|
786
850
|
const item = (label, run, more2 = {}) => ({ label, run, ...more2 });
|
|
@@ -798,9 +862,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
798
862
|
item(t.print, print, { keys: `${mod}P` }),
|
|
799
863
|
...docx ? ["-", item(t.pageSetup, () => setDraft2({ width: page.width, height: page.height, margins: page.margins.map(cm), ...marginal }))] : []
|
|
800
864
|
] : [],
|
|
801
|
-
...can.edit && (file?.formats.length || file?.copy || file?.rename) ? ["-"] : [],
|
|
865
|
+
...can.edit && (file?.formats.length || file?.copy || file?.rename || file?.template) ? ["-"] : [],
|
|
802
866
|
...(file?.formats ?? []).map((f) => item(`${t.downloadAs} ${f === "md" ? "Markdown" : f.toUpperCase()}`, () => file.download(f))),
|
|
803
867
|
!!file?.copy && item(t.makeCopy, file.copy),
|
|
868
|
+
!!file?.template && item(t.saveTemplate, file.template),
|
|
804
869
|
!!file?.rename && item(t.rename, file.rename)
|
|
805
870
|
]],
|
|
806
871
|
["edit", t.menuEdit, can.edit ? [
|
|
@@ -905,17 +970,17 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
905
970
|
item(t.deleteColumn, () => editor.chain().focus().deleteColumn().run())
|
|
906
971
|
] : []
|
|
907
972
|
];
|
|
908
|
-
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__ */
|
|
973
|
+
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__ */ jsx3("hr", {}, i) : /* @__PURE__ */ jsxs3("button", { type: "button", role: x.on === void 0 ? "menuitem" : "menuitemcheckbox", "aria-checked": x.on, disabled: x.off, onClick: () => {
|
|
909
974
|
setPop(null);
|
|
910
975
|
x.run();
|
|
911
976
|
}, children: [
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
x.keys && /* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
|
|
978
|
+
/* @__PURE__ */ jsx3("span", { children: x.label }),
|
|
979
|
+
x.keys && /* @__PURE__ */ jsx3("kbd", { children: x.keys })
|
|
915
980
|
] }, i));
|
|
916
|
-
const menu = ([key, label, list]) => /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
pop === key && /* @__PURE__ */
|
|
981
|
+
const menu = ([key, label, list]) => /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
982
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-text-menu-button", "data-pop": true, "aria-haspopup": "menu", "aria-expanded": pop === key, onClick: () => pick(key), children: label }),
|
|
983
|
+
pop === key && /* @__PURE__ */ jsx3("span", { className: "w100n-text-pop w100n-text-menu", role: "menu", "aria-label": label, children: rows(list) })
|
|
919
984
|
] }, key);
|
|
920
985
|
const seek = (next) => {
|
|
921
986
|
editor.view.dispatch(editor.state.tr.setMeta(searching, next));
|
|
@@ -927,11 +992,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
927
992
|
}
|
|
928
993
|
};
|
|
929
994
|
const found = searching.getState(editor.state);
|
|
930
|
-
const finder = /* @__PURE__ */
|
|
931
|
-
/* @__PURE__ */
|
|
932
|
-
pop === "find" && /* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
/* @__PURE__ */
|
|
995
|
+
const finder = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
996
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "find", "aria-label": t.findReplace, title: t.findReplace, onClick: () => pick("find"), children: /* @__PURE__ */ jsx3(Search, { "aria-hidden": true }) }),
|
|
997
|
+
pop === "find" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-find", role: "search", "aria-label": t.findReplace, children: [
|
|
998
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-docs-row", children: [
|
|
999
|
+
/* @__PURE__ */ jsx3(
|
|
935
1000
|
"input",
|
|
936
1001
|
{
|
|
937
1002
|
autoFocus: true,
|
|
@@ -951,23 +1016,23 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
951
1016
|
}
|
|
952
1017
|
}
|
|
953
1018
|
),
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ jsx3("small", { "aria-live": "polite", children: query ? found?.hits.length ? `${(found.at ?? 0) + 1} / ${found.hits.length}` : t.noHits : "" }),
|
|
1020
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "aria-label": t.previous, title: t.previous, disabled: !found?.hits.length, onClick: () => seek({ at: found.at - 1 }), children: /* @__PURE__ */ jsx3(ChevronUp, { "aria-hidden": true }) }),
|
|
1021
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "aria-label": t.next, title: t.next, disabled: !found?.hits.length, onClick: () => seek({ at: found.at + 1 }), children: /* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true }) })
|
|
957
1022
|
] }),
|
|
958
|
-
can.edit && /* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
1023
|
+
can.edit && /* @__PURE__ */ jsxs3("span", { className: "w100n-docs-row", children: [
|
|
1024
|
+
/* @__PURE__ */ jsx3("input", { value: swap, placeholder: t.replaceWith, "aria-label": t.replaceWith, onChange: (e) => setSwap(e.target.value) }),
|
|
1025
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", disabled: !found?.hits.length, onClick: () => {
|
|
961
1026
|
replace(editor, swap, false);
|
|
962
1027
|
seek({});
|
|
963
1028
|
}, children: t.replaceOne }),
|
|
964
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-docs-action", disabled: !found?.hits.length, onClick: () => {
|
|
965
1030
|
replace(editor, swap, true);
|
|
966
1031
|
seek({});
|
|
967
1032
|
}, children: t.replaceAll })
|
|
968
1033
|
] }),
|
|
969
|
-
/* @__PURE__ */
|
|
970
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ jsxs3("label", { className: "w100n-setup-check", children: [
|
|
1035
|
+
/* @__PURE__ */ jsx3("input", { type: "checkbox", checked: matchCase, onChange: (e) => {
|
|
971
1036
|
setMatchCase(e.target.checked);
|
|
972
1037
|
seek({ matchCase: e.target.checked, at: 0 });
|
|
973
1038
|
} }),
|
|
@@ -992,47 +1057,47 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
992
1057
|
spacing(editor, { line: paint.block.line, after: paint.block.after });
|
|
993
1058
|
if (!paint.keep) setPaint(null);
|
|
994
1059
|
};
|
|
995
|
-
const fontPicker = /* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
1060
|
+
const fontPicker = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1061
|
+
/* @__PURE__ */ jsxs3("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: [
|
|
1062
|
+
/* @__PURE__ */ jsx3("span", { style: { fontFamily: state.font ?? void 0 }, children: state.font ?? t.defaultFont }),
|
|
1063
|
+
/* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
|
|
999
1064
|
] }),
|
|
1000
|
-
pop === "font" && /* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1065
|
+
pop === "font" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.font, children: [
|
|
1066
|
+
/* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": !state.font, onClick: () => {
|
|
1002
1067
|
editor.chain().focus().unsetFontFamily().run();
|
|
1003
1068
|
setPop(null);
|
|
1004
1069
|
}, children: t.defaultFont }),
|
|
1005
|
-
faces.map((f) => /* @__PURE__ */
|
|
1070
|
+
faces.map((f) => /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": state.font === f, style: { fontFamily: f }, onClick: () => {
|
|
1006
1071
|
editor.chain().focus().setFontFamily(f).run();
|
|
1007
1072
|
setPop(null);
|
|
1008
1073
|
}, children: f }, f))
|
|
1009
1074
|
] })
|
|
1010
1075
|
] });
|
|
1011
|
-
const sizePicker = /* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */
|
|
1076
|
+
const sizePicker = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1077
|
+
/* @__PURE__ */ jsxs3("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: [
|
|
1013
1078
|
state.size ? parseFloat(state.size) : t.defaultFont,
|
|
1014
|
-
/* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
|
|
1015
1080
|
] }),
|
|
1016
|
-
pop === "size" && /* @__PURE__ */
|
|
1017
|
-
/* @__PURE__ */
|
|
1081
|
+
pop === "size" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.fontSize, children: [
|
|
1082
|
+
/* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": !state.size, onClick: () => {
|
|
1018
1083
|
editor.chain().focus().unsetFontSize().run();
|
|
1019
1084
|
setPop(null);
|
|
1020
1085
|
}, children: t.defaultFont }),
|
|
1021
|
-
sizes.map((n) => /* @__PURE__ */
|
|
1086
|
+
sizes.map((n) => /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": state.size !== null && parseFloat(state.size) === n, onClick: () => {
|
|
1022
1087
|
editor.chain().focus().setFontSize(`${n}pt`).run();
|
|
1023
1088
|
setPop(null);
|
|
1024
1089
|
}, children: n }, n))
|
|
1025
1090
|
] })
|
|
1026
1091
|
] });
|
|
1027
|
-
const spacer = /* @__PURE__ */
|
|
1028
|
-
/* @__PURE__ */
|
|
1029
|
-
pop === "spacing" && /* @__PURE__ */
|
|
1030
|
-
lines.map(([v, label]) => /* @__PURE__ */
|
|
1092
|
+
const spacer = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1093
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "spacing", "aria-label": t.lineSpacing, title: t.lineSpacing, onClick: () => pick("spacing"), children: /* @__PURE__ */ jsx3(UnfoldVertical, { "aria-hidden": true }) }),
|
|
1094
|
+
pop === "spacing" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.lineSpacing, children: [
|
|
1095
|
+
lines.map(([v, label]) => /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": state.line === v, onClick: () => {
|
|
1031
1096
|
spacing(editor, { line: v });
|
|
1032
1097
|
setPop(null);
|
|
1033
1098
|
}, children: label }, v)),
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ jsx3("hr", {}),
|
|
1100
|
+
/* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": false, onClick: () => {
|
|
1036
1101
|
spacing(editor, { after: state.after === 0 ? 8 : 0 });
|
|
1037
1102
|
setPop(null);
|
|
1038
1103
|
}, children: state.after === 0 ? t.spaceAfter : t.noSpaceAfter })
|
|
@@ -1055,18 +1120,18 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1055
1120
|
setDraft2(null);
|
|
1056
1121
|
};
|
|
1057
1122
|
const zooms = [50, 75, 90, 100, 125, 150, 200];
|
|
1058
|
-
const zoomer = /* @__PURE__ */
|
|
1059
|
-
/* @__PURE__ */
|
|
1123
|
+
const zoomer = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1124
|
+
/* @__PURE__ */ jsxs3("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: [
|
|
1060
1125
|
percent,
|
|
1061
1126
|
"%",
|
|
1062
|
-
/* @__PURE__ */
|
|
1127
|
+
/* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
|
|
1063
1128
|
] }),
|
|
1064
|
-
pop === "zoom" && /* @__PURE__ */
|
|
1065
|
-
docx && /* @__PURE__ */
|
|
1129
|
+
pop === "zoom" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.zoom, children: [
|
|
1130
|
+
docx && /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": zoom === null, onClick: () => {
|
|
1066
1131
|
setZoom(null);
|
|
1067
1132
|
setPop(null);
|
|
1068
1133
|
}, children: t.fitWidth }),
|
|
1069
|
-
zooms.map((z) => /* @__PURE__ */
|
|
1134
|
+
zooms.map((z) => /* @__PURE__ */ jsxs3("button", { type: "button", role: "option", "aria-selected": zoom === z, onClick: () => {
|
|
1070
1135
|
setZoom(z);
|
|
1071
1136
|
setPop(null);
|
|
1072
1137
|
}, children: [
|
|
@@ -1076,9 +1141,9 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1076
1141
|
] })
|
|
1077
1142
|
] });
|
|
1078
1143
|
const Aligned = aligns.find(([, , value]) => value === state.align)?.[0] ?? AlignLeft;
|
|
1079
|
-
const aligner = /* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
pop === "align" && /* @__PURE__ */
|
|
1144
|
+
const aligner = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1145
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "align", "aria-label": t.align, title: t.align, onClick: () => pick("align"), children: /* @__PURE__ */ jsx3(Aligned, { "aria-hidden": true }) }),
|
|
1146
|
+
pop === "align" && /* @__PURE__ */ jsx3("span", { className: "w100n-text-pop", role: "group", "aria-label": t.align, children: /* @__PURE__ */ jsx3("span", { className: "w100n-text-tools", children: aligns.map(([icon, label, value], i) => /* @__PURE__ */ jsx3(Fragment2, { children: tool(icon, label, () => {
|
|
1082
1147
|
align(editor, value);
|
|
1083
1148
|
setPop(null);
|
|
1084
1149
|
}, state.align === value) }, i)) }) })
|
|
@@ -1087,13 +1152,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1087
1152
|
localStorage.setItem("w100n-docs-more", more ? "" : "1");
|
|
1088
1153
|
setMore(!more);
|
|
1089
1154
|
};
|
|
1090
|
-
const main = can.edit ? /* @__PURE__ */
|
|
1091
|
-
/* @__PURE__ */
|
|
1092
|
-
/* @__PURE__ */
|
|
1155
|
+
const main = can.edit ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1156
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1157
|
+
/* @__PURE__ */ jsxs3("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: [
|
|
1093
1158
|
styles.find(([key]) => key === state.style)?.[1] ?? t.normal,
|
|
1094
|
-
/* @__PURE__ */
|
|
1159
|
+
/* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
|
|
1095
1160
|
] }),
|
|
1096
|
-
pop === "style" && /* @__PURE__ */
|
|
1161
|
+
pop === "style" && /* @__PURE__ */ jsx3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.paragraphStyle, children: styles.map(([key, label, run]) => /* @__PURE__ */ jsx3(
|
|
1097
1162
|
"button",
|
|
1098
1163
|
{
|
|
1099
1164
|
type: "button",
|
|
@@ -1114,10 +1179,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1114
1179
|
tool(Italic, t.italic, () => editor.chain().focus().toggleItalic().run(), state.italic),
|
|
1115
1180
|
docx ? tool(Underline, t.underline, () => editor.chain().focus().toggleUnderline().run(), state.underline) : tool(Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
|
|
1116
1181
|
!docx && tool(Code, t.code, () => editor.chain().focus().toggleCode().run(), state.code),
|
|
1117
|
-
docx && /* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
/* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
1182
|
+
docx && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1183
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "color", "aria-label": t.textColour, title: t.textColour, onClick: () => pick("color"), children: [
|
|
1184
|
+
/* @__PURE__ */ jsx3(Baseline, { "aria-hidden": true }),
|
|
1185
|
+
/* @__PURE__ */ jsx3("i", { className: "w100n-text-bar", style: { background: state.color ?? "currentColor" } })
|
|
1121
1186
|
] }),
|
|
1122
1187
|
pop === "color" && swatches(inks, state.color, (c) => c ? editor.chain().focus().setColor(c).run() : editor.chain().focus().unsetColor().run(), t.automatic)
|
|
1123
1188
|
] }),
|
|
@@ -1127,35 +1192,35 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1127
1192
|
tool(ListOrdered, t.numbers, () => editor.chain().focus().toggleOrderedList().run(), state.numbers),
|
|
1128
1193
|
!docx && tool(ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
|
|
1129
1194
|
gap,
|
|
1130
|
-
/* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
pop === "link" && /* @__PURE__ */
|
|
1133
|
-
/* @__PURE__ */
|
|
1195
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1196
|
+
/* @__PURE__ */ jsx3("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__ */ jsx3(Link, { "aria-hidden": true }) }),
|
|
1197
|
+
pop === "link" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-form", children: [
|
|
1198
|
+
/* @__PURE__ */ jsx3("input", { autoFocus: true, value: href, placeholder: t.linkAddress, "aria-label": t.linkAddress, onChange: (e) => setHref(e.target.value), onKeyDown: (e) => {
|
|
1134
1199
|
if (e.key === "Enter") putLink();
|
|
1135
1200
|
} }),
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
state.link && /* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-docs-row", children: [
|
|
1202
|
+
state.link && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
|
|
1138
1203
|
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
1139
1204
|
setPop(null);
|
|
1140
1205
|
}, children: [
|
|
1141
|
-
/* @__PURE__ */
|
|
1206
|
+
/* @__PURE__ */ jsx3(Link2Off, { "aria-hidden": true }),
|
|
1142
1207
|
t.unlink
|
|
1143
1208
|
] }),
|
|
1144
|
-
/* @__PURE__ */
|
|
1145
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: putLink, children: [
|
|
1210
|
+
/* @__PURE__ */ jsx3(Link, { "aria-hidden": true }),
|
|
1146
1211
|
t.apply
|
|
1147
1212
|
] })
|
|
1148
1213
|
] })
|
|
1149
1214
|
] })
|
|
1150
1215
|
] }),
|
|
1151
1216
|
can.comment && tool(MessageSquarePlus, t.addComment, begin, void 0, state.empty),
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1218
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "image", "aria-label": t.image, title: t.image, onClick: () => {
|
|
1154
1219
|
setHref("");
|
|
1155
1220
|
pick("image");
|
|
1156
|
-
}, children: /* @__PURE__ */
|
|
1157
|
-
pop === "image" && /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1221
|
+
}, children: /* @__PURE__ */ jsx3(ImagePlus, { "aria-hidden": true }) }),
|
|
1222
|
+
pop === "image" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-form", children: [
|
|
1223
|
+
/* @__PURE__ */ jsx3(
|
|
1159
1224
|
"input",
|
|
1160
1225
|
{
|
|
1161
1226
|
autoFocus: true,
|
|
@@ -1171,10 +1236,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1171
1236
|
}
|
|
1172
1237
|
}
|
|
1173
1238
|
),
|
|
1174
|
-
/* @__PURE__ */
|
|
1175
|
-
docx && /* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-docs-row", children: [
|
|
1240
|
+
docx && /* @__PURE__ */ jsxs3("label", { className: "w100n-pdf-link", children: [
|
|
1176
1241
|
t.chooseFile,
|
|
1177
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ jsx3("input", { type: "file", accept: "image/png,image/jpeg,image/gif", hidden: true, onChange: (e) => {
|
|
1178
1243
|
const file2 = e.target.files?.[0];
|
|
1179
1244
|
if (!file2) return;
|
|
1180
1245
|
const reader = new FileReader();
|
|
@@ -1185,23 +1250,23 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1185
1250
|
reader.readAsDataURL(file2);
|
|
1186
1251
|
} })
|
|
1187
1252
|
] }),
|
|
1188
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: () => {
|
|
1189
1254
|
editor.chain().focus().setImage({ src: href.trim() }).run();
|
|
1190
1255
|
setPop(null);
|
|
1191
1256
|
}, children: [
|
|
1192
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ jsx3(ImagePlus, { "aria-hidden": true }),
|
|
1193
1258
|
t.put
|
|
1194
1259
|
] })
|
|
1195
1260
|
] })
|
|
1196
1261
|
] })
|
|
1197
1262
|
] }),
|
|
1198
|
-
/* @__PURE__ */
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
pop === "table" && /* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1264
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "table", "aria-label": t.table, title: t.table, onClick: () => pick("table"), children: /* @__PURE__ */ jsx3(Table, { "aria-hidden": true }) }),
|
|
1265
|
+
pop === "table" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-grid", role: "group", "aria-label": t.table, onPointerLeave: () => setGrid({ rows: 0, cols: 0 }), children: [
|
|
1266
|
+
/* @__PURE__ */ jsx3("span", { children: Array.from({ length: 48 }, (_, i) => {
|
|
1202
1267
|
const rows2 = Math.floor(i / 8) + 1;
|
|
1203
1268
|
const cols = i % 8 + 1;
|
|
1204
|
-
return /* @__PURE__ */
|
|
1269
|
+
return /* @__PURE__ */ jsx3(
|
|
1205
1270
|
"button",
|
|
1206
1271
|
{
|
|
1207
1272
|
type: "button",
|
|
@@ -1216,31 +1281,31 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1216
1281
|
i
|
|
1217
1282
|
);
|
|
1218
1283
|
}) }),
|
|
1219
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ jsx3("small", { children: grid.rows ? `${grid.rows} \xD7 ${grid.cols}` : t.table })
|
|
1220
1285
|
] })
|
|
1221
1286
|
] }),
|
|
1222
1287
|
gap,
|
|
1223
|
-
/* @__PURE__ */
|
|
1224
|
-
] }) : /* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1226
|
-
/* @__PURE__ */
|
|
1288
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "aria-expanded": more, "aria-label": more ? t.fewerTools : t.moreTools, title: more ? t.fewerTools : t.moreTools, onClick: widen, children: more ? /* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ jsx3(ChevronUp, { "aria-hidden": true }) })
|
|
1289
|
+
] }) : /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1290
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("outline"), children: [
|
|
1291
|
+
/* @__PURE__ */ jsx3(ListTree, { "aria-hidden": true }),
|
|
1227
1292
|
t.outline
|
|
1228
1293
|
] }),
|
|
1229
|
-
can.comment && /* @__PURE__ */
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1294
|
+
can.comment && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1295
|
+
/* @__PURE__ */ jsx3("span", { className: "w100n-text-grow" }),
|
|
1296
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: state.empty, onClick: begin, children: [
|
|
1297
|
+
/* @__PURE__ */ jsx3(MessageSquarePlus, { "aria-hidden": true }),
|
|
1233
1298
|
t.addComment
|
|
1234
1299
|
] })
|
|
1235
1300
|
] }),
|
|
1236
|
-
!!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1301
|
+
!!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("comments"), children: [
|
|
1302
|
+
/* @__PURE__ */ jsx3(MessagesSquare, { "aria-hidden": true }),
|
|
1238
1303
|
t.comments,
|
|
1239
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ jsx3("b", { children: open.length })
|
|
1240
1305
|
] })
|
|
1241
1306
|
] });
|
|
1242
|
-
const extra = can.edit && more && /* @__PURE__ */
|
|
1243
|
-
docx && /* @__PURE__ */
|
|
1307
|
+
const extra = can.edit && more && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1308
|
+
docx && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1244
1309
|
fontPicker,
|
|
1245
1310
|
sizePicker,
|
|
1246
1311
|
gap
|
|
@@ -1248,11 +1313,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1248
1313
|
docx && tool(Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
|
|
1249
1314
|
docx && tool(Superscript, t.superscript, () => editor.chain().focus().toggleMark("superscript").run(), state.sup),
|
|
1250
1315
|
docx && tool(Subscript, t.subscript, () => editor.chain().focus().toggleMark("subscript").run(), state.sub),
|
|
1251
|
-
docx && /* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1316
|
+
docx && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1317
|
+
/* @__PURE__ */ jsx3("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__ */ jsx3(Highlighter, { "aria-hidden": true }) }),
|
|
1253
1318
|
pop === "mark" && swatches(glows, null, (c) => c ? editor.chain().focus().setHighlight({ color: c }).run() : editor.chain().focus().unsetHighlight().run(), t.noColour)
|
|
1254
1319
|
] }),
|
|
1255
|
-
docx && /* @__PURE__ */
|
|
1320
|
+
docx && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1256
1321
|
gap,
|
|
1257
1322
|
spacer
|
|
1258
1323
|
] }),
|
|
@@ -1260,24 +1325,24 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1260
1325
|
tool(ListIndentIncrease, t.indent, () => indent(editor, 1)),
|
|
1261
1326
|
docx && tool(ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
|
|
1262
1327
|
gap,
|
|
1263
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ jsx3("button", { type: "button", "aria-label": t.painter, title: paint ? t.painterHint : t.painter, "aria-pressed": !!paint, onClick: () => take(false), onDoubleClick: () => take(true), children: /* @__PURE__ */ jsx3(PaintRoller, { "aria-hidden": true }) }),
|
|
1264
1329
|
tool(RemoveFormatting, t.clearFormat, () => clear(editor)),
|
|
1265
|
-
docx && /* @__PURE__ */
|
|
1330
|
+
docx && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1266
1331
|
gap,
|
|
1267
1332
|
tool(FilePenLine, t.suggest, suggest, state.suggest)
|
|
1268
1333
|
] })
|
|
1269
1334
|
] });
|
|
1270
|
-
const context = can.edit && (state.table ? /* @__PURE__ */
|
|
1335
|
+
const context = can.edit && (state.table ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1271
1336
|
tool(BetweenHorizontalStart, t.rowAbove, () => editor.chain().focus().addRowBefore().run()),
|
|
1272
1337
|
tool(BetweenHorizontalEnd, t.rowBelow, () => editor.chain().focus().addRowAfter().run()),
|
|
1273
1338
|
tool(BetweenVerticalStart, t.columnLeft, () => editor.chain().focus().addColumnBefore().run()),
|
|
1274
1339
|
tool(BetweenVerticalEnd, t.columnRight, () => editor.chain().focus().addColumnAfter().run()),
|
|
1275
1340
|
tool(PanelTop, t.headerRow, () => editor.chain().focus().toggleHeaderRow().run()),
|
|
1276
1341
|
docx && tool(TableCellsMerge, t.mergeCells, () => editor.chain().focus().mergeOrSplit().run()),
|
|
1277
|
-
docx && /* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1342
|
+
docx && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
|
|
1343
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "fill", "aria-label": t.cellFill, title: t.cellFill, onClick: () => pick("fill"), children: [
|
|
1344
|
+
/* @__PURE__ */ jsx3(PaintBucket, { "aria-hidden": true }),
|
|
1345
|
+
/* @__PURE__ */ jsx3("i", { className: "w100n-text-bar", style: { background: state.fill ?? "transparent" } })
|
|
1281
1346
|
] }),
|
|
1282
1347
|
pop === "fill" && swatches(glows, state.fill, (c) => editor.chain().focus().setCellAttribute("background", c).run(), t.noColour)
|
|
1283
1348
|
] }),
|
|
@@ -1285,33 +1350,33 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1285
1350
|
tool(TableRowsSplit, t.deleteRow, () => editor.chain().focus().deleteRow().run()),
|
|
1286
1351
|
tool(TableColumnsSplit, t.deleteColumn, () => editor.chain().focus().deleteColumn().run()),
|
|
1287
1352
|
tool(Trash2, t.deleteTable, () => editor.chain().focus().deleteTable().run())
|
|
1288
|
-
] }) : state.img && /* @__PURE__ */
|
|
1289
|
-
const status = (can.edit || live) && /* @__PURE__ */
|
|
1290
|
-
live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1353
|
+
] }) : state.img && /* @__PURE__ */ jsx3(Fragment3, { children: [[Image, t.wrapInline, "inline"], [PanelLeft, t.wrapLeft, "left"], [PanelRight, t.wrapRight, "right"]].map(([icon, label, value]) => /* @__PURE__ */ jsx3(Fragment2, { children: tool(icon, label, () => editor.chain().focus().updateAttributes("image", { wrap: value === "inline" ? null : value }).run(), state.img === value) }, value)) }));
|
|
1354
|
+
const status = (can.edit || live) && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-end", children: [
|
|
1355
|
+
live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-live", title: live.denied ? void 0 : t.offlineHint, children: [
|
|
1356
|
+
/* @__PURE__ */ jsx3(WifiOff, { "aria-hidden": true }),
|
|
1292
1357
|
live.denied ? t.liveOff : t.offline
|
|
1293
1358
|
] }),
|
|
1294
|
-
state.suggest && /* @__PURE__ */
|
|
1295
|
-
can.edit && saving === "failed" && /* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1359
|
+
state.suggest && /* @__PURE__ */ jsx3("span", { className: "w100n-docs-badge", children: t.suggesting }),
|
|
1360
|
+
can.edit && saving === "failed" && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-text-saved", title: `${t.save} (${mod}S)`, onClick: () => void save(), children: [
|
|
1361
|
+
/* @__PURE__ */ jsx3(CloudAlert, { "aria-hidden": true }),
|
|
1362
|
+
/* @__PURE__ */ jsx3("span", { children: t.saveFailed })
|
|
1298
1363
|
] }),
|
|
1299
|
-
live && live.people.length > 0 && /* @__PURE__ */
|
|
1364
|
+
live && live.people.length > 0 && /* @__PURE__ */ jsx3("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: live.people.map((p) => /* @__PURE__ */ jsx3("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ jsx3("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) })
|
|
1300
1365
|
] });
|
|
1301
|
-
const menubar = /* @__PURE__ */
|
|
1366
|
+
const menubar = /* @__PURE__ */ jsx3("span", { className: "w100n-text-menus", role: "menubar", "aria-label": t.textTools, children: menus.filter(([, , list]) => list.some((x) => x && x !== "-")).map(menu) });
|
|
1302
1367
|
const keep = (e) => {
|
|
1303
1368
|
if (e.target.closest("button")) e.preventDefault();
|
|
1304
1369
|
};
|
|
1305
1370
|
const sheet = docx ? { "--page-w": `${page.width}px`, "--page-h": `${page.height}px`, "--mt": `${page.margins[0]}px`, "--mr": `${page.margins[1]}px`, "--mb": `${page.margins[2]}px`, "--ml": `${page.margins[3]}px` } : void 0;
|
|
1306
|
-
return /* @__PURE__ */
|
|
1307
|
-
head ? /* @__PURE__ */
|
|
1308
|
-
head.menus && createPortal(/* @__PURE__ */
|
|
1309
|
-
head.status && status && createPortal(/* @__PURE__ */
|
|
1310
|
-
] }) : /* @__PURE__ */
|
|
1371
|
+
return /* @__PURE__ */ jsxs3("div", { ref: root, className: "w100n-text", "data-kind": kind, "data-docs-find": true, onKeyDown: keys, children: [
|
|
1372
|
+
head ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1373
|
+
head.menus && createPortal(/* @__PURE__ */ jsx3("div", { className: "w100n-text-ribbon w100n-text-docbar", onKeyDown: rove, onPointerDown: keep, children: menubar }), head.menus),
|
|
1374
|
+
head.status && status && createPortal(/* @__PURE__ */ jsx3("div", { className: "w100n-text-ribbon w100n-text-docbar", onPointerDown: keep, children: status }), head.status)
|
|
1375
|
+
] }) : /* @__PURE__ */ jsxs3("div", { className: "w100n-text-ribbon w100n-text-top", onKeyDown: rove, onPointerDown: keep, children: [
|
|
1311
1376
|
menubar,
|
|
1312
1377
|
status
|
|
1313
1378
|
] }),
|
|
1314
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsx3("div", { ref: scroller, className: "w100n-text-scroll", "data-paint": !!paint, onMouseUp: lay, onPointerDown: (e) => {
|
|
1315
1380
|
touch.current = e.pointerType === "touch";
|
|
1316
1381
|
}, onContextMenu: (e) => {
|
|
1317
1382
|
if (touch.current || e.shiftKey || pop === "context" || !e.target.closest(".ProseMirror")) return setPop(null);
|
|
@@ -1334,49 +1399,49 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1334
1399
|
if (!id) return;
|
|
1335
1400
|
setActive(id);
|
|
1336
1401
|
onPanel?.("comments");
|
|
1337
|
-
}, children: /* @__PURE__ */
|
|
1338
|
-
pop === "context" && /* @__PURE__ */
|
|
1402
|
+
}, children: /* @__PURE__ */ jsx3("div", { className: "w100n-text-zoomed", style: { zoom: percent / 100 }, children: /* @__PURE__ */ jsx3("div", { className: docx ? `w100n-text-sheet${flow ? " is-flow" : ""}` : "w100n-docs-page w100n-text-column", style: sheet, children: /* @__PURE__ */ jsx3(EditorContent, { editor }) }) }) }),
|
|
1403
|
+
pop === "context" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-menu w100n-text-context", role: "menu", "aria-label": t.textTools, style: { left: spot.x, top: spot.y }, onPointerDown: keep, children: [
|
|
1339
1404
|
rows(near),
|
|
1340
|
-
spell && /* @__PURE__ */
|
|
1405
|
+
spell && /* @__PURE__ */ jsx3("small", { className: "w100n-text-hint", children: t.spellHint })
|
|
1341
1406
|
] }),
|
|
1342
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "left", onPointerDown: keep, children: /* @__PURE__ */ jsxs3("div", { className: "w100n-text-tools", role: "group", "aria-label": t.zoom, children: [
|
|
1343
1408
|
tool(Minus, t.zoomOut, () => zoomBy(-10)),
|
|
1344
1409
|
zoomer,
|
|
1345
1410
|
tool(Plus, t.zoomIn, () => zoomBy(10))
|
|
1346
1411
|
] }) }),
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
context && /* @__PURE__ */
|
|
1349
|
-
extra && /* @__PURE__ */
|
|
1350
|
-
/* @__PURE__ */
|
|
1412
|
+
/* @__PURE__ */ jsxs3("div", { className: "w100n-text-ribbon w100n-text-island", role: "toolbar", "aria-label": t.textTools, onKeyDown: rove, onPointerDown: keep, children: [
|
|
1413
|
+
context && /* @__PURE__ */ jsx3("div", { className: "w100n-text-tools", role: "group", "aria-label": state.table ? t.table : t.image, children: context }),
|
|
1414
|
+
extra && /* @__PURE__ */ jsx3("div", { className: "w100n-text-tools", role: "group", "aria-label": t.moreTools, children: extra }),
|
|
1415
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-text-tools", role: "group", "aria-label": t.textTools, children: main })
|
|
1351
1416
|
] }),
|
|
1352
|
-
/* @__PURE__ */
|
|
1353
|
-
can.edit && /* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "right", onPointerDown: keep, children: /* @__PURE__ */ jsxs3("div", { className: "w100n-text-tools", role: "group", "aria-label": t.findReplace, children: [
|
|
1418
|
+
can.edit && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1354
1419
|
tool(Undo2, t.undo, () => editor.chain().focus().undo().run(), void 0, !state.undo),
|
|
1355
1420
|
tool(Redo2, t.redo, () => editor.chain().focus().redo().run(), void 0, !state.redo),
|
|
1356
1421
|
gap
|
|
1357
1422
|
] }),
|
|
1358
1423
|
finder
|
|
1359
1424
|
] }) }),
|
|
1360
|
-
dialog && /* @__PURE__ */
|
|
1425
|
+
dialog && /* @__PURE__ */ jsx3("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
|
|
1361
1426
|
if (e.key === "Escape") {
|
|
1362
1427
|
e.stopPropagation();
|
|
1363
1428
|
setDialog(null);
|
|
1364
1429
|
}
|
|
1365
|
-
}, children: dialog.kind === "symbol" ? /* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */
|
|
1367
|
-
/* @__PURE__ */
|
|
1368
|
-
/* @__PURE__ */
|
|
1369
|
-
/* @__PURE__ */
|
|
1430
|
+
}, children: dialog.kind === "symbol" ? /* @__PURE__ */ jsxs3("div", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.symbols, children: [
|
|
1431
|
+
/* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
|
|
1432
|
+
/* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "pink", children: /* @__PURE__ */ jsx3(Omega, { "aria-hidden": true }) }),
|
|
1433
|
+
/* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.symbols }),
|
|
1434
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx3(X, { "aria-hidden": true }) })
|
|
1370
1435
|
] }),
|
|
1371
|
-
/* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */
|
|
1436
|
+
/* @__PURE__ */ jsxs3("label", { className: "w100n-docs-field w100n-docs-search", children: [
|
|
1437
|
+
/* @__PURE__ */ jsx3(Search, { "aria-hidden": true }),
|
|
1438
|
+
/* @__PURE__ */ jsx3("input", { autoFocus: true, value: dialog.query, placeholder: t.symbolSearch, "aria-label": t.symbolSearch, onChange: (e) => setDialog({ kind: "symbol", query: e.target.value }) })
|
|
1374
1439
|
] }),
|
|
1375
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ jsx3("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__ */ jsx3("button", { type: "button", "aria-label": name, title: name, onClick: () => {
|
|
1376
1441
|
editor.chain().focus().insertContent(ch).run();
|
|
1377
1442
|
setDialog(null);
|
|
1378
1443
|
}, children: ch }, ch)) })
|
|
1379
|
-
] }) : dialog.kind === "formula" ? /* @__PURE__ */
|
|
1444
|
+
] }) : dialog.kind === "formula" ? /* @__PURE__ */ jsxs3("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.formula, onSubmit: (e) => {
|
|
1380
1445
|
e.preventDefault();
|
|
1381
1446
|
const latex = dialog.latex.trim();
|
|
1382
1447
|
if (!latex) return;
|
|
@@ -1387,13 +1452,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1387
1452
|
else editor.chain().focus().insertContent({ type: "math", attrs: { latex } }).run();
|
|
1388
1453
|
setDialog(null);
|
|
1389
1454
|
}, children: [
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
/* @__PURE__ */
|
|
1455
|
+
/* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
|
|
1456
|
+
/* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ jsx3(Sigma, { "aria-hidden": true }) }),
|
|
1457
|
+
/* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.formula }),
|
|
1458
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx3(X, { "aria-hidden": true }) })
|
|
1394
1459
|
] }),
|
|
1395
|
-
/* @__PURE__ */
|
|
1396
|
-
/* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ jsx3("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 }) }),
|
|
1461
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-insert-tools", role: "group", "aria-label": t.formula, children: helpers.map(([label, code]) => /* @__PURE__ */ jsx3("button", { type: "button", onClick: () => {
|
|
1397
1462
|
const el = field.current;
|
|
1398
1463
|
const at = el.selectionStart ?? dialog.latex.length;
|
|
1399
1464
|
const latex = dialog.latex.slice(0, at) + code + dialog.latex.slice(el.selectionEnd ?? at);
|
|
@@ -1404,15 +1469,15 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1404
1469
|
el.setSelectionRange(caret, caret);
|
|
1405
1470
|
});
|
|
1406
1471
|
}, children: label }, label)) }),
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
/* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-insert-preview", "aria-live": "polite", dangerouslySetInnerHTML: { __html: dialog.latex.trim() ? mathml(dialog.latex) : "" } }),
|
|
1473
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
|
|
1474
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
|
|
1475
|
+
/* @__PURE__ */ jsxs3("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.latex.trim(), children: [
|
|
1476
|
+
/* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
|
|
1412
1477
|
dialog.at !== null ? t.update : t.put
|
|
1413
1478
|
] })
|
|
1414
1479
|
] })
|
|
1415
|
-
] }) : /* @__PURE__ */
|
|
1480
|
+
] }) : /* @__PURE__ */ jsxs3("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.footnote, onSubmit: (e) => {
|
|
1416
1481
|
e.preventDefault();
|
|
1417
1482
|
const text = dialog.text.trim();
|
|
1418
1483
|
if (!text) return;
|
|
@@ -1429,12 +1494,12 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1429
1494
|
}
|
|
1430
1495
|
setDialog(null);
|
|
1431
1496
|
}, children: [
|
|
1432
|
-
/* @__PURE__ */
|
|
1433
|
-
/* @__PURE__ */
|
|
1434
|
-
/* @__PURE__ */
|
|
1435
|
-
/* @__PURE__ */
|
|
1497
|
+
/* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
|
|
1498
|
+
/* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "violet", children: /* @__PURE__ */ jsx3(Superscript, { "aria-hidden": true }) }),
|
|
1499
|
+
/* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.footnote }),
|
|
1500
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx3(X, { "aria-hidden": true }) })
|
|
1436
1501
|
] }),
|
|
1437
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ jsx3(
|
|
1438
1503
|
"textarea",
|
|
1439
1504
|
{
|
|
1440
1505
|
autoFocus: true,
|
|
@@ -1448,40 +1513,40 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1448
1513
|
}
|
|
1449
1514
|
}
|
|
1450
1515
|
),
|
|
1451
|
-
/* @__PURE__ */
|
|
1452
|
-
dialog.at !== null && /* @__PURE__ */
|
|
1516
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
|
|
1517
|
+
dialog.at !== null && /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
|
|
1453
1518
|
editor.chain().focus().deleteRange({ from: dialog.at, to: dialog.at + 1 }).run();
|
|
1454
1519
|
setDialog(null);
|
|
1455
1520
|
}, children: t.removeFootnote }),
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
|
|
1522
|
+
/* @__PURE__ */ jsxs3("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.text.trim(), children: [
|
|
1523
|
+
/* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
|
|
1459
1524
|
dialog.at !== null ? t.update : t.put
|
|
1460
1525
|
] })
|
|
1461
1526
|
] })
|
|
1462
1527
|
] }) }),
|
|
1463
|
-
draft2 && /* @__PURE__ */
|
|
1528
|
+
draft2 && /* @__PURE__ */ jsx3("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
|
|
1464
1529
|
if (e.key === "Escape") {
|
|
1465
1530
|
e.stopPropagation();
|
|
1466
1531
|
setDraft2(null);
|
|
1467
1532
|
}
|
|
1468
|
-
}, children: /* @__PURE__ */
|
|
1533
|
+
}, children: /* @__PURE__ */ jsxs3("form", { className: "w100n-pdf-dialog w100n-setup", role: "dialog", "aria-modal": true, "aria-label": t.pageSetup, onSubmit: (e) => {
|
|
1469
1534
|
e.preventDefault();
|
|
1470
1535
|
applySetup();
|
|
1471
1536
|
}, children: [
|
|
1472
|
-
/* @__PURE__ */
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1475
|
-
/* @__PURE__ */
|
|
1537
|
+
/* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
|
|
1538
|
+
/* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ jsx3(Ruler, { "aria-hidden": true }) }),
|
|
1539
|
+
/* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.pageSetup }),
|
|
1540
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-docs-close", onClick: () => setDraft2(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx3(X, { "aria-hidden": true }) })
|
|
1476
1541
|
] }),
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1542
|
+
/* @__PURE__ */ jsx3("p", { className: "w100n-docs-caption", children: t.pageSize }),
|
|
1543
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.pageSize, children: [["A4", a4], ["Letter", letter], ["Legal", legal]].map(([label, size]) => {
|
|
1479
1544
|
const land = draft2.width > draft2.height;
|
|
1480
1545
|
const on = Math.abs(Math.min(draft2.width, draft2.height) - size.width) < 2 && Math.abs(Math.max(draft2.width, draft2.height) - size.height) < 2;
|
|
1481
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ jsx3("button", { type: "button", "aria-pressed": on, onClick: () => setDraft2({ ...draft2, width: land ? size.height : size.width, height: land ? size.width : size.height }), children: label }, label);
|
|
1482
1547
|
}) }),
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1548
|
+
/* @__PURE__ */ jsx3("p", { className: "w100n-docs-caption", children: t.orientation }),
|
|
1549
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.orientation, children: [[false, t.portrait], [true, t.landscape]].map(([land, label]) => /* @__PURE__ */ jsx3(
|
|
1485
1550
|
"button",
|
|
1486
1551
|
{
|
|
1487
1552
|
type: "button",
|
|
@@ -1493,11 +1558,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1493
1558
|
},
|
|
1494
1559
|
label
|
|
1495
1560
|
)) }),
|
|
1496
|
-
/* @__PURE__ */
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
/* @__PURE__ */
|
|
1499
|
-
/* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1561
|
+
/* @__PURE__ */ jsx3("p", { className: "w100n-docs-caption", children: t.marginsCm }),
|
|
1562
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.margins, children: margins.map(([label, values]) => /* @__PURE__ */ jsx3("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)) }),
|
|
1563
|
+
/* @__PURE__ */ jsx3("div", { className: "w100n-setup-grid", children: [t.mTop, t.mRight, t.mBottom, t.mLeft].map((label, n) => /* @__PURE__ */ jsxs3("label", { children: [
|
|
1564
|
+
/* @__PURE__ */ jsx3("span", { children: label }),
|
|
1565
|
+
/* @__PURE__ */ jsx3(
|
|
1501
1566
|
"input",
|
|
1502
1567
|
{
|
|
1503
1568
|
className: "w100n-docs-field",
|
|
@@ -1510,130 +1575,111 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1510
1575
|
}
|
|
1511
1576
|
)
|
|
1512
1577
|
] }, n)) }),
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
/* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ jsxs3("label", { className: "w100n-setup-line", children: [
|
|
1579
|
+
/* @__PURE__ */ jsx3("span", { children: t.headerText }),
|
|
1580
|
+
/* @__PURE__ */ jsx3("input", { className: "w100n-docs-field", value: draft2.header, onChange: (e) => setDraft2({ ...draft2, header: e.target.value }) })
|
|
1516
1581
|
] }),
|
|
1517
|
-
/* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1582
|
+
/* @__PURE__ */ jsxs3("label", { className: "w100n-setup-line", children: [
|
|
1583
|
+
/* @__PURE__ */ jsx3("span", { children: t.footerText }),
|
|
1584
|
+
/* @__PURE__ */ jsx3("input", { className: "w100n-docs-field", value: draft2.footer, onChange: (e) => setDraft2({ ...draft2, footer: e.target.value }) })
|
|
1520
1585
|
] }),
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ jsxs3("label", { className: "w100n-setup-check", children: [
|
|
1587
|
+
/* @__PURE__ */ jsx3("input", { type: "checkbox", checked: draft2.numbers, onChange: (e) => setDraft2({ ...draft2, numbers: e.target.checked }) }),
|
|
1523
1588
|
t.pageNumbers
|
|
1524
1589
|
] }),
|
|
1525
|
-
/* @__PURE__ */
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
/* @__PURE__ */
|
|
1528
|
-
/* @__PURE__ */
|
|
1590
|
+
/* @__PURE__ */ jsxs3("div", { className: "w100n-pdf-dialog-end", children: [
|
|
1591
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDraft2(null), children: t.cancel }),
|
|
1592
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", onClick: applySetup, children: [
|
|
1593
|
+
/* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
|
|
1529
1594
|
t.apply
|
|
1530
1595
|
] })
|
|
1531
1596
|
] })
|
|
1532
1597
|
] }) }),
|
|
1533
|
-
slot && createPortal(/* @__PURE__ */
|
|
1534
|
-
draft && /* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
|
|
1538
|
-
{
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) void post();
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
),
|
|
1549
|
-
/* @__PURE__ */ jsxs2("span", { className: "w100n-pdf-dialog-end", children: [
|
|
1550
|
-
/* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", onClick: drop, children: t.cancel }),
|
|
1551
|
-
/* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", disabled: !draft.body.trim() || posting === "busy", onClick: () => void post(), children: [
|
|
1552
|
-
/* @__PURE__ */ jsx2(MessageSquarePlus, { "aria-hidden": true }),
|
|
1598
|
+
slot && createPortal(/* @__PURE__ */ jsxs3("div", { className: "w100n-text-notes", children: [
|
|
1599
|
+
draft && /* @__PURE__ */ jsxs3("div", { className: "w100n-text-card w100n-text-draft", children: [
|
|
1600
|
+
/* @__PURE__ */ jsx3("blockquote", { children: draft.quote }),
|
|
1601
|
+
/* @__PURE__ */ jsx3(Mentions, { autoFocus: true, value: draft.body, placeholder: t.writeComment, label: t.writeComment, people, onChange: (body) => setDraft({ ...draft, body }), onSend: () => void post() }),
|
|
1602
|
+
tagged(draft.body, people).length > 0 && /* @__PURE__ */ jsxs3("label", { className: "w100n-setup-check", children: [
|
|
1603
|
+
/* @__PURE__ */ jsx3("input", { type: "checkbox", checked: draft.give, onChange: (e) => setDraft({ ...draft, give: e.target.checked }) }),
|
|
1604
|
+
t.assignTo.replace("{name}", tagged(draft.body, people)[0].name)
|
|
1605
|
+
] }),
|
|
1606
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
|
|
1607
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: drop, children: t.cancel }),
|
|
1608
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !draft.body.trim() || posting === "busy", onClick: () => void post(), children: [
|
|
1609
|
+
/* @__PURE__ */ jsx3(MessageSquarePlus, { "aria-hidden": true }),
|
|
1553
1610
|
t.post
|
|
1554
1611
|
] })
|
|
1555
1612
|
] })
|
|
1556
1613
|
] }),
|
|
1557
|
-
suggested.length > 0 && /* @__PURE__ */
|
|
1558
|
-
/* @__PURE__ */
|
|
1559
|
-
/* @__PURE__ */
|
|
1614
|
+
suggested.length > 0 && /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
1615
|
+
/* @__PURE__ */ jsxs3("p", { className: "w100n-docs-caption", children: [
|
|
1616
|
+
/* @__PURE__ */ jsx3(FilePenLine, { "aria-hidden": true }),
|
|
1560
1617
|
t.suggestions,
|
|
1561
|
-
/* @__PURE__ */
|
|
1618
|
+
/* @__PURE__ */ jsx3("span", { children: suggested.length })
|
|
1562
1619
|
] }),
|
|
1563
|
-
suggested.map((c, i) => /* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1566
|
-
/* @__PURE__ */
|
|
1567
|
-
/* @__PURE__ */
|
|
1568
|
-
c.date && /* @__PURE__ */
|
|
1620
|
+
suggested.map((c, i) => /* @__PURE__ */ jsxs3("article", { className: "w100n-text-card w100n-text-change", "data-kind": c.kind, onClick: () => jump(c.from), children: [
|
|
1621
|
+
/* @__PURE__ */ jsxs3("header", { children: [
|
|
1622
|
+
/* @__PURE__ */ jsx3("span", { className: "w100n-text-face", "aria-hidden": true, children: (c.author || "?").slice(0, 1).toUpperCase() }),
|
|
1623
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-text-who", children: [
|
|
1624
|
+
/* @__PURE__ */ jsx3("b", { children: c.author || t.someone }),
|
|
1625
|
+
c.date && /* @__PURE__ */ jsx3("small", { children: when(c.date) })
|
|
1569
1626
|
] })
|
|
1570
1627
|
] }),
|
|
1571
|
-
/* @__PURE__ */
|
|
1628
|
+
/* @__PURE__ */ jsxs3("p", { children: [
|
|
1572
1629
|
c.kind === "insertion" ? t.added : t.removed,
|
|
1573
1630
|
" ",
|
|
1574
|
-
/* @__PURE__ */
|
|
1631
|
+
/* @__PURE__ */ jsx3("q", { children: c.text })
|
|
1575
1632
|
] }),
|
|
1576
|
-
can.edit && /* @__PURE__ */
|
|
1577
|
-
/* @__PURE__ */
|
|
1578
|
-
/* @__PURE__ */
|
|
1633
|
+
can.edit && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
|
|
1634
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => decide(editor, true, c.id), children: [
|
|
1635
|
+
/* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
|
|
1579
1636
|
t.accept
|
|
1580
1637
|
] }),
|
|
1581
|
-
/* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1638
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => decide(editor, false, c.id), children: [
|
|
1639
|
+
/* @__PURE__ */ jsx3(X, { "aria-hidden": true }),
|
|
1583
1640
|
t.reject
|
|
1584
1641
|
] })
|
|
1585
1642
|
] })
|
|
1586
1643
|
] }, i))
|
|
1587
1644
|
] }),
|
|
1588
|
-
posting === "failed" && /* @__PURE__ */
|
|
1589
|
-
failed && /* @__PURE__ */
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1645
|
+
posting === "failed" && /* @__PURE__ */ jsx3("p", { className: "w100n-docs-muted", role: "alert", children: t.commentFailed }),
|
|
1646
|
+
failed && /* @__PURE__ */ jsx3("p", { className: "w100n-docs-muted", role: "alert", children: t.changeFailed }),
|
|
1647
|
+
/* @__PURE__ */ jsxs3("div", { className: "w100n-docs-row", children: [
|
|
1648
|
+
/* @__PURE__ */ jsxs3("p", { className: "w100n-docs-caption", children: [
|
|
1649
|
+
/* @__PURE__ */ jsx3(MessagesSquare, { "aria-hidden": true }),
|
|
1593
1650
|
t.comments,
|
|
1594
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ jsx3("span", { children: open.length })
|
|
1595
1652
|
] }),
|
|
1596
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ jsx3("span", { className: "w100n-docs-chips", children: /* @__PURE__ */ jsx3("button", { type: "button", "aria-pressed": resolved, onClick: () => setResolved(!resolved), children: t.showResolved }) })
|
|
1597
1654
|
] }),
|
|
1598
|
-
!threads.length && !draft && /* @__PURE__ */
|
|
1599
|
-
threads.map((c) => /* @__PURE__ */
|
|
1655
|
+
!threads.length && !draft && /* @__PURE__ */ jsx3("p", { className: "w100n-docs-muted", children: can.comment ? t.commentHint : t.noComments }),
|
|
1656
|
+
threads.map((c) => /* @__PURE__ */ jsxs3("article", { className: "w100n-text-card", "aria-current": active === c.id, "data-resolved": c.resolved, onClick: () => show(c), children: [
|
|
1600
1657
|
person(c),
|
|
1601
|
-
c.
|
|
1658
|
+
c.assignee && /* @__PURE__ */ jsx3("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) }),
|
|
1659
|
+
c.quote && /* @__PURE__ */ jsx3("blockquote", { children: c.quote }),
|
|
1602
1660
|
words(c),
|
|
1603
|
-
all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */
|
|
1661
|
+
all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */ jsxs3("div", { className: "w100n-text-reply", children: [
|
|
1604
1662
|
person(r),
|
|
1605
1663
|
words(r)
|
|
1606
1664
|
] }, r.id)),
|
|
1607
|
-
reply?.id === c.id && /* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
|
|
1610
|
-
{
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
placeholder: t.writeComment,
|
|
1614
|
-
"aria-label": t.reply,
|
|
1615
|
-
onChange: (e) => setReply({ ...reply, body: e.target.value }),
|
|
1616
|
-
onKeyDown: (e) => {
|
|
1617
|
-
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) void answer(c);
|
|
1618
|
-
}
|
|
1619
|
-
}
|
|
1620
|
-
),
|
|
1621
|
-
/* @__PURE__ */ jsxs2("span", { className: "w100n-pdf-dialog-end", children: [
|
|
1622
|
-
/* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", onClick: () => setReply(null), children: t.cancel }),
|
|
1623
|
-
/* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", disabled: !reply.body.trim() || posting === "busy", onClick: () => void answer(c), children: [
|
|
1624
|
-
/* @__PURE__ */ jsx2(Reply, { "aria-hidden": true }),
|
|
1665
|
+
reply?.id === c.id && /* @__PURE__ */ jsxs3("div", { className: "w100n-text-reply", onClick: (e) => e.stopPropagation(), children: [
|
|
1666
|
+
/* @__PURE__ */ jsx3(Mentions, { autoFocus: true, value: reply.body, placeholder: t.writeComment, label: t.reply, people, onChange: (body) => setReply({ ...reply, body }), onSend: () => void answer(c) }),
|
|
1667
|
+
/* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
|
|
1668
|
+
/* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setReply(null), children: t.cancel }),
|
|
1669
|
+
/* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !reply.body.trim() || posting === "busy", onClick: () => void answer(c), children: [
|
|
1670
|
+
/* @__PURE__ */ jsx3(Reply, { "aria-hidden": true }),
|
|
1625
1671
|
t.reply
|
|
1626
1672
|
] })
|
|
1627
1673
|
] })
|
|
1628
1674
|
] }),
|
|
1629
|
-
can.comment && reply?.id !== c.id && /* @__PURE__ */
|
|
1630
|
-
c.resolved && /* @__PURE__ */
|
|
1631
|
-
!c.resolved && /* @__PURE__ */
|
|
1632
|
-
/* @__PURE__ */
|
|
1675
|
+
can.comment && reply?.id !== c.id && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
|
|
1676
|
+
c.resolved && /* @__PURE__ */ jsx3("span", { className: "w100n-docs-badge", children: t.resolved }),
|
|
1677
|
+
!c.resolved && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", onClick: () => setReply({ id: c.id, body: "" }), children: [
|
|
1678
|
+
/* @__PURE__ */ jsx3(Reply, { "aria-hidden": true }),
|
|
1633
1679
|
t.reply
|
|
1634
1680
|
] }),
|
|
1635
|
-
host?.resolveComment && /* @__PURE__ */
|
|
1636
|
-
c.resolved ? /* @__PURE__ */
|
|
1681
|
+
host?.resolveComment && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => void settle(c), children: [
|
|
1682
|
+
c.resolved ? /* @__PURE__ */ jsx3(RotateCcw, { "aria-hidden": true }) : /* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
|
|
1637
1683
|
c.resolved ? t.reopen : t.resolve
|
|
1638
1684
|
] })
|
|
1639
1685
|
] })
|
|
@@ -1644,4 +1690,4 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
|
|
|
1644
1690
|
export {
|
|
1645
1691
|
TextEditor as default
|
|
1646
1692
|
};
|
|
1647
|
-
//# sourceMappingURL=TextEditor-
|
|
1693
|
+
//# sourceMappingURL=TextEditor-BF6HCNHL.js.map
|