@agentforge-io/chat-sdk 2.4.0-dev.6 → 2.4.0-dev.7

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.
Files changed (2) hide show
  1. package/dist/ChatDrawer.js +16 -8
  2. package/package.json +1 -1
@@ -45,7 +45,14 @@ const react_1 = require("react");
45
45
  const react_dom_1 = require("react-dom");
46
46
  const react_2 = require("./react");
47
47
  function ChatDrawer(props) {
48
- const { open, onOpenChange, snap = 0.98, header, closeOnBackdropClick = true, drawerClassName, surfaceStyle: surfaceStyleProp, widgetProps, chatSlot, } = props;
48
+ const { open, onOpenChange, snap = 1, header, closeOnBackdropClick = true, drawerClassName, surfaceStyle: surfaceStyleProp, widgetProps, chatSlot, } = props;
49
+ // `fullscreen` mode: snap=1 (the default). The drawer occupies the
50
+ // entire visible viewport. We disable drag-to-dismiss, the backdrop,
51
+ // the rounded top corners, and the drag handle in this mode — they
52
+ // exist purely for the bottom-sheet form factor (snap<1) where the
53
+ // page peeks behind the surface. With snap=1 there's nothing behind
54
+ // and no affordance to drag against.
55
+ const fullscreen = snap >= 1;
49
56
  // We mount once and keep alive across close→reopen so the chat session
50
57
  // doesn't get destroyed. After the FIRST open the panel stays in the
51
58
  // DOM forever (toggled by `display:none`) — `hasOpened` gates the
@@ -197,13 +204,13 @@ function ChatDrawer(props) {
197
204
  inset: 0,
198
205
  zIndex: 2147483600,
199
206
  pointerEvents: open ? 'auto' : 'none',
200
- }, children: [(0, jsx_runtime_1.jsx)("div", { className: "af-drawer-backdrop", onClick: closeOnBackdropClick ? () => onOpenChange(false) : undefined, style: {
207
+ }, children: [!fullscreen && ((0, jsx_runtime_1.jsx)("div", { className: "af-drawer-backdrop", onClick: closeOnBackdropClick ? () => onOpenChange(false) : undefined, style: {
201
208
  position: 'absolute',
202
209
  inset: 0,
203
210
  backgroundColor: 'rgba(0, 0, 0, 0.4)',
204
211
  opacity: open ? 1 : 0,
205
212
  transition: 'opacity 200ms ease-out',
206
- }, "aria-hidden": true }), (0, jsx_runtime_1.jsxs)("div", { ref: surfaceRef, id: panelId, role: "dialog", "aria-modal": "true", className: `af-drawer-surface ${drawerClassName ?? ''}`, style: {
213
+ }, "aria-hidden": true })), (0, jsx_runtime_1.jsxs)("div", { ref: surfaceRef, id: panelId, role: "dialog", "aria-modal": "true", className: `af-drawer-surface ${drawerClassName ?? ''}`, style: {
207
214
  position: 'absolute',
208
215
  left: 0,
209
216
  right: 0,
@@ -216,9 +223,10 @@ function ChatDrawer(props) {
216
223
  // the correct path.
217
224
  backgroundColor: 'var(--af-bg, #ffffff)',
218
225
  color: 'var(--af-fg, inherit)',
219
- borderTopLeftRadius: '16px',
220
- borderTopRightRadius: '16px',
221
- boxShadow: '0 -8px 24px rgba(15, 23, 42, 0.25)',
226
+ // Bottom-sheet visuals only — fullscreen mode is flat.
227
+ borderTopLeftRadius: fullscreen ? 0 : '16px',
228
+ borderTopRightRadius: fullscreen ? 0 : '16px',
229
+ boxShadow: fullscreen ? 'none' : '0 -8px 24px rgba(15, 23, 42, 0.25)',
222
230
  display: 'flex',
223
231
  flexDirection: 'column',
224
232
  overflow: 'hidden',
@@ -227,7 +235,7 @@ function ChatDrawer(props) {
227
235
  // `height` declarations a careless host might pass.
228
236
  ...surfaceStyleProp,
229
237
  ...surfaceMotionStyle,
230
- }, children: [(0, jsx_runtime_1.jsx)("div", { onPointerDown: onHandlePointerDown, onPointerMove: onHandlePointerMove, onPointerUp: onHandlePointerUp, onPointerCancel: onHandlePointerUp, style: {
238
+ }, children: [!fullscreen && ((0, jsx_runtime_1.jsx)("div", { onPointerDown: onHandlePointerDown, onPointerMove: onHandlePointerMove, onPointerUp: onHandlePointerUp, onPointerCancel: onHandlePointerUp, style: {
231
239
  padding: '10px 0',
232
240
  cursor: 'grab',
233
241
  touchAction: 'none',
@@ -240,5 +248,5 @@ function ChatDrawer(props) {
240
248
  borderRadius: '999px',
241
249
  backgroundColor: 'var(--af-muted, rgba(100, 116, 139, 0.45))',
242
250
  display: 'block',
243
- } }) }), header, (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: chatSlot ?? (widgetProps ? ((0, jsx_runtime_1.jsx)(react_2.ChatWidget, { ...widgetProps, inline: true, variant: widgetProps.variant ?? 'bare' })) : null) })] })] }), portalEl);
251
+ } }) })), header, (0, jsx_runtime_1.jsx)("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: chatSlot ?? (widgetProps ? ((0, jsx_runtime_1.jsx)(react_2.ChatWidget, { ...widgetProps, inline: true, variant: widgetProps.variant ?? 'bare' })) : null) })] })] }), portalEl);
244
252
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/chat-sdk",
3
- "version": "2.4.0-dev.6",
3
+ "version": "2.4.0-dev.7",
4
4
  "description": "Framework-free chat session SDK for AgentForge public chat tokens. Headless — no DOM. Drop into any frontend (React, Vue, Svelte, vanilla) and listen for events.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",