mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 22:06:12 +02:00
✨ Improve audit events on inspect copy operations
This commit is contained in:
parent
00ee6833c8
commit
942989824a
3 changed files with 26 additions and 20 deletions
|
@ -153,20 +153,24 @@
|
|||
(cb/format-code markup-type))))
|
||||
|
||||
on-markup-copied
|
||||
(mf/use-callback
|
||||
(mf/deps markup-type)
|
||||
(mf/use-fn
|
||||
(mf/deps markup-type from)
|
||||
(fn []
|
||||
(let [origin (if (= :workspace from) "workspace" "viewer")]
|
||||
(st/emit! (ptk/event ::ev/event
|
||||
{::ev/name "copy-inspect-code"
|
||||
:type markup-type}))))
|
||||
::ev/origin origin
|
||||
:type markup-type})))))
|
||||
|
||||
on-style-copied
|
||||
(mf/use-callback
|
||||
(mf/use-fn
|
||||
(mf/deps style-type)
|
||||
(fn []
|
||||
(let [origin (if (= :workspace from) "workspace" "viewer")]
|
||||
(st/emit! (ptk/event ::ev/event
|
||||
{::ev/name "copy-inspect-style"
|
||||
:type style-type}))))
|
||||
::ev/origin origin
|
||||
:type style-type})))))
|
||||
|
||||
{on-markup-pointer-down :on-pointer-down
|
||||
on-markup-lost-pointer-capture :on-lost-pointer-capture
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
(mf/defc right-sidebar
|
||||
[{:keys [frame page objects file selected shapes page-id file-id share-id from on-change-section on-expand]
|
||||
:or {from :inspect}}]
|
||||
:or {from :viewer}}]
|
||||
(let [section (mf/use-state :info #_:code)
|
||||
objects (or objects (:objects page))
|
||||
shapes (or shapes
|
||||
|
@ -83,7 +83,7 @@
|
|||
(handle-change-tab :info))))
|
||||
|
||||
[:aside {:class (stl/css-case :settings-bar-right true
|
||||
:viewer-code (= from :inspect))}
|
||||
:viewer-code (= from :viewer))}
|
||||
(if (seq shapes)
|
||||
[:div {:class (stl/css :tool-windows)}
|
||||
[:div {:class (stl/css :shape-row)}
|
||||
|
|
|
@ -104,7 +104,9 @@
|
|||
{:on-change-tab on-change-tab
|
||||
:selected section
|
||||
:collapsable false
|
||||
:content-class (stl/css-case :content-class true :inspect (= section :inspect))
|
||||
:content-class (stl/css-case
|
||||
:content-class true
|
||||
:inspect (= section :inspect))
|
||||
:header-class (stl/css :tab-spacing)}
|
||||
[:& tab-element {:id :design
|
||||
:title (tr "workspace.options.design")}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue