mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-06 20:13:35 +09:00
Node 20 brings a few cool features - stable test runner - recursive readdir - global crypto.randomUUID()
JSX Utils
Utilities to work with JSX, including converting it to Webstudio format.
Usage
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:
traverseTemplateandtraverseTemplateAsyncto traverse a WsEmbedTemplate and work with nodestailwindToWebstudioconverts a templateclassNameprop to Webstudio local stylesheroiconsToSvgEmbedconverts<HeroIcon name="iconName" type="solid">toHtmlEmbedwith inline SVG