From 3fcd21635e4583278b00589404560397646c1e93 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 29 Dec 2015 23:39:31 +0200 Subject: [PATCH] Add shape type hierarchy. --- frontend/uxbox/shapes.cljs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/uxbox/shapes.cljs b/frontend/uxbox/shapes.cljs index 34f09e12fd..40214290b4 100644 --- a/frontend/uxbox/shapes.cljs +++ b/frontend/uxbox/shapes.cljs @@ -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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;