@marketrix.ai/widget 4.0.112 → 4.0.114
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/dist/src/components/blocks/WidgetFab.d.ts +6 -3
- package/dist/src/components/views/ChatView.d.ts +3 -1
- package/dist/src/context/WidgetProviders.d.ts +8 -4
- package/dist/src/utils/log.d.ts +2 -0
- package/dist/widget.mjs +64 -64
- package/package.json +1 -1
- package/dist/src/test/a11y-utils.d.ts +0 -1
- package/dist/src/test/fixtures.d.ts +0 -10
- package/dist/src/test/renderWidget.d.ts +0 -6
|
@@ -8,9 +8,12 @@
|
|
|
8
8
|
* picks — the same data-attribute variant convention every other component here uses. The two icon
|
|
9
9
|
* layers carry only their own transform and opacity; the transition they share is `.mtx-fab-icon-layer`.
|
|
10
10
|
*
|
|
11
|
-
* `useDragSnap` (below) drags this launcher and snaps it to the nearest corner
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* `useDragSnap` (below) drags this launcher and snaps it to the nearest corner over ONE Pointer Events
|
|
12
|
+
* path (`onPointerDown/Move/Up/Cancel` — no separate mouse/touch handlers, since Pointer Events already
|
|
13
|
+
* unify both). Pointer state is tracked in a ref; movement under DRAG_THRESHOLD_PX stays a click, beyond
|
|
14
|
+
* it the wrapper is translated on a rAF loop with velocity sampled into `velocityHistoryRef` so a flick
|
|
15
|
+
* lands where it was heading — `projectFlickVelocity` (module-level, pure) turns that sample history into
|
|
16
|
+
* a projected pixel delta. On release
|
|
14
17
|
* `getNearestCornerByTranslation` picks the corner, the wrapper animates there for SNAP_DURATION_MS via
|
|
15
18
|
* `left`/`top` transitions, and `commitPositionAfterAnimation` calls `onPositionCommit` on
|
|
16
19
|
* `transitionend` (with a timeout fallback, since a hidden tab fires no transition events) — the
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
* `useScreenShare` (this file's only other consumer) owns the screen-share lifecycle: the in-transcript
|
|
22
22
|
* permission card, the browser picker, the live share message, and ending a share. `useLatest` keeps a
|
|
23
|
-
* value readable from a callback that must not be re-created (the polling interval below, mounted once)
|
|
23
|
+
* value readable from a callback that must not be re-created (the polling interval below, mounted once);
|
|
24
|
+
its refs are listed in that effect's deps for the linter, but since `useRef` identity never changes,
|
|
25
|
+
listing them cannot re-arm the interval.
|
|
24
26
|
* The hook returns `requestScreenAccess` — posting a request card carrying the queued turn, no-oping if
|
|
25
27
|
* one is already open — plus that card's Allow/Deny handlers, the toolbar dialog's Allow/Dismiss
|
|
26
28
|
* handlers, and `toggleScreenShareRef`, a toggle stopping a live share or opening that dialog.
|
|
@@ -13,10 +13,14 @@
|
|
|
13
13
|
* mounted before the read, its first effect would overwrite the stored transcript on every remount.
|
|
14
14
|
* `previewMode` skips init entirely: no chat session is minted, no stream opened, nothing persisted.
|
|
15
15
|
*
|
|
16
|
-
* The init effect
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* The init effect lists `previewMode`, `uiActions` and `chatActions` for the linter, but runs once per
|
|
17
|
+
* mount in practice — `uiActions` is a `useMemo([])` and `chatActions` bottoms out in `commit`
|
|
18
|
+
* (`useCallback([])`), both stable for the component's lifetime, and `previewMode` is fixed by the
|
|
19
|
+
* caller. `cancelled` drops the connect when a StrictMode double-invoke or an unmount cleans up before
|
|
20
|
+
* the chat_id resolves. `streamClient.connect` never rejects — it catches internally and owns its own
|
|
21
|
+
* backoff reconnect and warn-level log — so the call here is fire-and-forget; a failed INIT (the
|
|
22
|
+
* snapshot restore or `getOrCreateChatId`) is the one thing this bridge logs and surfaces through
|
|
23
|
+
* `uiActions.setError`.
|
|
20
24
|
*/
|
|
21
25
|
import React from 'react';
|
|
22
26
|
export declare const PortalContainerContext: React.Context<HTMLElement | null>;
|