Commit Graph

74 Commits

Author SHA1 Message Date
Peng Xiao
628edb4775 fix: should also mute cursor blinks 2022-04-19 21:14:23 +08:00
Peng Xiao
bdf18a0793 fix: code block in published graph is not copyable 2022-04-19 21:14:23 +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
llcc
f4985fd8ef Feat: record audio on mobile (#4766)
* feat(audio): render audio link as component

* refactor frontend/component/block/inline

* fix audio component on mobile

* Fix(iOS): allow clock to replay audio

* feat(mobile): audio record

* add permission request code on record

* rename `editor/recording?` to `editor/record-status`

* move `get-asset-path` into handler/editor.cljs

* add android settings

* support sharing audio file from some apps

* enhance(record): insert audio link in a new block if non-editing

* feat(audio): allow cancelling record

* fix lints

* feat(iOS): add a tab bar

* tweak some css on mobile

* fix lints

* fix https://github.com/logseq/logseq/issues/4798

* enable tab bar on Android

* fix landscape height of tab bar

* add :reuse-last-block? option

* dont't show tab bar when editing mirror code

* tweak code-editor css

* increase width for more functional buttons

* fix card preview css on iPad

* add document-mode to tab bar

* remove tabbar when editing code and tweak textarea resize cursor behavior

* reduce SplashScreen launch screen duration

* don't show tabbar when editing page title

* enhance: float timer

* fix lint

* fix tabbar height on iPhone without notch

* remove .embed-page width

* fix lint

Co-authored-by: Andelf <andelf@gmail.com>
2022-04-12 20:17:54 +08:00
Tienson Qin
e37649299f use forked rum 2022-04-02 21:49:37 +08:00
Tienson Qin
1ef811ed8e fix code block 2022-04-02 21:49:37 +08:00
Tienson Qin
1682dc3c7e fix: avoid reentrancy when pressing ESC to quit codemirror 2022-04-02 21:40:29 +08:00
Peng Xiao
65f5f2e470 fix: disable some functions for published graph 2022-03-31 13:58:24 +08:00
Andelf
098173b97c fix(code): avoid calling .focus when editor close 2022-03-21 12:48:42 +08:00
Andelf
888cab7fa0 fix(code): avoid calling saving handler too often
Fix #4565
2022-03-15 11:17:29 +08:00
Tienson Qin
ee9b52248e Performance improvement: incremental queries (#4002)
Incremental queries
2022-02-17 20:26:03 +08:00
Tienson Qin
7f7b5e0c36 fix: codemirror style 2022-02-17 18:19:10 +08:00
Tienson Qin
bd3128ab6e fix: calc css 2022-02-17 18:19:10 +08:00
Tienson Qin
904c3a9114 fix: calc result overlaps with input text when the latter is very long
close #4147
2022-02-17 18:19:10 +08:00
Gabriel Horner
b7b3375f62 Lint extensions/ and wrap up hanging frontend dirs
fs/, format/ and logseq/ also added to linting by adding todos for later
inspection
2022-01-12 16:38:17 -05:00
Gabriel Horner
89bef5b26e Merge remote-tracking branch 'origin/master' into test/add-clj-kondo-part-two 2022-01-12 15:38:57 -05:00
Gabriel Horner
f1d15b0e05 Lint components and address comments in review
Start using :clj-kondo/ignore as lint violations that need to be
revisited. They may side effect and should be removed with better
understanding of their context
2022-01-12 15:32:47 -05:00
Tienson Qin
0f08340799 fix: pop up a saving confirmation dialog when losing focus 2022-01-12 11:52:28 +08:00
Andelf
967f89d5ac fix: rm debug print 2022-01-06 13:43:05 +08:00
Andelf
7e39d9efad feat(editor): add codemirror options support 2022-01-04 21:35:07 +08:00
Andelf
7024e9b4c3 fix(editor): refine file edting, fix state update
- update element state when switching files #3415
- notification when saved
- minor style change
- refine editor element id gen, use uuid
- add trailing newline to saved file

Fix #3415
2021-12-21 12:37:03 +08:00
Andelf
f838590ea5 fix(editor): handle convertion from file ext to language mode 2021-12-21 12:36:06 +08:00
Andelf
0e570ba45b refactor: simplify clojure lang mode setting 2021-12-21 12:36:06 +08:00
Andelf
9eb7c6f820 refactor(editor): use codemirror to guess code mode 2021-12-21 12:36:06 +08:00
Andelf
acabab5ba7 fix(editor): do not remove properties before parse 2021-12-16 19:23:10 +08:00
Andelf
0fa73c2786 feat(editor): add as many lanuage modes 2021-12-16 17:23:01 +08:00
Andelf
13e3ee2cc9 fix(editor): handle code block with non-latin1 chars 2021-12-13 14:59:29 +08:00
Andelf
b3f2871414 refactor(editor): refine saving of code editor
- won't remove indentations
- use pos-meta to save block
- debounce esc event against blur
2021-12-12 16:24:14 +08:00
Tienson Qin
b8e3298904 enhance: type ``` and press Enter to switch to codemirror 2021-11-26 21:04:10 +08:00
Tienson Qin
a5674b1728 fix: code block can't be saved 2021-11-26 19:15:33 +08:00
llcc
b2e3901631 fix slash command clashes with Org-mode italics (#3010)
* enhance: fix https://github.com/logseq/logseq/issues/990

Co-authored-by: leizhe <leizhe@leizhedeMacBook-Air.local>
2021-11-02 19:15:17 +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
Peng Xiao
401d85be5f feat: add protobuf mode 2021-08-27 13:37:20 +08:00
Tienson Qin
a378170c26 enhance: git auto-commit when detecting new changes from the disk 2021-08-24 23:59:48 +08:00
Weihua Lu
dde5b9d178 enhance: add codemirror r mode 2021-08-20 15:51:30 +08:00
Tienson Qin
e81e0046d6 feat: add sparql and turtle modes (codemirror) 2021-08-20 15:16:33 +08:00
Tienson Qin
bfaa65a996 fix: remove properties 2021-07-30 13:17:39 +08:00
Tienson Qin
d5dbdf6589 chore: bump mldoc 2021-07-30 12:57:27 +08:00
Tienson Qin
1142239c89 fix: timestamps in code block 2021-07-29 14:16:47 +08:00
Tienson Qin
ab8e04d14d fix: block timestamps in the code block 2021-07-16 19:40:36 +08:00
rcmerci
5c6c7a7939 fix: error when editing config.edn 2021-06-29 12:31:42 +08:00
Sebastian Bensusan
a196ddb8ed fix: set the codemirror block as the edited block when it is clicked (#2299) 2021-06-28 12:58:13 +08:00
Devon Zuegel
07e7e42b0e feat: add /calc slash command (#2244) 2021-06-21 11:19:01 +08:00
Sebastian Bensusan
56de7fbd40 feat: add ui for calculator mode in editor 2021-06-13 08:48:09 +08:00
Tienson Qin
b130f88bfc fix: code block editing issue 2021-06-11 00:12:03 +08:00
Tienson Qin
ed5ec08d84 fix: preventDefault error
close #2069
2021-06-03 02:05:06 +08:00
Tienson Qin
b8b24d9370 fix: keep codemirror mode is null when language not set
close #2066
2021-06-02 16:08:15 +08:00
Tienson Qin
73cea19caf fix: code not saved when update 2021-06-01 23:58:38 +08:00
charlie
81ae683689 fix(ui): code block theme when toggling theme 2021-06-01 21:48:45 +08:00
Tienson Qin
43d00d677d fix: inserting some weird characters on plain text and code blocks
close #2042
close #2037
2021-05-30 11:14:02 +08:00