Adding new step props: observables + highlight selectors #266
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
hey! 😊
I recently needed some improvements around the svg mask shape.
Basically, I wanted 3 new features:
data-*attributes(at the moment we can only highlight one element)
(at the moment the svg mask do not redraw on DOM node changes so node can be hidden)
(at the moment the svg mask do not redraw when DOM node is resized so node can be hidden)
So I suggest adding three new step properties:
highlightedSelectors: Array of selectors, each selected node will be included (by union) in the highlighted region of the mask ;mutationObservables: Array of selectors, each selected node DOM addition/removal will triggered a rerender of the mask shape ;resizeObservables: Array of selectors, each selected node resize will triggered a rerender of the mask shape.This PR targets the
v1branch but I saw the work onmasterwith the react hooks refacto so I tried to make the integration in master in the future as easy as possible.Also, I've updated the README and provided a new step in the demo to demonstrate how we can use these 3 new properties.
Hope you will find this PR useful.
Let me know your feedback. Thanks!