mirror of https://github.com/penpot/penpot.git
Add shape type hierarchy.
This commit is contained in:
parent
9072c816e8
commit
3fcd21635e
|
|
@ -2,6 +2,21 @@
|
|||
(:require [sablono.core :refer-macros [html]]
|
||||
[uxbox.util.data :refer (remove-nil-vals)]))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Types
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(def ^:static ^:private +hierarchy+
|
||||
(as-> (make-hierarchy) $
|
||||
(derive $ :builtin/icon ::shape)
|
||||
(derive $ :builtin/icon-svg ::shape)
|
||||
(derive $ :builtin/icon-group ::shape)))
|
||||
|
||||
(defn shape?
|
||||
[type]
|
||||
{:pre [(keyword? type)]}
|
||||
(isa? +hierarchy+ type ::shape))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Api
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
|
|
|||
Loading…
Reference in New Issue