Users provide an array of middleware functions to DecoratorComposer
The DecoratorComposer initializes these functions based on the decorators type
When, for example, an activity is rendered, it passes the activity to the ActivityDecorator to form a request and process middlewars, which apply the appropriate changes
Specific Changes
added decorators for activity decoration
added ActivityBorder for activity decorators stack
added test
added example decorator implementation
-
-
[x] I have added tests and executed them locally
[x] I have updated CHANGELOG.md
[x] ~I have updated documentation~
Review Checklist
This section is for contributors to review your work.
[x] ~Accessibility reviewed (tab order, content readability, alt text, color contrast)~
[x] Browser and platform compatibilities reviewed
[x] CSS styles reviewed (minimal rules, no z-index)
[x] ~Documents reviewed (docs, samples, live demo)~
[x] ~Internationalization reviewed (strings, unit formatting)~
[x] package.json and package-lock.json reviewed
[x] ~Security reviewed (no data URIs, check for nonce leak)~
Changelog Entry
Added
botframework-webchat-api/decorator
import, in PR #5205, by @OEvgenyDecoratorComposer
andActivityDecorator
to be used for decorating activity border, in PR #5205, by @OEvgenyDescription
This adds a way to decorate various things in WebChat in the future. For now it supports activity decoration with a custom border.
Design
The design introduces decorators to WebChat. The current implementation includes support for activity decoration with custom border decorator.
Key components of the design:
ActivityBorderDecoratorMiddleware
: Middleware stack for managing activity border changesActivityDecorator
: A React component for decorating activities e.g. inside of the WebChat or activity middlewaresDecoratorComposer
: Allows multiple decorators to be passed together and initialized according to the type of decoratorcreateDecoratorComposer
: A factory function for creating decorator composerActivityDecoratorRequestType
: Describes activity decorator requestFlow
DecoratorComposer
DecoratorComposer
initializes these functions based on the decorators typeactivity
to theActivityDecorator
to form a request and process middlewars, which apply the appropriate changesSpecific Changes
-
-
CHANGELOG.md
Review Checklist
z-index
)package.json
andpackage-lock.json
reviewed