@tagit/ai-client-react 0.6.1 → 0.7.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 +146 -11
- package/dist/chat-conversation.d.ts +2 -1
- package/dist/chat-conversation.d.ts.map +1 -1
- package/dist/chat-widget.d.ts +17 -1
- package/dist/chat-widget.d.ts.map +1 -1
- package/dist/chat-widget.js +28 -13
- package/dist/chat-widget.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/provider.d.ts +2 -2
- package/dist/provider.d.ts.map +1 -1
- package/dist/renderers/ChartRenderer.d.ts +1 -1
- package/dist/renderers/ChartRenderer.d.ts.map +1 -1
- package/dist/renderers/ContentBlockRenderer.d.ts +1 -1
- package/dist/renderers/ContentBlockRenderer.d.ts.map +1 -1
- package/dist/renderers/MarkdownRenderer.d.ts +2 -1
- package/dist/renderers/MarkdownRenderer.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/chat-widget.css +54 -31
package/README.md
CHANGED
|
@@ -131,23 +131,64 @@ Treat the core package as the engine and the React package as the UI layer on to
|
|
|
131
131
|
|
|
132
132
|
## Widget Modes
|
|
133
133
|
|
|
134
|
-
`ChatWidget` supports two
|
|
134
|
+
`ChatWidget` supports two layout APIs:
|
|
135
135
|
|
|
136
|
-
- `
|
|
137
|
-
- `mode
|
|
136
|
+
- `presentation`, the preferred API for new integrations
|
|
137
|
+
- `mode`, the legacy API retained for existing integrations
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
Use `presentation` when embedding the widget into production applications:
|
|
140
|
+
|
|
141
|
+
- `presentation="overlay"` for floating chat over host content
|
|
142
|
+
- `presentation="sidePanel"` for a viewport-docked panel where the host reserves side space
|
|
143
|
+
- `presentation="inline"` for embedded layouts inside the host page
|
|
144
|
+
|
|
145
|
+
The older `mode="overlay"` and `mode="inline"` props continue to work.
|
|
146
|
+
|
|
147
|
+
For legacy inline mode, there are two common host patterns:
|
|
140
148
|
|
|
141
149
|
- `dockMode="page"` for a page-anchored rail
|
|
142
150
|
- `dockMode="viewport"` for a viewport-docked rail that stays fixed to the browser edge
|
|
143
151
|
|
|
144
|
-
Use `
|
|
152
|
+
Use `presentation="sidePanel"` for new viewport sidebar integrations. The SDK keeps the panel pinned to the browser edge, owns resize math, and automatically switches to mobile fullscreen at the configured breakpoint. The host should only reserve page space from the controlled `open` and `width` values.
|
|
153
|
+
|
|
154
|
+
### Choosing a Presentation
|
|
155
|
+
|
|
156
|
+
| Use case | Recommended presentation | Host responsibility |
|
|
157
|
+
|---|---|---|
|
|
158
|
+
| Marketing site, support bubble, simple app assistant | `presentation="overlay"` | None, unless you want a backdrop or controlled open state. |
|
|
159
|
+
| Application copilot that should push content aside | `presentation="sidePanel"` | Reserve side space from `open` and `width`; let the SDK render and resize the panel. |
|
|
160
|
+
| Fully embedded chat region inside a page layout | `presentation="inline"` | Provide the parent container size. |
|
|
161
|
+
| Existing integrations already using `mode` | Keep `mode` for now | Migrate to `presentation` when you next touch layout code. |
|
|
162
|
+
|
|
163
|
+
### What The SDK Owns
|
|
164
|
+
|
|
165
|
+
The React package owns:
|
|
166
|
+
|
|
167
|
+
- panel shell rendering
|
|
168
|
+
- viewport docking
|
|
169
|
+
- resize handle behavior
|
|
170
|
+
- mobile fullscreen takeover
|
|
171
|
+
- tab positioning
|
|
172
|
+
- close and new-chat controls
|
|
173
|
+
- stock conversation body
|
|
174
|
+
|
|
175
|
+
The host application should not wrap the widget in invisible resize frames or constrain the panel with `max-width: 100%` when using `presentation="sidePanel"`. Those patterns can break bidirectional resize math.
|
|
176
|
+
|
|
177
|
+
### What The Host Owns
|
|
178
|
+
|
|
179
|
+
The host application owns:
|
|
180
|
+
|
|
181
|
+
- the `AIClientProvider` and configured core client
|
|
182
|
+
- whether the panel is controlled or uncontrolled
|
|
183
|
+
- reserved page space for `presentation="sidePanel"`
|
|
184
|
+
- theme/color values when the default palette is not enough
|
|
185
|
+
- application-specific quick actions, page context, or custom callbacks
|
|
145
186
|
|
|
146
187
|
### Overlay Example
|
|
147
188
|
|
|
148
189
|
```tsx
|
|
149
190
|
<ChatWidget
|
|
150
|
-
|
|
191
|
+
presentation="overlay"
|
|
151
192
|
side="right"
|
|
152
193
|
title="tagIt Assistant"
|
|
153
194
|
showBackdrop
|
|
@@ -155,7 +196,54 @@ Use `dockMode="viewport"` when the widget should behave like a fixed browser sid
|
|
|
155
196
|
/>
|
|
156
197
|
```
|
|
157
198
|
|
|
158
|
-
###
|
|
199
|
+
### Side-Panel Example
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
const [open, setOpen] = useState(false);
|
|
203
|
+
const [width, setWidth] = useState('420px');
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<div
|
|
207
|
+
style={{
|
|
208
|
+
minHeight: '100dvh',
|
|
209
|
+
paddingRight: open ? width : 0,
|
|
210
|
+
transition: 'padding-right 180ms ease',
|
|
211
|
+
}}
|
|
212
|
+
>
|
|
213
|
+
<main>
|
|
214
|
+
<AppContent />
|
|
215
|
+
</main>
|
|
216
|
+
|
|
217
|
+
<ChatWidget
|
|
218
|
+
presentation="sidePanel"
|
|
219
|
+
side="right"
|
|
220
|
+
open={open}
|
|
221
|
+
onOpenChange={setOpen}
|
|
222
|
+
width={width}
|
|
223
|
+
onWidthChange={setWidth}
|
|
224
|
+
minWidthPx={360}
|
|
225
|
+
maxWidthPx={720}
|
|
226
|
+
mobileBreakpointPx={768}
|
|
227
|
+
mobilePresentation="fullscreen"
|
|
228
|
+
title="Tacky"
|
|
229
|
+
/>
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
For a left-side panel, reserve `paddingLeft` instead of `paddingRight`.
|
|
235
|
+
|
|
236
|
+
### Side-Panel Integration Checklist
|
|
237
|
+
|
|
238
|
+
- Use controlled `open` and `onOpenChange`.
|
|
239
|
+
- Store `width` as a string, for example `'420px'`.
|
|
240
|
+
- Pass the same `width` to the widget and to the host reserved space.
|
|
241
|
+
- Keep `minWidthPx` and `maxWidthPx` aligned with your application layout.
|
|
242
|
+
- Use `mobilePresentation="fullscreen"` unless your mobile layout has a strong reason not to.
|
|
243
|
+
- Do not put the widget inside a parent that clips overflow or limits width when using `presentation="sidePanel"`.
|
|
244
|
+
- Do not implement a separate resize handle in the host application.
|
|
245
|
+
|
|
246
|
+
### Legacy Page-Rail Inline Example
|
|
159
247
|
|
|
160
248
|
```tsx
|
|
161
249
|
<ChatWidget
|
|
@@ -168,7 +256,7 @@ Use `dockMode="viewport"` when the widget should behave like a fixed browser sid
|
|
|
168
256
|
/>
|
|
169
257
|
```
|
|
170
258
|
|
|
171
|
-
### Viewport-Docked Inline Example
|
|
259
|
+
### Legacy Viewport-Docked Inline Example
|
|
172
260
|
|
|
173
261
|
```tsx
|
|
174
262
|
<ChatWidget
|
|
@@ -186,6 +274,8 @@ Use `dockMode="viewport"` when the widget should behave like a fixed browser sid
|
|
|
186
274
|
/>
|
|
187
275
|
```
|
|
188
276
|
|
|
277
|
+
Prefer the new side-panel example for new application copilot integrations. The legacy viewport-docked inline mode remains available for existing apps that already use it.
|
|
278
|
+
|
|
189
279
|
## Widget Configuration Dictionary
|
|
190
280
|
|
|
191
281
|
This section documents the public `ChatWidget` props that matter for integrations. If a field is omitted, the widget uses its built-in default.
|
|
@@ -194,6 +284,7 @@ This section documents the public `ChatWidget` props that matter for integration
|
|
|
194
284
|
|
|
195
285
|
| Field | Type / values | Default | What it does | Example |
|
|
196
286
|
|---|---|---:|---|---|
|
|
287
|
+
| `presentation` | `'overlay' \| 'sidePanel' \| 'inline'` | derived from `mode` | Preferred layout API for new integrations. `sidePanel` is viewport-docked and designed for host-reserved side space. | `presentation="sidePanel"` |
|
|
197
288
|
| `mode` | `'overlay' \| 'inline'` | `overlay` | Chooses between floating chat and embedded chat. | `mode="inline"` |
|
|
198
289
|
| `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"` |
|
|
199
290
|
| `side` | `'left' \| 'right'` | `right` | Chooses which side the tab and panel live on. | `side="right"` |
|
|
@@ -204,6 +295,8 @@ This section documents the public `ChatWidget` props that matter for integration
|
|
|
204
295
|
| `resizable` | `boolean` | `true` | Enables or disables the drag resize handle. | `resizable={false}` |
|
|
205
296
|
| `minWidthPx` | `number` | `280` | Minimum panel width in pixels when resizing. | `minWidthPx={360}` |
|
|
206
297
|
| `maxWidthPx` | `number` | `undefined` | Maximum panel width in pixels when resizing. | `maxWidthPx={520}` |
|
|
298
|
+
| `mobileBreakpointPx` | `number` | `720` | Width breakpoint where the widget switches to mobile behavior. | `mobileBreakpointPx={768}` |
|
|
299
|
+
| `mobilePresentation` | `'fullscreen' \| 'default'` | `fullscreen` | Controls mobile behavior. `fullscreen` makes the panel a 100vw x 100dvh takeover and disables resize. | `mobilePresentation="fullscreen"` |
|
|
207
300
|
| `tabHeightPercent` | `number` from `0` to `100` | `40` | Positions the tab vertically. `100` is near the top, `0` near the bottom. | `tabHeightPercent={18}` |
|
|
208
301
|
| `className` | `string` | `undefined` | Adds host styling hooks to the widget root. | `className="product-rail"` |
|
|
209
302
|
| `children` | `ReactNode` | `undefined` | Replaces the stock conversation body when intentionally supplied. | `<CustomConversation />` |
|
|
@@ -250,22 +343,64 @@ Use controlled state when the host page needs to:
|
|
|
250
343
|
- coordinate open state with surrounding page layout
|
|
251
344
|
- keep the tab at the browser edge in a viewport-docked integration
|
|
252
345
|
|
|
253
|
-
### Example: controlled
|
|
346
|
+
### Example: controlled side panel
|
|
254
347
|
|
|
255
348
|
```tsx
|
|
256
349
|
const [isOpen, setIsOpen] = useState(true);
|
|
350
|
+
const [width, setWidth] = useState('420px');
|
|
257
351
|
|
|
258
352
|
<ChatWidget
|
|
259
|
-
|
|
260
|
-
dockMode="viewport"
|
|
353
|
+
presentation="sidePanel"
|
|
261
354
|
side="right"
|
|
262
355
|
open={isOpen}
|
|
263
356
|
onOpenChange={setIsOpen}
|
|
357
|
+
width={width}
|
|
358
|
+
onWidthChange={setWidth}
|
|
264
359
|
title="tagIt Assistant"
|
|
265
360
|
tabLabel="AI Client"
|
|
266
361
|
/>
|
|
267
362
|
```
|
|
268
363
|
|
|
364
|
+
## Mobile Behavior
|
|
365
|
+
|
|
366
|
+
By default, the widget switches to fullscreen when the viewport is at or below `mobileBreakpointPx`.
|
|
367
|
+
|
|
368
|
+
Fullscreen mobile behavior means:
|
|
369
|
+
|
|
370
|
+
- the panel uses `100vw` and `100dvh`
|
|
371
|
+
- the panel is anchored to the viewport instead of the page
|
|
372
|
+
- resize is disabled
|
|
373
|
+
- the tab becomes a floating button near the lower-right edge
|
|
374
|
+
- the host should not reserve side-panel layout space for mobile
|
|
375
|
+
|
|
376
|
+
If your host reserves side-panel space, clear that reservation at the same breakpoint:
|
|
377
|
+
|
|
378
|
+
```tsx
|
|
379
|
+
const isMobile = useMediaQuery('(max-width: 768px)');
|
|
380
|
+
|
|
381
|
+
<div style={{ paddingRight: open && !isMobile ? width : 0 }}>
|
|
382
|
+
<AppContent />
|
|
383
|
+
<ChatWidget
|
|
384
|
+
presentation="sidePanel"
|
|
385
|
+
open={open}
|
|
386
|
+
onOpenChange={setOpen}
|
|
387
|
+
width={width}
|
|
388
|
+
onWidthChange={setWidth}
|
|
389
|
+
mobileBreakpointPx={768}
|
|
390
|
+
/>
|
|
391
|
+
</div>
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Troubleshooting Layout
|
|
395
|
+
|
|
396
|
+
| Symptom | Likely cause | Fix |
|
|
397
|
+
|---|---|---|
|
|
398
|
+
| Panel opens but leaves a blank rail after closing | Host always reserves width instead of checking `open`. | Reserve side space only when `open` is true and not mobile. |
|
|
399
|
+
| Panel can shrink but not grow | Parent container is constraining width. | Use `presentation="sidePanel"` and avoid parent `max-width: 100%` constraints around the widget. |
|
|
400
|
+
| Panel scrolls with the page | The host is using an embedded/inline layout when it wanted a viewport panel. | Use `presentation="sidePanel"` or `presentation="overlay"`. |
|
|
401
|
+
| Mobile inherits desktop side-panel behavior | Host is not clearing reserved side space at the mobile breakpoint. | Use `mobilePresentation="fullscreen"` and clear host padding/margin on mobile. |
|
|
402
|
+
| Backdrop shows in a side panel | `presentation="overlay"` is being used. | Use `presentation="sidePanel"` for app copilots that push content aside. |
|
|
403
|
+
|
|
269
404
|
## Conversation Action Options
|
|
270
405
|
|
|
271
406
|
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).
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
export interface ChatConversationProps {
|
|
2
3
|
className?: string;
|
|
3
4
|
}
|
|
@@ -6,5 +7,5 @@ export interface ChatConversationProps {
|
|
|
6
7
|
* This renders the default welcome state, message list, tool call output,
|
|
7
8
|
* streaming indicator, inline errors, and composer footer.
|
|
8
9
|
*/
|
|
9
|
-
export declare function ChatConversation({ className }: ChatConversationProps):
|
|
10
|
+
export declare function ChatConversation({ className }: ChatConversationProps): React.JSX.Element;
|
|
10
11
|
//# sourceMappingURL=chat-conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-conversation.d.ts","sourceRoot":"","sources":["../src/chat-conversation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat-conversation.d.ts","sourceRoot":"","sources":["../src/chat-conversation.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoE,MAAM,OAAO,CAAC;AAqCzF,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE,qBAAqB,qBAmUpE"}
|
package/dist/chat-widget.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type ChatWidgetMode = 'overlay' | 'inline';
|
|
2
|
+
export type ChatWidgetPresentation = 'overlay' | 'sidePanel' | 'inline';
|
|
3
|
+
export type ChatWidgetMobilePresentation = 'fullscreen' | 'default';
|
|
2
4
|
export type ChatWidgetSide = 'left' | 'right';
|
|
3
5
|
export type ChatWidgetTheme = 'light' | 'dark' | 'system';
|
|
4
6
|
export type ChatColorScheme = {
|
|
@@ -22,6 +24,18 @@ export type ChatColorScheme = {
|
|
|
22
24
|
scrim?: string;
|
|
23
25
|
};
|
|
24
26
|
export type ChatWidgetProps = {
|
|
27
|
+
/**
|
|
28
|
+
* Preferred layout API for new integrations.
|
|
29
|
+
*
|
|
30
|
+
* - `overlay`: viewport-docked floating panel over host content.
|
|
31
|
+
* - `sidePanel`: viewport-docked panel intended for hosts that reserve side space.
|
|
32
|
+
* - `inline`: embedded panel inside the host layout.
|
|
33
|
+
*/
|
|
34
|
+
presentation?: ChatWidgetPresentation;
|
|
35
|
+
/**
|
|
36
|
+
* Legacy layout API retained for existing integrations.
|
|
37
|
+
* New side-panel integrations should prefer `presentation="sidePanel"`.
|
|
38
|
+
*/
|
|
25
39
|
mode?: ChatWidgetMode;
|
|
26
40
|
dockMode?: 'page' | 'viewport';
|
|
27
41
|
side?: ChatWidgetSide;
|
|
@@ -44,11 +58,13 @@ export type ChatWidgetProps = {
|
|
|
44
58
|
minWidthPx?: number;
|
|
45
59
|
maxWidthPx?: number;
|
|
46
60
|
onWidthChange?: (width: string) => void;
|
|
61
|
+
mobileBreakpointPx?: number;
|
|
62
|
+
mobilePresentation?: ChatWidgetMobilePresentation;
|
|
47
63
|
showBackdrop?: boolean;
|
|
48
64
|
closeOnOutsideClick?: boolean;
|
|
49
65
|
onNewChat?: () => void;
|
|
50
66
|
className?: string;
|
|
51
67
|
children?: React.ReactNode;
|
|
52
68
|
};
|
|
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
|
|
69
|
+
export declare function ChatWidget({ presentation, mode, dockMode, side, title, titleIconUrl, open, defaultOpen, onOpenChange, theme, colorScheme, colorSchemes, tabIcon, tabLabel, tabTooltipOpen, tabTooltipClose, tabIconUrl, tabHeightPercent, width, resizable, minWidthPx, maxWidthPx, onWidthChange, mobileBreakpointPx, mobilePresentation, showBackdrop, closeOnOutsideClick, onNewChat, className, children, }: ChatWidgetProps): import("react").JSX.Element;
|
|
54
70
|
//# 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,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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, }) {
|
|
15
|
+
export function ChatWidget({ presentation, 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, mobileBreakpointPx = 720, mobilePresentation = 'fullscreen', 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));
|
|
19
|
+
const [isMobileViewport, setIsMobileViewport] = useState(false);
|
|
19
20
|
const panelRef = useRef(null);
|
|
20
21
|
const client = useAIClient();
|
|
21
22
|
const isControlled = typeof open === 'boolean';
|
|
22
23
|
const isOpen = isControlled ? Boolean(open) : internalOpen;
|
|
24
|
+
const effectivePresentation = presentation ?? (mode === 'inline' ? (dockMode === 'viewport' ? 'sidePanel' : 'inline') : 'overlay');
|
|
25
|
+
const effectiveMode = effectivePresentation === 'overlay' ? 'overlay' : 'inline';
|
|
26
|
+
const effectiveDockMode = effectivePresentation === 'inline' ? dockMode : 'viewport';
|
|
27
|
+
const isFullscreenMobile = isMobileViewport && mobilePresentation === 'fullscreen';
|
|
28
|
+
const canResize = resizable && !isFullscreenMobile;
|
|
23
29
|
useEffect(() => {
|
|
24
30
|
setInternalWidth(typeof width === 'number' ? `${width}px` : String(width));
|
|
25
31
|
}, [width]);
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (typeof window === 'undefined') {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const mql = window.matchMedia(`(max-width: ${Math.max(1, mobileBreakpointPx)}px)`);
|
|
37
|
+
const onChange = () => setIsMobileViewport(mql.matches);
|
|
38
|
+
onChange();
|
|
39
|
+
mql.addEventListener('change', onChange);
|
|
40
|
+
return () => mql.removeEventListener('change', onChange);
|
|
41
|
+
}, [mobileBreakpointPx]);
|
|
26
42
|
useEffect(() => {
|
|
27
43
|
setResolvedTheme(resolveTheme(theme));
|
|
28
44
|
if (theme !== 'system' || typeof window === 'undefined') {
|
|
@@ -34,7 +50,7 @@ export function ChatWidget({ mode = 'overlay', dockMode = 'page', side = 'right'
|
|
|
34
50
|
return () => mql.removeEventListener('change', onChange);
|
|
35
51
|
}, [theme]);
|
|
36
52
|
useEffect(() => {
|
|
37
|
-
if (!isOpen ||
|
|
53
|
+
if (!isOpen || effectivePresentation !== 'overlay') {
|
|
38
54
|
return;
|
|
39
55
|
}
|
|
40
56
|
const onKeyDown = (event) => {
|
|
@@ -44,7 +60,7 @@ export function ChatWidget({ mode = 'overlay', dockMode = 'page', side = 'right'
|
|
|
44
60
|
};
|
|
45
61
|
window.addEventListener('keydown', onKeyDown);
|
|
46
62
|
return () => window.removeEventListener('keydown', onKeyDown);
|
|
47
|
-
}, [
|
|
63
|
+
}, [effectivePresentation, isOpen]);
|
|
48
64
|
const setOpen = (nextOpen) => {
|
|
49
65
|
if (!isControlled) {
|
|
50
66
|
setInternalOpen(nextOpen);
|
|
@@ -66,7 +82,7 @@ export function ChatWidget({ mode = 'overlay', dockMode = 'page', side = 'right'
|
|
|
66
82
|
onWidthChange?.(next);
|
|
67
83
|
};
|
|
68
84
|
const startResize = (event) => {
|
|
69
|
-
if (!
|
|
85
|
+
if (!canResize || !isOpen) {
|
|
70
86
|
return;
|
|
71
87
|
}
|
|
72
88
|
event.preventDefault();
|
|
@@ -74,11 +90,8 @@ export function ChatWidget({ mode = 'overlay', dockMode = 'page', side = 'right'
|
|
|
74
90
|
const startWidth = panelRef.current?.getBoundingClientRect().width ?? 0;
|
|
75
91
|
const onMove = (moveEvent) => {
|
|
76
92
|
const delta = side === 'right' ? startX - moveEvent.clientX : moveEvent.clientX - startX;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
? dockMode === 'viewport'
|
|
80
|
-
? window.innerWidth
|
|
81
|
-
: (root?.parentElement?.getBoundingClientRect().width ?? window.innerWidth)
|
|
93
|
+
const containerMaxPx = effectivePresentation === 'inline' && effectiveDockMode === 'page'
|
|
94
|
+
? (panelRef.current?.closest('.tagIt-chat-widget')?.parentElement?.getBoundingClientRect().width ?? window.innerWidth)
|
|
82
95
|
: window.innerWidth;
|
|
83
96
|
setWidthFromResize(startWidth + delta, containerMaxPx);
|
|
84
97
|
};
|
|
@@ -117,13 +130,15 @@ export function ChatWidget({ mode = 'overlay', dockMode = 'page', side = 'right'
|
|
|
117
130
|
}, [activeColorScheme, internalWidth, normalizedTabHeightPercent]);
|
|
118
131
|
return (_jsxs("div", { className: [
|
|
119
132
|
'tagIt-chat-widget',
|
|
120
|
-
`tagIt-chat-widget-${
|
|
121
|
-
`tagIt-chat-widget-
|
|
133
|
+
`tagIt-chat-widget-${effectiveMode}`,
|
|
134
|
+
`tagIt-chat-widget-presentation-${effectivePresentation}`,
|
|
135
|
+
`tagIt-chat-widget-dock-${effectiveDockMode}`,
|
|
122
136
|
isOpen ? 'tagIt-chat-widget-open' : 'tagIt-chat-widget-closed',
|
|
137
|
+
isFullscreenMobile ? 'tagIt-chat-widget-mobile-fullscreen' : '',
|
|
123
138
|
`tagIt-chat-side-${side}`,
|
|
124
139
|
`tagIt-chat-theme-${resolvedTheme}`,
|
|
125
140
|
className || '',
|
|
126
|
-
].join(' ').trim(), style: cssVars, children: [
|
|
141
|
+
].join(' ').trim(), style: cssVars, children: [effectivePresentation === 'overlay' && (showBackdrop || closeOnOutsideClick) && (_jsx("div", { className: [
|
|
127
142
|
'tagIt-chat-scrim',
|
|
128
143
|
isOpen ? 'tagIt-chat-scrim-open' : '',
|
|
129
144
|
showBackdrop ? '' : 'tagIt-chat-scrim-transparent',
|
|
@@ -136,7 +151,7 @@ export function ChatWidget({ mode = 'overlay', dockMode = 'page', side = 'right'
|
|
|
136
151
|
'tagIt-chat-tab',
|
|
137
152
|
tabLabel?.trim() ? '' : 'tagIt-chat-tab-icon-only',
|
|
138
153
|
isOpen ? 'tagIt-chat-tab-open' : '',
|
|
139
|
-
].join(' ').trim(), "aria-expanded": isOpen, "aria-label": isOpen ? `Close ${accessibleLabel}` : `Open ${accessibleLabel}`, title: hoverTitle, onClick: () => setOpen(!isOpen), children: [_jsx("span", { className: "tagIt-chat-tab-icon", "aria-hidden": true, children: isOpen ? collapseIcon : tabIconUrl ? _jsx("img", { src: tabIconUrl, alt: "" }) : tabIcon || 'AI' }), tabLabel?.trim() ? _jsx("span", { className: "tagIt-chat-tab-label", children: tabLabel }) : null] }), _jsxs("aside", { ref: panelRef, className: `tagIt-chat-panel ${isOpen ? 'tagIt-chat-panel-open' : ''}`, children: [
|
|
154
|
+
].join(' ').trim(), "aria-expanded": isOpen, "aria-label": isOpen ? `Close ${accessibleLabel}` : `Open ${accessibleLabel}`, title: hoverTitle, onClick: () => setOpen(!isOpen), children: [_jsx("span", { className: "tagIt-chat-tab-icon", "aria-hidden": true, children: isOpen ? collapseIcon : tabIconUrl ? _jsx("img", { src: tabIconUrl, alt: "" }) : tabIcon || 'AI' }), tabLabel?.trim() ? _jsx("span", { className: "tagIt-chat-tab-label", children: tabLabel }) : null] }), _jsxs("aside", { ref: panelRef, className: `tagIt-chat-panel ${isOpen ? 'tagIt-chat-panel-open' : ''}`, children: [canResize ? (_jsx("button", { type: "button", className: "tagIt-chat-resize-handle", "aria-label": "Resize chat panel", onMouseDown: startResize })) : null, _jsxs("header", { className: "tagIt-chat-panel-header", children: [_jsxs("div", { className: "tagIt-chat-panel-title-wrap", children: [titleIconUrl?.trim() ? (_jsx("img", { src: titleIconUrl, alt: "", "aria-hidden": true, className: "tagIt-chat-panel-title-icon" })) : null, _jsx("h2", { children: title })] }), _jsxs("div", { className: "tagIt-chat-panel-header-actions", children: [_jsx("button", { type: "button", className: "tagIt-chat-header-btn", "aria-label": "New chat", title: "New chat", onClick: () => {
|
|
140
155
|
if (onNewChat) {
|
|
141
156
|
onNewChat();
|
|
142
157
|
return;
|
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;AAyE5C,SAAS,YAAY,CAAC,KAAsB;IAC1C,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM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,CAAC,CAAC,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/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
export { AIClientProvider, useAIClient, useConversation, useClientEvents, } from './provider.js';
|
|
25
|
-
export { ChatWidget, type ChatWidgetProps, type ChatWidgetMode, type ChatWidgetSide, type ChatWidgetTheme, type ChatColorScheme, } from './chat-widget.js';
|
|
25
|
+
export { ChatWidget, type ChatWidgetProps, type ChatWidgetMode, type ChatWidgetPresentation, type ChatWidgetMobilePresentation, type ChatWidgetSide, type ChatWidgetTheme, type ChatColorScheme, } from './chat-widget.js';
|
|
26
26
|
export { ChatConversation, type ChatConversationProps, } from './chat-conversation.js';
|
|
27
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,UAAU,GAQX,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,GAEjB,MAAM,wBAAwB,CAAC"}
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import type { AIClient, ClientEvent, SendMessageOptions } from '@tagit/ai-client-core';
|
|
3
3
|
interface AIClientProviderProps {
|
|
4
4
|
client: AIClient;
|
|
@@ -7,7 +7,7 @@ interface AIClientProviderProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* Provider that exposes the AI client to React components
|
|
9
9
|
*/
|
|
10
|
-
export declare function AIClientProvider({ client, children }: AIClientProviderProps):
|
|
10
|
+
export declare function AIClientProvider({ client, children }: AIClientProviderProps): React.JSX.Element;
|
|
11
11
|
/**
|
|
12
12
|
* Hook to access the AI client
|
|
13
13
|
*/
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAgD,MAAM,OAAO,CAAC;AACvF,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAqB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAO1G,UAAU,qBAAqB;IAC7B,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,qBAAqB,qBAM3E;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAMtC;AAED;;GAEG;AACH,wBAAgB,eAAe;2BAaX,MAAM,YAAY,kBAAkB;;sBAWnC,kBAAkB;;+BAgBS,MAAM,KAAG,MAAM,GAAG,IAAI;;;;;;;;;;;EAcrE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,QAMrE"}
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
interface ChartRendererProps {
|
|
3
3
|
rawJson: string;
|
|
4
4
|
}
|
|
5
|
-
export declare const ChartRenderer: React.MemoExoticComponent<({ rawJson }: ChartRendererProps) =>
|
|
5
|
+
export declare const ChartRenderer: React.MemoExoticComponent<({ rawJson }: ChartRendererProps) => React.JSX.Element>;
|
|
6
6
|
export {};
|
|
7
7
|
//# sourceMappingURL=ChartRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/ChartRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA6E1B,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,0CAAkD,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ChartRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/ChartRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA6E1B,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,aAAa,0CAAkD,kBAAkB,uBAwH5F,CAAC"}
|
|
@@ -5,6 +5,6 @@ interface ContentBlockRendererProps {
|
|
|
5
5
|
content: string;
|
|
6
6
|
showStreamingCursor?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const ContentBlockRenderer: React.MemoExoticComponent<({ role, content, showStreamingCursor, }: ContentBlockRendererProps) =>
|
|
8
|
+
export declare const ContentBlockRenderer: React.MemoExoticComponent<({ role, content, showStreamingCursor, }: ContentBlockRendererProps) => React.JSX.Element>;
|
|
9
9
|
export {};
|
|
10
10
|
//# sourceMappingURL=ContentBlockRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentBlockRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/ContentBlockRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,UAAU,yBAAyB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,sEAI9B,yBAAyB,
|
|
1
|
+
{"version":3,"file":"ContentBlockRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/ContentBlockRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGzD,UAAU,yBAAyB;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,sEAI9B,yBAAyB,uBAe1B,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import 'highlight.js/styles/github-dark.css';
|
|
2
3
|
interface MarkdownRendererProps {
|
|
3
4
|
markdown: string;
|
|
4
5
|
showStreamingCursor?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare function MarkdownRenderer({ markdown, showStreamingCursor }: MarkdownRendererProps):
|
|
7
|
+
export declare function MarkdownRenderer({ markdown, showStreamingCursor }: MarkdownRendererProps): React.JSX.Element;
|
|
7
8
|
export {};
|
|
8
9
|
//# sourceMappingURL=MarkdownRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/MarkdownRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,OAAO,qCAAqC,CAAC;AAE7C,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AA6CD,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,mBAA2B,EAAE,EAAE,qBAAqB,qBA4ChG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tagit/ai-client-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"recharts": "^3.8.1",
|
|
44
44
|
"rehype-highlight": "^7.0.2",
|
|
45
45
|
"remark-gfm": "^4.0.1",
|
|
46
|
-
"@tagit/ai-client-core": "0.
|
|
46
|
+
"@tagit/ai-client-core": "0.7.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"react": "^18.0.0",
|
package/src/chat-widget.css
CHANGED
|
@@ -326,6 +326,10 @@
|
|
|
326
326
|
overflow: visible;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
+
.tagIt-chat-widget-presentation-sidePanel {
|
|
330
|
+
--tagIt-chat-side-panel-reserved-width: var(--tagIt-chat-panel-width);
|
|
331
|
+
}
|
|
332
|
+
|
|
329
333
|
.tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport.tagIt-chat-side-left {
|
|
330
334
|
left: 0;
|
|
331
335
|
right: auto;
|
|
@@ -380,42 +384,61 @@
|
|
|
380
384
|
left: auto;
|
|
381
385
|
}
|
|
382
386
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
387
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-widget,
|
|
388
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport {
|
|
389
|
+
position: fixed;
|
|
390
|
+
inset: 0;
|
|
391
|
+
width: 100vw;
|
|
392
|
+
max-width: 100vw;
|
|
393
|
+
height: 100dvh;
|
|
394
|
+
z-index: 100;
|
|
395
|
+
}
|
|
389
396
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
left: 0;
|
|
394
|
-
transform: translateY(102%);
|
|
395
|
-
}
|
|
397
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-widget-closed {
|
|
398
|
+
pointer-events: none;
|
|
399
|
+
}
|
|
396
400
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
401
|
+
.tagIt-chat-widget-mobile-fullscreen .tagIt-chat-panel {
|
|
402
|
+
position: fixed;
|
|
403
|
+
inset: 0;
|
|
404
|
+
width: 100vw;
|
|
405
|
+
max-width: 100vw;
|
|
406
|
+
height: 100dvh;
|
|
407
|
+
border-left: 0;
|
|
408
|
+
border-right: 0;
|
|
409
|
+
}
|
|
400
410
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
bottom: 18px;
|
|
408
|
-
}
|
|
411
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-side-right .tagIt-chat-panel,
|
|
412
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-side-left .tagIt-chat-panel {
|
|
413
|
+
right: 0;
|
|
414
|
+
left: 0;
|
|
415
|
+
transform: translateY(102%);
|
|
416
|
+
}
|
|
409
417
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
left: auto;
|
|
414
|
-
}
|
|
418
|
+
.tagIt-chat-widget-mobile-fullscreen .tagIt-chat-panel-open {
|
|
419
|
+
transform: translateY(0) !important;
|
|
420
|
+
}
|
|
415
421
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
422
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-side-right .tagIt-chat-tab,
|
|
423
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-side-left .tagIt-chat-tab {
|
|
424
|
+
position: fixed;
|
|
425
|
+
right: 12px;
|
|
426
|
+
left: auto;
|
|
427
|
+
top: auto;
|
|
428
|
+
bottom: 18px;
|
|
429
|
+
transform: none;
|
|
430
|
+
border-radius: 999px;
|
|
431
|
+
pointer-events: auto;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-side-right .tagIt-chat-tab-open,
|
|
435
|
+
.tagIt-chat-widget-mobile-fullscreen.tagIt-chat-side-left .tagIt-chat-tab-open {
|
|
436
|
+
right: 12px;
|
|
437
|
+
left: auto;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.tagIt-chat-widget-mobile-fullscreen .tagIt-chat-resize-handle {
|
|
441
|
+
display: none;
|
|
419
442
|
}
|
|
420
443
|
|
|
421
444
|
/* =============================================================
|