pptx-react-viewer 1.1.23 → 1.1.31

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.
@@ -1,4 +1,4 @@
1
- import { l, P, $, f, i, X, U, R, h, V } from './presentation-nZxgWvXq.js';
1
+ import { l, P, $, f, i, X, U, R, h, V } from './presentation-BWchOWpy.js';
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
  import { ViewerTheme } from './theme/index.js';
@@ -62,7 +62,7 @@ interface DragState {
62
62
  domEls: Map<string, HTMLElement>;
63
63
  /** Whether the pointer has actually moved since the drag started. */
64
64
  moved: boolean;
65
- /** Accumulated delta stored during DOM-only drag, committed on pointerup. */
65
+ /** Accumulated delta, stored during DOM-only drag, committed on pointerup. */
66
66
  lastDx: number;
67
67
  lastDy: number;
68
68
  }
@@ -94,7 +94,7 @@ interface ResizeState {
94
94
  moved: boolean;
95
95
  /** DOM element cached at resize-start to avoid per-frame querySelector calls. */
96
96
  domEl: HTMLElement | null;
97
- /** Accumulated final geometry committed on pointerup. */
97
+ /** Accumulated final geometry, committed on pointerup. */
98
98
  lastX: number;
99
99
  lastY: number;
100
100
  lastWidth: number;
@@ -176,7 +176,7 @@ interface ShapeQuickStyle {
176
176
  }
177
177
 
178
178
  /**
179
- * Collaboration types Shared type definitions for the real-time
179
+ * Collaboration types: Shared type definitions for the real-time
180
180
  * collaboration infrastructure (Yjs-backed CRDT sync, presence tracking,
181
181
  * collaborative editing).
182
182
  *
@@ -205,7 +205,7 @@ interface CollaborationConfig {
205
205
  userColor?: string;
206
206
  /** Optional authentication token sent with the WebSocket handshake. */
207
207
  authToken?: string;
208
- /** Role in the session defaults to `'collaborator'`. */
208
+ /** Role in the session: defaults to `'collaborator'`. */
209
209
  role?: CollaborationRole;
210
210
  }
211
211
  /** Connection lifecycle states for the Yjs WebSocket provider. */
@@ -384,13 +384,20 @@ interface AnimationPresetOption {
384
384
  interface PowerPointViewerProps {
385
385
  /** PowerPoint content as Uint8Array */
386
386
  content: Uint8Array;
387
- /** Original file path used for autosave recovery */
387
+ /** Original file path, used for autosave recovery */
388
388
  filePath?: string;
389
389
  /** Callback when content has unsaved changes */
390
390
  onDirtyChange?: (isDirty: boolean) => void;
391
391
  onContentChange?: (content: Uint8Array) => void;
392
392
  /** Callback when active slide changes */
393
393
  onActiveSlideChange?: (slideIndex: number) => void;
394
+ /**
395
+ * Host override for the File ▸ Open action. When provided, the built-in
396
+ * native file picker is bypassed and this is invoked instead; the host is
397
+ * then responsible for supplying a new `content` buffer. When omitted, the
398
+ * viewer opens its own picker and loads the chosen presentation in place.
399
+ */
400
+ onOpenFile?: () => void;
394
401
  /** Whether editing actions are enabled */
395
402
  canEdit?: boolean;
396
403
  /** Optional class name */
@@ -474,11 +481,26 @@ interface PowerPointViewerProps {
474
481
  userName?: string;
475
482
  serverUrl?: string;
476
483
  };
484
+ /**
485
+ * Opt in to the experimental Three.js SmartArt renderer. When `true`,
486
+ * SmartArt diagrams render as extruded 3D blocks on a WebGL canvas instead
487
+ * of flat SVG. Requires the optional `three` peer dependency; when it is not
488
+ * installed (or the diagram has no geometry), the viewer transparently falls
489
+ * back to the SVG `SmartArtRenderer`. Default `false`.
490
+ */
491
+ smartArt3D?: boolean;
477
492
  }
478
493
  interface PowerPointViewerHandle extends FileViewerHandle {
479
494
  getContent: () => Promise<Uint8Array>;
480
495
  }
481
496
 
497
+ /**
498
+ * Thin adapter shim: the initial-style resolution now lives in
499
+ * `pptx-viewer-shared` (`render/animation-effects`). Shared returns a neutral
500
+ * `AnimationStyle` (camelCase inline-style map); these wrappers re-type the
501
+ * result as `React.CSSProperties` so React consumers/tests are unchanged.
502
+ */
503
+
482
504
  declare function getAnimationInitialStyle(preset: f | undefined, nativeAnimation?: V): React__default.CSSProperties;
483
505
 
484
506
  /**
@@ -1,4 +1,4 @@
1
- import { l, P, $, f, i, X, U, R, h, V } from './presentation-nZxgWvXq.js';
1
+ import { l, P, $, f, i, X, U, R, h, V } from './presentation-BWchOWpy.js';
2
2
  import * as React from 'react';
3
3
  import React__default from 'react';
4
4
  import { ViewerTheme } from './theme/index.js';
@@ -62,7 +62,7 @@ interface DragState {
62
62
  domEls: Map<string, HTMLElement>;
63
63
  /** Whether the pointer has actually moved since the drag started. */
64
64
  moved: boolean;
65
- /** Accumulated delta stored during DOM-only drag, committed on pointerup. */
65
+ /** Accumulated delta, stored during DOM-only drag, committed on pointerup. */
66
66
  lastDx: number;
67
67
  lastDy: number;
68
68
  }
