@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
package/dist/android.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Chalk,
|
|
3
|
-
ChalkProvider,
|
|
4
|
-
Entrance,
|
|
5
|
-
Logo,
|
|
6
|
-
buildChalkInviteLink,
|
|
7
|
-
useCan,
|
|
8
|
-
useChat,
|
|
9
|
-
useConnection,
|
|
10
|
-
useMedia,
|
|
11
|
-
useParticipants,
|
|
12
|
-
useReactions,
|
|
13
|
-
useRecording,
|
|
14
|
-
useSelf,
|
|
15
|
-
useSpaceClient,
|
|
16
|
-
useWhiteboard
|
|
17
|
-
} from "./chunk-ITLUHTVS.js";
|
|
18
|
-
import {
|
|
19
|
-
THEME_PALETTES,
|
|
20
|
-
THEME_TEXTURES,
|
|
21
|
-
getThemeMode,
|
|
22
|
-
isDarkThemePalette,
|
|
23
|
-
resolveNativeAppearance
|
|
24
|
-
} from "./chunk-5DQ4KBRH.js";
|
|
25
|
-
import {
|
|
26
|
-
Theme,
|
|
27
|
-
createNativeTheme
|
|
28
|
-
} from "./chunk-JB4LNWVP.js";
|
|
29
|
-
import "./chunk-2OS7SSXE.js";
|
|
30
|
-
import "./chunk-F3NPRVHO.js";
|
|
31
|
-
import {
|
|
32
|
-
extractSpaceInviteFromLink,
|
|
33
|
-
getClipboardInviteSuggestion,
|
|
34
|
-
parseSpaceInviteLink
|
|
35
|
-
} from "./chunk-4L5GXJ36.js";
|
|
36
|
-
export {
|
|
37
|
-
Chalk,
|
|
38
|
-
ChalkProvider,
|
|
39
|
-
Entrance,
|
|
40
|
-
Logo,
|
|
41
|
-
THEME_PALETTES,
|
|
42
|
-
THEME_TEXTURES,
|
|
43
|
-
Theme,
|
|
44
|
-
buildChalkInviteLink,
|
|
45
|
-
createNativeTheme,
|
|
46
|
-
extractSpaceInviteFromLink,
|
|
47
|
-
getClipboardInviteSuggestion,
|
|
48
|
-
getThemeMode,
|
|
49
|
-
isDarkThemePalette,
|
|
50
|
-
parseSpaceInviteLink,
|
|
51
|
-
resolveNativeAppearance,
|
|
52
|
-
useCan,
|
|
53
|
-
useChat,
|
|
54
|
-
useConnection,
|
|
55
|
-
useMedia,
|
|
56
|
-
useParticipants,
|
|
57
|
-
useReactions,
|
|
58
|
-
useRecording,
|
|
59
|
-
useSelf,
|
|
60
|
-
useSpaceClient,
|
|
61
|
-
useWhiteboard
|
|
62
|
-
};
|
package/dist/chunk-2OS7SSXE.js
DELETED
|
@@ -1,552 +0,0 @@
|
|
|
1
|
-
// src/space-client/create-native-space-client.ts
|
|
2
|
-
import {
|
|
3
|
-
AsyncStorageV1PendingTargetStore,
|
|
4
|
-
CloudflareRTKClient,
|
|
5
|
-
CloudflareSFUClient,
|
|
6
|
-
createChalkChatFileHttpTransport,
|
|
7
|
-
createChalkWhiteboardV1Client,
|
|
8
|
-
createChalkWhiteboardV1FileHttpTransport,
|
|
9
|
-
createCloudflareSFUHTTPTransport,
|
|
10
|
-
createReactNativeSyncLifecycle,
|
|
11
|
-
createReactNativeWebSocketFactory,
|
|
12
|
-
createV1SyncClient
|
|
13
|
-
} from "@q9labsai/chalk-client";
|
|
14
|
-
import { createSpaceClientForPlatform } from "@q9labsai/chalk-client/effect";
|
|
15
|
-
import { RTCPeerConnection, mediaDevices } from "@cloudflare/react-native-webrtc";
|
|
16
|
-
import { AppState } from "react-native";
|
|
17
|
-
|
|
18
|
-
// src/telemetry.ts
|
|
19
|
-
import { syncTelemetryCorrelation } from "@q9labsai/chalk-client/telemetry";
|
|
20
|
-
var rtcStateEvents = ["connectionstatechange", "iceconnectionstatechange", "signalingstatechange"];
|
|
21
|
-
var nativeJourneyContexts = /* @__PURE__ */ new WeakMap();
|
|
22
|
-
async function authenticatedNativeCredential(credential, journey) {
|
|
23
|
-
const value = await credential();
|
|
24
|
-
try {
|
|
25
|
-
journey?.setAuthenticatedTelemetryHeaders?.({ Authorization: `Bearer ${value}` });
|
|
26
|
-
} catch {
|
|
27
|
-
}
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
function bindNativeAuthenticatedTelemetry(client, journey) {
|
|
31
|
-
const setHeaders = journey?.setAuthenticatedTelemetryHeaders;
|
|
32
|
-
if (!setHeaders) return;
|
|
33
|
-
const clear = () => {
|
|
34
|
-
try {
|
|
35
|
-
setHeaders(void 0);
|
|
36
|
-
} catch {
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const onSnapshot = () => {
|
|
40
|
-
const status = client.getSnapshot().connection.status;
|
|
41
|
-
if (status === "idle" || status === "failed" || status === "left") clear();
|
|
42
|
-
};
|
|
43
|
-
const unsubscribe = client.subscribe(onSnapshot);
|
|
44
|
-
let disposed = false;
|
|
45
|
-
const originalDispose = client.dispose;
|
|
46
|
-
client.dispose = () => {
|
|
47
|
-
if (disposed) return;
|
|
48
|
-
disposed = true;
|
|
49
|
-
clear();
|
|
50
|
-
unsubscribe();
|
|
51
|
-
originalDispose();
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function registerNativeJourneyContext(client, journey, telemetry) {
|
|
55
|
-
if (!journey || !telemetry) return;
|
|
56
|
-
nativeJourneyContexts.set(client, {
|
|
57
|
-
journeyId: journey.context.journeyId,
|
|
58
|
-
traceparent: journey.context.traceparent,
|
|
59
|
-
...journey.context.tracestate ? { tracestate: journey.context.tracestate } : {},
|
|
60
|
-
recordWhiteboardMetric: telemetry.recordWhiteboardMetric
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function getNativeJourneyContext(client) {
|
|
64
|
-
return nativeJourneyContexts.get(client);
|
|
65
|
-
}
|
|
66
|
-
function createTelemetry(journey) {
|
|
67
|
-
const connection = {
|
|
68
|
-
apiHeaders: journey.headers,
|
|
69
|
-
context: journey.context,
|
|
70
|
-
syncCorrelation: syncTelemetryCorrelation(journey.context)
|
|
71
|
-
};
|
|
72
|
-
return {
|
|
73
|
-
connection,
|
|
74
|
-
observePeerConnection(peerConnection) {
|
|
75
|
-
return observeNativeRtc(peerConnection, journey);
|
|
76
|
-
},
|
|
77
|
-
recordSyncFrame(observation) {
|
|
78
|
-
journey.recordSyncFrame(observation);
|
|
79
|
-
},
|
|
80
|
-
recordWhiteboardMetric(metric) {
|
|
81
|
-
journey.recordDiagnostic({
|
|
82
|
-
category: "whiteboard_renderer",
|
|
83
|
-
code: metric.name,
|
|
84
|
-
metricValue: metric.value,
|
|
85
|
-
phase: "media",
|
|
86
|
-
state: isFailedWhiteboardMetric(metric.name) ? "failed" : "observed"
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function syncTransportCloseDiagnostic(event) {
|
|
92
|
-
const code = typeof event.code === "number" ? event.code : null;
|
|
93
|
-
const reason = typeof event.reason === "string" ? event.reason : "";
|
|
94
|
-
return {
|
|
95
|
-
category: "network",
|
|
96
|
-
code: code === null ? "sync_websocket_closed_unknown" : `sync_websocket_closed_${code}_${syncCloseReason(reason)}`,
|
|
97
|
-
phase: "signaling",
|
|
98
|
-
state: code === 1e3 ? "observed" : "failed"
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function syncCloseReason(reason) {
|
|
102
|
-
switch (reason) {
|
|
103
|
-
case "authentication failed":
|
|
104
|
-
case "heartbeat timeout":
|
|
105
|
-
case "hello timeout":
|
|
106
|
-
case "invalid token":
|
|
107
|
-
case "policy violation":
|
|
108
|
-
case "space actions unsupported":
|
|
109
|
-
case "text frames only":
|
|
110
|
-
case "transport error":
|
|
111
|
-
return reason.replaceAll(" ", "_");
|
|
112
|
-
default:
|
|
113
|
-
return reason ? "other" : "none";
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function isFailedWhiteboardMetric(name) {
|
|
117
|
-
return name.endsWith(".failure") || name.endsWith(".termination");
|
|
118
|
-
}
|
|
119
|
-
function observeNativeRtc(peerConnection, journey) {
|
|
120
|
-
let disposed = false;
|
|
121
|
-
const dispose = () => {
|
|
122
|
-
if (disposed) return;
|
|
123
|
-
disposed = true;
|
|
124
|
-
for (const event of rtcStateEvents) peerConnection.removeEventListener(event, capture);
|
|
125
|
-
};
|
|
126
|
-
const capture = () => {
|
|
127
|
-
void peerConnection.getStats().then((stats) => journey.recordRtcSummary(rtcConnectionState(peerConnection), rtcStats(stats))).catch(() => void 0);
|
|
128
|
-
if (peerConnection.connectionState === "closed") dispose();
|
|
129
|
-
};
|
|
130
|
-
for (const event of rtcStateEvents) peerConnection.addEventListener(event, capture);
|
|
131
|
-
capture();
|
|
132
|
-
return dispose;
|
|
133
|
-
}
|
|
134
|
-
function rtcConnectionState(peerConnection) {
|
|
135
|
-
return {
|
|
136
|
-
connectionState: peerConnection.connectionState,
|
|
137
|
-
iceConnectionState: peerConnection.iceConnectionState,
|
|
138
|
-
signalingState: peerConnection.signalingState
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function rtcStats(stats) {
|
|
142
|
-
if (Array.isArray(stats)) return stats.filter(isRtcStatsLike);
|
|
143
|
-
if (isIterable(stats)) return Array.from(stats, statsValue).filter(isRtcStatsLike);
|
|
144
|
-
if (hasForEach(stats)) return forEachStats(stats);
|
|
145
|
-
if (isObject(stats)) return Object.values(stats).filter(isRtcStatsLike);
|
|
146
|
-
return [];
|
|
147
|
-
}
|
|
148
|
-
function isIterable(value) {
|
|
149
|
-
return isObject(value) && Symbol.iterator in value;
|
|
150
|
-
}
|
|
151
|
-
function hasForEach(value) {
|
|
152
|
-
return isObject(value) && "forEach" in value && typeof value.forEach === "function";
|
|
153
|
-
}
|
|
154
|
-
function forEachStats(stats) {
|
|
155
|
-
const entries = [];
|
|
156
|
-
stats.forEach((entry) => {
|
|
157
|
-
if (isRtcStatsLike(entry)) entries.push(entry);
|
|
158
|
-
});
|
|
159
|
-
return entries;
|
|
160
|
-
}
|
|
161
|
-
function statsValue(entry) {
|
|
162
|
-
return Array.isArray(entry) ? entry[1] : entry;
|
|
163
|
-
}
|
|
164
|
-
function isRtcStatsLike(value) {
|
|
165
|
-
return isObject(value) && typeof value.type === "string";
|
|
166
|
-
}
|
|
167
|
-
function isObject(value) {
|
|
168
|
-
return typeof value === "object" && value !== null;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// src/space-client/cloudflare-rtk-native.ts
|
|
172
|
-
var createNativeRealtimeKitClient = async ({ authToken, onError }) => {
|
|
173
|
-
const { default: NativeRealtimeKitClient } = await import("@cloudflare/realtimekit-react-native");
|
|
174
|
-
const client = await NativeRealtimeKitClient.init({
|
|
175
|
-
authToken,
|
|
176
|
-
defaults: { audio: false, video: false },
|
|
177
|
-
onError
|
|
178
|
-
});
|
|
179
|
-
return adaptNativeRealtimeKitClient(client);
|
|
180
|
-
};
|
|
181
|
-
function adaptNativeRealtimeKitClient(client) {
|
|
182
|
-
const self = client.self;
|
|
183
|
-
return {
|
|
184
|
-
join: () => client.joinRoom(),
|
|
185
|
-
leave: () => client.leaveRoom(),
|
|
186
|
-
self: {
|
|
187
|
-
get peerId() {
|
|
188
|
-
return self.peerId;
|
|
189
|
-
},
|
|
190
|
-
get audioEnabled() {
|
|
191
|
-
return self.audioEnabled;
|
|
192
|
-
},
|
|
193
|
-
get videoEnabled() {
|
|
194
|
-
return self.videoEnabled;
|
|
195
|
-
},
|
|
196
|
-
get screenShareEnabled() {
|
|
197
|
-
return self.screenShareEnabled;
|
|
198
|
-
},
|
|
199
|
-
get audioTrack() {
|
|
200
|
-
return self.audioTrack ?? null;
|
|
201
|
-
},
|
|
202
|
-
get videoTrack() {
|
|
203
|
-
return self.videoTrack ?? null;
|
|
204
|
-
},
|
|
205
|
-
get screenShareTracks() {
|
|
206
|
-
return {
|
|
207
|
-
...self.screenShareTracks.audio ? { audio: self.screenShareTracks.audio } : {},
|
|
208
|
-
...self.screenShareTracks.video ? { video: self.screenShareTracks.video } : {}
|
|
209
|
-
};
|
|
210
|
-
},
|
|
211
|
-
enableAudio: () => self.enableAudio(),
|
|
212
|
-
enableVideo: () => self.enableVideo(),
|
|
213
|
-
enableScreenShare: () => self.enableScreenShare(),
|
|
214
|
-
disableAudio: () => self.disableAudio(),
|
|
215
|
-
disableVideo: () => self.disableVideo(),
|
|
216
|
-
disableScreenShare: () => self.disableScreenShare(),
|
|
217
|
-
onAudioUpdate: (listener) => {
|
|
218
|
-
self.on("audioUpdate", listener);
|
|
219
|
-
return () => self.off("audioUpdate", listener);
|
|
220
|
-
},
|
|
221
|
-
onVideoUpdate: (listener) => {
|
|
222
|
-
self.on("videoUpdate", listener);
|
|
223
|
-
return () => self.off("videoUpdate", listener);
|
|
224
|
-
},
|
|
225
|
-
onScreenShareUpdate: (listener) => {
|
|
226
|
-
self.on("screenShareUpdate", listener);
|
|
227
|
-
return () => self.off("screenShareUpdate", listener);
|
|
228
|
-
},
|
|
229
|
-
onLeft: (listener) => {
|
|
230
|
-
const callback = () => listener();
|
|
231
|
-
self.on("roomLeft", callback);
|
|
232
|
-
return () => self.off("roomLeft", callback);
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
participants: {
|
|
236
|
-
joined: {
|
|
237
|
-
list: () => client.participants.joined.toArray().map(toParticipant),
|
|
238
|
-
onJoined: (listener) => {
|
|
239
|
-
const callback = (participant) => listener(toParticipant(participant));
|
|
240
|
-
client.participants.joined.on("participantJoined", callback);
|
|
241
|
-
return () => client.participants.joined.off("participantJoined", callback);
|
|
242
|
-
},
|
|
243
|
-
onLeft: (listener) => {
|
|
244
|
-
const callback = (participant) => listener(toParticipant(participant));
|
|
245
|
-
client.participants.joined.on("participantLeft", callback);
|
|
246
|
-
return () => client.participants.joined.off("participantLeft", callback);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
function toParticipant(participant) {
|
|
253
|
-
return {
|
|
254
|
-
id: participant.id,
|
|
255
|
-
userId: participant.userId,
|
|
256
|
-
...participant.customParticipantId === void 0 ? {} : { customParticipantId: participant.customParticipantId },
|
|
257
|
-
audioEnabled: participant.audioEnabled,
|
|
258
|
-
videoEnabled: participant.videoEnabled,
|
|
259
|
-
screenShareEnabled: participant.screenShareEnabled,
|
|
260
|
-
audioTrack: participant.audioTrack ?? null,
|
|
261
|
-
videoTrack: participant.videoTrack ?? null,
|
|
262
|
-
screenShareTracks: {
|
|
263
|
-
...participant.screenShareTracks.audio ? { audio: participant.screenShareTracks.audio } : {},
|
|
264
|
-
...participant.screenShareTracks.video ? { video: participant.screenShareTracks.video } : {}
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// src/space-client/create-native-space-client.ts
|
|
270
|
-
function createNativeSpaceClient(options) {
|
|
271
|
-
const { storage, telemetry: journey } = options;
|
|
272
|
-
const apiBaseURL = options.baseUrl ?? "https://api.chalkmeet.com";
|
|
273
|
-
const syncURL = options.syncUrl ?? defaultSyncURL(apiBaseURL);
|
|
274
|
-
const telemetry = journey ? createTelemetry(journey) : void 0;
|
|
275
|
-
const fetch = telemetryFetch(journey);
|
|
276
|
-
const lifecycle = createReactNativeSyncLifecycle({ appState: AppState });
|
|
277
|
-
const webSocket = createReactNativeWebSocketFactory(nativeWebSocketConstructor(journey));
|
|
278
|
-
const dependencies = {
|
|
279
|
-
clock: {
|
|
280
|
-
now: () => Date.now(),
|
|
281
|
-
setTimeout: (callback, milliseconds) => globalThis.setTimeout(callback, milliseconds),
|
|
282
|
-
clearTimeout: (handle) => globalThis.clearTimeout(handle)
|
|
283
|
-
},
|
|
284
|
-
mediaDevices: {
|
|
285
|
-
getUserMedia: async (constraints) => await mediaDevices.getUserMedia(constraints),
|
|
286
|
-
getDisplayMedia: async () => await mediaDevices.getDisplayMedia()
|
|
287
|
-
},
|
|
288
|
-
createMediaClient: (input) => createMediaClient(apiBaseURL, input, fetch, telemetry?.observePeerConnection, journey),
|
|
289
|
-
createSyncClient: (input) => createSyncClient(syncURL, input, lifecycle, webSocket, storage),
|
|
290
|
-
createChatFileTransport: (input) => createChatFileTransport(apiBaseURL, input, fetch),
|
|
291
|
-
createWhiteboardClient: options.whiteboardURL === null ? void 0 : (input) => createWhiteboardClient(apiBaseURL, options.whiteboardURL ?? whiteboardURL(syncURL), input, fetch, lifecycle, webSocket),
|
|
292
|
-
subscribeForeground: (listener) => {
|
|
293
|
-
const subscription = AppState.addEventListener("change", (state) => {
|
|
294
|
-
if (state === "active") listener();
|
|
295
|
-
});
|
|
296
|
-
return () => subscription.remove();
|
|
297
|
-
}
|
|
298
|
-
};
|
|
299
|
-
const client = createSpaceClientForPlatform(
|
|
300
|
-
{ space: options.space, getAccess: options.getAccess, baseUrl: apiBaseURL },
|
|
301
|
-
{
|
|
302
|
-
apiBaseUrl: apiBaseURL,
|
|
303
|
-
syncUrl: syncURL,
|
|
304
|
-
whiteboardUrl: options.whiteboardURL,
|
|
305
|
-
telemetry: journey?.context,
|
|
306
|
-
dependencies,
|
|
307
|
-
fetch,
|
|
308
|
-
syncStartupTimeoutMs: options.syncStartupTimeoutMs ?? 3e4,
|
|
309
|
-
initialMicrophoneEnabled: options.microphone,
|
|
310
|
-
initialCameraEnabled: options.camera,
|
|
311
|
-
onConnectionDiagnostic: (event) => journey?.recordDiagnostic(connectionDiagnostic(event)),
|
|
312
|
-
...journey ? { recordReconnect: (observation) => journey.recordDiagnostic(observation) } : {},
|
|
313
|
-
feedbackSource: options.feedbackSource ?? "embedded"
|
|
314
|
-
}
|
|
315
|
-
);
|
|
316
|
-
bindNativeAuthenticatedTelemetry(client, journey);
|
|
317
|
-
registerNativeJourneyContext(client, journey, telemetry);
|
|
318
|
-
return client;
|
|
319
|
-
}
|
|
320
|
-
function connectionDiagnostic(event) {
|
|
321
|
-
if (event.event === "space_join_span" && event.step && event.spanId && event.outcome) {
|
|
322
|
-
return {
|
|
323
|
-
category: "connection",
|
|
324
|
-
code: `space.join.${event.step}.${event.outcome}`,
|
|
325
|
-
phase: joinTracePhase(event.step),
|
|
326
|
-
state: event.outcome === "succeeded" ? "succeeded" : event.outcome === "failed" ? "failed" : "observed",
|
|
327
|
-
...event.durationMs === void 0 ? {} : { metricValue: event.durationMs },
|
|
328
|
-
attributes: {
|
|
329
|
-
span_id: event.spanId,
|
|
330
|
-
...event.parentSpanId ? { parent_span_id: event.parentSpanId } : {},
|
|
331
|
-
step: event.step,
|
|
332
|
-
outcome: event.outcome,
|
|
333
|
-
epoch: event.epoch,
|
|
334
|
-
...event.code ? { failure_code: event.code } : {}
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
return {
|
|
339
|
-
category: "connection",
|
|
340
|
-
code: event.event,
|
|
341
|
-
phase: event.state === "joining" ? "signaling" : event.state === "leaving" || event.state === "left" ? "terminal" : "recovery",
|
|
342
|
-
state: event.event.endsWith("_failed") || event.event.endsWith("_exhausted") ? "failed" : "observed"
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
function joinTracePhase(step) {
|
|
346
|
-
switch (step) {
|
|
347
|
-
case "acquire_initial_media":
|
|
348
|
-
case "create_media_client":
|
|
349
|
-
case "start_media":
|
|
350
|
-
return "media";
|
|
351
|
-
default:
|
|
352
|
-
return "signaling";
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
function createMediaClient(apiBaseURL, input, fetch, observePeerConnection, journey) {
|
|
356
|
-
const { subject } = input.access;
|
|
357
|
-
if (input.access.media.provider === "cloudflare_rtk") {
|
|
358
|
-
const client2 = new CloudflareRTKClient({
|
|
359
|
-
authToken: input.access.media.clientPayload.token,
|
|
360
|
-
participantId: subject.participantId,
|
|
361
|
-
clientFactory: createNativeRealtimeKitClient,
|
|
362
|
-
onError: input.onFailure,
|
|
363
|
-
onScreenEnded: input.onScreenEnded
|
|
364
|
-
});
|
|
365
|
-
return createRTKConnectionMediaClient(client2);
|
|
366
|
-
}
|
|
367
|
-
const replaceMediaConnection = input.replaceMediaConnection;
|
|
368
|
-
const client = new CloudflareSFUClient({
|
|
369
|
-
bootstrap: input.access.media.clientPayload,
|
|
370
|
-
participantId: subject.participantId,
|
|
371
|
-
transport: createCloudflareSFUHTTPTransport({
|
|
372
|
-
apiBaseURL,
|
|
373
|
-
telemetry: input.telemetry,
|
|
374
|
-
credential: () => authenticatedNativeCredential(input.credential, journey),
|
|
375
|
-
tenantId: subject.tenantId,
|
|
376
|
-
spaceId: subject.spaceId,
|
|
377
|
-
episodeId: subject.episodeId,
|
|
378
|
-
participantId: subject.participantId,
|
|
379
|
-
fetch
|
|
380
|
-
}),
|
|
381
|
-
replaceMediaConnection: replaceMediaConnection ? async () => {
|
|
382
|
-
const replacement = await replaceMediaConnection();
|
|
383
|
-
if (replacement.provider !== "cloudflare_sfu") throw new TypeError("The Cloudflare SFU adapter requires a Cloudflare SFU access grant");
|
|
384
|
-
return replacement.clientPayload;
|
|
385
|
-
} : void 0,
|
|
386
|
-
peerConnectionFactory: (configuration) => {
|
|
387
|
-
const connection = new RTCPeerConnection(configuration);
|
|
388
|
-
observePeerConnection?.(connection);
|
|
389
|
-
return connection;
|
|
390
|
-
},
|
|
391
|
-
recordReconnect: input.recordReconnect,
|
|
392
|
-
onError: input.onFailure,
|
|
393
|
-
onScreenEnded: input.onScreenEnded
|
|
394
|
-
});
|
|
395
|
-
return createSFUConnectionMediaClient(client);
|
|
396
|
-
}
|
|
397
|
-
function createRTKConnectionMediaClient(client) {
|
|
398
|
-
return {
|
|
399
|
-
setLocalPublicationTarget: client.setLocalPublicationTarget.bind(client),
|
|
400
|
-
observeLocalPublications: client.observeLocalPublications.bind(client),
|
|
401
|
-
observeRemotePublications: client.observeRemotePublications.bind(client),
|
|
402
|
-
start: client.start.bind(client),
|
|
403
|
-
stop: client.stop.bind(client),
|
|
404
|
-
restart: (input) => {
|
|
405
|
-
if (!("provider" in input) || input.provider !== "cloudflare_rtk") throw new TypeError("The RealtimeKit adapter requires a Cloudflare RealtimeKit access grant");
|
|
406
|
-
return client.restart(input);
|
|
407
|
-
},
|
|
408
|
-
prepareLocalTrack: client.prepareLocalTrack.bind(client),
|
|
409
|
-
clearPreparedLocalTrack: client.clearPreparedLocalTrack.bind(client),
|
|
410
|
-
getSnapshot: client.getSnapshot.bind(client),
|
|
411
|
-
subscribe: client.subscribe.bind(client)
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
function createSFUConnectionMediaClient(client) {
|
|
415
|
-
return {
|
|
416
|
-
setLocalPublicationTarget: client.setLocalPublicationTarget.bind(client),
|
|
417
|
-
observeLocalPublications: client.observeLocalPublications.bind(client),
|
|
418
|
-
observeRemotePublications: client.observeRemotePublications.bind(client),
|
|
419
|
-
start: client.start.bind(client),
|
|
420
|
-
stop: client.stop.bind(client),
|
|
421
|
-
restart: (input) => {
|
|
422
|
-
if ("provider" in input) {
|
|
423
|
-
if (input.provider !== "cloudflare_sfu") throw new TypeError("The Cloudflare SFU adapter requires a Cloudflare SFU access grant");
|
|
424
|
-
return client.restart(input.clientPayload);
|
|
425
|
-
}
|
|
426
|
-
return client.restart(input);
|
|
427
|
-
},
|
|
428
|
-
prepareLocalTrack: client.prepareLocalTrack.bind(client),
|
|
429
|
-
clearPreparedLocalTrack: client.clearPreparedLocalTrack.bind(client),
|
|
430
|
-
getSnapshot: client.getSnapshot.bind(client),
|
|
431
|
-
subscribe: client.subscribe.bind(client)
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
function createSyncClient(syncURL, input, lifecycle, webSocket, storage) {
|
|
435
|
-
const subject = input.access.subject;
|
|
436
|
-
const scope = `${subject.tenantId}:${subject.episodeId}:${subject.participantId}`;
|
|
437
|
-
return createV1SyncClient({
|
|
438
|
-
url: syncURL,
|
|
439
|
-
token: input.token,
|
|
440
|
-
mediaPlane: input.media,
|
|
441
|
-
lifecycle,
|
|
442
|
-
webSocket,
|
|
443
|
-
telemetry: input.telemetry,
|
|
444
|
-
recordReconnect: input.recordReconnect,
|
|
445
|
-
...storage ? { pendingStore: new AsyncStorageV1PendingTargetStore({ scope, storage }) } : {}
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
function createChatFileTransport(apiBaseURL, input, fetch) {
|
|
449
|
-
return createChalkChatFileHttpTransport({ baseUrl: apiBaseURL, token: input.token, fetch });
|
|
450
|
-
}
|
|
451
|
-
function createWhiteboardClient(apiBaseURL, url, input, fetch, lifecycle, webSocket) {
|
|
452
|
-
let sceneId = null;
|
|
453
|
-
const files = createChalkWhiteboardV1FileHttpTransport({
|
|
454
|
-
baseUrl: apiBaseURL,
|
|
455
|
-
token: input.token,
|
|
456
|
-
sceneId: () => {
|
|
457
|
-
if (sceneId === null) throw new TypeError("Whiteboard scene is not ready");
|
|
458
|
-
return sceneId;
|
|
459
|
-
},
|
|
460
|
-
fetch
|
|
461
|
-
});
|
|
462
|
-
return createChalkWhiteboardV1Client({
|
|
463
|
-
url,
|
|
464
|
-
token: input.token,
|
|
465
|
-
files,
|
|
466
|
-
lifecycle,
|
|
467
|
-
webSocket,
|
|
468
|
-
onSummary: (summary) => {
|
|
469
|
-
sceneId = summary.sceneId;
|
|
470
|
-
input.onSummary(summary);
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
function telemetryFetch(journey) {
|
|
475
|
-
if (!journey) return globalThis.fetch;
|
|
476
|
-
return (input, init) => {
|
|
477
|
-
const headers = new Headers(init?.headers);
|
|
478
|
-
for (const [name, value] of Object.entries(journey.headers)) headers.set(name, value);
|
|
479
|
-
return globalThis.fetch(input, { ...init, headers });
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
function nativeWebSocketConstructor(journey) {
|
|
483
|
-
const RuntimeWebSocket = globalThis.WebSocket;
|
|
484
|
-
return class ChalkNativeWebSocket {
|
|
485
|
-
onopen = null;
|
|
486
|
-
onmessage = null;
|
|
487
|
-
onclose = null;
|
|
488
|
-
onerror = null;
|
|
489
|
-
#socket;
|
|
490
|
-
constructor(url) {
|
|
491
|
-
this.#socket = new RuntimeWebSocket(url, void 0, journey ? { headers: journey.headers } : void 0);
|
|
492
|
-
this.#socket.onopen = (event) => this.onopen?.(event);
|
|
493
|
-
this.#socket.onmessage = (event) => {
|
|
494
|
-
recordSyncFrame(journey, "server_to_client", event.data);
|
|
495
|
-
this.onmessage?.(event);
|
|
496
|
-
};
|
|
497
|
-
this.#socket.onclose = (event) => {
|
|
498
|
-
recordSyncTransportClose(journey, event);
|
|
499
|
-
this.onclose?.(event);
|
|
500
|
-
};
|
|
501
|
-
this.#socket.onerror = (event) => {
|
|
502
|
-
journey?.recordDiagnostic({ category: "network", code: "sync_websocket_error", phase: "signaling", state: "failed" });
|
|
503
|
-
this.onerror?.(event);
|
|
504
|
-
};
|
|
505
|
-
}
|
|
506
|
-
send(data) {
|
|
507
|
-
recordSyncFrame(journey, "client_to_server", data);
|
|
508
|
-
this.#socket.send(data);
|
|
509
|
-
}
|
|
510
|
-
close(code, reason) {
|
|
511
|
-
this.#socket.close(code, reason);
|
|
512
|
-
}
|
|
513
|
-
};
|
|
514
|
-
}
|
|
515
|
-
function recordSyncTransportClose(journey, event) {
|
|
516
|
-
if (!journey) return;
|
|
517
|
-
journey.recordDiagnostic(syncTransportCloseDiagnostic(event));
|
|
518
|
-
}
|
|
519
|
-
function recordSyncFrame(journey, direction, data) {
|
|
520
|
-
if (!journey) return;
|
|
521
|
-
let frameType = "binary";
|
|
522
|
-
if (typeof data === "string") {
|
|
523
|
-
try {
|
|
524
|
-
const frame = JSON.parse(data);
|
|
525
|
-
frameType = typeof frame.type === "string" ? frame.type : "unknown";
|
|
526
|
-
} catch {
|
|
527
|
-
frameType = "invalid_json";
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
journey.recordSyncFrame({ direction, frameType });
|
|
531
|
-
}
|
|
532
|
-
function whiteboardURL(syncURL) {
|
|
533
|
-
const url = new URL(syncURL);
|
|
534
|
-
url.pathname = "/v1/whiteboard";
|
|
535
|
-
url.search = "";
|
|
536
|
-
url.hash = "";
|
|
537
|
-
return url.toString();
|
|
538
|
-
}
|
|
539
|
-
function defaultSyncURL(apiBaseURL) {
|
|
540
|
-
const url = new URL(apiBaseURL);
|
|
541
|
-
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
542
|
-
if (url.hostname.startsWith("api.")) url.hostname = `sync.${url.hostname.slice(4)}`;
|
|
543
|
-
url.pathname = "/v1/sync";
|
|
544
|
-
url.search = "";
|
|
545
|
-
url.hash = "";
|
|
546
|
-
return url.toString();
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
export {
|
|
550
|
-
getNativeJourneyContext,
|
|
551
|
-
createNativeSpaceClient
|
|
552
|
-
};
|