Source adapters that lower external design exports into the normalized DesignIR: Figma / Stitch / v0 / Pencil / Claude HTML, Google DESIGN.md (lint / diff / Tailwind export), and the Claude Design / React runtime bundle envelope (unpack + headless runtime materialization). More...
#include <pulp/view/design_ir.hpp>#include <pulp/view/design_ir_io.hpp>#include <pulp/view/design_source_types.hpp>#include <cstdint>#include <map>#include <memory>#include <string>#include <string_view>#include <optional>#include <vector>#include <unordered_map>Go to the source code of this file.
Namespaces | |
| namespace | pulp |
| namespace | pulp::view |
| Hover-cursor tracking for platform window hosts. | |
Functions | |
| std::optional< DesignSource > | pulp::view::parse_design_source (const std::string &name) |
| Convert string to DesignSource, returns nullopt for unknown sources. | |
| const char * | pulp::view::design_source_name (DesignSource source) |
| Convert DesignSource to display name. | |
| SnapshotDynamicApiScan | pulp::view::detect_jsx_snapshot_dynamic_apis (std::string_view source) |
| Detect dynamic APIs that make a JSX baked snapshot non-deterministic unless the caller explicitly accepts or warns on snapshot semantics. | |
| DesignIR | pulp::view::parse_figma_json (const std::string &json) |
| Parse a Figma export JSON into a DesignIR. | |
| DesignIR | pulp::view::parse_figma_plugin_json (const std::string &json) |
| Parse Pulp's "Design for Pulp" Figma-plugin export envelope. | |
| DesignIR | pulp::view::parse_stitch_html (const std::string &html) |
| Parse Stitch HTML export into a DesignIR. | |
| DesignIR | pulp::view::parse_v0_tsx (const std::string &tsx) |
| Parse v0-generated TSX/Tailwind into a DesignIR. | |
| DesignIR | pulp::view::parse_pencil_json (const std::string &json) |
| Parse Pencil node tree JSON into a DesignIR. | |
| DesignIR | pulp::view::parse_claude_html (const std::string &html) |
| Parse a Claude Design standalone HTML export into a DesignIR. | |
| DesignMdParseResult | pulp::view::parse_designmd (const std::string &markdown) |
| Parse a DESIGN.md file (YAML frontmatter + Markdown body) into a DesignIR. | |
| DesignIR | pulp::view::parse_designmd_yaml (const std::string &markdown) |
| Thin wrapper that returns just the IR. | |
| std::vector< DesignMdDiagnostic > | pulp::view::lint_designmd (const DesignMdParseResult &parsed) |
| Run Pulp's Google design.md compatibility lint against a parsed DESIGN.md. | |
| DesignMdDiffResult | pulp::view::diff_designmd (const DesignMdParseResult &before, const DesignMdParseResult &after) |
| Compute the token diff between two parsed DESIGN.md files plus a regression flag derived from their respective lint outputs. | |
| std::string | pulp::view::export_tailwind_v3_json (const DesignMdParseResult &parsed) |
| Emit a Tailwind v3 theme.extend-shaped JSON object from the parsed token tree. | |
| std::string | pulp::view::export_tailwind_v4_css (const DesignMdParseResult &parsed) |
| Emit a Tailwind v4 @theme { ... } CSS block from the parsed token tree. | |
| std::optional< ClaudeBundle > | pulp::view::parse_claude_bundle (const std::string &html) |
| Decode the bundler envelope from a Claude Design standalone HTML file. | |
| std::optional< ClaudeBundle > | pulp::view::parse_materialized_browser_document (const std::string &json) |
| Decode the deterministic pre-mount document emitted by Chromium browser capture. | |
| std::shared_ptr< const ClaudeBundle > | pulp::view::parse_materialized_browser_document_shared (const std::string &json) |
| parse_materialized_browser_document with process-wide reuse. | |
| MaterializedDocumentCacheStats | pulp::view::materialized_document_cache_stats () |
| void | pulp::view::clear_materialized_document_cache () |
| Drop every kept document (tests; a host that wants the memory back). | |
| std::vector< std::string > | pulp::view::runtime_import_whole_scripts (const ClaudeBundle &bundle) |
| The whole scripts a live editor evaluates when it imports bundle at run time (__pulpRuntimeImport__): each JavaScript asset payload and each text/javascript inline script, byte-identical to what the payload pipeline hands evaluate_script(). | |
| std::optional< ClaudeBundle > | pulp::view::parse_v0_dev_react (const std::string &tsx_or_envelope) |
| Normalize a constrained v0.dev React TSX export into the runtime-import bundle payload shape. | |
| std::optional< ClaudeBundle > | pulp::view::parse_figma_make_react (const std::string &tsx) |
| Normalize a constrained Figma Make React TSX export into the runtime-import bundle payload shape. | |
| std::optional< ClaudeBundle > | pulp::view::parse_stitch_react (const std::string &tsx) |
| Normalize a constrained Google Stitch React export into the runtime-import bundle payload shape. | |
| std::optional< ClaudeBundle > | pulp::view::parse_react_native_export (const std::string &tsx) |
| Normalize a constrained React Native single-file component export into the runtime-import bundle payload shape. | |
| std::optional< ClaudeBundle > | pulp::view::parse_pencil_react (const std::string &tsx) |
| Normalize a constrained Pencil/OpenPencil sanitized Tailwind-JSX export into the runtime-import bundle payload shape. | |
| std::optional< ClaudeBundle > | pulp::view::parse_jsx_react (const std::string &bundle_js, const std::string &component_name="JsxComponent") |
| Wrap a pre-compiled JSX runtime bundle (esbuild IIFE of React plus either ReactDOM or the @pulp/react native bridge and the user's JSX component, produced by tools/import-design/jsx-runtime/
jsx-transform.mjs) as a synthetic ClaudeBundle so the existing runtime-import harness (parse_claude_html_with_runtime) can materialize it. | |
| std::string | pulp::view::synthesize_runtime_envelope (const ClaudeBundle &bundle) |
| Synthesize a Claude-style HTML envelope around an arbitrary ClaudeBundle so the existing parse_claude_html_with_runtime harness can consume it without a real Claude Design HTML wrapper on input. | |
| DesignIR | pulp::view::parse_claude_html_with_runtime (const std::string &html, ClaudeRuntimeOptions opts={}) |
| Run the Claude Design bundle in a headless JS engine and harvest the materialized DOM into a DesignIR. | |
| ClaudeClassNameRules | pulp::view::extract_claude_classnames (const std::string &html) |
| Extract classname → declaration map from a Claude Design HTML export. | |
| std::string | pulp::view::serialize_claude_classnames (const ClaudeClassNameRules &rules) |
| Serialize a ClaudeClassNameRules map to the JSON shape Spectr's extract.mjs produces. | |
Source adapters that lower external design exports into the normalized DesignIR: Figma / Stitch / v0 / Pencil / Claude HTML, Google DESIGN.md (lint / diff / Tailwind export), and the Claude Design / React runtime bundle envelope (unpack + headless runtime materialization).
The result and option value types these adapters exchange live in design_source_types.hpp (pulp-design-ir), so generic view code can carry them without reaching the importer.