@saar-ai/web-widget 0.17.0 → 0.20.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.
- package/dist/avatar-face.d.ts +9 -3
- package/dist/avatar-face.d.ts.map +1 -1
- package/dist/avatar.d.ts +15 -2
- package/dist/avatar.d.ts.map +1 -1
- package/dist/chunks/{chat-DHMjOVms.js → chat-Bm4MPdY9.js} +25 -1
- package/dist/chunks/{form-fill-dom-D4ZMwxX1.js → form-fill-dom-Dxt-z0H0.js} +4 -0
- package/dist/chunks/{host-widget-BPHMVIjq.js → host-widget-kHzdanwT.js} +2037 -1333
- package/dist/concierge-shell.css +1 -1
- package/dist/dock/dock-row.d.ts +4 -2
- package/dist/dock/dock-row.d.ts.map +1 -1
- package/dist/dock/dock-sheet.d.ts.map +1 -1
- package/dist/dock/dock.d.ts +6 -0
- package/dist/dock/dock.d.ts.map +1 -1
- package/dist/dock/geometry.d.ts +1 -2
- package/dist/dock/geometry.d.ts.map +1 -1
- package/dist/form-fill/form-fill-dom.d.ts +5 -11
- package/dist/form-fill/form-fill-dom.d.ts.map +1 -1
- package/dist/generated/concierge-shell-css.d.ts.map +1 -1
- package/dist/generated/widget-css.d.ts.map +1 -1
- package/dist/host-widget.d.ts +2 -3
- package/dist/host-widget.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -15
- package/dist/messages.d.ts +17 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/next/index.js +1 -1
- package/dist/scroll-row.d.ts +29 -0
- package/dist/scroll-row.d.ts.map +1 -0
- package/dist/spoken-transcript.d.ts +23 -7
- package/dist/spoken-transcript.d.ts.map +1 -1
- package/dist/theme/derive.d.ts +71 -3
- package/dist/theme/derive.d.ts.map +1 -1
- package/dist/theme/host-tone.d.ts +0 -7
- package/dist/theme/host-tone.d.ts.map +1 -1
- package/dist/theme/index.d.ts +5 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/widget-derive.d.ts +17 -0
- package/dist/theme/widget-derive.d.ts.map +1 -0
- package/dist/theme/widget-theme-scope.d.ts +17 -0
- package/dist/theme/widget-theme-scope.d.ts.map +1 -0
- package/dist/turn-order.d.ts +2 -1
- package/dist/turn-order.d.ts.map +1 -1
- package/dist/use-voice-session.d.ts +1 -1
- package/dist/use-voice-session.d.ts.map +1 -1
- package/dist/voice-widget.d.ts +32 -2
- package/dist/voice-widget.d.ts.map +1 -1
- package/dist/widget/call-view.d.ts +176 -0
- package/dist/widget/call-view.d.ts.map +1 -0
- package/dist/widget/concierge-launcher.d.ts +26 -2
- package/dist/widget/concierge-launcher.d.ts.map +1 -1
- package/dist/widget/concierge-shell.d.ts +51 -67
- package/dist/widget/concierge-shell.d.ts.map +1 -1
- package/dist/widget/launcher-look.d.ts +37 -0
- package/dist/widget/launcher-look.d.ts.map +1 -0
- package/dist/widget/mark-look.d.ts +35 -0
- package/dist/widget/mark-look.d.ts.map +1 -0
- package/dist/widget/mark.d.ts +35 -0
- package/dist/widget/mark.d.ts.map +1 -0
- package/dist/widget/mic-button.d.ts +31 -0
- package/dist/widget/mic-button.d.ts.map +1 -0
- package/dist/widget/shell-renderer.d.ts +1 -1
- package/dist/widget/shell-renderer.d.ts.map +1 -1
- package/dist/widget/style-of.d.ts +9 -0
- package/dist/widget/style-of.d.ts.map +1 -0
- package/dist/widget/use-follow-bottom.d.ts +17 -0
- package/dist/widget/use-follow-bottom.d.ts.map +1 -0
- package/dist/widget-cards.d.ts.map +1 -1
- package/dist/widget-cart-summary.d.ts.map +1 -1
- package/dist/widget.css +1 -1
- package/package.json +23 -7
- package/src/styles/call-view.css +290 -0
- package/src/styles/concierge-shell-entry.css +11 -0
- package/src/styles/concierge.css +3 -0
- package/src/styles/mark.css +94 -0
- package/src/styles/scroll-row.css +62 -0
- package/src/styles/tokens.css +1 -1
- package/src/styles/widget-entry.css +1 -0
- package/src/styles/widget-panel.css +644 -0
- package/dist/widget/transcript-geometry.d.ts +0 -226
- package/dist/widget/transcript-geometry.d.ts.map +0 -1
package/dist/avatar-face.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { WidgetAvatar } from './avatar.js';
|
|
2
2
|
import type { BotState } from './bot-state.js';
|
|
3
3
|
/**
|
|
4
|
-
* Dispatches to whichever avatar a tenant published — `BotFace` (`'orb'`)
|
|
5
|
-
*
|
|
4
|
+
* Dispatches to whichever avatar a tenant published — `BotFace` (`'orb'`),
|
|
5
|
+
* `RopeKnot` (`'knot'`) or `Mark` (`'bars' | 'monogram' | 'dot'`) — with one shared, EXHAUSTIVE `switch` over
|
|
6
6
|
* {@link WidgetAvatar}. `concierge-shell.tsx` (the panel's `lg` slot) and
|
|
7
7
|
* `concierge-launcher.tsx` (the pill's `sm` slot) used to each hardcode
|
|
8
8
|
* their own `avatar === 'knot' ? <RopeKnot/> : <BotFace/>` ternary — fine
|
|
@@ -28,6 +28,12 @@ export interface AvatarFaceProps {
|
|
|
28
28
|
readonly messageArrived?: boolean;
|
|
29
29
|
/** `RopeKnot`-only: bumped to replay its click/message-arrived tighten pulse. */
|
|
30
30
|
readonly tightenKey?: number;
|
|
31
|
+
/** Mark-only: the agent's name, for the monogram's letter. */
|
|
32
|
+
readonly name?: string;
|
|
33
|
+
/** Mark-only: the shopper's microphone is off. */
|
|
34
|
+
readonly muted?: boolean;
|
|
35
|
+
/** Mark-only: the diameter, for a slot that draws the mark at its own size. */
|
|
36
|
+
readonly markSize?: number;
|
|
31
37
|
}
|
|
32
|
-
export declare function AvatarFace({ avatar, state, size, label, messageArrived, tightenKey, }: AvatarFaceProps): import("react").JSX.Element;
|
|
38
|
+
export declare function AvatarFace({ avatar, state, size, label, messageArrived, tightenKey, name, muted, markSize, }: AvatarFaceProps): import("react").JSX.Element;
|
|
33
39
|
//# sourceMappingURL=avatar-face.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar-face.d.ts","sourceRoot":"","sources":["../src/avatar-face.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar-face.d.ts","sourceRoot":"","sources":["../src/avatar-face.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,gFAAgF;IAChF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAKD,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,KAAK,EACL,IAAI,EACJ,KAAK,EACL,cAAc,EACd,UAAU,EACV,IAAI,EACJ,KAAK,EACL,QAAQ,GACT,EAAE,eAAe,+BAyBjB"}
|
package/dist/avatar.d.ts
CHANGED
|
@@ -3,13 +3,26 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `'orb'` is `BotFace`, the animated gradient blob this widget has always
|
|
5
5
|
* shipped. `'knot'` is `RopeKnot`, a hand-drawn rope line that ties and
|
|
6
|
-
* unties itself through the same four {@link BotState}s.
|
|
6
|
+
* unties itself through the same four {@link BotState}s. `'bars'`,
|
|
7
|
+
* `'monogram'` and `'dot'` are `widget/mark.tsx`'s flat brand mark. Kept as data,
|
|
7
8
|
* separate from the components, for the same reason `bot-state.ts` keeps
|
|
8
9
|
* `BotState` separate from `BotFace`: parsing and defaulting have to be
|
|
9
10
|
* assertable without rendering either avatar.
|
|
10
11
|
*/
|
|
11
|
-
export declare const
|
|
12
|
+
export declare const MARK_VARIANTS: readonly ['bars', 'monogram', 'dot'];
|
|
13
|
+
export type MarkVariant = (typeof MARK_VARIANTS)[number];
|
|
14
|
+
export declare const WIDGET_AVATARS: readonly ["orb", "knot", "bars", "monogram", "dot"];
|
|
12
15
|
export type WidgetAvatar = (typeof WIDGET_AVATARS)[number];
|
|
16
|
+
/**
|
|
17
|
+
* §9.1's `identity.avatar` — the drawn marks plus the two that are not drawn
|
|
18
|
+
* from a name: an `image` and `none`. `bars`, `monogram` and `dot` (added
|
|
19
|
+
* 2026-11-03) are the widget generation's marks and the default for a NEW
|
|
20
|
+
* config; the dock draws them through {@link dockAvatarFor}.
|
|
21
|
+
*/
|
|
22
|
+
export declare const WIDGET_IDENTITY_AVATARS: readonly ["orb", "knot", "bars", "monogram", "dot", "image", "none"];
|
|
23
|
+
export type WidgetIdentityAvatar = (typeof WIDGET_IDENTITY_AVATARS)[number];
|
|
24
|
+
/** The dock's face for an avatar it has no drawing for: the orb for bars and monogram, nothing for dot. */
|
|
25
|
+
export declare function dockAvatarFor(avatar: WidgetIdentityAvatar): WidgetIdentityAvatar;
|
|
13
26
|
/** What every layer in this package falls back to when a tenant never published one. */
|
|
14
27
|
export declare const DEFAULT_WIDGET_AVATAR: WidgetAvatar;
|
|
15
28
|
/** Whether a value is an avatar this widget knows how to render. Mirrors `bot-state.ts`'s `isBotState`. */
|
package/dist/avatar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../src/avatar.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../src/avatar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,YAAI,MAAM,EAAE,UAAU,EAAE,KAAK,CAAU,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,qDAA6C,CAAC;AAEzE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,sEAAgD,CAAC;AACrF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,2GAA2G;AAC3G,wBAAgB,aAAa,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CAGhF;AAED,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,EAAE,YAAoB,CAAC;AAEzD,2GAA2G;AAC3G,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE"}
|
|
@@ -309,6 +309,29 @@ var WidgetChatFillFormEventSchema = object({
|
|
|
309
309
|
fields: array(WidgetFillFormFieldSchema).min(1).max(30),
|
|
310
310
|
submit: boolean()
|
|
311
311
|
}).strict();
|
|
312
|
+
/**
|
|
313
|
+
* The widget reporting how a fill went, so the concierge can say "filled,
|
|
314
|
+
* press Send" or "the form is not on this page" (SAA-497). Enums and a count
|
|
315
|
+
* only: never a value, a selector or a control name. Client-asserted like
|
|
316
|
+
* every report; the enquiry was recorded before the fill was asked for.
|
|
317
|
+
*/
|
|
318
|
+
var WidgetFormFillReportSchema = object({
|
|
319
|
+
kind: literal("form_fill"),
|
|
320
|
+
outcome: _enum([
|
|
321
|
+
"submitted",
|
|
322
|
+
"needs-visitor",
|
|
323
|
+
"not-found",
|
|
324
|
+
"refused"
|
|
325
|
+
]),
|
|
326
|
+
filled: number().int().min(0).max(30),
|
|
327
|
+
botProtection: _enum([
|
|
328
|
+
"recaptcha",
|
|
329
|
+
"hcaptcha",
|
|
330
|
+
"turnstile",
|
|
331
|
+
"friendly-captcha",
|
|
332
|
+
"sitekey"
|
|
333
|
+
]).nullable()
|
|
334
|
+
}).strict();
|
|
312
335
|
//#endregion
|
|
313
336
|
//#region ../widget-protocol/dist/chat.js
|
|
314
337
|
/**
|
|
@@ -849,7 +872,8 @@ var WidgetChatReportSchema = discriminatedUnion("kind", [
|
|
|
849
872
|
WidgetSpotlightFailedReportSchema,
|
|
850
873
|
WidgetNavigateFailedReportSchema,
|
|
851
874
|
WidgetVariantChoiceRequestReportSchema,
|
|
852
|
-
WidgetCaptureCardReportSchema
|
|
875
|
+
WidgetCaptureCardReportSchema,
|
|
876
|
+
WidgetFormFillReportSchema
|
|
853
877
|
]);
|
|
854
878
|
/**
|
|
855
879
|
* Parse a request body's `report` field. Never throws — the caller decides
|
|
@@ -135,6 +135,7 @@ function handBack(form) {
|
|
|
135
135
|
*/
|
|
136
136
|
function fillHostForm(doc, request) {
|
|
137
137
|
const none = (outcome) => ({
|
|
138
|
+
kind: "form_fill",
|
|
138
139
|
outcome,
|
|
139
140
|
filled: 0,
|
|
140
141
|
botProtection: null
|
|
@@ -163,6 +164,7 @@ function fillHostForm(doc, request) {
|
|
|
163
164
|
if (botProtection !== null || !request.submit || filled < wanted || typeof form.requestSubmit !== "function") {
|
|
164
165
|
handBack(form);
|
|
165
166
|
return {
|
|
167
|
+
kind: "form_fill",
|
|
166
168
|
outcome: "needs-visitor",
|
|
167
169
|
filled,
|
|
168
170
|
botProtection
|
|
@@ -172,6 +174,7 @@ function fillHostForm(doc, request) {
|
|
|
172
174
|
form.reportValidity();
|
|
173
175
|
handBack(form);
|
|
174
176
|
return {
|
|
177
|
+
kind: "form_fill",
|
|
175
178
|
outcome: "needs-visitor",
|
|
176
179
|
filled,
|
|
177
180
|
botProtection: null
|
|
@@ -179,6 +182,7 @@ function fillHostForm(doc, request) {
|
|
|
179
182
|
}
|
|
180
183
|
form.requestSubmit();
|
|
181
184
|
return {
|
|
185
|
+
kind: "form_fill",
|
|
182
186
|
outcome: "submitted",
|
|
183
187
|
filled,
|
|
184
188
|
botProtection: null
|