Skip to content

Commit

Permalink
[Monorepo][base-branch] import of gutenberg-mobile (#18508)
Browse files Browse the repository at this point in the history
* Use string-array instead of plurals tag in strings.xml

See https://github.com/GlotPress/GlotPress-WP/blob/master/gp-includes/formats/format-android.php

* Update string files

* Update scripts to minimize changes in git diff and keep the same context for android

* Exclude strings from tests

* Fix lint errors

* Bump version to 1.17.1

* Update gutenberg ref following 1.17 merge to gutenberg master

* Update gutenberg ref

* Remove declaration on bridge of unused methods.

* Added bridge code for gutenberg to request a native fullscreen preview for for an image from a URL on iOS.

* Updating bundle and gutenberg reference.

* Updated release notes.

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update GB reference.

* Updating bundle after catching up branch and gutenberg submodule.

* Update gutenberg ref

* Update release notes.

* Update UI test

* Pass postType as initial prop on iOS

* Pass postType down to Editor

* Allow Android to set the post type

* Updating gutenberg reference.

* Removed duplicate line from merge.

* updafe test files and iOS version for running locally with xcode 11

* Update gutenberg ref

* Update gutenberg ref

* Update aztec to version that support reversed and start on lists.

* Update Gutenberg to version where list settings are active in native.

* update block list check and capabilities

* replace double click on android

* fix block insertion timeout

* update branch with develop

* Update gutenberg ref

* Update package.json and JS bundle for 1.18.0 release

* Update Gutenberg

* Update Gutenberg

* update gutenberg ref

* Update GB-reference.

* Update release notes.

* revert caps to iPhone Simulator

* Update Gutenberg ref

* Update Release notes

* Update gutenberg/ reference

* Update bundles

* Update GB reference.

* Fix spacing

* Add static method to Media class to create instance using mimeType

* Add flag to track when appending multiple selected media items as blocks

* Introduce mediaSelectionCancelled method in WPAndroidGlueCode

* Set flag to append blocks when multiple = false is not respected

* Only use appendUploadMediaFiles plural version

* Update gutenberg ref

* Update to latest Gutenberg master

* Patch jsdom to implement Element.closest()

* Bring back changes on package.json from 1.7.1

* Add docstring to the function

* Return null as per https://dom.spec.whatwg.org/#dom-element-closest

* Update Aztec version.

* Update GB reference.

* Update gutenberg ref

* Update RELEASE-NOTES.txt

* Update GB reference

* Improve code block style

* Update GB reference.

* Update gutenberg ref

* Update Media mimeType truncation to use enum names

* Add Javadoc for mAppendsMultipleSelectedToSiblingBlocks flag

* Set appends to sibling blocks flag explicitly for all requests

* Add clarifying comment for special block append handling

* Remove singular (unused) appendMedia method

* Update GB reference.

* Update GB reference to master.

* Set appends to sibling blocks flag explicitly for other media pick

* Update GB reference.

* Update GB reference.

* Use lowercase for Media mimeType truncation

* Update Gutenberg

* Update Gutenberg

* Update Gutenberg ref - after fix for caption alignment

* Update bundles

* Point to aztecVersion hash which supports list with start and reverse attribute

* Update bundle and gutenberg ref - fix disappearing image

* Update GB reference.

* Update GB reference.

* Update GB reference.

* Update Gutenberg

* Update Gutenberg ref

* Update GB reference

* Update GB reference.

* Only enable page templates on dev builds

* Update aztec version

* Update aztec version

* Add colors for gallery block

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg reference

* Update GB reference.

* Update Gutenberg ref

* Update Aztec version to 1.14.0

* Make sure if the textColor is changed the default text color is updated.

* Use Slider from react-native-community lib (#1620)

* Use Slider from react-native-community lib

* Update slider version

* Add function to read npm version

* Rengenerate yarn.lock

* Bump node version

* Update readNPMVersion function

* Use Slider from fork

* Update Slider commit

* Use Slider from wordpress-mobile fork

* Add react-native-slider podspec

* Improve babel config

* Correct settings.gradle

* Correct project.pbxproj

* Update ref

* Bump

* Update ref

* Update ref to gutenberg master

* Update ref to gutenberg quick fix

* Update ref to gutenberg master

* Update Aztec editor version.

* Update to iOS 13

* Update Xcode version.

* Use iOS 12 for tests.

* Fix typo

* Update Aztec to fix CI error with xcode 10

* Use iOS 12.2

* Update Appium version.

* Update to appium 1.15.1

* Update to Appium 1.15.1 only in iOS

* Update caps.

* Add Gallery Block (#1498)

* WIP - initial-html.js for gallery testing

* Add parent app media mock for Android

* Update gutenberg reference

* Update gutenberg reference

* Comment out line setting mPendingMediaUploadCallback to null

* Update gutenberg reference

* Generate bundles

* Update gutenberg ref

* Generate bundles

* Generate bundles

* Add some color-studio colors for gallery

* Update gutenberg reference

* Generate bundle

* WIP update ref

* Update gutenberg reference

* Update gutenberg submodule

* Generate bundles

* Add $gray-40 color

* Update gutenberg reference

* Generate bundles

* Update gutenberg reference

* Generate bundles

* Update gutenberg reference

* Generate bundles

* Update gutenberg reference

* Generate bundles

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg reference

* Restore demo content

* Restore anonymous implementation of GutenbergBridgeJS2Parent

* Update gutenberg reference

* Generate bundles

* Bump up Aztec version on iOS Example app

* Update gb ref

* Generate bundles

* Update gutenberg ref

* Update gutenberg ref (#1646)

* Add release notes for Gallery (#1658)

* Make sure we use iPhone 11 (iOS 13) for build and run tests

* Pooint aztecVersion to develop

* Update Appium for Android tests too.

* Set Appium to 1.15.0

* Update aztec version to 1.3.36

* Update appium to 1.16.0-rc.1

* Update Aztec iOS to 1.14.1

* Update GB reference.

* Activate preformat block on android platform (#1615)

* Updates package.json and JS bundle for 1.19.0 release.

* Update to shorten git commands

Make the git commands a little easier to copy by taking out `$` from the start of the lines.

This also matches with the other commands on the page which do not start with `$`.

* Update Unit Tests headings in Getting Started documentation

The heading "Test" should be "Unit Tests".

The heading "Writing and Running Tests" should be "Writing and Running Unit Tests".

https://github.com/wordpress-mobile/gutenberg-mobile/blob/develop/src/index.test.js

* Update gutenberg reference

* Update gutenberg reference

* Update gutenberg ref

* Updating bundles.

* Feat: Navigation Down in InnerBlocks (#1379)

* Add ref to gutenberg repo

* Fix e2e tests

* Update ref to gutenberg master

* Update Gutenberg ref

* Remove empty line between checkboxes

* Updating release notes to show video settings in 1.19

* Updating gutenberg reference to latest 1.19 release change on gutenberg master branch

* Update gutenberg ref

* Sass Transformer: Also look for partials

Add support for [SASS partials](https://sass-lang.com/guide), as is already present [upstream](https://github.com/kristerkari/react-native-sass-transformer/blob/52884dd59582856fa17e2b2e8ca9efc37d412387/index.js#L41-L42).

This should fix the issue introduced by #19159, and discussed there.

* Single quotes

* Also update sass-transformer-inside-gb.js

* Update release notes

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Update Gutenberg ref

* Update gutenberg ref

* Update gutenberg ref

* Bundles up to date with merged code from develop

* Add ref to gutenberg repo

* Update ref

* Update ref

* Update ref

* Upgrade the SVG lib to fix #1703

* Upgrade the Video lib to fix #1705

* Upgrade the Slider lib to use node_modules in local npm build

* Update ref

* Upgrade the SVG lib ref

* Upgrade the Video lib ref

* Upgrade the Slider lib ref

* Update ref

* Brings back gb master to normal (#1722)

* Fix/Bring back master to normal (#1724)

* Update Gutenberg ref

* Update Gutenberg ref

Co-authored-by: Tugdual de Kerviler <dekervit@gmail.com>
Co-authored-by: Matt Chowning <mchowning@gmail.com>
Co-authored-by: etoledom <etoledom@icloud.com>
Co-authored-by: Sérgio Estêvão <sergioestevao@gmail.com>
Co-authored-by: Cameron Voell <cameronvoell@gmail.com>
Co-authored-by: Jorge Bernal <jbernal@gmail.com>
Co-authored-by: Javon Davis <JavonDavis@users.noreply.github.com>
Co-authored-by: Maxime Biais <maxime@bia.is>
Co-authored-by: Gerardo Pacheco <gerardo.pacheco@automattic.com>
Co-authored-by: Matthew Kevins <mkevins@users.noreply.github.com>
Co-authored-by: Stefanos Togoulidis <stefanostogoulidis@gmail.com>
Co-authored-by: Marko Savic <savicmarko1985@gmail.com>
Co-authored-by: Luke Walczak <lukasz.walczak.pwr@gmail.com>
Co-authored-by: Pinar Olguc <pinarolguc@gmail.com>
Co-authored-by: Sheri Bigelow <sheri@designsimply.com>
Co-authored-by: jbinda <jakub.binda@gmail.com>
Co-authored-by: Bernie Reiter <ockham@raz.or.at>
  • Loading branch information
18 people committed Jan 6, 2020
1 parent c7d00c6 commit 26ee90d
Show file tree
Hide file tree
Showing 380 changed files with 47,122 additions and 0 deletions.
177 changes: 177 additions & 0 deletions packages/react-native-editor/.circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
version: 2.1

commands:
yarn-install:
steps:
- restore_cache:
name: Restore Yarn Cache
keys:
- yarn-i18n-v4-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}
- run:
name: Yarn Install
command: yarn install --frozen-lockfile --prefer-offline
- save_cache:
name: Save Yarn Cache
key: yarn-i18n-v4-{{ .Environment.CIRCLE_JOB }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- i18n-cache/data
checkout-gutenberg:
steps:
- run:
name: Checkout Gutenberg
command: git submodule update --init --recursive
add-jest-reporter-dir:
steps:
- run:
name: Create reports directory
command: mkdir reports && mkdir reports/test-results

jobs:
checks:
parameters:
platform:
type: string
default: ""
check-tests:
type: boolean
default: false
check-correctness:
type: boolean
default: false
docker:
- image: circleci/node:8
steps:
- checkout
- checkout-gutenberg
- yarn-install
- add-jest-reporter-dir
- run:
name: Set Environment Variables
command: |
echo 'export CHECK_CORRECTNESS=<<parameters.check-correctness>>' >> $BASH_ENV
echo 'export CHECK_TESTS=<<parameters.check-tests>>' >> $BASH_ENV
echo 'export TEST_RN_PLATFORM=<<parameters.platform>>' >> $BASH_ENV
- run:
name: Run Checks
command: bin/ci-checks-js.sh
environment:
JEST_JUNIT_OUTPUT: "reports/test-results/android-test-results.xml"
- store_test_results:
path: ./reports/test-results
android-device-checks:
docker:
- image: circleci/android:api-29-node
steps:
- checkout
- run:
name: Checkout Gutenberg
command: git submodule update --init --recursive
- yarn-install
- add-jest-reporter-dir
- run:
name: Set Environment Variables
command: |
echo 'export TEST_RN_PLATFORM=android' >> $BASH_ENV
echo 'export TEST_ENV=sauce' >> $BASH_ENV
- run:
name: Bundle Android and Generate debug .apk file for testing
command: yarn test:e2e:build-app:android
- run:
name: Upload apk to sauce labs
command: |
source bin/sauce-pre-upload.sh
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg-$SAUCE_FILENAME.apk?overwrite=true --data-binary @./android/app/build/outputs/apk/debug/app-debug.apk
- run:
name: Run Device Tests
command: yarn device-tests
environment:
JEST_JUNIT_OUTPUT: "reports/test-results/android-test-results.xml"
- store_test_results:
path: ./reports/test-results
ios-device-checks:
macos:
xcode: "11.2.1"
steps:
- checkout
- checkout-gutenberg
- yarn-install
- add-jest-reporter-dir
- run:
name: Set Environment Variables
command: |
echo 'export TEST_RN_PLATFORM=ios' >> $BASH_ENV
echo 'export TEST_ENV=sauce' >> $BASH_ENV
- run:
name: Prepare build cache key
command: find yarn.lock ios react-native-aztec/ios react-native-gutenberg-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt
- restore_cache:
name: Restore Build Cache
keys:
- ios-build-cache-{{ checksum "ios-checksums.txt" }}
- restore_cache:
name: Restore Dependencies Cache
keys:
- dependencies-v2-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}-{{
checksum "yarn.lock" }}
- dependencies-v2-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}
- dependencies-v2-
- run:
name: Yarn preios (if needed)
command: test -e ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app || yarn preios
- save_cache:
name: Save Dependencies Cache
key: dependencies-v2-{{ checksum "react-native-aztec/ios/Cartfile.resolved" }}-{{
checksum "yarn.lock" }}
paths:
- react-native-aztec/ios/Carthage
- ~/.rncache
- run:
name: Build (if needed)
command: test -e ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app || yarn react-native run-ios --configuration Release --no-packager
- run:
name: Bundle iOS
command: yarn test:e2e:bundle:ios
- run:
name: Generate .app file for testing
command: WORK_DIR=$(pwd) && cd ./ios/build/gutenberg/Build/Products/Release-iphonesimulator && zip -r $WORK_DIR/ios/Gutenberg.app.zip gutenberg.app
- run:
name: Upload .app to sauce labs
command: |
source bin/sauce-pre-upload.sh
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X POST -H "Content-Type: application/octet-stream" https://saucelabs.com/rest/v1/storage/automattic/Gutenberg-$SAUCE_FILENAME.app.zip?overwrite=true --data-binary @./ios/Gutenberg.app.zip
- run:
name: Run Device Tests
command: |
yarn device-tests
environment:
JEST_JUNIT_OUTPUT: "reports/test-results/ios-test-results.xml"
- store_test_results:
path: ./reports/test-results
- run:
name: Prepare build cache
command: rm ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app/main.jsbundle
- save_cache:
name: Save Build Cache
key: ios-build-cache-{{ checksum "ios-checksums.txt" }}
paths:
- ios/build/gutenberg/Build/Products/Release-iphonesimulator/gutenberg.app

workflows:
gutenberg-mobile:
jobs:
- checks:
name: Check Correctness
check-correctness: true
- checks:
name: Test iOS
platform: ios
check-tests: true
- checks:
name: Test Android
platform: android
check-tests: true
- ios-device-checks:
name: Test iOS on Device
- android-device-checks:
name: Test Android on Device
7 changes: 7 additions & 0 deletions packages/react-native-editor/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; ignore the submodules
gutenberg
symlinked-packages
symlinked-packages-in-parent
react-native-aztec
bundle
react-native-aztec-old-submodule
74 changes: 74 additions & 0 deletions packages/react-native-editor/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/**
* External dependencies
*/
const { map } = require( 'lodash' );

module.exports = {
parser: "babel-eslint",
env: {
browser: true,
"jest/globals": true
},
globals: {
__DEV__: true
},
plugins: [
"react",
"react-native",
"jest",
"flowtype"
],
extends: [
"plugin:@wordpress/eslint-plugin/recommended",
"plugin:flowtype/recommended",
],
settings: {
flowtype: {
onlyFilesWithFlowAnnotation: true,
},
react: {
pragma: "React",
version: "16.8.3",
flowVersion: "0.92.0",
},
},
rules: {
'no-restricted-syntax': [
'error',
// NOTE: We can't include the forward slash in our regex or
// we'll get a `SyntaxError` (Invalid regular expression: \ at end of pattern)
// here. That's why we use \\u002F in the regexes below.
{
selector: 'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]',
message: 'Path access on WordPress dependencies is not allowed.',
},
{
selector: 'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] Literal[value=/\\.{3}/]',
message: 'Use ellipsis character (…) in place of three dots',
},
{
selector: 'ImportDeclaration[source.value="lodash"] Identifier.imported[name="memoize"]',
message: 'Use memize instead of Lodash’s memoize',
},
{
selector: 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',
message: 'Prefer page.waitForSelector instead.',
},
{
selector: 'JSXAttribute[name.name="id"][value.type="Literal"]',
message: 'Do not use string literals for IDs; use withInstanceId instead.',
},
{
// Discourage the usage of `Math.random()` as it's a code smell
// for UUID generation, for which we already have a higher-order
// component: `withInstanceId`.
selector: 'CallExpression[callee.object.name="Math"][callee.property.name="random"]',
message: 'Do not use Math.random() to generate unique IDs; use withInstanceId instead. (If you’re not generating unique IDs: ignore this message.)',
},
{
selector: 'CallExpression[callee.name="withDispatch"] > :function > BlockStatement > :not(VariableDeclaration,ReturnStatement)',
message: 'withDispatch must return an object with consistent keys. Avoid performing logic in `mapDispatchToProps`.',
},
],
},
}
115 changes: 115 additions & 0 deletions packages/react-native-editor/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore templates for 'react-native init'
<PROJECT_ROOT>/node_modules/react-native/local-cli/templates/.*

; Ignore RN jest
<PROJECT_ROOT>/node_modules/react-native/jest/.*

; Ignore RNTester
<PROJECT_ROOT>/node_modules/react-native/RNTester/.*

; Ignore the website subdir
<PROJECT_ROOT>/node_modules/react-native/website/.*

; Ignore the Dangerfile
<PROJECT_ROOT>/node_modules/react-native/danger/dangerfile.js

; Ignore Fbemitter
<PROJECT_ROOT>/node_modules/fbemitter/.*

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/node_modules/react-native/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; Ignore polyfills
<PROJECT_ROOT>/node_modules/react-native/Libraries/polyfills/.*

; Ignore various node_modules
<PROJECT_ROOT>/node_modules/react-native-gesture-handler/.*
<PROJECT_ROOT>/node_modules/expo/.*
<PROJECT_ROOT>/node_modules/react-navigation/.*
<PROJECT_ROOT>/node_modules/xdl/.*
<PROJECT_ROOT>/node_modules/reqwest/.*
<PROJECT_ROOT>/node_modules/metro-bundler/.*
<PROJECT_ROOT>/node_modules/fbjs/.*
<PROJECT_ROOT>/node_modules/graphql/.*
<PROJECT_ROOT>/node_modules/prettier/.*
<PROJECT_ROOT>/node_modules/jsx-to-string/.*
<PROJECT_ROOT>/node_modules/jest-enzyme/.*
<PROJECT_ROOT>/node_modules/enzyme-matchers/.*

; Ignore react-native-recyclerview-list example app
<PROJECT_ROOT>/node_modules/react-native-recyclerview-list/example

; Ignore immutable-js. See https://github.com/facebook/immutable-js/issues/1308
<PROJECT_ROOT>/node_modules/immutable/.*

; Gutenberg tools
<PROJECT_ROOT>/gutenberg/node_modules/findup/.*
<PROJECT_ROOT>/gutenberg/node_modules/cypress/.*
<PROJECT_ROOT>/gutenberg/node_modules/config-chain/.*
<PROJECT_ROOT>/gutenberg/node_modules/editions/es2015/.*
<PROJECT_ROOT>/gutenberg/node_modules/@parcel/.*

; Mirror some ignores from Gutenberg tools
<PROJECT_ROOT>/node_modules/config-chain/.*

; Hack to make Flow works on OS X with a RN project
<PROJECT_ROOT>/node_modules/metro/.*
<PROJECT_ROOT>/node_modules/react-native/.*

; Ignore the node_modules folders in GB packages
<PROJECT_ROOT>/gutenberg/packages/element/node_modules/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/expo/flow/
libdefs.js

[options]
emoji=true

module.system=haste
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=symlinked-packages

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.ios.js
module.file_ext=.scss

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

; mock/ignore style files
module.name_mapper='.*\(.scss\)' -> 'empty/object'

server.max_workers=4

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[untyped]
<PROJECT_ROOT>/node_modules/react-native-keyboard-aware-scroll-view/.*
<PROJECT_ROOT>/node_modules/react-native-safe-area/.*

[version]
^0.92.0
1 change: 1 addition & 0 deletions packages/react-native-editor/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RELEASE-NOTES.txt merge=union
Loading

0 comments on commit 26ee90d

Please sign in to comment.