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

Move interactive components to components package #92

Merged
merged 2 commits into from
Jun 20, 2018
Merged
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
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@

[![tweet][tweet-badge]][tweet]

| Package | Version |
| -------------------------- | ------------------------------------------------------------------------------ |
| `@react-slate/core` | [![Version][react-slate-core-version]][react-slate-core-package] |
| `@react-slate/components` | [![Version][react-slate-components-version]][react-slate-components-package] |
| `@react-slate/interactive` | [![Version][react-slate-interactive-version]][react-slate-interactive-package] |
| `@react-slate/utils` | [![Version][react-slate-utils-version]][react-slate-utils-package] |
| Package | Version |
| ------------------------- | ---------------------------------------------------------------------------- |
| `@react-slate/core` | [![Version][react-slate-core-version]][react-slate-core-package] |
| `@react-slate/components` | [![Version][react-slate-components-version]][react-slate-components-package] |
| `@react-slate/utils` | [![Version][react-slate-utils-version]][react-slate-utils-package] |

---

Expand Down Expand Up @@ -64,7 +63,7 @@ renderToTerminal(<App />, process.stdout);
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
| [<img src="https://avatars2.githubusercontent.com/u/17573635?v=4" width="100px;"/><br /><sub><b>Paweł Trysła</b></sub>](https://twitter.com/_zamotany)<br />[💬](#question-zamotany "Answering Questions") [🐛](https://github.com/zamotany/react-slate/issues?q=author%3Azamotany "Bug reports") [💻](https://github.com/zamotany/react-slate/commits?author=zamotany "Code") [🎨](#design-zamotany "Design") [📖](https://github.com/zamotany/react-slate/commits?author=zamotany "Documentation") [💡](#example-zamotany "Examples") [🤔](#ideas-zamotany "Ideas, Planning, & Feedback") [⚠️](https://github.com/zamotany/react-slate/commits?author=zamotany "Tests") | [<img src="https://avatars2.githubusercontent.com/u/1174278?v=4" width="100px;"/><br /><sub><b>Satyajit Sahoo</b></sub>](https://twitter.com/@satya164)<br />[💻](https://github.com/zamotany/react-slate/commits?author=satya164 "Code") [🤔](#ideas-satya164 "Ideas, Planning, & Feedback") [👀](#review-satya164 "Reviewed Pull Requests") | [<img src="https://avatars3.githubusercontent.com/u/8135252?v=4" width="100px;"/><br /><sub><b>Jakub Beneš</b></sub>](https://jukben.cz)<br />[💻](https://github.com/zamotany/react-slate/commits?author=jukben "Code") [👀](#review-jukben "Reviewed Pull Requests") | [<img src="https://avatars0.githubusercontent.com/u/7389005?v=4" width="100px;"/><br /><sub><b>Mikhail Nikolaevskiy</b></sub>](https://github.com/mik639)<br />[💻](https://github.com/zamotany/react-slate/commits?author=mik639 "Code") |
| :---: | :---: | :---: | :---: |
| :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
<!-- ALL-CONTRIBUTORS-LIST:END -->

<!-- badges (common) -->
Expand All @@ -88,7 +87,5 @@ renderToTerminal(<App />, process.stdout);
[react-slate-core-package]: https://www.npmjs.com/package/@react-slate/core
[react-slate-components-version]: https://img.shields.io/npm/v/@react-slate/components.svg?style=flat-square
[react-slate-components-package]: https://www.npmjs.com/package/@react-slate/components
[react-slate-interactive-version]: https://img.shields.io/npm/v/@react-slate/interactive.svg?style=flat-square
[react-slate-interactive-package]: https://www.npmjs.com/package/@react-slate/interactive
[react-slate-utils-version]: https://img.shields.io/npm/v/@react-slate/utils.svg?style=flat-square
[react-slate-utils-package]: https://www.npmjs.com/package/@react-slate/utils
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: interactive-key-press
id: components-key-press
title: KeyPress
sidebar_label: KeyPress
---
Expand All @@ -26,7 +26,7 @@ Contentless component for attaching `onPress` callback to `keypress` event.
```js
import React from 'react';
import { Text, View } from '@react-slate/core';
import { KeyPress } from '@react-slate/interactive';
import { KeyPress } from '@react-slate/components';

class MyComponent extends React.Component {
_onPress = (char, key) => {
Expand All @@ -49,7 +49,7 @@ Rendering passed children:
```js
import React from 'react';
import { Text } from '@react-slate/core';
import { KeyPress } from '@react-slate/interactive';
import { KeyPress } from '@react-slate/components';

class MyComponent extends React.Component {
_onPress = (char, key) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
id: interactive-scroll-view
id: components-scroll-view
title: ScrollView
sidebar_label: ScrollView
---
Expand All @@ -24,7 +24,7 @@ In order for `ScrollView` to function properly, it needs to have a fixed height.

```js
import React from 'react';
import { ScrollView } from '@react-slate/interactive';
import { ScrollView } from '@react-slate/components';

class MyComponent extends React.Component {
render() {
Expand Down
24 changes: 0 additions & 24 deletions docs/interactive-getting-started.md

This file was deleted.

2 changes: 0 additions & 2 deletions docs/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@ The core functionality lives inside `@react-slate/core` package. It contains ren

[`@react-slate/components`](./components-getting-started.md) is a standard library of components for `react-slate`.

[`@react-slate/interactive`](./interactive-getting-started.md) consists of special components to interact with terminal, for example to capture the user input.

[`@react-slate/utils`](./utils-getting-started.md) contains only helper functions for altering/enhancing terminal, like hiding cursor before rendering, overwriting global `console` so the output doesn't break the UI etc.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* @flow */
/* eslint-disable react/no-unused-prop-types */

import React, { type Element } from 'react';
import { View, type Style } from '@react-slate/core';
Expand Down
2 changes: 2 additions & 0 deletions packages/react-slate-components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

export { default as ProgressBar } from './components/ProgressBar';
export { default as Spinner } from './components/Spinner';
export { default as KeyPress } from './components/KeyPress';
export { default as ScrollView } from './components/ScrollView';
3 changes: 0 additions & 3 deletions packages/react-slate-interactive/.eslintignore

This file was deleted.

42 changes: 0 additions & 42 deletions packages/react-slate-interactive/README.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-slate-interactive/index.js

This file was deleted.

64 changes: 0 additions & 64 deletions packages/react-slate-interactive/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/react-slate-interactive/src/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-slate-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"dependencies": {
"@react-slate/components": "^0.1.0",
"@react-slate/core": "^0.6.0",
"@react-slate/interactive": "^0.1.0",
"@react-slate/utils": "^0.2.1",
"lodash.throttle": "^4.1.1",
"react": "^16.3.2"
Expand Down
8 changes: 6 additions & 2 deletions packages/react-slate-playground/src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import React from 'react';
import { View } from '@react-slate/core';
import { Spinner, ProgressBar } from '@react-slate/components';
import { KeyPress, ScrollView } from '@react-slate/interactive';
import {
Spinner,
ProgressBar,
KeyPress,
ScrollView,
} from '@react-slate/components';

const components = ['Spinner', 'ProgressBar'];

Expand Down
10 changes: 4 additions & 6 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
"tagline": "Render React apps to terminal",
"components-getting-started": "@react-slate/components: Getting started",
"Getting started": "Getting started",
"components-key-press": "KeyPress",
"KeyPress": "KeyPress",
"components-progress-bar": "ProgressBar",
"ProgressBar": "ProgressBar",
"components-scroll-view": "ScrollView",
"ScrollView": "ScrollView",
"components-spinner": "Spinner",
"Spinner": "Spinner",
"core-positioning": "Positioning",
Expand All @@ -32,11 +36,6 @@
"View": "View",
"installation": "Installation",
"Installation": "Installation",
"interactive-getting-started": "@react-slate/interactive: Getting started",
"interactive-key-press": "KeyPress",
"KeyPress": "KeyPress",
"interactive-scroll-view": "ScrollView",
"ScrollView": "ScrollView",
"packages": "Packages",
"Packages": "Packages",
"responding-to-resize-event-guide": "Responding to `resize` event",
Expand All @@ -47,7 +46,6 @@
"@react-slate/core: API": "@react-slate/core: API",
"@react-slate/core: Styling & Layout": "@react-slate/core: Styling & Layout",
"@react-slate/components": "@react-slate/components",
"@react-slate/interactive": "@react-slate/interactive",
"@react-slate/utils": "@react-slate/utils"
},
"pages-strings": {
Expand Down
9 changes: 3 additions & 6 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
"@react-slate/components": [
"components-getting-started",
"components-progress-bar",
"components-spinner"
],
"@react-slate/interactive": [
"interactive-getting-started",
"interactive-key-press",
"interactive-scroll-view"
"components-spinner",
"components-key-press",
"components-scroll-view"
],
"@react-slate/utils": ["utils-getting-started"]
}
Expand Down