react-figma
Advanced tools
Comparing version 0.0.30 to 0.0.31
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var isValidSize = function (size) { | ||
return size && size >= 0.01; | ||
}; | ||
var isValidSize_1 = require("../helpers/isValidSize"); | ||
exports.layoutMixin = function (node) { return function (props) { | ||
@@ -19,3 +17,3 @@ if (props.relativeTransform) { | ||
} | ||
if (isValidSize(props.width) && isValidSize(props.height) && node.type !== 'LINE') { | ||
if (isValidSize_1.isValidSize(props.width) && isValidSize_1.isValidSize(props.height) && node.type !== 'LINE') { | ||
if (props.isWithoutConstraints) { | ||
@@ -28,3 +26,3 @@ node.resizeWithoutConstraints(props.width, props.height); | ||
} | ||
if (isValidSize(props.width) && node.type === 'LINE') { | ||
if (isValidSize_1.isValidSize(props.width) && node.type === 'LINE') { | ||
if (props.isWithoutConstraints) { | ||
@@ -31,0 +29,0 @@ node.resizeWithoutConstraints(props.width, 0); |
{ | ||
"name": "react-figma", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"description": "This plugin template uses Typescript. If you are familiar with Javascript, Typescript will look very familiar. In fact, valid Javascript code is already valid Typescript code.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -28,6 +28,6 @@ <p align="center"><img src="./logo.svg" width="128"></p> | ||
return ( | ||
<Page name="New page"> | ||
<Page name="New page" isCurrent> | ||
<View> | ||
<View style={{ width: 200, height: 100, backgroundColor: '#dd55aa' }} /> | ||
<Text characters="text" style={{ color: '#ffffff' }} /> | ||
<Text style={{ color: '#ffffff' }}>text</Text> | ||
</View> | ||
@@ -34,0 +34,0 @@ </Page> |
@@ -11,2 +11,3 @@ "use strict"; | ||
var blendMixin_1 = require("../mixins/blendMixin"); | ||
var isValidSize_1 = require("../helpers/isValidSize"); | ||
var textNodePropsAssign = propsAssign_1.propsAssign([ | ||
@@ -42,3 +43,9 @@ 'characters', | ||
} | ||
textNode.textAutoResize = props.textAutoResize || 'WIDTH_AND_HEIGHT'; | ||
if (isValidSize_1.isValidSize(props.width) && isValidSize_1.isValidSize(textNode.height) && !props.textAutoResize) { | ||
textNode.resize(props.width, textNode.height); | ||
textNode.textAutoResize = 'HEIGHT'; | ||
} | ||
else { | ||
textNode.textAutoResize = props.textAutoResize || 'WIDTH_AND_HEIGHT'; | ||
} | ||
textNodePropsAssign(textNode)(props); | ||
@@ -45,0 +52,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
259610
227
3996