mirror of
https://github.com/logseq/logseq.git
synced 2026-06-01 19:01:22 +00:00
cmdk initial implementation
This commit is contained in:
@@ -193,8 +193,16 @@
|
||||
(state/set-edit-content! edit-id new-value)
|
||||
(cursor/move-cursor-to input (+ cur-pos forward-pos))))))
|
||||
|
||||
(-> (random-uuid) str)
|
||||
|
||||
(defn open-block-in-sidebar!
|
||||
[block-id]
|
||||
; (assert (uuid? block-id) "frontend.handler.editor/open-block-in-sidebar! expects block-id to be of type uuid")
|
||||
(js/console.log "db-entity/block" block-id)
|
||||
(js/console.log "db-entity/entity" (db/entity [:block/uuid block-id]))
|
||||
; (js/console.log "db-entity/types" (str block-id) (uuid block-id))
|
||||
; (js/console.log "db-entity/string" (db/entity [:block/uuid (str block-id)]))
|
||||
; (js/console.log "db-entity/uuid" (db/entity [:block/uuid (uuid block-id)]))
|
||||
(when block-id
|
||||
(when-let [block (db/entity [:block/uuid block-id])]
|
||||
(let [page? (nil? (:block/page block))]
|
||||
@@ -831,9 +839,9 @@
|
||||
concat-prev-block? (boolean (and prev-block new-content))
|
||||
transact-opts (cond->
|
||||
{:outliner-op :delete-blocks}
|
||||
concat-prev-block?
|
||||
(assoc :concat-data
|
||||
{:last-edit-block (:block/uuid block)}))]
|
||||
concat-prev-block?
|
||||
(assoc :concat-data
|
||||
{:last-edit-block (:block/uuid block)}))]
|
||||
(outliner-tx/transact! transact-opts
|
||||
(if concat-prev-block?
|
||||
(let [prev-block' (if (seq (:block/_refs block-e))
|
||||
@@ -1267,7 +1275,7 @@
|
||||
|
||||
(defn save-block!
|
||||
([repo block-or-uuid content]
|
||||
(save-block! repo block-or-uuid content {}))
|
||||
(save-block! repo block-or-uuid content {}))
|
||||
([repo block-or-uuid content {:keys [properties] :as opts}]
|
||||
(let [block (if (or (uuid? block-or-uuid)
|
||||
(string? block-or-uuid))
|
||||
|
||||
Reference in New Issue
Block a user