@extend-ai/react-pptx 0.2.5 → 0.3.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/index.d.ts CHANGED
@@ -12,6 +12,229 @@ declare class PptxViewerError extends Error {
12
12
  });
13
13
  }
14
14
 
15
+ /** Finite quantity or indefinite; durations are milliseconds and percentages are fractions. */
16
+ type AnimationNumber = number | 'indefinite';
17
+ type AnimationValue = {
18
+ kind: 'string';
19
+ value: string;
20
+ } | {
21
+ kind: 'boolean';
22
+ value: boolean;
23
+ } | {
24
+ kind: 'integer' | 'number';
25
+ value: number;
26
+ } | {
27
+ kind: 'color';
28
+ value: ColorValue;
29
+ } | {
30
+ kind: 'point';
31
+ value: AnimationPoint;
32
+ } | {
33
+ kind: 'rgbDelta' | 'hslDelta';
34
+ value: [number, number, number];
35
+ };
36
+ interface SlideTransition {
37
+ effect?: TransitionEffect;
38
+ speed: string;
39
+ durationMs?: number;
40
+ advanceOnClick: boolean;
41
+ advanceAfterMs?: number;
42
+ sound?: TransitionSound;
43
+ sourceXml: string;
44
+ }
45
+ interface TransitionEffect {
46
+ kind: string;
47
+ namespace: string;
48
+ direction?: string;
49
+ orientation?: string;
50
+ throughBlack?: boolean;
51
+ spokes?: number;
52
+ parameters: Record<string, string>;
53
+ }
54
+ interface TransitionSound {
55
+ action: string;
56
+ loopSound: boolean;
57
+ source?: AnimationSound;
58
+ }
59
+ interface AnimationSound {
60
+ relationshipId?: string;
61
+ target?: string;
62
+ assetId?: string;
63
+ external: boolean;
64
+ name?: string;
65
+ builtin?: boolean;
66
+ }
67
+ interface SlideTiming {
68
+ nodes?: AnimationNode[];
69
+ builds?: AnimationBuild[];
70
+ unsupported?: string[];
71
+ sourceXml: string;
72
+ }
73
+ interface AnimationNode {
74
+ kind: string;
75
+ time?: AnimationTime;
76
+ behavior?: AnimationBehavior;
77
+ sequence?: AnimationSequence;
78
+ media?: AnimationMedia;
79
+ parameters: AnimationParameters;
80
+ }
81
+ interface AnimationTime {
82
+ id?: number;
83
+ presetId?: number;
84
+ presetClass?: string;
85
+ presetSubtype?: number;
86
+ durationMs?: AnimationNumber;
87
+ repeatCount: AnimationNumber;
88
+ repeatDurationMs?: AnimationNumber;
89
+ speed: number;
90
+ acceleration: number;
91
+ deceleration: number;
92
+ autoReverse: boolean;
93
+ restart?: string;
94
+ fill?: string;
95
+ syncBehavior?: string;
96
+ timeFilter?: string;
97
+ eventFilter?: string;
98
+ display?: boolean;
99
+ masterRelation?: string;
100
+ buildLevel?: number;
101
+ groupId?: number;
102
+ afterEffect?: boolean;
103
+ nodeType?: string;
104
+ placeholder?: boolean;
105
+ startConditions?: AnimationCondition[];
106
+ endConditions?: AnimationCondition[];
107
+ endSync?: AnimationCondition;
108
+ iterate?: AnimationIteration;
109
+ children?: AnimationNode[];
110
+ subNodes?: AnimationNode[];
111
+ }
112
+ interface AnimationCondition {
113
+ event?: string;
114
+ delayMs?: AnimationNumber;
115
+ target?: AnimationTarget;
116
+ timeNodeId?: number;
117
+ runtimeNode?: string;
118
+ }
119
+ interface AnimationIteration {
120
+ kind: string;
121
+ backwards: boolean;
122
+ intervalMs?: AnimationNumber;
123
+ intervalFraction?: number;
124
+ }
125
+ interface AnimationTarget {
126
+ kind: string;
127
+ /** Identifier scoped to the owning part, matching object source identity. */
128
+ shapeId?: string;
129
+ subShapeId?: string;
130
+ background?: boolean;
131
+ text?: AnimationTextRange;
132
+ chart?: AnimationChartTarget;
133
+ diagram?: AnimationDiagramTarget;
134
+ sound?: AnimationSound;
135
+ }
136
+ interface AnimationTextRange {
137
+ kind: string;
138
+ start?: number;
139
+ end?: number;
140
+ }
141
+ interface AnimationChartTarget {
142
+ kind: string;
143
+ level?: number;
144
+ seriesIndex?: number;
145
+ categoryIndex?: number;
146
+ }
147
+ interface AnimationDiagramTarget {
148
+ id?: string;
149
+ buildStep?: string;
150
+ }
151
+ interface AnimationBehavior {
152
+ target?: AnimationTarget;
153
+ attributeNames?: string[];
154
+ additive?: string;
155
+ accumulate?: string;
156
+ transformType?: string;
157
+ from?: string;
158
+ to?: string;
159
+ by?: string;
160
+ runtimeContext?: string;
161
+ overrideMode?: string;
162
+ }
163
+ interface AnimationSequence {
164
+ concurrent?: boolean;
165
+ previousAction?: string;
166
+ nextAction?: string;
167
+ previousConditions?: AnimationCondition[];
168
+ nextConditions?: AnimationCondition[];
169
+ }
170
+ interface AnimationMedia {
171
+ target?: AnimationTarget;
172
+ volume: number;
173
+ mute: boolean;
174
+ slideCount: number;
175
+ showWhenStopped: boolean;
176
+ narration?: boolean;
177
+ fullScreen?: boolean;
178
+ }
179
+ interface AnimationParameters {
180
+ from?: AnimationValue;
181
+ to?: AnimationValue;
182
+ by?: AnimationValue;
183
+ calculationMode?: string;
184
+ valueType?: string;
185
+ keyframes?: AnimationKeyframe[];
186
+ colorSpace?: string;
187
+ direction?: string;
188
+ transition?: string;
189
+ filter?: string;
190
+ properties?: string;
191
+ progress?: AnimationValue;
192
+ origin?: string;
193
+ path?: string;
194
+ pathEditMode?: string;
195
+ rotationCenter?: AnimationPoint;
196
+ rotationDegrees?: number;
197
+ pointTypes?: string;
198
+ zoomContents?: boolean;
199
+ commandType?: string;
200
+ command?: string;
201
+ }
202
+ interface AnimationPoint {
203
+ x: number;
204
+ y: number;
205
+ }
206
+ interface AnimationKeyframe {
207
+ time: AnimationNumber;
208
+ formula: string;
209
+ value?: AnimationValue;
210
+ }
211
+ interface AnimationBuild {
212
+ kind: string;
213
+ /** Identifier scoped to the owning part, matching object source identity. */
214
+ shapeId?: string;
215
+ groupId?: number;
216
+ uiExpand: boolean;
217
+ build?: string;
218
+ level?: number;
219
+ animateBackground?: boolean;
220
+ autoUpdateBackground?: boolean;
221
+ reverse?: boolean;
222
+ advanceAfterMs?: AnimationNumber;
223
+ asOne?: boolean;
224
+ graphicBuild?: AnimationGraphicBuild;
225
+ templates?: AnimationTemplate[];
226
+ }
227
+ interface AnimationGraphicBuild {
228
+ kind: string;
229
+ build?: string;
230
+ reverse?: boolean;
231
+ animateBackground?: boolean;
232
+ }
233
+ interface AnimationTemplate {
234
+ level: number;
235
+ nodes?: AnimationNode[];
236
+ }
237
+
15
238
  type PresentationFormat = 'pptx' | 'ppt';
