Need
I would like to target an instance’s layer(s) associated with a boolean prop.
Analysis
The instance includes:
- A top node with the
componentProperties
array with boolean props each with a key with an appended{prop name}#{prop id}
, such asHelp text#3807:17
- An associated layer that has an
id
of{instance id}:{library component layer id}
, such asI347:39718;3807:28801
yet, as per the API docs, acomponentPropertyReferences
set tonull
. This is the node I want to target.
The instance’s .mainComponent
property is a reference to:
- A top component or set node with an
id
, in this case119:2895
- A top node also has
componentProperties
includingHelp text#3807:17
- A corresponding layer associated with the prop with an
id
, in this case119:3091
, as well ascomponentPropertyReferences
array includingvisible: Help text#3807:17
The actual variant resides in a separate library file, and includes:
- A top node with id
3807:27735
andcomponentPropertyDefinitions
that includesHelp text:3807:17
- A corresponding layer with
id
of3807:28801
andcomponentPropertyReferences
that includesvisible: "Help text:3807:17"
.
Problem
- The instance’s
.mainComponent
layerid
doesn’t match the instance’s layerid
., which means I can’t use information in the.mainComponent
to target that instance’s layer. - The instance’s layer
id
DOES match the actual variant via theirid
s (3807:28801
), which can be mapped within the actual variant by matching the prop definition of3807:17
.
However, I don’t know how to access the library file programmatically, so I can’t get to these matches. Using importComponentByKeyAsync
loads the component locally (which I’d like to avoid) and results in different layer id
s anyway, defeating the purpose.
Is there a different way other than mimicing the traversal (from the main component’s layer to the top, then down the same path in the instance) to more directly target a layer in an instance associated with a boolean property?