@silurus/ooxml 0.34.0 → 0.36.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-gWByFXpk.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-CzgfHii0.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
 
@@ -300,9 +336,16 @@ declare interface LineSpacing {
300
336
  explicit?: boolean;
301
337
  }
302
338
 
303
- /** Options for {@link DocxDocument.load}. Re-exports the shared
339
+ /** Options for {@link DocxDocument.load}. Extends the shared
304
340
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
305
- export declare type LoadOptions = LoadOptions_2;
341
+ export declare interface LoadOptions extends LoadOptions_2 {
342
+ /**
343
+ * Override the per-entry ZIP decompression cap (bytes) used by the
344
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Zero / negative
345
+ * values fall back to the default.
346
+ */
347
+ maxZipEntryBytes?: number;
348
+ }
306
349
 
307
350
  /**
308
351
  * Common load-time options shared by the docx / pptx / xlsx viewer
@@ -393,6 +436,10 @@ export declare interface RenderPageOptions {
393
436
  fontSize: number;
394
437
  font: string;
395
438
  }) => void;
439
+ /** Default `true`. When false, ECMA-376 §17.13.5 track-changes runs render
440
+ * in their normal style (no author colour, no underline / strikethrough)
441
+ * — equivalent to Word's "Final / No Markup" view. */
442
+ showTrackChanges?: boolean;
396
443
  }
397
444
 
398
445
  declare interface RubyAnnotation {
@@ -401,6 +448,15 @@ declare interface RubyAnnotation {
401
448
  fontSizePt: number;
402
449
  }
403
450
 
451
+ export declare interface RunRevision {
452
+ /** "insertion" or "deletion" */
453
+ kind: 'insertion' | 'deletion' | string;
454
+ /** `<w:ins w:author>` / `<w:del w:author>`. Used to colour the markup. */
455
+ author?: string;
456
+ /** ISO-8601 timestamp. */
457
+ date?: string;
458
+ }
459
+
404
460
  export declare interface SectionProps {
405
461
  pageWidth: number;
406
462
  pageHeight: number;
@@ -544,6 +600,11 @@ export declare interface TextRun {
544
600
  /** ECMA-376 §17.3.3.25 ruby annotation (furigana). Renders above the
545
601
  * base text in a smaller font; line height is expanded to fit it. */
546
602
  ruby?: RubyAnnotation;
603
+ /** ECMA-376 §17.13.5 — set when this run sits inside `<w:ins>` or
604
+ * `<w:del>`. The renderer paints insertions with an author-coloured
605
+ * underline and deletions with an author-coloured strikethrough so
606
+ * tracked changes appear inline. */
607
+ revision?: RunRevision;
547
608
  }
548
609
 
549
610
  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
  }
@@ -987,9 +1028,18 @@ declare interface LineSpacing {
987
1028
  explicit?: boolean;
988
1029
  }
989
1030
 
990
- /** Options for {@link PptxPresentation.load}. Re-exports the shared
1031
+ /** Options for {@link PptxPresentation.load}. Extends the shared
991
1032
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
992
- declare type LoadOptions = LoadOptions_2;
1033
+ declare interface LoadOptions extends LoadOptions_2 {
1034
+ /**
1035
+ * Override the per-entry ZIP decompression cap (bytes). Defaults to
1036
+ * 512 MiB — matches `MAX_ZIP_ENTRY_BYTES` in the Rust parser. Raising
1037
+ * this past 4 GiB requires a 64-bit WASM build; lowering it makes the
1038
+ * loader reject otherwise-legitimate large media decks. Zero or
1039
+ * negative values fall back to the default.
1040
+ */
1041
+ maxZipEntryBytes?: number;
1042
+ }
993
1043
 
994
1044
  /**
995
1045
  * Common load-time options shared by the docx / pptx / xlsx viewer
@@ -1013,13 +1063,28 @@ declare interface LoadOptions_2 {
1013
1063
  useGoogleFonts?: boolean;
1014
1064
  }
1015
1065
 
1016
- /** Options for {@link XlsxWorkbook.load}. Re-exports the shared
1066
+ /** Options for {@link XlsxWorkbook.load}. Extends the shared
1017
1067
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
1018
- declare type LoadOptions_3 = LoadOptions_2;
1068
+ declare interface LoadOptions_3 extends LoadOptions_2 {
1069
+ /**
1070
+ * Override the per-entry ZIP decompression cap (bytes) used by the
1071
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Applies to both
1072
+ * the initial workbook parse and per-sheet parse. Zero / negative values
1073
+ * fall back to the default.
1074
+ */
1075
+ maxZipEntryBytes?: number;
1076
+ }
1019
1077
 
1020
- /** Options for {@link DocxDocument.load}. Re-exports the shared
1078
+ /** Options for {@link DocxDocument.load}. Extends the shared
1021
1079
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
1022
- declare type LoadOptions_4 = LoadOptions_2;
1080
+ declare interface LoadOptions_4 extends LoadOptions_2 {
1081
+ /**
1082
+ * Override the per-entry ZIP decompression cap (bytes) used by the
1083
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Zero / negative
1084
+ * values fall back to the default.
1085
+ */
1086
+ maxZipEntryBytes?: number;
1087
+ }
1023
1088
 
1024
1089
  declare interface ManualLayout {
1025
1090
  xMode: string;
@@ -1399,6 +1464,13 @@ declare interface PptxViewerOptions extends RenderOptions {
1399
1464
  * default — see {@link PptxPresentation.load} for privacy implications.
1400
1465
  */
1401
1466
  useGoogleFonts?: boolean;
1467
+ /**
1468
+ * Override the per-entry ZIP decompression cap (bytes) used by the zip-bomb
1469
+ * guard in the Rust parser. Defaults to 512 MiB. Raise this to load decks
1470
+ * with very large embedded media, or lower it to tighten the budget for
1471
+ * untrusted input. Zero / negative values fall back to the default.
1472
+ */
1473
+ maxZipEntryBytes?: number;
1402
1474
  /**
1403
1475
  * Enable interactive audio/video playback. When true, slides are rendered
1404
1476
  * via {@link PptxPresentation.presentSlide} so media elements become
@@ -1496,6 +1568,10 @@ declare interface RenderPageOptions {
1496
1568
  fontSize: number;
1497
1569
  font: string;
1498
1570
  }) => void;
1571
+ /** Default `true`. When false, ECMA-376 §17.13.5 track-changes runs render
1572
+ * in their normal style (no author colour, no underline / strikethrough)
1573
+ * — equivalent to Word's "Final / No Markup" view. */
1574
+ showTrackChanges?: boolean;
1499
1575
  }
1500
1576
 
1501
1577
  /**
@@ -1590,6 +1666,15 @@ declare interface RunFont {
1590
1666
  vertAlign?: 'superscript' | 'subscript';
1591
1667
  }
1592
1668
 
1669
+ declare interface RunRevision {
1670
+ /** "insertion" or "deletion" */
1671
+ kind: 'insertion' | 'deletion' | string;
1672
+ /** `<w:ins w:author>` / `<w:del w:author>`. Used to colour the markup. */
1673
+ author?: string;
1674
+ /** ISO-8601 timestamp. */
1675
+ date?: string;
1676
+ }
1677
+
1593
1678
  declare interface SectionProps {
1594
1679
  pageWidth: number;
1595
1680
  pageHeight: number;
@@ -2122,6 +2207,11 @@ declare interface TextRun_2 {
2122
2207
  /** ECMA-376 §17.3.3.25 ruby annotation (furigana). Renders above the
2123
2208
  * base text in a smaller font; line height is expanded to fit it. */
2124
2209
  ruby?: RubyAnnotation;
2210
+ /** ECMA-376 §17.13.5 — set when this run sits inside `<w:ins>` or
2211
+ * `<w:del>`. The renderer paints insertions with an author-coloured
2212
+ * underline and deletions with an author-coloured strikethrough so
2213
+ * tracked changes appear inline. */
2214
+ revision?: RunRevision;
2125
2215
  }
2126
2216
 
2127
2217
  declare type TextRunCallback = (run: TextRunInfo) => void;
@@ -2459,6 +2549,12 @@ declare interface XlsxViewerOptions {
2459
2549
  * privacy implications.
2460
2550
  */
2461
2551
  useGoogleFonts?: boolean;
2552
+ /**
2553
+ * Override the per-entry ZIP decompression cap (bytes) used by the
2554
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Zero / negative
2555
+ * values fall back to the default.
2556
+ */
2557
+ maxZipEntryBytes?: number;
2462
2558
  }
2463
2559
 
2464
2560
  declare class XlsxWorkbook {
@@ -2468,6 +2564,7 @@ declare class XlsxWorkbook {
2468
2564
  /** Cache of loaded images keyed by their data URL. Shared across sheets. */
2469
2565
  private imageCache;
2470
2566
  private rawData;
2567
+ private maxZipEntryBytes;
2471
2568
  constructor();
2472
2569
  load(source: string | ArrayBuffer, opts?: LoadOptions_3): Promise<void>;
2473
2570
  get sheetNames(): string[];
@@ -301,9 +301,18 @@ export declare interface LineBreak {
301
301
  type: 'break';
302
302
  }
303
303
 
304
- /** Options for {@link PptxPresentation.load}. Re-exports the shared
304
+ /** Options for {@link PptxPresentation.load}. Extends the shared
305
305
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
306
- export declare type LoadOptions = LoadOptions_2;
306
+ export declare interface LoadOptions extends LoadOptions_2 {
307
+ /**
308
+ * Override the per-entry ZIP decompression cap (bytes). Defaults to
309
+ * 512 MiB — matches `MAX_ZIP_ENTRY_BYTES` in the Rust parser. Raising
310
+ * this past 4 GiB requires a 64-bit WASM build; lowering it makes the
311
+ * loader reject otherwise-legitimate large media decks. Zero or
312
+ * negative values fall back to the default.
313
+ */
314
+ maxZipEntryBytes?: number;
315
+ }
307
316
 
308
317
  /**
309
318
  * Common load-time options shared by the docx / pptx / xlsx viewer
@@ -554,6 +563,13 @@ export declare interface PptxViewerOptions extends RenderOptions {
554
563
  * default — see {@link PptxPresentation.load} for privacy implications.
555
564
  */
556
565
  useGoogleFonts?: boolean;
566
+ /**
567
+ * Override the per-entry ZIP decompression cap (bytes) used by the zip-bomb
568
+ * guard in the Rust parser. Defaults to 512 MiB. Raise this to load decks
569
+ * with very large embedded media, or lower it to tighten the budget for
570
+ * untrusted input. Zero / negative values fall back to the default.
571
+ */
572
+ maxZipEntryBytes?: number;
557
573
  /**
558
574
  * Enable interactive audio/video playback. When true, slides are rendered
559
575
  * via {@link PptxPresentation.presentSlide} so media elements become
@@ -414,9 +414,17 @@ declare interface LegendManualLayout {
414
414
  h: number;
415
415
  }
416
416
 
417
- /** Options for {@link XlsxWorkbook.load}. Re-exports the shared
417
+ /** Options for {@link XlsxWorkbook.load}. Extends the shared
418
418
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
419
- declare type LoadOptions = LoadOptions_2;
419
+ declare interface LoadOptions extends LoadOptions_2 {
420
+ /**
421
+ * Override the per-entry ZIP decompression cap (bytes) used by the
422
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Applies to both
423
+ * the initial workbook parse and per-sheet parse. Zero / negative values
424
+ * fall back to the default.
425
+ */
426
+ maxZipEntryBytes?: number;
427
+ }
420
428
 
421
429
  /**
422
430
  * Common load-time options shared by the docx / pptx / xlsx viewer
@@ -972,6 +980,12 @@ export declare interface XlsxViewerOptions {
972
980
  * privacy implications.
973
981
  */
974
982
  useGoogleFonts?: boolean;
983
+ /**
984
+ * Override the per-entry ZIP decompression cap (bytes) used by the
985
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Zero / negative
986
+ * values fall back to the default.
987
+ */
988
+ maxZipEntryBytes?: number;
975
989
  }
976
990
 
977
991
  export declare class XlsxWorkbook {
@@ -981,6 +995,7 @@ export declare class XlsxWorkbook {
981
995
  /** Cache of loaded images keyed by their data URL. Shared across sheets. */
982
996
  private imageCache;
983
997
  private rawData;
998
+ private maxZipEntryBytes;
984
999
  constructor();
985
1000
  load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<void>;
986
1001
  get sheetNames(): string[];