@schandlergarcia/sf-web-components 1.9.86 → 1.9.87
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.
|
@@ -398,19 +398,27 @@ Define schemas outside component body. Always `required: true` on mandatory fiel
|
|
|
398
398
|
|
|
399
399
|
## AI Chat & Agent
|
|
400
400
|
|
|
401
|
-
Two
|
|
401
|
+
Two pieces for agent integration — a **ChatBar** component and the **`useEvaAgent` hook** (Agent REST API):
|
|
402
402
|
|
|
403
403
|
- **`ChatBar`** — command-palette strip for suggested prompts. Place between the hero map and data panels (full-width, `px-4 pt-4`), NOT in the header. Always provide 3–5 `suggestions`.
|
|
404
|
-
- **`
|
|
404
|
+
- **`useEvaAgent`** — pre-installed hook at `src/hooks/useEvaAgent.ts`. Handles OAuth → session → messages → cleanup via the Agentforce Agent REST API. Config is in `src/config/agentApi.ts`. Vite proxy rules in `vite.config.ts` forward requests.
|
|
405
|
+
|
|
406
|
+
> **Do NOT use `AgentforceConversationClient`** (the iframe widget). We use the Agent REST API via `useEvaAgent`.
|
|
407
|
+
> **Do NOT create wrapper hooks** (useEvaChatAdapter, useDisruptionAlerts, etc.). Use `useEvaAgent` directly.
|
|
408
|
+
> **Do NOT create `.env` or `.env.local` files** — config is hardcoded in `src/config/agentApi.ts`.
|
|
405
409
|
|
|
406
410
|
```tsx
|
|
407
|
-
import
|
|
411
|
+
import useEvaAgent from "@/hooks/useEvaAgent";
|
|
412
|
+
|
|
413
|
+
const { messages, isReady, isSending, connect, sendMessage } = useEvaAgent();
|
|
414
|
+
useEffect(() => { connect(); }, [connect]);
|
|
408
415
|
|
|
409
|
-
|
|
416
|
+
const handleChat = (text: string) => {
|
|
417
|
+
sendMessage(text);
|
|
418
|
+
return { text: `Looking into: "${text}"…` };
|
|
419
|
+
};
|
|
410
420
|
```
|
|
411
421
|
|
|
412
|
-
- Return `components` for structured data — never markdown tables in text
|
|
413
|
-
- Always set height on `ChatPanel`
|
|
414
422
|
- Extract `onSend` handlers to module scope when shared
|
|
415
423
|
|
|
416
424
|
## Tables
|
|
@@ -672,7 +672,7 @@ Dropdown select. Value `"all"` skips filtering.
|
|
|
672
672
|
## Data Utilities
|
|
673
673
|
|
|
674
674
|
### DataModeToggle
|
|
675
|
-
**
|
|
675
|
+
> ⚠️ **Do NOT use in the Engine Command Center dashboard.** The Engine dashboard controls data mode via `ENABLE_SAMPLE_DATA_CACHE` in `src/lib/dataStrategy.ts` — there is no UI toggle. Only use `DataModeToggle` in non-Engine dashboards that explicitly need a manual toggle.
|
|
676
676
|
|
|
677
677
|
```jsx
|
|
678
678
|
<DataModeToggle className="ml-4" />
|
|
@@ -54,7 +54,7 @@ Wraps app. Provides `useDataMode()` → `{ mode, isSample, isLive, toggle, setMo
|
|
|
54
54
|
## Data Utilities
|
|
55
55
|
|
|
56
56
|
### DataModeToggle
|
|
57
|
-
**
|
|
57
|
+
> ⚠️ **Do NOT use in the Engine Command Center dashboard.** The Engine dashboard controls data mode via `ENABLE_SAMPLE_DATA_CACHE` in `src/lib/dataStrategy.ts` — there is no UI toggle. Only use `DataModeToggle` in non-Engine dashboards that explicitly need a manual toggle.
|
|
58
58
|
|
|
59
59
|
```jsx
|
|
60
60
|
<DataModeToggle className="ml-4" />
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.87] - 2026-04-07
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **SKILL.md AI Chat section** — replaced `AgentforceConversationClient` instructions with `useEvaAgent` hook usage and explicit prohibitions against iframe widget, wrapper hooks, and .env files.
|
|
12
|
+
- **Component library DataModeToggle docs** — added warning that DataModeToggle must NOT be used in the Engine Command Center dashboard (both SKILL.md and chat-data.md).
|
|
13
|
+
|
|
8
14
|
## [1.9.86] - 2026-04-07
|
|
9
15
|
|
|
10
16
|
### Changed
|
package/package.json
CHANGED