Файли
openidea/crates/ide-plugin/tests/fixtures/settings-controls/settings.schema.json
T
Bruno Valladares c1d552e578 feat(plugins): radio, segmented, slider, color and checkbox-list controls for plugin settings (#7693)
Plugin API 1.21 adds optional settings schema fields: presentation (select, radio, segmented, slider, color, checkbox-list), enumOptions (label, description, icon per enum value), minimum / maximum / step, and when conditions on another setting of the page. New src/ui primitives RadioGroup, SegmentedControl, CheckboxGroup, Slider and ColorInput. Schemas that use none of them render as before; manifests admitting an older API keep ignoring JSON Schema bounds.

Review changes: the fields are gated on API 1.21 (1.20 shipped in 0.1.57), and the colour swatch fill is stretched inside its button.

Part of #7688.

Co-authored-by: Bruno0416 <[email protected]>
2026-12-03 21:00:11 +08:00

90 рядки
2.6 KiB
JSON

{
"properties": {
"density": {
"type": "string",
"title": "Density",
"presentation": "segmented",
"enum": ["compact", "comfortable", "custom"],
"default": "comfortable",
"enumOptions": [
{
"value": "compact",
"label": "Compact",
"description": "Smaller rows",
"icon": "icons/compact.svg",
"iconDark": "icons/compact_dark.svg"
},
{ "value": "comfortable", "label": "Comfortable", "icon": "icons/comfortable.svg" },
{ "value": "custom", "label": "Custom", "description": "Choose the row height" }
]
},
"rowHeight": {
"type": "integer",
"title": "Row height",
"presentation": "slider",
"minimum": 16,
"maximum": 40,
"step": 2,
"default": 24,
"when": { "key": "density", "equals": "custom" }
},
"folders": {
"type": "string",
"title": "Folder icons",
"group": "Icons",
"presentation": "radio",
"enum": ["specific", "classic", "none"],
"default": "specific",
"enumOptions": [
{ "value": "specific", "label": "Specific", "description": "An icon for each known folder name" },
{ "value": "classic", "label": "Classic", "description": "One folder icon for every folder" },
{ "value": "none", "label": "None" }
]
},
"folderColor": {
"type": "string",
"title": "Folder colour",
"group": "Icons",
"presentation": "color",
"default": "#3574f0",
"when": { "key": "folders", "in": ["specific", "classic"] }
},
"packs": {
"type": "array",
"title": "Icon packs",
"group": "Icons",
"presentation": "checkbox-list",
"items": {
"type": "string",
"enum": ["react", "angular", "rust"],
"enumOptions": [
{ "value": "react", "label": "React", "icon": "icons/react.svg" },
{ "value": "angular", "label": "Angular" },
{ "value": "rust", "label": "Rust", "description": "Cargo and rustfmt files" }
]
},
"default": ["rust"]
},
"opacity": {
"type": "number",
"title": "Icon opacity",
"group": "Icons",
"presentation": "slider",
"minimum": 0.2,
"maximum": 1,
"step": 0.05,
"default": 0.8
},
"arrows": {
"type": "string",
"title": "Tree arrows",
"group": "Icons",
"enum": ["chevron", "triangle"],
"enumOptions": [
{ "value": "chevron", "label": "Chevrons" },
{ "value": "triangle", "label": "Triangles", "description": "As in older IDEs" }
]
}
}
}