Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 47f95fa

Browse files
authoredJul 13, 2020
add ui.schema (#5955)
* 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
1 parent 84c050a commit 47f95fa

File tree

2 files changed

+161
-0
lines changed

2 files changed

+161
-0
lines changed
 

‎.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
insert_final_newline = true
5+
6+
[*.json]
7+
indent_style = space
8+
indent_size = 4
9+
10+
[*.schema]
11+
indent_style = space
12+
indent_size = 4

‎schemas/ui/v1.0/ui.schema

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "https://schemas.botframework.com/schemas/ui/v1.0/ui.schema",
4+
"title": "UI Schema",
5+
"description": "Visual customization options for BotFramework SDK components.",
6+
"type": "object",
7+
"additionalProperties": true,
8+
"properties": {
9+
"form": {
10+
"title": "Form UI Options",
11+
"description": "UI Options object describing form UI customizations for this $kind.",
12+
"$ref": "#/definitions/FormUIOptions"
13+
},
14+
"menu": {
15+
"title": "Menu Options",
16+
"description": "Configure how this component appears in the menu.",
17+
"$ref": "#/definitions/MenuOptions"
18+
}
19+
},
20+
"definitions": {
21+
"FormUIOptions": {
22+
"type": "object",
23+
"properties": {
24+
"description": {
25+
"title": "Description",
26+
"description": "Description override. Used in tooltips.",
27+
"type": "string"
28+
},
29+
"helpLink": {
30+
"title": "Help Link",
31+
"description": "URI to component or property documentation. Used in tooltips.",
32+
"type": "string",
33+
"format": "uri"
34+
},
35+
"hidden": {
36+
"title": "Hidden Properties",
37+
"description": "An array of property names to hide in the UI.",
38+
"type": "array",
39+
"items": {
40+
"type": "string"
41+
}
42+
},
43+
"label": {
44+
"title": "Label",
45+
"description": "Label override. Can either be a string or false to hide the label.",
46+
"oneOf": [
47+
{
48+
"type": "string"
49+
},
50+
{
51+
"const": false
52+
}
53+
]
54+
},
55+
"order": {
56+
"title": "Property Order",
57+
"description": "Set the order of fields. Use \"*\" for all other fields. ex. [\"foo\", \"*\", \"bar\"]",
58+
"type": "array",
59+
"items": {
60+
"type": "string"
61+
},
62+
"examples": [
63+
[
64+
"*"
65+
]
66+
]
67+
},
68+
"placeholder": {
69+
"title": "Placeholder",
70+
"description": "Placeholder override. Default is `examples` property in the schema.",
71+
"type": "string"
72+
},
73+
"properties": {
74+
"title": "Properties",
75+
"description": "A map of component property names to UI options with customizations for each property.",
76+
"type": "object",
77+
"additionalProperties": {
78+
"title": "Property Name",
79+
"description": "UI Options object describing UI customizations for this property.",
80+
"$ref": "#/definitions/FormUIOptions"
81+
}
82+
},
83+
"subtitle": {
84+
"title": "Subtitle",
85+
"description": "Subtitle rendered in form title, defaults to schema.$kind",
86+
"type": "string"
87+
},
88+
"widget": {
89+
"title": "Field Widget",
90+
"description": "Override default field widget.",
91+
"type": "string",
92+
"enum": [
93+
"checkbox",
94+
"date",
95+
"datetime",
96+
"input",
97+
"number",
98+
"radio",
99+
"select",
100+
"textarea"
101+
]
102+
}
103+
},
104+
"additionalProperties": false
105+
},
106+
"MenuOptions": {
107+
"type": "object",
108+
"properties": {
109+
"label": {
110+
"title": "Menu Item Label",
111+
"description": "Text that appears as the menu item. Defaults to $kind.",
112+
"type": "string"
113+
},
114+
"submenu": {
115+
"title": "Submenu",
116+
"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.",
117+
"oneOf": [
118+
{
119+
"$ref": "#/definitions/SubmenuOptions"
120+
},
121+
{
122+
"type": "array",
123+
"items": {
124+
"$ref": "#/definitions/SubmenuOptions"
125+
}
126+
},
127+
{
128+
"const": false
129+
}
130+
]
131+
}
132+
},
133+
"additionalProperties": false
134+
},
135+
"SubmenuOptions": {
136+
"type": "array",
137+
"items": {
138+
"title": "Group Name",
139+
"type": "string"
140+
},
141+
"examples": [
142+
[
143+
"Top Level Menu",
144+
"Secondary Menu"
145+
]
146+
]
147+
}
148+
}
149+
}

0 commit comments

Comments
 (0)
Please sign in to comment.