浏览代码

fix not update script issue for ios.index; clean up code style for demo;

iou90 6 年前
父节点
当前提交
5078a6946d
共有 6 个文件被更改,包括 7391 次插入257 次删除
  1. 8
    3
      autoHeightWebView/index.ios.js
  2. 18
    89
      demo/App.js
  3. 183
    53
      demo/ios/demo.xcodeproj/project.pbxproj
  4. 7150
    90
      demo/package-lock.json
  5. 21
    21
      demo/package.json
  6. 11
    1
      demo/yarn.lock

+ 8
- 3
autoHeightWebView/index.ios.js 查看文件

@@ -140,6 +140,12 @@ const styles = StyleSheet.create({
140 140
   }
141 141
 });
142 142
 
143
+const commonScript = `
144
+    updateHeight();
145
+    window.addEventListener('load', updateHeight);
146
+    window.addEventListener('resize', updateHeight);
147
+    `;
148
+
143 149
 const baseScript = `
144 150
     ;
145 151
     (function () {
@@ -158,6 +164,7 @@ const baseScript = `
158 164
                 window.location.hash = ++i;
159 165
             }
160 166
         }
167
+        ${commonScript}
161 168
         ${domMutationObserveScript}
162 169
     } ());
163 170
     `;
@@ -174,9 +181,7 @@ const iframeBaseScript = `
174 181
                 window.location.hash = ++i;
175 182
             }
176 183
         }
177
-        updateHeight();
178
-        window.addEventListener('load', updateHeight);
179
-        window.addEventListener('resize', updateHeight);
184
+        ${commonScript}
180 185
         ${domMutationObserveScript}
181 186
     } ());
