Commit graph

386 commits

Author SHA1 Message Date
Danila Poyarkov 6f88a2e47e Merge branch 'port-tools' 2026-03-02 19:51:11 +03:00
Danila Poyarkov afb480d05d Update changelog with layers context menu and CI improvements 2026-03-02 19:46:04 +03:00
Danila Poyarkov 90e29f13a2 Add context menu to layers panel
Extract menu items into shared NodeContextMenuContent component,
used by both the canvas and layers panel context menus.
Right-clicking a layer selects it and shows the same menu.
2026-03-02 19:45:09 +03:00
Danila Poyarkov c3869908ee Format core package 2026-03-02 19:43:44 +03:00
Danila Poyarkov 5147bc1fec Update changelog with new tools and color constants 2026-03-02 19:35:18 +03:00
Danila Poyarkov 4e1c15c4ff Extract color constants: BLACK, TRANSPARENT, DEFAULT_SHADOW_COLOR
Replace 8 inline { r: 0, g: 0, b: 0, a: 1 } literals across core
with shared constants from constants.ts. Also reuse CANVAS_BG_COLOR
in fig-export.ts instead of duplicating the value.
2026-03-02 19:34:35 +03:00
Danila Poyarkov 537663aa3c Port figma-use tools: variables, set_*, node ops, boolean, paths, viewport
Add 40+ new tool definitions ported from figma-use:

Granular set tools: set_rotation, set_opacity, set_radius, set_minmax,
set_text, set_font, set_font_range, set_text_resize, set_visible,
set_blend, set_locked, set_stroke_align

Node operations: node_bounds, node_move, node_resize, node_ancestors,
node_children, node_tree, node_bindings, node_replace_with

Variable CRUD: get_variable, find_variables, create_variable,
set_variable, delete_variable, bind_variable

Collection CRUD: get_collection, create_collection, delete_collection

Boolean operations: boolean_union, boolean_subtract, boolean_intersect,
boolean_exclude

Vector path tools: path_get, path_set, path_scale, path_flip, path_move

Create tools: create_page, create_vector, create_slice

Misc: flatten_nodes, viewport_get, viewport_set, viewport_zoom_to_fit,
page_bounds, list_fonts

Also adds createVariable/createCollection to SceneGraph, and viewport,
boolean operation, and flatten methods to FigmaAPI.
2026-03-02 19:27:42 +03:00
Danila Poyarkov b7a634f1ae Skip already-published versions in CI npm publish
Prevents re-run failures when a package was already published.
Real errors (auth, build) still fail the job.
2026-03-02 18:37:00 +03:00
Danila Poyarkov 7d98201548 Release v0.4.2 2026-03-02 18:14:35 +03:00
Danila Poyarkov 877350a3af Auto-populate GitHub Releases from CHANGELOG.md
Use ffurrer2/extract-release-notes@v2 to extract the version section
and pass it as releaseBody to the Tauri action.

