mirror of
https://github.com/penpot/penpot.git
synced 2025-05-23 18:26:11 +02:00
✨ Allow library colors as recent colors
This commit is contained in:
parent
53526b9957
commit
f9692fde35
4 changed files with 15 additions and 5 deletions
|
@ -9,8 +9,9 @@
|
|||
### :heart: Community contributions (Thank you!)
|
||||
|
||||
### :sparkles: New features
|
||||
- Improve auth process [Taiga #7094](https://tree.taiga.io/project/penpot/us/7094)
|
||||
- Improve auth process [Taiga #Change Auth Process](https://tree.taiga.io/project/penpot/us/7094)
|
||||
- Add locking degrees increment (hold shift) on path edition [Taiga #7761](https://tree.taiga.io/project/penpot/issue/7761)
|
||||
- Allow library colors as recent colors [Taiga issue #7640](https://tree.taiga.io/project/penpot/issue/7640)
|
||||
|
||||
### :bug: Bugs fixed
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
(:require
|
||||
[app.common.data.macros :as dm]
|
||||
[app.main.data.workspace.colors :as mdc]
|
||||
[app.main.data.workspace.libraries :as dwl]
|
||||
[app.main.refs :as refs]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.color-bullet :as cb]
|
||||
|
@ -24,7 +25,9 @@
|
|||
{::mf/wrap [mf/memo]}
|
||||
[{:keys [color size]}]
|
||||
(letfn [(select-color [event]
|
||||
(st/emit! (mdc/apply-color-from-palette color (kbd/alt? event))))]
|
||||
(st/emit!
|
||||
(dwl/add-recent-color color)
|
||||
(mdc/apply-color-from-palette color (kbd/alt? event))))]
|
||||
[:div {:class (stl/css-case :color-cell true
|
||||
:is-not-library-color (nil? (:id color))
|
||||
:no-text (<= size 64))
|
||||
|
|
|
@ -168,7 +168,9 @@
|
|||
(if (and (some? (:color color)) (some? (:gradient data)))
|
||||
(handle-change-color {:hex (:color color) :alpha (:opacity color)})
|
||||
(do
|
||||
(st/emit! (dc/apply-color-from-colorpicker color))
|
||||
(st/emit!
|
||||
(dwl/add-recent-color color)
|
||||
(dc/apply-color-from-colorpicker color))
|
||||
(on-change color)))))
|
||||
|
||||
on-add-library-color
|
||||
|
|
|
@ -68,7 +68,9 @@
|
|||
(mf/use-fn
|
||||
(mf/deps color)
|
||||
(fn [event]
|
||||
(st/emit! (dc/apply-color-from-palette (merge uc/empty-color color) (kbd/alt? event)))))
|
||||
(st/emit!
|
||||
(dwl/add-recent-color color)
|
||||
(dc/apply-color-from-palette (merge uc/empty-color color) (kbd/alt? event)))))
|
||||
|
||||
rename-color
|
||||
(mf/use-fn
|
||||
|
@ -183,7 +185,9 @@
|
|||
on-click
|
||||
(mf/use-fn
|
||||
(mf/deps color-id apply-color on-asset-click)
|
||||
(partial on-asset-click color-id apply-color))]
|
||||
(do
|
||||
(dwl/add-recent-color color)
|
||||
(partial on-asset-click color-id apply-color)))]
|
||||
|
||||
(mf/with-effect [editing?]
|
||||
(when editing?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue