Commit graph

854 commits

Author SHA1 Message Date
Lucas.Xu
19f999f422
feat: optimize the performance (#442) 2023-09-11 15:03:14 +08:00
Mayur Mahajan
ad55171c5b
refactor: migrate tests (#438)
* refactor: separate remove line command

* test: delete sentence

* chore: export delete left line command

* refactor: move from internal_key_handler to new

* refactor: move from command to new
2023-09-11 14:24:50 +08:00
Antony Kithinzi
2924c167e2
feat: bulk open links shortcut (#419)
* feat: creating open links shortcut command

* test: open links command

* refactor: applying suggestion

* refactor: fetching all unique links by a chain function
2023-09-11 14:23:45 +08:00
Mathias Mogensen
574741265b
fix: request focus in find replace menu (#440) 2023-09-11 14:21:58 +08:00
Lucas.Xu
dd59eb5210
feat: implement delta diff and provide external values (#444)
* feat: support diff funciton in delta

* feat: support diff funciton in delta
2023-09-11 11:29:25 +08:00
Lucas.Xu
3f2db9b416
feat: simplify auto scroll behavior in ScrollServiceWidget (#437) 2023-09-04 13:36:39 +08:00
Lucas.Xu
0e55cce14f
chore: bump version 1.3.0 (#435) 2023-09-01 12:54:53 +08:00
Mohammad Zolfaghari
b429ae6b96
fix: better column resize performance (#434)
* 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
2023-09-01 10:48:13 +08:00
Mohammad Zolfaghari
9143c1fd48
fix: table padding and selection (#432)
* 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
2023-09-01 10:40:45 +08:00
Lucas.Xu
f205f8040a
fix: table block bugs (#431)
* 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>
2023-08-31 10:35:23 +08:00
Lucas.Xu
a912c1c965 fix: refactor text alignment handling in block components 2023-08-29 21:33:30 +08:00
Lucas.Xu
e59b36173f
Revert "fix: remove flutter overlay (#358)" (#427)
* Revert "fix: remove flutter overlay (#358)"

This reverts commit 81fbb40fff.

* fix: hide toolbar when the selection area is invisible
2023-08-29 17:18:06 +08:00
Lucas.Xu
836e4cbd70
feat: support alignment for block component (#425) 2023-08-29 16:43:24 +08:00
Mathias Mogensen
81fbb40fff
fix: remove flutter overlay (#358)
* fix: remove flutter overlay

* fix: hide toolbar if selection is not visible

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-08-29 15:52:59 +08:00
Mayur Mahajan
7a03439c82
feat: toggle highlight using ctrl/cmd + shift + h (#333)
* feat: add highlight command shortcut

* feat: toggle highlight in markdown commands

* refactor: customizable highlight color

* feat: taking color from editor page
2023-08-29 15:25:08 +08:00
Mohammad Zolfaghari
dd52ce6718
feat: table plugin (#62)
* feat: table plugin requisites

* feat: moved table plugin to appflowy-editor

* fix: flutter analyze

* fix: dont use nested maps in node attributes

rust backend (flowy-document) doesn't support it.

* feat: add table to appflowy editor default selection menu

* feat table markdown encoder

* refactor: apply @Xazin review suggestions

* refactor: merge main and fix color picker conflicts

* feat: table markdown decoder

* fix: use specific backgroun generator for table

* feat: table plugin

* style: adapt new structure

* fix: table columns border height

* fix: adapt new style key commands

* fix: remove table context menu

* test: adapt to main branch changes

* fix: backspace handling regarding table

* fix: flutter analyze

* fix: enter when table cell is bullet list

* fix: selection bug on large table

* feat: row/col action menu

* fix: row action handler positioning

* refactor: merge row and col handler widget

* refactor: add size and color to handler icon

* style(merge): merge main

* feat: added padding and action wrapper

* feat: enable customizing icons and etc

* feat: table menu builder

* fix: table getBlockRect

* refactor: table action button design

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-08-29 15:24:25 +08:00
Mohammad Zolfaghari
cda17c7b94
feat: editor state update node (#405)
* 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: editor state update node

Use update node when the purpose is only adding new attribute to
node. format node causes extra unnessesary delete operation.
2023-08-29 15:21:38 +08:00
Mohammad Zolfaghari
e2fc87f892
fix: exception on prev node text direction null (#404)
* 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).
2023-08-29 15:20:50 +08:00
Ali Hassan
72d6c52f25
fix: html encoder not adding multiple text decorations (#424)
* fix: html encoder not adding multiple text decorations

* fix: html encoder with multiple attributes more test added
2023-08-29 15:02:01 +08:00
Mohammad Zolfaghari
9105812cbc
feat: default text direction property (#402)
* 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
2023-08-28 17:13:04 +08:00
Mukund Tandon
5a0a6fa5e0
fix: fixed the cursor not moving to next line after inserting divider (#371)
* 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
2023-08-28 17:11:58 +08:00
Lucas.Xu
20ddb03cca chore: update theme colors for editor 2023-08-28 16:35:57 +08:00
Lucas.Xu
efba5ae5d3 feat: refactor floating toolbar positioning logic 2023-08-28 16:16:02 +08:00
Lucas.Xu
3a790e2f42 fix: update resizable image width calculation with minimum width constraint 2023-08-28 15:09:05 +08:00
Mayur Mahajan
c722ec142d
chore: comment suggesting use of deprecated method (#417) 2023-08-28 11:03:56 +08:00
Mayur Mahajan
e38b07d13b
fix: replace matches on the same node (#418)
* test: failing test for expected behavior

* test: fix test by removing enter

* fix: replace all fixed

* chore: remove unused code

* test: replace selected called multiple times

* chore: remove unused variable
2023-08-28 11:02:41 +08:00
Lucas.Xu
a9af2bbd37
fix: rect of the divider block is incorrect (#415)
* fix: rect of the divider block is incorrect

* fix: only show the context menu when the gesture hit the selection area

* chore: change image upload widget UI

* fix: context menu test
2023-08-25 18:02:24 +08:00
Lucas.Xu
81186fa857
chore: bump version 1.2.4 (#414) 2023-08-25 16:11:19 +08:00
Lucas.Xu
1922e56903
feat: migrate copy paste command from AppFlowy (#413) 2023-08-25 15:58:33 +08:00
Mukund Tandon
687af49f63
feat: added support for custom parser for markdown to document (#403) 2023-08-25 15:58:22 +08:00
APPFLOWY\tsuiy
790d3fda53 feat: improve CJK IME support 2023-08-25 14:56:28 +08:00
Lucas.Xu
28c5adf0f9 feat: add support for context menu items to the editor 2023-08-24 19:17:13 +08:00
Lucas.Xu
f4db21c367 fix: refactor _onSelectionChange method to update _showPlaceholder state more efficiently 2023-08-23 10:33:36 +08:00
Lucas.Xu
6b15d6cca6
fix: typo (#408) 2023-08-23 00:49:08 +08:00
Lucas.Xu
a8eb042d27
Fix selected nodes (#407)
* fix: miss the nested node when copying

* fix: miss the nested node when copying
2023-08-23 00:45:54 +08:00
Lucas.Xu
aaef934f07
fix: miss the nested node when copying (#406) 2023-08-23 00:38:41 +08:00
Johan Sutrisno
5e78abc36f
feat: skip whitespace between words while navigating with CTRL+ARROW keys (#363)
* feat: skip whitespace between words while navigating with CTRL+ARROW keys

* refactor: testing for arrow keys handler

* refactor: testing for arrow keys handler

* refactor: refactor var to final

* test: Presses arrow left/right/up/down + meta in not collapsed and forward selection except macos

* refactor: refactor test alt+arrow up

* refactor: refactor test alt+arrow down

* refactor: resolve suggestion of code

* refactor: resolve suggestion of code

* refactor: resolve suggestion of code

---------

Co-authored-by: Johan Sutrisno <johan@zero-one-group.com>
2023-08-21 11:47:07 +08:00
Mathias Mogensen
2eb801e7f5
feat: double hyphen to em dash (#395)
* feat: double hyphen to em dash

* chore: fix tests

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-08-21 11:46:45 +08:00
Sean Riley Hawkins
1f2668c18a
fix: add variable to hold editor selection for colour menu (#400)
* fix: add variable to hold selection

* fix: keep the selection area when editing color

---------

Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
2023-08-21 11:46:04 +08:00
MayurSMahajan
de779ab87a test: open link command 2023-08-21 10:43:06 +08:00
MayurSMahajan
807a8dfb96 refactor: show link command test 2023-08-21 10:43:06 +08:00
MayurSMahajan
22b56130e8 refactor: show link menu command 2023-08-21 10:43:06 +08:00
MayurSMahajan
52231f885f feat: open link command 2023-08-21 10:43:06 +08:00
Mathias Mogensen
61be737fe2
fix: placeholder on paragraph when selected (#390)
* fix: placeholder on paragraph when selected

Closes: #380

* fix: review comment
2023-08-17 09:45:28 +02:00
Lucas.Xu
56474e8bd9 fix: revert the customSlashCommand function 2023-08-17 14:07:19 +08:00
Lucas.Xu
378ff75a97 fix: test error 2023-08-17 13:49:51 +08:00
Mathias Mogensen
0d4a00a848 chore: remove highlight toolbar item (unused) 2023-08-17 13:13:45 +08:00
Mathias Mogensen
2dabbebb43 test: improve coverage of link mobile toolbar item 2023-08-17 13:13:45 +08:00
Mathias Mogensen
52486cc6a3 test: improve coverage 2023-08-17 13:13:45 +08:00
Mathias Mogensen
c38fe1625d test: mobile selection gesture 2023-08-17 13:13:45 +08:00