From 6c3415b92c8eeded625def6707427df09bf6d98b Mon Sep 17 00:00:00 2001 From: Florian Schroedl Date: Tue, 6 Aug 2024 14:56:11 +0200 Subject: [PATCH] Differentiate groups and sets --- common/src/app/common/types/file.cljc | 6 ++++-- common/src/app/common/types/token_theme.cljc | 13 ++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/common/src/app/common/types/file.cljc b/common/src/app/common/types/file.cljc index ac14d71b6d..021d9a09df 100644 --- a/common/src/app/common/types/file.cljc +++ b/common/src/app/common/types/file.cljc @@ -63,10 +63,12 @@ [:map-of {:gen/max 5} ::sm/uuid ::media-object]] [:plugin-data {:optional true} [:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]] - [:token-themes [:vector ::sm/uuid]] + [:token-themes {:optional true} + [: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 {:optional true} + [: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} diff --git a/common/src/app/common/types/token_theme.cljc b/common/src/app/common/types/token_theme.cljc index ebb6f8b266..4b9bf92a05 100644 --- a/common/src/app/common/types/token_theme.cljc +++ b/common/src/app/common/types/token_theme.cljc @@ -16,11 +16,22 @@ [:modified-at {:optional true} ::sm/inst] [:sets [:set {:gen/max 10 :gen/min 1} ::sm/uuid]]]) +(sm/register! ::token-set-group-ref + [:map + [:id :sm/uuid] + [:type [:= :group]]]) + +(sm/register! ::token-set-ref + [:map + [:id :sm/uuid] + [:type [:= :set]]]) + (sm/register! ::token-set-group [:map {:title "TokenSetGroup"} [:id ::sm/uuid] [:name :string] - [:sets [:vector {:gen/max 10 :gen/min 1} ::sm/uuid]]]) + [:items [:vector {:gen/max 10 :gen/min 1} + [:or ::token-set-group-ref ::token-set-ref]]]]) (sm/register! ::token-set [:map {:title "TokenSet"}