dmonad on v13.5.45
dmonad on main
13.5.45 (compare)
dmonad on main
bump typescript and fix type is… add whenSynced and isSynced pro… (compare)
styleDef = {
from = position_pointer,
to = position_pointer,
type: ["bold" | "Italic" | ..]
}
word
/ br
already stores a position pointerword = {
content: String,
styles: [ style ]
}
style = {
type: bold|italic|…,
selection: selection
}
selection = {
fromWord: Number,
fromPos: Number,
toWord: Number,
toPos: Number
}
Don't you mean to specify references to the words?
selection = {
fromWord: word,
fromPos: Number,
toWord: word,
toPos: Number
}
Furthermore, I don't think its the best idea to store a reference to the style from the word (just because its not necessary). It suffices that the most left, and the most right word stores a reference to the style or reference.
word1 = {
content : "Hello",
ref_left = [sel1, sel2],
ref_right = [sel1, sel2]
}
sel1 = {
fromWord : word1
fromPos: 2
toWord: word1
toPos: 4
type: italic
}
sel2 = {
fromWord : word1
fromPos: 0
toWord: word1
toPos: 6
type: bold
}