reset() {
        this.chars = []
        this.length = 0
        this.pendingChunks = []
        this.advance = 0
        this.lineAdvance = 0
        this.attributes = null
        this.lastCharSpace = false
      }
Flows the content i.e. wraps the text into multiple lines, splits each line into chunks with the same
attributes, and sets the component state based on the result. This state is then used for rendering the
editor surface during the next render cycle. This should be called after any operation that may change
the content flow, such as inserting or deleting text.

One or more spaces at the end of a word are not "counted" for wrapping purposes because that would cause the
space to show up at the beginning of the next line. Instead, these spaces are included on the prior line
even though strictly it causes the line length to exceed the margin. This behavior is consistent with
common word processors such as Microsoft Word and Google Docs.

Even though all of the state here can be calculated from the replica, this is not done at render time
because the line state must be available when user input such as clicks or selections are made.

Because the algorithm to shortcut the flow before and after the changed area is complex, and can fail
without causing an obvious problem other than performance, debug statements are included and can be
enabled by setting FLOW_DEBUG to true.