@@ -94,7 +94,7 @@ interface ResizeState {
94
94
  moved: boolean;
95
95
  /** DOM element cached at resize-start to avoid per-frame querySelector calls. */
96
96
  domEl: HTMLElement | null;
97
- /** Accumulated final geometry committed on pointerup. */
97
+ /** Accumulated final geometry, committed on pointerup. */
98
98
  lastX: number;
99
99
  lastY: number;
100
100
  lastWidth: number;
@@ -176,7 +176,7 @@ interface ShapeQuickStyle {
176
176
  }
177
177
 
178
178
  /**
179
- * Collaboration types Shared type definitions for the real-time
179
+ * Collaboration types: Shared type definitions for the real-time
180
180
  * collaboration infrastructure (Yjs-backed CRDT sync, presence tracking,
181
181
  * collaborative editing).
182
182
  *
@@ -205,7 +205,7 @@ interface CollaborationConfig {
205
205
  userColor?: string;
206
206
  /** Optional authentication token sent with the WebSocket handshake. */
207
207
  authToken?: string;
208
- /** Role in the session defaults to `'collaborator'`. */
208
+ /** Role in the session: defaults to `'collaborator'`. */
209
209
  role?: CollaborationRole;
210
210
  }
211
211
  /** Connection lifecycle states for the Yjs WebSocket provider. */
