You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documentation/docs/controls/AdaptiveCardHost.md
+28-7Lines changed: 28 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,19 @@ Three custom themes have been created for Microsoft Teams to emulate the colors
11
11
12
12
All Elements and Actions of Adaptive Cards have been redefined using Fluent UI React, both for SharePoint and Microsoft Teams (in this case the "Fluent UI Northstar" library is not used), adding and improving features that are not managed in Microsoft's implementation of the "adaptivecards-fluentui" library (Theme support for example).
13
13
14
+
Thanks to the "context" property that allows you to pass the SPFx context, whether the "data" property is passed or not, a new field called @context will be injected into the data object.
15
+
16
+
This allows, using Adaptive Cards templating syntax, to access to the context informations using the following fields (for more information on these fields, refer to the [BaseComponentContext](https://docs.microsoft.com/en-us/javascript/api/sp-component-base/basecomponentcontext) class):
17
+
- "aadInfo": property "aadInfo" of the SPFx context object.
18
+
- "cultureInfo": "cultureInfo" property of the SPFx context object.
19
+
- "legacyPageContext": "legacyPageContext" property of the SPFx context object.
20
+
- "list": property "list" of the SPFx context object.
21
+
- "listItem": property "listItem" of the SPFx context object.
22
+
- "site": property "site" of the SPFx context object.
23
+
- "user": "user" property of the SPFx context object.
24
+
- "web": "web" property of the SPFx context object.
25
+
- "theme": property "theme" from the current theme applied to the card.
26
+
14
27
The Adaptive Cards version supported is 1.5, by using the 'adaptivecards' npm package version 2.10.0.
15
28
16
29
Here is an example of the control in action inside a Web Part:
- Example on use the `AdaptiveCardHost` control with SharePoint Theme "Section Variation" ('this.props.theme' is the theme that come from the Web Part) */):
@@ -141,6 +161,7 @@ The `AdaptiveCardHost` control can be configured with the following properties:
141
161
| onSetCustomActions | (registry: CardObjectRegistry<Action>) => void | no | Invoked to manage Actions to the current Adaptive Card instance. |
142
162
| onUpdateHostCapabilities | (hostCapabilities: HostCapabilities) => void | no | Invoked to manage the HostCapabilities object like add custom properties. |
143
163
| isUniqueControlInPage | boolean | no | Set to true if you want to use only one instance of this control per page, false for multiple controls. This affects how CSS variables are set. |
164
+
| context | BaseComponentContext | yes | Set the context from SPFx component. |
0 commit comments