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.
This commit is contained in:
parent
75cc653efc
commit
f4b45d4f13
|
|
@ -22,7 +22,7 @@ Additionally, we need to assess the current state of documentation tooling — s
|
|||
- `text-editing`: Inline text editing with CanvasKit Paragraph API, textarea overlay, font loading (Inter default + Local Font Access API for system fonts), font weight, auto-width text boxes
|
||||
- `pen-tool`: Pen tool with vector network model, bezier curves, open/closed paths, vectorNetworkBlob binary encode/decode
|
||||
- `auto-layout`: Yoga WASM integration, horizontal/vertical/wrap, gap, padding, justify, align, child sizing, Shift+A toggle, drag reordering with insertion indicator, wrap selected nodes in auto-layout
|
||||
- `figma-clipboard`: Bidirectional Figma clipboard — paste from Figma (fig-kiwi binary decode), copy for Figma (fig-kiwi binary encode), cut/copy between OpenPencil instances
|
||||
- `figma-clipboard`: Bidirectional Figma clipboard — paste from Figma (Kiwi binary decode), copy for Figma (Kiwi binary encode), cut/copy between OpenPencil instances
|
||||
- `fig-import`: .fig file import via Kiwi codec — header parsing, Zstd decompression, schema decode, NodeChange[] extraction, scene graph population
|
||||
- `kiwi-codec`: Vendored kiwi-schema, Kiwi binary codec for Figma's 194-definition schema, ESM/CLI patching for sparse field IDs
|
||||
- `editor-ui`: Vue 3 + Reka UI panels — toolbar (bottom), layers panel (tree with expand/collapse, drag reorder, visibility toggle), properties panel (appearance, fill, stroke, typography, layout, position sections), color picker (HSV, hex, opacity, alpha)
|
||||
|
|
|
|||
|
|
@ -1,25 +1,25 @@
|
|||
## ADDED Requirements
|
||||
|
||||
### Requirement: Paste from Figma
|
||||
The editor SHALL accept paste events containing fig-kiwi binary data from Figma's clipboard. Pasted nodes SHALL be decoded and added to the scene graph.
|
||||
The editor SHALL accept paste events containing Kiwi binary data from Figma's clipboard. Pasted nodes SHALL be decoded and added to the scene graph.
|
||||
|
||||
#### Scenario: Paste Figma nodes
|
||||
- **WHEN** user copies a frame in Figma and pastes in OpenPencil
|
||||
- **THEN** the frame and its children appear on the canvas with preserved properties
|
||||
|
||||
### Requirement: Copy for Figma compatibility
|
||||
The editor SHALL encode selected nodes as fig-kiwi binary on copy, allowing paste into Figma or other OpenPencil instances.
|
||||
The editor SHALL encode selected nodes as Kiwi binary on copy, allowing paste into Figma or other OpenPencil instances.
|
||||
|
||||
#### Scenario: Copy to Figma
|
||||
- **WHEN** user copies a rectangle in OpenPencil and pastes in Figma
|
||||
- **THEN** the rectangle appears in Figma with preserved fill, stroke, and dimensions
|
||||
|
||||
### Requirement: Native copy/paste events
|
||||
Clipboard operations SHALL use native copy/paste browser events (not async Clipboard API) and build the fig-kiwi binary synchronously in the event handler.
|
||||
Clipboard operations SHALL use native copy/paste browser events (not async Clipboard API) and build the Kiwi binary synchronously in the event handler.
|
||||
|
||||
#### Scenario: Synchronous clipboard encoding
|
||||
- **WHEN** user presses ⌘C with a node selected
|
||||
- **THEN** the fig-kiwi binary is built synchronously within the copy event handler
|
||||
- **THEN** the Kiwi binary is built synchronously within the copy event handler
|
||||
|
||||
### Requirement: Cut operation
|
||||
Cut SHALL copy nodes to clipboard and delete them from the scene graph.
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
## ADDED Requirements
|
||||
|
||||
### Requirement: .fig file export
|
||||
The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with fig-kiwi header, schema, message, and thumbnail.
|
||||
The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with Kiwi header, schema, message, and thumbnail.
|
||||
|
||||
#### Scenario: Save As .fig
|
||||
- **WHEN** user selects File → Save As
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ The Kiwi codec SHALL support encoding NodeChange[] back to Kiwi binary format fo
|
|||
|
||||
#### Scenario: Encode scene graph to Kiwi binary
|
||||
- **WHEN** the editor exports a document
|
||||
- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid fig-kiwi payload
|
||||
- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid Kiwi payload
|
||||
|
||||
### Requirement: .fig ZIP built in Rust
|
||||
On the desktop app, the .fig ZIP archive SHALL be assembled in Rust instead of JavaScript (fflate) for better performance and correct Zstd framing (content size in header).
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ The import pipeline SHALL resolve blob references (images, vector networks, font
|
|||
- **THEN** the vector paths are correctly decoded and renderable
|
||||
|
||||
### Requirement: .fig file export
|
||||
The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with fig-kiwi header, schema, message, and thumbnail.
|
||||
The editor SHALL export documents as .fig files. The pipeline: scene graph → Kiwi encode NodeChange[] → compress → write ZIP with Kiwi header, schema, message, and thumbnail.
|
||||
|
||||
#### Scenario: Save As .fig
|
||||
- **WHEN** user selects File → Save As
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
# figma-clipboard Specification
|
||||
|
||||
## Purpose
|
||||
Bidirectional clipboard compatibility with Figma. Decodes fig-kiwi binary on paste, encodes fig-kiwi binary on copy, supports cut, and works across OpenPencil instances.
|
||||
Bidirectional clipboard compatibility with Figma. Decodes Kiwi binary on paste, encodes Kiwi binary on copy, supports cut, and works across OpenPencil instances.
|
||||
## Requirements
|
||||
### Requirement: Paste from Figma
|
||||
The editor SHALL accept paste events containing fig-kiwi binary data from Figma's clipboard. Pasted nodes SHALL be decoded and added to the scene graph.
|
||||
The editor SHALL accept paste events containing Kiwi binary data from Figma's clipboard. Pasted nodes SHALL be decoded and added to the scene graph.
|
||||
|
||||
#### Scenario: Paste Figma nodes
|
||||
- **WHEN** user copies a frame in Figma and pastes in OpenPencil
|
||||
- **THEN** the frame and its children appear on the canvas with preserved properties
|
||||
|
||||
### Requirement: Copy for Figma compatibility
|
||||
The editor SHALL encode selected nodes as fig-kiwi binary on copy, allowing paste into Figma or other OpenPencil instances.
|
||||
The editor SHALL encode selected nodes as Kiwi binary on copy, allowing paste into Figma or other OpenPencil instances.
|
||||
|
||||
#### Scenario: Copy to Figma
|
||||
- **WHEN** user copies a rectangle in OpenPencil and pastes in Figma
|
||||
- **THEN** the rectangle appears in Figma with preserved fill, stroke, and dimensions
|
||||
|
||||
### Requirement: Native copy/paste events
|
||||
Clipboard operations SHALL use native copy/paste browser events (not async Clipboard API) and build the fig-kiwi binary synchronously in the event handler.
|
||||
Clipboard operations SHALL use native copy/paste browser events (not async Clipboard API) and build the Kiwi binary synchronously in the event handler.
|
||||
|
||||
#### Scenario: Synchronous clipboard encoding
|
||||
- **WHEN** user presses ⌘C with a node selected
|
||||
- **THEN** the fig-kiwi binary is built synchronously within the copy event handler
|
||||
- **THEN** the Kiwi binary is built synchronously within the copy event handler
|
||||
|
||||
### Requirement: Cut operation
|
||||
Cut SHALL copy nodes to clipboard and delete them from the scene graph.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ The Kiwi codec SHALL support encoding NodeChange[] back to Kiwi binary format fo
|
|||
|
||||
#### Scenario: Encode scene graph to Kiwi binary
|
||||
- **WHEN** the editor exports a document
|
||||
- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid fig-kiwi payload
|
||||
- **THEN** all nodes are encoded as NodeChange messages using the Kiwi schema and the binary output is a valid Kiwi payload
|
||||
|
||||
### Requirement: .fig ZIP built in Rust
|
||||
On the desktop app, the .fig ZIP archive SHALL be assembled in Rust instead of JavaScript (fflate) for better performance and correct Zstd framing (content size in header).
|
||||
|
|
|
|||
|
|
@ -833,7 +833,7 @@ message Paint {
|
|||
Video video = 18;
|
||||
uint originalImageWidth = 19;
|
||||
uint originalImageHeight = 20;
|
||||
PaintVariableBinding variableBinding = 21; // Not in fig-kiwi. Discovered via WS sniffing 2026-01
|
||||
PaintVariableBinding variableBinding = 21; // Not in .fig files. Discovered via WS sniffing 2026-01
|
||||
}
|
||||
|
||||
message FontMetaData {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ openspec/
|
|||
| text-editing | Text tool, Paragraph API, font loading |
|
||||
| pen-tool | Vector network model, bezier curves |
|
||||
| auto-layout | Yoga WASM flexbox, Shift+A toggle |
|
||||
| figma-clipboard | Bidirectional fig-kiwi clipboard |
|
||||
| figma-clipboard | Bidirectional Kiwi binary clipboard |
|
||||
| fig-import | .fig file import pipeline |
|
||||
| kiwi-codec | Kiwi binary codec, sparse field IDs |
|
||||
| editor-ui | Vue 3 panels, toolbar, color picker |
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ Properties panel, layers panel, toolbar, Yoga layout integration, text editing.
|
|||
- Save (⌘S) and Save As (⇧⌘S) with native OS dialogs
|
||||
- Zstd compression via Tauri Rust command (deflate fallback in browser)
|
||||
- Vendored kiwi-schema with ESM + sparse field ID patches
|
||||
- Figma-compatible clipboard (bidirectional fig-kiwi binary)
|
||||
- Figma-compatible clipboard (bidirectional Kiwi binary)
|
||||
- Pen tool with vector network model
|
||||
- vectorNetworkBlob binary encode/decode
|
||||
- Group/ungroup (⌘G/⇧⌘G)
|
||||
|
|
|
|||
|
|
@ -85,4 +85,4 @@ Inverse-command pattern. Before applying any change, affected fields are snapsho
|
|||
|
||||
### Clipboard
|
||||
|
||||
Figma-compatible bidirectional clipboard. Encodes/decodes fig-kiwi binary using native browser copy/paste events (synchronous, not async Clipboard API).
|
||||
Figma-compatible bidirectional clipboard. Encodes/decodes Kiwi binary (same format as .fig files) using native browser copy/paste events (synchronous, not async Clipboard API).
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ Open Pencil delegates to a battle-tested library (Yoga, used by React Native on
|
|||
|
||||
- **Native Kiwi binary format** — same serialization as Figma uses internally
|
||||
- Direct `.fig` file import via extracted Kiwi codec (2,178 LOC schema + 551 LOC codec)
|
||||
- Figma clipboard paste support (reads Figma's `fig-kiwi` binary clipboard format)
|
||||
- Figma clipboard paste support (reads Figma's Kiwi binary from the clipboard)
|
||||
- Wire-compatible with Figma's multiplayer protocol
|
||||
|
||||
### Penpot
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ Feature-by-feature comparison of Figma Design capabilities with Open Pencil's cu
|
|||
| Layer types & hierarchy | ✅ | 17 node types, flat Map + parent-child tree |
|
||||
| Select layers | ✅ | Click, shift-click, marquee selection |
|
||||
| Alignment & position | ✅ | Position, rotation, dimensions in properties panel |
|
||||
| Copy & paste objects | ✅ | Standard clipboard + Figma fig-kiwi binary format |
|
||||
| Copy & paste objects | ✅ | Standard clipboard + Figma Kiwi binary format |
|
||||
| Scale layers proportionally | 🟡 | Shift-resize constrains proportions; no dedicated Scale tool (K) |
|
||||
| Lock & unlock layers | ✅ | ⇧⌘L toggles lock; locked nodes can't be selected/moved from canvas |
|
||||
| Toggle layer visibility | ✅ | Eye icon in layers panel + ⇧⌘H keyboard shortcut |
|
||||
|
|
@ -189,8 +189,8 @@ Feature-by-feature comparison of Figma Design capabilities with Open Pencil's cu
|
|||
| .fig file import | ✅ | Full Kiwi codec: 194 definitions, ~390 fields per NodeChange |
|
||||
| .fig file export | ✅ | Kiwi encoding + Zstd compression + thumbnail generation |
|
||||
| Save / Save As | ✅ | ⌘S / ⇧⌘S with native OS dialogs (Tauri) |
|
||||
| Figma clipboard (paste) | ✅ | Decode fig-kiwi binary from Figma clipboard |
|
||||
| Figma clipboard (copy) | ✅ | Encode fig-kiwi binary that Figma can read |
|
||||
| Figma clipboard (paste) | ✅ | Decode Kiwi binary from Figma clipboard |
|
||||
| Figma clipboard (copy) | ✅ | Encode Kiwi binary that Figma can read |
|
||||
| Sketch file import | 🔲 | .sketch file parsing |
|
||||
| Image/SVG export | 🟡 | PNG/JPG/WEBP with scale selector and live preview; SVG/PDF not yet |
|
||||
| Version history | 🔲 | Browse and restore previous versions |
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ See [Roadmap](/development/roadmap) for planned format support timeline.
|
|||
|
||||
## Clipboard Format
|
||||
|
||||
Copy/paste uses the same fig-kiwi binary encoding:
|
||||
Copy/paste uses the same Kiwi binary encoding:
|
||||
|
||||
1. **Copy** — encode selected NodeChange[] to Kiwi binary, compress, write to clipboard as `application/x-figma-design` MIME type
|
||||
2. **Paste** — read clipboard, decompress, decode Kiwi binary, create nodes in scene graph
|
||||
|
|
|
|||
Loading…
Reference in a new issue