@marketrix.ai/widget 4.0.113 → 4.0.115

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.
@@ -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's deps are empty on purpose — once per mount — and `cancelled` drops the connect when
17
- * a StrictMode double-invoke or an unmount cleans up before the chat_id resolves. A failed connect is
18
- * logged only, since `StreamClient` owns the backoff reconnect; a failed init is logged AND surfaced
19
- * through `uiActions.setError`.
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>;
@@ -8,7 +8,10 @@
8
8
  *
9
9
  * `LAYER_TOKENS` is the z-index ladder (screen-edge glow < panel < dialog < toast), based just above the
10
10
  * 2^31-ish ceiling most host pages use so the widget sits over everything without the values overflowing a
11
- * 32-bit int.
11
+ * 32-bit int. `showHighlight`/`showPopup` are a separate, much higher pair near the int32 ceiling: Show
12
+ * mode's coaching overlay (`ShowModeService`) mounts to the HOST page, outside the shadow root, to point at
13
+ * the widget's OWN chrome — it must outrank every value in this ladder by a wide margin, not sit one step
14
+ * above `toast`.
12
15
  */
13
16
  import type { CSSProperties } from 'react';
14
17
  export type RadiusToken = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'pill';
@@ -33,6 +36,8 @@ export declare const LAYER_TOKENS: {
33
36
  panel: number;
34
37
  dialog: number;
35
38
  toast: number;
39
+ showHighlight: number;
40
+ showPopup: number;
36
41
  };
37
42
  export declare const notificationToneStyles: Record<NotificationTone, {
38
43
  background: string;
@@ -17,6 +17,9 @@
17
17
  * highlight is sized and placed over its element, so the first paint and every reposition run through it;
18
18
  * placement takes the first of right/left/above/below that fits then clamps, its 120px height an assumption,
19
19
  * and the watchdog tests `document.body.contains` first, covering removal as well as occlusion.
20
+ * `ACCENT_COLOR`/`TEXT_COLOR` are raw literals rather than design-system tokens: the highlight and popup
21
+ * mount to `document.body` on the HOST page, outside the shadow root, so `index.css`'s `:host`-scoped
22
+ * CSS custom properties never reach them.
20
23
  */
21
24
  interface ShowModeOptions {
22
25
  element: HTMLElement;
@@ -0,0 +1,2 @@
1
+ export declare function logWarn(message: string, cause?: unknown): void;
2
+ export declare function logError(message: string, cause?: unknown): void;