Commit Graph
494 Commits
Author SHA1 Message Date
Timo Klerx 41ee2d7e92 Merge branch 'main' of https://github.com/storytold/figcraft into codex/fig-import-confirmation
# Conflicts:
#	crates/engine/src/cmd/file/load.rs
#	docs/file-format-parity.md
2026-11-29 13:33:22 +01:00
Timo Klerx 3b0e091f98 Merge branch 'main' into codex/fig-import-confirmation 2026-11-29 12:36:58 +01:00
Jindřich ŠaršonandClaude Opus 5.5 071fe03776 Merge main: image averaging after #2673
#2673 draws an image shown at half its size or less from a filtered,
halved copy. The per-pixel area average from this branch now applies to
that copy below half size and to the image itself above it; the export
test of the average across fractional positions moves to 0.625 of the
image's size, where no copy is made (it still fails without the
average). Test fixtures build text through Shared<TextData> (#1819).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-29 10:44:55 +01:00
BFlat 01a6c0e08d Merge pull request #2716 from brytoncooper/feat/fig-fidelity-harness-and-tail
M6: .fig import tail (table cells, connector label pill) and fidelity/visual-diff harness
2026-11-29 08:02:48 +07:00
FredApps 9016174dbd Web size: address review: native-only gate tests, and no plugin recents in the browser version (#2720) 2026-11-28 23:42:43 +01:00
FredApps f69cba48f1 Web size: leave camera raw development and the plugin runtime out of the browser version (#2720)
The browser version still recognises camera raw files and says they open in the desktop app
only; its pickers don't offer them. The Plugins menu, the plugin palette rows and the plugin
commands are hidden there, and running a plugin says it needs the desktop app. Native builds
are unchanged.
2026-11-28 22:57:54 +01:00
Bryton Cooper f260f8b9ac fix(format): count only page-reachable layers in fidelity and preserve narrow terminal table tracks 2026-11-28 12:50:28 -07:00
Bryton CooperandClaude Opus 5.5 1157a843f8 fig: snap table cells to their grid, pill fallback connector labels, add a fidelity harness
Import tail (docs/gaps.md Gap 1), as FigCraft-side passes over the mapped
REST JSON in crates/format/src/fig/map.rs (the craft-fig mapper is pinned
and unchanged):

- A connector label without a saved snapshot gets a white, fully rounded
  stand-in pill centred under it, padded by the font size, within the layer
  budget (labels past it stay bare under the mapper's original note).
- TABLE cells are put back on the table's grid from their own geometry:
  offsets within 2 px share a track, a sizeless or misaligned cell takes its
  row and column, and no two cells overlap. Fills, strokes and text are kept.
  Rotated, non-finite, colliding or oversized tables keep their saved bounds
  with a warning. No row or column fields of the file are read.
- The new import notes are counted like the mapper's (`note (×n)`) and
  have English keys in crates/ui-egui/locales/en.toml.
- Vector-region style and variable links were already resolved with a
  fall-back to the region's own paint; no change.

Fidelity harness (Gap 3), no new dependencies:

- fig::fidelity: compare_documents (layer counts, box L-infinity error,
  text/fill/stroke/opacity match rates, warnings) and compare_rgba (SSD,
  RMSE, PSNR, luminance SSIM, channels past a tolerance), with JSON and
  Markdown scorecards.
- fidelity_tests: metric properties, a built-in corpus that round-trips
  through .fig with every layer matched and no new warnings, and an ignored
  FIGCRAFT_FIG_CORPUS runner for local real files.
- render: a multi-layer scene drawn before and after a .fig round trip is
  compared with compare_rgba (SSIM > 0.99; measured identical).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 11:53:20 -07:00
Timo Klerx 957d255641 fix(import): offer a bounded retry for large .fig files 2026-11-28 17:29:35 +01:00
bflatastic ba151a7087 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
2026-11-28 21:16:34 +07:00
bflatastic c3e87801b8 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-28 20:28:50 +07:00
bflatastic 9ae491f9ea Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	ROADMAP.md
#	docs/components-parity.md
2026-11-28 20:28:39 +07:00
bflatastic 5ec442a94b Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-28 19:03:34 +07:00
Bryton CooperandClaude Opus 5.5 96a2067684 figcraft-cli: --strict on export, convert and run; .fig fill outline per winding rule (#2384)
`export`, `convert` and `run --out` take `--strict`. When the .fig,
.penpot or Android Vector Drawable writer reports anything left out or
changed, nothing is written or replaced and the command exits 1 with the
reasons on the error line. A folder of drawables is written only once
none of its files leaves anything out. `--strict` with an output whose
writer reports nothing (png, svg, pdf, ...) or with `--vd-compat ignore`
is a usage error (exit 2), so it never passes without checking anything.
A .figcraft output is accepted for convert and run: it keeps everything.

.fig export writes a vector whose filled areas use both winding rules as
one fillGeometry path per rule, so other readers fill each area as the
network does. The warning that the outline used the first area's rule is
gone.

Image adjustments, list spacing, hanging punctuation and lists, and
vertical trim were already written on main. OpenType features,
variables' publishing, code syntax and inheritance settings, prototype
device settings and text styles on part of a text keep their warnings:
the .fig import (craft_fig's mapping at the pinned craft-libs rev) does
not read them back, so they cannot round-trip yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 04:37:07 -07:00
BFlat 5135b3c4b9 Merge pull request #2177 from victorazesc/codex/native-corner-styles
M4: editable chamfered and concave corners
2026-11-28 18:25:31 +07:00
bflatastic 8750ba81bb M9: .jam import: connectors on the page come in as board connectors attached to what they join (#1808)
A whiteboard file's connectors came in as loose vectors, so moving a
shape left them behind. On a whiteboard the mapper's adapter now writes
a board connector on each connector drawn as one line on the page: its
ends name the layers it joins (a named magnet is that side, an automatic
one the side facing the other end, an end without a magnet keeps its
point on the layer) or a free page point, with its routing. The REST
importer makes the vector a native board connector once every layer is
in, so the board routes it again when what it joins moves. The import
report counts only the connectors that stayed vectors. Labelled
connectors, connectors inside frames and connectors in design files are
unchanged.
2026-11-28 18:16:03 +07:00
bflatastic 225d6810bb M7: variables export and import as DTCG design tokens (#1687)
variable.export {format: "dtcg", mode?} writes a group per collection and
a token per variable, nested by the parts of its name: colours as
colorSpace/components objects, numbers as px dimensions or plain numbers
where they are used unitless, aliases as {group.token}, colour
calculations as the colour they show. Strings, booleans, every mode's
value and scopes go under $extensions, so the file reads back whole;
`mode` picks the mode written as $value. Variables > Export offers it,
saved as .tokens.json.

variable.import reads a file holding a $value as tokens: top-level groups
are collections, types are handed down from groups, and color, dimension
(px, rem at 16 px), number, fontWeight, duration, fontFamily, strings,
booleans and aliases become variables, merged as the variables JSON is.
A plain file fills the default mode of the same-named collection.
Composite tokens are skipped and counted in the warnings.
2026-11-28 18:08:53 +07:00
bflatastic 2cd906ddd8 Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	crates/format/Cargo.toml
2026-11-28 17:32:22 +07:00
bflatastic 2d7370017c Merge remote-tracking branch 'origin/main' into HEAD 2026-11-28 17:26:19 +07:00
bflatastic 86092cddda Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	contributors/people.toml
2026-11-28 15:45:40 +07:00
Bryton Cooper d9deec7b12 perf(doc): share TextData and VectorNetwork copy-on-write via Shared<T> (#1819) 2026-11-28 01:27:27 -07:00
BFlat dbe9eeb1bd Merge pull request #2607 from Utakata/feat/open-camera-raw
format: open camera raw files as their developed picture
2026-11-28 15:06:51 +07:00
bflatastic 95b2fc41f9 Build the export test's corners from the default so the new style field is set 2026-11-28 14:57:14 +07:00
FredApps 3660125b8d Merge branch 'main' into pr-fig-slot-export 2026-11-28 08:01:56 +01:00
FredApps add4e27b4b Merge branch 'main' into codex/native-corner-styles
The ring stroke moved into draw::ring on main; its round-corner guard keeps this
branch's corner-style check. pt-BR.toml goes back to main's: translations are
added in storytold/craft-i18n, and this branch had renamed "Individual corners"
to "Ajustes da borda" (edge settings).
2026-11-28 07:47:21 +01:00
FredApps b6469cd439 Merge branch 'main' into formats/penpot-craft-zip-9-8-2 2026-11-28 07:46:25 +01:00
FredApps 4561b31166 Merge branch 'main' into feat/open-camera-raw
main's craft-libs pin (8fa4db64) already contains 249a41bd, so the pins stay at
main's and the camera raw crates are added at that same rev.
2026-11-28 07:46:25 +01:00
bflatastic e07c9944eb M4: superscript and subscript per range of characters (text.style textPosition, Type settings while editing, text styles, CSS) (#2338) 2026-11-28 08:06:10 +07:00
Jindřich ŠaršonandClaude Opus 5.5 086e709170 Merge main: export rules through world_render_bounds_with
#2616 measures each exported layer's drawn outlines through
Document::world_render_bounds_with. The export framing from this branch
(drop shadows to their blur radius, layers that draw nothing left out)
now goes through the same callback instead of a separate walk: the
callback returns None for a layer that doesn't count and takes a second
function for what a group's effects add round its children.

#2631's outline shadow path now groups blended drop shadows as the
pixel path does, so two linear-burn shadows darken where they overlap,
not the backdrop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-27 14:23:24 +01:00
bflatastic 75ffff90ec Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	docs/file-format-parity.md
2026-11-27 15:32:56 +07:00
BFlat 848d7b40a4 Merge pull request #2212 from TKlerx/codex/2210-fig-prototype-actions
Preserve variable and conditional prototype actions in .fig exports
2026-11-27 13:47:21 +07:00
UtakataandClaude Opus 5.5 90d2d92430 format: open camera raw files as their developed picture
RW2, CR2, CR3, NEF, ARW, RAF, ORF, DNG and the other containers craft-raw
decodes now open, import, place and fill shapes. add_image develops a raw
once with craft-develop's stages (AHD demosaic, highlight rebuild, as-shot
white balance and colour matrices, neutral tone curve, sRGB, orientation)
and the document keeps the picture as a quality 95 JPEG, so every way an
image comes in takes raws. file.open and the Open, Import, Place and image
fill dialogs know the raw extensions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 04:34:49 +09:00
Dylan M. Taylor 47f1e70d67 Use ZIP 9.8.2 for FigCraft test fixtures
Covers the dependency bump from #1602 using current fixture APIs and adds a normal CP437 ancillary-member regression.
2026-11-23 20:24:33 -05:00
Dylan M. Taylor 91eb2fc2ab Read Penpot archives through craft-zip 2026-11-23 20:24:33 -05:00
Terra854 bbf7ad418f format: resolve Penpot media IDs per file (#2538) 2026-11-21 23:48:49 -05:00
Terra854 9e802f2c21 format: read Sketch previews through shared ZIP (#2552)
* format: read Sketch previews through shared ZIP

* Credits: add Terra854 to About
2026-11-21 23:48:46 -05:00
Terra854 b7815587b6 format: retain 16-bit precision when shrinking recent thumbnails (#2559)
* format: retain 16-bit precision when shrinking recent thumbnails

* format: prevent overflow in 16-bit thumbnail averages
2026-11-22 11:40:31 +07:00
Dylan M. Taylor 5c2a378494 format: share PNG pHYs reader via craft-image-codecs (craft-libs#785) (#2547) 2026-11-21 13:28:27 -05:00
Jindřich ŠaršonandClaude Opus 5.5 bb2ecfb170 M6: REST import reads opentypeFlags as the API writes it
Figma's REST API names a text's feature toggles style.opentypeFlags; the
importer looked for openTypeFlags, so features in real files (SF Pro's
SS16 large symbols on an iOS kit's back chevron) were dropped. The old
spelling is still read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-21 00:09:21 +01:00
Jindřich ŠaršonandClaude Opus 5.5 d5a0d71690 M6: imported variant properties bound to a mode variable pick their variant
A design kit's Light/Dark components switch variant through a `Mode`
string variable bound to the variant property. Imports dropped that:
dark screens showed the light variants.

- REST import reads boundVariables.componentProperties (variant, text
  and boolean properties) as componentProperties/<name> bindings.
- An opened REST or .fig file settles them: each bound instance shows
  the variant the variable names in its mode, outer instances first,
  keeping its own overrides and the ones the mains around it make.
- A text reads a property its instance sets even when the variant set
  lists it under another id (imported library copies do).

.fig needs craft-libs craft-fig with the RESOLVE_VARIANT mapping (local
commit edcc9d6d3). On a real-world iOS kit file: dark alerts 28%/20% and
the dark keyboard 38% differing pixels -> 2%, 1.4%, 1.7%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012eBDgsvRwsSRpWeWrzabVY
2026-11-21 00:09:21 +01:00
Dylan M. Taylor 390e5f4e4b format: cut over thumbnail decode and image dimension probing to craft-image-codecs (#2528) 2026-11-20 14:22:20 -05:00
Dylan M. Taylor 8320b6699e render,format: finish craft-image-codecs cutover and ICC/GIF/bounds parity tests (#2526) 2026-11-20 13:02:48 -05:00
Dylan M. Taylor 9b04f4c99e cutover: use craft_jpeg::finer_than_first (#2478) 2026-11-18 19:10:44 -05:00
bflatastic a88580470b M6: REST import reports node-level paint and effect bindings only when something is lost (#2441) 2026-11-19 03:42:03 +07:00
Trevor Brown 6b625a0d46 M6: .fig export writes ruler guides (#2336) (#2337)
The change from #2337 by @TrevorBrown-dev, as one commit.
2026-11-19 01:28:57 +07:00
BFlat c7f0ad195c Merge pull request #2449 from Hamza0101/fix/rest-stroke-side-variables
REST import: variables bound to stroke sides bind each side's weight
2026-11-18 19:19:51 +07:00
Trevor Brown d494fad166 M2: Fill across a hugging axis takes the line, as Figma does
In a hugging parent, Fill on the other axis follows the line the way
Figma does, instead of forcing the parent Fixed. This also covers item 2
of #2090 on both axes: a hugging main that becomes Fixed is followed by
its instances' roots.

Fixes #2091 item 3. Fixes #2034. Fixes item 2 of #2090.
2026-11-18 18:31:20 +07:00
Hamza 11b896699f REST import test: the spec's four side names each bind a variable of their own 2026-11-18 16:24:41 +05:00
Hamza d7fcbf94ca REST import test: each of Card's sides is bound to a variable of its own
So a side read into another side's field fails the test (review).
2026-11-18 15:57:39 +05:00
Hamza d332c18a2c REST import: variables bound to stroke sides bind each side's weight (#2441)
boundVariables.individualStrokeWeights was skipped with a warning, so a 1 px bottom divider bound to a variable came across as a plain number. Each side now binds strokeTopWeight ... strokeLeftWeight, read from the live API's BORDER_TOP_WEIGHT ... keys or the published spec's top ... keys.
2026-11-18 15:44:42 +05:00