grommet / grommet-designer

Apache License 2.0
36 stars 18 forks source link

Fix copying components with deep property components #100

Closed ericsoderberghp closed 2 years ago

ericsoderberghp commented 2 years ago

The essence of this is a new hook called copy that allows component types to tap into when components are copied, allowing the type to determine if there is something embedded in its properties that needs copying.

See line 160 of change.js where this is called and line 1605 of the grommet components.js file for an example of using it.

The bulk of these changes are to ensure we pass libraries around everywhere we need it, since that's where we get the type for a component.