Commit graph

148 commits

Author SHA1 Message Date
Danila Poyarkov 346d13c405 feat(dom-css): map image aspect styles 2026-06-30 10:51:37 +03:00
Danila Poyarkov 3c04249124 feat(dom-css): map dashed border styles 2026-06-30 10:51:05 +03:00
Danila Poyarkov ce1bcb3434 test(app): cover Code panel import errors 2026-06-30 10:51:05 +03:00
Danila Poyarkov 3f1a5ce779 feat(dom-css): map browser text casing 2026-06-30 10:51:05 +03:00
Danila Poyarkov 7f99431981 feat(app): import DOM/CSS from code panel 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 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 5b61c1bf46 test(dom-css): expand fixture matrix 2026-06-30 10:47:26 +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
rcoenen 33f53324f7
feat(export): persist per-node export settings
* fix(ui): anchor AppSelect dropdown to its trigger

AppSelect wraps its SelectTrigger inside <Tip> (a TooltipTrigger
as-child). reka-ui's Select popper captures its trigger element via
useForwardExpose on mount, but that capture resolves to null when the
trigger sits inside another primitive's as-child slot. With no anchor,
floating-ui positioned the menu at the viewport origin and flipped it
off-screen (~y:-412), so clicking the dropdown appeared to do nothing.

Wrap the trigger in a layout-neutral span, keep the styled <Tip>
tooltip, and pass that span to SelectContent's `reference` prop so the
popper anchors explicitly on every open (PopperContent prefers
props.reference over the broken auto-capture, and re-reads it on each
open/reopen).

Fixes every dropdown built on AppSelect across the inspector (export
scale/format, typography, effects, stroke, flex/grid layout, variants,
fills, gradients, color format).

Verified live: menu opens directly below the trigger, fully on-screen,
across repeated open/select/reopen cycles; tooltip still shows.

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

* feat(export): editable custom scale with 1024x cap

The export scale was a preset-only dropdown (0.5x–4x). Make it Figma-like:
an editable field where you can type any multiplier (e.g. 9x, 1.5x) in
addition to picking a preset from the chevron menu. Custom values are used
as-is and are never added to the preset list.

Typed input is clamped to [0.01x, 1024x] — an unbounded multiplier would
allocate an enormous canvas and crash the renderer. The clamp lives in the
export data model (clampExportScale, applied in updateScale) so it defends
every caller, and is reused by the input for immediate display feedback
(9999999 -> 1024x, 0.0000001 -> 0.01x). Invalid/zero input reverts.

New ExportScaleInput.vue pairs a text input with a reka DropdownMenu for
presets (mirrors ZoomDropdown; not wrapped in <Tip>, so it positions
correctly). The active preset shows a checkmark.

Verified live across custom entry, clamping (both bounds), decimals,
invalid input, and preset selection.

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

* feat(export): store export settings per node

Export settings were global and transient: every selection showed a
default 1x PNG row, and nothing was remembered per layer or persisted
with the document.

Store export settings on each SceneNode (exportSettings: ExportSetting[]),
defaulting to empty so the panel shows only its header and add button
until the user adds a row. Settings apply across multi-select and target
the current page when nothing is selected; add/edit/remove are undoable.

Persist settings with the document via open-pencil pluginData in .fig
(lossless, including webp). On import, prefer app pluginData; otherwise
map native Figma exportSettings (PNG/JPEG/SVG/PDF + content scale) without
overwriting raw native fields on re-export.

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

* fix(export): working format dropdown, JPG/WEBP export, and zip bundling

- Anchor AppSelect dropdown via native title so the format selector is
  clickable in multi-row export panels (was rendering off-screen)
- Add a browser-canvas encode fallback on the renderer for JPG/WEBP, which
  CanvasKit's encodeToBytes returns null for in this build (fixes the
  "Nothing to export" error)
- Bundle multi-format exports into a single zip; a single export still
  downloads the file directly
- Default each added export row to 2x the previous scale (1x -> 2x -> 4x)
- Add e2e coverage for the multi-row dropdown, zip bundling, and direct
  single-file download

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

* revert(export): drop AppSelect native-title workaround, superseded by #325

The shared <Tip> path is now handled generally by #325; #321 should not carry
the AppSelect change. Reverts src/components/ui/AppSelect.vue to master.

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

