pptx-react-viewer 1.1.73 → 1.1.75

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,65 @@ 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
+ /**
1411
+ * Whether the provider completed its initial document sync (or the
1412
+ * first-write grace period elapsed). Local doc writes are gated on this.
1413
+ */
1414
+ synced: boolean;
1415
+ /** Manually retry the WebSocket connection after a timeout or error. */
1416
+ retry: () => void;
1417
+ }
1418
+
1360
1419
  /** Returns true if the current page was opened as an audience tab. */
1361
1420
  declare function isAudienceTab(): boolean;
1362
1421
 
@@ -1440,10 +1499,13 @@ interface ThemeSwitchingResult {
1440
1499
  declare function useThemeSwitching(input: UseThemeSwitchingInput): ThemeSwitchingResult;
1441
1500
 
1442
1501
  /**
1443
- * useYjsProvider: Manages the Yjs document and WebSocket provider lifecycle.
1502
+ * useYjsProvider: Manages the Yjs document and provider lifecycle.
1444
1503
  *
1445
- * Creates a Y.Doc and connects via WebSocketProvider to the collaboration
1446
- * server. Exposes connection status and cleanup on unmount.
1504
+ * Creates a Y.Doc and connects via one of two transports:
1505
+ * - `websocket` (default): WebSocketProvider against `config.serverUrl`.
1506
+ * - `webrtc`: peer-to-peer WebrtcProvider (no document server); usable from
1507
+ * static hosting. Same-browser tabs sync over BroadcastChannel.
1508
+ * Exposes connection status and cleanup on unmount.
1447
1509
  *
1448
1510
  * This hook is intentionally thin: it only manages the transport layer.
1449
1511
  * Application-level collaboration logic lives in useCollaborativeState
@@ -1464,6 +1526,15 @@ interface UseYjsProviderResult {
1464
1526
  doc: Doc | null;
1465
1527
  /** Local awareness client ID. */
1466
1528
  clientId: number | null;
1529
+ /**
1530
+ * Whether the provider completed its initial document sync. Local doc
1531
+ * writes should be gated on this so a late joiner never seeds its
1532
+ * bootstrap deck into a room whose content has not arrived yet. Websocket
1533
+ * flips it on the provider's 'synced' event; webrtc flips it on peer sync
1534
+ * or after {@link INITIAL_SYNC_GRACE_MS} (a lone fresh-room peer never
1535
+ * receives a sync event).
1536
+ */
1537
+ synced: boolean;
1467
1538
  /** Manually retry the connection after a timeout or error. */
1468
1539
  retry: () => void;
1469
1540
  }
@@ -1632,4 +1703,4 @@ interface CollaborationStatusIndicatorProps {
1632
1703
  }
1633
1704
  declare function CollaborationStatusIndicator({ status, connectedCount, onRetry, }: CollaborationStatusIndicatorProps): React__default.ReactElement;
1634
1705
 
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 };
1706
+ 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 };