Switch changelog headings to Keep a Changelog format (## [X.Y.Z])
to match the action's expected pattern.
2026-03-02 18:12:36 +03:00
Danila Poyarkov 8bb62d908f Update changelog with clipboard import fixes 2026-03-02 18:07:59 +03:00
Danila Poyarkov db7a019385 Fix Figma paste redo + add clipboard import tests
Redo was creating duplicate childIds because snapshots captured after
tree construction had populated childIds, and createNode appends to
parent.childIds again. Fix: clear childIds in redo snapshots.

New tests (7):
- layoutAlignSelf from stackChildAlignSelf
- clipsContent from frameMaskDisabled
- fontWeight from fontName.style via styleToWeight
- letterSpacing object → pixels conversion
- undo removes full subtree
- redo recreates correct parent-child tree
- redo without childIds:[] demonstrates the duplicate bug
2026-03-02 18:05:22 +03:00
Danila Poyarkov 8850625a6f Fix text not rendering + undo for Figma clipboard paste
- letterSpacing is an object {value, units} not a number — was NaN,
  which silently breaks CanvasKit paragraph layout
- Add mapLetterSpacing() to handle PIXELS and PERCENT units
- Force textAutoResize to NONE (Yoga has no text measurement callback)
- Record undo entry for Figma paste with full subtree snapshots
- Add stackChildAlignSelf, fontWeight to NodeChange interface
2026-03-02 17:59:18 +03:00
Danila Poyarkov e1b5f1901e Import missing layout/text properties from Figma clipboard
- layoutAlignSelf (stackChildAlignSelf → STRETCH/AUTO)
- clipsContent (from frameMaskDisabled, inverted)
- textAutoResize (NONE/HEIGHT/WIDTH_AND_HEIGHT/TRUNCATE)
- fontWeight (from fontName.style via styleToWeight when not explicit)
- italic (from fontName.style)
- lineHeight (PIXELS only, PERCENT deferred)
- letterSpacing
2026-03-02 17:41:42 +03:00
Danila Poyarkov f54871fae2 Compute layouts after clipboard paste 2026-03-02 17:34:53 +03:00
Danila Poyarkov 8b1547ece7 Center pasted Figma nodes in viewport instead of using original coordinates 2026-03-02 17:32:06 +03:00
Danila Poyarkov d7ba0bfef9 Skip non-visual node types in clipboard import (variables, widgets, etc.)
Figma clipboard data includes VARIABLE_SET, VARIABLE, and other non-visual
types that were falling through to the default RECTANGLE case in mapNodeType.
These now join DOCUMENT and CANVAS in the skipTypes set.
2026-03-02 17:22:09 +03:00
Danila Poyarkov e0c5820183 CI: publish releases as non-draft 2026-03-02 15:54:43 +03:00
Danila Poyarkov 7eb74c3969 Release v0.4.1 2026-03-02 15:51:34 +03:00
Danila Poyarkov ebb85e8f20 Improve scene cache regression test for font load race 2026-03-02 15:51:02 +03:00
Danila Poyarkov af8b90a939 Fix text disappearing after hover: invalidate SkPicture on font load
The first render records an SkPicture before fonts are loaded (fallback
drawText path). When fonts finish loading asynchronously, the cached
picture was never invalidated — subsequent renders replayed stale picture
without paragraph text. Hovering a node forced a full re-render (volatile
overlay path), making text reappear. Un-hovering replayed the stale cache.

Fix: call invalidateScenePicture() at the end of loadFonts() so the next
render records a fresh picture with proper paragraph text.
2026-03-02 15:45:58 +03:00
Danila Poyarkov f4b45d4f13 Replace "fig-kiwi" format name with "Kiwi binary" in docs
fig-kiwi is the magic header string in .fig files, not a format name.
The format is Kiwi binary — used for both .fig files and clipboard.
2026-03-02 15:31:25 +03:00
Danila Poyarkov 75cc653efc Fix Kiwi format description — same binary format as .fig files, not a clipboard format 2026-03-02 15:28:24 +03:00
Danila Poyarkov 9103d1b554 Highlight copy & paste with Figma in README and docs 2026-03-02 15:26:06 +03:00
Danila Poyarkov cc77c68143 Fix core exports: node → dist, default → src 2026-03-02 15:03:40 +03:00
Danila Poyarkov 5856233832 Fix core exports: types → src for workspace typecheck 2026-03-02 15:02:43 +03:00
Danila Poyarkov eecc58e63e Regenerate lockfile 2026-03-02 15:01:44 +03:00
Danila Poyarkov 8fea6c086d Bump all packages to 0.4.0, fix Node.js ESM compatibility
- tsgo + fix-esm-import-path for .js extensions in dist/
- Core exports: bun condition → src, import → dist
- MCP depends on core ^0.4.0
2026-03-02 14:59:59 +03:00
Danila Poyarkov 1f27add8c7 Fix MCP build script, bump to 0.3.3 2026-03-02 14:45:48 +03:00
Danila Poyarkov e7209171fa Build MCP package to JS for Node.js bin compatibility
tsgo emits dist/*.js with shebangs. Bins point at dist/ so
openpencil-mcp and openpencil-mcp-http work via npm/npx.
2026-03-02 14:42:15 +03:00
Danila Poyarkov d93bcab0b6 Add install instructions for @open-pencil/mcp 2026-03-02 14:28:56 +03:00
Danila Poyarkov 10b4fc6c13 Add @open-pencil/mcp to npm publish workflow 2026-03-02 14:27:07 +03:00
Danila Poyarkov 4ad90d4819 Add MCP server package with stdio and HTTP transports
29 tools: open_file, save_file, new_document + all 26 from @open-pencil/core.
Stdio for MCP clients (Claude Code, Cursor), HTTP (Hono + Streamable HTTP
with sessions) for scripts, browser extensions, CI.
Runs on both Bun and Node.js (via tsx).
2026-03-02 14:20:49 +03:00
Danila Poyarkov eeaef12c27 Update Penpot comparison to reflect WASM renderer (render-wasm/v1)
Penpot 2.x ships with Rust/Skia WASM rendering enabled by default.
Update architecture diagram, rendering pipeline, and file format sections
to reflect the current state instead of the old SVG-based renderer.
2026-03-02 13:35:09 +03:00
Danila Poyarkov c3c5253642 Acknowledge Anton Soldatov for docs 2026-03-02 12:27:05 +03:00
Danila Poyarkov 518ddb0c5b Release v0.3.2 2026-03-02 11:36:18 +03:00
Danila Poyarkov 527be98f2a Re-apply SkPicture scene caching with visual regression tests 2026-03-02 11:33:45 +03:00
Danila Poyarkov 1b414bf680 Release v0.3.1 2026-03-02 11:14:15 +03:00
Danila Poyarkov 11bff6d83f Remove COMPARISON.md (moved to docs site) 2026-03-02 11:13:59 +03:00
Danila Poyarkov 3011d603ab Fix macOS startup hang: async font loading, show_main_window on reopen 2026-03-02 11:13:50 +03:00
Danila Poyarkov 38aeade46e Revert SkPicture scene caching (breaks text rendering on hover) 2026-03-02 11:13:46 +03:00
Danila Poyarkov d5ca92e01f Add MIT license 2026-03-02 08:31:54 +03:00
Danila Poyarkov c2e77ff63d Fix Figma MCP timeline, update tool counts to 26, add AI providers to roadmap 2026-03-02 08:19:08 +03:00
Danila Poyarkov d24e0ee767 Style roadmap as blockquote 2026-03-02 08:00:58 +03:00
Danila Poyarkov ca5f0929d1 Add roadmap to README, update plan.md to current state 2026-03-02 07:56:52 +03:00
Danila Poyarkov f495f4072a Release v0.3.0 2026-03-01 22:46:06 +03:00
Danila Poyarkov a9c096a69d Fix npm publish: pnpm for workspace resolution, update README, read CLI version from package.json 2026-03-01 22:44:56 +03:00
Danila Poyarkov 1ee8e8e5af Add render performance benchmark test 2026-03-01 22:35:16 +03:00
Danila Poyarkov 9431918634 SkPicture scene caching for fast pan/zoom 2026-03-01 22:28:03 +03:00
Danila Poyarkov 80beba3348 Cache vector paths and pen paints across frames 2026-03-01 22:21:20 +03:00