Version 4.5.2
What's Changed
- #165 —
Variants only working correctly with duplicate layers
- fix(): add check to removes empty subclasses for generated elements
- fix(): use
randomUUID()
instead ofMath.random()
to calc temp IDs - feat(): accept
INSTANCE
as input for generating elements - fix(): change ID type to string; fix(): add extra check for leading underscore for child elements
- docs(): update elements documentation
- refactor(): break up FigmagicElements nested CSS logic into separate functions
- fix(): update
getUniqueValues
to only use first occurrence of a property (previously it matched the full line: key + value) - tests(): update "wrong" test to work with unique CSS properties
Full Changelog: v4.5.1...v4.5.2
Summary of changes
This release adds a number of smaller fixes that are mostly "under the hood". Most interestingly you are now able to use component instances as "input" when generating Elements, which could cut down on your redundancy and boilerplate when making variations (like buttons). This is still early days, so your mileage may vary on this feature.
What's become apparent during work on #165 is that the flat and nested elements code bases are pretty dissimilar and I'm reminded of how they really should be synced. The deduplication done for nested elements is not strictly 1:1 with how it works for "flat" elements meaning you may end up with duplicate properties. This is now addressed. Note that this change may impact your currently generated elements.