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` + `textAlign`
+ `textAlignVertical` + `textAlignVertical`
+ `textDecorationLine` + `textDecorationLine`
+ `textIndent`
+ `textOverflow` + `textOverflow`
+ `textRendering` + `textRendering`
+ `textShadowColor` + `textShadowColor`

View File

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

View File

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

View File

@@ -1,19 +1,43 @@
/* global window */
class Clipboard { class Clipboard {
static isSupported() {
return (
typeof document.queryCommandSupported === 'function' && document.queryCommandSupported('copy')
);
}
static getString() { static getString() {
return Promise.resolve(''); return Promise.resolve('');
} }
static setString(text) { static setString(text) {
let success = false; let success = false;
const textField = document.createElement('textarea');
textField.innerText = text; // add the text to a hidden node
document.body.appendChild(textField); const node = document.createElement('span');
textField.select(); 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 { try {
document.execCommand('copy'); document.execCommand('copy');
success = true; success = true;
} catch (e) {} } catch (e) {}
document.body.removeChild(textField);
// remove selection and node
selection.removeAllRanges();
document.body.removeChild(node);
return success; return success;
} }
} }

View File

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

View File

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

View File

@@ -14,7 +14,6 @@ const LayoutPropTypes = {
]), ]),
alignItems: oneOf(['baseline', 'center', 'flex-end', 'flex-start', 'stretch']), alignItems: oneOf(['baseline', 'center', 'flex-end', 'flex-start', 'stretch']),
alignSelf: oneOf(['auto', 'baseline', 'center', 'flex-end', 'flex-start', 'stretch']), alignSelf: oneOf(['auto', 'baseline', 'center', 'flex-end', 'flex-start', 'stretch']),
aspectRatio: number,
backfaceVisibility: hiddenOrVisible, backfaceVisibility: hiddenOrVisible,
borderWidth: numberOrString, borderWidth: numberOrString,
borderBottomWidth: numberOrString, borderBottomWidth: numberOrString,
@@ -61,7 +60,26 @@ const LayoutPropTypes = {
top: numberOrString, top: numberOrString,
visibility: hiddenOrVisible, visibility: hiddenOrVisible,
width: numberOrString, 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; module.exports = LayoutPropTypes;