@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental 1.75.1 → 1.76.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.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: webapp-add-react-component
3
+ description: Creates React components, pages, headers, and footers using shadcn UI and Tailwind CSS. Use when the user asks to create a component, add a widget, build a UI element, add a page, create a new page, add a section (e.g. "add a contacts page"), add a header, add a footer, add a navigation bar, or add anything to the web application.
4
+ ---
5
+
6
+ # Add React Component
7
+
8
+ ## Step 1 — Identify the type of component
9
+
10
+ Determine which of these three categories the request falls into, then follow the corresponding section below:
11
+
12
+ - **Page** — user wants a new routed page (e.g. "add a contacts page", "create a dashboard page", "add a settings section")
13
+ - **Header / Footer** — user wants a site-wide header, footer, nav bar, or page footer that appears on every page
14
+ - **Component** — everything else: a widget, card, table, form, dialog, or other UI element placed within an existing page
15
+
16
+ If it is not immediately clear from the user's message, ask:
17
+
18
+ > "Are you looking to add a new page, a site-wide header or footer, or a component within an existing page?"
19
+
20
+ Then follow the matching section.
21
+
22
+ ---
23
+
24
+ ## Clarifying Questions
25
+
26
+ Ask **one question at a time** and wait for the response before asking the next. Stop when you have enough to build accurately — do not guess or assume.
27
+
28
+ ### For a Page
29
+
30
+ 1. **What is the name and purpose of the page?** (e.g., Contacts, Dashboard, Settings)
31
+ 2. **What URL path should it use?** (e.g., `/contacts`, `/dashboard`) — or derive from the page name?
32
+ 3. **Should the page appear in the navigation menu?**
33
+ 4. **Who can access it?** Public, authenticated users only (`PrivateRoute`), or unauthenticated only (e.g., login — `AuthenticationRoute`)?
34
+ 5. **What content or sections should the page include?** (list, form, table, detail view, etc.)
35
+ 6. **Does it need to fetch any data?** If so, from where?
36
+
37
+ ### For a Header / Footer
38
+
39
+ 1. **Header, footer, or both?**
40
+ 2. **What should the header contain?** (logo/app name, nav links, user avatar, CTA button, etc.)
41
+ 3. **What should the footer contain?** (copyright text, links, social icons, etc.)
42
+ 4. **Should the header be sticky (fixed to top while scrolling)?**
43
+ 5. **Is there a logo or brand name to display?** (or placeholder?)
44
+ 6. **Any specific color scheme or style direction?** (dark background, branded primary color, minimal, etc.)
45
+ 7. **Should navigation links appear in the header?** If so, which pages?
46
+
47
+ ### For a Component
48
+
49
+ 1. **What should the component do?** (display data, accept input, trigger an action, etc.)
50
+ 2. **What page or location should it appear on?**
51
+ 3. **Is this shared/reusable across pages, or specific to one feature?** (determines file location)
52
+ 4. **What data or props does it need?** (static content, props, fetched data)
53
+ 5. **Does it need internal state?** (loading, toggle, form state, etc.)
54
+ 6. **Are there any specific shadcn components to use?** (Card, Table, Dialog, Form, etc.)
55
+ 7. **Should it appear in a specific layout position?** (full-width, sidebar, inline, etc.)
56
+
57
+ ---
58
+
59
+ ## Implementation
60
+
61
+ Once you have identified the type and gathered answers to the clarifying questions, read and follow the corresponding implementation guide:
62
+
63
+ - **Page** — read `implementation/page.md` and follow the instructions there.
64
+ - **Header / Footer** — read `implementation/header-footer.md` and follow the instructions there.
65
+ - **Component** — read `implementation/component.md` and follow the instructions there.
66
+
67
+ ---
68
+
69
+ ## Verification
70
+
71
+ Before completing, run from the web app directory `force-app/main/default/webapplications/<appName>/` (use the actual app folder name):
72
+
73
+ ```bash
74
+ cd force-app/main/default/webapplications/<appName> && npm run lint && npm run build
75
+ ```
76
+
77
+ - **Lint:** MUST result in 0 errors. Fix any ESLint or TypeScript issues.
78
+ - **Build:** MUST succeed. Resolve any compilation or Vite build failures before finishing.
@@ -0,0 +1,78 @@
1
+ # Implementation — Component
2
+
3
+ ### Rules
4
+
5
+ 1. **Always use shadcn components** from `@/components/ui` — never build raw HTML equivalents for buttons, inputs, cards, alerts, tabs, tables, or labels.
6
+ 2. **All styling via Tailwind** — utility classes only. No inline `style={{}}`, CSS Modules, or other styling systems.
7
+ 3. **Use design tokens** — prefer `bg-background`, `text-foreground`, `text-muted-foreground`, `border`, `bg-primary`, `text-destructive`, `rounded-lg` over hardcoded colors.
8
+ 4. **Use `cn()`** from `@/lib/utils` for conditional or composable class names.
9
+ 5. **TypeScript** — functional components with typed props interface; always accept `className?: string`.
10
+
11
+ ### File Location — Component
12
+
13
+ | Component type | Location | Export |
14
+ | ---------------------------------------------- | ---------------------------------------- | ---------------------------------------- |
15
+ | Shared UI primitive (reusable across features) | `src/components/ui/` — add to `index.ts` | Named export |
16
+ | Feature-specific (e.g., dashboard widget) | `src/components/<feature>/` | Named export, import directly where used |
17
+ | Page-level layout element | `src/components/layout/` | Named export |
18
+
19
+ ### Component Structure
20
+
21
+ ```tsx
22
+ import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui";
23
+ import { cn } from "@/lib/utils";
24
+
25
+ interface MyComponentProps {
26
+ title: string;
27
+ value: string;
28
+ className?: string;
29
+ }
30
+
31
+ export function MyComponent({ title, value, className }: MyComponentProps) {
32
+ return (
33
+ <Card className={cn("border", className)}>
34
+ <CardHeader>
35
+ <CardTitle className="text-sm font-medium">{title}</CardTitle>
36
+ </CardHeader>
37
+ <CardContent>
38
+ <p className="text-2xl font-semibold text-foreground">{value}</p>
39
+ </CardContent>
40
+ </Card>
41
+ );
42
+ }
43
+ ```
44
+
45
+ ### State and Hooks
46
+
47
+ - **Local state only:** keep `useState`, `useReducer`, `useRef` inside the component.
48
+ - **Shared or complex state:** extract to a custom hook in `src/hooks/` (prefix with `use`, e.g. `useFormData`). Do this when more than one component needs the state, or when multiple hooks are composed together.
49
+
50
+ ### Adding the Component to a Page
51
+
52
+ ```tsx
53
+ // In the target page file, e.g. src/pages/HomePage.tsx
54
+ import { MyComponent } from "@/components/<feature>/MyComponent";
55
+
56
+ export default function HomePage() {
57
+ return (
58
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
59
+ <MyComponent title="Status" value="Active" />
60
+ </div>
61
+ );
62
+ }
63
+ ```
64
+
65
+ ### Useful Patterns — Component
66
+
67
+ - **Programmatic navigation:** use `useNavigate` from `react-router`; call `navigate(path)` — consistent with GlobalSearchInput, SearchResultCard, MaintenanceTable, and other components in the web application.
68
+ - **Page container:** `max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12`
69
+ - **Icons:** `lucide-react`; add `aria-hidden="true"` on decorative icons
70
+ - **Focus styles:** use `focus-visible:` variants
71
+ - **Multiple visual variants:** use CVA (`cva`) and `VariantProps`
72
+ - **shadcn import barrel:** `import { Button, Card, Input } from "@/components/ui"`
73
+
74
+ ### Confirm — Component
75
+
76
+ - Imports use path aliases (`@/`, not deep relative paths)
77
+ - No raw `<button>`, `<input>`, or styled `<div>` where shadcn equivalents exist
78
+ - No inline `style={{}}` — Tailwind only
@@ -0,0 +1,124 @@
1
+ # Implementation — Header / Footer
2
+
3
+ ### Rules
4
+
5
+ 1. **Edit `appLayout.tsx` only** — header and footer are layout-level concerns. Never add them to individual page files.
6
+ 2. **Never modify `routes.tsx` or `app.tsx`** — the router setup must remain intact.
7
+ 3. **Create component files in `src/components/layout/`** — the designated location for layout-level components.
8
+ 4. **Use the full-height flex column pattern** — wrap layout in `min-h-screen flex flex-col` so footer stays at bottom.
9
+ 5. **Use shadcn and Tailwind** — compose from `@/components/ui`; style with Tailwind utility classes and design tokens.
10
+ 6. **Use path aliases** — import with `@/components/layout/...` and `@/components/ui`; no deep relative paths.
11
+ 7. **Preserve existing content** — if `appLayout.tsx` already has a `<NavigationMenu />` or other shell elements, keep them in place.
12
+
13
+ ### Step 1 — Create the header component (if requested)
14
+
15
+ Create `src/components/layout/AppHeader.tsx`:
16
+
17
+ ```tsx
18
+ import { cn } from "@/lib/utils";
19
+
20
+ interface AppHeaderProps {
21
+ className?: string;
22
+ }
23
+
24
+ export function AppHeader({ className }: AppHeaderProps) {
25
+ return (
26
+ <header
27
+ className={cn(
28
+ "w-full border-b bg-background px-4 sm:px-6 lg:px-8 py-4",
29
+ className,
30
+ )}
31
+ >
32
+ <div className="max-w-7xl mx-auto flex items-center justify-between">
33
+ <span className="text-lg font-semibold text-foreground">My App</span>
34
+ </div>
35
+ </header>
36
+ );
37
+ }
38
+ ```
39
+
40
+ ### Step 2 — Create the footer component (if requested)
41
+
42
+ Create `src/components/layout/AppFooter.tsx`:
43
+
44
+ ```tsx
45
+ import { cn } from "@/lib/utils";
46
+
47
+ interface AppFooterProps {
48
+ className?: string;
49
+ }
50
+
51
+ export function AppFooter({ className }: AppFooterProps) {
52
+ return (
53
+ <footer
54
+ className={cn(
55
+ "w-full border-t bg-background px-4 sm:px-6 lg:px-8 py-4",
56
+ className,
57
+ )}
58
+ >
59
+ <div className="max-w-7xl mx-auto text-center text-sm text-muted-foreground">
60
+ &copy; {new Date().getFullYear()} My App. All rights reserved.
61
+ </div>
62
+ </footer>
63
+ );
64
+ }
65
+ ```
66
+
67
+ ### Step 3 — Edit `appLayout.tsx`
68
+
69
+ Open `src/appLayout.tsx` — this is the **only file to modify** for layout-level additions. Wrap existing content in a flex column and add header above and footer below `<Outlet />`:
70
+
71
+ ```tsx
72
+ import { Outlet } from "react-router";
73
+ import { AppHeader } from "@/components/layout/AppHeader";
74
+ import { AppFooter } from "@/components/layout/AppFooter";
75
+ // Keep all existing imports unchanged
76
+
77
+ export default function AppLayout() {
78
+ return (
79
+ <div className="min-h-screen flex flex-col bg-background">
80
+ <AppHeader />
81
+ {/* Keep any existing NavigationMenu or other shell elements here */}
82
+ <main className="flex-1">
83
+ <Outlet />
84
+ </main>
85
+ <AppFooter />
86
+ </div>
87
+ );
88
+ }
89
+ ```
90
+
91
+ ### File Locations — Header / Footer
92
+
93
+ | Component | File | Export |
94
+ | ------------ | ------------------------------------- | ------------------------------ |
95
+ | Header | `src/components/layout/AppHeader.tsx` | Named export |
96
+ | Footer | `src/components/layout/AppFooter.tsx` | Named export |
97
+ | Layout shell | `src/appLayout.tsx` | Default export (edit in place) |
98
+
99
+ ### Why `appLayout.tsx` — Not Pages or Routes
100
+
101
+ `AppLayout` is the single shell rendered at the root route. Every page is a child rendered via `<Outlet />`. Placing the header and footer here ensures they appear on every page without touching individual pages or the route registry.
102
+
103
+ ```
104
+ AppLayout (appLayout.tsx)
105
+ ├── AppHeader ← renders on every page
106
+ ├── NavigationMenu ← keep if already present
107
+ ├── <Outlet /> ← active page renders here
108
+ └── AppFooter ← renders on every page
109
+ ```
110
+
111
+ ### Useful Patterns — Header / Footer
112
+
113
+ - **Sticky header:** add `sticky top-0 z-50` to the `<header>` element
114
+ - **Separator:** use `<Separator />` from `@/components/ui` instead of `border-b`/`border-t` if a visible divider is preferred
115
+ - **Nav links in header:** use `<Button variant="ghost" asChild>` wrapping a React Router `<Link>`
116
+ - **Icons:** `lucide-react`; add `aria-hidden="true"` on decorative icons
117
+ - **Design tokens:** `bg-background`, `text-foreground`, `text-muted-foreground`, `border`, `bg-primary`
118
+
119
+ ### Confirm — Header / Footer
120
+
121
+ - Header and footer appear on every page (navigate to at least two routes)
122
+ - Imports use path aliases (`@/components/layout/...`)
123
+ - No inline `style={{}}` — Tailwind only
124
+ - `src/routes.tsx` and `src/app.tsx` are unchanged
@@ -0,0 +1,92 @@
1
+ # Implementation — Page
2
+
3
+ ### Rules
4
+
5
+ 1. **`routes.tsx` is the only route registry** — never add routes in `app.tsx` or inside page files.
6
+ 2. **All pages are children of the AppLayout route** — do not create top-level routes that bypass the layout shell.
7
+ 3. **Default export per page** — each page file has exactly one default-export component.
8
+ 4. **Path aliases in all imports** — use `@/pages/...`, `@/components/...`; no deep relative paths.
9
+ 5. **No inline styles** — Tailwind utility classes and design tokens only.
10
+ 6. **Catch-all last** — `path: '*'` (NotFound) must always remain the last child in the layout route.
11
+ 7. **Never modify `appLayout.tsx`** when adding a page — layout changes are a separate concern.
12
+
13
+ ### Step 1 — Create the page file
14
+
15
+ Create `src/pages/MyPage.tsx` with a **default export** and the standard page container:
16
+
17
+ ```tsx
18
+ export default function MyPage() {
19
+ return (
20
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
21
+ <h1 className="text-3xl font-bold text-foreground">My Page</h1>
22
+ <p className="mt-4 text-muted-foreground">Page content goes here.</p>
23
+ </div>
24
+ );
25
+ }
26
+ ```
27
+
28
+ Use shadcn components from `@/components/ui` for UI elements. All styling via Tailwind — no inline `style={{}}`.
29
+
30
+ ### Step 2 — Register the route in `routes.tsx`
31
+
32
+ Open `src/routes.tsx`. Import the page and add it inside the layout route's `children` array:
33
+
34
+ ```tsx
35
+ import MyPage from "@/pages/MyPage";
36
+
37
+ // Inside the layout route's children array (before the catch-all):
38
+ {
39
+ path: "my-page",
40
+ element: <MyPage />,
41
+ handle: { showInNavigation: true, label: "My Page" },
42
+ },
43
+ ```
44
+
45
+ - `path` is a **relative segment** (e.g., `"contacts"`), not an absolute path.
46
+ - Include `handle: { showInNavigation: true, label: "Label" }` only if the page should appear in the navigation menu.
47
+ - The catch-all `path: '*'` must stay **last**.
48
+
49
+ ### Step 3 — Apply an auth guard (if needed)
50
+
51
+ | Access type | Guard | Behavior |
52
+ | ---------------------------------- | ----------------------- | --------------------------------------- |
53
+ | Public | None | Direct child of layout |
54
+ | Authenticated only | `<PrivateRoute>` | Redirects to login if not authenticated |
55
+ | Unauthenticated only (e.g., login) | `<AuthenticationRoute>` | Redirects away if already authenticated |
56
+
57
+ Example — private page:
58
+
59
+ ```tsx
60
+ import { PrivateRoute } from "@/components/auth/private-route";
61
+
62
+ {
63
+ path: "settings",
64
+ element: <PrivateRoute><SettingsPage /></PrivateRoute>,
65
+ handle: { showInNavigation: true, label: "Settings" },
66
+ },
67
+ ```
68
+
69
+ Use `ROUTES.*` constants from `@/utils/authenticationConfig` for auth-related paths — do not hardcode `/login`, `/profile`, etc.
70
+
71
+ ### File Conventions — Page
72
+
73
+ | Concern | Location |
74
+ | ----------------- | ------------------------------------------------------ |
75
+ | Page component | `src/pages/<PageName>.tsx` (default export) |
76
+ | Route definition | `src/routes.tsx` only |
77
+ | Layout shell | `src/appLayout.tsx` — do not modify for page additions |
78
+ | Auth config paths | `ROUTES.*` from `@/utils/authenticationConfig` |
79
+
80
+ ### State and Data
81
+
82
+ - **Local state:** `useState`, `useReducer`, `useRef` inside the page component
83
+ - **Shared or complex state:** extract to `src/hooks/` with a `use` prefix (e.g., `useContacts`)
84
+ - **Data fetching:** prefer GraphQL (`executeGraphQL`) or REST utilities in `src/api/`; place shared data logic in `src/hooks/`
85
+ - **Auth context:** `useAuth()` from `@/context/AuthContext` when current user is needed — only valid under `AuthProvider`
86
+
87
+ ### Confirm — Page
88
+
89
+ - The page renders inside the app shell (header/nav visible)
90
+ - If `showInNavigation: true`, the link appears in the navigation menu
91
+ - No TypeScript errors; no broken imports; no missing exports
92
+ - Imports use path aliases (`@/`, not deep relative paths)
package/dist/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
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
+ # [1.76.0](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.75.1...v1.76.0) (2026-03-06)
7
+
8
+
9
+ ### Features
10
+
11
+ * (template) add skills for base-app ([#208](https://github.com/salesforce-experience-platform-emu/webapps/issues/208)) ([dd5f7c5](https://github.com/salesforce-experience-platform-emu/webapps/commit/dd5f7c59b0d711cade589620c434836f016c5417))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [1.75.1](https://github.com/salesforce-experience-platform-emu/webapps/compare/v1.75.0...v1.75.1) (2026-03-05)
7
18
 
8
19
  **Note:** Version bump only for package @salesforce/webapp-template-base-sfdx-project-experimental
@@ -15,9 +15,9 @@
15
15
  "graphql:schema": "node scripts/get-graphql-schema.mjs"
16
16
  },
17
17
  "dependencies": {
18
- "@salesforce/agentforce-conversation-client": "^1.75.1",
19
- "@salesforce/sdk-data": "^1.75.1",
20
- "@salesforce/webapp-experimental": "^1.75.1",
18
+ "@salesforce/agentforce-conversation-client": "^1.76.0",
19
+ "@salesforce/sdk-data": "^1.76.0",
20
+ "@salesforce/webapp-experimental": "^1.76.0",
21
21
  "@tailwindcss/vite": "^4.1.17",
22
22
  "class-variance-authority": "^0.7.1",
23
23
  "clsx": "^2.1.1",
@@ -39,7 +39,7 @@
39
39
  "@graphql-eslint/eslint-plugin": "^4.1.0",
40
40
  "@graphql-tools/utils": "^11.0.0",
41
41
  "@playwright/test": "^1.49.0",
42
- "@salesforce/vite-plugin-webapp-experimental": "^1.75.1",
42
+ "@salesforce/vite-plugin-webapp-experimental": "^1.76.0",
43
43
  "@testing-library/jest-dom": "^6.6.3",
44
44
  "@testing-library/react": "^16.1.0",
45
45
  "@testing-library/user-event": "^14.5.2",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.75.1",
3
+ "version": "1.76.0",
4
4
  "description": "Base SFDX project template",
5
5
  "private": true,
6
6
  "files": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-feature-react-agentforce-conversation-client-experimental",
3
- "version": "1.75.1",
3
+ "version": "1.76.0",
4
4
  "description": "Embedded Agentforce conversation client feature for web applications",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -27,7 +27,7 @@
27
27
  "clean": "rm -rf dist"
28
28
  },
29
29
  "dependencies": {
30
- "@salesforce/agentforce-conversation-client": "^1.75.1"
30
+ "@salesforce/agentforce-conversation-client": "^1.76.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/react": "^19.2.7",