Skip to content

AI-native design editor. Open-source Figma alternative.

feat: write and read sticky notes as design JSX (#1238)

Danila Poyarkovfa5d880ef00b
diff --git a/changes/1238/added.md b/changes/1238/added.md
new file mode 100644
index 000000000..835444267
--- /dev/null
+++ b/changes/1238/added.md
@@ -0,0 +1 @@
+- Design JSX writes and reads FigJam sticky notes as `<Sticky color="yellow" author="Ada">…</Sticky>`, with their colour, author line, wide shape, text size, and scale, and JSX export no longer drops them (#1118).
diff --git a/packages/core/tests/design-jsx/stickies.test.ts b/packages/core/tests/design-jsx/stickies.test.ts
new file mode 100644
index 000000000..21820748c
--- /dev/null
+++ b/packages/core/tests/design-jsx/stickies.test.ts
@@ -0,0 +1,79 @@
+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, STICKY_COLORS, stickySublayers } from '@open-pencil/scene-graph'
+
+const BOARD = `
+ <Frame name="Board" w={900} h={400}>
+ <Sticky x={0} y={0} color="yellow" author="Ada">Ship it</Sticky>
+ <Sticky name="Risks" x={300} y={0} color="#FF0000" wide textSize="large" author="Lin" authorVisible={false}>Fonts</Sticky>
+ </Frame>`
+
+describe('sticky notes in design JSX', () => {
+ test('are made as the sticky tool makes them, named by their body', async () => {
+ const graph = new SceneGraph()
+ const [result] = await renderJSX(graph, BOARD)
+ const [plain, styled] = graph.getChildren(getNodeOrThrow(graph, result.id).id)
+ expect(plain).toMatchObject({
+ type: 'STICKY',
+ name: 'Ship it',
+ autoRename: true,
+ x: 0,
+ width: 240
+ })
+ expect(plain.fills[0]?.color).toEqual(STICKY_COLORS.yellow)
+ const layers = stickySublayers(graph, plain)
+ expect([layers?.body.text, layers?.author.text, layers?.author.visible]).toEqual([
+ 'Ship it',
+ 'Ada',
+ true
+ ])
+ expect(styled).toMatchObject({ name: 'Risks', autoRename: false, width: 416 })
+ const styledLayers = stickySublayers(graph, styled)
+ expect([styledLayers?.body.fontSize, styledLayers?.author.visible]).toEqual([40, false])
+ })
+
+ test('write back as Sticky elements', async () => {
+ const graph = new SceneGraph()
+ const [result] = await renderJSX(graph, BOARD)
+ const jsx = sceneNodeToJSX(result.id, graph)
+ expect(jsx).toContain('<Sticky color="yellow" author="Ada">Ship it</Sticky>')
+ expect(jsx).toContain(
+ '<Sticky name="Risks" x={300} color="#FF0000" author="Lin" authorVisible={false} wide textSize="large">Fonts</Sticky>'
+ )
+ const again = new SceneGraph()
+ const [reread] = await renderJSX(again, jsx)
+ expect(sceneNodeToJSX(reread.id, again)).toBe(jsx)
+ })
+
+ test('keep a name given in the JSX, even one that matches the body', async () => {
+ const graph = new SceneGraph()
+ const [result] = await renderJSX(graph, '<Sticky name="Ship it">Ship it</Sticky>')
+ const jsx = sceneNodeToJSX(result.id, graph)
+ expect(jsx).toContain('name="Ship it"')
+ const again = new SceneGraph()
+ const [reread] = await renderJSX(again, jsx)
+ expect(getNodeOrThrow(again, reread.id).autoRename).toBe(false)
+ })
+
+ test('join connectors to themselves, never to the layers they generate', async () => {
+ const graph = new SceneGraph()
+ const [result] = await renderJSX(
+ graph,
+ `<Frame name="Board" w={900} h={400}>
+ <Sticky x={0} y={0}>Ship it</Sticky>
+ <Text name="Text" x={600} y={0}>Done</Text>
+ <Connector from="Ship it" to="Text" />
+</Frame>`
+ )
+ const [sticky, text, connector] = graph.getChildren(result.id)
+ // The note's body is named as the layer the connector names, and is not joined.
+ expect(stickySublayers(graph, sticky)?.body.name).toBe('Text')
+ expect(result.warnings ?? []).toEqual([])
+ expect(connector.connectorStart?.nodeId).toBe(sticky.id)
+ expect(connector.connectorEnd?.nodeId).toBe(text.id)
+ })
+})
diff --git a/packages/design-jsx/src/connectors.ts b/packages/design-jsx/src/connectors.ts
index 0b272b602..56e55638c 100644
--- a/packages/design-jsx/src/connectors.ts
+++ b/packages/design-jsx/src/connectors.ts
@@ -11,6 +11,7 @@ import {
connectorSublayers,
createConnector,
freeEndpoint,
+ isGeneratedFrame,
type ConnectorEndpoint,
type SceneGraph,
type SceneNode
@@ -95,8 +96,8 @@ function styleLine(graph: SceneGraph, line: SceneNode, props: TreeNode['props'])
}
/**
- * The layers JSX writes under `rootIds`, in order, each before its descendants: a connector's
- * generated line and label are not, so an end never names them.
+ * The layers JSX writes under `rootIds`, in order, each before its descendants: the layers a
+ * connector or sticky note generates are not, so an end never names them.
*/
function layersUnder(graph: SceneGraph, rootIds: readonly string[]): SceneNode[] {
const layers: SceneNode[] = []
@@ -104,7 +105,7 @@ function layersUnder(graph: SceneGraph, rootIds: readonly string[]): SceneNode[]
const node = graph.getNode(id)
if (!node) return
layers.push(node)
- if (node.type !== 'CONNECTOR') for (const childId of node.childIds) visit(childId)
+ if (!isGeneratedFrame(node)) for (const childId of node.childIds) visit(childId)
}
for (const id of rootIds) visit(id)
return layers
diff --git a/packages/design-jsx/src/elements.ts b/packages/design-jsx/src/elements.ts
index a904c4924..b0f527a32 100644
--- a/packages/design-jsx/src/elements.ts
+++ b/packages/design-jsx/src/elements.ts
@@ -8,6 +8,8 @@ import {
DESIGN_JSX_CONNECTOR_PROPERTY_NAMES,
DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES,
DESIGN_JSX_SPAN_PROPERTY_NAMES,
+ DESIGN_JSX_STICKY_LAYER_PROPERTY_NAMES,
+ DESIGN_JSX_STICKY_PROPERTY_NAMES,
DESIGN_JSX_SUPPORTED_PROPERTY_NAMES,
DESIGN_JSX_TEXT_PARAGRAPH_PROPERTY_NAMES
} from './schema'
@@ -154,6 +156,13 @@ export const DESIGN_JSX_ELEMENTS: DesignJSXElementDefinition[] = [
nodeType: 'RECTANGLE'
},
{ name: 'Icon', runtimeType: 'icon', description: 'An Iconify icon.' },
+ {
+ name: 'Sticky',
+ runtimeType: 'sticky',
+ description: 'A FigJam sticky note; its text is the body.',
+ props: [...DESIGN_JSX_STICKY_PROPERTY_NAMES, ...DESIGN_JSX_STICKY_LAYER_PROPERTY_NAMES],
+ writes: ['STICKY']
+ },
{
name: 'Connector',
runtimeType: 'connector',
diff --git a/packages/design-jsx/src/enums.ts b/packages/design-jsx/src/enums.ts
index b42f7210d..fb92aeae8 100644
--- a/packages/design-jsx/src/enums.ts
+++ b/packages/design-jsx/src/enums.ts
@@ -6,6 +6,7 @@ import type {
MaskType,
SceneNode,
Stroke,
+ StickyTextSize,
StrokeCap,
StrokeJoin,
TextAutoResize,
@@ -38,14 +39,15 @@ export function jsxEnum<T extends string>(
aliases: Readonly<Record<string, T>> = {}
): JSXEnum<T> {
const entries = Object.entries(spellings) as [T, string][]
- const byName = new Map<string, T>([
- ...entries.map(([value, name]): [string, T] => [name, value]),
- ...Object.entries(aliases)
- ])
+ const byName = new Map<string, T>(
+ [...entries.map(([value, name]): [string, T] => [name, value]), ...Object.entries(aliases)].map(
+ ([name, value]): [string, T] => [name.toLowerCase(), value]
+ )
+ )
return {
parse: (value) => (typeof value === 'string' ? byName.get(value.toLowerCase()) : undefined),
print: (value) => spellings[value],
- names: [...byName.keys()]
+ names: [...entries.map(([, name]) => name), ...Object.keys(aliases)]
}
}
@@ -117,6 +119,13 @@ export const TEXT_DECORATION = lowercaseEnum<TextDecoration>(['NONE', 'UNDERLINE
export const TEXT_DECORATION_STYLE = lowercaseEnum<TextDecorationStyle>(['SOLID', 'DOTTED', 'WAVY'])
export const TEXT_CASE = lowercaseEnum<TextCase>(['ORIGINAL', 'UPPER', 'LOWER', 'TITLE'])
+export const STICKY_TEXT_SIZE = jsxEnum<StickyTextSize>({
+ small: 'small',
+ medium: 'medium',
+ large: 'large',
+ extraLarge: 'extraLarge',
+ huge: 'huge'
+})
export const CONNECTOR_LINE = lowercaseEnum<ConnectorLineType>(['ELBOWED', 'STRAIGHT', 'CURVED'])
/** The sides a `<Connector>` end attaches by; the other magnets come only from files. */
export const CONNECTOR_SIDE = lowercaseEnum<
@@ -137,6 +146,7 @@ export const ENUM_PROPS: Readonly<Partial<Record<string, JSXEnum<string>>>> = {
textDecoration: TEXT_DECORATION,
textDecorationStyle: TEXT_DECORATION_STYLE,
textCase: TEXT_CASE,
+ textSize: STICKY_TEXT_SIZE,
line: CONNECTOR_LINE,
fromSide: CONNECTOR_SIDE,
toSide: CONNECTOR_SIDE,
diff --git a/packages/design-jsx/src/export/index.ts b/packages/design-jsx/src/export/index.ts
index bdea9b20e..b54ed5cf7 100644
--- a/packages/design-jsx/src/export/index.ts
+++ b/packages/design-jsx/src/export/index.ts
@@ -11,9 +11,10 @@ import {
type ConnectorExportScope
} from '../connectors'
import { elementTag } from '../elements'
+import { stickyBody, stickyName, stickyProps } from '../stickies'
import { rekaExport, type RekaExport } from './behaviours'
import { iconProps } from './icons'
-import { collectProps } from './props'
+import { collectProps, positionProps } from './props'
import { textChildren } from './text'
import { plainValue, propAttribute, Reference, type JSXProp } from './value'
@@ -63,6 +64,17 @@ interface OwnElement {
const OWN_ELEMENTS: Partial<
Record<NodeType, (graph: SceneGraph, node: SceneNode, scope?: ConnectorExportScope) => OwnElement>
> = {
+ STICKY: (graph, node) => {
+ const name = stickyName(node)
+ return {
+ props: [
+ ...(name ? [['name', name] satisfies JSXProp] : []),
+ ...positionProps(node, graph),
+ ...stickyProps(graph, node).map(([key, value]): JSXProp => [key, plainValue(value)])
+ ],
+ text: stickyBody(graph, node)
+ }
+ },
CONNECTOR: (graph, node, scope) => ({
props: connectorProps(graph, node, scope).map(([key, value]): JSXProp => [
key,
@@ -180,8 +192,8 @@ export function designJSXElement(nodeId: string, graph: SceneGraph): DesignJSXEl
const tag = node && elementTag(node.type)
const printed = sceneNodeAttributes(nodeId, graph)
if (!node || !tag || !printed) return null
- // A text layer's content, or a connector's label, is written as its children, not as the
- // `text` attribute; a connector's generated layers are not written at all.
+ // A text layer's content, a connector's label, or a sticky note's body is written as its
+ // children, not as the `text` attribute; the layers they generate are not written at all.
const own = OWN_ELEMENTS[node.type]
const hasContent = node.type === 'TEXT' || own !== undefined
const attributes = Object.fromEntries(
diff --git a/packages/design-jsx/src/export/props.ts b/packages/design-jsx/src/export/props.ts
index 1cb433b9a..5c9876e78 100644
--- a/packages/design-jsx/src/export/props.ts
+++ b/packages/design-jsx/src/export/props.ts
@@ -146,6 +146,13 @@ function collectPositionProps(
if (node.y !== 0) props.push(['y', node.y])
}
+/** Where a layer sits in its parent, as the export writes any layer's position. */
+export function positionProps(node: SceneNode, graph: SceneGraph): JSXProp[] {
+ const props: JSXProp[] = []
+ collectPositionProps(node, getNodeContext(node, graph), props)
+ return props
+}
+
function collectSizingProps(
node: SceneNode,
ctx: ReturnType<typeof getNodeContext>,
diff --git a/packages/design-jsx/src/reference/authoring.md b/packages/design-jsx/src/reference/authoring.md
index ca34b1cfa..84ffe1463 100644
--- a/packages/design-jsx/src/reference/authoring.md
+++ b/packages/design-jsx/src/reference/authoring.md
@@ -25,6 +25,7 @@ This reference describes scene creation, not React DOM output. Use the `render`
- 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.
- `Icon` uses an Iconify name, size, and color. Prefer icons to emoji when reliable vector output is needed. Image fills belong on appropriate leaf shapes, not containers whose children must remain visible.
+- `Sticky` makes a FigJam sticky note whose text is its body: `<Sticky color="yellow" author="Ada">Ship it</Sticky>`. `color` takes a FigJam palette name (`white`, `gray`, `red`, `orange`, `yellow`, `green`, `teal`, `blue`, `violet`, `pink`) or any colour, `author` signs it (`authorVisible={false}` hides the line), `wide` makes it 416 wide instead of 240, `textSize` is `small`, `medium`, `large`, `extraLarge`, or `huge`, and `scale` scales the whole note. A note sizes itself; it takes no `w`, `h`, fills, or layout props.
- `Connector` draws a FigJam connector that follows the layers it joins: `<Connector from="Start" to="Done">Next</Connector>`. `from` and `to` name layers of the same JSX, take a `ref()` a layer is marked with (`const card = ref()`, then `<Frame ref={card}>` and `from={card}`), or give `{ x, y }` points in the connector's parent; `fromSide`/`toSide` (`top`, `right`, `bottom`, `left`) fix the side it attaches by, `line` is `elbowed` (default), `straight`, or `curved`, and `startCap`/`endCap` take the same caps as `strokeCap`: `none`, `round`, `square`, `arrow_lines`, `arrow_equilateral`, `triangle_filled`, `diamond_filled`, or `circle_filled` (it starts with none and ends with `arrow_lines`). Its text is the label; `stroke`, `strokeWidth`, and `dashPattern` style the line. When layers share a name, join them by `ref()`; a name more than one layer has joins the first, with a warning.
- Design JSX props are the portable authoring interface. Some CSS-style aliases are supported, but this is not a browser CSS engine; do not assume arbitrary HTML, classes, or styles work.
diff --git a/packages/design-jsx/src/renderer.ts b/packages/design-jsx/src/renderer.ts
index a0b013966..d58009623 100644
--- a/packages/design-jsx/src/renderer.ts
+++ b/packages/design-jsx/src/renderer.ts
@@ -23,6 +23,7 @@ import { applySizeOverrides, propsToOverrides } from './props-overrides'
import { LayerRefs } from './refs'
import { prepareScalarBindings } from './scalar-bindings'
import type { DesignJSXServices } from './services'
+import { renderStickyNode, STICKY_ELEMENT } from './stickies'
import { isTextContent, TEXT_CONTENT_NAMES, textContentFields } from './text-content'
import { FRAGMENT, isTreeNode } from './tree'
import type { TreeNode } from './tree'
@@ -514,6 +515,8 @@ function renderOwnElement<Artwork>(
return renderArtworkNode(services, graph, tree, parentId)
case 'instance':
return renderInstanceNode(graph, tree, parentId)
+ case STICKY_ELEMENT:
+ return Promise.resolve(renderStickyNode(graph, tree, parentId))
case CONNECTOR_ELEMENT:
return Promise.resolve(renderConnectorElement(graph, tree, parentId))
default:
diff --git a/packages/design-jsx/src/schema.ts b/packages/design-jsx/src/schema.ts
index be688d1aa..6f50f609e 100644
--- a/packages/design-jsx/src/schema.ts
+++ b/packages/design-jsx/src/schema.ts
@@ -15,6 +15,27 @@ export const DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES = [
'indent'
] as const
+/** Props only `<Sticky>` takes. */
+export const DESIGN_JSX_STICKY_PROPERTY_NAMES = [
+ 'color',
+ 'author',
+ 'authorVisible',
+ 'wide',
+ 'textSize',
+ 'scale'
+] as const
+
+/** Layer props a sticky note takes too. */
+export const DESIGN_JSX_STICKY_LAYER_PROPERTY_NAMES = [
+ 'name',
+ 'key',
+ 'x',
+ 'y',
+ 'position',
+ 'visible',
+ 'opacity'
+] as const
+
/** Props only `<Connector>` takes. */
export const DESIGN_JSX_CONNECTOR_PROPERTY_NAMES = [
'from',
diff --git a/packages/design-jsx/src/stickies.ts b/packages/design-jsx/src/stickies.ts
new file mode 100644
index 000000000..7f1507b8a
--- /dev/null
+++ b/packages/design-jsx/src/stickies.ts
@@ -0,0 +1,112 @@
+import {
+ createSticky,
+ isWideSticky,
+ STICKY_COLORS,
+ stickyBodySizeFields,
+ stickyScale,
+ stickySublayers,
+ stickyTextSize,
+ type SceneGraph,
+ type SceneNode
+} from '@open-pencil/scene-graph'
+import { colorToHex, parseColor } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+
+import { STICKY_TEXT_SIZE } from './enums'
+import type { TreeNode } from './tree'
+
+/**
+ * `<Sticky color="yellow" author="Ada">Body</Sticky>`: a FigJam sticky note, made from the same
+ * template as the sticky tool's.
+ */
+export const STICKY_ELEMENT = 'sticky'
+
+type StickyColorName = keyof typeof STICKY_COLORS
+
+function isStickyColorName(value: string): value is StickyColorName {
+ return value in STICKY_COLORS
+}
+
+/** A palette name such as `"yellow"`, or any colour. */
+function colorOf(value: unknown): Color | undefined {
+ if (typeof value !== 'string') return undefined
+ return isStickyColorName(value) ? { ...STICKY_COLORS[value] } : parseColor(value)
+}
+
+function bodyOf(tree: TreeNode): string {
+ return tree.children.filter((child): child is string => typeof child === 'string').join('')
+}
+
+/** The note an element describes, named by its body as FigJam names a note until renamed. */
+export function renderStickyNode(graph: SceneGraph, tree: TreeNode, parentId: string) {
+ const { props } = tree
+ const text = bodyOf(tree)
+ const author = typeof props.author === 'string' ? props.author : ''
+ const parent = graph.getNode(parentId)
+ const named = typeof props.name === 'string'
+ const sticky = createSticky(
+ graph,
+ parentId,
+ {
+ text,
+ author,
+ authorVisible: props.authorVisible !== false && author !== '',
+ color: colorOf(props.color),
+ wide: props.wide === true,
+ scale: typeof props.scale === 'number' && props.scale > 0 ? props.scale : 1
+ },
+ {
+ name: named ? String(props.name) : text.trim() || 'Sticky',
+ autoRename: !named,
+ ...(typeof props.x === 'number' && { x: props.x }),
+ ...(typeof props.y === 'number' && { y: props.y }),
+ ...(props.visible === false && { visible: false }),
+ ...(typeof props.opacity === 'number' && { opacity: props.opacity }),
+ ...(props.position === 'absolute' &&
+ parent?.layoutMode !== 'NONE' && { layoutPositioning: 'ABSOLUTE' as const })
+ }
+ )
+ const body = stickySublayers(graph, sticky)?.body
+ const textSize = STICKY_TEXT_SIZE.parse(props.textSize)
+ if (body && textSize) graph.updateNode(body.id, stickyBodySizeFields(textSize))
+ return sticky
+}
+
+/** The colour as `<Sticky>` writes it: its palette name, or a hex colour off the palette. */
+function colorName(color: Color): string {
+ const hex = colorToHex(color)
+ const named = Object.entries(STICKY_COLORS).find(([, value]) => colorToHex(value) === hex)
+ return named ? named[0] : hex
+}
+
+/**
+ * The name `<Sticky>` writes: none while the note is still named by its body, and its name once
+ * renamed, even to its body, so reading it back keeps the name from following the body.
+ */
+export function stickyName(node: SceneNode): string | null {
+ return node.autoRename ? null : node.name
+}
+
+/** A note's own props as `<Sticky>` writes them, after its name and position. */
+export function stickyProps(graph: SceneGraph, node: SceneNode): Array<[string, unknown]> {
+ const layers = stickySublayers(graph, node)
+ const color = node.fills.at(0)?.color
+ const props: Array<[string, unknown]> = []
+ if (color) props.push(['color', colorName(color)])
+ if (layers?.author.text) props.push(['author', layers.author.text])
+ if (layers?.author.text && !layers.author.visible) props.push(['authorVisible', false])
+ if (isWideSticky(graph, node)) props.push(['wide', true])
+ if (layers && stickyTextSize(layers.body) !== 'small') {
+ props.push(['textSize', stickyTextSize(layers.body)])
+ }
+ const scale = layers ? stickyScale(layers.author) : 1
+ if (scale !== 1) props.push(['scale', scale])
+ if (node.opacity < 1) props.push(['opacity', Math.round(node.opacity * 100) / 100])
+ if (!node.visible) props.push(['visible', false])
+ return props
+}
+
+/** The body a note writes as its children. */
+export function stickyBody(graph: SceneGraph, node: SceneNode): string {
+ return stickySublayers(graph, node)?.body.text ?? ''
+}
diff --git a/packages/design-jsx/tests/enums.test.ts b/packages/design-jsx/tests/enums.test.ts
index 90069aa31..89d12805a 100644
--- a/packages/design-jsx/tests/enums.test.ts
+++ b/packages/design-jsx/tests/enums.test.ts
@@ -4,6 +4,7 @@ import {
BLEND_MODE,
CONSTRAINT,
MASK_TYPE,
+ STICKY_TEXT_SIZE,
STROKE_ALIGN,
STROKE_CAP,
STROKE_JOIN,
@@ -112,6 +113,13 @@ describe('design JSX enums', () => {
expect(warnings).toEqual([])
})
+ test('a sticky text size reads as its camelCase name in any case, and an unknown one warns', async () => {
+ expect(STICKY_TEXT_SIZE.parse('extralarge')).toBe('extraLarge')
+ expect(STICKY_TEXT_SIZE.print('extraLarge')).toBe('extraLarge')
+ const { warnings } = await render('<Sticky textSize="giant">Hi</Sticky>')
+ expect(warnings[0]).toStartWith('Unknown textSize "giant" on <sticky> is ignored')
+ })
+
test('a connector cap is spelled as strokeCap spells it, and an unknown one warns', async () => {
const { graph, warnings } = await render(
'<Frame><Rectangle name="A" /><Rectangle name="B" /><Connector from="A" to="B" startCap="circle_filled" endCap="arrow" /></Frame>'
diff --git a/packages/docs/reference/design-authoring.md b/packages/docs/reference/design-authoring.md
index 360d4f1d7..610a3b4b0 100644
--- a/packages/docs/reference/design-authoring.md
+++ b/packages/docs/reference/design-authoring.md
@@ -27,6 +27,7 @@ This reference describes scene creation, not React DOM output. Use the `render`
- 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.
- `Icon` uses an Iconify name, size, and color. Prefer icons to emoji when reliable vector output is needed. Image fills belong on appropriate leaf shapes, not containers whose children must remain visible.
+- `Sticky` makes a FigJam sticky note whose text is its body: `<Sticky color="yellow" author="Ada">Ship it</Sticky>`. `color` takes a FigJam palette name (`white`, `gray`, `red`, `orange`, `yellow`, `green`, `teal`, `blue`, `violet`, `pink`) or any colour, `author` signs it (`authorVisible={false}` hides the line), `wide` makes it 416 wide instead of 240, `textSize` is `small`, `medium`, `large`, `extraLarge`, or `huge`, and `scale` scales the whole note. A note sizes itself; it takes no `w`, `h`, fills, or layout props.
- `Connector` draws a FigJam connector that follows the layers it joins: `<Connector from="Start" to="Done">Next</Connector>`. `from` and `to` name layers of the same JSX, take a `ref()` a layer is marked with (`const card = ref()`, then `<Frame ref={card}>` and `from={card}`), or give `{ x, y }` points in the connector's parent; `fromSide`/`toSide` (`top`, `right`, `bottom`, `left`) fix the side it attaches by, `line` is `elbowed` (default), `straight`, or `curved`, and `startCap`/`endCap` take the same caps as `strokeCap`: `none`, `round`, `square`, `arrow_lines`, `arrow_equilateral`, `triangle_filled`, `diamond_filled`, or `circle_filled` (it starts with none and ends with `arrow_lines`). Its text is the label; `stroke`, `strokeWidth`, and `dashPattern` style the line. When layers share a name, join them by `ref()`; a name more than one layer has joins the first, with a warning.
- Design JSX props are the portable authoring interface. Some CSS-style aliases are supported, but this is not a browser CSS engine; do not assume arbitrary HTML, classes, or styles work.
@@ -103,7 +104,7 @@ The examples below are executed by the authoring-reference tests. Create the nam
Generated from the renderer metadata. This inventory lists accepted names, not arbitrary browser CSS support.
-**Elements:** `Frame`, `Text`, `Span`, `Paragraph`, `Rectangle`, `Ellipse`, `Line`, `Star`, `Polygon`, `Vector`, `Group`, `Section`, `Component`, `ComponentSet`, `Instance`, `View`, `Rect`, `Icon`, `Connector`, `Button.Root`, `Toggle.Root`, `Switch.Root`, `Switch.Thumb`, `Checkbox.Root`, `Checkbox.Indicator`, `RadioGroup.Root`, `RadioGroup.Item`, `RadioGroup.Indicator`, `ToggleGroup.Root`, `ToggleGroup.Item`, `Slider.Root`, `Slider.Track`, `Slider.Range`, `Slider.Thumb`, `Progress.Root`, `Progress.Track`, `Progress.Indicator`, `Tabs.Root`, `Tabs.List`, `Tabs.Trigger`, `Tabs.Content`, `Collapsible.Root`, `Collapsible.Trigger`, `Collapsible.Content`, `Accordion.Root`, `Accordion.Item`, `Accordion.Header`, `Accordion.Trigger`, `Accordion.Content`, `NumberField.Root`, `NumberField.Input`, `NumberField.Increment`, `NumberField.Decrement`, `TextField.Root`, `TextField.Input`, `Textarea.Root`, `Textarea.Input`.
+**Elements:** `Frame`, `Text`, `Span`, `Paragraph`, `Rectangle`, `Ellipse`, `Line`, `Star`, `Polygon`, `Vector`, `Group`, `Section`, `Component`, `ComponentSet`, `Instance`, `View`, `Rect`, `Icon`, `Sticky`, `Connector`, `Button.Root`, `Toggle.Root`, `Switch.Root`, `Switch.Thumb`, `Checkbox.Root`, `Checkbox.Indicator`, `RadioGroup.Root`, `RadioGroup.Item`, `RadioGroup.Indicator`, `ToggleGroup.Root`, `ToggleGroup.Item`, `Slider.Root`, `Slider.Track`, `Slider.Range`, `Slider.Thumb`, `Progress.Root`, `Progress.Track`, `Progress.Indicator`, `Tabs.Root`, `Tabs.List`, `Tabs.Trigger`, `Tabs.Content`, `Collapsible.Root`, `Collapsible.Trigger`, `Collapsible.Content`, `Accordion.Root`, `Accordion.Item`, `Accordion.Header`, `Accordion.Trigger`, `Accordion.Content`, `NumberField.Root`, `NumberField.Input`, `NumberField.Increment`, `NumberField.Decrement`, `TextField.Root`, `TextField.Input`, `Textarea.Root`, `Textarea.Input`.
**Helpers:** `solid`, `gradient`, `linearGradient`, `radialGradient`, `angularGradient`, `diamondGradient`, `shader`, `dropShadow`, `innerShadow`, `layerBlur`, `backgroundBlur`, `foregroundBlur`, `designVar`, `defineVars`, `ref`.
diff --git a/skills/open-pencil/references/design-authoring.md b/skills/open-pencil/references/design-authoring.md
index 360d4f1d7..610a3b4b0 100644
--- a/skills/open-pencil/references/design-authoring.md
+++ b/skills/open-pencil/references/design-authoring.md
@@ -27,6 +27,7 @@ This reference describes scene creation, not React DOM output. Use the `render`
- 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.
- `Icon` uses an Iconify name, size, and color. Prefer icons to emoji when reliable vector output is needed. Image fills belong on appropriate leaf shapes, not containers whose children must remain visible.
+- `Sticky` makes a FigJam sticky note whose text is its body: `<Sticky color="yellow" author="Ada">Ship it</Sticky>`. `color` takes a FigJam palette name (`white`, `gray`, `red`, `orange`, `yellow`, `green`, `teal`, `blue`, `violet`, `pink`) or any colour, `author` signs it (`authorVisible={false}` hides the line), `wide` makes it 416 wide instead of 240, `textSize` is `small`, `medium`, `large`, `extraLarge`, or `huge`, and `scale` scales the whole note. A note sizes itself; it takes no `w`, `h`, fills, or layout props.
- `Connector` draws a FigJam connector that follows the layers it joins: `<Connector from="Start" to="Done">Next</Connector>`. `from` and `to` name layers of the same JSX, take a `ref()` a layer is marked with (`const card = ref()`, then `<Frame ref={card}>` and `from={card}`), or give `{ x, y }` points in the connector's parent; `fromSide`/`toSide` (`top`, `right`, `bottom`, `left`) fix the side it attaches by, `line` is `elbowed` (default), `straight`, or `curved`, and `startCap`/`endCap` take the same caps as `strokeCap`: `none`, `round`, `square`, `arrow_lines`, `arrow_equilateral`, `triangle_filled`, `diamond_filled`, or `circle_filled` (it starts with none and ends with `arrow_lines`). Its text is the label; `stroke`, `strokeWidth`, and `dashPattern` style the line. When layers share a name, join them by `ref()`; a name more than one layer has joins the first, with a warning.
- Design JSX props are the portable authoring interface. Some CSS-style aliases are supported, but this is not a browser CSS engine; do not assume arbitrary HTML, classes, or styles work.
@@ -103,7 +104,7 @@ The examples below are executed by the authoring-reference tests. Create the nam
Generated from the renderer metadata. This inventory lists accepted names, not arbitrary browser CSS support.
-**Elements:** `Frame`, `Text`, `Span`, `Paragraph`, `Rectangle`, `Ellipse`, `Line`, `Star`, `Polygon`, `Vector`, `Group`, `Section`, `Component`, `ComponentSet`, `Instance`, `View`, `Rect`, `Icon`, `Connector`, `Button.Root`, `Toggle.Root`, `Switch.Root`, `Switch.Thumb`, `Checkbox.Root`, `Checkbox.Indicator`, `RadioGroup.Root`, `RadioGroup.Item`, `RadioGroup.Indicator`, `ToggleGroup.Root`, `ToggleGroup.Item`, `Slider.Root`, `Slider.Track`, `Slider.Range`, `Slider.Thumb`, `Progress.Root`, `Progress.Track`, `Progress.Indicator`, `Tabs.Root`, `Tabs.List`, `Tabs.Trigger`, `Tabs.Content`, `Collapsible.Root`, `Collapsible.Trigger`, `Collapsible.Content`, `Accordion.Root`, `Accordion.Item`, `Accordion.Header`, `Accordion.Trigger`, `Accordion.Content`, `NumberField.Root`, `NumberField.Input`, `NumberField.Increment`, `NumberField.Decrement`, `TextField.Root`, `TextField.Input`, `Textarea.Root`, `Textarea.Input`.
+**Elements:** `Frame`, `Text`, `Span`, `Paragraph`, `Rectangle`, `Ellipse`, `Line`, `Star`, `Polygon`, `Vector`, `Group`, `Section`, `Component`, `ComponentSet`, `Instance`, `View`, `Rect`, `Icon`, `Sticky`, `Connector`, `Button.Root`, `Toggle.Root`, `Switch.Root`, `Switch.Thumb`, `Checkbox.Root`, `Checkbox.Indicator`, `RadioGroup.Root`, `RadioGroup.Item`, `RadioGroup.Indicator`, `ToggleGroup.Root`, `ToggleGroup.Item`, `Slider.Root`, `Slider.Track`, `Slider.Range`, `Slider.Thumb`, `Progress.Root`, `Progress.Track`, `Progress.Indicator`, `Tabs.Root`, `Tabs.List`, `Tabs.Trigger`, `Tabs.Content`, `Collapsible.Root`, `Collapsible.Trigger`, `Collapsible.Content`, `Accordion.Root`, `Accordion.Item`, `Accordion.Header`, `Accordion.Trigger`, `Accordion.Content`, `NumberField.Root`, `NumberField.Input`, `NumberField.Increment`, `NumberField.Decrement`, `TextField.Root`, `TextField.Input`, `Textarea.Root`, `Textarea.Input`.
**Helpers:** `solid`, `gradient`, `linearGradient`, `radialGradient`, `angularGradient`, `diamondGradient`, `shader`, `dropShadow`, `innerShadow`, `layerBlur`, `backgroundBlur`, `foregroundBlur`, `designVar`, `defineVars`, `ref`.