mirror of
https://github.com/penpot/penpot.git
synced 2025-05-08 05:35:54 +02:00
📎 Add some notes to assets ns in sidebar
This commit is contained in:
parent
c405e9a7a3
commit
ade41f77f3
1 changed files with 5 additions and 12 deletions
|
@ -47,14 +47,10 @@
|
||||||
[potok.core :as ptk]
|
[potok.core :as ptk]
|
||||||
[rumext.alpha :as mf]))
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
;; TODO: refactor to remove duplicate code and less parameter passing.
|
;; NOTE: TODO: for avoid too many arguments, I think we can use react
|
||||||
;; - Move all state to [:workspace-local :assets-bar file-id :open-boxes {}
|
;; context variables for pass to the down tree all the common
|
||||||
;; :open-groups {}
|
;; variables that are defined on the MAIN container/box component.
|
||||||
;; :reverse-sort?
|
|
||||||
;; :listing-thumbs?
|
|
||||||
;; :selected-assets {}]
|
|
||||||
;; - Move selection code to independent functions that receive the state as a parameter.
|
|
||||||
;;
|
|
||||||
;; TODO: change update operations to admit multiple ids, thus avoiding the need of
|
;; TODO: change update operations to admit multiple ids, thus avoiding the need of
|
||||||
;; emitting many events and opening an undo transaction. Also move the logic
|
;; emitting many events and opening an undo transaction. Also move the logic
|
||||||
;; of grouping, deleting, etc. to events in the data module, since now the
|
;; of grouping, deleting, etc. to events in the data module, since now the
|
||||||
|
@ -205,8 +201,6 @@
|
||||||
create-typed-assets-group (partial create-typed-assets-group components-to-group)]
|
create-typed-assets-group (partial create-typed-assets-group components-to-group)]
|
||||||
(modal/show! :name-group-dialog {:accept create-typed-assets-group}))))))
|
(modal/show! :name-group-dialog {:accept create-typed-assets-group}))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(defn- on-drag-enter-asset
|
(defn- on-drag-enter-asset
|
||||||
[event asset dragging? selected-assets selected-assets-paths]
|
[event asset dragging? selected-assets selected-assets-paths]
|
||||||
(when (and
|
(when (and
|
||||||
|
@ -275,8 +269,6 @@
|
||||||
(:id target-asset)
|
(:id target-asset)
|
||||||
(cph/merge-path-item prefix (:name target-asset))))))))
|
(cph/merge-path-item prefix (:name target-asset))))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; ---- Common blocks ----
|
;; ---- Common blocks ----
|
||||||
|
|
||||||
(def auto-pos-menu-state {:open? false
|
(def auto-pos-menu-state {:open? false
|
||||||
|
@ -1090,6 +1082,7 @@
|
||||||
:else (:value color))
|
:else (:value color))
|
||||||
|
|
||||||
;; TODO: looks like the first argument is not necessary
|
;; TODO: looks like the first argument is not necessary
|
||||||
|
;; TODO: this code should be out of this UI component
|
||||||
apply-color
|
apply-color
|
||||||
(fn [_ event]
|
(fn [_ event]
|
||||||
(let [objects (wsh/lookup-page-objects @st/state)
|
(let [objects (wsh/lookup-page-objects @st/state)
|
||||||
|
|
Loading…
Add table
Reference in a new issue