-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema Driven Visual Editor #1770
Comments
@cwhitten this is the 'schema driven' topic we talked today |
In FormEditor, uischema contains several types of elements:
1 & 2 define what a SDK type looks like; 3,4,5 provide us convenience to config the form. In Visual Editor, we will build something similar with FormEditor. Here is an example on 'SendActivity'. const FormCard = (title, content, menu) => <div>{title}{content}{menu}</div>;
const AdaptiveTitle = data => ConceptLabels[data.$type].title;
const LgField= value = > <LgContent value={value} />
const uischema = {
[SDKTypes.SendActivity]: {
'ui:widget': FormCard,
'ui:theme': <a group of styles>,
title: AdaptiveTitle,
content: data => <LgField value={data.activity} />,
}
} |
Another example on const FormCard = (title, content, menu) => <div>{title}{content}{menu}</div>;
const ActionList = (actions: AdaptiveAction[]) => /* leverage uischema*/
const uischema = {
[SDKTypes.IfCondition]: {
'ui:widget': IfCondition,
condition: {
'ui:widget': FormCard,
title: 'Condition',
content: data => data.condition,
},
ifBranch: {
'ui:widget': ActionList,
actions: data => data.actions,
},
elseBranch: {
'ui:widget': ActionList,
actions: data => data.elseActions,
}
}
} |
@cwhitten @a-b-r-o-w-n do you have suggestions on the schema format? |
closed by
|
Description
Visual Editor and Form Editor are both visualization libs for AdaptiveDialog schema, they work on the same abstraction level.
In Form Editor, we have an
uischema.ts
file in which render process is defined by a json.We should also have a schema definition file in Visual Editor. Then we can possibily
Interface
Ideally, a semantic Visual Editor could be used like this
PR plan
uischema
definition & implement a generic renderer based onuischema
LogAction
SendActivity
,ReplaceDialog
,BeginDialog
BaseInput
TextInput
,NumberInput
(but excludeOauthInput
)IfConditon, Foreach
IfCondtion
,SwitchConditon
; loop -Foreach
,ForeachPage
;The text was updated successfully, but these errors were encountered: