🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@builder.io/mitosis

Package Overview
Dependencies
Maintainers
21
Versions
375
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builder.io/mitosis - npm Package Compare versions

Comparing version

to
0.9.2

21

dist/src/generators/react/generator.js

@@ -152,2 +152,3 @@ "use strict";

stylesType: 'styled-jsx',
styleTagsPlacement: 'bottom',
type: 'dom',

@@ -240,2 +241,13 @@ plugins: [

};
const generateStyleTags = (placement, json, options, componentHasStyles, css, shouldInjectCustomStyles) => {
if (placement !== options.styleTagsPlacement)
return '';
return (0, dedent_1.dedent) `
${componentHasStyles && options.stylesType === 'styled-jsx'
? `<style jsx>{\`${css}\`}</style>`
: ''}
${componentHasStyles && options.stylesType === 'style-tag' ? `<style>{\`${css}\`}</style>` : ''}
${shouldInjectCustomStyles ? `<style>{\`${json.style}\`}</style>` : ''}
`;
};
const _componentToReact = (json, options, isSubComponent = false) => {

@@ -343,10 +355,5 @@ var _a, _b, _c, _d, _e, _f;

${wrap ? (0, helpers_2.openFrag)(options) : ''}
${generateStyleTags('top', json, options, componentHasStyles, css, shouldInjectCustomStyles)}
${json.children.map((item) => (0, blocks_1.blockToReact)(item, options, json, wrap, [])).join('\n')}
${componentHasStyles && options.stylesType === 'styled-jsx'
? `<style jsx>{\`${css}\`}</style>`
: ''}
${componentHasStyles && options.stylesType === 'style-tag'
? `<style>{\`${css}\`}</style>`
: ''}
${shouldInjectCustomStyles ? `<style>{\`${json.style}\`}</style>` : ''}
${generateStyleTags('bottom', json, options, componentHasStyles, css, shouldInjectCustomStyles)}
${wrap ? (0, helpers_2.closeFrag)(options) : ''}

@@ -353,0 +360,0 @@ );

import { BaseTranspilerOptions } from '../../types/transpiler';
export interface ToReactOptions extends BaseTranspilerOptions {
stylesType: 'emotion' | 'styled-components' | 'styled-jsx' | 'react-native' | 'style-tag' | 'twrnc' | 'native-wind';
styleTagsPlacement?: 'top' | 'bottom';
stateType: 'useState' | 'mobx' | 'valtio' | 'solid' | 'builder' | 'variables';

@@ -5,0 +6,0 @@ format?: 'lite' | 'safe';

@@ -25,3 +25,3 @@ {

},
"version": "0.9.1",
"version": "0.9.2",
"homepage": "https://github.com/BuilderIO/mitosis",

@@ -28,0 +28,0 @@ "main": "./dist/src/index.js",