LivelyKernel / lively.next

lively.next is a personal programming kit. It emphasizes liveness, directness, and interactivity.
https://lively-next.org
MIT License
66 stars 16 forks source link

Embedded `Morphs` in `Text` should behave correctly with and without `Document` #600

Open linusha opened 1 year ago

linusha commented 1 year ago

Right now, we force Documents on Text with embedded Morphs. It would be nice to have them work without Documents as well.

This spans multiple different problem spaces:

  1. [ ] It should be possible to add lines either via drag-and-drop in interactive mode and programmatically by including them in textAndAttributes. The second scenario should work with document and without.
  2. [ ] Regardless of whether a Text has a document or not, its submorph-array should always contain its embedded morphs. They should also be correctly referenced in the embeddedMorphMap of the text.
  3. [ ] When a morph A is embedded into a text, calling A.owner should return the text. This should work with or without document.
  4. [ ] When a Morph gets removed from a text (either via drag-and-drop in interactive mode) or because the textAndAttributes of a Text were changed, the submorphs array of the text, its embeddedMorphMap and the owner of the previously embedded morph should be in a consistent state.
  5. [ ] Regardless of whether a text is backed by a document or not, embedded morphs should update their positions correctly.
linusha commented 1 year ago

This is related to #763.