119std::optional<std::string>
143std::vector<LockResult>
145 const std::vector<LockToSourceTweak>& tweaks);
Import design files from external tools (Figma, Stitch, v0, Pencil) into Pulp's web-compat JS format.
Hover-cursor tracking for platform window hosts.
Definition fwd.hpp:27
@ inserted
Definition design_update.hpp:10
LockResult lock_tweak_into_source(const std::string &source, const LockToSourceTweak &tweak)
Locate the element anchored by tweak.anchor_id in a generated web-compat JS/TSX source string and rew...
LockStatus
Outcome status for a single lock attempt.
Definition lock_to_source.hpp:58
@ already_current
The element block was found and the property already held exactly value — the source text is unchange...
Definition lock_to_source.hpp:66
@ anchor_not_found
No // @pulp-anchor <id> comment matched anchor_id.
Definition lock_to_source.hpp:70
@ rewritten
The property line existed and its value was rewritten.
Definition lock_to_source.hpp:60
@ inserted
No line for the property existed; a new el.style.
Definition lock_to_source.hpp:63
std::optional< std::string > lock_property_to_style_name(const std::string &property_path)
Map a dotted tweak property_path (paint.backgroundColor, style.width, layout.padding,...
@ already_current
The element and prop were found and the prop already held exactly value — source unchanged (idempoten...
Definition jsx_lock.hpp:85
@ anchor_not_found
No element carried data-pulp-anchor="<anchor_id>".
Definition jsx_lock.hpp:88
std::vector< LockResult > lock_tweaks_into_source(const std::string &source, const std::vector< LockToSourceTweak > &tweaks)
Lock several tweaks into the same source in one pass.
@ unsupported_property
Definition design_ir.hpp:702
bool is_generated_source(const std::string &source)
Heuristic guard for the generated-file boundary.
LockResult reparent_in_source(const std::string &source, const ReparentToSourceEdit &edit)
Rewrite the dragged element's appendChild receiver so the generated source wires it under the new par...
Result of locking one tweak into a generated source string.
Definition lock_to_source.hpp:77
std::string style_property
The CSS-style property name the path resolved to (camelCase, e.g.
Definition lock_to_source.hpp:85
std::string message
Human-readable summary, suitable for CLI / inspector display.
Definition lock_to_source.hpp:87
int line
1-based line number of the rewritten / inserted assignment, or 0 when nothing was located.
Definition lock_to_source.hpp:90
bool mutated() const
True when the lock changed the source text.
Definition lock_to_source.hpp:93
std::string source
The (possibly rewritten) source text.
Definition lock_to_source.hpp:82
LockStatus status
Definition lock_to_source.hpp:78
bool ok() const
True when the anchor was located, regardless of whether a rewrite was needed (already_current counts ...
Definition lock_to_source.hpp:99
A single tweak to promote into source.
Definition lock_to_source.hpp:48
std::string anchor_id
Definition lock_to_source.hpp:49
std::string property_path
Definition lock_to_source.hpp:50
std::string value
The tweaked value, already stringified the way it should appear in the generated source's JS string l...
Definition lock_to_source.hpp:54
A single structural reparent to promote into source: move the element anchored by child_anchor_id to ...
Definition lock_to_source.hpp:172
std::string insert_after_anchor_id
Definition lock_to_source.hpp:175
std::string child_anchor_id
Definition lock_to_source.hpp:173
std::string new_parent_anchor_id
Definition lock_to_source.hpp:174