Merge branch 'master' into replace-state

This commit is contained in:
Filipp Riabchun 2017-11-08 03:29:12 +03:00 committed by GitHub
commit b7c9ace701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 349 additions and 341 deletions

View File

@ -19,7 +19,7 @@
"prepare": "node ../../scripts/prepare.js", "prepare": "node ../../scripts/prepare.js",
"publish-storybook": "bash .scripts/publish_storybook.sh", "publish-storybook": "bash .scripts/publish_storybook.sh",
"storybook": "start-storybook -p 3006", "storybook": "start-storybook -p 3006",
"storybook-local": "STORYBOOK_CLOUD_SERVER='http://localhost:3003/graphql' start-storybook -p 9010", "storybook-local": "cross-env STORYBOOK_CLOUD_SERVER='http://localhost:3003/graphql' start-storybook -p 9010",
"storybook-remote": "start-storybook -p 3006" "storybook-remote": "start-storybook -p 3006"
}, },
"dependencies": { "dependencies": {
@ -28,12 +28,12 @@
"deep-equal": "^1.0.1", "deep-equal": "^1.0.1",
"events": "^1.1.1", "events": "^1.1.1",
"global": "^4.3.2", "global": "^4.3.2",
"insert-css": "^1.0.0", "insert-css": "^2.0.0",
"marked": "^0.3.6", "marked": "^0.3.6",
"moment": "^2.19.0", "moment": "^2.19.0",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"react-render-html": "^0.5.2", "react-render-html": "^0.5.2",
"react-textarea-autosize": "^4.3.0" "react-textarea-autosize": "^5.1.0"
}, },
"devDependencies": { "devDependencies": {
"@kadira/storybook-database-cloud": "*", "@kadira/storybook-database-cloud": "*",

View File

@ -24,7 +24,7 @@
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
"format-json": "^1.0.3", "format-json": "^1.0.3",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"react-textarea-autosize": "^4.3.0", "react-textarea-autosize": "^5.1.0",
"uuid": "^3.1.0" "uuid": "^3.1.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -149,9 +149,6 @@ export default class Item extends Component {
</button> </button>
<Textarea <Textarea
id={`addon-event-${name}`} id={`addon-event-${name}`}
ref={ref => {
this.input = ref;
}}
style={{ ...styles.textArea, ...extraStyle }} style={{ ...styles.textArea, ...extraStyle }}
value={this.state.payloadString} value={this.state.payloadString}
onChange={this.onChange} onChange={this.onChange}

View File

@ -18,25 +18,25 @@
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
"deep-equal": "^1.0.1", "deep-equal": "^1.0.1",
"global": "^4.3.2", "global": "^4.3.2",
"insert-css": "^1.0.0", "insert-css": "^2.0.0",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"moment": "^2.19.1", "moment": "^2.19.1",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"react-color": "^2.11.4", "react-color": "^2.11.4",
"react-datetime": "^2.10.3", "react-datetime": "^2.10.3",
"react-textarea-autosize": "^4.3.0", "react-textarea-autosize": "^5.1.0",
"util-deprecate": "^1.0.2" "util-deprecate": "^1.0.2"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^7.0.46", "@types/node": "^8.0.49",
"@types/react": "^16.0.19", "@types/react": "^16.0.20",
"raw-loader": "^0.5.1", "raw-loader": "^0.5.1",
"react": "^16.0.0", "react": "^16.0.0",
"react-dom": "^16.0.0", "react-dom": "^16.0.0",
"style-loader": "^0.19.0", "style-loader": "^0.19.0",
"typescript": "^2.6.1", "typescript": "^2.6.1",
"typescript-definition-tester": "^0.0.5", "typescript-definition-tester": "^0.0.5",
"vue": "^2.5.2" "vue": "^2.5.3"
}, },
"peerDependencies": { "peerDependencies": {
"react": "*", "react": "*",

View File

@ -16,22 +16,14 @@ const styles = {
color: '#555', color: '#555',
}; };
class ArrayType extends React.Component { const ArrayType = ({ knob, onChange }) => (
render() {
const { knob, onChange } = this.props;
return (
<Textarea <Textarea
id={knob.name} id={knob.name}
ref={c => {
this.input = c;
}}
style={styles} style={styles}
value={knob.value.join(knob.separator)} value={knob.value.join(knob.separator)}
onChange={e => onChange(e.target.value.split(knob.separator))} onChange={e => onChange(e.target.value.split(knob.separator))}
/> />
); );
}
}
ArrayType.defaultProps = { ArrayType.defaultProps = {
knob: {}, knob: {},

View File

@ -69,9 +69,6 @@ class ObjectType extends React.Component {
return ( return (
<Textarea <Textarea
id={knob.name} id={knob.name}
ref={c => {
this.input = c;
}}
style={{ ...styles, ...extraStyle }} style={{ ...styles, ...extraStyle }}
value={jsonString} value={jsonString}
onChange={e => this.handleChange(e)} onChange={e => this.handleChange(e)}

View File

@ -16,23 +16,14 @@ const styles = {
color: '#555', color: '#555',
}; };
class TextType extends React.Component { const TextType = ({ knob, onChange }) => (
render() {
const { knob, onChange } = this.props;
return (
<Textarea <Textarea
id={knob.name} id={knob.name}
ref={c => {
this.input = c;
}}
style={styles} style={styles}
value={knob.value} value={knob.value}
onChange={e => onChange(e.target.value)} onChange={e => onChange(e.target.value)}
/> />
); );
}
}
TextType.defaultProps = { TextType.defaultProps = {
knob: {}, knob: {},

View File

@ -33,6 +33,6 @@
"react": "*" "react": "*"
}, },
"optionalDependencies": { "optionalDependencies": {
"@types/react": "^15.0.24" "@types/react": "^16.0.20"
} }
} }

View File

@ -17,7 +17,7 @@
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",
"global": "^4.3.2", "global": "^4.3.2",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"read-pkg-up": "^2.0.0" "read-pkg-up": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@storybook/addons": "^3.2.14", "@storybook/addons": "^3.2.14",

View File

@ -50,7 +50,7 @@
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"events": "^1.1.1", "events": "^1.1.1",
"express": "^4.16.2", "express": "^4.16.2",
"file-loader": "^0.11.2", "file-loader": "^1.1.5",
"find-cache-dir": "^1.0.0", "find-cache-dir": "^1.0.0",
"global": "^4.3.2", "global": "^4.3.2",
"json-loader": "^0.5.7", "json-loader": "^0.5.7",
@ -67,13 +67,13 @@
"webpack": "^3.8.1", "webpack": "^3.8.1",
"webpack-dev-middleware": "^1.12.0", "webpack-dev-middleware": "^1.12.0",
"webpack-hot-middleware": "^2.20.0", "webpack-hot-middleware": "^2.20.0",
"ws": "^3.0.0" "ws": "^3.3.0"
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"react": "^16.0.0", "react": "^16.0.0",
"react-dom": "^16.0.0", "react-dom": "^16.0.0",
"react-native": "^0.49.3" "react-native": "^0.50.1"
}, },
"peerDependencies": { "peerDependencies": {
"react": "*", "react": "*",

View File

@ -18,7 +18,7 @@
"url": "https://github.com/storybooks/storybook.git" "url": "https://github.com/storybooks/storybook.git"
}, },
"scripts": { "scripts": {
"dev": "DEV_BUILD=1 nodemon --watch ./src --exec 'yarn prepare'", "dev": "cross-env DEV_BUILD=1 nodemon --watch ./src --exec \"yarn prepare\"",
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
@ -48,7 +48,7 @@
"core-js": "^2.5.1", "core-js": "^2.5.1",
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"express": "^4.16.2", "express": "^4.16.2",
"file-loader": "^0.11.2", "file-loader": "^1.1.5",
"find-cache-dir": "^1.0.0", "find-cache-dir": "^1.0.0",
"glamor": "^2.20.40", "glamor": "^2.20.40",
"glamorous": "^4.11.0", "glamorous": "^4.11.0",
@ -62,7 +62,6 @@
"postcss-loader": "^2.0.8", "postcss-loader": "^2.0.8",
"prop-types": "^15.6.0", "prop-types": "^15.6.0",
"qs": "^6.5.1", "qs": "^6.5.1",
"react-modal": "^2.4.1",
"redux": "^3.7.2", "redux": "^3.7.2",
"request": "^2.83.0", "request": "^2.83.0",
"serve-favicon": "^2.4.5", "serve-favicon": "^2.4.5",

View File

@ -18,7 +18,7 @@
"url": "https://github.com/storybooks/storybook.git" "url": "https://github.com/storybooks/storybook.git"
}, },
"scripts": { "scripts": {
"dev": "DEV_BUILD=1 nodemon --watch ./src --exec 'yarn prepare'", "dev": "cross-env DEV_BUILD=1 nodemon --watch ./src --exec \"yarn prepare\"",
"prepare": "node ../../scripts/prepare.js" "prepare": "node ../../scripts/prepare.js"
}, },
"dependencies": { "dependencies": {
@ -48,7 +48,7 @@
"core-js": "^2.5.1", "core-js": "^2.5.1",
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"express": "^4.16.2", "express": "^4.16.2",
"file-loader": "^0.11.2", "file-loader": "^1.1.5",
"find-cache-dir": "^1.0.0", "find-cache-dir": "^1.0.0",
"global": "^4.3.2", "global": "^4.3.2",
"json-loader": "^0.5.7", "json-loader": "^0.5.7",
@ -61,7 +61,6 @@
"qs": "^6.5.1", "qs": "^6.5.1",
"react": "^16.0.0", "react": "^16.0.0",
"react-dom": "^16.0.0", "react-dom": "^16.0.0",
"react-modal": "^2.4.1",
"redux": "^3.7.2", "redux": "^3.7.2",
"request": "^2.83.0", "request": "^2.83.0",
"serve-favicon": "^2.4.5", "serve-favicon": "^2.4.5",
@ -79,9 +78,9 @@
"devDependencies": { "devDependencies": {
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"nodemon": "^1.12.1", "nodemon": "^1.12.1",
"vue": "^2.5.2", "vue": "^2.5.3",
"vue-loader": "^13.3.0", "vue-loader": "^13.4.0",
"vue-template-compiler": "^2.5.2" "vue-template-compiler": "^2.5.3"
}, },
"peerDependencies": { "peerDependencies": {
"vue": "*", "vue": "*",

View File

@ -29,7 +29,7 @@ collectors:
bootstrap_command: yarn bootstrap_command: yarn
actors: actors:
# pull requests for updates to our major version # pull requests for updates to our major version
- type: js-lerna:0.9.0-beta - type: js-lerna
versions: "L.Y.Y" versions: "L.Y.Y"
settings: settings:
batch_mode: true batch_mode: true
@ -54,6 +54,7 @@ collectors:
- type: js-npm - type: js-npm
versions: "L.Y.Y" versions: "L.Y.Y"
settings: settings:
batch_mode: true
github_labels: github_labels:
- dependencies:update - dependencies:update
github_assignees: github_assignees:

View File

@ -34,7 +34,7 @@
"@storybook/addons": "^3.2.10", "@storybook/addons": "^3.2.10",
"@storybook/components": "^3.2.10", "@storybook/components": "^3.2.10",
"@storybook/react": "^3.2.11", "@storybook/react": "^3.2.11",
"react-scripts": "1.0.16" "react-scripts": "1.0.17"
}, },
"private": true "private": true
} }

View File

@ -14,18 +14,18 @@
"babel-loader": "^7.1.2", "babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0", "babel-preset-env": "^1.6.0",
"babel-preset-vue": "^1.2.1", "babel-preset-vue": "^1.2.1",
"cross-env": "^3.0.0", "cross-env": "^5.1.1",
"css-loader": "^0.28.7", "css-loader": "^0.28.7",
"file-loader": "^1.1.5", "file-loader": "^1.1.5",
"vue-hot-reload-api": "^2.2.0", "vue-hot-reload-api": "^2.2.0",
"vue-loader": "^13.3.0", "vue-loader": "^13.4.0",
"vue-style-loader": "^3.0.1", "vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2", "vue-template-compiler": "^2.5.3",
"webpack": "^3.6.0", "webpack": "^3.6.0",
"webpack-dev-server": "^2.9.3" "webpack-dev-server": "^2.9.3"
}, },
"dependencies": { "dependencies": {
"vue": "^2.5.2", "vue": "^2.5.3",
"vuex": "^3.0.0" "vuex": "^3.0.0"
}, },
"scripts": { "scripts": {

View File

@ -1,5 +1,5 @@
{ {
"lerna": "2.4.0", "lerna": "2.5.1",
"npmClient": "yarn", "npmClient": "yarn",
"useWorkspaces": true, "useWorkspaces": true,
"commands": { "commands": {

View File

@ -33,7 +33,7 @@
"react-icons": "^2.2.7", "react-icons": "^2.2.7",
"react-inspector": "^2.2.1", "react-inspector": "^2.2.1",
"react-komposer": "^2.0.0", "react-komposer": "^2.0.0",
"react-modal": "^2.4.1", "react-modal": "^3.1.2",
"react-split-pane": "^0.1.68", "react-split-pane": "^0.1.68",
"react-treebeard": "^2.0.3", "react-treebeard": "^2.0.3",
"redux": "^3.7.2" "redux": "^3.7.2"

View File

@ -1,4 +1,3 @@
import { document } from 'global';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactModal from 'react-modal'; import ReactModal from 'react-modal';
@ -20,6 +19,7 @@ const modalStyle = {
}, },
overlay: { overlay: {
background: 'transparent', background: 'transparent',
zIndex: '1',
}, },
}; };
@ -68,13 +68,13 @@ export default class SearchBox extends React.Component {
this.onSelect = this.onSelect.bind(this); this.onSelect = this.onSelect.bind(this);
this.fireOnStory = this.fireOnStory.bind(this); this.fireOnStory = this.fireOnStory.bind(this);
this.fireOnKind = this.fireOnKind.bind(this); this.fireOnKind = this.fireOnKind.bind(this);
this.inputRef = this.inputRef.bind(this);
} }
// TODO: Remove this if and when https://github.com/reactjs/react-modal/issues/464 resolves
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
// remove current focus on opening to prevent firing 'enter' keyDowns on it when modal closes // focus search box on opening
if (this.props.showSearchBox && !prevProps.showSearchBox && document.activeElement) { if (this.props.showSearchBox && !prevProps.showSearchBox && this.input != null) {
document.activeElement.blur(); this.input.focus();
} }
} }
@ -95,6 +95,12 @@ export default class SearchBox extends React.Component {
if (onSelectStory) onSelectStory(kind, story); if (onSelectStory) onSelectStory(kind, story);
} }
inputRef(fuzzy) {
if (fuzzy != null) {
this.input = fuzzy.refs.searchBox;
}
}
render() { render() {
return ( return (
<ReactModal <ReactModal
@ -102,13 +108,14 @@ export default class SearchBox extends React.Component {
onRequestClose={this.props.onClose} onRequestClose={this.props.onClose}
style={modalStyle} style={modalStyle}
contentLabel="Search" contentLabel="Search"
shouldReturnFocusAfterClose={false}
> >
<FuzzySearch <FuzzySearch
list={formatStories(this.props.stories)} list={formatStories(this.props.stories)}
onSelect={this.onSelect} onSelect={this.onSelect}
keys={['value', 'type']} keys={['value', 'type']}
resultsTemplate={suggestionTemplate} resultsTemplate={suggestionTemplate}
autoFocus ref={this.inputRef}
/> />
</ReactModal> </ReactModal>
); );

View File

@ -23,7 +23,6 @@ describe('manager.ui.components.search_box', () => {
const search = modal.find(FuzzySearch); const search = modal.find(FuzzySearch);
expect(search).toBePresent(); expect(search).toBePresent();
expect(search).toHaveProp('keys', ['value', 'type']); expect(search).toHaveProp('keys', ['value', 'type']);
expect(search).toHaveProp('autoFocus', true);
}); });
test('should format stories', () => { test('should format stories', () => {

View File

@ -14,7 +14,7 @@
"examples/vue-kitchen-sink" "examples/vue-kitchen-sink"
], ],
"scripts": { "scripts": {
"bootstrap": "./scripts/bootstrap.js", "bootstrap": "node ./scripts/bootstrap.js",
"bootstrap:docs": "yarn install --cwd docs", "bootstrap:docs": "yarn install --cwd docs",
"bootstrap:react-native-vanilla": "npm --prefix examples/react-native-vanilla install", "bootstrap:react-native-vanilla": "npm --prefix examples/react-native-vanilla install",
"bootstrap:crna-kitchen-sink": "npm --prefix examples/crna-kitchen-sink install", "bootstrap:crna-kitchen-sink": "npm --prefix examples/crna-kitchen-sink install",
@ -34,13 +34,13 @@
"lint:js": "eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.json", "lint:js": "eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.json",
"lint:md": "remark", "lint:md": "remark",
"publish": "lerna publish", "publish": "lerna publish",
"test": "./scripts/test.js", "test": "node ./scripts/test.js",
"repo-dirty-check": "node ./scripts/repo-dirty-check" "repo-dirty-check": "node ./scripts/repo-dirty-check"
}, },
"devDependencies": { "devDependencies": {
"babel-cli": "^6.26.0", "babel-cli": "^6.26.0",
"babel-core": "^6.26.0", "babel-core": "^6.26.0",
"babel-eslint": "^8.0.0", "babel-eslint": "^8.0.2",
"babel-plugin-transform-md-import-to-string": "^1.0.6", "babel-plugin-transform-md-import-to-string": "^1.0.6",
"babel-plugin-transform-runtime": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0", "babel-polyfill": "^6.26.0",
@ -50,12 +50,13 @@
"chalk": "^2.3.0", "chalk": "^2.3.0",
"codecov": "^3.0.0", "codecov": "^3.0.0",
"commander": "^2.11.0", "commander": "^2.11.0",
"danger": "^1.2.0", "cross-env": "^5.1.1",
"enzyme": "^3.1.0", "danger": "^2.0.1",
"enzyme-adapter-react-16": "^1.0.2", "enzyme": "^3.1.1",
"enzyme-adapter-react-16": "^1.0.4",
"eslint": "^4.10.0", "eslint": "^4.10.0",
"eslint-config-airbnb": "^16.1.0", "eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.4.0", "eslint-config-prettier": "^2.7.0",
"eslint-plugin-import": "^2.8.0", "eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.0.0", "eslint-plugin-jest": "^21.0.0",
"eslint-plugin-json": "^1.2.0", "eslint-plugin-json": "^1.2.0",
@ -72,12 +73,12 @@
"jest-cli": "^21.2.1", "jest-cli": "^21.2.1",
"jest-enzyme": "^4.0.1", "jest-enzyme": "^4.0.1",
"jest-image-snapshot": "^2.1.0", "jest-image-snapshot": "^2.1.0",
"lerna": "^2.4.0", "lerna": "^2.5.1",
"lint-staged": "^4.3.0", "lint-staged": "^4.3.0",
"lodash": "^4.17.4", "lodash": "^4.17.4",
"nodemon": "^1.12.1", "nodemon": "^1.12.1",
"npmlog": "^4.1.2", "npmlog": "^4.1.2",
"prettier": "^1.7.4", "prettier": "^1.8.1",
"puppeteer": "^0.12.0", "puppeteer": "^0.12.0",
"raf": "^3.4.0", "raf": "^3.4.0",
"react": "^16.0.0", "react": "^16.0.0",

535
yarn.lock

File diff suppressed because it is too large Load Diff