182 187
     `;

+ 18
- 89
demo/App.js 查看文件

@@ -1,16 +1,8 @@
1
-'use strict'
1
+'use strict';
2 2
 
3
-import React, {
4
-  Component,
5
-} from 'react';
3
+import React, { Component } from 'react';
6 4
 
7
-import {
8
-  ScrollView,
9
-  StyleSheet,
10
-  Text,
11
-  TouchableOpacity,
12
-  View
13
-} from 'react-native';
5
+import { ScrollView, StyleSheet, Text, TouchableOpacity } from 'react-native';
14 6
 
15 7
 import AutoHeightWebView from 'react-native-autoheight-webview';
16 8
 
@@ -21,8 +13,6 @@ export default class Explorer extends Component {
21 13
     this.html1 = `Tags are great for describing the essence of your story in a single word or phrase, but stories are rarely about a single thing. If I pen a story about moving across the country to start a new job in a car with my husband, two cats, a dog, and a tarantula, I wouldn’t only tag the piece with “moving”. I’d also use the tags “pets”, “marriage”, “career change”, and “travel tips”.`;
22 14
     this.script0 = '';
23 15
     this.script1 = `document.body.style.background = 'cornflowerblue';`;
24
-    this.changeSource = this.changeSource.bind(this);
25
-    this.changeScript = this.changeScript.bind(this);
26 16
     this.state = {
27 17
       html: this.html0,
28 18
       script: this.script0,
@@ -30,20 +20,21 @@ export default class Explorer extends Component {
30 20
     };
31 21
   }
32 22
 
33
-  changeSource() {
23
+  changeSource = () => {
34 24
     this.setState(prevState => ({
35 25
       html: prevState.html === this.html0 ? this.html1 : this.html0
36 26
     }));
37
-  }
27
+  };
38 28
 
39
-  changeScript() {
29
+  changeScript = () => {
40 30
     this.changeSource();
41 31
     this.setState(prevState => ({
42 32
       script: prevState.script === this.script0 ? this.script1 : this.script0
43 33
     }));
44
-  }
34
+  };
45 35
 
46 36
   render() {
37
+    const { html, script, height } = this.state;
47 38
     return (
48 39
       <ScrollView
49 40
         style={{
@@ -52,38 +43,34 @@ export default class Explorer extends Component {
52 43
         contentContainerStyle={{
53 44
           justifyContent: 'center',
54 45
           alignItems: 'center'
55
-        }}>
46
+        }}
47
+      >
56 48
         <AutoHeightWebView
57 49
           onError={() => console.log('on error')}
58 50
           onLoad={() => console.log('on load')}
59 51
           onLoadStart={() => console.log('on load start')}
60 52
           onLoadEnd={() => console.log('on load end')}
61 53
           onShouldStartLoadWithRequest={result => {
62
-            console.log(result)
54
+            console.log(result);
63 55
             return true;
64 56
           }}
65 57
           onHeightUpdated={height => this.setState({ height })}
66
-          source={{ html: this.state.html }}
67
-          customScript={this.state.script} />
68
-        <TouchableOpacity
69
-          onPress={this.changeSource}
70
-          style={Styles.button}>
58
+          source={{ html }}
59
+          customScript={script}
60
+        />
61
+        <TouchableOpacity onPress={this.changeSource} style={styles.button}>
71 62
           <Text>change source</Text>
72 63
         </TouchableOpacity>
73
-        <TouchableOpacity
74
-          onPress={this.changeScript}
75
-          style={Styles.button}>
64
+        <TouchableOpacity onPress={this.changeScript} style={styles.button}>
76 65
           <Text>change script (have to change source to reload on android)</Text>
77 66
         </TouchableOpacity>
78
-        <Text style={{ padding: 5 }}>
79
-          {this.state.height}
80
-        </Text>
67
+        <Text style={{ padding: 5 }}>{height}</Text>
81 68
       </ScrollView>
82 69
     );
83 70
   }
84 71
 }
85 72
 
86
-const Styles = StyleSheet.create({
73
+const styles = StyleSheet.create({
87 74
   button: {
88 75
     marginTop: 15,
89 76
     backgroundColor: 'aliceblue',
@@ -91,61 +78,3 @@ const Styles = StyleSheet.create({
91 78
     padding: 5
92 79
   }
93 80
 });
94
-
95
-// /**
96
-//  * Sample React Native App
97
-//  * https://github.com/facebook/react-native
98
-//  * @flow
99
-//  */
100
-
101
-// import React, { Component } from 'react';
102
-// import {
103
-//   Platform,
104
-//   StyleSheet,
105
-//   Text,
106
-//   View
107
-// } from 'react-native';
108
-
109
-// const instructions = Platform.select({
110
-//   ios: 'Press Cmd+R to reload,\n' +
111
-//     'Cmd+D or shake for dev menu',
112
-//   android: 'Double tap R on your keyboard to reload,\n' +
113
-//     'Shake or press menu button for dev menu',
114
-// });
115
-
116
-// export default class App extends Component<{}> {
117
-//   render() {
118
-//     return (
119
-//       <View style={styles.container}>
120
-//         <Text style={styles.welcome}>
121
-//           Welcome to React Native!
122
-//         </Text>
123
-//         <Text style={styles.instructions}>
124
-//           To get started, edit App.js
125
-//         </Text>
126
-//         <Text style={styles.instructions}>
127
-//           {instructions}
128
-//         </Text>
129
-//       </View>
130
-//     );
131
-//   }
132
-// }
133
-
134
-// const styles = StyleSheet.create({
135
-//   container: {
136
-//     flex: 1,
137
-//     justifyContent: 'center',
138
-//     alignItems: 'center',
139
-//     backgroundColor: '#F5FCFF',
140
-//   },
141
-//   welcome: {
142
-//     fontSize: 20,
143
-//     textAlign: 'center',
144
-//     margin: 10,
145
-//   },
146
-//   instructions: {
147
-//     textAlign: 'center',
148
-//     color: '#333333',
149
-//     marginBottom: 5,
150
-//   },
151
-// });

+ 183
- 53
demo/ios/demo.xcodeproj/project.pbxproj 查看文件

@@ -5,6 +5,7 @@
5 5
 	};
6 6
 	objectVersion = 46;
7 7
 	objects = {
8
+
8 9
 /* Begin PBXBuildFile section */
9 10
 		00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
10 11
 		00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
@@ -33,10 +34,10 @@
33 34
 		2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */; };
34 35
 		2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };
35 36
 		2DCD954D1E0B4F2C00145EB5 /* demoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* demoTests.m */; };
37
+		4015A12E66A247F0B2F6AE09 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F6205ED3CE4F403ABCC50D34 /* libRCTActionSheet.a */; };
36 38
 		5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; };
37 39
 		832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
38 40
 		ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
39
-		4015A12E66A247F0B2F6AE09 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F6205ED3CE4F403ABCC50D34 /* libRCTActionSheet.a */; };
40 41
 /* End PBXBuildFile section */
41 42
 
42 43
 /* Begin PBXContainerItemProxy section */
@@ -131,6 +132,62 @@
131 132
 			remoteGlobalIDString = 3DBE0D0D1F3B181C0099AA32;
132 133
 			remoteInfo = "fishhook-tvOS";
133 134
 		};
135
+		376DEA652043F3BD000FE890 /* PBXContainerItemProxy */ = {
136
+			isa = PBXContainerItemProxy;
137
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
138
+			proxyType = 2;
139
+			remoteGlobalIDString = EBF21BDC1FC498900052F4D5;
140
+			remoteInfo = jsinspector;
141
+		};
142
+		376DEA672043F3BD000FE890 /* PBXContainerItemProxy */ = {
143
+			isa = PBXContainerItemProxy;
144
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
145
+			proxyType = 2;
146
+			remoteGlobalIDString = EBF21BFA1FC4989A0052F4D5;
147
+			remoteInfo = "jsinspector-tvOS";
148
+		};
149
+		376DEA692043F3BD000FE890 /* PBXContainerItemProxy */ = {
150
+			isa = PBXContainerItemProxy;
151
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
152
+			proxyType = 2;
153
+			remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7;
154
+			remoteInfo = "third-party";
155
+		};
156
+		376DEA6B2043F3BD000FE890 /* PBXContainerItemProxy */ = {
157
+			isa = PBXContainerItemProxy;
158
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
159
+			proxyType = 2;
160
+			remoteGlobalIDString = 3D383D3C1EBD27B6005632C8;
161
+			remoteInfo = "third-party-tvOS";
162
+		};
163
+		376DEA6D2043F3BD000FE890 /* PBXContainerItemProxy */ = {
164
+			isa = PBXContainerItemProxy;
165
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
166
+			proxyType = 2;
167
+			remoteGlobalIDString = 139D7E881E25C6D100323FB7;
168
+			remoteInfo = "double-conversion";
169
+		};
170
+		376DEA6F2043F3BD000FE890 /* PBXContainerItemProxy */ = {
171
+			isa = PBXContainerItemProxy;
172
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
173
+			proxyType = 2;
174
+			remoteGlobalIDString = 3D383D621EBD27B9005632C8;
175
+			remoteInfo = "double-conversion-tvOS";
176
+		};
177
+		376DEA712043F3BD000FE890 /* PBXContainerItemProxy */ = {
178
+			isa = PBXContainerItemProxy;
179
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
180
+			proxyType = 2;
181
+			remoteGlobalIDString = 9936F3131F5F2E4B0010BF04;
182
+			remoteInfo = privatedata;
183
+		};
184
+		376DEA732043F3BD000FE890 /* PBXContainerItemProxy */ = {
185
+			isa = PBXContainerItemProxy;
186
+			containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
187
+			proxyType = 2;
188
+			remoteGlobalIDString = 9936F32F1F5F2E5B0010BF04;
189
+			remoteInfo = "privatedata-tvOS";
190
+		};
134 191
 		3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = {
135 192
 			isa = PBXContainerItemProxy;
136 193
 			containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */;
@@ -286,8 +343,8 @@
286 343
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
287 344
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
288 345
 		ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
289
-		B22DCF12CF304549B28FD63C /* demo.xcodeproj */ = {isa = PBXFileReference; name = "demo.xcodeproj"; path = "../node_modules/react-native-autoheight-webview/demo/ios/demo.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
290
-		F6205ED3CE4F403ABCC50D34 /* libRCTActionSheet.a */ = {isa = PBXFileReference; name = "libRCTActionSheet.a"; path = "libRCTActionSheet.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
346
+		B22DCF12CF304549B28FD63C /* demo.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = demo.xcodeproj; path = "../node_modules/react-native-autoheight-webview/demo/ios/demo.xcodeproj"; sourceTree = "<group>"; };
347
+		F6205ED3CE4F403ABCC50D34 /* libRCTActionSheet.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTActionSheet.a; sourceTree = "<group>"; };
291 348
 /* End PBXFileReference section */
292 349
 
293 350
 /* Begin PBXFrameworksBuildPhase section */
@@ -442,13 +499,21 @@
442 499
 			isa = PBXGroup;
443 500
 			children = (
444 501
 				146834041AC3E56700842450 /* libReact.a */,
502
+				3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */,
445 503
 				3DAD3EA51DF850E9000B6D8A /* libyoga.a */,
446 504
 				3DAD3EA71DF850E9000B6D8A /* libyoga.a */,
447 505
 				3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */,
448 506
 				3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */,
449 507
 				3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */,
450 508
 				3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */,
451
-				3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */,
509
+				376DEA662043F3BD000FE890 /* libjsinspector.a */,
510
+				376DEA682043F3BD000FE890 /* libjsinspector-tvOS.a */,
511
+				376DEA6A2043F3BD000FE890 /* libthird-party.a */,
512
+				376DEA6C2043F3BD000FE890 /* libthird-party.a */,
513
+				376DEA6E2043F3BD000FE890 /* libdouble-conversion.a */,
514
+				376DEA702043F3BD000FE890 /* libdouble-conversion.a */,
515
+				376DEA722043F3BD000FE890 /* libprivatedata.a */,
516
+				376DEA742043F3BD000FE890 /* libprivatedata-tvOS.a */,
452 517
 			);
453 518
 			name = Products;
454 519
 			sourceTree = "<group>";
@@ -461,6 +526,14 @@
461 526
 			name = Frameworks;
462 527
 			sourceTree = "<group>";
463 528
 		};
529
+		376DEA3F2043F3BA000FE890 /* Recovered References */ = {
530
+			isa = PBXGroup;
531
+			children = (
532
+				F6205ED3CE4F403ABCC50D34 /* libRCTActionSheet.a */,
533
+			);
534
+			name = "Recovered References";
535
+			sourceTree = "<group>";
536
+		};
464 537
 		5E91572E1DD0AC6500FF2AA8 /* Products */ = {
465 538
 			isa = PBXGroup;
466 539
 			children = (
@@ -516,6 +589,7 @@
516 589
 				00E356EF1AD99517003FC87E /* demoTests */,
517 590
 				83CBBA001A601CBA00E9B192 /* Products */,
518 591
 				2D16E6871FA4F8E400B85C8A /* Frameworks */,
592
+				376DEA3F2043F3BA000FE890 /* Recovered References */,
519 593
 			);
520 594
 			indentWidth = 2;
521 595
 			sourceTree = "<group>";
@@ -790,6 +864,62 @@
790 864
 			remoteRef = 2D16E6851FA4F8DC00B85C8A /* PBXContainerItemProxy */;
791 865
 			sourceTree = BUILT_PRODUCTS_DIR;
792 866
 		};
867
+		376DEA662043F3BD000FE890 /* libjsinspector.a */ = {
868
+			isa = PBXReferenceProxy;
869
+			fileType = archive.ar;
870
+			path = libjsinspector.a;
871
+			remoteRef = 376DEA652043F3BD000FE890 /* PBXContainerItemProxy */;
872
+			sourceTree = BUILT_PRODUCTS_DIR;
873
+		};
874
+		376DEA682043F3BD000FE890 /* libjsinspector-tvOS.a */ = {
875
+			isa = PBXReferenceProxy;
876
+			fileType = archive.ar;
877
+			path = "libjsinspector-tvOS.a";
878
+			remoteRef = 376DEA672043F3BD000FE890 /* PBXContainerItemProxy */;
879
+			sourceTree = BUILT_PRODUCTS_DIR;
880
+		};
881
+		376DEA6A2043F3BD000FE890 /* libthird-party.a */ = {
882
+			isa = PBXReferenceProxy;
883
+			fileType = archive.ar;
884
+			path = "libthird-party.a";
885
+			remoteRef = 376DEA692043F3BD000FE890 /* PBXContainerItemProxy */;
886
+			sourceTree = BUILT_PRODUCTS_DIR;
887
+		};
888
+		376DEA6C2043F3BD000FE890 /* libthird-party.a */ = {
889
+			isa = PBXReferenceProxy;
890
+			fileType = archive.ar;
891
+			path = "libthird-party.a";
892
+			remoteRef = 376DEA6B2043F3BD000FE890 /* PBXContainerItemProxy */;
893
+			sourceTree = BUILT_PRODUCTS_DIR;
894
+		};
895
+		376DEA6E2043F3BD000FE890 /* libdouble-conversion.a */ = {
896
+			isa = PBXReferenceProxy;
897
+			fileType = archive.ar;
898
+			path = "libdouble-conversion.a";
899
+			remoteRef = 376DEA6D2043F3BD000FE890 /* PBXContainerItemProxy */;
900
+			sourceTree = BUILT_PRODUCTS_DIR;
901
+		};
902
+		376DEA702043F3BD000FE890 /* libdouble-conversion.a */ = {
903
+			isa = PBXReferenceProxy;
904
+			fileType = archive.ar;
905
+			path = "libdouble-conversion.a";
906
+			remoteRef = 376DEA6F2043F3BD000FE890 /* PBXContainerItemProxy */;
907
+			sourceTree = BUILT_PRODUCTS_DIR;
908
+		};
909
+		376DEA722043F3BD000FE890 /* libprivatedata.a */ = {
910
+			isa = PBXReferenceProxy;
911
+			fileType = archive.ar;
912
+			path = libprivatedata.a;
913
+			remoteRef = 376DEA712043F3BD000FE890 /* PBXContainerItemProxy */;
914
+			sourceTree = BUILT_PRODUCTS_DIR;
915
+		};
916
+		376DEA742043F3BD000FE890 /* libprivatedata-tvOS.a */ = {
917
+			isa = PBXReferenceProxy;
918
+			fileType = archive.ar;
919
+			path = "libprivatedata-tvOS.a";
920
+			remoteRef = 376DEA732043F3BD000FE890 /* PBXContainerItemProxy */;
921
+			sourceTree = BUILT_PRODUCTS_DIR;
922
+		};
793 923
 		3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = {
794 924
 			isa = PBXReferenceProxy;
795 925
 			fileType = archive.ar;
@@ -835,7 +965,7 @@
835 965
 		3DAD3EA31DF850E9000B6D8A /* libReact-tvOS.a */ = {
836 966
 			isa = PBXReferenceProxy;
837 967
 			fileType = archive.ar;
838
-			path = "libReact-tvOS.a";
968
+			path = libReact.a;
839 969
 			remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */;
840 970
 			sourceTree = BUILT_PRODUCTS_DIR;
841 971
 		};
@@ -1054,23 +1184,23 @@
1054 1184
 					"DEBUG=1",
1055 1185
 					"$(inherited)",
1056 1186
 				);
1187
+				HEADER_SEARCH_PATHS = (
1188
+					"$(inherited)",
1189
+					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1190
+				);
1057 1191
 				INFOPLIST_FILE = demoTests/Info.plist;
1058 1192
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1059 1193
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1194
+				LIBRARY_SEARCH_PATHS = (
1195
+					"$(inherited)",
1196
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1197
+				);
1060 1198
 				OTHER_LDFLAGS = (
1061 1199
 					"-ObjC",
1062 1200
 					"-lc++",
1063 1201
 				);
1064 1202
 				PRODUCT_NAME = "$(TARGET_NAME)";
1065 1203
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo.app/demo";
1066
-				LIBRARY_SEARCH_PATHS = (
1067
-					"$(inherited)",
1068
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1069
-				);
1070
-				HEADER_SEARCH_PATHS = (
1071
-					"$(inherited)",
1072
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1073
-				);
1074 1204
 			};
1075 1205
 			name = Debug;
1076 1206
 		};
@@ -1079,23 +1209,23 @@
1079 1209
 			buildSettings = {
1080 1210
 				BUNDLE_LOADER = "$(TEST_HOST)";
1081 1211
 				COPY_PHASE_STRIP = NO;
1212
+				HEADER_SEARCH_PATHS = (
1213
+					"$(inherited)",
1214
+					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1215
+				);
1082 1216
 				INFOPLIST_FILE = demoTests/Info.plist;
1083 1217
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
1084 1218
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1219
+				LIBRARY_SEARCH_PATHS = (
1220
+					"$(inherited)",
1221
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1222
+				);
1085 1223
 				OTHER_LDFLAGS = (
1086 1224
 					"-ObjC",
1087 1225
 					"-lc++",
1088 1226
 				);
1089 1227
 				PRODUCT_NAME = "$(TARGET_NAME)";
1090 1228
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo.app/demo";
1091
-				LIBRARY_SEARCH_PATHS = (
1092
-					"$(inherited)",
1093
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1094
-				);
1095
-				HEADER_SEARCH_PATHS = (
1096
-					"$(inherited)",
1097
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1098
-				);
1099 1229
 			};
1100 1230
 			name = Release;
1101 1231
 		};
@@ -1105,6 +1235,10 @@
1105 1235
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1106 1236
 				CURRENT_PROJECT_VERSION = 1;
1107 1237
 				DEAD_CODE_STRIPPING = NO;
1238
+				HEADER_SEARCH_PATHS = (
1239
+					"$(inherited)",
1240
+					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1241
+				);
1108 1242
 				INFOPLIST_FILE = demo/Info.plist;
1109 1243
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1110 1244
 				OTHER_LDFLAGS = (
@@ -1114,10 +1248,6 @@
1114 1248
 				);
1115 1249
 				PRODUCT_NAME = demo;
1116 1250
 				VERSIONING_SYSTEM = "apple-generic";
1117
-				HEADER_SEARCH_PATHS = (
1118
-					"$(inherited)",
1119
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1120
-				);
1121 1251
 			};
1122 1252
 			name = Debug;
1123 1253
 		};
@@ -1126,6 +1256,10 @@
1126 1256
 			buildSettings = {
1127 1257
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1128 1258
 				CURRENT_PROJECT_VERSION = 1;
1259
+				HEADER_SEARCH_PATHS = (
1260
+					"$(inherited)",
1261
+					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1262
+				);
1129 1263
 				INFOPLIST_FILE = demo/Info.plist;
1130 1264
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1131 1265
 				OTHER_LDFLAGS = (
@@ -1135,10 +1269,6 @@
1135 1269
 				);
1136 1270
 				PRODUCT_NAME = demo;
1137 1271
 				VERSIONING_SYSTEM = "apple-generic";
1138
-				HEADER_SEARCH_PATHS = (
1139
-					"$(inherited)",
1140
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1141
-				);
1142 1272
 			};
1143 1273
 			name = Release;
1144 1274
 		};
@@ -1154,8 +1284,16 @@
1154 1284
 				DEBUG_INFORMATION_FORMAT = dwarf;
1155 1285
 				ENABLE_TESTABILITY = YES;
1156 1286
 				GCC_NO_COMMON_BLOCKS = YES;
1287
+				HEADER_SEARCH_PATHS = (
1288
+					"$(inherited)",
1289
+					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1290
+				);
1157 1291
 				INFOPLIST_FILE = "demo-tvOS/Info.plist";
1158 1292
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1293
+				LIBRARY_SEARCH_PATHS = (
1294
+					"$(inherited)",
1295
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1296
+				);
1159 1297
 				OTHER_LDFLAGS = (
1160 1298
 					"-ObjC",
1161 1299
 					"-lc++",
@@ -1165,14 +1303,6 @@
1165 1303
 				SDKROOT = appletvos;
1166 1304
 				TARGETED_DEVICE_FAMILY = 3;
1167 1305
 				TVOS_DEPLOYMENT_TARGET = 9.2;
1168
-				LIBRARY_SEARCH_PATHS = (
1169
-					"$(inherited)",
1170
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1171
-				);
1172
-				HEADER_SEARCH_PATHS = (
1173
-					"$(inherited)",
1174
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1175
-				);
1176 1306
 			};
1177 1307
 			name = Debug;
1178 1308
 		};
@@ -1188,8 +1318,16 @@
1188 1318
 				COPY_PHASE_STRIP = NO;
1189 1319
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
1190 1320
 				GCC_NO_COMMON_BLOCKS = YES;
1321
+				HEADER_SEARCH_PATHS = (
1322
+					"$(inherited)",
1323
+					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1324
+				);
1191 1325
 				INFOPLIST_FILE = "demo-tvOS/Info.plist";
1192 1326
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
1327
+				LIBRARY_SEARCH_PATHS = (
1328
+					"$(inherited)",
1329
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1330
+				);
1193 1331
 				OTHER_LDFLAGS = (
1194 1332
 					"-ObjC",
1195 1333
 					"-lc++",
@@ -1199,14 +1337,6 @@
1199 1337
 				SDKROOT = appletvos;
1200 1338
 				TARGETED_DEVICE_FAMILY = 3;
1201 1339
 				TVOS_DEPLOYMENT_TARGET = 9.2;
1202
-				LIBRARY_SEARCH_PATHS = (
1203
-					"$(inherited)",
1204
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1205
-				);
1206
-				HEADER_SEARCH_PATHS = (
1207
-					"$(inherited)",
1208
-					"$(SRCROOT)/../node_modules/react-native-autoheight-webview/demo/ios/demo",
1209
-				);
1210 1340
 			};
1211 1341
 			name = Release;
1212 1342
 		};
@@ -1223,15 +1353,15 @@
1223 1353
 				GCC_NO_COMMON_BLOCKS = YES;
1224 1354
 				INFOPLIST_FILE = "demo-tvOSTests/Info.plist";
1225 1355
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1356
+				LIBRARY_SEARCH_PATHS = (
1357
+					"$(inherited)",
1358
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1359
+				);
1226 1360
 				PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.demo-tvOSTests";
1227 1361
 				PRODUCT_NAME = "$(TARGET_NAME)";
1228 1362
 				SDKROOT = appletvos;
1229 1363
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo-tvOS.app/demo-tvOS";
1230 1364
 				TVOS_DEPLOYMENT_TARGET = 10.1;
1231
-				LIBRARY_SEARCH_PATHS = (
1232
-					"$(inherited)",
1233
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1234
-				);
1235 1365
 			};
1236 1366
 			name = Debug;
1237 1367
 		};
@@ -1248,15 +1378,15 @@
1248 1378
 				GCC_NO_COMMON_BLOCKS = YES;
1249 1379
 				INFOPLIST_FILE = "demo-tvOSTests/Info.plist";
1250 1380
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1381
+				LIBRARY_SEARCH_PATHS = (
1382
+					"$(inherited)",
1383
+					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1384
+				);
1251 1385
 				PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.demo-tvOSTests";
1252 1386
 				PRODUCT_NAME = "$(TARGET_NAME)";
1253 1387
 				SDKROOT = appletvos;
1254 1388
 				TEST_HOST = "$(BUILT_PRODUCTS_DIR)/demo-tvOS.app/demo-tvOS";
1255 1389
 				TVOS_DEPLOYMENT_TARGET = 10.1;
1256
-				LIBRARY_SEARCH_PATHS = (
1257
-					"$(inherited)",
1258
-					"\"$(SRCROOT)/$(TARGET_NAME)\"",
1259
-				);
1260 1390
 			};
1261 1391
 			name = Release;
1262 1392
 		};

+ 7150
- 90
demo/package-lock.json
文件差异内容过多而无法显示
查看文件


+ 21
- 21
demo/package.json 查看文件

@@ -1,23 +1,23 @@
1 1
 {
2
-	"name": "demo",
3
-	"version": "0.0.1",
4
-	"private": true,
5
-	"scripts": {
6
-		"start": "node node_modules/react-native/local-cli/cli.js start",
7
-		"test": "jest"
8
-	},
9
-	"dependencies": {
10
-		"react": "16.2.0",
11
-		"react-native": "0.53.3",
12
-		"react-native-autoheight-webview": "file:.."
13
-	},
14
-	"devDependencies": {
15
-		"babel-jest": "21.2.0",
16
-		"babel-preset-react-native": "4.0.0",
17
-		"jest": "21.2.1",
18
-		"react-test-renderer": "16.0.0"
19
-	},
20
-	"jest": {
21
-		"preset": "react-native"
22
-	}
2
+  "name": "demo",
3
+  "version": "0.0.1",
4
+  "private": true,
5
+  "scripts": {
6
+    "start": "node node_modules/react-native/local-cli/cli.js start",
7
+    "test": "jest"
8
+  },
9
+  "dependencies": {
10
+    "react": "16.2.0",
11
+    "react-native": "0.53.3",
12
+    "react-native-autoheight-webview": "../"
13
+  },
14
+  "devDependencies": {
15
+    "babel-jest": "21.2.0",
16
+    "babel-preset-react-native": "4.0.0",
17
+    "jest": "21.2.1",
18
+    "react-test-renderer": "16.0.0"
19
+  },
20
+  "jest": {
21
+    "preset": "react-native"
22
+  }
23 23
 }

+ 11
- 1
demo/yarn.lock 查看文件

@@ -1959,6 +1959,10 @@ image-size@^0.6.0:
1959 1959
   version "0.6.1"
1960 1960
   resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.6.1.tgz#98122a562d59dcc097ef1b2c8191866eb8f5d663"
1961 1961
 
1962
+immutable@^3.8.1:
1963
+  version "3.8.2"
1964
+  resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
1965
+
1962 1966
 imurmurhash@^0.1.4:
1963 1967
   version "0.1.4"
1964 1968
   resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
@@ -3341,7 +3345,7 @@ promise@^7.1.1:
3341 3345
   dependencies:
3342 3346
     asap "~2.0.3"
3343 3347
 
3344
-prop-types@^15.5.8, prop-types@^15.6.0:
3348
+prop-types@^15.5.10, prop-types@^15.5.8, prop-types@^15.6.0:
3345 3349
   version "15.6.0"
3346 3350
   resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.0.tgz#ceaf083022fc46b4a35f69e13ef75aed0d639856"
3347 3351
   dependencies:
@@ -3420,6 +3424,12 @@ react-devtools-core@3.0.0:
3420 3424
     shell-quote "^1.6.1"
3421 3425
     ws "^2.0.3"
3422 3426
 
3427
+react-native-autoheight-webview@../:
3428
+  version "0.4.0"
3429
+  dependencies:
3430
+    immutable "^3.8.1"
3431
+    prop-types "^15.5.10"
3432
+
3423 3433
 react-native@0.53.3:
3424 3434
   version "0.53.3"
3425 3435
   resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.53.3.tgz#930d1de5d68866f32a4b55112fc0228e29784e8f"