mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
55
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d01e5ad731 | ||
|
|
a97d6185fa | ||
|
|
1126bbb149 | ||
|
|
f36bfe5dfa | ||
|
|
e8a64fd638 | ||
|
|
8c64e0868e | ||
|
|
086e93d227 | ||
|
|
f864d6b533 | ||
|
|
d1153ff468 | ||
|
|
1a1714300e | ||
|
|
c33954c80d | ||
|
|
00d272fb3b | ||
|
|
e7378f0d9e | ||
|
|
d90c278672 | ||
|
|
9a4b2cecd5 | ||
|
|
63442d3757 | ||
|
|
c09b71b990 | ||
|
|
a18bc58645 | ||
|
|
54ac150324 | ||
|
|
5b1877fb3f | ||
|
|
559d070e8e | ||
|
|
3420eb87b0 | ||
|
|
0f1d4704df | ||
|
|
b3648be84f | ||
|
|
9d1e24cb2f | ||
|
|
2204ec94d4 | ||
|
|
e3c63cfd34 | ||
|
|
48cafc0b69 | ||
|
|
6368555ab0 | ||
|
|
ef7f714f57 | ||
|
|
51fb5ab87a | ||
|
|
a511c1bdee | ||
|
|
8b8b0ba5dc | ||
|
|
c799aa07e2 | ||
|
|
f44ff97c47 | ||
|
|
9f7bacaa6b | ||
|
|
07769d4d7e | ||
|
|
8b5e2ea683 | ||
|
|
b7eccf23de | ||
|
|
85f9939031 | ||
|
|
e4d969a4ab | ||
|
|
d95909ea15 | ||
|
|
817cb17f78 | ||
|
|
2056794d24 | ||
|
|
647ca90a30 | ||
|
|
2d320fbd76 | ||
|
|
980458c061 | ||
|
|
5a290c4cab | ||
|
|
90d2f65301 | ||
|
|
05e8007e12 | ||
|
|
1e0009407d | ||
|
|
12e321daf0 | ||
|
|
c7785e7ead | ||
|
|
fe8d102663 | ||
|
|
671520943f |
@@ -20,8 +20,6 @@ runs:
|
||||
- name: Set React Native Version
|
||||
shell: bash
|
||||
run: node ./scripts/releases/set-rn-artifacts-version.js --build-type ${{ inputs.release-type }}
|
||||
# We don't want to re-set the artifacts version if we're on the release branch.
|
||||
if: ${{ !contains(github.ref, '-stable') }}
|
||||
- name: Setup gradle
|
||||
uses: ./.github/actions/setup-gradle
|
||||
with:
|
||||
|
||||
@@ -35,7 +35,7 @@ runs:
|
||||
steps:
|
||||
- name: Installing Maestro
|
||||
shell: bash
|
||||
run: export MAESTRO_VERSION=1.39.5; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
run: export MAESTRO_VERSION=1.39.7; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
- name: Set up JDK 17
|
||||
if: ${{ inputs.install-java == 'true' }}
|
||||
uses: actions/setup-java@v4
|
||||
|
||||
@@ -31,7 +31,7 @@ runs:
|
||||
steps:
|
||||
- name: Installing Maestro
|
||||
shell: bash
|
||||
run: export MAESTRO_VERSION=1.39.5; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
run: export MAESTRO_VERSION=1.39.7; curl -Ls "https://get.maestro.mobile.dev" | bash
|
||||
- name: Installing Maestro dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
test_ios_rntester:
|
||||
runs-on: macos-13
|
||||
runs-on: macos-13-large
|
||||
needs:
|
||||
[build_apple_slices_hermes, prepare_hermes_workspace, build_hermes_macos]
|
||||
env:
|
||||
@@ -369,6 +369,11 @@ jobs:
|
||||
sed -i 's/newArchEnabled=true/newArchEnabled=false/' android/gradle.properties
|
||||
fi
|
||||
|
||||
if [[ ${{matrix.jsengine}} == "JSC" ]]; then
|
||||
echo "Using JSC instead of Hermes"
|
||||
sed -i 's/hermesEnabled=true/hermesEnabled=false/' android/gradle.properties
|
||||
fi
|
||||
|
||||
# Build
|
||||
cd android
|
||||
CAPITALIZED_FLAVOR=$(echo "${{ matrix.flavor }}" | awk '{print toupper(substr($0, 1, 1)) substr($0, 2)}')
|
||||
|
||||
+155
@@ -1,5 +1,160 @@
|
||||
# Changelog
|
||||
|
||||
## v0.78.0-rc.0
|
||||
|
||||
### Breaking
|
||||
|
||||
- Codegen: Separate component array types and command array types ([825492b199](https://github.com/facebook/react-native/commit/825492b1999b62de708e6f40d5d5de8d3d7cb8a9) by [@elicwhite](https://github.com/elicwhite))
|
||||
- The `FuseboxClient.setClientMetadata` CDP method is removed. Instead, use `ReactNativeApplication.enable`. ([1a9780f0e3](https://github.com/facebook/react-native/commit/1a9780f0e3714ac18ffae34cb67376c711b0e031) by [@huntie](https://github.com/huntie))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- Changed visibility of FrescoBasedReactTextInlineImageViewManager to internal ([d5f33c19cb](https://github.com/facebook/react-native/commit/d5f33c19cb33e2f2c7d2470cc90872c1f065f20d) by [@alanleedev](https://github.com/alanleedev))
|
||||
- Mikgrating pointerEvents API breaks compatibility for kotlin usages of this api as a val ([45e4a3afce](https://github.com/facebook/react-native/commit/45e4a3afceb4be3047cd01a60ec2c9f806ed30fe) by [@mdvacca](https://github.com/mdvacca))
|
||||
- Convert RootView to Kotlin ([21c9491926](https://github.com/facebook/react-native/commit/21c94919260a68409f82081740169d0409e78933) by [@fabriziocucci](https://github.com/fabriziocucci))
|
||||
- Delete unused abstract class GuardedResultAsyncTask ([67bff8734f](https://github.com/facebook/react-native/commit/67bff8734f4b92fe399910eecad5b67511a749c1) by [@mdvacca](https://github.com/mdvacca))
|
||||
- Delete deprecated class FabricViewStateManager ([b25b65ba19](https://github.com/facebook/react-native/commit/b25b65ba19f3c674fd2efe5c01123ccc0ae55cbf) by [@mdvacca](https://github.com/mdvacca))
|
||||
- Removed ComponentNameResolver from public API ([a4849cb3d6](https://github.com/facebook/react-native/commit/a4849cb3d6f4245d15eb3812e417a9f4248bb3a1) by [@mdvacca](https://github.com/mdvacca))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- Change Image load event size info from logical size to pixel ([09995fc874](https://github.com/facebook/react-native/commit/09995fc8741cfdc6095d09627262b4f6fbbaafc2) by [@zhongwuzw](https://github.com/zhongwuzw))
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for the second parameter of `console.table` to specify a list of columns to print in the table. ([fd0894b1c7](https://github.com/facebook/react-native/commit/fd0894b1c7fcb20dd213ec1e93aafef25935d709) by [@rubennorte](https://github.com/rubennorte))
|
||||
- Added `RawValue(Runtime*, jsi::Value&)` constructor to make a `RawValue` from a `jsi::Value`. ([03d2186ace](https://github.com/facebook/react-native/commit/03d2186ace2cb17c676b7763d5a545759a658b77) by [@hannojg](https://github.com/hannojg))
|
||||
- Added `pointerEvents` to `TextProps` type. ([3efbe33ce0](https://github.com/facebook/react-native/commit/3efbe33ce03f846932406742528652eb695b957d) by [@hyochan](https://github.com/hyochan))
|
||||
- Add `jest-diff v29.7.0` to devDependencies ([b27bd00a38](https://github.com/facebook/react-native/commit/b27bd00a389295250ec003357df713ebf306374b) by [@andrewdacenko](https://github.com/andrewdacenko))
|
||||
- Add useColorScheme mock test ([24fee29f7a](https://github.com/facebook/react-native/commit/24fee29f7a8ab328bb35e66d145d6b9c2d018c1d) by [@Kudo](https://github.com/Kudo))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- Make the addition of JitPack repository configurable ([a98528e609](https://github.com/facebook/react-native/commit/a98528e609ff0ace4b7bc82f3aa273b7e3fa6443) by [@cortinico](https://github.com/cortinico))
|
||||
- Fixing schema types for component command params of Arrays ([25c673e357](https://github.com/facebook/react-native/commit/25c673e35784d8d8c49555af104b9b4d8d37973d) by [@elicwhite](https://github.com/elicwhite))
|
||||
- SoftException categories ([c832f94cf7](https://github.com/facebook/react-native/commit/c832f94cf713d0cb7616ef095f38583979e1cf43) by Thomas Nardone)
|
||||
- Add mockito-kotlin for Kotlin unit testing ([e393711ef8](https://github.com/facebook/react-native/commit/e393711ef88629a661b34d4aebe785855c5c5969) by Thomas Nardone)
|
||||
- ActivityIndicator: setting `resource-id` from the `testID` prop ([87b1bad45e](https://github.com/facebook/react-native/commit/87b1bad45e4eb730ea07686a2b2558253c60d3b7) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- Added `getState` method for `StateWrapperImpl` ([ed36e896ac](https://github.com/facebook/react-native/commit/ed36e896ac34fcbefece87456dbdfdff30d22ad5) by [@hannojg](https://github.com/hannojg))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- [TextInput] Integrate a new property - `disableKeyboardShortcuts`. It can disable the keyboard shortcuts on iPads. ([0154372b93](https://github.com/facebook/react-native/commit/0154372b93eb1b02f0c62f2a75c95f4fc6a9f3e8) by [@rezkiy37](https://github.com/rezkiy37))
|
||||
- Implement ReactNativeFactory ([081be01a5d](https://github.com/facebook/react-native/commit/081be01a5dd24d0a398c6aa8297575502a17d5ec) by [@okwasniewski](https://github.com/okwasniewski))
|
||||
- Support system font families (system-ui, ui-sans-serif, ui-serif, ui-monospace, and ui-rounded) on iOS ([1763321c89](https://github.com/facebook/react-native/commit/1763321c8960d30ddc4d3464a0fffdecdd44617a) by [@cxa](https://github.com/cxa))
|
||||
|
||||
### Changed
|
||||
|
||||
- Improved types in BoxInspector and refactored a code ([f832c450a5](https://github.com/facebook/react-native/commit/f832c450a52c4c9d61c1d6b609fcad1332613556) by [@coado](https://github.com/coado))
|
||||
- Improved types in StyleInspector and refactored a code ([49e5c58c59](https://github.com/facebook/react-native/commit/49e5c58c595265c9fffc84741aab6363d291f1f5) by [@coado](https://github.com/coado))
|
||||
- Improved types in ElementBox and refactored a code ([2959d49e8d](https://github.com/facebook/react-native/commit/2959d49e8d09663f9ac437ffcb66d1c99162c6d0) by [@coado](https://github.com/coado))
|
||||
- Improve types on BorderBox ([48a7840919](https://github.com/facebook/react-native/commit/48a784091989c695e3432cb8ba657139eb9f5e99) by [@coado](https://github.com/coado))
|
||||
- Improved formatting of values logged via `console.table` (including Markdown format). ([7154c62afb](https://github.com/facebook/react-native/commit/7154c62afb5371f3f861663826792e41229c344a) by [@rubennorte](https://github.com/rubennorte))
|
||||
- Improve types on DrawerLayoutAndroid ([b5155fba89](https://github.com/facebook/react-native/commit/b5155fba895411e290faeeea06180fce24079f78) by [@huntie](https://github.com/huntie))
|
||||
- Mark `intersectionRect` required in `NativeIntersectionObserverEntry` to reflect native logic. ([8681fc2ab2](https://github.com/facebook/react-native/commit/8681fc2ab20aa1e5937a0bf3fc58ed03c3e0ee23) by [@lunaleaps](https://github.com/lunaleaps))
|
||||
- Upgrading `typescript-config` module version to `esnext` ([5370347f54](https://github.com/facebook/react-native/commit/5370347f54719f318a4e032aba6cbf2269e7c3d7) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- Reverts #47503. (~~Callbacks passed to `animation.start(<callback>)` will be scheduled for execution in a microtask. Previously, there were certain scenarios in which the callback could be synchronously executed by `start`.~~) ([8793b7d89b](https://github.com/facebook/react-native/commit/8793b7d89bcafdfcca7ecb953e60882b67ffc807) by [@yungsters](https://github.com/yungsters))
|
||||
- ([9aa21b5e87](https://github.com/facebook/react-native/commit/9aa21b5e8765f14a9806eac435636b87f62178cc) by [@lunaleaps](https://github.com/lunaleaps))
|
||||
- Fix item disappearing with scroll in VirtualizedList ([df7b6ae092](https://github.com/facebook/react-native/commit/df7b6ae092d03385ebd05efd0f068c59e727f723) by [@Tom910](https://github.com/Tom910))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- Introduce new public API ViewManagerInterface ([40a0cdbc99](https://github.com/facebook/react-native/commit/40a0cdbc99746f18ca15c48f3d8f03cdad1635af) by [@mdvacca](https://github.com/mdvacca))
|
||||
- Bumped Android Gradle Plugin (AGP) to 8.8.0 ([4c7c836ebf](https://github.com/facebook/react-native/commit/4c7c836ebf956c13fa327170adaec43a076226e7) by [@cortinico](https://github.com/cortinico))
|
||||
- Bump Gradle to 8.12 ([5e6478954c](https://github.com/facebook/react-native/commit/5e6478954c77f64a9086757ed4a879e83a1ab404) by [@cortinico](https://github.com/cortinico))
|
||||
- Replaced custom XML decoder with Fresco's built-in decoder ([6feb90bb29](https://github.com/facebook/react-native/commit/6feb90bb290ab460df8df2f6f01531a77aac9008) by [@Abbondanzo](https://github.com/Abbondanzo))
|
||||
- Update Fresco to 3.6.0 ([819b5c2c8d](https://github.com/facebook/react-native/commit/819b5c2c8dfad620152b159838575b6c03e18ffe) by [@Abbondanzo](https://github.com/Abbondanzo))
|
||||
- Migrate jsc-android to mavenCentral ([e42a3a6b84](https://github.com/facebook/react-native/commit/e42a3a6b842d71fc25419c02f6015863fa019f05) by [@Kudo](https://github.com/Kudo))
|
||||
- Migrate ComponentNameResolver to kotlin ([385b9f4265](https://github.com/facebook/react-native/commit/385b9f4265316a1e1cf8627ea7ed3bed790cc8c5) by [@mdvacca](https://github.com/mdvacca))
|
||||
- Update Fresco to 3.5.0 ([72bb2f4089](https://github.com/facebook/react-native/commit/72bb2f4089d5e49b9e8a09f416d63db6c7d2b798) by [@Abbondanzo](https://github.com/Abbondanzo))
|
||||
- Migrate `ReactSwitchManager` to Kotlin ([b886bc4db9](https://github.com/facebook/react-native/commit/b886bc4db970d8c70de1596dc3f88bdc398de482) by [@krozniata](https://github.com/krozniata))
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- Reduce memory allocations when computing accessibilityLabel ([74bdab8bd8](https://github.com/facebook/react-native/commit/74bdab8bd8be2413734004145507c0688232053e) by [@sparga](https://github.com/sparga))
|
||||
- Explicitly define the source files for React-graphics ([3ff9212ce4](https://github.com/facebook/react-native/commit/3ff9212ce46314a749e65dd246e49965288d8f57) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- Use configuration type when adding ndebug flag to pods in release ([462fae4a29](https://github.com/facebook/react-native/commit/462fae4a29ba1a5249d05862d2593dca4d6758c1) by [@benhandanyan](https://github.com/benhandanyan))
|
||||
- Fix typo in utils.rb ([fa03840e68](https://github.com/facebook/react-native/commit/fa03840e688067bf16a7fb60c00efdc9a1813f92) by [@WoLewicki](https://github.com/WoLewicki))
|
||||
|
||||
### Removed
|
||||
|
||||
#### Android specific
|
||||
|
||||
- Removed JSCHeapCapture module, deprecated PackagerCommandListener#onCaptureHeapCommand ([e06fa5d102](https://github.com/facebook/react-native/commit/e06fa5d1026843ec4a2ba3dd209652dc5290c0ba) by [@javache](https://github.com/javache))
|
||||
- Made ReactCookieJarContainer internal. ([18ebea533d](https://github.com/facebook/react-native/commit/18ebea533d348329926bd7782bb55469aa228a4a) by [@javache](https://github.com/javache))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Modified `console.table` to avoid mutating the received argument. ([caa77fbe2b](https://github.com/facebook/react-native/commit/caa77fbe2b03e6969ae9b542d011f926a0ede3c7) by [@rubennorte](https://github.com/rubennorte))
|
||||
- Disable `react-in-jsx-scope` rule in eslint config ([ea56c432b7](https://github.com/facebook/react-native/commit/ea56c432b7a577d3805d1a7b4b46596799dd892e) by [@matinzd](https://github.com/matinzd))
|
||||
- Fix a bug when fantom tests could not be run in parallel, e.g. in a stress-test. ([8696b79f73](https://github.com/facebook/react-native/commit/8696b79f73fec18a9e3785b9a2c150afc9965d76) by [@mijay](https://github.com/mijay))
|
||||
- Fix peer dependencies on React types ([4368368ef5](https://github.com/facebook/react-native/commit/4368368ef5c3f3d08a66ee6c13222f6d81a2d2df) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- Removed unnecessary state updates in React to reflect the current state of looping animations. ([6059660c60](https://github.com/facebook/react-native/commit/6059660c607f5b6edba08a12906f0f9d6cb15d34) by [@rubennorte](https://github.com/rubennorte))
|
||||
- `JSBigFileString` fails for non-zero offset arguments ([7d0338cb0b](https://github.com/facebook/react-native/commit/7d0338cb0b24926aff648a4c8ba5d77b052010cc) by [@jwajgelt](https://github.com/jwajgelt))
|
||||
- Animation.stop() executes when `animatedShouldUseSingleOp` is enabled. ([746d584a23](https://github.com/facebook/react-native/commit/746d584a23f303493faa4f9d857ec542257a92ae) by [@javache](https://github.com/javache))
|
||||
- Fixed `adjustsFontSizeToFit` not working for text with a single character ([47822e9048](https://github.com/facebook/react-native/commit/47822e90480d61e197a3f223e088ee88a0f38ad7) by [@j-piasecki](https://github.com/j-piasecki))
|
||||
|
||||
#### Android specific
|
||||
|
||||
- Fix crash for setEventEmitterCallback NoSuchMethodError on API lvl 26 ([7dcbc799eb](https://github.com/facebook/react-native/commit/7dcbc799eb2fb5792512b71320eafed08deec9ea) by [@cortinico](https://github.com/cortinico))
|
||||
- Fix incorrect height of single line TextInputs without definite size ([9b646c8b7b](https://github.com/facebook/react-native/commit/9b646c8b7b9a23645b1563883768a9274897a1cd) by [@NickGerleman](https://github.com/NickGerleman))
|
||||
- `FLAG_SECURE` not respected in Modal dialog ([7e029b0dcf](https://github.com/facebook/react-native/commit/7e029b0dcf6d1a6455a8a6343457b70e353d0ff6) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- Fix JSC Debug instacrashing ([b10491a3c4](https://github.com/facebook/react-native/commit/b10491a3c457c802608758ca1fe659a72c18576b) by [@cortinico](https://github.com/cortinico))
|
||||
- Fix BackHandle callback undefined cause crash issue ([44705fe11b](https://github.com/facebook/react-native/commit/44705fe11bd9bb12c8f71d1e50a7b48e0af6a38d) by [@BleemIs42](https://github.com/BleemIs42))
|
||||
- Modal: Setting `resource-id` from `testID` prop ([52b6592559](https://github.com/facebook/react-native/commit/52b65925595882d9b6c7f354a5ce3bfe3823738e) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- Handling `testID` correctly for horizontal scroll view ([81c74cd35f](https://github.com/facebook/react-native/commit/81c74cd35f9e40c8ad4663fc932d0dddeaa4bc19) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- Fixed build issue when including mapbuffer jni headers in library code ([ecf17666ad](https://github.com/facebook/react-native/commit/ecf17666ad84e15d31944962e2d0e846a5670977) by [@hannojg](https://github.com/hannojg))
|
||||
- Support Long values in WritableMap and WritableArray ([e7f943de2f](https://github.com/facebook/react-native/commit/e7f943de2fd71d2259ab53e7817d2dcf96559f7e) by [@WoLewicki](https://github.com/WoLewicki))
|
||||
- Re-introduce the deprecated constructor on ReactModuleInfo ([734730df75](https://github.com/facebook/react-native/commit/734730df75b3bdddeb5dbe65f4151cc92b988303) by [@cortinico](https://github.com/cortinico))
|
||||
- Fix JSC by avoiding use of unavailable `str.replaceAll()` ([b5b9e032c2](https://github.com/facebook/react-native/commit/b5b9e032c2b57aa44afb7141a879d83c8b889feb) by [@robhogan](https://github.com/robhogan))
|
||||
- Reverted removal of TurboReactPackage ([70a957452c](https://github.com/facebook/react-native/commit/70a957452c438a74787f4f752b2c274360cb2edd) by [@javache](https://github.com/javache))
|
||||
- SetColorScheme should be called on the UI thread ([2aa79979d3](https://github.com/facebook/react-native/commit/2aa79979d3e4a54008f24c81b6c04553c98ff6b6) by lihaitao)
|
||||
|
||||
#### iOS specific
|
||||
|
||||
- Fix app becoming unresponsive when RefreshControl is used inside of <Modal /> ([6cb2684b43](https://github.com/facebook/react-native/commit/6cb2684b4343bd8698b9770c0f6ef8812683c783) by [@sammy-SC](https://github.com/sammy-SC))
|
||||
- Resolve "Your project does not explicitly specify the CocoaPods master specs repo" `pod install` warning ([2f2281718a](https://github.com/facebook/react-native/commit/2f2281718a2ef905ffd15adf3b47a1b6b6fb8d95) by [@noway](https://github.com/noway))
|
||||
- Enable/disable keyboard shortcuts only on iOS ([8b0af4542e](https://github.com/facebook/react-native/commit/8b0af4542e6fd5628fefdc8e1699326c2225c3f0) by [@okwasniewski](https://github.com/okwasniewski))
|
||||
- Dashed & dotted borders now work with overflow: hidden ([1b88c5b429](https://github.com/facebook/react-native/commit/1b88c5b429888e109b7acae4808b4b6f8b3f920f) by [@joevilches](https://github.com/joevilches))
|
||||
- Emit didUpdateDimensions correctly ([920867d949](https://github.com/facebook/react-native/commit/920867d9494cbfcc9cb0e23607cb339ec1b89ca9) by TobiasH)
|
||||
- Fix applicationDidEnterBackground not being called ([adaceba546](https://github.com/facebook/react-native/commit/adaceba5462b4ad8676745f34e0be2bf5bb25166) by [@alextoudic](https://github.com/alextoudic))
|
||||
- Fixed problem with accessory view & 3rd party libs ([5fc582783d](https://github.com/facebook/react-native/commit/5fc582783d7f70ca9521e317c93624a8845bfff2) by [@kirillzyusko](https://github.com/kirillzyusko))
|
||||
- Fix Direct Debugging with JSC ([b04d17afca](https://github.com/facebook/react-native/commit/b04d17afcac82af1a47fd462a04fe4088d19b468) by [@Saadnajmi](https://github.com/Saadnajmi))
|
||||
- Fix ccache not found error exporting ccache binary path as Xcode user-defined setting to be used by ccache scripts ([d31ac832c5](https://github.com/facebook/react-native/commit/d31ac832c5b866653f7179fd517427f7be11ad45) by [@ste7en](https://github.com/ste7en))
|
||||
- Properly escape paths in Xcode build script used when bundling an app. ([2fee13094b](https://github.com/facebook/react-native/commit/2fee13094b3d384c071978776fd8b7cff0b6530f) by [@kraenhansen](https://github.com/kraenhansen))
|
||||
- Exclude Android HorizontalScrollContentView cxx component code ([4adaacb4f7](https://github.com/facebook/react-native/commit/4adaacb4f7cd136d5534c81fb9b8f5f2a0312d7f) by [@zhongwuzw](https://github.com/zhongwuzw))
|
||||
- Fixed centerContent losing taps and causing jitter ([fe7e97a2fd](https://github.com/facebook/react-native/commit/fe7e97a2fd272db0d9d9aa7d0561337a7c8e2c30) by [@gaearon](https://github.com/gaearon))
|
||||
|
||||
### Unknown
|
||||
|
||||
- Release 0.78.0-rc.0 ([b713f273b6](https://github.com/facebook/react-native/commit/b713f273b6df654e4274ae00a849c39d2efccedc) by [@react-native-bot](https://github.com/react-native-bot))
|
||||
- Bump Hermes ([0c8e15e8bb](https://github.com/facebook/react-native/commit/0c8e15e8bb16ec279290d2390caf75e83d52f518) by [@cipolleschi](https://github.com/cipolleschi))
|
||||
- Include cxx modules in codegen schema ([cf5ab03d43](https://github.com/facebook/react-native/commit/cf5ab03d4324b7e3fce38f9eacc96da82b11b68a) by [@elicwhite](https://github.com/elicwhite))
|
||||
- Add "jsEngine: hermes" to JS runtime Error prototype ([85bdd75828](https://github.com/facebook/react-native/commit/85bdd75828f85230aaa90ed510666457c46f996c) by Maddie Lord)
|
||||
- Translation auto-update for Apps/Wilde/scripts/intl-config.json on master ([5b6e35afda](https://github.com/facebook/react-native/commit/5b6e35afda5f0ef8cc8810ed8c6bd918777292b4) by Intl Scheduler)
|
||||
- Add logging in ReactInstanceManager.onHostPause when activity is incorrectly null ([c2fd35a442](https://github.com/facebook/react-native/commit/c2fd35a4429c752dc2d10a789e4c5f48d22b1eeb) by Maddie Lord)
|
||||
- Remove as_const option (on by default) in fbsource ([e5a526ff44](https://github.com/facebook/react-native/commit/e5a526ff44c25afd935d117d6d4d342f210553a6) by [@panagosg7](https://github.com/panagosg7))
|
||||
- Remove comment syntax from ReactNativeTypes ([a80baac58e](https://github.com/facebook/react-native/commit/a80baac58e9f2fc62829ab76b929f5c8b21c05a5) by [@hoxyq](https://github.com/hoxyq))
|
||||
- Update YGNodeStyleGetGap to return YGValue ([331d99a941](https://github.com/facebook/react-native/commit/331d99a94154678848628122e8fe3373ee67fb9b) by [@heoblitz](https://github.com/heoblitz))
|
||||
- Remove unused-variable in ../xplat/compphoto/gpuEngine/tools/ToolHelpers.cpp +3 ([071d223ee0](https://github.com/facebook/react-native/commit/071d223ee02c6f826d06c033e6c949642bd24b9a) by [@r-barnes](https://github.com/r-barnes))
|
||||
|
||||
#### Android Unknown
|
||||
|
||||
- Fix background getting clipped when border-radius is set ([6d235853fb](https://github.com/facebook/react-native/commit/6d235853fb9e9ad4050ba5611d74921fa1b9c72d) by [@jorge-cab](https://github.com/jorge-cab))
|
||||
|
||||
#### iOS Unknown
|
||||
|
||||
- Static Hermes for React Native ([23eb06f662](https://github.com/facebook/react-native/commit/23eb06f6623f6831ff5f6a2f12e22884de4c1326) by [@piaskowyk](https://github.com/piaskowyk))
|
||||
- Remove unused-variable in xplat/js/react-native-github/packages/react-native/React/Base/RCTModuleData.mm +3 ([72007a14af](https://github.com/facebook/react-native/commit/72007a14af3afe0e161c1144af39759807807f25) by [@r-barnes](https://github.com/r-barnes))
|
||||
|
||||
#### Failed to parse
|
||||
|
||||
- Apply fixup patch to fbsource ([7948044179](https://github.com/facebook/react-native/commit/794804417990848d0fc9bb8939b9c340ced3477f) by generatedunixname499836121)
|
||||
- Test(image): [android] react okhttp network fetcher cache control tests ([37c532a063](https://github.com/facebook/react-native/commit/37c532a063c6054ea974612a40551f7c1399c147) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- Test(network): [android] `ResponseUtil` unit tests ([50d0157f0c](https://github.com/facebook/react-native/commit/50d0157f0c6a4e3224d8064a8b55c523bcd33269) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
- ReactOkHttpNetworkFetcher – cache control headers getting overwritten by the rest of the headers ([81cb166d10](https://github.com/facebook/react-native/commit/81cb166d103f7caaa5135b5a1c66d4e978f3619f) by [@mateoguzmana](https://github.com/mateoguzmana))
|
||||
|
||||
|
||||
## v0.76.6
|
||||
|
||||
### Fixed
|
||||
|
||||
-393
@@ -1,393 +0,0 @@
|
||||
Attribution 4.0 International
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||
does not provide legal services or legal advice. Distribution of
|
||||
Creative Commons public licenses does not create a lawyer-client or
|
||||
other relationship. Creative Commons makes its licenses and related
|
||||
information available on an "as-is" basis. Creative Commons gives no
|
||||
warranties regarding its licenses, any material licensed under their
|
||||
terms and conditions, or any related information. Creative Commons
|
||||
disclaims all liability for damages resulting from their use to the
|
||||
fullest extent possible.
|
||||
|
||||
Using Creative Commons Public Licenses
|
||||
|
||||
Creative Commons public licenses provide a standard set of terms and
|
||||
conditions that creators and other rights holders may use to share
|
||||
original works of authorship and other material subject to copyright
|
||||
and certain other rights specified in the public license below. The
|
||||
following considerations are for informational purposes only, are not
|
||||
exhaustive, and do not form part of our licenses.
|
||||
|
||||
Considerations for licensors: Our public licenses are
|
||||
intended for use by those authorized to give the public
|
||||
permission to use material in ways otherwise restricted by
|
||||
copyright and certain other rights. Our licenses are
|
||||
irrevocable. Licensors should read and understand the terms
|
||||
and conditions of the license they choose before applying it.
|
||||
Licensors should also secure all rights necessary before
|
||||
applying our licenses so that the public can reuse the
|
||||
material as expected. Licensors should clearly mark any
|
||||
material not subject to the license. This includes other CC-
|
||||
licensed material, or material used under an exception or
|
||||
limitation to copyright. More considerations for licensors:
|
||||
wiki.creativecommons.org/Considerations_for_licensors
|
||||
|
||||
Considerations for the public: By using one of our public
|
||||
licenses, a licensor grants the public permission to use the
|
||||
licensed material under specified terms and conditions. If
|
||||
the licensor's permission is not necessary for any reason--for
|
||||
example, because of any applicable exception or limitation to
|
||||
copyright--then that use is not regulated by the license. Our
|
||||
licenses grant only permissions under copyright and certain
|
||||
other rights that a licensor has authority to grant. Use of
|
||||
the licensed material may still be restricted for other
|
||||
reasons, including because others have copyright or other
|
||||
rights in the material. A licensor may make special requests,
|
||||
such as asking that all changes be marked or described.
|
||||
Although not required by our licenses, you are encouraged to
|
||||
respect those requests where reasonable. More_considerations
|
||||
for the public:
|
||||
wiki.creativecommons.org/Considerations_for_licensees
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons Attribution 4.0 International Public License
|
||||
|
||||
By exercising the Licensed Rights (defined below), You accept and agree
|
||||
to be bound by the terms and conditions of this Creative Commons
|
||||
Attribution 4.0 International Public License ("Public License"). To the
|
||||
extent this Public License may be interpreted as a contract, You are
|
||||
granted the Licensed Rights in consideration of Your acceptance of
|
||||
these terms and conditions, and the Licensor grants You such rights in
|
||||
consideration of benefits the Licensor receives from making the
|
||||
Licensed Material available under these terms and conditions.
|
||||
|
||||
|
||||
Section 1 -- Definitions.
|
||||
|
||||
a. Adapted Material means material subject to Copyright and Similar
|
||||
Rights that is derived from or based upon the Licensed Material
|
||||
and in which the Licensed Material is translated, altered,
|
||||
arranged, transformed, or otherwise modified in a manner requiring
|
||||
permission under the Copyright and Similar Rights held by the
|
||||
Licensor. For purposes of this Public License, where the Licensed
|
||||
Material is a musical work, performance, or sound recording,
|
||||
Adapted Material is always produced where the Licensed Material is
|
||||
synched in timed relation with a moving image.
|
||||
|
||||
b. Adapter's License means the license You apply to Your Copyright
|
||||
and Similar Rights in Your contributions to Adapted Material in
|
||||
accordance with the terms and conditions of this Public License.
|
||||
|
||||
c. Copyright and Similar Rights means copyright and/or similar rights
|
||||
closely related to copyright including, without limitation,
|
||||
performance, broadcast, sound recording, and Sui Generis Database
|
||||
Rights, without regard to how the rights are labeled or
|
||||
categorized. For purposes of this Public License, the rights
|
||||
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||
Rights.
|
||||
|
||||
d. Effective Technological Measures means those measures that, in the
|
||||
absence of proper authority, may not be circumvented under laws
|
||||
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||
Treaty adopted on December 20, 1996, and/or similar international
|
||||
agreements.
|
||||
|
||||
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||
any other exception or limitation to Copyright and Similar Rights
|
||||
that applies to Your use of the Licensed Material.
|
||||
|
||||
f. Licensed Material means the artistic or literary work, database,
|
||||
or other material to which the Licensor applied this Public
|
||||
License.
|
||||
|
||||
g. Licensed Rights means the rights granted to You subject to the
|
||||
terms and conditions of this Public License, which are limited to
|
||||
all Copyright and Similar Rights that apply to Your use of the
|
||||
Licensed Material and that the Licensor has authority to license.
|
||||
|
||||
h. Licensor means the individual(s) or entity(ies) granting rights
|
||||
under this Public License.
|
||||
|
||||
i. Share means to provide material to the public by any means or
|
||||
process that requires permission under the Licensed Rights, such
|
||||
as reproduction, public display, public performance, distribution,
|
||||
dissemination, communication, or importation, and to make material
|
||||
available to the public including in ways that members of the
|
||||
public may access the material from a place and at a time
|
||||
individually chosen by them.
|
||||
|
||||
j. Sui Generis Database Rights means rights other than copyright
|
||||
resulting from Directive 96/9/EC of the European Parliament and of
|
||||
the Council of 11 March 1996 on the legal protection of databases,
|
||||
as amended and/or succeeded, as well as other essentially
|
||||
equivalent rights anywhere in the world.
|
||||
|
||||
k. You means the individual or entity exercising the Licensed Rights
|
||||
under this Public License. Your has a corresponding meaning.
|
||||
|
||||
|
||||
Section 2 -- Scope.
|
||||
|
||||
a. License grant.
|
||||
|
||||
1. Subject to the terms and conditions of this Public License,
|
||||
the Licensor hereby grants You a worldwide, royalty-free,
|
||||
non-sublicensable, non-exclusive, irrevocable license to
|
||||
exercise the Licensed Rights in the Licensed Material to:
|
||||
|
||||
a. reproduce and Share the Licensed Material, in whole or
|
||||
in part; and
|
||||
|
||||
b. produce, reproduce, and Share Adapted Material.
|
||||
|
||||
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||
Exceptions and Limitations apply to Your use, this Public
|
||||
License does not apply, and You do not need to comply with
|
||||
its terms and conditions.
|
||||
|
||||
3. Term. The term of this Public License is specified in Section
|
||||
6(a).
|
||||
|
||||
4. Media and formats; technical modifications allowed. The
|
||||
Licensor authorizes You to exercise the Licensed Rights in
|
||||
all media and formats whether now known or hereafter created,
|
||||
and to make technical modifications necessary to do so. The
|
||||
Licensor waives and/or agrees not to assert any right or
|
||||
authority to forbid You from making technical modifications
|
||||
necessary to exercise the Licensed Rights, including
|
||||
technical modifications necessary to circumvent Effective
|
||||
Technological Measures. For purposes of this Public License,
|
||||
simply making modifications authorized by this Section 2(a)
|
||||
(4) never produces Adapted Material.
|
||||
|
||||
5. Downstream recipients.
|
||||
|
||||
a. Offer from the Licensor -- Licensed Material. Every
|
||||
recipient of the Licensed Material automatically
|
||||
receives an offer from the Licensor to exercise the
|
||||
Licensed Rights under the terms and conditions of this
|
||||
Public License.
|
||||
|
||||
b. No downstream restrictions. You may not offer or impose
|
||||
any additional or different terms or conditions on, or
|
||||
apply any Effective Technological Measures to, the
|
||||
Licensed Material if doing so restricts exercise of the
|
||||
Licensed Rights by any recipient of the Licensed
|
||||
Material.
|
||||
|
||||
6. No endorsement. Nothing in this Public License constitutes or
|
||||
may be construed as permission to assert or imply that You
|
||||
are, or that Your use of the Licensed Material is, connected
|
||||
with, or sponsored, endorsed, or granted official status by,
|
||||
the Licensor or others designated to receive attribution as
|
||||
provided in Section 3(a)(1)(A)(i).
|
||||
|
||||
b. Other rights.
|
||||
|
||||
1. Moral rights, such as the right of integrity, are not
|
||||
licensed under this Public License, nor are publicity,
|
||||
privacy, and/or other similar personality rights; however, to
|
||||
the extent possible, the Licensor waives and/or agrees not to
|
||||
assert any such rights held by the Licensor to the limited
|
||||
extent necessary to allow You to exercise the Licensed
|
||||
Rights, but not otherwise.
|
||||
|
||||
2. Patent and trademark rights are not licensed under this
|
||||
Public License.
|
||||
|
||||
3. To the extent possible, the Licensor waives any right to
|
||||
collect royalties from You for the exercise of the Licensed
|
||||
Rights, whether directly or through a collecting society
|
||||
under any voluntary or waivable statutory or compulsory
|
||||
licensing scheme. In all other cases the Licensor expressly
|
||||
reserves any right to collect such royalties.
|
||||
|
||||
|
||||
Section 3 -- License Conditions.
|
||||
|
||||
Your exercise of the Licensed Rights is expressly made subject to the
|
||||
following conditions.
|
||||
|
||||
a. Attribution.
|
||||
|
||||
1. If You Share the Licensed Material (including in modified
|
||||
form), You must:
|
||||
|
||||
a. retain the following if it is supplied by the Licensor
|
||||
with the Licensed Material:
|
||||
|
||||
i. identification of the creator(s) of the Licensed
|
||||
Material and any others designated to receive
|
||||
attribution, in any reasonable manner requested by
|
||||
the Licensor (including by pseudonym if
|
||||
designated);
|
||||
|
||||
ii. a copyright notice;
|
||||
|
||||
iii. a notice that refers to this Public License;
|
||||
|
||||
iv. a notice that refers to the disclaimer of
|
||||
warranties;
|
||||
|
||||
v. a URI or hyperlink to the Licensed Material to the
|
||||
extent reasonably practicable;
|
||||
|
||||
b. indicate if You modified the Licensed Material and
|
||||
retain an indication of any previous modifications; and
|
||||
|
||||
c. indicate the Licensed Material is licensed under this
|
||||
Public License, and include the text of, or the URI or
|
||||
hyperlink to, this Public License.
|
||||
|
||||
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||
reasonable manner based on the medium, means, and context in
|
||||
which You Share the Licensed Material. For example, it may be
|
||||
reasonable to satisfy the conditions by providing a URI or
|
||||
hyperlink to a resource that includes the required
|
||||
information.
|
||||
|
||||
3. If requested by the Licensor, You must remove any of the
|
||||
information required by Section 3(a)(1)(A) to the extent
|
||||
reasonably practicable.
|
||||
|
||||
4. If You Share Adapted Material You produce, the Adapter's
|
||||
License You apply must not prevent recipients of the Adapted
|
||||
Material from complying with this Public License.
|
||||
|
||||
|
||||
Section 4 -- Sui Generis Database Rights.
|
||||
|
||||
Where the Licensed Rights include Sui Generis Database Rights that
|
||||
apply to Your use of the Licensed Material:
|
||||
|
||||
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||
to extract, reuse, reproduce, and Share all or a substantial
|
||||
portion of the contents of the database;
|
||||
|
||||
b. if You include all or a substantial portion of the database
|
||||
contents in a database in which You have Sui Generis Database
|
||||
Rights, then the database in which You have Sui Generis Database
|
||||
Rights (but not its individual contents) is Adapted Material; and
|
||||
|
||||
c. You must comply with the conditions in Section 3(a) if You Share
|
||||
all or a substantial portion of the contents of the database.
|
||||
|
||||
For the avoidance of doubt, this Section 4 supplements and does not
|
||||
replace Your obligations under this Public License where the Licensed
|
||||
Rights include other Copyright and Similar Rights.
|
||||
|
||||
|
||||
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||
|
||||
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||
|
||||
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||
|
||||
c. The disclaimer of warranties and limitation of liability provided
|
||||
above shall be interpreted in a manner that, to the extent
|
||||
possible, most closely approximates an absolute disclaimer and
|
||||
waiver of all liability.
|
||||
|
||||
|
||||
Section 6 -- Term and Termination.
|
||||
|
||||
a. This Public License applies for the term of the Copyright and
|
||||
Similar Rights licensed here. However, if You fail to comply with
|
||||
this Public License, then Your rights under this Public License
|
||||
terminate automatically.
|
||||
|
||||
b. Where Your right to use the Licensed Material has terminated under
|
||||
Section 6(a), it reinstates:
|
||||
|
||||
1. automatically as of the date the violation is cured, provided
|
||||
it is cured within 30 days of Your discovery of the
|
||||
violation; or
|
||||
|
||||
2. upon express reinstatement by the Licensor.
|
||||
|
||||
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||
right the Licensor may have to seek remedies for Your violations
|
||||
of this Public License.
|
||||
|
||||
c. For the avoidance of doubt, the Licensor may also offer the
|
||||
Licensed Material under separate terms or conditions or stop
|
||||
distributing the Licensed Material at any time; however, doing so
|
||||
will not terminate this Public License.
|
||||
|
||||
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||
License.
|
||||
|
||||
|
||||
Section 7 -- Other Terms and Conditions.
|
||||
|
||||
a. The Licensor shall not be bound by any additional or different
|
||||
terms or conditions communicated by You unless expressly agreed.
|
||||
|
||||
b. Any arrangements, understandings, or agreements regarding the
|
||||
Licensed Material not stated herein are separate from and
|
||||
independent of the terms and conditions of this Public License.
|
||||
|
||||
|
||||
Section 8 -- Interpretation.
|
||||
|
||||
a. For the avoidance of doubt, this Public License does not, and
|
||||
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||
conditions on any use of the Licensed Material that could lawfully
|
||||
be made without permission under this Public License.
|
||||
|
||||
b. To the extent possible, if any provision of this Public License is
|
||||
deemed unenforceable, it shall be automatically reformed to the
|
||||
minimum extent necessary to make it enforceable. If the provision
|
||||
cannot be reformed, it shall be severed from this Public License
|
||||
without affecting the enforceability of the remaining terms and
|
||||
conditions.
|
||||
|
||||
c. No term or condition of this Public License will be waived and no
|
||||
failure to comply consented to unless expressly agreed to by the
|
||||
Licensor.
|
||||
|
||||
d. Nothing in this Public License constitutes or may be interpreted
|
||||
as a limitation upon, or waiver of, any privileges and immunities
|
||||
that apply to the Licensor or You, including from the legal
|
||||
processes of any jurisdiction or authority.
|
||||
|
||||
|
||||
=======================================================================
|
||||
|
||||
Creative Commons is not a party to its public licenses.
|
||||
Notwithstanding, Creative Commons may elect to apply one of its public
|
||||
licenses to material it publishes and in those instances will be
|
||||
considered the "Licensor." Except for the limited purpose of indicating
|
||||
that material is shared under a Creative Commons public license or as
|
||||
otherwise permitted by the Creative Commons policies published at
|
||||
creativecommons.org/policies, Creative Commons does not authorize the
|
||||
use of the trademark "Creative Commons" or any other trademark or logo
|
||||
of Creative Commons without its prior written consent including,
|
||||
without limitation, in connection with any unauthorized modifications
|
||||
to any of its public licenses or any other arrangements,
|
||||
understandings, or agreements concerning use of licensed material. For
|
||||
the avoidance of doubt, this paragraph does not form part of the public
|
||||
licenses.
|
||||
|
||||
Creative Commons may be contacted at creativecommons.org.
|
||||
-19
@@ -27,7 +27,6 @@ import com.facebook.react.utils.JsonUtils
|
||||
import com.facebook.react.utils.NdkConfiguratorUtils.configureReactNativeNdk
|
||||
import com.facebook.react.utils.ProjectUtils.isNewArchEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.needsCodegenFromPackageJson
|
||||
import com.facebook.react.utils.ProjectUtils.shouldWarnIfNewArchFlagIsSetInPrealpha
|
||||
import com.facebook.react.utils.findPackageJsonFile
|
||||
import java.io.File
|
||||
import kotlin.system.exitProcess
|
||||
@@ -42,7 +41,6 @@ class ReactPlugin : Plugin<Project> {
|
||||
override fun apply(project: Project) {
|
||||
checkJvmVersion(project)
|
||||
val extension = project.extensions.create("react", ReactExtension::class.java, project)
|
||||
checkIfNewArchFlagIsSet(project, extension)
|
||||
|
||||
// We register a private extension on the rootProject so that project wide configs
|
||||
// like codegen config can be propagated from app project to libraries.
|
||||
@@ -112,23 +110,6 @@ class ReactPlugin : Plugin<Project> {
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkIfNewArchFlagIsSet(project: Project, extension: ReactExtension) {
|
||||
if (project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)) {
|
||||
project.logger.warn(
|
||||
"""
|
||||
|
||||
********************************************************************************
|
||||
|
||||
WARNING: This version of React Native is ignoring the `newArchEnabled` flag you set. Please set it to true or remove it to suppress this warning.
|
||||
|
||||
|
||||
********************************************************************************
|
||||
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
}
|
||||
|
||||
/** This function sets up `react-native-codegen` in our Gradle plugin. */
|
||||
@Suppress("UnstableApiUsage")
|
||||
private fun configureCodegen(
|
||||
|
||||
+1
-47
@@ -17,7 +17,6 @@ import com.facebook.react.utils.PropertyUtils.REACT_NATIVE_ARCHITECTURES
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_HERMES_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_NEW_ARCH_ENABLED
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_REACT_NATIVE_ARCHITECTURES
|
||||
import java.io.File
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
|
||||
@@ -29,8 +28,7 @@ internal object ProjectUtils {
|
||||
return (project.hasProperty(NEW_ARCH_ENABLED) &&
|
||||
project.property(NEW_ARCH_ENABLED).toString().toBoolean()) ||
|
||||
(project.hasProperty(SCOPED_NEW_ARCH_ENABLED) &&
|
||||
project.property(SCOPED_NEW_ARCH_ENABLED).toString().toBoolean()) ||
|
||||
shouldEnableNewArchForReactNativeVersion(project.reactNativeDir(extension))
|
||||
project.property(SCOPED_NEW_ARCH_ENABLED).toString().toBoolean())
|
||||
}
|
||||
|
||||
internal val Project.isHermesEnabled: Boolean
|
||||
@@ -83,50 +81,6 @@ internal object ProjectUtils {
|
||||
internal fun Project.reactNativeDir(extension: ReactExtension): String =
|
||||
extension.reactNativeDir.get().asFile.absolutePath
|
||||
|
||||
internal fun shouldEnableNewArchForReactNativeVersion(reactNativeDir: String): Boolean {
|
||||
val packageJsonFile = File(reactNativeDir, "package.json")
|
||||
if (!packageJsonFile.exists()) {
|
||||
return false
|
||||
}
|
||||
|
||||
val rnPackageJson = JsonUtils.fromPackageJson(packageJsonFile)
|
||||
if (rnPackageJson == null) {
|
||||
return false
|
||||
}
|
||||
|
||||
// This regex describe the version syntax for React Native in the shape of
|
||||
// major.minor.patch[-<prerelease>[[-.]k]]
|
||||
// Where
|
||||
// major is a number
|
||||
// minor is a number
|
||||
// patch is a number
|
||||
// <prerelease>[-.]k is optional, but if present is preceeded by a `-`
|
||||
// the <prerelease> tag is a string.
|
||||
// it can be followed by `-` or `.` and k is a number.
|
||||
val regex = """^(\d+)\.(\d+)\.(\d+)(?:-(\w+(?:[-.]\d+)?))?$""".toRegex()
|
||||
|
||||
val matchResult = regex.find(rnPackageJson.version)
|
||||
|
||||
if (matchResult == null) {
|
||||
return false
|
||||
}
|
||||
|
||||
val prerelease = matchResult.groupValues[4].toString()
|
||||
return prerelease.contains("prealpha")
|
||||
}
|
||||
|
||||
internal fun Project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension: ReactExtension): Boolean {
|
||||
|
||||
val propertySetToFalse =
|
||||
(this.hasPropertySetToFalse(NEW_ARCH_ENABLED)) ||
|
||||
(this.hasPropertySetToFalse(SCOPED_NEW_ARCH_ENABLED))
|
||||
|
||||
val shouldEnableNewArch =
|
||||
shouldEnableNewArchForReactNativeVersion(this.reactNativeDir(extension))
|
||||
|
||||
return shouldEnableNewArch && propertySetToFalse
|
||||
}
|
||||
|
||||
internal fun Project.hasPropertySetToFalse(property: String): Boolean =
|
||||
this.hasProperty(property) && this.property(property).toString().toBoolean() == false
|
||||
}
|
||||
|
||||
-283
@@ -15,7 +15,6 @@ import com.facebook.react.utils.ProjectUtils.getReactNativeArchitectures
|
||||
import com.facebook.react.utils.ProjectUtils.isHermesEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.isNewArchEnabled
|
||||
import com.facebook.react.utils.ProjectUtils.needsCodegenFromPackageJson
|
||||
import com.facebook.react.utils.ProjectUtils.shouldWarnIfNewArchFlagIsSetInPrealpha
|
||||
import java.io.File
|
||||
import org.assertj.core.api.Assertions.assertThat
|
||||
import org.junit.Rule
|
||||
@@ -75,78 +74,6 @@ class ProjectUtilsTest {
|
||||
assertThat(project.isNewArchEnabled(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isNewArchEnabled_withRNVersionPrealpha_returnTrue() {
|
||||
val project = createProject()
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-202310916"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.isNewArchEnabled(extension)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isNewArchEnabled_withRNVersion1PrereleaseString_returnTrue() {
|
||||
val project = createProject()
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "1.2.3-prealpha0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.isNewArchEnabled(extension)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isNewArchEnabled_withRNVersion1PrereleaseStringDotNumber_returnTrue() {
|
||||
val project = createProject()
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "1.2.3-prealpha.0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.isNewArchEnabled(extension)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isNewArchEnabled_withRNVersion1PrereleaseStringDashNumber_returnTrue() {
|
||||
val project = createProject()
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "1.2.3-prealpha-0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.isNewArchEnabled(extension)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun isNewArchEnabled_withRNVersion1000_returnFalse() {
|
||||
val project = createProject()
|
||||
@@ -320,214 +247,4 @@ class ProjectUtilsTest {
|
||||
assertThat(archs[2]).isEqualTo("x86")
|
||||
assertThat(archs[3]).isEqualTo("x86_64")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenNewArchIsSetToFalseAndOnPrealpha_returnTrue() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("newArchEnabled", "false")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-2023100915"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenScopedNewArchIsSetToFalseAndOnPrealpha_returnTrue() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("react.newArchEnabled", "false")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-2023100915"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenBothAreSetToFalseAndOnPrealpha_returnTrue() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("newArchEnabled", "false")
|
||||
project.extensions.extraProperties.set("react.newArchEnabled", "false")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-2023100915"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenNewArchIsSetToTrueAndOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("newArchEnabled", "true")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-2023100915"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenScopedNewArchIsSetToTrueAndOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("react.newArchEnabled", "true")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-2023100915"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenBothAreSetToTrueAndOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("newArchEnabled", "true")
|
||||
project.extensions.extraProperties.set("react.newArchEnabled", "true")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-2023100915"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenNoneAreSetAndOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.0.0-prealpha-2023100915"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenNewArchIsSetToTrueAndNotOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("newxArchEnabled", "true")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.73.0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenScopedNewArchIsSetToTrueAndNotOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("react.newxArchEnabled", "true")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.73.0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenBothAreSetToTrueAndNotOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
project.extensions.extraProperties.set("newArchEnabled", "true")
|
||||
project.extensions.extraProperties.set("react.newxArchEnabled", "true")
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.73.0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun shouldWarnIfNewArchFlagIsSetInPrealpha_whenNoneAreSetAndNotOnPrealpha_returnFalse() {
|
||||
val project = createProject()
|
||||
val extension = TestReactExtension(project)
|
||||
File(tempFolder.root, "package.json").apply {
|
||||
writeText(
|
||||
// language=json
|
||||
"""
|
||||
{
|
||||
"version": "0.73.0"
|
||||
}
|
||||
"""
|
||||
.trimIndent())
|
||||
}
|
||||
extension.reactNativeDir.set(tempFolder.root)
|
||||
assertThat(project.shouldWarnIfNewArchFlagIsSetInPrealpha(extension)).isFalse()
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+4
-4
@@ -25,7 +25,7 @@ import type {
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
@@ -39,9 +39,9 @@ type NativeProps = $ReadOnly<{|
|
||||
edgeInsets?: $ReadOnlyArray<EdgeInsetsValue>,
|
||||
dimensions?: $ReadOnlyArray<DimensionValue>,
|
||||
sizes?: WithDefault<$ReadOnlyArray<'small' | 'large'>, 'small'>,
|
||||
object?: $ReadOnlyArray<$ReadOnly<{|prop: string|}>>,
|
||||
arrayOfObjects?: $ReadOnlyArray<$ReadOnly<{|prop1: Float, prop2: Int32|}>>,
|
||||
|}>;
|
||||
object?: $ReadOnlyArray<$ReadOnly<{prop: string}>>,
|
||||
arrayOfObjects?: $ReadOnlyArray<$ReadOnly<{prop1: Float, prop2: Int32}>>,
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'ArrayPropsNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -14,13 +14,13 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
disabled?: WithDefault<boolean, false>,
|
||||
disabledNullable?: WithDefault<boolean, null>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'BooleanPropNativeComponentView',
|
||||
|
||||
+2
-2
@@ -14,12 +14,12 @@ import type {ColorValue} from 'react-native/Libraries/StyleSheet/StyleSheet';
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
tintColor?: ColorValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'ColorPropNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -14,12 +14,12 @@ import type {DimensionValue} from 'react-native/Libraries/StyleSheet/StyleSheetT
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
marginBack?: DimensionValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'DimensionPropNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -13,13 +13,13 @@ import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNat
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
// TODO(T104760003) Fix EdgeInsetsValue in codegen
|
||||
// contentInset?: EdgeInsetsValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'EdgeInsetsPropNativeComponentView',
|
||||
|
||||
+2
-2
@@ -14,13 +14,13 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
alignment?: WithDefault<'top' | 'center' | 'bottom-right', 'center'>,
|
||||
intervals?: WithDefault<0 | 15 | 30 | 60, 0>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'EnumPropNativeComponentView',
|
||||
|
||||
+4
-4
@@ -18,7 +18,7 @@ import type {
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type OnChangeEvent = $ReadOnly<{|
|
||||
type OnChangeEvent = $ReadOnly<{
|
||||
location: {
|
||||
source: {url: string, ...},
|
||||
x: Int32,
|
||||
@@ -26,9 +26,9 @@ type OnChangeEvent = $ReadOnly<{|
|
||||
arrayOfObjects: $ReadOnlyArray<{value: $ReadOnly<{str: string}>}>,
|
||||
...
|
||||
},
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
@@ -36,7 +36,7 @@ type NativeProps = $ReadOnly<{|
|
||||
|
||||
// Events
|
||||
onChange?: ?BubblingEventHandler<OnChangeEvent>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'EventNestedObjectPropsNativeComponentView',
|
||||
|
||||
Vendored
+8
-8
@@ -20,22 +20,22 @@ import type {
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type OnChangeEvent = $ReadOnly<{|
|
||||
type OnChangeEvent = $ReadOnly<{
|
||||
value: boolean,
|
||||
source?: string,
|
||||
progress: ?Int32,
|
||||
scale?: ?Float,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type OnEventDirect = $ReadOnly<{|
|
||||
type OnEventDirect = $ReadOnly<{
|
||||
value: boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type OnOrientationChangeEvent = $ReadOnly<{|
|
||||
type OnOrientationChangeEvent = $ReadOnly<{
|
||||
orientation: 'landscape' | 'portrait',
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
@@ -57,7 +57,7 @@ type NativeProps = $ReadOnly<{|
|
||||
null,
|
||||
'paperBubblingName',
|
||||
>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'EventPropsNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -17,7 +17,7 @@ import type {
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
@@ -28,7 +28,7 @@ type NativeProps = $ReadOnly<{|
|
||||
blurRadius5?: WithDefault<Float, 1>,
|
||||
blurRadius6?: WithDefault<Float, -0.0>,
|
||||
blurRadiusNullable?: WithDefault<Float, null>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'FloatPropsNativeComponentView',
|
||||
|
||||
+2
-2
@@ -14,12 +14,12 @@ import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNat
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
thumbImage?: ImageSource,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'ImagePropNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -17,14 +17,14 @@ import type {
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
progress1?: WithDefault<Int32, 0>,
|
||||
progress2?: WithDefault<Int32, -1>,
|
||||
progress3?: WithDefault<Int32, 10>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'IntegerPropNativeComponentView',
|
||||
|
||||
Vendored
+3
-3
@@ -17,15 +17,15 @@ import type {
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
title?: WithDefault<string, ''>,
|
||||
|
||||
// Events
|
||||
onChange?: ?BubblingEventHandler<$ReadOnly<{|value: boolean|}>>,
|
||||
|}>;
|
||||
onChange?: ?BubblingEventHandler<$ReadOnly<{value: boolean}>>,
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'InterfaceOnlyNativeComponentView',
|
||||
|
||||
+2
-2
@@ -14,12 +14,12 @@ import type {UnsafeMixed} from 'react-native/Libraries/Types/CodegenTypes';
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
mixedProp?: UnsafeMixed,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'MixedPropNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -16,7 +16,7 @@ import type {PointValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
@@ -24,7 +24,7 @@ type NativeProps = $ReadOnly<{|
|
||||
color?: ColorValue,
|
||||
thumbTintColor?: ColorValue,
|
||||
point?: PointValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'MultiNativePropNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -13,11 +13,11 @@ import type {HostComponent} from 'react-native/Libraries/Renderer/shims/ReactNat
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// No Props or events
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'NoPropsNoEventsNativeComponentView',
|
||||
|
||||
Vendored
+8
-8
@@ -21,29 +21,29 @@ import type {
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type ObjectArrayPropType = $ReadOnly<{|
|
||||
type ObjectArrayPropType = $ReadOnly<{
|
||||
array: $ReadOnlyArray<string>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
objectProp?: $ReadOnly<{|
|
||||
objectProp?: $ReadOnly<{
|
||||
stringProp?: WithDefault<string, ''>,
|
||||
booleanProp: boolean,
|
||||
floatProp: Float,
|
||||
intProp: Int32,
|
||||
stringEnumProp?: WithDefault<'small' | 'large', 'small'>,
|
||||
intEnumProp?: WithDefault<0 | 1, 0>,
|
||||
|}>,
|
||||
}>,
|
||||
objectArrayProp: ObjectArrayPropType,
|
||||
objectPrimitiveRequiredProp: $ReadOnly<{|
|
||||
objectPrimitiveRequiredProp: $ReadOnly<{
|
||||
image: ImageSource,
|
||||
color?: ColorValue,
|
||||
point: ?PointValue,
|
||||
|}>,
|
||||
|}>;
|
||||
}>,
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'ObjectPropsNativeComponent',
|
||||
|
||||
+2
-2
@@ -14,12 +14,12 @@ import type {PointValue} from 'react-native/Libraries/StyleSheet/StyleSheetTypes
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
startPoint?: PointValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'PointPropNativeComponentView',
|
||||
|
||||
Vendored
+2
-2
@@ -14,13 +14,13 @@ import type {WithDefault} from 'react-native/Libraries/Types/CodegenTypes';
|
||||
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
// Props
|
||||
placeholder?: WithDefault<string, ''>,
|
||||
defaultValue?: string,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export default (codegenNativeComponent<NativeProps>(
|
||||
'StringPropNativeComponentView',
|
||||
|
||||
+4
-4
@@ -12,9 +12,9 @@ import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
|
||||
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
export type StateType = {|
|
||||
export type StateType = {
|
||||
state: string,
|
||||
|};
|
||||
};
|
||||
|
||||
export enum StatusRegularEnum {
|
||||
Active,
|
||||
@@ -40,13 +40,13 @@ export enum StatusLowerCaseEnum {
|
||||
Off = 'off',
|
||||
}
|
||||
|
||||
export type StateTypeWithEnums = {|
|
||||
export type StateTypeWithEnums = {
|
||||
state: string,
|
||||
regular: StatusRegularEnum,
|
||||
str: StatusStrEnum,
|
||||
num: StatusNumEnum,
|
||||
lowerCase: StatusLowerCaseEnum,
|
||||
|};
|
||||
};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getStatusRegular: (statusProp: StateType) => StatusRegularEnum;
|
||||
|
||||
+18
-18
@@ -17,46 +17,46 @@ type AnotherGenericObject = GenericObject;
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getGenericObject: (arg: Object) => Object;
|
||||
+getGenericObjectReadOnly: (arg: Object) => $ReadOnly<{|a: string|}>;
|
||||
+getGenericObjectReadOnly: (arg: Object) => $ReadOnly<{a: string}>;
|
||||
+getGenericObjectWithAlias: (arg: GenericObject) => AnotherGenericObject;
|
||||
+difficultObject: (A: {|
|
||||
+difficultObject: (A: {
|
||||
D: boolean,
|
||||
E: {|
|
||||
E: {
|
||||
D: boolean,
|
||||
E: number,
|
||||
F: string,
|
||||
|},
|
||||
},
|
||||
F: string,
|
||||
|}) => {|
|
||||
}) => {
|
||||
D: boolean,
|
||||
E: {|
|
||||
E: {
|
||||
D: boolean,
|
||||
E: {|
|
||||
E: {
|
||||
D: boolean,
|
||||
E: number,
|
||||
F: string,
|
||||
|},
|
||||
},
|
||||
F: string,
|
||||
|},
|
||||
},
|
||||
F: string,
|
||||
|};
|
||||
+getConstants: () => {|
|
||||
};
|
||||
+getConstants: () => {
|
||||
D: boolean,
|
||||
E: {|
|
||||
E: {
|
||||
D: boolean,
|
||||
E: {|
|
||||
E: {
|
||||
D: boolean,
|
||||
E: {|
|
||||
E: {
|
||||
D: boolean,
|
||||
E: number,
|
||||
F: string,
|
||||
|},
|
||||
},
|
||||
F: string,
|
||||
|},
|
||||
},
|
||||
F: string,
|
||||
|},
|
||||
},
|
||||
F: string,
|
||||
|};
|
||||
};
|
||||
}
|
||||
|
||||
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
||||
|
||||
Vendored
+8
-8
@@ -13,24 +13,24 @@ import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
+getConstants: () => {|
|
||||
+getConstants: () => {
|
||||
D?: ?boolean,
|
||||
A?: Array<any>,
|
||||
E?: ?{|
|
||||
E?: ?{
|
||||
D?: ?boolean,
|
||||
E?: ?{|
|
||||
E?: ?{
|
||||
D?: ?boolean,
|
||||
E?: ?{|
|
||||
E?: ?{
|
||||
D?: boolean,
|
||||
E?: number,
|
||||
F?: string,
|
||||
|},
|
||||
},
|
||||
F?: string,
|
||||
|},
|
||||
},
|
||||
F?: string,
|
||||
|},
|
||||
},
|
||||
F?: string,
|
||||
|};
|
||||
};
|
||||
}
|
||||
|
||||
export default (TurboModuleRegistry.getEnforcing<Spec>(
|
||||
|
||||
Vendored
+2
-2
@@ -14,10 +14,10 @@ import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
|
||||
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
export type SomeObj = {|
|
||||
export type SomeObj = {
|
||||
a: string,
|
||||
b?: boolean,
|
||||
|};
|
||||
};
|
||||
|
||||
export type PartialSomeObj = Partial<SomeObj>;
|
||||
|
||||
|
||||
+5
-5
@@ -15,24 +15,24 @@ import type {
|
||||
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
type Animal = {|
|
||||
type Animal = {
|
||||
name: string,
|
||||
|};
|
||||
};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
// Exported methods.
|
||||
+getConstants: () => {|
|
||||
+getConstants: () => {
|
||||
const1: boolean,
|
||||
const2: number,
|
||||
const3: string,
|
||||
|};
|
||||
};
|
||||
+voidFunc: () => void;
|
||||
+getBool: (arg: boolean) => boolean;
|
||||
+getNumber: (arg: number) => number;
|
||||
+getString: (arg: string) => string;
|
||||
+getArray: (arg: Array<any>) => Array<any>;
|
||||
+getObject: (arg: Object) => Object;
|
||||
+getObjectShape: (arg: {|prop: number|}) => {|prop: number|};
|
||||
+getObjectShape: (arg: {prop: number}) => {prop: number};
|
||||
+getAlias: (arg: Animal) => Animal;
|
||||
+getRootTag: (arg: RootTag) => RootTag;
|
||||
+getValue: (
|
||||
|
||||
Vendored
+6
-6
@@ -15,25 +15,25 @@ import type {
|
||||
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
type Animal = {|
|
||||
type Animal = {
|
||||
name: string,
|
||||
|};
|
||||
};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
// Exported methods.
|
||||
+getConstants: () => {|
|
||||
+getConstants: () => {
|
||||
const1: Array<boolean>,
|
||||
const2: Array<number>,
|
||||
const3: Array<string>,
|
||||
id?: Array<?{|prop: number|}>,
|
||||
|};
|
||||
id?: Array<?{prop: number}>,
|
||||
};
|
||||
+voidFunc: () => void;
|
||||
+getBool: (id: Array<boolean>) => Array<boolean>;
|
||||
+getNumber: (arg: Array<number>) => Array<number>;
|
||||
+getString: (arg: Array<string>) => Array<string>;
|
||||
+getArray: (arg: Array<Array<any>>) => Array<Array<any>>;
|
||||
+getObject: (arg: Array<Object>) => Array<Object>;
|
||||
+getObjectShape: (arg: Array<{|prop: number|}>) => Array<{|prop: number|}>;
|
||||
+getObjectShape: (arg: Array<{prop: number}>) => Array<{prop: number}>;
|
||||
+getAlias: (arg: Array<Animal>) => Array<Animal>;
|
||||
+getRootTag: (arg: Array<RootTag>) => Array<RootTag>;
|
||||
+getValue: (
|
||||
|
||||
Vendored
+5
-5
@@ -15,24 +15,24 @@ import type {
|
||||
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
type Animal = ?{|
|
||||
type Animal = ?{
|
||||
name: ?string,
|
||||
|};
|
||||
};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
// Exported methods.
|
||||
+getConstants: () => {|
|
||||
+getConstants: () => {
|
||||
const1: ?boolean,
|
||||
const2: ?number,
|
||||
const3: ?string,
|
||||
|};
|
||||
};
|
||||
+voidFunc: () => void;
|
||||
+getBool: (arg: ?boolean) => ?boolean;
|
||||
+getNumber: (arg: ?number) => ?number;
|
||||
+getString: (arg: ?string) => ?string;
|
||||
+getArray: (arg: ?Array<any>) => ?Array<any>;
|
||||
+getObject: (arg: ?Object) => ?Object;
|
||||
+getObjectShape: (arg: ?{|prop: ?number|}) => ?{|prop: ?number|};
|
||||
+getObjectShape: (arg: ?{prop: ?number}) => ?{prop: ?number};
|
||||
+getAlias: (arg: ?Animal) => ?Animal;
|
||||
+getRootTag: (arg: ?RootTag) => ?RootTag;
|
||||
+getValue: (x: ?number, y: ?string, z: ?Object) => ?Object;
|
||||
|
||||
+5
-5
@@ -15,24 +15,24 @@ import type {
|
||||
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
type Animal = ?{|
|
||||
type Animal = ?{
|
||||
name?: ?string,
|
||||
|};
|
||||
};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
// Exported methods.
|
||||
+getConstants?: () => {|
|
||||
+getConstants?: () => {
|
||||
const1?: ?boolean,
|
||||
const2?: ?number,
|
||||
const3?: ?string,
|
||||
|};
|
||||
};
|
||||
+voidFunc?: () => void;
|
||||
+getBool?: (arg?: ?boolean) => ?boolean;
|
||||
+getNumber?: (arg?: ?number) => ?number;
|
||||
+getString?: (arg?: ?string) => ?string;
|
||||
+getArray?: (arg?: ?Array<any>) => ?Array<any>;
|
||||
+getObject?: (arg?: ?Object) => ?Object;
|
||||
+getObjectShape?: (arg?: {|prop?: ?number|}) => {|prop?: ?number|};
|
||||
+getObjectShape?: (arg?: {prop?: ?number}) => {prop?: ?number};
|
||||
+getAlias?: (arg?: ?Animal) => ?Animal;
|
||||
+getRootTag?: (arg?: ?RootTag) => ?RootTag;
|
||||
+getValue?: (x?: ?number, y?: ?string, z?: ?Object) => ?Object;
|
||||
|
||||
Vendored
+5
-5
@@ -15,24 +15,24 @@ import type {
|
||||
|
||||
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
||||
|
||||
type Animal = {|
|
||||
type Animal = {
|
||||
name?: string,
|
||||
|};
|
||||
};
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
// Exported methods.
|
||||
+getConstants?: () => {|
|
||||
+getConstants?: () => {
|
||||
const1?: boolean,
|
||||
const2?: number,
|
||||
const3?: string,
|
||||
|};
|
||||
};
|
||||
+voidFunc?: () => void;
|
||||
+getBool?: (arg?: boolean) => boolean;
|
||||
+getNumber?: (arg?: number) => number;
|
||||
+getString?: (arg?: string) => string;
|
||||
+getArray?: (arg?: Array<any>) => Array<any>;
|
||||
+getObject?: (arg?: Object) => Object;
|
||||
+getObjectShape?: (arg?: {|prop?: number|}) => {|prop?: number|};
|
||||
+getObjectShape?: (arg?: {prop?: number}) => {prop?: number};
|
||||
+getAlias?: (arg?: Animal) => Animal;
|
||||
+getRootTag?: (arg?: RootTag) => RootTag;
|
||||
+getValue?: (x?: number, y?: string, z?: Object) => Object;
|
||||
|
||||
@@ -28,18 +28,18 @@ type Event = $ReadOnly<{
|
||||
doubles: $ReadOnlyArray<Double>,
|
||||
yesNos: $ReadOnlyArray<'yep' | 'nope'>,
|
||||
strings: $ReadOnlyArray<string>,
|
||||
latLons: $ReadOnlyArray<{|lat: Double, lon: Double|}>,
|
||||
latLons: $ReadOnlyArray<{lat: Double, lon: Double}>,
|
||||
multiArrays: $ReadOnlyArray<$ReadOnlyArray<Int32>>,
|
||||
}>;
|
||||
|
||||
type NativeProps = $ReadOnly<{|
|
||||
type NativeProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
opacity?: Float,
|
||||
values: $ReadOnlyArray<Int32>,
|
||||
|
||||
// Events
|
||||
onIntArrayChanged?: ?BubblingEventHandler<Event>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type NativeComponentType = HostComponent<NativeProps>;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ const ActionSheetIOS = {
|
||||
* See https://reactnative.dev/docs/actionsheetios#showactionsheetwithoptions
|
||||
*/
|
||||
showActionSheetWithOptions(
|
||||
options: {|
|
||||
options: {
|
||||
+title?: ?string,
|
||||
+message?: ?string,
|
||||
+options: Array<string>,
|
||||
@@ -52,7 +52,7 @@ const ActionSheetIOS = {
|
||||
+disabledButtonTintColor?: ColorValue | ProcessedColorValue,
|
||||
+userInterfaceStyle?: string,
|
||||
+disabledButtonIndices?: Array<number>,
|
||||
|},
|
||||
},
|
||||
callback: (buttonIndex: number) => void,
|
||||
) {
|
||||
invariant(
|
||||
|
||||
@@ -192,4 +192,4 @@ export default {
|
||||
forkEvent: AnimatedImplementation.forkEvent,
|
||||
unforkEvent: AnimatedImplementation.unforkEvent,
|
||||
Event: AnimatedEvent,
|
||||
};
|
||||
} as typeof AnimatedImplementation;
|
||||
|
||||
+27
-9
@@ -10,17 +10,35 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import type {AnimatedComponentType} from './createAnimatedComponent';
|
||||
|
||||
import AnimatedImplementation from './AnimatedImplementation';
|
||||
import React from 'react';
|
||||
|
||||
export default {
|
||||
...AnimatedImplementation,
|
||||
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
||||
* types. Plain intrinsic components can't be typed like this */
|
||||
div: (AnimatedImplementation.createAnimatedComponent('div'): $FlowFixMe),
|
||||
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
||||
* types. Plain intrinsic components can't be typed like this */
|
||||
span: (AnimatedImplementation.createAnimatedComponent('span'): $FlowFixMe),
|
||||
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
||||
* types. Plain intrinsic components can't be typed like this */
|
||||
img: (AnimatedImplementation.createAnimatedComponent('img'): $FlowFixMe),
|
||||
div: AnimatedImplementation.createAnimatedComponent<
|
||||
React.PropsOf<'div'>,
|
||||
mixed,
|
||||
>(
|
||||
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
||||
* types. Plain intrinsic components can't be typed like this */
|
||||
'div',
|
||||
) as AnimatedComponentType<React.PropsOf<'div'>>,
|
||||
span: AnimatedImplementation.createAnimatedComponent<
|
||||
React.PropsOf<'span'>,
|
||||
mixed,
|
||||
>(
|
||||
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
||||
* types. Plain intrinsic components can't be typed like this */
|
||||
'span',
|
||||
) as AnimatedComponentType<React.PropsOf<'span'>>,
|
||||
img: AnimatedImplementation.createAnimatedComponent<
|
||||
React.PropsOf<'img'>,
|
||||
mixed,
|
||||
>(
|
||||
/* $FlowFixMe[incompatible-call] createAnimatedComponent expects to receive
|
||||
* types. Plain intrinsic components can't be typed like this */
|
||||
'img',
|
||||
) as AnimatedComponentType<React.PropsOf<'img'>>,
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
import type {EventSubscription} from '../../vendor/emitter/EventEmitter';
|
||||
import type {PlatformConfig} from '../AnimatedPlatformConfig';
|
||||
import type Animation, {EndCallback} from '../animations/Animation';
|
||||
import type {InterpolationConfigType} from './AnimatedInterpolation';
|
||||
import type AnimatedNode from './AnimatedNode';
|
||||
@@ -131,6 +132,11 @@ export default class AnimatedValue extends AnimatedWithChildren {
|
||||
return this._value + this._offset;
|
||||
}
|
||||
|
||||
__makeNative(platformConfig: ?PlatformConfig): void {
|
||||
super.__makeNative(platformConfig);
|
||||
this.#ensureUpdateSubscriptionExists();
|
||||
}
|
||||
|
||||
#ensureUpdateSubscriptionExists(): void {
|
||||
if (this.#updateSubscription != null) {
|
||||
return;
|
||||
|
||||
+14
-13
@@ -276,6 +276,20 @@ function useAnimatedPropsLifecycle_insertionEffects(node: AnimatedProps): void {
|
||||
// if the queue is empty. When multiple animated components are mounted at
|
||||
// the same time. Only first component flushes the queue and the others will noop.
|
||||
NativeAnimatedHelper.API.flushQueue();
|
||||
let drivenAnimationEndedListener: ?EventSubscription = null;
|
||||
if (node.__isNative) {
|
||||
drivenAnimationEndedListener =
|
||||
NativeAnimatedHelper.nativeEventEmitter.addListener(
|
||||
'onUserDrivenAnimationEnded',
|
||||
data => {
|
||||
node.update();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
return () => {
|
||||
drivenAnimationEndedListener?.remove();
|
||||
};
|
||||
});
|
||||
|
||||
useInsertionEffect(() => {
|
||||
@@ -287,17 +301,6 @@ function useAnimatedPropsLifecycle_insertionEffects(node: AnimatedProps): void {
|
||||
|
||||
useInsertionEffect(() => {
|
||||
node.__attach();
|
||||
let drivenAnimationEndedListener: ?EventSubscription = null;
|
||||
|
||||
if (node.__isNative) {
|
||||
drivenAnimationEndedListener =
|
||||
NativeAnimatedHelper.nativeEventEmitter.addListener(
|
||||
'onUserDrivenAnimationEnded',
|
||||
data => {
|
||||
node.update();
|
||||
},
|
||||
);
|
||||
}
|
||||
if (prevNodeRef.current != null) {
|
||||
const prevNode = prevNodeRef.current;
|
||||
// TODO: Stop restoring default values (unless `reset` is called).
|
||||
@@ -312,8 +315,6 @@ function useAnimatedPropsLifecycle_insertionEffects(node: AnimatedProps): void {
|
||||
} else {
|
||||
prevNodeRef.current = node;
|
||||
}
|
||||
|
||||
drivenAnimationEndedListener?.remove();
|
||||
};
|
||||
}, [node]);
|
||||
}
|
||||
|
||||
+2
-1
@@ -12,7 +12,8 @@
|
||||
|
||||
import type {BlobOptions} from './BlobTypes';
|
||||
|
||||
const Blob = require('./Blob');
|
||||
import Blob from './Blob';
|
||||
|
||||
const invariant = require('invariant');
|
||||
|
||||
/**
|
||||
|
||||
+4
-4
@@ -26,15 +26,15 @@ const GRAY = '#999999';
|
||||
|
||||
type IndicatorSize = number | 'small' | 'large';
|
||||
|
||||
type IOSProps = $ReadOnly<{|
|
||||
type IOSProps = $ReadOnly<{
|
||||
/**
|
||||
Whether the indicator should hide when not animating.
|
||||
|
||||
@platform ios
|
||||
*/
|
||||
hidesWhenStopped?: ?boolean,
|
||||
|}>;
|
||||
type Props = $ReadOnly<{|
|
||||
}>;
|
||||
type Props = $ReadOnly<{
|
||||
...ViewProps,
|
||||
...IOSProps,
|
||||
|
||||
@@ -58,7 +58,7 @@ type Props = $ReadOnly<{|
|
||||
@type {@platform android} number
|
||||
*/
|
||||
size?: ?IndicatorSize,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
const ActivityIndicator = (
|
||||
{
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ import View from './View/View';
|
||||
import invariant from 'invariant';
|
||||
import * as React from 'react';
|
||||
|
||||
type ButtonProps = $ReadOnly<{|
|
||||
type ButtonProps = $ReadOnly<{
|
||||
/**
|
||||
Text to display inside the button. On Android the given title will be
|
||||
converted to the uppercased form.
|
||||
@@ -167,7 +167,7 @@ type ButtonProps = $ReadOnly<{|
|
||||
importantForAccessibility?: ?('auto' | 'yes' | 'no' | 'no-hide-descendants'),
|
||||
accessibilityHint?: ?string,
|
||||
accessibilityLanguage?: ?Stringish,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
A basic button component that should render nicely on any platform. Supports a
|
||||
|
||||
+6
-6
@@ -31,11 +31,11 @@ const DRAWER_STATES = ['Idle', 'Dragging', 'Settling'];
|
||||
|
||||
type DrawerStates = 'Idle' | 'Dragging' | 'Settling';
|
||||
|
||||
type DrawerSlideEvent = $ReadOnly<{|
|
||||
type DrawerSlideEvent = $ReadOnly<{
|
||||
offset: number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
accessibilityRole?: ?AccessibilityRole,
|
||||
|
||||
/**
|
||||
@@ -116,11 +116,11 @@ type Props = $ReadOnly<{|
|
||||
|
||||
children?: React.Node,
|
||||
style?: ?ViewStyleProp,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type State = {|
|
||||
type State = {
|
||||
drawerOpened: boolean,
|
||||
|};
|
||||
};
|
||||
|
||||
/**
|
||||
* React component that wraps the platform `DrawerLayout` (Android only). The
|
||||
|
||||
@@ -25,32 +25,32 @@ export type KeyboardEventEasing =
|
||||
| 'linear'
|
||||
| 'keyboard';
|
||||
|
||||
export type KeyboardMetrics = $ReadOnly<{|
|
||||
export type KeyboardMetrics = $ReadOnly<{
|
||||
screenX: number,
|
||||
screenY: number,
|
||||
width: number,
|
||||
height: number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type KeyboardEvent = AndroidKeyboardEvent | IOSKeyboardEvent;
|
||||
|
||||
type BaseKeyboardEvent = {|
|
||||
type BaseKeyboardEvent = {
|
||||
duration: number,
|
||||
easing: KeyboardEventEasing,
|
||||
endCoordinates: KeyboardMetrics,
|
||||
|};
|
||||
};
|
||||
|
||||
export type AndroidKeyboardEvent = $ReadOnly<{|
|
||||
export type AndroidKeyboardEvent = $ReadOnly<{
|
||||
...BaseKeyboardEvent,
|
||||
duration: 0,
|
||||
easing: 'keyboard',
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type IOSKeyboardEvent = $ReadOnly<{|
|
||||
export type IOSKeyboardEvent = $ReadOnly<{
|
||||
...BaseKeyboardEvent,
|
||||
startCoordinates: KeyboardMetrics,
|
||||
isEventFromThisApp: boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type KeyboardEventDefinitions = {
|
||||
keyboardWillShow: [KeyboardEvent],
|
||||
|
||||
+4
-4
@@ -27,7 +27,7 @@ import View from '../View/View';
|
||||
import Keyboard from './Keyboard';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
/**
|
||||
@@ -51,11 +51,11 @@ type Props = $ReadOnly<{|
|
||||
* may be non-zero in some cases. Defaults to 0.
|
||||
*/
|
||||
keyboardVerticalOffset?: number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type State = {|
|
||||
type State = {
|
||||
bottom: number,
|
||||
|};
|
||||
};
|
||||
|
||||
/**
|
||||
* View that moves out of the way when the keyboard appears by automatically
|
||||
|
||||
@@ -34,11 +34,11 @@ import {useMemo, useRef, useState} from 'react';
|
||||
|
||||
type ViewStyleProp = $ElementType<React.ElementConfig<typeof View>, 'style'>;
|
||||
|
||||
export type StateCallbackType = $ReadOnly<{|
|
||||
export type StateCallbackType = $ReadOnly<{
|
||||
pressed: boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
/**
|
||||
* Accessibility.
|
||||
*/
|
||||
@@ -193,7 +193,7 @@ type Props = $ReadOnly<{|
|
||||
* https://github.com/facebook/react-native/issues/34424
|
||||
*/
|
||||
'aria-label'?: ?string,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type Instance = React.ElementRef<typeof View>;
|
||||
|
||||
|
||||
+9
-9
@@ -19,19 +19,19 @@ import invariant from 'invariant';
|
||||
import * as React from 'react';
|
||||
import {useMemo} from 'react';
|
||||
|
||||
type NativeBackgroundProp = $ReadOnly<{|
|
||||
type NativeBackgroundProp = $ReadOnly<{
|
||||
type: 'RippleAndroid',
|
||||
color: ?number,
|
||||
borderless: boolean,
|
||||
rippleRadius: ?number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type RippleConfig = {|
|
||||
export type RippleConfig = {
|
||||
color?: ColorValue,
|
||||
borderless?: boolean,
|
||||
radius?: number,
|
||||
foreground?: boolean,
|
||||
|};
|
||||
};
|
||||
|
||||
/**
|
||||
* Provides the event handlers and props for configuring the ripple effect on
|
||||
@@ -39,15 +39,15 @@ export type RippleConfig = {|
|
||||
*/
|
||||
export default function useAndroidRippleForView(
|
||||
rippleConfig: ?RippleConfig,
|
||||
viewRef: {|current: null | React.ElementRef<typeof View>|},
|
||||
): ?$ReadOnly<{|
|
||||
viewRef: {current: null | React.ElementRef<typeof View>},
|
||||
): ?$ReadOnly<{
|
||||
onPressIn: (event: PressEvent) => void,
|
||||
onPressMove: (event: PressEvent) => void,
|
||||
onPressOut: (event: PressEvent) => void,
|
||||
viewProps:
|
||||
| $ReadOnly<{|nativeBackgroundAndroid: NativeBackgroundProp|}>
|
||||
| $ReadOnly<{|nativeForegroundAndroid: NativeBackgroundProp|}>,
|
||||
|}> {
|
||||
| $ReadOnly<{nativeBackgroundAndroid: NativeBackgroundProp}>
|
||||
| $ReadOnly<{nativeForegroundAndroid: NativeBackgroundProp}>,
|
||||
}> {
|
||||
const {color, borderless, radius, foreground} = rippleConfig ?? {};
|
||||
|
||||
return useMemo(() => {
|
||||
|
||||
+6
-6
@@ -15,7 +15,7 @@ import ProgressBarAndroidNativeComponent from './ProgressBarAndroidNativeCompone
|
||||
|
||||
const React = require('react');
|
||||
|
||||
export type ProgressBarAndroidProps = $ReadOnly<{|
|
||||
export type ProgressBarAndroidProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
/**
|
||||
@@ -25,12 +25,12 @@ export type ProgressBarAndroidProps = $ReadOnly<{|
|
||||
* `progress` value.
|
||||
*/
|
||||
...
|
||||
| {|
|
||||
| {
|
||||
styleAttr: 'Horizontal',
|
||||
indeterminate: false,
|
||||
progress: number,
|
||||
|}
|
||||
| {|
|
||||
}
|
||||
| {
|
||||
typeAttr:
|
||||
| 'Horizontal'
|
||||
| 'Normal'
|
||||
@@ -40,7 +40,7 @@ export type ProgressBarAndroidProps = $ReadOnly<{|
|
||||
| 'SmallInverse'
|
||||
| 'LargeInverse',
|
||||
indeterminate: true,
|
||||
|},
|
||||
},
|
||||
/**
|
||||
* Whether to show the ProgressBar (true, the default) or hide it (false).
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ export type ProgressBarAndroidProps = $ReadOnly<{|
|
||||
* Used to locate this view in end-to-end tests.
|
||||
*/
|
||||
testID?: ?string,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* React component that wraps the Android-only `ProgressBar`. This component is
|
||||
|
||||
+6
-6
@@ -21,7 +21,7 @@ import PullToRefreshViewNativeComponent, {
|
||||
const Platform = require('../../Utilities/Platform');
|
||||
const React = require('react');
|
||||
|
||||
type IOSProps = $ReadOnly<{|
|
||||
type IOSProps = $ReadOnly<{
|
||||
/**
|
||||
* The color of the refresh indicator.
|
||||
*/
|
||||
@@ -34,9 +34,9 @@ type IOSProps = $ReadOnly<{|
|
||||
* The title displayed under the refresh indicator.
|
||||
*/
|
||||
title?: ?string,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidProps = $ReadOnly<{|
|
||||
type AndroidProps = $ReadOnly<{
|
||||
/**
|
||||
* Whether the pull to refresh functionality is enabled.
|
||||
*/
|
||||
@@ -53,9 +53,9 @@ type AndroidProps = $ReadOnly<{|
|
||||
* Size of the refresh indicator.
|
||||
*/
|
||||
size?: ?('default' | 'large'),
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type RefreshControlProps = $ReadOnly<{|
|
||||
export type RefreshControlProps = $ReadOnly<{
|
||||
...ViewProps,
|
||||
...IOSProps,
|
||||
...AndroidProps,
|
||||
@@ -74,7 +74,7 @@ export type RefreshControlProps = $ReadOnly<{|
|
||||
* Progress view top offset
|
||||
*/
|
||||
progressViewOffset?: ?number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* This component is used inside a ScrollView or ListView to add pull to refresh
|
||||
|
||||
@@ -127,7 +127,7 @@ import * as React from 'react';
|
||||
*/
|
||||
|
||||
// Public methods for ScrollView
|
||||
export type ScrollViewImperativeMethods = $ReadOnly<{|
|
||||
export type ScrollViewImperativeMethods = $ReadOnly<{
|
||||
getScrollResponder: $PropertyType<ScrollView, 'getScrollResponder'>,
|
||||
getScrollableNode: $PropertyType<ScrollView, 'getScrollableNode'>,
|
||||
getInnerViewNode: $PropertyType<ScrollView, 'getInnerViewNode'>,
|
||||
@@ -141,19 +141,19 @@ export type ScrollViewImperativeMethods = $ReadOnly<{|
|
||||
ScrollView,
|
||||
'scrollResponderScrollNativeHandleToKeyboard',
|
||||
>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type DecelerationRateType = 'fast' | 'normal' | number;
|
||||
export type ScrollResponderType = ScrollViewImperativeMethods;
|
||||
|
||||
type PublicScrollViewInstance = $ReadOnly<{|
|
||||
type PublicScrollViewInstance = $ReadOnly<{
|
||||
...HostInstance,
|
||||
...ScrollViewImperativeMethods,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type InnerViewInstance = React.ElementRef<View>;
|
||||
|
||||
type IOSProps = $ReadOnly<{|
|
||||
type IOSProps = $ReadOnly<{
|
||||
/**
|
||||
* Controls whether iOS should automatically adjust the content inset
|
||||
* for scroll views that are placed behind a navigation bar or
|
||||
@@ -307,9 +307,9 @@ type IOSProps = $ReadOnly<{|
|
||||
| 'never'
|
||||
| 'always'
|
||||
),
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidProps = $ReadOnly<{|
|
||||
type AndroidProps = $ReadOnly<{
|
||||
/**
|
||||
* Enables nested scrolling for Android API level 21+.
|
||||
* Nested scrolling is supported by default on iOS
|
||||
@@ -364,14 +364,14 @@ type AndroidProps = $ReadOnly<{|
|
||||
* @platform android
|
||||
*/
|
||||
fadingEdgeLength?: ?number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type StickyHeaderComponentType = component(
|
||||
ref?: React.RefSetter<$ReadOnly<interface {setNextHeaderY: number => void}>>,
|
||||
...ScrollViewStickyHeaderProps
|
||||
);
|
||||
|
||||
export type Props = $ReadOnly<{|
|
||||
export type Props = $ReadOnly<{
|
||||
...ViewProps,
|
||||
...IOSProps,
|
||||
...AndroidProps,
|
||||
@@ -494,10 +494,10 @@ export type Props = $ReadOnly<{|
|
||||
* whether content is "visible" or not.
|
||||
*
|
||||
*/
|
||||
maintainVisibleContentPosition?: ?$ReadOnly<{|
|
||||
maintainVisibleContentPosition?: ?$ReadOnly<{
|
||||
minIndexForVisible: number,
|
||||
autoscrollToTopThreshold?: ?number,
|
||||
|}>,
|
||||
}>,
|
||||
/**
|
||||
* Called when the momentum scroll starts (scroll which occurs as the ScrollView glides to a stop).
|
||||
*/
|
||||
@@ -651,17 +651,17 @@ export type Props = $ReadOnly<{|
|
||||
* measure, measureLayout, etc.
|
||||
*/
|
||||
scrollViewRef?: React.RefSetter<PublicScrollViewInstance>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type State = {|
|
||||
type State = {
|
||||
layoutHeight: ?number,
|
||||
|};
|
||||
};
|
||||
|
||||
const IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
|
||||
|
||||
export type ScrollViewComponentStatics = $ReadOnly<{|
|
||||
export type ScrollViewComponentStatics = $ReadOnly<{
|
||||
Context: typeof ScrollViewContext,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* Component that wraps platform ScrollView while providing
|
||||
@@ -976,22 +976,22 @@ class ScrollView extends React.Component<Props, State> {
|
||||
* @platform ios
|
||||
*/
|
||||
scrollResponderZoomTo: (
|
||||
rect: {|
|
||||
rect: {
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
animated?: boolean,
|
||||
|},
|
||||
},
|
||||
animated?: boolean, // deprecated, put this inside the rect argument instead
|
||||
) => void = (
|
||||
rect: {|
|
||||
rect: {
|
||||
x: number,
|
||||
y: number,
|
||||
width: number,
|
||||
height: number,
|
||||
animated?: boolean,
|
||||
|},
|
||||
},
|
||||
animated?: boolean, // deprecated, put this inside the rect argument instead
|
||||
) => {
|
||||
invariant(Platform.OS === 'ios', 'zoomToRect is not implemented');
|
||||
|
||||
+2
-2
@@ -31,13 +31,13 @@ interface NativeCommands {
|
||||
) => void;
|
||||
+zoomToRect: (
|
||||
viewRef: React.ElementRef<ScrollViewNativeComponentType>,
|
||||
rect: {|
|
||||
rect: {
|
||||
x: Double,
|
||||
y: Double,
|
||||
width: Double,
|
||||
height: Double,
|
||||
animated?: boolean,
|
||||
|},
|
||||
},
|
||||
animated?: boolean,
|
||||
) => void;
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import * as React from 'react';
|
||||
import {useCallback, useEffect, useMemo, useRef, useState} from 'react';
|
||||
|
||||
export type Props = $ReadOnly<{
|
||||
children?: ExactReactElement_DEPRECATED<$FlowFixMe>,
|
||||
children?: React.Node,
|
||||
nextHeaderLayoutY: ?number,
|
||||
onLayout: (event: LayoutEvent) => void,
|
||||
scrollAnimatedValue: Animated.Value,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
const React = require('react');
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
/**
|
||||
* Indicates whether the render function needs to be called again
|
||||
*/
|
||||
@@ -22,7 +22,7 @@ type Props = $ReadOnly<{|
|
||||
* A function that returns a renderable component
|
||||
*/
|
||||
render: () => React.Node,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
class StaticRenderer extends React.Component<Props> {
|
||||
shouldComponentUpdate(nextProps: Props): boolean {
|
||||
|
||||
@@ -55,7 +55,7 @@ export type StatusBarAnimation = $Keys<{
|
||||
...
|
||||
}>;
|
||||
|
||||
type AndroidProps = $ReadOnly<{|
|
||||
type AndroidProps = $ReadOnly<{
|
||||
/**
|
||||
* The background color of the status bar.
|
||||
* @platform android
|
||||
@@ -69,9 +69,9 @@ type AndroidProps = $ReadOnly<{|
|
||||
* @platform android
|
||||
*/
|
||||
translucent?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type IOSProps = $ReadOnly<{|
|
||||
type IOSProps = $ReadOnly<{
|
||||
/**
|
||||
* If the network activity indicator should be visible.
|
||||
*
|
||||
@@ -85,9 +85,9 @@ type IOSProps = $ReadOnly<{|
|
||||
* @platform ios
|
||||
*/
|
||||
showHideTransition?: ?('fade' | 'slide' | 'none'),
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
...AndroidProps,
|
||||
...IOSProps,
|
||||
/**
|
||||
@@ -103,7 +103,25 @@ type Props = $ReadOnly<{|
|
||||
* Sets the color of the status bar text.
|
||||
*/
|
||||
barStyle?: ?('default' | 'light-content' | 'dark-content'),
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type StackProps = {
|
||||
backgroundColor: ?{
|
||||
value: Props['backgroundColor'],
|
||||
animated: boolean,
|
||||
},
|
||||
barStyle: ?{
|
||||
value: Props['barStyle'],
|
||||
animated: boolean,
|
||||
},
|
||||
translucent: Props['translucent'],
|
||||
hidden: ?{
|
||||
value: boolean,
|
||||
animated: boolean,
|
||||
transition: Props['showHideTransition'],
|
||||
},
|
||||
networkActivityIndicatorVisible: Props['networkActivityIndicatorVisible'],
|
||||
};
|
||||
|
||||
/**
|
||||
* Merges the prop stack with the default values.
|
||||
@@ -129,7 +147,7 @@ function mergePropsStack(
|
||||
* Returns an object to insert in the props stack from the props
|
||||
* and the transition/animation info.
|
||||
*/
|
||||
function createStackEntry(props: any): any {
|
||||
function createStackEntry(props: Props): StackProps {
|
||||
const animated = props.animated ?? false;
|
||||
const showHideTransition = props.showHideTransition ?? 'fade';
|
||||
return {
|
||||
@@ -203,7 +221,7 @@ function createStackEntry(props: any): any {
|
||||
* `currentHeight` (Android only) The height of the status bar.
|
||||
*/
|
||||
class StatusBar extends React.Component<Props> {
|
||||
static _propsStack: Array<any> = [];
|
||||
static _propsStack: Array<StackProps> = [];
|
||||
|
||||
static _defaultProps: any = createStackEntry({
|
||||
backgroundColor:
|
||||
@@ -218,12 +236,10 @@ class StatusBar extends React.Component<Props> {
|
||||
});
|
||||
|
||||
// Timer for updating the native module values at the end of the frame.
|
||||
// $FlowFixMe[missing-local-annot]
|
||||
static _updateImmediate = null;
|
||||
static _updateImmediate: ?number = null;
|
||||
|
||||
// The current merged values from the props stack.
|
||||
// $FlowFixMe[missing-local-annot]
|
||||
static _currentValues = null;
|
||||
static _currentValues: ?StackProps = null;
|
||||
|
||||
// TODO(janic): Provide a real API to deal with status bar height. See the
|
||||
// discussion in #6195.
|
||||
@@ -371,8 +387,7 @@ class StatusBar extends React.Component<Props> {
|
||||
return newEntry;
|
||||
}
|
||||
|
||||
// $FlowFixMe[missing-local-annot]
|
||||
_stackEntry = null;
|
||||
_stackEntry: ?StackProps = null;
|
||||
|
||||
componentDidMount() {
|
||||
// Every time a StatusBar component is mounted, we push it's prop to a stack
|
||||
@@ -412,14 +427,14 @@ class StatusBar extends React.Component<Props> {
|
||||
if (Platform.OS === 'ios') {
|
||||
if (
|
||||
!oldProps ||
|
||||
oldProps.barStyle.value !== mergedProps.barStyle.value
|
||||
oldProps.barStyle?.value !== mergedProps.barStyle.value
|
||||
) {
|
||||
NativeStatusBarManagerIOS.setStyle(
|
||||
mergedProps.barStyle.value,
|
||||
mergedProps.barStyle.animated || false,
|
||||
);
|
||||
}
|
||||
if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {
|
||||
if (!oldProps || oldProps.hidden?.value !== mergedProps.hidden.value) {
|
||||
NativeStatusBarManagerIOS.setHidden(
|
||||
mergedProps.hidden.value,
|
||||
mergedProps.hidden.animated
|
||||
@@ -456,7 +471,7 @@ class StatusBar extends React.Component<Props> {
|
||||
mergedProps.backgroundColor.animated,
|
||||
);
|
||||
}
|
||||
if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) {
|
||||
if (!oldProps || oldProps.hidden?.value !== mergedProps.hidden.value) {
|
||||
NativeStatusBarManagerAndroid.setHidden(mergedProps.hidden.value);
|
||||
}
|
||||
// Activities are not translucent by default, so always set if true.
|
||||
|
||||
@@ -24,13 +24,13 @@ import SwitchNativeComponent, {
|
||||
import * as React from 'react';
|
||||
|
||||
type SwitchChangeEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
value: boolean,
|
||||
target: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type Props = $ReadOnly<{|
|
||||
export type Props = $ReadOnly<{
|
||||
...ViewProps,
|
||||
|
||||
/**
|
||||
@@ -59,10 +59,10 @@ export type Props = $ReadOnly<{|
|
||||
color of the background exposed by the shrunken track, use
|
||||
[`ios_backgroundColor`](https://reactnative.dev/docs/switch#ios_backgroundColor).
|
||||
*/
|
||||
trackColor?: ?$ReadOnly<{|
|
||||
trackColor?: ?$ReadOnly<{
|
||||
false?: ?ColorValue,
|
||||
true?: ?ColorValue,
|
||||
|}>,
|
||||
}>,
|
||||
|
||||
/**
|
||||
On iOS, custom color for the background. This background color can be
|
||||
@@ -84,7 +84,7 @@ export type Props = $ReadOnly<{|
|
||||
use `onChange`.
|
||||
*/
|
||||
onValueChange?: ?(value: boolean) => Promise<void> | void,
|
||||
|}>;
|
||||
}>;
|
||||
const returnsFalse = () => false;
|
||||
const returnsTrue = () => true;
|
||||
|
||||
|
||||
+31
-31
@@ -69,10 +69,10 @@ export type ReturnKeyType =
|
||||
|
||||
export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline';
|
||||
|
||||
export type NativeProps = $ReadOnly<{|
|
||||
export type NativeProps = $ReadOnly<{
|
||||
// This allows us to inherit everything from ViewProps except for style (see below)
|
||||
// This must be commented for Fabric codegen to work.
|
||||
...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>,
|
||||
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
|
||||
|
||||
/**
|
||||
* Android props after this
|
||||
@@ -345,13 +345,13 @@ export type NativeProps = $ReadOnly<{|
|
||||
* Callback that is called when the text input is blurred.
|
||||
* `target` is the reactTag of the element
|
||||
*/
|
||||
onBlur?: ?BubblingEventHandler<$ReadOnly<{|target: Int32|}>>,
|
||||
onBlur?: ?BubblingEventHandler<$ReadOnly<{target: Int32}>>,
|
||||
|
||||
/**
|
||||
* Callback that is called when the text input is focused.
|
||||
* `target` is the reactTag of the element
|
||||
*/
|
||||
onFocus?: ?BubblingEventHandler<$ReadOnly<{|target: Int32|}>>,
|
||||
onFocus?: ?BubblingEventHandler<$ReadOnly<{target: Int32}>>,
|
||||
|
||||
/**
|
||||
* Callback that is called when the text input's text changes.
|
||||
@@ -359,7 +359,7 @@ export type NativeProps = $ReadOnly<{|
|
||||
* TODO: differentiate between onChange and onChangeText
|
||||
*/
|
||||
onChange?: ?BubblingEventHandler<
|
||||
$ReadOnly<{|target: Int32, eventCount: Int32, text: string|}>,
|
||||
$ReadOnly<{target: Int32, eventCount: Int32, text: string}>,
|
||||
>,
|
||||
|
||||
/**
|
||||
@@ -368,7 +368,7 @@ export type NativeProps = $ReadOnly<{|
|
||||
* TODO: differentiate between onChange and onChangeText
|
||||
*/
|
||||
onChangeText?: ?BubblingEventHandler<
|
||||
$ReadOnly<{|target: Int32, eventCount: Int32, text: string|}>,
|
||||
$ReadOnly<{target: Int32, eventCount: Int32, text: string}>,
|
||||
>,
|
||||
|
||||
/**
|
||||
@@ -379,17 +379,17 @@ export type NativeProps = $ReadOnly<{|
|
||||
* Only called for multiline text inputs.
|
||||
*/
|
||||
onContentSizeChange?: ?DirectEventHandler<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
target: Int32,
|
||||
contentSize: $ReadOnly<{|width: Double, height: Double|}>,
|
||||
|}>,
|
||||
contentSize: $ReadOnly<{width: Double, height: Double}>,
|
||||
}>,
|
||||
>,
|
||||
|
||||
/**
|
||||
* Callback that is called when text input ends.
|
||||
*/
|
||||
onEndEditing?: ?BubblingEventHandler<
|
||||
$ReadOnly<{|target: Int32, text: string|}>,
|
||||
$ReadOnly<{target: Int32, text: string}>,
|
||||
>,
|
||||
|
||||
/**
|
||||
@@ -398,10 +398,10 @@ export type NativeProps = $ReadOnly<{|
|
||||
* `{ nativeEvent: { selection: { start, end } } }`.
|
||||
*/
|
||||
onSelectionChange?: ?DirectEventHandler<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
target: Int32,
|
||||
selection: $ReadOnly<{|start: Double, end: Double|}>,
|
||||
|}>,
|
||||
selection: $ReadOnly<{start: Double, end: Double}>,
|
||||
}>,
|
||||
>,
|
||||
|
||||
/**
|
||||
@@ -409,7 +409,7 @@ export type NativeProps = $ReadOnly<{|
|
||||
* Invalid if `multiline={true}` is specified.
|
||||
*/
|
||||
onSubmitEditing?: ?BubblingEventHandler<
|
||||
$ReadOnly<{|target: Int32, text: string|}>,
|
||||
$ReadOnly<{target: Int32, text: string}>,
|
||||
>,
|
||||
|
||||
/**
|
||||
@@ -419,7 +419,7 @@ export type NativeProps = $ReadOnly<{|
|
||||
* the typed-in character otherwise including `' '` for space.
|
||||
* Fires before `onChange` callbacks.
|
||||
*/
|
||||
onKeyPress?: ?BubblingEventHandler<$ReadOnly<{|target: Int32, key: string|}>>,
|
||||
onKeyPress?: ?BubblingEventHandler<$ReadOnly<{target: Int32, key: string}>>,
|
||||
|
||||
/**
|
||||
* Invoked on content scroll with `{ nativeEvent: { contentOffset: { x, y } } }`.
|
||||
@@ -427,32 +427,32 @@ export type NativeProps = $ReadOnly<{|
|
||||
* is not provided for performance reasons.
|
||||
*/
|
||||
onScroll?: ?DirectEventHandler<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
target: Int32,
|
||||
responderIgnoreScroll: boolean,
|
||||
contentInset: $ReadOnly<{|
|
||||
contentInset: $ReadOnly<{
|
||||
top: Double, // always 0 on Android
|
||||
bottom: Double, // always 0 on Android
|
||||
left: Double, // always 0 on Android
|
||||
right: Double, // always 0 on Android
|
||||
|}>,
|
||||
contentOffset: $ReadOnly<{|
|
||||
}>,
|
||||
contentOffset: $ReadOnly<{
|
||||
x: Double,
|
||||
y: Double,
|
||||
|}>,
|
||||
contentSize: $ReadOnly<{|
|
||||
}>,
|
||||
contentSize: $ReadOnly<{
|
||||
width: Double, // always 0 on Android
|
||||
height: Double, // always 0 on Android
|
||||
|}>,
|
||||
layoutMeasurement: $ReadOnly<{|
|
||||
}>,
|
||||
layoutMeasurement: $ReadOnly<{
|
||||
width: Double,
|
||||
height: Double,
|
||||
|}>,
|
||||
velocity: $ReadOnly<{|
|
||||
}>,
|
||||
velocity: $ReadOnly<{
|
||||
x: Double, // always 0 on Android
|
||||
y: Double, // always 0 on Android
|
||||
|}>,
|
||||
|}>,
|
||||
}>,
|
||||
}>,
|
||||
>,
|
||||
|
||||
/**
|
||||
@@ -485,10 +485,10 @@ export type NativeProps = $ReadOnly<{|
|
||||
* The start and end of the text input's selection. Set start and end to
|
||||
* the same value to position the cursor.
|
||||
*/
|
||||
selection?: ?$ReadOnly<{|
|
||||
selection?: ?$ReadOnly<{
|
||||
start: Int32,
|
||||
end?: ?Int32,
|
||||
|}>,
|
||||
}>,
|
||||
|
||||
/**
|
||||
* The value to show for the text input. `TextInput` is a controlled
|
||||
@@ -588,7 +588,7 @@ export type NativeProps = $ReadOnly<{|
|
||||
textShadowRadius?: ?Float,
|
||||
textDecorationLine?: ?string,
|
||||
fontStyle?: ?string,
|
||||
textShadowOffset?: ?$ReadOnly<{|width?: ?Double, height?: ?Double|}>,
|
||||
textShadowOffset?: ?$ReadOnly<{width?: ?Double, height?: ?Double}>,
|
||||
lineHeight?: ?Float,
|
||||
textTransform?: ?string,
|
||||
color?: ?Int32,
|
||||
@@ -610,7 +610,7 @@ export type NativeProps = $ReadOnly<{|
|
||||
*/
|
||||
mostRecentEventCount: Int32,
|
||||
text?: ?string,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type NativeType = HostComponent<NativeProps>;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ import * as React from 'react';
|
||||
* For an example, look at InputAccessoryViewExample.js in RNTester.
|
||||
*/
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
+children: React.Node,
|
||||
/**
|
||||
* An ID which is used to associate this `InputAccessoryView` to
|
||||
@@ -85,7 +85,7 @@ type Props = $ReadOnly<{|
|
||||
nativeID?: ?string,
|
||||
style?: ?ViewStyleProp,
|
||||
backgroundColor?: ?ColorValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
const InputAccessoryView: React.ComponentType<Props> = (props: Props) => {
|
||||
const {width} = useWindowDimensions();
|
||||
|
||||
@@ -26,71 +26,71 @@ import * as React from 'react';
|
||||
type ReactRefSetter<T> = {current: null | T, ...} | ((ref: null | T) => mixed);
|
||||
|
||||
export type ChangeEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
eventCount: number,
|
||||
target: number,
|
||||
text: string,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type TextInputEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
eventCount: number,
|
||||
previousText: string,
|
||||
range: $ReadOnly<{|
|
||||
range: $ReadOnly<{
|
||||
start: number,
|
||||
end: number,
|
||||
|}>,
|
||||
}>,
|
||||
target: number,
|
||||
text: string,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type ContentSizeChangeEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
target: number,
|
||||
contentSize: $ReadOnly<{|
|
||||
contentSize: $ReadOnly<{
|
||||
width: number,
|
||||
height: number,
|
||||
|}>,
|
||||
|}>,
|
||||
}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
type TargetEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
target: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type BlurEvent = TargetEvent;
|
||||
export type FocusEvent = TargetEvent;
|
||||
|
||||
type Selection = $ReadOnly<{|
|
||||
type Selection = $ReadOnly<{
|
||||
start: number,
|
||||
end: number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type SelectionChangeEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
selection: Selection,
|
||||
target: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type KeyPressEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
key: string,
|
||||
target?: ?number,
|
||||
eventCount?: ?number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type EditingEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
eventCount: number,
|
||||
text: string,
|
||||
target: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
type DataDetectorTypesType =
|
||||
@@ -215,7 +215,7 @@ export type enterKeyHintType =
|
||||
|
||||
type PasswordRules = string;
|
||||
|
||||
type IOSProps = $ReadOnly<{|
|
||||
type IOSProps = $ReadOnly<{
|
||||
/**
|
||||
* If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
|
||||
* @platform ios
|
||||
@@ -350,9 +350,9 @@ type IOSProps = $ReadOnly<{|
|
||||
* @platform ios
|
||||
*/
|
||||
smartInsertDelete?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidProps = $ReadOnly<{|
|
||||
type AndroidProps = $ReadOnly<{
|
||||
/**
|
||||
* When provided it will set the color of the cursor (or "caret") in the component.
|
||||
* Unlike the behavior of `selectionColor` the cursor color will be set independently
|
||||
@@ -444,10 +444,10 @@ type AndroidProps = $ReadOnly<{|
|
||||
* @platform android
|
||||
*/
|
||||
underlineColorAndroid?: ?ColorValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type Props = $ReadOnly<{|
|
||||
...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>,
|
||||
export type Props = $ReadOnly<{
|
||||
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
|
||||
...IOSProps,
|
||||
...AndroidProps,
|
||||
|
||||
@@ -900,10 +900,10 @@ export type Props = $ReadOnly<{|
|
||||
* The start and end of the text input's selection. Set start and end to
|
||||
* the same value to position the cursor.
|
||||
*/
|
||||
selection?: ?$ReadOnly<{|
|
||||
selection?: ?$ReadOnly<{
|
||||
start: number,
|
||||
end?: ?number,
|
||||
|}>,
|
||||
}>,
|
||||
|
||||
/**
|
||||
* The highlight and cursor color of the text input.
|
||||
@@ -978,14 +978,14 @@ export type Props = $ReadOnly<{|
|
||||
* unwanted edits without flicker.
|
||||
*/
|
||||
value?: ?Stringish,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type ImperativeMethods = $ReadOnly<{|
|
||||
type ImperativeMethods = $ReadOnly<{
|
||||
clear: () => void,
|
||||
isFocused: () => boolean,
|
||||
getNativeRef: () => ?HostInstance,
|
||||
setSelection: (start: number, end: number) => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* A foundational component for inputting text into the app via a
|
||||
@@ -1103,13 +1103,13 @@ type InternalTextInput = component(
|
||||
...Props
|
||||
);
|
||||
|
||||
export type TextInputComponentStatics = $ReadOnly<{|
|
||||
State: $ReadOnly<{|
|
||||
export type TextInputComponentStatics = $ReadOnly<{
|
||||
State: $ReadOnly<{
|
||||
currentlyFocusedInput: () => ?HostInstance,
|
||||
currentlyFocusedField: () => ?number,
|
||||
focusTextInput: (textField: ?HostInstance) => void,
|
||||
blurTextInput: (textField: ?HostInstance) => void,
|
||||
|}>,
|
||||
|}>;
|
||||
}>,
|
||||
}>;
|
||||
|
||||
export type TextInputType = InternalTextInput & TextInputComponentStatics;
|
||||
|
||||
@@ -67,71 +67,71 @@ if (Platform.OS === 'android') {
|
||||
}
|
||||
|
||||
export type ChangeEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
eventCount: number,
|
||||
target: number,
|
||||
text: string,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type TextInputEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
eventCount: number,
|
||||
previousText: string,
|
||||
range: $ReadOnly<{|
|
||||
range: $ReadOnly<{
|
||||
start: number,
|
||||
end: number,
|
||||
|}>,
|
||||
}>,
|
||||
target: number,
|
||||
text: string,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type ContentSizeChangeEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
target: number,
|
||||
contentSize: $ReadOnly<{|
|
||||
contentSize: $ReadOnly<{
|
||||
width: number,
|
||||
height: number,
|
||||
|}>,
|
||||
|}>,
|
||||
}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
type TargetEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
target: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type BlurEvent = TargetEvent;
|
||||
export type FocusEvent = TargetEvent;
|
||||
|
||||
type Selection = $ReadOnly<{|
|
||||
type Selection = $ReadOnly<{
|
||||
start: number,
|
||||
end: number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type SelectionChangeEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
selection: Selection,
|
||||
target: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type KeyPressEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
key: string,
|
||||
target?: ?number,
|
||||
eventCount?: ?number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export type EditingEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
eventCount: number,
|
||||
text: string,
|
||||
target: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
type DataDetectorTypesType =
|
||||
@@ -259,7 +259,7 @@ export type enterKeyHintType =
|
||||
|
||||
type PasswordRules = string;
|
||||
|
||||
type IOSProps = $ReadOnly<{|
|
||||
type IOSProps = $ReadOnly<{
|
||||
/**
|
||||
* If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false.
|
||||
* @platform ios
|
||||
@@ -397,9 +397,9 @@ type IOSProps = $ReadOnly<{|
|
||||
* @platform ios
|
||||
*/
|
||||
smartInsertDelete?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidProps = $ReadOnly<{|
|
||||
type AndroidProps = $ReadOnly<{
|
||||
/**
|
||||
* When provided it will set the color of the cursor (or "caret") in the component.
|
||||
* Unlike the behavior of `selectionColor` the cursor color will be set independently
|
||||
@@ -483,10 +483,10 @@ type AndroidProps = $ReadOnly<{|
|
||||
* @platform android
|
||||
*/
|
||||
underlineColorAndroid?: ?ColorValue,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type Props = $ReadOnly<{|
|
||||
...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>,
|
||||
export type Props = $ReadOnly<{
|
||||
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
|
||||
...IOSProps,
|
||||
...AndroidProps,
|
||||
|
||||
@@ -903,10 +903,10 @@ export type Props = $ReadOnly<{|
|
||||
* The start and end of the text input's selection. Set start and end to
|
||||
* the same value to position the cursor.
|
||||
*/
|
||||
selection?: ?$ReadOnly<{|
|
||||
selection?: ?$ReadOnly<{
|
||||
start: number,
|
||||
end?: ?number,
|
||||
|}>,
|
||||
}>,
|
||||
|
||||
/**
|
||||
* The highlight and cursor color of the text input.
|
||||
@@ -987,7 +987,7 @@ export type Props = $ReadOnly<{|
|
||||
* unwanted edits without flicker.
|
||||
*/
|
||||
value?: ?Stringish,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type ViewCommands = $NonMaybeType<
|
||||
| typeof AndroidTextInputCommands
|
||||
@@ -995,10 +995,10 @@ type ViewCommands = $NonMaybeType<
|
||||
| typeof RCTSinglelineTextInputNativeCommands,
|
||||
>;
|
||||
|
||||
type LastNativeSelection = {|
|
||||
type LastNativeSelection = {
|
||||
selection: Selection,
|
||||
mostRecentEventCount: number,
|
||||
|};
|
||||
};
|
||||
|
||||
const emptyFunctionThatReturnsTrue = () => true;
|
||||
|
||||
@@ -1874,14 +1874,14 @@ ExportedForwardRef.State = {
|
||||
blurTextInput: TextInputState.blurTextInput,
|
||||
};
|
||||
|
||||
export type TextInputComponentStatics = $ReadOnly<{|
|
||||
State: $ReadOnly<{|
|
||||
export type TextInputComponentStatics = $ReadOnly<{
|
||||
State: $ReadOnly<{
|
||||
currentlyFocusedInput: typeof TextInputState.currentlyFocusedInput,
|
||||
currentlyFocusedField: typeof TextInputState.currentlyFocusedField,
|
||||
focusTextInput: typeof TextInputState.focusTextInput,
|
||||
blurTextInput: typeof TextInputState.blurTextInput,
|
||||
|}>,
|
||||
|}>;
|
||||
}>,
|
||||
}>;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
multilineDefault: {
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@ export interface TextInputNativeCommands<T> {
|
||||
) => void;
|
||||
}
|
||||
|
||||
const supportedCommands = ['focus', 'blur', 'setTextAndSelection'];
|
||||
const supportedCommands = ['focus', 'blur', 'setTextAndSelection'] as string[];
|
||||
|
||||
export default supportedCommands;
|
||||
|
||||
@@ -19,7 +19,7 @@ import {PressabilityDebugView} from '../../Pressability/PressabilityDebug';
|
||||
import Platform from '../../Utilities/Platform';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
...React.ElementConfig<TouchableWithoutFeedback>,
|
||||
|
||||
onPressAnimationComplete?: ?() => void,
|
||||
@@ -29,12 +29,12 @@ type Props = $ReadOnly<{|
|
||||
style?: ?ViewStyleProp,
|
||||
|
||||
hostRef: React.RefSetter<React.ElementRef<typeof Animated.View>>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type State = $ReadOnly<{|
|
||||
type State = $ReadOnly<{
|
||||
pressability: Pressability,
|
||||
scale: Animated.Value,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
class TouchableBounce extends React.Component<Props, State> {
|
||||
state: State = {
|
||||
@@ -218,5 +218,5 @@ module.exports = (React.forwardRef((props, hostRef) => (
|
||||
<TouchableBounce {...props} hostRef={hostRef} />
|
||||
)): component(
|
||||
ref: React.RefSetter<mixed>,
|
||||
...props: $ReadOnly<$Diff<Props, {|hostRef: mixed|}>>
|
||||
...props: $ReadOnly<$Diff<Props, {hostRef: mixed}>>
|
||||
));
|
||||
|
||||
+11
-11
@@ -20,19 +20,19 @@ import StyleSheet, {type ViewStyleProp} from '../../StyleSheet/StyleSheet';
|
||||
import Platform from '../../Utilities/Platform';
|
||||
import * as React from 'react';
|
||||
|
||||
type AndroidProps = $ReadOnly<{|
|
||||
type AndroidProps = $ReadOnly<{
|
||||
nextFocusDown?: ?number,
|
||||
nextFocusForward?: ?number,
|
||||
nextFocusLeft?: ?number,
|
||||
nextFocusRight?: ?number,
|
||||
nextFocusUp?: ?number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type IOSProps = $ReadOnly<{|
|
||||
type IOSProps = $ReadOnly<{
|
||||
hasTVPreferredFocus?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
...React.ElementConfig<TouchableWithoutFeedback>,
|
||||
...AndroidProps,
|
||||
...IOSProps,
|
||||
@@ -45,17 +45,17 @@ type Props = $ReadOnly<{|
|
||||
testOnly_pressed?: ?boolean,
|
||||
|
||||
hostRef: React.RefSetter<React.ElementRef<typeof View>>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type ExtraStyles = $ReadOnly<{|
|
||||
type ExtraStyles = $ReadOnly<{
|
||||
child: ViewStyleProp,
|
||||
underlay: ViewStyleProp,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type State = $ReadOnly<{|
|
||||
type State = $ReadOnly<{
|
||||
pressability: Pressability,
|
||||
extraStyles: ?ExtraStyles,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* A wrapper for making views respond properly to touches.
|
||||
@@ -383,7 +383,7 @@ class TouchableHighlight extends React.Component<Props, State> {
|
||||
|
||||
const Touchable: component(
|
||||
ref: React.RefSetter<React.ElementRef<typeof View>>,
|
||||
...props: $ReadOnly<$Diff<Props, {|+hostRef: mixed|}>>
|
||||
...props: $ReadOnly<$Diff<Props, {+hostRef: mixed}>>
|
||||
) = React.forwardRef((props, hostRef) => (
|
||||
<TouchableHighlight {...props} hostRef={hostRef} />
|
||||
));
|
||||
|
||||
+14
-14
@@ -23,7 +23,7 @@ import {Commands} from '../View/ViewNativeComponent';
|
||||
import invariant from 'invariant';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
...React.ElementConfig<TouchableWithoutFeedback>,
|
||||
|
||||
/**
|
||||
@@ -33,19 +33,19 @@ type Props = $ReadOnly<{|
|
||||
* methods to generate that dictionary.
|
||||
*/
|
||||
background?: ?(
|
||||
| $ReadOnly<{|
|
||||
| $ReadOnly<{
|
||||
type: 'ThemeAttrAndroid',
|
||||
attribute:
|
||||
| 'selectableItemBackground'
|
||||
| 'selectableItemBackgroundBorderless',
|
||||
rippleRadius: ?number,
|
||||
|}>
|
||||
| $ReadOnly<{|
|
||||
}>
|
||||
| $ReadOnly<{
|
||||
type: 'RippleAndroid',
|
||||
color: ?number,
|
||||
borderless: boolean,
|
||||
rippleRadius: ?number,
|
||||
|}>
|
||||
}>
|
||||
),
|
||||
|
||||
/**
|
||||
@@ -89,22 +89,22 @@ type Props = $ReadOnly<{|
|
||||
* versions, this will fallback to background.
|
||||
*/
|
||||
useForeground?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type State = $ReadOnly<{|
|
||||
type State = $ReadOnly<{
|
||||
pressability: Pressability,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
class TouchableNativeFeedback extends React.Component<Props, State> {
|
||||
/**
|
||||
* Creates a value for the `background` prop that uses the Android theme's
|
||||
* default background for selectable elements.
|
||||
*/
|
||||
static SelectableBackground: (rippleRadius: ?number) => $ReadOnly<{|
|
||||
static SelectableBackground: (rippleRadius: ?number) => $ReadOnly<{
|
||||
attribute: 'selectableItemBackground',
|
||||
type: 'ThemeAttrAndroid',
|
||||
rippleRadius: ?number,
|
||||
|}> = (rippleRadius: ?number) => ({
|
||||
}> = (rippleRadius: ?number) => ({
|
||||
type: 'ThemeAttrAndroid',
|
||||
attribute: 'selectableItemBackground',
|
||||
rippleRadius,
|
||||
@@ -114,11 +114,11 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
|
||||
* Creates a value for the `background` prop that uses the Android theme's
|
||||
* default background for borderless selectable elements. Requires API 21+.
|
||||
*/
|
||||
static SelectableBackgroundBorderless: (rippleRadius: ?number) => $ReadOnly<{|
|
||||
static SelectableBackgroundBorderless: (rippleRadius: ?number) => $ReadOnly<{
|
||||
attribute: 'selectableItemBackgroundBorderless',
|
||||
type: 'ThemeAttrAndroid',
|
||||
rippleRadius: ?number,
|
||||
|}> = (rippleRadius: ?number) => ({
|
||||
}> = (rippleRadius: ?number) => ({
|
||||
type: 'ThemeAttrAndroid',
|
||||
attribute: 'selectableItemBackgroundBorderless',
|
||||
rippleRadius,
|
||||
@@ -133,12 +133,12 @@ class TouchableNativeFeedback extends React.Component<Props, State> {
|
||||
color: string,
|
||||
borderless: boolean,
|
||||
rippleRadius: ?number,
|
||||
) => $ReadOnly<{|
|
||||
) => $ReadOnly<{
|
||||
borderless: boolean,
|
||||
color: ?number,
|
||||
rippleRadius: ?number,
|
||||
type: 'RippleAndroid',
|
||||
|}> = (color: string, borderless: boolean, rippleRadius: ?number) => {
|
||||
}> = (color: string, borderless: boolean, rippleRadius: ?number) => {
|
||||
const processedColor = processColor(color);
|
||||
invariant(
|
||||
processedColor == null || typeof processedColor === 'number',
|
||||
|
||||
@@ -21,16 +21,16 @@ import flattenStyle from '../../StyleSheet/flattenStyle';
|
||||
import Platform from '../../Utilities/Platform';
|
||||
import * as React from 'react';
|
||||
|
||||
type TVProps = $ReadOnly<{|
|
||||
type TVProps = $ReadOnly<{
|
||||
hasTVPreferredFocus?: ?boolean,
|
||||
nextFocusDown?: ?number,
|
||||
nextFocusForward?: ?number,
|
||||
nextFocusLeft?: ?number,
|
||||
nextFocusRight?: ?number,
|
||||
nextFocusUp?: ?number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
...React.ElementConfig<TouchableWithoutFeedback>,
|
||||
...TVProps,
|
||||
|
||||
@@ -38,12 +38,12 @@ type Props = $ReadOnly<{|
|
||||
style?: ?ViewStyleProp,
|
||||
|
||||
hostRef?: ?React.RefSetter<React.ElementRef<typeof Animated.View>>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type State = $ReadOnly<{|
|
||||
type State = $ReadOnly<{
|
||||
anim: Animated.Value,
|
||||
pressability: Pressability,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* A wrapper for making views respond properly to touches.
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ import usePressability from '../../Pressability/usePressability';
|
||||
import * as React from 'react';
|
||||
import {useMemo} from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
||||
accessibilityElementsHidden?: ?boolean,
|
||||
accessibilityHint?: ?Stringish,
|
||||
@@ -82,7 +82,7 @@ type Props = $ReadOnly<{|
|
||||
rejectResponderTermination?: ?boolean,
|
||||
testID?: ?string,
|
||||
touchSoundDisabled?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
const PASSTHROUGH_PROPS = [
|
||||
'accessibilityActions',
|
||||
|
||||
@@ -144,7 +144,7 @@ export type AccessibilityState = {
|
||||
...
|
||||
};
|
||||
|
||||
export type AccessibilityValue = $ReadOnly<{|
|
||||
export type AccessibilityValue = $ReadOnly<{
|
||||
/**
|
||||
* The minimum value of this component's range. (should be an integer)
|
||||
*/
|
||||
@@ -164,4 +164,4 @@ export type AccessibilityValue = $ReadOnly<{|
|
||||
* A textual description of this component's value. (will override minimum, current, and maximum if set)
|
||||
*/
|
||||
text?: Stringish,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
@@ -34,7 +34,7 @@ import type {Node} from 'react';
|
||||
export type ViewLayout = Layout;
|
||||
export type ViewLayoutEvent = LayoutEvent;
|
||||
|
||||
type DirectEventProps = $ReadOnly<{|
|
||||
type DirectEventProps = $ReadOnly<{
|
||||
/**
|
||||
* When `accessible` is true, the system will try to invoke this function
|
||||
* when the user performs an accessibility custom action.
|
||||
@@ -78,15 +78,15 @@ type DirectEventProps = $ReadOnly<{|
|
||||
* See https://reactnative.dev/docs/view#onaccessibilityescape
|
||||
*/
|
||||
onAccessibilityEscape?: ?() => mixed,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type MouseEventProps = $ReadOnly<{|
|
||||
type MouseEventProps = $ReadOnly<{
|
||||
onMouseEnter?: ?(event: MouseEvent) => void,
|
||||
onMouseLeave?: ?(event: MouseEvent) => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
// Experimental/Work in Progress Pointer Event Callbacks (not yet ready for use)
|
||||
type PointerEventProps = $ReadOnly<{|
|
||||
type PointerEventProps = $ReadOnly<{
|
||||
onClick?: ?(event: PointerEvent) => void,
|
||||
onClickCapture?: ?(event: PointerEvent) => void,
|
||||
onPointerEnter?: ?(event: PointerEvent) => void,
|
||||
@@ -109,16 +109,16 @@ type PointerEventProps = $ReadOnly<{|
|
||||
onGotPointerCaptureCapture?: ?(e: PointerEvent) => void,
|
||||
onLostPointerCapture?: ?(e: PointerEvent) => void,
|
||||
onLostPointerCaptureCapture?: ?(e: PointerEvent) => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type FocusEventProps = $ReadOnly<{|
|
||||
type FocusEventProps = $ReadOnly<{
|
||||
onBlur?: ?(event: BlurEvent) => void,
|
||||
onBlurCapture?: ?(event: BlurEvent) => void,
|
||||
onFocus?: ?(event: FocusEvent) => void,
|
||||
onFocusCapture?: ?(event: FocusEvent) => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type TouchEventProps = $ReadOnly<{|
|
||||
type TouchEventProps = $ReadOnly<{
|
||||
onTouchCancel?: ?(e: PressEvent) => void,
|
||||
onTouchCancelCapture?: ?(e: PressEvent) => void,
|
||||
onTouchEnd?: ?(e: PressEvent) => void,
|
||||
@@ -127,14 +127,14 @@ type TouchEventProps = $ReadOnly<{|
|
||||
onTouchMoveCapture?: ?(e: PressEvent) => void,
|
||||
onTouchStart?: ?(e: PressEvent) => void,
|
||||
onTouchStartCapture?: ?(e: PressEvent) => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* For most touch interactions, you'll simply want to wrap your component in
|
||||
* `TouchableHighlight` or `TouchableOpacity`. Check out `Touchable.js`,
|
||||
* `ScrollResponder.js` and `ResponderEventPlugin.js` for more discussion.
|
||||
*/
|
||||
type GestureResponderEventProps = $ReadOnly<{|
|
||||
type GestureResponderEventProps = $ReadOnly<{
|
||||
/**
|
||||
* Does this view want to "claim" touch responsiveness? This is called for
|
||||
* every touch move on the `View` when it is not the responder.
|
||||
@@ -249,23 +249,23 @@ type GestureResponderEventProps = $ReadOnly<{|
|
||||
* See https://reactnative.dev/docs/view#onstartshouldsetrespondercapture
|
||||
*/
|
||||
onStartShouldSetResponderCapture?: ?(e: PressEvent) => boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidDrawableThemeAttr = $ReadOnly<{|
|
||||
type AndroidDrawableThemeAttr = $ReadOnly<{
|
||||
type: 'ThemeAttrAndroid',
|
||||
attribute: string,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidDrawableRipple = $ReadOnly<{|
|
||||
type AndroidDrawableRipple = $ReadOnly<{
|
||||
type: 'RippleAndroid',
|
||||
color?: ?number,
|
||||
borderless?: ?boolean,
|
||||
rippleRadius?: ?number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidDrawable = AndroidDrawableThemeAttr | AndroidDrawableRipple;
|
||||
|
||||
type AndroidViewProps = $ReadOnly<{|
|
||||
type AndroidViewProps = $ReadOnly<{
|
||||
/**
|
||||
* Identifies the element that labels the element it is applied to. When the assistive technology focuses on the component with this props,
|
||||
* the text is read aloud. The value should should match the nativeID of the related element.
|
||||
@@ -394,9 +394,9 @@ type AndroidViewProps = $ReadOnly<{|
|
||||
* @platform android
|
||||
*/
|
||||
onClick?: ?(event: PressEvent) => mixed,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type IOSViewProps = $ReadOnly<{|
|
||||
type IOSViewProps = $ReadOnly<{
|
||||
/**
|
||||
* Prevents view from being inverted if set to true and color inversion is turned on.
|
||||
*
|
||||
@@ -465,9 +465,9 @@ type IOSViewProps = $ReadOnly<{|
|
||||
* See https://reactnative.dev/docs/view#shouldrasterizeios
|
||||
*/
|
||||
shouldRasterizeIOS?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type ViewProps = $ReadOnly<{|
|
||||
export type ViewProps = $ReadOnly<{
|
||||
...DirectEventProps,
|
||||
...GestureResponderEventProps,
|
||||
...MouseEventProps,
|
||||
@@ -644,4 +644,4 @@ export type ViewProps = $ReadOnly<{|
|
||||
* See https://reactnative.dev/docs/view#removeclippedsubviews
|
||||
*/
|
||||
removeClippedSubviews?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
+2
-2
@@ -12,13 +12,13 @@ import type {IEventEmitter} from '../vendor/emitter/EventEmitter';
|
||||
|
||||
import EventEmitter from '../vendor/emitter/EventEmitter';
|
||||
|
||||
export type RawEventEmitterEvent = $ReadOnly<{|
|
||||
export type RawEventEmitterEvent = $ReadOnly<{
|
||||
eventName: string,
|
||||
// We expect, but do not/cannot require, that nativeEvent is an object
|
||||
// with the properties: key, elementType (string), type (string), tag (numeric),
|
||||
// and a stateNode of the native element/Fiber the event was emitted to.
|
||||
nativeEvent: {[string]: mixed},
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type RawEventDefinitions = {
|
||||
[eventChannel: string]: [RawEventEmitterEvent],
|
||||
|
||||
+2
-2
@@ -452,7 +452,7 @@ function setSendIdleEvents(sendIdleEvents: boolean): void {
|
||||
NativeTiming.setSendIdleEvents(sendIdleEvents);
|
||||
}
|
||||
|
||||
let ExportedJSTimers: {|
|
||||
let ExportedJSTimers: {
|
||||
callIdleCallbacks: (frameTime: number) => any | void,
|
||||
callReactNativeMicrotasks: () => void,
|
||||
callTimers: (timersToCall: Array<number>) => any | void,
|
||||
@@ -467,7 +467,7 @@ let ExportedJSTimers: {|
|
||||
queueReactNativeMicrotask: (func: any, ...args: any) => number,
|
||||
setInterval: (func: any, duration: number, ...args: any) => number,
|
||||
setTimeout: (func: any, duration: number, ...args: any) => number,
|
||||
|};
|
||||
};
|
||||
|
||||
if (!NativeTiming) {
|
||||
console.warn("Timing native module is not available, can't set timers.");
|
||||
|
||||
+2
-2
@@ -11,12 +11,12 @@
|
||||
// Make sure global Event is defined
|
||||
import EventPolyfill from './EventPolyfill';
|
||||
|
||||
type CustomEvent$Options = $ReadOnly<{|
|
||||
type CustomEvent$Options = $ReadOnly<{
|
||||
bubbles?: boolean,
|
||||
cancelable?: boolean,
|
||||
composed?: boolean,
|
||||
detail?: {...},
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
class CustomEvent extends EventPolyfill {
|
||||
detail: ?{...};
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
export type ResolvedAssetSource = {|
|
||||
export type ResolvedAssetSource = {
|
||||
+__packager_asset: boolean,
|
||||
+width: ?number,
|
||||
+height: ?number,
|
||||
+uri: string,
|
||||
+scale: number,
|
||||
|};
|
||||
};
|
||||
|
||||
import type {
|
||||
AssetDestPathResolver,
|
||||
|
||||
+17
-17
@@ -24,16 +24,16 @@ import type {ImageSource} from './ImageSource';
|
||||
import type {ElementRef, Node, RefSetter} from 'react';
|
||||
|
||||
export type ImageLoadEvent = SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
source: $ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
source: $ReadOnly<{
|
||||
width: number,
|
||||
height: number,
|
||||
uri: string,
|
||||
|}>,
|
||||
|}>,
|
||||
}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
type IOSImageProps = $ReadOnly<{|
|
||||
type IOSImageProps = $ReadOnly<{
|
||||
/**
|
||||
* A static image to display while loading the image source.
|
||||
*
|
||||
@@ -52,12 +52,12 @@ type IOSImageProps = $ReadOnly<{|
|
||||
* See https://reactnative.dev/docs/image#onprogress
|
||||
*/
|
||||
onProgress?: ?(
|
||||
event: SyntheticEvent<$ReadOnly<{|loaded: number, total: number|}>>,
|
||||
event: SyntheticEvent<$ReadOnly<{loaded: number, total: number}>>,
|
||||
) => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type AndroidImageProps = $ReadOnly<{|
|
||||
loadingIndicatorSource?: ?(number | $ReadOnly<{|uri: string|}>),
|
||||
type AndroidImageProps = $ReadOnly<{
|
||||
loadingIndicatorSource?: ?(number | $ReadOnly<{uri: string}>),
|
||||
progressiveRenderingEnabled?: ?boolean,
|
||||
fadeDuration?: ?number,
|
||||
|
||||
@@ -76,10 +76,10 @@ type AndroidImageProps = $ReadOnly<{|
|
||||
* Defaults to 1.0.
|
||||
*/
|
||||
resizeMultiplier?: ?number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type ImageProps = $ReadOnly<{|
|
||||
...$Diff<ViewProps, $ReadOnly<{|style: ?ViewStyleProp|}>>,
|
||||
export type ImageProps = $ReadOnly<{
|
||||
...$Diff<ViewProps, $ReadOnly<{style: ?ViewStyleProp}>>,
|
||||
...IOSImageProps,
|
||||
...AndroidImageProps,
|
||||
|
||||
@@ -164,9 +164,9 @@ export type ImageProps = $ReadOnly<{|
|
||||
*/
|
||||
onError?: ?(
|
||||
event: SyntheticEvent<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
error: string,
|
||||
|}>,
|
||||
}>,
|
||||
>,
|
||||
) => void,
|
||||
|
||||
@@ -267,9 +267,9 @@ export type ImageProps = $ReadOnly<{|
|
||||
*/
|
||||
srcSet?: ?string,
|
||||
children?: empty,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type ImageBackgroundProps = $ReadOnly<{|
|
||||
export type ImageBackgroundProps = $ReadOnly<{
|
||||
...ImageProps,
|
||||
children?: Node,
|
||||
|
||||
@@ -293,4 +293,4 @@ export type ImageBackgroundProps = $ReadOnly<{|
|
||||
* See https://reactnative.dev/docs/imagebackground#imageref
|
||||
*/
|
||||
imageRef?: RefSetter<ElementRef<Image>>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {ImageURISource} from './ImageSource';
|
||||
|
||||
import Platform from '../Utilities/Platform';
|
||||
|
||||
type NativeImageSourceSpec = $ReadOnly<{|
|
||||
type NativeImageSourceSpec = $ReadOnly<{
|
||||
android?: string,
|
||||
ios?: string,
|
||||
default?: string,
|
||||
@@ -21,7 +21,7 @@ type NativeImageSourceSpec = $ReadOnly<{|
|
||||
// https://reactnative.dev/docs/images#why-not-automatically-size-everything
|
||||
height: number,
|
||||
width: number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* In hybrid apps, use `nativeImageSource` to access images that are already
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
import type {InspectorData} from '../Renderer/shims/ReactNativeTypes';
|
||||
import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
const TouchableHighlight = require('../Components/Touchable/TouchableHighlight');
|
||||
const TouchableWithoutFeedback = require('../Components/Touchable/TouchableWithoutFeedback');
|
||||
const View = require('../Components/View/View');
|
||||
@@ -22,15 +24,14 @@ const Text = require('../Text/Text');
|
||||
const mapWithSeparator = require('../Utilities/mapWithSeparator');
|
||||
const BoxInspector = require('./BoxInspector');
|
||||
const StyleInspector = require('./StyleInspector');
|
||||
const React = require('react');
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
hierarchy: ?InspectorData['hierarchy'],
|
||||
style?: ?ViewStyleProp,
|
||||
frame?: ?Object,
|
||||
selection?: ?number,
|
||||
setSelection?: number => mixed,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
class ElementProperties extends React.Component<Props> {
|
||||
render(): React.Node {
|
||||
|
||||
+1
-1
@@ -19,6 +19,7 @@ import type {ViewStyleProp} from '../StyleSheet/StyleSheet';
|
||||
import type {ReactDevToolsAgent} from '../Types/ReactDevToolsTypes';
|
||||
|
||||
import SafeAreaView from '../../src/private/components/SafeAreaView_INTERNAL_DO_NOT_USE';
|
||||
import React from 'react';
|
||||
|
||||
const View = require('../Components/View/View');
|
||||
const PressabilityDebug = require('../Pressability/PressabilityDebug');
|
||||
@@ -29,7 +30,6 @@ const Platform = require('../Utilities/Platform');
|
||||
const getInspectorDataForViewAtPoint = require('./getInspectorDataForViewAtPoint');
|
||||
const InspectorOverlay = require('./InspectorOverlay');
|
||||
const InspectorPanel = require('./InspectorPanel');
|
||||
const React = require('react');
|
||||
|
||||
const {useState} = React;
|
||||
|
||||
|
||||
@@ -13,15 +13,16 @@
|
||||
import type {PressEvent} from '../Types/CoreEventTypes';
|
||||
import type {InspectedElement} from './Inspector';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
const View = require('../Components/View/View');
|
||||
const StyleSheet = require('../StyleSheet/StyleSheet');
|
||||
const ElementBox = require('./ElementBox');
|
||||
const React = require('react');
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
inspected?: ?InspectedElement,
|
||||
onTouchPoint: (locationX: number, locationY: number) => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
function InspectorOverlay({inspected, onTouchPoint}: Props): React.Node {
|
||||
const findViewForTouchEvent = (e: PressEvent) => {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
import type {ElementsHierarchy, InspectedElement} from './Inspector';
|
||||
|
||||
import SafeAreaView from '../Components/SafeAreaView/SafeAreaView';
|
||||
import React from 'react';
|
||||
|
||||
const ScrollView = require('../Components/ScrollView/ScrollView');
|
||||
const TouchableHighlight = require('../Components/Touchable/TouchableHighlight');
|
||||
@@ -22,9 +23,8 @@ const Text = require('../Text/Text');
|
||||
const ElementProperties = require('./ElementProperties');
|
||||
const NetworkOverlay = require('./NetworkOverlay');
|
||||
const PerformanceOverlay = require('./PerformanceOverlay');
|
||||
const React = require('react');
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
devtoolsIsOpen: boolean,
|
||||
inspecting: boolean,
|
||||
setInspecting: (val: boolean) => void,
|
||||
@@ -38,7 +38,7 @@ type Props = $ReadOnly<{|
|
||||
selection?: ?number,
|
||||
setSelection: number => mixed,
|
||||
inspected?: ?InspectedElement,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
class InspectorPanel extends React.Component<Props> {
|
||||
renderWaiting(): React.Node {
|
||||
@@ -107,11 +107,11 @@ class InspectorPanel extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
type InspectorPanelButtonProps = $ReadOnly<{|
|
||||
type InspectorPanelButtonProps = $ReadOnly<{
|
||||
onClick: (val: boolean) => void,
|
||||
pressed: boolean,
|
||||
title: string,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
class InspectorPanelButton extends React.Component<InspectorPanelButtonProps> {
|
||||
render(): React.Node {
|
||||
|
||||
@@ -49,11 +49,11 @@ type NetworkRequestInfo = {
|
||||
...
|
||||
};
|
||||
|
||||
type Props = $ReadOnly<{||}>;
|
||||
type State = {|
|
||||
type Props = $ReadOnly<{}>;
|
||||
type State = {
|
||||
detailRowId: ?number,
|
||||
requests: Array<NetworkRequestInfo>,
|
||||
|};
|
||||
};
|
||||
|
||||
function getStringByValue(value: any): string {
|
||||
if (value === undefined) {
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
const View = require('../Components/View/View');
|
||||
const StyleSheet = require('../StyleSheet/StyleSheet');
|
||||
const Text = require('../Text/Text');
|
||||
const PerformanceLogger = require('../Utilities/GlobalPerformanceLogger');
|
||||
const React = require('react');
|
||||
|
||||
class PerformanceOverlay extends React.Component<{...}> {
|
||||
render(): React.Node {
|
||||
|
||||
@@ -25,12 +25,12 @@ const I18nManager = require('../ReactNative/I18nManager');
|
||||
function resolveBoxStyle(
|
||||
prefix: string,
|
||||
style: Object,
|
||||
): ?$ReadOnly<{|
|
||||
): ?$ReadOnly<{
|
||||
bottom: number,
|
||||
left: number,
|
||||
right: number,
|
||||
top: number,
|
||||
|}> {
|
||||
}> {
|
||||
let hasParts = false;
|
||||
const result = {
|
||||
bottom: 0,
|
||||
|
||||
@@ -124,7 +124,7 @@ const currentCentroidY = TouchHistoryMath.currentCentroidY;
|
||||
* [PanResponder example in RNTester](https://github.com/facebook/react-native/blob/HEAD/packages/rn-tester/js/examples/PanResponder/PanResponderExample.js)
|
||||
*/
|
||||
|
||||
export type GestureState = {|
|
||||
export type GestureState = {
|
||||
/**
|
||||
* ID of the gestureState - persisted as long as there at least one touch on screen
|
||||
*/
|
||||
@@ -181,7 +181,7 @@ export type GestureState = {|
|
||||
* @private
|
||||
*/
|
||||
_accountsForMovesUpTo: number,
|
||||
|};
|
||||
};
|
||||
|
||||
type ActiveCallback = (
|
||||
event: PressEvent,
|
||||
@@ -190,7 +190,7 @@ type ActiveCallback = (
|
||||
|
||||
type PassiveCallback = (event: PressEvent, gestureState: GestureState) => mixed;
|
||||
|
||||
export type PanHandlers = {|
|
||||
export type PanHandlers = {
|
||||
onMoveShouldSetResponder: (event: PressEvent) => boolean,
|
||||
onMoveShouldSetResponderCapture: (event: PressEvent) => boolean,
|
||||
onResponderEnd: (event: PressEvent) => void,
|
||||
@@ -203,9 +203,9 @@ export type PanHandlers = {|
|
||||
onResponderTerminationRequest: (event: PressEvent) => boolean,
|
||||
onStartShouldSetResponder: (event: PressEvent) => boolean,
|
||||
onStartShouldSetResponderCapture: (event: PressEvent) => boolean,
|
||||
|};
|
||||
};
|
||||
|
||||
type PanResponderConfig = $ReadOnly<{|
|
||||
type PanResponderConfig = $ReadOnly<{
|
||||
onMoveShouldSetPanResponder?: ?ActiveCallback,
|
||||
onMoveShouldSetPanResponderCapture?: ?ActiveCallback,
|
||||
onStartShouldSetPanResponder?: ?ActiveCallback,
|
||||
@@ -224,7 +224,7 @@ type PanResponderConfig = $ReadOnly<{|
|
||||
onPanResponderTerminate?: ?PassiveCallback,
|
||||
onPanResponderTerminationRequest?: ?ActiveCallback,
|
||||
onShouldBlockNativeResponder?: ?ActiveCallback,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
const PanResponder = {
|
||||
/**
|
||||
|
||||
+6
-6
@@ -32,14 +32,14 @@ const Platform = require('../Utilities/Platform');
|
||||
const invariant = require('invariant');
|
||||
const React = require('react');
|
||||
|
||||
type RequiredProps<ItemT> = {|
|
||||
type RequiredProps<ItemT> = {
|
||||
/**
|
||||
* An array (or array-like list) of items to render. Other data types can be
|
||||
* used by targeting VirtualizedList directly.
|
||||
*/
|
||||
data: ?$ReadOnly<$ArrayLike<ItemT>>,
|
||||
|};
|
||||
type OptionalProps<ItemT> = {|
|
||||
};
|
||||
type OptionalProps<ItemT> = {
|
||||
/**
|
||||
* Takes an item from `data` and renders it into the list. Example usage:
|
||||
*
|
||||
@@ -150,7 +150,7 @@ type OptionalProps<ItemT> = {|
|
||||
* Enable an optimization to memoize the item renderer to prevent unnecessary rerenders.
|
||||
*/
|
||||
strictMode?: boolean,
|
||||
|};
|
||||
};
|
||||
|
||||
/**
|
||||
* Default Props Helper Functions
|
||||
@@ -176,10 +176,10 @@ function isArrayLike(data: mixed): boolean {
|
||||
return typeof Object(data).length === 'number';
|
||||
}
|
||||
|
||||
type FlatListProps<ItemT> = {|
|
||||
type FlatListProps<ItemT> = {
|
||||
...RequiredProps<ItemT>,
|
||||
...OptionalProps<ItemT>,
|
||||
|};
|
||||
};
|
||||
|
||||
type VirtualizedListProps = React.ElementConfig<typeof VirtualizedList>;
|
||||
|
||||
|
||||
+6
-6
@@ -25,7 +25,7 @@ type Item = any;
|
||||
|
||||
export type SectionBase<SectionItemT> = _SectionBase<SectionItemT>;
|
||||
|
||||
type RequiredProps<SectionT: SectionBase<any>> = {|
|
||||
type RequiredProps<SectionT: SectionBase<any>> = {
|
||||
/**
|
||||
* The actual data to render, akin to the `data` prop in [`<FlatList>`](https://reactnative.dev/docs/flatlist).
|
||||
*
|
||||
@@ -38,9 +38,9 @@ type RequiredProps<SectionT: SectionBase<any>> = {|
|
||||
* }>
|
||||
*/
|
||||
sections: $ReadOnlyArray<SectionT>,
|
||||
|};
|
||||
};
|
||||
|
||||
type OptionalProps<SectionT: SectionBase<any>> = {|
|
||||
type OptionalProps<SectionT: SectionBase<any>> = {
|
||||
/**
|
||||
* Default renderer for every item in every section. Can be over-ridden on a per-section basis.
|
||||
*/
|
||||
@@ -90,9 +90,9 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
|
||||
* This may improve scroll performance for large lists.
|
||||
*/
|
||||
removeClippedSubviews?: boolean,
|
||||
|};
|
||||
};
|
||||
|
||||
export type Props<SectionT> = {|
|
||||
export type Props<SectionT> = {
|
||||
...$Diff<
|
||||
VirtualizedSectionListProps<SectionT>,
|
||||
{
|
||||
@@ -114,7 +114,7 @@ export type Props<SectionT> = {|
|
||||
>,
|
||||
...RequiredProps<SectionT>,
|
||||
...OptionalProps<SectionT>,
|
||||
|};
|
||||
};
|
||||
|
||||
/**
|
||||
* A performant interface for rendering sectioned lists, supporting the most handy features:
|
||||
|
||||
@@ -26,7 +26,7 @@ type Item = any;
|
||||
|
||||
export type SectionBase<SectionItemT> = _SectionBase<SectionItemT>;
|
||||
|
||||
type RequiredProps<SectionT: SectionBase<any>> = {|
|
||||
type RequiredProps<SectionT: SectionBase<any>> = {
|
||||
/**
|
||||
* The actual data to render, akin to the `data` prop in [`<FlatList>`](https://reactnative.dev/docs/flatlist).
|
||||
*
|
||||
@@ -39,9 +39,9 @@ type RequiredProps<SectionT: SectionBase<any>> = {|
|
||||
* }>
|
||||
*/
|
||||
sections: $ReadOnlyArray<SectionT>,
|
||||
|};
|
||||
};
|
||||
|
||||
type OptionalProps<SectionT: SectionBase<any>> = {|
|
||||
type OptionalProps<SectionT: SectionBase<any>> = {
|
||||
/**
|
||||
* Default renderer for every item in every section. Can be over-ridden on a per-section basis.
|
||||
*/
|
||||
@@ -91,9 +91,9 @@ type OptionalProps<SectionT: SectionBase<any>> = {|
|
||||
* This may improve scroll performance for large lists.
|
||||
*/
|
||||
removeClippedSubviews?: boolean,
|
||||
|};
|
||||
};
|
||||
|
||||
export type Props<SectionT: SectionBase<any>> = $ReadOnly<{|
|
||||
export type Props<SectionT: SectionBase<any>> = $ReadOnly<{
|
||||
...$Diff<
|
||||
VirtualizedSectionListProps<SectionT>,
|
||||
{
|
||||
@@ -115,7 +115,7 @@ export type Props<SectionT: SectionBase<any>> = $ReadOnly<{|
|
||||
>,
|
||||
...RequiredProps<SectionT>,
|
||||
...OptionalProps<SectionT>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* A performant interface for rendering sectioned lists, supporting the most handy features:
|
||||
|
||||
+14
-14
@@ -37,20 +37,20 @@ export type LogData = $ReadOnly<{
|
||||
}>;
|
||||
|
||||
export type Observer = (
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
logs: LogBoxLogs,
|
||||
isDisabled: boolean,
|
||||
selectedLogIndex: number,
|
||||
|}>,
|
||||
}>,
|
||||
) => void;
|
||||
|
||||
export type IgnorePattern = string | RegExp;
|
||||
|
||||
export type Subscription = $ReadOnly<{|
|
||||
export type Subscription = $ReadOnly<{
|
||||
unsubscribe: () => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type WarningInfo = {|
|
||||
export type WarningInfo = {
|
||||
finalFormat: string,
|
||||
forceDialogImmediately: boolean,
|
||||
suppressDialog_LEGACY: boolean,
|
||||
@@ -58,15 +58,15 @@ export type WarningInfo = {|
|
||||
monitorEvent: string | null,
|
||||
monitorListVersion: number,
|
||||
monitorSampleRate: number,
|
||||
|};
|
||||
};
|
||||
|
||||
export type WarningFilter = (format: string) => WarningInfo;
|
||||
|
||||
type AppInfo = $ReadOnly<{|
|
||||
type AppInfo = $ReadOnly<{
|
||||
appVersion: string,
|
||||
engine: string,
|
||||
onPress?: ?() => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
const observers: Set<{observer: Observer, ...}> = new Set();
|
||||
const ignorePatterns: Set<IgnorePattern> = new Set();
|
||||
@@ -413,25 +413,25 @@ export function observe(observer: Observer): Subscription {
|
||||
};
|
||||
}
|
||||
|
||||
type Props = $ReadOnly<{||}>;
|
||||
type State = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{}>;
|
||||
type State = $ReadOnly<{
|
||||
logs: LogBoxLogs,
|
||||
isDisabled: boolean,
|
||||
hasError: boolean,
|
||||
selectedLogIndex: number,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
type SubscribedComponent = React.ComponentType<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
logs: $ReadOnlyArray<LogBoxLog>,
|
||||
isDisabled: boolean,
|
||||
selectedLogIndex: number,
|
||||
|}>,
|
||||
}>,
|
||||
>;
|
||||
|
||||
export function withSubscription(
|
||||
WrappedComponent: SubscribedComponent,
|
||||
): React.ComponentType<{||}> {
|
||||
): React.ComponentType<{}> {
|
||||
class LogBoxStateSubscription extends React.Component<Props, State> {
|
||||
static getDerivedStateFromError(): {hasError: boolean} {
|
||||
return {hasError: true};
|
||||
|
||||
@@ -82,23 +82,23 @@ class LogBoxLog {
|
||||
isComponentError: boolean;
|
||||
extraData: mixed | void;
|
||||
symbolicated:
|
||||
| $ReadOnly<{|error: null, stack: null, status: 'NONE'|}>
|
||||
| $ReadOnly<{|error: null, stack: null, status: 'PENDING'|}>
|
||||
| $ReadOnly<{|error: null, stack: Stack, status: 'COMPLETE'|}>
|
||||
| $ReadOnly<{|error: Error, stack: null, status: 'FAILED'|}> = {
|
||||
| $ReadOnly<{error: null, stack: null, status: 'NONE'}>
|
||||
| $ReadOnly<{error: null, stack: null, status: 'PENDING'}>
|
||||
| $ReadOnly<{error: null, stack: Stack, status: 'COMPLETE'}>
|
||||
| $ReadOnly<{error: Error, stack: null, status: 'FAILED'}> = {
|
||||
error: null,
|
||||
stack: null,
|
||||
status: 'NONE',
|
||||
};
|
||||
symbolicatedComponentStack:
|
||||
| $ReadOnly<{|error: null, componentStack: null, status: 'NONE'|}>
|
||||
| $ReadOnly<{|error: null, componentStack: null, status: 'PENDING'|}>
|
||||
| $ReadOnly<{|
|
||||
| $ReadOnly<{error: null, componentStack: null, status: 'NONE'}>
|
||||
| $ReadOnly<{error: null, componentStack: null, status: 'PENDING'}>
|
||||
| $ReadOnly<{
|
||||
error: null,
|
||||
componentStack: ComponentStack,
|
||||
status: 'COMPLETE',
|
||||
|}>
|
||||
| $ReadOnly<{|error: Error, componentStack: null, status: 'FAILED'|}> = {
|
||||
}>
|
||||
| $ReadOnly<{error: Error, componentStack: null, status: 'FAILED'}> = {
|
||||
error: null,
|
||||
componentStack: null,
|
||||
status: 'NONE',
|
||||
|
||||
@@ -40,12 +40,12 @@ function getLogBoxLog() {
|
||||
});
|
||||
}
|
||||
|
||||
function getLogBoxSymbolication(): {|
|
||||
function getLogBoxSymbolication(): {
|
||||
symbolicate: JestMockFn<
|
||||
$ReadOnlyArray<Array<StackFrame>>,
|
||||
Promise<SymbolicatedStackTrace>,
|
||||
>,
|
||||
|} {
|
||||
} {
|
||||
return (require('../LogBoxSymbolication'): any);
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -107,7 +107,7 @@ export type ExtendedExceptionData = ExceptionData & {
|
||||
...
|
||||
};
|
||||
export type Category = string;
|
||||
export type CodeFrame = $ReadOnly<{|
|
||||
export type CodeFrame = $ReadOnly<{
|
||||
content: string,
|
||||
location: ?{
|
||||
row: number,
|
||||
@@ -120,26 +120,26 @@ export type CodeFrame = $ReadOnly<{|
|
||||
// we gained the ability to use the collapse flag, but
|
||||
// it is not integrated into the LogBox UI.
|
||||
collapse?: boolean,
|
||||
|}>;
|
||||
export type Message = $ReadOnly<{|
|
||||
}>;
|
||||
export type Message = $ReadOnly<{
|
||||
content: string,
|
||||
substitutions: $ReadOnlyArray<
|
||||
$ReadOnly<{|
|
||||
$ReadOnly<{
|
||||
length: number,
|
||||
offset: number,
|
||||
|}>,
|
||||
}>,
|
||||
>,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export type ComponentStack = $ReadOnlyArray<CodeFrame>;
|
||||
export type ComponentStackType = 'legacy' | 'stack';
|
||||
|
||||
const SUBSTITUTION = UTFSequence.BOM + '%s';
|
||||
|
||||
export function parseInterpolation(args: $ReadOnlyArray<mixed>): $ReadOnly<{|
|
||||
export function parseInterpolation(args: $ReadOnlyArray<mixed>): $ReadOnly<{
|
||||
category: Category,
|
||||
message: Message,
|
||||
|}> {
|
||||
}> {
|
||||
const categoryParts = [];
|
||||
const contentParts = [];
|
||||
const substitutionOffsets = [];
|
||||
@@ -456,12 +456,12 @@ export function withoutANSIColorStyles(message: mixed): mixed {
|
||||
);
|
||||
}
|
||||
|
||||
export function parseLogBoxLog(args: $ReadOnlyArray<mixed>): {|
|
||||
export function parseLogBoxLog(args: $ReadOnlyArray<mixed>): {
|
||||
componentStack: ComponentStack,
|
||||
componentStackType: ComponentStackType,
|
||||
category: Category,
|
||||
message: Message,
|
||||
|} {
|
||||
} {
|
||||
const message = withoutANSIColorStyles(args[0]);
|
||||
let argsWithoutComponentStack: Array<mixed> = [];
|
||||
let componentStack: ComponentStack = [];
|
||||
|
||||
@@ -16,11 +16,11 @@ import * as LogBoxData from './Data/LogBoxData';
|
||||
import LogBoxInspector from './UI/LogBoxInspector';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
logs: $ReadOnlyArray<LogBoxLog>,
|
||||
selectedLogIndex: number,
|
||||
isDisabled?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export class _LogBoxInspectorContainer extends React.Component<Props> {
|
||||
render(): React.Node {
|
||||
@@ -65,4 +65,4 @@ export class _LogBoxInspectorContainer extends React.Component<Props> {
|
||||
|
||||
export default (LogBoxData.withSubscription(
|
||||
_LogBoxInspectorContainer,
|
||||
): React.ComponentType<{||}>);
|
||||
): React.ComponentType<{}>);
|
||||
|
||||
@@ -16,11 +16,11 @@ import LogBoxLog from './Data/LogBoxLog';
|
||||
import LogBoxLogNotification from './UI/LogBoxNotification';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
logs: $ReadOnlyArray<LogBoxLog>,
|
||||
selectedLogIndex: number,
|
||||
isDisabled?: ?boolean,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export function _LogBoxNotificationContainer(props: Props): React.Node {
|
||||
const {logs} = props;
|
||||
@@ -102,4 +102,4 @@ const styles = StyleSheet.create({
|
||||
|
||||
export default (LogBoxData.withSubscription(
|
||||
_LogBoxNotificationContainer,
|
||||
): React.ComponentType<{||}>);
|
||||
): React.ComponentType<{}>);
|
||||
|
||||
@@ -18,16 +18,16 @@ import StyleSheet from '../../StyleSheet/StyleSheet';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
backgroundColor: $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
backgroundColor: $ReadOnly<{
|
||||
default: string,
|
||||
pressed: string,
|
||||
|}>,
|
||||
}>,
|
||||
children?: React.Node,
|
||||
hitSlop?: ?EdgeInsetsProp,
|
||||
onPress?: ?(event: PressEvent) => void,
|
||||
style?: ViewStyleProp,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
function LogBoxButton(props: Props): React.Node {
|
||||
const [pressed, setPressed] = React.useState(false);
|
||||
|
||||
@@ -22,9 +22,9 @@ import LogBoxButton from './LogBoxButton';
|
||||
import LogBoxInspectorSection from './LogBoxInspectorSection';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
codeFrame: ?CodeFrame,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
function LogBoxInspectorCodeFrame(props: Props): React.Node {
|
||||
const codeFrame = props.codeFrame;
|
||||
|
||||
@@ -18,13 +18,13 @@ import LogBoxMessage from './LogBoxMessage';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
collapsed: boolean,
|
||||
message: Message,
|
||||
level: LogLevel,
|
||||
title: string,
|
||||
onPress: () => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
const SHOW_MORE_MESSAGE_LENGTH = 300;
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ import LogBoxInspectorSection from './LogBoxInspectorSection';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
log: LogBoxLog,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
const BEFORE_SLASH_RE = /^(.*)[\\/]/;
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ import Text from '../../Text/Text';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
heading: string,
|
||||
children: React.Node,
|
||||
action?: ?React.Node,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
function LogBoxInspectorSection(props: Props): React.Node {
|
||||
return (
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ import LogBoxButton from './LogBoxButton';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
onPress?: ?(event: PressEvent) => void,
|
||||
status: 'COMPLETE' | 'FAILED' | 'NONE' | 'PENDING',
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
function LogBoxInspectorSourceMapStatus(props: Props): React.Node {
|
||||
const [state, setState] = React.useState({
|
||||
|
||||
@@ -23,10 +23,10 @@ import LogBoxInspectorStackFrame from './LogBoxInspectorStackFrame';
|
||||
import * as LogBoxStyle from './LogBoxStyle';
|
||||
import * as React from 'react';
|
||||
|
||||
type Props = $ReadOnly<{|
|
||||
type Props = $ReadOnly<{
|
||||
log: LogBoxLog,
|
||||
onRetry: () => void,
|
||||
|}>;
|
||||
}>;
|
||||
|
||||
export function getCollapseMessage(
|
||||
stackFrames: Stack,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user