mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-06 20:13:35 +09:00
Here improved our checks. No longet rely on "checks" script but run "test" and "typescript" scripts from each package in monorepo. Would also make each package less boilerplaty.
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