@salesforce/ui-bundle-template-app-react-template-b2x 11.51.0 → 11.52.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 +8 -0
- package/dist/PRD.md +1 -1
- package/dist/force-app/main/default/uiBundles/reactexternalapp/package.json +4 -4
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/appLayout.tsx +7 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/components/CustomerWebClientChat.tsx +74 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/index.ts +6 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/pages/TestChatPage.tsx +26 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/routes.tsx +6 -0
- package/dist/force-app/main/default/uiBundles/reactexternalapp/src/types/chat.ts +36 -0
- package/dist/package-lock.json +2 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
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.52.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.51.0...v11.52.0) (2026-08-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [11.51.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v11.50.0...v11.51.0) (2026-08-07)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @salesforce/ui-bundle-template-base-sfdx-project
|
package/dist/PRD.md
CHANGED
|
@@ -10,7 +10,7 @@ Building a customer-facing portal on Salesforce usually means solving the hard p
|
|
|
10
10
|
|
|
11
11
|
## Solution
|
|
12
12
|
|
|
13
|
-
A minimal external-facing starter with everything already in place: the app framework, a full sign-in experience with protected private areas, the public site setup, and a single example feature — Account search — that shows how the app displays Salesforce data. The sign-in and site setup are done for you so teams can focus on the customer experience, and the Account example serves as a template for building their own features.
|
|
13
|
+
A minimal external-facing starter with everything already in place: the app framework, a full sign-in experience with protected private areas, a built-in Agentforce chat assistant, the public site setup, and a single example feature — Account search — that shows how the app displays Salesforce data. The sign-in and site setup are done for you so teams can focus on the customer experience, and the Account example serves as a template for building their own features.
|
|
14
14
|
|
|
15
15
|
### Core Features
|
|
16
16
|
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"graphql:schema": "node scripts/get-graphql-schema.mjs"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@salesforce/platform-sdk": "^11.
|
|
22
|
-
"@salesforce/ui-bundle": "^11.
|
|
21
|
+
"@salesforce/platform-sdk": "^11.52.0",
|
|
22
|
+
"@salesforce/ui-bundle": "^11.52.0",
|
|
23
23
|
"@tailwindcss/vite": "^4.1.17",
|
|
24
24
|
"class-variance-authority": "^0.7.1",
|
|
25
25
|
"clsx": "^2.1.1",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"@graphql-eslint/eslint-plugin": "^4.1.0",
|
|
47
47
|
"@graphql-tools/utils": "^11.0.0",
|
|
48
48
|
"@playwright/test": "^1.49.0",
|
|
49
|
-
"@salesforce/graphiti": "^11.
|
|
50
|
-
"@salesforce/vite-plugin-ui-bundle": "^11.
|
|
49
|
+
"@salesforce/graphiti": "^11.52.0",
|
|
50
|
+
"@salesforce/vite-plugin-ui-bundle": "^11.52.0",
|
|
51
51
|
"@testing-library/jest-dom": "^6.6.3",
|
|
52
52
|
"@testing-library/react": "^16.1.0",
|
|
53
53
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -3,6 +3,7 @@ import { getAllRoutes } from "./router-utils";
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { AuthMenu } from "./features/authentication/menu/AuthMenu";
|
|
5
5
|
import { Button } from "./components/ui/button";
|
|
6
|
+
import CustomerWebClientChat from "./components/CustomerWebClientChat";
|
|
6
7
|
|
|
7
8
|
export default function AppLayout() {
|
|
8
9
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -83,6 +84,12 @@ export default function AppLayout() {
|
|
|
83
84
|
</div>
|
|
84
85
|
</nav>
|
|
85
86
|
<Outlet />
|
|
87
|
+
<CustomerWebClientChat
|
|
88
|
+
orgId="<ORG_ID_15_OR_18_CHAR_00D...>"
|
|
89
|
+
deploymentName="<EMBEDDED_SERVICE_DEPLOYMENT_NAME>"
|
|
90
|
+
siteURL="<SITE_URL>"
|
|
91
|
+
scrt2URL="<SCRT2_URL>"
|
|
92
|
+
/>
|
|
86
93
|
</>
|
|
87
94
|
);
|
|
88
95
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { useEffect } from "react";
|
|
8
|
+
import type { CustomerWebClientChatProps, WindowWithCwcProperties } from "../types/chat";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* React wrapper that embeds the Customer Web Client (Embedded Messaging) chat
|
|
12
|
+
* widget into an external site. It dynamically loads the site's
|
|
13
|
+
* `embeddedservice_bootstrap` script and calls `init` with the org, deployment,
|
|
14
|
+
* site, and SCRT2 configuration. Renders nothing itself — the chat UI is a
|
|
15
|
+
* floating widget injected by the bootstrap script.
|
|
16
|
+
*/
|
|
17
|
+
export function CustomerWebClientChat({
|
|
18
|
+
orgId,
|
|
19
|
+
deploymentName,
|
|
20
|
+
siteURL,
|
|
21
|
+
scrt2URL,
|
|
22
|
+
language = "en",
|
|
23
|
+
devMode = false,
|
|
24
|
+
}: CustomerWebClientChatProps) {
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (typeof window === "undefined") return;
|
|
27
|
+
if (
|
|
28
|
+
!orgId ||
|
|
29
|
+
!deploymentName ||
|
|
30
|
+
!siteURL ||
|
|
31
|
+
!scrt2URL ||
|
|
32
|
+
!(orgId.length === 15 || orgId.length === 18)
|
|
33
|
+
) {
|
|
34
|
+
console.warn("[CustomerWebClientChat] missing required config; skipping init");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const win = window as WindowWithCwcProperties;
|
|
39
|
+
const bootstrapSrc = `${siteURL}/assets/js/bootstrap.js`;
|
|
40
|
+
const existing = document.querySelector<HTMLScriptElement>(`script[src="${bootstrapSrc}"]`);
|
|
41
|
+
const script: HTMLScriptElement = existing ?? document.createElement("script");
|
|
42
|
+
|
|
43
|
+
const init = () => {
|
|
44
|
+
try {
|
|
45
|
+
if (!win.embeddedservice_bootstrap) return;
|
|
46
|
+
win.embeddedservice_bootstrap.settings.language = language;
|
|
47
|
+
if (devMode) win.embeddedservice_bootstrap.settings.devMode = true;
|
|
48
|
+
win.embeddedservice_bootstrap.init(orgId, deploymentName, siteURL, {
|
|
49
|
+
scrt2URL,
|
|
50
|
+
});
|
|
51
|
+
} catch (err) {
|
|
52
|
+
console.error("Error loading Embedded Messaging: ", err);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (existing) {
|
|
57
|
+
if (win.embeddedservice_bootstrap) init();
|
|
58
|
+
else existing.addEventListener("load", init, { once: true });
|
|
59
|
+
} else {
|
|
60
|
+
script.type = "text/javascript";
|
|
61
|
+
script.src = bootstrapSrc;
|
|
62
|
+
script.addEventListener("load", init, { once: true });
|
|
63
|
+
document.body.appendChild(script);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return () => {
|
|
67
|
+
script.removeEventListener("load", init);
|
|
68
|
+
};
|
|
69
|
+
}, [orgId, deploymentName, siteURL, scrt2URL, language, devMode]);
|
|
70
|
+
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export default CustomerWebClientChat;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import CustomerWebClientChat from "../components/CustomerWebClientChat";
|
|
8
|
+
|
|
9
|
+
export default function TestChatPage() {
|
|
10
|
+
return (
|
|
11
|
+
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
|
|
12
|
+
<div className="text-center">
|
|
13
|
+
<h1 className="text-4xl font-bold text-gray-900 mb-4">Chat</h1>
|
|
14
|
+
<p className="text-lg text-gray-600 mb-8">
|
|
15
|
+
Welcome to your Customer Web Client chat application.
|
|
16
|
+
</p>
|
|
17
|
+
</div>
|
|
18
|
+
<CustomerWebClientChat
|
|
19
|
+
orgId="<ORG_ID_15_OR_18_CHAR_00D...>"
|
|
20
|
+
deploymentName="<EMBEDDED_SERVICE_DEPLOYMENT_NAME>"
|
|
21
|
+
siteURL="<SITE_URL>"
|
|
22
|
+
scrt2URL="<SCRT2_URL>"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -9,6 +9,7 @@ import Profile from "./features/authentication/pages/Profile";
|
|
|
9
9
|
import ChangePassword from "./features/authentication/pages/ChangePassword";
|
|
10
10
|
import PrivateRoute from "./features/authentication/layouts/privateRouteLayout";
|
|
11
11
|
import { ROUTES } from "./features/authentication/authenticationConfig";
|
|
12
|
+
import TestChatPage from "./pages/TestChatPage";
|
|
12
13
|
import AuthAppLayout from "./features/authentication/layouts/AuthAppLayout";
|
|
13
14
|
import AccountSearch from "./pages/AccountSearch";
|
|
14
15
|
import AccountObjectDetail from "./pages/AccountObjectDetailPage";
|
|
@@ -58,6 +59,11 @@ export const routes: RouteObject[] = [
|
|
|
58
59
|
}
|
|
59
60
|
]
|
|
60
61
|
},
|
|
62
|
+
{
|
|
63
|
+
path: "test-chat",
|
|
64
|
+
element: <TestChatPage />,
|
|
65
|
+
handle: { showInNavigation: true, label: "Test Chat" }
|
|
66
|
+
},
|
|
61
67
|
{
|
|
62
68
|
path: "accounts/:recordId",
|
|
63
69
|
element: <AccountObjectDetail />
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/** Shape of the Embedded Messaging bootstrap global injected by the site's bootstrap.js. */
|
|
8
|
+
export interface WindowWithCwcProperties extends Window {
|
|
9
|
+
embeddedservice_bootstrap?: {
|
|
10
|
+
settings: {
|
|
11
|
+
language: string;
|
|
12
|
+
devMode?: boolean;
|
|
13
|
+
};
|
|
14
|
+
init: (
|
|
15
|
+
orgId: string,
|
|
16
|
+
deploymentName: string,
|
|
17
|
+
siteURL: string,
|
|
18
|
+
options: { scrt2URL: string },
|
|
19
|
+
) => void;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface CustomerWebClientChatProps {
|
|
24
|
+
/** The organization id (15- or 18-char Salesforce id starting with `00D`). */
|
|
25
|
+
orgId: string;
|
|
26
|
+
/** The Embedded Service deployment / channel name the agent is connected to. */
|
|
27
|
+
deploymentName: string;
|
|
28
|
+
/** The ESW site URL. Usually contains `ESW` and the deployment name. */
|
|
29
|
+
siteURL: string;
|
|
30
|
+
/** The SCRT2 (Service Cloud Real-Time) chat service URL. Usually contains `scrt`. */
|
|
31
|
+
scrt2URL: string;
|
|
32
|
+
/** Optional chat language. Defaults to `"en"`. */
|
|
33
|
+
language?: string;
|
|
34
|
+
/** Optional. Enables Embedded Messaging dev mode. Defaults to `false`. */
|
|
35
|
+
devMode?: boolean;
|
|
36
|
+
}
|
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.52.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.52.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