pmk65 / jedemov2 Goto Github PK
View Code? Open in Web Editor NEWJSON-Editor Playground
Home Page: https://pmk65.github.io/jedemov2/dist/demo.html
JSON-Editor Playground
Home Page: https://pmk65.github.io/jedemov2/dist/demo.html
Given my setup here, I'm seeing a gap. Specifically:
damage
as the Effect Type.the JSON Schema for effect is
"type": "object",
"additionalProperties": { "type": "string" },
"properties": {
"attributes": {
"type": "array",
"items": {
"$ref": "#/definitions/Attribute"
}
},
"chance": {
"type": "integer"
},
"duration": {
"type": "integer"
},
"effect": {
"$ref": "#/definitions/EffectEnum"
},
"targeting": {
"$ref": "#/definitions/Targeting"
},
"amount": {
"type": "number"
},
"level": {
"type": "integer"
},
"range": {
"$ref": "#/definitions/Range"
},
"condition": {
"$ref": "#/definitions/Condition"
}
},
"allOf": [
{
"if": {
"properties": { "effect": { "const": "damage" } }
},
"then": {
"properties": {
"type": {
"$ref": "#/definitions/AttackEffectType"
}
}
}
},
{
"if": {
"properties": { "effect": { "const": "recharge" } }
},
"then": {
"properties": {
"type": {
"$ref": "#/definitions/RechargeEffectType"
}
}
}
}
],
"required": [
"effect",
"targeting"
],
"title": "Effect"
},
Note that type
is expected under two of the enum values, but with a different schema for each. Is this something that can be supported?
Additionally, this schema has been edited slightly from the one I am using for the online editor. the two items that have a maxItems, also have a minItems of the same amount. While this works correctly in the editor, it makes the copy button non-functional. If possible, could the copy button overwrite the subsequent entry in the array with its values so the array can be copied?
A complex schema that express a node tree.
some points:
anyOf
. see #/definitions/___
#/definitions/viewComponent*
(a low solution, but work){
"properties": {
"name": {
"type": "string",
"default": "root"
},
"id": {
"type": "string",
"default": "root"
},
"desc": {
"type": "string"
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layout",
"default": {
"l": 0,
"t": 0,
"w": 900,
"h": 1600
}
},
"bgColor": {
"type": "object",
"$ref": "#/definitions/color"
},
"round": {
"type": "object",
"$ref": "#/definitions/round",
"format": "grid"
},
"visible": {
"type": "boolean"
}
},
"type": "object",
"defaultProperties": [
"layout"
]
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
}
},
"type": "object",
"defaultProperties": [
"name",
"id",
"desc",
"prop",
"child"
],
"definitions": {
"___": {
"patternProperties": {
"___.*": {
"type": "string",
"required": true,
"options": {
"hidden": true
}
}
}
},
"base": {
"$ref": "#/definitions/___",
"type": "object",
"properties": {
"name": {
"type": "string",
"propertyOrder": 10
},
"id": {
"type": "string",
"pattern": "^[a-zA-Z0-9_]+$",
"minLength": 1,
"maxLength": 50,
"propertyOrder": 20
},
"desc": {
"type": "string",
"maxLength": 100,
"propertyOrder": 30
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layout",
"propertyOrder": 1
},
"bgColor": {
"$ref": "#/definitions/color",
"propertyOrder": 2000
},
"round": {
"$ref": "#/definitions/round",
"format": "grid",
"propertyOrder": 3000
},
"visible": {
"type": "boolean",
"propertyOrder": 4000
}
},
"type": "object",
"defaultProperties": [
"layout"
],
"propertyOrder": 40
},
"data": {
"type": "object",
"propertyOrder": 50
}
},
"required": [
"name",
"id",
"desc",
"prop"
],
"defaultProperties": [
"name",
"id",
"desc",
"prop"
]
},
"layout": {
"$ref": "#/definitions/___",
"properties": {
"l": {
"type": "number",
"propertyOrder": 10
},
"r": {
"type": "number",
"propertyOrder": 20
},
"t": {
"type": "number",
"propertyOrder": 30
},
"b": {
"type": "number",
"propertyOrder": 40
},
"w": {
"type": "number",
"propertyOrder": 50
},
"h": {
"type": "number",
"propertyOrder": 60
},
"centerLand": {
"type": "boolean",
"propertyOrder": 70
},
"centerPort": {
"type": "boolean",
"propertyOrder": 80
},
"___layout": {}
},
"type": "object",
"format": "grid",
"defaultProperties": [
"l",
"t",
"w",
"h",
"___layout"
]
},
"layoutSupportAutoWidthHeight": {
"$ref": "#/definitions/___",
"properties": {
"l": {
"type": "number",
"propertyOrder": 10
},
"r": {
"type": "number",
"propertyOrder": 20
},
"t": {
"type": "number",
"propertyOrder": 30
},
"b": {
"type": "number",
"propertyOrder": 40
},
"w": {
"type": "number",
"propertyOrder": 50
},
"h": {
"type": "number",
"propertyOrder": 60
},
"centerLand": {
"type": "boolean",
"propertyOrder": 70
},
"centerPort": {
"type": "boolean",
"propertyOrder": 80
},
"widthAuto": {
"type": "boolean",
"propertyOrder": 90
},
"heightAuto": {
"type": "boolean",
"propertyOrder": 100
},
"___layoutSupportAutoWidthHeight": {}
},
"type": "object",
"format": "grid",
"defaultProperties": [
"l",
"t",
"w",
"h",
"___layoutSupportAutoWidthHeight"
]
},
"color": {
"$ref": "#/definitions/___",
"properties": {
"color": {
"type": "string",
"format": "color",
"default": "#000000"
},
"alpha": {
"type": "number",
"minimum": 0,
"maximum": 1,
"default": 1
},
"___color": {}
},
"type": "object",
"format": "grid",
"defaultProperties": [
"color",
"___color"
]
},
"round": {
"$ref": "#/definitions/___",
"properties": {
"radius": {
"type": "number"
},
"borderWidth": {
"type": "number"
},
"borderColor": {
"$ref": "#/definitions/color"
},
"___round": {}
},
"type": "object",
"defaultProperties": [
"radius",
"___round"
]
},
"viewComponent": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent1"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponent": {}
},
"defaultProperties": [
"child",
"___viewComponent"
]
},
"viewComponent1": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent2"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponent1": {}
},
"defaultProperties": [
"child",
"___viewComponent1"
]
},
"viewComponent2": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent3"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponent2": {}
},
"defaultProperties": [
"child",
"___viewComponent2"
]
},
"viewComponent3": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent4"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponent3": {}
},
"defaultProperties": [
"child",
"___viewComponent3"
]
},
"viewComponent4": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent5"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponent4": {}
},
"defaultProperties": [
"child",
"___viewComponent4"
]
},
"viewComponent5": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponent5": {}
},
"defaultProperties": [
"child",
"___viewComponent5"
]
},
"viewComponentWithoutSeat": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat1"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponentWithoutSeat": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat"
]
},
"viewComponentWithoutSeat1": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat2"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponentWithoutSeat1": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat1"
]
},
"viewComponentWithoutSeat2": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat3"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponentWithoutSeat2": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat2"
]
},
"viewComponentWithoutSeat3": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat4"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponentWithoutSeat3": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat3"
]
},
"viewComponentWithoutSeat4": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat5"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponentWithoutSeat4": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat4"
]
},
"viewComponentWithoutSeat5": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___viewComponentWithoutSeat5": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat5"
]
},
"labelComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "label",
"readOnly": true
},
"prop": {
"properties": {
"text": {
"type": "string",
"propertyOrder": 10
},
"textSize": {
"type": "number",
"propertyOrder": 20
},
"textColor": {
"type": "object",
"$ref": "#/definitions/color",
"propertyOrder": 30
},
"maxWidth": {
"type": "number",
"propertyOrder": 40
},
"ellipsize": {
"type": "number",
"enum": [
0,
1,
2
],
"options": {
"enum_titles": [
"...",
"truncate",
"marquee"
]
},
"propertyOrder": 50
},
"maxLines": {
"type": "number",
"default": 1,
"propertyOrder": 60
},
"gravity": {
"type": "number",
"enum": [
0,
1,
2
],
"default": 0,
"options": {
"enum_titles": [
"left",
"right",
"center"
]
},
"propertyOrder": 70
}
},
"defaultProperties": [
"text",
"textSize",
"gravity",
"textColor"
]
},
"___labelComponent": {}
},
"defaultProperties": [
"data",
"___labelComponent"
]
},
"imageComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "image",
"readOnly": true
},
"prop": {
"properties": {
"src": {
"type": "string",
"format": "url"
},
"defaultSrc": {
"type": "string",
"format": "url"
},
"mode": {
"type": "string",
"enum": [
"centerCrop",
"fit",
"fill"
]
}
},
"defaultProperties": [
"src",
"defaultSrc",
"mode"
]
},
"___imageComponent": {}
},
"defaultProperties": [
"data",
"___imageComponent"
]
},
"lottieComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "lottie",
"readOnly": true
},
"prop": {
"properties": {
"url": {
"type": "string",
"format": "url"
},
"status": {
"type": "boolean"
}
},
"type": "object",
"defaultProperties": [
"url",
"status"
]
},
"___lottieComponent": {}
},
"defaultProperties": [
"data",
"___lottieComponent"
]
},
"keyframeComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "keyframe",
"readOnly": true
},
"prop": {
"properties": {
"url": {
"type": "string",
"format": "url"
},
"status": {
"type": "boolean"
}
},
"defaultProperties": [
"url",
"status"
]
},
"___keyframeComponent": {}
},
"defaultProperties": [
"data",
"___keyframeComponent"
]
},
"seatViewComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "seatView",
"readOnly": true
},
"prop": {
"properties": {
"seat": {
"type": "number",
"minimum": 0,
"maximum": 8
},
"seatInfo": {
"type": "object"
},
"states": {
"type": "object",
"properties": {
"empty": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "emptyView",
"readOnly": true
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
}
},
"defaultProperties": [
"child"
]
},
"audio": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "audioView",
"readOnly": true
},
"prop": {
"properties": {
"audioAnim": {
"$ref": "#/definitions/lottieComponent"
}
},
"defaultProperties": [
"audioAnim"
]
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
}
},
"defaultProperties": [
"child"
]
},
"video": {
"$ref": "#/definitions/base",
"properties": {
"name": {
"default": "videoView",
"readOnly": true
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
}
},
"defaultProperties": [
"child"
]
}
}
}
},
"defaultProperties": [
"seat",
"states"
]
},
"data": {
"default": {
"seatInfo": "sync:p_user.users[position=1]"
}
},
"child": {
"items": {
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"type": "array"
},
"___seatViewComponent": {}
},
"defaultProperties": [
"data",
"child",
"___seatViewComponent"
]
},
"muteButtonComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "muteButton",
"readOnly": true
},
"prop": {
"properties": {
"onSrc": {
"type": "string",
"format": "url"
},
"offSrc": {
"type": "string",
"format": "url"
}
},
"defaultProperties": [
"onSrc",
"offSrc"
]
},
"___muteButtonComponent": {}
},
"defaultProperties": [
"data",
"___muteButtonComponent"
]
},
"genderComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "genderView",
"readOnly": true
},
"prop": {
"properties": {
"genderUrl": {
"type": "object",
"properties": {
"M": {
"type": "string",
"format": "url"
},
"F": {
"type": "string",
"format": "url"
},
"N": {
"type": "string",
"format": "url"
}
},
"defaultProperties": [
"M",
"F",
"N"
]
}
},
"defaultProperties": [
"genderUrl"
]
},
"___genderComponent": {}
},
"defaultProperties": [
"data",
"___genderComponent"
]
},
"followButtonComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "followButton",
"readOnly": true
},
"prop": {
"properties": {
"src": {
"type": "string",
"format": "url"
}
},
"type": "object",
"defaultProperties": [
"src"
]
},
"___followButtonComponent": {}
},
"defaultProperties": [
"data",
"___followButtonComponent"
]
},
"contributeComponent": {
"$ref": "#/definitions/base",
"type": "object",
"properties": {
"name": {
"default": "contributeView",
"readOnly": true
},
"prop": {
"properties": {
"fansWidth": {
"type": "number"
},
"fansHeight": {
"type": "number"
},
"fansBorderWidth": {
"type": "number"
}
},
"type": "object"
},
"___contributeComponent": {}
},
"defaultProperties": [
"data",
"___contributeComponent"
]
}
}
}
{
"properties": {
"name": {
"title": "组件名称",
"type": "string",
"description": "不同组件有不同的组件行为",
"default": "root"
},
"id": {
"title": "唯一标识",
"type": "string",
"description": "当前布局内不允许重复,用于H5识别对应组件",
"default": "root"
},
"desc": {
"title": "描述",
"type": "string",
"description": "备注,方便查看及修改",
"default": "根节点,不要改动,在子节点上添加组件"
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layout",
"default": {
"l": 0,
"t": 0,
"w": 900,
"h": 1600
}
},
"bgColor": {
"title": "背景色",
"type": "object",
"$ref": "#/definitions/color"
},
"round": {
"title": "圆角",
"type": "object",
"$ref": "#/definitions/round",
"format": "grid"
},
"visible": {
"title": "是否可见",
"type": "boolean"
}
},
"title": "属性",
"type": "object",
"defaultProperties": [
"layout"
]
},
"child": {
"items": {
"title": "子组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
}
},
"title": "布局",
"type": "object",
"defaultProperties": [
"name",
"id",
"desc",
"prop",
"child"
],
"definitions": {
"___": {
"patternProperties": {
"___.*": {
"title": "识别属性,勿动",
"type": "string",
"required": true,
"options": {
"hidden": true
}
}
}
},
"base": {
"$ref": "#/definitions/___",
"type": "object",
"properties": {
"name": {
"title": "组件名称",
"type": "string",
"description": "不同组件有不同的组件行为",
"propertyOrder": 10
},
"id": {
"title": "唯一标识",
"type": "string",
"description": "当前布局内不允许重复,用于H5识别对应组件",
"pattern": "^[a-zA-Z0-9_]+$",
"minLength": 1,
"maxLength": 50,
"propertyOrder": 20
},
"desc": {
"title": "描述",
"type": "string",
"description": "备注,方便查看及修改",
"maxLength": 100,
"propertyOrder": 30
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layout",
"propertyOrder": 1
},
"bgColor": {
"$ref": "#/definitions/color",
"propertyOrder": 2000
},
"round": {
"$ref": "#/definitions/round",
"format": "grid",
"propertyOrder": 3000
},
"visible": {
"title": "是否可见",
"type": "boolean",
"propertyOrder": 4000
}
},
"title": "属性",
"type": "object",
"defaultProperties": [
"layout"
],
"propertyOrder": 40
},
"data": {
"title": "数据映射",
"type": "object",
"description": "此组件支持的属性可指定数据来源,具体格式参照:https://git.corp.qihoo.net/pepper/doc/blob/master/interface/live/publicRoom/README.md",
"propertyOrder": 50
}
},
"required": [
"name", "id", "desc", "prop"
],
"defaultProperties": [
"name",
"id",
"desc",
"prop"
]
},
"layout": {
"$ref": "#/definitions/___",
"properties": {
"l": {
"title": "距左",
"description": "单位:像素",
"type": "number",
"propertyOrder": 10
},
"r": {
"title": "距右",
"type": "number",
"description": "单位:像素",
"propertyOrder": 20
},
"t": {
"title": "距上",
"type": "number",
"description": "单位:像素",
"propertyOrder": 30
},
"b": {
"title": "距下",
"type": "number",
"description": "单位:像素",
"propertyOrder": 40
},
"w": {
"title": "宽度",
"type": "number",
"description": "单位:像素",
"propertyOrder": 50
},
"h": {
"title": "高度",
"type": "number",
"description": "单位:像素",
"propertyOrder": 60
},
"centerLand": {
"title": "相对于父容器,横向居中",
"type": "boolean",
"propertyOrder": 70
},
"centerPort": {
"title": "相对于父容器,纵向居中",
"type": "boolean",
"propertyOrder": 80
},
"___layout": {}
},
"title": "位置布局",
"type": "object",
"description": "可灵活设置各种布局,如不会使用请咨询客户端同学",
"format": "grid",
"defaultProperties": [
"l",
"t",
"w",
"h",
"___layout"
]
},
"layoutSupportAutoWidthHeight": {
"$ref": "#/definitions/___",
"properties": {
"l": {
"title": "距左",
"description": "单位:像素",
"type": "number",
"propertyOrder": 10
},
"r": {
"title": "距右",
"type": "number",
"description": "单位:像素",
"propertyOrder": 20
},
"t": {
"title": "距上",
"type": "number",
"description": "单位:像素",
"propertyOrder": 30
},
"b": {
"title": "距下",
"type": "number",
"description": "单位:像素",
"propertyOrder": 40
},
"w": {
"title": "宽度",
"type": "number",
"description": "单位:像素",
"propertyOrder": 50
},
"h": {
"title": "高度",
"type": "number",
"description": "单位:像素",
"propertyOrder": 60
},
"centerLand": {
"title": "横向居中",
"description": "相对于父容器",
"type": "boolean",
"propertyOrder": 70
},
"centerPort": {
"title": "纵向居中",
"description": "相对于父容器",
"type": "boolean",
"propertyOrder": 80
},
"widthAuto": {
"title": "宽度自适应",
"description": "可用于横向布局,固定高度",
"type": "boolean",
"propertyOrder": 90
},
"heightAuto": {
"title": "高度自适应",
"description": "可用于纵向布局,固定宽度",
"type": "boolean",
"propertyOrder": 100
},
"___layoutSupportAutoWidthHeight": {}
},
"title": "位置布局(支持自适应)",
"type": "object",
"description": "可灵活设置各种布局,如不会使用请咨询客户端同学",
"format": "grid",
"defaultProperties": [
"l",
"t",
"w",
"h",
"___layoutSupportAutoWidthHeight"
]
},
"color": {
"$ref": "#/definitions/___",
"properties": {
"color": {
"title": "颜色",
"type": "string",
"format": "color",
"default": "#000000"
},
"alpha": {
"title": "透明度",
"type": "number",
"minimum": 0,
"maximum": 1,
"default": 1
},
"___color": {}
},
"title": "颜色",
"type": "object",
"format": "grid",
"defaultProperties": [
"color",
"___color"
]
},
"round": {
"$ref": "#/definitions/___",
"properties": {
"radius": {
"title": "圆角半径",
"type": "number"
},
"borderWidth": {
"title": "边框的宽度",
"type": "number"
},
"borderColor": {
"title": "边框颜色",
"$ref": "#/definitions/color"
},
"___round": {}
},
"title": "圆角",
"type": "object",
"defaultProperties": [
"radius",
"___round"
]
},
"viewComponent": {
"$ref": "#/definitions/base",
"title": "view组件",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent1"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponent": {}
},
"defaultProperties": [
"child",
"___viewComponent"
]
},
"viewComponent1": {
"$ref": "#/definitions/base",
"title": "view组件",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent2"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponent1": {}
},
"defaultProperties": [
"child",
"___viewComponent1"
]
},
"viewComponent2": {
"$ref": "#/definitions/base",
"title": "view组件",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent3"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponent2": {}
},
"defaultProperties": [
"child",
"___viewComponent2"
]
},
"viewComponent3": {
"$ref": "#/definitions/base",
"title": "view组件",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent4"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponent3": {}
},
"defaultProperties": [
"child",
"___viewComponent3"
]
},
"viewComponent4": {
"$ref": "#/definitions/base",
"title": "view组件",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponent5"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponent4": {}
},
"defaultProperties": [
"child",
"___viewComponent4"
]
},
"viewComponent5": {
"$ref": "#/definitions/base",
"title": "view组件",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/seatViewComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponent5": {}
},
"defaultProperties": [
"child",
"___viewComponent5"
]
},
"viewComponentWithoutSeat": {
"$ref": "#/definitions/base",
"title": "view组件",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat1"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponentWithoutSeat": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat"
]
},
"viewComponentWithoutSeat1": {
"$ref": "#/definitions/base",
"title": "view组件",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat2"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponentWithoutSeat1": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat1"
]
},
"viewComponentWithoutSeat2": {
"$ref": "#/definitions/base",
"title": "view组件",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat3"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponentWithoutSeat2": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat2"
]
},
"viewComponentWithoutSeat3": {
"$ref": "#/definitions/base",
"title": "view组件",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat4"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponentWithoutSeat3": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat3"
]
},
"viewComponentWithoutSeat4": {
"$ref": "#/definitions/base",
"title": "view组件",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat5"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponentWithoutSeat4": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat4"
]
},
"viewComponentWithoutSeat5": {
"$ref": "#/definitions/base",
"title": "view组件",
"type": "object",
"properties": {
"name": {
"default": "view",
"readOnly": true
},
"prop": {
"properties": {
"layout": {
"type": "object",
"$ref": "#/definitions/layoutSupportAutoWidthHeight"
}
}
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___viewComponentWithoutSeat5": {}
},
"defaultProperties": [
"child",
"___viewComponentWithoutSeat5"
]
},
"labelComponent": {
"$ref": "#/definitions/base",
"title": "文字组件",
"type": "object",
"properties": {
"name": {
"default": "label",
"readOnly": true
},
"prop": {
"properties": {
"text": {
"type": "string",
"title": "文字内容",
"propertyOrder": 10
},
"textSize": {
"type": "number",
"title": "文字大小",
"propertyOrder": 20
},
"textColor": {
"title": "文字颜色",
"type": "object",
"$ref": "#/definitions/color",
"propertyOrder": 30
},
"maxWidth": {
"type": "number",
"title": "最大宽度",
"propertyOrder": 40
},
"ellipsize": {
"type": "number",
"title": "超长处理",
"description": "文本超过显示范围后的末尾处理方式。设置最大宽度或宽度后,单行可以有跑马灯效果,单行多行可以末尾省略号或截断",
"enum": [
0,
1,
2
],
"options": {
"enum_titles": [
"省略号",
"截断",
"跑马灯"
]
},
"propertyOrder": 50
},
"maxLines": {
"type": "number",
"title": "最多显示行数",
"default": 1,
"propertyOrder": 60
},
"gravity": {
"type": "number",
"title": "内部文字位置",
"description": "可用于固定label大小,设置文字位置,纵向始终是居中的",
"enum": [
0,
1,
2
],
"default": 0,
"options": {
"enum_titles": [
"左对齐",
"右对齐",
"居中"
]
},
"propertyOrder": 70
}
},
"defaultProperties": [
"text",
"textSize",
"gravity",
"textColor"
]
},
"___labelComponent": {}
},
"defaultProperties": [
"data",
"___labelComponent"
]
},
"imageComponent": {
"$ref": "#/definitions/base",
"title": "图片组件",
"type": "object",
"properties": {
"name": {
"default": "image",
"readOnly": true
},
"prop": {
"properties": {
"src": {
"title": "图片地址",
"type": "string",
"format": "url"
},
"defaultSrc": {
"title": "默认图地址",
"type": "string",
"format": "url"
},
"mode": {
"title": "显示模式",
"type": "string",
"enum": [
"centerCrop",
"fit",
"fill"
],
"options": {
"enum_titles": [
"缩放后截取中间部分显示,不会变形,会有缺失,常用",
"有留白,不会变形",
"铺满,会变形"
]
}
}
},
"defaultProperties": [
"src",
"defaultSrc",
"mode"
]
},
"___imageComponent": {}
},
"defaultProperties": [
"data",
"___imageComponent"
]
},
"lottieComponent": {
"$ref": "#/definitions/base",
"title": "json动画组件",
"type": "object",
"properties": {
"name": {
"default": "lottie",
"readOnly": true
},
"prop": {
"properties": {
"url": {
"type": "string",
"title": "json动画url",
"format": "url"
},
"status": {
"type": "boolean",
"title": "开关"
}
},
"title": "属性",
"type": "object",
"defaultProperties": [
"url",
"status"
]
},
"___lottieComponent": {}
},
"defaultProperties": [
"data",
"___lottieComponent"
]
},
"keyframeComponent": {
"$ref": "#/definitions/base",
"title": "关键帧动画组件",
"type": "object",
"properties": {
"name": {
"default": "keyframe",
"readOnly": true
},
"prop": {
"properties": {
"url": {
"type": "string",
"title": "帧动画url",
"format": "url"
},
"status": {
"type": "boolean",
"title": "开关"
}
},
"defaultProperties": [
"url",
"status"
]
},
"___keyframeComponent": {}
},
"defaultProperties": [
"data",
"___keyframeComponent"
]
},
"seatViewComponent": {
"$ref": "#/definitions/base",
"title": "座位组件",
"type": "object",
"properties": {
"name": {
"default": "seatView",
"readOnly": true
},
"prop": {
"properties": {
"seat": {
"type": "number",
"title": "座位号",
"minimum": 0,
"maximum": 8
},
"seatInfo": {
"type": "object",
"title": "座位信息",
"description": "请通过数据映射设置"
},
"states": {
"type": "object",
"title": "状态布局",
"properties": {
"empty": {
"$ref": "#/definitions/base",
"type": "object",
"title": "空座位布局",
"properties": {
"name": {
"default": "emptyView",
"readOnly": true
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
}
},
"defaultProperties": [
"child"
]
},
"audio": {
"$ref": "#/definitions/base",
"title": "音频模式布局",
"properties": {
"name": {
"default": "audioView",
"readOnly": true
},
"prop": {
"properties": {
"audioAnim": {
"$ref": "#/definitions/lottieComponent"
}
},
"defaultProperties": [
"audioAnim"
]
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
}
},
"defaultProperties": [
"child"
]
},
"video": {
"$ref": "#/definitions/base",
"title": "视频模式布局",
"properties": {
"name": {
"default": "videoView",
"readOnly": true
},
"child": {
"items": {
"title": "组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
}
},
"defaultProperties": [
"child"
]
}
}
}
},
"defaultProperties": [
"seat",
"states"
]
},
"data": {
"default": {
"seatInfo": "sync:p_user.users[position=1]"
}
},
"child": {
"items": {
"title": "子组件",
"type": "object",
"anyOf": [
{
"$ref": "#/definitions/labelComponent"
},
{
"$ref": "#/definitions/imageComponent"
},
{
"$ref": "#/definitions/viewComponentWithoutSeat"
},
{
"$ref": "#/definitions/lottieComponent"
},
{
"$ref": "#/definitions/keyframeComponent"
},
{
"$ref": "#/definitions/muteButtonComponent"
},
{
"$ref": "#/definitions/genderComponent"
},
{
"$ref": "#/definitions/followButtonComponent"
},
{
"$ref": "#/definitions/contributeComponent"
}
]
},
"title": "子组件",
"type": "array"
},
"___seatViewComponent": {}
},
"defaultProperties": [
"data",
"child",
"___seatViewComponent"
]
},
"muteButtonComponent": {
"$ref": "#/definitions/base",
"title": "静音按钮组件",
"type": "object",
"properties": {
"name": {
"default": "muteButton",
"readOnly": true
},
"prop": {
"properties": {
"onSrc": {
"type": "string",
"title": "开启图标",
"format": "url"
},
"offSrc": {
"type": "string",
"title": "关闭图标",
"format": "url"
}
},
"defaultProperties": [
"onSrc",
"offSrc"
]
},
"___muteButtonComponent": {}
},
"defaultProperties": [
"data",
"___muteButtonComponent"
]
},
"genderComponent": {
"$ref": "#/definitions/base",
"title": "性别组件",
"type": "object",
"properties": {
"name": {
"default": "genderView",
"readOnly": true
},
"prop": {
"properties": {
"genderUrl": {
"type": "object",
"title": "性别图片url",
"properties": {
"M": {
"type": "string",
"title": "男性图片",
"format": "url"
},
"F": {
"type": "string",
"title": "女性图片",
"format": "url"
},
"N": {
"type": "string",
"title": "未知性别图片",
"format": "url"
}
},
"defaultProperties": [
"M",
"F",
"N"
]
}
},
"defaultProperties": [
"genderUrl"
]
},
"___genderComponent": {}
},
"defaultProperties": [
"data",
"___genderComponent"
]
},
"followButtonComponent": {
"$ref": "#/definitions/base",
"title": "关注按钮组件",
"type": "object",
"properties": {
"name": {
"default": "followButton",
"readOnly": true
},
"prop": {
"properties": {
"src": {
"type": "string",
"title": "按钮图标url",
"format": "url"
}
},
"title": "属性",
"type": "object",
"defaultProperties": [
"src"
]
},
"___followButtonComponent": {}
},
"defaultProperties": [
"data",
"___followButtonComponent"
]
},
"contributeComponent": {
"$ref": "#/definitions/base",
"title": "三人贡献榜组件",
"type": "object",
"properties": {
"name": {
"default": "contributeView",
"readOnly": true
},
"prop": {
"properties": {
"fansWidth": {
"title": "粉丝头像宽度",
"type": "number"
},
"fansHeight": {
"title": "粉丝头像高度",
"type": "number"
},
"fansBorderWidth": {
"title": "粉丝头像边框宽度",
"type": "number"
}
},
"title": "属性",
"type": "object"
},
"___contributeComponent": {}
},
"defaultProperties": [
"data",
"___contributeComponent"
]
}
}
}
Data is included in URL, but only Schema seems to be updated.
The external schemas defined in $ref doesn't load. Only if I supply a absolute path it works.
Currently the Slide-In menu is triggered by CSS hover. This causes problems when the mouse moves outside the panel (specially when a selectbox is open)
Instead it should be JavaScript controlled, so it closes when you click close button or outside panel.
When selecting a template engine an error is thrown.
"Template engine XXXXX missing required library."
If anyone got a good Schema and/or JavaScript examples that show off some of the more advanced features of JSON-Editor, please post it here on the JSON-Editor Interactive Playground GitHub page.
I will then evaluate it and add it to the list of available examples. 🚀
Currently the height of the ACE Editor instances is set to a fixed value (CSS)
The current checkbox logic only takes action when value is true. (assumes all values are false by default). This doesn't work as some checkbox options now are true as default.
I get TypeError when I use schema with a type definition.
Here's the example: https://is.gd/siIJYX
Uncaught (in promise) TypeError: t.extends.reduce is not a function
at t.extends (jsoneditor.js:14:76223)
at jsoneditor.js:14:85375
at Array.forEach (<anonymous>)
at t.value (jsoneditor.js:14:85288)
at jsoneditor.js:14:81837
at Array.forEach (<anonymous>)
at t.properties (jsoneditor.js:14:81762)
at jsoneditor.js:14:87186
at Array.forEach (<anonymous>)
at t.value (jsoneditor.js:14:87087)
Schema
{
"title": "Example",
"type": "object",
"definitions": {
"indexFilter": {
"type": [
"string",
"array",
"null"
],
"uniqueItems": true,
"items": {
"type": "string"
},
"format": "table"
}
},
"properties": {
"filters": {
"title": "Keyword filters",
"type": "object",
"properties": {
"category": {
"title": "Categrories",
"extends": {
"$ref": "#/definitions/indexFilter"
}
}
}
}
},
"format": "categories"
}
I'm looking at the Autocomplete example here:
https://pmk65.github.io/20test/dist/demo.html
It's almost exactly what I need, but my Autocomplete API returns a combination of Id and Title. So I want to show the Title to the user, but save both the Id and Title in the json.
Or only save the Id in the Json and do a lookup for the title every time the user opens the json-editor?
Because I need the Id to know what item is selected. But showing just an id (guid) in the json-editor is not very user friendly.
Any idea how I can do this? Thanks!
The following example shows error:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"test": {
"properties": {
"sources": {
"options": { "compact": true },
"type": "table",
"items": {
"properties": {
"amount": {
"type": "string"
}
}
}
}
}
}
}
}
The error resolves when we set compact: false
. Doesn't happen on https://json-editor.github.io/json-editor/
In FireFox: TypeError: this.title is undefined
In Chrome: TypeError: Cannot read properties of undefined (reading 'appendChild')
Parameters like lib_dompurify=true
is not evaluated correctly, due to Boolean/string format. Needs to be converted into numeric values.
After new update, the Direct Link button no longer works.
Hello, the example with iMask is unfortunately not working. I cannot also find the option to include iMask plugin to the playground environment, plugin is not listed in external libraries, but example with iMask is.
However it is working under this link: https://json-editor.github.io/json-editor/imask.html but it is not possible to edit schema and js file there.
Thanks for help
Replace hard coded example from demo.html with example loaded from the list of examples if LocalStorage var is UNDEFINED/EMPTY and NO URL parameters is present.
Add Ace editor for CSS on the JavaScript Tab with splitpanel.
Hi,
thanks for putting so much effort into this project.
I would like to use it, although I can not find any license information.
Could you add a license?
Greetings
DescribedBy, Radio, Grid_strict etc.
body
field)First Thank you for this excellent resource.
I am not able to figure out , or google search for, how to validate an optional url.
Let alone using a definition multiple times.
Such an example would be most helpful.
Thanks
Chris
Error: Upload handler required for upload editor
Add LocalStorage support so that schema, startval, JavaScript, CSS and config options are saved when form is generated.
When page is loaded and there is NO parameters in the URL, then load previously saved data from LocalStorage and update form.
Hi,
The example named Typeahead Autocomplete as custom editor
errors when opening.
Error is TypeError: window.JSONEditor.defaults.editors.string.extend is not a function
I cannot see any other example showing how to extend the editors programmatically.
Can this please be looked into?
Similar to what is displayed on the original Demo.
Maybe located in a new slide-in panel?
Replace the selectbox with a button that opens a right side panel.
Inside panel is selectbox, expanded to full height/width.
Click on example closes panel and load example.
Currently the JSON-Editor instance is created in a "hidden" JavaScript code, inserted before the content of the JavaScript Tab.
This method has a drawback, because it is not possible to add code before the instance is created.
Pros: After change, the "hidden" JavaScript code will be removed, and the creation of the instance will be inside the JavaScript Tab code.
The JavaScript Editor will then have a couple of lines that are mandatory (readonly) which creates the JSON-Editor instance. The user can then add code above and below these lines, allowing for all setup variations.
Cons: After the changes, none of the previously generated Direct Links will work.
Error: TypeError: a is null
is it possible to have a multilinetext option for string values?
SyntaxError: Failed to load worker script at "worker-javascript.js"
According to Stack Overflow it's a cross origin problem, so probably related to the blob url problem described in #2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.