@saar-ai/web-widget 0.24.0 → 0.25.1
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/chunks/{host-widget-FCxPyMok.js → host-widget-DiHyQxke.js} +274 -110
- package/dist/dock/dock.d.ts +5 -0
- package/dist/dock/dock.d.ts.map +1 -1
- package/dist/generated/widget-css.d.ts.map +1 -1
- package/dist/host-widget.d.ts +3 -1
- package/dist/host-widget.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/next/index.js +1 -1
- package/dist/page-forms.d.ts +24 -0
- package/dist/page-forms.d.ts.map +1 -0
- package/dist/unread-state.d.ts +3 -0
- package/dist/unread-state.d.ts.map +1 -0
- package/dist/use-chat-session.d.ts +6 -0
- package/dist/use-chat-session.d.ts.map +1 -1
- package/dist/widget/concierge-launcher.d.ts +19 -1
- package/dist/widget/concierge-launcher.d.ts.map +1 -1
- package/dist/widget/concierge-shell.d.ts +7 -1
- package/dist/widget/concierge-shell.d.ts.map +1 -1
- package/dist/widget/launcher-look.d.ts +23 -0
- package/dist/widget/launcher-look.d.ts.map +1 -1
- package/dist/widget/shell-renderer.d.ts.map +1 -1
- package/dist/widget.css +1 -1
- package/package.json +1 -1
- package/src/styles/concierge.css +3 -1
|
@@ -4638,7 +4638,7 @@ var defaultWidgetMessages = {
|
|
|
4638
4638
|
dock_show_transcript: "Show what was said",
|
|
4639
4639
|
dock_show_conversation: "Show conversation",
|
|
4640
4640
|
dock_earbuds: "Earbuds in — talk freely",
|
|
4641
|
-
dock_unread: "new",
|
|
4641
|
+
dock_unread: "1 new message",
|
|
4642
4642
|
dock_float_you: "You",
|
|
4643
4643
|
dock_float_dismiss: "Dismiss",
|
|
4644
4644
|
dock_minimise_dock: "Minimise the concierge",
|
|
@@ -5484,6 +5484,32 @@ function themeToInlineStyle(vars, tokens = WIDGET_THEME_TOKENS) {
|
|
|
5484
5484
|
return tokens.map((t) => `${t}:${vars[t]};`).join("");
|
|
5485
5485
|
}
|
|
5486
5486
|
//#endregion
|
|
5487
|
+
//#region src/unread-state.ts
|
|
5488
|
+
/**
|
|
5489
|
+
* SAA-511 — a proactive opener arrived while the conversation was out of
|
|
5490
|
+
* sight and has not been seen yet, so the launcher (the dock's pill and row,
|
|
5491
|
+
* the widget's launcher) keeps its unread dot across an in-site navigation.
|
|
5492
|
+
*
|
|
5493
|
+
* `sessionStorage`, so it ends with the tab, and a FLAG only: never the
|
|
5494
|
+
* line, the turn or anything about the visitor, and never `localStorage`.
|
|
5495
|
+
* Written by whichever surface showed the opener (`cdn/core.ts` before the
|
|
5496
|
+
* handover, the React dock or shell after it) and cleared when the shopper
|
|
5497
|
+
* opens the conversation or dismisses the line. Every access is guarded: a
|
|
5498
|
+
* private window, blocked site data or a sandboxed frame throws, and the
|
|
5499
|
+
* launcher is then simply quiet on the next page.
|
|
5500
|
+
*
|
|
5501
|
+
* Its own module, not `widget/open-state.ts`: both renderers and `core`
|
|
5502
|
+
* read it, and the dock may not reach the widget generation's modules
|
|
5503
|
+
* (`dock/__tests__/renderer-boundary.test.ts`).
|
|
5504
|
+
*/
|
|
5505
|
+
var KEY$1 = "wgt_unread";
|
|
5506
|
+
function writeUnread(on) {
|
|
5507
|
+
try {
|
|
5508
|
+
if (on) sessionStorage.setItem(KEY$1, "1");
|
|
5509
|
+
else sessionStorage.removeItem(KEY$1);
|
|
5510
|
+
} catch {}
|
|
5511
|
+
}
|
|
5512
|
+
//#endregion
|
|
5487
5513
|
//#region src/dock/geometry.ts
|
|
5488
5514
|
/**
|
|
5489
5515
|
* DOCK GEOMETRY — every length the dock's row, pill and sheet are built from
|
|
@@ -8498,6 +8524,17 @@ function Dock(props) {
|
|
|
8498
8524
|
const [sheet, setSheet] = useState("closed");
|
|
8499
8525
|
useEffect(() => onShown?.(sheet !== "closed"), [sheet, onShown]);
|
|
8500
8526
|
/**
|
|
8527
|
+
* SAA-511 — a proactive line arrived while the sheet was down: §3.2's dot
|
|
8528
|
+
* on the pill until the sheet rises, mirrored to `sessionStorage` so the
|
|
8529
|
+
* core dock on the next page keeps it. Set in the §5.6 effect below.
|
|
8530
|
+
*/
|
|
8531
|
+
const [nudged, setNudged] = useState(false);
|
|
8532
|
+
useEffect(() => {
|
|
8533
|
+
if (sheet === "closed") return;
|
|
8534
|
+
setNudged(false);
|
|
8535
|
+
writeUnread(false);
|
|
8536
|
+
}, [sheet]);
|
|
8537
|
+
/**
|
|
8501
8538
|
* The sheet has been open at least once this session — one of the three
|
|
8502
8539
|
* things that retire the greeting placeholder (see `placeholder` below).
|
|
8503
8540
|
*
|
|
@@ -9179,6 +9216,10 @@ function Dock(props) {
|
|
|
9179
9216
|
formBeforeNudge.current = form;
|
|
9180
9217
|
setNudge(proactive);
|
|
9181
9218
|
setForm("row");
|
|
9219
|
+
if (sheet === "closed") {
|
|
9220
|
+
setNudged(true);
|
|
9221
|
+
writeUnread(true);
|
|
9222
|
+
}
|
|
9182
9223
|
const id = setTimeout(() => {
|
|
9183
9224
|
setNudge(void 0);
|
|
9184
9225
|
if (formBeforeNudge.current === "pill" && !audioOpenRef.current) setForm("pill");
|
|
@@ -9522,7 +9563,7 @@ function Dock(props) {
|
|
|
9522
9563
|
draggable,
|
|
9523
9564
|
dragHandleProps: dragging.handleProps,
|
|
9524
9565
|
pillRef,
|
|
9525
|
-
unread,
|
|
9566
|
+
unread: unread || nudged,
|
|
9526
9567
|
unreadLabel: msg("dock_unread")
|
|
9527
9568
|
}),
|
|
9528
9569
|
/* @__PURE__ */ jsx(DockRow, {
|
|
@@ -10645,6 +10686,29 @@ var LAUNCHER_GRIP_CSS = `position:relative;z-index:1;display:grid;place-items:ce
|
|
|
10645
10686
|
var ROUND_GRIP_CSS = `position:absolute;bottom:-4px;inset-inline-start:-4px;z-index:1;min-height:28px;background:${LAUNCHER_SURFACE};box-shadow:${LAUNCHER_ELEVATION}`;
|
|
10646
10687
|
/** The grip's hit area: 44px across around the 28px grip, which keeps its look. */
|
|
10647
10688
|
var GRIP_HIT_CSS = "position:absolute;inset:-8px";
|
|
10689
|
+
/**
|
|
10690
|
+
* The unread dot (SAA-511, and §4's badge before it): something landed
|
|
10691
|
+
* behind the closed panel. `--wgt-text` because the derivation guarantees it
|
|
10692
|
+
* clears 4.5:1 on the launcher's surface (`--wgt-panel-surface`) in the light
|
|
10693
|
+
* AND the dark block (`theme/widget-derive.ts`, text from `theme/derive.ts`), well over the 3:1 a UI component needs; ringed in the
|
|
10694
|
+
* surface so it reads on any mark. Static, with no transition or animation,
|
|
10695
|
+
* so there is nothing for reduced motion to turn off.
|
|
10696
|
+
*/
|
|
10697
|
+
var LAUNCHER_BADGE_CSS = `position:absolute;top:0;inset-inline-end:0;width:12px;height:12px;border-radius:50%;background:${LAUNCHER_TEXT};box-shadow:0 0 0 2px ${LAUNCHER_SURFACE}`;
|
|
10698
|
+
/**
|
|
10699
|
+
* The proactive opener beside the collapsed launcher (SAA-511): a card on
|
|
10700
|
+
* the launcher's own surface, above it (below it on a top anchor), with the
|
|
10701
|
+
* line as one button that opens the panel and a × that dismisses it.
|
|
10702
|
+
*/
|
|
10703
|
+
var NUDGE_BUBBLE_CSS = `position:absolute;display:flex;align-items:flex-start;gap:4px;width:max-content;max-width:min(280px,calc(100vw - 32px));padding:6px;border-radius:16px;background:${LAUNCHER_SURFACE};box-shadow:${LAUNCHER_ELEVATION};color:${LAUNCHER_TEXT};white-space:normal`;
|
|
10704
|
+
var NUDGE_LINE_CSS = `flex:1 1 auto;min-width:0;min-height:44px;margin:0;padding:8px 6px 8px 10px;border:0;border-radius:12px;background:none;color:${LAUNCHER_TEXT};font:inherit;font-size:14px;line-height:1.4;text-align:start;cursor:pointer`;
|
|
10705
|
+
var NUDGE_DISMISS_CSS = `flex:none;display:grid;place-items:center;width:44px;height:44px;margin:0;padding:0;border:0;border-radius:50%;background:none;color:${MUTED};font:inherit;font-size:18px;line-height:1;cursor:pointer`;
|
|
10706
|
+
/**
|
|
10707
|
+
* Where the bubble sits: on the side away from the screen edge the launcher
|
|
10708
|
+
* hangs from, and flush with the launcher's own horizontal anchor so it never
|
|
10709
|
+
* runs off the screen edge the launcher is pinned to.
|
|
10710
|
+
*/
|
|
10711
|
+
var nudgePlaceCss = (top, align) => `${top ? "top" : "bottom"}:calc(100% + 8px);` + (align === "center" ? "left:50%;transform:translateX(-50%)" : `${align}:0`);
|
|
10648
10712
|
//#endregion
|
|
10649
10713
|
//#region src/widget/position.ts
|
|
10650
10714
|
/**
|
|
@@ -10751,7 +10815,7 @@ var QUIET = {
|
|
|
10751
10815
|
badge: false,
|
|
10752
10816
|
initials: false
|
|
10753
10817
|
};
|
|
10754
|
-
function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChange, onOpen, hidden, id, testId, avatar = "orb", spec = QUIET, initials = "", launcher = DEFAULT_LAUNCHER_VARIANT, agentName, subLabel, callLabel, callSrLabel }) {
|
|
10818
|
+
function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChange, onOpen, hidden, id, testId, avatar = "orb", spec = QUIET, initials = "", launcher = DEFAULT_LAUNCHER_VARIANT, agentName, subLabel, callLabel, callSrLabel, unread = false, unreadLabel, nudge, dismissLabel, onDismissNudge, onNudgeHold }) {
|
|
10755
10819
|
const rootRef = useRef(null);
|
|
10756
10820
|
/** Pixel offset while a drag is in flight; `null` when it is not. */
|
|
10757
10821
|
const [drag, setDrag] = useState(null);
|
|
@@ -10839,7 +10903,8 @@ function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChan
|
|
|
10839
10903
|
const round = launcher === "round";
|
|
10840
10904
|
const sub = callLabel ?? subLabel;
|
|
10841
10905
|
const showText = !round && (label !== void 0 || sub !== void 0);
|
|
10842
|
-
const
|
|
10906
|
+
const baseLabel = round || label === void 0 ? [srLabel, callSrLabel ?? callLabel].filter(Boolean).join(", ") : callSrLabel && `${label}, ${callSrLabel}`;
|
|
10907
|
+
const ariaLabel = unread && unreadLabel ? `${baseLabel || [label, sub].filter(Boolean).join(", ")}, ${unreadLabel}` : baseLabel;
|
|
10843
10908
|
return /* @__PURE__ */ jsxs("div", {
|
|
10844
10909
|
ref: rootRef,
|
|
10845
10910
|
id,
|
|
@@ -10852,112 +10917,133 @@ function ConciergeLauncher({ label, srLabel, moveLabel, position, onPositionChan
|
|
|
10852
10917
|
...styleOf(launcherRootCss(launcher)),
|
|
10853
10918
|
...drag ? { transform: `translate(${drag.dx}px, ${drag.dy}px)` } : {}
|
|
10854
10919
|
},
|
|
10855
|
-
children: [
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10860
|
-
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10867
|
-
|
|
10868
|
-
...styleOf(round ? `${LAUNCHER_GRIP_CSS};${ROUND_GRIP_CSS}` : LAUNCHER_GRIP_CSS),
|
|
10869
|
-
cursor: dragging ? "grabbing" : "grab"
|
|
10870
|
-
},
|
|
10871
|
-
children: [/* @__PURE__ */ jsx(GripVertical, {
|
|
10872
|
-
className: "size-4",
|
|
10873
|
-
"aria-hidden": true
|
|
10874
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
10875
|
-
"aria-hidden": true,
|
|
10876
|
-
style: styleOf(GRIP_HIT_CSS)
|
|
10877
|
-
})]
|
|
10878
|
-
}) : null, /* @__PURE__ */ jsxs("button", {
|
|
10879
|
-
type: "button",
|
|
10880
|
-
"aria-label": ariaLabel,
|
|
10881
|
-
tabIndex: hidden || spec.disabled ? -1 : 0,
|
|
10882
|
-
disabled: spec.disabled,
|
|
10883
|
-
...spec.busy ? { "aria-busy": true } : {},
|
|
10884
|
-
"data-launcher-state": spec.disabled ? "offline" : spec.busy ? "busy" : spec.dimmed ? "ducked" : void 0,
|
|
10885
|
-
onClick: () => {
|
|
10886
|
-
if (spec.disabled) return;
|
|
10887
|
-
setTightenKey((k) => k + 1);
|
|
10888
|
-
onOpen();
|
|
10889
|
-
},
|
|
10890
|
-
"data-testid": testId ? `${testId}-open` : void 0,
|
|
10891
|
-
className: FOCUS_RING,
|
|
10892
|
-
style: styleOf(launcherOpenCss(launcher)),
|
|
10893
|
-
children: [/* @__PURE__ */ jsxs("span", {
|
|
10894
|
-
"aria-hidden": true,
|
|
10895
|
-
className: "relative block shrink-0",
|
|
10920
|
+
children: [
|
|
10921
|
+
onPositionChange ? /* @__PURE__ */ jsxs("button", {
|
|
10922
|
+
type: "button",
|
|
10923
|
+
"aria-label": moveLabel,
|
|
10924
|
+
title: moveLabel,
|
|
10925
|
+
tabIndex: hidden ? -1 : 0,
|
|
10926
|
+
"data-testid": testId ? `${testId}-grip` : void 0,
|
|
10927
|
+
onPointerDown,
|
|
10928
|
+
onPointerMove,
|
|
10929
|
+
onPointerUp,
|
|
10930
|
+
onPointerCancel: onPointerUp,
|
|
10931
|
+
onKeyDown: onGripKeyDown,
|
|
10932
|
+
className: FOCUS_RING,
|
|
10896
10933
|
style: {
|
|
10897
|
-
|
|
10898
|
-
|
|
10934
|
+
...styleOf(round ? `${LAUNCHER_GRIP_CSS};${ROUND_GRIP_CSS}` : LAUNCHER_GRIP_CSS),
|
|
10935
|
+
cursor: dragging ? "grabbing" : "grab"
|
|
10899
10936
|
},
|
|
10900
|
-
children: [
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10912
|
-
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10937
|
+
children: [/* @__PURE__ */ jsx(GripVertical, {
|
|
10938
|
+
className: "size-4",
|
|
10939
|
+
"aria-hidden": true
|
|
10940
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
10941
|
+
"aria-hidden": true,
|
|
10942
|
+
style: styleOf(GRIP_HIT_CSS)
|
|
10943
|
+
})]
|
|
10944
|
+
}) : null,
|
|
10945
|
+
/* @__PURE__ */ jsxs("button", {
|
|
10946
|
+
type: "button",
|
|
10947
|
+
"aria-label": ariaLabel,
|
|
10948
|
+
tabIndex: hidden || spec.disabled ? -1 : 0,
|
|
10949
|
+
disabled: spec.disabled,
|
|
10950
|
+
...spec.busy ? { "aria-busy": true } : {},
|
|
10951
|
+
"data-launcher-state": spec.disabled ? "offline" : spec.busy ? "busy" : spec.dimmed ? "ducked" : void 0,
|
|
10952
|
+
onClick: () => {
|
|
10953
|
+
if (spec.disabled) return;
|
|
10954
|
+
setTightenKey((k) => k + 1);
|
|
10955
|
+
onOpen();
|
|
10956
|
+
},
|
|
10957
|
+
"data-testid": testId ? `${testId}-open` : void 0,
|
|
10958
|
+
className: FOCUS_RING,
|
|
10959
|
+
style: styleOf(launcherOpenCss(launcher)),
|
|
10960
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
10961
|
+
"aria-hidden": true,
|
|
10962
|
+
className: "relative block shrink-0",
|
|
10963
|
+
style: {
|
|
10964
|
+
width: markSize,
|
|
10965
|
+
height: markSize
|
|
10966
|
+
},
|
|
10967
|
+
children: [
|
|
10968
|
+
spec.initials && initials !== "" ? /* @__PURE__ */ jsx("span", {
|
|
10969
|
+
"data-testid": "widget-launcher-initials",
|
|
10970
|
+
style: styleOf(`${markRootCss(markSize)};${round ? `${ROUND_MARK_CSS};` : ""}font-weight:600;font-size:${Math.round(markSize * .34)}px;line-height:1;font-family:var(--wgt-font,inherit)`),
|
|
10971
|
+
children: initials
|
|
10972
|
+
}) : isMarkVariant(avatar) ? /* @__PURE__ */ jsx(Mark, {
|
|
10973
|
+
variant: avatar,
|
|
10974
|
+
state: spec.busy ? "connecting" : "idle",
|
|
10975
|
+
size: markSize,
|
|
10976
|
+
...agentName !== void 0 ? { name: agentName } : {},
|
|
10977
|
+
...round ? { extraCss: ROUND_MARK_CSS } : {}
|
|
10978
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
10979
|
+
className: "absolute start-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rtl:translate-x-1/2",
|
|
10980
|
+
style: { scale: String(markSize / 64) },
|
|
10981
|
+
children: /* @__PURE__ */ jsx(AvatarFace, {
|
|
10982
|
+
avatar,
|
|
10983
|
+
state: "idle",
|
|
10984
|
+
size: "sm",
|
|
10985
|
+
tightenKey
|
|
10986
|
+
})
|
|
10987
|
+
}),
|
|
10988
|
+
spec.busy ? /* @__PURE__ */ jsx("span", {
|
|
10989
|
+
"data-testid": "widget-launcher-busy",
|
|
10990
|
+
className: "pointer-events-none absolute -inset-[3px] animate-spin rounded-full border-2 border-transparent border-t-[var(--wgt-primary,#111827)] motion-reduce:animate-none"
|
|
10991
|
+
}) : null,
|
|
10992
|
+
spec.badge || unread ? /* @__PURE__ */ jsx("span", {
|
|
10993
|
+
"data-testid": "widget-launcher-badge",
|
|
10994
|
+
style: BADGE_STYLE
|
|
10995
|
+
}) : null,
|
|
10996
|
+
round && callLabel !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
10997
|
+
"data-testid": "widget-launcher-live",
|
|
10998
|
+
title: callLabel,
|
|
10999
|
+
style: LIVE_STYLE
|
|
11000
|
+
}) : null
|
|
11001
|
+
]
|
|
11002
|
+
}), showText ? /* @__PURE__ */ jsxs("span", {
|
|
11003
|
+
dir: "auto",
|
|
11004
|
+
style: styleOf(LAUNCHER_TEXT_CSS),
|
|
11005
|
+
children: [label !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
11006
|
+
style: styleOf(LAUNCHER_TITLE_CSS),
|
|
11007
|
+
children: label
|
|
11008
|
+
}) : null, sub !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
11009
|
+
"data-testid": "widget-launcher-sub",
|
|
11010
|
+
style: styleOf(LAUNCHER_SUB_CSS),
|
|
11011
|
+
children: sub
|
|
11012
|
+
}) : null]
|
|
10945
11013
|
}) : null]
|
|
10946
|
-
})
|
|
10947
|
-
|
|
11014
|
+
}),
|
|
11015
|
+
nudge !== void 0 && !hidden ? /* @__PURE__ */ jsxs("div", {
|
|
11016
|
+
"data-testid": testId ? `${testId}-nudge` : void 0,
|
|
11017
|
+
role: "status",
|
|
11018
|
+
onFocus: () => onNudgeHold?.(true),
|
|
11019
|
+
onBlur: () => onNudgeHold?.(false),
|
|
11020
|
+
onPointerEnter: () => onNudgeHold?.(true),
|
|
11021
|
+
onPointerLeave: () => onNudgeHold?.(false),
|
|
11022
|
+
style: styleOf(`${NUDGE_BUBBLE_CSS};${nudgePlaceCss(edgeOf(position) === "top", alignOf(position))}`),
|
|
11023
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
11024
|
+
type: "button",
|
|
11025
|
+
dir: "auto",
|
|
11026
|
+
onClick: onOpen,
|
|
11027
|
+
className: FOCUS_RING,
|
|
11028
|
+
style: styleOf(NUDGE_LINE_CSS),
|
|
11029
|
+
children: nudge
|
|
11030
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
11031
|
+
type: "button",
|
|
11032
|
+
"aria-label": dismissLabel,
|
|
11033
|
+
onClick: onDismissNudge,
|
|
11034
|
+
className: FOCUS_RING,
|
|
11035
|
+
style: styleOf(NUDGE_DISMISS_CSS),
|
|
11036
|
+
children: "×"
|
|
11037
|
+
})]
|
|
11038
|
+
}) : null
|
|
11039
|
+
]
|
|
10948
11040
|
});
|
|
10949
11041
|
}
|
|
10950
|
-
/**
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
width: 12,
|
|
10956
|
-
height: 12,
|
|
10957
|
-
borderRadius: "50%",
|
|
10958
|
-
background: LAUNCHER_TEXT,
|
|
10959
|
-
boxShadow: `0 0 0 2px ${LAUNCHER_SURFACE}`
|
|
10960
|
-
};
|
|
11042
|
+
/**
|
|
11043
|
+
* Something landed behind the closed panel: §4's badge, and the SAA-511
|
|
11044
|
+
* unread dot. One look with `cdn/launcher-dom.ts`, from `launcher-look.ts`.
|
|
11045
|
+
*/
|
|
11046
|
+
var BADGE_STYLE = styleOf(LAUNCHER_BADGE_CSS);
|
|
10961
11047
|
/** A call is live (round launcher). */
|
|
10962
11048
|
var LIVE_STYLE = {
|
|
10963
11049
|
position: "absolute",
|
|
@@ -11982,7 +12068,7 @@ function CallView({ state, callerSpeaking = false, turns, renderCards, renderOpt
|
|
|
11982
12068
|
}
|
|
11983
12069
|
//#endregion
|
|
11984
12070
|
//#region src/widget/concierge-shell.tsx
|
|
11985
|
-
function ConciergeShell({ open, onOpenChange, state, messageArrived = false, launcher, launcherInitials, launcherVariant, agentName, typing = false, operatorName, avatar = "orb", labels, children, badge, draft, onDraftChange, onSubmit, composerDisabled = false, voice, callIcon, call, announcement, skin, skinStyle, idPrefix = "concierge", scrollKey, composerLeading, testIds, position = DEFAULT_CONCIERGE_POSITION, onPositionChange, attribution, privacyChoices, focusOnOpen = true }) {
|
|
12071
|
+
function ConciergeShell({ open, onOpenChange, state, messageArrived = false, launcher, launcherInitials, launcherNudge, launcherVariant, agentName, typing = false, operatorName, avatar = "orb", labels, children, badge, draft, onDraftChange, onSubmit, composerDisabled = false, voice, callIcon, call, announcement, skin, skinStyle, idPrefix = "concierge", scrollKey, composerLeading, testIds, position = DEFAULT_CONCIERGE_POSITION, onPositionChange, attribution, privacyChoices, focusOnOpen = true }) {
|
|
11986
12072
|
const triggerId = `${idPrefix}-trigger`;
|
|
11987
12073
|
const inputId = `${idPrefix}-input`;
|
|
11988
12074
|
const panelRef = useRef(null);
|
|
@@ -12094,6 +12180,7 @@ function ConciergeShell({ open, onOpenChange, state, messageArrived = false, lau
|
|
|
12094
12180
|
avatar,
|
|
12095
12181
|
...launcher !== void 0 ? { spec: launcher } : {},
|
|
12096
12182
|
...launcherInitials !== void 0 ? { initials: launcherInitials } : {},
|
|
12183
|
+
...launcherNudge,
|
|
12097
12184
|
...launcherVariant !== void 0 ? { launcher: launcherVariant } : {},
|
|
12098
12185
|
...agentName !== void 0 ? { agentName } : {},
|
|
12099
12186
|
...callLabel !== void 0 ? {
|
|
@@ -12644,10 +12731,37 @@ function positionFor(dock) {
|
|
|
12644
12731
|
function ShellRenderer({ turns, showMic, callPhase, micOpen, onToggleMic, onEndCall, statusKind, statusLine, escalated, operatorName, humanTyping, composing, replyStreaming, channel, draft, onDraftChange, submit, attaching, onAttach, attachInput, transcript, extras, messages, skinStyle, avatar, attribution, privacyChoices, voice: derivedVoice, renderCards, renderOptions, suggestions, call: callHooks, cart, capturing, showBasket, captureChoices, dock, locale }) {
|
|
12645
12732
|
const [restored] = useState(readOpen);
|
|
12646
12733
|
const [open, setOpen] = useState(dock?.initialMinimised === false || restored);
|
|
12734
|
+
/**
|
|
12735
|
+
* SAA-511 — a proactive opener `cdn/core.ts` handed over (`dock.proactive`)
|
|
12736
|
+
* while the panel is closed: its line beside the launcher for
|
|
12737
|
+
* `PROACTIVE_NUDGE_MS`, and the unread dot until the panel opens. Kept in
|
|
12738
|
+
* `sessionStorage` too, so the cold launcher on the next page has it.
|
|
12739
|
+
*/
|
|
12740
|
+
const proactive = dock?.proactive;
|
|
12741
|
+
const [unread, setUnread] = useState(false);
|
|
12742
|
+
const [nudge, setNudge] = useState();
|
|
12743
|
+
useEffect(() => {
|
|
12744
|
+
if (!proactive || open) return;
|
|
12745
|
+
setUnread(true);
|
|
12746
|
+
writeUnread(true);
|
|
12747
|
+
setNudge(proactive);
|
|
12748
|
+
}, [proactive]);
|
|
12749
|
+
const [held, setHeld] = useState(false);
|
|
12750
|
+
useEffect(() => {
|
|
12751
|
+
if (nudge === void 0 || held) return;
|
|
12752
|
+
const id = setTimeout(() => setNudge(void 0), PROACTIVE_NUDGE_MS);
|
|
12753
|
+
return () => clearTimeout(id);
|
|
12754
|
+
}, [nudge, held]);
|
|
12755
|
+
const seen = () => {
|
|
12756
|
+
setUnread(false);
|
|
12757
|
+
setNudge(void 0);
|
|
12758
|
+
writeUnread(false);
|
|
12759
|
+
};
|
|
12647
12760
|
const onShown = dock?.onShown;
|
|
12648
12761
|
useEffect(() => {
|
|
12649
12762
|
writeOpen(open);
|
|
12650
12763
|
onShown?.(open);
|
|
12764
|
+
if (open) seen();
|
|
12651
12765
|
}, [open, onShown]);
|
|
12652
12766
|
const onReady = dock?.onReady;
|
|
12653
12767
|
useLayoutEffect(() => {
|
|
@@ -12820,6 +12934,17 @@ function ShellRenderer({ turns, showMic, callPhase, micOpen, onToggleMic, onEndC
|
|
|
12820
12934
|
launcher: view.launcher,
|
|
12821
12935
|
...view.handoff && operatorName !== void 0 ? { operatorName } : {},
|
|
12822
12936
|
launcherInitials: view.launcher.initials ? handoffInitials(operatorName) : "",
|
|
12937
|
+
launcherNudge: {
|
|
12938
|
+
unread,
|
|
12939
|
+
unreadLabel: messages.dock_unread,
|
|
12940
|
+
...nudge !== void 0 ? { nudge } : {},
|
|
12941
|
+
dismissLabel: messages.dock_float_dismiss,
|
|
12942
|
+
onDismissNudge: () => {
|
|
12943
|
+
seen();
|
|
12944
|
+
dock?.onNudgeDismiss?.();
|
|
12945
|
+
},
|
|
12946
|
+
onNudgeHold: setHeld
|
|
12947
|
+
},
|
|
12823
12948
|
...dock?.layout?.launcher !== void 0 ? { launcherVariant: dock.layout.launcher } : {},
|
|
12824
12949
|
...agentName ? { agentName } : {},
|
|
12825
12950
|
typing: view.typing,
|
|
@@ -15281,6 +15406,8 @@ function stripCartLineIds(cart) {
|
|
|
15281
15406
|
function useChatSession(options) {
|
|
15282
15407
|
const { embedKey, attribution, apiBase = DEFAULT_API_BASE, pollIntervalMs = DEFAULT_POLL_INTERVAL_MS, idlePollIntervalMs = DEFAULT_IDLE_POLL_INTERVAL_MS, lightPollIntervalMs = DEFAULT_LIGHT_POLL_INTERVAL_MS, socketUrl, socketPath = DEFAULT_SOCKET_PATH, collector, hostRoutes } = options;
|
|
15283
15408
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
15409
|
+
const pageFormsRef = useRef(options.pageForms);
|
|
15410
|
+
pageFormsRef.current = options.pageForms;
|
|
15284
15411
|
const socketFactory = options.socketImpl;
|
|
15285
15412
|
const now = useMemo(() => options.now ?? (() => Date.now()), []);
|
|
15286
15413
|
const [turns, setTurns] = useState([]);
|
|
@@ -16426,6 +16553,7 @@ function useChatSession(options) {
|
|
|
16426
16553
|
release();
|
|
16427
16554
|
setTurns((prev) => prev.filter((t) => t.id !== callerTurnId && t.id !== agentTurnId));
|
|
16428
16555
|
};
|
|
16556
|
+
const pageForms = pageFormsRef.current?.();
|
|
16429
16557
|
const postChat = (cart) => fetchImpl(withEmbedKeyParam(`${apiBase}/chat`, embedKey), {
|
|
16430
16558
|
method: "POST",
|
|
16431
16559
|
headers: {
|
|
@@ -16434,7 +16562,8 @@ function useChatSession(options) {
|
|
|
16434
16562
|
},
|
|
16435
16563
|
body: JSON.stringify({
|
|
16436
16564
|
...payload,
|
|
16437
|
-
...cart ? { cart } : {}
|
|
16565
|
+
...cart ? { cart } : {},
|
|
16566
|
+
...pageForms !== void 0 ? { pageForms } : {}
|
|
16438
16567
|
})
|
|
16439
16568
|
});
|
|
16440
16569
|
let res;
|
|
@@ -18885,6 +19014,28 @@ var TurnOrderClock = class {
|
|
|
18885
19014
|
return stamp;
|
|
18886
19015
|
}
|
|
18887
19016
|
};
|
|
19017
|
+
var SKIP = "[role=search],[hidden],[aria-hidden=true]";
|
|
19018
|
+
var SENSITIVE = "input[type=password],input[type=file],[autocomplete^=cc-]";
|
|
19019
|
+
var TYPED = "textarea,select,input:not([type]),input[type=\"\"],input[type=text],input[type=email],input[type=tel],input[type=url],input[type=number]";
|
|
19020
|
+
function shown(form) {
|
|
19021
|
+
const check = form.checkVisibility;
|
|
19022
|
+
if (check) return check.call(form, { checkVisibilityCSS: true });
|
|
19023
|
+
for (let node = form; node; node = node.parentElement) {
|
|
19024
|
+
const style = getComputedStyle(node);
|
|
19025
|
+
if (style.display === "none" || style.visibility === "hidden") return false;
|
|
19026
|
+
}
|
|
19027
|
+
return true;
|
|
19028
|
+
}
|
|
19029
|
+
function countPageForms(doc) {
|
|
19030
|
+
if (!doc) return void 0;
|
|
19031
|
+
try {
|
|
19032
|
+
let count = 0;
|
|
19033
|
+
for (const form of Array.from(doc.forms).slice(0, 50)) if (!form.closest(SKIP) && !form.querySelector(SENSITIVE) && form.querySelectorAll(TYPED).length > 1 && shown(form) && ++count >= 20) break;
|
|
19034
|
+
return count;
|
|
19035
|
+
} catch {
|
|
19036
|
+
return;
|
|
19037
|
+
}
|
|
19038
|
+
}
|
|
18888
19039
|
//#endregion
|
|
18889
19040
|
//#region src/host-widget.tsx
|
|
18890
19041
|
/**
|
|
@@ -18931,6 +19082,10 @@ var ACT_HOLD_MAX_MS = 15e3;
|
|
|
18931
19082
|
function isActEvent(event) {
|
|
18932
19083
|
return event.type === "navigate" || event.type === "filter" || event.type === "spotlight" || event.type === "capture-card" || event.type === "capture-saved" || event.type === "fill-form";
|
|
18933
19084
|
}
|
|
19085
|
+
/** SAA-514: the host page's enquiry-shaped forms, sent with each turn (see `page-forms.ts`). */
|
|
19086
|
+
function readPageForms() {
|
|
19087
|
+
return countPageForms(typeof document === "undefined" ? void 0 : document);
|
|
19088
|
+
}
|
|
18934
19089
|
/**
|
|
18935
19090
|
* Do two storefront paths name the same PAGE — ignoring the query, the
|
|
18936
19091
|
* fragment and a trailing slash?
|
|
@@ -19289,7 +19444,7 @@ function brandColor(primary) {
|
|
|
19289
19444
|
tone: "light"
|
|
19290
19445
|
};
|
|
19291
19446
|
}
|
|
19292
|
-
function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages = defaultWidgetMessages, locale = "en", productHref, hostRoutes, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, privacyChoices, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, starters, voiceAvailable, direction, proactive, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, cartLineIds }) {
|
|
19447
|
+
function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages = defaultWidgetMessages, locale = "en", productHref, hostRoutes, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, privacyChoices, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, starters, voiceAvailable, direction, proactive, onNudgeDismiss, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, cartLineIds }) {
|
|
19293
19448
|
/**
|
|
19294
19449
|
* Maps the tenant's semantic config fields onto the widget's historical
|
|
19295
19450
|
* CSS custom properties — this is the "one becomes the other" site
|
|
@@ -19325,7 +19480,8 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
19325
19480
|
...socketUrl !== void 0 ? { socketUrl } : {},
|
|
19326
19481
|
...socketPath !== void 0 ? { socketPath } : {},
|
|
19327
19482
|
...collector ? { collector } : {},
|
|
19328
|
-
...hostRouteDeclaration ? { hostRoutes: hostRouteDeclaration } : {}
|
|
19483
|
+
...hostRouteDeclaration ? { hostRoutes: hostRouteDeclaration } : {},
|
|
19484
|
+
pageForms: readPageForms
|
|
19329
19485
|
});
|
|
19330
19486
|
const chatToken = session.chatToken;
|
|
19331
19487
|
const canReachVoiceToken = apiBase !== void 0 && chatToken !== void 0;
|
|
@@ -19836,6 +19992,13 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
19836
19992
|
useEffect(() => {
|
|
19837
19993
|
inCallRef.current = inCall;
|
|
19838
19994
|
}, [inCall]);
|
|
19995
|
+
useEffect(() => {
|
|
19996
|
+
if (inCall && captureCard !== null && captureCard.checkout === void 0) showCaptureCard(null);
|
|
19997
|
+
}, [
|
|
19998
|
+
inCall,
|
|
19999
|
+
captureCard,
|
|
20000
|
+
showCaptureCard
|
|
20001
|
+
]);
|
|
19839
20002
|
useEffect(() => {
|
|
19840
20003
|
streamingRef.current = session.status === "streaming";
|
|
19841
20004
|
}, [session.status]);
|
|
@@ -21159,6 +21322,7 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
21159
21322
|
...cardImageAspect !== void 0 ? { cardImageAspect } : {},
|
|
21160
21323
|
...direction !== void 0 ? { direction } : {},
|
|
21161
21324
|
...proactive !== void 0 ? { proactive } : {},
|
|
21325
|
+
...onNudgeDismiss !== void 0 ? { onNudgeDismiss } : {},
|
|
21162
21326
|
channel: inCall ? "voice" : "text",
|
|
21163
21327
|
...partialTranscript !== void 0 ? { partialTranscript } : {},
|
|
21164
21328
|
reconnecting: session.resuming || voiceEnabled && voice.phase === "disconnected",
|
|
@@ -21210,7 +21374,7 @@ function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bri
|
|
|
21210
21374
|
...attribution !== void 0 ? { attribution } : {},
|
|
21211
21375
|
...privacyChoices !== void 0 ? { privacyChoices } : {},
|
|
21212
21376
|
dock: dockProps,
|
|
21213
|
-
...captureCard !== null ? {
|
|
21377
|
+
...captureCard !== null && (!inCall || captureCard.checkout !== void 0) ? {
|
|
21214
21378
|
captureCard: /* @__PURE__ */ jsx(CaptureCardHost, { options: captureCard }),
|
|
21215
21379
|
captureChoices: captureCard.card.choices
|
|
21216
21380
|
} : {}
|
package/dist/dock/dock.d.ts
CHANGED
|
@@ -523,6 +523,11 @@ export interface DockProps {
|
|
|
523
523
|
readonly onReady?: () => void;
|
|
524
524
|
/** SAA-449: whether the transcript is on screen (the sheet is up), for read receipts. */
|
|
525
525
|
readonly onShown?: (shown: boolean) => void;
|
|
526
|
+
/**
|
|
527
|
+
* SAA-511 — the shopper dismissed the proactive opener (`cdn/core.ts`
|
|
528
|
+
* reports it). Only the widget generation's launcher draws a × for it.
|
|
529
|
+
*/
|
|
530
|
+
readonly onNudgeDismiss?: () => void;
|
|
526
531
|
}
|
|
527
532
|
/** §5.1 — "labelled the first two times per visitor, icon after". */
|
|
528
533
|
export declare const INTERRUPT_LABEL_LIMIT = 2;
|
package/dist/dock/dock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dock.d.ts","sourceRoot":"","sources":["../../src/dock/dock.tsx"],"names":[],"mappings":"AAEA,OAAO,EASL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAwC,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAOjG,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAGL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"dock.d.ts","sourceRoot":"","sources":["../../src/dock/dock.tsx"],"names":[],"mappings":"AAEA,OAAO,EASL,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAwC,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAOjG,OAAO,EAAwC,KAAK,c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AQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CACtC;AAUD,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AAEpE,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAgsDpC;AAmND,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-css.d.ts","sourceRoot":"","sources":["../../src/generated/widget-css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"widget-css.d.ts","sourceRoot":"","sources":["../../src/generated/widget-css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,EAAE,MAA0gpE,CAAC"}
|
package/dist/host-widget.d.ts
CHANGED
|
@@ -447,6 +447,8 @@ export interface ConciergeWidgetProps {
|
|
|
447
447
|
readonly direction?: 'ltr' | 'rtl';
|
|
448
448
|
/** §5.6 — a proactive rule fired; the line it wants in the caption for 8 s. */
|
|
449
449
|
readonly proactive?: string;
|
|
450
|
+
/** SAA-511 — the shopper pressed the × on that line (`cdn/core.ts` reports it). */
|
|
451
|
+
readonly onNudgeDismiss?: () => void;
|
|
450
452
|
/**
|
|
451
453
|
* Called if this widget's OWN render throws — never surfaced to the host
|
|
452
454
|
* page otherwise (see `error-boundary.tsx`). Optional; the default is to
|
|
@@ -556,5 +558,5 @@ export type ConciergeHostProps = ConciergeWidgetProps & {
|
|
|
556
558
|
* when the caller did not. See `renderers.ts` for why they are two functions.
|
|
557
559
|
*/
|
|
558
560
|
export declare function ConciergeWidget({ renderer, ...props }: ConciergeWidgetProps): import("react").JSX.Element;
|
|
559
|
-
export declare function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages, locale, productHref, hostRoutes, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, privacyChoices, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, starters, voiceAvailable, direction, proactive, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, cartLineIds, }: ConciergeHostProps): import("react").JSX.Element;
|
|
561
|
+
export declare function ConciergeHost({ renderer, embedKey, apiBase, socketUrl, socketPath, bridge, siteProfile, collector, messages, locale, productHref, hostRoutes, curationHref, brandPrimary, brandSecondary, brandAccent, avatar, attribution, privacyChoices, color, type, identity, layout, copy, bottomOffset, showPrice, cardImageAspect, starters, voiceAvailable, direction, proactive, onNudgeDismiss, initialDraft, initialSelection, initialFocus, initialMinimised, insets, hold, audio, onReady, cartLineIds, }: ConciergeHostProps): import("react").JSX.Element;
|
|
560
562
|
//# sourceMappingURL=host-widget.d.ts.map
|