diff --git a/.eslintignore b/.eslintignore index 659d5f474585e..08e37e82948a3 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,7 +4,6 @@ build-module node_modules packages/block-serialization-spec-parser/parser.js packages/e2e-tests/plugins -packages/react-native-* playground/dist vendor wordpress diff --git a/package-lock.json b/package-lock.json index 2c7cf600f1cc7..8d9f828aa7bbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10833,6 +10833,7 @@ "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.14.3", "eslint-plugin-react-hooks": "^1.6.1", + "eslint-plugin-react-native": "^3.8.1", "globals": "^12.0.0", "prettier": "npm:wp-prettier@1.19.1", "requireindex": "^1.2.0" @@ -11088,7 +11089,8 @@ "react-native-sass-transformer": "^1.1.1", "react-native-svg": "git+https://github.com/wordpress-mobile/react-native-svg.git#a628e92990a2404e30a0086f168bd2b5b7b4ce96", "react-native-url-polyfill": "^1.1.2", - "react-native-video": "git+https://github.com/wordpress-mobile/react-native-video.git#c43bdf6b06d361da399b98b8d2e32b578fa188ac" + "react-native-video": "git+https://github.com/wordpress-mobile/react-native-video.git#c43bdf6b06d361da399b98b8d2e32b578fa188ac", + "wd": "^1.11.1" }, "dependencies": { "jsc-android": { @@ -11766,6 +11768,133 @@ "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, + "archiver": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-3.1.1.tgz", + "integrity": "sha512-5Hxxcig7gw5Jod/8Gq0OneVgLYET+oNHcxgWItq4TbhOzRLKNAFUb9edAftiMKXvXfCB0vbGrJdZDNq0dWMsxg==", + "requires": { + "archiver-utils": "^2.1.0", + "async": "^2.6.3", + "buffer-crc32": "^0.2.1", + "glob": "^7.1.4", + "readable-stream": "^3.4.0", + "tar-stream": "^2.1.0", + "zip-stream": "^2.1.2" + }, + "dependencies": { + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "bl": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.2.tgz", + "integrity": "sha512-j4OH8f6Qg2bGuWfRiltT2HYGx0e1QcBTrK9KAHNMwMZdQnDZFk0ZSYIpADjYCB3U12nicC5tVJwSIhwOWjb4RQ==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } + } + }, + "buffer": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.5.0.tgz", + "integrity": "sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "tar-stream": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz", + "integrity": "sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q==", + "requires": { + "bl": "^4.0.1", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + } + } + } + }, + "archiver-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "requires": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "graceful-fs": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", + "integrity": "sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ==" + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + } + } + }, "are-we-there-yet": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", @@ -14833,6 +14962,24 @@ "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" }, + "compress-commons": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-2.1.1.tgz", + "integrity": "sha512-eVw6n7CnEMFzc3duyFVrQEuY1BlHR3rYsSztyG32ibGMW722i3C6IizEGMFmfMU+A+fALvBIwxN3czffTcdA+Q==", + "requires": { + "buffer-crc32": "^0.2.13", + "crc32-stream": "^3.0.1", + "normalize-path": "^3.0.0", + "readable-stream": "^2.3.6" + }, + "dependencies": { + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + } + } + }, "compressible": { "version": "2.0.17", "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.17.tgz", @@ -15696,6 +15843,46 @@ } } }, + "crc": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", + "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", + "requires": { + "buffer": "^5.1.0" + }, + "dependencies": { + "buffer": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.5.0.tgz", + "integrity": "sha512-9FTEDjLjwoAkEwyMGDjYJQN2gfRgOKBKRfiglhvibGbpeeU/pQn1bJxQqm32OD/AIeEuHxU9roxXxg34Byp/Ww==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" + } + } + } + }, + "crc32-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-3.0.1.tgz", + "integrity": "sha512-mctvpXlbzsvK+6z8kJwSJ5crm7yBwrQMTybJzMw1O4lLGJqjlDCXY2Zw7KheiA6XBEcBmfLx1D88mjRGVJtY9w==", + "requires": { + "crc": "^3.4.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "create-ecdh": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", @@ -18172,6 +18359,19 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.6.1.tgz", "integrity": "sha512-wHhmGJyVuijnYIJXZJHDUF2WM+rJYTjulUTqF9k61d3BTk8etydz+M4dXUVH7M76ZRS85rqBTCx0Es/lLsrjnA==" }, + "eslint-plugin-react-native": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-native/-/eslint-plugin-react-native-3.8.1.tgz", + "integrity": "sha512-6Z4s4nvgFRdda/1s1+uu4a6EMZwEjjJ9Bk/1yBImv0fd9U2CsGu2cUakAtV83cZKhizbWhSouXoaK4JtlScdFg==", + "requires": { + "eslint-plugin-react-native-globals": "^0.1.1" + } + }, + "eslint-plugin-react-native-globals": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz", + "integrity": "sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g==" + }, "eslint-scope": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", @@ -19595,8 +19795,7 @@ "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "fs-exists-sync": { "version": "0.1.0", @@ -25576,6 +25775,14 @@ } } }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "requires": { + "readable-stream": "^2.0.5" + } + }, "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", @@ -26110,6 +26317,16 @@ "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", "dev": true }, + "lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" + }, + "lodash.difference": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.difference/-/lodash.difference-4.5.0.tgz", + "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" + }, "lodash.differencewith": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.differencewith/-/lodash.differencewith-4.5.0.tgz", @@ -26162,8 +26379,7 @@ "lodash.isplainobject": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", - "dev": true + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" }, "lodash.memoize": { "version": "4.1.2", @@ -26229,6 +26445,11 @@ "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=" }, + "lodash.union": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", + "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -39927,6 +40148,11 @@ "builtins": "^1.0.3" } }, + "vargs": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/vargs/-/vargs-0.1.0.tgz", + "integrity": "sha1-a2GE2mUgzDIEzhtAfKwm2SYJ6/8=" + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -40199,6 +40425,20 @@ "defaults": "^1.0.3" } }, + "wd": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/wd/-/wd-1.12.1.tgz", + "integrity": "sha512-O99X8OnOgkqfmsPyLIRzG9LmZ+rjmdGFBCyhGpnsSL4MB4xzHoeWmSVcumDiQ5QqPZcwGkszTgeJvjk2VjtiNw==", + "requires": { + "archiver": "^3.0.0", + "async": "^2.0.0", + "lodash": "^4.0.0", + "mkdirp": "^0.5.1", + "q": "^1.5.1", + "request": "2.88.0", + "vargs": "^0.1.0" + } + }, "web-namespaces": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.3.tgz", @@ -41353,6 +41593,28 @@ "fd-slicer": "~1.0.1" } }, + "zip-stream": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.3.tgz", + "integrity": "sha512-EkXc2JGcKhO5N5aZ7TmuNo45budRaFGHOmz24wtJR7znbNqDPmdZtUauKX6et8KAVseAMBOyWJqEpXcHTBsh7Q==", + "requires": { + "archiver-utils": "^2.1.0", + "compress-commons": "^2.1.1", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, "zwitch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.4.tgz", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 25280cf8616f1..554c824fa5b09 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -32,6 +32,7 @@ "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.14.3", "eslint-plugin-react-hooks": "^1.6.1", + "eslint-plugin-react-native": "^3.8.1", "globals": "^12.0.0", "prettier": "npm:wp-prettier@1.19.1", "requireindex": "^1.2.0" diff --git a/packages/react-native-aztec/.flowconfig b/packages/react-native-aztec/.flowconfig deleted file mode 100644 index 1fed445333e85..0000000000000 --- a/packages/react-native-aztec/.flowconfig +++ /dev/null @@ -1,11 +0,0 @@ -[ignore] - -[include] - -[libs] - -[lints] - -[options] - -[strict] diff --git a/packages/react-native-aztec/README.md b/packages/react-native-aztec/README.md index 2bda062f08aff..05ece82f3aacd 100644 --- a/packages/react-native-aztec/README.md +++ b/packages/react-native-aztec/README.md @@ -7,66 +7,3 @@ Wrapping Aztec Android and Aztec iOS in a React Native component # License GPL v2 - -## Android: Run the example app - -Make sure to have an emulator running or an Android device connected, and then: - -``` -$ cd example/ -$ yarn clean:install -$ yarn android -``` - -This will build the Android library (via `gradle`) and example app, then launch the main example activity on your connected device and run the Metro bundler at the same time. - -## iOS: Run the example app - -Before being able to run the Example App, you'll need to install [Carthage](https://github.com/Carthage/Carthage) and the dependencies for this project: -``` -cd ios -carthage bootstrap --platform iOS -``` - -Then go back to the root directory of the project and do: -``` -$ cd example/ -$ yarn clean:install -$ yarn ios -``` - -This will compile the example project, launch metro, run the simulator and run the app. - -## FAQ / Troubleshooting - -Q: The example app doesn't run - -A: Make sure you have yarn and babel installed (https://yarnpkg.com/lang/en/docs/install/) - - -Q: The example app gets compiled but ReactNative cannot connect to Metro bundler (I'm on a real device attached through USB) - -A: To debug on the device through USB, remember to revert ports before launching metro: -`adb reverse tcp:8081 tcp:8081` - - -Q: The example app gets compiled but ReactNative shows an error - -A: try running, from the root folder in the project -``` -$ cd example/ -$ yarn start --reset-cache -``` - -Open a new shell window and run either of these depending on the platform: - -``` -$ yarn android -``` - -or - -``` -$ yarn ios -``` - diff --git a/packages/react-native-aztec/example/.babelrc b/packages/react-native-aztec/example/.babelrc deleted file mode 100644 index d4b74b5be7b43..0000000000000 --- a/packages/react-native-aztec/example/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["module:metro-react-native-babel-preset"] -} diff --git a/packages/react-native-aztec/example/App.js b/packages/react-native-aztec/example/App.js deleted file mode 100644 index fdb6b468f875f..0000000000000 --- a/packages/react-native-aztec/example/App.js +++ /dev/null @@ -1,83 +0,0 @@ -import React from 'react'; -import {AppRegistry, StyleSheet, TextInput, FlatList, KeyboardAvoidingView, SafeAreaView, Platform} from 'react-native'; -import {example_content} from './content'; -import Editor from './editor' - -const _minHeight = 100; - -const sampleContent = example_content(); - -const elements = [ - {key: '1', text: sampleContent, height: _minHeight}, - {key: '2', text: sampleContent, height: _minHeight}, - {key: '3', text: sampleContent, height: _minHeight}, - {key: '4', text: sampleContent, height: _minHeight}, - {key: '5', text: sampleContent, height: _minHeight}, - {key: '6', text: sampleContent, height: _minHeight}, - ] - -export default class example extends React.Component { - constructor(props) { - super(props); - this.renderItem = this.renderItem.bind(this) - this.renderItemAsTextInput = this.renderItemAsTextInput.bind(this) - this.state = {isShowingText: true, data: elements}; - } - - renderItem( { item } ) { - const key = item.key; - return ( - { - let newHeight = contentSize.height; - const newElements = this.state.data.map( searchItem => { - if (searchItem.key == key) { - return {...searchItem, height: newHeight}; - } else { - return searchItem; - } - }) - this.setState( { data: newElements}) - }} - /> - ) - } - - renderItemAsTextInput( { item } ) { - return ( - ) - } - - render() { - const data = this.state.data; - const mainContent = ( - - - - ); - if (Platform.OS === "ios") { - return ({mainContent}) - } else { - return mainContent - } - } -} - -var styles = StyleSheet.create({ - container: { - flex: 1 - }, - aztec_editor: { - minHeight: _minHeight, - margin: 10, - }, -}); - -AppRegistry.registerComponent('example', () => example); diff --git a/packages/react-native-aztec/example/android/app/build.gradle b/packages/react-native-aztec/example/android/app/build.gradle deleted file mode 100644 index a64a36b4dfa98..0000000000000 --- a/packages/react-native-aztec/example/android/app/build.gradle +++ /dev/null @@ -1,159 +0,0 @@ -apply plugin: 'com.android.application' - -/** - * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets - * and bundleReleaseJsAndAssets). - * These basically call `react-native bundle` with the correct arguments during the Android build - * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the - * bundle directly from the development server. Below you can see all the possible configurations - * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "../../node_modules/react-native/react.gradle"` line. - * - * project.ext.react = [ - * // the name of the generated asset file containing your JS bundle - * bundleAssetName: "index.android.bundle", - * - * // the entry file for bundle generation - * entryFile: "index.android.js", - * - * // whether to bundle JS and assets in debug mode - * bundleInDebug: false, - * - * // whether to bundle JS and assets in release mode - * bundleInRelease: true, - * - * // whether to bundle JS and assets in another build variant (if configured). - * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants - * // The configuration property can be in the following formats - * // 'bundleIn${productFlavor}${buildType}' - * // 'bundleIn${buildType}' - * // bundleInFreeDebug: true, - * // bundleInPaidRelease: true, - * // bundleInBeta: true, - * - * // whether to disable dev mode in custom build variants (by default only disabled in release) - * // for example: to disable dev mode in the staging build type (if configured) - * devDisabledInStaging: true, - * // The configuration property can be in the following formats - * // 'devDisabledIn${productFlavor}${buildType}' - * // 'devDisabledIn${buildType}' - * - * // the root of your project, i.e. where "package.json" lives - * root: "../../", - * - * // where to put the JS bundle asset in debug mode - * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", - * - * // where to put the JS bundle asset in release mode - * jsBundleDirRelease: "$buildDir/intermediates/assets/release", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in debug mode - * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", - * - * // where to put drawable resources / React Native assets, e.g. the ones you use via - * // require('./image.png')), in release mode - * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", - * - * // by default the gradle tasks are skipped if none of the JS files or assets change; this means - * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to - * // date; if you have any other folders that you want to ignore for performance reasons (gradle - * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ - * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"], - * - * // override which node gets called and with what additional arguments - * nodeExecutableAndArgs: ["node"], - * - * // supply additional arguments to the packager - * extraPackagerArgs: [] - * ] - */ - -project.ext.react = [ - entryFile: "index.js" -] - -apply from: "../../node_modules/react-native/react.gradle" - -// The sample build uses multiple directories to -// keep boilerplate and common code separate from -// the main sample code. -List dirs = [ - 'main', // main sample code; look here for the interesting stuff. - 'common', // components that are reused by multiple samples - 'template'] // boilerplate code that is generated by the sample template process - -android { - compileSdkVersion 27 - - buildToolsVersion "27.0.3" - - defaultConfig { - minSdkVersion 16 - targetSdkVersion 26 - - ndk { - abiFilters "armeabi-v7a", "x86" - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 - } - - sourceSets { - main { - dirs.each { dir -> - java.srcDirs "src/${dir}/java" - res.srcDirs "src/${dir}/res" - } - } - - androidTest.setRoot('tests') - androidTest.java.srcDirs = ['tests/src'] - } - - lintOptions { - disable 'GradleCompatible' - } -} - -buildscript { - repositories { - jcenter() - google() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - } -} - -repositories { - jcenter() - google() - maven { url "https://jitpack.io" } -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" - - implementation "com.android.support:appcompat-v7:$supportLibVersion" - implementation "org.wordpress:utils:$wordpressUtilsVersion" - - implementation project(':react-native-aztec') - - implementation "com.android.support:support-v4:$supportLibVersion" - implementation "com.android.support:gridlayout-v7:$supportLibVersion" - implementation "com.android.support:cardview-v7:$supportLibVersion" - implementation "com.android.support:appcompat-v7:$supportLibVersion" - implementation "com.android.support:recyclerview-v7:$supportLibVersion" - - implementation "com.facebook.react:react-native:+" // From node_modules. -} - - - - diff --git a/packages/react-native-aztec/example/android/app/src/main/AndroidManifest.xml b/packages/react-native-aztec/example/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 0a320c48727b1..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/MainActivity.java b/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/MainActivity.java deleted file mode 100644 index 20f7dcac324d6..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/MainActivity.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright 2013 The Android Open Source Project -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - - -package com.example.android; - -import android.os.Bundle; -import android.support.v4.app.FragmentTransaction; -import android.view.KeyEvent; - -import com.example.android.common.activities.SampleRNBaseActivity; - -/** - * A simple launcher activity containing a summary sample description, sample log and a custom - * {@link android.support.v4.app.Fragment} which can display a view. - *

- * For devices with displays with a width of 720dp or greater, the sample log is always visible, - * on other devices it's visibility is controlled by an item on the Action Bar. - */ -public class MainActivity extends SampleRNBaseActivity { - - public static final String TAG = "MainActivity"; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - if (savedInstanceState == null) { - FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); - MyFragment fragment = new MyFragment(); - transaction.replace(R.id.sample_content_fragment, fragment); - transaction.commit(); - } - } - - @Override - public boolean onKeyUp(int keyCode, KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { - mReactInstanceManager.showDevOptionsDialog(); - return true; - } - return super.onKeyUp(keyCode, event); - } - -} diff --git a/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/MyFragment.java b/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/MyFragment.java deleted file mode 100644 index ae4986adc122b..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/MyFragment.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.example.android; - -import android.app.Activity; -import android.os.Bundle; -import android.support.v4.app.Fragment; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - -import com.example.android.common.activities.SampleRNBaseActivity; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.ReactRootView; - -public class MyFragment extends Fragment { - - private static final String TAG = "MyFragment"; - - private ReactInstanceManager mReactInstanceManager; - - @Override - public void onAttach(Activity activity) { - super.onAttach(activity); - try { - mReactInstanceManager = ((SampleRNBaseActivity) activity).getReactInstanceManager(); - } catch (ClassCastException e) { - throw new ClassCastException(activity.toString() + " must extends SampleRNBaseActivity"); - } - } - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - if (mReactInstanceManager == null) { - try { - mReactInstanceManager = ((SampleRNBaseActivity) getActivity()).getReactInstanceManager(); - } catch (ClassCastException e) { - throw new ClassCastException(getActivity().toString() + " must extends SampleRNBaseActivity"); - } - } - - ReactRootView reactRootView = new ReactRootView(getContext()); - reactRootView.startReactApplication(mReactInstanceManager, "example", null); - return reactRootView; - } - - @Override - public void onSaveInstanceState(Bundle savedInstanceState) { - super.onSaveInstanceState(savedInstanceState); - } - -} diff --git a/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/common/activities/SampleRNBaseActivity.java b/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/common/activities/SampleRNBaseActivity.java deleted file mode 100644 index 76084a08a7ddf..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/java/com/example/android/common/activities/SampleRNBaseActivity.java +++ /dev/null @@ -1,86 +0,0 @@ -/* -* Copyright 2013 The Android Open Source Project -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package com.example.android.common.activities; - -import android.os.Bundle; -import android.support.v4.app.FragmentActivity; - -import org.wordpress.mobile.ReactNativeAztec.ReactAztecPackage; -import org.wordpress.mobile.ReactNativeAztec.BuildConfig; -import com.facebook.react.ReactInstanceManager; -import com.facebook.react.common.LifecycleState; -import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; -import com.facebook.react.shell.MainReactPackage; - -/** - * Base launcher activity, to handle most of the common plumbing for samples. - */ -public class SampleRNBaseActivity extends FragmentActivity implements DefaultHardwareBackBtnHandler { - - public static final String TAG = "SampleRNBaseActivity"; - protected ReactInstanceManager mReactInstanceManager; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - mReactInstanceManager = ReactInstanceManager.builder() - .setApplication(getApplication()) - .setBundleAssetName("index.android.bundle") - .setJSMainModulePath("index") - .addPackage(new MainReactPackage()) - .addPackage(new ReactAztecPackage()) - .setUseDeveloperSupport(BuildConfig.DEBUG) - .setInitialLifecycleState(LifecycleState.RESUMED) - .build(); - } - - public ReactInstanceManager getReactInstanceManager() { - return mReactInstanceManager; - } - - @Override - protected void onPause() { - super.onPause(); - - if (mReactInstanceManager != null) { - mReactInstanceManager.onHostPause(this); - } - } - - @Override - protected void onResume() { - super.onResume(); - - if (mReactInstanceManager != null) { - mReactInstanceManager.onHostResume(this, this); - } - } - - @Override - protected void onDestroy() { - super.onDestroy(); - - if (mReactInstanceManager != null) { - mReactInstanceManager.onHostDestroy(this); - } - } - - @Override - public void invokeDefaultOnBackPressed() { - super.onBackPressed(); - } -} diff --git a/packages/react-native-aztec/example/android/app/src/main/res/drawable-hdpi/ic_launcher.png b/packages/react-native-aztec/example/android/app/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index bcb72b12f5511..0000000000000 Binary files a/packages/react-native-aztec/example/android/app/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-aztec/example/android/app/src/main/res/drawable-hdpi/tile.9.png b/packages/react-native-aztec/example/android/app/src/main/res/drawable-hdpi/tile.9.png deleted file mode 100644 index 135862883e26e..0000000000000 Binary files a/packages/react-native-aztec/example/android/app/src/main/res/drawable-hdpi/tile.9.png and /dev/null differ diff --git a/packages/react-native-aztec/example/android/app/src/main/res/drawable-mdpi/ic_launcher.png b/packages/react-native-aztec/example/android/app/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 37e5bce60f095..0000000000000 Binary files a/packages/react-native-aztec/example/android/app/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-aztec/example/android/app/src/main/res/drawable-xhdpi/ic_launcher.png b/packages/react-native-aztec/example/android/app/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 1c4a85a0204f3..0000000000000 Binary files a/packages/react-native-aztec/example/android/app/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-aztec/example/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/packages/react-native-aztec/example/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index b26545c36b837..0000000000000 Binary files a/packages/react-native-aztec/example/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/packages/react-native-aztec/example/android/app/src/main/res/drawable/ic_reorder_black_24dp.xml b/packages/react-native-aztec/example/android/app/src/main/res/drawable/ic_reorder_black_24dp.xml deleted file mode 100644 index 2b87cd8404bfb..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/drawable/ic_reorder_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/layout-w720dp/activity_main.xml b/packages/react-native-aztec/example/android/app/src/main/res/layout-w720dp/activity_main.xml deleted file mode 100644 index 7e7ec64b17e86..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/layout-w720dp/activity_main.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/layout/activity_main.xml b/packages/react-native-aztec/example/android/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 51434768bad50..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/menu/main.xml b/packages/react-native-aztec/example/android/app/src/main/res/menu/main.xml deleted file mode 100644 index 29c52f8ed465f..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/menu/main.xml +++ /dev/null @@ -1,23 +0,0 @@ - - -

- - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values-sw600dp/template-dimens.xml b/packages/react-native-aztec/example/android/app/src/main/res/values-sw600dp/template-dimens.xml deleted file mode 100644 index 22074a2bdbaf6..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values-sw600dp/template-dimens.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - @dimen/margin_huge - @dimen/margin_medium - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values-sw600dp/template-styles.xml b/packages/react-native-aztec/example/android/app/src/main/res/values-sw600dp/template-styles.xml deleted file mode 100644 index 03d1974183dd6..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values-sw600dp/template-styles.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values/colors.xml b/packages/react-native-aztec/example/android/app/src/main/res/values/colors.xml deleted file mode 100644 index c2832bdb7b1ec..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - #00BCD4 - #00838F - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values/dimens.xml b/packages/react-native-aztec/example/android/app/src/main/res/values/dimens.xml deleted file mode 100644 index 8c5b99af6bdba..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - 100dp - \ No newline at end of file diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values/fragmentview_strings.xml b/packages/react-native-aztec/example/android/app/src/main/res/values/fragmentview_strings.xml deleted file mode 100644 index 7b9d9ec4f3c52..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values/fragmentview_strings.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - Show Log - Hide Log - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values/strings.xml b/packages/react-native-aztec/example/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 45031ada040fa..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Aztec React Native example - Element - Grid Layout Manager - Linear Layout Manager - \ No newline at end of file diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values/styles.xml b/packages/react-native-aztec/example/android/app/src/main/res/values/styles.xml deleted file mode 100755 index 5db0d48712eef..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values/template-dimens.xml b/packages/react-native-aztec/example/android/app/src/main/res/values/template-dimens.xml deleted file mode 100644 index 39e710b5ca358..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values/template-dimens.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - 4dp - 8dp - 16dp - 32dp - 64dp - - - - @dimen/margin_medium - @dimen/margin_medium - - diff --git a/packages/react-native-aztec/example/android/app/src/main/res/values/template-styles.xml b/packages/react-native-aztec/example/android/app/src/main/res/values/template-styles.xml deleted file mode 100644 index 199025ef2359d..0000000000000 --- a/packages/react-native-aztec/example/android/app/src/main/res/values/template-styles.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/react-native-aztec/example/android/build.gradle b/packages/react-native-aztec/example/android/build.gradle deleted file mode 100644 index 79d431ac34db0..0000000000000 --- a/packages/react-native-aztec/example/android/build.gradle +++ /dev/null @@ -1,46 +0,0 @@ -buildscript { - ext { - gradlePluginVersion = '3.0.1' - kotlinVersion = '1.2.61' - supportLibVersion = '27.1.1' - tagSoupVersion = '1.2.1' - glideVersion = '3.7.0' - picassoVersion = '2.5.2' - robolectricVersion = '3.5.1' - jUnitVersion = '4.12' - jSoupVersion = '1.10.3' - wordpressUtilsVersion = '1.22' - espressoVersion = '3.0.1' - } - - repositories { - jcenter() - google() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - } - - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - mavenLocal() - jcenter() - maven { - // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$rootDir/../node_modules/react-native/android" - } - } -} diff --git a/packages/react-native-aztec/example/android/gradle/wrapper/gradle-wrapper.jar b/packages/react-native-aztec/example/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 8c0fb64a8698b..0000000000000 Binary files a/packages/react-native-aztec/example/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/packages/react-native-aztec/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/react-native-aztec/example/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 7b466bd228b49..0000000000000 --- a/packages/react-native-aztec/example/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Mon Sep 08 13:53:18 PDT 2014 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip \ No newline at end of file diff --git a/packages/react-native-aztec/example/android/gradlew b/packages/react-native-aztec/example/android/gradlew deleted file mode 100755 index 91a7e269e19df..0000000000000 --- a/packages/react-native-aztec/example/android/gradlew +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/packages/react-native-aztec/example/android/gradlew.bat b/packages/react-native-aztec/example/android/gradlew.bat deleted file mode 100644 index 8a0b282aa6885..0000000000000 --- a/packages/react-native-aztec/example/android/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/packages/react-native-aztec/example/android/settings.gradle b/packages/react-native-aztec/example/android/settings.gradle deleted file mode 100644 index fd315d9847b1c..0000000000000 --- a/packages/react-native-aztec/example/android/settings.gradle +++ /dev/null @@ -1,7 +0,0 @@ -rootProject.name = 'example' - -include ':react-native-aztec' -project(':react-native-aztec').projectDir = new File(rootProject.projectDir, '../../android') - -include ':app' - diff --git a/packages/react-native-aztec/example/app.json b/packages/react-native-aztec/example/app.json deleted file mode 100644 index 713b4fe00671a..0000000000000 --- a/packages/react-native-aztec/example/app.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "example", - "displayName": "example" - } \ No newline at end of file diff --git a/packages/react-native-aztec/example/content.js b/packages/react-native-aztec/example/content.js deleted file mode 100644 index b52a9126728b2..0000000000000 --- a/packages/react-native-aztec/example/content.js +++ /dev/null @@ -1,94 +0,0 @@ - -HEADING = -"

Heading 1

" + - "

Heading 2

" + - "

Heading 3

" + - "

Heading 4

" + - "
Heading 5
" + - "
Heading 6
"; -BOLD = "Bold
"; -ITALIC = "Italic
"; -UNDERLINE = "Underline
"; -STRIKETHROUGH = "Strikethrough
" ;// or or -ORDERED = "
  1. Ordered
  2. should have color
"; -LINE = "
"; -UNORDERED = "
  • Unordered
  • Should not have color
"; -QUOTE = "
Quote
"; -LINK = "Link
"; -UNKNOWN = "
"; -COMMENT = "
"; -COMMENT_MORE = "
"; -COMMENT_PAGE = "
"; -HIDDEN = -"" + - "
" + - "
" + - "
" + - " Div
Span
Hidden" + - "
" + - "
" + - "
" + - "
" + - " " + - "
" + - "
"; -GUTENBERG_CODE_BLOCK = "\n" + -"
\"\"
\n" + -""; -PREFORMAT = -"
" +
-        "when (person) {
" + - " MOCTEZUMA -> {
" + - " print (\"friend\")
" + - " }
" + - " CORTES -> {
" + - " print (\"foe\")
" + - " }
" + - "}" + - "
"; -CODE = "if (Stringue == 5) printf(Stringue)
"; -IMG = "[caption align=\"alignright\"]Caption[/caption]"; -EMOJI = "👍"; -NON_LATIN_TEXT = "测试一个"; -LONG_TEXT = "

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "; -VIDEO = "[video src=\"https://examplebloge.files.wordpress.com/2017/06/d7d88643-88e6-d9b5-11e6-92e03def4804.mp4\"]"; -AUDIO = "[audio src=\"https://upload.wikimedia.org/wikipedia/commons/9/94/H-Moll.ogg\"]"; -VIDEOPRESS = "[wpvideo OcobLTqC]"; -VIDEOPRESS_2 = "[wpvideo OcobLTqC w=640 h=400 autoplay=true html5only=true3]"; -QUOTE_RTL = "
לְצַטֵט
same quote but LTR
"; - -EXAMPLE_CONTENT = - IMG + - HEADING + - BOLD + - ITALIC + - UNDERLINE + - STRIKETHROUGH + - ORDERED + - LINE + - UNORDERED + - QUOTE + - PREFORMAT + - LINK + - HIDDEN + - COMMENT + - COMMENT_MORE + - COMMENT_PAGE + - CODE + - UNKNOWN + - EMOJI + - NON_LATIN_TEXT + - LONG_TEXT + - VIDEO + - VIDEOPRESS + - VIDEOPRESS_2 + - AUDIO + - GUTENBERG_CODE_BLOCK + - QUOTE_RTL; - -export function example_content() { - return EXAMPLE_CONTENT; -} - - - diff --git a/packages/react-native-aztec/example/editor.js b/packages/react-native-aztec/example/editor.js deleted file mode 100644 index 1155c654191f7..0000000000000 --- a/packages/react-native-aztec/example/editor.js +++ /dev/null @@ -1,73 +0,0 @@ -import React, { Component } from 'react'; -import {StyleSheet, Button, View} from 'react-native'; -import AztecView from 'react-native-aztec' - -const _minHeight = 100; - -export default class Editor extends Component { - constructor(props) { - super(props); - this.onFormatPress = this.onFormatPress.bind(this) - this.onActiveFormatsChange = this.onActiveFormatsChange.bind(this) - this.isFormatActive = this.isFormatActive.bind(this) - this.state = { activeFormats: [] }; - } - - onFormatPress( format ) { - const { _aztec } = this.refs; - _aztec.applyFormat(format); - } - - onActiveFormatsChange( formats ) { - this.setState({activeFormats: formats }); - } - - isFormatActive( format ) { - const { activeFormats } = this.state; - console.log(activeFormats); - return activeFormats.indexOf(format) != -1; - } - - render() { - const { item, onContentSizeChange } = this.props; - let myMinHeight = Math.max(_minHeight, item.height); - return ( - - -