mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-06 20:13:35 +09:00
Fixes: - Disable Radix components via feat flag - classNames should be optional when generating templates - Prevent unwrapped JSX to fail - Use shared computeSelectorForInstanceId when inserting templates and deleting instances - Add extra instruction for GPT to fill required values just in case
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