openpencil/packages/dom-css/tests/export/tailwind-jsx/helpers.ts
Danila Poyarkov 00361313d1
refactor(dom-css): group sources into import, export, and runtime (#789)
* refactor(dom-css): group sources into import, export, and runtime

dom-css kept both conversion directions in one flat folder: HTML and CSS
import next to SceneGraph export, a JSX runtime next to the Tailwind JSX
printer, and CSS parsing and formatting in one file.

Sources now live in `import/`, `export/`, and `runtime/`, with the CSS
value helpers split by direction and `export/index.ts` as the `./export`
entry. Tests mirror the new folders. Public entry points are unchanged.

* docs(dom-css): add a package guide for the import, export, and runtime layout

dom-css had no AGENTS.md. The guide records the source layout, the
scene-graph-only dependency, the browser-safe `./export` entry, printed
code generation, and Base64 validation for imported documents, and the
root map links to it.
2026-09-30 09:44:52 +04:00

18 lines
444 B
TypeScript

import { sceneNodesToTailwindJSX } from '#dom-css/index'
import { SceneGraph } from '@open-pencil/scene-graph'
export function makeGraph() {
const graph = new SceneGraph()
graph.createNode('CANVAS', graph.rootId, { name: 'Page 1' })
return graph
}
export function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
}
export function tw(graph: SceneGraph, nodeId: string) {
return sceneNodesToTailwindJSX(graph, [nodeId])
}