afv-library/skills/implementing-webapplication-agentforce-conversation-client/references/examples.md

133 lines
2.6 KiB
Markdown
Raw Normal View History

feat: syncing webapp skills sync to afv @W-21338965@ (#57) * feat: removing old webapp skills * feat: adding sync of skills from webapps to afv * feat: adding the first iteration of skills * feat: pin template deps to latest npm versions and flatten skill folders - Add pin-template-deps.js to resolve "*" deps to exact npm versions - Integrate pinning into sync-template-skills npm script - Remove check-template-skills-versions.js (no longer needed) - Simplify workflow to single sync step - Flatten skill output: one folder per skill with cleaned names Made-with: Cursor * fix: resolve skill validation errors - Move .template-versions.json from skills/ to root - Shorten skill names to meet 64-char limit: - salesforce-webapp-feature-micro-frontend-generating-micro-frontend-lwc → salesforce-webapp-micro-frontend-lwc - salesforce-webapp-feature-react-agentforce-conversation-client-integrating-agentforce-conversation-client → salesforce-webapp-agentforce-conversation-client - salesforce-webapp-feature-react-file-upload-implementing-file-upload → salesforce-webapp-react-file-upload - Expand descriptions to meet 20-word minimum with trigger context * Add webapp skills from template, sync script updates - Rename skill folders from salesforce-webapp-* to *-webapp-* convention - Update sync-template-skills.js: set SKILL.md front matter name to dest folder - Remove sync-template-skills workflow and pin-template-deps script - Add .synced-template-skills.json manifest, deploying-webapp-to-salesforce skill - Replace salesforce-webapp-designing-webapp-ui-ux with designing-webapp-ui-ux Made-with: Cursor * Align SKILL.md front matter name with folder for all webapp skills Made-with: Cursor * Fix skill validation: description length and trigger context for configuring-webapp-metadata, creating-webapp Made-with: Cursor * Rename sync script to sync-webapp-skills, drop manifest file - Rename sync-template-skills.js to sync-webapp-skills.js - Update package.json script to sync-webapp-skills - Remove .synced-template-skills.json creation and add to .gitignore Made-with: Cursor * Revert sync-react-b2e-sample and sync-react-b2x-sample to upstream version Made-with: Cursor * Sync script: pin b2e and b2x to latest, sync skills from template - Pin both template packages to latest in sync-webapp-skills.js - Update package.json / package-lock.json (b2x 1.109.0) - Sync skills: managing-webapp-agentforce-conversation-client, bar-line-chart, remove building-webapp-analytics-charts and integrating-webapp-agentforce-conversation-client - Minor skill content updates Made-with: Cursor * Remove interactive map, weather widget, and Unsplash skills (no longer in template) Made-with: Cursor --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-20 01:16:27 +08:00
# Additional Examples
Essential examples for common patterns and combinations. All use flat props API.
---
## Layout Patterns
### Sidebar Chat
```tsx
export default function DashboardWithChat() {
return (
<div style={{ display: "flex", height: "100vh" }}>
<main style={{ flex: 1 }}>{/* Main content */}</main>
<aside style={{ width: 400 }}>
<AgentforceConversationClient agentId="0Xx..." inline width="100%" height="100%" />
</aside>
</div>
);
}
```
### Full Page Chat
```tsx
export default function SupportPage() {
return (
<div>
<h1>Customer Support</h1>
<AgentforceConversationClient agentId="0Xx..." inline width="100%" height="600px" />
</div>
);
}
```
---
## Size Variations
### Responsive sizing
```tsx
<AgentforceConversationClient agentId="0Xx..." inline width="100%" height="80vh" />
```
### Calculated dimensions
```tsx
<AgentforceConversationClient agentId="0Xx..." inline width="500px" height="calc(100vh - 100px)" />
```
---
## Theming Combinations
### Brand theme with custom sizing
```tsx
<AgentforceConversationClient
agentId="0Xx..."
inline
width="500px"
height="700px"
styleTokens={{
headerBlockBackground: "#0176d3",
headerBlockTextColor: "#ffffff",
messageBlockInboundBackgroundColor: "#0176d3",
messageBlockInboundTextColor: "#ffffff",
messageInputFooterSendButton: "#0176d3",
}}
/>
```
### Dark theme
```tsx
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "#1a1a1a",
headerBlockTextColor: "#ffffff",
messageBlockInboundBackgroundColor: "#2d2d2d",
messageBlockInboundTextColor: "#ffffff",
messageBlockOutboundBackgroundColor: "#3a3a3a",
messageBlockOutboundTextColor: "#f0f0f0",
}}
/>
```
### Inline without header
```tsx
<AgentforceConversationClient
agentId="0Xx..."
inline
width="100%"
height="600px"
headerEnabled={false}
styleTokens={{
messageBlockBorderRadius: "12px",
}}
/>
```
---
## Complete Host Component Example
```tsx
import { Outlet } from "react-router";
import { AgentforceConversationClient } from "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental";
export default function AgentChatHost() {
return (
<>
<Outlet />
<AgentforceConversationClient
agentId="0Xx..."
styleTokens={{
headerBlockBackground: "#0176d3",
headerBlockTextColor: "#ffffff",
}}
/>
</>
);
}
```
---
For complete style token reference, see `references/style-tokens.md` or `node_modules/@salesforce/agentforce-conversation-client/README.md`.