@saar-ai/web-widget 0.17.0 → 0.18.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/{host-widget-BPHMVIjq.js → host-widget-BhtqtvaY.js} +1833 -1322
- 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.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/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 +4 -4
- package/dist/messages.d.ts +4 -3
- package/dist/messages.d.ts.map +1 -1
- package/dist/next/index.js +1 -1
- package/dist/spoken-transcript.d.ts +21 -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/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 +146 -0
- package/dist/widget/call-view.d.ts.map +1 -0
- package/dist/widget/concierge-launcher.d.ts +21 -2
- package/dist/widget/concierge-launcher.d.ts.map +1 -1
- package/dist/widget/concierge-shell.d.ts +49 -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 +27 -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.css +1 -1
- package/package.json +14 -2
- package/src/styles/call-view.css +280 -0
- package/src/styles/concierge-shell-entry.css +10 -0
- package/src/styles/mark.css +94 -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/messages.d.ts
CHANGED
|
@@ -283,9 +283,10 @@ export interface WidgetMessages {
|
|
|
283
283
|
*/
|
|
284
284
|
readonly cart_add_failed?: string;
|
|
285
285
|
/**
|
|
286
|
-
* The one-word
|
|
287
|
-
*
|
|
288
|
-
*
|
|
286
|
+
* The one-word call state: the widget's header pill while the call view is
|
|
287
|
+
* not shown, and the call view's header word — see
|
|
288
|
+
* `ConciergeShellVoice.labels`'s matching four keys and the pill's own doc
|
|
289
|
+
* comment in `concierge-shell.tsx`. Optional, like every key
|
|
289
290
|
* added after 0.2.0 (see `handoff_event` above for the compatibility
|
|
290
291
|
* contract this follows).
|
|
291
292
|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AC,CAGhG"}
|
package/dist/next/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as ConciergeWidget,
|
|
1
|
+
import { i as ConciergeWidget, x as detectPage } from "../chunks/host-widget-BhtqtvaY.js";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
3
|
import { usePathname, useRouter } from "next/navigation";
|
|
4
4
|
//#region src/next/use-next-bridge.ts
|
|
@@ -20,11 +20,22 @@ import type { TranscriptPayload } from '@saar-ai/widget-protocol/telemetry';
|
|
|
20
20
|
* `truncated` is set when a settled agent frame came in SHORTER than the
|
|
21
21
|
* provisional line it replaced. Settled text is what the caller heard, so a
|
|
22
22
|
* shorter one means playout stopped early: a barge-in. It is the fallback for
|
|
23
|
-
* a worker that sends no `turn.latency` `interruptedBy`.
|
|
23
|
+
* a worker that sends no `turn.latency` `interruptedBy`. `dropped` is how many
|
|
24
|
+
* words of the provisional line went unspoken.
|
|
24
25
|
*/
|
|
25
26
|
export type SpokenLine = TranscriptPayload & {
|
|
26
27
|
readonly truncated?: true;
|
|
28
|
+
readonly dropped?: number;
|
|
27
29
|
};
|
|
30
|
+
/** The words of `provisional` after the `settled` prefix the caller heard. */
|
|
31
|
+
export declare function droppedWords(settled: string, provisional: string): number;
|
|
32
|
+
/**
|
|
33
|
+
* A cut line is tagged "Interrupted" only when the worker reported the turn
|
|
34
|
+
* interrupted, or at least this many words went unspoken. A finished reply
|
|
35
|
+
* can settle a word or two shorter than its provisional text without anyone
|
|
36
|
+
* cutting in.
|
|
37
|
+
*/
|
|
38
|
+
export declare const CUT_TAG_MIN_DROPPED_WORDS = 3;
|
|
28
39
|
/** Up to this many words counts as "very little spoken". */
|
|
29
40
|
export declare const NEGLIGIBLE_REPLY_MAX_WORDS = 3;
|
|
30
41
|
/**
|
|
@@ -50,13 +61,16 @@ export declare function isNegligibleText(raw: string): boolean;
|
|
|
50
61
|
/** The character cap for a single run with no spaces. */
|
|
51
62
|
export declare const NEGLIGIBLE_UNSPACED_MAX_CHARS = 8;
|
|
52
63
|
/**
|
|
53
|
-
* Which settled agent lines were cut off
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* Fillers are never replies.
|
|
64
|
+
* Which settled agent lines were cut off by the caller. A line counts as cut
|
|
65
|
+
* off when the hook saw it truncated, or when the worker reported its turn
|
|
66
|
+
* interrupted and it is that turn's LAST agent line (`interruptedBy` covers
|
|
67
|
+
* the turn; earlier lines of it finished). Fillers are never replies.
|
|
58
68
|
*/
|
|
59
|
-
export declare function
|
|
69
|
+
export declare function cutLineIndexes(lines: readonly SpokenLine[], interrupted: ReadonlySet<string>): ReadonlySet<number>;
|
|
70
|
+
/** The cut-off lines ({@link cutLineIndexes}) that draw the "Interrupted" tag. */
|
|
71
|
+
export declare function taggedCutIndexes(lines: readonly SpokenLine[], cut: ReadonlySet<number>, interrupted: ReadonlySet<string>): ReadonlySet<number>;
|
|
72
|
+
/** The cut-off lines ({@link cutLineIndexes}) with so little spoken that they draw nothing. */
|
|
73
|
+
export declare function negligibleLineIndexes(lines: readonly SpokenLine[], cut: ReadonlySet<number>): ReadonlySet<number>;
|
|
60
74
|
/** The fields of a typed turn the echo check reads. */
|
|
61
75
|
export interface EchoCandidate {
|
|
62
76
|
readonly speaker: 'caller' | 'agent' | 'event';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spoken-transcript.d.ts","sourceRoot":"","sources":["../src/spoken-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E
|
|
1
|
+
{"version":3,"file":"spoken-transcript.d.ts","sourceRoot":"","sources":["../src/spoken-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAE5E;;;;;;;;;GASG;AACH,MAAM,MAAM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ACvB,WAAW,CAAC,MAAM,CAAC,CAErB;AAED,uDAAuD;AACvD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,WAAW,CAAC,MAAM,CAAC,CAkBrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EAC7C,MAAM,EAAE,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,GAC5C,MAAM,GAAG,IAAI,CAIf"}
|
package/dist/theme/derive.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export interface WidgetColorConfig {
|
|
|
8
8
|
accent?: string;
|
|
9
9
|
surface?: string;
|
|
10
10
|
tone: WidgetTone;
|
|
11
|
+
/** `true` ⇒ the widget generation's panel is translucent over a static blur. Absent ⇒ `false`. */
|
|
12
|
+
glass?: boolean;
|
|
11
13
|
}
|
|
12
14
|
/** §9.1's `type` group. */
|
|
13
15
|
export interface WidgetTypeConfig {
|
|
@@ -57,6 +59,64 @@ export declare const SYSTEM_FONT_STACK = "system-ui, -apple-system, \"Segoe UI\"
|
|
|
57
59
|
*/
|
|
58
60
|
export declare const SHEET_RADIUS_MAX_PX = 20;
|
|
59
61
|
export declare const CARD_RADIUS_MAX_PX = 12;
|
|
62
|
+
/** §9.3's floor for derived text on the surface. */
|
|
63
|
+
export declare const TEXT_CONTRAST_MIN = 4.5;
|
|
64
|
+
/**
|
|
65
|
+
* The focus ring for a given surface: the brand primary itself wherever that
|
|
66
|
+
* clears §11's 3:1, and otherwise the primary walked in OKLCH lightness —
|
|
67
|
+
* hue and chroma held — until it does.
|
|
68
|
+
*
|
|
69
|
+
* WHY THE RING IS NO LONGER TRANSLUCENT. §9.2's table says "primary at 35 %
|
|
70
|
+
* alpha", and `outline-offset: 2px` in `concierge.css` puts every focus ring
|
|
71
|
+
* OUTSIDE its control's border box, over a row, pill or sheet painted
|
|
72
|
+
* `--wgt-surface`. A translucent fill over an opaque backdrop is a blend, and
|
|
73
|
+
* the blend is what the shopper's eye receives — so the blend is what §11's
|
|
74
|
+
* 3:1 has to be measured on. At 35 % alpha that number is unreachable for
|
|
75
|
+
* EVERY primary in sRGB on a white surface: black, the most extreme ink
|
|
76
|
+
* available, composites to `#a6a6a6` and tops out at 2.43:1, and the default
|
|
77
|
+
* `#4c1d50` manages 2.05:1 while the spec's own reference teal `#39b6ae`
|
|
78
|
+
* manages 1.36:1. 3:1 against white needs a blended relative luminance at or
|
|
79
|
+
* below 0.30 and 35 %-over-white cannot go under 0.38, so no choice of
|
|
80
|
+
* primary rescues it. The alpha therefore has to go; §9.2's table is a
|
|
81
|
+
* derivation that was never checked against §11's floor.
|
|
82
|
+
*
|
|
83
|
+
* WHY DROPPING THE ALPHA IS NOT THE WHOLE FIX. It is tempting to stop at an
|
|
84
|
+
* opaque primary and lean on §9.3, which asserts `primary` vs `surface`
|
|
85
|
+
* >= 3:1 at publish — and where that assertion covers the surface being
|
|
86
|
+
* rendered it is exactly enough, including at the boundary, because both
|
|
87
|
+
* floors are the same 3 and both are `>=`, so a tenant sitting precisely on
|
|
88
|
+
* 3.00:1 gets a legal ring rather than a rounding argument. It does not cover
|
|
89
|
+
* every surface we render, though:
|
|
90
|
+
*
|
|
91
|
+
* - `tone: 'auto'` emits TWO token sets. `WidgetConfigsService` checks both
|
|
92
|
+
* defaults when no surface is supplied, but when one IS supplied it
|
|
93
|
+
* checks only that colour — and {@link deriveTheme} replaces a supplied
|
|
94
|
+
* LIGHT surface with `#141414` in the dark block, which nothing ever
|
|
95
|
+
* asserted the primary against. The default `#4c1d50` is 13.13:1 on white
|
|
96
|
+
* and 1.40:1 on `#141414`.
|
|
97
|
+
* - `deriveTheme` also runs on input that has not been published: the
|
|
98
|
+
* console's live preview derives a theme from whatever the merchant has
|
|
99
|
+
* typed so far, and it must not paint an invisible focus ring while they
|
|
100
|
+
* are still choosing a colour.
|
|
101
|
+
*
|
|
102
|
+
* A guarantee that holds only because a different service checked first is
|
|
103
|
+
* not one this module can state, so it is made true here instead.
|
|
104
|
+
*
|
|
105
|
+
* WHY LIGHTNESS AND NOT SOMETHING ELSE. The ring still has to read as the
|
|
106
|
+
* brand. Holding OKLCH hue and chroma and moving only lightness keeps the
|
|
107
|
+
* colour recognisably the same one — a teal ring stays teal, it just gets
|
|
108
|
+
* dark enough to see — where a jump to black or to a computed complement
|
|
109
|
+
* would not. The step is the same 0.01 walk {@link deriveText} uses, and it
|
|
110
|
+
* converges in a handful of iterations; chroma is gamut-reduced on the way
|
|
111
|
+
* out by `oklchToHex`, which is what keeps a rotated-into-nowhere colour from
|
|
112
|
+
* clipping sideways in hue.
|
|
113
|
+
*
|
|
114
|
+
* The preferred direction is away from the surface's own lightness, with the
|
|
115
|
+
* opposite direction as a fallback for the same reason `deriveText` has one:
|
|
116
|
+
* a mid-lightness surface can be unreachable from one side and comfortable
|
|
117
|
+
* from the other.
|
|
118
|
+
*/
|
|
119
|
+
export declare function deriveRing(primaryHex: string, surfaceHex: string, floor?: number): string;
|
|
60
120
|
/**
|
|
61
121
|
* Derive every `--wgt-*` token from the published `color` + `type` groups.
|
|
62
122
|
*
|
|
@@ -86,14 +146,22 @@ export declare function deriveTheme(color: WidgetColorConfig, type: WidgetTypeCo
|
|
|
86
146
|
* `:host` is the default because the dock lives in a shadow root; pass a class
|
|
87
147
|
* or `:root` for the console preview, which renders in light DOM.
|
|
88
148
|
*/
|
|
89
|
-
export declare function themeToCss(theme: DerivedWidgetTheme, selector?: string): string;
|
|
149
|
+
export declare function themeToCss(theme: DerivedWidgetTheme, selector?: string, tokens?: readonly string[]): string;
|
|
90
150
|
/**
|
|
91
151
|
* For an element that carries its own token block inside the shadow root
|
|
92
152
|
* (the React dock's `[data-wgt-scope]`): the same marks, one level up, so the
|
|
93
153
|
* host page's tone beats the media query on that element too. Matches
|
|
94
154
|
* nothing in light DOM. Empty unless the tone is `auto`.
|
|
95
155
|
*/
|
|
96
|
-
export declare function themeToMarkedHostCss(theme: DerivedWidgetTheme, selector: string): string;
|
|
156
|
+
export declare function themeToMarkedHostCss(theme: DerivedWidgetTheme, selector: string, tokens?: readonly string[]): string;
|
|
157
|
+
/**
|
|
158
|
+
* The tenant's tokens for one scoped element (`[data-wgt-scope]`), with the
|
|
159
|
+
* host's tone marks on it; `host` adds a `:host` block first, for an element
|
|
160
|
+
* that renders in a shadow root as well as in light DOM. Two blocks with the
|
|
161
|
+
* same body rather than one selector list, because one invalid selector
|
|
162
|
+
* invalidates a whole rule.
|
|
163
|
+
*/
|
|
164
|
+
export declare function scopedThemeCss(theme: DerivedWidgetTheme, scope: string, tokens?: readonly string[], host?: boolean): string;
|
|
97
165
|
/**
|
|
98
166
|
* The theme as a `style` attribute value, for the `core` stage — which paints
|
|
99
167
|
* the resting row before any stylesheet, adopted or otherwise, exists.
|
|
@@ -103,5 +171,5 @@ export declare function themeToMarkedHostCss(theme: DerivedWidgetTheme, selector
|
|
|
103
171
|
* current `prefers-color-scheme` and the adopted stylesheet takes over the
|
|
104
172
|
* responsiveness at the React handover.
|
|
105
173
|
*/
|
|
106
|
-
export declare function themeToInlineStyle(vars:
|
|
174
|
+
export declare function themeToInlineStyle(vars: Record<string, string>, tokens?: readonly string[]): string;
|
|
107
175
|
//# sourceMappingURL=derive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/theme/derive.ts"],"names":[],"mappings":"AAyCA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,4BAA4B;AAC5B,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../src/theme/derive.ts"],"names":[],"mappings":"AAyCA,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;AAC9C,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,4BAA4B;AAC5B,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,kGAAkG;IAClG,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,2BAA2B;AAC3B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;;;GAIG;AAiBH,eAAO,MAA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,oBAAoB,CAClC,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,SAAS,MAAM,EAAwB,GAC9C,MAAM,CAGR;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,kBAAkB,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,SAAS,MAAM,EAAwB,EAC/C,IAAI,UAAQ,GACX,MAAM,CAGR;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,MAAM,GAAE,SAAS,MAAM,EAAwB,GAC9C,MAAM,CAER"}
|
|
@@ -18,13 +18,6 @@
|
|
|
18
18
|
* body classes such as `header-dark` describe a part of the page, not the
|
|
19
19
|
* page), no `color-scheme` meta tag and no background sampling.
|
|
20
20
|
*/
|
|
21
|
-
/**
|
|
22
|
-
* `styles/tokens.css`'s dark values for the roles the widget
|
|
23
|
-
* generation's plain-DOM launcher reads. `core` writes them on its host while
|
|
24
|
-
* dark, because the launcher paints before that stylesheet is adopted.
|
|
25
|
-
* `tokens-css.test.ts` keeps the two equal.
|
|
26
|
-
*/
|
|
27
|
-
export declare const DARK_WIDGET_ROLES: ReadonlyArray<readonly [string, string]>;
|
|
28
21
|
/** Whether the host page reads as dark right now. */
|
|
29
22
|
export declare function hostIsDark(win: Window): boolean;
|
|
30
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-tone.d.ts","sourceRoot":"","sources":["../../src/theme/host-tone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"host-tone.d.ts","sourceRoot":"","sources":["../../src/theme/host-tone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAeH,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAiB/C;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GAAG,MAAM,IAAI,CAmBxF"}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* Two modules, both pure and dependency-free so the CDN `core` stage can
|
|
5
5
|
* inline them inside its budget: `color.ts` (sRGB/OKLab/OKLCH conversion and
|
|
6
6
|
* WCAG contrast) and `derive.ts` (the config → `--wgt-*` token derivation).
|
|
7
|
+
* The widget generation's extra tokens (`widget-derive.ts`) and its light-DOM
|
|
8
|
+
* scope are exported by name; their constants and step helpers stay internal.
|
|
7
9
|
*/
|
|
8
10
|
export * from './color.js';
|
|
9
|
-
export
|
|
11
|
+
export { CARD_RADIUS_MAX_PX, SHEET_RADIUS_MAX_PX, SYSTEM_FONT_STACK, WIDGET_THEME_TOKENS, deriveTheme, themeToCss, themeToInlineStyle, themeToMarkedHostCss, type DerivedWidgetTheme, type WidgetCaps, type WidgetColorConfig, type WidgetFont, type WidgetRadius, type WidgetThemeVar, type WidgetThemeVars, type WidgetTone, type WidgetTypeConfig, } from './derive.js';
|
|
12
|
+
export { deriveWidgetTheme, type DerivedWidgetGenTheme, type WidgetGenToken, type WidgetGenVars, } from './widget-derive.js';
|
|
13
|
+
export * from './widget-theme-scope.js';
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,oBAAoB,CAAC;AAC5B,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type WidgetColorConfig, type WidgetThemeVars, type WidgetTypeConfig } from './derive.js';
|
|
2
|
+
export declare const WIDGET_GEN_EXTRA_TOKENS: readonly ['--wgt-panel-radius', '--wgt-card-lg-radius', '--wgt-btn-radius', '--wgt-chip-radius', '--wgt-bubble-radius', '--wgt-bubble-tail-radius', '--wgt-launcher-radius', '--wgt-text-2', '--wgt-surface-3', '--wgt-panel-surface', '--wgt-panel-filter', '--wgt-elevation', '--wgt-card-elevation', '--wgt-accent-ink', '--wgt-live'];
|
|
3
|
+
/** Every token the widget generation reads: the dock's, then the extras. */
|
|
4
|
+
export declare const WIDGET_GEN_TOKENS: readonly ["--wgt-primary", "--wgt-on-primary", "--wgt-surface", "--wgt-surface-2", "--wgt-surface-glass", "--wgt-surface-glass-blurred", "--wgt-surface-veil", "--wgt-glass-tune", "--wgt-text", "--wgt-text-muted", "--wgt-border", "--wgt-ring", "--wgt-radius", "--wgt-row-radius", "--wgt-sheet-radius", "--wgt-card-radius", "--wgt-font", "--wgt-caps", "--wgt-panel-radius", "--wgt-card-lg-radius", "--wgt-btn-radius", "--wgt-chip-radius", "--wgt-bubble-radius", "--wgt-bubble-tail-radius", "--wgt-launcher-radius", "--wgt-text-2", "--wgt-surface-3", "--wgt-panel-surface", "--wgt-panel-filter", "--wgt-elevation", "--wgt-card-elevation", "--wgt-accent-ink", "--wgt-live"];
|
|
5
|
+
export type WidgetGenToken = (typeof WIDGET_GEN_EXTRA_TOKENS)[number];
|
|
6
|
+
export type WidgetGenVars = WidgetThemeVars & Record<WidgetGenToken, string>;
|
|
7
|
+
export interface DerivedWidgetGenTheme {
|
|
8
|
+
light: WidgetGenVars;
|
|
9
|
+
dark?: WidgetGenVars;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Every `--wgt-*` token the widget generation reads, from the published
|
|
13
|
+
* `color` + `type` groups: {@link deriveTheme}'s eighteen plus the extras,
|
|
14
|
+
* per block, with the same tone rules. Pure, and throws on the same inputs.
|
|
15
|
+
*/
|
|
16
|
+
export declare function deriveWidgetTheme(color: WidgetColorConfig, type: WidgetTypeConfig): DerivedWidgetGenTheme;
|
|
17
|
+
//# sourceMappingURL=widget-derive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-derive.d.ts","sourceRoot":"","sources":["../../src/theme/widget-derive.ts"],"names":[],"mappings":"AAOA,OAAO,EAKL,KAAK,iBAAiB,EAEtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,uBAAuB,YAClC,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,YAAY,CACJ,CAAC;AAEX,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,+pBAAgE,CAAC;AAE/F,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;AAE7E,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AA6DD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,gBAAgB,GACrB,qBAAqB,CAOvB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type WidgetColorConfig, type WidgetTypeConfig } from './derive.js';
|
|
3
|
+
export interface WidgetThemeScopeProps {
|
|
4
|
+
/** Absent ⇒ the default theme (primary #111827, light). */
|
|
5
|
+
readonly color?: WidgetColorConfig | undefined;
|
|
6
|
+
/** Absent ⇒ inherited font, `round` radius, no caps. */
|
|
7
|
+
readonly type?: WidgetTypeConfig | undefined;
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Puts the tenant's `--wgt-*` tokens (docs/DOCK_SPEC.md §9.2) on the widget
|
|
12
|
+
* generation for every mount without a `core` stage (docs/CONCIERGE_GENERATIONS.md
|
|
13
|
+
* §3.4). A scoped stylesheet rather than inline style so `tone: 'auto'` can carry
|
|
14
|
+
* its `prefers-color-scheme` query. Every value comes out of `deriveWidgetTheme`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function WidgetThemeScope({ color, type, children, }: WidgetThemeScopeProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=widget-theme-scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-theme-scope.d.ts","sourceRoot":"","sources":["../../src/theme/widget-theme-scope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAkB,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG5F,MAAM,WAAW,qBAAqB;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC/C,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAKD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAqB,EACrB,IAAmB,EACnB,QAAQ,GACT,EAAE,qBAAqB,+BAavB"}
|
|
@@ -3,7 +3,7 @@ import type { CallerInterruptReason, SessionConfigPayload, TurnCostPayload, Turn
|
|
|
3
3
|
import type { SessionTuning } from '@saar-ai/widget-protocol/tuning';
|
|
4
4
|
import type { WidgetToolEvent } from '@saar-ai/widget-protocol/chat';
|
|
5
5
|
import { type SessionLogEntry } from './session-log.js';
|
|
6
|
-
import type
|
|
6
|
+
import { type SpokenLine } from './spoken-transcript.js';
|
|
7
7
|
import { type VoicePhase, type VoiceSessionSnapshot } from './voice-session-state.js';
|
|
8
8
|
/**
|
|
9
9
|
* The widget's live call: token → room → microphone → the avatar's state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-voice-session.d.ts","sourceRoot":"","sources":["../src/use-voice-session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EACV,qBAAqB,EACrB,oBAAoB,EAEpB,eAAe,EACf,kBAAkB,EACnB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAqC,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"use-voice-session.d.ts","sourceRoot":"","sources":["../src/use-voice-session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM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"}
|
package/dist/voice-widget.d.ts
CHANGED
|
@@ -66,6 +66,12 @@ export interface WidgetTurn {
|
|
|
66
66
|
* read as one.
|
|
67
67
|
*/
|
|
68
68
|
readonly filler?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* A spoken agent reply the caller cut off (`spoken-transcript.ts`'s
|
|
71
|
+
* `cutLineIndexes`): its text is what they heard before they talked over
|
|
72
|
+
* it. Only the call view draws it differently.
|
|
73
|
+
*/
|
|
74
|
+
readonly cut?: boolean;
|
|
69
75
|
/**
|
|
70
76
|
* WHO wrote this reply, when it was not the concierge — the display name of
|
|
71
77
|
* the human operator who took the conversation (DOCK_SPEC §5.1's `human`).
|
|
@@ -79,6 +85,23 @@ export interface WidgetTurn {
|
|
|
79
85
|
readonly operatorName?: string;
|
|
80
86
|
}
|
|
81
87
|
export type WidgetMode = 'voice' | 'text';
|
|
88
|
+
/**
|
|
89
|
+
* What the widget's call view needs from the voice session that the turns do
|
|
90
|
+
* not carry: `useVoiceSession`'s own fields, so a host passes the session
|
|
91
|
+
* whole and the dock's bundle carries no code for them. `ShellRenderer` reads
|
|
92
|
+
* them.
|
|
93
|
+
*/
|
|
94
|
+
export interface WidgetCallHooks {
|
|
95
|
+
/**
|
|
96
|
+
* Says a line as the CALLER, on the call itself (`voice.caller_text`), so
|
|
97
|
+
* the concierge answers out loud. Resolving `false` did not send it.
|
|
98
|
+
*/
|
|
99
|
+
readonly sendText?: (line: string) => Promise<boolean> | boolean;
|
|
100
|
+
/** What the call's tools put on screen; the newest `checkout` is the call's handover. */
|
|
101
|
+
readonly widgetEvents?: readonly {
|
|
102
|
+
readonly type: string;
|
|
103
|
+
}[];
|
|
104
|
+
}
|
|
82
105
|
export interface VoiceWidgetProps {
|
|
83
106
|
readonly state: BotState;
|
|
84
107
|
/** The conversation, oldest first. */
|
|
@@ -89,7 +112,7 @@ export interface VoiceWidgetProps {
|
|
|
89
112
|
* voice leg should render — never a button that cannot end anything.
|
|
90
113
|
*/
|
|
91
114
|
readonly onEndCall?: () => void;
|
|
92
|
-
/** Where the call is,
|
|
115
|
+
/** Where the call is: the dock's row, the widget's call view. Absent ⇒ `idle`. */
|
|
93
116
|
readonly callPhase?: ConciergeCallPhase;
|
|
94
117
|
/** Send a typed turn. The widget clears its input only when this resolves true. */
|
|
95
118
|
readonly onSendText: (text: string) => Promise<boolean> | boolean;
|
|
@@ -259,6 +282,8 @@ export interface VoiceWidgetProps {
|
|
|
259
282
|
* one renderer's code and not both (`VoiceWidgetWithRenderer`).
|
|
260
283
|
*/
|
|
261
284
|
readonly renderer?: ConciergeRenderer;
|
|
285
|
+
/** Absent ⇒ the call view offers no "Try saying" lines. */
|
|
286
|
+
readonly call?: WidgetCallHooks;
|
|
262
287
|
/** §9.1 `ui.generation`, honoured only when `renderer` is absent. */
|
|
263
288
|
readonly generation?: 'widget' | 'dock';
|
|
264
289
|
readonly dock?: Omit<DockProps, 'draft' | 'onDraftChange' | 'onSubmit' | 'transcript' | 'sheetExtra' | 'messages'>;
|
|
@@ -323,6 +348,11 @@ export interface ConversationView {
|
|
|
323
348
|
readonly attachInput: ReactNode;
|
|
324
349
|
/** The `role="log"` transcript, openers included. */
|
|
325
350
|
readonly transcript: ReactNode;
|
|
351
|
+
/** One turn's product cards, wired exactly as the transcript wires them. */
|
|
352
|
+
readonly renderCards: (cards: ChatCards) => ReactNode;
|
|
353
|
+
/** The openers, already chosen (`suggestions`, else the `suggestion_*` messages). */
|
|
354
|
+
readonly suggestions: readonly string[];
|
|
355
|
+
readonly call: WidgetCallHooks | undefined;
|
|
326
356
|
/** The basket summary and the upload status, for the end of the transcript. */
|
|
327
357
|
readonly extras: ReactNode;
|
|
328
358
|
readonly messages: WidgetMessages;
|
|
@@ -433,7 +463,7 @@ export declare function basketIntentFromTurns(turns: readonly Pick<WidgetTurn, '
|
|
|
433
463
|
*/
|
|
434
464
|
export declare function VoiceWidget({ renderer, generation, ...props }: VoiceWidgetProps): import("react").JSX.Element;
|
|
435
465
|
/** `VoiceWidget` with the renderer decided — the component the CDN entries and `ConciergeHost` use. */
|
|
436
|
-
export declare function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCall, callPhase, onSendText, micOpen, status, statusKind, notice, mode, escalated, humanTyping, onTyping, onAddToCart, onChooseOptions, chooseOptionsBusy, curationHref, productHref, onAttachFile, cart, captureCard, messages, suggestions, navigate, locale, skinStyle, avatar, attribution, privacyChoices, dock, }: VoiceWidgetProps & {
|
|
466
|
+
export declare function VoiceWidgetWithRenderer({ renderer, state, turns, onToggleMic, onEndCall, callPhase, onSendText, micOpen, status, statusKind, notice, mode, escalated, humanTyping, onTyping, onAddToCart, onChooseOptions, chooseOptionsBusy, curationHref, productHref, onAttachFile, cart, captureCard, messages, suggestions, navigate, locale, skinStyle, avatar, attribution, privacyChoices, call, dock, }: VoiceWidgetProps & {
|
|
437
467
|
readonly renderer: ConciergeRenderer;
|
|
438
468
|
}): import("react").JSX.Element;
|
|
439
469
|
//# sourceMappingURL=voice-widget.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice-widget.d.ts","sourceRoot":"","sources":["../src/voice-widget.tsx"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EACL,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAExF,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;AAExD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AA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d,IAAI,EACJ,IAAI,GACL,EAAE,gBAAgB,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAA;CAAE,+BA6mB7D"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { WidgetAvatar } from '../avatar.js';
|
|
3
|
+
import type { BotState } from '../bot-state.js';
|
|
4
|
+
import type { ConciergeState } from '../concierge-state.js';
|
|
5
|
+
import { type WidgetMessages } from '../messages.js';
|
|
6
|
+
import type { ChatCards } from '../use-chat-session.js';
|
|
7
|
+
import type { ConciergeCallPhase, WidgetTurn } from '../voice-widget.js';
|
|
8
|
+
import type { WidgetCartLine } from '../widget-cart-summary.js';
|
|
9
|
+
import type { ConciergeShellVoice } from './concierge-shell.js';
|
|
10
|
+
/**
|
|
11
|
+
* The call view's own words. Kept out of `defaultWidgetMessages` so the dock's
|
|
12
|
+
* `ui.mjs` does not carry them; a host catalogue overrides any of them by key.
|
|
13
|
+
*/
|
|
14
|
+
export declare const defaultCallMessages: {
|
|
15
|
+
call_your_turn: string;
|
|
16
|
+
call_muted: string;
|
|
17
|
+
call_paused: string;
|
|
18
|
+
call_mic_blocked: string;
|
|
19
|
+
call_human: string;
|
|
20
|
+
call_offline: string;
|
|
21
|
+
call_problem: string;
|
|
22
|
+
call_ended: string;
|
|
23
|
+
call_interrupted: string;
|
|
24
|
+
call_try_saying: string;
|
|
25
|
+
call_to_text: string;
|
|
26
|
+
call_back_to_call: string;
|
|
27
|
+
call_back_to_chat: string;
|
|
28
|
+
call_summary_added: string;
|
|
29
|
+
call_summary_checkout: string;
|
|
30
|
+
call_on_call: string;
|
|
31
|
+
};
|
|
32
|
+
export type WidgetCallMessages = {
|
|
33
|
+
readonly [K in keyof typeof defaultCallMessages]?: string;
|
|
34
|
+
};
|
|
35
|
+
export type CallWordKey = keyof typeof defaultCallMessages | 'voice_state_connecting' | 'voice_state_listening' | 'voice_state_thinking' | 'voice_state_speaking' | 'dock_still_here';
|
|
36
|
+
/** One message, from the host's catalogue when it has the key. */
|
|
37
|
+
export declare function callText(messages: WidgetMessages & WidgetCallMessages, key: CallWordKey): string;
|
|
38
|
+
export declare function callStatus(state: ConciergeState, { ended, callerSpeaking }: {
|
|
39
|
+
readonly ended: boolean;
|
|
40
|
+
readonly callerSpeaking: boolean;
|
|
41
|
+
}): {
|
|
42
|
+
readonly word: CallWordKey;
|
|
43
|
+
readonly explain: boolean;
|
|
44
|
+
};
|
|
45
|
+
/** `mm:ss`, minutes uncapped. */
|
|
46
|
+
export declare function formatCallTime(ms: number): string;
|
|
47
|
+
/**
|
|
48
|
+
* One call as the view tracks it, on the monotonic clock.
|
|
49
|
+
*
|
|
50
|
+
* A call begins when the phase leaves `idle` and ends when it returns there.
|
|
51
|
+
* The timer starts at the first `live` or `waiting` phase, so dialling and
|
|
52
|
+
* the permission prompt are not counted. A dropped room is `idle`, so a
|
|
53
|
+
* reconnect is a new call: new `id`, timer from zero, a fresh `from`.
|
|
54
|
+
*/
|
|
55
|
+
export interface CallRecord {
|
|
56
|
+
readonly id: number;
|
|
57
|
+
readonly active: boolean;
|
|
58
|
+
readonly startedAt: number | null;
|
|
59
|
+
readonly endedAt: number | null;
|
|
60
|
+
/** How many turns were on screen before this call: its own start at `from`. */
|
|
61
|
+
readonly from: number;
|
|
62
|
+
/** The basket when the call began. */
|
|
63
|
+
readonly cart: readonly WidgetCartLine[];
|
|
64
|
+
/** A checkout was handed over during this call. Latched, so a capped event list cannot drop it. */
|
|
65
|
+
readonly checkout?: boolean;
|
|
66
|
+
/** The host's `checkout` value when the call began: one left over from the last call is not this one's. */
|
|
67
|
+
readonly checkoutFrom?: unknown;
|
|
68
|
+
}
|
|
69
|
+
export declare const IDLE_CALL_RECORD: CallRecord;
|
|
70
|
+
export declare function advanceCallRecord(prev: CallRecord, next: {
|
|
71
|
+
readonly phase: ConciergeCallPhase;
|
|
72
|
+
readonly now: number;
|
|
73
|
+
readonly turns: number;
|
|
74
|
+
readonly cart: readonly WidgetCartLine[];
|
|
75
|
+
readonly checkout?: unknown;
|
|
76
|
+
}): CallRecord;
|
|
77
|
+
export declare function useCallRecord(phase: ConciergeCallPhase, turns: readonly WidgetTurn[], cart: readonly WidgetCartLine[] | undefined, checkout?: unknown): CallRecord;
|
|
78
|
+
/** The titles whose quantity grew since the call began, in basket order. */
|
|
79
|
+
export declare function addedDuringCall(before: readonly WidgetCartLine[], after: readonly WidgetCartLine[]): readonly string[];
|
|
80
|
+
/** What the view needs from the conversation; `ShellRenderer` builds it. */
|
|
81
|
+
export interface CallViewData {
|
|
82
|
+
/**
|
|
83
|
+
* Says a "Try saying" line on the call (`WidgetCallHooks.sendText`). Absent
|
|
84
|
+
* draws no such row; resolving `false` did not send the line, and its chip
|
|
85
|
+
* stays.
|
|
86
|
+
*/
|
|
87
|
+
readonly onSay?: (line: string) => Promise<boolean> | boolean;
|
|
88
|
+
/**
|
|
89
|
+
* A checkout was handed over: `true`, or the newest checkout event itself.
|
|
90
|
+
* The panel's call record latches a change of it per call.
|
|
91
|
+
*/
|
|
92
|
+
readonly checkout?: boolean | object;
|
|
93
|
+
readonly state: ConciergeState;
|
|
94
|
+
readonly callerSpeaking?: boolean;
|
|
95
|
+
readonly turns: readonly WidgetTurn[];
|
|
96
|
+
readonly renderCards: (cards: ChatCards) => ReactNode;
|
|
97
|
+
readonly suggestions: readonly string[];
|
|
98
|
+
readonly cart?: readonly WidgetCartLine[];
|
|
99
|
+
readonly messages: WidgetMessages & WidgetCallMessages;
|
|
100
|
+
}
|
|
101
|
+
export interface CallViewProps extends CallViewData {
|
|
102
|
+
readonly voice: ConciergeShellVoice;
|
|
103
|
+
/** The agent's name, for a monogram mark. */
|
|
104
|
+
readonly name?: string;
|
|
105
|
+
/** Drawn at the header's end: the panel's own close control. */
|
|
106
|
+
readonly actions?: ReactNode;
|
|
107
|
+
readonly record: CallRecord;
|
|
108
|
+
readonly bot: BotState;
|
|
109
|
+
readonly avatar: WidgetAvatar;
|
|
110
|
+
/** The host's status line, drawn under the header when it explains the state. */
|
|
111
|
+
readonly hint?: ReactNode;
|
|
112
|
+
readonly onText: () => void;
|
|
113
|
+
readonly onBackToChat: () => void;
|
|
114
|
+
readonly testIds?: {
|
|
115
|
+
readonly mic?: string;
|
|
116
|
+
readonly endCall?: string;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export interface CallMode {
|
|
120
|
+
/** The panel draws the call view in place of the chat. */
|
|
121
|
+
readonly shown: boolean;
|
|
122
|
+
readonly record: CallRecord;
|
|
123
|
+
/** The launcher's second line while a call runs ("On call · 01:24"). */
|
|
124
|
+
readonly launcherLabel: string | undefined;
|
|
125
|
+
/** "Type instead": the chat, with this call still running. */
|
|
126
|
+
readonly toText: () => void;
|
|
127
|
+
/** The way back from the chat to the running call. */
|
|
128
|
+
readonly backToCall: () => void;
|
|
129
|
+
/** Closes the ended call's summary. */
|
|
130
|
+
readonly closeSummary: () => void;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The panel's call lifecycle. A running call takes the panel over unless the
|
|
134
|
+
* shopper chose "Type instead"; an ended one shows its summary until they
|
|
135
|
+
* close it. Both choices hold for that call only: the next one shows again.
|
|
136
|
+
* Absent `call` (the marketing preview), the call view never shows.
|
|
137
|
+
*/
|
|
138
|
+
export declare function useCallMode(voice: ConciergeShellVoice | undefined, call: CallViewData | undefined): CallMode;
|
|
139
|
+
/**
|
|
140
|
+
* The widget generation's call: a header that names the state, the call's
|
|
141
|
+
* own turns with their cards, the "Try saying" lines and the call controls,
|
|
142
|
+
* then the summary once it ends. Styled by `styles/call-view.css` (`.wgc`).
|
|
143
|
+
* See docs/CONCIERGE_GENERATIONS.md "Call mode".
|
|
144
|
+
*/
|
|
145
|
+
export declare function CallView({ state, callerSpeaking, turns, renderCards, suggestions, onSay, checkout, cart, messages, voice, name, actions, record, bot, avatar, hint, onText, onBackToChat, testIds, }: CallViewProps): import("react").JSX.Element;
|
|
146
|
+
//# sourceMappingURL=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