mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-23 09:54:49 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
000b92e707 | ||
|
|
d5f5dbccdb | ||
|
|
79456d5920 | ||
|
|
2d1e303a6a |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"version": "0.9.11",
|
||||
"version": "0.9.13",
|
||||
"name": "react-native-web-monorepo",
|
||||
"scripts": {
|
||||
"clean": "del ./packages/*/dist",
|
||||
@@ -49,6 +49,7 @@
|
||||
"flow-bin": "^0.63.1",
|
||||
"glob": "^7.1.2",
|
||||
"husky": "^0.14.3",
|
||||
"inline-style-prefixer": "^5.0.3",
|
||||
"jest": "^22.4.3",
|
||||
"jest-canvas-mock": "^1.0.2",
|
||||
"lint-staged": "^7.1.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "babel-plugin-react-native-web",
|
||||
"version": "0.9.11",
|
||||
"version": "0.9.13",
|
||||
"description": "Babel plugin for React Native for Web",
|
||||
"main": "index.js",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "benchmarks",
|
||||
"version": "0.9.11",
|
||||
"version": "0.9.13",
|
||||
"scripts": {
|
||||
"build": "mkdir -p dist && cp -f index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js",
|
||||
"release": "NODE_ENV=production yarn build && git checkout gh-pages && rm -rf ../../benchmarks && mv dist ../../benchmarks && git add -A && git commit -m \"Benchmarks deploy\" && git push origin gh-pages && git checkout -"
|
||||
@@ -16,7 +16,7 @@
|
||||
"react-dom": "^16.7.0",
|
||||
"react-fela": "^10.0.2",
|
||||
"react-jss": "^8.6.1",
|
||||
"react-native-web": "0.9.11",
|
||||
"react-native-web": "0.9.13",
|
||||
"reactxp": "^1.5.0",
|
||||
"styled-components": "^4.1.3",
|
||||
"styled-jsx": "^3.1.2",
|
||||
@@ -24,7 +24,7 @@
|
||||
"styletron-react": "^4.4.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-react-native-web": "0.9.11",
|
||||
"babel-plugin-react-native-web": "0.9.13",
|
||||
"css-loader": "^2.0.2",
|
||||
"style-loader": "^0.23.1",
|
||||
"url-loader": "^1.1.2",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "react-native-examples",
|
||||
"version": "0.9.11",
|
||||
"version": "0.9.13",
|
||||
"scripts": {
|
||||
"build": "mkdir -p dist && cp -f src/index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js",
|
||||
"release": "yarn build && git checkout gh-pages && rm -rf ../../examples && mv dist ../../examples && git add -A && git commit -m \"Examples deploy\" && git push origin gh-pages && git checkout -"
|
||||
@@ -10,10 +10,10 @@
|
||||
"babel-runtime": "^6.26.0",
|
||||
"react": "^16.5.1",
|
||||
"react-dom": "^16.5.1",
|
||||
"react-native-web": "0.9.11"
|
||||
"react-native-web": "0.9.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-react-native-web": "0.9.11",
|
||||
"babel-plugin-react-native-web": "0.9.13",
|
||||
"babel-plugin-transform-runtime": "^6.23.0",
|
||||
"file-loader": "^1.1.11",
|
||||
"webpack": "^4.8.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-web",
|
||||
"version": "0.9.11",
|
||||
"version": "0.9.13",
|
||||
"description": "React Native for Web",
|
||||
"module": "dist/index.js",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import React from 'react';
|
||||
import ScrollView from '..';
|
||||
import StyleSheet from '../../StyleSheet';
|
||||
import View from '../../View';
|
||||
import { mount, shallow } from 'enzyme';
|
||||
|
||||
describe('components/ScrollView', () => {
|
||||
@@ -13,6 +14,21 @@ describe('components/ScrollView', () => {
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
test('"children" prop', () => {
|
||||
const component = shallow(
|
||||
<ScrollView>
|
||||
<View testID="child" />
|
||||
</ScrollView>
|
||||
);
|
||||
expect(component.find({ testID: 'child' }).length).toBe(1);
|
||||
|
||||
component.setProps({ stickyHeaderIndices: [4] });
|
||||
expect(component.find({ testID: 'child' }).length).toBe(1);
|
||||
|
||||
component.setProps({ pagingEnabled: true });
|
||||
expect(component.find({ testID: 'child' }).length).toBe(1);
|
||||
});
|
||||
|
||||
test('"pagingEnabled" prop', () => {
|
||||
const getStyleProp = (component, prop) => StyleSheet.flatten(component.prop('style'))[prop];
|
||||
|
||||
|
||||
@@ -168,20 +168,18 @@ const ScrollView = createReactClass({
|
||||
const children =
|
||||
hasStickyHeaderIndices || pagingEnabled
|
||||
? React.Children.map(this.props.children, (child, i) => {
|
||||
if (child != null) {
|
||||
const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
|
||||
if (isSticky || pagingEnabled) {
|
||||
return (
|
||||
<View
|
||||
style={StyleSheet.compose(
|
||||
isSticky && styles.stickyHeader,
|
||||
pagingEnabled && styles.pagingEnabledChild
|
||||
)}
|
||||
>
|
||||
{child}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
const isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
|
||||
if (child != null && (isSticky || pagingEnabled)) {
|
||||
return (
|
||||
<View
|
||||
style={StyleSheet.compose(
|
||||
isSticky && styles.stickyHeader,
|
||||
pagingEnabled && styles.pagingEnabledChild
|
||||
)}
|
||||
>
|
||||
{child}
|
||||
</View>
|
||||
);
|
||||
} else {
|
||||
return child;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import createPrefixer from 'inline-style-prefixer/static/createPrefixer';
|
||||
import createPrefixer from 'inline-style-prefixer/lib/createPrefixer';
|
||||
import staticData from './static';
|
||||
|
||||
const prefixAll = createPrefixer(staticData);
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import crossFade from 'inline-style-prefixer/static/plugins/crossFade';
|
||||
import cursor from 'inline-style-prefixer/static/plugins/cursor';
|
||||
import filter from 'inline-style-prefixer/static/plugins/filter';
|
||||
import flex from 'inline-style-prefixer/static/plugins/flex';
|
||||
import flexboxIE from 'inline-style-prefixer/static/plugins/flexboxIE';
|
||||
import flexboxOld from 'inline-style-prefixer/static/plugins/flexboxOld';
|
||||
import gradient from 'inline-style-prefixer/static/plugins/gradient';
|
||||
import imageSet from 'inline-style-prefixer/static/plugins/imageSet';
|
||||
import position from 'inline-style-prefixer/static/plugins/position';
|
||||
import sizing from 'inline-style-prefixer/static/plugins/sizing';
|
||||
import transition from 'inline-style-prefixer/static/plugins/transition';
|
||||
import backgroundClip from 'inline-style-prefixer/lib/plugins/backgroundClip';
|
||||
import crossFade from 'inline-style-prefixer/lib/plugins/crossFade';
|
||||
import cursor from 'inline-style-prefixer/lib/plugins/cursor';
|
||||
import filter from 'inline-style-prefixer/lib/plugins/filter';
|
||||
import flex from 'inline-style-prefixer/lib/plugins/flex';
|
||||
import flexboxIE from 'inline-style-prefixer/lib/plugins/flexboxIE';
|
||||
import flexboxOld from 'inline-style-prefixer/lib/plugins/flexboxOld';
|
||||
import gradient from 'inline-style-prefixer/lib/plugins/gradient';
|
||||
import imageSet from 'inline-style-prefixer/lib/plugins/imageSet';
|
||||
import position from 'inline-style-prefixer/lib/plugins/position';
|
||||
import sizing from 'inline-style-prefixer/lib/plugins/sizing';
|
||||
import transition from 'inline-style-prefixer/lib/plugins/transition';
|
||||
const w = ['Webkit'];
|
||||
const m = ['Moz'];
|
||||
const ms = ['ms'];
|
||||
@@ -18,6 +19,7 @@ const wmms = ['Webkit', 'Moz', 'ms'];
|
||||
|
||||
export default {
|
||||
plugins: [
|
||||
backgroundClip,
|
||||
crossFade,
|
||||
cursor,
|
||||
filter,
|
||||
@@ -120,6 +122,7 @@ export default {
|
||||
flowInto: wms,
|
||||
flowFrom: wms,
|
||||
regionFragment: wms,
|
||||
textOrientation: w,
|
||||
textAlignLast: m,
|
||||
tabSize: m,
|
||||
wrapFlow: ms,
|
||||
@@ -144,7 +147,7 @@ export default {
|
||||
gridRowGap: ms,
|
||||
gridArea: ms,
|
||||
gridGap: ms,
|
||||
textSizeAdjust: wms,
|
||||
textSizeAdjust: ['ms', 'Webkit'],
|
||||
borderImage: w,
|
||||
borderImageOutset: w,
|
||||
borderImageRepeat: w,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "website",
|
||||
"version": "0.9.11",
|
||||
"version": "0.9.13",
|
||||
"scripts": {
|
||||
"build": "build-storybook -o ./dist -c ./storybook/.storybook",
|
||||
"start": "start-storybook -p 9001 -c ./storybook/.storybook",
|
||||
@@ -12,10 +12,10 @@
|
||||
"@storybook/react": "^3.4.3",
|
||||
"react": "^16.5.1",
|
||||
"react-dom": "^16.5.1",
|
||||
"react-native-web": "0.9.11"
|
||||
"react-native-web": "0.9.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-react-native-web": "0.9.11",
|
||||
"babel-plugin-react-native-web": "0.9.13",
|
||||
"url-loader": "^1.0.1",
|
||||
"webpack": "^4.8.1"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const generator = require('inline-style-prefixer/generator');
|
||||
const generator = require('inline-style-prefixer/lib/generator').default;
|
||||
const path = require('path');
|
||||
|
||||
const browserList = {
|
||||
@@ -19,8 +19,5 @@ const browserList = {
|
||||
};
|
||||
|
||||
generator(browserList, {
|
||||
staticPath: path.join(
|
||||
__dirname,
|
||||
'../../packages/react-native-web/src/modules/prefixStyles/static.js'
|
||||
)
|
||||
path: path.join(__dirname, '../../packages/react-native-web/src/modules/prefixStyles/static.js')
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user