Skip to content

Extract reusable components from DESIGN.md#4

Merged
vicmaster merged 1 commit into
masterfrom
feat/design-md-components
May 14, 2026
Merged

Extract reusable components from DESIGN.md#4
vicmaster merged 1 commit into
masterfrom
feat/design-md-components

Conversation

@vicmaster
Copy link
Copy Markdown
Owner

Summary

  • Final Phase 4 backlog item: extract component patterns from DESIGN.md.
  • The parser pulled color/typography/spacing/radius tokens but ignored the "Component Styling" section. Adds extractComponents, which detects button / card / badge descriptions (sub-section heading or list item), pulls whatever fill / text color / padding / cornerRadius / border / fontSize / fontWeight it can find via regex, and builds component SceneNode skeletons with sensible defaults for anything missing.
  • Preset gains an optional components map. apply_preset copies those into canvas.components (structured-cloned) so they're instanceable; import_design_md reports the extracted component keys.
  • Components not described in the DESIGN.md are simply omitted.

Test plan

  • npm run build clean
  • npx tsx test-design-md.ts — 28/28 checks pass (13 color-filter, 13 component-extraction, 2 instanced-render)
  • Verified an instance node referencing an extracted button resolves and renders its fill + label via renderToHtml

The DESIGN.md parser pulled colors, typography, spacing, and radius
tokens but ignored the "Component Styling" section. Add extractComponents,
which builds button/card/badge component skeletons from whatever fill,
text color, padding, radius, border, and font props it can find, falling
back to sensible defaults. Presets now carry an optional components map;
apply_preset copies them into canvas.components so they can be instanced.
@vicmaster vicmaster merged commit f0723c0 into master May 14, 2026
@vicmaster vicmaster deleted the feat/design-md-components branch May 14, 2026 18:06
vicmaster added a commit that referenced this pull request May 15, 2026
Phase 5 item #4: root document fills + centers the viewport
vicmaster added a commit that referenced this pull request May 17, 2026
Phase 8 #4: 'path' node type for custom SVG paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant