pptx-react-viewer 1.11.0 → 1.13.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +2 -0
  3. package/dist/PowerPointViewer-BzsjqMzg.d.mts +26 -0
  4. package/dist/PowerPointViewer-C2a7iXAK.d.ts +26 -0
  5. package/dist/hooks-unstable.d.mts +2294 -0
  6. package/dist/hooks-unstable.d.ts +2294 -0
  7. package/dist/hooks-unstable.js +4891 -0
  8. package/dist/hooks-unstable.js.br +0 -0
  9. package/dist/hooks-unstable.js.gz +0 -0
  10. package/dist/hooks-unstable.mjs +4891 -0
  11. package/dist/hooks-unstable.mjs.br +0 -0
  12. package/dist/hooks-unstable.mjs.gz +0 -0
  13. package/dist/i18n.js +1 -1
  14. package/dist/i18n.js.br +0 -0
  15. package/dist/i18n.js.gz +0 -0
  16. package/dist/i18n.mjs +1 -1
  17. package/dist/i18n.mjs.br +0 -0
  18. package/dist/i18n.mjs.gz +0 -0
  19. package/dist/index.d.mts +2 -1
  20. package/dist/index.d.ts +2 -1
  21. package/dist/index.js +339 -333
  22. package/dist/index.js.br +0 -0
  23. package/dist/index.js.gz +0 -0
  24. package/dist/index.mjs +339 -333
  25. package/dist/index.mjs.br +0 -0
  26. package/dist/index.mjs.gz +0 -0
  27. package/dist/pptx-viewer.css +1 -1
  28. package/dist/pptx-viewer.css.br +0 -0
  29. package/dist/pptx-viewer.css.gz +0 -0
  30. package/dist/{PowerPointViewer-88hWoBGx.d.mts → types-ui-DlsqFx7_.d.mts} +126 -23
  31. package/dist/{PowerPointViewer-88hWoBGx.d.ts → types-ui-DlsqFx7_.d.ts} +126 -23
  32. package/dist/usePresenterWindow-BKx5DLJy.d.ts +1619 -0
  33. package/dist/usePresenterWindow-BQwzr87T.d.mts +1619 -0
  34. package/dist/viewer/index.d.mts +10 -1604
  35. package/dist/viewer/index.d.ts +10 -1604
  36. package/dist/viewer/index.js +339 -333
  37. package/dist/viewer/index.js.br +0 -0
  38. package/dist/viewer/index.js.gz +0 -0
  39. package/dist/viewer/index.mjs +339 -333
  40. package/dist/viewer/index.mjs.br +0 -0
  41. package/dist/viewer/index.mjs.gz +0 -0
  42. package/package.json +6 -1
@@ -1,5 +1,4 @@
1
- import { l, P, $, f, i, X, U, R, h, V } from './presentation-CLc4eS3z.js';
2
- import * as React from 'react';
1
+ import { l, P, $, U, f, i, X, R, h } from './presentation-CLc4eS3z.js';
3
2
  import React__default from 'react';
4
3
  import { ViewerTheme } from './theme/index.js';
5
4
 
@@ -159,6 +158,130 @@ interface CollaborationConfig {
159
158
  */
160
159
  writeBackDebounceMs?: number;
161
160
  }
