@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/src/components/Chalk.tsx
DELETED
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
import type { ChatUploadFile, ClientEventMap, FeedbackEvidenceInput, GetAccess, SpaceClient } from "@q9labsai/chalk-client";
|
|
2
|
-
import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from "react";
|
|
3
|
-
import { Pressable, StyleSheet, Text, View } from "react-native";
|
|
4
|
-
|
|
5
|
-
import { ChalkProvider, useSpaceClient } from "../context/space-client-context";
|
|
6
|
-
import { useConnection } from "../hooks/space-hooks";
|
|
7
|
-
import { createNativeSpaceClient } from "../space-client/create-native-space-client";
|
|
8
|
-
import { NativeAppearanceProvider, NativeTextureOverlay, useNativeAppearance } from "../ui/native-appearance-context";
|
|
9
|
-
import { type ThemePalette, type ThemeTexture } from "../ui/appearance";
|
|
10
|
-
import { NativeThemeProvider, useNativeTheme } from "../ui/native-theme";
|
|
11
|
-
import { DEFAULT_CHALK_THEME_TOKENS } from "../ui/theme-tokens";
|
|
12
|
-
import { SpaceView } from "./SpaceView";
|
|
13
|
-
import { Entrance, type EntranceDefaults } from "./Entrance";
|
|
14
|
-
|
|
15
|
-
export type ChalkFeatures = {
|
|
16
|
-
readonly chat?: boolean;
|
|
17
|
-
readonly participants?: boolean;
|
|
18
|
-
readonly admission?: boolean;
|
|
19
|
-
readonly screenShare?: boolean;
|
|
20
|
-
readonly whiteboard?: boolean;
|
|
21
|
-
readonly reactions?: boolean;
|
|
22
|
-
readonly handRaise?: boolean;
|
|
23
|
-
readonly info?: boolean;
|
|
24
|
-
readonly settings?: boolean;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const CHALK_THEME_TOKENS = DEFAULT_CHALK_THEME_TOKENS;
|
|
28
|
-
|
|
29
|
-
export type ChalkThemeTokens = {
|
|
30
|
-
readonly [Token in keyof typeof CHALK_THEME_TOKENS]: string;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type ChalkTheme = {
|
|
34
|
-
readonly colorScheme?: "dark" | "light";
|
|
35
|
-
readonly palette?: ThemePalette;
|
|
36
|
-
readonly texture?: ThemeTexture;
|
|
37
|
-
readonly accent?: string;
|
|
38
|
-
readonly tokens?: Partial<ChalkThemeTokens>;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export type SpaceLayout = "grid" | "focus" | "presentation";
|
|
42
|
-
|
|
43
|
-
type ChalkCallbacks = {
|
|
44
|
-
readonly onJoined?: () => void;
|
|
45
|
-
readonly onLeft?: () => void;
|
|
46
|
-
readonly onEpisodeEnded?: (event: ClientEventMap["episodeEnded"]) => void;
|
|
47
|
-
readonly onParticipantJoined?: (event: ClientEventMap["participantJoined"]) => void;
|
|
48
|
-
readonly onParticipantLeft?: (event: ClientEventMap["participantLeft"]) => void;
|
|
49
|
-
readonly onScreenShareStarted?: (event: ClientEventMap["screenShareStarted"]) => void;
|
|
50
|
-
readonly onScreenShareStopped?: (event: ClientEventMap["screenShareStopped"]) => void;
|
|
51
|
-
readonly onError?: (event: ClientEventMap["error"]) => void;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
type ChalkCommonProps = ChalkCallbacks & {
|
|
55
|
-
readonly displayName?: string;
|
|
56
|
-
readonly entrance?: boolean;
|
|
57
|
-
readonly defaults?: EntranceDefaults;
|
|
58
|
-
readonly features?: ChalkFeatures;
|
|
59
|
-
readonly theme?: ChalkTheme;
|
|
60
|
-
/** Selects files; the SDK owns bounds, upload, and send sequencing. */
|
|
61
|
-
readonly pickChatFiles?: () => Promise<readonly ChatUploadFile[]>;
|
|
62
|
-
readonly logoUrl?: string;
|
|
63
|
-
readonly spaceName?: string;
|
|
64
|
-
readonly inviteLink?: string;
|
|
65
|
-
readonly layout?: SpaceLayout;
|
|
66
|
-
readonly onLayoutChange?: (layout: SpaceLayout) => void;
|
|
67
|
-
readonly onOpenDiagnostics?: () => void;
|
|
68
|
-
readonly feedbackEvidence?: Partial<FeedbackEvidenceInput>;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export type ChalkProps = ChalkCommonProps &
|
|
72
|
-
(
|
|
73
|
-
| {
|
|
74
|
-
readonly client: SpaceClient;
|
|
75
|
-
readonly space?: never;
|
|
76
|
-
readonly getAccess?: never;
|
|
77
|
-
}
|
|
78
|
-
| {
|
|
79
|
-
readonly client?: never;
|
|
80
|
-
readonly space: string;
|
|
81
|
-
readonly getAccess: GetAccess;
|
|
82
|
-
}
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
export function Chalk(props: ChalkProps): React.JSX.Element {
|
|
86
|
-
const suppliedClient = props.client;
|
|
87
|
-
const space = props.space;
|
|
88
|
-
const getAccess = props.getAccess;
|
|
89
|
-
const getAccessRef = useRef(getAccess);
|
|
90
|
-
getAccessRef.current = getAccess;
|
|
91
|
-
const defaults = useRef(props.defaults).current;
|
|
92
|
-
const getLatestAccess = useCallback((...args: Parameters<GetAccess>): ReturnType<GetAccess> => {
|
|
93
|
-
const currentGetAccess = getAccessRef.current;
|
|
94
|
-
if (!currentGetAccess) throw new Error("Chalk requires getAccess when it creates the SpaceClient.");
|
|
95
|
-
return currentGetAccess(...args);
|
|
96
|
-
}, []);
|
|
97
|
-
const ownedClient = useMemo(
|
|
98
|
-
() =>
|
|
99
|
-
suppliedClient
|
|
100
|
-
? null
|
|
101
|
-
: createNativeSpaceClient({
|
|
102
|
-
space: space!,
|
|
103
|
-
getAccess: getLatestAccess,
|
|
104
|
-
microphone: defaults?.microphone,
|
|
105
|
-
camera: defaults?.camera,
|
|
106
|
-
}),
|
|
107
|
-
[getLatestAccess, space, suppliedClient],
|
|
108
|
-
);
|
|
109
|
-
const client = suppliedClient ?? ownedClient!;
|
|
110
|
-
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
if (!ownedClient) return;
|
|
113
|
-
return () => {
|
|
114
|
-
void ownedClient
|
|
115
|
-
.leave()
|
|
116
|
-
.catch(() => undefined)
|
|
117
|
-
.finally(() => ownedClient.dispose());
|
|
118
|
-
};
|
|
119
|
-
}, [ownedClient]);
|
|
120
|
-
|
|
121
|
-
return (
|
|
122
|
-
<NativeAppearanceProvider initialAppearance={{ palette: props.theme?.palette, texture: props.theme?.texture }}>
|
|
123
|
-
<AppearanceThemeBridge theme={props.theme}>
|
|
124
|
-
<ChalkProvider client={client}>
|
|
125
|
-
<SpaceExperience {...props} />
|
|
126
|
-
</ChalkProvider>
|
|
127
|
-
</AppearanceThemeBridge>
|
|
128
|
-
</NativeAppearanceProvider>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function AppearanceThemeBridge({ children, theme }: { readonly children: ReactNode; readonly theme?: ChalkTheme }): React.JSX.Element {
|
|
133
|
-
const { appearance } = useNativeAppearance();
|
|
134
|
-
return (
|
|
135
|
-
<NativeThemeProvider appearance={appearance} theme={theme}>
|
|
136
|
-
{children}
|
|
137
|
-
</NativeThemeProvider>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function SpaceExperience(props: ChalkProps): React.JSX.Element {
|
|
142
|
-
const client = useSpaceClient();
|
|
143
|
-
const connection = useConnection();
|
|
144
|
-
const previousStatus = useRef(connection.status);
|
|
145
|
-
const hasObservedStatus = useRef(false);
|
|
146
|
-
const hasBeenLive = useRef(connection.status === "live" || connection.status === "reconnecting");
|
|
147
|
-
const autoJoinAttempted = useRef(false);
|
|
148
|
-
const previousClient = useRef(client);
|
|
149
|
-
const [joinError, setJoinError] = useState<string | null>(null);
|
|
150
|
-
|
|
151
|
-
if (previousClient.current !== client) {
|
|
152
|
-
previousClient.current = client;
|
|
153
|
-
previousStatus.current = connection.status;
|
|
154
|
-
hasObservedStatus.current = false;
|
|
155
|
-
hasBeenLive.current = connection.status === "live" || connection.status === "reconnecting";
|
|
156
|
-
autoJoinAttempted.current = false;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const entrance = props.entrance ?? true;
|
|
160
|
-
const spaceName = props.spaceName ?? props.space ?? "Space";
|
|
161
|
-
const join = useCallback(
|
|
162
|
-
async (options: Parameters<SpaceClient["join"]>[0]) => {
|
|
163
|
-
try {
|
|
164
|
-
setJoinError(null);
|
|
165
|
-
await client.join(options);
|
|
166
|
-
} catch (cause) {
|
|
167
|
-
setJoinError(cause instanceof Error ? cause.message : "Could not enter this Space.");
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
[client],
|
|
171
|
-
);
|
|
172
|
-
const retryAutomaticJoin = useCallback(() => {
|
|
173
|
-
autoJoinAttempted.current = true;
|
|
174
|
-
void join(defaultJoinOptions(props));
|
|
175
|
-
}, [join, props]);
|
|
176
|
-
|
|
177
|
-
useEffect(() => {
|
|
178
|
-
setJoinError(null);
|
|
179
|
-
}, [client]);
|
|
180
|
-
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
const subscriptions = [
|
|
183
|
-
props.onEpisodeEnded && client.on("episodeEnded", props.onEpisodeEnded),
|
|
184
|
-
props.onParticipantJoined && client.on("participantJoined", props.onParticipantJoined),
|
|
185
|
-
props.onParticipantLeft && client.on("participantLeft", props.onParticipantLeft),
|
|
186
|
-
props.onScreenShareStarted && client.on("screenShareStarted", props.onScreenShareStarted),
|
|
187
|
-
props.onScreenShareStopped && client.on("screenShareStopped", props.onScreenShareStopped),
|
|
188
|
-
props.onError && client.on("error", props.onError),
|
|
189
|
-
].filter((unsubscribe): unsubscribe is () => void => Boolean(unsubscribe));
|
|
190
|
-
return () => subscriptions.forEach((unsubscribe) => unsubscribe());
|
|
191
|
-
}, [client, props.onEpisodeEnded, props.onError, props.onParticipantJoined, props.onParticipantLeft, props.onScreenShareStarted, props.onScreenShareStopped]);
|
|
192
|
-
|
|
193
|
-
useEffect(() => {
|
|
194
|
-
if (!entrance && connection.status === "idle" && !autoJoinAttempted.current) {
|
|
195
|
-
autoJoinAttempted.current = true;
|
|
196
|
-
void join(defaultJoinOptions(props));
|
|
197
|
-
}
|
|
198
|
-
}, [connection.status, entrance, join, props.defaults?.camera, props.defaults?.microphone, props.displayName]);
|
|
199
|
-
|
|
200
|
-
useEffect(() => {
|
|
201
|
-
const previous = previousStatus.current;
|
|
202
|
-
if (hasObservedStatus.current) {
|
|
203
|
-
if (connection.status === "live" && previous !== "live" && previous !== "reconnecting") props.onJoined?.();
|
|
204
|
-
if (connection.status === "left" && previous !== "left") props.onLeft?.();
|
|
205
|
-
}
|
|
206
|
-
previousStatus.current = connection.status;
|
|
207
|
-
hasObservedStatus.current = true;
|
|
208
|
-
if (connection.status === "live" || connection.status === "reconnecting") hasBeenLive.current = true;
|
|
209
|
-
}, [connection.status, props.onJoined, props.onLeft]);
|
|
210
|
-
|
|
211
|
-
if (connection.status === "idle" && entrance) {
|
|
212
|
-
return (
|
|
213
|
-
<AppearanceLayer>
|
|
214
|
-
<Entrance defaultDisplayName={props.displayName} defaults={props.defaults} error={joinError ?? undefined} logoUrl={props.logoUrl} onJoin={join} spaceName={spaceName} />
|
|
215
|
-
</AppearanceLayer>
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if (connection.status === "idle") {
|
|
220
|
-
return (
|
|
221
|
-
<AppearanceLayer>
|
|
222
|
-
<SpaceStatus message={joinError ?? `Entering ${spaceName}…`} onRetry={joinError ? retryAutomaticJoin : undefined} />
|
|
223
|
-
</AppearanceLayer>
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
if (connection.status === "joining") {
|
|
228
|
-
if (!entrance)
|
|
229
|
-
return (
|
|
230
|
-
<AppearanceLayer>
|
|
231
|
-
<SpaceStatus message={`Entering ${spaceName}…`} />
|
|
232
|
-
</AppearanceLayer>
|
|
233
|
-
);
|
|
234
|
-
return (
|
|
235
|
-
<AppearanceLayer>
|
|
236
|
-
<Entrance defaultDisplayName={props.displayName} defaults={props.defaults} joining logoUrl={props.logoUrl} onJoin={join} spaceName={spaceName} />
|
|
237
|
-
</AppearanceLayer>
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
if (connection.status === "failed") {
|
|
242
|
-
if (!hasBeenLive.current && entrance) {
|
|
243
|
-
return (
|
|
244
|
-
<AppearanceLayer>
|
|
245
|
-
<Entrance defaultDisplayName={props.displayName} defaults={props.defaults} error={connection.lastError?.message ?? "Unable to enter this Space."} logoUrl={props.logoUrl} onJoin={join} spaceName={spaceName} />
|
|
246
|
-
</AppearanceLayer>
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
return (
|
|
250
|
-
<AppearanceLayer>
|
|
251
|
-
<SpaceStatus message={connection.lastError?.message ?? "This Space is unavailable."} onRetry={() => void join(defaultJoinOptions(props))} />
|
|
252
|
-
</AppearanceLayer>
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (connection.status === "leaving")
|
|
257
|
-
return (
|
|
258
|
-
<AppearanceLayer>
|
|
259
|
-
<SpaceStatus message={`Leaving ${spaceName}…`} />
|
|
260
|
-
</AppearanceLayer>
|
|
261
|
-
);
|
|
262
|
-
if (connection.status === "left")
|
|
263
|
-
return (
|
|
264
|
-
<AppearanceLayer>
|
|
265
|
-
<SpaceStatus message="You have left this Space." onRetry={() => void join(defaultJoinOptions(props))} />
|
|
266
|
-
</AppearanceLayer>
|
|
267
|
-
);
|
|
268
|
-
|
|
269
|
-
return (
|
|
270
|
-
<NativeSpaceView
|
|
271
|
-
features={props.features}
|
|
272
|
-
inviteLink={props.inviteLink}
|
|
273
|
-
layout={props.layout}
|
|
274
|
-
logoUrl={props.logoUrl}
|
|
275
|
-
onLayoutChange={props.onLayoutChange}
|
|
276
|
-
onOpenDiagnostics={props.onOpenDiagnostics}
|
|
277
|
-
feedbackEvidence={props.feedbackEvidence}
|
|
278
|
-
pickChatFiles={props.pickChatFiles}
|
|
279
|
-
reconnecting={connection.status === "reconnecting"}
|
|
280
|
-
spaceName={spaceName}
|
|
281
|
-
/>
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function defaultJoinOptions(props: ChalkProps): Parameters<SpaceClient["join"]>[0] {
|
|
286
|
-
const displayName = props.displayName?.trim();
|
|
287
|
-
return {
|
|
288
|
-
...(displayName ? { displayName } : {}),
|
|
289
|
-
microphone: props.defaults?.microphone ?? true,
|
|
290
|
-
camera: props.defaults?.camera ?? true,
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
type NativeSpaceViewProps = {
|
|
295
|
-
readonly features?: ChalkFeatures;
|
|
296
|
-
readonly inviteLink?: string;
|
|
297
|
-
readonly layout?: SpaceLayout;
|
|
298
|
-
readonly logoUrl?: string;
|
|
299
|
-
readonly onLayoutChange?: (layout: SpaceLayout) => void;
|
|
300
|
-
readonly onOpenDiagnostics?: () => void;
|
|
301
|
-
readonly feedbackEvidence?: Partial<FeedbackEvidenceInput>;
|
|
302
|
-
readonly pickChatFiles?: () => Promise<readonly ChatUploadFile[]>;
|
|
303
|
-
readonly reconnecting: boolean;
|
|
304
|
-
readonly spaceName: string;
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
function NativeSpaceView({ features, inviteLink, layout, logoUrl, onLayoutChange, onOpenDiagnostics, feedbackEvidence, pickChatFiles, reconnecting, spaceName }: NativeSpaceViewProps): React.JSX.Element {
|
|
308
|
-
const client = useSpaceClient();
|
|
309
|
-
const theme = useNativeTheme();
|
|
310
|
-
|
|
311
|
-
return (
|
|
312
|
-
<View style={[styles.space, { backgroundColor: theme.colors.background }]}>
|
|
313
|
-
<SpaceView
|
|
314
|
-
features={features}
|
|
315
|
-
inviteLink={inviteLink}
|
|
316
|
-
layout={layout}
|
|
317
|
-
logoUrl={logoUrl}
|
|
318
|
-
onEndEpisode={() => client.endEpisode()}
|
|
319
|
-
onLayoutChange={onLayoutChange}
|
|
320
|
-
onLeave={() => client.leave()}
|
|
321
|
-
onOpenDiagnostics={onOpenDiagnostics}
|
|
322
|
-
feedbackEvidence={feedbackEvidence}
|
|
323
|
-
pickChatFiles={pickChatFiles}
|
|
324
|
-
reconnecting={reconnecting}
|
|
325
|
-
spaceName={spaceName}
|
|
326
|
-
/>
|
|
327
|
-
<NativeTextureOverlay />
|
|
328
|
-
</View>
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
function AppearanceLayer({ children }: { readonly children: ReactNode }): React.JSX.Element {
|
|
333
|
-
const theme = useNativeTheme();
|
|
334
|
-
return (
|
|
335
|
-
<View style={[styles.appearanceLayer, { backgroundColor: theme.colors.background }]}>
|
|
336
|
-
{children}
|
|
337
|
-
<NativeTextureOverlay />
|
|
338
|
-
</View>
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function SpaceStatus({ message, onRetry }: { readonly message: string; readonly onRetry?: () => void }): React.JSX.Element {
|
|
343
|
-
const theme = useNativeTheme();
|
|
344
|
-
return (
|
|
345
|
-
<View accessibilityLiveRegion="polite" style={[styles.status, { backgroundColor: theme.colors.background }]}>
|
|
346
|
-
<Text style={[styles.statusText, { color: theme.colors.foreground }]}>{message}</Text>
|
|
347
|
-
{onRetry ? (
|
|
348
|
-
<Pressable accessibilityRole="button" onPress={onRetry} style={[styles.retry, { backgroundColor: theme.colors.primary }]}>
|
|
349
|
-
<Text style={[styles.retryText, { color: theme.colors.primaryForeground }]}>Try again</Text>
|
|
350
|
-
</Pressable>
|
|
351
|
-
) : null}
|
|
352
|
-
</View>
|
|
353
|
-
);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
const styles = StyleSheet.create({
|
|
357
|
-
space: { flex: 1 },
|
|
358
|
-
appearanceLayer: { flex: 1 },
|
|
359
|
-
status: { flex: 1, alignItems: "center", justifyContent: "center", gap: 16, padding: 24 },
|
|
360
|
-
statusText: { fontSize: 16, textAlign: "center" },
|
|
361
|
-
retry: { borderRadius: 12, paddingHorizontal: 18, paddingVertical: 12 },
|
|
362
|
-
retryText: { fontWeight: "800" },
|
|
363
|
-
});
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import type { NativeChatMessage as ChatMessage } from "../ui/native-types";
|
|
2
|
-
import { useCallback, useRef } from "react";
|
|
3
|
-
import { type LayoutChangeEvent, type NativeScrollEvent, type NativeSyntheticEvent, ScrollView, StyleSheet, Text, type StyleProp, View, type ViewStyle } from "react-native";
|
|
4
|
-
import { Theme } from "../ui/theme";
|
|
5
|
-
import { formatChatAttachmentSize, isLatestChatMessageVisible, type NativeChatViewport } from "./native-chat";
|
|
6
|
-
|
|
7
|
-
export interface ChatMessageListProps {
|
|
8
|
-
readonly messages: readonly ChatMessage[];
|
|
9
|
-
readonly localParticipantId: string | null;
|
|
10
|
-
readonly onLatestMessageVisible: (sequence: string) => void;
|
|
11
|
-
readonly style?: StyleProp<ViewStyle>;
|
|
12
|
-
readonly contentContainerStyle?: StyleProp<ViewStyle>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export function ChatMessageList({ messages, localParticipantId, onLatestMessageVisible, style, contentContainerStyle }: ChatMessageListProps): React.JSX.Element {
|
|
16
|
-
const latestSequence = messages.at(-1)?.sequence ?? null;
|
|
17
|
-
const viewport = useRef<NativeChatViewport>({ contentHeight: 0, viewportHeight: 0, scrollOffset: 0 });
|
|
18
|
-
const renderedSequence = useRef<string | null>(null);
|
|
19
|
-
const measuredSequence = useRef<string | null>(null);
|
|
20
|
-
const reportedSequence = useRef<string | null>(null);
|
|
21
|
-
|
|
22
|
-
if (renderedSequence.current !== latestSequence) {
|
|
23
|
-
renderedSequence.current = latestSequence;
|
|
24
|
-
measuredSequence.current = null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const reportLatestIfVisible = useCallback(() => {
|
|
28
|
-
if (!latestSequence || measuredSequence.current !== latestSequence || reportedSequence.current === latestSequence) return;
|
|
29
|
-
if (!isLatestChatMessageVisible(viewport.current)) return;
|
|
30
|
-
reportedSequence.current = latestSequence;
|
|
31
|
-
onLatestMessageVisible(latestSequence);
|
|
32
|
-
}, [latestSequence, onLatestMessageVisible]);
|
|
33
|
-
|
|
34
|
-
const handleLayout = useCallback(
|
|
35
|
-
(event: LayoutChangeEvent) => {
|
|
36
|
-
viewport.current = { ...viewport.current, viewportHeight: event.nativeEvent.layout.height };
|
|
37
|
-
reportLatestIfVisible();
|
|
38
|
-
},
|
|
39
|
-
[reportLatestIfVisible],
|
|
40
|
-
);
|
|
41
|
-
|
|
42
|
-
const handleContentSizeChange = useCallback(
|
|
43
|
-
(_width: number, height: number) => {
|
|
44
|
-
viewport.current = { ...viewport.current, contentHeight: height };
|
|
45
|
-
measuredSequence.current = latestSequence;
|
|
46
|
-
reportLatestIfVisible();
|
|
47
|
-
},
|
|
48
|
-
[latestSequence, reportLatestIfVisible],
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
const handleScroll = useCallback(
|
|
52
|
-
(event: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
53
|
-
const { contentOffset, contentSize, layoutMeasurement } = event.nativeEvent;
|
|
54
|
-
viewport.current = {
|
|
55
|
-
contentHeight: contentSize.height,
|
|
56
|
-
viewportHeight: layoutMeasurement.height,
|
|
57
|
-
scrollOffset: contentOffset.y,
|
|
58
|
-
};
|
|
59
|
-
measuredSequence.current = latestSequence;
|
|
60
|
-
reportLatestIfVisible();
|
|
61
|
-
},
|
|
62
|
-
[latestSequence, reportLatestIfVisible],
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
return (
|
|
66
|
-
<ScrollView accessibilityLabel="Chat messages" contentContainerStyle={[styles.content, contentContainerStyle]} onContentSizeChange={handleContentSizeChange} onLayout={handleLayout} onScroll={handleScroll} scrollEventThrottle={16} showsVerticalScrollIndicator={false} style={style}>
|
|
67
|
-
{messages.length === 0 ? (
|
|
68
|
-
<View style={styles.emptyState}>
|
|
69
|
-
<Text style={styles.emptyTitle}>No messages yet.</Text>
|
|
70
|
-
<Text style={styles.emptyText}>Send a message to start the conversation.</Text>
|
|
71
|
-
</View>
|
|
72
|
-
) : null}
|
|
73
|
-
{messages.map((message) => {
|
|
74
|
-
const isLocal = message.senderId === localParticipantId;
|
|
75
|
-
const readByNames = message.readBy.map((receipt) => receipt.displayName);
|
|
76
|
-
const status = readByNames.length > 0 ? `Read by ${readByNames.join(", ")}` : "Sent";
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<View key={message.id} style={[styles.messageGroup, isLocal && styles.localMessageGroup]}>
|
|
80
|
-
{!isLocal ? <Text style={styles.sender}>{message.senderName}</Text> : null}
|
|
81
|
-
<View style={[styles.bubble, isLocal ? styles.localBubble : styles.remoteBubble]}>
|
|
82
|
-
{message.content ? <Text style={styles.messageText}>{message.content}</Text> : null}
|
|
83
|
-
{message.attachments.map((attachment) => {
|
|
84
|
-
const isImage = attachment.mimeType.startsWith("image/");
|
|
85
|
-
return (
|
|
86
|
-
<View accessibilityLabel={`${isImage ? "Image" : "File"} attachment ${attachment.fileName}, ${formatChatAttachmentSize(attachment.byteLength)}`} key={attachment.attachmentId} style={styles.attachment}>
|
|
87
|
-
<Text style={styles.attachmentKind}>{isImage ? "IMAGE" : "FILE"}</Text>
|
|
88
|
-
<View style={styles.attachmentMetadata}>
|
|
89
|
-
<Text numberOfLines={1} style={styles.attachmentName}>
|
|
90
|
-
{attachment.fileName}
|
|
91
|
-
</Text>
|
|
92
|
-
<Text style={styles.attachmentDetails}>
|
|
93
|
-
{formatChatAttachmentSize(attachment.byteLength)} · {attachment.mimeType}
|
|
94
|
-
</Text>
|
|
95
|
-
</View>
|
|
96
|
-
</View>
|
|
97
|
-
);
|
|
98
|
-
})}
|
|
99
|
-
</View>
|
|
100
|
-
{isLocal ? (
|
|
101
|
-
<Text accessibilityLabel={status} numberOfLines={1} style={[styles.status, readByNames.length > 0 && styles.readStatus]}>
|
|
102
|
-
{status}
|
|
103
|
-
</Text>
|
|
104
|
-
) : null}
|
|
105
|
-
</View>
|
|
106
|
-
);
|
|
107
|
-
})}
|
|
108
|
-
</ScrollView>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const styles = StyleSheet.create({
|
|
113
|
-
content: {
|
|
114
|
-
gap: 12,
|
|
115
|
-
},
|
|
116
|
-
emptyState: {
|
|
117
|
-
flex: 1,
|
|
118
|
-
minHeight: 160,
|
|
119
|
-
alignItems: "center",
|
|
120
|
-
justifyContent: "center",
|
|
121
|
-
paddingHorizontal: 24,
|
|
122
|
-
},
|
|
123
|
-
emptyTitle: {
|
|
124
|
-
color: Theme.colors.onDark,
|
|
125
|
-
fontSize: 15,
|
|
126
|
-
fontWeight: "700",
|
|
127
|
-
},
|
|
128
|
-
emptyText: {
|
|
129
|
-
color: Theme.colors.mutedForeground,
|
|
130
|
-
fontSize: 12,
|
|
131
|
-
marginTop: 6,
|
|
132
|
-
textAlign: "center",
|
|
133
|
-
},
|
|
134
|
-
messageGroup: {
|
|
135
|
-
alignSelf: "flex-start",
|
|
136
|
-
gap: 5,
|
|
137
|
-
maxWidth: "85%",
|
|
138
|
-
},
|
|
139
|
-
localMessageGroup: {
|
|
140
|
-
alignSelf: "flex-end",
|
|
141
|
-
alignItems: "flex-end",
|
|
142
|
-
},
|
|
143
|
-
sender: {
|
|
144
|
-
color: Theme.colors.mutedForeground,
|
|
145
|
-
fontSize: 11,
|
|
146
|
-
fontWeight: "700",
|
|
147
|
-
paddingHorizontal: 4,
|
|
148
|
-
},
|
|
149
|
-
bubble: {
|
|
150
|
-
borderRadius: 18,
|
|
151
|
-
maxWidth: "100%",
|
|
152
|
-
paddingHorizontal: 14,
|
|
153
|
-
paddingVertical: 10,
|
|
154
|
-
},
|
|
155
|
-
localBubble: {
|
|
156
|
-
backgroundColor: Theme.colors.primary,
|
|
157
|
-
borderBottomRightRadius: 6,
|
|
158
|
-
},
|
|
159
|
-
remoteBubble: {
|
|
160
|
-
backgroundColor: Theme.colors.whiteOverlay06,
|
|
161
|
-
borderBottomLeftRadius: 6,
|
|
162
|
-
},
|
|
163
|
-
messageText: {
|
|
164
|
-
color: Theme.colors.onDark,
|
|
165
|
-
fontSize: 14,
|
|
166
|
-
lineHeight: 20,
|
|
167
|
-
},
|
|
168
|
-
attachment: {
|
|
169
|
-
alignItems: "center",
|
|
170
|
-
backgroundColor: Theme.colors.darkOverlay16,
|
|
171
|
-
borderColor: Theme.colors.whiteOverlay16,
|
|
172
|
-
borderRadius: 10,
|
|
173
|
-
borderWidth: 1,
|
|
174
|
-
flexDirection: "row",
|
|
175
|
-
gap: 10,
|
|
176
|
-
marginTop: 8,
|
|
177
|
-
minWidth: 190,
|
|
178
|
-
padding: 10,
|
|
179
|
-
},
|
|
180
|
-
attachmentKind: {
|
|
181
|
-
color: Theme.colors.whiteOverlay72,
|
|
182
|
-
fontSize: 9,
|
|
183
|
-
fontWeight: "800",
|
|
184
|
-
letterSpacing: 0.6,
|
|
185
|
-
},
|
|
186
|
-
attachmentMetadata: {
|
|
187
|
-
flex: 1,
|
|
188
|
-
minWidth: 0,
|
|
189
|
-
},
|
|
190
|
-
attachmentName: {
|
|
191
|
-
color: Theme.colors.onDark,
|
|
192
|
-
fontSize: 13,
|
|
193
|
-
fontWeight: "700",
|
|
194
|
-
},
|
|
195
|
-
attachmentDetails: {
|
|
196
|
-
color: Theme.colors.whiteOverlay68,
|
|
197
|
-
fontSize: 10,
|
|
198
|
-
marginTop: 2,
|
|
199
|
-
},
|
|
200
|
-
status: {
|
|
201
|
-
color: Theme.colors.mutedForeground,
|
|
202
|
-
fontSize: 10,
|
|
203
|
-
maxWidth: 240,
|
|
204
|
-
paddingHorizontal: 4,
|
|
205
|
-
},
|
|
206
|
-
readStatus: {
|
|
207
|
-
color: Theme.colors.primary,
|
|
208
|
-
},
|
|
209
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { EntranceView } from "./EntranceView";
|
|
2
|
-
import { Image } from "react-native";
|
|
3
|
-
import { Logo } from "./logo/Logo";
|
|
4
|
-
|
|
5
|
-
export type EntranceDefaults = {
|
|
6
|
-
readonly microphone?: boolean;
|
|
7
|
-
readonly camera?: boolean;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type EntranceSettings = {
|
|
11
|
-
readonly displayName: string;
|
|
12
|
-
readonly microphone: boolean;
|
|
13
|
-
readonly camera: boolean;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type EntranceProps = {
|
|
17
|
-
readonly spaceName: string;
|
|
18
|
-
readonly logoUrl?: string;
|
|
19
|
-
readonly defaultDisplayName?: string;
|
|
20
|
-
readonly defaults?: EntranceDefaults;
|
|
21
|
-
readonly error?: string;
|
|
22
|
-
readonly joining?: boolean;
|
|
23
|
-
readonly onCancel?: () => void;
|
|
24
|
-
readonly onJoin: (settings: EntranceSettings) => void | Promise<void>;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/** The native implementation owns the device preview lifecycle and disposal. */
|
|
28
|
-
export function Entrance({ spaceName, logoUrl, defaultDisplayName, defaults, error, joining = false, onCancel, onJoin }: EntranceProps): React.JSX.Element {
|
|
29
|
-
return (
|
|
30
|
-
<EntranceView
|
|
31
|
-
error={error}
|
|
32
|
-
initialAudioEnabled={defaults?.microphone ?? true}
|
|
33
|
-
initialVideoEnabled={defaults?.camera ?? true}
|
|
34
|
-
joinDisabled={joining}
|
|
35
|
-
logo={logoUrl ? <Image accessibilityLabel="Chalk" source={{ uri: logoUrl }} style={{ height: 32, width: 120 }} /> : <Logo height={32} variant="wordmark" />}
|
|
36
|
-
onCancel={onCancel}
|
|
37
|
-
onJoin={({ displayName, microphoneEnabled, cameraEnabled }) => void onJoin({ displayName, microphone: microphoneEnabled, camera: cameraEnabled })}
|
|
38
|
-
spaceName={spaceName}
|
|
39
|
-
displayName={defaultDisplayName}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
}
|