Skip to content

Commit df65f07

Browse files
committed
Fix context & isUniqueControlInPage properties
1 parent ce75762 commit df65f07

File tree

11 files changed

+1314
-1226
lines changed

11 files changed

+1314
-1226
lines changed

docs/documentation/docs/controls/AdaptiveCardHost.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Here is an example of the previous Web Part (using different Card), hosted as a
3939
- In your component file, import the `AdaptiveCardHost` control as follows:
4040

4141
```TypeScript
42-
import { AdaptiveCardHost, IAdaptiveCardHostActionResult, AdaptiveCardHostThemeType } from "@pnp/spfx-controls-react/lib/AdaptiveCardHost";
42+
import { AdaptiveCardHost, IAdaptiveCardHostActionResult, AdaptiveCardHostThemeType, Action, CardElement, CardObjectRegistry, HostCapabilities } from "@pnp/spfx-controls-react/lib/AdaptiveCardHost";
4343
```
4444

4545
- Example on use the `AdaptiveCardHost` control with only required properties:
@@ -75,7 +75,6 @@ import { AdaptiveCardHost, IAdaptiveCardHostActionResult, AdaptiveCardHostThemeT
7575
onUpdateHostCapabilities={(hostCapabilities: HostCapabilities) => {
7676
hostCapabilities.setCustomProperty("CustomPropertyName", Date.now);
7777
}}
78-
isUniqueControlInPage={true}
7978
context={this.props.context}
8079
/>
8180
```
@@ -151,16 +150,15 @@ The `AdaptiveCardHost` control can be configured with the following properties:
151150
| data | { "$root": object } | no | Set Data Source for template rendering. |
152151
| style | React.CSSProperties | no | Set CSS Style. |
153152
| className | string | no | Set CSS Class. |
154-
| theme | IPartialTheme or ITheme | no | Set Fluent UI Theme. Used only if the "themeType" property is set to 'ThemeType.SharePoint'. If not set or set to null or not defined, the theme passed through context will be searched, or the default theme of the page will be loaded. |
153+
| theme | IPartialTheme or ITheme | no | Set Fluent UI Theme. Used only if the "themeType" property is set to 'ThemeType.SharePoint'. If not set or set to null or not defined, the theme passed through context will be searched, or the default theme of the page will be loaded. However, the Theme object will be automatically injected into the data object, so that it can be used by the Adaptive Cards binding engine. |
155154
| themeType | ThemeType | no | Select the Type of Theme you want to use. If it is not set or set to null or undefined, the 'ThemeType.SharePoint' value will be used and the "theme" property or the theme passed through the context or default page will be loaded. In other cases, the chosen Microsoft Teams theme will be applied. |
156155
| hostConfig | object | no | Set custom HostConfig. |
157156
| onInvokeAction | (action: IAdaptiveCardActionResult) => void | yes | Invoked every time an Action is performed. |
158157
| onError | (error: Error) => void | yes | Invoked every time an exception occurs in the rendering phase. |
159158
| onSetCustomElements | (registry: CardObjectRegistry<CardElement>) => void | no | Invoked to manage Elements to the current Adaptive Card instance. |
160159
| onSetCustomActions | (registry: CardObjectRegistry<Action>) => void | no | Invoked to manage Actions to the current Adaptive Card instance. |
161160
| onUpdateHostCapabilities | (hostCapabilities: HostCapabilities) => void | no | Invoked to manage the HostCapabilities object like add custom properties. |
162-
| 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. |
163-
| context | BaseComponentContext | yes | Set the context from SPFx component. |
161+
| context | BaseComponentContext | yes | Set the context from the SPFx component. If set, some context properties will be automatically injected into the data object, so they can be used by the Adaptive Cards binding engine. |
164162

165163
Interface `IAdaptiveCardHostActionResult`
166164

package-lock.json

Lines changed: 110 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
"react-mentions": "^4.3.0",
5858
"react-quill": "1.3.5",
5959
"regexify-string": "^1.0.16",
60-
"spfx-uifabric-themes": "^0.8.5"
60+
"spfx-uifabric-themes": "^0.8.5",
61+
"nano-css": "^5.3.4"
6162
},
6263
"devDependencies": {
6364
"@microsoft/microsoft-graph-types": "^2.1.0",

src/controls/adaptiveCardHost/AdaptiveCardHost.css

Lines changed: 0 additions & 142 deletions
This file was deleted.

0 commit comments

Comments
 (0)