react-figma
Advanced tools
Comparing version 0.0.53 to 0.0.54
@@ -20,7 +20,8 @@ "use strict"; | ||
var useSelectionChange_1 = require("../../hooks/useSelectionChange"); | ||
var transformAutoLayoutToYoga_1 = require("../../styleTransformers/transformAutoLayoutToYoga"); | ||
exports.Component = function (props) { | ||
var nodeRef = props.nodeRef || React.useRef(); | ||
useSelectionChange_1.useSelectionChange(nodeRef, props); | ||
var style = __1.StyleSheet.flatten(props.style); | ||
var componentProps = __assign({}, transformLayoutStyleProperties_1.transformLayoutStyleProperties(style), transformBlendProperties_1.transformBlendProperties(style), props); | ||
var style = __assign({}, __1.StyleSheet.flatten(props.style), transformAutoLayoutToYoga_1.transformAutoLayoutToYoga(props)); | ||
var componentProps = __assign({}, transformLayoutStyleProperties_1.transformLayoutStyleProperties(style), transformBlendProperties_1.transformBlendProperties(style), props, { style: style }); | ||
var yogaChildProps = useYogaLayout_1.useYogaLayout(__assign({ nodeRef: nodeRef }, componentProps)); | ||
@@ -27,0 +28,0 @@ return React.createElement("component", __assign({}, componentProps, yogaChildProps, { innerRef: nodeRef })); |
@@ -21,2 +21,3 @@ "use strict"; | ||
var useSelectionChange_1 = require("../../hooks/useSelectionChange"); | ||
var transformAutoLayoutToYoga_1 = require("../../styleTransformers/transformAutoLayoutToYoga"); | ||
var findNodeByName = function (children, name) { | ||
@@ -33,4 +34,4 @@ return children && children.find(function (child) { return child.name === name || findNodeByName(child.children, name); }); | ||
useSelectionChange_1.useSelectionChange(nodeRef, props); | ||
var style = __1.StyleSheet.flatten(props.style); | ||
var componentProps = __assign({}, transformLayoutStyleProperties_1.transformLayoutStyleProperties(style), transformBlendProperties_1.transformBlendProperties(style), props); | ||
var style = __assign({}, __1.StyleSheet.flatten(props.style), transformAutoLayoutToYoga_1.transformAutoLayoutToYoga(props)); | ||
var componentProps = __assign({}, transformLayoutStyleProperties_1.transformLayoutStyleProperties(style), transformBlendProperties_1.transformBlendProperties(style), props, { style: style }); | ||
var yogaProps = useYogaLayout_1.useYogaLayout(__assign({ nodeRef: nodeRef }, componentProps)); | ||
@@ -37,0 +38,0 @@ return (React.createElement("instance", __assign({}, componentProps, yogaProps, { innerRef: nodeRef, innerRefCallback: function () { return setHaveNode(true); } }), isHaveNode && props.overrides |
@@ -33,2 +33,3 @@ "use strict"; | ||
var transformBorderProperties_1 = require("../../styleTransformers/transformBorderProperties"); | ||
var transformAutoLayoutToYoga_1 = require("../../styleTransformers/transformAutoLayoutToYoga"); | ||
exports.FRAME_PRESETS = { | ||
@@ -204,5 +205,5 @@ iPhoneX: { | ||
useSelectionChange_1.useSelectionChange(nodeRef, props); | ||
var style = StyleSheet_1.StyleSheet.flatten(props.style); | ||
var style = __assign({}, StyleSheet_1.StyleSheet.flatten(props.style), transformAutoLayoutToYoga_1.transformAutoLayoutToYoga(props)); | ||
var preset = props.preset, propWithoutPreset = __rest(props, ["preset"]); | ||
var frameProps = __assign({}, (preset || {}), transformLayoutStyleProperties_1.transformLayoutStyleProperties(style), transformBlendProperties_1.transformBlendProperties(style), transformGeometryStyleProperties_1.transformGeometryStyleProperties('backgrounds', style), transformBorderProperties_1.transformBorderStyleProperties(style), propWithoutPreset); | ||
var frameProps = __assign({}, (preset || {}), transformLayoutStyleProperties_1.transformLayoutStyleProperties(style), transformBlendProperties_1.transformBlendProperties(style), transformGeometryStyleProperties_1.transformGeometryStyleProperties('backgrounds', style), transformBorderProperties_1.transformBorderStyleProperties(style), propWithoutPreset, { style: style }); | ||
var yogaChildProps = useYogaLayout_1.useYogaLayout(__assign({ nodeRef: nodeRef }, frameProps)); | ||
@@ -209,0 +210,0 @@ return React.createElement("frame", __assign({}, frameProps, yogaChildProps, { innerRef: nodeRef })); |
{ | ||
"name": "react-figma", | ||
"version": "0.0.53", | ||
"version": "0.0.54", | ||
"description": "Render React components to Figma", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -47,3 +47,3 @@ "use strict"; | ||
exports.yogaWorker = function (yoga) { return function (message) { | ||
if (!message.value || message.value.type !== 'calculateLayout') { | ||
if (!message.value || message.value.type !== 'calculateLayout' || !yoga) { | ||
return; | ||
@@ -50,0 +50,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
320748
261
4899