mirror of
https://github.com/penpot/penpot.git
synced 2026-02-18 15:19:00 -05:00
Compare commits
1 Commits
develop
...
luis-13120
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82eb7084e7 |
@@ -27,6 +27,7 @@
|
||||
[app.main.data.workspace.versions :as dwv]
|
||||
[app.main.features :as features]
|
||||
[app.main.refs :as refs]
|
||||
[app.main.router :as rt]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.dropdown-menu :refer [dropdown-menu*
|
||||
dropdown-menu-item*]]
|
||||
@@ -765,6 +766,47 @@
|
||||
[:span {:class (stl/css :item-icon)
|
||||
:title (tr "workspace.plugins.error.need-editor")} deprecated-icon/help])]))])))
|
||||
|
||||
(mf/defc mcp-menu*
|
||||
{::mf/props :obj
|
||||
::mf/private true}
|
||||
[{:keys [on-close]}]
|
||||
(let [on-click-nav-to-integrations
|
||||
(mf/use-fn
|
||||
(fn []
|
||||
(st/emit! (rt/nav :settings-integrations))))
|
||||
|
||||
on-enter-nav-to-integrations
|
||||
(mf/use-fn
|
||||
(fn [event]
|
||||
(when (kbd/enter? event)
|
||||
(on-click-nav-to-integrations))))
|
||||
|
||||
toggle-mcp-plugin-status
|
||||
(mf/use-fn
|
||||
#(print "status"))]
|
||||
|
||||
[:> dropdown-menu* {:show true
|
||||
;; :id "workspace-edit-menu"
|
||||
:class (stl/css-case :sub-menu true
|
||||
:mcp true)
|
||||
:on-close on-close}
|
||||
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
:on-click toggle-mcp-plugin-status
|
||||
:on-key-down (fn [event]
|
||||
(when (kbd/enter? event)
|
||||
toggle-mcp-plugin-status))
|
||||
:id "mcp-menu-toggle-mcp-plugin-status"}
|
||||
[:span {:class (stl/css :item-name)}
|
||||
"Disconnect"]]
|
||||
|
||||
[:> dropdown-menu-item* {:class (stl/css :submenu-item)
|
||||
:on-click on-click-nav-to-integrations
|
||||
:on-key-down on-enter-nav-to-integrations
|
||||
:id "mcp-menu-nav-to-integrations"}
|
||||
[:span {:class (stl/css :item-name)}
|
||||
"Manage"]]]))
|
||||
|
||||
(mf/defc menu
|
||||
{::mf/props :obj}
|
||||
[{:keys [layout file profile]}]
|
||||
@@ -917,6 +959,18 @@
|
||||
[:span {:class (stl/css :item-name)} (tr "workspace.plugins.menu.title")]
|
||||
[:span {:class (stl/css :open-arrow)} deprecated-icon/arrow]])
|
||||
|
||||
(when (contains? cf/flags :mcp)
|
||||
[:> dropdown-menu-item* {:class (stl/css :menu-item)
|
||||
:on-click on-menu-click
|
||||
:on-key-down (fn [event]
|
||||
(when (kbd/enter? event)
|
||||
(on-menu-click event)))
|
||||
:on-pointer-enter on-menu-click
|
||||
:data-testid "mcp"
|
||||
:id "file-menu-mcp"}
|
||||
[:span {:class (stl/css :item-name)} "MCP Server"]
|
||||
[:span {:class (stl/css :open-arrow)} deprecated-icon/arrow]])
|
||||
|
||||
[:div {:class (stl/css :separator)}]
|
||||
[:> dropdown-menu-item* {:class (stl/css-case :menu-item true)
|
||||
:on-click on-menu-click
|
||||
@@ -971,6 +1025,10 @@
|
||||
{:open-plugins open-plugins-manager
|
||||
:on-close close-sub-menu}]
|
||||
|
||||
:mcp
|
||||
[:> mcp-menu*
|
||||
{:on-close close-sub-menu}]
|
||||
|
||||
:help-info
|
||||
[:> help-info-menu*
|
||||
{:layout layout
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
@use "refactor/common-refactor.scss" as deprecated;
|
||||
|
||||
@use "ds/_sizes.scss" as *;
|
||||
|
||||
.menu {
|
||||
@extend .menu-dropdown;
|
||||
top: deprecated.$s-48;
|
||||
@@ -111,6 +113,10 @@
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
&.mcp {
|
||||
top: $sz-224;
|
||||
}
|
||||
|
||||
&.help-info {
|
||||
top: deprecated.$s-232;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user