Commit Graph

110 Commits

Author SHA1 Message Date
Tienson Qin
89edb3af9a fix: can't remove Many values 2024-05-02 18:03:17 +08:00
Tienson Qin
95eb0e7f4a Merge branch 'feat/db' into refactor/db-properties-schema 2024-04-29 15:55:23 +08:00
charlie
163ee38a8a enhance(ux): support shortcut to insert a new sibling block for the code mirror editing mode 2024-04-24 11:53:31 +08:00
charlie
3cb5fdbc97 fix(chore): typos 2024-04-23 17:30:22 +08:00
Tienson Qin
2d5eb0f79f enhance: editor experience
1. back to use container id + editing block id instead of block dom
ref to decide which block is in editing, to simplify edit-block! and
reduce browser gc.
2. set next editing block ahead of receiving the data changes from db
worker, so the editor feels a bit faster.
2024-04-08 21:10:12 +08:00
charlie
14ec0499d4 fix(ui): incorrect behavior of the code block editing 2024-03-18 20:08:34 +08:00
Tienson Qin
732b87a63f fix: code block e2e test 2024-01-14 15:33:06 +08:00
Tienson Qin
ee3442a44b Merge branch 'master' into feat/db 2023-11-14 20:40:36 +08:00
Ben Yorke
69e02edaeb Merge branch 'master' into feat/cmdk 2023-10-16 21:02:12 +02:00
Tienson Qin
d9ab81e00d enhance: use block dom node for editing instead of container 2023-10-11 00:46:47 +08:00
Andelf
438976c7e6 fix(code): guard nil editor dom obj 2023-09-26 17:19:42 +09:00
Ben Yorke
4e2d980955 button and cmdk 2023-06-30 09:37:07 +02:00
Ben Yorke
1e264c9c76 Update codemirror 2023-06-30 09:35:34 +02:00
Andelf
71b5fa3b97 Feat: auto-completion for config editing (#8584)
* feat(editor): add auto-completion for config editing
* enhance: filter keys already in file when autocompletion
2023-02-15 17:56:33 +08:00
situ2001
e2ff4b9600 fix: CodeMirror shortcuts cause page routing 2023-01-24 11:14:44 -05:00
Tienson Qin
f5e37091dd fix: save code block resets cursor position
close #7816
2023-01-02 11:30:35 +08:00
Tienson Qin
10704da424 fix: file content cleared when onblur 2022-12-20 10:53:21 +08:00
sid597
35badf5c52 use ->> for better readability 2022-12-16 21:24:01 +08:00
sid597
d2b45a59b3 Update code edit for the codeblocks that are opened in main area and sidebar,or as embeds 2022-12-16 21:24:01 +08:00
Tienson Qin
004870d81c fix: lint warning 2022-12-14 11:34:45 +08:00
Tienson Qin
4a93d27f40 feat(plugin): add save_focused_code_editor 2022-12-14 11:34:45 +08:00
Charlie
dda1f9bd9f Enhance / Plugin APIs (#6945)
Added
1. All configurations of current graph.
App.getCurrentGraphConfigs: () => Promise<any>
2. All favorite pages list of current graph.
App.getCurrentGraphFavorites: () => Promise<Array<string> | null>
3. All recent pages list of current graph.
App.getCurrentGraphRecent: () => Promise<Array<string> | null>
4. Clear right sidebar blocks.
App.clearRightSidebarBlocks: (opts?: { close: boolean }) => void
5. Support register CodeMirror enhancer. #Experiment feature
Experiments.registerExtensionsEnhancer<T = any>(type: 'katex' | 'codemirror', enhancer: (v: T) => Promise<any>)
6. Support hooks for app search service. #Alpha stage
App.registerSearchService<T extends IPluginSearchServiceHooks>(s: T): void
7. Support focus option for App.insertBlock. Credit to [[tennox]] #PR

Fixed
1. Adjust build script to be compatible for shadow-cljs bundler.
How to set up a clojurescript project with shadow-cljs?
https://github.com/rlhk/logseq-url-plus/blob/main/doc/dev-notes.md
2022-11-22 22:00:29 +08:00
Tienson Qin
0a796d11da fix: ``` surroundings in code block disappear
close #7015
close #7378
close #5735
2022-11-22 14:43:10 +08:00
Tienson Qin
a8244a8e1b fix: trim on nil 2022-10-12 20:52:30 +08:00
Charlie
01d879c18e feat!: File Sync (#5355)
- file sync for electron/ios/android
- age encryption of both file content and file path
- massive UI enhancement
- corresponding CI tasks

Co-authored-by: llcc <lzhes43@gmail.com>
Co-authored-by: rcmerci <rcmerci@gmail.com>
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Co-authored-by: Andelf <andelf@gmail.com>
Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2022-09-01 00:31:49 +08:00
Charlie
d9c9438abf Fix/custom css not reload (#6510)
* fix: custom css not reload when switching graph
* fix(ux): sometimes code editing auto save not work with blur event
2022-08-30 09:06:45 +08:00
Gabriel Horner
0275e5a067 Fix tabindex console react warnings (#6520)
Follow up to #6442
2022-08-29 15:37:56 -04:00
llcc
f52786a1c8 Merge branch 'master' into gesture-support-on-block 2022-05-26 10:58:38 +08:00
Tienson Qin
2eb5bbb6e8 fix: code not saved when click the bottom line to add a new block
related to #5406
2022-05-25 22:37:31 +08:00
llcc
ee3b578d99 Merge branch 'master' into gesture-support-on-block 2022-05-23 22:07:36 +08:00
llcc
e119fef6bd Merge branch 'master' into gesture-support-on-block 2022-05-12 09:58:53 +08:00
Gabriel Horner
20b8b9624d Moved nbb ns into graph-parser. nbb mldoc tests wip 2022-05-10 20:22:48 -04:00
llcc
17eb19d249 disable swipe gesture when scrolling mirrorcode editor 2022-05-09 15:50:28 +08:00
Gabriel Horner
af4b55c870 Consistent aliasing for frontend.config 2022-05-04 12:02:36 -04:00
Tienson Qin
46dedfb7eb fix: simplify code editor 2022-04-28 12:25:29 +08:00
Andelf
9938d1971b fix(code): do not accept tab in codemirror 2022-04-22 16:24:23 +08:00
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