Compare commits

...

4 Commits

Author SHA1 Message Date
Nicolas Gallagher
000b92e707 0.9.13 2018-12-31 17:31:46 -08:00
Nicolas Gallagher
d5f5dbccdb [fix] inline-style-prefixer API update
Fix #1217
2018-12-31 17:22:05 -08:00
Nicolas Gallagher
79456d5920 0.9.12 2018-12-31 10:34:04 -08:00
Nicolas Gallagher
2d1e303a6a [fix] ScrollView with stickyHeaderIndices regression
A ScrollView with stickyHeaderIndices would not render children that
weren't sticky.

Fixes 1e202b6bd5
2018-12-31 10:26:33 -08:00
11 changed files with 59 additions and 44 deletions

View File

@@ -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",

View File

@@ -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": {

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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];

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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,

View File

@@ -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"
}

View File

@@ -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')
});