@unif/react-native-camera 1.2.6 → 2.0.0
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 -1
- package/README.md +92 -22
- package/lib/module/camera/Camera.js +163 -285
- package/lib/module/camera/Camera.js.map +1 -1
- package/lib/module/camera/Container.js +209 -49
- package/lib/module/camera/Container.js.map +1 -1
- package/lib/module/camera/Error.js +23 -18
- package/lib/module/camera/Error.js.map +1 -1
- package/lib/module/camera/FocusIndicator.js +35 -41
- package/lib/module/camera/FocusIndicator.js.map +1 -1
- package/lib/module/camera/ModalView.js +28 -21
- package/lib/module/camera/ModalView.js.map +1 -1
- package/lib/module/camera/NoCamera.js +38 -14
- package/lib/module/camera/NoCamera.js.map +1 -1
- package/lib/module/camera/NoPermission.js +44 -38
- package/lib/module/camera/NoPermission.js.map +1 -1
- package/lib/module/camera/capturePhotoHelper.js +24 -0
- package/lib/module/camera/capturePhotoHelper.js.map +1 -0
- package/lib/module/camera/footer/Footer.js +83 -140
- package/lib/module/camera/footer/Footer.js.map +1 -1
- package/lib/module/camera/footer/index.js +3 -2
- package/lib/module/camera/footer/index.js.map +1 -1
- package/lib/module/camera/index.js +11 -13
- package/lib/module/camera/index.js.map +1 -1
- package/lib/module/camera/preview/PreView.js +36 -93
- package/lib/module/camera/preview/PreView.js.map +1 -1
- package/lib/module/camera/preview/PreViewContainer.js +28 -29
- package/lib/module/camera/preview/PreViewContainer.js.map +1 -1
- package/lib/module/camera/preview/PreviewFooter.js +30 -21
- package/lib/module/camera/preview/PreviewFooter.js.map +1 -1
- package/lib/module/camera/preview/SinglePre.js +28 -60
- package/lib/module/camera/preview/SinglePre.js.map +1 -1
- package/lib/module/camera/preview/index.js +6 -12
- package/lib/module/camera/preview/index.js.map +1 -1
- package/lib/module/camera/setup/SetUp.js +67 -189
- package/lib/module/camera/setup/SetUp.js.map +1 -1
- package/lib/module/camera/setup/index.js +3 -2
- package/lib/module/camera/setup/index.js.map +1 -1
- package/lib/module/components/Carousel/Carousel.js +33 -40
- package/lib/module/components/Carousel/Carousel.js.map +1 -1
- package/lib/module/components/Carousel/SlideItem.js +22 -70
- package/lib/module/components/Carousel/SlideItem.js.map +1 -1
- package/lib/module/components/Carousel/index.js +4 -11
- package/lib/module/components/Carousel/index.js.map +1 -1
- package/lib/module/components/Loading.js +15 -61
- package/lib/module/components/Loading.js.map +1 -1
- package/lib/module/components/PreviewThumbnail.js +36 -33
- package/lib/module/components/PreviewThumbnail.js.map +1 -1
- package/lib/module/components/index.js +5 -8
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/hooks/index.js +5 -11
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useCamera.js +44 -0
- package/lib/module/hooks/useCamera.js.map +1 -0
- package/lib/module/hooks/useConfirm.js +13 -49
- package/lib/module/hooks/useConfirm.js.map +1 -1
- package/lib/module/hooks/useCreation.js +18 -0
- package/lib/module/hooks/useCreation.js.map +1 -0
- package/lib/module/index.js +4 -24
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/utils/depsAreSame.js +7 -4
- package/lib/module/utils/depsAreSame.js.map +1 -1
- package/lib/module/utils/index.js +6 -14
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/interface.js +1 -21
- package/lib/module/utils/interface.js.map +1 -1
- package/lib/module/utils/px-to-dp.js +6 -10
- package/lib/module/utils/px-to-dp.js.map +1 -1
- package/lib/module/utils/util.js +16 -40
- package/lib/module/utils/util.js.map +1 -1
- package/lib/typescript/jest.setup.d.ts +1 -0
- package/lib/typescript/jest.setup.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/camera/Camera.d.ts +18 -10
- package/lib/typescript/src/camera/Camera.d.ts.map +1 -1
- package/lib/typescript/src/camera/Container.d.ts +7 -5
- package/lib/typescript/src/camera/Container.d.ts.map +1 -1
- package/lib/typescript/src/camera/Error.d.ts +3 -7
- package/lib/typescript/src/camera/Error.d.ts.map +1 -1
- package/lib/typescript/src/camera/FocusIndicator.d.ts +7 -7
- package/lib/typescript/src/camera/FocusIndicator.d.ts.map +1 -1
- package/lib/typescript/src/camera/ModalView.d.ts +7 -4
- package/lib/typescript/src/camera/ModalView.d.ts.map +1 -1
- package/lib/typescript/src/camera/NoCamera.d.ts +5 -3
- package/lib/typescript/src/camera/NoCamera.d.ts.map +1 -1
- package/lib/typescript/src/camera/NoPermission.d.ts +6 -3
- package/lib/typescript/src/camera/NoPermission.d.ts.map +1 -1
- package/lib/typescript/src/camera/capturePhotoHelper.d.ts +16 -0
- package/lib/typescript/src/camera/capturePhotoHelper.d.ts.map +1 -0
- package/lib/typescript/src/camera/footer/Footer.d.ts +13 -15
- package/lib/typescript/src/camera/footer/Footer.d.ts.map +1 -1
- package/lib/typescript/src/camera/footer/index.d.ts +1 -2
- package/lib/typescript/src/camera/footer/index.d.ts.map +1 -1
- package/lib/typescript/src/camera/index.d.ts +9 -5
- package/lib/typescript/src/camera/index.d.ts.map +1 -1
- package/lib/typescript/src/camera/preview/PreView.d.ts +6 -9
- package/lib/typescript/src/camera/preview/PreView.d.ts.map +1 -1
- package/lib/typescript/src/camera/preview/PreViewContainer.d.ts +8 -5
- package/lib/typescript/src/camera/preview/PreViewContainer.d.ts.map +1 -1
- package/lib/typescript/src/camera/preview/PreviewFooter.d.ts +6 -6
- package/lib/typescript/src/camera/preview/PreviewFooter.d.ts.map +1 -1
- package/lib/typescript/src/camera/preview/SinglePre.d.ts +5 -28
- package/lib/typescript/src/camera/preview/SinglePre.d.ts.map +1 -1
- package/lib/typescript/src/camera/preview/index.d.ts +4 -4
- package/lib/typescript/src/camera/preview/index.d.ts.map +1 -1
- package/lib/typescript/src/camera/setup/SetUp.d.ts +12 -11
- package/lib/typescript/src/camera/setup/SetUp.d.ts.map +1 -1
- package/lib/typescript/src/camera/setup/index.d.ts +1 -2
- package/lib/typescript/src/camera/setup/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Carousel/Carousel.d.ts +6 -8
- package/lib/typescript/src/components/Carousel/Carousel.d.ts.map +1 -1
- package/lib/typescript/src/components/Carousel/SlideItem.d.ts +4 -12
- package/lib/typescript/src/components/Carousel/SlideItem.d.ts.map +1 -1
- package/lib/typescript/src/components/Carousel/index.d.ts +2 -3
- package/lib/typescript/src/components/Carousel/index.d.ts.map +1 -1
- package/lib/typescript/src/components/Loading.d.ts +1 -3
- package/lib/typescript/src/components/Loading.d.ts.map +1 -1
- package/lib/typescript/src/components/PreviewThumbnail.d.ts +7 -8
- package/lib/typescript/src/components/PreviewThumbnail.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +2 -7
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +3 -3
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCamera.d.ts +4 -0
- package/lib/typescript/src/hooks/useCamera.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useConfirm.d.ts +1 -5
- package/lib/typescript/src/hooks/useConfirm.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCreation.d.ts +2 -0
- package/lib/typescript/src/hooks/useCreation.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/depsAreSame.d.ts +1 -2
- package/lib/typescript/src/utils/depsAreSame.d.ts.map +1 -1
- package/lib/typescript/src/utils/index.d.ts +2 -4
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/interface.d.ts +30 -70
- package/lib/typescript/src/utils/interface.d.ts.map +1 -1
- package/lib/typescript/src/utils/px-to-dp.d.ts +1 -3
- package/lib/typescript/src/utils/px-to-dp.d.ts.map +1 -1
- package/lib/typescript/src/utils/util.d.ts +8 -9
- package/lib/typescript/src/utils/util.d.ts.map +1 -1
- package/package.json +120 -107
- package/src/camera/Camera.tsx +210 -331
- package/src/camera/Container.tsx +224 -50
- package/src/camera/Error.tsx +22 -23
- package/src/camera/FocusIndicator.tsx +36 -46
- package/src/camera/ModalView.tsx +26 -24
- package/src/camera/NoCamera.tsx +37 -14
- package/src/camera/NoPermission.tsx +45 -37
- package/src/camera/capturePhotoHelper.ts +37 -0
- package/src/camera/footer/Footer.tsx +104 -195
- package/src/camera/footer/index.tsx +1 -2
- package/src/camera/index.tsx +12 -13
- package/src/camera/preview/PreView.tsx +22 -103
- package/src/camera/preview/PreViewContainer.tsx +23 -27
- package/src/camera/preview/PreviewFooter.tsx +28 -22
- package/src/camera/preview/SinglePre.tsx +23 -68
- package/src/camera/preview/index.tsx +4 -13
- package/src/camera/setup/SetUp.tsx +80 -217
- package/src/camera/setup/index.tsx +1 -3
- package/src/components/Carousel/Carousel.tsx +22 -42
- package/src/components/Carousel/SlideItem.tsx +12 -87
- package/src/components/Carousel/index.tsx +2 -13
- package/src/components/Loading.tsx +7 -69
- package/src/components/PreviewThumbnail.tsx +38 -33
- package/src/components/index.tsx +2 -7
- package/src/hooks/index.ts +3 -12
- package/src/hooks/useCamera.tsx +42 -0
- package/src/hooks/useConfirm.tsx +10 -57
- package/src/hooks/useCreation.ts +26 -0
- package/src/index.tsx +3 -37
- package/src/utils/depsAreSame.ts +7 -8
- package/src/utils/index.ts +2 -12
- package/src/utils/interface.ts +26 -87
- package/src/utils/px-to-dp.tsx +5 -9
- package/src/utils/util.ts +17 -42
- package/UnifRNCamera.podspec +0 -41
- package/android/CMakeLists.txt +0 -15
- package/android/build.gradle +0 -124
- package/android/cpp-adapter.cpp +0 -8
- package/android/gradle.properties +0 -5
- package/android/src/main/AndroidManifest.xml +0 -3
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/android/src/main/java/com/unif/reactnativecamera/ReactNativeCameraModule.java +0 -34
- package/android/src/main/java/com/unif/reactnativecamera/ReactNativeCameraPackage.java +0 -45
- package/android/src/newarch/ReactNativeCameraSpec.java +0 -9
- package/android/src/oldarch/ReactNativeCameraSpec.java +0 -13
- package/cpp/unif-react-native-camera.cpp +0 -7
- package/cpp/unif-react-native-camera.h +0 -8
- package/ios/ReactNativeCamera.h +0 -15
- package/ios/ReactNativeCamera.mm +0 -51
- package/lib/commonjs/NativeReactNativeCamera.js +0 -17
- package/lib/commonjs/NativeReactNativeCamera.js.map +0 -1
- package/lib/commonjs/assets/close.png +0 -0
- package/lib/commonjs/assets/home/record.png +0 -0
- package/lib/commonjs/assets/home/take.png +0 -0
- package/lib/commonjs/assets/preview/back.png +0 -0
- package/lib/commonjs/assets/preview/del.png +0 -0
- package/lib/commonjs/assets/preview/rotate.png +0 -0
- package/lib/commonjs/assets/preview/save.png +0 -0
- package/lib/commonjs/assets/tools/auto.png +0 -0
- package/lib/commonjs/assets/tools/defaultEye.png +0 -0
- package/lib/commonjs/assets/tools/enlarge.png +0 -0
- package/lib/commonjs/assets/tools/fishEye.png +0 -0
- package/lib/commonjs/assets/tools/narrow.png +0 -0
- package/lib/commonjs/assets/tools/off.png +0 -0
- package/lib/commonjs/assets/tools/on.png +0 -0
- package/lib/commonjs/assets/tools/volumeOff.png +0 -0
- package/lib/commonjs/assets/tools/volumeOn.png +0 -0
- package/lib/commonjs/camera/Camera.js +0 -316
- package/lib/commonjs/camera/Camera.js.map +0 -1
- package/lib/commonjs/camera/Container.js +0 -64
- package/lib/commonjs/camera/Container.js.map +0 -1
- package/lib/commonjs/camera/Error.js +0 -30
- package/lib/commonjs/camera/Error.js.map +0 -1
- package/lib/commonjs/camera/FocusIndicator.js +0 -64
- package/lib/commonjs/camera/FocusIndicator.js.map +0 -1
- package/lib/commonjs/camera/ModalView.js +0 -37
- package/lib/commonjs/camera/ModalView.js.map +0 -1
- package/lib/commonjs/camera/NoCamera.js +0 -23
- package/lib/commonjs/camera/NoCamera.js.map +0 -1
- package/lib/commonjs/camera/NoPermission.js +0 -50
- package/lib/commonjs/camera/NoPermission.js.map +0 -1
- package/lib/commonjs/camera/footer/Footer.js +0 -159
- package/lib/commonjs/camera/footer/Footer.js.map +0 -1
- package/lib/commonjs/camera/footer/index.js +0 -14
- package/lib/commonjs/camera/footer/index.js.map +0 -1
- package/lib/commonjs/camera/index.js +0 -35
- package/lib/commonjs/camera/index.js.map +0 -1
- package/lib/commonjs/camera/preview/PreView.js +0 -109
- package/lib/commonjs/camera/preview/PreView.js.map +0 -1
- package/lib/commonjs/camera/preview/PreViewContainer.js +0 -42
- package/lib/commonjs/camera/preview/PreViewContainer.js.map +0 -1
- package/lib/commonjs/camera/preview/PreviewFooter.js +0 -35
- package/lib/commonjs/camera/preview/PreviewFooter.js.map +0 -1
- package/lib/commonjs/camera/preview/SinglePre.js +0 -72
- package/lib/commonjs/camera/preview/SinglePre.js.map +0 -1
- package/lib/commonjs/camera/preview/index.js +0 -28
- package/lib/commonjs/camera/preview/index.js.map +0 -1
- package/lib/commonjs/camera/setup/SetUp.js +0 -205
- package/lib/commonjs/camera/setup/SetUp.js.map +0 -1
- package/lib/commonjs/camera/setup/index.js +0 -14
- package/lib/commonjs/camera/setup/index.js.map +0 -1
- package/lib/commonjs/camera/watermark/Render.js +0 -110
- package/lib/commonjs/camera/watermark/Render.js.map +0 -1
- package/lib/commonjs/camera/watermark/ViewShotWatermark.js +0 -143
- package/lib/commonjs/camera/watermark/ViewShotWatermark.js.map +0 -1
- package/lib/commonjs/camera/watermark/index.js +0 -21
- package/lib/commonjs/camera/watermark/index.js.map +0 -1
- package/lib/commonjs/components/Back.js +0 -48
- package/lib/commonjs/components/Back.js.map +0 -1
- package/lib/commonjs/components/Carousel/Carousel.js +0 -51
- package/lib/commonjs/components/Carousel/Carousel.js.map +0 -1
- package/lib/commonjs/components/Carousel/SlideItem.js +0 -84
- package/lib/commonjs/components/Carousel/SlideItem.js.map +0 -1
- package/lib/commonjs/components/Carousel/index.js +0 -21
- package/lib/commonjs/components/Carousel/index.js.map +0 -1
- package/lib/commonjs/components/Delete.js +0 -36
- package/lib/commonjs/components/Delete.js.map +0 -1
- package/lib/commonjs/components/Loading.js +0 -75
- package/lib/commonjs/components/Loading.js.map +0 -1
- package/lib/commonjs/components/Modal/Confirm.js +0 -121
- package/lib/commonjs/components/Modal/Confirm.js.map +0 -1
- package/lib/commonjs/components/Modal/index.js +0 -14
- package/lib/commonjs/components/Modal/index.js.map +0 -1
- package/lib/commonjs/components/PreviewThumbnail.js +0 -44
- package/lib/commonjs/components/PreviewThumbnail.js.map +0 -1
- package/lib/commonjs/components/Rotate.js +0 -32
- package/lib/commonjs/components/Rotate.js.map +0 -1
- package/lib/commonjs/components/Save.js +0 -48
- package/lib/commonjs/components/Save.js.map +0 -1
- package/lib/commonjs/components/index.js +0 -73
- package/lib/commonjs/components/index.js.map +0 -1
- package/lib/commonjs/hooks/index.js +0 -21
- package/lib/commonjs/hooks/index.js.map +0 -1
- package/lib/commonjs/hooks/useCamera.tsx/index.js +0 -90
- package/lib/commonjs/hooks/useCamera.tsx/index.js.map +0 -1
- package/lib/commonjs/hooks/useConfirm.js +0 -61
- package/lib/commonjs/hooks/useConfirm.js.map +0 -1
- package/lib/commonjs/hooks/useCreation/index.js +0 -34
- package/lib/commonjs/hooks/useCreation/index.js.map +0 -1
- package/lib/commonjs/index.js +0 -39
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/utils/common.js +0 -69
- package/lib/commonjs/utils/common.js.map +0 -1
- package/lib/commonjs/utils/depsAreSame.js +0 -14
- package/lib/commonjs/utils/depsAreSame.js.map +0 -1
- package/lib/commonjs/utils/index.js +0 -72
- package/lib/commonjs/utils/index.js.map +0 -1
- package/lib/commonjs/utils/interface.js +0 -24
- package/lib/commonjs/utils/interface.js.map +0 -1
- package/lib/commonjs/utils/px-to-dp.js +0 -21
- package/lib/commonjs/utils/px-to-dp.js.map +0 -1
- package/lib/commonjs/utils/render-item.js +0 -40
- package/lib/commonjs/utils/render-item.js.map +0 -1
- package/lib/commonjs/utils/util.js +0 -53
- package/lib/commonjs/utils/util.js.map +0 -1
- package/lib/commonjs/utils/watermark.js +0 -49
- package/lib/commonjs/utils/watermark.js.map +0 -1
- package/lib/module/NativeReactNativeCamera.js +0 -12
- package/lib/module/NativeReactNativeCamera.js.map +0 -1
- package/lib/module/assets/close.png +0 -0
- package/lib/module/assets/home/record.png +0 -0
- package/lib/module/assets/home/take.png +0 -0
- package/lib/module/assets/preview/back.png +0 -0
- package/lib/module/assets/preview/del.png +0 -0
- package/lib/module/assets/preview/rotate.png +0 -0
- package/lib/module/assets/preview/save.png +0 -0
- package/lib/module/assets/tools/auto.png +0 -0
- package/lib/module/assets/tools/defaultEye.png +0 -0
- package/lib/module/assets/tools/enlarge.png +0 -0
- package/lib/module/assets/tools/fishEye.png +0 -0
- package/lib/module/assets/tools/narrow.png +0 -0
- package/lib/module/assets/tools/off.png +0 -0
- package/lib/module/assets/tools/on.png +0 -0
- package/lib/module/assets/tools/volumeOff.png +0 -0
- package/lib/module/assets/tools/volumeOn.png +0 -0
- package/lib/module/camera/watermark/Render.js +0 -102
- package/lib/module/camera/watermark/Render.js.map +0 -1
- package/lib/module/camera/watermark/ViewShotWatermark.js +0 -133
- package/lib/module/camera/watermark/ViewShotWatermark.js.map +0 -1
- package/lib/module/camera/watermark/index.js +0 -13
- package/lib/module/camera/watermark/index.js.map +0 -1
- package/lib/module/components/Back.js +0 -40
- package/lib/module/components/Back.js.map +0 -1
- package/lib/module/components/Delete.js +0 -28
- package/lib/module/components/Delete.js.map +0 -1
- package/lib/module/components/Modal/Confirm.js +0 -111
- package/lib/module/components/Modal/Confirm.js.map +0 -1
- package/lib/module/components/Modal/index.js +0 -3
- package/lib/module/components/Modal/index.js.map +0 -1
- package/lib/module/components/Rotate.js +0 -24
- package/lib/module/components/Rotate.js.map +0 -1
- package/lib/module/components/Save.js +0 -40
- package/lib/module/components/Save.js.map +0 -1
- package/lib/module/hooks/useCamera.tsx/index.js +0 -81
- package/lib/module/hooks/useCamera.tsx/index.js.map +0 -1
- package/lib/module/hooks/useCreation/index.js +0 -27
- package/lib/module/hooks/useCreation/index.js.map +0 -1
- package/lib/module/utils/common.js +0 -62
- package/lib/module/utils/common.js.map +0 -1
- package/lib/module/utils/render-item.js +0 -32
- package/lib/module/utils/render-item.js.map +0 -1
- package/lib/module/utils/watermark.js +0 -39
- package/lib/module/utils/watermark.js.map +0 -1
- package/lib/typescript/src/NativeReactNativeCamera.d.ts +0 -6
- package/lib/typescript/src/NativeReactNativeCamera.d.ts.map +0 -1
- package/lib/typescript/src/camera/watermark/Render.d.ts +0 -26
- package/lib/typescript/src/camera/watermark/Render.d.ts.map +0 -1
- package/lib/typescript/src/camera/watermark/ViewShotWatermark.d.ts +0 -41
- package/lib/typescript/src/camera/watermark/ViewShotWatermark.d.ts.map +0 -1
- package/lib/typescript/src/camera/watermark/index.d.ts +0 -4
- package/lib/typescript/src/camera/watermark/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Back.d.ts +0 -20
- package/lib/typescript/src/components/Back.d.ts.map +0 -1
- package/lib/typescript/src/components/Delete.d.ts +0 -7
- package/lib/typescript/src/components/Delete.d.ts.map +0 -1
- package/lib/typescript/src/components/Modal/Confirm.d.ts +0 -9
- package/lib/typescript/src/components/Modal/Confirm.d.ts.map +0 -1
- package/lib/typescript/src/components/Modal/index.d.ts +0 -3
- package/lib/typescript/src/components/Modal/index.d.ts.map +0 -1
- package/lib/typescript/src/components/Rotate.d.ts +0 -9
- package/lib/typescript/src/components/Rotate.d.ts.map +0 -1
- package/lib/typescript/src/components/Save.d.ts +0 -20
- package/lib/typescript/src/components/Save.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useCamera.tsx/index.d.ts +0 -5
- package/lib/typescript/src/hooks/useCamera.tsx/index.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useCreation/index.d.ts +0 -3
- package/lib/typescript/src/hooks/useCreation/index.d.ts.map +0 -1
- package/lib/typescript/src/utils/common.d.ts +0 -14
- package/lib/typescript/src/utils/common.d.ts.map +0 -1
- package/lib/typescript/src/utils/render-item.d.ts +0 -10
- package/lib/typescript/src/utils/render-item.d.ts.map +0 -1
- package/lib/typescript/src/utils/watermark.d.ts +0 -11
- package/lib/typescript/src/utils/watermark.d.ts.map +0 -1
- package/src/NativeReactNativeCamera.ts +0 -15
- package/src/assets/close.png +0 -0
- package/src/assets/home/record.png +0 -0
- package/src/assets/home/take.png +0 -0
- package/src/assets/preview/back.png +0 -0
- package/src/assets/preview/del.png +0 -0
- package/src/assets/preview/rotate.png +0 -0
- package/src/assets/preview/save.png +0 -0
- package/src/assets/tools/auto.png +0 -0
- package/src/assets/tools/defaultEye.png +0 -0
- package/src/assets/tools/enlarge.png +0 -0
- package/src/assets/tools/fishEye.png +0 -0
- package/src/assets/tools/narrow.png +0 -0
- package/src/assets/tools/off.png +0 -0
- package/src/assets/tools/on.png +0 -0
- package/src/assets/tools/volumeOff.png +0 -0
- package/src/assets/tools/volumeOn.png +0 -0
- package/src/camera/watermark/Render.tsx +0 -128
- package/src/camera/watermark/ViewShotWatermark.tsx +0 -134
- package/src/camera/watermark/index.tsx +0 -12
- package/src/components/Back.tsx +0 -37
- package/src/components/Delete.tsx +0 -30
- package/src/components/Modal/Confirm.tsx +0 -116
- package/src/components/Modal/index.tsx +0 -3
- package/src/components/Rotate.tsx +0 -32
- package/src/components/Save.tsx +0 -37
- package/src/hooks/useCamera.tsx/index.tsx +0 -95
- package/src/hooks/useCreation/index.ts +0 -25
- package/src/utils/common.ts +0 -67
- package/src/utils/render-item.tsx +0 -39
- package/src/utils/watermark.ts +0 -55
|
@@ -1,34 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @Date: 2024-12-02 13:37:36
|
|
4
|
-
* @LastEditors: 刘利军
|
|
5
|
-
* @LastEditTime: 2024-12-27 13:29:19
|
|
6
|
-
* @Description:
|
|
7
|
-
* @PageName:
|
|
8
|
-
*/
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
9
3
|
import { StyleSheet, View } from 'react-native';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
import { SinglePre } from "./SinglePre.js";
|
|
5
|
+
import { PreView } from "./PreView.js";
|
|
6
|
+
import { PreviewFooter } from "./PreviewFooter.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
export function PreViewContainer({
|
|
9
|
+
files,
|
|
10
|
+
onRetake,
|
|
11
|
+
onConfirm
|
|
12
|
+
}) {
|
|
13
|
+
const first = files[0];
|
|
14
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
15
|
+
style: styles.root,
|
|
16
|
+
children: [files.length === 1 && first != null ? /*#__PURE__*/_jsx(SinglePre, {
|
|
17
|
+
file: first
|
|
18
|
+
}) : files.length > 1 ? /*#__PURE__*/_jsx(PreView, {
|
|
19
|
+
files: files
|
|
20
|
+
}) : null, /*#__PURE__*/_jsx(PreviewFooter, {
|
|
21
|
+
onRetake: onRetake,
|
|
22
|
+
onConfirm: onConfirm
|
|
23
|
+
})]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
23
26
|
const styles = StyleSheet.create({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
right: 0,
|
|
29
|
-
left: 0,
|
|
30
|
-
backgroundColor: '#fff',
|
|
31
|
-
zIndex: 19
|
|
27
|
+
// 预览容器固定黑底:相机 UX 惯例,与 SinglePre / PreView / SlideItem 一致.
|
|
28
|
+
root: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
backgroundColor: '#000'
|
|
32
31
|
}
|
|
33
32
|
});
|
|
34
33
|
//# sourceMappingURL=PreViewContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","View","
|
|
1
|
+
{"version":3,"names":["StyleSheet","View","SinglePre","PreView","PreviewFooter","jsx","_jsx","jsxs","_jsxs","PreViewContainer","files","onRetake","onConfirm","first","style","styles","root","children","length","file","create","flex","backgroundColor"],"sourceRoot":"../../../../src","sources":["camera/preview/PreViewContainer.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,aAAa,QAAQ,oBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQhD,OAAO,SAASC,gBAAgBA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,EAAE;EACtE,MAAMC,KAAK,GAAGH,KAAK,CAAC,CAAC,CAAC;EACtB,oBACEF,KAAA,CAACP,IAAI;IAACa,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAC,QAAA,GACtBP,KAAK,CAACQ,MAAM,KAAK,CAAC,IAAIL,KAAK,IAAI,IAAI,gBAClCP,IAAA,CAACJ,SAAS;MAACiB,IAAI,EAAEN;IAAM,CAAE,CAAC,GACxBH,KAAK,CAACQ,MAAM,GAAG,CAAC,gBAClBZ,IAAA,CAACH,OAAO;MAACO,KAAK,EAAEA;IAAM,CAAE,CAAC,GACvB,IAAI,eACRJ,IAAA,CAACF,aAAa;MAACO,QAAQ,EAAEA,QAAS;MAACC,SAAS,EAAEA;IAAU,CAAE,CAAC;EAAA,CACvD,CAAC;AAEX;AAEA,MAAMG,MAAM,GAAGf,UAAU,CAACoB,MAAM,CAAC;EAC/B;EACAJ,IAAI,EAAE;IAAEK,IAAI,EAAE,CAAC;IAAEC,eAAe,EAAE;EAAO;AAC3C,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @Date: 2024-12-16 09:21:56
|
|
4
|
-
* @LastEditors: 刘利军
|
|
5
|
-
* @LastEditTime: 2024-12-25 17:12:01
|
|
6
|
-
* @Description:
|
|
7
|
-
* @PageName:
|
|
8
|
-
*/
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
9
3
|
import { StyleSheet, View } from 'react-native';
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
import { Button, r } from '@unif/react-native-design';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
export function PreviewFooter({
|
|
7
|
+
onRetake,
|
|
8
|
+
onConfirm
|
|
9
|
+
}) {
|
|
10
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
11
|
+
style: styles.root,
|
|
12
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
13
|
+
variant: "ghost",
|
|
14
|
+
label: "\u91CD\u62CD",
|
|
15
|
+
onPress: onRetake,
|
|
16
|
+
testID: "retake-btn"
|
|
17
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
18
|
+
variant: "primary",
|
|
19
|
+
label: "\u4F7F\u7528\u7167\u7247",
|
|
20
|
+
onPress: onConfirm,
|
|
21
|
+
testID: "confirm-btn"
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
}
|
|
21
25
|
const styles = StyleSheet.create({
|
|
22
|
-
|
|
26
|
+
root: {
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
bottom: r(40),
|
|
29
|
+
left: 0,
|
|
30
|
+
right: 0,
|
|
23
31
|
flexDirection: 'row',
|
|
24
|
-
justifyContent: 'space-
|
|
32
|
+
justifyContent: 'space-around',
|
|
33
|
+
alignItems: 'center'
|
|
25
34
|
}
|
|
26
35
|
});
|
|
27
36
|
//# sourceMappingURL=PreviewFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","View","
|
|
1
|
+
{"version":3,"names":["StyleSheet","View","Button","r","jsx","_jsx","jsxs","_jsxs","PreviewFooter","onRetake","onConfirm","style","styles","root","children","variant","label","onPress","testID","create","position","bottom","left","right","flexDirection","justifyContent","alignItems"],"sourceRoot":"../../../../src","sources":["camera/preview/PreviewFooter.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,MAAM,EAAEC,CAAC,QAAQ,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOtD,OAAO,SAASC,aAAaA,CAAC;EAAEC,QAAQ;EAAEC;AAAiB,CAAC,EAAE;EAC5D,oBACEH,KAAA,CAACN,IAAI;IAACU,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAC,QAAA,gBACvBT,IAAA,CAACH,MAAM;MACLa,OAAO,EAAC,OAAO;MACfC,KAAK,EAAC,cAAI;MACVC,OAAO,EAAER,QAAS;MAClBS,MAAM,EAAC;IAAY,CACpB,CAAC,eACFb,IAAA,CAACH,MAAM;MACLa,OAAO,EAAC,SAAS;MACjBC,KAAK,EAAC,0BAAM;MACZC,OAAO,EAAEP,SAAU;MACnBQ,MAAM,EAAC;IAAa,CACrB,CAAC;EAAA,CACE,CAAC;AAEX;AAEA,MAAMN,MAAM,GAAGZ,UAAU,CAACmB,MAAM,CAAC;EAC/BN,IAAI,EAAE;IACJO,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAElB,CAAC,CAAC,EAAE,CAAC;IACbmB,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,cAAc;IAC9BC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,64 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @Date: 2024-12-16 09:54:00
|
|
4
|
-
* @LastEditors: 刘利军
|
|
5
|
-
* @LastEditTime: 2024-12-27 10:55:55
|
|
6
|
-
* @Description:
|
|
7
|
-
* @PageName:
|
|
8
|
-
*/
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
9
3
|
import { Image, StyleSheet, View } from 'react-native';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
key: "back",
|
|
37
|
-
style: styles.image,
|
|
38
|
-
text: "\u8FD4\u56DE",
|
|
39
|
-
onPress: onBack
|
|
40
|
-
}), /*#__PURE__*/React.createElement(Save, {
|
|
41
|
-
key: "save",
|
|
42
|
-
style: styles.image,
|
|
43
|
-
text: "\u4FDD\u5B58",
|
|
44
|
-
onPress: onSave
|
|
45
|
-
})]
|
|
46
|
-
})));
|
|
47
|
-
};
|
|
48
|
-
export default SinglePre;
|
|
49
|
-
export const styles = StyleSheet.create({
|
|
50
|
-
container: {
|
|
51
|
-
flex: 1
|
|
52
|
-
},
|
|
53
|
-
footer: {
|
|
54
|
-
position: 'absolute',
|
|
55
|
-
left: 0,
|
|
56
|
-
right: 0,
|
|
57
|
-
bottom: 0
|
|
58
|
-
},
|
|
59
|
-
image: {
|
|
60
|
-
width: 60,
|
|
61
|
-
height: 60
|
|
4
|
+
import { Empty } from '@unif/react-native-design';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export function SinglePre({
|
|
7
|
+
file
|
|
8
|
+
}) {
|
|
9
|
+
return /*#__PURE__*/_jsx(View, {
|
|
10
|
+
style: styles.root,
|
|
11
|
+
testID: "single-pre",
|
|
12
|
+
children: file.mime === 'video/mp4' ? /*#__PURE__*/_jsx(Empty, {
|
|
13
|
+
title: `视频 · ${file.duration?.toFixed(1) ?? '0.0'}s`,
|
|
14
|
+
desc: file.path
|
|
15
|
+
}) : /*#__PURE__*/_jsx(Image, {
|
|
16
|
+
source: {
|
|
17
|
+
uri: file.uri
|
|
18
|
+
},
|
|
19
|
+
style: StyleSheet.absoluteFill,
|
|
20
|
+
resizeMode: "contain"
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
// 相机预览容器固定黑底:相机 UX 惯例(任何主题下都需要让照片 / 视频在纯黑上凸显),
|
|
26
|
+
// 不走 c.background token.
|
|
27
|
+
root: {
|
|
28
|
+
flex: 1,
|
|
29
|
+
backgroundColor: '#000'
|
|
62
30
|
}
|
|
63
31
|
});
|
|
64
32
|
//# sourceMappingURL=SinglePre.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Image","StyleSheet","View","
|
|
1
|
+
{"version":3,"names":["Image","StyleSheet","View","Empty","jsx","_jsx","SinglePre","file","style","styles","root","testID","children","mime","title","duration","toFixed","desc","path","source","uri","absoluteFill","resizeMode","create","flex","backgroundColor"],"sourceRoot":"../../../../src","sources":["camera/preview/SinglePre.tsx"],"mappings":";;AAAA,SAASA,KAAK,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACtD,SAASC,KAAK,QAAQ,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAKlD,OAAO,SAASC,SAASA,CAAC;EAAEC;AAAY,CAAC,EAAE;EACzC,oBACEF,IAAA,CAACH,IAAI;IAACM,KAAK,EAAEC,MAAM,CAACC,IAAK;IAACC,MAAM,EAAC,YAAY;IAAAC,QAAA,EAC1CL,IAAI,CAACM,IAAI,KAAK,WAAW,gBACxBR,IAAA,CAACF,KAAK;MACJW,KAAK,EAAE,QAAQP,IAAI,CAACQ,QAAQ,EAAEC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,GAAI;MACrDC,IAAI,EAAEV,IAAI,CAACW;IAAK,CACjB,CAAC,gBAEFb,IAAA,CAACL,KAAK;MACJmB,MAAM,EAAE;QAAEC,GAAG,EAAEb,IAAI,CAACa;MAAI,CAAE;MAC1BZ,KAAK,EAAEP,UAAU,CAACoB,YAAa;MAC/BC,UAAU,EAAC;IAAS,CACrB;EACF,CACG,CAAC;AAEX;AAEA,MAAMb,MAAM,GAAGR,UAAU,CAACsB,MAAM,CAAC;EAC/B;EACA;EACAb,IAAI,EAAE;IAAEc,IAAI,EAAE,CAAC;IAAEC,eAAe,EAAE;EAAO;AAC3C,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* @PageName:
|
|
8
|
-
*/
|
|
9
|
-
import PreView from './PreView';
|
|
10
|
-
import SinglePre from './SinglePre';
|
|
11
|
-
import PreViewContainer from './PreViewContainer';
|
|
12
|
-
export { PreView, SinglePre, PreViewContainer };
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { SinglePre } from "./SinglePre.js";
|
|
4
|
+
export { PreView } from "./PreView.js";
|
|
5
|
+
export { PreviewFooter } from "./PreviewFooter.js";
|
|
6
|
+
export { PreViewContainer } from "./PreViewContainer.js";
|
|
13
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PreView","
|
|
1
|
+
{"version":3,"names":["SinglePre","PreView","PreviewFooter","PreViewContainer"],"sourceRoot":"../../../../src","sources":["camera/preview/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,gBAAa;AACvC,SAASC,OAAO,QAAQ,cAAW;AACnC,SAASC,aAAa,QAAQ,oBAAiB;AAC/C,SAASC,gBAAgB,QAAQ,uBAAoB","ignoreList":[]}
|
|
@@ -1,196 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
* @Author: 刘利军
|
|
3
|
-
* @Date: 2024-12-02 11:52:31
|
|
4
|
-
* @LastEditors: 刘利军
|
|
5
|
-
* @LastEditTime: 2025-01-21 11:10:20
|
|
6
|
-
* @Description:
|
|
7
|
-
* @PageName:
|
|
8
|
-
*/
|
|
9
|
-
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
10
|
-
import React, { useState } from 'react';
|
|
11
|
-
import { CONTROL_BUTTON_SIZE } from '../../utils';
|
|
12
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
13
|
-
const FlashOn = require('../../assets/tools/on.png');
|
|
14
|
-
const FlashOff = require('../../assets/tools/off.png');
|
|
15
|
-
const FlashAuto = require('../../assets/tools/auto.png');
|
|
16
|
-
const volumeOff = require('../../assets/tools/volumeOff.png');
|
|
17
|
-
const volumeOn = require('../../assets/tools/volumeOn.png');
|
|
18
|
-
const enlarge = require('../../assets/tools/enlarge.png');
|
|
19
|
-
const narrow = require('../../assets/tools/narrow.png');
|
|
20
|
-
const defaultEyeImage = require('../../assets/tools/defaultEye.png');
|
|
21
|
-
const defaultFishEyeImage = require('../../assets/tools/fishEye.png');
|
|
22
|
-
let volume = false;
|
|
23
|
-
let screen = true;
|
|
24
|
-
const SetUp = ({
|
|
25
|
-
isMultiCam,
|
|
26
|
-
onChange,
|
|
27
|
-
onAspectRationChange,
|
|
28
|
-
onScreenChange,
|
|
29
|
-
onVolumeChange,
|
|
30
|
-
onFishEyeOpen
|
|
31
|
-
}) => {
|
|
32
|
-
const [flashImage, setFlashImage] = useState(FlashOff);
|
|
33
|
-
const [volumeImage, setVolumeImage] = useState(volumeOff);
|
|
34
|
-
const [flashOpen, setFlashOpen] = useState(false);
|
|
35
|
-
const [screenImage, setScreenImage] = useState(narrow);
|
|
36
|
-
const [fishEyeOpen, setFishEyeOpen] = useState(false);
|
|
37
|
-
const [fishEyeImage, setFishEyeImage] = useState(defaultEyeImage);
|
|
38
|
-
const [openHeader, setOpenHeader] = useState(true);
|
|
39
|
-
const insets = useSafeAreaInsets();
|
|
1
|
+
"use strict";
|
|
40
2
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
setFlashImage(FlashAuto);
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
setFlashImage(FlashOff);
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
onChange(type);
|
|
55
|
-
setFlashOpen(false);
|
|
56
|
-
setOpenHeader(true);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
// 广角切换
|
|
60
|
-
const fishEyeChange = type => {
|
|
61
|
-
onFishEyeOpen(type);
|
|
62
|
-
setFishEyeImage(type === 'default' ? defaultEyeImage : defaultFishEyeImage);
|
|
63
|
-
setFishEyeOpen(false);
|
|
64
|
-
setOpenHeader(true);
|
|
65
|
-
};
|
|
66
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, openHeader && /*#__PURE__*/React.createElement(View, {
|
|
67
|
-
style: [styles.top, styles.header, {
|
|
68
|
-
top: insets.top + 10
|
|
69
|
-
}]
|
|
70
|
-
}), /*#__PURE__*/React.createElement(View, {
|
|
71
|
-
style: [styles.top, styles.tools, {
|
|
72
|
-
top: undefined,
|
|
73
|
-
bottom: insets.bottom + 125
|
|
74
|
-
}]
|
|
75
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
76
|
-
style: styles.tool
|
|
77
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
78
|
-
style: styles.toolImg,
|
|
79
|
-
onPress: () => {
|
|
80
|
-
setOpenHeader(false);
|
|
81
|
-
setFlashOpen(val => !val);
|
|
82
|
-
}
|
|
83
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
84
|
-
source: flashImage,
|
|
85
|
-
style: styles.toolImg
|
|
86
|
-
})), flashOpen && /*#__PURE__*/React.createElement(View, {
|
|
87
|
-
style: styles.toolSetting
|
|
88
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
89
|
-
onPress: () => falshChange('auto'),
|
|
90
|
-
style: styles.toolText
|
|
91
|
-
}, "\u81EA\u52A8"), /*#__PURE__*/React.createElement(Text, {
|
|
92
|
-
onPress: () => falshChange('on'),
|
|
93
|
-
style: styles.toolText
|
|
94
|
-
}, "\u6253\u5F00"), /*#__PURE__*/React.createElement(Text, {
|
|
95
|
-
onPress: () => falshChange('off'),
|
|
96
|
-
style: styles.toolText
|
|
97
|
-
}, "\u5173\u95ED"))), /*#__PURE__*/React.createElement(View, {
|
|
98
|
-
style: styles.tool
|
|
99
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
100
|
-
style: styles.toolImg,
|
|
101
|
-
onPress: () => {
|
|
102
|
-
if (volume) {
|
|
103
|
-
setVolumeImage(volumeOff);
|
|
104
|
-
} else {
|
|
105
|
-
setVolumeImage(volumeOn);
|
|
106
|
-
}
|
|
107
|
-
volume = !volume;
|
|
108
|
-
onVolumeChange(volume);
|
|
109
|
-
}
|
|
110
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
111
|
-
source: volumeImage,
|
|
112
|
-
style: styles.toolImg
|
|
113
|
-
}))), /*#__PURE__*/React.createElement(View, {
|
|
114
|
-
style: styles.tool
|
|
115
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
116
|
-
style: styles.toolImg,
|
|
117
|
-
onPress: () => {
|
|
118
|
-
if (screen) {
|
|
119
|
-
setScreenImage(enlarge);
|
|
120
|
-
} else {
|
|
121
|
-
setScreenImage(narrow);
|
|
122
|
-
}
|
|
123
|
-
onScreenChange(screen ? 'contain' : 'cover');
|
|
124
|
-
onAspectRationChange(screen ? 4 : 16);
|
|
125
|
-
screen = !screen;
|
|
126
|
-
}
|
|
127
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
128
|
-
source: screenImage,
|
|
129
|
-
style: styles.toolImg
|
|
130
|
-
}))), isMultiCam && /*#__PURE__*/React.createElement(View, {
|
|
131
|
-
style: styles.tool
|
|
132
|
-
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
133
|
-
style: styles.toolImg,
|
|
134
|
-
onPress: () => {
|
|
135
|
-
setOpenHeader(false);
|
|
136
|
-
setFishEyeOpen(val => !val);
|
|
137
|
-
}
|
|
138
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
139
|
-
source: fishEyeImage,
|
|
140
|
-
style: styles.toolImg
|
|
141
|
-
})), fishEyeOpen && /*#__PURE__*/React.createElement(View, {
|
|
142
|
-
style: styles.toolSetting
|
|
143
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
144
|
-
onPress: () => fishEyeChange('default'),
|
|
145
|
-
style: styles.toolText
|
|
146
|
-
}, "\u9ED8\u8BA4"), /*#__PURE__*/React.createElement(Text, {
|
|
147
|
-
onPress: () => fishEyeChange('fishEye'),
|
|
148
|
-
style: styles.toolText
|
|
149
|
-
}, "\u5E7F\u89D2")))));
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
|
+
import { Chip, Icon, r, useColors } from '@unif/react-native-design';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const flashLabel = {
|
|
7
|
+
off: '闪关',
|
|
8
|
+
on: '闪开',
|
|
9
|
+
auto: '自动'
|
|
150
10
|
};
|
|
151
|
-
|
|
11
|
+
const flashOrder = ['off', 'auto', 'on'];
|
|
12
|
+
const flashIconMap = {
|
|
13
|
+
off: 'flash-off',
|
|
14
|
+
on: 'flash-on',
|
|
15
|
+
auto: 'flash-auto'
|
|
16
|
+
};
|
|
17
|
+
export function SetUp({
|
|
18
|
+
flash,
|
|
19
|
+
aspectRatio,
|
|
20
|
+
onChangeFlash,
|
|
21
|
+
onChangeAspectRatio,
|
|
22
|
+
onToggleLens,
|
|
23
|
+
lensLabel
|
|
24
|
+
}) {
|
|
25
|
+
const c = useColors();
|
|
26
|
+
const nextFlash = () => {
|
|
27
|
+
const i = flashOrder.indexOf(flash);
|
|
28
|
+
const next = flashOrder[(i + 1) % flashOrder.length];
|
|
29
|
+
onChangeFlash(next);
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
32
|
+
style: styles.root,
|
|
33
|
+
children: [/*#__PURE__*/_jsx(Chip, {
|
|
34
|
+
label: flashLabel[flash],
|
|
35
|
+
leading: /*#__PURE__*/_jsx(Icon, {
|
|
36
|
+
name: flashIconMap[flash],
|
|
37
|
+
size: r(14),
|
|
38
|
+
color: c.foreground
|
|
39
|
+
}),
|
|
40
|
+
onPress: nextFlash,
|
|
41
|
+
selected: flash !== 'off',
|
|
42
|
+
testID: "flash-btn"
|
|
43
|
+
}), /*#__PURE__*/_jsx(Chip, {
|
|
44
|
+
label: aspectRatio,
|
|
45
|
+
leading: /*#__PURE__*/_jsx(Icon, {
|
|
46
|
+
name: aspectRatio === '4:3' ? 'aspect-4-3' : 'aspect-16-9',
|
|
47
|
+
size: r(14),
|
|
48
|
+
color: c.foreground
|
|
49
|
+
}),
|
|
50
|
+
onPress: () => onChangeAspectRatio(aspectRatio === '4:3' ? '16:9' : '4:3'),
|
|
51
|
+
testID: "aspect-btn"
|
|
52
|
+
}), /*#__PURE__*/_jsx(Chip, {
|
|
53
|
+
label: lensLabel,
|
|
54
|
+
leading: /*#__PURE__*/_jsx(Icon, {
|
|
55
|
+
name: "lens-flip",
|
|
56
|
+
size: r(14),
|
|
57
|
+
color: c.foreground
|
|
58
|
+
}),
|
|
59
|
+
onPress: onToggleLens,
|
|
60
|
+
testID: "lens-btn"
|
|
61
|
+
})]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
152
64
|
const styles = StyleSheet.create({
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
marginHorizontal: 20,
|
|
159
|
-
bottom: undefined,
|
|
160
|
-
zIndex: 9
|
|
161
|
-
},
|
|
162
|
-
header: {
|
|
163
|
-
display: 'flex',
|
|
164
|
-
alignItems: 'center'
|
|
165
|
-
},
|
|
166
|
-
tools: {
|
|
167
|
-
display: 'flex',
|
|
168
|
-
width: '100%'
|
|
169
|
-
},
|
|
170
|
-
tool: {
|
|
171
|
-
display: 'flex',
|
|
65
|
+
root: {
|
|
66
|
+
position: 'absolute',
|
|
67
|
+
top: r(60),
|
|
68
|
+
left: r(16),
|
|
69
|
+
right: r(16),
|
|
172
70
|
flexDirection: 'row',
|
|
173
|
-
|
|
174
|
-
height: CONTROL_BUTTON_SIZE / 2,
|
|
175
|
-
alignItems: 'center',
|
|
176
|
-
marginBottom: 8
|
|
177
|
-
},
|
|
178
|
-
toolImg: {
|
|
179
|
-
width: CONTROL_BUTTON_SIZE / 2,
|
|
180
|
-
height: '100%'
|
|
181
|
-
},
|
|
182
|
-
toolSetting: {
|
|
183
|
-
display: 'flex',
|
|
184
|
-
flexDirection: 'row'
|
|
185
|
-
},
|
|
186
|
-
toolText: {
|
|
187
|
-
marginLeft: 8,
|
|
188
|
-
fontWeight: '900',
|
|
189
|
-
color: '#fff'
|
|
190
|
-
},
|
|
191
|
-
headerLeft: {
|
|
192
|
-
display: 'flex',
|
|
193
|
-
flexDirection: 'row'
|
|
71
|
+
justifyContent: 'space-between'
|
|
194
72
|
}
|
|
195
73
|
});
|
|
196
74
|
//# sourceMappingURL=SetUp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["StyleSheet","View","Chip","Icon","r","useColors","jsx","_jsx","jsxs","_jsxs","flashLabel","off","on","auto","flashOrder","flashIconMap","SetUp","flash","aspectRatio","onChangeFlash","onChangeAspectRatio","onToggleLens","lensLabel","c","nextFlash","i","indexOf","next","length","style","styles","root","children","label","leading","name","size","color","foreground","onPress","selected","testID","create","position","top","left","right","flexDirection","justifyContent"],"sourceRoot":"../../../../src","sources":["camera/setup/SetUp.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SACEC,IAAI,EACJC,IAAI,EACJC,CAAC,EACDC,SAAS,QAEJ,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAcnC,MAAMC,UAAqC,GAAG;EAC5CC,GAAG,EAAE,IAAI;EACTC,EAAE,EAAE,IAAI;EACRC,IAAI,EAAE;AACR,CAAC;AACD,MAAMC,UAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC;AAErD,MAAMC,YAAyC,GAAG;EAChDJ,GAAG,EAAE,WAAW;EAChBC,EAAE,EAAE,UAAU;EACdC,IAAI,EAAE;AACR,CAAC;AAED,OAAO,SAASG,KAAKA,CAAC;EACpBC,KAAK;EACLC,WAAW;EACXC,aAAa;EACbC,mBAAmB;EACnBC,YAAY;EACZC;AACK,CAAC,EAAE;EACR,MAAMC,CAAC,GAAGlB,SAAS,CAAC,CAAC;EACrB,MAAMmB,SAAS,GAAGA,CAAA,KAAM;IACtB,MAAMC,CAAC,GAAGX,UAAU,CAACY,OAAO,CAACT,KAAK,CAAC;IACnC,MAAMU,IAAI,GAAGb,UAAU,CAAC,CAACW,CAAC,GAAG,CAAC,IAAIX,UAAU,CAACc,MAAM,CAAc;IACjET,aAAa,CAACQ,IAAI,CAAC;EACrB,CAAC;EACD,oBACElB,KAAA,CAACR,IAAI;IAAC4B,KAAK,EAAEC,MAAM,CAACC,IAAK;IAAAC,QAAA,gBACvBzB,IAAA,CAACL,IAAI;MACH+B,KAAK,EAAEvB,UAAU,CAACO,KAAK,CAAE;MACzBiB,OAAO,eACL3B,IAAA,CAACJ,IAAI;QAACgC,IAAI,EAAEpB,YAAY,CAACE,KAAK,CAAE;QAACmB,IAAI,EAAEhC,CAAC,CAAC,EAAE,CAAE;QAACiC,KAAK,EAAEd,CAAC,CAACe;MAAW,CAAE,CACrE;MACDC,OAAO,EAAEf,SAAU;MACnBgB,QAAQ,EAAEvB,KAAK,KAAK,KAAM;MAC1BwB,MAAM,EAAC;IAAW,CACnB,CAAC,eACFlC,IAAA,CAACL,IAAI;MACH+B,KAAK,EAAEf,WAAY;MACnBgB,OAAO,eACL3B,IAAA,CAACJ,IAAI;QACHgC,IAAI,EAAEjB,WAAW,KAAK,KAAK,GAAG,YAAY,GAAG,aAAc;QAC3DkB,IAAI,EAAEhC,CAAC,CAAC,EAAE,CAAE;QACZiC,KAAK,EAAEd,CAAC,CAACe;MAAW,CACrB,CACF;MACDC,OAAO,EAAEA,CAAA,KACPnB,mBAAmB,CAACF,WAAW,KAAK,KAAK,GAAG,MAAM,GAAG,KAAK,CAC3D;MACDuB,MAAM,EAAC;IAAY,CACpB,CAAC,eACFlC,IAAA,CAACL,IAAI;MACH+B,KAAK,EAAEX,SAAU;MACjBY,OAAO,eAAE3B,IAAA,CAACJ,IAAI;QAACgC,IAAI,EAAC,WAAW;QAACC,IAAI,EAAEhC,CAAC,CAAC,EAAE,CAAE;QAACiC,KAAK,EAAEd,CAAC,CAACe;MAAW,CAAE,CAAE;MACrEC,OAAO,EAAElB,YAAa;MACtBoB,MAAM,EAAC;IAAU,CAClB,CAAC;EAAA,CACE,CAAC;AAEX;AAEA,MAAMX,MAAM,GAAG9B,UAAU,CAAC0C,MAAM,CAAC;EAC/BX,IAAI,EAAE;IACJY,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAExC,CAAC,CAAC,EAAE,CAAC;IACVyC,IAAI,EAAEzC,CAAC,CAAC,EAAE,CAAC;IACX0C,KAAK,EAAE1C,CAAC,CAAC,EAAE,CAAC;IACZ2C,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["SetUp"],"sourceRoot":"../../../../src","sources":["camera/setup/index.tsx"],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"names":["SetUp"],"sourceRoot":"../../../../src","sources":["camera/setup/index.tsx"],"mappings":";;AAAA,SAASA,KAAK,QAA0C,YAAS","ignoreList":[]}
|