Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-figma

Package Overview
Dependencies
Maintainers
1
Versions
113
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-figma - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

helpers/connectToDevTools.d.ts

3

components/component/Component.d.ts

@@ -11,2 +11,3 @@ import * as React from 'react';

}
export declare const Component: React.FC<ComponentProps>;
declare const Component: React.FC<ComponentProps>;
export { Component };

@@ -22,3 +22,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Component = function (props) {
var Component = function (props) {
var nodeRef = props.nodeRef || React.useRef();

@@ -32,2 +32,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Component = Component;
//# sourceMappingURL=Component.js.map

@@ -14,2 +14,3 @@ import * as React from 'react';

}
export declare const Instance: React.FC<InstanceProps>;
declare const Instance: React.FC<InstanceProps>;
export { Instance };

@@ -93,3 +93,3 @@ "use strict";

};
exports.Instance = function (props) {
var Instance = function (props) {
var _a = React.useState(false), isHaveNode = _a[0], setHaveNode = _a[1];

@@ -108,2 +108,3 @@ var nodeRef = React.useRef();

};
exports.Instance = Instance;
//# sourceMappingURL=Instance.js.map

@@ -13,2 +13,3 @@ import * as React from 'react';

}
export declare const Ellipse: React.FC<EllipseProps>;
declare const Ellipse: React.FC<EllipseProps>;
export { Ellipse };

