@teleporthq/teleport-plugin-react-base-component
Advanced tools
Comparing version 0.33.2 to 0.33.3
@@ -71,4 +71,4 @@ "use strict"; | ||
var reactComponentPlugin = function (structure) { return __awaiter(void 0, void 0, void 0, function () { | ||
var uidl, dependencies, _a, stateDefinitions, _b, propDefinitions, nodesLookup, windowImports, jsxParams, jsxOptions, jsxTagStructure, componentName, pureComponent, routerAST, componentBody; | ||
return __generator(this, function (_c) { | ||
var uidl, dependencies, _a, stateDefinitions, _b, propDefinitions, nodesLookup, windowImports, jsxParams, jsxOptions, _i, _c, propKey, prop, jsxTagStructure, componentName, pureComponent, routerAST, componentBody; | ||
return __generator(this, function (_d) { | ||
uidl = structure.uidl, dependencies = structure.dependencies; | ||
@@ -100,2 +100,13 @@ _a = uidl.stateDefinitions, stateDefinitions = _a === void 0 ? {} : _a, _b = uidl.propDefinitions, propDefinitions = _b === void 0 ? {} : _b; | ||
}; | ||
/* | ||
We need to generate jsx structure of every node that is defined in the UIDL. | ||
If we use these nodes in the later stage of the code-generation depends on the usage of these nodes. | ||
*/ | ||
for (_i = 0, _c = Object.keys(propDefinitions); _i < _c.length; _i++) { | ||
propKey = _c[_i]; | ||
prop = propDefinitions[propKey]; | ||
if (prop.type === 'element' && typeof prop.defaultValue === 'object') { | ||
(0, teleport_plugin_common_1.createJSXSyntax)(prop.defaultValue, jsxParams, jsxOptions); | ||
} | ||
} | ||
jsxTagStructure = (0, teleport_plugin_common_1.createJSXSyntax)(uidl.node, jsxParams, jsxOptions); | ||
@@ -102,0 +113,0 @@ componentName = teleport_shared_1.UIDLUtils.getComponentClassName(uidl); |
@@ -45,4 +45,4 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
var reactComponentPlugin = function (structure) { return __awaiter(void 0, void 0, void 0, function () { | ||
var uidl, dependencies, _a, stateDefinitions, _b, propDefinitions, nodesLookup, windowImports, jsxParams, jsxOptions, jsxTagStructure, componentName, pureComponent, routerAST, componentBody; | ||
return __generator(this, function (_c) { | ||
var uidl, dependencies, _a, stateDefinitions, _b, propDefinitions, nodesLookup, windowImports, jsxParams, jsxOptions, _i, _c, propKey, prop, jsxTagStructure, componentName, pureComponent, routerAST, componentBody; | ||
return __generator(this, function (_d) { | ||
uidl = structure.uidl, dependencies = structure.dependencies; | ||
@@ -74,2 +74,13 @@ _a = uidl.stateDefinitions, stateDefinitions = _a === void 0 ? {} : _a, _b = uidl.propDefinitions, propDefinitions = _b === void 0 ? {} : _b; | ||
}; | ||
/* | ||
We need to generate jsx structure of every node that is defined in the UIDL. | ||
If we use these nodes in the later stage of the code-generation depends on the usage of these nodes. | ||
*/ | ||
for (_i = 0, _c = Object.keys(propDefinitions); _i < _c.length; _i++) { | ||
propKey = _c[_i]; | ||
prop = propDefinitions[propKey]; | ||
if (prop.type === 'element' && typeof prop.defaultValue === 'object') { | ||
createJSXSyntax(prop.defaultValue, jsxParams, jsxOptions); | ||
} | ||
} | ||
jsxTagStructure = createJSXSyntax(uidl.node, jsxParams, jsxOptions); | ||
@@ -76,0 +87,0 @@ componentName = UIDLUtils.getComponentClassName(uidl); |
{ | ||
"name": "@teleporthq/teleport-plugin-react-base-component", | ||
"version": "0.33.2", | ||
"version": "0.33.3", | ||
"description": "A plugin for handling the skeleton/baseline of a React component", | ||
@@ -28,7 +28,7 @@ "author": "teleportHQ", | ||
"@babel/types": "^7.5.5", | ||
"@teleporthq/teleport-plugin-common": "^0.33.2", | ||
"@teleporthq/teleport-plugin-common": "^0.33.3", | ||
"@teleporthq/teleport-shared": "^0.33.0", | ||
"@teleporthq/teleport-types": "^0.33.0" | ||
}, | ||
"gitHead": "9f1064de15087e42684312060ee9b9a8cff63275" | ||
"gitHead": "54218e148225ecc586de1c5a9da7e09a54531dd0" | ||
} |
@@ -14,2 +14,3 @@ import { Constants, UIDLUtils } from '@teleporthq/teleport-shared' | ||
FileType, | ||
UIDLElementNode, | ||
} from '@teleporthq/teleport-types' | ||
@@ -73,2 +74,13 @@ import * as types from '@babel/types' | ||
/* | ||
We need to generate jsx structure of every node that is defined in the UIDL. | ||
If we use these nodes in the later stage of the code-generation depends on the usage of these nodes. | ||
*/ | ||
for (const propKey of Object.keys(propDefinitions)) { | ||
const prop = propDefinitions[propKey] | ||
if (prop.type === 'element' && typeof prop.defaultValue === 'object') { | ||
createJSXSyntax(prop.defaultValue as UIDLElementNode, jsxParams, jsxOptions) | ||
} | ||
} | ||
const jsxTagStructure = createJSXSyntax(uidl.node, jsxParams, jsxOptions) | ||
@@ -75,0 +87,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
91095
555