Utilities to work with JSX, including converting it to Webstudio format.
Install the package
pnpm i @webstudio-is/jsx-utils
Transform a JSX string to Webstudio Embed Template:
import { jsxToWSEmbedTemplate } from "@webstudio-is/jsx-utils";
await jsxToWSEmbedTemplate("<Box>hello</Box>");
Other utils:
traverseTemplate
andtraverseTemplateAsync
to traverse a WsEmbedTemplate and work with nodestailwindToWebstudio
converts a templateclassName
prop to Webstudio local stylesheroiconsToSvgEmbed
converts<HeroIcon name="iconName" type="solid">
toHtmlEmbed
with inline SVG