@skippr/live-agent-sdk 0.110.0 → 0.112.0

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.
@@ -1,9 +1,9 @@
1
1
  interface ConsentBubbleProps {
2
2
  className?: string;
3
3
  style?: React.CSSProperties;
4
- leadIn: string;
4
+ template: string;
5
5
  onPointerEnter?: React.PointerEventHandler<HTMLDivElement>;
6
6
  onPointerLeave?: React.PointerEventHandler<HTMLDivElement>;
7
7
  }
8
- export declare function ConsentBubble({ className, style, leadIn, onPointerEnter, onPointerLeave, }: ConsentBubbleProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ConsentBubble({ className, style, template, onPointerEnter, onPointerLeave, }: ConsentBubbleProps): import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1,7 +1,6 @@
1
1
  interface ConsentNoticeProps {
2
2
  className?: string;
3
- leadIn: string;
4
- determiner?: string;
3
+ template: string;
5
4
  }
6
- export declare function ConsentNotice({ className, leadIn, determiner }: ConsentNoticeProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function ConsentNotice({ className, template }: ConsentNoticeProps): import("react/jsx-runtime").JSX.Element;
7
6
  export {};
@@ -9,6 +9,7 @@ interface LiveAgentBaseProps {
9
9
  getUserToken?: (() => Promise<string>) | undefined;
10
10
  userToken?: string | undefined;
11
11
  userContext?: UserContext | undefined;
12
+ locale?: string | undefined;
12
13
  verticalAlign?: VerticalAlign | undefined;
13
14
  variant?: 'floating' | 'sidebar' | undefined;
14
15
  minimizable?: boolean | undefined;
@@ -4,7 +4,7 @@ interface VoiceBarFrameProps {
4
4
  pos: BarPos;
5
5
  canFold: boolean;
6
6
  notifications: BarNotification[];
7
- onDrop: (pos: BarPos) => void;
7
+ onDrop: (pos: BarPos, widthPx: number) => void;
8
8
  setDragging: (dragging: boolean) => void;
9
9
  }
10
10
  export declare function VoiceBarFrame({ pos, canFold, notifications, onDrop, setDragging, }: VoiceBarFrameProps): import("react/jsx-runtime").JSX.Element;
@@ -58,6 +58,7 @@ export interface SplashAppearance {
58
58
  overlayMode?: SplashOverlayMode;
59
59
  panelEnabled?: boolean;
60
60
  launcherVisible?: boolean;
61
+ locale?: string;
61
62
  copy?: SplashCopy;
62
63
  sections?: SplashSection[];
63
64
  attributionVisible?: boolean;
@@ -206,7 +207,7 @@ export interface LiveAgentContextValue extends LiveAgentPublicValue {
206
207
  commitLauncherDrop: (target: LauncherDropTarget) => void;
207
208
  popsDown: boolean;
208
209
  barPos: BarPos | null;
209
- setBarPos: (next: BarPos) => void;
210
+ setBarPos: (next: BarPos, widthPx: number) => void;
210
211
  launcherDock: BarDock;
211
212
  setLauncherDock: (next: BarDock) => void;
212
213
  panelExpanded: boolean;
@@ -5,6 +5,7 @@ interface UseAvailableModulesParams {
5
5
  bearerToken: string | null;
6
6
  authedFetch: AuthedFetch;
7
7
  agentId?: string | undefined;
8
+ locale?: string | undefined;
8
9
  }
9
10
  interface UseAvailableModulesResult {
10
11
  modules: Module[];
@@ -16,5 +17,5 @@ interface UseAvailableModulesResult {
16
17
  error: string | null;
17
18
  refetch: () => Promise<void>;
18
19
  }
19
- export declare function useAvailableModules({ enabled, bearerToken, authedFetch, agentId, }: UseAvailableModulesParams): UseAvailableModulesResult;
20
+ export declare function useAvailableModules({ enabled, bearerToken, authedFetch, agentId, locale, }: UseAvailableModulesParams): UseAvailableModulesResult;
20
21
  export {};
@@ -1,4 +1,4 @@
1
- import { type BarPos } from '../lib/voiceBar';
1
+ import type { BarPos } from '../lib/voiceBar';
2
2
  type FollowerRef = React.RefObject<HTMLElement | null>;
3
3
  export declare function useVoiceBarDrag(containerRef: React.RefObject<HTMLElement | null>, onDrop: (pos: BarPos) => void, followRefs?: FollowerRef[] | null, reportDragging?: (dragging: boolean) => void): {
4
4
  wasDraggedRef: React.RefObject<boolean>;
@@ -105,6 +105,11 @@ export declare const SPLASH_SURFACE: {
105
105
  };
106
106
  export type SplashSurface = (typeof SPLASH_SURFACE)[keyof typeof SPLASH_SURFACE];
107
107
  export declare const SKIPPR_OPEN_EVENT = "skippr:open";
108
+ export declare const CONSENT_TERMS_PLACEHOLDER = "{terms}";
109
+ export declare const CONSENT_PRIVACY_PLACEHOLDER = "{privacy}";
110
+ export declare const CONSENT_NOTICE_SESSION_START = "By starting a session, you agree to Skippr's {terms} & {privacy}";
111
+ export declare const CONSENT_NOTICE_CONTINUING = "By continuing, you agree to the {terms} & {privacy}";
112
+ export declare const CONSENT_NOTICE_AGENT_SESSION_START = "By starting the AI agent session, you agree to Skippr's {terms} & {privacy}";
108
113
  export declare const SPLASH_COPY_DEFAULTS: {
109
114
  readonly howItWorksHeading: "How it works";
110
115
  readonly lastAccomplishmentHeading: "Last accomplishment";
@@ -122,6 +127,20 @@ export declare const SPLASH_COPY_DEFAULTS: {
122
127
  readonly tipsCta: "Need help with something else?";
123
128
  readonly tipsEmptyTitle: "Ask about this page";
124
129
  readonly tipsEmptyDescription: "Get instant answers about anything you see here";
130
+ readonly attributionPrefix: "AI Agent Powered by";
131
+ readonly closeLabel: "Close";
132
+ readonly mediaEnableAction: "Enable";
133
+ readonly mediaEnabledStatus: "Enabled";
134
+ readonly micMutedStatus: "Muted";
135
+ readonly screenRequiredStatus: "Required";
136
+ readonly muteMicAction: "Mute microphone";
137
+ readonly consentNotice: "By starting a session, you agree to Skippr's {terms} & {privacy}";
138
+ readonly sectionRouteTitle: "Guides you step by step";
139
+ readonly sectionRouteDescription: "Walks you through each step, start to finish";
140
+ readonly sectionMessagesTitle: "Talk or type";
141
+ readonly sectionMessagesDescription: "Ask by voice or in chat";
142
+ readonly sectionPointerTitle: "Ask it to click through for you";
143
+ readonly sectionPointerDescription: "Controls the environment for you";
125
144
  };
126
145
  export type SplashCopyKey = keyof typeof SPLASH_COPY_DEFAULTS;
127
146
  export type SplashCopy = Partial<Record<SplashCopyKey, string>>;
@@ -0,0 +1,2 @@
1
+ export declare function detectLocale(configLocale: string | undefined): string | undefined;
2
+ export declare function useDetectedLocale(configLocale: string | undefined): string | undefined;
@@ -1,6 +1,7 @@
1
1
  import type { SplashAppearance } from '../context/LiveAgentContext';
2
2
  import { type SplashCopyKey, type SplashSection, type SplashSectionGlyph } from './constants';
3
3
  export interface SplashPresentation {
4
+ locale: string;
4
5
  copy: Record<SplashCopyKey, string>;
5
6
  card: {
6
7
  width: number;
@@ -11,13 +11,18 @@ export interface BarPos {
11
11
  x: number;
12
12
  y: number;
13
13
  }
14
+ export interface BarPosRatio {
15
+ xRatio: number;
16
+ yRatio: number;
17
+ }
14
18
  export type DockKind = 'launcher';
15
19
  export declare function isHorizontalEdge(edge: BarEdge): boolean;
16
20
  export declare function readSavedDock(kind: DockKind): BarDock | null;
17
21
  export declare function persistDock(kind: DockKind, dock: BarDock): void;
18
22
  export declare function readSavedBarPos(): BarPos | null;
23
+ export declare function barPosRatio(pos: BarPos): BarPosRatio;
19
24
  export declare function persistBarPos(pos: BarPos): void;
20
- export declare function clampBarPos(pos: BarPos): BarPos;
25
+ export declare function clampBarPos(pos: BarPos, widthPx: number): BarPos;
21
26
  export declare function barPopsDown(pos: BarPos): boolean;
22
27
  export declare function barLeftAligned(pos: BarPos): boolean;
23
28
  export declare function defaultBarPos(): BarPos;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skippr/live-agent-sdk",
3
- "version": "0.110.0",
3
+ "version": "0.112.0",
4
4
  "type": "module",
5
5
  "main": "dist/esm/lib-exports.js",
6
6
  "module": "dist/esm/lib-exports.js",