A specialized React tool for refining generative SVGs into semantically tagged, CSS-compliant assets for the PICTOS.net and MediaFranca ecosystem.
SVG editor designed specifically for working with AAC (Augmentative and Alternative Communication) pictograms that follow the MediaFranca SVG Schema. It provides a comprehensive interface for:
- Semantic Structure Editing: Visual tree-based editing of SVG DOM with semantic role mappings
- CSS-Only Styling: Strict enforcement of CSS classes over inline styles
- Schema Validation: Real-time validation against MediaFranca SVG Schema requirements
- Visual Manipulation: Bounding box system for precise element positioning
- AI-Powered Refinement: Partial element regeneration via LLM prompts
Root container managing the entire application layout.
Top header containing:
- Undo/Redo history controls
- Export to Schema button
Main three-panel layout:
Left Panel: Semantic Tree (#aside-semantic-tree)
- Expandable/collapsible SVG DOM tree
- Inline ID editing for all elements
- Visual selection sync with canvas
Center: Canvas Viewport (#canvas-viewport)
- SVG rendering with accurate coordinate mapping via
getScreenCTM() - Bounding box overlay for selected elements
- Move, Scale, and Distort operations
Right Panel: Style Forge (#aside-style-forge)
- CSS class management (no inline styles allowed)
- Schema validation results
- Real-time compliance checking
Bottom panel for AI-powered partial element regeneration.
- Framework: React 19 with TypeScript
- State Management: Zustand
- Styling: Tailwind CSS 4
- Icons: Lucide React
- Build Tool: Vite 7
The project integrates two MediaFranca ecosystem submodules:
Location: client/src/lib/style-editor
Alias: @style-editor
Repository: https://github.com/mediafranca/style-editor
Component library for SVG style editing with CSS class management.
Location: client/src/lib/mf-schema
Alias: @schema
Repository: https://github.com/mediafranca/mf-svg-schema
Formal specification for semantically rich, accessible SVG pictograms.
All imported SVGs are automatically normalized:
- Inline
styleattributes are stripped - Styles are converted to CSS classes
- CSS rules are consolidated in a
<style>block
Real-time validation against MediaFranca requirements:
- Required elements (
<title>,<desc>,<metadata>) - Semantic groups with
role="group" - Accessibility attributes (
aria-labelledby,tabindex) - Metadata structure (utterance, concepts, NSM mapping)
Accurate screen-to-SVG coordinate transformation using:
getBBox()for element boundsgetScreenCTM()for coordinate transformationcreateSVGPoint()for point mapping
Full undo/redo support:
- Automatic history snapshots on changes
- Bidirectional navigation
- State restoration
Technical Precision with Functional Aesthetics
- Monospace Typography: JetBrains Mono for code-like precision
- High-Contrast Colors: Deep technical blue (
oklch(0.45 0.15 250)) - Minimal Borders: Sharp 0.25rem radius for professional edges
- Functional Animations: Focused on user feedback, not decoration
- Semantic IDs: All major UI elements use semantic HTML IDs
# Clone with submodules
git clone --recurse-submodules https://github.com/mediafranca/picto-editor.git
cd picto-editor
# Install dependencies
pnpm install# Start dev server
pnpm dev# Build for production
pnpm build- Import SVG: Click "Choose File" or "Load Sample" to import an SVG
- Edit Structure: Use the Semantic Tree to select and rename elements
- Style Elements: Apply CSS classes in the Style Forge panel
- Validate: Check real-time validation results
- Refine with AI: Use the Agent Prompt Dock for partial regeneration
- Export: Click "Export to Schema" to download the refined SVG
This tool is part of the broader MediaFranca AAC ecosystem:
- NLU Schema: Natural language understanding and semantic decomposition
- PictoNet: Generative model for pictogram synthesis
- SVG Schema: Formal specification (this repository validates against)
- ICAP Framework: Human-in-the-loop validation
This project follows the MediaFranca ecosystem licensing:
- Code: MIT License
- Schema/Specification: CC BY 4.0
Contributions should align with:
- MediaFranca SVG Schema requirements
- Single Source of Truth (SSoT) philosophy
- Deterministic accessibility principles