@silurus/ooxml 0.35.0 → 0.37.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-CLc84h6v.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-DdpPwDWz.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 };
@@ -336,9 +336,16 @@ declare interface LineSpacing {
336
336
  explicit?: boolean;
337
337
  }
338
338
 
339
- /** Options for {@link DocxDocument.load}. Re-exports the shared
339
+ /** Options for {@link DocxDocument.load}. Extends the shared
340
340
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
341
- 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
+ }
342
349
 
343
350
  /**
344
351
  * Common load-time options shared by the docx / pptx / xlsx viewer
@@ -957,6 +957,15 @@ declare interface ImageAnchor {
957
957
  toColOff: number;
958
958
  toRow: number;
959
959
  toRowOff: number;
960
+ /** `twoCellAnchor@editAs` (ECMA-376 §20.5.2.33). `"oneCell"` instructs the
961
+ * renderer to use `nativeExtCx`/`nativeExtCy` as the size and ignore the
962
+ * `to` anchor (Excel's "Move but don't size with cells"). Absent ⇒ default
963
+ * `"twoCell"`. */
964
+ editAs?: string;
965
+ /** `<xdr:pic><xdr:spPr><a:xfrm><a:ext cx cy>` in EMU — the picture's saved
966
+ * size. Authoritative when `editAs === "oneCell"`. 0 = unavailable. */
967
+ nativeExtCx: number;
968
+ nativeExtCy: number;
960
969
  /** Data URL (data:image/png;base64,...) */
961
970
  dataUrl: string;
962
971
  }
@@ -1028,9 +1037,18 @@ declare interface LineSpacing {
1028
1037
  explicit?: boolean;
1029
1038
  }
1030
1039
 
1031
- /** Options for {@link PptxPresentation.load}. Re-exports the shared
1040
+ /** Options for {@link PptxPresentation.load}. Extends the shared
1032
1041
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
1033
- declare type LoadOptions = LoadOptions_2;
1042
+ declare interface LoadOptions extends LoadOptions_2 {
1043
+ /**
1044
+ * Override the per-entry ZIP decompression cap (bytes). Defaults to
1045
+ * 512 MiB — matches `MAX_ZIP_ENTRY_BYTES` in the Rust parser. Raising
1046
+ * this past 4 GiB requires a 64-bit WASM build; lowering it makes the
1047
+ * loader reject otherwise-legitimate large media decks. Zero or
1048
+ * negative values fall back to the default.
1049
+ */
1050
+ maxZipEntryBytes?: number;
1051
+ }
1034
1052
 
1035
1053
  /**
1036
1054
  * Common load-time options shared by the docx / pptx / xlsx viewer
@@ -1054,13 +1072,28 @@ declare interface LoadOptions_2 {
1054
1072
  useGoogleFonts?: boolean;
1055
1073
  }
1056
1074
 
1057
- /** Options for {@link XlsxWorkbook.load}. Re-exports the shared
1075
+ /** Options for {@link XlsxWorkbook.load}. Extends the shared
1058
1076
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
1059
- declare type LoadOptions_3 = LoadOptions_2;
1077
+ declare interface LoadOptions_3 extends LoadOptions_2 {
1078
+ /**
1079
+ * Override the per-entry ZIP decompression cap (bytes) used by the
1080
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Applies to both
1081
+ * the initial workbook parse and per-sheet parse. Zero / negative values
1082
+ * fall back to the default.
1083
+ */
1084
+ maxZipEntryBytes?: number;
1085
+ }
1060
1086
 
1061
- /** Options for {@link DocxDocument.load}. Re-exports the shared
1087
+ /** Options for {@link DocxDocument.load}. Extends the shared
1062
1088
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
1063
- declare type LoadOptions_4 = LoadOptions_2;
1089
+ declare interface LoadOptions_4 extends LoadOptions_2 {
1090
+ /**
1091
+ * Override the per-entry ZIP decompression cap (bytes) used by the
1092
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Zero / negative
1093
+ * values fall back to the default.
1094
+ */
1095
+ maxZipEntryBytes?: number;
1096
+ }
1064
1097
 
