@w100n/documents 0.13.0 → 0.14.0

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 (52) hide show
  1. package/dist/{SheetView-3XTEV2VT.css → SheetView-43MPR64N.css} +5 -4
  2. package/dist/{SheetView-3XTEV2VT.css.map → SheetView-43MPR64N.css.map} +1 -1
  3. package/dist/{SheetView-3UAFXGZS.js → SheetView-4TPL7DES.js} +51 -10
  4. package/dist/SheetView-4TPL7DES.js.map +1 -0
  5. package/dist/{TextEditor-OLBLWC6F.js → TextEditor-VBHWUOZR.js} +636 -225
  6. package/dist/TextEditor-VBHWUOZR.js.map +1 -0
  7. package/dist/{chunk-L765DZPO.js → chunk-2CA3HQTI.js} +3 -3
  8. package/dist/{chunk-L765DZPO.js.map → chunk-2CA3HQTI.js.map} +1 -1
  9. package/dist/{chunk-MRP3EURG.js → chunk-5MH4WDW4.js} +133 -20
  10. package/dist/chunk-5MH4WDW4.js.map +1 -0
  11. package/dist/{chunk-WR3MT7KP.js → chunk-DR3TTJWZ.js} +374 -29
  12. package/dist/chunk-DR3TTJWZ.js.map +1 -0
  13. package/dist/{chunk-T7XCGDE5.js → chunk-RCQODE2Z.js} +2 -2
  14. package/dist/collab.cjs +487 -46
  15. package/dist/collab.cjs.map +1 -1
  16. package/dist/collab.d.cts +2 -2
  17. package/dist/collab.d.ts +2 -2
  18. package/dist/collab.js +2 -2
  19. package/dist/{grid-EI5JNZAA.js → grid-Q4XBPQFY.js} +3 -3
  20. package/dist/grid-Q4XBPQFY.js.map +1 -0
  21. package/dist/index.cjs +1449 -314
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.css +888 -171
  24. package/dist/index.css.map +1 -1
  25. package/dist/index.d.cts +9 -4
  26. package/dist/index.d.ts +9 -4
  27. package/dist/index.js +282 -32
  28. package/dist/index.js.map +1 -1
  29. package/dist/kinds.cjs +2 -2
  30. package/dist/kinds.cjs.map +1 -1
  31. package/dist/kinds.d.cts +2 -2
  32. package/dist/kinds.d.ts +2 -2
  33. package/dist/kinds.js +1 -1
  34. package/dist/memory.cjs +3 -0
  35. package/dist/memory.cjs.map +1 -1
  36. package/dist/memory.d.cts +1 -1
  37. package/dist/memory.d.ts +1 -1
  38. package/dist/memory.js +4 -1
  39. package/dist/memory.js.map +1 -1
  40. package/dist/{types-Er60M5kL.d.ts → types-BTsVooZw.d.cts} +2 -1
  41. package/dist/{types-Er60M5kL.d.cts → types-BTsVooZw.d.ts} +2 -1
  42. package/dist/write-BCI8yool.d.cts +16 -0
  43. package/dist/write-BCI8yool.d.ts +16 -0
  44. package/package.json +1 -1
  45. package/dist/SheetView-3UAFXGZS.js.map +0 -1
  46. package/dist/TextEditor-OLBLWC6F.js.map +0 -1
  47. package/dist/chunk-MRP3EURG.js.map +0 -1
  48. package/dist/chunk-WR3MT7KP.js.map +0 -1
  49. package/dist/grid-EI5JNZAA.js.map +0 -1
  50. package/dist/write-DaVtTJCS.d.cts +0 -6
  51. package/dist/write-DaVtTJCS.d.ts +0 -6
  52. /package/dist/{chunk-T7XCGDE5.js.map → chunk-RCQODE2Z.js.map} +0 -0
@@ -242,7 +242,7 @@ function zip(entries) {
242
242
  }
243
243
 
244
244
  // src/docx/pkg.ts
