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.0.1-alpha.8 to 0.0.1-alpha.9

62

dist/renderer.js

@@ -56,2 +56,30 @@ "use strict";

};
var remove = function (childNode) {
if (!childNode || childNode.removed) {
return;
}
childNode.remove();
};
var renderInstance = function (type, node, props) {
var instance = renderers[type](node)(props);
if (!node) {
instance.setPluginData('isReactFigmaNode', 'true');
}
return instance;
};
var getFirstChild = function (parentInstance) {
if (parentInstance.children && parentInstance.children.length > 0) {
return parentInstance.children.find(isReactFigmaNode);
}
};
var getNextChildren = function (instance) {
if (!instance || !instance.parent) {
return;
}
var parent = instance.parent;
console.log('getNextHydratableSibling:children', parent.children);
var instanceIndex = parent.children.indexOf(instance);
console.log('getNextHydratableSibling:instanceIndex', instanceIndex);
return parent.children.slice(instanceIndex + 1).find(isReactFigmaNode);
};
exports.render = function (jsx, rootNode) { return __awaiter(_this, void 0, void 0, function () {

@@ -103,10 +131,3 @@ var HostConfig, reconciler, container, lastPage, tempPage;

console.log.apply(console, ['createInstance', type, props].concat(other));
var instance = renderers[type]()(props);
try {
instance.setPluginData('isReactFigmaNode', 'true');
}
catch (e) {
console.log(e);
}
return instance;
return renderInstance(type, null, props);
},

@@ -160,3 +181,3 @@ createTextInstance: function (text) {

commitUpdate: function (node, updatePayload, type, oldProps, newProps) {
renderers[type](node)(newProps);
renderInstance(type, node, newProps);
console.log('commitUpdate', node, updatePayload, type, oldProps, newProps);

@@ -169,3 +190,3 @@ },

console.log('removeChild', parentNode, childNode);
childNode.remove();
remove(childNode);
},

@@ -181,20 +202,11 @@ canHydrateInstance: function (instance, type, props) {

console.log('hydrateInstance', instance, type, props);
return renderers[type](instance.type.toLowerCase() === type ? instance : null)(props);
return renderInstance(type, instance.type.toLowerCase() === type ? instance : null, props);
},
getFirstHydratableChild: function (parentInstance) {
console.log('getFirstHydratableChild', parentInstance);
if (parentInstance.children && parentInstance.children.length > 0) {
return parentInstance.children.find(isReactFigmaNode);
}
return getFirstChild(parentInstance);
},
getNextHydratableSibling: function (instance) {
console.log('getNextHydratableSibling', instance);
if (!instance || !instance.parent) {
return;
}
var parent = instance.parent;
console.log('getNextHydratableSibling:children', parent.children);
var instanceIndex = parent.children.indexOf(instance);
console.log('getNextHydratableSibling:instanceIndex', instanceIndex);
return parent.children.slice(instanceIndex + 1).find(isReactFigmaNode);
return getNextChildren(instance);
},

@@ -222,7 +234,7 @@ didNotHydrateContainerInstance: function () {

},
didNotFindHydratableTextInstance: function (parentType, parentProps, parentInstance, text) {
console.log('didNotFindHydratableTextInstance', parentType, parentProps, parentInstance, text);
},
didNotHydrateInstance: function (parentType, parentProps, parentInstance, instance) {
console.log('didNotHydrateInstance', parentType, parentProps, parentInstance, instance);
if (isReactFigmaNode(instance)) {
instance.remove();
}
},

@@ -229,0 +241,0 @@ commitMount: function (instance, type, newProps, internalInstanceHandle) {

{
"name": "react-figma",
"version": "0.0.1-alpha.8",
"version": "0.0.1-alpha.9",
"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 @@ "main": "./dist/index.js",

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