161
+ /** Snapshot of a single element's animation state at a point in the timeline. */
162
+ interface ElementAnimationState {
163
+ /** Whether the element should be visible. */
164
+ visible: boolean;
165
+ /** CSS animation shorthand to apply (undefined = no active animation). */
166
+ cssAnimation: string | undefined;
167
+ }
168
+
169
+ /**
170
+ * slide-compare — pure, framework-agnostic slide-diff engine shared by every
171
+ * binding (React / Vue / Angular).
172
+ *
173
+ * Provides two entry points over the same element-diff core:
174
+ * - `comparePresentation(base, compare)` — diffs two full `PptxData` documents
175
+ * (the React surface).
176
+ * - `compareSlides(base, compare)` — diffs two `PptxSlide[]` arrays directly
177
+ * (the Vue editor-foundation surface), plus `compareSlide` for a single
178
+ * slide pair and `diffSlideElements` for the flattened element trees.
179
+ *
180
+ * DOM-free and side-effect-free.
181
+ */
182
+
183
+ type SlideDiffStatus = 'added' | 'removed' | 'changed' | 'unchanged';
184
+ type ElementChangeKind = 'added' | 'removed' | 'moved' | 'resized' | 'textChanged';
185
+ interface ElementChange {
186
+ elementId: string;
187
+ label: string;
188
+ kind: ElementChangeKind;
189
+ description: string;
190
+ }
191
+ interface SlideDiff {
192
+ status: SlideDiffStatus;
193
+ /** Index in the base (current) presentation, or -1 for added slides. */
194
+ baseIndex: number;
195
+ /** Index in the compare (other) presentation, or -1 for removed slides. */
196
+ compareIndex: number;
197
+ /** The base slide data (undefined for added slides). */
198
+ baseSlide?: l;
199
+ /** The compare slide data (undefined for removed slides). */
200
+ compareSlide?: l;
201
+ /** Per-element changes when status is `changed`. */
202
+ changes: ElementChange[];
203
+ }
204
+ interface CompareResult {
205
+ diffs: SlideDiff[];
206
+ baseSlideCount: number;
207
+ compareSlideCount: number;
208
+ addedCount: number;
209
+ removedCount: number;
210
+ changedCount: number;
211
+ unchangedCount: number;
212
+ }
213
+
214
+ /**
215
+ * mobile-viewport.ts: framework-agnostic viewport / touch / orientation
216
+ * detection shared by the React, Vue, and Angular bindings.
217
+ *
218
+ * These are the pure predicates and feature-detection helpers behind each
219
+ * binding's `useIsMobile` / `IsMobileService`. The reactive wiring (React
220
+ * state, Vue refs, Angular signals) stays in the binding; the breakpoint maths
221
+ * and DOM capability probes live here so all three frameworks switch chrome at
222
+ * exactly the same thresholds.
223
+ *
224
+ * SSR / test safe: every probe feature-detects `window` / `navigator` /
225
+ * `screen` and returns a sensible default when absent.
226
+ */
227
+ /** Mobile breakpoint: below this width is considered mobile. */
228
+ declare const MOBILE_BREAKPOINT = 768;
229
+ /** Tablet breakpoint: below this width (but >= MOBILE) is tablet. */
230
+ declare const TABLET_BREAKPOINT = 1024;
231
+ /** Device orientation as reported by the screen / viewport aspect ratio. */
232
+ type DeviceOrientation = 'portrait' | 'landscape';
233
+ interface TouchGestureCallbacks {
234
+ /** Called continuously during a pinch gesture with the new (clamped) scale. */
235
+ onPinchZoom?: (newScale: number) => void;
236
+ /** Called when a horizontal swipe is detected. direction: -1 = left, 1 = right. */
237
+ onSwipe?: (direction: -1 | 1) => void;
238
+ /** Called when a long-press is detected, with the press coordinates. */
239
+ onLongPress?: (clientX: number, clientY: number) => void;
240
+ }
241
+
242
+ /**
243
+ * Pure handout layout calculations, shared by every binding's print path.
244
+ *
245
+ * Handles distributing slides across pages, computing grid dimensions, and
246
+ * positioning cells within A4 page space. No DOM/framework dependency: callers
247
+ * render the resulting rectangles however their view layer prefers.
248
+ */
249
+ /** Supported slides-per-page values. */
250
+ type HandoutSlidesPerPage = 1 | 2 | 3 | 4 | 6 | 9;
251
+
252
+ /**
253
+ * Pure print helpers shared by every binding's print path: settings validation,
254
+ * slide-range / colour-filter resolution, page-count estimation, HTML markup
255
+ * builders, escaping, and the full print-document assembler.
256
+ *
257
+ * No DOM side effects and no `window.print()`: everything is deterministic and
258
+ * the binding writes the returned HTML string into a print window. The handout
259
+ * grid geometry lives in `handout-layout`; this module reuses it.
260
+ *
261
+ * ng-packagr constraint honoured here (the Angular binding inlines this source
262
+ * and compiles it through ng-packagr): NO `String.prototype.replaceAll`
263
+ * (`escapeHtml` uses `.split(x).join(y)` instead).
264
+ */
265
+
266
+ /** What to print. */
267
+ type PrintWhat = 'slides' | 'handouts' | 'notes' | 'outline';
268
+ /** Page orientation for the printed output. */
269
+ type PrintOrientation = 'portrait' | 'landscape';
270
+ /** Colour mode for the printed output. */
271
+ type PrintColorMode = 'color' | 'grayscale' | 'blackAndWhite';
272
+ /** Slide range mode. */
273
+ type PrintSlideRange = 'all' | 'current' | 'custom';
274
+ /** Resolved print settings emitted on confirm. */
275
+ interface PrintSettings {
276
+ printWhat: PrintWhat;
277
+ orientation: PrintOrientation;
278
+ colorMode: PrintColorMode;
279
+ frameSlides: boolean;
280
+ slidesPerPage: HandoutSlidesPerPage;
281
+ slideRange: PrintSlideRange;
282
+ customRangeFrom: number;
283
+ customRangeTo: number;
284
+ }
162
285
 
