@syntrologie/adapt-chatbot 2.52.0 → 2.54.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/AdaptiveChatBarMountable.d.ts.map +1 -1
- package/dist/LeaveAMessageLit.d.ts +68 -9
- package/dist/LeaveAMessageLit.d.ts.map +1 -1
- package/dist/findSmartCanvas.d.ts +19 -0
- package/dist/findSmartCanvas.d.ts.map +1 -0
- package/dist/runtime.js +729 -456
- package/dist/runtime.js.map +4 -4
- package/dist/schema.d.ts +72 -4
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +17 -0
- package/dist/schema.js.map +2 -2
- package/dist/support-chat/__tests__/lc-fetch-stub.d.ts +26 -1
- package/dist/support-chat/__tests__/lc-fetch-stub.d.ts.map +1 -1
- package/dist/support-chat/boot.d.ts +35 -3
- package/dist/support-chat/boot.d.ts.map +1 -1
- package/dist/support-chat/inbox.d.ts +57 -0
- package/dist/support-chat/inbox.d.ts.map +1 -0
- package/dist/support-chat/inbox.test.d.ts +2 -0
- package/dist/support-chat/inbox.test.d.ts.map +1 -0
- package/dist/support-chat/leadconnector.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdaptiveChatBarMountable.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatBarMountable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,wBAAwB,EAI9B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"AdaptiveChatBarMountable.d.ts","sourceRoot":"","sources":["../src/AdaptiveChatBarMountable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,wBAAwB,EAI9B,MAAM,4BAA4B,CAAC;AAmBpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAQvE,OAAO,KAAK,EAAmB,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAsIxE;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,CAIjD;AA6BD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExE;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,IAAI,CAgB/F;AA+DD;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE;IAC9C,kBAAkB,CAAC,EAAE,wBAAwB,CAAC;CAC/C,GAAG,CAAC,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,QAAQ,KAAK,gBAAgB,CAkC5D;AAOD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAkDxF;AAED,6EAA6E;AAC7E,wBAAgB,0BAA0B,IAAI,IAAI,CAMjD;AAsGD,0BAA0B;AAC1B,wBAAgB,6BAA6B,IAAI,IAAI,CAEpD;AA0ED,wBAAgB,+BAA+B,IAAI,IAAI,CAUtD;AAyID,eAAO,MAAM,wBAAwB;qBAClB,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAI;sBA4G9D,WAAW,gBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAQ5E,CAAC"}
|
|
@@ -41,7 +41,21 @@
|
|
|
41
41
|
import { LitElement, nothing } from 'lit';
|
|
42
42
|
import './AdaptiveChatTrail.js';
|
|
43
43
|
import type { SupportChatBridge } from './support-chat/types';
|
|
44
|
+
/** One line of the visitor↔operator conversation, persisted so a page
|
|
45
|
+
* remount can rebuild the exact transcript in order. */
|
|
46
|
+
export interface TranscriptEntry {
|
|
47
|
+
role: 'visitor' | 'operator';
|
|
48
|
+
text: string;
|
|
49
|
+
}
|
|
50
|
+
/** Namespace + key the widget persists {state, transcript, email} under
|
|
51
|
+
* via `runtime.state.ns()` (I2, final-review fixes 2026-08-13) —
|
|
52
|
+
* see `LeaveAMessageLit#_loadPersisted` / `#_persist`. The page-level
|
|
53
|
+
* inbox (support-chat/inbox.ts) writes the same record when a team
|
|
54
|
+
* message arrives with no card mounted, so the next card picks it up. */
|
|
55
|
+
export declare const LEAVE_A_MESSAGE_PERSIST_NAMESPACE = "supportchat";
|
|
56
|
+
export declare const LEAVE_A_MESSAGE_PERSIST_KEY = "leave-a-message";
|
|
44
57
|
export type LeaveAMessageState = 'form' | 'email' | 'sent' | 'mail' | 'flipped';
|
|
58
|
+
export declare function liveLeaveAMessageCards(): ReadonlySet<LeaveAMessageLit>;
|
|
45
59
|
/**
|
|
46
60
|
* Every visitor-facing string on this card — authored entirely by the
|
|
47
61
|
* workspace (`default_widget_props.copy`), same pattern as `replyToast`.
|
|
@@ -101,7 +115,7 @@ export interface LeaveAMessageRuntime {
|
|
|
101
115
|
};
|
|
102
116
|
/**
|
|
103
117
|
* Optional persistence seam (I2, final-review fixes 2026-08-13) — mirrors
|
|
104
|
-
* adaptive-overlays' `WorkflowWidgetLit.runtimeRef?.state?.
|
|
118
|
+
* adaptive-overlays' `WorkflowWidgetLit.runtimeRef?.state?.ns?.(...)`
|
|
105
119
|
* pattern exactly. On an MPA the tile unmounts and remounts fresh per
|
|
106
120
|
* page; without this, a visitor who already sent a message and is
|
|
107
121
|
* waiting on a reply loses that thread on their very next click (state
|
|
@@ -110,14 +124,18 @@ export interface LeaveAMessageRuntime {
|
|
|
110
124
|
* widget still works, it just can't survive navigation.
|
|
111
125
|
*/
|
|
112
126
|
state?: {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
set: (key: string, value: unknown) => void;
|
|
117
|
-
};
|
|
127
|
+
ns?: (namespace: string) => {
|
|
128
|
+
get: (key: string) => unknown;
|
|
129
|
+
set: (key: string, value: unknown) => void;
|
|
118
130
|
};
|
|
119
131
|
};
|
|
120
132
|
}
|
|
133
|
+
/** Shape persisted under `runtime.state.ns('supportchat')`. */
|
|
134
|
+
export interface PersistedLeaveAMessage {
|
|
135
|
+
state?: LeaveAMessageState;
|
|
136
|
+
transcript?: TranscriptEntry[];
|
|
137
|
+
email?: string;
|
|
138
|
+
}
|
|
121
139
|
export declare class LeaveAMessageLit extends LitElement {
|
|
122
140
|
static properties: {
|
|
123
141
|
bridge: {
|
|
@@ -188,10 +206,23 @@ export declare class LeaveAMessageLit extends LitElement {
|
|
|
188
206
|
* in `_submitMessage`. */
|
|
189
207
|
private _transcript;
|
|
190
208
|
private _unsubscribe;
|
|
209
|
+
private _readyUnsub;
|
|
191
210
|
createRenderRoot(): HTMLElement;
|
|
192
211
|
connectedCallback(): void;
|
|
193
212
|
updated(): void;
|
|
194
213
|
disconnectedCallback(): void;
|
|
214
|
+
/** Is this card's own vendor subscription delivering replies? While it
|
|
215
|
+
* is, the page-level inbox leaves every message to the card. */
|
|
216
|
+
get isListening(): boolean;
|
|
217
|
+
/** Hand the card a team message that arrived through the page-level
|
|
218
|
+
* inbox (support-chat/inbox.ts) while the card was mounted but not yet
|
|
219
|
+
* listening — a compose-step card the concierge put up moments before
|
|
220
|
+
* the team's own message landed. */
|
|
221
|
+
receiveOperatorMessage(text: string): void;
|
|
222
|
+
/** Open the thread face — what tapping the mail face or an announcement
|
|
223
|
+
* does. Used by the page-level inbox when its announcement is tapped
|
|
224
|
+
* after a card has already mounted and hydrated the thread. */
|
|
225
|
+
showThread(): void;
|
|
195
226
|
/** Read the injected persistence store, if any (I2). */
|
|
196
227
|
private _persistStore;
|
|
197
228
|
/** Hydrate {state, transcript, email} from a prior page's mount. */
|
|
@@ -199,13 +230,41 @@ export declare class LeaveAMessageLit extends LitElement {
|
|
|
199
230
|
/** Snapshot {state, transcript, email} so the NEXT mount (a fresh page
|
|
200
231
|
* in the same session) can pick the thread back up. */
|
|
201
232
|
private _persist;
|
|
233
|
+
/** The pending reply announcement, if the canvas gave us a handle to it. */
|
|
234
|
+
private _noticeHandle;
|
|
235
|
+
/**
|
|
236
|
+
* Is the visitor LOOKING at this card right now? True only when the card
|
|
237
|
+
* has a laid-out box inside the viewport, the document is visible, and a
|
|
238
|
+
* hit-test at the card's center lands on the card itself — so a deck card
|
|
239
|
+
* stacked behind another, a card under a maximized chat, or a closed
|
|
240
|
+
* canvas all read as "not on screen". The hit-test descends through open
|
|
241
|
+
* shadow roots (`document.elementFromPoint` stops at the outermost host).
|
|
242
|
+
* Canvas-agnostic on purpose: the card never asks a canvas which tile is
|
|
243
|
+
* front. Anything this can't evaluate (jsdom, no layout) is "not on
|
|
244
|
+
* screen": when unsure, announce — a missed reply costs more than an
|
|
245
|
+
* extra toast.
|
|
246
|
+
*/
|
|
247
|
+
private _isOnScreen;
|
|
248
|
+
/** The tile id sc-mount stamps on every widget's container, so the card can
|
|
249
|
+
* name itself to the canvas when the visitor taps its announcement. */
|
|
250
|
+
private _instanceId;
|
|
251
|
+
/**
|
|
252
|
+
* Tap on the reply announcement: open the thread and ask the canvas to
|
|
253
|
+
* bring this tile to the front. `tile-recall` is the same composed event
|
|
254
|
+
* AdaptiveChatBar already raises for its own recalls — velvet cycles the
|
|
255
|
+
* deck to the card and un-maximizes the chat; the host opens the canvas
|
|
256
|
+
* if it was closed.
|
|
257
|
+
*/
|
|
258
|
+
private _recall;
|
|
202
259
|
/**
|
|
203
|
-
*
|
|
260
|
+
* Announce a reply through the canvas element. Pierces shadow roots to
|
|
204
261
|
* find `<smart-canvas>` (same resolution AdaptiveChatBarMountable uses), and
|
|
205
262
|
* no-ops when no canvas is present — the tile's own "You got mail!" face is
|
|
206
|
-
* always the durable signal.
|
|
263
|
+
* always the durable signal. The announcement is PERSISTENT: a human's
|
|
264
|
+
* reply is the one thing the visitor was waiting on, so it stays until
|
|
265
|
+
* tapped or until the visitor opens the thread themselves (`_flip`).
|
|
207
266
|
*/
|
|
208
|
-
private
|
|
267
|
+
private _announceReply;
|
|
209
268
|
/** Paint our own focus ring from the theme. The border now lives on the
|
|
210
269
|
* field SHELL (`data-lam-field-wrap`), not the borderless inner
|
|
211
270
|
* textarea/input, so the ring targets that ancestor via `closest()`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LeaveAMessageLit.d.ts","sourceRoot":"","sources":["../src/LeaveAMessageLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAQ,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGhD,OAAO,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"LeaveAMessageLit.d.ts","sourceRoot":"","sources":["../src/LeaveAMessageLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,EAAQ,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGhD,OAAO,wBAAwB,CAAC;AAIhC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAmQ9D;yDACyD;AACzD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;0EAI0E;AAC1E,eAAO,MAAM,iCAAiC,gBAAgB,CAAC;AAC/D,eAAO,MAAM,2BAA2B,oBAAoB,CAAC;AAI7D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAIhF,wBAAgB,sBAAsB,IAAI,WAAW,CAAC,gBAAgB,CAAC,CAEtE;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IACh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Aa,CAAsC;IAE3D;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,WAAW;IAwBnB;4EACwE;IACxE,OAAO,CAAC,WAAW;IAInB;;;;;;OAMG;IACH,OAAO,CAAC,OAAO,CAOb;IAEF;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IA2BtB;;6EAEyE;IACzE,OAAO,CAAC,QAAQ,CAKd;IAEF,OAAO,CAAC,SAAS,CAIf;IAEF,OAAO,CAAC,QAAQ,CAmCd;IAEF;;;;;iDAK6C;IAC7C,OAAO,CAAC,cAAc,CAQpB;IAEF;;gFAE4E;IAC5E,OAAO,CAAC,YAAY,CAQlB;IAEF;;;8BAG0B;IAC1B,OAAO,CAAC,UAAU,CAIhB;IAEF,OAAO,CAAC,KAAK,CAQX;IAEF;;;;;;sCAMkC;IAClC,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,UAAU,CAWhB;IAEF,2EAA2E;IAC3E,OAAO,CAAC,gBAAgB;IAIxB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,UAAU,CAKhB;IAEO,MAAM;CAiNhB;AAED,wEAAwE;AACxE,wBAAgB,wBAAwB,IAAI,IAAI,CAI/C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The host canvas element's notification seam, as the adaptives use it. */
|
|
2
|
+
export interface SmartCanvasNotificationHost extends HTMLElement {
|
|
3
|
+
previewNotification?: (opts: {
|
|
4
|
+
title: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
ttl?: number;
|
|
7
|
+
persistent?: boolean;
|
|
8
|
+
onTap?: () => void;
|
|
9
|
+
}) => {
|
|
10
|
+
dismiss: () => void;
|
|
11
|
+
} | undefined | void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Find the page's `<smart-canvas>`, piercing open shadow roots: the canvas
|
|
15
|
+
* usually lives inside one (live finding: a plain `document.querySelector`
|
|
16
|
+
* never found it and the toast silently no-op'd).
|
|
17
|
+
*/
|
|
18
|
+
export declare function findSmartCanvas(): SmartCanvasNotificationHost | null;
|
|
19
|
+
//# sourceMappingURL=findSmartCanvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findSmartCanvas.d.ts","sourceRoot":"","sources":["../src/findSmartCanvas.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,WAAW,2BAA4B,SAAQ,WAAW;IAC9D,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC3B,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;KACpB,KAAK;QAAE,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,GAAG,SAAS,GAAG,IAAI,CAAC;CAClD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,2BAA2B,GAAG,IAAI,CAepE"}
|