@w100n/documents 0.16.0 → 0.16.2

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.
Files changed (39) hide show
  1. package/dist/{SheetView-EFBSMY7K.js → SheetView-S5AFXKPA.js} +5 -5
  2. package/dist/{TextEditor-MGCSGGGA.js → TextEditor-7WQJFUUU.js} +399 -349
  3. package/dist/TextEditor-7WQJFUUU.js.map +1 -0
  4. package/dist/{chunk-3OLRFIHQ.js → chunk-JC4DLTMI.js} +2 -2
  5. package/dist/{chunk-2L3TK7UF.js → chunk-KGAQT5M3.js} +3 -3
  6. package/dist/{chunk-2L3TK7UF.js.map → chunk-KGAQT5M3.js.map} +1 -1
  7. package/dist/{chunk-RKV3N6OS.js → chunk-LZYITB56.js} +22 -1
  8. package/dist/chunk-LZYITB56.js.map +1 -0
  9. package/dist/collab.cjs +22 -1
  10. package/dist/collab.cjs.map +1 -1
  11. package/dist/collab.d.cts +1 -1
  12. package/dist/collab.d.ts +1 -1
  13. package/dist/collab.js +2 -2
  14. package/dist/{grid-Q4XBPQFY.js → grid-AZLMNS7K.js} +15 -6
  15. package/dist/grid-AZLMNS7K.js.map +1 -0
  16. package/dist/index.cjs +1023 -886
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.css +78 -6
  19. package/dist/index.css.map +1 -1
  20. package/dist/index.d.cts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +58 -14
  23. package/dist/index.js.map +1 -1
  24. package/dist/kinds.d.cts +1 -1
  25. package/dist/kinds.d.ts +1 -1
  26. package/dist/memory.cjs +25 -2
  27. package/dist/memory.cjs.map +1 -1
  28. package/dist/memory.d.cts +3 -2
  29. package/dist/memory.d.ts +3 -2
  30. package/dist/memory.js +25 -2
  31. package/dist/memory.js.map +1 -1
  32. package/dist/{types-BTsVooZw.d.cts → types-DNcaU6SK.d.cts} +9 -0
  33. package/dist/{types-BTsVooZw.d.ts → types-DNcaU6SK.d.ts} +9 -0
  34. package/package.json +1 -1
  35. package/dist/TextEditor-MGCSGGGA.js.map +0 -1
  36. package/dist/chunk-RKV3N6OS.js.map +0 -1
  37. package/dist/grid-Q4XBPQFY.js.map +0 -1
  38. /package/dist/{SheetView-EFBSMY7K.js.map → SheetView-S5AFXKPA.js.map} +0 -0
  39. /package/dist/{chunk-3OLRFIHQ.js.map → chunk-JC4DLTMI.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-QDH7EZAF.js";
5
5
  import {
6
6
  useLive
7
- } from "./chunk-3OLRFIHQ.js";
7
+ } from "./chunk-JC4DLTMI.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-2L3TK7UF.js";
26
+ } from "./chunk-KGAQT5M3.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-RKV3N6OS.js";
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 useRef2, useState as useState2 } from "react";
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 jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
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 = useRef2(null);
236
- const anchors = useRef2(/* @__PURE__ */ new Map());
237
- const scroller = useRef2(null);
238
- const root = useRef2(null);
239
- const [pop, setPop] = useState2(null);
240
- const [spot, setSpot] = useState2({ x: 0, y: 0 });
241
- const touch = useRef2(false);
242
- const [spell, setSpell] = useState2(() => typeof localStorage === "undefined" || localStorage.getItem("w100n-docs-spell") !== "0");
243
- const [dialog, setDialog] = useState2(null);
244
- const field = useRef2(null);
245
- const [more, setMore] = useState2(() => typeof localStorage !== "undefined" && localStorage.getItem("w100n-docs-more") === "1");
246
- const [zoom, setZoom] = useState2(null);
247
- const [layout, setLayout] = useState2(null);
248
- const [room, setRoom] = useState2(0);
249
- const [printed, setPrinted] = useState2(null);
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] = useState2("idle");
252
- const [href, setHref] = useState2("");
253
- const [grid, setGrid] = useState2({ rows: 0, cols: 0 });
254
- const [draft, setDraft] = useState2(null);
255
- const [reply, setReply] = useState2(null);
256
- const [active, setActive] = useState2(null);
257
- const [resolved, setResolved] = useState2(false);
258
- const [posting, setPosting] = useState2("idle");
259
- const [added, setAdded] = useState2([]);
260
- const [changed, setChanged] = useState2({});
261
- const [editing, setEditing] = useState2(null);
262
- const [dropping, setDropping] = useState2(null);
263
- const [failed, setFailed] = useState2(false);
264
- const [paint, setPaint] = useState2(null);
265
- const [query, setQuery] = useState2("");
266
- const [swap, setSwap] = useState2("");
267
- const [matchCase, setMatchCase] = useState2(false);
268
- const [count, setCount] = useState2({ words: 0, pages: 0 });
269
- const [marg, setMarg] = useState2(null);
270
- const [unsetup, setUnsetup] = useState2(false);
271
- const [draft2, setDraft2] = useState2(null);
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__ */ jsx2("div", { className: "w100n-docs-scroll", children: /* @__PURE__ */ jsx2(DocxView, { bytes, onOutline, failed: t.failed }) }) : /* @__PURE__ */ jsx2("div", { className: "w100n-docs-empty", children: t.failed });
526
- if (!source.data || !editor || !state || live && !live.ready && !live.late && !live.denied) return /* @__PURE__ */ jsx2("div", { className: "w100n-docs-empty", children: t.loading });
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__ */ jsx2("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled, onClick: () => {
765
+ return /* @__PURE__ */ jsx3("button", { type: "button", "aria-label": label, title: label, "aria-pressed": pressed, disabled, onClick: () => {
702
766
  run();
703
- }, children: /* @__PURE__ */ jsx2(Icon, { "aria-hidden": true }) });
767
+ }, children: /* @__PURE__ */ jsx3(Icon, { "aria-hidden": true }) });
704
768
  };
705
- const gap = /* @__PURE__ */ jsx2("span", { className: "w100n-pdf-gap" });
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__ */ jsxs2("header", { children: [
725
- c.author.avatarUrl ? /* @__PURE__ */ jsx2("img", { className: "w100n-text-face", src: c.author.avatarUrl, alt: "" }) : /* @__PURE__ */ jsx2("span", { className: "w100n-text-face", "aria-hidden": true, children: c.author.name.slice(0, 1).toUpperCase() }),
726
- /* @__PURE__ */ jsxs2("span", { className: "w100n-text-who", children: [
727
- /* @__PURE__ */ jsxs2("b", { children: [
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__ */ jsx2("span", { className: "w100n-docs-badge", children: t.guest })
793
+ c.author.id.startsWith("guest:") && /* @__PURE__ */ jsx3("span", { className: "w100n-docs-badge", children: t.guest })
730
794
  ] }),
731
- /* @__PURE__ */ jsx2("small", { children: when(c.createdAt) })
795
+ /* @__PURE__ */ jsx3("small", { children: when(c.createdAt) })
732
796
  ] }),
733
- drops(c) && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-own", onClick: (e) => e.stopPropagation(), children: [
734
- mine(c) && host.editComment && /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": t.editComment, title: t.editComment, onClick: () => {
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__ */ jsx2(Pencil, { "aria-hidden": true }) }),
738
- host.deleteComment && /* @__PURE__ */ jsx2("button", { type: "button", "data-tone": "red", "aria-label": t.delete, title: t.delete, onClick: () => {
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__ */ jsx2(Trash2, { "aria-hidden": true }) })
805
+ }, children: /* @__PURE__ */ jsx3(Trash2, { "aria-hidden": true }) })
742
806
  ] })
743
807
  ] });
