Merge main into #1648

This commit is contained in:
bflatastic
2026-10-30 19:11:02 +07:00
30 changed files with 128 additions and 8 deletions
+2 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -34,6 +34,8 @@ mod map;
mod missing_image_tests;
mod network;
#[cfg(test)]
mod paste_style_tests;
#[cfg(test)]
mod prop_value_tests;
#[cfg(test)]
mod slot_tests;
+4 -1
View File
@@ -347,7 +347,10 @@ impl<'a> Mapper<'a> {
/// the reference has neither or the asset names nothing (or ambiguously) in the file.
/// Original code for this importer: the field names are those of the schema each file embeds.
fn resource_id(&self, v: &Kv) -> Option<String> {
if let Some(g) = v.get("guid").and_then(guid).filter(|g| *g != NO_STYLE) {
// A guid names the resource when this file holds a node by it. One from another file (the
// library a style or collection came from, as a paste carries) names nothing here: the
// asset it also names finds the file's copy (#1638).
if let Some(g) = v.get("guid").and_then(guid).filter(|g| *g != NO_STYLE && self.nodes.contains_key(g)) {
return Some(g);
}
let asset = v.get("assetRef")?;
+10 -3
View File
@@ -33,10 +33,17 @@ impl<'a> Mapper<'a> {
/// The style node a layer links in `key` (or the older `legacy` field), recorded for the REST
/// `styles` map under `slot`.
/// A link to a style the file doesn't hold leaves the layer its own values (the colours it
/// stored with it), with a note.
pub(super) fn style(&mut self, v: &View<'a>, key: &str, legacy: &str, slot: &str, out: &mut Obj) -> Option<&'a Kv<'a>> {
let id = self.style_link(v, key, legacy)?;
let node = *self.nodes.get(&id)?;
node.get("styleType").and_then(Kv::str)?;
let found = self.style_link(v, key, legacy).and_then(|id| Some((self.nodes.get(&id).copied()?, id)));
let Some((node, id)) = found.filter(|(n, _)| n.get("styleType").and_then(Kv::str).is_some()) else {
let named = |l: &Kv| l.get("assetRef").is_some() || l.get("guid").and_then(guid).is_some_and(|g| g != NO_STYLE);
if v.get(key).is_some_and(named) || v.get(legacy).and_then(guid).is_some_and(|g| g != NO_STYLE) {
self.warn("links to shared styles that aren't in the file kept the layers' own values");
}
return None;
};
out.insert(slot.into(), json!(id));
if !self.styles.contains_key(&id) {
let name = node.get("name").and_then(Kv::str).unwrap_or("Style");
@@ -0,0 +1,82 @@
//! Layers pasted from another design app whose paints come from a shared paint style (#1638): the
//! clipboard links the style by the guid it has in the library it came from, which this payload
//! doesn't hold, and by its library asset, whose copy it does hold. The layers (a component's
//! glyph and the same glyph in an instance of it) take the style's colour and stay linked to it.
//! A link to a style the payload doesn't hold at all keeps the colour stored with the layer, with
//! a note. Built in code and read as `edit.pasteDesignLayers` reads a clipboard's design data.
use figcraft_doc::{Document, Node};
use super::kiwi::Kv;
use super::tests::{arr, canvas, e, g, node, o, s, schema, solid, xy};
use super::try_import;
/// A style link by `guid` (absent from the payload) and, given, the library asset `key`.
fn link(guid: u64, asset: Option<&str>) -> Kv<'static> {
let mut fields = vec![("guid", g(guid))];
if let Some(key) = asset {
fields.push(("assetRef", o(vec![("key", s(key)), ("version", s("7"))])));
}
o(fields)
}
/// The pasted payload: on the internal page, the file's copy of library style "Red" (#FF4040);
/// on the page, component "Icon" whose "Glyph" stores stale black and links the style, an
/// instance of it, and "Lost", which stores #1F1F1F and links a style the payload doesn't hold.
fn pasted() -> (Document, Vec<String>) {
let nodes = vec![
node(0, None, "DOCUMENT", "Document", vec![]),
node(1, Some((0, "!")), "CANVAS", "Page", vec![]),
node(2, Some((0, "~")), "CANVAS", "Internal", vec![("internalOnly", Kv::Bool(true))]),
node(
10,
Some((2, "!")),
"RECTANGLE",
"Red",
vec![("styleType", e("FILL")), ("key", s("lib-red")), ("version", s("7")), ("fillPaints", arr(vec![solid(1.0, 0.25, 0.25)]))],
),
node(20, Some((1, "!")), "SYMBOL", "Icon", vec![("size", xy(24.0, 24.0))]),
node(
21,
Some((20, "!")),
"RECTANGLE",
"Glyph",
vec![("size", xy(16.0, 16.0)), ("fillPaints", arr(vec![solid(0.0, 0.0, 0.0)])), ("styleIdForFill", link(99, Some("lib-red")))],
),
node(30, Some((1, "\"")), "INSTANCE", "Icon copy", vec![("size", xy(24.0, 24.0)), ("symbolData", o(vec![("symbolID", g(20))]))]),
node(
40,
Some((1, "#")),
"RECTANGLE",
"Lost",
vec![("size", xy(16.0, 16.0)), ("fillPaints", arr(vec![solid(0.12, 0.12, 0.12)])), ("styleIdForFill", link(98, None))],
),
];
let bytes = canvas(&schema(), &o(vec![("nodeChanges", arr(nodes))]));
try_import(&bytes, "Pasted layers").expect("design data").expect("it imports")
}
fn fill_hex(n: &Node) -> Option<String> {
n.fills.first()?.solid_color().map(|c| c.to_hex())
}
#[test]
fn a_library_paint_style_colours_the_component_and_its_instance() {
let (doc, _) = pasted();
let glyphs: Vec<&Node> = doc.nodes().filter(|n| n.name == "Glyph").collect();
assert_eq!(glyphs.len(), 2, "the component's glyph and the instance's");
for glyph in glyphs {
assert_eq!(fill_hex(glyph).as_deref(), Some("FF4040"), "the style's colour, not the stale black");
let style = glyph.styles.fill.as_deref().and_then(|id| doc.style(id)).expect("linked to the style");
assert_eq!(style.name, "Red");
}
}
#[test]
fn a_style_the_paste_doesnt_hold_keeps_the_stored_colour() {
let (doc, warnings) = pasted();
let lost = doc.nodes().find(|n| n.name == "Lost").unwrap();
assert_eq!(fill_hex(lost).as_deref(), Some("1F1F1F"), "the colour stored with the layer, not black");
assert!(lost.styles.fill.is_none());
assert!(warnings.iter().any(|w| w.contains("shared styles that aren't in the file")), "{warnings:?}");
}
+1 -1
View File
@@ -59,7 +59,7 @@ message TextData string characters, uint[] characterStyleIDs, NodeChange[] style
message Path WindingRule windingRule, uint commandsBlob
message GUIDPath GUID[] guids
message SymbolData GUID symbolID, NodeChange[] symbolOverrides
message StyleId GUID guid
message StyleId GUID guid, AssetRef assetRef
message PropValue bool boolValue, TextData textValue
message PropDef GUID id, string name, PropValue initialValue, PropType type
message PropAssignment GUID defID, PropValue value
+1
View File
@@ -1732,6 +1732,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "وُضعت الطبقات التي ليس لها موضع عند نقطة أصل العنصر الأب"
"layers without a type were skipped" = "تم تخطي الطبقات التي ليس لها نوع"
"legacy image filter container is unsupported; filter conversion was skipped" = "حاوية مرشحات الصورة القديمة غير مدعومة؛ تم تخطي تحويل المرشحات"
"links to shared styles that aren't in the file kept the layers' own values" = "احتفظت الروابط إلى أنماط مشتركة غير موجودة في الملف بقيم الطبقات نفسها"
"locked" = "مقفل"
"malformed image filters container was skipped" = "تم تخطي حاوية مرشحات الصورة غير السليمة"
"malformed image paintFilter container was skipped" = "تم تخطي حاوية paintFilter غير السليمة للصورة"
+1
View File
@@ -1674,6 +1674,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "অবস্থান ছাড়া লেয়ারগুলো তাদের প্যারেন্টের মূল অবস্থানে রাখা হয়েছে"
"layers without a type were skipped" = "ধরন ছাড়া লেয়ারগুলো বাদ দেওয়া হয়েছে"
"legacy image filter container is unsupported; filter conversion was skipped" = "লিগ্যাসি ইমেজ ফিল্টার কন্টেইনার অসমর্থিত; ফিল্টার রূপান্তর বাদ দেওয়া হয়েছে"
"links to shared styles that aren't in the file kept the layers' own values" = "ফাইলে নেই এমন শেয়ার করা স্টাইলের লিংক থাকা লেয়ারগুলো নিজেদের মান রেখেছে"
"locked" = "লক করা"
"malformed image filters container was skipped" = "ত্রুটিপূর্ণ ইমেজ ফিল্টার কন্টেইনার বাদ দেওয়া হয়েছে"
"malformed image paintFilter container was skipped" = "ত্রুটিপূর্ণ ইমেজ paintFilter কন্টেইনার বাদ দেওয়া হয়েছে"
+1
View File
@@ -1639,6 +1639,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "vrstvy bez pozice byly umístěny do počátku nadřazeného prvku"
"layers without a type were skipped" = "vrstvy bez typu byly přeskočeny"
"legacy image filter container is unsupported; filter conversion was skipped" = "starší kontejner filtrů obrázku není podporován; převod filtrů byl přeskočen"
"links to shared styles that aren't in the file kept the layers' own values" = "odkazy na sdílené styly, které v souboru nejsou, ponechaly vrstvám jejich vlastní hodnoty"
"locked" = "zamknuté"
"malformed image filters container was skipped" = "poškozený kontejner filtrů obrázku byl přeskočen"
"malformed image paintFilter container was skipped" = "poškozený kontejner paintFilter obrázku byl přeskočen"
+1
View File
@@ -1599,6 +1599,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "Ebenen ohne Position wurden am Ursprung ihres übergeordneten Elements platziert"
"layers without a type were skipped" = "Ebenen ohne Typ wurden übersprungen"
"legacy image filter container is unsupported; filter conversion was skipped" = "der veraltete Bildfiltercontainer wird nicht unterstützt; die Filterumwandlung wurde übersprungen"
"links to shared styles that aren't in the file kept the layers' own values" = "Verweise auf gemeinsame Stile, die nicht in der Datei sind, behielten die eigenen Werte der Ebenen"
"locked" = "gesperrt"
"malformed image filters container was skipped" = "fehlerhafter Bildfiltercontainer wurde übersprungen"
"malformed image paintFilter container was skipped" = "fehlerhafter paintFilter-Container des Bildes wurde übersprungen"
+1
View File
@@ -1754,6 +1754,7 @@ name = "English"
"layers without a type were skipped" = "layers without a type were skipped"
"legacy image filter container is unsupported; filter conversion was skipped" = "legacy image filter container is unsupported; filter conversion was skipped"
"linked vector region fill styles keep resolved appearance; live style links were left out" = "linked vector region fill styles keep resolved appearance; live style links were left out"
"links to shared styles that aren't in the file kept the layers' own values" = "links to shared styles that aren't in the file kept the layers' own values"
"locked" = "locked"
"malformed image filters container was skipped" = "malformed image filters container was skipped"
"malformed image paintFilter container was skipped" = "malformed image paintFilter container was skipped"
+1
View File
@@ -1720,6 +1720,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "las capas sin posición se colocaron en el origen de su elemento padre"
"layers without a type were skipped" = "se omitieron las capas sin tipo"
"legacy image filter container is unsupported; filter conversion was skipped" = "el contenedor antiguo de filtros de imagen no es compatible; se omitió la conversión de filtros"
"links to shared styles that aren't in the file kept the layers' own values" = "los vínculos a estilos compartidos que no están en el archivo conservaron los valores propios de las capas"
"locked" = "bloqueada"
"malformed image filters container was skipped" = "se omitió el contenedor de filtros de imagen mal formado"
"malformed image paintFilter container was skipped" = "se omitió el contenedor paintFilter de imagen mal formado"
+1
View File
@@ -1679,6 +1679,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "tasot, joilta puuttuu sijainti, sijoitettiin emotasonsa origoon"
"layers without a type were skipped" = "tasot, joilta puuttuu tyyppi, ohitettiin"
"legacy image filter container is unsupported; filter conversion was skipped" = "vanhaa kuvasuodinsäilöä ei tueta; suotimien muunnos ohitettiin"
"links to shared styles that aren't in the file kept the layers' own values" = "linkit jaettuihin tyyleihin, joita tiedostossa ei ole, säilyttivät tasojen omat arvot"
"locked" = "lukittu"
"malformed image filters container was skipped" = "virheellinen image filters -säilö ohitettiin"
"malformed image paintFilter container was skipped" = "virheellinen image paintFilter -säilö ohitettiin"
+1
View File
@@ -1682,6 +1682,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "les calques sans position ont été placés à l’origine de leur parent"
"layers without a type were skipped" = "les calques sans type ont été ignorés"
"legacy image filter container is unsupported; filter conversion was skipped" = "l’ancien conteneur de filtres d’image n’est pas pris en charge ; la conversion des filtres a été ignorée"
"links to shared styles that aren't in the file kept the layers' own values" = "les liens vers des styles partagés absents du fichier ont gardé les valeurs propres des calques"
"locked" = "verrouillé"
"malformed image filters container was skipped" = "le conteneur de filtres d’image mal formé a été ignoré"
"malformed image paintFilter container was skipped" = "le conteneur paintFilter d’image mal formé a été ignoré"
+1
View File
@@ -1643,6 +1643,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "layer tanpa posisi ditempatkan di titik asal induknya"
"layers without a type were skipped" = "layer tanpa tipe dilewati"
"legacy image filter container is unsupported; filter conversion was skipped" = "kontainer filter gambar versi lama tidak didukung; konversi filter dilewati"
"links to shared styles that aren't in the file kept the layers' own values" = "tautan ke gaya bersama yang tidak ada di file mempertahankan nilai lapisan itu sendiri"
"locked" = "terkunci"
"malformed image filters container was skipped" = "kontainer filter gambar yang rusak dilewati"
"malformed image paintFilter container was skipped" = "kontainer paintFilter gambar yang rusak dilewati"
+1
View File
@@ -1617,6 +1617,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "i livelli senza posizione sono stati posti all'origine del loro genitore"
"layers without a type were skipped" = "i livelli senza tipo sono stati saltati"
"legacy image filter container is unsupported; filter conversion was skipped" = "il contenitore di filtri immagine legacy non è supportato; la conversione dei filtri è stata saltata"
"links to shared styles that aren't in the file kept the layers' own values" = "i collegamenti a stili condivisi che non sono nel file hanno mantenuto i valori propri dei livelli"
"locked" = "bloccato"
"malformed image filters container was skipped" = "il contenitore di filtri immagine malformato è stato saltato"
"malformed image paintFilter container was skipped" = "il contenitore paintFilter dell'immagine malformato è stato saltato"
+1
View File
@@ -1663,6 +1663,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "位置のないレイヤーは親の原点に配置"
"layers without a type were skipped" = "タイプのないレイヤーをスキップ"
"legacy image filter container is unsupported; filter conversion was skipped" = "旧形式の画像フィルターコンテナは未対応のため、フィルターの変換をスキップ"
"links to shared styles that aren't in the file kept the layers' own values" = "ファイルにない共有スタイルへのリンクは、レイヤー自身の値を保持しました"
"locked" = "ロック中"
"malformed image filters container was skipped" = "不正な画像フィルターコンテナをスキップ"
"malformed image paintFilter container was skipped" = "不正な画像の paintFilter コンテナをスキップ"
+1
View File
@@ -1700,6 +1700,7 @@ status = "draft — reviewed by a native speaker, awaiting a maintainer's approv
"layers without a position were placed at their parent's origin" = "პოზიციის გარეშე შრეები მშობლის საწყის წერტილში განთავსდა"
"layers without a type were skipped" = "ტიპის გარეშე შრეები გამოტოვებულია"
"legacy image filter container is unsupported; filter conversion was skipped" = "გამოსახულების ფილტრების ძველი კონტეინერი მხარდაუჭერელია; ფილტრების გარდაქმნა გამოტოვებულია"
"links to shared styles that aren't in the file kept the layers' own values" = "ფაილში არარსებულ საერთო სტილებზე ბმულებმა შეინარჩუნეს ფენების საკუთარი მნიშვნელობები"
"locked" = "ჩაკეტილი"
"malformed image filters container was skipped" = "გამოსახულების ფილტრების დაზიანებული კონტეინერი გამოტოვებულია"
"malformed image paintFilter container was skipped" = "გამოსახულების paintFilter-ის დაზიანებული კონტეინერი გამოტოვებულია"
+1
View File
@@ -1590,6 +1590,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "위치가 없는 레이어는 상위 요소의 원점에 배치됨"
"layers without a type were skipped" = "유형이 없는 레이어를 건너뜀"
"legacy image filter container is unsupported; filter conversion was skipped" = "레거시 이미지 필터 컨테이너는 지원되지 않아 필터 변환을 건너뜀"
"links to shared styles that aren't in the file kept the layers' own values" = "파일에 없는 공유 스타일에 대한 링크는 레이어 자체 값을 유지했습니다"
"locked" = "잠김"
"malformed image filters container was skipped" = "잘못된 형식의 이미지 필터 컨테이너를 건너뜀"
"malformed image paintFilter container was skipped" = "잘못된 형식의 이미지 paintFilter 컨테이너를 건너뜀"
+1
View File
@@ -1679,6 +1679,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "lagen zonder positie zijn op de oorsprong van het bovenliggende element geplaatst"
"layers without a type were skipped" = "lagen zonder type zijn overgeslagen"
"legacy image filter container is unsupported; filter conversion was skipped" = "Verouderde container voor beeldfilters wordt niet ondersteund; filterconversie is overgeslagen"
"links to shared styles that aren't in the file kept the layers' own values" = "koppelingen naar gedeelde stijlen die niet in het bestand staan, hielden de eigen waarden van de lagen"
"locked" = "vergrendeld"
"malformed image filters container was skipped" = "misvormde container met afbeeldingsfilters is overgeslagen"
"malformed image paintFilter container was skipped" = "onjuist gevormde image paintFilter-container is overgeslagen"
+1
View File
@@ -1689,6 +1689,7 @@ name = "Polski"
"layers without a position were placed at their parent's origin" = "warstwy bez określonej pozycji zostały umieszczone w punkcie początkowym rodzica"
"layers without a type were skipped" = "warstwy bez typu zostały pominięte"
"legacy image filter container is unsupported; filter conversion was skipped" = "przestarzały kontener filtrów obrazu jest nieobsługiwany; konwersja filtrów została pominięta"
"links to shared styles that aren't in the file kept the layers' own values" = "odwołania do współdzielonych stylów, których nie ma w pliku, zachowały własne wartości warstw"
"locked" = "Zablokowane"
"malformed image filters container was skipped" = "nieprawidłowy kontener filtrów obrazu został pominięty"
"malformed image paintFilter container was skipped" = "nieprawidłowy kontener filtrów malowania (paintFilter) został pominięty"
+1
View File
@@ -1588,6 +1588,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "camadas sem posição foram colocadas na origem do elemento pai"
"layers without a type were skipped" = "camadas sem tipo foram ignoradas"
"legacy image filter container is unsupported; filter conversion was skipped" = "o contêiner legado de filtros de imagem não é compatível; a conversão dos filtros foi ignorada"
"links to shared styles that aren't in the file kept the layers' own values" = "vínculos para estilos compartilhados que não estão no arquivo mantiveram os valores próprios das camadas"
"locked" = "bloqueada"
"malformed image filters container was skipped" = "o contêiner de filtros de imagem malformado foi ignorado"
"malformed image paintFilter container was skipped" = "o contêiner paintFilter de imagem malformado foi ignorado"
+1
View File
@@ -1689,6 +1689,7 @@ name = "Русский"
"layers without a position were placed at their parent's origin" = "слои без положения размещены в начале координат родителя"
"layers without a type were skipped" = "слои без типа пропущены"
"legacy image filter container is unsupported; filter conversion was skipped" = "устаревший контейнер фильтров изображения не поддерживается; преобразование фильтров пропущено"
"links to shared styles that aren't in the file kept the layers' own values" = "ссылки на общие стили, которых нет в файле, сохранили собственные значения слоёв"
"locked" = "заблокировано"
"malformed image filters container was skipped" = "повреждённый контейнер фильтров изображения пропущен"
"malformed image paintFilter container was skipped" = "повреждённый контейнер paintFilter изображения пропущен"
+1
View File
@@ -1751,6 +1751,7 @@ name = "Svenska"
"layers without a type were skipped" = "lager utan typ hoppades över"
"legacy image filter container is unsupported; filter conversion was skipped" = "den äldre bildfilterbehållaren stöds inte; filterkonverteringen hoppades över"
"linked vector region fill styles keep resolved appearance; live style links were left out" = "länkade fyllningsstilar i vektorregioner behåller sitt beräknade utseende; levande stillänkar utelämnades"
"links to shared styles that aren't in the file kept the layers' own values" = "länkar till delade stilar som inte finns i filen behöll lagrens egna värden"
"locked" = "låst"
"malformed image filters container was skipped" = "en felaktig bildfilterbehållare hoppades över"
"malformed image paintFilter container was skipped" = "en felaktig paintFilter-behållare för bild hoppades över"
+1
View File
@@ -1668,6 +1668,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "เลเยอร์ที่ไม่มีตำแหน่งถูกวางที่จุดกำเนิดของตัวแม่"
"layers without a type were skipped" = "ข้ามเลเยอร์ที่ไม่มีชนิด"
"legacy image filter container is unsupported; filter conversion was skipped" = "ไม่รองรับคอนเทนเนอร์ตัวกรองรูปภาพแบบเก่า: ข้ามการแปลงตัวกรอง"
"links to shared styles that aren't in the file kept the layers' own values" = "ลิงก์ไปยังสไตล์ที่ใช้ร่วมกันซึ่งไม่มีในไฟล์ใช้ค่าของเลเยอร์เอง"
"locked" = "ล็อกอยู่"
"malformed image filters container was skipped" = "ข้ามคอนเทนเนอร์ตัวกรองรูปภาพที่รูปแบบผิด"
"malformed image paintFilter container was skipped" = "ข้ามคอนเทนเนอร์ paintFilter ของรูปภาพที่รูปแบบผิด"
+1
View File
@@ -1643,6 +1643,7 @@ name = "Türkçe"
"layers without a position were placed at their parent's origin" = "konumu olmayan katmanlar üst öğelerinin başlangıç noktasına yerleştirildi"
"layers without a type were skipped" = "türü olmayan katmanlar atlandı"
"legacy image filter container is unsupported; filter conversion was skipped" = "eski görüntü filtresi kapsayıcısı desteklenmiyor; filtre dönüştürme atlandı"
"links to shared styles that aren't in the file kept the layers' own values" = "dosyada olmayan paylaşılan stillere bağlantılar katmanların kendi değerlerini korudu"
"locked" = "kilitli"
"malformed image filters container was skipped" = "bozuk görüntü filtreleri kapsayıcısı atlandı"
"malformed image paintFilter container was skipped" = "bozuk görüntü paintFilter kapsayıcısı atlandı"
+1
View File
@@ -1618,6 +1618,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "các lớp không có vị trí đã được đặt tại gốc tọa độ của lớp cha"
"layers without a type were skipped" = "đã bỏ qua các lớp không có loại"
"legacy image filter container is unsupported; filter conversion was skipped" = "vùng chứa bộ lọc hình ảnh kiểu cũ không được hỗ trợ; đã bỏ qua chuyển đổi bộ lọc"
"links to shared styles that aren't in the file kept the layers' own values" = "các liên kết đến kiểu dùng chung không có trong tệp đã giữ giá trị riêng của các lớp"
"locked" = "đã khóa"
"malformed image filters container was skipped" = "đã bỏ qua vùng chứa bộ lọc hình ảnh bị lỗi định dạng"
"malformed image paintFilter container was skipped" = "đã bỏ qua vùng chứa paintFilter hình ảnh bị lỗi định dạng"
+1
View File
@@ -1598,6 +1598,7 @@ status = "draft — needs native review"
"layers without a position were placed at their parent's origin" = "没有位置的图层已放在其父级的原点"
"layers without a type were skipped" = "已跳过没有类型的图层"
"legacy image filter container is unsupported; filter conversion was skipped" = "不支持旧版图片滤镜容器;已跳过滤镜转换"
"links to shared styles that aren't in the file kept the layers' own values" = "指向文件中不存在的共享样式的链接保留了图层自身的值"
"locked" = "已锁定"
"malformed image filters container was skipped" = "已跳过格式错误的图片滤镜容器"
"malformed image paintFilter container was skipped" = "已跳过格式错误的图片 paintFilter 容器"
+3 -1
View File
@@ -1,6 +1,6 @@
# File format parity
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (pasted layers whose image the clipboard lacks are named and show a placeholder that reads as missing (#1646); imported and pasted text finds an installed family under the other names its fonts give it, and with other case and spacing (#1292); `.fig` export writes colour calculations as the colour they show in each mode and leaves out, with a warning, one that resolves to nothing (#1280); `.fig` import budgets four decoded values per compressed byte instead of one, still within 20M–128M, so dense files within that budget open instead of being refused as having too many values (#574); `.fig` ZIP image reads share a total byte budget and count skipped images in the import warnings (#1076); every file a command reads whole by path is a regular file within a cap that fits it: documents 16 GiB, placed images 256 MiB, CLI scripts 1 GiB; folders, devices and pipes are refused before anything is read (#1114); files nested 256 levels deep import on the browser's 1 MB stack (#1101); SVG and PDF exports count pattern sources and the renders they embed from the layer's depth, so one cap bounds a whole export (#1082); opening a `.figcraft` file unpacks at most 6 GiB in all (2 GiB in the browser), every area together (#1079); `.fig` instance expansion no longer walks variable nodes for every instance or copies every outer override row into each nested instance (#1077); a FigJam `.jam` file opens as a board (#1342); FigJam `.jam` files open like `.fig` files: File ▸ Open, drag and drop, `file.import` and the command line (#1342); SVG import reads `color()` and `color-mix()` colours, with a note and a grey for those it can't (#1550); SVG import draws each pattern tile once per scale, within the layer budget (#1080); a file's JPEG thumbnail can't crash the home screen (#1491's progressive JPEG check, now shared); `.fig` import: library text styles linked by asset key, and override rows restating a nested level (#1234); `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); Download a missing free font from the Missing fonts window (`font.download`, #754); offline Penpot 2.x import/export (#1143); `.sketch` import checked against Sketch's renders: master backgrounds, symbol clipping, tints before Sketch 64, mask opacity, bitmap fills, image overrides on shapes, stretching stacks, blur radii, colour adjustments, OKLab gradients, text growth, shape group borders (#1389); FigJam outer shape outlines and sticky body fallback beside author text (#1341, #1397); image member names are checked on read, and REST image placeholders get archive-safe keys (#1086); Android Vector Drawable (XML) export; `.fig` export: files the incumbent imports, with component set properties, and grid track sizes at its field ids; Save and auto-save don't replace changes another app made to the open file (#1330); `.sketch` import, best effort, Sketch 48 and newer; the PNG row names ignore overlapping layers and where include bounding box is offered; the Fonts table's missing-font row describes the Missing fonts window; `.figcraft` carries the file kind (boards); `.fig` import: resized instances and variable modes by asset key; atomic saves; auto-save; SVG export clip of nested frames; SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source; REST import keeps slot layers and instances' slot content (#792); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732)) · **Target:** Figma Design (desktop app 126.10.7)
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (pasted layers whose image the clipboard lacks are named and show a placeholder that reads as missing (#1646); paint-style colours on layers pasted from another design app keep their style instead of turning black (#1638); imported and pasted text finds an installed family under the other names its fonts give it, and with other case and spacing (#1292); `.fig` export writes colour calculations as the colour they show in each mode and leaves out, with a warning, one that resolves to nothing (#1280); `.fig` import budgets four decoded values per compressed byte instead of one, still within 20M–128M, so dense files within that budget open instead of being refused as having too many values (#574); `.fig` ZIP image reads share a total byte budget and count skipped images in the import warnings (#1076); every file a command reads whole by path is a regular file within a cap that fits it: documents 16 GiB, placed images 256 MiB, CLI scripts 1 GiB; folders, devices and pipes are refused before anything is read (#1114); files nested 256 levels deep import on the browser's 1 MB stack (#1101); SVG and PDF exports count pattern sources and the renders they embed from the layer's depth, so one cap bounds a whole export (#1082); opening a `.figcraft` file unpacks at most 6 GiB in all (2 GiB in the browser), every area together (#1079); `.fig` instance expansion no longer walks variable nodes for every instance or copies every outer override row into each nested instance (#1077); a FigJam `.jam` file opens as a board (#1342); FigJam `.jam` files open like `.fig` files: File ▸ Open, drag and drop, `file.import` and the command line (#1342); SVG import reads `color()` and `color-mix()` colours, with a note and a grey for those it can't (#1550); SVG import draws each pattern tile once per scale, within the layer budget (#1080); a file's JPEG thumbnail can't crash the home screen (#1491's progressive JPEG check, now shared); `.fig` import: library text styles linked by asset key, and override rows restating a nested level (#1234); `.fig` import keeps the file's saved line breaks while the text and its box are unedited (#1236); Download a missing free font from the Missing fonts window (`font.download`, #754); offline Penpot 2.x import/export (#1143); `.sketch` import checked against Sketch's renders: master backgrounds, symbol clipping, tints before Sketch 64, mask opacity, bitmap fills, image overrides on shapes, stretching stacks, blur radii, colour adjustments, OKLab gradients, text growth, shape group borders (#1389); FigJam outer shape outlines and sticky body fallback beside author text (#1341, #1397); image member names are checked on read, and REST image placeholders get archive-safe keys (#1086); Android Vector Drawable (XML) export; `.fig` export: files the incumbent imports, with component set properties, and grid track sizes at its field ids; Save and auto-save don't replace changes another app made to the open file (#1330); `.sketch` import, best effort, Sketch 48 and newer; the PNG row names ignore overlapping layers and where include bounding box is offered; the Fonts table's missing-font row describes the Missing fonts window; `.figcraft` carries the file kind (boards); `.fig` import: resized instances and variable modes by asset key; atomic saves; auto-save; SVG export clip of nested frames; SVG/PDF export depth refusal (#208); `.fig` export: instance sizes, variables with modes, shared styles, variable-width strokes; `.fig` export: written files checked by opening them in other software; experimental `.fig` export; export and inspect behaviour suite and fixes; .fig import: editable vector networks and more layer kinds; embedded image colour profiles; `.fig` import, best effort; animated GIF fills and TIFF images; last major: created, formats from the installed Figma's Info.plist and help center, ours from source; REST import keeps slot layers and instances' slot content (#792); REST import reads grid track sizes (#465); `.fig` import fidelity from the community batches, budgets for large files, the import report, a `.fig` copy from Save as, paste from another design app; instance layers' size and resizing and Hug on import (#731, #732)) · **Target:** Figma Design (desktop app 126.10.7)
Every format Figma reads or writes, with FigCraft's support. Sources: `Info.plist` of
`/Applications/Figma.app` (document types only; nothing inside the bundle's code was read), Figma's
@@ -40,6 +40,7 @@ and prototype interactions are still unchecked there.
| MP4, MOV, WebM (video fills, paid plans) | yes | **no** | shortcut: decoding H.264/HEVC/VP9 needs non-Rust libraries (FFmpeg or each platform's media framework); presenter playback would reuse the animated GIF clock | 4–8 |
| Images over 4096 px | downscaled to 4096 | kept | | — |
| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text (newest clipboard content wins), **layers copied from another design app, best effort** | Cmd/Ctrl+V reads an image copied in another app (under Wayland through the data-control protocol, not run on Linux here; Linux and BSD clipboard reads give up after 2 s). Copied design layers: the `.fig` canvas in the clipboard's HTML is read like a `.fig` file (with its warnings) and pasted as Paste pastes, in place or into the selected frame (`edit.pasteDesignLayers {html \| data}`, refused over 256 MB before decoding); text copied later pastes as text again. An image the clipboard doesn't carry keeps its name on the fill and shows the missing-image placeholder (light grey with darker stripes), and the paste names those layers and lists its notes in the import report (#1646). Tested with clipboard HTML made from our own `.fig` export (`design_paste_tests`), never with a real clipboard from other software | with `.fig` |
| Pasted content from other apps | images, SVG, text, Figma clipboard | images, SVG, text (newest clipboard content wins), **layers copied from another design app, best effort** | Cmd/Ctrl+V reads an image copied in another app (under Wayland through the data-control protocol, not run on Linux here; Linux and BSD clipboard reads give up after 2 s). Copied design layers: the `.fig` canvas in the clipboard's HTML is read like a `.fig` file (with its warnings) and pasted as Paste pastes, in place or into the selected frame (`edit.pasteDesignLayers {html \| data}`, refused over 256 MB before decoding); text copied later pastes as text again. Shared paint, text and effect styles that a pasted layer links by the guid of the library it came from are found by their library asset, so the layers keep the style's colours and their link to it; a link to a style the clipboard doesn't hold keeps the layer's stored colours, with a note (#1638). Tested with clipboard HTML made from our own `.fig` export (`design_paste_tests`) and with design data built in code (`paste_style_tests`), never with a real clipboard from other software | with `.fig` |
## Export
@@ -187,6 +188,7 @@ source paint coordinates.
| Date | Change | Summary |
|---|---|---|
| 2026-10-30 | minor | Pasted content row: an image the clipboard doesn't carry keeps its name and shows a placeholder that reads as missing; the paste names those layers in its message and opens the import report with its notes (#1646). Numbers unchanged |
| 2026-10-30 | minor | Pasted content row: styles a pasted layer links by its library's guid are found by their library asset, so paint-style colours on pasted components and instances no longer import as black; a link to a style that isn't there keeps the stored colour, with a note (#1638). Numbers unchanged |
| 2026-10-30 | minor | `.fig` import: elbowed and curved connectors saved without their path were drawn straight; they now run as FigCraft's board connectors do, in right angles or one curve, from the side of each layer they join (the file's `magnet`, else the edge its point is on, else the side facing the other end). The router moved from the engine into `figcraft-doc` (`route_points`) so both use it. Straight connectors are unchanged. Not checked on real files. Tests: `fig::tests::tail` (`other_layer_kinds_import_as_the_closest_layers`, `connectors_without_a_saved_path_follow_their_line_style`) |
| 2026-10-30 | minor | M3, #1280: `.fig` export writes a colour calculation (a variable's `{alpha}` or `{mix}` value) as the colour it shows in each mode of its collection, other collections in their default modes; one that resolves to nothing (an operand missing, or more than 32 variables to read) is left out with a warning. Tests: `crates/format/src/fig/assets_tests.rs`. Numbers unchanged. |
| 2026-10-30 | minor | Fonts: the missing-font row adds that a family is found under the other names its fonts give it (legacy per-weight names and typographic ones) and with other case and spacing, so a `.fig`, REST or pasted file no longer reports an installed family missing (#1292). Numbers unchanged |
+2 -1
View File
File diff suppressed because one or more lines are too long