@@ -384,13 +384,20 @@ interface AnimationPresetOption {
384
384
  interface PowerPointViewerProps {
385
385
  /** PowerPoint content as Uint8Array */
386
386
  content: Uint8Array;
387
- /** Original file path used for autosave recovery */
387
+ /** Original file path, used for autosave recovery */
388
388
  filePath?: string;
389
389
  /** Callback when content has unsaved changes */
390
390
  onDirtyChange?: (isDirty: boolean) => void;
391
391
  onContentChange?: (content: Uint8Array) => void;
392
392
  /** Callback when active slide changes */
393
393
  onActiveSlideChange?: (slideIndex: number) => void;
394
+ /**
395
+ * Host override for the File ▸ Open action. When provided, the built-in
396
+ * native file picker is bypassed and this is invoked instead; the host is
397
+ * then responsible for supplying a new `content` buffer. When omitted, the
398
+ * viewer opens its own picker and loads the chosen presentation in place.
399
+ */
400
+ onOpenFile?: () => void;
394
401
  /** Whether editing actions are enabled */
395
402
  canEdit?: boolean;
396
403
  /** Optional class name */
@@ -474,11 +481,26 @@ interface PowerPointViewerProps {
474
481
  userName?: string;
475
482
  serverUrl?: string;
476
483
  };
484
+ /**
485
+ * Opt in to the experimental Three.js SmartArt renderer. When `true`,
486
+ * SmartArt diagrams render as extruded 3D blocks on a WebGL canvas instead
487
+ * of flat SVG. Requires the optional `three` peer dependency; when it is not
488
+ * installed (or the diagram has no geometry), the viewer transparently falls
489
+ * back to the SVG `SmartArtRenderer`. Default `false`.
490
+ */
491
+ smartArt3D?: boolean;
477
492
  }
478
493
  interface PowerPointViewerHandle extends FileViewerHandle {
479
494
  getContent: () => Promise<Uint8Array>;
480
495
  }
481
496
 
497
+ /**
498
+ * Thin adapter shim: the initial-style resolution now lives in
499
+ * `pptx-viewer-shared` (`render/animation-effects`). Shared returns a neutral
500
+ * `AnimationStyle` (camelCase inline-style map); these wrappers re-type the
501
+ * result as `React.CSSProperties` so React consumers/tests are unchanged.
502
+ */
503
+
482
504
  declare function getAnimationInitialStyle(preset: f | undefined, nativeAnimation?: V): React__default.CSSProperties;
483
505
 
484
506
  /**
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- export { P as PowerPointViewer, a as PowerPointViewerHandle, b as PowerPointViewerProps, g as getAnimationInitialStyle } from './PowerPointViewer-BZa65J1D.mjs';
1
+ export { P as PowerPointViewer, a as PowerPointViewerHandle, b as PowerPointViewerProps, g as getAnimationInitialStyle } from './PowerPointViewer-765OcwHH.mjs';
2
2
  import { Options } from 'html2canvas-pro';
3
3
  import { ViewerTheme } from './theme/index.js';
4
4
  export { ViewerTheme, ViewerThemeColors, defaultCssVars, defaultRadius, defaultThemeColors, themeToCssVars } from './theme/index.js';
5
5
  import * as React$1 from 'react';
6
- import './presentation-nZxgWvXq.js';
6
+ import './presentation-BWchOWpy.js';
7
7
  import 'yjs';
8
8
 
9
9
  interface ViewerThemeProviderProps {
@@ -13,7 +13,7 @@ interface ViewerThemeProviderProps {
13
13
  /**
14
14
  * Provides a `ViewerTheme` to all descendant viewer components.
15
15
  *
16
- * Typically you do **not** need to use this directly passing a `theme`
16
+ * Typically you do **not** need to use this directly; passing a `theme`
17
17
  * prop to `<PowerPointViewer>` is sufficient. This provider is exposed
18
18
  * for advanced use-cases where you want to wrap multiple viewers or
19
19
  * share a theme across a wider subtree.
@@ -28,7 +28,7 @@ declare function useViewerTheme(): ViewerTheme | undefined;
28
28
  /**
29
29
  * A drop-in replacement for `html2canvas(element, options)` that first
30
30
  * resolves any oklch / oklab / lch / lab / color() values in the cloned
31
- * DOM to rgb()/hex, preventing parse errors in html2canvas 1.x.
31
+ * DOM to rgb()/hex, preventing parse errors in html2canvas <= 1.x.
32
32
  *
33
33
  * Three-pronged approach:
34
34
  * 1. Patch `<style>` elements to replace oklch in CSS custom properties.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- export { P as PowerPointViewer, a as PowerPointViewerHandle, b as PowerPointViewerProps, g as getAnimationInitialStyle } from './PowerPointViewer-BZa65J1D.js';
1
+ export { P as PowerPointViewer, a as PowerPointViewerHandle, b as PowerPointViewerProps, g as getAnimationInitialStyle } from './PowerPointViewer-765OcwHH.js';
2
2
  import { Options } from 'html2canvas-pro';
3
3
  import { ViewerTheme } from './theme/index.js';
4
4
  export { ViewerTheme, ViewerThemeColors, defaultCssVars, defaultRadius, defaultThemeColors, themeToCssVars } from './theme/index.js';
5
5
  import * as React$1 from 'react';
6
- import './presentation-nZxgWvXq.js';
6
+ import './presentation-BWchOWpy.js';
7
7
  import 'yjs';
8
8
 
9
9
  interface ViewerThemeProviderProps {
@@ -13,7 +13,7 @@ interface ViewerThemeProviderProps {
13
13
  /**
14
14
  * Provides a `ViewerTheme` to all descendant viewer components.
15
15
  *
16
- * Typically you do **not** need to use this directly passing a `theme`
16
+ * Typically you do **not** need to use this directly; passing a `theme`
17
17
  * prop to `<PowerPointViewer>` is sufficient. This provider is exposed
18
18
  * for advanced use-cases where you want to wrap multiple viewers or
19
19
  * share a theme across a wider subtree.
@@ -28,7 +28,7 @@ declare function useViewerTheme(): ViewerTheme | undefined;
28
28
  /**
29
29
  * A drop-in replacement for `html2canvas(element, options)` that first
30
30
  * resolves any oklch / oklab / lch / lab / color() values in the cloned
31
- * DOM to rgb()/hex, preventing parse errors in html2canvas 1.x.
31
+ * DOM to rgb()/hex, preventing parse errors in html2canvas <= 1.x.
32
32
  *
33
33
  * Three-pronged approach:
34
34
  * 1. Patch `<style>` elements to replace oklch in CSS custom properties.