mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 15:09:10 -05:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
d22c47fc50
4 changed files with 12 additions and 8 deletions
|
@ -246,9 +246,8 @@
|
||||||
(let [shape-old (dm/get-in data-old [:pages-index page-id :objects id])
|
(let [shape-old (dm/get-in data-old [:pages-index page-id :objects id])
|
||||||
shape-new (dm/get-in data-new [:pages-index page-id :objects id])]
|
shape-new (dm/get-in data-new [:pages-index page-id :objects id])]
|
||||||
|
|
||||||
;; If object has changed verify is correct
|
;; If object has changed or is new verify is correct
|
||||||
(when (and (some? shape-old)
|
(when (and (some? shape-new)
|
||||||
(some? shape-new)
|
|
||||||
(not= shape-old shape-new))
|
(not= shape-old shape-new))
|
||||||
(dm/verify! (cts/shape? shape-new)))))]
|
(dm/verify! (cts/shape? shape-new)))))]
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
[:map
|
[:map
|
||||||
[:color ::grid-color]
|
[:color ::grid-color]
|
||||||
[:type [::sm/one-of #{:stretch :left :center :right}]]
|
[:type [::sm/one-of #{:stretch :left :center :right}]]
|
||||||
[:size {:optional true} ::sm/safe-number]
|
[:size {:optional true} [:maybe ::sm/safe-number]]
|
||||||
[:margin {:optional true} [:maybe ::sm/safe-number]]
|
[:margin {:optional true} [:maybe ::sm/safe-number]]
|
||||||
[:item-length {:optional true} [:maybe ::sm/safe-number]]
|
[:item-length {:optional true} [:maybe ::sm/safe-number]]
|
||||||
[:gutter {:optional true} [:maybe ::sm/safe-number]]])
|
[:gutter {:optional true} [:maybe ::sm/safe-number]]])
|
||||||
|
|
||||||
(sm/def! ::square-params
|
(sm/def! ::square-params
|
||||||
[:map
|
[:map
|
||||||
[:size ::sm/safe-number]
|
[:size {:optional true} [:maybe ::sm/safe-number]]
|
||||||
[:color ::grid-color]])
|
[:color ::grid-color]])
|
||||||
|
|
||||||
(sm/def! ::grid
|
(sm/def! ::grid
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
[:map {:title "TextAttrs"}
|
[:map {:title "TextAttrs"}
|
||||||
[:id ::sm/uuid]
|
[:id ::sm/uuid]
|
||||||
[:type [:= :text]]
|
[:type [:= :text]]
|
||||||
[:content ::ctsx/content]])
|
[:content {:optional true} [:maybe ::ctsx/content]]])
|
||||||
|
|
||||||
(sm/def! ::shape
|
(sm/def! ::shape
|
||||||
[:multi {:dispatch :type :title "Shape"}
|
[:multi {:dispatch :type :title "Shape"}
|
||||||
|
|
|
@ -102,7 +102,10 @@
|
||||||
input (mf/use-ref)
|
input (mf/use-ref)
|
||||||
|
|
||||||
fonts (mf/use-memo (mf/deps @state) #(filter-fonts @state @fonts/fonts))
|
fonts (mf/use-memo (mf/deps @state) #(filter-fonts @state @fonts/fonts))
|
||||||
recent-fonts (mf/deref refs/workspace-recent-fonts)
|
fontsdb (mf/deref fonts/fontsdb)
|
||||||
|
;; Filtering deleted fonts
|
||||||
|
recent-fonts (->> (mf/deref refs/workspace-recent-fonts)
|
||||||
|
(into [] (filter #(some? (get fontsdb (:id %))))))
|
||||||
|
|
||||||
select-next
|
select-next
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
|
@ -259,7 +262,9 @@
|
||||||
|
|
||||||
fonts (mf/deref fonts/fontsdb)
|
fonts (mf/deref fonts/fontsdb)
|
||||||
font (get fonts font-id)
|
font (get fonts font-id)
|
||||||
recent-fonts (mf/deref refs/workspace-recent-fonts)
|
;; Filtering deleted fonts
|
||||||
|
recent-fonts (->> (mf/deref refs/workspace-recent-fonts)
|
||||||
|
(into [] (filter #(some? (get fonts (:id %))))))
|
||||||
last-font (mf/use-ref nil)
|
last-font (mf/use-ref nil)
|
||||||
|
|
||||||
open-selector? (mf/use-state false)
|
open-selector? (mf/use-state false)
|
||||||
|
|
Loading…
Add table
Reference in a new issue