Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@
frontend.config/ENABLE-FILE-SYNC-PRODUCTION #shadow/env ["ENABLE_FILE_SYNC_PRODUCTION" :as :bool :default true]
frontend.config/ENABLE-RTC-SYNC-PRODUCTION #shadow/env ["ENABLE_RTC_SYNC_PRODUCTION" :as :bool :default true]
frontend.config/REVISION #shadow/env ["LOGSEQ_REVISION" :default "dev"]} ;; set by git-revision-hook

:devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function
:after-load frontend.core/start ;; after live-reloading finishes call this function
:watch-path "/static"
:preloads [devtools.preload
shadow.remote.runtime.cljs.browser]
:loader-mode :eval
;; :ignore-warnings true
}}

Expand Down Expand Up @@ -98,7 +99,8 @@
:after-load frontend.core/start ;; after live-reloading finishes call this function
:watch-path "/static"
:preloads [devtools.preload
shadow.remote.runtime.cljs.browser]}}
shadow.remote.runtime.cljs.browser]
:loader-mode :eval}}
:mobile {:target :browser
:module-loader true
:js-options {:js-provider :external
Expand Down
5 changes: 3 additions & 2 deletions src/main/frontend/commands.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@

(defn db-based-priorities
[]
(map (fn [e] (:block/title e))
(map (fn [e] (str "Priority " (:block/title e)))
(db-pu/get-closed-property-values :logseq.property/priority)))

(defn get-priorities
Expand All @@ -272,7 +272,8 @@
(db-based-priorities)
(file-based-priorities))
(mapv (fn [item]
(let [command item]
(let [command item
item (string/replace item #"^Priority " "")]
[command
(->priority item)
(str "Set priority to " item)
Expand Down
31 changes: 19 additions & 12 deletions src/main/frontend/components/query/builder.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,12 @@

(declare clauses-group)

(defn- uuid->page-title
[s]
(if (and (string? s) (common-util/uuid-string? s))
(:block/title (db/entity [:block/uuid (uuid s)]))
s))

(defn- dsl-human-output
[clause]
(let [f (first clause)]
Expand All @@ -465,32 +471,33 @@
(str "Search: " clause)

(= (keyword f) :page-ref)
(ref/->page-ref (second clause))
(ref/->page-ref (uuid->page-title (second clause)))

(contains? #{:tags :page-tags} (keyword f))
(cond
(string? (second clause))
(str "#" (second clause))
(str "#" (uuid->page-title (second clause)))
(symbol? (second clause))
(str "#" (str (second clause)))
(str "#" (uuid->page-title (str (second clause))))
:else
(str "#" (second (second clause))))
(str "#" (uuid->page-title (second (second clause)))))

(contains? #{:property :private-property :page-property} (keyword f))
(str (if (and (config/db-based-graph? (state/get-current-repo))
(qualified-keyword? (second clause)))
(:block/title (db/entity (second clause)))
(some-> (second clause) name))
": "
(cond
(and (vector? (last clause)) (= :page-ref (first (last clause))))
(second (last clause))
(uuid->page-title
(cond
(and (vector? (last clause)) (= :page-ref (first (last clause))))
(second (last clause))

(= 2 (count clause))
"ALL"
(= 2 (count clause))
"ALL"

:else
(last clause)))
:else
(last clause))))

;; between timestamp start (optional end)
(and (= (keyword f) :between) (query-dsl/get-timestamp-property clause))
Expand Down Expand Up @@ -525,7 +532,7 @@
(symbol? (last clause)))
(name (last clause))
(second (last clause)))]
(str "between: " start " ~ " end))
(str "between: " (uuid->page-title start) " ~ " (uuid->page-title end)))

(contains? #{:task :priority} (keyword f))
(str (name f) ": "
Expand Down
1 change: 1 addition & 0 deletions src/main/frontend/components/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,7 @@
[config properties]
(->> properties
(map db/entity)
(remove ldb/hidden?)
(ldb/sort-by-order)
((fn [cs] (build-columns config cs {:add-tags-column? false})))))

Expand Down
4 changes: 2 additions & 2 deletions src/main/frontend/extensions/latex.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
(render! state))
(when-not @*loading?
(reset! *loading? true)
(loader/load "/js/katex.min.js"
(loader/load "./js/katex.min.js"
(fn []
(loader/load "/js/mhchem.min.js"
(loader/load "./js/mhchem.min.js"
(fn []
(-> (when-let [enhancers (and config/lsp-enabled?
(seq (hook-extensions-enhancers-by-key :katex)))]
Expand Down
35 changes: 9 additions & 26 deletions src/main/frontend/handler/editor.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -837,32 +837,15 @@
nil

concat-prev-block?
(let [children (:block/_parent (db/entity (:db/id block)))
db-based? (config/db-based-graph? repo)
prev-block-is-not-parent? (empty? (:block/_parent prev-block))
delete-prev-block? (and db-based?
prev-block-is-not-parent?
(empty? (:block/tags block))
(not (:logseq.property.node/display-type block))
(seq (:block/properties block))
(empty? (:block/properties prev-block))
(not (:logseq.property/created-from-property block)))]
(if delete-prev-block?
(p/do!
(state/set-state! :editor/edit-block-fn
#(edit-block! (assoc block :block/title new-content) (count (:block/title prev-block))))
(ui-outliner-tx/transact!
transact-opts
(delete-block-aux! prev-block)
(save-block! repo block new-content {})))
(p/do!
(state/set-state! :editor/edit-block-fn edit-block-f)
(ui-outliner-tx/transact!
transact-opts
(when (seq children)
(outliner-op/move-blocks! children prev-block {:sibling? false}))
(delete-block-aux! block)
(save-block! repo prev-block new-content {})))))
(let [children (:block/_parent (db/entity (:db/id block)))]
(p/do!
(state/set-state! :editor/edit-block-fn edit-block-f)
(ui-outliner-tx/transact!
transact-opts
(when (seq children)
(outliner-op/move-blocks! children prev-block {:sibling? false}))
(delete-block-aux! block)
(save-block! repo prev-block new-content {}))))

:else
(p/do!
Expand Down