@forevka/wordcanvas 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist-lib/assets/{worker-D8rUOKfg.js → worker-CqU4Popa.js} +10903 -10736
  2. package/dist-lib/assets/worker-Cw5cYW5z.js +2418 -0
  3. package/dist-lib/blockFactory-DDCRWDnA.js +91 -0
  4. package/dist-lib/browser-BUrsjziD.js +612 -0
  5. package/dist-lib/builder.js +13 -13
  6. package/dist-lib/editorApp-CB_ZArIF.js +9566 -0
  7. package/dist-lib/export.js +4507 -4456
  8. package/dist-lib/generate-toc.js +7 -7
  9. package/dist-lib/import.js +2 -2
  10. package/dist-lib/lists-DpmgbDyt.js +110 -0
  11. package/dist-lib/measure.js +2 -2
  12. package/dist-lib/{measureHost-CMiJKdlk.js → measureHost-BlukHGwx.js} +1 -1
  13. package/dist-lib/metrics-bvGO8KDK.js +96 -0
  14. package/dist-lib/paintStyle-vT6jtWbH.js +74 -0
  15. package/dist-lib/pipeline-UryP-u7Z.js +1850 -0
  16. package/dist-lib/recalc-docx.js +2 -2
  17. package/dist-lib/recalcToc-BfXlXZik.js +3985 -0
  18. package/dist-lib/styleProps-DhqDEfvc.js +149 -0
  19. package/dist-lib/stylesheet-LTBEGkvG.js +146 -0
  20. package/dist-lib/toc-D09f4PrI.js +939 -0
  21. package/dist-lib/{webmcp-6WxRNKCc.js → webmcp-K6UZgQJ0.js} +60 -68
  22. package/dist-lib/wordcanvas-DBx2ana_.js +734 -0
  23. package/dist-lib/wordcanvas.js +4 -2
  24. package/dist-node/{chunk-CDN6WU2P.js → chunk-373K2XRY.js} +40 -22
  25. package/dist-node/chunk-373K2XRY.js.map +7 -0
  26. package/dist-node/{chunk-22JHAERT.js → chunk-3PUV3BG6.js} +235 -39
  27. package/dist-node/chunk-3PUV3BG6.js.map +7 -0
  28. package/dist-node/{chunk-4ICCHZX4.js → chunk-5RX3IHWE.js} +39 -3
  29. package/dist-node/chunk-5RX3IHWE.js.map +7 -0
  30. package/dist-node/{chunk-4PDVRJF6.js → chunk-EMY2P524.js} +32 -2
  31. package/dist-node/chunk-EMY2P524.js.map +7 -0
  32. package/dist-node/{chunk-BRAPV465.js → chunk-HWQKGDS2.js} +2 -2
  33. package/dist-node/{chunk-6AJJMHKY.js → chunk-KJV7GJ3H.js} +1 -1
  34. package/dist-node/chunk-KJV7GJ3H.js.map +7 -0
  35. package/dist-node/{chunk-RNB336F3.js → chunk-ZLLSXOO2.js} +92 -14
  36. package/dist-node/{chunk-RNB336F3.js.map → chunk-ZLLSXOO2.js.map} +2 -2
  37. package/dist-node/{engine-5FGDJD2H.js → engine-LLA6PCS5.js} +4 -4
  38. package/dist-node/export.js +89 -24
  39. package/dist-node/export.js.map +2 -2
  40. package/dist-node/generate-toc.js +6 -6
  41. package/dist-node/import.js +3 -3
  42. package/dist-node/measure.js +2 -2
  43. package/dist-node/recalc-docx.js +4 -4
  44. package/package.json +1 -1
  45. package/types/model.d.ts +46 -0
  46. package/types/wordcanvas.d.ts +493 -1
  47. package/dist-lib/assets/worker-wXuuyshQ.js +0 -2258
  48. package/dist-lib/blockFactory-CUI4Rqiq.js +0 -186
  49. package/dist-lib/browser-DkKxreJM.js +0 -1305
  50. package/dist-lib/editorApp-DLXMmtu5.js +0 -8023
  51. package/dist-lib/lists-Sc5I40JO.js +0 -110
  52. package/dist-lib/metrics-CkAo4zh8.js +0 -143
  53. package/dist-lib/pipeline-CbxmCE84.js +0 -1705
  54. package/dist-lib/recalcToc-g1hFKSNs.js +0 -3935
  55. package/dist-lib/styleProps-Db5pEkG8.js +0 -127
  56. package/dist-lib/toc-B6VpkJge.js +0 -213
  57. package/dist-lib/wordcanvas-CFqpDK0k.js +0 -125
  58. package/dist-node/chunk-22JHAERT.js.map +0 -7
  59. package/dist-node/chunk-4ICCHZX4.js.map +0 -7
  60. package/dist-node/chunk-4PDVRJF6.js.map +0 -7
  61. package/dist-node/chunk-6AJJMHKY.js.map +0 -7
  62. package/dist-node/chunk-CDN6WU2P.js.map +0 -7
  63. /package/dist-node/{chunk-BRAPV465.js.map → chunk-HWQKGDS2.js.map} +0 -0
  64. /package/dist-node/{engine-5FGDJD2H.js.map → engine-LLA6PCS5.js.map} +0 -0
