@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client 9.9.3 → 9.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/CHANGELOG.md +16 -0
- package/dist/force-app/main/default/uiBundles/feature-react-agentforce-conversation-client/src/components/AgentforceConversationClient.tsx +5 -1
- package/dist/force-app/main/default/uiBundles/feature-react-agentforce-conversation-client/src/types/conversation.ts +9 -0
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +2 -2
- package/src/force-app/main/default/uiBundles/feature-react-agentforce-conversation-client/src/components/AgentforceConversationClient.tsx +5 -1
- package/src/force-app/main/default/uiBundles/feature-react-agentforce-conversation-client/src/types/conversation.ts +9 -0
package/README.md
CHANGED
|
@@ -50,6 +50,8 @@ export default function AppLayout() {
|
|
|
50
50
|
| `styleTokens` | `Record<string, string>` | No | Theme tokens for chat UI styling. Merged with package defaults. |
|
|
51
51
|
| `salesforceOrigin` | `string` | No | Salesforce org origin URL. Resolved automatically if not provided. |
|
|
52
52
|
| `frontdoorUrl` | `string` | No | Frontdoor URL for authentication. Resolved automatically in dev if not provided. |
|
|
53
|
+
| `onReady` | `AgentforceReadyHandler` | No | Callback invoked when Lightning Out is ready. Receives the event detail. |
|
|
54
|
+
| `onError` | `AgentforceErrorHandler` | No | Callback invoked on Lightning Out errors. Receives `{ type, detail }`. |
|
|
53
55
|
|
|
54
56
|
### Rendering Modes
|
|
55
57
|
|
|
@@ -114,6 +116,26 @@ Use `showHeaderIcon` to explicitly show or hide the icon in the header.
|
|
|
114
116
|
<AgentforceConversationClient agentId="0Xx000000000000AAA" showHeaderIcon={false} />
|
|
115
117
|
```
|
|
116
118
|
|
|
119
|
+
### Error and ready callbacks
|
|
120
|
+
|
|
121
|
+
Use `onReady` and `onError` to react programmatically to Lightning Out lifecycle events — for example, to show a loading spinner until the agent is ready, or to report errors to an observability service.
|
|
122
|
+
|
|
123
|
+
```tsx
|
|
124
|
+
<AgentforceConversationClient
|
|
125
|
+
agentId="0Xx000000000000AAA"
|
|
126
|
+
onReady={(detail) => {
|
|
127
|
+
console.log("Agent chat is ready", detail);
|
|
128
|
+
}}
|
|
129
|
+
onError={(error) => {
|
|
130
|
+
// error.type: "lo.application.error" | "lo.iframe.error"
|
|
131
|
+
// error.detail: the raw error payload from Lightning Out
|
|
132
|
+
reportError(error);
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Both callbacks are optional. When omitted, the SDK still logs errors and readiness to the console.
|
|
138
|
+
|
|
117
139
|
### Wrapper defaults and initialization behavior
|
|
118
140
|
|
|
119
141
|
This React wrapper applies a few defaults around the underlying SDK:
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.10.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v9.9.4...v9.10.0) (2026-05-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [9.9.4](https://github.com/salesforce-experience-platform-emu/webapps/compare/v9.9.3...v9.9.4) (2026-05-26)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [9.9.3](https://github.com/salesforce-experience-platform-emu/webapps/compare/v9.9.2...v9.9.3) (2026-05-25)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
@@ -64,6 +64,8 @@ export function AgentforceConversationClient({
|
|
|
64
64
|
styleTokens,
|
|
65
65
|
salesforceOrigin,
|
|
66
66
|
frontdoorUrl,
|
|
67
|
+
onReady,
|
|
68
|
+
onError,
|
|
67
69
|
}: AgentforceConversationClientProps) {
|
|
68
70
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
69
71
|
const normalizedAgentforceClientConfig = useMemo<AgentforceClientConfig>(() => {
|
|
@@ -121,6 +123,8 @@ export function AgentforceConversationClient({
|
|
|
121
123
|
salesforceOrigin: salesforceOrigin ?? options.salesforceOrigin,
|
|
122
124
|
frontdoorUrl: frontdoorUrl ?? options.frontdoorUrl,
|
|
123
125
|
agentforceClientConfig: normalizedAgentforceClientConfig,
|
|
126
|
+
onReady,
|
|
127
|
+
onError,
|
|
124
128
|
});
|
|
125
129
|
singleton.initialized = true;
|
|
126
130
|
} catch (err) {
|
|
@@ -175,7 +179,7 @@ export function AgentforceConversationClient({
|
|
|
175
179
|
// Intentionally no cleanup:
|
|
176
180
|
// This component guarantees a single LO initialization per window.
|
|
177
181
|
};
|
|
178
|
-
}, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline]);
|
|
182
|
+
}, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline, onReady, onError]);
|
|
179
183
|
|
|
180
184
|
if (!inline) {
|
|
181
185
|
return null;
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type {
|
|
8
|
+
AgentforceErrorHandler,
|
|
9
|
+
AgentforceReadyHandler,
|
|
10
|
+
} from "@salesforce/agentforce-conversation-client";
|
|
11
|
+
|
|
7
12
|
export interface ResolvedEmbedOptions {
|
|
8
13
|
salesforceOrigin?: string;
|
|
9
14
|
frontdoorUrl?: string;
|
|
@@ -32,4 +37,8 @@ export interface AgentforceConversationClientProps {
|
|
|
32
37
|
salesforceOrigin?: string;
|
|
33
38
|
/** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
|
|
34
39
|
frontdoorUrl?: string;
|
|
40
|
+
/** Callback invoked when the Lightning Out application is ready. */
|
|
41
|
+
onReady?: AgentforceReadyHandler;
|
|
42
|
+
/** Callback invoked when a Lightning Out error occurs. */
|
|
43
|
+
onError?: AgentforceErrorHandler;
|
|
35
44
|
}
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/webapp-template-base-sfdx-project-experimental",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.10.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/webapp-template-base-sfdx-project-experimental",
|
|
9
|
-
"version": "9.
|
|
9
|
+
"version": "9.10.0",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
11
11
|
"devDependencies": {
|
|
12
12
|
"@lwc/eslint-plugin-lwc": "^3.3.0",
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-bundle-template-feature-react-agentforce-conversation-client",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.10.0",
|
|
4
4
|
"description": "Embedded Agentforce conversation client feature for UI Bundles",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"clean": "rm -rf dist"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@salesforce/agentforce-conversation-client": "^9.
|
|
29
|
+
"@salesforce/agentforce-conversation-client": "^9.10.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "^19.2.7",
|
|
@@ -64,6 +64,8 @@ export function AgentforceConversationClient({
|
|
|
64
64
|
styleTokens,
|
|
65
65
|
salesforceOrigin,
|
|
66
66
|
frontdoorUrl,
|
|
67
|
+
onReady,
|
|
68
|
+
onError,
|
|
67
69
|
}: AgentforceConversationClientProps) {
|
|
68
70
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
69
71
|
const normalizedAgentforceClientConfig = useMemo<AgentforceClientConfig>(() => {
|
|
@@ -121,6 +123,8 @@ export function AgentforceConversationClient({
|
|
|
121
123
|
salesforceOrigin: salesforceOrigin ?? options.salesforceOrigin,
|
|
122
124
|
frontdoorUrl: frontdoorUrl ?? options.frontdoorUrl,
|
|
123
125
|
agentforceClientConfig: normalizedAgentforceClientConfig,
|
|
126
|
+
onReady,
|
|
127
|
+
onError,
|
|
124
128
|
});
|
|
125
129
|
singleton.initialized = true;
|
|
126
130
|
} catch (err) {
|
|
@@ -175,7 +179,7 @@ export function AgentforceConversationClient({
|
|
|
175
179
|
// Intentionally no cleanup:
|
|
176
180
|
// This component guarantees a single LO initialization per window.
|
|
177
181
|
};
|
|
178
|
-
}, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline]);
|
|
182
|
+
}, [salesforceOrigin, frontdoorUrl, normalizedAgentforceClientConfig, inline, onReady, onError]);
|
|
179
183
|
|
|
180
184
|
if (!inline) {
|
|
181
185
|
return null;
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type {
|
|
8
|
+
AgentforceErrorHandler,
|
|
9
|
+
AgentforceReadyHandler,
|
|
10
|
+
} from "@salesforce/agentforce-conversation-client";
|
|
11
|
+
|
|
7
12
|
export interface ResolvedEmbedOptions {
|
|
8
13
|
salesforceOrigin?: string;
|
|
9
14
|
frontdoorUrl?: string;
|
|
@@ -32,4 +37,8 @@ export interface AgentforceConversationClientProps {
|
|
|
32
37
|
salesforceOrigin?: string;
|
|
33
38
|
/** Optional. If not provided, resolved internally in dev via /__lo/frontdoor. */
|
|
34
39
|
frontdoorUrl?: string;
|
|
40
|
+
/** Callback invoked when the Lightning Out application is ready. */
|
|
41
|
+
onReady?: AgentforceReadyHandler;
|
|
42
|
+
/** Callback invoked when a Lightning Out error occurs. */
|
|
43
|
+
onError?: AgentforceErrorHandler;
|
|
35
44
|
}
|