0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

Change spec location

This commit is contained in:
alonso.torres 2024-07-04 15:16:58 +02:00
parent 53d3b2abbc
commit c2564eaf65
8 changed files with 28 additions and 10 deletions

View file

@ -907,10 +907,6 @@
::oapi/format "password"}})
;; FIXME: this should not be here
(define! ::plugin-data
[:map-of {:gen/max 5} :string :string])
;; ---- PREDICATES
(def valid-safe-number?

View file

@ -14,6 +14,7 @@
[app.common.types.color.generic :as-alias color-generic]
[app.common.types.color.gradient :as-alias color-gradient]
[app.common.types.color.gradient.stop :as-alias color-gradient-stop]
[app.common.types.plugins :as ctpg]
[app.common.uuid :as uuid]
[clojure.test.check.generators :as tgen]
[cuerdas.core :as str]))
@ -88,7 +89,7 @@
[:gradient {:optional true} [:maybe ::gradient]]
[:image {:optional true} [:maybe ::image-color]]
[:plugin-data {:optional true}
[:map-of {:gen/max 5} :keyword ::sm/plugin-data]]]
[:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]]]
[::sm/contains-any {:strict true} [:color :gradient :image]]])
(sm/define! ::recent-color

View file

@ -15,6 +15,7 @@
[app.common.types.component :as ctk]
[app.common.types.components-list :as ctkl]
[app.common.types.pages-list :as ctpl]
[app.common.types.plugins :as ctpg]
[app.common.types.shape-tree :as ctst]
[app.common.types.shape.layout :as ctl]
[app.common.uuid :as uuid]))
@ -37,7 +38,7 @@
[:objects {:optional true}
[:map-of {:gen/max 10} ::sm/uuid :map]]
[:plugin-data {:optional true}
[:map-of {:gen/max 5} :keyword ::sm/plugin-data]]])
[:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]]])
(def check-container!
(sm/check-fn ::container))

View file

@ -24,6 +24,7 @@
[app.common.types.container :as ctn]
[app.common.types.page :as ctp]
[app.common.types.pages-list :as ctpl]
[app.common.types.plugins :as ctpg]
[app.common.types.shape-tree :as ctst]
[app.common.types.typographies-list :as ctyl]
[app.common.types.typography :as cty]
@ -59,7 +60,7 @@
[:media {:optional true}
[:map-of {:gen/max 5} ::sm/uuid ::media-object]]
[:plugin-data {:optional true}
[:map-of {:gen/max 5} :keyword ::sm/plugin-data]]])
[:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]]])
(def check-file-data!
(sm/check-fn ::data))

View file

@ -10,6 +10,7 @@
[app.common.schema :as sm]
[app.common.types.color :as-alias ctc]
[app.common.types.grid :as ctg]
[app.common.types.plugins :as ctpg]
[app.common.types.shape :as cts]
[app.common.uuid :as uuid]))
@ -45,7 +46,7 @@
[:guides {:optional true}
[:map-of {:gen/max 2} ::sm/uuid ::guide]]
[:plugin-data {:optional true}
[:map-of {:gen/max 5} :keyword ::sm/plugin-data]]]]])
[:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]]]]])
(def check-page-guide!
(sm/check-fn ::guide))

View file

@ -0,0 +1,16 @@
;; 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.plugins
(:require
[app.common.schema :as sm]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SCHEMAS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(sm/define! ::plugin-data
[:map-of {:gen/max 5} :string :string])

View file

@ -20,6 +20,7 @@
[app.common.transit :as t]
[app.common.types.color :as ctc]
[app.common.types.grid :as ctg]
[app.common.types.plugins :as ctpg]
[app.common.types.shape.attrs :refer [default-color]]
[app.common.types.shape.blur :as ctsb]
[app.common.types.shape.export :as ctse]
@ -188,7 +189,7 @@
[:grow-type {:optional true}
[::sm/one-of #{:auto-width :auto-height :fixed}]]
[:plugin-data {:optional true}
[:map-of {:gen/max 5} :keyword ::sm/plugin-data]]])
[:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]]])
(sm/define! ::group-attrs
[:map {:title "GroupAttrs"}

View file

@ -9,6 +9,7 @@
[app.common.data :as d]
[app.common.schema :as sm]
[app.common.text :as txt]
[app.common.types.plugins :as ctpg]
[app.common.uuid :as uuid]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -31,7 +32,7 @@
[:modified-at {:optional true} ::sm/inst]
[:path {:optional true} [:maybe :string]]
[:plugin-data {:optional true}
[:map-of {:gen/max 5} :keyword ::sm/plugin-data]]])
[:map-of {:gen/max 5} :keyword ::ctpg/plugin-data]]])
(def check-typography!
(sm/check-fn ::typography))