@@ -1,8 +1,8 @@
1
- import { d as v, B as k, s as B } from "./blockFactory-CUI4Rqiq.js";
2
- import { d as y, D as C, a as R, b as I, n as F, m as A } from "./lists-Sc5I40JO.js";
3
- import { b as L, g as D } from "./toc-B6VpkJge.js";
4
- import { t as x, B as w } from "./browser-DkKxreJM.js";
5
- import { b as E, e as T, r as H } from "./pipeline-CbxmCE84.js";
1
+ import { t as x, B as w, b as v, g as B } from "./toc-D09f4PrI.js";
2
+ import { d as C, s as R } from "./stylesheet-LTBEGkvG.js";
3
+ import { d as k, D as I, a as F, b as A, n as L, m as D } from "./lists-DpmgbDyt.js";
4
+ import { B as y } from "./blockFactory-DDCRWDnA.js";
5
+ import { b as E, e as T, r as H } from "./pipeline-UryP-u7Z.js";
6
6
  function N(a) {
7
7
  let t = "";
8
8
  for (let i = 0; i < a.length; i += 32768)
@@ -382,7 +382,7 @@ class f {
382
382
  r !== void 0 ? s[r] || (this.ctx.warn(
383
383
  `list-missing:${r}`,
384
384
  `List definition "${r}" is not in the document — a default ${i} definition was registered under that id.`
385
- ), s[r] = { ...y(i === "number" ? "decimal" : "bullet"), id: r }) : (r = i === "number" ? C : R, s[r] || (s[r] = y(i === "number" ? "decimal" : "bullet")));
385
+ ), s[r] = { ...k(i === "number" ? "decimal" : "bullet"), id: r }) : (r = i === "number" ? I : F, s[r] || (s[r] = k(i === "number" ? "decimal" : "bullet")));
386
386
  for (const n of t) {
387
387
  const o = typeof n == "string" ? { text: n } : n, h = Math.max(0, Math.min(8, o.level ?? e.level ?? 0));
388
388
  this.push(this.ctx.paragraph([this.ctx.run(o.text, o.style ?? {})], { list: { listId: r, level: h } }));
@@ -482,15 +482,15 @@ class b extends f {
482
482
  marginPx: { top: p, right: p, bottom: p, left: p, ...t.margins }
483
483
  },
484
484
  blocks: [],
485
- stylesheet: t.stylesheet ?? v()
485
+ stylesheet: t.stylesheet ?? C()
486
486
  };
487
- return new b(new k(i, t.idSeed));
487
+ return new b(new y(i, t.idSeed));
488
488
  }
489
489
  /** Start from a .docx template: its stylesheet, list definitions, page setup,
490
490
  * and header/footer bands carry over (body content is discarded unless
491
491
  * keepBody). Import warnings surface on `builder.warnings`. */
492
492
  static async fromTemplate(t, e = {}) {
493
- const { doc: i, warnings: s } = M(t, e.keepBody ?? !1), r = new b(new k(i, e.idSeed));
493
+ const { doc: i, warnings: s } = M(t, e.keepBody ?? !1), r = new b(new y(i, e.idSeed));
494
494
  for (const n of s) r.ctx.warn(n.code, n.message);
495
495
  return r;
496
496
  }
@@ -541,12 +541,12 @@ class b extends f {
541
541
  * defaults from it. Call EARLY — only content added afterwards inherits it. */
542
542
  defaultStyle(t) {
543
543
  const e = this.ctx.stylesheet();
544
- return B(e, t) ? (e.defaultStyleId = t, this.ctx.refreshDefaults(), this) : (this.ctx.warn(`style-missing:${t}`, `.defaultStyle("${t}") — no such style in the stylesheet; default unchanged.`), this);
544
+ return R(e, t) ? (e.defaultStyleId = t, this.ctx.refreshDefaults(), this) : (this.ctx.warn(`style-missing:${t}`, `.defaultStyle("${t}") — no such style in the stylesheet; default unchanged.`), this);
545
545
  }
546
546
  /** Register a custom list definition; reference it via .list(items,{listId:id}). */
547
547
  listDefinition(t, e) {
548
548
  const i = this.ctx.doc.lists ??= {};
549
- return "levels" in e ? i[t] = { id: t, levels: e.levels } : e.kind === "bullet" ? i[t] = I(t, e.char) : e.kind === "number" ? i[t] = F(t, e.format, e.suffix ?? ".") : i[t] = { ...A(), id: t }, this;
549
+ return "levels" in e ? i[t] = { id: t, levels: e.levels } : e.kind === "bullet" ? i[t] = A(t, e.char) : e.kind === "number" ? i[t] = L(t, e.format, e.suffix ?? ".") : i[t] = { ...D(), id: t }, this;
550
550
  }
551
551
  /** Register (or override) a builder-only table-style preset — reusable cell
552
552
  * formatting applied via .table(rows, { style: name }). Resolved to concrete
@@ -565,7 +565,7 @@ class b extends f {
565
565
  hideInWeb: !0,
566
566
  outlineRange: { from: 1, to: t.maxLevel ?? 3 }
567
567
  };
568
- this.ctx.doc.tocInstruction = L(e);
568
+ this.ctx.doc.tocInstruction = v(e);
569
569
  const i = this.ctx.paragraph([]);
570
570
  return this.push(i), this.ctx.doc.tocAnchorBlockId = i.id, this;
571
571
  }
@@ -609,7 +609,7 @@ class b extends f {
609
609
  build() {
610
610
  this.flushPendingPageBreak();
611
611
  let t = structuredClone(this.ctx.doc);
612
- return this.tocRequested && t.tocAnchorBlockId !== void 0 && (t = D(t, this.tocOpts).doc), t.blocks.length === 0 && t.blocks.push(this.ctx.paragraph([])), t;
612
+ return this.tocRequested && t.tocAnchorBlockId !== void 0 && (t = B(t, this.tocOpts).doc), t.blocks.length === 0 && t.blocks.push(this.ctx.paragraph([])), t;
613
613
  }
614
614
  }
615
615
  export {