|
|
@@ -17,7 +17,6 @@
|
|
|
[frontend.util.page :as page-util]
|
|
|
[goog.functions :as gfun]
|
|
|
[goog.object :as gobj]
|
|
|
- [logseq.shui.core :as shui-core]
|
|
|
[logseq.shui.ui :as shui]
|
|
|
[promesa.core :as p]
|
|
|
[rum.core :as rum]
|
|
|
@@ -598,37 +597,37 @@
|
|
|
(if (= show :more)
|
|
|
[:div.flex.flex-row.gap-1.items-center
|
|
|
"Show less"
|
|
|
- (shui-core/shortcut "mod up" nil)]
|
|
|
+ (shui/shortcut "mod up" nil)]
|
|
|
[:div.flex.flex-row.gap-1.items-center
|
|
|
"Show more"
|
|
|
- (shui-core/shortcut "mod down" nil)])])]
|
|
|
+ (shui/shortcut "mod down" nil)])])]
|
|
|
|
|
|
[:div.search-results
|
|
|
(for [item visible-items
|
|
|
:let [highlighted? (= item highlighted-item)]]
|
|
|
- (let [item (shui-core/list-item (assoc item
|
|
|
- :query (when-not (= group :create) @(::input state))
|
|
|
- :compact true
|
|
|
- :rounded false
|
|
|
- :hoverable @*mouse-active?
|
|
|
- :highlighted highlighted?
|
|
|
+ (let [item (shui/list-item (assoc item
|
|
|
+ :query (when-not (= group :create) @(::input state))
|
|
|
+ :compact true
|
|
|
+ :rounded false
|
|
|
+ :hoverable @*mouse-active?
|
|
|
+ :highlighted highlighted?
|
|
|
;; for some reason, the highlight effect does not always trigger on a
|
|
|
;; boolean value change so manually pass in the dep
|
|
|
- :on-highlight-dep highlighted-item
|
|
|
- :on-click (fn [e]
|
|
|
- (reset! (::highlighted-item state) item)
|
|
|
- (handle-action :default state item)
|
|
|
- (when-let [on-click (:on-click item)]
|
|
|
- (on-click e)))
|
|
|
+ :on-highlight-dep highlighted-item
|
|
|
+ :on-click (fn [e]
|
|
|
+ (reset! (::highlighted-item state) item)
|
|
|
+ (handle-action :default state item)
|
|
|
+ (when-let [on-click (:on-click item)]
|
|
|
+ (on-click e)))
|
|
|
;; :on-mouse-enter (fn [e]
|
|
|
;; (when (not highlighted?)
|
|
|
;; (reset! (::highlighted-item state) (assoc item :mouse-enter-triggered-highlight true))))
|
|
|
- :on-highlight (fn [ref]
|
|
|
- (reset! (::highlighted-group state) group)
|
|
|
- (when (and ref (.-current ref)
|
|
|
- (not (:mouse-enter-triggered-highlight @(::highlighted-item state))))
|
|
|
- (scroll-into-view-when-invisible state (.-current ref)))))
|
|
|
- nil)]
|
|
|
+ :on-highlight (fn [ref]
|
|
|
+ (reset! (::highlighted-group state) group)
|
|
|
+ (when (and ref (.-current ref)
|
|
|
+ (not (:mouse-enter-triggered-highlight @(::highlighted-item state))))
|
|
|
+ (scroll-into-view-when-invisible state (.-current ref)))))
|
|
|
+ nil)]
|
|
|
(if (= group :blocks)
|
|
|
(ui/lazy-visible (fn [] item) {:trigger-once? true})
|
|
|
item)))]]]))
|
|
|
@@ -776,10 +775,10 @@
|
|
|
(rand-nth
|
|
|
[[:div.flex.flex-row.gap-1.items-center.opacity-50.hover:opacity-100
|
|
|
[:div "Type"]
|
|
|
- (shui-core/shortcut "/")
|
|
|
+ (shui/shortcut "/")
|
|
|
[:div "to filter search results"]]
|
|
|
[:div.flex.flex-row.gap-1.items-center.opacity-50.hover:opacity-100
|
|
|
- (shui-core/shortcut ["mod" "enter"])
|
|
|
+ (shui/shortcut ["mod" "enter"])
|
|
|
[:div "to open search in the sidebar"]]]))
|
|
|
|
|
|
(rum/defcs tip <
|
|
|
@@ -791,7 +790,7 @@
|
|
|
filter
|
|
|
[:div.flex.flex-row.gap-1.items-center.opacity-50.hover:opacity-100
|
|
|
[:div "Type"]
|
|
|
- (shui-core/shortcut "esc" {:tiled false})
|
|
|
+ (shui/shortcut "esc" {:tiled false})
|
|
|
[:div "to clear search filter"]]
|
|
|
|
|
|
:else
|