@q9labsai/chalk-react-native 4.1.17 → 5.0.1
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 +134 -29
- package/android/build.gradle +35 -0
- package/android/compatibility/ModuleApiCompatibility.java +215 -0
- package/android/src/main/AndroidManifest.xml +2 -1
- package/android/src/main/java/ai/q9labs/chalk/reactnative/ChalkSpaceForegroundService.java +105 -31
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/ChalkAndroidConnectionServicePackage.kt +2 -0
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/ChalkAudioRouteModule.kt +137 -0
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/ChalkCallServiceModule.kt +32 -0
- package/android/src/main/kotlin/ai/q9labs/chalk/reactnative/CommunicationDeviceListener.kt +23 -0
- package/android/src/test/kotlin/ai/q9labs/chalk/compatibility/UnsafeSignatures.kt +29 -0
- package/dist/android/call-service.d.ts +4 -0
- package/dist/android/call-service.d.ts.map +1 -0
- package/dist/avatar/FaceAvatar.d.ts +19 -0
- package/dist/avatar/FaceAvatar.d.ts.map +1 -0
- package/dist/avatar/tile-avatar-size.d.ts +3 -0
- package/dist/avatar/tile-avatar-size.d.ts.map +1 -0
- package/dist/chunk-GYVZSOGQ.js +30 -0
- package/dist/chunk-IHE6EA3T.js +25 -0
- package/dist/chunk-OIBT2FNM.js +1479 -0
- package/dist/client.d.ts +1 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +185 -2
- package/dist/components/EmbeddedWhiteboard.d.ts.map +1 -1
- package/dist/components/native-media-visibility.d.ts +3 -2
- package/dist/components/native-media-visibility.d.ts.map +1 -1
- package/dist/components/useAndroidCallService.d.ts +8 -0
- package/dist/components/useAndroidCallService.d.ts.map +1 -0
- package/dist/dev.d.ts +10 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +10 -0
- package/dist/dock/Dock.d.ts +23 -0
- package/dist/dock/Dock.d.ts.map +1 -0
- package/dist/dock/LeaveMenu.d.ts +12 -0
- package/dist/dock/LeaveMenu.d.ts.map +1 -0
- package/dist/dock/MoreSheet.d.ts +17 -0
- package/dist/dock/MoreSheet.d.ts.map +1 -0
- package/dist/dock/ReactionBurst.d.ts +8 -0
- package/dist/dock/ReactionBurst.d.ts.map +1 -0
- package/dist/dock/RoutePicker.d.ts +16 -0
- package/dist/dock/RoutePicker.d.ts.map +1 -0
- package/dist/dock/audio-route.d.ts +25 -0
- package/dist/dock/audio-route.d.ts.map +1 -0
- package/dist/error-YOPTEH5N.wav +0 -0
- package/dist/frame/CallFrame.d.ts +17 -0
- package/dist/frame/CallFrame.d.ts.map +1 -0
- package/dist/frame/Chalk.d.ts +40 -0
- package/dist/frame/Chalk.d.ts.map +1 -0
- package/dist/frame/back-handler.d.ts +6 -0
- package/dist/frame/back-handler.d.ts.map +1 -0
- package/dist/frame/dev-scenario.d.ts +28 -0
- package/dist/frame/dev-scenario.d.ts.map +1 -0
- package/dist/frame/device-layout.d.ts +16 -0
- package/dist/frame/device-layout.d.ts.map +1 -0
- package/dist/frame/measurement.d.ts +28 -0
- package/dist/frame/measurement.d.ts.map +1 -0
- package/dist/frame/portal.d.ts +24 -0
- package/dist/frame/portal.d.ts.map +1 -0
- package/dist/frame/preferences.d.ts +21 -0
- package/dist/frame/preferences.d.ts.map +1 -0
- package/dist/frame/regions.d.ts +25 -0
- package/dist/frame/regions.d.ts.map +1 -0
- package/dist/hand-DFWVXPH2.wav +0 -0
- package/dist/haptics/haptics.d.ts +12 -0
- package/dist/haptics/haptics.d.ts.map +1 -0
- package/dist/header/CallDetailsSheet.d.ts +18 -0
- package/dist/header/CallDetailsSheet.d.ts.map +1 -0
- package/dist/header/Header.d.ts +17 -0
- package/dist/header/Header.d.ts.map +1 -0
- package/dist/header/QrCode.d.ts +6 -0
- package/dist/header/QrCode.d.ts.map +1 -0
- package/dist/icons/Icon.d.ts +12 -0
- package/dist/icons/Icon.d.ts.map +1 -0
- package/dist/icons/icon-element.d.ts +24 -0
- package/dist/icons/icon-element.d.ts.map +1 -0
- package/dist/icons/icon-paths.d.ts +530 -0
- package/dist/icons/icon-paths.d.ts.map +1 -0
- package/dist/index.d.ts +6 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2956 -38
- package/dist/join-Z6RL5AHE.wav +0 -0
- package/dist/knock-4VBQSHK4.wav +0 -0
- package/dist/leave-MQLZOWQD.wav +0 -0
- package/dist/limbo/Limbo.d.ts +25 -0
- package/dist/limbo/Limbo.d.ts.map +1 -0
- package/dist/limbo/Veil.d.ts +10 -0
- package/dist/limbo/Veil.d.ts.map +1 -0
- package/dist/media/native-capture-error.d.ts +7 -0
- package/dist/media/native-capture-error.d.ts.map +1 -0
- package/dist/message-6Y6WJGTB.wav +0 -0
- package/dist/motion/MovingFrame.d.ts +36 -0
- package/dist/motion/MovingFrame.d.ts.map +1 -0
- package/dist/motion/motion.d.ts +82 -0
- package/dist/motion/motion.d.ts.map +1 -0
- package/dist/motion/presence.d.ts +6 -0
- package/dist/motion/presence.d.ts.map +1 -0
- package/dist/motion/press.d.ts +15 -0
- package/dist/motion/press.d.ts.map +1 -0
- package/dist/mute-H5SJFXVI.wav +0 -0
- package/dist/primitives/BottomSheet.d.ts +36 -0
- package/dist/primitives/BottomSheet.d.ts.map +1 -0
- package/dist/primitives/ChalkText.d.ts +13 -0
- package/dist/primitives/ChalkText.d.ts.map +1 -0
- package/dist/primitives/CopyButton.d.ts +11 -0
- package/dist/primitives/CopyButton.d.ts.map +1 -0
- package/dist/primitives/IconButton.d.ts +26 -0
- package/dist/primitives/IconButton.d.ts.map +1 -0
- package/dist/primitives/Menu.d.ts +39 -0
- package/dist/primitives/Menu.d.ts.map +1 -0
- package/dist/primitives/NameTag.d.ts +19 -0
- package/dist/primitives/NameTag.d.ts.map +1 -0
- package/dist/primitives/PillButton.d.ts +19 -0
- package/dist/primitives/PillButton.d.ts.map +1 -0
- package/dist/primitives/SegmentedControl.d.ts +17 -0
- package/dist/primitives/SegmentedControl.d.ts.map +1 -0
- package/dist/primitives/SheetGroup.d.ts +24 -0
- package/dist/primitives/SheetGroup.d.ts.map +1 -0
- package/dist/primitives/Switch.d.ts +9 -0
- package/dist/primitives/Switch.d.ts.map +1 -0
- package/dist/primitives/TileShell.d.ts +18 -0
- package/dist/primitives/TileShell.d.ts.map +1 -0
- package/dist/primitives/announce.d.ts +3 -0
- package/dist/primitives/announce.d.ts.map +1 -0
- package/dist/primitives/menu-placement.d.ts +32 -0
- package/dist/primitives/menu-placement.d.ts.map +1 -0
- package/dist/primitives/toast/Toast.d.ts +8 -0
- package/dist/primitives/toast/Toast.d.ts.map +1 -0
- package/dist/primitives/toast/ToastStack.d.ts +18 -0
- package/dist/primitives/toast/ToastStack.d.ts.map +1 -0
- package/dist/primitives/toast/toast-store.d.ts +39 -0
- package/dist/primitives/toast/toast-store.d.ts.map +1 -0
- package/dist/recording-Q4GB77Y4.wav +0 -0
- package/dist/sheets/people-chat/ChatNotices.d.ts +14 -0
- package/dist/sheets/people-chat/ChatNotices.d.ts.map +1 -0
- package/dist/sheets/people-chat/ChatTab.d.ts +6 -0
- package/dist/sheets/people-chat/ChatTab.d.ts.map +1 -0
- package/dist/sheets/people-chat/Composer.d.ts +7 -0
- package/dist/sheets/people-chat/Composer.d.ts.map +1 -0
- package/dist/sheets/people-chat/PeopleChatSheet.d.ts +17 -0
- package/dist/sheets/people-chat/PeopleChatSheet.d.ts.map +1 -0
- package/dist/sheets/people-chat/PeopleTab.d.ts +3 -0
- package/dist/sheets/people-chat/PeopleTab.d.ts.map +1 -0
- package/dist/sheets/people-chat/PhotoViewer.d.ts +19 -0
- package/dist/sheets/people-chat/PhotoViewer.d.ts.map +1 -0
- package/dist/sheets/people-chat/TextField.d.ts +4 -0
- package/dist/sheets/people-chat/TextField.d.ts.map +1 -0
- package/dist/sheets/people-chat/attachments.d.ts +33 -0
- package/dist/sheets/people-chat/attachments.d.ts.map +1 -0
- package/dist/sheets/people-chat/chat-model.d.ts +64 -0
- package/dist/sheets/people-chat/chat-model.d.ts.map +1 -0
- package/dist/sheets/people-chat/people-model.d.ts +43 -0
- package/dist/sheets/people-chat/people-model.d.ts.map +1 -0
- package/dist/sounds/sounds.d.ts +33 -0
- package/dist/sounds/sounds.d.ts.map +1 -0
- package/dist/space-client/create-native-space-client.d.ts +0 -4
- package/dist/space-client/create-native-space-client.d.ts.map +1 -1
- package/dist/space-client/random-uuid.d.ts +7 -0
- package/dist/space-client/random-uuid.d.ts.map +1 -0
- package/dist/stage/ContentTile.d.ts +18 -0
- package/dist/stage/ContentTile.d.ts.map +1 -0
- package/dist/stage/ParticipantTile.d.ts +18 -0
- package/dist/stage/ParticipantTile.d.ts.map +1 -0
- package/dist/stage/Stage.d.ts +14 -0
- package/dist/stage/Stage.d.ts.map +1 -0
- package/dist/stage/TileSheet.d.ts +12 -0
- package/dist/stage/TileSheet.d.ts.map +1 -0
- package/dist/stage/camera.d.ts +7 -0
- package/dist/stage/camera.d.ts.map +1 -0
- package/dist/stage/layout.d.ts +57 -0
- package/dist/stage/layout.d.ts.map +1 -0
- package/dist/stage/space-selector.d.ts +10 -0
- package/dist/stage/space-selector.d.ts.map +1 -0
- package/dist/stage/stage-view.d.ts +23 -0
- package/dist/stage/stage-view.d.ts.map +1 -0
- package/dist/status/CallOverlays.d.ts +17 -0
- package/dist/status/CallOverlays.d.ts.map +1 -0
- package/dist/status/ChalkArrival.d.ts +24 -0
- package/dist/status/ChalkArrival.d.ts.map +1 -0
- package/dist/status/StatusPage.d.ts +14 -0
- package/dist/status/StatusPage.d.ts.map +1 -0
- package/dist/status/call-screen.d.ts +20 -0
- package/dist/status/call-screen.d.ts.map +1 -0
- package/dist/test-VD2KAM4D.wav +0 -0
- package/dist/theme/theme.d.ts +15 -0
- package/dist/theme/theme.d.ts.map +1 -0
- package/dist/theme/tokens.d.ts +248 -0
- package/dist/theme/tokens.d.ts.map +1 -0
- package/dist/toasts/CallEventToasts.d.ts +21 -0
- package/dist/toasts/CallEventToasts.d.ts.map +1 -0
- package/dist/toasts/notices.d.ts +34 -0
- package/dist/toasts/notices.d.ts.map +1 -0
- package/dist/ui/ChalkUI.d.ts +12 -0
- package/dist/ui/ChalkUI.d.ts.map +1 -0
- package/dist/ui.d.ts +25 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +77 -0
- package/dist/unmute-2XR2LICU.wav +0 -0
- package/embedded/chalk-whiteboard/asset-manifest.json +2 -2
- package/embedded/chalk-whiteboard/renderer.js +510 -510
- package/ios/ChalkAudioRouteModule.swift +93 -0
- package/ios/ChalkAudioRouteModuleBridge.m +9 -0
- package/package.json +46 -76
- package/src/android/call-service.ts +19 -0
- package/src/avatar/FaceAvatar.tsx +145 -0
- package/src/avatar/tile-avatar-size.ts +4 -0
- package/src/client.ts +1 -5
- package/src/components/EmbeddedWhiteboard.tsx +14 -71
- package/src/components/native-media-visibility.ts +1 -2
- package/src/components/useAndroidCallService.ts +41 -0
- package/src/dev.ts +9 -0
- package/src/dock/Dock.tsx +95 -0
- package/src/dock/LeaveMenu.tsx +21 -0
- package/src/dock/MoreSheet.tsx +233 -0
- package/src/dock/ReactionBurst.tsx +55 -0
- package/src/dock/RoutePicker.tsx +42 -0
- package/src/dock/audio-route.ts +69 -0
- package/src/frame/CallFrame.tsx +209 -0
- package/src/frame/Chalk.tsx +83 -0
- package/src/frame/back-handler.ts +19 -0
- package/src/frame/dev-scenario.ts +48 -0
- package/src/frame/device-layout.tsx +31 -0
- package/src/frame/measurement.ts +44 -0
- package/src/frame/portal.tsx +107 -0
- package/src/frame/preferences.tsx +48 -0
- package/src/frame/regions.test.ts +38 -0
- package/src/frame/regions.ts +60 -0
- package/src/haptics/haptics.ts +19 -0
- package/src/header/CallDetailsSheet.tsx +139 -0
- package/src/header/Header.tsx +107 -0
- package/src/header/QrCode.tsx +34 -0
- package/src/icons/Icon.tsx +35 -0
- package/src/icons/icon-element.ts +11 -0
- package/src/icons/icon-paths.ts +199 -0
- package/src/index.ts +6 -9
- package/src/limbo/Limbo.tsx +159 -0
- package/src/limbo/Veil.tsx +36 -0
- package/src/media/native-capture-error.test.ts +19 -0
- package/src/media/native-capture-error.ts +13 -0
- package/src/motion/MovingFrame.tsx +101 -0
- package/src/motion/motion.ts +33 -0
- package/src/motion/presence.ts +20 -0
- package/src/motion/press.ts +35 -0
- package/src/primitives/BottomSheet.tsx +211 -0
- package/src/primitives/ChalkText.tsx +23 -0
- package/src/primitives/CopyButton.tsx +78 -0
- package/src/primitives/IconButton.tsx +90 -0
- package/src/primitives/Menu.tsx +212 -0
- package/src/primitives/NameTag.tsx +68 -0
- package/src/primitives/PillButton.tsx +56 -0
- package/src/primitives/SegmentedControl.tsx +55 -0
- package/src/primitives/SheetGroup.tsx +72 -0
- package/src/primitives/Switch.tsx +39 -0
- package/src/primitives/TileShell.tsx +53 -0
- package/src/primitives/announce.ts +7 -0
- package/src/primitives/menu-placement.test.ts +50 -0
- package/src/primitives/menu-placement.ts +43 -0
- package/src/primitives/toast/Toast.tsx +50 -0
- package/src/primitives/toast/ToastStack.tsx +89 -0
- package/src/primitives/toast/toast-store.ts +86 -0
- package/src/sheets/people-chat/ChatNotices.tsx +69 -0
- package/src/sheets/people-chat/ChatTab.tsx +186 -0
- package/src/sheets/people-chat/Composer.tsx +182 -0
- package/src/sheets/people-chat/PeopleChatSheet.tsx +100 -0
- package/src/sheets/people-chat/PeopleTab.tsx +326 -0
- package/src/sheets/people-chat/PhotoViewer.tsx +132 -0
- package/src/sheets/people-chat/TextField.tsx +14 -0
- package/src/sheets/people-chat/attachments.tsx +183 -0
- package/src/sheets/people-chat/chat-model.ts +157 -0
- package/src/sheets/people-chat/people-chat-model.test.ts +98 -0
- package/src/sheets/people-chat/people-model.ts +68 -0
- package/src/sounds/assets/error.wav +0 -0
- package/src/sounds/assets/hand.wav +0 -0
- package/src/sounds/assets/join.wav +0 -0
- package/src/sounds/assets/knock.wav +0 -0
- package/src/sounds/assets/leave.wav +0 -0
- package/src/sounds/assets/message.wav +0 -0
- package/src/sounds/assets/mute.wav +0 -0
- package/src/sounds/assets/recording.wav +0 -0
- package/src/sounds/assets/test.wav +0 -0
- package/src/sounds/assets/unmute.wav +0 -0
- package/src/sounds/assets.d.ts +5 -0
- package/src/sounds/sounds.ts +50 -0
- package/src/space-client/create-native-space-client.ts +20 -181
- package/src/space-client/random-uuid.ts +17 -0
- package/src/space-client/whiteboard-watchdog.test.ts +23 -0
- package/src/stage/ContentTile.tsx +100 -0
- package/src/stage/ParticipantTile.tsx +140 -0
- package/src/stage/Stage.tsx +152 -0
- package/src/stage/TileSheet.tsx +116 -0
- package/src/stage/camera.ts +20 -0
- package/src/stage/layout.test.ts +77 -0
- package/src/stage/layout.ts +226 -0
- package/src/stage/space-selector.ts +31 -0
- package/src/stage/stage-view.tsx +68 -0
- package/src/status/CallOverlays.tsx +47 -0
- package/src/status/ChalkArrival.tsx +53 -0
- package/src/status/StatusPage.tsx +123 -0
- package/src/status/call-screen.test.ts +42 -0
- package/src/status/call-screen.ts +29 -0
- package/src/theme/theme.tsx +28 -0
- package/src/theme/tokens.ts +247 -0
- package/src/toasts/CallEventToasts.tsx +192 -0
- package/src/toasts/notices.test.ts +92 -0
- package/src/toasts/notices.ts +62 -0
- package/src/ui/ChalkUI.tsx +49 -0
- package/src/ui.ts +24 -0
- package/dist/android.d.ts +0 -2
- package/dist/android.d.ts.map +0 -1
- package/dist/android.js +0 -62
- package/dist/chunk-2OS7SSXE.js +0 -552
- package/dist/chunk-5DQ4KBRH.js +0 -690
- package/dist/chunk-ITLUHTVS.js +0 -5271
- package/dist/chunk-JB4LNWVP.js +0 -247
- package/dist/components/Chalk.d.ts +0 -79
- package/dist/components/Chalk.d.ts.map +0 -1
- package/dist/components/ChatMessageList.d.ts +0 -11
- package/dist/components/ChatMessageList.d.ts.map +0 -1
- package/dist/components/Entrance.d.ts +0 -22
- package/dist/components/Entrance.d.ts.map +0 -1
- package/dist/components/EntranceView.android.d.ts +0 -4
- package/dist/components/EntranceView.android.d.ts.map +0 -1
- package/dist/components/EntranceView.d.ts +0 -18
- package/dist/components/EntranceView.d.ts.map +0 -1
- package/dist/components/EntranceView.ios-pad.d.ts +0 -3
- package/dist/components/EntranceView.ios-pad.d.ts.map +0 -1
- package/dist/components/EntranceView.ios-phone.d.ts +0 -3
- package/dist/components/EntranceView.ios-phone.d.ts.map +0 -1
- package/dist/components/EntranceView.macos.d.ts +0 -4
- package/dist/components/EntranceView.macos.d.ts.map +0 -1
- package/dist/components/FaceAvatar.d.ts +0 -16
- package/dist/components/FaceAvatar.d.ts.map +0 -1
- package/dist/components/GradientSurface.d.ts +0 -14
- package/dist/components/GradientSurface.d.ts.map +0 -1
- package/dist/components/MediaView.d.ts +0 -14
- package/dist/components/MediaView.d.ts.map +0 -1
- package/dist/components/ReactionPicker.d.ts +0 -10
- package/dist/components/ReactionPicker.d.ts.map +0 -1
- package/dist/components/SpaceView.android.d.ts +0 -2
- package/dist/components/SpaceView.android.d.ts.map +0 -1
- package/dist/components/SpaceView.d.ts +0 -33
- package/dist/components/SpaceView.d.ts.map +0 -1
- package/dist/components/SpaceView.ios-pad.d.ts +0 -2
- package/dist/components/SpaceView.ios-pad.d.ts.map +0 -1
- package/dist/components/SpaceView.ios-phone.d.ts +0 -2
- package/dist/components/SpaceView.ios-phone.d.ts.map +0 -1
- package/dist/components/SpaceView.macos.d.ts +0 -2
- package/dist/components/SpaceView.macos.d.ts.map +0 -1
- package/dist/components/SpaceView.shared.d.ts +0 -3
- package/dist/components/SpaceView.shared.d.ts.map +0 -1
- package/dist/components/episode-diagnostic-render-observer.d.ts +0 -2
- package/dist/components/episode-diagnostic-render-observer.d.ts.map +0 -1
- package/dist/components/logo/Logo.d.ts +0 -11
- package/dist/components/logo/Logo.d.ts.map +0 -1
- package/dist/components/native-animation-controller.d.ts +0 -7
- package/dist/components/native-animation-controller.d.ts.map +0 -1
- package/dist/components/native-chat.d.ts +0 -8
- package/dist/components/native-chat.d.ts.map +0 -1
- package/dist/components/native-entrance/entrance-controller-store.d.ts +0 -34
- package/dist/components/native-entrance/entrance-controller-store.d.ts.map +0 -1
- package/dist/components/native-entrance/useEntranceController.d.ts +0 -19
- package/dist/components/native-entrance/useEntranceController.d.ts.map +0 -1
- package/dist/components/native-joining-loading-animation.d.ts +0 -9
- package/dist/components/native-joining-loading-animation.d.ts.map +0 -1
- package/dist/components/native-space-view/AppearanceSettings.d.ts +0 -2
- package/dist/components/native-space-view/AppearanceSettings.d.ts.map +0 -1
- package/dist/components/native-space-view/FeedbackSheet.d.ts +0 -12
- package/dist/components/native-space-view/FeedbackSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/ParticipantActionSheet.d.ts +0 -9
- package/dist/components/native-space-view/ParticipantActionSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SettingsSheet.d.ts +0 -7
- package/dist/components/native-space-view/SettingsSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceActionMenu.d.ts +0 -10
- package/dist/components/native-space-view/SpaceActionMenu.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceBottomDock.android.d.ts +0 -4
- package/dist/components/native-space-view/SpaceBottomDock.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceChatAttachment.d.ts +0 -8
- package/dist/components/native-space-view/SpaceChatAttachment.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceChatSheet.d.ts +0 -5
- package/dist/components/native-space-view/SpaceChatSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceGrid.android.d.ts +0 -8
- package/dist/components/native-space-view/SpaceGrid.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceMoreSheet.d.ts +0 -7
- package/dist/components/native-space-view/SpaceMoreSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpacePanelSheet.d.ts +0 -5
- package/dist/components/native-space-view/SpacePanelSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpacePeopleSheet.d.ts +0 -5
- package/dist/components/native-space-view/SpacePeopleSheet.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceStage.android.d.ts +0 -29
- package/dist/components/native-space-view/SpaceStage.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceSurfacePrimitives.d.ts +0 -30
- package/dist/components/native-space-view/SpaceSurfacePrimitives.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceTopBar.android.d.ts +0 -11
- package/dist/components/native-space-view/SpaceTopBar.android.d.ts.map +0 -1
- package/dist/components/native-space-view/SpaceWhiteboardSurface.d.ts +0 -15
- package/dist/components/native-space-view/SpaceWhiteboardSurface.d.ts.map +0 -1
- package/dist/components/native-space-view/diagnostics.d.ts +0 -48
- package/dist/components/native-space-view/diagnostics.d.ts.map +0 -1
- package/dist/components/native-space-view/format-space-duration.d.ts +0 -2
- package/dist/components/native-space-view/format-space-duration.d.ts.map +0 -1
- package/dist/components/native-space-view/native-space-grid-keys.d.ts +0 -3
- package/dist/components/native-space-view/native-space-grid-keys.d.ts.map +0 -1
- package/dist/components/native-space-view/native-space-page-store.d.ts +0 -8
- package/dist/components/native-space-view/native-space-page-store.d.ts.map +0 -1
- package/dist/components/native-space-view/space-chat-attachments.d.ts +0 -15
- package/dist/components/native-space-view/space-chat-attachments.d.ts.map +0 -1
- package/dist/components/native-space-view/space-panel-layout.d.ts +0 -10
- package/dist/components/native-space-view/space-panel-layout.d.ts.map +0 -1
- package/dist/components/native-space-view/space-progressive-surface-helpers.d.ts +0 -16
- package/dist/components/native-space-view/space-progressive-surface-helpers.d.ts.map +0 -1
- package/dist/components/native-space-view/space-progressive-surface-types.d.ts +0 -3
- package/dist/components/native-space-view/space-progressive-surface-types.d.ts.map +0 -1
- package/dist/components/native-space-view/types.d.ts +0 -24
- package/dist/components/native-space-view/types.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewController.contract.d.ts +0 -41
- package/dist/components/native-space-view/useSpaceViewController.contract.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewController.d.ts +0 -156
- package/dist/components/native-space-view/useSpaceViewController.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewDerived.d.ts +0 -12
- package/dist/components/native-space-view/useSpaceViewDerived.d.ts.map +0 -1
- package/dist/components/native-space-view/useSpaceViewPanels.d.ts +0 -70
- package/dist/components/native-space-view/useSpaceViewPanels.d.ts.map +0 -1
- package/dist/feedback/native-capture.d.ts +0 -9
- package/dist/feedback/native-capture.d.ts.map +0 -1
- package/dist/feedback/native-evidence.d.ts +0 -3
- package/dist/feedback/native-evidence.d.ts.map +0 -1
- package/dist/hooks/entrance-preview-store.d.ts +0 -16
- package/dist/hooks/entrance-preview-store.d.ts.map +0 -1
- package/dist/hooks/useEntrancePreview.d.ts +0 -7
- package/dist/hooks/useEntrancePreview.d.ts.map +0 -1
- package/dist/hooks/useLayout.d.ts +0 -16
- package/dist/hooks/useLayout.d.ts.map +0 -1
- package/dist/hooks/usePanels.d.ts +0 -12
- package/dist/hooks/usePanels.d.ts.map +0 -1
- package/dist/ios-pad.d.ts +0 -2
- package/dist/ios-pad.d.ts.map +0 -1
- package/dist/ios-pad.js +0 -62
- package/dist/ios-phone.d.ts +0 -2
- package/dist/ios-phone.d.ts.map +0 -1
- package/dist/ios-phone.js +0 -62
- package/dist/ios.d.ts +0 -2
- package/dist/ios.d.ts.map +0 -1
- package/dist/ios.js +0 -62
- package/dist/macos.d.ts +0 -2
- package/dist/macos.d.ts.map +0 -1
- package/dist/macos.js +0 -62
- package/dist/space-client/cloudflare-rtk-native.d.ts +0 -3
- package/dist/space-client/cloudflare-rtk-native.d.ts.map +0 -1
- package/dist/telemetry.d.ts +0 -63
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/ui/appearance.d.ts +0 -246
- package/dist/ui/appearance.d.ts.map +0 -1
- package/dist/ui/appearance.js +0 -14
- package/dist/ui/native-appearance-context.d.ts +0 -15
- package/dist/ui/native-appearance-context.d.ts.map +0 -1
- package/dist/ui/native-theme.d.ts +0 -17
- package/dist/ui/native-theme.d.ts.map +0 -1
- package/dist/ui/native-types.d.ts +0 -38
- package/dist/ui/native-types.d.ts.map +0 -1
- package/dist/ui/participant-avatar.d.ts +0 -21
- package/dist/ui/participant-avatar.d.ts.map +0 -1
- package/dist/ui/theme-tokens.d.ts +0 -25
- package/dist/ui/theme-tokens.d.ts.map +0 -1
- package/dist/ui/theme.d.ts +0 -404
- package/dist/ui/theme.d.ts.map +0 -1
- package/dist/ui/theme.js +0 -8
- package/dist/utils/native-space-layout.d.ts +0 -42
- package/dist/utils/native-space-layout.d.ts.map +0 -1
- package/src/android.ts +0 -1
- package/src/components/Chalk.tsx +0 -363
- package/src/components/ChatMessageList.tsx +0 -209
- package/src/components/Entrance.tsx +0 -42
- package/src/components/EntranceView.android.tsx +0 -274
- package/src/components/EntranceView.ios-pad.tsx +0 -326
- package/src/components/EntranceView.ios-phone.tsx +0 -271
- package/src/components/EntranceView.macos.tsx +0 -278
- package/src/components/EntranceView.tsx +0 -38
- package/src/components/FaceAvatar.tsx +0 -120
- package/src/components/GradientSurface.tsx +0 -23
- package/src/components/MediaView.tsx +0 -76
- package/src/components/ReactionPicker.tsx +0 -98
- package/src/components/SpaceView.android.tsx +0 -1
- package/src/components/SpaceView.ios-pad.tsx +0 -1
- package/src/components/SpaceView.ios-phone.tsx +0 -1
- package/src/components/SpaceView.macos.tsx +0 -1
- package/src/components/SpaceView.shared.tsx +0 -98
- package/src/components/SpaceView.tsx +0 -54
- package/src/components/episode-diagnostic-render-observer.ts +0 -12
- package/src/components/logo/Logo.tsx +0 -309
- package/src/components/native-animation-controller.ts +0 -36
- package/src/components/native-chat.ts +0 -23
- package/src/components/native-entrance/entrance-controller-store.ts +0 -112
- package/src/components/native-entrance/useEntranceController.ts +0 -60
- package/src/components/native-joining-loading-animation.ts +0 -26
- package/src/components/native-space-view/AppearanceSettings.tsx +0 -114
- package/src/components/native-space-view/FeedbackSheet.tsx +0 -296
- package/src/components/native-space-view/ParticipantActionSheet.tsx +0 -99
- package/src/components/native-space-view/SettingsSheet.tsx +0 -164
- package/src/components/native-space-view/SpaceActionMenu.tsx +0 -109
- package/src/components/native-space-view/SpaceBottomDock.android.tsx +0 -115
- package/src/components/native-space-view/SpaceChatAttachment.tsx +0 -105
- package/src/components/native-space-view/SpaceChatSheet.tsx +0 -184
- package/src/components/native-space-view/SpaceGrid.android.tsx +0 -323
- package/src/components/native-space-view/SpaceMoreSheet.tsx +0 -190
- package/src/components/native-space-view/SpacePanelSheet.tsx +0 -45
- package/src/components/native-space-view/SpacePeopleSheet.tsx +0 -116
- package/src/components/native-space-view/SpaceStage.android.tsx +0 -372
- package/src/components/native-space-view/SpaceSurfacePrimitives.tsx +0 -75
- package/src/components/native-space-view/SpaceTopBar.android.tsx +0 -113
- package/src/components/native-space-view/SpaceWhiteboardSurface.tsx +0 -69
- package/src/components/native-space-view/diagnostics.ts +0 -84
- package/src/components/native-space-view/format-space-duration.ts +0 -3
- package/src/components/native-space-view/native-space-grid-keys.ts +0 -6
- package/src/components/native-space-view/native-space-page-store.ts +0 -41
- package/src/components/native-space-view/space-chat-attachments.test.ts +0 -26
- package/src/components/native-space-view/space-chat-attachments.ts +0 -37
- package/src/components/native-space-view/space-panel-layout.ts +0 -10
- package/src/components/native-space-view/space-progressive-surface-helpers.ts +0 -33
- package/src/components/native-space-view/space-progressive-surface-types.ts +0 -3
- package/src/components/native-space-view/types.ts +0 -25
- package/src/components/native-space-view/useSpaceViewController.contract.ts +0 -34
- package/src/components/native-space-view/useSpaceViewController.ts +0 -416
- package/src/components/native-space-view/useSpaceViewDerived.ts +0 -29
- package/src/components/native-space-view/useSpaceViewPanels.ts +0 -170
- package/src/feedback/native-capture.ts +0 -62
- package/src/feedback/native-evidence.ts +0 -37
- package/src/hooks/entrance-preview-store.ts +0 -99
- package/src/hooks/useEntrancePreview.ts +0 -26
- package/src/hooks/useLayout.ts +0 -37
- package/src/hooks/usePanels.ts +0 -30
- package/src/ios-pad.ts +0 -1
- package/src/ios-phone.ts +0 -1
- package/src/ios.ts +0 -1
- package/src/macos.ts +0 -1
- package/src/space-client/cloudflare-rtk-native.ts +0 -104
- package/src/telemetry.ts +0 -234
- package/src/types/hugeicons-direct.d.ts +0 -4
- package/src/types/react-native-safe-area-context.d.ts +0 -8
- package/src/ui/appearance.ts +0 -808
- package/src/ui/native-appearance-context.tsx +0 -74
- package/src/ui/native-theme.tsx +0 -54
- package/src/ui/native-types.ts +0 -40
- package/src/ui/participant-avatar.ts +0 -47
- package/src/ui/theme-tokens.ts +0 -41
- package/src/ui/theme.ts +0 -214
- package/src/utils/native-space-layout.ts +0 -135
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { FeedbackEvidenceInput, FeedbackPlatformKind } from "@q9labsai/chalk-client";
|
|
2
|
-
import { Platform } from "react-native";
|
|
3
|
-
|
|
4
|
-
import { getDeviceInfo } from "../runtime";
|
|
5
|
-
|
|
6
|
-
export function createNativeFeedbackEvidence(): FeedbackEvidenceInput {
|
|
7
|
-
const device = getDeviceInfo({ scriptUrl: null });
|
|
8
|
-
const kind = feedbackPlatformKind(Platform.OS);
|
|
9
|
-
const osName = boundedString(device.systemName ?? device.platform ?? kind);
|
|
10
|
-
const osVersion = boundedString(device.osVersion);
|
|
11
|
-
const deviceModel = boundedString(device.model);
|
|
12
|
-
const reactNativeVersion = boundedString(device.reactNativeVersion);
|
|
13
|
-
const deviceClass = kind === "macos" ? "desktop" : device.interfaceIdiom === "pad" ? "tablet" : "phone";
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
sdk: { client: "@q9labsai/chalk-client", ...(reactNativeVersion ? { react_native: reactNativeVersion } : {}) },
|
|
17
|
-
platform: {
|
|
18
|
-
kind,
|
|
19
|
-
...(osName ? { os_name: osName } : {}),
|
|
20
|
-
...(osVersion ? { os_version: osVersion } : {}),
|
|
21
|
-
device_class: deviceClass,
|
|
22
|
-
...(deviceModel ? { device_model: deviceModel } : {}),
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function feedbackPlatformKind(platform: string): FeedbackPlatformKind {
|
|
28
|
-
if (platform === "ios") return "ios";
|
|
29
|
-
if (platform === "macos") return "macos";
|
|
30
|
-
return "android";
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function boundedString(value: string | null): string | undefined {
|
|
34
|
-
const normalized = value?.trim();
|
|
35
|
-
if (!normalized) return undefined;
|
|
36
|
-
return normalized.slice(0, 64);
|
|
37
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import type { NativeMediaStream } from "../media/native-webrtc";
|
|
2
|
-
import type { ExternalStore } from "./external-store";
|
|
3
|
-
|
|
4
|
-
export interface PreviewSnapshot {
|
|
5
|
-
readonly previewStream: NativeMediaStream | null;
|
|
6
|
-
readonly previewError: string | null;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export type EntrancePreviewStore = ExternalStore<PreviewSnapshot>;
|
|
10
|
-
|
|
11
|
-
interface EntrancePreviewStoreOptions {
|
|
12
|
-
readonly enabled: boolean;
|
|
13
|
-
readonly simulatorVideoDisabled: boolean;
|
|
14
|
-
readonly simulatorVideoMessage: string;
|
|
15
|
-
readonly getUserMedia: (constraints: unknown) => Promise<NativeMediaStream>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function stopPreviewTracks(stream: NativeMediaStream | null): void {
|
|
19
|
-
stream?.getTracks?.().forEach((track) => {
|
|
20
|
-
try {
|
|
21
|
-
track.stop();
|
|
22
|
-
} catch {
|
|
23
|
-
// Best effort only.
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function createEntrancePreviewStore(options: EntrancePreviewStoreOptions): EntrancePreviewStore {
|
|
29
|
-
const initialSnapshot: PreviewSnapshot = {
|
|
30
|
-
previewStream: null,
|
|
31
|
-
previewError: options.enabled && options.simulatorVideoDisabled ? options.simulatorVideoMessage : null,
|
|
32
|
-
};
|
|
33
|
-
let snapshot = initialSnapshot;
|
|
34
|
-
let activeStream: NativeMediaStream | null = null;
|
|
35
|
-
let requestGeneration = 0;
|
|
36
|
-
const listeners = new Set<() => void>();
|
|
37
|
-
|
|
38
|
-
const notify = (): void => {
|
|
39
|
-
listeners.forEach((listener) => listener());
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const reset = (): void => {
|
|
43
|
-
requestGeneration += 1;
|
|
44
|
-
stopPreviewTracks(activeStream);
|
|
45
|
-
activeStream = null;
|
|
46
|
-
snapshot = initialSnapshot;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const start = (): void => {
|
|
50
|
-
if (!options.enabled || options.simulatorVideoDisabled) return;
|
|
51
|
-
|
|
52
|
-
const generation = ++requestGeneration;
|
|
53
|
-
void options
|
|
54
|
-
.getUserMedia({ audio: false, video: { facingMode: "user" } })
|
|
55
|
-
.then((stream) => {
|
|
56
|
-
if (generation !== requestGeneration) {
|
|
57
|
-
stopPreviewTracks(stream);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const videoTrack = stream.getVideoTracks?.()[0] ?? null;
|
|
62
|
-
if (!videoTrack) {
|
|
63
|
-
stopPreviewTracks(stream);
|
|
64
|
-
snapshot = { previewStream: null, previewError: "No camera track available" };
|
|
65
|
-
notify();
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
stopPreviewTracks(activeStream);
|
|
70
|
-
activeStream = stream;
|
|
71
|
-
snapshot = { previewStream: stream, previewError: null };
|
|
72
|
-
notify();
|
|
73
|
-
})
|
|
74
|
-
.catch((cause: unknown) => {
|
|
75
|
-
if (generation !== requestGeneration) return;
|
|
76
|
-
snapshot = {
|
|
77
|
-
previewStream: null,
|
|
78
|
-
previewError: cause instanceof Error ? cause.message : "Unable to start camera preview",
|
|
79
|
-
};
|
|
80
|
-
notify();
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const subscribe = (listener: () => void): (() => void) => {
|
|
85
|
-
listeners.add(listener);
|
|
86
|
-
if (listeners.size === 1) start();
|
|
87
|
-
|
|
88
|
-
return () => {
|
|
89
|
-
listeners.delete(listener);
|
|
90
|
-
if (listeners.size !== 0) return;
|
|
91
|
-
reset();
|
|
92
|
-
};
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return {
|
|
96
|
-
getSnapshot: () => snapshot,
|
|
97
|
-
subscribe,
|
|
98
|
-
};
|
|
99
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { mediaDevices, type NativeMediaStream } from "../media/native-webrtc";
|
|
2
|
-
import { useMemo, useSyncExternalStore } from "react";
|
|
3
|
-
import { getIosSimulatorVideoMessage, isIosSimulator } from "../utils/ios-simulator";
|
|
4
|
-
import { createEntrancePreviewStore } from "./entrance-preview-store";
|
|
5
|
-
|
|
6
|
-
export interface UseEntrancePreviewReturn {
|
|
7
|
-
previewStream: NativeMediaStream | null;
|
|
8
|
-
previewError: string | null;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function useEntrancePreview(enabled: boolean): UseEntrancePreviewReturn {
|
|
12
|
-
const simulatorVideoDisabled = isIosSimulator();
|
|
13
|
-
const store = useMemo(
|
|
14
|
-
() =>
|
|
15
|
-
createEntrancePreviewStore({
|
|
16
|
-
enabled,
|
|
17
|
-
simulatorVideoDisabled,
|
|
18
|
-
simulatorVideoMessage: getIosSimulatorVideoMessage(),
|
|
19
|
-
getUserMedia: mediaDevices.getUserMedia,
|
|
20
|
-
}),
|
|
21
|
-
[enabled, simulatorVideoDisabled],
|
|
22
|
-
);
|
|
23
|
-
const { previewStream, previewError } = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
|
|
24
|
-
|
|
25
|
-
return { previewStream, previewError };
|
|
26
|
-
}
|
package/src/hooks/useLayout.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
import type { Layout } from "../ui/native-types";
|
|
4
|
-
|
|
5
|
-
export interface UseLayoutReturn {
|
|
6
|
-
readonly layout: Layout;
|
|
7
|
-
readonly isMobileView: boolean;
|
|
8
|
-
readonly isFullscreen: boolean;
|
|
9
|
-
readonly setLayout: (layout: Layout) => void;
|
|
10
|
-
readonly toggleLayout: () => void;
|
|
11
|
-
readonly toggleFullscreen: () => Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
type UseLayoutOptions = {
|
|
15
|
-
readonly layout?: Layout;
|
|
16
|
-
readonly onLayoutChange?: (layout: Layout) => void;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export function useLayout({ layout: controlledLayout, onLayoutChange }: UseLayoutOptions = {}): UseLayoutReturn {
|
|
20
|
-
const [uncontrolledLayout, setUncontrolledLayout] = useState<Layout>(controlledLayout ?? "focus");
|
|
21
|
-
const [isFullscreen, setFullscreen] = useState(false);
|
|
22
|
-
const layout = controlledLayout ?? uncontrolledLayout;
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (controlledLayout) setUncontrolledLayout(controlledLayout);
|
|
25
|
-
}, [controlledLayout]);
|
|
26
|
-
const setLayout = useCallback(
|
|
27
|
-
(nextLayout: Layout) => {
|
|
28
|
-
if (!controlledLayout) setUncontrolledLayout(nextLayout);
|
|
29
|
-
onLayoutChange?.(nextLayout);
|
|
30
|
-
},
|
|
31
|
-
[controlledLayout, onLayoutChange],
|
|
32
|
-
);
|
|
33
|
-
const toggleLayout = useCallback(() => setLayout(layout === "grid" ? "focus" : "grid"), [layout, setLayout]);
|
|
34
|
-
const toggleFullscreen = useCallback(async () => setFullscreen((current) => !current), []);
|
|
35
|
-
|
|
36
|
-
return { layout, isMobileView: true, isFullscreen, setLayout, toggleLayout, toggleFullscreen };
|
|
37
|
-
}
|
package/src/hooks/usePanels.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from "react";
|
|
2
|
-
|
|
3
|
-
import type { NativePanel } from "../ui/native-types";
|
|
4
|
-
|
|
5
|
-
export interface UsePanelsReturn {
|
|
6
|
-
readonly activePanel: NativePanel;
|
|
7
|
-
readonly controlsVisible: boolean;
|
|
8
|
-
readonly openPanel: (panel: NativePanel) => void;
|
|
9
|
-
readonly closePanel: () => void;
|
|
10
|
-
readonly togglePanel: (panel: Exclude<NativePanel, null>) => void;
|
|
11
|
-
readonly showControls: () => void;
|
|
12
|
-
readonly hideControls: () => void;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function usePanels(): UsePanelsReturn {
|
|
16
|
-
const [activePanel, setActivePanel] = useState<NativePanel>(null);
|
|
17
|
-
const [controlsVisible, setControlsVisible] = useState(true);
|
|
18
|
-
const closePanel = useCallback(() => setActivePanel(null), []);
|
|
19
|
-
const togglePanel = useCallback((panel: Exclude<NativePanel, null>) => setActivePanel((current) => (current === panel ? null : panel)), []);
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
activePanel,
|
|
23
|
-
controlsVisible,
|
|
24
|
-
openPanel: setActivePanel,
|
|
25
|
-
closePanel,
|
|
26
|
-
togglePanel,
|
|
27
|
-
showControls: () => setControlsVisible(true),
|
|
28
|
-
hideControls: () => setControlsVisible(false),
|
|
29
|
-
};
|
|
30
|
-
}
|
package/src/ios-pad.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./index";
|
package/src/ios-phone.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./index";
|
package/src/ios.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./index";
|
package/src/macos.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./index";
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type RealtimeKitClient from "@cloudflare/realtimekit-react-native";
|
|
2
|
-
import type { CloudflareRTKClientFactory, CloudflareRTKConnection, CloudflareRTKParticipant } from "@q9labsai/chalk-client";
|
|
3
|
-
|
|
4
|
-
type NativeRealtimeKitClient = Awaited<ReturnType<typeof RealtimeKitClient.init>>;
|
|
5
|
-
type NativeRealtimeKitParticipant = ReturnType<NativeRealtimeKitClient["participants"]["joined"]["toArray"]>[number];
|
|
6
|
-
|
|
7
|
-
export const createNativeRealtimeKitClient: CloudflareRTKClientFactory = async ({ authToken, onError }) => {
|
|
8
|
-
const { default: NativeRealtimeKitClient } = await import("@cloudflare/realtimekit-react-native");
|
|
9
|
-
const client = await NativeRealtimeKitClient.init({
|
|
10
|
-
authToken,
|
|
11
|
-
defaults: { audio: false, video: false },
|
|
12
|
-
onError,
|
|
13
|
-
});
|
|
14
|
-
return adaptNativeRealtimeKitClient(client);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
function adaptNativeRealtimeKitClient(client: NativeRealtimeKitClient): CloudflareRTKConnection {
|
|
18
|
-
const self = client.self;
|
|
19
|
-
return {
|
|
20
|
-
join: () => client.joinRoom(),
|
|
21
|
-
leave: () => client.leaveRoom(),
|
|
22
|
-
self: {
|
|
23
|
-
get peerId() {
|
|
24
|
-
return self.peerId;
|
|
25
|
-
},
|
|
26
|
-
get audioEnabled() {
|
|
27
|
-
return self.audioEnabled;
|
|
28
|
-
},
|
|
29
|
-
get videoEnabled() {
|
|
30
|
-
return self.videoEnabled;
|
|
31
|
-
},
|
|
32
|
-
get screenShareEnabled() {
|
|
33
|
-
return self.screenShareEnabled;
|
|
34
|
-
},
|
|
35
|
-
get audioTrack() {
|
|
36
|
-
return self.audioTrack ?? null;
|
|
37
|
-
},
|
|
38
|
-
get videoTrack() {
|
|
39
|
-
return self.videoTrack ?? null;
|
|
40
|
-
},
|
|
41
|
-
get screenShareTracks() {
|
|
42
|
-
return {
|
|
43
|
-
...(self.screenShareTracks.audio ? { audio: self.screenShareTracks.audio } : {}),
|
|
44
|
-
...(self.screenShareTracks.video ? { video: self.screenShareTracks.video } : {}),
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
enableAudio: () => self.enableAudio(),
|
|
48
|
-
enableVideo: () => self.enableVideo(),
|
|
49
|
-
enableScreenShare: () => self.enableScreenShare(),
|
|
50
|
-
disableAudio: () => self.disableAudio(),
|
|
51
|
-
disableVideo: () => self.disableVideo(),
|
|
52
|
-
disableScreenShare: () => self.disableScreenShare(),
|
|
53
|
-
onAudioUpdate: (listener) => {
|
|
54
|
-
self.on("audioUpdate", listener);
|
|
55
|
-
return () => self.off("audioUpdate", listener);
|
|
56
|
-
},
|
|
57
|
-
onVideoUpdate: (listener) => {
|
|
58
|
-
self.on("videoUpdate", listener);
|
|
59
|
-
return () => self.off("videoUpdate", listener);
|
|
60
|
-
},
|
|
61
|
-
onScreenShareUpdate: (listener) => {
|
|
62
|
-
self.on("screenShareUpdate", listener);
|
|
63
|
-
return () => self.off("screenShareUpdate", listener);
|
|
64
|
-
},
|
|
65
|
-
onLeft: (listener) => {
|
|
66
|
-
const callback = () => listener();
|
|
67
|
-
self.on("roomLeft", callback);
|
|
68
|
-
return () => self.off("roomLeft", callback);
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
participants: {
|
|
72
|
-
joined: {
|
|
73
|
-
list: () => client.participants.joined.toArray().map(toParticipant),
|
|
74
|
-
onJoined: (listener) => {
|
|
75
|
-
const callback = (participant: NativeRealtimeKitParticipant) => listener(toParticipant(participant));
|
|
76
|
-
client.participants.joined.on("participantJoined", callback);
|
|
77
|
-
return () => client.participants.joined.off("participantJoined", callback);
|
|
78
|
-
},
|
|
79
|
-
onLeft: (listener) => {
|
|
80
|
-
const callback = (participant: NativeRealtimeKitParticipant) => listener(toParticipant(participant));
|
|
81
|
-
client.participants.joined.on("participantLeft", callback);
|
|
82
|
-
return () => client.participants.joined.off("participantLeft", callback);
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function toParticipant(participant: NativeRealtimeKitParticipant): CloudflareRTKParticipant {
|
|
90
|
-
return {
|
|
91
|
-
id: participant.id,
|
|
92
|
-
userId: participant.userId,
|
|
93
|
-
...(participant.customParticipantId === undefined ? {} : { customParticipantId: participant.customParticipantId }),
|
|
94
|
-
audioEnabled: participant.audioEnabled,
|
|
95
|
-
videoEnabled: participant.videoEnabled,
|
|
96
|
-
screenShareEnabled: participant.screenShareEnabled,
|
|
97
|
-
audioTrack: participant.audioTrack ?? null,
|
|
98
|
-
videoTrack: participant.videoTrack ?? null,
|
|
99
|
-
screenShareTracks: {
|
|
100
|
-
...(participant.screenShareTracks.audio ? { audio: participant.screenShareTracks.audio } : {}),
|
|
101
|
-
...(participant.screenShareTracks.video ? { video: participant.screenShareTracks.video } : {}),
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
}
|
package/src/telemetry.ts
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { syncTelemetryCorrelation, type DiagnosticObservation, type JourneyTelemetryContext, type RtcConnectionStateSnapshot, type RtcStatsLike, type SyncFrameObservation } from "@q9labsai/chalk-client/telemetry";
|
|
2
|
-
|
|
3
|
-
export interface TelemetryJourney {
|
|
4
|
-
readonly context: JourneyTelemetryContext;
|
|
5
|
-
readonly headers: Readonly<Record<string, string>>;
|
|
6
|
-
/** Internal native bridge; callers must not inspect or derive media credentials. */
|
|
7
|
-
readonly setAuthenticatedTelemetryHeaders?: (headers: Readonly<Record<string, string>> | undefined) => void;
|
|
8
|
-
recordDiagnostic(observation: DiagnosticObservation): unknown;
|
|
9
|
-
recordRtcSummary(connection: RtcConnectionStateSnapshot, stats: Iterable<RtcStatsLike>): unknown;
|
|
10
|
-
recordSyncFrame(observation: SyncFrameObservation): unknown;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface WhiteboardMetric {
|
|
14
|
-
readonly name: string;
|
|
15
|
-
readonly value: number;
|
|
16
|
-
readonly attributes?: Readonly<Record<string, string | number | boolean>>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface ConnectionTelemetry {
|
|
20
|
-
readonly apiHeaders: Readonly<Record<string, string>>;
|
|
21
|
-
readonly context: JourneyTelemetryContext;
|
|
22
|
-
readonly syncCorrelation: ReturnType<typeof syncTelemetryCorrelation>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface RtcPeerConnection {
|
|
26
|
-
readonly connectionState?: string;
|
|
27
|
-
readonly iceConnectionState?: string;
|
|
28
|
-
readonly signalingState?: string;
|
|
29
|
-
addEventListener(type: NativeRtcStateEvent, listener: () => void): void;
|
|
30
|
-
getStats(): Promise<unknown>;
|
|
31
|
-
removeEventListener(type: NativeRtcStateEvent, listener: () => void): void;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
type NativeRtcStateEvent = "connectionstatechange" | "iceconnectionstatechange" | "signalingstatechange";
|
|
35
|
-
|
|
36
|
-
const rtcStateEvents: readonly NativeRtcStateEvent[] = ["connectionstatechange", "iceconnectionstatechange", "signalingstatechange"];
|
|
37
|
-
|
|
38
|
-
export interface Telemetry {
|
|
39
|
-
readonly connection: ConnectionTelemetry;
|
|
40
|
-
observePeerConnection(peerConnection: RtcPeerConnection): () => void;
|
|
41
|
-
recordSyncFrame(observation: SyncFrameObservation): void;
|
|
42
|
-
recordWhiteboardMetric(metric: WhiteboardMetric): void;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface NativeJourneyContext {
|
|
46
|
-
readonly journeyId: string;
|
|
47
|
-
readonly traceparent: string;
|
|
48
|
-
readonly tracestate?: string;
|
|
49
|
-
readonly recordWhiteboardMetric: (metric: WhiteboardMetric) => void;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const nativeJourneyContexts = new WeakMap<object, NativeJourneyContext>();
|
|
53
|
-
|
|
54
|
-
type NativeTelemetryClient = {
|
|
55
|
-
readonly getSnapshot: () => { readonly connection: { readonly status: string } };
|
|
56
|
-
readonly subscribe: (listener: () => void) => () => void;
|
|
57
|
-
readonly dispose: () => void;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export async function authenticatedNativeCredential(credential: () => Promise<string>, journey: TelemetryJourney | undefined): Promise<string> {
|
|
61
|
-
const value = await credential();
|
|
62
|
-
try {
|
|
63
|
-
journey?.setAuthenticatedTelemetryHeaders?.({ Authorization: `Bearer ${value}` });
|
|
64
|
-
} catch {
|
|
65
|
-
// Telemetry exporters cannot interrupt an authenticated media request.
|
|
66
|
-
}
|
|
67
|
-
return value;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/** Binds authenticated-header cleanup to the private native client's terminal lifecycle. */
|
|
71
|
-
export function bindNativeAuthenticatedTelemetry(client: NativeTelemetryClient, journey: TelemetryJourney | undefined): void {
|
|
72
|
-
const setHeaders = journey?.setAuthenticatedTelemetryHeaders;
|
|
73
|
-
if (!setHeaders) return;
|
|
74
|
-
|
|
75
|
-
const clear = () => {
|
|
76
|
-
try {
|
|
77
|
-
setHeaders(undefined);
|
|
78
|
-
} catch {
|
|
79
|
-
// Telemetry exporters cannot interrupt client teardown.
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const onSnapshot = () => {
|
|
83
|
-
const status = client.getSnapshot().connection.status;
|
|
84
|
-
if (status === "idle" || status === "failed" || status === "left") clear();
|
|
85
|
-
};
|
|
86
|
-
const unsubscribe = client.subscribe(onSnapshot);
|
|
87
|
-
let disposed = false;
|
|
88
|
-
const originalDispose = client.dispose;
|
|
89
|
-
(client as NativeTelemetryClient & { dispose: () => void }).dispose = () => {
|
|
90
|
-
if (disposed) return;
|
|
91
|
-
disposed = true;
|
|
92
|
-
clear();
|
|
93
|
-
unsubscribe();
|
|
94
|
-
originalDispose();
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function registerNativeJourneyContext(client: object, journey: TelemetryJourney | undefined, telemetry: Telemetry | undefined): void {
|
|
99
|
-
if (!journey || !telemetry) return;
|
|
100
|
-
nativeJourneyContexts.set(client, {
|
|
101
|
-
journeyId: journey.context.journeyId,
|
|
102
|
-
traceparent: journey.context.traceparent,
|
|
103
|
-
...(journey.context.tracestate ? { tracestate: journey.context.tracestate } : {}),
|
|
104
|
-
recordWhiteboardMetric: telemetry.recordWhiteboardMetric,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function getNativeJourneyContext(client: object): NativeJourneyContext | undefined {
|
|
109
|
-
return nativeJourneyContexts.get(client);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/** Connects a typed journey to native API, WebSocket, and WebRTC boundaries without collecting raw media or network data. */
|
|
113
|
-
export function createTelemetry(journey: TelemetryJourney): Telemetry {
|
|
114
|
-
const connection: ConnectionTelemetry = {
|
|
115
|
-
apiHeaders: journey.headers,
|
|
116
|
-
context: journey.context,
|
|
117
|
-
syncCorrelation: syncTelemetryCorrelation(journey.context),
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
return {
|
|
121
|
-
connection,
|
|
122
|
-
observePeerConnection(peerConnection) {
|
|
123
|
-
return observeNativeRtc(peerConnection, journey);
|
|
124
|
-
},
|
|
125
|
-
recordSyncFrame(observation) {
|
|
126
|
-
journey.recordSyncFrame(observation);
|
|
127
|
-
},
|
|
128
|
-
recordWhiteboardMetric(metric) {
|
|
129
|
-
journey.recordDiagnostic({
|
|
130
|
-
category: "whiteboard_renderer",
|
|
131
|
-
code: metric.name,
|
|
132
|
-
metricValue: metric.value,
|
|
133
|
-
phase: "media",
|
|
134
|
-
state: isFailedWhiteboardMetric(metric.name) ? "failed" : "observed",
|
|
135
|
-
});
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function syncTransportCloseDiagnostic(event: { readonly code?: unknown; readonly reason?: unknown }): DiagnosticObservation {
|
|
141
|
-
const code = typeof event.code === "number" ? event.code : null;
|
|
142
|
-
const reason = typeof event.reason === "string" ? event.reason : "";
|
|
143
|
-
return {
|
|
144
|
-
category: "network",
|
|
145
|
-
code: code === null ? "sync_websocket_closed_unknown" : `sync_websocket_closed_${code}_${syncCloseReason(reason)}`,
|
|
146
|
-
phase: "signaling",
|
|
147
|
-
state: code === 1000 ? "observed" : "failed",
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function syncCloseReason(reason: string): string {
|
|
152
|
-
switch (reason) {
|
|
153
|
-
case "authentication failed":
|
|
154
|
-
case "heartbeat timeout":
|
|
155
|
-
case "hello timeout":
|
|
156
|
-
case "invalid token":
|
|
157
|
-
case "policy violation":
|
|
158
|
-
case "space actions unsupported":
|
|
159
|
-
case "text frames only":
|
|
160
|
-
case "transport error":
|
|
161
|
-
return reason.replaceAll(" ", "_");
|
|
162
|
-
default:
|
|
163
|
-
return reason ? "other" : "none";
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function isFailedWhiteboardMetric(name: string): boolean {
|
|
168
|
-
return name.endsWith(".failure") || name.endsWith(".termination");
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function observeNativeRtc(peerConnection: RtcPeerConnection, journey: TelemetryJourney): () => void {
|
|
172
|
-
let disposed = false;
|
|
173
|
-
const dispose = () => {
|
|
174
|
-
if (disposed) return;
|
|
175
|
-
disposed = true;
|
|
176
|
-
for (const event of rtcStateEvents) peerConnection.removeEventListener(event, capture);
|
|
177
|
-
};
|
|
178
|
-
const capture = () => {
|
|
179
|
-
void peerConnection
|
|
180
|
-
.getStats()
|
|
181
|
-
.then((stats) => journey.recordRtcSummary(rtcConnectionState(peerConnection), rtcStats(stats)))
|
|
182
|
-
.catch(() => undefined);
|
|
183
|
-
if (peerConnection.connectionState === "closed") dispose();
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
for (const event of rtcStateEvents) peerConnection.addEventListener(event, capture);
|
|
187
|
-
capture();
|
|
188
|
-
|
|
189
|
-
return dispose;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function rtcConnectionState(peerConnection: RtcPeerConnection): RtcConnectionStateSnapshot {
|
|
193
|
-
return {
|
|
194
|
-
connectionState: peerConnection.connectionState,
|
|
195
|
-
iceConnectionState: peerConnection.iceConnectionState,
|
|
196
|
-
signalingState: peerConnection.signalingState,
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function rtcStats(stats: unknown): readonly RtcStatsLike[] {
|
|
201
|
-
if (Array.isArray(stats)) return stats.filter(isRtcStatsLike);
|
|
202
|
-
if (isIterable(stats)) return Array.from(stats, statsValue).filter(isRtcStatsLike);
|
|
203
|
-
if (hasForEach(stats)) return forEachStats(stats);
|
|
204
|
-
if (isObject(stats)) return Object.values(stats).filter(isRtcStatsLike);
|
|
205
|
-
return [];
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function isIterable(value: unknown): value is Iterable<unknown> {
|
|
209
|
-
return isObject(value) && Symbol.iterator in value;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function hasForEach(value: unknown): value is { forEach(callback: (entry: unknown) => void): void } {
|
|
213
|
-
return isObject(value) && "forEach" in value && typeof value.forEach === "function";
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function forEachStats(stats: { forEach(callback: (entry: unknown) => void): void }): RtcStatsLike[] {
|
|
217
|
-
const entries: RtcStatsLike[] = [];
|
|
218
|
-
stats.forEach((entry) => {
|
|
219
|
-
if (isRtcStatsLike(entry)) entries.push(entry);
|
|
220
|
-
});
|
|
221
|
-
return entries;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function statsValue(entry: unknown): unknown {
|
|
225
|
-
return Array.isArray(entry) ? entry[1] : entry;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
function isRtcStatsLike(value: unknown): value is RtcStatsLike {
|
|
229
|
-
return isObject(value) && typeof value.type === "string";
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function isObject(value: unknown): value is Record<PropertyKey, unknown> {
|
|
233
|
-
return typeof value === "object" && value !== null;
|
|
234
|
-
}
|