From 0b53d23ecead79949ba74e73b58d173cedb3378a Mon Sep 17 00:00:00 2001 From: Amirhossein Alibakhshi Date: Sat, 4 Jan 2025 22:53:01 +0330 Subject: [PATCH] doc(dx): add json schema for interactive demo --- internals/doc-helpers/schema.json | 64 +++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 internals/doc-helpers/schema.json diff --git a/internals/doc-helpers/schema.json b/internals/doc-helpers/schema.json new file mode 100644 index 00000000..ee23a24a --- /dev/null +++ b/internals/doc-helpers/schema.json @@ -0,0 +1,64 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "requiredElements": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\/|(\\.\\.?\\/)+)?([a-zA-Z0-9-_]+\\/)*[a-zA-Z0-9-_]+\\.html$" + } + }, + "properties": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "defaultValue": { "type": ["string", "boolean", "number"] }, + "mutators": { + "type": "array", + "items": { + "type": "string", + "pattern": "^(#|props#)[a-zA-Z][\\w-]*$" + } + } + }, + "required": ["name"] + } + }, + "slots": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "options": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "path": { "type": "string", "pattern": "^(\\/|(\\.\\.?\\/)+)?([a-zA-Z0-9-_]+\\/)*[a-zA-Z0-9-_]+\\.html$" }, + "mutates": { + "type": "array", + "items": { + "type": "object", + "properties": { + "target": { "type": "string", "pattern": "^props#[a-zA-Z][\\w-]*$" }, + "value": { "type": ["string", "number", "boolean", "object", "null"] } + }, + "required": ["target", "value"] + } + } + }, + "required": ["name"] + } + } + }, + "required": ["name", "options"] + } + } + }, + "required": ["properties", "slots"] +}