react-isoform 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +104 -2
- package/android/build.gradle +212 -0
- package/android/consumer-rules.pro +10 -0
- package/android/src/audio/java/com/isoform/IsoAudioControls.kt +531 -0
- package/android/src/audio/java/com/isoform/IsoAudioView.kt +328 -0
- package/android/src/audio/java/com/isoform/IsoAudioViewManager.kt +88 -0
- package/android/src/camera/AndroidManifest.xml +6 -0
- package/android/src/camera/java/com/isoform/IsoCamera.kt +99 -0
- package/android/src/camera/java/com/isoform/IsoCameraController.kt +232 -0
- package/android/src/camera/java/com/isoform/IsoCameraLifecycle.kt +26 -0
- package/android/src/camera/java/com/isoform/IsoCameraView.kt +392 -0
- package/android/src/camera/java/com/isoform/IsoCameraViewManager.kt +76 -0
- package/android/src/cameraCodes/java/com/isoform/IsoCodeScanner.kt +90 -0
- package/android/src/cameraCodesOff/java/com/isoform/IsoCodeScanner.kt +17 -0
- package/android/src/cameraVideo/AndroidManifest.xml +4 -0
- package/android/src/cameraVideo/java/com/isoform/IsoCameraRecorder.kt +83 -0
- package/android/src/cameraVideoOff/java/com/isoform/IsoCameraRecorder.kt +22 -0
- package/android/src/datePicker/java/com/isoform/IsoDatePicker.kt +724 -0
- package/android/src/datePicker/java/com/isoform/IsoDatePickerView.kt +137 -0
- package/android/src/datePicker/java/com/isoform/IsoDatePickerViewManager.kt +56 -0
- package/android/src/image/java/com/isoform/IsoImageModule.kt +33 -0
- package/android/src/image/java/com/isoform/IsoImagePipeline.kt +516 -0
- package/android/src/image/java/com/isoform/IsoImageView.kt +573 -0
- package/android/src/image/java/com/isoform/IsoImageViewManager.kt +119 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/isoform/IsoformPackage.kt +52 -0
- package/android/src/mediaSession/AndroidManifest.xml +18 -0
- package/android/src/mediaSession/java/com/isoform/IsoMediaService.kt +21 -0
- package/android/src/mediaSession/java/com/isoform/IsoMediaSession.kt +92 -0
- package/android/src/mediaSessionOff/java/com/isoform/IsoMediaSession.kt +18 -0
- package/android/src/modal/java/com/isoform/IsoModal.kt +182 -0
- package/android/src/modal/java/com/isoform/IsoModalView.kt +137 -0
- package/android/src/modal/java/com/isoform/IsoModalViewManager.kt +70 -0
- package/android/src/pdf/java/com/isoform/IsoPdfDocument.kt +157 -0
- package/android/src/pdf/java/com/isoform/IsoPdfEngine.kt +161 -0
- package/android/src/pdf/java/com/isoform/IsoPdfIcons.kt +76 -0
- package/android/src/pdf/java/com/isoform/IsoPdfReader.kt +176 -0
- package/android/src/pdf/java/com/isoform/IsoPdfView.kt +372 -0
- package/android/src/pdf/java/com/isoform/IsoPdfViewManager.kt +100 -0
- package/android/src/pdf/java/com/isoform/IsoPdfViewer.kt +849 -0
- package/android/src/sheet/java/com/isoform/IsoSheet.kt +247 -0
- package/android/src/sheet/java/com/isoform/IsoSheetView.kt +188 -0
- package/android/src/sheet/java/com/isoform/IsoSheetViewManager.kt +76 -0
- package/android/src/video/java/com/isoform/IsoVideoControls.kt +921 -0
- package/android/src/video/java/com/isoform/IsoVideoPlaylistPanel.kt +247 -0
- package/android/src/video/java/com/isoform/IsoVideoView.kt +324 -0
- package/android/src/video/java/com/isoform/IsoVideoViewManager.kt +84 -0
- package/babel.js +133 -0
- package/dist/adapters/react-dom/adapter.d.ts +3 -0
- package/dist/adapters/react-dom/adapter.js +108 -0
- package/dist/adapters/react-dom/camera/CameraElement.d.ts +15 -0
- package/dist/adapters/react-dom/camera/CameraElement.js +293 -0
- package/dist/adapters/react-dom/camera/LazyCamera.d.ts +4 -0
- package/dist/adapters/react-dom/camera/LazyCamera.js +21 -0
- package/dist/adapters/react-dom/camera/webCamera.d.ts +27 -0
- package/dist/adapters/react-dom/camera/webCamera.js +51 -0
- package/dist/adapters/react-dom/css/sheet.d.ts +43 -0
- package/dist/adapters/react-dom/css/sheet.js +183 -0
- package/dist/adapters/react-dom/datePicker/DatePicker.d.ts +19 -0
- package/dist/adapters/react-dom/datePicker/DatePicker.js +31 -0
- package/dist/adapters/react-dom/image/Image.d.ts +23 -0
- package/dist/adapters/react-dom/image/Image.js +256 -0
- package/dist/adapters/react-dom/media/audio/AudioControls.d.ts +44 -0
- package/dist/adapters/react-dom/media/audio/AudioControls.js +53 -0
- package/dist/adapters/react-dom/media/audio/AudioElement.d.ts +18 -0
- package/dist/adapters/react-dom/media/audio/AudioElement.js +139 -0
- package/dist/adapters/react-dom/media/audio/LazyAudio.d.ts +3 -0
- package/dist/adapters/react-dom/media/audio/LazyAudio.js +22 -0
- package/dist/adapters/react-dom/media/audio/audioStyles.d.ts +3 -0
- package/dist/adapters/react-dom/media/audio/audioStyles.js +52 -0
- package/dist/adapters/react-dom/media/index.d.ts +4 -0
- package/dist/adapters/react-dom/media/index.js +10 -0
- package/dist/adapters/react-dom/media/pdf/LazyPdf.d.ts +4 -0
- package/dist/adapters/react-dom/media/pdf/LazyPdf.js +22 -0
- package/dist/adapters/react-dom/media/pdf/PdfElement.d.ts +20 -0
- package/dist/adapters/react-dom/media/pdf/PdfElement.js +622 -0
- package/dist/adapters/react-dom/media/pdf/PdfPage.d.ts +31 -0
- package/dist/adapters/react-dom/media/pdf/PdfPage.js +154 -0
- package/dist/adapters/react-dom/media/pdf/PdfThumbnails.d.ts +12 -0
- package/dist/adapters/react-dom/media/pdf/PdfThumbnails.js +56 -0
- package/dist/adapters/react-dom/media/pdf/PdfToolbar.d.ts +82 -0
- package/dist/adapters/react-dom/media/pdf/PdfToolbar.js +92 -0
- package/dist/adapters/react-dom/media/pdf/pdfDocument.d.ts +90 -0
- package/dist/adapters/react-dom/media/pdf/pdfDocument.js +118 -0
- package/dist/adapters/react-dom/media/pdf/pdfStyles.d.ts +3 -0
- package/dist/adapters/react-dom/media/pdf/pdfStyles.js +107 -0
- package/dist/adapters/react-dom/media/pdf/pdfjs.d.ts +12 -0
- package/dist/adapters/react-dom/media/pdf/pdfjs.js +31 -0
- package/dist/adapters/react-dom/media/pdf/readAloud.d.ts +27 -0
- package/dist/adapters/react-dom/media/pdf/readAloud.js +136 -0
- package/dist/adapters/react-dom/media/pdf/search.d.ts +48 -0
- package/dist/adapters/react-dom/media/pdf/search.js +57 -0
- package/dist/adapters/react-dom/media/shared/Playlist.d.ts +21 -0
- package/dist/adapters/react-dom/media/shared/Playlist.js +240 -0
- package/dist/adapters/react-dom/media/shared/Track.d.ts +21 -0
- package/dist/adapters/react-dom/media/shared/Track.js +47 -0
- package/dist/adapters/react-dom/media/shared/controlStyles.d.ts +3 -0
- package/dist/adapters/react-dom/media/shared/controlStyles.js +46 -0
- package/dist/adapters/react-dom/media/shared/helpers.d.ts +22 -0
- package/dist/adapters/react-dom/media/shared/helpers.js +46 -0
- package/dist/adapters/react-dom/media/shared/icons.d.ts +49 -0
- package/dist/adapters/react-dom/media/shared/icons.js +52 -0
- package/dist/adapters/react-dom/media/shared/playlistHandle.d.ts +13 -0
- package/dist/adapters/react-dom/media/shared/playlistHandle.js +17 -0
- package/dist/adapters/react-dom/media/shared/withPlaylist.d.ts +4 -0
- package/dist/adapters/react-dom/media/shared/withPlaylist.js +24 -0
- package/dist/adapters/react-dom/media/video/LazyVideo.d.ts +4 -0
- package/dist/adapters/react-dom/media/video/LazyVideo.js +22 -0
- package/dist/adapters/react-dom/media/video/VideoControls.d.ts +43 -0
- package/dist/adapters/react-dom/media/video/VideoControls.js +89 -0
- package/dist/adapters/react-dom/media/video/VideoElement.d.ts +19 -0
- package/dist/adapters/react-dom/media/video/VideoElement.js +161 -0
- package/dist/adapters/react-dom/media/video/fullscreen.d.ts +17 -0
- package/dist/adapters/react-dom/media/video/fullscreen.js +43 -0
- package/dist/adapters/react-dom/media/video/pictureInPicture.d.ts +11 -0
- package/dist/adapters/react-dom/media/video/pictureInPicture.js +34 -0
- package/dist/adapters/react-dom/media/video/videoStyles.d.ts +3 -0
- package/dist/adapters/react-dom/media/video/videoStyles.js +49 -0
- package/dist/adapters/react-dom/modal/LazyModal.d.ts +8 -0
- package/dist/adapters/react-dom/modal/LazyModal.js +22 -0
- package/dist/adapters/react-dom/modal/Modal.d.ts +16 -0
- package/dist/adapters/react-dom/modal/Modal.js +101 -0
- package/dist/adapters/react-dom/normalize/domProps.d.ts +9 -0
- package/dist/adapters/react-dom/normalize/domProps.js +279 -0
- package/dist/adapters/react-dom/normalize/props.d.ts +5 -0
- package/dist/adapters/react-dom/normalize/props.js +258 -0
- package/dist/adapters/react-dom/normalize/style.d.ts +14 -0
- package/dist/adapters/react-dom/normalize/style.js +165 -0
- package/dist/adapters/react-dom/primitives.d.ts +6 -0
- package/dist/adapters/react-dom/primitives.js +37 -0
- package/dist/adapters/react-dom/sheet/LazySheet.d.ts +7 -0
- package/dist/adapters/react-dom/sheet/LazySheet.js +26 -0
- package/dist/adapters/react-dom/sheet/SheetElement.d.ts +17 -0
- package/dist/adapters/react-dom/sheet/SheetElement.js +223 -0
- package/dist/adapters/react-dom/sheet/sheetStyles.d.ts +3 -0
- package/dist/adapters/react-dom/sheet/sheetStyles.js +36 -0
- package/dist/adapters/react-dom/svg/elements.d.ts +5 -0
- package/dist/adapters/react-dom/svg/elements.js +32 -0
- package/dist/adapters/react-dom/themeToggle.bench.d.ts +2 -0
- package/dist/adapters/react-dom/themeToggle.bench.js +111 -0
- package/dist/adapters/react-native/adapter.d.ts +24 -0
- package/dist/adapters/react-native/adapter.js +356 -0
- package/dist/adapters/react-native/animatedHost.d.ts +21 -0
- package/dist/adapters/react-native/animatedHost.js +84 -0
- package/dist/adapters/react-native/animation.d.ts +63 -0
- package/dist/adapters/react-native/animation.js +340 -0
- package/dist/adapters/react-native/breakpoint.bench.d.ts +2 -0
- package/dist/adapters/react-native/breakpoint.bench.js +112 -0
- package/dist/adapters/react-native/camera/Camera.d.ts +12 -0
- package/dist/adapters/react-native/camera/Camera.disabled.d.ts +8 -0
- package/dist/adapters/react-native/camera/Camera.disabled.js +14 -0
- package/dist/adapters/react-native/camera/Camera.js +103 -0
- package/dist/adapters/react-native/camera/native/IsoCameraViewNativeComponent.d.ts +83 -0
- package/dist/adapters/react-native/camera/native/IsoCameraViewNativeComponent.js +6 -0
- package/dist/adapters/react-native/datePicker/DatePicker.d.ts +16 -0
- package/dist/adapters/react-native/datePicker/DatePicker.disabled.d.ts +10 -0
- package/dist/adapters/react-native/datePicker/DatePicker.disabled.js +13 -0
- package/dist/adapters/react-native/datePicker/DatePicker.js +43 -0
- package/dist/adapters/react-native/datePicker/native/IsoDatePickerViewNativeComponent.d.ts +35 -0
- package/dist/adapters/react-native/datePicker/native/IsoDatePickerViewNativeComponent.js +13 -0
- package/dist/adapters/react-native/image/Image.d.ts +26 -0
- package/dist/adapters/react-native/image/Image.disabled.d.ts +7 -0
- package/dist/adapters/react-native/image/Image.disabled.js +7 -0
- package/dist/adapters/react-native/image/Image.js +56 -0
- package/dist/adapters/react-native/image/PlainImage.d.ts +18 -0
- package/dist/adapters/react-native/image/PlainImage.js +18 -0
- package/dist/adapters/react-native/image/imageCache.d.ts +4 -0
- package/dist/adapters/react-native/image/imageCache.js +17 -0
- package/dist/adapters/react-native/image/native/IsoImageViewNativeComponent.d.ts +86 -0
- package/dist/adapters/react-native/image/native/IsoImageViewNativeComponent.js +14 -0
- package/dist/adapters/react-native/image/native/NativeIsoImageModule.d.ts +17 -0
- package/dist/adapters/react-native/image/native/NativeIsoImageModule.js +9 -0
- package/dist/adapters/react-native/media/audio/Audio.d.ts +19 -0
- package/dist/adapters/react-native/media/audio/Audio.disabled.d.ts +8 -0
- package/dist/adapters/react-native/media/audio/Audio.disabled.js +16 -0
- package/dist/adapters/react-native/media/audio/Audio.js +40 -0
- package/dist/adapters/react-native/media/audio/native/IsoAudioViewNativeComponent.d.ts +77 -0
- package/dist/adapters/react-native/media/audio/native/IsoAudioViewNativeComponent.js +6 -0
- package/dist/adapters/react-native/media/index.d.ts +4 -0
- package/dist/adapters/react-native/media/index.js +9 -0
- package/dist/adapters/react-native/media/pdf/Pdf.d.ts +19 -0
- package/dist/adapters/react-native/media/pdf/Pdf.disabled.d.ts +9 -0
- package/dist/adapters/react-native/media/pdf/Pdf.disabled.js +16 -0
- package/dist/adapters/react-native/media/pdf/Pdf.js +46 -0
- package/dist/adapters/react-native/media/pdf/native/IsoPdfViewNativeComponent.d.ts +77 -0
- package/dist/adapters/react-native/media/pdf/native/IsoPdfViewNativeComponent.js +6 -0
- package/dist/adapters/react-native/media/shared/Playlist.d.ts +18 -0
- package/dist/adapters/react-native/media/shared/Playlist.js +242 -0
- package/dist/adapters/react-native/media/video/Video.d.ts +25 -0
- package/dist/adapters/react-native/media/video/Video.disabled.d.ts +9 -0
- package/dist/adapters/react-native/media/video/Video.disabled.js +16 -0
- package/dist/adapters/react-native/media/video/Video.js +46 -0
- package/dist/adapters/react-native/media/video/native/IsoVideoViewNativeComponent.d.ts +87 -0
- package/dist/adapters/react-native/media/video/native/IsoVideoViewNativeComponent.js +6 -0
- package/dist/adapters/react-native/miss.bench.d.ts +2 -0
- package/dist/adapters/react-native/miss.bench.js +78 -0
- package/dist/adapters/react-native/modal/Modal.d.ts +18 -0
- package/dist/adapters/react-native/modal/Modal.disabled.d.ts +7 -0
- package/dist/adapters/react-native/modal/Modal.disabled.js +7 -0
- package/dist/adapters/react-native/modal/Modal.js +71 -0
- package/dist/adapters/react-native/modal/PlainModal.d.ts +16 -0
- package/dist/adapters/react-native/modal/PlainModal.js +26 -0
- package/dist/adapters/react-native/modal/native/IsoModalViewNativeComponent.d.ts +35 -0
- package/dist/adapters/react-native/modal/native/IsoModalViewNativeComponent.js +14 -0
- package/dist/adapters/react-native/normalize.d.ts +13 -0
- package/dist/adapters/react-native/normalize.js +221 -0
- package/dist/adapters/react-native/pseudo.d.ts +27 -0
- package/dist/adapters/react-native/pseudo.js +39 -0
- package/dist/adapters/react-native/sheet/BottomSheet.d.ts +12 -0
- package/dist/adapters/react-native/sheet/BottomSheet.disabled.d.ts +8 -0
- package/dist/adapters/react-native/sheet/BottomSheet.disabled.js +14 -0
- package/dist/adapters/react-native/sheet/BottomSheet.js +89 -0
- package/dist/adapters/react-native/sheet/native/IsoSheetViewNativeComponent.d.ts +40 -0
- package/dist/adapters/react-native/sheet/native/IsoSheetViewNativeComponent.js +14 -0
- package/dist/adapters/react-native/styleHost.d.ts +21 -0
- package/dist/adapters/react-native/styleHost.js +72 -0
- package/dist/adapters/react-native/svg/Svg.d.ts +5 -0
- package/dist/adapters/react-native/svg/Svg.disabled.d.ts +5 -0
- package/dist/adapters/react-native/svg/Svg.disabled.js +18 -0
- package/dist/adapters/react-native/svg/Svg.js +60 -0
- package/dist/adapters/react-native/transition.d.ts +41 -0
- package/dist/adapters/react-native/transition.js +145 -0
- package/dist/adapters/react-native/transitionHost.d.ts +11 -0
- package/dist/adapters/react-native/transitionHost.js +147 -0
- package/dist/adapters/react-native/windowWidth.d.ts +15 -0
- package/dist/adapters/react-native/windowWidth.js +49 -0
- package/dist/cache/lru.d.ts +11 -0
- package/dist/cache/lru.js +32 -0
- package/dist/config/index.d.ts +239 -0
- package/dist/config/index.js +161 -0
- package/dist/core/adapter.d.ts +72 -0
- package/dist/core/adapter.js +2 -0
- package/dist/core/builder.d.ts +95 -0
- package/dist/core/builder.js +431 -0
- package/dist/core/camera.d.ts +142 -0
- package/dist/core/camera.js +43 -0
- package/dist/core/cameraRequests.d.ts +18 -0
- package/dist/core/cameraRequests.js +44 -0
- package/dist/core/conditions.d.ts +54 -0
- package/dist/core/conditions.js +123 -0
- package/dist/core/datePicker.d.ts +92 -0
- package/dist/core/datePicker.js +92 -0
- package/dist/core/dev.d.ts +5 -0
- package/dist/core/dev.js +18 -0
- package/dist/core/engine.d.ts +62 -0
- package/dist/core/engine.js +26 -0
- package/dist/core/flatten.d.ts +6 -0
- package/dist/core/flatten.js +22 -0
- package/dist/core/image.d.ts +246 -0
- package/dist/core/image.js +171 -0
- package/dist/core/inline.d.ts +33 -0
- package/dist/core/inline.js +25 -0
- package/dist/core/keyframes.d.ts +40 -0
- package/dist/core/keyframes.js +38 -0
- package/dist/core/media.d.ts +118 -0
- package/dist/core/media.js +2 -0
- package/dist/core/modal.d.ts +76 -0
- package/dist/core/modal.js +35 -0
- package/dist/core/modules.d.ts +7 -0
- package/dist/core/modules.js +9 -0
- package/dist/core/pdf.d.ts +133 -0
- package/dist/core/pdf.js +2 -0
- package/dist/core/playlist.d.ts +97 -0
- package/dist/core/playlist.js +58 -0
- package/dist/core/primitives.d.ts +410 -0
- package/dist/core/primitives.js +2 -0
- package/dist/core/proxy.d.ts +2 -0
- package/dist/core/proxy.js +25 -0
- package/dist/core/sheet.d.ts +95 -0
- package/dist/core/sheet.js +71 -0
- package/dist/core/style/types.d.ts +88 -0
- package/dist/core/style/types.js +2 -0
- package/dist/core/svg.d.ts +121 -0
- package/dist/core/svg.js +76 -0
- package/dist/core/testing/benchHarness.d.ts +42 -0
- package/dist/core/testing/benchHarness.js +75 -0
- package/dist/core/types.d.ts +222 -0
- package/dist/core/types.js +2 -0
- package/dist/hash/optimizedHash.d.ts +10 -0
- package/dist/hash/optimizedHash.js +63 -0
- package/dist/hash/stringHash.d.ts +6 -0
- package/dist/hash/stringHash.js +17 -0
- package/dist/hash/trackReads.d.ts +20 -0
- package/dist/hash/trackReads.js +49 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +21 -0
- package/dist/jsx-dev-runtime.d.ts +7 -0
- package/dist/jsx-dev-runtime.js +13 -0
- package/dist/jsx-runtime.d.ts +19 -0
- package/dist/jsx-runtime.js +25 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +5 -0
- package/dist/providers/index.native.d.ts +2 -0
- package/dist/providers/index.native.js +5 -0
- package/dist/theme/index.d.ts +46 -0
- package/dist/theme/index.js +51 -0
- package/dist/theme/store/helpers.d.ts +50 -0
- package/dist/theme/store/helpers.js +116 -0
- package/dist/theme/store/index.d.ts +196 -0
- package/dist/theme/store/index.js +259 -0
- package/dist/theme/variables.d.ts +23 -0
- package/dist/theme/variables.js +127 -0
- package/ios/audio/IsoAudioCard.swift +471 -0
- package/ios/audio/IsoAudioPlayer.swift +326 -0
- package/ios/audio/IsoAudioView.mm +173 -0
- package/ios/camera/IsoCamera.swift +682 -0
- package/ios/camera/IsoCameraView.mm +206 -0
- package/ios/datePicker/IsoDatePicker.swift +826 -0
- package/ios/datePicker/IsoDatePickerView.mm +118 -0
- package/ios/datePicker/IsoWheelView.swift +190 -0
- package/ios/image/IsoImage.swift +568 -0
- package/ios/image/IsoImageModule.mm +45 -0
- package/ios/image/IsoImagePipeline.swift +612 -0
- package/ios/image/IsoImageView.mm +173 -0
- package/ios/mediaSession/IsoNowPlaying.swift +150 -0
- package/ios/mediaSessionOff/IsoNowPlaying.swift +18 -0
- package/ios/modal/IsoModal.swift +301 -0
- package/ios/modal/IsoModalView.mm +132 -0
- package/ios/pdf/IsoPdfSupport.swift +247 -0
- package/ios/pdf/IsoPdfToolbar.swift +403 -0
- package/ios/pdf/IsoPdfView.mm +194 -0
- package/ios/pdf/IsoPdfViewer.swift +547 -0
- package/ios/shared/IsoAudioSession.swift +42 -0
- package/ios/sheet/IsoSheet.swift +259 -0
- package/ios/sheet/IsoSheetView.mm +143 -0
- package/ios/stubs/audio/IsoAudioViewStub.mm +32 -0
- package/ios/stubs/camera/IsoCameraViewStub.mm +32 -0
- package/ios/stubs/datePicker/IsoDatePickerViewStub.mm +32 -0
- package/ios/stubs/image/IsoImageViewStub.mm +62 -0
- package/ios/stubs/modal/IsoModalViewStub.mm +32 -0
- package/ios/stubs/pdf/IsoPdfViewStub.mm +32 -0
- package/ios/stubs/sheet/IsoSheetViewStub.mm +32 -0
- package/ios/stubs/video/IsoVideoViewStub.mm +32 -0
- package/ios/video/IsoVideoControls.swift +569 -0
- package/ios/video/IsoVideoFullscreen.swift +280 -0
- package/ios/video/IsoVideoPlayer.swift +421 -0
- package/ios/video/IsoVideoPlaylistPanel.swift +360 -0
- package/ios/video/IsoVideoView.mm +187 -0
- package/isoform.podspec +132 -0
- package/metro.js +81 -0
- package/package.json +180 -4
- package/react-native.config.js +12 -0
- package/scripts/setup-ios.js +85 -0
- package/src/adapters/react-native/camera/native/IsoCameraViewNativeComponent.ts +79 -0
- package/src/adapters/react-native/datePicker/native/IsoDatePickerViewNativeComponent.ts +44 -0
- package/src/adapters/react-native/image/native/IsoImageViewNativeComponent.ts +90 -0
- package/src/adapters/react-native/image/native/NativeIsoImageModule.ts +24 -0
- package/src/adapters/react-native/media/audio/native/IsoAudioViewNativeComponent.ts +69 -0
- package/src/adapters/react-native/media/pdf/native/IsoPdfViewNativeComponent.ts +71 -0
- package/src/adapters/react-native/media/video/native/IsoVideoViewNativeComponent.ts +74 -0
- package/src/adapters/react-native/modal/native/IsoModalViewNativeComponent.ts +47 -0
- package/src/adapters/react-native/sheet/native/IsoSheetViewNativeComponent.ts +50 -0
package/metro.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper do Metro (opcional): tira do bundle JS o código dos módulos desligados
|
|
3
|
+
* no `isoform.config.json` da raiz do app.
|
|
4
|
+
*
|
|
5
|
+
* // metro.config.js
|
|
6
|
+
* const { withIsoform } = require('react-isoform/metro');
|
|
7
|
+
* module.exports = withIsoform(getDefaultConfig(__dirname));
|
|
8
|
+
*
|
|
9
|
+
* Sem o arquivo (ou sem este helper), nada muda: o código fica no bundle e o
|
|
10
|
+
* `configure` decide em runtime.
|
|
11
|
+
*/
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
|
|
15
|
+
const CONFIG_FILE = 'isoform.config.json';
|
|
16
|
+
|
|
17
|
+
/** Arquivo de cada módulo → versão vazia (mesmo nome + `.disabled`, mesma extensão). */
|
|
18
|
+
const MODULE_FILES = {
|
|
19
|
+
video: /[\\/]adapters[\\/]react-native[\\/]media[\\/]video[\\/]Video\.(tsx|js)$/,
|
|
20
|
+
audio: /[\\/]adapters[\\/]react-native[\\/]media[\\/]audio[\\/]Audio\.(tsx|js)$/,
|
|
21
|
+
pdf: /[\\/]adapters[\\/]react-native[\\/]media[\\/]pdf[\\/]Pdf\.(tsx|js)$/,
|
|
22
|
+
sheet: /[\\/]adapters[\\/]react-native[\\/]sheet[\\/]BottomSheet\.(tsx|js)$/,
|
|
23
|
+
svg: /[\\/]adapters[\\/]react-native[\\/]svg[\\/]Svg\.(tsx|js)$/,
|
|
24
|
+
camera: /[\\/]adapters[\\/]react-native[\\/]camera[\\/]Camera\.(tsx|js)$/,
|
|
25
|
+
datePicker: /[\\/]adapters[\\/]react-native[\\/]datePicker[\\/]DatePicker\.(tsx|js)$/,
|
|
26
|
+
image: /[\\/]adapters[\\/]react-native[\\/]image[\\/]Image\.(tsx|js)$/,
|
|
27
|
+
modal: /[\\/]adapters[\\/]react-native[\\/]modal[\\/]Modal\.(tsx|js)$/,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** `modules` do arquivo (ex.: `{ video: true, audio: { enabled: false } }`), ou `null` se o app não tem o arquivo. */
|
|
31
|
+
function readModules(projectRoot) {
|
|
32
|
+
const file = path.join(projectRoot, CONFIG_FILE);
|
|
33
|
+
if (!fs.existsSync(file)) return null;
|
|
34
|
+
return JSON.parse(fs.readFileSync(file, 'utf8')).modules ?? {};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** `true` ou `{ enabled: true }`. */
|
|
38
|
+
const isEnabled = (setting) => setting === true || (typeof setting === 'object' && setting !== null && setting.enabled === true);
|
|
39
|
+
|
|
40
|
+
const disabledVersion = (filePath) => filePath.replace(/\.(tsx|js)$/, '.disabled.$1');
|
|
41
|
+
|
|
42
|
+
/** Módulos que dependem de um pacote que o próprio app instala → nome do pacote. */
|
|
43
|
+
const APP_PACKAGES = { svg: 'react-native-svg' };
|
|
44
|
+
|
|
45
|
+
/** Erro claro já no início do Metro, em vez de "Unable to resolve module" no meio do bundle. */
|
|
46
|
+
function checkAppPackages(modules, projectRoot) {
|
|
47
|
+
for (const [name, pkg] of Object.entries(APP_PACKAGES)) {
|
|
48
|
+
if (!isEnabled(modules[name])) continue;
|
|
49
|
+
try {
|
|
50
|
+
require.resolve(`${pkg}/package.json`, { paths: [projectRoot] });
|
|
51
|
+
} catch {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`[isoform] o módulo "${name}" está ligado no ${CONFIG_FILE}, mas o pacote "${pkg}" não está instalado. ` +
|
|
54
|
+
`Rode \`npx expo install ${pkg}\` (ou \`yarn add ${pkg}\`) e, no iOS, \`pod install\`; ou desligue o módulo.`,
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function withIsoform(config, { projectRoot = config.projectRoot ?? process.cwd() } = {}) {
|
|
61
|
+
const modules = readModules(projectRoot);
|
|
62
|
+
if (!modules) return config;
|
|
63
|
+
checkAppPackages(modules, projectRoot);
|
|
64
|
+
|
|
65
|
+
const off = Object.entries(MODULE_FILES)
|
|
66
|
+
.filter(([name]) => !isEnabled(modules[name]))
|
|
67
|
+
.map(([, pattern]) => pattern);
|
|
68
|
+
if (!off.length) return config;
|
|
69
|
+
|
|
70
|
+
const upstream = config.resolver?.resolveRequest;
|
|
71
|
+
const resolveRequest = (context, moduleName, platform) => {
|
|
72
|
+
const resolve = upstream ?? context.resolveRequest;
|
|
73
|
+
const result = resolve(context, moduleName, platform);
|
|
74
|
+
const isOff = result?.type === 'sourceFile' && off.some((pattern) => pattern.test(result.filePath));
|
|
75
|
+
return isOff ? { type: 'sourceFile', filePath: disabledVersion(result.filePath) } : result;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
return { ...config, resolver: { ...config.resolver, resolveRequest } };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
module.exports = { withIsoform, readModules };
|
package/package.json
CHANGED
|
@@ -1,6 +1,182 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-isoform",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "One styling API for React and React Native: write a component once, run it on web (React DOM) and mobile, with global theming and no providers",
|
|
5
|
+
"homepage": "https://github.com/MichelGutner/isoform#readme",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/MichelGutner/isoform.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/MichelGutner/isoform/issues"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"react",
|
|
15
|
+
"react-native",
|
|
16
|
+
"cross-platform",
|
|
17
|
+
"universal",
|
|
18
|
+
"styling",
|
|
19
|
+
"theme",
|
|
20
|
+
"typescript",
|
|
21
|
+
"css-in-js",
|
|
22
|
+
"atomic-css",
|
|
23
|
+
"styled-components"
|
|
24
|
+
],
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"module": "./dist/index.js",
|
|
27
|
+
"react-native": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "rm -rf dist && tspc -p tsconfig.json",
|
|
31
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
32
|
+
"lint": "eslint src metro.js babel.js react-native.config.js scripts",
|
|
33
|
+
"lint:fix": "eslint src metro.js babel.js react-native.config.js scripts --fix",
|
|
34
|
+
"test": "jest",
|
|
35
|
+
"test:coverage": "jest --coverage",
|
|
36
|
+
"check:package": "node scripts/check-package.js",
|
|
37
|
+
"check:docs": "node scripts/check-docs.js",
|
|
38
|
+
"check:swift": "scripts/check-swift.sh",
|
|
39
|
+
"check:android": "scripts/check-android.sh",
|
|
40
|
+
"verify": "yarn lint && yarn typecheck && yarn test && yarn build && yarn check:package && yarn check:docs && yarn size",
|
|
41
|
+
"verify:all": "yarn verify && yarn check:swift && yarn check:android",
|
|
42
|
+
"release": "scripts/release.sh",
|
|
43
|
+
"release:dry": "scripts/release.sh --dry-run",
|
|
44
|
+
"bench": "jest --config jest.bench.config.js",
|
|
45
|
+
"build:dev": "yarn build && yalc push",
|
|
46
|
+
"build:watch": "./watch.sh",
|
|
47
|
+
"prepack": "npm run build",
|
|
48
|
+
"prepare": "husky || true",
|
|
49
|
+
"size": "size-limit"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"pdfjs-dist": "^6.5.438",
|
|
53
|
+
"react": ">=18",
|
|
54
|
+
"react-dom": ">=18",
|
|
55
|
+
"react-native": ">=0.76",
|
|
56
|
+
"react-native-svg": ">=15"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@babel/core": "^7.29.13",
|
|
60
|
+
"@eslint/js": "^10.0.1",
|
|
61
|
+
"@size-limit/esbuild": "14.3.0",
|
|
62
|
+
"@size-limit/file": "14.3.0",
|
|
63
|
+
"@testing-library/dom": "^10.4.0",
|
|
64
|
+
"@testing-library/react": "^16.3.0",
|
|
65
|
+
"@testing-library/react-native": "^13.2.0",
|
|
66
|
+
"@types/jest": "^29.5.14",
|
|
67
|
+
"@types/node": "^26.6.6",
|
|
68
|
+
"@types/react": "~19.3.0",
|
|
69
|
+
"@types/react-dom": "^19.1.0",
|
|
70
|
+
"babel-jest": "^29.7.0",
|
|
71
|
+
"babel-plugin-module-resolver": "^5.0.3",
|
|
72
|
+
"eslint": "10.15.0",
|
|
73
|
+
"eslint-plugin-react-hooks": "7.1.1",
|
|
74
|
+
"globals": "^16.0.0",
|
|
75
|
+
"husky": "^9.1.7",
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
78
|
+
"metro-react-native-babel-preset": "^0.77.0",
|
|
79
|
+
"pdfjs-dist": "6.5.438",
|
|
80
|
+
"react": "^19.3.1",
|
|
81
|
+
"react-dom": "19.3.1",
|
|
82
|
+
"react-native": "^0.88.1",
|
|
83
|
+
"react-test-renderer": "^19.3.1",
|
|
84
|
+
"size-limit": "14.3.0",
|
|
85
|
+
"ts-jest": "^29.4.15",
|
|
86
|
+
"ts-patch": "^3.3.0",
|
|
87
|
+
"typescript": "^5.7.3",
|
|
88
|
+
"typescript-eslint": "8.73.0",
|
|
89
|
+
"typescript-transform-paths": "^3.5.3"
|
|
90
|
+
},
|
|
91
|
+
"engines": {
|
|
92
|
+
"node": ">=22.13.0"
|
|
93
|
+
},
|
|
94
|
+
"license": "MIT",
|
|
95
|
+
"exports": {
|
|
96
|
+
".": {
|
|
97
|
+
"types": "./dist/index.d.ts",
|
|
98
|
+
"react-native": "./dist/index.js",
|
|
99
|
+
"default": "./dist/index.js"
|
|
100
|
+
},
|
|
101
|
+
"./jsx-runtime": {
|
|
102
|
+
"types": "./dist/jsx-runtime.d.ts",
|
|
103
|
+
"react-native": "./dist/jsx-runtime.js",
|
|
104
|
+
"default": "./dist/jsx-runtime.js"
|
|
105
|
+
},
|
|
106
|
+
"./jsx-dev-runtime": {
|
|
107
|
+
"types": "./dist/jsx-dev-runtime.d.ts",
|
|
108
|
+
"react-native": "./dist/jsx-dev-runtime.js",
|
|
109
|
+
"default": "./dist/jsx-dev-runtime.js"
|
|
110
|
+
},
|
|
111
|
+
"./package.json": "./package.json",
|
|
112
|
+
"./metro": "./metro.js",
|
|
113
|
+
"./babel": "./babel.js"
|
|
114
|
+
},
|
|
115
|
+
"sideEffects": [
|
|
116
|
+
"./dist/index.js",
|
|
117
|
+
"./dist/providers/*",
|
|
118
|
+
"./src/index.ts",
|
|
119
|
+
"./src/providers/*"
|
|
120
|
+
],
|
|
121
|
+
"files": [
|
|
122
|
+
"dist/**/*.js",
|
|
123
|
+
"dist/**/*.d.ts",
|
|
124
|
+
"!dist/**/babel.config.*",
|
|
125
|
+
"!dist/**/jest.config.*",
|
|
126
|
+
"README.md",
|
|
127
|
+
"LICENSE",
|
|
128
|
+
"src/adapters/react-native/**/native/**",
|
|
129
|
+
"ios/**",
|
|
130
|
+
"android/build.gradle",
|
|
131
|
+
"android/consumer-rules.pro",
|
|
132
|
+
"android/src/**",
|
|
133
|
+
"isoform.podspec",
|
|
134
|
+
"react-native.config.js",
|
|
135
|
+
"metro.js",
|
|
136
|
+
"babel.js",
|
|
137
|
+
"scripts/setup-ios.js"
|
|
138
|
+
],
|
|
139
|
+
"peerDependenciesMeta": {
|
|
140
|
+
"pdfjs-dist": {
|
|
141
|
+
"optional": true
|
|
142
|
+
},
|
|
143
|
+
"react-dom": {
|
|
144
|
+
"optional": true
|
|
145
|
+
},
|
|
146
|
+
"react-native": {
|
|
147
|
+
"optional": true
|
|
148
|
+
},
|
|
149
|
+
"react-native-svg": {
|
|
150
|
+
"optional": true
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"codegenConfig": {
|
|
154
|
+
"name": "IsoformSpec",
|
|
155
|
+
"type": "all",
|
|
156
|
+
"jsSrcsDir": "src/adapters/react-native",
|
|
157
|
+
"android": {
|
|
158
|
+
"javaPackageName": "com.isoform"
|
|
159
|
+
},
|
|
160
|
+
"ios": {
|
|
161
|
+
"componentProvider": {
|
|
162
|
+
"IsoVideoView": "IsoVideoView",
|
|
163
|
+
"IsoAudioView": "IsoAudioView",
|
|
164
|
+
"IsoPdfView": "IsoPdfView",
|
|
165
|
+
"IsoSheetView": "IsoSheetView",
|
|
166
|
+
"IsoCameraView": "IsoCameraView",
|
|
167
|
+
"IsoDatePickerView": "IsoDatePickerView",
|
|
168
|
+
"IsoImageView": "IsoImageView",
|
|
169
|
+
"IsoModalView": "IsoModalView"
|
|
170
|
+
},
|
|
171
|
+
"modulesProvider": {
|
|
172
|
+
"IsoImageModule": "IsoImageModule"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"bin": {
|
|
177
|
+
"isoform-setup-ios": "scripts/setup-ios.js"
|
|
178
|
+
},
|
|
179
|
+
"publishConfig": {
|
|
180
|
+
"access": "public"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Autolinking (React Native CLI e Expo): onde estão as partes nativas do isoform.
|
|
2
|
+
module.exports = {
|
|
3
|
+
dependency: {
|
|
4
|
+
platforms: {
|
|
5
|
+
android: {
|
|
6
|
+
packageImportPath: 'import com.isoform.IsoformPackage;',
|
|
7
|
+
packageInstance: 'new IsoformPackage()',
|
|
8
|
+
},
|
|
9
|
+
ios: {},
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Setup for `modules.mediaSession` on iOS: adds `UIBackgroundModes` → `audio` to
|
|
4
|
+
* the app's Info.plist, so audio keeps playing with the screen locked or the app
|
|
5
|
+
* in the background. A pod cannot declare this key, so the pod's build phase
|
|
6
|
+
* (`isoform.podspec`) already does the same on every iOS build; this script is
|
|
7
|
+
* for running it by hand or in CI, without building.
|
|
8
|
+
*
|
|
9
|
+
* node node_modules/react-isoform/scripts/setup-ios.js [app-root]
|
|
10
|
+
*
|
|
11
|
+
* It only acts when `isoform.config.json` (at the app root) has
|
|
12
|
+
* `modules.audio: { enabled: true, mediaSession: true }` and is safe to run again (idempotent).
|
|
13
|
+
* Android needs nothing: the library's own manifest is merged at build time.
|
|
14
|
+
*/
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const path = require('path');
|
|
17
|
+
const { execFileSync } = require('child_process');
|
|
18
|
+
|
|
19
|
+
const root = path.resolve(process.argv[2] ?? process.cwd());
|
|
20
|
+
const MODE = 'audio';
|
|
21
|
+
|
|
22
|
+
/** `true` or `{ enabled: true }`. */
|
|
23
|
+
const isOn = (setting) => setting === true || (typeof setting === 'object' && setting !== null && setting.enabled === true);
|
|
24
|
+
|
|
25
|
+
const log = (message) => console.log(`[isoform] ${message}`);
|
|
26
|
+
const fail = (message) => {
|
|
27
|
+
console.error(`[isoform] ${message}`);
|
|
28
|
+
process.exit(1);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** `modules` of the app's `isoform.config.json` (or `{}` when there is none). */
|
|
32
|
+
function readModules() {
|
|
33
|
+
const file = path.join(root, 'isoform.config.json');
|
|
34
|
+
if (!fs.existsSync(file)) return {};
|
|
35
|
+
return JSON.parse(fs.readFileSync(file, 'utf8')).modules ?? {};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The app's Info.plist files: `ios/<Target>/Info.plist` (Pods and build output are skipped). */
|
|
39
|
+
function findPlists() {
|
|
40
|
+
const ios = path.join(root, 'ios');
|
|
41
|
+
if (!fs.existsSync(ios)) return [];
|
|
42
|
+
return fs
|
|
43
|
+
.readdirSync(ios, { withFileTypes: true })
|
|
44
|
+
.filter((entry) => entry.isDirectory() && !['Pods', 'build'].includes(entry.name))
|
|
45
|
+
.map((entry) => path.join(ios, entry.name, 'Info.plist'))
|
|
46
|
+
.filter((file) => fs.existsSync(file));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const plutil = (...args) => execFileSync('/usr/bin/plutil', args, { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
|
|
50
|
+
|
|
51
|
+
/** Current `UIBackgroundModes` of the plist (`null` when the key is missing). */
|
|
52
|
+
function backgroundModes(file) {
|
|
53
|
+
try {
|
|
54
|
+
return JSON.parse(plutil('-extract', 'UIBackgroundModes', 'json', '-o', '-', file));
|
|
55
|
+
} catch {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Adds `audio` to the plist. Returns `false` when it was already there. */
|
|
61
|
+
function enableAudio(file) {
|
|
62
|
+
const modes = backgroundModes(file);
|
|
63
|
+
if (modes?.includes(MODE)) return false;
|
|
64
|
+
if (modes === null) plutil('-insert', 'UIBackgroundModes', '-json', JSON.stringify([MODE]), file);
|
|
65
|
+
else plutil('-insert', 'UIBackgroundModes.0', '-string', MODE, file);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function main() {
|
|
70
|
+
const modules = readModules();
|
|
71
|
+
if (!isOn(modules.audio) || modules.audio.mediaSession !== true) {
|
|
72
|
+
return log('modules.audio is not { enabled: true, mediaSession: true } in isoform.config.json: nothing to do.');
|
|
73
|
+
}
|
|
74
|
+
if (process.platform !== 'darwin') return fail('run this on macOS (it uses plutil).');
|
|
75
|
+
|
|
76
|
+
const plists = findPlists();
|
|
77
|
+
if (!plists.length) return fail(`no ios/<App>/Info.plist found under ${root}. Pass the app root as an argument.`);
|
|
78
|
+
|
|
79
|
+
for (const file of plists) {
|
|
80
|
+
const relative = path.relative(root, file);
|
|
81
|
+
log(enableAudio(file) ? `${relative}: added UIBackgroundModes → ${MODE}` : `${relative}: already has ${MODE}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
main();
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec of the native camera (New Architecture / Fabric).
|
|
3
|
+
*
|
|
4
|
+
* The React Native Codegen reads THIS file when the app is built and generates
|
|
5
|
+
* the native interfaces (props, events and commands) used by:
|
|
6
|
+
* · iOS: ios/camera/IsoCameraView.mm + ios/camera/IsoCamera.swift (AVFoundation)
|
|
7
|
+
* · Android: android/src/camera/.../IsoCameraViewManager.kt + IsoCameraView.kt (CameraX + Compose)
|
|
8
|
+
*
|
|
9
|
+
* Captures answer through events carrying the `requestId` of the command, which
|
|
10
|
+
* the JS side turns back into promises.
|
|
11
|
+
*/
|
|
12
|
+
import type * as React from 'react';
|
|
13
|
+
import { codegenNativeCommands, codegenNativeComponent } from 'react-native';
|
|
14
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
15
|
+
|
|
16
|
+
type EmptyEvent = Readonly<{}>;
|
|
17
|
+
type ErrorEvent = Readonly<{ message: string }>;
|
|
18
|
+
type PermissionEvent = Readonly<{ camera: string; microphone: string }>;
|
|
19
|
+
type ZoomEvent = Readonly<{ zoom: CodegenTypes.Double }>;
|
|
20
|
+
// Codegen reads event arrays only in the `T[]` form
|
|
21
|
+
type CodesEvent = Readonly<{ codes: { value: string; type: string }[] }>;
|
|
22
|
+
type PhotoEvent = Readonly<{
|
|
23
|
+
requestId: CodegenTypes.Int32;
|
|
24
|
+
uri: string;
|
|
25
|
+
width: CodegenTypes.Int32;
|
|
26
|
+
height: CodegenTypes.Int32;
|
|
27
|
+
error: string;
|
|
28
|
+
}>;
|
|
29
|
+
type RecordStartEvent = Readonly<{ requestId: CodegenTypes.Int32; error: string }>;
|
|
30
|
+
type RecordEndEvent = Readonly<{
|
|
31
|
+
requestId: CodegenTypes.Int32;
|
|
32
|
+
uri: string;
|
|
33
|
+
duration: CodegenTypes.Double;
|
|
34
|
+
error: string;
|
|
35
|
+
}>;
|
|
36
|
+
|
|
37
|
+
export interface NativeProps extends ViewProps {
|
|
38
|
+
facing?: CodegenTypes.WithDefault<'back' | 'front', 'back'>;
|
|
39
|
+
active?: CodegenTypes.WithDefault<boolean, true>;
|
|
40
|
+
flash?: CodegenTypes.WithDefault<'off' | 'on' | 'auto', 'off'>;
|
|
41
|
+
torch?: CodegenTypes.WithDefault<boolean, false>;
|
|
42
|
+
zoom?: CodegenTypes.WithDefault<CodegenTypes.Float, 1.0>;
|
|
43
|
+
zoomGesture?: CodegenTypes.WithDefault<boolean, true>;
|
|
44
|
+
focusGesture?: CodegenTypes.WithDefault<boolean, true>;
|
|
45
|
+
/** Binds the video output and asks for the microphone. */
|
|
46
|
+
video?: CodegenTypes.WithDefault<boolean, false>;
|
|
47
|
+
/** Records sound with the video. */
|
|
48
|
+
audio?: CodegenTypes.WithDefault<boolean, true>;
|
|
49
|
+
/** Runs the code scanner. */
|
|
50
|
+
codeScanner?: CodegenTypes.WithDefault<boolean, false>;
|
|
51
|
+
/** Code kinds (`qr`, `ean-13`…). */
|
|
52
|
+
codeTypes?: ReadonlyArray<string>;
|
|
53
|
+
|
|
54
|
+
// `onCamera*` prefix so they do not clash with events React Native already defines.
|
|
55
|
+
onCameraReady?: CodegenTypes.DirectEventHandler<EmptyEvent>;
|
|
56
|
+
onCameraError?: CodegenTypes.DirectEventHandler<ErrorEvent>;
|
|
57
|
+
onCameraPermission?: CodegenTypes.DirectEventHandler<PermissionEvent>;
|
|
58
|
+
onCameraZoom?: CodegenTypes.DirectEventHandler<ZoomEvent>;
|
|
59
|
+
onCameraCodes?: CodegenTypes.DirectEventHandler<CodesEvent>;
|
|
60
|
+
onCameraPhoto?: CodegenTypes.DirectEventHandler<PhotoEvent>;
|
|
61
|
+
onCameraRecordStart?: CodegenTypes.DirectEventHandler<RecordStartEvent>;
|
|
62
|
+
onCameraRecordEnd?: CodegenTypes.DirectEventHandler<RecordEndEvent>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type ComponentType = HostComponent<NativeProps>;
|
|
66
|
+
|
|
67
|
+
// Codegen requires `React.ElementRef<...>` written inline as the first argument (no alias).
|
|
68
|
+
interface NativeCommands {
|
|
69
|
+
takePhoto: (viewRef: React.ElementRef<ComponentType>, requestId: CodegenTypes.Int32, flash: string) => void;
|
|
70
|
+
startRecording: (viewRef: React.ElementRef<ComponentType>, requestId: CodegenTypes.Int32) => void;
|
|
71
|
+
stopRecording: (viewRef: React.ElementRef<ComponentType>, requestId: CodegenTypes.Int32) => void;
|
|
72
|
+
requestPermission: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
76
|
+
supportedCommands: ['takePhoto', 'startRecording', 'stopRecording', 'requestPermission'],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export default codegenNativeComponent<NativeProps>('IsoCameraView') as ComponentType;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec of the native date picker (New Architecture / Fabric).
|
|
3
|
+
*
|
|
4
|
+
* The React Native Codegen reads THIS file when the app is built and generates
|
|
5
|
+
* the native interfaces (props and events) used by:
|
|
6
|
+
* · iOS: ios/datePicker/IsoDatePickerView.mm + ios/datePicker/IsoDatePicker.swift (SwiftUI `DatePicker`)
|
|
7
|
+
* · Android: android/src/datePicker/.../IsoDatePickerViewManager.kt + IsoDatePickerView.kt (Jetpack Compose, Material 3)
|
|
8
|
+
*
|
|
9
|
+
* Moments travel as milliseconds since the epoch (UTC); each side shows them in the device's time zone.
|
|
10
|
+
*/
|
|
11
|
+
import { codegenNativeComponent } from 'react-native';
|
|
12
|
+
import type { CodegenTypes, ColorValue, HostComponent, ViewProps } from 'react-native';
|
|
13
|
+
|
|
14
|
+
type ValueEvent = Readonly<{ value: CodegenTypes.Double }>;
|
|
15
|
+
type SizeEvent = Readonly<{ width: CodegenTypes.Double; height: CodegenTypes.Double }>;
|
|
16
|
+
|
|
17
|
+
export interface NativeProps extends ViewProps {
|
|
18
|
+
/** The selected moment (ms since the epoch). */
|
|
19
|
+
value?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
20
|
+
/** What it edits. */
|
|
21
|
+
mode?: CodegenTypes.WithDefault<'date' | 'time' | 'datetime', 'date'>;
|
|
22
|
+
/** How it is drawn. */
|
|
23
|
+
display?: CodegenTypes.WithDefault<'inline' | 'wheel' | 'compact', 'inline'>;
|
|
24
|
+
/** Earliest moment (ms); `-8.64e15` means no limit. */
|
|
25
|
+
minimumDate?: CodegenTypes.WithDefault<CodegenTypes.Double, -8640000000000000>;
|
|
26
|
+
/** Latest moment (ms); `8.64e15` means no limit. */
|
|
27
|
+
maximumDate?: CodegenTypes.WithDefault<CodegenTypes.Double, 8640000000000000>;
|
|
28
|
+
/** BCP 47 language tag; empty = the device's. */
|
|
29
|
+
locale?: string;
|
|
30
|
+
/** `auto` follows the locale; `h12` / `h24` force the clock. */
|
|
31
|
+
hourCycle?: CodegenTypes.WithDefault<'auto' | 'h12' | 'h24', 'auto'>;
|
|
32
|
+
/** Accent color (unset = the platform's). */
|
|
33
|
+
tintColor?: ColorValue;
|
|
34
|
+
/** Blocks the picker. */
|
|
35
|
+
disabled?: CodegenTypes.WithDefault<boolean, false>;
|
|
36
|
+
|
|
37
|
+
// `onPicker*` prefix so they do not clash with events React Native already defines.
|
|
38
|
+
/** The user picked a moment. */
|
|
39
|
+
onPickerChange?: CodegenTypes.DirectEventHandler<ValueEvent>;
|
|
40
|
+
/** Natural size of the picker (the view is sized to it). */
|
|
41
|
+
onPickerSize?: CodegenTypes.DirectEventHandler<SizeEvent>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default codegenNativeComponent<NativeProps>('IsoDatePickerView') as HostComponent<NativeProps>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec of the native image view (New Architecture / Fabric).
|
|
3
|
+
*
|
|
4
|
+
* The React Native Codegen reads THIS file when the app is built and generates
|
|
5
|
+
* the native interfaces (props and events) used by:
|
|
6
|
+
* · iOS: ios/image/IsoImageView.mm + ios/image/IsoImage.swift (UIKit + the lib's pipeline)
|
|
7
|
+
* · Android: android/src/image/.../IsoImageViewManager.kt + IsoImageView.kt
|
|
8
|
+
*/
|
|
9
|
+
import { codegenNativeCommands, codegenNativeComponent } from 'react-native';
|
|
10
|
+
import type * as React from 'react';
|
|
11
|
+
import type { CodegenTypes, ColorValue, HostComponent, ViewProps } from 'react-native';
|
|
12
|
+
|
|
13
|
+
type EmptyEvent = Readonly<{}>;
|
|
14
|
+
type ProgressEvent = Readonly<{ loaded: CodegenTypes.Double; total: CodegenTypes.Double }>;
|
|
15
|
+
type LoadEvent = Readonly<{ width: CodegenTypes.Double; height: CodegenTypes.Double; cacheType: string }>;
|
|
16
|
+
type ErrorEvent = Readonly<{ message: string }>;
|
|
17
|
+
type ZoomEvent = Readonly<{ scale: CodegenTypes.Double; x: CodegenTypes.Double; y: CodegenTypes.Double; rotation: CodegenTypes.Double }>;
|
|
18
|
+
|
|
19
|
+
export interface NativeProps extends ViewProps {
|
|
20
|
+
/** The picture: `https://`, `file://`, `data:` (and `content://` or a resource name on Android). */
|
|
21
|
+
uri?: string;
|
|
22
|
+
/** Cache key instead of the URL (empty = the URL). */
|
|
23
|
+
cacheKey?: string;
|
|
24
|
+
/** HTTP headers as `[name, value, name, value…]`. */
|
|
25
|
+
headers?: ReadonlyArray<string>;
|
|
26
|
+
/** A picture shown until `uri` loads (empty = none). */
|
|
27
|
+
placeholderUri?: string;
|
|
28
|
+
/** A blurhash shown until `uri` loads (empty = none; wins over `placeholderUri`). */
|
|
29
|
+
blurhash?: string;
|
|
30
|
+
/** How the picture fills the view. */
|
|
31
|
+
contentFit?: CodegenTypes.WithDefault<'cover' | 'contain' | 'fill' | 'none' | 'scaleDown', 'cover'>;
|
|
32
|
+
/** Horizontal position of the picture in the free space: 0 left, 0.5 center, 1 right. */
|
|
33
|
+
positionX?: CodegenTypes.WithDefault<CodegenTypes.Double, 0.5>;
|
|
34
|
+
/** Vertical position of the picture in the free space: 0 top, 0.5 center, 1 bottom. */
|
|
35
|
+
positionY?: CodegenTypes.WithDefault<CodegenTypes.Double, 0.5>;
|
|
36
|
+
/** Crossfade from the placeholder, in ms. */
|
|
37
|
+
transition?: CodegenTypes.WithDefault<CodegenTypes.Double, 250>;
|
|
38
|
+
/** Paints the non-transparent pixels. */
|
|
39
|
+
tintColor?: ColorValue;
|
|
40
|
+
/** Gaussian blur radius, in points. */
|
|
41
|
+
blurRadius?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
42
|
+
/** Which caches keep the picture. */
|
|
43
|
+
cachePolicy?: CodegenTypes.WithDefault<'memoryDisk' | 'memory' | 'disk' | 'none', 'memoryDisk'>;
|
|
44
|
+
/** Download order. */
|
|
45
|
+
priority?: CodegenTypes.WithDefault<'low' | 'normal' | 'high', 'normal'>;
|
|
46
|
+
/** Plays animated pictures. */
|
|
47
|
+
autoplay?: CodegenTypes.WithDefault<boolean, true>;
|
|
48
|
+
/** Pinch, drag and double-tap gestures. */
|
|
49
|
+
zoomable?: CodegenTypes.WithDefault<boolean, false>;
|
|
50
|
+
/** Largest zoom. */
|
|
51
|
+
maxZoom?: CodegenTypes.WithDefault<CodegenTypes.Double, 4>;
|
|
52
|
+
/** Zoom of a double tap. */
|
|
53
|
+
doubleTapZoom?: CodegenTypes.WithDefault<CodegenTypes.Double, 2.5>;
|
|
54
|
+
/** Two-finger rotation (with `zoomable`). */
|
|
55
|
+
rotatable?: CodegenTypes.WithDefault<boolean, false>;
|
|
56
|
+
/** Corner radius the picture is clipped to (the view's `borderRadius`). */
|
|
57
|
+
cornerRadius?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
|
|
58
|
+
|
|
59
|
+
// `onImage*` prefix so they do not clash with events React Native already defines.
|
|
60
|
+
/** The download started. */
|
|
61
|
+
onImageLoadStart?: CodegenTypes.DirectEventHandler<EmptyEvent>;
|
|
62
|
+
/** Bytes received. */
|
|
63
|
+
onImageProgress?: CodegenTypes.DirectEventHandler<ProgressEvent>;
|
|
64
|
+
/** The picture is on screen (`cacheType`: `memory`, `disk` or `none`). */
|
|
65
|
+
onImageLoad?: CodegenTypes.DirectEventHandler<LoadEvent>;
|
|
66
|
+
/** The picture could not be loaded or decoded. */
|
|
67
|
+
onImageError?: CodegenTypes.DirectEventHandler<ErrorEvent>;
|
|
68
|
+
/** Zoom, offset or rotation changed. */
|
|
69
|
+
onImageZoom?: CodegenTypes.DirectEventHandler<ZoomEvent>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
type ComponentType = HostComponent<NativeProps>;
|
|
73
|
+
|
|
74
|
+
// Codegen requires `React.ElementRef<...>` written inline as the first argument (no alias).
|
|
75
|
+
/** Commands sent from the `ref` (`ImageHandle`). */
|
|
76
|
+
interface NativeCommands {
|
|
77
|
+
/** Zooms to `scale`; `focusX`/`focusY` in points (negative = the center). */
|
|
78
|
+
zoomTo: (view: React.ElementRef<ComponentType>, scale: CodegenTypes.Double, focusX: CodegenTypes.Double, focusY: CodegenTypes.Double, animated: boolean) => void;
|
|
79
|
+
resetZoom: (view: React.ElementRef<ComponentType>, animated: boolean) => void;
|
|
80
|
+
rotateTo: (view: React.ElementRef<ComponentType>, degrees: CodegenTypes.Double, animated: boolean) => void;
|
|
81
|
+
play: (view: React.ElementRef<ComponentType>) => void;
|
|
82
|
+
pause: (view: React.ElementRef<ComponentType>) => void;
|
|
83
|
+
reload: (view: React.ElementRef<ComponentType>) => void;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
87
|
+
supportedCommands: ['zoomTo', 'resetZoom', 'rotateTo', 'play', 'pause', 'reload'],
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export default codegenNativeComponent<NativeProps>('IsoImageView') as HostComponent<NativeProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spec of the image cache module (TurboModule): `prefetchImages` and `clearImageCache`.
|
|
3
|
+
* Implemented by ios/image/IsoImageModule.mm and android/src/image/.../IsoImageModule.kt;
|
|
4
|
+
* with the `image` module off the native side is an empty shell and `get` returns `null`
|
|
5
|
+
* on Android (the iOS shell resolves `false`).
|
|
6
|
+
*/
|
|
7
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
8
|
+
import type { TurboModule } from 'react-native';
|
|
9
|
+
|
|
10
|
+
export interface Spec extends TurboModule {
|
|
11
|
+
/**
|
|
12
|
+
* Downloads the pictures into the cache.
|
|
13
|
+
* @param urls The pictures.
|
|
14
|
+
* @param headers HTTP headers as `[name, value, name, value…]`.
|
|
15
|
+
* @param memory Decodes them into the memory cache.
|
|
16
|
+
* @param disk Keeps the files in the disk cache.
|
|
17
|
+
* @returns `true` when every picture was cached.
|
|
18
|
+
*/
|
|
19
|
+
prefetch(urls: ReadonlyArray<string>, headers: ReadonlyArray<string>, memory: boolean, disk: boolean): Promise<boolean>;
|
|
20
|
+
/** Empties the memory cache, the disk cache or both. */
|
|
21
|
+
clear(memory: boolean, disk: boolean): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default TurboModuleRegistry.get<Spec>('IsoImageModule');
|