Merge remote-tracking branch 'upstream/master' into whiteboards

This commit is contained in:
Peng Xiao
2022-08-26 15:46:20 +08:00
45 changed files with 656 additions and 563 deletions

View File

@@ -1953,7 +1953,12 @@
[tree-vec format {:keys [target-block keep-uuid?] :as opts}]
(let [blocks (block-tree->blocks tree-vec format keep-uuid?)
page-id (:db/id (:block/page target-block))
blocks (gp-block/with-parent-and-left page-id blocks)]
blocks (gp-block/with-parent-and-left page-id blocks)
block-refs (->> (mapcat :block/refs blocks)
(set)
(filter (fn [ref] (and (vector? ref) (= :block/uuid (first ref))))))]
(when (seq block-refs)
(db/transact! (map (fn [[_ id]] {:block/uuid id}) block-refs)))
(paste-blocks
blocks
opts)))