mirror of
https://github.com/logseq/logseq.git
synced 2026-05-28 14:39:48 +00:00
Merge branch 'master' into enhance/mobile-silk
This commit is contained in:
@@ -19,14 +19,18 @@
|
||||
:will-unmount (fn [state]
|
||||
(state/clear-edit!)
|
||||
(state/clear-selection!)
|
||||
state)}
|
||||
state)
|
||||
:did-mount (fn [state]
|
||||
(when-not (util/mobile?)
|
||||
(editor-handler/quick-add-open-last-block!))
|
||||
state)}
|
||||
[]
|
||||
(when (model/get-journal-page (date/today))
|
||||
(when-let [add-page (ldb/get-built-in-page (db/get-db) common-config/quick-add-page-name)]
|
||||
(let [mobile? (util/mobile?)
|
||||
add-button [:div
|
||||
(shui/button
|
||||
{:variant (if mobile? :default :outline)
|
||||
{:variant :default
|
||||
:size :sm
|
||||
:on-click (fn [_e]
|
||||
(editor-handler/quick-add-blocks!))}
|
||||
@@ -35,13 +39,11 @@
|
||||
[:div.ls-quick-add.flex.flex-1.flex-col.w-full.gap-4
|
||||
[:div.border-b.pb-4.flex.flex-row.justify-between.gap-4.items-center
|
||||
[:div.font-medium
|
||||
{:class (when-not mobile? "text-xs")}
|
||||
"Quick add"]
|
||||
(when mobile? add-button)]
|
||||
[:div.content
|
||||
{:class (if mobile?
|
||||
"flex flex-1 flex-col w-full"
|
||||
"block -ml-6")}
|
||||
(page/page-blocks-cp add-page {})
|
||||
(when-not mobile?
|
||||
add-button)]]))))
|
||||
(page/page-blocks-cp add-page {})]
|
||||
(when-not mobile? add-button)]))))
|
||||
|
||||
@@ -3966,3 +3966,10 @@
|
||||
(if (shui-dialog/get-modal :ls-dialog-quick-add)
|
||||
(quick-add-blocks!)
|
||||
(show-quick-add)))
|
||||
|
||||
(defn quick-add-open-last-block!
|
||||
[]
|
||||
(when-let [add-page (ldb/get-built-in-page (db/get-db) common-config/quick-add-page-name)]
|
||||
(when (:block/_parent add-page)
|
||||
(let [block (last (ldb/sort-by-order (:block/_parent add-page)))]
|
||||
(edit-block! block :max {:container-id :unknown-container})))))
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
|
||||
(defn rtc-group?
|
||||
[]
|
||||
(set/intersection (state/user-groups) #{"team" "rtc_2025_07_10"}))
|
||||
(boolean (seq (set/intersection (state/user-groups) #{"team" "rtc_2025_07_10"}))))
|
||||
|
||||
(defn alpha-user?
|
||||
[]
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
(ns mobile.components.popup
|
||||
"Mobile popup"
|
||||
(:require [dommy.core :as dom]
|
||||
[frontend.db :as db]
|
||||
[frontend.handler.editor :as editor-handler]
|
||||
[frontend.state :as state]
|
||||
[logseq.common.config :as common-config]
|
||||
[logseq.db :as ldb]
|
||||
[logseq.shui.popup.core :as shui-popup]
|
||||
[logseq.shui.ui :as shui]
|
||||
[mobile.components.ui :as mobile-ui]
|
||||
@@ -85,10 +82,7 @@
|
||||
:initialBreakpoint initial-breakpoint
|
||||
:onDidPresent (fn []
|
||||
(when (= :ls-quick-add (:id opts))
|
||||
(when-let [add-page (ldb/get-built-in-page (db/get-db) common-config/quick-add-page-name)]
|
||||
(when (:block/_parent add-page)
|
||||
(let [block (last (ldb/sort-by-order (:block/_parent add-page)))]
|
||||
(editor-handler/edit-block! block :max {:container-id :unknown-container}))))))
|
||||
(editor-handler/quick-add-open-last-block!)))
|
||||
:breakpoints breakpoints
|
||||
:onDidDismiss (fn []
|
||||
(mobile-state/set-popup! nil)
|
||||
|
||||
Reference in New Issue
Block a user