mirror of
https://github.com/penpot/penpot.git
synced 2026-09-14 07:59:36 +00:00
🐛 Fix variants not syncronizing tokens on switch
This commit is contained in:
parent
216b2d3072
commit
fec420b6e9
@ -60,7 +60,7 @@
|
|||||||
- Fix lock proportion tooltip [Taiga #12326](https://tree.taiga.io/project/penpot/issue/12326)
|
- Fix lock proportion tooltip [Taiga #12326](https://tree.taiga.io/project/penpot/issue/12326)
|
||||||
- Fix internal Error when selecting a set by name in the token theme editor [Taiga #12310](https://tree.taiga.io/project/penpot/issue/12310)
|
- Fix internal Error when selecting a set by name in the token theme editor [Taiga #12310](https://tree.taiga.io/project/penpot/issue/12310)
|
||||||
- Fix drag & drop functionality is swapping instead or reordering [Taiga #12254](https://tree.taiga.io/project/penpot/issue/12254)
|
- Fix drag & drop functionality is swapping instead or reordering [Taiga #12254](https://tree.taiga.io/project/penpot/issue/12254)
|
||||||
|
- Fix variants not syncronizing tokens on switch [Taiga #12290](https://tree.taiga.io/project/penpot/issue/12290)
|
||||||
|
|
||||||
## 2.10.1
|
## 2.10.1
|
||||||
|
|
||||||
@ -68,12 +68,10 @@
|
|||||||
|
|
||||||
- Improve workpace file loading [Github 7366](https://github.com/penpot/penpot/pull/7366)
|
- Improve workpace file loading [Github 7366](https://github.com/penpot/penpot/pull/7366)
|
||||||
|
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
- Fix regression with text shapes creation with Plugins API [Taiga #12244](https://tree.taiga.io/project/penpot/issue/12244)
|
- Fix regression with text shapes creation with Plugins API [Taiga #12244](https://tree.taiga.io/project/penpot/issue/12244)
|
||||||
|
|
||||||
|
|
||||||
## 2.10.0
|
## 2.10.0
|
||||||
|
|
||||||
### :rocket: Epics and highlights
|
### :rocket: Epics and highlights
|
||||||
@ -89,7 +87,7 @@
|
|||||||
- Add efficiency enhancements to right sidebar [Github #7182](https://github.com/penpot/penpot/pull/7182)
|
- Add efficiency enhancements to right sidebar [Github #7182](https://github.com/penpot/penpot/pull/7182)
|
||||||
- Add defaults for artboard drawing [Taiga #494](https://tree.taiga.io/project/penpot/us/494?milestone=465047)
|
- Add defaults for artboard drawing [Taiga #494](https://tree.taiga.io/project/penpot/us/494?milestone=465047)
|
||||||
- Continuous display of distances between elements when moving a layer with the keyboard [Taiga #1780](https://tree.taiga.io/project/penpot/us/1780)
|
- Continuous display of distances between elements when moving a layer with the keyboard [Taiga #1780](https://tree.taiga.io/project/penpot/us/1780)
|
||||||
- New Number token - unitless values [Taiga #10936](https://tree.taiga.io/project/penpot/us/10936)
|
- New Number token - unitless values [Taiga #10936](https://tree.taiga.io/project/penpot/us/10936)
|
||||||
- New font-family token [Taiga #10937](https://tree.taiga.io/project/penpot/us/10937)
|
- New font-family token [Taiga #10937](https://tree.taiga.io/project/penpot/us/10937)
|
||||||
- New text case token [Taiga #10942](https://tree.taiga.io/project/penpot/us/10942)
|
- New text case token [Taiga #10942](https://tree.taiga.io/project/penpot/us/10942)
|
||||||
- New text-decoration token [Taiga #10941](https://tree.taiga.io/project/penpot/us/10941)
|
- New text-decoration token [Taiga #10941](https://tree.taiga.io/project/penpot/us/10941)
|
||||||
@ -170,7 +168,6 @@
|
|||||||
- Add info to apply-token event [Taiga #11710](https://tree.taiga.io/project/penpot/task/11710)
|
- Add info to apply-token event [Taiga #11710](https://tree.taiga.io/project/penpot/task/11710)
|
||||||
- Fix double click on set name input [Taiga #11747](https://tree.taiga.io/project/penpot/issue/11747)
|
- Fix double click on set name input [Taiga #11747](https://tree.taiga.io/project/penpot/issue/11747)
|
||||||
|
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
- Copying font size does not copy the unit [Taiga #11143](https://tree.taiga.io/project/penpot/issue/11143)
|
- Copying font size does not copy the unit [Taiga #11143](https://tree.taiga.io/project/penpot/issue/11143)
|
||||||
|
|||||||
@ -1642,7 +1642,8 @@
|
|||||||
(pcb/apply-changes-local)))))
|
(pcb/apply-changes-local)))))
|
||||||
|
|
||||||
(defn- generate-update-tokens
|
(defn- generate-update-tokens
|
||||||
[changes container dest-shape origin-shape touched omit-touched?]
|
[changes container dest-shape origin-shape touched omit-touched? valid-attrs]
|
||||||
|
;; valid-attrs is a set of attrs to consider on the update. If it is nil, it will consider all the attrs
|
||||||
(let [attrs (->> (seq (keys ctk/sync-attrs))
|
(let [attrs (->> (seq (keys ctk/sync-attrs))
|
||||||
;; We don't update the flex-child attrs
|
;; We don't update the flex-child attrs
|
||||||
(remove #(= :layout-grid-cells %)))
|
(remove #(= :layout-grid-cells %)))
|
||||||
@ -1650,8 +1651,8 @@
|
|||||||
applied-tokens (reduce (fn [applied-tokens attr]
|
applied-tokens (reduce (fn [applied-tokens attr]
|
||||||
(let [attr-group (get ctk/sync-attrs attr)
|
(let [attr-group (get ctk/sync-attrs attr)
|
||||||
token-attrs (cto/shape-attr->token-attrs attr)]
|
token-attrs (cto/shape-attr->token-attrs attr)]
|
||||||
(if (not (and (touched attr-group)
|
(if (and (or (not omit-touched?) (not (touched attr-group)))
|
||||||
omit-touched?))
|
(or (empty? valid-attrs) (contains? valid-attrs attr)))
|
||||||
(into applied-tokens token-attrs)
|
(into applied-tokens token-attrs)
|
||||||
applied-tokens)))
|
applied-tokens)))
|
||||||
#{}
|
#{}
|
||||||
@ -1808,7 +1809,7 @@
|
|||||||
:always
|
:always
|
||||||
(check-detached-main dest-shape origin-shape)
|
(check-detached-main dest-shape origin-shape)
|
||||||
:always
|
:always
|
||||||
(generate-update-tokens container dest-shape origin-shape touched omit-touched?))
|
(generate-update-tokens container dest-shape origin-shape touched omit-touched? nil))
|
||||||
|
|
||||||
(let [attr-group (get ctk/sync-attrs attr)
|
(let [attr-group (get ctk/sync-attrs attr)
|
||||||
;; position-data is a special case because can be affected by
|
;; position-data is a special case because can be affected by
|
||||||
@ -2082,12 +2083,14 @@
|
|||||||
(recur (next attrs)
|
(recur (next attrs)
|
||||||
roperations'
|
roperations'
|
||||||
uoperations'))
|
uoperations'))
|
||||||
(cond-> changes
|
|
||||||
(> (count roperations) 1)
|
|
||||||
(add-update-attr-changes current-shape container roperations uoperations)
|
|
||||||
|
|
||||||
:always
|
(let [updated-attrs (into #{} (comp (filter #(= :set (:type %)))
|
||||||
(generate-update-tokens container current-shape previous-shape touched false))))))
|
(map :attr))
|
||||||
|
roperations)]
|
||||||
|
(cond-> changes
|
||||||
|
(> (count roperations) 1)
|
||||||
|
(-> (add-update-attr-changes current-shape container roperations uoperations)
|
||||||
|
(generate-update-tokens container current-shape previous-shape touched false updated-attrs))))))))
|
||||||
|
|
||||||
(defn- propagate-attrs
|
(defn- propagate-attrs
|
||||||
"Helper that puts the origin attributes (attrs) into dest but only if
|
"Helper that puts the origin attributes (attrs) into dest but only if
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user