Another approach requires changing Maqetta's source code. Right now, the widget definitions in widget.json includes allowedParent and allowedChild values to indicate that a particular widget (e.g., a Button) is only allowed to have certain parents and certain parents (e.g., TD) are only allowed to have particular children. The default settings that ship with Maqetta aren't comprehensive. It is sometimes possible for a user to drop a particular widget into a container which might cause problems.
If you want Maqetta to have additional smarts vs what is built in today, you'll need to beef up the logic in the main engine. Making those changes are likely to be somewhat of a challenge, but the place to start is to search the codebase for allowedParent and allowedChild, and try to understand what the code is doing. As I remember, the allowedParent/allowedChild logic is spread across ChooseParent.js, metadata.js, CreateTool.js and SelectTool.js, where ChooseParent.js is the most critical. ChooseParent.js decides which child is allowed in which parent while a widget drag operation is happening (e.g., dragging from the widget palette and dropping a new widget onto the canvas), and picks a different set of candidate parents depending on where the pointer is at any given moment.
Jon