pptx-react-viewer 1.1.72 → 1.1.74

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,9 +1,9 @@
1
- import { C as CollaborationConfig, c as ConnectionStatus, U as UserPresence, d as CollaborationContextValue } from '../PowerPointViewer-DSaLy8x5.js';
2
- export { A as AccessibilityIssue, e as AnimationPresetOption, f as CanvasSize, h as CollaborationRole, i as ConnectorArrowOption, j as ConnectorGeometryOption, k as ConnectorGeometryType, l as ConnectorPathGeometry, D as DragState, m as DrawingTool, E as EditorHistorySnapshot, n as ElementBounds, o as ElementClipboardPayload, p as ElementContextMenuAction, q as ElementContextMenuState, F as FileViewerHandle, M as MarqueeSelectionState, r as ParsedTableCell, s as ParsedTableData, P as PowerPointViewer, a as PowerPointViewerHandle, b as PowerPointViewerProps, t as PresentationAnimationRuntime, R as ResizeHandle, u as ResizeState, S as ShapeAdjustmentDragState, v as ShapeAdjustmentHandleDescriptor, w as ShapePreset, x as ShapeQuickStyle, y as ShortcutReferenceItem, z as SlideAlignment, B as SlideSectionGroup, G as SlideTransitionOption, H as StrokeDashOption, I as SupportedShapeType, T as TableCellEditorState, J as ToolbarSection, V as ViewerMode, g as getAnimationInitialStyle } from '../PowerPointViewer-DSaLy8x5.js';
1
+ import { C as CollaborationRole, c as CollaborationConfig } from '../PowerPointViewer-DNlwKuTs.js';
2
+ export { A as AccessibilityIssue, d as AnimationPresetOption, e as CanvasSize, f as ConnectorArrowOption, h as ConnectorGeometryOption, i as ConnectorGeometryType, j as ConnectorPathGeometry, D as DragState, k as DrawingTool, E as EditorHistorySnapshot, l as ElementBounds, m as ElementClipboardPayload, n as ElementContextMenuAction, o as ElementContextMenuState, F as FileViewerHandle, M as MarqueeSelectionState, p as ParsedTableCell, q as ParsedTableData, P as PowerPointViewer, a as PowerPointViewerHandle, b as PowerPointViewerProps, r as PresentationAnimationRuntime, R as ResizeHandle, s as ResizeState, S as ShapeAdjustmentDragState, t as ShapeAdjustmentHandleDescriptor, u as ShapePreset, v as ShapeQuickStyle, w as ShortcutReferenceItem, x as SlideAlignment, y as SlideSectionGroup, z as SlideTransitionOption, B as StrokeDashOption, G as SupportedShapeType, T as TableCellEditorState, H as ToolbarSection, V as ViewerMode, g as getAnimationInitialStyle } from '../PowerPointViewer-DNlwKuTs.js';
3
3
  import { d, e, n, o, m, l, P, X, p, q, r, s, t, u, v, w, x, y, z, A, B, D, E, F, G, H, J, K, L, h, i, k, j, f, g } from './presentation-BRAUjTRt.js';
4
4
  import React__default, { RefObject } from 'react';
5
- import { Awareness } from 'y-protocols/awareness';
6
5
  import { Doc } from 'yjs';
6
+ import { Awareness } from 'y-protocols/awareness';
7
7
  import './theme/index.js';
8
8
 
