AI-native design editor. Open-source Figma alternative.
feat: draw ellipse arcs and flip layers in design JSX (#1355)
Danila Poyarkovce36515c27d6
diff --git a/changes/1355/added.md b/changes/1355/added.mdnew file mode 100644index 000000000..09dd5c41a--- /dev/null+++ b/changes/1355/added.md@@ -0,0 +1 @@+- Design JSX draws ellipse arcs and donuts with `startAngle`, `endAngle`, and `innerRadius` on `<Ellipse>`, flips any layer with `flipX` and `flipY`, and exports both, so they survive `get_jsx`.diff --git a/packages/core/tests/design-jsx/arcs-and-flips.test.ts b/packages/core/tests/design-jsx/arcs-and-flips.test.tsnew file mode 100644index 000000000..578685189--- /dev/null+++ b/packages/core/tests/design-jsx/arcs-and-flips.test.ts@@ -0,0 +1,60 @@+import { describe, expect, test } from 'bun:test'++import { getNodeOrThrow } from '#core-tests/helpers/assert'++import { renderJSX } from '@open-pencil/core/design-jsx'+import { sceneNodeToJSX } from '@open-pencil/design-jsx'+import { SceneGraph } from '@open-pencil/scene-graph'++async function render(jsx: string) {+ const graph = new SceneGraph()+ const [node] = await renderJSX(graph, jsx)+ return { graph, node: getNodeOrThrow(graph, node.id) }+}++describe('ellipse arcs', () => {+ test('take their angles in degrees, clockwise from three o’clock, and their hole as a share', async () => {+ const { node } = await render(+ '<Ellipse w={100} h={100} startAngle={90} endAngle={360} innerRadius={0.5} />'+ )+ expect(node.arcData).toEqual({+ startingAngle: Math.PI / 2,+ endingAngle: Math.PI * 2,+ innerRadius: 0.5+ })+ })++ test('end a whole turn from their start unless told otherwise', async () => {+ const { node } = await render('<Ellipse w={100} h={100} innerRadius={0.25} />')+ expect(node.arcData).toEqual({ startingAngle: 0, endingAngle: Math.PI * 2, innerRadius: 0.25 })+ })++ test("are a hole on an ellipse but a star's depth on a star", async () => {+ const { node: ellipse } = await render('<Ellipse w={100} h={100} innerRadius={0.5} />')+ const { node: star } = await render('<Star w={100} h={100} innerRadius={0.5} />')+ expect(ellipse.starInnerRadius).not.toBe(0.5)+ expect(star.starInnerRadius).toBe(0.5)+ expect(star.arcData).toBeNull()+ })++ test('export only what differs from a whole ellipse', async () => {+ const { graph, node: whole } = await render('<Ellipse w={100} h={100} />')+ expect(sceneNodeToJSX(whole.id, graph)).not.toMatch(/Angle|innerRadius/)+ const { graph: arcGraph, node: arc } = await render(+ '<Ellipse w={100} h={100} startAngle={45} endAngle={225} />'+ )+ const jsx = sceneNodeToJSX(arc.id, arcGraph)+ expect(jsx).toContain('startAngle={45}')+ expect(jsx).toContain('endAngle={225}')+ expect(jsx).not.toContain('innerRadius')+ })+})++describe('flips', () => {+ test('reflect any layer, set as bare attributes or booleans', async () => {+ const { node } = await render('<Rectangle w={40} h={20} flipX rotate={30} />')+ expect(node).toMatchObject({ flipX: true, flipY: false, rotation: 30 })+ const { node: unflipped } = await render('<Rectangle w={40} h={20} flipY={false} />')+ expect(unflipped.flipY).toBe(false)+ })+})diff --git a/packages/core/tests/helpers/property-cases.ts b/packages/core/tests/helpers/property-cases.tsindex 7bca46f2b..0e364f117 100644--- a/packages/core/tests/helpers/property-cases.ts+++ b/packages/core/tests/helpers/property-cases.ts@@ -243,6 +243,13 @@ export const PROPERTY_CASES: RoundTripCase[] = [leafCase('mask', 'RECTANGLE', { isMask: true, maskType: 'LUMINANCE' }),leafCase('clipping', 'FRAME', { clipsContent: true }),leafCase('star geometry', 'STAR', { pointCount: 7, starInnerRadius: 0.5 }),+ leafCase('ellipse arc with a hole', 'ELLIPSE', {+ arcData: { startingAngle: Math.PI / 2, endingAngle: Math.PI * 2, innerRadius: 0.5 }+ }),+ leafCase('ellipse arc from the default start', 'ELLIPSE', {+ arcData: { startingAngle: 0, endingAngle: Math.PI, innerRadius: 0 }+ }),+ leafCase('flipped and turned layer', 'RECTANGLE', { flipX: true, flipY: true, rotation: 30 }),leafCase('text style', 'TEXT', {text: 'Hello',fontSize: 20,diff --git a/packages/design-jsx/src/components.ts b/packages/design-jsx/src/components.tsindex 3da2d6746..13fd925d9 100644--- a/packages/design-jsx/src/components.ts+++ b/packages/design-jsx/src/components.ts@@ -1,6 +1,7 @@import {node,type BaseProps,+ type EllipseProps,type ComponentProps,type InstanceProps,type ParagraphProps,@@ -38,7 +39,7 @@ export function Rectangle(props: BaseProps, ...children: Child[]): TreeNode {return withChildren('rectangle', props, children)}-export function Ellipse(props: BaseProps, ...children: Child[]): TreeNode {+export function Ellipse(props: BaseProps & EllipseProps, ...children: Child[]): TreeNode {return withChildren('ellipse', props, children)}diff --git a/packages/design-jsx/src/export/props.ts b/packages/design-jsx/src/export/props.tsindex d63a5ec1a..149e4253b 100644--- a/packages/design-jsx/src/export/props.ts+++ b/packages/design-jsx/src/export/props.ts@@ -3,6 +3,7 @@ import { isEqual, omitBy, pick } from 'es-toolkit'import {createDefaultNode,layoutSizing,+ type ArcData,type SceneGraph,type SceneNode} from '@open-pencil/scene-graph'@@ -124,6 +125,8 @@ function collectAppearanceProps(node: SceneNode, props: JSXProp[]): void {if (node.cornerSmoothing > 0) props.push(['cornerSmoothing', node.cornerSmoothing])if (node.opacity < 1) props.push(['opacity', Math.round(node.opacity * 100) / 100])if (node.rotation !== 0) props.push(['rotate', Math.round(node.rotation * 100) / 100])+ if (node.flipX) props.push(['flipX', true])+ if (node.flipY) props.push(['flipY', true])if (node.blendMode !== 'PASS_THROUGH' && node.blendMode !== 'NORMAL') {props.push(['blendMode', BLEND_MODE.print(node.blendMode)])}@@ -292,7 +295,21 @@ function collectTextAutoResizeProp(}}+const roundDegrees = (radians: number) => Math.round(((radians * 180) / Math.PI) * 10_000) / 10_000++/** An ellipse's arc, written only where it is not a whole ellipse. */+function collectArcProps(arc: ArcData | null, props: JSXProp[]): void {+ if (!arc) return+ const start = roundDegrees(arc.startingAngle)+ const end = roundDegrees(arc.endingAngle)+ if (start !== 0) props.push(['startAngle', start])+ // A whole turn from the start is the default end.+ if (Math.abs(end - (start + 360)) > 1e-6) props.push(['endAngle', end])+ if (arc.innerRadius !== 0) props.push(['innerRadius', arc.innerRadius])+}+function collectShapeNodeProps(node: SceneNode, props: JSXProp[]): void {+ if (node.type === 'ELLIPSE') collectArcProps(node.arcData, props)if (node.type === 'STAR') {if (node.pointCount !== 5) props.push(['points', node.pointCount])if (node.starInnerRadius !== 0.382) props.push(['innerRadius', node.starInnerRadius])diff --git a/packages/design-jsx/src/index.ts b/packages/design-jsx/src/index.tsindex 00c0e0b37..5204e455e 100644--- a/packages/design-jsx/src/index.ts+++ b/packages/design-jsx/src/index.ts@@ -41,6 +41,7 @@ export {export {type TreeNode,type BaseProps,+ type EllipseProps,type ComponentProps,type InstanceProps,type TextProps,diff --git a/packages/design-jsx/src/jsx-runtime.ts b/packages/design-jsx/src/jsx-runtime.tsindex b516ac6f8..e95f476c8 100644--- a/packages/design-jsx/src/jsx-runtime.ts+++ b/packages/design-jsx/src/jsx-runtime.ts@@ -2,6 +2,7 @@ import {FRAGMENT,node,type BaseProps,+ type EllipseProps,type ParagraphProps,type SpanProps,type TreeNode,@@ -32,7 +33,7 @@ export namespace JSX {'text-span': SpanProps'text-paragraph': ParagraphPropsrectangle: BaseProps- ellipse: BaseProps+ ellipse: BaseProps & EllipsePropsline: BasePropsstar: BaseProps & { points?: number; innerRadius?: number }polygon: BaseProps & { pointCount?: number }diff --git a/packages/design-jsx/src/props-overrides.ts b/packages/design-jsx/src/props-overrides.tsindex b8e7d1ffb..2c601824d 100644--- a/packages/design-jsx/src/props-overrides.ts+++ b/packages/design-jsx/src/props-overrides.ts@@ -5,7 +5,9 @@ import {parseCounterAxisAlign,parsePrimaryAxisAlign,withShaderPaints,+ type ArcData,type Fill,+ type NodeType,type SceneNode,type ShaderPaint} from '@open-pencil/scene-graph'@@ -160,6 +162,8 @@ function applyVisualOverrides(props: Record<string, unknown>, o: Partial<SceneNofunction applyTransformOverrides(props: Record<string, unknown>, o: Partial<SceneNode>): void {const rotation = designJSXProp(props, 'rotate')if (rotation !== undefined) o.rotation = rotation as number+ if (props.flipX !== undefined) o.flipX = props.flipX === true+ if (props.flipY !== undefined) o.flipY = props.flipY === true}function applyPaddingOverrides(props: Record<string, unknown>, o: Partial<SceneNode>): void {@@ -413,10 +417,48 @@ function applyTextOverrides(applyTextAutoResize(props, o, parentLayout)}-function applyShapeOverrides(props: Record<string, unknown>, o: Partial<SceneNode>): void {- if (props.points !== undefined) o.pointCount = props.points as number- if (props.innerRadius !== undefined) o.starInnerRadius = props.innerRadius as number- if (props.pointCount !== undefined) o.pointCount = props.pointCount as number+const FULL_TURN_DEGREES = 360++function numberProp(value: unknown): number | undefined {+ return typeof value === 'number' ? value : undefined+}++/**+ * An `<Ellipse>`'s arc from its props: angles in degrees, clockwise from three o'clock, as the+ * canvas draws arcs, and the hole as a share of the ellipse. Null when none is set.+ */+function arcOverride(props: Record<string, unknown>): ArcData | null {+ const start = numberProp(props.startAngle)+ const end = numberProp(props.endAngle)+ const innerRadius = numberProp(props.innerRadius)+ if (start === undefined && end === undefined && innerRadius === undefined) return null+ const startDegrees = start ?? 0+ return {+ startingAngle: (startDegrees * Math.PI) / 180,+ endingAngle: ((end ?? startDegrees + FULL_TURN_DEGREES) * Math.PI) / 180,+ innerRadius: innerRadius ?? 0+ }+}++/** The fields a shape element's own props set, by the layer it makes. */+export function shapeOverrides(+ nodeType: NodeType,+ props: Record<string, unknown>+): Partial<SceneNode> {+ const o: Partial<SceneNode> = {}+ if (nodeType === 'STAR' || nodeType === 'POLYGON') {+ const points = numberProp(props.pointCount) ?? numberProp(props.points)+ if (points !== undefined) o.pointCount = points+ }+ if (nodeType === 'STAR') {+ const innerRadius = numberProp(props.innerRadius)+ if (innerRadius !== undefined) o.starInnerRadius = innerRadius+ }+ if (nodeType === 'ELLIPSE') {+ const arc = arcOverride(props)+ if (arc) o.arcData = arc+ }+ return o}export function propsToOverrides(@@ -433,7 +475,6 @@ export function propsToOverrides(applyVisualOverrides(props, o)applyLayoutOverrides(props, o, w, h, isText, parentLayout)if (isText) applyTextOverrides(props, o, parentLayout)- applyShapeOverrides(props, o)applyEffectOverrides(props, o)applyStateOverrides(props, o)diff --git a/packages/design-jsx/src/reference/authoring.md b/packages/design-jsx/src/reference/authoring.mdindex d8a382143..3ed74323b 100644--- a/packages/design-jsx/src/reference/authoring.md+++ b/packages/design-jsx/src/reference/authoring.md@@ -21,6 +21,7 @@ This reference describes scene creation, not React DOM output. Use the `render`- `shader(effects, { opacity, visible, blendMode })` fills a layer with a shader from the [`shaders`](https://shaders.com) library: an array of effects such as `bg={shader([{ type: 'Aurora', props: { speed: 2 } }])}`, or a preset as shaders.com exports it, `{ components: [...] }`. The canvas shows the shader's first frame, preview plays it, and files and other formats keep that frame as an image.- `stroke` describes one stroke, refined by `strokeWidth`, `strokeAlign` (`"inside"`, `"center"`, `"outside"`), `strokeDash`, `strokeCap`, and `strokeJoin`. `strokes` takes several, as objects with `color`, `weight`, `align`, `dash`, `cap`, `join`, and `visible`; `strokeWeights={{ top, right, bottom, left }}` sets per-side widths. `dashPattern` sets the node's own dash pattern, separate from the per-stroke `strokeDash`.- `rounded` and `roundedTL`/`roundedTR`/`roundedBL`/`roundedBR` control corners. `strokeWidth`, `opacity`, `rotate`, and `blendMode` control appearance. `overflow="hidden"` clips content; do not hide accidental text overflow to make a broken layout appear correct.+- `rotate` turns a layer by degrees, and `flipX` and `flipY` reflect it across its centre before it turns, as the canvas places it. `Star` takes `points` and `innerRadius` (0–1, how deep its points go); `Polygon` takes `points`. `Ellipse` draws an arc or a donut with `startAngle` and `endAngle` in degrees, clockwise from three o'clock (0 to 360 by default), and `innerRadius` (0–1, the hole): `<Ellipse w={80} h={80} startAngle={0} endAngle={270} innerRadius={0.6} />`.- `effects` accepts structured effects such as `dropShadow`, `innerShadow`, and `layerBlur`. `shadow` takes a CSS `box-shadow` list, such as `shadow="0 4 8 #0002, inset 0 1 0 #fff"`, and `blur` a layer blur radius; both are convenient shorthands. Effect helpers take `radius`, as Figma's effects do; when a JSX string is rendered, an option a paint or effect helper does not support is reported as a warning.- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, and `textCase`. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.diff --git a/packages/design-jsx/src/renderer.ts b/packages/design-jsx/src/renderer.tsindex 5f19796f5..c51dbda88 100644--- a/packages/design-jsx/src/renderer.ts+++ b/packages/design-jsx/src/renderer.ts@@ -20,7 +20,7 @@ import {} from './component-properties'import { CONNECTOR_ELEMENT, resolveConnectorEnds } from './connectors'import { elementNodeType, elementOwnLayer, type OwnLayerRenderer } from './elements'-import { applySizeOverrides, propsToOverrides } from './props-overrides'+import { applySizeOverrides, propsToOverrides, shapeOverrides } from './props-overrides'import { LayerRefs } from './refs'import { prepareScalarBindings } from './scalar-bindings'import type { DesignJSXServices } from './services'@@ -484,6 +484,7 @@ export function elementOverrides(const { props, bindings } = preparePropsForRender(graph, tree.props, isText, parentId)const overrides = {...propsToOverrides(props, isText, parentLayout),+ ...shapeOverrides(nodeType, props),...componentMetadata(props, nodeType, componentPropertyScope(graph, parentId))}diff --git a/packages/design-jsx/src/schema.ts b/packages/design-jsx/src/schema.tsindex f1025c278..71ecb57e3 100644--- a/packages/design-jsx/src/schema.ts+++ b/packages/design-jsx/src/schema.ts@@ -116,6 +116,8 @@ export const DESIGN_JSX_SUPPORTED_PROPERTY_NAMES = ['blendMode','rotate','rotation',+ 'flipX',+ 'flipY','overflow','mask','visible',@@ -173,6 +175,8 @@ export const DESIGN_JSX_SUPPORTED_PROPERTY_NAMES = ['points','pointCount','innerRadius',+ 'startAngle',+ 'endAngle','label','style','bind',diff --git a/packages/design-jsx/src/tree.ts b/packages/design-jsx/src/tree.tsindex 81666be18..fa4bd0aec 100644--- a/packages/design-jsx/src/tree.ts+++ b/packages/design-jsx/src/tree.ts@@ -159,6 +159,10 @@ export type StyleProps = {mask?: boolean | 'alpha' | 'luminance' | 'vector'rotate?: numberrotation?: number+ /** Reflects the layer across its vertical centre line, before it turns. */+ flipX?: boolean+ /** Reflects the layer across its horizontal centre line, before it turns. */+ flipY?: booleanoverflow?: 'hidden' | 'visible'shadow?: stringblur?: number@@ -193,6 +197,14 @@ type NodeProps = StyleProps & {}export type BaseProps = NodeProps & { properties?: never }++/** An `<Ellipse>`'s arc: angles in degrees, clockwise from three o'clock, and its hole. */+export type EllipseProps = {+ startAngle?: number+ endAngle?: number+ /** The hole as a share of the ellipse, from 0 (none) to 1. */+ innerRadius?: number+}export type TextProps = BaseProps/** A `<Span>`'s props: the character styles of `<Text>`, under the same names. */diff --git a/packages/docs/reference/design-authoring.md b/packages/docs/reference/design-authoring.mdindex 660625276..6ec6bce4b 100644--- a/packages/docs/reference/design-authoring.md+++ b/packages/docs/reference/design-authoring.md@@ -23,6 +23,7 @@ This reference describes scene creation, not React DOM output. Use the `render`- `shader(effects, { opacity, visible, blendMode })` fills a layer with a shader from the [`shaders`](https://shaders.com) library: an array of effects such as `bg={shader([{ type: 'Aurora', props: { speed: 2 } }])}`, or a preset as shaders.com exports it, `{ components: [...] }`. The canvas shows the shader's first frame, preview plays it, and files and other formats keep that frame as an image.- `stroke` describes one stroke, refined by `strokeWidth`, `strokeAlign` (`"inside"`, `"center"`, `"outside"`), `strokeDash`, `strokeCap`, and `strokeJoin`. `strokes` takes several, as objects with `color`, `weight`, `align`, `dash`, `cap`, `join`, and `visible`; `strokeWeights={{ top, right, bottom, left }}` sets per-side widths. `dashPattern` sets the node's own dash pattern, separate from the per-stroke `strokeDash`.- `rounded` and `roundedTL`/`roundedTR`/`roundedBL`/`roundedBR` control corners. `strokeWidth`, `opacity`, `rotate`, and `blendMode` control appearance. `overflow="hidden"` clips content; do not hide accidental text overflow to make a broken layout appear correct.+- `rotate` turns a layer by degrees, and `flipX` and `flipY` reflect it across its centre before it turns, as the canvas places it. `Star` takes `points` and `innerRadius` (0–1, how deep its points go); `Polygon` takes `points`. `Ellipse` draws an arc or a donut with `startAngle` and `endAngle` in degrees, clockwise from three o'clock (0 to 360 by default), and `innerRadius` (0–1, the hole): `<Ellipse w={80} h={80} startAngle={0} endAngle={270} innerRadius={0.6} />`.- `effects` accepts structured effects such as `dropShadow`, `innerShadow`, and `layerBlur`. `shadow` takes a CSS `box-shadow` list, such as `shadow="0 4 8 #0002, inset 0 1 0 #fff"`, and `blur` a layer blur radius; both are convenient shorthands. Effect helpers take `radius`, as Figma's effects do; when a JSX string is rendered, an option a paint or effect helper does not support is reported as a warning.- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, and `textCase`. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.@@ -109,4 +110,4 @@ Generated from the renderer metadata. This inventory lists accepted names, not a**Helpers:** `solid`, `gradient`, `linearGradient`, `radialGradient`, `angularGradient`, `diamondGradient`, `shader`, `dropShadow`, `innerShadow`, `layerBlur`, `backgroundBlur`, `foregroundBlur`, `designVar`, `defineVars`, `ref`.-**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `propertyRefs`, `of`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.\ No newline at end of file+**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `flipX`, `flipY`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `startAngle`, `endAngle`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `propertyRefs`, `of`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.\ No newline at end of filediff --git a/skills/open-pencil/references/design-authoring.md b/skills/open-pencil/references/design-authoring.mdindex 660625276..6ec6bce4b 100644--- a/skills/open-pencil/references/design-authoring.md+++ b/skills/open-pencil/references/design-authoring.md@@ -23,6 +23,7 @@ This reference describes scene creation, not React DOM output. Use the `render`- `shader(effects, { opacity, visible, blendMode })` fills a layer with a shader from the [`shaders`](https://shaders.com) library: an array of effects such as `bg={shader([{ type: 'Aurora', props: { speed: 2 } }])}`, or a preset as shaders.com exports it, `{ components: [...] }`. The canvas shows the shader's first frame, preview plays it, and files and other formats keep that frame as an image.- `stroke` describes one stroke, refined by `strokeWidth`, `strokeAlign` (`"inside"`, `"center"`, `"outside"`), `strokeDash`, `strokeCap`, and `strokeJoin`. `strokes` takes several, as objects with `color`, `weight`, `align`, `dash`, `cap`, `join`, and `visible`; `strokeWeights={{ top, right, bottom, left }}` sets per-side widths. `dashPattern` sets the node's own dash pattern, separate from the per-stroke `strokeDash`.- `rounded` and `roundedTL`/`roundedTR`/`roundedBL`/`roundedBR` control corners. `strokeWidth`, `opacity`, `rotate`, and `blendMode` control appearance. `overflow="hidden"` clips content; do not hide accidental text overflow to make a broken layout appear correct.+- `rotate` turns a layer by degrees, and `flipX` and `flipY` reflect it across its centre before it turns, as the canvas places it. `Star` takes `points` and `innerRadius` (0–1, how deep its points go); `Polygon` takes `points`. `Ellipse` draws an arc or a donut with `startAngle` and `endAngle` in degrees, clockwise from three o'clock (0 to 360 by default), and `innerRadius` (0–1, the hole): `<Ellipse w={80} h={80} startAngle={0} endAngle={270} innerRadius={0.6} />`.- `effects` accepts structured effects such as `dropShadow`, `innerShadow`, and `layerBlur`. `shadow` takes a CSS `box-shadow` list, such as `shadow="0 4 8 #0002, inset 0 1 0 #fff"`, and `blur` a layer blur radius; both are convenient shorthands. Effect helpers take `radius`, as Figma's effects do; when a JSX string is rendered, an option a paint or effect helper does not support is reported as a warning.- Text content belongs inside `Text`. Use `size`, `font`, `weight`, `italic`, `lineHeight`, `letterSpacing`, `textAlign`, `textAlignVertical`, `textDecoration`, and `textCase`. Decorations take CSS's names and values: `textDecorationStyle` (`solid`, `dotted`, `wavy`), `textDecorationColor` (`currentColor` follows the text), `textDecorationThickness` and `textUnderlineOffset` (pixels or `auto`), and `textDecorationSkipInk`. `lineHeight="auto"` follows the font, and `fills={[]}` paints no text. Verify fonts actually load before judging dimensions; do not assume every font is available.- `Span` styles some characters of a `Text` with `Text`'s own prop names: `size`, `font`, `weight`, `italic`, `color`, `fills`, `lineHeight`, `letterSpacing`, `textDecoration`, the decoration details, and `textCase`. `href` links its characters to a URL without changing how they look. Spans nest; the inner one wins. `Paragraph` writes one paragraph: `list="ordered"` or `list="unordered"` makes it a list item nested at `level` 1–5, and `spacing`, `listSpacing`, and `indent` override the `Text`'s `paragraphSpacing`, `listSpacing`, and `paragraphIndent` for it; `hangingList` on the `Text` hangs list markers outside the text box. A `Text` holds only `Paragraph`s or none; without them, a line break in its text still starts a paragraph.@@ -109,4 +110,4 @@ Generated from the renderer metadata. This inventory lists accepted names, not a**Helpers:** `solid`, `gradient`, `linearGradient`, `radialGradient`, `angularGradient`, `diamondGradient`, `shader`, `dropShadow`, `innerShadow`, `layerBlur`, `backgroundBlur`, `foregroundBlur`, `designVar`, `defineVars`, `ref`.-**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `propertyRefs`, `of`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.\ No newline at end of file+**Properties:** `name`, `key`, `ref`, `flex`, `flow`, `dir`, `gap`, `wrap`, `rowGap`, `columnGap`, `justify`, `justifyContent`, `items`, `align`, `alignItems`, `grow`, `w`, `h`, `width`, `height`, `minW`, `maxW`, `minH`, `maxH`, `x`, `y`, `top`, `left`, `position`, `constraints`, `p`, `padding`, `px`, `py`, `pt`, `pr`, `pb`, `pl`, `bg`, `fill`, `fills`, `background`, `backgroundColor`, `stroke`, `border`, `borderColor`, `strokeWidth`, `borderWidth`, `strokeAlign`, `strokeDash`, `strokeCap`, `strokeJoin`, `dashPattern`, `strokes`, `strokeWeights`, `rounded`, `borderRadius`, `roundedTL`, `roundedTR`, `roundedBL`, `roundedBR`, `cornerRadius`, `cornerSmoothing`, `opacity`, `blendMode`, `rotate`, `rotation`, `flipX`, `flipY`, `overflow`, `mask`, `visible`, `locked`, `shadow`, `blur`, `effects`, `size`, `fontSize`, `font`, `fontFamily`, `weight`, `fontWeight`, `italic`, `color`, `text`, `characters`, `content`, `value`, `title`, `textAlign`, `textAlignHorizontal`, `textHorizontalAlignment`, `textAlignVertical`, `textVerticalAlignment`, `textAutoResize`, `lineHeight`, `letterSpacing`, `textDecoration`, `textDecorationStyle`, `textDecorationColor`, `textDecorationThickness`, `textUnderlineOffset`, `textDecorationSkipInk`, `textCase`, `paragraphSpacing`, `paragraphIndent`, `hangingList`, `list`, `level`, `spacing`, `listSpacing`, `indent`, `maxLines`, `truncate`, `grid`, `columns`, `rows`, `colStart`, `rowStart`, `col`, `row`, `colSpan`, `rowSpan`, `points`, `pointCount`, `innerRadius`, `startAngle`, `endAngle`, `label`, `style`, `bind`, `component`, `componentId`, `properties`, `propertyRefs`, `of`, `modelValue`, `open`, `disabled`, `filled`, `states`, `min`, `max`, `step`, `defaultValue`.\ No newline at end of file