1065
1098
  declare interface ManualLayout {
1066
1099
  xMode: string;
@@ -1440,6 +1473,13 @@ declare interface PptxViewerOptions extends RenderOptions {
1440
1473
  * default — see {@link PptxPresentation.load} for privacy implications.
1441
1474
  */
1442
1475
  useGoogleFonts?: boolean;
1476
+ /**
1477
+ * Override the per-entry ZIP decompression cap (bytes) used by the zip-bomb
1478
+ * guard in the Rust parser. Defaults to 512 MiB. Raise this to load decks
1479
+ * with very large embedded media, or lower it to tighten the budget for
1480
+ * untrusted input. Zero / negative values fall back to the default.
1481
+ */
1482
+ maxZipEntryBytes?: number;
1443
1483
  /**
1444
1484
  * Enable interactive audio/video playback. When true, slides are rendered
1445
1485
  * via {@link PptxPresentation.presentSlide} so media elements become
@@ -1695,6 +1735,15 @@ declare interface ShapeAnchor {
1695
1735
  toColOff: number;
1696
1736
  toRow: number;
1697
1737
  toRowOff: number;
1738
+ /** `twoCellAnchor@editAs` (ECMA-376 §20.5.2.33). With `"oneCell"` the
1739
+ * renderer uses `nativeExtCx`/`nativeExtCy` as the on-sheet size, since
1740
+ * Excel preserves the group's saved EMU extent regardless of cell
1741
+ * resizing ("Move but don't size with cells"). Absent ⇒ default `"twoCell"`. */
1742
+ editAs?: string;
1743
+ /** Saved EMU extent of the top-level grpSp (or the stand-alone sp/pic).
1744
+ * Authoritative when `editAs === "oneCell"`. 0 = unavailable. */
1745
+ nativeExtCx: number;
1746
+ nativeExtCy: number;
1698
1747
  shapes: ShapeInfo[];
1699
1748
  }
1700
1749
 
@@ -2518,6 +2567,12 @@ declare interface XlsxViewerOptions {
2518
2567
  * privacy implications.
2519
2568
  */
2520
2569
  useGoogleFonts?: boolean;
2570
+ /**
2571
+ * Override the per-entry ZIP decompression cap (bytes) used by the
2572
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Zero / negative
2573
+ * values fall back to the default.
2574
+ */
2575
+ maxZipEntryBytes?: number;
2521
2576
  }
2522
2577
 
2523
2578
  declare class XlsxWorkbook {
@@ -2527,6 +2582,7 @@ declare class XlsxWorkbook {
2527
2582
  /** Cache of loaded images keyed by their data URL. Shared across sheets. */
2528
2583
  private imageCache;
2529
2584
  private rawData;
2585
+ private maxZipEntryBytes;
2530
2586
  constructor();
2531
2587
  load(source: string | ArrayBuffer, opts?: LoadOptions_3): Promise<void>;
2532
2588
  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
@@ -401,6 +401,15 @@ declare interface ImageAnchor {
401
401
  toColOff: number;
402
402
  toRow: number;
403
403
  toRowOff: number;
404
+ /** `twoCellAnchor@editAs` (ECMA-376 §20.5.2.33). `"oneCell"` instructs the
405
+ * renderer to use `nativeExtCx`/`nativeExtCy` as the size and ignore the
406
+ * `to` anchor (Excel's "Move but don't size with cells"). Absent ⇒ default
407
+ * `"twoCell"`. */
408
+ editAs?: string;
409
+ /** `<xdr:pic><xdr:spPr><a:xfrm><a:ext cx cy>` in EMU — the picture's saved
410
+ * size. Authoritative when `editAs === "oneCell"`. 0 = unavailable. */
411
+ nativeExtCx: number;
412
+ nativeExtCy: number;
404
413
  /** Data URL (data:image/png;base64,...) */
405
414
  dataUrl: string;
406
415
  }
@@ -414,9 +423,17 @@ declare interface LegendManualLayout {
414
423
  h: number;
415
424
  }
416
425
 
417
- /** Options for {@link XlsxWorkbook.load}. Re-exports the shared
426
+ /** Options for {@link XlsxWorkbook.load}. Extends the shared
418
427
  * `LoadOptions` shape from `@silurus/ooxml-core`. */
419
- declare type LoadOptions = LoadOptions_2;
428
+ declare interface LoadOptions extends LoadOptions_2 {
429
+ /**
430
+ * Override the per-entry ZIP decompression cap (bytes) used by the
431
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Applies to both
432
+ * the initial workbook parse and per-sheet parse. Zero / negative values
433
+ * fall back to the default.
434
+ */
435
+ maxZipEntryBytes?: number;
436
+ }
420
437
 
421
438
  /**
422
439
  * Common load-time options shared by the docx / pptx / xlsx viewer
@@ -597,6 +614,15 @@ declare interface ShapeAnchor {
597
614
  toColOff: number;
598
615
  toRow: number;
599
616
  toRowOff: number;
617
+ /** `twoCellAnchor@editAs` (ECMA-376 §20.5.2.33). With `"oneCell"` the
618
+ * renderer uses `nativeExtCx`/`nativeExtCy` as the on-sheet size, since
619
+ * Excel preserves the group's saved EMU extent regardless of cell
620
+ * resizing ("Move but don't size with cells"). Absent ⇒ default `"twoCell"`. */
621
+ editAs?: string;
622
+ /** Saved EMU extent of the top-level grpSp (or the stand-alone sp/pic).
623
+ * Authoritative when `editAs === "oneCell"`. 0 = unavailable. */
624
+ nativeExtCx: number;
625
+ nativeExtCy: number;
600
626
  shapes: ShapeInfo[];
601
627
  }
602
628
 
@@ -972,6 +998,12 @@ export declare interface XlsxViewerOptions {
972
998
  * privacy implications.
973
999
  */
974
1000
  useGoogleFonts?: boolean;
1001
+ /**
1002
+ * Override the per-entry ZIP decompression cap (bytes) used by the
1003
+ * zip-bomb guard in the Rust parser. Defaults to 512 MiB. Zero / negative
1004
+ * values fall back to the default.
1005
+ */
1006
+ maxZipEntryBytes?: number;
975
1007
  }
976
1008
 
977
1009
  export declare class XlsxWorkbook {
@@ -981,6 +1013,7 @@ export declare class XlsxWorkbook {
981
1013
  /** Cache of loaded images keyed by their data URL. Shared across sheets. */
982
1014
  private imageCache;
983
1015
  private rawData;
1016
+ private maxZipEntryBytes;
984
1017
  constructor();
985
1018
  load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<void>;
986
1019
  get sheetNames(): string[];