openpencil/crates/openpencil-shell-core
Kayshen-X cf48a006de feat(shell-core/figma): kind→NodeKind mapper (clipboard JSON one step from real import)
`FigmaClipboardNode::to_node_kind()` maps the 8 most-common Figma
type strings to the closest `crate::document::NodeKind`:

  RECTANGLE              → Rect
  ELLIPSE                → Ellipse
  LINE                   → Line
  POLYGON / REGULAR_POLY → Polygon
  VECTOR                 → Path
  TEXT                   → Text
  FRAME / SECTION        → Frame
  GROUP                  → Group
  <unknown>              → Other(<kind string>)

Unknown kinds round-trip via `NodeKind::Other(...)` so the layer
panel still renders something honest instead of dropping the node.
Future commits add per-kind specialised geometry mappers (fills /
strokes / vectors / text / layout) ported from `pen-figma`.

Tests (2 new):
  - 10-case table of every supported Figma kind → expected NodeKind
  - Unknown `BOOLEAN_OPERATION` → `Other("BOOLEAN_OPERATION")` round-trip

#9 Figma now ~50% — file kind detection + clipboard JSON walker +
per-child kind + name + NodeKind mapping. Remaining: per-kind
geometry/style mapper functions (the `pen-figma` figma-fill-mapper /
stroke-mapper / text-mapper / vector-decoder / etc port).

Tests total: 245 shell-core (+2). Wasm32 build clean.
2026-05-14 15:50:56 +08:00
..
src feat(shell-core/figma): kind→NodeKind mapper (clipboard JSON one step from real import) 2026-05-14 15:50:56 +08:00
tests style(shell): cargo fmt --all (rustfmt-clean) 2026-05-10 18:47:33 +08:00
Cargo.toml feat(shell-core): Phase B1 — Widget trait + recording test harness 2026-05-09 21:45:00 +08:00