pptx-react-viewer 1.1.3 → 1.1.5
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/index.js +1099 -384
- package/dist/index.mjs +1099 -385
- package/dist/pptx-viewer.css +1 -1
- package/dist/viewer/index.js +1117 -390
- package/dist/viewer/index.mjs +1117 -391
- package/node_modules/emf-converter/dist/index.d.mts +2 -2
- package/node_modules/emf-converter/dist/index.d.ts +2 -2
- package/node_modules/emf-converter/dist/index.js +91 -33
- package/node_modules/emf-converter/dist/index.mjs +91 -33
- package/node_modules/emf-converter/package.json +2 -2
- package/node_modules/mtx-decompressor/dist/index.js +39 -9
- package/node_modules/mtx-decompressor/dist/index.mjs +39 -9
- package/node_modules/mtx-decompressor/package.json +2 -2
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-BMjoxMDV.d.ts → SvgExporter-0TxiiorD.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{SvgExporter-z6AbXRQg.d.mts → SvgExporter-BQ4KbRO9.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/dist/cli/index.d.mts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.d.ts +2 -2
- package/node_modules/pptx-viewer-core/dist/cli/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/cli/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.d.mts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.d.ts +3 -3
- package/node_modules/pptx-viewer-core/dist/converter/index.js +0 -0
- package/node_modules/pptx-viewer-core/dist/converter/index.mjs +0 -0
- package/node_modules/pptx-viewer-core/dist/index.d.mts +786 -54
- package/node_modules/pptx-viewer-core/dist/index.d.ts +786 -54
- package/node_modules/pptx-viewer-core/dist/index.js +3589 -630
- package/node_modules/pptx-viewer-core/dist/index.mjs +3575 -630
- package/node_modules/pptx-viewer-core/dist/{presentation-CchuDGfU.d.mts → presentation-ArhfImJ5.d.mts} +225 -8
- package/node_modules/pptx-viewer-core/dist/{presentation-CchuDGfU.d.ts → presentation-ArhfImJ5.d.ts} +225 -8
- package/node_modules/pptx-viewer-core/dist/{signature-inspection-status-BcJSdOvb.d.mts → signature-inspection-status-BCUpfCQh.d.mts} +13 -2
- package/node_modules/pptx-viewer-core/dist/{signature-inspection-status-BcJSdOvb.d.ts → signature-inspection-status-BCUpfCQh.d.ts} +13 -2
- package/node_modules/pptx-viewer-core/dist/signature-node/index.d.mts +2 -2
- package/node_modules/pptx-viewer-core/dist/signature-node/index.d.ts +2 -2
- package/node_modules/pptx-viewer-core/dist/signature-node/index.js +17 -3
- package/node_modules/pptx-viewer-core/dist/signature-node/index.mjs +16 -4
- package/node_modules/pptx-viewer-core/dist/{text-operations-CeukUztU.d.mts → text-operations-CLj-sJyk.d.mts} +1 -1
- package/node_modules/pptx-viewer-core/dist/{text-operations-e7JxgI5l.d.ts → text-operations-rhJV-A_W.d.ts} +1 -1
- package/node_modules/pptx-viewer-core/package.json +5 -5
- package/package.json +22 -20
package/node_modules/pptx-viewer-core/dist/{presentation-CchuDGfU.d.ts → presentation-ArhfImJ5.d.ts}
RENAMED
|
@@ -426,6 +426,13 @@ interface TextStyle {
|
|
|
426
426
|
/** Whether the hyperlink target is an internal slide jump (targetSlideIndex style). */
|
|
427
427
|
hyperlinkTargetSlideIndex?: number;
|
|
428
428
|
color?: string;
|
|
429
|
+
/**
|
|
430
|
+
* Raw XML colour-choice node preserved from `a:rPr/a:solidFill` for
|
|
431
|
+
* round-trip serialisation. Captures `a:schemeClr` / `a:sysClr` /
|
|
432
|
+
* `a:prstClr` / `a:srgbClr` plus colour transforms. On save we re-emit
|
|
433
|
+
* verbatim when the resolved {@link color} still matches this node.
|
|
434
|
+
*/
|
|
435
|
+
colorXml?: XmlObject;
|
|
429
436
|
align?: 'left' | 'center' | 'right' | 'justify' | 'justLow' | 'dist' | 'thaiDist';
|
|
430
437
|
vAlign?: 'top' | 'middle' | 'bottom';
|
|
431
438
|
/** Right-to-left paragraph/run direction (`a:pPr/@rtl`, `a:rPr/@rtl`). */
|
|
@@ -524,6 +531,36 @@ interface TextStyle {
|
|
|
524
531
|
smartTagClean?: boolean;
|
|
525
532
|
/** Bookmark link target (`a:rPr/@bmk`). */
|
|
526
533
|
bookmark?: string;
|
|
534
|
+
/** Alternative language for the run (`a:rPr/@altLang`). Populated for runs
|
|
535
|
+
* authored in mixed-script documents (e.g. Asian/Latin combined). */
|
|
536
|
+
altLanguage?: string;
|
|
537
|
+
/** SmartTag (Office grammar tag) GUID id (`a:rPr/@smtId`). Round-tripped
|
|
538
|
+
* verbatim — the engine doesn't interpret it. */
|
|
539
|
+
smartTagId?: number;
|
|
540
|
+
/** Latin font PANOSE classification string from `a:rPr > a:latin/@panose`. */
|
|
541
|
+
latinFontPanose?: string;
|
|
542
|
+
/** Latin font pitch + family flag from `a:rPr > a:latin/@pitchFamily`. */
|
|
543
|
+
latinFontPitchFamily?: number;
|
|
544
|
+
/** Latin font character set id from `a:rPr > a:latin/@charset`. */
|
|
545
|
+
latinFontCharset?: number;
|
|
546
|
+
/** East-Asian font PANOSE from `a:rPr > a:ea/@panose`. */
|
|
547
|
+
eastAsiaFontPanose?: string;
|
|
548
|
+
/** East-Asian font pitch + family flag from `a:rPr > a:ea/@pitchFamily`. */
|
|
549
|
+
eastAsiaFontPitchFamily?: number;
|
|
550
|
+
/** East-Asian font character set id from `a:rPr > a:ea/@charset`. */
|
|
551
|
+
eastAsiaFontCharset?: number;
|
|
552
|
+
/** Complex-script font PANOSE from `a:rPr > a:cs/@panose`. */
|
|
553
|
+
complexScriptFontPanose?: string;
|
|
554
|
+
/** Complex-script font pitch + family flag from `a:rPr > a:cs/@pitchFamily`. */
|
|
555
|
+
complexScriptFontPitchFamily?: number;
|
|
556
|
+
/** Complex-script font character set id from `a:rPr > a:cs/@charset`. */
|
|
557
|
+
complexScriptFontCharset?: number;
|
|
558
|
+
/** Symbol-font PANOSE from `a:rPr > a:sym/@panose`. */
|
|
559
|
+
symbolFontPanose?: string;
|
|
560
|
+
/** Symbol-font pitch + family flag from `a:rPr > a:sym/@pitchFamily`. */
|
|
561
|
+
symbolFontPitchFamily?: number;
|
|
562
|
+
/** Symbol-font character set id from `a:rPr > a:sym/@charset`. */
|
|
563
|
+
symbolFontCharset?: number;
|
|
527
564
|
/** Paragraph list type for toggling bullet / numbered lists via the toolbar.
|
|
528
565
|
* - `'bullet'` — character bullet (default "•")
|
|
529
566
|
* - `'numbered'` — auto-numbered list (arabicPeriod)
|
|
@@ -671,6 +708,15 @@ interface BulletInfo {
|
|
|
671
708
|
imageRelId?: string;
|
|
672
709
|
/** Picture bullet: data URL of the embedded image. */
|
|
673
710
|
imageDataUrl?: string;
|
|
711
|
+
/** When true, `<a:buFontTx/>` was specified — inherit the bullet font from
|
|
712
|
+
* the run text, not from a buFont declaration. */
|
|
713
|
+
fontInherit?: boolean;
|
|
714
|
+
/** When true, `<a:buClrTx/>` was specified — inherit the bullet colour from
|
|
715
|
+
* the run text. */
|
|
716
|
+
colorInherit?: boolean;
|
|
717
|
+
/** When true, `<a:buSzTx/>` was specified — inherit the bullet size from
|
|
718
|
+
* the run text font size. */
|
|
719
|
+
sizeInherit?: boolean;
|
|
674
720
|
}
|
|
675
721
|
/**
|
|
676
722
|
* A single text run within a paragraph.
|
|
@@ -708,6 +754,22 @@ interface TextSegment {
|
|
|
708
754
|
isParagraphBreak?: boolean;
|
|
709
755
|
/** Structured bullet info for the first segment of a paragraph. */
|
|
710
756
|
bulletInfo?: BulletInfo;
|
|
757
|
+
/**
|
|
758
|
+
* Outline level for the paragraph this segment starts (`a:p/@lvl`).
|
|
759
|
+
*
|
|
760
|
+
* Only meaningful on the first segment of a paragraph (matching the
|
|
761
|
+
* convention used for {@link bulletInfo}). Stored as the raw OOXML
|
|
762
|
+
* value (0 = top level, 1-8 = nested) and serialised back when non-zero.
|
|
763
|
+
*/
|
|
764
|
+
paragraphLevel?: number;
|
|
765
|
+
/**
|
|
766
|
+
* Raw `a:endParaRPr` XML node for the paragraph this segment starts.
|
|
767
|
+
*
|
|
768
|
+
* Captured verbatim on parse so attributes and child colours/fonts that
|
|
769
|
+
* the typed model doesn't represent survive a round-trip. Only meaningful
|
|
770
|
+
* on the first segment of a paragraph.
|
|
771
|
+
*/
|
|
772
|
+
endParaRunProperties?: Record<string, unknown>;
|
|
711
773
|
/**
|
|
712
774
|
* Phonetic annotation text from `a:ruby > a:rt` (e.g. furigana, pinyin).
|
|
713
775
|
* When present, the renderer should wrap the base text with an HTML `<ruby>` tag.
|
|
@@ -787,6 +849,15 @@ interface TextSegment {
|
|
|
787
849
|
*/
|
|
788
850
|
interface ShapeStyle {
|
|
789
851
|
fillColor?: string;
|
|
852
|
+
/**
|
|
853
|
+
* Raw XML colour-choice node preserved from `a:solidFill` for round-trip
|
|
854
|
+
* serialisation. Captures `a:schemeClr` / `a:sysClr` / `a:prstClr` /
|
|
855
|
+
* `a:srgbClr` plus colour transforms (`lumMod`, `lumOff`, `tint`,
|
|
856
|
+
* `shade`, `satMod`, `alpha`, …). On save we re-emit verbatim when the
|
|
857
|
+
* resolved {@link fillColor} still matches this node, otherwise we fall
|
|
858
|
+
* back to canonical `<a:srgbClr>`.
|
|
859
|
+
*/
|
|
860
|
+
fillColorXml?: XmlObject;
|
|
790
861
|
fillGradient?: string;
|
|
791
862
|
fillMode?: 'solid' | 'gradient' | 'pattern' | 'none' | 'image' | 'theme' | 'group';
|
|
792
863
|
fillPatternPreset?: string;
|
|
@@ -825,13 +896,30 @@ interface ShapeStyle {
|
|
|
825
896
|
r: number;
|
|
826
897
|
b: number;
|
|
827
898
|
};
|
|
899
|
+
/** Gradient tile flip mode (`a:gradFill/@flip`).
|
|
900
|
+
* `none` = no tiling flip (default), `x|y|xy` = mirror in the named axis. */
|
|
901
|
+
fillGradientFlip?: 'none' | 'x' | 'y' | 'xy';
|
|
902
|
+
/** Whether the gradient rotates with the shape (`a:gradFill/@rotWithShape`).
|
|
903
|
+
* Defaults to true per the schema; preserved for round-trip when the source
|
|
904
|
+
* authored the attribute explicitly. */
|
|
905
|
+
fillGradientRotWithShape?: boolean;
|
|
906
|
+
/** Whether the linear gradient is scaled to the shape (`a:lin/@scaled`).
|
|
907
|
+
* Defaults to true per the schema; preserved for round-trip. */
|
|
908
|
+
fillGradientScaled?: boolean;
|
|
828
909
|
fillOpacity?: number;
|
|
829
910
|
strokeColor?: string;
|
|
911
|
+
/**
|
|
912
|
+
* Raw XML colour-choice node preserved from `a:ln/a:solidFill` for
|
|
913
|
+
* round-trip serialisation. See {@link fillColorXml} for the rationale.
|
|
914
|
+
*/
|
|
915
|
+
strokeColorXml?: XmlObject;
|
|
830
916
|
strokeWidth?: number;
|
|
831
917
|
strokeOpacity?: number;
|
|
832
918
|
strokeDash?: StrokeDashType;
|
|
833
919
|
/** Line join style (`a:ln/@join`): round, bevel, or miter. */
|
|
834
920
|
lineJoin?: 'round' | 'bevel' | 'miter';
|
|
921
|
+
/** Miter limit (`a:miter/@lim`) in EMU-percent units (default 800000 = 8.0). Only meaningful when lineJoin is 'miter'. */
|
|
922
|
+
miterLimit?: number;
|
|
835
923
|
/** Line cap style (`a:ln/@cap`): flat, rnd, or sq. */
|
|
836
924
|
lineCap?: 'flat' | 'rnd' | 'sq';
|
|
837
925
|
/** Compound line type (`a:ln/@cmpd`). */
|
|
@@ -849,6 +937,34 @@ interface ShapeStyle {
|
|
|
849
937
|
shadowDistance?: number;
|
|
850
938
|
/** Whether shadow rotates with shape. Parsed from `@_rotWithShape`. */
|
|
851
939
|
shadowRotateWithShape?: boolean;
|
|
940
|
+
/** Outer-shadow horizontal scaling (`a:outerShdw/@sx`) in 1000ths of a percent (default 100000 = 100%). */
|
|
941
|
+
shadowScaleX?: number;
|
|
942
|
+
/** Outer-shadow vertical scaling (`a:outerShdw/@sy`). */
|
|
943
|
+
shadowScaleY?: number;
|
|
944
|
+
/** Outer-shadow horizontal skew (`a:outerShdw/@kx`) in 60000ths of a degree. */
|
|
945
|
+
shadowSkewX?: number;
|
|
946
|
+
/** Outer-shadow vertical skew (`a:outerShdw/@ky`). */
|
|
947
|
+
shadowSkewY?: number;
|
|
948
|
+
/** Outer-shadow alignment (`a:outerShdw/@algn`). */
|
|
949
|
+
shadowAlignment?: 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
|
|
950
|
+
/** Inner-shadow rotateWithShape (`a:innerShdw/@rotWithShape`). */
|
|
951
|
+
innerShadowRotateWithShape?: boolean;
|
|
952
|
+
/** Reflection fade direction (`a:reflection/@fadeDir`) in 60000ths of a degree. */
|
|
953
|
+
reflectionFadeDirection?: number;
|
|
954
|
+
/** Reflection horizontal scaling (`a:reflection/@sx`). */
|
|
955
|
+
reflectionScaleX?: number;
|
|
956
|
+
/** Reflection vertical scaling (`a:reflection/@sy`). */
|
|
957
|
+
reflectionScaleY?: number;
|
|
958
|
+
/** Reflection horizontal skew (`a:reflection/@kx`). */
|
|
959
|
+
reflectionSkewX?: number;
|
|
960
|
+
/** Reflection vertical skew (`a:reflection/@ky`). */
|
|
961
|
+
reflectionSkewY?: number;
|
|
962
|
+
/** Reflection alignment (`a:reflection/@algn`). */
|
|
963
|
+
reflectionAlignment?: 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';
|
|
964
|
+
/** Reflection rotateWithShape (`a:reflection/@rotWithShape`). */
|
|
965
|
+
reflectionRotateWithShape?: boolean;
|
|
966
|
+
/** Reflection start position (`a:reflection/@stPos`) as 0-1 fraction. */
|
|
967
|
+
reflectionStartPosition?: number;
|
|
852
968
|
/** Multiple shadow layers (for advanced effects). */
|
|
853
969
|
shadows?: ShadowEffect[];
|
|
854
970
|
glowColor?: string;
|
|
@@ -951,6 +1067,22 @@ interface ShapeStyle {
|
|
|
951
1067
|
};
|
|
952
1068
|
/** Fill overlay blend mode from effectDag `a:fillOverlay/@blend`. */
|
|
953
1069
|
dagFillOverlayBlend?: 'over' | 'mult' | 'screen' | 'darken' | 'lighten';
|
|
1070
|
+
/** `<a:lnRef @idx>` — 1-based index into the theme's lnStyleLst. */
|
|
1071
|
+
lnRefIdx?: number;
|
|
1072
|
+
/** Raw XML colour child of `<a:lnRef>` (e.g. `<a:schemeClr>` with transforms). */
|
|
1073
|
+
lnRefColorXml?: XmlObject;
|
|
1074
|
+
/** `<a:fillRef @idx>` — 1-based index into fillStyleLst (1-3) or bgFillStyleLst (1001-1003). */
|
|
1075
|
+
fillRefIdx?: number;
|
|
1076
|
+
/** Raw XML colour child of `<a:fillRef>`. */
|
|
1077
|
+
fillRefColorXml?: XmlObject;
|
|
1078
|
+
/** `<a:effectRef @idx>` — 1-based index into the theme's effectStyleLst. */
|
|
1079
|
+
effectRefIdx?: number;
|
|
1080
|
+
/** Raw XML colour child of `<a:effectRef>`. */
|
|
1081
|
+
effectRefColorXml?: XmlObject;
|
|
1082
|
+
/** `<a:fontRef @idx>` — typically `major`, `minor`, or `none`. */
|
|
1083
|
+
fontRefIdx?: string;
|
|
1084
|
+
/** Raw XML colour child of `<a:fontRef>`. */
|
|
1085
|
+
fontRefColorXml?: XmlObject;
|
|
954
1086
|
}
|
|
955
1087
|
|
|
956
1088
|
/**
|
|
@@ -1187,6 +1319,27 @@ interface CustomGeometryPath {
|
|
|
1187
1319
|
height: number;
|
|
1188
1320
|
/** Ordered list of drawing segments. */
|
|
1189
1321
|
segments: CustomGeometrySegment[];
|
|
1322
|
+
/** Path fill mode (`a:path/@fill`): norm, lighten, lightenLess, darken, darkenLess, none. */
|
|
1323
|
+
fillMode?: 'norm' | 'lighten' | 'lightenLess' | 'darken' | 'darkenLess' | 'none';
|
|
1324
|
+
/** Whether the path is stroked (`a:path/@stroke`). */
|
|
1325
|
+
stroke?: boolean;
|
|
1326
|
+
/** 3D extrusion compatibility (`a:path/@extrusionOk`). */
|
|
1327
|
+
extrusionOk?: boolean;
|
|
1328
|
+
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Auxiliary raw XML preserved from `a:custGeom` for round-trip serialization.
|
|
1331
|
+
* These are stored opaquely so adjustment guides, handles, connection sites,
|
|
1332
|
+
* and the text rectangle are not lost when a custGeom is edited and saved.
|
|
1333
|
+
*/
|
|
1334
|
+
interface CustomGeometryRawData {
|
|
1335
|
+
/** Raw `a:gdLst` XML content (guide list). */
|
|
1336
|
+
gdLstXml?: unknown;
|
|
1337
|
+
/** Raw `a:ahLst` XML content (adjustment handles). */
|
|
1338
|
+
ahLstXml?: unknown;
|
|
1339
|
+
/** Raw `a:cxnLst` XML content (connection sites). */
|
|
1340
|
+
cxnLstXml?: unknown;
|
|
1341
|
+
/** Raw `a:rect` XML content (text rectangle). */
|
|
1342
|
+
rectXml?: unknown;
|
|
1190
1343
|
}
|
|
1191
1344
|
/**
|
|
1192
1345
|
* Custom (non-preset) geometry path — only on shapes and pictures.
|
|
@@ -1213,6 +1366,8 @@ interface PptxCustomPathProperties {
|
|
|
1213
1366
|
pathHeight?: number;
|
|
1214
1367
|
/** Structured custom geometry paths for editing (maps to a:custGeom/a:pathLst). */
|
|
1215
1368
|
customGeometryPaths?: CustomGeometryPath[];
|
|
1369
|
+
/** Raw a:gdLst/a:ahLst/a:cxnLst/a:rect XML preserved for round-trip serialization. */
|
|
1370
|
+
customGeometryRawData?: CustomGeometryRawData;
|
|
1216
1371
|
}
|
|
1217
1372
|
|
|
1218
1373
|
/**
|
|
@@ -1416,6 +1571,12 @@ interface PptxChartAxisFormatting {
|
|
|
1416
1571
|
logScale?: boolean;
|
|
1417
1572
|
/** Logarithmic base value (c:scaling/c:logBase/@val), typically 10 or e. */
|
|
1418
1573
|
logBase?: number;
|
|
1574
|
+
/** Major-unit interval between primary tick marks (c:majorUnit/@val). */
|
|
1575
|
+
majorUnit?: number;
|
|
1576
|
+
/** Minor-unit interval between secondary tick marks (c:minorUnit/@val). */
|
|
1577
|
+
minorUnit?: number;
|
|
1578
|
+
/** Tick-label position (c:tickLblPos/@val): 'high', 'low', 'nextTo', or 'none'. */
|
|
1579
|
+
tickLblPos?: 'high' | 'low' | 'nextTo' | 'none';
|
|
1419
1580
|
}
|
|
1420
1581
|
/** 3D wall or floor element formatting. */
|
|
1421
1582
|
interface PptxChart3DSurface {
|
|
@@ -1878,7 +2039,20 @@ interface PptxTableCellStyle {
|
|
|
1878
2039
|
italic?: boolean;
|
|
1879
2040
|
underline?: boolean;
|
|
1880
2041
|
color?: string;
|
|
2042
|
+
/**
|
|
2043
|
+
* Raw XML colour-choice node preserved from `a:tc/a:txBody/.../a:rPr/a:solidFill`
|
|
2044
|
+
* for round-trip serialisation. Currently unused by the cell-level writer
|
|
2045
|
+
* (cell text colour falls through `writeCellTextFormatting`), reserved for
|
|
2046
|
+
* future expansion alongside the run-properties round-trip path.
|
|
2047
|
+
*/
|
|
2048
|
+
colorXml?: XmlObject;
|
|
1881
2049
|
backgroundColor?: string;
|
|
2050
|
+
/**
|
|
2051
|
+
* Raw XML colour-choice node preserved from cell `a:tcPr/a:solidFill` for
|
|
2052
|
+
* round-trip serialisation. Re-emitted verbatim when the resolved
|
|
2053
|
+
* {@link backgroundColor} still matches the original colour.
|
|
2054
|
+
*/
|
|
2055
|
+
backgroundColorXml?: XmlObject;
|
|
1882
2056
|
borderColor?: string;
|
|
1883
2057
|
/** Top border width in px. */
|
|
1884
2058
|
borderTopWidth?: number;
|
|
@@ -3559,6 +3733,14 @@ interface PptxThemeFontGroup {
|
|
|
3559
3733
|
latin?: string;
|
|
3560
3734
|
eastAsia?: string;
|
|
3561
3735
|
complexScript?: string;
|
|
3736
|
+
/**
|
|
3737
|
+
* Per-script typeface overrides (`<a:font script="Hans|Hant|Arab|Hebr|
|
|
3738
|
+
* Thai|Beng|Gujr|Khmr|Knda|…"/>` per ECMA-376 §20.1.4.1.16). Keyed by
|
|
3739
|
+
* the four-letter ISO 15924 script tag from the `script` attribute.
|
|
3740
|
+
*
|
|
3741
|
+
* Phase 4 Stream A / M4.
|
|
3742
|
+
*/
|
|
3743
|
+
byScript?: Record<string, string>;
|
|
3562
3744
|
}
|
|
3563
3745
|
/**
|
|
3564
3746
|
* Theme font scheme — major (headings) and minor (body) font families.
|
|
@@ -3758,6 +3940,22 @@ interface PptxTheme {
|
|
|
3758
3940
|
/** Format scheme — fill, line, effect and background fill style matrices. */
|
|
3759
3941
|
formatScheme?: PptxThemeFormatScheme;
|
|
3760
3942
|
}
|
|
3943
|
+
/**
|
|
3944
|
+
* Snapshot of `<a:objectDefaults>` (ECMA-376 §20.1.6.7). Each child
|
|
3945
|
+
* (`spDef`, `lnDef`, `txDef`) carries `<a:spPr>`, `<a:bodyPr>`,
|
|
3946
|
+
* `<a:lstStyle>`, `<a:style>`. We capture them as raw parser objects so
|
|
3947
|
+
* round-trip is byte-stable regardless of schema-walking depth.
|
|
3948
|
+
*
|
|
3949
|
+
* Phase 4 Stream A / M5.
|
|
3950
|
+
*/
|
|
3951
|
+
interface PptxThemeObjectDefaults {
|
|
3952
|
+
/** Raw `<a:spDef>` parser object, or `undefined` if absent. */
|
|
3953
|
+
spDef?: unknown;
|
|
3954
|
+
/** Raw `<a:lnDef>` parser object, or `undefined` if absent. */
|
|
3955
|
+
lnDef?: unknown;
|
|
3956
|
+
/** Raw `<a:txDef>` parser object, or `undefined` if absent. */
|
|
3957
|
+
txDef?: unknown;
|
|
3958
|
+
}
|
|
3761
3959
|
|
|
3762
3960
|
/**
|
|
3763
3961
|
* Master and layout types: notes master, handout master, slide master,
|
|
@@ -3793,6 +3991,8 @@ interface PptxNotesMaster {
|
|
|
3793
3991
|
}>;
|
|
3794
3992
|
/** Editable elements on the notes master (header, footer, date, page number, slide image, notes body). */
|
|
3795
3993
|
elements?: PptxElement[];
|
|
3994
|
+
/** Header/footer flags from `<p:hf>` on the notes master (P-H3). */
|
|
3995
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
3796
3996
|
}
|
|
3797
3997
|
/**
|
|
3798
3998
|
* Parsed handout master from `ppt/handoutMasters/handoutMaster1.xml`.
|
|
@@ -3822,6 +4022,8 @@ interface PptxHandoutMaster {
|
|
|
3822
4022
|
elements?: PptxElement[];
|
|
3823
4023
|
/** Number of slides per page for handout print layout (1, 2, 3, 4, 6, or 9). */
|
|
3824
4024
|
slidesPerPage?: number;
|
|
4025
|
+
/** Header/footer flags from `<p:hf>` on the handout master (P-H3). */
|
|
4026
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
3825
4027
|
}
|
|
3826
4028
|
/**
|
|
3827
4029
|
* Active tab within the master view sidebar.
|
|
@@ -3871,6 +4073,8 @@ interface PptxSlideMaster {
|
|
|
3871
4073
|
layouts?: PptxSlideLayout[];
|
|
3872
4074
|
/** Text styles from `p:txStyles` — title, body, and other text defaults. */
|
|
3873
4075
|
txStyles?: PptxMasterTextStyles;
|
|
4076
|
+
/** Header/footer flags from `<p:hf>` on this master (P-H3). */
|
|
4077
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
3874
4078
|
}
|
|
3875
4079
|
/**
|
|
3876
4080
|
* Per-level paragraph properties for a text style category.
|
|
@@ -3889,6 +4093,22 @@ interface PptxMasterTextStyles {
|
|
|
3889
4093
|
/** Other text style (`p:otherStyle`). */
|
|
3890
4094
|
otherStyle?: PptxTextStyleLevels;
|
|
3891
4095
|
}
|
|
4096
|
+
/**
|
|
4097
|
+
* Per-part header/footer flags from `<p:hf>` (CT_HeaderFooter, ECMA-376
|
|
4098
|
+
* §19.3.1.21). Defaults are "all true" — fields are only set on the typed
|
|
4099
|
+
* model when they were explicitly read, so callers can distinguish "unset"
|
|
4100
|
+
* (preserve original XML) from "false" (override).
|
|
4101
|
+
*/
|
|
4102
|
+
interface PptxHeaderFooterFlags {
|
|
4103
|
+
/** `@hdr` — show header placeholder. Spec default: `true`. */
|
|
4104
|
+
hasHeader?: boolean;
|
|
4105
|
+
/** `@ftr` — show footer placeholder. Spec default: `true`. */
|
|
4106
|
+
hasFooter?: boolean;
|
|
4107
|
+
/** `@dt` — show date/time placeholder. Spec default: `true`. */
|
|
4108
|
+
hasDateTime?: boolean;
|
|
4109
|
+
/** `@sldNum` — show slide-number placeholder. Spec default: `true`. */
|
|
4110
|
+
hasSlideNumber?: boolean;
|
|
4111
|
+
}
|
|
3892
4112
|
/**
|
|
3893
4113
|
* A slide layout associated with a slide master.
|
|
3894
4114
|
*
|
|
@@ -3927,6 +4147,8 @@ interface PptxSlideLayout {
|
|
|
3927
4147
|
userDrawn?: boolean;
|
|
3928
4148
|
/** Colour map override from `p:clrMapOvr`. */
|
|
3929
4149
|
clrMapOverride?: Record<string, string>;
|
|
4150
|
+
/** Header/footer flags from `<p:hf>` on this layout (P-H3). */
|
|
4151
|
+
headerFooter?: PptxHeaderFooterFlags;
|
|
3930
4152
|
}
|
|
3931
4153
|
/**
|
|
3932
4154
|
* A theme part available in the presentation package.
|
|
@@ -4044,13 +4266,6 @@ interface PptxViewProperties {
|
|
|
4044
4266
|
rawXml?: Record<string, unknown>;
|
|
4045
4267
|
}
|
|
4046
4268
|
|
|
4047
|
-
/**
|
|
4048
|
-
* Top-level presentation types: slides, canvas dimensions, export options,
|
|
4049
|
-
* and the root {@link PptxData} structure returned by `PptxHandlerCore.load()`.
|
|
4050
|
-
*
|
|
4051
|
-
* @module pptx-types/presentation
|
|
4052
|
-
*/
|
|
4053
|
-
|
|
4054
4269
|
/**
|
|
4055
4270
|
* A customer data reference from `p:custDataLst / p:custData`.
|
|
4056
4271
|
*
|
|
@@ -4145,6 +4360,8 @@ interface PptxSlide {
|
|
|
4145
4360
|
customerData?: PptxCustomerData[];
|
|
4146
4361
|
/** ActiveX control references from `p:controls` on this slide. */
|
|
4147
4362
|
activeXControls?: PptxActiveXControl[];
|
|
4363
|
+
/** Per-slide header/footer flags from `<p:hf>` (P-H3). */
|
|
4364
|
+
headerFooterFlags?: PptxHeaderFooterFlags;
|
|
4148
4365
|
}
|
|
4149
4366
|
/**
|
|
4150
4367
|
* A slide layout available in the loaded presentation.
|
|
@@ -4577,4 +4794,4 @@ interface PptxEmbeddedFont {
|
|
|
4577
4794
|
originalPartBytes?: Uint8Array;
|
|
4578
4795
|
}
|
|
4579
4796
|
|
|
4580
|
-
export { type OleObjectType as $, type PptxTagCollection as A, type PptxPhotoAlbum as B, type ConnectorPptxElement as C, type PptxKinsoku as D, type PptxModifyVerifier as E, type PptxViewProperties as F, type PptxEmbeddedFont as G, type PptxExportOptions as H, type InkPptxElement as I, type PptxThemeFormatScheme as J, type TextSegment as K, type PptxComment as L, type PptxSlideTransition as M, type PptxElementAnimation as N, type PptxNativeAnimation as O, type PptxElement as P, type PptxCustomerData as Q, type PptxActiveXControl as R, type ShapePptxElement as S, type TextPptxElement as T, type AnimationCondition as U, type ShapeStyle as V, type TextStyle as W, type XmlObject as X, type ElementAction as Y, type ZoomPptxElement as Z, type PptxAction as _, type PptxElementWithShapeStyle as a, type
|
|
4797
|
+
export { type OleObjectType as $, type PptxTagCollection as A, type PptxPhotoAlbum as B, type ConnectorPptxElement as C, type PptxKinsoku as D, type PptxModifyVerifier as E, type PptxViewProperties as F, type PptxEmbeddedFont as G, type PptxExportOptions as H, type InkPptxElement as I, type PptxThemeFormatScheme as J, type TextSegment as K, type PptxComment as L, type PptxSlideTransition as M, type PptxElementAnimation as N, type PptxNativeAnimation as O, type PptxElement as P, type PptxCustomerData as Q, type PptxActiveXControl as R, type ShapePptxElement as S, type TextPptxElement as T, type AnimationCondition as U, type ShapeStyle as V, type TextStyle as W, type XmlObject as X, type ElementAction as Y, type ZoomPptxElement as Z, type PptxAction as _, type PptxElementWithShapeStyle as a, type MaterialPresetType as a$, type PptxSmartArtNode as a0, type SmartArtLayoutType as a1, type PptxSmartArtDrawingShape as a2, type PptxChartDataTable as a3, type PptxChartLineStyle as a4, type PptxChartErrBars as a5, type PptxChartTrendline as a6, type PptxChartMarker as a7, type PptxChartDataLabel as a8, type PptxChartDataPoint as a9, type PptxChartSeries as aA, type SmartArtPptxElement as aB, type GeometryAdjustmentHandle as aC, type CustomGeometryRawData as aD, type CustomGeometryPath as aE, type BulletInfo as aF, type PptxShapeLocks as aG, type PptxTextStyleLevels as aH, type PptxThemeFillStyle as aI, type PptxThemeLineStyle as aJ, type PptxThemeEffectStyle as aK, type PptxSmartArtChrome as aL, type PptxSmartArtColorTransform as aM, type PptxSmartArtQuickStyle as aN, type PptxExternalData as aO, type CustomGeometryPoint as aP, type ChartPptxElement as aQ, type ImagePptxElement as aR, type ActionButtonPreset as aS, type AnimationConditionEvent as aT, type BevelPresetType as aU, type ConnectorConnectionPoint as aV, type ContentPartInkStroke as aW, type ContentPartPptxElement as aX, type CustomGeometrySegment as aY, type ElementActionType as aZ, type MasterViewTab as a_, type PptxChartShapeProps as aa, type PptxChart3DSurface as ab, type PptxChartAxisFormatting as ac, type PptxEmbeddedWorkbookData as ad, type PptxDrawingGuide as ae, type PptxTableCellStyle as af, type PptxCustomXmlPart as ag, type PptxCommentAuthor as ah, type MediaPptxElement as ai, type PptxTableData as aj, type PptxTheme as ak, type ParsedTableStyleMap as al, type PptxSlideMaster as am, type PptxThemeOption as an, type PlaceholderDefaults as ao, type PptxMasterTextStyles as ap, type PptxThemeObjectDefaults as aq, type ParsedTableStyleFill as ar, type ParsedTableStyleText as as, type PptxImageEffects as at, type MediaBookmark as au, type PptxChartStyle as av, type TablePptxElement as aw, type OlePptxElement as ax, type GroupPptxElement as ay, type PlaceholderTextLevelStyle as az, type PptxElementWithText as b, type MediaCaptionTrack as b0, type MediaMetadata as b1, type Model3DPptxElement as b2, type ParsedTableStyleEntry as b3, type PicturePptxElement as b4, type Pptx3DScene as b5, type Pptx3DShape as b6, type PptxAfterAnimationAction as b7, type PptxAnimationDirection as b8, type PptxAnimationIterate as b9, type PptxStripDirection as bA, type PptxTableCell as bB, type PptxTableRow as bC, type PptxTag as bD, type PptxTextAnimationTarget as bE, type PptxTextBuildType as bF, type PptxTextProperties as bG, type PptxTextWarpPreset as bH, type PptxThemeFontGroup as bI, type PptxTransitionDirection4 as bJ, type PptxTransitionDirection8 as bK, type PptxViewOrigin as bL, type PptxViewScale as bM, type ShadowEffect as bN, type SmartArtColorScheme as bO, type SmartArtLayout as bP, type SmartArtStyle as bQ, THEME_COLOR_SCHEME_KEYS as bR, TRANSITION_VALID_DIRECTIONS as bS, type Text3DStyle as bT, type UnderlineStyle as bU, type UnknownPptxElement as bV, type PptxAnimationRepeatMode as ba, type PptxAnimationSequence as bb, type PptxAnimationTimingCurve as bc, type PptxChartAxisNumFmt as bd, type PptxChartErrBarDir as be, type PptxChartErrBarType as bf, type PptxChartErrValType as bg, type PptxChartMarkerSymbol as bh, type PptxChartTrendlineType as bi, type PptxColorAnimation as bj, type PptxCommonSlideViewProperties as bk, type PptxCropShape as bl, type PptxCustomPathProperties as bm, type PptxElementBase as bn, type PptxElementType as bo, type PptxExportFormat as bp, type PptxHeaderFooterFlags as bq, type PptxImageProperties as br, type PptxMediaType as bs, type PptxNormalViewProperties as bt, type PptxRestoredRegion as bu, type PptxShapeProperties as bv, type PptxSlideLayout as bw, type PptxSmartArtConnection as bx, type PptxSplitDirection as by, type PptxSplitOrientation as bz, type PptxImageLikeElement as c, type PptxThemeColorScheme as d, type PptxThemeFontScheme as e, type PptxAnimationPreset as f, type PptxAnimationTrigger as g, type StrokeDashType as h, type ConnectorArrowType as i, type PptxTransitionType as j, type PptxChartType as k, type PptxSlide as l, type PptxData as m, type PptxCompatibilityWarning as n, type PptxLayoutOption as o, type PptxChartData as p, type PptxSmartArtData as q, type PptxHeaderFooter as r, type PptxPresentationProperties as s, type PptxCustomShow as t, type PptxSection as u, type PptxCoreProperties as v, type PptxAppProperties as w, type PptxCustomProperty as x, type PptxNotesMaster as y, type PptxHandoutMaster as z };
|
|
@@ -136,8 +136,19 @@ interface OfficeSignatureReference {
|
|
|
136
136
|
* These functions operate on raw XML strings without requiring a DOM parser,
|
|
137
137
|
* making them platform-agnostic (browser + Node).
|
|
138
138
|
*/
|
|
139
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Escape special characters in an XML attribute value.
|
|
141
|
+
* Handles `&`, `<`, `>`, `"`, and `'` so the result is safe inside both
|
|
142
|
+
* double- and single-quoted attributes.
|
|
143
|
+
*/
|
|
140
144
|
declare function escapeXmlAttr(value: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* Escape special characters in XML text content.
|
|
147
|
+
* Only `&`, `<`, and `>` need escaping outside of attribute values.
|
|
148
|
+
*/
|
|
149
|
+
declare function escapeXmlText(value: string): string;
|
|
150
|
+
/** Validate that `value` only contains characters from the standard base64 alphabet. */
|
|
151
|
+
declare function isValidBase64(value: string): boolean;
|
|
141
152
|
/**
|
|
142
153
|
* Extract an attribute value from the first matching XML tag via regex.
|
|
143
154
|
* Namespace prefixes on the tag name are supported via the pattern.
|
|
@@ -206,4 +217,4 @@ declare function computeDetailStatus(detail: Pick<SignatureDetail, 'signatureVal
|
|
|
206
217
|
*/
|
|
207
218
|
declare function computeVerificationStatus(details: SignatureDetail[]): DigitalSignatureReport['verificationStatus'];
|
|
208
219
|
|
|
209
|
-
export {
|
|
220
|
+
export { extractTagAttribute as A, isValidBase64 as B, type CertificateRevocationStatus as C, DIGEST_ALGORITHM_TO_HASH as D, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV as E, normalizePartPath as F, resolveReferenceUriToPart as G, type LoadedSigningMaterial as L, OPC_RELATIONSHIP_TRANSFORM as O, PPTX_VIEWER_MANIFEST_NS as P, type ReferenceTransformResult as R, SUPPORTED_XML_CANON_TRANSFORMS as S, type TimestampAuthorityStatus as T, XMLDSIG_NS as X, DIGEST_ALGORITHM_TO_WEB_CRYPTO as a, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE as b, DIGITAL_SIGNATURE_REL_TYPE as c, type DigitalSignatureReport as d, type DigitalSignatureVerificationStatus as e, ENTERPRISE_REQUIRE_REVOCATION_ENV as f, ENTERPRISE_REQUIRE_TIMESTAMP_ENV as g, ENTERPRISE_TRUST_ROOTS_FILE_ENV as h, ENTERPRISE_TRUST_ROOTS_PEM_ENV as i, type OfficeSignatureReference as j, type ParsedReferenceTransform as k, type SignOptions as l, type SignResult as m, type SignatureDetail as n, type SignatureDetailStatus as o, type SignatureCertificateInfo as p, type SignatureReferenceCheck as q, type SignatureValidationPolicy as r, XML_TRANSFORM_ENVELOPED_SIGNATURE as s, computeDetailStatus as t, computeDigestBase64 as u, computeVerificationStatus as v, escapeXmlAttr as w, escapeXmlText as x, extractAllTagText as y, extractFirstTagText as z };
|
|
@@ -136,8 +136,19 @@ interface OfficeSignatureReference {
|
|
|
136
136
|
* These functions operate on raw XML strings without requiring a DOM parser,
|
|
137
137
|
* making them platform-agnostic (browser + Node).
|
|
138
138
|
*/
|
|
139
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Escape special characters in an XML attribute value.
|
|
141
|
+
* Handles `&`, `<`, `>`, `"`, and `'` so the result is safe inside both
|
|
142
|
+
* double- and single-quoted attributes.
|
|
143
|
+
*/
|
|
140
144
|
declare function escapeXmlAttr(value: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* Escape special characters in XML text content.
|
|
147
|
+
* Only `&`, `<`, and `>` need escaping outside of attribute values.
|
|
148
|
+
*/
|
|
149
|
+
declare function escapeXmlText(value: string): string;
|
|
150
|
+
/** Validate that `value` only contains characters from the standard base64 alphabet. */
|
|
151
|
+
declare function isValidBase64(value: string): boolean;
|
|
141
152
|
/**
|
|
142
153
|
* Extract an attribute value from the first matching XML tag via regex.
|
|
143
154
|
* Namespace prefixes on the tag name are supported via the pattern.
|
|
@@ -206,4 +217,4 @@ declare function computeDetailStatus(detail: Pick<SignatureDetail, 'signatureVal
|
|
|
206
217
|
*/
|
|
207
218
|
declare function computeVerificationStatus(details: SignatureDetail[]): DigitalSignatureReport['verificationStatus'];
|
|
208
219
|
|
|
209
|
-
export {
|
|
220
|
+
export { extractTagAttribute as A, isValidBase64 as B, type CertificateRevocationStatus as C, DIGEST_ALGORITHM_TO_HASH as D, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV as E, normalizePartPath as F, resolveReferenceUriToPart as G, type LoadedSigningMaterial as L, OPC_RELATIONSHIP_TRANSFORM as O, PPTX_VIEWER_MANIFEST_NS as P, type ReferenceTransformResult as R, SUPPORTED_XML_CANON_TRANSFORMS as S, type TimestampAuthorityStatus as T, XMLDSIG_NS as X, DIGEST_ALGORITHM_TO_WEB_CRYPTO as a, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE as b, DIGITAL_SIGNATURE_REL_TYPE as c, type DigitalSignatureReport as d, type DigitalSignatureVerificationStatus as e, ENTERPRISE_REQUIRE_REVOCATION_ENV as f, ENTERPRISE_REQUIRE_TIMESTAMP_ENV as g, ENTERPRISE_TRUST_ROOTS_FILE_ENV as h, ENTERPRISE_TRUST_ROOTS_PEM_ENV as i, type OfficeSignatureReference as j, type ParsedReferenceTransform as k, type SignOptions as l, type SignResult as m, type SignatureDetail as n, type SignatureDetailStatus as o, type SignatureCertificateInfo as p, type SignatureReferenceCheck as q, type SignatureValidationPolicy as r, XML_TRANSFORM_ENVELOPED_SIGNATURE as s, computeDetailStatus as t, computeDigestBase64 as u, computeVerificationStatus as v, escapeXmlAttr as w, escapeXmlText as x, extractAllTagText as y, extractFirstTagText as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as SignatureCertificateInfo, L as LoadedSigningMaterial, C as CertificateRevocationStatus, T as TimestampAuthorityStatus, r as SignatureValidationPolicy, k as ParsedReferenceTransform, R as ReferenceTransformResult, q as SignatureReferenceCheck, l as SignOptions, m as SignResult, d as DigitalSignatureReport } from '../signature-inspection-status-
|
|
2
|
-
export { D as DIGEST_ALGORITHM_TO_HASH, a as DIGEST_ALGORITHM_TO_WEB_CRYPTO, b as DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, c as DIGITAL_SIGNATURE_REL_TYPE, e as DigitalSignatureVerificationStatus, E as ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, f as ENTERPRISE_REQUIRE_REVOCATION_ENV, g as ENTERPRISE_REQUIRE_TIMESTAMP_ENV, h as ENTERPRISE_TRUST_ROOTS_FILE_ENV, i as ENTERPRISE_TRUST_ROOTS_PEM_ENV, O as OPC_RELATIONSHIP_TRANSFORM, j as OfficeSignatureReference, P as PPTX_VIEWER_MANIFEST_NS, S as SUPPORTED_XML_CANON_TRANSFORMS, n as SignatureDetail, o as SignatureDetailStatus, X as XMLDSIG_NS, s as XML_TRANSFORM_ENVELOPED_SIGNATURE, t as computeDetailStatus, u as computeDigestBase64WebCrypto, v as computeVerificationStatus, w as escapeXmlAttr, x as
|
|
1
|
+
import { p as SignatureCertificateInfo, L as LoadedSigningMaterial, C as CertificateRevocationStatus, T as TimestampAuthorityStatus, r as SignatureValidationPolicy, k as ParsedReferenceTransform, R as ReferenceTransformResult, q as SignatureReferenceCheck, l as SignOptions, m as SignResult, d as DigitalSignatureReport } from '../signature-inspection-status-BCUpfCQh.mjs';
|
|
2
|
+
export { D as DIGEST_ALGORITHM_TO_HASH, a as DIGEST_ALGORITHM_TO_WEB_CRYPTO, b as DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, c as DIGITAL_SIGNATURE_REL_TYPE, e as DigitalSignatureVerificationStatus, E as ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, f as ENTERPRISE_REQUIRE_REVOCATION_ENV, g as ENTERPRISE_REQUIRE_TIMESTAMP_ENV, h as ENTERPRISE_TRUST_ROOTS_FILE_ENV, i as ENTERPRISE_TRUST_ROOTS_PEM_ENV, O as OPC_RELATIONSHIP_TRANSFORM, j as OfficeSignatureReference, P as PPTX_VIEWER_MANIFEST_NS, S as SUPPORTED_XML_CANON_TRANSFORMS, n as SignatureDetail, o as SignatureDetailStatus, X as XMLDSIG_NS, s as XML_TRANSFORM_ENVELOPED_SIGNATURE, t as computeDetailStatus, u as computeDigestBase64WebCrypto, v as computeVerificationStatus, w as escapeXmlAttr, x as escapeXmlText, y as extractAllTagText, z as extractFirstTagText, A as extractTagAttribute, B as isValidBase64, F as normalizePartPath, G as resolveReferenceUriToPart } from '../signature-inspection-status-BCUpfCQh.mjs';
|
|
3
3
|
import JSZip from 'jszip';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as SignatureCertificateInfo, L as LoadedSigningMaterial, C as CertificateRevocationStatus, T as TimestampAuthorityStatus, r as SignatureValidationPolicy, k as ParsedReferenceTransform, R as ReferenceTransformResult, q as SignatureReferenceCheck, l as SignOptions, m as SignResult, d as DigitalSignatureReport } from '../signature-inspection-status-
|
|
2
|
-
export { D as DIGEST_ALGORITHM_TO_HASH, a as DIGEST_ALGORITHM_TO_WEB_CRYPTO, b as DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, c as DIGITAL_SIGNATURE_REL_TYPE, e as DigitalSignatureVerificationStatus, E as ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, f as ENTERPRISE_REQUIRE_REVOCATION_ENV, g as ENTERPRISE_REQUIRE_TIMESTAMP_ENV, h as ENTERPRISE_TRUST_ROOTS_FILE_ENV, i as ENTERPRISE_TRUST_ROOTS_PEM_ENV, O as OPC_RELATIONSHIP_TRANSFORM, j as OfficeSignatureReference, P as PPTX_VIEWER_MANIFEST_NS, S as SUPPORTED_XML_CANON_TRANSFORMS, n as SignatureDetail, o as SignatureDetailStatus, X as XMLDSIG_NS, s as XML_TRANSFORM_ENVELOPED_SIGNATURE, t as computeDetailStatus, u as computeDigestBase64WebCrypto, v as computeVerificationStatus, w as escapeXmlAttr, x as
|
|
1
|
+
import { p as SignatureCertificateInfo, L as LoadedSigningMaterial, C as CertificateRevocationStatus, T as TimestampAuthorityStatus, r as SignatureValidationPolicy, k as ParsedReferenceTransform, R as ReferenceTransformResult, q as SignatureReferenceCheck, l as SignOptions, m as SignResult, d as DigitalSignatureReport } from '../signature-inspection-status-BCUpfCQh.js';
|
|
2
|
+
export { D as DIGEST_ALGORITHM_TO_HASH, a as DIGEST_ALGORITHM_TO_WEB_CRYPTO, b as DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, c as DIGITAL_SIGNATURE_REL_TYPE, e as DigitalSignatureVerificationStatus, E as ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, f as ENTERPRISE_REQUIRE_REVOCATION_ENV, g as ENTERPRISE_REQUIRE_TIMESTAMP_ENV, h as ENTERPRISE_TRUST_ROOTS_FILE_ENV, i as ENTERPRISE_TRUST_ROOTS_PEM_ENV, O as OPC_RELATIONSHIP_TRANSFORM, j as OfficeSignatureReference, P as PPTX_VIEWER_MANIFEST_NS, S as SUPPORTED_XML_CANON_TRANSFORMS, n as SignatureDetail, o as SignatureDetailStatus, X as XMLDSIG_NS, s as XML_TRANSFORM_ENVELOPED_SIGNATURE, t as computeDetailStatus, u as computeDigestBase64WebCrypto, v as computeVerificationStatus, w as escapeXmlAttr, x as escapeXmlText, y as extractAllTagText, z as extractFirstTagText, A as extractTagAttribute, B as isValidBase64, F as normalizePartPath, G as resolveReferenceUriToPart } from '../signature-inspection-status-BCUpfCQh.js';
|
|
3
3
|
import JSZip from 'jszip';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -56,7 +56,13 @@ var DIGEST_ALGORITHM_TO_WEB_CRYPTO = {
|
|
|
56
56
|
|
|
57
57
|
// src/core/utils/signature-xml-utils.ts
|
|
58
58
|
function escapeXmlAttr(value) {
|
|
59
|
-
return value.replace(/&/g, "&").replace(
|
|
59
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
60
|
+
}
|
|
61
|
+
function escapeXmlText(value) {
|
|
62
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
63
|
+
}
|
|
64
|
+
function isValidBase64(value) {
|
|
65
|
+
return typeof value === "string" && value.length > 0 && /^[A-Za-z0-9+/=\s]+$/.test(value);
|
|
60
66
|
}
|
|
61
67
|
function extractTagAttribute(xml, tagName, attributeName) {
|
|
62
68
|
const pattern = new RegExp(
|
|
@@ -1081,7 +1087,7 @@ async function buildOfficeReferenceList(zip) {
|
|
|
1081
1087
|
}
|
|
1082
1088
|
function buildOfficeSignatureXml(references, privateKeyPem, certificatePem) {
|
|
1083
1089
|
const signedInfoReferencesXml = references.map(
|
|
1084
|
-
(reference) => `<Reference URI="${escapeXmlAttr(reference.uri)}"><DigestMethod Algorithm="${escapeXmlAttr(reference.digestMethod)}"/><DigestValue>${
|
|
1090
|
+
(reference) => `<Reference URI="${escapeXmlAttr(reference.uri)}"><DigestMethod Algorithm="${escapeXmlAttr(reference.digestMethod)}"/><DigestValue>${escapeXmlText(reference.digestValue)}</DigestValue></Reference>`
|
|
1085
1091
|
).join("");
|
|
1086
1092
|
const signedInfoXml = `<SignedInfo xmlns="${XMLDSIG_NS}"><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>${signedInfoReferencesXml}</SignedInfo>`;
|
|
1087
1093
|
const canonicalSignedInfo = canonicalizeSignedInfoXml(signedInfoXml);
|
|
@@ -1090,8 +1096,14 @@ function buildOfficeSignatureXml(references, privateKeyPem, certificatePem) {
|
|
|
1090
1096
|
signer.end();
|
|
1091
1097
|
const signatureValueBase64 = signer.sign(privateKeyPem).toString("base64");
|
|
1092
1098
|
const certificateBase64 = pemCertificateToBase64(certificatePem);
|
|
1099
|
+
if (!isValidBase64(signatureValueBase64)) {
|
|
1100
|
+
throw new Error("Generated SignatureValue is not valid base64");
|
|
1101
|
+
}
|
|
1102
|
+
if (!isValidBase64(certificateBase64)) {
|
|
1103
|
+
throw new Error("X.509 certificate is not valid base64");
|
|
1104
|
+
}
|
|
1093
1105
|
const signingTime = (/* @__PURE__ */ new Date()).toISOString();
|
|
1094
|
-
return `<Signature xmlns="${XMLDSIG_NS}">${signedInfoXml}<SignatureValue>${signatureValueBase64}</SignatureValue><KeyInfo><X509Data><X509Certificate>${certificateBase64}</X509Certificate></X509Data></KeyInfo><Object><SignatureProperties><SignatureProperty><SigningTime>${
|
|
1106
|
+
return `<Signature xmlns="${XMLDSIG_NS}">${signedInfoXml}<SignatureValue>${escapeXmlText(signatureValueBase64)}</SignatureValue><KeyInfo><X509Data><X509Certificate>${escapeXmlText(certificateBase64)}</X509Certificate></X509Data></KeyInfo><Object><SignatureProperties><SignatureProperty><SigningTime>${escapeXmlText(signingTime)}</SigningTime></SignatureProperty></SignatureProperties></Object></Signature>`;
|
|
1095
1107
|
}
|
|
1096
1108
|
async function signPptxWithCertificate(data, certificateBuffer, options) {
|
|
1097
1109
|
try {
|
|
@@ -1169,6 +1181,7 @@ exports.computeDigestBase64 = computeDigestBase642;
|
|
|
1169
1181
|
exports.computeDigestBase64WebCrypto = computeDigestBase64;
|
|
1170
1182
|
exports.computeVerificationStatus = computeVerificationStatus;
|
|
1171
1183
|
exports.escapeXmlAttr = escapeXmlAttr;
|
|
1184
|
+
exports.escapeXmlText = escapeXmlText;
|
|
1172
1185
|
exports.evaluateCertificateRevocation = evaluateCertificateRevocation;
|
|
1173
1186
|
exports.evaluateTimestampAuthority = evaluateTimestampAuthority;
|
|
1174
1187
|
exports.extractAllTagText = extractAllTagText;
|
|
@@ -1181,6 +1194,7 @@ exports.getFirstDescendantElementByLocalName = getFirstDescendantElementByLocalN
|
|
|
1181
1194
|
exports.getNodeLocalName = getNodeLocalName;
|
|
1182
1195
|
exports.getSignatureValidationPolicy = getSignatureValidationPolicy;
|
|
1183
1196
|
exports.inspectPptxDigitalSignatures = inspectPptxDigitalSignatures;
|
|
1197
|
+
exports.isValidBase64 = isValidBase64;
|
|
1184
1198
|
exports.loadEnterpriseTrustRoots = loadEnterpriseTrustRoots;
|
|
1185
1199
|
exports.loadSigningMaterialFromBuffer = loadSigningMaterialFromBuffer;
|
|
1186
1200
|
exports.normalizePartPath = normalizePartPath;
|
|
@@ -43,7 +43,13 @@ var DIGEST_ALGORITHM_TO_WEB_CRYPTO = {
|
|
|
43
43
|
|
|
44
44
|
// src/core/utils/signature-xml-utils.ts
|
|
45
45
|
function escapeXmlAttr(value) {
|
|
46
|
-
return value.replace(/&/g, "&").replace(
|
|
46
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
47
|
+
}
|
|
48
|
+
function escapeXmlText(value) {
|
|
49
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
50
|
+
}
|
|
51
|
+
function isValidBase64(value) {
|
|
52
|
+
return typeof value === "string" && value.length > 0 && /^[A-Za-z0-9+/=\s]+$/.test(value);
|
|
47
53
|
}
|
|
48
54
|
function extractTagAttribute(xml, tagName, attributeName) {
|
|
49
55
|
const pattern = new RegExp(
|
|
@@ -1068,7 +1074,7 @@ async function buildOfficeReferenceList(zip) {
|
|
|
1068
1074
|
}
|
|
1069
1075
|
function buildOfficeSignatureXml(references, privateKeyPem, certificatePem) {
|
|
1070
1076
|
const signedInfoReferencesXml = references.map(
|
|
1071
|
-
(reference) => `<Reference URI="${escapeXmlAttr(reference.uri)}"><DigestMethod Algorithm="${escapeXmlAttr(reference.digestMethod)}"/><DigestValue>${
|
|
1077
|
+
(reference) => `<Reference URI="${escapeXmlAttr(reference.uri)}"><DigestMethod Algorithm="${escapeXmlAttr(reference.digestMethod)}"/><DigestValue>${escapeXmlText(reference.digestValue)}</DigestValue></Reference>`
|
|
1072
1078
|
).join("");
|
|
1073
1079
|
const signedInfoXml = `<SignedInfo xmlns="${XMLDSIG_NS}"><CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>${signedInfoReferencesXml}</SignedInfo>`;
|
|
1074
1080
|
const canonicalSignedInfo = canonicalizeSignedInfoXml(signedInfoXml);
|
|
@@ -1077,8 +1083,14 @@ function buildOfficeSignatureXml(references, privateKeyPem, certificatePem) {
|
|
|
1077
1083
|
signer.end();
|
|
1078
1084
|
const signatureValueBase64 = signer.sign(privateKeyPem).toString("base64");
|
|
1079
1085
|
const certificateBase64 = pemCertificateToBase64(certificatePem);
|
|
1086
|
+
if (!isValidBase64(signatureValueBase64)) {
|
|
1087
|
+
throw new Error("Generated SignatureValue is not valid base64");
|
|
1088
|
+
}
|
|
1089
|
+
if (!isValidBase64(certificateBase64)) {
|
|
1090
|
+
throw new Error("X.509 certificate is not valid base64");
|
|
1091
|
+
}
|
|
1080
1092
|
const signingTime = (/* @__PURE__ */ new Date()).toISOString();
|
|
1081
|
-
return `<Signature xmlns="${XMLDSIG_NS}">${signedInfoXml}<SignatureValue>${signatureValueBase64}</SignatureValue><KeyInfo><X509Data><X509Certificate>${certificateBase64}</X509Certificate></X509Data></KeyInfo><Object><SignatureProperties><SignatureProperty><SigningTime>${
|
|
1093
|
+
return `<Signature xmlns="${XMLDSIG_NS}">${signedInfoXml}<SignatureValue>${escapeXmlText(signatureValueBase64)}</SignatureValue><KeyInfo><X509Data><X509Certificate>${escapeXmlText(certificateBase64)}</X509Certificate></X509Data></KeyInfo><Object><SignatureProperties><SignatureProperty><SigningTime>${escapeXmlText(signingTime)}</SigningTime></SignatureProperty></SignatureProperties></Object></Signature>`;
|
|
1082
1094
|
}
|
|
1083
1095
|
async function signPptxWithCertificate(data, certificateBuffer, options) {
|
|
1084
1096
|
try {
|
|
@@ -1128,4 +1140,4 @@ async function signPptxWithCertificate(data, certificateBuffer, options) {
|
|
|
1128
1140
|
}
|
|
1129
1141
|
}
|
|
1130
1142
|
|
|
1131
|
-
export { DIGEST_ALGORITHM_TO_HASH, DIGEST_ALGORITHM_TO_WEB_CRYPTO, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, DIGITAL_SIGNATURE_REL_TYPE, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, ENTERPRISE_REQUIRE_REVOCATION_ENV, ENTERPRISE_REQUIRE_TIMESTAMP_ENV, ENTERPRISE_TRUST_ROOTS_FILE_ENV, ENTERPRISE_TRUST_ROOTS_PEM_ENV, OPC_RELATIONSHIP_TRANSFORM, PPTX_VIEWER_MANIFEST_NS, SUPPORTED_XML_CANON_TRANSFORMS, XMLDSIG_NS, XML_TRANSFORM_ENVELOPED_SIGNATURE, applyReferenceTransforms, buildOcspRequestDer, buildReferenceChecksFromPptxViewerManifest, buildReferenceChecksFromSignatureXml, canonicalizeNode, canonicalizeSignedInfoXml, certFingerprintSha256, certPemFromBase64, certificateInfoFromBase64, computeDetailStatus, computeDigestBase642 as computeDigestBase64, computeDigestBase64 as computeDigestBase64WebCrypto, computeVerificationStatus, escapeXmlAttr, evaluateCertificateRevocation, evaluateTimestampAuthority, extractAllTagText, extractFirstTagText, extractOcspUrls, extractPemCertificatesFromText, extractReferenceTransforms, extractTagAttribute, getFirstDescendantElementByLocalName, getNodeLocalName, getSignatureValidationPolicy, inspectPptxDigitalSignatures, loadEnterpriseTrustRoots, loadSigningMaterialFromBuffer, normalizePartPath, parseOcspResponseStatus, pemCertificateToBase64, resolveReferenceUriToPart, signPptxWithCertificate, validateCertificateChain, verifySignatureValue };
|
|
1143
|
+
export { DIGEST_ALGORITHM_TO_HASH, DIGEST_ALGORITHM_TO_WEB_CRYPTO, DIGITAL_SIGNATURE_ORIGIN_REL_TYPE, DIGITAL_SIGNATURE_REL_TYPE, ENTERPRISE_FAIL_ON_REVOCATION_UNKNOWN_ENV, ENTERPRISE_REQUIRE_REVOCATION_ENV, ENTERPRISE_REQUIRE_TIMESTAMP_ENV, ENTERPRISE_TRUST_ROOTS_FILE_ENV, ENTERPRISE_TRUST_ROOTS_PEM_ENV, OPC_RELATIONSHIP_TRANSFORM, PPTX_VIEWER_MANIFEST_NS, SUPPORTED_XML_CANON_TRANSFORMS, XMLDSIG_NS, XML_TRANSFORM_ENVELOPED_SIGNATURE, applyReferenceTransforms, buildOcspRequestDer, buildReferenceChecksFromPptxViewerManifest, buildReferenceChecksFromSignatureXml, canonicalizeNode, canonicalizeSignedInfoXml, certFingerprintSha256, certPemFromBase64, certificateInfoFromBase64, computeDetailStatus, computeDigestBase642 as computeDigestBase64, computeDigestBase64 as computeDigestBase64WebCrypto, computeVerificationStatus, escapeXmlAttr, escapeXmlText, evaluateCertificateRevocation, evaluateTimestampAuthority, extractAllTagText, extractFirstTagText, extractOcspUrls, extractPemCertificatesFromText, extractReferenceTransforms, extractTagAttribute, getFirstDescendantElementByLocalName, getNodeLocalName, getSignatureValidationPolicy, inspectPptxDigitalSignatures, isValidBase64, loadEnterpriseTrustRoots, loadSigningMaterialFromBuffer, normalizePartPath, parseOcspResponseStatus, pemCertificateToBase64, resolveReferenceUriToPart, signPptxWithCertificate, validateCertificateChain, verifySignatureValue };
|