Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
anchor_strategy.hpp
Go to the documentation of this file.
1#pragma once
2
31
33#include <string>
34#include <string_view>
35#include <vector>
36
37namespace pulp::view {
38
45
62 AnchorStrategy strategy,
63 std::string_view adapter_name = "");
64
67 std::string path;
68 std::string previous;
69 std::string anchor;
70 std::string first_path;
71};
72
84std::vector<AnchorDisambiguation> resolve_anchor_collisions(IRNode& root);
85
100std::string compute_anchor_id(const IRNode& node,
101 std::string_view parent_anchor,
102 std::size_t sibling_tag_index_for_path,
103 std::size_t depth,
104 std::size_t sig_index_for_content_hash,
105 AnchorStrategy strategy,
106 std::string_view adapter_name = "");
107
111
112} // namespace pulp::view
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
AnchorStrategy
Strategy for computing stable_anchor_id values. See header comment.
Definition anchor_strategy.hpp:40
@ content_hash
Definition anchor_strategy.hpp:41
@ adapter
Definition anchor_strategy.hpp:43
@ path
Definition anchor_strategy.hpp:42
void assign_anchors(IRNode &root, AnchorStrategy strategy, std::string_view adapter_name="")
Walk root and populate stable_anchor_id on every node according to strategy.
AnchorStrategy default_anchor_strategy(DesignSource source)
Map a DesignSource to its default anchor strategy.
std::vector< AnchorDisambiguation > resolve_anchor_collisions(IRNode &root)
Makes every derived anchor in root unique, in document order over children.
DesignSource
Definition design_ir.hpp:37
std::string compute_anchor_id(const IRNode &node, std::string_view parent_anchor, std::size_t sibling_tag_index_for_path, std::size_t depth, std::size_t sig_index_for_content_hash, AnchorStrategy strategy, std::string_view adapter_name="")
Compute a single anchor without walking.
One derived anchor a collision pass replaced.
Definition anchor_strategy.hpp:66
std::string path
$/children[i]/... of the node that changed
Definition anchor_strategy.hpp:67
std::string first_path
the earlier node that keeps previous
Definition anchor_strategy.hpp:70
std::string anchor
its new anchor
Definition anchor_strategy.hpp:69
std::string previous
the anchor it shared
Definition anchor_strategy.hpp:68
Definition design_ir.hpp:614