@naviedu/room-platform-react 0.0.9 → 0.0.12

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/README.md CHANGED
@@ -27,14 +27,12 @@ runtime dependencies are installed automatically with the package.
27
27
 
28
28
  ## Basic usage
29
29
 
30
- Import the package stylesheet once, then render `RoomPlatformRoom` with the
31
- launch ticket returned by your backend:
30
+ Render `RoomPlatformRoom` with the launch ticket returned by your backend:
32
31
 
33
32
  ```tsx
34
33
  'use client'
35
34
 
36
35
  import { type RoomLaunchTicketRenewalReason, RoomPlatformRoom } from '@naviedu/room-platform-react'
37
- import '@naviedu/room-platform-react/styles.css'
38
36
 
39
37
  type RoomTicketResponse = { launchToken: string }
40
38
 
@@ -61,6 +59,10 @@ export function Room({ launchToken }: { launchToken: string }) {
61
59
  }
62
60
  ```
63
61
 
62
+ `RoomPlatformRoom` renders its default room UI in an isolated Shadow Root and installs the package stylesheet itself. Do not import `@naviedu/room-platform-react/styles.css` for the default component.
63
+
64
+ `RoomPlatformProvider` is advanced composition only; a consumer using it instead of `RoomPlatformRoom` owns its own DOM and stylesheet boundary.
65
+
64
66
  `apiBaseUrl` is the URL prefix before `/rooms`. The package calls these routes
65
67
  relative to it:
66
68
 
@@ -85,13 +87,18 @@ layout that allows the room to occupy the viewport.
85
87
  | `extensions` | No | Host-provided top-bar, workspace, sidebar, monitor, and participant extensions. |
86
88
  | `integrations` | No | Chat and whiteboard configuration. |
87
89
  | `isPracticeMode` | No | Enables practice-room presentation behavior. |
88
- | `showLocalPreview` | No | Shows the local preview in the sidebar. Defaults to `true`. |
89
- | `primaryCameraSelector` | No | Selects the primary camera track when the default selection is not suitable. |
90
90
  | `onError` | No | Receives connection, media, and action errors. |
91
91
  | `onLifecycleEvent` | No | Receives exchange, renewal, and reconnect lifecycle events. |
92
92
  | `onExit` | No | Called when the user chooses to leave the room. |
93
93
  | `children` | No | Replaces the default workspace while keeping the provider and room runtime. |
94
94
 
95
+ The default teaching stage selects the available participant camera carrying
96
+ the canonical `room:moderate` capability. Screen share remains primary and the
97
+ moderator camera becomes its overlay. If no moderator camera is available, the
98
+ stage keeps its waiting state and never promotes a student camera. The local
99
+ sidebar preview is hidden only when that selected moderator camera is local;
100
+ its existing desktop breakpoint remains unchanged.
101
+
95
102
  ### Error and lifecycle callbacks
96
103
 
97
104
  ```tsx
@@ -153,6 +160,9 @@ whiteboard surface. Omit either integration when the host does not use it.
153
160
  Extensions keep host-specific UI outside the shared room implementation. Every
154
161
  extension receives `RoomPlatformExtensionProps`:
155
162
 
163
+ Host extensions with independent framework CSS must own their own DOM and
164
+ stylesheet boundary.
165
+
156
166
  ```tsx
157
167
  import type { RoomPlatformExtensionProps } from '@naviedu/room-platform-react'
158
168
 
package/index.d.ts CHANGED
@@ -393,7 +393,6 @@ export declare type RoomPlatformExtensions = {
393
393
  topBarTrailing?: ComponentType<RoomPlatformExtensionProps>;
394
394
  monitor?: {
395
395
  roster: readonly RoomParticipantRosterEntry[];
396
- roomEligible: boolean;
397
396
  };
398
397
  mainWorkspace?: {
399
398
  placement: 'overlay' | 'alongside-stage';
@@ -617,7 +616,7 @@ export declare type RoomPlatformProviderProps = PropsWithChildren<{
617
616
  }>;
618
617
  }>;
619
618
 
620
- export declare function RoomPlatformRoom({ children, extensions, integrations, isPracticeMode, onExit, primaryCameraSelector, showLocalPreview, sizing, ...providerProps }: RoomPlatformRoomProps): JSX.Element;
619
+ export declare function RoomPlatformRoom(props: RoomPlatformRoomProps): JSX.Element;
621
620
 
622
621
  export declare type RoomPlatformRoomProps = {
623
622
  apiBaseUrl: string;
@@ -626,8 +625,6 @@ export declare type RoomPlatformRoomProps = {
626
625
  launchToken: string;
627
626
  isPracticeMode?: boolean;
628
627
  sizing?: RoomPlatformSizing;
629
- primaryCameraSelector?: (cameraTracks: readonly TrackReference[], activeSpeakerParticipantIdentity?: string) => TrackReference | null;
630
- showLocalPreview?: boolean;
631
628
  onError?: (event: RoomPlatformErrorEvent) => void;
632
629
  onLifecycleEvent?: (event: RoomPlatformLifecycleEvent) => void;
633
630
  onExit?: () => void;
@@ -663,14 +660,13 @@ export declare type RoomPlatformShellProps = {
663
660
 
664
661
  export declare type RoomPlatformSizing = 'viewport' | 'container';
665
662
 
666
- export declare function RoomPlatformSpeakQueue({ activeSpeakerParticipantIdentity, activeSpeakerSlot, canApproveSpeak, canClearActiveSpeaker, canRejectSpeak, isClearingActiveSpeaker, isPracticeMode, onApproveSpeakRequest, onClearActiveSpeaker, onRejectSpeakRequest, participants, raisedHandParticipantIdentities, }: {
663
+ export declare function RoomPlatformSpeakQueue({ activeSpeakerParticipantIdentity, activeSpeakerSlot, canApproveSpeak, canClearActiveSpeaker, canRejectSpeak, isClearingActiveSpeaker, onApproveSpeakRequest, onClearActiveSpeaker, onRejectSpeakRequest, participants, raisedHandParticipantIdentities, }: {
667
664
  activeSpeakerParticipantIdentity?: string;
668
665
  activeSpeakerSlot?: ReactNode;
669
666
  canApproveSpeak?: boolean;
670
667
  canClearActiveSpeaker?: boolean;
671
668
  canRejectSpeak?: boolean;
672
669
  isClearingActiveSpeaker?: boolean;
673
- isPracticeMode?: boolean;
674
670
  onApproveSpeakRequest?: (participantIdentity: string) => Promise<void> | void;
675
671
  onClearActiveSpeaker?: () => void;
676
672
  onRejectSpeakRequest?: (participantIdentity: string) => Promise<void> | void;