163
286
  /**
164
287
  * Core data-model types for the PowerPoint viewer/editor plugin.
@@ -575,24 +698,4 @@ interface PowerPointViewerHandle extends FileViewerHandle, PowerPointViewerAPI {
575
698
  getContent: () => Promise<Uint8Array>;
576
699
  }
577
700
 
578
- /**
579
- * Thin adapter shim: the initial-style resolution now lives in
580
- * `pptx-viewer-shared` (`render/animation-effects`). Shared returns a neutral
581
- * `AnimationStyle` (camelCase inline-style map); these wrappers re-type the
582
- * result as `React.CSSProperties` so React consumers/tests are unchanged.
583
- */
584
-
585
- declare function getAnimationInitialStyle(preset: f | undefined, nativeAnimation?: V): React__default.CSSProperties;
586
-
587
- /**
588
- * Root React component for the PowerPoint viewer/editor.
589
- *
590
- * Accepts binary `.pptx` content and renders a full-featured editor with
591
- * slide canvas, toolbar, inspector panels, presentation mode, and more.
592
- *
593
- * Uses `forwardRef` to expose a `PowerPointViewerHandle` for imperative
594
- * access (e.g. serialising the current content for saving).
595
- */
596
- declare const PowerPointViewer: React.ForwardRefExoticComponent<PowerPointViewerProps & React.RefAttributes<PowerPointViewerHandle>>;
597
-
598
- export { type AccessibilityIssue as A, type SlideTransitionOption as B, type CollaborationRole as C, type DragState as D, type EditorHistorySnapshot as E, type FileViewerHandle as F, type StrokeDashOption as G, type SupportedShapeType as H, type ToolbarSection as I, type MarqueeSelectionState as M, PowerPointViewer as P, type ResizeHandle as R, type ShapeAdjustmentDragState as S, type TableCellEditorState as T, type ViewerMode as V, type PowerPointViewerAPI as a, type PowerPointViewerHandle as b, type PowerPointViewerProps as c, type CollaborationConfig as d, type AnimationPresetOption as e, type CanvasSize as f, getAnimationInitialStyle as g, type ConnectorArrowOption as h, type ConnectorGeometryOption as i, type ConnectorGeometryType as j, type ConnectorPathGeometry as k, type DrawingTool as l, type ElementBounds as m, type ElementClipboardPayload as n, type ElementContextMenuAction as o, type ElementContextMenuState as p, type ParsedTableCell as q, type ParsedTableData as r, type PresentationAnimationRuntime as s, type ResizeState as t, type ShapeAdjustmentHandleDescriptor as u, type ShapePreset as v, type ShapeQuickStyle as w, type ShortcutReferenceItem as x, type SlideAlignment as y, type SlideSectionGroup as z };
701
+ export { type AccessibilityIssue as A, type SupportedShapeType as B, type CollaborationConfig as C, type DragState as D, type EditorHistorySnapshot as E, type FileViewerHandle as F, type ToolbarSection as G, type ElementAnimationState as H, type PrintSettings as I, type CompareResult as J, type DeviceOrientation as K, type TouchGestureCallbacks as L, type MarqueeSelectionState as M, MOBILE_BREAKPOINT as N, TABLET_BREAKPOINT as O, type PowerPointViewerAPI as P, type ResizeHandle as R, type ShapeAdjustmentDragState as S, type TableCellEditorState as T, type ViewerMode as V, type PowerPointViewerHandle as a, type PowerPointViewerProps as b, type AnimationPresetOption as c, type CanvasSize as d, type CollaborationRole as e, type ConnectorArrowOption as f, type ConnectorGeometryOption as g, type ConnectorGeometryType as h, type ConnectorPathGeometry as i, type DrawingTool as j, type ElementBounds as k, type ElementClipboardPayload as l, type ElementContextMenuAction as m, type ElementContextMenuState as n, type ParsedTableCell as o, type ParsedTableData as p, type PresentationAnimationRuntime as q, type ResizeState as r, type ShapeAdjustmentHandleDescriptor as s, type ShapePreset as t, type ShapeQuickStyle as u, type ShortcutReferenceItem as v, type SlideAlignment as w, type SlideSectionGroup as x, type SlideTransitionOption as y, type StrokeDashOption as z };