mirror of
https://github.com/logseq/logseq.git
synced 2026-04-30 00:46:23 +00:00
Merge branch 'master' into feat/capacitor-new
This commit is contained in:
@@ -127,14 +127,15 @@
|
||||
(or (let [page (some-> (text/get-namespace-last-part input)
|
||||
string/trim
|
||||
db/get-page)
|
||||
parent-title (:block/title (:logseq.property/parent page))
|
||||
parent-title (:block/title (:block/parent page))
|
||||
namespace? (string/includes? input "/")]
|
||||
(and page
|
||||
(or (not namespace?)
|
||||
(and
|
||||
parent-title
|
||||
(= (util/page-name-sanity-lc parent-title)
|
||||
(util/page-name-sanity-lc (nth (reverse (string/split input "/")) 1)))))))
|
||||
(some-> (util/nth-safe (reverse (string/split input "/")) 1)
|
||||
util/page-name-sanity-lc))))))
|
||||
(some (fn [block]
|
||||
(and
|
||||
(:block/tags block)
|
||||
@@ -294,20 +295,27 @@
|
||||
source-page (or (model/get-alias-source-page repo (:db/id entity))
|
||||
(:alias page))
|
||||
icon (get-page-icon entity)
|
||||
title (block-handler/block-unique-title page)
|
||||
title (block-handler/block-unique-title (or entity page))
|
||||
title' (if source-page (str title " -> alias: " (:block/title source-page)) title)]
|
||||
(hash-map :icon icon
|
||||
:icon-theme :gray
|
||||
:text title'
|
||||
:source-page (or source-page page)
|
||||
:alias (:alias page))))
|
||||
:header (when (:block/parent entity)
|
||||
(block/breadcrumb {:disable-preview? true
|
||||
:search? true} repo (:block/uuid page) {}))
|
||||
:alias (:alias page)
|
||||
:source-page (or source-page page))))
|
||||
|
||||
(defn block-item
|
||||
[repo block current-page input]
|
||||
(let [id (:block/uuid block)
|
||||
text (block-handler/block-unique-title block)]
|
||||
{:text (highlight-content-query text input)
|
||||
:header (when-not (db/page? block) (block/breadcrumb {:search? true} repo id {}))
|
||||
text (block-handler/block-unique-title block)
|
||||
icon "letter-n"]
|
||||
{:icon icon
|
||||
:icon-theme :gray
|
||||
:text (highlight-content-query text input)
|
||||
:header (block/breadcrumb {:disable-preview? true
|
||||
:search? true} repo id {})
|
||||
:current-page? (when-let [page-id (:block/page block)]
|
||||
(= page-id (:block/uuid current-page)))
|
||||
:source-block block}))
|
||||
@@ -324,8 +332,6 @@
|
||||
(swap! !results assoc-in [:current-page :status] :loading)
|
||||
(p/let [blocks (search/block-search repo @!input opts)
|
||||
blocks (remove nil? blocks)
|
||||
blocks (search/fuzzy-search blocks @!input {:limit 100
|
||||
:extract-fn :block/title})
|
||||
items (keep (fn [block]
|
||||
(if (:page? block)
|
||||
(page-item repo block)
|
||||
|
||||
Reference in New Issue
Block a user