|
|
@@ -32,11 +32,9 @@
|
|
|
[frontend.loader :as loader]
|
|
|
[goog.dom :as gdom]
|
|
|
[lambdaisland.glogi :as log]
|
|
|
- [medley.core :as medley]
|
|
|
[promesa.core :as p]
|
|
|
[reitit.frontend.easy :as rfe]
|
|
|
[sci.core :as sci]
|
|
|
- [logseq.graph-parser.util :as gp-util]
|
|
|
[frontend.version :as fv]
|
|
|
[frontend.handler.shell :as shell]
|
|
|
[frontend.modules.layout.core]))
|
|
|
@@ -442,11 +440,11 @@
|
|
|
|
|
|
(defn ^:export open_in_right_sidebar
|
|
|
[block-uuid]
|
|
|
- (editor-handler/open-block-in-sidebar! (medley/uuid block-uuid)))
|
|
|
+ (editor-handler/open-block-in-sidebar! (uuid block-uuid)))
|
|
|
|
|
|
(def ^:export edit_block
|
|
|
(fn [block-uuid ^js opts]
|
|
|
- (when-let [block-uuid (and block-uuid (medley/uuid block-uuid))]
|
|
|
+ (when-let [block-uuid (and block-uuid (uuid block-uuid))]
|
|
|
(when-let [block (db-model/query-block-by-uuid block-uuid)]
|
|
|
(let [{:keys [pos] :or {pos :max}} (bean/->clj opts)]
|
|
|
(editor-handler/edit-block! block pos block-uuid))))))
|
|
|
@@ -455,7 +453,7 @@
|
|
|
(fn [block-uuid-or-page-name content ^js opts]
|
|
|
(let [{:keys [before sibling isPageBlock properties]} (bean/->clj opts)
|
|
|
page-name (and isPageBlock block-uuid-or-page-name)
|
|
|
- block-uuid (if isPageBlock nil (medley/uuid block-uuid-or-page-name))
|
|
|
+ block-uuid (if isPageBlock nil (uuid block-uuid-or-page-name))
|
|
|
new-block (editor-handler/api-insert-new-block!
|
|
|
content
|
|
|
{:block-uuid block-uuid
|
|
|
@@ -480,7 +478,7 @@
|
|
|
(let [includeChildren true
|
|
|
repo (state/get-current-repo)]
|
|
|
(editor-handler/delete-block-aux!
|
|
|
- {:block/uuid (medley/uuid block-uuid) :repo repo} includeChildren)
|
|
|
+ {:block/uuid (uuid block-uuid) :repo repo} includeChildren)
|
|
|
nil)))
|
|
|
|
|
|
(def ^:export update_block
|
|
|
@@ -490,7 +488,7 @@
|
|
|
editing? (and edit-input (string/ends-with? edit-input block-uuid))]
|
|
|
(if editing?
|
|
|
(state/set-edit-content! edit-input content)
|
|
|
- (editor-handler/save-block! repo (medley/uuid block-uuid) content))
|
|
|
+ (editor-handler/save-block! repo (uuid block-uuid) content))
|
|
|
nil)))
|
|
|
|
|
|
(def ^:export move_block
|
|
|
@@ -505,8 +503,8 @@
|
|
|
|
|
|
:else
|
|
|
nil)
|
|
|
- src-block (db-model/query-block-by-uuid (medley/uuid src-block-uuid))
|
|
|
- target-block (db-model/query-block-by-uuid (medley/uuid target-block-uuid))]
|
|
|
+ src-block (db-model/query-block-by-uuid (uuid src-block-uuid))
|
|
|
+ target-block (db-model/query-block-by-uuid (uuid target-block-uuid))]
|
|
|
(editor-dnd-handler/move-blocks nil [src-block] target-block move-to) nil)))
|
|
|
|
|
|
(def ^:export get_block
|
|
|
@@ -565,11 +563,11 @@
|
|
|
|
|
|
(def ^:export upsert_block_property
|
|
|
(fn [block-uuid key value]
|
|
|
- (editor-handler/set-block-property! (medley/uuid block-uuid) key value)))
|
|
|
+ (editor-handler/set-block-property! (uuid block-uuid) key value)))
|
|
|
|
|
|
(def ^:export remove_block_property
|
|
|
(fn [block-uuid key]
|
|
|
- (editor-handler/remove-block-property! (medley/uuid block-uuid) key)))
|
|
|
+ (editor-handler/remove-block-property! (uuid block-uuid) key)))
|
|
|
|
|
|
(def ^:export get_block_property
|
|
|
(fn [block-uuid key]
|
|
|
@@ -637,7 +635,7 @@
|
|
|
|
|
|
(defn ^:export prepend_block_in_page
|
|
|
[uuid-or-page-name content ^js opts]
|
|
|
- (let [page? (not (gp-util/uuid-string? uuid-or-page-name))
|
|
|
+ (let [page? (not (util/uuid-string? uuid-or-page-name))
|
|
|
page-not-exist? (and page? (nil? (db-model/get-page uuid-or-page-name)))
|
|
|
_ (and page-not-exist? (page-handler/create! uuid-or-page-name
|
|
|
{:redirect? false
|
|
|
@@ -653,7 +651,7 @@
|
|
|
|
|
|
(defn ^:export append_block_in_page
|
|
|
[uuid-or-page-name content ^js opts]
|
|
|
- (let [page? (not (gp-util/uuid-string? uuid-or-page-name))
|
|
|
+ (let [page? (not (util/uuid-string? uuid-or-page-name))
|
|
|
page-not-exist? (and page? (nil? (db-model/get-page uuid-or-page-name)))
|
|
|
_ (and page-not-exist? (page-handler/create! uuid-or-page-name
|
|
|
{:redirect? false
|