@tagit/ai-client-react 0.2.0-beta.1 → 0.4.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/README.md +387 -0
- package/dist/chat-widget.d.ts +2 -1
- package/dist/chat-widget.d.ts.map +1 -1
- package/dist/chat-widget.js +3 -1
- package/dist/chat-widget.js.map +1 -1
- package/package.json +2 -2
- package/src/chat-widget.css +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# @tagit/ai-client-react
|
|
2
|
+
|
|
3
|
+
React integration layer for tagIt AI.
|
|
4
|
+
|
|
5
|
+
Use this package when you want a self-contained chat experience in a React app. It builds on `@tagit/ai-client-core`, which owns the client engine, orchestrator transport, state, and collector emission. The core package README is the source of truth for those engine details.
|
|
6
|
+
|
|
7
|
+
## What Is tagIt?
|
|
8
|
+
|
|
9
|
+
tagIt is the platform for building governed AI experiences. It gives teams a way to define AI use cases, connect models, optionally attach MCP servers, and shape the orchestration logic that drives the overall experience.
|
|
10
|
+
|
|
11
|
+
## What Is the AI Orchestrator?
|
|
12
|
+
|
|
13
|
+
The AI Orchestrator is the runtime layer that executes a use case. It combines the configured model, optional tools and MCP servers, conversation context, and policy behavior to produce the response flow for a specific scenario.
|
|
14
|
+
|
|
15
|
+
## Why These Packages Exist
|
|
16
|
+
|
|
17
|
+
The `@tagit/ai-client-core` and `@tagit/ai-client-react` packages are the client-side pieces of that system. They connect your app to a tagIt account and a configured orchestrator so you can embed AI experiences in a product or website.
|
|
18
|
+
|
|
19
|
+
You need a tagIt account and at least one configured use case before these packages can drive a real experience. MCP servers are optional, but they can extend the orchestrator with tools and external capabilities.
|
|
20
|
+
|
|
21
|
+
To learn more, visit [tagit.live](https://tagit.live).
|
|
22
|
+
|
|
23
|
+
This README is the source of truth for integrating the React package.
|
|
24
|
+
|
|
25
|
+
## What This Package Provides
|
|
26
|
+
|
|
27
|
+
- `AIClientProvider` for React context
|
|
28
|
+
- `useAIClient`, `useConversation`, and `useClientEvents`
|
|
29
|
+
- `ChatWidget` for a full embeddable chat shell
|
|
30
|
+
- `ChatConversation` for a lighter conversation surface
|
|
31
|
+
- the widget stylesheet for direct import
|
|
32
|
+
|
|
33
|
+
## Provider Contract
|
|
34
|
+
|
|
35
|
+
`AIClientProvider` is the only required wrapper.
|
|
36
|
+
|
|
37
|
+
| Field | Type | Required | What it does | Example |
|
|
38
|
+
|---|---|---:|---|---|
|
|
39
|
+
| `client` | `AIClient` | yes | The live client instance used by hooks and widgets below the provider. | `client={client}` |
|
|
40
|
+
| `children` | `ReactNode` | yes | The React subtree that receives AI client context. | `<ChatWidget />` |
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<AIClientProvider client={client}>
|
|
44
|
+
<ChatWidget />
|
|
45
|
+
</AIClientProvider>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Public Imports
|
|
49
|
+
|
|
50
|
+
Supported public imports:
|
|
51
|
+
|
|
52
|
+
- `@tagit/ai-client-core`
|
|
53
|
+
- `@tagit/ai-client-core/config`
|
|
54
|
+
- `@tagit/ai-client-core/types`
|
|
55
|
+
- `@tagit/ai-client-react`
|
|
56
|
+
- `@tagit/ai-client-react/chat-widget`
|
|
57
|
+
- `@tagit/ai-client-react/chat-widget.css`
|
|
58
|
+
- `@tagit/ai-client-react/hooks`
|
|
59
|
+
- `@tagit/ai-client-react/provider`
|
|
60
|
+
- `@tagit/ai-client-react/conversation`
|
|
61
|
+
|
|
62
|
+
Do not import from `dist/*` or from internal source paths.
|
|
63
|
+
|
|
64
|
+
## Install
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm install @tagit/ai-client-core @tagit/ai-client-react
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Minimal Working Example
|
|
71
|
+
|
|
72
|
+
This is the smallest known-good React embed.
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
import { AIClient, createDefaultConfig } from '@tagit/ai-client-core';
|
|
76
|
+
import { AIClientProvider, ChatWidget } from '@tagit/ai-client-react';
|
|
77
|
+
import '@tagit/ai-client-react/chat-widget.css';
|
|
78
|
+
|
|
79
|
+
const client = new AIClient(
|
|
80
|
+
createDefaultConfig('your-use-case-id', 'https://your-orchestrator.example.com', {
|
|
81
|
+
collector: {
|
|
82
|
+
enabled: false,
|
|
83
|
+
},
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
export default function App() {
|
|
88
|
+
return (
|
|
89
|
+
<AIClientProvider client={client}>
|
|
90
|
+
<ChatWidget />
|
|
91
|
+
</AIClientProvider>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If that exact example does not render the default empty state and footer, verify the package install and runtime config before customizing anything.
|
|
97
|
+
|
|
98
|
+
## Core Concepts
|
|
99
|
+
|
|
100
|
+
### `@tagit/ai-client-core`
|
|
101
|
+
|
|
102
|
+
This is the headless engine:
|
|
103
|
+
|
|
104
|
+
- orchestrator config and transport
|
|
105
|
+
- conversation state
|
|
106
|
+
- SSE streaming
|
|
107
|
+
- retry and timeout handling
|
|
108
|
+
- collector emission
|
|
109
|
+
|
|
110
|
+
### `@tagit/ai-client-react`
|
|
111
|
+
|
|
112
|
+
This is the React shell:
|
|
113
|
+
|
|
114
|
+
- provider + hooks
|
|
115
|
+
- stock chat widget
|
|
116
|
+
- inline or overlay rendering
|
|
117
|
+
- shell styling and theming
|
|
118
|
+
|
|
119
|
+
Treat the core package as the engine and the React package as the UI layer on top.
|
|
120
|
+
|
|
121
|
+
## Widget Modes
|
|
122
|
+
|
|
123
|
+
`ChatWidget` supports two modes:
|
|
124
|
+
|
|
125
|
+
- `mode="overlay"` for floating chat
|
|
126
|
+
- `mode="inline"` for embedded layouts
|
|
127
|
+
|
|
128
|
+
For inline mode, there are two common host patterns:
|
|
129
|
+
|
|
130
|
+
- `dockMode="page"` for a page-anchored rail
|
|
131
|
+
- `dockMode="viewport"` for a viewport-docked rail that stays fixed to the browser edge
|
|
132
|
+
|
|
133
|
+
Use `dockMode="viewport"` when the widget should behave like a fixed browser sidebar and the host page should reserve layout space only while the panel is open. In this mode, the host page is responsible for the viewport split; the widget stays pinned to the browser edge and the tab collapses back to that edge.
|
|
134
|
+
|
|
135
|
+
### Overlay Example
|
|
136
|
+
|
|
137
|
+
```tsx
|
|
138
|
+
<ChatWidget
|
|
139
|
+
mode="overlay"
|
|
140
|
+
side="right"
|
|
141
|
+
title="tagIt Assistant"
|
|
142
|
+
showBackdrop
|
|
143
|
+
closeOnOutsideClick
|
|
144
|
+
/>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Page-Rail Inline Example
|
|
148
|
+
|
|
149
|
+
```tsx
|
|
150
|
+
<ChatWidget
|
|
151
|
+
mode="inline"
|
|
152
|
+
dockMode="page"
|
|
153
|
+
side="right"
|
|
154
|
+
open={true}
|
|
155
|
+
title="tagIt Assistant"
|
|
156
|
+
tabLabel="AI Client"
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Viewport-Docked Inline Example
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
<ChatWidget
|
|
164
|
+
mode="inline"
|
|
165
|
+
dockMode="viewport"
|
|
166
|
+
side="right"
|
|
167
|
+
open={isOpen}
|
|
168
|
+
onOpenChange={setIsOpen}
|
|
169
|
+
title="tagIt Assistant"
|
|
170
|
+
tabLabel="AI Client"
|
|
171
|
+
tabHeightPercent={18}
|
|
172
|
+
width={440}
|
|
173
|
+
minWidthPx={360}
|
|
174
|
+
maxWidthPx={440}
|
|
175
|
+
/>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Widget Configuration Dictionary
|
|
179
|
+
|
|
180
|
+
This section documents the public `ChatWidget` props that matter for integrations. If a field is omitted, the widget uses its built-in default.
|
|
181
|
+
|
|
182
|
+
### Layout and shell fields
|
|
183
|
+
|
|
184
|
+
| Field | Type / values | Default | What it does | Example |
|
|
185
|
+
|---|---|---:|---|---|
|
|
186
|
+
| `mode` | `'overlay' \| 'inline'` | `overlay` | Chooses between floating chat and embedded chat. | `mode="inline"` |
|
|
187
|
+
| `dockMode` | `'page' \| 'viewport'` | `page` | Controls how inline mode is docked. `page` is a normal page rail. `viewport` pins the rail to the browser edge. | `dockMode="viewport"` |
|
|
188
|
+
| `side` | `'left' \| 'right'` | `right` | Chooses which side the tab and panel live on. | `side="right"` |
|
|
189
|
+
| `open` | `boolean` | uncontrolled | Controlled open state. Use when the host needs to manage layout changes. | `open={isOpen}` |
|
|
190
|
+
| `defaultOpen` | `boolean` | `false` | Uncontrolled initial open state. | `defaultOpen={true}` |
|
|
191
|
+
| `onOpenChange` | `(open: boolean) => void` | `undefined` | Callback fired when the widget opens or closes. | `onOpenChange={setIsOpen}` |
|
|
192
|
+
| `width` | `number \| string` | `420` | Sets the panel width. Numbers are treated as pixels. | `width={440}` or `width="32vw"` |
|
|
193
|
+
| `resizable` | `boolean` | `true` | Enables or disables the drag resize handle. | `resizable={false}` |
|
|
194
|
+
| `minWidthPx` | `number` | `280` | Minimum panel width in pixels when resizing. | `minWidthPx={360}` |
|
|
195
|
+
| `maxWidthPx` | `number` | `undefined` | Maximum panel width in pixels when resizing. | `maxWidthPx={520}` |
|
|
196
|
+
| `tabHeightPercent` | `number` from `0` to `100` | `40` | Positions the tab vertically. `100` is near the top, `0` near the bottom. | `tabHeightPercent={18}` |
|
|
197
|
+
| `className` | `string` | `undefined` | Adds host styling hooks to the widget root. | `className="product-rail"` |
|
|
198
|
+
| `children` | `ReactNode` | `undefined` | Replaces the stock conversation body when intentionally supplied. | `<CustomConversation />` |
|
|
199
|
+
|
|
200
|
+
### Identity and labeling fields
|
|
201
|
+
|
|
202
|
+
| Field | Type / values | Default | What it does | Example |
|
|
203
|
+
|---|---|---:|---|---|
|
|
204
|
+
| `title` | `string` | `Ask TagIt` | Panel header title. | `title="tagIt Assistant"` |
|
|
205
|
+
| `titleIconUrl` | `string \| null` | `undefined` | Optional header icon URL. | `titleIconUrl="/icons/agent.png"` |
|
|
206
|
+
| `tabLabel` | `string \| null` | `Chat` | Text label on the tab. Set to `null` for icon-only mode. | `tabLabel="AI Client"` |
|
|
207
|
+
| `tabIcon` | `ReactNode` | `'AI'` | Fallback tab icon/content when no icon URL is provided. | `tabIcon={<Sparkles />}` |
|
|
208
|
+
| `tabIconUrl` | `string \| null` | `undefined` | Optional image URL for the tab icon. | `tabIconUrl="/icons/chat.png"` |
|
|
209
|
+
| `tabTooltipOpen` | `string \| null` | derived | Tooltip shown when the widget is closed. | `tabTooltipOpen="Open AI Client"` |
|
|
210
|
+
| `tabTooltipClose` | `string \| null` | derived | Tooltip shown when the widget is open. | `tabTooltipClose="Collapse AI Client"` |
|
|
211
|
+
|
|
212
|
+
### Theme and color fields
|
|
213
|
+
|
|
214
|
+
| Field | Type / values | Default | What it does | Example |
|
|
215
|
+
|---|---|---:|---|---|
|
|
216
|
+
| `theme` | `'light' \| 'dark' \| 'system'` | `system` | Chooses the widget theme. `system` follows the OS preference. | `theme="dark"` |
|
|
217
|
+
| `colorScheme` | `ChatColorScheme` | `undefined` | Single theme palette for the widget. | `{ bg: '#0b1220', primary: '#60a5fa' }` |
|
|
218
|
+
| `colorSchemes` | `Partial<Record<'light' \| 'dark', ChatColorScheme>>` | `undefined` | Separate palettes for light and dark themes. | `{ light: {...}, dark: {...} }` |
|
|
219
|
+
|
|
220
|
+
### Visibility and actions
|
|
221
|
+
|
|
222
|
+
| Field | Type / values | Default | What it does | Example |
|
|
223
|
+
|---|---|---:|---|---|
|
|
224
|
+
| `showBackdrop` | `boolean` | `false` | Shows the overlay scrim in overlay mode. | `showBackdrop` |
|
|
225
|
+
| `closeOnOutsideClick` | `boolean` | `false` | Allows clicking the backdrop to close the widget in overlay mode. | `closeOnOutsideClick` |
|
|
226
|
+
| `onWidthChange` | `(width: string) => void` | `undefined` | Called when the user resizes the panel. | `onWidthChange={setWidth}` |
|
|
227
|
+
| `onNewChat` | `() => void` | `undefined` | Overrides the default new-chat action. | `onNewChat={handleNewChat}` |
|
|
228
|
+
|
|
229
|
+
## Open / Close Control
|
|
230
|
+
|
|
231
|
+
`ChatWidget` supports both controlled and uncontrolled open state.
|
|
232
|
+
|
|
233
|
+
- `open` + `onOpenChange` for controlled usage
|
|
234
|
+
- `defaultOpen` for uncontrolled usage
|
|
235
|
+
|
|
236
|
+
Use controlled state when the host page needs to:
|
|
237
|
+
|
|
238
|
+
- reserve layout space only while the panel is open
|
|
239
|
+
- coordinate open state with surrounding page layout
|
|
240
|
+
- keep the tab at the browser edge in a viewport-docked integration
|
|
241
|
+
|
|
242
|
+
### Example: controlled viewport dock
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
const [isOpen, setIsOpen] = useState(true);
|
|
246
|
+
|
|
247
|
+
<ChatWidget
|
|
248
|
+
mode="inline"
|
|
249
|
+
dockMode="viewport"
|
|
250
|
+
side="right"
|
|
251
|
+
open={isOpen}
|
|
252
|
+
onOpenChange={setIsOpen}
|
|
253
|
+
title="tagIt Assistant"
|
|
254
|
+
tabLabel="AI Client"
|
|
255
|
+
/>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Conversation Action Options
|
|
259
|
+
|
|
260
|
+
The `useConversation()` hook exposes `sendMessage()`, `retry()`, `cancel()`, `clearHistory()`, and `reEditMessage()`. The request option bag belongs to the core client and is documented in [`@tagit/ai-client-core`](../ai-client-core/README.md).
|
|
261
|
+
|
|
262
|
+
## `ChatConversation`
|
|
263
|
+
|
|
264
|
+
Use `ChatConversation` when you want a lighter conversation surface and you are already handling the shell yourself.
|
|
265
|
+
|
|
266
|
+
```tsx
|
|
267
|
+
import { AIClientProvider, ChatConversation } from '@tagit/ai-client-react';
|
|
268
|
+
|
|
269
|
+
export default function App() {
|
|
270
|
+
return (
|
|
271
|
+
<AIClientProvider client={client}>
|
|
272
|
+
<ChatConversation />
|
|
273
|
+
</AIClientProvider>
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Use `ChatWidget` when you want the full built-in shell, header, tab, and sizing controls.
|
|
279
|
+
|
|
280
|
+
## Custom Conversation Body
|
|
281
|
+
|
|
282
|
+
Only pass `children` to `ChatWidget` if you intentionally want to replace the built-in conversation body.
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
<ChatWidget mode="overlay" side="right" title="tagIt Assistant">
|
|
286
|
+
<CustomConversation />
|
|
287
|
+
</ChatWidget>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
If you do not pass `children`, the stock conversation UI is rendered automatically.
|
|
291
|
+
|
|
292
|
+
## Configuration
|
|
293
|
+
|
|
294
|
+
The React package owns the widget shell, provider, hooks, and layout guidance. The core config, request, event, and collector contracts live in [`@tagit/ai-client-core`](../ai-client-core/README.md).
|
|
295
|
+
|
|
296
|
+
Use the core README for:
|
|
297
|
+
|
|
298
|
+
- `createDefaultConfig()`
|
|
299
|
+
- orchestrator config
|
|
300
|
+
- collector config
|
|
301
|
+
- UI config
|
|
302
|
+
- `sendMessage()` / `retry()` option bags
|
|
303
|
+
- conversation state
|
|
304
|
+
- client events
|
|
305
|
+
- orchestrator request shape
|
|
306
|
+
- collector envelope shape
|
|
307
|
+
|
|
308
|
+
See [`packages/ai-client-core/README.md`](../ai-client-core/README.md).
|
|
309
|
+
|
|
310
|
+
## Starter Harness
|
|
311
|
+
|
|
312
|
+
The starter app in `apps/starter` is the local demo and shell playground.
|
|
313
|
+
|
|
314
|
+
Use it to test:
|
|
315
|
+
|
|
316
|
+
- overlay mode
|
|
317
|
+
- inline page-rail mode
|
|
318
|
+
- inline viewport-docked mode
|
|
319
|
+
- theming and color schemes
|
|
320
|
+
- tab labels and tooltips
|
|
321
|
+
- open/close behavior
|
|
322
|
+
- sizing and resize behavior
|
|
323
|
+
|
|
324
|
+
The starter is not the distributable package.
|
|
325
|
+
|
|
326
|
+
## Recommended Integration Patterns
|
|
327
|
+
|
|
328
|
+
### Simple Embed
|
|
329
|
+
|
|
330
|
+
Use this when you want the fastest possible install:
|
|
331
|
+
|
|
332
|
+
- create one `AIClient`
|
|
333
|
+
- wrap the app with `AIClientProvider`
|
|
334
|
+
- render `<ChatWidget />`
|
|
335
|
+
- import `@tagit/ai-client-react/chat-widget.css`
|
|
336
|
+
|
|
337
|
+
### Viewport-Docked Sidebar
|
|
338
|
+
|
|
339
|
+
Use this when the chat should feel like a persistent product rail:
|
|
340
|
+
|
|
341
|
+
- keep the widget fixed to the browser edge
|
|
342
|
+
- reserve page width only when open
|
|
343
|
+
- let the tab collapse back to the browser edge
|
|
344
|
+
- keep the host page scroll independent of the rail
|
|
345
|
+
|
|
346
|
+
This pattern pairs best with:
|
|
347
|
+
|
|
348
|
+
- `mode="inline"`
|
|
349
|
+
- `dockMode="viewport"`
|
|
350
|
+
- controlled `open` state
|
|
351
|
+
- host-page padding or content width reservation that only applies while the panel is open
|
|
352
|
+
|
|
353
|
+
```tsx
|
|
354
|
+
<div className={`page-shell ${isOpen ? 'page-shell-chat-open' : ''}`}>
|
|
355
|
+
<main>...</main>
|
|
356
|
+
<ChatWidget
|
|
357
|
+
mode="inline"
|
|
358
|
+
dockMode="viewport"
|
|
359
|
+
side="right"
|
|
360
|
+
open={isOpen}
|
|
361
|
+
onOpenChange={setIsOpen}
|
|
362
|
+
/>
|
|
363
|
+
</div>
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Custom Shell
|
|
367
|
+
|
|
368
|
+
Use `useConversation()` when the host app wants to render its own shell and only consume conversation state and actions.
|
|
369
|
+
|
|
370
|
+
## Troubleshooting
|
|
371
|
+
|
|
372
|
+
| Symptom | Likely cause | Check |
|
|
373
|
+
|---|---|---|
|
|
374
|
+
| Header/tab only, empty shell | stale package cache or old bundle | clear `node_modules/.vite`, restart dev server, confirm `children` is not being passed |
|
|
375
|
+
| No styling | CSS not imported | verify `@tagit/ai-client-react/chat-widget.css` import |
|
|
376
|
+
| Missing body after passing custom JSX | `children` overrides stock body | remove `children` to restore the stock widget |
|
|
377
|
+
| No messages sent | invalid orchestrator config | verify `orchestrator.baseUrl` and `useCaseId`, confirm `baseUrl` does not include `/v1/chat` |
|
|
378
|
+
| Runtime import error | unsupported import path | use only documented public exports |
|
|
379
|
+
| Collector events do not appear | collector config incomplete or disabled | confirm `collector.enabled`, `collector.baseUrl`, and `collector.tagId` |
|
|
380
|
+
| Inline mode looks cramped | panel width too small | pass a wider `width` or switch to `dockMode="viewport"` with host-side reserved space |
|
|
381
|
+
| Viewport-docked mode takes over the whole page | host layout is stretching the widget root | keep the docked widget fixed to the viewport edge and reserve page width only in the host shell |
|
|
382
|
+
|
|
383
|
+
## Related Docs
|
|
384
|
+
|
|
385
|
+
- [`AGENTS.md`](../../AGENTS.md)
|
|
386
|
+
- [`README.md`](../../README.md)
|
|
387
|
+
- [`apps/starter`](../../apps/starter)
|
package/dist/chat-widget.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export type ChatColorScheme = {
|
|
|
23
23
|
};
|
|
24
24
|
export type ChatWidgetProps = {
|
|
25
25
|
mode?: ChatWidgetMode;
|
|
26
|
+
dockMode?: 'page' | 'viewport';
|
|
26
27
|
side?: ChatWidgetSide;
|
|
27
28
|
title?: string;
|
|
28
29
|
titleIconUrl?: string | null;
|
|
@@ -49,5 +50,5 @@ export type ChatWidgetProps = {
|
|
|
49
50
|
className?: string;
|
|
50
51
|
children?: React.ReactNode;
|
|
51
52
|
};
|
|
52
|
-
export declare function ChatWidget({ mode, side, title, titleIconUrl, open, defaultOpen, onOpenChange, theme, colorScheme, colorSchemes, tabIcon, tabLabel, tabTooltipOpen, tabTooltipClose, tabIconUrl, tabHeightPercent, width, resizable, minWidthPx, maxWidthPx, onWidthChange, showBackdrop, closeOnOutsideClick, onNewChat, className, children, }: ChatWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export declare function ChatWidget({ mode, dockMode, side, title, titleIconUrl, open, defaultOpen, onOpenChange, theme, colorScheme, colorSchemes, tabIcon, tabLabel, tabTooltipOpen, tabTooltipClose, tabIconUrl, tabHeightPercent, width, resizable, minWidthPx, maxWidthPx, onWidthChange, showBackdrop, closeOnOutsideClick, onNewChat, className, children, }: ChatWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
53
54
|
//# sourceMappingURL=chat-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-widget.d.ts","sourceRoot":"","sources":["../src/chat-widget.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B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,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAYF,wBAAgB,UAAU,CAAC,EACzB,IAAgB,EAChB,QAAiB,EACjB,IAAc,EACd,KAAmB,EACnB,YAAY,EACZ,IAAI,EACJ,WAAmB,EACnB,YAAY,EACZ,KAAgB,EAChB,WAAW,EACX,YAAY,EACZ,OAAO,EACP,QAAiB,EACjB,cAAc,EACd,eAAe,EACf,UAAU,EACV,gBAAqB,EACrB,KAAW,EACX,SAAgB,EAChB,UAAgB,EAChB,UAAU,EACV,aAAa,EACb,YAAoB,EACpB,mBAA2B,EAC3B,SAAS,EACT,SAAS,EACT,QAAQ,GACT,EAAE,eAAe,2CAiOjB"}
|
package/dist/chat-widget.js
CHANGED
|
@@ -12,7 +12,7 @@ function resolveTheme(theme) {
|
|
|
12
12
|
}
|
|
13
13
|
return 'light';
|
|
14
14
|
}
|
|
15
|
-
export function ChatWidget({ mode = 'overlay', side = 'right', title = 'Ask TagIt', titleIconUrl, open, defaultOpen = false, onOpenChange, theme = 'system', colorScheme, colorSchemes, tabIcon, tabLabel = 'Chat', tabTooltipOpen, tabTooltipClose, tabIconUrl, tabHeightPercent = 40, width = 420, resizable = true, minWidthPx = 280, maxWidthPx, onWidthChange, showBackdrop = false, closeOnOutsideClick = false, onNewChat, className, children, }) {
|
|
15
|
+
export function ChatWidget({ mode = 'overlay', dockMode = 'page', side = 'right', title = 'Ask TagIt', titleIconUrl, open, defaultOpen = false, onOpenChange, theme = 'system', colorScheme, colorSchemes, tabIcon, tabLabel = 'Chat', tabTooltipOpen, tabTooltipClose, tabIconUrl, tabHeightPercent = 40, width = 420, resizable = true, minWidthPx = 280, maxWidthPx, onWidthChange, showBackdrop = false, closeOnOutsideClick = false, onNewChat, className, children, }) {
|
|
16
16
|
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
17
17
|
const [internalWidth, setInternalWidth] = useState(typeof width === 'number' ? `${width}px` : String(width));
|
|
18
18
|
const [resolvedTheme, setResolvedTheme] = useState(() => resolveTheme(theme));
|
|
@@ -116,6 +116,8 @@ export function ChatWidget({ mode = 'overlay', side = 'right', title = 'Ask TagI
|
|
|
116
116
|
return (_jsxs("div", { className: [
|
|
117
117
|
'tagIt-chat-widget',
|
|
118
118
|
`tagIt-chat-widget-${mode}`,
|
|
119
|
+
`tagIt-chat-widget-dock-${dockMode}`,
|
|
120
|
+
isOpen ? 'tagIt-chat-widget-open' : 'tagIt-chat-widget-closed',
|
|
119
121
|
`tagIt-chat-side-${side}`,
|
|
120
122
|
`tagIt-chat-theme-${resolvedTheme}`,
|
|
121
123
|
className || '',
|
package/dist/chat-widget.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-widget.js","sourceRoot":"","sources":["../src/chat-widget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"chat-widget.js","sourceRoot":"","sources":["../src/chat-widget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAyD5C,SAAS,YAAY,CAAC,KAAsB;IAC1C,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QAC1C,OA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C,IAAI,EACR,uBAAK,KAAK,GAAM,IACZ,EACN,eAAK,SAAS,EAAC,iCAAiC,aAC9C,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,uBAAuB,gBACtB,UAAU,EACrB,KAAK,EAAC,UAAU,EAChB,OAAO,EAAE,GAAG,EAAE;4CACZ,IAAI,SAAS,EAAE,CAAC;gDACd,SAAS,EAAE,CAAC;gDACZ,OAAO;4CACT,CAAC;4CAED,MAAM,CAAC,MAAM,EAAE,CAAC;4CAChB,MAAM,CAAC,YAAY,EAAE,CAAC;wCACxB,CAAC,YAED,KAAC,qBAAqB,IAAC,IAAI,EAAE,EAAE,GAAI,GAC5B,EACT,iBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kBAAkB,gBACjB,YAAY,EACvB,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAE7B,KAAC,CAAC,IAAC,IAAI,EAAE,EAAE,GAAI,GACR,IACL,IACC,EACT,cAAK,SAAS,EAAC,uBAAuB,YACnC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC,CAAC,QAAQ,GACrD,IACA,IACJ,CACP,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tagit/ai-client-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Self-contained React chat widget and hooks for TagIt AI client",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"recharts": "^3.8.1",
|
|
43
43
|
"rehype-highlight": "^7.0.2",
|
|
44
44
|
"remark-gfm": "^4.0.1",
|
|
45
|
-
"@tagit/ai-client-core": "0.
|
|
45
|
+
"@tagit/ai-client-core": "0.4.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": "^18.0.0",
|
package/src/chat-widget.css
CHANGED
|
@@ -314,6 +314,31 @@
|
|
|
314
314
|
border-right: 1px solid var(--tagIt-chat-border);
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
+
.tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport {
|
|
318
|
+
position: fixed;
|
|
319
|
+
top: 0;
|
|
320
|
+
right: 0;
|
|
321
|
+
bottom: 0;
|
|
322
|
+
z-index: 80;
|
|
323
|
+
width: min(100vw, var(--tagIt-chat-panel-width));
|
|
324
|
+
max-width: 100vw;
|
|
325
|
+
height: 100dvh;
|
|
326
|
+
overflow: visible;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport.tagIt-chat-side-left {
|
|
330
|
+
left: 0;
|
|
331
|
+
right: auto;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport.tagIt-chat-widget-open {
|
|
335
|
+
width: min(100vw, var(--tagIt-chat-panel-width));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport.tagIt-chat-widget-closed {
|
|
339
|
+
width: 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
317
342
|
.tagIt-chat-widget-inline .tagIt-chat-panel {
|
|
318
343
|
position: absolute;
|
|
319
344
|
top: 0;
|