110 lines
3.5 KiB
JSON
110 lines
3.5 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"label": {
|
|
"type": "string",
|
|
"description": "The field label displayed in the edit screen",
|
|
"minLength": 1
|
|
},
|
|
"type": {
|
|
"type": "string",
|
|
"enum": [
|
|
"range"
|
|
],
|
|
"description": "Field type identifier. Must be \"range\" for this field type."
|
|
},
|
|
"name": {
|
|
"type": "string",
|
|
"description": "The field name used to save/load data. Auto-generated from label if not provided.",
|
|
"pattern": "^[a-z_][a-z0-9_]*$"
|
|
},
|
|
"key": {
|
|
"type": "string",
|
|
"description": "Unique field key. Auto-generated if not provided.",
|
|
"pattern": "^field_[a-z0-9]+$"
|
|
},
|
|
"instructions": {
|
|
"type": "string",
|
|
"description": "Instructions displayed to editors below the field label"
|
|
},
|
|
"required": {
|
|
"type": "boolean",
|
|
"description": "Whether this field is required",
|
|
"default": false
|
|
},
|
|
"conditional_logic": {
|
|
"type": [
|
|
"boolean",
|
|
"array"
|
|
],
|
|
"description": "Conditional logic rules. Set to false to disable, or provide rules array.",
|
|
"default": false
|
|
},
|
|
"wrapper": {
|
|
"type": "object",
|
|
"description": "HTML wrapper attributes",
|
|
"properties": {
|
|
"width": {
|
|
"type": "string",
|
|
"description": "Width percentage (e.g., \"50\")"
|
|
},
|
|
"class": {
|
|
"type": "string",
|
|
"description": "Custom CSS classes"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"description": "Custom HTML ID"
|
|
}
|
|
}
|
|
},
|
|
"default_value": {
|
|
"type": "number",
|
|
"description": "Default numerical value for the range field when creating new content"
|
|
},
|
|
"placeholder": {
|
|
"type": "string",
|
|
"description": "Placeholder text shown in empty fields"
|
|
},
|
|
"prepend": {
|
|
"type": "string",
|
|
"description": "Text or character to display before the range input (e.g., \"$\" for currency)"
|
|
},
|
|
"append": {
|
|
"type": "string",
|
|
"description": "Text or character to display after the range input (e.g., \"%\" for percentage)"
|
|
},
|
|
"maxlength": {
|
|
"type": "integer",
|
|
"description": "Maximum character length (if applicable)",
|
|
"minimum": 1
|
|
},
|
|
"allow_in_bindings": {
|
|
"type": "boolean",
|
|
"description": "Whether this field can be used in block bindings",
|
|
"default": false
|
|
},
|
|
"min": {
|
|
"type": "number",
|
|
"description": "Minimum allowed value for the range slider",
|
|
"default": 0
|
|
},
|
|
"max": {
|
|
"type": "number",
|
|
"description": "Maximum allowed value for the range slider",
|
|
"default": 100
|
|
},
|
|
"step": {
|
|
"type": "number",
|
|
"description": "Step size for the range slider (controls increment/decrement granularity)",
|
|
"default": 1,
|
|
"minimum": 0
|
|
}
|
|
},
|
|
"required": [
|
|
"label",
|
|
"type"
|
|
]
|
|
} |