webwriter-app / webwriter

Authoring tool for interactive content
https://webwriter.app
Other
14 stars 1 forks source link

Container Switching #38

Open salmenf opened 1 year ago

salmenf commented 1 year ago

Some nodes in the model are containers, for example the built-in lists and headings. Furthermore, widgets can also work as containers with slots. Authors should be able to switch between (compatible) types of containers.

How can this be implemented? Fundamentally, there is a target node and zero or more original nodes which need to be fit inside the target node.

  1. Parse and resolve the target node's content expression. This yields a content tree in which the original nodes can be fitted.
  2. Based on the content, find a way to fill the target node with the original nodes. Try several strategies for this:
    1. If there are no original nodes: Insert an empty target node (with default content according to spec).
    2. If there are one or more original nodes: Try to fit???