-
Notifications
You must be signed in to change notification settings - Fork 378
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
feat: Visual Editor as an extension #2586
Conversation
@@ -6,6 +6,7 @@ import { PluginConfig } from '@bfc/extension'; | |||
|
|||
const PluginContext = React.createContext<Required<PluginConfig>>({ | |||
uiSchema: {}, | |||
visual: {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these names here are odd. uiSchema
? visual
? Questions I have as a developer using this interface:
- What's the difference?
uiSchema
corresponds to forms andvisual
corresponds to the flow editor? Not very self-descriptive. - Why the need for both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think would be most intuitive?
I think making a change like make sense.
interface uiSchema {
formSchema: FormSchema;
flowSchema: FlowSchema;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @yeze322 can you make this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@a-b-r-o-w-n @cwhitten Great! It's a good name, I will update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
visual
renamed to flowSchema
, renamed uiSchema
to formSchema
in a separated PR #2634
renamed |
* PluginConfig.uiSchema ->formSchema * fix alphabetical issue in test
* rename 'ui:widget' field to 'widget' * change default widget to ActionHeader * fix visual editor demo * simplify visual schema * support loading widgets via reflection * uischema -> visualSchema * drive TypesWithoutWrapper as 'nowrap' in schema * remove outdated files * hoists visualSchema.types to @bfc/extension * rename visualSchema to defaultVisualSchema * fix demo * consume Extension context in Visual * declare schema as Visual Props * let visual editor consume plugin schema * split visual config to widgets & schema * implement visual plugin merge strategy * migrate SendActivity to Lg plugin * move styled components to external lib * move prompts visual schema to 'prompts' plugin * rename @visual-designer-elements to @ui-shared * use ui-shared in LG * fix visual widget type declaration * add missing workspace dependency * remove ActivityRenderer (replaced by LgWidget) * remove unref vars * rename: visualSchema -> flowSchema * update config key to `visualSchema` * chore: rename 'uiSchema' in PluginConfig to 'formSchema' (microsoft#2634) * PluginConfig.uiSchema ->formSchema * fix alphabetical issue in test
Description
Apply the extension pattern to Visual Editor
fix #2120
Extension pattern's impact on Visual Editor
Visual Editor received verbose props before, now it consumes Extension context.

Visual Editor didn't support plugin before, now it supports plugin so we can put complicated $kinds out of visual's core lib.

Visual Editor's uischema (visualSchema) only supported direct import React Component before, now it supports register a widget and consume it by string.

Main changes
uiSchemaXXX
->visualSchemaXXX
SendActivity
-> plugin/lg,TextInput
/ChoiceInput
... -> plugin/prompts)@bfc/ui-shared
lib to share ui elements between Visual Editor and plugins (shared as a design language)Plugin schema that Visual Editor supports
Visual Editor requires two parts of config -- widgets and schema
As an example, in

plugins/lg
, it declares a widget named 'LgWidget' and register the visual node definition ofMicrosoft.SendActivity
.Task Item
closes #2120
Screenshots