245
- var plain = { b: false, i: false, u: false, s: false, code: false, link: null, hl: null, color: null, size: null, font: null, rev: null };
245
+ var plain = { b: false, i: false, u: false, s: false, code: false, link: null, hl: null, color: null, size: null, font: null, rev: null, va: null };
246
246
  var highlights = {
247
247
  yellow: "ffff00",
248
248
  green: "00ff00",
@@ -294,6 +294,8 @@ function fmtOf(marks) {
294
294
  else if (m.type === "underline") f.u = true;
295
295
  else if (m.type === "strike") f.s = true;
296
296
  else if (m.type === "code") f.code = true;
297
+ else if (m.type === "superscript") f.va = "sup";
298
+ else if (m.type === "subscript") f.va = "sub";
297
299
  else if (m.type === "link" && typeof a.href === "string" && a.href) f.link = a.href;
298
300
  else if (m.type === "highlight") f.hl = color(a.color) ?? "#ffff00";
299
301
  else if (m.type === "textStyle") {
@@ -312,6 +314,7 @@ function marksOf(f) {
312
314
  if (f.u) out.push({ type: "underline" });
313
315
  if (f.s) out.push({ type: "strike" });
314
316
  if (f.code) out.push({ type: "code" });
317
+ if (f.va) out.push({ type: f.va === "sup" ? "superscript" : "subscript" });
315
318
  if (f.link) out.push({ type: "link", attrs: { href: f.link } });
316
319
  if (f.hl) out.push({ type: "highlight", attrs: { color: f.hl } });
317
320
  if (f.color || f.size || f.font) out.push({ type: "textStyle", attrs: { color: f.color, fontSize: f.size, fontFamily: f.font } });
@@ -322,7 +325,7 @@ function marksOf(f) {
322
325
  return out.length ? out : void 0;
323
326
  }
324
327
  function keyOf(f) {
325
- return `${+f.b}${+f.i}${+f.u}${+f.s}${+f.code}|${f.link ?? ""}|${f.hl ?? ""}|${f.color ?? ""}|${f.size ?? ""}|${f.font ?? ""}|${f.rev ?? ""}`;
328
+ return `${+f.b}${+f.i}${+f.u}${+f.s}${+f.code}|${f.link ?? ""}|${f.hl ?? ""}|${f.color ?? ""}|${f.size ?? ""}|${f.font ?? ""}|${f.rev ?? ""}|${f.va ?? ""}`;
326
329
  }
327
330
  var Styles = class {
328
331
  constructor(s, fonts) {
@@ -469,6 +472,11 @@ function props(s, rPr, fonts) {
469
472
  case "w:sz":
470
473
  out.size = size(+(attr(s, k, "w:val") ?? 0) / 2);
471
474
  break;
475
+ case "w:vertAlign": {
476
+ const v = attr(s, k, "w:val");
477
+ out.va = v === "superscript" ? "sup" : v === "subscript" ? "sub" : null;
478
+ break;
479
+ }
472
480
  case "w:highlight": {
473
481
  const v = attr(s, k, "w:val") ?? "none";
474
482
  out.hl = highlights[v] ? "#" + highlights[v] : null;
@@ -613,7 +621,7 @@ function resolve(dir, target) {
613
621
  }
614
622
 
615
623
  // src/docx/read.ts
616
- var blank = () => ({ align: null, indent: 0, ref: null });
624
+ var blank = () => ({ align: null, indent: 0, line: null, after: null, ref: null });
617
625
  var mimes = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif", bmp: "image/bmp", webp: "image/webp", svg: "image/svg+xml" };
618
626
  function align(v) {
619
627
  if (v === "center") return "center";
@@ -731,7 +739,14 @@ var Reader = class {
731
739
  const src = p.pic && this.src(p.pic.embed);
732
740
  if (!src) continue;
733
741
  const meta2 = Object.fromEntries(attrs(/<wp:docPr\b[^>]*>/.exec(p.raw)?.[0] ?? "<x>"));
734
- p.img = { src, alt: meta2.descr ?? null, title: meta2.title ?? null, width: Math.round(p.pic.cx / 9525), height: Math.round(p.pic.cy / 9525) };
742
+ p.img = {
743
+ src,
744
+ alt: meta2.descr ?? null,
745
+ title: meta2.title ?? null,
746
+ width: Math.round(p.pic.cx / 9525),
747
+ height: Math.round(p.pic.cy / 9525),
748
+ wrap: /<wp:anchor\b/.test(p.raw) ? /<wp:positionH\b[^>]*>\s*<wp:align>right</.test(p.raw) ? "right" : "left" : null
749
+ };
735
750
  }
736
751
  const pPr = kid(el, "w:pPr");
737
752
  const styles = this.pkg.styles;
@@ -759,7 +774,11 @@ var Reader = class {
759
774
  const ind = pPr && kid(pPr, "w:ind");
760
775
  const left = ind && (attr(s, ind, "w:left") ?? attr(s, ind, "w:start"));
761
776
  const indent = isList ? 0 : Math.max(0, Math.round((left !== null && left !== void 0 ? +left : styles.left(style)) / 720));
762
- const base = { align: align(jc ? attr(s, jc, "w:val") : styles.jc(style)), indent, ref };
777
+ const sp = pPr && kid(pPr, "w:spacing");
778
+ const lineAt = sp && attr(s, sp, "w:line");
779
+ const afterAt = sp && attr(s, sp, "w:after");
780
+ const auto = !sp || !attr(s, sp, "w:lineRule") || attr(s, sp, "w:lineRule") === "auto";
781
+ const base = { align: align(jc ? attr(s, jc, "w:val") : styles.jc(style)), indent, line: lineAt && auto ? Math.round(+lineAt / 2.4) / 100 : null, after: afterAt ? +afterAt / 20 : null, ref };
763
782
  const node = level ? { type: "heading", attrs: { level, ...base } } : { type: "paragraph", attrs: base };
764
783
  const content = inline(final);
765
784
  if (content.length) node.content = content;
@@ -967,10 +986,13 @@ var Reader = class {
967
986
  const ref = this.ref();
968
987
  const pr = kid(el, "w:tblPr");
969
988
  const jc = pr && kid(pr, "w:jc");
970
- const node = { type: "table", attrs: { align: align(jc ? attr(s, jc, "w:val") : null), indent: 0, ref }, content: [] };
989
+ const bd = pr && kid(pr, "w:tblBorders");
990
+ const bare = !!bd && bd.kids.length > 0 && bd.kids.every((k) => /^(none|nil)$/.test(attr(s, k, "w:val") ?? ""));
991
+ const node = { type: "table", attrs: { align: align(jc ? attr(s, jc, "w:val") : null), indent: 0, borders: bare ? "none" : null, ref }, content: [] };
971
992
  const b = this.block("tbl", el, node, ref);
972
993
  const grid2 = kid(el, "w:tblGrid");
973
994
  b.cols = grid2 ? grid2.kids.filter((k) => k.name === "w:gridCol").length : 0;
995
+ const widths = grid2 ? grid2.kids.filter((k) => k.name === "w:gridCol").map((k) => Math.floor(+(attr(s, k, "w:w") ?? 0) / 15)) : [];
974
996
  const open = [];
975
997
  let prev = grid2 ? grid2.end : pr ? pr.end : el.open;
976
998
  for (const tr of el.kids) {
@@ -1006,7 +1028,10 @@ var Reader = class {
1006
1028
  if (vm === "continue") open[col].attrs.rowspan++;
1007
1029
  else {
1008
1030
  const content = assemble(inside.list);
1009
- cell.node = { type: header ? "tableHeader" : "tableCell", attrs: { colspan: span, rowspan: 1, align: null, indent: 0, ref: cref }, content: content.length ? content : [{ type: "paragraph", attrs: blank() }] };
1031
+ const own = widths.slice(col, col + span);
1032
+ const shd = tcPr && kid(tcPr, "w:shd");
1033
+ const fill = shd ? attr(s, shd, "w:fill") : null;
1034
+ cell.node = { type: header ? "tableHeader" : "tableCell", attrs: { colspan: span, rowspan: 1, colwidth: own.length === span && own.every((w) => w > 0) ? own : null, background: fill && /^[0-9a-f]{6}$/i.test(fill) ? `#${fill.toLowerCase()}` : null, align: null, indent: 0, ref: cref }, content: content.length ? content : [{ type: "paragraph", attrs: blank() }] };
1010
1035
  row.node.content.push(cell.node);
1011
1036
  for (let c = col; c < col + span; c++) open[c] = null;
1012
1037
  if (vm === "restart") open[col] = cell.node;
@@ -1212,20 +1237,23 @@ var TC = ["w:cnfStyle", "w:tcW", "w:gridSpan", "w:hMerge", "w:vMerge", "w:tcBord
1212
1237
  var REL = "http://schemas.openxmlformats.org/officeDocument/2006/relationships";
1213
1238
  var special = { " ": "<w:tab/>", "\n": "<w:br/>", "\u2011": "<w:noBreakHyphen/>", "\xAD": "<w:softHyphen/>" };
1214
1239
  var keys = {
1215
- paragraph: [["align", null], ["indent", 0]],
1216
- heading: [["level", 1], ["align", null], ["indent", 0]],
1217
- table: [["align", null]],
1218
- tableCell: [["colspan", 1], ["rowspan", 1]],
1219
- tableHeader: [["colspan", 1], ["rowspan", 1]],
1240
+ paragraph: [["align", null], ["indent", 0], ["line", null], ["after", null]],
1241
+ heading: [["level", 1], ["align", null], ["indent", 0], ["line", null], ["after", null]],
1242
+ table: [["align", null], ["borders", null]],
1243
+ tableCell: [["colspan", 1], ["rowspan", 1], ["colwidth", null], ["background", null]],
1244
+ tableHeader: [["colspan", 1], ["rowspan", 1], ["colwidth", null], ["background", null]],
1220
1245
  orderedList: [["start", 1]],
1221
1246
  taskItem: [["checked", false]],
1222
1247
  codeBlock: [["language", null]],
1223
- toc: [["entries", "[]"], ["title", null]]
1248
+ toc: [["entries", "[]"], ["title", null]],
1249
+ image: [["src", null], ["alt", null], ["title", null], ["width", null], ["height", null], ["wrap", null]]
1224
1250
  };
1225
1251
  function value(key, v) {
1226
1252
  if (v === void 0 || v === "" || v === null) return null;
1227
1253
  if (key === "align") return v === "left" ? null : v;
1228
1254
  if (key === "width" || key === "height") return Math.round(Number(v)) || null;
1255
+ if (key === "line" || key === "after") return Number.isFinite(Number(v)) ? Number(v) : null;
1256
+ if (key === "colwidth") return Array.isArray(v) && v.length && v.every((w) => Number(w) > 0) ? v.map((w) => Math.round(Number(w))) : null;
1229
1257
  if (key === "indent" || key === "level" || key === "colspan" || key === "rowspan" || key === "start") return Number(v) || 0;
1230
1258
  if (key === "checked") return !!v;
1231
1259
  return v;
@@ -1259,7 +1287,7 @@ function inlineSig(kids) {
1259
1287
  return out;
1260
1288
  }
1261
1289
  function picture2(a) {
1262
- return JSON.stringify([a.src ?? null, a.alt || null, a.title || null, Math.round(Number(a.width)) || null, Math.round(Number(a.height)) || null]);
1290
+ return JSON.stringify([a.src ?? null, a.alt || null, a.title || null, Math.round(Number(a.width)) || null, Math.round(Number(a.height)) || null, a.wrap || null]);
1263
1291
  }
1264
1292
  var groups = 0;
1265
1293
  function flatten(content, out = [], quote = false) {
@@ -1393,7 +1421,7 @@ var Writer = class {
1393
1421
  this.docPr = max + 1;
1394
1422
  this.nextRev = Math.max(0, ...[...this.s.matchAll(/\bw:id="(\d+)"/g)].map((m) => +m[1])) + 1;
1395
1423
  }
1396
- run(doc) {
1424
+ run(doc, setup) {
1397
1425
  const s = this.s;
1398
1426
  this.body = this.r.body();
1399
1427
  const { list, tail, body } = this.body;
@@ -1403,8 +1431,8 @@ var Writer = class {
1403
1431
  this.carryOver(list, (x) => rest = x);
1404
1432
  let xml = this.container(flatten(doc.content ?? []), list, null);
1405
1433
  if (this.last === "tbl" && list[list.length - 1]?.kind !== "tbl") xml += "<w:p/>";
1406
- const text = s.slice(0, body.open) + xml + rest + s.slice(tail);
1407
1434
  const changed = /* @__PURE__ */ new Map();
1435
+ const text = this.marginal(s.slice(0, body.open) + xml + rest + s.slice(tail), setup, changed);
1408
1436
  if (text !== s) changed.set(this.pkg.main, text);
1409
1437
  if (this.rels.length) {
1410
1438
  const path = this.pkg.relsPath(this.pkg.main);
@@ -1530,6 +1558,79 @@ var Writer = class {
1530
1558
  if (o.kind === "toc") return b && sig(o.node) === sig(b.node) ? s.slice(b.start, b.end) : this.toc(o.node);
1531
1559
  return this.code(o);
1532
1560
  }
1561
+ marginal(text, setup, changed) {
1562
+ if (!setup || !setup.page && setup.header === void 0 && setup.footer === void 0 && setup.numbers === void 0) return text;
1563
+ const end = text.lastIndexOf("</w:body>");
1564
+ const opens = (i) => /^<w:sectPr[\s>/]/.test(text.slice(i, i + 11));
1565
+ let start = -1;
1566
+ let close = text.lastIndexOf("</w:sectPr>", end);
1567
+ if (close >= 0 && !text.slice(close + 11, end).trim()) {
1568
+ let depth = 1;
1569
+ let i = close;
1570
+ while (depth > 0 && i > 0) {
1571
+ let o = text.lastIndexOf("<w:sectPr", i - 1);
1572
+ while (o >= 0 && !opens(o)) o = text.lastIndexOf("<w:sectPr", o - 1);
1573
+ const c = text.lastIndexOf("</w:sectPr>", i - 1);
1574
+ if (c > o) {
1575
+ depth++;
1576
+ i = c;
1577
+ } else if (o < 0) break;
1578
+ else {
1579
+ if (text[text.indexOf(">", o) - 1] !== "/") depth--;
1580
+ i = o;
1581
+ }
1582
+ }
1583
+ start = i;
1584
+ close += 11;
1585
+ } else {
1586
+ start = close = end;
1587
+ }
1588
+ let sec = start === end ? "<w:sectPr></w:sectPr>" : text.slice(start, close);
1589
+ if (sec.endsWith("/>") && !sec.includes("</w:sectPr>")) sec = sec.slice(0, -2) + "></w:sectPr>";
1590
+ const after = ["w:pgMar", "w:paperSrc", "w:pgBorders", "w:lnNumType", "w:pgNumType", "w:cols", "w:formProt", "w:vAlign", "w:noEndnote", "w:titlePg", "w:textDirection", "w:bidi", "w:rtlGutter", "w:docGrid", "w:printerSettings", "w:sectPrChange"];
1591
+ const put = (name, xml, before) => {
1592
+ const re = new RegExp(`<${name}\\b[^>]*?(?:/>|>[\\s\\S]*?</${name}>)`);
1593
+ if (re.test(sec)) {
1594
+ sec = sec.replace(re, xml);
1595
+ return;
1596
+ }
1597
+ const at = before.map((b) => sec.search(new RegExp(`<${b}[\\s>/]`))).filter((i2) => i2 >= 0);
1598
+ const i = at.length ? Math.min(...at) : sec.lastIndexOf("</w:sectPr>");
1599
+ sec = sec.slice(0, i) + xml + sec.slice(i);
1600
+ };
1601
+ const tw = (px) => Math.round(px * 15);
1602
+ if (setup.page) {
1603
+ const { width, height, margins: [top, right, bottom, left] } = setup.page;
1604
+ put("w:pgSz", `<w:pgSz w:w="${tw(width)}" w:h="${tw(height)}"${width > height ? ' w:orient="landscape"' : ""}/>`, after);
1605
+ const was = /<w:pgMar\b[^>]*\/>/.exec(sec)?.[0] ?? "";
1606
+ const keep = attrs(was.replace(/^<w:pgMar|\/>$/g, "")).filter(([k]) => !["w:top", "w:right", "w:bottom", "w:left"].includes(k));
1607
+ if (!keep.some(([k]) => k === "w:header")) keep.push(["w:header", "708"], ["w:footer", "708"], ["w:gutter", "0"]);
1608
+ put("w:pgMar", `<w:pgMar w:top="${tw(top)}" w:right="${tw(right)}" w:bottom="${tw(bottom)}" w:left="${tw(left)}" ${keep.map(([k, v]) => `${k}="${escape(v)}"`).join(" ")}/>`, after.slice(1));
1609
+ }
1610
+ const part = (kind, body) => {
1611
+ sec = sec.replace(new RegExp(`<w:${kind}Reference\\b[^>]*\\bw:type="default"[^>]*/>`), "");
1612
+ if (!body) return;
1613
+ let n = 1;
1614
+ while (this.pkg.files.has(`word/${kind}${n}.xml`) || changed.has(`word/${kind}${n}.xml`)) n++;
1615
+ const id = this.relId();
1616
+ const tag = kind === "header" ? "w:hdr" : "w:ftr";
1617
+ changed.set(`word/${kind}${n}.xml`, `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
1618
+ <${tag} xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="${REL}">${body}</${tag}>`);
1619
+ this.rels.push(`<Relationship Id="${id}" Type="${REL}/${kind}" Target="${kind}${n}.xml"/>`);
1620
+ this.types.add(`<Override PartName="/word/${kind}${n}.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.${kind}+xml"/>`);
1621
+ const open = sec.indexOf(">") + 1;
1622
+ sec = sec.slice(0, open) + `<w:${kind}Reference w:type="default" r:id="${id}"/>` + sec.slice(open);
1623
+ };
1624
+ const line = (words, page) => {
1625
+ const field = '<w:r><w:fldChar w:fldCharType="begin"/></w:r><w:r><w:instrText xml:space="preserve"> PAGE </w:instrText></w:r><w:r><w:fldChar w:fldCharType="separate"/></w:r><w:r><w:t>1</w:t></w:r><w:r><w:fldChar w:fldCharType="end"/></w:r>';
1626
+ const run = words ? `<w:r><w:t xml:space="preserve">${escape(words)}</w:t></w:r>` : "";
1627
+ if (!words && !page) return "";
1628
+ return `<w:p><w:pPr>${page && words ? `<w:tabs><w:tab w:val="right" w:pos="${this.textWidth()}"/></w:tabs>` : page ? '<w:jc w:val="right"/>' : ""}</w:pPr>${run}${page && words ? "<w:r><w:tab/></w:r>" : ""}${page ? field : ""}</w:p>`;
1629
+ };
1630
+ if (setup.header !== void 0) part("header", line(setup.header, false));
1631
+ if (setup.footer !== void 0 || setup.numbers !== void 0) part("footer", line(setup.footer ?? "", !!setup.numbers));
1632
+ return text.slice(0, start) + sec + text.slice(close);
1633
+ }
1533
1634
  toc(node) {
1534
1635
  this.tocs = true;
1535
1636
  const styles = this.pkg.styles;
@@ -1647,6 +1748,20 @@ var Writer = class {
1647
1748
  if (align(direct ?? styles.jc(style)) !== want) {
1648
1749
  set["w:jc"] = align(styles.jc(style)) === want ? null : `<w:jc w:val="${{ center: "center", right: "right", justify: "both" }[want ?? ""] ?? "left"}"/>`;
1649
1750
  }
1751
+ const spEl = get("w:spacing");
1752
+ const spacing = spEl ? attrs(xml.slice(spEl.start, spEl.open)) : [];
1753
+ const had = (name) => spacing.find(([k]) => k === name)?.[1] ?? null;
1754
+ const line = value("line", o.node.attrs?.line);
1755
+ const after = value("after", o.node.attrs?.after);
1756
+ const auto = !had("w:lineRule") || had("w:lineRule") === "auto";
1757
+ const drift = (had("w:line") && auto ? Math.round(+had("w:line") / 2.4) / 100 : null) !== line || (had("w:after") ? +had("w:after") / 20 : null) !== after;
1758
+ if ((b || line !== null || after !== null) && drift) {
1759
+ const kept = spacing.filter(([k]) => k !== "w:line" && k !== "w:lineRule" && k !== "w:after" && !(k === "w:afterAutospacing" && after !== null));
1760
+ if (line !== null) kept.push(["w:line", String(Math.round(line * 240))], ["w:lineRule", "auto"]);
1761
+ else if (had("w:line") && !auto) kept.push(["w:line", had("w:line")], ["w:lineRule", had("w:lineRule")]);
1762
+ if (after !== null) kept.push(["w:after", String(Math.round(after * 20))]);
1763
+ set["w:spacing"] = kept.length ? `<w:spacing ${kept.map(([k, v]) => `${k}="${escape(v)}"`).join(" ")}/>` : null;
1764
+ }
1650
1765
  if (!pr) {
1651
1766
  const indEl = "w:ind" in set ? void 0 : get("w:ind");
1652
1767
  const list = indEl ? attrs(xml.slice(indEl.start, indEl.open)).filter(([k]) => k !== "w:left" && k !== "w:start") : [];
@@ -1901,6 +2016,7 @@ var Writer = class {
1901
2016
  set["w:strike"] = to.s ? "<w:strike/>" : sf.s ? '<w:strike w:val="0"/>' : null;
1902
2017
  if (!to.s) set["w:dstrike"] = null;
1903
2018
  }
2019
+ if (to.va !== from.va) set["w:vertAlign"] = to.va ? `<w:vertAlign w:val="${to.va === "sup" ? "superscript" : "subscript"}"/>` : sf.va ? '<w:vertAlign w:val="baseline"/>' : null;
1904
2020
  if (to.color !== from.color) set["w:color"] = to.color ? `<w:color w:val="${to.color.slice(1).toUpperCase()}"/>` : sf.color ? '<w:color w:val="auto"/>' : null;
1905
2021
  if (to.size !== from.size) {
1906
2022
  const hp = to.size ? Math.round(parseFloat(to.size) * 2) : 0;
@@ -1959,6 +2075,17 @@ var Writer = class {
1959
2075
  this.srcs.set(src, added.id);
1960
2076
  return added;
1961
2077
  }
2078
+ wrapped(raw, side) {
2079
+ const anchor = /<wp:anchor\b/.test(raw);
2080
+ if (!side && !anchor) return raw;
2081
+ const ns = (tag) => attrs(/<wp:(?:inline|anchor)\b([^>]*)>/.exec(tag)?.[1] ?? "").filter(([k]) => k.startsWith("xmlns")).map(([k, v]) => ` ${k}="${v}"`).join("");
2082
+ const part = (name) => new RegExp(`<${name}\\b[^>]*?(?:/>|>[\\s\\S]*?</${name}>)`).exec(raw)?.[0] ?? "";
2083
+ const body = part("wp:extent") + part("wp:effectExtent");
2084
+ const rest = part("wp:docPr") + part("wp:cNvGraphicFramePr") + part("a:graphic");
2085
+ if (!side) return raw.replace(/<wp:anchor\b[\s\S]*<\/wp:anchor>/, `<wp:inline distT="0" distB="0" distL="0" distR="0"${ns(raw)}>${body}${rest}</wp:inline>`);
2086
+ const head = `<wp:anchor distT="0" distB="0" distL="114300" distR="114300" simplePos="0" relativeHeight="251658240" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1"${ns(raw)}><wp:simplePos x="0" y="0"/><wp:positionH relativeFrom="column"><wp:align>${side === "right" ? "right" : "left"}</wp:align></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>`;
2087
+ return raw.replace(anchor ? /<wp:anchor\b[\s\S]*<\/wp:anchor>/ : /<wp:inline\b[\s\S]*<\/wp:inline>/, `${head}${body}<wp:wrapSquare wrapText="bothSides"/>${rest}</wp:anchor>`);
2088
+ }
1962
2089
  drawing(img) {
1963
2090
  const media = this.embed(String(img.src ?? ""));
1964
2091
  const max = Math.round(this.textWidth() / 15);
@@ -1970,7 +2097,8 @@ var Writer = class {
1970
2097
  else if (!w) w = Math.round(h * nw / nh);
1971
2098
  const id = this.docPr++;
1972
2099
  const ext = `cx="${Math.round(w * 9525)}" cy="${Math.round(h * 9525)}"`;
1973
- return `<w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"><wp:extent ${ext}/><wp:effectExtent l="0" t="0" r="0" b="0"/>${meta(`<wp:docPr id="${id}" name="Picture ${id}"/>`, img)}<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="${id}" name="Picture ${id}"/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${media.id}"/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext ${ext}/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing>`;
2100
+ const xml = `<w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"><wp:extent ${ext}/><wp:effectExtent l="0" t="0" r="0" b="0"/>${meta(`<wp:docPr id="${id}" name="Picture ${id}"/>`, img)}<wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1"/></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="${id}" name="Picture ${id}"/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${media.id}"/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext ${ext}/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing>`;
2101
+ return img.wrap ? this.wrapped(xml, img.wrap) : xml;
1974
2102
  }
1975
2103
  patch(raw, old, img) {
1976
2104
  let xml = raw;
@@ -1982,6 +2110,7 @@ var Writer = class {
1982
2110
  }
1983
2111
  if ((img.alt || null) !== (old.alt || null) || (img.title || null) !== (old.title || null)) xml = xml.replace(/<wp:docPr\b[^>]*>/, (tag) => meta(tag, img));
1984
2112
  if (img.src !== old.src) xml = xml.replace(/(<a:blip\b[^>]*\br:embed=")[^"]*"/, `$1${this.embed(String(img.src ?? "")).id}"`);
2113
+ if ((img.wrap || null) !== (old.wrap || null)) xml = this.wrapped(xml, img.wrap);
1985
2114
  return xml;
1986
2115
  }
1987
2116
  textWidth() {
@@ -2047,6 +2176,27 @@ var Writer = class {
2047
2176
  head = `<w:tbl>${tblPr}<w:tblGrid>${`<w:gridCol w:w="${Math.floor(this.textWidth() / cols)}"/>`.repeat(cols)}</w:tblGrid>`;
2048
2177
  }
2049
2178
  const width = Math.floor(this.textWidth() / cols);
2179
+ const sized = [];
2180
+ for (const r of layout) for (const sl of r) {
2181
+ const own2 = sl.cell && value("colwidth", sl.cell.attrs?.colwidth);
2182
+ if (own2 && own2.length === sl.span) own2.forEach((w, k) => {
2183
+ var _a;
2184
+ return sized[_a = sl.col + k] ?? (sized[_a] = w);
2185
+ });
2186
+ }
2187
+ const known = sized.length === cols && sized.every(Boolean);
2188
+ const had = [...head.matchAll(/<w:gridCol\b[^>]*\bw:w="(\d+)"/g)].map((m) => Math.floor(+m[1] / 15));
2189
+ if (known && had.join() !== sized.join()) {
2190
+ const list = sized.map((w) => `<w:gridCol w:w="${Math.round(w * 15)}"/>`).join("");
2191
+ head = head.replace(/(<w:tblGrid\b[^>]*>)[\s\S]*?(<\/w:tblGrid>)/, `$1${list}$2`);
2192
+ }
2193
+ const own = (col, span) => known ? sized.slice(col, col + span) : null;
2194
+ const borders = value("borders", o.node.attrs?.borders);
2195
+ if (borders !== value("borders", b?.node.attrs?.borders)) {
2196
+ const line = (side) => `<w:${side} w:val="${borders === "none" ? "none" : "single"}" w:sz="4" w:space="0" w:color="${borders === "none" ? "auto" : "94A3B8"}"/>`;
2197
+ const all = `<w:tblBorders>${["top", "left", "bottom", "right", "insideH", "insideV"].map(line).join("")}</w:tblBorders>`;
2198
+ head = /<w:tblBorders\b/.test(head) ? head.replace(/<w:tblBorders\b[\s\S]*?<\/w:tblBorders>|<w:tblBorders\/>/, all) : head.replace(/(<w:tblPr\b[^>]*>(?:(?!<\/w:tblPr>)[\s\S])*?)(<w:shd\b|<w:tblLayout\b|<w:tblCellMar\b|<w:tblLook\b|<w:tblCaption\b|<w:tblDescription\b|<w:tblPrChange\b|<\/w:tblPr>)/, `$1${all}$2`);
2199
+ }
2050
2200
  let xml = head;
2051
2201
  let above = [];
2052
2202
  let aboveRow = null;
@@ -2077,7 +2227,7 @@ var Writer = class {
2077
2227
  if (!sl.cell) {
2078
2228
  const cont = R2?.cells.find((c) => c.vm === "continue" && c.col === sl.col);
2079
2229
  if (cont) xml += cont.lead + s.slice(cont.el.start, cont.el.end);
2080
- else xml += `<w:tc>${this.tcPr(cover.get(sl.from) ?? above[sl.col] ?? null, sl.span, "continue", width)}<w:p/></w:tc>`;
2230
+ else xml += `<w:tc>${this.tcPr(cover.get(sl.from) ?? above[sl.col] ?? null, sl.span, "continue", width, true, own(sl.col, sl.span))}<w:p/></w:tc>`;
2081
2231
  now[sl.col] = cover.get(sl.from) ?? null;
2082
2232
  continue;
2083
2233
  }
@@ -2093,7 +2243,7 @@ var Writer = class {
2093
2243
  const fallback = srcCell?.blocks.find((x) => x.kind === "p") ?? null;
2094
2244
  let inside = this.container(flatten(sl.cell.content ?? []), C ? C.blocks : [], fallback) + (C ? this.left.get(C) ?? "" : "");
2095
2245
  if (!this.last || this.last === "tbl") inside += "<w:p/>";
2096
- xml += (C ? C.lead + opened(s, C.el) : "<w:tc>") + this.tcPr(srcCell, sl.span, vm, width, !C) + inside + (C ? C.tail : "") + "</w:tc>";
2246
+ xml += (C ? C.lead + opened(s, C.el) : "<w:tc>") + this.tcPr(srcCell, sl.span, vm, width, !C, own(sl.col, sl.span), value("background", sl.cell.attrs?.background)) + inside + (C ? C.tail : "") + "</w:tc>";
2097
2247
  }
2098
2248
  const lastCell = R2?.cells[R2.cells.length - 1];
2099
2249
  xml += (R2 && lastCell ? s.slice(lastCell.el.end, R2.el.close) : "") + "</w:tr>";
@@ -2102,15 +2252,21 @@ var Writer = class {
2102
2252
  });
2103
2253
  return xml + tail + "</w:tbl>";
2104
2254
  }
2105
- tcPr(src, span, vm, width, clone = true) {
2255
+ tcPr(src, span, vm, width, clone = true, own = null, fill) {
2106
2256
  const s = this.s;
2107
2257
  const el = src && kid(src.el, "w:tcPr");
2108
2258
  const xml = el ? s.slice(el.start, el.end) : "";
2109
- if (!clone && src && src.span === span && src.vm === vm) return xml;
2259
+ const tcW = el && kid(el, "w:tcW");
2260
+ const sized = own ? Math.round(own.reduce((a, w) => a + w, 0) * 15) : null;
2261
+ const resized = sized !== null && !(tcW && attr(s, tcW, "w:type") === "dxa" && Math.abs(+(attr(s, tcW, "w:w") ?? 0) - sized) < 15);
2262
+ const was = src?.node ? value("background", src.node.attrs?.background) : null;
2263
+ const painted = fill !== void 0 && fill !== was;
2264
+ if (!clone && src && src.span === span && src.vm === vm && !resized && !painted) return xml;
2110
2265
  const set = { "w:gridSpan": span > 1 ? `<w:gridSpan w:val="${span}"/>` : null, "w:vMerge": vm === "restart" ? '<w:vMerge w:val="restart"/>' : vm ? "<w:vMerge/>" : null, "w:hMerge": null };
2111
2266
  if (clone) Object.assign(set, { "w:cellIns": null, "w:cellDel": null, "w:cellMerge": null, "w:tcPrChange": null });
2112
- const tcW = el && kid(el, "w:tcW");
2113
- if (!tcW && !src) set["w:tcW"] = `<w:tcW w:w="${width * span}" w:type="dxa"/>`;
2267
+ if (painted) set["w:shd"] = fill ? `<w:shd w:val="clear" w:color="auto" w:fill="${fill.slice(1).toUpperCase()}"/>` : null;
2268
+ if (resized) set["w:tcW"] = `<w:tcW w:w="${sized}" w:type="dxa"/>`;
2269
+ else if (!tcW && !src) set["w:tcW"] = `<w:tcW w:w="${width * span}" w:type="dxa"/>`;
2114
2270
  else if (tcW && src && src.span !== span && attr(xml, tcW, "w:type") === "dxa") set["w:tcW"] = `<w:tcW w:w="${Math.round(+(attr(xml, tcW, "w:w") ?? 0) * span / src.span)}" w:type="dxa"/>`;
2115
2271
  return rebuild(xml, "w:tcPr", TC, set);
2116
2272
  }
@@ -2142,15 +2298,24 @@ async function readDocx(bytes) {
2142
2298
  const size2 = sect && kid(sect, "w:pgSz");
2143
2299
  const mar = sect && kid(sect, "w:pgMar");
2144
2300
  const px = (el, name, fallback) => Math.round(Math.abs(+((el && attr(s, el, name)) ?? fallback)) / 15 * 100) / 100;
2301
+ const words = (kind) => {
2302
+ const ref = sect?.kids.find((k) => k.name === `w:${kind}Reference` && attr(s, k, "w:type") === "default");
2303
+ const part = ref && pkg.rels.get(attr(s, ref, "r:id") ?? "");
2304
+ const xml = part ? pkg.text(part.target) ?? "" : "";
2305
+ return { text: [...xml.matchAll(/<w:t(?:\s[^>]*)?>([^<]*)<\/w:t>/g)].map((m) => m[1]).join("").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").trim(), page: /\bPAGE\b/.test(xml) };
2306
+ };
2307
+ const head = words("header");
2308
+ const foot = words("footer");
2145
2309
  return {
2310
+ marginal: { header: head.text, footer: foot.page ? foot.text.replace(/\s*\d+$/, "") : foot.text, numbers: foot.page },
2146
2311
  doc: { type: "doc", content: content.length ? content : [{ type: "paragraph", attrs: { align: null, indent: 0, ref: null } }] },
2147
2312
  styles: pkg.styles.list(),
2148
2313
  page: { width: px(size2, "w:w", 12240), height: px(size2, "w:h", 15840), margins: [px(mar, "w:top", 1440), px(mar, "w:right", 1440), px(mar, "w:bottom", 1440), px(mar, "w:left", 1440)] }
2149
2314
  };
2150
2315
  }
2151
- async function writeDocx(original, doc, load = fetched) {
2316
+ async function writeDocx(original, doc, load = fetched, setup) {
2152
2317
  const pkg = new Pkg(new Uint8Array(original));
2153
- const out = new Writer(pkg, await images(doc, load)).run(doc);
2318
+ const out = new Writer(pkg, await images(doc, load)).run(doc, setup);
2154
2319
  return out ? out.slice().buffer : original.slice(0);
2155
2320
  }
2156
2321
 
@@ -2170,6 +2335,10 @@ var en = {
2170
2335
  versions: "Versions",
2171
2336
  details: "Details",
2172
2337
  noOutline: "This document has no headings",
2338
+ findHeading: "Find a heading",
2339
+ read: "read",
2340
+ showSections: "Show sections",
2341
+ hideSections: "Hide sections",
2173
2342
  current: "Current",
2174
2343
  size: "Size",
2175
2344
  updated: "Updated",
@@ -2217,6 +2386,12 @@ var en = {
2217
2386
  save: "Save",
2218
2387
  saving: "Saving",
2219
2388
  saved: "Saved",
2389
+ align: "Align",
2390
+ moreTools: "More tools",
2391
+ fewerTools: "Fewer tools",
2392
+ typeFilter: "Type",
2393
+ selectAll: "Select all",
2394
+ clearPick: "Clear",
2220
2395
  saveFailed: "Could not save",
2221
2396
  remove: "Remove",
2222
2397
  notePlaceholder: "Write a note",
@@ -2326,6 +2501,11 @@ var en = {
2326
2501
  someone: "Someone",
2327
2502
  copyAs: "Make an XLSX copy",
2328
2503
  copyFailed: "Could not make the copy",
2504
+ downloadAs: "Download as",
2505
+ makeCopy: "Make a copy",
2506
+ copyOf: "Copy of",
2507
+ rename: "Rename",
2508
+ renameFailed: "Could not rename",
2329
2509
  editComment: "Edit",
2330
2510
  delete: "Delete",
2331
2511
  deleteAsk: "Delete this comment?",
@@ -2411,7 +2591,52 @@ var en = {
2411
2591
  untitled: "Untitled",
2412
2592
  kindHints: { docx: "Word, DOCX", markdown: "MD, same editor", sheet: "Excel, XLSX", slides: "HTML slides" },
2413
2593
  newKinds: { docx: "Document", markdown: "Markdown", sheet: "Spreadsheet", slides: "Presentation" },
2414
- templates: { blank: "Blank", letter: "Letter", contract: "Contract", notes: "Meeting notes", invoice: "Invoice", report: "Report" }
2594
+ templates: { blank: "Blank", letter: "Letter", contract: "Contract", notes: "Meeting notes", invoice: "Invoice", report: "Report" },
2595
+ menuFile: "File",
2596
+ menuEdit: "Edit",
2597
+ menuFormat: "Format",
2598
+ menuTools: "Tools",
2599
+ zoom: "Zoom",
2600
+ font: "Font",
2601
+ fontSize: "Font size",
2602
+ defaultFont: "Default",
2603
+ lineSpacing: "Line and paragraph spacing",
2604
+ single: "Single",
2605
+ double: "Double",
2606
+ spaceAfter: "Add space after paragraph",
2607
+ noSpaceAfter: "Remove space after paragraph",
2608
+ superscript: "Superscript",
2609
+ subscript: "Subscript",
2610
+ painter: "Paint format",
2611
+ painterHint: "Select text to paint, double click keeps it on, Esc stops",
2612
+ pageSetup: "Page setup",
2613
+ orientation: "Orientation",
2614
+ portrait: "Portrait",
2615
+ landscape: "Landscape",
2616
+ marginsCm: "Margins, cm",
2617
+ mTop: "Top",
2618
+ mRight: "Right",
2619
+ mBottom: "Bottom",
2620
+ mLeft: "Left",
2621
+ headerText: "Header",
2622
+ footerText: "Footer",
2623
+ pageNumbers: "Page numbers in the footer",
2624
+ wrapInline: "In line with text",
2625
+ wrapLeft: "Text wraps on the right",
2626
+ wrapRight: "Text wraps on the left",
2627
+ cellFill: "Cell fill",
2628
+ tableBorders: "Table borders",
2629
+ findReplace: "Find and replace",
2630
+ replaceWith: "Replace with",
2631
+ replaceOne: "Replace",
2632
+ replaceAll: "Replace all",
2633
+ matchCase: "Match case",
2634
+ words: "Words",
2635
+ print: "Print",
2636
+ autosavedNote: "Autosaved",
2637
+ uploadFile: "Upload a file",
2638
+ uploading: "Uploading",
2639
+ uploadFailed: "Could not upload the file"
2415
2640
  };
2416
2641
  var pl = {
2417
2642
  documents: "Dokumenty",
@@ -2428,6 +2653,10 @@ var pl = {
2428
2653
  versions: "Wersje",
2429
2654
  details: "Szczeg\xF3\u0142y",
2430
2655
  noOutline: "Ten dokument nie ma nag\u0142\xF3wk\xF3w",
2656
+ findHeading: "Znajd\u017A nag\u0142\xF3wek",
2657
+ read: "przeczytano",
2658
+ showSections: "Poka\u017C sekcje",
2659
+ hideSections: "Ukryj sekcje",
2431
2660
  current: "Bie\u017C\u0105ca",
2432
2661
  size: "Rozmiar",
2433
2662
  updated: "Zmieniono",
@@ -2475,6 +2704,12 @@ var pl = {
2475
2704
  save: "Zapisz",
2476
2705
  saving: "Zapisywanie",
2477
2706
  saved: "Zapisano",
2707
+ align: "Wyr\xF3wnanie",
2708
+ moreTools: "Wi\u0119cej narz\u0119dzi",
2709
+ fewerTools: "Mniej narz\u0119dzi",
2710
+ typeFilter: "Typ",
2711
+ selectAll: "Zaznacz wszystkie",
2712
+ clearPick: "Wyczy\u015B\u0107",
2478
2713
  saveFailed: "Nie uda\u0142o si\u0119 zapisa\u0107",
2479
2714
  remove: "Usu\u0144",
2480
2715
  notePlaceholder: "Napisz notatk\u0119",
@@ -2583,6 +2818,11 @@ var pl = {
2583
2818
  removed: "Usuni\u0119to",
2584
2819
  someone: "Kto\u015B",
2585
2820
  copyAs: "Zr\xF3b kopi\u0119 XLSX",
2821
+ downloadAs: "Pobierz jako",
2822
+ makeCopy: "Utw\xF3rz kopi\u0119",
2823
+ copyOf: "Kopia",
2824
+ rename: "Zmie\u0144 nazw\u0119",
2825
+ renameFailed: "Nie uda\u0142o si\u0119 zmieni\u0107 nazwy",
2586
2826
  copyFailed: "Nie uda\u0142o si\u0119 zrobi\u0107 kopii",
2587
2827
  editComment: "Edytuj",
2588
2828
  delete: "Usu\u0144",
@@ -2669,7 +2909,52 @@ var pl = {
2669
2909
  untitled: "Bez tytu\u0142u",
2670
2910
  kindHints: { docx: "Word, DOCX", markdown: "MD, ten sam edytor", sheet: "Excel, XLSX", slides: "Slajdy HTML" },
2671
2911
  newKinds: { docx: "Dokument", markdown: "Markdown", sheet: "Arkusz", slides: "Prezentacja" },
2672
- templates: { blank: "Pusty", letter: "List", contract: "Umowa", notes: "Notatki ze spotkania", invoice: "Faktura", report: "Raport" }
2912
+ templates: { blank: "Pusty", letter: "List", contract: "Umowa", notes: "Notatki ze spotkania", invoice: "Faktura", report: "Raport" },
2913
+ menuFile: "Plik",
2914
+ menuEdit: "Edycja",
2915
+ menuFormat: "Format",
2916
+ menuTools: "Narz\u0119dzia",
2917
+ zoom: "Powi\u0119kszenie",
2918
+ font: "Czcionka",
2919
+ fontSize: "Rozmiar czcionki",
2920
+ defaultFont: "Domy\u015Blna",
2921
+ lineSpacing: "Interlinia i odst\u0119py",
2922
+ single: "Pojedyncza",
2923
+ double: "Podw\xF3jna",
2924
+ spaceAfter: "Dodaj odst\u0119p po akapicie",
2925
+ noSpaceAfter: "Usu\u0144 odst\u0119p po akapicie",
2926
+ superscript: "Indeks g\xF3rny",
2927
+ subscript: "Indeks dolny",
2928
+ painter: "Malarz format\xF3w",
2929
+ painterHint: "Zaznacz tekst, dwuklik zostawia w\u0142\u0105czone, Esc ko\u0144czy",
2930
+ pageSetup: "Ustawienia strony",
2931
+ orientation: "Orientacja",
2932
+ portrait: "Pionowa",
2933
+ landscape: "Pozioma",
2934
+ marginsCm: "Marginesy, cm",
2935
+ mTop: "G\xF3rny",
2936
+ mRight: "Prawy",
2937
+ mBottom: "Dolny",
2938
+ mLeft: "Lewy",
2939
+ headerText: "Nag\u0142\xF3wek",
2940
+ footerText: "Stopka",
2941
+ pageNumbers: "Numery stron w stopce",
2942
+ wrapInline: "W linii z tekstem",
2943
+ wrapLeft: "Tekst op\u0142ywa z prawej",
2944
+ wrapRight: "Tekst op\u0142ywa z lewej",
2945
+ cellFill: "Wype\u0142nienie kom\xF3rki",
2946
+ tableBorders: "Obramowanie tabeli",
2947
+ findReplace: "Znajd\u017A i zamie\u0144",
2948
+ replaceWith: "Zamie\u0144 na",
2949
+ replaceOne: "Zamie\u0144",
2950
+ replaceAll: "Zamie\u0144 wszystko",
2951
+ matchCase: "Uwzgl\u0119dnij wielko\u015B\u0107 liter",
2952
+ words: "S\u0142owa",
2953
+ print: "Drukuj",
2954
+ autosavedNote: "Zapisano automatycznie",
2955
+ uploadFile: "Wgraj plik",
2956
+ uploading: "Wysy\u0142anie",
2957
+ uploadFailed: "Nie uda\u0142o si\u0119 wgra\u0107 pliku"
2673
2958
  };
2674
2959
  var uk = {
2675
2960
  documents: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0438",
@@ -2686,6 +2971,10 @@ var uk = {
2686
2971
  versions: "\u0412\u0435\u0440\u0441\u0456\u0457",
2687
2972
  details: "\u0414\u0435\u0442\u0430\u043B\u0456",
2688
2973
  noOutline: "\u0423 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0456 \u043D\u0435\u043C\u0430\u0454 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0456\u0432",
2974
+ findHeading: "\u0417\u043D\u0430\u0439\u0442\u0438 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A",
2975
+ read: "\u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043E",
2976
+ showSections: "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u0438 \u0440\u043E\u0437\u0434\u0456\u043B\u0438",
2977
+ hideSections: "\u0421\u0445\u043E\u0432\u0430\u0442\u0438 \u0440\u043E\u0437\u0434\u0456\u043B\u0438",
2689
2978
  current: "\u041F\u043E\u0442\u043E\u0447\u043D\u0430",
2690
2979
  size: "\u0420\u043E\u0437\u043C\u0456\u0440",
2691
2980
  updated: "\u0417\u043C\u0456\u043D\u0435\u043D\u043E",
@@ -2733,6 +3022,12 @@ var uk = {
2733
3022
  save: "\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438",
2734
3023
  saving: "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043D\u044F",
2735
3024
  saved: "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043E",
3025
+ align: "\u0412\u0438\u0440\u0456\u0432\u043D\u044E\u0432\u0430\u043D\u043D\u044F",
3026
+ moreTools: "\u0411\u0456\u043B\u044C\u0448\u0435 \u0456\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u0456\u0432",
3027
+ fewerTools: "\u041C\u0435\u043D\u0448\u0435 \u0456\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u0456\u0432",
3028
+ typeFilter: "\u0422\u0438\u043F",
3029
+ selectAll: "\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u0432\u0441\u0456",
3030
+ clearPick: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u0438",
2736
3031
  saveFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0431\u0435\u0440\u0435\u0433\u0442\u0438",
2737
3032
  remove: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
2738
3033
  notePlaceholder: "\u041D\u0430\u043F\u0438\u0448\u0456\u0442\u044C \u043D\u043E\u0442\u0430\u0442\u043A\u0443",
@@ -2841,6 +3136,11 @@ var uk = {
2841
3136
  removed: "\u0412\u0438\u0434\u0430\u043B\u0435\u043D\u043E",
2842
3137
  someone: "\u0425\u0442\u043E\u0441\u044C",
2843
3138
  copyAs: "\u0417\u0440\u043E\u0431\u0438\u0442\u0438 \u043A\u043E\u043F\u0456\u044E XLSX",
3139
+ downloadAs: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u044F\u043A",
3140
+ makeCopy: "\u0417\u0440\u043E\u0431\u0438\u0442\u0438 \u043A\u043E\u043F\u0456\u044E",
3141
+ copyOf: "\u041A\u043E\u043F\u0456\u044F",
3142
+ rename: "\u041F\u0435\u0440\u0435\u0439\u043C\u0435\u043D\u0443\u0432\u0430\u0442\u0438",
3143
+ renameFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u043F\u0435\u0440\u0435\u0439\u043C\u0435\u043D\u0443\u0432\u0430\u0442\u0438",
2844
3144
  copyFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0440\u043E\u0431\u0438\u0442\u0438 \u043A\u043E\u043F\u0456\u044E",
2845
3145
  editComment: "\u0417\u043C\u0456\u043D\u0438\u0442\u0438",
2846
3146
  delete: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
@@ -2927,7 +3227,52 @@ var uk = {
2927
3227
  untitled: "\u0411\u0435\u0437 \u043D\u0430\u0437\u0432\u0438",
2928
3228
  kindHints: { docx: "Word, DOCX", markdown: "MD, \u0442\u043E\u0439 \u0441\u0430\u043C\u0438\u0439 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440", sheet: "Excel, XLSX", slides: "HTML-\u0441\u043B\u0430\u0439\u0434\u0438" },
2929
3229
  newKinds: { docx: "\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442", markdown: "Markdown", sheet: "\u0422\u0430\u0431\u043B\u0438\u0446\u044F", slides: "\u041F\u0440\u0435\u0437\u0435\u043D\u0442\u0430\u0446\u0456\u044F" },
2930
- templates: { blank: "\u041F\u043E\u0440\u043E\u0436\u043D\u0456\u0439", letter: "\u041B\u0438\u0441\u0442", contract: "\u0414\u043E\u0433\u043E\u0432\u0456\u0440", notes: "\u041D\u043E\u0442\u0430\u0442\u043A\u0438 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456", invoice: "\u0420\u0430\u0445\u0443\u043D\u043E\u043A", report: "\u0417\u0432\u0456\u0442" }
3230
+ templates: { blank: "\u041F\u043E\u0440\u043E\u0436\u043D\u0456\u0439", letter: "\u041B\u0438\u0441\u0442", contract: "\u0414\u043E\u0433\u043E\u0432\u0456\u0440", notes: "\u041D\u043E\u0442\u0430\u0442\u043A\u0438 \u0437\u0443\u0441\u0442\u0440\u0456\u0447\u0456", invoice: "\u0420\u0430\u0445\u0443\u043D\u043E\u043A", report: "\u0417\u0432\u0456\u0442" },
3231
+ menuFile: "\u0424\u0430\u0439\u043B",
3232
+ menuEdit: "\u041F\u0440\u0430\u0432\u043A\u0430",
3233
+ menuFormat: "\u0424\u043E\u0440\u043C\u0430\u0442",
3234
+ menuTools: "\u0406\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u0438",
3235
+ zoom: "\u041C\u0430\u0441\u0448\u0442\u0430\u0431",
3236
+ font: "\u0428\u0440\u0438\u0444\u0442",
3237
+ fontSize: "\u0420\u043E\u0437\u043C\u0456\u0440 \u0448\u0440\u0438\u0444\u0442\u0443",
3238
+ defaultFont: "\u0422\u0438\u043F\u043E\u0432\u0438\u0439",
3239
+ lineSpacing: "\u041C\u0456\u0436\u0440\u044F\u0434\u043A\u043E\u0432\u0438\u0439 \u0456\u043D\u0442\u0435\u0440\u0432\u0430\u043B \u0456 \u0432\u0456\u0434\u0441\u0442\u0443\u043F\u0438",
3240
+ single: "\u041E\u0434\u0438\u043D\u0430\u0440\u043D\u0438\u0439",
3241
+ double: "\u041F\u043E\u0434\u0432\u0456\u0439\u043D\u0438\u0439",
3242
+ spaceAfter: "\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0456\u0434\u0441\u0442\u0443\u043F \u043F\u0456\u0441\u043B\u044F \u0430\u0431\u0437\u0430\u0446\u0443",
3243
+ noSpaceAfter: "\u041F\u0440\u0438\u0431\u0440\u0430\u0442\u0438 \u0432\u0456\u0434\u0441\u0442\u0443\u043F \u043F\u0456\u0441\u043B\u044F \u0430\u0431\u0437\u0430\u0446\u0443",
3244
+ superscript: "\u0412\u0435\u0440\u0445\u043D\u0456\u0439 \u0456\u043D\u0434\u0435\u043A\u0441",
3245
+ subscript: "\u041D\u0438\u0436\u043D\u0456\u0439 \u0456\u043D\u0434\u0435\u043A\u0441",
3246
+ painter: "\u041A\u043E\u043F\u0456\u044E\u0432\u0430\u0442\u0438 \u0444\u043E\u0440\u043C\u0430\u0442",
3247
+ painterHint: "\u0412\u0438\u0434\u0456\u043B\u0456\u0442\u044C \u0442\u0435\u043A\u0441\u0442, \u043F\u043E\u0434\u0432\u0456\u0439\u043D\u0438\u0439 \u043A\u043B\u0456\u043A \u043B\u0438\u0448\u0430\u0454 \u0443\u0432\u0456\u043C\u043A\u043D\u0435\u043D\u0438\u043C, Esc \u0432\u0438\u043C\u0438\u043A\u0430\u0454",
3248
+ pageSetup: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043A\u0438",
3249
+ orientation: "\u041E\u0440\u0456\u0454\u043D\u0442\u0430\u0446\u0456\u044F",
3250
+ portrait: "\u041A\u043D\u0438\u0436\u043A\u043E\u0432\u0430",
3251
+ landscape: "\u0410\u043B\u044C\u0431\u043E\u043C\u043D\u0430",
3252
+ marginsCm: "\u041F\u043E\u043B\u044F, \u0441\u043C",
3253
+ mTop: "\u0412\u0435\u0440\u0445\u043D\u0454",
3254
+ mRight: "\u041F\u0440\u0430\u0432\u0435",
3255
+ mBottom: "\u041D\u0438\u0436\u043D\u0454",
3256
+ mLeft: "\u041B\u0456\u0432\u0435",
3257
+ headerText: "\u0412\u0435\u0440\u0445\u043D\u0456\u0439 \u043A\u043E\u043B\u043E\u043D\u0442\u0438\u0442\u0443\u043B",
3258
+ footerText: "\u041D\u0438\u0436\u043D\u0456\u0439 \u043A\u043E\u043B\u043E\u043D\u0442\u0438\u0442\u0443\u043B",
3259
+ pageNumbers: "\u041D\u043E\u043C\u0435\u0440\u0438 \u0441\u0442\u043E\u0440\u0456\u043D\u043E\u043A \u0443\u043D\u0438\u0437\u0443",
3260
+ wrapInline: "\u0423 \u0440\u044F\u0434\u043A\u0443 \u0437 \u0442\u0435\u043A\u0441\u0442\u043E\u043C",
3261
+ wrapLeft: "\u0422\u0435\u043A\u0441\u0442 \u043E\u0431\u0442\u0456\u043A\u0430\u0454 \u043F\u0440\u0430\u0432\u043E\u0440\u0443\u0447",
3262
+ wrapRight: "\u0422\u0435\u043A\u0441\u0442 \u043E\u0431\u0442\u0456\u043A\u0430\u0454 \u043B\u0456\u0432\u043E\u0440\u0443\u0447",
3263
+ cellFill: "\u0417\u0430\u043B\u0438\u0432\u043A\u0430 \u043A\u043B\u0456\u0442\u0438\u043D\u043A\u0438",
3264
+ tableBorders: "\u041C\u0435\u0436\u0456 \u0442\u0430\u0431\u043B\u0438\u0446\u0456",
3265
+ findReplace: "\u0417\u043D\u0430\u0439\u0442\u0438 \u0439 \u0437\u0430\u043C\u0456\u043D\u0438\u0442\u0438",
3266
+ replaceWith: "\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438 \u043D\u0430",
3267
+ replaceOne: "\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438",
3268
+ replaceAll: "\u0417\u0430\u043C\u0456\u043D\u0438\u0442\u0438 \u0432\u0441\u0456",
3269
+ matchCase: "\u0417 \u0443\u0440\u0430\u0445\u0443\u0432\u0430\u043D\u043D\u044F\u043C \u0440\u0435\u0433\u0456\u0441\u0442\u0440\u0443",
3270
+ words: "\u0421\u043B\u043E\u0432\u0430",
3271
+ print: "\u0414\u0440\u0443\u043A",
3272
+ autosavedNote: "\u0417\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043E \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u043D\u043E",
3273
+ uploadFile: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043B",
3274
+ uploading: "\u0417\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0435\u043D\u043D\u044F",
3275
+ uploadFailed: "\u041D\u0435 \u0432\u0434\u0430\u043B\u043E\u0441\u044F \u0437\u0430\u0432\u0430\u043D\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043B"
2931
3276
  };
2932
3277
  var texts = { en, pl, uk };
2933
3278
 
@@ -2945,4 +3290,4 @@ export {
2945
3290
  writeDocx,
2946
3291
  texts
2947
3292
  };
2948
- //# sourceMappingURL=chunk-WR3MT7KP.js.map
3293
+ //# sourceMappingURL=chunk-DR3TTJWZ.js.map