├── .babelrc ├── .buckconfig ├── .gitattributes ├── .gitignore ├── App.tsx ├── LICENSE ├── README.md ├── __tests__ └── App.js ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── linguabrowse │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios ├── Podfile ├── Podfile.lock ├── linguabrowse.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── linguabrowse.xcscheme ├── linguabrowse.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── linguabrowse │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ └── LaunchScreen.xib │ ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Info.plist │ └── main.m ├── package.json ├── src ├── browser │ ├── BrowserViewController.tsx │ ├── bothBars │ │ ├── BarButtons.tsx │ │ ├── BarConfig.ts │ │ ├── ToolbarButton.tsx │ │ └── barSpring.ts │ ├── browserConfig.tsx │ ├── footer │ │ ├── Footer.tsx │ │ └── TabToolbar.tsx │ ├── header │ │ ├── AutocompleteTextField.tsx │ │ ├── GradientProgressBar.tsx │ │ ├── Header.tsx │ │ ├── PrivacyIndicatorView.tsx │ │ ├── RetractibleHeader.tsx │ │ ├── TabLocationView.tsx │ │ ├── TopTabsContainer.tsx │ │ └── URLBarView.tsx │ └── webView │ │ ├── BarAwareWebView.tsx │ │ └── WebViewBackdrop.tsx ├── store │ ├── navigationState.ts │ ├── rootReducer.ts │ ├── store.ts │ └── uiState.ts └── utils │ └── urlBarTextHandling.ts ├── tsconfig.build.json ├── tsconfig.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["module:metro-react-native-babel-preset"] 3 | } 4 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # Cocoapods 59 | ios/Pods/* 60 | 61 | # Build 62 | /dist -------------------------------------------------------------------------------- /App.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Provider } from 'react-redux'; 3 | import { store } from './src/store/store'; 4 | import { BrowserViewControllerConnected } from "./src/browser/BrowserViewController"; 5 | import { SafeAreaProvider } from "react-native-safe-area-context"; 6 | 7 | interface Props { 8 | } 9 | 10 | interface State { 11 | } 12 | 13 | class AppContainer extends React.Component { 14 | render(){ 15 | const { } = this.props; 16 | 17 | return ( 18 | 19 | 20 | 21 | 22 | 23 | ); 24 | } 25 | } 26 | 27 | export default AppContainer; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 Jamie Birch. All rights reserved. 2 | 3 | Mozilla Public License Version 2.0 4 | ================================== 5 | 6 | 1. Definitions 7 | -------------- 8 | 9 | 1.1. "Contributor" 10 | means each individual or legal entity that creates, contributes to 11 | the creation of, or owns Covered Software. 12 | 13 | 1.2. "Contributor Version" 14 | means the combination of the Contributions of others (if any) used 15 | by a Contributor and that particular Contributor's Contribution. 16 | 17 | 1.3. "Contribution" 18 | means Covered Software of a particular Contributor. 19 | 20 | 1.4. "Covered Software" 21 | means Source Code Form to which the initial Contributor has attached 22 | the notice in Exhibit A, the Executable Form of such Source Code 23 | Form, and Modifications of such Source Code Form, in each case 24 | including portions thereof. 25 | 26 | 1.5. "Incompatible With Secondary Licenses" 27 | means 28 | 29 | (a) that the initial Contributor has attached the notice described 30 | in Exhibit B to the Covered Software; or 31 | 32 | (b) that the Covered Software was made available under the terms of 33 | version 1.1 or earlier of the License, but not also under the 34 | terms of a Secondary License. 35 | 36 | 1.6. "Executable Form" 37 | means any form of the work other than Source Code Form. 38 | 39 | 1.7. "Larger Work" 40 | means a work that combines Covered Software with other material, in 41 | a separate file or files, that is not Covered Software. 42 | 43 | 1.8. "License" 44 | means this document. 45 | 46 | 1.9. "Licensable" 47 | means having the right to grant, to the maximum extent possible, 48 | whether at the time of the initial grant or subsequently, any and 49 | all of the rights conveyed by this License. 50 | 51 | 1.10. "Modifications" 52 | means any of the following: 53 | 54 | (a) any file in Source Code Form that results from an addition to, 55 | deletion from, or modification of the contents of Covered 56 | Software; or 57 | 58 | (b) any new file in Source Code Form that contains any Covered 59 | Software. 60 | 61 | 1.11. "Patent Claims" of a Contributor 62 | means any patent claim(s), including without limitation, method, 63 | process, and apparatus claims, in any patent Licensable by such 64 | Contributor that would be infringed, but for the grant of the 65 | License, by the making, using, selling, offering for sale, having 66 | made, import, or transfer of either its Contributions or its 67 | Contributor Version. 68 | 69 | 1.12. "Secondary License" 70 | means either the GNU General Public License, Version 2.0, the GNU 71 | Lesser General Public License, Version 2.1, the GNU Affero General 72 | Public License, Version 3.0, or any later versions of those 73 | licenses. 74 | 75 | 1.13. "Source Code Form" 76 | means the form of the work preferred for making modifications. 77 | 78 | 1.14. "You" (or "Your") 79 | means an individual or a legal entity exercising rights under this 80 | License. For legal entities, "You" includes any entity that 81 | controls, is controlled by, or is under common control with You. For 82 | purposes of this definition, "control" means (a) the power, direct 83 | or indirect, to cause the direction or management of such entity, 84 | whether by contract or otherwise, or (b) ownership of more than 85 | fifty percent (50%) of the outstanding shares or beneficial 86 | ownership of such entity. 87 | 88 | 2. License Grants and Conditions 89 | -------------------------------- 90 | 91 | 2.1. Grants 92 | 93 | Each Contributor hereby grants You a world-wide, royalty-free, 94 | non-exclusive license: 95 | 96 | (a) under intellectual property rights (other than patent or trademark) 97 | Licensable by such Contributor to use, reproduce, make available, 98 | modify, display, perform, distribute, and otherwise exploit its 99 | Contributions, either on an unmodified basis, with Modifications, or 100 | as part of a Larger Work; and 101 | 102 | (b) under Patent Claims of such Contributor to make, use, sell, offer 103 | for sale, have made, import, and otherwise transfer either its 104 | Contributions or its Contributor Version. 105 | 106 | 2.2. Effective Date 107 | 108 | The licenses granted in Section 2.1 with respect to any Contribution 109 | become effective for each Contribution on the date the Contributor first 110 | distributes such Contribution. 111 | 112 | 2.3. Limitations on Grant Scope 113 | 114 | The licenses granted in this Section 2 are the only rights granted under 115 | this License. No additional rights or licenses will be implied from the 116 | distribution or licensing of Covered Software under this License. 117 | Notwithstanding Section 2.1(b) above, no patent license is granted by a 118 | Contributor: 119 | 120 | (a) for any code that a Contributor has removed from Covered Software; 121 | or 122 | 123 | (b) for infringements caused by: (i) Your and any other third party's 124 | modifications of Covered Software, or (ii) the combination of its 125 | Contributions with other software (except as part of its Contributor 126 | Version); or 127 | 128 | (c) under Patent Claims infringed by Covered Software in the absence of 129 | its Contributions. 130 | 131 | This License does not grant any rights in the trademarks, service marks, 132 | or logos of any Contributor (except as may be necessary to comply with 133 | the notice requirements in Section 3.4). 134 | 135 | 2.4. Subsequent Licenses 136 | 137 | No Contributor makes additional grants as a result of Your choice to 138 | distribute the Covered Software under a subsequent version of this 139 | License (see Section 10.2) or under the terms of a Secondary License (if 140 | permitted under the terms of Section 3.3). 141 | 142 | 2.5. Representation 143 | 144 | Each Contributor represents that the Contributor believes its 145 | Contributions are its original creation(s) or it has sufficient rights 146 | to grant the rights to its Contributions conveyed by this License. 147 | 148 | 2.6. Fair Use 149 | 150 | This License is not intended to limit any rights You have under 151 | applicable copyright doctrines of fair use, fair dealing, or other 152 | equivalents. 153 | 154 | 2.7. Conditions 155 | 156 | Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted 157 | in Section 2.1. 158 | 159 | 3. Responsibilities 160 | ------------------- 161 | 162 | 3.1. Distribution of Source Form 163 | 164 | All distribution of Covered Software in Source Code Form, including any 165 | Modifications that You create or to which You contribute, must be under 166 | the terms of this License. You must inform recipients that the Source 167 | Code Form of the Covered Software is governed by the terms of this 168 | License, and how they can obtain a copy of this License. You may not 169 | attempt to alter or restrict the recipients' rights in the Source Code 170 | Form. 171 | 172 | 3.2. Distribution of Executable Form 173 | 174 | If You distribute Covered Software in Executable Form then: 175 | 176 | (a) such Covered Software must also be made available in Source Code 177 | Form, as described in Section 3.1, and You must inform recipients of 178 | the Executable Form how they can obtain a copy of such Source Code 179 | Form by reasonable means in a timely manner, at a charge no more 180 | than the cost of distribution to the recipient; and 181 | 182 | (b) You may distribute such Executable Form under the terms of this 183 | License, or sublicense it under different terms, provided that the 184 | license for the Executable Form does not attempt to limit or alter 185 | the recipients' rights in the Source Code Form under this License. 186 | 187 | 3.3. Distribution of a Larger Work 188 | 189 | You may create and distribute a Larger Work under terms of Your choice, 190 | provided that You also comply with the requirements of this License for 191 | the Covered Software. If the Larger Work is a combination of Covered 192 | Software with a work governed by one or more Secondary Licenses, and the 193 | Covered Software is not Incompatible With Secondary Licenses, this 194 | License permits You to additionally distribute such Covered Software 195 | under the terms of such Secondary License(s), so that the recipient of 196 | the Larger Work may, at their option, further distribute the Covered 197 | Software under the terms of either this License or such Secondary 198 | License(s). 199 | 200 | 3.4. Notices 201 | 202 | You may not remove or alter the substance of any license notices 203 | (including copyright notices, patent notices, disclaimers of warranty, 204 | or limitations of liability) contained within the Source Code Form of 205 | the Covered Software, except that You may alter any license notices to 206 | the extent required to remedy known factual inaccuracies. 207 | 208 | 3.5. Application of Additional Terms 209 | 210 | You may choose to offer, and to charge a fee for, warranty, support, 211 | indemnity or liability obligations to one or more recipients of Covered 212 | Software. However, You may do so only on Your own behalf, and not on 213 | behalf of any Contributor. You must make it absolutely clear that any 214 | such warranty, support, indemnity, or liability obligation is offered by 215 | You alone, and You hereby agree to indemnify every Contributor for any 216 | liability incurred by such Contributor as a result of warranty, support, 217 | indemnity or liability terms You offer. You may include additional 218 | disclaimers of warranty and limitations of liability specific to any 219 | jurisdiction. 220 | 221 | 4. Inability to Comply Due to Statute or Regulation 222 | --------------------------------------------------- 223 | 224 | If it is impossible for You to comply with any of the terms of this 225 | License with respect to some or all of the Covered Software due to 226 | statute, judicial order, or regulation then You must: (a) comply with 227 | the terms of this License to the maximum extent possible; and (b) 228 | describe the limitations and the code they affect. Such description must 229 | be placed in a text file included with all distributions of the Covered 230 | Software under this License. Except to the extent prohibited by statute 231 | or regulation, such description must be sufficiently detailed for a 232 | recipient of ordinary skill to be able to understand it. 233 | 234 | 5. Termination 235 | -------------- 236 | 237 | 5.1. The rights granted under this License will terminate automatically 238 | if You fail to comply with any of its terms. However, if You become 239 | compliant, then the rights granted under this License from a particular 240 | Contributor are reinstated (a) provisionally, unless and until such 241 | Contributor explicitly and finally terminates Your grants, and (b) on an 242 | ongoing basis, if such Contributor fails to notify You of the 243 | non-compliance by some reasonable means prior to 60 days after You have 244 | come back into compliance. Moreover, Your grants from a particular 245 | Contributor are reinstated on an ongoing basis if such Contributor 246 | notifies You of the non-compliance by some reasonable means, this is the 247 | first time You have received notice of non-compliance with this License 248 | from such Contributor, and You become compliant prior to 30 days after 249 | Your receipt of the notice. 250 | 251 | 5.2. If You initiate litigation against any entity by asserting a patent 252 | infringement claim (excluding declaratory judgment actions, 253 | counter-claims, and cross-claims) alleging that a Contributor Version 254 | directly or indirectly infringes any patent, then the rights granted to 255 | You by any and all Contributors for the Covered Software under Section 256 | 2.1 of this License shall terminate. 257 | 258 | 5.3. In the event of termination under Sections 5.1 or 5.2 above, all 259 | end user license agreements (excluding distributors and resellers) which 260 | have been validly granted by You or Your distributors under this License 261 | prior to termination shall survive termination. 262 | 263 | ************************************************************************ 264 | * * 265 | * 6. Disclaimer of Warranty * 266 | * ------------------------- * 267 | * * 268 | * Covered Software is provided under this License on an "as is" * 269 | * basis, without warranty of any kind, either expressed, implied, or * 270 | * statutory, including, without limitation, warranties that the * 271 | * Covered Software is free of defects, merchantable, fit for a * 272 | * particular purpose or non-infringing. The entire risk as to the * 273 | * quality and performance of the Covered Software is with You. * 274 | * Should any Covered Software prove defective in any respect, You * 275 | * (not any Contributor) assume the cost of any necessary servicing, * 276 | * repair, or correction. This disclaimer of warranty constitutes an * 277 | * essential part of this License. No use of any Covered Software is * 278 | * authorized under this License except under this disclaimer. * 279 | * * 280 | ************************************************************************ 281 | 282 | ************************************************************************ 283 | * * 284 | * 7. Limitation of Liability * 285 | * -------------------------- * 286 | * * 287 | * Under no circumstances and under no legal theory, whether tort * 288 | * (including negligence), contract, or otherwise, shall any * 289 | * Contributor, or anyone who distributes Covered Software as * 290 | * permitted above, be liable to You for any direct, indirect, * 291 | * special, incidental, or consequential damages of any character * 292 | * including, without limitation, damages for lost profits, loss of * 293 | * goodwill, work stoppage, computer failure or malfunction, or any * 294 | * and all other commercial damages or losses, even if such party * 295 | * shall have been informed of the possibility of such damages. This * 296 | * limitation of liability shall not apply to liability for death or * 297 | * personal injury resulting from such party's negligence to the * 298 | * extent applicable law prohibits such limitation. Some * 299 | * jurisdictions do not allow the exclusion or limitation of * 300 | * incidental or consequential damages, so this exclusion and * 301 | * limitation may not apply to You. * 302 | * * 303 | ************************************************************************ 304 | 305 | 8. Litigation 306 | ------------- 307 | 308 | Any litigation relating to this License may be brought only in the 309 | courts of a jurisdiction where the defendant maintains its principal 310 | place of business and such litigation shall be governed by laws of that 311 | jurisdiction, without reference to its conflict-of-law provisions. 312 | Nothing in this Section shall prevent a party's ability to bring 313 | cross-claims or counter-claims. 314 | 315 | 9. Miscellaneous 316 | ---------------- 317 | 318 | This License represents the complete agreement concerning the subject 319 | matter hereof. If any provision of this License is held to be 320 | unenforceable, such provision shall be reformed only to the extent 321 | necessary to make it enforceable. Any law or regulation which provides 322 | that the language of a contract shall be construed against the drafter 323 | shall not be used to construe this License against a Contributor. 324 | 325 | 10. Versions of the License 326 | --------------------------- 327 | 328 | 10.1. New Versions 329 | 330 | Mozilla Foundation is the license steward. Except as provided in Section 331 | 10.3, no one other than the license steward has the right to modify or 332 | publish new versions of this License. Each version will be given a 333 | distinguishing version number. 334 | 335 | 10.2. Effect of New Versions 336 | 337 | You may distribute the Covered Software under the terms of the version 338 | of the License under which You originally received the Covered Software, 339 | or under the terms of any subsequent version published by the license 340 | steward. 341 | 342 | 10.3. Modified Versions 343 | 344 | If you create software not governed by this License, and you want to 345 | create a new license for such software, you may create and use a 346 | modified version of this License if you rename the license and remove 347 | any references to the name of the license steward (except to note that 348 | such modified license differs from this License). 349 | 350 | 10.4. Distributing Source Code Form that is Incompatible With Secondary 351 | Licenses 352 | 353 | If You choose to distribute Source Code Form that is Incompatible With 354 | Secondary Licenses under the terms of this version of the License, the 355 | notice described in Exhibit B of this License must be attached. 356 | 357 | Exhibit A - Source Code Form License Notice 358 | ------------------------------------------- 359 | 360 | This Source Code Form is subject to the terms of the Mozilla Public 361 | License, v. 2.0. If a copy of the MPL was not distributed with this 362 | file, You can obtain one at http://mozilla.org/MPL/2.0/. 363 | 364 | If it is not possible or desirable to put the notice in a particular 365 | file, then You may include the notice in a location (such as a LICENSE 366 | file in a relevant directory) where a recipient would be likely to look 367 | for such a notice. 368 | 369 | You may add additional accurate notices of copyright ownership. 370 | 371 | Exhibit B - "Incompatible With Secondary Licenses" Notice 372 | --------------------------------------------------------- 373 | 374 | This Source Code Form is "Incompatible With Secondary Licenses", as 375 | defined by the Mozilla Public License, v. 2.0. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Web Browser App 2 | 3 | An open-source, extensible cross-platform (mobile and desktop) web browser made in React Native! 4 | 5 | ## Motivation 6 | 7 | My masochistic hobby project is building a web browser for browsing foreign-language websites: [LinguaBrowse iOS](https://apps.apple.com/us/app/linguabrowse/id1281350165?ls=1). It is a basic minimal clone of iOS Safari that does a lot of Natural Language Processing and JS injection, manages a vocabulary list, and handles In-App Purchases. It was written imperatively in Swift, which ultimately brought my productivity to a standstill, as I found UIs much harder to build in UIKit than in React, and state much harder to manage in an imperative coding style. 8 | 9 | Last year I tried to address these issues [by porting LinguaBrowse to React Native macOS](https://apps.apple.com/us/app/linguabrowse/id1422884180), but ultimately gave up developing it due to the premature state of React Native macOS: I was unable to code-share with iOS; had to make most of the UI on the native side (with lots of message-passing over the bridge) due to incomplete React components; and hot-reloading didn't work. But it was fun and showed great promise. 10 | 11 | So here I am foolishly building the same browser for the third time, and this time the landscape of React Native and cross-platform app development is looking more exciting than ever: 12 | 13 | * React Native has Fast Refresh and auto-linking; 14 | * Apple have produced Catalyst (meaning that I don't have to use React Native macOS); 15 | * Microsoft are driving desktop platforms on React Native (meaning that a new React Native macOS is available anyway); 16 | * JSI and turbo-modules are on its way; 17 | * Redux Toolkit makes Redux bearable with TypeScript, and; 18 | * Expo are doing great work driving the ecosystem with Unimodules, React Navigation, and more. 19 | 20 | Given all this momentum behind React Native, I believe that we now have the maturity of tools to pull off a cross-platform, declarative UI-based web browser in a single code-base. So rather than attempt it all on my own and couple the code to LinguaBrowse, I've decided to open-source the 'browser' aspect of LinguaBrowse and maintain any of my brand-specific stuff in a separate fork. In fact, with adequate extension APIs, a fork may not even be needed at all. 21 | 22 | ## Scope 23 | 24 | The browser should: 25 | 26 | * have a UI that is no less functional than that of Firefox's; 27 | * support at least iOS, Android, macOS, and Windows from one codebase; 28 | * allow consumers to swap out the WebView for another one (for now, I'm using my fork of `react-native-webview`); 29 | 30 | To be clear: This project is **purely** focused on building a browser UI, and forwarding user actions to a WebView. We are not trying to rebuild a browser engine here – just the UI around it. 31 | 32 | ## Roadmap 33 | 34 | - [X] Functional navigation buttons (back, forward, stop, refresh) 35 | - [X] Functional URL bar (can navigate to URL inputs and updates text upon page redirect) 36 | - [X] Rotation 37 | - [X] Bar retraction 38 | - [X] Intelligent URL vs. search query determination in search bar 39 | - [ ] Search suggestions 40 | - [ ] Bars snapping to fully retracted/revealed upon gesture release 41 | - [ ] Tabs 42 | - [ ] History 43 | - [ ] Browsing-state persistence 44 | - [ ] Bookmarks 45 | - [ ] Reading list 46 | - [ ] Page-specific actions 47 | - [ ] Branded app-specific actions (e.g. JS injection, popup blocking, whatever) 48 | 49 | ## Prior art 50 | 51 | I have been talking a fair bit about browser-building with the Cliqz team, as they are doing some exciting work (see these stellar [blog posts](https://www.0x65.dev)) in this space right now. 52 | 53 | Cliqz provides superb prior art – it would be great (in my opinion) if this project could converge with it in some way to provide a single, declarative UI codebase that could be used for all platforms. They already use a cross-platform core. In fact, they have experimented with a React Native UI at least for the purposes of producing a Windows app, and I shall have to ask what brought that experiment to an end. It could be that this project could feed into `cliqz-s` (see below), or vice-versa. 54 | 55 | Cliqz give [good reasons](https://www.0x65.dev/blog/2019-12-17/why-we-forked-firefox-and-not-chromium.html) as to why they use Firefox as a basis rather than Chromium. 56 | 57 | * [`cliqz-oss/browser-android`](https://github.com/cliqz-oss/browser-android): an Android web browser UI built in Java, based on Firefox for Android(?). Is the UI for the Cliqz Play Store Android app. 58 | * [`cliqz/user-agent-ios`](https://github.com/cliqz/user-agent-ios): an iOS web browser UI built in Swift, based on Firefox for iOS. [Is the UI for the Cliqz AppStore iOS app](https://twitter.com/chrmod/status/1204771688824655872?s=20). 59 | * [`cliqz-oss/cliqz-s`](https://github.com/cliqz-oss/cliqz-s): Cliqz's prototype Windows browser, written in React Native Windows ([not meant for production](https://twitter.com/chrmod/status/1204772242279809025?s=20)). 60 | * [`cliqz-oss/browser-f`](https://github.com/cliqz-oss/browser-f): Cliqz's production desktop browser (Windows & Mac), based on Firefox desktop. There are a mixture of languages in the source: C++ and JS, at least. I'm not really sure what the dominant UI language is. 61 | * [`cliqz-oss/browser-core`](https://github.com/cliqz-oss/browser-core): Cliqz's set of cross-platform (desktop & mobile) core modules such as their search UI. 62 | * [Mozilla Application Services](https://github.com/mozilla/application-services/blob/master/README.md), recommended as a state storage solution by [Krzysztof Modras](https://twitter.com/chrmod/status/1208335429507960832?s=20) of Cliqz – particularly Places DB (explained by Krzysztof [here](https://twitter.com/chrmod/status/1208336158037557248?s=20)). 63 | 64 | -------------------------------------------------------------------------------- /__tests__/App.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import App from '../App.tsx'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | renderer.create(); 10 | }); 11 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.linguabrowse", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.linguabrowse", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | project.ext.react = [ 76 | entryFile: "index.js", 77 | enableHermes: false 78 | ] 79 | 80 | apply from: '../../node_modules/react-native-unimodules/gradle.groovy' 81 | apply from: "../../node_modules/react-native/react.gradle" 82 | apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 83 | 84 | /** 85 | * Set this to true to create two separate APKs instead of one: 86 | * - An APK that only works on ARM devices 87 | * - An APK that only works on x86 devices 88 | * The advantage is the size of the APK is reduced by about 4MB. 89 | * Upload all the APKs to the Play Store and people will download 90 | * the correct one based on the CPU architecture of their device. 91 | */ 92 | def enableSeparateBuildPerCPUArchitecture = false 93 | 94 | /** 95 | * Run Proguard to shrink the Java bytecode in release builds. 96 | */ 97 | def enableProguardInReleaseBuilds = false 98 | 99 | android { 100 | compileSdkVersion rootProject.ext.compileSdkVersion 101 | buildToolsVersion rootProject.ext.buildToolsVersion 102 | 103 | defaultConfig { 104 | applicationId "com.linguabrowse" 105 | minSdkVersion rootProject.ext.minSdkVersion 106 | targetSdkVersion rootProject.ext.targetSdkVersion 107 | versionCode 1 108 | versionName "1.0" 109 | } 110 | splits { 111 | abi { 112 | reset() 113 | enable enableSeparateBuildPerCPUArchitecture 114 | universalApk false // If true, also generate a universal APK 115 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 116 | } 117 | } 118 | buildTypes { 119 | release { 120 | minifyEnabled enableProguardInReleaseBuilds 121 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 122 | } 123 | } 124 | // applicationVariants are e.g. debug, release 125 | applicationVariants.all { variant -> 126 | variant.outputs.each { output -> 127 | // For each separate APK per architecture, set a unique version code as described here: 128 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 129 | def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4] 130 | def abi = output.getFilter(OutputFile.ABI) 131 | if (abi != null) { // null for the universal-debug, universal-release variants 132 | output.versionCodeOverride = 133 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 134 | } 135 | } 136 | } 137 | compileOptions { 138 | sourceCompatibility JavaVersion.VERSION_1_8 139 | targetCompatibility JavaVersion.VERSION_1_8 140 | } 141 | } 142 | 143 | def jscFlavor = 'org.webkit:android-jsc:+' 144 | 145 | def enableHermes = project.ext.react.get("enableHermes", false); 146 | 147 | dependencies { 148 | implementation project(':react-native-screens') 149 | implementation project(':react-native-reanimated') 150 | implementation project(':react-native-gesture-handler') 151 | implementation fileTree(dir: "libs", include: ["*.jar"]) 152 | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" 153 | implementation "com.facebook.react:react-native:+" // From node_modules 154 | addUnimodulesDependencies() 155 | 156 | if (enableHermes) { 157 | def hermesPath = "../../node_modules/hermes-engine/android/"; 158 | debugImplementation files(hermesPath + "hermes-debug.aar") 159 | releaseImplementation files(hermesPath + "hermes-release.aar") 160 | } else { 161 | implementation jscFlavor 162 | } 163 | } 164 | 165 | // Run this once to be able to run the application with BUCK 166 | // puts all compile dependencies into folder libs for BUCK to use 167 | task copyDownloadableDepsToLibs(type: Copy) { 168 | from configurations.compile 169 | into 'libs' 170 | } 171 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 35 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/linguabrowse/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.linguabrowse; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView; 7 | 8 | public class MainActivity extends ReactActivity { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. 12 | * This is used to schedule rendering of the component. 13 | */ 14 | @Override 15 | protected String getMainComponentName() { 16 | return "linguabrowse"; 17 | } 18 | 19 | @Override 20 | protected ReactActivityDelegate createReactActivityDelegate() { 21 | return new ReactActivityDelegate(this, getMainComponentName()) { 22 | @Override 23 | protected ReactRootView createRootView() { 24 | return new RNGestureHandlerEnabledRootView(MainActivity.this); 25 | } 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/linguabrowse/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.linguabrowse; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.facebook.react.ReactNativeHost; 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.shell.MainReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | import com.linguabrowse.generated.BasePackageList; 11 | import com.swmansion.gesturehandler.react.RNGestureHandlerPackage; 12 | import com.swmansion.reanimated.ReanimatedPackage; 13 | import com.swmansion.rnscreens.RNScreensPackage; 14 | 15 | import org.unimodules.adapters.react.ReactAdapterPackage; 16 | import org.unimodules.adapters.react.ModuleRegistryAdapter; 17 | import org.unimodules.adapters.react.ReactModuleRegistryProvider; 18 | import org.unimodules.core.interfaces.Package; 19 | import org.unimodules.core.interfaces.SingletonModule; 20 | import expo.modules.constants.ConstantsPackage; 21 | import expo.modules.permissions.PermissionsPackage; 22 | import expo.modules.filesystem.FileSystemPackage; 23 | 24 | import java.util.Arrays; 25 | import java.util.List; 26 | 27 | public class MainApplication extends Application implements ReactApplication { 28 | private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider( 29 | new BasePackageList().getPackageList(), 30 | Arrays.asList() 31 | ); 32 | 33 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 34 | @Override 35 | public boolean getUseDeveloperSupport() { 36 | return BuildConfig.DEBUG; 37 | } 38 | 39 | @Override 40 | protected List getPackages() { 41 | return Arrays.asList( 42 | new MainReactPackage(), 43 | new ReanimatedPackage(), 44 | new RNGestureHandlerPackage(), 45 | new RNScreensPackage(), 46 | new ModuleRegistryAdapter(mModuleRegistryProvider) 47 | ); 48 | } 49 | 50 | @Override 51 | protected String getJSMainModuleName() { 52 | return "index"; 53 | } 54 | }; 55 | 56 | @Override 57 | public ReactNativeHost getReactNativeHost() { 58 | return mReactNativeHost; 59 | } 60 | 61 | @Override 62 | public void onCreate() { 63 | super.onCreate(); 64 | SoLoader.init(this, /* native exopackage */ false); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | LinguaBrowse 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 21 7 | compileSdkVersion = 28 8 | targetSdkVersion = 27 9 | supportLibVersion = "28.0.0" 10 | } 11 | repositories { 12 | google() 13 | jcenter() 14 | } 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.3.0' 17 | 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | mavenLocal() 26 | google() 27 | jcenter() 28 | maven { 29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 30 | url "$rootDir/../node_modules/react-native/android" 31 | } 32 | maven { 33 | // Android JSC is installed from npm 34 | url("$rootDir/../node_modules/jsc-android/dist") 35 | } 36 | } 37 | } 38 | 39 | 40 | task wrapper(type: Wrapper) { 41 | gradleVersion = '4.7' 42 | distributionUrl = distributionUrl.replace("bin", "all") 43 | } 44 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true 21 | android.enableJetifier=true 22 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shirakaba/react-native-web-browser-app/7a5bdd5fbf8aab527158f5f3759cd14d4fb93b26/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | apply from: '../node_modules/react-native-unimodules/gradle.groovy' 2 | include ':react-native-screens' 3 | project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android') 4 | include ':react-native-reanimated' 5 | project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android') 6 | includeUnimodulesProjects() 7 | 8 | include ':react-native-gesture-handler' 9 | project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android') 10 | 11 | rootProject.name = 'linguabrowse' 12 | 13 | include ':app' 14 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "linguabrowse", 3 | "displayName": "LinguaBrowse", 4 | "expo": { 5 | "name": "linguabrowse", 6 | "slug": "expo-template-bare", 7 | "privacy": "unlisted", 8 | "sdkVersion": "36.0.0", 9 | "version": "1.0.0", 10 | "entryPoint": "node_modules/expo/AppEntry.js", 11 | "platforms": [ 12 | "ios", 13 | "android", 14 | "web" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | plugins: [ 6 | ], 7 | }; 8 | }; 9 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './App'; 3 | import { name as appName } from './app.json'; 4 | 5 | AppRegistry.registerComponent(appName, () => App); 6 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '10.0' 2 | 3 | require_relative '../node_modules/react-native-unimodules/cocoapods' 4 | 5 | target 'linguabrowse' do 6 | 7 | rnPrefix = "../node_modules/react-native" 8 | 9 | # React Native and its dependencies 10 | pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector" 11 | pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec" 12 | pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired" 13 | pod 'RCTTypeSafety', :path => "#{rnPrefix}/Libraries/TypeSafety" 14 | pod 'React', :path => "#{rnPrefix}/" 15 | pod 'React-Core', :path => "#{rnPrefix}/" 16 | pod 'React-CoreModules', :path => "#{rnPrefix}/React/CoreModules" 17 | pod 'React-RCTActionSheet', :path => "#{rnPrefix}/Libraries/ActionSheetIOS" 18 | pod 'React-RCTAnimation', :path => "#{rnPrefix}/Libraries/NativeAnimation" 19 | pod 'React-RCTBlob', :path => "#{rnPrefix}/Libraries/Blob" 20 | pod 'React-RCTImage', :path => "#{rnPrefix}/Libraries/Image" 21 | pod 'React-RCTLinking', :path => "#{rnPrefix}/Libraries/LinkingIOS" 22 | pod 'React-RCTNetwork', :path => "#{rnPrefix}/Libraries/Network" 23 | pod 'React-RCTSettings', :path => "#{rnPrefix}/Libraries/Settings" 24 | pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Text" 25 | pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration" 26 | pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/" 27 | pod 'React-Core/DevSupport', :path => "#{rnPrefix}/" 28 | pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact" 29 | pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi" 30 | pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor" 31 | pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector" 32 | pod 'ReactCommon/jscallinvoker', :path => "#{rnPrefix}/ReactCommon" 33 | pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon" 34 | pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga" 35 | pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec" 36 | pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec" 37 | pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec" 38 | 39 | # Other native modules 40 | pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec' 41 | pod 'RNReanimated', :path => '../node_modules/react-native-reanimated' 42 | pod 'RNScreens', :path => '../node_modules/react-native-screens' 43 | pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons' 44 | pod 'react-native-webview', :path => '../node_modules/react-native-webview' 45 | pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context' 46 | 47 | # Automatically detect installed unimodules 48 | use_unimodules! 49 | end 50 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost-for-react-native (1.63.0) 3 | - DoubleConversion (1.1.6) 4 | - EXAppLoaderProvider (8.0.0) 5 | - EXConstants (8.0.0): 6 | - UMConstantsInterface 7 | - UMCore 8 | - EXErrorRecovery (1.0.0): 9 | - UMCore 10 | - EXFileSystem (8.0.0): 11 | - UMCore 12 | - UMFileSystemInterface 13 | - EXFont (8.0.0): 14 | - UMCore 15 | - UMFontInterface 16 | - EXKeepAwake (8.0.0): 17 | - UMCore 18 | - EXLinearGradient (8.0.0): 19 | - UMCore 20 | - EXLocation (8.0.0): 21 | - UMCore 22 | - UMPermissionsInterface 23 | - UMTaskManagerInterface 24 | - EXPermissions (8.0.0): 25 | - UMCore 26 | - UMPermissionsInterface 27 | - EXSQLite (8.0.0): 28 | - UMCore 29 | - UMFileSystemInterface 30 | - EXWebBrowser (8.0.0): 31 | - UMCore 32 | - FBLazyVector (0.61.5) 33 | - FBReactNativeSpec (0.61.5): 34 | - Folly (= 2018.10.22.00) 35 | - RCTRequired (= 0.61.5) 36 | - RCTTypeSafety (= 0.61.5) 37 | - React-Core (= 0.61.5) 38 | - React-jsi (= 0.61.5) 39 | - ReactCommon/turbomodule/core (= 0.61.5) 40 | - Folly (2018.10.22.00): 41 | - boost-for-react-native 42 | - DoubleConversion 43 | - Folly/Default (= 2018.10.22.00) 44 | - glog 45 | - Folly/Default (2018.10.22.00): 46 | - boost-for-react-native 47 | - DoubleConversion 48 | - glog 49 | - glog (0.3.5) 50 | - RCTRequired (0.61.5) 51 | - RCTTypeSafety (0.61.5): 52 | - FBLazyVector (= 0.61.5) 53 | - Folly (= 2018.10.22.00) 54 | - RCTRequired (= 0.61.5) 55 | - React-Core (= 0.61.5) 56 | - React (0.61.5): 57 | - React-Core (= 0.61.5) 58 | - React-Core/DevSupport (= 0.61.5) 59 | - React-Core/RCTWebSocket (= 0.61.5) 60 | - React-RCTActionSheet (= 0.61.5) 61 | - React-RCTAnimation (= 0.61.5) 62 | - React-RCTBlob (= 0.61.5) 63 | - React-RCTImage (= 0.61.5) 64 | - React-RCTLinking (= 0.61.5) 65 | - React-RCTNetwork (= 0.61.5) 66 | - React-RCTSettings (= 0.61.5) 67 | - React-RCTText (= 0.61.5) 68 | - React-RCTVibration (= 0.61.5) 69 | - React-Core (0.61.5): 70 | - Folly (= 2018.10.22.00) 71 | - glog 72 | - React-Core/Default (= 0.61.5) 73 | - React-cxxreact (= 0.61.5) 74 | - React-jsi (= 0.61.5) 75 | - React-jsiexecutor (= 0.61.5) 76 | - Yoga 77 | - React-Core/CoreModulesHeaders (0.61.5): 78 | - Folly (= 2018.10.22.00) 79 | - glog 80 | - React-Core/Default 81 | - React-cxxreact (= 0.61.5) 82 | - React-jsi (= 0.61.5) 83 | - React-jsiexecutor (= 0.61.5) 84 | - Yoga 85 | - React-Core/Default (0.61.5): 86 | - Folly (= 2018.10.22.00) 87 | - glog 88 | - React-cxxreact (= 0.61.5) 89 | - React-jsi (= 0.61.5) 90 | - React-jsiexecutor (= 0.61.5) 91 | - Yoga 92 | - React-Core/DevSupport (0.61.5): 93 | - Folly (= 2018.10.22.00) 94 | - glog 95 | - React-Core/Default (= 0.61.5) 96 | - React-Core/RCTWebSocket (= 0.61.5) 97 | - React-cxxreact (= 0.61.5) 98 | - React-jsi (= 0.61.5) 99 | - React-jsiexecutor (= 0.61.5) 100 | - React-jsinspector (= 0.61.5) 101 | - Yoga 102 | - React-Core/RCTActionSheetHeaders (0.61.5): 103 | - Folly (= 2018.10.22.00) 104 | - glog 105 | - React-Core/Default 106 | - React-cxxreact (= 0.61.5) 107 | - React-jsi (= 0.61.5) 108 | - React-jsiexecutor (= 0.61.5) 109 | - Yoga 110 | - React-Core/RCTAnimationHeaders (0.61.5): 111 | - Folly (= 2018.10.22.00) 112 | - glog 113 | - React-Core/Default 114 | - React-cxxreact (= 0.61.5) 115 | - React-jsi (= 0.61.5) 116 | - React-jsiexecutor (= 0.61.5) 117 | - Yoga 118 | - React-Core/RCTBlobHeaders (0.61.5): 119 | - Folly (= 2018.10.22.00) 120 | - glog 121 | - React-Core/Default 122 | - React-cxxreact (= 0.61.5) 123 | - React-jsi (= 0.61.5) 124 | - React-jsiexecutor (= 0.61.5) 125 | - Yoga 126 | - React-Core/RCTImageHeaders (0.61.5): 127 | - Folly (= 2018.10.22.00) 128 | - glog 129 | - React-Core/Default 130 | - React-cxxreact (= 0.61.5) 131 | - React-jsi (= 0.61.5) 132 | - React-jsiexecutor (= 0.61.5) 133 | - Yoga 134 | - React-Core/RCTLinkingHeaders (0.61.5): 135 | - Folly (= 2018.10.22.00) 136 | - glog 137 | - React-Core/Default 138 | - React-cxxreact (= 0.61.5) 139 | - React-jsi (= 0.61.5) 140 | - React-jsiexecutor (= 0.61.5) 141 | - Yoga 142 | - React-Core/RCTNetworkHeaders (0.61.5): 143 | - Folly (= 2018.10.22.00) 144 | - glog 145 | - React-Core/Default 146 | - React-cxxreact (= 0.61.5) 147 | - React-jsi (= 0.61.5) 148 | - React-jsiexecutor (= 0.61.5) 149 | - Yoga 150 | - React-Core/RCTSettingsHeaders (0.61.5): 151 | - Folly (= 2018.10.22.00) 152 | - glog 153 | - React-Core/Default 154 | - React-cxxreact (= 0.61.5) 155 | - React-jsi (= 0.61.5) 156 | - React-jsiexecutor (= 0.61.5) 157 | - Yoga 158 | - React-Core/RCTTextHeaders (0.61.5): 159 | - Folly (= 2018.10.22.00) 160 | - glog 161 | - React-Core/Default 162 | - React-cxxreact (= 0.61.5) 163 | - React-jsi (= 0.61.5) 164 | - React-jsiexecutor (= 0.61.5) 165 | - Yoga 166 | - React-Core/RCTVibrationHeaders (0.61.5): 167 | - Folly (= 2018.10.22.00) 168 | - glog 169 | - React-Core/Default 170 | - React-cxxreact (= 0.61.5) 171 | - React-jsi (= 0.61.5) 172 | - React-jsiexecutor (= 0.61.5) 173 | - Yoga 174 | - React-Core/RCTWebSocket (0.61.5): 175 | - Folly (= 2018.10.22.00) 176 | - glog 177 | - React-Core/Default (= 0.61.5) 178 | - React-cxxreact (= 0.61.5) 179 | - React-jsi (= 0.61.5) 180 | - React-jsiexecutor (= 0.61.5) 181 | - Yoga 182 | - React-CoreModules (0.61.5): 183 | - FBReactNativeSpec (= 0.61.5) 184 | - Folly (= 2018.10.22.00) 185 | - RCTTypeSafety (= 0.61.5) 186 | - React-Core/CoreModulesHeaders (= 0.61.5) 187 | - React-RCTImage (= 0.61.5) 188 | - ReactCommon/turbomodule/core (= 0.61.5) 189 | - React-cxxreact (0.61.5): 190 | - boost-for-react-native (= 1.63.0) 191 | - DoubleConversion 192 | - Folly (= 2018.10.22.00) 193 | - glog 194 | - React-jsinspector (= 0.61.5) 195 | - React-jsi (0.61.5): 196 | - boost-for-react-native (= 1.63.0) 197 | - DoubleConversion 198 | - Folly (= 2018.10.22.00) 199 | - glog 200 | - React-jsi/Default (= 0.61.5) 201 | - React-jsi/Default (0.61.5): 202 | - boost-for-react-native (= 1.63.0) 203 | - DoubleConversion 204 | - Folly (= 2018.10.22.00) 205 | - glog 206 | - React-jsiexecutor (0.61.5): 207 | - DoubleConversion 208 | - Folly (= 2018.10.22.00) 209 | - glog 210 | - React-cxxreact (= 0.61.5) 211 | - React-jsi (= 0.61.5) 212 | - React-jsinspector (0.61.5) 213 | - react-native-safe-area-context (0.6.1): 214 | - React 215 | - react-native-webview (8.0.2): 216 | - React 217 | - React-RCTActionSheet (0.61.5): 218 | - React-Core/RCTActionSheetHeaders (= 0.61.5) 219 | - React-RCTAnimation (0.61.5): 220 | - React-Core/RCTAnimationHeaders (= 0.61.5) 221 | - React-RCTBlob (0.61.5): 222 | - React-Core/RCTBlobHeaders (= 0.61.5) 223 | - React-Core/RCTWebSocket (= 0.61.5) 224 | - React-jsi (= 0.61.5) 225 | - React-RCTNetwork (= 0.61.5) 226 | - React-RCTImage (0.61.5): 227 | - React-Core/RCTImageHeaders (= 0.61.5) 228 | - React-RCTNetwork (= 0.61.5) 229 | - React-RCTLinking (0.61.5): 230 | - React-Core/RCTLinkingHeaders (= 0.61.5) 231 | - React-RCTNetwork (0.61.5): 232 | - React-Core/RCTNetworkHeaders (= 0.61.5) 233 | - React-RCTSettings (0.61.5): 234 | - React-Core/RCTSettingsHeaders (= 0.61.5) 235 | - React-RCTText (0.61.5): 236 | - React-Core/RCTTextHeaders (= 0.61.5) 237 | - React-RCTVibration (0.61.5): 238 | - React-Core/RCTVibrationHeaders (= 0.61.5) 239 | - ReactCommon/jscallinvoker (0.61.5): 240 | - DoubleConversion 241 | - Folly (= 2018.10.22.00) 242 | - glog 243 | - React-cxxreact (= 0.61.5) 244 | - ReactCommon/turbomodule/core (0.61.5): 245 | - DoubleConversion 246 | - Folly (= 2018.10.22.00) 247 | - glog 248 | - React-Core (= 0.61.5) 249 | - React-cxxreact (= 0.61.5) 250 | - React-jsi (= 0.61.5) 251 | - ReactCommon/jscallinvoker (= 0.61.5) 252 | - RNGestureHandler (1.5.2): 253 | - React 254 | - RNReanimated (1.4.0): 255 | - React 256 | - RNScreens (2.0.0-alpha.22): 257 | - React 258 | - RNVectorIcons (6.6.0): 259 | - React 260 | - UMBarCodeScannerInterface (5.0.0) 261 | - UMCameraInterface (5.0.0) 262 | - UMConstantsInterface (5.0.0) 263 | - UMCore (5.0.0) 264 | - UMFaceDetectorInterface (5.0.0) 265 | - UMFileSystemInterface (5.0.0) 266 | - UMFontInterface (5.0.0) 267 | - UMImageLoaderInterface (5.0.0) 268 | - UMPermissionsInterface (5.0.0) 269 | - UMReactNativeAdapter (5.0.0): 270 | - React-Core 271 | - UMCore 272 | - UMFontInterface 273 | - UMSensorsInterface (5.0.0) 274 | - UMTaskManagerInterface (5.0.0) 275 | - Yoga (1.14.0) 276 | 277 | DEPENDENCIES: 278 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 279 | - EXAppLoaderProvider (from `../node_modules/expo-app-loader-provider/ios`) 280 | - EXConstants (from `../node_modules/expo-constants/ios`) 281 | - EXErrorRecovery (from `../node_modules/expo-error-recovery/ios`) 282 | - EXFileSystem (from `../node_modules/expo-file-system/ios`) 283 | - EXFont (from `../node_modules/expo-font/ios`) 284 | - EXKeepAwake (from `../node_modules/expo-keep-awake/ios`) 285 | - EXLinearGradient (from `../node_modules/expo-linear-gradient/ios`) 286 | - EXLocation (from `../node_modules/expo-location/ios`) 287 | - EXPermissions (from `../node_modules/expo-permissions/ios`) 288 | - EXSQLite (from `../node_modules/expo-sqlite/ios`) 289 | - EXWebBrowser (from `../node_modules/expo-web-browser/ios`) 290 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 291 | - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) 292 | - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) 293 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 294 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 295 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 296 | - React (from `../node_modules/react-native/`) 297 | - React-Core (from `../node_modules/react-native/`) 298 | - React-Core/DevSupport (from `../node_modules/react-native/`) 299 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 300 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 301 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 302 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 303 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 304 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 305 | - react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`) 306 | - react-native-webview (from `../node_modules/react-native-webview`) 307 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 308 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 309 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 310 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 311 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 312 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 313 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 314 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 315 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 316 | - ReactCommon/jscallinvoker (from `../node_modules/react-native/ReactCommon`) 317 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 318 | - RNGestureHandler (from `../node_modules/react-native-gesture-handler/RNGestureHandler.podspec`) 319 | - RNReanimated (from `../node_modules/react-native-reanimated`) 320 | - RNScreens (from `../node_modules/react-native-screens`) 321 | - RNVectorIcons (from `../node_modules/react-native-vector-icons`) 322 | - UMBarCodeScannerInterface (from `../node_modules/unimodules-barcode-scanner-interface/ios`) 323 | - UMCameraInterface (from `../node_modules/unimodules-camera-interface/ios`) 324 | - UMConstantsInterface (from `../node_modules/unimodules-constants-interface/ios`) 325 | - "UMCore (from `../node_modules/@unimodules/core/ios`)" 326 | - UMFaceDetectorInterface (from `../node_modules/unimodules-face-detector-interface/ios`) 327 | - UMFileSystemInterface (from `../node_modules/unimodules-file-system-interface/ios`) 328 | - UMFontInterface (from `../node_modules/unimodules-font-interface/ios`) 329 | - UMImageLoaderInterface (from `../node_modules/unimodules-image-loader-interface/ios`) 330 | - UMPermissionsInterface (from `../node_modules/unimodules-permissions-interface/ios`) 331 | - "UMReactNativeAdapter (from `../node_modules/@unimodules/react-native-adapter/ios`)" 332 | - UMSensorsInterface (from `../node_modules/unimodules-sensors-interface/ios`) 333 | - UMTaskManagerInterface (from `../node_modules/unimodules-task-manager-interface/ios`) 334 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 335 | 336 | SPEC REPOS: 337 | https://github.com/cocoapods/specs.git: 338 | - boost-for-react-native 339 | 340 | EXTERNAL SOURCES: 341 | DoubleConversion: 342 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 343 | EXAppLoaderProvider: 344 | :path: !ruby/object:Pathname 345 | path: "../node_modules/expo-app-loader-provider/ios" 346 | EXConstants: 347 | :path: !ruby/object:Pathname 348 | path: "../node_modules/expo-constants/ios" 349 | EXErrorRecovery: 350 | :path: !ruby/object:Pathname 351 | path: "../node_modules/expo-error-recovery/ios" 352 | EXFileSystem: 353 | :path: !ruby/object:Pathname 354 | path: "../node_modules/expo-file-system/ios" 355 | EXFont: 356 | :path: !ruby/object:Pathname 357 | path: "../node_modules/expo-font/ios" 358 | EXKeepAwake: 359 | :path: !ruby/object:Pathname 360 | path: "../node_modules/expo-keep-awake/ios" 361 | EXLinearGradient: 362 | :path: !ruby/object:Pathname 363 | path: "../node_modules/expo-linear-gradient/ios" 364 | EXLocation: 365 | :path: !ruby/object:Pathname 366 | path: "../node_modules/expo-location/ios" 367 | EXPermissions: 368 | :path: !ruby/object:Pathname 369 | path: "../node_modules/expo-permissions/ios" 370 | EXSQLite: 371 | :path: !ruby/object:Pathname 372 | path: "../node_modules/expo-sqlite/ios" 373 | EXWebBrowser: 374 | :path: !ruby/object:Pathname 375 | path: "../node_modules/expo-web-browser/ios" 376 | FBLazyVector: 377 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 378 | FBReactNativeSpec: 379 | :path: "../node_modules/react-native/Libraries/FBReactNativeSpec" 380 | Folly: 381 | :podspec: "../node_modules/react-native/third-party-podspecs/Folly.podspec" 382 | glog: 383 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 384 | RCTRequired: 385 | :path: "../node_modules/react-native/Libraries/RCTRequired" 386 | RCTTypeSafety: 387 | :path: "../node_modules/react-native/Libraries/TypeSafety" 388 | React: 389 | :path: "../node_modules/react-native/" 390 | React-Core: 391 | :path: "../node_modules/react-native/" 392 | React-CoreModules: 393 | :path: "../node_modules/react-native/React/CoreModules" 394 | React-cxxreact: 395 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 396 | React-jsi: 397 | :path: "../node_modules/react-native/ReactCommon/jsi" 398 | React-jsiexecutor: 399 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 400 | React-jsinspector: 401 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 402 | react-native-safe-area-context: 403 | :path: "../node_modules/react-native-safe-area-context" 404 | react-native-webview: 405 | :path: "../node_modules/react-native-webview" 406 | React-RCTActionSheet: 407 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 408 | React-RCTAnimation: 409 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 410 | React-RCTBlob: 411 | :path: "../node_modules/react-native/Libraries/Blob" 412 | React-RCTImage: 413 | :path: "../node_modules/react-native/Libraries/Image" 414 | React-RCTLinking: 415 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 416 | React-RCTNetwork: 417 | :path: "../node_modules/react-native/Libraries/Network" 418 | React-RCTSettings: 419 | :path: "../node_modules/react-native/Libraries/Settings" 420 | React-RCTText: 421 | :path: "../node_modules/react-native/Libraries/Text" 422 | React-RCTVibration: 423 | :path: "../node_modules/react-native/Libraries/Vibration" 424 | ReactCommon: 425 | :path: "../node_modules/react-native/ReactCommon" 426 | RNGestureHandler: 427 | :podspec: "../node_modules/react-native-gesture-handler/RNGestureHandler.podspec" 428 | RNReanimated: 429 | :path: "../node_modules/react-native-reanimated" 430 | RNScreens: 431 | :path: "../node_modules/react-native-screens" 432 | RNVectorIcons: 433 | :path: "../node_modules/react-native-vector-icons" 434 | UMBarCodeScannerInterface: 435 | :path: !ruby/object:Pathname 436 | path: "../node_modules/unimodules-barcode-scanner-interface/ios" 437 | UMCameraInterface: 438 | :path: !ruby/object:Pathname 439 | path: "../node_modules/unimodules-camera-interface/ios" 440 | UMConstantsInterface: 441 | :path: !ruby/object:Pathname 442 | path: "../node_modules/unimodules-constants-interface/ios" 443 | UMCore: 444 | :path: !ruby/object:Pathname 445 | path: "../node_modules/@unimodules/core/ios" 446 | UMFaceDetectorInterface: 447 | :path: !ruby/object:Pathname 448 | path: "../node_modules/unimodules-face-detector-interface/ios" 449 | UMFileSystemInterface: 450 | :path: !ruby/object:Pathname 451 | path: "../node_modules/unimodules-file-system-interface/ios" 452 | UMFontInterface: 453 | :path: !ruby/object:Pathname 454 | path: "../node_modules/unimodules-font-interface/ios" 455 | UMImageLoaderInterface: 456 | :path: !ruby/object:Pathname 457 | path: "../node_modules/unimodules-image-loader-interface/ios" 458 | UMPermissionsInterface: 459 | :path: !ruby/object:Pathname 460 | path: "../node_modules/unimodules-permissions-interface/ios" 461 | UMReactNativeAdapter: 462 | :path: !ruby/object:Pathname 463 | path: "../node_modules/@unimodules/react-native-adapter/ios" 464 | UMSensorsInterface: 465 | :path: !ruby/object:Pathname 466 | path: "../node_modules/unimodules-sensors-interface/ios" 467 | UMTaskManagerInterface: 468 | :path: !ruby/object:Pathname 469 | path: "../node_modules/unimodules-task-manager-interface/ios" 470 | Yoga: 471 | :path: "../node_modules/react-native/ReactCommon/yoga" 472 | 473 | SPEC CHECKSUMS: 474 | boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c 475 | DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 476 | EXAppLoaderProvider: ebdb6bc2632c1ccadbe49f5e4104d8d690969c49 477 | EXConstants: 4051b16c17ef3defa03c541d42811dc92b249146 478 | EXErrorRecovery: d36db99ec6a3808f313f01b0890eb443796dd1c2 479 | EXFileSystem: 6e0d9bb6cc4ea404dbb8f583c1a8a2dcdf4b83b6 480 | EXFont: 6187b5ab46ee578d5f8e7f2ea092752e78772235 481 | EXKeepAwake: 66e9f80b6d129633725a0e42f8d285c229876811 482 | EXLinearGradient: 75f302f9d6484267a3f6d3252df2e7a5f00e716a 483 | EXLocation: 3c75d012ca92eed94d4338778d79c49d1252393a 484 | EXPermissions: 9bc08859a675d291e89be9a0870155c27c16ac35 485 | EXSQLite: 220226a354912b100dfe913f5fe6f31762c8927e 486 | EXWebBrowser: db32607359fb7b55b7b7b91df32dd3d8355bb3b7 487 | FBLazyVector: aaeaf388755e4f29cd74acbc9e3b8da6d807c37f 488 | FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75 489 | Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 490 | glog: 1f3da668190260b06b429bb211bfbee5cd790c28 491 | RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1 492 | RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320 493 | React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78 494 | React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04 495 | React-CoreModules: d04f8494c1a328b69ec11db9d1137d667f916dcb 496 | React-cxxreact: d0f7bcafa196ae410e5300736b424455e7fb7ba7 497 | React-jsi: cb2cd74d7ccf4cffb071a46833613edc79cdf8f7 498 | React-jsiexecutor: d5525f9ed5f782fdbacb64b9b01a43a9323d2386 499 | React-jsinspector: fa0ecc501688c3c4c34f28834a76302233e29dc0 500 | react-native-safe-area-context: 1f8a52fb0ab1321eef9a7099bd2c360d4e38264b 501 | react-native-webview: 99bdfd6c189772b0f15494f728430c23b18b93e4 502 | React-RCTActionSheet: 600b4d10e3aea0913b5a92256d2719c0cdd26d76 503 | React-RCTAnimation: 791a87558389c80908ed06cc5dfc5e7920dfa360 504 | React-RCTBlob: d89293cc0236d9cb0933d85e430b0bbe81ad1d72 505 | React-RCTImage: 6b8e8df449eb7c814c99a92d6b52de6fe39dea4e 506 | React-RCTLinking: 121bb231c7503cf9094f4d8461b96a130fabf4a5 507 | React-RCTNetwork: fb353640aafcee84ca8b78957297bd395f065c9a 508 | React-RCTSettings: 8db258ea2a5efee381fcf7a6d5044e2f8b68b640 509 | React-RCTText: 9ccc88273e9a3aacff5094d2175a605efa854dbe 510 | React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad 511 | ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd 512 | RNGestureHandler: 946a7691e41df61e2c4b1884deab41a4cdc3afff 513 | RNReanimated: 8b675a650fc67c87f63d4345a1b2d4a699c25e4f 514 | RNScreens: 6adf01eb4080f44af6cca551207c6b0505066857 515 | RNVectorIcons: 0bb4def82230be1333ddaeee9fcba45f0b288ed4 516 | UMBarCodeScannerInterface: 3802c8574ef119c150701d679ab386e2266d6a54 517 | UMCameraInterface: 985d301f688ed392f815728f0dd906ca34b7ccb1 518 | UMConstantsInterface: bda5f8bd3403ad99e663eb3c4da685d063c5653c 519 | UMCore: 7ab08669a8bb2e61f557c1fe9784521cb5aa28e3 520 | UMFaceDetectorInterface: ce14e8e597f6a52aa66e4ab956cb5bff4fa8acf8 521 | UMFileSystemInterface: 2ed004c9620f43f0b36b33c42ce668500850d6a4 522 | UMFontInterface: 24fbc0a02ade6c60ad3ee3e2b5d597c8dcfc3208 523 | UMImageLoaderInterface: 3976a14c588341228881ff75970fbabf122efca4 524 | UMPermissionsInterface: 2abf9f7f4aa7110e27beaf634a7deda2d50ff3d7 525 | UMReactNativeAdapter: 230406e3335a8dbd4c9c0e654488a1cf3b44552f 526 | UMSensorsInterface: d708a892ef1500bdd9fc3ff03f7836c66d1634d3 527 | UMTaskManagerInterface: a98e37a576a5220bf43b8faf33cfdc129d2f441d 528 | Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b 529 | 530 | PODFILE CHECKSUM: b86068a6f9bc898b6889605a5eb9faf16dbc0671 531 | 532 | COCOAPODS: 1.7.3 533 | -------------------------------------------------------------------------------- /ios/linguabrowse.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 11 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 12 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 14 | 7B0C5784998A29E517983E0C /* libPods-linguabrowse.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2502ACF51380E8237829647D /* libPods-linguabrowse.a */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 19 | 056F63395CAC2B8C2DC048FE /* Pods-linguabrowse.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-linguabrowse.debug.xcconfig"; path = "Target Support Files/Pods-linguabrowse/Pods-linguabrowse.debug.xcconfig"; sourceTree = ""; }; 20 | 13B07F961A680F5B00A75B9A /* linguabrowse.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = linguabrowse.app; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = linguabrowse/AppDelegate.h; sourceTree = ""; }; 22 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = linguabrowse/AppDelegate.m; sourceTree = ""; }; 23 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 24 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = linguabrowse/Images.xcassets; sourceTree = ""; }; 25 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = linguabrowse/Info.plist; sourceTree = ""; }; 26 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = linguabrowse/main.m; sourceTree = ""; }; 27 | 2502ACF51380E8237829647D /* libPods-linguabrowse.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-linguabrowse.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; }; 29 | E40B1F720DE0D29BF6B90074 /* Pods-linguabrowse.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-linguabrowse.release.xcconfig"; path = "Target Support Files/Pods-linguabrowse/Pods-linguabrowse.release.xcconfig"; sourceTree = ""; }; 30 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 31 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | 7B0C5784998A29E517983E0C /* libPods-linguabrowse.a in Frameworks */, 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 13B07FAE1A68108700A75B9A /* linguabrowse */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 50 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 51 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 52 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 53 | 13B07FB61A68108700A75B9A /* Info.plist */, 54 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 55 | 13B07FB71A68108700A75B9A /* main.m */, 56 | ); 57 | name = linguabrowse; 58 | sourceTree = ""; 59 | }; 60 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 64 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 65 | 2D16E6891FA4F8E400B85C8A /* libReact.a */, 66 | 2502ACF51380E8237829647D /* libPods-linguabrowse.a */, 67 | ); 68 | name = Frameworks; 69 | sourceTree = ""; 70 | }; 71 | 6C68EC841F3FBF9CD21359E0 /* Pods */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 056F63395CAC2B8C2DC048FE /* Pods-linguabrowse.debug.xcconfig */, 75 | E40B1F720DE0D29BF6B90074 /* Pods-linguabrowse.release.xcconfig */, 76 | ); 77 | path = Pods; 78 | sourceTree = ""; 79 | }; 80 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | ); 84 | name = Libraries; 85 | sourceTree = ""; 86 | }; 87 | 83CBB9F61A601CBA00E9B192 = { 88 | isa = PBXGroup; 89 | children = ( 90 | 13B07FAE1A68108700A75B9A /* linguabrowse */, 91 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 92 | 83CBBA001A601CBA00E9B192 /* Products */, 93 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 94 | 6C68EC841F3FBF9CD21359E0 /* Pods */, 95 | ); 96 | indentWidth = 2; 97 | sourceTree = ""; 98 | tabWidth = 2; 99 | usesTabs = 0; 100 | }; 101 | 83CBBA001A601CBA00E9B192 /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 13B07F961A680F5B00A75B9A /* linguabrowse.app */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | /* End PBXGroup section */ 110 | 111 | /* Begin PBXNativeTarget section */ 112 | 13B07F861A680F5B00A75B9A /* linguabrowse */ = { 113 | isa = PBXNativeTarget; 114 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "linguabrowse" */; 115 | buildPhases = ( 116 | 56DD4AB7BC040A533152C46D /* [CP] Check Pods Manifest.lock */, 117 | FD4C38642228810C00325AF5 /* Start Packager */, 118 | 13B07F871A680F5B00A75B9A /* Sources */, 119 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 120 | 13B07F8E1A680F5B00A75B9A /* Resources */, 121 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 122 | A8761A5EF3D1DB691A1E1185 /* [CP] Copy Pods Resources */, 123 | ); 124 | buildRules = ( 125 | ); 126 | dependencies = ( 127 | ); 128 | name = linguabrowse; 129 | productName = "Hello World"; 130 | productReference = 13B07F961A680F5B00A75B9A /* linguabrowse.app */; 131 | productType = "com.apple.product-type.application"; 132 | }; 133 | /* End PBXNativeTarget section */ 134 | 135 | /* Begin PBXProject section */ 136 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 137 | isa = PBXProject; 138 | attributes = { 139 | LastUpgradeCheck = 0940; 140 | ORGANIZATIONNAME = Facebook; 141 | TargetAttributes = { 142 | 13B07F861A680F5B00A75B9A = { 143 | DevelopmentTeam = TVU9P2GAL9; 144 | }; 145 | }; 146 | }; 147 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "linguabrowse" */; 148 | compatibilityVersion = "Xcode 3.2"; 149 | developmentRegion = English; 150 | hasScannedForEncodings = 0; 151 | knownRegions = ( 152 | English, 153 | en, 154 | Base, 155 | ); 156 | mainGroup = 83CBB9F61A601CBA00E9B192; 157 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 158 | projectDirPath = ""; 159 | projectRoot = ""; 160 | targets = ( 161 | 13B07F861A680F5B00A75B9A /* linguabrowse */, 162 | ); 163 | }; 164 | /* End PBXProject section */ 165 | 166 | /* Begin PBXResourcesBuildPhase section */ 167 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 168 | isa = PBXResourcesBuildPhase; 169 | buildActionMask = 2147483647; 170 | files = ( 171 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 172 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXResourcesBuildPhase section */ 177 | 178 | /* Begin PBXShellScriptBuildPhase section */ 179 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 180 | isa = PBXShellScriptBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | ); 184 | inputPaths = ( 185 | ); 186 | name = "Bundle React Native code and images"; 187 | outputPaths = ( 188 | ); 189 | runOnlyForDeploymentPostprocessing = 0; 190 | shellPath = /bin/sh; 191 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; 192 | }; 193 | 56DD4AB7BC040A533152C46D /* [CP] Check Pods Manifest.lock */ = { 194 | isa = PBXShellScriptBuildPhase; 195 | buildActionMask = 2147483647; 196 | files = ( 197 | ); 198 | inputFileListPaths = ( 199 | ); 200 | inputPaths = ( 201 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 202 | "${PODS_ROOT}/Manifest.lock", 203 | ); 204 | name = "[CP] Check Pods Manifest.lock"; 205 | outputFileListPaths = ( 206 | ); 207 | outputPaths = ( 208 | "$(DERIVED_FILE_DIR)/Pods-linguabrowse-checkManifestLockResult.txt", 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | shellPath = /bin/sh; 212 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 213 | showEnvVarsInLog = 0; 214 | }; 215 | A8761A5EF3D1DB691A1E1185 /* [CP] Copy Pods Resources */ = { 216 | isa = PBXShellScriptBuildPhase; 217 | buildActionMask = 2147483647; 218 | files = ( 219 | ); 220 | inputPaths = ( 221 | "${PODS_ROOT}/Target Support Files/Pods-linguabrowse/Pods-linguabrowse-resources.sh", 222 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf", 223 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf", 224 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf", 225 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf", 226 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf", 227 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf", 228 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf", 229 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf", 230 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf", 231 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf", 232 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf", 233 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf", 234 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf", 235 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf", 236 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf", 237 | "${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf", 238 | ); 239 | name = "[CP] Copy Pods Resources"; 240 | outputPaths = ( 241 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf", 242 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf", 243 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf", 244 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf", 245 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf", 246 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf", 247 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf", 248 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf", 249 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf", 250 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf", 251 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf", 252 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf", 253 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf", 254 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf", 255 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf", 256 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf", 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | shellPath = /bin/sh; 260 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-linguabrowse/Pods-linguabrowse-resources.sh\"\n"; 261 | showEnvVarsInLog = 0; 262 | }; 263 | FD4C38642228810C00325AF5 /* Start Packager */ = { 264 | isa = PBXShellScriptBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | inputFileListPaths = ( 269 | ); 270 | inputPaths = ( 271 | ); 272 | name = "Start Packager"; 273 | outputFileListPaths = ( 274 | ); 275 | outputPaths = ( 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | shellPath = /bin/sh; 279 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 280 | showEnvVarsInLog = 0; 281 | }; 282 | /* End PBXShellScriptBuildPhase section */ 283 | 284 | /* Begin PBXSourcesBuildPhase section */ 285 | 13B07F871A680F5B00A75B9A /* Sources */ = { 286 | isa = PBXSourcesBuildPhase; 287 | buildActionMask = 2147483647; 288 | files = ( 289 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 290 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 291 | ); 292 | runOnlyForDeploymentPostprocessing = 0; 293 | }; 294 | /* End PBXSourcesBuildPhase section */ 295 | 296 | /* Begin PBXVariantGroup section */ 297 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 298 | isa = PBXVariantGroup; 299 | children = ( 300 | 13B07FB21A68108700A75B9A /* Base */, 301 | ); 302 | name = LaunchScreen.xib; 303 | path = linguabrowse; 304 | sourceTree = ""; 305 | }; 306 | /* End PBXVariantGroup section */ 307 | 308 | /* Begin XCBuildConfiguration section */ 309 | 13B07F941A680F5B00A75B9A /* Debug */ = { 310 | isa = XCBuildConfiguration; 311 | baseConfigurationReference = 056F63395CAC2B8C2DC048FE /* Pods-linguabrowse.debug.xcconfig */; 312 | buildSettings = { 313 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 314 | CURRENT_PROJECT_VERSION = 1; 315 | DEAD_CODE_STRIPPING = NO; 316 | DEVELOPMENT_TEAM = TVU9P2GAL9; 317 | INFOPLIST_FILE = linguabrowse/Info.plist; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | OTHER_LDFLAGS = ( 320 | "$(inherited)", 321 | "-ObjC", 322 | "-lc++", 323 | ); 324 | PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.webbrowser; 325 | PRODUCT_NAME = linguabrowse; 326 | VERSIONING_SYSTEM = "apple-generic"; 327 | }; 328 | name = Debug; 329 | }; 330 | 13B07F951A680F5B00A75B9A /* Release */ = { 331 | isa = XCBuildConfiguration; 332 | baseConfigurationReference = E40B1F720DE0D29BF6B90074 /* Pods-linguabrowse.release.xcconfig */; 333 | buildSettings = { 334 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 335 | CURRENT_PROJECT_VERSION = 1; 336 | DEVELOPMENT_TEAM = TVU9P2GAL9; 337 | INFOPLIST_FILE = linguabrowse/Info.plist; 338 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 339 | OTHER_LDFLAGS = ( 340 | "$(inherited)", 341 | "-ObjC", 342 | "-lc++", 343 | ); 344 | PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.webbrowser; 345 | PRODUCT_NAME = linguabrowse; 346 | VERSIONING_SYSTEM = "apple-generic"; 347 | }; 348 | name = Release; 349 | }; 350 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ALWAYS_SEARCH_USER_PATHS = NO; 354 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 355 | CLANG_CXX_LIBRARY = "libc++"; 356 | CLANG_ENABLE_MODULES = YES; 357 | CLANG_ENABLE_OBJC_ARC = YES; 358 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 359 | CLANG_WARN_BOOL_CONVERSION = YES; 360 | CLANG_WARN_COMMA = YES; 361 | CLANG_WARN_CONSTANT_CONVERSION = YES; 362 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 363 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 364 | CLANG_WARN_EMPTY_BODY = YES; 365 | CLANG_WARN_ENUM_CONVERSION = YES; 366 | CLANG_WARN_INFINITE_RECURSION = YES; 367 | CLANG_WARN_INT_CONVERSION = YES; 368 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 369 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 370 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 371 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 372 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 373 | CLANG_WARN_STRICT_PROTOTYPES = YES; 374 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 375 | CLANG_WARN_UNREACHABLE_CODE = YES; 376 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 377 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 378 | COPY_PHASE_STRIP = NO; 379 | ENABLE_STRICT_OBJC_MSGSEND = YES; 380 | ENABLE_TESTABILITY = YES; 381 | GCC_C_LANGUAGE_STANDARD = gnu99; 382 | GCC_DYNAMIC_NO_PIC = NO; 383 | GCC_NO_COMMON_BLOCKS = YES; 384 | GCC_OPTIMIZATION_LEVEL = 0; 385 | GCC_PREPROCESSOR_DEFINITIONS = ( 386 | "DEBUG=1", 387 | "$(inherited)", 388 | ); 389 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 390 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 391 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 392 | GCC_WARN_UNDECLARED_SELECTOR = YES; 393 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 394 | GCC_WARN_UNUSED_FUNCTION = YES; 395 | GCC_WARN_UNUSED_VARIABLE = YES; 396 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 397 | MTL_ENABLE_DEBUG_INFO = YES; 398 | ONLY_ACTIVE_ARCH = YES; 399 | SDKROOT = iphoneos; 400 | }; 401 | name = Debug; 402 | }; 403 | 83CBBA211A601CBA00E9B192 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | ALWAYS_SEARCH_USER_PATHS = NO; 407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 408 | CLANG_CXX_LIBRARY = "libc++"; 409 | CLANG_ENABLE_MODULES = YES; 410 | CLANG_ENABLE_OBJC_ARC = YES; 411 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 412 | CLANG_WARN_BOOL_CONVERSION = YES; 413 | CLANG_WARN_COMMA = YES; 414 | CLANG_WARN_CONSTANT_CONVERSION = YES; 415 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 416 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 417 | CLANG_WARN_EMPTY_BODY = YES; 418 | CLANG_WARN_ENUM_CONVERSION = YES; 419 | CLANG_WARN_INFINITE_RECURSION = YES; 420 | CLANG_WARN_INT_CONVERSION = YES; 421 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 422 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 423 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 424 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 425 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 426 | CLANG_WARN_STRICT_PROTOTYPES = YES; 427 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 428 | CLANG_WARN_UNREACHABLE_CODE = YES; 429 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 430 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 431 | COPY_PHASE_STRIP = YES; 432 | ENABLE_NS_ASSERTIONS = NO; 433 | ENABLE_STRICT_OBJC_MSGSEND = YES; 434 | GCC_C_LANGUAGE_STANDARD = gnu99; 435 | GCC_NO_COMMON_BLOCKS = YES; 436 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 437 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 438 | GCC_WARN_UNDECLARED_SELECTOR = YES; 439 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 440 | GCC_WARN_UNUSED_FUNCTION = YES; 441 | GCC_WARN_UNUSED_VARIABLE = YES; 442 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 443 | MTL_ENABLE_DEBUG_INFO = NO; 444 | SDKROOT = iphoneos; 445 | VALIDATE_PRODUCT = YES; 446 | }; 447 | name = Release; 448 | }; 449 | /* End XCBuildConfiguration section */ 450 | 451 | /* Begin XCConfigurationList section */ 452 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "linguabrowse" */ = { 453 | isa = XCConfigurationList; 454 | buildConfigurations = ( 455 | 13B07F941A680F5B00A75B9A /* Debug */, 456 | 13B07F951A680F5B00A75B9A /* Release */, 457 | ); 458 | defaultConfigurationIsVisible = 0; 459 | defaultConfigurationName = Release; 460 | }; 461 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "linguabrowse" */ = { 462 | isa = XCConfigurationList; 463 | buildConfigurations = ( 464 | 83CBBA201A601CBA00E9B192 /* Debug */, 465 | 83CBBA211A601CBA00E9B192 /* Release */, 466 | ); 467 | defaultConfigurationIsVisible = 0; 468 | defaultConfigurationName = Release; 469 | }; 470 | /* End XCConfigurationList section */ 471 | }; 472 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 473 | } 474 | -------------------------------------------------------------------------------- /ios/linguabrowse.xcodeproj/xcshareddata/xcschemes/linguabrowse.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/linguabrowse.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/linguabrowse.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/linguabrowse/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | #import 11 | #import 12 | 13 | @interface AppDelegate : UMAppDelegateWrapper 14 | 15 | @property (nonatomic, strong) UMModuleRegistryAdapter *moduleRegistryAdapter; 16 | @property (nonatomic, strong) UIWindow *window; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ios/linguabrowse/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | #import 16 | 17 | @implementation AppDelegate 18 | 19 | @synthesize window = _window; 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 22 | { 23 | self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]]; 24 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 25 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"linguabrowse" initialProperties:nil]; 26 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 27 | 28 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 29 | UIViewController *rootViewController = [UIViewController new]; 30 | rootViewController.view = rootView; 31 | self.window.rootViewController = rootViewController; 32 | [self.window makeKeyAndVisible]; 33 | 34 | [super application:application didFinishLaunchingWithOptions:launchOptions]; 35 | 36 | return YES; 37 | } 38 | 39 | - (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge 40 | { 41 | NSArray> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge]; 42 | // You can inject any extra modules that you would like here, more information at: 43 | // https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection 44 | return extraModules; 45 | } 46 | 47 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { 48 | #ifdef DEBUG 49 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 50 | #else 51 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 52 | #endif 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ios/linguabrowse/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ios/linguabrowse/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/linguabrowse/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/linguabrowse/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | LinguaBrowse 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSCalendarsUsageDescription 41 | Allow LinguaBrowse to access your calendar 42 | NSCameraUsageDescription 43 | Allow LinguaBrowse to use the camera 44 | NSContactsUsageDescription 45 | Allow LinguaBrowse experiences to access your contacts 46 | NSLocationAlwaysAndWhenInUseUsageDescription 47 | Allow LinguaBrowse to use your location 48 | NSLocationAlwaysUsageDescription 49 | Allow LinguaBrowse to use your location 50 | NSLocationWhenInUseUsageDescription 51 | Allow LinguaBrowse to use your location 52 | NSMicrophoneUsageDescription 53 | Allow LinguaBrowse to access your microphone 54 | NSMotionUsageDescription 55 | Allow LinguaBrowse to access your device's accelerometer 56 | NSPhotoLibraryAddUsageDescription 57 | Give LinguaBrowse periences permission to save photos 58 | NSPhotoLibraryUsageDescription 59 | Give LinguaBrowse periences permission to access your photos 60 | NSRemindersUsageDescription 61 | Allow LinguaBrowse to access your reminders 62 | UIAppFonts 63 | 64 | AntDesign.ttf 65 | Entypo.ttf 66 | EvilIcons.ttf 67 | Feather.ttf 68 | FontAwesome.ttf 69 | FontAwesome5_Brands.ttf 70 | FontAwesome5_Regular.ttf 71 | FontAwesome5_Solid.ttf 72 | Foundation.ttf 73 | Ionicons.ttf 74 | MaterialIcons.ttf 75 | MaterialCommunityIcons.ttf 76 | SimpleLineIcons.ttf 77 | Octicons.ttf 78 | Zocial.ttf 79 | 80 | UILaunchStoryboardName 81 | LaunchScreen 82 | UIRequiredDeviceCapabilities 83 | 84 | armv7 85 | 86 | UISupportedInterfaceOrientations 87 | 88 | UIInterfaceOrientationPortrait 89 | UIInterfaceOrientationLandscapeLeft 90 | UIInterfaceOrientationLandscapeRight 91 | 92 | UIViewControllerBasedStatusBarAppearance 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /ios/linguabrowse/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-web-browser-app", 3 | "version": "0.2.0", 4 | "description": "Fully-featured cross-platform Web Browser, made in React Native", 5 | "main": "dist/app.js", 6 | "types": "dist/app.d.ts", 7 | "files": [ 8 | "dist", 9 | "LICENSE", 10 | "README.md" 11 | ], 12 | "scripts": { 13 | "build": "tsc --project ./tsconfig.build.json", 14 | "prepare": "npm run build", 15 | "original_postinstall": "jetify", 16 | "android": "react-native run-android", 17 | "ios": "react-native run-ios", 18 | "web": "expo start --web", 19 | "start": "react-native start", 20 | "test": "jest" 21 | }, 22 | "repository": { 23 | "type": "git", 24 | "url": "git+https://github.com/shirakaba/react-native-web-browser-app.git" 25 | }, 26 | "bugs": { 27 | "url": "https://github.com/shirakaba/react-native-web-browser-app/issues" 28 | }, 29 | "homepage": "https://github.com/shirakaba/react-native-web-browser-app#readme", 30 | "keywords": [ 31 | "retractible bars", 32 | "LinguaBrowse", 33 | "browser", 34 | "web browser", 35 | "React Native", 36 | "React" 37 | ], 38 | "peerDependencies": { 39 | "@reduxjs/toolkit": "^1.1.0", 40 | "expo": ">=36.0.0", 41 | "react": ">=16.9.0", 42 | "react-native": ">=0.61.4", 43 | "react-native-gesture-handler": "*", 44 | "react-native-reanimated": "*", 45 | "react-native-safe-area-context": ">=0.6.1", 46 | "react-native-screens": "*", 47 | "react-native-unimodules": "*", 48 | "react-native-vector-icons": "^6.6.0", 49 | "react-native-webview": "*", 50 | "react-redux": "^7.1.3", 51 | "redux": "^4.0.5", 52 | "redux-thunk": "^2.3.0" 53 | }, 54 | "devDependencies": { 55 | "@babel/core": "~7.6.0", 56 | "@types/react": "~16.9.0", 57 | "@types/react-native": "~0.60.23", 58 | "@types/react-redux": "^7.1.5", 59 | "babel-preset-expo": "~8.0.0", 60 | "jest-expo": "~36.0.0", 61 | "jetifier": "~1.6.4", 62 | "typescript": "~3.6.3", 63 | 64 | "@reduxjs/toolkit": "^1.1.0", 65 | "@types/react-native-vector-icons": "^6.4.5", 66 | "expo": "~36.0.0", 67 | "react": "~16.9.0", 68 | "react-native": "~0.61.4", 69 | "react-native-gesture-handler": "~1.5.0", 70 | "react-native-reanimated": "git+https://github.com/software-mansion/react-native-reanimated.git#master", 71 | "react-native-safe-area-context": "^0.6.1", 72 | "react-native-screens": "~2.0.0-alpha.12", 73 | "react-native-unimodules": "~0.7.0", 74 | "react-native-vector-icons": "^6.6.0", 75 | "react-native-webview": "git+https://github.com/shirakaba/react-native-webview.git#shirakaba/main", 76 | "react-redux": "^7.1.3", 77 | "redux": "^4.0.5", 78 | "redux-thunk": "^2.3.0" 79 | }, 80 | "jest": { 81 | "preset": "react-native" 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/browser/BrowserViewController.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { Dimensions, View } from "react-native"; 3 | import Animated from "react-native-reanimated"; 4 | import { connect } from "react-redux"; 5 | import { BrowserConfig, defaultConfig } from "./browserConfig"; 6 | import { WholeStoreState } from "../store/store"; 7 | import { isPortrait, updateOrientation } from "../store/uiState"; 8 | import { DRAG_END_INITIAL } from "./bothBars/barSpring"; 9 | import { FooterConnected } from "./footer/Footer"; 10 | import { RetractibleHeaderConnected } from "./header/RetractibleHeader"; 11 | import { DEFAULT_HEADER_RETRACTED_HEIGHT, DEFAULT_HEADER_REVEALED_HEIGHT } from "./header/TabLocationView"; 12 | import { DefaultBarAwareWebView } from "./webView/BarAwareWebView"; 13 | import { WebViewBackdrop } from "./webView/WebViewBackdrop"; 14 | 15 | const BrowserViewControllerUX = { 16 | ShowHeaderTapAreaHeight: 0, 17 | BookmarkStarAnimationDuration: 0.5, 18 | BookmarkStarAnimationOffset: 80, 19 | } 20 | 21 | // // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L70 22 | // class AlertStackView extends React.Component { 23 | // render(){ 24 | // const { style, children, ...rest } = this.props; 25 | 26 | // return ( 27 | // 36 | // ); 37 | // } 38 | // } 39 | 40 | // // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L65 41 | // class OverlayBackground extends React.Component { 42 | // render(){ 43 | // const { style, ...rest } = this.props; 44 | 45 | // return ( 46 | // // UIVisualEffectView() 47 | // 55 | // ); 56 | // } 57 | // } 58 | 59 | interface Props { 60 | config?: BrowserConfig, 61 | updateOrientation: typeof updateOrientation, 62 | } 63 | 64 | interface State { 65 | 66 | } 67 | 68 | export class BrowserViewController extends React.Component { 69 | private readonly scrollY; 70 | private readonly scrollEndDragVelocity = new Animated.Value(DRAG_END_INITIAL); 71 | 72 | constructor(props: Props){ 73 | super(props); 74 | 75 | const { config = defaultConfig, } = props; 76 | const { 77 | HEADER_RETRACTED_HEIGHT = DEFAULT_HEADER_RETRACTED_HEIGHT, 78 | HEADER_REVEALED_HEIGHT = DEFAULT_HEADER_REVEALED_HEIGHT, 79 | } = config.header; 80 | const HEADER_RETRACTION_DISTANCE: number = HEADER_REVEALED_HEIGHT - HEADER_RETRACTED_HEIGHT; 81 | 82 | this.scrollY = new Animated.Value(HEADER_RETRACTION_DISTANCE); 83 | } 84 | 85 | private readonly onOrientationChange = () => { 86 | this.props.updateOrientation(isPortrait() ? 'portrait' : 'landscape'); 87 | }; 88 | 89 | componentDidMount(){ 90 | Dimensions.addEventListener('change', this.onOrientationChange); 91 | } 92 | 93 | componentWillUnmount(){ 94 | Dimensions.removeEventListener('change', this.onOrientationChange); 95 | } 96 | 97 | render(){ 98 | const { config = defaultConfig } = this.props; 99 | const { barAwareWebView = DefaultBarAwareWebView } = config; 100 | // Visibility of certain components changes when switching app (if in private browsing mode) 101 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L343 102 | 103 | return ( 104 | 113 | 117 | 118 | 129 | 136 | 142 | {barAwareWebView({ 143 | headerConfig: config.header, 144 | scrollY: this.scrollY, 145 | scrollEndDragVelocity: this.scrollEndDragVelocity, 146 | })} 147 | 148 | 149 | 154 | 155 | 156 | ); 157 | } 158 | } 159 | 160 | export const BrowserViewControllerConnected = connect( 161 | (wholeStoreState: WholeStoreState) => { 162 | // console.log(`wholeStoreState`, wholeStoreState); 163 | return {}; 164 | }, 165 | { 166 | updateOrientation: updateOrientation 167 | }, 168 | )(BrowserViewController); -------------------------------------------------------------------------------- /src/browser/bothBars/BarButtons.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { Text, TouchableOpacityProps, TouchableOpacity } from "react-native"; 3 | import { ToolbarButton, ToolbarButtonProps } from "./ToolbarButton"; 4 | import { goBackOnWebView, goForwardOnWebView, reloadWebView, stopWebView } from "../../store/navigationState"; 5 | import { connect } from "react-redux"; 6 | import { WholeStoreState } from "../../store/store"; 7 | 8 | // From URLBarView 9 | 10 | interface BackButtonProps { 11 | canGoBack: boolean, 12 | goBackOnWebView: typeof goBackOnWebView, 13 | } 14 | class BackButton extends React.Component { 15 | private readonly onTap = () => { 16 | this.props.goBackOnWebView(); 17 | }; 18 | 19 | render(){ 20 | const { canGoBack, ...rest } = this.props; 21 | return ( 22 | 28 | ); 29 | } 30 | } 31 | export const BackButtonConnected = connect( 32 | (wholeStoreState: WholeStoreState) => { 33 | // May support pop-out history in future. 34 | return { 35 | canGoBack: wholeStoreState.navigation.tabs[wholeStoreState.navigation.activeTab].canGoBack, 36 | }; 37 | }, 38 | { 39 | goBackOnWebView, 40 | }, 41 | )(BackButton); 42 | 43 | interface ForwardButtonProps { 44 | canGoForward: boolean, 45 | goForwardOnWebView: typeof goForwardOnWebView, 46 | } 47 | class ForwardButton extends React.Component { 48 | private readonly onTap = () => { 49 | this.props.goForwardOnWebView(); 50 | }; 51 | 52 | render(){ 53 | const { canGoForward, ...rest } = this.props; 54 | return ( 55 | 61 | ); 62 | } 63 | } 64 | export const ForwardButtonConnected = connect( 65 | (wholeStoreState: WholeStoreState) => { 66 | // May support pop-out history in future. 67 | return { 68 | canGoForward: wholeStoreState.navigation.tabs[wholeStoreState.navigation.activeTab].canGoForward, 69 | }; 70 | }, 71 | { 72 | goForwardOnWebView, 73 | }, 74 | )(ForwardButton); 75 | 76 | interface StopReloadButtonProps { 77 | loading: boolean, 78 | 79 | stopWebView: typeof stopWebView, 80 | reloadWebView: typeof reloadWebView, 81 | } 82 | 83 | class StopReloadButton extends React.Component { 84 | private readonly onTap = () => { 85 | if(this.props.loading){ 86 | this.props.stopWebView(); 87 | } else { 88 | this.props.reloadWebView(); 89 | } 90 | }; 91 | 92 | render(){ 93 | const { loading, ...rest } = this.props; 94 | 95 | return ( 96 | 107 | ); 108 | } 109 | } 110 | export const StopReloadButtonConnected = connect( 111 | (wholeStoreState: WholeStoreState) => { 112 | const { activeTab, tabs } = wholeStoreState.navigation; 113 | // console.log(`[StopReloadButtonConnected] wholeStoreState.navigation`, wholeStoreState.navigation); 114 | return { 115 | loading: tabs[activeTab].loadProgress !== 1, 116 | }; 117 | }, 118 | { 119 | reloadWebView, 120 | stopWebView, 121 | }, 122 | )(StopReloadButton); 123 | 124 | // From TabToolbar 125 | /** 126 | * Menu refers to the app menu, not a page-specific menu. 127 | */ 128 | class MenuButton extends React.Component<{} & ToolbarButtonProps, {}> { 129 | render(){ 130 | const { ...rest } = this.props; 131 | return ( 132 | 133 | ); 134 | } 135 | } 136 | export const MenuButtonConnected = connect( 137 | (wholeStoreState: WholeStoreState) => { 138 | return {}; 139 | }, 140 | { 141 | // TODO 142 | }, 143 | )(MenuButton); 144 | class SearchButton extends React.Component<{} & ToolbarButtonProps, {}> { 145 | render(){ 146 | const { ...rest } = this.props; 147 | return ( 148 | 149 | ); 150 | } 151 | } 152 | export const SearchButtonConnected = connect( 153 | (wholeStoreState: WholeStoreState) => { 154 | return {}; 155 | }, 156 | { 157 | // TODO 158 | }, 159 | )(SearchButton); 160 | // https://github.com/cliqz/user-agent-ios/blob/7a91b5ea3e2fbb8b95dadd4f0cfd71b334e73449/Client/Frontend/Browser/TabToolbar.swift#L146 161 | class TabsButton extends React.Component<{} & ToolbarButtonProps, {}>{ 162 | 163 | render(){ 164 | const { ...rest } = this.props; 165 | 166 | return ( 167 | 168 | ); 169 | } 170 | } 171 | export const TabsButtonConnected = connect( 172 | (wholeStoreState: WholeStoreState) => { 173 | return {}; 174 | }, 175 | { 176 | // TODO 177 | }, 178 | )(TabsButton); 179 | 180 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/URLBarView.swift#L136 181 | class CancelButton extends React.Component<{} & TouchableOpacityProps, {}>{ 182 | render(){ 183 | const { ...rest } = this.props; 184 | return ( 185 | 186 | Cancel 187 | 188 | ); 189 | } 190 | } 191 | export const CancelButtonConnected = connect( 192 | (wholeStoreState: WholeStoreState) => { 193 | return {}; 194 | }, 195 | { 196 | // TODO 197 | }, 198 | )(CancelButton); -------------------------------------------------------------------------------- /src/browser/bothBars/BarConfig.ts: -------------------------------------------------------------------------------- 1 | export enum RetractionStyle { 2 | alwaysRevealed = "alwaysRevealed", 3 | alwaysCompact = "alwaysCompact", 4 | alwaysHidden = "alwaysHidden", 5 | /* Displays text and icons but not buttons, which would be too small to tap */ 6 | retractToCompact = "retractToCompact", 7 | retractToHidden = "retractToHidden" 8 | } 9 | export interface BarConfig { 10 | portraitRetraction: RetractionStyle; 11 | landscapeRetraction: RetractionStyle; 12 | backgroundColor?: string; 13 | } 14 | -------------------------------------------------------------------------------- /src/browser/bothBars/ToolbarButton.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { RegisteredStyle, TouchableOpacity, TouchableOpacityProps, ViewStyle } from "react-native"; 3 | import Animated from "react-native-reanimated"; 4 | import Icon, { FontAwesome5IconProps } from 'react-native-vector-icons/FontAwesome5'; 5 | 6 | type ToolbarButtonContainerStyle = RegisteredStyle> | Animated.AnimateStyle; 7 | export type ToolbarButtonContainerStyleProp = { containerStyle?: ToolbarButtonContainerStyle }; 8 | 9 | export interface ToolbarButtonOwnProps { 10 | name?: string, 11 | onTap?: () => void, 12 | enabled?: boolean, 13 | enabledColor?: string, 14 | disabledColor?: string, 15 | } 16 | 17 | interface State { 18 | } 19 | 20 | // AnimateProps 21 | const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity) as React.ComponentClass>; 22 | 23 | export type ToolbarButtonProps = ToolbarButtonOwnProps & Omit & Partial; 24 | 25 | // https://github.com/cliqz/user-agent-ios/blob/7a91b5ea3e2fbb8b95dadd4f0cfd71b334e73449/Client/Frontend/Browser/TabToolbar.swift#L146 26 | export class ToolbarButton extends React.Component{ 27 | render(){ 28 | const { onTap, containerStyle, solid, light, brand, enabled = true, name = "", enabledColor = "white", disabledColor = "lightgray", children, ...rest } = this.props; 29 | 30 | /** For what it's worth: iOS HIG for "Navigation Bar and Toolbar Icon Size" gives 24pt target size, 28pt max size. 31 | * @see: https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/ */ 32 | 33 | /* Just a TypeScript hack here. */ 34 | const assertOnlyOneVariantInProps = { 35 | solid, 36 | light, 37 | brand 38 | } as FontAwesome5IconProps; 39 | 40 | return ( 41 | 57 | 67 | 68 | 69 | ); 70 | } 71 | } -------------------------------------------------------------------------------- /src/browser/bothBars/barSpring.ts: -------------------------------------------------------------------------------- 1 | import Animated, { not } from "react-native-reanimated"; 2 | const { diffClamp, interpolate, event: reanimatedEvent, multiply, add, cond, lessThan, neq, Clock, Extrapolate, clockRunning, set, startClock, spring, sub, stopClock, eq } = Animated; 3 | 4 | export const DRAG_END_INITIAL: number = 10000000; 5 | export const NAV_BAR_HEIGHT: number = 44; 6 | 7 | // https://github.com/rgommezz/reanimated-collapsible-navbar/blob/master/App.js#L36 8 | export function runSpring({ 9 | clock, 10 | from, 11 | velocity, 12 | toValue, 13 | scrollEndDragVelocity, 14 | snapOffset, 15 | diffClampNode, 16 | }) { 17 | const state = { 18 | finished: new Animated.Value(0), 19 | velocity: new Animated.Value(0), 20 | position: new Animated.Value(0), 21 | time: new Animated.Value(0), 22 | }; 23 | 24 | const config = { 25 | damping: 1, 26 | mass: 1, 27 | stiffness: 50, 28 | overshootClamping: true, 29 | restSpeedThreshold: 0.001, 30 | restDisplacementThreshold: 0.001, 31 | toValue: new Animated.Value(0), 32 | }; 33 | 34 | return [ 35 | cond(clockRunning(clock), 0, [ 36 | set(state.finished, 0), 37 | set(state.velocity, velocity), 38 | set(state.position, from), 39 | set(config.toValue, toValue), 40 | startClock(clock), 41 | ]), 42 | spring(clock, state, config), 43 | cond(state.finished, [ 44 | set(scrollEndDragVelocity, DRAG_END_INITIAL), 45 | set( 46 | snapOffset, 47 | cond( 48 | eq(toValue, 0), 49 | // SnapOffset acts as an accumulator. 50 | // We need to keep track of the previous offsets applied. 51 | add(snapOffset, multiply(diffClampNode, -1)), 52 | add(snapOffset, sub(NAV_BAR_HEIGHT, diffClampNode)), 53 | ), 54 | ), 55 | stopClock(clock), 56 | ]), 57 | state.position, 58 | ]; 59 | } -------------------------------------------------------------------------------- /src/browser/browserConfig.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { DEFAULT_HEADER_RETRACTED_HEIGHT, DEFAULT_HEADER_REVEALED_HEIGHT } from "./header/TabLocationView"; 3 | import { DEFAULT_FOOTER_REVEALED_HEIGHT } from "./footer/Footer"; 4 | import { BarAwareWebViewType, DefaultBarAwareWebView } from "./webView/BarAwareWebView"; 5 | import { defaultTabToolbar, TabToolbarType } from "./footer/TabToolbar"; 6 | import { defaultHeader, HeaderType } from "./header/Header"; 7 | import { GradientProgressBarType, defaultGradientProgressBar } from "./header/GradientProgressBar"; 8 | import { BarConfig, RetractionStyle } from "./bothBars/BarConfig"; 9 | 10 | export interface HeaderConfig extends BarConfig { 11 | HEADER_RETRACTED_HEIGHT?: number, 12 | HEADER_REVEALED_HEIGHT?: number, 13 | HEADER_HIDDEN_HEIGHT?: number, 14 | progressBarTrackColor?: string, 15 | portraitRetraction: RetractionStyle, 16 | landscapeRetraction: RetractionStyle, 17 | textFieldTextColor?: string, 18 | buttonEnabledColor?: string, 19 | buttonDisabledColor?: string, 20 | slotBackgroundColor?: string, 21 | textFieldBackgroundColor?: string, 22 | contentView?: HeaderType; 23 | progressBar?: GradientProgressBarType, 24 | } 25 | 26 | /** 27 | * References are made to the header retraction/reveal heights because the footer 28 | * is designed to retract at exactly the same rate as the header does. 29 | */ 30 | export interface FooterConfig extends BarConfig { 31 | buttonEnabledColor?: string, 32 | buttonDisabledColor?: string, 33 | HEADER_RETRACTED_HEIGHT?: number, 34 | HEADER_REVEALED_HEIGHT?: number, 35 | FOOTER_REVEALED_HEIGHT: number, 36 | portraitRetraction: RetractionStyle.alwaysRevealed|RetractionStyle.retractToHidden|RetractionStyle.alwaysHidden, 37 | landscapeRetraction: RetractionStyle.alwaysRevealed|RetractionStyle.retractToHidden|RetractionStyle.alwaysHidden, 38 | contentView?: TabToolbarType; 39 | } 40 | 41 | 42 | 43 | export interface BrowserConfig { 44 | header: HeaderConfig, 45 | footer: FooterConfig, 46 | barAwareWebView?: BarAwareWebViewType, 47 | } 48 | 49 | export const defaultConfig: BrowserConfig = { 50 | header: { 51 | HEADER_RETRACTED_HEIGHT: DEFAULT_HEADER_RETRACTED_HEIGHT, 52 | HEADER_REVEALED_HEIGHT: DEFAULT_HEADER_REVEALED_HEIGHT, 53 | portraitRetraction: RetractionStyle.retractToCompact, 54 | landscapeRetraction: RetractionStyle.retractToHidden, 55 | progressBarTrackColor: "blue", 56 | backgroundColor: "gray", 57 | slotBackgroundColor: "darkgray", 58 | textFieldTextColor: "black", 59 | textFieldBackgroundColor: "transparent", 60 | // contentView: (props: HeaderProps) => null, 61 | contentView: defaultHeader, 62 | // progressBar: (props: GradientProgressBarOwnProps) => null, 63 | progressBar: defaultGradientProgressBar, 64 | }, 65 | footer: { 66 | HEADER_RETRACTED_HEIGHT: DEFAULT_HEADER_RETRACTED_HEIGHT, 67 | HEADER_REVEALED_HEIGHT: DEFAULT_HEADER_REVEALED_HEIGHT, 68 | FOOTER_REVEALED_HEIGHT: DEFAULT_FOOTER_REVEALED_HEIGHT, 69 | portraitRetraction: RetractionStyle.retractToHidden, 70 | landscapeRetraction: RetractionStyle.alwaysHidden, 71 | backgroundColor: "gray", 72 | // contentView: (props: TabToolbarProps) => null, 73 | contentView: defaultTabToolbar, 74 | }, 75 | barAwareWebView: DefaultBarAwareWebView, 76 | }; -------------------------------------------------------------------------------- /src/browser/footer/Footer.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { View, ViewProps } from "react-native"; 3 | import Animated from "react-native-reanimated"; 4 | import { EdgeInsets, SafeAreaConsumer } from 'react-native-safe-area-context'; 5 | import { connect } from "react-redux"; 6 | import { FooterConfig } from "../../browser/browserConfig"; 7 | import { RetractionStyle } from "../bothBars/BarConfig"; 8 | import { WholeStoreState } from "../../store/store"; 9 | import { DEFAULT_HEADER_RETRACTED_HEIGHT, DEFAULT_HEADER_REVEALED_HEIGHT } from "../header/TabLocationView"; 10 | import { defaultTabToolbar } from "./TabToolbar"; 11 | const { diffClamp, interpolate, event: reanimatedEvent, multiply, add, cond, lessThan, neq, Clock, Extrapolate, clockRunning, set, startClock, spring, sub, stopClock, eq } = Animated; 12 | 13 | 14 | interface FooterOwnProps { 15 | // retractionStyle: RetractionStyle.retractToHidden|RetractionStyle.alwaysRevealed, 16 | config: FooterConfig, 17 | scrollY: Animated.Value, 18 | orientation: "portrait"|"landscape", 19 | showToolbar: boolean, 20 | }; 21 | 22 | type FooterProps = FooterOwnProps & Omit; 23 | 24 | // export const FOOTER_RETRACTED_HEIGHT: number = 22; 25 | export const DEFAULT_FOOTER_REVEALED_HEIGHT: number = 44; 26 | 27 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L103 28 | export class Footer extends React.Component { 29 | render(){ 30 | const { config, showToolbar, orientation, children, ...rest } = this.props; 31 | const { 32 | backgroundColor, 33 | contentView = defaultTabToolbar, 34 | landscapeRetraction, 35 | portraitRetraction, 36 | FOOTER_REVEALED_HEIGHT = DEFAULT_FOOTER_REVEALED_HEIGHT, 37 | HEADER_REVEALED_HEIGHT = DEFAULT_HEADER_REVEALED_HEIGHT, 38 | HEADER_RETRACTED_HEIGHT = DEFAULT_HEADER_RETRACTED_HEIGHT 39 | } = config; 40 | 41 | const retractionStyle = orientation === "portrait" ? portraitRetraction : landscapeRetraction; 42 | 43 | const HEADER_RETRACTION_DISTANCE: number = HEADER_REVEALED_HEIGHT - HEADER_RETRACTED_HEIGHT; 44 | const FOOTER_HIDDEN_HEIGHT: number = 0; 45 | 46 | if(showToolbar){ 47 | /* Warning: I've tried other layouts (StackLayout and FlexboxLayout) here, but they shift 48 | * horizontally after rotation. Only ContentView seems to escape this bug. */ 49 | return ( 50 | 51 | {(edgeInsets: EdgeInsets) => { 52 | const unsafeAreaCoverHeight: number = edgeInsets.bottom; 53 | 54 | let heightStyle; 55 | switch(retractionStyle){ 56 | case RetractionStyle.alwaysRevealed: 57 | heightStyle = { 58 | // height: "auto", 59 | height: FOOTER_REVEALED_HEIGHT + unsafeAreaCoverHeight, 60 | }; 61 | break; 62 | // case RetractionStyle.retractToCompact: 63 | case RetractionStyle.retractToHidden: 64 | heightStyle = { 65 | height: interpolate(this.props.scrollY, { 66 | // We'll keep the footer retraction in sync with that of the header retraction. 67 | // -y means finger is moving upwards (so bar should retract) 68 | inputRange: [-(HEADER_RETRACTION_DISTANCE), (HEADER_RETRACTION_DISTANCE)], 69 | outputRange: [FOOTER_HIDDEN_HEIGHT, add(FOOTER_REVEALED_HEIGHT, unsafeAreaCoverHeight)], 70 | extrapolate: Extrapolate.CLAMP, 71 | }), 72 | }; 73 | break; 74 | case RetractionStyle.alwaysHidden: 75 | heightStyle = { 76 | height: FOOTER_HIDDEN_HEIGHT 77 | }; 78 | } 79 | 80 | return ( 81 | 97 | {contentView({ config })} 98 | {/* */} 99 | 100 | ); 101 | }} 102 | 103 | ); 104 | } 105 | 106 | // Unclear what footer should do when not showing toolbar... 107 | return ( 108 | 109 | 110 | ); 111 | } 112 | } 113 | 114 | export const FooterConnected = connect( 115 | (wholeStoreState: WholeStoreState) => { 116 | // console.log(`wholeStoreState`, wholeStoreState); 117 | return { 118 | orientation: wholeStoreState.ui.orientation, 119 | }; 120 | }, 121 | {}, 122 | )(Footer); -------------------------------------------------------------------------------- /src/browser/footer/TabToolbar.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { View, ViewProps, ViewStyle } from "react-native"; 3 | import { BackButtonConnected, ForwardButtonConnected, MenuButtonConnected, SearchButtonConnected, TabsButtonConnected, } from "../bothBars/BarButtons"; 4 | import { HeaderConfig } from "../browserConfig"; 5 | 6 | export interface TabToolbarOwnProps { 7 | config: HeaderConfig, 8 | containerStyle?: ViewStyle, 9 | } 10 | 11 | export type TabToolbarProps = TabToolbarOwnProps & ViewProps; 12 | export type TabToolbarType = (props: TabToolbarProps) => React.ReactNode; 13 | export const defaultTabToolbar = (props: TabToolbarProps) => ; 14 | 15 | interface State { 16 | 17 | } 18 | 19 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabToolbar.swift#L199 20 | export class TabToolbar extends React.Component{ 21 | 22 | render(){ 23 | const { config, containerStyle, ...rest } = this.props; 24 | const { buttonEnabledColor, buttonDisabledColor } = config; 25 | 26 | return ( 27 | 40 | {/* actionButtons */} 41 | 42 | 43 | 44 | 45 | 46 | 47 | ); 48 | } 49 | } -------------------------------------------------------------------------------- /src/browser/header/AutocompleteTextField.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { TextInput } from "react-native"; 3 | 4 | interface Props { 5 | 6 | } 7 | 8 | interface State { 9 | 10 | } 11 | 12 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Widgets/AutocompleteTextField.swift 13 | export class AutocompleteTextField extends React.Component{ 14 | render(){ 15 | return ( 16 | 17 | ); 18 | } 19 | } -------------------------------------------------------------------------------- /src/browser/header/GradientProgressBar.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { connect } from 'react-redux'; 3 | import { WholeStoreState } from "../../store/store"; 4 | import { View, Animated, ViewProps } from "react-native"; 5 | 6 | interface GradientProgressBarOwnProps { 7 | trackColor?: string, 8 | } 9 | 10 | interface GradientProgressBarConnectedProps { 11 | progress: number, 12 | } 13 | 14 | export type GradientProgressBarProps = GradientProgressBarOwnProps & GradientProgressBarConnectedProps & ViewProps; 15 | export type GradientProgressBarType = (props: GradientProgressBarOwnProps) => React.ReactNode; 16 | export const defaultGradientProgressBar = (props: GradientProgressBarOwnProps) => ; 17 | 18 | interface State { 19 | // Both between 0 and 1 20 | barOpacity: Animated.Value, 21 | barWidth: Animated.Value, 22 | } 23 | 24 | export const GRADIENT_PROGRESS_BAR_HEIGHT: number = 2; 25 | 26 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift 27 | class GradientProgressBar extends React.Component{ 28 | constructor(props: GradientProgressBarProps){ 29 | super(props); 30 | 31 | this.state = { 32 | barWidth: new Animated.Value(props.progress), 33 | barOpacity: new Animated.Value(props.progress === 1 ? 0 : 1) 34 | }; 35 | } 36 | 37 | shouldComponentUpdate(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean { 38 | // console.log(`[GradientProgressBar] shouldComponentUpdate with this.props.progress ${this.props.progress}, nextProps.progress ${nextProps.progress},`); 39 | if(this.props.progress !== nextProps.progress){ 40 | if(nextProps.progress === 1){ 41 | nextState.barOpacity.stopAnimation( 42 | () => { 43 | Animated.timing(nextState.barOpacity, { 44 | toValue: 0, 45 | duration: 500 46 | }) 47 | .start(); 48 | } 49 | ); 50 | } 51 | if(nextProps.progress < this.props.progress){ 52 | nextState.barWidth.stopAnimation(() => { 53 | nextState.barWidth.setValue(nextProps.progress); 54 | nextState.barOpacity.setValue(1); 55 | }); 56 | } else { 57 | nextState.barWidth.stopAnimation(() => { 58 | Animated.timing(nextState.barWidth, { 59 | toValue: nextProps.progress, 60 | duration: 10, 61 | }) 62 | .start(); 63 | }); 64 | } 65 | } 66 | 67 | return true; 68 | } 69 | 70 | render(){ 71 | const { progress, trackColor = "blue", ...rest } = this.props; 72 | 73 | // console.log(`[GradientProgressBar] rendering with progress ${progress}`); 74 | 75 | return ( 76 | 90 | 105 | 106 | ); 107 | } 108 | } 109 | 110 | export const GradientProgressBarConnected = connect( 111 | (wholeStoreState: WholeStoreState) => { 112 | // console.log(`wholeStoreState`, wholeStoreState); 113 | const { activeTab, tabs } = wholeStoreState.navigation; 114 | 115 | return { 116 | progress: tabs[activeTab].loadProgress, 117 | }; 118 | }, 119 | {}, 120 | )(GradientProgressBar); -------------------------------------------------------------------------------- /src/browser/header/Header.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { StyleSheet, View, ViewProps } from "react-native"; 3 | import Animated from "react-native-reanimated"; 4 | import { HeaderConfig } from "../browserConfig"; 5 | import { TopTabsViewController } from "./TopTabsContainer"; 6 | import { URLBarView } from "./URLBarView"; 7 | 8 | class TopTabsContainer extends React.Component<{}, {}>{ 9 | 10 | render(){ 11 | return ( 12 | 13 | 14 | 15 | ); 16 | } 17 | } 18 | 19 | interface HeaderOwnProps { 20 | config: HeaderConfig, 21 | animatedNavBarTranslateYPortrait: Animated.Node, 22 | animatedNavBarTranslateYLandscape: Animated.Node, 23 | animatedTitleOpacity: Animated.Node, 24 | 25 | scrollY: Animated.Value, 26 | inOverlayMode: boolean, 27 | toolbarIsShowing: boolean, 28 | } 29 | 30 | export type HeaderProps = HeaderOwnProps & ViewProps; 31 | export type HeaderType = (props: HeaderProps) => React.ReactNode; 32 | export const defaultHeader = (props: HeaderProps) =>
; 33 | 34 | interface State { 35 | 36 | } 37 | 38 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L105 39 | // Header used to have a subchild, "UrlBarTopTabsContainer", but that has now been flattened. 40 | export class Header extends React.Component{ 41 | render(){ 42 | const { 43 | config, 44 | toolbarIsShowing, 45 | inOverlayMode, 46 | style, 47 | children, 48 | ...rest 49 | } = this.props; 50 | return ( 51 | 65 | {/* urlBar */} 66 | 75 | {/* topTabsContainer */} 76 | 77 | 78 | ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /src/browser/header/PrivacyIndicatorView.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { ToolbarButton } from "../../browser/bothBars/ToolbarButton"; 3 | import { TouchableOpacityProps } from "react-native"; 4 | 5 | interface Props { 6 | 7 | } 8 | 9 | interface State { 10 | } 11 | 12 | // https://github.com/cliqz/user-agent-ios/blob/7a91b5ea3e2fbb8b95dadd4f0cfd71b334e73449/UserAgent/Views/Privacy%20Indicator/PrivacyIndicatorView.swift 13 | export class PrivacyIndicatorView extends React.Component { 14 | render(){ 15 | const { ...rest } = this.props; 16 | return ( 17 | 18 | // <$StackLayout> 19 | // {/* stub for canvasView, which is that donut graph. */} 20 | // <$ContentView/> 21 | // <$Button/> 22 | // 23 | ); 24 | } 25 | } -------------------------------------------------------------------------------- /src/browser/header/RetractibleHeader.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { ViewProps } from "react-native"; 3 | import Animated from "react-native-reanimated"; 4 | import { EdgeInsets, SafeAreaConsumer } from 'react-native-safe-area-context'; 5 | import { connect } from "react-redux"; 6 | import { GRADIENT_PROGRESS_BAR_HEIGHT, defaultGradientProgressBar } from "../../browser/header/GradientProgressBar"; 7 | import { WholeStoreState } from "../../store/store"; 8 | import { HeaderConfig } from "../browserConfig"; 9 | import { RetractionStyle } from "../bothBars/BarConfig"; 10 | import { defaultHeader } from "./Header"; 11 | import { DEFAULT_HEADER_RETRACTED_HEIGHT, DEFAULT_HEADER_REVEALED_HEIGHT } from "./TabLocationView"; 12 | import { URL_BAR_VIEW_PADDING_VERTICAL } from "./URLBarView"; 13 | const { interpolate, Extrapolate } = Animated; 14 | 15 | interface RetractibleHeaderProps { 16 | config: HeaderConfig, 17 | scrollY: Animated.Value, 18 | 19 | urlBarText: string, 20 | orientation: "portrait"|"landscape", 21 | } 22 | 23 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L61 24 | // Formerly named "NotchAreaCover". 25 | export class RetractibleHeader extends React.Component, {}> { 26 | private readonly animatedNavBarTranslateYPortrait: Animated.Node; 27 | private readonly animatedNavBarTranslateYLandscape: Animated.Node; 28 | private readonly animatedTitleOpacity: Animated.Node; 29 | 30 | constructor(props: RetractibleHeaderProps & Omit){ 31 | super(props); 32 | 33 | const { config } = props; 34 | const { 35 | landscapeRetraction, 36 | portraitRetraction, 37 | HEADER_RETRACTED_HEIGHT = DEFAULT_HEADER_RETRACTED_HEIGHT, 38 | HEADER_REVEALED_HEIGHT = DEFAULT_HEADER_REVEALED_HEIGHT, 39 | } = config; 40 | 41 | const HEADER_HIDDEN_HEIGHT: number = 0; 42 | const HEADER_RETRACTION_DISTANCE: number = HEADER_REVEALED_HEIGHT - HEADER_RETRACTED_HEIGHT; 43 | 44 | // const diffClampNode = diffClamp( 45 | // add(this.scrollY, this.snapOffset), 46 | // 0, 47 | // NAV_BAR_HEIGHT, 48 | // ); 49 | // const inverseDiffClampNode = multiply(diffClampNode, -1); 50 | 51 | // const clock = new Clock(); 52 | 53 | // const snapPoint = cond( 54 | // lessThan(diffClampNode, NAV_BAR_HEIGHT / 2), 55 | // 0, 56 | // -NAV_BAR_HEIGHT, 57 | // ); 58 | 59 | // this.animatedNavBarTranslateY = cond( 60 | // // Condition to detect if we stopped scrolling 61 | // neq(this.scrollEndDragVelocity, DRAG_END_INITIAL), 62 | // runSpring({ 63 | // clock, 64 | // from: inverseDiffClampNode, 65 | // velocity: 0, 66 | // toValue: snapPoint, 67 | // scrollEndDragVelocity: this.scrollEndDragVelocity, 68 | // snapOffset: this.snapOffset, 69 | // diffClampNode, 70 | // }), 71 | // inverseDiffClampNode, 72 | // ); 73 | 74 | this.animatedNavBarTranslateYPortrait = interpolate(this.props.scrollY, { 75 | // -y means finger is moving upwards (so bar should retract) 76 | inputRange: [-HEADER_RETRACTION_DISTANCE, HEADER_RETRACTION_DISTANCE], 77 | outputRange: [HEADER_RETRACTED_HEIGHT, HEADER_REVEALED_HEIGHT], 78 | 79 | /* To disable header retraction */ 80 | // outputRange: [HEADER_REVEALED_HEIGHT, HEADER_REVEALED_HEIGHT], 81 | 82 | extrapolate: Extrapolate.CLAMP, 83 | }); 84 | 85 | this.animatedNavBarTranslateYLandscape = interpolate(this.props.scrollY, { 86 | // -y means finger is moving upwards (so bar should retract) 87 | inputRange: [-HEADER_RETRACTION_DISTANCE, HEADER_RETRACTION_DISTANCE], 88 | outputRange: [HEADER_HIDDEN_HEIGHT, HEADER_REVEALED_HEIGHT], 89 | 90 | /* To disable header retraction */ 91 | // outputRange: [HEADER_REVEALED_HEIGHT, HEADER_REVEALED_HEIGHT], 92 | 93 | extrapolate: Extrapolate.CLAMP, 94 | }); 95 | 96 | this.animatedTitleOpacity = interpolate(this.props.scrollY, { 97 | inputRange: [-(HEADER_RETRACTION_DISTANCE), (HEADER_RETRACTION_DISTANCE)], 98 | outputRange: [0, 1], 99 | extrapolate: Extrapolate.CLAMP, 100 | }); 101 | } 102 | 103 | render(){ 104 | return ( 105 | 106 | {(edgeInsets: EdgeInsets) => { 107 | const { config, orientation, scrollY, urlBarText, style, children, ...rest } = this.props; 108 | const { 109 | contentView = defaultHeader, 110 | progressBar = defaultGradientProgressBar, 111 | backgroundColor, 112 | landscapeRetraction, 113 | portraitRetraction, 114 | progressBarTrackColor, 115 | HEADER_RETRACTED_HEIGHT = DEFAULT_HEADER_RETRACTED_HEIGHT, 116 | HEADER_REVEALED_HEIGHT = DEFAULT_HEADER_REVEALED_HEIGHT, 117 | } = config; 118 | const HEADER_HIDDEN_HEIGHT: number = 0; 119 | const retractionStyle: RetractionStyle = orientation === "portrait" ? portraitRetraction : landscapeRetraction; 120 | 121 | const unsafeAreaCoverHeight: number = edgeInsets.top; 122 | 123 | let heightStyle; 124 | switch(retractionStyle){ 125 | case RetractionStyle.alwaysRevealed: 126 | case RetractionStyle.retractToCompact: 127 | case RetractionStyle.alwaysCompact: 128 | heightStyle = { 129 | height: "auto" 130 | }; 131 | break; 132 | case RetractionStyle.retractToHidden: 133 | heightStyle = { 134 | height: Animated.interpolate( 135 | this.animatedNavBarTranslateYLandscape, 136 | { 137 | inputRange: [HEADER_HIDDEN_HEIGHT, HEADER_REVEALED_HEIGHT], 138 | outputRange: [HEADER_HIDDEN_HEIGHT, HEADER_REVEALED_HEIGHT + URL_BAR_VIEW_PADDING_VERTICAL * 2 + edgeInsets.top + GRADIENT_PROGRESS_BAR_HEIGHT], 139 | extrapolate: Extrapolate.CLAMP, 140 | } 141 | ), 142 | }; 143 | break; 144 | case RetractionStyle.alwaysHidden: 145 | heightStyle = { 146 | height: HEADER_HIDDEN_HEIGHT 147 | }; 148 | } 149 | 150 | return ( 151 | 167 | {contentView({ 168 | config, 169 | scrollY, 170 | animatedNavBarTranslateYLandscape: this.animatedNavBarTranslateYLandscape, 171 | animatedNavBarTranslateYPortrait: this.animatedNavBarTranslateYPortrait, 172 | animatedTitleOpacity: this.animatedTitleOpacity, 173 | toolbarIsShowing: orientation === "landscape", 174 | inOverlayMode: false, 175 | style: { 176 | paddingLeft: edgeInsets.left, 177 | paddingRight: edgeInsets.right, 178 | } 179 | })} 180 | {progressBar({ trackColor: progressBarTrackColor })} 181 | 182 | ); 183 | }} 184 | 185 | ); 186 | } 187 | } 188 | 189 | 190 | export const RetractibleHeaderConnected = connect( 191 | (wholeStoreState: WholeStoreState) => { 192 | // console.log(`wholeStoreState`, wholeStoreState); 193 | return { 194 | urlBarText: wholeStoreState.navigation.urlBarText, 195 | orientation: wholeStoreState.ui.orientation, 196 | }; 197 | }, 198 | {}, 199 | )(RetractibleHeader); 200 | -------------------------------------------------------------------------------- /src/browser/header/TabLocationView.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { TextInput, TextInputProps, NativeSyntheticEvent, TextInputSubmitEditingEventData, View, ViewProps, StyleSheet, StyleProp, TextStyle } from "react-native"; 3 | import { ToolbarButton, ToolbarButtonProps } from "../bothBars/ToolbarButton"; 4 | import { PrivacyIndicatorView } from "../../browser/header/PrivacyIndicatorView"; 5 | import { connect } from 'react-redux'; 6 | import { updateUrlBarText, submitUrlBarTextToWebView } from "../../store/navigationState"; 7 | import { WholeStoreState } from "../../store/store"; 8 | import Animated, { Transitioning } from "react-native-reanimated"; 9 | import { HeaderConfig } from "../browserConfig"; 10 | import { RetractionStyle } from "../bothBars/BarConfig"; 11 | 12 | const TabLocationViewUX = { 13 | Spacing: 8, 14 | PlaceholderLefPadding: 12, 15 | StatusIconSize: 18, 16 | TPIconSize: 24, 17 | ButtonSize: 44, 18 | URLBarPadding: 4, 19 | } 20 | 21 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift#L83 22 | class LockImageView extends React.Component<{ locked: boolean } & ToolbarButtonProps, {}> { 23 | render(){ 24 | const { locked, ...rest } = this.props; 25 | 26 | return ( 27 | // <$Image/> 28 | 29 | ); 30 | } 31 | } 32 | 33 | class ClearUrlBarTextButton extends React.Component<{ urlBarText: string, updateUrlBarText: typeof updateUrlBarText, } & ToolbarButtonProps, {}> { 34 | private readonly onClearButtonPress = () => { 35 | this.props.updateUrlBarText({ text: "", fromNavigationEvent: false }); 36 | }; 37 | 38 | render(){ 39 | const { urlBarText, light, brand, ...rest } = this.props; 40 | 41 | return ( 42 | 48 | ); 49 | } 50 | } 51 | 52 | const ClearUrlBarTextButtonConnected = connect( 53 | (wholeStoreState: WholeStoreState) => { 54 | // console.log(`wholeStoreState`, wholeStoreState); 55 | const { urlBarText } = wholeStoreState.navigation; 56 | 57 | return { 58 | urlBarText, 59 | }; 60 | }, 61 | { 62 | updateUrlBarText, 63 | }, 64 | )(ClearUrlBarTextButton); 65 | 66 | interface DisplayTextFieldProps { 67 | style?: StyleProp, 68 | 69 | activeTab: string, 70 | urlBarText: string, 71 | updateUrlBarText: typeof updateUrlBarText, 72 | submitUrlBarTextToWebView: typeof submitUrlBarTextToWebView, 73 | } 74 | 75 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift#L319 76 | class DisplayTextField extends React.Component { 77 | private readonly onChangeText = (text: string) => { 78 | this.props.updateUrlBarText({ text, fromNavigationEvent: false }); 79 | }; 80 | 81 | private readonly onSubmitEditing = (e: NativeSyntheticEvent) => { 82 | this.props.submitUrlBarTextToWebView(e.nativeEvent.text, this.props.activeTab); 83 | }; 84 | 85 | render(){ 86 | const { urlBarText, style, ...rest } = this.props; 87 | 88 | return ( 89 | 108 | ); 109 | } 110 | } 111 | 112 | const DisplayTextFieldConnected = connect( 113 | (wholeStoreState: WholeStoreState) => { 114 | // console.log(`wholeStoreState`, wholeStoreState); 115 | const { activeTab, urlBarText } = wholeStoreState.navigation; 116 | 117 | return { 118 | activeTab, 119 | urlBarText, 120 | }; 121 | }, 122 | { 123 | updateUrlBarText, 124 | submitUrlBarTextToWebView, 125 | }, 126 | )(DisplayTextField); 127 | 128 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift#L62 129 | class UrlTextField extends React.Component { 130 | render(){ 131 | const { ...rest } = this.props; 132 | 133 | return ( 134 | 135 | // 136 | ); 137 | } 138 | } 139 | 140 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift#L111 141 | class PageOptionsButton extends React.Component<{} & ToolbarButtonProps, {}> { 142 | render(){ 143 | const { ...rest } = this.props; 144 | 145 | return ( 146 | 147 | ); 148 | } 149 | } 150 | 151 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift#L105 152 | class PrivacyIndicator extends React.Component<{} & ToolbarButtonProps, {}> { 153 | render(){ 154 | const { ...rest } = this.props; 155 | 156 | return ( 157 | 158 | ); 159 | } 160 | } 161 | 162 | export const DEFAULT_HEADER_RETRACTED_HEIGHT: number = 22; 163 | export const DEFAULT_HEADER_REVEALED_HEIGHT: number = 44; 164 | // export const HEADER_RETRACTION_DISTANCE: number = DEFAULT_HEADER_REVEALED_HEIGHT - DEFAULT_HEADER_RETRACTED_HEIGHT; 165 | 166 | 167 | interface Props { 168 | activeTabIsSecure: boolean|null, 169 | urlBarText: string, 170 | updateUrlBarText: typeof updateUrlBarText, 171 | config: HeaderConfig, 172 | orientation: "portrait"|"landscape", 173 | scrollY: Animated.Value, 174 | animatedTitleOpacity: Animated.Node, 175 | animatedNavBarTranslateYPortrait: Animated.Node, 176 | animatedNavBarTranslateYLandscape: Animated.Node, 177 | } 178 | 179 | interface State { 180 | } 181 | 182 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift 183 | export class TabLocationView extends React.Component, State>{ 184 | render(){ 185 | const { activeTabIsSecure, urlBarText, config, orientation, ...rest } = this.props; 186 | const { slotBackgroundColor = "darkgray", textFieldTextColor = "black", textFieldBackgroundColor = "transparent", landscapeRetraction, portraitRetraction, HEADER_RETRACTED_HEIGHT = DEFAULT_HEADER_RETRACTED_HEIGHT, HEADER_REVEALED_HEIGHT = DEFAULT_HEADER_REVEALED_HEIGHT, buttonEnabledColor, buttonDisabledColor } = config; 187 | const retractionStyle: RetractionStyle = orientation === "portrait" ? portraitRetraction : landscapeRetraction; 188 | 189 | const HEADER_HIDDEN_HEIGHT: number = 0; 190 | const HEADER_RETRACTION_DISTANCE: number = HEADER_REVEALED_HEIGHT - HEADER_RETRACTED_HEIGHT; 191 | 192 | let heightStyle; 193 | switch(retractionStyle){ 194 | case RetractionStyle.alwaysRevealed: 195 | heightStyle = { 196 | // height: "auto", 197 | height: HEADER_REVEALED_HEIGHT, 198 | }; 199 | break; 200 | case RetractionStyle.alwaysCompact: 201 | heightStyle = { 202 | height: HEADER_RETRACTED_HEIGHT, 203 | }; 204 | break; 205 | case RetractionStyle.retractToCompact: 206 | case RetractionStyle.retractToHidden: 207 | heightStyle = { 208 | height: this.props.animatedNavBarTranslateYPortrait, 209 | }; 210 | break; 211 | case RetractionStyle.alwaysHidden: 212 | heightStyle = { 213 | height: HEADER_HIDDEN_HEIGHT 214 | }; 215 | } 216 | 217 | // Where 1 is not compact and 0 is fully compact. 218 | let scaleFactor: number; 219 | switch(retractionStyle){ 220 | case RetractionStyle.alwaysRevealed: 221 | scaleFactor = 1; 222 | break; 223 | case RetractionStyle.alwaysHidden: 224 | case RetractionStyle.alwaysCompact: 225 | scaleFactor = 0; 226 | break; 227 | case RetractionStyle.retractToCompact: 228 | case RetractionStyle.retractToHidden: 229 | scaleFactor = this.props.animatedTitleOpacity as any; 230 | break; 231 | } 232 | 233 | return ( 234 | /* self.view now flattened down to simplify UI. */ 235 | 236 | /* self.contentView */ 237 | /* https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TabLocationView.swift#L149 */ 238 | /* https://developer.apple.com/documentation/uikit/uistackview */ 239 | 261 | {/* Simplest way to animate a backgroundColor fade-out with nativeDriver: introduce a backdrop view. */} 262 | 272 | 273 | {/* frontSpaceView */} 274 | 275 | 276 | {/* privacyIndicator */} 277 | 287 | 288 | {/* privacyIndicatorSeparator */} 289 | 290 | 304 | 311 | 0 ? "flex": "none", 315 | /* Nothing to do with animation; just my lazy way of making it more compact. */ 316 | transform: [ 317 | { scaleX: 0.80 }, 318 | { scaleY: 0.80 }, 319 | ] 320 | }} 321 | /> 322 | 332 | 333 | {/* Another spacer view */} 334 | 335 | 336 | ); 337 | } 338 | } 339 | 340 | export const TabLocationViewConnected = connect( 341 | (wholeStoreState: WholeStoreState) => { 342 | // console.log(`wholeStoreState.navigation.urlBarText`, wholeStoreState.navigation.urlBarText); 343 | return { 344 | orientation: wholeStoreState.ui.orientation, 345 | urlBarText: wholeStoreState.navigation.urlBarText, 346 | activeTabIsSecure: wholeStoreState.navigation.tabs[wholeStoreState.navigation.activeTab].isSecure, 347 | }; 348 | }, 349 | { 350 | updateUrlBarText, 351 | }, 352 | )(TabLocationView); -------------------------------------------------------------------------------- /src/browser/header/TopTabsContainer.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { View } from "react-native"; 3 | 4 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/TopTabsViewController.swift 5 | // Just a stub for now. 6 | export class TopTabsViewController extends React.Component<{}, {}> { 7 | render(){ 8 | return ( 9 | // UIViewController().view 10 | 11 | {/* topTabFader */} 12 | {/* tabsButton */} 13 | {/* newTab */} 14 | {/* privateModeButton */} 15 | 16 | ); 17 | } 18 | } 19 | 20 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L128 21 | export class TopTabsContainer extends React.Component<{}, {}> { 22 | render(){ 23 | return ( 24 | // UIView() 25 | 26 | {/* topTabsViewController.view */} 27 | 28 | 29 | ); 30 | } 31 | } -------------------------------------------------------------------------------- /src/browser/header/URLBarView.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { View } from "react-native"; 3 | import Animated from "react-native-reanimated"; 4 | import { AutocompleteTextField } from "../../browser/header/AutocompleteTextField"; 5 | import { BackButtonConnected, CancelButtonConnected, ForwardButtonConnected, MenuButtonConnected, StopReloadButtonConnected, TabsButtonConnected } from "../bothBars/BarButtons"; 6 | import { HeaderConfig } from "../browserConfig"; 7 | import { TabLocationViewConnected } from "./TabLocationView"; 8 | 9 | interface State { 10 | // text: string, // locationTextField?.text 11 | } 12 | 13 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/URLBarView.swift#L786 14 | class ToolbarTextField extends React.Component<{}, {}>{ 15 | // Just a themeable AutocompleteTextField 16 | render(){ 17 | return ( 18 | 19 | ); 20 | } 21 | } 22 | 23 | // We need a subclass so we can setup the shadows correctly 24 | // This subclass creates a strong shadow on the URLBar 25 | class TabLocationContainerView extends React.Component<{}, {}>{ 26 | render(){ 27 | return ( 28 | 29 | 30 | 31 | ); 32 | } 33 | } 34 | 35 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/URLBarView.swift#L108 36 | class LocationContainer extends React.Component<{}, {}>{ 37 | render(){ 38 | return ( 39 | 40 | ); 41 | } 42 | } 43 | 44 | /* https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/URLBarView.swift */ 45 | 46 | interface Props { 47 | config: HeaderConfig, 48 | scrollY: Animated.Value, 49 | animatedTitleOpacity: Animated.Node, 50 | animatedNavBarTranslateYPortait: Animated.Node, 51 | animatedNavBarTranslateYLandscape: Animated.Node, 52 | inOverlayMode: boolean, 53 | toolbarIsShowing: boolean, 54 | // location: string, // locationTextField?.text 55 | } 56 | 57 | export const URL_BAR_VIEW_PADDING_VERTICAL: number = 8; 58 | 59 | export class URLBarView extends React.Component{ 60 | constructor(props: Props){ 61 | super(props); 62 | 63 | this.state = { 64 | location: "https://www.birchlabs.co.uk", 65 | }; 66 | } 67 | 68 | render(){ 69 | const { config, toolbarIsShowing, inOverlayMode } = this.props; 70 | const { buttonEnabledColor, buttonDisabledColor } = config; 71 | const { } = this.state; 72 | 73 | let stackContents: React.ReactNode; 74 | 75 | if(inOverlayMode){ 76 | // i.e. URL bar's text field has been focused and the browser displays an overlay over the webpage. 77 | stackContents = ( 78 | <> 79 | {/* AKA locationTextField */} 80 | 81 | 82 | 83 | ); 84 | } else if(toolbarIsShowing){ 85 | // i.e. landscape (so show all the items that the footer would normally handle) 86 | stackContents = ( 87 | <> 88 | 89 | 90 | 91 | {/* AKA locationView. */} 92 | 99 | 100 | 101 | 102 | ); 103 | } else { 104 | // i.e. portrait (so hide all the items that the footer will be handling) 105 | stackContents = ( 106 | <> 107 | {/* AKA locationView. */} 108 | 115 | 116 | ); 117 | } 118 | 119 | return ( 120 | 132 | {stackContents} 133 | 134 | ); 135 | } 136 | } -------------------------------------------------------------------------------- /src/browser/webView/BarAwareWebView.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { connect } from "react-redux"; 3 | import { WholeStoreState } from "../../store/store"; 4 | import { webViews, updateUrlBarText, TabStateRecord, setProgressOnWebView, updateWebViewNavigationState } from "../../store/navigationState"; 5 | import { ViewProps, Platform, ViewStyle } from "react-native"; 6 | import { WebView } from 'react-native-webview'; 7 | import { IOSWebViewProps, WebViewNavigationEvent, WebViewProgressEvent } from 'react-native-webview/lib/WebViewTypes'; 8 | import Animated from "react-native-reanimated"; 9 | import { HeaderConfig } from "../browserConfig"; 10 | import { DEFAULT_HEADER_RETRACTED_HEIGHT, DEFAULT_HEADER_REVEALED_HEIGHT } from "../header/TabLocationView"; 11 | 12 | export type BarAwareWebViewType = (props: BarAwareWebViewOwnProps) => React.ReactNode; 13 | 14 | export interface BarAwareWebViewOwnProps { 15 | headerConfig: HeaderConfig, 16 | scrollY: Animated.Value, 17 | scrollEndDragVelocity: Animated.Value, 18 | } 19 | export interface BarAwareWebViewConnectedProps { 20 | updateUrlBarText: typeof updateUrlBarText, 21 | setProgressOnWebView: typeof setProgressOnWebView, 22 | updateWebViewNavigationState: typeof updateWebViewNavigationState, 23 | activeTab: string, 24 | tabs: TabStateRecord, 25 | } 26 | export type BarAwareWebViewProps = BarAwareWebViewOwnProps & BarAwareWebViewConnectedProps; 27 | 28 | const IosWebView = WebView as React.ComponentClass; 29 | const AnimatedIosWebView = Animated.createAnimatedComponent(IosWebView) as React.ComponentClass>; 30 | 31 | export const DefaultBarAwareWebView: BarAwareWebViewType = (props: BarAwareWebViewOwnProps) => ; 32 | 33 | export class BarAwareWebView extends React.Component { 34 | private readonly onLoadStarted = (event: WebViewNavigationEvent) => { 35 | const { url, navigationType, canGoBack, canGoForward } = event.nativeEvent; 36 | 37 | console.log(`[WebView onLoadStarted] url ${url} navigationType ${navigationType}`); 38 | 39 | // TODO: handle errors 40 | this.props.updateWebViewNavigationState({ canGoBack, canGoForward, tab: this.props.activeTab }); 41 | }; 42 | 43 | private readonly onLoadCommitted = (event: WebViewNavigationEvent) => { 44 | const { url, navigationType, canGoBack, canGoForward } = event.nativeEvent; 45 | 46 | console.log(`[WebView onLoadCommitted] url ${url} navigationType ${navigationType}`); 47 | 48 | if(Platform.OS === "ios" || Platform.OS === "macos"){ 49 | /* iOS seems to fire loading events on the non-main frame, so onLoadCommitted event is the best one on which to update the main-frame URL. 50 | * This event doesn't exist on Android to my knowledge, so I haven't hooked it up in BetterWebView. */ 51 | this.props.updateUrlBarText({ text: url, fromNavigationEvent: true }); 52 | } 53 | this.props.updateWebViewNavigationState({ canGoBack, canGoForward, tab: this.props.activeTab }); 54 | }; 55 | 56 | private readonly onLoadFinished = (event: WebViewNavigationEvent) => { 57 | const { url, navigationType, canGoBack, canGoForward } = event.nativeEvent; 58 | 59 | console.log(`[WebView onLoadFinished] url ${url} navigationType ${navigationType}`); 60 | 61 | // TODO: handle errors 62 | 63 | if(Platform.OS === "android"){ 64 | /* TODO: check whether Android fires onLoadFinished at sensible moments for updating the URL bar text. */ 65 | this.props.updateUrlBarText({ text: url, fromNavigationEvent: true }); 66 | } 67 | this.props.updateWebViewNavigationState({ canGoBack, canGoForward, tab: this.props.activeTab }); 68 | }; 69 | 70 | private readonly onProgress = (event: WebViewProgressEvent) => { 71 | const { url, progress, canGoBack, canGoForward } = event.nativeEvent; 72 | console.log(`[WebView onLoadProgress] progress ${progress}`); 73 | 74 | this.props.setProgressOnWebView({ progress, tab: this.props.activeTab }); 75 | this.props.updateWebViewNavigationState({ canGoBack, canGoForward, tab: this.props.activeTab }); 76 | }; 77 | 78 | // const MyWebView = ({ children, ...rest }) => React.createElement(WebView, props, children); 79 | 80 | render(){ 81 | const { headerConfig, activeTab, tabs, style, children, ...rest } = this.props; 82 | const { 83 | HEADER_RETRACTED_HEIGHT = DEFAULT_HEADER_RETRACTED_HEIGHT, 84 | HEADER_REVEALED_HEIGHT = DEFAULT_HEADER_REVEALED_HEIGHT, 85 | } = headerConfig; 86 | const HEADER_RETRACTION_DISTANCE: number = HEADER_REVEALED_HEIGHT - HEADER_RETRACTED_HEIGHT; 87 | 88 | return ( 89 | { 102 | return Animated.block([ 103 | Animated.cond( 104 | /* We won't update scrollY if there was no panGesture movement. 105 | * This is necessary because onScroll is called without gestures 106 | * sometimes, e.g. due to autolayout when first initialising. */ 107 | Animated.neq(y, 0), 108 | 109 | /* We always receive a gesture relative to 0. 110 | * e.g. when panning down (scrolling up): +3, 9, 12, 20. 111 | * It needs to be added to the current this.props.scrollY to make sense. */ 112 | Animated.set( 113 | this.props.scrollY, 114 | Animated.max( 115 | -HEADER_RETRACTION_DISTANCE, 116 | Animated.min( 117 | HEADER_RETRACTION_DISTANCE, 118 | Animated.add( 119 | this.props.scrollY, 120 | y, 121 | ) 122 | ), 123 | ), 124 | ), 125 | ), 126 | Animated.call( 127 | [y], 128 | (r) => { 129 | // console.log(`Reanimated got arg`, r[0]); 130 | } 131 | ) 132 | ]); 133 | } 134 | } 135 | } 136 | } 137 | ], 138 | { 139 | useNativeDriver: true 140 | } 141 | )} 142 | onScrollEndDrag={Animated.event( 143 | [ 144 | { 145 | nativeEvent: { 146 | velocity: { 147 | y: this.props.scrollEndDragVelocity 148 | } 149 | } 150 | } 151 | ], 152 | { 153 | useNativeDriver: true 154 | } 155 | )} 156 | onLoadStart={this.onLoadStarted} 157 | onLoadCommit={this.onLoadCommitted} 158 | onLoadEnd={this.onLoadFinished} 159 | onLoadProgress={this.onProgress} 160 | /> 161 | ); 162 | } 163 | } 164 | 165 | export const BarAwareWebViewConnected = connect( 166 | (wholeStoreState: WholeStoreState) => { 167 | // console.log(`wholeStoreState`, wholeStoreState); 168 | return { 169 | activeTab: wholeStoreState.navigation.activeTab, 170 | tabs: wholeStoreState.navigation.tabs, 171 | }; 172 | }, 173 | { 174 | updateUrlBarText, 175 | setProgressOnWebView, 176 | updateWebViewNavigationState, 177 | }, 178 | )(BarAwareWebView); 179 | -------------------------------------------------------------------------------- /src/browser/webView/WebViewBackdrop.tsx: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { StyleSheet, View, ViewProps } from "react-native"; 3 | 4 | // https://github.com/cliqz/user-agent-ios/blob/develop/Client/Frontend/Browser/BrowserViewController.swift#L110 5 | export class WebViewBackdrop extends React.Component { 6 | render(){ 7 | const { style, children, ...rest } = this.props; 8 | 9 | return ( 10 | // UIView() 11 | 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/store/navigationState.ts: -------------------------------------------------------------------------------- 1 | import { createSlice, PayloadAction } from "@reduxjs/toolkit"; 2 | import * as React from "react"; 3 | import { convertTextToSearchQuery, isValidUrl, SearchProvider } from "../utils/urlBarTextHandling"; 4 | import { AppThunk } from "./store"; 5 | 6 | type WebView = any; 7 | type WebViewId = string; 8 | export const webViews = new Map>([ 9 | ["tab0", React.createRef()] 10 | ]); 11 | export type TabStateRecord = Record; 12 | 13 | 14 | const initialPage: string = "https://www.birchlabs.co.uk"; 15 | 16 | const navigationSlice = createSlice({ 17 | name: 'navigation', 18 | initialState: { 19 | activeTab: "tab0", 20 | tabs: { 21 | tab0: { 22 | url: initialPage, 23 | isSecure: true, 24 | loadProgress: 0, 25 | canGoBack: false, 26 | canGoForward: false, 27 | } 28 | }, 29 | urlBarText: initialPage, 30 | searchProvider: SearchProvider.DuckDuckGo, 31 | }, 32 | reducers: { 33 | /** 34 | * Update the singleton URL bar's displayed text (does not launch a query). 35 | */ 36 | updateUrlBarText(state, action: PayloadAction<{ text: string, fromNavigationEvent: boolean }>) { 37 | // console.log(`[navigationState.ts] updateUrlBarText action ${JSON.stringify(action)} and state`, state); 38 | const { text, fromNavigationEvent } = action.payload; 39 | state.urlBarText = text; 40 | if(fromNavigationEvent){ 41 | state.tabs[state.activeTab].isSecure = text.startsWith("https://") ? true : text.startsWith("http://") ? false : null; 42 | } 43 | }, 44 | updateWebViewNavigationState(state, action: PayloadAction<{ canGoBack: boolean, canGoForward: boolean, tab?: string }>){ 45 | const { canGoBack, canGoForward, tab = state.activeTab } = action.payload; 46 | state.tabs[tab] = { 47 | ...state.tabs[tab], 48 | canGoBack, 49 | canGoForward, 50 | }; 51 | }, 52 | setUrlOnWebView(state, action: PayloadAction<{ url: string, tab?: string }>) { 53 | // console.log(`[setUrlOnWebView] setting url for activeTab "${state.activeTab}" as: "${action.payload.url}"`); 54 | const { url, tab = state.activeTab } = action.payload; 55 | state.tabs[tab] = { 56 | ...state.tabs[tab], 57 | url, 58 | isSecure: url.startsWith("https://") ? true : url.startsWith("http://") ? false : null, 59 | loadProgress: 0, 60 | }; 61 | }, 62 | setProgressOnWebView(state, action: PayloadAction<{ progress: number, tab?: string }>) { 63 | // console.log(`[setUrlOnWebView] setting progress for activeTab "${state.activeTab}" as: "${action.payload.progress}"`); 64 | const { progress, tab = state.activeTab } = action.payload; 65 | state.tabs[tab].loadProgress = progress; 66 | }, 67 | goBackOnWebView(state, action: PayloadAction){ 68 | 69 | }, 70 | goForwardOnWebView(state, action: PayloadAction){ 71 | 72 | }, 73 | reloadWebView(state, action: PayloadAction){ 74 | 75 | }, 76 | stopWebView(state, action: PayloadAction){ 77 | 78 | }, 79 | } 80 | }); 81 | 82 | export const { updateUrlBarText, setProgressOnWebView, updateWebViewNavigationState } = navigationSlice.actions; 83 | export const navigationSliceReducer = navigationSlice.reducer; 84 | 85 | export function getWebView(tab: string){ 86 | const webViewRef = webViews.get(tab); 87 | if(!webViewRef){ 88 | console.error(`Unable to find webViewRef for tab "${tab}".`); 89 | return null; 90 | } 91 | if(!webViewRef.current){ 92 | console.error(`webViewRef for tab "${tab}" wasn't populated.`); 93 | return null; 94 | } 95 | 96 | if((webViewRef.current as any).getNode){ 97 | console.log(`webViewRef for tab "${tab}" is an Reanimated component; calling getNode() on it.`); 98 | return (webViewRef.current as any).getNode(); 99 | } 100 | 101 | return webViewRef.current!; 102 | } 103 | 104 | export function submitUrlBarTextToWebView(text: string, tab?: string): AppThunk { 105 | return function(dispatch, getState) { 106 | const chosenTab: string = tab || getState().navigation.activeTab; 107 | const webView = getWebView(chosenTab); 108 | if(!webView){ 109 | return Promise.resolve(); 110 | } 111 | 112 | const trimmedText: string = text.trim(); 113 | 114 | if(trimmedText.length === 0){ 115 | return Promise.resolve(); 116 | } 117 | 118 | let url: string; 119 | let protocol: string|null = null; 120 | 121 | if(trimmedText.startsWith("//")){ 122 | // We won't support protocol-relative URLs. 123 | // TODO: reject 124 | return Promise.resolve(); 125 | } 126 | 127 | // https://stackoverflow.com/questions/2824302/how-to-make-regular-expression-into-non-greedy 128 | const protocolMatchArr: RegExpMatchArray|null = trimmedText.match(/.*?:\/\//); 129 | const lacksWhitespace: boolean = !/\s+/.test(trimmedText); // This is a cheap test, so we do it in preference of isValidUrl(). 130 | if( 131 | protocolMatchArr === null || 132 | protocolMatchArr.length === 0 || 133 | trimmedText.indexOf(protocolMatchArr[0]) !== 0 134 | ){ 135 | /* No protocol at start of string. Possible Cases: 136 | * "bbc.co.uk", "foo bar", "what does https:// mean?", "bbc.co.uk#https://" (Safari fails this one as invalid) */ 137 | if(lacksWhitespace && isValidUrl(trimmedText)){ 138 | protocol = "http"; // It's now the server's responsibility to redirect us to HTTPS if available. 139 | url = `${protocol}://${trimmedText}`; 140 | } else { 141 | protocol = "https"; // All our search engines use HTTPS 142 | url = convertTextToSearchQuery( 143 | trimmedText, 144 | getState().navigation.searchProvider, 145 | ); 146 | } 147 | } else { 148 | // Has a protocol at start ("https://bbc.co.uk"). 149 | protocol = protocolMatchArr[0].slice(0, -("://".length)); 150 | url = trimmedText; 151 | } 152 | 153 | if(protocol === "file"){ 154 | // We won't support file browsing (can rethink this later). 155 | // TODO: reject 156 | return Promise.resolve(); 157 | } 158 | 159 | if(webView.src === url){ 160 | console.log(`[setUrlOnWebView] Setting URL on webView for chosenTab "${chosenTab}" as same as before, so reloading: ${url}`); 161 | webView.reload(); 162 | } else { 163 | console.log(`[setUrlOnWebView] Setting URL on webView for chosenTab "${chosenTab}" as: ${url}`); 164 | webView.src = url; 165 | } 166 | 167 | console.log(`[setUrlOnWebView] Dispatching action to set url for chosenTab "${chosenTab}" as: "${url}"`); 168 | 169 | return dispatch(navigationSlice.actions.setUrlOnWebView({ url, canGoBack: webView.canGoBack, canGoForward: webView.canGoForward, tab: chosenTab })); 170 | }; 171 | } 172 | 173 | export function goBackOnWebView(tab?: string): AppThunk { 174 | return function(dispatch, getState) { 175 | const chosenTab: string = tab || getState().navigation.activeTab; 176 | const webView = getWebView(chosenTab); 177 | if(!webView){ 178 | return Promise.resolve(); 179 | } 180 | 181 | console.log(`[goBackOnWebView] Calling goBack() on webView for chosenTab "${chosenTab}" while canGoBack is: ${webView.canGoBack}`); 182 | webView.goBack(); 183 | 184 | return dispatch(navigationSlice.actions.goBackOnWebView()); 185 | }; 186 | } 187 | 188 | export function goForwardOnWebView(tab?: string): AppThunk { 189 | return function(dispatch, getState) { 190 | const chosenTab: string = tab || getState().navigation.activeTab; 191 | const webView = getWebView(chosenTab); 192 | if(!webView){ 193 | return Promise.resolve(); 194 | } 195 | 196 | console.log(`[goForwardOnWebView] Calling goForward() on webView for chosenTab "${chosenTab}" while canGoForward is: ${webView.canGoForward}`); 197 | webView.goForward(); 198 | 199 | return dispatch(navigationSlice.actions.goForwardOnWebView()); 200 | }; 201 | } 202 | 203 | 204 | export function reloadWebView(tab?: string): AppThunk { 205 | return function(dispatch, getState) { 206 | const chosenTab: string = tab || getState().navigation.activeTab; 207 | const webView = getWebView(chosenTab); 208 | if(!webView){ 209 | return Promise.resolve(); 210 | } 211 | 212 | console.log(`[goBackOnWebView] Calling reload() on webView for chosenTab "${chosenTab}".`); 213 | webView.reload(); 214 | 215 | return dispatch(navigationSlice.actions.reloadWebView()); 216 | }; 217 | } 218 | 219 | export function stopWebView(tab?: string): AppThunk { 220 | return function(dispatch, getState) { 221 | const chosenTab: string = tab || getState().navigation.activeTab; 222 | const webView = getWebView(chosenTab); 223 | if(!webView){ 224 | return Promise.resolve(); 225 | } 226 | 227 | console.log(`[stopWebView] Calling reload() on webView for chosenTab "${chosenTab}".`); 228 | webView.stopLoading(); 229 | 230 | return dispatch(navigationSlice.actions.stopWebView()); 231 | }; 232 | } 233 | -------------------------------------------------------------------------------- /src/store/rootReducer.ts: -------------------------------------------------------------------------------- 1 | import { combineReducers } from "@reduxjs/toolkit"; 2 | import { navigationSliceReducer } from "./navigationState"; 3 | import { uiSliceReducer } from "./uiState"; 4 | 5 | export const rootReducer = combineReducers({ 6 | ui: uiSliceReducer, 7 | navigation: navigationSliceReducer, 8 | }); 9 | 10 | export type RootReducer = ReturnType; -------------------------------------------------------------------------------- /src/store/store.ts: -------------------------------------------------------------------------------- 1 | import { configureStore } from "@reduxjs/toolkit"; 2 | import { rootReducer, RootReducer } from "./rootReducer"; 3 | import thunk, { ThunkAction } from "redux-thunk"; 4 | import { Action } from 'redux'; 5 | 6 | export const store = configureStore({ 7 | reducer: rootReducer, 8 | middleware: [thunk], 9 | }); 10 | 11 | export type WholeStoreState = RootReducer; 12 | // https://redux.js.org/recipes/usage-with-typescript/#usage-with-redux-thunk 13 | export type AppThunk = ThunkAction< 14 | ReturnType, 15 | WholeStoreState, 16 | null, 17 | Action 18 | >; -------------------------------------------------------------------------------- /src/store/uiState.ts: -------------------------------------------------------------------------------- 1 | import { createSlice, PayloadAction } from "@reduxjs/toolkit"; 2 | import { Dimensions } from "react-native"; 3 | 4 | export function isPortrait(): boolean { 5 | const { width, height } = Dimensions.get('screen'); 6 | return height >= width; 7 | }; 8 | 9 | const uiSlice = createSlice({ 10 | name: 'ui', 11 | initialState: { 12 | orientation: isPortrait() ? 'portrait' : 'landscape', 13 | }, 14 | reducers: { 15 | updateOrientation(state, action: PayloadAction<'portrait' | 'landscape'>) { 16 | state.orientation = action.payload; 17 | }, 18 | } 19 | }); 20 | 21 | export const { updateOrientation } = uiSlice.actions; 22 | export const uiSliceReducer = uiSlice.reducer; -------------------------------------------------------------------------------- /src/utils/urlBarTextHandling.ts: -------------------------------------------------------------------------------- 1 | /* Safer regex of the two given in: https://stackoverflow.com/a/4749397/5951226 */ 2 | // The original Regex written and escaped for usage in Obj-C: "(?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/?)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))*(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’])*)" 3 | 4 | const urlRegEx: RegExp = /^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/?)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))*(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'\".,<>?«»“”‘’])*)/i 5 | 6 | export function isValidUrl(text: string): boolean { 7 | return urlRegEx.test(text); 8 | } 9 | 10 | export enum SearchProvider { 11 | Bing = "Bing", 12 | 13 | /* I'll support these later */ 14 | // Cliqz = "Cliqz", 15 | DuckDuckGo = "DuckDuckGo", 16 | Google = "Google", 17 | // Yahoo = "Yahoo", 18 | } 19 | 20 | export function convertTextToSearchQuery(text: string, searchProvider: SearchProvider): string { 21 | let searchQuery: string = ""; 22 | switch(searchProvider){ 23 | case SearchProvider.Bing: 24 | { 25 | const termDelimiter: string = "+"; 26 | const params: string = text.split(" ").reduce((acc, term, i) => acc + (i > 0 ? termDelimiter : "") + encodeURIComponent(term), "") 27 | searchQuery = "https://www.bing.com/search?q=" + params; 28 | } 29 | break; 30 | case SearchProvider.Google: 31 | { 32 | const termDelimiter: string = "%20"; 33 | const params: string = text.split(" ").reduce((acc, term, i) => acc + (i > 0 ? termDelimiter : "") + encodeURIComponent(term), "") 34 | searchQuery = "https://www.google.com/search?q=" + params; 35 | } 36 | break; 37 | case SearchProvider.DuckDuckGo: 38 | { 39 | // Seems to accept either "+" or "%20" as a term delimeter. 40 | const termDelimiter: string = "+"; 41 | const params: string = text.split(" ").reduce((acc, term, i) => acc + (i > 0 ? termDelimiter : "") + encodeURIComponent(term), "") 42 | searchQuery = "https://www.duckduckgo.com/?q=" + params; 43 | } 44 | break; 45 | } 46 | 47 | return searchQuery; 48 | } -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig", 3 | "compilerOptions": { 4 | "target": "esnext", 5 | "noEmit": false, 6 | "declaration": true, 7 | "outDir": "dist", 8 | "removeComments": false, 9 | "sourceMap": true 10 | }, 11 | "include": ["src"] 12 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "jsx": "react-native", 5 | "lib": ["dom", "esnext"], 6 | "baseUrl": ".", 7 | "paths": { 8 | "*": [ 9 | "./node_modules/*" 10 | ] 11 | }, 12 | "moduleResolution": "node", 13 | "noEmit": true, 14 | "skipLibCheck": true, 15 | "resolveJsonModule": true 16 | }, 17 | "exclude": [ 18 | "node_modules", 19 | "dist" 20 | ] 21 | } 22 | --------------------------------------------------------------------------------