fix: blocks context menu

This commit is contained in:
Tienson Qin
2025-03-08 06:38:36 +08:00
parent 429f9c81c2
commit fdba2d2d11
2 changed files with 12 additions and 8 deletions

View File

@@ -878,16 +878,18 @@
{:keys [page page-entity]} (state/sub :page-title/context)]
(let [show!
(fn [content]
(fn [content & {:as option}]
(shui/popup-show! e
(fn [{:keys [id]}]
[:div {:on-click #(shui/popup-hide! id)
:data-keep-selection true}
content])
{:on-before-hide state/dom-clear-selection!
:on-after-hide state/state-clear-selection!
:content-props {:class "w-[280px] ls-context-menu-content"}
:as-dropdown? true}))
(merge
{:on-before-hide state/dom-clear-selection!
:on-after-hide state/state-clear-selection!
:content-props {:class "w-[280px] ls-context-menu-content"}
:as-dropdown? true}
option)))
handled
(cond
@@ -903,7 +905,8 @@
;; block selection
(and (state/selection?) (not (d/has-class? target "bullet")))
(show! (cp-content/custom-context-menu-content))
(show! (cp-content/custom-context-menu-content)
{:id "blocks-selection-context-menu"})
;; block bullet
(and block-id (parse-uuid block-id))