9
9
  /**
@@ -1357,6 +1357,60 @@ declare class PptxHandler extends PptxHandlerCore {
1357
1357
  static create(options?: PresentationOptions): Promise<PresentationBuilderResult>;
1358
1358
  }
1359
1359
 
1360
+ /**
1361
+ * Collaboration types: Shared type definitions for the real-time
1362
+ * collaboration infrastructure (Yjs-backed CRDT sync, presence tracking,
1363
+ * collaborative editing).
1364
+ *
1365
+ * @module collaboration/types
1366
+ */
1367
+
1368
+ /** Connection lifecycle states for the Yjs WebSocket provider. */
1369
+ type ConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'error';
1370
+ /**
1371
+ * Presence data broadcast to other participants.
1372
+ * Cursor position is relative to the slide canvas (0..canvasWidth, 0..canvasHeight).
1373
+ */
1374
+ interface UserPresence {
1375
+ /** Unique client ID (assigned by Yjs awareness). */
1376
+ clientId: number;
1377
+ /** Sanitised display name. */
1378
+ userName: string;
1379
+ /** Optional avatar URL (validated). */
1380
+ userAvatar?: string;
1381
+ /** Hex colour for the user's cursor ring. */
1382
+ userColor: string;
1383
+ /** Slide index the user is currently viewing. */
1384
+ activeSlideIndex: number;
1385
+ /** Cursor X on the canvas (clamped to slide bounds). */
1386
+ cursorX: number;
1387
+ /** Cursor Y on the canvas (clamped to slide bounds). */
1388
+ cursorY: number;
1389
+ /** ISO timestamp of last update (for stale-presence cleanup). */
1390
+ lastUpdated: string;
1391
+ /** Optional currently selected element ID. */
1392
+ selectedElementId?: string;
1393
+ /** Role in the session (owner, viewer, or collaborator). */
1394
+ role?: CollaborationRole;
1395
+ }
1396
+ /** Value exposed by `CollaborationContext`. */
1397
+ interface CollaborationContextValue {
1398
+ /** Current WebSocket connection status. */
1399
+ status: ConnectionStatus;
1400
+ /** Presence data for all remote users (excludes the local user). */
1401
+ remoteUsers: UserPresence[];
1402
+ /** Broadcast the local user's presence state. */
1403
+ broadcastPresence: (update: Partial<Omit<UserPresence, 'clientId'>>) => void;
1404
+ /** Total number of connected users (including local). */
1405
+ connectedCount: number;
1406
+ /** The collaboration config that was provided. */
1407
+ config: CollaborationConfig;
1408
+ /** The Yjs document (for document sync). */
1409
+ doc: Doc | null;
1410
+ /** Manually retry the WebSocket connection after a timeout or error. */
1411
+ retry: () => void;
1412
+ }
1413
+
1360
1414
  /** Returns true if the current page was opened as an audience tab. */
1361
1415
  declare function isAudienceTab(): boolean;
1362
1416
 
@@ -1440,10 +1494,13 @@ interface ThemeSwitchingResult {
1440
1494
  declare function useThemeSwitching(input: UseThemeSwitchingInput): ThemeSwitchingResult;
1441
1495
 
1442
1496
  /**
1443
- * useYjsProvider: Manages the Yjs document and WebSocket provider lifecycle.
1497
+ * useYjsProvider: Manages the Yjs document and provider lifecycle.
1444
1498
  *
1445
- * Creates a Y.Doc and connects via WebSocketProvider to the collaboration
1446
- * server. Exposes connection status and cleanup on unmount.
1499
+ * Creates a Y.Doc and connects via one of two transports:
1500
+ * - `websocket` (default): WebSocketProvider against `config.serverUrl`.
1501
+ * - `webrtc`: peer-to-peer WebrtcProvider (no document server); usable from
1502
+ * static hosting. Same-browser tabs sync over BroadcastChannel.
1503
+ * Exposes connection status and cleanup on unmount.
1447
1504
  *
1448
1505
  * This hook is intentionally thin: it only manages the transport layer.
1449
1506
  * Application-level collaboration logic lives in useCollaborativeState
@@ -1632,4 +1689,4 @@ interface CollaborationStatusIndicatorProps {
1632
1689
  }
1633
1690
  declare function CollaborationStatusIndicator({ status, connectedCount, onRetry, }: CollaborationStatusIndicatorProps): React__default.ReactElement;
1634
1691
 
1635
- export { CollaborationConfig, CollaborationContextValue, CollaborationProvider, CollaborationStatusIndicator, type CollaborationStatusIndicatorProps, ConnectionStatus, RemoteUserCursors, type RemoteUserCursorsProps, type ThemeSwitchingResult, type UseCollaborativeHistoryResult, type UseCollaborativeStateInput, type UsePresenceTrackingResult, type UseThemeSwitchingInput, UserAvatarBar, type UserAvatarBarProps, UserPresence, clearAudienceContent, isAudienceTab, loadAudienceContent, storeAudienceContent, useCollaborativeHistory, useCollaborativeState, usePresenceTracking, useThemeSwitching, useYjsProvider };
1692
+ export { CollaborationConfig, type CollaborationContextValue, CollaborationProvider, CollaborationRole, CollaborationStatusIndicator, type CollaborationStatusIndicatorProps, type ConnectionStatus, RemoteUserCursors, type RemoteUserCursorsProps, type ThemeSwitchingResult, type UseCollaborativeHistoryResult, type UseCollaborativeStateInput, type UsePresenceTrackingResult, type UseThemeSwitchingInput, UserAvatarBar, type UserAvatarBarProps, type UserPresence, clearAudienceContent, isAudienceTab, loadAudienceContent, storeAudienceContent, useCollaborativeHistory, useCollaborativeState, usePresenceTracking, useThemeSwitching, useYjsProvider };