mirror of
https://github.com/penpot/penpot.git
synced 2025-02-11 01:28:30 -05:00
Add validation for shapes.
This commit is contained in:
parent
3fcd21635e
commit
e07ada5ad4
2 changed files with 4 additions and 4 deletions
|
@ -91,11 +91,10 @@
|
|||
(-apply-update [_ state]
|
||||
(assoc-in state [:workspace :selected] #{}))))
|
||||
|
||||
;; TODO: validate shape
|
||||
|
||||
(defn add-shape
|
||||
"Mark a shape selected for drawing in the canvas."
|
||||
[shape props]
|
||||
(sc/validate! +shape-schema+ shape)
|
||||
(sc/validate! +shape-props-schema+ props)
|
||||
(reify
|
||||
rs/UpdateEvent
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
(ns uxbox.schema
|
||||
(:refer-clojure :exclude [keyword uuid])
|
||||
(:refer-clojure :exclude [keyword uuid vector])
|
||||
(:require [bouncer.core :as b]
|
||||
[bouncer.validators :as v]))
|
||||
[bouncer.validators :as v]
|
||||
[uxbox.shapes :refer (shape?)]))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Validators
|
||||
|
|
Loading…
Add table
Reference in a new issue