@marketrix.ai/widget 3.8.476 → 3.8.478

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.
@@ -0,0 +1,29 @@
1
+ import { Toast } from '@base-ui/react/toast';
2
+ import React from 'react';
3
+ export declare const GREETING_TIMEOUT_MS = 8000;
4
+ export interface NotificationProviderProps {
5
+ children?: React.ReactNode;
6
+ /** The closed shadow root to portal into — a portal to document.body would leave the styles behind. */
7
+ container?: HTMLElement | null;
8
+ /** Raised above the launcher when the launcher sits at the bottom, so the two cannot overlap. */
9
+ offsetBottom?: number;
10
+ }
11
+ /**
12
+ * The one notification surface. Base UI owns the live region, the dismiss timers, hover-to-pause and
13
+ * stacking; before this the widget announced nothing to a screen reader and ran its own setTimeout.
14
+ */
15
+ export declare const NotificationProvider: React.FC<NotificationProviderProps>;
16
+ export declare const useNotifications: typeof Toast.useToastManager;
17
+ export interface WidgetNotificationsProps {
18
+ error?: string;
19
+ onClearError: () => void;
20
+ onRetry?: () => void;
21
+ greeting?: string;
22
+ greetingBody?: string;
23
+ onGreetingDismiss: () => void;
24
+ }
25
+ /**
26
+ * Drives the toasts from widget state. Both use a stable id, so `add` upserts and a re-render cannot
27
+ * stack duplicates of the same condition.
28
+ */
29
+ export declare const WidgetNotifications: React.FC<WidgetNotificationsProps>;
@@ -7,5 +7,11 @@ export interface WidgetDialogProps {
7
7
  onConfirm?: () => void;
8
8
  confirmLabel?: string;
9
9
  cancelLabel?: string;
10
+ /**
11
+ * Where focus lands on close. Base UI's default restore is broken here: it descends
12
+ * `element.shadowRoot.activeElement`, which is null for a CLOSED root, so it records the shadow
13
+ * HOST and hands focus to a host-page element on close. Naming the target sidesteps that.
14
+ */
15
+ finalFocusRef?: React.RefObject<HTMLElement | null>;
10
16
  }
11
17
  export declare const WidgetDialog: React.FC<WidgetDialogProps>;
@@ -1,7 +1,3 @@
1
1
  import React from 'react';
2
- import type { WidgetView } from '../../types';
3
- export interface ShellTabBarProps {
4
- activeView: WidgetView;
5
- onChange: (view: WidgetView) => void;
6
- }
7
- export declare const ShellTabBar: React.FC<ShellTabBarProps>;
2
+ /** Selection, roles, ids and arrow-key navigation come from Tabs.Root — see MessengerShell. */
3
+ export declare const ShellTabBar: React.FC;
@@ -1,4 +1,17 @@
1
- import type { ZodError } from 'zod';
1
+ import type { WidgetSettingsData } from '../sdk';
2
2
  export declare function isHTMLElement(element: Element | null): element is HTMLElement;
3
3
  export declare function isHTMLScriptElement(element: Element | null): element is HTMLScriptElement;
4
- export declare const invalidSettingsMessage: (error: ZodError) => string;
4
+ export type WidgetSettingsResult = {
5
+ settings: WidgetSettingsData;
6
+ invalidFields?: undefined;
7
+ } | {
8
+ settings?: undefined;
9
+ invalidFields: string[];
10
+ };
11
+ /**
12
+ * Validates and PICKS, because stripping is load-bearing: `widgetDefaultGet` returns the render
13
+ * constants too, and the settings object is spread into the widget config — passing unknown keys
14
+ * through would leak them where zod used to drop them.
15
+ */
16
+ export declare function parseWidgetSettings(value: unknown): WidgetSettingsResult;
17
+ export declare const invalidSettingsMessage: (invalidFields: string[]) => string;