A table keeps each row's height on its cells, corrected after every
layout through a transaction. A read-only editor applies no transaction
(EditorState.apply returns while it isn't editable), so a table shown
read-only kept the heights it was stored with, or the default of one
line: a cell of several lines ran over its row's borders. The table's
own height (colsHeight) already took the read-only case in place; the
rows' heights now do the same. Upstream's main has the same code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MMm7usAo6q9ZZRoPkWjoxi
* feat: add command shortcut keys to convert text to title
* fix: use const values from heading block keys
* chore: add test cases for command
* fix: comments and nomenclature
* chore: add appropriate description
* feat: table navigation using TAB key
* feat: shift+tab for reverse navigation in table
* chore: circular traversal for arrow left and right
* test: added tests for tab and shift-tab commands in Table
* test: added tests for arrow left and right in table
* test: added corner case for tab and shift tab
* refactor: made changes as per the review
* refactor: Apply suggestions from code review
Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
---------
Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
* fix: table padding when it gets scrolled
The handler was getting out of region when table width was wider
than editor size.
* fix: modify scroll view padding
* fix: better column resize performance
* fix: resizing the table won't send transaction
* fix: lost selection after inserting table block
* fix: test
* refactor: don't pass editorState to TableNode
pass only transaction to methods directly.
* refactor: reduce extra transactions
* fix: mitigate Appflowy transaction adapter problem
With current transaction adapter in Appflowy which creates `BlockActionPB`
for `documentService` (backend). Its not possible to have multiple
`InsertOperation`s separately as a single transaction (multiple
`transaction.insertNode()`). The `BlockActionPB` creator (`toBlockAction`)
can't figure out the `prevId` (previous node of inserting node id), The
first insert operations shifts all next nodes path.
Because of this situation we decided to apply the insert operations one by
one.
* fix: table actions keep selection
* fix: on add col|row respect row|col bg color
* refactor: moving cell related keys to TableCellBlockKeys
* style: dart format
---------
Co-authored-by: Mohammad Zolfaghari <zidom72@gmail.com>
* feat: default text direction property
Introduced default text direction property on editor style. which
accepts rtl|ltr|auto for controlling default fallback direction.
Before this we had something controlled by Directionality but it
had two problems:
1. It didn't accept auto text direction. We had to introduce our
own Directionality component.
2. Directionality also affects layout direction, for example
setting Directionality to RTL will cause the handlers and other
things move to right side of the screen. While this is good but
there are cases which we don't want to change whole layout direction
but only the text default direction to for example auto.
* fix: flutter analyze
* fix: exception on prev node text direction null
The code was throwing excenption on changing current node text
direction to auto when the previous node had text direction attribute
with null value.
Also changed to only use direct previous node text direction and
direct parent for inheriting text direction when the current node
text direction is auto and undeterminable (e.g. empty text).
* feat: default text direction property
Introduced default text direction property on editor style. which
accepts rtl|ltr|auto for controlling default fallback direction.
Before this we had something controlled by Directionality but it
had two problems:
1. It didn't accept auto text direction. We had to introduce our
own Directionality component.
2. Directionality also affects layout direction, for example
setting Directionality to RTL will cause the handlers and other
things move to right side of the screen. While this is good but
there are cases which we don't want to change whole layout direction
but only the text default direction to for example auto.
* fix: flutter analyze
* fix: bugfix on auto as default text direction
* docs: make documentation clear
* fix: fixed the cursor not moving to next line after inserting divider
* test: added test
* fix: fixed failing checks
* fix: fixed issues from code review
* refactor: removed the use of depriciated function
* feat: Added divider to work with *
* chore: Resolved the suggested changes
* refactor: removed the check for star character
* feat:added character variable to insert divider .
* feat: support converting stars ** to divider
---------
Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>