16
239
  interface PresentationSize {
17
240
  widthEmu: number;
@@ -108,8 +331,28 @@ interface LineStyle {
108
331
  startArrow?: string;
109
332
  endArrow?: string;
110
333
  }
111
- interface TextRun {
334
+ interface MathElement {
335
+ name: string;
336
+ namespace?: string;
337
+ attributes?: {
338
+ name: string;
339
+ namespace?: string;
340
+ value: string;
341
+ }[];
342
+ children?: MathElement[];
343
+ text?: string;
344
+ }
345
+ interface OfficeMath {
112
346
  text: string;
347
+ display: boolean;
348
+ sourceXml: string;
349
+ root?: MathElement;
350
+ justification?: string;
351
+ mathMl: string;
352
+ fontSizePt?: number;
353
+ unsupported?: string[];
354
+ }
355
+ interface TextRunProperties {
113
356
  fontFamily?: string;
114
357
  /** Explicit East Asian typeface declared for this run. */
115
358
  eastAsianFontFamily?: string;
@@ -134,6 +377,30 @@ interface TextRun {
134
377
  kerningThresholdPt?: number;
135
378
  hyperlink?: string;
136
379
  }
380
+ interface TextRun extends TextRunProperties {
381
+ math?: OfficeMath;
382
+ text: string;
383
+ field?: TextField;
384
+ }
385
+ interface TextField {
386
+ id?: string;
387
+ type?: string;
388
+ hasCachedText: boolean;
389
+ paragraphProperties?: TextFieldParagraphProperties;
390
+ sourcePart?: string;
391
+ sourceXml: string;
392
+ }
393
+ interface TextFieldParagraphProperties extends Omit<TextParagraph, 'runs'> {
394
+ marginRightEmu?: number;
395
+ fontAlignment?: string;
396
+ bulletNone?: boolean;
397
+ bulletColor?: ColorValue;
398
+ bulletColorFollowText?: boolean;
399
+ bulletFontFollowText?: boolean;
400
+ bulletSizeFollowText?: boolean;
401
+ bulletImageAssetId?: string;
402
+ defaultRunProperties?: TextRunProperties;
403
+ }
137
404
  interface TextTabStop {
138
405
  positionEmu: number;
139
406
  alignment: 'left' | 'center' | 'right' | 'decimal';
@@ -179,6 +446,21 @@ interface TextAutofit {
179
446
  /** PowerPoint normal-autofit line-spacing reduction, normalized to 0..1. */
180
447
  lineSpacingReduction?: number;
181
448
  }
449
+ interface ObjectAction {
450
+ relationshipId?: string;
451
+ target?: string;
452
+ external?: boolean;
453
+ action?: string;
454
+ tooltip?: string;
455
+ targetFrame?: string;
456
+ invalidUrl?: string;
457
+ history?: boolean;
458
+ highlightClick?: boolean;
459
+ endSound?: boolean;
460
+ soundAssetId?: string;
461
+ soundName?: string;
462
+ soundBuiltin?: boolean;
463
+ }
182
464
  interface BaseSlideNode {
183
465
  id: string;
184
466
  name?: string;
@@ -187,7 +469,47 @@ interface BaseSlideNode {
187
469
  opacity?: number;
188
470
  hyperlink?: string;
189
471
  altText?: string;
472
+ accessibilityTitle?: string;
473
+ description?: string;
474
+ decorative?: boolean;
475
+ clickAction?: ObjectAction;
476
+ hoverAction?: ObjectAction;
190
477
  sourcePart?: string;
478
+ sourceId?: string;
479
+ editing?: ObjectEditing;
480
+ }
481
+ interface ObjectEditing {
482
+ kind: 'shape' | 'connector' | 'picture' | 'group' | 'graphicFrame' | 'contentPart';
483
+ locks?: ObjectLocks;
484
+ connector?: ConnectorConnections;
485
+ textBox?: boolean;
486
+ preferRelativeResize?: boolean;
487
+ isComment?: boolean;
488
+ sourceXml: string;
489
+ }
490
+ interface ObjectLocks {
491
+ noGrouping?: boolean;
492
+ noUngrouping?: boolean;
493
+ noSelection?: boolean;
494
+ noRotation?: boolean;
495
+ noChangeAspect?: boolean;
496
+ noMove?: boolean;
497
+ noResize?: boolean;
498
+ noEditPoints?: boolean;
499
+ noAdjustHandles?: boolean;
500
+ noChangeArrowheads?: boolean;
501
+ noChangeShapeType?: boolean;
502
+ noTextEdit?: boolean;
503
+ noCrop?: boolean;
504
+ noDrilldown?: boolean;
505
+ }
506
+ interface ConnectorConnections {
507
+ start?: ConnectorEndpoint;
508
+ end?: ConnectorEndpoint;
509
+ }
510
+ interface ConnectorEndpoint {
511
+ shapeId: number;
512
+ connectionSite: number;
191
513
  }
192
514
  interface ShapeNode extends BaseSlideNode {
193
515
  type: 'shape';
@@ -250,6 +572,37 @@ interface Model3D {
250
572
  interface ImageNode extends BaseSlideNode {
251
573
  type: 'image';
252
574
  model3d?: Model3D;
575
+ ink?: {
576
+ assetId?: string;
577
+ sourceXml?: string;
578
+ drawing?: {
579
+ sourceBounds: {
580
+ x: number;
581
+ y: number;
582
+ width: number;
583
+ height: number;
584
+ };
585
+ strokes: Array<{
586
+ id?: string;
587
+ timeOffset?: string;
588
+ points: Array<{
589
+ x: number;
590
+ y: number;
591
+ pressure: number;
592
+ contact: boolean;
593
+ }>;
594
+ brush: {
595
+ width: number;
596
+ height: number;
597
+ color: string;
598
+ opacity: number;
599
+ rectangle: boolean;
600
+ pencil: boolean;
601
+ ignorePressure: boolean;
602
+ };
603
+ }>;
604
+ };
605
+ };
253
606
  assetId: string;
254
607
  crop?: {
255
608
  top: number;
@@ -257,9 +610,14 @@ interface ImageNode extends BaseSlideNode {
257
610
  bottom: number;
258
611
  left: number;
259
612
  };
613
+ fallbackAssetId?: string;
260
614
  preserveAspectRatio?: boolean;
261
615
  effects?: ImageEffects;
262
616
  pictureSvg?: string;
617
+ fallbackPicture?: {
618
+ svg: string;
619
+ paintBounds?: PicturePaintBounds | null;
620
+ };
263
621
  paintBounds?: PicturePaintBounds;
264
622
  sourceXml?: string;
265
623
  }
@@ -269,6 +627,14 @@ interface GroupNode extends BaseSlideNode {
269
627
  childTransform?: Transform;
270
628
  }
271
629
  interface TableCell {
630
+ merge?: {
631
+ horizontal: boolean;
632
+ vertical: boolean;
633
+ origin?: {
634
+ row: number;
635
+ column: number;
636
+ };
637
+ };
272
638
  rowSpan?: number;
273
639
  colSpan?: number;
274
640
  fill?: FillStyle;
@@ -316,9 +682,44 @@ interface ChartNode extends BaseSlideNode {
316
682
  }
317
683
  interface MediaNode extends BaseSlideNode {
318
684
  type: 'media';
319
- mediaType: 'audio' | 'video' | 'ole' | 'unknown';
685
+ mediaType: 'audio' | 'video' | 'ole' | 'control' | 'unknown';
320
686
  assetId?: string;
321
687
  posterAssetId?: string;
688
+ sourceUrl?: string;
689
+ poster?: ImageNode;
690
+ playback?: {
691
+ trimStartMs?: number;
692
+ /** Duration removed from the end of the media. */
693
+ trimEndMs?: number;
694
+ fadeInMs?: number;
695
+ fadeOutMs?: number;
696
+ bookmarks?: {
697
+ name: string;
698
+ timeMs: number;
699
+ }[];
700
+ };
701
+ embeddedObject?: {
702
+ control?: {
703
+ classId?: string;
704
+ persistence?: string;
705
+ sourceXml?: string;
706
+ binaryAssetIds?: string[];
707
+ properties?: Array<{
708
+ name: string;
709
+ value?: string;
710
+ }>;
711
+ };
712
+ programId?: string;
713
+ name?: string;
714
+ relationshipId?: string;
715
+ linked: boolean;
716
+ showAsIcon?: boolean;
717
+ previewWidthEmu?: number;
718
+ previewHeightEmu?: number;
719
+ followColorScheme?: string;
720
+ updateAutomatic?: boolean;
721
+ };
722
+ sourceXml?: string;
322
723
  }
323
724
  interface UnknownNode extends BaseSlideNode {
324
725
  type: 'unknown';
@@ -338,25 +739,77 @@ interface SlideMaster {
338
739
  id: string;
339
740
  name?: string;
340
741
  themeId?: string;
742
+ transition?: SlideTransition;
743
+ timing?: SlideTiming;
341
744
  nodes: SlideNode[];
342
745
  }
343
746
  interface SlideLayout {
344
747
  id: string;
345
748
  name?: string;
346
749
  masterId?: string;
750
+ transition?: SlideTransition;
751
+ timing?: SlideTiming;
347
752
  nodes: SlideNode[];
348
753
  }
349
754
  interface SlideNote {
350
755
  text: string;
756
+ paragraphs?: TextParagraph[];
351
757
  }
352
758
  interface SlideComment {
353
759
  id: string;
354
760
  author?: string;
761
+ authorId?: string;
762
+ authorInitials?: string;
763
+ sourceIndex?: number;
764
+ sourcePart?: string;
355
765
  text: string;
766
+ paragraphs?: TextParagraph[];
767
+ replies?: SlideComment[];
768
+ modern?: ModernComment;
356
769
  createdAt?: string;
770
+ modifiedAt?: string;
771
+ position?: {
772
+ x: number;
773
+ y: number;
774
+ unit: 'eighthPoint';
775
+ };
357
776
  x?: number;
358
777
  y?: number;
359
778
  }
779
+ interface ModernComment {
780
+ status: string;
781
+ authorUserId?: string;
782
+ authorProviderId?: string;
783
+ authorExtensionsXml?: string;
784
+ anchors?: CommentAnchor[];
785
+ positionEmu?: {
786
+ x: number;
787
+ y: number;
788
+ sourceX: string;
789
+ sourceY: string;
790
+ };
791
+ task?: CommentTask;
792
+ extensionsXml?: string;
793
+ }
794
+ interface CommentTask {
795
+ startDate?: string;
796
+ dueDate?: string;
797
+ assignedTo: string[];
798
+ title: string;
799
+ completion: string;
800
+ completionFraction?: number;
801
+ }
802
+ interface CommentAnchor {
803
+ kind: 'slide' | 'drawingElement' | 'textRange' | 'unknown';
804
+ monikers: CommentMoniker[];
805
+ }
806
+ interface CommentMoniker {
807
+ namespace: string;
808
+ name: string;
809
+ attributes: Record<string, string>;
810
+ children?: CommentMoniker[];
811
+ text?: string;
812
+ }
360
813
  interface PresentationSlide {
361
814
  id: string;
362
815
  index: number;
@@ -365,6 +818,8 @@ interface PresentationSlide {
365
818
  masterId?: string;
366
819
  layoutId?: string;
367
820
  background?: FillStyle;
821
+ transition?: SlideTransition;
822
+ timing?: SlideTiming;
368
823
  nodes: SlideNode[];
369
824
  notes?: SlideNote[];
370
825
  comments?: SlideComment[];
@@ -750,4 +1205,4 @@ declare function createPptxThumbnailRenderer(presentation: ParsedPresentation, o
750
1205
  declare const OFFICE_FONT_FALLBACKS: Readonly<Record<string, readonly string[]>>;
751
1206
  declare function resolvePptxFontFamily(fontFamily: string, options?: Pick<PptxFontOptions, 'fallbacks' | 'fallbackFamilies' | 'useOfficeFallbacks'>): string;
752
1207
 
753
- export { type BinaryPresentationSource, type FitMode, OFFICE_FONT_FALLBACKS, type ParsePresentationOptions, type ParsedPresentation, type PicturePaintBounds, type PptxFontOptions, type PptxFontSource, type PptxPerformanceMeasurement, type PptxPerformancePhase, type PptxSlideThumbnailItem, type PptxSlideThumbnailRenderOptions, type PptxSlideThumbnailRenderWindow, type PptxSlideThumbnailResolution, type PptxSlideThumbnailStatus, type PptxThumbnailOutput, type PptxThumbnailRenderOptions, type PptxThumbnailRenderResult, type PptxThumbnailRenderer, type PptxThumbnailRendererOptions, type PptxViewerController, PptxViewerError, type PptxViewerThumbnails, type PresentationAsset, type PresentationDocument, type PresentationEmbeddedFont, type PresentationFormat, type PresentationMetadata, type PresentationSearchResult, type PresentationSlide, type PresentationSource, type PresentationTheme, type PresentationWarning, ReactPptxViewer, type ReactPptxViewerProps, type SearchHighlightOptions, type Slide, type SlideComment, type SlideLayout, type SlideMaster, type SlideNode, type SlideNote, type ThumbnailRenderContext, type UsePptxPresentationState, type UsePptxViewerResult, type UsePptxViewerThumbnailsOptions, type ViewerMode, type ViewerSearchOptions, type ViewerZoomLevel, type ViewerZoomMode, type ViewerZoomState, type VirtualizationOptions, type WasmSource, type WorkerWasmSource, createPptxThumbnailRenderer, initWasm, parsePresentation, presentationParsingDefaults, resolvePptxFontFamily, setWasmSource, usePptxModel, usePptxPresentation, usePptxViewer, usePptxViewerThumbnails };
1208
+ export { type BinaryPresentationSource, type CommentAnchor, type CommentMoniker, type CommentTask, type FitMode, type ModernComment, OFFICE_FONT_FALLBACKS, type ParsePresentationOptions, type ParsedPresentation, type PicturePaintBounds, type PptxFontOptions, type PptxFontSource, type PptxPerformanceMeasurement, type PptxPerformancePhase, type PptxSlideThumbnailItem, type PptxSlideThumbnailRenderOptions, type PptxSlideThumbnailRenderWindow, type PptxSlideThumbnailResolution, type PptxSlideThumbnailStatus, type PptxThumbnailOutput, type PptxThumbnailRenderOptions, type PptxThumbnailRenderResult, type PptxThumbnailRenderer, type PptxThumbnailRendererOptions, type PptxViewerController, PptxViewerError, type PptxViewerThumbnails, type PresentationAsset, type PresentationDocument, type PresentationEmbeddedFont, type PresentationFormat, type PresentationMetadata, type PresentationSearchResult, type PresentationSlide, type PresentationSource, type PresentationTheme, type PresentationWarning, ReactPptxViewer, type ReactPptxViewerProps, type SearchHighlightOptions, type Slide, type SlideComment, type SlideLayout, type SlideMaster, type SlideNode, type SlideNote, type ThumbnailRenderContext, type UsePptxPresentationState, type UsePptxViewerResult, type UsePptxViewerThumbnailsOptions, type ViewerMode, type ViewerSearchOptions, type ViewerZoomLevel, type ViewerZoomMode, type ViewerZoomState, type VirtualizationOptions, type WasmSource, type WorkerWasmSource, createPptxThumbnailRenderer, initWasm, parsePresentation, presentationParsingDefaults, resolvePptxFontFamily, setWasmSource, usePptxModel, usePptxPresentation, usePptxViewer, usePptxViewerThumbnails };