|
|
@@ -16,6 +16,7 @@
|
|
|
[frontend.util :as util]
|
|
|
[logseq.api.block :as api-block]
|
|
|
[logseq.db :as ldb]
|
|
|
+ [logseq.db.common.entity-util :as common-entity-util]
|
|
|
[logseq.outliner.core :as outliner-core]
|
|
|
[logseq.sdk.core]
|
|
|
[logseq.sdk.experiments]
|
|
|
@@ -45,13 +46,13 @@
|
|
|
{:keys [sibling before schema]} opts
|
|
|
block (if before
|
|
|
(db/pull (:db/id (ldb/get-left-sibling (db/entity (:db/id target))))) target)
|
|
|
- sibling? (if (ldb/page? block) false sibling)
|
|
|
+ sibling? (if (common-entity-util/page? block) false sibling)
|
|
|
uuid->properties (let [blocks (outliner-core/tree-vec-flatten blocks' :children)]
|
|
|
(when (some (fn [b] (seq (:properties b))) blocks)
|
|
|
(zipmap (map :uuid blocks)
|
|
|
(map :properties blocks))))]
|
|
|
(p/let [result (editor-handler/insert-block-tree-after-target
|
|
|
- (:db/id block) sibling? blocks' (get block :block/format :markdown) true)
|
|
|
+ (:db/id block) sibling? blocks' :markdown true)
|
|
|
blocks (:blocks result)]
|
|
|
(when (seq blocks)
|
|
|
(p/doseq [block blocks]
|