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

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 +32 -7
  2. package/package.json +1 -1
@@ -192,13 +192,38 @@ function ChatDrawer(props) {
192
192
  // Motion / sizing portion of the surface style, kept separate from
193
193
  // the host-supplied theming so a re-render driven by drag offset
194
194
  // doesn't smash the host's CSS vars.
195
- const surfaceMotionStyle = {
196
- height: `${drawerHeight}px`,
197
- transform: `translate3d(0, ${translateY}, 0)`,
198
- bottom: `${vv.offsetTop}px`,
199
- transition: isDragging ? 'none' : 'transform 240ms cubic-bezier(.32,.72,0,1)',
200
- willChange: 'transform',
201
- };
195
+ //
196
+ // Two distinct positioning modes:
197
+ //
198
+ // **fullscreen (snap=1)**: pin the surface to the VISUAL viewport
199
+ // box. `top = visualViewport.offsetTop` + `height = visualViewport.h`
200
+ // means the drawer sits exactly on the area the user can see, with
201
+ // the bottom edge flush against the on-screen keyboard (when it's up)
202
+ // or the bottom of the screen (when it's down). No layout viewport
203
+ // gymnastics needed.
204
+ //
205
+ // **bottom-sheet (snap<1)**: anchor the surface to the bottom of the
206
+ // visual viewport. `bottom = visualViewport.offsetTop` is the legacy
207
+ // path that handles the rubber-band scroll case on iOS Safari.
208
+ const surfaceMotionStyle = fullscreen
209
+ ? {
210
+ top: `${vv.offsetTop}px`,
211
+ height: `${vv.h}px`,
212
+ transform: `translate3d(0, ${translateY}, 0)`,
213
+ transition: isDragging
214
+ ? 'none'
215
+ : 'transform 240ms cubic-bezier(.32,.72,0,1)',
216
+ willChange: 'transform',
217
+ }
218
+ : {
219
+ height: `${drawerHeight}px`,
220
+ transform: `translate3d(0, ${translateY}, 0)`,
221
+ bottom: `${vv.offsetTop}px`,
222
+ transition: isDragging
223
+ ? 'none'
224
+ : 'transform 240ms cubic-bezier(.32,.72,0,1)',
225
+ willChange: 'transform',
226
+ };
202
227
  return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsxs)("div", { className: "af-drawer-root", "data-state": open ? 'open' : 'closed', style: {
203
228
  position: 'fixed',
204
229
  inset: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/chat-sdk",
3
- "version": "2.4.0-dev.7",
3
+ "version": "2.4.0-dev.8",
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",