@silurus/ooxml 0.34.0 → 0.35.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.
package/dist/pptx.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./autoResize-C6N7p_Or.cjs`),t=require(`./pptx-fT7k8Zgz.cjs`);exports.PptxPresentation=t.r,exports.PptxViewer=t.n,exports.autoResize=e.t,exports.renderSlide=t.i;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./autoResize-C6N7p_Or.cjs`),t=require(`./pptx-CLc84h6v.cjs`);exports.PptxPresentation=t.r,exports.PptxViewer=t.n,exports.autoResize=e.t,exports.renderSlide=t.i;
package/dist/pptx.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as e } from "./autoResize-D-Yz7Izt.js";
2
- import { i as t, n, r } from "./pptx-BiCFrgHM.js";
2
+ import { i as t, n, r } from "./pptx-DdpPwDWz.js";
3
3
  export { r as PptxPresentation, n as PptxViewer, e as autoResize, t as renderSlide };
@@ -23,7 +23,7 @@ export declare interface AutoResizeOptions {
23
23
  pauseWhenHidden?: boolean;
24
24
  }
25
25
 
26
- declare type BodyElement = {
26
+ export declare type BodyElement = {
27
27
  type: 'paragraph';
28
28
  } & DocParagraph | {
29
29
  type: 'table';
@@ -52,6 +52,19 @@ declare type CellElement = {
52
52
  type: 'table';
53
53
  } & DocTable;
54
54
 
55
+ export declare interface DocComment {
56
+ id: string;
57
+ author?: string;
58
+ initials?: string;
59
+ date?: string;
60
+ text: string;
61
+ }
62
+
63
+ export declare interface DocNote {
64
+ id: string;
65
+ text: string;
66
+ }
67
+
55
68
  export declare interface DocParagraph {
56
69
  /**
57
70
  * ECMA-376 §17.18.44 ST_Jc. Renderer honors left, start, center, right, end,
@@ -88,6 +101,15 @@ export declare interface DocParagraph {
88
101
  defaultFontSize?: number;
89
102
  }
90
103
 
104
+ export declare interface DocRevision {
105
+ /** "insertion" | "deletion" */
106
+ kind: 'insertion' | 'deletion' | string;
107
+ author?: string;
108
+ /** ISO-8601 timestamp */
109
+ date?: string;
110
+ text: string;
111
+ }
112
+
91
113
  export declare type DocRun = {
92
114
  type: 'text';
93
115
  } & TextRun | {
@@ -148,6 +170,20 @@ declare interface Document_2 {
148
170
  * entry is absent or classified as "auto".
149
171
  */
150
172
  fontFamilyClasses?: Record<string, string>;
173
+ /** ECMA-376 §17.13.5 — flat list of `<w:ins>` / `<w:del>` events in the
174
+ * body. Each entry carries author / date / text. The renderer marks
175
+ * runs inline via {@link TextRun.revision}; this array is primarily for
176
+ * tooling (MCP, agents, change-summary panels). */
177
+ revisions?: DocRevision[];
178
+ /** ECMA-376 §17.13.4 — `word/comments.xml`. Each comment carries id,
179
+ * author, initials, date, and plain-text body. */
180
+ comments?: DocComment[];
181
+ /** ECMA-376 §17.11.10 — `word/footnotes.xml` (id + text). Excludes the
182
+ * spec-defined separator / continuation-separator entries. */
183
+ footnotes?: DocNote[];
184
+ /** ECMA-376 §17.11.4 — `word/endnotes.xml` (id + text). Same shape as
185
+ * `footnotes`. */
186
+ endnotes?: DocNote[];
151
187
  }
152
188
  export { Document_2 as Document }
153
189
 
@@ -393,6 +429,10 @@ export declare interface RenderPageOptions {
393
429
  fontSize: number;
394
430
  font: string;
395
431
  }) => void;
432
+ /** Default `true`. When false, ECMA-376 §17.13.5 track-changes runs render
433
+ * in their normal style (no author colour, no underline / strikethrough)
434
+ * — equivalent to Word's "Final / No Markup" view. */
435
+ showTrackChanges?: boolean;
396
436
  }
397
437
 
398
438
  declare interface RubyAnnotation {
@@ -401,6 +441,15 @@ declare interface RubyAnnotation {
401
441
  fontSizePt: number;
402
442
  }
403
443
 
444
+ export declare interface RunRevision {
445
+ /** "insertion" or "deletion" */
446
+ kind: 'insertion' | 'deletion' | string;
447
+ /** `<w:ins w:author>` / `<w:del w:author>`. Used to colour the markup. */
448
+ author?: string;
449
+ /** ISO-8601 timestamp. */
450
+ date?: string;
451
+ }
452
+
404
453
  export declare interface SectionProps {
405
454
  pageWidth: number;
406
455
  pageHeight: number;
@@ -544,6 +593,11 @@ export declare interface TextRun {
544
593
  /** ECMA-376 §17.3.3.25 ruby annotation (furigana). Renders above the
545
594
  * base text in a smaller font; line height is expanded to fit it. */
546
595
  ruby?: RubyAnnotation;
596
+ /** ECMA-376 §17.13.5 — set when this run sits inside `<w:ins>` or
597
+ * `<w:del>`. The renderer paints insertions with an author-coloured
598
+ * underline and deletions with an author-coloured strikethrough so
599
+ * tracked changes appear inline. */
600
+ revision?: RunRevision;
547
601
  }
548
602
 
549
603
  export { }
@@ -598,6 +598,19 @@ declare interface DefinedName {
598
598
  formula: string;
599
599
  }
600
600
 
601
+ declare interface DocComment {
602
+ id: string;
603
+ author?: string;
604
+ initials?: string;
605
+ date?: string;
606
+ text: string;
607
+ }
608
+
609
+ declare interface DocNote {
610
+ id: string;
611
+ text: string;
612
+ }
613
+
601
614
  declare interface DocParagraph {
602
615
  /**
603
616
  * ECMA-376 §17.18.44 ST_Jc. Renderer honors left, start, center, right, end,
@@ -634,6 +647,15 @@ declare interface DocParagraph {
634
647
  defaultFontSize?: number;
635
648
  }
636
649
 
650
+ declare interface DocRevision {
651
+ /** "insertion" | "deletion" */
652
+ kind: 'insertion' | 'deletion' | string;
653
+ author?: string;
654
+ /** ISO-8601 timestamp */
655
+ date?: string;
656
+ text: string;
657
+ }
658
+
637
659
  declare type DocRun = {
638
660
  type: 'text';
639
661
  } & TextRun_2 | {
@@ -694,6 +716,20 @@ declare interface Document_2 {
694
716
  * entry is absent or classified as "auto".
695
717
  */
696
718
  fontFamilyClasses?: Record<string, string>;
719
+ /** ECMA-376 §17.13.5 — flat list of `<w:ins>` / `<w:del>` events in the
720
+ * body. Each entry carries author / date / text. The renderer marks
721
+ * runs inline via {@link TextRun.revision}; this array is primarily for
722
+ * tooling (MCP, agents, change-summary panels). */
723
+ revisions?: DocRevision[];
724
+ /** ECMA-376 §17.13.4 — `word/comments.xml`. Each comment carries id,
725
+ * author, initials, date, and plain-text body. */
726
+ comments?: DocComment[];
727
+ /** ECMA-376 §17.11.10 — `word/footnotes.xml` (id + text). Excludes the
728
+ * spec-defined separator / continuation-separator entries. */
729
+ footnotes?: DocNote[];
730
+ /** ECMA-376 §17.11.4 — `word/endnotes.xml` (id + text). Same shape as
731
+ * `footnotes`. */
732
+ endnotes?: DocNote[];
697
733
  }
698
734
 
699
735
  export declare namespace docx {
@@ -706,11 +742,16 @@ export declare namespace docx {
706
742
  AutoResizeOptions,
707
743
  Document_2 as Document,
708
744
  SectionProps,
745
+ BodyElement,
709
746
  DocParagraph,
710
747
  DocRun,
711
748
  TextRun_2 as TextRun,
712
749
  ImageRun,
713
750
  RenderPageOptions,
751
+ RunRevision,
752
+ DocRevision,
753
+ DocComment,
754
+ DocNote,
714
755
  DocxTextRunInfo
715
756
  }
716
757
  }
@@ -1496,6 +1537,10 @@ declare interface RenderPageOptions {
1496
1537
  fontSize: number;
1497
1538
  font: string;
1498
1539
  }) => void;
1540
+ /** Default `true`. When false, ECMA-376 §17.13.5 track-changes runs render
1541
+ * in their normal style (no author colour, no underline / strikethrough)
1542
+ * — equivalent to Word's "Final / No Markup" view. */
1543
+ showTrackChanges?: boolean;
1499
1544
  }
1500
1545
 
1501
1546
  /**
@@ -1590,6 +1635,15 @@ declare interface RunFont {
1590
1635
  vertAlign?: 'superscript' | 'subscript';
1591
1636
  }
1592
1637
 
1638
+ declare interface RunRevision {
1639
+ /** "insertion" or "deletion" */
1640
+ kind: 'insertion' | 'deletion' | string;
1641
+ /** `<w:ins w:author>` / `<w:del w:author>`. Used to colour the markup. */
1642
+ author?: string;
1643
+ /** ISO-8601 timestamp. */
1644
+ date?: string;
1645
+ }
1646
+
1593
1647
  declare interface SectionProps {
1594
1648
  pageWidth: number;
1595
1649
  pageHeight: number;
@@ -2122,6 +2176,11 @@ declare interface TextRun_2 {
2122
2176
  /** ECMA-376 §17.3.3.25 ruby annotation (furigana). Renders above the
2123
2177
  * base text in a smaller font; line height is expanded to fit it. */
2124
2178
  ruby?: RubyAnnotation;
2179
+ /** ECMA-376 §17.13.5 — set when this run sits inside `<w:ins>` or
2180
+ * `<w:del>`. The renderer paints insertions with an author-coloured
2181
+ * underline and deletions with an author-coloured strikethrough so
2182
+ * tracked changes appear inline. */
2183
+ revision?: RunRevision;
2125
2184
  }
2126
2185
 
2127
2186
  declare type TextRunCallback = (run: TextRunInfo) => void;