@@ -24,3 +24,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Ellipse = function (props) {
var Ellipse = function (props) {
var nodeRef = React.useRef();

@@ -35,2 +35,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Ellipse = Ellipse;
//# sourceMappingURL=Ellipse.js.map

@@ -185,3 +185,3 @@ import * as React from 'react';

}
export declare const Frame: React.FC<FrameNodeProps>;
export {};
declare const Frame: React.FC<FrameNodeProps>;
export { Frame };

@@ -202,3 +202,3 @@ "use strict";

};
exports.Frame = function (props) {
var Frame = function (props) {
var nodeRef = React.useRef();

@@ -213,2 +213,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Frame = Frame;
//# sourceMappingURL=Frame.js.map

@@ -11,2 +11,3 @@ import * as React from 'react';

}
export declare const Group: React.FC<GroupNodeProps>;
declare const Group: React.FC<GroupNodeProps>;
export { Group };

@@ -23,3 +23,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Group = function (props) {
var Group = function (props) {
var nodeRef = React.useRef();

@@ -33,2 +33,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Group = Group;
//# sourceMappingURL=Group.js.map

@@ -8,2 +8,3 @@ import * as React from 'react';

}
export declare const Image: React.FC<ImageProps>;
declare const Image: React.FC<ImageProps>;
export { Image };

@@ -17,6 +17,7 @@ "use strict";

var __1 = require("../..");
exports.Image = function (props) {
var Image = function (props) {
var style = props.style, source = props.source, resizeMode = props.resizeMode;
return (React.createElement(Rectangle_1.Rectangle, __assign({}, props, { style: [__1.StyleSheet.flatten(style), { backgroundImage: source, backgroundSize: resizeMode }] })));
};
exports.Image = Image;
//# sourceMappingURL=Image.js.map

@@ -11,2 +11,3 @@ import * as React from 'react';

}
export declare const Line: React.FC<LineProps>;
declare const Line: React.FC<LineProps>;
export { Line };

@@ -23,3 +23,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Line = function (props) {
var Line = function (props) {
var nodeRef = React.useRef();

@@ -33,2 +33,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Line = Line;
//# sourceMappingURL=Line.js.map

@@ -13,2 +13,3 @@ import * as React from 'react';

}, callback?: void | ((isCurrent: boolean) => void), _isCurrent?: boolean) => void;
export declare const Page: React.FC<PageProps>;
declare const Page: React.FC<PageProps>;
export { Page };

@@ -43,3 +43,3 @@ "use strict";

};
exports.Page = function (props) {
var Page = function (props) {
var nodeRef = React.useRef();

@@ -52,2 +52,3 @@ var onCurrentChange = props.onCurrentChange, otherProps = __rest(props, ["onCurrentChange"]);

};
exports.Page = Page;
//# sourceMappingURL=Page.js.map

@@ -13,2 +13,3 @@ import * as React from 'react';

}
export declare const Rectangle: React.FC<RectangleProps>;
declare const Rectangle: React.FC<RectangleProps>;
export { Rectangle };

@@ -25,3 +25,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Rectangle = function (props) {
var Rectangle = function (props) {
var nodeRef = React.useRef();

@@ -36,2 +36,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Rectangle = Rectangle;
//# sourceMappingURL=Rectangle.js.map

@@ -12,2 +12,3 @@ import * as React from 'react';

}
export declare const Star: React.FC<StarProps>;
declare const Star: React.FC<StarProps>;
export { Star };

@@ -24,3 +24,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Star = function (props) {
var Star = function (props) {
var nodeRef = React.useRef();

@@ -35,2 +35,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Star = Star;
//# sourceMappingURL=Star.js.map

@@ -12,2 +12,3 @@ import * as React from 'react';

}
export declare const Svg: React.FC<SvgNodeProps>;
declare const Svg: React.FC<SvgNodeProps>;
export { Svg };

@@ -23,3 +23,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Svg = function (props) {
var Svg = function (props) {
var nodeRef = React.useRef();

@@ -33,2 +33,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Svg = Svg;
//# sourceMappingURL=Svg.js.map

@@ -14,2 +14,3 @@ import * as React from 'react';

}
export declare const Text: React.FC<TextProps>;
declare const Text: React.FC<TextProps>;
export { Text };

@@ -28,3 +28,3 @@ "use strict";

};
exports.Text = function (props) {
var Text = function (props) {
var nodeRef = React.useRef();

@@ -43,2 +43,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Text = Text;
//# sourceMappingURL=Text.js.map

@@ -12,2 +12,3 @@ import * as React from 'react';

}
export declare const Vector: React.FC<VectorProps>;
declare const Vector: React.FC<VectorProps>;
export { Vector };

@@ -24,3 +24,3 @@ "use strict";

var useOnLayoutHandler_1 = require("../../hooks/useOnLayoutHandler");
exports.Vector = function (props) {
var Vector = function (props) {
var nodeRef = React.useRef();

@@ -35,2 +35,3 @@ useSelectionChange_1.useSelectionChange(nodeRef, props);

};
exports.Vector = Vector;
//# sourceMappingURL=Vector.js.map

@@ -5,2 +5,3 @@ import * as React from 'react';

export declare type ViewProps = FrameNodeProps | RectangleProps;
export declare const View: React.FC<ViewProps>;
declare const View: React.FC<ViewProps>;
export { View };

@@ -16,3 +16,3 @@ "use strict";

var __1 = require("../..");
exports.View = function (props) {
var View = function (props) {
if (props.children) {

@@ -25,2 +25,3 @@ return (React.createElement(__1.Frame, __assign({}, props, { style: [{ backgroundColor: 'transparent' }, props.style && __1.StyleSheet.flatten(props.style)] })));

};
exports.View = View;
//# sourceMappingURL=View.js.map

@@ -64,3 +64,7 @@ # Contribution Guidelines

1. Check linting/tests
2. Check that project is can be built `npm run build`
2. Check project is can be built `npm run build`
3. Make Pull Request with your changes.
## Publishing new version to NPM
1. Bump version in `package.json` and `src/renderer.tsx`
2. Create new release/new tag on Github named `vx.y.z` where `x.y.z` is new version number
export { render } from './renderer';
export { connectToDevTools } from './helpers/connectToDevTools';
export { Text } from './components/text/Text';

@@ -3,0 +4,0 @@ export { Rectangle } from './components/rectangle/Rectangle';

@@ -5,2 +5,4 @@ "use strict";

exports.render = renderer_1.render;
var connectToDevTools_1 = require("./helpers/connectToDevTools");
exports.connectToDevTools = connectToDevTools_1.connectToDevTools;
var Text_1 = require("./components/text/Text");

@@ -7,0 +9,0 @@ exports.Text = Text_1.Text;

{
"name": "react-figma",
"version": "0.1.5",
"version": "0.1.6",
"description": "Render React components to Figma",

@@ -56,2 +56,3 @@ "scripts": {

"react": "16.8.6",
"react-devtools-core": "^4.7.0",
"react-figma-webpack-config": "0.0.7",

@@ -58,0 +59,0 @@ "react-test-renderer": "16.8.6",

@@ -51,4 +51,3 @@ "use strict";

var nanoid = require("nanoid/non-secure");
// * Development version of react-reconciler can't be used inside Figma realm.
var createReconciler = require("react-reconciler/cjs/react-reconciler.production.min");
var createReconciler = require("react-reconciler");
var useTextChildren_1 = require("./hooks/useTextChildren");

@@ -213,9 +212,10 @@ var rpc_1 = require("./rpc");

commitMount: function (instance, type) { },
commitHydratedContainer: function (container) {
/*container.children.forEach(child => {
updateYogaRoot(child);
});*/
}
commitHydratedContainer: function () { }
};
reconciler = createReconciler(HostConfig);
reconciler.injectIntoDevTools({
bundleType: 1,
version: '0.1.6',
rendererPackageName: 'react-figma'
});
container = reconciler.createContainer(rootNode, true, true);

@@ -222,0 +222,0 @@ reconciler.updateContainer(jsx, container);

@@ -31,2 +31,3 @@ import { Subject } from 'rxjs';

setCurrentPage: (_node: any) => Promise<void>;
highlightNativeElement: (_node: any) => Promise<void>;
}>;

@@ -33,0 +34,0 @@ export declare const setupMainThread: () => void;

@@ -199,2 +199,19 @@ "use strict";

figma.currentPage = node;
},
highlightNativeElement: function (_node) {
var node = transformToNode(_node);
if (!node || node.type === 'DOCUMENT') {
return;
}
if (figma.currentPage.selection.includes(node)) {
return;
}
var nodePage = findRoot(node);
if (figma.currentPage !== nodePage) {
figma.currentPage = nodePage;
}
if (node.type !== 'PAGE') {
figma.viewport.scrollAndZoomIntoView([node]);
figma.currentPage.selection = [node];
}
}

@@ -201,0 +218,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

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

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc