@multiplayer-app/session-recorder-react-native 1.0.1-beta.2 → 1.0.1-beta.4
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/LICENSE +1 -2
- package/README.md +216 -155
- package/SessionRecorderNative.podspec +9 -14
- package/android/build.gradle +21 -41
- package/android/gradle.properties +4 -4
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeConfig.kt +52 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeModule.kt +860 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativeModuleSpec.kt +51 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/SessionRecorderNativePackage.kt +33 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/model/TargetInfo.kt +9 -0
- package/android/src/main/java/com/multiplayer/sessionrecordernative/util/ViewUtils.kt +72 -0
- package/android/src/main/java/com/xxx/XxxModule.kt +23 -0
- package/ios/GestureTargetFinder.swift +50 -0
- package/ios/SessionRecorderNative.podspec +4 -2
- package/ios/SessionRecorderNative.swift +10 -1
- package/ios/SessionRecorderNativeSpec.swift +55 -0
- package/ios/Xxx.h +5 -0
- package/ios/Xxx.mm +21 -0
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js +23 -0
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js.map +1 -0
- package/lib/module/components/ScreenRecorderView/index.js +4 -0
- package/lib/module/components/ScreenRecorderView/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js +64 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js +74 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js +191 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js +138 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js +177 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js +27 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js +133 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/icons.js +93 -0
- package/lib/module/components/SessionRecorderWidget/icons.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/index.js +5 -0
- package/lib/module/components/SessionRecorderWidget/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/styles.js +173 -0
- package/lib/module/components/SessionRecorderWidget/styles.js.map +1 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/config/constants.js +42 -0
- package/lib/module/config/constants.js.map +1 -0
- package/lib/module/config/defaults.js +81 -0
- package/lib/module/config/defaults.js.map +1 -0
- package/lib/module/config/index.js +9 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/masking.js +35 -0
- package/lib/module/config/masking.js.map +1 -0
- package/lib/module/config/session-recorder.js +44 -0
- package/lib/module/config/session-recorder.js.map +1 -0
- package/lib/module/config/validators.js +28 -0
- package/lib/module/config/validators.js.map +1 -0
- package/lib/module/config/widget.js +35 -0
- package/lib/module/config/widget.js.map +1 -0
- package/lib/module/context/SessionRecorderContext.js +93 -0
- package/lib/module/context/SessionRecorderContext.js.map +1 -0
- package/lib/module/context/SessionRecorderStore.js +12 -0
- package/lib/module/context/SessionRecorderStore.js.map +1 -0
- package/lib/module/context/useSessionRecorderStore.js +20 -0
- package/lib/module/context/useSessionRecorderStore.js.map +1 -0
- package/lib/module/context/useStoreSelector.js +27 -0
- package/lib/module/context/useStoreSelector.js.map +1 -0
- package/lib/module/index.js +13 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/SessionRecorderNative.js +74 -0
- package/lib/module/native/SessionRecorderNative.js.map +1 -0
- package/lib/module/native/index.js +4 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/otel/helpers.js +218 -0
- package/lib/module/otel/helpers.js.map +1 -0
- package/lib/module/otel/index.js +95 -0
- package/lib/module/otel/index.js.map +1 -0
- package/lib/module/otel/instrumentations/index.js +102 -0
- package/lib/module/otel/instrumentations/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/patch/index.js +4 -0
- package/lib/module/patch/index.js.map +1 -0
- package/lib/module/patch/xhr.js +116 -0
- package/lib/module/patch/xhr.js.map +1 -0
- package/lib/module/recorder/eventExporter.js +130 -0
- package/lib/module/recorder/eventExporter.js.map +1 -0
- package/lib/module/recorder/gestureRecorder.js +641 -0
- package/lib/module/recorder/gestureRecorder.js.map +1 -0
- package/lib/module/recorder/index.js +168 -0
- package/lib/module/recorder/index.js.map +1 -0
- package/lib/module/recorder/navigationTracker.js +228 -0
- package/lib/module/recorder/navigationTracker.js.map +1 -0
- package/lib/module/recorder/screenRecorder.js +495 -0
- package/lib/module/recorder/screenRecorder.js.map +1 -0
- package/lib/module/services/api.service.js +149 -0
- package/lib/module/services/api.service.js.map +1 -0
- package/lib/module/services/network.service.js +178 -0
- package/lib/module/services/network.service.js.map +1 -0
- package/lib/module/services/screenMaskingService.js +107 -0
- package/lib/module/services/screenMaskingService.js.map +1 -0
- package/lib/module/services/storage.service.js +179 -0
- package/lib/module/services/storage.service.js.map +1 -0
- package/lib/module/session-recorder.js +541 -0
- package/lib/module/session-recorder.js.map +1 -0
- package/lib/module/types/configs.js +4 -0
- package/lib/module/types/configs.js.map +1 -0
- package/lib/module/types/expo-constants.d.js +2 -0
- package/lib/module/types/expo-constants.d.js.map +1 -0
- package/lib/module/types/index.js +11 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/session-recorder.js +68 -0
- package/lib/module/types/session-recorder.js.map +1 -0
- package/lib/module/types/session.js +9 -0
- package/lib/module/types/session.js.map +1 -0
- package/lib/module/utils/app-metadata.js +28 -0
- package/lib/module/utils/app-metadata.js.map +1 -0
- package/lib/module/utils/constants.optional.expo.js +6 -0
- package/lib/module/utils/constants.optional.expo.js.map +1 -0
- package/lib/module/utils/constants.optional.js +8 -0
- package/lib/module/utils/constants.optional.js.map +1 -0
- package/lib/module/utils/createStore.js +27 -0
- package/lib/module/utils/createStore.js.map +1 -0
- package/lib/module/utils/index.js +11 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/logger.js +193 -0
- package/lib/module/utils/logger.js.map +1 -0
- package/lib/module/utils/platform.js +340 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/utils/request-utils.js +58 -0
- package/lib/module/utils/request-utils.js.map +1 -0
- package/lib/module/utils/rrweb-events.js +276 -0
- package/lib/module/utils/rrweb-events.js.map +1 -0
- package/lib/module/utils/session.js +21 -0
- package/lib/module/utils/session.js.map +1 -0
- package/lib/module/utils/shallowEqual.js +17 -0
- package/lib/module/utils/shallowEqual.js.map +1 -0
- package/lib/module/utils/time.js +17 -0
- package/lib/module/utils/time.js.map +1 -0
- package/lib/module/utils/type-utils.js +69 -0
- package/lib/module/utils/type-utils.js.map +1 -0
- package/lib/module/version.js +4 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts +6 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts.map +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts +2 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ErrorBanner.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FinalPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FloatingButton.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/InitialPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalContainer.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalHeader.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/SessionRecorderWidget.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/icons.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts.map +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts +3 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/styles.d.ts +4 -3
- package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/constants.d.ts +1 -0
- package/lib/typescript/src/config/constants.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/defaults.d.ts +2 -1
- package/lib/typescript/src/config/defaults.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/index.d.ts +1 -0
- package/lib/typescript/src/config/index.d.ts.map +1 -0
- package/lib/typescript/src/config/masking.d.ts +3 -0
- package/lib/typescript/src/config/masking.d.ts.map +1 -0
- package/lib/typescript/src/config/session-recorder.d.ts +3 -0
- package/lib/typescript/src/config/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/validators.d.ts +1 -0
- package/lib/typescript/src/config/validators.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/widget.d.ts +2 -1
- package/lib/typescript/src/config/widget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderContext.d.ts +3 -2
- package/lib/typescript/src/context/SessionRecorderContext.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderStore.d.ts +2 -1
- package/lib/typescript/src/context/SessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useSessionRecorderStore.d.ts +2 -1
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useStoreSelector.d.ts +2 -1
- package/lib/typescript/src/context/useStoreSelector.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/native/SessionRecorderNative.d.ts +21 -3
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/native/index.d.ts +1 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/helpers.d.ts +3 -2
- package/lib/typescript/src/otel/helpers.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/index.d.ts +2 -2
- package/lib/typescript/src/otel/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/instrumentations/index.d.ts +2 -1
- package/lib/typescript/src/otel/instrumentations/index.d.ts.map +1 -0
- package/lib/typescript/src/patch/index.d.ts +2 -0
- package/lib/typescript/src/patch/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/patch/xhr.d.ts +1 -0
- package/lib/typescript/src/patch/xhr.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/eventExporter.d.ts +2 -1
- package/lib/typescript/src/recorder/eventExporter.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/gestureRecorder.d.ts +3 -2
- package/lib/typescript/src/recorder/gestureRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/index.d.ts +3 -2
- package/lib/typescript/src/recorder/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/navigationTracker.d.ts +2 -1
- package/lib/typescript/src/recorder/navigationTracker.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/screenRecorder.d.ts +4 -4
- package/lib/typescript/src/recorder/screenRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/api.service.d.ts +2 -1
- package/lib/typescript/src/services/api.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/network.service.d.ts +1 -0
- package/lib/typescript/src/services/network.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/screenMaskingService.d.ts +2 -1
- package/lib/typescript/src/services/screenMaskingService.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/storage.service.d.ts +2 -1
- package/lib/typescript/src/services/storage.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/session-recorder.d.ts +3 -2
- package/lib/typescript/src/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/configs.d.ts +3 -2
- package/lib/typescript/src/types/configs.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/index.d.ts +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session-recorder.d.ts +3 -2
- package/lib/typescript/src/types/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session.d.ts +1 -0
- package/lib/typescript/src/types/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/app-metadata.d.ts +1 -0
- package/lib/typescript/src/utils/app-metadata.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.expo.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.expo.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/createStore.d.ts +1 -0
- package/lib/typescript/src/utils/createStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/logger.d.ts +1 -0
- package/lib/typescript/src/utils/logger.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/platform.d.ts +2 -1
- package/lib/typescript/src/utils/platform.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/request-utils.d.ts +1 -0
- package/lib/typescript/src/utils/request-utils.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/rrweb-events.d.ts +2 -1
- package/lib/typescript/src/utils/rrweb-events.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/session.d.ts +1 -0
- package/lib/typescript/src/utils/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/shallowEqual.d.ts +1 -0
- package/lib/typescript/src/utils/shallowEqual.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/time.d.ts +1 -0
- package/lib/typescript/src/utils/time.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/type-utils.d.ts +1 -0
- package/lib/typescript/src/utils/type-utils.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +2 -0
- package/lib/typescript/src/version.d.ts.map +1 -0
- package/package.json +140 -39
- package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +20 -0
- package/src/components/SessionRecorderWidget/ErrorBanner.tsx +58 -0
- package/src/components/SessionRecorderWidget/FinalPopover.tsx +96 -0
- package/src/components/SessionRecorderWidget/FloatingButton.tsx +176 -0
- package/src/components/SessionRecorderWidget/InitialPopover.tsx +167 -0
- package/src/components/SessionRecorderWidget/ModalContainer.tsx +189 -0
- package/src/components/SessionRecorderWidget/ModalHeader.tsx +24 -0
- package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +136 -0
- package/src/components/SessionRecorderWidget/icons.tsx +52 -0
- package/{dist/components/SessionRecorderWidget/index.d.ts → src/components/SessionRecorderWidget/index.ts} +1 -0
- package/src/components/SessionRecorderWidget/styles.ts +169 -0
- package/src/components/index.ts +2 -0
- package/src/config/constants.ts +68 -0
- package/src/config/defaults.ts +101 -0
- package/src/config/index.ts +6 -0
- package/src/config/masking.ts +34 -0
- package/src/config/session-recorder.ts +59 -0
- package/src/config/validators.ts +31 -0
- package/src/config/widget.ts +38 -0
- package/src/context/SessionRecorderContext.tsx +138 -0
- package/src/context/SessionRecorderStore.ts +21 -0
- package/src/context/useSessionRecorderStore.ts +27 -0
- package/src/context/useStoreSelector.ts +34 -0
- package/src/index.ts +10 -0
- package/src/native/SessionRecorderNative.ts +164 -0
- package/src/native/index.ts +1 -0
- package/src/otel/helpers.ts +274 -0
- package/src/otel/index.ts +135 -0
- package/src/otel/instrumentations/index.ts +115 -0
- package/src/patch/index.ts +1 -0
- package/src/patch/xhr.ts +149 -0
- package/src/recorder/eventExporter.ts +155 -0
- package/src/recorder/gestureRecorder.ts +681 -0
- package/src/recorder/index.ts +190 -0
- package/src/recorder/navigationTracker.ts +245 -0
- package/src/recorder/screenRecorder.ts +549 -0
- package/src/services/api.service.ts +215 -0
- package/src/services/network.service.ts +182 -0
- package/src/services/screenMaskingService.ts +122 -0
- package/src/services/storage.service.ts +219 -0
- package/src/session-recorder.ts +591 -0
- package/src/types/configs.ts +96 -0
- package/src/types/expo-constants.d.ts +7 -0
- package/src/types/index.ts +29 -0
- package/src/types/session-recorder.ts +386 -0
- package/src/types/session.ts +65 -0
- package/src/utils/app-metadata.ts +31 -0
- package/src/utils/constants.optional.expo.ts +5 -0
- package/src/utils/constants.optional.ts +16 -0
- package/src/utils/createStore.ts +29 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/logger.ts +216 -0
- package/src/utils/platform.ts +370 -0
- package/src/utils/request-utils.ts +61 -0
- package/src/utils/rrweb-events.ts +316 -0
- package/src/utils/session.ts +19 -0
- package/src/utils/shallowEqual.ts +14 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/type-utils.ts +75 -0
- package/src/version.ts +1 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/android/gradlew +0 -249
- package/android/gradlew.bat +0 -92
- package/copy-react-native-dist.sh +0 -56
- package/dist/components/ScreenRecorderView/ScreenRecorderView.d.ts +0 -5
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js +0 -1
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js.map +0 -1
- package/dist/components/ScreenRecorderView/index.js +0 -1
- package/dist/components/ScreenRecorderView/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js.map +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js.map +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js.map +0 -1
- package/dist/components/SessionRecorderWidget/icons.js +0 -1
- package/dist/components/SessionRecorderWidget/icons.js.map +0 -1
- package/dist/components/SessionRecorderWidget/index.js +0 -1
- package/dist/components/SessionRecorderWidget/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/styles.js +0 -1
- package/dist/components/SessionRecorderWidget/styles.js.map +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/config/constants.js +0 -1
- package/dist/config/constants.js.map +0 -1
- package/dist/config/defaults.js +0 -1
- package/dist/config/defaults.js.map +0 -1
- package/dist/config/index.js +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/masking.d.ts +0 -2
- package/dist/config/masking.js +0 -1
- package/dist/config/masking.js.map +0 -1
- package/dist/config/session-recorder.d.ts +0 -2
- package/dist/config/session-recorder.js +0 -1
- package/dist/config/session-recorder.js.map +0 -1
- package/dist/config/validators.js +0 -1
- package/dist/config/validators.js.map +0 -1
- package/dist/config/widget.js +0 -1
- package/dist/config/widget.js.map +0 -1
- package/dist/context/SessionRecorderContext.js +0 -1
- package/dist/context/SessionRecorderContext.js.map +0 -1
- package/dist/context/SessionRecorderStore.js +0 -1
- package/dist/context/SessionRecorderStore.js.map +0 -1
- package/dist/context/useSessionRecorderStore.js +0 -1
- package/dist/context/useSessionRecorderStore.js.map +0 -1
- package/dist/context/useStoreSelector.js +0 -1
- package/dist/context/useStoreSelector.js.map +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +0 -1
- package/dist/native/GestureRecorderNative.d.ts +0 -57
- package/dist/native/GestureRecorderNative.js +0 -1
- package/dist/native/GestureRecorderNative.js.map +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.d.ts +0 -31
- package/dist/native/GestureRecorderNativeTurboSpec.js +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/SessionRecorderNative.js +0 -1
- package/dist/native/SessionRecorderNative.js.map +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.d.ts +0 -17
- package/dist/native/SessionRecorderNativeTurboSpec.js +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/index.js +0 -1
- package/dist/native/index.js.map +0 -1
- package/dist/otel/helpers.js +0 -1
- package/dist/otel/helpers.js.map +0 -1
- package/dist/otel/index.js +0 -1
- package/dist/otel/index.js.map +0 -1
- package/dist/otel/instrumentations/index.js +0 -1
- package/dist/otel/instrumentations/index.js.map +0 -1
- package/dist/patch/index.d.ts +0 -1
- package/dist/patch/index.js +0 -1
- package/dist/patch/index.js.map +0 -1
- package/dist/patch/xhr.js +0 -1
- package/dist/patch/xhr.js.map +0 -1
- package/dist/recorder/eventExporter.js +0 -1
- package/dist/recorder/eventExporter.js.map +0 -1
- package/dist/recorder/gestureRecorder.js +0 -1
- package/dist/recorder/gestureRecorder.js.map +0 -1
- package/dist/recorder/index.js +0 -1
- package/dist/recorder/index.js.map +0 -1
- package/dist/recorder/navigationTracker.js +0 -1
- package/dist/recorder/navigationTracker.js.map +0 -1
- package/dist/recorder/screenRecorder.js +0 -1
- package/dist/recorder/screenRecorder.js.map +0 -1
- package/dist/services/api.service.js +0 -1
- package/dist/services/api.service.js.map +0 -1
- package/dist/services/network.service.js +0 -1
- package/dist/services/network.service.js.map +0 -1
- package/dist/services/screenMaskingService.js +0 -1
- package/dist/services/screenMaskingService.js.map +0 -1
- package/dist/services/storage.service.js +0 -1
- package/dist/services/storage.service.js.map +0 -1
- package/dist/session-recorder.js +0 -1
- package/dist/session-recorder.js.map +0 -1
- package/dist/types/configs.js +0 -1
- package/dist/types/configs.js.map +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/session-recorder.js +0 -1
- package/dist/types/session-recorder.js.map +0 -1
- package/dist/types/session.js +0 -1
- package/dist/types/session.js.map +0 -1
- package/dist/utils/app-metadata.js +0 -1
- package/dist/utils/app-metadata.js.map +0 -1
- package/dist/utils/constants.optional.expo.js +0 -1
- package/dist/utils/constants.optional.expo.js.map +0 -1
- package/dist/utils/constants.optional.js +0 -1
- package/dist/utils/constants.optional.js.map +0 -1
- package/dist/utils/createStore.js +0 -1
- package/dist/utils/createStore.js.map +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/platform.js +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/request-utils.js +0 -1
- package/dist/utils/request-utils.js.map +0 -1
- package/dist/utils/rrweb-events.js +0 -1
- package/dist/utils/rrweb-events.js.map +0 -1
- package/dist/utils/session.js +0 -1
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/shallowEqual.js +0 -1
- package/dist/utils/shallowEqual.js.map +0 -1
- package/dist/utils/time.js +0 -1
- package/dist/utils/time.js.map +0 -1
- package/dist/utils/type-utils.js +0 -1
- package/dist/utils/type-utils.js.map +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/dist/version.js.map +0 -1
- package/docs/AUTO_METADATA_DETECTION.md +0 -108
- /package/{dist/components/ScreenRecorderView/index.d.ts → src/components/ScreenRecorderView/index.ts} +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useRef, useEffect, useMemo } from 'react';
|
|
4
|
+
import { StyleSheet, Platform, Animated, PanResponder, View, Dimensions } from 'react-native';
|
|
5
|
+
import { SessionState } from "../../types/index.js";
|
|
6
|
+
import { StorageService } from "../../services/storage.service.js";
|
|
7
|
+
import { RecordIcon, CapturingIcon, PausedIcon } from "./icons.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const buttonSize = 52;
|
|
10
|
+
const rightOffset = 20;
|
|
11
|
+
const topOffset = Platform.OS === 'ios' ? 60 : 40;
|
|
12
|
+
const FloatingButton = ({
|
|
13
|
+
sessionState,
|
|
14
|
+
onPress
|
|
15
|
+
}) => {
|
|
16
|
+
const position = useRef(new Animated.ValueXY({
|
|
17
|
+
x: 0,
|
|
18
|
+
y: 0
|
|
19
|
+
})).current;
|
|
20
|
+
const lastPosition = useRef({
|
|
21
|
+
top: topOffset,
|
|
22
|
+
right: rightOffset
|
|
23
|
+
});
|
|
24
|
+
const storageService = useRef(StorageService.getInstance()).current;
|
|
25
|
+
const screenBounds = useMemo(() => {
|
|
26
|
+
const {
|
|
27
|
+
width,
|
|
28
|
+
height
|
|
29
|
+
} = Dimensions.get('window');
|
|
30
|
+
return {
|
|
31
|
+
minTop: topOffset,
|
|
32
|
+
maxTop: height - buttonSize,
|
|
33
|
+
minRight: 0,
|
|
34
|
+
maxRight: width - buttonSize
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
|
|
38
|
+
// Load saved position on component mount
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const savedPosition = storageService.getFloatingButtonPosition();
|
|
41
|
+
if (savedPosition) {
|
|
42
|
+
const {
|
|
43
|
+
width
|
|
44
|
+
} = Dimensions.get('window');
|
|
45
|
+
const top = savedPosition.y;
|
|
46
|
+
const right = width - savedPosition.x - buttonSize;
|
|
47
|
+
lastPosition.current = {
|
|
48
|
+
top,
|
|
49
|
+
right
|
|
50
|
+
};
|
|
51
|
+
position.setValue({
|
|
52
|
+
x: right,
|
|
53
|
+
y: top
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
position.setValue({
|
|
57
|
+
x: lastPosition.current.right,
|
|
58
|
+
y: lastPosition.current.top
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
const panResponder = useRef(PanResponder.create({
|
|
63
|
+
onStartShouldSetPanResponder: () => true,
|
|
64
|
+
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
65
|
+
const distance = Math.sqrt(gestureState.dx * gestureState.dx + gestureState.dy * gestureState.dy);
|
|
66
|
+
return distance > 5;
|
|
67
|
+
},
|
|
68
|
+
onPanResponderGrant: () => {
|
|
69
|
+
// Set the initial position for this gesture
|
|
70
|
+
position.setValue({
|
|
71
|
+
x: lastPosition.current.right,
|
|
72
|
+
y: lastPosition.current.top
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
onPanResponderMove: (_, gestureState) => {
|
|
76
|
+
// Calculate new position based on gesture movement
|
|
77
|
+
const newTop = lastPosition.current.top + gestureState.dy;
|
|
78
|
+
const newRight = lastPosition.current.right - gestureState.dx;
|
|
79
|
+
|
|
80
|
+
// Update position during drag
|
|
81
|
+
position.setValue({
|
|
82
|
+
x: newRight,
|
|
83
|
+
y: newTop
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
87
|
+
// Check if this was actually a drag (significant movement)
|
|
88
|
+
const distance = Math.sqrt(gestureState.dx * gestureState.dx + gestureState.dy * gestureState.dy);
|
|
89
|
+
|
|
90
|
+
// If it was a tap (no significant movement), trigger onPress
|
|
91
|
+
if (distance <= 5) {
|
|
92
|
+
onPress();
|
|
93
|
+
} else {
|
|
94
|
+
// Calculate new position after dragging
|
|
95
|
+
const newTop = lastPosition.current.top + gestureState.dy;
|
|
96
|
+
const newRight = lastPosition.current.right - gestureState.dx;
|
|
97
|
+
|
|
98
|
+
// Clamp to screen bounds
|
|
99
|
+
const clampedTop = Math.max(screenBounds.minTop, Math.min(screenBounds.maxTop, newTop));
|
|
100
|
+
const clampedRight = Math.max(screenBounds.minRight, Math.min(screenBounds.maxRight, newRight));
|
|
101
|
+
|
|
102
|
+
// Update position
|
|
103
|
+
lastPosition.current = {
|
|
104
|
+
top: clampedTop,
|
|
105
|
+
right: clampedRight
|
|
106
|
+
};
|
|
107
|
+
position.setValue({
|
|
108
|
+
x: clampedRight,
|
|
109
|
+
y: clampedTop
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// Convert back to x,y coordinates for storage
|
|
113
|
+
const {
|
|
114
|
+
width
|
|
115
|
+
} = Dimensions.get('window');
|
|
116
|
+
const storagePosition = {
|
|
117
|
+
x: width - clampedRight - buttonSize,
|
|
118
|
+
y: clampedTop
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
// Persist position to AsyncStorage (debounced)
|
|
122
|
+
storageService.saveFloatingButtonPosition(storagePosition);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
})).current;
|
|
126
|
+
|
|
127
|
+
// Memoized button icon and color for performance
|
|
128
|
+
const content = useMemo(() => {
|
|
129
|
+
switch (sessionState) {
|
|
130
|
+
case SessionState.started:
|
|
131
|
+
return {
|
|
132
|
+
icon: /*#__PURE__*/_jsx(CapturingIcon, {
|
|
133
|
+
size: 28,
|
|
134
|
+
color: "white"
|
|
135
|
+
}),
|
|
136
|
+
color: '#FF4444'
|
|
137
|
+
};
|
|
138
|
+
case SessionState.paused:
|
|
139
|
+
return {
|
|
140
|
+
icon: /*#__PURE__*/_jsx(PausedIcon, {
|
|
141
|
+
size: 28,
|
|
142
|
+
color: "white"
|
|
143
|
+
}),
|
|
144
|
+
color: '#FFA500'
|
|
145
|
+
};
|
|
146
|
+
default:
|
|
147
|
+
return {
|
|
148
|
+
icon: /*#__PURE__*/_jsx(RecordIcon, {
|
|
149
|
+
size: 28,
|
|
150
|
+
color: "#718096"
|
|
151
|
+
}),
|
|
152
|
+
color: '#ffffff'
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}, [sessionState]);
|
|
156
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
157
|
+
style: [styles.draggableButton, {
|
|
158
|
+
top: position.y,
|
|
159
|
+
right: position.x
|
|
160
|
+
}],
|
|
161
|
+
...panResponder.panHandlers,
|
|
162
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
163
|
+
style: [styles.floatingButton, {
|
|
164
|
+
backgroundColor: content.color
|
|
165
|
+
}],
|
|
166
|
+
children: content.icon
|
|
167
|
+
})
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
const styles = StyleSheet.create({
|
|
171
|
+
draggableButton: {
|
|
172
|
+
position: 'absolute'
|
|
173
|
+
},
|
|
174
|
+
floatingButton: {
|
|
175
|
+
elevation: 8,
|
|
176
|
+
shadowRadius: 4,
|
|
177
|
+
width: buttonSize,
|
|
178
|
+
shadowColor: '#000',
|
|
179
|
+
height: buttonSize,
|
|
180
|
+
shadowOpacity: 0.25,
|
|
181
|
+
alignItems: 'center',
|
|
182
|
+
justifyContent: 'center',
|
|
183
|
+
borderRadius: buttonSize / 2,
|
|
184
|
+
shadowOffset: {
|
|
185
|
+
width: 0,
|
|
186
|
+
height: 2
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
export default FloatingButton;
|
|
191
|
+
//# sourceMappingURL=FloatingButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useRef","useEffect","useMemo","StyleSheet","Platform","Animated","PanResponder","View","Dimensions","SessionState","StorageService","RecordIcon","CapturingIcon","PausedIcon","jsx","_jsx","buttonSize","rightOffset","topOffset","OS","FloatingButton","sessionState","onPress","position","ValueXY","x","y","current","lastPosition","top","right","storageService","getInstance","screenBounds","width","height","get","minTop","maxTop","minRight","maxRight","savedPosition","getFloatingButtonPosition","setValue","panResponder","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","_","gestureState","distance","Math","sqrt","dx","dy","onPanResponderGrant","onPanResponderMove","newTop","newRight","onPanResponderRelease","clampedTop","max","min","clampedRight","storagePosition","saveFloatingButtonPosition","content","started","icon","size","color","paused","style","styles","draggableButton","panHandlers","children","floatingButton","backgroundColor","elevation","shadowRadius","shadowColor","shadowOpacity","alignItems","justifyContent","borderRadius","shadowOffset"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/FloatingButton.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACzD,SACEC,UAAU,EACVC,QAAQ,EACRC,QAAQ,EACRC,YAAY,EACZC,IAAI,EACJC,UAAU,QACL,cAAc;AACrB,SAASC,YAAY,Q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EACtEV,OAAO,CAACE;IAAI,CACT;EAAC,CACM,CAAC;AAEpB,CAAC;AAED,MAAMK,MAAM,GAAGtE,UAAU,CAAC0C,MAAM,CAAC;EAC/B6B,eAAe,EAAE;IACfnD,QAAQ,EAAE;EACZ,CAAC;EACDsD,cAAc,EAAE;IACdE,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE,CAAC;IACf9C,KAAK,EAAElB,UAAU;IACjBiE,WAAW,EAAE,MAAM;IACnB9C,MAAM,EAAEnB,UAAU;IAClBkE,aAAa,EAAE,IAAI;IACnBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,YAAY,EAAErE,UAAU,GAAG,CAAC;IAC5BsE,YAAY,EAAE;MAAEpD,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE;EACtC;AACF,CAAC,CAAC;AAEF,eAAef,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useMemo, useState } from 'react';
|
|
4
|
+
import { View, Text, Pressable, Switch } from 'react-native';
|
|
5
|
+
import { SessionType } from '@multiplayer-app/session-recorder-common';
|
|
6
|
+
import { sharedStyles } from "./styles.js";
|
|
7
|
+
import ModalHeader from "./ModalHeader.js";
|
|
8
|
+
import { CapturingIcon } from "./icons.js";
|
|
9
|
+
import { logger } from "../../utils/index.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
+
const InitialPopover = ({
|
|
12
|
+
isContinuous,
|
|
13
|
+
textOverrides,
|
|
14
|
+
showContinuousRecording,
|
|
15
|
+
onStartRecording,
|
|
16
|
+
onStopRecording,
|
|
17
|
+
onSaveContinuousSession,
|
|
18
|
+
isOnline,
|
|
19
|
+
children
|
|
20
|
+
}) => {
|
|
21
|
+
const [saving, setSaving] = useState(false);
|
|
22
|
+
const [loading, setLoading] = useState(false);
|
|
23
|
+
const [continuousRecording, setContinuousRecording] = useState(isContinuous);
|
|
24
|
+
const handleStartRecording = async () => {
|
|
25
|
+
try {
|
|
26
|
+
setLoading(true);
|
|
27
|
+
await onStartRecording(SessionType.PLAIN);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
logger.error('InitialPopover', 'Failed to start recording', error);
|
|
30
|
+
} finally {
|
|
31
|
+
setLoading(false);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const handleToggleContinuousRecording = async value => {
|
|
35
|
+
try {
|
|
36
|
+
setLoading(true);
|
|
37
|
+
setContinuousRecording(value);
|
|
38
|
+
if (value) {
|
|
39
|
+
await onStartRecording(SessionType.CONTINUOUS);
|
|
40
|
+
} else {
|
|
41
|
+
await onStopRecording();
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {
|
|
44
|
+
logger.error('InitialPopover', 'Failed to toggle continuous recording', error);
|
|
45
|
+
} finally {
|
|
46
|
+
setLoading(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const handleSaveContinuousSession = async () => {
|
|
50
|
+
try {
|
|
51
|
+
setSaving(true);
|
|
52
|
+
await onSaveContinuousSession();
|
|
53
|
+
} catch (error) {
|
|
54
|
+
logger.error('InitialPopover', 'Failed to save continuous session', error);
|
|
55
|
+
} finally {
|
|
56
|
+
setSaving(false);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const textContent = useMemo(() => {
|
|
60
|
+
return {
|
|
61
|
+
label: textOverrides.continuousRecordingLabel,
|
|
62
|
+
title: showContinuousRecording ? textOverrides.initialTitleWithContinuous : textOverrides.initialTitleWithoutContinuous,
|
|
63
|
+
description: showContinuousRecording ? textOverrides.initialDescriptionWithContinuous : textOverrides.initialDescriptionWithoutContinuous
|
|
64
|
+
};
|
|
65
|
+
}, [showContinuousRecording, textOverrides]);
|
|
66
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
67
|
+
style: sharedStyles.popoverContent,
|
|
68
|
+
children: [/*#__PURE__*/_jsx(ModalHeader, {}), /*#__PURE__*/_jsxs(View, {
|
|
69
|
+
style: sharedStyles.popoverBody,
|
|
70
|
+
children: [children, showContinuousRecording && /*#__PURE__*/_jsxs(View, {
|
|
71
|
+
style: sharedStyles.continuousRecordingSection,
|
|
72
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
73
|
+
style: sharedStyles.continuousRecordingLabel,
|
|
74
|
+
children: textContent.label
|
|
75
|
+
}), /*#__PURE__*/_jsx(Switch, {
|
|
76
|
+
disabled: loading || !isOnline,
|
|
77
|
+
value: continuousRecording,
|
|
78
|
+
ios_backgroundColor: "#e2e8f0",
|
|
79
|
+
onValueChange: handleToggleContinuousRecording,
|
|
80
|
+
trackColor: {
|
|
81
|
+
false: '#e2e8f0',
|
|
82
|
+
true: '#493bff'
|
|
83
|
+
},
|
|
84
|
+
thumbColor: '#ffffff'
|
|
85
|
+
})]
|
|
86
|
+
}), !continuousRecording ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
87
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
88
|
+
style: sharedStyles.title,
|
|
89
|
+
children: textContent.title
|
|
90
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
91
|
+
style: sharedStyles.description,
|
|
92
|
+
children: textContent.description
|
|
93
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
94
|
+
style: sharedStyles.popoverFooter,
|
|
95
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
96
|
+
disabled: loading || !isOnline,
|
|
97
|
+
onPress: handleStartRecording,
|
|
98
|
+
style: [sharedStyles.actionButton, sharedStyles.startButton],
|
|
99
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
100
|
+
style: sharedStyles.actionButtonText,
|
|
101
|
+
children: loading ? 'Starting to record...' : textOverrides.startRecordingButtonText
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
})]
|
|
105
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
106
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
107
|
+
style: sharedStyles.continuousOverlay,
|
|
108
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
109
|
+
style: sharedStyles.continuousOverlayHeader,
|
|
110
|
+
children: [/*#__PURE__*/_jsx(CapturingIcon, {
|
|
111
|
+
size: 20,
|
|
112
|
+
color: "red"
|
|
113
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
114
|
+
style: sharedStyles.continuousOverlayTitle,
|
|
115
|
+
children: textOverrides.continuousOverlayTitle
|
|
116
|
+
})]
|
|
117
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
118
|
+
style: sharedStyles.continuousOverlayDescription,
|
|
119
|
+
children: textOverrides.continuousOverlayDescription
|
|
120
|
+
})]
|
|
121
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
122
|
+
style: sharedStyles.popoverFooter,
|
|
123
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
124
|
+
disabled: saving || !isOnline,
|
|
125
|
+
onPress: handleSaveContinuousSession,
|
|
126
|
+
style: [sharedStyles.actionButton, sharedStyles.saveButton],
|
|
127
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
128
|
+
style: sharedStyles.actionButtonText,
|
|
129
|
+
children: saving ? 'Saving...' : textOverrides.saveLastSnapshotButtonText
|
|
130
|
+
})
|
|
131
|
+
})
|
|
132
|
+
})]
|
|
133
|
+
})]
|
|
134
|
+
})]
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
export default InitialPopover;
|
|
138
|
+
//# sourceMappingURL=InitialPopover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useMemo","useState","View","Text","Pressable","Switch","SessionType","sharedStyles","ModalHeader","CapturingIcon","logger","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","InitialPopover","isContinuous","textOverrides","showContinuousRecording","onStartRecording","onStopRecording","onSaveContinuousSession","isOnline","children","saving","setSaving","loading","setLoading","continuousRecording","setContinuousRecording","handleStartRecording","PLAIN","error","handleToggleContinuousRecording","value","CONTINUOUS","handleSaveContinuousSession","textContent","label","continuousRecordingLabel","title","initialTitleWithContinuous","initialTitleWithoutContinuous","description","initialDescriptionWithContinuous","initialDescriptionWithoutContinuous","style","popoverContent","popoverBody","continuousRecordingSection","disabled","ios_backgroundColor","onValueChange","trackColor","false","true","thumbColor","popoverFooter","onPress","actionButton","startButton","actionButtonText","startRecordingButtonText","continuousOverlay","continuousOverlayHeader","size","color","continuousOverlayTitle","continuousOverlayDescription","saveButton","saveLastSnapshotButtonText"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/InitialPopover.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAChD,SAASC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAEC,MAAM,QAAQ,cAAc;AAC5D,SAASC,WAAW,QAAQ,0CAA0C;AAEtE,SAASC,YAAY,QAAQ,aAAU;AACvC,OAAOC,WAAW,MAAM,kBAAe;AACvC,SAASC,aAAa,QAAQ,YAAS;AACvC,SAASC,MAAM,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAcrC,MAAMC,cAA6C,GAAGA,CAAC;EACrDC,YAAY;EACZC,aAAa;EACbC,uBAAuB;EACvBC,gBAAgB;EAChBC,eAAe;EACfC,uBAAuB;EACvBC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG1B,QAAQ,CAAC,KAAK,CAAC;EAC3C,MAAM,CAAC2B,OAAO,EAAEC,UAAU,CAAC,GAAG5B,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAM,CAAC6B,mBAAmB,EAAEC,sBAAsB,CAAC,GAAG9B,QAAQ,CAACiB,YAAY,CAAC;EAE5E,MAAMc,oBAAoB,GAAG,MAAAA,CAAA,KAA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AAEtD,YAAY,CAACgE,UAAU,CAAE;YAAA9C,QAAA,eAE5Db,IAAA,CAACT,IAAI;cAAC6C,KAAK,EAAEzC,YAAY,CAACwD,gBAAiB;cAAAtC,QAAA,EACxCC,MAAM,GACH,WAAW,GACXP,aAAa,CAACqD;YAA0B,CACxC;UAAC,CACE;QAAC,CACR,CAAC;MAAA,CACP,CACH;IAAA,CACG,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAED,eAAevD,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { Animated, Pressable, StyleSheet, Dimensions, Modal, PanResponder, Platform } from 'react-native';
|
|
5
|
+
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
height: SCREEN_HEIGHT
|
|
9
|
+
} = Dimensions.get('window');
|
|
10
|
+
const MODAL_HEIGHT = SCREEN_HEIGHT * 0.7;
|
|
11
|
+
const ModalContainer = ({
|
|
12
|
+
isVisible,
|
|
13
|
+
onClose,
|
|
14
|
+
children
|
|
15
|
+
}) => {
|
|
16
|
+
const fadeAnim = useRef(new Animated.Value(0)).current;
|
|
17
|
+
const translateY = useRef(new Animated.Value(0)).current;
|
|
18
|
+
const [visible, setVisible] = useState(isVisible);
|
|
19
|
+
const SWIPE_THRESHOLD = 100; // Distance to trigger close
|
|
20
|
+
|
|
21
|
+
const animateClose = () => {
|
|
22
|
+
Animated.parallel([Animated.timing(fadeAnim, {
|
|
23
|
+
toValue: 0,
|
|
24
|
+
duration: 250,
|
|
25
|
+
useNativeDriver: true
|
|
26
|
+
}), Animated.timing(translateY, {
|
|
27
|
+
toValue: MODAL_HEIGHT,
|
|
28
|
+
duration: 250,
|
|
29
|
+
useNativeDriver: true
|
|
30
|
+
})]).start(() => {
|
|
31
|
+
setVisible(false);
|
|
32
|
+
onClose();
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (isVisible) {
|
|
37
|
+
setVisible(true);
|
|
38
|
+
// Start from bottom and animate to position
|
|
39
|
+
translateY.setValue(MODAL_HEIGHT);
|
|
40
|
+
Animated.parallel([Animated.timing(fadeAnim, {
|
|
41
|
+
toValue: 1,
|
|
42
|
+
duration: 300,
|
|
43
|
+
useNativeDriver: true
|
|
44
|
+
}), Animated.timing(translateY, {
|
|
45
|
+
toValue: 0,
|
|
46
|
+
duration: 300,
|
|
47
|
+
useNativeDriver: true
|
|
48
|
+
})]).start();
|
|
49
|
+
} else if (visible) {
|
|
50
|
+
// If external isVisible turned false, animate close then hide
|
|
51
|
+
Animated.parallel([Animated.timing(fadeAnim, {
|
|
52
|
+
toValue: 0,
|
|
53
|
+
duration: 250,
|
|
54
|
+
useNativeDriver: true
|
|
55
|
+
}), Animated.timing(translateY, {
|
|
56
|
+
toValue: MODAL_HEIGHT,
|
|
57
|
+
duration: 250,
|
|
58
|
+
useNativeDriver: true
|
|
59
|
+
})]).start(() => {
|
|
60
|
+
setVisible(false);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, [isVisible, fadeAnim, translateY, visible]);
|
|
64
|
+
|
|
65
|
+
// PanResponder for swipe-to-dismiss functionality
|
|
66
|
+
const panResponder = useRef(PanResponder.create({
|
|
67
|
+
onStartShouldSetPanResponder: () => true,
|
|
68
|
+
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
69
|
+
// Only respond to downward swipes
|
|
70
|
+
return gestureState.dy > 10;
|
|
71
|
+
},
|
|
72
|
+
onPanResponderGrant: () => {
|
|
73
|
+
// Reset any ongoing animations
|
|
74
|
+
translateY.stopAnimation();
|
|
75
|
+
},
|
|
76
|
+
onPanResponderMove: (_, gestureState) => {
|
|
77
|
+
// Only allow downward movement
|
|
78
|
+
if (gestureState.dy > 0) {
|
|
79
|
+
translateY.setValue(gestureState.dy);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
onPanResponderRelease: (_, gestureState) => {
|
|
83
|
+
const {
|
|
84
|
+
dy,
|
|
85
|
+
vy
|
|
86
|
+
} = gestureState;
|
|
87
|
+
|
|
88
|
+
// If swiped down with sufficient distance or velocity, close modal
|
|
89
|
+
if (dy > SWIPE_THRESHOLD || vy > 500) {
|
|
90
|
+
animateClose();
|
|
91
|
+
} else {
|
|
92
|
+
// Snap back to original position
|
|
93
|
+
Animated.spring(translateY, {
|
|
94
|
+
toValue: 0,
|
|
95
|
+
useNativeDriver: true,
|
|
96
|
+
tension: 100,
|
|
97
|
+
friction: 8
|
|
98
|
+
}).start();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
})).current;
|
|
102
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
103
|
+
visible: visible,
|
|
104
|
+
transparent: true,
|
|
105
|
+
animationType: "none",
|
|
106
|
+
onRequestClose: onClose,
|
|
107
|
+
children: /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
108
|
+
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
109
|
+
style: {
|
|
110
|
+
...styles.backdrop,
|
|
111
|
+
opacity: fadeAnim
|
|
112
|
+
},
|
|
113
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
114
|
+
style: styles.backdropPressable,
|
|
115
|
+
onPress: animateClose
|
|
116
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
117
|
+
style: [styles.modal, {
|
|
118
|
+
transform: [{
|
|
119
|
+
translateY
|
|
120
|
+
}]
|
|
121
|
+
}],
|
|
122
|
+
...panResponder.panHandlers,
|
|
123
|
+
children: /*#__PURE__*/_jsx(SafeAreaView, {
|
|
124
|
+
style: styles.safeArea,
|
|
125
|
+
edges: ['bottom'],
|
|
126
|
+
children: children
|
|
127
|
+
})
|
|
128
|
+
})]
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const styles = StyleSheet.create({
|
|
134
|
+
backdrop: {
|
|
135
|
+
position: 'absolute',
|
|
136
|
+
top: 0,
|
|
137
|
+
left: 0,
|
|
138
|
+
right: 0,
|
|
139
|
+
bottom: 0,
|
|
140
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
141
|
+
},
|
|
142
|
+
backdropPressable: {
|
|
143
|
+
flex: 1
|
|
144
|
+
},
|
|
145
|
+
safeArea: {
|
|
146
|
+
flex: 1,
|
|
147
|
+
backgroundColor: 'white',
|
|
148
|
+
borderTopLeftRadius: 20,
|
|
149
|
+
borderTopRightRadius: 20
|
|
150
|
+
},
|
|
151
|
+
modal: {
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
bottom: 0,
|
|
154
|
+
left: 0,
|
|
155
|
+
right: 0,
|
|
156
|
+
maxHeight: MODAL_HEIGHT,
|
|
157
|
+
backgroundColor: 'white',
|
|
158
|
+
borderTopLeftRadius: 20,
|
|
159
|
+
borderTopRightRadius: 20,
|
|
160
|
+
...Platform.select({
|
|
161
|
+
ios: {
|
|
162
|
+
shadowColor: '#000',
|
|
163
|
+
shadowOffset: {
|
|
164
|
+
width: 0,
|
|
165
|
+
height: -2
|
|
166
|
+
},
|
|
167
|
+
shadowOpacity: 0.1,
|
|
168
|
+
shadowRadius: 8
|
|
169
|
+
},
|
|
170
|
+
android: {
|
|
171
|
+
elevation: 8
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
export default ModalContainer;
|
|
177
|
+
//# sourceMappingURL=ModalContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Animated","Pressable","StyleSheet","Dimensions","Modal","PanResponder","Platform","SafeAreaProvider","SafeAreaView","jsx","_jsx","jsxs","_jsxs","height","SCREEN_HEIGHT","get","MODAL_HEIGHT","ModalContainer","isVisible","onClose","children","fadeAnim","Value","current","translateY","visible","setVisible","SWIPE_THRESHOLD","animateClose","parallel","timing","toValue","duration","useNativeDriver","start","setValue","panResponder","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","_","gestureState","dy","onPanResponderGrant","stopAnimation","onPanResponderMove","onPanResponderRelease","vy","spring","tension","friction","transparent","animationType","onRequestClose","View","style","styles","backdrop","opacity","backdropPressable","onPress","modal","transform","panHandlers","safeArea","edges","position","top","left","right","bottom","backgroundColor","flex","borderTopLeftRadius","borderTopRightRadius","maxHeight","select","ios","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","android","elevation"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/ModalContainer.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC1D,SACEC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,KAAK,EACLC,YAAY,EACZC,QAAQ,QACH,cAAc;AACrB,SAASC,gBAAgB,EAAEC,YAAY,QAAQ,gCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhF,MAAM;EAAEC,MAAM,EAAEC;AAAc,CAAC,GAAGX,UAAU,CAACY,GAAG,CAAC,QAAQ,CAAC;AAC1D,MAAMC,YAAY,GAAGF,aAAa,GAAG,GAAG;AAQxC,MAAMG,cAA6C,GAAGA,CAAC;EACrDC,SAAS;EACTC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAMC,QAAQ,GAAGvB,MAAM,CAAC,IAAIE,QAAQ,CAACsB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACtD,MAAMC,UAAU,GAAG1B,MAAM,CAAC,IAAIE,QAAQ,CAACsB,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACxD,MAAM,CAACE,OAAO,EAAEC,UAAU,CAAC,GAAG3B,QAAQ,CAAUmB,SAAS,CAAC;E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AAoB,EAAE;EACxB,CAAC;EACDb,KAAK,EAAE;IACLK,QAAQ,EAAE,UAAU;IACpBI,MAAM,EAAE,CAAC;IACTF,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRM,SAAS,EAAE3D,YAAY;IACvBuD,eAAe,EAAE,OAAO;IACxBE,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxB,GAAGpE,QAAQ,CAACsE,MAAM,CAAC;MACjBC,GAAG,EAAE;QACHC,WAAW,EAAE,MAAM;QACnBC,YAAY,EAAE;UAAEC,KAAK,EAAE,CAAC;UAAEnE,MAAM,EAAE,CAAC;QAAE,CAAC;QACtCoE,aAAa,EAAE,GAAG;QAClBC,YAAY,EAAE;MAChB,CAAC;MACDC,OAAO,EAAE;QACPC,SAAS,EAAE;MACb;IACF,CAAC;EACH;AACF,CAAC,CAAC;AAEF,eAAenE,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { View, Pressable, Linking } from 'react-native';
|
|
5
|
+
import { sharedStyles } from "./styles.js";
|
|
6
|
+
import { LogoIcon } from "./icons.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const ModalHeader = ({
|
|
9
|
+
children
|
|
10
|
+
}) => {
|
|
11
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
12
|
+
style: sharedStyles.popoverHeader,
|
|
13
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
14
|
+
style: sharedStyles.modalHandle
|
|
15
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
16
|
+
style: sharedStyles.popoverHeaderContent,
|
|
17
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
18
|
+
onPress: () => Linking.openURL('https://www.multiplayer.app'),
|
|
19
|
+
children: /*#__PURE__*/_jsx(LogoIcon, {
|
|
20
|
+
size: 42
|
|
21
|
+
})
|
|
22
|
+
}), children]
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
export default ModalHeader;
|
|
27
|
+
//# sourceMappingURL=ModalHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","Pressable","Linking","sharedStyles","LogoIcon","jsx","_jsx","jsxs","_jsxs","ModalHeader","children","style","popoverHeader","modalHandle","popoverHeaderContent","onPress","openURL","size"],"sourceRoot":"../../../../src","sources":["components/SessionRecorderWidget/ModalHeader.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,SAAS,EAAEC,OAAO,QAAQ,cAAc;AACvD,SAASC,YAAY,QAAQ,aAAU;AACvC,SAASC,QAAQ,QAAQ,YAAS;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAMlC,MAAMC,WAAuC,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAChE,oBACEF,KAAA,CAACR,IAAI;IAACW,KAAK,EAAER,YAAY,CAACS,aAAc;IAAAF,QAAA,gBACtCJ,IAAA,CAACN,IAAI;MAACW,KAAK,EAAER,YAAY,CAACU;IAAY,CAAE,CAAC,eACzCL,KAAA,CAACR,IAAI;MAACW,KAAK,EAAER,YAAY,CAACW,oBAAqB;MAAAJ,QAAA,gBAC7CJ,IAAA,CAACL,SAAS;QAACc,OAAO,EAAEA,CAAA,KAAMb,OAAO,CAACc,OAAO,CAAC,6BAA6B,CAAE;QAAAN,QAAA,eACvEJ,IAAA,CAACF,QAAQ;UAACa,IAAI,EAAE;QAAG,CAAE;MAAC,CACb,CAAC,EACXP,QAAQ;IAAA,CACL,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAED,eAAeD,WAAW","ignoreList":[]}
|