Compare commits

...

5 Commits

Author SHA1 Message Date
Nicolas Gallagher
64d2d34367 0.0.87 2017-04-23 13:39:27 -07:00
Nicolas Gallagher
d83cd45b6f [fix] Clipboard browser support
Safari 10.3 supports copying (but apparently not from inputs)
2017-04-23 13:38:51 -07:00
Nicolas Gallagher
227971d22c [add] support for CSS grid properties (experimental)
Allow people to experiment with using CSS grid in react-native. (No
support for shorthand properties.)
2017-04-22 10:34:43 -07:00
Nicolas Gallagher
4822cf4620 [add] support for 'clip' and 'textIndent' styles 2017-04-22 10:06:27 -07:00
Nathan Broadbent
91e4528eac Allow filter property in CSS 2017-04-22 22:56:07 +07:00
7 changed files with 74 additions and 10 deletions

View File

@@ -85,6 +85,7 @@ When `false`, the text is not selectable.
+ `textAlign`
+ `textAlignVertical`
+ `textDecorationLine`
+ `textIndent`
+ `textOverflow`
+ `textRendering`
+ `textShadowColor`

View File

@@ -186,16 +186,30 @@ Controls whether the View can be the target of touch events. The enhanced
+ `borderRightWidth`
+ `borderTopWidth`
+ `bottom`
+ `boxShadow`
+ `boxShadow`
+ `boxSizing`
+ `clip`
+ `cursor`
+ `display`
+ `filter`
+ `flex` (number)
+ `flexBasis`
+ `flexDirection`
+ `flexGrow`
+ `flexShrink`
+ `flexWrap`
+ `gridAutoColumns`
+ `gridAutoFlow`
+ `gridAutoRows`
+ `gridColumnEnd`
+ `gridColumnGap`
+ `gridColumnStart`
+ `gridRowEnd`
+ `gridRowGap`
+ `gridRowStart`
+ `gridTemplateColumns`
+ `gridTemplateRows`
+ `gridTemplateAreas`
+ `height`
+ `justifyContent`
+ `left`
@@ -228,6 +242,10 @@ Controls whether the View can be the target of touch events. The enhanced
+ `perspectiveOrigin`
+ `position`
+ `right`
+ `shadowColor`
+ `shadowOffset`
+ `shadowOpacity`
+ `shadowRadius`
+ `top`
+ `transform`
+ `transformOrigin`

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-web",
"version": "0.0.86",
"version": "0.0.87",
"description": "React Native for Web",
"main": "dist/index.js",
"files": [

View File

@@ -1,19 +1,43 @@
/* global window */
class Clipboard {
static isSupported() {
return (
typeof document.queryCommandSupported === 'function' && document.queryCommandSupported('copy')
);
}
static getString() {
return Promise.resolve('');
}
static setString(text) {
let success = false;
const textField = document.createElement('textarea');
textField.innerText = text;
document.body.appendChild(textField);
textField.select();
// add the text to a hidden node
const node = document.createElement('span');
node.textContent = text;
node.style.position = 'absolute';
node.style.opacity = '0';
document.body.appendChild(node);
// select the text
const selection = window.getSelection();
selection.removeAllRanges();
const range = document.createRange();
range.selectNodeContents(node);
selection.addRange(range);
// attempt to copy
try {
document.execCommand('copy');
success = true;
} catch (e) {}
document.body.removeChild(textField);
// remove selection and node
selection.removeAllRanges();
document.body.removeChild(node);
return success;
}
}

View File

@@ -25,6 +25,7 @@ const TextOnlyStylePropTypes = {
textShadowRadius: number,
writingDirection: WritingDirectionPropType,
/* @platform web */
textIndent: numberOrString,
textOverflow: string,
textRendering: oneOf(['auto', 'geometricPrecision', 'optimizeLegibility', 'optimizeSpeed']),
textTransform: oneOf(['capitalize', 'lowercase', 'none', 'uppercase']),

View File

@@ -18,7 +18,7 @@ module.exports = {
* @platform unsupported
*/
elevation: number,
/*
/**
* @platform web
*/
backgroundAttachment: string,
@@ -29,7 +29,9 @@ module.exports = {
backgroundRepeat: string,
backgroundSize: string,
boxShadow: string,
clip: string,
cursor: string,
filter: string,
outline: string,
outlineColor: ColorPropType,
perspective: oneOfType([number, string]),

View File

@@ -14,7 +14,6 @@ const LayoutPropTypes = {
]),
alignItems: oneOf(['baseline', 'center', 'flex-end', 'flex-start', 'stretch']),
alignSelf: oneOf(['auto', 'baseline', 'center', 'flex-end', 'flex-start', 'stretch']),
aspectRatio: number,
backfaceVisibility: hiddenOrVisible,
borderWidth: numberOrString,
borderBottomWidth: numberOrString,
@@ -61,7 +60,26 @@ const LayoutPropTypes = {
top: numberOrString,
visibility: hiddenOrVisible,
width: numberOrString,
zIndex: number
zIndex: number,
/**
* @platform unsupported
*/
aspectRatio: number,
/**
* @platform web
*/
gridAutoColumns: string,
gridAutoFlow: string,
gridAutoRows: string,
gridColumnEnd: string,
gridColumnGap: string,
gridColumnStart: string,
gridRowEnd: string,
gridRowGap: string,
gridRowStart: string,
gridTemplateColumns: string,
gridTemplateRows: string,
gridTemplateAreas: string
};
module.exports = LayoutPropTypes;