Commit graph

1838 commits

Author SHA1 Message Date
Danila Poyarkov 8365112c51 refactor(kiwi): move FIG container helpers 2026-06-30 10:49:44 +03:00
Danila Poyarkov d068237ee4 refactor(kiwi): move FIG parse helpers 2026-06-30 10:49:29 +03:00
Danila Poyarkov eda61d815d refactor(kiwi): move FIG codec package 2026-06-30 10:49:14 +03:00
Danila Poyarkov 0c4429d3ff refactor(kiwi): isolate FIG codec types 2026-06-30 10:49:14 +03:00
Danila Poyarkov 086ab2d2ae refactor(kiwi): move variable binding codec 2026-06-30 10:49:14 +03:00
Danila Poyarkov 6877516f06 refactor(kiwi): consume standalone Kiwi package 2026-06-30 10:49:14 +03:00
Danila Poyarkov f5bd2425b6 feat(kiwi): scaffold standalone Kiwi package 2026-06-30 10:48:47 +03:00
Danila Poyarkov 605a404f1e docs: plan Kiwi package extraction 2026-06-30 10:48:14 +03:00
Danila Poyarkov c6db022d8d docs(dom-css): document browser Tailwind CSS recipes 2026-06-30 10:48:14 +03:00
Danila Poyarkov 7f99431981 feat(app): import DOM/CSS from code panel 2026-06-30 10:48:14 +03:00
Danila Poyarkov 6b3b2d68a7 build(dom-css): stabilize DOM/CSS chunk names 2026-06-30 10:48:14 +03:00
Danila Poyarkov 4811cac69b fix(dom-css): apply embedded HTML styles 2026-06-30 10:48:14 +03:00
Danila Poyarkov 05980797e3 feat(app): open DOM/CSS documents 2026-06-30 10:48:14 +03:00
Danila Poyarkov 2c66336c58 test(cli): cover DOM/CSS import 2026-06-30 10:48:14 +03:00
Danila Poyarkov 97246a67ce docs: preserve acronym casing in commits 2026-06-30 10:48:14 +03:00
Danila Poyarkov 3638fc11ba feat(cli): import DOM/CSS documents 2026-06-30 10:48:13 +03:00
Danila Poyarkov e77a82fb3b feat(dom-css): add browser JSX pipeline 2026-06-30 10:48:13 +03:00
Danila Poyarkov 50c9961d75 test(dom-css): cover browser CSS runtime pipeline 2026-06-30 10:48:13 +03:00
Danila Poyarkov 1f55891c3d feat(dom-css): add JSX authoring bridge 2026-06-30 10:48:13 +03:00
Danila Poyarkov 41c00a437f feat(dom-css): improve CSS export parity 2026-06-30 10:48:13 +03:00
Danila Poyarkov c1499b1745 docs: update DOM/CSS agent notes 2026-06-30 10:48:07 +03:00
Danila Poyarkov ef067ab7b1 test(dom-css): add standalone DOM/CSS package checks 2026-06-30 10:48:07 +03:00
Danila Poyarkov e16caea67d test(dom-css): add DOM/CSS package-local suite 2026-06-30 10:47:46 +03:00
Danila Poyarkov 5b61c1bf46 test(dom-css): expand fixture matrix 2026-06-30 10:47:26 +03:00
Danila Poyarkov a18a0f6403 docs(dom-css): document DOM/CSS conversion pipeline 2026-06-30 10:47:26 +03:00
Danila Poyarkov 9d14250ed2 feat(dom-css): add HTML conversion helpers 2026-06-30 10:47:25 +03:00
Danila Poyarkov 6e7e268c85 feat(dom-css): deepen browser runtime mapping 2026-06-30 10:47:25 +03:00
Danila Poyarkov f43c50338b feat(dom-css): map flex alignment 2026-06-30 10:47:25 +03:00
Danila Poyarkov 101a047e4d test(dom-css): share CSS fixture suite 2026-06-30 10:47:25 +03:00
Danila Poyarkov 95fedac2b7 test(dom-css): add browser CSS oracle 2026-06-30 10:47:25 +03:00
Danila Poyarkov 2c880186b0 feat(dom-css): add Tailwind compiler adapter 2026-06-30 10:47:25 +03:00
Danila Poyarkov 7db023b290 feat(dom-css): ingest Tailwind CSS utilities 2026-06-30 10:47:25 +03:00
Danila Poyarkov 8fd4cbc105 feat(dom-css): round-trip CSS cards 2026-06-30 10:47:25 +03:00
Danila Poyarkov c613df838c refactor(dom-css): use CSS acronym in identifiers 2026-06-30 10:47:19 +03:00
Danila Poyarkov 107b52d473 feat(dom-css): compute headless CSS styles 2026-06-30 10:47:19 +03:00
Danila Poyarkov 47c1f9fb38 feat(dom-css): parse HTML headlessly 2026-06-30 10:47:04 +03:00
Danila Poyarkov 141d88cf94 feat(dom-css): add SceneGraph conversion 2026-06-30 10:46:53 +03:00
Danila Poyarkov 4d61c002fa feat(dom-css): add DOM/CSS package skeleton 2026-06-30 10:46:25 +03:00
Danila Poyarkov 8983c11f45 feat(design-jsx): support structured effects 2026-06-30 10:45:15 +03:00
Danila Poyarkov cc1167eed5 feat(design-jsx): support structured paints 2026-06-30 10:44:51 +03:00
Danila Poyarkov 4b65e64c18 feat(design-jsx): support variable refs 2026-06-30 10:44:28 +03:00
Danila Poyarkov 7303a40964
fix(editor): separate preview updates from graph mutations
Separate preview-only scene graph updates from committed mutation events and fix vector resize undo.
2026-06-30 10:28:02 +03:00
Danila Poyarkov ec5ef4474e
i18n: add Japanese and complete menu localization (#367)
* i18n: more menu translations

* chore: code formatting

* chore: code formatting

* chore: code formatting

* i18n: more menu translations

* chore: code formatting

* i18n: added new menu translations and japanese language

* i18n: added theme-auto string

* i18n: translated rest of the menu text

* fix(i18n): polish PR 273 locale updates

- Fix obvious translation regressions in existing locales
- Preserve update size interpolation across localized update messages
- Use standard UI terms for theme and boolean operation labels

* fix(i18n): tune localized toggle labels

- Use paired action wording for toggle commands
- Clarify Japanese frame-selection command label

---------

Co-authored-by: Santos Alarcón <santosalarcon86@gmail.com>
2026-06-30 10:25:52 +03:00
Danila Poyarkov 00d5ba8e92
Merge pull request #355 from HelloAIXIAOJI/master
fix(i18n): correct translation of the duplicate command in zh-CN
2026-06-30 10:07:14 +03:00
Danila Poyarkov e5a479a81a docs: soften README status note 2026-06-30 09:53:44 +03:00
rcoenen b8076adfbb
fix(desktop): enable image drag-and-drop in the Tauri window
Tauri's dragDropEnabled defaults to true, which makes the native OS file
drop intercept and swallow the event so the webview's HTML5 drop handler
(useCanvasDrop) never fires — drag-and-drop of images worked in the browser
but failed in the desktop app. Set dragDropEnabled: false so the webview
receives HTML5 drag/drop natively and the existing web handler works on
desktop too. No web-side code changes.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Danila Poyarkov <dev@dannote.net>
2026-06-30 09:50:15 +03:00
Danila Poyarkov 568cdf91ef Merge remote-tracking branch 'joey/feature-overlapping-element-analysis-tool' into pr352-local-merge
# Conflicts:
#	tests/engine/clipboard/fixtures/gold-preview-roundtrip.test.ts
#	tests/engine/io/fig/import/group-reclassify.test.ts
#	tests/engine/io/fig/roundtrip/glyph-blob.test.ts
#	tests/engine/layout/auto-layout/text/measurement.test.ts
2026-06-30 09:47:07 +03:00
Joseph Cumines dc9638ac3e
fix(export): prevent GUID collisions and file corruption on .fig round-trip (#333)
* fix(export): prevent GUID collisions and file corruption on .fig round-trip

Nodes sharing the same imported source.id (component instance children,
cloned subtrees) silently overwrote each other on export because the
GUID assignment reused imported GUID values without checking for
duplicates.  This caused data loss on reimport — only the last node
with a given GUID survived.

- Track all assigned GUID values in a Set for O(1) collision detection.
- Scan imported source.ids for both sessionID 0 and 1 before assigning
  any new GUIDs, so the counter starts past every imported value.
- Fall back to counter-based GUIDs when source.id collides with an
  already-assigned value.

Additional fixes in the same change set:

- cloneTree now deep-copies source.fig via structuredClone, preventing
  mutations on a clone from corrupting the original node's kiwi payload.
- Removed decompressFigKiwiData sync wrapper (zero callers) and the
  silent try/catch fallback in parseFigKiwiContainer that masked
  corrupt data as raw bytes.
- buildFigKiwi uses Bun.zstdCompressSync when available, matching the
  zstd decompression path already used on import.
- Fixed setSavedVersion ordering in read.ts — must run after
  requestRender to capture the post-bump version, preventing spurious
  dirty-state immediately after file reload.

Tests: GUID collision (2 and 3 node), clone isolation, parse failure,
text export zstd compatibility, gold-preview round-trip.

* fix(export): handle EXCLUDE boolean operation and BOOLEAN_OPERATION node type

The internal representation uses EXCLUDE for exclude boolean operations,
but Figma's kiwi schema uses XOR. Map EXCLUDE back to XOR on export so
round-trips through .fig files don't fail. Also add BOOLEAN_OPERATION to
VALID_NODE_TYPES and increase timeout for heavy material3 fixture test.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* style: format export-node.ts

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* test: add type guard after null assertion in guid-collision test

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(clipboard): detect zstd-compressed data before zlib inflate

fflate's inflateSync silently accepts zstd-compressed data and returns
garbage instead of throwing. Check for the zstd magic bytes (28 b5 2f
fd) before attempting zlib decompression. Also revert the EXCLUDE enum
addition to the kiwi schema since the export-node.ts mapping is
sufficient.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(clipboard): add length guard before zstd magic byte check

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* test(scene-graph): group clone regression coverage

* ci: retrigger CI checks

* test: increase timeouts for heavy .fig fixture tests on slow CI runners

Gold-preview.fig and material3.fig parsing/export tests consistently
exceed the 5s bun:test default timeout on GitHub Actions runners.
Increase to 30s for: beforeAll codec init, clipboard roundtrip,
glyph blob roundtrip, group reclassification, and text measurement.

* test: add individual test timeouts for heavy .fig fixture tests

The beforeAll timeout helped but individual test() calls also need
explicit 30s timeouts since bun:test applies the 5s default per-test.
Fixes remaining CI flakes in glyph-blob roundtrip and clipboard
roundtrip tests.

* test: increase beforeAll timeout for render cache test

The canvas/render cache test loads gold-preview.fig AND initializes
CanvasKit (Skia WASM), which is much slower than the other fixture
tests. Use 60s timeout to account for slow CI runners.

* fix(export): reserve document GUID to prevent 0:0 namespace collision

- Add docGuid (0:0) to assignedGuidValues before processing imported
  node source.ids, preventing an imported node with source.id "0:0"
  from reusing the document's GUID slot
- Add regression test using session-0 source.ids to verify nodes
  survive roundtrip without document GUID collision
- Remove unnecessary async keyword from synchronous component
  metadata test

* fix(export): guard canvas GUID reuse with assignedGuidValues check

- Mirror getOrCreateNodeGuid() collision logic in buildCanvasEntries():
  if an imported page's source.id maps to a GUID already in
  assignedGuidValues, generate a fresh counter-based GUID instead
- Prevents canvas-level last-write-wins when multiple pages share
  the same source.id or a page uses 0:0

* fix(test): use explicit little-endian writes and fix misleading test title

- Replace host-endian Uint32Array writes with DataView.setUint32(offset, value, true) in parse-failures.test.ts to ensure platform-independent fig-kiwi container assembly
- Rename test title from "clone clears source.id from the original" to "clone clears source.id from the clone" to accurately reflect what the assertions verify

* test(io): use file-level timeout for heavy fixture

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Danila Poyarkov <dev@dannote.net>
2026-06-23 18:05:23 +03:00
Yang Borui 9f59c35257
fix(i18n): correct translation of the duplicate command in zh-CN
The `commands.duplicate` action was previously translated as "复制" (Copy) in `zh-CN.json`, identically to the native `menu.copy` action. This caused the context menu to display two identical "复制" options, creating confusion about which action copies to the clipboard and which one clones the object directly on the canvas.

    This commit updates the translation of `commands.duplicate` to "克隆" (Clone) to accurately reflect its behavior and clearly distinguish it from the native clipboard copy command.
2026-06-19 23:55:04 +08:00
Joseph Cumines 99e4153ec5 test(tools): create control-case node on the plain graph
CodeRabbit found the RotatedPlain control node was created on
instead of , so the unstroked control assertion was not actually
validating the same setup without a stroke.
2026-06-19 11:47:37 +10:00