Resizable Groups with parenthood determined by location of nodes inside it

We need functionality similar to the Resizable Groups that is available GoJS Sized Groups -- Northwoods Software
The group can be resized manually, and w/o connection to the children layout inside it.
The children inside the group can be moved around and even move outside the group.

The only feature we are missing is that when child nodes are dragged outside the group, the remain connected to the group, and move when the group is moved (they seem to remain children of the group even when put outside the group).

We would like the group parenthood relation to be determined by the position of the child node. If any non-child node is dragged into the group, it needs to become a child of that group. If, on the other hand a child is dragged of the group, it needs to no longer be grouped by it.

Any advice?

Do something like the Planogram sample, Planogram or the Regrouping sample, Regrouping Demo.

Fundamentally, implement event handlers for mouseDrop on both the Group, GraphObject | GoJS API as well as the Diagram, Diagram | GoJS API.

Note also the convenience property that you’ll probably want to set to true: Group | GoJS API.