mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
279
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
486c507dd0 | ||
|
|
7aa5858ea6 | ||
|
|
ec9f38c540 | ||
|
|
741ac367d8 | ||
|
|
486f3b035f | ||
|
|
8491e08755 | ||
|
|
c2b60dd029 | ||
|
|
60b2b5175d | ||
|
|
44206a949f | ||
|
|
64dd140c1b | ||
|
|
295867607b | ||
|
|
016f47c7f5 | ||
|
|
5c0dec16ba | ||
|
|
79e1eacc18 | ||
|
|
770091f3c1 | ||
|
|
b7ded130df | ||
|
|
9673c885fd | ||
|
|
b99343bdad | ||
|
|
dd6d297c55 | ||
|
|
f0a3a25cd2 | ||
|
|
3968e0ac45 | ||
|
|
5200ac1ee9 | ||
|
|
1c23b70929 | ||
|
|
24a83fae2f | ||
|
|
1296cb29eb | ||
|
|
d89f59d94a | ||
|
|
b6719b247d | ||
|
|
fea38570ff | ||
|
|
8708c8bb82 | ||
|
|
9311c4e6f5 | ||
|
|
217a4449d4 | ||
|
|
1502e66c31 | ||
|
|
ccea759b71 | ||
|
|
467b637656 | ||
|
|
645540809f | ||
|
|
0b2d5317c4 | ||
|
|
aef3d8128f | ||
|
|
8622998335 | ||
|
|
91d266ba87 | ||
|
|
f77185f27e | ||
|
|
1941450649 | ||
|
|
9a7e4b4902 | ||
|
|
fb355f663d | ||
|
|
69ec19c61e | ||
|
|
f7cbd56d8e | ||
|
|
5eb28dc4f0 | ||
|
|
20ef20591f | ||
|
|
2bca6acdaf | ||
|
|
286b56fbd0 | ||
|
|
9ac9ec90c3 | ||
|
|
bbade77fb4 | ||
|
|
b8804fdbc3 | ||
|
|
8fbf0dad1f | ||
|
|
e2b25c8c9d | ||
|
|
179a651240 | ||
|
|
6130650d93 | ||
|
|
d7d89172c2 | ||
|
|
6d175f2c25 | ||
|
|
8915507244 | ||
|
|
a1402511f5 | ||
|
|
0e2591e90b | ||
|
|
feced42fea | ||
|
|
a2aab625f3 | ||
|
|
1a9853da37 | ||
|
|
86c195b3d8 | ||
|
|
5a24ea0b42 | ||
|
|
707aba822e | ||
|
|
c4ac8b329c | ||
|
|
5b52dab781 | ||
|
|
6ee319d8eb | ||
|
|
67f9d92478 | ||
|
|
dbc853246d | ||
|
|
4b70c66a27 | ||
|
|
31a78f3644 | ||
|
|
2817b397de | ||
|
|
90db4f3c6d | ||
|
|
9b261dbc94 | ||
|
|
12a97e1ecd | ||
|
|
b1fdac47b5 | ||
|
|
aa36adb116 | ||
|
|
17405b9774 | ||
|
|
05de4dbb94 | ||
|
|
a75ec1153c | ||
|
|
0eea9c61ee | ||
|
|
3080b8d26c | ||
|
|
542ab8643e | ||
|
|
eafd9b258f | ||
|
|
154c4890c6 | ||
|
|
fc154fcd74 | ||
|
|
e4c21fe292 | ||
|
|
462ab9f988 | ||
|
|
9981b8928d | ||
|
|
af5c8a8fd2 | ||
|
|
441d146b7b | ||
|
|
b2dac834fb | ||
|
|
c43a3f5d84 | ||
|
|
e083f9a139 | ||
|
|
404b7cc069 | ||
|
|
fc62b00880 | ||
|
|
ba8066d7f3 | ||
|
|
95b1fc42b7 | ||
|
|
b32a857d60 | ||
|
|
d22a85211e | ||
|
|
1f27dd6643 | ||
|
|
dfcfb90baa | ||
|
|
449c195941 | ||
|
|
d368ebfab2 | ||
|
|
339531065f | ||
|
|
30989dd24a | ||
|
|
cfae3e376d | ||
|
|
0a0dd30c6a | ||
|
|
9af620bc33 | ||
|
|
97e3c091f8 | ||
|
|
d7a2d3a957 | ||
|
|
6071e8ca2c | ||
|
|
51df83d7d5 | ||
|
|
971cda8794 | ||
|
|
72e203bf95 | ||
|
|
0ce2bbdd64 | ||
|
|
b644b426af | ||
|
|
9462a73189 | ||
|
|
7a02b400be | ||
|
|
251f65263c | ||
|
|
0a9b6bedb3 | ||
|
|
295ee16430 | ||
|
|
0abaaeead0 | ||
|
|
7fd9e77837 | ||
|
|
9584480261 | ||
|
|
8adf78ffc9 | ||
|
|
2289909374 | ||
|
|
9f792c2bae | ||
|
|
100a31412f | ||
|
|
3a2bb3dbc5 | ||
|
|
b2821c3345 | ||
|
|
1b2d9a858b | ||
|
|
24c72f513e | ||
|
|
1142d9d059 | ||
|
|
0cfc38a59f | ||
|
|
797ca6c219 | ||
|
|
1f9b765f81 | ||
|
|
7dff5d2e30 | ||
|
|
76c54847bb | ||
|
|
31b158c9fe | ||
|
|
ff79224d37 | ||
|
|
acdd08aef7 | ||
|
|
53c9dbabaf | ||
|
|
4c2fa7e4ee | ||
|
|
db06fc6814 | ||
|
|
23d84c8df8 | ||
|
|
17219720e4 | ||
|
|
826d7345ad | ||
|
|
04d870b10b | ||
|
|
2da08884b2 | ||
|
|
727b7dffb4 | ||
|
|
858e95b2aa | ||
|
|
bdc47313e8 | ||
|
|
5c13eaccbd | ||
|
|
61eb3e8826 | ||
|
|
5f8c82412f | ||
|
|
df5d14c568 | ||
|
|
3318483b31 | ||
|
|
f1ce6426fe | ||
|
|
779f9e2b9c | ||
|
|
1a62b66c51 | ||
|
|
820b1c0e46 | ||
|
|
048449b678 | ||
|
|
33c3d5d2a9 | ||
|
|
52cbe7dc22 | ||
|
|
b3ee595af7 | ||
|
|
bb933c8ad4 | ||
|
|
fe84362a90 | ||
|
|
999ebb154d | ||
|
|
0c7ccfe172 | ||
|
|
82354640ff | ||
|
|
5ac77062be | ||
|
|
ebecd4872b | ||
|
|
375a5805d1 | ||
|
|
10601c921e | ||
|
|
be140107b9 | ||
|
|
7f2bbf4263 | ||
|
|
922cd6ddfc | ||
|
|
21fda19ca9 | ||
|
|
c6024f6391 | ||
|
|
f839627605 | ||
|
|
04392f2428 | ||
|
|
74c32e2609 | ||
|
|
7b2080e118 | ||
|
|
d41c3950eb | ||
|
|
7dbc8051e5 | ||
|
|
38c5621602 | ||
|
|
1a3e6eb888 | ||
|
|
dd20aa5ef0 | ||
|
|
644b93dc11 | ||
|
|
8b8c2ece7b | ||
|
|
145109fc6d | ||
|
|
bd4cd6ea5d | ||
|
|
fd84447341 | ||
|
|
5deb528695 | ||
|
|
6565929358 | ||
|
|
19d0429a76 | ||
|
|
bdff10b4ea | ||
|
|
4941cbcf1e | ||
|
|
a36ccf227d | ||
|
|
9ee815f6b5 | ||
|
|
610c4826a5 | ||
|
|
b62ed2f291 | ||
|
|
9ff4d31dc4 | ||
|
|
228f104dad | ||
|
|
95cce07baf | ||
|
|
0162be8fc3 | ||
|
|
5710b230a2 | ||
|
|
0c157bea36 | ||
|
|
8af84c6788 | ||
|
|
e193aea2f4 | ||
|
|
5d35df8afa | ||
|
|
44b0e6b91f | ||
|
|
3b5e4cc593 | ||
|
|
25e048ba3a | ||
|
|
d0d1712851 | ||
|
|
c1ed6ab4ed | ||
|
|
b7ee6adade | ||
|
|
5c3f9547c6 | ||
|
|
6f42603d0e | ||
|
|
5d57368bb0 | ||
|
|
d2c333acaf | ||
|
|
e6bec9cb80 | ||
|
|
fa6191f6ac | ||
|
|
00e7d46df3 | ||
|
|
0e8b75b22c | ||
|
|
272d3ded4f | ||
|
|
857bae4ea3 | ||
|
|
3182b608fc | ||
|
|
d4dff25292 | ||
|
|
3dac49a4f5 | ||
|
|
a6e1e33a50 | ||
|
|
2cf2fdbc04 | ||
|
|
24736d1188 | ||
|
|
1f9c9ecb4b | ||
|
|
8eee79b5d1 | ||
|
|
cacc31d759 | ||
|
|
3e153b2a5b | ||
|
|
f4e3e19f8c | ||
|
|
f3253c0f84 | ||
|
|
df83f05737 | ||
|
|
6f75591620 | ||
|
|
d6926c5468 | ||
|
|
e2cf37a5a6 | ||
|
|
a4916b8c98 | ||
|
|
82c8c97898 | ||
|
|
178407da40 | ||
|
|
157febcd54 | ||
|
|
228abd4ff5 | ||
|
|
77e533cb9f | ||
|
|
c507a05f70 | ||
|
|
111ed8d180 | ||
|
|
4ab455b37d | ||
|
|
d14eb2e38d | ||
|
|
2c0d44a902 | ||
|
|
5f7b2e4085 | ||
|
|
2bd5b0b440 | ||
|
|
db870f8729 | ||
|
|
406a1b3ca2 | ||
|
|
c79f617742 | ||
|
|
16bdbee165 | ||
|
|
84ce9d9aea | ||
|
|
38354c4cbf | ||
|
|
027a2706d2 | ||
|
|
2e4ab9ff70 | ||
|
|
2ee910a11a | ||
|
|
8689b0f21c | ||
|
|
d6fe78fc25 | ||
|
|
66abc86c9a | ||
|
|
5f381fd357 | ||
|
|
53eaf9062d | ||
|
|
4fcd316781 | ||
|
|
73d7f36d8f | ||
|
|
6efe8e1d81 | ||
|
|
68848f8c91 | ||
|
|
8ebe66d0e3 |
@@ -221,6 +221,9 @@
|
||||
"no-bitwise": 1, // disallow use of bitwise operators (off by default)
|
||||
"no-plusplus": 0, // disallow use of unary operators, ++ and -- (off by default)
|
||||
|
||||
// React Plugin
|
||||
// The following rules are made available via `eslint-plugin-react`.
|
||||
|
||||
"react/display-name": 0,
|
||||
"react/jsx-boolean-value": 0,
|
||||
"react/jsx-no-duplicate-props": 2,
|
||||
@@ -228,8 +231,8 @@
|
||||
"react/jsx-sort-props": 0,
|
||||
"react/jsx-uses-react": 1,
|
||||
"react/jsx-uses-vars": 1,
|
||||
"react/no-did-mount-set-state": [1, "allow-in-func"],
|
||||
"react/no-did-update-set-state": [1, "allow-in-func"],
|
||||
"react/no-did-mount-set-state": 1,
|
||||
"react/no-did-update-set-state": 1,
|
||||
"react/no-multi-comp": 0,
|
||||
"react/no-string-refs": 1,
|
||||
"react/no-unknown-property": 0,
|
||||
|
||||
+3
-3
@@ -47,11 +47,11 @@ suppress_type=$FlowIssue
|
||||
suppress_type=$FlowFixMe
|
||||
suppress_type=$FixMe
|
||||
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
|
||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
||||
|
||||
unsafe.enable_getters_and_setters=true
|
||||
|
||||
[version]
|
||||
^0.32.0
|
||||
^0.33.0
|
||||
|
||||
@@ -34,6 +34,7 @@ project.xcworkspace
|
||||
buck-out
|
||||
/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/
|
||||
/ReactAndroid/src/main/jni/prebuilt/lib/x86/
|
||||
/ReactAndroid/src/main/gen
|
||||
|
||||
# Android
|
||||
.idea
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
language: objective-c
|
||||
|
||||
osx_image: xcode7.3
|
||||
osx_image: xcode8
|
||||
|
||||
install:
|
||||
- mkdir -p /Users/travis/build/facebook/.nvm
|
||||
@@ -16,6 +16,7 @@ install:
|
||||
|
||||
script:
|
||||
- if [[ "$TEST_TYPE" = objc ]]; then travis_retry travis_wait ./scripts/objc-test.sh; fi
|
||||
- if [[ "$TEST_TYPE" = objc-tvos ]]; then travis_retry travis_wait ./scripts/objc-test-tvos.sh; fi
|
||||
- if [[ "$TEST_TYPE" = e2e-objc ]]; then node ./scripts/run-ci-e2e-tests.js --ios --js --retries 3; fi
|
||||
- if [[ "$TEST_TYPE" = js ]]; then npm run flow check; fi
|
||||
- if [[ "$TEST_TYPE" = js ]]; then npm test -- --maxWorkers=1; fi
|
||||
@@ -24,6 +25,7 @@ env:
|
||||
matrix:
|
||||
- TEST_TYPE=e2e-objc
|
||||
- TEST_TYPE=objc
|
||||
- TEST_TYPE=objc-tvos
|
||||
- TEST_TYPE=js
|
||||
|
||||
branches:
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UIUserInterfaceStyle</key>
|
||||
<string>Automatic</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -7,6 +7,7 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
001BFCE41D838343008E587E /* RCTMultipartStreamReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */; };
|
||||
1300627F1B59179B0043FE5A /* RCTGzipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1300627E1B59179B0043FE5A /* RCTGzipTests.m */; };
|
||||
13129DD41C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */; };
|
||||
13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; };
|
||||
@@ -57,11 +58,55 @@
|
||||
272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };
|
||||
27B885561BED29AF00008352 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; };
|
||||
27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };
|
||||
2D4624FA1DA2EAC300C74D09 /* RCTLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */; };
|
||||
2D4624FB1DA2EAC300C74D09 /* RCTRootViewIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */; };
|
||||
2D4624FC1DA2EAC300C74D09 /* UIExplorerIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB99D0B1BA0340600302749 /* UIExplorerIntegrationTests.m */; };
|
||||
2D4624FD1DA2EAC300C74D09 /* UIExplorerSnapshotTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 143BC5A01B21E45C00462512 /* UIExplorerSnapshotTests.m */; };
|
||||
2D4624FE1DA2EAC300C74D09 /* RCTUIManagerScenarioTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */; };
|
||||
2D4625351DA2EBBE00C74D09 /* libRCTTest-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */; };
|
||||
2D4BD8D21DA2E20D005AC8A8 /* RCTURLUtilsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B6C1A21C34225900D3FAF5 /* RCTURLUtilsTests.m */; };
|
||||
2D4BD8D31DA2E20D005AC8A8 /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */; };
|
||||
2D4BD8D41DA2E20D005AC8A8 /* RCTAllocationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA41B21F5E400C1F8F2 /* RCTAllocationTests.m */; };
|
||||
2D4BD8D51DA2E20D005AC8A8 /* RCTBridgeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA51B21F5E400C1F8F2 /* RCTBridgeTests.m */; };
|
||||
2D4BD8D61DA2E20D005AC8A8 /* RCTJSCExecutorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA61B21F5E400C1F8F2 /* RCTJSCExecutorTests.m */; };
|
||||
2D4BD8D71DA2E20D005AC8A8 /* RCTConvert_NSURLTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA71B21F5E400C1F8F2 /* RCTConvert_NSURLTests.m */; };
|
||||
2D4BD8D81DA2E20D005AC8A8 /* RCTFontTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA81B21F5E400C1F8F2 /* RCTFontTests.m */; };
|
||||
2D4BD8D91DA2E20D005AC8A8 /* RCTEventDispatcherTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFA91B21F5E400C1F8F2 /* RCTEventDispatcherTests.m */; };
|
||||
2D4BD8DA1DA2E20D005AC8A8 /* RCTGzipTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1300627E1B59179B0043FE5A /* RCTGzipTests.m */; };
|
||||
2D4BD8DB1DA2E20D005AC8A8 /* RCTImageLoaderHelpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */; };
|
||||
2D4BD8DC1DA2E20D005AC8A8 /* RCTImageLoaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */; };
|
||||
2D4BD8DD1DA2E20D005AC8A8 /* RCTImageUtilTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 144D21231B2204C5006DB32B /* RCTImageUtilTests.m */; };
|
||||
2D4BD8DE1DA2E20D005AC8A8 /* RCTJSONTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DB03471B5D2ED500C27245 /* RCTJSONTests.m */; };
|
||||
2D4BD8DF1DA2E20D005AC8A8 /* RCTMethodArgumentTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DF61B51B67A45000EDB188 /* RCTMethodArgumentTests.m */; };
|
||||
2D4BD8E01DA2E20D005AC8A8 /* RCTModuleInitTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */; };
|
||||
2D4BD8E11DA2E20D005AC8A8 /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */; };
|
||||
2D4BD8E21DA2E20D005AC8A8 /* RCTModuleMethodTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1393D0371B68CD1300E1B601 /* RCTModuleMethodTests.m */; };
|
||||
2D4BD8E31DA2E20D005AC8A8 /* RCTShadowViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 138D6A161B53CD440074A87E /* RCTShadowViewTests.m */; };
|
||||
2D4BD8E41DA2E20D005AC8A8 /* RCTUIManagerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */; };
|
||||
2D4BD8E51DA2E20D005AC8A8 /* RCTComponentPropsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */; };
|
||||
2D4BD8E61DA2E20D005AC8A8 /* TestBundle.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DD981D51D33C6FB007DC7BE /* TestBundle.js */; };
|
||||
2D4BD8E71DA2E20D005AC8A8 /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D6D7101B220EB3001FB087 /* libOCMock.a */; };
|
||||
2D8C2E321DA40403000EE098 /* RCTMultipartStreamReaderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */; };
|
||||
2DD323DC1DA2DDBF000FE1B8 /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; };
|
||||
2DD323DD1DA2DDBF000FE1B8 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; };
|
||||
2DD323DE1DA2DDBF000FE1B8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
|
||||
2DD323DF1DA2DDBF000FE1B8 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||
2DD323E01DA2DDBF000FE1B8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||
2DD323E11DA2DDBF000FE1B8 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };
|
||||
2DD323E21DA2DDBF000FE1B8 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB61A68108700A75B9A /* Info.plist */; };
|
||||
2DD323E31DA2DE3F000FE1B8 /* libRCTAnimation-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323B51DA2DD8B000FE1B8 /* libRCTAnimation-tvOS.a */; };
|
||||
2DD323E41DA2DE3F000FE1B8 /* libRCTImage-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */; };
|
||||
2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */; };
|
||||
2DD323E61DA2DE3F000FE1B8 /* libRCTNetwork-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */; };
|
||||
2DD323E71DA2DE3F000FE1B8 /* libRCTSettings-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */; };
|
||||
2DD323E81DA2DE3F000FE1B8 /* libRCTText-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */; };
|
||||
2DD323E91DA2DE3F000FE1B8 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */; };
|
||||
2DD323EA1DA2DE3F000FE1B8 /* libReact-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD323D91DA2DD8B000FE1B8 /* libReact-tvOS.a */; };
|
||||
3578590A1B28D2CF00341EDB /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 357859011B28D2C500341EDB /* libRCTLinking.a */; };
|
||||
3D13F8481D6F6AF900E69E0E /* ImageInBundle.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */; };
|
||||
3D13F84A1D6F6AFD00E69E0E /* OtherImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */; };
|
||||
3D299BAF1D33EBFA00FA1057 /* RCTLoggingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */; };
|
||||
3D2AFAF51D646CF80089D1A3 /* LegacyImage@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* LegacyImage@2x.png */; };
|
||||
3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; };
|
||||
3D56F9F11D6F6E9B00F53A06 /* UIExplorerBundle.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 3D13F83E1D6F6AE000E69E0E /* UIExplorerBundle.bundle */; };
|
||||
3DB99D0C1BA0340600302749 /* UIExplorerIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DB99D0B1BA0340600302749 /* UIExplorerIntegrationTests.m */; };
|
||||
3DD981D61D33C6FB007DC7BE /* TestBundle.js in Resources */ = {isa = PBXBuildFile; fileRef = 3DD981D51D33C6FB007DC7BE /* TestBundle.js */; };
|
||||
@@ -158,6 +203,83 @@
|
||||
remoteGlobalIDString = 134814201AA4EA6300B7C361;
|
||||
remoteInfo = RCTPushNotification;
|
||||
};
|
||||
2D4624C31DA2EA6900C74D09 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 2DD3238F1DA2DD8A000FE1B8;
|
||||
remoteInfo = "UIExplorer-tvOS";
|
||||
};
|
||||
2DD323A61DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 2DD3238F1DA2DD8A000FE1B8;
|
||||
remoteInfo = "UIExplorer-tvOS";
|
||||
};
|
||||
2DD323B41DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 13E5019C1D07A502005F35D8 /* RCTAnimation.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A28201D9B03D100D4039D;
|
||||
remoteInfo = "RCTAnimation-tvOS";
|
||||
};
|
||||
2DD323BA1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 13417FE31AA91428003F314A /* RCTImage.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A283A1D9B042B00D4039D;
|
||||
remoteInfo = "RCTImage-tvOS";
|
||||
};
|
||||
2DD323BE1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A28471D9B043800D4039D;
|
||||
remoteInfo = "RCTLinking-tvOS";
|
||||
};
|
||||
2DD323C21DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 134180261AA91779003F314A /* RCTNetwork.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A28541D9B044C00D4039D;
|
||||
remoteInfo = "RCTNetwork-tvOS";
|
||||
};
|
||||
2DD323C71DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 13CC9D481AEED2B90020D1C2 /* RCTSettings.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A28611D9B046600D4039D;
|
||||
remoteInfo = "RCTSettings-tvOS";
|
||||
};
|
||||
2DD323CB1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A286E1D9B047700D4039D;
|
||||
remoteInfo = "RCTTest-tvOS";
|
||||
};
|
||||
2DD323CF1DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 13417FEA1AA914B8003F314A /* RCTText.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A287B1D9B048500D4039D;
|
||||
remoteInfo = "RCTText-tvOS";
|
||||
};
|
||||
2DD323D41DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 139FDECA1B0651EA00C62182 /* RCTWebSocket.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A28881D9B049200D4039D;
|
||||
remoteInfo = "RCTWebSocket-tvOS";
|
||||
};
|
||||
2DD323D81DA2DD8B000FE1B8 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;
|
||||
proxyType = 2;
|
||||
remoteGlobalIDString = 2D2A28131D9B038B00D4039D;
|
||||
remoteInfo = "React-tvOS";
|
||||
};
|
||||
357859001B28D2C500341EDB /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */;
|
||||
@@ -196,6 +318,7 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTMultipartStreamReaderTests.m; sourceTree = "<group>"; };
|
||||
004D289E1AAF61C70097A701 /* UIExplorerUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UIExplorerUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1300627E1B59179B0043FE5A /* RCTGzipTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTGzipTests.m; sourceTree = "<group>"; };
|
||||
13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuleInitNotificationRaceTests.m; sourceTree = "<group>"; };
|
||||
@@ -252,13 +375,17 @@
|
||||
27B885551BED29AF00008352 /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = "<group>"; };
|
||||
27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = UIExplorer/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = "<group>"; };
|
||||
27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = UIExplorer/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = "<group>"; };
|
||||
2D4624E01DA2EA6900C74D09 /* UIExplorer-tvOSIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UIExplorer-tvOSIntegrationTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2DD323901DA2DD8A000FE1B8 /* UIExplorer-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "UIExplorer-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2DD323A01DA2DD8B000FE1B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
2DD323A51DA2DD8B000FE1B8 /* UIExplorer-tvOSUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "UIExplorer-tvOSUnitTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
357858F81B28D2C400341EDB /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../../Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = "<group>"; };
|
||||
3D13F83E1D6F6AE000E69E0E /* UIExplorerBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UIExplorerBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
3D13F8401D6F6AE000E69E0E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../Info.plist; sourceTree = "<group>"; };
|
||||
3D13F8441D6F6AF200E69E0E /* ImageInBundle.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = ImageInBundle.png; sourceTree = "<group>"; };
|
||||
3D13F8451D6F6AF200E69E0E /* OtherImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = OtherImages.xcassets; sourceTree = "<group>"; };
|
||||
3D299BAE1D33EBFA00FA1057 /* RCTLoggingTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLoggingTests.m; sourceTree = "<group>"; };
|
||||
3D2AFAF41D646CF80089D1A3 /* LegacyImage@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "LegacyImage@2x.png"; path = "UIExplorer/LegacyImage@2x.png"; sourceTree = "<group>"; };
|
||||
3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "legacy_image@2x.png"; path = "UIExplorer/legacy_image@2x.png"; sourceTree = "<group>"; };
|
||||
3DB99D0B1BA0340600302749 /* UIExplorerIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIExplorerIntegrationTests.m; sourceTree = "<group>"; };
|
||||
3DD981D51D33C6FB007DC7BE /* TestBundle.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = TestBundle.js; sourceTree = "<group>"; };
|
||||
58005BE41ABA80530062E044 /* RCTTest.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTTest.xcodeproj; path = ../../Libraries/RCTTest/RCTTest.xcodeproj; sourceTree = "<group>"; };
|
||||
@@ -320,6 +447,37 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2D4624D91DA2EA6900C74D09 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D4625351DA2EBBE00C74D09 /* libRCTTest-tvOS.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2DD3238D1DA2DD8A000FE1B8 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2DD323E31DA2DE3F000FE1B8 /* libRCTAnimation-tvOS.a in Frameworks */,
|
||||
2DD323E41DA2DE3F000FE1B8 /* libRCTImage-tvOS.a in Frameworks */,
|
||||
2DD323E51DA2DE3F000FE1B8 /* libRCTLinking-tvOS.a in Frameworks */,
|
||||
2DD323E61DA2DE3F000FE1B8 /* libRCTNetwork-tvOS.a in Frameworks */,
|
||||
2DD323E71DA2DE3F000FE1B8 /* libRCTSettings-tvOS.a in Frameworks */,
|
||||
2DD323E81DA2DE3F000FE1B8 /* libRCTText-tvOS.a in Frameworks */,
|
||||
2DD323E91DA2DE3F000FE1B8 /* libRCTWebSocket-tvOS.a in Frameworks */,
|
||||
2DD323EA1DA2DE3F000FE1B8 /* libReact-tvOS.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2DD323A21DA2DD8B000FE1B8 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D4BD8E71DA2E20D005AC8A8 /* libOCMock.a in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3D13F83B1D6F6AE000E69E0E /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -355,7 +513,7 @@
|
||||
1323F18D1C04ABAC0091BED0 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3D2AFAF41D646CF80089D1A3 /* LegacyImage@2x.png */,
|
||||
3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */,
|
||||
13B07FB61A68108700A75B9A /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
@@ -365,6 +523,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
13417FE81AA91428003F314A /* libRCTImage.a */,
|
||||
2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -373,6 +532,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
13417FEF1AA914B8003F314A /* libRCTText.a */,
|
||||
2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -381,6 +541,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1341802B1AA91779003F314A /* libRCTNetwork.a */,
|
||||
2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -413,6 +574,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
139FDED91B0651EA00C62182 /* libRCTWebSocket.a */,
|
||||
2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -435,6 +597,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
13E501A31D07A502005F35D8 /* libRCTAnimation.a */,
|
||||
2DD323B51DA2DD8B000FE1B8 /* libRCTAnimation-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -460,6 +623,7 @@
|
||||
134CB9291C85A38800265FA6 /* RCTModuleInitTests.m */,
|
||||
13129DD31C85F87C007D611C /* RCTModuleInitNotificationRaceTests.m */,
|
||||
1393D0371B68CD1300E1B601 /* RCTModuleMethodTests.m */,
|
||||
001BFCE31D838343008E587E /* RCTMultipartStreamReaderTests.m */,
|
||||
138D6A161B53CD440074A87E /* RCTShadowViewTests.m */,
|
||||
1497CFAB1B21F5E400C1F8F2 /* RCTUIManagerTests.m */,
|
||||
13BCE84E1C9C209600DD7AAD /* RCTComponentPropsTests.m */,
|
||||
@@ -504,6 +668,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
14AADF041AC3DB95002390C9 /* libReact.a */,
|
||||
2DD323D91DA2DD8B000FE1B8 /* libReact-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -550,10 +715,19 @@
|
||||
name = NativeExampleViews;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
2DD323911DA2DD8B000FE1B8 /* UIExplorer-tvOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
2DD323A01DA2DD8B000FE1B8 /* Info.plist */,
|
||||
);
|
||||
path = "UIExplorer-tvOS";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
357858F91B28D2C400341EDB /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
357859011B28D2C500341EDB /* libRCTLinking.a */,
|
||||
2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -573,6 +747,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
58005BEE1ABA80530062E044 /* libRCTTest.a */,
|
||||
2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -581,6 +756,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
834C36D21AF8DA610019C93C /* libRCTSettings.a */,
|
||||
2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -594,6 +770,7 @@
|
||||
143BC5961B21E3E100462512 /* UIExplorerIntegrationTests */,
|
||||
3D13F83F1D6F6AE000E69E0E /* UIExplorerBundle */,
|
||||
14D6D6EA1B2205C0001FB087 /* OCMock */,
|
||||
2DD323911DA2DD8B000FE1B8 /* UIExplorer-tvOS */,
|
||||
83CBBA001A601CBA00E9B192 /* Products */,
|
||||
);
|
||||
indentWidth = 2;
|
||||
@@ -607,6 +784,9 @@
|
||||
004D289E1AAF61C70097A701 /* UIExplorerUnitTests.xctest */,
|
||||
143BC5951B21E3E100462512 /* UIExplorerIntegrationTests.xctest */,
|
||||
3D13F83E1D6F6AE000E69E0E /* UIExplorerBundle.bundle */,
|
||||
2DD323901DA2DD8A000FE1B8 /* UIExplorer-tvOS.app */,
|
||||
2DD323A51DA2DD8B000FE1B8 /* UIExplorer-tvOSUnitTests.xctest */,
|
||||
2D4624E01DA2EA6900C74D09 /* UIExplorer-tvOSIntegrationTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -676,6 +856,60 @@
|
||||
productReference = 143BC5951B21E3E100462512 /* UIExplorerIntegrationTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
2D4624C11DA2EA6900C74D09 /* UIExplorer-tvOSIntegrationTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D4624DD1DA2EA6900C74D09 /* Build configuration list for PBXNativeTarget "UIExplorer-tvOSIntegrationTests" */;
|
||||
buildPhases = (
|
||||
2D4624C41DA2EA6900C74D09 /* Sources */,
|
||||
2D4624D91DA2EA6900C74D09 /* Frameworks */,
|
||||
2D4624DB1DA2EA6900C74D09 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
2D4624C21DA2EA6900C74D09 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "UIExplorer-tvOSIntegrationTests";
|
||||
productName = "UIExplorer-tvOSUnitTests";
|
||||
productReference = 2D4624E01DA2EA6900C74D09 /* UIExplorer-tvOSIntegrationTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
2DD3238F1DA2DD8A000FE1B8 /* UIExplorer-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2DD323DA1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget "UIExplorer-tvOS" */;
|
||||
buildPhases = (
|
||||
2DD3238C1DA2DD8A000FE1B8 /* Sources */,
|
||||
2DD3238D1DA2DD8A000FE1B8 /* Frameworks */,
|
||||
2DD3238E1DA2DD8A000FE1B8 /* Resources */,
|
||||
2DD323EB1DA2DEC1000FE1B8 /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "UIExplorer-tvOS";
|
||||
productName = "UIExplorer-tvOS";
|
||||
productReference = 2DD323901DA2DD8A000FE1B8 /* UIExplorer-tvOS.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
2DD323A41DA2DD8B000FE1B8 /* UIExplorer-tvOSUnitTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2DD323DB1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget "UIExplorer-tvOSUnitTests" */;
|
||||
buildPhases = (
|
||||
2DD323A11DA2DD8B000FE1B8 /* Sources */,
|
||||
2DD323A21DA2DD8B000FE1B8 /* Frameworks */,
|
||||
2DD323A31DA2DD8B000FE1B8 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
2DD323A71DA2DD8B000FE1B8 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "UIExplorer-tvOSUnitTests";
|
||||
productName = "UIExplorer-tvOSUnitTests";
|
||||
productReference = 2DD323A51DA2DD8B000FE1B8 /* UIExplorer-tvOSUnitTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
3D13F83D1D6F6AE000E69E0E /* UIExplorerBundle */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 3D13F8411D6F6AE000E69E0E /* Build configuration list for PBXNativeTarget "UIExplorerBundle" */;
|
||||
@@ -709,6 +943,15 @@
|
||||
CreatedOnToolsVersion = 6.3.2;
|
||||
TestTargetID = 13B07F861A680F5B00A75B9A;
|
||||
};
|
||||
2DD3238F1DA2DD8A000FE1B8 = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
2DD323A41DA2DD8B000FE1B8 = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
TestTargetID = 2DD3238F1DA2DD8A000FE1B8;
|
||||
};
|
||||
3D13F83D1D6F6AE000E69E0E = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
};
|
||||
@@ -793,6 +1036,9 @@
|
||||
004D289D1AAF61C70097A701 /* UIExplorerUnitTests */,
|
||||
143BC5941B21E3E100462512 /* UIExplorerIntegrationTests */,
|
||||
3D13F83D1D6F6AE000E69E0E /* UIExplorerBundle */,
|
||||
2DD3238F1DA2DD8A000FE1B8 /* UIExplorer-tvOS */,
|
||||
2DD323A41DA2DD8B000FE1B8 /* UIExplorer-tvOSUnitTests */,
|
||||
2D4624C11DA2EA6900C74D09 /* UIExplorer-tvOSIntegrationTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@@ -875,6 +1121,69 @@
|
||||
remoteRef = 14DC67F01AB71876001358AB /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323B51DA2DD8B000FE1B8 /* libRCTAnimation-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTAnimation-tvOS.a";
|
||||
remoteRef = 2DD323B41DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323BB1DA2DD8B000FE1B8 /* libRCTImage-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTImage-tvOS.a";
|
||||
remoteRef = 2DD323BA1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323BF1DA2DD8B000FE1B8 /* libRCTLinking-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTLinking-tvOS.a";
|
||||
remoteRef = 2DD323BE1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323C31DA2DD8B000FE1B8 /* libRCTNetwork-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTNetwork-tvOS.a";
|
||||
remoteRef = 2DD323C21DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323C81DA2DD8B000FE1B8 /* libRCTSettings-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTSettings-tvOS.a";
|
||||
remoteRef = 2DD323C71DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323CC1DA2DD8B000FE1B8 /* libRCTTest-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTTest-tvOS.a";
|
||||
remoteRef = 2DD323CB1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323D01DA2DD8B000FE1B8 /* libRCTText-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTText-tvOS.a";
|
||||
remoteRef = 2DD323CF1DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323D51DA2DD8B000FE1B8 /* libRCTWebSocket-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libRCTWebSocket-tvOS.a";
|
||||
remoteRef = 2DD323D41DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
2DD323D91DA2DD8B000FE1B8 /* libReact-tvOS.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
path = "libReact-tvOS.a";
|
||||
remoteRef = 2DD323D81DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
sourceTree = BUILT_PRODUCTS_DIR;
|
||||
};
|
||||
357859011B28D2C500341EDB /* libRCTLinking.a */ = {
|
||||
isa = PBXReferenceProxy;
|
||||
fileType = archive.ar;
|
||||
@@ -920,7 +1229,7 @@
|
||||
files = (
|
||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||
3D56F9F11D6F6E9B00F53A06 /* UIExplorerBundle.bundle in Resources */,
|
||||
3D2AFAF51D646CF80089D1A3 /* LegacyImage@2x.png in Resources */,
|
||||
3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */,
|
||||
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -932,6 +1241,31 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2D4624DB1DA2EA6900C74D09 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2DD3238E1DA2DD8A000FE1B8 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2DD323DF1DA2DDBF000FE1B8 /* Images.xcassets in Resources */,
|
||||
2DD323E11DA2DDBF000FE1B8 /* legacy_image@2x.png in Resources */,
|
||||
2DD323E21DA2DDBF000FE1B8 /* Info.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2DD323A31DA2DD8B000FE1B8 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D4BD8E61DA2E20D005AC8A8 /* TestBundle.js in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3D13F83C1D6F6AE000E69E0E /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -944,6 +1278,19 @@
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
2DD323EB1DA2DEC1000FE1B8 /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "export NODE_BINARY=node\n$SRCROOT/../../packager/react-native-xcode.sh Examples/UIExplorer/js/UIExplorerApp.ios.js";
|
||||
};
|
||||
68CD48B71D2BCB2C007E06A9 /* Run Script */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -979,6 +1326,7 @@
|
||||
1497CFB31B21F5E400C1F8F2 /* RCTUIManagerTests.m in Sources */,
|
||||
13DB03481B5D2ED500C27245 /* RCTJSONTests.m in Sources */,
|
||||
1497CFAC1B21F5E400C1F8F2 /* RCTAllocationTests.m in Sources */,
|
||||
001BFCE41D838343008E587E /* RCTMultipartStreamReaderTests.m in Sources */,
|
||||
13DF61B61B67A45000EDB188 /* RCTMethodArgumentTests.m in Sources */,
|
||||
138D6A181B53CD440074A87E /* RCTShadowViewTests.m in Sources */,
|
||||
13B6C1A31C34225900D3FAF5 /* RCTURLUtilsTests.m in Sources */,
|
||||
@@ -1011,6 +1359,57 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2D4624C41DA2EA6900C74D09 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D4624FC1DA2EAC300C74D09 /* UIExplorerIntegrationTests.m in Sources */,
|
||||
2D4624FA1DA2EAC300C74D09 /* RCTLoggingTests.m in Sources */,
|
||||
2D4624FE1DA2EAC300C74D09 /* RCTUIManagerScenarioTests.m in Sources */,
|
||||
2D4624FD1DA2EAC300C74D09 /* UIExplorerSnapshotTests.m in Sources */,
|
||||
2D4624FB1DA2EAC300C74D09 /* RCTRootViewIntegrationTests.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2DD3238C1DA2DD8A000FE1B8 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2DD323DC1DA2DDBF000FE1B8 /* FlexibleSizeExampleView.m in Sources */,
|
||||
2DD323DD1DA2DDBF000FE1B8 /* UpdatePropertiesExampleView.m in Sources */,
|
||||
2DD323E01DA2DDBF000FE1B8 /* main.m in Sources */,
|
||||
2DD323DE1DA2DDBF000FE1B8 /* AppDelegate.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
2DD323A11DA2DD8B000FE1B8 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D4BD8DC1DA2E20D005AC8A8 /* RCTImageLoaderTests.m in Sources */,
|
||||
2D4BD8D51DA2E20D005AC8A8 /* RCTBridgeTests.m in Sources */,
|
||||
2D4BD8D91DA2E20D005AC8A8 /* RCTEventDispatcherTests.m in Sources */,
|
||||
2D4BD8D41DA2E20D005AC8A8 /* RCTAllocationTests.m in Sources */,
|
||||
2D4BD8DA1DA2E20D005AC8A8 /* RCTGzipTests.m in Sources */,
|
||||
2D4BD8DB1DA2E20D005AC8A8 /* RCTImageLoaderHelpers.m in Sources */,
|
||||
2D4BD8E51DA2E20D005AC8A8 /* RCTComponentPropsTests.m in Sources */,
|
||||
2D4BD8D71DA2E20D005AC8A8 /* RCTConvert_NSURLTests.m in Sources */,
|
||||
2D4BD8E21DA2E20D005AC8A8 /* RCTModuleMethodTests.m in Sources */,
|
||||
2D4BD8E11DA2E20D005AC8A8 /* RCTModuleInitNotificationRaceTests.m in Sources */,
|
||||
2D4BD8DF1DA2E20D005AC8A8 /* RCTMethodArgumentTests.m in Sources */,
|
||||
2D4BD8D61DA2E20D005AC8A8 /* RCTJSCExecutorTests.m in Sources */,
|
||||
2D4BD8D31DA2E20D005AC8A8 /* RCTBundleURLProviderTests.m in Sources */,
|
||||
2D4BD8D21DA2E20D005AC8A8 /* RCTURLUtilsTests.m in Sources */,
|
||||
2D8C2E321DA40403000EE098 /* RCTMultipartStreamReaderTests.m in Sources */,
|
||||
2D4BD8DE1DA2E20D005AC8A8 /* RCTJSONTests.m in Sources */,
|
||||
2D4BD8E31DA2E20D005AC8A8 /* RCTShadowViewTests.m in Sources */,
|
||||
2D4BD8D81DA2E20D005AC8A8 /* RCTFontTests.m in Sources */,
|
||||
2D4BD8DD1DA2E20D005AC8A8 /* RCTImageUtilTests.m in Sources */,
|
||||
2D4BD8E41DA2E20D005AC8A8 /* RCTUIManagerTests.m in Sources */,
|
||||
2D4BD8E01DA2E20D005AC8A8 /* RCTModuleInitTests.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3D13F83A1D6F6AE000E69E0E /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -1026,6 +1425,16 @@
|
||||
target = 13B07F861A680F5B00A75B9A /* UIExplorer */;
|
||||
targetProxy = 143BC59B1B21E3E100462512 /* PBXContainerItemProxy */;
|
||||
};
|
||||
2D4624C21DA2EA6900C74D09 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 2DD3238F1DA2DD8A000FE1B8 /* UIExplorer-tvOS */;
|
||||
targetProxy = 2D4624C31DA2EA6900C74D09 /* PBXContainerItemProxy */;
|
||||
};
|
||||
2DD323A71DA2DD8B000FE1B8 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 2DD3238F1DA2DD8A000FE1B8 /* UIExplorer-tvOS */;
|
||||
targetProxy = 2DD323A61DA2DD8B000FE1B8 /* PBXContainerItemProxy */;
|
||||
};
|
||||
3D13F84C1D6F6B5F00E69E0E /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 3D13F83D1D6F6AE000E69E0E /* UIExplorerBundle */;
|
||||
@@ -1161,6 +1570,169 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2D4624DE1DA2EA6900C74D09 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
"FB_REFERENCE_IMAGE_DIR=\"\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)IntegrationTests/ReferenceImages\\\"\"",
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
"$(SRCROOT)/../../Libraries/**",
|
||||
);
|
||||
INFOPLIST_FILE = UIExplorerIntegrationTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/UIExplorerUnitTests",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.UIExplorer-tvOSIntegrationTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIExplorer-tvOS.app/UIExplorer-tvOS";
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D4624DF1DA2EA6900C74D09 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
"$(SRCROOT)/../../Libraries/**",
|
||||
);
|
||||
INFOPLIST_FILE = UIExplorerIntegrationTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/UIExplorerUnitTests",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.UIExplorer-tvOSIntegrationTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIExplorer-tvOS.app/UIExplorer-tvOS";
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2DD323AC1DA2DD8B000FE1B8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "UIExplorer-tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.UIExplorer-tvOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2DD323AD1DA2DD8B000FE1B8 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
INFOPLIST_FILE = "UIExplorer-tvOS/Info.plist";
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.UIExplorer-tvOS";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TARGETED_DEVICE_FAMILY = 3;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
2DD323AE1DA2DD8B000FE1B8 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
"$(SRCROOT)/../../Libraries/**",
|
||||
"$(SRCROOT)/UIExplorerUnitTests",
|
||||
);
|
||||
INFOPLIST_FILE = UIExplorerUnitTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/UIExplorerUnitTests",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.UIExplorer-tvOSUnitTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIExplorer-tvOS.app/UIExplorer-tvOS";
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2DD323AF1DA2DD8B000FE1B8 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
"$(SRCROOT)/../../Libraries/**",
|
||||
"$(SRCROOT)/UIExplorerUnitTests",
|
||||
);
|
||||
INFOPLIST_FILE = UIExplorerUnitTests/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
LIBRARY_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"$(PROJECT_DIR)/UIExplorerUnitTests",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.UIExplorer-tvOSUnitTests";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/UIExplorer-tvOS.app/UIExplorer-tvOS";
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
3D13F8421D6F6AE000E69E0E /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -1356,6 +1928,33 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2D4624DD1DA2EA6900C74D09 /* Build configuration list for PBXNativeTarget "UIExplorer-tvOSIntegrationTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D4624DE1DA2EA6900C74D09 /* Debug */,
|
||||
2D4624DF1DA2EA6900C74D09 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2DD323DA1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget "UIExplorer-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2DD323AC1DA2DD8B000FE1B8 /* Debug */,
|
||||
2DD323AD1DA2DD8B000FE1B8 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
2DD323DB1DA2DD8B000FE1B8 /* Build configuration list for PBXNativeTarget "UIExplorer-tvOSUnitTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2DD323AE1DA2DD8B000FE1B8 /* Debug */,
|
||||
2DD323AF1DA2DD8B000FE1B8 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
3D13F8411D6F6AE000E69E0E /* Build configuration list for PBXNativeTarget "UIExplorerBundle" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
+118
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0800"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "2DD3238F1DA2DD8A000FE1B8"
|
||||
BuildableName = "UIExplorer-tvOS.app"
|
||||
BlueprintName = "UIExplorer-tvOS"
|
||||
ReferencedContainer = "container:UIExplorer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "2DD323A41DA2DD8B000FE1B8"
|
||||
BuildableName = "UIExplorer-tvOSUnitTests.xctest"
|
||||
BlueprintName = "UIExplorer-tvOSUnitTests"
|
||||
ReferencedContainer = "container:UIExplorer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
<TestableReference
|
||||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "2D4624C11DA2EA6900C74D09"
|
||||
BuildableName = "UIExplorer-tvOSIntegrationTests.xctest"
|
||||
BlueprintName = "UIExplorer-tvOSIntegrationTests"
|
||||
ReferencedContainer = "container:UIExplorer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</TestableReference>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "2DD3238F1DA2DD8A000FE1B8"
|
||||
BuildableName = "UIExplorer-tvOS.app"
|
||||
BlueprintName = "UIExplorer-tvOS"
|
||||
ReferencedContainer = "container:UIExplorer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "2DD3238F1DA2DD8A000FE1B8"
|
||||
BuildableName = "UIExplorer-tvOS.app"
|
||||
BlueprintName = "UIExplorer-tvOS"
|
||||
ReferencedContainer = "container:UIExplorer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<EnvironmentVariables>
|
||||
<EnvironmentVariable
|
||||
key = "CI_USE_PACKAGER"
|
||||
value = "1"
|
||||
isEnabled = "YES">
|
||||
</EnvironmentVariable>
|
||||
</EnvironmentVariables>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "2DD3238F1DA2DD8A000FE1B8"
|
||||
BuildableName = "UIExplorer-tvOS.app"
|
||||
BlueprintName = "UIExplorer-tvOS"
|
||||
ReferencedContainer = "container:UIExplorer.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@@ -19,7 +19,9 @@
|
||||
#import "RCTJavaScriptLoader.h"
|
||||
#import "RCTLinkingManager.h"
|
||||
#import "RCTRootView.h"
|
||||
#if !TARGET_OS_TV
|
||||
#import "RCTPushNotificationManager.h"
|
||||
#endif
|
||||
|
||||
@interface AppDelegate() <RCTBridgeDelegate>
|
||||
|
||||
@@ -79,6 +81,8 @@
|
||||
|
||||
# pragma mark - Push Notifications
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
|
||||
// Required to register for notifications
|
||||
- (void)application:(__unused UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
|
||||
{
|
||||
@@ -109,4 +113,6 @@
|
||||
[RCTPushNotificationManager didReceiveLocalNotification:notification];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "20x20",
|
||||
"scale" : "3x"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
@@ -41,4 +51,4 @@
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,9 @@ RCT_EXPORT_MODULE();
|
||||
[_resizableRootView setSizeFlexibility:RCTRootViewSizeFlexibilityHeight];
|
||||
|
||||
_currentSizeTextView = [UITextView new];
|
||||
#ifndef TARGET_OS_TV
|
||||
_currentSizeTextView.editable = NO;
|
||||
#endif
|
||||
_currentSizeTextView.text = @"Resizable view has not been resized yet";
|
||||
_currentSizeTextView.textColor = [UIColor blackColor];
|
||||
_currentSizeTextView.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@@ -45,12 +45,14 @@
|
||||
[_runner runTest:_cmd module:@#name]; \
|
||||
}
|
||||
|
||||
#if !TARGET_OS_TV // None of these will run in tvOS due to StatusBar not existing
|
||||
RCT_TEST(ViewExample)
|
||||
RCT_TEST(LayoutExample)
|
||||
RCT_TEST(TextExample)
|
||||
RCT_TEST(SwitchExample)
|
||||
RCT_TEST(SliderExample)
|
||||
RCT_TEST(TabBarExample)
|
||||
#endif
|
||||
|
||||
- (void)testZZZNotInRecordMode
|
||||
{
|
||||
|
||||
@@ -235,6 +235,7 @@ RCT_EXPORT_METHOD(test:(__unused NSString *)a
|
||||
// Wait to complete the test until the new batchedbridge is also deallocated
|
||||
@autoreleasepool {
|
||||
batchedBridge = bridge.batchedBridge;
|
||||
[bridge invalidate];
|
||||
bridge = nil;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,11 +63,13 @@
|
||||
|
||||
- (void)testFamily
|
||||
{
|
||||
#if !TARGET_OS_TV
|
||||
{
|
||||
UIFont *expected = [UIFont fontWithName:@"Cochin" size:14];
|
||||
UIFont *result = [RCTConvert UIFont:@{@"fontFamily": @"Cochin"}];
|
||||
RCTAssertEqualFonts(expected, result);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
UIFont *expected = [UIFont fontWithName:@"HelveticaNeue" size:14];
|
||||
UIFont *result = [RCTConvert UIFont:@{@"fontFamily": @"Helvetica Neue"}];
|
||||
@@ -135,6 +137,7 @@
|
||||
UIFont *result = [RCTConvert UIFont:@{@"fontFamily": @"HelveticaNeue-Bold", @"fontWeight": @"normal"}];
|
||||
RCTAssertEqualFonts(expected, result);
|
||||
}
|
||||
#if !TARGET_OS_TV
|
||||
{
|
||||
UIFont *expected = [UIFont fontWithName:@"Cochin-Bold" size:14];
|
||||
UIFont *result = [RCTConvert UIFont:@{@"fontFamily": @"Cochin", @"fontWeight": @"700"}];
|
||||
@@ -145,6 +148,7 @@
|
||||
UIFont *result = [RCTConvert UIFont:@{@"fontFamily": @"Cochin", @"fontWeight": @"100"}];
|
||||
RCTAssertEqualFonts(expected, result);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)testFamilyAndStyle
|
||||
|
||||
@@ -47,7 +47,13 @@
|
||||
return _canLoadImageURLHandler(requestURL);
|
||||
}
|
||||
|
||||
- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL size:(CGSize)size scale:(CGFloat)scale resizeMode:(RCTResizeMode)resizeMode progressHandler:(RCTImageLoaderProgressBlock)progressHandler completionHandler:(RCTImageLoaderCompletionBlock)completionHandler
|
||||
- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL
|
||||
size:(CGSize)size
|
||||
scale:(CGFloat)scale
|
||||
resizeMode:(RCTResizeMode)resizeMode
|
||||
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
|
||||
partialLoadHandler:(__unused RCTImageLoaderPartialLoadBlock)partialLoadHandler
|
||||
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler
|
||||
{
|
||||
return _loadImageURLHandler(imageURL, size, scale, resizeMode, progressHandler, completionHandler);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ RCTDefineImageDecoder(RCTImageLoaderTestsDecoder2)
|
||||
[bridge.imageLoader loadImageWithURLRequest:urlRequest size:CGSizeMake(100, 100) scale:1.0 clipped:YES resizeMode:RCTResizeModeContain progressBlock:^(int64_t progress, int64_t total) {
|
||||
XCTAssertEqual(progress, 1);
|
||||
XCTAssertEqual(total, 1);
|
||||
} completionBlock:^(NSError *loadError, id loadedImage) {
|
||||
} partialLoadBlock:nil completionBlock:^(NSError *loadError, id loadedImage) {
|
||||
XCTAssertEqualObjects(loadedImage, image);
|
||||
XCTAssertNil(loadError);
|
||||
}];
|
||||
@@ -92,7 +92,7 @@ RCTDefineImageDecoder(RCTImageLoaderTestsDecoder2)
|
||||
[bridge.imageLoader loadImageWithURLRequest:urlRequest size:CGSizeMake(100, 100) scale:1.0 clipped:YES resizeMode:RCTResizeModeContain progressBlock:^(int64_t progress, int64_t total) {
|
||||
XCTAssertEqual(progress, 1);
|
||||
XCTAssertEqual(total, 1);
|
||||
} completionBlock:^(NSError *loadError, id loadedImage) {
|
||||
} partialLoadBlock:nil completionBlock:^(NSError *loadError, id loadedImage) {
|
||||
XCTAssertEqualObjects(loadedImage, image);
|
||||
XCTAssertNil(loadError);
|
||||
}];
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
/**
|
||||
* The examples provided by Facebook are for non-commercial testing and
|
||||
* evaluation purposes only.
|
||||
*
|
||||
* Facebook reserves all rights not expressly granted.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
|
||||
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#import <XCTest/XCTest.h>
|
||||
#import "RCTUtils.h"
|
||||
#import "RCTMultipartStreamReader.h"
|
||||
|
||||
@interface RCTMultipartStreamReaderTests : XCTestCase
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTMultipartStreamReaderTests
|
||||
|
||||
- (void)testSimpleCase {
|
||||
NSString *response =
|
||||
@"preable, should be ignored\r\n"
|
||||
@"--sample_boundary\r\n"
|
||||
@"Content-Type: application/json; charset=utf-8\r\n"
|
||||
@"Content-Length: 2\r\n\r\n"
|
||||
@"{}\r\n"
|
||||
@"--sample_boundary--\r\n"
|
||||
@"epilogue, should be ignored";
|
||||
|
||||
NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@"sample_boundary"];
|
||||
__block NSInteger count = 0;
|
||||
BOOL success = [reader readAllParts:^(NSDictionary *headers, NSData *content, BOOL done) {
|
||||
XCTAssertTrue(done);
|
||||
XCTAssertEqualObjects(headers[@"Content-Type"], @"application/json; charset=utf-8");
|
||||
XCTAssertEqualObjects([[NSString alloc] initWithData:content encoding:NSUTF8StringEncoding], @"{}");
|
||||
count++;
|
||||
}];
|
||||
XCTAssertTrue(success);
|
||||
XCTAssertEqual(count, 1);
|
||||
}
|
||||
|
||||
- (void)testMultipleParts {
|
||||
NSString *response =
|
||||
@"preable, should be ignored\r\n"
|
||||
@"--sample_boundary\r\n"
|
||||
@"1\r\n"
|
||||
@"--sample_boundary\r\n"
|
||||
@"2\r\n"
|
||||
@"--sample_boundary\r\n"
|
||||
@"3\r\n"
|
||||
@"--sample_boundary--\r\n"
|
||||
@"epilogue, should be ignored";
|
||||
|
||||
NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@"sample_boundary"];
|
||||
__block NSInteger count = 0;
|
||||
BOOL success = [reader readAllParts:^(__unused NSDictionary *headers, NSData *content, BOOL done) {
|
||||
count++;
|
||||
XCTAssertEqual(done, count == 3);
|
||||
NSString *expectedBody = [NSString stringWithFormat:@"%ld", (long)count];
|
||||
NSString *actualBody = [[NSString alloc] initWithData:content encoding:NSUTF8StringEncoding];
|
||||
XCTAssertEqualObjects(actualBody, expectedBody);
|
||||
}];
|
||||
XCTAssertTrue(success);
|
||||
XCTAssertEqual(count, 3);
|
||||
}
|
||||
|
||||
- (void)testNoDelimiter {
|
||||
NSString *response = @"Yolo";
|
||||
|
||||
NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@"sample_boundary"];
|
||||
__block NSInteger count = 0;
|
||||
BOOL success = [reader readAllParts:^(__unused NSDictionary *headers, __unused NSData *content, __unused BOOL done) {
|
||||
count++;
|
||||
}];
|
||||
XCTAssertFalse(success);
|
||||
XCTAssertEqual(count, 0);
|
||||
}
|
||||
|
||||
- (void)testNoCloseDelimiter {
|
||||
NSString *response =
|
||||
@"preable, should be ignored\r\n"
|
||||
@"--sample_boundary\r\n"
|
||||
@"Content-Type: application/json; charset=utf-8\r\n"
|
||||
@"Content-Length: 2\r\n\r\n"
|
||||
@"{}\r\n"
|
||||
@"--sample_boundary\r\n"
|
||||
@"incomplete message...";
|
||||
|
||||
NSInputStream *inputStream = [NSInputStream inputStreamWithData:[response dataUsingEncoding:NSUTF8StringEncoding]];
|
||||
RCTMultipartStreamReader *reader = [[RCTMultipartStreamReader alloc] initWithInputStream:inputStream boundary:@"sample_boundary"];
|
||||
__block NSInteger count = 0;
|
||||
BOOL success = [reader readAllParts:^(__unused NSDictionary *headers, __unused NSData *content, __unused BOOL done) {
|
||||
count++;
|
||||
}];
|
||||
XCTAssertFalse(success);
|
||||
XCTAssertEqual(count, 1);
|
||||
}
|
||||
|
||||
@end
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
@@ -612,7 +612,7 @@ exports.examples = [
|
||||
render: function() {
|
||||
return (
|
||||
<Image
|
||||
source={require('image!LegacyImage')}
|
||||
source={require('image!legacy_image')}
|
||||
/>
|
||||
);
|
||||
},
|
||||
@@ -645,6 +645,7 @@ exports.examples = [
|
||||
</View>
|
||||
);
|
||||
},
|
||||
platform: 'ios',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ var {
|
||||
TouchableHighlight,
|
||||
View,
|
||||
} = ReactNative;
|
||||
// $FlowFixMe Picker.Item not properly defined for flow.
|
||||
|
||||
const Item = Picker.Item;
|
||||
|
||||
exports.displayName = (undefined: ?string);
|
||||
|
||||
@@ -50,7 +50,6 @@ class Tester extends React.Component {
|
||||
toValue: this.current,
|
||||
};
|
||||
|
||||
// $FlowIssue #0000000
|
||||
Animated[this.props.type](this.state.native, { ...config, useNativeDriver: true }).start();
|
||||
Animated[this.props.type](this.state.js, { ...config, useNativeDriver: false }).start();
|
||||
};
|
||||
@@ -169,6 +168,46 @@ class InternalSettings extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
class EventExample extends React.Component {
|
||||
state = {
|
||||
scrollX: new Animated.Value(0),
|
||||
};
|
||||
|
||||
render() {
|
||||
const opacity = this.state.scrollX.interpolate({
|
||||
inputRange: [0, 200],
|
||||
outputRange: [1, 0],
|
||||
});
|
||||
return (
|
||||
<View>
|
||||
<Animated.View
|
||||
style={[
|
||||
styles.block,
|
||||
{
|
||||
opacity,
|
||||
}
|
||||
]}
|
||||
/>
|
||||
<Animated.ScrollView
|
||||
horizontal
|
||||
style={{ height: 100, marginTop: 16 }}
|
||||
onScroll={
|
||||
Animated.event([{
|
||||
nativeEvent: { contentOffset: { x: this.state.scrollX } }
|
||||
}], {
|
||||
useNativeDriver: true,
|
||||
})
|
||||
}
|
||||
>
|
||||
<View style={{ width: 600, backgroundColor: '#eee', justifyContent: 'center' }}>
|
||||
<Text>Scroll me!</Text>
|
||||
</View>
|
||||
</Animated.ScrollView>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
row: {
|
||||
padding: 10,
|
||||
@@ -430,4 +469,13 @@ exports.examples = [
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'Animated events',
|
||||
platform: 'android',
|
||||
render: function() {
|
||||
return (
|
||||
<EventExample />
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
@@ -33,7 +33,7 @@ const {
|
||||
Text,
|
||||
TouchableWithoutFeedback,
|
||||
} = ReactNative;
|
||||
// $FlowFixMe found when converting React.createClass to ES6
|
||||
|
||||
const Item = Picker.Item;
|
||||
|
||||
class PickerExample extends React.Component {
|
||||
|
||||
@@ -66,9 +66,7 @@ var SwipeableListViewSimpleExample = React.createClass({
|
||||
dataSource={this.state.dataSource}
|
||||
maxSwipeDistance={100}
|
||||
renderQuickActions={
|
||||
/* $FlowFixMe(>=0.31.0) */
|
||||
(rowData: Object, sectionID: string, rowID: string) => {
|
||||
/* $FlowFixMe(>=0.31.0) */
|
||||
return (<View style={styles.actionsContainer}>
|
||||
<TouchableHighlight onPress={() => {
|
||||
Alert.alert('Tips', 'You could do something with this row: ' + rowData.text);
|
||||
|
||||
@@ -300,23 +300,23 @@ class TextExample extends React.Component {
|
||||
</Text>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="Unicode">
|
||||
<View style={{flex: 1}}>
|
||||
<View>
|
||||
<View style={{flexDirection: 'row'}}>
|
||||
<Text style={{backgroundColor: 'red'}}>
|
||||
星际争霸是世界上最好的游戏。
|
||||
</Text>
|
||||
</View>
|
||||
<View style={{flex: 1}}>
|
||||
<View>
|
||||
<Text style={{backgroundColor: 'red'}}>
|
||||
星际争霸是世界上最好的游戏。
|
||||
</Text>
|
||||
</View>
|
||||
<View style={{flex: 1, alignItems: 'center'}}>
|
||||
<View style={{alignItems: 'center'}}>
|
||||
<Text style={{backgroundColor: 'red'}}>
|
||||
星际争霸是世界上最好的游戏。
|
||||
</Text>
|
||||
</View>
|
||||
<View style={{flex: 1}}>
|
||||
<View>
|
||||
<Text style={{backgroundColor: 'red'}}>
|
||||
星际争霸是世界上最好的游戏。星际争霸是世界上最好的游戏。星际争霸是世界上最好的游戏。星际争霸是世界上最好的游戏。
|
||||
</Text>
|
||||
|
||||
@@ -66,7 +66,7 @@ class TimePickerAndroidExample extends React.Component {
|
||||
<UIExplorerPage title="TimePickerAndroid">
|
||||
<UIExplorerBlock title="Simple time picker">
|
||||
<TouchableWithoutFeedback
|
||||
onPress={this.showPicker.bind(this, 'simple')}>
|
||||
onPress={this.showPicker.bind(this, 'simple', {})}>
|
||||
<Text style={styles.text}>{this.state.simpleText}</Text>
|
||||
</TouchableWithoutFeedback>
|
||||
</UIExplorerBlock>
|
||||
|
||||
@@ -42,6 +42,8 @@ const UIManager = require('UIManager');
|
||||
const URIActionMap = require('./URIActionMap');
|
||||
const View = require('View');
|
||||
|
||||
import type {UIExplorerNavigationState} from './UIExplorerNavigationReducer';
|
||||
|
||||
UIManager.setLayoutAnimationEnabledExperimental(true);
|
||||
|
||||
const DRAWER_WIDTH_LEFT = 56;
|
||||
|
||||
@@ -120,6 +120,7 @@ class UIExplorerExampleList extends React.Component {
|
||||
this.props.persister.setState(() => ({filter: text}));
|
||||
}}
|
||||
placeholder="Search..."
|
||||
underlineColorAndroid="transparent"
|
||||
style={[styles.searchTextInput, this.props.searchTextInputStyle]}
|
||||
testID="explorer_search"
|
||||
value={this.props.persister.state.filter}
|
||||
@@ -215,6 +216,7 @@ const styles = StyleSheet.create({
|
||||
borderRadius: 3,
|
||||
borderWidth: 1,
|
||||
paddingLeft: 8,
|
||||
paddingVertical: 0,
|
||||
height: 35,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -32,10 +32,6 @@ const ComponentExamples: Array<UIExplorerExample> = [
|
||||
key: 'ActivityIndicatorExample',
|
||||
module: require('./ActivityIndicatorExample'),
|
||||
},
|
||||
{
|
||||
key: 'SliderExample',
|
||||
module: require('./SliderExample'),
|
||||
},
|
||||
{
|
||||
key: 'ImageExample',
|
||||
module: require('./ImageExample'),
|
||||
@@ -44,6 +40,14 @@ const ComponentExamples: Array<UIExplorerExample> = [
|
||||
key: 'ListViewExample',
|
||||
module: require('./ListViewExample'),
|
||||
},
|
||||
{
|
||||
key: 'ListViewGridLayoutExample',
|
||||
module: require('./ListViewGridLayoutExample'),
|
||||
},
|
||||
{
|
||||
key: 'ListViewPagingExample',
|
||||
module: require('./ListViewPagingExample'),
|
||||
},
|
||||
{
|
||||
key: 'ModalExample',
|
||||
module: require('./ModalExample'),
|
||||
@@ -64,6 +68,10 @@ const ComponentExamples: Array<UIExplorerExample> = [
|
||||
key: 'ScrollViewSimpleExample',
|
||||
module: require('./ScrollViewSimpleExample'),
|
||||
},
|
||||
{
|
||||
key: 'SliderExample',
|
||||
module: require('./SliderExample'),
|
||||
},
|
||||
{
|
||||
key: 'StatusBarExample',
|
||||
module: require('./StatusBarExample'),
|
||||
|
||||
@@ -15,10 +15,12 @@ var AnimatedImplementation = require('AnimatedImplementation');
|
||||
var Image = require('Image');
|
||||
var Text = require('Text');
|
||||
var View = require('View');
|
||||
var ScrollView = require('ScrollView');
|
||||
|
||||
module.exports = {
|
||||
...AnimatedImplementation,
|
||||
View: AnimatedImplementation.createAnimatedComponent(View),
|
||||
Text: AnimatedImplementation.createAnimatedComponent(Text),
|
||||
Image: AnimatedImplementation.createAnimatedComponent(Image),
|
||||
ScrollView: AnimatedImplementation.createAnimatedComponent(ScrollView),
|
||||
};
|
||||
|
||||
@@ -727,6 +727,9 @@ class AnimatedValue extends AnimatedWithChildren {
|
||||
*/
|
||||
setOffset(offset: number): void {
|
||||
this._offset = offset;
|
||||
if (this.__isNative) {
|
||||
NativeAnimatedAPI.setAnimatedNodeOffset(this.__getNativeTag(), offset);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -736,6 +739,9 @@ class AnimatedValue extends AnimatedWithChildren {
|
||||
flattenOffset(): void {
|
||||
this._value += this._offset;
|
||||
this._offset = 0;
|
||||
if (this.__isNative) {
|
||||
NativeAnimatedAPI.flattenAnimatedNodeOffset(this.__getNativeTag());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1130,6 +1136,54 @@ class AnimatedAddition extends AnimatedWithChildren {
|
||||
}
|
||||
}
|
||||
|
||||
class AnimatedDivision extends AnimatedWithChildren {
|
||||
_a: Animated;
|
||||
_b: Animated;
|
||||
|
||||
constructor(a: Animated | number, b: Animated | number) {
|
||||
super();
|
||||
this._a = typeof a === 'number' ? new AnimatedValue(a) : a;
|
||||
this._b = typeof b === 'number' ? new AnimatedValue(b) : b;
|
||||
}
|
||||
|
||||
__makeNative() {
|
||||
super.__makeNative();
|
||||
this._a.__makeNative();
|
||||
this._b.__makeNative();
|
||||
}
|
||||
|
||||
__getValue(): number {
|
||||
const a = this._a.__getValue();
|
||||
const b = this._b.__getValue();
|
||||
if (b === 0) {
|
||||
console.error('Detected division by zero in AnimatedDivision');
|
||||
}
|
||||
return a / b;
|
||||
}
|
||||
|
||||
interpolate(config: InterpolationConfigType): AnimatedInterpolation {
|
||||
return new AnimatedInterpolation(this, config);
|
||||
}
|
||||
|
||||
__attach(): void {
|
||||
this._a.__addChild(this);
|
||||
this._b.__addChild(this);
|
||||
}
|
||||
|
||||
__detach(): void {
|
||||
this._a.__removeChild(this);
|
||||
this._b.__removeChild(this);
|
||||
super.__detach();
|
||||
}
|
||||
|
||||
__getNativeConfig(): any {
|
||||
return {
|
||||
type: 'division',
|
||||
input: [this._a.__getNativeTag(), this._b.__getNativeTag()],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class AnimatedMultiplication extends AnimatedWithChildren {
|
||||
_a: Animated;
|
||||
_b: Animated;
|
||||
@@ -1486,6 +1540,8 @@ class AnimatedProps extends Animated {
|
||||
// JS may not be up to date.
|
||||
props[key] = value.__getValue();
|
||||
}
|
||||
} else if (value instanceof AnimatedEvent) {
|
||||
props[key] = value.__getHandler();
|
||||
} else {
|
||||
props[key] = value;
|
||||
}
|
||||
@@ -1596,6 +1652,7 @@ function createAnimatedComponent(Component: any): any {
|
||||
|
||||
componentWillUnmount() {
|
||||
this._propsAnimated && this._propsAnimated.__detach();
|
||||
this._detachNativeEvents(this.props);
|
||||
}
|
||||
|
||||
setNativeProps(props) {
|
||||
@@ -1603,14 +1660,50 @@ function createAnimatedComponent(Component: any): any {
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.attachProps(this.props);
|
||||
this._attachProps(this.props);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this._propsAnimated.setNativeView(this._component);
|
||||
|
||||
this._attachNativeEvents(this.props);
|
||||
}
|
||||
|
||||
attachProps(nextProps) {
|
||||
_attachNativeEvents(newProps) {
|
||||
if (newProps !== this.props) {
|
||||
this._detachNativeEvents(this.props);
|
||||
}
|
||||
|
||||
// Make sure to get the scrollable node for components that implement
|
||||
// `ScrollResponder.Mixin`.
|
||||
const ref = this._component.getScrollableNode ?
|
||||
this._component.getScrollableNode() :
|
||||
this._component;
|
||||
|
||||
for (const key in newProps) {
|
||||
const prop = newProps[key];
|
||||
if (prop instanceof AnimatedEvent && prop.__isNative) {
|
||||
prop.__attach(ref, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_detachNativeEvents(props) {
|
||||
// Make sure to get the scrollable node for components that implement
|
||||
// `ScrollResponder.Mixin`.
|
||||
const ref = this._component.getScrollableNode ?
|
||||
this._component.getScrollableNode() :
|
||||
this._component;
|
||||
|
||||
for (const key in props) {
|
||||
const prop = props[key];
|
||||
if (prop instanceof AnimatedEvent && prop.__isNative) {
|
||||
prop.__detach(ref, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_attachProps(nextProps) {
|
||||
var oldPropsAnimated = this._propsAnimated;
|
||||
|
||||
// The system is best designed when setNativeProps is implemented. It is
|
||||
@@ -1640,7 +1733,6 @@ function createAnimatedComponent(Component: any): any {
|
||||
callback,
|
||||
);
|
||||
|
||||
|
||||
if (this._component) {
|
||||
this._propsAnimated.setNativeView(this._component);
|
||||
}
|
||||
@@ -1657,7 +1749,8 @@ function createAnimatedComponent(Component: any): any {
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
this.attachProps(nextProps);
|
||||
this._attachProps(nextProps);
|
||||
this._attachNativeEvents(nextProps);
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -1672,6 +1765,12 @@ function createAnimatedComponent(Component: any): any {
|
||||
_setComponentRef(c) {
|
||||
this._component = c;
|
||||
}
|
||||
|
||||
// A third party library can use getNode()
|
||||
// to get the node reference of the decorated component
|
||||
getNode () {
|
||||
return this._component;
|
||||
}
|
||||
}
|
||||
AnimatedComponent.propTypes = {
|
||||
style: function(props, propName, componentName) {
|
||||
@@ -1688,7 +1787,7 @@ function createAnimatedComponent(Component: any): any {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return AnimatedComponent;
|
||||
@@ -1744,15 +1843,22 @@ type CompositeAnimation = {
|
||||
};
|
||||
|
||||
var add = function(
|
||||
a: Animated,
|
||||
b: Animated
|
||||
a: Animated | number,
|
||||
b: Animated | number,
|
||||
): AnimatedAddition {
|
||||
return new AnimatedAddition(a, b);
|
||||
};
|
||||
|
||||
var divide = function(
|
||||
a: Animated | number,
|
||||
b: Animated | number,
|
||||
): AnimatedDivision {
|
||||
return new AnimatedDivision(a, b);
|
||||
};
|
||||
|
||||
var multiply = function(
|
||||
a: Animated,
|
||||
b: Animated
|
||||
a: Animated | number,
|
||||
b: Animated | number,
|
||||
): AnimatedMultiplication {
|
||||
return new AnimatedMultiplication(a, b);
|
||||
};
|
||||
@@ -1992,21 +2098,108 @@ var stagger = function(
|
||||
};
|
||||
|
||||
type Mapping = {[key: string]: Mapping} | AnimatedValue;
|
||||
type EventConfig = {
|
||||
listener?: ?Function;
|
||||
useNativeDriver?: bool;
|
||||
};
|
||||
|
||||
type EventConfig = {listener?: ?Function};
|
||||
var event = function(
|
||||
argMapping: Array<?Mapping>,
|
||||
config?: ?EventConfig,
|
||||
): () => void {
|
||||
return function(...args): void {
|
||||
var traverse = function(recMapping, recEvt, key) {
|
||||
class AnimatedEvent {
|
||||
_argMapping: Array<?Mapping>;
|
||||
_listener: ?Function;
|
||||
__isNative: bool;
|
||||
|
||||
constructor(
|
||||
argMapping: Array<?Mapping>,
|
||||
config?: EventConfig = {}
|
||||
) {
|
||||
this._argMapping = argMapping;
|
||||
this._listener = config.listener;
|
||||
this.__isNative = config.useNativeDriver || false;
|
||||
|
||||
if (this.__isNative) {
|
||||
invariant(!this._listener, 'Listener is not supported for native driven events.');
|
||||
}
|
||||
|
||||
if (__DEV__) {
|
||||
this._validateMapping();
|
||||
}
|
||||
}
|
||||
|
||||
__attach(viewRef, eventName) {
|
||||
invariant(this.__isNative, 'Only native driven events need to be attached.');
|
||||
|
||||
// Find animated values in `argMapping` and create an array representing their
|
||||
// key path inside the `nativeEvent` object. Ex.: ['contentOffset', 'x'].
|
||||
const eventMappings = [];
|
||||
|
||||
const traverse = (value, path) => {
|
||||
if (value instanceof AnimatedValue) {
|
||||
value.__makeNative();
|
||||
|
||||
eventMappings.push({
|
||||
nativeEventPath: path,
|
||||
animatedValueTag: value.__getNativeTag(),
|
||||
});
|
||||
} else if (typeof value === 'object') {
|
||||
for (const key in value) {
|
||||
traverse(value[key], path.concat(key));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
invariant(
|
||||
this._argMapping[0] && this._argMapping[0].nativeEvent,
|
||||
'Native driven events only support animated values contained inside `nativeEvent`.'
|
||||
);
|
||||
|
||||
// Assume that the event containing `nativeEvent` is always the first argument.
|
||||
traverse(this._argMapping[0].nativeEvent, []);
|
||||
|
||||
const viewTag = findNodeHandle(viewRef);
|
||||
|
||||
eventMappings.forEach((mapping) => {
|
||||
NativeAnimatedAPI.addAnimatedEventToView(viewTag, eventName, mapping);
|
||||
});
|
||||
}
|
||||
|
||||
__detach(viewTag, eventName) {
|
||||
invariant(this.__isNative, 'Only native driven events need to be detached.');
|
||||
|
||||
NativeAnimatedAPI.removeAnimatedEventFromView(viewTag, eventName);
|
||||
}
|
||||
|
||||
__getHandler() {
|
||||
return (...args) => {
|
||||
const traverse = (recMapping, recEvt, key) => {
|
||||
if (typeof recEvt === 'number' && recMapping instanceof AnimatedValue) {
|
||||
recMapping.setValue(recEvt);
|
||||
} else if (typeof recMapping === 'object') {
|
||||
for (const mappingKey in recMapping) {
|
||||
traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (!this.__isNative) {
|
||||
this._argMapping.forEach((mapping, idx) => {
|
||||
traverse(mapping, args[idx], 'arg' + idx);
|
||||
});
|
||||
}
|
||||
|
||||
if (this._listener) {
|
||||
this._listener.apply(null, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_validateMapping() {
|
||||
const traverse = (recMapping, recEvt, key) => {
|
||||
if (typeof recEvt === 'number') {
|
||||
invariant(
|
||||
recMapping instanceof AnimatedValue,
|
||||
'Bad mapping of type ' + typeof recMapping + ' for key ' + key +
|
||||
', event value must map to AnimatedValue'
|
||||
);
|
||||
recMapping.setValue(recEvt);
|
||||
return;
|
||||
}
|
||||
invariant(
|
||||
@@ -2017,17 +2210,23 @@ var event = function(
|
||||
typeof recEvt === 'object',
|
||||
'Bad event of type ' + typeof recEvt + ' for key ' + key
|
||||
);
|
||||
for (var key in recMapping) {
|
||||
traverse(recMapping[key], recEvt[key], key);
|
||||
for (const mappingKey in recMapping) {
|
||||
traverse(recMapping[mappingKey], recEvt[mappingKey], mappingKey);
|
||||
}
|
||||
};
|
||||
argMapping.forEach((mapping, idx) => {
|
||||
traverse(mapping, args[idx], 'arg' + idx);
|
||||
});
|
||||
if (config && config.listener) {
|
||||
config.listener.apply(null, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var event = function(
|
||||
argMapping: Array<?Mapping>,
|
||||
config?: EventConfig,
|
||||
): any {
|
||||
const animatedEvent = new AnimatedEvent(argMapping, config);
|
||||
if (animatedEvent.__isNative) {
|
||||
return animatedEvent;
|
||||
} else {
|
||||
return animatedEvent.__getHandler();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2151,6 +2350,13 @@ module.exports = {
|
||||
* together.
|
||||
*/
|
||||
add,
|
||||
|
||||
/**
|
||||
* Creates a new Animated value composed by dividing the first Animated value
|
||||
* by the second Animated value.
|
||||
*/
|
||||
divide,
|
||||
|
||||
/**
|
||||
* Creates a new Animated value composed from two Animated values multiplied
|
||||
* together.
|
||||
|
||||
@@ -163,7 +163,7 @@ function colorToRgba(input: string): string {
|
||||
return input;
|
||||
}
|
||||
|
||||
int32Color = int32Color || 0; // $FlowIssue
|
||||
int32Color = int32Color || 0;
|
||||
|
||||
var r = (int32Color & 0xff000000) >>> 24;
|
||||
var g = (int32Color & 0x00ff0000) >>> 16;
|
||||
|
||||
@@ -21,6 +21,10 @@ let __nativeAnimationIdCount = 1; /* used for started animations */
|
||||
|
||||
type EndResult = {finished: bool};
|
||||
type EndCallback = (result: EndResult) => void;
|
||||
type EventMapping = {
|
||||
nativeEventPath: Array<string>;
|
||||
animatedValueTag: number;
|
||||
};
|
||||
|
||||
let nativeEventEmitter;
|
||||
|
||||
@@ -61,6 +65,14 @@ const API = {
|
||||
assertNativeAnimatedModule();
|
||||
NativeAnimatedModule.setAnimatedNodeValue(nodeTag, value);
|
||||
},
|
||||
setAnimatedNodeOffset: function(nodeTag: number, offset: number): void {
|
||||
assertNativeAnimatedModule();
|
||||
NativeAnimatedModule.setAnimatedNodeOffset(nodeTag, offset);
|
||||
},
|
||||
flattenAnimatedNodeOffset: function(nodeTag: number): void {
|
||||
assertNativeAnimatedModule();
|
||||
NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag);
|
||||
},
|
||||
connectAnimatedNodeToView: function(nodeTag: number, viewTag: number): void {
|
||||
assertNativeAnimatedModule();
|
||||
NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag);
|
||||
@@ -73,6 +85,14 @@ const API = {
|
||||
assertNativeAnimatedModule();
|
||||
NativeAnimatedModule.dropAnimatedNode(tag);
|
||||
},
|
||||
addAnimatedEventToView: function(viewTag: number, eventName: string, eventMapping: EventMapping) {
|
||||
assertNativeAnimatedModule();
|
||||
NativeAnimatedModule.addAnimatedEventToView(viewTag, eventName, eventMapping);
|
||||
},
|
||||
removeAnimatedEventFromView(viewTag: number, eventName: string) {
|
||||
assertNativeAnimatedModule();
|
||||
NativeAnimatedModule.removeAnimatedEventFromView(viewTag, eventName);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,9 +15,11 @@ var BatchedBridge = require('BatchedBridge');
|
||||
var BugReporting = require('BugReporting');
|
||||
var ReactNative = require('react/lib/ReactNative');
|
||||
|
||||
const infoLog = require('infoLog');
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
var renderApplication = require('renderApplication');
|
||||
const infoLog = require('infoLog');
|
||||
|
||||
const { HeadlessJsTaskSupport } = require('NativeModules');
|
||||
|
||||
if (__DEV__) {
|
||||
// In order to use Cmd+P to record/dump perf data, we need to make sure
|
||||
@@ -25,8 +27,12 @@ if (__DEV__) {
|
||||
require('RCTRenderingPerf');
|
||||
}
|
||||
|
||||
type Task = (taskData: any) => Promise<void>;
|
||||
type TaskProvider = () => Task;
|
||||
|
||||
var runnables = {};
|
||||
var runCount = 1;
|
||||
const tasks: Map<string, TaskProvider> = new Map();
|
||||
|
||||
type ComponentProvider = () => ReactClass<any>;
|
||||
|
||||
@@ -103,6 +109,40 @@ var AppRegistry = {
|
||||
ReactNative.unmountComponentAtNodeAndRemoveContainer(rootTag);
|
||||
},
|
||||
|
||||
/**
|
||||
* Register a headless task. A headless task is a bit of code that runs without a UI.
|
||||
* @param taskKey the key associated with this task
|
||||
* @param task a promise returning function that takes some data passed from the native side as
|
||||
* the only argument; when the promise is resolved or rejected the native side is
|
||||
* notified of this event and it may decide to destroy the JS context.
|
||||
*/
|
||||
registerHeadlessTask: function(taskKey: string, task: TaskProvider): void {
|
||||
if (tasks.has(taskKey)) {
|
||||
console.warn(`registerHeadlessTask called multiple times for same key '${taskKey}'`);
|
||||
}
|
||||
tasks.set(taskKey, task);
|
||||
},
|
||||
|
||||
/**
|
||||
* Only called from native code. Starts a headless task.
|
||||
*
|
||||
* @param taskId the native id for this task instance to keep track of its execution
|
||||
* @param taskKey the key for the task to start
|
||||
* @param data the data to pass to the task
|
||||
*/
|
||||
startHeadlessTask: function(taskId: number, taskKey: string, data: any): void {
|
||||
const taskProvider = tasks.get(taskKey);
|
||||
if (!taskProvider) {
|
||||
throw new Error(`No task registered for key ${taskKey}`);
|
||||
}
|
||||
taskProvider()(data)
|
||||
.then(() => HeadlessJsTaskSupport.notifyTaskFinished(taskId))
|
||||
.catch(reason => {
|
||||
console.error(reason);
|
||||
HeadlessJsTaskSupport.notifyTaskFinished(taskId);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
BatchedBridge.registerCallableModule(
|
||||
|
||||
@@ -7,25 +7,16 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule BatchedBridge
|
||||
* @flow
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const MessageQueue = require('MessageQueue');
|
||||
|
||||
const serializeNativeParams = typeof global.__fbBatchedBridgeSerializeNativeParams !== 'undefined';
|
||||
|
||||
const BatchedBridge = new MessageQueue(
|
||||
() => global.__fbBatchedBridgeConfig,
|
||||
serializeNativeParams
|
||||
);
|
||||
const BatchedBridge = new MessageQueue();
|
||||
|
||||
// TODO: Move these around to solve the cycle in a cleaner way.
|
||||
|
||||
const Systrace = require('Systrace');
|
||||
const JSTimersExecution = require('JSTimersExecution');
|
||||
|
||||
BatchedBridge.registerCallableModule('Systrace', Systrace);
|
||||
BatchedBridge.registerCallableModule('JSTimersExecution', JSTimersExecution);
|
||||
BatchedBridge.registerCallableModule('Systrace', require('Systrace'));
|
||||
BatchedBridge.registerCallableModule('JSTimersExecution', require('JSTimersExecution'));
|
||||
BatchedBridge.registerCallableModule('HeapCapture', require('HeapCapture'));
|
||||
BatchedBridge.registerCallableModule('SamplingProfiler', require('SamplingProfiler'));
|
||||
|
||||
|
||||
@@ -12,53 +12,130 @@
|
||||
'use strict';
|
||||
|
||||
const BatchedBridge = require('BatchedBridge');
|
||||
const RemoteModules = BatchedBridge.RemoteModules;
|
||||
|
||||
function normalizePrefix(moduleName: string): string {
|
||||
return moduleName.replace(/^(RCT|RK)/, '');
|
||||
const defineLazyObjectProperty = require('defineLazyObjectProperty');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
|
||||
type ModuleConfig = [
|
||||
string, /* name */
|
||||
?Object, /* constants */
|
||||
Array<string>, /* functions */
|
||||
Array<number>, /* promise method IDs */
|
||||
Array<number>, /* sync method IDs */
|
||||
];
|
||||
|
||||
export type MethodType = 'async' | 'promise' | 'sync';
|
||||
|
||||
function genModule(config: ?ModuleConfig, moduleID: number): ?{name: string, module?: Object} {
|
||||
if (!config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const [moduleName, constants, methods, promiseMethods, syncMethods] = config;
|
||||
invariant(!moduleName.startsWith('RCT') && !moduleName.startsWith('RK'),
|
||||
'Module name prefixes should\'ve been stripped by the native side ' +
|
||||
'but wasn\'t for ' + moduleName);
|
||||
|
||||
if (!constants && !methods) {
|
||||
// Module contents will be filled in lazily later
|
||||
return { name: moduleName };
|
||||
}
|
||||
|
||||
const module = {};
|
||||
methods && methods.forEach((methodName, methodID) => {
|
||||
const isPromise = promiseMethods && arrayContains(promiseMethods, methodID);
|
||||
const isSync = syncMethods && arrayContains(syncMethods, methodID);
|
||||
invariant(!isPromise || !isSync, 'Cannot have a method that is both async and a sync hook');
|
||||
const methodType = isPromise ? 'promise' : isSync ? 'sync' : 'async';
|
||||
module[methodName] = genMethod(moduleID, methodID, methodType);
|
||||
});
|
||||
Object.assign(module, constants);
|
||||
|
||||
if (__DEV__) {
|
||||
BatchedBridge.createDebugLookup(moduleID, moduleName, methods);
|
||||
}
|
||||
|
||||
return { name: moduleName, module };
|
||||
}
|
||||
|
||||
/**
|
||||
* Dirty hack to support old (RK) and new (RCT) native module name conventions.
|
||||
* TODO 10487027: kill this behaviour
|
||||
*/
|
||||
Object.keys(RemoteModules).forEach((moduleName) => {
|
||||
const strippedName = normalizePrefix(moduleName);
|
||||
if (RemoteModules['RCT' + strippedName] && RemoteModules['RK' + strippedName]) {
|
||||
throw new Error(
|
||||
'Module cannot be registered as both RCT and RK: ' + moduleName
|
||||
);
|
||||
}
|
||||
if (strippedName !== moduleName) {
|
||||
RemoteModules[strippedName] = RemoteModules[moduleName];
|
||||
delete RemoteModules[moduleName];
|
||||
}
|
||||
});
|
||||
function loadModule(name: string, moduleID: number): ?Object {
|
||||
invariant(global.nativeRequireModuleConfig,
|
||||
'Can\'t lazily create module without nativeRequireModuleConfig');
|
||||
const config = global.nativeRequireModuleConfig(name);
|
||||
const info = genModule(config, moduleID);
|
||||
return info && info.module;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define lazy getters for each module.
|
||||
* These will return the module if already loaded, or load it if not.
|
||||
*/
|
||||
const NativeModules = {};
|
||||
Object.keys(RemoteModules).forEach((moduleName) => {
|
||||
Object.defineProperty(NativeModules, moduleName, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: () => {
|
||||
let module = RemoteModules[moduleName];
|
||||
if (module && typeof module.moduleID === 'number' && global.nativeRequireModuleConfig) {
|
||||
const config = global.nativeRequireModuleConfig(moduleName);
|
||||
module = config && BatchedBridge.processModuleConfig(config, module.moduleID);
|
||||
RemoteModules[moduleName] = module;
|
||||
}
|
||||
Object.defineProperty(NativeModules, moduleName, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: module,
|
||||
function genMethod(moduleID: number, methodID: number, type: MethodType) {
|
||||
let fn = null;
|
||||
if (type === 'promise') {
|
||||
fn = function(...args: Array<any>) {
|
||||
return new Promise((resolve, reject) => {
|
||||
BatchedBridge.enqueueNativeCall(moduleID, methodID, args,
|
||||
(data) => resolve(data),
|
||||
(errorData) => reject(createErrorFromErrorData(errorData)));
|
||||
});
|
||||
return module;
|
||||
},
|
||||
});
|
||||
};
|
||||
} else if (type === 'sync') {
|
||||
fn = function(...args: Array<any>) {
|
||||
return global.nativeCallSyncHook(moduleID, methodID, args);
|
||||
};
|
||||
} else {
|
||||
fn = function(...args: Array<any>) {
|
||||
const lastArg = args.length > 0 ? args[args.length - 1] : null;
|
||||
const secondLastArg = args.length > 1 ? args[args.length - 2] : null;
|
||||
const hasSuccessCallback = typeof lastArg === 'function';
|
||||
const hasErrorCallback = typeof secondLastArg === 'function';
|
||||
hasErrorCallback && invariant(
|
||||
hasSuccessCallback,
|
||||
'Cannot have a non-function arg after a function arg.'
|
||||
);
|
||||
const onSuccess = hasSuccessCallback ? lastArg : null;
|
||||
const onFail = hasErrorCallback ? secondLastArg : null;
|
||||
const callbackCount = hasSuccessCallback + hasErrorCallback;
|
||||
args = args.slice(0, args.length - callbackCount);
|
||||
BatchedBridge.enqueueNativeCall(moduleID, methodID, args, onFail, onSuccess);
|
||||
};
|
||||
}
|
||||
fn.type = type;
|
||||
return fn;
|
||||
}
|
||||
|
||||
function arrayContains<T>(array: Array<T>, value: T): boolean {
|
||||
return array.indexOf(value) !== -1;
|
||||
}
|
||||
|
||||
function createErrorFromErrorData(errorData: {message: string}): Error {
|
||||
const {
|
||||
message,
|
||||
...extraErrorInfo
|
||||
} = errorData;
|
||||
const error = new Error(message);
|
||||
(error:any).framesToPop = 1;
|
||||
return Object.assign(error, extraErrorInfo);
|
||||
}
|
||||
|
||||
const bridgeConfig = global.__fbBatchedBridgeConfig;
|
||||
invariant(bridgeConfig, '__fbBatchedBridgeConfig is not set, cannot invoke native modules');
|
||||
|
||||
const NativeModules : {[moduleName: string]: Object} = {};
|
||||
(bridgeConfig.remoteModuleConfig || []).forEach((config: ModuleConfig, moduleID: number) => {
|
||||
// Initially this config will only contain the module name when running in JSC. The actual
|
||||
// configuration of the module will be lazily loaded.
|
||||
const info = genModule(config, moduleID);
|
||||
if (!info) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.module) {
|
||||
NativeModules[info.name] = info.module;
|
||||
}
|
||||
// If there's no module config, define a lazy getter
|
||||
else {
|
||||
defineLazyObjectProperty(NativeModules, info.name, {
|
||||
get: () => loadModule(info.name, moduleID)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = NativeModules;
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@
|
||||
*/
|
||||
'use strict';
|
||||
var remoteModulesConfig = [
|
||||
['RemoteModule1',['remoteMethod1','remoteMethod2'],[],[]],
|
||||
['RemoteModule2',['remoteMethod1','remoteMethod2'],[],[]],
|
||||
['RemoteModule1',null,['remoteMethod','promiseMethod'],[]],
|
||||
['RemoteModule2',null,['remoteMethod','promiseMethod'],[]],
|
||||
];
|
||||
|
||||
var MessageQueueTestConfig = {
|
||||
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
jest.unmock('BatchedBridge');
|
||||
jest.unmock('defineLazyObjectProperty');
|
||||
jest.unmock('MessageQueue');
|
||||
jest.unmock('NativeModules');
|
||||
|
||||
let BatchedBridge;
|
||||
let NativeModules;
|
||||
|
||||
const MODULE_IDS = 0;
|
||||
const METHOD_IDS = 1;
|
||||
const PARAMS = 2;
|
||||
const CALL_ID = 3;
|
||||
|
||||
const assertQueue = (flushedQueue, index, moduleID, methodID, params) => {
|
||||
expect(flushedQueue[MODULE_IDS][index]).toEqual(moduleID);
|
||||
expect(flushedQueue[METHOD_IDS][index]).toEqual(methodID);
|
||||
expect(flushedQueue[PARAMS][index]).toEqual(params);
|
||||
};
|
||||
|
||||
// Important things to test:
|
||||
//
|
||||
// [x] Calling remote method actually queues it up on the BatchedBridge
|
||||
//
|
||||
// [x] Both error and success callbacks are invoked.
|
||||
//
|
||||
// [x] When simulating an error callback from remote method, both error and
|
||||
// success callbacks are cleaned up.
|
||||
//
|
||||
// [ ] Remote invocation throws if not supplying an error callback.
|
||||
describe('MessageQueue', function() {
|
||||
beforeEach(function() {
|
||||
jest.resetModuleRegistry();
|
||||
|
||||
global.__fbBatchedBridgeConfig = require('MessageQueueTestConfig');
|
||||
BatchedBridge = require('BatchedBridge');
|
||||
NativeModules = require('NativeModules');
|
||||
});
|
||||
|
||||
it('should generate native modules', () => {
|
||||
NativeModules.RemoteModule1.remoteMethod('foo');
|
||||
const flushedQueue = BatchedBridge.flushedQueue();
|
||||
assertQueue(flushedQueue, 0, 0, 0, ['foo']);
|
||||
});
|
||||
|
||||
it('should make round trip and clear memory', function() {
|
||||
const onFail = jasmine.createSpy();
|
||||
const onSucc = jasmine.createSpy();
|
||||
|
||||
// Perform communication
|
||||
NativeModules.RemoteModule1.promiseMethod('paloAlto', 'menloPark', onFail, onSucc);
|
||||
NativeModules.RemoteModule2.promiseMethod('mac', 'windows', onFail, onSucc);
|
||||
|
||||
const resultingRemoteInvocations = BatchedBridge.flushedQueue();
|
||||
|
||||
// As always, the message queue has four fields
|
||||
expect(resultingRemoteInvocations.length).toBe(4);
|
||||
expect(resultingRemoteInvocations[MODULE_IDS].length).toBe(2);
|
||||
expect(resultingRemoteInvocations[METHOD_IDS].length).toBe(2);
|
||||
expect(resultingRemoteInvocations[PARAMS].length).toBe(2);
|
||||
expect(typeof resultingRemoteInvocations[CALL_ID]).toEqual('number');
|
||||
|
||||
expect(resultingRemoteInvocations[0][0]).toBe(0); // `RemoteModule1`
|
||||
expect(resultingRemoteInvocations[1][0]).toBe(1); // `promiseMethod`
|
||||
expect([ // the arguments
|
||||
resultingRemoteInvocations[2][0][0],
|
||||
resultingRemoteInvocations[2][0][1]
|
||||
]).toEqual(['paloAlto', 'menloPark']);
|
||||
// Callbacks ids are tacked onto the end of the remote arguments.
|
||||
const firstFailCBID = resultingRemoteInvocations[2][0][2];
|
||||
const firstSuccCBID = resultingRemoteInvocations[2][0][3];
|
||||
|
||||
expect(resultingRemoteInvocations[0][1]).toBe(1); // `RemoteModule2`
|
||||
expect(resultingRemoteInvocations[1][1]).toBe(1); // `promiseMethod`
|
||||
expect([ // the arguments
|
||||
resultingRemoteInvocations[2][1][0],
|
||||
resultingRemoteInvocations[2][1][1]
|
||||
]).toEqual(['mac', 'windows']);
|
||||
const secondFailCBID = resultingRemoteInvocations[2][1][2];
|
||||
const secondSuccCBID = resultingRemoteInvocations[2][1][3];
|
||||
|
||||
// Handle the first remote invocation by signaling failure.
|
||||
BatchedBridge.__invokeCallback(firstFailCBID, ['firstFailure']);
|
||||
// The failure callback was already invoked, the success is no longer valid
|
||||
expect(function() {
|
||||
BatchedBridge.__invokeCallback(firstSuccCBID, ['firstSucc']);
|
||||
}).toThrow();
|
||||
expect(onFail.calls.count()).toBe(1);
|
||||
expect(onSucc.calls.count()).toBe(0);
|
||||
|
||||
// Handle the second remote invocation by signaling success.
|
||||
BatchedBridge.__invokeCallback(secondSuccCBID, ['secondSucc']);
|
||||
// The success callback was already invoked, the fail cb is no longer valid
|
||||
expect(function() {
|
||||
BatchedBridge.__invokeCallback(secondFailCBID, ['secondFail']);
|
||||
}).toThrow();
|
||||
expect(onFail.calls.count()).toBe(1);
|
||||
expect(onSucc.calls.count()).toBe(1);
|
||||
});
|
||||
});
|
||||
@@ -185,12 +185,14 @@ RCT_EXPORT_METHOD(getPhotos:(NSDictionary *)params
|
||||
CGSize dimensions = [result defaultRepresentation].dimensions;
|
||||
CLLocation *loc = [result valueForProperty:ALAssetPropertyLocation];
|
||||
NSDate *date = [result valueForProperty:ALAssetPropertyDate];
|
||||
NSString *filename = [result defaultRepresentation].filename;
|
||||
[assets addObject:@{
|
||||
@"node": @{
|
||||
@"type": [result valueForProperty:ALAssetPropertyType],
|
||||
@"group_name": [group valueForProperty:ALAssetsGroupPropertyName],
|
||||
@"image": @{
|
||||
@"uri": uri,
|
||||
@"filename" : filename,
|
||||
@"height": @(dimensions.height),
|
||||
@"width": @(dimensions.width),
|
||||
@"isStored": @YES,
|
||||
|
||||
@@ -36,6 +36,7 @@ RCT_EXPORT_MODULE()
|
||||
scale:(CGFloat)scale
|
||||
resizeMode:(RCTResizeMode)resizeMode
|
||||
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
|
||||
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
|
||||
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler
|
||||
{
|
||||
// Using PhotoKit for iOS 8+
|
||||
|
||||
@@ -11,7 +11,130 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
const NativeEventEmitter = require('NativeEventEmitter');
|
||||
const KeyboardObserver = require('NativeModules').KeyboardObserver;
|
||||
const dismissKeyboard = require('dismissKeyboard');
|
||||
const KeyboardEventEmitter = new NativeEventEmitter(KeyboardObserver);
|
||||
|
||||
type KeyboardEventName =
|
||||
| 'keyboardWillShow'
|
||||
| 'keyboardDidShow'
|
||||
| 'keyboardWillHide'
|
||||
| 'keyboardDidHide'
|
||||
| 'keyboardWillChangeFrame'
|
||||
| 'keyboardDidChangeFrame';
|
||||
|
||||
type KeyboardEventData = {
|
||||
endCoordinates: {
|
||||
width: number,
|
||||
height: number,
|
||||
screenX: number,
|
||||
screenY: number,
|
||||
},
|
||||
};
|
||||
|
||||
type KeyboardEventListener = (e: KeyboardEventData) => void;
|
||||
|
||||
// The following object exists for documentation purposes
|
||||
// Actual work happens in
|
||||
// https://github.com/facebook/react-native/blob/master/Libraries/EventEmitter/NativeEventEmitter.js
|
||||
|
||||
/**
|
||||
* `Keyboard` module to control keyboard events.
|
||||
*
|
||||
* ### Usage
|
||||
*
|
||||
* The Keyboard module allows you to listen for native events and react to them, as
|
||||
* well as make changes to the keyboard, like dismissing it.
|
||||
*
|
||||
*```
|
||||
* import React, { Component } from 'react';
|
||||
* import { Keyboard, TextInput } from 'react-native';
|
||||
*
|
||||
* class Example extends Component {
|
||||
* componentWillMount () {
|
||||
* this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
|
||||
* this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
|
||||
* }
|
||||
*
|
||||
* componentWillUnmount () {
|
||||
* this.keyboardDidShowListener.remove();
|
||||
* this.keyboardDidHideListener.remove();
|
||||
* }
|
||||
*
|
||||
* _keyboardDidShow () {
|
||||
* alert('Keyboard Shown');
|
||||
* }
|
||||
*
|
||||
* _keyboardDidHide () {
|
||||
* alert('Keyboard Hidden');
|
||||
* }
|
||||
*
|
||||
* render() {
|
||||
* return (
|
||||
* <TextInput
|
||||
* onSubmitEditing={Keyboard.dismiss}
|
||||
* />
|
||||
* );
|
||||
* }
|
||||
* }
|
||||
*```
|
||||
*/
|
||||
|
||||
let Keyboard = {
|
||||
/**
|
||||
* The `addListener` function connects a JavaScript function to an identified native
|
||||
* keyboard notification event.
|
||||
*
|
||||
* This function then returns the reference to the listener.
|
||||
*
|
||||
* @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for. This
|
||||
*can be any of the following:
|
||||
*
|
||||
* - `keyboardWillShow`
|
||||
* - `keyboardDidShow`
|
||||
* - `keyboardWillHide`
|
||||
* - `keyboardDidHide`
|
||||
* - `keyboardWillChangeFrame`
|
||||
* - `keyboardDidChangeFrame`
|
||||
*
|
||||
* @param {function} callback function to be called when the event fires.
|
||||
*/
|
||||
addListener(eventName: KeyboardEventName, callback: KeyboardEventListener) {
|
||||
invariant(false, 'Dummy method used for documentation');
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes a specific listener.
|
||||
*
|
||||
* @param {string} eventName The `nativeEvent` is the string that identifies the event you're listening for.
|
||||
* @param {function} callback function to be called when the event fires.
|
||||
*/
|
||||
removeListener(eventName: KeyboardEventName, callback: Function) {
|
||||
invariant(false, 'Dummy method used for documentation');
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all listeners for a specific event type.
|
||||
*
|
||||
* @param {string} eventType The native event string listeners are watching which will be removed.
|
||||
*/
|
||||
removeAllListeners(eventName: KeyboardEventName) {
|
||||
invariant(false, 'Dummy method used for documentation');
|
||||
},
|
||||
|
||||
/**
|
||||
* Dismisses the active keyboard and removes focus.
|
||||
*/
|
||||
dismiss() {
|
||||
invariant(false, 'Dummy method used for documentation');
|
||||
}
|
||||
};
|
||||
|
||||
// Throw away the dummy object and reassign it to original module
|
||||
Keyboard = KeyboardEventEmitter;
|
||||
Keyboard.dismiss = dismissKeyboard;
|
||||
|
||||
module.exports = Keyboard;
|
||||
|
||||
module.exports = new NativeEventEmitter(KeyboardObserver);
|
||||
|
||||
@@ -87,7 +87,7 @@ const KeyboardAvoidingView = React.createClass({
|
||||
|
||||
relativeKeyboardHeight(keyboardFrame: ScreenRect): number {
|
||||
const frame = this.frame;
|
||||
if (!frame) {
|
||||
if (!frame || !keyboardFrame) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
var React = require('React');
|
||||
var TimerMixin = require('TimerMixin');
|
||||
var TimerMixin = require('react-timer-mixin');
|
||||
|
||||
var LazyRenderer = React.createClass({
|
||||
mixin: [TimerMixin],
|
||||
|
||||
@@ -60,8 +60,8 @@ export type AnnotationDragState = $Enum<{
|
||||
* `MKMapView`.
|
||||
*
|
||||
* For a cross-platform solution, check out
|
||||
* [react-native-maps](https://github.com/lelandrichardson/react-native-maps)
|
||||
* by Leland Richardson.
|
||||
* [react-native-maps](https://github.com/airbnb/react-native-maps)
|
||||
* by Airbnb.
|
||||
*
|
||||
* ```
|
||||
* import React, { Component } from 'react';
|
||||
|
||||
@@ -45,7 +45,7 @@ var PickerIOS = React.createClass({
|
||||
_stateFromProps: function(props) {
|
||||
var selectedIndex = 0;
|
||||
var items = [];
|
||||
ReactChildren.forEach(props.children, function (child, index) {
|
||||
ReactChildren.toArray(props.children).forEach(function (child, index) {
|
||||
if (child.props.value === props.selectedValue) {
|
||||
selectedIndex = index;
|
||||
}
|
||||
|
||||
@@ -251,10 +251,12 @@ const ScrollView = React.createClass({
|
||||
scrollsToTop: PropTypes.bool,
|
||||
/**
|
||||
* When true, shows a horizontal scroll indicator.
|
||||
* The default value is true.
|
||||
*/
|
||||
showsHorizontalScrollIndicator: PropTypes.bool,
|
||||
/**
|
||||
* When true, shows a vertical scroll indicator.
|
||||
* The default value is true.
|
||||
*/
|
||||
showsVerticalScrollIndicator: PropTypes.bool,
|
||||
/**
|
||||
@@ -390,7 +392,7 @@ const ScrollView = React.createClass({
|
||||
|
||||
_handleScroll: function(e: Object) {
|
||||
if (__DEV__) {
|
||||
if (this.props.onScroll && !this.props.scrollEventThrottle && Platform.OS === 'ios') {
|
||||
if (this.props.onScroll && this.props.scrollEventThrottle == null && Platform.OS === 'ios') {
|
||||
console.log( // eslint-disable-line no-console-disallow
|
||||
'You specified `onScroll` on a <ScrollView> but not ' +
|
||||
'`scrollEventThrottle`. You will only receive one event. ' +
|
||||
@@ -529,7 +531,7 @@ const ScrollView = React.createClass({
|
||||
return React.cloneElement(
|
||||
refreshControl,
|
||||
{style: props.style},
|
||||
<ScrollViewClass {...props} style={baseStyle} ref={this._setScrollViewRef}>
|
||||
<ScrollViewClass {...props} ref={this._setScrollViewRef}>
|
||||
{contentContainer}
|
||||
</ScrollViewClass>
|
||||
);
|
||||
@@ -545,12 +547,16 @@ const ScrollView = React.createClass({
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
baseVertical: {
|
||||
flex: 1,
|
||||
flexGrow: 1,
|
||||
flexShrink: 1,
|
||||
flexDirection: 'column',
|
||||
overflow: 'scroll',
|
||||
},
|
||||
baseHorizontal: {
|
||||
flex: 1,
|
||||
flexGrow: 1,
|
||||
flexShrink: 1,
|
||||
flexDirection: 'row',
|
||||
overflow: 'scroll',
|
||||
},
|
||||
contentContainerHorizontal: {
|
||||
flexDirection: 'row',
|
||||
|
||||
@@ -24,13 +24,17 @@ const StatusBarManager = require('NativeModules').StatusBarManager;
|
||||
*/
|
||||
export type StatusBarStyle = $Enum<{
|
||||
/**
|
||||
* Default status bar style
|
||||
* Default status bar style (dark for iOS, light for Android)
|
||||
*/
|
||||
'default': string,
|
||||
/**
|
||||
* Dark background style
|
||||
* Dark background, white texts and icons
|
||||
*/
|
||||
'light-content': string,
|
||||
/**
|
||||
* Light background, dark texts and icons
|
||||
*/
|
||||
'dark-content': string,
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -134,7 +138,7 @@ class StatusBar extends React.Component {
|
||||
animated?: boolean,
|
||||
backgroundColor?: $FlowFixMe,
|
||||
translucent?: boolean,
|
||||
barStyle?: 'default' | 'light-content',
|
||||
barStyle?: 'default' | 'light-content' | 'dark-content',
|
||||
networkActivityIndicatorVisible?: boolean,
|
||||
showHideTransition?: 'fade' | 'slide',
|
||||
};
|
||||
@@ -191,13 +195,13 @@ class StatusBar extends React.Component {
|
||||
* @param animated Animate the style change.
|
||||
*/
|
||||
static setBarStyle(style: StatusBarStyle, animated?: boolean) {
|
||||
if (Platform.OS !== 'ios') {
|
||||
console.warn('`setBarStyle` is only available on iOS');
|
||||
return;
|
||||
}
|
||||
animated = animated || false;
|
||||
StatusBar._defaultProps.barStyle.value = style;
|
||||
StatusBarManager.setStyle(style, animated);
|
||||
if (Platform.OS === 'ios') {
|
||||
StatusBarManager.setStyle(style, animated);
|
||||
} else if (Platform.OS === 'android') {
|
||||
StatusBarManager.setStyle(style);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -272,6 +276,7 @@ class StatusBar extends React.Component {
|
||||
barStyle: React.PropTypes.oneOf([
|
||||
'default',
|
||||
'light-content',
|
||||
'dark-content',
|
||||
]),
|
||||
/**
|
||||
* If the network activity indicator should be visible.
|
||||
@@ -360,6 +365,9 @@ class StatusBar extends React.Component {
|
||||
);
|
||||
}
|
||||
} else if (Platform.OS === 'android') {
|
||||
if (!oldProps || oldProps.barStyle.value !== mergedProps.barStyle.value) {
|
||||
StatusBarManager.setStyle(mergedProps.barStyle.value);
|
||||
}
|
||||
if (!oldProps || oldProps.backgroundColor.value !== mergedProps.backgroundColor.value) {
|
||||
StatusBarManager.setColor(
|
||||
processColor(mergedProps.backgroundColor.value),
|
||||
|
||||
@@ -360,7 +360,7 @@ const TextInput = React.createClass({
|
||||
/**
|
||||
* The string that will be rendered before text input has been entered.
|
||||
*/
|
||||
placeholder: PropTypes.string,
|
||||
placeholder: PropTypes.node,
|
||||
/**
|
||||
* The text color of the placeholder string.
|
||||
*/
|
||||
@@ -413,7 +413,7 @@ const TextInput = React.createClass({
|
||||
* Useful for simple use-cases where you do not want to deal with listening
|
||||
* to events and updating the value prop to keep the controlled state in sync.
|
||||
*/
|
||||
defaultValue: PropTypes.string,
|
||||
defaultValue: PropTypes.node,
|
||||
/**
|
||||
* When the clear button should appear on the right side of the text view.
|
||||
* @platform ios
|
||||
|
||||
@@ -21,7 +21,13 @@ var RCTToastAndroid = require('NativeModules').ToastAndroid;
|
||||
* 2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG
|
||||
*
|
||||
* There is also a function `showWithGravity` to specify the layout gravity. May be
|
||||
* ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER
|
||||
* ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER.
|
||||
*
|
||||
* Basic usage:
|
||||
* ```javascript
|
||||
* ToastAndroid.show('A pikachu appeared nearby !', ToastAndroid.SHORT);
|
||||
* ToastAndroid.showWithGravity('All Your Base Are Belong To Us', ToastAndroid.SHORT, ToastAndroid.CENTER);
|
||||
* ```
|
||||
*/
|
||||
|
||||
var ToastAndroid = {
|
||||
|
||||
@@ -690,16 +690,9 @@ var TouchableMixin = {
|
||||
}
|
||||
|
||||
if (newIsHighlight && !curIsHighlight) {
|
||||
this._savePressInLocation(e);
|
||||
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
|
||||
} else if (!newIsHighlight && curIsHighlight && this.touchableHandleActivePressOut) {
|
||||
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
|
||||
this.pressOutDelayTimeout = setTimeout(() => {
|
||||
this.touchableHandleActivePressOut(e);
|
||||
}, this.touchableGetPressOutDelayMS());
|
||||
} else {
|
||||
this.touchableHandleActivePressOut(e);
|
||||
}
|
||||
this._startHighlight(e);
|
||||
} else if (!newIsHighlight && curIsHighlight) {
|
||||
this._endHighlight(e);
|
||||
}
|
||||
|
||||
if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) {
|
||||
@@ -712,13 +705,35 @@ var TouchableMixin = {
|
||||
|
||||
var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress;
|
||||
if (shouldInvokePress && this.touchableHandlePress) {
|
||||
if (!newIsHighlight && !curIsHighlight) {
|
||||
// we never highlighted because of delay, but we should highlight now
|
||||
this._startHighlight(e);
|
||||
this._endHighlight(e);
|
||||
}
|
||||
this.touchableHandlePress(e);
|
||||
}
|
||||
}
|
||||
|
||||
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
|
||||
this.touchableDelayTimeout = null;
|
||||
}
|
||||
},
|
||||
|
||||
_startHighlight: function(e) {
|
||||
this._savePressInLocation(e);
|
||||
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
|
||||
},
|
||||
|
||||
_endHighlight: function(e) {
|
||||
if (this.touchableHandleActivePressOut) {
|
||||
if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) {
|
||||
this.pressOutDelayTimeout = setTimeout(() => {
|
||||
this.touchableHandleActivePressOut(e);
|
||||
}, this.touchableGetPressOutDelayMS());
|
||||
} else {
|
||||
this.touchableHandleActivePressOut(e);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ var onlyChild = require('react/lib/onlyChild');
|
||||
type Event = Object;
|
||||
|
||||
var DEFAULT_PROPS = {
|
||||
activeOpacity: 0.8,
|
||||
activeOpacity: 0.85,
|
||||
underlayColor: 'black',
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@ var PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
|
||||
* );
|
||||
* },
|
||||
* ```
|
||||
* > **NOTE**: TouchableHighlight supports only one child
|
||||
* > **NOTE**: TouchableHighlight must have one child (not zero or more than one)
|
||||
* >
|
||||
* > If you wish to have several child components, wrap them in a View.
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var Platform = require('Platform');
|
||||
var PropTypes = require('react/lib/ReactPropTypes');
|
||||
var React = require('React');
|
||||
var ReactNative = require('react/lib/ReactNative');
|
||||
@@ -41,6 +42,7 @@ var backgroundPropType = PropTypes.oneOfType([
|
||||
var TouchableView = requireNativeComponent('RCTView', null, {
|
||||
nativeOnly: {
|
||||
nativeBackgroundAndroid: backgroundPropType,
|
||||
nativeForegroundAndroid: backgroundPropType,
|
||||
}
|
||||
});
|
||||
|
||||
@@ -86,6 +88,17 @@ var TouchableNativeFeedback = React.createClass({
|
||||
* methods to generate that dictionary.
|
||||
*/
|
||||
background: backgroundPropType,
|
||||
|
||||
/**
|
||||
* Set to true to add the ripple effect to the foreground of the view, instead of the
|
||||
* background. This is useful if one of your child views has a background of its own, or you're
|
||||
* e.g. displaying images, and you don't want the ripple to be covered by them.
|
||||
*
|
||||
* Check TouchableNativeFeedback.canUseNativeForeground() first, as this is only available on
|
||||
* Android 6.0 and above. If you try to use this on older versions you will get a warning and
|
||||
* fallback to background.
|
||||
*/
|
||||
useForeground: PropTypes.bool,
|
||||
},
|
||||
|
||||
statics: {
|
||||
@@ -117,6 +130,10 @@ var TouchableNativeFeedback = React.createClass({
|
||||
Ripple: function(color: string, borderless: boolean) {
|
||||
return {type: 'RippleAndroid', color: processColor(color), borderless: borderless};
|
||||
},
|
||||
|
||||
canUseNativeForeground: function() {
|
||||
return Platform.OS === 'android' && Platform.Version >= 23;
|
||||
}
|
||||
},
|
||||
|
||||
mixins: [Touchable.Mixin],
|
||||
@@ -213,9 +230,19 @@ var TouchableNativeFeedback = React.createClass({
|
||||
}
|
||||
children.push(Touchable.renderDebugView({color: 'brown', hitSlop: this.props.hitSlop}));
|
||||
}
|
||||
if (this.props.useForeground && !TouchableNativeFeedback.canUseNativeForeground()) {
|
||||
console.warn(
|
||||
'Requested foreground ripple, but it is not available on this version of Android. ' +
|
||||
'Consider calling TouchableNativeFeedback.canUseNativeForeground() and using a different ' +
|
||||
'Touchable if the result is false.');
|
||||
}
|
||||
const drawableProp =
|
||||
this.props.useForeground && TouchableNativeFeedback.canUseNativeForeground()
|
||||
? 'nativeForegroundAndroid'
|
||||
: 'nativeBackgroundAndroid';
|
||||
var childProps = {
|
||||
...child.props,
|
||||
nativeBackgroundAndroid: this.props.background,
|
||||
[drawableProp]: this.props.background,
|
||||
accessible: this.props.accessible !== false,
|
||||
accessibilityLabel: this.props.accessibilityLabel,
|
||||
accessibilityComponentType: this.props.accessibilityComponentType,
|
||||
|
||||
@@ -97,7 +97,7 @@ const statics = {
|
||||
*
|
||||
* ### Synthetic Touch Events
|
||||
*
|
||||
* For `View` repsonder props (e.g., `onResponderMove`), the synthetic touch event passed to them
|
||||
* For `View` responder props (e.g., `onResponderMove`), the synthetic touch event passed to them
|
||||
* are of the following form:
|
||||
*
|
||||
* - `nativeEvent`
|
||||
@@ -143,7 +143,7 @@ const View = React.createClass({
|
||||
* with the element. By default, the label is constructed by traversing all the
|
||||
* children and accumulating all the `Text` nodes separated by space.
|
||||
*/
|
||||
accessibilityLabel: PropTypes.string,
|
||||
accessibilityLabel: PropTypes.node,
|
||||
|
||||
/**
|
||||
* Indicates to accessibility services to treat UI component like a
|
||||
@@ -509,6 +509,7 @@ const View = React.createClass({
|
||||
const RCTView = requireNativeComponent('RCTView', View, {
|
||||
nativeOnly: {
|
||||
nativeBackgroundAndroid: true,
|
||||
nativeForegroundAndroid: true,
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ var ViewStylePropTypes = {
|
||||
borderBottomWidth: ReactPropTypes.number,
|
||||
borderLeftWidth: ReactPropTypes.number,
|
||||
opacity: ReactPropTypes.number,
|
||||
overflow: ReactPropTypes.oneOf(['visible', 'hidden']),
|
||||
/**
|
||||
* (Android-only) Sets the elevation of a view, using Android's underlying
|
||||
* [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).
|
||||
|
||||
@@ -141,7 +141,7 @@ class ViewPagerAndroid extends React.Component {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
if (this.props.initialPage) {
|
||||
if (this.props.initialPage != null) {
|
||||
this.setPageWithoutAnimation(this.props.initialPage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ var ListView = React.createClass({
|
||||
|
||||
var {
|
||||
renderScrollComponent,
|
||||
...props,
|
||||
...props
|
||||
} = this.props;
|
||||
if (!props.scrollEventThrottle) {
|
||||
props.scrollEventThrottle = DEFAULT_SCROLL_CALLBACK_THROTTLE;
|
||||
|
||||
@@ -82,7 +82,7 @@ class NavigationCard extends React.Component<any, Props, any> {
|
||||
pointerEvents,
|
||||
renderScene,
|
||||
style,
|
||||
...props, /* NavigationSceneRendererProps */
|
||||
...props /* NavigationSceneRendererProps */
|
||||
} = this.props;
|
||||
|
||||
const viewStyle = style === undefined ?
|
||||
|
||||
@@ -297,7 +297,7 @@ var Navigator = React.createClass({
|
||||
* (route, routeStack) => Navigator.SceneConfigs.FloatFromRight
|
||||
* ```
|
||||
*
|
||||
* Available scene configutation options are:
|
||||
* Available scene configuration options are:
|
||||
*
|
||||
* - Navigator.SceneConfigs.PushFromRight (default)
|
||||
* - Navigator.SceneConfigs.FloatFromRight
|
||||
@@ -484,6 +484,7 @@ var Navigator = React.createClass({
|
||||
*/
|
||||
immediatelyResetRouteStack: function(nextRouteStack) {
|
||||
var destIndex = nextRouteStack.length - 1;
|
||||
this._emitWillFocus(nextRouteStack[destIndex]);
|
||||
this.setState({
|
||||
routeStack: nextRouteStack,
|
||||
sceneConfigStack: nextRouteStack.map(
|
||||
@@ -1248,7 +1249,7 @@ var Navigator = React.createClass({
|
||||
key={'scene_' + getRouteID(route)}
|
||||
ref={'scene_' + i}
|
||||
onStartShouldSetResponderCapture={() => {
|
||||
return (this.state.transitionFromIndex != null) || (this.state.transitionFromIndex != null);
|
||||
return (this.state.transitionFromIndex != null);
|
||||
}}
|
||||
pointerEvents={disabledScenePointerEvents}
|
||||
style={[styles.baseScene, this.props.sceneStyle, disabledSceneStyle]}>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
/**
|
||||
* Copyright (c) 2015, Facebook, Inc. All rights reserved.
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* Facebook, Inc. ("Facebook") owns all right, title and interest, including
|
||||
* all intellectual property and other proprietary rights, in and to the React
|
||||
@@ -26,35 +31,35 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var NavigatorBreadcrumbNavigationBarStyles = require('NavigatorBreadcrumbNavigationBarStyles');
|
||||
var NavigatorNavigationBarStylesAndroid = require('NavigatorNavigationBarStylesAndroid');
|
||||
var NavigatorNavigationBarStylesIOS = require('NavigatorNavigationBarStylesIOS');
|
||||
var Platform = require('Platform');
|
||||
var React = require('React');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var View = require('View');
|
||||
const NavigatorBreadcrumbNavigationBarStyles = require('NavigatorBreadcrumbNavigationBarStyles');
|
||||
const NavigatorNavigationBarStylesAndroid = require('NavigatorNavigationBarStylesAndroid');
|
||||
const NavigatorNavigationBarStylesIOS = require('NavigatorNavigationBarStylesIOS');
|
||||
const Platform = require('Platform');
|
||||
const React = require('React');
|
||||
const StyleSheet = require('StyleSheet');
|
||||
const View = require('View');
|
||||
|
||||
var { Map } = require('immutable');
|
||||
const guid = require('guid');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
|
||||
var guid = require('guid');
|
||||
var invariant = require('fbjs/lib/invariant');
|
||||
const { Map } = require('immutable');
|
||||
|
||||
var Interpolators = NavigatorBreadcrumbNavigationBarStyles.Interpolators;
|
||||
var NavigatorNavigationBarStyles = Platform.OS === 'android' ?
|
||||
const Interpolators = NavigatorBreadcrumbNavigationBarStyles.Interpolators;
|
||||
const NavigatorNavigationBarStyles = Platform.OS === 'android' ?
|
||||
NavigatorNavigationBarStylesAndroid : NavigatorNavigationBarStylesIOS;
|
||||
var PropTypes = React.PropTypes;
|
||||
const PropTypes = React.PropTypes;
|
||||
|
||||
/**
|
||||
* Reusable props objects.
|
||||
*/
|
||||
var CRUMB_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
var ICON_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
var SEPARATOR_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
var TITLE_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
var RIGHT_BUTTON_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
const CRUMB_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
const ICON_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
const SEPARATOR_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
const TITLE_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
const RIGHT_BUTTON_PROPS = Interpolators.map(() => ({style: {}}));
|
||||
|
||||
|
||||
var navStatePresentedIndex = function(navState) {
|
||||
function navStatePresentedIndex(navState) {
|
||||
if (navState.presentedIndex !== undefined) {
|
||||
return navState.presentedIndex;
|
||||
}
|
||||
@@ -70,7 +75,7 @@ var navStatePresentedIndex = function(navState) {
|
||||
* @param {number} index Index of breadcrumb.
|
||||
* @return {object} Style config for initial rendering of index.
|
||||
*/
|
||||
var initStyle = function(index, presentedIndex) {
|
||||
function initStyle(index, presentedIndex) {
|
||||
return index === presentedIndex ? NavigatorBreadcrumbNavigationBarStyles.Center[index] :
|
||||
index < presentedIndex ? NavigatorBreadcrumbNavigationBarStyles.Left[index] :
|
||||
NavigatorBreadcrumbNavigationBarStyles.Right[index];
|
||||
@@ -99,7 +104,7 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
|
||||
|
||||
static Styles = NavigatorBreadcrumbNavigationBarStyles;
|
||||
|
||||
_updateIndexProgress = (progress, index, fromIndex, toIndex) => {
|
||||
_updateIndexProgress(progress, index, fromIndex, toIndex) {
|
||||
var amount = toIndex > fromIndex ? progress : (1 - progress);
|
||||
var oldDistToCenter = index - fromIndex;
|
||||
var newDistToCenter = index - toIndex;
|
||||
@@ -141,32 +146,32 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
|
||||
pointerEvents: rightButtonStyle.opacity === 0 ? 'none' : 'auto',
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
updateProgress = (progress, fromIndex, toIndex) => {
|
||||
updateProgress(progress, fromIndex, toIndex) {
|
||||
var max = Math.max(fromIndex, toIndex);
|
||||
var min = Math.min(fromIndex, toIndex);
|
||||
for (var index = min; index <= max; index++) {
|
||||
this._updateIndexProgress(progress, index, fromIndex, toIndex);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
onAnimationStart = (fromIndex, toIndex) => {
|
||||
onAnimationStart(fromIndex, toIndex) {
|
||||
var max = Math.max(fromIndex, toIndex);
|
||||
var min = Math.min(fromIndex, toIndex);
|
||||
for (var index = min; index <= max; index++) {
|
||||
this._setRenderViewsToHardwareTextureAndroid(index, true);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
onAnimationEnd = () => {
|
||||
onAnimationEnd() {
|
||||
var max = this.props.navState.routeStack.length - 1;
|
||||
for (var index = 0; index <= max; index++) {
|
||||
this._setRenderViewsToHardwareTextureAndroid(index, false);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_setRenderViewsToHardwareTextureAndroid = (index, renderToHardwareTexture) => {
|
||||
_setRenderViewsToHardwareTextureAndroid(index, renderToHardwareTexture) {
|
||||
var props = {
|
||||
renderToHardwareTextureAndroid: renderToHardwareTexture,
|
||||
};
|
||||
@@ -175,7 +180,7 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
|
||||
this._setPropsIfExists('separator_' + index, props);
|
||||
this._setPropsIfExists('title_' + index, props);
|
||||
this._setPropsIfExists('right_' + index, props);
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this._reset();
|
||||
@@ -186,6 +191,7 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
|
||||
var icons = navState && navState.routeStack.map(this._getBreadcrumb);
|
||||
var titles = navState.routeStack.map(this._getTitle);
|
||||
var buttons = navState.routeStack.map(this._getRightButton);
|
||||
|
||||
return (
|
||||
<View
|
||||
key={this._key}
|
||||
@@ -197,31 +203,37 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
|
||||
);
|
||||
}
|
||||
|
||||
immediatelyRefresh = () => {
|
||||
immediatelyRefresh() {
|
||||
this._reset();
|
||||
this.forceUpdate();
|
||||
};
|
||||
}
|
||||
|
||||
_reset = () => {
|
||||
_reset() {
|
||||
this._key = guid();
|
||||
this._descriptors = {
|
||||
crumb: new Map(),
|
||||
title: new Map(),
|
||||
right: new Map(),
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
_getBreadcrumb = (route, index) => {
|
||||
if (this._descriptors.crumb.has(route)) {
|
||||
return this._descriptors.crumb.get(route);
|
||||
}
|
||||
|
||||
var navBarRouteMapper = this.props.routeMapper;
|
||||
var firstStyles = initStyle(index, navStatePresentedIndex(this.props.navState));
|
||||
/**
|
||||
* To prevent the case where titles on an empty navigation stack covers the first icon and
|
||||
* becomes partially unpressable, we set the first breadcrumb to be unpressable by default, and
|
||||
* make it pressable when there are multiple items in the stack.
|
||||
*/
|
||||
const pointerEvents = (
|
||||
(this.props.navState.routeStack.length <= 1 && index === 0) ?
|
||||
'none' :
|
||||
'auto'
|
||||
);
|
||||
const navBarRouteMapper = this.props.routeMapper;
|
||||
const firstStyles = initStyle(index, navStatePresentedIndex(this.props.navState));
|
||||
|
||||
var breadcrumbDescriptor = (
|
||||
<View
|
||||
key={'crumb_' + index}
|
||||
pointerEvents={pointerEvents}
|
||||
ref={'crumb_' + index}
|
||||
style={firstStyles.Crumb}>
|
||||
<View ref={'icon_' + index} style={firstStyles.Icon}>
|
||||
@@ -233,7 +245,6 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
|
||||
</View>
|
||||
);
|
||||
|
||||
this._descriptors.crumb = this._descriptors.crumb.set(route, breadcrumbDescriptor);
|
||||
return breadcrumbDescriptor;
|
||||
};
|
||||
|
||||
@@ -285,13 +296,13 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
|
||||
return rightButtonDescriptor;
|
||||
};
|
||||
|
||||
_setPropsIfExists = (ref, props) => {
|
||||
_setPropsIfExists(ref, props) {
|
||||
var ref = this.refs[ref];
|
||||
ref && ref.setNativeProps(props);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var styles = StyleSheet.create({
|
||||
const styles = StyleSheet.create({
|
||||
breadCrumbContainer: {
|
||||
overflow: 'hidden',
|
||||
position: 'absolute',
|
||||
|
||||
@@ -600,6 +600,13 @@ var NavigatorSceneConfigs = {
|
||||
out: buildStyleInterpolator(directionMapping.ToTheStartIOS),
|
||||
},
|
||||
},
|
||||
PushFromLeft: {
|
||||
...BaseConfig,
|
||||
animationInterpolators: {
|
||||
into: buildStyleInterpolator(directionMapping.FromTheStart),
|
||||
out: buildStyleInterpolator(directionMapping.ToTheEndIOS),
|
||||
},
|
||||
},
|
||||
FloatFromRight: {
|
||||
...BaseConfig,
|
||||
// We will want to customize this soon
|
||||
|
||||
@@ -30,6 +30,19 @@ const SwipeableRow = require('SwipeableRow');
|
||||
|
||||
const {PropTypes} = React;
|
||||
|
||||
type Props = {
|
||||
bounceFirstRowOnMount: boolean,
|
||||
dataSource: SwipeableListViewDataSource,
|
||||
maxSwipeDistance: number,
|
||||
onScroll: ?Function,
|
||||
renderRow: Function,
|
||||
renderQuickActions: Function,
|
||||
};
|
||||
|
||||
type State = {
|
||||
dataSource: Object,
|
||||
};
|
||||
|
||||
/**
|
||||
* A container component that renders multiple SwipeableRow's in a ListView
|
||||
* implementation. This is designed to be a drop-in replacement for the
|
||||
@@ -49,20 +62,18 @@ const {PropTypes} = React;
|
||||
* - More to come
|
||||
*/
|
||||
class SwipeableListView extends React.Component {
|
||||
props: {
|
||||
bounceFirstRowOnMount: boolean,
|
||||
dataSource: SwipeableListViewDataSource,
|
||||
maxSwipeDistance: number,
|
||||
renderRow: Function,
|
||||
renderQuickActions: Function,
|
||||
};
|
||||
props: Props;
|
||||
state: State;
|
||||
|
||||
_listViewRef: ?ReactElement<any> = null;
|
||||
_shouldBounceFirstRowOnMount: boolean = false;
|
||||
|
||||
static getNewDataSource(): Object {
|
||||
return new SwipeableListViewDataSource({
|
||||
getRowData: (data, sectionID, rowID) => data[sectionID][rowID],
|
||||
getSectionHeaderData: (data, sectionID) => data[sectionID],
|
||||
sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
|
||||
rowHasChanged: (row1, row2) => row1 !== row2,
|
||||
sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -90,21 +101,17 @@ class SwipeableListView extends React.Component {
|
||||
renderQuickActions: () => null,
|
||||
};
|
||||
|
||||
state: Object = {
|
||||
dataSource: this.props.dataSource,
|
||||
};
|
||||
constructor(props: Props, context: any): void {
|
||||
super(props, context);
|
||||
|
||||
_listViewRef: ?ReactElement<any> = null;
|
||||
_shouldBounceFirstRowOnMount = false;
|
||||
|
||||
componentWillMount(): void {
|
||||
this._shouldBounceFirstRowOnMount = this.props.bounceFirstRowOnMount;
|
||||
this.state = {
|
||||
dataSource: this.props.dataSource,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: Object): void {
|
||||
if (
|
||||
this.state.dataSource.getDataSource() !== nextProps.dataSource.getDataSource()
|
||||
) {
|
||||
componentWillReceiveProps(nextProps: Props): void {
|
||||
if (this.state.dataSource.getDataSource() !== nextProps.dataSource.getDataSource()) {
|
||||
this.setState({
|
||||
dataSource: nextProps.dataSource,
|
||||
});
|
||||
@@ -119,34 +126,42 @@ class SwipeableListView extends React.Component {
|
||||
this._listViewRef = ref;
|
||||
}}
|
||||
dataSource={this.state.dataSource.getDataSource()}
|
||||
onScroll={this._onScroll}
|
||||
renderRow={this._renderRow}
|
||||
scrollEnabled={this.state.scrollEnabled}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
_onScroll = (e): void => {
|
||||
// Close any opens rows on ListView scroll
|
||||
if (this.props.dataSource.getOpenRowID()) {
|
||||
this.setState({
|
||||
dataSource: this.state.dataSource.setOpenRowID(null),
|
||||
});
|
||||
}
|
||||
this.props.onScroll && this.props.onScroll(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a work-around to lock vertical `ListView` scrolling on iOS and
|
||||
* mimic Android behaviour. Locking vertical scrolling when horizontal
|
||||
* scrolling is active allows us to significantly improve framerates
|
||||
* (from high 20s to almost consistently 60 fps)
|
||||
*/
|
||||
_setListViewScrollable = (value: boolean): void => {
|
||||
if (this._listViewRef &&
|
||||
typeof this._listViewRef.setNativeProps === 'function') {
|
||||
_setListViewScrollable(value: boolean): void {
|
||||
if (this._listViewRef && typeof this._listViewRef.setNativeProps === 'function') {
|
||||
this._listViewRef.setNativeProps({
|
||||
scrollEnabled: value,
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Passing through ListView's getScrollResponder() function
|
||||
getScrollResponder = (): ?Object => {
|
||||
if (this._listViewRef &&
|
||||
typeof this._listViewRef.getScrollResponder === 'function') {
|
||||
getScrollResponder(): ?Object {
|
||||
if (this._listViewRef && typeof this._listViewRef.getScrollResponder === 'function') {
|
||||
return this._listViewRef.getScrollResponder();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
_renderRow = (rowData: Object, sectionID: string, rowID: string): ReactElement<any> => {
|
||||
const slideoutView = this.props.renderQuickActions(rowData, sectionID, rowID);
|
||||
@@ -177,11 +192,11 @@ class SwipeableListView extends React.Component {
|
||||
);
|
||||
};
|
||||
|
||||
_onOpen = (rowID: string): void => {
|
||||
_onOpen(rowID: string): void {
|
||||
this.setState({
|
||||
dataSource: this.state.dataSource.setOpenRowID(rowID),
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SwipeableListView;
|
||||
|
||||
@@ -31,7 +31,7 @@ type GeoOptions = {
|
||||
}
|
||||
|
||||
/**
|
||||
* The Geolocation API follows the web spec:
|
||||
* The Geolocation API extends the web spec:
|
||||
* https://developer.mozilla.org/en-US/docs/Web/API/Geolocation
|
||||
*
|
||||
* As a browser polyfill, this API is available through the `navigator.geolocation`
|
||||
@@ -48,6 +48,9 @@ type GeoOptions = {
|
||||
*
|
||||
* `<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />`
|
||||
*
|
||||
* Android API >= 18 Positions will also contain a `mocked` boolean to indicate if position
|
||||
* was created from a mock provider.
|
||||
*
|
||||
*/
|
||||
var Geolocation = {
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ RCT_EXPORT_MODULE()
|
||||
- (void)timeout:(NSTimer *)timer
|
||||
{
|
||||
RCTLocationRequest *request = timer.userInfo;
|
||||
NSString *message = [NSString stringWithFormat: @"Unable to fetch location within %zds.", (NSInteger)(timer.timeInterval * 1000.0)];
|
||||
NSString *message = [NSString stringWithFormat: @"Unable to fetch location within %.1fs.", request.options.timeout];
|
||||
request.errorBlock(@[RCTPositionError(RCTPositionErrorTimeout, message)]);
|
||||
[_pendingRequests removeObject:request];
|
||||
|
||||
|
||||
@@ -336,9 +336,6 @@ var cfg = {
|
||||
nativeOnly: {
|
||||
src: true,
|
||||
loadingIndicatorSrc: true,
|
||||
defaultImageSrc: true,
|
||||
imageTag: true,
|
||||
progressHandlerRegistered: true,
|
||||
shouldNotifyLoadEvents: true,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -257,6 +257,13 @@ const Image = React.createClass({
|
||||
* @platform ios
|
||||
*/
|
||||
onError: PropTypes.func,
|
||||
/**
|
||||
* Invoked when a partial load of the image is complete. The definition of
|
||||
* what constitutes a "partial load" is loader specific though this is meant
|
||||
* for progressive JPEG loads.
|
||||
* @platform ios
|
||||
*/
|
||||
onPartialLoad: PropTypes.func,
|
||||
/**
|
||||
* Invoked when load completes successfully.
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,17 @@
|
||||
139A38841C4D587C00862840 /* RCTResizeMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 139A38831C4D587C00862840 /* RCTResizeMode.m */; };
|
||||
13EF7F7F1BC825B1003F47DD /* RCTLocalAssetImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */; };
|
||||
143879381AAD32A300F088A5 /* RCTImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879371AAD32A300F088A5 /* RCTImageLoader.m */; };
|
||||
2D3B5F1A1D9B0D0400451313 /* RCTImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CCD34C261D4B8FE900268922 /* RCTImageCache.m */; };
|
||||
2D3B5F1B1D9B0D0700451313 /* RCTImageBlurUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = EEF314711C9B0DD30049118E /* RCTImageBlurUtils.m */; };
|
||||
2D3B5F1C1D9B0D1300451313 /* RCTResizeMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 139A38831C4D587C00862840 /* RCTResizeMode.m */; };
|
||||
2D3B5F1D1D9B0D1300451313 /* RCTLocalAssetImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */; };
|
||||
2D3B5F1E1D9B0D1300451313 /* RCTGIFImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5B11AA8C50D0002E2BE /* RCTGIFImageDecoder.m */; };
|
||||
2D3B5F1F1D9B0D1300451313 /* RCTImageEditingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 354631671B69857700AA0B86 /* RCTImageEditingManager.m */; };
|
||||
2D3B5F201D9B0D1300451313 /* RCTImageLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 143879371AAD32A300F088A5 /* RCTImageLoader.m */; };
|
||||
2D3B5F211D9B0D1300451313 /* RCTImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5A81AA8C4A30002E2BE /* RCTImageView.m */; };
|
||||
2D3B5F221D9B0D1300451313 /* RCTImageViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1304D5AA1AA8C4A30002E2BE /* RCTImageViewManager.m */; };
|
||||
2D3B5F231D9B0D1300451313 /* RCTImageStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */; };
|
||||
2D3B5F241D9B0D1300451313 /* RCTImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 134B00A11B54232B00EC8DFB /* RCTImageUtils.m */; };
|
||||
35123E6B1B59C99D00EBAD80 /* RCTImageStoreManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */; };
|
||||
354631681B69857700AA0B86 /* RCTImageEditingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 354631671B69857700AA0B86 /* RCTImageEditingManager.m */; };
|
||||
CCD34C271D4B8FE900268922 /* RCTImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = CCD34C261D4B8FE900268922 /* RCTImageCache.m */; };
|
||||
@@ -21,6 +32,15 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2D2A28381D9B042B00D4039D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B5115B1A9E6B3D00147676 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -47,6 +67,7 @@
|
||||
13EF7F7E1BC825B1003F47DD /* RCTLocalAssetImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLocalAssetImageLoader.m; sourceTree = "<group>"; };
|
||||
143879361AAD32A300F088A5 /* RCTImageLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageLoader.h; sourceTree = "<group>"; };
|
||||
143879371AAD32A300F088A5 /* RCTImageLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoader.m; sourceTree = "<group>"; };
|
||||
2D2A283A1D9B042B00D4039D /* libRCTImage-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTImage-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
35123E691B59C99D00EBAD80 /* RCTImageStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageStoreManager.h; sourceTree = "<group>"; };
|
||||
35123E6A1B59C99D00EBAD80 /* RCTImageStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageStoreManager.m; sourceTree = "<group>"; };
|
||||
354631661B69857700AA0B86 /* RCTImageEditingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTImageEditingManager.h; sourceTree = "<group>"; };
|
||||
@@ -59,6 +80,13 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2D2A28371D9B042B00D4039D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B5115A1A9E6B3D00147676 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -104,6 +132,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
58B5115D1A9E6B3D00147676 /* libRCTImage.a */,
|
||||
2D2A283A1D9B042B00D4039D /* libRCTImage-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -111,6 +140,23 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2D2A28391D9B042B00D4039D /* RCTImage-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D2A28421D9B042B00D4039D /* Build configuration list for PBXNativeTarget "RCTImage-tvOS" */;
|
||||
buildPhases = (
|
||||
2D2A28361D9B042B00D4039D /* Sources */,
|
||||
2D2A28371D9B042B00D4039D /* Frameworks */,
|
||||
2D2A28381D9B042B00D4039D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "RCTImage-tvOS";
|
||||
productName = "RCTImage-tvOS";
|
||||
productReference = 2D2A283A1D9B042B00D4039D /* libRCTImage-tvOS.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
58B5115C1A9E6B3D00147676 /* RCTImage */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 58B511711A9E6B3D00147676 /* Build configuration list for PBXNativeTarget "RCTImage" */;
|
||||
@@ -137,6 +183,10 @@
|
||||
LastUpgradeCheck = 0610;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
2D2A28391D9B042B00D4039D = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
58B5115C1A9E6B3D00147676 = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
@@ -155,11 +205,30 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
58B5115C1A9E6B3D00147676 /* RCTImage */,
|
||||
2D2A28391D9B042B00D4039D /* RCTImage-tvOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2D2A28361D9B042B00D4039D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D3B5F231D9B0D1300451313 /* RCTImageStoreManager.m in Sources */,
|
||||
2D3B5F1A1D9B0D0400451313 /* RCTImageCache.m in Sources */,
|
||||
2D3B5F1D1D9B0D1300451313 /* RCTLocalAssetImageLoader.m in Sources */,
|
||||
2D3B5F1F1D9B0D1300451313 /* RCTImageEditingManager.m in Sources */,
|
||||
2D3B5F1E1D9B0D1300451313 /* RCTGIFImageDecoder.m in Sources */,
|
||||
2D3B5F1C1D9B0D1300451313 /* RCTResizeMode.m in Sources */,
|
||||
2D3B5F221D9B0D1300451313 /* RCTImageViewManager.m in Sources */,
|
||||
2D3B5F211D9B0D1300451313 /* RCTImageView.m in Sources */,
|
||||
2D3B5F201D9B0D1300451313 /* RCTImageLoader.m in Sources */,
|
||||
2D3B5F1B1D9B0D0700451313 /* RCTImageBlurUtils.m in Sources */,
|
||||
2D3B5F241D9B0D1300451313 /* RCTImageUtils.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511591A9E6B3D00147676 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -181,6 +250,54 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2D2A28401D9B042B00D4039D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
"$(SRCROOT)/../Network/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D2A28411D9B042B00D4039D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
"$(SRCROOT)/../Network/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
58B5116F1A9E6B3D00147676 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -312,6 +429,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2D2A28421D9B042B00D4039D /* Build configuration list for PBXNativeTarget "RCTImage-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D2A28401D9B042B00D4039D /* Debug */,
|
||||
2D2A28411D9B042B00D4039D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
58B511581A9E6B3D00147676 /* Build configuration list for PBXProject "RCTImage" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#import "RCTResizeMode.h"
|
||||
|
||||
typedef void (^RCTImageLoaderProgressBlock)(int64_t progress, int64_t total);
|
||||
typedef void (^RCTImageLoaderPartialLoadBlock)(UIImage *image);
|
||||
typedef void (^RCTImageLoaderCompletionBlock)(NSError *error, UIImage *image);
|
||||
typedef dispatch_block_t RCTImageLoaderCancellationBlock;
|
||||
|
||||
@@ -82,6 +83,9 @@ typedef dispatch_block_t RCTImageLoaderCancellationBlock;
|
||||
* select the optimal dimensions for the loaded image. The `clipped` option
|
||||
* controls whether the image will be clipped to fit the specified size exactly,
|
||||
* or if the original aspect ratio should be retained.
|
||||
* `partialLoadBlock` is meant for custom image loaders that do not ship with the core RN library.
|
||||
* It is meant to be called repeatedly while loading the image as higher quality versions are decoded,
|
||||
* for instance with progressive JPEGs.
|
||||
*/
|
||||
- (RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest
|
||||
size:(CGSize)size
|
||||
@@ -89,6 +93,7 @@ typedef dispatch_block_t RCTImageLoaderCancellationBlock;
|
||||
clipped:(BOOL)clipped
|
||||
resizeMode:(RCTResizeMode)resizeMode
|
||||
progressBlock:(RCTImageLoaderProgressBlock)progressBlock
|
||||
partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock
|
||||
completionBlock:(RCTImageLoaderCompletionBlock)completionBlock;
|
||||
|
||||
/**
|
||||
@@ -155,6 +160,7 @@ typedef dispatch_block_t RCTImageLoaderCancellationBlock;
|
||||
scale:(CGFloat)scale
|
||||
resizeMode:(RCTResizeMode)resizeMode
|
||||
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
|
||||
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
|
||||
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler;
|
||||
|
||||
@optional
|
||||
|
||||
@@ -229,6 +229,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
clipped:YES
|
||||
resizeMode:RCTResizeModeStretch
|
||||
progressBlock:nil
|
||||
partialLoadBlock:nil
|
||||
completionBlock:callback];
|
||||
}
|
||||
|
||||
@@ -292,6 +293,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
scale:(CGFloat)scale
|
||||
resizeMode:(RCTResizeMode)resizeMode
|
||||
progressBlock:(RCTImageLoaderProgressBlock)progressHandler
|
||||
partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
|
||||
completionBlock:(void (^)(NSError *error, id imageOrData, BOOL cacheResult, NSString *fetchDate))completionBlock
|
||||
{
|
||||
{
|
||||
@@ -343,6 +345,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
scale:scale
|
||||
resizeMode:resizeMode
|
||||
progressHandler:progressHandler
|
||||
partialLoadHandler:partialLoadHandler
|
||||
completionHandler:^(NSError *error, UIImage *image){
|
||||
completionHandler(error, image, nil);
|
||||
}];
|
||||
@@ -366,6 +369,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
scale:scale
|
||||
resizeMode:resizeMode
|
||||
progressHandler:progressHandler
|
||||
partialLoadHandler:partialLoadHandler
|
||||
completionHandler:^(NSError *error, UIImage *image) {
|
||||
completionHandler(error, image, nil);
|
||||
}];
|
||||
@@ -378,7 +382,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
});
|
||||
|
||||
return ^{
|
||||
if (cancelLoad) {
|
||||
if (cancelLoad && !cancelled) {
|
||||
cancelLoad();
|
||||
cancelLoad = nil;
|
||||
}
|
||||
@@ -440,7 +444,9 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
|
||||
// Download image
|
||||
__weak __typeof(self) weakSelf = self;
|
||||
RCTNetworkTask *task = [networking networkTaskWithRequest:request completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
__block RCTNetworkTask *task =
|
||||
[networking networkTaskWithRequest:request
|
||||
completionBlock:^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
__typeof(self) strongSelf = weakSelf;
|
||||
if (!strongSelf) {
|
||||
return;
|
||||
@@ -469,7 +475,11 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
});
|
||||
}];
|
||||
|
||||
task.downloadProgressBlock = progressHandler;
|
||||
task.downloadProgressBlock = ^(int64_t progress, int64_t total) {
|
||||
if (progressHandler) {
|
||||
progressHandler(progress, total);
|
||||
}
|
||||
};
|
||||
|
||||
if (task) {
|
||||
if (!_pendingTasks) {
|
||||
@@ -480,8 +490,15 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
}
|
||||
|
||||
return ^{
|
||||
[task cancel];
|
||||
[weakSelf dequeueTasks];
|
||||
__typeof(self) strongSelf = weakSelf;
|
||||
if (!strongSelf || !task) {
|
||||
return;
|
||||
}
|
||||
dispatch_async(strongSelf->_URLRequestQueue, ^{
|
||||
[task cancel];
|
||||
task = nil;
|
||||
});
|
||||
[strongSelf dequeueTasks];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -491,12 +508,13 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
clipped:(BOOL)clipped
|
||||
resizeMode:(RCTResizeMode)resizeMode
|
||||
progressBlock:(RCTImageLoaderProgressBlock)progressBlock
|
||||
partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock
|
||||
completionBlock:(RCTImageLoaderCompletionBlock)completionBlock
|
||||
{
|
||||
__block volatile uint32_t cancelled = 0;
|
||||
__block dispatch_block_t cancelLoad = nil;
|
||||
dispatch_block_t cancellationBlock = ^{
|
||||
if (cancelLoad) {
|
||||
if (cancelLoad && !cancelled) {
|
||||
cancelLoad();
|
||||
}
|
||||
OSAtomicOr32Barrier(1, &cancelled);
|
||||
@@ -544,7 +562,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
completionBlock(error_, image);
|
||||
};
|
||||
|
||||
cancelLoad = [weakSelf decodeImageData:imageOrData
|
||||
cancelLoad = [strongSelf decodeImageData:imageOrData
|
||||
size:size
|
||||
scale:scale
|
||||
clipped:clipped
|
||||
@@ -557,6 +575,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
scale:scale
|
||||
resizeMode:resizeMode
|
||||
progressBlock:progressBlock
|
||||
partialLoadBlock:partialLoadBlock
|
||||
completionBlock:completionHandler];
|
||||
return cancellationBlock;
|
||||
}
|
||||
@@ -693,6 +712,7 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image,
|
||||
scale:1
|
||||
resizeMode:RCTResizeModeStretch
|
||||
progressBlock:NULL
|
||||
partialLoadBlock:NULL
|
||||
completionBlock:completion];
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ static NSDictionary *onLoadParamsForSource(RCTImageSource *source)
|
||||
@property (nonatomic, copy) RCTDirectEventBlock onLoadStart;
|
||||
@property (nonatomic, copy) RCTDirectEventBlock onProgress;
|
||||
@property (nonatomic, copy) RCTDirectEventBlock onError;
|
||||
@property (nonatomic, copy) RCTDirectEventBlock onPartialLoad;
|
||||
@property (nonatomic, copy) RCTDirectEventBlock onLoad;
|
||||
@property (nonatomic, copy) RCTDirectEventBlock onLoadEnd;
|
||||
|
||||
@@ -296,6 +297,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
};
|
||||
}
|
||||
|
||||
__weak RCTImageView *weakSelf = self;
|
||||
RCTImageLoaderPartialLoadBlock partialLoadHandler = ^(UIImage *image) {
|
||||
[weakSelf imageLoaderLoadedImage:image error:nil forImageSource:source partial:YES];
|
||||
};
|
||||
|
||||
CGSize imageSize = self.bounds.size;
|
||||
CGFloat imageScale = RCTScreenScale();
|
||||
if (!UIEdgeInsetsEqualToEdgeInsets(_capInsets, UIEdgeInsetsZero)) {
|
||||
@@ -304,9 +310,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
imageScale = source.scale;
|
||||
}
|
||||
|
||||
__weak RCTImageView *weakSelf = self;
|
||||
RCTImageLoaderCompletionBlock completionHandler = ^(NSError *error, UIImage *loadedImage) {
|
||||
[weakSelf imageLoaderLoadedImage:loadedImage error:error forImageSource:source];
|
||||
[weakSelf imageLoaderLoadedImage:loadedImage error:error forImageSource:source partial:NO];
|
||||
};
|
||||
|
||||
_reloadImageCancellationBlock =
|
||||
@@ -316,13 +321,14 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
clipped:NO
|
||||
resizeMode:_resizeMode
|
||||
progressBlock:progressHandler
|
||||
partialLoadBlock:partialLoadHandler
|
||||
completionBlock:completionHandler];
|
||||
} else {
|
||||
[self clearImage];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)imageLoaderLoadedImage:(UIImage *)loadedImage error:(NSError *)error forImageSource:(RCTImageSource *)source
|
||||
- (void)imageLoaderLoadedImage:(UIImage *)loadedImage error:(NSError *)error forImageSource:(RCTImageSource *)source partial:(BOOL)isPartialLoad
|
||||
{
|
||||
if (![source isEqual:_pendingImageSource]) {
|
||||
// Bail out if source has changed since we started loading
|
||||
@@ -340,8 +346,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
}
|
||||
|
||||
void (^setImageBlock)(UIImage *) = ^(UIImage *image) {
|
||||
self->_imageSource = source;
|
||||
self->_pendingImageSource = nil;
|
||||
if (!isPartialLoad) {
|
||||
self->_imageSource = source;
|
||||
self->_pendingImageSource = nil;
|
||||
}
|
||||
|
||||
if (image.reactKeyframeAnimation) {
|
||||
[self.layer addAnimation:image.reactKeyframeAnimation forKey:@"contents"];
|
||||
@@ -350,11 +358,17 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
self.image = image;
|
||||
}
|
||||
|
||||
if (self->_onLoad) {
|
||||
self->_onLoad(onLoadParamsForSource(source));
|
||||
}
|
||||
if (self->_onLoadEnd) {
|
||||
self->_onLoadEnd(nil);
|
||||
if (isPartialLoad) {
|
||||
if (self->_onPartialLoad) {
|
||||
self->_onPartialLoad(nil);
|
||||
}
|
||||
} else {
|
||||
if (self->_onLoad) {
|
||||
self->_onLoad(onLoadParamsForSource(source));
|
||||
}
|
||||
if (self->_onLoadEnd) {
|
||||
self->_onLoadEnd(nil);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ RCT_REMAP_VIEW_PROPERTY(defaultSource, defaultImage, UIImage)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onLoadStart, RCTDirectEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onProgress, RCTDirectEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onError, RCTDirectEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onPartialLoad, RCTDirectEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onLoad, RCTDirectEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(onLoadEnd, RCTDirectEventBlock)
|
||||
RCT_EXPORT_VIEW_PROPERTY(resizeMode, RCTResizeMode)
|
||||
|
||||
@@ -71,6 +71,7 @@ static NSBundle *bundleForPath(NSString *key)
|
||||
scale:(CGFloat)scale
|
||||
resizeMode:(RCTResizeMode)resizeMode
|
||||
progressHandler:(RCTImageLoaderProgressBlock)progressHandler
|
||||
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler
|
||||
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler
|
||||
{
|
||||
__block volatile uint32_t cancelled = 0;
|
||||
|
||||
@@ -99,7 +99,13 @@ var InteractionManager = {
|
||||
});
|
||||
return {
|
||||
then: promise.then.bind(promise),
|
||||
done: promise.done.bind(promise),
|
||||
done: (...args) => {
|
||||
if (promise.done) {
|
||||
return promise.done(...args);
|
||||
} else {
|
||||
console.warn('Tried to call done when not supported by current Promise implementation.');
|
||||
}
|
||||
},
|
||||
cancel: function() {
|
||||
_taskQueue.cancelTasks(tasks);
|
||||
},
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
const {fetch} = require('fetch');
|
||||
const getDevServer = require('getDevServer');
|
||||
const {SourceCode} = require('NativeModules');
|
||||
|
||||
import type {StackFrame} from 'parseErrorStack';
|
||||
|
||||
@@ -21,6 +22,19 @@ async function symbolicateStackTrace(stack: Array<StackFrame>): Promise<Array<St
|
||||
if (!devServer.bundleLoadedFromServer) {
|
||||
throw new Error('Bundle was not loaded from the packager');
|
||||
}
|
||||
if (SourceCode.scriptURL) {
|
||||
for (let i = 0; i < stack.length; ++i) {
|
||||
// If the sources exist on disk rather than appearing to come from the packager,
|
||||
// replace the location with the packager URL until we reach an internal source
|
||||
// which does not have a path (no slashes), indicating a switch from within
|
||||
// the application to a surrounding debugging environment.
|
||||
if (/^http/.test(stack[i].file) || !/[\\/]/.test(stack[i].file)) {
|
||||
break;
|
||||
}
|
||||
stack[i].file = SourceCode.scriptURL;
|
||||
}
|
||||
}
|
||||
|
||||
const response = await fetch(devServer.url + 'symbolicate', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({stack}),
|
||||
|
||||
@@ -8,9 +8,19 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
148699CF1ABD045300480536 /* RCTLinkingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 148699CE1ABD045300480536 /* RCTLinkingManager.m */; };
|
||||
2D3B5F251D9B0DE600451313 /* RCTLinkingManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 148699CE1ABD045300480536 /* RCTLinkingManager.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2D2A28451D9B043800D4039D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -26,9 +36,17 @@
|
||||
134814201AA4EA6300B7C361 /* libRCTLinking.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTLinking.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
148699CD1ABD045300480536 /* RCTLinkingManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTLinkingManager.h; sourceTree = "<group>"; };
|
||||
148699CE1ABD045300480536 /* RCTLinkingManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTLinkingManager.m; sourceTree = "<group>"; };
|
||||
2D2A28471D9B043800D4039D /* libRCTLinking-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTLinking-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2D2A28441D9B043800D4039D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -53,12 +71,30 @@
|
||||
148699CD1ABD045300480536 /* RCTLinkingManager.h */,
|
||||
148699CE1ABD045300480536 /* RCTLinkingManager.m */,
|
||||
134814211AA4EA7D00B7C361 /* Products */,
|
||||
2D2A28471D9B043800D4039D /* libRCTLinking-tvOS.a */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2D2A28461D9B043800D4039D /* RCTLinking-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D2A284F1D9B043800D4039D /* Build configuration list for PBXNativeTarget "RCTLinking-tvOS" */;
|
||||
buildPhases = (
|
||||
2D2A28431D9B043800D4039D /* Sources */,
|
||||
2D2A28441D9B043800D4039D /* Frameworks */,
|
||||
2D2A28451D9B043800D4039D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "RCTLinking-tvOS";
|
||||
productName = "RCTLinking-tvOS";
|
||||
productReference = 2D2A28471D9B043800D4039D /* libRCTLinking-tvOS.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
58B511DA1A9E6C8500147676 /* RCTLinking */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTLinking" */;
|
||||
@@ -85,6 +121,10 @@
|
||||
LastUpgradeCheck = 0610;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
2D2A28461D9B043800D4039D = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
58B511DA1A9E6C8500147676 = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
@@ -103,11 +143,20 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
58B511DA1A9E6C8500147676 /* RCTLinking */,
|
||||
2D2A28461D9B043800D4039D /* RCTLinking-tvOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2D2A28431D9B043800D4039D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D3B5F251D9B0DE600451313 /* RCTLinkingManager.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D71A9E6C8500147676 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -119,6 +168,52 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2D2A284D1D9B043800D4039D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D2A284E1D9B043800D4039D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
58B511ED1A9E6C8500147676 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -236,6 +331,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2D2A284F1D9B043800D4039D /* Build configuration list for PBXNativeTarget "RCTLinking-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D2A284D1D9B043800D4039D /* Debug */,
|
||||
2D2A284E1D9B043800D4039D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTLinking" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -11,15 +11,15 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const AppContainer = require('AppContainer');
|
||||
const I18nManager = require('I18nManager');
|
||||
const Platform = require('Platform');
|
||||
const PropTypes = require('react/lib/ReactPropTypes');
|
||||
const React = require('React');
|
||||
const StyleSheet = require('StyleSheet');
|
||||
const UIManager = require('UIManager');
|
||||
const View = require('View');
|
||||
const deprecatedPropType = require('deprecatedPropType');
|
||||
|
||||
const deprecatedPropType = require('deprecatedPropType');
|
||||
const requireNativeComponent = require('requireNativeComponent');
|
||||
const RCTModalHostView = requireNativeComponent('RCTModalHostView', null);
|
||||
|
||||
@@ -27,7 +27,7 @@ const RCTModalHostView = requireNativeComponent('RCTModalHostView', null);
|
||||
* The Modal component is a simple way to present content above an enclosing view.
|
||||
*
|
||||
* _Note: If you need more control over how to present modals over the rest of your app,
|
||||
* then consider using a top-level Navigator. Go [here](/react-native/docs/navigator-comparison.html) to compare navigation options._
|
||||
* then consider using a top-level Navigator._
|
||||
*
|
||||
* ```javascript
|
||||
* import React, { Component } from 'react';
|
||||
@@ -136,7 +136,6 @@ class Modal extends React.Component {
|
||||
|
||||
const containerStyles = {
|
||||
backgroundColor: this.props.transparent ? 'transparent' : 'white',
|
||||
top: Platform.OS === 'android' && Platform.Version >= 19 ? UIManager.RCTModalHostView.Constants.StatusBarHeight : 0,
|
||||
};
|
||||
|
||||
let animationType = this.props.animationType;
|
||||
@@ -148,6 +147,12 @@ class Modal extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
const innerChildren = __DEV__ ?
|
||||
( <AppContainer>
|
||||
{this.props.children}
|
||||
</AppContainer>) :
|
||||
this.props.children;
|
||||
|
||||
return (
|
||||
<RCTModalHostView
|
||||
animationType={animationType}
|
||||
@@ -160,7 +165,7 @@ class Modal extends React.Component {
|
||||
onOrientationChange={this.props.onOrientationChange}
|
||||
>
|
||||
<View style={[styles.container, containerStyles]}>
|
||||
{this.props.children}
|
||||
{innerChildren}
|
||||
</View>
|
||||
</RCTModalHostView>
|
||||
);
|
||||
|
||||
+4
-6
@@ -7,10 +7,8 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
const NavigationRootContainer = {
|
||||
getBackAction: () => {
|
||||
return { type: 'BackAction' };
|
||||
}
|
||||
};
|
||||
#import "RCTValueAnimatedNode.h"
|
||||
|
||||
module.exports = NavigationRootContainer;
|
||||
@interface RCTDivisionAnimatedNode : RCTValueAnimatedNode
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#import "RCTDivisionAnimatedNode.h"
|
||||
#import "RCTLog.h"
|
||||
|
||||
@implementation RCTDivisionAnimatedNode
|
||||
|
||||
- (void)performUpdate
|
||||
{
|
||||
[super performUpdate];
|
||||
|
||||
NSArray<NSNumber *> *inputNodes = self.config[@"input"];
|
||||
if (inputNodes.count > 1) {
|
||||
RCTValueAnimatedNode *parent1 = (RCTValueAnimatedNode *)self.parentNodes[inputNodes[0]];
|
||||
RCTValueAnimatedNode *parent2 = (RCTValueAnimatedNode *)self.parentNodes[inputNodes[1]];
|
||||
if ([parent1 isKindOfClass:[RCTValueAnimatedNode class]] &&
|
||||
[parent2 isKindOfClass:[RCTValueAnimatedNode class]]) {
|
||||
if (parent2.value == 0) {
|
||||
RCTLogError(@"Detected a division by zero in Animated.divide node");
|
||||
return;
|
||||
}
|
||||
self.value = parent1.value / parent2.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -20,6 +20,9 @@
|
||||
|
||||
@interface RCTValueAnimatedNode : RCTAnimatedNode
|
||||
|
||||
- (void)setOffset:(CGFloat)offset;
|
||||
- (void)flattenOffset;
|
||||
|
||||
@property (nonatomic, assign) CGFloat value;
|
||||
@property (nonatomic, weak) id<RCTValueAnimatedNodeObserver> valueObserver;
|
||||
|
||||
|
||||
@@ -9,8 +9,37 @@
|
||||
|
||||
#import "RCTValueAnimatedNode.h"
|
||||
|
||||
@interface RCTValueAnimatedNode ()
|
||||
|
||||
@property (nonatomic, assign) CGFloat offset;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RCTValueAnimatedNode
|
||||
|
||||
@synthesize value = _value;
|
||||
|
||||
- (instancetype)initWithTag:(NSNumber *)tag
|
||||
config:(NSDictionary<NSString *, id> *)config
|
||||
{
|
||||
if (self = [super initWithTag:tag config:config]) {
|
||||
_offset = [self.config[@"offset"] floatValue];
|
||||
_value = [self.config[@"value"] floatValue];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)flattenOffset
|
||||
{
|
||||
_value += _offset;
|
||||
_offset = 0;
|
||||
}
|
||||
|
||||
- (CGFloat)value
|
||||
{
|
||||
return _value + _offset;
|
||||
}
|
||||
|
||||
- (void)setValue:(CGFloat)value
|
||||
{
|
||||
_value = value;
|
||||
|
||||
@@ -19,11 +19,36 @@
|
||||
13E501EE1D07A6C9005F35D8 /* RCTStyleAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E31D07A6C9005F35D8 /* RCTStyleAnimatedNode.m */; };
|
||||
13E501EF1D07A6C9005F35D8 /* RCTTransformAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E51D07A6C9005F35D8 /* RCTTransformAnimatedNode.m */; };
|
||||
13E501F01D07A6C9005F35D8 /* RCTValueAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E71D07A6C9005F35D8 /* RCTValueAnimatedNode.m */; };
|
||||
94DAE3F91D7334A70059942F /* RCTModuloAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */; };
|
||||
193F64F41D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */; };
|
||||
2D3B5EF21D9B0B3100451313 /* RCTAnimationUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501B81D07A644005F35D8 /* RCTAnimationUtils.m */; };
|
||||
2D3B5EF31D9B0B3400451313 /* RCTViewPropertyMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501C81D07A644005F35D8 /* RCTViewPropertyMapper.m */; };
|
||||
2D3B5EF41D9B0B3700451313 /* RCTNativeAnimatedModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501BE1D07A644005F35D8 /* RCTNativeAnimatedModule.m */; };
|
||||
2D3B5EF51D9B0B4800451313 /* RCTDivisionAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */; };
|
||||
2D3B5EF61D9B0B4800451313 /* RCTDiffClampAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */; };
|
||||
2D3B5EF71D9B0B4800451313 /* RCTAdditionAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501D71D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m */; };
|
||||
2D3B5EF81D9B0B4800451313 /* RCTAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501D91D07A6C9005F35D8 /* RCTAnimatedNode.m */; };
|
||||
2D3B5EF91D9B0B4800451313 /* RCTAnimationDriverNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501DB1D07A6C9005F35D8 /* RCTAnimationDriverNode.m */; };
|
||||
2D3B5EFA1D9B0B4800451313 /* RCTInterpolationAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501DD1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m */; };
|
||||
2D3B5EFB1D9B0B4800451313 /* RCTModuloAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */; };
|
||||
2D3B5EFC1D9B0B4800451313 /* RCTMultiplicationAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501DF1D07A6C9005F35D8 /* RCTMultiplicationAnimatedNode.m */; };
|
||||
2D3B5EFD1D9B0B4800451313 /* RCTPropsAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E11D07A6C9005F35D8 /* RCTPropsAnimatedNode.m */; };
|
||||
2D3B5EFE1D9B0B4800451313 /* RCTStyleAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E31D07A6C9005F35D8 /* RCTStyleAnimatedNode.m */; };
|
||||
2D3B5EFF1D9B0B4800451313 /* RCTTransformAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E51D07A6C9005F35D8 /* RCTTransformAnimatedNode.m */; };
|
||||
2D3B5F001D9B0B4800451313 /* RCTValueAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 13E501E71D07A6C9005F35D8 /* RCTValueAnimatedNode.m */; };
|
||||
5C9894951D999639008027DB /* RCTDivisionAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */; };
|
||||
94DAE3F91D7334A70059942F /* RCTModuloAnimatedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2D2A281E1D9B03D100D4039D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -61,13 +86,23 @@
|
||||
13E501E51D07A6C9005F35D8 /* RCTTransformAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTransformAnimatedNode.m; sourceTree = "<group>"; };
|
||||
13E501E61D07A6C9005F35D8 /* RCTValueAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTValueAnimatedNode.h; sourceTree = "<group>"; };
|
||||
13E501E71D07A6C9005F35D8 /* RCTValueAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTValueAnimatedNode.m; sourceTree = "<group>"; };
|
||||
94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModuloAnimatedNode.h; sourceTree = "<group>"; };
|
||||
94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuloAnimatedNode.m; sourceTree = "<group>"; };
|
||||
193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDiffClampAnimatedNode.h; sourceTree = "<group>"; };
|
||||
193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDiffClampAnimatedNode.m; sourceTree = "<group>"; };
|
||||
2D2A28201D9B03D100D4039D /* libRCTAnimation-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTAnimation-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDivisionAnimatedNode.h; sourceTree = "<group>"; };
|
||||
5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDivisionAnimatedNode.m; sourceTree = "<group>"; };
|
||||
94DAE3F71D7334A70059942F /* RCTModuloAnimatedNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTModuloAnimatedNode.h; sourceTree = "<group>"; };
|
||||
94DAE3F81D7334A70059942F /* RCTModuloAnimatedNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTModuloAnimatedNode.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2D2A281D1D9B03D100D4039D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -89,6 +124,8 @@
|
||||
13E501D51D07A6C9005F35D8 /* Nodes */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5C9894931D999639008027DB /* RCTDivisionAnimatedNode.h */,
|
||||
5C9894941D999639008027DB /* RCTDivisionAnimatedNode.m */,
|
||||
193F64F21D776EC6004D1CAA /* RCTDiffClampAnimatedNode.h */,
|
||||
193F64F31D776EC6004D1CAA /* RCTDiffClampAnimatedNode.m */,
|
||||
13E501D61D07A6C9005F35D8 /* RCTAdditionAnimatedNode.h */,
|
||||
@@ -126,12 +163,30 @@
|
||||
13E501BE1D07A644005F35D8 /* RCTNativeAnimatedModule.m */,
|
||||
13E501D51D07A6C9005F35D8 /* Nodes */,
|
||||
134814211AA4EA7D00B7C361 /* Products */,
|
||||
2D2A28201D9B03D100D4039D /* libRCTAnimation-tvOS.a */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2D2A281F1D9B03D100D4039D /* RCTAnimation-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D2A28281D9B03D100D4039D /* Build configuration list for PBXNativeTarget "RCTAnimation-tvOS" */;
|
||||
buildPhases = (
|
||||
2D2A281C1D9B03D100D4039D /* Sources */,
|
||||
2D2A281D1D9B03D100D4039D /* Frameworks */,
|
||||
2D2A281E1D9B03D100D4039D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "RCTAnimation-tvOS";
|
||||
productName = "RCTAnimation-tvOS";
|
||||
productReference = 2D2A28201D9B03D100D4039D /* libRCTAnimation-tvOS.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
58B511DA1A9E6C8500147676 /* RCTAnimation */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTAnimation" */;
|
||||
@@ -158,6 +213,10 @@
|
||||
LastUpgradeCheck = 0730;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
2D2A281F1D9B03D100D4039D = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
58B511DA1A9E6C8500147676 = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
@@ -176,11 +235,34 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
58B511DA1A9E6C8500147676 /* RCTAnimation */,
|
||||
2D2A281F1D9B03D100D4039D /* RCTAnimation-tvOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2D2A281C1D9B03D100D4039D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D3B5F001D9B0B4800451313 /* RCTValueAnimatedNode.m in Sources */,
|
||||
2D3B5EFB1D9B0B4800451313 /* RCTModuloAnimatedNode.m in Sources */,
|
||||
2D3B5EF21D9B0B3100451313 /* RCTAnimationUtils.m in Sources */,
|
||||
2D3B5EF51D9B0B4800451313 /* RCTDivisionAnimatedNode.m in Sources */,
|
||||
2D3B5EF71D9B0B4800451313 /* RCTAdditionAnimatedNode.m in Sources */,
|
||||
2D3B5EF41D9B0B3700451313 /* RCTNativeAnimatedModule.m in Sources */,
|
||||
2D3B5EF61D9B0B4800451313 /* RCTDiffClampAnimatedNode.m in Sources */,
|
||||
2D3B5EF81D9B0B4800451313 /* RCTAnimatedNode.m in Sources */,
|
||||
2D3B5EFE1D9B0B4800451313 /* RCTStyleAnimatedNode.m in Sources */,
|
||||
2D3B5EFA1D9B0B4800451313 /* RCTInterpolationAnimatedNode.m in Sources */,
|
||||
2D3B5EF91D9B0B4800451313 /* RCTAnimationDriverNode.m in Sources */,
|
||||
2D3B5EFF1D9B0B4800451313 /* RCTTransformAnimatedNode.m in Sources */,
|
||||
2D3B5EFC1D9B0B4800451313 /* RCTMultiplicationAnimatedNode.m in Sources */,
|
||||
2D3B5EFD1D9B0B4800451313 /* RCTPropsAnimatedNode.m in Sources */,
|
||||
2D3B5EF31D9B0B3400451313 /* RCTViewPropertyMapper.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D71A9E6C8500147676 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -196,6 +278,7 @@
|
||||
13E501E91D07A6C9005F35D8 /* RCTAnimatedNode.m in Sources */,
|
||||
13E501EB1D07A6C9005F35D8 /* RCTInterpolationAnimatedNode.m in Sources */,
|
||||
13E501E81D07A6C9005F35D8 /* RCTAdditionAnimatedNode.m in Sources */,
|
||||
5C9894951D999639008027DB /* RCTDivisionAnimatedNode.m in Sources */,
|
||||
13E501EA1D07A6C9005F35D8 /* RCTAnimationDriverNode.m in Sources */,
|
||||
13E501EF1D07A6C9005F35D8 /* RCTTransformAnimatedNode.m in Sources */,
|
||||
13E501D41D07A644005F35D8 /* RCTViewPropertyMapper.m in Sources */,
|
||||
@@ -205,6 +288,51 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2D2A28261D9B03D100D4039D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D2A28271D9B03D100D4039D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
58B511ED1A9E6C8500147676 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -325,6 +453,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2D2A28281D9B03D100D4039D /* Build configuration list for PBXNativeTarget "RCTAnimation-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D2A28261D9B03D100D4039D /* Debug */,
|
||||
2D2A28271D9B03D100D4039D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTAnimation" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#import "RCTInterpolationAnimatedNode.h"
|
||||
#import "RCTLog.h"
|
||||
#import "RCTDiffClampAnimatedNode.h"
|
||||
#import "RCTDivisionAnimatedNode.h"
|
||||
#import "RCTModuloAnimatedNode.h"
|
||||
#import "RCTMultiplicationAnimatedNode.h"
|
||||
#import "RCTPropsAnimatedNode.h"
|
||||
@@ -71,6 +72,7 @@ RCT_EXPORT_METHOD(createAnimatedNode:(nonnull NSNumber *)tag
|
||||
@"interpolation" : [RCTInterpolationAnimatedNode class],
|
||||
@"addition" : [RCTAdditionAnimatedNode class],
|
||||
@"diffclamp": [RCTDiffClampAnimatedNode class],
|
||||
@"division" : [RCTDivisionAnimatedNode class],
|
||||
@"multiplication" : [RCTMultiplicationAnimatedNode class],
|
||||
@"modulus" : [RCTModuloAnimatedNode class],
|
||||
@"transform" : [RCTTransformAnimatedNode class]};
|
||||
@@ -175,6 +177,32 @@ RCT_EXPORT_METHOD(setAnimatedNodeValue:(nonnull NSNumber *)nodeTag
|
||||
[valueNode setNeedsUpdate];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(setAnimatedNodeOffset:(nonnull NSNumber *)nodeTag
|
||||
offset:(nonnull NSNumber *)offset)
|
||||
{
|
||||
RCTAnimatedNode *node = _animationNodes[nodeTag];
|
||||
if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {
|
||||
RCTLogError(@"Not a value node.");
|
||||
return;
|
||||
}
|
||||
|
||||
RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)node;
|
||||
[valueNode setOffset:offset.floatValue];
|
||||
[_updatedValueNodes addObject:valueNode];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(flattenAnimatedNodeOffset:(nonnull NSNumber *)nodeTag)
|
||||
{
|
||||
RCTAnimatedNode *node = _animationNodes[nodeTag];
|
||||
if (![node isKindOfClass:[RCTValueAnimatedNode class]]) {
|
||||
RCTLogError(@"Not a value node.");
|
||||
return;
|
||||
}
|
||||
|
||||
RCTValueAnimatedNode *valueNode = (RCTValueAnimatedNode *)node;
|
||||
[valueNode flattenOffset];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(connectAnimatedNodeToView:(nonnull NSNumber *)nodeTag
|
||||
viewTag:(nonnull NSNumber *)viewTag)
|
||||
{
|
||||
|
||||
@@ -11,11 +11,26 @@
|
||||
1372B7371AB03E7B00659ED6 /* RCTNetInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7361AB03E7B00659ED6 /* RCTNetInfo.m */; };
|
||||
13D6D66A1B5FCF8200883BE9 /* RCTNetworkTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D6D6691B5FCF8200883BE9 /* RCTNetworkTask.m */; };
|
||||
13EF800E1BCBE015003F47DD /* RCTFileRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF800D1BCBE015003F47DD /* RCTFileRequestHandler.m */; };
|
||||
2D3B5F261D9B0EAB00451313 /* RCTNetworkTask.m in Sources */ = {isa = PBXBuildFile; fileRef = 13D6D6691B5FCF8200883BE9 /* RCTNetworkTask.m */; };
|
||||
2D3B5F271D9B0EB400451313 /* RCTHTTPRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.m */; };
|
||||
2D3B5F281D9B0EB400451313 /* RCTFileRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 13EF800D1BCBE015003F47DD /* RCTFileRequestHandler.m */; };
|
||||
2D3B5F291D9B0EB400451313 /* RCTDataRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 134E96991BCEB7F800AFFDA1 /* RCTDataRequestHandler.m */; };
|
||||
2D3B5F2A1D9B0EB400451313 /* RCTNetInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7361AB03E7B00659ED6 /* RCTNetInfo.m */; };
|
||||
2D3B5F2B1D9B0EB400451313 /* RCTNetworking.mm in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTNetworking.mm */; };
|
||||
352DA0BA1B17855800AA15A8 /* RCTHTTPRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.m */; };
|
||||
58B512081A9E6CE300147676 /* RCTNetworking.mm in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTNetworking.mm */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2D2A28521D9B044C00D4039D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -36,6 +51,7 @@
|
||||
13D6D6691B5FCF8200883BE9 /* RCTNetworkTask.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNetworkTask.m; sourceTree = "<group>"; };
|
||||
13EF800C1BCBE015003F47DD /* RCTFileRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTFileRequestHandler.h; sourceTree = "<group>"; };
|
||||
13EF800D1BCBE015003F47DD /* RCTFileRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTFileRequestHandler.m; sourceTree = "<group>"; };
|
||||
2D2A28541D9B044C00D4039D /* libRCTNetwork-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTNetwork-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
352DA0B71B17855800AA15A8 /* RCTHTTPRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTHTTPRequestHandler.h; sourceTree = "<group>"; };
|
||||
352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTHTTPRequestHandler.m; sourceTree = "<group>"; };
|
||||
58B511DB1A9E6C8500147676 /* libRCTNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTNetwork.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -44,6 +60,13 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2D2A28511D9B044C00D4039D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -79,6 +102,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
58B511DB1A9E6C8500147676 /* libRCTNetwork.a */,
|
||||
2D2A28541D9B044C00D4039D /* libRCTNetwork-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -86,6 +110,23 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2D2A28531D9B044C00D4039D /* RCTNetwork-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D2A285C1D9B044C00D4039D /* Build configuration list for PBXNativeTarget "RCTNetwork-tvOS" */;
|
||||
buildPhases = (
|
||||
2D2A28501D9B044C00D4039D /* Sources */,
|
||||
2D2A28511D9B044C00D4039D /* Frameworks */,
|
||||
2D2A28521D9B044C00D4039D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "RCTNetwork-tvOS";
|
||||
productName = "RCTNetwork-tvOS";
|
||||
productReference = 2D2A28541D9B044C00D4039D /* libRCTNetwork-tvOS.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
58B511DA1A9E6C8500147676 /* RCTNetwork */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTNetwork" */;
|
||||
@@ -112,6 +153,10 @@
|
||||
LastUpgradeCheck = 0610;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
2D2A28531D9B044C00D4039D = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
58B511DA1A9E6C8500147676 = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
@@ -130,11 +175,25 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
58B511DA1A9E6C8500147676 /* RCTNetwork */,
|
||||
2D2A28531D9B044C00D4039D /* RCTNetwork-tvOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2D2A28501D9B044C00D4039D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D3B5F2A1D9B0EB400451313 /* RCTNetInfo.m in Sources */,
|
||||
2D3B5F261D9B0EAB00451313 /* RCTNetworkTask.m in Sources */,
|
||||
2D3B5F281D9B0EB400451313 /* RCTFileRequestHandler.m in Sources */,
|
||||
2D3B5F271D9B0EB400451313 /* RCTHTTPRequestHandler.m in Sources */,
|
||||
2D3B5F2B1D9B0EB400451313 /* RCTNetworking.mm in Sources */,
|
||||
2D3B5F291D9B0EB400451313 /* RCTDataRequestHandler.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D71A9E6C8500147676 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -151,6 +210,52 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2D2A285A1D9B044C00D4039D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D2A285B1D9B044C00D4039D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
58B511ED1A9E6C8500147676 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -275,6 +380,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2D2A285C1D9B044C00D4039D /* Build configuration list for PBXNativeTarget "RCTNetwork-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D2A285A1D9B044C00D4039D /* Debug */,
|
||||
2D2A285B1D9B044C00D4039D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTNetwork" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -53,6 +53,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
_incrementalDataBlock = nil;
|
||||
_responseBlock = nil;
|
||||
_uploadProgressBlock = nil;
|
||||
_requestToken = nil;
|
||||
}
|
||||
|
||||
- (void)dispatchCallback:(dispatch_block_t)callback
|
||||
@@ -66,6 +67,11 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
|
||||
- (void)start
|
||||
{
|
||||
if (_status != RCTNetworkTaskPending) {
|
||||
RCTLogError(@"RCTNetworkTask was already started or completed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_requestToken == nil) {
|
||||
id token = [_handler sendRequest:_request withDelegate:self];
|
||||
if ([self validateRequestToken:token]) {
|
||||
@@ -77,6 +83,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
|
||||
- (void)cancel
|
||||
{
|
||||
if (_status == RCTNetworkTaskFinished) {
|
||||
return;
|
||||
}
|
||||
|
||||
_status = RCTNetworkTaskFinished;
|
||||
id token = _requestToken;
|
||||
if (token && [_handler respondsToSelector:@selector(cancelRequest:)]) {
|
||||
|
||||
@@ -340,7 +340,7 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
||||
var headers = this.responseHeaders || {};
|
||||
return Object.keys(headers).map((headerName) => {
|
||||
return headerName + ': ' + headers[headerName];
|
||||
}).join('\n');
|
||||
}).join('\r\n');
|
||||
}
|
||||
|
||||
getResponseHeader(header: string): ?string {
|
||||
@@ -468,8 +468,10 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
||||
setReadyState(newState: number): void {
|
||||
this.readyState = newState;
|
||||
this.dispatchEvent({type: 'readystatechange'});
|
||||
if (newState === this.DONE && !this._aborted) {
|
||||
if (this._hasError) {
|
||||
if (newState === this.DONE) {
|
||||
if (this._aborted) {
|
||||
this.dispatchEvent({type: 'abort'});
|
||||
} else if (this._hasError) {
|
||||
if (this._timedOut) {
|
||||
this.dispatchEvent({type: 'timeout'});
|
||||
} else {
|
||||
@@ -478,6 +480,7 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
||||
} else {
|
||||
this.dispatchEvent({type: 'load'});
|
||||
}
|
||||
this.dispatchEvent({type: 'loadend'});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ describe('XMLHttpRequest', function() {
|
||||
var handleError;
|
||||
var handleLoad;
|
||||
var handleReadyStateChange;
|
||||
var handleLoadEnd;
|
||||
|
||||
beforeEach(() => {
|
||||
xhr = new XMLHttpRequest();
|
||||
@@ -40,16 +41,19 @@ describe('XMLHttpRequest', function() {
|
||||
xhr.ontimeout = jest.fn();
|
||||
xhr.onerror = jest.fn();
|
||||
xhr.onload = jest.fn();
|
||||
xhr.onloadend = jest.fn();
|
||||
xhr.onreadystatechange = jest.fn();
|
||||
|
||||
handleTimeout = jest.fn();
|
||||
handleError = jest.fn();
|
||||
handleLoad = jest.fn();
|
||||
handleLoadEnd = jest.fn();
|
||||
handleReadyStateChange = jest.fn();
|
||||
|
||||
xhr.addEventListener('timeout', handleTimeout);
|
||||
xhr.addEventListener('error', handleError);
|
||||
xhr.addEventListener('load', handleLoad);
|
||||
xhr.addEventListener('loadend', handleLoadEnd);
|
||||
xhr.addEventListener('readystatechange', handleReadyStateChange);
|
||||
});
|
||||
|
||||
@@ -58,6 +62,8 @@ describe('XMLHttpRequest', function() {
|
||||
handleTimeout = null;
|
||||
handleError = null;
|
||||
handleLoad = null;
|
||||
handleLoadEnd = null;
|
||||
handleReadyStateChange = null;
|
||||
});
|
||||
|
||||
it('should transition readyState correctly', function() {
|
||||
@@ -119,10 +125,12 @@ describe('XMLHttpRequest', function() {
|
||||
expect(xhr.readyState).toBe(xhr.DONE);
|
||||
|
||||
expect(xhr.ontimeout.mock.calls.length).toBe(1);
|
||||
expect(xhr.onloadend.mock.calls.length).toBe(1);
|
||||
expect(xhr.onerror).not.toBeCalled();
|
||||
expect(xhr.onload).not.toBeCalled();
|
||||
|
||||
expect(handleTimeout.mock.calls.length).toBe(1);
|
||||
expect(handleLoadEnd.mock.calls.length).toBe(1);
|
||||
expect(handleError).not.toBeCalled();
|
||||
expect(handleLoad).not.toBeCalled();
|
||||
});
|
||||
@@ -136,11 +144,13 @@ describe('XMLHttpRequest', function() {
|
||||
|
||||
expect(xhr.onreadystatechange.mock.calls.length).toBe(2);
|
||||
expect(xhr.onerror.mock.calls.length).toBe(1);
|
||||
expect(xhr.onloadend.mock.calls.length).toBe(1);
|
||||
expect(xhr.ontimeout).not.toBeCalled();
|
||||
expect(xhr.onload).not.toBeCalled();
|
||||
|
||||
expect(handleReadyStateChange.mock.calls.length).toBe(2);
|
||||
expect(handleError.mock.calls.length).toBe(1);
|
||||
expect(handleLoadEnd.mock.calls.length).toBe(1);
|
||||
expect(handleTimeout).not.toBeCalled();
|
||||
expect(handleLoad).not.toBeCalled();
|
||||
});
|
||||
@@ -154,16 +164,18 @@ describe('XMLHttpRequest', function() {
|
||||
|
||||
expect(xhr.onreadystatechange.mock.calls.length).toBe(2);
|
||||
expect(xhr.onload.mock.calls.length).toBe(1);
|
||||
expect(xhr.onloadend.mock.calls.length).toBe(1);
|
||||
expect(xhr.onerror).not.toBeCalled();
|
||||
expect(xhr.ontimeout).not.toBeCalled();
|
||||
|
||||
expect(handleReadyStateChange.mock.calls.length).toBe(2);
|
||||
expect(handleLoad.mock.calls.length).toBe(1);
|
||||
expect(handleLoadEnd.mock.calls.length).toBe(1);
|
||||
expect(handleError).not.toBeCalled();
|
||||
expect(handleTimeout).not.toBeCalled();
|
||||
});
|
||||
|
||||
it('should call onload function when there is no error', function() {
|
||||
it('should call upload onprogress', function() {
|
||||
xhr.open('GET', 'blabla');
|
||||
xhr.send();
|
||||
|
||||
@@ -182,4 +194,17 @@ describe('XMLHttpRequest', function() {
|
||||
expect(handleProgress.mock.calls[0][0].total).toBe(100);
|
||||
});
|
||||
|
||||
it('should combine response headers with CRLF', function() {
|
||||
xhr.open('GET', 'blabla');
|
||||
xhr.send();
|
||||
xhr.__didReceiveResponse(1, 200, {
|
||||
'Content-Type': 'text/plain; charset=utf-8',
|
||||
'Content-Length': '32',
|
||||
});
|
||||
|
||||
expect(xhr.getAllResponseHeaders()).toBe(
|
||||
'Content-Type: text/plain; charset=utf-8\r\n' +
|
||||
'Content-Length: 32');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -39,8 +39,8 @@ type Rationale = {
|
||||
* ```
|
||||
* async function requestCameraPermission() {
|
||||
* try {
|
||||
* const granted = await AndroidPermissions.requestPermission(
|
||||
* AndroidPermissions.PERMISSIONS.CAMERA,
|
||||
* const granted = await PermissionsAndroid.requestPermission(
|
||||
* PermissionsAndroid.PERMISSIONS.CAMERA,
|
||||
* {
|
||||
* 'title': 'Cool Photo App Camera Permission',
|
||||
* 'message': 'Cool Photo App needs access to your camera ' +
|
||||
|
||||
@@ -41,8 +41,7 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
@property(readwrite, nonatomic, assign) BOOL recordMode;
|
||||
|
||||
/**
|
||||
@param testClass The subclass of FBSnapshotTestCase that is using this controller.
|
||||
@param referenceImagesDirectory The directory where the reference images are stored.
|
||||
@param testClass The subclass of FBSnapshotTestCase that is using this controller.d.
|
||||
@returns An instance of FBSnapshotTestController.
|
||||
*/
|
||||
- (id)initWithTestClass:(Class)testClass;
|
||||
@@ -50,7 +49,6 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
/**
|
||||
Designated initializer.
|
||||
@param testName The name of the tests.
|
||||
@param referenceImagesDirectory The directory where the reference images are stored.
|
||||
@returns An instance of FBSnapshotTestController.
|
||||
*/
|
||||
- (id)initWithTestName:(NSString *)testName;
|
||||
@@ -59,9 +57,8 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
/**
|
||||
Performs the comparison of the layer.
|
||||
@param layer The Layer to snapshot.
|
||||
@param referenceImagesDirectory The directory in which reference images are stored.
|
||||
@param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method.
|
||||
@param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||
@param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||
@returns YES if the comparison (or saving of the reference image) succeeded.
|
||||
*/
|
||||
- (BOOL)compareSnapshotOfLayer:(CALayer *)layer
|
||||
@@ -72,9 +69,9 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
/**
|
||||
Performs the comparison of the view.
|
||||
@param view The view to snapshot.
|
||||
@param referenceImagesDirectory The directory in which reference images are stored.
|
||||
@param selector selector
|
||||
@param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method.
|
||||
@param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||
@param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||
@returns YES if the comparison (or saving of the reference image) succeeded.
|
||||
*/
|
||||
- (BOOL)compareSnapshotOfView:(UIView *)view
|
||||
@@ -84,10 +81,10 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
|
||||
/**
|
||||
Performs the comparison of a view or layer.
|
||||
@param view The view or layer to snapshot.
|
||||
@param referenceImagesDirectory The directory in which reference images are stored.
|
||||
@param viewOrLayer The view or layer to snapshot.
|
||||
@param selector selector
|
||||
@param identifier An optional identifier, used is there are muliptle snapshot tests in a given -test method.
|
||||
@param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||
@param errorPtr An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc).
|
||||
@returns YES if the comparison (or saving of the reference image) succeeded.
|
||||
*/
|
||||
- (BOOL)compareSnapshotOfViewOrLayer:(id)viewOrLayer
|
||||
@@ -116,7 +113,7 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
Saves a reference image.
|
||||
@param selector The test method being run.
|
||||
@param identifier The optional identifier, used when multiple images are tested in a single -test method.
|
||||
@param error An error, if this methods returns NO, the error will be something useful.
|
||||
@param errorPtr An error, if this methods returns NO, the error will be something useful.
|
||||
@returns An image.
|
||||
*/
|
||||
- (BOOL)saveReferenceImage:(UIImage *)image
|
||||
@@ -128,8 +125,8 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
Performs a pixel-by-pixel comparison of the two images.
|
||||
@param referenceImage The reference (correct) image.
|
||||
@param image The image to test against the reference.
|
||||
@param error An error that indicates why the comparison failed if it does.
|
||||
@param YES if the comparison succeeded and the images are the same.
|
||||
@param errorPtr An error that indicates why the comparison failed if it does.
|
||||
@returns YES if the comparison succeeded and the images are the same.
|
||||
*/
|
||||
- (BOOL)compareReferenceImage:(UIImage *)referenceImage
|
||||
toImage:(UIImage *)image
|
||||
@@ -141,8 +138,8 @@ extern NSString *const FBReferenceImageFilePathKey;
|
||||
@param testImage The image to test against the reference.
|
||||
@param selector The test method being run.
|
||||
@param identifier The optional identifier, used when multiple images are tested in a single -test method.
|
||||
@param error An error that indicates why the comparison failed if it does.
|
||||
@param YES if the save succeeded.
|
||||
@param errorPtr An error that indicates why the comparison failed if it does.
|
||||
@returns YES if the save succeeded.
|
||||
*/
|
||||
- (BOOL)saveFailedReferenceImage:(UIImage *)referenceImage
|
||||
testImage:(UIImage *)testImage
|
||||
|
||||
@@ -247,6 +247,9 @@ typedef NS_ENUM(NSUInteger, FBTestSnapshotFileNameType) {
|
||||
if ([[UIScreen mainScreen] scale] > 1.0) {
|
||||
fileName = [fileName stringByAppendingFormat:@"@%.fx", [[UIScreen mainScreen] scale]];
|
||||
}
|
||||
#if TARGET_OS_TV
|
||||
fileName = [fileName stringByAppendingString:@"_tvOS"];
|
||||
#endif
|
||||
fileName = [fileName stringByAppendingPathExtension:@"png"];
|
||||
return fileName;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
2D3B5F2D1D9B0F2800451313 /* RCTSnapshotManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9913A84A1BBE833400D70E66 /* RCTSnapshotManager.m */; };
|
||||
2D3B5F2E1D9B0F2B00451313 /* RCTTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135341AB3C56F00882537 /* RCTTestModule.m */; };
|
||||
2D3B5F2F1D9B0F2E00451313 /* RCTTestRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135361AB3C56F00882537 /* RCTTestRunner.m */; };
|
||||
2D3B5F301D9B0F3D00451313 /* FBSnapshotTestController.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FE71AB964CD007446E2 /* FBSnapshotTestController.m */; };
|
||||
2D3B5F311D9B0F4200451313 /* UIImage+Compare.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FE91AB964CD007446E2 /* UIImage+Compare.m */; };
|
||||
2D3B5F321D9B0F4500451313 /* UIImage+Diff.m in Sources */ = {isa = PBXBuildFile; fileRef = 58E64FEB1AB964CD007446E2 /* UIImage+Diff.m */; };
|
||||
585135371AB3C56F00882537 /* RCTTestModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135341AB3C56F00882537 /* RCTTestModule.m */; };
|
||||
585135381AB3C57000882537 /* RCTTestRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = 585135361AB3C56F00882537 /* RCTTestRunner.m */; };
|
||||
585135391AB3C59A00882537 /* RCTTestRunner.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 585135351AB3C56F00882537 /* RCTTestRunner.h */; };
|
||||
@@ -17,6 +23,15 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2D2A286C1D9B047700D4039D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
580C376D1AB104AF0015E709 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -30,6 +45,7 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
2D2A286E1D9B047700D4039D /* libRCTTest-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTTest-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
580C376F1AB104AF0015E709 /* libRCTTest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTTest.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
585135331AB3C56F00882537 /* RCTTestModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTTestModule.h; sourceTree = "<group>"; };
|
||||
585135341AB3C56F00882537 /* RCTTestModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTestModule.m; sourceTree = "<group>"; };
|
||||
@@ -48,6 +64,13 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2D2A286B1D9B047700D4039D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
580C376C1AB104AF0015E709 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -78,6 +101,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
580C376F1AB104AF0015E709 /* libRCTTest.a */,
|
||||
2D2A286E1D9B047700D4039D /* libRCTTest-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -100,6 +124,23 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2D2A286D1D9B047700D4039D /* RCTTest-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D2A28761D9B047700D4039D /* Build configuration list for PBXNativeTarget "RCTTest-tvOS" */;
|
||||
buildPhases = (
|
||||
2D2A286A1D9B047700D4039D /* Sources */,
|
||||
2D2A286B1D9B047700D4039D /* Frameworks */,
|
||||
2D2A286C1D9B047700D4039D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "RCTTest-tvOS";
|
||||
productName = "RCTTest-tvOS";
|
||||
productReference = 2D2A286E1D9B047700D4039D /* libRCTTest-tvOS.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
580C376E1AB104AF0015E709 /* RCTTest */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 580C37831AB104AF0015E709 /* Build configuration list for PBXNativeTarget "RCTTest" */;
|
||||
@@ -126,6 +167,10 @@
|
||||
LastUpgradeCheck = 0610;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
2D2A286D1D9B047700D4039D = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
580C376E1AB104AF0015E709 = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
@@ -144,11 +189,25 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
580C376E1AB104AF0015E709 /* RCTTest */,
|
||||
2D2A286D1D9B047700D4039D /* RCTTest-tvOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2D2A286A1D9B047700D4039D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D3B5F311D9B0F4200451313 /* UIImage+Compare.m in Sources */,
|
||||
2D3B5F2F1D9B0F2E00451313 /* RCTTestRunner.m in Sources */,
|
||||
2D3B5F321D9B0F4500451313 /* UIImage+Diff.m in Sources */,
|
||||
2D3B5F301D9B0F3D00451313 /* FBSnapshotTestController.m in Sources */,
|
||||
2D3B5F2D1D9B0F2800451313 /* RCTSnapshotManager.m in Sources */,
|
||||
2D3B5F2E1D9B0F2B00451313 /* RCTTestModule.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
580C376B1AB104AF0015E709 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -165,6 +224,42 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2D2A28741D9B047700D4039D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D2A28751D9B047700D4039D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
580C37811AB104AF0015E709 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -303,6 +398,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2D2A28761D9B047700D4039D /* Build configuration list for PBXNativeTarget "RCTTest-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D2A28741D9B047700D4039D /* Debug */,
|
||||
2D2A28751D9B047700D4039D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
580C376A1AB104AF0015E709 /* Build configuration list for PBXProject "RCTTest" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -8,9 +8,19 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
13DBA45E1AEE749000A17CF8 /* RCTSettingsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */; };
|
||||
2D3B5F2C1D9B0ECA00451313 /* RCTSettingsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2D2A285F1D9B046600D4039D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D91A9E6C8500147676 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -26,9 +36,17 @@
|
||||
134814201AA4EA6300B7C361 /* libRCTSettings.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTSettings.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
13DBA45C1AEE749000A17CF8 /* RCTSettingsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTSettingsManager.h; sourceTree = "<group>"; };
|
||||
13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTSettingsManager.m; sourceTree = "<group>"; };
|
||||
2D2A28611D9B046600D4039D /* libRCTSettings-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTSettings-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2D2A285E1D9B046600D4039D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D81A9E6C8500147676 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -53,12 +71,30 @@
|
||||
13DBA45C1AEE749000A17CF8 /* RCTSettingsManager.h */,
|
||||
13DBA45D1AEE749000A17CF8 /* RCTSettingsManager.m */,
|
||||
134814211AA4EA7D00B7C361 /* Products */,
|
||||
2D2A28611D9B046600D4039D /* libRCTSettings-tvOS.a */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2D2A28601D9B046600D4039D /* RCTSettings-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D2A28691D9B046600D4039D /* Build configuration list for PBXNativeTarget "RCTSettings-tvOS" */;
|
||||
buildPhases = (
|
||||
2D2A285D1D9B046600D4039D /* Sources */,
|
||||
2D2A285E1D9B046600D4039D /* Frameworks */,
|
||||
2D2A285F1D9B046600D4039D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "RCTSettings-tvOS";
|
||||
productName = "RCTSettings-tvOS";
|
||||
productReference = 2D2A28611D9B046600D4039D /* libRCTSettings-tvOS.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
58B511DA1A9E6C8500147676 /* RCTSettings */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RCTSettings" */;
|
||||
@@ -85,6 +121,10 @@
|
||||
LastUpgradeCheck = 0610;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
2D2A28601D9B046600D4039D = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
58B511DA1A9E6C8500147676 = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
@@ -103,11 +143,20 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
58B511DA1A9E6C8500147676 /* RCTSettings */,
|
||||
2D2A28601D9B046600D4039D /* RCTSettings-tvOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2D2A285D1D9B046600D4039D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D3B5F2C1D9B0ECA00451313 /* RCTSettingsManager.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511D71A9E6C8500147676 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -119,6 +168,52 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2D2A28671D9B046600D4039D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D2A28681D9B046600D4039D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
58B511ED1A9E6C8500147676 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -238,6 +333,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2D2A28691D9B046600D4039D /* Build configuration list for PBXNativeTarget "RCTSettings-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D2A28671D9B046600D4039D /* Debug */,
|
||||
2D2A28681D9B046600D4039D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RCTSettings" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -83,7 +83,7 @@ var LayoutPropTypes = {
|
||||
* use logical pixel units, rather than percents, ems, or any of that.
|
||||
*
|
||||
* See https://developer.mozilla.org/en-US/docs/Web/CSS/bottom
|
||||
* for more details of how `top` affects layout.
|
||||
* for more details of how `bottom` affects layout.
|
||||
*/
|
||||
bottom: ReactPropTypes.number,
|
||||
|
||||
@@ -328,6 +328,19 @@ var LayoutPropTypes = {
|
||||
'stretch'
|
||||
]),
|
||||
|
||||
/** `overflow` controls how a children are measured and displayed.
|
||||
* `overflow: hidden` causes views to be clipped while `overflow: scroll`
|
||||
* causes views to be measured independently of their parents main axis.`
|
||||
* It works like `overflow` in CSS (default: visible).
|
||||
* See https://developer.mozilla.org/en/docs/Web/CSS/overflow
|
||||
* for more details.
|
||||
*/
|
||||
overflow: ReactPropTypes.oneOf([
|
||||
'visible',
|
||||
'hidden',
|
||||
'scroll',
|
||||
]),
|
||||
|
||||
/** In React Native `flex` does not work the same way that it does in CSS.
|
||||
* `flex` is a number rather than a string, and it works
|
||||
* according to the `css-layout` library
|
||||
|
||||
@@ -12,6 +12,16 @@
|
||||
1362F1001B4D51F400E06D8C /* RCTTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1362F0FD1B4D51F400E06D8C /* RCTTextField.m */; };
|
||||
1362F1011B4D51F400E06D8C /* RCTTextFieldManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1362F0FF1B4D51F400E06D8C /* RCTTextFieldManager.m */; };
|
||||
19FC5C851D41A4120090108F /* RCTTextSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = 19FC5C841D41A4120090108F /* RCTTextSelection.m */; };
|
||||
2D3B5F331D9B102D00451313 /* RCTTextSelection.m in Sources */ = {isa = PBXBuildFile; fileRef = 19FC5C841D41A4120090108F /* RCTTextSelection.m */; };
|
||||
2D3B5F341D9B103100451313 /* RCTRawTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */; };
|
||||
2D3B5F351D9B103300451313 /* RCTShadowRawText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C91A9E6C5C00147676 /* RCTShadowRawText.m */; };
|
||||
2D3B5F361D9B106F00451313 /* RCTShadowText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511CB1A9E6C5C00147676 /* RCTShadowText.m */; };
|
||||
2D3B5F371D9B106F00451313 /* RCTText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B512141A9E6EFF00147676 /* RCTText.m */; };
|
||||
2D3B5F381D9B106F00451313 /* RCTTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511CD1A9E6C5C00147676 /* RCTTextManager.m */; };
|
||||
2D3B5F391D9B106F00451313 /* RCTTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 1362F0FD1B4D51F400E06D8C /* RCTTextField.m */; };
|
||||
2D3B5F3A1D9B106F00451313 /* RCTTextFieldManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1362F0FF1B4D51F400E06D8C /* RCTTextFieldManager.m */; };
|
||||
2D3B5F3B1D9B106F00451313 /* RCTTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6ABD1AF0CD0600FFC3E0 /* RCTTextView.m */; };
|
||||
2D3B5F3C1D9B106F00451313 /* RCTTextViewManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 131B6ABF1AF0CD0600FFC3E0 /* RCTTextViewManager.m */; };
|
||||
58B511CE1A9E6C5C00147676 /* RCTRawTextManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */; };
|
||||
58B511CF1A9E6C5C00147676 /* RCTShadowRawText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511C91A9E6C5C00147676 /* RCTShadowRawText.m */; };
|
||||
58B511D01A9E6C5C00147676 /* RCTShadowText.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B511CB1A9E6C5C00147676 /* RCTShadowText.m */; };
|
||||
@@ -20,6 +30,15 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
2D2A28791D9B048500D4039D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "include/$(PRODUCT_NAME)";
|
||||
dstSubfolderSpec = 16;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511991A9E6C1200147676 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -42,6 +61,7 @@
|
||||
1362F0FF1B4D51F400E06D8C /* RCTTextFieldManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTextFieldManager.m; sourceTree = "<group>"; };
|
||||
19FC5C841D41A4120090108F /* RCTTextSelection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTTextSelection.m; sourceTree = "<group>"; };
|
||||
19FC5C861D41A4220090108F /* RCTTextSelection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTTextSelection.h; sourceTree = "<group>"; };
|
||||
2D2A287B1D9B048500D4039D /* libRCTText-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRCTText-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
58B5119B1A9E6C1200147676 /* libRCTText.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTText.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
58B511C61A9E6C5C00147676 /* RCTRawTextManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTRawTextManager.h; sourceTree = "<group>"; };
|
||||
58B511C71A9E6C5C00147676 /* RCTRawTextManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRawTextManager.m; sourceTree = "<group>"; };
|
||||
@@ -56,6 +76,13 @@
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
2D2A28781D9B048500D4039D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511981A9E6C1200147676 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -99,6 +126,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
58B5119B1A9E6C1200147676 /* libRCTText.a */,
|
||||
2D2A287B1D9B048500D4039D /* libRCTText-tvOS.a */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -106,6 +134,23 @@
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
2D2A287A1D9B048500D4039D /* RCTText-tvOS */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2D2A28831D9B048500D4039D /* Build configuration list for PBXNativeTarget "RCTText-tvOS" */;
|
||||
buildPhases = (
|
||||
2D2A28771D9B048500D4039D /* Sources */,
|
||||
2D2A28781D9B048500D4039D /* Frameworks */,
|
||||
2D2A28791D9B048500D4039D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "RCTText-tvOS";
|
||||
productName = "RCTText-tvOS";
|
||||
productReference = 2D2A287B1D9B048500D4039D /* libRCTText-tvOS.a */;
|
||||
productType = "com.apple.product-type.library.static";
|
||||
};
|
||||
58B5119A1A9E6C1200147676 /* RCTText */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 58B511AF1A9E6C1300147676 /* Build configuration list for PBXNativeTarget "RCTText" */;
|
||||
@@ -132,6 +177,10 @@
|
||||
LastUpgradeCheck = 0610;
|
||||
ORGANIZATIONNAME = Facebook;
|
||||
TargetAttributes = {
|
||||
2D2A287A1D9B048500D4039D = {
|
||||
CreatedOnToolsVersion = 8.0;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
58B5119A1A9E6C1200147676 = {
|
||||
CreatedOnToolsVersion = 6.1.1;
|
||||
};
|
||||
@@ -150,11 +199,29 @@
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
58B5119A1A9E6C1200147676 /* RCTText */,
|
||||
2D2A287A1D9B048500D4039D /* RCTText-tvOS */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
2D2A28771D9B048500D4039D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2D3B5F371D9B106F00451313 /* RCTText.m in Sources */,
|
||||
2D3B5F381D9B106F00451313 /* RCTTextManager.m in Sources */,
|
||||
2D3B5F391D9B106F00451313 /* RCTTextField.m in Sources */,
|
||||
2D3B5F361D9B106F00451313 /* RCTShadowText.m in Sources */,
|
||||
2D3B5F3B1D9B106F00451313 /* RCTTextView.m in Sources */,
|
||||
2D3B5F3A1D9B106F00451313 /* RCTTextFieldManager.m in Sources */,
|
||||
2D3B5F341D9B103100451313 /* RCTRawTextManager.m in Sources */,
|
||||
2D3B5F3C1D9B106F00451313 /* RCTTextViewManager.m in Sources */,
|
||||
2D3B5F331D9B102D00451313 /* RCTTextSelection.m in Sources */,
|
||||
2D3B5F351D9B103300451313 /* RCTShadowRawText.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
58B511971A9E6C1200147676 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
@@ -175,6 +242,52 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
2D2A28811D9B048500D4039D /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
2D2A28821D9B048500D4039D /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVES = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||||
"$(SRCROOT)/../../React/**",
|
||||
);
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SDKROOT = appletvos;
|
||||
SKIP_INSTALL = YES;
|
||||
TVOS_DEPLOYMENT_TARGET = 9.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
58B511AD1A9E6C1300147676 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
@@ -295,6 +408,15 @@
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
2D2A28831D9B048500D4039D /* Build configuration list for PBXNativeTarget "RCTText-tvOS" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
2D2A28811D9B048500D4039D /* Debug */,
|
||||
2D2A28821D9B048500D4039D /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
58B511961A9E6C1200147676 /* Build configuration list for PBXProject "RCTText" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
||||
@@ -96,12 +96,16 @@
|
||||
_textView = [[RCTUITextView alloc] initWithFrame:CGRectZero];
|
||||
_textView.backgroundColor = [UIColor clearColor];
|
||||
_textView.textColor = [UIColor blackColor];
|
||||
#if !TARGET_OS_TV
|
||||
_textView.scrollsToTop = NO;
|
||||
#endif
|
||||
_textView.scrollEnabled = NO;
|
||||
_textView.delegate = self;
|
||||
|
||||
_scrollView = [[UIScrollView alloc] initWithFrame:CGRectZero];
|
||||
#if !TARGET_OS_TV
|
||||
_scrollView.scrollsToTop = NO;
|
||||
#endif
|
||||
[_scrollView addSubview:_textView];
|
||||
|
||||
[self addSubview:_scrollView];
|
||||
@@ -283,11 +287,13 @@ static NSAttributedString *removeReactTagFromString(NSAttributedString *string)
|
||||
|
||||
if (_placeholder) {
|
||||
_placeholderView = [[UITextView alloc] initWithFrame:self.bounds];
|
||||
_placeholderView.editable = NO;
|
||||
_placeholderView.userInteractionEnabled = NO;
|
||||
_placeholderView.backgroundColor = [UIColor clearColor];
|
||||
_placeholderView.scrollEnabled = NO;
|
||||
#if !TARGET_OS_TV
|
||||
_placeholderView.editable = NO;
|
||||
_placeholderView.scrollsToTop = NO;
|
||||
#endif
|
||||
_placeholderView.attributedText =
|
||||
[[NSAttributedString alloc] initWithString:_placeholder attributes:@{
|
||||
NSFontAttributeName : (_textView.font ? _textView.font : [self defaultPlaceholderFont]),
|
||||
|
||||
@@ -7,38 +7,40 @@
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule MessageQueue
|
||||
* @flow
|
||||
*/
|
||||
|
||||
/*eslint no-bitwise: 0*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const Systrace = require('Systrace');
|
||||
const ErrorUtils = require('ErrorUtils');
|
||||
const JSTimersExecution = require('JSTimersExecution');
|
||||
const Systrace = require('Systrace');
|
||||
|
||||
const deepFreezeAndThrowOnMutationInDev = require('deepFreezeAndThrowOnMutationInDev');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
const keyMirror = require('fbjs/lib/keyMirror');
|
||||
const stringifySafe = require('stringifySafe');
|
||||
|
||||
export type SpyData = {
|
||||
type: number,
|
||||
module: ?string,
|
||||
method: string|number,
|
||||
args: any
|
||||
}
|
||||
|
||||
const TO_JS = 0;
|
||||
const TO_NATIVE = 1;
|
||||
|
||||
const MODULE_IDS = 0;
|
||||
const METHOD_IDS = 1;
|
||||
const PARAMS = 2;
|
||||
const MIN_TIME_BETWEEN_FLUSHES_MS = 5;
|
||||
|
||||
const TO_NATIVE = 1;
|
||||
const TO_JS = 0;
|
||||
|
||||
const TRACE_TAG_REACT_APPS = 1 << 17;
|
||||
|
||||
const DEBUG_INFO_LIMIT = 32;
|
||||
|
||||
const MethodTypes = keyMirror({
|
||||
async: null,
|
||||
promise: null,
|
||||
sync: null,
|
||||
});
|
||||
|
||||
const guard = (fn) => {
|
||||
try {
|
||||
fn();
|
||||
@@ -47,12 +49,22 @@ const guard = (fn) => {
|
||||
}
|
||||
};
|
||||
|
||||
type Config = {
|
||||
remoteModuleConfig: Object,
|
||||
};
|
||||
|
||||
class MessageQueue {
|
||||
constructor(configProvider: () => Config, serializeNativeParams: boolean) {
|
||||
_callableModules: {[key: string]: Object};
|
||||
_queue: [Array<number>, Array<number>, Array<any>, number];
|
||||
_callbacks: [];
|
||||
_callbackID: number;
|
||||
_callID: number;
|
||||
_lastFlush: number;
|
||||
_eventLoopStartTime: number;
|
||||
|
||||
_debugInfo: Object;
|
||||
_remoteModuleTable: Object;
|
||||
_remoteMethodTable: Object;
|
||||
|
||||
__spy: ?(data: SpyData) => void;
|
||||
|
||||
constructor() {
|
||||
this._callableModules = {};
|
||||
this._queue = [[], [], [], 0];
|
||||
this._callbacks = [];
|
||||
@@ -60,7 +72,6 @@ class MessageQueue {
|
||||
this._callID = 0;
|
||||
this._lastFlush = 0;
|
||||
this._eventLoopStartTime = new Date().getTime();
|
||||
this._serializeNativeParams = serializeNativeParams;
|
||||
|
||||
if (__DEV__) {
|
||||
this._debugInfo = {};
|
||||
@@ -68,28 +79,20 @@ class MessageQueue {
|
||||
this._remoteMethodTable = {};
|
||||
}
|
||||
|
||||
[
|
||||
'invokeCallbackAndReturnFlushedQueue',
|
||||
'callFunctionReturnFlushedQueue',
|
||||
'callFunction',
|
||||
'flushedQueue',
|
||||
].forEach((fn) => (this[fn] = this[fn].bind(this)));
|
||||
|
||||
lazyProperty(this, 'RemoteModules', () => {
|
||||
const {remoteModuleConfig} = configProvider();
|
||||
const modulesConfig = remoteModuleConfig;
|
||||
return this._genModules(modulesConfig);
|
||||
});
|
||||
(this:any).callFunctionReturnFlushedQueue = this.callFunctionReturnFlushedQueue.bind(this);
|
||||
(this:any).callFunctionReturnResultAndFlushedQueue = this.callFunctionReturnResultAndFlushedQueue.bind(this);
|
||||
(this:any).flushedQueue = this.flushedQueue.bind(this);
|
||||
(this:any).invokeCallbackAndReturnFlushedQueue = this.invokeCallbackAndReturnFlushedQueue.bind(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Public APIs
|
||||
*/
|
||||
|
||||
static spy(spyOrToggle){
|
||||
static spy(spyOrToggle: boolean|(data: SpyData) => void){
|
||||
if (spyOrToggle === true){
|
||||
MessageQueue.prototype.__spy = (info)=>{
|
||||
console.log(`${info.type == TO_JS ? 'N->JS' : 'JS->N'} : ` +
|
||||
MessageQueue.prototype.__spy = info => {
|
||||
console.log(`${info.type === TO_JS ? 'N->JS' : 'JS->N'} : ` +
|
||||
`${info.module ? (info.module + '.') : ''}${info.method}` +
|
||||
`(${JSON.stringify(info.args)})`);
|
||||
};
|
||||
@@ -100,7 +103,7 @@ class MessageQueue {
|
||||
}
|
||||
}
|
||||
|
||||
callFunctionReturnFlushedQueue(module, method, args) {
|
||||
callFunctionReturnFlushedQueue(module: string, method: string, args: Array<any>) {
|
||||
guard(() => {
|
||||
this.__callFunction(module, method, args);
|
||||
this.__callImmediates();
|
||||
@@ -109,17 +112,17 @@ class MessageQueue {
|
||||
return this.flushedQueue();
|
||||
}
|
||||
|
||||
callFunction(module, method, args) {
|
||||
callFunctionReturnResultAndFlushedQueue(module: string, method: string, args: Array<any>) {
|
||||
let result;
|
||||
guard(() => {
|
||||
result = this.__callFunction(module, method, args);
|
||||
this.__callImmediates();
|
||||
});
|
||||
|
||||
return result;
|
||||
return [result, this.flushedQueue()];
|
||||
}
|
||||
|
||||
invokeCallbackAndReturnFlushedQueue(cbID, args) {
|
||||
invokeCallbackAndReturnFlushedQueue(cbID: number, args: Array<any>) {
|
||||
guard(() => {
|
||||
this.__invokeCallback(cbID, args);
|
||||
this.__callImmediates();
|
||||
@@ -136,37 +139,19 @@ class MessageQueue {
|
||||
return queue[0].length ? queue : null;
|
||||
}
|
||||
|
||||
processModuleConfig(config, moduleID) {
|
||||
const info = this._genModule(config, moduleID);
|
||||
this.RemoteModules[info.name] = info.module;
|
||||
if (__DEV__) {
|
||||
this._createDebugLookup(config, moduleID, this._remoteModuleTable, this._remoteMethodTable);
|
||||
}
|
||||
return info.module;
|
||||
}
|
||||
|
||||
getEventLoopRunningTime() {
|
||||
return new Date().getTime() - this._eventLoopStartTime;
|
||||
}
|
||||
|
||||
registerCallableModule(name, methods) {
|
||||
this._callableModules[name] = methods;
|
||||
registerCallableModule(name: string, module: Object) {
|
||||
this._callableModules[name] = module;
|
||||
}
|
||||
|
||||
/**
|
||||
* "Private" methods
|
||||
*/
|
||||
__callImmediates() {
|
||||
Systrace.beginEvent('JSTimersExecution.callImmediates()');
|
||||
guard(() => JSTimersExecution.callImmediates());
|
||||
Systrace.endEvent();
|
||||
}
|
||||
|
||||
__nativeCall(module, method, params, onFail, onSucc) {
|
||||
enqueueNativeCall(moduleID: number, methodID: number, params: Array<any>, onFail: ?Function, onSucc: ?Function) {
|
||||
if (onFail || onSucc) {
|
||||
if (__DEV__) {
|
||||
let callId = this._callbackID >> 1;
|
||||
this._debugInfo[callId] = [module, method];
|
||||
const callId = this._callbackID >> 1;
|
||||
this._debugInfo[callId] = [moduleID, methodID];
|
||||
if (callId > DEBUG_INFO_LIMIT) {
|
||||
delete this._debugInfo[callId - DEBUG_INFO_LIMIT];
|
||||
}
|
||||
@@ -183,11 +168,17 @@ class MessageQueue {
|
||||
}
|
||||
this._callID++;
|
||||
|
||||
this._queue[MODULE_IDS].push(module);
|
||||
this._queue[METHOD_IDS].push(method);
|
||||
this._queue[MODULE_IDS].push(moduleID);
|
||||
this._queue[METHOD_IDS].push(methodID);
|
||||
|
||||
const preparedParams = this._serializeNativeParams ? JSON.stringify(params) : params;
|
||||
this._queue[PARAMS].push(preparedParams);
|
||||
if (__DEV__) {
|
||||
// Any params sent over the bridge should be encodable as JSON
|
||||
JSON.stringify(params);
|
||||
|
||||
// The params object should not be mutated after being queued
|
||||
deepFreezeAndThrowOnMutationInDev((params:any));
|
||||
}
|
||||
this._queue[PARAMS].push(params);
|
||||
|
||||
const now = new Date().getTime();
|
||||
if (global.nativeFlushQueueImmediate &&
|
||||
@@ -197,17 +188,34 @@ class MessageQueue {
|
||||
this._lastFlush = now;
|
||||
}
|
||||
Systrace.counterEvent('pending_js_to_native_queue', this._queue[0].length);
|
||||
if (__DEV__ && this.__spy && isFinite(module)) {
|
||||
if (__DEV__ && this.__spy && isFinite(moduleID)) {
|
||||
this.__spy(
|
||||
{ type: TO_NATIVE,
|
||||
module: this._remoteModuleTable[module],
|
||||
method: this._remoteMethodTable[module][method],
|
||||
module: this._remoteModuleTable[moduleID],
|
||||
method: this._remoteMethodTable[moduleID][methodID],
|
||||
args: params }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
__callFunction(module: string, method: string, args: any) {
|
||||
createDebugLookup(moduleID: number, name: string, methods: Array<string>) {
|
||||
if (__DEV__) {
|
||||
this._remoteModuleTable[moduleID] = name;
|
||||
this._remoteMethodTable[moduleID] = methods;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* "Private" methods
|
||||
*/
|
||||
|
||||
__callImmediates() {
|
||||
Systrace.beginEvent('JSTimersExecution.callImmediates()');
|
||||
guard(() => JSTimersExecution.callImmediates());
|
||||
Systrace.endEvent();
|
||||
}
|
||||
|
||||
__callFunction(module: string, method: string, args: Array<any>) {
|
||||
this._lastFlush = new Date().getTime();
|
||||
this._eventLoopStartTime = this._lastFlush;
|
||||
Systrace.beginEvent(`${module}.${method}()`);
|
||||
@@ -230,7 +238,7 @@ class MessageQueue {
|
||||
return result;
|
||||
}
|
||||
|
||||
__invokeCallback(cbID, args) {
|
||||
__invokeCallback(cbID: number, args: Array<any>) {
|
||||
this._lastFlush = new Date().getTime();
|
||||
this._eventLoopStartTime = this._lastFlush;
|
||||
const callback = this._callbacks[cbID];
|
||||
@@ -270,145 +278,6 @@ class MessageQueue {
|
||||
Systrace.endEvent();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Private helper methods
|
||||
*/
|
||||
|
||||
_genModules(remoteModules) {
|
||||
const modules = {};
|
||||
remoteModules.forEach((config, moduleID) => {
|
||||
// Initially this config will only contain the module name when running in JSC. The actual
|
||||
// configuration of the module will be lazily loaded (see NativeModules.js) and updated
|
||||
// through processModuleConfig.
|
||||
const info = this._genModule(config, moduleID);
|
||||
if (info) {
|
||||
modules[info.name] = info.module;
|
||||
}
|
||||
|
||||
if (__DEV__) {
|
||||
this._createDebugLookup(config, moduleID, this._remoteModuleTable, this._remoteMethodTable);
|
||||
}
|
||||
});
|
||||
return modules;
|
||||
}
|
||||
|
||||
_genModule(config, moduleID): ?Object {
|
||||
if (!config) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let moduleName, constants, methods, promiseMethods, syncMethods;
|
||||
if (moduleHasConstants(config)) {
|
||||
[moduleName, constants, methods, promiseMethods, syncMethods] = config;
|
||||
} else {
|
||||
[moduleName, methods, promiseMethods, syncMethods] = config;
|
||||
}
|
||||
|
||||
const module = {};
|
||||
methods && methods.forEach((methodName, methodID) => {
|
||||
const isPromise = promiseMethods && arrayContains(promiseMethods, methodID);
|
||||
const isSync = syncMethods && arrayContains(syncMethods, methodID);
|
||||
invariant(!isPromise || !isSync, 'Cannot have a method that is both async and a sync hook');
|
||||
const methodType = isPromise ? MethodTypes.promise :
|
||||
isSync ? MethodTypes.sync : MethodTypes.async;
|
||||
module[methodName] = this._genMethod(moduleID, methodID, methodType);
|
||||
});
|
||||
Object.assign(module, constants);
|
||||
|
||||
if (!constants && !methods && !promiseMethods) {
|
||||
module.moduleID = moduleID;
|
||||
}
|
||||
|
||||
return { name: moduleName, module };
|
||||
}
|
||||
|
||||
_genMethod(module, method, type) {
|
||||
let fn = null;
|
||||
const self = this;
|
||||
if (type === MethodTypes.promise) {
|
||||
fn = function(...args) {
|
||||
return new Promise((resolve, reject) => {
|
||||
self.__nativeCall(module, method, args,
|
||||
(data) => resolve(data),
|
||||
(errorData) => reject(createErrorFromErrorData(errorData)));
|
||||
});
|
||||
};
|
||||
} else if (type === MethodTypes.sync) {
|
||||
fn = function(...args) {
|
||||
return global.nativeCallSyncHook(module, method, args);
|
||||
};
|
||||
} else {
|
||||
fn = function(...args) {
|
||||
const lastArg = args.length > 0 ? args[args.length - 1] : null;
|
||||
const secondLastArg = args.length > 1 ? args[args.length - 2] : null;
|
||||
const hasSuccessCallback = typeof lastArg === 'function';
|
||||
const hasErrorCallback = typeof secondLastArg === 'function';
|
||||
hasErrorCallback && invariant(
|
||||
hasSuccessCallback,
|
||||
'Cannot have a non-function arg after a function arg.'
|
||||
);
|
||||
const onSuccess = hasSuccessCallback ? lastArg : null;
|
||||
const onFail = hasErrorCallback ? secondLastArg : null;
|
||||
const callbackCount = hasSuccessCallback + hasErrorCallback;
|
||||
args = args.slice(0, args.length - callbackCount);
|
||||
return self.__nativeCall(module, method, args, onFail, onSuccess);
|
||||
};
|
||||
}
|
||||
fn.type = type;
|
||||
return fn;
|
||||
}
|
||||
|
||||
_createDebugLookup(config, moduleID, moduleTable, methodTable) {
|
||||
if (!config) {
|
||||
return;
|
||||
}
|
||||
|
||||
let moduleName, methods;
|
||||
if (moduleHasConstants(config)) {
|
||||
[moduleName, , methods] = config;
|
||||
} else {
|
||||
[moduleName, methods] = config;
|
||||
}
|
||||
|
||||
moduleTable[moduleID] = moduleName;
|
||||
methodTable[moduleID] = Object.assign({}, methods);
|
||||
}
|
||||
}
|
||||
|
||||
function moduleHasConstants(moduleArray: Array<Object|Array<>>): boolean {
|
||||
return !Array.isArray(moduleArray[1]);
|
||||
}
|
||||
|
||||
function arrayContains<T>(array: Array<T>, value: T): boolean {
|
||||
return array.indexOf(value) !== -1;
|
||||
}
|
||||
|
||||
function createErrorFromErrorData(errorData: {message: string}): Error {
|
||||
const {
|
||||
message,
|
||||
...extraErrorInfo,
|
||||
} = errorData;
|
||||
const error = new Error(message);
|
||||
error.framesToPop = 1;
|
||||
return Object.assign(error, extraErrorInfo);
|
||||
}
|
||||
|
||||
function lazyProperty(target: Object, name: string, f: () => any) {
|
||||
Object.defineProperty(target, name, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get() {
|
||||
const value = f();
|
||||
Object.defineProperty(target, name, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
writeable: true,
|
||||
value: value,
|
||||
});
|
||||
return value;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = MessageQueue;
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
'use strict';
|
||||
|
||||
const BatchedBridge = require('BatchedBridge');
|
||||
const fbjsPerformanceNow = require('fbjs/lib/performanceNow');
|
||||
|
||||
const performanceNow = global.nativePerformanceNow || fbjsPerformanceNow;
|
||||
const performanceNow = global.nativePerformanceNow || require('fbjs/lib/performanceNow');
|
||||
|
||||
var timespans = {};
|
||||
var extras = {};
|
||||
|
||||
@@ -11,13 +11,15 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const Platform = require('Platform');
|
||||
const NativeModules = require('NativeModules');
|
||||
const { UIManager } = NativeModules;
|
||||
const Platform = require('Platform');
|
||||
|
||||
const defineLazyObjectProperty = require('defineLazyObjectProperty');
|
||||
const findNodeHandle = require('react/lib/findNodeHandle');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
|
||||
const { UIManager } = NativeModules;
|
||||
|
||||
invariant(UIManager, 'UIManager is undefined. The native module config is probably incorrect.');
|
||||
|
||||
const _takeSnapshot = UIManager.takeSnapshot;
|
||||
@@ -64,25 +66,13 @@ UIManager.takeSnapshot = async function(
|
||||
* namespace instead of UIManager, unlike Android.
|
||||
*/
|
||||
if (Platform.OS === 'ios') {
|
||||
// Copied from NativeModules
|
||||
function normalizePrefix(moduleName: string): string {
|
||||
return moduleName.replace(/^(RCT|RK)/, '');
|
||||
}
|
||||
|
||||
Object.keys(UIManager).forEach(viewName => {
|
||||
const viewConfig = UIManager[viewName];
|
||||
if (viewConfig.Manager) {
|
||||
let constants;
|
||||
/* $FlowFixMe - nice try. Flow doesn't like getters */
|
||||
Object.defineProperty(viewConfig, 'Constants', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
defineLazyObjectProperty(viewConfig, 'Constants', {
|
||||
get: () => {
|
||||
if (constants) {
|
||||
return constants;
|
||||
}
|
||||
constants = {};
|
||||
const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)];
|
||||
const viewManager = NativeModules[viewConfig.Manager];
|
||||
const constants = {};
|
||||
viewManager && Object.keys(viewManager).forEach(key => {
|
||||
const value = viewManager[key];
|
||||
if (typeof value !== 'function') {
|
||||
@@ -92,17 +82,10 @@ if (Platform.OS === 'ios') {
|
||||
return constants;
|
||||
},
|
||||
});
|
||||
let commands;
|
||||
/* $FlowFixMe - nice try. Flow doesn't like getters */
|
||||
Object.defineProperty(viewConfig, 'Commands', {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
defineLazyObjectProperty(viewConfig, 'Commands', {
|
||||
get: () => {
|
||||
if (commands) {
|
||||
return commands;
|
||||
}
|
||||
commands = {};
|
||||
const viewManager = NativeModules[normalizePrefix(viewConfig.Manager)];
|
||||
const viewManager = NativeModules[viewConfig.Manager];
|
||||
const commands = {};
|
||||
let index = 0;
|
||||
viewManager && Object.keys(viewManager).forEach(key => {
|
||||
const value = viewManager[key];
|
||||
@@ -115,6 +98,8 @@ if (Platform.OS === 'ios') {
|
||||
});
|
||||
}
|
||||
});
|
||||
} else if (Platform.OS === 'android' && UIManager.AndroidLazyViewManagersEnabled) {
|
||||
// TODO fill this out
|
||||
}
|
||||
|
||||
module.exports = UIManager;
|
||||
|
||||
+3
-4
@@ -6,7 +6,7 @@
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule MessageQueueTestModule1
|
||||
* @providesModule MessageQueueTestModule
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@@ -15,12 +15,11 @@
|
||||
* correctly dispatches to commonJS modules. The `testHook` is overriden by test
|
||||
* cases.
|
||||
*/
|
||||
var MessageQueueTestModule1 = {
|
||||
var MessageQueueTestModule = {
|
||||
testHook1: function() {
|
||||
},
|
||||
testHook2: function() {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = MessageQueueTestModule1;
|
||||
|
||||
module.exports = MessageQueueTestModule;
|
||||
@@ -9,12 +9,12 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const MessageQueueTestConfig = require('MessageQueueTestConfig');
|
||||
// const MessageQueueTestConfig = require('MessageQueueTestConfig');
|
||||
jest.unmock('MessageQueue');
|
||||
jest.unmock('defineLazyObjectProperty');
|
||||
|
||||
let MessageQueue;
|
||||
let MessageQueueTestModule1;
|
||||
let MessageQueueTestModule2;
|
||||
let MessageQueueTestModule;
|
||||
let queue;
|
||||
|
||||
const MODULE_IDS = 0;
|
||||
@@ -29,169 +29,59 @@ const assertQueue = (flushedQueue, index, moduleID, methodID, params) => {
|
||||
|
||||
// Important things to test:
|
||||
//
|
||||
// [x] Calling remote method on queue actually queues it up.
|
||||
//
|
||||
// [x] Both error and success callbacks are invoked.
|
||||
//
|
||||
// [x] When simulating an error callback from remote method, both error and
|
||||
// success callbacks are cleaned up.
|
||||
//
|
||||
// [x] Local modules can be invoked through the queue.
|
||||
//
|
||||
// [ ] Local modules that throw exceptions are gracefully caught. In that case
|
||||
// local callbacks stored by IDs are cleaned up.
|
||||
//
|
||||
// [ ] Remote invocation throws if not supplying an error callback.
|
||||
describe('MessageQueue', function() {
|
||||
beforeEach(function() {
|
||||
jest.resetModuleRegistry();
|
||||
MessageQueue = require('MessageQueue');
|
||||
MessageQueueTestModule1 = require('MessageQueueTestModule1');
|
||||
MessageQueueTestModule2 = require('MessageQueueTestModule2');
|
||||
queue = new MessageQueue(
|
||||
() => MessageQueueTestConfig
|
||||
);
|
||||
|
||||
MessageQueueTestModule = require('MessageQueueTestModule');
|
||||
queue = new MessageQueue();
|
||||
queue.registerCallableModule(
|
||||
'MessageQueueTestModule1',
|
||||
MessageQueueTestModule1
|
||||
);
|
||||
queue.registerCallableModule(
|
||||
'MessageQueueTestModule2',
|
||||
MessageQueueTestModule2
|
||||
'MessageQueueTestModule',
|
||||
MessageQueueTestModule
|
||||
);
|
||||
queue.createDebugLookup(0, 'MessageQueueTestModule',
|
||||
['testHook1', 'testHook2']);
|
||||
});
|
||||
|
||||
it('should enqueue native calls', () => {
|
||||
queue.__nativeCall(0, 1, [2]);
|
||||
queue.enqueueNativeCall(0, 1, [2]);
|
||||
const flushedQueue = queue.flushedQueue();
|
||||
assertQueue(flushedQueue, 0, 0, 1, [2]);
|
||||
});
|
||||
|
||||
it('should call a local function with the function name', () => {
|
||||
MessageQueueTestModule1.testHook2 = jasmine.createSpy();
|
||||
expect(MessageQueueTestModule1.testHook2.calls.count()).toEqual(0);
|
||||
queue.__callFunction('MessageQueueTestModule1', 'testHook2', [2]);
|
||||
expect(MessageQueueTestModule1.testHook2.calls.count()).toEqual(1);
|
||||
});
|
||||
|
||||
it('should generate native modules', () => {
|
||||
queue.RemoteModules.RemoteModule1.remoteMethod1('foo');
|
||||
const flushedQueue = queue.flushedQueue();
|
||||
assertQueue(flushedQueue, 0, 0, 0, ['foo']);
|
||||
MessageQueueTestModule.testHook2 = jasmine.createSpy();
|
||||
expect(MessageQueueTestModule.testHook2.calls.count()).toEqual(0);
|
||||
queue.__callFunction('MessageQueueTestModule', 'testHook2', [2]);
|
||||
expect(MessageQueueTestModule.testHook2.calls.count()).toEqual(1);
|
||||
});
|
||||
|
||||
it('should store callbacks', () => {
|
||||
queue.RemoteModules.RemoteModule1.remoteMethod2('foo', () => {}, () => {});
|
||||
queue.enqueueNativeCall(0, 1, ['foo'], null, null);
|
||||
const flushedQueue = queue.flushedQueue();
|
||||
assertQueue(flushedQueue, 0, 0, 1, ['foo', 0, 1]);
|
||||
assertQueue(flushedQueue, 0, 0, 1, ['foo']);
|
||||
});
|
||||
|
||||
it('should call the stored callback', () => {
|
||||
var done = false;
|
||||
queue.RemoteModules.RemoteModule1.remoteMethod1(() => { done = true; });
|
||||
let done = false;
|
||||
queue.enqueueNativeCall(0, 1, [], () => {}, () => { done = true; });
|
||||
queue.__invokeCallback(1);
|
||||
expect(done).toEqual(true);
|
||||
});
|
||||
|
||||
it('should throw when calling the same callback twice', () => {
|
||||
queue.RemoteModules.RemoteModule1.remoteMethod1(() => {});
|
||||
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
|
||||
queue.__invokeCallback(1);
|
||||
expect(() => queue.__invokeCallback(1)).toThrow();
|
||||
});
|
||||
|
||||
it('should throw when calling both success and failure callback', () => {
|
||||
queue.RemoteModules.RemoteModule1.remoteMethod1(() => {}, () => {});
|
||||
queue.enqueueNativeCall(0, 1, [], () => {}, () => {});
|
||||
queue.__invokeCallback(1);
|
||||
expect(() => queue.__invokeCallback(0)).toThrow();
|
||||
});
|
||||
|
||||
it('should make round trip and clear memory', function() {
|
||||
// Perform communication
|
||||
|
||||
// First we're going to call into this (overriden) test hook pretending to
|
||||
// be a remote module making a "local" invocation into JS.
|
||||
const onFail = jasmine.createSpy();
|
||||
const onSucc = jasmine.createSpy();
|
||||
MessageQueueTestModule1.testHook1 = function() {
|
||||
// Then inside of this local module, we're going to fire off a remote
|
||||
// request.
|
||||
queue.__nativeCall(
|
||||
0,
|
||||
0,
|
||||
Array.prototype.slice.apply(arguments),
|
||||
onFail,
|
||||
onSucc,
|
||||
);
|
||||
};
|
||||
|
||||
// The second test hook does the same thing as the first, but fires off a
|
||||
// remote request to a different remote module/method.
|
||||
MessageQueueTestModule1.testHook2 = function() {
|
||||
queue.__nativeCall(
|
||||
1,
|
||||
1,
|
||||
Array.prototype.slice.apply(arguments),
|
||||
onFail,
|
||||
onSucc,
|
||||
);
|
||||
};
|
||||
|
||||
/* MessageQueueTestModule1.testHook1 */
|
||||
queue.__callFunction('MessageQueueTestModule1', 'testHook1', ['paloAlto', 'menloPark']);
|
||||
/* MessageQueueTestModule1.testHook2 */
|
||||
queue.__callFunction('MessageQueueTestModule1', 'testHook2', ['mac', 'windows']);
|
||||
|
||||
// And how do we know that it executed those local modules correctly? Well,
|
||||
// these particular test method echo their arguments back to remote methods!
|
||||
|
||||
var resultingRemoteInvocations = queue.flushedQueue();
|
||||
// As always, the message queue has five fields
|
||||
expect(resultingRemoteInvocations.length).toBe(4);
|
||||
expect(resultingRemoteInvocations[0].length).toBe(2);
|
||||
expect(resultingRemoteInvocations[1].length).toBe(2);
|
||||
expect(resultingRemoteInvocations[2].length).toBe(2);
|
||||
expect(typeof resultingRemoteInvocations[3]).toEqual('number');
|
||||
|
||||
expect(resultingRemoteInvocations[0][0]).toBe(0); // `RemoteModule1`
|
||||
expect(resultingRemoteInvocations[1][0]).toBe(0); // `remoteMethod1`
|
||||
expect([ // the arguments
|
||||
resultingRemoteInvocations[2][0][0],
|
||||
resultingRemoteInvocations[2][0][1]
|
||||
]).toEqual(['paloAlto', 'menloPark']);
|
||||
// Callbacks ids are tacked onto the end of the remote arguments.
|
||||
var firstFailCBID = resultingRemoteInvocations[2][0][2];
|
||||
var firstSuccCBID = resultingRemoteInvocations[2][0][3];
|
||||
|
||||
expect(resultingRemoteInvocations[0][1]).toBe(1); // `RemoteModule2`
|
||||
expect(resultingRemoteInvocations[1][1]).toBe(1); // `remoteMethod2`
|
||||
expect([ // the arguments
|
||||
resultingRemoteInvocations[2][1][0],
|
||||
resultingRemoteInvocations[2][1][1]
|
||||
]).toEqual(['mac', 'windows']);
|
||||
var secondFailCBID = resultingRemoteInvocations[2][1][2];
|
||||
var secondSuccCBID = resultingRemoteInvocations[2][1][3];
|
||||
|
||||
// Trigger init
|
||||
queue.RemoteModules;
|
||||
// Handle the first remote invocation by signaling failure.
|
||||
// -------------------------------------------------------
|
||||
queue.__invokeCallback(firstFailCBID, ['firstFailure']);
|
||||
// The failure callback was already invoked, the success is no longer valid
|
||||
expect(function() {
|
||||
queue.__invokeCallback(firstSuccCBID, ['firstSucc']);
|
||||
}).toThrow();
|
||||
expect(onFail.calls.count()).toBe(1);
|
||||
expect(onSucc.calls.count()).toBe(0);
|
||||
|
||||
// Handle the second remote invocation by signaling success.
|
||||
// -------------------------------------------------------
|
||||
queue.__invokeCallback(secondSuccCBID, ['secondSucc']);
|
||||
// The success callback was already invoked, the fail cb is no longer valid
|
||||
expect(function() {
|
||||
queue.__invokeCallback(secondFailCBID, ['secondFail']);
|
||||
}).toThrow();
|
||||
expect(onFail.calls.count()).toBe(1);
|
||||
expect(onSucc.calls.count()).toBe(1);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
jest.unmock('buildStyleInterpolator');
|
||||
|
||||
var buildStyleInterpolator = require('buildStyleInterpolator');
|
||||
|
||||
var validateEmpty = function(interpolator, value, validator) {
|
||||
var emptyObject = {};
|
||||
var changed = interpolator(emptyObject, value);
|
||||
validator(emptyObject);
|
||||
expect(changed).toBe(true);
|
||||
changed = interpolator(emptyObject, value);
|
||||
expect(changed).toBe(false);
|
||||
};
|
||||
describe('buildStyleInterpolator', function() {
|
||||
it('should linearly interpolate without extrapolating', function() {
|
||||
var testAnim = {
|
||||
opacity: {
|
||||
from: 100,
|
||||
to: 200,
|
||||
min: 0,
|
||||
max: 1,
|
||||
type: 'linear',
|
||||
extrapolate: false,
|
||||
},
|
||||
left: {
|
||||
from: 200,
|
||||
to: 300,
|
||||
min: 0,
|
||||
max: 1,
|
||||
type: 'linear',
|
||||
extrapolate: false,
|
||||
},
|
||||
top: {
|
||||
type: 'constant',
|
||||
value: 23.5,
|
||||
},
|
||||
};
|
||||
var interpolator = buildStyleInterpolator(testAnim);
|
||||
validateEmpty(interpolator, 0, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 100,
|
||||
left: 200,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 1, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 200,
|
||||
left: 300,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, -0.1, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 100,
|
||||
left: 200,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 1.1, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 200,
|
||||
left: 300,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 0.5, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 150,
|
||||
left: 250,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
});
|
||||
it('should linearly interpolate with extrapolating', function() {
|
||||
var testAnim = {
|
||||
opacity: {
|
||||
from: 100,
|
||||
to: 200,
|
||||
min: 0,
|
||||
max: 1,
|
||||
type: 'linear',
|
||||
round: 1, // To make testing easier
|
||||
extrapolate: true,
|
||||
},
|
||||
left: {
|
||||
from: 200,
|
||||
to: 300,
|
||||
min: 0,
|
||||
max: 1,
|
||||
type: 'linear',
|
||||
round: 1, // To make testing easier
|
||||
extrapolate: true,
|
||||
},
|
||||
top: {
|
||||
type: 'constant',
|
||||
value: 23.5,
|
||||
},
|
||||
};
|
||||
var interpolator = buildStyleInterpolator(testAnim);
|
||||
validateEmpty(interpolator, 0, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 100,
|
||||
left: 200,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 1, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 200,
|
||||
left: 300,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, -0.1, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 90,
|
||||
left: 190,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 1.1, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 210,
|
||||
left: 310,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 0.5, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 150,
|
||||
left: 250,
|
||||
top: 23.5,
|
||||
});
|
||||
});
|
||||
});
|
||||
it('should round accordingly', function() {
|
||||
var testAnim = {
|
||||
opacity: {
|
||||
from: 0,
|
||||
to: 1,
|
||||
min: 0,
|
||||
max: 1,
|
||||
type: 'linear',
|
||||
round: 2, // As in one over two
|
||||
extrapolate: true,
|
||||
},
|
||||
};
|
||||
var interpolator = buildStyleInterpolator(testAnim);
|
||||
validateEmpty(interpolator, 0, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 0,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 0.5, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 0.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 0.4, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 0.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 0.26, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 0.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 0.74, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 0.5,
|
||||
});
|
||||
});
|
||||
validateEmpty(interpolator, 0.76, function(res) {
|
||||
expect(res).toEqual({
|
||||
opacity: 1.0,
|
||||
});
|
||||
});
|
||||
});
|
||||
it('should detect chnages correctly', function() {
|
||||
var testAnim = {
|
||||
opacity: {
|
||||
from: 0,
|
||||
to: 1,
|
||||
min: 0,
|
||||
max: 1,
|
||||
type: 'linear',
|
||||
round: 2, // As in one over two
|
||||
extrapolate: false,
|
||||
},
|
||||
};
|
||||
var interpolator = buildStyleInterpolator(testAnim);
|
||||
var obj = {};
|
||||
var res = interpolator(obj, 0);
|
||||
expect(obj).toEqual({
|
||||
opacity: 0,
|
||||
});
|
||||
expect(res).toBe(true);
|
||||
|
||||
res = interpolator(obj, 0);
|
||||
// No change detected
|
||||
expect(obj).toEqual({
|
||||
opacity: 0,
|
||||
});
|
||||
expect(res).toBe(false);
|
||||
|
||||
// No change detected
|
||||
res = interpolator(obj, 1);
|
||||
expect(obj).toEqual({
|
||||
opacity: 1,
|
||||
});
|
||||
expect(res).toBe(true);
|
||||
|
||||
// Still no change detected even when clipping
|
||||
res = interpolator(obj, 1);
|
||||
expect(obj).toEqual({
|
||||
opacity: 1,
|
||||
});
|
||||
expect(res).toBe(false);
|
||||
});
|
||||
|
||||
it('should step', function() {
|
||||
var testAnim = {
|
||||
opacity: {
|
||||
threshold: 13,
|
||||
from: 10,
|
||||
to: 20,
|
||||
type: 'step',
|
||||
},
|
||||
};
|
||||
var interpolator = buildStyleInterpolator(testAnim);
|
||||
var obj = {};
|
||||
var res = interpolator(obj, 0);
|
||||
expect(obj).toEqual({
|
||||
opacity: 10,
|
||||
});
|
||||
expect(res).toBe(true);
|
||||
|
||||
res = interpolator(obj, 0);
|
||||
// No change detected
|
||||
expect(obj).toEqual({
|
||||
opacity: 10,
|
||||
});
|
||||
expect(res).toBe(false);
|
||||
|
||||
// No change detected
|
||||
res = interpolator(obj, 10);
|
||||
expect(obj).toEqual({
|
||||
opacity: 10,
|
||||
});
|
||||
expect(res).toBe(false);
|
||||
|
||||
// No change detected
|
||||
res = interpolator(obj, 12);
|
||||
expect(obj).toEqual({
|
||||
opacity: 10,
|
||||
});
|
||||
expect(res).toBe(false);
|
||||
|
||||
// No change detected
|
||||
res = interpolator(obj, 13);
|
||||
expect(obj).toEqual({
|
||||
opacity: 20,
|
||||
});
|
||||
expect(res).toBe(true);
|
||||
|
||||
// No change detected
|
||||
res = interpolator(obj, 13.1);
|
||||
expect(obj).toEqual({
|
||||
opacity: 20,
|
||||
});
|
||||
expect(res).toBe(false);
|
||||
|
||||
// No change detected
|
||||
res = interpolator(obj, 25);
|
||||
expect(obj).toEqual({
|
||||
opacity: 20,
|
||||
});
|
||||
expect(res).toBe(false);
|
||||
});
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user