Skip to content

Commit

Permalink
add ui.schema (#5955)
Browse files Browse the repository at this point in the history
* add ui.schema

* add better title and description to placeholder and subtitle

* add widget to ui schema

* refactor ui schema to make way for flow & menu schema

* add editorconfig

* add first iteration of the flow schema

* un-nest options

* add menu options

* expand ability to nest menu items

* update copy

* move ui schema into ui directory

* update $id

* move additionalProperties into the definition

* remove flow schema for now
  • Loading branch information
a-b-r-o-w-n authored Jul 13, 2020
1 parent 84c050a commit 47f95fa
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
insert_final_newline = true

[*.json]
indent_style = space
indent_size = 4

[*.schema]
indent_style = space
indent_size = 4
149 changes: 149 additions & 0 deletions schemas/ui/v1.0/ui.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://schemas.botframework.com/schemas/ui/v1.0/ui.schema",
"title": "UI Schema",
"description": "Visual customization options for BotFramework SDK components.",
"type": "object",
"additionalProperties": true,
"properties": {
"form": {
"title": "Form UI Options",
"description": "UI Options object describing form UI customizations for this $kind.",
"$ref": "#/definitions/FormUIOptions"
},
"menu": {
"title": "Menu Options",
"description": "Configure how this component appears in the menu.",
"$ref": "#/definitions/MenuOptions"
}
},
"definitions": {
"FormUIOptions": {
"type": "object",
"properties": {
"description": {
"title": "Description",
"description": "Description override. Used in tooltips.",
"type": "string"
},
"helpLink": {
"title": "Help Link",
"description": "URI to component or property documentation. Used in tooltips.",
"type": "string",
"format": "uri"
},
"hidden": {
"title": "Hidden Properties",
"description": "An array of property names to hide in the UI.",
"type": "array",
"items": {
"type": "string"
}
},
"label": {
"title": "Label",
"description": "Label override. Can either be a string or false to hide the label.",
"oneOf": [
{
"type": "string"
},
{
"const": false
}
]
},
"order": {
"title": "Property Order",
"description": "Set the order of fields. Use \"*\" for all other fields. ex. [\"foo\", \"*\", \"bar\"]",
"type": "array",
"items": {
"type": "string"
},
"examples": [
[
"*"
]
]
},
"placeholder": {
"title": "Placeholder",
"description": "Placeholder override. Default is `examples` property in the schema.",
"type": "string"
},
"properties": {
"title": "Properties",
"description": "A map of component property names to UI options with customizations for each property.",
"type": "object",
"additionalProperties": {
"title": "Property Name",
"description": "UI Options object describing UI customizations for this property.",
"$ref": "#/definitions/FormUIOptions"
}
},
"subtitle": {
"title": "Subtitle",
"description": "Subtitle rendered in form title, defaults to schema.$kind",
"type": "string"
},
"widget": {
"title": "Field Widget",
"description": "Override default field widget.",
"type": "string",
"enum": [
"checkbox",
"date",
"datetime",
"input",
"number",
"radio",
"select",
"textarea"
]
}
},
"additionalProperties": false
},
"MenuOptions": {
"type": "object",
"properties": {
"label": {
"title": "Menu Item Label",
"description": "Text that appears as the menu item. Defaults to $kind.",
"type": "string"
},
"submenu": {
"title": "Submenu",
"description": "An array of menu item labels which get mapped to a menu hierarchy. Set to false to leave the component un-grouped. To have a component appear in multiple submenus, provide multiple arrays.",
"oneOf": [
{
"$ref": "#/definitions/SubmenuOptions"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/SubmenuOptions"
}
},
{
"const": false
}
]
}
},
"additionalProperties": false
},
"SubmenuOptions": {
"type": "array",
"items": {
"title": "Group Name",
"type": "string"
},
"examples": [
[
"Top Level Menu",
"Secondary Menu"
]
]
}
}
}

0 comments on commit 47f95fa

Please sign in to comment.