openpencil/packages
Danila Poyarkov 5ba5b4aad5
fix(figma-api): validate effects like Figma (#794)
* build(core): import Markdown with unplugin-raw

Core inlined ?raw imports with a hand-written Rolldown plugin that also turned plain .md imports into strings, which nothing in Core uses. unplugin-raw already does this for the Vue SDK and design-jsx; use it here too and drop the unused *.md module declaration.

* refactor(pen): use the scene-graph color parser

pen/src/color.ts duplicated parseColor from @open-pencil/scene-graph/color line for line. Import it instead, which also drops pen's direct culori dependency.

* fix(figma-api): validate effects like Figma

The effects setter stored whatever a script passed, so scripts that Figma rejects ran here and malformed effects reached rendering and .fig export. Validate against Figma's effect shapes with Valibot, recorded from live Figma: strict objects, required shadow fields, radius >= 0, RGBA channels within 0..1, and no shadow fields on blurs. The getter now returns Figma's shape so node.effects = node.effects keeps working.

Closes #786

* fix(figma-api): reject infinite numbers in effects

Figma rejects Infinity in every effect number ("Number must be finite"), but v.number() accepts it, so infinite radii, offsets, and spreads reached the scene graph.

* fix(figma-api): store PASS_THROUGH shadow blend as NORMAL

PASS_THROUGH is a layer blend mode. Live Figma accepts it on drop and inner shadows but reads NORMAL back, so do the same instead of storing it.
2026-09-30 21:18:20 +04:00
..
cli feat: export components as Storybook stories (#751) 2026-09-30 03:16:47 +04:00
core fix(figma-api): validate effects like Figma (#794) 2026-09-30 21:18:20 +04:00
demos
design-jsx refactor(design-jsx): extract design JSX into its own package (#793) 2026-09-30 20:55:27 +04:00
docs refactor(design-jsx): extract design JSX into its own package (#793) 2026-09-30 20:55:27 +04:00
dom-css refactor(dom-css): group sources into import, export, and runtime (#789) 2026-09-30 09:44:52 +04:00
fig docs: route contributors through per-domain guides and ship npm license text (#785) 2026-09-29 01:02:06 +04:00
harness docs: route contributors through per-domain guides and ship npm license text (#785) 2026-09-29 01:02:06 +04:00
kiwi fix(kiwi): type the NodeChange fields fig.kiwi already declares 2026-09-30 12:18:00 +04:00
mcp refactor(design-jsx): extract design JSX into its own package (#793) 2026-09-30 20:55:27 +04:00
pen fix(figma-api): validate effects like Figma (#794) 2026-09-30 21:18:20 +04:00
scene-graph fix(tools): judge describe text contrast by WCAG ratio (#758) 2026-09-30 11:32:34 +04:00
vue docs: route contributors through per-domain guides and ship npm license text (#785) 2026-09-29 01:02:06 +04:00