0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-15 16:31:25 -05:00

Add shape type hierarchy.

This commit is contained in:
Andrey Antukh 2015-12-29 23:39:31 +02:00
parent 9072c816e8
commit 3fcd21635e

View file

@ -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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;