@multiplayer-app/session-recorder-react-native 1.0.0 → 1.0.1-beta.10
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 +35 -14
- package/android/build.gradle +65 -22
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeConfig.kt +52 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeModule.kt +861 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativePackage.kt +33 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeSpec.kt +79 -0
- package/android/src/main/java/com/sessionrecordernative/model/TargetInfo.kt +9 -0
- package/android/src/main/java/com/sessionrecordernative/util/ViewUtils.kt +72 -0
- package/ios/GestureTargetFinder.swift +50 -0
- package/ios/SessionRecorderNative-Bridging-Header.h +2 -0
- package/ios/{GestureRecorderNative.m → SessionRecorderNative.mm} +17 -6
- package/ios/SessionRecorderNative.swift +256 -4
- package/lib/module/SessionRecorderNativeSpec.js +5 -0
- package/lib/module/SessionRecorderNativeSpec.js.map +1 -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 +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/SessionRecorderNative.js +79 -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 +185 -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/{dist/native/SessionRecorderNative.d.ts → lib/typescript/src/SessionRecorderNativeSpec.d.ts} +23 -15
- package/lib/typescript/src/SessionRecorderNativeSpec.d.ts.map +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/lib/typescript/src/components/index.d.ts +3 -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 +4 -3
- 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 +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/SessionRecorderNative.d.ts +27 -0
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +2 -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 +7 -6
- 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/lib/typescript/src/utils/index.d.ts +8 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/logger.d.ts +2 -1
- 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 +157 -39
- package/react-native.config.js +8 -6
- package/src/SessionRecorderNativeSpec.ts +52 -0
- package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +20 -0
- package/src/components/ScreenRecorderView/index.ts +1 -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 +26 -0
- package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +150 -0
- package/src/components/SessionRecorderWidget/icons.tsx +80 -0
- package/src/components/SessionRecorderWidget/index.ts +3 -0
- package/src/components/SessionRecorderWidget/styles.ts +168 -0
- package/src/config/constants.ts +67 -0
- package/src/config/defaults.ts +105 -0
- package/src/config/index.ts +6 -0
- package/src/config/masking.ts +60 -0
- package/src/config/session-recorder.ts +87 -0
- package/src/config/validators.ts +54 -0
- package/src/config/widget.ts +47 -0
- package/src/context/SessionRecorderContext.tsx +138 -0
- package/src/context/SessionRecorderStore.ts +22 -0
- package/src/context/useSessionRecorderStore.ts +34 -0
- package/src/context/useStoreSelector.ts +36 -0
- package/src/index.ts +13 -0
- package/src/native/SessionRecorderNative.ts +120 -0
- package/src/native/index.ts +5 -0
- package/src/otel/helpers.ts +290 -0
- package/src/otel/index.ts +132 -0
- package/src/otel/instrumentations/index.ts +118 -0
- package/src/patch/xhr.ts +148 -0
- package/src/recorder/eventExporter.ts +150 -0
- package/src/recorder/gestureRecorder.ts +828 -0
- package/src/recorder/index.ts +203 -0
- package/src/recorder/navigationTracker.ts +268 -0
- package/src/recorder/screenRecorder.ts +600 -0
- package/src/services/api.service.ts +216 -0
- package/src/services/network.service.ts +191 -0
- package/src/services/screenMaskingService.ts +153 -0
- package/src/services/storage.service.ts +248 -0
- package/src/session-recorder.ts +647 -0
- package/src/types/configs.ts +118 -0
- package/src/types/expo-constants.d.ts +7 -0
- package/src/types/index.ts +27 -0
- package/src/types/session-recorder.ts +381 -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 +18 -0
- package/src/utils/createStore.ts +32 -0
- package/{dist/utils/index.d.ts → src/utils/index.ts} +1 -0
- package/src/utils/logger.ts +245 -0
- package/src/utils/platform.ts +401 -0
- package/src/utils/request-utils.ts +61 -0
- package/src/utils/rrweb-events.ts +329 -0
- package/src/utils/session.ts +22 -0
- package/src/utils/shallowEqual.ts +20 -0
- package/src/utils/time.ts +20 -0
- package/src/utils/type-utils.ts +75 -0
- package/src/version.ts +1 -0
- 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.d.ts +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.d.ts +0 -2
- 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/SessionRecorderNative.js +0 -1
- package/dist/native/SessionRecorderNative.js.map +0 -1
- package/dist/native/index.d.ts +0 -2
- 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.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/ios/GestureRecorderNative.swift +0 -316
- package/ios/SessionRecorderNative.m +0 -17
- package/ios/SessionRecorderNative.podspec +0 -26
- /package/{dist/components/index.d.ts → src/components/index.ts} +0 -0
- /package/{dist/patch/index.d.ts → src/patch/index.ts} +0 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { Dimensions } from 'react-native';
|
|
2
|
+
import {
|
|
3
|
+
EventType,
|
|
4
|
+
type eventWithTime,
|
|
5
|
+
NodeType,
|
|
6
|
+
type serializedNodeWithId,
|
|
7
|
+
IncrementalSource,
|
|
8
|
+
type mutationData,
|
|
9
|
+
} from '@rrweb/types';
|
|
10
|
+
import { getAppMetadata } from './platform';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Creates a meta event to mark the start of recording
|
|
14
|
+
* @param sessionId - The session ID
|
|
15
|
+
* @param sessionType - The type of session (PLAIN or CONTINUOUS)
|
|
16
|
+
* @param additionalData - Additional data to include in the meta event
|
|
17
|
+
* @returns MetaEvent object
|
|
18
|
+
*/
|
|
19
|
+
export function createRecordingMetaEvent(): eventWithTime {
|
|
20
|
+
const screenDimensions = Dimensions.get('window');
|
|
21
|
+
const metadata = getAppMetadata();
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
type: EventType.Meta,
|
|
25
|
+
data: {
|
|
26
|
+
href:
|
|
27
|
+
metadata.bundleId || metadata.name || 'https://native.multiplayer.app',
|
|
28
|
+
width: screenDimensions.width,
|
|
29
|
+
height: screenDimensions.height,
|
|
30
|
+
},
|
|
31
|
+
timestamp: Date.now(),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create a full snapshot event with the given base64 image
|
|
37
|
+
* @param base64Image - Base64 encoded image data
|
|
38
|
+
* @param width - Screen width
|
|
39
|
+
* @param height - Screen height
|
|
40
|
+
* @param captureFormat - Image format (png, jpg, etc.)
|
|
41
|
+
* @param nodeIdCounter - Starting node ID counter (will be modified)
|
|
42
|
+
* @param timestamp - Optional timestamp to use for the event
|
|
43
|
+
* @returns Full snapshot event
|
|
44
|
+
*/
|
|
45
|
+
export function createFullSnapshotEvent(
|
|
46
|
+
base64Image: string,
|
|
47
|
+
width: number,
|
|
48
|
+
height: number,
|
|
49
|
+
captureFormat: string = 'jpg',
|
|
50
|
+
nodeIdCounter: { current: number },
|
|
51
|
+
timestamp?: number
|
|
52
|
+
): eventWithTime {
|
|
53
|
+
// Create a virtual DOM node representing the screen as an image
|
|
54
|
+
const imageNode: serializedNodeWithId = {
|
|
55
|
+
type: NodeType.Element,
|
|
56
|
+
id: 0,
|
|
57
|
+
tagName: 'img',
|
|
58
|
+
attributes: {
|
|
59
|
+
src: `data:image/${captureFormat};base64,${base64Image}`,
|
|
60
|
+
width: width.toString(),
|
|
61
|
+
height: height.toString(),
|
|
62
|
+
style: `width: ${width}px; height: ${height}px;`,
|
|
63
|
+
},
|
|
64
|
+
childNodes: [],
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Create the root container
|
|
68
|
+
const rootNode: serializedNodeWithId = {
|
|
69
|
+
type: NodeType.Element,
|
|
70
|
+
id: nodeIdCounter.current++,
|
|
71
|
+
tagName: 'div',
|
|
72
|
+
attributes: {
|
|
73
|
+
style: `width: ${width}px; height: ${height}px; position: relative;`,
|
|
74
|
+
},
|
|
75
|
+
childNodes: [imageNode],
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const domNode: serializedNodeWithId = {
|
|
79
|
+
type: NodeType.Document,
|
|
80
|
+
childNodes: [
|
|
81
|
+
{
|
|
82
|
+
type: NodeType.DocumentType,
|
|
83
|
+
name: 'html',
|
|
84
|
+
publicId: '',
|
|
85
|
+
systemId: '',
|
|
86
|
+
id: nodeIdCounter.current++,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: NodeType.Element,
|
|
90
|
+
tagName: 'html',
|
|
91
|
+
attributes: {},
|
|
92
|
+
childNodes: [
|
|
93
|
+
{
|
|
94
|
+
type: NodeType.Element,
|
|
95
|
+
tagName: 'head',
|
|
96
|
+
attributes: {},
|
|
97
|
+
childNodes: [
|
|
98
|
+
{
|
|
99
|
+
type: NodeType.Element,
|
|
100
|
+
tagName: 'meta',
|
|
101
|
+
attributes: { charset: 'utf-8' },
|
|
102
|
+
childNodes: [],
|
|
103
|
+
id: nodeIdCounter.current++,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
type: NodeType.Element,
|
|
107
|
+
tagName: 'meta',
|
|
108
|
+
attributes: {
|
|
109
|
+
name: 'viewport',
|
|
110
|
+
content:
|
|
111
|
+
'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no',
|
|
112
|
+
},
|
|
113
|
+
childNodes: [],
|
|
114
|
+
id: nodeIdCounter.current++,
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
id: nodeIdCounter.current++,
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: NodeType.Element,
|
|
121
|
+
tagName: 'body',
|
|
122
|
+
attributes: {
|
|
123
|
+
style: 'margin: 0; padding: 0; width: 100%; height: 100%;',
|
|
124
|
+
},
|
|
125
|
+
childNodes: [rootNode],
|
|
126
|
+
id: nodeIdCounter.current++,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
id: nodeIdCounter.current++,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
id: nodeIdCounter.current++,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
type: EventType.FullSnapshot,
|
|
137
|
+
data: {
|
|
138
|
+
node: domNode,
|
|
139
|
+
initialOffset: { left: 0, top: 0 },
|
|
140
|
+
},
|
|
141
|
+
timestamp: timestamp || Date.now(),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Create an incremental snapshot event with mutation data to update image src
|
|
147
|
+
* @param base64Image - New base64 encoded image data
|
|
148
|
+
* @param captureFormat - Image format (png, jpg, etc.)
|
|
149
|
+
* @param timestamp - Optional timestamp to use for the event
|
|
150
|
+
* @returns Incremental snapshot event with mutation data
|
|
151
|
+
*/
|
|
152
|
+
export function createIncrementalSnapshotWithImageUpdate(
|
|
153
|
+
base64Image: string,
|
|
154
|
+
captureFormat: string = 'jpg',
|
|
155
|
+
timestamp?: number
|
|
156
|
+
): eventWithTime {
|
|
157
|
+
const mutationData: mutationData = {
|
|
158
|
+
source: IncrementalSource.Mutation,
|
|
159
|
+
texts: [],
|
|
160
|
+
attributes: [
|
|
161
|
+
{
|
|
162
|
+
id: 0,
|
|
163
|
+
attributes: {
|
|
164
|
+
src: `data:image/${captureFormat};base64,${base64Image}`,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
removes: [],
|
|
169
|
+
adds: [],
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
return {
|
|
173
|
+
type: EventType.IncrementalSnapshot,
|
|
174
|
+
data: mutationData,
|
|
175
|
+
timestamp: timestamp || Date.now(),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Create a simple image node for React Native screen capture
|
|
181
|
+
* @param base64Image - Base64 encoded image data
|
|
182
|
+
* @param width - Image width
|
|
183
|
+
* @param height - Image height
|
|
184
|
+
* @param captureFormat - Image format (png, jpg, etc.)
|
|
185
|
+
* @param nodeId - Node ID for the image
|
|
186
|
+
* @returns Serialized node with ID
|
|
187
|
+
*/
|
|
188
|
+
export function createImageNode(
|
|
189
|
+
base64Image: string,
|
|
190
|
+
width: number,
|
|
191
|
+
height: number,
|
|
192
|
+
captureFormat: string = 'jpg',
|
|
193
|
+
nodeId: number
|
|
194
|
+
): serializedNodeWithId {
|
|
195
|
+
return {
|
|
196
|
+
type: NodeType.Element,
|
|
197
|
+
id: nodeId,
|
|
198
|
+
tagName: 'img',
|
|
199
|
+
attributes: {
|
|
200
|
+
src: `data:image/${captureFormat};base64,${base64Image}`,
|
|
201
|
+
width: width.toString(),
|
|
202
|
+
height: height.toString(),
|
|
203
|
+
style: `width: ${width}px; height: ${height}px;`,
|
|
204
|
+
},
|
|
205
|
+
childNodes: [],
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Create a document node for React Native screen capture
|
|
211
|
+
* @param imageNode - The image node to include
|
|
212
|
+
* @param width - Screen width
|
|
213
|
+
* @param height - Screen height
|
|
214
|
+
* @param nodeIdCounter - Node ID counter (will be modified)
|
|
215
|
+
* @returns Document node
|
|
216
|
+
*/
|
|
217
|
+
export function createDocumentNode(
|
|
218
|
+
imageNode: serializedNodeWithId,
|
|
219
|
+
width: number,
|
|
220
|
+
height: number,
|
|
221
|
+
nodeIdCounter: { current: number }
|
|
222
|
+
): serializedNodeWithId {
|
|
223
|
+
// Create the root container
|
|
224
|
+
const rootNode: serializedNodeWithId = {
|
|
225
|
+
type: NodeType.Element,
|
|
226
|
+
id: nodeIdCounter.current++,
|
|
227
|
+
tagName: 'div',
|
|
228
|
+
attributes: {
|
|
229
|
+
style: `width: ${width}px; height: ${height}px; position: relative;`,
|
|
230
|
+
},
|
|
231
|
+
childNodes: [imageNode],
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
type: NodeType.Document,
|
|
236
|
+
childNodes: [
|
|
237
|
+
{
|
|
238
|
+
type: NodeType.DocumentType,
|
|
239
|
+
name: 'html',
|
|
240
|
+
publicId: '',
|
|
241
|
+
systemId: '',
|
|
242
|
+
id: nodeIdCounter.current++,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
type: NodeType.Element,
|
|
246
|
+
tagName: 'html',
|
|
247
|
+
attributes: {},
|
|
248
|
+
childNodes: [
|
|
249
|
+
{
|
|
250
|
+
type: NodeType.Element,
|
|
251
|
+
tagName: 'head',
|
|
252
|
+
attributes: {},
|
|
253
|
+
childNodes: [
|
|
254
|
+
{
|
|
255
|
+
type: NodeType.Element,
|
|
256
|
+
tagName: 'meta',
|
|
257
|
+
attributes: { charset: 'utf-8' },
|
|
258
|
+
childNodes: [],
|
|
259
|
+
id: nodeIdCounter.current++,
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
type: NodeType.Element,
|
|
263
|
+
tagName: 'meta',
|
|
264
|
+
attributes: {
|
|
265
|
+
name: 'viewport',
|
|
266
|
+
content:
|
|
267
|
+
'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no',
|
|
268
|
+
},
|
|
269
|
+
childNodes: [],
|
|
270
|
+
id: nodeIdCounter.current++,
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
id: nodeIdCounter.current++,
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
type: NodeType.Element,
|
|
277
|
+
tagName: 'body',
|
|
278
|
+
attributes: {},
|
|
279
|
+
childNodes: [rootNode],
|
|
280
|
+
id: nodeIdCounter.current++,
|
|
281
|
+
},
|
|
282
|
+
],
|
|
283
|
+
id: nodeIdCounter.current++,
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
id: nodeIdCounter.current++,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Generate a simple hash for screen comparison
|
|
292
|
+
* This is a lightweight hash that focuses on the beginning and end of the base64 string
|
|
293
|
+
* to detect changes without doing a full comparison
|
|
294
|
+
* @param base64Image - Base64 encoded image
|
|
295
|
+
* @param sampleSize - Number of characters to sample from each part
|
|
296
|
+
* @returns Hash string for comparison
|
|
297
|
+
*/
|
|
298
|
+
export function generateScreenHash(
|
|
299
|
+
base64Image: string,
|
|
300
|
+
sampleSize: number = 100
|
|
301
|
+
): string {
|
|
302
|
+
// Use a simple hash that samples the beginning, middle, and end of the base64 string
|
|
303
|
+
// This is much faster than comparing the entire string
|
|
304
|
+
const start = base64Image.substring(0, sampleSize);
|
|
305
|
+
const middle = base64Image.substring(
|
|
306
|
+
Math.floor(base64Image.length / 2) - sampleSize / 2,
|
|
307
|
+
Math.floor(base64Image.length / 2) + sampleSize / 2
|
|
308
|
+
);
|
|
309
|
+
const end = base64Image.substring(base64Image.length - sampleSize);
|
|
310
|
+
|
|
311
|
+
// Combine samples and create a simple hash
|
|
312
|
+
const combined = start + middle + end;
|
|
313
|
+
return simpleHash(combined);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Simple hash function for string comparison
|
|
318
|
+
* @param str - String to hash
|
|
319
|
+
* @returns Hash value as string
|
|
320
|
+
*/
|
|
321
|
+
export function simpleHash(str: string): string {
|
|
322
|
+
let hash = 0;
|
|
323
|
+
for (let i = 0; i < str.length; i++) {
|
|
324
|
+
const char = str.charCodeAt(i);
|
|
325
|
+
hash = (hash << 5) - hash + char;
|
|
326
|
+
hash = hash & hash; // Convert to 32-bit integer
|
|
327
|
+
}
|
|
328
|
+
return Math.abs(hash).toString(36);
|
|
329
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SessionType } from '@multiplayer-app/session-recorder-common';
|
|
2
|
+
import { DEBUG_SESSION_MAX_DURATION_SECONDS } from '../config/constants';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Session-related utility functions for React Native
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const isSessionActive = (
|
|
9
|
+
session: any,
|
|
10
|
+
sessionType: SessionType | null
|
|
11
|
+
): boolean => {
|
|
12
|
+
if (!session) return false;
|
|
13
|
+
if (sessionType === SessionType.CONTINUOUS) return true;
|
|
14
|
+
const startedAt = new Date(session.startedAt || session.createdAt);
|
|
15
|
+
const now = new Date();
|
|
16
|
+
const diff = now.getTime() - startedAt.getTime();
|
|
17
|
+
return diff < DEBUG_SESSION_MAX_DURATION_SECONDS * 1000;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const isConsoleEvent = (event: any): boolean => {
|
|
21
|
+
return event.type === 'Plugin' && event.data?.plugin === 'rrweb/console@1';
|
|
22
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function shallowEqual<T extends Record<string, any>>(
|
|
2
|
+
a: T,
|
|
3
|
+
b: T
|
|
4
|
+
): boolean {
|
|
5
|
+
if (Object.is(a, b)) return true;
|
|
6
|
+
if (!a || !b) return false;
|
|
7
|
+
const aKeys = Object.keys(a);
|
|
8
|
+
const bKeys = Object.keys(b);
|
|
9
|
+
if (aKeys.length !== bKeys.length) return false;
|
|
10
|
+
for (let i = 0; i < aKeys.length; i++) {
|
|
11
|
+
const key = aKeys[i];
|
|
12
|
+
if (
|
|
13
|
+
!Object.prototype.hasOwnProperty.call(b, key!) ||
|
|
14
|
+
!Object.is(a[key!], b[key!])
|
|
15
|
+
) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time and date utility functions for React Native
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const getFormattedDate = (
|
|
6
|
+
date: number | Date,
|
|
7
|
+
options?: any
|
|
8
|
+
): string => {
|
|
9
|
+
return new Date(date).toLocaleDateString(
|
|
10
|
+
'en-US',
|
|
11
|
+
options || {
|
|
12
|
+
month: 'short',
|
|
13
|
+
year: 'numeric',
|
|
14
|
+
day: 'numeric',
|
|
15
|
+
hour: 'numeric',
|
|
16
|
+
minute: '2-digit',
|
|
17
|
+
second: '2-digit',
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const nativeIsArray = Array.isArray;
|
|
2
|
+
const ObjProto = Object.prototype;
|
|
3
|
+
export const hasOwnProperty = ObjProto.hasOwnProperty;
|
|
4
|
+
const toString = ObjProto.toString;
|
|
5
|
+
|
|
6
|
+
export const isArray =
|
|
7
|
+
nativeIsArray ||
|
|
8
|
+
function (obj: any): obj is any[] {
|
|
9
|
+
return toString.call(obj) === '[object Array]';
|
|
10
|
+
};
|
|
11
|
+
export const isUint8Array = function (x: unknown): x is Uint8Array {
|
|
12
|
+
return toString.call(x) === '[object Uint8Array]';
|
|
13
|
+
};
|
|
14
|
+
// from a comment on http://dbj.org/dbj/?p=286
|
|
15
|
+
// fails on only one very rare and deliberate custom object:
|
|
16
|
+
// let bomb = { toString : undefined, valueOf: function(o) { return "function BOMBA!"; }};
|
|
17
|
+
export const isFunction = function (f: any): f is (...args: any[]) => any {
|
|
18
|
+
return typeof f === 'function';
|
|
19
|
+
};
|
|
20
|
+
// Underscore Addons
|
|
21
|
+
export const isObject = function (x: unknown): x is Record<string, any> {
|
|
22
|
+
return x === Object(x) && !isArray(x);
|
|
23
|
+
};
|
|
24
|
+
export const isEmptyObject = function (x: unknown): x is Record<string, any> {
|
|
25
|
+
if (isObject(x)) {
|
|
26
|
+
for (const key in x) {
|
|
27
|
+
if (hasOwnProperty.call(x, key)) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
};
|
|
35
|
+
export const isUndefined = function (x: unknown): x is undefined {
|
|
36
|
+
return x === void 0;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const isString = function (x: unknown): x is string {
|
|
40
|
+
return toString.call(x) == '[object String]';
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const isEmptyString = function (x: unknown): boolean {
|
|
44
|
+
return isString(x) && x.trim().length === 0;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const isNull = function (x: unknown): x is null {
|
|
48
|
+
return x === null;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/*
|
|
52
|
+
sometimes you want to check if something is null or undefined
|
|
53
|
+
that's what this is for
|
|
54
|
+
*/
|
|
55
|
+
export const isNullish = function (x: unknown): x is null | undefined {
|
|
56
|
+
return isUndefined(x) || isNull(x);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const isDate = function (x: unknown): x is Date {
|
|
60
|
+
return toString.call(x) == '[object Date]';
|
|
61
|
+
};
|
|
62
|
+
export const isNumber = function (x: unknown): x is number {
|
|
63
|
+
return toString.call(x) == '[object Number]';
|
|
64
|
+
};
|
|
65
|
+
export const isBoolean = function (x: unknown): x is boolean {
|
|
66
|
+
return toString.call(x) === '[object Boolean]';
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const isFormData = (x: unknown): x is FormData => {
|
|
70
|
+
return x instanceof FormData;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const isFile = (x: unknown): x is File => {
|
|
74
|
+
return x instanceof File;
|
|
75
|
+
};
|
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const version = '1.0.1-beta.3';
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Exit on any error
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
# Configuration
|
|
7
|
-
SOURCE_DIR="./dist"
|
|
8
|
-
SOURCE_DIR_IOS="./ios"
|
|
9
|
-
SOURCE_DIR_ANDROID="./android"
|
|
10
|
-
TARGET_DIR_EXPO="./examples/example-app-expo/node_modules/@multiplayer-app/session-recorder-react-native"
|
|
11
|
-
TARGET_DIR_NATIVE="./examples/example-app/node_modules/@multiplayer-app/session-recorder-react-native"
|
|
12
|
-
|
|
13
|
-
echo "📱 Copying React Native dist to sample Expo app..."
|
|
14
|
-
|
|
15
|
-
# Check if source directory exists
|
|
16
|
-
if [ ! -d "$SOURCE_DIR" ]; then
|
|
17
|
-
echo "❌ Source directory does not exist: $SOURCE_DIR"
|
|
18
|
-
echo "💡 Please run 'npm run build' in the session-recorder-react-native package first"
|
|
19
|
-
exit 1
|
|
20
|
-
fi
|
|
21
|
-
|
|
22
|
-
# Check if target directory exists
|
|
23
|
-
if [ ! -d "$TARGET_DIR_EXPO" ]; then
|
|
24
|
-
echo "⚠️ Target directory does not exist: $TARGET_DIR_EXPO"
|
|
25
|
-
echo "💡 Skipping script execution - please make sure the sample-expo-app is set up and has the package installed"
|
|
26
|
-
exit 0
|
|
27
|
-
fi
|
|
28
|
-
|
|
29
|
-
# Check if target directory exists
|
|
30
|
-
if [ ! -d "$TARGET_DIR_NATIVE" ]; then
|
|
31
|
-
echo "⚠️ Target directory does not exist: $TARGET_DIR_NATIVE"
|
|
32
|
-
echo "💡 Skipping script execution - please make sure the example-app is set up and has the package installed"
|
|
33
|
-
exit 0
|
|
34
|
-
fi
|
|
35
|
-
|
|
36
|
-
# Copy the dist and native folders
|
|
37
|
-
echo "🔄 Copying dist folder and native sources..."
|
|
38
|
-
cp -r "$SOURCE_DIR" "$TARGET_DIR_EXPO/"
|
|
39
|
-
cp -r "$SOURCE_DIR_IOS" "$TARGET_DIR_EXPO/"
|
|
40
|
-
cp -r "$SOURCE_DIR_ANDROID" "$TARGET_DIR_EXPO/"
|
|
41
|
-
|
|
42
|
-
cp -r "$SOURCE_DIR" "$TARGET_DIR_NATIVE/"
|
|
43
|
-
cp -r "$SOURCE_DIR_IOS" "$TARGET_DIR_NATIVE/"
|
|
44
|
-
cp -r "$SOURCE_DIR_ANDROID" "$TARGET_DIR_NATIVE/"
|
|
45
|
-
|
|
46
|
-
# Ensure RN autolinking config and metadata are in sync
|
|
47
|
-
echo "🛠️ Syncing react-native.config.js and package.json..."
|
|
48
|
-
cp -f "./react-native.config.js" "$TARGET_DIR_EXPO/react-native.config.js"
|
|
49
|
-
cp -f "./package.json" "$TARGET_DIR_EXPO/package.json"
|
|
50
|
-
cp -f "./react-native.config.js" "$TARGET_DIR_NATIVE/react-native.config.js"
|
|
51
|
-
cp -f "./package.json" "$TARGET_DIR_NATIVE/package.json"
|
|
52
|
-
|
|
53
|
-
echo "✅ Successfully synced package into sample Expo app."
|
|
54
|
-
echo "📍 Source: $(pwd)"
|
|
55
|
-
echo "📍 Target: $TARGET_DIR_EXPO"
|
|
56
|
-
echo "📍 Target: $TARGET_DIR_NATIVE"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.ScreenRecorderView=void 0;var _sessionRecorderReactNative=_interopRequireDefault(require("@multiplayer-app/session-recorder-react-native"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _this=void 0,_jsxFileName="/Users/gegham/www/multiplayer-debugger-javascript/packages/session-recorder-react-native/dist/components/ScreenRecorderView/ScreenRecorderView.js";var ScreenRecorderView=exports.ScreenRecorderView=function ScreenRecorderView(_ref){var children=_ref.children;var setViewShotRef=function setViewShotRef(ref){var _a;if(ref){(_a=_sessionRecorderReactNative["default"].setViewShotRef)===null||_a===void 0?void 0:_a.call(_sessionRecorderReactNative["default"],ref);}};return(0,_jsxRuntime.jsx)(_reactNative.View,{ref:setViewShotRef,style:{flex:1},children:children});};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenRecorderView.js","sourceRoot":"","sources":["../../../src/components/ScreenRecorderView/ScreenRecorderView.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,gDAAgD,CAAA;AAC5E,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAInC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAA2B,EAAE,EAAE;IAC1E,kEAAkE;IAClE,MAAM,cAAc,GAAG,CAAC,GAAgB,EAAE,EAAE;;QAC1C,IAAI,GAAG,EAAE,CAAC;YACR,MAAA,eAAe,CAAC,cAAc,gEAAG,GAAG,CAAC,CAAA;QACvC,CAAC;IACH,CAAC,CAAA;IAED,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAC5C;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./ScreenRecorderView";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _ScreenRecorderView=require("./ScreenRecorderView");Object.keys(_ScreenRecorderView).forEach(function(key){if(key==="default"||key==="__esModule")return;if(key in exports&&exports[key]===_ScreenRecorderView[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _ScreenRecorderView[key];}});});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ScreenRecorderView/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _this=void 0,_jsxFileName="/Users/gegham/www/multiplayer-debugger-javascript/packages/session-recorder-react-native/dist/components/SessionRecorderWidget/ErrorBanner.js";var ErrorBanner=function ErrorBanner(_ref){var error=_ref.error,onDismiss=_ref.onDismiss;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.container,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.content,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.errorText,children:error}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:onDismiss,style:styles.dismissButton,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.dismissText,children:"\u2715"})})]})});};var styles=_reactNative.StyleSheet.create({container:{backgroundColor:'#ff4444',paddingHorizontal:16,paddingVertical:12,marginHorizontal:16,marginTop:8,borderRadius:8},content:{flexDirection:'row',alignItems:'center',justifyContent:'space-between'},errorText:{color:'white',fontSize:14,flex:1,marginRight:8},dismissButton:{padding:4,borderRadius:12,backgroundColor:'rgba(255, 255, 255, 0.2)',width:24,height:24,alignItems:'center',justifyContent:'center'},dismissText:{color:'white',fontSize:12,fontWeight:'bold'}});var _default=exports["default"]=ErrorBanner;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBanner.js","sourceRoot":"","sources":["../../../src/components/SessionRecorderWidget/ErrorBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAOhE,MAAM,WAAW,GAA+B,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;IACvE,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAC1B;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAC5C;QAAA,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CACzD;UAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,CAC1C;QAAA,EAAE,SAAS,CACb;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,eAAe,EAAE,SAAS;QAC1B,iBAAiB,EAAE,EAAE;QACrB,eAAe,EAAE,EAAE;QACnB,gBAAgB,EAAE,EAAE;QACpB,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;KAChB;IACD,OAAO,EAAE;QACP,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,eAAe;KAChC;IACD,SAAS,EAAE;QACT,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,IAAI,EAAE,CAAC;QACP,WAAW,EAAE,CAAC;KACf;IACD,aAAa,EAAE;QACb,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,0BAA0B;QAC3C,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;IACD,WAAW,EAAE;QACX,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAA;AAEF,eAAe,WAAW,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _styles=require("./styles");var _ModalHeader=_interopRequireDefault(require("./ModalHeader"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");var _this=void 0,_jsxFileName="/Users/gegham/www/multiplayer-debugger-javascript/packages/session-recorder-react-native/dist/components/SessionRecorderWidget/FinalPopover.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t3 in e)"default"!==_t3&&{}.hasOwnProperty.call(e,_t3)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t3))&&(i.get||i.set)?o(f,_t3,i):f[_t3]=e[_t3]);return f;})(e,t);}var FinalPopover=function FinalPopover(_ref){var isOnline=_ref.isOnline,textOverrides=_ref.textOverrides,onStopRecording=_ref.onStopRecording,onCancelSession=_ref.onCancelSession,isSubmitting=_ref.isSubmitting,children=_ref.children;var _useState=(0,_react.useState)(''),_useState2=(0,_slicedToArray2["default"])(_useState,2),comment=_useState2[0],setComment=_useState2[1];var handleStopRecording=function(){var _ref2=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var _t;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=1;return onStopRecording(comment);case 1:_context.next=3;break;case 2:_context.prev=2;_t=_context["catch"](0);_utils.logger.error('FinalPopover','Failed to save session',_t);case 3:case"end":return _context.stop();}},_callee,null,[[0,2]]);}));return function handleStopRecording(){return _ref2.apply(this,arguments);};}();return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.sharedStyles.popoverContent,children:[(0,_jsxRuntime.jsx)(_ModalHeader["default"],{children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{onPress:onCancelSession,disabled:!isOnline,style:_styles.sharedStyles.cancelButton,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.cancelButtonText,children:textOverrides.cancelButtonText})})}),(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:_styles.sharedStyles.popoverBody,keyboardShouldPersistTaps:"handled",contentInsetAdjustmentBehavior:"automatic",children:[children,(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.title,children:textOverrides.finalTitle}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.description,children:textOverrides.finalDescription}),(0,_jsxRuntime.jsx)(_reactNative.TextInput,{style:_styles.sharedStyles.commentInput,placeholder:textOverrides.commentPlaceholder,placeholderTextColor:'#9CA3AF',value:comment,onChangeText:setComment,multiline:true,numberOfLines:3,textAlignVertical:"top",returnKeyType:"done",blurOnSubmit:true,onSubmitEditing:function onSubmitEditing(){return _reactNative.Keyboard.dismiss();}}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:_styles.sharedStyles.popoverFooter,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:isSubmitting||!isOnline,style:[_styles.sharedStyles.actionButton,_styles.sharedStyles.stopButton],onPress:handleStopRecording,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.actionButtonText,children:isSubmitting?'Saving...':textOverrides.saveButtonText})})})]})]});};var _default=exports["default"]=FinalPopover;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FinalPopover.js","sourceRoot":"","sources":["../../../src/components/SessionRecorderWidget/FinalPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,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AE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _types=require("../../types");var _storage=require("../../services/storage.service");var _icons=require("./icons");var _jsxRuntime=require("react/jsx-runtime");var _this=void 0,_jsxFileName="/Users/gegham/www/multiplayer-debugger-javascript/packages/session-recorder-react-native/dist/components/SessionRecorderWidget/FloatingButton.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t2 in e)"default"!==_t2&&{}.hasOwnProperty.call(e,_t2)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t2))&&(i.get||i.set)?o(f,_t2,i):f[_t2]=e[_t2]);return f;})(e,t);}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}var buttonSize=52;var rightOffset=20;var topOffset=_reactNative.Platform.OS==='ios'?60:40;var FloatingButton=function FloatingButton(_ref){var sessionState=_ref.sessionState,onPress=_ref.onPress;var position=(0,_react.useRef)(new _reactNative.Animated.ValueXY({x:0,y:0})).current;var lastPosition=(0,_react.useRef)({top:topOffset,right:rightOffset});var storageService=(0,_react.useRef)(_storage.StorageService.getInstance()).current;var screenBounds=(0,_react.useMemo)(function(){var _Dimensions$get=_reactNative.Dimensions.get('window'),width=_Dimensions$get.width,height=_Dimensions$get.height;return{minTop:topOffset,maxTop:height-buttonSize,minRight:0,maxRight:width-buttonSize};},[]);(0,_react.useEffect)(function(){var savedPosition=storageService.getFloatingButtonPosition();if(savedPosition){var _Dimensions$get2=_reactNative.Dimensions.get('window'),width=_Dimensions$get2.width;var top=savedPosition.y;var right=width-savedPosition.x-buttonSize;lastPosition.current={top:top,right:right};position.setValue({x:right,y:top});}else{position.setValue({x:lastPosition.current.right,y:lastPosition.current.top});}},[]);var panResponder=(0,_react.useRef)(_reactNative.PanResponder.create({onStartShouldSetPanResponder:function onStartShouldSetPanResponder(){return true;},onMoveShouldSetPanResponder:function onMoveShouldSetPanResponder(evt,gestureState){var distance=Math.sqrt(gestureState.dx*gestureState.dx+gestureState.dy*gestureState.dy);return distance>5;},onPanResponderGrant:function onPanResponderGrant(){position.setValue({x:lastPosition.current.right,y:lastPosition.current.top});},onPanResponderMove:function onPanResponderMove(evt,gestureState){var newTop=lastPosition.current.top+gestureState.dy;var newRight=lastPosition.current.right-gestureState.dx;position.setValue({x:newRight,y:newTop});},onPanResponderRelease:function onPanResponderRelease(e,gestureState){var distance=Math.sqrt(gestureState.dx*gestureState.dx+gestureState.dy*gestureState.dy);if(distance<=5){onPress();}else{var newTop=lastPosition.current.top+gestureState.dy;var newRight=lastPosition.current.right-gestureState.dx;var clampedTop=Math.max(screenBounds.minTop,Math.min(screenBounds.maxTop,newTop));var clampedRight=Math.max(screenBounds.minRight,Math.min(screenBounds.maxRight,newRight));lastPosition.current={top:clampedTop,right:clampedRight};position.setValue({x:clampedRight,y:clampedTop});var _Dimensions$get3=_reactNative.Dimensions.get('window'),width=_Dimensions$get3.width;var storagePosition={x:width-clampedRight-buttonSize,y:clampedTop};storageService.saveFloatingButtonPosition(storagePosition);}}})).current;var content=(0,_react.useMemo)(function(){switch(sessionState){case _types.SessionState.started:return{icon:(0,_jsxRuntime.jsx)(_icons.CapturingIcon,{size:28,color:"white"}),color:'#FF4444'};case _types.SessionState.paused:return{icon:(0,_jsxRuntime.jsx)(_icons.PausedIcon,{size:28,color:"white"}),color:'#FFA500'};default:return{icon:(0,_jsxRuntime.jsx)(_icons.RecordIcon,{size:28,color:"#718096"}),color:'#ffffff'};}},[sessionState]);return(0,_jsxRuntime.jsx)(_reactNative.Animated.View,_objectSpread(_objectSpread({style:[styles.draggableButton,{top:position.y,right:position.x}]},panResponder.panHandlers),{},{children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.floatingButton,{backgroundColor:content.color}],children:content.icon})}));};var styles=_reactNative.StyleSheet.create({draggableButton:{position:'absolute'},floatingButton:{elevation:8,shadowRadius:4,width:buttonSize,shadowColor:'#000',height:buttonSize,shadowOpacity:0.25,alignItems:'center',justifyContent:'center',borderRadius:buttonSize/2,shadowOffset:{width:0,height:2}}});var _default=exports["default"]=FloatingButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingButton.js","sourceRoot":"","sources":["../../../src/components/SessionRecorderWidget/FloatingButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC7F,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,cAA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C,CACnH;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,EAAE,eAAe,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAChG;IAAA,EAAE,QAAQ,CAAC,IAAI,CAAC,CACjB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE,UAAU;KACrB;IACD,cAAc,EAAE;QACd,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE,UAAU;QAClB,aAAa,EAAE,IAAI;QACnB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,YAAY,EAAE,UAAU,GAAG,CAAC;QAC5B,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;KACtC;CACF,CAAC,CAAA;AAEF,eAAe,cAAc,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports["default"]=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _sessionRecorderCommon=require("@multiplayer-app/session-recorder-common");var _styles=require("./styles");var _ModalHeader=_interopRequireDefault(require("./ModalHeader"));var _icons=require("./icons");var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");var _this=void 0,_jsxFileName="/Users/gegham/www/multiplayer-debugger-javascript/packages/session-recorder-react-native/dist/components/SessionRecorderWidget/InitialPopover.js";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,"default":e};if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t5 in e)"default"!==_t5&&{}.hasOwnProperty.call(e,_t5)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t5))&&(i.get||i.set)?o(f,_t5,i):f[_t5]=e[_t5]);return f;})(e,t);}var InitialPopover=function InitialPopover(_ref){var isContinuous=_ref.isContinuous,textOverrides=_ref.textOverrides,showContinuousRecording=_ref.showContinuousRecording,onStartRecording=_ref.onStartRecording,onStopRecording=_ref.onStopRecording,onSaveContinuousSession=_ref.onSaveContinuousSession,isOnline=_ref.isOnline,children=_ref.children;var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2["default"])(_useState,2),saving=_useState2[0],setSaving=_useState2[1];var _useState3=(0,_react.useState)(false),_useState4=(0,_slicedToArray2["default"])(_useState3,2),loading=_useState4[0],setLoading=_useState4[1];var _useState5=(0,_react.useState)(isContinuous),_useState6=(0,_slicedToArray2["default"])(_useState5,2),continuousRecording=_useState6[0],setContinuousRecording=_useState6[1];var handleStartRecording=function(){var _ref2=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var _t;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;setLoading(true);_context.next=1;return onStartRecording(_sessionRecorderCommon.SessionType.PLAIN);case 1:_context.next=3;break;case 2:_context.prev=2;_t=_context["catch"](0);_utils.logger.error('InitialPopover','Failed to start recording',_t);case 3:_context.prev=3;setLoading(false);return _context.finish(3);case 4:case"end":return _context.stop();}},_callee,null,[[0,2,3,4]]);}));return function handleStartRecording(){return _ref2.apply(this,arguments);};}();var handleToggleContinuousRecording=function(){var _ref3=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(value){var _t2;return _regenerator["default"].wrap(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.prev=0;setLoading(true);setContinuousRecording(value);if(!value){_context2.next=2;break;}_context2.next=1;return onStartRecording(_sessionRecorderCommon.SessionType.CONTINUOUS);case 1:_context2.next=3;break;case 2:_context2.next=3;return onStopRecording();case 3:_context2.next=5;break;case 4:_context2.prev=4;_t2=_context2["catch"](0);_utils.logger.error('InitialPopover','Failed to toggle continuous recording',_t2);case 5:_context2.prev=5;setLoading(false);return _context2.finish(5);case 6:case"end":return _context2.stop();}},_callee2,null,[[0,4,5,6]]);}));return function handleToggleContinuousRecording(_x){return _ref3.apply(this,arguments);};}();var handleSaveContinuousSession=function(){var _ref4=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(){var _t3;return _regenerator["default"].wrap(function(_context3){while(1)switch(_context3.prev=_context3.next){case 0:_context3.prev=0;setSaving(true);_context3.next=1;return onSaveContinuousSession();case 1:_context3.next=3;break;case 2:_context3.prev=2;_t3=_context3["catch"](0);_utils.logger.error('InitialPopover','Failed to save continuous session',_t3);case 3:_context3.prev=3;setSaving(false);return _context3.finish(3);case 4:case"end":return _context3.stop();}},_callee3,null,[[0,2,3,4]]);}));return function handleSaveContinuousSession(){return _ref4.apply(this,arguments);};}();var textContent=(0,_react.useMemo)(function(){return{label:textOverrides.continuousRecordingLabel,title:showContinuousRecording?textOverrides.initialTitleWithContinuous:textOverrides.initialTitleWithoutContinuous,description:showContinuousRecording?textOverrides.initialDescriptionWithContinuous:textOverrides.initialDescriptionWithoutContinuous};},[showContinuousRecording,textOverrides]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.sharedStyles.popoverContent,children:[(0,_jsxRuntime.jsx)(_ModalHeader["default"],{}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.sharedStyles.popoverBody,children:[children,showContinuousRecording&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.sharedStyles.continuousRecordingSection,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.continuousRecordingLabel,children:textContent.label}),(0,_jsxRuntime.jsx)(_reactNative.Switch,{disabled:loading||!isOnline,value:continuousRecording,ios_backgroundColor:"#e2e8f0",onValueChange:handleToggleContinuousRecording,trackColor:{"false":'#e2e8f0',"true":'#493bff'},thumbColor:'#ffffff'})]}),!continuousRecording?(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.title,children:textContent.title}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.description,children:textContent.description}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:_styles.sharedStyles.popoverFooter,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:loading||!isOnline,onPress:handleStartRecording,style:[_styles.sharedStyles.actionButton,_styles.sharedStyles.startButton],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.actionButtonText,children:loading?'Starting to record...':textOverrides.startRecordingButtonText})})})]}):(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.sharedStyles.continuousOverlay,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.sharedStyles.continuousOverlayHeader,children:[(0,_jsxRuntime.jsx)(_icons.CapturingIcon,{size:20,color:"red"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.continuousOverlayTitle,children:textOverrides.continuousOverlayTitle})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.continuousOverlayDescription,children:textOverrides.continuousOverlayDescription})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:_styles.sharedStyles.popoverFooter,children:(0,_jsxRuntime.jsx)(_reactNative.Pressable,{disabled:saving||!isOnline,onPress:handleSaveContinuousSession,style:[_styles.sharedStyles.actionButton,_styles.sharedStyles.saveButton],children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:_styles.sharedStyles.actionButtonText,children:saving?'Saving...':textOverrides.saveLastSnapshotButtonText})})})]})]})]});};var _default=exports["default"]=InitialPopover;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InitialPopover.js","sourceRoot":"","sources":["../../../src/components/SessionRecorderWidget/InitialPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,WAAW,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAcpC,MAAM,cAAc,GAAkC,CAAC,EACrD,YAAY,EACZ,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,QAAQ,EACR,QAAQ,EACT,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC7C,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAA;IAE5E,MAAM,oBAAoB,GAAG,KAAK,IAAI,EAAE;QACtC,IAAI,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,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