744
- const words = (c) => editing?.id === c.id ? /* @__PURE__ */ jsxs2("div", { className: "w100n-text-reply w100n-text-edit", onClick: (e) => e.stopPropagation(), children: [
745
- /* @__PURE__ */ jsx2(
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__ */ jsxs2("span", { className: "w100n-pdf-dialog-end", children: [
758
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", onClick: () => setEditing(null), children: t.cancel }),
759
- /* @__PURE__ */ jsxs2("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: [
760
- /* @__PURE__ */ jsx2(Save, { "aria-hidden": true }),
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__ */ jsxs2("div", { className: "w100n-text-confirm", role: "group", "aria-label": t.delete, onClick: (e) => e.stopPropagation(), children: [
765
- /* @__PURE__ */ jsx2("p", { children: c.replyTo || !all.some((r) => r.replyTo === c.id) ? t.deleteAsk : t.deleteThread }),
766
- /* @__PURE__ */ jsxs2("span", { className: "w100n-pdf-dialog-end", children: [
767
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", autoFocus: true, onClick: () => setDropping(null), children: t.cancel }),
768
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", disabled: posting === "busy", onClick: () => void change(c.id, null), children: [
769
- /* @__PURE__ */ jsx2(Trash2, { "aria-hidden": true }),
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__ */ jsx2("p", { children: c.body });
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__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-swatches", role: "group", children: [
776
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-text-none", onClick: () => {
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__ */ jsx2("button", { type: "button", "aria-label": c, "aria-pressed": current === c, onClick: () => {
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__ */ jsx2("i", { style: { background: c } }) }, i))
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__ */ jsx2("hr", {}, i) : /* @__PURE__ */ jsxs2("button", { type: "button", role: x.on === void 0 ? "menuitem" : "menuitemcheckbox", "aria-checked": x.on, disabled: x.off, onClick: () => {
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__ */ jsx2(Check, { "aria-hidden": true }),
913
- /* @__PURE__ */ jsx2("span", { children: x.label }),
914
- x.keys && /* @__PURE__ */ jsx2("kbd", { children: x.keys })
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__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
917
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-text-menu-button", "data-pop": true, "aria-haspopup": "menu", "aria-expanded": pop === key, onClick: () => pick(key), children: label }),
918
- pop === key && /* @__PURE__ */ jsx2("span", { className: "w100n-text-pop w100n-text-menu", role: "menu", "aria-label": label, children: rows(list) })
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__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
931
- /* @__PURE__ */ jsx2("button", { type: "button", "data-pop": true, "aria-expanded": pop === "find", "aria-label": t.findReplace, title: t.findReplace, onClick: () => pick("find"), children: /* @__PURE__ */ jsx2(Search, { "aria-hidden": true }) }),
932
- pop === "find" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-find", role: "search", "aria-label": t.findReplace, children: [
933
- /* @__PURE__ */ jsxs2("span", { className: "w100n-docs-row", children: [
934
- /* @__PURE__ */ jsx2(
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,27 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
951
1016
  }
952
1017
  }
953
1018
  ),
954
- /* @__PURE__ */ jsx2("small", { "aria-live": "polite", children: query ? found?.hits.length ? `${(found.at ?? 0) + 1} / ${found.hits.length}` : t.noHits : "" }),
955
- /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": t.previous, title: t.previous, disabled: !found?.hits.length, onClick: () => seek({ at: found.at - 1 }), children: /* @__PURE__ */ jsx2(ChevronUp, { "aria-hidden": true }) }),
956
- /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": t.next, title: t.next, disabled: !found?.hits.length, onClick: () => seek({ at: found.at + 1 }), children: /* @__PURE__ */ jsx2(ChevronDown, { "aria-hidden": true }) })
1019
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-text-find-end", children: [
1020
+ /* @__PURE__ */ jsx3("small", { "aria-live": "polite", children: query ? found?.hits.length ? `${(found.at ?? 0) + 1} / ${found.hits.length}` : t.noHits : "" }),
1021
+ /* @__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 }) }),
1022
+ /* @__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 }) })
1023
+ ] })
957
1024
  ] }),
958
- can.edit && /* @__PURE__ */ jsxs2("span", { className: "w100n-docs-row", children: [
959
- /* @__PURE__ */ jsx2("input", { value: swap, placeholder: t.replaceWith, "aria-label": t.replaceWith, onChange: (e) => setSwap(e.target.value) }),
960
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", disabled: !found?.hits.length, onClick: () => {
961
- replace(editor, swap, false);
962
- seek({});
963
- }, children: t.replaceOne }),
964
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-docs-action", disabled: !found?.hits.length, onClick: () => {
965
- replace(editor, swap, true);
966
- seek({});
967
- }, children: t.replaceAll })
1025
+ can.edit && /* @__PURE__ */ jsxs3("span", { className: "w100n-docs-row", children: [
1026
+ /* @__PURE__ */ jsx3("input", { value: swap, placeholder: t.replaceWith, "aria-label": t.replaceWith, onChange: (e) => setSwap(e.target.value) }),
1027
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-text-find-end", children: [
1028
+ /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", disabled: !found?.hits.length, onClick: () => {
1029
+ replace(editor, swap, false);
1030
+ seek({});
1031
+ }, children: t.replaceOne }),
1032
+ /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-docs-action", disabled: !found?.hits.length, onClick: () => {
1033
+ replace(editor, swap, true);
1034
+ seek({});
1035
+ }, children: t.replaceAll })
1036
+ ] })
968
1037
  ] }),
969
- /* @__PURE__ */ jsxs2("label", { className: "w100n-setup-check", children: [
970
- /* @__PURE__ */ jsx2("input", { type: "checkbox", checked: matchCase, onChange: (e) => {
1038
+ /* @__PURE__ */ jsxs3("label", { className: "w100n-setup-check", children: [
1039
+ /* @__PURE__ */ jsx3("input", { type: "checkbox", checked: matchCase, onChange: (e) => {
971
1040
  setMatchCase(e.target.checked);
972
1041
  seek({ matchCase: e.target.checked, at: 0 });
973
1042
  } }),
@@ -992,47 +1061,47 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
992
1061
  spacing(editor, { line: paint.block.line, after: paint.block.after });
993
1062
  if (!paint.keep) setPaint(null);
994
1063
  };
995
- const fontPicker = /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
996
- /* @__PURE__ */ jsxs2("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: [
997
- /* @__PURE__ */ jsx2("span", { style: { fontFamily: state.font ?? void 0 }, children: state.font ?? t.defaultFont }),
998
- /* @__PURE__ */ jsx2(ChevronDown, { "aria-hidden": true })
1064
+ const fontPicker = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1065
+ /* @__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: [
1066
+ /* @__PURE__ */ jsx3("span", { style: { fontFamily: state.font ?? void 0 }, children: state.font ?? t.defaultFont }),
1067
+ /* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
999
1068
  ] }),
1000
- pop === "font" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.font, children: [
1001
- /* @__PURE__ */ jsx2("button", { type: "button", role: "option", "aria-selected": !state.font, onClick: () => {
1069
+ pop === "font" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.font, children: [
1070
+ /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": !state.font, onClick: () => {
1002
1071
  editor.chain().focus().unsetFontFamily().run();
1003
1072
  setPop(null);
1004
1073
  }, children: t.defaultFont }),
1005
- faces.map((f) => /* @__PURE__ */ jsx2("button", { type: "button", role: "option", "aria-selected": state.font === f, style: { fontFamily: f }, onClick: () => {
1074
+ faces.map((f) => /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": state.font === f, style: { fontFamily: f }, onClick: () => {
1006
1075
  editor.chain().focus().setFontFamily(f).run();
1007
1076
  setPop(null);
1008
1077
  }, children: f }, f))
1009
1078
  ] })
1010
1079
  ] });
1011
- const sizePicker = /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1012
- /* @__PURE__ */ jsxs2("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: [
1080
+ const sizePicker = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1081
+ /* @__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
1082
  state.size ? parseFloat(state.size) : t.defaultFont,
1014
- /* @__PURE__ */ jsx2(ChevronDown, { "aria-hidden": true })
1083
+ /* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
1015
1084
  ] }),
1016
- pop === "size" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.fontSize, children: [
1017
- /* @__PURE__ */ jsx2("button", { type: "button", role: "option", "aria-selected": !state.size, onClick: () => {
1085
+ pop === "size" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.fontSize, children: [
1086
+ /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": !state.size, onClick: () => {
1018
1087
  editor.chain().focus().unsetFontSize().run();
1019
1088
  setPop(null);
1020
1089
  }, children: t.defaultFont }),
1021
- sizes.map((n) => /* @__PURE__ */ jsx2("button", { type: "button", role: "option", "aria-selected": state.size !== null && parseFloat(state.size) === n, onClick: () => {
1090
+ sizes.map((n) => /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": state.size !== null && parseFloat(state.size) === n, onClick: () => {
1022
1091
  editor.chain().focus().setFontSize(`${n}pt`).run();
1023
1092
  setPop(null);
1024
1093
  }, children: n }, n))
1025
1094
  ] })
1026
1095
  ] });
1027
- const spacer = /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1028
- /* @__PURE__ */ jsx2("button", { type: "button", "data-pop": true, "aria-expanded": pop === "spacing", "aria-label": t.lineSpacing, title: t.lineSpacing, onClick: () => pick("spacing"), children: /* @__PURE__ */ jsx2(UnfoldVertical, { "aria-hidden": true }) }),
1029
- pop === "spacing" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.lineSpacing, children: [
1030
- lines.map(([v, label]) => /* @__PURE__ */ jsx2("button", { type: "button", role: "option", "aria-selected": state.line === v, onClick: () => {
1096
+ const spacer = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1097
+ /* @__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 }) }),
1098
+ pop === "spacing" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.lineSpacing, children: [
1099
+ lines.map(([v, label]) => /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": state.line === v, onClick: () => {
1031
1100
  spacing(editor, { line: v });
1032
1101
  setPop(null);
1033
1102
  }, children: label }, v)),
1034
- /* @__PURE__ */ jsx2("hr", {}),
1035
- /* @__PURE__ */ jsx2("button", { type: "button", role: "option", "aria-selected": false, onClick: () => {
1103
+ /* @__PURE__ */ jsx3("hr", {}),
1104
+ /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": false, onClick: () => {
1036
1105
  spacing(editor, { after: state.after === 0 ? 8 : 0 });
1037
1106
  setPop(null);
1038
1107
  }, children: state.after === 0 ? t.spaceAfter : t.noSpaceAfter })
@@ -1055,18 +1124,18 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1055
1124
  setDraft2(null);
1056
1125
  };
1057
1126
  const zooms = [50, 75, 90, 100, 125, 150, 200];
1058
- const zoomer = /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1059
- /* @__PURE__ */ jsxs2("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: [
1127
+ const zoomer = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1128
+ /* @__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
1129
  percent,
1061
1130
  "%",
1062
- /* @__PURE__ */ jsx2(ChevronDown, { "aria-hidden": true })
1131
+ /* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
1063
1132
  ] }),
1064
- pop === "zoom" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.zoom, children: [
1065
- docx && /* @__PURE__ */ jsx2("button", { type: "button", role: "option", "aria-selected": zoom === null, onClick: () => {
1133
+ pop === "zoom" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.zoom, children: [
1134
+ docx && /* @__PURE__ */ jsx3("button", { type: "button", role: "option", "aria-selected": zoom === null, onClick: () => {
1066
1135
  setZoom(null);
1067
1136
  setPop(null);
1068
1137
  }, children: t.fitWidth }),
1069
- zooms.map((z) => /* @__PURE__ */ jsxs2("button", { type: "button", role: "option", "aria-selected": zoom === z, onClick: () => {
1138
+ zooms.map((z) => /* @__PURE__ */ jsxs3("button", { type: "button", role: "option", "aria-selected": zoom === z, onClick: () => {
1070
1139
  setZoom(z);
1071
1140
  setPop(null);
1072
1141
  }, children: [
@@ -1076,9 +1145,9 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1076
1145
  ] })
1077
1146
  ] });
1078
1147
  const Aligned = aligns.find(([, , value]) => value === state.align)?.[0] ?? AlignLeft;
1079
- const aligner = /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1080
- /* @__PURE__ */ jsx2("button", { type: "button", "data-pop": true, "aria-expanded": pop === "align", "aria-label": t.align, title: t.align, onClick: () => pick("align"), children: /* @__PURE__ */ jsx2(Aligned, { "aria-hidden": true }) }),
1081
- pop === "align" && /* @__PURE__ */ jsx2("span", { className: "w100n-text-pop", role: "group", "aria-label": t.align, children: /* @__PURE__ */ jsx2("span", { className: "w100n-text-tools", children: aligns.map(([icon, label, value], i) => /* @__PURE__ */ jsx2(Fragment2, { children: tool(icon, label, () => {
1148
+ const aligner = /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1149
+ /* @__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 }) }),
1150
+ 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
1151
  align(editor, value);
1083
1152
  setPop(null);
1084
1153
  }, state.align === value) }, i)) }) })
@@ -1087,13 +1156,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1087
1156
  localStorage.setItem("w100n-docs-more", more ? "" : "1");
1088
1157
  setMore(!more);
1089
1158
  };
1090
- const main = can.edit ? /* @__PURE__ */ jsxs2(Fragment3, { children: [
1091
- /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1092
- /* @__PURE__ */ jsxs2("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: [
1159
+ const main = can.edit ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
1160
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1161
+ /* @__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
1162
  styles.find(([key]) => key === state.style)?.[1] ?? t.normal,
1094
- /* @__PURE__ */ jsx2(ChevronDown, { "aria-hidden": true })
1163
+ /* @__PURE__ */ jsx3(ChevronDown, { "aria-hidden": true })
1095
1164
  ] }),
1096
- pop === "style" && /* @__PURE__ */ jsx2("span", { className: "w100n-text-pop w100n-text-styles", role: "listbox", "aria-label": t.paragraphStyle, children: styles.map(([key, label, run]) => /* @__PURE__ */ jsx2(
1165
+ 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
1166
  "button",
1098
1167
  {
1099
1168
  type: "button",
@@ -1114,10 +1183,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1114
1183
  tool(Italic, t.italic, () => editor.chain().focus().toggleItalic().run(), state.italic),
1115
1184
  docx ? tool(Underline, t.underline, () => editor.chain().focus().toggleUnderline().run(), state.underline) : tool(Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
1116
1185
  !docx && tool(Code, t.code, () => editor.chain().focus().toggleCode().run(), state.code),
1117
- docx && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1118
- /* @__PURE__ */ jsxs2("button", { type: "button", "data-pop": true, "aria-expanded": pop === "color", "aria-label": t.textColour, title: t.textColour, onClick: () => pick("color"), children: [
1119
- /* @__PURE__ */ jsx2(Baseline, { "aria-hidden": true }),
1120
- /* @__PURE__ */ jsx2("i", { className: "w100n-text-bar", style: { background: state.color ?? "currentColor" } })
1186
+ docx && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1187
+ /* @__PURE__ */ jsxs3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "color", "aria-label": t.textColour, title: t.textColour, onClick: () => pick("color"), children: [
1188
+ /* @__PURE__ */ jsx3(Baseline, { "aria-hidden": true }),
1189
+ /* @__PURE__ */ jsx3("i", { className: "w100n-text-bar", style: { background: state.color ?? "currentColor" } })
1121
1190
  ] }),
1122
1191
  pop === "color" && swatches(inks, state.color, (c) => c ? editor.chain().focus().setColor(c).run() : editor.chain().focus().unsetColor().run(), t.automatic)
1123
1192
  ] }),
@@ -1127,35 +1196,35 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1127
1196
  tool(ListOrdered, t.numbers, () => editor.chain().focus().toggleOrderedList().run(), state.numbers),
1128
1197
  !docx && tool(ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
1129
1198
  gap,
1130
- /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1131
- /* @__PURE__ */ jsx2("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__ */ jsx2(Link, { "aria-hidden": true }) }),
1132
- pop === "link" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-form", children: [
1133
- /* @__PURE__ */ jsx2("input", { autoFocus: true, value: href, placeholder: t.linkAddress, "aria-label": t.linkAddress, onChange: (e) => setHref(e.target.value), onKeyDown: (e) => {
1199
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1200
+ /* @__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 }) }),
1201
+ pop === "link" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-form", children: [
1202
+ /* @__PURE__ */ jsx3("input", { autoFocus: true, value: href, placeholder: t.linkAddress, "aria-label": t.linkAddress, onChange: (e) => setHref(e.target.value), onKeyDown: (e) => {
1134
1203
  if (e.key === "Enter") putLink();
1135
1204
  } }),
1136
- /* @__PURE__ */ jsxs2("span", { className: "w100n-docs-row", children: [
1137
- state.link && /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
1205
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-docs-row", children: [
1206
+ state.link && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
1138
1207
  editor.chain().focus().extendMarkRange("link").unsetLink().run();
1139
1208
  setPop(null);
1140
1209
  }, children: [
1141
- /* @__PURE__ */ jsx2(Link2Off, { "aria-hidden": true }),
1210
+ /* @__PURE__ */ jsx3(Link2Off, { "aria-hidden": true }),
1142
1211
  t.unlink
1143
1212
  ] }),
1144
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: putLink, children: [
1145
- /* @__PURE__ */ jsx2(Link, { "aria-hidden": true }),
1213
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: putLink, children: [
1214
+ /* @__PURE__ */ jsx3(Link, { "aria-hidden": true }),
1146
1215
  t.apply
1147
1216
  ] })
1148
1217
  ] })
1149
1218
  ] })
1150
1219
  ] }),
1151
1220
  can.comment && tool(MessageSquarePlus, t.addComment, begin, void 0, state.empty),
1152
- /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1153
- /* @__PURE__ */ jsx2("button", { type: "button", "data-pop": true, "aria-expanded": pop === "image", "aria-label": t.image, title: t.image, onClick: () => {
1221
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1222
+ /* @__PURE__ */ jsx3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "image", "aria-label": t.image, title: t.image, onClick: () => {
1154
1223
  setHref("");
1155
1224
  pick("image");
1156
- }, children: /* @__PURE__ */ jsx2(ImagePlus, { "aria-hidden": true }) }),
1157
- pop === "image" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-form", children: [
1158
- /* @__PURE__ */ jsx2(
1225
+ }, children: /* @__PURE__ */ jsx3(ImagePlus, { "aria-hidden": true }) }),
1226
+ pop === "image" && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-pop w100n-text-form", children: [
1227
+ /* @__PURE__ */ jsx3(
1159
1228
  "input",
1160
1229
  {
1161
1230
  autoFocus: true,
@@ -1171,10 +1240,10 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1171
1240
  }
1172
1241
  }
1173
1242
  ),
1174
- /* @__PURE__ */ jsxs2("span", { className: "w100n-docs-row", children: [
1175
- docx && /* @__PURE__ */ jsxs2("label", { className: "w100n-pdf-link", children: [
1243
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-docs-row", children: [
1244
+ docx && /* @__PURE__ */ jsxs3("label", { className: "w100n-pdf-link", children: [
1176
1245
  t.chooseFile,
1177
- /* @__PURE__ */ jsx2("input", { type: "file", accept: "image/png,image/jpeg,image/gif", hidden: true, onChange: (e) => {
1246
+ /* @__PURE__ */ jsx3("input", { type: "file", accept: "image/png,image/jpeg,image/gif", hidden: true, onChange: (e) => {
1178
1247
  const file2 = e.target.files?.[0];
1179
1248
  if (!file2) return;
1180
1249
  const reader = new FileReader();
@@ -1185,23 +1254,23 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1185
1254
  reader.readAsDataURL(file2);
1186
1255
  } })
1187
1256
  ] }),
1188
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: () => {
1257
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !href.trim(), onClick: () => {
1189
1258
  editor.chain().focus().setImage({ src: href.trim() }).run();
1190
1259
  setPop(null);
1191
1260
  }, children: [
1192
- /* @__PURE__ */ jsx2(ImagePlus, { "aria-hidden": true }),
1261
+ /* @__PURE__ */ jsx3(ImagePlus, { "aria-hidden": true }),
1193
1262
  t.put
1194
1263
  ] })
1195
1264
  ] })
1196
1265
  ] })
1197
1266
  ] }),
1198
- /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1199
- /* @__PURE__ */ jsx2("button", { type: "button", "data-pop": true, "aria-expanded": pop === "table", "aria-label": t.table, title: t.table, onClick: () => pick("table"), children: /* @__PURE__ */ jsx2(Table, { "aria-hidden": true }) }),
1200
- pop === "table" && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-pop w100n-text-grid", role: "group", "aria-label": t.table, onPointerLeave: () => setGrid({ rows: 0, cols: 0 }), children: [
1201
- /* @__PURE__ */ jsx2("span", { children: Array.from({ length: 48 }, (_, i) => {
1267
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1268
+ /* @__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 }) }),
1269
+ 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: [
1270
+ /* @__PURE__ */ jsx3("span", { children: Array.from({ length: 48 }, (_, i) => {
1202
1271
  const rows2 = Math.floor(i / 8) + 1;
1203
1272
  const cols = i % 8 + 1;
1204
- return /* @__PURE__ */ jsx2(
1273
+ return /* @__PURE__ */ jsx3(
1205
1274
  "button",
1206
1275
  {
1207
1276
  type: "button",
@@ -1216,31 +1285,31 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1216
1285
  i
1217
1286
  );
1218
1287
  }) }),
1219
- /* @__PURE__ */ jsx2("small", { children: grid.rows ? `${grid.rows} \xD7 ${grid.cols}` : t.table })
1288
+ /* @__PURE__ */ jsx3("small", { children: grid.rows ? `${grid.rows} \xD7 ${grid.cols}` : t.table })
1220
1289
  ] })
1221
1290
  ] }),
1222
1291
  gap,
1223
- /* @__PURE__ */ jsx2("button", { type: "button", "aria-expanded": more, "aria-label": more ? t.fewerTools : t.moreTools, title: more ? t.fewerTools : t.moreTools, onClick: widen, children: more ? /* @__PURE__ */ jsx2(ChevronDown, { "aria-hidden": true }) : /* @__PURE__ */ jsx2(ChevronUp, { "aria-hidden": true }) })
1224
- ] }) : /* @__PURE__ */ jsxs2(Fragment3, { children: [
1225
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("outline"), children: [
1226
- /* @__PURE__ */ jsx2(ListTree, { "aria-hidden": true }),
1292
+ /* @__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 }) })
1293
+ ] }) : /* @__PURE__ */ jsxs3(Fragment3, { children: [
1294
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("outline"), children: [
1295
+ /* @__PURE__ */ jsx3(ListTree, { "aria-hidden": true }),
1227
1296
  t.outline
1228
1297
  ] }),
1229
- can.comment && /* @__PURE__ */ jsxs2(Fragment3, { children: [
1230
- /* @__PURE__ */ jsx2("span", { className: "w100n-text-grow" }),
1231
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", disabled: state.empty, onClick: begin, children: [
1232
- /* @__PURE__ */ jsx2(MessageSquarePlus, { "aria-hidden": true }),
1298
+ can.comment && /* @__PURE__ */ jsxs3(Fragment3, { children: [
1299
+ /* @__PURE__ */ jsx3("span", { className: "w100n-text-grow" }),
1300
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: state.empty, onClick: begin, children: [
1301
+ /* @__PURE__ */ jsx3(MessageSquarePlus, { "aria-hidden": true }),
1233
1302
  t.addComment
1234
1303
  ] })
1235
1304
  ] }),
1236
- !!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("comments"), children: [
1237
- /* @__PURE__ */ jsx2(MessagesSquare, { "aria-hidden": true }),
1305
+ !!host?.comments && (can.comment || open.length > 0) && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-text-word", onClick: () => onPanel?.("comments"), children: [
1306
+ /* @__PURE__ */ jsx3(MessagesSquare, { "aria-hidden": true }),
1238
1307
  t.comments,
1239
- /* @__PURE__ */ jsx2("b", { children: open.length })
1308
+ /* @__PURE__ */ jsx3("b", { children: open.length })
1240
1309
  ] })
1241
1310
  ] });
1242
- const extra = can.edit && more && /* @__PURE__ */ jsxs2(Fragment3, { children: [
1243
- docx && /* @__PURE__ */ jsxs2(Fragment3, { children: [
1311
+ const extra = can.edit && more && /* @__PURE__ */ jsxs3(Fragment3, { children: [
1312
+ docx && /* @__PURE__ */ jsxs3(Fragment3, { children: [
1244
1313
  fontPicker,
1245
1314
  sizePicker,
1246
1315
  gap
@@ -1248,11 +1317,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1248
1317
  docx && tool(Strikethrough, t.strike, () => editor.chain().focus().toggleStrike().run(), state.strike),
1249
1318
  docx && tool(Superscript, t.superscript, () => editor.chain().focus().toggleMark("superscript").run(), state.sup),
1250
1319
  docx && tool(Subscript, t.subscript, () => editor.chain().focus().toggleMark("subscript").run(), state.sub),
1251
- docx && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1252
- /* @__PURE__ */ jsx2("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__ */ jsx2(Highlighter, { "aria-hidden": true }) }),
1320
+ docx && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1321
+ /* @__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
1322
  pop === "mark" && swatches(glows, null, (c) => c ? editor.chain().focus().setHighlight({ color: c }).run() : editor.chain().focus().unsetHighlight().run(), t.noColour)
1254
1323
  ] }),
1255
- docx && /* @__PURE__ */ jsxs2(Fragment3, { children: [
1324
+ docx && /* @__PURE__ */ jsxs3(Fragment3, { children: [
1256
1325
  gap,
1257
1326
  spacer
1258
1327
  ] }),
@@ -1260,24 +1329,24 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1260
1329
  tool(ListIndentIncrease, t.indent, () => indent(editor, 1)),
1261
1330
  docx && tool(ListChecks, t.tasks, () => editor.chain().focus().toggleTaskList().run(), state.tasks),
1262
1331
  gap,
1263
- /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": t.painter, title: paint ? t.painterHint : t.painter, "aria-pressed": !!paint, onClick: () => take(false), onDoubleClick: () => take(true), children: /* @__PURE__ */ jsx2(PaintRoller, { "aria-hidden": true }) }),
1332
+ /* @__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
1333
  tool(RemoveFormatting, t.clearFormat, () => clear(editor)),
1265
- docx && /* @__PURE__ */ jsxs2(Fragment3, { children: [
1334
+ docx && /* @__PURE__ */ jsxs3(Fragment3, { children: [
1266
1335
  gap,
1267
1336
  tool(FilePenLine, t.suggest, suggest, state.suggest)
1268
1337
  ] })
1269
1338
  ] });
1270
- const context = can.edit && (state.table ? /* @__PURE__ */ jsxs2(Fragment3, { children: [
1339
+ const context = can.edit && (state.table ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
1271
1340
  tool(BetweenHorizontalStart, t.rowAbove, () => editor.chain().focus().addRowBefore().run()),
1272
1341
  tool(BetweenHorizontalEnd, t.rowBelow, () => editor.chain().focus().addRowAfter().run()),
1273
1342
  tool(BetweenVerticalStart, t.columnLeft, () => editor.chain().focus().addColumnBefore().run()),
1274
1343
  tool(BetweenVerticalEnd, t.columnRight, () => editor.chain().focus().addColumnAfter().run()),
1275
1344
  tool(PanelTop, t.headerRow, () => editor.chain().focus().toggleHeaderRow().run()),
1276
1345
  docx && tool(TableCellsMerge, t.mergeCells, () => editor.chain().focus().mergeOrSplit().run()),
1277
- docx && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-anchor", children: [
1278
- /* @__PURE__ */ jsxs2("button", { type: "button", "data-pop": true, "aria-expanded": pop === "fill", "aria-label": t.cellFill, title: t.cellFill, onClick: () => pick("fill"), children: [
1279
- /* @__PURE__ */ jsx2(PaintBucket, { "aria-hidden": true }),
1280
- /* @__PURE__ */ jsx2("i", { className: "w100n-text-bar", style: { background: state.fill ?? "transparent" } })
1346
+ docx && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-anchor", children: [
1347
+ /* @__PURE__ */ jsxs3("button", { type: "button", "data-pop": true, "aria-expanded": pop === "fill", "aria-label": t.cellFill, title: t.cellFill, onClick: () => pick("fill"), children: [
1348
+ /* @__PURE__ */ jsx3(PaintBucket, { "aria-hidden": true }),
1349
+ /* @__PURE__ */ jsx3("i", { className: "w100n-text-bar", style: { background: state.fill ?? "transparent" } })
1281
1350
  ] }),
1282
1351
  pop === "fill" && swatches(glows, state.fill, (c) => editor.chain().focus().setCellAttribute("background", c).run(), t.noColour)
1283
1352
  ] }),
@@ -1285,33 +1354,33 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1285
1354
  tool(TableRowsSplit, t.deleteRow, () => editor.chain().focus().deleteRow().run()),
1286
1355
  tool(TableColumnsSplit, t.deleteColumn, () => editor.chain().focus().deleteColumn().run()),
1287
1356
  tool(Trash2, t.deleteTable, () => editor.chain().focus().deleteTable().run())
1288
- ] }) : state.img && /* @__PURE__ */ jsx2(Fragment3, { children: [[Image, t.wrapInline, "inline"], [PanelLeft, t.wrapLeft, "left"], [PanelRight, t.wrapRight, "right"]].map(([icon, label, value]) => /* @__PURE__ */ jsx2(Fragment2, { children: tool(icon, label, () => editor.chain().focus().updateAttributes("image", { wrap: value === "inline" ? null : value }).run(), state.img === value) }, value)) }));
1289
- const status = (can.edit || live) && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-end", children: [
1290
- live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-live", title: live.denied ? void 0 : t.offlineHint, children: [
1291
- /* @__PURE__ */ jsx2(WifiOff, { "aria-hidden": true }),
1357
+ ] }) : 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)) }));
1358
+ const status = (can.edit || live) && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-end", children: [
1359
+ live && (live.ready ? !live.online : live.late || live.denied) && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-live", title: live.denied ? void 0 : t.offlineHint, children: [
1360
+ /* @__PURE__ */ jsx3(WifiOff, { "aria-hidden": true }),
1292
1361
  live.denied ? t.liveOff : t.offline
1293
1362
  ] }),
1294
- state.suggest && /* @__PURE__ */ jsx2("span", { className: "w100n-docs-badge", children: t.suggesting }),
1295
- can.edit && saving === "failed" && /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-text-saved", title: `${t.save} (${mod}S)`, onClick: () => void save(), children: [
1296
- /* @__PURE__ */ jsx2(CloudAlert, { "aria-hidden": true }),
1297
- /* @__PURE__ */ jsx2("span", { children: t.saveFailed })
1363
+ state.suggest && /* @__PURE__ */ jsx3("span", { className: "w100n-docs-badge", children: t.suggesting }),
1364
+ can.edit && saving === "failed" && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-text-saved", title: `${t.save} (${mod}S)`, onClick: () => void save(), children: [
1365
+ /* @__PURE__ */ jsx3(CloudAlert, { "aria-hidden": true }),
1366
+ /* @__PURE__ */ jsx3("span", { children: t.saveFailed })
1298
1367
  ] }),
1299
- live && live.people.length > 0 && /* @__PURE__ */ jsx2("span", { className: "w100n-text-people", role: "group", "aria-label": t.people, children: live.people.map((p) => /* @__PURE__ */ jsx2("span", { className: "w100n-text-face", title: p.me ? `${p.name} (${t.you})` : p.name, style: { "--face": p.color }, children: p.avatarUrl ? /* @__PURE__ */ jsx2("img", { src: p.avatarUrl, alt: "" }) : p.name.split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase() }, p.id)) })
1368
+ 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
1369
  ] });
1301
- const menubar = /* @__PURE__ */ jsx2("span", { className: "w100n-text-menus", role: "menubar", "aria-label": t.textTools, children: menus.filter(([, , list]) => list.some((x) => x && x !== "-")).map(menu) });
1370
+ 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
1371
  const keep = (e) => {
1303
1372
  if (e.target.closest("button")) e.preventDefault();
1304
1373
  };
1305
1374
  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__ */ jsxs2("div", { ref: root, className: "w100n-text", "data-kind": kind, "data-docs-find": true, onKeyDown: keys, children: [
1307
- head ? /* @__PURE__ */ jsxs2(Fragment3, { children: [
1308
- head.menus && createPortal(/* @__PURE__ */ jsx2("div", { className: "w100n-text-ribbon w100n-text-docbar", onKeyDown: rove, onPointerDown: keep, children: menubar }), head.menus),
1309
- head.status && status && createPortal(/* @__PURE__ */ jsx2("div", { className: "w100n-text-ribbon w100n-text-docbar", onPointerDown: keep, children: status }), head.status)
1310
- ] }) : /* @__PURE__ */ jsxs2("div", { className: "w100n-text-ribbon w100n-text-top", onKeyDown: rove, onPointerDown: keep, children: [
1375
+ return /* @__PURE__ */ jsxs3("div", { ref: root, className: "w100n-text", "data-kind": kind, "data-docs-find": true, onKeyDown: keys, children: [
1376
+ head ? /* @__PURE__ */ jsxs3(Fragment3, { children: [
1377
+ head.menus && createPortal(/* @__PURE__ */ jsx3("div", { className: "w100n-text-ribbon w100n-text-docbar", onKeyDown: rove, onPointerDown: keep, children: menubar }), head.menus),
1378
+ head.status && status && createPortal(/* @__PURE__ */ jsx3("div", { className: "w100n-text-ribbon w100n-text-docbar", onPointerDown: keep, children: status }), head.status)
1379
+ ] }) : /* @__PURE__ */ jsxs3("div", { className: "w100n-text-ribbon w100n-text-top", onKeyDown: rove, onPointerDown: keep, children: [
1311
1380
  menubar,
1312
1381
  status
1313
1382
  ] }),
1314
- /* @__PURE__ */ jsx2("div", { ref: scroller, className: "w100n-text-scroll", "data-paint": !!paint, onMouseUp: lay, onPointerDown: (e) => {
1383
+ /* @__PURE__ */ jsx3("div", { ref: scroller, className: "w100n-text-scroll", "data-paint": !!paint, onMouseUp: lay, onPointerDown: (e) => {
1315
1384
  touch.current = e.pointerType === "touch";
1316
1385
  }, onContextMenu: (e) => {
1317
1386
  if (touch.current || e.shiftKey || pop === "context" || !e.target.closest(".ProseMirror")) return setPop(null);
@@ -1334,49 +1403,49 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1334
1403
  if (!id) return;
1335
1404
  setActive(id);
1336
1405
  onPanel?.("comments");
1337
- }, children: /* @__PURE__ */ jsx2("div", { className: "w100n-text-zoomed", style: { zoom: percent / 100 }, children: /* @__PURE__ */ jsx2("div", { className: docx ? `w100n-text-sheet${flow ? " is-flow" : ""}` : "w100n-docs-page w100n-text-column", style: sheet, children: /* @__PURE__ */ jsx2(EditorContent, { editor }) }) }) }),
1338
- pop === "context" && /* @__PURE__ */ jsxs2("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: [
1406
+ }, 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 }) }) }) }),
1407
+ 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
1408
  rows(near),
1340
- spell && /* @__PURE__ */ jsx2("small", { className: "w100n-text-hint", children: t.spellHint })
1409
+ spell && /* @__PURE__ */ jsx3("small", { className: "w100n-text-hint", children: t.spellHint })
1341
1410
  ] }),
1342
- /* @__PURE__ */ jsx2("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "left", onPointerDown: keep, children: /* @__PURE__ */ jsxs2("div", { className: "w100n-text-tools", role: "group", "aria-label": t.zoom, children: [
1411
+ /* @__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
1412
  tool(Minus, t.zoomOut, () => zoomBy(-10)),
1344
1413
  zoomer,
1345
1414
  tool(Plus, t.zoomIn, () => zoomBy(10))
1346
1415
  ] }) }),
1347
- /* @__PURE__ */ jsxs2("div", { className: "w100n-text-ribbon w100n-text-island", role: "toolbar", "aria-label": t.textTools, onKeyDown: rove, onPointerDown: keep, children: [
1348
- context && /* @__PURE__ */ jsx2("div", { className: "w100n-text-tools", role: "group", "aria-label": state.table ? t.table : t.image, children: context }),
1349
- extra && /* @__PURE__ */ jsx2("div", { className: "w100n-text-tools", role: "group", "aria-label": t.moreTools, children: extra }),
1350
- /* @__PURE__ */ jsx2("div", { className: "w100n-text-tools", role: "group", "aria-label": t.textTools, children: main })
1416
+ /* @__PURE__ */ jsxs3("div", { className: "w100n-text-ribbon w100n-text-island", role: "toolbar", "aria-label": t.textTools, onKeyDown: rove, onPointerDown: keep, children: [
1417
+ context && /* @__PURE__ */ jsx3("div", { className: "w100n-text-tools", role: "group", "aria-label": state.table ? t.table : t.image, children: context }),
1418
+ extra && /* @__PURE__ */ jsx3("div", { className: "w100n-text-tools", role: "group", "aria-label": t.moreTools, children: extra }),
1419
+ /* @__PURE__ */ jsx3("div", { className: "w100n-text-tools", role: "group", "aria-label": t.textTools, children: main })
1351
1420
  ] }),
1352
- /* @__PURE__ */ jsx2("div", { className: "w100n-text-ribbon w100n-text-corner", "data-side": "right", onPointerDown: keep, children: /* @__PURE__ */ jsxs2("div", { className: "w100n-text-tools", role: "group", "aria-label": t.findReplace, children: [
1353
- can.edit && /* @__PURE__ */ jsxs2(Fragment3, { children: [
1421
+ /* @__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: [
1422
+ can.edit && /* @__PURE__ */ jsxs3(Fragment3, { children: [
1354
1423
  tool(Undo2, t.undo, () => editor.chain().focus().undo().run(), void 0, !state.undo),
1355
1424
  tool(Redo2, t.redo, () => editor.chain().focus().redo().run(), void 0, !state.redo),
1356
1425
  gap
1357
1426
  ] }),
1358
1427
  finder
1359
1428
  ] }) }),
1360
- dialog && /* @__PURE__ */ jsx2("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
1429
+ dialog && /* @__PURE__ */ jsx3("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
1361
1430
  if (e.key === "Escape") {
1362
1431
  e.stopPropagation();
1363
1432
  setDialog(null);
1364
1433
  }
1365
- }, children: dialog.kind === "symbol" ? /* @__PURE__ */ jsxs2("div", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.symbols, children: [
1366
- /* @__PURE__ */ jsxs2("div", { className: "w100n-new-head", children: [
1367
- /* @__PURE__ */ jsx2("span", { className: "w100n-new-tile", "data-tone": "pink", children: /* @__PURE__ */ jsx2(Omega, { "aria-hidden": true }) }),
1368
- /* @__PURE__ */ jsx2("b", { className: "w100n-pdf-dialog-title", children: t.symbols }),
1369
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx2(X, { "aria-hidden": true }) })
1434
+ }, children: dialog.kind === "symbol" ? /* @__PURE__ */ jsxs3("div", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.symbols, children: [
1435
+ /* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
1436
+ /* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "pink", children: /* @__PURE__ */ jsx3(Omega, { "aria-hidden": true }) }),
1437
+ /* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.symbols }),
1438
+ /* @__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
1439
  ] }),
1371
- /* @__PURE__ */ jsxs2("label", { className: "w100n-docs-field w100n-docs-search", children: [
1372
- /* @__PURE__ */ jsx2(Search, { "aria-hidden": true }),
1373
- /* @__PURE__ */ jsx2("input", { autoFocus: true, value: dialog.query, placeholder: t.symbolSearch, "aria-label": t.symbolSearch, onChange: (e) => setDialog({ kind: "symbol", query: e.target.value }) })
1440
+ /* @__PURE__ */ jsxs3("label", { className: "w100n-docs-field w100n-docs-search", children: [
1441
+ /* @__PURE__ */ jsx3(Search, { "aria-hidden": true }),
1442
+ /* @__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
1443
  ] }),
1375
- /* @__PURE__ */ jsx2("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__ */ jsx2("button", { type: "button", "aria-label": name, title: name, onClick: () => {
1444
+ /* @__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
1445
  editor.chain().focus().insertContent(ch).run();
1377
1446
  setDialog(null);
1378
1447
  }, children: ch }, ch)) })
1379
- ] }) : dialog.kind === "formula" ? /* @__PURE__ */ jsxs2("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.formula, onSubmit: (e) => {
1448
+ ] }) : dialog.kind === "formula" ? /* @__PURE__ */ jsxs3("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.formula, onSubmit: (e) => {
1380
1449
  e.preventDefault();
1381
1450
  const latex = dialog.latex.trim();
1382
1451
  if (!latex) return;
@@ -1387,13 +1456,13 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1387
1456
  else editor.chain().focus().insertContent({ type: "math", attrs: { latex } }).run();
1388
1457
  setDialog(null);
1389
1458
  }, children: [
1390
- /* @__PURE__ */ jsxs2("div", { className: "w100n-new-head", children: [
1391
- /* @__PURE__ */ jsx2("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ jsx2(Sigma, { "aria-hidden": true }) }),
1392
- /* @__PURE__ */ jsx2("b", { className: "w100n-pdf-dialog-title", children: t.formula }),
1393
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx2(X, { "aria-hidden": true }) })
1459
+ /* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
1460
+ /* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ jsx3(Sigma, { "aria-hidden": true }) }),
1461
+ /* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.formula }),
1462
+ /* @__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
1463
  ] }),
1395
- /* @__PURE__ */ jsx2("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 }) }),
1396
- /* @__PURE__ */ jsx2("div", { className: "w100n-insert-tools", role: "group", "aria-label": t.formula, children: helpers.map(([label, code]) => /* @__PURE__ */ jsx2("button", { type: "button", onClick: () => {
1464
+ /* @__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 }) }),
1465
+ /* @__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
1466
  const el = field.current;
1398
1467
  const at = el.selectionStart ?? dialog.latex.length;
1399
1468
  const latex = dialog.latex.slice(0, at) + code + dialog.latex.slice(el.selectionEnd ?? at);
@@ -1404,15 +1473,15 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1404
1473
  el.setSelectionRange(caret, caret);
1405
1474
  });
1406
1475
  }, children: label }, label)) }),
1407
- /* @__PURE__ */ jsx2("div", { className: "w100n-insert-preview", "aria-live": "polite", dangerouslySetInnerHTML: { __html: dialog.latex.trim() ? mathml(dialog.latex) : "" } }),
1408
- /* @__PURE__ */ jsxs2("span", { className: "w100n-pdf-dialog-end", children: [
1409
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
1410
- /* @__PURE__ */ jsxs2("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.latex.trim(), children: [
1411
- /* @__PURE__ */ jsx2(Check, { "aria-hidden": true }),
1476
+ /* @__PURE__ */ jsx3("div", { className: "w100n-insert-preview", "aria-live": "polite", dangerouslySetInnerHTML: { __html: dialog.latex.trim() ? mathml(dialog.latex) : "" } }),
1477
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
1478
+ /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
1479
+ /* @__PURE__ */ jsxs3("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.latex.trim(), children: [
1480
+ /* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
1412
1481
  dialog.at !== null ? t.update : t.put
1413
1482
  ] })
1414
1483
  ] })
1415
- ] }) : /* @__PURE__ */ jsxs2("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.footnote, onSubmit: (e) => {
1484
+ ] }) : /* @__PURE__ */ jsxs3("form", { className: "w100n-pdf-dialog w100n-insert", role: "dialog", "aria-modal": true, "aria-label": t.footnote, onSubmit: (e) => {
1416
1485
  e.preventDefault();
1417
1486
  const text = dialog.text.trim();
1418
1487
  if (!text) return;
@@ -1429,12 +1498,12 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1429
1498
  }
1430
1499
  setDialog(null);
1431
1500
  }, children: [
1432
- /* @__PURE__ */ jsxs2("div", { className: "w100n-new-head", children: [
1433
- /* @__PURE__ */ jsx2("span", { className: "w100n-new-tile", "data-tone": "violet", children: /* @__PURE__ */ jsx2(Superscript, { "aria-hidden": true }) }),
1434
- /* @__PURE__ */ jsx2("b", { className: "w100n-pdf-dialog-title", children: t.footnote }),
1435
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-docs-close", onClick: () => setDialog(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx2(X, { "aria-hidden": true }) })
1501
+ /* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
1502
+ /* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "violet", children: /* @__PURE__ */ jsx3(Superscript, { "aria-hidden": true }) }),
1503
+ /* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.footnote }),
1504
+ /* @__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
1505
  ] }),
1437
- /* @__PURE__ */ jsx2(
1506
+ /* @__PURE__ */ jsx3(
1438
1507
  "textarea",
1439
1508
  {
1440
1509
  autoFocus: true,
@@ -1448,40 +1517,40 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1448
1517
  }
1449
1518
  }
1450
1519
  ),
1451
- /* @__PURE__ */ jsxs2("span", { className: "w100n-pdf-dialog-end", children: [
1452
- dialog.at !== null && /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
1520
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
1521
+ dialog.at !== null && /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => {
1453
1522
  editor.chain().focus().deleteRange({ from: dialog.at, to: dialog.at + 1 }).run();
1454
1523
  setDialog(null);
1455
1524
  }, children: t.removeFootnote }),
1456
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
1457
- /* @__PURE__ */ jsxs2("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.text.trim(), children: [
1458
- /* @__PURE__ */ jsx2(Check, { "aria-hidden": true }),
1525
+ /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDialog(null), children: t.cancel }),
1526
+ /* @__PURE__ */ jsxs3("button", { type: "submit", className: "w100n-docs-action", disabled: !dialog.text.trim(), children: [
1527
+ /* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
1459
1528
  dialog.at !== null ? t.update : t.put
1460
1529
  ] })
1461
1530
  ] })
1462
1531
  ] }) }),
1463
- draft2 && /* @__PURE__ */ jsx2("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
1532
+ draft2 && /* @__PURE__ */ jsx3("div", { className: "w100n-pdf-back", onKeyDown: (e) => {
1464
1533
  if (e.key === "Escape") {
1465
1534
  e.stopPropagation();
1466
1535
  setDraft2(null);
1467
1536
  }
1468
- }, children: /* @__PURE__ */ jsxs2("form", { className: "w100n-pdf-dialog w100n-setup", role: "dialog", "aria-modal": true, "aria-label": t.pageSetup, onSubmit: (e) => {
1537
+ }, children: /* @__PURE__ */ jsxs3("form", { className: "w100n-pdf-dialog w100n-setup", role: "dialog", "aria-modal": true, "aria-label": t.pageSetup, onSubmit: (e) => {
1469
1538
  e.preventDefault();
1470
1539
  applySetup();
1471
1540
  }, children: [
1472
- /* @__PURE__ */ jsxs2("div", { className: "w100n-new-head", children: [
1473
- /* @__PURE__ */ jsx2("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ jsx2(Ruler, { "aria-hidden": true }) }),
1474
- /* @__PURE__ */ jsx2("b", { className: "w100n-pdf-dialog-title", children: t.pageSetup }),
1475
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-docs-close", onClick: () => setDraft2(null), "aria-label": t.close, title: t.close, children: /* @__PURE__ */ jsx2(X, { "aria-hidden": true }) })
1541
+ /* @__PURE__ */ jsxs3("div", { className: "w100n-new-head", children: [
1542
+ /* @__PURE__ */ jsx3("span", { className: "w100n-new-tile", "data-tone": "blue", children: /* @__PURE__ */ jsx3(Ruler, { "aria-hidden": true }) }),
1543
+ /* @__PURE__ */ jsx3("b", { className: "w100n-pdf-dialog-title", children: t.pageSetup }),
1544
+ /* @__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
1545
  ] }),
1477
- /* @__PURE__ */ jsx2("p", { className: "w100n-docs-caption", children: t.pageSize }),
1478
- /* @__PURE__ */ jsx2("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.pageSize, children: [["A4", a4], ["Letter", letter], ["Legal", legal]].map(([label, size]) => {
1546
+ /* @__PURE__ */ jsx3("p", { className: "w100n-docs-caption", children: t.pageSize }),
1547
+ /* @__PURE__ */ jsx3("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.pageSize, children: [["A4", a4], ["Letter", letter], ["Legal", legal]].map(([label, size]) => {
1479
1548
  const land = draft2.width > draft2.height;
1480
1549
  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__ */ jsx2("button", { type: "button", "aria-pressed": on, onClick: () => setDraft2({ ...draft2, width: land ? size.height : size.width, height: land ? size.width : size.height }), children: label }, label);
1550
+ 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
1551
  }) }),
1483
- /* @__PURE__ */ jsx2("p", { className: "w100n-docs-caption", children: t.orientation }),
1484
- /* @__PURE__ */ jsx2("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.orientation, children: [[false, t.portrait], [true, t.landscape]].map(([land, label]) => /* @__PURE__ */ jsx2(
1552
+ /* @__PURE__ */ jsx3("p", { className: "w100n-docs-caption", children: t.orientation }),
1553
+ /* @__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
1554
  "button",
1486
1555
  {
1487
1556
  type: "button",
@@ -1493,11 +1562,11 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1493
1562
  },
1494
1563
  label
1495
1564
  )) }),
1496
- /* @__PURE__ */ jsx2("p", { className: "w100n-docs-caption", children: t.marginsCm }),
1497
- /* @__PURE__ */ jsx2("div", { className: "w100n-docs-chips", role: "group", "aria-label": t.margins, children: margins.map(([label, values]) => /* @__PURE__ */ jsx2("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)) }),
1498
- /* @__PURE__ */ jsx2("div", { className: "w100n-setup-grid", children: [t.mTop, t.mRight, t.mBottom, t.mLeft].map((label, n) => /* @__PURE__ */ jsxs2("label", { children: [
1499
- /* @__PURE__ */ jsx2("span", { children: label }),
1500
- /* @__PURE__ */ jsx2(
1565
+ /* @__PURE__ */ jsx3("p", { className: "w100n-docs-caption", children: t.marginsCm }),
1566
+ /* @__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)) }),
1567
+ /* @__PURE__ */ jsx3("div", { className: "w100n-setup-grid", children: [t.mTop, t.mRight, t.mBottom, t.mLeft].map((label, n) => /* @__PURE__ */ jsxs3("label", { children: [
1568
+ /* @__PURE__ */ jsx3("span", { children: label }),
1569
+ /* @__PURE__ */ jsx3(
1501
1570
  "input",
1502
1571
  {
1503
1572
  className: "w100n-docs-field",
@@ -1510,130 +1579,111 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1510
1579
  }
1511
1580
  )
1512
1581
  ] }, n)) }),
1513
- /* @__PURE__ */ jsxs2("label", { className: "w100n-setup-line", children: [
1514
- /* @__PURE__ */ jsx2("span", { children: t.headerText }),
1515
- /* @__PURE__ */ jsx2("input", { className: "w100n-docs-field", value: draft2.header, onChange: (e) => setDraft2({ ...draft2, header: e.target.value }) })
1582
+ /* @__PURE__ */ jsxs3("label", { className: "w100n-setup-line", children: [
1583
+ /* @__PURE__ */ jsx3("span", { children: t.headerText }),
1584
+ /* @__PURE__ */ jsx3("input", { className: "w100n-docs-field", value: draft2.header, onChange: (e) => setDraft2({ ...draft2, header: e.target.value }) })
1516
1585
  ] }),
1517
- /* @__PURE__ */ jsxs2("label", { className: "w100n-setup-line", children: [
1518
- /* @__PURE__ */ jsx2("span", { children: t.footerText }),
1519
- /* @__PURE__ */ jsx2("input", { className: "w100n-docs-field", value: draft2.footer, onChange: (e) => setDraft2({ ...draft2, footer: e.target.value }) })
1586
+ /* @__PURE__ */ jsxs3("label", { className: "w100n-setup-line", children: [
1587
+ /* @__PURE__ */ jsx3("span", { children: t.footerText }),
1588
+ /* @__PURE__ */ jsx3("input", { className: "w100n-docs-field", value: draft2.footer, onChange: (e) => setDraft2({ ...draft2, footer: e.target.value }) })
1520
1589
  ] }),
1521
- /* @__PURE__ */ jsxs2("label", { className: "w100n-setup-check", children: [
1522
- /* @__PURE__ */ jsx2("input", { type: "checkbox", checked: draft2.numbers, onChange: (e) => setDraft2({ ...draft2, numbers: e.target.checked }) }),
1590
+ /* @__PURE__ */ jsxs3("label", { className: "w100n-setup-check", children: [
1591
+ /* @__PURE__ */ jsx3("input", { type: "checkbox", checked: draft2.numbers, onChange: (e) => setDraft2({ ...draft2, numbers: e.target.checked }) }),
1523
1592
  t.pageNumbers
1524
1593
  ] }),
1525
- /* @__PURE__ */ jsxs2("div", { className: "w100n-pdf-dialog-end", children: [
1526
- /* @__PURE__ */ jsx2("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDraft2(null), children: t.cancel }),
1527
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", onClick: applySetup, children: [
1528
- /* @__PURE__ */ jsx2(Check, { "aria-hidden": true }),
1594
+ /* @__PURE__ */ jsxs3("div", { className: "w100n-pdf-dialog-end", children: [
1595
+ /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setDraft2(null), children: t.cancel }),
1596
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", onClick: applySetup, children: [
1597
+ /* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
1529
1598
  t.apply
1530
1599
  ] })
1531
1600
  ] })
1532
1601
  ] }) }),
1533
- slot && createPortal(/* @__PURE__ */ jsxs2("div", { className: "w100n-text-notes", children: [
1534
- draft && /* @__PURE__ */ jsxs2("div", { className: "w100n-text-card w100n-text-draft", children: [
1535
- /* @__PURE__ */ jsx2("blockquote", { children: draft.quote }),
1536
- /* @__PURE__ */ jsx2(
1537
- "textarea",
1538
- {
1539
- autoFocus: true,
1540
- value: draft.body,
1541
- placeholder: t.writeComment,
1542
- "aria-label": t.writeComment,
1543
- onChange: (e) => setDraft({ ...draft, body: e.target.value }),
1544
- onKeyDown: (e) => {
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 }),
1602
+ slot && createPortal(/* @__PURE__ */ jsxs3("div", { className: "w100n-text-notes", children: [
1603
+ draft && /* @__PURE__ */ jsxs3("div", { className: "w100n-text-card w100n-text-draft", children: [
1604
+ /* @__PURE__ */ jsx3("blockquote", { children: draft.quote }),
1605
+ /* @__PURE__ */ jsx3(Mentions, { autoFocus: true, value: draft.body, placeholder: t.writeComment, label: t.writeComment, people, onChange: (body) => setDraft({ ...draft, body }), onSend: () => void post() }),
1606
+ tagged(draft.body, people).length > 0 && /* @__PURE__ */ jsxs3("label", { className: "w100n-setup-check", children: [
1607
+ /* @__PURE__ */ jsx3("input", { type: "checkbox", checked: draft.give, onChange: (e) => setDraft({ ...draft, give: e.target.checked }) }),
1608
+ t.assignTo.replace("{name}", tagged(draft.body, people)[0].name)
1609
+ ] }),
1610
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
1611
+ /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: drop, children: t.cancel }),
1612
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !draft.body.trim() || posting === "busy", onClick: () => void post(), children: [
1613
+ /* @__PURE__ */ jsx3(MessageSquarePlus, { "aria-hidden": true }),
1553
1614
  t.post
1554
1615
  ] })
1555
1616
  ] })
1556
1617
  ] }),
1557
- suggested.length > 0 && /* @__PURE__ */ jsxs2(Fragment3, { children: [
1558
- /* @__PURE__ */ jsxs2("p", { className: "w100n-docs-caption", children: [
1559
- /* @__PURE__ */ jsx2(FilePenLine, { "aria-hidden": true }),
1618
+ suggested.length > 0 && /* @__PURE__ */ jsxs3(Fragment3, { children: [
1619
+ /* @__PURE__ */ jsxs3("p", { className: "w100n-docs-caption", children: [
1620
+ /* @__PURE__ */ jsx3(FilePenLine, { "aria-hidden": true }),
1560
1621
  t.suggestions,
1561
- /* @__PURE__ */ jsx2("span", { children: suggested.length })
1622
+ /* @__PURE__ */ jsx3("span", { children: suggested.length })
1562
1623
  ] }),
1563
- suggested.map((c, i) => /* @__PURE__ */ jsxs2("article", { className: "w100n-text-card w100n-text-change", "data-kind": c.kind, onClick: () => jump(c.from), children: [
1564
- /* @__PURE__ */ jsxs2("header", { children: [
1565
- /* @__PURE__ */ jsx2("span", { className: "w100n-text-face", "aria-hidden": true, children: (c.author || "?").slice(0, 1).toUpperCase() }),
1566
- /* @__PURE__ */ jsxs2("span", { className: "w100n-text-who", children: [
1567
- /* @__PURE__ */ jsx2("b", { children: c.author || t.someone }),
1568
- c.date && /* @__PURE__ */ jsx2("small", { children: when(c.date) })
1624
+ suggested.map((c, i) => /* @__PURE__ */ jsxs3("article", { className: "w100n-text-card w100n-text-change", "data-kind": c.kind, onClick: () => jump(c.from), children: [
1625
+ /* @__PURE__ */ jsxs3("header", { children: [
1626
+ /* @__PURE__ */ jsx3("span", { className: "w100n-text-face", "aria-hidden": true, children: (c.author || "?").slice(0, 1).toUpperCase() }),
1627
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-text-who", children: [
1628
+ /* @__PURE__ */ jsx3("b", { children: c.author || t.someone }),
1629
+ c.date && /* @__PURE__ */ jsx3("small", { children: when(c.date) })
1569
1630
  ] })
1570
1631
  ] }),
1571
- /* @__PURE__ */ jsxs2("p", { children: [
1632
+ /* @__PURE__ */ jsxs3("p", { children: [
1572
1633
  c.kind === "insertion" ? t.added : t.removed,
1573
1634
  " ",
1574
- /* @__PURE__ */ jsx2("q", { children: c.text })
1635
+ /* @__PURE__ */ jsx3("q", { children: c.text })
1575
1636
  ] }),
1576
- can.edit && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
1577
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => decide(editor, true, c.id), children: [
1578
- /* @__PURE__ */ jsx2(Check, { "aria-hidden": true }),
1637
+ can.edit && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
1638
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => decide(editor, true, c.id), children: [
1639
+ /* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
1579
1640
  t.accept
1580
1641
  ] }),
1581
- /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => decide(editor, false, c.id), children: [
1582
- /* @__PURE__ */ jsx2(X, { "aria-hidden": true }),
1642
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", "data-tone": "red", onClick: () => decide(editor, false, c.id), children: [
1643
+ /* @__PURE__ */ jsx3(X, { "aria-hidden": true }),
1583
1644
  t.reject
1584
1645
  ] })
1585
1646
  ] })
1586
1647
  ] }, i))
1587
1648
  ] }),
1588
- posting === "failed" && /* @__PURE__ */ jsx2("p", { className: "w100n-docs-muted", role: "alert", children: t.commentFailed }),
1589
- failed && /* @__PURE__ */ jsx2("p", { className: "w100n-docs-muted", role: "alert", children: t.changeFailed }),
1590
- /* @__PURE__ */ jsxs2("div", { className: "w100n-docs-row", children: [
1591
- /* @__PURE__ */ jsxs2("p", { className: "w100n-docs-caption", children: [
1592
- /* @__PURE__ */ jsx2(MessagesSquare, { "aria-hidden": true }),
1649
+ posting === "failed" && /* @__PURE__ */ jsx3("p", { className: "w100n-docs-muted", role: "alert", children: t.commentFailed }),
1650
+ failed && /* @__PURE__ */ jsx3("p", { className: "w100n-docs-muted", role: "alert", children: t.changeFailed }),
1651
+ /* @__PURE__ */ jsxs3("div", { className: "w100n-docs-row", children: [
1652
+ /* @__PURE__ */ jsxs3("p", { className: "w100n-docs-caption", children: [
1653
+ /* @__PURE__ */ jsx3(MessagesSquare, { "aria-hidden": true }),
1593
1654
  t.comments,
1594
- /* @__PURE__ */ jsx2("span", { children: open.length })
1655
+ /* @__PURE__ */ jsx3("span", { children: open.length })
1595
1656
  ] }),
1596
- /* @__PURE__ */ jsx2("span", { className: "w100n-docs-chips", children: /* @__PURE__ */ jsx2("button", { type: "button", "aria-pressed": resolved, onClick: () => setResolved(!resolved), children: t.showResolved }) })
1657
+ /* @__PURE__ */ jsx3("span", { className: "w100n-docs-chips", children: /* @__PURE__ */ jsx3("button", { type: "button", "aria-pressed": resolved, onClick: () => setResolved(!resolved), children: t.showResolved }) })
1597
1658
  ] }),
1598
- !threads.length && !draft && /* @__PURE__ */ jsx2("p", { className: "w100n-docs-muted", children: can.comment ? t.commentHint : t.noComments }),
1599
- threads.map((c) => /* @__PURE__ */ jsxs2("article", { className: "w100n-text-card", "aria-current": active === c.id, "data-resolved": c.resolved, onClick: () => show(c), children: [
1659
+ !threads.length && !draft && /* @__PURE__ */ jsx3("p", { className: "w100n-docs-muted", children: can.comment ? t.commentHint : t.noComments }),
1660
+ threads.map((c) => /* @__PURE__ */ jsxs3("article", { className: "w100n-text-card", "aria-current": active === c.id, "data-resolved": c.resolved, onClick: () => show(c), children: [
1600
1661
  person(c),
1601
- c.quote && /* @__PURE__ */ jsx2("blockquote", { children: c.quote }),
1662
+ 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) }),
1663
+ c.quote && /* @__PURE__ */ jsx3("blockquote", { children: c.quote }),
1602
1664
  words(c),
1603
- all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */ jsxs2("div", { className: "w100n-text-reply", children: [
1665
+ all.filter((r) => r.replyTo === c.id).map((r) => /* @__PURE__ */ jsxs3("div", { className: "w100n-text-reply", children: [
1604
1666
  person(r),
1605
1667
  words(r)
1606
1668
  ] }, r.id)),
1607
- reply?.id === c.id && /* @__PURE__ */ jsxs2("div", { className: "w100n-text-reply", onClick: (e) => e.stopPropagation(), children: [
1608
- /* @__PURE__ */ jsx2(
1609
- "textarea",
1610
- {
1611
- autoFocus: true,
1612
- value: reply.body,
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 }),
1669
+ reply?.id === c.id && /* @__PURE__ */ jsxs3("div", { className: "w100n-text-reply", onClick: (e) => e.stopPropagation(), children: [
1670
+ /* @__PURE__ */ jsx3(Mentions, { autoFocus: true, value: reply.body, placeholder: t.writeComment, label: t.reply, people, onChange: (body) => setReply({ ...reply, body }), onSend: () => void answer(c) }),
1671
+ /* @__PURE__ */ jsxs3("span", { className: "w100n-pdf-dialog-end", children: [
1672
+ /* @__PURE__ */ jsx3("button", { type: "button", className: "w100n-pdf-link", onClick: () => setReply(null), children: t.cancel }),
1673
+ /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", disabled: !reply.body.trim() || posting === "busy", onClick: () => void answer(c), children: [
1674
+ /* @__PURE__ */ jsx3(Reply, { "aria-hidden": true }),
1625
1675
  t.reply
1626
1676
  ] })
1627
1677
  ] })
1628
1678
  ] }),
1629
- can.comment && reply?.id !== c.id && /* @__PURE__ */ jsxs2("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
1630
- c.resolved && /* @__PURE__ */ jsx2("span", { className: "w100n-docs-badge", children: t.resolved }),
1631
- !c.resolved && /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", onClick: () => setReply({ id: c.id, body: "" }), children: [
1632
- /* @__PURE__ */ jsx2(Reply, { "aria-hidden": true }),
1679
+ can.comment && reply?.id !== c.id && /* @__PURE__ */ jsxs3("span", { className: "w100n-text-actions", onClick: (e) => e.stopPropagation(), children: [
1680
+ c.resolved && /* @__PURE__ */ jsx3("span", { className: "w100n-docs-badge", children: t.resolved }),
1681
+ !c.resolved && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", onClick: () => setReply({ id: c.id, body: "" }), children: [
1682
+ /* @__PURE__ */ jsx3(Reply, { "aria-hidden": true }),
1633
1683
  t.reply
1634
1684
  ] }),
1635
- host?.resolveComment && /* @__PURE__ */ jsxs2("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => void settle(c), children: [
1636
- c.resolved ? /* @__PURE__ */ jsx2(RotateCcw, { "aria-hidden": true }) : /* @__PURE__ */ jsx2(Check, { "aria-hidden": true }),
1685
+ host?.resolveComment && /* @__PURE__ */ jsxs3("button", { type: "button", className: "w100n-docs-action", "data-tone": "green", onClick: () => void settle(c), children: [
1686
+ c.resolved ? /* @__PURE__ */ jsx3(RotateCcw, { "aria-hidden": true }) : /* @__PURE__ */ jsx3(Check, { "aria-hidden": true }),
1637
1687
  c.resolved ? t.reopen : t.resolve
1638
1688
  ] })
1639
1689
  ] })
@@ -1644,4 +1694,4 @@ img { max-width: 100%; } img[data-wrap='left'] { float: left; margin: 0 12pt 6pt
1644
1694
  export {
1645
1695
  TextEditor as default
1646
1696
  };
1647
- //# sourceMappingURL=TextEditor-MGCSGGGA.js.map
1697
+ //# sourceMappingURL=TextEditor-7WQJFUUU.js.map