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

Create @wordpress-mobile/components package #15475

Closed
wants to merge 1 commit 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
4 changes: 0 additions & 4 deletions packages/block-editor/src/components/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ export { default as DefaultBlockAppender } from './default-block-appender';

// State Related Components
export { default as BlockEditorProvider } from './provider';

// Mobile Editor Related Components
export { default as BottomSheet } from './mobile/bottom-sheet';
export { default as Picker } from './mobile/picker';
4 changes: 3 additions & 1 deletion packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ import {
RichText,
BlockControls,
InspectorControls,
} from '@wordpress/block-editor';
import {
BottomSheet,
Picker,
} from '@wordpress/block-editor';
} from '@wordpress-mobile/components';
import { __, sprintf } from '@wordpress/i18n';
import { isURL } from '@wordpress/url';
import { doAction, hasAction } from '@wordpress/hooks';
Expand Down
2 changes: 1 addition & 1 deletion packages/format-library/src/link/modal.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Switch, Platform } from 'react-native';
*/
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { BottomSheet } from '@wordpress/block-editor';
import { BottomSheet } from '@wordpress-mobile/components';
import { prependHTTP } from '@wordpress/url';
import {
withSpokenMessages,
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/components/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
3 changes: 3 additions & 0 deletions packages/mobile/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0 (Unreleased)

- Initial release: BottomSheet and Picker components
11 changes: 11 additions & 0 deletions packages/mobile/components/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Components

This packages includes a library of React Native components to be used for creating common UI elements in the WordPress mobile apps.

## Installation

Install the module

```bash
npm install @wordpress-mobile/components --save
```
24 changes: 24 additions & 0 deletions packages/mobile/components/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@wordpress-mobile/components",
"version": "1.0.0",
"description": "React Native components for WordPress mobile apps",
"repository": "git+https://github.com/WordPress/gutenberg.git",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
"keywords": [
"wordpress",
"mobile",
"react-native"
],
"main": "src/index",
"react-native": "src/index",
"dependencies": {
"@wordpress/components": "file:../components",
"@wordpress/element": "file:../element",
"@wordpress/i18n": "file:../i18n",
"react": "16.8.3",
"react-native": "^0.59.3",
"react-native-modal": "^6.5.0",
"react-native-safe-area": "^0.5.0"
}
}
6 changes: 6 additions & 0 deletions packages/mobile/components/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Internal dependencies
*/

export BottomSheet from './bottom-sheet';
export Picker from './picker';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import { View } from 'react-native';
*/
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { BottomSheet } from '@wordpress/block-editor';

/**
* Internal dependencies
*/
import BottomSheet from '../bottom-sheet';

export default class Picker extends Component {
constructor() {
Expand Down