Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Monorepo] Import gutenberg-mobile as new WordPress react-native packages #17456

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build-module
node_modules
packages/block-serialization-spec-parser/parser.js
packages/e2e-tests/plugins
packages/react-native-*
playground/dist
vendor
wordpress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ _Returns_

- `?boolean`: Whether the template is valid or not.


<!-- END TOKEN(Autogenerated selectors) -->

## Actions
Expand Down Expand Up @@ -1243,4 +1242,5 @@ _Returns_

Undocumented declaration.


<!-- END TOKEN(Autogenerated actions) -->
28,688 changes: 16,268 additions & 12,420 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
"@wordpress/nux": "file:packages/nux",
"@wordpress/plugins": "file:packages/plugins",
"@wordpress/priority-queue": "file:packages/priority-queue",
"@wordpress/react-native-aztec": "file:packages/react-native-aztec",
"@wordpress/react-native-e2e-tests": "file:packages/react-native-e2e-tests",
"@wordpress/react-native-gutenberg-bridge": "file:packages/react-native-gutenberg-bridge",
"@wordpress/react-native-gutenberg-editor": "file:packages/react-native-gutenberg-editor",
"@wordpress/redux-routine": "file:packages/redux-routine",
"@wordpress/rich-text": "file:packages/rich-text",
"@wordpress/server-side-render": "file:packages/server-side-render",
Expand Down Expand Up @@ -118,8 +122,6 @@
"lint-staged": "9.2.5",
"lodash": "4.17.14",
"make-dir": "3.0.0",
"metro-react-native-babel-preset": "0.55.0",
"metro-react-native-babel-transformer": "0.55.0",
"mkdirp": "0.5.1",
"node-sass": "4.12.0",
"node-watch": "0.6.0",
Expand All @@ -128,7 +130,6 @@
"progress": "2.0.3",
"react": "16.9.0",
"react-dom": "16.9.0",
"react-native": "0.60.0",
"react-test-renderer": "16.9.0",
"rimraf": "2.6.2",
"rtlcss": "2.4.0",
Expand Down Expand Up @@ -187,6 +188,7 @@
"predev": "npm run check-engines",
"dev": "npm run build:packages && concurrently \"wp-scripts start\" \"npm run dev:packages\"",
"dev:packages": "node ./bin/packages/watch.js",
"native": "npm run --prefix packages/react-native-gutenberg-editor",
"docs:build": "node ./docs/tool/index.js && node ./bin/update-readmes.js",
"fixtures:clean": "rimraf \"packages/e2e-tests/fixtures/blocks/*.+(json|serialized.html)\"",
"fixtures:server-registered": "wp-scripts env docker-run php ./bin/get-server-blocks.php > test/integration/full-content/server-registered.json",
Expand Down Expand Up @@ -217,7 +219,6 @@
"test-unit-php": "wp-scripts env test-php",
"test-unit-php-multisite": "cross-env WP_MULTISITE=1 wp-scripts env test-php",
"test-unit:native": "cd test/native/ && cross-env NODE_ENV=test jest --config ./jest.config.js",
"test-unit:native:debug": "cd test/native/ && node --inspect ../../node_modules/.bin/jest --runInBand --config ./jest.config.js",
"playground:build": "npm run build:packages && parcel build playground/src/index.html -d playground/dist",
"playground:start": "concurrently \"npm run dev:packages\" \"parcel playground/src/index.html -d playground/dist\"",
"preenv": "npm run check-engines",
Expand Down
3 changes: 2 additions & 1 deletion packages/block-directory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
"wordpress",
"wordpress",
"block directory"
],
"homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/block-directory/README.md",
Expand All @@ -19,6 +19,7 @@
},
"main": "build/index.js",
"module": "build-module/index.js",
"react-native": "src/index",
"dependencies": {
"@wordpress/api-fetch": "file:../api-fetch",
"@wordpress/block-editor": "file:../block-editor",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import { FlatList, View, Text, TouchableHighlight } from 'react-native';
import { subscribeMediaAppend } from 'react-native-gutenberg-bridge';

/**
* WordPress dependencies
Expand All @@ -15,6 +14,7 @@ import {
import { withDispatch, withSelect } from '@wordpress/data';
import { withInstanceId, compose } from '@wordpress/compose';
import { BottomSheet, Icon } from '@wordpress/components';
import { subscribeMediaAppend } from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
* External dependencies
*/
import React from 'react';
import {
requestMediaPickFromMediaLibrary,
requestMediaPickFromDeviceLibrary,
requestMediaPickFromDeviceCamera,
} from 'react-native-gutenberg-bridge';

/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Picker } from '@wordpress/components';
import {
requestMediaPickFromMediaLibrary,
requestMediaPickFromDeviceLibrary,
requestMediaPickFromDeviceCamera,
} from '@wordpress/react-native-gutenberg-bridge';

