mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 00:06: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!)
|
### :heart: Community contributions (Thank you!)
|
||||||
|
|
||||||
### :sparkles: New features
|
### :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)
|
- 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
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.main.data.workspace.colors :as mdc]
|
[app.main.data.workspace.colors :as mdc]
|
||||||
|
[app.main.data.workspace.libraries :as dwl]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.main.ui.components.color-bullet :as cb]
|
[app.main.ui.components.color-bullet :as cb]
|
||||||
|
@ -24,7 +25,9 @@
|
||||||
{::mf/wrap [mf/memo]}
|
{::mf/wrap [mf/memo]}
|
||||||
[{:keys [color size]}]
|
[{:keys [color size]}]
|
||||||
(letfn [(select-color [event]
|
(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
|
[:div {:class (stl/css-case :color-cell true
|
||||||
:is-not-library-color (nil? (:id color))
|
:is-not-library-color (nil? (:id color))
|
||||||
:no-text (<= size 64))
|
:no-text (<= size 64))
|
||||||
|
|
|
@ -168,7 +168,9 @@
|
||||||
(if (and (some? (:color color)) (some? (:gradient data)))
|
(if (and (some? (:color color)) (some? (:gradient data)))
|
||||||
(handle-change-color {:hex (:color color) :alpha (:opacity color)})
|
(handle-change-color {:hex (:color color) :alpha (:opacity color)})
|
||||||
(do
|
(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-change color)))))
|
||||||
|
|
||||||
on-add-library-color
|
on-add-library-color
|
||||||
|
|
|
@ -68,7 +68,9 @@
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps color)
|
(mf/deps color)
|
||||||
(fn [event]
|
(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
|
rename-color
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
@ -183,7 +185,9 @@
|
||||||
on-click
|
on-click
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps color-id apply-color on-asset-click)
|
(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?]
|
(mf/with-effect [editing?]
|
||||||
(when editing?
|
(when editing?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue