diff --git a/common/src/app/common/types/file.cljc b/common/src/app/common/types/file.cljc index fefef7b75..ac14d71b6 100644 --- a/common/src/app/common/types/file.cljc +++ b/common/src/app/common/types/file.cljc @@ -27,6 +27,7 @@ [app.common.types.plugins :as ctpg] [app.common.types.shape-tree :as ctst] [app.common.types.token :as cto] + [app.common.types.token-theme :as ctt] [app.common.types.typographies-list :as ctyl] [app.common.types.typography :as cty] [app.common.uuid :as uuid] @@ -58,12 +59,20 @@ [:vector {:gen/max 3} ::ctc/recent-color]] [:typographies {:optional true} [:map-of {:gen/max 2} ::sm/uuid ::cty/typography]] - [:tokens {:optional true} - [:map-of {:gen/max 100} ::sm/uuid ::cto/token]] [:media {:optional true} [:map-of {:gen/max 5} ::sm/uuid ::media-object]] [:plugin-data {:optional true} - [:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]]]) + [:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]] + [:token-themes [:vector ::sm/uuid]] + [:token-themes-index {:optional true} + [:map-of {:gen/max 5} ::sm/uuid ::ctt/token-theme]] + [:token-set-groups [:vector ::sm/uuid]] + [:token-set-groups-index {:optional true} + [:map-of {:gen/max 10} ::sm/uuid ::ctt/token-set-group]] + [:token-sets-index {:optional true} + [:map-of {:gen/max 10} ::sm/uuid ::ctt/token-set]] + [:tokens {:optional true} + [:map-of {:gen/max 100} ::sm/uuid ::cto/token]]]) (def check-file-data! (sm/check-fn ::data)) diff --git a/common/src/app/common/types/token_theme.cljc b/common/src/app/common/types/token_theme.cljc new file mode 100644 index 000000000..ebb6f8b26 --- /dev/null +++ b/common/src/app/common/types/token_theme.cljc @@ -0,0 +1,31 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) KALEIDOS INC + +(ns app.common.types.token-theme + (:require + [app.common.schema :as sm])) + +(sm/register! ::token-theme + [:map {:title "TokenTheme"} + [:id ::sm/uuid] + [:name :string] + [:description {:optional true} :string] + [:modified-at {:optional true} ::sm/inst] + [:sets [:set {:gen/max 10 :gen/min 1} ::sm/uuid]]]) + +(sm/register! ::token-set-group + [:map {:title "TokenSetGroup"} + [:id ::sm/uuid] + [:name :string] + [:sets [:vector {:gen/max 10 :gen/min 1} ::sm/uuid]]]) + +(sm/register! ::token-set + [:map {:title "TokenSet"} + [:id ::sm/uuid] + [:name :string] + [:description {:optional true} :string] + [:modified-at {:optional true} ::sm/inst] + [:tokens [:vector {:gen/max 10 :gen/min 1} ::sm/uuid]]])