mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Add validation for shapes.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user