@salesforce/ui-bundle-template-app-angular-template-b2e 11.50.0 → 11.51.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/dist/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [11.51.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.50.0...v11.51.0) (2026-08-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [11.50.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.49.4...v11.50.0) (2026-08-07)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
embedAgentforceClient,
|
|
9
9
|
type AgentforceClientConfig,
|
|
10
10
|
} from "@salesforce/agentforce-conversation-client";
|
|
11
|
+
import { createAccEmbedder } from "@salesforce/agentforce-conversation-client/ui-bundle";
|
|
11
12
|
import type {
|
|
12
13
|
AgentforceErrorHandler,
|
|
13
14
|
AgentforceReadyHandler,
|
|
@@ -20,30 +21,27 @@ export interface AgentforceEmbedHandlers {
|
|
|
20
21
|
onError?: AgentforceErrorHandler;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
const GLOBAL_HOST_ID = "agentforce-conversation-client-global-host";
|
|
24
|
-
const EXISTING_EMBED_SELECTOR = 'lightning-out-application[data-lo="acc"]';
|
|
25
|
-
|
|
26
24
|
/**
|
|
27
25
|
* App-wide singleton that owns the one-time Lightning Out embed of the
|
|
28
|
-
* Agentforce Conversation Client.
|
|
29
|
-
*
|
|
30
|
-
* `
|
|
31
|
-
*
|
|
32
|
-
*
|
|
26
|
+
* Agentforce Conversation Client. Because the service is `providedIn: 'root'`,
|
|
27
|
+
* a single instance is shared across the app; it delegates to the shared,
|
|
28
|
+
* framework-agnostic `@salesforce/agentforce-conversation-client/ui-bundle`
|
|
29
|
+
* embedder, which owns the embed
|
|
30
|
+
* orchestration (window singleton, global host, dev frontdoor fetch, `SFDC_ENV`
|
|
31
|
+
* default, and partial-embed cleanup) that used to be duplicated here and in the
|
|
32
|
+
* React feature.
|
|
33
33
|
*
|
|
34
|
-
* A valid Salesforce session is required for the given org
|
|
35
|
-
*
|
|
36
|
-
* prod). Config is passed through to the embed client as-is.
|
|
34
|
+
* A valid Salesforce session is required for the given org. Config is passed
|
|
35
|
+
* through to the embed client as-is.
|
|
37
36
|
*/
|
|
38
37
|
@Injectable({ providedIn: "root" })
|
|
39
38
|
export class AgentforceEmbedService {
|
|
40
|
-
private
|
|
41
|
-
private initPromise?: Promise<void>;
|
|
39
|
+
private readonly embedder = createAccEmbedder<AgentforceClientConfig>(embedAgentforceClient);
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
42
|
* Embed the client once. Subsequent calls are no-ops while an embed is in
|
|
45
43
|
* flight or already complete. `host` is the inline container element (when
|
|
46
|
-
* rendering inline); when omitted the
|
|
44
|
+
* rendering inline); when omitted the shared floating host is used.
|
|
47
45
|
*/
|
|
48
46
|
embed(
|
|
49
47
|
config: AgentforceClientConfig,
|
|
@@ -51,132 +49,6 @@ export class AgentforceEmbedService {
|
|
|
51
49
|
host?: HTMLElement | null,
|
|
52
50
|
handlers?: AgentforceEmbedHandlers,
|
|
53
51
|
): void {
|
|
54
|
-
|
|
55
|
-
throw new Error(
|
|
56
|
-
"AgentforceConversationClient requires agentId. " +
|
|
57
|
-
"Pass flat inputs only (agentId, agentLabel, inline, headerEnabled, showHeaderIcon, width, height, styleTokens).",
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const inline = config.renderingConfig?.mode === "inline";
|
|
62
|
-
if (inline && !host) {
|
|
63
|
-
// Inline host not yet in the DOM — the component retries after render.
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (this.initialized || this.initPromise) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const shouldFetchFrontdoor = window.location.hostname === "localhost";
|
|
72
|
-
|
|
73
|
-
if (shouldFetchFrontdoor) {
|
|
74
|
-
this.initPromise = fetch("/__lo/frontdoor")
|
|
75
|
-
.then(async (res) => {
|
|
76
|
-
if (!res.ok) {
|
|
77
|
-
console.error("frontdoor fetch failed");
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const { frontdoorUrl: resolvedFrontdoorUrl } = await res.json();
|
|
81
|
-
this.safeInitialize(
|
|
82
|
-
config,
|
|
83
|
-
{ ...overrides, frontdoorUrl: resolvedFrontdoorUrl },
|
|
84
|
-
host,
|
|
85
|
-
handlers,
|
|
86
|
-
);
|
|
87
|
-
})
|
|
88
|
-
.catch((err) => {
|
|
89
|
-
console.error("AgentforceConversationClient: failed to fetch frontdoor URL", err);
|
|
90
|
-
})
|
|
91
|
-
.finally(() => {
|
|
92
|
-
this.initPromise = undefined;
|
|
93
|
-
});
|
|
94
|
-
} else {
|
|
95
|
-
this.initPromise = Promise.resolve()
|
|
96
|
-
.then(() => {
|
|
97
|
-
this.safeInitialize(
|
|
98
|
-
config,
|
|
99
|
-
{ ...this.getDefaultEmbedOptions(), ...this.stripUndefined(overrides) },
|
|
100
|
-
host,
|
|
101
|
-
handlers,
|
|
102
|
-
);
|
|
103
|
-
})
|
|
104
|
-
.catch((err) => {
|
|
105
|
-
console.error("AgentforceConversationClient: failed to embed Agentforce client", err);
|
|
106
|
-
})
|
|
107
|
-
.finally(() => {
|
|
108
|
-
this.initPromise = undefined;
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
private safeInitialize(
|
|
114
|
-
config: AgentforceClientConfig,
|
|
115
|
-
options: ResolvedEmbedOptions,
|
|
116
|
-
host?: HTMLElement | null,
|
|
117
|
-
handlers?: AgentforceEmbedHandlers,
|
|
118
|
-
): void {
|
|
119
|
-
try {
|
|
120
|
-
this.initialize(config, options, host, handlers);
|
|
121
|
-
} catch (initErr) {
|
|
122
|
-
console.error("AgentforceConversationClient: initialization failed", initErr);
|
|
123
|
-
this.initialized = false;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
private initialize(
|
|
128
|
-
config: AgentforceClientConfig,
|
|
129
|
-
options: ResolvedEmbedOptions,
|
|
130
|
-
host?: HTMLElement | null,
|
|
131
|
-
handlers?: AgentforceEmbedHandlers,
|
|
132
|
-
): void {
|
|
133
|
-
if (this.initialized) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const existingEmbed = document.querySelector(EXISTING_EMBED_SELECTOR);
|
|
138
|
-
if (existingEmbed) {
|
|
139
|
-
this.initialized = true;
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
const inline = config.renderingConfig?.mode === "inline";
|
|
144
|
-
const container = inline ? host! : this.getOrCreateGlobalHost();
|
|
145
|
-
|
|
146
|
-
try {
|
|
147
|
-
embedAgentforceClient({
|
|
148
|
-
container,
|
|
149
|
-
salesforceOrigin: options.salesforceOrigin,
|
|
150
|
-
frontdoorUrl: options.frontdoorUrl,
|
|
151
|
-
agentforceClientConfig: config,
|
|
152
|
-
onReady: handlers?.onReady,
|
|
153
|
-
onError: handlers?.onError,
|
|
154
|
-
});
|
|
155
|
-
this.initialized = true;
|
|
156
|
-
} catch (err) {
|
|
157
|
-
// Strip a partially-created LO element so the next mount can retry.
|
|
158
|
-
const partialEmbed = document.querySelector(EXISTING_EMBED_SELECTOR);
|
|
159
|
-
partialEmbed?.remove();
|
|
160
|
-
console.error("AgentforceConversationClient: initialization failed", err);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
private getOrCreateGlobalHost(): HTMLDivElement {
|
|
165
|
-
let host = document.getElementById(GLOBAL_HOST_ID) as HTMLDivElement | null;
|
|
166
|
-
if (!host) {
|
|
167
|
-
host = document.createElement("div");
|
|
168
|
-
host.id = GLOBAL_HOST_ID;
|
|
169
|
-
document.body.appendChild(host);
|
|
170
|
-
}
|
|
171
|
-
return host;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
private getDefaultEmbedOptions(): ResolvedEmbedOptions {
|
|
175
|
-
return { salesforceOrigin: SFDC_ENV?.orgUrl };
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/** Remove keys with undefined/null values so they don't override defaults when spread. */
|
|
179
|
-
private stripUndefined(opts: ResolvedEmbedOptions): ResolvedEmbedOptions {
|
|
180
|
-
return Object.fromEntries(Object.entries(opts).filter(([, v]) => v != null));
|
|
52
|
+
this.embedder.embedAcc(config, overrides, host, handlers);
|
|
181
53
|
}
|
|
182
54
|
}
|
package/dist/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/ui-bundle-template-base-sfdx-project",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.51.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@salesforce/ui-bundle-template-base-sfdx-project",
|
|
9
|
-
"version": "11.
|
|
9
|
+
"version": "11.51.0",
|
|
10
10
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"fast-xml-parser": "^5.9.3",
|
package/dist/package.json
CHANGED