Commit Graph

63 Commits

Author SHA1 Message Date
llcc
511712a39b add *swipe atom condition for unexpected swipe 2022-05-09 19:48:42 +08:00
llcc
8fb070ca78 feat(gesture): only enable swipe on single-touch 2022-05-06 16:20:00 +08:00
llcc
1a3725b255 feat(gesture): use goog.dom library 2022-05-06 16:20:00 +08:00
llcc
3f92bc7e90 feat(gesture): indent/outdent only when it is available 2022-05-06 16:20:00 +08:00
llcc
3d881a86ce feat(gesture): swipe right to indent block 2022-05-06 16:20:00 +08:00
Tienson Qin
904eff6d9d Core outliner operations refactoring (#4880)
* Add outliner nested transact!

Copied the code mostly from https://github.com/logseq/logseq/pull/4671
by zhiyuan

* refactor: insert-blocks

* fix: insert-blocks

* fix: move cursor to the last block when inserting

* fix: replace the current block when inserting and its content is empty

* keep only :insert-blocks

* expose only :delete-blocks

* Use existing implementations for move-nodes-up-down and

indent/outdent.

* fix editing state not updated immediately

* fix editing status

* fix: avoid recursive copy

* fix: inserting blocks after an empty block

* Implement move-blocks with insert-blocks

* fix: block left

* Implement move-blocks-up-down with move-blocks

* fix: paste text

* Implement indent-outdent-blocks with move-blocks

* fix: indent/outdent

* feat: multiple blocks drag && drop

* fix: indent/outdent blocks

* fix: drag drop

* Port unit tests for outliner.core

* enhance: open collapsed parent when indenting blocks

* refactor: block selection

* fix: indent/outdent blocks with different levels

* Add instrument on invalid outliner structure

* fix: can't write a block if the page has any outdated blocks

* fix: editing status for empty page

* fix: multiple drag & drop

* fix: drag & drop disallows moving from parents to its child

* fix: public property

* fix: can't delete first empty block

* Remove unused code

* fix: e2e tests

A workaround is to not select/highlight the block when pressing esc if it has
fenced code.

* remove unused code

* Add batch transaction test

* fix: update :block/page when dragging targets' children to another page

* Add more tests

* Simplify extract

* Replace db/get-conn with db/get-db

* Simplify extracting blocks from ast

* Code cleanup

* Code cleanup

* Add outliner core fuzzy tests

* Remove unused code

* fix: cursor not jump to the upper block when pressing Enter in the beginning

* fix: Enter in the beginning of a non-empty block

* Fix lint warnings

* Add editor random e2e tests

* Fix typo

* enhance: move some fns and add some comments

* enhance(outliner): add page-block? util

* fix: increase td width to prevent content overflow

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* First pass at file tests for file-sync

Each action usually passes by 5th try

* Fix two incorrect calls caught by tests

* More test improvements

- Easier auth setup
- subdirectory is configurable
- list graphs api also exercised

* Address cleanup from #3839

- Remove unused translation key
- Delete or TODO commented code
- Capitalize notifications to users

* fix quick capture template not working

* enhance(sync): add logout

* enhance: add logout i18n

* fix(plugin): sometimes plugin settings of gui not work when entry from app settings

* enable show-brackets? toggle for orgmode [[file:./pages/demo.org][demo]]

* fix(sync): fix unfinishable sync loop

* feature: logseq protocol; refactor persistGraph

* fix: deeplink support

* fix: broadcast persist graph on opening new graph with logseq protocol

* feat: logseq protocol open action for page-name and uuid

* fix: logseq protocol graph param validation

* ux: copy logseq URL of block

* enhance: remove the redundant 'open' from logseq protocol (v0.1)

* ux: page dropdown button for copy page URL

* chore: logseq protocol comments

* don't create new contents file when changing format

Logseq now creates a new contents file when users try to toggle the
preferred format, which causes file duplications error.

* fix pasting in src block not working on iOS

close https://github.com/logseq/logseq/issues/4914

* fix playing video goes into editing mode on iOS

* fix copy to clipboard failure on iOS

* add Podfile item

* fix mobile toolbar order not persisting after restart

* test(e2e): add test for backspace and cursor pos (#4896)

* test(e2e): add test for backspace and cursor pos
* fix(test): refine, fix wrong helper

* fix(ui): warn about illegal git commit interval

* enhance(editor): allow global git cmd shortcut

* style(settings): line-space of general/journals

* enhance(editor): accept enter in dummy block

Fix #4931

* fix editing state not updated immediately

* fix: can't write a block if the page has any outdated blocks

TODO: clean outdated blocks

* fix: editing status for empty page

* Random tree for outliner core tests

* Add pre assertions and fn docs based on Zhiyuan's suggestions

* Made some changes based on Gabriel's suggestions

* fix: tests

* fix: save current block before moving

* Updated the timeout to 100ms based on llcc's suggestion

https://github.com/logseq/logseq/pull/4880#discussion_r851966301

* api-insert-new-block! supports replace-empty-target?

* fix: replace all :reuse-last-block? usage

Co-authored-by: rcmerci <rcmerci@gmail.com>
Co-authored-by: Yue Yang <g1enyy0ung@gmail.com>
Co-authored-by: Gabriel Horner <gabriel@logseq.com>
Co-authored-by: llcc <lzhes43@gmail.com>
Co-authored-by: charlie <xyhp915@qq.com>
Co-authored-by: Junyi Du <junyidu.cn@gmail.com>
Co-authored-by: Andelf <andelf@gmail.com>
2022-04-19 11:14:38 +08:00
Tienson Qin
b5b0c1e06b fix: lazy loading ids 2022-04-02 21:40:28 +08:00
Tienson Qin
b0999efa47 Switch back to blocks tree instead of virtual list for now 2022-04-02 21:40:28 +08:00
Tienson Qin
2d5c929407 Improve performance of get-by-parent-&-left 2022-04-02 21:40:28 +08:00
Tienson Qin
7a095571f6 remove unused code 2022-04-02 21:40:28 +08:00
Tienson Qin
b6e02e18b1 fix: lazy loading in block embeds 2022-04-02 21:40:28 +08:00
Tienson Qin
2ea282b902 Reduce reactive queries for core outliner ops 2022-04-02 21:40:28 +08:00
Tienson Qin
c244674ad1 remove unused code 2022-04-02 21:40:28 +08:00
Tienson Qin
df597688b6 fix: simplify pagination loop 2022-04-02 21:40:28 +08:00
Tienson Qin
ee897c244b Refactor page loading 2022-04-02 21:40:28 +08:00
Tienson Qin
870f9e1e2e fix: remove nil from pull-many 2022-03-20 21:56:45 +08:00
Tienson Qin
d1cc77ae0c fix: when searching for text which is in a collapsed block, it is not opened
close #4017
2022-01-29 21:22:09 +08:00
Tienson Qin
69b75ef5f7 enhance: when search, zoom in to a block if it's a long page 2022-01-29 18:36:47 +08:00
Tienson Qin
7822848af8 chore: remove :block/title, :block/body and :block/unordered
For two reasons:

1. Reducing memory usage, both block/title and block/body are AST parsed
by Mldoc. After removing, logseq is able to handle 10k notes.

2. Simplify the db schema
2021-12-08 10:46:45 +08:00
llcc
fef5bbf068 enhance(clock): support recording in repeated block // cleanup unused namespaces (#2777)
* enhance(clock): support recording in repeated block

* cleanup: unused namespaces

* cleanup: missing-else-branch if --> when

* enhance: wider search results window for mobile browser

* fix: namespace requirement
2021-09-08 10:23:16 +08:00
Tienson Qin
42155bad7a refactor: tree-seq version of get-block-refs-with-children 2021-06-04 16:55:43 +08:00
Tienson Qin
742210d25d fix: filters work on block children too 2021-06-04 16:30:09 +08:00
Tienson Qin
799d0a24f1 refactor: remove dummy block 2021-05-28 21:12:11 +08:00
Tienson Qin
a64090e2a3 enhance: one-click to convert old markdown to new markdown files 2021-05-27 21:44:34 +08:00
Tienson Qin
717391e3db fix: re-find issue 2021-05-20 21:54:03 +08:00
rcmerci
4fe8d751d6 chore: clear codes 2021-05-17 20:35:30 +08:00
Tienson Qin
662fe83b7f fix: can't restore page's name if it includes reserved characters
Also, fixed issues related to renaming pages
2021-05-14 02:48:20 +08:00
Tienson Qin
0fee13bd62 fix: filters 2021-05-12 21:36:14 +08:00
Tienson Qin
c0df49a24a fix: can't create a new block when delete all the blocks 2021-04-30 22:34:38 +08:00
Tienson Qin
402c5db938 feat: preserve expand/collapse state
Also, fixed several issues related to data migration
2021-04-29 19:56:57 +08:00
Tienson Qin
45533ce77b Move to local bindings && events bus (#1686)
refactor: switch to global && local shortcuts

Also, use an events channel to decouple components and handlers
2021-04-25 09:43:18 +08:00
Tienson Qin
2f808c14bf refactor: simplify editor timeout 2021-04-18 17:27:07 +08:00
Tienson Qin
38b0ecae46 refactor: simplify dummy node 2021-04-07 20:17:43 +08:00
Tienson Qin
9e1b5beb9d refactor: create new pages 2021-04-07 17:33:43 +08:00
Tienson Qin
f6964065b6 chore: remove unused fns 2021-04-05 14:16:47 +08:00
Tienson Qin
10f7f078f7 fix: get-block-and-children 2021-04-05 14:14:44 +08:00
Tienson Qin
f2077701ab Merge branch 'master' into feat/outliner-core 2021-04-05 09:53:18 +08:00
defclass
2f790d3a34 style(outliner): move logic to outliner 2021-04-01 10:38:04 +08:00
defclass
633705fd03 refactor(outliner): connecting bewteen ui and outliner 2021-03-31 16:50:42 +08:00
Tienson Qin
58980188a8 fix: renaming a page without TITLE eats characters of the first line
Related to #1510
2021-03-30 22:55:48 +08:00
defclass
d4d4f9ee33 fix(outliner): fix render 2021-03-29 21:04:14 +08:00
defclass
9a75cb6431 fix(outliner): fix typo 2021-03-26 22:18:22 +08:00
defclass
168352ed6f style: update var name 2021-03-26 22:16:39 +08:00
defclass
cf582584e3 doc: update comment 2021-03-26 22:16:33 +08:00
defclass
df074f6c43 style: update code style 2021-03-26 22:05:02 +08:00
defclass
abc529cb9f fix(outliner): support random blocks passed into blocks->vec-tree 2021-03-26 21:36:17 +08:00
Tienson Qin
84fb245d8a fix: parse-block preserve parent and left 2021-03-25 22:00:51 +08:00
defclass
d88542f412 refactor(outliner): blocks->vec-tree 2021-03-25 16:46:46 +08:00
Tienson Qin
4dddaa66ab refactor: remove both :block/scheduled-ast and :block/deadline-ast 2021-03-23 14:55:01 +08:00
Tienson Qin
15dd3c46a7 refactor: db migrate 2021-03-15 09:50:06 +08:00