@helpai/elements 6.14.0 → 7.0.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/docs/frameworks.md +7 -3
- package/docs/installation.md +10 -10
- package/elements-web-component.esm.js +32 -32
- package/elements-web-component.esm.js.map +3 -3
- package/elements.cjs.js +33 -33
- package/elements.cjs.js.map +4 -4
- package/elements.esm.js +33 -33
- package/elements.esm.js.map +4 -4
- package/elements.js +33 -33
- package/elements.js.map +4 -4
- package/index.d.ts +7 -7
- package/index.mjs +21 -21
- package/llms-full.txt +157 -153
- package/llms.txt +19 -19
- package/package.json +2 -1
- package/react-BBw_sT1s.mjs +3 -0
- package/react-Dpi-Oi92.mjs +73 -0
- package/react.d.ts +45 -18
- package/react.mjs +1 -71
- package/style.css +1 -1
- package/web-component.mjs +21 -21
package/docs/frameworks.md
CHANGED
|
@@ -94,8 +94,10 @@ function PricingHelp() {
|
|
|
94
94
|
the server render sees the initial state. The commands are stable across renders and do nothing until the widget
|
|
95
95
|
has mounted (`state.ready`). `ask(text)` fills the composer; `ask(text, { send: true })` sends it. Call `reset()`
|
|
96
96
|
when your user logs out.
|
|
97
|
-
- **One import path.** The kit carries the
|
|
98
|
-
from `@helpai/elements/react`; the package's other entries are
|
|
97
|
+
- **One import path.** The kit carries the widget API a React app uses (`getInstance`, `getAllInstances`, `hook`,
|
|
98
|
+
`version`, `brand`, the types), so import everything from `@helpai/elements/react`; the package's other entries are
|
|
99
|
+
separate copies with their own widgets. `<HelpAI />` is how the kit mounts the widget: it has no `init`, `mount` or
|
|
100
|
+
`destroy`.
|
|
99
101
|
- **Two widgets** on one page: give each `<HelpAI widgetId='support' … />` and read it with `useHelpAI('support')`.
|
|
100
102
|
- **Page tools:** `useHelpAITool(tool)` gives the agent a tool while the component is mounted, or pass
|
|
101
103
|
`<HelpAI tools={[...]} />` ([Page tools](./page-tools.md)). `execute` can be a new function on every render; the
|
|
@@ -106,7 +108,9 @@ function PricingHelp() {
|
|
|
106
108
|
To open your own login modal from the widget's Log in button, `hook('default', 'loginRequested', fn)`
|
|
107
109
|
(Logging in).
|
|
108
110
|
|
|
109
|
-
The kit
|
|
111
|
+
The kit carries the widget and imports only React from your app, so you don't need Preact installed. The widget
|
|
112
|
+
itself (about 150 kB gzipped) is a separate chunk that `<HelpAI />` loads once it mounts in the browser, so it stays
|
|
113
|
+
out of your app's first load; the hooks work from the start and pick the widget up when it is ready.
|
|
110
114
|
|
|
111
115
|
### React 19 — use the web component directly
|
|
112
116
|
|
package/docs/installation.md
CHANGED
|
@@ -479,16 +479,16 @@ The web-component bundle self-registers `<web-ai-chat>` on import:
|
|
|
479
479
|
|
|
480
480
|
### File catalog (every `dist/<brand>/` ships these)
|
|
481
481
|
|
|
482
|
-
| File | Purpose
|
|
483
|
-
| --------------------------------- |
|
|
484
|
-
| `elements.js` | IIFE bundle, defines `window.HelpAI`
|
|
485
|
-
| `elements.esm.js` | **Standalone ESM, fully bundled**
|
|
486
|
-
| `elements-web-component.esm.js` | **Standalone ESM, registers `<web-ai-chat>`**
|
|
487
|
-
| `index.mjs` / `web-component.mjs` | tsdown ESM with bare imports (`import "preact"` etc.)
|
|
488
|
-
| `react.mjs` / `react.d.ts` | React kit: `<HelpAI />`, `useHelpAI()
|
|
489
|
-
| `style.css` | Standalone stylesheet — host-element tokens + layout
|
|
490
|
-
| `loader.js`, `loader.min.js` | GA-style queueing loader stub
|
|
491
|
-
| `index.d.ts` | TypeScript declarations
|
|
482
|
+
| File | Purpose | Use with |
|
|
483
|
+
| --------------------------------- | ------------------------------------------------------------------------------------ | --------------------------------------- |
|
|
484
|
+
| `elements.js` | IIFE bundle, defines `window.HelpAI` | Plain `<script>` (no `type="module"`) |
|
|
485
|
+
| `elements.esm.js` | **Standalone ESM, fully bundled** | `<script type="module">` import |
|
|
486
|
+
| `elements-web-component.esm.js` | **Standalone ESM, registers `<web-ai-chat>`** | `<script type="module">` import (no JS) |
|
|
487
|
+
| `index.mjs` / `web-component.mjs` | tsdown ESM with bare imports (`import "preact"` etc.) | Bundlers (Vite, webpack, esbuild) |
|
|
488
|
+
| `react.mjs` / `react.d.ts` | React kit: `<HelpAI />`, `useHelpAI()`; the widget is `react-*.mjs`, loaded on mount | React apps, `@helpai/elements/react` |
|
|
489
|
+
| `style.css` | Standalone stylesheet — host-element tokens + layout | `<link rel="stylesheet">` |
|
|
490
|
+
| `loader.js`, `loader.min.js` | GA-style queueing loader stub | Tag managers / analytics pipelines |
|
|
491
|
+
| `index.d.ts` | TypeScript declarations | NPM consumers |
|
|
492
492
|
|
|
493
493
|
### CDN URL forms
|
|
494
494
|
|