23#include <unordered_map>
142 const std::string& json);
156 const std::string& json);
224 const std::string& component_name =
"JsxComponent");
Normalized intermediate representation (IR) for imported designs: the IR value model (style,...
Importer operations over the DesignIR value model: canonical JSON serialize/parse,...
Value types exchanged with the design-source adapters: DESIGN.md parse and diff results,...
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
ClaudeClassNameRules extract_claude_classnames(const std::string &html)
Extract classname → declaration map from a Claude Design HTML export.
std::optional< ClaudeBundle > 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...
DesignMdParseResult parse_designmd(const std::string &markdown)
Parse a DESIGN.md file (YAML frontmatter + Markdown body) into a DesignIR.
SnapshotDynamicApiScan detect_jsx_snapshot_dynamic_apis(std::string_view source)
Detect dynamic APIs that make a JSX baked snapshot non-deterministic unless the caller explicitly acc...
std::optional< ClaudeBundle > 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.
DesignIR parse_designmd_yaml(const std::string &markdown)
Thin wrapper that returns just the IR.
DesignIR parse_claude_html(const std::string &html)
Parse a Claude Design standalone HTML export into a DesignIR.
std::optional< ClaudeBundle > parse_figma_make_react(const std::string &tsx)
Normalize a constrained Figma Make React TSX export into the runtime-import bundle payload shape.
MaterializedDocumentCacheStats materialized_document_cache_stats()
std::optional< ClaudeBundle > parse_stitch_react(const std::string &tsx)
Normalize a constrained Google Stitch React export into the runtime-import bundle payload shape.
DesignIR 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...
std::shared_ptr< const ClaudeBundle > parse_materialized_browser_document_shared(const std::string &json)
parse_materialized_browser_document with process-wide reuse.
std::optional< ClaudeBundle > parse_react_native_export(const std::string &tsx)
Normalize a constrained React Native single-file component export into the runtime-import bundle payl...
std::string export_tailwind_v4_css(const DesignMdParseResult &parsed)
Emit a Tailwind v4 @theme { ... } CSS block from the parsed token tree.
void clear_materialized_document_cache()
Drop every kept document (tests; a host that wants the memory back).
DesignIR parse_v0_tsx(const std::string &tsx)
Parse v0-generated TSX/Tailwind into a DesignIR.
std::string serialize_claude_classnames(const ClaudeClassNameRules &rules)
Serialize a ClaudeClassNameRules map to the JSON shape Spectr's extract.mjs produces.
DesignIR parse_pencil_json(const std::string &json)
Parse Pencil node tree JSON into a DesignIR.
std::string synthesize_runtime_envelope(const ClaudeBundle &bundle)
Synthesize a Claude-style HTML envelope around an arbitrary ClaudeBundle so the existing parse_claude...
DesignSource
Definition design_ir.hpp:37
@ html
Definition design_ir.hpp:46
std::string export_tailwind_v3_json(const DesignMdParseResult &parsed)
Emit a Tailwind v3 theme.extend-shaped JSON object from the parsed token tree.
DesignIR parse_figma_plugin_json(const std::string &json)
Parse Pulp's "Design for Pulp" Figma-plugin export envelope.
std::optional< ClaudeBundle > parse_materialized_browser_document(const std::string &json)
Decode the deterministic pre-mount document emitted by Chromium browser capture.
DesignIR parse_stitch_html(const std::string &html)
Parse Stitch HTML export into a DesignIR.
DesignMdDiffResult 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 r...
std::optional< ClaudeBundle > parse_claude_bundle(const std::string &html)
Decode the bundler envelope from a Claude Design standalone HTML file.
std::map< std::string, std::map< std::string, std::string > > ClaudeClassNameRules
Definition design_source_types.hpp:160
std::optional< DesignSource > parse_design_source(const std::string &name)
Convert string to DesignSource, returns nullopt for unknown sources.
std::optional< ClaudeBundle > parse_pencil_react(const std::string &tsx)
Normalize a constrained Pencil/OpenPencil sanitized Tailwind-JSX export into the runtime-import bundl...
std::vector< DesignMdDiagnostic > lint_designmd(const DesignMdParseResult &parsed)
Run Pulp's Google design.md compatibility lint against a parsed DESIGN.md.
DesignIR parse_figma_json(const std::string &json)
Parse a Figma export JSON into a DesignIR.
std::vector< std::string > runtime_import_whole_scripts(const ClaudeBundle &bundle)
The whole scripts a live editor evaluates when it imports bundle at run time (__pulpRuntimeImport__):...
const char * design_source_name(DesignSource source)
Convert DesignSource to display name.
Result of unpacking a Claude Design bundle's <script type="__bundler/manifest">.
Definition design_source_types.hpp:113
Options for the --execute-bundle import lane.
Definition design_source_types.hpp:133
Complete design IR document.
Definition design_ir.hpp:791
Definition design_source_types.hpp:71
Definition design_source_types.hpp:45
Definition design_source_types.hpp:123
Definition design_source_types.hpp:21