export const MEDIA_TYPE_IMAGE = 'image';
export const MEDIA_TYPE_VIDEO = 'video';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
*/
import { shallow } from 'enzyme';
import { TouchableWithoutFeedback } from 'react-native';

/**
* WordPress dependencies
*/
import {
requestMediaPickFromMediaLibrary,
requestMediaPickFromDeviceLibrary,
requestMediaPickFromDeviceCamera,
} from 'react-native-gutenberg-bridge';
} from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand Down
12 changes: 6 additions & 6 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
*/
import React from 'react';
import { View, ImageBackground, Text, TouchableWithoutFeedback, Dimensions } from 'react-native';
import {
requestMediaImport,
mediaUploadSync,
requestImageFailedRetryDialog,
requestImageUploadCancelDialog,
} from 'react-native-gutenberg-bridge';
import { isEmpty } from 'lodash';

/**
Expand All @@ -31,6 +25,12 @@ import {
import { __, sprintf } from '@wordpress/i18n';
import { isURL } from '@wordpress/url';
import { doAction, hasAction } from '@wordpress/hooks';
import {
requestMediaImport,
mediaUploadSync,
requestImageFailedRetryDialog,
requestImageUploadCancelDialog,
} from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
*/
import React from 'react';
import { View } from 'react-native';
import {
subscribeMediaUpload,
} from 'react-native-gutenberg-bridge';

/**
* WordPress dependencies
Expand All @@ -14,6 +11,9 @@ import {
Spinner,
} from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import {
subscribeMediaUpload,
} from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
* External dependencies
*/
import { shallow } from 'enzyme';

/**
* WordPress dependencies
*/
import {
sendMediaUpload,
} from 'react-native-gutenberg-bridge';
} from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand All @@ -17,7 +21,7 @@ import {
MEDIA_UPLOAD_STATE_RESET,
} from '../media-upload-progress';

jest.mock( 'react-native-gutenberg-bridge', () => {
jest.mock( '@wordpress/react-native-gutenberg-bridge', () => {
const callUploadCallback = ( payload ) => {
this.uploadCallBack( payload );
};
Expand Down
11 changes: 6 additions & 5 deletions packages/block-library/src/video/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
*/
import React from 'react';
import { View, TouchableWithoutFeedback, Text } from 'react-native';

/**
* Internal dependencies
*/
import Video from './video-player';
import {
mediaUploadSync,
requestImageFailedRetryDialog,
requestImageUploadCancelDialog,
} from 'react-native-gutenberg-bridge';

/**
* WordPress dependencies
Expand All @@ -32,6 +28,11 @@ import {
import { __ } from '@wordpress/i18n';
import { isURL } from '@wordpress/url';
import { doAction, hasAction } from '@wordpress/hooks';
import {
mediaUploadSync,
requestImageFailedRetryDialog,
requestImageUploadCancelDialog,
} from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-post/src/components/layout/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
import { Platform, SafeAreaView, View } from 'react-native';
import SafeArea from 'react-native-safe-area';
import { sendNativeEditorDidLayout } from 'react-native-gutenberg-bridge';

/**
* WordPress dependencies
Expand All @@ -12,6 +11,7 @@ import { Component } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { HTMLTextInput, KeyboardAvoidingView, ReadableContentView } from '@wordpress/components';
import { sendNativeEditorDidLayout } from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand Down
3 changes: 2 additions & 1 deletion packages/edit-post/src/test/editor.native.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/**
* External dependencies
*/
import RNReactNativeGutenbergBridge from 'react-native-gutenberg-bridge';
import { mount } from 'enzyme';

/**
* WordPress dependencies
*/
import { registerCoreBlocks } from '@wordpress/block-library';
// Force register 'core/editor' store.
import { store } from '@wordpress/editor'; // eslint-disable-line no-unused-vars
import RNReactNativeGutenbergBridge from '@wordpress/react-native-gutenberg-bridge';

jest.mock( '../components/layout', () => () => 'Layout' );

Expand Down
16 changes: 6 additions & 10 deletions packages/editor/src/components/provider/index.native.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
/**
* External dependencies
* WordPress dependencies
*/
import { Component } from '@wordpress/element';
import { parse, serialize, getUnregisteredTypeHandlerName } from '@wordpress/blocks';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import RNReactNativeGutenbergBridge, {
subscribeParentGetHtml,
subscribeParentToggleHTMLMode,
subscribeUpdateHtml,
subscribeSetFocusOnTitle,
subscribeSetTitle,
} from 'react-native-gutenberg-bridge';

/**
* WordPress dependencies
*/
import { Component } from '@wordpress/element';
import { parse, serialize, getUnregisteredTypeHandlerName } from '@wordpress/blocks';
import { withDispatch, withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
} from '@wordpress/react-native-gutenberg-bridge';

/**
* Internal dependencies
Expand Down
Loading