* fix(export): address review feedback (#321)

- Clear raw native exportSettings when the user edits/clears export rows so they
  don't resurrect from the import fallback on reopen (scene-graph/source-metadata).
- Clamp export scale at the .fig import boundary (plugin + native CONTENT_SCALE),
  not just in the UI; centralize the bounds in core/scene-graph/export-scale and
  reuse them from the vue helpers (single source of truth).
- Export the rows the panel shows (activeSettings) for every target so a
  multi-selection is WYSIWYG — no hidden rows export, and the "mixed" notice shows
  whenever targets diverge.
- Sanitize zip entry names (strip separators, parent refs, control chars) so layer
  names can't escape or corrupt the archive.
- Verify toDataURL() honored the requested MIME in the JPEG/WEBP fallback; reject a
  silent PNG so we never write PNG bytes under a .jpg/.webp extension.

Add regression tests for the native-settings clear and import-scale clamp.

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 20:05:34 +03:00
Danila Poyarkov c4e21af7ee
fix(ui): keep tooltips on floating triggers 2026-06-06 11:31:24 +03:00
박영호 ee2a7472ee
fix(text): handle Hangul IME composition (#319)
Co-authored-by: 05Park <im0505@kakao.com>
2026-06-06 07:21:56 +03:00
Danila Poyarkov 70a6c86da6 test(canvas): cover outlined complex text fills 2026-05-30 12:49:27 +03:00
Danila Poyarkov 94dd6cf3aa fix(canvas): tune Figma pattern origin 2026-05-26 21:21:49 +03:00
Danila Poyarkov c1532610db fix(canvas): tighten Figma text and pattern fidelity 2026-05-26 18:30:08 +03:00
Danila Poyarkov b95943697a test(canvas): cover pattern fill visuals 2026-05-26 17:41:36 +03:00
Danila Poyarkov b3570cb588 test(canvas): cover text decoration visuals 2026-05-26 15:34:05 +03:00
Danila Poyarkov abd795bd9a chore: format codebase 2026-05-24 12:15:29 +03:00
Danila Poyarkov 8c85d2b953 fix(canvas): improve Figma mask and text fidelity 2026-05-23 00:18:33 +03:00
Danila Poyarkov 5b12b1597f test(canvas): make luminance tile fixture visible 2026-05-22 23:55:20 +03:00
Danila Poyarkov ea08ea1370 test(canvas): cover luminance masks and tile transforms 2026-05-22 23:52:47 +03:00
Danila Poyarkov f8db73949e test(canvas): cover renderer showcase visuals 2026-05-22 23:24:26 +03:00
Danila Poyarkov e65d53c9d3 test(canvas): add visual blend and mask fixtures 2026-05-22 23:13:46 +03:00
Danila Poyarkov ad0b984057 test(canvas): cover smoothed corner visuals 2026-05-22 23:09:55 +03:00
Danila Poyarkov 3a85632f38 refactor(ui): localize tooltip labels 2026-05-19 15:41:38 +03:00
Danila Poyarkov 8cb6d008fc fix(ai): allow custom OpenRouter models 2026-05-19 15:10:32 +03:00
Danila Poyarkov 83af1453d8 fix(fonts): load Google font previews 2026-05-19 13:02:15 +03:00
Danila Poyarkov 59550c1c07 fix(fonts): restore font picker selection 2026-05-19 12:52:11 +03:00
Danila Poyarkov f3649550f2 chore: enable stricter oxlint rules 2026-05-18 18:58:30 +03:00
Danila Poyarkov a4d4cf1bee fix(canvas): switch edited text on click 2026-05-17 20:49:25 +03:00
Danila Poyarkov a535c6be8a fix(canvas): edit nested text on drill double-click 2026-05-17 20:46:13 +03:00
Danila Poyarkov 28f7ef165b feat(text): wrap styled outline text 2026-05-17 20:23:55 +03:00
Danila Poyarkov 1c8fe1ee8b feat(editor): add outline stroke command 2026-05-17 20:18:14 +03:00
Danila Poyarkov 655f4fcb89 test(ui): cover boolean outline menu placement 2026-05-17 20:09:53 +03:00
Danila Poyarkov 197e19b6f4 test(e2e): cover live move repaint and component labels 2026-05-17 02:11:04 +03:00
Danila Poyarkov 7cfa08aec5 fix(clipboard): normalize glyph advance by fontSize
Figma expects derivedTextData glyph advance values normalized to
font-size units (advance / fontSize), not absolute pixel values.
This caused pasted text to appear horizontally mirrored because
Figma multiplied the already-absolute advances by fontSize again.
2026-05-16 18:02:10 +03:00
Danila Poyarkov 680350cdcb test(e2e): extract shared editor setup and store helpers
- useEditorSetup() / useEditorSetupWithClear() in tests/e2e/fixtures.ts
- Migrated 15 simple specs to shared fixture
- Moved getSelectedNode/getSelectedNodes to tests/helpers/store.ts
- Replaced inline getSelectedNode in 4 specs
- Reverted 8 specs with custom beforeAll setup (not fixture-compatible)
- Test duplication in tests/: 329 → 307 clones (10.12% → 8.95%)
2026-05-16 16:55:34 +03:00
Danila Poyarkov 11e38b626a test(e2e): extract shared editor setup fixture
- useEditorSetup() / useEditorSetupWithClear() in tests/e2e/fixtures.ts
- Migrated 17 specs to shared fixture, removing ~300 lines of boilerplate
- Moved getSelectedNode/getSelectedNodes to shared store helpers
- Replaced inline getSelectedNode in 4 specs with shared import
- Test duplication: 329 → 308 clones (10.12% → 9.08%)
2026-05-16 16:19:03 +03:00
Danila Poyarkov 23583525f5 test(e2e): hide rulers in visual regression snapshots
- Add &no-rulers to all E2E test URLs that use &no-chrome
- Regenerate snapshots without ruler ticks/selection badges
- Remove stale snapshot dirs from old test paths
2026-05-16 15:36:37 +03:00
Danila Poyarkov 698bcde00b refactor(vue): share generated test id helpers 2026-05-15 13:10:44 +03:00
Danila Poyarkov 6b406002dd test(e2e): remove remaining raw test id strings 2026-05-15 13:02:41 +03:00
Danila Poyarkov 1583181d3a test(e2e): remove raw test id selectors 2026-05-15 12:55:01 +03:00
Danila Poyarkov 2f94ce6510 test(e2e): use Playwright test id locators 2026-05-15 12:49:49 +03:00
Danila Poyarkov b46295a7bb fix(editor): close padding editor on canvas click 2026-05-15 11:49:18 +03:00
Danila Poyarkov 031897c73a test(editor): cover auto-layout padding editor 2026-05-14 22:37:16 +03:00
Danila Poyarkov 686ca5326f chore: enforce Vue style and state boundaries 2026-05-14 22:05:43 +03:00