fix: can't undo on CodeMirror blocks

This commit is contained in:
Tienson Qin
2023-04-24 17:14:44 +08:00
parent ab0c1c1860
commit 0b6cb1f20f
2 changed files with 6 additions and 17 deletions

View File

@@ -552,8 +552,7 @@
:shortcut.handler/editor-global
(->
(build-category-map [
:graph/export-as-html
(build-category-map [:graph/export-as-html
:graph/open
:graph/remove
:graph/add
@@ -580,7 +579,9 @@
:editor/copy
:editor/copy-text
:editor/cut
:command/toggle-favorite])
:command/toggle-favorite
:editor/undo
:editor/redo])
(with-meta {:before m/enable-when-not-component-editing!}))
:shortcut.handler/global-prevent-default
@@ -590,8 +591,7 @@
:editor/zoom-in
:editor/zoom-out
:editor/toggle-undo-redo-mode
:editor/undo
:editor/redo
:ui/toggle-brackets
:go/search-in-page
:go/search

View File

@@ -1560,12 +1560,6 @@ Similar to re-frame subscriptions"
(when-let [tldraw-el (.querySelector js/document.body ".logseq-tldraw[data-tlapp]")]
(gobj/get js/window.tlapps (.. tldraw-el -dataset -tlapp))))
(defn tldraw-editing-logseq-block?
[]
(when-let [app (active-tldraw-app)]
(and (= 1 (.. app -selectedShapesArray -length))
(= (.. app -editingShape) (.. app -selectedShapesArray (at 0))))))
(defn set-graph-syncing?
[value]
(set-state! :graph/syncing? value))
@@ -1737,14 +1731,9 @@ Similar to re-frame subscriptions"
[args]
(set-state! :editor/args args))
(defn editing-whiteboard-portal?
[]
(and (active-tldraw-app) (tldraw-editing-logseq-block?)))
(defn block-component-editing?
[]
(and (:block/component-editing-mode? @state)
(not (editing-whiteboard-portal?))))
(:block/component-editing-mode? @state))
(defn set-block-component-editing-mode!
[value]